/* ===== DESIGN SYSTEM VARIABLES ===== */
:root {
    --primary-blue: #2563eb;
    --primary-dark: #1d4ed8;
    --card-bg: #ffffff;
    --border: #e5e7eb;
    --text-primary: #111827;
    --text-secondary: #6b7280;

    /* Dynamic background colors (will be set by JavaScript) */
    --bg-gradient-start: #dbeafe;
    --bg-gradient-mid: #fef3c7;
    --bg-gradient-end: #fef3c7;
    --wave-color-1: rgba(37,99,235,0.15);
    --wave-color-2: rgba(16,185,129,0.12);
    --wave-color-3: rgba(245,158,11,0.1);
    --overlay-color: rgba(219, 234, 254, 0.4);
}

body {
    margin: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    /* Use CSS variables for gradient */
    background: linear-gradient(180deg, var(--bg-gradient-start) 0%, var(--bg-gradient-mid) 50%, var(--bg-gradient-end) 100%);
    position: relative;
    overflow: hidden;
    transition: background 2s ease;
}

/* Elevation profile waves background */
body::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100%;
    background-image:
        url("data:image/svg+xml,%3Csvg width='2400' height='600' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M0,300 C300,200 500,200 800,300 C1100,400 1300,400 1600,300 C1900,200 2100,200 2400,300 L2400,600 L0,600 Z' fill='var(--wave-color-1)'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg width='2400' height='600' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M0,360 C300,240 500,240 800,360 C1100,480 1300,480 1600,360 C1900,240 2100,240 2400,360 L2400,600 L0,600 Z' fill='var(--wave-color-2)'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg width='2400' height='600' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M0,400 C300,300 500,300 800,400 C1100,500 1300,500 1600,400 C1900,300 2100,300 2400,400 L2400,600 L0,600 Z' fill='var(--wave-color-3)'/%3E%3C/svg%3E");
    background-position: bottom left, bottom center, bottom right;
    background-repeat: repeat-x;
    background-size: 2400px 600px;
    pointer-events: none;
    transition: opacity 2s ease;
}

/* Dawn-specific waves */
body.dawn-time::before {
    background-image:
        url("data:image/svg+xml,%3Csvg width='2400' height='600' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M0,300 C300,200 500,200 800,300 C1100,400 1300,400 1600,300 C1900,200 2100,200 2400,300 L2400,600 L0,600 Z' fill='rgba(236,72,153,0.12)'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg width='2400' height='600' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M0,360 C300,240 500,240 800,360 C1100,480 1300,480 1600,360 C1900,240 2100,240 2400,360 L2400,600 L0,600 Z' fill='rgba(168,85,247,0.1)'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg width='2400' height='600' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M0,400 C300,300 500,300 800,400 C1100,500 1300,500 1600,400 C1900,300 2100,300 2400,400 L2400,600 L0,600 Z' fill='rgba(251,207,232,0.15)'/%3E%3C/svg%3E");
    background-position: bottom left, bottom center, bottom right;
    background-repeat: repeat-x;
    background-size: 2400px 600px;
}

/* Midday-specific waves */
body.midday-time::before {
    background-image:
        url("data:image/svg+xml,%3Csvg width='2400' height='600' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M0,300 C300,200 500,200 800,300 C1100,400 1300,400 1600,300 C1900,200 2100,200 2400,300 L2400,600 L0,600 Z' fill='rgba(37,99,235,0.15)'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg width='2400' height='600' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M0,360 C300,240 500,240 800,360 C1100,480 1300,480 1600,360 C1900,240 2100,240 2400,360 L2400,600 L0,600 Z' fill='rgba(16,185,129,0.12)'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg width='2400' height='600' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M0,400 C300,300 500,300 800,400 C1100,500 1300,500 1600,400 C1900,300 2100,300 2400,400 L2400,600 L0,600 Z' fill='rgba(245,158,11,0.1)'/%3E%3C/svg%3E");
    background-position: bottom left, bottom center, bottom right;
    background-repeat: repeat-x;
    background-size: 2400px 600px;
}

/* Sunset-specific waves */
body.sunset-time::before {
    background-image:
        url("data:image/svg+xml,%3Csvg width='2400' height='600' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M0,300 C300,200 500,200 800,300 C1100,400 1300,400 1600,300 C1900,200 2100,200 2400,300 L2400,600 L0,600 Z' fill='rgba(251,146,60,0.18)'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg width='2400' height='600' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M0,360 C300,240 500,240 800,360 C1100,480 1300,480 1600,360 C1900,240 2100,240 2400,360 L2400,600 L0,600 Z' fill='rgba(239,68,68,0.15)'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg width='2400' height='600' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M0,400 C300,300 500,300 800,400 C1100,500 1300,500 1600,400 C1900,300 2100,300 2400,400 L2400,600 L0,600 Z' fill='rgba(192,132,252,0.12)'/%3E%3C/svg%3E");
    background-position: bottom left, bottom center, bottom right;
    background-repeat: repeat-x;
    background-size: 2400px 600px;
}

/* Twilight-specific waves (keep them dark) */
body.twilight-time::before {
    background-image:
        url("data:image/svg+xml,%3Csvg width='2400' height='600' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M0,300 C300,200 500,200 800,300 C1100,400 1300,400 1600,300 C1900,200 2100,200 2400,300 L2400,600 L0,600 Z' fill='rgba(10,10,15,0.9)'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg width='2400' height='600' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M0,360 C300,240 500,240 800,360 C1100,480 1300,480 1600,360 C1900,240 2100,240 2400,360 L2400,600 L0,600 Z' fill='rgba(8,8,12,0.85)'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg width='2400' height='600' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M0,400 C300,300 500,300 800,400 C1100,500 1300,500 1600,400 C1900,300 2100,300 2400,400 L2400,600 L0,600 Z' fill='rgba(5,5,10,0.8)'/%3E%3C/svg%3E");
    background-position: bottom left, bottom center, bottom right;
    background-repeat: repeat-x;
    background-size: 2400px 600px;
}

/* Night-specific waves with darker but visible colors */
body.night-time::before {
    background-image:
        url("data:image/svg+xml,%3Csvg width='2400' height='600' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M0,300 C300,200 500,200 800,300 C1100,400 1300,400 1600,300 C1900,200 2100,200 2400,300 L2400,600 L0,600 Z' fill='rgba(30,41,59,0.4)'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg width='2400' height='600' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M0,360 C300,240 500,240 800,360 C1100,480 1300,480 1600,360 C1900,240 2100,240 2400,360 L2400,600 L0,600 Z' fill='rgba(15,23,42,0.35)'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg width='2400' height='600' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M0,400 C300,300 500,300 800,400 C1100,500 1300,500 1600,400 C1900,300 2100,300 2400,400 L2400,600 L0,600 Z' fill='rgba(2,6,23,0.3)'/%3E%3C/svg%3E");
    background-position: bottom left, bottom center, bottom right;
    background-repeat: repeat-x;
    background-size: 2400px 600px;
}
/* Top gradient overlay */
body::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg,
        var(--overlay-color) 0%,
        transparent 40%,
        transparent 100%
    );
    pointer-events: none;
    transition: background 2s ease;
}

/* Stars layer (only visible at night) with twinkle animation */
body.night-time::after {
    background-image:
        radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.4) 1.5px, transparent 1.5px),
        radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.3) 1px, transparent 1px),
        radial-gradient(circle at 45% 30%, rgba(255, 255, 255, 0.35) 1.5px, transparent 1.5px),
        radial-gradient(circle at 70% 60%, rgba(255, 255, 255, 0.25) 1px, transparent 1px),
        radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.3) 1px, transparent 1px),
        radial-gradient(circle at 90% 35%, rgba(255, 255, 255, 0.35) 1.5px, transparent 1.5px),
        radial-gradient(circle at 55% 55%, rgba(255, 255, 255, 0.25) 1px, transparent 1px),
        radial-gradient(circle at 10% 45%, rgba(255, 255, 255, 0.4) 1.5px, transparent 1.5px),
        radial-gradient(circle at 80% 28%, rgba(255, 255, 255, 0.3) 1px, transparent 1px),
        radial-gradient(circle at 35% 42%, rgba(255, 255, 255, 0.25) 1px, transparent 1px),
        radial-gradient(circle at 60% 10%, rgba(255, 255, 255, 0.35) 1.5px, transparent 1.5px),
        radial-gradient(circle at 20% 35%, rgba(255, 255, 255, 0.3) 1px, transparent 1px);
    background-size: 100% 100%;
}

/* Remove the twinkle animation from ::after */
body.night-time::after,
body.twilight-time::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}


body.night-time .card {
    background: linear-gradient(145deg, #fffbf0, #fef3c7);
    backdrop-filter: blur(10px);
    box-shadow:
        0 0 30px rgba(254, 243, 199, 0.4),
        0 0 60px rgba(254, 243, 199, 0.2),
        0 4px 6px rgba(0, 0, 0, 0.05),
        0 10px 25px rgba(0, 0, 0, 0.1);
    color: #111827;
}

/* Night theme - keep heading dark */
body.night-time .card h2 {
    color: #111827;
}

/* Night theme - adjust secondary button for light background */
body.night-time .secondary {
    background: white;
    color: #111827;
    border: 2px solid #e5e7eb;
}

body.night-time .secondary:hover {
    background: #f9fafb;
    border-color: #6b7280;
}



/* Individual twinkling stars container */
.stars {
    display: none !important;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
}

body.night-time .stars,
body.twilight-time .stars {
    display: block !important;
}

/* Individual star elements - slightly larger */
.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle 5s ease-in-out infinite;
}

/* Random, slower animation timing for each star */
.star:nth-child(1) { animation-duration: 4s; animation-delay: 0s; }
.star:nth-child(2) { animation-duration: 6s; animation-delay: 2s; }
.star:nth-child(3) { animation-duration: 5s; animation-delay: 4s; }
.star:nth-child(4) { animation-duration: 7s; animation-delay: 1s; }
.star:nth-child(5) { animation-duration: 5.5s; animation-delay: 3s; }
.star:nth-child(6) { animation-duration: 6.5s; animation-delay: 0.5s; }
.star:nth-child(7) { animation-duration: 4.5s; animation-delay: 2.5s; }
.star:nth-child(8) { animation-duration: 5.8s; animation-delay: 1.8s; }
.star:nth-child(9) { animation-duration: 6.2s; animation-delay: 3.5s; }
.star:nth-child(10) { animation-duration: 4.8s; animation-delay: 0.8s; }
.star:nth-child(11) { animation-duration: 5.3s; animation-delay: 2.2s; }
.star:nth-child(12) { animation-duration: 6.8s; animation-delay: 1.5s; }

/* More pronounced twinkling - brighter and more dramatic */
@keyframes twinkle {
    0%, 100% {
        opacity: 0.2; /* Dimmer at rest (was 0.3) */
        transform: scale(1);
        box-shadow: 0 0 3px rgba(255, 255, 255, 0.4);
    }
    50% {
        opacity: 1; /* Full brightness */
        transform: scale(1.5); /* Slightly larger when bright */
        box-shadow: 0 0 15px rgba(255, 255, 255, 1),
                    0 0 25px rgba(255, 255, 255, 0.6); /* Stronger glow */
    }
}




/* Rest of your CSS stays the same... */
.card {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 16px;
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.05),
        0 10px 25px rgba(0, 0, 0, 0.1);
    width: 380px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.card h2 {
    margin: 0 0 32px 0;
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

button {
    width: 100%;
    padding: 12px 20px;
    margin-top: 12px;
    font-size: 15px;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.primary {
    background: var(--primary-blue);
    color: white;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

.primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.secondary {
    background: white;
    color: var(--text-primary);
    border: 2px solid var(--border);
}

.secondary:hover {
    background: #f9fafb;
    border-color: var(--text-secondary);
    transform: translateY(-1px);
}

.secondary:active {
    transform: translateY(0);
}

/* Modal */
#auth-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 1000;
}

.modal-card {
    background: white;
    width: 360px;
    margin: 120px auto;
    padding: 24px;
    border-radius: 12px;
    box-sizing: border-box;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-card h3 {
    margin: 0 0 20px 0;
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 600;
}

.modal-card input {
    width: 100%;
    padding: 10px 12px;
    margin-top: 8px;
    font-size: 14px;
    box-sizing: border-box;
    border: 1px solid var(--border);
    border-radius: 6px;
    outline: none;
    transition: all 0.2s ease;
}

.modal-card input:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.instruction {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 12px;
    margin-bottom: 12px;
}

.close {
    float: right;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 24px;
    font-weight: bold;
    line-height: 1;
    transition: color 0.2s ease;
}

.close:hover {
    color: var(--text-primary);
}

.forgot-password {
    margin-top: 12px;
    font-size: 13px;
    color: var(--primary-blue);
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.forgot-password:hover {
    color: var(--primary-dark);
}

#reset-fields {
    display: none;
}


/* Twilight theme - soft purple tinted card with more transparency */
body.twilight-time .card {
    background: linear-gradient(145deg, rgba(243, 232, 255, 0.85), rgba(233, 213, 255, 0.85));
    backdrop-filter: blur(10px);
    box-shadow:
        0 0 30px rgba(233, 213, 255, 0.4),
        0 4px 6px rgba(0, 0, 0, 0.05),
        0 10px 25px rgba(0, 0, 0, 0.1);
    color: #1f2937;
}

/* Twilight theme - heading color */
body.twilight-time .card h2 {
    color: #581c87; /* Deep purple for contrast */
}

/* Twilight theme - primary button (make it stand out) */
body.twilight-time .primary {
    background: #7c3aed; /* Vibrant purple */
    color: white;
}

body.twilight-time .primary:hover {
    background: #6d28d9; /* Darker purple on hover */
}

/* Twilight theme - secondary button */
body.twilight-time .secondary {
    background: white;
    color: #581c87; /* Deep purple text */
    border: 2px solid #c4b5fd; /* Light purple border */
}

body.twilight-time .secondary:hover {
    background: #faf5ff; /* Very light purple on hover */
    border-color: #a78bfa; /* Medium purple border */
}

/* Animated moon (only visible during twilight) */
.moon {
    display: none !important;
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    /* Warmer yellow-tinted moon */
    background: radial-gradient(circle at 35% 35%, #fef3c7, #fde68a 40%, #eab308 100%);
    box-shadow:
        0 0 30px rgba(253, 230, 138, 0.6),
        0 0 60px rgba(253, 230, 138, 0.4),
        inset -8px -8px 15px rgba(0, 0, 0, 0.15);
    z-index: 3;
    pointer-events: none;

    /* Slow animation across the sky */
    animation: moonRise 180s linear infinite;
    /* Remove position: relative - this might be causing issues */
}

/* Craters using pseudo-elements and extra styling */
.moon::before,
.moon::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.05));
}

/* Large crater (top right) */
.moon::before {
    width: 18px;
    height: 18px;
    top: 20%;
    right: 25%;
    z-index: 4;
    box-shadow:
        inset 2px 2px 4px rgba(0, 0, 0, 0.3),
        /* Additional craters using box-shadow */
        -25px 15px 0 -2px rgba(0, 0, 0, 0.15),
        -10px 30px 0 -4px rgba(0, 0, 0, 0.12),
        15px 25px 0 -5px rgba(0, 0, 0, 0.1),
        -15px -5px 0 -6px rgba(0, 0, 0, 0.08),
        20px -8px 0 -3px rgba(0, 0, 0, 0.12),
        5px 35px 0 -6px rgba(0, 0, 0, 0.1);
}

/* Medium crater (lower left) */
.moon::after {
    width: 12px;
    height: 12px;
    bottom: 30%;
    left: 20%;
    z-index: 4;
    box-shadow:
        inset 2px 2px 3px rgba(0, 0, 0, 0.3),
        /* More small craters */
        20px -10px 0 -4px rgba(0, 0, 0, 0.12),
        10px 15px 0 -5px rgba(0, 0, 0, 0.1),
        -5px 20px 0 -6px rgba(0, 0, 0, 0.08);
}

body.twilight-time .moon {
    display: block !important;
}

@keyframes moonRise {
    0% {
        left: 5%;
        top: 20%;
        opacity: 0.7;
    }
    25% {
        left: 28%;
        top: 10%;
        opacity: 0.95;
    }
    50% {
        left: 50%;
        top: 5%;
        opacity: 1;
    }
    75% {
        left: 72%;
        top: 10%;
        opacity: 0.95;
    }
    100% {
        left: 95%;
        top: 20%;
        opacity: 0.7;
    }
}

/* Stars layer (only visible during twilight) */
body.twilight-time::after {
    background-image:
        radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.4) 1.5px, transparent 1.5px),
        radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.3) 1px, transparent 1px),
        radial-gradient(circle at 45% 30%, rgba(255, 255, 255, 0.35) 1.5px, transparent 1.5px),
        radial-gradient(circle at 70% 40%, rgba(255, 255, 255, 0.25) 1px, transparent 1px),
        radial-gradient(circle at 25% 50%, rgba(255, 255, 255, 0.3) 1px, transparent 1px),
        radial-gradient(circle at 90% 55%, rgba(255, 255, 255, 0.35) 1.5px, transparent 1.5px),
        radial-gradient(circle at 55% 65%, rgba(255, 255, 255, 0.25) 1px, transparent 1px),
        radial-gradient(circle at 10% 45%, rgba(255, 255, 255, 0.4) 1.5px, transparent 1.5px),
        radial-gradient(circle at 80% 50%, rgba(255, 255, 255, 0.3) 1px, transparent 1px),
        radial-gradient(circle at 35% 60%, rgba(255, 255, 255, 0.25) 1px, transparent 1px),
        radial-gradient(circle at 60% 10%, rgba(255, 255, 255, 0.35) 1.5px, transparent 1.5px),
        radial-gradient(circle at 20% 35%, rgba(255, 255, 255, 0.3) 1px, transparent 1px);
    background-size: 100% 100%;
    opacity: 0.8;
    z-index: 1;
}

/* Train scene (only visible during midday) */
.train-scene {
    display: none !important;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 250px; /* Increased from 150px to fit lighthouse */
    z-index: 2;
    pointer-events: none;
}

body.midday-time .train-scene {
    display: block !important;
}

/* Grass strip with texture */
.grass {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background:
        linear-gradient(to bottom, #7cb342 0%, #689f38 50%, #558b2f 100%);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Grass blade texture */
.grass::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(90deg, transparent 0%, transparent 48%, rgba(0, 0, 0, 0.05) 48%, rgba(0, 0, 0, 0.05) 52%, transparent 52%),
        linear-gradient(180deg, rgba(106, 168, 79, 0.4) 0%, transparent 30%);
    background-size: 8px 100%, 100% 100%;
}

/* Grass top edge with jagged texture */
.grass::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 0;
    width: 100%;
    height: 15px;
    background:
        radial-gradient(ellipse at 5% 100%, #7cb342 0%, transparent 50%),
        radial-gradient(ellipse at 15% 100%, #689f38 0%, transparent 50%),
        radial-gradient(ellipse at 25% 100%, #7cb342 0%, transparent 50%),
        radial-gradient(ellipse at 35% 100%, #558b2f 0%, transparent 50%),
        radial-gradient(ellipse at 45% 100%, #7cb342 0%, transparent 50%),
        radial-gradient(ellipse at 55% 100%, #689f38 0%, transparent 50%),
        radial-gradient(ellipse at 65% 100%, #7cb342 0%, transparent 50%),
        radial-gradient(ellipse at 75% 100%, #558b2f 0%, transparent 50%),
        radial-gradient(ellipse at 85% 100%, #7cb342 0%, transparent 50%),
        radial-gradient(ellipse at 95% 100%, #689f38 0%, transparent 50%);
    background-size: 10% 100%;
    background-repeat: repeat-x;
}

/* Train tracks - taller version */
.tracks {
    position: absolute;
    bottom: 45px;
    left: 0;
    width: 100%;
    height: 12px;
    background: repeating-linear-gradient(
        90deg,
        #78716c 0px,
        #78716c 50px,
        transparent 50px,
        transparent 100px
    );
    border-top: 4px solid #57534e;
    border-bottom: 4px solid #57534e;
}

/* Train rails (the metal rails) */
.tracks::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(to bottom, #d4d4d8 0%, #a8a29e 100%);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.tracks::after {
    content: '';
    position: absolute;
    bottom: 3px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(to bottom, #d4d4d8 0%, #a8a29e 100%);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* Train using image */
/* Train using actual Thomas image */
.train {
    position: absolute;
    width: 165px;
    height: 110px;
    bottom: 30px;
    animation: trainMove 30s linear infinite;
    background-image: url('/static/thomas.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    z-index: 4;
}

/* Smoke puffs */
.smoke {
    position: absolute;
    width: 10px;
    height: 10px;
    background: rgba(156, 163, 175, 0.7);
    border-radius: 50%;
    bottom: 75px;
    left: 15px;
    animation: smokeRise 3s ease-out infinite;
}

.smoke:nth-child(1) {
    animation-delay: 0s;
}

.smoke:nth-child(2) {
    animation-delay: 1s;
}

.smoke:nth-child(3) {
    animation-delay: 2s;
}


/* Lighthouse (only visible during midday) */
/* Lighthouse (only visible during midday) */
.lighthouse {
    position: absolute;
    bottom: 70px;
    left: 50px;
    width: 100px;
    height: 180px;
    z-index: 3;
    pointer-events: none;
    background-image: url('/static/lighthouse.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center bottom;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

@keyframes smokeRise {
    0% {
        opacity: 0.7;
        transform: translateY(0) translateX(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-50px) translateX(-15px) scale(2.5);
    }
}

/* Train moves horizontally right to left */
@keyframes trainMove {
    0% {
        left: 110%;
    }
    100% {
        left: -15%;
    }
}}


/* Birds container (only visible during dawn) */
.birds {
    display: none !important; /* Add !important */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* ONLY show during dawn */
body.dawn-time .birds {
    display: block !important; /* Add !important here too */
}

/* Explicitly hide during all other times */
body.midday-time .birds,
body.sunset-time .birds,
body.twilight-time .birds,
body.night-time .birds {
    display: none !important;
}

/* Individual bird */
.bird {
    position: absolute;
    width: 33px;
    height: 22px;
}

/* Bird wing flapping animation using SVG */
.bird::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='30' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M 5,10 Q 10,5 15,10 Q 20,5 25,10' stroke='%23111827' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

/* Different flapping speeds */
.bird:nth-child(1)::before {
    animation: flapWings 0.5s ease-in-out infinite;
}

.bird:nth-child(2)::before {
    animation: flapWings 0.7s ease-in-out infinite;
}

.bird:nth-child(3)::before {
    animation: flapWings 0.6s ease-in-out infinite;
}

.bird:nth-child(4)::before {
    animation: flapWings 0.55s ease-in-out infinite;
}

.bird:nth-child(5)::before {
    animation: flapWings 0.65s ease-in-out infinite;
}

/* Wing flapping animation */
@keyframes flapWings {
    0%, 100% {
        transform: scaleY(1);
    }
    50% {
        transform: scaleY(0.6);
    }
}

/* Bird 1: Start onscreen, fly left to right (fast) */
.bird:nth-child(1) {
    animation: flyBird1 35s linear infinite;
}

/* Bird 2: Start onscreen, fly right to left (medium) */
.bird:nth-child(2) {
    animation: flyBird2 40s linear infinite;
}

/* Bird 3: Join later from left (slow) */
.bird:nth-child(3) {
    animation: flyBird3 55s linear infinite;
    animation-delay: 4s;
}

/* Bird 4: Join later from right (fast) */
.bird:nth-child(4) {
    animation: flyBird4 37s linear infinite;
    animation-delay: 6s;
}

/* Bird 5: Join later from left (medium) */
.bird:nth-child(5) {
    animation: flyBird5 30s linear infinite;
    animation-delay: 16s;
}

/* Bird 1: Start at 30%, fly left to right, slight downward */
@keyframes flyBird1 {
    0% {
        left: 30%;
        top: 15%;
    }
    100% {
        left: 105%;
        top: 22%;
    }
}

/* Bird 2: Start at 70%, fly right to left, slight upward */
@keyframes flyBird2 {
    0% {
        left: 70%;
        top: 28%;
        transform: scaleX(-1); /* Flip bird to face left */
    }
    100% {
        left: -5%;
        top: 20%;
        transform: scaleX(-1);
    }
}

/* Bird 3: Enter from left, fly right, gentle wave */
@keyframes flyBird3 {
    0% {
        left: -5%;
        top: 35%;
    }
    30% {
        top: 30%;
    }
    60% {
        top: 33%;
    }
    100% {
        left: 105%;
        top: 28%;
    }
}

/* Bird 4: Enter from right, fly left, downward diagonal */
@keyframes flyBird4 {
    0% {
        left: 105%;
        top: 12%;
        transform: scaleX(-1);
    }
    100% {
        left: -5%;
        top: 25%;
        transform: scaleX(-1);
    }
}

/* Bird 5: Enter from left, fly right, upward curve */
@keyframes flyBird5 {
    0% {
        left: -5%;
        top: 38%;
    }
    40% {
        top: 30%;
    }
    70% {
        top: 22%;
    }
    100% {
        left: 105%;
        top: 18%;
    }
}

/* Clouds container (only visible during dawn) */
.clouds {
    display: none !important;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 60%;
    z-index: 0;
    pointer-events: none;
}

body.dawn-time .clouds {
    display: block !important;
}

/* Individual cloud - long and streaky */
.cloud {
    position: absolute;
    opacity: 1; /* Full opacity */
}

/* Long streaky cloud shape */
.cloud::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 25px; /* Slightly thicker */
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.85) 10%,
        rgba(255, 255, 255, 1) 25%,
        rgba(255, 255, 255, 1) 50%,
        rgba(255, 255, 255, 1) 75%,
        rgba(255, 255, 255, 0.85) 90%,
        transparent 100%
    );
    border-radius: 50%;
    filter: blur(10px); /* Less blur for more definition */
    transform: skewX(-15deg);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.8); /* Added glow */
}

/* Additional wispy layer */
.cloud::after {
    content: '';
    position: absolute;
    width: 350px;
    height: 18px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.75) 20%,
        rgba(255, 255, 255, 0.95) 50%,
        rgba(255, 255, 255, 0.75) 80%,
        transparent 100%
    );
    border-radius: 50%;
    filter: blur(8px);
    left: 50px;
    top: -8px;
    transform: skewX(-10deg);
}

/* Cloud positions - start some onscreen */
.cloud:nth-child(1) {
    top: 12%;
    left: 15%;
    animation: driftCloud1 90s linear infinite;
}

.cloud:nth-child(2) {
    top: 22%;
    left: 50%;
    animation: driftCloud2 100s linear infinite;
    transform: rotate(-5deg);
}

.cloud:nth-child(3) {
    top: 32%;
    animation: driftCloud3 85s linear infinite;
    transform: rotate(3deg);
}

.cloud:nth-child(4) {
    top: 18%;
    animation: driftCloud4 95s linear infinite;
    transform: rotate(-3deg);
}

.cloud:nth-child(5) {
    top: 28%;
    left: 70%;
    animation: driftCloud5 92s linear infinite;
    transform: rotate(2deg);
}

/* Slow cloud drift animations */
@keyframes driftCloud1 {
    0% {
        left: 15%;
    }
    100% {
        left: 110%;
    }
}

@keyframes driftCloud2 {
    0% {
        left: 50%;
    }
    100% {
        left: 110%;
    }
}

@keyframes driftCloud3 {
    0% {
        left: -30%;
    }
    100% {
        left: 110%;
    }
}

@keyframes driftCloud4 {
    0% {
        left: -30%;
    }
    100% {
        left: 110%;
    }
}

@keyframes driftCloud5 {
    0% {
        left: 70%;
    }
    100% {
        left: 110%;
    }
}

/* Hot air balloons container (only visible during sunset) */
.balloons {
    display: none !important;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* Sunset theme - warm cream tinted card */
body.sunset-time .card {
    background: linear-gradient(145deg, #fffbf5, #fff7ed);
    backdrop-filter: blur(10px);
    box-shadow:
        0 0 25px rgba(255, 247, 237, 0.5),
        0 4px 6px rgba(0, 0, 0, 0.05),
        0 10px 25px rgba(0, 0, 0, 0.1);
    color: #111827;
}

/* Sunset theme - heading stays dark */
body.sunset-time .card h2 {
    color: #111827;
}

body.sunset-time .balloons {
    display: block !important;
}

/* Individual balloon using image */
.balloon {
    position: absolute;
    width: 100px;
    height: 120px;
    background-image: url('/static/balloon.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

/* Balloon 1 - Left side, higher */
.balloon:nth-child(1) {
    left: 15%;
    top: 12%;
    animation: floatBalloon1 25s ease-in-out infinite;
}

/* Balloon 2 - Right side, lower */
.balloon:nth-child(2) {
    right: 15%;
    top: 28%;
    animation: floatBalloon2 30s ease-in-out infinite;
    animation-delay: 2s;
}

/* Floating animation 1 - gentle drift */
@keyframes floatBalloon1 {
    0% {
        transform: translate(0, 0);
    }
    25% {
        transform: translate(40px, -25px);
    }
    50% {
        transform: translate(70px, -15px);
    }
    75% {
        transform: translate(35px, -30px);
    }
    100% {
        transform: translate(0, 0);
    }
}

/* Floating animation 2 - different drift pattern */
@keyframes floatBalloon2 {
    0% {
        transform: translate(0, 0);
    }
    25% {
        transform: translate(-35px, -20px);
    }
    50% {
        transform: translate(-60px, -35px);
    }
    75% {
        transform: translate(-30px, -15px);
    }
    100% {
        transform: translate(0, 0);
    }
}

/* Road and cyclist (only visible during sunset) */
.road-scene {
    display: none !important;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 150px;
    z-index: 2;
    pointer-events: none;
}

body.sunset-time .road-scene {
    display: block !important;
}

/* Road - lighter gray */
.road {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: linear-gradient(to bottom, #a1a1aa 0%, #71717a 100%);
    box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.2);
}

/* Road center line */
.road::before {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 0;
    width: 100%;
    height: 3px;
    background: repeating-linear-gradient(
        90deg,
        #fbbf24 0px,
        #fbbf24 30px,
        transparent 30px,
        transparent 60px
    );
}

/* Road edge lines */
.road::after {
    content: '';
    position: absolute;
    top: 5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #d4d4d8;
    box-shadow: 0 65px 0 0 #d4d4d8;
}

/* Cyclist */
.cyclist {
    position: absolute;
    bottom: 50px;
    width: 80px;
    height: 60px;
    background-image: url('/static/bike.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* First cyclist - starts offscreen left, moves faster */
.cyclist:nth-child(2) {
    animation: rideBike 25s linear infinite; /* Faster - 25s */
    animation-delay: 0s;
}

/* Second cyclist - starts 1/4 from left, moves slower */
.cyclist:nth-child(3) {
    animation: rideBike 35s linear infinite; /* Slower - 35s */
    animation-delay: -8.75s; /* 35s × 0.25 = 8.75s to start at 1/4 position */
}

/* Bike riding animation - left to right */
@keyframes rideBike {
    0% {
        left: -10%;
    }
    100% {
        left: 110%;
    }
}