* { box-sizing: border-box; margin: 0; padding: 0; user-select: none; -webkit-user-select: none; }
body { background: #0d0f14; color: #f0f4f8; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; overflow: hidden; }

.screen { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; z-index: 10; }
.screen.active { display: flex; }

.card { background: #181c26; border: 1px solid #2d3548; padding: 28px; border-radius: 12px; width: 90%; max-width: 420px; text-align: center; box-shadow: 0 12px 30px rgba(0,0,0,0.6); }
.card.wide { max-width: 720px; }
h2 { margin-bottom: 8px; letter-spacing: 1px; }
.sub { color: #94a3b8; font-size: 0.9rem; margin-bottom: 18px; }
.highlight { color: #38bdf8; font-family: monospace; font-size: 1.4rem; }
.error-msg { color: #ef4444; font-size: 0.9rem; margin-top: 10px; min-height: 20px; }

input { width: 100%; padding: 12px; margin: 10px 0; background: #0f131a; border: 1px solid #334155; color: #fff; border-radius: 6px; font-size: 1rem; text-align: center; }
button { width: 100%; padding: 12px; margin-top: 8px; background: #2563eb; color: #fff; border: none; border-radius: 6px; font-weight: bold; cursor: pointer; transition: 0.15s; }
button:hover { background: #1d4ed8; }
.start-btn { background: #10b981; font-size: 1.1rem; margin-top: 20px; }
.start-btn:hover { background: #059669; }

.mode-grid, .team-setup { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 15px; }
.mode-box, .team-box { background: #11151e; padding: 18px; border-radius: 8px; border: 1px solid #283044; }
.blue-box { border-color: #2563eb; }
.red-box { border-color: #ef4444; }
.team-box ul { list-style: none; min-height: 110px; margin: 12px 0; text-align: left; font-size: 0.9rem; color: #cbd5e1; }
.team-box li { padding: 4px 8px; border-bottom: 1px solid #1e293b; }

/* HUD EN JEU */
#game-ui { pointer-events: none; justify-content: space-between; padding: 14px; }
#game-canvas { position: absolute; inset: 0; width: 100vw; height: 100vh; z-index: 1; display: none; }

#top-hud { display: flex; align-items: center; justify-content: center; gap: 24px; background: rgba(15, 19, 26, 0.85); padding: 10px 24px; border-radius: 12px; border: 1px solid #334155; }
.team-hud { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.status-bar { display: flex; gap: 6px; min-height: 32px; }

.player-slot { width: 30px; height: 30px; border-radius: 6px; position: relative; border: 2px solid #fff; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 0.75rem; }
.player-slot.blue { background: #2563eb; }
.player-slot.red { background: #ef4444; }
.player-slot.dead { filter: grayscale(100%); opacity: 0.45; }
.player-slot.dead::after { content: "✖"; color: #ff0000; font-size: 24px; position: absolute; filter: none; }

.score-text { font-size: 1.2rem; font-weight: 900; }
.blue-score { color: #60a5fa; }
.red-score { color: #f87171; }
.center-vs { text-align: center; }
#timer-display { font-size: 1.3rem; font-weight: bold; font-family: monospace; color: #f8fafc; }
.vs-label { font-size: 0.9rem; font-weight: 900; color: #facc15; }

#crosshair { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 26px; color: rgba(255,255,255,0.85); font-family: monospace; }
#killcam-banner { position: absolute; top: 110px; background: rgba(220, 38, 38, 0.85); padding: 10px 24px; border-radius: 8px; font-weight: bold; font-size: 1.1rem; }

#bottom-hud { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 10px; }
.hp-container { width: 260px; height: 24px; background: #1e293b; border-radius: 12px; overflow: hidden; position: relative; border: 2px solid #475569; }
#hp-bar { width: 100%; height: 100%; background: #22c55e; transition: width 0.1s; }
#hp-text { position: absolute; inset: 0; text-align: center; line-height: 20px; font-size: 0.85rem; font-weight: bold; }
.weapon-info { background: rgba(0,0,0,0.65); padding: 6px 14px; border-radius: 6px; font-size: 0.85rem; }

/* Contrôles Mobiles */
#mobile-controls { position: absolute; bottom: 20px; left: 20px; right: 20px; display: none; justify-content: space-between; align-items: flex-end; pointer-events: auto; }
@media (pointer: coarse), (max-width: 900px) {
    #mobile-controls { display: flex; }
}
.stick-group { display: flex; align-items: center; gap: 14px; }
.joystick-zone { width: 110px; height: 110px; border-radius: 50%; background: rgba(255,255,255,0.12); border: 2px solid rgba(255,255,255,0.3); position: relative; touch-action: none; }
.joystick-knob { width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,0.7); position: absolute; top: 31px; left: 31px; pointer-events: none; }
.mob-btn { width: 64px; height: 64px; border-radius: 50%; pointer-events: auto; font-size: 0.8rem; margin: 0; }
.shoot-btn { background: rgba(239, 68, 68, 0.85); border: 2px solid #fff; }
.sub-btns { display: flex; flex-direction: column; gap: 8px; }
.sub-btn { width: 52px; height: 52px; background: rgba(59, 130, 246, 0.8); font-size: 0.7rem; padding: 0; }

/* Écran de fin */
#end-screen { background: rgba(0, 0, 0, 0.88); z-index: 50; }
.thats-the-game { font-size: 4.5rem; font-weight: 900; color: #facc15; text-shadow: 0 6px 0 #b45309, 0 12px 25px #000; letter-spacing: 3px; text-align: center; }