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

body {
    font-family: 'Courier New', monospace;
    overflow: hidden;
    background: #000;
    color: #0f0;
}

#game-container {
    width: 100vw;
    height: 100vh;
    position: relative;
}

canvas {
    display: block;
}

/* HUD Styles */
#hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.hud-top {
    display: flex;
    justify-content: space-around;
    padding: 20px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent);
}

.hud-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.8);
}

.hud-label {
    font-size: 12px;
    color: #0f0;
    margin-bottom: 5px;
}

.hud-value {
    font-size: 24px;
    font-weight: bold;
    color: #0ff;
}

.hud-left {
    position: absolute;
    left: 20px;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mute-button {
    position: absolute;
    right: 20px;
    top: 10px;
    background: rgba(0, 50, 0, 0.8);
    border: 2px solid #0f0;
    color: #0f0;
    font-size: 24px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: all;
    z-index: 20;
}

.mute-button:hover {
    background: rgba(0, 100, 0, 0.9);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
    transform: scale(1.1);
}

.mute-button.muted {
    border-color: #f00;
    color: #f00;
    background: rgba(50, 0, 0, 0.8);
}

.mute-button.muted:hover {
    background: rgba(100, 0, 0, 0.9);
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
}

.resource-bar {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.resource-label {
    font-size: 12px;
    color: #0f0;
}

.bar-container {
    width: 200px;
    height: 20px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #0f0;
    border-radius: 3px;
    overflow: hidden;
}

.bar {
    height: 100%;
    transition: width 0.3s ease;
}

.fuel-bar {
    background: linear-gradient(to right, #ff0000, #ffff00, #00ff00);
}

.oxygen-bar {
    background: linear-gradient(to right, #0000ff, #00ffff, #00ff00);
}

.resource-value {
    font-size: 14px;
    color: #0ff;
}

/* Radar */
#radar {
    position: absolute;
    right: 20px;
    bottom: 20px;
    width: 220px;
    height: 220px;
}

#radar-canvas {
    border: 2px solid #0f0;
    border-radius: 50%;
    background: rgba(0, 20, 0, 0.8);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
}

.radar-label {
    text-align: center;
    margin-top: 5px;
    font-size: 12px;
    color: #0f0;
}

/* Warnings */
#warnings {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    font-size: 24px;
    color: #ff0000;
    text-shadow: 0 0 20px rgba(255, 0, 0, 0.8);
    font-weight: bold;
    animation: pulse 0.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Screens */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    pointer-events: all;
    overflow-y: auto;
    padding: 20px;
}

.screen.hidden {
    display: none;
}

.screen h1 {
    font-size: 48px;
    color: #0ff;
    text-shadow: 0 0 20px rgba(0, 255, 255, 0.8);
    margin-bottom: 20px;
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { text-shadow: 0 0 20px rgba(0, 255, 255, 0.8); }
    50% { text-shadow: 0 0 40px rgba(0, 255, 255, 1); }
}

.subtitle {
    font-size: 16px;
    color: #0f0;
    margin-bottom: 20px;
}

.instructions {
    background: rgba(0, 50, 0, 0.3);
    border: 2px solid #0f0;
    border-radius: 10px;
    padding: 15px 20px;
    margin: 10px;
    max-width: 600px;
    text-align: left;
}

.instructions h3 {
    color: #0ff;
    margin-bottom: 8px;
    margin-top: 8px;
    font-size: 18px;
}

.instructions h3:first-child {
    margin-top: 0;
}

.instructions p {
    color: #0f0;
    margin: 8px 0;
    font-size: 14px;
    line-height: 1.5;
}

#game-stats, #victory-stats {
    background: rgba(0, 50, 0, 0.3);
    border: 2px solid #0f0;
    border-radius: 10px;
    padding: 30px;
    margin: 20px;
    min-width: 400px;
}

#game-stats p, #victory-stats p {
    color: #0f0;
    font-size: 18px;
    margin: 10px 0;
}

#game-stats span, #victory-stats span {
    color: #0ff;
    font-weight: bold;
}

.game-button {
    background: linear-gradient(to bottom, #0f0, #0a0);
    border: 3px solid #0ff;
    border-radius: 10px;
    color: #000;
    font-size: 24px;
    font-weight: bold;
    padding: 15px 40px;
    cursor: pointer;
    margin-top: 20px;
    font-family: 'Courier New', monospace;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
}

.game-button:hover {
    background: linear-gradient(to bottom, #0ff, #0aa);
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.8);
}

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

/* Touch Controls */
#touch-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    pointer-events: all;
    z-index: 50;
}

#touch-controls.hidden {
    display: none;
}

.touch-joystick {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.joystick-base {
    width: 120px;
    height: 120px;
    background: rgba(0, 255, 0, 0.2);
    border: 3px solid #0f0;
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
}

.joystick-stick {
    width: 50px;
    height: 50px;
    background: #0f0;
    border: 2px solid #0ff;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.8);
}

.touch-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.touch-button {
    width: 60px;
    height: 60px;
    background: rgba(0, 255, 0, 0.3);
    border: 3px solid #0f0;
    border-radius: 10px;
    color: #0f0;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.5);
}

.touch-button:active {
    background: rgba(0, 255, 0, 0.6);
    box-shadow: 0 0 25px rgba(0, 255, 0, 0.8);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hud-value {
        font-size: 18px;
    }
    
    .bar-container {
        width: 150px;
    }
    
    #radar {
        width: 150px;
        height: 150px;
    }
    
    #radar-canvas {
        width: 150px;
        height: 150px;
    }
    
    .screen h1 {
        font-size: 32px;
    }
    
    .instructions {
        padding: 20px;
        font-size: 14px;
    }
}

/* Loading indicator */
.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #0f0;
    font-size: 24px;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.8);
}
