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

:root {
    --primary-color: #00ff00;
    --secondary-color: #00cc00;
    --background-color: #000000;
    --text-color: #ffffff;
    --glow-color: rgba(0, 255, 0, 0.3);
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--background-color);
    font-family: 'Press Start 2P', monospace;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
}

/* Prevent mobile scrolling and zooming */
body {
    overscroll-behavior: none;
    touch-action: none;
    position: fixed;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, #0a0a0a 0%, #000000 100%);
}

canvas {
    display: block;
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 30px var(--glow-color), inset 0 0 20px rgba(0, 255, 0, 0.1);
    background: #000;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    max-width: 100%;
    max-height: 100%;
}

/* Overlays */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    animation: fadeIn 0.3s ease-in;
}

.overlay.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.menu-content {
    text-align: center;
    color: var(--text-color);
    padding: 2rem;
}

.game-title {
    font-size: 3rem;
    color: var(--primary-color);
    text-shadow: 0 0 20px var(--glow-color), 0 0 40px var(--glow-color);
    margin-bottom: 3rem;
    letter-spacing: 0.2rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        text-shadow: 0 0 20px var(--glow-color), 0 0 40px var(--glow-color);
    }
    50% {
        text-shadow: 0 0 30px var(--glow-color), 0 0 60px var(--glow-color), 0 0 80px var(--glow-color);
    }
}

.pause-title, .game-over-title {
    font-size: 2rem;
    color: var(--primary-color);
    text-shadow: 0 0 20px var(--glow-color);
    margin-bottom: 2rem;
}

.menu-options {
    margin: 2rem 0;
}

.menu-button {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 1rem auto;
    padding: 1rem 2rem;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.9rem;
    color: var(--background-color);
    background: var(--primary-color);
    border: 3px solid var(--primary-color);
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.1rem;
    box-shadow: 0 0 20px var(--glow-color);
}

.menu-button:hover,
.menu-button:focus {
    background: var(--background-color);
    color: var(--primary-color);
    box-shadow: 0 0 30px var(--glow-color), inset 0 0 20px var(--glow-color);
    transform: scale(1.05);
}

.menu-button:active {
    transform: scale(0.95);
}

.controls-info {
    margin: 2rem 0;
    font-size: 0.6rem;
    color: var(--secondary-color);
    line-height: 1.8;
}

.control-line {
    margin: 0.5rem 0;
}

.high-score {
    margin-top: 3rem;
    font-size: 0.8rem;
    color: var(--primary-color);
}

.final-score {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin: 2rem 0;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .game-title {
        font-size: 2rem;
        margin-bottom: 2rem;
    }

    .pause-title, .game-over-title {
        font-size: 1.5rem;
    }

    .menu-button {
        font-size: 0.7rem;
        padding: 0.8rem 1.5rem;
        max-width: 250px;
    }

    .controls-info {
        font-size: 0.5rem;
    }

    .final-score {
        font-size: 1.2rem;
    }

    canvas {
        border-width: 1px;
    }
}

@media (max-width: 480px) {
    .game-title {
        font-size: 1.5rem;
        letter-spacing: 0.1rem;
    }

    .menu-button {
        font-size: 0.6rem;
        padding: 0.7rem 1rem;
    }

    .controls-info {
        font-size: 0.45rem;
        margin: 1rem 0;
    }
}

/* Landscape mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .game-title {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .menu-options {
        margin: 1rem 0;
    }

    .menu-button {
        padding: 0.6rem 1rem;
        margin: 0.5rem auto;
    }

    .controls-info {
        margin: 1rem 0;
    }

    .high-score {
        margin-top: 1rem;
    }
}

/* Loading animation */
@keyframes blink {
    0%, 50%, 100% {
        opacity: 1;
    }
    25%, 75% {
        opacity: 0.3;
    }
}

.loading {
    animation: blink 1s ease-in-out infinite;
}
