body {
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #87CEEB;
    font-family: 'Press Start 2P', cursive;
}

.game-container {
    position: relative;
}

#gameCanvas {
    border: 2px solid #000;
    background-color: #fff;
}

#score {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 16px;
    color: #000;
    text-shadow: 
        2px 2px 0 #fff,
        -2px -2px 0 #fff,
        2px -2px 0 #fff,
        -2px 2px 0 #fff;
    letter-spacing: 2px;
}

#gameOverDisplay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.game-over-content {
    background-color: #000;
    padding: 30px;
    border: 4px solid #fff;
    text-align: center;
    color: #fff;
    image-rendering: pixelated;
}

.game-over-content h2 {
    font-size: 24px;
    margin: 0 0 20px 0;
    color: #ff0000;
    text-shadow: 
        2px 2px 0 #500,
        -2px -2px 0 #500,
        2px -2px 0 #500,
        -2px 2px 0 #500;
}

.game-over-content p {
    font-size: 16px;
    margin: 20px 0;
    color: #fff;
}

.game-over-content button {
    margin-top: 20px;
    padding: 15px 30px;
    font-family: 'Press Start 2P', cursive;
    font-size: 14px;
    cursor: pointer;
    background-color: #000;
    color: #fff;
    border: 2px solid #fff;
    text-transform: uppercase;
    transition: all 0.2s ease;
}

.game-over-content button:hover {
    background-color: #fff;
    color: #000;
}

/* Add scanline effect */
@keyframes scanline {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(100%);
    }
}

.game-over-content::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    animation: scanline 8s linear infinite;
}

.speed-up-alert {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Press Start 2P', cursive;
    text-align: center;
    pointer-events: none;
    animation: speedUpAlert 0.5s ease-out;
}

.alert-text {
    font-size: 32px;
    color: #FF0000;
    text-shadow: 
        2px 2px 0 #000,
        -2px -2px 0 #000,
        2px -2px 0 #000,
        -2px 2px 0 #000;
    margin-bottom: 10px;
}

.level-text {
    font-size: 24px;
    color: #FFD700;
    text-shadow: 
        2px 2px 0 #000,
        -2px -2px 0 #000,
        2px -2px 0 #000,
        -2px 2px 0 #000;
    margin-bottom: 10px;
}

.speed-up-alert.fade-out {
    animation: fadeOut 0.5s forwards;
}

@keyframes speedUpAlert {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
}

/* Start Screen Styles */
.start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('loading.webp');
    background-size: cover;
    background-position: center;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    overflow: hidden; /* Ensure snow stays within bounds */
}

/* Snow animation layer - positioned behind content */
.snow-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1; /* Lower z-index so it's behind content */
}

/* Multiple snow layers with different sizes and speeds */
.snow-layer::before,
.snow-layer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle, rgba(255,255,255,0.9) 3px, transparent 3px),
        radial-gradient(circle, rgba(255,255,255,0.7) 2px, transparent 2px),
        radial-gradient(circle, rgba(255,255,255,0.5) 1px, transparent 1px);
    background-size: 40px 40px, 30px 30px, 20px 20px;
    animation: snowfall-large 15s linear infinite;
}

.snow-layer::after {
    background-image: 
        radial-gradient(circle, rgba(255,255,255,0.8) 4px, transparent 4px),
        radial-gradient(circle, rgba(255,255,255,0.6) 2px, transparent 2px),
        radial-gradient(circle, rgba(255,255,255,0.4) 1px, transparent 1px);
    background-size: 50px 50px, 35px 35px, 25px 25px;
    animation: snowfall-small 12s linear infinite;
    opacity: 0.7;
}

.start-content {
    background-color: rgba(0, 0, 0, 0.7);
    padding: 40px;
    border-radius: 10px;
    text-align: center;
    border: 4px solid #fff;
    max-width: 80%;
    position: relative;
    z-index: 2; /* Higher z-index to appear above snow */
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.start-screen h1 {
    font-family: 'Press Start 2P', cursive;
    font-size: 36px;
    color: #FF0000;
    margin: 0 0 20px 0;
    text-shadow: 
        3px 3px 0 #000,
        -3px -3px 0 #000,
        3px -3px 0 #000,
        -3px 3px 0 #000;
    letter-spacing: 2px;
}

.start-screen h2 {
    font-family: 'Press Start 2P', cursive;
    font-size: 48px;
    color: #FFD700;
    margin: 0 0 40px 0;
    text-shadow: 
        3px 3px 0 #000,
        -3px -3px 0 #000,
        3px -3px 0 #000,
        -3px 3px 0 #000;
    letter-spacing: 3px;
}

.start-screen button {
    font-family: 'Press Start 2P', cursive;
    font-size: 20px;
    padding: 15px 30px;
    background-color: #000;
    color: #fff;
    border: 3px solid #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative; /* Ensure button is above snow */
    z-index: 3;
}

.start-screen button:hover {
    background-color: #fff;
    color: #000;
    transform: scale(1.05);
}

/* Separate animations for different snow layers */
@keyframes snowfall-large {
    0% {
        background-position: 0 0, 0 0, 0 0;
    }
    100% {
        background-position: 0 700px, 0 500px, 0 300px;
    }
}

@keyframes snowfall-small {
    0% {
        background-position: 30px 50px, 40px 60px, 50px 70px;
    }
    100% {
        background-position: 30px 750px, 40px 550px, 50px 350px;
    }
}

/* Touch Controls */
.touch-control {
    position: absolute;
    top: 0;
    height: 100%;
    width: 50%;
    z-index: 10;
    opacity: 0; /* Invisible but touchable */
}

.left-control {
    left: 0;
}

.right-control {
    right: 0;
}

/* Add active state indicator for debugging if needed */
.touch-control.active {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Prevent text selection on touch */
* {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Make buttons more touch-friendly */
.start-screen button,
.game-over-content button {
    padding: 20px 40px;
    min-width: 200px;
    margin: 20px auto;
    font-size: 18px;
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
    .start-screen h1 {
        font-size: 28px;
    }
    
    .start-screen h2 {
        font-size: 36px;
    }
    
    .start-content {
        padding: 30px;
        width: 90%;
    }
    
    #score {
        font-size: 14px;
        top: 10px;
        left: 10px;
    }
}

/* Audio Controls */
.audio-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
}

.audio-control {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.audio-control label {
    font-family: 'Press Start 2P', cursive;
    font-size: 12px;
    color: #fff;
    text-shadow: 1px 1px 0 #000;
}

.toggle-button {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    background-color: #fff;
    border: 2px solid #fff;
    color: #000;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.toggle-button:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
}

.toggle-button.active {
    background-color: #fff;
    color: #007700;
}

.toggle-button:not(.active) {
    background-color: #fff;
    color: #770000;
}

.toggle-icon {
    pointer-events: none;
    display: block; /* Ensure icon takes full space */
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Add responsive adjustment to ensure buttons don't exceed container width */
@media (max-width: 400px) {
    .toggle-button {
        width: 26px;
        height: 26px;
        font-size: 14px;
    }
}

/* Copyright notice styling */
.copyright-notice {
    position: absolute;
    bottom: 10px;
    right: 10px;
    font-family: 'Press Start 2P', cursive;
    font-size: 8px;
    color: rgba(255, 255, 255, 0.7);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    z-index: 10; /* Above snow but below other elements */
    padding: 5px;
    letter-spacing: 0.5px;
}

/* Responsive adjustment for smaller screens */
@media (max-width: 768px) {
    .copyright-notice {
        font-size: 6px;
        bottom: 5px;
        right: 5px;
    }
} 