* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a1a 0%, #000000 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: white;
}

.container {
    padding: 20px;
    width: min(100%, 760px);
}

.widget {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    padding: 3rem;
    border-radius: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(1);
    transition: transform 0.3s ease;
    width: 100%;
}

.widget:hover {
    transform: scale(1.015);
}

.today-label {
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
}

.counter {
    font-size: 6rem;
    font-weight: bold;
    background: linear-gradient(to right, #22d3ee, #3b82f6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-variant-numeric: tabular-nums;
}

.increment-button {
    position: relative;
    padding: 1rem 2rem;
    background: linear-gradient(to right, #22d3ee, #3b82f6);
    border: none;
    border-radius: 1rem;
    color: white;
    font-weight: 600;
    font-size: 1.125rem;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.save-button {
    width: 100%;
    padding: 0.95rem 1.2rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.08);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.key-button {
    align-self: stretch;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.9rem;
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.24);
    cursor: pointer;
    transition: color 0.2s ease;
}

.key-button:hover {
    color: rgba(255, 255, 255, 0.92);
}

.save-button:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.3);
}

.save-button:disabled {
    opacity: 0.7;
    cursor: wait;
}

.status-message {
    min-height: 1.25rem;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.78);
}

.status-message[data-state="error"] {
    color: #fca5a5;
}

.increment-button:hover {
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.3);
}

.increment-button:active {
    transform: scale(0.95);
}

.button-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.2);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.increment-button:hover .button-overlay {
    opacity: 1;
}

.button-content {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.history-panel {
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.history-header h2 {
    font-size: 1rem;
    font-weight: 700;
}

.history-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.history-header p {
    margin-top: 0.35rem;
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.9rem;
}

.history-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.45rem;
}

.history-stats span {
    border: 1px solid rgba(34, 211, 238, 0.22);
    border-radius: 999px;
    padding: 0.35rem 0.65rem;
    background: rgba(34, 211, 238, 0.08);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.78rem;
    font-weight: 700;
}

.chart {
    width: 100%;
    min-height: 300px;
    border-radius: 1.1rem;
    background:
        radial-gradient(circle at 22% 18%, rgba(34, 211, 238, 0.16), transparent 32%),
        radial-gradient(circle at 78% 14%, rgba(59, 130, 246, 0.18), transparent 36%),
        linear-gradient(to top, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.02)),
        linear-gradient(to right, rgba(34, 211, 238, 0.05), rgba(59, 130, 246, 0.12));
    padding: 0.85rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.chart svg {
    width: 100%;
    height: 300px;
    overflow: visible;
}

.chart-grid-line {
    stroke: rgba(255, 255, 255, 0.1);
    stroke-dasharray: 5 9;
}

.chart-area {
    fill: url("#chartAreaGradient");
    stroke: none;
}

.chart-line {
    fill: none;
    stroke: url("#chartLineGradient");
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
    filter: drop-shadow(0 0 10px rgba(34, 211, 238, 0.45));
}

.chart circle {
    fill: #07111f;
    stroke: #22d3ee;
    stroke-width: 3;
    filter: drop-shadow(0 0 8px rgba(34, 211, 238, 0.5));
}

.chart text {
    fill: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    font-weight: 700;
    text-anchor: middle;
}

.chart-axis-label {
    fill: rgba(255, 255, 255, 0.42);
    font-size: 12px;
    text-anchor: end;
}

.chart-date-label {
    fill: rgba(255, 255, 255, 0.55);
    font-size: 12px;
}

.chart-point {
    animation: point-pop 0.45s ease both;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.history-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 0.85rem;
    background: rgba(255, 255, 255, 0.06);
}

.empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
}

@media (max-width: 480px) {
    .widget {
        padding: 2rem;
    }
    
    .counter {
        font-size: 4rem;
    }
    
    .increment-button {
        padding: 0.75rem 1.5rem;
    }

    .chart {
        min-height: 220px;
    }

    .chart svg {
        height: 220px;
    }

    .history-header {
        flex-direction: column;
    }

    .history-stats {
        justify-content: flex-start;
    }

}

@keyframes point-pop {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
