/* =================================================================
   STAR DRAGON X — GALACTIC LEGENDS
   Thème mature : noir profond / néon cyan→violet / acier
   Logo & DA "Dark Crest". Jeu créé par LEO PELLEGRINO™
   ================================================================= */

:root {
  --c-bg:      #030208;   /* noir spatial profond */
  --c-bg2:     #0a0818;
  --c-panel:   #0c0e1e;   /* surfaces */
  --c-steel:   #262a44;   /* métal sombre */
  --c-cyan:    #5ad0ff;   /* néon froid */
  --c-blue:    #3a7bff;
  --c-violet:  #a64dff;   /* néon chaud */
  --c-violet2: #6d28d9;
  --c-gold:    #ffcf4d;   /* accent rare (conservé pour étoiles) */
  --c-white:   #eaf2ff;
  --c-mute:    #7a86aa;   /* texte secondaire acier */
  --c-danger:  #ff3b6b;
  --c-hp:      #2fe38a;
  --c-sp:      #5ad0ff;
  --neon:      linear-gradient(120deg, var(--c-cyan), var(--c-violet));
  --glow:      0 0 18px;
  --font: 'Rajdhani', 'Trebuchet MS', 'Segoe UI Semibold', system-ui, sans-serif;
  --font-display: 'Arial Black', 'Impact', 'Trebuchet MS', sans-serif;
}

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

html, body {
  height: 100%;
  width: 100%;
  position: fixed;          /* empêche le défilement élastique iOS */
  overflow: hidden;
  background: var(--c-bg);
  color: var(--c-white);
  font-family: var(--font);
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none; /* pas de "pull to refresh" / rebond */
  touch-action: none;        /* le navigateur ne gère plus les gestes : c'est le jeu */
}

/* Canvas d'étoiles en arrière-plan (toujours visible) */
#bgStars {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse at 30% 20%, #1a1248 0%, transparent 60%),
    radial-gradient(ellipse at 70% 80%, #1c0e3a 0%, transparent 55%),
    var(--c-bg);
}

/* ---------- Système d'écrans ---------- */
.screen {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;            /* le contenu trop haut (paysage) devient défilable */
  -webkit-overflow-scrolling: touch;
}
.screen.active { display: flex; }
/* en paysage court, on aligne en haut pour que le défilement révèle tout le panneau */
@media (max-height: 560px) {
  .screen { align-items: flex-start; padding: 10px; }
}

/* ---------- Boutons (style esport anguleux) ---------- */
.btn {
  font-family: var(--font);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--c-white);
  background: rgba(38,42,68,0.35);
  border: 1px solid rgba(90,208,255,0.35);
  border-radius: 4px;
  padding: 13px 28px;
  cursor: pointer;
  position: relative;
  transition: transform .12s, box-shadow .2s, background .2s, border-color .2s;
  backdrop-filter: blur(6px);
}
.btn:hover { transform: translateY(-2px); border-color: var(--c-cyan); box-shadow: 0 0 16px rgba(90,208,255,.4); background: rgba(90,208,255,0.12); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(120deg, rgba(90,208,255,.9), rgba(166,77,255,.9));
  border-color: rgba(255,255,255,0.4);
  color: #06030f;
  box-shadow: 0 0 22px rgba(90,208,255,.45);
}
.btn-primary:hover { box-shadow: 0 0 30px rgba(166,77,255,.6); color: #06030f; }
.btn.tiny { font-size: 12px; padding: 7px 14px; letter-spacing: 1px; }

/* ---------- Logos intégrés ---------- */
.sdx-logo { width: 100%; height: auto; display: block; }
.gate-logo { width: min(440px, 82vw); margin-bottom: 6px; filter: drop-shadow(0 0 30px rgba(90,208,255,.3)); animation: gatePulse 3s ease-in-out infinite; }
.menu-logo { width: min(380px, 78vw); margin: 0 auto 6px; filter: drop-shadow(0 0 24px rgba(166,77,255,.35)); }

/* ---------- Écran d'accueil ---------- */
.menu-wrap { text-align: center; animation: floatIn .8s ease; }
.title {
  font-size: clamp(42px, 11vw, 92px);
  font-weight: 900;
  letter-spacing: 3px;
  line-height: .95;
  background: linear-gradient(180deg, #fff, var(--c-blue) 55%, var(--c-violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 22px rgba(154,77,255,.7));
}
.subtitle { margin: 14px 0 30px; color: var(--c-mute); font-size: clamp(12px,3vw,15px); letter-spacing: 2px; text-transform: uppercase; font-weight: 600; }
.menu-buttons { display: flex; flex-direction: column; gap: 12px; width: min(320px, 80vw); margin: 0 auto; }
.menu-footer { margin-top: 28px; color: var(--c-mute); font-size: 14px; letter-spacing: 1px; }
.star-count b { color: var(--c-gold); }

/* ---------- Panneaux génériques (verre dépoli sombre) ---------- */
.panel {
  position: relative;
  width: min(900px, 96vw);
  margin: auto;                /* centré, mais peut défiler si trop haut */
  background: linear-gradient(160deg, rgba(12,14,30,.94), rgba(6,5,16,.96));
  border: 1px solid rgba(90,208,255,.28);
  border-radius: 10px;
  padding: 26px;
  box-shadow: 0 0 50px rgba(166,77,255,.18), inset 0 1px 0 rgba(255,255,255,.05);
  animation: floatIn .5s ease;
}
.panel.center { text-align: center; max-width: 480px; }
.screen-title {
  text-align: center; font-family: var(--font-display); font-size: 24px;
  margin-bottom: 22px; color: var(--c-white); letter-spacing: 2px; text-transform: uppercase;
}
.row-buttons { display: flex; gap: 14px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }
/* en paysage court : panneau compact, défilement géré par .screen */
@media (max-height: 560px) {
  .panel { padding: 16px; margin: 0 auto; }
  .screen-title { font-size: 19px; margin-bottom: 12px; }
}

/* ---------- Cartes de héros ---------- */
.hero-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; justify-content: center; padding: 4px; }
@media (max-width: 760px) { .hero-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .hero-cards { grid-template-columns: 1fr; } }
/* en paysage court, on garde 3 colonnes compactes et on défile via .screen */
@media (max-height: 560px) { .hero-cards { grid-template-columns: repeat(3, 1fr); gap: 10px; } }
.hero-card {
  background: rgba(12,14,30,.6);
  border: 1px solid rgba(90,208,255,.25);
  border-radius: 8px;
  padding: 16px;
  cursor: pointer;
  transition: transform .15s, border-color .2s, box-shadow .2s;
  text-align: center;
}
.hero-card:hover { transform: translateY(-4px); border-color: rgba(90,208,255,.6); }
.hero-card.selected { border-color: var(--c-cyan); box-shadow: 0 0 28px rgba(90,208,255,.4); background: rgba(90,208,255,.08); }
.hero-emoji { font-size: 70px; line-height: 1; filter: drop-shadow(0 0 14px var(--card-glow, #9a4dff)); }
.hero-card h3 { margin: 10px 0 4px; font-size: 22px; }
.rarity { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: #06030f; background: linear-gradient(90deg, var(--c-cyan), var(--c-violet)); padding: 3px 12px; border-radius: 3px; margin-bottom: 10px; }
.hero-stats { font-size: 13px; color: #c9c3ef; text-align: left; margin-top: 8px; line-height: 1.7; }
.hero-stats .atk { color: var(--c-blue); font-weight: bold; }
.hero-stats .sp  { color: var(--c-gold); font-weight: bold; }

/* ---------- HUD du jeu ---------- */
#screen-game { padding: 0; flex-direction: column; }
#hud {
  position: absolute; top: 0; left: 0; right: 0; z-index: 3;
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 12px 16px; gap: 12px;
  pointer-events: none;
}
#hud .btn { pointer-events: auto; }
.hud-left { width: min(300px, 55vw); }
.hud-hero { font-weight: bold; font-size: 15px; margin-bottom: 5px; text-shadow: 0 0 8px var(--c-violet); }
.bar { position: relative; height: 18px; background: rgba(0,0,0,.5); border: 1px solid rgba(255,255,255,.25); border-radius: 10px; overflow: hidden; }
.bar.small { height: 10px; margin-top: 6px; }
.bar-fill { height: 100%; width: 100%; transition: width .15s; }
.bar-fill.hp { background: linear-gradient(90deg, var(--c-hp), #1fae5b); }
.bar-fill.sp { background: linear-gradient(90deg, var(--c-sp), #ff9d4d); }
.bar-txt { position: absolute; inset: 0; text-align: center; font-size: 11px; font-weight: bold; line-height: 18px; text-shadow: 0 0 3px #000; }
.special-label { font-size: 11px; color: var(--c-gold); }
.hud-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.hud-stat { font-size: 14px; background: rgba(0,0,0,.4); padding: 3px 10px; border-radius: 8px; }
.hud-stat b { color: var(--c-gold); }

#game { display: block; width: 100%; height: 100%; background: transparent; touch-action: none; }

/* ---------- Commandes tactiles (twin-stick) ---------- */
#touch-controls { position: absolute; inset: 0; z-index: 4; display: none; pointer-events: none; }
#joystick, #joystickAim {
  position: absolute; bottom: 28px;
  width: 120px; height: 120px; border-radius: 50%;
  background: rgba(255,255,255,.06); border: 2px solid rgba(154,77,255,.4);
  pointer-events: auto;
}
#joystick { left: 24px; }
#joystickAim { right: 24px; border-color: rgba(255,207,77,.5); }
#joystick-knob, #joystick-aim-knob { position: absolute; left: 35px; top: 35px; width: 50px; height: 50px; border-radius: 50%; box-shadow: 0 0 14px var(--c-violet); }
#joystick-knob { background: rgba(154,77,255,.6); }
#joystick-aim-knob { background: rgba(255,207,77,.6); box-shadow: 0 0 14px var(--c-gold); }
.joy-label { position: absolute; bottom: -22px; left: 0; right: 0; text-align: center; font-size: 11px; color: #bcb6e0; pointer-events: none; }
.touch-btns { position: absolute; right: 160px; bottom: 56px; display: flex; gap: 14px; }
.touch-btn {
  width: 74px; height: 74px; border-radius: 50%; font-size: 30px;
  background: rgba(58,123,255,.25); border: 2px solid var(--c-gold); color: #fff;
  pointer-events: auto; cursor: pointer;
}
.touch-btn:active { background: rgba(255,207,77,.4); }

/* Aide commandes en jeu */
#controlsHint {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  z-index: 5; display: flex; flex-direction: column; gap: 8px; align-items: center;
  background: rgba(5,3,15,.7); border: 1px solid rgba(154,77,255,.4); border-radius: 14px;
  padding: 18px 26px; pointer-events: none; backdrop-filter: blur(3px);
  animation: hintFade 5s ease forwards;
}
#controlsHint span { font-size: 14px; color: #d6d0f5; }
#controlsHint b { color: var(--c-gold); }
@keyframes hintFade { 0%,60% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
@media (pointer: coarse) { #controlsHint { display: none; } }

/* ---------- Écrans victoire / défaite ---------- */
.win-title { font-family: var(--font-display); font-size: 32px; letter-spacing: 2px; text-transform: uppercase; color: var(--c-cyan); text-shadow: 0 0 22px rgba(90,208,255,.5); margin-bottom: 10px; }
.lose-title { font-family: var(--font-display); font-size: 28px; letter-spacing: 2px; text-transform: uppercase; color: var(--c-danger); margin-bottom: 10px; }
.win-sub { color: #c9c3ef; margin-bottom: 18px; }
.win-reward { font-size: 22px; margin: 14px 0; }
.win-reward b { color: var(--c-gold); }

/* ---------- QG Cosmique ---------- */
.hq-panel { max-width: 760px; }
.hq-grid { display: flex; gap: 22px; flex-wrap: wrap; justify-content: center; }
.hq-stage {
  position: relative; flex: 1 1 280px; min-height: 260px;
  border-radius: 18px;
  background: radial-gradient(circle at 50% 40%, #241258, #0a0620);
  border: 1px solid rgba(154,77,255,.4);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.hq-portal { position: absolute; top: 18px; font-size: 60px; animation: spin 8s linear infinite; opacity: .8; }
.hq-hero { width: 200px; height: 200px; filter: drop-shadow(0 0 24px var(--c-violet)); }
.hq-weapons { margin: 4px 0 14px; }
.hq-wline { font-size: 14px; color: #d6dcf0; margin: 5px 0; }
.hq-crystals { position: absolute; bottom: 14px; display: flex; gap: 26px; font-size: 26px; }
.hq-crystals span:nth-child(1){ animation: bob 2.4s ease-in-out infinite; }
.hq-crystals span:nth-child(2){ animation: bob 2.4s ease-in-out infinite .4s; }
.hq-crystals span:nth-child(3){ animation: bob 2.4s ease-in-out infinite .8s; }
.hq-info { flex: 1 1 240px; }
.hq-info h3 { font-family: var(--font-display); font-size: 24px; color: #fff; letter-spacing: 1px; text-transform: uppercase; }
.hq-role { color: var(--c-cyan); margin-bottom: 14px; text-transform: uppercase; font-size: 13px; letter-spacing: 1px; font-weight: 600; }
.hq-total { font-size: 28px; margin-bottom: 18px; }
.hq-total b { color: var(--c-gold); }
.hq-total span { display: block; font-size: 13px; color: var(--c-mute); }
.hq-rooms { display: flex; flex-direction: column; gap: 8px; }
.hq-room { background: rgba(90,208,255,.05); border: 1px solid rgba(90,208,255,.2); border-radius: 6px; padding: 10px 14px; font-size: 14px; }

/* ---------- Animations ---------- */
@keyframes floatIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

/* ---------- Responsive : afficher commandes tactiles sur écran tactile ---------- */
@media (pointer: coarse) {
  #touch-controls { display: block; }
}

/* =================================================================
   MOBILE — adaptation des commandes et du HUD aux petits écrans
   ================================================================= */
@media (max-width: 820px) {
  /* HUD plus compact pour ne pas masquer le jeu */
  .hero-hud { width: min(220px, 52vw); padding: 6px 10px 6px 6px; gap: 7px; }
  .hero-hud-portrait { width: 40px; height: 40px; }
  .hud-hero { font-size: 12px; }
  .wave-hud { padding: 5px 14px; }
  .wave-num { font-size: 20px; }
  .stat-chip { font-size: 12px; padding: 4px 9px; min-width: 54px; }
  .hud-right { gap: 4px; }
}

/* Joysticks : taille et marges adaptées au tactile, ancrés en bas via safe-area iPhone */
@media (pointer: coarse) {
  #joystick, #joystickAim {
    width: 116px; height: 116px;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }
  #joystick { left: calc(16px + env(safe-area-inset-left, 0px)); }
  #joystickAim { right: calc(16px + env(safe-area-inset-right, 0px)); }
  #joystick-knob, #joystick-aim-knob { width: 50px; height: 50px; }
  .touch-btns {
    right: calc(150px + env(safe-area-inset-right, 0px));
    bottom: calc(44px + env(safe-area-inset-bottom, 0px));
  }
  .touch-btn { width: 66px; height: 66px; font-size: 26px; }
}

/* Très petits écrans : on resserre encore */
@media (pointer: coarse) and (max-width: 380px) {
  #joystick, #joystickAim { width: 104px; height: 104px; }
  #joystick-knob, #joystick-aim-knob { width: 46px; height: 46px; }
  .touch-btn { width: 58px; height: 58px; font-size: 22px; }
  .touch-btns { right: calc(128px + env(safe-area-inset-right, 0px)); }
}

/* =================================================================
   V1.2 — Intro cinématique, gate de démarrage, bouton son
   ================================================================= */

/* Bouton son global */
#muteBtn {
  position: fixed; top: 12px; right: 12px; z-index: 30;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(0,0,0,.45); border: 1.5px solid rgba(154,77,255,.5);
  color: #fff; font-size: 20px; cursor: pointer; backdrop-filter: blur(4px);
}
#muteBtn:hover { box-shadow: var(--glow) rgba(154,77,255,.5); }

/* "Appuyez pour commencer" */
#introGate {
  position: fixed; inset: 0; z-index: 40;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, #0d0826, #05030f);
  cursor: pointer;
}
.gate-hint { margin-top: 22px; color: var(--c-cyan); font-size: 17px; letter-spacing: 4px; text-transform: uppercase; font-weight: 600; animation: blink 1.6s ease-in-out infinite; }
@keyframes gatePulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.03); } }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* Écran intro cinématique */
#screen-intro { background: radial-gradient(ellipse at center, #0a0826, #05030f); z-index: 20; }
.cine-vignette { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.85)); }
.cine-stage { position: relative; z-index: 2; text-align: center; max-width: 800px; padding: 20px; }
.cine-line {
  font-size: clamp(20px, 4.5vw, 36px); line-height: 1.4; color: var(--c-white);
  text-shadow: 0 0 18px rgba(58,123,255,.5);
}
.cine-line.big { font-size: clamp(26px, 6vw, 46px); }
.cine-line.gold { color: var(--c-gold); text-shadow: 0 0 20px rgba(255,207,77,.6); }
.cine-line.danger { color: var(--c-danger); text-shadow: 0 0 20px rgba(255,77,109,.6); }
.cine-line.fade { animation: cineFade 1s ease both; }
.cine-line b { color: var(--c-gold); }
.cine-line.danger b { color: #ffd0d8; }
@keyframes cineFade { from { opacity: 0; transform: translateY(14px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
.cine-void { font-size: 90px; margin-bottom: 16px; animation: spin 10s linear infinite, voidGrow 3s ease both; }
@keyframes voidGrow { from { transform: scale(.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.cine-stars { font-size: clamp(28px, 7vw, 54px); letter-spacing: 10px; color: #cfe0ff; margin-bottom: 20px; animation: starsDie 3s ease forwards; }
@keyframes starsDie { 0% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: .25; letter-spacing: 18px; } }
.cine-heroes { font-size: 84px; margin-bottom: 16px; display: flex; gap: 30px; justify-content: center; }
.cine-heroes span:nth-child(1) { animation: heroIn .8s ease both; filter: drop-shadow(0 0 18px var(--c-blue)); }
.cine-heroes span:nth-child(2) { animation: heroIn .8s ease .3s both; filter: drop-shadow(0 0 18px var(--c-violet)); }
@keyframes heroIn { from { opacity: 0; transform: translateY(30px) scale(.6); } to { opacity: 1; transform: none; } }
.cine-title {
  font-family: var(--font-display);
  font-size: clamp(44px, 13vw, 110px); font-weight: 900; letter-spacing: 4px; margin-bottom: 14px; text-transform: uppercase;
  background: linear-gradient(180deg, #fff, var(--c-cyan) 50%, var(--c-violet));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 30px rgba(90,208,255,.6));
  animation: titleSlam .7s cubic-bezier(.2,1.4,.4,1) both;
}
@keyframes titleSlam { from { opacity: 0; transform: scale(2.2); filter: blur(10px); } to { opacity: 1; transform: scale(1); filter: none; } }
.cine-skip { position: absolute; bottom: 24px; right: 24px; z-index: 3; }

/* Citation de héros sur les cartes */
.hero-quote { margin-top: 8px; font-style: italic; color: #a89fd6; font-size: 12px; }

/* =================================================================
   V1.4 — Comptes, avatars, leaderboard
   ================================================================= */

/* Encart compte sur le menu */
.account-badge {
  display: inline-flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(154,77,255,.4);
  border-radius: 30px; padding: 6px 8px 6px 14px; margin-bottom: 22px;
}
.acc-avatar { font-size: 26px; }
.acc-name { font-weight: bold; color: var(--c-gold); max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Écrans d'authentification */
.auth-panel { max-width: 460px; }
.auth-form { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.auth-input {
  font-family: var(--font); font-size: 16px; color: var(--c-white);
  background: rgba(0,0,0,.4); border: 1.5px solid rgba(154,77,255,.5);
  border-radius: 12px; padding: 13px 16px; outline: none; text-align: center;
}
.auth-input:focus { border-color: var(--c-gold); box-shadow: 0 0 14px rgba(255,207,77,.3); }
.auth-input::placeholder { color: #8c85b8; }
.auth-error { color: var(--c-danger); font-size: 14px; min-height: 18px; }
.auth-switch { margin-top: 14px; font-size: 14px; color: #bcb6e0; }
.link-btn { background: none; border: none; color: var(--c-blue); font-weight: bold; cursor: pointer; font-size: 14px; text-decoration: underline; font-family: var(--font); }
.auth-note { margin-top: 14px; font-size: 12px; color: #8c85b8; line-height: 1.5; background: rgba(0,0,0,.25); border-radius: 10px; padding: 10px; }
.auth-note b { color: #bcb6e0; }

/* Banque d'avatars */
.avatar-label { font-size: 14px; color: #bcb6e0; margin-top: 6px; }
.avatar-bank { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; }
.avatar-pick {
  font-size: 26px; aspect-ratio: 1; border-radius: 12px; cursor: pointer;
  background: rgba(255,255,255,.05); border: 2px solid transparent; transition: transform .1s, border-color .2s;
}
.avatar-pick:hover { transform: scale(1.1); }
.avatar-pick.selected { border-color: var(--c-gold); background: rgba(255,207,77,.18); box-shadow: 0 0 14px rgba(255,207,77,.4); }

/* Leaderboard */
.lb-panel { max-width: 720px; }
.lb-scope { text-align: center; font-size: 15px; font-weight: 700; letter-spacing: 1px; margin-bottom: 4px; color: var(--c-cyan); }
.lb-formula { text-align: center; color: var(--c-gold); font-size: 13px; margin-bottom: 14px; }
.lb-scroll { max-height: 60vh; overflow-y: auto; border-radius: 12px; }
.lb-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.lb-table th { position: sticky; top: 0; background: #160d34; color: var(--c-gold); padding: 10px 8px; text-align: left; font-size: 12px; letter-spacing: .5px; }
.lb-table td { padding: 11px 8px; border-bottom: 1px solid rgba(154,77,255,.18); }
.lb-rank { font-weight: bold; font-size: 16px; text-align: center; width: 44px; }
.lb-player { font-weight: bold; }
.lb-av { font-size: 20px; }
.lb-me { background: rgba(255,207,77,.12); }
.lb-me td:first-child { box-shadow: inset 3px 0 0 var(--c-gold); }
.lb-empty { text-align: center; color: #bcb6e0; padding: 40px 20px; line-height: 1.7; }

@media (max-width: 600px) {
  .avatar-bank { grid-template-columns: repeat(6, 1fr); }
  .lb-table { font-size: 12px; }
  .lb-table th:nth-child(4), .lb-table td:nth-child(4) { display: none; } /* masque Étoiles sur mobile étroit */
}

/* =================================================================
   V2 — HUD immersif, widgets, signatures studio
   ================================================================= */

/* Cartes HUD génériques (effet verre dépoli premium) */
.hud-card {
  background: rgba(10,6,30,.62); border: 1px solid rgba(154,77,255,.45);
  border-radius: 14px; backdrop-filter: blur(6px);
  box-shadow: 0 4px 18px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.08);
  pointer-events: auto;
}

/* Carte héros (haut-gauche) */
.hero-hud { display: flex; gap: 10px; align-items: center; padding: 8px 12px 8px 8px; width: min(320px, 60vw); }
.hero-hud-portrait {
  font-size: 34px; width: 52px; height: 52px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 40% 35%, rgba(120,90,255,.5), rgba(20,12,52,.8));
  border-radius: 12px; border: 1px solid rgba(154,77,255,.5);
}
.hero-hud-info { flex: 1; min-width: 0; }

/* Widget vague (haut-centre) */
.wave-hud {
  position: absolute; left: 50%; transform: translateX(-50%); top: 0;
  text-align: center; padding: 8px 22px;
}
.wave-label { font-size: 10px; letter-spacing: 3px; color: #bcb6e0; }
.wave-num { font-size: 26px; font-weight: 900; color: var(--c-gold); line-height: 1; }
.wave-num span { font-size: 14px; color: #8c85b8; }
.wave-dots { display: flex; gap: 5px; justify-content: center; margin-top: 6px; }
.wave-dots span { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.18); transition: background .3s; }
.wave-dots span.on { background: var(--c-gold); box-shadow: 0 0 8px var(--c-gold); }

/* Cluster stats (haut-droite) */
.hud-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.stat-chip { font-size: 15px; padding: 6px 12px; min-width: 70px; text-align: right; }
.stat-chip b { color: #fff; }
.stat-chip.gold { border-color: rgba(255,207,77,.6); }
.stat-chip.gold b { color: var(--c-gold); }

/* Signatures studio */
.ingame-credit {
  position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%);
  z-index: 3; font-size: 11px; color: rgba(255,255,255,.25); letter-spacing: .5px; pointer-events: none;
}
.ingame-credit b { color: rgba(255,207,77,.4); }
.creator-credit { margin-top: 10px; font-size: 12px; color: #8c85b8; letter-spacing: .5px; }
.creator-credit b { color: var(--c-gold); }
.cine-credit { margin-top: 18px; font-size: 14px; color: #8c85b8; letter-spacing: 2px; animation: cineFade 1.2s ease .4s both; }
@media (pointer: coarse) { .ingame-credit { bottom: 150px; } }

/* =================================================================
   V2.2 — Cartes héros avec portraits "bonhommes" + armes
   ================================================================= */
.hero-portrait { width: 120px; height: 120px; display: block; margin: 0 auto 4px; }
.hero-role-tag { font-size: 13px; font-weight: 600; letter-spacing: .5px; margin-bottom: 10px; text-transform: uppercase; }
.hero-stats { font-size: 13px; color: #c2cae0; text-align: left; margin-top: 4px; line-height: 1.5; }
.stat-line { display: flex; justify-content: space-between; padding: 2px 0; border-bottom: 1px solid rgba(90,208,255,.08); }
.stat-line b { color: #fff; }
.weapon-line { margin-top: 6px; font-size: 12px; color: #d6dcf0; }
.wlabel { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 1px; color: #06030f; background: var(--c-cyan); padding: 1px 6px; border-radius: 3px; margin-right: 6px; }
.wlabel.sp { background: var(--c-violet); }
.hero-quote { margin-top: 10px; font-style: italic; color: var(--c-mute); font-size: 11px; }
