/* ==========================================================================
   NEON CYBER DUEL - STYLE SHEET
   Cyberpunk / Neon Arcade Theme for Kids Mobile & Desktop
   ========================================================================== */

:root {
  --bg-dark: #070714;
  --bg-card: rgba(15, 15, 35, 0.85);
  --neon-cyan: #00f0ff;
  --neon-pink: #ff007f;
  --neon-yellow: #ffe600;
  --neon-green: #39ff14;
  --neon-purple: #9d4edd;
  --text-main: #ffffff;
  --text-dim: #a0a5c0;
  --border-neon: rgba(0, 240, 255, 0.4);
  --font-title: 'Orbitron', 'Rajdhani', sans-serif;
  --font-body: 'Rajdhani', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-dark);
  font-family: var(--font-body);
  color: var(--text-main);
  touch-action: none;
}

/* Container Principal du Jeu */
#game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at center, #121230 0%, #050510 100%);
  overflow: hidden;
}

/* Canvas de Jeu 2D */
#gameCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
  touch-action: none;
}

/* Overlays UI */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.overlay.hidden {
  display: none !important;
}

/* Regle generique : n'importe quel element avec .hidden doit se cacher, */
/* pas seulement les .overlay (bug : manga-announcement n'a pas la classe .overlay) */
.hidden {
  display: none !important;
}

/* Screens (Start, GameOver, Pause, Garage, Hauts Faits, Boutique) */
/* BUG CORRIGE 2026-07-26 : screen-garage/achievements/shop manquaient ici -> heritaient */
/* de pointer-events:none de la regle .overlay generique -> le canvas du jeu (en dessous) */
/* interceptait tous les clics, rendant impossible de choisir un skin/pouvoir dans le garage. */
#screen-start, #screen-gameover, #screen-pause, #screen-garage, #screen-achievements, #screen-shop, #screen-talents, #screen-patchnotes, #screen-equipment, #screen-weapon-drop, #screen-codex, #modal-lootbox, #modal-add-player {
  background: rgba(7, 7, 20, 0.55);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  pointer-events: auto;
  justify-content: center;
  align-items: flex-start;
  padding: 15px 15px calc(25px + env(safe-area-inset-bottom, 0px)) 15px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.overlay.hidden {
  display: none !important;
  pointer-events: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

#game-canvas {
  will-change: transform;
  transform: translateZ(0);
}

/* Ecran d'accueil : overlay quasi-transparent pour laisser voir le decor spatial */
#screen-start {
  background: rgba(7, 7, 20, 0.12);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
  position: relative;
}

/* Bouton Plein Écran (Top Left sur écran d'accueil avec clamp pour éviter les chevauchements) */
.btn-fullscreen {
  position: absolute;
  top: clamp(8px, 1.8vh, 15px);
  left: clamp(8px, 1.8vw, 15px);
  z-index: 1001;
  background: rgba(15, 15, 35, 0.85);
  border: 1px solid var(--neon-cyan);
  color: var(--neon-cyan);
  font-family: var(--font-title);
  font-size: 0.82rem;
  font-weight: bold;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.3);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  pointer-events: auto;
}

.btn-fullscreen:hover {
  background: rgba(0, 240, 255, 0.2);
  transform: scale(1.05);
}

/* Cartes Style Néon (Toutes adaptatives avec scroll indépendant) */
.screen-card {
  background: var(--bg-card);
  border: 2px solid var(--neon-cyan);
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.3), inset 0 0 15px rgba(0, 240, 255, 0.1);
  border-radius: 16px;
  padding: 20px 20px calc(24px + env(safe-area-inset-bottom, 0px)) 20px;
  margin: auto auto calc(15px + env(safe-area-inset-bottom, 0px)) auto;
  max-width: 540px;
  width: 100%;
  max-height: calc(86vh - env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-sizing: border-box;
  animation: cardFadeIn 0.3s ease-out;
}

/* Badge de Rang Cyber (Carte Blanche Polish) */
.cyber-rank-badge {
  background: rgba(0, 0, 0, 0.45);
  border: 2px solid var(--neon-yellow);
  box-shadow: 0 0 15px rgba(255, 230, 0, 0.3);
  border-radius: 12px;
  padding: 8px 16px;
  margin: 10px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  max-width: 320px;
}

.cyber-rank-badge .rank-title {
  font-family: var(--font-title);
  font-size: 0.75rem;
  color: var(--text-dim);
}

.cyber-rank-badge .rank-grade {
  font-family: var(--font-title);
  font-size: 1.8rem;
  font-weight: 900;
}

.cyber-rank-badge .rank-label {
  font-family: var(--font-title);
  font-size: 0.85rem;
  font-weight: bold;
  color: var(--neon-cyan);
}

@keyframes cardFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* Titre & Logo */
.logo-container {
  text-align: center;
}

.glitch-title {
  font-family: var(--font-title);
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--neon-cyan);
  text-shadow: 0 0 10px var(--neon-cyan), 0 0 20px var(--neon-cyan);
  text-transform: uppercase;
}

.subtitle {
  font-size: 0.95rem;
  color: var(--neon-pink);
  font-weight: 700;
  letter-spacing: 1px;
  margin-top: 4px;
}

/* Choix de Joueur (Gabriel / Martin) */
.turn-selector h2 {
  font-size: 0.9rem;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 10px;
  letter-spacing: 1px;
}

.player-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.btn-player {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #fff;
  text-align: left;
}

.btn-player:hover, .btn-player:active {
  transform: translateY(-2px);
}

.btn-gabriel.active-player {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
}

.btn-martin.active-player {
  background: rgba(255, 0, 127, 0.15);
  border-color: var(--neon-pink);
  box-shadow: 0 0 15px rgba(255, 0, 127, 0.4);
}

.player-avatar {
  font-size: 1.8rem;
}

.player-meta {
  display: flex;
  flex-direction: column;
}

.player-title {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.1rem;
}

.player-subtitle {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Boutons d'Action CTA */
.btn-cta {
  width: 100%;
  padding: 14px 20px;
  border-radius: 12px;
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 800;
  border: none;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.2s ease;
  letter-spacing: 1px;
}

.btn-neon-green {
  background: var(--neon-green);
  color: #050814 !important;
  box-shadow: 0 0 20px rgba(57, 255, 20, 0.5);
}

.btn-neon-green:hover, .btn-neon-green:active {
  background: #4ef02b;
  box-shadow: 0 0 30px rgba(57, 255, 20, 0.8);
  transform: scale(1.02);
}

.btn-neon-pink {
  background: var(--neon-pink);
  color: #050814 !important;
  box-shadow: 0 0 20px rgba(255, 0, 127, 0.5);
}

.btn-neon-cyan {
  background: var(--neon-cyan);
  color: #050814 !important;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.5);
}

.btn-neon-yellow {
  background: var(--neon-yellow);
  color: #050814 !important;
  box-shadow: 0 0 20px rgba(255, 230, 0, 0.5);
}

/* Comment Jouer */
.how-to-play {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.85rem;
}

.how-to-play h3 {
  font-size: 0.9rem;
  color: var(--neon-yellow);
  margin-bottom: 8px;
}

.how-to-play ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Mini Leaderboard & Full Leaderboard */
.mini-leaderboard h3, .full-leaderboard h3 {
  font-size: 0.9rem;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 8px;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
}

.lb-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.04);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  border-left: 3px solid transparent;
}

.lb-row.top-1 {
  border-left-color: var(--neon-yellow);
  background: rgba(255, 230, 0, 0.08);
}
.lb-row.top-2 {
  border-left-color: var(--neon-cyan);
}
.lb-row.top-3 {
  border-left-color: var(--neon-pink);
}

.lb-rank {
  font-weight: bold;
  width: 24px;
}

.lb-name {
  flex-grow: 1;
  font-weight: 700;
  padding: 0 8px;
}

.lb-score {
  font-family: var(--font-title);
  color: var(--neon-yellow);
  font-weight: 700;
}

/* HUD Top Bar */
.hud-top {
  pointer-events: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  width: 100%;
  background: linear-gradient(180deg, rgba(7, 7, 20, 0.88) 0%, rgba(7, 7, 20, 0.3) 70%, rgba(7, 7, 20, 0) 100%);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.hud-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(15, 15, 35, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 4px 8px;
}

.hud-label {
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 1px;
  font-weight: 700;
}

.hud-value {
  font-family: var(--font-title);
  font-size: 1.2rem;
  font-weight: 900;
}

.neon-cyan { color: var(--neon-cyan); text-shadow: 0 0 8px var(--neon-cyan); }
.neon-pink { color: var(--neon-pink); text-shadow: 0 0 8px var(--neon-pink); }
.neon-yellow { color: var(--neon-yellow); text-shadow: 0 0 8px var(--neon-yellow); }

/* Barre de Vie Horizontale */
.health-bar-container {
  width: 90px;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin: 3px 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.health-bar-fill {
  height: 100%;
  width: 100%;
  transition: width 0.25s ease, background 0.25s ease;
}

.health-bar-fill.high-hp {
  background: linear-gradient(90deg, var(--neon-green), var(--neon-cyan));
}

.health-bar-fill.mid-hp {
  background: linear-gradient(90deg, var(--neon-yellow), #ff9900);
}

.health-bar-fill.low-hp {
  background: #ff003c;
  animation: hpBlink 0.5s infinite alternate;
}

@keyframes hpBlink {
  from { opacity: 0.6; }
  to { opacity: 1.0; }
}

/* Barre de Timer */
.timer-box {
  flex-grow: 1;
  max-width: 220px;
  margin: 0 8px;
}

.timer-bar-container {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin: 4px 0;
  border: 1px solid rgba(255, 0, 127, 0.3);
}

#timer-bar-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--neon-pink), var(--neon-yellow));
  transition: width 0.2s linear;
}

/* Overlay Ambient Vignette */
.ambient-vignette {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 2;
  box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.65);
}

/* Overlay Red Critical Vignette */
.critical-vignette {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 3;
  box-shadow: inset 0 0 70px rgba(255, 0, 60, 0.85);
  animation: criticalPulse 0.8s infinite alternate;
}

@keyframes criticalPulse {
  0% { box-shadow: inset 0 0 40px rgba(255, 0, 60, 0.4); }
  100% { box-shadow: inset 0 0 90px rgba(255, 0, 60, 0.95); }
}

/* Shield Bar HUD */
.shield-box {
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid var(--neon-cyan);
  border-radius: 10px;
  padding: 4px 14px;
  margin-bottom: 4px;
}

.shield-bar-container {
  width: 120px;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 3px;
  border: 1px solid var(--neon-cyan);
}

.shield-bar-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #00f0ff, #0077ff);
  transition: width 0.15s linear;
}

/* Middle HUD (Bonus Badge & Combo) */
.hud-middle {
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 10px;
  gap: 8px;
}

.powerup-badge {
  background: rgba(15, 15, 35, 0.9);
  border: 2px solid var(--neon-green);
  box-shadow: 0 0 12px rgba(57, 255, 20, 0.4);
  border-radius: 20px;
  padding: 6px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-title);
  font-size: 0.85rem;
  font-weight: 700;
  animation: badgePulse 1s infinite alternate;
}

@keyframes badgePulse {
  from { transform: scale(0.98); }
  to { transform: scale(1.02); }
}

.powerup-meter {
  width: 50px;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  overflow: hidden;
}

#powerup-meter-fill {
  width: 100%;
  height: 100%;
  background: var(--neon-green);
}

.combo-popup {
  font-family: var(--font-title);
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--neon-yellow);
  text-shadow: 0 0 12px var(--neon-yellow);
  animation: popAnim 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popAnim {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1.2); opacity: 1; }
}

/* Boutons Contrôles HUD (Top-right) */
.hud-controls {
  pointer-events: auto;
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  z-index: 12;
}

.icon-btn {
  background: rgba(15, 15, 35, 0.7);
  border: 1px solid var(--border-neon);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  color: #fff;
  transition: all 0.2s ease;
}

.icon-btn:active {
  transform: scale(0.9);
}

/* COMMANDES TACTILES VIRTUELLES */
#touch-controls {
  pointer-events: auto;
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 45%;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 20px 25px calc(90px + env(safe-area-inset-bottom, 0px)) 25px;
  z-index: 11;
  touch-action: none;
}

/* Zone Joysticks Twin-Stick (Gauche: Move 🕹️, Droit: Visée & Tir 🎯) */
.joystick-zone {
  width: 140px;
  height: 140px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.joystick-base {
  width: 110px;
  height: 110px;
  background: rgba(0, 240, 255, 0.08);
  border: 2px solid rgba(0, 240, 255, 0.4);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
  border-radius: 50%;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.aim-joystick-base {
  background: rgba(255, 0, 127, 0.08);
  border-color: rgba(255, 0, 127, 0.5);
  box-shadow: 0 0 15px rgba(255, 0, 127, 0.25);
}

.joystick-stick {
  width: 44px;
  height: 44px;
  background: radial-gradient(circle, var(--neon-cyan) 0%, rgba(0, 240, 255, 0.6) 100%);
  border: 2px solid #ffffff;
  box-shadow: 0 0 15px var(--neon-cyan);
  border-radius: 50%;
  position: absolute;
  transition: transform 0.05s linear;
}

.aim-joystick-stick {
  background: radial-gradient(circle, var(--neon-pink) 0%, rgba(255, 0, 127, 0.7) 100%);
  box-shadow: 0 0 15px var(--neon-pink);
}

.joystick-label {
  position: absolute;
  bottom: -22px;
  font-family: var(--font-title);
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--text-dim);
  letter-spacing: 1px;
}

/* Zone d'Action Droite (Tir & Dash) & Control Group */
.touch-right-controls {
  display: flex;
  align-items: flex-end;
  gap: 15px;
}

#action-zone {
  display: flex;
  gap: 15px;
  align-items: flex-end;
}

.touch-btn {
  border: none;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  font-family: var(--font-title);
  font-weight: 700;
  color: #fff;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  touch-action: none;
}

.touch-btn:active {
  transform: scale(0.92);
}

.fire-btn {
  width: 85px;
  height: 85px;
  background: radial-gradient(circle, var(--neon-pink) 0%, rgba(255, 0, 127, 0.6) 100%);
  border: 3px solid #ffffff;
  box-shadow: 0 0 20px rgba(255, 0, 127, 0.6);
  font-size: 0.8rem;
}

.dash-btn {
  width: 65px;
  height: 65px;
  background: radial-gradient(circle, var(--neon-yellow) 0%, rgba(255, 230, 0, 0.6) 100%);
  border: 2px solid #ffffff;
  box-shadow: 0 0 15px rgba(255, 230, 0, 0.6);
  color: #000;
  font-size: 0.7rem;
}

.special-btn {
  width: 70px;
  height: 70px;
  background: radial-gradient(circle, #ffe600 0%, #9d4edd 100%);
  border: 2px solid #ffffff;
  box-shadow: 0 0 20px #ffe600, 0 0 30px #9d4edd;
  color: #fff;
  font-size: 0.75rem;
  animation: specialPulse 0.8s infinite alternate;
}

@keyframes specialPulse {
  from { transform: scale(0.95); box-shadow: 0 0 15px #ffe600; }
  to { transform: scale(1.08); box-shadow: 0 0 30px #ffe600, 0 0 45px #9d4edd; }
}

/* Jauge de Pouvoir Spécial Manga */
.special-meter-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  margin-top: 4px;
}

.special-label {
  font-family: var(--font-title);
  font-size: 0.65rem;
  font-weight: 900;
  color: var(--neon-yellow);
  letter-spacing: 1px;
  text-shadow: 0 0 8px var(--neon-yellow);
}

.special-bar-container {
  width: 160px;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--neon-yellow);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 0 8px rgba(255, 230, 0, 0.3);
}

#special-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #9d4edd, #ff007f, #ffe600);
  transition: width 0.15s ease-out;
}

/* Overlay d'Annonce Manga : place tout en haut, au dessus de la zone de jeu, pour ne pas gener le pilotage */
.manga-announcement {
  position: absolute;
  top: calc(64px + env(safe-area-inset-top, 0px));
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  z-index: 100;
}

.manga-banner {
  background: rgba(7, 7, 20, 0.88);
  border-top: 4px solid var(--neon-yellow);
  border-bottom: 4px solid var(--neon-pink);
  box-shadow: 0 0 40px rgba(255, 0, 127, 0.6);
  padding: 10px 20px;
  max-width: 90vw;
  text-align: center;
  transform: skewX(-10deg);
  animation: popInManga 0.35 cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* clamp() evite qu'un long titre de boss (ex: "SUPER BOSS CYBER TITAN N°1 APPARAIT !")
   ne s'etale sur 4 lignes et couvre une trop grande partie de l'ecran sur mobile etroit */
#manga-announcement-text {
  font-family: var(--font-title);
  font-size: clamp(0.95rem, 4.2vw, 2.2rem);
  font-weight: 900;
  letter-spacing: 2px;
  color: #ffffff;
  text-shadow: 0 0 15px var(--neon-yellow), 0 0 30px var(--neon-pink);
  text-transform: uppercase;
  line-height: 1.25;
}

@keyframes popInManga {
  0% { transform: skewX(-10deg) scale(0.3); opacity: 0; }
  70% { transform: skewX(-10deg) scale(1.1); opacity: 1; }
  100% { transform: skewX(-10deg) scale(1); opacity: 1; }
}

/* Sélecteur de Difficulté */
.difficulty-selector {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 4px;
}

.difficulty-selector h2 {
  font-family: var(--font-title);
  font-size: 0.85rem;
  color: var(--neon-yellow);
  letter-spacing: 1px;
}

.difficulty-buttons {
  display: flex;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.btn-diff {
  flex: 1;
  background: rgba(15, 15, 35, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-family: var(--font-title);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 6px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-diff:hover {
  transform: translateY(-2px);
}

.btn-diff-easy.active-diff {
  border-color: var(--neon-green);
  background: rgba(57, 255, 20, 0.18);
  box-shadow: 0 0 14px rgba(57, 255, 20, 0.4);
  color: var(--neon-green);
}

.btn-diff-normal.active-diff {
  border-color: var(--neon-yellow);
  background: rgba(255, 230, 0, 0.18);
  box-shadow: 0 0 14px rgba(255, 230, 0, 0.4);
  color: var(--neon-yellow);
}

.btn-diff-hard.active-diff {
  border-color: #ff003c;
  background: rgba(255, 0, 60, 0.22);
  box-shadow: 0 0 14px rgba(255, 0, 60, 0.5);
  color: #ff003c;
}

/* Carte Duel Fraternel Gabriel vs Martin */
.fraternal-duel-card {
  background: rgba(15, 15, 35, 0.85);
  border: 2px solid rgba(255, 230, 0, 0.3);
  border-radius: 14px;
  padding: 12px 14px;
  margin-top: 12px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  box-shadow: inset 0 0 12px rgba(255, 230, 0, 0.1);
}

.fraternal-duel-card h3 {
  font-family: var(--font-title);
  font-size: 0.85rem;
  color: var(--neon-yellow);
  letter-spacing: 1px;
  margin: 0;
}

.fraternal-banner {
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  background: rgba(0, 240, 255, 0.15);
  border: 1px solid var(--neon-cyan);
  padding: 6px 14px;
  border-radius: 20px;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
  text-align: center;
}

.fraternal-scores {
  display: flex;
  align-items: center;
  justify-content: space-around;
  width: 100%;
  margin-top: 2px;
}

.fraternal-score-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.fraternal-avatar {
  font-size: 1.5rem;
}

.fraternal-name {
  font-family: var(--font-title);
  font-size: 0.8rem;
  font-weight: 700;
}

.fraternal-score-item.gabriel .fraternal-name,
.fraternal-score-item.gabriel .fraternal-val {
  color: var(--neon-cyan);
}

.fraternal-score-item.martin .fraternal-name,
.fraternal-score-item.martin .fraternal-val {
  color: var(--neon-pink);
}

.fraternal-val {
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 900;
}

.fraternal-vs {
  font-family: var(--font-title);
  font-size: 0.9rem;
  font-weight: 900;
  color: var(--neon-yellow);
}

/* Screen Flash Overlay */
.screen-flash {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #ffffff;
  pointer-events: none;
  z-index: 99;
  opacity: 0;
  transition: opacity 0.05s ease-out;
}

.screen-flash.active {
  opacity: 0.85;
}

/* Actions Sub-Menu (Garage, Talents & Succès) */
.menu-sub-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
}

.menu-sub-actions .btn-cta {
  font-size: 0.82rem;
  padding: 10px 4px;
  text-align: center;
  white-space: nowrap;
}

/* Carte du Menu d'Accueil uniquement (Semi-transparente pour aperçu du décor spatial) */
#screen-start .screen-card {
  background: rgba(12, 12, 30, 0.42);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  border: 2px solid var(--neon-cyan);
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.35), inset 0 0 20px rgba(0, 240, 255, 0.12);
}

/* Garage Tabs */
.garage-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
}

.garage-tab-btn {
  background: rgba(15, 15, 35, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-family: var(--font-title);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.garage-tab-btn.active {
  border-color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.15);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.4);
  color: var(--neon-cyan);
}

.tab-content {
  width: 100%;
}

/* Grid des Pouvoirs Spéciaux */
.powers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  max-height: 50vh;
  overflow-y: auto;
  padding: 6px;
}

.power-card {
  background: rgba(15, 15, 35, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  text-align: center;
}

.power-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 0, 127, 0.5);
}

.power-card.selected {
  border-color: var(--neon-pink);
  box-shadow: 0 0 20px rgba(255, 0, 127, 0.5), inset 0 0 10px rgba(255, 0, 127, 0.2);
  background: rgba(255, 0, 127, 0.08);
}

.power-card.locked {
  opacity: 0.55;
  filter: grayscale(0.5);
  cursor: not-allowed;
}

.power-icon {
  font-size: 2.2rem;
}

.power-name {
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.power-card.selected .power-name {
  color: var(--neon-pink);
}

.power-desc {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.25;
}

/* Grid des Hauts Faits / Achievements */
.achievements-card {
  max-width: 680px;
}

.patchnotes-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 6px;
  text-align: left;
}

.patchnote-entry {
  background: rgba(15, 15, 35, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-left: 4px solid var(--neon-cyan);
  border-radius: 10px;
  padding: 12px 16px;
}

.patchnote-version {
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 700;
  color: var(--neon-yellow);
  margin-bottom: 6px;
}

.patchnote-items {
  margin: 0;
  padding-left: 18px;
  color: var(--text-dim);
  font-size: 0.85rem;
  line-height: 1.5;
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  max-height: 54vh;
  overflow-y: auto;
  padding: 6px;
}

.achievement-card {
  background: rgba(15, 15, 35, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  transition: all 0.2s ease;
}

.achievement-card.unlocked {
  border-color: var(--neon-green);
  background: rgba(57, 255, 20, 0.06);
  box-shadow: 0 0 14px rgba(57, 255, 20, 0.2);
}

.achievement-card.locked {
  opacity: 0.5;
  filter: grayscale(0.6);
}

.achievement-icon {
  font-size: 2.2rem;
  min-width: 44px;
  text-align: center;
}

.achievement-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.achievement-title {
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.achievement-card.unlocked .achievement-title {
  color: var(--neon-green);
}

.achievement-desc {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.75);
}

.achievement-date {
  font-size: 0.68rem;
  color: var(--neon-yellow);
  font-weight: 700;
  margin-top: 2px;
}

.btn-svg {
  width: 28px;
  height: 28px;
}

/* Ecran Garage & Skins Grid */
.garage-card {
  max-width: 620px;
}

.skins-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  max-height: 52vh;
  overflow-y: auto;
  padding: 6px;
}

.skin-card {
  background: rgba(15, 15, 35, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  text-align: center;
}

.skin-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 240, 255, 0.5);
}

.skin-card.selected {
  border-color: var(--neon-yellow);
  box-shadow: 0 0 20px rgba(255, 230, 0, 0.5), inset 0 0 10px rgba(255, 230, 0, 0.2);
  background: rgba(255, 230, 0, 0.08);
}

.skin-card.locked {
  opacity: 0.55;
  filter: grayscale(0.5);
  cursor: not-allowed;
}

.skin-preview-canvas {
  width: 70px;
  height: 70px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.skin-name {
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.skin-card.selected .skin-name {
  color: var(--neon-yellow);
}

.skin-stats-badge {
  font-size: 0.72rem;
  color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.1);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(0, 240, 255, 0.2);
}

.skin-req {
  font-size: 0.75rem;
  color: var(--neon-pink);
  font-weight: 700;
}

.skin-check {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--neon-yellow);
  color: #000;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 0.75rem;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 900;
}

/* Toast Notification Déblocage Skin */
.unlock-toast {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  pointer-events: none;
  animation: toastSlide 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes toastSlide {
  from { transform: translate(-50%, -60px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

.toast-card {
  background: rgba(15, 15, 35, 0.95);
  border: 2px solid var(--neon-yellow);
  box-shadow: 0 0 25px rgba(255, 230, 0, 0.6);
  border-radius: 16px;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.toast-icon {
  font-size: 2rem;
}

.toast-content {
  display: flex;
  flex-direction: column;
}

.toast-title {
  font-family: var(--font-title);
  font-size: 0.8rem;
  color: var(--neon-yellow);
  font-weight: 700;
  letter-spacing: 1px;
}

.toast-name {
  font-family: var(--font-title);
  font-size: 1.2rem;
  color: #fff;
  font-weight: 900;
}

.btn-svg {
  width: 28px;
  height: 28px;
}

/* Ecran GameOver Details */
.score-summary {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.score-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 12px;
}

.score-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 1px;
}

.score-number {
  font-family: var(--font-title);
  font-size: 2.8rem;
  font-weight: 900;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.stat-item {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-num {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--neon-cyan);
}

.stat-lbl {
  font-size: 0.65rem;
  color: var(--text-dim);
  text-align: center;
}

/* Quick Name Buttons (Gabriel / Martin) */
.save-score-section h3 {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.quick-name-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 8px;
}

.btn-quick-name {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-family: var(--font-title);
  font-weight: 700;
  cursor: pointer;
}

.custom-name-row {
  display: flex;
  gap: 8px;
}

.custom-name-row input {
  flex-grow: 1;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-neon);
  border-radius: 8px;
  padding: 8px 12px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
}

.btn-small {
  padding: 8px 14px;
  border-radius: 8px;
  border: none;
  font-family: var(--font-title);
  font-weight: 700;
  cursor: pointer;
}

.gameover-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vertical {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ==========================================================================
   BOUTIQUE DE NIVEAUX & STYLES HUD
   ========================================================================== */
#screen-shop {
  background: rgba(7, 7, 20, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: auto;
  justify-content: center;
  align-items: center;
  padding: 15px;
  overflow-y: auto;
}

.shop-crystals-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 10px 0 15px 0;
  padding: 8px 16px;
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid var(--border-neon);
  border-radius: 10px;
}

.shop-crystals-amount {
  font-family: var(--font-title);
  font-size: 1.2rem;
  font-weight: 900;
}

.shop-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
}

.shop-item-card {
  background: rgba(15, 15, 35, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.shop-item-card:hover {
  transform: translateY(-2px);
  border-color: var(--neon-cyan);
}

.shop-item-icon {
  font-size: 2rem;
}

.shop-item-title {
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
}

.shop-item-desc {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-align: center;
}

.shop-item-cost {
  font-family: var(--font-title);
  font-size: 0.9rem;
  color: var(--neon-yellow);
  font-weight: 700;
}

.btn-buy-item {
  width: 100%;
  padding: 8px;
  border-radius: 8px;
  border: none;
  background: var(--neon-cyan);
  color: #000;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.btn-buy-item:disabled {
  background: rgba(255, 255, 255, 0.15);
  color: #888;
  cursor: not-allowed;
}

.btn-buy-item.purchased {
  background: var(--neon-green);
  color: #000;
}

/* Mode Paysage (Landscape) Adjustments */
@media (max-height: 500px) and (orientation: landscape) {
  .screen-card {
    padding: 14px;
    gap: 10px;
  }
  .glitch-title {
    font-size: 1.5rem;
  }
  .score-number {
    font-size: 2rem;
  }
  #touch-controls {
    height: 60%;
    padding: 10px 20px calc(65px + env(safe-area-inset-bottom, 0px)) 20px;
  }
  .joystick-zone {
    width: 110px;
    height: 110px;
  }
  .joystick-base {
    width: 90px;
    height: 90px;
  }
  .manga-announcement {
    top: calc(52px + env(safe-area-inset-top, 0px));
  }
  #manga-announcement-text {
    font-size: 1.4rem;
  }
  .joystick-stick {
    width: 40px;
    height: 40px;
  }
  .fire-btn {
    width: 65px;
    height: 65px;
  }
  .dash-btn {
    width: 50px;
    height: 50px;
  }
}

/* ==========================================================================
   PILOT LEVEL & TALENT TREE STYLES
   ========================================================================== */
.pilot-level-display {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pilot-level-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pilot-level-badge {
  font-family: var(--font-title);
  font-weight: 900;
  font-size: 1.1rem;
}

.xp-bar-container {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.xp-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-yellow));
  transition: width 0.3s ease;
}

.xp-text-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-family: var(--font-title);
}

.xp-text-row .dim {
  color: var(--text-dim);
}

.talents-card {
  max-width: 680px;
}

.talents-header-info {
  display: flex;
  justify-content: space-around;
  background: rgba(0, 0, 0, 0.4);
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(0, 240, 255, 0.3);
  margin-bottom: 12px;
}

.xp-badge-box, .level-badge-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--font-title);
  font-weight: bold;
}

.talents-tree-grid {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-height: 520px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px;
  background: rgba(5, 7, 18, 0.7);
  border-radius: 12px;
  border: 1px solid rgba(0, 240, 255, 0.2);
}

.talent-tree-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.talents-tree-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.talent-tier-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.talent-tier-title {
  font-family: var(--font-title);
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--neon-yellow);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: rgba(0, 0, 0, 0.5);
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255, 230, 0, 0.3);
  margin: 0 auto;
}

.talent-nodes-container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
}

.talent-node-card {
  position: relative;
  width: 145px;
  background: rgba(12, 14, 30, 0.92);
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-sizing: border-box;
}

.talent-node-card:hover {
  transform: translateY(-3px) scale(1.02);
}

.talent-node-card.unlocked {
  border-color: #39ff14;
  background: rgba(15, 45, 20, 0.9);
  box-shadow: 0 0 15px rgba(57, 255, 20, 0.4);
}

.talent-node-card.can-buy {
  border-color: #ffe600;
  background: rgba(45, 40, 10, 0.9);
  animation: canBuyPulse 1.5s infinite alternate;
}

.talent-node-card.locked {
  border-color: rgba(255, 255, 255, 0.12);
  opacity: 0.55;
  filter: grayscale(70%);
  background: rgba(10, 10, 20, 0.7);
}

.talent-connection-line {
  fill: none;
  stroke-linecap: round;
  transition: stroke 0.3s;
}

.talent-connection-line.line-unlocked {
  stroke: #39ff14;
  stroke-width: 3;
  filter: drop-shadow(0 0 6px rgba(57, 255, 20, 0.6));
}

.talent-connection-line.line-available {
  stroke: #ffe600;
  stroke-width: 2.5;
  stroke-dasharray: 6 4;
  animation: lineDashAnim 1s linear infinite;
  filter: drop-shadow(0 0 5px rgba(255, 230, 0, 0.5));
}

.talent-connection-line.line-locked {
  stroke: rgba(255, 255, 255, 0.15);
  stroke-width: 1.8;
  stroke-dasharray: 4 4;
}

@keyframes lineDashAnim {
  0% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 20; }
}

@keyframes canBuyPulse {
  0% {
    box-shadow: 0 0 10px rgba(255, 230, 0, 0.4);
    border-color: #ffe600;
  }
  100% {
    box-shadow: 0 0 25px rgba(255, 230, 0, 0.9), 0 0 10px rgba(255, 255, 255, 0.6);
    border-color: #ffffff;
  }
}

.talent-icon {
  font-size: 1.8rem;
}

.talent-name {
  font-family: var(--font-title);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
}

.talent-cost {
  font-family: var(--font-title);
  font-size: 0.75rem;
  color: var(--neon-yellow);
}

.talent-desc {
  font-size: 0.68rem;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.25;
}

.talent-rank-label {
  font-family: var(--font-title);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--neon-yellow);
  text-shadow: 0 0 6px var(--neon-yellow);
  margin-top: 4px;
}

.btn-buy-talent {
  margin-top: 4px;
  width: 100%;
  padding: 5px;
  font-size: 0.75rem;
  border-radius: 6px;
}

/* ==========================================================================
   SUPPORT ÉCRANS PLIABLES (EX: GALAXY Z FOLD DÉPLIÉ/PLIÉ) & RATIOS EXTRÊMES
   ========================================================================== */

/* 1. Écran intérieur Fold Déplié / Écrans Ratios Larges (6:5, 5:4, 4:3, 1:1) */
@media (min-aspect-ratio: 1/1) {
  .screen-card {
    max-width: 640px;
    max-height: calc(84vh - env(safe-area-inset-bottom, 0px));
    margin: auto;
    box-shadow: 0 0 35px rgba(0, 240, 255, 0.35), inset 0 0 20px rgba(0, 240, 255, 0.12);
  }
  #touch-controls {
    padding: 16px 32px calc(85px + env(safe-area-inset-bottom, 0px)) 32px;
  }
}

/* 2. Écran de Couverture Fold (Très étroit, ~344px-360px de large, très haut ~840px) */
@media (max-width: 360px) {
  .screen-card,
  .landing-card,
  .garage-card,
  .equipment-card,
  .codex-card,
  .talents-card,
  .patchnotes-card,
  .weapon-drop-card,
  .lootbox-modal-card {
    padding: 10px 8px calc(15px + env(safe-area-inset-bottom, 0px)) 8px !important;
    width: 98% !important;
    max-width: 100% !important;
    gap: 8px !important;
    margin-top: 6px !important;
  }

  .glitch-title,
  .hero-title,
  .neon-title {
    font-size: 1.3rem !important;
    letter-spacing: 0.5px !important;
  }

  .subtitle,
  .hero-subtitle {
    font-size: 0.72rem !important;
    margin-bottom: 4px !important;
  }

  .cyber-badge-pulse {
    font-size: 0.6rem !important;
    padding: 2px 8px !important;
  }

  .hero-stats-banner {
    gap: 4px !important;
    margin-top: 2px !important;
  }

  .stat-pill {
    padding: 3px 5px !important;
    font-size: 0.65rem !important;
    flex: 1 1 45% !important;
    justify-content: center !important;
  }

  .landing-section {
    padding: 8px 6px !important;
    border-radius: 10px !important;
  }

  .section-header h2,
  .section-header h3 {
    font-size: 0.75rem !important;
  }

  .player-buttons {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
  }

  .btn-player {
    width: 100% !important;
    padding: 8px 8px !important;
    font-size: 0.75rem !important;
  }

  .difficulty-buttons {
    display: flex !important;
    flex-direction: row !important;
    gap: 4px !important;
  }

  .btn-diff {
    padding: 6px 2px !important;
    font-size: 0.65rem !important;
    flex: 1 !important;
    min-width: 0 !important;
    text-align: center !important;
  }

  .pilot-level-display {
    padding: 8px 6px !important;
    gap: 4px !important;
  }

  .pilot-level-badge {
    font-size: 0.95rem !important;
  }

  .btn-start-hero {
    padding: 11px 6px !important;
    font-size: 0.9rem !important;
    letter-spacing: 0.5px !important;
    border-radius: 10px !important;
    margin-bottom: 6px !important;
  }

  .grid-navigation {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 5px !important;
  }

  .btn-nav-card {
    padding: 6px 2px !important;
    gap: 2px !important;
  }

  .nav-icon {
    font-size: 1.05rem !important;
  }

  .nav-label {
    font-size: 0.62rem !important;
  }

  .mini-leaderboard {
    padding: 6px 6px !important;
  }

  /* Adjustments HUD sur écran ultra-étroit */
  .hud-top {
    padding: 4px 6px !important;
    gap: 3px !important;
    max-width: calc(100% - 100px) !important;
    flex-wrap: wrap !important;
  }

  .hud-box {
    padding: 2px 4px !important;
    border-radius: 6px !important;
  }

  .hud-label {
    font-size: 0.52rem !important;
    letter-spacing: 0 !important;
  }

  .hud-value {
    font-size: 0.82rem !important;
  }

  .health-bar-container {
    width: 55px !important;
    height: 5px !important;
  }

  .timer-box {
    max-width: 95px !important;
    margin: 0 1px !important;
  }

  .timer-bar-container {
    height: 5px !important;
  }

  #hud-weapon-box {
    max-width: 110px !important;
    min-width: 0 !important;
  }

  #hud-weapon-name {
    font-size: 0.68rem !important;
  }

  #hud-weapon-rarity {
    font-size: 0.6rem !important;
    padding: 1px 4px !important;
  }

  .hud-controls {
    top: 4px !important;
    right: 4px !important;
    gap: 3px !important;
  }

  .icon-btn {
    width: 30px !important;
    height: 30px !important;
    font-size: 0.85rem !important;
  }

  /* Commandes tactiles adaptées écran très étroit (344px) */
  #touch-controls {
    padding: 6px 6px calc(70px + env(safe-area-inset-bottom, 0px)) 6px !important;
    height: 42% !important;
  }

  .joystick-zone {
    width: 95px !important;
    height: 95px !important;
  }

  .joystick-base {
    width: 80px !important;
    height: 80px !important;
  }

  .joystick-stick {
    width: 32px !important;
    height: 32px !important;
  }

  .joystick-label {
    font-size: 0.52rem !important;
    bottom: -16px !important;
  }

  .touch-right-controls {
    gap: 6px !important;
  }

  #action-zone {
    gap: 4px !important;
  }

  .dash-btn {
    width: 48px !important;
    height: 48px !important;
    font-size: 0.6rem !important;
  }

  .special-btn {
    width: 52px !important;
    height: 52px !important;
    font-size: 0.62rem !important;
  }

  /* Grilles 1 colonne pour sous-écrans sur très faible largeur */
  .shop-items-grid,
  .weapons-grid,
  .equipped-items-grid,
  .inventory-items-grid,
  .equipped-modules-grid,
  .modules-inventory-grid,
  .codex-grid,
  .skins-grid,
  .powers-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .talent-nodes-container {
    flex-direction: column !important;
    align-items: center !important;
    gap: 6px !important;
  }

  .talent-node-card {
    width: 100% !important;
    max-width: 230px !important;
    padding: 6px 4px !important;
  }

  .weapon-compare-container {
    flex-direction: column !important;
    gap: 6px !important;
    width: 100% !important;
  }

  .weapon-compare-box {
    min-width: 0 !important;
    width: 100% !important;
    padding: 8px !important;
    box-sizing: border-box !important;
  }

  .compare-vs-badge {
    font-size: 1.1rem !important;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px !important;
  }

  .fraternal-duel-card {
    padding: 6px 4px !important;
  }

  .fraternal-scores {
    gap: 2px !important;
  }

  .fraternal-score-item {
    padding: 4px !important;
    font-size: 0.7rem !important;
    flex: 1 !important;
    text-align: center !important;
  }

  .quick-name-btns {
    gap: 4px !important;
  }

  .btn-quick-name {
    padding: 6px 2px !important;
    font-size: 0.7rem !important;
  }

  #input-player-name {
    padding: 6px !important;
    font-size: 0.78rem !important;
  }

  #btn-save-custom {
    padding: 6px !important;
    font-size: 0.72rem !important;
  }

  #avatar-selector-grid .avatar-opt-btn {
    font-size: 1.1rem !important;
    padding: 3px 6px !important;
  }
}

/* 3. Écrans Mobiles Standards et Intermédiaires (361px - 400px) */
@media (min-width: 361px) and (max-width: 400px) {
  .screen-card {
    padding: 12px 10px;
    gap: 10px;
  }
  .glitch-title,
  .hero-title {
    font-size: 1.45rem;
  }
  .menu-sub-actions .btn-cta {
    font-size: 0.72rem;
    padding: 8px 2px;
  }
  .grid-navigation {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  .hud-top {
    max-width: calc(100% - 110px);
    padding: 6px 8px;
  }
  #touch-controls {
    padding: 8px 12px calc(75px + env(safe-area-inset-bottom, 0px)) 12px;
  }
  .joystick-zone {
    width: 105px;
    height: 105px;
  }
  .joystick-base {
    width: 86px;
    height: 86px;
  }
  .joystick-stick {
    width: 35px;
    height: 35px;
  }
}

/* 4. Écrans Paysage (Faible Hauteur) */
@media (max-height: 580px) {
  .screen-card {
    padding: 10px 12px;
    gap: 8px;
    max-height: calc(88vh - env(safe-area-inset-bottom, 0px));
    margin-top: 10px;
  }
  .glitch-title,
  .hero-title {
    font-size: 1.35rem;
  }
  .btn-fullscreen {
    top: 6px;
    left: 6px;
    font-size: 0.72rem;
    padding: 4px 8px;
  }
}

/* ==========================================================================
   ÉCRAN ÉQUIPEMENT & RARETÉS
   ========================================================================== */
.equipment-card {
  max-width: 820px;
  width: 95%;
}
.equipment-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 15px;
}
.weapons-grid, .equipped-items-grid, .inventory-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.equipment-item-card, .weapon-item-card {
  background: rgba(15, 20, 35, 0.85);
  border: 2px solid rgba(0, 255, 204, 0.3);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.equipment-item-card:hover, .weapon-item-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 15px rgba(0, 255, 204, 0.4);
}
.equipment-item-card.equipped, .weapon-item-card.equipped {
  border-color: #00ffcc;
  box-shadow: 0 0 20px rgba(0, 255, 204, 0.6);
  background: rgba(0, 255, 204, 0.12);
}
.item-icon, .weapon-icon {
  font-size: 2.2rem;
}
.item-title, .weapon-title {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
}
.item-desc, .weapon-desc {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
}
.item-level-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #ffaa00;
  color: #000;
  font-weight: 900;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
}
.rarity-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.rarity-commun {
  background: rgba(160, 160, 160, 0.2);
  color: #a0a0a0;
  border: 1px solid #a0a0a0;
}
.rarity-rare {
  background: rgba(0, 170, 255, 0.2);
  color: #00aaff;
  border: 1px solid #00aaff;
}
.rarity-epique {
  background: rgba(176, 0, 255, 0.2);
  color: #b000ff;
  border: 1px solid #b000ff;
}
.rarity-legendaire {
  background: rgba(255, 170, 0, 0.2);
  color: #ffaa00;
  border: 1px solid #ffaa00;
  box-shadow: 0 0 10px rgba(255, 170, 0, 0.4);
}
.rarity-goddess {
  background: linear-gradient(135deg, rgba(255, 0, 127, 0.3), rgba(0, 255, 204, 0.3));
  color: #ff007f;
  border: 1.5px solid #ff007f;
  box-shadow: 0 0 15px rgba(255, 0, 127, 0.6);
  animation: pulseGoddess 2s infinite ease-in-out;
}
@keyframes pulseGoddess {
  0% { box-shadow: 0 0 10px rgba(255, 0, 127, 0.5); }
  50% { box-shadow: 0 0 22px rgba(0, 255, 204, 0.9); }
  100% { box-shadow: 0 0 10px rgba(255, 0, 127, 0.5); }
}
.btn-equip-item, .btn-select-weapon {
  background: linear-gradient(135deg, #00ffcc, #0099ff);
  color: #000;
  border: none;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 4px;
  font-size: 0.85rem;
}
.btn-equip-item:disabled, .btn-select-weapon:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.btn-reroll-shop {
  background: linear-gradient(135deg, #ffaa00, #ff5500);
  color: #000;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  margin-top: 10px;
  font-size: 0.9rem;
}
.btn-reroll-shop:hover {
  box-shadow: 0 0 12px rgba(255, 170, 0, 0.6);
}

/* ==========================================================================
   ÉCRAN COMPARATEUR D'ARMES DROPPÉES & SYNERGIES
   ========================================================================== */
.weapon-drop-card {
  max-width: 650px;
  width: 92%;
}
.weapon-compare-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin-top: 15px;
  flex-wrap: wrap;
}
.weapon-compare-box {
  background: rgba(15, 20, 35, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 15px;
  flex: 1;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
}
.weapon-compare-box.highlight-box {
  border-color: #00ffcc;
  box-shadow: 0 0 20px rgba(0, 255, 204, 0.5);
  background: rgba(0, 255, 204, 0.08);
}
.compare-badge {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #a0a0a0;
}
.compare-vs-badge {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 900;
  font-size: 1.6rem;
  color: #ffaa00;
  text-shadow: 0 0 10px #ffaa00;
}
.btn-sell-item {
  background: linear-gradient(135deg, #ff9900, #ff0055);
  color: #fff;
  border: none;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 4px;
  font-size: 0.78rem;
}
.btn-sell-item:hover {
  box-shadow: 0 0 10px rgba(255, 0, 85, 0.6);
}

.weapon-hud-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 130px;
}

.weapon-hud-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.weapon-level-badge {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.65rem;
  font-weight: bold;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(0, 240, 255, 0.15);
  color: #00f0ff;
  border: 1px solid rgba(0, 240, 255, 0.5);
  box-shadow: 0 0 5px rgba(0, 240, 255, 0.3);
  letter-spacing: 0.5px;
  display: inline-block;
  white-space: nowrap;
}

.weapon-xp-bar-container {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 2px;
}

.weapon-xp-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #00f0ff, #ff007f);
  box-shadow: 0 0 6px #00f0ff;
  transition: width 0.2s ease-out;
}

/* ==========================================================================
   REFONTE INTERFACE LANDING PAGE ACCUEIL (ULTRA MODERN CYBERPUNK)
   ========================================================================== */
.landing-card {
  max-width: 680px;
  width: 94%;
  padding: 24px 20px;
  border-radius: 20px;
  background: rgba(11, 13, 28, 0.88);
  border: 1px solid rgba(0, 240, 255, 0.3);
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.25), inset 0 0 15px rgba(0, 240, 255, 0.1);
  gap: 16px;
}

.hero-header {
  margin-bottom: 5px;
}

.cyber-badge-pulse {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 2px;
  padding: 3px 12px;
  border-radius: 20px;
  background: rgba(255, 0, 127, 0.15);
  color: #ff007f;
  border: 1px solid #ff007f;
  text-shadow: 0 0 8px #ff007f;
  margin-bottom: 8px;
  animation: cyberPulse 2s infinite alternate;
}

@keyframes cyberPulse {
  0% { box-shadow: 0 0 5px rgba(255, 0, 127, 0.4); transform: scale(1); }
  100% { box-shadow: 0 0 16px rgba(255, 0, 127, 0.9); transform: scale(1.03); }
}

.hero-title {
  font-size: 2.2rem;
  margin: 4px 0;
  letter-spacing: 2px;
}

.hero-subtitle {
  font-size: 0.88rem;
  color: #b0c0e0;
  margin-bottom: 12px;
}

.hero-stats-banner {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(20, 25, 45, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
}

.stat-val {
  font-weight: 900;
}

.landing-section {
  width: 100%;
  background: rgba(15, 18, 35, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px 14px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.section-header h2, .section-header h3 {
  font-size: 0.9rem;
  letter-spacing: 1px;
  color: #00f0ff;
  margin: 0;
}

.btn-start-hero {
  width: 100%;
  padding: 16px;
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 1.5px;
  background: linear-gradient(135deg, #00ff99, #00e0ff);
  color: #050a15;
  border: none;
  border-radius: 14px;
  box-shadow: 0 0 25px rgba(0, 255, 153, 0.6);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  margin-bottom: 12px;
}

.btn-start-hero:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 35px rgba(0, 255, 153, 0.9);
}

.grid-navigation {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  width: 100%;
}

.btn-nav-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 8px;
  border-radius: 10px;
  gap: 4px;
  font-size: 0.8rem;
  border: 1.5px solid rgba(0, 240, 255, 0.4);
  background: rgba(14, 20, 42, 0.85);
  color: #ffffff !important;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.btn-nav-card:hover {
  transform: translateY(-2px);
  border-color: #00f0ff;
  background: rgba(24, 35, 70, 0.95);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.6);
  color: #ffffff !important;
}

.nav-icon {
  font-size: 1.3rem;
}

.nav-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
  color: #ffffff !important;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.4);
}

.btn-nav-card:hover .nav-label {
  color: #00ffff !important;
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
}

/* Correctif Responsive Mobile Téléphone pour les cartes Joueurs */
.btn-player {
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  max-width: 100%;
}

.player-meta {
  min-width: 0;
  flex: 1;
}

.player-title, .player-subtitle {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 580px) {
  .player-buttons {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .btn-player {
    width: 100%;
    padding: 10px 12px;
    justify-content: flex-start;
  }
  .landing-card {
    padding: 16px 10px;
    width: 96%;
  }
  .hero-title {
    font-size: 1.65rem;
  }
  .hero-subtitle {
    font-size: 0.8rem;
  }
  .stat-pill {
    padding: 4px 8px;
    font-size: 0.72rem;
  }
  .weapons-grid,
  .equipped-items-grid,
  .inventory-items-grid,
  .equipped-modules-grid,
  .modules-inventory-grid,
  .codex-grid,
  .skins-grid,
  .powers-grid,
  .shop-items-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
}

/* Animation Pulse Gain de Monnaie 💎 HUD */
@keyframes pulseGain {
  0% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.32); filter: brightness(1.7) drop-shadow(0 0 10px #00ffff); }
  100% { transform: scale(1); filter: brightness(1); }
}

.pulse-gain {
  animation: pulseGain 0.4s ease-in-out;
}

/* Styles du Cyber Codex & Bestiaire */
.codex-card {
  max-width: 860px;
  width: 95%;
}

.codex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 15px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 5px;
}

.codex-item-card {
  background: rgba(15, 18, 35, 0.85);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  position: relative;
  transition: transform 0.2s, border-color 0.2s;
}

.codex-item-card:hover {
  transform: translateY(-2px);
  border-color: #00f0ff;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
}

.codex-item-card.locked-codex {
  opacity: 0.45;
  filter: grayscale(0.8);
  border-color: rgba(255, 255, 255, 0.1);
}

.codex-icon {
  font-size: 2.2rem;
}

.codex-title {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.05rem;
  color: #00f0ff;
}

.codex-stats {
  font-size: 0.78rem;
  color: #a0a0a0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 4px 0;
}

.codex-stat-tag {
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.codex-desc {
  font-size: 0.75rem;
  color: #d0d0d0;
}

.codex-kills-badge {
  font-size: 0.72rem;
  font-weight: 900;
  color: #ffe600;
  background: rgba(255, 230, 0, 0.15);
  border: 1px solid #ffe600;
  padding: 2px 8px;
  border-radius: 10px;
}

.btn-filter-equipped {
  background: rgba(255, 230, 0, 0.15);
  border: 1px solid #ffe600;
  color: #ffe600;
  font-weight: 700;
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-filter-equipped.active-filter {
  background: #ffe600;
  color: #000;
  box-shadow: 0 0 12px rgba(255, 230, 0, 0.6);
}

/* ==========================================================================
   MODULES VAISSEAU & LOOT BOX DE BOSS (v84)
   ========================================================================== */
.keys-display-box {
  background: rgba(255, 230, 0, 0.12);
  border: 1px solid #ffe600;
  padding: 6px 14px;
  border-radius: 10px;
  font-weight: 800;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.equipped-modules-grid, .modules-inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  width: 100%;
}

.part-card {
  background: rgba(15, 22, 45, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  position: relative;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.part-card:hover {
  transform: translateY(-2px);
  border-color: #00f0ff;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
}

.part-card.equipped-part {
  border-color: #39ff14;
  box-shadow: 0 0 16px rgba(57, 255, 20, 0.4);
}

.part-icon {
  font-size: 2rem;
}

.part-title {
  font-size: 0.85rem;
  font-weight: 800;
}

.part-stats {
  font-size: 0.72rem;
  color: #39ff14;
}

.lootbox-hero-box {
  background: rgba(12, 18, 40, 0.85);
  border: 2px solid #ffe600;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 0 30px rgba(255, 230, 0, 0.3);
}

.lootbox-icon-glow {
  font-size: 4rem;
  animation: chestPulse 2s infinite ease-in-out;
}

@keyframes chestPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 10px #ffe600); }
  50% { transform: scale(1.1); filter: drop-shadow(0 0 25px #ffaa00); }
}

.loot-rates-banner {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.rate-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Modal d'Ouverture de Loot Box Centrée au Milieu de l'Écran */
#modal-lootbox {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  position: fixed !important;
  top: 0; left: 0; right: 0; bottom: 0;
  padding: 15px;
  z-index: 2000;
}

#modal-lootbox.hidden {
  display: none !important;
  pointer-events: none !important;
}

.lootbox-modal-card {
  max-width: 480px;
  width: 90%;
  padding: 30px 20px;
  background: rgba(8, 10, 24, 0.95);
  border: 2px solid #00f0ff;
  box-shadow: 0 0 40px rgba(0, 240, 255, 0.6);
  position: relative;
  overflow: hidden;
  margin: auto !important;
}

.lootbox-chest-icon {
  font-size: 6rem;
  transition: transform 0.2s;
}

.chest-shake {
  animation: chestShakeAnim 0.8s infinite linear;
}

.chest-jackpot-shake {
  animation: chestJackpotShakeAnim 0.35s infinite linear !important;
  filter: drop-shadow(0 0 30px #ffe600) drop-shadow(0 0 50px #ff0055);
}

@keyframes chestShakeAnim {
  0% { transform: translate(0, 0) rotate(0deg); }
  20% { transform: translate(-5px, 0) rotate(-6deg); }
  40% { transform: translate(5px, 0) rotate(6deg); }
  60% { transform: translate(-5px, 0) rotate(-4deg); }
  80% { transform: translate(5px, 0) rotate(4deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

@keyframes chestJackpotShakeAnim {
  0% { transform: translate(0, 0) scale(1) rotate(0deg); }
  25% { transform: translate(-10px, -6px) scale(1.15) rotate(-12deg); }
  50% { transform: translate(10px, 6px) scale(1.2) rotate(12deg); }
  75% { transform: translate(-10px, 6px) scale(1.15) rotate(-10deg); }
  100% { transform: translate(0, 0) scale(1) rotate(0deg); }
}

.lootbox-beam-burst {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200%;
  height: 200%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

.beam-burst-active {
  opacity: 1;
  animation: burstExpand 1.2s forwards ease-out;
}

@keyframes burstExpand {
  0% { transform: translate(-50%, -50%) scale(0.1); opacity: 0.9; }
  50% { opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.5); opacity: 0; }
}

.goddess-supernova {
  background: radial-gradient(circle, rgba(255,0,127,1) 0%, rgba(0,255,255,1) 50%, rgba(255,230,0,1) 100%);
  animation: supernovaRainbow 1.5s infinite linear;
}

@keyframes supernovaRainbow {
  0% { filter: hue-rotate(0deg) blur(10px); }
  100% { filter: hue-rotate(360deg) blur(10px); }
}

.manga-reveal-banner {
  font-family: var(--font-title);
  font-size: 1.3rem;
  font-weight: 900;
  color: #ffe600;
  text-shadow: 0 0 10px #ffe600;
  margin-bottom: 12px;
}

.jackpot-banner-glow {
  color: #ffe600 !important;
  font-size: 1.5rem !important;
  text-shadow: 0 0 15px #ffe600, 0 0 30px #ff007f !important;
  animation: jackpotGlowPulse 0.8s infinite alternate ease-in-out;
}

@keyframes jackpotGlowPulse {
  0% { transform: scale(1); text-shadow: 0 0 15px #ffe600, 0 0 30px #ff007f; }
  100% { transform: scale(1.08); text-shadow: 0 0 30px #ffffff, 0 0 60px #ff0055, 0 0 90px #00f0ff; }
}

.jackpot-card-border {
  border-color: #ffe600 !important;
  box-shadow: 0 0 40px rgba(255, 230, 0, 0.85), inset 0 0 25px rgba(255, 0, 127, 0.6) !important;
  animation: borderJackpotRainbow 2s infinite linear;
}

@keyframes borderJackpotRainbow {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

/* ==========================================================================
   ANIMATIONS & EFFETS SPECTACULAIRES D'OUVERTURE DE LOOT BOX
   ========================================================================== */

/* Lumière pulsante selon la rareté pendant la secousse */
.rarity-glow-commun {
  filter: drop-shadow(0 0 15px #a0a0a0);
}
.rarity-glow-rare {
  filter: drop-shadow(0 0 25px #00aaff);
  animation: pulseGlowRare 1s infinite alternate ease-in-out;
}
.rarity-glow-epique {
  filter: drop-shadow(0 0 30px #b000ff);
  animation: pulseGlowEpique 0.8s infinite alternate ease-in-out;
}
.rarity-glow-legendaire {
  filter: drop-shadow(0 0 35px #ffe600);
  animation: pulseGlowLegendaire 0.6s infinite alternate ease-in-out;
}
.rarity-glow-goddess {
  filter: drop-shadow(0 0 45px #ff007f) drop-shadow(0 0 25px #00ffcc);
  animation: pulseGlowGoddess 0.4s infinite alternate ease-in-out;
}

@keyframes pulseGlowRare {
  0% { filter: drop-shadow(0 0 15px #00aaff); }
  100% { filter: drop-shadow(0 0 30px #00f0ff); }
}
@keyframes pulseGlowEpique {
  0% { filter: drop-shadow(0 0 20px #b000ff); }
  100% { filter: drop-shadow(0 0 40px #e055ff); }
}
@keyframes pulseGlowLegendaire {
  0% { filter: drop-shadow(0 0 25px #ffe600); transform: scale(1); }
  100% { filter: drop-shadow(0 0 50px #ffaa00); transform: scale(1.08); }
}
@keyframes pulseGlowGoddess {
  0% { filter: drop-shadow(0 0 30px #ff007f) drop-shadow(0 0 20px #00ffcc); transform: scale(1); }
  100% { filter: drop-shadow(0 0 60px #00ffcc) drop-shadow(0 0 40px #ff007f); transform: scale(1.15); }
}

/* Transition d'ouverture / pop du coffre */
.chest-open-pop {
  animation: chestOpenPopAnim 0.45s ease-out forwards;
}

@keyframes chestOpenPopAnim {
  0% { transform: scale(1) rotate(0deg); opacity: 1; }
  50% { transform: scale(1.4) rotate(8deg); filter: brightness(1.8); opacity: 1; }
  100% { transform: scale(2.2); filter: brightness(3); opacity: 0; }
}

/* Faisceau lumineux coloré selon la rareté */
.beam-burst-commun {
  background: radial-gradient(circle, rgba(160, 160, 160, 0.85) 0%, rgba(160, 160, 160, 0.25) 50%, transparent 70%);
}
.beam-burst-rare {
  background: radial-gradient(circle, rgba(0, 170, 255, 0.9) 0%, rgba(0, 240, 255, 0.4) 50%, transparent 70%);
}
.beam-burst-epique {
  background: radial-gradient(circle, rgba(176, 0, 255, 0.9) 0%, rgba(157, 78, 221, 0.4) 50%, transparent 70%);
}
.beam-burst-legendaire {
  background: radial-gradient(circle, rgba(255, 230, 0, 1) 0%, rgba(255, 170, 0, 0.6) 50%, transparent 75%);
}
.beam-burst-goddess {
  background: radial-gradient(circle, rgba(255, 0, 127, 1) 0%, rgba(0, 255, 255, 0.8) 40%, rgba(255, 230, 0, 0.6) 70%, transparent 85%);
}

/* Apparition dynamique et rebondissante de la carte de Butin */
.lootbox-card-pop {
  animation: lootboxCardPop 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes lootboxCardPop {
  0% { transform: scale(0.6) translateY(25px); opacity: 0; }
  70% { transform: scale(1.05) translateY(-5px); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
