* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Orbitron', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    background: #000;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#gameContainer {
    position: relative;
    width: 100%;
    max-width: 600px;
    height: 100vh;
    background: #000;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(0, 255, 255, 0.3);
}

#header {
    position: absolute;
    top: 0;
    width: 100%;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.8);
    color: #0ff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    z-index: 100;
    backdrop-filter: blur(10px);
    border-bottom: 2px solid #0ff;
    text-shadow: 0 0 10px #0ff;
}

#weaponIndicator {
    font-size: 14px;
    color: #ffd700;
    text-shadow: 0 0 5px #ffd700;
}

#switchWeaponBtn {
    padding: 5px 10px;
    font-size: 12px;
    background: rgba(0, 255, 255, 0.2);
    border: 1px solid #0ff;
    border-radius: 5px;
    color: #0ff;
    cursor: pointer;
    transition: all 0.2s;
}

#switchWeaponBtn:hover {
    background: rgba(0, 255, 255, 0.4);
    transform: scale(1.05);
}

#score, #level, #health, #combo {
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 1px;
}

#health {
    color: #ff6b6b;
    text-shadow: 0 0 10px #ff6b6b;
}

#combo {
    color: #ffd700;
    text-shadow: 0 0 10px #ffd700;
    animation: pulse-combo 0.5s ease-in-out infinite;
}

@keyframes pulse-combo {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

#gameCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at bottom, #1b2735 0%, #090a0f 100%);
    cursor: none;
    touch-action: none;
}

#startScreen, #gameOverScreen {
    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.95);
    z-index: 200;
    color: #0ff;
    text-align: center;
}

#gameOverScreen {
    display: none;
}

h1 {
    font-size: 42px;
    margin-bottom: 20px;
    text-shadow: 0 0 20px #0ff, 0 0 40px #0ff;
    letter-spacing: 3px;
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% {
        text-shadow: 0 0 20px #0ff, 0 0 40px #0ff;
    }
    50% {
        text-shadow: 0 0 30px #0ff, 0 0 60px #0ff, 0 0 80px #0ff;
    }
}

.instruction {
    font-size: 16px;
    margin: 8px 0;
    padding: 0 20px;
    color: #fff;
    text-shadow: 0 0 5px #0ff;
}

button {
    margin-top: 30px;
    padding: 15px 40px;
    font-size: 22px;
    font-weight: bold;
    color: #000;
    background: linear-gradient(135deg, #0ff 0%, #00f 100%);
    border: 2px solid #0ff;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 0 20px #0ff, inset 0 0 20px rgba(0, 255, 255, 0.3);
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 2px;
}

button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px #0ff, inset 0 0 30px rgba(0, 255, 255, 0.5);
}

button:active {
    transform: scale(0.95);
}

#finalScore, #waveReached {
    font-size: 28px;
    margin: 15px 0;
    color: #ffd700;
    text-shadow: 0 0 15px #ffd700;
}

#waveReached {
    font-size: 20px;
    color: #0ff;
    text-shadow: 0 0 10px #0ff;
}

.emoji {
    font-size: 70px;
    margin: 20px 0;
    filter: drop-shadow(0 0 20px #0ff);
}

#powerUpIndicator {
    position: absolute;
    top: 80px;
    right: 20px;
    z-index: 150;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.power-active {
    padding: 8px 12px;
    background: rgba(0, 255, 255, 0.2);
    border: 1px solid #0ff;
    border-radius: 5px;
    color: #0ff;
    font-size: 12px;
    text-shadow: 0 0 5px #0ff;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    display: none;
}

.power-active.active {
    display: block;
    animation: pulse-power 1s ease-in-out infinite;
}

@keyframes pulse-power {
    0%, 100% {
        box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(0, 255, 255, 1);
    }
}

/* Étoiles animées en arrière-plan */
@keyframes twinkle {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 1;
    }
}

#playerName {
    margin: 20px 0;
    padding: 12px 20px;
    font-size: 18px;
    background: rgba(0, 255, 255, 0.1);
    border: 2px solid #0ff;
    border-radius: 5px;
    color: #0ff;
    text-align: center;
    width: 200px;
    font-family: inherit;
}

#playerName::placeholder {
    color: rgba(0, 255, 255, 0.5);
}

#rankMessage {
    font-size: 18px;
    margin: 10px 0;
    color: #ffd700;
    text-shadow: 0 0 10px #ffd700;
    min-height: 25px;
}

#homeLeaderboardList {
    width: 100%;
    max-width: 500px;
    margin: 10px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}

.leaderboard-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid #0ff;
    border-radius: 8px;
    font-size: 16px;
}

.leaderboard-entry.top3 {
    background: rgba(255, 215, 0, 0.2);
    border-color: #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.leaderboard-rank {
    font-weight: bold;
    font-size: 20px;
    min-width: 40px;
    color: #ffd700;
}

.leaderboard-entry.top3 .leaderboard-rank {
    font-size: 24px;
}

.leaderboard-name {
    flex: 1;
    text-align: left;
    margin-left: 15px;
    font-weight: bold;
}

.leaderboard-score {
    font-size: 18px;
    color: #0ff;
    min-width: 80px;
}

.leaderboard-wave {
    font-size: 14px;
    color: rgba(0, 255, 255, 0.7);
    min-width: 60px;
}

.leaderboard-date {
    font-size: 12px;
    color: rgba(0, 255, 255, 0.5);
    margin-top: 5px;
}

.empty-leaderboard {
    padding: 40px;
    color: rgba(0, 255, 255, 0.5);
    font-size: 18px;
}

#startScreen h2 {
    margin-top: 30px;
    font-size: 24px;
    color: #0ff;
    text-shadow: 0 0 10px #0ff;
}

@media (max-width: 600px) {
    h1 {
        font-size: 32px;
    }
    .instruction {
        font-size: 14px;
    }
    #header {
        padding: 10px 15px;
    }
    #score, #level, #health {
        font-size: 14px;
    }
    .leaderboard-entry {
        padding: 12px 15px;
        font-size: 14px;
    }
    #homeLeaderboardList {
        max-height: 300px;
    }
}
