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

/* The hidden attribute must win over display:flex/grid rules */
[hidden] {
    display: none !important;
}

/* Back to main site link */
.back-link {
    position: fixed;
    top: 15px;
    left: 15px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: bold;
    z-index: 100;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.back-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
}

/* ========================================
   ACCESSIBILITY STYLES
   ======================================== */

/* Skip Navigation Link */
.skip-link {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: #000;
    color: #fff;
    padding: 12px 24px;
    text-decoration: none;
    font-weight: bold;
    z-index: 10000;
    border-radius: 0 0 8px 8px;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid #FFD700;
    outline-offset: 2px;
}

/* Screen Reader Only (visually hidden but accessible) */
.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;
}

/* Focus Indicators */
*:focus {
    outline: 2px solid #FFD700;
    outline-offset: 2px;
}

*:focus:not(:focus-visible) {
    outline: none;
}

*:focus-visible {
    outline: 3px solid #FFD700;
    outline-offset: 3px;
    box-shadow: 0 0 0 6px rgba(255, 215, 0, 0.3);
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
    outline: 3px solid #FFD700;
    outline-offset: 3px;
    box-shadow: 0 0 0 6px rgba(255, 215, 0, 0.3);
}

/* ========================================
   END ACCESSIBILITY STYLES
   ======================================== */

body {
    /* Theme tokens (countdown / night defaults; count-up overrides below) */
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    --text-color: #fff;
    --stars-opacity: 1;

    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    color: var(--text-color);
    transition: color 1s ease;
    overflow-x: hidden;
    position: relative;
}

/* Animated stars background */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: var(--stars-opacity);
    transition: opacity 2s ease;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    animation: twinkle linear infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

/* Hourglass */
.hourglass-container {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    opacity: 0.95;
    transition: all 0.3s ease;
}

.hourglass-container:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.05);
}

.hourglass {
    display: flex;
    flex-direction: column;
    align-items: center;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.3));
    animation: gentleSway 4s ease-in-out infinite;
}

@keyframes gentleSway {
    0%, 100% {
        transform: rotate(-1deg);
    }
    50% {
        transform: rotate(1deg);
    }
}

.hourglass-frame-top,
.hourglass-frame-bottom {
    width: 140px;
    height: 15px;
    background: linear-gradient(135deg,
        #8B4513 0%,
        #D2691E 50%,
        #8B4513 100%);
    border-radius: 8px;
    box-shadow:
        inset 0 2px 5px rgba(0, 0, 0, 0.4),
        0 3px 10px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 2;
}

.hourglass-frame-top::before,
.hourglass-frame-bottom::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    height: 3px;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 215, 0, 0.3),
        transparent);
}

.hourglass-top-bulb,
.hourglass-bottom-bulb {
    width: 120px;
    height: 140px;
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.2) 0%,
        rgba(255, 255, 255, 0.35) 50%,
        rgba(255, 255, 255, 0.2) 100%);
    border-radius: 50%;
    position: relative;
    border: 3px solid rgba(255, 255, 255, 0.4);
    box-shadow:
        inset -10px -10px 30px rgba(0, 0, 0, 0.2),
        inset 10px 10px 30px rgba(255, 255, 255, 0.3),
        0 0 30px rgba(255, 215, 0, 0.3);
    overflow: hidden;
}

.hourglass-top-bulb {
    margin-top: -5px;
    border-bottom-left-radius: 50% 30%;
    border-bottom-right-radius: 50% 30%;
}

.hourglass-bottom-bulb {
    margin-bottom: -5px;
    border-top-left-radius: 50% 30%;
    border-top-right-radius: 50% 30%;
}

.sand-top {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 100%;
    background: linear-gradient(to bottom,
        #FFD700 0%,
        #FFA500 50%,
        #FF8C00 100%);
    border-radius: 50%;
    transition: height 1s ease-out;
    overflow: hidden;
}

.sand-surface {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(to bottom,
        rgba(255, 215, 0, 0.8),
        rgba(255, 165, 0, 0.6));
    border-radius: 50%;
    animation: sandShimmer 2s ease-in-out infinite;
}

@keyframes sandShimmer {
    0%, 100% {
        opacity: 0.8;
        transform: scaleX(1);
    }
    50% {
        opacity: 1;
        transform: scaleX(0.95);
    }
}

.sand-bottom {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 0%;
    background: linear-gradient(to top,
        #FF8C00 0%,
        #FFA500 50%,
        #FFD700 100%);
    border-radius: 50%;
    transition: height 1s ease-out;
    overflow: hidden;
}

.sand-surface-bottom {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 15px;
    background: linear-gradient(to bottom,
        rgba(255, 215, 0, 0.9),
        rgba(255, 165, 0, 0.7));
    border-radius: 50%;
    animation: sandPile 1.5s ease-in-out infinite;
}

@keyframes sandPile {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-2px);
    }
}

.hourglass-neck {
    width: 20px;
    height: 40px;
    background: linear-gradient(to bottom,
        rgba(255, 255, 255, 0.3),
        rgba(255, 255, 255, 0.1));
    clip-path: polygon(30% 0%, 70% 0%, 100% 100%, 0% 100%);
    position: relative;
    z-index: 1;
    margin: -8px 0;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
}

.sand-stream {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 100%;
    opacity: 1;
}

.sand-particle {
    position: absolute;
    width: 3px;
    height: 6px;
    background: radial-gradient(circle,
        #FFD700,
        #FFA500);
    border-radius: 50%;
    animation: sandFall linear infinite;
    box-shadow: 0 0 3px rgba(255, 215, 0, 0.8);
}

.sand-particle:nth-child(1) {
    left: 2px;
    animation-duration: 1.5s;
    animation-delay: 0s;
}

.sand-particle:nth-child(2) {
    left: 4px;
    animation-duration: 1.3s;
    animation-delay: 0.2s;
}

.sand-particle:nth-child(3) {
    left: 1px;
    animation-duration: 1.6s;
    animation-delay: 0.4s;
}

.sand-particle:nth-child(4) {
    left: 3px;
    animation-duration: 1.4s;
    animation-delay: 0.6s;
}

.sand-particle:nth-child(5) {
    left: 2px;
    animation-duration: 1.5s;
    animation-delay: 0.8s;
}

.sand-particle:nth-child(6) {
    left: 4px;
    animation-duration: 1.7s;
    animation-delay: 1s;
}

.sand-particle:nth-child(7) {
    left: 1px;
    animation-duration: 1.4s;
    animation-delay: 1.2s;
}

.sand-particle:nth-child(8) {
    left: 3px;
    animation-duration: 1.6s;
    animation-delay: 1.4s;
}

@keyframes sandFall {
    0% {
        top: -5px;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        top: 100%;
        opacity: 0;
    }
}

.glass-shine-top,
.glass-shine-bottom {
    position: absolute;
    top: 20%;
    left: 20%;
    width: 35px;
    height: 50px;
    background: radial-gradient(ellipse at 30% 30%,
        rgba(255, 255, 255, 0.7) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
    transform: rotate(-25deg);
}

.glass-shine-bottom {
    top: auto;
    bottom: 20%;
}

.hourglass-label {
    margin-top: 15px;
    font-size: 0.85rem;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.95);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    text-align: center;
    animation: labelGlow 2s ease-in-out infinite;
}

@keyframes labelGlow {
    0%, 100% {
        text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    }
    50% {
        text-shadow:
            0 2px 8px rgba(0, 0, 0, 0.5),
            0 0 20px rgba(255, 215, 0, 0.6);
    }
}

/* Hide hourglass on mobile/tablet for space */
@media (max-width: 1024px) {
    .hourglass-container {
        display: none;
    }
}

/* Thermometer */
.thermometer-container {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    opacity: 0.95;
    transition: all 0.3s ease;
}

.thermometer-container:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.05);
}

.thermometer {
    display: flex;
    flex-direction: column;
    align-items: center;
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.3));
}

.thermometer-tube {
    width: 60px;
    height: 450px;
    background: linear-gradient(90deg,
        rgba(255, 255, 255, 0.15) 0%,
        rgba(255, 255, 255, 0.25) 50%,
        rgba(255, 255, 255, 0.15) 100%);
    border-radius: 30px;
    position: relative;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.4);
    box-shadow:
        inset -5px 0 15px rgba(255, 255, 255, 0.3),
        inset 5px 0 15px rgba(0, 0, 0, 0.2),
        0 0 30px rgba(255, 255, 255, 0.2);
}

.thermometer-liquid {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 0%;
    background: linear-gradient(to top,
        #4facfe 0%,
        #00f2fe 20%,
        #667eea 40%,
        #764ba2 60%,
        #f093fb 80%,
        #ff6b6b 100%);
    border-radius: 20px;
    transition: height 1s ease-out;
    box-shadow:
        0 0 20px rgba(255, 107, 107, 0.5),
        inset 0 0 10px rgba(255, 255, 255, 0.3);
    animation: liquidPulse 3s ease-in-out infinite;
}

@keyframes liquidPulse {
    0%, 100% {
        box-shadow:
            0 0 20px rgba(255, 107, 107, 0.5),
            inset 0 0 10px rgba(255, 255, 255, 0.3);
    }
    50% {
        box-shadow:
            0 0 40px rgba(255, 107, 107, 0.8),
            inset 0 0 20px rgba(255, 255, 255, 0.5);
    }
}

.thermometer-shine {
    position: absolute;
    left: 15%;
    top: 0;
    width: 15px;
    height: 100%;
    background: linear-gradient(to right,
        rgba(255, 255, 255, 0.6) 0%,
        rgba(255, 255, 255, 0.1) 100%);
    border-radius: 10px 0 0 10px;
    pointer-events: none;
}

.bubble {
    position: absolute;
    background: radial-gradient(circle at 30% 30%,
        rgba(255, 255, 255, 0.8),
        rgba(255, 255, 255, 0.2));
    border-radius: 50%;
    animation: bubbleRise linear infinite;
}

.bubble:nth-child(1) {
    width: 8px;
    height: 8px;
    left: 25%;
    animation-duration: 4s;
    animation-delay: 0s;
}

.bubble:nth-child(2) {
    width: 12px;
    height: 12px;
    left: 60%;
    animation-duration: 5s;
    animation-delay: 1s;
}

.bubble:nth-child(3) {
    width: 6px;
    height: 6px;
    left: 40%;
    animation-duration: 3.5s;
    animation-delay: 2s;
}

.bubble:nth-child(4) {
    width: 10px;
    height: 10px;
    left: 70%;
    animation-duration: 4.5s;
    animation-delay: 0.5s;
}

.bubble:nth-child(5) {
    width: 7px;
    height: 7px;
    left: 30%;
    animation-duration: 6s;
    animation-delay: 3s;
}

@keyframes bubbleRise {
    0% {
        bottom: -10px;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        bottom: 100%;
        opacity: 0;
    }
}

.thermometer-markings {
    position: absolute;
    top: 0;
    left: 100%;
    width: 100%;
    height: 100%;
    padding-left: 10px;
}

.marking {
    position: absolute;
    display: flex;
    align-items: center;
    width: 100%;
}

.marking::before {
    content: '';
    width: 15px;
    height: 2px;
    background: rgba(255, 255, 255, 0.6);
    margin-right: 5px;
}

.marking.major::before {
    width: 25px;
    height: 3px;
    background: rgba(255, 255, 255, 0.9);
}

.marking span {
    font-size: 0.75rem;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
}

.marking[data-days="730"] { top: 2%; }
.marking[data-days="365"] { top: 15%; }
.marking[data-days="180"] { top: 35%; }
.marking[data-days="100"] { top: 50%; }
.marking[data-days="50"] { top: 65%; }
.marking[data-days="30"] { top: 75%; }
.marking[data-days="7"] { top: 88%; }
.marking[data-days="0"] { bottom: 0%; }

.thermometer-bulb {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.2) 0%,
        rgba(255, 255, 255, 0.35) 50%,
        rgba(255, 255, 255, 0.2) 100%);
    border-radius: 50%;
    position: relative;
    margin-top: -10px;
    border: 4px solid rgba(255, 255, 255, 0.5);
    box-shadow:
        inset -10px -10px 30px rgba(0, 0, 0, 0.2),
        inset 10px 10px 30px rgba(255, 255, 255, 0.3),
        0 0 40px rgba(255, 107, 107, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: bulbGlow 2s ease-in-out infinite;
}

@keyframes bulbGlow {
    0%, 100% {
        box-shadow:
            inset -10px -10px 30px rgba(0, 0, 0, 0.2),
            inset 10px 10px 30px rgba(255, 255, 255, 0.3),
            0 0 40px rgba(255, 107, 107, 0.4);
    }
    50% {
        box-shadow:
            inset -10px -10px 30px rgba(0, 0, 0, 0.2),
            inset 10px 10px 30px rgba(255, 255, 255, 0.3),
            0 0 60px rgba(255, 107, 107, 0.8);
    }
}

.bulb-liquid {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 30%,
        rgba(255, 107, 107, 0.8),
        rgba(245, 87, 108, 0.6));
    border-radius: 50%;
    animation: bulbLiquidPulse 2s ease-in-out infinite;
}

@keyframes bulbLiquidPulse {
    0%, 100% {
        transform: scale(0.95);
        opacity: 0.8;
    }
    50% {
        transform: scale(1);
        opacity: 1;
    }
}

.bulb-shine {
    position: absolute;
    top: 15%;
    left: 20%;
    width: 30px;
    height: 30px;
    background: radial-gradient(circle,
        rgba(255, 255, 255, 0.6) 0%,
        rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
}

.bulb-days {
    font-size: 2rem;
    font-weight: bold;
    color: #fff;
    text-shadow:
        0 0 10px rgba(255, 255, 255, 0.8),
        0 2px 5px rgba(0, 0, 0, 0.5);
    z-index: 2;
    animation: daysPulse 1s ease-in-out infinite;
}

@keyframes daysPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.bulb-label {
    font-size: 0.65rem;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 2px;
    z-index: 2;
    margin-top: -5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Hide thermometer on mobile/tablet for space */
@media (max-width: 1024px) {
    .thermometer-container {
        display: none;
    }
}

/* Container */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 15px;
    position: relative;
    z-index: 1;
}

/* Title */
.title {
    text-align: center;
    font-size: 2.5rem;
    margin: 20px 0 8px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    animation: pulse 2s ease-in-out infinite;
}

.subtitle {
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: 20px;
    opacity: 0.9;
    font-style: italic;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* Date setter */
.date-setter {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 25px;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.date-setter label {
    font-size: 1rem;
    margin-right: 10px;
    font-weight: bold;
}

.date-setter input {
    padding: 8px 12px;
    font-size: 0.95rem;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    margin-right: 8px;
}

.date-setter button {
    padding: 8px 20px;
    font-size: 0.95rem;
    border: none;
    border-radius: 6px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.date-setter button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Main countdown */
.main-countdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.countdown-item {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.countdown-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.countdown-item.large {
    padding: 20px 15px;
}

.countdown-item .value {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    animation: countPulse 1s ease-in-out infinite;
}

.countdown-item.large .value {
    font-size: 2.5rem;
}

.countdown-item .label {
    display: block;
    font-size: 0.9rem;
    margin-top: 8px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

@keyframes countPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Alternate views */
.alternate-views {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 25px;
}

/* Fun metrics */
.fun-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 25px;
}

.metric-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.metric-card:hover {
    transform: scale(1.03) rotate(1deg);
    border-color: rgba(255, 255, 255, 0.5);
}

.metric-icon {
    font-size: 2rem;
    margin-bottom: 6px;
    animation: bounce 2s ease-in-out infinite;
}

.metric-value {
    font-size: 1.8rem;
    font-weight: bold;
    margin: 6px 0;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.metric-label {
    font-size: 0.8rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Progress section */
.progress-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.progress-section h2 {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.progress-timeline {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.timeline-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    min-width: 90px;
}

.marker-icon {
    font-size: 2rem;
    animation: float 3s ease-in-out infinite;
}

.timeline-marker.start .marker-icon {
    animation-delay: 0s;
}

.timeline-marker.end .marker-icon {
    animation-delay: 1.5s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

.marker-date {
    font-size: 0.9rem;
    font-weight: bold;
    text-align: center;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.marker-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.85;
    text-align: center;
}

.progress-bar {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50px;
    height: 35px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
    flex: 1;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #f093fb, #f5576c);
    border-radius: 50px;
    transition: width 0.5s ease;
    box-shadow: 0 0 20px rgba(245, 87, 108, 0.5);
    animation: shimmer 2s linear infinite;
}

@keyframes shimmer {
    0% { background-position: -100% 0; }
    100% { background-position: 100% 0; }
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.1rem;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.progress-description {
    text-align: center;
    font-size: 1rem;
    margin-top: 12px;
    font-weight: bold;
}

/* Milestones */
.milestone-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.milestone-section h2 {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 25px;
}

.milestones-container {
    position: relative;
    padding: 20px 0;
}

.milestone-timeline-line {
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 3px;
    background: linear-gradient(90deg,
        rgba(255, 255, 255, 0.2) 0%,
        rgba(255, 255, 255, 0.4) 50%,
        rgba(255, 255, 255, 0.2) 100%);
    transform: translateY(-50%);
    z-index: 0;
    border-radius: 2px;
}

#milestones {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    align-items: stretch;
    position: relative;
    z-index: 1;
}

.milestone {
    background: rgba(255, 255, 255, 0.15);
    padding: 15px 20px;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.4s ease;
    min-width: 120px;
    position: relative;
}

/* Locked milestone (future) */
.milestone.locked {
    background: rgba(100, 100, 100, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.15);
    opacity: 0.5;
    filter: grayscale(0.7);
}

.milestone.locked .milestone-emoji {
    display: none;
}

.milestone.locked .milestone-text,
.milestone.locked .milestone-days {
    opacity: 0.6;
}

/* Active milestone (approaching) */
.milestone.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: 3px solid #f5576c;
    transform: scale(1.08);
    box-shadow: 0 0 25px rgba(245, 87, 108, 0.6), 0 8px 20px rgba(0, 0, 0, 0.3);
    animation: activePulse 2s ease-in-out infinite;
}

@keyframes activePulse {
    0%, 100% {
        box-shadow: 0 0 25px rgba(245, 87, 108, 0.6), 0 8px 20px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(245, 87, 108, 0.9), 0 12px 30px rgba(0, 0, 0, 0.4);
    }
}

/* Achieved milestone (passed) */
.milestone.achieved {
    background: linear-gradient(135deg, #11998e, #38ef7d);
    border: 2px solid #38ef7d;
}

.milestone.achieved .milestone-emoji {
    display: none;
}

.milestone-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 50px;
    height: 50px;
}

.milestone-icon {
    font-size: 2rem;
    transition: all 0.3s ease;
}

.milestone.active .milestone-icon {
    animation: bounce 1.5s ease-in-out infinite;
}

.milestone-emoji {
    position: absolute;
    font-size: 1.5rem;
    top: -8px;
    right: -8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    padding: 3px;
}

.milestone-text {
    font-size: 0.9rem;
    font-weight: bold;
    text-align: center;
    line-height: 1.2;
}

.milestone-days {
    font-size: 0.75rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.milestone:hover {
    transform: translateY(-3px) scale(1.02);
}

.milestone.locked:hover {
    transform: translateY(-2px) scale(1.01);
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Motivation section */
.motivation-section {
    text-align: center;
    padding: 20px;
    margin-bottom: 25px;
}

.motivation-quote {
    font-size: 1.3rem;
    font-weight: bold;
    font-style: italic;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    animation: fadeInOut 10s ease-in-out infinite;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Confetti */
#confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    animation: fall linear forwards;
}

@keyframes fall {
    to {
        transform: translateY(100vh) rotate(360deg);
    }
}

/* Notification */
.notification {
    position: fixed;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    font-size: 1rem;
    font-weight: bold;
    z-index: 2000;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

/* Celebration overlay (shown only when a live countdown reaches zero) */
.celebration {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 900;
    overflow: auto;
    padding: 20px;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    text-align: center;
    animation: rainbow 5s linear infinite;
}

.celebration-title {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: bounce 1s ease-in-out infinite;
}

.celebration-subtitle {
    font-size: 3rem;
    margin-bottom: 30px;
}

.celebration-message {
    font-size: 2rem;
    margin-bottom: 40px;
}

.celebration-emoji {
    font-size: 5rem;
    animation: spin 3s linear infinite;
}

.reset-button {
    margin-top: 40px;
    padding: 20px 40px;
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 3px solid #fff;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.reset-button:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

@keyframes rainbow {
    0% { background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%); }
    25% { background: linear-gradient(135deg, #f093fb 0%, #667eea 50%, #764ba2 100%); }
    50% { background: linear-gradient(135deg, #764ba2 0%, #f093fb 50%, #667eea 100%); }
    75% { background: linear-gradient(135deg, #667eea 0%, #f093fb 50%, #764ba2 100%); }
    100% { background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
    .title {
        font-size: 2.5rem;
    }

    .subtitle {
        font-size: 1.2rem;
    }

    .countdown-item .value {
        font-size: 2rem;
    }

    .countdown-item.large .value {
        font-size: 3rem;
    }

    .date-setter {
        padding: 15px;
    }

    .date-setter label {
        display: block;
        margin-bottom: 10px;
    }

    .date-setter input,
    .date-setter button {
        display: block;
        width: 100%;
        margin: 10px 0;
    }

    .progress-timeline {
        flex-direction: column;
        gap: 10px;
    }

    .timeline-marker {
        min-width: 100%;
    }

    .marker-date {
        font-size: 0.85rem;
    }

    .milestone-timeline-line {
        display: none;
    }

    #milestones {
        flex-direction: column;
        align-items: center;
    }

    .milestone {
        width: 90%;
        max-width: 280px;
    }

    .celebration-title {
        font-size: 3rem;
    }

    .celebration-subtitle {
        font-size: 2rem;
    }
}

/* ========================================
   REDUCED MOTION SUPPORT
   For users who prefer reduced motion
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    /* Disable specific animations */
    .star,
    .confetti,
    .bubble,
    .sand-particle {
        animation: none !important;
    }

    .hourglass {
        animation: none !important;
        transform: none !important;
    }

    .hourglass-container,
    .thermometer-container {
        transform: translateY(-50%) !important;
    }

    .hourglass-container:hover,
    .thermometer-container:hover {
        transform: translateY(-50%) !important;
    }

    /* Keep essential visual feedback */
    .skip-link:focus {
        transition: top 0.01ms !important;
    }
}

/* ========================================
   HIGH CONTRAST MODE SUPPORT
   ======================================== */
@media (prefers-contrast: high) {
    body {
        background: #000;
    }

    .container,
    .date-setter,
    .countdown-item,
    .metric-card,
    .progress-section,
    .milestone-section {
        border: 2px solid #fff;
    }

    .progress-fill {
        background: #FFD700 !important;
    }

    .title,
    .subtitle,
    .value,
    .label,
    .metric-label {
        color: #fff !important;
        opacity: 1 !important;
    }
}

/* ========================================
   COUNT-UP MODE (dawn theme)
   Applied when the retirement date is in the past.
   ======================================== */

body.mode-countup {
    --bg-gradient: linear-gradient(160deg, #ffb88c 0%, #f6d365 45%, #a1c4fd 100%);
    --text-color: #3a2f45;
    --stars-opacity: 0;
}

/* Glass surfaces need more opacity on a light background */
body.mode-countup .date-setter,
body.mode-countup .metric-card,
body.mode-countup .progress-section,
body.mode-countup .milestone-section,
body.mode-countup .countup-hero,
body.mode-countup .comparisons-section,
body.mode-countup .personal-section {
    background: rgba(255, 255, 255, 0.38);
    border-color: rgba(255, 255, 255, 0.7);
}

body.mode-countup .milestone {
    background: rgba(255, 255, 255, 0.45);
    border-color: rgba(255, 255, 255, 0.8);
}

body.mode-countup .milestone.locked {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(58, 47, 69, 0.15);
    opacity: 0.6;
}

body.mode-countup .milestone.active {
    background: linear-gradient(135deg, #f6a35a, #e07a5f);
    border-color: #fff;
    color: #fff;
    box-shadow: 0 8px 20px rgba(224, 122, 95, 0.35);
    animation: none;
}

body.mode-countup .milestone.achieved {
    background: linear-gradient(135deg, #8fd3b6, #5fb89a);
    border-color: #5fb89a;
    color: #1f3b30;
}

body.mode-countup .milestone-emoji {
    background: rgba(255, 255, 255, 0.6);
}

body.mode-countup .milestone-timeline-line {
    background: linear-gradient(90deg,
        rgba(58, 47, 69, 0.05) 0%,
        rgba(58, 47, 69, 0.25) 50%,
        rgba(58, 47, 69, 0.05) 100%);
}

/* Flatten the glow effects */
body.mode-countup .title,
body.mode-countup .metric-value,
body.mode-countup .motivation-quote,
body.mode-countup .marker-date,
body.mode-countup .progress-text {
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.4);
}

body.mode-countup .subtitle {
    opacity: 0.8;
}

/* Calm: switch off the busiest animations */
body.mode-countup .title,
body.mode-countup .metric-icon,
body.mode-countup .marker-icon,
body.mode-countup .motivation-quote,
body.mode-countup .progress-fill,
body.mode-countup .milestone.active .milestone-icon,
body.mode-countup .bulb-days,
body.mode-countup .hourglass-label,
body.mode-countup .thermometer-liquid {
    animation: none;
}

body.mode-countup .metric-card:hover {
    transform: translateY(-3px);
}

/* Accents: warm sunrise instead of purple */
body.mode-countup .date-setter button,
body.mode-countup .notification {
    background: linear-gradient(135deg, #f6a35a, #e07a5f);
    color: #fff;
}

body.mode-countup .progress-fill {
    background: linear-gradient(90deg, #f6a35a, #e07a5f);
    box-shadow: 0 0 12px rgba(224, 122, 95, 0.35);
}

body.mode-countup .progress-bar {
    background: rgba(58, 47, 69, 0.12);
}

body.mode-countup .progress-text {
    color: #3a2f45;
}

body.mode-countup .back-link {
    color: #3a2f45;
    background: rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.7);
}

body.mode-countup .back-link:hover {
    color: #1f1626;
    background: rgba(255, 255, 255, 0.6);
}

body.mode-countup .date-setter-details summary {
    color: #3a2f45;
}

body.mode-countup .hourglass-label,
body.mode-countup .bulb-days,
body.mode-countup .bulb-label,
body.mode-countup .marking span {
    color: #3a2f45;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

body.mode-countup .thermometer-liquid {
    background: linear-gradient(to top, #e07a5f 0%, #f6a35a 60%, #f6d365 100%);
    box-shadow: 0 0 12px rgba(224, 122, 95, 0.35), inset 0 0 10px rgba(255, 255, 255, 0.3);
}

/* Count-up hero */
.countup-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 30px 20px 24px;
    margin-bottom: 25px;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.countup-days {
    display: block;
    font-size: clamp(4.5rem, 16vw, 9rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.countup-label {
    display: block;
    margin-top: 10px;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    opacity: 0.85;
}

.countup-breakdown {
    margin-top: 14px;
    font-size: 1.3rem;
    font-style: italic;
    opacity: 0.9;
}

/* Comparisons */
.comparisons-section,
.personal-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.comparisons-section h2,
.personal-section h2 {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 16px;
}

.comparisons-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: 0;
    margin: 0 0 12px;
}

.comparison-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 18px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.8);
    min-width: 150px;
}

.comparison-label {
    font-weight: bold;
    text-align: center;
}

.comparison-label::first-letter {
    text-transform: uppercase;
}

.comparison-days {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.75;
}

.comparisons-next,
.stats-updated {
    text-align: center;
    font-size: 0.95rem;
    opacity: 0.8;
    font-style: italic;
}

.personal-metrics {
    margin-bottom: 8px;
}

/* Thermometer tick marks per mode */
.countup-marking {
    display: none;
}

body.mode-countup .marking[data-days] {
    display: none;
}

body.mode-countup .countup-marking {
    display: flex;
}

.countup-marking[data-mark="next"] { top: 2%; }
.countup-marking[data-mark="prev"] { bottom: 0%; }

/* Responsive tweaks for count-up components */
@media (max-width: 768px) {
    .countup-days {
        font-size: clamp(3.5rem, 20vw, 6rem);
    }

    .countup-breakdown {
        font-size: 1.1rem;
    }

    .comparisons-list {
        flex-direction: column;
        align-items: stretch;
    }

    .comparison-item {
        min-width: 0;
    }
}

/* High contrast: never put dark plum text on a black background */
@media (prefers-contrast: high) {
    body.mode-countup {
        --bg-gradient: #000;
        --text-color: #fff;
        background: #000;
        color: #fff;
    }

    body.mode-countup .date-setter,
    body.mode-countup .metric-card,
    body.mode-countup .progress-section,
    body.mode-countup .milestone-section,
    body.mode-countup .countup-hero,
    body.mode-countup .comparisons-section,
    body.mode-countup .personal-section,
    body.mode-countup .milestone,
    body.mode-countup .comparison-item {
        background: #000;
        border: 2px solid #fff;
        color: #fff;
    }

    body.mode-countup .progress-text,
    body.mode-countup .back-link,
    body.mode-countup .hourglass-label,
    body.mode-countup .bulb-days,
    body.mode-countup .bulb-label,
    body.mode-countup .marking span,
    body.mode-countup .date-setter-details summary {
        color: #fff;
    }
}

/* Date setter disclosure and reset control (both modes) */
.date-setter-details {
    margin-bottom: 25px;
}

.date-setter-details summary {
    cursor: pointer;
    text-align: center;
    font-size: 0.95rem;
    text-decoration: underline;
    text-underline-offset: 3px;
    opacity: 0.85;
    padding: 6px;
    list-style: none;
}

.date-setter-details summary::-webkit-details-marker {
    display: none;
}

.date-setter-details summary:hover {
    opacity: 1;
}

.date-setter-details[open] summary {
    margin-bottom: 10px;
}

.date-setter-details .date-setter {
    margin-bottom: 0;
}

.date-setter button.reset-link {
    background: transparent;
    box-shadow: none;
    font-weight: normal;
    text-decoration: underline;
    text-underline-offset: 3px;
    color: inherit;
    margin-left: 6px;
}

.date-setter button.reset-link:hover {
    transform: none;
    box-shadow: none;
    opacity: 0.8;
}
