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

:root {
    --primary-green: #6A7553;
    --rose-pink-100: #F5EFED;
    --rose-pink-200: #E8D8D3;
    --rose-pink-300: #D7B9B0;
    --rose-pink-400: #C79A8E;
    --rose-pink-500: #B27A6B;
    --rose-pink-600: #9A604F;
    --text-shadow: 0 2px 6px rgba(0,0,0,0.1);
    --elegant-transition: all 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* Add Falling Egg Animation Styles */
.egg-confetti {
    position: fixed;
    width: 30px;
    height: 40px;
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; /* Egg shape */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

body {
    background-color: var(--primary-green); /* Pure flat color that matches logo */
    min-height: 100vh;
    overflow-x: hidden;
    font-family: 'Montserrat', sans-serif;
    color: white;
    position: relative;
}

/* Landing Page Styles */
#landing-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    position: relative;
    z-index: 1;
}

/* Desktop-only: Constrain height to prevent scroll */
@media (min-width: 1025px) {
    #landing-page {
        height: 100vh;
        min-height: auto;
    }
}

@media (max-width: 1024px) {
    #landing-page {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }
}

/* Left Side - Logo Section */
.logo-container {
    padding: 2vw;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center; /* Center logo horizontally */
    position: relative;
    overflow: hidden;
}

.logo-frame {
    position: relative;
    opacity: 0;
    animation: fadeSlideIn 1s ease-out 0.2s forwards;
    max-width: 500px; /* Larger logo */
    width: 90%;
}

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

#logo {
    width: 100%;
    transition: var(--elegant-transition);
    cursor: pointer; /* Indicate the logo is clickable */
}

#logo:hover {
    transform: scale(1.03);
}

.tagline {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.8rem;
    font-weight: 400;
    font-style: italic;
    opacity: 0;
    animation: fadeSlideIn 1s ease-out 0.4s forwards;
    letter-spacing: 1px;
    text-shadow: var(--text-shadow);
    margin-bottom: 2rem;
}

/* Newsletter Signup Styles */
.newsletter-signup {
    opacity: 0;
    animation: fadeSlideIn 1s ease-out 1.8s forwards;
    align-self: flex-start;
    width: 100%;
    max-width: 600px;
}

@media (max-width: 1024px) {
    .newsletter-signup {
        align-self: center;
    }
}

.newsletter-title {
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0 0 1.8rem 0;
    color: rgba(255, 255, 255, 0.95);
    text-align: center;
    line-height: 1.5;
    font-family: 'Montserrat', sans-serif;
    position: relative;
    padding-bottom: 1rem;
}

.newsletter-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 1px;
    background: rgba(215, 185, 176, 0.3);
}

.newsletter-form {
    background: rgba(255, 255, 255, 0.08);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid rgba(215, 185, 176, 0.15);
    border-top: 2px solid rgba(178, 122, 107, 0.2);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
}

/* Desktop-only: Reduce newsletter form padding */
@media (min-width: 1025px) {
    .newsletter-form {
        padding: 1.5rem;
        margin-bottom: 0.5rem;
        margin-top: 0.5rem;
    }
}

.form-group {
    margin-bottom: 1rem;
}

.form-group:last-of-type {
    margin-bottom: 1.5rem;
}

.newsletter-form input {
    width: 75%;
    max-width: 400px;
    margin: 0 auto;
    display: block;
    padding: 0.9rem 1.2rem;
    border: 2px solid rgba(215, 185, 176, 0.2);
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.95);
    color: #36402C;
    font-size: 1rem;
    font-family: 'Montserrat', sans-serif;
    transition: var(--elegant-transition);
    box-sizing: border-box;
}

.newsletter-form input:focus {
    outline: none;
    border-color: var(--rose-pink-400);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(178, 122, 107, 0.1);
}

.newsletter-form input::placeholder {
    color: #8FA279;
    font-size: 0.95rem;
}

.newsletter-btn {
    width: 60%;
    max-width: 280px;
    margin: 0 auto;
    display: block;
    padding: 1rem 2rem;
    background-color: var(--rose-pink-500);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: var(--elegant-transition);
    font-family: 'Montserrat', sans-serif;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.newsletter-btn:hover:not(:disabled) {
    background-color: var(--rose-pink-600);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.newsletter-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.newsletter-status {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-weight: 500;
    text-align: center;
    font-size: 0.95rem;
}

/* Desktop-only: Reduce newsletter status padding */
@media (min-width: 1025px) {
    .newsletter-status {
        padding: 0.75rem;
        margin-bottom: 0.5rem;
    }
}

.newsletter-status.success {
    background-color: rgba(106, 117, 86, 0.15);
    border: 1px solid rgba(106, 117, 86, 0.3);
    color: rgba(255, 255, 255, 0.95);
}

.newsletter-status.error {
    background-color: rgba(178, 122, 107, 0.15);
    border: 1px solid rgba(178, 122, 107, 0.3);
    color: rgba(255, 255, 255, 0.95);
}



/* Screen reader only class */
.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;
}

/* Mobile responsive adjustments */
@media (max-width: 767px) {
    .newsletter-signup {
        max-width: 300px;
        margin-top: 0.5rem;
    }
    
    /* Hide newsletter title on mobile */
    .newsletter-title {
        display: none;
    }
    
    /* Remove container styling on mobile */
    .newsletter-form {
        background: none;
        padding: 0;
        border: none;
        backdrop-filter: none;
        box-shadow: none;
        margin-bottom: 0;
    }
    
    .newsletter-form input {
        width: 100%;
        padding: 0.7rem 0.9rem;
        font-size: 16px; /* Prevent zoom on iOS */
        margin-bottom: 0.6rem;
        border: 2px solid rgba(255, 255, 255, 0.3);
        background-color: rgba(255, 255, 255, 0.9);
    }
    
    .newsletter-btn {
        width: 100%;
        padding: 0.8rem 1.2rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .newsletter-form {
        padding: 0;
    }
    
    .newsletter-form input {
        width: 100%;
        padding: 0.65rem 0.8rem;
        margin-bottom: 0.5rem;
    }
    
    .newsletter-btn {
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }
    
    /* Make countdown even more compact on very small screens */
    #countdown {
        max-width: 220px;
        gap: 6px;
    }
    
    #countdown .countdown-box span:first-child {
        font-size: 1.6rem;
        padding: 0.5rem 0.2rem;
    }
    
    #countdown .label {
        font-size: 0.6rem;
        margin-top: 0.2rem;
    }
}

/* Right Side - Countdown Section */
.countdown-container {
    padding: 5vw;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    position: relative;
}

/* Desktop-only: Reduce padding to accommodate newsletter status */
@media (min-width: 1025px) {
    .countdown-container {
        padding: 3vw 5vw;
        overflow-y: auto;
    }
}

@media (max-width: 1024px) {
    .countdown-container {
        align-items: center;
        text-align: center;
        padding: 5vw;
    }
}

.countdown-container h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 3.2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 3rem;
    position: relative;
    opacity: 0;
    animation: fadeSlideIn 1s ease-out 0.8s forwards;
    text-shadow: var(--text-shadow);
}

/* Desktop-only: Reduce margins to fit content */
@media (min-width: 1025px) {
    .countdown-container h1 {
        margin-bottom: 2rem;
    }
}

.countdown-container h1::after {
    content: '';
    display: block;
    width: 60px;
    height: 2px;
    background: rgba(215, 185, 176, 0.5);
    margin-top: 15px;
}

@media (max-width: 1024px) {
    .countdown-container h1::after {
        margin-left: auto;
        margin-right: auto;
    }
}

/* Countdown wrapper - transparent for desktop, centered for mobile */
.countdown-wrapper {
    /* Desktop: transparent wrapper that doesn't interfere with layout */
    display: contents;
}

#countdown {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    width: 100%;
    max-width: 600px;
    margin-bottom: 3rem;
}

/* Desktop-only: Reduce countdown margin */
@media (min-width: 1025px) {
    #countdown {
        margin-bottom: 2rem;
    }
}

@media (max-width: 767px) {
    #countdown {
        grid-template-columns: repeat(2, 1fr);
        max-width: 400px;
    }
}

.countdown-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    animation: fadeScaleIn 0.8s ease-out forwards;
}

.countdown-box:nth-child(1) { animation-delay: 1.0s; }
.countdown-box:nth-child(2) { animation-delay: 1.1s; }
.countdown-box:nth-child(3) { animation-delay: 1.2s; }
.countdown-box:nth-child(4) { animation-delay: 1.3s; }

@keyframes fadeScaleIn {
    from { opacity: 0; transform: translateY(20px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.countdown-box span:first-child {
    width: 100%;
    aspect-ratio: 1/1;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3.6rem;
    font-weight: 300;
    position: relative;
    border-radius: 12px;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    overflow: hidden;
    transition: var(--elegant-transition);
    color: white;
    text-shadow: var(--text-shadow);
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(215, 185, 176, 0.15);
    z-index: 1;
}

.countdown-box span:first-child::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.08) 0%,
        transparent 50%,
        rgba(0, 0, 0, 0.05) 100%
    );
    z-index: -1;
}

.countdown-box:hover span:first-child {
    transform: translateY(-5px);
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.label {
    margin-top: 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.9;
}

.launch-info {
    margin-bottom: 2.5rem;
    opacity: 0;
    animation: fadeSlideIn 1s ease-out 1.4s forwards;
}

/* Desktop-only: Reduce launch-info margin */
@media (min-width: 1025px) {
    .launch-info {
        margin-bottom: 1.5rem;
    }
}

.launch-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.95);
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 0.5px;
}

.launch-details {
    font-size: 1.1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 0.5rem;
    font-family: 'Montserrat', sans-serif;
}

.launch-address {
    font-size: 1.1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
    font-family: 'Montserrat', sans-serif;
}



@media (max-width: 767px) {
    .countdown-container h1 {
        font-size: 2.6rem;
    }
    
    .countdown-box span:first-child {
        font-size: 2.8rem;
    }
    
    .label {
        font-size: 0.8rem;
    }
    
    .launch-title {
        font-size: 1.2rem;
    }
    
    .launch-details, 
    .launch-address {
        font-size: 1rem;
    }
    

}

@media (max-width: 480px) {
    .countdown-container h1 {
        font-size: 2.2rem;
    }
    
    .logo-frame {
        max-width: 80%;
        margin: 0 auto;
    }
    
    .countdown-box span:first-child {
        font-size: 2.4rem;
    }
    
    .launch-details, 
    .launch-address {
        padding: 0 1rem;
    }
}

/* Add a wooden texture to create a book-like frame */
.game-frame {
    background: #8b5a2b;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), inset 0 0 15px rgba(0, 0, 0, 0.4);
    padding: 20px;
    max-width: 950px;
    width: 95%;
    margin: 0 auto;
    position: relative;
    background-image: linear-gradient(160deg, 
        #a67c52 0%, 
        #8b5a2b 46%, 
        #6d4326 100%);
    opacity: 0;
    animation: fadeFrameIn 0.7s ease-out 0.4s forwards;
    transform: translateY(15px);
}

.game-frame::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    pointer-events: none;
}

@keyframes fadeFrameIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.controls-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding: 10px 15px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    color: #fff;
    opacity: 0;
    animation: fadeFrameIn 0.5s ease-out 0.7s forwards;
}

.controls-left {
    display: flex;
    align-items: center;
}

.controls-right {
    display: flex;
    align-items: center;
}

.score-display {
    display: flex;
    align-items: center;
    font-size: 18px;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.2);
    padding: 5px 15px;
    border-radius: 20px;
    margin-left: 15px;
}

/* Add space between the high score label and number */
#high-score {
    margin-left: 6px;
}

/* Add more spacing between high score and message */
#game-message {
    margin-right: 10px;
}

/* Back button for the game */
.back-arrow {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 50;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    opacity: 0;
    animation: fadeFrameIn 0.5s ease-out 0.8s forwards;
}

.back-arrow:hover {
    background: var(--rose-pink-500);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.control-hint {
    margin-right: 20px;
    display: flex;
    align-items: center;
}

.key {
    display: inline-block;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    padding: 2px 8px;
    border-radius: 4px;
    margin: 0 5px;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    font-weight: bold;
}

.easter-egg-hint {
    font-size: 12px;
    opacity: 0.7;
    font-style: italic;
    transition: all 0.3s ease;
}

/* Animation for message change */
.message-change {
    animation: pulse-message 0.5s ease;
}

@keyframes pulse-message {
    0% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.1); opacity: 1; color: var(--rose-pink-300); }
    100% { transform: scale(1); opacity: 0.7; }
}

/* Game Styles */
#game-container {
    width: 100%;
    height: 100vh;
    position: relative;
    background-color: var(--primary-green);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: visible;
    z-index: 10;
    opacity: 0; /* Start invisible */
    animation: none; /* Animation will be applied via JS */
}

#game-container.fade-in {
    animation: gameFadeIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

#game-area {
    width: 100%;
    max-width: 900px; /* Keep fixed max width */
    height: 300px; /* Keep fixed height */
    position: relative;
    overflow: hidden;
    border-bottom: 2px solid #5e7451;
    background-color: transparent; /* Remove background color to show the background image */
    transition: filter 0.3s, opacity 0.3s;
    border: 3px solid #4a5d40; /* Add border to game area */
    border-radius: 5px;
    opacity: 0;
    animation: fadeFrameIn 0.6s ease-out 0.5s forwards;
    will-change: opacity, filter; /* Optimize for transitions */
    backface-visibility: visible; /* Ensure visibility during 3D transformations */
    transform-style: preserve-3d; /* Preserve 3D transformations */
}

/* Ensure overflow visible when game over dialog is shown */
#game-area:has(#game-over:not(.hidden)) {
    overflow: visible;
}

.background {
    position: absolute;
    width: 200%; /* Make wider than game area for continuous scrolling */
    height: 100%;
    background-image: url('assets/game-background/final-forest-background.png');
    background-repeat: repeat-x;
    background-size: auto 100%; /* Maintain aspect ratio while fitting height */
    background-position: 0 bottom; /* Align to bottom */
    bottom: 0;
    z-index: 1;
    /* Removed animation to prevent interference with parallax scroll */
}

/* Inverted mode styling (similar to Chrome Dino night mode) */
.inverted-mode {
    filter: invert(100%) hue-rotate(180deg) contrast(110%) saturate(120%);
    animation: flash 0.5s, pulse 2s infinite;
    opacity: 1 !important; /* Ensure opacity is always 1 */
    visibility: visible !important; /* Ensure visibility is always visible */
}

.inverted-mode #hare {
    /* Prevent double inversion of the hare */
    filter: invert(100%) hue-rotate(180deg) brightness(1.2);
    opacity: 1 !important; /* Ensure hare stays visible */
}

.inverted-mode .background {
    opacity: 1 !important; /* Ensure background stays visible */
}

/* Flash animation for inverted mode activation */
@keyframes flash {
    0% { filter: invert(0%) brightness(100%) contrast(100%); opacity: 1; }
    50% { filter: invert(100%) brightness(200%) contrast(150%) saturate(150%); opacity: 1; }
    100% { filter: invert(100%) hue-rotate(180deg) contrast(110%) saturate(120%); opacity: 1; }
}

/* Subtle pulsing effect for inverted mode */
@keyframes pulse {
    0% { filter: invert(100%) hue-rotate(180deg) contrast(110%) saturate(120%); opacity: 1; }
    50% { filter: invert(100%) hue-rotate(190deg) contrast(120%) saturate(130%) brightness(110%); opacity: 1; }
    100% { filter: invert(100%) hue-rotate(180deg) contrast(110%) saturate(120%); opacity: 1; }
}

/* Add this rule to adjust background when game over dialog appears */
#game-over:not(.hidden) ~ .background,
#game-over:not(.hidden) + .background,
#game-area:has(#game-over:not(.hidden)) .background {
    left: 0;
    right: 0;
    width: 100%; /* Reduce width to prevent extending past the game area */
    background-position: center bottom; /* Center the background */
}

#hare {
    width: 100px;
    height: 100px;
    position: absolute;
    bottom: 20px;
    left: 50px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 10;
    background-color: transparent;
    filter: brightness(1.2);
}

.obstacle {
    position: absolute;
    bottom: 20px;
    background-image: url('assets/obstacles/short-bookshelf.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: bottom center;
    z-index: 5;
}

.obstacle.large {
    /* CSS for larger obstacles if needed */
    z-index: 6; /* Slightly higher z-index to appear in front */
}

.obstacle.coffee-cup {
    background-image: url('assets/obstacles/coffee-cup.png');
    transform-origin: center center; /* Rotate from the center of the cup */
    bottom: 40px; /* Lowered from 60px to 40px to bring the cup closer to the ground */
    z-index: 6;
}

@keyframes rotate-counter-clockwise {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(-360deg);
    }
}

#score {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    font-weight: bold;
    color: white;
    z-index: 20; /* Ensure score is above everything */
    background: rgba(0, 0, 0, 0.4);
    padding: 5px 10px;
    border-radius: 5px;
}

#game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(51, 51, 51, 0.9); /* Semi-transparent background */
    color: white;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.7); /* Stronger shadow */
    border: 2px solid #5e7451; /* Thicker border */
    z-index: 200; /* Higher z-index to ensure it appears on top */
    min-width: 250px; /* Ensure minimum width */
    backdrop-filter: blur(5px); /* Add blur effect for modern browsers */
}

#game-over.hidden {
    display: none !important;
}

#game-over h2 {
    color: white;
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

#game-over p {
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

#game-over button {
    margin-top: 1rem;
    padding: 0.8rem 1.2rem;
    background-color: #5e7451;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-right: 0.5rem;
    font-weight: bold;
    transition: all 0.2s ease;
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.2);
}

#game-over button:hover {
    background-color: #4a5d40;
    transform: translateY(-2px);
    box-shadow: 0 5px 8px rgba(0, 0, 0, 0.3);
}

#game-over button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.3);
}

/* Utility Classes */
.hidden {
    display: none !important; /* Add !important to ensure it overrides other display settings */
    visibility: hidden;
    opacity: 0;
}

/* Responsive Styles */
@media (max-width: 768px) {
    #countdown {
        flex-wrap: wrap;
        gap: 1.5rem;
    }
    
    .countdown-box {
        min-width: 130px;
        width: calc(50% - 1.5rem);
        margin-bottom: 1rem;
    }
    
    .countdown-box span:first-child {
        font-size: 3.2rem;
        padding: 1rem 0.5rem;
    }
    
    .countdown-container h1 {
        font-size: 2.8rem;
        margin-bottom: 2.5rem;
    }
    
    .logo-container {
        margin-bottom: 2.5rem;
    }
    
    .logo-frame {
        padding: 20px;
    }
    
    #logo {
        max-width: 320px;
    }
    
    .tagline {
        font-size: 1.6rem;
        margin-bottom: 1.8rem;
    }
    
    .launch-date {
        font-size: 1.2rem;
        padding: 1rem 2.5rem;
    }
    

}

@media (max-width: 480px) {
    #landing-page {
        padding: 1.5rem;
    }
    
    .countdown-box span:first-child {
        font-size: 2.8rem;
        padding: 0.8rem 0.4rem;
    }
    
    .countdown-container h1 {
        font-size: 2.4rem;
        margin-bottom: 2rem;
    }
    

    
    .label {
        font-size: 0.8rem;
        letter-spacing: 2px;
    }
    
    .launch-date {
        font-size: 1rem;
        padding: 0.9rem 2rem;
    }
    
    .tagline {
        font-size: 1.3rem;
    }
    
    .logo-frame {
        padding: 15px;
    }
    
    #logo {
        max-width: 280px;
    }
}

.new-high-score {
    animation: high-score-pulse 0.5s ease-in-out infinite alternate;
}

@keyframes high-score-pulse {
    0% { background: rgba(0, 0, 0, 0.2); }
    100% { background: rgba(94, 116, 81, 0.7); color: #fff; }
}

/* Utility class to hide elements on small screens */
@media (max-width: 767px) {
    /* Hide countdown boxes on mobile */
    #countdown {
        display: none;
    }
    
    /* Clean up the h1::after since we're using a different approach */
    .countdown-container h1::after {
        content: none;
    }
}

/* Mobile Optimization - Comprehensive Update */
@media (max-width: 767px) {
    /* Simplified grid layout */
    #landing-page {
        display: flex;
        flex-direction: column;
        padding: 0.25rem 1.5rem 1.5rem;
        min-height: 100vh;
        gap: 0;
    }
    
    /* Logo container adjustments */
    .logo-container {
        padding: 0.25rem 0 0;
        justify-content: center;
        margin-bottom: -10px; /* Negative margin pulls content closer */
    }
    
    /* Countdown container adjustments */
    .countdown-container {
        padding-top: 0;
    }
    
    /* Restore heading styles */
    .countdown-container h1 {
        font-size: 2rem;
        margin-top: 0;
        margin-bottom: 0.5rem;
        text-align: center;
        white-space: nowrap; /* Prevent text wrapping */
        line-height: 1.2;
    }
    
    /* Restore the accent line under heading */
    .countdown-container h1::after {
        content: "" !important; /* Override previous rule */
        display: block;
        width: 60px;
        height: 2px;
        background: rgba(215, 185, 176, 0.5);
        margin: 10px auto 5px;
    }
    
    /* Adjust spacing for launch info */
    .launch-info {
        margin-top: 0.3rem;
        margin-bottom: 1rem;
    }
    
    /* Make launch info more compact */
    .launch-title {
        font-size: 1.1rem;
        margin-bottom: 0.2rem;
    }
    
    .launch-details {
        font-size: 0.95rem;
        margin-bottom: 0.2rem;
    }
    
    .launch-address {
        font-size: 0.85rem;
    }
}

/* Extra Small Devices */
@media (max-width: 374px) {
    #landing-page {
        padding: 1.5rem 1rem;
    }
    
    .logo-frame {
        max-width: 85%;
    }
    
    .countdown-container h1 {
        font-size: 1.8rem;
    }
    
    #countdown {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .countdown-box span:first-child {
        font-size: 2rem;
    }
    
    .label {
        font-size: 0.7rem;
    }
    
    .launch-title {
        font-size: 1rem;
    }
    
    .launch-details, 
    .launch-address {
        font-size: 0.85rem;
    }
    

}

/* Optimize animation delays for mobile */
@media (max-width: 767px) {
    .countdown-box:nth-child(1) { animation-delay: 0.5s; }
    .countdown-box:nth-child(2) { animation-delay: 0.6s; }
    .countdown-box:nth-child(3) { animation-delay: 0.7s; }
    .countdown-box:nth-child(4) { animation-delay: 0.8s; }
    
    .countdown-container h1 {
        animation-delay: 0.3s;
    }
    
    .launch-info {
        animation-delay: 0.9s;
    }
    

    

}

/* Utility classes for responsive design */
.hide-on-small {
    display: block;
}

.hide-on-desktop {
    display: none;
}

@media (max-width: 767px) {
    .hide-on-small {
        display: none;
    }
    
    .hide-on-desktop {
        display: block;
    }
    
    /* Hide launch info section on mobile */
    .launch-info {
        display: none !important;
    }
    
    /* Countdown wrapper - mobile only centering */
    .countdown-wrapper {
        width: 100%;
        display: flex;
        justify-content: center;
        padding-right: 31px;
    }
    
    /* Show compact countdown on mobile - all 4 elements */
    #countdown {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(2, 1fr);
        gap: 8px;
        max-width: 240px;
        margin: 0.8rem 0 1.2rem;
    }
    
    /* Make countdown boxes more compact for mobile */
    #countdown .countdown-box span:first-child {
        font-size: 1.8rem;
        padding: 0.6rem 0.3rem;
        aspect-ratio: 1.1/1; /* Slightly wider than tall for better mobile appearance */
    }
    
    #countdown .label {
        font-size: 0.65rem;
        margin-top: 0.3rem;
        letter-spacing: 0.5px;
    }
    
    /* Restore the accent line under heading */
    .countdown-container h1::after {
        content: "" !important;
        display: block;
        width: 60px;
        height: 2px;
        background: rgba(215, 185, 176, 0.5);
        margin: 15px auto 5px;
    }
    
    /* Show abbreviated address instead */
    .countdown-container .launch-details::after {
        content: "· Holly Springs, NC";
        white-space: nowrap;
    }
}

/* Removed duplicate mobile section to prevent conflicts */

/* Confetti Animation Styles */
.confetti-piece {
    position: absolute;
    width: 10px;
    height: 20px;
    background-color: #d13447;
    top: -20px;
    opacity: 0;
    pointer-events: none;
    animation: confetti-fall 3s ease-in-out forwards;
    z-index: 100;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Congratulations Dialog */
.congrats-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(51, 51, 51, 0.95);
    color: white;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.7);
    z-index: 1000;
    max-width: 90%;
    width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    animation: dialog-pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.congrats-dialog h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.2rem;
    margin-bottom: 10px;
    color: var(--rose-pink-300);
}

.congrats-dialog p {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.1rem;
    margin-bottom: 20px;
    line-height: 1.4;
    color: white;
}

.congrats-dialog button {
    background-color: var(--primary-green);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 5px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0 5px;
}

.congrats-dialog button:hover {
    background-color: var(--rose-pink-500);
    transform: translateY(-2px);
}

/* Email form styles */
.email-form {
    margin-top: 15px;
}

.email-form input[type="email"] {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #5e7451;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 5px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    margin-bottom: 15px;
    transition: border-color 0.3s;
    color: #333;
}

.email-form input[type="email"]:focus {
    border-color: var(--primary-green);
    outline: none;
}

.form-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

#submission-status {
    margin-top: 10px;
    padding: 8px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.status-success {
    background-color: rgba(144, 190, 109, 0.3);
    color: #a5d6a7;
    border: 1px solid #81c784;
}

.status-error {
    background-color: rgba(244, 67, 54, 0.3);
    color: #ef9a9a;
    border: 1px solid #e57373;
}

.success-message {
    background-color: rgba(144, 190, 109, 0.3);
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
    color: white;
}

@keyframes dialog-pop {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@media (max-width: 767px) {
    .hide-on-small {
        display: none;
    }
}

/* Game Container Animation */
@keyframes gameFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Add styles for orientation prompt */
.orientation-prompt {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(74, 118, 52, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    text-align: center;
    padding: 2rem;
    box-sizing: border-box;
}

.orientation-prompt svg {
    margin-bottom: 1rem;
}

.orientation-prompt h3 {
    margin: 0.5rem 0;
    font-size: 1.2rem;
}

.orientation-prompt p {
    margin: 0;
    font-size: 0.9rem;
    max-width: 250px;
}

/* Only show orientation prompt in portrait mode on mobile */
@media (orientation: landscape) {
    .orientation-prompt {
        display: none;
    }
}

/* Adjust dialog sizes for mobile screens */
@media (max-width: 767px) {
    #game-over {
        width: 85%;
        max-width: 300px;
        padding: 1.5rem;
    }
    
    #game-over h2 {
        font-size: 1.5rem;
        margin-top: 0;
    }
    
    #game-over p {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    #game-over button {
        width: 100%;
        margin: 0.5rem 0;
        font-size: 0.9rem;
    }
    
    .congrats-dialog {
        width: 85%;
        max-width: 300px;
        padding: 1.5rem;
    }
    
    .congrats-dialog h3 {
        font-size: 1.3rem;
        margin-top: 0;
    }
    
    .congrats-dialog p {
        font-size: 0.9rem;
    }
    
    .form-buttons {
        flex-direction: column;
    }
    
    .congrats-dialog button {
        width: 100%;
        margin: 0.5rem 0;
        font-size: 0.9rem;
    }
}

/* Desktop/Mobile control display */
.desktop-control {
    display: inline;
}

.mobile-control {
    display: none;
}

@media (max-width: 767px) {
    .desktop-control {
        display: none;
    }
    
    .mobile-control {
        display: inline;
    }
}

/* Fix controls visibility in landscape mode */
@media (orientation: landscape) and (max-height: 500px) {
    #game-area {
        height: 200px; /* Smaller height for landscape on small screens */
    }
    
    .controls-container {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        background-color: rgba(74, 118, 52, 0.9);
        z-index: 100;
        flex-direction: row;
        padding: 5px 10px;
    }
    
    .controls-left, .controls-right {
        width: auto;
        margin: 0 5px;
    }
    
    #game-message {
        margin: 0 10px;
    }
    
    /* Adjust game frame padding to account for absolute positioned controls */
    .game-frame {
        padding-bottom: 40px;
    }
}

/* Show the mobile date on mobile devices */
@media (max-width: 767px) {
    .mobile-date {
        display: block !important;
        font-size: 1.1rem;
        color: rgba(255, 255, 255, 0.9);
        margin-bottom: 0.5rem;
        font-weight: 500;
        opacity: 0;
        animation: fadeSlideIn 1s ease-out 0.4s forwards;
    }
}

/* Show address on mobile devices */
@media (max-width: 767px) {
    .launch-address.hide-on-small {
        display: block !important; /* Override the hide-on-small class */
        font-size: 0.9rem;
        margin-top: 5px;
    }
}

/* Fix mobile layout for launch info */
@media (max-width: 767px) {
    .launch-info {
        display: flex;
        flex-direction: column;
        align-items: center;
        margin: 20px 0;
    }
    
    .launch-title {
        font-size: 1.3rem;
        margin-bottom: 10px;
        font-weight: 600;
    }
    
    .launch-details {
        font-size: 0.95rem;
        line-height: 1.5;
        margin-bottom: 6px;
    }
    
    .launch-address.hide-on-small {
        display: block !important;
        font-size: 0.95rem;
        margin-top: 0;
        line-height: 1.5;
    }
    
    /* Remove the extra location that gets added by the ::after pseudo-element */
    .countdown-container .launch-details::after {
        content: none !important;
    }
} 