@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&display=swap');

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

body {
    font-family: 'Orbitron', 'Courier New', monospace;
    background: #000;
    color: #00ff41;
    overflow: hidden;
    user-select: none;
}

#scene-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Scanline effect */
#scene-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 65, 0.05) 2px,
        rgba(0, 255, 65, 0.05) 4px
    );
    pointer-events: none;
    z-index: 10;
    animation: scanlines 0.1s linear infinite;
}

@keyframes scanlines {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

/* HUD */
.hud {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    pointer-events: none;
    font-size: 14px;
    font-weight: 700;
    text-shadow: 0 0 10px currentColor;
    animation: flicker 0.15s ease-in-out infinite alternate;
}

@keyframes flicker {
    0% { opacity: 1; }
    100% { opacity: 0.98; }
}

.hud-top-left {
    position: absolute;
    top: 20px;
    left: 20px;
}

.hud-top-right {
    position: absolute;
    top: 20px;
    right: 20px;
}

.hud-bottom-left {
    position: absolute;
    bottom: 80px;
    left: 20px;
}

.hud-bottom-right {
    position: absolute;
    bottom: 80px;
    right: 20px;
}

.hud-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.fuel-container {
    text-align: right;
}

.fuel-label {
    margin-bottom: 5px;
    font-size: 12px;
}

.fuel-bar {
    width: 120px;
    height: 15px;
    border: 2px solid #00ff41;
    background: transparent;
    position: relative;
}

.fuel-level {
    height: 100%;
    background: #00ff41;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px currentColor;
}

.game-message {
    font-size: 24px;
    font-weight: 900;
    opacity: 0;
    transition: opacity 0.3s ease;
    text-align: center;
    animation: glow 1s ease-in-out infinite alternate;
}

@keyframes glow {
    0% { text-shadow: 0 0 10px currentColor; }
    100% { text-shadow: 0 0 20px currentColor, 0 0 30px currentColor; }
}

/* Touch Controls */
.touch-controls {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 6;
    display: flex;
    gap: 20px;
    pointer-events: auto;
}

.control-btn {
    background: rgba(0, 255, 65, 0.1);
    border: 2px solid #00ff41;
    color: #00ff41;
    padding: 15px 20px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    text-shadow: 0 0 10px currentColor;
    transition: all 0.2s ease;
    touch-action: manipulation;
}

.control-btn:hover,
.control-btn:active {
    background: rgba(0, 255, 65, 0.3);
    box-shadow: 0 0 15px #00ff41;
}

.thrust-btn {
    padding: 20px 30px;
    font-size: 16px;
}

.rotate-btn {
    width: 60px;
    height: 60px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* Menu Screens */
.menu-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    backdrop-filter: blur(5px);
}

.menu-screen.hidden {
    display: none;
}

.menu-content {
    text-align: center;
    max-width: 500px;
    padding: 40px;
    border: 3px solid #00ff41;
    background: rgba(0, 0, 0, 0.8);
    box-shadow: 
        0 0 20px #00ff41,
        inset 0 0 20px rgba(0, 255, 65, 0.1);
}

.title {
    font-size: 48px;
    font-weight: 900;
    margin-bottom: 20px;
    text-shadow: 
        0 0 10px currentColor,
        0 0 20px currentColor,
        0 0 30px currentColor;
    animation: titlePulse 2s ease-in-out infinite alternate;
}

@keyframes titlePulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.05); }
}

.subtitle {
    font-size: 18px;
    margin-bottom: 30px;
    opacity: 0.8;
}

.instructions {
    margin: 30px 0;
    font-size: 14px;
    line-height: 1.8;
}

.instructions p {
    margin: 5px 0;
}

.score-display {
    margin: 30px 0;
    font-size: 16px;
    line-height: 2;
}

.menu-btn {
    background: transparent;
    border: 2px solid #00ff41;
    color: #00ff41;
    padding: 15px 30px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin: 10px;
    text-shadow: 0 0 10px currentColor;
    transition: all 0.3s ease;
}

.menu-btn:hover {
    background: rgba(0, 255, 65, 0.2);
    box-shadow: 0 0 20px #00ff41;
    transform: scale(1.05);
}

/* Attribution */
.attribution {
    position: fixed;
    bottom: 10px;
    right: 10px;
    z-index: 30;
    font-size: 12px;
    opacity: 0.6;
}

.attribution a {
    color: #00ff41;
    text-decoration: none;
}

.attribution a:hover {
    text-shadow: 0 0 10px currentColor;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .hud {
        font-size: 12px;
    }
    
    .title {
        font-size: 36px;
    }
    
    .menu-content {
        margin: 20px;
        padding: 30px 20px;
    }
    
    .fuel-bar {
        width: 80px;
        height: 12px;
    }
    
    .touch-controls {
        bottom: 10px;
        gap: 15px;
    }
    
    .control-btn {
        padding: 12px 16px;
        font-size: 12px;
    }
    
    .thrust-btn {
        padding: 15px 20px;
        font-size: 14px;
    }
    
    .rotate-btn {
        width: 50px;
        height: 50px;
        font-size: 16px;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hud {
        text-rendering: optimizeLegibility;
    }
}

/* Landscape mobile */
@media (max-height: 500px) {
    .menu-content {
        padding: 20px;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .title {
        font-size: 28px;
        margin-bottom: 10px;
    }
    
    .instructions {
        margin: 15px 0;
        font-size: 12px;
    }
}