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

body {
    font-family: 'Orbitron', 'Arial', sans-serif;
    background: #000;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

#game-container {
    width: 100%;
    height: 100%;
    position: relative;
    background: radial-gradient(ellipse at center, #1a1a2e 0%, #0f0f23 100%);
}

/* Animation d'étoiles en arrière-plan */
body::before {
    content: '';
    position: fixed;
    width: 200%;
    height: 200%;
    background-image: 
        radial-gradient(2px 2px at 20% 30%, white, transparent),
        radial-gradient(2px 2px at 60% 70%, white, transparent),
        radial-gradient(1px 1px at 50% 50%, white, transparent),
        radial-gradient(1px 1px at 80% 10%, white, transparent),
        radial-gradient(2px 2px at 90% 60%, white, transparent),
        radial-gradient(1px 1px at 33% 25%, white, transparent),
        radial-gradient(2px 2px at 70% 40%, white, transparent);
    background-size: 300% 300%;
    animation: stars 30s linear infinite;
    opacity: 0.4;
    z-index: 0;
}

@keyframes stars {
    from {
        transform: translate(0, 0);
    }
    to {
        transform: translate(-50%, -50%);
    }
}

/* Écran de démarrage */
#start-screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 100;
    width: 90%;
    max-width: 900px;
}

.game-title {
    font-size: 5em;
    font-weight: bold;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 10px;
    margin-bottom: 40px;
    background: linear-gradient(45deg, #00d4ff, #ff00ff, #00d4ff);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: neonPulse 3s ease infinite, gradientShift 4s ease infinite;
    filter: drop-shadow(0 0 30px rgba(0, 212, 255, 0.8)) 
            drop-shadow(0 0 60px rgba(255, 0, 255, 0.6));
}

@keyframes neonPulse {
    0%, 100% {
        filter: drop-shadow(0 0 30px rgba(0, 212, 255, 0.8)) 
                drop-shadow(0 0 60px rgba(255, 0, 255, 0.6));
    }
    50% {
        filter: drop-shadow(0 0 50px rgba(0, 212, 255, 1)) 
                drop-shadow(0 0 80px rgba(255, 0, 255, 0.8));
    }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.game-info {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.3);
}

.game-info h2 {
    color: #00d4ff;
    font-size: 2em;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.8);
}

.controls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.player-controls {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
}

.player-controls h3 {
    color: #fff;
    font-size: 1.5em;
    margin-bottom: 15px;
}

.player-controls:first-child h3 {
    color: #00d4ff;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.8);
}

.player-controls:last-child h3 {
    color: #ff006e;
    text-shadow: 0 0 10px rgba(255, 0, 110, 0.8);
}

.player-controls p {
    color: #fff;
    font-size: 1.1em;
    margin: 8px 0;
    text-align: left;
}

/* Boutons néon */
.neon-button {
    background: transparent;
    border: 3px solid #00d4ff;
    color: #00d4ff;
    padding: 20px 50px;
    font-size: 1.5em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 3px;
    cursor: pointer;
    border-radius: 10px;
    margin: 10px;
    transition: all 0.3s ease;
    box-shadow: 
        0 0 20px rgba(0, 212, 255, 0.5),
        inset 0 0 20px rgba(0, 212, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.neon-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(0, 212, 255, 0.3);
    transition: left 0.3s ease;
}

.neon-button:hover::before {
    left: 100%;
}

.neon-button:hover {
    background: rgba(0, 212, 255, 0.2);
    box-shadow: 
        0 0 40px rgba(0, 212, 255, 0.8),
        inset 0 0 30px rgba(0, 212, 255, 0.3);
    transform: scale(1.05);
}

.neon-button.secondary {
    border-color: #ff006e;
    color: #ff006e;
    box-shadow: 
        0 0 20px rgba(255, 0, 110, 0.5),
        inset 0 0 20px rgba(255, 0, 110, 0.1);
}

.neon-button.secondary::before {
    background: rgba(255, 0, 110, 0.3);
}

.neon-button.secondary:hover {
    background: rgba(255, 0, 110, 0.2);
    box-shadow: 
        0 0 40px rgba(255, 0, 110, 0.8),
        inset 0 0 30px rgba(255, 0, 110, 0.3);
}

/* Interface de jeu */
#game-screen {
    width: 100%;
    height: 100%;
    position: relative;
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
    background: transparent;
}

/* HUD */
#hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px;
    z-index: 10;
    pointer-events: none;
}

.player-hud {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border: 2px solid;
    border-radius: 15px;
    padding: 20px;
    min-width: 250px;
    box-shadow: 0 0 30px;
}

.player1-hud {
    border-color: #00d4ff;
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.5);
}

.player2-hud {
    border-color: #ff006e;
    box-shadow: 0 0 30px rgba(255, 0, 110, 0.5);
}

.player-hud h3 {
    font-size: 1.5em;
    margin-bottom: 15px;
    text-shadow: 0 0 10px currentColor;
}

.player1-hud h3 {
    color: #00d4ff;
}

.player2-hud h3 {
    color: #ff006e;
}

.stat-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: #fff;
    font-size: 1em;
}

.bar-container {
    flex: 1;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

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

.health-bar {
    background: linear-gradient(90deg, #00ff00, #00ff00);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.6);
    width: 100%;
}

.missiles-count {
    font-size: 1.5em;
    font-weight: bold;
    color: #ffff00;
    text-shadow: 0 0 10px rgba(255, 255, 0, 0.8);
}

.score {
    color: #fff;
    font-size: 1.2em;
    margin-top: 10px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.timer-container {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border: 3px solid #ffff00;
    border-radius: 15px;
    padding: 15px 30px;
    box-shadow: 0 0 30px rgba(255, 255, 0, 0.5);
}

#timer {
    font-size: 2.5em;
    font-weight: bold;
    color: #ffff00;
    text-shadow: 0 0 20px rgba(255, 255, 0, 0.8);
}

/* Écran de fin */
#end-screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 100;
    width: 90%;
    max-width: 800px;
}

#winner-announcement {
    font-size: 3em;
    font-weight: bold;
    color: #fff;
    margin: 30px 0;
    padding: 30px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 2px solid;
    border-radius: 20px;
    animation: victoryPulse 2s ease infinite;
}

@keyframes victoryPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

#final-scores {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 30px 0;
}

.final-score-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 2px solid;
    border-radius: 15px;
    padding: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .game-title {
        font-size: 3em;
        letter-spacing: 5px;
    }

    .controls-grid {
        grid-template-columns: 1fr;
    }

    #hud {
        flex-direction: column;
        align-items: stretch;
    }

    .player-hud {
        margin-bottom: 10px;
        min-width: auto;
    }

    .timer-container {
        align-self: center;
        margin: 10px 0;
    }

    .neon-button {
        padding: 15px 30px;
        font-size: 1.2em;
    }
}

@media (max-width: 480px) {
    .game-title {
        font-size: 2em;
    }

    .player-controls p {
        font-size: 0.9em;
    }

    #timer {
        font-size: 2em;
    }
}