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

body {
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: 'Courier New', monospace;
    overflow: hidden;
}

#game-container {
    position: relative;
    width: 800px;
    height: 600px;
    background: #000;
    border: 4px solid #00ff00;
    box-shadow: 0 0 20px #00ff00, inset 0 0 20px rgba(0, 255, 0, 0.1);
}

#scanlines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 10;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

#ui {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    color: #00ff00;
    font-size: 18px;
    text-shadow: 0 0 10px #00ff00;
    z-index: 5;
    pointer-events: none;
}

#start-screen, #game-over {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.9);
    color: #00ff00;
    text-align: center;
    z-index: 20;
}

#start-screen h1, #game-over h1 {
    font-size: 64px;
    text-shadow: 0 0 20px #00ff00, 0 0 40px #00ff00;
    margin-bottom: 20px;
    letter-spacing: 10px;
}

#start-screen p, #game-over p {
    font-size: 18px;
    margin: 10px 0;
    text-shadow: 0 0 10px #00ff00;
}

.controls {
    margin-top: 30px;
    padding: 20px;
    border: 2px solid #00ff00;
}

.controls p {
    font-size: 14px;
}

.blink {
    animation: blink 1s infinite;
}

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

.hidden {
    display: none !important;
}

/* CRT effect */
#game-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        ellipse at center,
        transparent 0%,
        rgba(0, 0, 0, 0.3) 100%
    );
    pointer-events: none;
    z-index: 15;
}

/* Mobile Touch Controls */
#touch-controls {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

#joystick-zone {
    position: absolute;
    bottom: 20px;
    left: 20px;
    width: 150px;
    height: 150px;
    pointer-events: auto;
}

#joystick-base {
    position: absolute;
    width: 120px;
    height: 120px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 255, 0, 0.2);
    border: 3px solid rgba(0, 255, 0, 0.6);
    border-radius: 50%;
}

#joystick-stick {
    position: absolute;
    width: 50px;
    height: 50px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(0, 255, 0, 0.9) 0%, rgba(0, 200, 0, 0.7) 100%);
    border: 2px solid #00ff00;
    border-radius: 50%;
    transition: none;
}

#fire-button {
    position: absolute;
    bottom: 40px;
    right: 40px;
    width: 100px;
    height: 100px;
    background: rgba(255, 0, 100, 0.3);
    border: 3px solid rgba(255, 0, 100, 0.8);
    border-radius: 50%;
    color: #ff0064;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

#fire-button:active, #fire-button.active {
    background: rgba(255, 0, 100, 0.7);
}

/* Mobile responsive adjustments */
@media (max-width: 850px) {
    #game-container {
        width: 100vw;
        height: 100vh;
        border: none;
        box-shadow: none;
    }

    #ui {
        font-size: 12px;
    }

    #start-screen h1, #game-over h1 {
        font-size: 36px;
        letter-spacing: 4px;
    }

    #start-screen p, #game-over p {
        font-size: 14px;
    }

    .controls {
        padding: 10px;
    }

    .controls p {
        font-size: 11px;
    }
}

@media (max-width: 500px) {
    #joystick-zone {
        bottom: 15px;
        left: 15px;
        width: 120px;
        height: 120px;
    }

    #joystick-base {
        width: 100px;
        height: 100px;
    }

    #joystick-stick {
        width: 40px;
        height: 40px;
    }

    #fire-button {
        bottom: 25px;
        right: 25px;
        width: 80px;
        height: 80px;
        font-size: 14px;
    }
}
