:root {
    --primary-color: #00ff88;
    --secondary-color: #0088ff;
    --accent-color: #ffaa00;
    --danger-color: #ff0040;
    --background-dark: #000011;
    --background-space: #000022;
    --text-color: #00ff88;
    --text-secondary: #88ccff;
    --success-color: #00ff44;
    --warning-color: #ffaa00;
    --border-radius: 4px;
    --neon-glow: 0 0 10px currentColor;
}

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

body {
    font-family: 'Orbitron', monospace;
    background: radial-gradient(circle at center, var(--background-space), var(--background-dark));
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow: hidden;
    position: relative;
}

/* Animated starfield background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(1px 1px at 20px 30px, white, transparent),
        radial-gradient(1px 1px at 40px 70px, white, transparent),
        radial-gradient(1px 1px at 90px 40px, white, transparent),
        radial-gradient(1px 1px at 130px 80px, white, transparent),
        radial-gradient(1px 1px at 160px 30px, white, transparent);
    background-repeat: repeat;
    background-size: 200px 200px;
    animation: stars 20s linear infinite;
    z-index: -1;
    opacity: 0.3;
}

@keyframes stars {
    from { transform: translateY(0); }
    to { transform: translateY(-200px); }
}

#game-container {
    background: rgba(0, 0, 34, 0.9);
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    box-shadow: var(--neon-glow);
    padding: 20px;
    max-width: 900px;
    width: 100%;
    position: relative;
}

.game-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: linear-gradient(180deg, #000011 0%, #000033 100%);
    color: white;
    font-family: 'Orbitron', 'Courier New', monospace;
    overflow: hidden;
}

.game-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    padding: 8px 16px;
    border-bottom: 2px solid #00ff88;
    box-shadow: 0 2px 10px rgba(0, 255, 136, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 50px;
}

.game-header h1 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 900;
    text-shadow: 0 0 10px #00ff88;
    letter-spacing: 2px;
}

.game-info {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.75rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 255, 136, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid rgba(0, 255, 136, 0.3);
}

.info-label {
    color: #00ff88;
    font-weight: bold;
    font-size: 0.7rem;
}

.info-value {
    color: white;
    font-weight: normal;
    min-width: 30px;
    text-align: right;
}

.fuel-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #000;
    border: 1px solid #00ff88;
    border-radius: 3px;
    width: 80px;
    height: 12px;
    position: relative;
    overflow: hidden;
}

.fuel-fill {
    background: linear-gradient(90deg, #ff4444 0%, #ffaa00 50%, #00ff88 100%);
    height: 100%;
    transition: width 0.3s ease;
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.6);
}

.fuel-text {
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 8px;
    color: white;
    text-shadow: 1px 1px 2px #000;
    z-index: 10;
}

#game-header h1 {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--primary-color);
    text-shadow: var(--neon-glow);
    margin-bottom: 15px;
    letter-spacing: 3px;
}

#game-info {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 15px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    background: rgba(0, 255, 136, 0.1);
    padding: 8px 12px;
    border-radius: var(--border-radius);
    border: 1px solid rgba(0, 255, 136, 0.3);
}

.info-label {
    color: var(--text-secondary);
    font-weight: 400;
}

.info-value {
    color: var(--primary-color);
    font-weight: 700;
    min-width: 40px;
    text-align: right;
}

.fuel-bar {
    width: 80px;
    height: 8px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.fuel-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--danger-color), var(--warning-color), var(--primary-color));
    transition: width 0.3s ease;
    width: 100%;
}

#game-board {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid var(--secondary-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.game-area {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background: 
        radial-gradient(ellipse at center, rgba(0, 50, 100, 0.1) 0%, transparent 50%),
        linear-gradient(180deg, #000011 0%, #000033 100%);
    padding: 10px;
    min-height: 0;
}

#game-canvas {
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: 4px;
    background: #000000;
    box-shadow: 
        0 0 20px rgba(0, 255, 136, 0.2),
        inset 0 0 50px rgba(0, 50, 100, 0.1);
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
}

#game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.overlay-message {
    background: rgba(0, 0, 17, 0.95);
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.5);
    max-width: 400px;
    backdrop-filter: blur(5px);
}

.overlay-message.success {
    border-color: var(--success-color);
    box-shadow: 0 0 30px rgba(0, 255, 68, 0.5);
}

.overlay-message h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--primary-color);
    text-shadow: var(--neon-glow);
}

.overlay-message.success h2 {
    color: var(--success-color);
}

.instructions {
    text-align: left;
    margin: 20px 0;
    background: rgba(0, 255, 136, 0.05);
    padding: 15px;
    border-radius: var(--border-radius);
    border: 1px solid rgba(0, 255, 136, 0.2);
}

.instructions p {
    margin: 5px 0;
    font-size: 0.9rem;
}

.instructions strong {
    color: var(--primary-color);
}

.mission-info {
    text-align: left;
    margin: 20px 0;
    background: rgba(255, 170, 0, 0.05);
    padding: 15px;
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 170, 0, 0.2);
}

.mission-info p {
    margin: 5px 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.mission-info strong {
    color: var(--accent-color);
}

#gameover-stats, #success-stats {
    margin: 15px 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

#gameover-stats p, #success-stats p {
    margin: 5px 0;
}

.action-btn {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: var(--background-dark);
    border: none;
    padding: 12px 24px;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    font-size: 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.3);
    margin-top: 15px;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 255, 136, 0.5);
    filter: brightness(1.1);
}

.action-btn:active {
    transform: translateY(0);
}

#warning-indicators {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.warning {
    background: rgba(255, 68, 68, 0.9);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.8rem;
    border: 1px solid #ff4444;
    box-shadow: 0 2px 8px rgba(255, 68, 68, 0.4);
    animation: warning-pulse 1s ease-in-out infinite alternate;
}

@keyframes warning-pulse {
    from { 
        background: rgba(255, 68, 68, 0.9);
        box-shadow: 0 2px 8px rgba(255, 68, 68, 0.4);
    }
    to { 
        background: rgba(255, 68, 68, 1);
        box-shadow: 0 4px 15px rgba(255, 68, 68, 0.8);
    }
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    #game-container {
        padding: 15px;
    }
    
    #game-header h1 {
        font-size: 2rem;
    }
    
    #game-info {
        font-size: 0.8rem;
    }
    
    #game-canvas {
        width: 100%;
        height: 400px;
    }
    
    .overlay-message {
        padding: 20px;
        font-size: 0.9rem;
        max-width: 300px;
    }
    
    .info-item {
        font-size: 0.8rem;
        padding: 6px 10px;
    }
    
    .fuel-bar {
        width: 60px;
        height: 6px;
    }
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 255, 136, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Particle effects */
@keyframes particle-float {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(-50px) rotate(360deg);
        opacity: 0;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-header {
        padding: 6px 12px;
        flex-direction: column;
        gap: 8px;
    }
    
    .game-header h1 {
        font-size: 1.1rem;
    }
    
    .game-info {
        gap: 6px;
        font-size: 0.65rem;
    }
    
    .info-item {
        padding: 2px 6px;
        gap: 4px;
    }
    
    .fuel-bar {
        width: 60px;
        height: 10px;
    }
    
    .fuel-text {
        font-size: 7px;
    }
    
    #warning-indicators {
        bottom: 60px;
        right: 10px;
    }
    
    .warning {
        font-size: 0.7rem;
        padding: 4px 8px;
    }
}

@media (max-width: 480px) {
    .game-header h1 {
        font-size: 1rem;
        letter-spacing: 1px;
    }
    
    .game-info {
        font-size: 0.6rem;
    }
    
    .fuel-bar {
        width: 50px;
        height: 8px;
    }
    
    .game-area {
        padding: 5px;
    }
}
