/* screens.css — styles spécifiques par écran (lobby, personnalisation, HUD, podium). */

/* ═══════════════ ACCUEIL ═══════════════ */
.profile-badge {
  position: absolute; top: 24px; right: 24px; display: flex; gap: 10px;
  font-family: 'Bebas Neue', Impact, sans-serif; font-size: 22px; letter-spacing: 0.05em;
  background: rgba(9, 11, 18, 0.55); backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 20px; padding: 8px 18px;
}
.profile-badge span { color: var(--neon-yellow2); }

/* ═══════════════ LOBBY ═══════════════ */
.lobby-header { text-align: center; margin-top: 70px; }
.lobby-room-label { font-family: 'Bebas Neue', Impact, sans-serif; font-size: 26px; letter-spacing: 0.3em; opacity: 0.5; }
.lobby-room-code {
  font-family: 'Bebas Neue', Impact, sans-serif; font-size: 110px; letter-spacing: 0.2em;
  color: var(--neon-cyan); text-shadow: 0 0 30px rgba(0, 229, 255, 0.5);
}
.lobby-mode-label { font-family: 'Bebas Neue', Impact, sans-serif; font-size: 34px; color: var(--neon-orange); margin-top: 6px; }

.lobby-mode-select { width: 80%; max-width: 700px; margin: 24px auto 0; font-size: 30px; padding: 18px; }

/* Slot d'accueil de la preview 3D (#preview-wrap y est déplacé quand on est dans le lobby) */
#lobby-preview-slot { width: 100%; flex: 1 1 0; min-height: 0; display: flex; margin-top: 10px; }

.lobby-players-head {
  width: 90%; max-width: 820px; display: flex; justify-content: space-between;
  margin: 30px auto 10px; font-family: 'Bebas Neue', Impact, sans-serif; font-size: 28px;
  letter-spacing: 0.15em; opacity: 0.6;
}
.lobby-player-list { width: 90%; max-width: 820px; flex: 0 1 auto; max-height: 420px; margin: 0 auto; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.player-row {
  display: flex; align-items: center; gap: 16px; padding: 18px 20px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px; font-size: 30px;
}
.player-row.ready { border-color: rgba(0, 230, 130, 0.5); background: rgba(0, 230, 130, 0.08); }
.player-swatch { width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.3); flex: none; }
.player-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-host { font-size: 18px; color: var(--neon-yellow2); border: 1px solid var(--neon-yellow2); padding: 2px 10px; border-radius: 6px; }
.player-ready-tag { font-size: 20px; opacity: 0.7; min-width: 80px; text-align: right; }

.lobby-actions { width: 90%; max-width: 820px; margin: 20px auto 30px; }
#btn-toggle-ready.is-ready { background: linear-gradient(135deg, #33dd77, #119944); }

/* ═══════════════ PERSONNALISATION ═══════════════ */
#screen-customization { flex-direction: column; }
#preview-wrap { flex: 1 1 0; position: relative; width: 100%; touch-action: none; min-height: 0; }
#preview-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#preview-hint {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.5); padding: 10px 24px; border-radius: 20px;
  font-size: 20px; letter-spacing: 0.1em; opacity: 0.6;
}
.customization-panel {
  flex: 0 0 auto; width: 100%; padding: 30px 50px 50px;
  background: linear-gradient(0deg, rgba(4, 5, 10, 0.99), rgba(9, 11, 18, 0.92));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.presets-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; margin-bottom: 10px; }
.preset-swatch { aspect-ratio: 1; border-radius: 50%; cursor: pointer; border: 4px solid transparent; box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 3px 10px rgba(0,0,0,.4); }
.preset-swatch.on { border-color: #fff; box-shadow: 0 0 20px rgba(255,255,255,.4); }
.rgb-native-input { width: 100%; height: 80px; border: none; border-radius: 14px; cursor: pointer; background: none; padding: 0; }

/* ═══════════════ COUNTDOWN ═══════════════ */
#screen-countdown { align-items: center; justify-content: center; }
.countdown-number {
  font-family: 'Bebas Neue', Impact, sans-serif; font-size: 380px;
  color: var(--neon-orange); text-shadow: 0 0 60px rgba(255, 140, 0, 0.7);
}

/* ═══════════════ HUD IN-GAME ═══════════════ */
/* Ne PAS repasser #screen-hud en position:relative : l'ID écraserait le
   position:absolute+inset:0 de .screen, l'écran s'effondrerait à hauteur 0
   (tous ses enfants sont absolus) et le canvas 3D (height:100%) deviendrait
   invisible — écran noir en jeu, seuls les badges HUD débordants restent. */
#game-canvas-3d, #fx-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#fx-canvas { pointer-events: none; }

.hud-top { position: absolute; top: 20px; left: 0; right: 0; display: flex; justify-content: space-between; align-items: flex-start; padding: 0 30px; z-index: 5; }
.hud-role { font-family: 'Bebas Neue', Impact, sans-serif; font-size: 40px; padding: 10px 26px; border-radius: 12px; }
.hud-role.thief { background: rgba(255, 170, 0, 0.25); color: var(--neon-orange); border: 2px solid var(--neon-orange); }
.hud-role.cop { background: rgba(0, 102, 204, 0.25); color: var(--neon-cyan); border: 2px solid var(--neon-cyan); }
.hud-timer { font-family: 'Bebas Neue', Impact, sans-serif; font-size: 56px; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.8); }
.hud-timer.urgent { color: #ff3333; animation: pulseUrgent 0.6s infinite; }
.hud-team-scores { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-family: 'Bebas Neue', Impact, sans-serif; font-size: 30px; }
.team-thieves { color: var(--neon-orange); }
.team-cops { color: var(--neon-cyan); }

.hud-scoreboard {
  position: absolute; top: 130px; right: 24px; z-index: 5; display: flex; flex-direction: column; gap: 6px;
  background: rgba(9, 11, 18, 0.55); border-radius: 12px; padding: 10px; max-width: 340px;
}
.score-row { display: flex; align-items: center; gap: 8px; font-size: 20px; padding: 2px 6px; }
.score-row.me { background: rgba(255, 170, 0, 0.15); border-radius: 8px; }
.score-swatch { width: 16px; height: 16px; border-radius: 50%; flex: none; }
.score-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 120px; }
.score-lives { color: #ff5566; font-size: 16px; }

.hud-debug { position: absolute; bottom: 10px; left: 10px; z-index: 5; font-size: 14px; opacity: 0.3; }

/* Flèches radar (façon Midtown Madness 2) : anneau autour du centre de l'écran, une flèche
   par adversaire, orientée dans sa direction relative. Dorée + pulsante = porteur du trésor. */
#hud-arrows { position: absolute; top: 46%; left: 50%; width: 0; height: 0; z-index: 4; pointer-events: none; }
.hud-target-arrow { position: absolute; top: 0; left: 0; width: 0; height: 0; }
.hud-target-arrow-inner {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -330px);
  display: flex; flex-direction: column; align-items: center; gap: 0;
}
.hud-target-arrow-glyph { font-size: 46px; line-height: 1; text-shadow: 0 0 14px currentColor; }
.hud-target-arrow-label {
  font-family: 'Bebas Neue', Impact, sans-serif; font-size: 20px; letter-spacing: 0.08em;
  color: #fff; text-shadow: 0 2px 6px rgba(0,0,0,.9); white-space: nowrap;
}
.hud-target-arrow.cop .hud-target-arrow-glyph { color: var(--neon-cyan); }
.hud-target-arrow.thief .hud-target-arrow-glyph { color: var(--neon-orange); }
.hud-target-arrow.treasure .hud-target-arrow-glyph {
  color: #ffd700; font-size: 62px; animation: treasurePulse 0.8s infinite;
}
.hud-target-arrow.treasure .hud-target-arrow-label { color: #ffd700; font-size: 24px; }
@keyframes treasurePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.25); }
}

/* Boussole : direction du trésor le plus proche (voleur) ou de la planque (voleur chargé). */
.hud-compass {
  position: absolute; top: 200px; left: 50%; transform: translateX(-50%);
  z-index: 5; display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.hud-compass-arrow { font-size: 40px; color: var(--neon-cyan); text-shadow: 0 0 12px rgba(0,229,255,.7); transition: transform 0.1s linear; }
.hud-compass-label { font-family: 'Bebas Neue', Impact, sans-serif; font-size: 20px; opacity: 0.7; letter-spacing: 0.1em; }

/* ── Contrôles ── */
.controls-layer { position: absolute; inset: 0; z-index: 10; pointer-events: none; }
/* Zone de pilotage : moitié gauche de l'écran — le joystick (dynamique) se place sous le doigt. */
.steer-zone {
  position: absolute; left: 0; bottom: 0; width: 46%; height: 62%;
  pointer-events: all; touch-action: none;
}
.joystick-base {
  position: absolute; left: 60px; top: calc(100% - 400px); width: 340px; height: 340px;
  touch-action: none; opacity: 0.55; transition: opacity 0.15s;
}
.joystick-base.dragging { opacity: 1; transition: none; }
.joystick-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.12);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.04) 0%, transparent 65%);
}
.joystick-thumb {
  position: absolute; width: 130px; height: 130px; border-radius: 50%;
  top: 50%; left: 50%; transform: translate(-50%, -50%); pointer-events: none;
  background: radial-gradient(circle at 34% 30%, #ffaa55, #ff5500);
  box-shadow: 0 6px 26px rgba(255, 85, 0, .5), 0 0 0 4px rgba(255, 120, 40, .2), inset 0 1px 0 rgba(255,255,255,.25);
  transition: box-shadow 0.15s;
}
.joystick-thumb.active { box-shadow: 0 6px 34px rgba(255, 85, 0, .85), 0 0 0 6px rgba(255, 120, 40, .35), inset 0 1px 0 rgba(255,255,255,.3); }

.action-buttons { position: absolute; right: 40px; bottom: 40px; width: 480px; height: 480px; pointer-events: all; }
.btn-round {
  position: absolute; border-radius: 50%; border: none; cursor: pointer; touch-action: manipulation;
  font-family: 'Bebas Neue', Impact, sans-serif; letter-spacing: 0.05em; color: #fff;
  display: flex; align-items: center; justify-content: center; text-align: center;
}
.btn-round.pressed { filter: brightness(1.3); transform: scale(0.95); }
.btn-throttle {
  width: 190px; height: 190px; right: 0; bottom: 0; font-size: 34px;
  background: radial-gradient(circle at 34% 30%, #66ffaa, #22cc66);
  box-shadow: 0 6px 24px rgba(50, 230, 130, .5);
}
.btn-brake {
  width: 150px; height: 150px; right: 200px; bottom: 20px; font-size: 26px;
  background: radial-gradient(circle at 34% 30%, #ff8833, #cc2200);
  box-shadow: 0 6px 24px rgba(255, 100, 30, .5);
}
.btn-handbrake {
  width: 120px; height: 120px; right: 300px; bottom: 200px; font-size: 18px;
  background: radial-gradient(circle at 34% 30%, #ffee66, #cc9900);
  box-shadow: 0 6px 20px rgba(255, 220, 0, .4); color: #221900;
}
.btn-horn {
  width: 100px; height: 100px; right: 40px; bottom: 260px; font-size: 16px;
  background: radial-gradient(circle at 34% 30%, #6688ff, #2244cc);
  box-shadow: 0 6px 20px rgba(60, 100, 255, .4);
}
.btn-auto {
  width: 90px; height: 90px; right: 20px; bottom: 380px; font-size: 18px;
  background: radial-gradient(circle at 34% 30%, #556070, #2a3240);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .4); opacity: 0.65;
}
.btn-auto.on {
  background: radial-gradient(circle at 34% 30%, #66ffaa, #159955);
  box-shadow: 0 6px 20px rgba(50, 230, 130, .55); opacity: 1;
}
.btn-action {
  width: 130px; height: 130px; right: 150px; bottom: 340px; font-size: 20px;
  background: radial-gradient(circle at 34% 30%, #00e5ff, #0066cc);
  box-shadow: 0 6px 22px rgba(0, 200, 255, .5);
}
.btn-action.disabled { opacity: 0.35; filter: grayscale(0.6); box-shadow: none; }

/* ═══════════════ PODIUM ═══════════════ */
.podium-list { width: 90%; max-width: 850px; display: flex; flex-direction: column; gap: 14px; margin-top: 20px; flex: 1; overflow-y: auto; }
.podium-row {
  display: flex; align-items: center; gap: 16px; padding: 22px 26px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 16px;
  font-size: 30px;
}
.podium-row.rank-1 { border-color: var(--neon-yellow2); background: rgba(255, 204, 0, 0.12); }
.podium-row.me { outline: 2px solid var(--neon-cyan); }
.podium-rank { font-family: 'Bebas Neue', Impact, sans-serif; font-size: 44px; color: var(--neon-orange); width: 90px; }
.podium-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-score { font-family: 'Bebas Neue', Impact, sans-serif; font-size: 34px; }
.podium-rewards { font-size: 18px; opacity: 0.6; min-width: 220px; text-align: right; }
.podium-actions { width: 90%; max-width: 850px; margin: 30px auto; }
