/* ============================================================
   SHADOW HUNTERS — Styles (v2 multiplayer)
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
.hidden { display: none !important; }

:root {
  --bg:       #08080c;
  --bg2:      rgba(20, 18, 15, 0.85); /* Teinte plus chaude/cuir */
  --bg3:      rgba(40, 35, 30, 0.6);
  --glass:    blur(12px) saturate(180%);
  --border:   rgba(212, 175, 55, 0.2); /* Bordures dorées fines */
  --text:     #f0f0f5;
  --dim:      #9494b8;
  --accent:   #d4af37; /* Or Gallicéen */
  --accent-glow: rgba(212, 175, 55, 0.3);
  --danger:   #cc3333;
  --shadow-c: #8b0000;
  --hunter-c: #004080;
  --neutral-c:#405060;
  --r:        6px;
  --rl:       18px;
  --font-main: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-display: 'Cinzel', serif;
}

body { 
  font-family: var(--font-main); 
  background: var(--bg); 
  color: var(--text); 
  min-height: 100vh; 
  font-size: 14px; 
  overflow-x: hidden;
  background-image: 
    url('/img/ui/texture-stone.png'), /* Texture de fond pierre/granit */
    radial-gradient(circle at 50% 50%, rgba(20, 15, 10, 0.4) 0%, #050508 100%),
    linear-gradient(180deg, #08080c 0%, #050505 100%);
  background-attachment: fixed;
  background-blend-mode: multiply;
}

/* Effet de vignettage sur tout l'écran pour l'immersion */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  box-shadow: inset 0 0 150px rgba(0,0,0,0.9);
  pointer-events: none;
  z-index: 9999;
}

/* Plateau de jeu = zone centrale */
#board.game-board-map {
  display: block !important;
  padding: 0 !important;
  gap: 0 !important;
  perspective: none !important;
  overflow: hidden;
  /* Design Gothique pour le fond de la fenêtre de jeu */
  background-color: #080a0f;
  background-image: url('/img/ui/bg-pattern.png');
  background-repeat: repeat;
  background-blend-mode: overlay;
  box-shadow: inset 0 0 100px rgba(0,0,0,0.8);
}

/* ---------- SCREENS ---------- */
.screen { display:none; }
.screen.active { display:flex; flex-direction:column; min-height:100vh; min-height:100dvh; }

/* ---------- BUTTONS ---------- */
.btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; padding:9px 18px; border:2px solid var(--border); border-radius:var(--r); cursor:pointer; font-size:12px; line-height:1.15; font-weight:700; transition:all .2s cubic-bezier(0.4, 0, 0.2, 1); background:var(--bg3); color:var(--text); text-decoration:none; text-transform:uppercase; letter-spacing:.5px; text-indent:.5px; position:relative; overflow:hidden; font-family: var(--font-display); text-shadow: 1px 1px 2px rgba(0,0,0,0.8); }
.btn:hover { border-color:var(--accent); box-shadow: 0 0 15px var(--accent-glow), inset 0 0 10px rgba(0,0,0,0.5); transform:translateY(-2px); }
.btn:active { transform:translateY(0); }
.btn.big { font-size:14px; padding:11px 24px; border-width: 3px; }
.btn-primary   { background: linear-gradient(135deg, var(--accent), #8a6d1d); color:#000; border-color:var(--accent); }
.btn-secondary { background:var(--bg3); color:var(--text); }
.btn-danger    { background:var(--danger); color:#fff; border-color:var(--danger); }
.btn-discord   { background:#5865F2; color:#fff; border-color:#5865F2; font-size:15px; padding:12px 24px; }
.btn-zone      { background:var(--bg2); border-color:#446; font-size:13px; }
.btn-target    { background:#001a30; border-color:var(--hunter-c); font-size:13px; }
.btn-attack    { background:#2a0000; border-color:var(--danger); font-size:13px; }
.btn-xs        { padding:3px 8px; font-size:11px; }

/* ---------- SPINNER ---------- */
.spinner { width:24px; height:24px; border:3px solid var(--border); border-top-color:var(--accent); border-radius:50%; animation:spin .8s linear infinite; margin:16px auto; }
@keyframes spin { to { transform:rotate(360deg); } }

/* ---------- AVATARS ---------- */
.avatar-sm { width:28px; height:28px; border-radius:50%; border:1px solid var(--border); }
.avatar-xs { width:20px; height:20px; border-radius:50%; border:1px solid var(--border); vertical-align:middle; margin-right:4px; }

/* ============================================================
   LOGIN
   ============================================================ */
#screen-login { 
  align-items:center; 
  justify-content:center; 
  background: 
    url('/img/ui/noise.png'),
    radial-gradient(circle at center, #1a1a3a 0%, var(--bg) 100%); 
}
.login-box { background:var(--bg2); border:1px solid var(--border); border-radius:var(--rl); padding:48px 40px; width:min(440px,95vw); text-align:center; }
.login-box h1 { font-size:2.2em; color:var(--accent); text-shadow:0 0 20px rgba(200,160,48,.4); letter-spacing:3px; margin-bottom:8px; }
.tagline { color:var(--dim); margin-bottom:32px; font-size:15px; }
.btn-discord { margin:0 auto; display:inline-flex; }
.error-msg { color:#ff6666; margin-top:16px; font-size:13px; }

/* ============================================================
   LOBBY
   ============================================================ */
.lobby-header { 
  display:flex; align-items:center; justify-content:space-between; padding:12px 24px; 
  background:rgba(10, 10, 20, 0.8); backdrop-filter: var(--glass);
  border-bottom:1px solid var(--border); flex-shrink:0; 
}
.lobby-header h1 { font-size:1.3em; color:var(--accent); letter-spacing:2px; }
.user-info { display:flex; align-items:center; gap:8px; }
.room-code-display { display:flex; align-items:center; gap:8px; color:var(--dim); font-size:14px; }
.room-code-display strong { color:var(--accent); font-size:1.4em; letter-spacing:3px; font-family:monospace; }

#screen-lobby.active { background:radial-gradient(ellipse at 50% 0%,#1a0a2e 0%,var(--bg) 60%); }
.lobby-main { display:grid; grid-template-columns:1fr 1fr; gap:16px; padding:24px; max-width:900px; width:100%; margin:0 auto; }

.lobby-card { 
  background:var(--bg2); border:1px solid var(--border); border-radius:var(--rl); 
  padding:24px; backdrop-filter: var(--glass);
  transition: transform 0.3s ease, border-color 0.3s ease;
}
.lobby-card.wide { grid-column:1/-1; }
.lobby-card h2 { font-size:1.1em; color:var(--accent); margin-bottom:8px; }
.lobby-card p { color:var(--dim); margin-bottom:16px; font-size:13px; line-height:1.5; }

.join-row { display:flex; gap:8px; }
.code-input { flex:1; padding:8px 12px; background:var(--bg3); border:1px solid var(--border); border-radius:var(--r); color:var(--text); font-size:16px; letter-spacing:3px; font-family:monospace; text-transform:uppercase; }
.code-input:focus { outline:none; border-color:var(--accent); }

/* Stats */
.stats-grid { display:flex; gap:12px; margin-bottom:8px; }
.stat-box { flex:1; text-align:center; background:var(--bg3); border:1px solid var(--border); border-radius:var(--r); padding:10px; }
.stat-val { font-size:1.6em; font-weight:700; color:var(--accent); }
.stat-lbl { font-size:11px; color:var(--dim); text-transform:uppercase; letter-spacing:1px; }
.char-stat-row { display:flex; justify-content:space-between; font-size:12px; color:var(--dim); padding:2px 0; }

/* Leaderboard */
.lb-table { width:100%; border-collapse:collapse; font-size:13px; }
.lb-table th { text-align:left; padding:6px 8px; border-bottom:1px solid var(--border); color:var(--dim); font-size:11px; text-transform:uppercase; letter-spacing:1px; }
.lb-table td { padding:6px 8px; border-bottom:1px solid rgba(255,255,255,.04); }
.lb-me td { background:rgba(200,160,48,.1); color:var(--accent); }

/* ============================================================
   WAITING ROOM
   ============================================================ */
.waiting-main { display:flex; align-items:flex-start; justify-content:center; padding:32px 20px; flex:1; }
.waiting-card { background:var(--bg2); border:1px solid var(--border); border-radius:var(--rl); padding:32px; width:min(500px,95vw); }
.waiting-card h2 { font-size:1.2em; color:var(--accent); margin-bottom:20px; }
.waiting-player { display:flex; align-items:center; gap:8px; padding:8px 12px; background:var(--bg3); border:1px solid var(--border); border-radius:var(--r); margin-bottom:8px; }
.waiting-player.bot-player { border-color:#3a3a5a; opacity:.9; }
.badge-host { font-size:11px; margin-left:auto; }
.badge-bot  { font-size:10px; padding:1px 6px; border-radius:3px; background:rgba(80,60,180,.5); color:#c0b8ff; border:1px solid #504898; margin-left:auto; }
.bot-avatar { font-size:22px; width:28px; text-align:center; }
/* Contrôles bots (hôte) */
.bot-controls  { margin-bottom:12px; }
.bot-row       { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.btn.btn-sm    { padding:5px 12px; font-size:12px; }
.bot-hint      { font-size:12px; color:var(--dim); font-style:italic; }
.waiting-actions { margin-top:24px; display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.waiting-tip { color:var(--dim); font-size:13px; width:100%; }

/* ============================================================
   GAME SCREEN
   ============================================================ */
#screen-game.active { display:grid; grid-template-rows:auto 1fr; height:100vh; height:100dvh; overflow:hidden; }

/* Header */
.game-header { 
  display:flex; align-items:center; justify-content:space-between; padding:8px 24px; 
  background:rgba(5, 5, 10, 0.9); backdrop-filter: var(--glass);
  border-bottom:1px solid var(--border); flex-shrink:0; gap:20px; 
  box-shadow: 0 4px 30px rgba(0,0,0,0.5);
  z-index: 100;
}
.game-header h1 { font-family: var(--font-display); font-size:1.2em; color:var(--accent); letter-spacing:3px; white-space:nowrap; }
#gh-turn-info { color:var(--dim); font-size:12px; white-space:nowrap; }

/* ---------- CHRONO DE TOUR ---------- */
.gh-timer {
  display:flex; align-items:center; gap:8px;
  margin-left:auto;
  padding:5px 14px;
  background:rgba(20,18,15,.85);
  border:1px solid var(--border);
  border-radius:20px;
  white-space:nowrap;
  box-shadow: inset 0 0 8px rgba(0,0,0,.5);
  transition: border-color .3s, box-shadow .3s, background .3s;
}
.gh-timer-icon  { font-size:14px; line-height:1; }
.gh-timer-label { font-size:11px; color:var(--dim); text-transform:uppercase; letter-spacing:.5px; }
.gh-timer-value {
  font-family: var(--font-display);
  font-size:16px; font-weight:800; color:var(--text);
  font-variant-numeric: tabular-nums;
  min-width:42px; text-align:center;
}
/* Dernières secondes du tour : rouge + pulsation */
.gh-timer-urgent {
  border-color: var(--danger);
  background: rgba(60,10,10,.85);
  box-shadow: 0 0 14px rgba(204,51,51,.5), inset 0 0 8px rgba(0,0,0,.5);
  animation: gh-timer-pulse .8s ease-in-out infinite;
}
.gh-timer-urgent .gh-timer-value { color:#ff6b6b; }
@keyframes gh-timer-pulse {
  0%,100% { box-shadow: 0 0 10px rgba(204,51,51,.4), inset 0 0 8px rgba(0,0,0,.5); }
  50%     { box-shadow: 0 0 20px rgba(204,51,51,.8), inset 0 0 8px rgba(0,0,0,.5); }
}
/* Décompte inter-parties */
.gh-timer-gameover {
  border-color: var(--accent);
  background: rgba(45,38,15,.85);
}
.gh-timer-gameover .gh-timer-value { color: var(--accent); }

#gh-player-info { display:flex; align-items:center; gap:8px; margin-left:auto; }
.hp-badge { font-size:13px; padding:4px 12px; border-radius:20px; font-weight: 800; border: 1px solid rgba(255,255,255,0.1); }
.hp-badge.hp-high { background: rgba(20, 100, 20, 0.3); color:#66ff66; box-shadow: 0 0 10px rgba(102, 255, 102, 0.2); }
.hp-badge.hp-mid  { background: rgba(100, 80, 20, 0.3); color:#ffcc44; box-shadow: 0 0 10px rgba(255, 204, 68, 0.2); }
.hp-badge.hp-low  { background: rgba(100, 20, 20, 0.3); color:#ff4444; box-shadow: 0 0 10px rgba(255, 68, 68, 0.2); }

/* ============================================================
   GAME LAYOUT — 3 colonnes : gauche / centre / droite
   ============================================================ */
.game-layout {
  display: grid; 
  grid-template-columns: 220px 1fr 290px;
  overflow: hidden;
  height: 100%;
  background: rgba(0,0,0,0.2);
}

/* ------------------------------------------------------------------
   OVERLAY PERSONNAGE SECRET
   ------------------------------------------------------------------ */
.overlay { position:fixed; inset:0; background:rgba(0,0,0,.85); z-index:200; display:flex; align-items:center; justify-content:center; }
.overlay.hidden { display:none; }
.char-reveal-box { background:var(--bg2); border:1px solid var(--border); border-radius:var(--rl); padding:32px; width:min(500px,95vw); text-align:center; max-height:95vh; overflow-y:auto; }
.char-reveal-box h2 { font-size:1.4em; color:var(--accent); margin-bottom:8px; }
.char-reveal-box p { color:var(--dim); margin-bottom:20px; }
.char-hp { font-size:14px; margin:8px 0; }

/* ------------------------------------------------------------------
   TITRE DES PANNEAUX
   ------------------------------------------------------------------ */
.panel-title {
  font-size: 10px;
  font-weight: 800;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin: 0 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

/* ============================================================
   PANNEAU GAUCHE — Mon personnage + Joueurs
   ============================================================ */
.left-panel {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 10px;
  background: rgba(10, 10, 25, 0.5);
  backdrop-filter: var(--glass);
  border-right: 1px solid var(--border);
  /* Dégradé vers la droite pour fondre le panneau dans la map */
  background: linear-gradient(to right, rgba(10,10,20,0.7), rgba(5,5,10,0.5));
}

/* ── Section "Mon personnage" dans le panneau gauche ── */
.left-my-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 8px 12px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.left-my-card.hidden { display: none; }
.lmc-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--dim);
  margin-bottom: 8px;
}
.lmc-inner {
  cursor: pointer;
  transition: transform .2s;
}
.lmc-inner:hover { transform: translateY(-4px) scale(1.03); }


.panel-title-players {
  text-align: center;
}

/* ── Centrage du contenu de la liste joueurs ── */
#players-list .pcard {
  justify-content: center;
}
#players-list .pcard-content {
  text-align: left;
  flex: 1;
}

/* On masque la carte du joueur local dans la liste générale pour éviter la duplication 
   avec la section "Mon personnage" qui est prioritaire. */
#players-list .pcard.me { display: none; }

/* ── Carte joueur — layout flex avec avatar à gauche ── */
.pcard {
  display: flex;
  gap: 8px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 8px;
  margin-bottom: 6px;
  transition: border-color .2s, box-shadow .2s;
}
.pcard.current { border-color: var(--accent); box-shadow: 0 0 8px rgba(200,160,48,.25); }
.pcard.me      { border-color: #334466; }
/* Mort : contour rouge sombre, fond légèrement rouge, contenu grisé */
.pcard.dead    {
  border-color: #5a1a1a;
  background: #160606;
  opacity: .82;
}
.pcard.dead .pcard-content { filter: grayscale(.5); opacity: .65; }
/* Le nom barré pour les éliminés */
.pcard-name-dead { text-decoration: line-through; color: var(--dim) !important; }
/* Badge "Éliminé" */
.pcard-dead-tag {
  font-size: 8px; font-weight: 700; color: #cc3333;
  text-transform: uppercase; letter-spacing: .5px; white-space: nowrap;
}

/* Colonne avatar */
.pcard-avatar-col {
  flex-shrink: 0;
  width: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.pcard-avatar-wrap {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.pcard-avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pcard-initials {
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--dim);
}
/* Placeholder avatar mort ─────────────────────────────────────────────
   Quand ton image sera prête, remplace ce bloc par :
     .pcard-dead-avatar { background-image: url('/img/dead-placeholder.png'); background-size: cover; }
   et supprime le span .pcard-skull-icon dans app.js.
   ──────────────────────────────────────────────────────────────────── */
.pcard-dead-avatar {
  background: #2a0808;
  border-color: #7a2222 !important;
  font-size: 0;           /* cache emoji si image ajoutée via background-image */
  position: relative;
  overflow: hidden;
}
.pcard-dead-avatar::after {
  content: '☠';           /* ← remplacer par rien quand l'image est prête */
  font-size: 20px;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  opacity: .85;
}
.pcard-skull { display: none; } /* intégré dans l'avatar, plus besoin en dessous */

/* Colonne contenu */
.pcard-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  justify-content: center;
}

/* Ligne 1 — Nom + indicateurs */
.pcard-row1 { display: flex; align-items: center; gap: 4px; }
.pcard-name {
  font-weight: 700;
  font-size: 11px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
.pcard-indicators { display: flex; align-items: center; gap: 3px; flex-shrink: 0; }
.cur-badge  { color: var(--accent); font-size: 10px; }
.me-tag     { font-size: 8px; padding: 1px 4px; background: #001a40; border-radius: 3px; color: #88aaff; }
.esp-target-tag { color: #cc99ff; font-size: 10px; }

/* Ligne 2 — Faction + HP */
.pcard-row2 { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }

/* HP dans la carte joueur */
.pcard-hp { font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 3px; flex-shrink: 0; }
.pcard-hp.hp-high { background:#0a2a0a; color:#66ff66; }
.pcard-hp.hp-mid  { background:#2a200a; color:#ffcc44; }
.pcard-hp.hp-low  { background:#2a0a0a; color:#ff4444; }
.pcard-hp.hp-dead { background:#1a0a0a; color:#ff4444; opacity:.7; }

/* Badge faction */
.badge { display:inline-flex; align-items:center; gap:3px; font-size:8px; padding:1px 5px; border-radius:3px; }
.badge.shadow  { background:#3a0000; color:#ffaaaa; border:1px solid #8b0000; }
.badge.hunter  { background:#001a3a; color:#aaccff; border:1px solid #004080; }
.badge.neutral { background:#1a2030; color:#aabbcc; border:1px solid #405060; }
.badge.unknown { background:#1a1a1a; color:#666;    border:1px solid #333; }
.badge-char    { opacity: .7; }

/* Ligne 3 — Zone + équipements */
.pcard-row3 { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.pcard-zone { font-size: 9px; color: var(--dim); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard-equips { display: flex; gap: 2px; flex-shrink: 0; }
.equip-chip {
  font-size: 13px;
  line-height: 1;
  cursor: default;
  filter: drop-shadow(0 0 2px rgba(255,220,120,.2));
  transition: transform .1s;
}
.equip-chip:hover { transform: scale(1.2); }

/* ============================================================
   PLATEAU CENTRAL — Board 2×4 (4 paires thématiques)
   ============================================================ */
.board {
  display: grid;
  grid-template-columns: 1fr 1fr;   /* 2 colonnes égales */
  grid-auto-rows: 1fr;              /* 4 lignes égales → 8 zones */
  gap: 10px;
  padding: 14px;
  overflow: hidden;
  background: var(--bg);
  /* Effet 2.5D — légère perspective isométrique */
  perspective: 1200px;
}

/* ── Tuile de zone ──────────────────────────────────────── */
.zone {
  position: relative;
  border-radius: 10px;
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  cursor: default;
  transition: border-color .25s, box-shadow .25s, transform .2s;
  /* Léger effet de profondeur sur chaque tuile */
  transform-style: preserve-3d;
}
.zone:hover {
  transform: translateY(-2px) scale(1.015);
  z-index: 2;
}
.zone.current-zone {
  border-color: var(--accent) !important;
  box-shadow: 0 0 14px rgba(200,160,48,.4), 0 0 3px rgba(200,160,48,.8) inset;
}

/* ── Fond de zone (image ou gradient couleur) ─────────── */
.zone-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: transform .4s ease;
}
.zone:hover .zone-bg { transform: scale(1.04); }

.zone.hermit .zone-bg { background-color: #071407; }
.zone.shadow .zone-bg { background-color: #140000; }
.zone.hunter .zone-bg { background-color: #000614; }

/* ── Overlay gradient lisibilité ──────────────────────── */
.zone-overlay {
  position: absolute;
  inset: 0;
}
.zone.hermit .zone-overlay { background: linear-gradient(to bottom, rgba(0,18,0,.3) 0%, rgba(0,8,0,.82) 100%); }
.zone.shadow  .zone-overlay { background: linear-gradient(to bottom, rgba(18,0,0,.3) 0%, rgba(8,0,0,.88) 100%); }
.zone.hunter  .zone-overlay { background: linear-gradient(to bottom, rgba(0,4,18,.3) 0%, rgba(0,2,12,.85) 100%); }

/* ── Bordures faction ─────────────────────────────────── */
.zone.hermit  { border-color: #1e4a1e; }
.zone.shadow  { border-color: #4a0e0e; }
.zone.hunter  { border-color: #0e2848; }
.zone.hermit:hover  { border-color: #3a8a3a; }
.zone.shadow:hover  { border-color: #8a1818; }
.zone.hunter:hover  { border-color: #183878; }

/* ── Contenu (par-dessus le fond et les effets) ───────── */
.zone-content {
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 8px 10px;
  gap: 3px;
}

/* En-tête : type + dés */
.zone-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:2px; }
.zone-type-badge {
  font-size: 9px; font-weight: 700; letter-spacing: .5px;
  padding: 1px 6px; border-radius: 4px; text-transform: uppercase;
}
.zone.hermit .zone-type-badge { background: rgba(42,90,42,.75); color: #88dd88; }
.zone.shadow  .zone-type-badge { background: rgba(90,16,16,.75); color: #ff9999; }
.zone.hunter  .zone-type-badge { background: rgba(16,40,80,.75); color: #99bbff; }
.zone-dice-badge {
  font-size: 9px; color: rgba(255,255,255,.55);
  background: rgba(0,0,0,.45); padding: 1px 5px; border-radius: 4px;
}

/* Icône centrale */
.zone-icon-wrap { font-size: 2em; line-height: 1; margin: 4px 0 2px; }

/* Nom */
.zone-name { font-size: 10px; font-weight: 700; color: rgba(255,255,255,.9); line-height: 1.3; }

/* ── Tokens joueurs (perles avatar) ──────────────────── */
.zone-tokens {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
  justify-content: center;
}
.player-token {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: default;
  transition: transform .15s;
}
.player-token:hover { transform: scale(1.1); }
.token-avatar-wrap {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.45);
  overflow: hidden;
  background: rgba(20,20,44,.85);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.token-avatar-wrap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.token-initials {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,.7);
  letter-spacing: -.5px;
  user-select: none;
  position: relative;
  z-index: 1;
  align-items: center;
  justify-content: center;
}
.token-name {
  font-size: 8.5px;
  color: rgba(255,255,255,.8);
  text-align: center;
  max-width: 48px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1;
}
/* Faction glow (révélé) */
.player-token.shadow  .token-avatar-wrap { border-color:rgba(220,60,60,.8);  box-shadow:0 0 8px rgba(220,60,60,.55); }
.player-token.hunter  .token-avatar-wrap { border-color:rgba(60,140,255,.8); box-shadow:0 0 8px rgba(60,140,255,.55); }
.player-token.neutral .token-avatar-wrap { border-color:rgba(90,180,110,.8); box-shadow:0 0 8px rgba(90,180,110,.5); }
.player-token.unknown .token-avatar-wrap { border-color:rgba(120,120,140,.5); }
/* Moi : bordure dorée */
.player-token.me-token .token-avatar-wrap {
  width: 38px; height: 38px;
  border-width: 3px;
  border-color: rgba(255,215,0,.9);
  box-shadow: 0 0 10px rgba(255,215,0,.5);
}
.player-token.me-token .token-name { color: rgba(255,215,0,.9); }

/* ============================================================
   EFFETS ATMOSPHÉRIQUES PAR ZONE (CSS pur, zéro JS)
   ============================================================ */

/* ── Couche d'effets (entre bg et overlay) ─────────────── */
.zone-fx {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

/* ── 🌲 Forêt / Chalet — particules féeriques vertes ────── */
.fx-forest .zone-fx::before,
.fx-forest .zone-fx::after {
  content: '';
  position: absolute;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: rgba(100,255,120,.8);
  box-shadow:
    8px  12px 0 1px rgba(80,255,100,.6),
    22px  5px 0 1px rgba(150,255,80,.7),
    35px 28px 0 2px rgba(60,220,120,.5),
    50px 10px 0 1px rgba(180,255,100,.6),
    65px 22px 0 1px rgba(100,255,80,.7),
    15px 40px 0 1px rgba(80,200,120,.4),
    45px 38px 0 2px rgba(120,255,60,.5),
    72px  8px 0 1px rgba(60,255,140,.6),
    30px 18px 0 1px rgba(200,255,100,.4);
  animation: fairy-float 4s ease-in-out infinite;
  opacity: 0;
}
.fx-forest .zone-fx::after {
  animation-delay: 2s;
  left: 10px;
  box-shadow:
    12px 15px 0 1px rgba(100,255,80,.5),
    28px  6px 0 1px rgba(80,220,120,.7),
    40px 32px 0 2px rgba(150,255,70,.4),
    55px 18px 0 1px rgba(60,255,100,.6);
}
@keyframes fairy-float {
  0%   { opacity: 0; transform: translateY(0) scale(.8); }
  20%  { opacity: 1; }
  80%  { opacity: .7; }
  100% { opacity: 0; transform: translateY(-30px) scale(1.1); }
}

/* ── 🌫️ Marais — brume flottante ──────────────────────── */
.fx-marsh .zone-fx::before,
.fx-marsh .zone-fx::after {
  content: '';
  position: absolute;
  width: 70%; height: 25px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(180,200,180,.18) 0%, transparent 70%);
  filter: blur(6px);
  bottom: 20%;
  left: 0;
  animation: marsh-fog 5s ease-in-out infinite;
}
.fx-marsh .zone-fx::after {
  width: 55%; height: 18px;
  bottom: 35%;
  left: 20%;
  animation: marsh-fog 7s ease-in-out infinite reverse;
  animation-delay: 2.5s;
}
@keyframes marsh-fog {
  0%, 100% { transform: translateX(-10px); opacity: .6; }
  50%       { transform: translateX(10px);  opacity: 1; }
}

/* ── ⛪ Ruines / Église — poussière dorée ──────────────── */
.fx-ruins .zone-fx::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(2px 2px at 20% 30%, rgba(220,190,100,.5) 0%, transparent 100%),
    radial-gradient(2px 2px at 60% 20%, rgba(220,200,120,.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 80% 60%, rgba(240,200,80,.3)  0%, transparent 100%),
    radial-gradient(1px 1px at 40% 70%, rgba(200,180,100,.4) 0%, transparent 100%);
  animation: ruin-dust 6s ease-in-out infinite;
  opacity: 0;
}
@keyframes ruin-dust {
  0%, 100% { opacity: 0; transform: translateY(0); }
  40%, 60% { opacity: 1; transform: translateY(-8px); }
}

/* ── 🌀 Portail des Enfers — énergie sombre pulsante ─── */
.fx-inferno .zone-fx::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 60%; height: 60%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(180,0,0,.25) 0%, rgba(80,0,0,.15) 40%, transparent 70%);
  animation: inferno-pulse 2.5s ease-in-out infinite;
}
.fx-inferno .zone-fx::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1px 1px at 30% 40%, rgba(255,60,0,.7)  0%, transparent 100%),
    radial-gradient(1px 1px at 65% 25%, rgba(255,30,0,.5)  0%, transparent 100%),
    radial-gradient(2px 2px at 50% 65%, rgba(200,0,0,.6)   0%, transparent 100%),
    radial-gradient(1px 1px at 75% 55%, rgba(255,80,0,.4)  0%, transparent 100%);
  animation: inferno-sparks 1.8s ease-in-out infinite;
}
@keyframes inferno-pulse {
  0%, 100% { opacity: .6; transform: translate(-50%,-50%) scale(1); }
  50%       { opacity: 1;  transform: translate(-50%,-50%) scale(1.15); }
}
@keyframes inferno-sparks {
  0%, 100% { opacity: 0; transform: translateY(0); }
  50%       { opacity: 1; transform: translateY(-6px); }
}

/* ── ⚰️ Cimetière — brume épaisse spectrale ─────────── */
.fx-grave .zone-fx::before,
.fx-grave .zone-fx::after {
  content: '';
  position: absolute;
  width: 80%; height: 30px;
  bottom: 10%;
  left: 0;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(140,160,140,.22) 0%, transparent 70%);
  filter: blur(8px);
  animation: grave-mist 6s ease-in-out infinite;
}
.fx-grave .zone-fx::after {
  width: 65%; height: 22px;
  bottom: 28%;
  left: 15%;
  animation: grave-mist 8s ease-in-out infinite reverse;
  animation-delay: 3s;
  background: radial-gradient(ellipse, rgba(160,180,160,.15) 0%, transparent 70%);
}
@keyframes grave-mist {
  0%, 100% { transform: translateX(-15px) scaleX(.9); opacity: .5; }
  50%       { transform: translateX(15px)  scaleX(1.1); opacity: 1; }
}

/* ── ✝️ Zones Chasseur — shimmer divin doré ─────────── */
.fx-divine .zone-fx::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    transparent 0%,
    rgba(255,220,80,.04) 25%,
    rgba(255,240,120,.10) 50%,
    rgba(255,220,80,.04) 75%,
    transparent 100%
  );
  background-size: 200% 200%;
  animation: divine-shimmer 4s linear infinite;
}
.fx-divine .zone-fx::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1px 1px at 25% 35%, rgba(255,240,100,.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 70% 20%, rgba(255,220,80,.5)  0%, transparent 100%),
    radial-gradient(2px 2px at 50% 70%, rgba(255,230,120,.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 80% 50%, rgba(255,200,60,.5)  0%, transparent 100%);
  animation: divine-sparkle 3s ease-in-out infinite;
}
@keyframes divine-shimmer {
  0%   { background-position: 200% 200%; opacity: .6; }
  100% { background-position: -200% -200%; opacity: 1; }
}
@keyframes divine-sparkle {
  0%, 100% { opacity: 0; transform: scale(.95); }
  50%       { opacity: 1; transform: scale(1); }
}

/* ============================================================
   PANNEAU DROIT — Actions + Conseils + Journal
   ============================================================ */
.right-panel {
  display: grid;
  grid-template-rows: auto minmax(160px, 220px) 1fr;
  overflow: hidden;
  background: var(--bg2);
  border-left: 1px solid var(--border);
}

/* --- Actions --- */
#action-panel { padding: 10px; border-bottom: 1px solid var(--border); overflow-y: auto; }
.phase-label { font-size: 10px; font-weight: 800; color: var(--accent); text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 8px; }
.not-my-turn { color: var(--dim); font-size: 12px; padding: 8px 10px; background: var(--bg3); border-radius: var(--r); margin-bottom: 6px; line-height: 1.5; }
.ac-center { display:flex; gap:6px; flex-wrap:wrap; justify-content: center; }
.btn-row { display:flex; gap:5px; flex-wrap:wrap; margin-bottom:6px; }

/* --- Uniformité des boutons dans le panneau d'action --- */
#action-panel .btn-row { flex-direction: column; gap: 6px; flex-wrap: nowrap; margin-bottom: 8px; }
#action-panel .ac-center { flex-direction: column; align-items: stretch; gap: 6px; }
#action-panel .btn { font-size: 13px; padding: 10px 14px; justify-content: center; width: 100%; }
#action-panel .btn.big { font-size: 14px; padding: 10px 14px; }

/* --- Bouton "Me révéler" persistent --- */
.action-reveal-section {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.btn-action-reveal {
  width: 100%;
  background: rgba(200,160,48,.1);
  border-color: rgba(200,160,48,.3);
  color: var(--accent);
  font-size: 13px;
  padding: 10px 14px;
  justify-content: center;
}
.btn-action-reveal:hover:not(:disabled) {
  background: rgba(200,160,48,.2);
  filter: brightness(1.15);
}
.btn-action-reveal:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  transform: none !important;
  filter: none !important;
}
.reveal-lock {
  font-size: 10px;
  opacity: 0.65;
  margin-left: 6px;
  font-weight: 400;
}
.drawn-card { display:flex; align-items:center; gap:10px; padding:8px 12px; border-radius:var(--r); border:1px solid; margin-bottom:8px; }
.drawn-card.hermit { background:#0a1a0a; border-color:#2a5a2a; }
.drawn-card.shadow { background:#1a0000; border-color:#5a1010; }
.drawn-card.hunter { background:#00001a; border-color:#102850; }
.equip-note { font-size:10px; color:var(--accent); margin-top:2px; }
.ability-zone { border-top:1px solid var(--border); padding-top:6px; margin-top:6px; }
.ability-zone p { font-size:11px; color:var(--dim); margin-bottom:4px; }
.ability-sir { background: rgba(80,0,40,.18); border: 1px solid rgba(180,0,80,.3); border-radius: var(--r); padding: 8px; margin-bottom: 6px; border-top: none; }
.ability-sir p { color: rgba(220,120,180,.9); font-size: 12px; }
.dice-display {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--dim);
  margin-top: 8px; padding: 4px 12px;
  background: var(--bg3); border-radius: 6px; border: 1px solid var(--border);
}
.dice-display strong { color: var(--accent); font-size: 13px; }
.hermit-zone { margin-top:6px; }

/* --- Conseils --- */
#tips-panel { padding: 10px; border-bottom: 1px solid var(--border); overflow-y: auto; min-height: 160px; max-height: 220px; }
.tip-entry {
  font-size: 11px;
  line-height: 1.6;
  color: rgba(200,210,230,.75);
  padding: 6px 10px;
  background: rgba(200,160,48,.05);
  border-left: 2px solid rgba(200,160,48,.35);
  border-radius: 0 6px 6px 0;
}
.tip-entry strong { color: var(--accent); }

/* --- Journal --- */
#log-panel { padding: 8px; overflow-y: auto; }
#game-log { font-size: 10px; line-height: 1.75; }
.log-entry { padding: 1px 0; border-bottom: 1px solid rgba(255,255,255,.025); color: var(--dim); }
.log-entry.log-fresh { color: var(--text); }
.log-entry.log-important { color: var(--accent); font-weight: 700; }

/* Types d'entrées de log */
.log-dice   { color: #88aaff; }
.log-damage { color: #ff8888; }
.log-heal   { color: #88ee88; }
.log-move   { color: #aaaaaa; }
.log-reveal { color: #ffd060; }
.log-turn   { color: rgba(200,160,48,.5); font-size: 9px; letter-spacing: 1px; text-transform: uppercase; }

/* ============================================================
   CHAR CARD
   ============================================================ */
.char-card { border-radius:var(--rl); padding:20px; border:2px solid; text-align:left; }
.char-card.shadow  { background:linear-gradient(135deg,#1a0000,#2a0a0a); border-color:#8b0000; }
.char-card.hunter  { background:linear-gradient(135deg,#00001a,#0a0a2a); border-color:#003070; }
.char-card.neutral { background:linear-gradient(135deg,#0a0a0a,#1a1a2a); border-color:#405060; }
.char-faction-badge { font-size:10px; font-weight:700; letter-spacing:2px; padding:2px 8px; border-radius:3px; display:inline-block; margin-bottom:8px; }
.shadow .char-faction-badge  { background:#8b0000; color:#ffc0c0; }
.hunter .char-faction-badge  { background:#003070; color:#c0d8ff; }
.neutral .char-faction-badge { background:#405060; color:#c0d0e0; }
.char-name  { font-size:1.4em; color:var(--accent); margin-bottom:4px; }
.char-desc  { color:var(--dim); font-style:italic; margin-bottom:10px; font-size:13px; }
.char-ability, .char-win { background:rgba(255,255,255,.05); border-radius:var(--r); padding:6px 10px; margin-bottom:6px; font-size:12px; line-height:1.5; }
.char-lore { color:var(--dim); font-style:italic; font-size:11px; margin-top:10px; }

/* ============================================================
   GAME OVER
   ============================================================ */
.winner-names { font-size:1.3em; color:var(--accent); margin-bottom:12px; }
.reveal-row { display:flex; align-items:center; gap:8px; padding:5px 8px; border-radius:var(--r); margin-bottom:3px; font-size:12px; }
.reveal-row.shadow  { background:#1a0000; }
.reveal-row.hunter  { background:#00001a; }
.reveal-row.neutral { background:#0a0a1a; }

/* ============================================================
   MODAL
   ============================================================ */
.modal { position:fixed; inset:0; background:rgba(0,0,0,.75); display:flex; align-items:center; justify-content:center; z-index:500; }
.modal.hidden { display:none; }
.modal-inner { background:var(--bg2); border:1px solid var(--border); border-radius:var(--rl); padding:28px; width:min(520px,95vw); max-height:90vh; overflow-y:auto; overflow-x:visible; }
#modal-title { display:block; font-size:1.2em; color:var(--accent); margin-bottom:14px; }
#modal-body { margin-bottom:20px; line-height:1.6; }
#modal-close { width:100%; }

/* ============================================================
   HOLOGRAPHIC CARD INTÉGRATION (reveal / modals / action panel)
   ============================================================ */

/* Centrage de la carte dans l'overlay de révélation du personnage */
.char-reveal-card-wrap {
  display: flex;
  justify-content: center;
  margin: 0 0 20px;
}

/* Centrage de la carte dans les modals (peek, my card) */
.card-modal-center {
  display: flex;
  justify-content: center;
  padding: 8px 0;
}

/* Carte piochée (petite taille) dans le panneau d'action */
.drawn-card-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

/* Choix Agnes : défilement horizontal pour les cartes small */
.agnes-choices {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 6px;
  scroll-snap-type: x mandatory;
}
.agnes-choices::-webkit-scrollbar { height: 3px; }

.agnes-choice-wrap {
  cursor: pointer;
  flex-shrink: 0;
  scroll-snap-align: start;
  transition: opacity .15s, transform .15s;
}
.agnes-choice-wrap:hover { opacity: .9; transform: translateY(-2px); }

/* Modal plus large pour les cartes holographiques pleine taille */
.modal-inner.modal-card { max-width: 340px; }

/* ============================================================
   LECTEUR MUSIQUE — Flottant persistant (coin bas-droite)
   ============================================================ */

/* Variables locales */
.music-player {
  --mp-bg:      rgba(12, 12, 28, 0.96);
  --mp-border:  rgba(200, 160, 48, 0.35);
  --mp-accent:  #c8a030;
  --mp-dim:     rgba(255,255,255,.4);
  --mp-radius:  12px;

  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1800;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  font-family: inherit;
}

/* ── Bouton flottant (FAB) ──────────────────────────────── */
.music-fab {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a1a38, #0e0e22);
  border: 1px solid var(--mp-border);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  box-shadow: 0 4px 16px rgba(0,0,0,.6), 0 0 8px rgba(200,160,48,.1);
  transition: box-shadow .2s, border-color .2s, transform .15s;
  overflow: hidden;
}
.music-fab:hover {
  border-color: var(--mp-accent);
  box-shadow: 0 4px 20px rgba(0,0,0,.7), 0 0 12px rgba(200,160,48,.3);
  transform: translateY(-1px);
}
.music-fab.open {
  border-color: rgba(200,160,48,.7);
  box-shadow: 0 0 16px rgba(200,160,48,.4);
}
.music-fab-icon { font-size: 18px; transition: opacity .2s; }
.music-fab.playing .music-fab-icon { opacity: 0; }

/* Barres animées (visibles quand lecture en cours) */
.music-fab-bars {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  padding-bottom: 10px;
  opacity: 0;
  transition: opacity .25s;
}
.music-fab.playing .music-fab-bars { opacity: 1; }
.music-fab-bars i {
  display: block;
  width: 3px;
  border-radius: 2px;
  background: var(--mp-accent);
  animation: bar-dance 0.8s ease-in-out infinite;
}
.music-fab-bars i:nth-child(1) { height: 8px;  animation-delay: 0s; }
.music-fab-bars i:nth-child(2) { height: 14px; animation-delay: .15s; }
.music-fab-bars i:nth-child(3) { height: 10px; animation-delay: .3s; }
.music-fab-bars i:nth-child(4) { height: 6px;  animation-delay: .1s; }
@keyframes bar-dance {
  0%, 100% { transform: scaleY(1); }
  50%       { transform: scaleY(.3); }
}

/* ── Panneau principal ─────────────────────────────────── */
.music-panel {
  width: 260px;
  background: var(--mp-bg);
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,.7), 0 0 24px rgba(200,160,48,.1);
  animation: mp-enter .25s cubic-bezier(.34,1.56,.64,1) both;
}
.music-panel.hidden { display: none; }
@keyframes mp-enter {
  from { opacity: 0; transform: translateY(10px) scale(.97); }
  to   { opacity: 1; transform: translateY(0)     scale(1); }
}

/* En-tête */
.music-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 8px;
  border-bottom: 1px solid rgba(200,160,48,.12);
}
.music-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--mp-accent);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Now playing + visualiseur */
.music-now-playing {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 8px;
}
.music-visualizer {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 20px;
  flex-shrink: 0;
}
.music-visualizer span {
  display: block;
  width: 3px;
  border-radius: 2px;
  background: var(--mp-accent);
  height: 4px;
  opacity: .4;
  transition: height .1s;
}
/* Barres animées quand actif (classe ajoutée par JS via .playing sur FAB) */
.music-fab.playing ~ .music-panel .music-visualizer span,
.music-panel.active .music-visualizer span {
  opacity: 1;
}
.music-panel.active .music-visualizer span:nth-child(1) { animation: viz-bar .7s ease-in-out infinite;       height: 12px; }
.music-panel.active .music-visualizer span:nth-child(2) { animation: viz-bar .5s ease-in-out infinite .1s;   height: 20px; }
.music-panel.active .music-visualizer span:nth-child(3) { animation: viz-bar .6s ease-in-out infinite .05s;  height: 16px; }
.music-panel.active .music-visualizer span:nth-child(4) { animation: viz-bar .8s ease-in-out infinite .15s;  height: 10px; }
.music-panel.active .music-visualizer span:nth-child(5) { animation: viz-bar .55s ease-in-out infinite .2s;  height: 14px; }
@keyframes viz-bar {
  0%, 100% { transform: scaleY(1); }
  50%       { transform: scaleY(.25); }
}

.music-track-info { flex: 1; min-width: 0; }
.music-track-name {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.music-track-hint {
  font-size: 10px;
  color: var(--mp-dim);
  margin-top: 1px;
}

/* Contrôles lecture */
.music-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 14px 8px;
}

/* Bouton icône générique */
.music-icon-btn {
  background: none;
  border: 1px solid rgba(255,255,255,.1);
  color: var(--mp-dim);
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 14px;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
  line-height: 1;
}
.music-icon-btn:hover {
  color: rgba(255,255,255,.9);
  border-color: rgba(255,255,255,.3);
  background: rgba(255,255,255,.06);
}
.music-icon-btn.active {
  color: var(--mp-accent);
  border-color: rgba(200,160,48,.5);
  background: rgba(200,160,48,.08);
}
.music-play-btn {
  padding: 6px 14px;
  font-size: 16px;
  border-color: rgba(200,160,48,.4);
  color: var(--mp-accent);
}
.music-play-btn:hover,
.music-play-btn.active {
  background: rgba(200,160,48,.12);
  border-color: rgba(200,160,48,.7);
  color: #ffd060;
}

/* Volume */
.music-volume-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px 10px;
}
.music-volume-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  background: rgba(255,255,255,.15);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}
.music-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--mp-accent);
  cursor: pointer;
  box-shadow: 0 0 4px rgba(200,160,48,.5);
}
.music-volume-slider::-moz-range-thumb {
  width: 12px; height: 12px;
  border: none;
  border-radius: 50%;
  background: var(--mp-accent);
  cursor: pointer;
}

/* ============================================================
   JETON VOLANT — Animation de déplacement
   ============================================================ */
.flying-token {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  /* Trajet plus lent et lisible ; le pion reste opaque presque tout le trajet
     puis s'estompe juste à l'arrivée (delay = durée du déplacement). */
  transition:
    left    .7s cubic-bezier(.45,.05,.25,1),
    top     .7s cubic-bezier(.45,.05,.25,1),
    opacity .25s .6s ease-out;
  transform-style: preserve-3d;
  perspective: 1000px;
}

.token-puck {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid #f0d080;
  background: linear-gradient(135deg, #1a1a3a, #050510);
  display: flex;
  align-items: center;
  justify-content: center;
  /* Aspect 3D Puck : épaisseur via ombres portées */
  box-shadow: 
    0 1px 0 #b8860b,
    0 2px 0 #b8860b,
    0 3px 0 #966d09,
    0 4px 12px rgba(0,0,0,0.8),
    0 0 20px rgba(212, 175, 55, 0.3);
  transform-style: preserve-3d;
  position: relative;
}

.token-puck img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
  overflow: hidden;
}

.flying-token-initials {
  font-size: 13px;
  font-weight: 800;
  color: rgba(255,255,255,.9);
  letter-spacing: -.5px;
  user-select: none;
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

/* Animation de marche : sauts nets avec écrasement à l'atterrissage
   (squash & stretch) pour bien donner l'impression que le pion "marche". */
@keyframes token-walk {
  0%   { transform: translateY(0)     scale(1,   1);    } /* au sol */
  15%  { transform: translateY(0)     scale(1.12,.88);  } /* accroupi (impulsion) */
  45%  { transform: translateY(-18px) scale(.9, 1.12);  } /* en l'air, étiré */
  75%  { transform: translateY(0)     scale(1.12,.88);  } /* atterrissage, écrasé */
  100% { transform: translateY(0)     scale(1,   1);    } /* récupération */
}

.walking {
  animation: token-walk 0.35s infinite ease-in-out;
  transform-origin: center bottom; /* l'écrasement part du sol */
}

/* ============================================================
   RÉVÉLATION VOLONTAIRE
   ============================================================ */

/* Bouton dans le header de jeu */
.btn-reveal-self {
  background: linear-gradient(135deg, rgba(80,30,120,.8), rgba(120,60,180,.8));
  border: 1px solid rgba(160,90,230,.65);
  color: #e0c8ff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  transition: background .2s, transform .1s;
  white-space: nowrap;
}
.btn-reveal-self:hover {
  background: linear-gradient(135deg, rgba(100,40,150,.9), rgba(140,70,200,.9));
  transform: translateY(-1px);
}

/* Fenêtre de révélation post-dégâts (bannière flottante) */
.reveal-window-banner {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(40,15,70,.97);
  border: 2px solid rgba(160,80,230,.75);
  border-radius: 14px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1500;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, transform .3s;
  transform: translateX(-50%) translateY(20px);
  box-shadow: 0 4px 24px rgba(160,80,230,.45), 0 2px 8px rgba(0,0,0,.6);
  animation: none;
}
.reveal-window-banner.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
  animation: rwb-pulse 2s ease-in-out infinite;
}
@keyframes rwb-pulse {
  0%, 100% { box-shadow: 0 4px 24px rgba(160,80,230,.4), 0 2px 8px rgba(0,0,0,.6); }
  50%       { box-shadow: 0 4px 32px rgba(160,80,230,.7), 0 2px 8px rgba(0,0,0,.6); }
}
.rwb-icon { font-size: 1.8em; flex-shrink: 0; }
.rwb-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rwb-text strong { font-size: 13px; color: #e8d0ff; }
.rwb-text span   { font-size: 11px; color: rgba(220,200,255,.75); }
.rwb-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 4px;
}
.rwb-countdown {
  font-size: 11px;
  color: rgba(200,180,240,.7);
  min-width: 20px;
  text-align: center;
}
.btn-reveal-sm {
  background: linear-gradient(135deg, rgba(80,30,120,.9), rgba(140,60,200,.9));
  border: 1px solid rgba(180,100,240,.65);
  color: #e8d0ff;
  padding: 7px 13px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, transform .1s;
  white-space: nowrap;
}
.btn-reveal-sm:hover { background: rgba(160,70,230,.9); transform: translateY(-1px); }
.btn-reveal-skip {
  background: rgba(40,40,60,.7);
  border: 1px solid rgba(100,100,130,.4);
  color: rgba(200,200,220,.7);
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 12px;
  cursor: pointer;
  transition: background .2s;
}
.btn-reveal-skip:hover { background: rgba(60,60,80,.9); color: rgba(220,220,240,.9); }

/* ============================================================
   ESPIONNAGE — Phase de placement (premier tour)
   ============================================================ */

/* Carte d'espionnage affichée dans le panneau d'actions */
.espionage-card-preview {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(80, 20, 120, 0.35);
  border: 1px solid rgba(160, 80, 220, 0.5);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.espionage-card-preview.is-forced {
  background: rgba(140, 30, 30, 0.35);
  border-color: rgba(220, 80, 80, 0.7);
  animation: esp-pulse 1.5s ease-in-out infinite;
}
@keyframes esp-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(220, 80, 80, 0.3); }
  50%       { box-shadow: 0 0 22px rgba(220, 80, 80, 0.65); }
}
.esp-icon  { font-size: 2em; flex-shrink: 0; line-height: 1; }
.esp-name  { font-weight: 700; color: #e0c8ff; margin-bottom: 4px; font-size: 13px; }
.esp-text  { font-size: 11px; color: rgba(255,255,255,0.72); line-height: 1.45; }
.esp-info  { flex: 1; min-width: 0; }
.esp-question {
  margin: 8px 0 10px;
  font-size: 13px;
  color: rgba(255,255,255,0.9);
}

/* Réponses d'espionnage */
.espionage-responses {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 4px;
}
.btn-response {
  background: rgba(55, 25, 85, 0.7);
  border: 1px solid rgba(140, 80, 200, 0.45);
  color: #e0d0ff;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  line-height: 1.35;
  transition: background .2s, border-color .2s, transform .1s;
  width: 100%;
}
.btn-response:hover {
  background: rgba(100, 50, 155, 0.8);
  border-color: rgba(180, 100, 240, 0.75);
  transform: translateY(-1px);
}
.btn-response:active { transform: translateY(0); }

/* Réponse forcée affichée au joueur interrogé */
.esp-forced-response {
  background: rgba(40, 20, 70, .55);
  border: 1px solid rgba(160, 90, 220, .5);
  border-radius: 10px;
  padding: 12px 16px;
  color: #d8c0ff;
  font-size: 13px;
  font-style: italic;
  font-weight: 600;
  text-align: center;
  margin: 8px 0 10px;
  line-height: 1.5;
}

/* Notice révélation forcée */
.espionage-forced-notice {
  background: rgba(160, 35, 35, 0.4);
  border: 1px solid rgba(230, 80, 80, 0.55);
  border-radius: 8px;
  padding: 10px 14px;
  color: #ffb0b0;
  font-size: 12px;
  line-height: 1.4;
  margin-bottom: 10px;
}

/* ── Overlay animation réponse espionnage (interrogateur) ── */
.espionage-result-overlay {
  position: fixed;
  inset: 0;
  z-index: 3100;
  background: rgba(0, 0, 0, .75);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  animation: spotlight-in .2s ease;
}
.espionage-result-overlay.hidden { display: none; }
.espionage-result-overlay.is-forced { background: rgba(40, 0, 0, .82); }

.esp-result-card {
  background: linear-gradient(160deg, #18183a, #0e0e24);
  border: 1px solid rgba(200, 160, 48, .5);
  border-radius: 20px;
  padding: 36px 40px;
  max-width: 380px;
  width: min(380px, 92vw);
  text-align: center;
  animation: spotlight-card-pop .35s cubic-bezier(0.34,1.56,0.64,1);
  pointer-events: none;
}
.is-forced .esp-result-card {
  border-color: rgba(230, 80, 80, .7);
  background: linear-gradient(160deg, #2a0808, #180404);
}
.esp-result-icon   { font-size: 2.8em; margin-bottom: 10px; }
.esp-result-title  { font-size: 10px; letter-spacing: 2.5px; text-transform: uppercase; color: rgba(200,160,48,.7); margin-bottom: 18px; }
.esp-result-target { font-size: 12px; color: rgba(255,255,255,.5); margin-bottom: 6px; }
.esp-result-target strong { color: rgba(255,255,255,.85); }
.esp-result-response {
  font-size: 1.25em;
  font-weight: 700;
  color: #ffd060;
  margin-bottom: 24px;
  line-height: 1.5;
}
.is-forced .esp-result-response { color: #ff9999; }
.esp-result-hint { font-size: 11px; color: rgba(255,255,255,.28); letter-spacing: 1px; text-transform: uppercase; }
.btn-danger {
  background: rgba(160, 30, 30, 0.75);
  border: 1px solid rgba(220, 70, 70, 0.7);
  color: #ffcfcf;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: background .2s, transform .1s;
}
.btn-danger:hover { background: rgba(200, 40, 40, 0.85); transform: translateY(-1px); }

/* Notice de placement (affiché avant le bouton "Lancer les dés") */
.placement-notice {
  background: rgba(60, 30, 100, 0.4);
  border: 1px solid rgba(120, 70, 180, 0.45);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  color: rgba(220, 190, 255, 0.9);
  margin-bottom: 10px;
  line-height: 1.4;
}

/* Indicateurs de placement */
.pcard-placed   { color: #80ff90; font-size: 9px; }
.pcard-unplaced { color: #ffcc80; font-size: 9px; }

/* Carte joueur avec cible d'espionnage mise en évidence */
.pcard.esp-target {
  border-color: rgba(160, 80, 220, 0.7) !important;
  box-shadow: 0 0 12px rgba(160, 80, 220, 0.35);
  animation: esp-target-pulse 1.2s ease-in-out infinite;
}
@keyframes esp-target-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(160, 80, 220, 0.25); }
  50%       { box-shadow: 0 0 20px rgba(160, 80, 220, 0.6); }
}

/* ============================================================
   SPOTLIGHT — Carte piochée en plein écran
   ============================================================ */
.card-spotlight-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  cursor: pointer;
  animation: spotlight-in .2s ease;
}
.card-spotlight-overlay.hidden { display: none; }
@keyframes spotlight-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.spotlight-card-container {
  animation: spotlight-card-pop .3s cubic-bezier(0.34,1.56,0.64,1);
  pointer-events: none;
}
@keyframes spotlight-card-pop {
  from { transform: scale(0.75) translateY(20px); opacity: 0; }
  to   { transform: scale(1)    translateY(0);    opacity: 1; }
}
.spotlight-hint {
  color: rgba(255,255,255,.45);
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  pointer-events: none;
}

/* ── Animation pioche : dos de carte → flip-out ──────────────
   Le dos tourne de 0° à 90° (mi-flip → invisible).
   La face est ensuite insérée et joue le flip-in existant
   (.sh-card.flipped dans cards.css).
   ─────────────────────────────────────────────────────────── */
@keyframes card-draw-flip-out {
  0%   { transform: perspective(900px) rotateY(0deg)  scale(1);    opacity: 1; }
  80%  { transform: perspective(900px) rotateY(75deg) scale(0.9);  opacity: 0.4; }
  100% { transform: perspective(900px) rotateY(90deg) scale(0.88); opacity: 0; }
}
.card-draw-flip-out {
  animation: card-draw-flip-out 0.38s ease-in forwards !important;
  pointer-events: none;
}

/* Carte dans le panel action — cliquable pour re-voir en grand */
.drawn-card-wrap.clickable-card { cursor: pointer; }
.drawn-card-wrap.clickable-card:hover .sh-card { filter: brightness(1.1); }
.reread-hint {
  font-size: 9px;
  color: var(--dim);
  text-align: center;
  margin-top: 4px;
  letter-spacing: .5px;
}

/* Message "en attente de réponse" */
.waiting-answer {
  font-style: italic;
  color: rgba(200, 170, 255, 0.85);
  padding: 10px 0;
}

/* Playlist */
.music-playlist {
  border-top: 1px solid rgba(200,160,48,.1);
  max-height: 120px;
  overflow-y: auto;
}
.music-track-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: none;
  border: none;
  color: var(--mp-dim);
  font-size: 11px;
  cursor: pointer;
  text-align: left;
  transition: background .15s, color .15s;
  border-bottom: 1px solid rgba(255,255,255,.03);
}
.music-track-item:hover {
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.8);
}
.music-track-item.active {
  background: rgba(200,160,48,.08);
  color: var(--mp-accent);
}
.music-track-label { font-size: 13px; flex-shrink: 0; }
.music-track-title  { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Section effets sonores ─────────────────────────────── */
.music-sfx-section {
  border-top: 1px solid rgba(200,160,48,.12);
  padding: 8px 14px 6px;
}
.music-sfx-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.music-sfx-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--mp-dim, #888);
}
.music-sfx-vol-icon { font-size: 13px; flex-shrink: 0; }
#sfx-toggle { font-size: 15px; }
#sfx-toggle.active { color: var(--mp-accent, #c8a030); }

/* Notice autoplay */
.music-autoplay-notice {
  display: none;
  padding: 8px 14px 10px;
  font-size: 10px;
  color: rgba(255,200,80,.8);
  border-top: 1px solid rgba(200,160,48,.1);
  line-height: 1.5;
  text-align: center;
}
.music-autoplay-notice.visible { display: block; }
.music-autoplay-notice strong  { color: var(--mp-accent); }

/* Responsive : plus petit sur mobile */
@media (max-width: 600px) {
  .music-player { bottom: 14px; right: 14px; }
  .music-panel  { width: 230px; }
}

/* ── Panneau de pioche en bas d'écran ──────────────────────── */
#card-draw-tray {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(350px); /* caché par défaut */
  z-index: 1100;
  width: 360px;
  padding: 10px 20px 0;
  background: linear-gradient(180deg, rgba(5,0,20,0) 0%, rgba(5,0,20,0.82) 35%);
  border-radius: 24px 24px 0 0;
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.5s cubic-bezier(0.34,1.56,0.64,1);
  pointer-events: none;
  user-select: none;
}
#card-draw-tray.tray-visible {
  transform: translateX(-50%) translateY(145px); /* 145px sous le bord = ~65% visible */
  pointer-events: auto;
}
.card-tray-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.45);
  pointer-events: none;
}

/* ── Deck de sélection de personnage ─────────────────────── */
.char-select-prompt { margin-bottom: 6px; }
.char-select-deck {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  padding: 6px 4px 10px;
}
.char-slot {
  position: relative;
  transition: transform 0.2s ease;
  cursor: default;
}
.char-slot.available {
  cursor: pointer;
}
.char-slot.available:hover {
  transform: translateY(-10px);
}
.char-slot.taken {
  opacity: 0.35;
  filter: grayscale(0.5);
}
.char-slot.taken .sh-card {
  pointer-events: none;
}

/* ============================================================
   SCROLLBARS
   ============================================================ */
::-webkit-scrollbar { width:5px; height:5px; }
::-webkit-scrollbar-track { background:var(--bg); }
::-webkit-scrollbar-thumb { background:var(--border); border-radius:3px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width:1100px) {
  .game-layout { grid-template-columns: 180px 1fr 260px; }
}
@media (max-width:900px) {
  .game-layout { grid-template-columns: 160px 1fr 240px; }
  .board { gap: 6px; padding: 10px; }
}
@media (max-width:700px) {
  .lobby-main { grid-template-columns:1fr; }

  /* ── Écran de jeu mobile : 1 colonne ──
     bandeau joueurs (haut) / plateau (centre) / actions+journal (bas) */
  .game-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  /* Header compact : on garde tour + PV, on retire le titre */
  .game-header { padding: 6px 10px; gap: 8px; }
  .game-header h1 { display: none; }
  /* Chrono compact : on masque le libellé, on garde icône + valeur */
  .gh-timer { padding: 4px 10px; gap: 5px; }
  .gh-timer-label { display: none; }
  .gh-timer-value { font-size: 14px; min-width: 38px; }

  /* Panneau gauche → bandeau horizontal scrollable (joueurs visibles !) */
  .left-panel {
    flex-direction: row;
    align-items: stretch;
    gap: 8px;
    padding: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: none;
    border-bottom: 1px solid var(--border);
    -webkit-overflow-scrolling: touch;
  }
  .panel-title-players { display: none; }
  #players-list { display: flex; gap: 8px; }
  #players-list .pcard { flex: 0 0 172px; margin-bottom: 0; }

  /* Mini-carte "Mon personnage" → vignette compacte (clic = revoir l'identité) */
  .left-my-card {
    flex: 0 0 auto;
    flex-direction: row;
    margin-bottom: 0;
    padding: 0 8px 0 0;
    border-bottom: none;
    border-right: 1px solid rgba(255,255,255,.08);
  }
  .lmc-title { display: none; }
  .left-my-card .lmc-inner { width: 66px; height: 92px; overflow: hidden; }
  .left-my-card .lmc-inner .sh-card {
    transform: scale(.46) !important;
    transform-origin: top left;
  }

  /* Panneau droit → bas d'écran : actions d'abord, journal ensuite */
  .right-panel {
    display: flex;
    flex-direction: column;
    max-height: 45vh;
    max-height: 45dvh;
    border-left: none;
    border-top: 1px solid var(--border);
  }
  #tips-panel { display: none; }            /* les conseils passent à la trappe sur petit écran */
  #action-panel { flex: 0 0 auto; max-height: 60%; }
  #log-panel { flex: 1; padding-bottom: 72px; } /* espace pour la barre des decks fixe */

  /* Cibles tactiles confortables */
  #action-panel .btn { min-height: 44px; }

  /* Barre des decks plus discrète */
  .deck-bar { gap: 10px; padding: 6px 12px 8px; }
}

/* ============================================================
   BARRE DES DECKS — bas de l'écran de jeu
   ============================================================ */
.deck-bar {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 20px;
  padding: 10px 28px 12px;
  z-index: 100;
  background: linear-gradient(0deg, rgba(5,0,20,0.92) 0%, rgba(5,0,20,0) 100%);
  pointer-events: auto;
  align-items: flex-end;
}

/* Une pile de cartes */
.deck-pile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: default;
  transition: transform 0.2s ease;
}
.deck-pile:hover { transform: translateY(-8px); }

/* Effet empilage 3D */
.deck-stack { position: relative; width: 54px; height: 72px; }
.deck-card {
  position: absolute;
  width: 50px; height: 68px;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,.12);
}
.deck-card.d3 { bottom: 0; left: 4px;  transform: rotate(-4deg); background: rgba(20,15,40,.8); }
.deck-card.d2 { bottom: 2px; left: 2px; transform: rotate(-2deg); background: rgba(25,18,45,.85); }
.deck-card.d1 {
  bottom: 4px; left: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  box-shadow: 0 3px 10px rgba(0,0,0,.7);
  border: 1px solid rgba(255,255,255,.18);
  background: var(--bg3);
}
.deck-pile[data-deck="green"] .deck-card.d1  { border-color:rgba(76,175,80,.55);  background:linear-gradient(160deg,#0a200a,#162816); }
.deck-pile[data-deck="green"] .deck-card.d2  { border-color:rgba(76,175,80,.2); }
.deck-pile[data-deck="black"] .deck-card.d1  { border-color:rgba(156,39,176,.55); background:linear-gradient(160deg,#150a20,#200828); }
.deck-pile[data-deck="black"] .deck-card.d2  { border-color:rgba(156,39,176,.2); }
.deck-pile[data-deck="white"] .deck-card.d1  { border-color:rgba(255,215,0,.4);   background:linear-gradient(160deg,#0a0a20,#101028); }
.deck-pile[data-deck="white"] .deck-card.d2  { border-color:rgba(255,215,0,.15); }

.deck-icon  { font-size: 20px; line-height: 1; }
.deck-count { font-size: 9px; font-weight: 700; color: rgba(255,255,255,.55); letter-spacing: .5px; }
.deck-label { font-size: 9px; text-transform: uppercase; letter-spacing: 1.2px; color: rgba(255,255,255,.3); white-space: nowrap; }

/* Deck actif (zone du joueur courant) */
.deck-pile.deck-active { transform: translateY(-10px); }
.deck-pile.deck-active .deck-card.d1 {
  box-shadow: 0 0 14px rgba(200,160,48,.55), 0 3px 10px rgba(0,0,0,.7);
  border-color: rgba(200,160,48,.6) !important;
}
.deck-pile.deck-active .deck-label { color: var(--accent); font-weight: 700; }

/* Tooltip infobulle */
.deck-tooltip {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%; transform: translateX(-50%);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  width: 220px;
  font-size: 11px;
  line-height: 1.5;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 500;
}
.deck-pile:hover .deck-tooltip { opacity: 1; }
.deck-tooltip strong  { font-size: 13px; color: var(--accent); display: block; margin-bottom: 4px; }
.deck-tooltip .tt-desc { color: var(--dim); margin-bottom: 4px; }
.deck-tooltip .tt-fx   { font-size: 10px; color: rgba(255,255,255,.45); }
.deck-tooltip .tt-cnt  { font-size: 10px; color: rgba(255,255,255,.35); margin-top: 5px; border-top: 1px solid rgba(255,255,255,.08); padding-top: 5px; }

/* Pendant CHAR_SELECT : decks de jeu assombris */
.deck-bar.char-select-mode .deck-pile {
  opacity: 0.2;
  pointer-events: none;
  filter: grayscale(.6);
}

/* ============================================================
   CHAR-SELECT OVERLAY (par-dessus la map)
   ============================================================ */
#board.game-board-map { position: relative; }

.char-select-overlay {
  position: absolute;
  inset: 0;
  z-index: 1000; /* au-dessus des panes Leaflet (z-index 400–600) */
  background: rgba(4, 0, 16, 0.82);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 16px;
  overflow-y: auto;
}
.char-select-overlay.hidden { display: none; }

.cso-header { text-align: center; }
.cso-title {
  font-family: 'Cinzel', serif;
  font-size: 1.25em;
  color: var(--accent);
  margin: 0 0 6px;
  text-shadow: 0 0 20px rgba(var(--accent-rgb, 180,140,60), 0.5);
}
.cso-sub {
  font-size: 0.82em;
  color: var(--dim);
  margin: 0;
  min-height: 1.2em;
  transition: color 0.3s;
}
.cso-sub.my-turn { color: #c8a840; font-weight: 600; }

.cso-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: center;
  align-items: flex-end;
  max-width: 800px;
}

/* Slot de carte dans l'overlay */
.cso-slot {
  position: relative;
  cursor: default;
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s;
}
.cso-slot.available { cursor: pointer; }
/* La délégation via .closest() gère les clics — pointer-events hérité auto */
.cso-reveal-card { display: flex; justify-content: center; padding: 8px 0; }
.cso-slot.available:hover {
  transform: translateY(-14px) scale(1.06);
  filter: drop-shadow(0 8px 24px rgba(200,168,64,0.45));
}
.cso-slot.available:active { transform: translateY(-8px) scale(1.02); }
.cso-slot.waiting { cursor: default; opacity: 0.7; }
.cso-slot.taken {
  opacity: 0.3;
  filter: grayscale(0.6);
  pointer-events: none;
}
.cso-slot.taken::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5em;
  color: rgba(255,255,255,0.5);
  border-radius: 14px;
  background: rgba(0,0,0,0.35);
}

/* Rang des joueurs ayant déjà sélectionné */
.cso-players {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.cso-player-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  padding: 3px 10px 3px 5px;
  font-size: 11px;
  color: var(--dim);
}
.cso-player-chip.done { color: #78c878; border-color: rgba(120,200,120,0.3); }
.cso-player-chip.active { color: #c8a840; border-color: rgba(200,168,64,0.4); animation: cso-pulse 1.4s ease infinite; }
.cso-player-chip img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }
.cso-player-chip .cso-initials { width:20px; height:20px; border-radius:50%; background:var(--border); display:flex; align-items:center; justify-content:center; font-size:8px; font-weight:700; }
@keyframes cso-pulse { 0%,100%{opacity:1} 50%{opacity:0.6} }

/* ============================================================
   MINI-CARTE PERSONNAGE (bas-gauche, persistante)
   ============================================================ */
/* Animation d'apparition de la carte personnage (panneau gauche) */
@keyframes mcm-appear {
  from { opacity: 0; transform: translateY(20px) scale(0.7); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
#left-my-card.appearing { animation: mcm-appear 0.5s cubic-bezier(0.34,1.56,0.64,1) both; }

/* ============================================================
   ORBES D'ÉQUIPEMENT (panneau droit)
   ============================================================ */
.equip-orbs {
  padding: 10px 10px 8px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.equip-orbs.hidden { display: none; }

.eo-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--dim);
}

.eo-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.eo-orb {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, rgba(255,255,255,0.18) 0%, rgba(0,0,0,0.55) 100%);
  border: 1.5px solid rgba(255,255,255,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: help;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.eo-orb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 14px rgba(255,220,80,0.45);
  border-color: rgba(255,220,80,0.5);
  z-index: 10;
}
/* Couleur orbe selon deck d'origine */
.eo-orb.orb-black { border-color: rgba(150,40,200,0.4); background: radial-gradient(circle at 38% 32%, rgba(150,40,200,0.25) 0%, rgba(0,0,0,0.55) 100%); }
.eo-orb.orb-white { border-color: rgba(80,150,255,0.4); background: radial-gradient(circle at 38% 32%, rgba(80,150,255,0.2) 0%, rgba(0,0,0,0.55) 100%); }

.eo-tooltip {
  display: none;
  position: absolute;
  left: 46px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 11px;
  white-space: nowrap;
  color: var(--text);
  pointer-events: none;
  z-index: 300;
  min-width: 150px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}
.eo-orb:hover .eo-tooltip { display: block; }
.eo-tooltip strong { display: block; margin-bottom: 3px; color: var(--accent); font-size: 12px; }
.eo-tooltip .eo-tt-desc { color: var(--dim); font-size: 10px; line-height: 1.4; }

/* Chips équipement améliorées sur les profils joueurs */
.pcard-equips { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 2px; }
.equip-chip {
  position: relative;
  font-size: 14px;
  cursor: help;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  transition: transform 0.15s, background 0.15s;
}
.equip-chip:hover {
  transform: scale(1.25);
  background: rgba(255,220,80,0.12);
  border-color: rgba(255,220,80,0.35);
  z-index: 5;
}
.equip-chip .equip-chip-tip {
  display: none;
  position: absolute;
  left: 26px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 10px;
  white-space: nowrap;
  color: var(--text);
  pointer-events: none;
  z-index: 400;
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}
.equip-chip:hover .equip-chip-tip { display: block; }

/* --- Animations de dégâts mini-carte --- */
@keyframes mini-damage-flash {
  0% { transform: scale(1); filter: brightness(1) sepia(0); }
  10% { transform: scale(1.1) rotate(5deg); filter: brightness(2) sepia(1) hue-rotate(-50deg); box-shadow: 0 0 40px #ff0000; }
  20% { transform: scale(1.1) rotate(-5deg); }
  30% { transform: scale(1.1) rotate(5deg); }
  100% { transform: scale(1) rotate(0); filter: brightness(1) sepia(0); box-shadow: none; }
}

#left-my-card.damage-flash {
  animation: mini-damage-flash 0.6s cubic-bezier(.36,.07,.19,.97) both;
}

.blood-particle {
  position: absolute;
  width: 6px;
  height: 6px;
  background: #990000;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1000;
  box-shadow: 0 0 4px #ff0000;
}

@keyframes blood-explode {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { 
    transform: translate(var(--dx), var(--dy)) scale(0.2); 
    opacity: 0; 
  }
}

/* --- Animations de soin mini-carte --- */
@keyframes mini-heal-flash {
  0% { transform: scale(1); filter: brightness(1); box-shadow: none; }
  50% { transform: scale(1.08); filter: brightness(1.4) saturate(1.2); box-shadow: 0 0 30px rgba(0, 255, 0, 0.6); }
  100% { transform: scale(1); filter: brightness(1); box-shadow: none; }
}

#left-my-card.heal-flash {
  animation: mini-heal-flash 0.8s ease-out;
}

.heal-particle {
  position: absolute;
  width: 5px;
  height: 5px;
  background: #55ff55;
  border-radius: 20%;
  pointer-events: none;
  z-index: 1000;
  box-shadow: 0 0 6px #00ff00;
}

@keyframes heal-float {
  0% { transform: translate(0, 0) scale(0); opacity: 0; }
  30% { opacity: 1; transform: translate(calc(var(--dx) * 0.3), calc(var(--dy) * 0.3)) scale(1.2); }
  100% {
    transform: translate(var(--dx), var(--dy)) scale(0.5);
    opacity: 0;
  }
}

/* ---------- Pièges & effets de statut ---------- */
.pcard-status { display: inline-flex; gap: 3px; align-items: center; margin-left: 4px; }
.status-chip {
  font-size: 13px; line-height: 1;
  filter: drop-shadow(0 0 3px rgba(255,120,0,.7));
  animation: status-pulse 1.4s ease-in-out infinite;
}
.status-chip sup { font-size: 8px; color: #ffd9a0; font-weight: 700; }
@keyframes status-pulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .status-chip { animation: none; } }

.my-traps-note {
  margin: 8px 0; padding: 6px 10px; border-radius: 8px;
  background: rgba(120,40,0,.22); border: 1px solid rgba(200,90,20,.4);
  color: #ffc89a; font-size: 12px; text-align: center;
}
