:root {
    --primary: #0d6efd;
    --bg: #f4f6f8;
    --card: #ffffff;
    --muted: #6b7280;
    --text: #0f1724;
    --card-radius: 16px;
    --ring-width: 10;
}

/* layout */
html, body {
    height: 100%;
}

body {
    margin: 0;
    padding: 28px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    background: linear-gradient(180deg, #eef2f7 0%, var(--bg) 100%);
    -webkit-font-smoothing: antialiased;
}

.countdown-card {
    width: 100%;
    max-width: 940px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), var(--card) 80%);
    padding: 24px;
    border-radius: var(--card-radius);
    box-shadow: 0 18px 40px rgba(10, 15, 25, 0.06);
    border: 1px solid rgba(15, 23, 36, 0.04);
    position: relative;
    overflow: visible;
}

.title-row {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 18px;
}

.title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 1px;
}

/* 4 items - never wrap, shrink to fit */
.row-4 {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    flex-wrap: nowrap;
}

.item {
    flex: 1 1 0;
    text-align: center;
    min-width: 0;
}

/* ring container */
.ring {
    width: min(120px, 18.5vw);
    aspect-ratio: 1/1;
    margin: 0 auto;
    padding: 8px;
    border-radius: 999px;
    position: relative;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.06));
    filter: drop-shadow(0 8px 18px rgba(13, 110, 253, 0.06));
}

    .ring svg {
        width: 100%;
        height: 100%;
        transform: rotate(-90deg);
        display: block;
    }

.value {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-weight: 800;
    color: var(--text);
    font-size: clamp(0.95rem, 3.1vw, 1.45rem);
    transform-origin: center;
}

.label {
    margin-top: 10px;
    font-size: clamp(0.62rem, 1.9vw, 0.85rem);
    color: var(--muted);
    letter-spacing: 1px;
}

.base {
    stroke: rgba(8, 12, 20, 0.06);
    stroke-width: var(--ring-width);
    fill: none;
}

.progress {
    stroke-width: var(--ring-width);
    stroke-linecap: round;
    fill: none;
    transition: stroke-dashoffset 600ms linear;
    stroke: var(--primary);
}

/* --- animations --- */
@keyframes pop {
    0% {
        transform: scale(1);
        filter: blur(0);
    }

    35% {
        transform: scale(1.18);
        filter: blur(0.2px);
    }

    100% {
        transform: scale(1);
        filter: blur(0);
    }
}

@keyframes ringPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.06);
        opacity: 0.98;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes cardPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 18px 40px rgba(10, 15, 25, 0.06);
    }

    50% {
        transform: scale(1.02);
        box-shadow: 0 30px 60px rgba(13, 110, 253, 0.08);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 18px 40px rgba(10, 15, 25, 0.06);
    }
}

/* confetti particle animation */
@keyframes confettiFall {
    0% {
        transform: translateY(-10px) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(240px) rotate(360deg);
        opacity: 0;
    }
}

/* utility classes toggled by JS */
.pop {
    animation: pop 420ms cubic-bezier(.2, .9, .25, 1);
}

.ring-animate {
    animation: ringPulse 520ms ease;
}

.card-end {
    animation: cardPulse 800ms ease;
}

.confetti {
    position: absolute;
    left: 50%;
    top: 10%;
    pointer-events: none;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    overflow: visible;
}

    .confetti .piece {
        position: absolute;
        width: 10px;
        height: 14px;
        opacity: 0.95;
        border-radius: 2px;
        animation: confettiFall linear forwards;
    }

/* respects reduced motion */
@media (prefers-reduced-motion: reduce) {
    .pop, .ring-animate, .card-end, .confetti .piece {
        animation: none !important;
        transition: none !important;
    }

    .progress {
        transition: none !important;
    }
}

/* smaller devices */
@media (max-width: 520px) {
    .ring {
        width: min(96px, 22vw);
        padding: 6px;
    }
}

@media (max-width: 360px) {
    .ring {
        width: min(74px, 24vw);
        padding: 4px;
    }

    .title {
        font-size: 1rem;
    }
}
