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

:root {
    --font-sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, "Segoe UI Variable", "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
    --font-display: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", system-ui, "Segoe UI Variable Display", "Segoe UI Variable", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    --text: #ffffff;
    --text-dim: rgba(255, 255, 255, 0.72);
    --stroke: rgba(255, 255, 255, 0.14);
    --card: rgba(255, 255, 255, 0.08);
    --card-strong: rgba(255, 255, 255, 0.10);

    --blue-600: #2563EB;
    --blue-500: #3B82F6;
    --blue-400: #60A5FA;
    --sky-400: #38BDF8;

    --seconds-progress: 0;

    --spring-accent: rgba(147, 197, 253, 0.18);
    --summer-accent: rgba(56, 189, 248, 0.22);
    --autumn-accent: rgba(59, 130, 246, 0.14);
    --winter-accent: rgba(96, 165, 250, 0.20);
}

body {
    font-family: var(--font-sans);
    background: #050914;
    color: var(--text);
    height: 100vh;
    overflow: hidden;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.app {
    position: relative;
    width: 100%;
    height: 100vh;
    display: grid;
    place-items: center;
    isolation: isolate;
}

.bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.bg-glow {
    position: absolute;
    inset: -20vh -20vw;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.06) 0%, transparent 40%),
        radial-gradient(circle at calc(var(--seconds-progress) * 100%) 22%, rgba(96, 165, 250, 0.14) 0%, transparent 45%),
        radial-gradient(ellipse at center, rgba(59, 130, 246, 0.12) 0%, transparent 65%);
    filter: blur(0px);
    transition: background 500ms ease;
}

.app[data-season="spring"] .bg-glow {
    background:
        radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.08) 0%, transparent 42%),
        radial-gradient(circle at calc(var(--seconds-progress) * 100%) 22%, var(--spring-accent) 0%, transparent 45%),
        radial-gradient(ellipse at center, rgba(59, 130, 246, 0.10) 0%, transparent 65%);
}

.app[data-season="summer"] .bg-glow {
    background:
        radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.10) 0%, transparent 42%),
        radial-gradient(circle at calc(var(--seconds-progress) * 100%) 22%, var(--summer-accent) 0%, transparent 45%),
        radial-gradient(ellipse at center, rgba(56, 189, 248, 0.10) 0%, transparent 65%);
}

.app[data-season="autumn"] .bg-glow {
    background:
        radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.06) 0%, transparent 42%),
        radial-gradient(circle at calc(var(--seconds-progress) * 100%) 22%, var(--autumn-accent) 0%, transparent 45%),
        radial-gradient(ellipse at center, rgba(37, 99, 235, 0.10) 0%, transparent 65%);
}

.app[data-season="winter"] .bg-glow {
    background:
        radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.07) 0%, transparent 42%),
        radial-gradient(circle at calc(var(--seconds-progress) * 100%) 22%, var(--winter-accent) 0%, transparent 45%),
        radial-gradient(ellipse at center, rgba(59, 130, 246, 0.12) 0%, transparent 65%);
}

.snow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.snowflake {
    position: absolute;
    top: -10px;
    color: white;
    font-size: 1em;
    opacity: 0.8;
    animation: fall linear infinite;
}

@keyframes fall {
    0% {
        transform: translateY(-10px) rotate(0deg);
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
    }
}

.card {
    position: relative;
    z-index: 2;
    width: min(1000px, calc(100vw - 64px));
    padding: 64px 56px 48px;
    border-radius: 40px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.11) 0%, rgba(255, 255, 255, 0.06) 100%);
    border: 1px solid var(--stroke);
    box-shadow:
        0 40px 100px rgba(0, 0, 0, 0.45),
        0 0 80px rgba(59, 130, 246, 0.18);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    display: grid;
    gap: 22px;
    isolation: isolate;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background:
        radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.12) 0%, transparent 42%),
        radial-gradient(circle at 82% 24%, rgba(96, 165, 250, 0.14) 0%, transparent 46%);
    opacity: 0.9;
    z-index: 0;
    pointer-events: none;
}

.card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.10) 0%, transparent 42%, rgba(0, 0, 0, 0.14) 100%);
    z-index: 0;
    pointer-events: none;
}

.card > * {
    position: relative;
    z-index: 1;
}

.card-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
}

.date {
    font-size: 18px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-dim);
    font-weight: 500;
}

.season {
    font-size: 14px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    font-weight: 500;
}

.time {
    display: grid;
    justify-items: center;
    gap: 10px;
}

.time-row {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 10px;
    font-variant-numeric: tabular-nums;
    font-family: var(--font-display);
    letter-spacing: -0.03em;
    line-height: 1.02;
    font-weight: 300;
    font-size: clamp(72px, 11.5vw, 168px);
    color: rgba(255, 255, 255, 0.96);
    text-shadow: 0 0 22px rgba(96, 165, 250, 0.14);
    transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1), opacity 320ms ease;
}

.time-row.is-tick {
    animation: tick 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes tick {
    0% {
        opacity: 0.92;
        transform: translateY(2px);
        filter: blur(0.3px);
    }
    100% {
        opacity: 1;
        transform: translateY(0px);
        filter: blur(0px);
    }
}

.t {
    display: inline-block;
    min-width: 2ch;
}

.sep {
    display: inline-block;
    min-width: 0.4ch;
    opacity: 0.72;
    transform: translateY(-0.04em);
}

.period {
    font-size: 18px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.62);
    font-weight: 500;
}

.flow {
    position: relative;
    height: 12px;
    display: grid;
    align-items: center;
}

.flow-track {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.10);
}

.flow-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(96, 165, 250, 0.0) 0%, rgba(96, 165, 250, 0.55) 35%, rgba(255, 255, 255, 0.60) 100%);
    box-shadow: 0 0 24px rgba(96, 165, 250, 0.24);
    transition: width 120ms linear;
}


.controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding-top: 10px;
}

.btn {
    height: 48px;
    width: 48px;
    min-width: 48px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.92);
    cursor: pointer;
    transition: transform 160ms ease, background 200ms ease, border-color 200ms ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon {
    color: rgba(255, 255, 255, 0.90);
}

.btn:hover .icon {
    color: rgba(255, 255, 255, 0.98);
}

.btn:hover {
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(255, 255, 255, 0.24);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0px) scale(0.99);
}

.btn.is-active {
    background: linear-gradient(180deg, rgba(96, 165, 250, 0.22) 0%, rgba(96, 165, 250, 0.10) 100%);
    border-color: rgba(96, 165, 250, 0.40);
}

.btn-text {
    font-size: 14px;
    letter-spacing: 0.10em;
    text-transform: uppercase;
}

.app.is-fullscreen .card {
    width: min(1500px, calc(100vw - 80px));
    padding: 104px 84px 76px;
    border-radius: 52px;
}

.app.is-fullscreen .time-row {
    font-size: clamp(140px, 15vw, 280px);
}

.app.is-fullscreen .date {
    font-size: 20px;
}

.app.is-fullscreen .period {
    font-size: 20px;
}

.app.is-fullscreen .flow {
    height: 14px;
}

.app.is-fullscreen .controls {
    gap: 14px;
}

.app.is-fullscreen .btn {
    height: 56px;
    width: 56px;
    min-width: 56px;
}

@media (max-width: 768px) {
    .card {
        width: calc(100vw - 28px);
        padding: 28px 18px 20px;
        border-radius: 26px;
        gap: 18px;
    }

    .date {
        font-size: 14px;
    }

    .season {
        font-size: 12px;
    }

    .flow {
        height: 9px;
    }

    .btn {
        height: 46px;
        width: 46px;
        min-width: 46px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bg-glow,
    .btn {
        transition: none;
    }

    .snowflake {
        animation: none;
    }
}
