/* ═══════════════════════════════════════════════════════════════
   MAGIC COMMANDER — Couche atmosphère (immersion.css)
   ═══════════════════════════════════════════════════════════════ */

/* ── Scroll bloqué sur accueil + lobby ──────────────────────── */
html, body { overflow: hidden !important; }

/* ── Compte joueur — badge discret coin supérieur gauche (miroir de
   #live-stats à droite) + popover au clic. Remplace un ancien bloc inline
   en haut du formulaire de connexion, jugé trop imposant pour une
   fonctionnalité optionnelle — voir CLAUDE.md section "Comptes joueurs". */
#account-widget {
  position: fixed;
  top: 12px;
  left: 16px;
  z-index: 200;
  font-family: 'Inter', sans-serif;
  display: flex;
  align-items: center;
  gap: 8px;
}
/* Raccourcis Profil/Stats/Badges/Temps de jeu/Decks — vivent dans le bandeau
   intégré de l'accueil (.join-header-area, index.html), pas à l'intérieur de
   #account-widget : ce dernier est déplacé en JS entre l'accueil (dans le
   bandeau) et les autres écrans (pastille flottante), #home-quick-nav reste
   à sa place dans le bandeau dans les deux cas. */
#home-quick-nav { display: none; align-items: center; gap: 6px; flex-wrap: wrap; }
/* Sélecteur #home-quick-nav .home-quick-nav-item (pas juste .home-quick-nav-item)
   — ces boutons portent aussi .account-menu-item (réutilise son handler de
   navigation, lobby.js) dont les règles (platform.css, chargé après
   immersion.css) l'emporteraient sinon à spécificité égale. */
#home-quick-nav .home-quick-nav-item {
  background: rgba(10, 8, 20, .55);
  border: 1px solid rgba(226, 192, 105, .2);
  border-radius: 20px;
  color: rgba(255, 255, 255, .6);
  font-family: 'Inter', sans-serif;
  font-size: .66rem;
  padding: 5px 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .15s, color .15s, background .15s;
}
#home-quick-nav .home-quick-nav-item:hover {
  border-color: rgba(226, 192, 105, .5);
  color: #e2c069;
  background: rgba(10, 8, 20, .8);
}
/* Masqué pendant une partie — pas d'intérêt en jeu, et prend une place
   visuelle inutile en coin d'écran pendant qu'on joue. */
body:has(#screen-game.active) #account-widget { display: none; }
#account-badge {
  background: rgba(10, 8, 20, .55);
  border: 1px solid rgba(226, 192, 105, .25);
  border-radius: 20px;
  color: rgba(255, 255, 255, .65);
  font-size: .68rem;
  padding: 5px 12px;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
#account-badge:hover {
  border-color: rgba(226, 192, 105, .55);
  color: #e2c069;
  background: rgba(10, 8, 20, .8);
}
#account-popover {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 250px;
  background: rgba(8, 6, 16, .97);
  border: 1px solid rgba(226, 192,105, .3);
  border-radius: 10px;
  padding: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
}
#account-popover.open { display: block; }
#account-popover label {
  display: block;
  font-size: .68rem;
  color: rgba(255, 255, 255, .45);
  letter-spacing: .04em;
  margin-bottom: .5rem;
}
#account-popover input {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: .45rem;
}
/* lobby.css ne stylise que input[type="text"] — le champ mot de passe
   (type="password", absent partout ailleurs sur le site) retombe sinon sur
   le style par défaut du navigateur (fond blanc, texte noir). */
#account-popover input[type="password"] {
  background: rgba(0, 0, 0, .3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: .95rem;
  padding: .65rem .9rem;
  outline: none;
}
#account-popover input[type="password"]:focus {
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 2px rgba(226, 192, 105, .1);
}

/* Auto-remplissage navigateur/gestionnaire de mots de passe : Chrome applique
   son propre fond (jaune/blanc) sur les champs username/password, en
   ignorant le CSS de la page — ce sont les premiers champs de ce type sur
   tout le site (le reste utilise autocomplete="off"), d'où le contraste
   choquant signalé. Astuce classique : box-shadow inset géant à la place du
   background (que le navigateur refuse de laisser overrider) +
   -webkit-text-fill-color pour la couleur du texte. */
#account-popover input:-webkit-autofill,
#account-popover input:-webkit-autofill:hover,
#account-popover input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px rgba(10, 8, 20, .92) inset !important;
  -webkit-text-fill-color: #e8e6f0 !important;
  caret-color: #e8e6f0;
  transition: background-color 5000s ease-in-out 0s;
}

/* ── Lien "Règles du jeu" sous le logo d'accueil ────────────── */
.rules-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 8px 20px;
  border-radius: 30px;
  border: 1px solid rgba(226, 192, 105, .35);
  background: linear-gradient(160deg, rgba(226, 192, 105, .12), rgba(226, 192, 105, .04));
  color: #e2c069;
  font-family: 'Cinzel', serif;
  font-size: .82rem;
  letter-spacing: .02em;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
  box-shadow: 0 2px 14px rgba(0, 0, 0, .3);
}
.rules-link:hover {
  transform: translateY(-2px);
  border-color: rgba(226, 192, 105, .7);
  background: linear-gradient(160deg, rgba(226, 192, 105, .22), rgba(226, 192, 105, .08));
  box-shadow: 0 6px 22px rgba(226, 192, 105, .25);
}
.logo-links { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
/* .rules-link est un <a> par défaut — le bouton "Découvrir des cartes"
   partage la classe (même style) mais doit perdre le reset navigateur des
   <button> (font/curseur) pour rester identique visuellement. */
button.rules-link { cursor: pointer; font: inherit; letter-spacing: .02em; }

/* Badge "nouveau" — pastille sur "🆕 Nouvelles sorties" (accueil), signale
   des previews jamais vues (nrUpdateBadge, lobby.js, comparaison avec un
   timestamp localStorage). position:relative scopé à ce bouton précis, pas
   à .rules-link entier (les autres liens du bandeau n'ont pas de badge). */
#btn-open-new-releases { position: relative; }
.nr-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #e2c069;
  border: 1.5px solid rgba(10, 8, 20, .9);
}

/* ── Scrollbars globales — DA sombre/dorée ──────────────────── */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(226,192,105,.25) transparent;
}
::-webkit-scrollbar              { width: 5px; height: 5px; }
::-webkit-scrollbar-track        { background: transparent; }
::-webkit-scrollbar-thumb        { background: rgba(226,192,105,.2); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover  { background: rgba(226,192,105,.45); }
::-webkit-scrollbar-corner       { background: transparent; }

/* ── Supprimer les transitions de layout sur #screen-game ──────
   La transition grid-template-columns (game.css l.14) cause un
   "jump" visuel quand le board se rebuild. On la neutralise.    */
#screen-game { transition: none !important; }
.log-content { transition: none !important; }
/* align-items:flex-start (pas center, lobby.css) — sans ça, un .join-wrapper
   plus haut que le viewport (fréquent depuis l'ajout du bandeau intégré) se
   centre verticalement et déborde À MOITIÉ AU-DESSUS de y:0, une zone que
   overflow-y:auto ne permet pas de faire défiler jusqu'à : le bandeau (tout
   en haut du wrapper) devient invisible et inatteignable au scroll. */
#screen-join  { overflow-y: auto !important; max-height: 100vh !important; align-items: flex-start !important; }
#screen-lobby { overflow-y: auto !important; max-height: 100vh !important; }

/* ── Lobby ban-list : 3ème colonne ──────────────────────────── */
/* min-width:769px (pas juste "desktop") : sous ce seuil, on laisse le repli
   mobile de lobby.css (grid-template-columns:1fr, colonnes empilées) reprendre
   la main — sans ce garde-fou le !important s'appliquait aussi en mobile et
   écrasait ce repli, rendant la colonne joueurs inatteignable (hors écran). */
@media (min-width: 769px) {
  #screen-lobby .lobby-layout {
    grid-template-columns: 1fr 1.6fr 160px !important;
  }
}

.lobby-ban-col {
  display: flex;
  flex-direction: column;
  gap: 0;
  /* Hauteur synchronisée en JS (syncLobbyBanHeight, lobby.js) sur la hauteur
     réelle de .lobby-right (panneau deck) — la liste s'étire exactement à
     la même hauteur que la colonne centrale sans jamais la dépasser.
     400px = valeur de secours tant que le JS n'a pas encore mesuré. */
  height: 400px;
}

.lobby-ban-header {
  font-family: 'Cinzel', serif;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: rgba(226,192,105,.7);
  background: rgba(200,50,50,.12);
  border: 1px solid rgba(200,50,50,.3);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  padding: 6px 10px;
  text-align: center;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.lobby-ban-copy-btn {
  background: rgba(226,192,105,.12);
  border: 1px solid rgba(226,192,105,.3);
  border-radius: 4px;
  color: #e2c069;
  font-size: .68rem;
  line-height: 1;
  padding: 2px 5px;
  cursor: pointer;
  flex-shrink: 0;
}
.lobby-ban-copy-btn:hover { background: rgba(226,192,105,.22); }

/* ── Drag-and-drop des decks sauvegardés (#my-decks-list) ────── */
#my-decks-list > div.deck-row-dragging { opacity: .4; }
#my-decks-list > div.deck-row-drag-over {
  border-color: rgba(226,192,105,.6) !important;
  background: rgba(226,192,105,.08) !important;
}

.lobby-ban-ticker-wrap {
  flex: 1;
  min-height: 0;                 /* laisse flex/grid capper la hauteur — sinon le contenu (liste dupliquée) force la colonne entière à s'étirer sur toute la page */
  overflow: hidden;
  border: 1px solid rgba(200,50,50,.25);
  border-radius: 0 0 8px 8px;
  background: rgba(8,5,18,.6);
  position: relative;
}

.lobby-ban-ticker-wrap::before,
.lobby-ban-ticker-wrap::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 28px;
  z-index: 2;
  pointer-events: none;
}
.lobby-ban-ticker-wrap::before {
  top: 0;
  background: linear-gradient(to bottom, rgba(8,5,18,.9), transparent);
}
.lobby-ban-ticker-wrap::after {
  bottom: 0;
  background: linear-gradient(to top, rgba(8,5,18,.9), transparent);
}

.lobby-ban-ticker {
  display: flex;
  flex-direction: column;
  gap: 0;
  animation: banTickerScroll 60s linear infinite;
}
.lobby-ban-ticker:hover { animation-play-state: paused; }

@keyframes banTickerScroll {
  0%   { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}

.lobby-ban-entry {
  font-size: .64rem;
  color: rgba(255,160,160,.75);
  padding: 5px 10px;
  border-bottom: 1px solid rgba(200,50,50,.1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lobby-ban-entry::before {
  content: '🚫 ';
  font-size: .6rem;
  opacity: .7;
}

/* ═══ JOIN SCREEN — Layout 4 colonnes ══════════════════════════ */
.join-wrapper {
  display: grid;
  grid-template-columns: 220px 320px minmax(420px, 640px);
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "logo   logo  logo"
    "board  left  right";
  gap: 1.5rem 1.6rem;
  align-items: start;
  /* justify-content:center — les colonnes ont des largeurs fixes (px, pas
     fr) dont la somme + gaps (~1267px) n'atteint jamais max-width (1310px) :
     sans ce centrage, la grille reste collée au bord gauche de .join-wrapper
     (défaut "start") et le logo (grid-area "logo", text-align:center) se
     retrouve visuellement décalé d'une vingtaine de px à gauche du vrai
     centre de la page — décalage repéré en essayant d'aligner le bandeau
     intégré (.join-header-area) dessus. */
  justify-content: center;
  width: 100%;
  max-width: 1500px;
  padding: 2rem 0;
}

.join-logo { grid-area: logo; }
.join-left  { grid-area: left; }
.join-right { grid-area: right; }
.join-board { grid-area: board; }
.join-ban-col { grid-area: ban; }
.join-copyright-col { grid-area: copyright; }
.join-fdp-col { grid-area: fdp; }
/* Titres des 3 colonnes à hauteur égale (un titre sur 2 lignes décalait le
   bas de son cadre par rapport aux voisins) — contenu centré verticalement. */
.join-ban-header,
.join-copyright-header,
.join-fdp-header {
  box-sizing: border-box;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* 6 colonnes (~1480px) : sur un écran plus étroit (portable 1366px), on
   resserre colonnes et écarts plutôt que de faire déborder la page. */
@media (max-width: 1520px) and (min-width: 1081px) {
  .join-wrapper {
    grid-template-columns: 200px 290px minmax(380px, 520px);
    column-gap: 1rem;
  }}

/* ── Bandeau intégré (option retenue parmi 3 maquettes proposées) — un
   vrai header plein viewport, pas une carte insérée dans la grille de
   contenu (première tentative, jugée pas assez "header" par l'utilisateur).
   position:fixed échappe à .join-wrapper/#screen-join quel que soit
   l'endroit où le markup vit dans le DOM (overflow:auto sur un ancêtre ne
   crée pas de containing block pour fixed, vérifié) — pas besoin de le
   sortir de .join-wrapper dans le HTML. Remplace le badge compte flottant +
   les raccourcis quand on est sur l'accueil ; #account-widget est déplacé
   ici en JS (showScreen, lobby.js) et redevient une pastille flottante coin
   supérieur gauche sur les autres écrans (compte requis) — un seul élément,
   jamais dupliqué. #screen-join compense sa hauteur par un padding-top
   dédié (ci-dessous), sinon il recouvrirait le haut de .join-wrapper. */
.join-header-area {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  min-height: 68px;
  padding: .6rem 1.8rem;
  background: rgba(11, 9, 24, .8);
  border-bottom: 1px solid rgba(226, 192, 105, .18);
  backdrop-filter: blur(6px);
}
/* Compte en premier dans le bandeau (demandé — le nom du site est déjà
   affiché en grand au centre de l'écran, pas besoin de le répéter ici) — le
   popover garde son ouverture par défaut vers la droite (left:0), le badge
   étant de nouveau contre le bord gauche du viewport. */
#account-widget.inline-mode { position: relative; top: auto; left: auto; }
/* "Onglets soulignés XL" (retouche après retour "trop petit, on dirait qu'il
   faut sniper le bouton" sur la première version) — texte et hitbox
   nettement agrandis, tout le padding autour du mot réagit au survol (pas
   seulement le trait du bas). Volontairement limité à 3 raccourcis
   (Profil/Mes decks/Temps de jeu) — Stats/Badges/Paramètres restent dans le
   popover complet, pas dupliqués ici. */
/* Centrage en grille 3 colonnes (pas flex + translate(-50%)) — "Profil" et
   "Temps de jeu" n'ont pas la même largeur, donc centrer le BLOC entier
   (ancienne approche) décale l'item du milieu ("Mes decks") par rapport au
   vrai centre du viewport, qui doit matcher le logo ⚔ centré juste en
   dessous. Les colonnes 1fr (vides d'items, juste des ancres d'alignement)
   absorbent la différence de largeur des deux côtés, donc la colonne du
   milieu reste toujours au centre exact quel que soit le texte des boutons
   voisins. left:0/right:0 sur .join-header-area (position:fixed) = pleine
   largeur du viewport, donc "au centre de la grille" = "au centre du
   viewport" = centre du logo. */
/* .is-visible (classList, lobby.js) au lieu d'un style.display inline : un
   inline style fige une seule valeur de display et écraserait aussi bien ce
   display:grid que le display:flex de la media query mobile ci-dessous —
   voir renderAccountState() (lobby.js) pour l'historique du bug. */
#home-quick-nav.is-visible {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 3rem;
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}
#home-quick-nav.is-visible .home-quick-nav-item:first-child { justify-self: end; }
#home-quick-nav.is-visible .home-quick-nav-item:last-child { justify-self: start; }
#home-quick-nav .home-quick-nav-item {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 8px;
  padding: .5rem 1rem;
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .55);
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
#home-quick-nav .home-quick-nav-item:hover { color: #e2c069; border-color: #e2c069; background: rgba(226, 192, 105, .07); }
/* live-stats (coin sup. droit) doit rester lisible au-dessus du bandeau,
   sinon son fond translucide + flou le ternit — pointer-events:none dessus
   de toute façon, jamais de conflit de clic. */
#live-stats { z-index: 600; }
/* Compense la hauteur du bandeau fixed (~68px) — sinon il recouvre le haut
   de .join-wrapper. Le padding existant de #screen-join (2rem, lobby.css)
   reste, celui-ci s'y ajoute. */
#screen-join { padding-top: calc(2rem + 68px) !important; }
@media (max-width: 900px) {
  .join-header-area { flex-wrap: wrap; row-gap: .6rem; }
  /* Le centrage absolu (ci-dessus) sort la nav du flux — sur un bandeau qui
     wrap en plusieurs lignes, il faut la remettre dans le flux normal pour
     qu'elle prenne sa propre ligne comme le reste plutôt que de flotter
     par-dessus le badge compte / live-stats. */
  #home-quick-nav.is-visible { display: flex; position: static; transform: none; margin: 0; gap: 1.4rem; flex-basis: 100%; justify-content: center; }
  #home-quick-nav.is-visible .home-quick-nav-item:first-child, #home-quick-nav.is-visible .home-quick-nav-item:last-child { justify-self: auto; }
  /* #account-popover (position:absolute, pas de réservation d'espace dans le
     flux) recouvre .logo-block juste en dessous dès qu'il s'ouvre — visible
     surtout ici où le bandeau wrap déjà. On réserve la place uniquement
     pendant l'ouverture (:has), sans toucher au flux le reste du temps ; la
     marge couvre la variante déconnectée (~175px) et connectée (~291px,
     jusqu'à 6 raccourcis + déconnexion) avec une marge de sécurité. */
  .join-header-area:has(#account-popover.open) ~ .logo-block { margin-top: 210px; }
}

.join-right {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ── Ban list colonne ────────────────────────────────────────── */
.join-ban-col {
  display: flex;
  flex-direction: column;
  align-self: stretch;
}

/* ── Select pseudo (menu déroulant prénoms) ──────────────────── */
.name-preset-select {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(226,192,105,.28);
  border-radius: 8px;
  color: #ece3d0;
  padding: 10px 12px;
  font-family: 'Inter', sans-serif;
  font-size: .92rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='%23e2c069' stroke-width='1.6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.name-preset-select:focus {
  outline: none;
  border-color: rgba(226,192,105,.6);
  box-shadow: 0 0 0 2px rgba(226,192,105,.15);
}
.name-preset-select option { background: #14101f; color: #ece3d0; }

/* Menu déroulant pseudo du panel admin classement (index.html) — même
   thème sombre que .name-preset-select ci-dessus pour la liste déroulante ;
   le bouton fermé garde son style inline compact existant (fond/couleur/
   taille déjà posés dans index.html), seule la LISTE OUVERTE (élément
   <option>, non stylable via l'attribut style="" du <select>) a besoin
   de cette règle dédiée. */
#board-admin-name-preset option { background: #14101f; color: #ece3d0; }

/* ── Classement des victoires (colonne accueil) ──────────────── */
.join-board {
  display: flex;
  flex-direction: column;
}
.join-board-header {
  font-family: 'Cinzel', serif;
  font-size: .63rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: rgba(226,192,105,.85);
  background: rgba(226,192,105,.12);
  border: 1px solid rgba(226,192,105,.3);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  padding: 7px 10px;
  text-align: center;
  flex-shrink: 0;
}
.join-board-tables {
  overflow-y: auto;
  border: 1px solid rgba(226,192,105,.22);
  border-radius: 0 0 6px 6px;
  background: rgba(6,4,14,.65);
  max-height: calc(100vh - 160px);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.board-table {
  background: rgba(226,192,105,.04);
  border: 1px solid rgba(226,192,105,.14);
  border-radius: 8px;
  padding: 7px 8px 8px;
}
.board-table-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: .62rem;
  letter-spacing: .08em;
  color: rgba(226,192,105,.7);
  text-align: center;
  padding-bottom: 6px;
  margin-bottom: 5px;
  border-bottom: 1px solid rgba(226,192,105,.12);
}
.board-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 2px;
  font-size: .76rem;
}
.board-row + .board-row { border-top: 1px solid rgba(255,255,255,.04); }
.board-rank { width: 20px; text-align: center; flex-shrink: 0; font-size: .8rem; }
.board-name {
  flex: 1;
  color: #e6ddca;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.board-name-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.board-name-link:hover,
.board-name-link:focus-visible {
  color: #e2c069;
  text-decoration: underline;
}
.board-wins {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: #e2c069;
  flex-shrink: 0;
}
.board-winrate {
  font-weight: 400;
  color: rgba(226,192,105,.55);
  font-size: .85em;
}
.board-row-first .board-name { color: #fff; font-weight: 600; }
.board-empty {
  font-size: .68rem;
  color: rgba(255,255,255,.3);
  text-align: center;
  padding: 8px 4px;
  font-style: italic;
}

.join-ban-header {
  font-family: 'Cinzel', serif;
  font-size: .63rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: rgba(226,192,105,.75);
  background: rgba(160,30,30,.18);
  border: 1px solid rgba(200,50,50,.35);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  padding: 7px 10px;
  text-align: center;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.join-ban-ticker-wrap {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(200,50,50,.28);
  border-radius: 0 0 6px 6px;
  background: rgba(6,4,14,.65);
  position: relative;
  /* La hauteur s'étire pour remplir la colonne */
  height: calc(100vh - 240px);
  max-height: 680px;
}

.join-ban-ticker-wrap::before,
.join-ban-ticker-wrap::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 36px;
  z-index: 2;
  pointer-events: none;
}
.join-ban-ticker-wrap::before {
  top: 0;
  background: linear-gradient(to bottom, rgba(6,4,14,.95), transparent);
}
.join-ban-ticker-wrap::after {
  bottom: 0;
  background: linear-gradient(to top, rgba(6,4,14,.95), transparent);
}

.join-ban-ticker {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  animation: joinBanScroll 80s linear infinite;
}
.join-ban-ticker:hover { animation-play-state: paused; }

@keyframes joinBanScroll {
  0%   { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}

.join-ban-entry {
  display: block;
  font-size: .68rem;
  color: rgba(255,150,150,.7);
  text-decoration: none;
  cursor: pointer;
  padding: 5px 12px;
  border-bottom: 1px solid rgba(180,30,30,.12);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
  transition: color .15s;
}
.join-ban-entry:hover { color: rgba(255,180,180,.95); }
.join-ban-entry::before {
  content: '🚫 ';
  font-size: .62rem;
  opacity: .55;
}

/* ── Copyright colonne — miroir de la colonne ban ci-dessus, teinte dorée
   neutre (pas rouge, ce n'est pas un avertissement) ────────────────────── */
.join-copyright-col {
  display: flex;
  flex-direction: column;
  align-self: stretch;
}

.join-copyright-header {
  font-family: 'Cinzel', serif;
  font-size: .63rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: rgba(226,192,105,.85);
  background: rgba(226,192,105,.12);
  border: 1px solid rgba(226,192,105,.35);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  padding: 7px 10px;
  text-align: center;
  flex-shrink: 0;
}

.join-copyright-ticker-wrap {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(226,192,105,.28);
  border-radius: 0 0 6px 6px;
  background: rgba(6,4,14,.65);
  position: relative;
  height: calc(100vh - 240px);
  max-height: 680px;
}

.join-copyright-ticker-wrap::before,
.join-copyright-ticker-wrap::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 36px;
  z-index: 2;
  pointer-events: none;
}
.join-copyright-ticker-wrap::before {
  top: 0;
  background: linear-gradient(to bottom, rgba(6,4,14,.95), transparent);
}
.join-copyright-ticker-wrap::after {
  bottom: 0;
  background: linear-gradient(to top, rgba(6,4,14,.95), transparent);
}

.join-copyright-ticker {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  animation: joinBanScroll 80s linear infinite;
}
.join-copyright-ticker:hover { animation-play-state: paused; }

.join-copyright-player {
  font-size: .68rem;
  font-weight: 700;
  color: #e2c069;
  padding: 8px 12px 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.join-copyright-entry {
  display: block;
  font-size: .68rem;
  color: rgba(226,224,216,.75);
  text-decoration: none;
  cursor: pointer;
  padding: 3px 12px 3px 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
  transition: color .15s;
}
.join-copyright-entry:hover { color: rgba(226,224,216,1); }
.join-copyright-entry::before {
  content: '© ';
  font-size: .62rem;
  opacity: .55;
}

/* ── Commandants de fdp — même structure que la colonne Copyright, teinte
   rouge (c'est un avertissement, comme la colonne ban) ──────────────────── */
.join-fdp-col {
  display: flex;
  flex-direction: column;
  align-self: stretch;
}
.join-fdp-header {
  font-family: 'Cinzel', serif;
  font-size: .63rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: #ff8888;
  background: rgba(160,30,30,.22);
  border: 1px solid rgba(224,85,85,.45);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  padding: 7px 10px;
  text-align: center;
  flex-shrink: 0;
}
.join-fdp-ticker-wrap {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(224,85,85,.32);
  border-radius: 0 0 6px 6px;
  background: rgba(6,4,14,.65);
  position: relative;
  height: calc(100vh - 240px);
  max-height: 680px;
}
.join-fdp-ticker-wrap::before,
.join-fdp-ticker-wrap::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 36px;
  z-index: 2;
  pointer-events: none;
}
.join-fdp-ticker-wrap::before { top: 0; background: linear-gradient(to bottom, rgba(6,4,14,.95), transparent); }
.join-fdp-ticker-wrap::after { bottom: 0; background: linear-gradient(to top, rgba(6,4,14,.95), transparent); }
.join-fdp-ticker {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  animation: joinBanScroll 40s linear infinite;
}
.join-fdp-ticker:hover { animation-play-state: paused; }
.join-fdp-entry {
  display: block;
  font-size: .68rem;
  color: rgba(255,170,170,.85);
  text-decoration: none;
  cursor: pointer;
  padding: 3px 12px 3px 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
  transition: color .15s;
}
.join-fdp-entry:hover { color: #ffd0d0; }
.join-fdp-entry::before { content: '☠ '; font-size: .62rem; opacity: .6; }

/* Panel générique (mes parties + parties en cours) */
.games-panel {
  background: var(--panel, rgba(255,255,255,.04));
  border: 1px solid var(--border, rgba(255,255,255,.1));
  border-radius: 12px;
  padding: 1rem 1.2rem;
}

.games-panel-title {
  font-size: .65rem;
  font-weight: 700;
  color: rgba(255,255,255,.35);
  text-transform: uppercase;
  letter-spacing: .12em;
  margin-bottom: .8rem;
  padding-bottom: .55rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

/* Pastilles couleur de l'écran "Découvrir des cartes" (#screen-card-discovery,
   platform.css) — sous un nom de classe distinct de .de-color-toggle
   (éditeur de deck, platform.css) : ce dernier est câblé globalement en JS
   sur tout le document (deckEditor.js), donc réutiliser sa classe aurait
   fait piloter ces pastilles-ci par l'état de recherche de l'éditeur. */
.rc-color-toggle-group { display: flex; gap: .5rem; }
.rc-color-toggle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .18);
  cursor: pointer;
  opacity: .55;
  transition: opacity .12s, border-color .12s, box-shadow .12s, transform .12s;
}
.rc-color-toggle:hover { opacity: .85; transform: scale(1.08); }
.rc-color-toggle.active { opacity: 1; border-color: #e2c069; box-shadow: 0 0 8px rgba(226, 192, 105, .6); }
/* Optionnelle (2e clic) : la couleur PEUT être présente sans y être obligée
   — contour pointillé plutôt qu'un halo plein, même code visuel que
   .de-color-toggle.de-color-optional (éditeur de deck, platform.css). */
.rc-color-toggle.rc-color-optional { opacity: 1; border-style: dashed; border-color: #e2c069; box-shadow: 0 0 4px rgba(226, 192, 105, .35); }
.rc-color-toggle.rc-color-W { background: var(--mtg-W-deep, #c9b97f); }
.rc-color-toggle.rc-color-U { background: var(--mtg-U-deep, #1f4a8f); }
.rc-color-toggle.rc-color-B { background: #241f2c; border-color: rgba(255, 255, 255, .28); }
.rc-color-toggle.rc-color-R { background: var(--mtg-R-deep, #8a2a1c); }
.rc-color-toggle.rc-color-G { background: var(--mtg-G-deep, #2f6938); }
.rc-color-toggle.rc-color-C { background: #5c5c68; }

.games-empty {
  text-align: center;
  color: rgba(255,255,255,.2);
  font-size: .74rem;
  padding: .4rem 0 .2rem;
  font-style: italic;
}

/* ── Carte reconnexion (dans le panel Mes parties) ────────────── */
#rejoin-banner {
  background: rgba(226,192,105,.08);
  border: 1px solid rgba(226,192,105,.3);
  border-radius: 8px;
  padding: .75rem 1rem;
}

.rejoin-card-label {
  font-family: 'Cinzel', serif;
  font-size: .78rem;
  font-weight: 700;
  color: var(--gold, #e2c069);
  margin-bottom: .35rem;
}

.rejoin-card-info {
  font-size: .7rem;
  color: rgba(255,255,255,.5);
  margin-bottom: .65rem;
}

.rejoin-card-actions {
  display: flex;
  gap: 8px;
}

.rejoin-btn-join {
  background: rgba(226,192,105,.25);
  border: 1px solid rgba(226,192,105,.5);
  color: #e2c069;
  border-radius: 7px;
  padding: 5px 14px;
  font-weight: 700;
  cursor: pointer;
  font-size: .76rem;
  transition: background .15s;
}
.rejoin-btn-join:hover { background: rgba(226,192,105,.4); }

.rejoin-btn-ignore {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.15);
  color: rgba(255,255,255,.4);
  border-radius: 7px;
  padding: 5px 11px;
  cursor: pointer;
  font-size: .76rem;
  transition: background .15s;
}
.rejoin-btn-ignore:hover { background: rgba(255,255,255,.1); color: rgba(255,255,255,.65); }

/* Responsive : une colonne en dessous de 1080px (colonnes ne rentrent plus) */
@media (max-width: 1080px) {
  .join-wrapper {
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "logo"
      "left"
      "right"
      "board"
      "ban"
      "copyright"
      "fdp";
    max-width: 420px;
  }
  .join-right   { padding-top: 0; }
  .join-board-tables,
  .join-ban-ticker-wrap,
  .join-copyright-ticker-wrap,
  .join-fdp-ticker-wrap { height: auto; max-height: 320px; }
}

/* ── Embers — derrière l'UI lobby/accueil, visibles en game ─── */
body > .embers-layer {
  position: fixed !important;
  inset: 0 !important;
  z-index: 0 !important;
  pointer-events: none !important;
  overflow: hidden !important;
}
#screen-join.active,
#screen-lobby.active { position: relative !important; z-index: 1 !important; }

#screen-game > .embers-layer {
  position: absolute !important;
  inset: 0 !important;
  z-index: 1 !important;
  pointer-events: none !important;
  overflow: hidden !important;
}
.ember {
  position: absolute !important;
  bottom: -10px !important;
  width: 1.5px !important;
  height: 1.5px !important;
  border-radius: 50% !important;
  background: #e2c069 !important;
  box-shadow: 0 0 3px 1px rgba(226,192,105,.55) !important;
  filter: blur(.3px) !important;
  animation: arcanum-ember-rise var(--d,12s) var(--delay,0s) infinite ease-in !important;
}


/* ═══ Sélecteur du nombre de faces (dé) ═══════════════════════════ */
.dice-face-panel {
  position: absolute;
  top: 110%;
  left: 0;
  background: #1a1a2e;
  border: 1px solid rgba(226, 192, 105, .3);
  border-radius: 10px;
  padding: 10px;
  z-index: 4000;
  min-width: 190px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .7);
}
.dice-face-panel-title {
  font-size: .68rem;
  color: rgba(255, 255, 255, .5);
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: .04em;
}
.dice-face-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.dice-face-grid button {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(226, 192, 105, .25);
  border-radius: 6px;
  color: #e2e0d8;
  font-family: 'Cinzel', serif;
  font-size: .8rem;
  padding: .4rem 0;
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.dice-face-grid button:hover { background: rgba(226, 192, 105, .15); border-color: rgba(226, 192, 105, .5); }
.dice-face-grid button.active { background: rgba(226, 192, 105, .22); border-color: #e2c069; color: #e2c069; }

.dice-count-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(226, 192, 105, .15);
}
.dice-count-stepper { display: flex; align-items: center; gap: 6px; }
.dice-count-stepper button {
  width: 22px;
  height: 22px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(226, 192, 105, .25);
  border-radius: 5px;
  color: #e2c069;
  font-weight: 700;
  font-size: .85rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.dice-count-stepper button:hover { background: rgba(226, 192, 105, .15); border-color: rgba(226, 192, 105, .5); }
#dice-count-val {
  min-width: 20px;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: .78rem;
  font-weight: 700;
  color: #e2e0d8;
}

/* ═══ D20 — Animation cinématique ═══════════════════════════════ */
#dice-overlay {
  position: fixed; inset: 0; z-index: 9500;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.78);
  backdrop-filter: blur(6px);
  animation: dice-overlay-in .3s ease-out;
  cursor: pointer;
}
@keyframes dice-overlay-in { from{opacity:0} to{opacity:1} }

.dice-box {
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  background: linear-gradient(160deg, #120c28 0%, #07040f 100%);
  border: 1px solid rgba(226,192,105,.3);
  border-radius: 20px;
  padding: 36px 56px 28px;
  min-width: 320px;
  box-shadow:
    0 0 80px rgba(90,40,200,.25),
    0 32px 80px rgba(0,0,0,.9),
    inset 0 1px 0 rgba(255,255,255,.05);
}

/* Header */
.dice-header { text-align: center; }
.dice-subtitle {
  font-family: 'Cinzel', serif; font-size: .55rem; font-weight: 700;
  letter-spacing: .35em; color: rgba(226,192,105,.55);
  text-transform: uppercase; margin-bottom: 5px;
}
.dice-who {
  font-family: 'Cinzel', serif; font-size: .82rem;
  letter-spacing: .1em; color: rgba(255,255,255,.65);
  text-transform: uppercase;
}

/* Stage */
.dice-stage {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 200px; height: 200px;
}

/* ── Le Gem D20 ── */
.dice-gem {
  position: relative; width: 170px; height: 170px;
  display: flex; align-items: center; justify-content: center;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,.8)) drop-shadow(0 0 28px rgba(100,50,220,.5));
}

/* Corps principal — hexagone avec gradient 3D */
.dgem-bg {
  position: absolute; inset: 0;
  clip-path: polygon(50% 0%, 97% 26%, 97% 74%, 50% 100%, 3% 74%, 3% 26%);
  background: linear-gradient(160deg, #7848e8 0%, #3a1e9c 45%, #0e0428 100%);
  box-shadow:
    inset 0 -30px 50px rgba(0,0,0,.6),
    inset 0 12px 30px rgba(180,130,255,.2);
}
/* Reflet lumineux (coin haut-gauche) */
.dgem-shine {
  position: absolute; inset: 0; pointer-events: none;
  clip-path: polygon(50% 0%, 97% 26%, 97% 74%, 50% 100%, 3% 74%, 3% 26%);
  background: linear-gradient(128deg, rgba(255,255,255,.22) 0%, transparent 42%);
}
/* Bord doré */
.dgem-edge {
  position: absolute; inset: -3px; pointer-events: none;
  clip-path: polygon(50% 0%, 97% 26%, 97% 74%, 50% 100%, 3% 74%, 3% 26%);
  background: transparent;
  border: 2px solid rgba(226,192,105,.55);
  filter: drop-shadow(0 0 6px rgba(226,192,105,.7));
}
/* Numéro affiché */
.dgem-num {
  position: relative; z-index: 2;
  font-family: 'Cinzel', serif; font-size: 5rem; font-weight: 900;
  color: #f0dea0; line-height: 1; letter-spacing: -.03em;
  text-shadow: 0 0 24px rgba(226,192,105,.9), 0 3px 8px rgba(0,0,0,.85);
}
/* Flash bref à chaque changement de nombre */
.dgem-num.num-blink { animation: num-tick .08s ease-out; }
@keyframes num-tick {
  0%  { opacity:.45; transform: scale(.88); }
  100%{ opacity:1;   transform: scale(1); }
}
/* Révélation finale */
.dgem-num.revealed {
  animation: num-reveal .5s cubic-bezier(.15,2.2,.4,1) both;
}
@keyframes num-reveal {
  from { transform: scale(.2) rotateY(-90deg); opacity:0; }
  to   { transform: scale(1)  rotateY(0);      opacity:1; }
}

/* ── Phase rolling — gem qui se balance ── */
.dice-gem.rolling {
  animation: gem-entry .5s cubic-bezier(.2,1.6,.4,1) both,
             gem-wobble 1.5s .5s ease-in-out both;
}
@keyframes gem-entry {
  from { transform: translateY(-60px) scale(.6) rotate(-25deg); opacity:0; }
  to   { transform: translateY(0)      scale(1)  rotate(0);      opacity:1; }
}
@keyframes gem-wobble {
  0%   { transform: rotate(0deg)   scale(1); }
  10%  { transform: rotate(14deg)  scale(1.04); }
  25%  { transform: rotate(-10deg) scale(.98); }
  40%  { transform: rotate(8deg)   scale(1.02); }
  55%  { transform: rotate(-6deg)  scale(1); }
  70%  { transform: rotate(4deg)   scale(1.01); }
  85%  { transform: rotate(-2deg)  scale(1); }
  100% { transform: rotate(0deg)   scale(1); }
}

/* ── Phase landing ── */
.dice-gem.landing {
  animation: gem-slam .55s cubic-bezier(.15,1.9,.4,1) both;
}
@keyframes gem-slam {
  0%   { transform: scale(1.3) rotate(-8deg); }
  35%  { transform: scale(.8)  rotate(5deg); }
  65%  { transform: scale(1.1) rotate(-2deg); }
  100% { transform: scale(1)   rotate(0); }
}

/* ── Crit (20) ── */
.dice-gem.crit .dgem-bg {
  background: linear-gradient(160deg, #f8e868 0%, #c89820 50%, #5a3c08 100%);
  box-shadow: inset 0 -30px 50px rgba(0,0,0,.3), inset 0 12px 30px rgba(255,230,60,.35);
}
.dice-gem.crit .dgem-edge {
  border-color: rgba(255,230,60,.95);
  filter: drop-shadow(0 0 14px rgba(255,220,40,1));
  animation: crit-edge-pulse 1s ease-in-out infinite;
}
.dice-gem.crit { filter: drop-shadow(0 0 50px rgba(246,228,60,.7)) drop-shadow(0 8px 20px rgba(0,0,0,.8)); animation: gem-slam .55s cubic-bezier(.15,1.9,.4,1) both, crit-glow-pulse 1.2s .55s ease-in-out infinite; }
.dice-gem.crit .dgem-num { color:#fff; text-shadow:0 0 30px #fff,0 0 60px #f6e4a3,0 3px 8px rgba(0,0,0,.7); }
@keyframes crit-edge-pulse  { 0%,100%{filter:drop-shadow(0 0 14px rgba(255,220,40,1))}50%{filter:drop-shadow(0 0 26px rgba(255,230,60,1))} }
@keyframes crit-glow-pulse  { 0%,100%{filter:drop-shadow(0 0 50px rgba(246,228,60,.7)) drop-shadow(0 8px 20px rgba(0,0,0,.8))} 50%{filter:drop-shadow(0 0 80px rgba(255,240,80,1)) drop-shadow(0 0 140px rgba(246,228,60,.7))} }

/* ── Fumble (1) ── */
.dice-gem.fumble .dgem-bg { background: linear-gradient(160deg, #8a1818 0%, #3a0808 55%, #0e0203 100%); }
.dice-gem.fumble .dgem-edge { border-color: rgba(224,85,85,.8); filter: drop-shadow(0 0 10px rgba(224,85,85,.8)); }
.dice-gem.fumble { filter: drop-shadow(0 0 30px rgba(224,85,85,.55)) drop-shadow(0 8px 20px rgba(0,0,0,.8)); animation: gem-slam .55s cubic-bezier(.15,1.9,.4,1) both, fumble-jitter .11s .55s ease-in-out 5; }
.dice-gem.fumble .dgem-num { color:#ff9090; text-shadow:0 0 20px #e05555,0 0 40px rgba(224,85,85,.55),0 3px 8px rgba(0,0,0,.7); }
@keyframes fumble-jitter { 0%,100%{transform:translateX(0)}33%{transform:translateX(-5px)}66%{transform:translateX(5px)} }

/* Ombre au sol */
.dice-ground-shadow {
  position: absolute; bottom: -4px; width: 110px; height: 14px;
  background: radial-gradient(ellipse, rgba(80,30,200,.55) 0%, transparent 70%);
  border-radius: 50%;
  animation: ground-shadow-pulse 1.5s ease-in-out infinite;
}
@keyframes ground-shadow-pulse { 0%,100%{opacity:.7;transform:scaleX(1)} 50%{opacity:.35;transform:scaleX(.75)} }

/* ── Plusieurs dés (count > 1) — un gem par dé, en rangée ──
   showDiceRolling/showDiceResult (game-features.js) créent un .dice-gem par
   dé au lieu d'un seul réutilisé ; ces classes ne font que réduire leur
   taille et laisser la rangée s'enrouler pour que 2 à 20 dés tiennent dans
   la boîte sans la faire exploser en largeur. */
.dice-box-multi { padding: 30px 38px 26px; }
.dice-stage-multi {
  flex-wrap: wrap;
  width: auto; height: auto;
  max-width: 460px;
  gap: 10px;
}
.dice-stage-multi .dice-gem { width: 78px; height: 78px; }
.dice-stage-multi .dgem-num { font-size: 2rem; }
.dice-stage-multi .dice-ground-shadow { display: none; }

/* Barre de suspense */
.dice-bar-track {
  width: 210px; height: 5px;
  background: rgba(255,255,255,.07);
  border-radius: 3px; overflow: hidden;
}
.dice-bar-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #4a18a8, #e2c069);
  border-radius: 3px;
  box-shadow: 0 0 10px rgba(226,192,105,.7);
  transition: width .08s linear;
}

/* Status / label */
.dice-status {
  font-family: 'Cinzel', serif; font-size: .62rem;
  color: rgba(255,255,255,.3); letter-spacing: .12em;
  text-transform: uppercase; text-align: center;
  max-width: 420px; overflow-wrap: break-word; /* détail de nombreux dés (jusqu'à 20) */
}
.dice-status.crit   { font-size: .95rem; font-weight: 800; color: #f6e4a3; text-shadow: 0 0 16px #f6e4a3; animation: label-pop .45s cubic-bezier(.15,2,.4,1) both; }
.dice-status.fumble { font-size: .95rem; font-weight: 800; color: #e05555; text-shadow: 0 0 14px #e05555; animation: label-pop .45s cubic-bezier(.15,2,.4,1) both; }
@keyframes label-pop { from{opacity:0;transform:scale(.5) translateY(6px)} to{opacity:1;transform:scale(1) translateY(0)} }

/* ── Particules ── */
@keyframes dice-particle-burst {
  0%   { transform:translate(-50%,-50%) translate(0,0) rotate(0);         opacity:1; }
  100% { transform:translate(-50%,-50%) translate(var(--dx),var(--dy)) rotate(var(--rot)); opacity:0; }
}
.dice-particle { will-change: transform, opacity; }

/* ── Screen shake ── */
@keyframes dice-screen-shake {
  0%,100%{ transform:translate(0,0) }
  20%    { transform:translate(-5px, 3px) }
  40%    { transform:translate(4px,-4px) }
  60%    { transform:translate(-3px, 4px) }
  80%    { transform:translate(3px,-2px) }
}
body.dice-shake #screen-game { animation: dice-screen-shake .38s cubic-bezier(.3,.5,.7,.5); }


/* ═══ Bannière de guerre — déclaration d'attaque ════════════════ */
#war-banner {
  position: fixed;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9600;
  pointer-events: none;
  animation: war-in .35s cubic-bezier(.2,.8,.4,1) both;
}
#war-banner.war-out { animation: war-out .6s ease-in forwards; }
@keyframes war-in  { from { opacity:0; transform:translateX(-50%) translateY(-20px) scale(.9); } to { opacity:1; transform:translateX(-50%) translateY(0) scale(1); } }
@keyframes war-out { to   { opacity:0; transform:translateX(-50%) translateY(-12px) scale(.95); } }

.war-content {
  background: linear-gradient(135deg, rgba(30,10,10,.97), rgba(80,20,20,.97));
  border: 1px solid rgba(200,60,60,.5);
  border-radius: 10px;
  padding: 10px 28px;
  text-align: center;
  box-shadow: 0 0 40px rgba(200,60,60,.25), 0 8px 30px rgba(0,0,0,.7);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.war-label {
  font-family: 'Cinzel', serif;
  font-size: .75rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #e05555;
  text-shadow: 0 0 16px rgba(224,85,85,.6);
}
.war-detail {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  font-weight: 700;
  color: #f0dea0;
  letter-spacing: .06em;
}
.war-arrow { color: #e05555; margin: 0 6px; }
.war-card {
  font-size: .65rem;
  color: rgba(255,255,255,.45);
  font-style: italic;
}

/* ═══ Dégâts commandant — affichage header ══════════════════════ */
.cmd-dmg-group {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 1px !important;
  line-height: 1.1 !important;
  min-width: 36px;
}
.cmd-source-name {
  font-family: 'Cinzel', serif;
  font-size: .6rem;
  font-weight: 600;
  color: rgba(226,192,105,.85);
  letter-spacing: .03em;
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}
.cmd-dmg-value {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: .82rem;
  font-family: 'JetBrains Mono', monospace;
}
.fd-lethal .cmd-source-name { color: #ff5555; }
.fd-warn   .cmd-source-name { color: #ff9944; }
/* Flash quand la valeur change */
@keyframes cmd-flash {
  0%   { background: rgba(220,80,80,.5); box-shadow: 0 0 12px rgba(220,80,80,.7); }
  100% { background: transparent; box-shadow: none; }
}
.cmd-dmg-changed {
  animation: cmd-flash .8s ease-out forwards;
  border-radius: 4px;
}

/* ═══ Badge dé — affiché sur la zone board du joueur ═══════════ */
.dice-badge {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20,15,40,.92);
  border: 1px solid rgba(226,192,105,.6);
  color: #f6e4a3;
  font-weight: 700;
  font-size: .9rem;
  border-radius: 22px;
  padding: 4px 14px;
  z-index: 300;
  pointer-events: none;
  font-family: 'Cinzel', serif;
  letter-spacing: .06em;
  box-shadow: 0 0 16px rgba(226,192,105,.3);
  animation: dice-badge-in .35s cubic-bezier(.2,.8,.4,1) both;
  white-space: nowrap;
}
.dice-badge-val { font-size: 1.1rem; font-weight: 900; }
.dice-badge-crit   { border-color: rgba(246,228,163,.9); box-shadow: 0 0 24px rgba(246,228,163,.5); animation: dice-badge-in .35s cubic-bezier(.2,.8,.4,1) both, crit-pulse 1s .4s ease-in-out infinite; }
.dice-badge-fumble { border-color: rgba(224,85,85,.7); color: #e05555; box-shadow: 0 0 16px rgba(224,85,85,.3); }
@keyframes dice-badge-in {
  from { opacity:0; transform:translateX(-50%) scale(.5); }
  to   { opacity:1; transform:translateX(-50%) scale(1); }
}


/* ═══ NOTES — Fenêtre draggable ════════════════════════════════ */
#note-window {
  position: fixed;
  right: 20px;
  left: auto;
  bottom: 160px;
  width: 640px;
  z-index: 8000;
  background: rgba(12,9,28,.95);
  border: 1px solid rgba(226,192,105,.28);
  border-radius: 10px;
  box-shadow: 0 8px 40px rgba(0,0,0,.7);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: blur(8px);
  animation: note-in .2s ease-out;
}
@keyframes note-in { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }
.note-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(226,192,105,.08);
  border-bottom: 1px solid rgba(226,192,105,.15);
  font-family: 'Cinzel', serif;
  font-size: .62rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #e2c069;
  cursor: grab;
  user-select: none;
  flex-shrink: 0;
}
.note-header:active { cursor: grabbing; }
.note-close-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,.4);
  cursor: pointer;
  font-size: .8rem;
  padding: 0 2px;
  line-height: 1;
}
.note-close-btn:hover { color: #e05555; }

/* ── Corps : notes (gauche) + calculatrice (droite) ─────────── */
.note-body {
  display: flex;
  flex: 1;
}
.note-textarea {
  background: transparent;
  border: none;
  border-right: 1px solid rgba(226,192,105,.12);
  color: rgba(255,255,255,.9);
  font-family: 'Inter', sans-serif;
  font-size: 1.05rem;
  line-height: 1.6;
  padding: 10px 12px;
  resize: none;
  min-height: 380px;
  outline: none;
  flex: 1;
}
.note-textarea::placeholder { color: rgba(255,255,255,.2); }

/* ── Calculatrice ────────────────────────────────────────────── */
.calc-panel {
  width: 250px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 8px;
  gap: 6px;
  background: rgba(0,0,0,.25);
}
.calc-display {
  background: rgba(0,0,0,.5);
  border: 1px solid rgba(226,192,105,.18);
  border-radius: 6px;
  padding: 8px 10px;
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: #f0dea0;
  letter-spacing: .02em;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
  word-break: break-all;
}
.calc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.calc-btn {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 5px;
  color: rgba(255,255,255,.85);
  font-size: .8rem;
  font-weight: 600;
  padding: 7px 0;
  cursor: pointer;
  transition: background .1s;
  font-family: 'Inter', sans-serif;
}
.calc-btn:hover  { background: rgba(255,255,255,.16); }
.calc-btn:active { background: rgba(255,255,255,.25); }
.calc-fn  { background: rgba(255,255,255,.12); color: rgba(255,255,255,.65); }
.calc-fn:hover { background: rgba(255,255,255,.2); }
.calc-op  { background: rgba(226,192,105,.18); color: #e2c069; border-color: rgba(226,192,105,.22); }
.calc-op:hover { background: rgba(226,192,105,.32); }
.calc-op.calc-op-active { background: #e2c069; color: #1a1230; }
.calc-eq  { background: rgba(226,192,105,.85); color: #12111e; font-size: .95rem; }
.calc-eq:hover { background: #e2c069; }
.calc-zero { grid-column: span 2; text-align: left; padding-left: 10px; }


/* ═══ INTRO DE PARTIE ══════════════════════════════════════════ */
#game-intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 9800;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(60% 50% at 50% 30%, rgba(123,86,255,.15), transparent 70%),
    #060410;
  cursor: pointer;
  animation: intro-in .5s ease-out;
}
@keyframes intro-in  { from { opacity:0; } to { opacity:1; } }
.gi-out { animation: intro-out .5s ease-in forwards !important; }
@keyframes intro-out { to { opacity:0; } }

.gi-bg {
  position: absolute;
  inset: 0;
  background: transparent;
  pointer-events: none;
}

.gi-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.gi-title {
  font-family: 'Cinzel', serif;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #fbeec0 0%, #e2c069 55%, #8a6326 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 24px rgba(226,192,105,.4));
  animation: gi-title-in .8s ease-out both;
}
@keyframes gi-title-in { from { opacity:0; transform:translateY(16px); } }
.gi-subtitle {
  font-family: 'Cinzel', serif;
  font-size: .75rem;
  letter-spacing: .2em;
  color: rgba(255,255,255,.35);
  text-transform: uppercase;
  animation: gi-title-in .8s .1s ease-out both;
}
.gi-players {
  display: flex;
  align-items: flex-end;
  gap: 32px;
  flex-wrap: wrap;
  justify-content: center;
  animation: gi-title-in .8s .25s ease-out both;
}
.gi-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: gi-player-in .7s ease-out both;
}
@keyframes gi-player-in {
  from { opacity:0; transform:scale(.75) translateY(24px); }
  to   { opacity:1; transform:scale(1) translateY(0); }
}
.gi-cmd-img {
  width: 260px; height: 364px;
  border-radius: 12px;
  object-fit: cover;
  object-position: 50% 15%;
  border: 2px solid rgba(226,192,105,.6);
  box-shadow:
    0 16px 60px rgba(0,0,0,.85),
    0 0 60px rgba(226,192,105,.3),
    0 0 120px rgba(226,192,105,.12);
  animation: gi-card-float 3s ease-in-out infinite;
}
@keyframes gi-card-float {
  0%,100% { transform: translateY(0);  }
  50%     { transform: translateY(-6px); }
}
.gi-cmd-ph {
  width: 260px; height: 364px;
  border-radius: 12px;
  background: rgba(255,255,255,.05);
  border: 2px solid rgba(226,192,105,.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem;
}
.gi-name {
  font-family: 'Cinzel', serif;
  font-size: .82rem;
  color: #e2c069;
  letter-spacing: .12em;
  max-width: 160px;
  text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-shadow: 0 0 14px rgba(226,192,105,.4);
}
.gi-vs {
  font-family: 'Cinzel', serif;
  font-size: .65rem;
  letter-spacing: .18em;
  color: rgba(255,255,255,.2);
  text-transform: uppercase;
}
.gi-skip {
  font-size: .6rem;
  color: rgba(255,255,255,.2);
  letter-spacing: .1em;
  text-transform: uppercase;
  animation: blink-skip 1.5s ease-in-out infinite;
}
@keyframes blink-skip { 0%,100%{opacity:.3;} 50%{opacity:.7;} }


/* ── Token modal ──────────────────────────────────────────────── */
#token-search:focus {
  border-color: rgba(226,192,105,.6);
  box-shadow: 0 0 0 2px rgba(226,192,105,.08);
}

/* ═══ VICTOIRE ÉPIQUE ══════════════════════════════════════════ */
#epic-victory-overlay {
  position: fixed;
  inset: 0;
  z-index: 9700;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(60% 50% at 50% 30%, rgba(226,192,105,.2), transparent 70%),
    radial-gradient(120% 80% at 50% 0%, #1a1336 0%, #0b0918 55%, #050409 100%);
  animation: ev-in .6s ease-out;
}
@keyframes ev-in { from { opacity:0; } to { opacity:1; } }
.ev-out { animation: ev-out .5s ease-in forwards !important; }
@keyframes ev-out { to { opacity:0; } }

.ev-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.ev-title {
  font-family: 'Cinzel', serif;
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: .22em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #fbeec0 0%, #e2c069 45%, #b88a31 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 40px rgba(226,192,105,.5));
  animation: ev-glow 2s ease-in-out infinite;
}
@keyframes ev-glow { 0%,100%{filter:drop-shadow(0 0 40px rgba(226,192,105,.5));} 50%{filter:drop-shadow(0 0 70px rgba(226,192,105,.8));} }
.ev-cmd {
  width: 160px; height: 224px;
  border-radius: 10px;
  object-fit: cover;
  border: 3px solid #e2c069;
  box-shadow: 0 0 50px rgba(226,192,105,.4), 0 20px 60px rgba(0,0,0,.8);
  animation: ev-float 3s ease-in-out infinite;
}
@keyframes ev-float { 0%,100%{transform:translateY(0);} 50%{transform:translateY(-8px);} }
.ev-trophy { font-size: 5rem; animation: ev-float 3s ease-in-out infinite; }
.ev-winner {
  font-family: 'Cinzel', serif;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: .14em;
  color: #f6e4a3;
}
.ev-subtitle {
  font-family: 'Cinzel', serif;
  font-size: .75rem;
  letter-spacing: .14em;
  color: rgba(255,255,255,.4);
  text-transform: uppercase;
}
.ev-timers {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(226,192,105,.15);
  border-radius: 8px;
  padding: 10px 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: .68rem;
  min-width: 180px;
}
.ev-timers-title {
  font-family: 'Cinzel', serif;
  font-size: .5rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(226,192,105,.45);
  text-align: center;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(226,192,105,.12);
  padding-bottom: 4px;
}
.ev-timer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  color: rgba(255,255,255,.55);
}
.ev-timer b { color: #e2c069; font-weight: 700; }
.ev-close {
  background: rgba(226,192,105,.1);
  border: 1px solid rgba(226,192,105,.3);
  color: #e2c069;
  border-radius: 6px;
  padding: 8px 28px;
  font-family: 'Cinzel', serif;
  font-size: .65rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .15s;
}
.ev-close:hover { background: rgba(226,192,105,.22); }


/* ═══ JOUER UNE CARTE — Ascension + Dissolution (Magic Arena) ══ */
/* Monte haut (250px) puis se dissout en poussière magique        */
@keyframes fly-card-away {
  0%   { transform: translateY(0)     rotate(0deg)  scale(1);    opacity: 1;   filter: blur(0)    brightness(1); }
  18%  { transform: translateY(-30px)  rotate(1deg)  scale(1.05); opacity: 1;   filter: blur(0)    brightness(1.06) drop-shadow(0 0 6px rgba(200,170,255,.3)); }
  42%  { transform: translateY(-110px) rotate(2.5deg) scale(1.09); opacity: .88; filter: blur(1.5px) brightness(1.18) drop-shadow(0 0 16px rgba(180,130,255,.6)); }
  65%  { transform: translateY(-200px) rotate(3.8deg) scale(1.14); opacity: .45; filter: blur(6px)   brightness(1.5)  drop-shadow(0 0 28px rgba(160,110,255,.8)); }
  85%  { transform: translateY(-260px) rotate(4.5deg) scale(1.18); opacity: .18; filter: blur(12px)  brightness(1.9)  drop-shadow(0 0 38px rgba(150,100,255,.6)); }
  100% { transform: translateY(-290px) rotate(5deg)   scale(1.22); opacity: 0;   filter: blur(22px)  brightness(2.5)  drop-shadow(0 0 45px rgba(130,90,255,.3)); }
}

/* ═══ DÉFAUSSER/EXILER — Burn / Incinération magique ═══════════ */
@keyframes card-burn-away {
  0%   { opacity: 1;   filter: none; clip-path: inset(0% 0% 0% 0% round 7px); transform: scale(1); }
  10%  { opacity: 1;   filter: drop-shadow(0 0 10px rgba(255,120,30,.7)); clip-path: inset(0% 0% 0% 0% round 7px); transform: scale(1.03); }
  30%  { opacity: .95; filter: drop-shadow(0 0 20px rgba(255,70,0,.9)) sepia(.6) saturate(2.5); clip-path: inset(0% 1% 15% 1% round 6px); transform: scale(1.02); }
  52%  { opacity: .8;  filter: drop-shadow(0 0 28px rgba(255,50,0,1))  sepia(.9) saturate(3) brightness(1.3); clip-path: inset(0% 2% 48% 2% round 5px); transform: scale(1); }
  73%  { opacity: .45; filter: drop-shadow(0 0 18px rgba(200,80,0,.6)) sepia(1) brightness(1.8); clip-path: inset(0% 4% 76% 4% round 4px); transform: scale(.97); }
  90%  { opacity: .15; filter: brightness(2.5); clip-path: inset(0% 6% 93% 6% round 3px); transform: scale(.94); }
  100% { opacity: 0;   filter: brightness(4); clip-path: inset(0% 8% 100% 8% round 2px); transform: scale(.9) translateY(6px); }
}

/* ═══ PARTICULES DISSOLUTION (poussière magique) ═══════════════ */
.card-particle {
  position: fixed;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: #c8a8ff;
  box-shadow: 0 0 6px 2px rgba(180,130,255,.9);
  pointer-events: none;
  z-index: 19999;
  animation: particle-dissolve var(--pd,.7s) var(--pdelay,0s) ease-out forwards;
}
@keyframes particle-dissolve {
  0%   { transform: translate(0,0) scale(1); opacity: 1; }
  100% { transform: translate(var(--px,20px), var(--py,-90px)) scale(.15); opacity: 0; }
}

/* Particules braises (burn) */
.card-ember {
  position: fixed;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: #ff6020;
  box-shadow: 0 0 5px 2px rgba(255,80,0,.8);
  pointer-events: none;
  z-index: 19999;
  animation: ember-rise var(--pd,.9s) var(--pdelay,0s) ease-out forwards;
}
@keyframes ember-rise {
  0%   { transform: translate(0,0) scale(1); opacity: .9; }
  50%  { opacity: .6; }
  100% { transform: translate(var(--px,10px), var(--py,-70px)) scale(.1); opacity: 0; }
}


/* ═══ CORRECTIFS SUPPLÉMENTAIRES ═══════════════════════════════ */

/* ── Emotes : force au-dessus du fond arcane ─────────────────── */
#emote-panel {
  z-index: 9200 !important;
  position: absolute !important;
}
.emote-bubble {
  z-index: 9100 !important;
}

/* ── Lexique : scrollbar dorée + recherche ───────────────────── */
#lexicon-modal .browser-body::-webkit-scrollbar { width: 6px; }
#lexicon-modal .browser-body::-webkit-scrollbar-track { background: rgba(0,0,0,.3); border-radius: 3px; }
#lexicon-modal .browser-body::-webkit-scrollbar-thumb { background: rgba(226,192,105,.35); border-radius: 3px; }
#lexicon-modal .browser-body::-webkit-scrollbar-thumb:hover { background: rgba(226,192,105,.6); }
.browser-body::-webkit-scrollbar { width: 6px; }
.browser-body::-webkit-scrollbar-track { background: rgba(0,0,0,.3); border-radius: 3px; }
.browser-body::-webkit-scrollbar-thumb { background: rgba(226,192,105,.35); border-radius: 3px; }
.browser-body::-webkit-scrollbar-thumb:hover { background: rgba(226,192,105,.6); }

/* ── Filtre main : hauteur minimale pour rester visible ─────── */
.my-hand { min-height: 50px !important; }
.hand-type-tabs { position: relative !important; z-index: 2 !important; flex-shrink: 0 !important; }

/* ── Filtres main : style texte (labels remplacés via HTML) ──── */
.htt {
  font-family: 'Cinzel', serif !important;
  font-size: .58rem !important;
  letter-spacing: .06em !important;
  padding: 3px 7px !important;
  border-radius: 4px !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  color: rgba(255,255,255,.45) !important;
  cursor: pointer !important;
  transition: all .15s !important;
  text-transform: uppercase !important;
  white-space: nowrap !important;
}
.htt:hover { color: rgba(226,192,105,.8) !important; border-color: rgba(226,192,105,.2) !important; }
.htt.active {
  color: #e2c069 !important;
  border-color: rgba(226,192,105,.5) !important;
  background: rgba(226,192,105,.1) !important;
}

/* ── D20 button : assurer visibilité ────────────────────────── */
#btn-dice, #btn-notes {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* ── Note window : draggable reste dans l'écran ─────────────── */
#note-window { max-height: 60vh !important; }

/* ── Filtre main : position FIXE même si main vide ─────────── */
.hand-fan-wrap { min-height: 185px !important; }
.my-hand       { min-height: 165px !important; }

/* ── Search deck modal : scrollbar dorée ────────────────────── */
#search-deck-results::-webkit-scrollbar       { width: 6px; }
#search-deck-results::-webkit-scrollbar-track { background: rgba(0,0,0,.3); border-radius: 3px; }
#search-deck-results::-webkit-scrollbar-thumb { background: rgba(226,192,105,.35); border-radius: 3px; }

/* ── VICTOIRE PREMIUM ═══════════════════════════════════════════ */
#epic-victory-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9700 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background:
    radial-gradient(ellipse 70% 55% at 50% 20%, rgba(226,192,105,.22), transparent 65%),
    radial-gradient(120% 80% at 50% 0%, #1a1336 0%, #0b0918 55%, #050409 100%) !important;
  overflow: hidden !important;
  animation: ev-in .6s ease-out !important;
}
.ev-rays {
  /* Rayons statiques — pas de rotation pour ne pas distraire */
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 50% at 50% 10%, rgba(226,192,105,.08), transparent 70%);
  pointer-events: none;
}
/* @keyframes ev-rays-spin supprimé — effet trop distrayant */

.ev-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.ev-particle {
  position: absolute;
  bottom: -10px;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: #e2c069;
  box-shadow: 0 0 6px 2px rgba(226,192,105,.7);
  animation: ev-particle-rise var(--d, 3s) var(--delay, 0s) ease-in infinite;
}
@keyframes ev-particle-rise {
  0%   { transform: translateY(0) translateX(0) scale(1); opacity: 0; }
  10%  { opacity: .9; }
  80%  { opacity: .4; }
  100% { transform: translateY(-100vh) translateX(var(--ev-dx, 20px)) scale(.3); opacity: 0; }
}

.ev-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  animation: ev-content-in .8s .1s ease-out both;
  max-height: 92vh;
  overflow-y: auto;
  padding: 4px 8px; /* évite que le scroll ne rogne l'ombre portée des éléments */
}
@keyframes ev-content-in { from { opacity:0; transform:translateY(30px) scale(.95); } }

.ev-stats {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(226,192,105,.16);
  border-radius: 10px;
  padding: 16px 22px;
  min-width: 560px;
}
.ev-stats-title {
  font-family: 'Cinzel', serif;
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(226,192,105,.7);
  text-align: center;
}
.ev-stats-table {
  border-collapse: collapse;
  width: 100%;
}
.ev-stats-table th, .ev-stats-table td {
  padding: 8px 12px;
  text-align: center;
  white-space: nowrap;
}
.ev-stats-table th {
  font-family: 'Cinzel', serif;
  font-size: .68rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: .02em;
  color: rgba(226,192,105,.65);
  border-bottom: 1px solid rgba(226,192,105,.2);
  padding-bottom: 8px;
}
.ev-stats-col-name { text-align: left !important; }
.ev-stats-table td {
  font-family: 'JetBrains Mono', monospace;
  font-size: .82rem;
  font-weight: 600;
  color: rgba(255,255,255,.75);
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.ev-stats-table tr:last-child td { border-bottom: none; }
.ev-stats-table td.ev-stats-name {
  text-align: left;
  color: #e6ddca;
  font-family: 'Cinzel', serif;
  font-size: .92rem;
  font-weight: 600;
}
.ev-stats-winner-row { background: rgba(226,192,105,.06); }
.ev-stats-winner-row td { color: #f6e4a3; }
.ev-stats-winner-row td.ev-stats-name { color: #e2c069; }
.ev-stats-note {
  font-size: .64rem;
  color: rgba(255,255,255,.35);
  text-align: center;
  font-style: italic;
  margin-top: 2px;
}
.ev-empty { color: rgba(255,255,255,.25); font-size: .72rem; }

/* ── Jalons de partie (premier sang / premier éliminé) ───────── */
.ev-milestones {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .7rem;
  color: rgba(255,255,255,.55);
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(226,192,105,.1);
  border-radius: 20px;
  padding: 6px 18px;
}
.ev-milestones b { color: #e2c069; }
.ev-milestone-sep { color: rgba(226,192,105,.3); }

/* ── Badges de fin de partie (showEpicVictory, game-features.js) ─
   Grille de "awards" rigolos/gênants décernés au joueur le plus extrême
   sur une stat donnée — même carte visuelle que .ev-stats mais en grille
   responsive plutôt qu'en tableau. ─────────────────────────────── */
.ev-badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}
.ev-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(226,192,105,.05);
  border: 1px solid rgba(226,192,105,.15);
  border-radius: 10px;
  padding: 10px 12px;
}
.ev-badge-icon {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
}
.ev-badge-body { min-width: 0; }
.ev-badge-name {
  font-family: 'Cinzel', serif;
  font-size: .74rem;
  font-weight: 600;
  color: #e2c069;
  white-space: nowrap;
}
.ev-badge-player {
  font-size: .78rem;
  font-weight: 700;
  color: #e6ddca;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ev-badge-detail {
  font-family: 'JetBrains Mono', monospace;
  font-size: .62rem;
  color: rgba(255,255,255,.45);
  white-space: normal;
  line-height: 1.3;
}

/* ── Répartition des cartes jouées par type ──────────────────── */
.ev-type-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.ev-type-row:last-child { border-bottom: none; }
.ev-type-name {
  font-family: 'Cinzel', serif;
  font-size: .8rem;
  font-weight: 600;
  color: #e6ddca;
  min-width: 80px;
  flex-shrink: 0;
}
.ev-type-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ev-type-chip {
  font-size: .68rem;
  color: rgba(255,255,255,.6);
  background: rgba(226,192,105,.07);
  border: 1px solid rgba(226,192,105,.15);
  border-radius: 20px;
  padding: 2px 10px;
  white-space: nowrap;
}
.ev-type-chip b { color: #e2c069; font-weight: 700; }

/* ── Courbe de mana (mini histogramme par joueur) ────────────── */
.ev-mana-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.ev-mana-row:last-child { border-bottom: none; }
.ev-mana-name {
  font-family: 'Cinzel', serif;
  font-size: .8rem;
  font-weight: 600;
  color: #e6ddca;
  min-width: 80px;
  flex-shrink: 0;
}
.ev-mana-bars { display: flex; align-items: flex-end; gap: 6px; height: 44px; }
.ev-mana-bar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  width: 18px;
  height: 100%;
}
.ev-mana-bar-count { font-size: .58rem; color: rgba(226,192,105,.6); line-height: 1.4; min-height: 11px; }
.ev-mana-bar {
  width: 100%;
  background: linear-gradient(180deg, #e2c069, #b88a31);
  border-radius: 2px 2px 0 0;
  min-height: 2px;
}
.ev-mana-bar-label {
  font-size: .58rem;
  color: rgba(255,255,255,.4);
  margin-top: 3px;
  font-family: 'JetBrains Mono', monospace;
}

/* ── Évolution des PV (sparkline SVG par joueur) ─────────────── */
.ev-spark-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.ev-spark-row:last-child { border-bottom: none; }
.ev-spark-name {
  font-family: 'Cinzel', serif;
  font-size: .8rem;
  font-weight: 600;
  color: #e6ddca;
  min-width: 80px;
  flex-shrink: 0;
}
.ev-life-spark { width: 160px; height: 34px; flex-shrink: 0; }
.ev-spark-final {
  font-family: 'JetBrains Mono', monospace;
  font-size: .72rem;
  font-weight: 600;
  color: rgba(255,255,255,.6);
  margin-left: auto;
}

.ev-crown {
  font-size: 3.5rem;
  animation: ev-crown-bounce 1s .6s ease-out both, ev-float 3s 1.6s ease-in-out infinite;
}
@keyframes ev-crown-bounce {
  0%   { transform: scale(0) translateY(-40px); opacity:0; }
  60%  { transform: scale(1.2) translateY(8px); opacity:1; }
  80%  { transform: scale(.95) translateY(-4px); }
  100% { transform: scale(1) translateY(0); opacity:1; }
}

.ev-title {
  font-family: 'Cinzel', serif !important;
  font-size: 3.2rem !important;
  font-weight: 800 !important;
  letter-spacing: .2em !important;
  text-transform: uppercase !important;
  background: linear-gradient(180deg, #fff7dc 0%, #e2c069 40%, #c49a28 70%, #8a6b10 100%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  color: transparent !important;
  filter: drop-shadow(0 0 30px rgba(226,192,105,.6)) !important;
  animation: ev-title-glow 2s ease-in-out infinite !important;
}
@keyframes ev-title-glow {
  0%,100% { filter: drop-shadow(0 0 30px rgba(226,192,105,.5)); }
  50%     { filter: drop-shadow(0 0 60px rgba(226,192,105,.9)) drop-shadow(0 0 100px rgba(226,192,105,.4)); }
}

.ev-winner-wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  background: rgba(0,0,0,.3);
  border: 1px solid rgba(226,192,105,.25);
  border-radius: 14px;
  padding: 14px 24px;
  backdrop-filter: blur(6px);
}
.ev-cmd {
  width: 130px !important; height: 182px !important;
  border-radius: 9px !important;
  object-fit: cover !important;
  border: 2px solid #e2c069 !important;
  box-shadow: 0 0 40px rgba(226,192,105,.45), 0 12px 40px rgba(0,0,0,.7) !important;
  animation: ev-float 3s ease-in-out infinite !important;
}
@keyframes ev-float { 0%,100%{transform:translateY(0);} 50%{transform:translateY(-8px);} }

.ev-winner-info { display: flex; flex-direction: column; gap: 6px; }
.ev-winner {
  font-family: 'Cinzel', serif !important;
  font-size: 1.6rem !important;
  font-weight: 700 !important;
  color: #f6e4a3 !important;
  text-shadow: 0 0 20px rgba(246,228,163,.4) !important;
}
.ev-subtitle {
  font-family: 'Cinzel', serif !important;
  font-size: .8rem !important;
  color: rgba(255,255,255,.45) !important;
  letter-spacing: .12em !important;
  text-transform: uppercase !important;
}

.ev-timers {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(226,192,105,.12);
  border-radius: 8px;
  padding: 10px 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: .68rem;
}
.ev-timer { display: flex; justify-content: space-between; gap: 24px; color: rgba(255,255,255,.5); }
.ev-timer b { color: #e2c069; font-weight: 700; }

.ev-close {
  background: linear-gradient(135deg, rgba(226,192,105,.2), rgba(226,192,105,.08)) !important;
  border: 1px solid rgba(226,192,105,.5) !important;
  color: #e2c069 !important;
  border-radius: 8px !important;
  padding: 10px 32px !important;
  font-family: 'Cinzel', serif !important;
  font-size: .72rem !important;
  letter-spacing: .18em !important;
  text-transform: uppercase !important;
  cursor: pointer !important;
  transition: all .2s !important;
  animation: ev-btn-in 1s 1s ease-out both !important;
}
@keyframes ev-btn-in { from { opacity:0; transform:translateY(10px); } }
.ev-close:hover {
  background: linear-gradient(135deg, rgba(226,192,105,.35), rgba(226,192,105,.15)) !important;
  box-shadow: 0 0 20px rgba(226,192,105,.3) !important;
}
.ev-actions {
  display: flex !important;
  gap: 12px !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  margin-top: 4px !important;
}
.ev-quit {
  background: rgba(255,255,255,.06) !important;
  border: 1px solid rgba(255,255,255,.18) !important;
  color: rgba(255,255,255,.5) !important;
  border-radius: 8px !important;
  padding: 12px 28px !important;
  font-family: 'Cinzel', serif !important;
  font-size: .8rem !important;
  letter-spacing: .08em !important;
  cursor: pointer !important;
  transition: all .2s !important;
  animation: ev-btn-in 1s 1.1s ease-out both !important;
}
.ev-quit:hover {
  background: rgba(224,85,85,.18) !important;
  border-color: rgba(224,85,85,.4) !important;
  color: #e05555 !important;
}
.ev-replay {
  background: rgba(79,209,197,.1) !important;
  border: 1px solid rgba(79,209,197,.4) !important;
  color: #4fd1c5 !important;
  border-radius: 8px !important;
  padding: 12px 28px !important;
  font-family: 'Cinzel', serif !important;
  font-size: .8rem !important;
  letter-spacing: .08em !important;
  cursor: pointer !important;
  transition: all .2s !important;
}
.ev-replay:hover {
  background: rgba(79,209,197,.22) !important;
  box-shadow: 0 0 20px rgba(79,209,197,.3) !important;
}
.ev-out { animation: ev-out .6s ease-in forwards !important; }
@keyframes ev-out { to { opacity:0; transform:scale(.95); } }


/* ═══════════════════════════════════════════════════════════════
   HEADER FILETS DORÉS — Player zone header redesign (Screen 4)
   ═══════════════════════════════════════════════════════════════ */

/* Base header : flex ligne, hauteur compacte, fond foncé */
.fd-header {
  display: flex !important;
  align-items: center !important;
  gap: 0 !important;
  padding: 0 8px !important;
  height: 46px !important;     /* +10px — plus lisible */
  min-height: 46px !important;
  background: rgba(8,5,20,.88) !important;
  border-bottom: 1px solid rgba(226,192,105,.18) !important;
  overflow: hidden !important;
}
.fd-header.fd-active {
  background: rgba(12,8,28,.92) !important;
  border-bottom-color: rgba(226,192,105,.38) !important;
}

/* ── GAUCHE ─────────────────────────────────────────────────── */
.fd-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  overflow: hidden;
}

/* Avatar 28px */
.fd-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(226,192,105,.2);
  border: 1px solid rgba(226,192,105,.35);
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700; color: #e2c069;
  flex-shrink: 0; overflow: hidden;
}
.fd-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
.fd-avatar.fd-avatar-active { border-color: #e2c069; box-shadow: 0 0 6px rgba(226,192,105,.5); }

/* Nom joueur */
.fd-name {
  font-family: 'Cinzel', serif;
  font-size: .8rem;
  font-weight: 600;
  color: rgba(255,255,255,.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
  letter-spacing: .04em;
}

/* Compteurs zones */
.fd-counts {
  display: flex;
  gap: 7px;
  flex-shrink: 0;
}
.fd-counts span {
  font-size: .82rem;
  color: rgba(255,255,255,.45);
  display: flex; align-items: center; gap: 1px;
  white-space: nowrap;
}
.fd-counts span b { color: rgba(255,255,255,.75); font-weight: 700; font-size: .85rem; }

/* Glisser-déposer une carte sur ✦/💀/✨ d'un adversaire (stat-hand/stat-gy/
   stat-exile, en-tête ET pied de zone joueur) → don direct dans cette zone
   précise (voir listeners délégués sur document, game.js). */
.stat-hand.zone-give-drop-hover,
.stat-gy.zone-give-drop-hover,
.stat-exile.zone-give-drop-hover {
  border-radius: 5px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.7);
  transform: scale(1.12);
}

/* ── SPACER ─────────────────────────────────────────────────── */
.fd-spacer { flex: 1; }

/* ── DROIT ──────────────────────────────────────────────────── */
.fd-right {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}

/* Groupe avec filet doré à gauche (sauf premier) */
.fd-group {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 0 7px;
  height: 36px;
  position: relative;
}
.fd-group + .fd-group::before {
  content: '';
  position: absolute;
  left: 0; top: 5px; bottom: 5px;
  width: 1px;
  background: rgba(226,192,105,.28);
}

/* Valeurs */
.fd-val {
  font-size: .9rem;
  display: flex; align-items: center; gap: 2px;
  white-space: nowrap;
}
.fd-val b { font-weight: 700; font-size: .92rem; }
.fd-dim  { color: rgba(255,255,255,.35); }
.fd-warn { color: #e09050; }
.fd-lethal { color: #e05555; }

/* PV */
.fd-life-val {
  font-family: 'Cinzel', serif;
  font-size: 1.08rem;
  font-weight: 700;
  display: flex; align-items: center; gap: 2px;
}
.fd-life-val b { font-size: 1.12rem; }

/* Boutons compacts */
.fd-btn {
  height: 24px; min-width: 20px;
  padding: 0 5px;
  border-radius: 4px;
  background: rgba(226,192,105,.1);
  border: 1px solid rgba(226,192,105,.25);
  color: rgba(255,255,255,.7);
  /* Sans famille explicite, les <button> ne l'héritent pas → Arial (défaut
     navigateur) au milieu d'une interface Inter/Cinzel. */
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: .72rem;
  cursor: pointer;
  transition: all .12s;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.fd-btn:hover { background: rgba(226,192,105,.22); color: #e2c069; }
.fd-btn.btn-undo       { background: rgba(80,150,255,.12); border-color: rgba(80,150,255,.3); }
.fd-btn.btn-board-view { background: rgba(80,150,255,.12); border-color: rgba(80,150,255,.3); }
.fd-interact { font-size: .68rem; white-space: nowrap; }

/* Input HP */
.fd-hp-input {
  width: 30px;
  text-align: center;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(226,192,105,.2);
  border-radius: 3px;
  color: #e2c069;
  font-size: .68rem;
  font-weight: 700;
  padding: 2px 2px;
  height: 20px;
}
.fd-hp-input::-webkit-inner-spin-button { opacity: 0; }

/* HP preset buttons */
.hp-preset-row {
  display: flex;
  gap: 3px;
  align-items: center;
}
.hp-preset {
  width: 22px;
  height: 20px;
  font-size: .6rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(226,192,105,.18);
  border-radius: 3px;
  color: #a0906a;
  cursor: pointer;
  padding: 0;
  transition: background .12s, color .12s, border-color .12s;
}
.hp-preset:hover  { background: rgba(226,192,105,.16); color: #e2c069; }
.hp-preset.active {
  background: rgba(226,192,105,.28);
  border-color: rgba(226,192,105,.6);
  color: #ffe8a0;
}

/* ═══ ANIMATION FLOTTANTE PV ════════════════════════════════════ */
@keyframes life-float {
  0%   { opacity: 1;   transform: translateY(0)    scale(1); }
  20%  { opacity: 1;   transform: translateY(-8px)  scale(1.12); }
  100% { opacity: 0;   transform: translateY(-48px) scale(.85); }
}
.life-delta {
  position: fixed;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.15rem;
  font-weight: 900;
  pointer-events: none;
  z-index: 9800;
  animation: life-float 1.25s ease-out forwards;
  text-shadow: 0 0 10px currentColor;
  letter-spacing: .02em;
}
.life-delta.gain { color: #5eff8a; }
.life-delta.loss { color: #ff5555; }


/* ═══ DÉ ROLLING — animation avant résultat ════════════════════ */
.dice-rolling {
  font-size: 5rem;
  display: block;
  text-align: center;
  animation: dice-wobble .25s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 20px rgba(226,192,105,.6));
}
@keyframes dice-wobble {
  from { transform: rotate(-15deg) scale(.95); }
  to   { transform: rotate(15deg)  scale(1.08); }
}
.dice-rolling-dots {
  display: flex; gap: 6px; justify-content: center; padding-top: 8px;
}
.dice-rolling-dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(226,192,105,.6);
  animation: dice-dot-pulse .6s ease-in-out infinite;
}
.dice-rolling-dots span:nth-child(2) { animation-delay: .15s; }
.dice-rolling-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes dice-dot-pulse { 0%,100%{opacity:.3;transform:scale(.8);} 50%{opacity:1;transform:scale(1.2);} }

/* ═══ ZONES LATÉRALES MAIN (Défausse + Exil + Pioche) ══════════ */
.hand-side-zones {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 4px;
  flex-shrink: 0;
}

/* Bouton zone (GY / Exile) */
.hsz-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(0,0,0,.5);
  border: 1px solid rgba(226,192,105,.15);
  cursor: pointer;
  transition: all .15s;
  min-width: 52px;
}
.hsz-btn:hover { background: rgba(226,192,105,.1); border-color: rgba(226,192,105,.35); }
.hsz-icon { font-size: 1.1rem; line-height: 1; }
.hsz-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: .9rem;
  font-weight: 700;
  color: #e2c069;
  line-height: 1;
}
.hsz-label {
  font-size: .48rem;
  color: rgba(255,255,255,.3);
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
}
.hsz-sep {
  width: 36px; height: 1px;
  background: rgba(226,192,105,.2);
  margin: 2px 0;
}

/* ═══ HEADER FD-COUNTS — taille légèrement agrandie ════════════ */
.fd-counts span {
  font-size: .68rem !important;
  gap: 2px !important;
}
.fd-counts span b { font-size: .7rem !important; color: rgba(255,255,255,.75) !important; }


/* ═══════════════════════════════════════════════════════════════
   DARK SOULS — VOUS ÊTES MORT
   ═══════════════════════════════════════════════════════════════ */
#darksouls-death {
  position: fixed;
  inset: 0;
  z-index: 9900;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  animation: ds-bg-darken 3.5s ease-out forwards;
  pointer-events: none;
}
@keyframes ds-bg-darken {
  0%   { background: rgba(0,0,0,0); }
  15%  { background: rgba(10,0,0,.6); }
  40%  { background: rgba(5,0,0,.92); }
  80%  { background: rgba(5,0,0,.88); }
  100% { background: rgba(5,0,0,.85); }
}
.ds-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 85% 75% at 50% 50%, transparent 45%, rgba(8,0,0,.9) 100%);
  animation: ds-vignette-in 2s .3s ease-out both;
}
@keyframes ds-vignette-in { from { opacity:0; } to { opacity:1; } }
.ds-text {
  position: relative;
  font-family: 'Cinzel', serif;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900;
  color: #8b0000;
  text-transform: uppercase;
  letter-spacing: .25em;
  text-align: center;
  animation: ds-text-appear 2s .4s ease-out both;
  text-shadow:
    0 0 40px rgba(180,0,0,.5),
    0 0 80px rgba(100,0,0,.3),
    2px 2px 0 rgba(0,0,0,.8);
  border-top: 1px solid rgba(139,0,0,.45);
  border-bottom: 1px solid rgba(139,0,0,.45);
  padding: .35em 1.5em;
}
@keyframes ds-text-appear {
  0%   { opacity:0; transform: scaleX(1.4) scaleY(.9); filter: blur(25px); letter-spacing:.6em; }
  20%  { opacity:.3; filter: blur(10px); }
  45%  { opacity:.85; filter: blur(3px); transform: scaleX(1.06) scaleY(.97); letter-spacing:.3em; }
  65%  { opacity:1; filter: blur(0); transform: scaleX(1) scaleY(1); letter-spacing:.25em; }
  100% { opacity:1; }
}
#darksouls-death.ds-out {
  animation: ds-fade-out .5s ease-in forwards !important;
}
@keyframes ds-fade-out { to { opacity:0; } }


/* ═══════════════════════════════════════════════════════════════
   PANNEAU GAUCHE MAIN — Biblio · Shuffle · GY · Exile (redesign)
   ═══════════════════════════════════════════════════════════════ */
.hand-side-zones {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 6px 5px;
  flex-shrink: 0;
  width: 68px;
}

/* Bouton bibliothèque (pioche) */
.hsz-lib-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 7px 4px;
  border-radius: 8px;
  background: rgba(226,192,105,.08);
  border: 1px solid rgba(226,192,105,.2);
  cursor: pointer;
  transition: all .15s;
  width: 100%;
  color: inherit;
  font-family: inherit;
}
.hsz-lib-btn:hover { background: rgba(226,192,105,.18); border-color: rgba(226,192,105,.45); }
.hsz-lib-btn .hsz-icon { font-size: 1.3rem; }
.hsz-lib-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: .95rem;
  font-weight: 700;
  color: #e2c069;
  line-height: 1;
}

/* Bouton shuffle */
.hsz-action-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border-radius: 6px;
  background: rgba(80,150,255,.08);
  border: 1px solid rgba(80,150,255,.2);
  cursor: pointer;
  transition: all .15s;
  width: 100%;
  color: rgba(255,255,255,.55);
  font-size: .6rem;
  font-family: inherit;
  justify-content: center;
}
.hsz-action-btn:hover { background: rgba(80,150,255,.2); color: rgba(150,200,255,.9); border-color: rgba(80,150,255,.5); }
.hsz-icon-sm { font-size: .9rem; }
.hsz-label-sm { font-size: .55rem; text-transform: uppercase; letter-spacing: .05em; }

/* Zones drop GY + Exile */
.hsz-drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 7px 4px;
  border-radius: 8px;
  background: rgba(0,0,0,.5);
  border: 1px dashed rgba(255,255,255,.12);
  cursor: pointer;
  transition: all .15s;
  width: 100%;
  user-select: none;
}
.hsz-drop-zone:hover { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.3); }
.hsz-drop-zone.drag-over {
  background: rgba(226,192,105,.15) !important;
  border-color: rgba(226,192,105,.6) !important;
  transform: scale(1.04);
}
.hsz-drop-zone .hsz-icon { font-size: 1.2rem; line-height: 1; }
.hsz-drop-zone .hsz-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: .95rem;
  font-weight: 700;
  color: #e2c069;
  line-height: 1;
}
.hsz-label {
  font-size: .48rem;
  color: rgba(255,255,255,.3);
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
}


/* ═══════════════════════════════════════════════════════════════
   ANIMATION AU JEU D'UNE CARTE — glow + lift + fade
   ═══════════════════════════════════════════════════════════════ */

/* Carte normale (créature, sort, artefact, enchantement) — glow doré */
@keyframes card-play-glow {
  0%   { transform: scale(1)    translateY(0);     opacity: 1; box-shadow: 0 0 0 rgba(226,192,105,0); }
  30%  { transform: scale(1.08) translateY(-8px);  opacity: 1; box-shadow: 0 0 30px rgba(226,192,105,.7), 0 0 60px rgba(226,192,105,.3); }
  100% { transform: scale(0.9)  translateY(-22px); opacity: 0; box-shadow: 0 0 0 transparent; }
}
.hand-card.playing {
  animation: card-play-glow .35s ease-out forwards !important;
  pointer-events: none !important;
  z-index: 999 !important;
  position: relative !important;
}

/* Terrain — glow vert plus discret */
@keyframes land-play-glow {
  0%   { transform: scale(1)    translateY(0);     opacity: 1; box-shadow: 0 0 0; }
  30%  { transform: scale(1.06) translateY(-6px);  opacity: 1; box-shadow: 0 0 25px rgba(76,175,80,.7), 0 0 50px rgba(76,175,80,.25); }
  100% { transform: scale(0.9)  translateY(-20px); opacity: 0; box-shadow: 0 0 0; }
}
.hand-card.playing-land {
  animation: land-play-glow .35s ease-out forwards !important;
  pointer-events: none !important;
  z-index: 999 !important;
  position: relative !important;
}


/* ═══════════════════════════════════════════════════════════════
   CHRONIQUE DE LA PARTIE — Journal redesign
   ═══════════════════════════════════════════════════════════════ */

/* ── Titre ─────────────────────────────────────────────────── */
.log-title {
  font-family: 'Cinzel', serif !important;
  font-size: .6rem !important;
  font-weight: 700 !important;
  letter-spacing: .2em !important;
  text-transform: uppercase !important;
  color: rgba(226,192,105,.7) !important;
  padding: 8px 10px 7px !important;
  border-bottom: 1px solid rgba(226,192,105,.15) !important;
  background: rgba(226,192,105,.04) !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

/* ── Container entrées ─────────────────────────────────────── */
.log-entries {
  gap: 1px !important;
  padding: 6px 0 !important;
  background: rgba(4,3,12,.6) !important;
}

/* ── Entrée de base ────────────────────────────────────────── */
.log-entry {
  font-size: .68rem !important;
  line-height: 1.45 !important;
  padding: 2px 10px !important;
  border-radius: 0 !important;
  color: rgba(210,205,230,.65) !important;
  border-left: 2px solid transparent !important;
  word-break: break-word !important;
  transition: background .1s !important;
}
.log-entry:hover { background: rgba(255,255,255,.025) !important; }

/* ── Séparateur de tour ────────────────────────────────────── */
.log-entry.log-turn {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 2px !important;
  padding: 6px 8px !important;
  margin: 5px 0 2px !important;
  background: rgba(226,192,105,.06) !important;
  border-left: none !important;
  border-top: 1px solid rgba(226,192,105,.12) !important;
  border-bottom: 1px solid rgba(226,192,105,.12) !important;
  color: #e2c069 !important;
  font-family: 'Cinzel', serif !important;
  text-transform: uppercase !important;
}
/* Ligne 1 : — TOUR N — */
.lt-row1 {
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
  width: 100% !important;
  justify-content: center !important;
}
/* Ligne 2 : NOM [durée] */
.lt-row2 {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  gap: 4px !important;
}
.lt-dash     { color: rgba(226,192,105,.35); font-size: .5rem; letter-spacing: .05em; white-space: nowrap; }
.lt-label    { color: rgba(226,192,105,.85); font-size: .58rem; letter-spacing: .14em; white-space: nowrap; font-weight: 700; }
.lt-player   { color: #f0dea0; font-size: .62rem; letter-spacing: .06em; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.lt-duration { color: rgba(226,192,105,.55); font-size: .52rem; letter-spacing: .04em; font-family: 'JetBrains Mono', monospace; white-space: nowrap; flex-shrink: 0; }

/* ── Types d'entrées ────────────────────────────────────────── */

/* Jouer une carte — blanc pur, légèrement accentué */
.log-entry.log-play {
  color: rgba(240,235,255,.92) !important;
  font-weight: 600 !important;
  border-left-color: rgba(180,140,255,.5) !important;
  background: rgba(160,120,255,.04) !important;
}

/* Combat / attaque — orange */
.log-entry.log-combat {
  color: rgba(255,185,100,.88) !important;
  font-weight: 600 !important;
  border-left-color: rgba(255,140,50,.45) !important;
  background: rgba(255,120,30,.03) !important;
}

/* Dégâts reçus — rouge */
.log-entry.log-damage {
  color: rgba(235,100,100,.95) !important;
  font-weight: 700 !important;
  border-left-color: rgba(220,60,60,.55) !important;
  background: rgba(180,40,40,.05) !important;
}

/* Gain de vie — vert */
.log-entry.log-heal {
  color: rgba(110,210,120,.9) !important;
  font-weight: 600 !important;
  border-left-color: rgba(76,175,80,.5) !important;
  background: rgba(60,150,60,.04) !important;
}

/* Victoire */
.log-entry.log-victory {
  color: #e2c069 !important;
  font-weight: 700 !important;
  font-family: 'Cinzel', serif !important;
  border-left-color: #e2c069 !important;
  background: rgba(226,192,105,.08) !important;
  letter-spacing: .05em !important;
}

/* Mort / poison */
.log-entry.log-death  { color: rgba(200,80,80,.9) !important; font-weight: 700 !important; border-left-color: rgba(180,50,50,.5) !important; }
.log-entry.log-poison { color: rgba(120,210,120,.8) !important; border-left-color: rgba(80,180,80,.4) !important; }

/* Tokens créés — vert doux */
.log-entry.log-token {
  color: rgba(100,200,120,.85) !important;
  border-left-color: rgba(76,175,80,.4) !important;
  font-style: italic !important;
}

/* Capacité activée — violet */
.log-entry.log-ability {
  color: rgba(180,130,255,.85) !important;
  border-left-color: rgba(150,100,230,.4) !important;
  background: rgba(130,90,200,.03) !important;
}

/* Pioche — bleu clair */
.log-entry.log-draw {
  color: rgba(120,170,240,.8) !important;
  border-left-color: rgba(100,150,220,.35) !important;
}

/* Scry / chercher — bleu-violet */
.log-entry.log-scry {
  color: rgba(140,160,240,.8) !important;
  border-left-color: rgba(120,140,220,.35) !important;
  font-style: italic !important;
}

/* Tap / engage — gris-doré */
.log-entry.log-tap    { color: rgba(190,175,130,.65) !important; border-left-color: rgba(190,175,130,.25) !important; }
.log-entry.log-untap  { color: rgba(150,175,180,.65) !important; border-left-color: rgba(150,175,180,.25) !important; }

/* Exil */
.log-entry.log-exile {
  color: rgba(200,150,255,.8) !important;
  border-left-color: rgba(180,120,240,.4) !important;
}

/* Cimetière / défausse */
.log-entry.log-graveyard {
  color: rgba(160,140,170,.7) !important;
  border-left-color: rgba(140,120,150,.3) !important;
}

/* Shuffle */
.log-entry.log-shuffle { color: rgba(160,165,185,.6) !important; font-style: italic !important; }

/* Dé */
.log-entry.log-dice {
  color: rgba(220,200,120,.85) !important;
  font-weight: 600 !important;
  border-left-color: rgba(220,190,80,.4) !important;
}

/* Bilan de tour */
.log-entry.log-recap {
  color: rgba(180,165,120,.65) !important;
  font-style: italic !important;
  font-size: .63rem !important;
}

/* FoF */
.log-entry.log-fof { color: rgba(200,130,255,.8) !important; border-left-color: rgba(180,100,240,.4) !important; }

/* Duplication de carte (⧉) — mauve, mis en évidence pour bien ressortir
   dans la Chronique (texte + bordure + fond teintés, en gras). */
.log-entry.log-duplicate {
  color: #d9a3ec !important;
  font-weight: 700 !important;
  border-left-color: #b96fd1 !important;
  background: rgba(190, 110, 230, .1) !important;
  letter-spacing: .02em !important;
}

/* ── Scrollbar Chronique ───────────────────────────────────── */
.log-entries::-webkit-scrollbar { width: 3px !important; }
.log-entries::-webkit-scrollbar-thumb { background: rgba(226,192,105,.18) !important; border-radius: 2px !important; }


/* ═══════════════════════════════════════════════════════════════
   PIOCHE — Bouton card-back ornemental
   ═══════════════════════════════════════════════════════════════ */

/* Neutraliser les anciens styles hsz-lib-btn sur btn-draw */
.hand-side-zones .hsz-lib-btn { display: none !important; }

.btn-draw {
  width: 58px !important;
  height: 82px !important;
  border-radius: 5px !important;
  padding: 6px 4px 5px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: space-between !important;
  position: relative !important;
  overflow: hidden !important;
  flex-shrink: 0 !important;
  cursor: pointer !important;
  border: 1px solid rgba(226,192,105,.45) !important;
  background:
    radial-gradient(120% 90% at 50% 50%, transparent 35%, rgba(0,0,0,.6) 100%),
    radial-gradient(60% 40% at 50% 50%, rgba(226,192,105,.08), transparent 75%),
    repeating-linear-gradient(135deg, rgba(226,192,105,.04) 0px, rgba(226,192,105,.04) 1px, transparent 1px, transparent 6px),
    linear-gradient(160deg, #1a1230 0%, #0a0617 50%, #060410 100%) !important;
  box-shadow:
    2px 2px 0 -1px rgba(226,192,105,.18),
    3px 3px 0 -1px rgba(0,0,0,.6),
    4px 4px 0 -1px rgba(226,192,105,.12),
    5px 5px 0 -1px rgba(0,0,0,.5),
    0 8px 20px rgba(0,0,0,.7),
    0 0 18px rgba(226,192,105,.18),
    inset 0 1px 0 rgba(255,255,255,.08),
    inset 0 -1px 0 rgba(0,0,0,.5) !important;
  transition: transform .18s cubic-bezier(.2,.8,.4,1), box-shadow .18s, filter .18s !important;
}

/* Cadre intérieur doré */
.btn-draw::before {
  content: '' !important;
  position: absolute !important;
  inset: 4px !important;
  border: 1px solid rgba(226,192,105,.32) !important;
  border-radius: 3px !important;
  pointer-events: none !important;
  box-shadow: inset 0 0 8px rgba(226,192,105,.06) !important;
}

/* 4 points dorés aux coins */
.btn-draw::after {
  content: '' !important;
  position: absolute !important;
  inset: 0 !important;
  pointer-events: none !important;
  background:
    radial-gradient(circle at 6px 6px,                           rgba(226,192,105,.55) 0 1px, transparent 1.5px),
    radial-gradient(circle at calc(100% - 6px) 6px,              rgba(226,192,105,.55) 0 1px, transparent 1.5px),
    radial-gradient(circle at 6px calc(100% - 6px),              rgba(226,192,105,.55) 0 1px, transparent 1.5px),
    radial-gradient(circle at calc(100% - 6px) calc(100% - 6px), rgba(226,192,105,.55) 0 1px, transparent 1.5px) !important;
}

/* Flèche du haut */
.btn-draw .draw-icon {
  position: relative !important;
  z-index: 1 !important;
  font-size: .9rem !important;
  color: #e2c069 !important;
  filter: drop-shadow(0 0 4px rgba(226,192,105,.5)) !important;
  line-height: 1 !important;
  margin-top: 2px !important;
}

/* Label PIOCHE avec sigil ✦ au-dessus */
.btn-draw .draw-label {
  display: block !important;
  position: relative !important;
  z-index: 1 !important;
  font-family: 'Cinzel', serif !important;
  font-weight: 700 !important;
  font-size: .52rem !important;
  letter-spacing: .14em !important;
  text-transform: uppercase !important;
  background: linear-gradient(180deg, #fbeec0 0%, #e2c069 55%, #8a6326 100%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  color: transparent !important;
  line-height: 1 !important;
  margin: 0 !important;
}
.btn-draw .draw-label::before {
  content: '✦' !important;
  display: block !important;
  font-style: italic !important;
  font-size: 1rem !important;
  color: #b88a31 !important;
  -webkit-text-fill-color: #b88a31 !important;
  opacity: .85 !important;
  line-height: 1 !important;
  margin-bottom: 2px !important;
  text-align: center !important;
}

/* Compteur */
.btn-draw .draw-count {
  position: relative !important;
  z-index: 1 !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: .78rem !important;
  font-weight: 700 !important;
  background: linear-gradient(180deg, #ffeacc 0%, #e6c98a 60%, #a07a2a 100%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  color: transparent !important;
  letter-spacing: .02em !important;
  padding-top: 2px !important;
  border-top: 1px solid rgba(226,192,105,.18) !important;
  width: 70% !important;
  text-align: center !important;
  line-height: 1 !important;
}

/* Hover */
.btn-draw:hover {
  transform: translateY(-3px) !important;
  filter: brightness(1.08) !important;
  box-shadow:
    2px 2px 0 -1px rgba(226,192,105,.25),
    3px 3px 0 -1px rgba(0,0,0,.6),
    4px 4px 0 -1px rgba(226,192,105,.18),
    5px 5px 0 -1px rgba(0,0,0,.5),
    0 14px 28px rgba(0,0,0,.8),
    0 0 30px rgba(226,192,105,.35),
    inset 0 1px 0 rgba(255,255,255,.1),
    inset 0 -1px 0 rgba(0,0,0,.5) !important;
}
.btn-draw:active { transform: translateY(-1px) scale(.98) !important; }

/* État LOW (≤10 cartes) */
.btn-draw.low {
  border-color: rgba(226,192,105,.65) !important;
  animation: draw-pulse 2.4s ease-in-out infinite !important;
}
@keyframes draw-pulse {
  0%,100% { box-shadow: 2px 2px 0 -1px rgba(226,192,105,.2),3px 3px 0 -1px rgba(0,0,0,.6),0 8px 20px rgba(0,0,0,.7),0 0 18px rgba(226,192,105,.25),inset 0 1px 0 rgba(255,255,255,.08); }
  50%     { box-shadow: 2px 2px 0 -1px rgba(226,192,105,.3),3px 3px 0 -1px rgba(0,0,0,.6),0 8px 20px rgba(0,0,0,.7),0 0 28px rgba(226,192,105,.5),inset 0 1px 0 rgba(255,255,255,.12); }
}

/* État EMPTY (0 cartes) */
.btn-draw.empty {
  border-color: rgba(196,62,92,.4) !important;
  cursor: not-allowed !important;
  animation: none !important;
}
.btn-draw.empty::before { border-color: rgba(196,62,92,.3) !important; }
.btn-draw.empty .draw-icon { color: rgba(196,62,92,.6) !important; filter: none !important; }
.btn-draw.empty .draw-label,
.btn-draw.empty .draw-count { background: none !important; -webkit-text-fill-color: rgba(196,62,92,.7) !important; }
.btn-draw.empty:hover { transform: none !important; filter: none !important; }


/* ═══════════════════════════════════════════════════════════════
   ZONE-STRIP + PIOCHE CARD-BACK — tailles et espacements finaux
   ═══════════════════════════════════════════════════════════════ */

/* Conteneur principal : strip + pioche + main en ligne */
.hand-area {
  display: flex !important;
  align-items: flex-end !important;
  gap: 8px !important;
  padding: 0 12px 6px !important;
}

/* ── Zone-strip : 4 boutons, 90px × 152px total ─────────────── */
.zone-strip {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  width: auto !important;
  height: 152px !important;
  flex-shrink: 0 !important;
  position: relative !important;
  z-index: 8 !important;
}

/* Chaque rangée (btn principal + action icon) */
.zs-row {
  display: flex !important;
  align-items: stretch !important;
  gap: 3px !important;
  height: 32px !important;
  flex-shrink: 0 !important;
}

/* Chaque bouton uniforme ×32px */
.zs-btn {
  flex: 1 !important;
  min-width: 70px !important;
  height: 32px !important;
  min-height: 32px !important;
  max-height: 32px !important;
  flex-shrink: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 1px !important;
  border-radius: 5px !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  font-family: 'JetBrains Mono', monospace !important;
  cursor: pointer !important;
  padding: 3px 6px !important;
  background: rgba(0,0,0,.4) !important;
  color: rgba(255,255,255,.85) !important;
  transition: filter .12s, border-color .12s !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05) !important;
  user-select: none !important;
}
.zs-btn:hover { filter: brightness(1.35) !important; border-color: rgba(255,255,255,.35) !important; }
.zs-btn:active { filter: brightness(.9) !important; }

/* Petits boutons d'action à droite (👁 / ½) */
.zsa-btn {
  width: 22px !important;
  height: 32px !important;
  flex-shrink: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 4px !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  background: rgba(255,255,255,.06) !important;
  color: rgba(255,255,255,.65) !important;
  font-size: .72rem !important;
  cursor: pointer !important;
  transition: background .12s, color .12s !important;
  padding: 0 !important;
  line-height: 1 !important;
}
.zsa-btn:hover {
  background: rgba(255,255,255,.14) !important;
  color: rgba(255,255,255,.95) !important;
}
.zsa-half {
  font-size: .85rem !important;
  font-weight: 700 !important;
  color: rgba(220,170,80,.8) !important;
}
.zsa-half:hover { color: #e2c069 !important; }
.zsa-exile-half { color: rgba(180,140,255,.8) !important; }
.zsa-exile-half:hover { color: rgba(220,190,255,.95) !important; }
.zsa-rand { color: rgba(255,126,200,.75) !important; }
.zsa-rand:hover { color: #ff8ecf !important; }

/* Label (haut) */
.zs-label {
  font-size: .52rem !important;
  letter-spacing: .08em !important;
  text-transform: uppercase !important;
  line-height: 1 !important;
  opacity: .8 !important;
  font-family: 'Cinzel', serif !important;
}

/* Valeur (bas) */
.zs-value {
  font-size: .82rem !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
  line-height: 1 !important;
  font-variant-numeric: tabular-nums !important;
  font-family: 'JetBrains Mono', monospace !important;
}

/* Couleurs sémantiques */
.zs-btn.zs-lib    { background:rgba(50,90,160,.22)!important; border-color:rgba(80,130,220,.3)!important; color:#8bb8e8!important; }
.zs-btn.zs-shuffle{ background:rgba(60,110,200,.18)!important; border-color:rgba(80,140,240,.28)!important; color:#b6a3ff!important; }
.zs-btn.zs-gy     { background:rgba(160,30,30,.28)!important; border-color:rgba(220,60,60,.35)!important; color:#e98ba3!important; }
.zs-btn.zs-exile  { background:rgba(150,100,10,.25)!important; border-color:rgba(226,192,105,.35)!important; color:#e2c069!important; }
.zs-btn.zs-outside{ background:rgba(60,60,80,.3)!important; border-color:rgba(140,130,180,.35)!important; color:#b0a8d0!important; }

/* Drag-over pour les drop zones */
.zs-btn.drag-over {
  filter: brightness(1.6) !important;
  border-color: rgba(226,192,105,.8) !important;
  transform: scale(1.04) !important;
}


/* ═══════════════════════════════════════════════════════════════
   MOBILE — Responsive ≤768px
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* Board : 1 colonne empilée */
  .game-board {
    grid-template-columns: 1fr !important;
    grid-template-rows: repeat(4, auto) !important;
    gap: 4px !important;
    padding: 4px !important;
    padding-bottom: 160px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* Ma zone : toujours en bas */
  .player-zone.is-me { order: 99 !important; }

  /* Zones adversaires : plus compactes */
  .player-zone:not(.is-me) { min-height: 130px !important; }

  /* Rangées de cartes : moins hautes sur mobile */
  .card-row { min-height: 56px !important; }
  .zone-card { width: 50px !important; height: 70px !important; }
  .zone-card img { width: 100% !important; height: 100% !important; object-fit: cover !important; }

  /* Header : compact, retour à la ligne */
  .game-header {
    flex-wrap: wrap !important;
    gap: 4px !important;
    padding: 4px 6px !important;
    min-height: unset !important;
  }
  .fd-header { gap: 4px !important; padding: 4px 6px !important; flex-wrap: wrap !important; }
  .fd-btn { min-width: 28px !important; min-height: 28px !important; font-size: .6rem !important; padding: 2px 5px !important; }
  .mana-btn { width: 20px !important; height: 20px !important; font-size: .55rem !important; }

  /* Main : scroll horizontal */
  #my-hand {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    justify-content: flex-start !important;
    padding: 4px 8px !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
  }
  #my-hand::-webkit-scrollbar { display: none !important; }
  #my-hand .hand-card {
    flex-shrink: 0 !important;
    width: 64px !important;
    height: 90px !important;
  }
  #my-hand .hand-card img { width: 100% !important; height: 100% !important; object-fit: cover !important; }

  /* Journal : réduit sur mobile */
  .game-log-panel { width: 0 !important; min-width: 0 !important; }
  .game-log-panel.log-open { width: 260px !important; }

  /* Overlay zoom désactivé sur mobile (trop petit) */
  #card-zoom { display: none !important; }

  /* Boutons touch-friendly */
  .btn-game { min-height: 36px !important; }
  .header-actions .btn-game { height: auto !important; max-height: none !important; min-height: 36px !important; font-size: .75rem !important; padding: 6px 10px !important; }
  .zs-btn   { min-height: 30px !important; font-size: .62rem !important; }
  .zsa-btn  { min-height: 28px !important; }
}

/* Deux commandants (Partner) — écrans réellement trop étroits (téléphones
   en portrait) : les deux anciennes cages .cmd-cage passent en colonne au
   lieu de côte à côte, mais restent TOUTES LES DEUX visibles (jamais
   masquées derrière une pastille). Au-dessus de ce seuil, elles restent
   côte à côte (voir .cmd-cages-container, règle de base). Chaque cage garde
   sa bordure/dimensions d'origine (game.css, jamais modifié) — seule la
   deuxième cage échange sa séparation gauche contre une séparation haute
   pour un empilement propre. */
@media (max-width: 400px) {
  .cmd-cages-container {
    flex-direction: column;
    align-items: center;
  }
  .cmd-cages-container .cmd-cage + .cmd-cage {
    border-left: none;
    margin-left: 0;
    padding-left: 0;
    border-top: 1px solid rgba(212,175,55,.25);
    margin-top: 4px;
    padding-top: 4px;
  }
}

/* ═══ Header intelligent — passe sur 2 lignes si trop compressé ════
   Pas de breakpoint fixe : s'adapte à N'IMPORTE QUELLE largeur ou niveau
   de zoom navigateur (le zoom réduit la largeur CSS effective disponible,
   donc le wrap se déclenche naturellement dès que le contenu déborde).
   grid-template-rows passe de 56px fixe à auto pour laisser le header
   grandir sur 2 lignes ; --header-h (mesuré en JS, game-features.js) est
   réutilisé partout où une hauteur de header était supposée fixe. ═══ */
#screen-game { grid-template-rows: auto 1fr !important; }

.game-header {
  flex-wrap: wrap !important;
  row-gap: 4px !important;
  min-height: 56px !important;
  padding-top: 6px !important;
  padding-bottom: 6px !important;
}
.header-actions { flex-wrap: wrap !important; row-gap: 4px !important; }
.turn-info, .phase-track, #chess-clock-header, #game-timer, #spectator-count,
.btn-lexicon-header, #turn-timer-wrap {
  flex-shrink: 0 !important;
}

/* Hauteur de board recalée sur la hauteur RÉELLE du header (mesurée en JS
   via ResizeObserver → --header-h), au lieu du 56px fixe supposé par défaut. */
.game-board {
  max-height: calc(100vh - var(--header-h, 56px) - 185px) !important;
}
#war-banner { top: calc(var(--header-h, 56px) + 6px) !important; }

/* ── Lignes de combat (attaquant → carte ciblée) ─────────────────
   Overlay SVG plein écran, pointer-events désactivés — se contente de
   dessiner par-dessus le plateau. Alimenté par renderCombatLinks (game.js),
   qui recalcule les coordonnées à chaque render/resize/scroll. ──────── */
#combat-links-svg {
  position: fixed;
  inset: 0;
  z-index: 500;
  pointer-events: none;
}
.combat-link-line {
  /* --link-color/--link-glow-a/--link-glow-b posées inline par
     renderCombatLinks (game.js), une teinte par joueur attaquant — repli
     rouge si jamais l'inline manque. */
  stroke: var(--link-color, #e05555);
  stroke-width: 2.5px;
  opacity: .55;
  stroke-dasharray: 9 7;
  transition: opacity .18s ease, stroke-width .18s ease;
  animation:
    combat-link-glow 1.8s ease-in-out infinite,
    combat-link-flow 3.4s linear infinite;
}
/* Aura qui respire — la profondeur du glow oscille dans le temps pour
   rendre la ligne moins plate qu'un simple trait uni. */
@keyframes combat-link-glow {
  0%, 100% { filter: drop-shadow(0 0 2px var(--link-glow-a, rgba(224, 85, 85, .35))); }
  50%      { filter: drop-shadow(0 0 9px var(--link-glow-b, rgba(224, 85, 85, .95))); }
}
/* Survol d'une carte impliquée dans un combat (renderCombatLinks) : sa
   ligne ressort, les autres s'estompent pour qu'on identifie l'attaque
   sans avoir à suivre le tracé sur tout le plateau. */
.combat-link-dimmed {
  opacity: .1 !important;
  animation-play-state: paused;
}
.combat-link-highlight {
  opacity: 1 !important;
  stroke-width: 3.5px !important;
}
/* Flux des pointillés — défile LENTEMENT de l'attaquant vers la cible
   (dans le sens x1,y1 → x2,y2, donc vers la flèche). */
@keyframes combat-link-flow {
  from { stroke-dashoffset: 0; }
  to   { stroke-dashoffset: -32; }
}

/* ── Récap de dégâts en bout de flèche (renderCombatLinks, game.js) ─────
   Un badge par joueur ciblé directement (pas par carte bloquante), posé
   juste à côté du point de convergence des lignes. Positions inline
   (left/top) posées en JS à chaque render, comme .board-ping-dot. */
#combat-damage-badges {
  position: fixed;
  inset: 0;
  z-index: 501;
  pointer-events: none;
}
.combat-damage-badge {
  position: absolute;
  transform: translate(0, -50%);
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(11, 9, 24, .88);
  border: 1.5px solid #e05555;
  color: #ff8888;
  font-family: 'JetBrains Mono', monospace;
  font-size: .78rem;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 0 8px rgba(224, 85, 85, .5);
}

/* ── Ping du board (molette maintenue) — point coloré éphémère visible de
   tous (game.js, spawnBoardPing/ping_broadcast). Un point par tick pendant
   le drag → la succession de points qui s'estompent chacun individuellement
   forme la traînée, pas un vrai tracé SVG. Positionné en fixed sur les
   coordonnées écran résolues à chaque tick, auto-supprimé après 650ms
   (timeout JS, pas de handler d'animationend nécessaire). ────────────── */
.board-ping-dot {
  position: fixed;
  z-index: 501; /* juste au-dessus des lignes de combat (500) */
  pointer-events: none;
  left: 0;
  top: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ping-color, #e2c069);
  box-shadow: 0 0 10px 3px var(--ping-color, #e2c069);
  animation: board-ping-dot-fade .65s ease-out forwards;
}
@keyframes board-ping-dot-fade {
  0%   { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(.35); opacity: 0; }
}

/* ── Pioche card-back : 95px × 152px ────────────────────────── */
/* Override les valeurs précédentes (58×82) */
.btn-draw {
  width: 95px !important;
  height: 152px !important;
}

/* Éléments internes agrandis pour respirer dans 152px */
.btn-draw .draw-icon       { font-size: 1.2rem !important; margin-top: 6px !important; }
.btn-draw .draw-label::before { font-size: 1.4rem !important; }
.btn-draw .draw-label      { font-size: .68rem !important; }
.btn-draw .draw-count      { font-size: 1.05rem !important; padding-top: 4px !important; width: 60% !important; }

/* Neutraliser anciens styles hand-side-zones */
.hand-side-zones { display: none !important; }


/* ═══════════════════════════════════════════════════════════════
   INTRO-PLAYING — board invisible pendant l'animation de début
   ═══════════════════════════════════════════════════════════════ */
/* Double protection : même si le blackout rate, le board reste caché */
body.intro-playing .game-board,
body.intro-playing .game-header,
body.intro-playing .game-log-panel,
body.intro-playing .my-hand-zone {
  opacity: 0 !important;
  pointer-events: none !important;
}
/* Le blackout et l'overlay d'intro restent visibles */
body.intro-playing #game-blackout,
body.intro-playing #game-intro-overlay { opacity: 1 !important; }


/* ═══════════════════════════════════════════════════════════════
   PIOCHE — suppression de la flèche ↓ et de la barre séparatrice
   ═══════════════════════════════════════════════════════════════ */
.btn-draw .draw-icon { display: none !important; }
.btn-draw .draw-count { border-top: none !important; padding-top: 0 !important; }


/* ═══════════════════════════════════════════════════════════════
   FOOTER BAR SOUS LE BATTLEFIELD — masqué (remplacé par le header FD)
   ═══════════════════════════════════════════════════════════════ */
.pz-footer { display: none !important; }
/* ── Historique des 5 dernières cartes jouées — bande sous le header ── */
.recent-plays-bar {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  background: rgba(0,0,0,.28);
  border-bottom: 1px solid rgba(226,192,105,.1);
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
  min-height: 34px;
}
.recent-plays-bar::-webkit-scrollbar { display: none; }
.recent-play-thumb {
  width: 22px;
  height: 30px;
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid rgba(226,192,105,.18);
  cursor: pointer;
  transition: transform .12s;
}
.recent-play-thumb:hover { transform: scale(1.8) translateY(-6px); z-index: 20; position: relative; }
.recent-play-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; display: block; }


/* ═══════════════════════════════════════════════════════════════
   SURBRILLANCE TOUR — s'arrête au bas du battlefield
   Ne déborde plus sur la zone de main
   ═══════════════════════════════════════════════════════════════ */
/* La surbrillance dorée reste dans la zone joueur uniquement */
/* game.css utilise maintenant inset shadow → plus besoin d'override spécifique */
.player-zone.active.is-me {
  /* Conserve juste une légère différenciation pour le joueur local */
  border-color: rgba(226,192,105,1) !important;
}
/* La main flottante (fixed) ne reçoit jamais le glow actif */
.my-hand-zone.in-game {
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
}


/* ═══════════════════════════════════════════════════════════════
   CENTRAGE — uniquement quand .in-game (jamais sur accueil/lobby)
   NE PAS forcer display:flex sans .in-game : game.css cache par défaut
   ═══════════════════════════════════════════════════════════════ */
.my-hand-zone.in-game {
  align-items: center !important;
}
.my-hand-zone.in-game .hand-area {
  justify-content: center !important;
  /* Décalage gauche pour centrer le fan de cartes sur la ligne médiane du board */
  /* zone-strip(~96px) + gap(10px) + btn-draw(95px) + gap(10px) = ~211px → /2 ≈ -106px */
  margin-left: -106px;
}

/* ── Pioche : centrer le contenu maintenant que la flèche est cachée ─ */
.btn-draw {
  justify-content: center !important;
  gap: 10px !important;
}


/* ═══════════════════════════════════════════════════════════════
   BOUTONS HEADER — fd-btn-lg (plus visibles)
   ═══════════════════════════════════════════════════════════════ */
.fd-btn.fd-btn-lg {
  width: 28px !important;
  height: 28px !important;
  font-size: .95rem !important;
  border-radius: 6px !important;
}

/* ── Boutons action header — taille compacte, croissance limitée au zoom ─ */
.header-actions .btn-game {
  font-size: 11px !important;
  padding: 3px 9px !important;
  height: 26px !important;
  max-height: 26px !important;
  line-height: 1 !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
}

/* ══════════════════════════════════════════════════════════════
   CARTES PAYSAGE — Room, Split, Aftermath (layout: split/aftermath)
   Untappée = horizontale · Tappée = portrait (rotation 90° = portrait)
   ══════════════════════════════════════════════════════════════ */

/* ── Dans la main ─────────────────────────────────────────── */
.hand-card.is-landscape {
  width: 175px !important;
  height: 122px !important;
  margin-left: -30px !important;
}
.hand-card.is-landscape:first-child { margin-left: 0 !important; }
.hand-card.is-landscape img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

/* ── Sur le battlefield — dimensions inversées par rangée ─── */
/* .row-crea : portrait 100×140 → paysage 140×100 */
.row-crea .zone-card.is-landscape { width: 140px !important; height: 100px !important; }
/* .row-art : portrait 80×112 → paysage 112×80 */
.row-art  .zone-card.is-landscape { width: 112px !important; height: 80px !important; }
/* .row-sort : idem row-art */
.row-sort .zone-card.is-landscape { width: 112px !important; height: 80px !important; }
/* .row-land : portrait 65×91 → paysage 91×65 */
.row-land .zone-card.is-landscape { width: 91px !important;  height: 65px !important; }

/* Carte paysage tappée : rotate(90°) la ramène en portrait — ajuster les marges */
.zone-card.is-landscape.tapped {
  transform: rotate(90deg) !important;
  margin: 20px 30px !important;
}
.zone-card.is-landscape.tapped:hover {
  transform: rotate(90deg) scale(1.07) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   Room cards (DSK) — image portrait Scryfall, rotation +90° pour
   affichage horizontal (texte lisible). Conteneur = landscape (is-landscape).
   ═══════════════════════════════════════════════════════════════════ */

/* Board — conteneur landscape, image portrait tournée +90° (sens horaire) */
.zone-card.is-landscape.is-room {
  overflow: hidden;
  position: relative;
}
.zone-card.is-landscape.is-room > img {
  position: absolute;
  top: 50%;
  left: 50%;
  object-fit: cover;
}
.row-crea .zone-card.is-landscape.is-room > img {
  width: 100px; height: 140px;   /* dimensions inversées du conteneur 140×100 */
  transform: translate(-50%, -50%) rotate(90deg);
}
.row-art  .zone-card.is-landscape.is-room > img,
.row-sort .zone-card.is-landscape.is-room > img {
  width: 80px; height: 112px;    /* inversées du conteneur 112×80 */
  transform: translate(-50%, -50%) rotate(90deg);
}
.row-land .zone-card.is-landscape.is-room > img {
  width: 65px; height: 91px;     /* inversées du conteneur 91×65 */
  transform: translate(-50%, -50%) rotate(90deg);
}

/* Main — .room-wrap couvre tout le hand-card (évite que play-hint remplisse le flex container) */
.hand-card.is-landscape.is-room {
  position: relative;
  overflow: hidden;
}
/* Le wrapper absorbe tout l'espace, l'img pivote à l'intérieur */
.hand-card.is-landscape.is-room .room-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.hand-card.is-landscape.is-room .room-wrap img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 122px; height: 175px;   /* inversées du conteneur 175×122 */
  transform: translate(-50%, -50%) rotate(90deg);
  object-fit: cover;
  border-radius: 0 !important;
}

/* Zoom in-game (.zoom-room-card) — 500×358 landscape, rotation via margin */
/* img portrait 358×500, décalé (71px,-71px) puis rotate(90deg) → visual 500×358 */
#game-card-zoom.zoom-room-card {
  /* !important nécessaire : la règle générique "#game-card-zoom { width:
     420px !important }" (FIX #10 plus bas) est plus spécifique en poids de
     déclaration et écrasait sinon ce 500px, recadrant/rognant ~80px de
     l'image pivotée (bug latent pré-existant, découvert en étendant ce
     traitement paysage aux cartes split/aftermath). */
  width: 500px !important;
  height: 358px;
  overflow: hidden;
}
#game-card-zoom.zoom-room-card #game-zoom-img {
  display: block;
  width: 358px !important;
  height: 500px !important;
  margin-left: 71px;    /* centre horizontal : (500-358)/2 = 71px */
  margin-top: -71px;    /* centre vertical   : (358-500)/2 = -71px */
  transform: rotate(90deg);
  transform-origin: center;
  object-fit: cover;
  border-radius: 16px;
}

/* Lobby browser-card — aspect-ratio landscape + rotation +90° */
.browser-card.is-room {
  aspect-ratio: 88 / 63 !important;
  overflow: hidden;
  position: relative;
}
.browser-card.is-room img {
  width: calc(63 / 88 * 100%) !important;
  height: calc(88 / 63 * 100%) !important;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(90deg);
  object-fit: cover;
}

/* ── Icône étoile (main) dans fd-counts ─ */
.fd-star-icon {
  font-size: .8rem;
  display: inline-block;
  transform: rotate(15deg);
  vertical-align: middle;
}


/* ═══════════════════════════════════════════════════════════════
   VICTOIRE — cinématique de fin de partie
   ═══════════════════════════════════════════════════════════════ */
#victory-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: radial-gradient(ellipse at center, rgba(20,15,40,.97) 0%, rgba(0,0,0,.99) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  animation: v-in 1s ease-out;
}
@keyframes v-in { from { opacity:0; } to { opacity:1; } }

.victory-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  position: relative;
  z-index: 2;
}
.victory-crown {
  font-size: 4rem;
  animation: v-crown 1.5s ease-out .3s both;
  filter: drop-shadow(0 0 30px rgba(226,192,105,.8));
}
@keyframes v-crown {
  from { transform: scale(0) rotate(-30deg); opacity:0; }
  60%  { transform: scale(1.15) rotate(5deg); }
  to   { transform: scale(1) rotate(0); opacity:1; }
}
.victory-title {
  font-family: 'Cinzel', serif;
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--gold, #e2c069);
  letter-spacing: .18em;
  text-transform: uppercase;
  text-shadow: 0 0 60px rgba(226,192,105,.7), 0 0 120px rgba(226,192,105,.3);
  animation: v-title 1s ease-out .6s both;
}
@keyframes v-title {
  from { opacity:0; transform: translateY(20px) scale(.9); }
  to   { opacity:1; transform: none; }
}
.victory-winner {
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  color: #fff;
  text-align: center;
  animation: v-title 1s ease-out .9s both;
  line-height: 1.4;
}
.victory-sub {
  font-size: .9rem;
  color: rgba(255,255,255,.5);
  font-weight: 400;
}
.victory-close {
  font-size: .7rem;
  color: rgba(255,255,255,.2);
  letter-spacing: .1em;
  animation: v-title 1s ease-out 1.4s both;
}

/* Particules */
.victory-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.vp {
  position: absolute;
  bottom: -10px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--gold, #e2c069);
  box-shadow: 0 0 6px rgba(226,192,105,.8);
  animation: vp-rise var(--d,3s) ease-in infinite;
}
@keyframes vp-rise {
  from { transform: translateY(0) scale(1); opacity:.9; }
  to   { transform: translateY(-110vh) scale(.3) rotate(720deg); opacity:0; }
}


/* ═══════════════════════════════════════════════════════════════
   COMMANDANT JOUÉ — révélation épique
   ═══════════════════════════════════════════════════════════════ */
#commander-reveal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9700;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(4px);
  pointer-events: auto;  /* cliquable pour fermer */
  cursor: pointer;
  animation: cmd-in .4s ease-out;
}
#commander-reveal-overlay.cmd-fading {
  animation: cmd-out .8s ease-in forwards;
  pointer-events: none;
}
@keyframes cmd-in  { from { opacity:0; transform: scale(.85); } to { opacity:1; transform: scale(1); } }
@keyframes cmd-out { from { opacity:1; } to { opacity:0; transform: scale(1.05); } }

.cmd-reveal-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  position: relative;
  pointer-events: none; /* seul l'overlay capte le clic */
}
.cmd-reveal-title {
  font-family: 'Cinzel', serif;
  color: var(--gold, #e2c069);
  font-size: .95rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-shadow: 0 0 20px rgba(226,192,105,.6);
}
.cmd-reveal-img {
  max-height: 55vh;
  border-radius: 14px;
  box-shadow: 0 0 80px rgba(226,192,105,.5), 0 0 200px rgba(226,192,105,.2);
  animation: cmd-glow 2s ease-in-out infinite alternate;
}
@keyframes cmd-glow {
  from { box-shadow: 0 0 60px rgba(226,192,105,.4), 0 0 120px rgba(226,192,105,.15); }
  to   { box-shadow: 0 0 100px rgba(226,192,105,.8), 0 0 200px rgba(226,192,105,.35); }
}
.cmd-reveal-name {
  font-family: 'Cinzel', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 30px rgba(226,192,105,.5);
}
.cmd-close-hint {
  font-size: .6rem;
  color: rgba(255,255,255,.3);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-top: 4px;
}



/* ═══ ZOOM ÉPINGLÉ — clic droit pour fixer ═════════════════════ */
#game-card-zoom.zoom-pinned,
#game-card-zoom-pinned {
  border-color: rgba(226,192,105,.9) !important;
  box-shadow: 0 0 24px rgba(226,192,105,.5), 0 8px 40px rgba(0,0,0,.85) !important;
  cursor: pointer;
}
#game-card-zoom.zoom-pinned::after,
#game-card-zoom-pinned::after {
  content: '📌 Clic pour fermer';
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: .58rem;
  color: rgba(226,192,105,.75);
  white-space: nowrap;
  pointer-events: none;
  letter-spacing: .06em;
}

/* ═══ HISTORIQUE DE TOUR ════════════════════════════════════════ */
.card-history-bar {
  display: flex;
  gap: 3px;
  align-items: center;
  padding: 4px 8px;
  min-height: 40px;
  overflow-x: auto;
  scrollbar-width: none;
  background: rgba(0,0,0,.35);
  border-top: 1px solid rgba(226,192,105,.12);
  flex-shrink: 0;
}
.card-history-bar::-webkit-scrollbar { display: none; }
.hist-thumb {
  width: 26px;
  height: 36px;
  border-radius: 3px;
  object-fit: cover;
  object-position: 50% 15%;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  flex-shrink: 0;
  border: 1px solid rgba(226,192,105,.2);
  position: relative;
}
.hist-thumb:hover {
  transform: scale(1.7) translateY(-8px);
  box-shadow: 0 6px 16px rgba(0,0,0,.75);
  z-index: 10;
}
.hist-thumb-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(226,192,105,.08);
  font-size: .65rem;
  color: rgba(226,192,105,.4);
}
/* ── Error toast — au-dessus de la zone de main ─────────────── */
#game-error-toast {
  bottom: 260px !important;
}

/* ── Bandeau "En attente mulligan" — juste au-dessus des filtres de main ── */
.mulligan-waiting-banner {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .28rem .75rem;
  background: rgba(10,6,24,.88);
  border: 1px solid rgba(226,192,105,.45);
  border-radius: 6px;
  font-family: 'Cinzel', serif;
  font-size: .7rem;
  color: var(--gold, #e2c069);
  white-space: nowrap;
  width: fit-content;
  margin: 0 auto 3px auto; /* centré horizontalement */
  flex-shrink: 0;
  align-self: center;
}
.mulligan-waiting-banner b { color: #fff; font-weight: 600; }

/* Token dans la barre historique — override les !important de arcanum-rows */
.hist-thumb.token-face {
  width: 26px !important;
  height: 36px !important;
  min-width: 26px !important;
  border-radius: 4px !important;
  flex-shrink: 0 !important;
  padding: 2px !important;
  justify-content: center !important;
}
.hist-thumb.token-face .token-art {
  width: 14px !important;
  height: 14px !important;
  min-width: 14px !important;
  aspect-ratio: 1 !important;
  margin: 0 !important;
  font-size: .6rem;
}
.hist-thumb.token-face .token-art::after {
  font-size: .55rem !important;
}
/* Masquer le nom et le P/T trop grands dans la barre historique */
.hist-thumb.token-face .token-name,
.hist-thumb.token-face .token-pt,
.hist-thumb.token-face .token-type { display: none !important; }

/* ═══ Layout 4 joueurs — rangées proportionnelles ════════════════
   Rows remplissent leur player-zone (flex:1), player-zone remplit
   sa cellule de grille (height:100%). Board borné pour ne pas
   déborder sur la main fixe (bottom:0, ~185px de hauteur).
   ══════════════════════════════════════════════════════════════ */

/* Board : hauteur cadrée + stretch pour remplir les cellules.
   --header-h (mesuré en JS, game-features.js) plutôt que 56px en dur :
   cette règle vient APRÈS celle du header intelligent plus haut et
   l'écrasait, ramenant le calcul à un header supposé sur une seule
   ligne. Dès qu'il passait sur deux lignes (écran étroit, zoom
   navigateur), le bas du plateau glissait sous la main.
   Header sur une ligne : --header-h vaut 56px, rendu inchangé. */
.game-board {
  align-items: stretch !important;
  max-height: calc(100vh - var(--header-h, 56px) - 185px) !important;
}

/* Player zone remplit toute sa cellule de grille */
.player-zone {
  height: 100% !important;
  min-height: 0 !important;
}

/* ── Mode spectateur : pas de main à réserver en bas de l'écran ──────
   Un spectateur n'a pas de #my-hand-zone visible (voir spectator_start,
   game.js) — les deux règles .game-board ci-dessus retirent ~185px de
   hauteur pour une main qui n'existe pas dans ce cas, laissant un bandeau
   vide en bas. Sélecteur plus spécifique (#id + 2 classes) pour l'emporter
   sur les deux quel que soit leur ordre. */
#screen-game.is-spectating .game-board {
  max-height: calc(100vh - var(--header-h, 56px) - 24px) !important;
}

/* Rows : partagent l'espace disponible à parts égales */
.row-crea,
.row-art,
.row-land {
  flex: 1 !important;
  min-height: 60px !important;
  height: auto !important;
  max-height: none !important;
  overflow-y: clip !important;   /* clip ≠ hidden : ne crée pas de BFC, hover visible */
}

/* Cartes légèrement agrandies (38×53 → 47×66) pour mieux remplir les rangées */
.zone-card {
  width: 47px !important;
  height: 66px !important;
}
.zone-card.tapped { margin: 18px 24px !important; }

/* ═══ FIX #9 — Modaux bibliothèque / cimetière / exil plus grands ══ */
.zone-modal-box {
  width: 97% !important;
  max-width: 1400px !important;
  max-height: 92vh !important;
}
.zone-modal-grid {
  min-height: 420px;
}

/* En-têtes de regroupement par type dans le cimetière/exil (voir
   groupCardsByZoneType, game.js) — flex-basis:100% force le retour à la
   ligne dans .zone-modal-grid (flex-wrap) sans dépendre d'un display:grid. */
.zone-group-header {
  flex-basis: 100%;
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: .5rem 0 -.2rem;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(226, 192, 105, .18);
  font-family: 'Cinzel', serif;
  font-size: .78rem;
  letter-spacing: .02em;
  color: #e2c069;
}
.zone-modal-grid > .zone-group-header:first-child { margin-top: 0; }
.zone-group-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: .68rem;
  color: rgba(226, 192, 105, .55);
}

/* ═══ FIX #10 — Zoom carte agrandi ══════════════════════════════ */
.card-zoom,
#game-card-zoom,
#game-card-zoom-pinned {
  width: 420px !important;
}

/* ═══ Modale "Créer un token" — catalogue complet pré-scrapé ═════════════
   Grille groupée par section (Créatures/Artefacts/Emblèmes), tout affiché
   d'un coup (pas de pastille à cliquer), recherche qui filtre en direct
   côté client (nom anglais ou alias français, voir renderTokenGrid,
   game.js). .token-preview-box/.token-preview-card/.tp-* restent inchangés
   (définis dans game.css, réutilisés tels quels). */
.token-search-input {
  background: #080614;
  border: 1px solid rgba(226, 192, 105, .3);
  color: #d4c48a;
  border-radius: 6px;
  padding: .45rem .65rem;
  font-family: var(--font-body);
  width: 100%;
  font-size: .88rem;
  box-sizing: border-box;
  outline: none;
}
/* Filtre Force/Endurance — les deux <select> ne listent que les valeurs
   réellement présentes dans le catalogue (voir populateTokenPtFilters,
   game.js) : choisir une combinaison absente donne "Aucun token trouvé",
   jamais une valeur inventée. */
.token-pt-filter-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: .78rem;
  color: rgba(255, 255, 255, .55);
}
.token-pt-filter-row label { display: flex; align-items: center; gap: .4rem; }
.token-pt-filter-row select {
  background: #080614;
  border: 1px solid rgba(226, 192, 105, .3);
  color: #d4c48a;
  border-radius: 6px;
  padding: .3rem .5rem;
  font-family: var(--font-mono);
  font-size: .82rem;
}
.token-pt-filter-clear {
  margin-left: auto;
  background: rgba(224, 85, 85, .1);
  border: 1px solid rgba(224, 85, 85, .4);
  color: #e08080;
  border-radius: 6px;
  padding: .25rem .55rem;
  cursor: pointer;
  font-size: .78rem;
}
.token-pt-filter-clear:hover { background: rgba(224, 85, 85, .2); }
.token-search-grid {
  max-height: 420px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: .7rem;
}
.token-search-grid:empty { display: none; }
.token-grid-section-title {
  font-size: .68rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: rgba(226, 192, 105, .6);
  margin-bottom: .4rem;
}
.token-grid-section-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.token-quick-tile {
  width: 62px;
  cursor: pointer;
  text-align: center;
  border-radius: 6px;
  padding: 3px;
  transition: background .12s;
}
.token-quick-tile:hover { background: rgba(226, 192, 105, .12); }
.token-quick-tile.selected { background: rgba(226, 192, 105, .22); box-shadow: 0 0 0 1px #e2c069 inset; }
.token-tile-img-wrap { position: relative; }
.token-quick-tile img {
  width: 100%;
  aspect-ratio: 63 / 88;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid rgba(226, 192, 105, .25);
  display: block;
}
.token-tile-noimg {
  width: 100%;
  aspect-ratio: 63 / 88;
  border-radius: 5px;
  background: rgba(255, 255, 255, .06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, .3);
  font-size: .8rem;
}
.token-tile-pt {
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: rgba(10, 8, 20, .88);
  border: 1px solid rgba(226, 192, 105, .4);
  color: #e2c069;
  font-family: 'JetBrains Mono', monospace;
  font-size: .58rem;
  padding: 0 3px;
  border-radius: 3px;
  line-height: 1.4;
}
.token-quick-tile span {
  display: block;
  font-size: .62rem;
  color: rgba(255, 255, 255, .7);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.token-search-status {
  font-size: .76rem;
  color: rgba(255, 255, 255, .5);
  padding: .3rem;
}
.token-custom-toggle {
  background: none;
  border: 1px dashed rgba(226, 192, 105, .35);
  color: rgba(226, 192, 105, .8);
  border-radius: 6px;
  padding: .4rem .6rem;
  font-size: .78rem;
  cursor: pointer;
  text-align: left;
}
.token-custom-toggle:hover { background: rgba(226, 192, 105, .08); }
.token-custom-toggle.active { border-style: solid; color: #e2c069; background: rgba(226, 192, 105, .12); }

/* Sélecteur de skin (clic droit sur une tuile) — choix global du token */
.token-skin-picker {
  position: fixed;
  z-index: 9600;
  width: 240px;
  background: rgba(11, 9, 24, .97);
  border: 1px solid rgba(226, 192, 105, .35);
  border-radius: 8px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, .65), 0 0 0 1px rgba(0, 0, 0, .4);
  padding: 8px;
  font-family: 'Inter', sans-serif;
}
.token-skin-picker-title {
  font-size: .68rem;
  color: rgba(226, 192, 105, .8);
  padding: 0 2px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.token-skin-picker-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-height: 260px;
  overflow-y: auto;
}
.token-skin-option {
  width: 44px;
  aspect-ratio: 63 / 88;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid rgba(226, 192, 105, .25);
  cursor: pointer;
  transition: border-color .12s, transform .12s;
}
.token-skin-option:hover { border-color: #e2c069; transform: translateY(-2px); }

/* ═══ FIX #13 — Zoom token survol ══════════════════════════════ */
#token-zoom-overlay {
  position: fixed;
  pointer-events: none;
  z-index: 19999;
  display: none;
  filter: drop-shadow(0 12px 40px rgba(0,0,0,.95));
}
/* Wrapper dimensionné — token-face remplit 100% dedans */
.token-zoom-wrapper {
  width: 180px;
  height: 250px;
}
/* Override tailles de texte pour le zoom (token-face a des .42rem etc.) */
#token-zoom-overlay .token-face .token-name {
  font-size: .9rem !important;
  opacity: 1 !important;
}
#token-zoom-overlay .token-face .token-art {
  width: 70% !important;
  font-size: 1.6rem !important;   /* glyphe de l'orbe */
}
#token-zoom-overlay .token-face .token-art::after {
  font-size: 2.2rem !important;
}
#token-zoom-overlay .token-face .token-type {
  font-size: .68rem !important;
}
#token-zoom-overlay .token-face .token-pt {
  font-size: 1.1rem !important;
  padding: 3px 10px !important;
}
#token-zoom-overlay .token-face .token-oracle {
  font-family: 'Inter', sans-serif;
  font-size: .6rem;
  color: rgba(255,255,255,.55);
  font-style: italic;
  text-align: center;
  padding: 0 6px;
  max-height: 40px;
  overflow: hidden;
}

/* ═══ FIX #11 — Indicateur joueur suivant ═══════════════════════ */
.next-player-chip {
  background: rgba(40,40,80,.5);
  border: 1px solid rgba(140,140,200,.35);
  border-radius: 12px;
  padding: 2px 10px;
  color: rgba(180,180,220,.85);
  font-size: .78rem;
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: .02em;
}
.next-player-chip.next-is-me {
  background: rgba(40,80,40,.6);
  border-color: rgba(80,200,80,.45);
  color: rgba(120,220,120,.95);
  font-weight: 700;
}

/* ═══ SURRENDER — Style League of Legends ═══════════════════════ */
#surrender-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.72);
  z-index: 9200;
  display: flex; align-items: center; justify-content: center;
  animation: sdr-in .18s ease;
}
@keyframes sdr-in { from { opacity:0; transform:scale(.93); } to { opacity:1; transform:scale(1); } }
.surrender-box {
  background: rgba(6,4,14,.96);
  border: 2px solid #8a6820;
  border-radius: 4px;
  padding: 22px 28px 20px;
  min-width: 300px;
  text-align: center;
  box-shadow: 0 0 48px rgba(140,100,30,.25), 0 8px 40px rgba(0,0,0,.8);
}
.surrender-title {
  font-family: 'Cinzel', serif;
  color: #e2c069;
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: .18em;
  margin-bottom: 5px;
}
.surrender-proposer {
  color: rgba(255,255,255,.38);
  font-size: .73rem;
  font-family: 'Inter', sans-serif;
  margin-bottom: 14px;
}
.surrender-segs {
  display: flex; gap: 4px;
  justify-content: center;
  margin-bottom: 8px;
}
.surrender-seg {
  width: 32px; height: 16px;
  border-radius: 2px;
  background: rgba(255,255,255,.1);
  transition: background .25s;
}
.surrender-seg.yes { background: #00b000; }
.surrender-seg.no  { background: #b00000; }
.surrender-sub {
  color: rgba(255,255,255,.45);
  font-size: .78rem;
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 7px;
}
.surrender-timer-track {
  height: 3px;
  background: rgba(255,255,255,.08);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 16px;
}
.surrender-timer-bar {
  height: 100%;
  background: #3a7ccc;
  transition: width 1s linear;
}
.surrender-btns { display: flex; gap: 8px; }
.surrender-btn {
  flex: 1; padding: 9px 16px;
  border-radius: 2px;
  font-family: 'Cinzel', serif;
  font-size: .95rem; font-weight: 800;
  letter-spacing: .06em;
  cursor: pointer; border: 1px solid;
  transition: background .12s, box-shadow .12s;
}
.surrender-btn-yes { background: rgba(0,140,0,.18); border-color: #00a000; color: #00ee44; }
.surrender-btn-yes:hover { background: rgba(0,160,0,.3); box-shadow: 0 0 10px rgba(0,180,0,.35); }
.surrender-btn-no  { background: rgba(140,0,0,.18); border-color: #a00000; color: #ff3333; }
.surrender-btn-no:hover  { background: rgba(160,0,0,.3); box-shadow: 0 0 10px rgba(180,0,0,.35); }
.surrender-voted {
  color: rgba(255,255,255,.45);
  font-size: .8rem;
  font-family: 'Inter', sans-serif;
  padding: 8px 0;
}

/* ═══ CHOIX MORPH / MEGAMORPH / DISGUISE ════════════════════════ */
#morph-choice-overlay,
#face-choice-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 9350;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: cmdr-kill-in .15s ease;
}
.morph-choice-box {
  background: linear-gradient(160deg, #120a1e 0%, #1c0d0d 100%);
  border: 1px solid rgba(226,192,105,.35);
  border-radius: 14px;
  padding: 1.4rem 1.8rem;
  width: 360px;
  max-width: 94vw;
  text-align: center;
  box-shadow: 0 0 40px rgba(226,192,105,.2), 0 8px 32px rgba(0,0,0,.6);
}
.morph-choice-title {
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #e2c069;
  margin-bottom: .4rem;
  letter-spacing: .05em;
}
.morph-choice-sub {
  font-size: .78rem;
  color: rgba(255,255,255,.65);
  line-height: 1.4;
  margin-bottom: .6rem;
}
/* Double confirmation visuelle Ward 2 (Disguise/Cloak) — voir
   showMorphChoiceModal, game.js. Encart distinct plutôt que du texte en fin
   de phrase, pour que le joueur ne puisse pas le manquer avant de valider. */
.morph-choice-ward-badge {
  background: rgba(90,60,150,.22);
  border: 1px solid rgba(150,120,220,.55);
  color: #cdb8f5;
  border-radius: 6px;
  padding: .45rem .6rem;
  font-size: .74rem;
  line-height: 1.35;
  margin-bottom: 1.1rem;
}
.morph-choice-ward-badge strong { color: #e2c9ff; }
.morph-choice-actions {
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
.morph-choice-btn {
  padding: .65rem .8rem;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .12s, transform .1s;
}
.morph-choice-btn:active { transform: scale(.97); }
.morph-choice-btn-normal {
  background: rgba(226,192,105,.12);
  border-color: rgba(226,192,105,.4);
  color: #e2c069;
}
.morph-choice-btn-normal:hover { background: rgba(226,192,105,.22); }
.morph-choice-btn-facedown {
  background: rgba(90,60,150,.25);
  border-color: rgba(150,120,220,.55);
  color: #cdb8f5;
}
.morph-choice-btn-facedown:hover { background: rgba(90,60,150,.4); }

/* ═══ CONFIRMATION MORT COMMANDANT ══════════════════════════════ */
#cmdr-kill-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 9300;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: cmdr-kill-in .2s ease;
}
@keyframes cmdr-kill-in {
  from { opacity: 0; transform: scale(.92); }
  to   { opacity: 1; transform: scale(1); }
}
.cmdr-kill-box {
  background: linear-gradient(160deg, #120a1e 0%, #1c0d0d 100%);
  border: 1px solid rgba(226,192,105,.35);
  border-radius: 14px;
  padding: 1.6rem 2rem;
  width: 380px;
  max-width: 94vw;
  text-align: center;
  box-shadow: 0 0 40px rgba(200,50,50,.25), 0 8px 32px rgba(0,0,0,.6);
}
.cmdr-kill-icon {
  font-size: 2.8rem;
  line-height: 1;
  margin-bottom: .4rem;
  filter: drop-shadow(0 0 12px rgba(200,60,60,.7));
  animation: cmdr-kill-pulse 1.4s ease-in-out infinite;
}
@keyframes cmdr-kill-pulse {
  0%,100% { transform: scale(1); }
  50%     { transform: scale(1.12); }
}
.cmdr-kill-title {
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #e05555;
  margin-bottom: .5rem;
  letter-spacing: .05em;
}
.cmdr-kill-desc {
  font-size: .82rem;
  color: rgba(255,255,255,.75);
  line-height: 1.5;
  margin-bottom: .2rem;
}
.cmdr-kill-total {
  font-size: 1.3rem;
  font-weight: 800;
  color: #e2c069;
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 1rem;
}
/* Barre de countdown */
.cmdr-kill-progress-track {
  background: rgba(255,255,255,.08);
  border-radius: 4px;
  height: 5px;
  margin-bottom: 1.1rem;
  overflow: hidden;
}
.cmdr-kill-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #e05555, #e2c069);
  border-radius: 4px;
  transition: width .9s linear;
}
.cmdr-kill-timer-text {
  font-size: .7rem;
  color: rgba(255,255,255,.4);
  margin-bottom: 1rem;
  margin-top: -.7rem;
}
/* Boutons */
.cmdr-kill-actions {
  display: flex;
  gap: .6rem;
}
.cmdr-kill-btn {
  flex: 1;
  padding: .6rem .5rem;
  border-radius: 8px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: opacity .15s, transform .1s;
}
.cmdr-kill-btn:active { transform: scale(.97); }
.cmdr-kill-btn-confirm {
  background: rgba(200,50,50,.25);
  border-color: rgba(200,50,50,.6);
  color: #e07070;
}
.cmdr-kill-btn-confirm:hover { background: rgba(200,50,50,.4); }
.cmdr-kill-btn-cancel {
  background: rgba(226,192,105,.12);
  border-color: rgba(226,192,105,.4);
  color: #e2c069;
}
.cmdr-kill-btn-cancel:hover { background: rgba(226,192,105,.22); }
/* Compteurs de votes */
.cmdr-kill-vote-row {
  display: flex;
  justify-content: center;
  gap: .8rem;
  margin-bottom: .6rem;
}
.ckv-pill {
  display: flex;
  align-items: center;
  gap: .3rem;
  font-size: .72rem;
  padding: .25rem .6rem;
  border-radius: 20px;
  border: 1px solid;
  font-weight: 500;
}
.ckv-pill-cancel  { border-color: rgba(226,192,105,.3); color: rgba(226,192,105,.7); }
.ckv-pill-confirm { border-color: rgba(200,50,50,.4);   color: rgba(224,112,112,.8); }
.ckv-count { font-weight: 800; font-family: 'JetBrains Mono', monospace; font-size: .8rem; }
.ckv-req   { opacity: .5; font-size: .68rem; }
.ckv-hint  {
  font-size: .62rem;
  color: rgba(255,255,255,.3);
  margin-top: .5rem;
  text-align: center;
  font-style: italic;
}

/* ═══ EMOTES — taille réduite ════════════════════════════════════ */
.emote-btn {
  padding: 6px !important;
  border-radius: 8px !important;
  gap: 4px !important;
}
.emote-btn img {
  width: 80px !important;
  height: 112px !important;
  border-radius: 6px !important;
  object-position: 50% 25% !important;
}
.emote-sound-icon {
  width: 50px !important;
  height: 50px !important;
  font-size: 1.6rem !important;
  border-radius: 6px !important;
}
.emote-label {
  font-size: .68rem !important;
}

/* ═══ MODE SPECTATEUR ════════════════════════════════════════════ */
.spec-hidden {
  display: none !important;
}

/* Bannière spectateur (en haut de #screen-game) */
#spectator-banner {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 5px 14px;
  background: rgba(80, 40, 160, .18);
  border-bottom: 1px solid rgba(150, 100, 220, .35);
  font-size: .8rem;
  color: #b896f5;
  letter-spacing: .04em;
  position: relative;
  z-index: 2;
}

/* Strip de la main visible par le spectateur, sous chaque player-zone */
.spec-hand-section {
  padding: 5px 8px 6px;
  border-top: 1px solid rgba(150, 100, 220, .15);
  background: rgba(60, 20, 100, .08);
}
.spec-hand-section img:hover {
  outline: 1px solid rgba(184, 150, 245, .6);
  border-radius: 3px;
}

/* ═══ Timer de tour ════════════════════════════════════════════ */
#turn-timer-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
#turn-timer-label {
  position: absolute;
  font-family: 'JetBrains Mono', monospace;
  font-size: .62rem;
  font-weight: 700;
  color: rgba(255,255,255,.85);
  letter-spacing: -.02em;
  pointer-events: none;
  text-align: center;
}
.ttr-track { stroke: rgba(255,255,255,.1); }
#ttr-arc   { stroke: #4caf82; transition: stroke .5s, stroke-dashoffset .9s linear; }

/* Jaune quand < 60s */
#turn-timer-wrap.ttw-warning #ttr-arc   { stroke: #e8b84b; }
#turn-timer-wrap.ttw-warning #turn-timer-label { color: #e8b84b; }

/* Rouge + pulse quand ≤ 10s */
#turn-timer-wrap.ttw-danger #ttr-arc    { stroke: #e05555; }
#turn-timer-wrap.ttw-danger #turn-timer-label { color: #ff6b6b; }
#turn-timer-wrap.ttw-danger {
  animation: ttr-pulse .6s ease-in-out infinite alternate;
}
@keyframes ttr-pulse {
  from { transform: scale(1);    filter: drop-shadow(0 0 3px rgba(224,85,85,.4)); }
  to   { transform: scale(1.12); filter: drop-shadow(0 0 8px rgba(224,85,85,.9)); }
}

/* ═══ Counters sur cage commandant ══════════════════════════════ */
.cmd-counter-btn {
  background: rgba(0,0,0,.8);
  border: 1px solid rgba(226,192,105,.5);
  border-radius: 3px;
  color: var(--gold);
  font-size: .6rem;
  padding: 1px 5px;
  cursor: pointer;
  line-height: 1.4;
  transition: background .1s;
}
.cmd-counter-btn:hover { background: rgba(226,192,105,.25); }
.cmd-counter-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: .65rem;
  color: #fff;
  background: rgba(0,0,0,.7);
  border-radius: 3px;
  padding: 1px 4px;
  min-width: 20px;
  text-align: center;
  font-weight: 700;
}

/* ═══ INTRO — Avatar photo (rond, pas rectangle carte) ═════════ */
.gi-avatar-img {
  border-radius: 50% !important;
  width: 110px !important;
  height: 110px !important;
  object-fit: cover !important;
  border: 3px solid rgba(226,192,105,.6) !important;
  box-shadow: 0 0 24px rgba(226,192,105,.3) !important;
}

/* ═══ PEEK — Espionner carte du dessus (privé) ══════════════════ */
#peek-card-overlay {
  position: fixed;
  inset: 0;
  z-index: 8800;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn .15s ease;
}
.peek-box {
  background: linear-gradient(160deg, #1a1530 0%, #0d0b1a 100%);
  border: 1px solid rgba(226,192,105,.45);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 40px rgba(0,0,0,.8), 0 0 20px rgba(226,192,105,.12);
  max-width: 280px;
}
.peek-label {
  font-family: 'Cinzel', serif;
  font-size: .72rem;
  color: rgba(226,192,105,.7);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.peek-img {
  width: 200px;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,.7);
}
.peek-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
}
.peek-name {
  font-family: 'Cinzel', serif;
  font-size: .85rem;
  color: rgba(255,255,255,.9);
  text-align: center;
}
.peek-cost {
  font-family: 'JetBrains Mono', monospace;
  font-size: .72rem;
  color: rgba(226,192,105,.75);
}
.peek-type {
  font-size: .68rem;
  color: rgba(180,180,200,.6);
  font-style: italic;
}
.peek-close {
  background: rgba(226,192,105,.12);
  border: 1px solid rgba(226,192,105,.35);
  border-radius: 6px;
  color: rgba(226,192,105,.85);
  font-family: 'Cinzel', serif;
  font-size: .72rem;
  padding: 5px 18px;
  cursor: pointer;
  transition: background .15s;
  margin-top: 2px;
}
.peek-close:hover {
  background: rgba(226,192,105,.25);
}

/* ═══ JODAH — Carte légendaire trouvée, en attente de décision (privé) ═══ */
#jodah-found-overlay {
  position: fixed;
  inset: 0;
  z-index: 8800;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn .15s ease;
}
.jodah-found-box {
  max-width: 300px;
}
.jodah-found-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.jodah-found-cast {
  background: linear-gradient(135deg, rgba(226,192,105,.35), rgba(226,192,105,.15));
  border: 1px solid rgba(226,192,105,.6);
  border-radius: 6px;
  color: #e2c069;
  font-family: 'Cinzel', serif;
  font-size: .72rem;
  padding: 7px 16px;
  cursor: pointer;
  transition: background .15s;
}
.jodah-found-cast:hover {
  background: linear-gradient(135deg, rgba(226,192,105,.5), rgba(226,192,105,.25));
}
.jodah-found-decline {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 6px;
  color: rgba(255,255,255,.7);
  font-family: 'Cinzel', serif;
  font-size: .72rem;
  padding: 7px 16px;
  cursor: pointer;
  transition: background .15s;
}
.jodah-found-decline:hover {
  background: rgba(255,255,255,.12);
}
/* Bouton peek dans zone-strip */
.zsa-peek {
  background: rgba(60,100,160,.25);
  border-color: rgba(60,100,200,.45);
  color: rgba(180,200,255,.9);
}
.zsa-peek:hover {
  background: rgba(60,100,160,.45);
}

/* ═══ Tokens légèrement réduits sur le board (~85%) ════════════
   Les tokens sans image occupaient la même taille qu'une vraie carte ;
   on les réduit un peu pour un meilleur rendu visuel.
   token-wrap est ajouté par makeZoneCard() quand card.isToken = true.
   ═══════════════════════════════════════════════════════════════ */
.row-crea .token-wrap > .zone-card           { width: 85px  !important; height: 119px !important; }
.row-art  .token-wrap > .zone-card,
.row-sort .token-wrap > .zone-card           { width: 68px  !important; height:  95px !important; }
.row-land .token-wrap > .zone-card           { width: 55px  !important; height:  77px !important; }
/* Hover token : garder le scale de game.css mais adapter l'axe */
.token-wrap > .zone-card:hover               { transform: translateY(-4px) scale(1.08) !important; }

/* ═══ Menu contextuel universel — clic droit sur une carte ═══════
   Remplace l'ancien système de boutons "4 coins" (peu intuitif).
   Couvre : main, battlefield (mes permanents), cimetière, exil.
   Voir attachCardContextMenu() / getUniversalCardActions() dans game.js
   — pour ajouter une interaction, il suffit d'éditer cette dernière.
   ═══════════════════════════════════════════════════════════════ */
.card-ctx-menu {
  position: fixed;
  z-index: 9450;
  min-width: 198px;
  max-width: 280px;
  background: rgba(11, 9, 24, .97);
  border: 1px solid rgba(226, 192, 105, .35);
  border-radius: 8px;
  box-shadow: 0 10px 32px rgba(0,0,0,.65), 0 0 0 1px rgba(0,0,0,.4);
  padding: 6px;
  font-family: 'Inter', sans-serif;
  animation: cardCtxFadeIn .12s ease-out;
}
@keyframes cardCtxFadeIn {
  from { opacity: 0; transform: scale(.95); }
  to   { opacity: 1; transform: scale(1); }
}
.card-ctx-title {
  font-family: 'Cinzel', serif;
  font-size: .72rem;
  letter-spacing: .03em;
  color: #e2c069;
  padding: 5px 10px 7px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(226,192,105,.18);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-ctx-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  background: none;
  border: none;
  border-radius: 5px;
  color: rgba(255,255,255,.85);
  font-size: .8rem;
  text-align: left;
  padding: 7px 10px;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.card-ctx-item:hover {
  background: rgba(226,192,105,.16);
  color: #fff;
}
.card-ctx-icon {
  width: 1.3em;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #e2c069;
}
.card-ctx-icon-svg { width: 15px; height: 15px; }
.card-ctx-group-label {
  padding: 2px 10px 4px;
  font-size: .6rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
}
.card-ctx-divider {
  height: 1px;
  background: rgba(255,255,255,.08);
  margin: 4px 2px;
}
/* Menu contextuel trop haut pour l'écran (game.js bascule cette classe
   après mesure) — 2 colonnes plutôt que de déborder verticalement ou de
   faire défiler un menu contextuel. */
.card-ctx-menu--columns {
  column-count: 2;
  column-gap: 14px;
  max-width: 560px;
  max-height: calc(100vh - 16px);
  overflow-y: auto;
}
.card-ctx-menu--columns .card-ctx-title { column-span: all; }
.card-ctx-group {
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
}
.card-ctx-divider { break-inside: avoid; }

/* Mini confirmation Oui/Non ancrée à côté d'un item du menu contextuel
   (showCtxInlineConfirm, game.js) — remplace le confirm() natif pour
   "Jouer/Révéler face cachée". */
.ctx-inline-confirm {
  position: fixed;
  z-index: 9460;
  width: 190px;
  background: rgba(11, 9, 24, .98);
  border: 1px solid rgba(226, 192, 105, .45);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.6);
  padding: 9px 10px;
  font-family: 'Inter', sans-serif;
  animation: cardCtxFadeIn .12s ease-out;
}
.ctx-inline-confirm-msg {
  font-size: .74rem;
  line-height: 1.35;
  color: rgba(255,255,255,.85);
  margin-bottom: 8px;
}
.ctx-inline-confirm-actions { display: flex; gap: 6px; }
.ctx-inline-confirm-btn {
  flex: 1;
  padding: 5px 0;
  border-radius: 5px;
  font-size: .74rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .12s;
}
.ctx-inline-confirm-btn-yes {
  background: rgba(226,192,105,.16);
  border-color: rgba(226,192,105,.45);
  color: #e2c069;
}
.ctx-inline-confirm-btn-yes:hover { background: rgba(226,192,105,.28); }
.ctx-inline-confirm-btn-no {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.18);
  color: rgba(255,255,255,.7);
}
.ctx-inline-confirm-btn-no:hover { background: rgba(255,255,255,.12); }

/* Choix manuel Morph/Megamorph/Disguise/Manifest/Cloak (showCtxMorphTypeChooser,
   game.js) — réutilise la boîte .ctx-inline-confirm (position, fond, ombre)
   avec une liste de boutons empilés plutôt que Oui/Non. */
.ctx-inline-confirm.ctx-morph-chooser { width: 215px; }
.ctx-morph-chooser-list { display: flex; flex-direction: column; gap: 5px; }
.ctx-morph-chooser-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(226,192,105,.3);
  background: rgba(226,192,105,.08);
  color: #e2c069;
  transition: background .12s;
}
.ctx-morph-chooser-btn:hover { background: rgba(226,192,105,.22); }
.ctx-morph-chooser-ward {
  font-size: .62rem;
  font-weight: 700;
  color: #cdb8f5;
  background: rgba(90,60,150,.25);
  border: 1px solid rgba(150,120,220,.5);
  border-radius: 4px;
  padding: 1px 5px;
  flex-shrink: 0;
}
.card-ctx-pill-btn {
  background: rgba(226,192,105,.1);
  border: 1px solid rgba(226,192,105,.3);
  border-radius: 6px;
  color: #e2c069;
  font-size: .72rem;
  padding: .3rem .65rem;
  cursor: pointer;
  transition: background .12s;
}
.card-ctx-pill-btn:hover { background: rgba(226,192,105,.22); }
/* Badge +1/+1 sur l'illustration (voir makeZoneCard, game.js) — force/
   endurance actuelle en gros, bonus en petit dessous, coin bas-droit près
   du cartouche P/T imprimé sur la vraie carte. */
.card-pt-counter-badge {
  position: absolute;
  bottom: 3px;
  right: 3px;
  background: rgba(5, 4, 9, .9);
  border: 1px solid #7fd88f;
  border-radius: 5px;
  padding: 1px 5px;
  text-align: right;
  line-height: 1.2;
  pointer-events: none;
  z-index: 3;
}
.pt-badge-total {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: .78rem;
  font-weight: 700;
  color: #f2efe0;
  text-shadow: 0 0 3px rgba(0,0,0,.9);
}
.pt-badge-bonus {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: .58rem;
  font-weight: 700;
  color: #7fd88f;
}
.pt-badge-bonus.negative { color: #e05555; }

/* Contrôles +/- indépendants force (gauche) / endurance (droite) — visibles
   uniquement au survol de la carte, distincts du compteur +1/+1 symétrique
   (rangée sous la carte, inchangée) et du badge P/T ci-dessus. */
.pt-side-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
  z-index: 5;
}
.pt-side-left { left: 2px; }
.pt-side-right { right: 2px; }
.zone-card:hover .pt-side-control {
  opacity: 1;
  pointer-events: auto;
}
.pt-side-control button {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 1px solid rgba(226, 192, 105, .65);
  background: rgba(5, 4, 9, .88);
  color: #e2c069;
  font-size: .68rem;
  line-height: 1;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.pt-side-control button:hover {
  background: rgba(226, 192, 105, .3);
}

/* Dos de carte — vrai dos Magic, servi depuis /img/card-back.jpg (copie
   locale : pas de dépendance réseau à Scryfall pour un élément d'interface,
   et le dos s'affiche même hors ligne). Remplace la pastille générique
   .zone-card-back (dégradé + glyphe 🃏, game.css) partout où une carte est
   face cachée : plateau, replay, et cinématique de retournement morph.
   Les éléments -ring / -gem sont l'ancien dessin CSS ; ils sont neutralisés
   ici plutôt que retirés des 4 endroits qui les émettent encore (game.js,
   game-features.js, replayViewer.js). */
.card-back-arcanum {
  width: 100%;
  height: 100%;
  border-radius: 6px;
  background: #0a0603 url('/img/card-back.jpg') center / cover no-repeat;
  border: 1px solid rgba(226, 192, 105, .35);
  position: relative;
  overflow: hidden;
}
.card-back-arcanum-ring,
.card-back-arcanum-gem { display: none; }

/* Retournement Morph/Megamorph/Disguise (REVEAL_FACE_DOWN) — la carte pivote
   physiquement sur son axe vertical : dos Magic → vraie carte, comme quand on
   retourne une carte sur une table. Utilisé à deux échelles, avec la même
   animation : sur la carte du plateau (playMorphFlipReveal, game-features.js)
   et dans la cinématique plein écran (morph_card_revealed, game.js).
   Durée réglable ici seule : --morph-flip. Les délais de nettoyage côté JS
   doivent lui rester supérieurs.
   PAS de garde prefers-reduced-motion : aucune autre animation de jeu du
   projet n'en a, et elle rendait l'effet totalement invisible sur un poste
   où les effets d'animation Windows sont réduits. */
@keyframes morph-flip { from { transform: rotateY(0); } to { transform: rotateY(180deg); } }

/* Conteneur : porte la perspective. position:fixed + coordonnées inline pour
   la version plateau (survit à une reconstruction du board pendant
   l'animation) ; la version plein écran repasse en absolute (-inset). */
.morph-flip-stage {
  --morph-flip: .7s;
  position: fixed;
  z-index: 19990; /* au-dessus du plateau, sous le zoom de carte (19999) */
  perspective: 1200px;
  pointer-events: none;
}
.morph-flip-inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  animation: morph-flip var(--morph-flip) cubic-bezier(.5, 0, .3, 1) forwards;
}
/* backface-visibility : sans elle, les deux faces resteraient visibles en
   miroir pendant la rotation. */
.morph-flip-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 6px;
  overflow: hidden;
}
.morph-flip-face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.morph-flip-front { transform: rotateY(180deg); }

/* Cinématique plein écran : la scène se cale sur l'illustration agrandie
   au lieu des coordonnées d'une carte du plateau. */
.morph-flip-stage-inset {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.morph-flip-stage-inset .morph-flip-face { border-radius: 12px; }

.card-nickname-badge {
  position: absolute;
  bottom: 2px;
  left: 2px;
  right: 2px;
  background: rgba(0,0,0,.78);
  color: #e2c069;
  font-size: .58rem;
  text-align: center;
  padding: 1px 3px;
  border-radius: 3px;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 4;
}
.card-pin-badge {
  position: absolute;
  top: 2px;
  left: 2px;
  font-size: .68rem;
  color: #e2c069;
  text-shadow: 0 0 3px rgba(0,0,0,.9), 0 0 2px rgba(0,0,0,.9);
  pointer-events: none;
  z-index: 4;
}

/* ═══ Repère "Aura" — zone rose fixe, façon "zone dorée" du commandant ══
   Toggle via le menu contextuel (clic droit → ✨ Marquer comme Aura),
   synchronisé serveur et visible par TOUS (card.auraMarked, voir game.js).
   Calqué tel quel sur .zone-card.is-commander-bf : cadre + lueur fixes
   (pas d'animation — la zone reste allumée en continu, comme la cage
   dorée du commandant), simplement en teinte rose pour la distinguer.
   !important pour rester visible même au survol (.zone-card:hover /
   .hand-card:hover redéfinissent border-color/box-shadow sinon).
   ═══════════════════════════════════════════════════════════════ */
.card-aura-marked {
  position: relative;
  z-index: 2;
  --aura: 255, 90, 190;           /* défaut rose — surchargé par .card-aura-<couleur> */
  border-color: rgb(var(--aura)) !important;
  box-shadow: 0 0 16px rgba(var(--aura), .55), 0 0 6px rgba(var(--aura), .35) !important;
}
/* Palette de couleurs d'aura — surcharge la variable --aura.
   Déclarées APRÈS .card-aura-marked pour gagner en cascade (même
   spécificité, l'ordre source tranche). Choix via clic droit → pastilles. */
.card-aura-pink   { --aura: 255, 90, 190; }
.card-aura-gold   { --aura: 226, 192, 105; }
.card-aura-blue   { --aura: 74, 127, 208; }
.card-aura-green  { --aura: 79, 174, 106; }
.card-aura-red    { --aura: 208, 82, 82; }
.card-aura-purple { --aura: 138, 95, 176; }
.card-aura-cyan   { --aura: 53, 196, 196; }
.card-aura-white  { --aura: 244, 239, 225; }
/* Petit repère en coin — utilise ::after pour ne pas entrer en conflit
   avec le ::before du commandant (⚔ icon sur .is-commander-bf::before) */
.card-aura-marked::after {
  content: '✦';
  position: absolute;
  top: 2px; right: 3px;
  font-size: .55rem;
  line-height: 1;
  background: rgba(0,0,0,.75);
  border-radius: 3px;
  padding: 1px 3px;
  color: rgb(var(--aura));
  z-index: 4;
  pointer-events: none;
}

/* ── Palette de couleurs d'aura dans le menu contextuel ─────────── */
.card-ctx-aura-row {
  padding: 6px 10px 8px;
  border-top: 1px solid rgba(226, 192, 105, .12);
  margin-top: 2px;
}
.card-ctx-aura-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
  color: rgba(226, 192, 105, .85);
  margin-bottom: 6px;
}
/* Bloc "Pioche" du menu contextuel champ de bataille uniquement (voir
   buildLibraryInsertRow, game.js) — titre doré plus affirmé que le libellé
   discret par défaut ci-dessus, pour le distinguer comme bloc mis en avant. */
.card-ctx-aura-label--gold {
  color: #e2c069;
  font-weight: 700;
}
.card-ctx-aura-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.aura-swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .18);
  cursor: pointer;
  padding: 0;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}
.aura-swatch:hover {
  transform: scale(1.18);
  border-color: rgba(255, 255, 255, .55);
}
.aura-swatch.active {
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .3), 0 0 8px rgba(255, 255, 255, .4);
}
.aura-swatch-none {
  background: rgba(20, 16, 30, .9);
  color: rgba(255, 255, 255, .7);
  font-size: .7rem;
  line-height: 1;
  display: grid;
  place-items: center;
}

/* Compteur +1/+1 visible au-dessus du commandant tappé
   .zone-card.is-commander-bf a z-index:3 (game.css) qui peint par-dessus
   le .counter-rows (z-index:auto). On le repasse au-dessus. */
.card-counter.counter-rows.visible,
.zone-card-wrap:hover .card-counter.counter-rows {
  position: relative;
  z-index: 10;
}
/* Rangée +/- sous la carte (game.css : display:flex en permanence par
   défaut) — masquée hors survol, même traitement que les nouveaux contrôles
   latéraux (.pt-side-control ci-dessus) pour ne pas encombrer le board.
   .visible (ajoutée par JS quand le compteur est non nul) ne gère plus que
   le z-index ci-dessus, plus la visibilité elle-même. */
.zone-card-wrap .card-counter.counter-rows {
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
}
.zone-card-wrap:hover .card-counter.counter-rows {
  opacity: 1;
  pointer-events: auto;
}

/* ── Scrollbar visible sur les rangées du board (terrains,
   artefacts/rituels) — même style doré que .crea-content (game.css),
   pour que toutes les rangées scrollables aient le même indicateur visuel
   de contenu à défiler, pas seulement les créatures. */
.zone-row { scrollbar-width: thin !important; scrollbar-color: rgba(226,192,105,.35) transparent; }
.zone-row::-webkit-scrollbar { display: block !important; height: 4px; }
.zone-row::-webkit-scrollbar-track { background: transparent; }
.zone-row::-webkit-scrollbar-thumb { background: rgba(226,192,105,.35); border-radius: 2px; }
.zone-row::-webkit-scrollbar-thumb:hover { background: rgba(226,192,105,.6); }

/* ═══ Tailles de cartes uniformes — toutes rangées identiques ════════
   Normalise toutes les rangées à 80×112 px (taille art/sort).
   row-crea (100×140) et row-land (65×91) sont alignées.
   Le commandant sur BF reprend la taille complète 100×140 pour se démarquer.
   ═══════════════════════════════════════════════════════════════════ */
.row-crea .zone-card                     { width: 80px !important; height: 112px !important; }
.row-land .zone-card                     { width: 80px !important; height: 112px !important; }
.zone-card.is-commander-bf               { width: 80px !important; height: 112px !important; }
/* Commander sur BF : taille pleine créature (100×140) pour le mettre en avant */
.row-crea .zone-card.is-commander-bf     { width: 100px !important; height: 140px !important; }
/* La cage garde sa taille d'origine — avec deux commandants, deux cages
   côte à côte gardent CHACUNE cette même taille (aucune réduction, testé à
   4 et 5 joueurs, voir CLAUDE.md règle 5). */
.cmd-cage .zone-card                     { width: 66px !important; height: 92px !important; }
/* Toutes les rangées à la même hauteur — uniformité en mode spectateur
   150px = commander 140px + 10px padding ; cartes 112px sont centrées (align-items:center) */
.row-crea, .row-art, .row-sort, .row-land { min-height: 150px !important; }
/* Tokens : taille uniforme dans toutes les rangées */
.row-crea .token-wrap > .zone-card       { width: 68px !important; height:  95px !important; }
.row-land .token-wrap > .zone-card       { width: 68px !important; height:  95px !important; }

/* ═══ Warnings deck (lobby) ══════════════════════════════════════ */
.deck-warnings-box {
  background: rgba(200,140,0,.1);
  border: 1px solid rgba(220,160,0,.35);
  border-radius: 8px;
  padding: .75rem 1rem;
  margin-top: .6rem;
}
.deck-warnings-title {
  font-size: .72rem;
  color: #e2c069;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .5rem;
}
.deck-warnings-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.deck-warnings-list li {
  font-size: .8rem;
  color: #d4b86a;
  padding-left: .9rem;
  position: relative;
}
.deck-warnings-list li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: #e2c069;
  font-weight: 700;
}

/* ── Skin Picker ───────────────────────────────────────────────── */
#skin-picker-panel {
  position: fixed;
  z-index: 9500;
  background: #1a1228;
  border: 1px solid rgba(226,192,105,.4);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,.7);
  width: 420px;
  max-height: 520px;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.skin-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .6rem .8rem;
  border-bottom: 1px solid rgba(226,192,105,.2);
  background: rgba(226,192,105,.07);
}
.skin-picker-title {
  font-size: .8rem;
  font-weight: 700;
  color: #e2c069;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}
.skin-picker-close {
  background: none;
  border: none;
  color: rgba(255,255,255,.5);
  cursor: pointer;
  font-size: .9rem;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}
.skin-picker-close:hover { background: rgba(255,255,255,.1); color: #fff; }
.skin-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 10px;
  overflow-y: auto;
  max-height: 460px;
}
.skin-thumb {
  position: relative;
  border-radius: 8px;
  border: 2px solid rgba(255,255,255,.12);
  cursor: pointer;
  overflow: hidden;
  aspect-ratio: 2/3;
  background: #0d0b16;
  transition: border-color .15s, transform .1s;
}
.skin-thumb:hover { border-color: rgba(226,192,105,.6); transform: scale(1.03); }
.skin-thumb-active { border-color: #e2c069 !important; box-shadow: 0 0 8px rgba(226,192,105,.5); }
.skin-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.skin-thumb-label {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,.75);
  font-size: .55rem;
  padding: 2px 3px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #ddd;
}
/* Badge langue visible en haut du thumbnail */
.skin-lang-flag {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 3px 0;
  pointer-events: none;
  z-index: 2;
}
.skin-lang-flag.lang-fr {
  background: rgba(0,60,180,.85);
  color: #fff;
  border-bottom: 1px solid rgba(0,100,255,.5);
}
.skin-lang-flag.lang-en {
  background: rgba(160,20,20,.8);
  color: #fff;
  border-bottom: 1px solid rgba(200,30,30,.5);
}

.skin-thumb-default {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: rgba(255,255,255,.4);
  font-size: 1.3rem;
  gap: 4px;
}
.skin-thumb-default span { font-size: .6rem; }

/* Zoom preview au survol du skin picker */
#skin-zoom-preview {
  position: fixed;
  z-index: 9600;
  display: none;
  width: 220px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,.85);
  border: 2px solid rgba(226,192,105,.35);
  pointer-events: none;
}
#skin-zoom-preview img {
  width: 100%;
  display: block;
}

/* Badge 🎨 sur les cartes avec skin actif dans le browser */
.browser-card { position: relative; }
.skin-active-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: .85rem;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.8));
  pointer-events: none;
  z-index: 2;
}

/* ───────────────────────────────────────────────────────────────
   Retour visuel de PAUSE (chess clock partagé)
   body.cc-paused ajouté par renderChessClock() quand cc.paused === true.
   L'écran passe en noir & blanc mais reste jouable (overlay non-bloquant).
─────────────────────────────────────────────────────────────── */
.game-board,
.game-log-panel {
  transition: filter .35s ease;
}
body.cc-paused .game-board,
body.cc-paused .game-log-panel {
  filter: grayscale(1) brightness(.72);
}

#cc-pause-banner {
  position: fixed;
  inset: 0;
  display: none;                 /* affiché via body.cc-paused */
  align-items: center;
  justify-content: center;
  pointer-events: none;          /* on continue à jouer normalement */
  z-index: 7000;                 /* sous les modaux (8000+) */
}
body.cc-paused #cc-pause-banner {
  display: flex;
}
#cc-pause-banner span {
  font-family: 'Cinzel', serif;
  font-size: 5.5rem;
  font-weight: 700;
  letter-spacing: .35em;
  padding-left: .35em;           /* compense le letter-spacing pour le centrage */
  color: rgba(226, 192, 105, .92);
  text-shadow: 0 4px 30px rgba(0, 0, 0, .85), 0 0 60px rgba(226, 192, 105, .35);
  animation: cc-pause-pulse 2.2s ease-in-out infinite;
}
@keyframes cc-pause-pulse {
  0%, 100% { opacity: .5;  transform: scale(1); }
  50%      { opacity: .95; transform: scale(1.03); }
}

/* ───────────────────────────────────────────────────────────────
   Commandant tapé (pivoté 90°) : garder le compteur du bas lisible.
   La carte pivotée peut recouvrir le .counter-rows placé sous elle →
   on le repasse au-dessus, on lui ajoute un fond et un peu d'espace.
─────────────────────────────────────────────────────────────── */
.zone-card-wrap:has(.zone-card.tapped) .card-counter.counter-rows,
.zone-card-wrap:has(.zone-card.tapped) .card-counter.counter-rows.visible {
  position: relative;
  z-index: 15;
  margin-top: 10px;
  background: rgba(12, 9, 20, .9);
  border-radius: 6px;
  padding: 1px 5px;
  opacity: 1;
}

/* ═══ Deux commandants (Partner) — deux anciennes cages côte à côte ══════
   .cmd-cages-container ne fait QUE positionner (aucun fond, aucune bordure,
   aucun titre propre) : chaque commandant garde sa propre .cmd-cage
   INDÉPENDANTE et INCHANGÉE (taille/bordure/comportement — voir game.css,
   jamais modifié). Avec un seul commandant, un seul .cmd-cage à l'intérieur
   = rendu strictement identique à l'ancien (pré-Partner). */
.cmd-cages-container {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
/* Taxe individuelle — dérivée uniquement de commanderCastCount, jamais un
   compteur éditable séparément — badge discret sur la cage concernée. */
.cmd-tax-badge {
  position: absolute;
  top: -5px;
  left: -5px;
  z-index: 14;
  background: rgba(20, 14, 6, .95);
  border: 1px solid rgba(226, 192, 105, .6);
  color: #e2c069;
  font-family: 'JetBrains Mono', monospace;
  font-size: .58rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 8px;
  line-height: 1.3;
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .6);
}

/* ── Dégâts de commandant à deux sources (en-tête joueur) ──────────────
   Résumé compact "Léa : Kraum 4 · Vial 2" — chaque commandant garde son nom
   affiché (jamais seulement une couleur) pour rester distinguable. */
.cmd-dmg-multi {
  display: flex;
  flex-direction: column;
  gap: 1px;
  align-items: flex-start;
}
.cmd-dmg-pair {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.cmd-dmg-pair .fd-btn {
  width: 13px; height: 13px;
  font-size: .55rem;
}

/* ── Mode Commander 2v2 (Two-Headed Giant) — badges d'équipe lobby ──
   Même palette que les lignes de combat (game.js/COMBAT_LINE_PALETTE) :
   doré pour l'équipe A, cyan pour l'équipe B — cohérence visuelle entre
   le lobby et le plateau de jeu. */
.badge-team {
  font-size: 0.65rem;
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-team-a {
  background: rgba(226,192,105,.15);
  color: #e2c069;
  border: 1px solid rgba(226,192,105,.35);
}
.badge-team-b {
  background: rgba(79,209,197,.15);
  color: #4fd1c5;
  border: 1px solid rgba(79,209,197,.35);
}
.player-card.team-a { border-left: 3px solid rgba(226,192,105,.5); }
.player-card.team-b { border-left: 3px solid rgba(79,209,197,.5); }

/* ── Mode 2v2 — plateau de jeu ────────────────────────────────
   Bordure de zone reprenant la couleur d'équipe (même logique que les
   rangées WUBRG existantes) — regroupe visuellement les deux coéquipiers
   sans toucher au layout 2×2 existant (réutilisé tel quel). Contour complet
   + accent gauche épais (pas juste un mince liseré, pour bien "capter qui
   est avec qui" au premier coup d'œil). */
.player-zone.team-a { box-shadow: inset 0 0 0 2px rgba(226,192,105,.35), inset 5px 0 0 rgba(226,192,105,.75); }
.player-zone.team-b { box-shadow: inset 0 0 0 2px rgba(79,209,197,.35), inset 5px 0 0 rgba(79,209,197,.75); }
/* Combiné avec le cadre "tour actif" (game.css .player-zone.active) — sans
   règle dédiée, le box-shadow de team-a/b écraserait celui de .active (même
   spécificité, immersion.css chargé après game.css) au lieu de s'additionner. */
.player-zone.active.team-a {
  box-shadow: inset 0 0 22px rgba(226,192,105,.14), inset 0 0 8px rgba(226,192,105,.07), inset 5px 0 0 rgba(226,192,105,.75);
}
.player-zone.active.team-b {
  box-shadow: inset 0 0 22px rgba(226,192,105,.14), inset 0 0 8px rgba(226,192,105,.07), inset 5px 0 0 rgba(79,209,197,.75);
}
/* Badge "Équipe A/B" dans le header de chaque zone (renderPlayerZone) */
.fd-team-badge {
  font-family: 'Cinzel', serif;
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}
.fd-team-a { background: rgba(226,192,105,.18); color: #e2c069; border: 1px solid rgba(226,192,105,.4); }
.fd-team-b { background: rgba(79,209,197,.18); color: #4fd1c5; border: 1px solid rgba(79,209,197,.4); }


/* Main du coéquipier (2v2) — bande de vignettes en lecture seule dans la
   zone du coéquipier, sous les rangées du board. */
.team-hand-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  margin-top: 2px;
  border-top: 1px dashed rgba(226,192,105,.15);
}
.team-hand-label {
  font-family: 'Cinzel', serif;
  font-size: .62rem;
  color: rgba(226,192,105,.7);
  white-space: nowrap;
  flex-shrink: 0;
}
.team-hand-strip {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.team-hand-thumb {
  width: 34px;
  height: 47px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid rgba(226,192,105,.3);
  flex-shrink: 0;
  cursor: default;
}


/* ═══ Polish visuel — groupe 1 (audit juillet 2026) ═══════════════════════
   1) Unification de l'or. La convention du projet est #e2c069 (immersion/
   platform), mais lobby.css définit --gold:#d4af37 (or legacy saturé) que
   toute la base game/lobby consomme via var(--gold). game.css/lobby.css
   étant intouchables, on redéfinit les variables ICI : ce fichier est chargé
   après lobby.css, cette :root gagne donc la cascade. Les rouges d'alerte
   (--red, tons rgba(200,50,50,…)) ne sont volontairement pas touchés. */
:root {
  --gold: #e2c069;
  --gold-dim: #97803f;              /* déclinaison sombre de #e2c069 (ex-#8b6914) */
  --border: rgba(226, 192, 105, .2);
  --border-hi: rgba(226, 192, 105, .6);
}

/* 2) Étiquettes de rangées (CRÉA/ART/LAND) : .47rem ≈ 7px, illisible.
   Définies avec !important dans arcanum-rows.css (hors périmètre de cette
   passe) → il faut ici une spécificité supérieure ET !important. Correction
   plus propre possible directement dans arcanum-rows.css lors d'une
   prochaine passe. */
.game-board .zone-row .row-label {
  font-size: .62rem !important;
  opacity: .38 !important;
  letter-spacing: .08em !important;
}

/* 3) Panneaux admin (scores) et cartes bannies de l'accueil : contrôles
   stylés inline dans index.html sans font-family (→ Arial, défaut Windows)
   et à .65rem (~9.75px). La famille passe sans !important (l'inline ne la
   fixe pas) ; la taille doit surclasser l'inline. Les couleurs (dont les
   rouges Ban/Déban) restent celles de l'inline. */
#board-admin-pwd, #board-admin-size, #board-admin-wins, #board-admin-games,
#board-admin-name, #board-admin-name-preset, #board-admin-refresh-accounts,
#board-admin-save, #ban-password, #ban-card-input, #ban-add-btn,
#ban-remove-btn, #ban-copy-btn, #reset-ratelimit-btn {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: .7rem !important;
}

/* 4) Focus clavier visible sur tout le site (7 règles :focus pour ~180
   :hover avant cette passe). :focus-visible ne s'affiche qu'en navigation
   clavier — jamais au clic souris, donc zéro bruit visuel en jeu. */
button:focus-visible, a:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid rgba(226, 192, 105, .6);
  outline-offset: 2px;
}

/* Steppers −/+ Mill/Cascade/Discover (voir .lib-scry-row, index.html) — ne
   touche pas à game.css (interdit) : ces cartes sont des <button> (clic =
   lance l'action tout de suite), donc les steppers sont des <span> et pas de
   vrais <button> imbriqués (invalide en HTML), avec stopPropagation() inline
   pour ne pas déclencher Mill/Cascade/Discover en cliquant dessus. */
.lib-scry-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(226, 192, 105, .12);
  border: 1px solid rgba(226, 192, 105, .4);
  color: var(--gold, #e2c069);
  font-size: .85rem;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  transition: background .12s, border-color .12s;
}
.lib-scry-step:hover {
  background: rgba(226, 192, 105, .25);
  border-color: rgba(226, 192, 105, .7);
}

/* ══════════════════════════════════════════════════════════════
   ORDRE DE PASSAGE — lancer de dé collectif avant la partie
   Piloté par lobby.js (événements turn_order_*). Même langage
   visuel que #dice-overlay (gemme hexagonale violet/or) mais
   styles séparés : les gemmes sont ici miniatures et posées sur
   les cartes joueurs, qui se réordonnent une fois tous les jets
   connus. Les dimensions (--to-w, --to-art-h, --to-die, --to-h)
   sont calculées par lobby.js selon le nombre de joueurs et la
   largeur dispo — indispensable pour tenir à 5 joueurs et sur
   mobile.
   ══════════════════════════════════════════════════════════════ */
#turn-order-overlay {
  position: fixed; inset: 0; z-index: 9400;
  display: flex; align-items: center; justify-content: center;
  background: rgba(4, 2, 10, .93);
  backdrop-filter: blur(7px);
  animation: dice-overlay-in .35s ease-out;
  padding: 18px;
}
#turn-order-overlay.to-out { animation: to-fade-out .45s ease-in forwards; }
@keyframes to-fade-out { to { opacity: 0; } }

.to-box { display: flex; flex-direction: column; align-items: center; gap: 20px; max-width: 100%; }

.to-cap {
  font-family: 'Cinzel', serif; font-size: .6rem; font-weight: 700;
  letter-spacing: .3em; color: rgba(226, 192, 105, .6);
  text-transform: uppercase; text-align: center; min-height: 1em;
  transition: color .4s, font-size .4s;
}
.to-cap.final { color: #e2c069; font-size: .95rem; letter-spacing: .16em; }

.to-stage { position: relative; height: var(--to-h, 190px); margin: 0 auto; }

.to-card {
  /* top: 14px laisse dépasser la gemme (posée à -13px) sans la rogner */
  position: absolute; top: 14px; left: 0; width: var(--to-w, 120px);
  display: flex; flex-direction: column; align-items: center;
  transition: transform .8s cubic-bezier(.3, 1.12, .35, 1);
}
.to-art {
  position: relative;
  width: var(--to-w, 120px); height: var(--to-art-h, 130px);
  border-radius: 10px; border: 1px solid rgba(226, 192, 105, .22);
  background: linear-gradient(160deg, #1a1130 0%, #08050f 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; color: rgba(255, 255, 255, .22);
  overflow: hidden; opacity: .5;
  transition: opacity .45s, border-color .45s, box-shadow .45s;
}
.to-art img { width: 100%; height: 100%; object-fit: cover; }
.to-card.rolled .to-art { opacity: 1; }
.to-card.me    .to-art { border-color: rgba(226, 192, 105, .6); }
.to-card.lead  .to-art { border-color: #e2c069; box-shadow: 0 0 26px rgba(226, 192, 105, .35); }

.to-name {
  font-family: 'Cinzel', serif; font-size: .72rem; letter-spacing: .04em;
  color: rgba(255, 255, 255, .72); margin-top: 8px; text-align: center;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.to-status {
  font-size: .58rem; letter-spacing: .04em; color: rgba(255, 255, 255, .3);
  margin-top: 3px; text-align: center; min-height: .8em;
}
.to-status.ok { color: rgba(226, 192, 105, .8); }

/* ── Gemme miniature posée sur la carte ── */
.to-die {
  /* right/left des deux pastilles gardés DANS la carte : à -8px la gemme
     débordait dans le gouttière et recouvrait le badge de rang de la carte
     voisine une fois les cartes réordonnées. */
  position: absolute; top: -13px; right: -2px;
  width: var(--to-die, 48px); height: var(--to-die, 48px);
  display: flex; align-items: center; justify-content: center;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, .8));
}
.to-die-bg, .to-die-shine, .to-die-edge {
  position: absolute; inset: 0; pointer-events: none;
  clip-path: polygon(50% 0%, 97% 26%, 97% 74%, 50% 100%, 3% 74%, 3% 26%);
}
.to-die-bg { background: linear-gradient(160deg, #7848e8 0%, #3a1e9c 45%, #0e0428 100%); }
.to-die-shine { background: linear-gradient(128deg, rgba(255, 255, 255, .22) 0%, transparent 42%); }
.to-die-edge { inset: -2px; background: transparent; border: 2px solid rgba(226, 192, 105, .5); }
.to-die-num {
  position: relative; z-index: 2;
  font-family: 'Cinzel', serif; font-weight: 900;
  font-size: calc(var(--to-die, 48px) * .42);
  color: #f0dea0; line-height: 1;
  text-shadow: 0 0 12px rgba(226, 192, 105, .85), 0 2px 5px rgba(0, 0, 0, .85);
}
.to-die.rolling { animation: to-wobble 1.05s ease-in-out infinite; }
@keyframes to-wobble {
  0%, 100% { transform: rotate(-9deg) translateY(0); }
  50%      { transform: rotate(9deg) translateY(-5px); }
}
.to-die.landed { animation: to-slam .45s cubic-bezier(.15, 1.9, .4, 1) both; }
@keyframes to-slam { 0% { transform: scale(1.35); } 100% { transform: scale(1); } }
.to-die.win .to-die-bg  { background: linear-gradient(160deg, #f6e4a3 0%, #c9a227 48%, #4a3104 100%); }
.to-die.win .to-die-num { color: #fff; text-shadow: 0 0 18px #fff, 0 0 34px #f6e4a3; }
.to-die.win { filter: drop-shadow(0 0 22px rgba(246, 228, 60, .6)) drop-shadow(0 4px 12px rgba(0, 0, 0, .8)); }

/* ── Badge de rang, révélé après le classement ── */
.to-rank {
  position: absolute; top: -11px; left: 6px; z-index: 3;
  font-family: 'Cinzel', serif; font-size: .55rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: #0b0918; background: rgba(226, 192, 105, .92);
  border-radius: 999px; padding: 3px 9px;
  opacity: 0; transform: scale(.7);
  transition: opacity .35s, transform .35s cubic-bezier(.2, 1.8, .4, 1);
}
.to-rank.in { opacity: 1; transform: scale(1); }

/* ── Contrôle de lancer ── */
.to-ctl { display: flex; flex-direction: column; align-items: center; gap: 8px; min-height: 56px; }
.to-btn {
  font-family: 'Cinzel', serif; font-size: .72rem; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
  color: #0b0918; background: #e2c069;
  border: none; border-radius: 9px; padding: 12px 26px; cursor: pointer;
  transition: background .2s, transform .1s, box-shadow .2s;
  box-shadow: 0 0 24px rgba(226, 192, 105, .28);
}
.to-btn:hover:not(:disabled) { background: #f0dea0; box-shadow: 0 0 34px rgba(226, 192, 105, .45); }
.to-btn:active:not(:disabled) { transform: scale(.97); }
.to-btn:disabled {
  background: rgba(226, 192, 105, .12); color: rgba(226, 192, 105, .45);
  cursor: default; box-shadow: none;
}
.to-hint { font-size: .62rem; letter-spacing: .04em; color: rgba(255, 255, 255, .32); min-height: .9em; }

@media (max-width: 640px) {
  .to-cap { font-size: .52rem; letter-spacing: .22em; }
  .to-cap.final { font-size: .78rem; }
  .to-btn { font-size: .64rem; padding: 11px 20px; }
}

/* ── Decks sauvegardés : grille de cartes (#my-decks-list) ────── */
#my-decks-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: .5rem;
  max-height: 290px;
  overflow-y: auto;
  padding: 2px;
}
.my-deck-tile {
  position: relative;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255,255,255,.05);
  transition: border-color .12s, transform .12s;
}
.my-deck-tile:hover { border-color: rgba(226,192,105,.6); transform: translateY(-1px); }
.my-deck-tile.loaded { border-color: rgba(100,170,255,.9); box-shadow: 0 0 0 1px rgba(100,170,255,.5); }
.my-deck-art { height: 72px; }
.my-deck-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.my-deck-name {
  font-size: .68rem; font-weight: 600; padding: .3rem .4rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.my-deck-del {
  position: absolute; top: 3px; right: 3px; opacity: 0;
  font-size: .62rem; padding: .15rem .3rem; cursor: pointer;
  background: rgba(20,10,10,.8); border: 1px solid rgba(220,60,60,.5);
  border-radius: 4px; color: #f99; transition: opacity .12s;
}
.my-deck-tile:hover .my-deck-del { opacity: 1; }
#my-decks-list > .my-deck-tile.deck-row-dragging { opacity: .4; }

#my-decks-search {
  background: rgba(8,8,24,.6);
  color: #e8e8f4;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 6px;
  outline: none;
  color-scheme: dark;
}
#my-decks-search::placeholder { color: rgba(255,255,255,.4); }
#my-decks-search:focus { border-color: rgba(226,192,105,.6); }

/* ── Plateau 2 joueurs et plus (cases étroites, surtout au zoom) ─────────
   L'en-tête garde sa ligne unique d'avant ; on resserre juste un peu les
   espacements pour qu'elle tienne dans les cases étroites. Si ça ne suffit
   vraiment pas (gros zoom), le bloc de droite passe en entier sur une 2e ligne
   au lieu d'être rogné ; _fitHeaderControls (game.js) le réduit alors juste
   assez pour qu'il tienne sur cette ligne. */
.game-board.board-multi .fd-header {
  height: auto !important;
  min-height: 46px !important;
  flex-wrap: wrap !important;
  padding-left: 6px !important;
  padding-right: 6px !important;
}
.game-board.board-multi .fd-left { min-width: 0; gap: 4px; }
.game-board.board-multi .fd-counts { gap: 5px; }
.game-board.board-multi .fd-group { padding: 0 4px; gap: 2px; }
.game-board.board-multi .fd-right { margin-left: auto; flex: 0 0 auto; flex-wrap: nowrap; }

/* ── Main nombreuse (> 12 cartes) : deux rangées qui se chevauchent ──
   Posé par renderHand (game.js). --hand-ml = chevauchement horizontal calculé. */
.my-hand.hand-two-rows {
  flex-direction: column !important;
  align-items: center !important;
  min-height: 0 !important;
}
.my-hand.hand-two-rows .hand-row {
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.my-hand.hand-two-rows .hand-row + .hand-row { margin-top: -65px; }
.my-hand.hand-two-rows .hand-card {
  width: 104px !important;
  height: 145px !important;
  margin-left: var(--hand-ml, -20px) !important;
}
.my-hand.hand-two-rows .hand-card:first-child { margin-left: 0 !important; }
.my-hand.hand-two-rows .hand-card.is-landscape {
  width: 158px !important;
  height: 110px !important;
}


/* ═══ Audit visuel 2026-10-28 — phase visible, header en 3 niveaux, choix de bibliothèque ═══ */

/* Niveau 2 : outils (Notes, Deck, Token, Stats) — fond sombre, filet or */
.header-actions .btn-game:not(.btn-next-phase):not(.btn-end-turn) {
  background: rgba(226,192,105,.06) !important; color: rgba(255,255,255,.82) !important;
  border: 1px solid rgba(226,192,105,.22) !important; border-radius: 8px !important; transition: .15s;
}
.header-actions .btn-game:not(.btn-next-phase):not(.btn-end-turn):hover { background: rgba(226,192,105,.16) !important; border-color: rgba(226,192,105,.55) !important; color: #fff !important; }

/* Niveau 1 : les deux boutons du cœur de boucle */
.header-actions .btn-next-phase, .header-actions .btn-end-turn { height: 34px !important; max-height: 34px !important; font-size: .8rem !important; padding: 0 16px !important; border-radius: 9px !important; }
.header-actions .btn-end-turn { background: transparent !important; border: 1px solid rgba(226,192,105,.75) !important; color: #e2c069 !important; font-weight: 600 !important; box-shadow: none !important; }
.header-actions .btn-end-turn:disabled { opacity: .45; }
.header-actions .btn-end-turn:hover:not(:disabled) { background: rgba(226,192,105,.14) !important; color: #fff !important; }

/* Niveau 3 : menu « ⋯ » */
.hdr-more { position: relative; margin-left: auto; order: 5; }
.hdr-more > button { height: 26px; width: 34px; border-radius: 8px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.16); color: #e8e4f5; font-size: 1rem; line-height: 1; cursor: pointer; }
.hdr-more > button:hover { border-color: rgba(226,192,105,.55); color: #e2c069; }
.hdr-more-menu { position: absolute; right: 0; top: 120%; min-width: 220px; z-index: 9100; background: rgba(11,9,24,.98); border: 1px solid rgba(226,192,105,.35); border-radius: 10px; padding: 6px; box-shadow: 0 14px 40px rgba(0,0,0,.7); display: none; flex-direction: column; gap: 2px; }
.hdr-more.open .hdr-more-menu { display: flex; }
.header-actions .hdr-more-menu .btn-game:not(.btn-next-phase):not(.btn-end-turn) { height: auto !important; max-height: none !important; width: 100%; text-align: left; padding: 8px 10px !important; font-size: .78rem !important; background: none !important; border: 0 !important; color: #e8e4f5 !important; }
.header-actions .hdr-more-menu .btn-game:not(.btn-next-phase):not(.btn-end-turn):hover { background: rgba(226,192,105,.12) !important; }
.header-actions .hdr-more-menu .btn-game:not(.btn-next-phase):not(.btn-end-turn).btn-surrender { color: #ff8f8f !important; }
.header-actions .hdr-more-menu .btn-game:not(.btn-next-phase):not(.btn-end-turn).btn-surrender:hover { background: rgba(224,85,85,.14) !important; }
.hdr-more-sep { height: 1px; background: rgba(255,255,255,.08); margin: 3px 4px; }


/* 1. Le fond défile au lieu de couper le haut (avant : boîte de 1227px, titre inaccessible) */
#library-choice-overlay { align-items: safe center !important; overflow-y: auto !important; padding: 16px 0; }
#library-choice-overlay .lib-choice-box {
  max-width: 780px !important; width: calc(100% - 32px) !important;
  padding: 1.1rem 1.4rem 1rem !important; gap: .7rem !important; margin: auto;
}
.lib-choice-title { font-size: 1.15rem !important; }
.lib-choice-sub   { font-size: .78rem !important; margin: 0 !important; }

/* 2. Grille 12 colonnes : 3 modes de lecture (gros) puis 4 effets spéciaux (petits) */
.lib-choice-options { display: grid !important; grid-template-columns: repeat(12, 1fr) !important; gap: .55rem !important; width: 100%; }
.lib-choice-btn { grid-column: span 4; padding: .7rem .6rem !important; gap: .25rem !important; min-height: 0; }
.lib-choice-btn:nth-child(-n+2) { grid-column: span 6; padding: .9rem .7rem !important; }
.lib-choice-btn:nth-child(-n+2) .lib-choice-icon { font-size: 2rem !important; }
.lib-choice-icon  { font-size: 1.4rem !important; line-height: 1; }
.lib-choice-label { font-size: .9rem !important; }
.lib-choice-desc  { font-size: .68rem !important; line-height: 1.35 !important; }

/* 3. Mode le plus courant mis en avant (Normal = prendre une carte / tuteur) */
#btn-lib-normal { border-color: rgba(226,192,105,.55) !important; background: linear-gradient(180deg, rgba(226,192,105,.10), rgba(226,192,105,.02)) !important; }

/* 4. Étiquette de groupe pour les 4 effets spéciaux (discrète) */
#btn-lib-mill { position: relative; margin-top: 1.1rem; }
#btn-lib-mill::before {
  content: "Effets spéciaux"; position: absolute; top: -1.15rem; left: 2px; white-space: nowrap;
  font: 600 .6rem/1 'Cinzel', serif; letter-spacing: .14em; text-transform: uppercase; color: rgba(226,192,105,.55);
}
#btn-lib-cascade, #btn-lib-discover { margin-top: 1.1rem; }
#btn-lib-jodah { grid-column: 3 / span 4; margin-top: .2rem; }
#btn-lib-fof { grid-column: 7 / span 4; margin-top: .2rem; }

/* 5. Mini-compteur X : plus compact */
.lib-scry-row { font-size: .72rem !important; gap: .3rem !important; margin-top: .15rem; }
.lib-scry-row input[type=number] { width: 44px !important; }

/* 6. Confirmation Pile/Scry : collée en bas, toujours visible sans défiler */
#pile-confirm-section, #scry-confirm-section {
  position: sticky; bottom: 0; width: 100%; margin-top: 0 !important; box-sizing: border-box;
  display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: .8rem !important; text-align: left !important;
  backdrop-filter: blur(6px); background: rgba(24,18,52,.96) !important;
}
#pile-confirm-section[style*="display: none"], #scry-confirm-section[style*="display: none"] { display: none !important; }
#pile-confirm-section > div:first-child, #scry-confirm-section > div:first-child { margin: 0 !important; grid-column: 1; white-space: nowrap; }
#pile-confirm-section > div:nth-child(2), #scry-confirm-section > div:nth-child(2) { margin: 0 !important; grid-column: 2; }
#btn-confirm-pile, #btn-confirm-scry { grid-column: 3; width: 100% !important; padding: 10px 18px !important; }

/* ═══ Audit visuel 2026-10-28 — panneau « Ta bibliothèque » ═══
   Scopé par .lib2-on (posé par openLibraryBrowser, game.js) : les
   bibliothèques/mains adverses qui réutilisent la même modale ne changent pas. */
#library-modal.lib2-on .zone-modal-box {
  width: min(1180px, 96vw) !important; max-width: none !important;
  height: min(820px, 92vh); max-height: 92vh !important;
  background: linear-gradient(180deg, #131028, #0d0b1d);
  border: 1px solid rgba(226,192,105,.28); border-radius: 16px;
  box-shadow: 0 30px 90px rgba(0,0,0,.85), inset 0 1px 0 rgba(226,192,105,.12);
}
#library-modal.lib2-on .zone-modal-header { padding: .9rem 1.2rem; border-bottom: 1px solid rgba(226,192,105,.14); gap: .8rem; }
#library-modal.lib2-on .zone-modal-header > span { font: 600 1.15rem/1 'Cinzel', serif; letter-spacing: .06em; color: #e2c069; display: flex; align-items: center; gap: .6rem; margin-right: auto; }
#library-modal.lib2-on .lib2-count { font: 500 .72rem 'JetBrains Mono', monospace; letter-spacing: 0; color: #b9b2d8; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: 999px; padding: 3px 10px; }
#library-modal.lib2-on #btn-shuffle-library { background: #e2c069; color: #1a1306; border: 0; font-weight: 700; border-radius: 8px; padding: .5rem .9rem !important; font-size: .78rem !important; }
#library-modal.lib2-on #btn-shuffle-library:hover { filter: brightness(1.1); }

/* Barre de mode : un sélecteur segmenté + une phrase d'explication */
#library-modal.lib2-on .library-mode-bar { gap: 1rem; padding: .7rem 1.2rem; border-bottom: 1px solid rgba(255,255,255,.06); }
#library-modal.lib2-on .lib2-explain { font-size: .76rem; color: #9d96c0; flex: 1; min-width: 220px; }
#library-modal.lib2-on .lib2-explain strong { color: #e2c069; font-weight: 600; }
.lib2-menu { position: relative; }
.lib2-pop { position: absolute; right: 0; top: 115%; min-width: 250px; background: rgba(11,9,24,.98); border: 1px solid rgba(226,192,105,.35); border-radius: 10px; padding: 6px; z-index: 6; box-shadow: 0 14px 40px rgba(0,0,0,.7); display: flex; flex-direction: column; gap: 2px; }
.lib2-pop[hidden] { display: none; }
.lib2-pop button { display: block; width: 100%; text-align: left; background: none; border: 0; color: #e8e4f5; font: 500 .78rem 'Inter', sans-serif; padding: .5rem .6rem; border-radius: 6px; cursor: pointer; }
.lib2-pop button:hover { background: rgba(226,192,105,.12); }
.lib2-pop small { display: block; color: #8e87b3; font-size: .66rem; margin-top: 2px; }
#library-modal.lib2-on #btn-sort-lib, #library-modal.lib2-on #btn-sort-lib-cmc, #library-modal.lib2-on #btn-fof { background: none; border: 0; margin-left: 0; }

/* Recherche + filtres de type avec compteurs */
#library-modal.lib2-on #library-search-bar { display: flex !important; flex-wrap: nowrap !important; align-items: center !important; gap: .6rem !important; padding: .7rem 1.2rem .3rem !important; border: 0 !important; }
#library-modal.lib2-on #library-search-bar input { min-width: 0; width: auto !important; flex: 1 !important; }
#library-modal.lib2-on #library-search-bar input { background: rgba(0,0,0,.4) !important; border: 1px solid rgba(255,255,255,.14) !important; border-radius: 10px !important; padding: .55rem .9rem !important; font-size: .9rem !important; }
#library-modal.lib2-on #library-search-bar input:focus { border-color: #e2c069 !important; box-shadow: 0 0 0 3px rgba(226,192,105,.14); }
#library-modal.lib2-on #lib-filter-tabs { padding: .3rem 1.2rem .7rem !important; gap: .4rem !important; border-bottom: 1px solid rgba(255,255,255,.06) !important; }
#library-modal.lib2-on #lib-filter-tabs .htt { font: 500 .72rem 'Inter', sans-serif; color: #b9b2d8; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); border-radius: 999px; padding: .28rem .7rem; letter-spacing: 0; text-transform: none; }
#library-modal.lib2-on #lib-filter-tabs .htt i { font: 500 .66rem 'JetBrains Mono', monospace; color: #7f78a3; margin-left: .35rem; }
#library-modal.lib2-on #lib-filter-tabs .htt.active { color: #e2c069; border-color: rgba(226,192,105,.55); background: rgba(226,192,105,.12); }
/* Scry / Voir : peu de cartes, pas de recherche ni de filtres */
#library-modal.lib2-short #library-search-bar, #library-modal.lib2-short #lib-filter-tabs { display: none !important; }

/* Grille : cartes lisibles (≥128 px), nom sur une ligne */
#library-modal.lib2-on #library-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 16px 14px; align-content: start;
  padding: .8rem 1.2rem 1rem; overflow-y: auto; flex: 1; min-height: 0; scrollbar-color: rgba(226,192,105,.3) transparent;
}
#library-modal.lib2-on #library-grid > .zone-modal-empty { grid-column: 1 / -1; }
#library-modal.lib2-on .lib2-card { position: relative; align-items: stretch; gap: 6px; }
#library-modal.lib2-on .lib2-art { position: relative; aspect-ratio: 5 / 7; border-radius: 8px; overflow: hidden; border: 1px solid rgba(255,255,255,.12); background: #1a1736; transition: transform .15s, border-color .15s, box-shadow .15s; }
#library-modal.lib2-on .lib2-art img { width: 100%; height: 100%; border: 0; border-radius: 0; object-fit: cover; display: block; }
#library-modal.lib2-on .lib2-art img:hover { transform: none; }
#library-modal.lib2-on .lib2-card:hover .lib2-art { transform: translateY(-3px); border-color: rgba(226,192,105,.7); box-shadow: 0 10px 26px rgba(0,0,0,.6), 0 0 0 1px rgba(226,192,105,.25); }
#library-modal.lib2-on .lib2-card.lib-locked { outline: 0; }
#library-modal.lib2-on .lib2-card.lib-locked .lib2-art { border-color: rgba(255,200,0,.75); box-shadow: 0 0 0 1px rgba(255,200,0,.35); }
#library-modal.lib2-on .lib2-pos { align-self: flex-start; width: auto; min-height: 16px; line-height: 16px; font: 600 .62rem/16px 'JetBrains Mono', monospace; color: #8e87b3; letter-spacing: .06em; background: none; padding: 0; }
#library-modal.lib2-on .lib2-pos--top { color: #1a1306; background: #e2c069; border-radius: 4px; padding: 1px 6px; }
#library-modal.lib2-on .lib2-art--blank { display: flex; align-items: center; justify-content: center; padding: 8px; text-align: center; font: 600 .78rem 'Cinzel', serif; color: #cfc9e8; }
#library-modal.lib2-on .lib2-name { font: 500 .72rem 'Inter', sans-serif; color: #cfc9e8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; max-width: none; }

/* Actions : cachées au repos, bandeau au survol — 1 action principale + icônes avec info-bulle */
#library-modal.lib2-on .lib2-actions { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 4px; padding: 6px; background: linear-gradient(0deg, rgba(8,6,18,.96) 55%, rgba(8,6,18,0)); opacity: 0; transform: translateY(6px); transition: .15s; z-index: 3; width: auto; }
#library-modal.lib2-on .lib2-card:hover .lib2-actions, #library-modal.lib2-on .lib2-card:focus-within .lib2-actions { opacity: 1; transform: none; }
#library-modal.lib2-on .lib2-act { flex: 1; font: 700 .7rem 'Inter', sans-serif; color: #1a1306; background: #e2c069; border: 0; border-radius: 6px; padding: .42rem .3rem; cursor: pointer; }
#library-modal.lib2-on .lib2-act:hover { filter: brightness(1.1); background: #e2c069; }
#library-modal.lib2-on .lib2-ico { width: 28px; flex: none; color: #e8e4f5; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); border-radius: 6px; cursor: pointer; font-size: .8rem; position: relative; padding: 0; }
#library-modal.lib2-on .lib2-ico:hover { background: rgba(226,192,105,.25); border-color: #e2c069; }
#library-modal.lib2-on .lib2-ico[data-tip]:hover::after { content: attr(data-tip); position: absolute; bottom: 125%; right: 0; white-space: nowrap; font: 500 .68rem 'Inter', sans-serif; color: #fff; background: #000; border: 1px solid rgba(226,192,105,.4); border-radius: 5px; padding: 3px 7px; z-index: 5; }
/* Menu « ⋯ » d'une carte (reste dans la carte : .lib2-art coupe ce qui dépasse) */
#library-modal.lib2-on .lib2-cardmenu { display: none; position: absolute; left: 6px; right: 6px; bottom: 44px; z-index: 4; flex-direction: column; background: rgba(11,9,24,.98); border: 1px solid rgba(226,192,105,.4); border-radius: 8px; padding: 4px; box-shadow: 0 8px 24px rgba(0,0,0,.7); }
#library-modal.lib2-on .lib2-cardmenu.open { display: flex; }
#library-modal.lib2-on .lib2-cardmenu button { text-align: left; background: none; border: 0; color: #e8e4f5; font: 500 .68rem 'Inter', sans-serif; padding: .4rem .45rem; border-radius: 5px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#library-modal.lib2-on .lib2-cardmenu button:hover { background: rgba(226,192,105,.14); }

/* Scry / Voir le dessus : N cartes plus grandes, boutons toujours visibles */
#library-modal.lib2-on #library-grid.lib2-grid--scry { grid-template-columns: repeat(auto-fit, minmax(150px, 170px)); justify-content: center; gap: 22px 18px; padding-top: 1.6rem; }
#library-modal.lib2-on .lib2-grid--scry .lib2-actions { position: static; opacity: 1; transform: none; background: none; padding: 0; }
#library-modal.lib2-on .lib2-grid--scry .lib2-act--ghost { color: #cfc9e8; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.18); }
#library-modal.lib2-on .lib2-grid--scry .lib2-card[draggable="true"] .lib2-art { cursor: grab; }
#library-modal.lib2-on .lib2-grip { position: absolute; top: 5px; right: 5px; font-size: .8rem; color: #e2c069; background: rgba(8,6,18,.82); border-radius: 5px; padding: 1px 6px; z-index: 2; }

/* Pied : aide discrète + validation de l'ordre */
.lib2-foot { display: none; align-items: center; gap: 1rem; padding: .7rem 1.2rem; border-top: 1px solid rgba(226,192,105,.14); background: rgba(0,0,0,.25); flex-shrink: 0; }
#library-modal.lib2-on .lib2-foot { display: flex; }
.lib2-hint { font-size: .72rem; color: #8e87b3; flex: 1; }
.lib2-hint b { font-weight: 600; color: #e2c069; }
.lib2-validate { background: #e2c069 !important; color: #1a1306 !important; border: 0 !important; font-weight: 700; border-radius: 8px; padding: .5rem 1.1rem !important; }
.lib2-validate[hidden] { display: none; }

@media (max-width: 700px) {
  #library-modal.lib2-on .zone-modal-header { flex-wrap: wrap; padding: .7rem .9rem; gap: .5rem; }
  #library-modal.lib2-on .zone-modal-header > span { flex: 1 1 100%; font-size: .95rem; margin-right: 0; }
  #library-modal.lib2-on #btn-shuffle-library { flex: 1; }
  #library-modal.lib2-on .library-mode-bar { padding: .6rem .9rem; gap: .6rem; }
  #library-modal.lib2-on #library-search-bar, #library-modal.lib2-on #lib-filter-tabs { padding-left: .9rem !important; padding-right: .9rem !important; }
  #library-modal.lib2-on #library-grid { padding: .8rem .9rem 1rem; }
}

/* ═══ Accueil : « Créer un lobby » d'abord, le code devient un simple repli ═══ */
.join-open-hint { margin: .9rem 0 0; font-size: .76rem; line-height: 1.45; color: rgba(255,255,255,.5); text-align: center; }
.join-code-fallback { margin-top: .9rem; text-align: center; }
.join-code-fallback summary { display: inline-block; cursor: pointer; list-style: none; font-size: .74rem; color: rgba(255,255,255,.4); padding: .2rem .4rem; border-radius: 6px; }
.join-code-fallback summary::-webkit-details-marker { display: none; }
.join-code-fallback summary:hover { color: #e2c069; }
.join-code-row { display: flex; gap: .5rem; margin-top: .6rem; }
.join-code-row input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: .3em; text-align: center; font-size: 1rem; }
.join-code-row .btn { width: auto; flex: none; padding-left: 1rem; padding-right: 1rem; }

/* ═══ Zones à gauche de la pioche (la Pioche elle-même n'est pas touchée) ═══
   1 gros bouton Bibliothèque · 3 actions nommées · 3 tuiles de zones · « ⋯ Plus ». */
.zone-strip { width: 156px !important; height: 152px !important; gap: 4px !important; }
.zs-lib2 { display: flex; align-items: center; justify-content: space-between; height: 34px; flex-shrink: 0; padding: 0 10px; border-radius: 9px; cursor: pointer;
  background: linear-gradient(180deg, rgba(226,192,105,.16), rgba(226,192,105,.05)); border: 1px solid rgba(226,192,105,.6); color: #e2c069;
  font: 700 .64rem 'Cinzel', serif; letter-spacing: .04em; transition: filter .12s; }
.zs-lib2:hover { filter: brightness(1.25); }
.zs-lib2-count { font: 700 .72rem 'JetBrains Mono', monospace; letter-spacing: 0; color: #1a1306; background: #e2c069; border-radius: 999px; padding: 1px 8px; }
.zs-quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; height: 38px; flex-shrink: 0; }
.zs-q { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 2px 0; border-radius: 8px; cursor: pointer;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.14); color: #e2c069; transition: background .12s, border-color .12s; }
.zs-q i { font-style: normal; font-size: .95rem; line-height: 1; }
.zs-q span { font: 600 .5rem 'Inter', sans-serif; color: #cfc9e8; }
.zs-q:hover { background: rgba(226,192,105,.14); border-color: rgba(226,192,105,.5); }
.zs-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; height: 40px; flex-shrink: 0; }
.zs-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border-radius: 8px; border: 1px solid; cursor: pointer; user-select: none; transition: filter .12s, transform .12s; }
.zs-tile b { font: 700 .9rem 'JetBrains Mono', monospace; line-height: 1; font-variant-numeric: tabular-nums; }
.zs-tile span { font: 600 .43rem 'Cinzel', serif; letter-spacing: .05em; text-transform: uppercase; }
.zs-tile:hover { filter: brightness(1.3); }
.zs-t-gy  { background: rgba(224,85,85,.12);   border-color: rgba(224,85,85,.45);   color: #ff9d9d; }
.zs-t-ex  { background: rgba(226,192,105,.09); border-color: rgba(226,192,105,.4);  color: #e2c069; }
.zs-t-out { background: rgba(150,100,220,.12); border-color: rgba(150,100,220,.45); color: #c8a8ff; }
.zs-tile.drag-over { filter: brightness(1.6); border-color: rgba(226,192,105,.9); transform: scale(1.06); }
.zs-more-wrap { position: relative; height: 24px; flex-shrink: 0; }
.zs-more { height: 24px; padding: 0 12px; border-radius: 8px; cursor: pointer; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.14); color: #cfc9e8; font: 600 .62rem 'Inter', sans-serif; }
.zs-more:hover { border-color: rgba(226,192,105,.5); color: #e2c069; }
.zs-more-menu { position: absolute; left: 0; bottom: calc(100% + 6px); width: 270px; z-index: 30; display: flex; flex-direction: column; gap: 2px; padding: 6px;
  background: #0b0918; border: 1px solid rgba(226,192,105,.4); border-radius: 10px; box-shadow: 0 14px 40px rgba(0,0,0,.7); }
.zs-more-menu[hidden] { display: none; }
.zs-mi { text-align: left; background: none; border: 0; color: #e2c069; font: 600 .72rem 'Inter', sans-serif; padding: 7px 9px; border-radius: 6px; cursor: pointer; }
.zs-mi:hover { background: rgba(226,192,105,.14); }

/* ═══ Donner une carte : panneau « Donner à un joueur » (fenêtres cimetière / exil) ═══ */
.zone-modal-box.has-give-panel { position: relative; padding-right: 262px; }
.zone-give-panel { position: absolute; top: 0; right: 0; bottom: 0; width: 262px; display: flex; flex-direction: column; gap: 10px; padding: 16px; overflow-y: auto;
  border-left: 1px solid rgba(226,192,105,.14); background: rgba(0,0,0,.28); }
.zone-give-panel h4 { margin: 0; font: 600 .8rem 'Cinzel', serif; letter-spacing: .1em; color: #e2c069; text-transform: uppercase; }
.zone-give-panel p { margin: 0; font: 400 .72rem/1.45 'Inter', sans-serif; color: #8e87b3; }
.zone-give-panel p b { color: #e8e4f5; }
.zone-give-target { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px; border-radius: 12px; border: 2px dashed rgba(255,255,255,.2); background: rgba(255,255,255,.03); transition: border-color .12s, background .12s, box-shadow .12s; }
.zone-give-target.hov { border-color: #e2c069; background: rgba(226,192,105,.14); box-shadow: 0 0 0 4px rgba(226,192,105,.12), 0 0 22px rgba(226,192,105,.35); }
.zg-av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: #1d1940; border: 1px solid rgba(226,192,105,.5); color: #e2c069; font: 700 1rem 'Cinzel', serif; }
.zg-n b { display: block; font: 600 .86rem 'Inter', sans-serif; color: #e8e4f5; }
.zg-n small { font: 400 .68rem 'Inter', sans-serif; color: #8e87b3; }
.zg-hint { flex-basis: 100%; font: 500 .68rem 'Inter', sans-serif; color: #b9b2d8; }
.zone-give-target.hov .zg-hint { color: #e2c069; font-weight: 700; }
.zone-modal-card[draggable="true"] { cursor: grab; }
.zone-modal-card.dragging { opacity: .4; }

/* ═══ Donner une carte : cibles agrandies sur les adversaires ═══
   Toujours un peu plus grosses ; pendant un glisser (body.dragging-card) elles
   grossissent encore par transform (aucun décalage de mise en page) et s'éclairent. */
.give-target { cursor: pointer; border-radius: 8px; transition: transform .12s, box-shadow .12s, background .12s; }
.fd-counts span.give-target { display: inline-flex; align-items: center; gap: 5px !important; min-height: 30px; padding: 2px 8px; font-size: 1.25rem !important; line-height: 1; }
.fd-counts span.give-target b { font-size: 1rem !important; }
.fd-counts span.give-target .fd-star-icon { font-size: 1.25rem !important; }
.pz-stat.give-target { min-height: 26px; padding: 2px 8px; font-size: .95rem; }
/* Aucun fond ajouté : les icônes gardent leur teinte d'origine (game.css). Pendant un
   glisser, seul un contour fin les signale. */
body.dragging-card .give-target { transform: scale(1.25); outline: 1px dashed rgba(255,255,255,.55); position: relative; z-index: 5; }
body.dragging-card .give-target.zone-give-drop-hover { transform: scale(1.4); outline: 2px solid rgba(255,255,255,.9); }

/* ═══ Refonte des fenêtres Cimetière / Exil / Hors jeu (« zone2 ») ═══
   Même habillage que « Ta bibliothèque » : en-tête avec compteur, une barre d'outils
   (filtres à gauche, actions côte à côte à droite), cartes lisibles avec actions au survol. */
.zone-modal-box.zone2 {
  width: min(1180px, 96vw) !important; max-width: none !important;
  height: min(760px, 90vh); max-height: 90vh !important;
  background: linear-gradient(180deg, #131028, #0d0b1d) !important;
  border: 1px solid rgba(226,192,105,.28) !important; border-radius: 16px !important;
  box-shadow: 0 30px 90px rgba(0,0,0,.85), inset 0 1px 0 rgba(226,192,105,.12);
}
.zone2 .zone-modal-header { padding: .9rem 1.2rem; border-bottom: 1px solid rgba(226,192,105,.14); gap: .8rem; }
.zone2 .zone-modal-header > span { font: 600 1.15rem/1 'Cinzel', serif; letter-spacing: .06em; color: #e2c069; display: flex; align-items: center; gap: .6rem; }
.zone2-count { font: 500 .72rem 'JetBrains Mono', monospace; letter-spacing: 0; color: #b9b2d8; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: 999px; padding: 3px 10px; }

.zone2-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; flex-shrink: 0; padding: .7rem 1.2rem; border-bottom: 1px solid rgba(255,255,255,.06); }
.zone2-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.zone2-chip { font: 500 .72rem 'Inter', sans-serif; color: #b9b2d8; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); border-radius: 999px; padding: .28rem .7rem; cursor: pointer; }
.zone2-chip i { font: 500 .66rem 'JetBrains Mono', monospace; font-style: normal; color: #7f78a3; margin-left: .35rem; }
.zone2-chip:hover { border-color: rgba(226,192,105,.4); color: #e8e4f5; }
.zone2-chip.is-on { color: #e2c069; border-color: rgba(226,192,105,.55); background: rgba(226,192,105,.12); }
.zone2-tools { display: flex; gap: .5rem; flex-wrap: wrap; }
.zone2-tool { font: 600 .74rem 'Inter', sans-serif; color: #e8e4f5; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); border-radius: 8px; padding: .5rem .85rem; cursor: pointer; white-space: nowrap; transition: .15s; }
.zone2-tool:hover { background: rgba(226,192,105,.12); border-color: rgba(226,192,105,.45); color: #fff; }

.zone2 .zone-modal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 16px 14px; align-content: start; padding: 1rem 1.2rem; overflow-y: auto; flex: 1; min-height: 0 !important; scrollbar-color: rgba(226,192,105,.3) transparent; }
.zone2 .zone-modal-grid > .zone-group-header { grid-column: 1 / -1; flex-basis: auto; }
.zone2 .zone-modal-grid > .zone-modal-empty { grid-column: 1 / -1; text-align: center; padding: 3rem 0; color: #8e87b3; margin: 0; }

.zone2-card { position: relative; align-items: stretch !important; gap: 6px !important; width: auto; }
.zone2-art { position: relative; aspect-ratio: 5 / 7; border-radius: 8px; overflow: hidden; border: 1px solid rgba(255,255,255,.12); background: #1a1736; transition: transform .15s, border-color .15s, box-shadow .15s; }
.zone2-art img { width: 100%; height: 100%; border: 0; border-radius: 0; object-fit: cover; display: block; }
.zone2-art img:hover { transform: none; }
.zone2-card:hover .zone2-art { transform: translateY(-3px); border-color: rgba(226,192,105,.7); box-shadow: 0 10px 26px rgba(0,0,0,.6), 0 0 0 1px rgba(226,192,105,.25); }
.zone2-face { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 6px; text-align: center; font-size: 1.5rem; color: #cfc9e8; }
.zone-order-badge.zone2-order { position: absolute; top: 5px; left: 5px; width: 20px; height: 20px; border-radius: 50%; background: rgba(11,9,24,.85); border: 1px solid rgba(226,192,105,.55); color: #e2c069; font: 700 .62rem 'JetBrains Mono', monospace; display: flex; align-items: center; justify-content: center; z-index: 2; }
.zone2-name { font: 500 .72rem 'Inter', sans-serif; color: #cfc9e8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.zone2-card.dragging { opacity: .4; }

/* Actions au survol : « Récupérer » (principale) + icône ✨ Exiler (cimetière) */
.zone2-actions { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 4px; padding: 6px; background: linear-gradient(0deg, rgba(8,6,18,.96) 55%, rgba(8,6,18,0)); opacity: 0; transform: translateY(6px); transition: .15s; z-index: 3; }
.zone2-card:hover .zone2-actions, .zone2-card:focus-within .zone2-actions { opacity: 1; transform: none; }
.zone2-act { flex: 1; font: 700 .68rem 'Inter', sans-serif; color: #1a1306; background: #e2c069; border: 0; border-radius: 6px; padding: .42rem .3rem; cursor: pointer; }
.zone2-act:hover { filter: brightness(1.1); }
.zone2-ico { width: 30px; flex: none; color: #e8e4f5; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); border-radius: 6px; cursor: pointer; font-size: .85rem; position: relative; padding: 0; }
.zone2-ico:hover { background: rgba(226,192,105,.25); border-color: #e2c069; }
.zone2-ico[data-tip]:hover::after { content: attr(data-tip); position: absolute; bottom: 125%; right: 0; white-space: nowrap; font: 500 .68rem 'Inter', sans-serif; color: #fff; background: #000; border: 1px solid rgba(226,192,105,.4); border-radius: 5px; padding: 3px 7px; z-index: 5; }

@media (max-width: 700px) {
  .zone-modal-box.zone2 { height: 92vh; max-height: 92vh !important; }
  .zone-modal-box.has-give-panel { padding-right: 0; }
  .zone-give-panel { display: none; }
  .zone2-bar { padding: .6rem .9rem; }
  .zone2 .zone-modal-grid { padding: .8rem .9rem 1rem; }
}

/* ═══ Zones de dépôt au glisser — version « à la place de la main » ═══
   Quand on attrape une carte de la main ou du terrain, la main s'efface et les 3 zones
   (Cimetière / Exil / Hors jeu) prennent sa place, en bas. Position et taille sont calées
   en JS (initDropDock) sur celles de .hand-fan-wrap ; rien ne recouvre le terrain. */
#drop-dock { position: fixed; left: 340px; width: 760px; bottom: 8px; height: 150px; margin: 0; z-index: 9000;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
  opacity: 0; pointer-events: none; transition: opacity .12s; }
body.dd-on #drop-dock { opacity: 1; pointer-events: auto; }
/* La main reste dans le DOM (display:none annulerait le glisser) : on la rend seulement invisible */
.hand-fan-wrap { transition: opacity .1s; }
body.dd-on .hand-fan-wrap { opacity: 0; pointer-events: none; }
.dd-zone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 12px; border: 2px dashed; text-align: center; user-select: none; transition: transform .1s, filter .1s, box-shadow .1s; }
.dd-zone .dd-i { font-size: 2.3rem; line-height: 1; }
.dd-zone b { font: 700 1.2rem 'Cinzel', serif; letter-spacing: .04em; }
.dd-zone small { font: 600 .66rem 'Inter', sans-serif; letter-spacing: .1em; text-transform: uppercase; opacity: .85; }
.dd-gy      { border-color: rgba(224,85,85,.75);   background: rgba(40,10,16,.85);  color: #ff9d9d; }
.dd-exile   { border-color: rgba(226,192,105,.75); background: rgba(38,28,8,.85);   color: #e2c069; }
.dd-outside { border-color: rgba(150,100,220,.75); background: rgba(26,16,48,.85);  color: #c8a8ff; }
.dd-zone.drag-over { border-style: solid; filter: brightness(1.35); transform: scale(1.03); box-shadow: 0 0 26px rgba(255,255,255,.18); }
@media (max-width: 768px) { #drop-dock { display: none; } }

/* ═══ Bibliothèque : cartes plus petites pour en voir davantage d'un coup ═══ */
#library-modal.lib2-on .zone-modal-box { height: min(900px, 96vh); max-height: 96vh !important; }
#library-modal.lib2-on #library-grid:not(.lib2-grid--scry) { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 10px 9px; padding: .6rem 1.2rem .8rem; }
#library-modal.lib2-on #library-grid:not(.lib2-grid--scry) .lib2-card { gap: 3px; }
#library-modal.lib2-on #library-grid:not(.lib2-grid--scry) .lib2-pos { font-size: .54rem; min-height: 12px; line-height: 12px; }
#library-modal.lib2-on #library-grid:not(.lib2-grid--scry) .lib2-name { font-size: .6rem; }
#library-modal.lib2-on #library-grid:not(.lib2-grid--scry) .lib2-art { border-radius: 6px; }
/* Sur une petite carte : « → Main » prend toute la largeur, les 3 icônes se partagent la ligne du dessous */
#library-modal.lib2-on #library-grid:not(.lib2-grid--scry) .lib2-actions { flex-wrap: wrap; gap: 3px; padding: 4px; }
#library-modal.lib2-on #library-grid:not(.lib2-grid--scry) .lib2-act { flex: 1 1 100%; font-size: .62rem; padding: .3rem .2rem; }
#library-modal.lib2-on #library-grid:not(.lib2-grid--scry) .lib2-ico { flex: 1 1 0; width: auto; height: 20px; font-size: .68rem; }
#library-modal.lib2-on #library-grid:not(.lib2-grid--scry) .lib2-cardmenu { bottom: 54px; left: 4px; right: 4px; }
#library-modal.lib2-on #library-grid:not(.lib2-grid--scry) .lib2-cardmenu button { font-size: .6rem; white-space: normal; padding: .3rem .35rem; }
/* Barre d'outils plus compacte : plus de place pour les cartes */
#library-modal.lib2-on .library-mode-bar { padding: .45rem 1.2rem; }
#library-modal.lib2-on #library-search-bar { padding: .5rem 1.2rem .2rem !important; }
#library-modal.lib2-on #lib-filter-tabs { padding: .2rem 1.2rem .5rem !important; }

/* ═══ Header : « ⋯ » masqué quand il n'a rien à proposer (simulation) ═══
   Il contient Exclure / Quitter / Forcer le tour / Reddition ; JS en cache plusieurs selon le mode. */
.header-actions .hdr-more { display: none; }
.header-actions .hdr-more:has(.hdr-more-menu .btn-game:not([style*="display:none"]):not([style*="display: none"])) { display: block; }

/* ═══ Mulligan : choix des cartes à mettre sous la bibliothèque ═══ */
.mulligan-card { position: relative; }
.mulligan-card--pick { cursor: pointer; transition: transform .12s, opacity .12s, outline-color .12s; }
.mulligan-card--pick:hover { transform: translateY(-4px); }
.mulligan-card--sel { outline: 3px solid #ff7eb6; outline-offset: 2px; opacity: .6; transform: translateY(10px) scale(.96); }
.mulligan-card--sel::after { content: "↓ dessous"; position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; font: 700 .6rem 'Inter', sans-serif; color: #fff; background: rgba(255,126,182,.9); padding: 3px 0; }
#btn-keep:disabled { opacity: .45; cursor: not-allowed; }

/* ═══ Journal lisible : codes couleur, texte plus grand, bruit atténué ═══
   terrain vert · perte de PV rouge · gain de PV turquoise · pioche bleu · token/trésor jaune ·
   sort blanc · commandant violet · exil orange · cimetière gris-bleu · bibliothèque vert-gris · mulligan rose */
#log-entries .log-entry { font-size: .8rem !important; line-height: 1.4 !important; padding: 3px 10px 3px 9px !important; margin: 1px 0; border-left: 3px solid transparent !important; color: rgba(215,210,235,.8) !important; }
#log-entries .lg-who { font-weight: 700; color: #f1ecff; }
#log-entries .lg-card { font-weight: 700; }
#log-entries .lg-num { font: 700 .86rem 'JetBrains Mono', monospace; }
#log-entries .lg-sub { opacity: .65; font-size: .72rem; }
#log-entries .log-land      { color: #86e594 !important; border-left-color: #4caf50 !important; background: rgba(76,175,80,.08); }
#log-entries .log-damage    { color: #ff8585 !important; border-left-color: #ef5350 !important; background: rgba(239,83,80,.1); }
#log-entries .log-heal      { color: #5eead4 !important; border-left-color: #2dd4bf !important; background: rgba(45,212,191,.09); }
#log-entries .log-draw      { color: #86bdff !important; border-left-color: #4a9bff !important; background: rgba(74,155,255,.09); }
#log-entries .log-token     { color: #f2cf6a !important; border-left-color: #e8b923 !important; background: rgba(232,185,35,.09); }
#log-entries .log-counter   { color: #c9b3ff !important; border-left-color: rgba(179,136,255,.5) !important; font-size: .7rem !important; opacity: .85; }
#log-entries .log-play      { color: #f4f0ff !important; border-left-color: #d9d2ff !important; background: rgba(217,210,255,.05); }
#log-entries .log-cast      { color: #c9adff !important; border-left-color: #a07bff !important; background: rgba(160,123,255,.1); }
#log-entries .log-exile     { color: #ffb066 !important; border-left-color: #ff9f43 !important; background: rgba(255,159,67,.09); }
#log-entries .log-graveyard { color: #a9b2c7 !important; border-left-color: #7d879b !important; background: rgba(125,135,155,.07); }
#log-entries .log-lib       { color: #93c9b9 !important; border-left-color: #5fa393 !important; font-style: italic; }
#log-entries .log-scry      { color: #8fd0e8 !important; border-left-color: #4fb0d0 !important; }
#log-entries .log-combat    { color: #ff9266 !important; border-left-color: #ff7043 !important; background: rgba(255,112,67,.09); }
#log-entries .log-mull      { color: #ffa6d2 !important; border-left-color: #ff7eb6 !important; background: rgba(255,126,182,.12); font-weight: 600; }
#log-entries .log-alert     { color: #ffbe6a !important; border-left-color: #ffa000 !important; background: rgba(255,160,0,.12); font-weight: 600; }
#log-entries .log-give      { color: #f7aedb !important; border-left-color: #e978bb !important; }
#log-entries .log-reveal    { color: #a6dcec !important; border-left-color: #6cc3df !important; }
#log-entries .log-undo, #log-entries .log-time { color: rgba(170,163,190,.65) !important; font-style: italic; font-size: .7rem !important; }
/* Engager / dégager : très nombreux → discrets et serrés */
#log-entries .log-tap, #log-entries .log-untap { color: rgba(165,158,190,.55) !important; font-size: .68rem !important; line-height: 1.2 !important; padding-top: 0 !important; padding-bottom: 0 !important; margin: 0; }
/* Pastilles de mana */
.lg-mana { display: inline-block; width: 1.05em; height: 1.05em; border-radius: 50%; margin: 0 1px; text-align: center; font: 700 .62em/1.05em 'JetBrains Mono', monospace; color: #14121f; vertical-align: baseline; }
.lg-mana-W { background: #f8f4d8; } .lg-mana-U { background: #6db3ff; } .lg-mana-B { background: #a79db8; }
.lg-mana-R { background: #ff7d6e; } .lg-mana-G { background: #6fd07a; } .lg-mana-C, .lg-mana-X { background: #cfcfd6; }

/* ═══ Zones de dépôt : taille fixe, 4e zone « Main » quand la carte vient du terrain ═══ */
#drop-dock { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 1fr; }
.dd-hand { display: none; border-color: rgba(91,155,213,.8); background: rgba(10,22,40,.85); color: #8bbfe8; }
body.dd-from-bf .dd-hand { display: flex; }
body.dd-from-hand .dd-outside { opacity: 1; pointer-events: auto; }

/* ═══ Zones de dépôt : « Main » toujours présente ; bloc Bibliothèque + pioche glissent à gauche ═══ */
.dd-hand, body.dd-from-bf .dd-hand { display: flex; }
#zone-strip, #btn-draw { transition: transform .14s ease; }

/* ═══ Raccourcis clavier : panneau de personnalisation ═══ */
#mtg-keys-panel { position: fixed; inset: 0; z-index: 10050; display: flex; align-items: center; justify-content: center; background: rgba(4,4,10,.62); }
#mtg-keys-panel .mk-box { width: min(460px, 92vw); max-height: 88vh; overflow: auto; background: #12121c; border: 1px solid rgba(226,192,105,.35); border-radius: 12px; padding: 16px 18px; color: #e8e4d8; box-shadow: 0 18px 50px rgba(0,0,0,.6); }
#mtg-keys-panel .mk-head { display: flex; justify-content: space-between; align-items: center; font-size: 1rem; color: #e2c069; }
#mtg-keys-panel .mk-x { background: none; border: 0; color: inherit; font-size: 1rem; cursor: pointer; opacity: .7; }
#mtg-keys-panel .mk-hint { font-size: .74rem; opacity: .65; margin: 6px 0 10px; }
#mtg-keys-panel .mk-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,.06); font-size: .84rem; }
#mtg-keys-panel .mk-key { min-width: 120px; padding: 4px 10px; border-radius: 6px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.06); color: #e8e4d8; font: inherit; font-size: .8rem; cursor: pointer; }
#mtg-keys-panel .mk-key:hover { border-color: rgba(226,192,105,.6); }
#mtg-keys-panel .mk-key.waiting { border-color: #e2c069; color: #e2c069; }
#mtg-keys-panel .mk-foot { margin-top: 12px; text-align: right; }
#mtg-keys-panel .mk-reset { background: none; border: 1px solid rgba(255,255,255,.2); color: #e8e4d8; border-radius: 6px; padding: 4px 10px; font-size: .78rem; cursor: pointer; }

/* ═══ Historique des cartes jouées : toujours visible, même en zoom navigateur ═══
   La barre était poussée hors de la zone (rangées à 60 px mini) : elle est maintenant
   posée en bas de la zone du joueur, par-dessus, et la zone lui réserve sa hauteur. */
.player-zone { position: relative; box-sizing: border-box; }
.player-zone:has(> .card-history-bar) { padding-bottom: 42px; }
.player-zone > .card-history-bar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; height: 42px; min-height: 0; box-sizing: border-box; background: rgba(8,8,16,.88); }

/* Mes decks (lobby) : deck à deux commandants = vignette scindée en deux. */
.my-deck-art.is-split { display: flex; }
.my-deck-art.is-split img { width: 50%; flex: 0 0 50%; }
.my-deck-art.is-split img + img { border-left: 1px solid rgba(226,192,105,.7); }

/* Intro de partie : deux commandants (Partner) côte à côte pour un même joueur. */
.gi-cmd-pair { display: flex; gap: 10px; align-items: flex-end; }
.gi-cmd-pair .gi-cmd-img { width: 190px; height: 266px; }


/* ═══ TABLES OUVERTES (accueil) — lisibles d'un coup d'œil ═══════════════ */
.tbl-filters{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin:0 0 .7rem}
.tbl-filters button{background:rgba(255,255,255,.05);border:1px solid rgba(226,192,105,.2);color:#cfc9b8;border-radius:999px;padding:4px 11px;font-size:.74rem;cursor:pointer;font-family:inherit}
.tbl-filters button span{opacity:.55;margin-left:4px}
.tbl-filters button.on{background:rgba(226,192,105,.18);border-color:rgba(226,192,105,.65);color:#f3e2a8}
.tbl-free{margin-left:auto;font-size:.72rem;color:rgba(255,255,255,.6);display:flex;align-items:center;gap:5px;cursor:pointer}
#open-lobbies-list{display:flex;flex-direction:column;gap:6px;max-height:60vh;overflow-y:auto;padding-right:2px}
.tbl-empty{padding:1.2rem .5rem;text-align:center;color:rgba(255,255,255,.45);font-size:.82rem}
.tbl-row{display:grid;grid-template-columns:minmax(0,1.3fr) auto auto auto auto;gap:6px 12px;align-items:center;
  padding:9px 11px;border:1px solid rgba(255,255,255,.08);border-radius:8px;background:rgba(255,255,255,.03)}
.tbl-row:hover{border-color:rgba(226,192,105,.35)}
.tbl-row.is-live{border-left:3px solid #d8574b}
.tbl-row.is-mine{border-color:rgba(226,192,105,.7);box-shadow:0 0 0 1px rgba(226,192,105,.25) inset}
.tbl-host{font-size:.88rem;color:#f0ead6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tbl-me{font-size:.62rem;color:#e2c069;border:1px solid rgba(226,192,105,.5);border-radius:4px;padding:0 4px;margin-left:4px}
.tbl-code{font-size:.66rem;letter-spacing:.12em;color:rgba(255,255,255,.4)}
.tbl-format{display:flex;flex-direction:column;align-items:center;gap:3px}
.tbl-format b{font-size:.82rem;color:#e2c069;letter-spacing:.02em}
.seats{display:flex;gap:3px}
.seat{width:9px;height:9px;border-radius:50%;border:1px solid rgba(226,192,105,.55);display:inline-block}
.seat.on{background:#e2c069}
.tbl-tag{font-size:.7rem;border-radius:5px;padding:2px 7px;border:1px solid rgba(255,255,255,.15);color:#cfc9b8;background:none;font-family:inherit}
.tbl-tag-bans{cursor:pointer;border-color:rgba(216,87,75,.5);color:#f0a79f}
.tbl-tag-off{color:rgba(255,255,255,.4)}
.tbl-status{font-size:.74rem;color:rgba(255,255,255,.65);white-space:nowrap}
.tbl-status.live{color:#f0a79f}
.tbl-btn{background:linear-gradient(#e2c069,#c49a2c);color:#1a1405;border:0;border-radius:6px;padding:6px 14px;font-weight:700;font-size:.78rem;cursor:pointer;font-family:inherit}
.tbl-btn-ghost{background:rgba(255,255,255,.08);color:#e8e2cf;font-weight:500}
.tbl-btn:disabled{opacity:.45;cursor:default}
.tbl-bans-list{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:4px;max-height:130px;overflow-y:auto;font-size:.68rem;color:#cfc9b8}
.tbl-bans-list[hidden]{display:none}
.tbl-bans-list span{background:rgba(216,87,75,.12);border-radius:4px;padding:1px 6px}
.tbl-bans-title{width:100%;color:#f0a79f;font-weight:600}
@media (max-width:1080px){
  .tbl-row{grid-template-columns:minmax(0,1fr) auto}
  .tbl-opts,.tbl-state{grid-column:1/-1}
}


/* ═══ Carte « Jouer » (accueil) ═══════════════════════════════════════ */
.play-chip{display:flex !important;align-items:center;gap:10px;padding:8px 10px;margin-bottom:1rem;border:1px solid rgba(226,192,105,.22);border-radius:10px;background:rgba(255,255,255,.04)}
.play-chip[style*="display: none"]{display:none !important}
.play-chip-avatar{width:34px;height:34px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-weight:700;color:#1a1405;background:linear-gradient(#e2c069,#c49a2c);flex:none}
.play-chip-text{display:flex;flex-direction:column;min-width:0;line-height:1.2}
.play-chip-text small{font-size:.66rem;color:rgba(255,255,255,.5)}
.play-chip-text strong{font-size:.95rem;color:#f0ead6;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.play-create{display:flex;flex-direction:column;align-items:center;gap:2px;padding:.85rem 1rem}
.play-create-main{font-size:1.05rem;font-weight:700}
.play-create-sub{font-size:.7rem;font-weight:400;opacity:.75}
.play-or{display:flex;align-items:center;gap:.6rem;margin:1.1rem 0 .7rem;font-size:.7rem;color:rgba(255,255,255,.45)}
.play-or::before,.play-or::after{content:"";flex:1;height:1px;background:rgba(255,255,255,.1)}
