/* ══════════════════════════════════════════════════════════════
   GAME BOARD — Layout 2×2, même structure pour les 4 joueurs
══════════════════════════════════════════════════════════════ */

#screen-game {
  display: grid;
  grid-template-rows: 56px 1fr;  /* header agrandi : 44 → 56px */
  grid-template-columns: 1fr 260px;
  grid-template-areas:
    "header  header"
    "board   log";
  height: 100vh;
  overflow: hidden;
  transition: grid-template-columns 0.25s ease;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(60,20,100,.18) 0%, transparent 55%),
    radial-gradient(ellipse at 70% 80%, rgba(20,50,110,.18) 0%, transparent 55%),
    var(--bg);
}

/* ── Header ─────────────────────────────────────────────────── */
.game-header {
  grid-area: header;
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: 0 .9rem;
  background: rgba(0,0,0,.55);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
  z-index: 20;
}

.phase-track { display: flex; gap: 3px; flex: 1; }

.phase-pip {
  padding: 4px 9px;
  border-radius: 4px;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-dim);
  border: 1px solid transparent;
  transition: all .2s;
  white-space: nowrap;
}
.phase-pip.active { background: rgba(212,175,55,.2); border-color: var(--gold); color: var(--gold); }
.phase-pip.done   { color: #444; }

.turn-info { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--text-dim); white-space: nowrap; }
.active-player-chip {
  background: rgba(212,175,55,.12); border: 1px solid rgba(212,175,55,.3);
  border-radius: 12px; padding: 2px 10px; color: var(--gold); font-size: .8rem; font-weight: 600;
}
.header-actions { display: flex; gap: .5rem; }

.btn-game {
  border: none; border-radius: 6px; padding: 6px 12px;
  font-size: .8rem; font-weight: 600; cursor: pointer;
  font-family: var(--font-body); transition: all .15s;
}
.btn-game:disabled { opacity: .3; cursor: not-allowed; }

/* ── Boutons HP dans le header (toujours accessibles) ─────────── */
.header-hp-btn {
  background: rgba(255,255,255,.08); border: 1px solid var(--border);
  color: var(--text); border-radius: 4px; width: 22px; height: 22px;
  font-size: .8rem; font-weight: 700; cursor: pointer; line-height: 1;
  transition: background .15s;
}
.header-hp-btn:hover { background: rgba(212,175,55,.2); border-color: var(--gold); color: var(--gold); }
.btn-next-phase { background: rgba(91,155,213,.15); border: 1px solid rgba(91,155,213,.35); color: #8bbfe8; }
.btn-next-phase:hover:not(:disabled) { background: rgba(91,155,213,.3); }
.btn-end-turn   { background: rgba(212,175,55,.15); border: 1px solid rgba(212,175,55,.4); color: var(--gold); }
.btn-end-turn:hover:not(:disabled)   { background: rgba(212,175,55,.3); }

/* ── Board 2×2 ───────────────────────────────────────────────── */
.game-board {
  grid-area: board;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  overflow: hidden;
  /* align-items: start → la bordure du player-zone serre le contenu
     (pas d'espace vide sous la rangée LAND) */
  align-items: start;
}

/* ── Zone joueur (même structure pour tous) ─────────────────── */
.player-zone {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: rgba(255,255,255,.018);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 6px;
  overflow-x: hidden;
  overflow-y: visible;   /* les cartes tappées ne sont pas clippées */
  position: relative;
  /* height auto → colle au contenu, grâce à align-items:start sur le parent */
  transition: border-color .3s, box-shadow .3s;
}
.player-zone.active {
  border-color: rgba(212,175,55,.95);
  border-width: 2px;
  /* inset shadows only — stay strictly inside the border, no background tint
     (the background would fill the entire grid cell incl. empty rows below land) */
  box-shadow: inset 0 0 22px rgba(212,175,55,.14), inset 0 0 8px rgba(212,175,55,.07);
  background: rgba(255,255,255,.018) !important; /* same as base, no yellow tint */
}
.player-zone.active .pz-header {
  /* seule la bannière header reçoit le tint doré — elle couvre exactement sa hauteur */
  background: rgba(212,175,55,.10);
  border-bottom: 1px solid rgba(212,175,55,.3);
}
/* Les rangées de cartes (land, créa…) reçoivent un léger tint sans déborder */
.player-zone.active .zone-row {
  background-color: rgba(212,175,55,.025);
}
.player-zone.is-me { border-color: rgba(100,140,220,.35); border-bottom: none !important; }

/* Header zone */
.pz-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}
.pz-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  overflow: hidden; border: 1px solid var(--border);
  flex-shrink: 0; background: var(--panel);
}
.pz-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pz-name  { flex: 1; font-size: .75rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pz-life  { font-family: var(--font-title); font-size: 1rem; font-weight: 700; white-space: nowrap; }
.pz-life-btns { display: flex; gap: 2px; }
.pz-life-btn {
  width: 16px; height: 16px; border-radius: 3px; border: 1px solid var(--border);
  background: rgba(255,255,255,.06); color: var(--text); font-size: .7rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-body); transition: background .15s;
}
.pz-life-btn:hover { background: rgba(255,255,255,.15); }

/* Rangées de cartes — couleurs user spec */
.zone-row {
  display: flex;
  align-items: center;
  gap: 3px;
  min-height: 46px;
  border-radius: 4px;
  padding: 4px 4px;
  border-left: 3px solid transparent;
  overflow-x: auto;
  overflow-y: visible;   /* visible pour que les cartes engagées ne soient pas coupées */
  flex-shrink: 0;
  scrollbar-width: none;
}
.zone-row::-webkit-scrollbar         { height: 5px; display: block; }
.zone-row::-webkit-scrollbar-track   { background: rgba(255,255,255,.04); border-radius: 3px; }
.zone-row::-webkit-scrollbar-thumb   { background: rgba(212,175,55,.35); border-radius: 3px; }
.zone-row::-webkit-scrollbar-thumb:hover { background: rgba(212,175,55,.6); }
.zone-row { scrollbar-width: thin; scrollbar-color: rgba(212,175,55,.35) rgba(255,255,255,.04); }

.row-crea { border-left-color: #e05555; background: rgba(224,85,85,.06); min-height: 260px !important; }
.row-art  { min-height: 180px !important; }
.row-sort { min-height: 180px !important; }
.row-land { min-height: 130px !important; }
.row-art  { border-left-color: #9c6fc8; background: rgba(156,111,200,.07); }  /* violet   — art/enc    */
.row-sort { border-left-color: #3b6fb5; background: rgba(59,111,181,.07);  }  /* bleu     — sorts      */
.row-land { border-left-color: #4caf7d; background: rgba(76,175,125,.07);  }  /* vert     — terrains   */

.row-label {
  font-size: .52rem; text-transform: uppercase; letter-spacing: .08em;
  color: rgba(255,255,255,.2); white-space: nowrap; writing-mode: vertical-lr;
  transform: rotate(180deg); flex-shrink: 0; margin-right: 1px;
}

/* Footer zone : stats */
.pz-footer {
  display: flex;
  gap: 4px;
  align-items: center;
  padding-top: 2px;
  border-top: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.pz-stat {
  display: flex; align-items: center; gap: 2px;
  font-size: .65rem; padding: 1px 5px; border-radius: 8px;
}
.stat-gy    { color: #e05555; background: rgba(224,85,85,.1); }
.stat-lib   { color: #888;    background: rgba(136,136,136,.1); }
.stat-exile { color: #d4af37; background: rgba(212,175,55,.1); }
.stat-hand  { color: #aab;    background: rgba(136,136,136,.1); }
.stat-land  { color: var(--green); }
.stat-mana  { display: flex; gap: 2px; align-items: center; }

/* Mana pips mini */
.mana-pip {
  width: 14px; height: 14px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .5rem; font-weight: 700;
  border: 1px solid rgba(255,255,255,.15);
}
.mana-pip.empty { opacity: .2; }
.pip-W { background: #e8e4d0; color: #333; }
.pip-U { background: #1560a8; color: #fff; }
.pip-B { background: #1a0e00; color: #ccc; border-color: rgba(255,255,255,.3); }
.pip-R { background: #c0282f; color: #fff; }
.pip-G { background: #006b3c; color: #fff; }
.pip-C { background: #999;    color: #fff; }

/* ── Cartes dans les rangées ─────────────────────────────────── */
.zone-card {
  width: 38px;
  height: 53px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,.1);
  overflow: hidden;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform .13s, border-color .13s, box-shadow .13s, filter .2s;
  background: var(--panel);
  position: relative;
}
.zone-card:hover {
  transform: translateY(-5px) scale(1.1);
  border-color: var(--gold-dim);
  box-shadow: 0 6px 18px rgba(0,0,0,.7);
  z-index: 10;
}
.zone-card.tapped {
  transform: rotate(90deg);
  margin: 16px 20px;
  filter: brightness(.85);
}
.zone-card.tapped:hover { transform: rotate(90deg) scale(1.07); filter: brightness(1); }

.zone-card.is-commander { border-color: rgba(212,175,55,.5); box-shadow: 0 0 8px rgba(212,175,55,.2); }
.zone-card.sick { filter: brightness(.65); }
.zone-card.sick::after { content:'💤'; position:absolute; bottom:1px; right:1px; font-size:.55rem; }

.zone-card img { width:100%; height:100%; object-fit:cover; border-radius:3px; }
.zone-card-back {
  width:100%; height:100%;
  background: linear-gradient(135deg,#1a1a3e,#0d0d2a);
  border-radius:3px;
  display:flex; align-items:center; justify-content:center;
  font-size:.9rem; color:rgba(212,175,55,.3);
}

/* ── Log ─────────────────────────────────────────────────────── */
/* Journal — layout flex horizontal (tab | contenu) */
.game-log-panel {
  grid-area: log;
  background: rgba(0,0,0,.4);
  display: flex; flex-direction: row; overflow: hidden;
}

/* Onglet vertical permanent */
.log-toggle-tab {
  width: 18px; flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; cursor: pointer;
  background: rgba(0,0,0,.5);
  border-left: 1px solid var(--border);
  border-right: 1px solid rgba(255,255,255,.05);
  transition: background .15s;
  user-select: none;
}
.log-toggle-tab:hover { background: rgba(212,175,55,.12); }
#log-toggle-icon { color: rgba(255,255,255,.4); font-size: .65rem; }
.log-tab-label {
  writing-mode: vertical-rl; transform: rotate(180deg);
  font-size: .5rem; letter-spacing: .12em; text-transform: uppercase;
  color: rgba(255,255,255,.25); white-space: nowrap;
}

/* Contenu journal */
.log-content {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden; transition: flex 0.25s ease;
}
/* Collapsed */
#screen-game.log-collapsed {
  grid-template-columns: 1fr 18px;
}
#screen-game.log-collapsed .log-content {
  flex: 0; overflow: hidden; width: 0;
}
#screen-game.log-collapsed #log-toggle-icon { color: rgba(212,175,55,.7); }

.log-title {
  padding: 5px 8px; font-size: .6rem; text-transform: uppercase;
  letter-spacing: .12em; color: var(--text-dim);
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.log-entries {
  flex:1; overflow-y: auto; padding:5px;
  display:flex; flex-direction:column; gap:2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(212,175,55,.2) transparent;
}
.log-entries::-webkit-scrollbar { width: 4px; display: block; }
.log-entries::-webkit-scrollbar-track { background: transparent; }
.log-entries::-webkit-scrollbar-thumb { background: rgba(212,175,55,.2); border-radius: 2px; }
.log-entry { font-size:.82rem; color:var(--text-dim); line-height:1.45; padding:3px 5px; border-radius:3px; word-break:break-word; }
.log-entry.log-turn { color:var(--gold); font-weight:600; background:rgba(212,175,55,.07); border-radius:4px; margin:2px 0; }

/* ── Main du joueur local — flottante par-dessus le board ─────── */
.my-hand-zone {
  display: none !important; /* cachée par défaut */
  position: fixed;
  bottom: 0;
  left: 0;
  right: 260px; /* largeur du journal */
  z-index: 50;
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 0;
  overflow: visible;
  pointer-events: none; /* clics passent à travers vers le board */
}
.my-hand-zone > * { pointer-events: auto; }
.my-hand-zone.in-game            { display: flex !important; }
.my-hand-zone.in-game.eliminated { opacity: .5; }
.my-hand-zone.hand-drop-hover    { outline: 2px dashed rgba(0,200,200,.7); border-radius: 12px; background: rgba(0,200,200,.06); }

#screen-game.log-collapsed .my-hand-zone { right: 18px; }

.hand-label { display: none; }

/* Conteneur principal : pioche + fan */
.hand-area {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 0 16px 8px;
}

/* Pioche — petit bouton carré à gauche */
.btn-draw {
  width: 52px; height: 72px;
  border-radius: 8px;
  background: rgba(0,0,0,.6);
  border: 1px solid rgba(212,175,55,.3);
  color: var(--gold);
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; flex-shrink: 0;
  transition: background .15s, border-color .15s;
}
.btn-draw:hover { background: rgba(212,175,55,.15); border-color: rgba(212,175,55,.6); }
.btn-draw .draw-icon { font-size: 1.4rem; }
.btn-draw .draw-label { display: none; }

/* Fan wrapper : filtres + cartes empilés */
.hand-fan-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* Filtres — petite ligne très discrète */
.hand-type-tabs {
  display: flex; gap: 2px; align-items: center;
  background: rgba(0,0,0,.4);
  border-radius: 6px;
  padding: 2px 4px;
  backdrop-filter: blur(4px);
}

/* Conteneur cartes en éventail */
.my-hand {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: visible;
}

/* Cartes en main — éventail */
.hand-card {
  width: 115px; height: 161px;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,.18);
  flex-shrink: 0; cursor: pointer;
  background: var(--panel); position: relative;
  transform-origin: bottom center;
  transition: transform .22s cubic-bezier(.2,.8,.4,1), border-color .15s, box-shadow .15s;
  margin-left: -22px;
  overflow: hidden;
  filter: drop-shadow(0 -4px 12px rgba(0,0,0,.6));
}
.hand-card:first-child { margin-left: 0; }

/* Hover : carte qui se lève, rotation reset */
.hand-card:hover {
  transform: translateY(-55px) scale(1.13) rotate(0deg) !important;
  border-color: var(--gold);
  box-shadow: 0 20px 50px rgba(0,0,0,.95), 0 0 24px rgba(212,175,55,.35);
  z-index: 200 !important;
  filter: none;
}

/* Éventail qui s'ouvre — voisines de la carte survolée s'écartent */
.hand-card:has(~ .hand-card:hover) {
  transform: translateX(-32px) !important;
  transition: transform .22s cubic-bezier(.2,.85,.4,1) !important;
}
.hand-card:hover ~ .hand-card {
  transform: translateX(32px) !important;
  transition: transform .22s cubic-bezier(.2,.85,.4,1) !important;
}
/* Carte immédiatement voisine pousse encore plus pour bien ouvrir */
.hand-card:has(+ .hand-card:hover) {
  transform: translateX(-42px) !important;
}
.hand-card:hover + .hand-card {
  transform: translateX(42px) !important;
}
.hand-card.playable { border-color: rgba(0,200,200,.45); }
.hand-card.playable:hover { border-color: rgba(0,220,220,.9); box-shadow: 0 16px 40px rgba(0,0,0,.9), 0 0 20px rgba(0,200,200,.5); }
.hand-card img { width:100%; height:100%; object-fit:cover; border-radius:5px; }
.hand-card-back { width:100%;height:100%;background:linear-gradient(135deg,#1a1a3e,#0d0d2a);border-radius:5px;display:flex;align-items:center;justify-content:center;font-size:1.3rem;color:rgba(212,175,55,.3); }
.play-hint { position:absolute;bottom:0;left:0;right:0;text-align:center;font-size:.5rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:rgba(0,220,220,.9);background:rgba(0,0,0,.75);padding:2px 0;display:none; }
.hand-card.playable:hover .play-hint { display:block; }
.hand-reveal-btn { position:absolute;top:3px;right:3px;background:rgba(0,0,0,.7);border:none;border-radius:4px;color:rgba(255,255,255,.5);font-size:.65rem;padding:1px 4px;cursor:pointer;display:none;line-height:1.4; }
.hand-card:hover .hand-reveal-btn { display:block; }
.hand-reveal-btn:hover { color:#fff;background:rgba(0,0,0,.9); }

/* Carte jouable hors tour (orange) */
.hand-card.off-turn-playable { border-color: rgba(255,140,0,.5); }
.hand-card.off-turn-playable:hover { border-color:rgba(255,140,0,.9);box-shadow:0 16px 40px rgba(0,0,0,.9),0 0 20px rgba(255,140,0,.4); }

/* Log rouge / vert */
.log-entry.log-red   { color:#e05555;font-weight:600; }
.log-entry.log-green { color:#4caf50;font-weight:600; }

/* ── Commander Damage Tracker ────────────────────────────────── */
.cmd-dmg-header { display:flex;gap:4px;align-items:center;flex-wrap:wrap;flex-shrink:0; }
.cmd-dmg-pill { display:flex;align-items:center;gap:2px;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.15);border-radius:6px;padding:2px 5px; }
.cdp-name { font-size:.6rem;color:rgba(255,255,255,.5);min-width:12px;text-align:center; }
.cdp-val  { font-size:.75rem;font-weight:700;min-width:18px;text-align:center; }
.cdp-btn  { background:rgba(255,255,255,.1);border:none;border-radius:3px;color:#fff;font-size:.65rem;width:14px;height:14px;cursor:pointer;line-height:1;padding:0;display:flex;align-items:center;justify-content:center; }
.cdp-btn:hover { background:rgba(212,175,55,.3); }

/* ── Library card locked ─────────────────────────────────────── */
.lib-card-entry.lib-locked { outline:2px solid rgba(255,200,0,.6);border-radius:8px; }

/* ── Emotes ──────────────────────────────────────────────────── */
.emote-btn { background:rgba(255,255,255,.06);border:1px solid rgba(212,175,55,.2);border-radius:10px;padding:8px;cursor:pointer;display:flex;flex-direction:column;align-items:center;gap:6px;transition:.15s; }
.emote-btn:hover { background:rgba(212,175,55,.1);border-color:rgba(212,175,55,.5); }
.emote-btn img { width:80px;height:112px;border-radius:8px;object-fit:cover;object-position:50% 15%;border:2px solid rgba(212,175,55,.3); }
.emote-fallback { width:80px;height:80px;border-radius:50%;background:rgba(212,175,55,.2);border:2px solid rgba(212,175,55,.3);align-items:center;justify-content:center;font-size:2rem;font-weight:700;color:var(--gold); }
.emote-label { font-size:.82rem;color:rgba(255,255,255,.7); }
.emote-bubble { position:fixed;z-index:8000;display:flex;flex-direction:column;align-items:center;gap:4px;pointer-events:none;opacity:0;transform:translateY(20px) scale(0.8);transition:opacity .3s,transform .3s; }
.emote-bubble.emote-pop { opacity:1;transform:translateY(0) scale(1); }
.emote-bubble.emote-fade { opacity:0;transform:translateY(-20px) scale(1.1); }

/* ── Onglets type main ───────────────────────────────────────── */
.hand-type-tabs { display:flex;gap:3px;align-items:center;flex-shrink:0;flex-wrap:wrap; }
.mulligan-tabs  { justify-content:center;margin-bottom:4px; }
.htt { background:rgba(255,255,255,.07);border:1px solid rgba(255,255,255,.12);border-radius:5px;color:rgba(255,255,255,.55);font-size:.62rem;padding:2px 7px;cursor:pointer;transition:.12s;white-space:nowrap; }
.htt:hover { background:rgba(255,255,255,.12);color:#fff; }
.htt.active { background:rgba(212,175,55,.2);border-color:rgba(212,175,55,.5);color:var(--gold); }

/* ── Zoom carte ──────────────────────────────────────────────── */
.card-zoom { position:fixed;pointer-events:none;z-index:19999;width:340px;filter:drop-shadow(0 12px 40px rgba(0,0,0,.95));transition:opacity .1s; }
.card-zoom img { width:100%;border-radius:14px;display:block; }

/* ── Barre de mana ───────────────────────────────────────────── */
.mana-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  border-left: 1px solid rgba(0,200,200,.15);
  flex-shrink: 0;
}

.mana-bar-title {
  font-size: .52rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(0,200,200,.4);
}

.mana-ctrl {
  display: flex;
  align-items: center;
  gap: 3px;
}

.mana-ctrl-sym {
  width: 18px; height: 18px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .6rem; font-weight: 700;
  border: 1px solid rgba(255,255,255,.15);
  flex-shrink: 0;
}
.ms-W { background:#e8e4d0; color:#333; }
.ms-U { background:#1560a8; color:#fff; }
.ms-B { background:#1a0e00; color:#ccc; border-color:rgba(255,255,255,.3); }
.ms-R { background:#c0282f; color:#fff; }
.ms-G { background:#006b3c; color:#fff; }
.ms-C { background:#888;    color:#fff; }

.mana-ctrl-val {
  font-size: .8rem;
  font-weight: 700;
  min-width: 16px;
  text-align: center;
  color: var(--text);
}

.mana-ctrl-btn {
  width: 16px; height: 16px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.06);
  color: var(--text);
  font-size: .75rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-body);
  transition: background .15s;
  padding: 0;
  line-height: 1;
}
.mana-ctrl-btn:hover { background: rgba(255,255,255,.18); }

/* ── Mana dans le header (à gauche des PV) ───────────────────── */
.pz-mana-header {
  display: flex;
  gap: 4px;
  align-items: center;
}

.mana-ctrl {
  display: flex;
  align-items: center;
  gap: 1px;
}

.mana-ctrl-sym {
  width: 15px; height: 15px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .5rem; font-weight: 700;
  border: 1px solid rgba(255,255,255,.15);
  flex-shrink: 0;
  cursor: default;
}
.ms-W { background:#e8e4d0; color:#333; }
.ms-U { background:#1560a8; color:#fff; }
.ms-B { background:#1a0e00; color:#ccc; border-color:rgba(255,255,255,.3); }
.ms-R { background:#c0282f; color:#fff; }
.ms-G { background:#006b3c; color:#fff; }
.ms-C { background:#888;    color:#fff; }

.mana-ctrl-val {
  font-size: .7rem; font-weight: 700;
  min-width: 12px; text-align: center; color: var(--text);
}

.mana-ctrl-btn {
  width: 13px; height: 13px;
  border-radius: 2px; border: 1px solid var(--border);
  background: rgba(255,255,255,.06); color: var(--text);
  font-size: .6rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-body); transition: background .15s; padding: 0; line-height:1;
}
.mana-ctrl-btn:hover { background: rgba(255,255,255,.2); }

/* ── Bouton Undo ─────────────────────────────────────────────── */
.btn-undo {
  width: 20px; height: 20px;
  border-radius: 4px; border: 1px solid var(--border);
  background: rgba(255,255,255,.06); color: var(--text-dim);
  font-size: .8rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s; flex-shrink: 0;
}
.btn-undo:hover { background: rgba(212,175,55,.15); color: var(--gold); border-color: var(--gold-dim); }

/* Tailles adaptées par rangée */
.row-crea .zone-card { width: 100px !important; height: 140px !important; }
.row-art  .zone-card { width: 80px  !important; height: 112px !important; }
.row-sort .zone-card { width: 80px  !important; height: 112px !important; }
.row-land .zone-card { width: 65px  !important; height: 91px  !important; }

.row-crea .zone-card-wrap { gap: 2px; }
.cmd-cage { width: 88px !important; }
.cmd-cage .zone-card { width: 66px !important; height: 92px !important; }

/* Carte cible d'un swap dans la même rangée */
.zone-card.swap-target {
  outline: 2px dashed rgba(91,155,213,.8);
  outline-offset: 2px;
  filter: brightness(1.25);
}

/* Rangée drop target (glisser depuis la main ou le BF) */
.zone-row.row-drop-target {
  background: rgba(212,175,55,.12) !important;
  outline: 2px dashed rgba(212,175,55,.6);
  outline-offset: -2px;
  transition: background .15s;
}

/* ── Zone card avec compteur à droite ────────────────────────── */
.zone-card-with-right {
  display: flex;
  align-items: stretch;
}
.right-counter-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 20px;
  background: rgba(20,20,40,.85);
  border-radius: 0 5px 5px 0;
  border: 1px solid rgba(212,175,55,.2);
  border-left: none;
  padding: 2px 1px;
  opacity: 0;
  transition: opacity .15s;
  pointer-events: none;
  flex-shrink: 0;
}
.zone-card-wrap:hover .right-counter-panel,
.right-counter-panel.rvisible { opacity: 1; pointer-events: auto; }

.right-counter-panel .ctr-btn {
  width: 14px !important; height: 14px !important;
  font-size: .55rem !important;
}
.right-counter-panel .ctr-val {
  font-size: .6rem !important;
  writing-mode: horizontal-tb;
  padding: 0 1px;
}

/* ── Token card (pas d'image) ────────────────────────────────── */
.token-face {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 4px; font-size: .52rem; text-align: center;
  gap: 2px; line-height: 1.3; color: rgba(255,255,255,.9);
  border-radius: 4px;
}
.token-face .token-name { font-weight: 700; font-size: .58rem; }
.token-face .token-pt   { font-size: .65rem; font-weight: 700; color: #fff; background: rgba(0,0,0,.4); border-radius: 3px; padding: 1px 4px; }
.token-face .token-type { font-size: .5rem; color: rgba(255,255,255,.6); }

/* ── Bibliothèque browser ────────────────────────────────────── */
.lib-card-entry {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.lib-card-entry .lib-pos {
  font-size: .6rem; color: var(--text-dim);
  background: rgba(255,255,255,.06); border-radius: 3px;
  padding: 1px 5px; width: 100%; text-align: center;
}
.lib-card-entry img {
  width: 80px; height: 112px; border-radius: 6px;
  border: 1px solid var(--border); object-fit: cover;
  transition: transform .13s;
}
.lib-card-entry img:hover { transform: scale(1.06); }
.lib-card-entry .btn-recover {
  font-size: .62rem; padding: 2px 6px; width: 100%;
}

/* ── Commander cage (dans la rangée CREA, à droite) ─────────── */
.crea-content {
  flex: 1;
  display: flex;
  gap: 3px;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(212,175,55,.25) transparent;
  min-width: 0;
}
.crea-content::-webkit-scrollbar { height: 4px; display: block; }
.crea-content::-webkit-scrollbar-track { background: transparent; }
.crea-content::-webkit-scrollbar-thumb { background: rgba(212,175,55,.25); border-radius: 2px; }

.cmd-cage {
  flex-shrink: 0;
  width: 58px;
  min-height: 42px;
  border-left: 1px solid rgba(212,175,55,.25);
  margin-left: 4px;
  padding-left: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Carte du commander dans la cage */
.cmd-cage .zone-card {
  width: 52px;
  height: 73px;
  border-color: rgba(212,175,55,.5);
  box-shadow: 0 0 12px rgba(212,175,55,.25);
}

.cmd-cast-hint {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.6);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 4px;
  opacity: 0;
  transition: opacity .15s;
  border-radius: 3px;
  font-size: .5rem;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.cmd-cage .zone-card:hover .cmd-cast-hint { opacity: 1; }

/* Commander sur le battlefield — dominant */
.zone-card.is-commander-bf {
  width: 58px !important;
  height: 81px !important;
  border-color: var(--gold) !important;
  box-shadow: 0 0 18px rgba(212,175,55,.5), 0 0 6px rgba(212,175,55,.3) !important;
  z-index: 3;
}
.zone-card.is-commander-bf::before {
  content: '⚔';
  position: absolute;
  top: 2px; left: 3px;
  font-size: .55rem;
  background: rgba(0,0,0,.75);
  border-radius: 3px;
  padding: 1px 3px;
  color: var(--gold);
  z-index: 4;
}

/* Cage vide quand commander est sur le BF */
.cmd-in-play {
  width: 52px; height: 40px;
  border-radius: 4px;
  border: 1px dashed rgba(212,175,55,.25);
  display: flex; align-items: center; justify-content: center;
  font-size: .5rem; color: rgba(212,175,55,.35);
  flex-direction: column; gap: 1px; text-align: center;
  padding: 3px;
}

/* ── Compteurs +1/+1 — wrapper sous la carte ─────────────────── */
.zone-card-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  position: relative;
}

.card-counter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  opacity: 0;
  transition: opacity .15s;
  pointer-events: none;
  height: 18px;
}
.zone-card-wrap:hover .card-counter,
.card-counter.visible { opacity: 1; pointer-events: auto; }

.ctr-btn {
  width: 18px; height: 18px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(40,40,60,.9);
  color: #fff;
  font-size: .85rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0; font-family: var(--font-body); line-height: 1;
  transition: background .1s;
  flex-shrink: 0;
}
.ctr-btn:hover { background: rgba(212,175,55,.4); border-color: var(--gold); }

.ctr-val {
  font-size: .72rem;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
  color: #fff;
  background: rgba(0,0,0,.7);
  border-radius: 3px;
  padding: 0 3px;
}
.ctr-val.positive { color: #4caf7d; }
.ctr-val.negative { color: #e05555; }

/* ── Zones glisser-déposer (cimetière / exil) ────────────────── */
.drop-zone {
  width: 28px; height: 28px;
  border-radius: 5px;
  border: 2px dashed transparent;
  display: flex; align-items: center; justify-content: center;
  font-size: .6rem; font-weight: 700;
  cursor: pointer;
  transition: all .15s;
  flex-shrink: 0;
}
.drop-zone-gy    { background: rgba(180,40,40,.15);  border-color: rgba(180,40,40,.4);  color: #e05555; }
.drop-zone-exile { background: rgba(200,140,0,.15);  border-color: rgba(200,140,0,.4);  color: #d4a017; }
.drop-zone.drag-over { transform: scale(1.15); border-style: solid; }
.drop-zone-gy.drag-over    { background: rgba(180,40,40,.4);  border-color: #e05555; }
.drop-zone-exile.drag-over { background: rgba(200,140,0,.4);  border-color: #d4a017; }

/* ── Modaux GY / Exil ────────────────────────────────────────── */
.zone-modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.85);
  z-index: 4000;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.zone-modal-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 94%; max-width: 1050px;
  max-height: 88vh;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.8);
  overflow: hidden;
}
.zone-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.4rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-title);
  color: var(--gold);
  font-size: 1.05rem;
  flex-shrink: 0;
}
.zone-modal-grid {
  display: flex; flex-wrap: wrap; gap: 12px;
  padding: 1.2rem; overflow-y: auto; flex: 1;
}
.zone-modal-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  cursor: default;
}
.zone-modal-card img {
  width: 115px; height: 161px;
  border-radius: 8px; border: 1px solid var(--border);
  object-fit: cover;
  transition: transform .13s;
}
.zone-modal-card img:hover { transform: scale(1.05); }
.zone-modal-card .btn-recover {
  font-size: .78rem; padding: 3px 10px;
  background: rgba(76,175,125,.15);
  border: 1px solid rgba(76,175,125,.4);
  color: var(--green); border-radius: 4px;
  cursor: pointer; font-family: var(--font-body);
  transition: background .15s;
}
.zone-modal-card .btn-recover:hover { background: rgba(76,175,125,.3); }
.zone-modal-empty { color: var(--text-dim); font-size: .85rem; margin: auto; }

/* ── Notification de tour ────────────────────────────────────── */
.turn-notif {
  position: fixed;
  top: 60px; left: 50%; transform: translateX(-50%);
  z-index: 5000;
  pointer-events: none;
}
.turn-notif.my-turn #turn-notif-text {
  background: linear-gradient(135deg, rgba(30,20,0,.95), rgba(60,40,0,.95));
  border: 2px solid var(--gold);
  color: var(--gold);
  font-family: var(--font-title);
  font-size: 1.3rem;
  letter-spacing: .08em;
  padding: .7rem 2rem;
  box-shadow: 0 0 30px rgba(212,175,55,.5);
}
.turn-notif.other-turn #turn-notif-text {
  background: rgba(20,20,40,.92);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: .9rem;
  padding: .5rem 1.5rem;
}
#turn-notif-text {
  border-radius: 10px;
  text-align: center;
  animation: notif-in .3s ease;
}
@keyframes notif-in {
  from { transform: translateY(-20px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

/* ── Overlay Mulligan ────────────────────────────────────────── */
.mulligan-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5,5,20,.97);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
}
.mulligan-overlay.mulligan-enter {
  animation: mulligan-reveal .65s cubic-bezier(.2,.8,.3,1) both;
}
@keyframes mulligan-reveal {
  from {
    opacity: 0;
    backdrop-filter: blur(0px);
    background: rgba(5,5,20,0);
  }
  30% {
    background: rgba(5,5,20,.97);
    backdrop-filter: blur(6px);
    opacity: 1;
  }
  to {
    opacity: 1;
  }
}
.mulligan-overlay.mulligan-enter .mulligan-box {
  animation: mulligan-box-reveal .55s .1s cubic-bezier(.2,.8,.3,1) both;
}
@keyframes mulligan-box-reveal {
  from { opacity: 0; transform: translateY(28px) scale(.96); }
  to   { opacity: 1; transform: none; }
}

.mulligan-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem;
  max-width: 900px;
  width: 95%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  box-shadow: 0 24px 80px rgba(0,0,0,.85);
}

.mulligan-title {
  font-family: var(--font-title);
  font-size: 1.4rem;
  color: var(--gold);
  letter-spacing: .08em;
}

.mulligan-sub {
  color: var(--text-dim);
  font-size: .85rem;
  text-align: center;
}

.mulligan-hand {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.mulligan-card {
  width: 100px;
  height: 140px;
  border-radius: 8px;
  border: 1px solid var(--border);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg2);
  transition: transform .15s, border-color .15s;
  cursor: default;
}
.mulligan-card:hover {
  transform: translateY(-8px) scale(1.05);
  border-color: var(--gold-dim);
  z-index: 2;
}
.mulligan-card img { width:100%; height:100%; object-fit:cover; border-radius:7px; }
.mulligan-card-back {
  width:100%; height:100%;
  background: linear-gradient(135deg,#1a1a3e,#0d0d2a);
  display:flex; align-items:center; justify-content:center;
  font-size:2rem; color:rgba(212,175,55,.3);
}

.mulligan-actions {
  display: flex;
  gap: 1rem;
}

.mulligan-count {
  font-size: .75rem;
  color: var(--text-dim);
  min-height: 1em;
}

.mulligan-stats {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  justify-content: center;
  padding: .4rem .8rem;
  background: rgba(255,255,255,.04);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.mstat {
  font-size: .78rem;
  display: flex;
  align-items: center;
  gap: .3rem;
  color: var(--text-dim);
}
.mstat-val { font-weight: 700; color: var(--text); }
.mstat-land    { color: var(--green); }
.mstat-crea    { color: #5b9bd5; }
.mstat-art     { color: #9c6fc8; }
.mstat-instant { color: #d4af37; }
.mstat-other   { color: #888; }

/* ── Bouton Vue large + Lexique ──────────────────────────────── */
.btn-board-view {
  width: 20px; height: 20px;
  border-radius: 4px; border: 1px solid var(--border);
  background: rgba(91,155,213,.1); color: #8bbfe8;
  font-size: .75rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s; flex-shrink: 0;
}
.btn-board-view:hover { background: rgba(91,155,213,.25); border-color: #5b9bd5; }

.btn-lexicon-header {
  border: 1px solid rgba(212,175,55,.3);
  background: rgba(212,175,55,.08);
  color: var(--gold);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  letter-spacing: .04em;
  transition: all .15s;
  flex-shrink: 0;
  white-space: nowrap;
}
.btn-lexicon-header:hover { background: rgba(212,175,55,.18); }

/* ── Modal Vue large du board ────────────────────────────────── */
.board-view-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.92);
  z-index: 4500;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(5px);
  padding: 1rem;
}
.board-view-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%; max-width: 1200px;
  max-height: 92vh;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 80px rgba(0,0,0,.9);
  overflow: hidden;
}
.board-view-header {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1.2rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.board-view-title { font-family: var(--font-title); color: var(--gold); font-size: 1.1rem; flex: 1; }
.board-view-tabs  { display: flex; gap: .4rem; }
.board-view-content {
  flex: 1; overflow-y: auto; padding: 1rem;
  display: flex; flex-direction: column; gap: 10px;
}
.bv-row {
  display: flex; gap: 6px; align-items: center;
  min-height: 60px; padding: 4px 8px;
  border-radius: 6px; border-left: 3px solid transparent;
}
.bv-row.bv-crea { border-left-color: #e05555; background: rgba(224,85,85,.05); min-height: 130px; }
.bv-row.bv-art  { border-left-color: #9c6fc8; background: rgba(156,111,200,.05); }
.bv-row.bv-sort { border-left-color: #3b6fb5; background: rgba(59,111,181,.05); }
.bv-row.bv-land { border-left-color: #4caf7d; background: rgba(76,175,125,.05); }
.bv-row.bv-gy   { border-left-color: #e05555; background: rgba(224,85,85,.03); }
.bv-row.bv-exile{ border-left-color: #d4af37; background: rgba(212,175,55,.03); }
.bv-label {
  width: 56px; font-size: .72rem; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-dim); flex-shrink: 0; text-align: right; padding-right: 6px;
}
.bv-cards { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.bv-card  {
  width: 90px; height: 126px; border-radius: 7px;
  border: 1px solid rgba(255,255,255,.1); overflow: hidden;
  background: var(--panel); flex-shrink: 0; cursor: default;
  transition: transform .13s;
}
.bv-card:hover { transform: scale(1.06); z-index: 2; position: relative; }
.bv-card.tapped { transform: rotate(90deg); margin: 14px 14px 14px -14px; }
.bv-card.tapped:hover { transform: rotate(90deg) scale(1.06); }
.bv-card.cmd    { border-color: rgba(212,175,55,.5); box-shadow: 0 0 10px rgba(212,175,55,.25); }
.bv-card img    { width:100%; height:100%; object-fit:cover; border-radius:5px; }
.bv-stats {
  display: flex; gap: 10px; font-size: .88rem; flex-wrap: wrap;
  padding: .5rem 1rem; border-radius: 6px;
  background: rgba(255,255,255,.03); border: 1px solid var(--border);
}
.bv-stat { display: flex; gap: .3rem; align-items: center; color: var(--text-dim); }

/* ── Lexique ─────────────────────────────────────────────────── */
.lexicon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: .75rem;
}
.lexicon-entry {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .75rem;
}
.lexicon-keyword {
  font-weight: 700; font-size: 1rem; color: var(--gold);
  margin-bottom: .35rem; display: flex; align-items: center; gap: .4rem;
}
.lexicon-keyword .lex-icon { font-size: 1.1rem; }
.lexicon-desc { font-size: .88rem; color: var(--text-dim); line-height: 1.6; }

/* ── Échange — bouton plus visible ───────────────────────────── */
.btn-exchange-big {
  display: flex; align-items: center; justify-content: center; gap: .3rem;
  width: 100%; padding: .35rem .5rem;
  background: rgba(212,175,55,.12);
  border: 1px solid rgba(212,175,55,.35);
  color: var(--gold); border-radius: 5px;
  cursor: pointer; font-family: var(--font-body);
  font-size: .68rem; font-weight: 600;
  transition: background .15s; margin-top: 2px;
}
.btn-exchange-big:hover { background: rgba(212,175,55,.28); }

/* ── Bouton Pioche ───────────────────────────────────────────── */
.btn-draw {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 52px;
  min-height: 90px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  color: var(--text-dim);
  cursor: pointer;
  font-family: var(--font-body);
  transition: all .2s;
  flex-shrink: 0;
  padding: 6px 4px;
}
.btn-draw:hover {
  background: rgba(212,175,55,.12);
  border-color: var(--gold-dim);
  color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.4);
}
.draw-icon  { font-size: 1.3rem; }
.draw-label { font-size: .55rem; text-transform: uppercase; letter-spacing: .08em; }

/* ── Deux compteurs (P + T) ──────────────────────────────────── */
.counter-rows {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.counter-row {
  display: flex;
  align-items: center;
  gap: 3px;
}

.counter-row-label {
  font-size: .55rem;
  color: var(--text-dim);
  width: 8px;
  text-align: center;
  flex-shrink: 0;
}

/* ── Modal Interaction joueur ────────────────────────────────── */
.exchange-panel {
  border-top: 1px solid var(--border);
  padding: 1rem;
  background: rgba(0,0,0,.2);
  flex-shrink: 0;
}
.exchange-panel-title { font-family: var(--font-title); color: var(--gold); font-size: .9rem; margin-bottom: .75rem; }
.exchange-panel-body  { display: flex; gap: 1rem; align-items: flex-start; }
.exchange-col         { flex: 1; display: flex; flex-direction: column; gap: .5rem; }
.exchange-col-title   { font-size: .75rem; color: var(--text-dim); }
.exchange-arrow       { font-size: 1.5rem; color: var(--gold); align-self: center; }
.exchange-select {
  background: rgba(0,0,0,.3); border: 1px solid var(--border); color: var(--text);
  border-radius: 5px; padding: .3rem .5rem; font-family: var(--font-body); font-size: .8rem; width: 100%;
}
.exchange-card-list {
  display: flex; flex-wrap: wrap; gap: 4px; max-height: 100px; overflow-y: auto;
}
.exchange-card-option {
  width: 44px; height: 62px; border-radius: 4px; border: 1px solid var(--border);
  overflow: hidden; cursor: pointer; transition: all .13s; flex-shrink: 0;
}
.exchange-card-option img { width:100%; height:100%; object-fit:cover; }
.exchange-card-option.selected { border-color: var(--gold); box-shadow: 0 0 8px rgba(212,175,55,.5); }
.exchange-selected-card { font-size: .75rem; color: var(--text-dim); padding: .4rem; border: 1px dashed var(--border); border-radius: 5px; min-height: 60px; display:flex; align-items:center; justify-content:center; text-align:center; }

/* ── Notification échange ────────────────────────────────────── */
.exchange-notif {
  position: fixed; bottom: 160px; right: 1.5rem;
  z-index: 5000;
  max-width: 340px;
}
.exchange-notif-box {
  background: var(--panel);
  border: 1px solid rgba(212,175,55,.4);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 8px 32px rgba(0,0,0,.7);
  animation: slide-in .3s ease;
}
.exchange-notif-title {
  font-family: var(--font-title);
  color: var(--gold);
  font-size: .9rem;
  margin-bottom: .5rem;
}
.exchange-notif-body {
  font-size: .8rem;
  color: var(--text-dim);
  margin-bottom: .75rem;
  line-height: 1.5;
}
.exchange-notif-actions { display: flex; gap: .5rem; }

/* Zone modal avec exchange panel en bas */
.zone-modal-box {
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}
.zone-modal-grid { flex: 1; }

/* Bouton interagir sur les zones adverses */
.btn-interact {
  font-size: .62rem; padding: 2px 7px;
  background: rgba(91,155,213,.12);
  border: 1px solid rgba(91,155,213,.3);
  color: #8bbfe8; border-radius: 4px;
  cursor: pointer; font-family: var(--font-body);
  transition: background .15s;
}
.btn-interact:hover { background: rgba(91,155,213,.25); }

/* ── Token face dans la main ─────────────────────────────────── */
.hand-token-face {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 6px; gap: 4px; line-height: 1.3;
  color: rgba(255,255,255,.95); border-radius: 5px;
  text-align: center;
}
.hand-token-face .ht-label { font-size: .5rem; opacity:.6; text-transform: uppercase; letter-spacing:.06em; }
.hand-token-face .ht-name  { font-size: .65rem; font-weight: 700; }
.hand-token-face .ht-pt    { font-size: .8rem; font-weight: 700; background: rgba(0,0,0,.4); border-radius: 4px; padding: 2px 6px; }

/* ── Mana opponents (mini pips dans leur footer) ─────────────── */
.opp-mana { display: flex; gap: 2px; align-items: center; flex-wrap: wrap; }
.opp-mana-pip {
  width: 14px; height: 14px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .5rem; font-weight: 700;
  border: 1px solid rgba(255,255,255,.15); flex-shrink: 0;
}

/* ── Log rouge (action bibliothèque) ─────────────────────────── */
.log-entry.log-red {
  color: #e05555;
  font-weight: 600;
  background: rgba(224,85,85,.07);
  border-radius: 4px;
  margin: 2px 0;
  border-left: 2px solid rgba(224,85,85,.4);
  padding-left: 5px;
}

/* ── Modal choix bibliothèque ────────────────────────────────── */
.lib-choice-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  max-width: 620px;
  width: 90%;
  display: flex; flex-direction: column;
  align-items: center; gap: 1.5rem;
  box-shadow: 0 24px 80px rgba(0,0,0,.85);
}

.lib-choice-title {
  font-family: var(--font-title);
  font-size: 1.4rem;
  color: var(--gold);
  letter-spacing: .06em;
}

.lib-choice-sub {
  font-size: .82rem;
  color: var(--text-dim);
  text-align: center;
}

.lib-choice-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  width: 100%;
}

.lib-choice-btn {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem 1rem;
  cursor: pointer;
  display: flex; flex-direction: column;
  align-items: center; gap: .5rem;
  color: var(--text);
  font-family: var(--font-body);
  transition: all .2s;
  text-align: center;
}

.lib-choice-btn:hover {
  border-color: var(--gold);
  background: rgba(212,175,55,.1);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}

.lib-choice-icon  { font-size: 2.5rem; }
.lib-choice-label { font-family: var(--font-title); color: var(--gold); font-size: 1rem; }
.lib-choice-desc  { font-size: .75rem; color: var(--text-dim); line-height: 1.5; }

.lib-scry-row {
  display: flex; align-items: center; gap: .4rem;
  font-size: .8rem; color: var(--text-dim);
  margin-top: .5rem; flex-wrap: wrap; justify-content: center;
}
.lib-scry-row input {
  width: 48px; padding: .2rem .3rem; text-align: center;
  background: rgba(0,0,0,.4); border: 1px solid var(--border);
  color: var(--text); border-radius: 5px; font-size: .85rem;
  font-family: var(--font-body);
}

/* ── SCRY mode library ───────────────────────────────────────── */
.library-mode-bar {
  display: flex; gap: .5rem; padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
  align-items: center; flex-wrap: wrap; flex-shrink: 0;
}
.mode-btn {
  padding: .3rem .9rem; border-radius: 6px; font-size: .78rem;
  font-weight: 600; cursor: pointer; font-family: var(--font-body);
  transition: all .2s; border: 1px solid var(--border);
  background: transparent; color: var(--text-dim);
}
.mode-btn.active { background: rgba(212,175,55,.15); border-color: var(--gold); color: var(--gold); }
.mode-btn:hover:not(.active) { background: rgba(255,255,255,.05); color: var(--text); }

.scry-controls {
  display: flex; align-items: center; gap: .5rem; margin-left: auto;
}
.scry-controls input[type="number"] {
  width: 50px; padding: .25rem .4rem; text-align: center;
  background: rgba(0,0,0,.3); border: 1px solid var(--border);
  color: var(--text); border-radius: 5px; font-size: .82rem;
  font-family: var(--font-body);
}
.scry-controls label { font-size: .75rem; color: var(--text-dim); }

.lib-card-entry { position: relative; transition: transform .15s, opacity .15s; }
.lib-card-entry[draggable="true"] { cursor: grab; }
.lib-card-entry[draggable="true"]:active { cursor: grabbing; }
.lib-card-entry.dragging { opacity: .35; transform: scale(.93); }
.lib-card-entry.drag-over {
  outline: 2px dashed var(--gold);
  outline-offset: 3px;
  background: rgba(212,175,55,.08);
  border-radius: 8px;
  transform: scale(1.04);
}

.scry-validate-btn {
  grid-column: 1 / -1;
  padding: .6rem 1.5rem;
  background: linear-gradient(135deg, rgba(212,175,55,.2), rgba(212,175,55,.1));
  border: 1px solid rgba(212,175,55,.5);
  color: var(--gold);
  border-radius: 8px;
  font-family: var(--font-title);
  font-size: .85rem;
  letter-spacing: .05em;
  cursor: pointer;
  transition: all .2s;
  width: 100%;
}
.scry-validate-btn:hover {
  background: rgba(212,175,55,.3);
  box-shadow: 0 4px 16px rgba(212,175,55,.25);
  transform: translateY(-1px);
}
.lib-scry-btns { display: flex; gap: 3px; width: 100%; }
.lib-scry-btns button { flex: 1; font-size: .6rem; padding: 2px 4px; }
.btn-to-hand   { background: rgba(76,175,125,.15); border: 1px solid rgba(76,175,125,.4); color: var(--green); border-radius:4px; cursor:pointer; font-family:var(--font-body); transition: background .15s; }
.btn-to-bottom { background: rgba(91,155,213,.1);  border: 1px solid rgba(91,155,213,.3);  color: #8bbfe8;     border-radius:4px; cursor:pointer; font-family:var(--font-body); transition: background .15s; }
.btn-to-hand:hover   { background: rgba(76,175,125,.3); }
.btn-to-bottom:hover { background: rgba(91,155,213,.25); }

/* ── Animations UX boutons ───────────────────────────────────── */
.btn-recover, .btn-interact, .btn-exchange-big, .btn-to-hand, .btn-to-bottom,
.zone-modal-card .btn-recover, .lib-card-entry .btn-recover {
  transition: transform .15s, background .15s, box-shadow .15s;
}
.btn-recover:hover    { transform: translateY(-2px); box-shadow: 0 3px 10px rgba(0,0,0,.4); }
.btn-recover:active   { transform: scale(.96); }
.btn-interact:hover   { transform: translateY(-1px); }
.btn-interact:active  { transform: scale(.97); }
.zone-modal-card img:hover { transform: scale(1.05); box-shadow: 0 6px 20px rgba(0,0,0,.6); }

/* ── Token preview box ───────────────────────────────────────── */
.token-preview-box {
  display: flex; align-items: center; justify-content: center;
  padding: .5rem; background: rgba(0,0,0,.2);
  border-radius: 8px; border: 1px solid var(--border);
  min-height: 80px;
}
.token-preview-card {
  width: 60px; height: 84px; border-radius: 6px;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px; padding: 4px;
  font-size: .55rem; text-align: center; color: rgba(255,255,255,.9); line-height: 1.3;
}
.token-preview-card .tp-type { opacity:.6; text-transform:uppercase; font-size:.45rem; letter-spacing:.06em; }
.token-preview-card .tp-name { font-weight:700; font-size:.6rem; }
.token-preview-card .tp-pt   { font-size:.65rem; font-weight:700; background:rgba(0,0,0,.4); border-radius:3px; padding:1px 4px; }

/* ── Spectateur (joueur éliminé) ─────────────────────────────── */
.player-zone.eliminated {
  opacity: .55;
  pointer-events: none;
}
.player-zone.eliminated::after {
  content: '💀 ÉLIMINÉ';
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 700; color: rgba(224,85,85,.6);
  letter-spacing: .15em; pointer-events: none;
}

/* ── Main du joueur local désactivée si éliminé ──────────────── */
.my-hand-zone.eliminated { opacity: .4; pointer-events: none !important; }

/* ── Board verrouillé (spectateur éliminé) ───────────────────── */
/* Spectateur éliminé : hover autorisé (zoom cartes), clics bloqués par sendAction */
.game-board.spectator-locked { cursor: default; }

/* ── Joueur déconnecté — mode fantôme ──────────────────────── */
.player-zone.ghost-player {
  opacity: .55;
  border-color: rgba(200,200,200,.3) !important;
  border-style: dashed !important;
}
.player-zone.ghost-player .fd-header::after {
  content: '⚡ RECONNEXION…';
  font-family: 'Cinzel', serif;
  font-size: .52rem;
  letter-spacing: .12em;
  color: rgba(255,200,50,.7);
  margin-left: auto;
  animation: ghost-blink 1.2s ease-in-out infinite;
}
@keyframes ghost-blink { 0%,100%{opacity:1;} 50%{opacity:.3;} }
.game-board.spectator-locked button,
.game-board.spectator-locked .pz-life-btn,
.game-board.spectator-locked .header-hp-btn { pointer-events: none; }

/* ── Toast erreur ────────────────────────────────────────────── */
#game-error-toast {
  position: fixed; bottom: 150px; left: 50%; transform: translateX(-50%);
  background: rgba(224,85,85,.15); border: 1px solid rgba(224,85,85,.4);
  color: #f0a0a0; border-radius: 8px; padding: 7px 18px;
  font-size: .8rem; z-index: 500; display: none;
}

/* ── Attaque visuelle ─────────────────────────────────────────── */
.attack-target {
  outline: 3px solid rgba(220,50,50,0.85) !important;
  background: rgba(220,50,50,0.08) !important;
  transition: outline 0.1s, background 0.1s;
}
.attack-flash { animation: atk-flash 0.7s ease-out; }
@keyframes atk-flash {
  0%   { box-shadow: inset 0 0 0 4px rgba(220,50,50,0.9); background: rgba(220,50,50,0.18); }
  60%  { box-shadow: inset 0 0 0 6px rgba(220,50,50,0.6); background: rgba(220,50,50,0.10); }
  100% { box-shadow: none; background: transparent; }
}
/* ── Panel volume ─────────────────────────────────────────────── */
.vol-row { display:flex;align-items:center;gap:8px;margin-bottom:8px; }
.vol-lbl { font-size:.68rem;color:rgba(255,255,255,.6);min-width:72px; }
.vol-pct { font-size:.68rem;color:rgba(255,255,255,.4);min-width:28px;text-align:right; }
.vol-slider { flex:1;accent-color:var(--gold);cursor:pointer;height:3px; }

/* ── Compteur poison ─────────────────────────────────────────── */
.pz-poison {
  display: flex; align-items: center; gap: 2px;
  font-size: .62rem; color: rgba(255,255,255,.3);
  flex-shrink: 0;
}
.pz-poison.poison-active { color: #a8d8a8; }
.pz-poison.poison-lethal { color: #e05555; font-weight: 700; animation: pulse-poison .8s infinite; }
@keyframes pulse-poison { 0%,100%{opacity:1} 50%{opacity:.5} }
.poison-btn {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15);
  border-radius: 3px; color: #fff; font-size: .6rem;
  width: 13px; height: 13px; cursor: pointer; line-height: 1; padding: 0;
  display: flex; align-items: center; justify-content: center;
}
.poison-btn:hover { background: rgba(168,216,168,.25); }

/* ── 5 dernières cartes jouées ───────────────────────────────── */
.recent-plays-bar {
  display: flex; gap: 3px; padding: 3px 6px;
  border-top: 1px solid rgba(255,255,255,.05);
  overflow: hidden; flex-shrink: 0;
}
.recent-play-thumb {
  width: 26px; height: 36px; border-radius: 3px; overflow: hidden;
  flex-shrink: 0; background: rgba(255,255,255,.05);
  display: flex; align-items: center; justify-content: center;
  opacity: .85; transition: opacity .15s, transform .15s;
  cursor: pointer;
}
.recent-play-thumb:hover { opacity: 1; transform: scale(1.15); }
.recent-play-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ── Bouton flip carte double face ────────────────────────────── */
.dfc-flip-btn {
  position: absolute;
  top: 50%; right: 3px;
  transform: translateY(-50%);
  z-index: 15;
  background: rgba(0,0,0,.78);
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 50%;
  color: #fff;
  font-size: .72rem;
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: background .15s, transform .15s;
}
.dfc-flip-btn:hover {
  background: rgba(212,175,55,.7);
  transform: rotate(180deg);
}

/* ── Drop sur bouton Pioche ───────────────────────────────────── */
.draw-drop-hover {
  outline: 2px solid var(--gold) !important;
  background: rgba(212,175,55,0.2) !important;
  transform: scale(1.05);
  transition: transform 0.1s;
}

/* ── Emote sonore ─────────────────────────────────────────────── */
.emote-sound-icon {
  width: 60px; height: 60px; border-radius: 8px;
  background: rgba(212,175,55,0.15);
  border: 2px solid rgba(212,175,55,0.4);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
}

/* ── Input montant HP ─────────────────────────────────────────── */
.hp-amount-input {
  width: 34px; height: 22px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  color: #fff; font-size: .75rem; text-align: center;
  padding: 0 2px;
  -moz-appearance: textfield;
}
.hp-amount-input::-webkit-outer-spin-button,
.hp-amount-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ── Sparkline historique PV ─────────────────────────────────── */
.pz-sparkline {
  display: flex; align-items: center;
  opacity: .75; flex-shrink: 0;
  transition: opacity .2s;
  cursor: default;
}
.pz-sparkline:hover { opacity: 1; }

/* ── Badge priorité ──────────────────────────────────────────── */
.pz-priority {
  font-size: .75rem;
  flex-shrink: 0;
  animation: pulse-prio 1.2s ease-in-out infinite;
  filter: drop-shadow(0 0 4px rgba(255,220,50,.8));
}
@keyframes pulse-prio { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.6;transform:scale(.88)} }

/* ── Vue panoramique ─────────────────────────────────────────── */
#pano-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,.88);
  flex-direction: column;
  overflow: auto;
}
.pano-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: .6rem 1.2rem;
  background: rgba(212,175,55,.12);
  border-bottom: 1px solid rgba(212,175,55,.25);
  color: var(--gold); font-weight: 700; font-size: .9rem;
  flex-shrink: 0;
}
.pano-hdr button {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.2);
  color: #fff; border-radius: 6px; padding: 2px 10px; cursor: pointer; font-size: .8rem;
}
.pano-grid {
  display: flex; flex-wrap: wrap; gap: 12px;
  padding: 16px; justify-content: center;
}
.pano-card {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px; padding: 10px;
  min-width: 160px; max-width: 200px; flex: 1;
  display: flex; flex-direction: column; gap: 6px;
  transition: border-color .2s;
}
.pano-card.pano-active {
  border-color: rgba(212,175,55,.6);
  background: rgba(212,175,55,.07);
  box-shadow: 0 0 12px rgba(212,175,55,.2);
}
.pano-card.pano-dead { opacity: .45; border-color: rgba(224,85,85,.3); }
.pano-card-top { display: flex; gap: 8px; align-items: flex-start; }
.pano-cmd {
  width: 38px; height: 52px; border-radius: 4px; object-fit: cover;
  flex-shrink: 0; border: 1px solid rgba(255,255,255,.15);
}
.pano-cmd-ph {
  width: 38px; height: 52px; border-radius: 4px;
  background: rgba(255,255,255,.06); display: flex;
  align-items: center; justify-content: center; font-size: 1.2rem;
  flex-shrink: 0;
}
.pano-card-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pano-name { font-size: .7rem; font-weight: 700; color: rgba(255,255,255,.9); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pano-life { font-size: .9rem; font-weight: 700; }
.pano-cd-row { display: flex; flex-wrap: wrap; gap: 3px; }
.pano-cd { font-size: .6rem; background: rgba(224,85,85,.2); border-radius: 3px; padding: 1px 4px; color: #e09050; }
.pano-stats { display: flex; gap: 8px; font-size: .68rem; color: rgba(255,255,255,.55); flex-wrap: wrap; }
.pano-spark { display: flex; opacity: .8; }
