/* ═══════════════════════════════════════════════════════════════
   MAGIC COMMANDER — Plateforme joueurs (platform.css)
   Profil, badges, et plus tard gestion de decks / éditeur de deck.
   Fichier dédié plutôt qu'ajouté à immersion.css (déjà volumineux, centré
   sur l'ambiance du plateau de jeu) — voir CLAUDE.md section "Plateforme
   joueurs". Jamais game.css/lobby.css, comme partout ailleurs sur le site.
   ═══════════════════════════════════════════════════════════════ */

/* ── Correctif navigation : #screen-game reste visible même sans .active ──
   game.css:5 lui donne `display:grid` par un sélecteur d'ID (donc plus
   spécifique que `.screen.active{display:flex}` de lobby.css et que
   `.screen{display:none}` de base) — jamais un problème avant le badge
   compte (#account-widget, présent sur TOUS les écrans y compris en partie)
   puisque le seul chemin pour quitter #screen-game était de recharger la
   page. Sans ce correctif, ouvrir "Mon profil"/"Mes badges" pendant une
   partie superposerait les deux écrans. Ne touche jamais game.css. */
#screen-game:not(.active) { display: none !important; }

/* ── Menu utilisateur (popover #account-popover connecté) ─────────── */
#account-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.account-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: rgba(255, 255, 255, .82);
  font-family: 'Inter', sans-serif;
  font-size: .78rem;
  text-align: left;
  padding: .5rem .6rem;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.account-menu-item:hover:not(:disabled) {
  background: rgba(226, 192, 105, .12);
  color: #e2c069;
}
.account-menu-item.is-soon {
  cursor: default;
  opacity: .45;
}
.account-menu-soon-tag {
  font-size: .6rem;
  background: rgba(255, 255, 255, .1);
  border-radius: 4px;
  padding: 1px 6px;
  letter-spacing: .03em;
}

/* ── Écrans plateforme (profil/badges) ─────────────────────────────── */
.platform-screen {
  flex-direction: column !important;
  align-items: center !important;
  height: 100vh; /* html/body ont overflow:hidden!important (immersion.css, pour le plateau) —
                    sans hauteur bornée ici, overflow-y:auto n'a aucun contenu à faire défiler */
  overflow-y: auto;
  padding: 2.5rem 1.5rem 4rem;
}
.platform-wrapper {
  width: 100%;
  max-width: 760px;
}
.platform-back {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(226, 192, 105, .22);
  border-radius: 7px;
  color: rgba(255, 255, 255, .65);
  font-family: 'Inter', sans-serif;
  font-size: .78rem;
  cursor: pointer;
  padding: .35rem .7rem;
  margin-bottom: 1.2rem;
  transition: color .15s, border-color .15s, background .15s;
}
.platform-back:hover { color: #e2c069; border-color: rgba(226, 192, 105, .5); background: rgba(226, 192, 105, .08); }
.platform-title {
  font-family: 'Cinzel', serif;
  color: #e2c069;
  font-size: 1.6rem;
  margin: 0 0 1.5rem;
}
.platform-subtitle {
  font-family: 'Cinzel', serif;
  color: rgba(255, 255, 255, .85);
  font-size: 1.05rem;
  margin: 1.8rem 0 .7rem;
}
.platform-loading, .platform-empty {
  color: rgba(255, 255, 255, .45);
  font-size: .9rem;
  text-align: center;
  padding: 2rem 0;
}
.platform-card {
  background: rgba(10, 8, 20, .55);
  border: 1px solid rgba(226, 192, 105, .18);
  border-radius: 10px;
  padding: 1.2rem 1.4rem;
  margin-bottom: 1rem;
}

/* ── Profil : en-tête ───────────────────────────────────────────────── */
.profile-header-card { text-align: center; }
.profile-header-name {
  font-family: 'Cinzel', serif;
  font-size: 1.3rem;
  color: #e2c069;
}
.profile-header-sub {
  font-size: .78rem;
  color: rgba(255, 255, 255, .45);
  margin-top: .2rem;
}
.profile-header-stats {
  display: flex;
  justify-content: center;
  gap: 2.2rem;
  margin-top: 1.1rem;
}
.profile-stat { display: flex; flex-direction: column; align-items: center; }
.profile-stat-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.4rem;
  color: #e2e0d8;
}
.profile-stat-label {
  font-size: .68rem;
  color: rgba(255, 255, 255, .45);
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ── Profil : stats par mode ────────────────────────────────────────── */
.profile-mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: .7rem;
}
.profile-mode-card {
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  padding: .7rem .8rem;
}
.profile-mode-name {
  font-size: .72rem;
  color: rgba(255, 255, 255, .55);
  margin-bottom: .35rem;
}
.profile-mode-stats {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: .74rem;
  color: rgba(255, 255, 255, .8);
}
.profile-mode-winrate { color: #e2c069; font-weight: 600; }

/* ── Profil : faits marquants ───────────────────────────────────────── */
.profile-highlights { display: flex; flex-direction: column; gap: .55rem; }
.profile-highlight {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: .82rem;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  padding-bottom: .5rem;
}
.profile-highlight:last-child { border-bottom: none; padding-bottom: 0; }
.profile-highlight-label { color: rgba(255, 255, 255, .55); }
.profile-highlight-value { color: #e2e0d8; font-weight: 600; text-align: right; }

/* ── Profil : parties récentes ───────────────────────────────────────── */
.profile-matches-list { display: flex; flex-direction: column; gap: .4rem; }
.profile-match-row {
  display: grid;
  /* result, commander, mode, date, temps/tour, durée partie (optionnel),
     pauses (optionnel), replay (optionnel) — 3 tracks "auto" de plus que les
     5 champs d'origine, sinon les derniers items retombent sur une ligne 2
     alignée sur les tracks 100px/1fr (grid-auto-flow: row par défaut). */
  grid-template-columns: 100px 1fr auto auto auto auto auto auto;
  gap: .8rem;
  align-items: center;
  font-size: .76rem;
  padding: .5rem .6rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, .03);
}
.profile-match-row.is-win  { border-left: 3px solid rgba(76, 175, 125, .6); }
.profile-match-row.is-loss { border-left: 3px solid rgba(224, 85, 85, .6); }

/* ── Écran Temps de jeu (discret, voir #screen-timestats) ──────────────── */
/* overflow-x plutôt que de laisser le tableau (9 colonnes) casser la mise en
   page sur un écran étroit — le wrapper de l'écran est déjà élargi côté HTML
   (voir #screen-timestats), mais mobile reste plus étroit que 9 colonnes confortables. */
.timestats-rows { overflow-x: auto; }
.timestats-table { width: 100%; border-collapse: collapse; font-size: .78rem; white-space: nowrap; }
.timestats-table th {
  text-align: right;
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: .68rem;
  letter-spacing: .03em;
  color: rgba(226, 192, 105, .65);
  padding: 0 .9rem .6rem 0;
  border-bottom: 1px solid rgba(226, 192, 105, .18);
}
.timestats-table td {
  text-align: right;
  color: rgba(255, 255, 255, .55);
  padding: .55rem .9rem .55rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
}
.timestats-table tr:last-child td { border-bottom: none; }
.timestats-table th.timestats-col-name, .timestats-table td.timestats-col-name { text-align: left; padding-left: .2rem; }
.timestats-col-name { color: #e2e0d8; font-weight: 600; }
.timestats-avg { color: #e2c069; font-weight: 700; }
.timestats-dim { color: rgba(255, 255, 255, .35); font-size: .72rem; }
.timestats-summary {
  margin-top: 1.1rem;
  padding: .3rem 1.1rem;
  font-size: .82rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, .65);
  background: rgba(226, 192, 105, .06);
  border: 1px solid rgba(226, 192, 105, .18);
  border-radius: 8px;
}
.timestats-summary strong { color: #e2c069; }
/* Chaque ligne = pastille icône + texte, séparées par un filet fin plutôt
   qu'un simple empilement de <p> — plus facile à parcourir d'un coup d'œil
   sur une liste d'une dizaine de constats. */
.timestats-line {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  margin: 0;
  padding: .75rem 0;
  border-bottom: 1px solid rgba(226, 192, 105, .1);
  transition: background .12s;
}
.timestats-line:last-child { border-bottom: none; }
.timestats-line:hover { background: rgba(226, 192, 105, .04); }
.timestats-line-icon {
  flex-shrink: 0;
  font-size: 1.15em;
  line-height: 1.4;
}
.profile-match-result   { font-weight: 600; }
.profile-match-commander { color: rgba(255, 255, 255, .7); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-match-mode, .profile-match-date,
.profile-match-turntime, .profile-match-duration, .profile-match-pauses { color: rgba(255, 255, 255, .4); white-space: nowrap; }
.profile-match-replay-btn {
  background: rgba(79, 209, 197, .1);
  border: 1px solid rgba(79, 209, 197, .35);
  color: #4fd1c5;
  border-radius: 6px;
  font-size: .7rem;
  padding: .25rem .55rem;
  cursor: pointer;
  white-space: nowrap;
}
.profile-match-replay-btn:hover { background: rgba(79, 209, 197, .22); }

/* ── Badges ──────────────────────────────────────────────────────────── */
.badges-summary { text-align: center; }
.badges-summary-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.8rem;
  color: #e2c069;
}
.badges-summary-label {
  font-size: .78rem;
  color: rgba(255, 255, 255, .5);
  margin-top: .2rem;
}
.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: .8rem;
  margin-bottom: .5rem;
}
.badge-card {
  background: rgba(10, 8, 20, .55);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 10px;
  padding: 1rem .8rem;
  text-align: center;
  transition: border-color .15s, transform .15s;
}
.badge-card.is-unlocked {
  border-color: rgba(226, 192, 105, .5);
  box-shadow: 0 0 12px rgba(226, 192, 105, .12);
}
.badge-card.is-locked { opacity: .45; filter: grayscale(.6); }
.badge-icon { font-size: 1.8rem; margin-bottom: .3rem; }
.badge-name {
  font-family: 'Cinzel', serif;
  font-size: .82rem;
  color: #e2e0d8;
  margin-bottom: .25rem;
}
.badge-desc {
  font-size: .68rem;
  color: rgba(255, 255, 255, .5);
  line-height: 1.3;
}
.badge-progress-bar {
  margin-top: .5rem;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .1);
  overflow: hidden;
}
.badge-progress-fill {
  height: 100%;
  background: #e2c069;
}

@media (max-width: 640px) {
  .profile-header-stats { gap: 1.2rem; }
  .profile-match-row { grid-template-columns: 80px 1fr; grid-template-rows: auto auto; }
  .profile-match-mode, .profile-match-date { font-size: .68rem; }
}

/* ═══════════════════════════════════════════════════════════════
   Mes decks (liste) + Éditeur de deck — Phase 2 plateforme
   ═══════════════════════════════════════════════════════════════ */

/* ── Liste "Mes decks" ──────────────────────────────────────────── */
.decks-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
/* ── Zone Copyright — grand rectangle de dépôt, vide par défaut ────────── */
.copyright-zone {
  border: 2px dashed rgba(226, 192, 105, .3);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  margin-bottom: 1.5rem;
  transition: border-color .15s, background .15s;
}
.copyright-zone.is-drag-over {
  border-color: rgba(226, 192, 105, .85);
  background: rgba(226, 192, 105, .06);
}
.copyright-zone-header {
  font-family: 'Cinzel', serif;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: #e2c069;
  margin-bottom: .7rem;
}
.copyright-zone-list {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  min-height: 2.4rem;
}
.copyright-zone-empty {
  font-size: .78rem;
  color: rgba(255, 255, 255, .35);
  font-style: italic;
  padding: .3rem 0;
}
.copyright-zone-entry {
  display: flex;
  align-items: center;
  gap: .4rem;
  background: rgba(226, 192, 105, .12);
  border: 1px solid rgba(226, 192, 105, .4);
  border-radius: 6px;
  padding: .3rem .5rem .3rem .7rem;
  font-size: .8rem;
  color: #e2e0d8;
}
.copyright-zone-entry button {
  background: none;
  border: none;
  color: rgba(255, 255, 255, .5);
  cursor: pointer;
  font-size: .9rem;
  line-height: 1;
  padding: 0 .2rem;
}
.copyright-zone-entry button:hover { color: #f0a0a0; }

/* ── Commandant potentiel — pochette de decks mis de côté ──────────────── */
.cp-reopen-tab {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: rgba(226, 192, 105, .1);
  border: 1px solid rgba(226, 192, 105, .3);
  color: #e2c069;
  border-radius: 8px;
  padding: .4rem .9rem;
  font-family: 'Inter', sans-serif;
  font-size: .8rem;
  cursor: pointer;
  margin-bottom: .9rem;
}
.cp-reopen-tab:hover { background: rgba(226, 192, 105, .18); }
.commander-potentiel-zone { margin-bottom: 1.5rem; }
.cp-tab {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  background: rgba(226, 192, 105, .16);
  border: 1px solid #e2c069;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  padding: .35rem .9rem;
  font-family: 'Cinzel', serif;
  font-size: .8rem;
  color: #e2c069;
  position: relative;
  top: 1px;
}
.cp-tab button {
  background: none;
  border: none;
  color: rgba(255, 255, 255, .5);
  cursor: pointer;
  font-size: .85rem;
  line-height: 1;
  padding: 0 .1rem;
}
.cp-tab button:hover { color: #f0a0a0; }
.cp-body {
  border: 1px solid #e2c069;
  border-radius: 0 10px 10px 10px;
  padding: 1rem .8rem .7rem;
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  min-height: 5.5rem;
  background: rgba(10, 8, 20, .35);
  transition: border-color .15s, background .15s;
}
.commander-potentiel-zone.is-drag-over .cp-body {
  background: rgba(226, 192, 105, .08);
  border-color: #f0d089;
}
.cp-empty {
  color: rgba(255, 255, 255, .35);
  font-size: .78rem;
  font-style: italic;
  align-self: center;
  padding: .3rem .2rem;
}
.cp-card {
  position: relative;
  width: 4.2rem;
  height: 5.8rem;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(226, 192, 105, .35);
  cursor: grab;
  flex-shrink: 0;
  margin-left: -1rem;
  background: rgba(10, 8, 20, .55);
  transition: transform .15s ease, z-index 0s;
}
.cp-card:first-child { margin-left: 0; }
.cp-card:nth-child(3n+1) { transform: rotate(-4deg); }
.cp-card:nth-child(3n+2) { transform: rotate(2deg); }
.cp-card:nth-child(3n) { transform: rotate(-1deg); }
.cp-card:hover { transform: rotate(0deg) scale(1.18); z-index: 5; }
.cp-card.is-dragging { opacity: .4; }
.cp-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}
.cp-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5,4,9,0) 40%, rgba(5,4,9,.92) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: .25rem;
  opacity: 0;
  transition: opacity .15s;
}
.cp-card:hover .cp-card-overlay { opacity: 1; }
.cp-card-name {
  font-size: .58rem;
  color: #fff;
  line-height: 1.15;
  margin-bottom: .2rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cp-card-actions { display: flex; gap: .2rem; }
.cp-card-actions button {
  flex: 1;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(226, 192, 105, .3);
  color: #e2c069;
  border-radius: 4px;
  font-size: .58rem;
  padding: .1rem 0;
  cursor: pointer;
}
.cp-card-actions button:hover { background: rgba(226, 192, 105, .2); }

.decks-sort-bar {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .8rem;
  font-size: .78rem;
  color: rgba(255, 255, 255, .55);
}
.decks-sort-bar label { flex: 0 0 auto; }
.decks-sort-bar select {
  background: rgba(10, 8, 20, .55);
  border: 1px solid rgba(226, 192, 105, .25);
  border-radius: 6px;
  color: #e2e0d8;
  font-size: .78rem;
  padding: .35rem .6rem;
  cursor: pointer;
}
.decks-sort-bar select:focus { outline: none; border-color: rgba(226, 192, 105, .6); }

.decks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

/* Vue "Tableau" — zones personnalisables (nom + nombre, voir _deStatusColumns
   dans deckEditor.js). Statut stocké sur le deck (d.status), déplacé par
   glisser-déposer entre colonnes. flex-basis (et non plus flex:1 1 0 pur) +
   overflow-x pour que le tableau reste lisible même avec beaucoup de zones,
   au lieu de toutes les compresser à l'infini. */
.decks-board {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  overflow-x: auto;
}
.decks-board-col {
  flex: 1 1 240px;
  min-width: 220px;
  background: rgba(10, 8, 20, .35);
  border: 1px dashed rgba(226, 192, 105, .22);
  border-radius: 10px;
  padding: .8rem;
  transition: border-color .15s, background .15s;
}
.decks-board-col.is-drag-over {
  border-color: rgba(226, 192, 105, .7);
  background: rgba(226, 192, 105, .07);
}
.decks-board-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}
.decks-board-col-title {
  font-family: 'Cinzel', serif;
  color: #e2c069;
  font-size: .85rem;
  letter-spacing: .02em;
  cursor: pointer;
  border-bottom: 1px dashed transparent;
}
.decks-board-col-title:hover { border-bottom-color: rgba(226, 192, 105, .5); }
.decks-board-col-header-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: .35rem;
}
.decks-board-col-count {
  flex: 0 0 auto;
  font-size: .68rem;
  color: rgba(255, 255, 255, .45);
  background: rgba(255, 255, 255, .07);
  border-radius: 10px;
  padding: 1px 8px;
}
.decks-board-col-del {
  flex: 0 0 auto;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, .3);
  font-size: .7rem;
  cursor: pointer;
  padding: 1px 4px;
  line-height: 1;
  transition: color .15s;
}
.decks-board-col-del:hover { color: #e05555; }
.decks-board-add-col {
  flex: 0 0 auto;
  align-self: stretch;
  min-width: 90px;
  background: rgba(226, 192, 105, .06);
  border: 1px dashed rgba(226, 192, 105, .3);
  border-radius: 10px;
  color: #e2c069;
  font-family: 'Inter', sans-serif;
  font-size: .78rem;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.decks-board-add-col:hover { background: rgba(226, 192, 105, .14); border-color: rgba(226, 192, 105, .6); }
.decks-board-col-hint {
  font-size: .68rem;
  color: rgba(255, 255, 255, .35);
  margin: .15rem 0 .8rem;
}
.decks-board-col-body {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .7rem;
  min-height: 90px;
}
.decks-board-col-empty {
  grid-column: 1 / -1;
  font-size: .72rem;
  color: rgba(255, 255, 255, .28);
  font-style: italic;
  text-align: center;
  padding: 1.6rem 0;
  border: 1px dashed rgba(255, 255, 255, .1);
  border-radius: 8px;
}
@media (max-width: 900px) {
  .decks-board { flex-direction: column; }
}
.deck-card {
  background: rgba(10, 8, 20, .55);
  border: 1px solid rgba(226, 192, 105, .18);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color .15s, opacity .15s, transform .15s, box-shadow .15s;
}
.deck-card:hover { border-color: rgba(226, 192, 105, .4); }
.deck-card.is-dragging { opacity: .42; transform: scale(.98); }
.deck-card.is-drag-over {
  border-color: rgba(226, 192, 105, .8);
  box-shadow: 0 0 0 2px rgba(226, 192, 105, .18), 0 0 22px rgba(226, 192, 105, .12);
}
/* Deck parmi les 8 premiers avec commandant choisi → affiché dans la
   colonne "Copyright" de l'accueil (voir /api/copyright). */
.deck-card.is-copyrighted {
  border-color: rgba(226, 192, 105, .55);
  box-shadow: 0 0 0 1px rgba(226, 192, 105, .25);
}

/* Bandeau visuel (art_crop du commandant, ou dégradé teinté par identité
   couleur tant que l'image n'est pas hydratée — voir deHydrateCommanderImages). */
.deck-card-banner {
  position: relative;
  /* 4/3 colle de près au ratio natif de l'art_crop Scryfall (~626×457,
     soit 1.37:1) — évite le rognage latéral important qu'un bandeau bas
     et large (l'ancien height:96px fixe) provoquait sur les cartes larges. */
  aspect-ratio: 4 / 3;
  flex: 0 0 auto;
  background-size: cover;
  background-position: center;
}
.deck-card-banner-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 30%;
}
.deck-card-banner::after {
  /* Assombrit le bas du bandeau pour garder les pips/badge lisibles quel que soit l'artwork. */
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(5,4,9,0) 45%, rgba(5,4,9,.85) 100%);
}
.deck-card-drag {
  position: absolute;
  top: .35rem; left: .4rem;
  z-index: 1;
  color: rgba(226, 192, 105, .75);
  text-shadow: 0 1px 3px rgba(0,0,0,.8);
  font-size: 1rem;
  line-height: 1;
  cursor: grab;
  user-select: none;
}
.deck-card:active .deck-card-drag { cursor: grabbing; }
.deck-card-banner-overlay {
  position: absolute;
  bottom: .35rem; left: .4rem; right: .4rem;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .4rem;
}
.deck-card-pips { display: flex; gap: 3px; flex-shrink: 0; }
.deck-card-pips .color-pip { box-shadow: 0 1px 3px rgba(0,0,0,.6); }
.deck-card-copyright-badge {
  flex: 0 0 auto;
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: #e2c069;
  background: rgba(20, 16, 10, .75);
  border: 1px solid rgba(226, 192, 105, .5);
  border-radius: 4px;
  padding: 2px 6px;
  white-space: nowrap;
  margin-left: auto;
}

.deck-card-body {
  padding: .65rem .8rem 0;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.deck-card-name {
  font-family: 'Cinzel', serif;
  color: #e2e0d8;
  font-size: .92rem;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.deck-card-commander {
  font-size: .76rem;
  color: rgba(255, 255, 255, .55);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.deck-card-meta { font-size: .68rem; color: rgba(255, 255, 255, .38); }

.deck-card-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .4rem;
  margin-top: .6rem;
  padding: .6rem .8rem .8rem;
  min-width: 0;
}
.deck-card-actions button {
  min-width: 0;
  font-size: .68rem;
  padding: .4rem;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 6px;
  color: rgba(255, 255, 255, .75);
  cursor: pointer;
  transition: background .12s, color .12s;
}
.deck-card-actions button:hover { background: rgba(226, 192, 105, .15); color: #e2c069; }
.deck-card-actions button.is-danger:hover { background: rgba(224, 85, 85, .18); color: #f0a0a0; }
.color-pip {
  width: 14px; height: 14px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px;
}
.color-pip.pip-W { background: #f8f6d8; }
.color-pip.pip-U { background: #aecbf0; }
.color-pip.pip-B { background: #b3a9a4; }
.color-pip.pip-R { background: #f0a68f; }
.color-pip.pip-G { background: #9fd1a8; }

/* ── Éditeur de deck — plein écran, 3 colonnes ───────────────────── */
.deck-editor-screen {
  flex-direction: column !important;
  align-items: stretch !important;
  height: 100vh; /* .screen ne pose que min-height:100vh — sans hauteur bornée ici, ce
                    conteneur grandit pour contenir toutes les cartes (html/body ont
                    overflow:hidden!important, voir immersion.css, donc rien en dessous
                    du viewport n'est atteignable) et .de-col{overflow-y:auto} n'a jamais
                    l'occasion de déborder pour scroller en interne. */
  padding: 0 !important;
  overflow: hidden;
}
.deck-editor-topbar {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .7rem 1.2rem;
  padding-left: 200px; /* dégage #account-widget (fixed, top:12px/left:16px) — largeur variable
                          selon le pseudo, marge généreuse pour ne jamais coller au bouton retour */
  border-bottom: 1px solid rgba(226, 192, 105, .18);
  flex-shrink: 0;
}
.deck-editor-topbar .platform-back { margin-bottom: 0; flex-shrink: 0; }
.de-deck-name-input {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 1px dashed rgba(226, 192, 105, .18);
  color: #e2c069;
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  outline: none;
  cursor: text;
}
.de-deck-name-input:hover { border-bottom-color: rgba(226, 192, 105, .4); }
.de-deck-name-input:focus { border-bottom: 1px solid rgba(226, 192, 105, .6); }
.de-save-status { font-size: .7rem; color: rgba(255, 255, 255, .4); white-space: nowrap; }

/* Badge de validation — déplacé du bas de la colonne gauche au topbar, à
   côté du nom du deck, pour qu'un problème de deck (carte bannie, hors
   identité couleur, doublon) saute aux yeux sans avoir à scroller. */
.de-validation-badge-wrap { position: relative; flex-shrink: 0; }
.de-validation-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  border-radius: 20px;
  border: 1px solid transparent;
  font-family: 'Inter', sans-serif;
  font-size: .72rem;
  padding: .35rem .7rem;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .15s, background .15s;
}
.de-validation-badge.is-ok { background: rgba(76, 175, 125, .14); color: #a0f0c0; border-color: rgba(76, 175, 125, .3); }
.de-validation-badge.is-warning { background: rgba(226, 192, 105, .14); color: #e2c069; border-color: rgba(226, 192, 105, .35); }
.de-validation-badge.is-error { background: rgba(224, 85, 85, .14); color: #f0a0a0; border-color: rgba(224, 85, 85, .4); }
.de-validation-badge:hover { filter: brightness(1.15); }
.de-validation-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 320px;
  max-height: 360px;
  overflow-y: auto;
  background: linear-gradient(160deg, #120c28 0%, #07040f 100%);
  border: 1px solid rgba(226, 192, 105, .3);
  border-radius: 10px;
  padding: .6rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .85);
  z-index: 500;
}

.deck-editor-columns {
  flex: 1;
  display: flex;
  min-height: 0;
}
.de-col {
  overflow-y: auto;
  padding: 1rem;
}
.de-col-left { width: 240px; flex-shrink: 0; border-right: 1px solid rgba(255, 255, 255, .06); }
.de-col-center { flex: 1; min-width: 0; }
.de-col-maybeboard {
  position: relative;
  width: 200px;
  flex-shrink: 0;
  border-right: 1px solid rgba(255, 255, 255, .06);
  background: rgba(255, 255, 255, .012);
  padding-left: 1.1rem; /* dégage la poignée de redimensionnement (0.6rem) */
}
.de-col-right { width: 500px; flex-shrink: 0; border-left: 1px solid rgba(255, 255, 255, .06); }

/* Poignée de redimensionnement de la colonne Hésitation */
.de-maybeboard-resizer {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  cursor: col-resize;
  z-index: 5;
}
.de-maybeboard-resizer:hover,
.de-maybeboard-resizer.de-maybeboard-resizing { background: rgba(226, 192, 105, .35); }
.de-maybeboard-close-btn {
  position: absolute;
  top: .5rem;
  right: .5rem;
  background: rgba(0, 0, 0, .3);
  border: 1px solid rgba(255, 255, 255, .12);
  color: rgba(255, 255, 255, .5);
  border-radius: 5px;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: .7rem;
  line-height: 1;
  padding: .3rem .45rem;
  cursor: pointer;
  z-index: 4;
}
.de-maybeboard-close-btn:hover { color: #f0a0a0; border-color: rgba(224, 85, 85, .4); }
/* Onglet flottant pour rouvrir la colonne une fois fermée */
.de-maybeboard-reopen-tab {
  align-self: center;
  flex-shrink: 0;
  width: 28px;
  height: 90px;
  margin: auto 0;
  writing-mode: vertical-rl;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px;
  color: rgba(255, 255, 255, .55);
  font-family: 'Cinzel', serif;
  font-size: .68rem;
  letter-spacing: .04em;
  cursor: pointer;
  padding: .5rem .25rem;
}
.de-maybeboard-reopen-tab:hover { color: #e2c069; border-color: rgba(226, 192, 105, .4); }

.de-mini-title {
  font-family: 'Cinzel', serif;
  font-size: .82rem;
  color: rgba(255, 255, 255, .75);
  margin: 0 0 .6rem;
}
.de-mini-title-row { display: flex; align-items: center; justify-content: space-between; margin: 0 0 .6rem; }
.de-mini-title-row .de-mini-title { margin: 0; }
.de-card-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, .4);
  font-size: .8rem;
  line-height: 1;
  cursor: pointer;
  padding: .15rem .35rem;
  border-radius: 4px;
}
.de-card-close:hover { color: #e2c069; background: rgba(226, 192, 105, .12); }
.de-col-left label {
  display: block;
  font-size: .68rem;
  color: rgba(255, 255, 255, .45);
  margin-bottom: .3rem;
}
.de-col-left textarea, .de-col-left select, .de-col-left input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(0, 0, 0, .3);
  border: 1px solid rgba(180, 140, 40, .25);
  border-radius: 6px;
  color: #e8e6f0;
  font-family: 'Inter', sans-serif;
  font-size: .8rem;
  padding: .5rem .6rem;
  resize: vertical;
}

/* Commandant */
.de-commander-display {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .6rem;
  min-height: 40px;
}
.de-commander-placeholder { font-size: .75rem; color: rgba(255, 255, 255, .35); }
.de-commander-copyright-warning {
  margin-bottom: .6rem;
  padding: .55rem .7rem;
  border: 2px solid #e05555;
  border-radius: 8px;
  background: rgba(224, 85, 85, .16);
  color: #ff8888;
  font-size: 1rem;
  font-weight: 800;
  text-align: center;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.de-commander-display img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; object-position: top; border: 1px solid rgba(226, 192, 105, .4); }
.de-commander-name { font-size: .82rem; color: #e2e0d8; }
.de-commander-results {
  max-height: 160px;
  overflow-y: auto;
  margin-top: .4rem;
}
.de-commander-result-row {
  display: flex; align-items: center; gap: .5rem;
  padding: .35rem .3rem;
  font-size: .75rem;
  color: rgba(255, 255, 255, .8);
  cursor: pointer;
  border-radius: 4px;
}
.de-commander-result-row:hover { background: rgba(226, 192, 105, .12); }
.de-commander-result-row img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; object-position: top; }

/* Commandants similaires — même style de ligne que la recherche de commandant.
   resize:vertical donne une poignée native (coin bas-droit) pour réduire la
   hauteur manuellement, en plus du ✕ qui masque le panneau entièrement. */
.de-similar-commanders {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 260px;
  min-height: 44px;
  overflow-y: auto;
  resize: vertical;
}
.de-similar-cmdr-row {
  display: flex; align-items: center; gap: .5rem;
  padding: .35rem .3rem;
  font-size: .75rem;
  color: rgba(255, 255, 255, .8);
  cursor: pointer;
  border-radius: 4px;
}
.de-similar-cmdr-row:hover { background: rgba(226, 192, 105, .12); }
.de-similar-cmdr-row img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; object-position: top; }

/* Filtres EDHREC (bracket / tags / deck filters) — colonne droite, dans la
   zone de recherche, sous les toggles rapides. Visible seulement quand
   "Suggestions EDHREC" est coché (voir deRenderEdhrecFiltersPanel). Même
   habillage que .de-advanced-filters-panel (boîte discrète), pas
   .platform-card (trop lourd dans cette zone dense). */
.de-edhrec-filters-panel {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  margin-top: .3rem;
  padding: .7rem .7rem .6rem;
  background: rgba(255, 255, 255, .015);
  border: 1px solid rgba(226, 192, 105, .18);
  border-radius: 8px;
}
.de-edhrec-deckcount { font-size: .68rem; color: rgba(255, 255, 255, .4); }
.de-edhrec-bracket-group { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .3rem; }
.de-edhrec-bracket-btn {
  flex: 1;
  min-width: 28px;
  background: rgba(0, 0, 0, .3);
  border: 1px solid rgba(180, 140, 40, .25);
  border-radius: 5px;
  color: rgba(255, 255, 255, .7);
  font-family: 'Inter', sans-serif;
  font-size: .7rem;
  padding: .3rem .2rem;
  cursor: pointer;
}
.de-edhrec-bracket-btn:hover { border-color: rgba(226, 192, 105, .5); color: #e8e6f0; }
.de-edhrec-bracket-btn.active { background: rgba(226, 192, 105, .18); border-color: #e2c069; color: #e2c069; }

.de-edhrec-tags-group { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .3rem; }
.de-edhrec-tags-empty { font-size: .7rem; color: rgba(255, 255, 255, .3); }
.de-edhrec-tag-pill {
  background: rgba(0, 0, 0, .3);
  border: 1px solid rgba(180, 140, 40, .25);
  border-radius: 20px;
  color: rgba(255, 255, 255, .75);
  font-family: 'Inter', sans-serif;
  font-size: .68rem;
  padding: .25rem .55rem;
  cursor: pointer;
}
.de-edhrec-tag-pill b { color: rgba(226, 192, 105, .8); font-weight: 600; margin-left: .2rem; }
.de-edhrec-tag-pill:hover:not(:disabled) { border-color: rgba(226, 192, 105, .5); color: #e8e6f0; }
.de-edhrec-tag-pill.active { background: rgba(226, 192, 105, .18); border-color: #e2c069; color: #e2c069; }
.de-edhrec-tag-pill:disabled { opacity: .35; cursor: not-allowed; }

.de-edhrec-df-row { display: flex; gap: .3rem; margin-bottom: .3rem; }
.de-edhrec-df-row select, .de-edhrec-df-row input {
  box-sizing: border-box;
  background: rgba(0, 0, 0, .3);
  border: 1px solid rgba(180, 140, 40, .25);
  border-radius: 5px;
  color: #e8e6f0;
  font-family: 'Inter', sans-serif;
  font-size: .7rem;
  padding: .3rem .35rem;
  min-width: 0;
}
.de-edhrec-df-row select:first-child { flex: 0 0 62px; }
.de-edhrec-df-row input { flex: 1; }
.de-edhrec-df-row select#de-df-stat { flex: 1.3; }
.de-edhrec-df-row select#de-df-op { flex: 0 0 48px; }
.de-edhrec-df-row input#de-df-num { flex: 0 0 62px; }
.de-df-add-btn {
  flex: 0 0 auto;
  background: rgba(226, 192, 105, .15);
  border: 1px solid rgba(226, 192, 105, .4);
  border-radius: 5px;
  color: #e2c069;
  font-size: .8rem;
  line-height: 1;
  padding: 0 .5rem;
  cursor: pointer;
}
.de-df-add-btn:hover { background: rgba(226, 192, 105, .28); }
.de-df-chips { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .2rem; }
.de-df-chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: rgba(226, 192, 105, .12);
  border: 1px solid rgba(226, 192, 105, .35);
  border-radius: 20px;
  color: #e2e0d8;
  font-size: .68rem;
  padding: .2rem .3rem .2rem .55rem;
}
.de-df-chip button {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, .5);
  cursor: pointer;
  font-size: .75rem;
  line-height: 1;
  padding: .1rem .2rem;
}
.de-df-chip button:hover { color: #e05555; }

/* Suggestions EDHREC — sélecteur de catégorie, désormais inline à côté de la
   case à cocher (colonne recherche) : la liste elle-même n'a plus de rendu
   dédié à gauche, elle passe par les résultats de recherche filtrés
   (deRenderEdhrecOnlySearch). */
.de-edhrec-select-inline {
  background: rgba(0, 0, 0, .3);
  border: 1px solid rgba(180, 140, 40, .25);
  border-radius: 6px;
  color: #e8e6f0;
  font-family: 'Inter', sans-serif;
  font-size: .68rem;
  padding: .3rem .4rem;
}

/* Combos connus — Commander Spellbook */
/* Groupes de cartes favorites (remplace l'ancien panneau Combos connus) */
.de-card-groups-list { display: flex; flex-direction: column; gap: .35rem; }
.de-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .4rem .55rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, .03);
  cursor: pointer;
  transition: background .12s;
}
.de-group-header:hover { background: rgba(226, 192, 105, .1); }
.de-group-header-name { font-size: .78rem; color: #e2c069; flex: 1 1 auto; }
.de-group-header-count { font-size: .66rem; color: rgba(255, 255, 255, .4); }
.de-group-header-del {
  flex: 0 0 auto;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, .3);
  font-size: .68rem;
  cursor: pointer;
  padding: 1px 4px;
  line-height: 1;
  transition: color .15s;
}
.de-group-header-del:hover { color: #e05555; }
.de-group-header.de-group-header-drop-active {
  outline: 2px dashed #e2c069;
  outline-offset: 2px;
  background: rgba(226, 192, 105, .12);
}

/* Modal "ouvrir un groupe" — cartes triées par type, mêmes tuiles/grille que
   la colonne centrale du deck (.de-category/.de-card-grid/.de-card-tile,
   voir plus haut), juste avec 2 contrôles (+ ajouter / ✕ retirer) au lieu de
   -/✕/+ (pas de quantité pour un groupe, une carte y est ou n'y est pas). */
.de-group-modal-panel { width: min(880px, 94vw); max-height: 88vh; }
.de-group-modal-body { overflow-y: auto; padding-top: .8rem; margin-top: .6rem; border-top: 1px solid rgba(255, 255, 255, .08); }
.de-group-modal-toolbar { display: flex; gap: .5rem; margin-top: .7rem; flex-shrink: 0; }
.de-group-modal-toolbar button {
  flex: 1 1 0;
  background: rgba(226, 192, 105, .1);
  border: 1px solid rgba(180, 140, 40, .35);
  border-radius: 8px;
  color: #e2c069;
  font-family: 'Inter', sans-serif;
  font-size: .76rem;
  padding: .5rem .8rem;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.de-group-modal-toolbar button:hover { background: rgba(226, 192, 105, .2); border-color: rgba(226, 192, 105, .6); }

/* Aperçu au survol d'un groupe fermé (lecture seule, miniatures) */
.de-group-preview {
  position: fixed;
  z-index: 9400;
  max-width: 190px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  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;
  pointer-events: none;
}
.de-group-preview img { width: 40px; height: 56px; object-fit: cover; border-radius: 3px; }
.de-group-preview-noimg {
  width: 40px; height: 56px; border-radius: 3px;
  background: rgba(255, 255, 255, .06); display: flex; align-items: center; justify-content: center;
  color: rgba(255, 255, 255, .3); font-size: .7rem;
}
.de-group-preview-status { font-size: .7rem; color: rgba(255, 255, 255, .6); padding: 2px 4px; white-space: nowrap; }

/* Menu clic droit "Ajouter à un groupe" (tuiles de recherche) */
.de-group-menu {
  position: fixed;
  z-index: 9500;
  min-width: 190px;
  max-width: 260px;
  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;
}
.de-group-menu-title {
  font-size: .66rem;
  color: rgba(255, 255, 255, .5);
  padding: 4px 8px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.de-group-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: rgba(255, 255, 255, .85);
  font-size: .78rem;
  padding: 6px 8px;
  border-radius: 5px;
  cursor: pointer;
  font-family: inherit;
}
.de-group-menu-item:hover { background: rgba(226, 192, 105, .12); }
.de-group-menu-new { color: #e2c069; border-top: 1px solid rgba(255, 255, 255, .08); margin-top: 4px; padding-top: 8px; }

/* Étape 1 du menu "⭐ Vers un groupe" — sélection multiple de types (voir
   deOpenBulkGroupMenu) : chaque ligne reste cliquable plusieurs fois sans
   fermer le menu, jusqu'au clic sur "Valider". */
.de-group-menu-check { display: flex; align-items: center; gap: 7px; }
.de-group-menu-checkbox {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid rgba(226, 192, 105, .5);
  background: rgba(255, 255, 255, .04);
}
.de-group-menu-check.is-selected { background: rgba(226, 192, 105, .16); }
.de-group-menu-check.is-selected .de-group-menu-checkbox {
  background: #e2c069;
  border-color: #e2c069;
  position: relative;
}
.de-group-menu-check.is-selected .de-group-menu-checkbox::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #1a1408;
}
.de-group-menu-confirm { text-align: center; font-weight: 600; }
.de-group-menu-confirm:disabled { color: rgba(255, 255, 255, .3); cursor: default; }
.de-group-menu-confirm:disabled:hover { background: none; }

/* Sélecteur de decks EDHREC (bracket/budget/tags) — génération de deck */
.de-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9400;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .78);
  backdrop-filter: blur(6px);
}
.de-modal-panel {
  width: min(680px, 92vw);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(160deg, #120c28 0%, #07040f 100%);
  border: 1px solid rgba(226, 192, 105, .3);
  border-radius: 14px;
  padding: 1.2rem 1.4rem;
  box-shadow: 0 32px 80px rgba(0, 0, 0, .9);
  overflow: hidden;
}
.de-modal-header { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.de-modal-title { font-family: 'Cinzel', serif; font-size: 1rem; color: #e2c069; margin: 0; }
.de-generate-progress-panel { width: min(420px, 90vw); align-items: stretch; gap: .3rem; }
.de-generate-progress-panel .de-modal-title { text-align: center; margin-bottom: .4rem; }
.de-generate-progress-panel .progress-bar { margin-top: 0; }
.de-samples-filters { display: flex; flex-wrap: wrap; gap: 1rem; flex-shrink: 0; margin-bottom: .8rem; }
.de-samples-filter-group { display: flex; align-items: center; gap: .3rem; }
.de-samples-filter-label { font-size: .68rem; color: rgba(255, 255, 255, .45); margin-right: .3rem; }
.de-samples-filter {
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 5px;
  color: rgba(255, 255, 255, .65);
  font-size: .72rem;
  padding: .3rem .55rem;
  cursor: pointer;
}
.de-samples-filter:hover { background: rgba(226, 192, 105, .1); }
.de-samples-filter.active { background: rgba(226, 192, 105, .2); border-color: #e2c069; color: #e2c069; }
.de-samples-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding-right: .3rem;
  font-family: 'JetBrains Mono', monospace;
}
.de-sample-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .4rem .5rem;
  border-radius: 5px;
}
.de-sample-row:nth-child(even) { background: rgba(255, 255, 255, .025); }
.de-sample-row:hover { background: rgba(226, 192, 105, .07); }
.de-sample-price { color: rgba(255, 255, 255, .55); font-size: .72rem; min-width: 48px; flex-shrink: 0; }
.de-sample-bracket { color: rgba(255, 255, 255, .35); font-size: .64rem; min-width: 18px; flex-shrink: 0; }
.de-sample-line {
  flex: 1;
  min-width: 0;
  color: rgba(255, 255, 255, .4);
  font-size: .68rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.de-sample-line b { color: #e2c069; font-weight: 600; }
.de-sample-generate {
  background: none;
  border: none;
  color: #e2c069;
  font-size: .9rem;
  cursor: pointer;
  padding: .1rem .4rem;
  border-radius: 4px;
  flex-shrink: 0;
  font-family: inherit;
}
.de-sample-generate:hover { background: rgba(226, 192, 105, .14); }

/* Modale "Mes combos" (Commander Spellbook — POST /find-my-combos) */
.de-combos-modal-panel { width: min(920px, 94vw); max-height: 88vh; }
.de-combos-tabs { display: flex; gap: .4rem; flex-shrink: 0; margin-bottom: .8rem; }
.de-combos-tab {
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 6px;
  color: rgba(255, 255, 255, .65);
  font-size: .78rem;
  padding: .4rem .8rem;
  cursor: pointer;
}
.de-combos-tab:hover { background: rgba(226, 192, 105, .1); }
.de-combos-tab.active { background: rgba(226, 192, 105, .2); border-color: #e2c069; color: #e2c069; }
.de-combos-body { overflow-y: auto; padding-right: .3rem; }
.de-combos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .7rem; }
.de-combo-card {
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px;
  padding: .7rem .8rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.de-combo-card:hover { border-color: rgba(226, 192, 105, .5); background: rgba(226, 192, 105, .06); }
.de-combo-card-names { font-size: .8rem; color: #e8e6f0; line-height: 1.4; }
.de-combo-card-names b { color: #e2c069; }
.de-combo-card-produces { font-size: .7rem; color: rgba(255, 255, 255, .5); }
.de-combo-card-missing { font-size: .68rem; color: #e2a05a; }
.de-combo-empty { color: rgba(255, 255, 255, .4); font-size: .85rem; text-align: center; padding: 2rem 0; }

/* Vue détail d'un combo */
.de-combo-detail-toolbar { display: flex; align-items: center; justify-content: space-between; padding-bottom: .8rem; }
.de-combo-detail-back {
  background: none; border: none; color: #e2c069; font-size: .82rem;
  cursor: pointer; padding: 0; text-align: left;
}
.de-combo-detail-back:hover { text-decoration: underline; }
#de-combo-translate-btn {
  background: rgba(226, 192, 105, .12);
  border: 1px solid rgba(226, 192, 105, .35);
  border-radius: 6px;
  color: #e2c069;
  font-size: .74rem;
  padding: .3rem .7rem;
  cursor: pointer;
}
#de-combo-translate-btn:hover:not(:disabled) { background: rgba(226, 192, 105, .22); }
#de-combo-translate-btn:disabled { opacity: .6; cursor: default; }
.de-combo-detail-cards { display: flex; flex-wrap: wrap; gap: .8rem; margin-bottom: 1rem; }
.de-combo-detail-card { width: 140px; text-align: center; }
.de-combo-detail-card img { width: 100%; border-radius: 6px; }
.de-combo-detail-card-name { font-size: .72rem; color: rgba(255, 255, 255, .8); margin-top: .3rem; }
.de-combo-detail-card-zone { font-size: .66rem; color: rgba(255, 255, 255, .45); }
.de-combo-detail-card.de-combo-detail-card-missing img { opacity: .4; border: 1px dashed #e2a05a; }
.de-combo-detail-card.de-combo-detail-card-missing .de-combo-detail-card-name { color: #e2a05a; }
.de-combo-detail-section { margin-bottom: .9rem; }
.de-combo-detail-section h4 { font-family: 'Cinzel', serif; font-size: .78rem; color: #e2c069; margin: 0 0 .3rem; }
.de-combo-detail-section p { font-size: .8rem; color: rgba(255, 255, 255, .78); white-space: pre-line; margin: 0; line-height: 1.5; }
.de-combo-detail-legalities { display: flex; flex-wrap: wrap; gap: .3rem .8rem; font-size: .7rem; }
.de-combo-detail-legalities span.legal { color: #7ed07e; }
.de-combo-detail-legalities span.illegal { color: rgba(255, 255, 255, .3); }
.de-combo-detail-prices { display: flex; gap: .8rem; font-size: .74rem; color: rgba(255, 255, 255, .6); }

/* Courbe de mana — barres CSS pures. La pastille (nombre) et le libellé
   (coût) sont des frères de la barre dans une colonne flex : SANS
   .de-mana-bar-track, leur hauteur "auto" grignote le budget des 100% du
   wrap, et la barre (dont la hauteur en % vise CE total de 100%) se
   retrouve plafonnée dès qu'elle dépasse l'espace restant après le texte —
   plusieurs comptes différents rendent alors la MÊME hauteur plafonnée
   (bug constaté : 62%, 77% et 100% mesuraient tous 39px). .de-mana-bar-track
   isole la barre dans son propre flex item (flex:1 1 auto) : son budget de
   hauteur est fixé UNE fois par le flex du wrap (après soustraction du texte
   auto), puis le pourcentage de la barre se résout contre cette hauteur à
   elle, sans concurrence avec le texte. */
.de-mana-curve { display: flex; align-items: flex-end; gap: 4px; height: 70px; }
.de-mana-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; cursor: pointer; border-radius: 3px; transition: background .15s; }
.de-mana-bar-wrap:hover { background: rgba(226, 192, 105, .1); }
.de-mana-bar-wrap.active { background: rgba(226, 192, 105, .2); }
.de-mana-bar-wrap.active .de-mana-bar { background: linear-gradient(180deg, #ffe08a, #e2c069); box-shadow: 0 0 8px rgba(226, 192, 105, .6); }
.de-mana-bar-wrap.active .de-mana-bar-label { color: #e2c069; font-weight: 600; }
.de-mana-bar-count { font-size: .6rem; color: rgba(255, 255, 255, .5); margin-bottom: 2px; }
.de-mana-bar-track { width: 100%; flex: 1 1 auto; min-height: 0; display: flex; align-items: flex-end; }
.de-mana-bar {
  width: 100%;
  background: linear-gradient(180deg, #e2c069, #a8842f);
  border-radius: 2px 2px 0 0;
  min-height: 2px;
}
.de-mana-bar-label { font-size: .6rem; color: rgba(255, 255, 255, .4); margin-top: 2px; }

/* Test de mains : résumé dans la colonne de gauche + fenêtre de détail.
   Volontairement neutre : aucune couleur d'appréciation (vert/orange/rouge),
   seulement des chiffres — c'est à l'utilisateur de juger. */
.de-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.de-hand-test { font-size: .78rem; color: rgba(255, 255, 255, .75); font-variant-numeric: tabular-nums; display: grid; gap: .3rem; }
.de-hand-test-empty { margin: 0; color: rgba(255, 255, 255, .55); }
.de-hand-test-warn { margin: 0 0 .6rem; padding: .35rem .6rem; border-left: 3px solid rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .04); border-radius: 6px; font-size: .74rem; color: rgba(255, 255, 255, .65); }
.de-hand-test-open { display: block; width: 100%; margin-top: .6rem; padding: .5rem; border: 1px solid rgba(226, 192, 105, .45); border-radius: 8px; text-align: center; font-size: .76rem; color: #e2c069; }
.de-hand-test-open:hover { background: rgba(226, 192, 105, .12); }
.de-hand-test-open:focus-visible, .de-hand-test-redraw:focus-visible { outline: 2px solid #e2c069; outline-offset: 2px; }
.de-hand-test-note { margin: .5rem 0 0; font-size: .66rem; line-height: 1.4; color: rgba(255, 255, 255, .45); }

/* Fenêtre */
.de-hand-test-panel { width: min(1040px, 94vw); max-height: 92vh; }
.de-hand-test-body { flex: 1; min-height: 0; overflow-y: auto; margin-top: .7rem; padding-right: .2rem; font-size: .78rem; color: rgba(255, 255, 255, .75); font-variant-numeric: tabular-nums; }
.de-hand-test-foot { flex-shrink: 0; margin-top: .6rem; padding-top: .6rem; border-top: 1px solid rgba(255, 255, 255, .08); display: flex; justify-content: flex-end; }
.de-hand-test-redraw { background: rgba(226, 192, 105, .12); border: 1px solid rgba(226, 192, 105, .45); color: #e2c069; border-radius: 8px; padding: .45rem .9rem; font-size: .76rem; cursor: pointer; }
.de-hand-test-redraw:hover { background: rgba(226, 192, 105, .22); }
.de-ht-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.de-ht-tile { display: flex; align-items: center; gap: .7rem; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08); border-radius: 10px; padding: .5rem .8rem; }
.de-ht-tile strong { font-family: 'Cinzel', serif; font-size: 1.6rem; line-height: 1; color: #e2e0d8; }
.de-ht-tile span { font-size: .72rem; line-height: 1.35; color: rgba(255, 255, 255, .6); }
.de-ht-tile small { font-size: .62rem; color: rgba(255, 255, 255, .42); }
.de-ht-atleast { width: 100%; margin-top: .6rem; border-collapse: separate; border-spacing: 3px; }
.de-ht-atleast caption { text-align: left; font-size: .66rem; color: rgba(255, 255, 255, .5); padding-bottom: .15rem; }
.de-ht-atleast caption span { color: rgba(255, 255, 255, .4); }
.de-ht-atleast th { font-weight: 400; font-size: .62rem; color: rgba(255, 255, 255, .5); text-align: center; }
.de-ht-atleast tbody th { text-align: left; font-size: .72rem; color: rgba(255, 255, 255, .7); white-space: nowrap; }
.de-ht-atleast small { font-size: .6rem; color: rgba(255, 255, 255, .4); margin-left: .25rem; }
.de-ht-atleast td { text-align: center; padding: .2rem 0; font-size: .82rem; font-weight: 600; color: #e2e0d8; background: rgba(255, 255, 255, .05); border-radius: 6px; }
.de-ht-atleast td.is-drop { box-shadow: inset 0 0 0 1.5px rgba(226, 192, 105, .8); }
.de-ht-subtitle { margin: .9rem 0 .5rem; font-family: 'Cinzel', serif; font-size: .85rem; color: #e2c069; font-weight: 500; }
.de-ht-subtitle span { font-family: 'Inter', sans-serif; font-size: .66rem; color: rgba(255, 255, 255, .45); margin-left: .4rem; }
.de-ht-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .6rem; align-items: start; }
.de-ht-colbox { background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .09); border-radius: 10px; padding: .6rem .65rem; }
.de-ht-colbox.is-side { border-style: dashed; }
.de-ht-colbox header { display: flex; align-items: center; gap: .4rem; }
.de-ht-colbox h4 { margin: 0; font-size: .85rem; color: #e2e0d8; font-weight: 600; }
.de-ht-src { margin-left: auto; font-size: .66rem; color: rgba(255, 255, 255, .5); }
.de-ht-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .35); }
.de-ht-dot-W { background: #f8f6d8; } .de-ht-dot-U { background: #aecbf0; } .de-ht-dot-B { background: #b3a9a4; }
.de-ht-dot-R { background: #f0a68f; } .de-ht-dot-G { background: #9fd1a8; }
.de-ht-turns { display: grid; grid-template-columns: repeat(3, 1fr); gap: .3rem; margin: .5rem 0 0; }
.de-ht-turns div { text-align: center; background: rgba(255, 255, 255, .05); border-radius: 6px; padding: .25rem 0; }
.de-ht-turns dt { font-size: .6rem; color: rgba(255, 255, 255, .5); }
.de-ht-turns dd { margin: 0; font-size: .95rem; font-weight: 600; color: #e2e0d8; }
.de-ht-exact { margin: .3rem 0 0; font-size: .6rem; line-height: 1.4; color: rgba(255, 255, 255, .42); }
.de-ht-chips { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .25rem; }
.de-ht-chip { padding: .25rem .45rem; background: rgba(255, 255, 255, .06); border-radius: 6px; font-size: .72rem; color: rgba(255, 255, 255, .85); }
.de-ht-landgrid { list-style: none; margin: .5rem 0 0; padding: .5rem 0 0; border-top: 1px solid rgba(255, 255, 255, .08); display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: .3rem; }
.de-ht-land { position: relative; aspect-ratio: 488 / 680; border-radius: 4px; cursor: zoom-in; }
.de-ht-land img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }
.de-ht-land:hover, .de-ht-land:focus-visible { outline: 2px solid #e2c069; outline-offset: 1px; z-index: 1; }
.de-ht-land-qty, .de-ht-land-approx { position: absolute; top: 1px; padding: 0 4px; border-radius: 8px; background: rgba(0, 0, 0, .85); color: #e2e0d8; font-weight: 700; line-height: 1.4; }
.de-ht-land-qty { right: 1px; font-size: .6rem; }
.de-ht-land-approx { left: 1px; font-size: .68rem; }
.de-ht-land-dots { position: absolute; left: 0; right: 0; bottom: 2px; display: flex; justify-content: center; gap: 2px; }
.de-ht-land-dots .de-ht-dot { width: 9px; height: 9px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .7); }
.de-ht-land-noimg { display: flex; align-items: center; justify-content: center; height: 100%; padding: .15rem; text-align: center; font-size: .55rem; line-height: 1.2; background: rgba(255, 255, 255, .08); border-radius: 4px; }
.de-ht-landgrid .de-ht-none { grid-column: 1 / -1; padding: .2rem 0; color: rgba(255, 255, 255, .4); font-size: .72rem; }
.de-ht-how { margin-top: .8rem; border-top: 1px solid rgba(255, 255, 255, .08); padding-top: .5rem; }
.de-ht-how summary { cursor: pointer; color: #e2c069; font-size: .76rem; }
.de-ht-how summary:focus-visible { outline: 2px solid #e2c069; outline-offset: 2px; }
.de-ht-how ul { margin: .5rem 0 0; padding-left: 1.1rem; display: grid; gap: .3rem; font-size: .72rem; line-height: 1.5; color: rgba(255, 255, 255, .6); }
@media (max-width: 640px) {
  .de-hand-test-panel { padding: 1rem .9rem; max-height: 94vh; }
  .de-ht-tiles { grid-template-columns: minmax(0, 1fr); }
  .de-ht-cols { grid-template-columns: minmax(0, 1fr); }
  .de-ht-atleast small { display: block; margin-left: 0; }
  .de-ht-atleast th { font-size: .56rem; }
  .de-ht-landgrid { grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); }
  .de-ht-subtitle span { display: block; margin: .1rem 0 0; }
  .de-hand-test-foot .de-hand-test-redraw { width: 100%; }
}
}

/* Chip de filtre CMC actif (colonne centrale) */
.de-cmc-filter-chip {
  display: none;
  align-items: center;
  gap: .5rem;
  align-self: center;
  margin: .4rem 0;
  padding: .3rem .7rem;
  background: rgba(226, 192, 105, .14);
  border: 1px solid rgba(226, 192, 105, .4);
  border-radius: 999px;
  font-size: .78rem;
  color: #e2c069;
}
.de-cmc-filter-chip button {
  background: none;
  border: none;
  color: rgba(255, 255, 255, .7);
  cursor: pointer;
  font-size: .85rem;
  line-height: 1;
  padding: 0;
}
.de-cmc-filter-chip button:hover { color: #e05555; }

/* Couleurs */
.de-color-pips { display: flex; flex-direction: column; gap: .35rem; }
.de-color-pip-row { display: flex; align-items: center; gap: .5rem; font-size: .74rem; color: rgba(255, 255, 255, .75); }
.de-color-pip-bar-track { flex: 1; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.de-color-pip-bar-fill { height: 100%; }

/* Stats */
.de-stats-list { display: flex; flex-direction: column; gap: .3rem; font-size: .76rem; }
.de-stats-row { display: flex; justify-content: space-between; color: rgba(255, 255, 255, .7); }
.de-stats-row strong { color: #e2e0d8; }

/* Validation */
.de-validation-list { display: flex; flex-direction: column; gap: .4rem; font-size: .72rem; }
.de-validation-item { padding: .4rem .5rem; border-radius: 6px; line-height: 1.35; }
.de-validation-item.is-error { background: rgba(224, 85, 85, .12); color: #f0a0a0; }
.de-validation-item.is-warning { background: rgba(226, 192, 105, .12); color: #e2c069; }
.de-validation-item.is-ok { background: rgba(76, 175, 125, .12); color: #a0f0c0; }

/* Colonne centrale — barre de recherche locale (filtre les cartes déjà
   posées, distincte de la recherche Scryfall à droite) */
.de-deck-search-bar-wrap { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .5rem; margin-bottom: 1rem; }
.de-deck-search-input {
  width: 100%;
  max-width: 360px;
  box-sizing: border-box;
  background: rgba(0, 0, 0, .3);
  border: 1px solid rgba(180, 140, 40, .25);
  border-radius: 20px;
  color: #e8e6f0;
  font-family: 'Inter', sans-serif;
  font-size: .8rem;
  padding: .5rem 1rem;
  text-align: center;
  transition: border-color .15s;
}
.de-deck-search-input:focus { outline: none; border-color: rgba(226, 192, 105, .6); }
.de-deck-search-input::placeholder { color: rgba(255, 255, 255, .4); }

/* Barre de recherche locale de la zone Hésitation — élément STABLE (jamais
   recréé par deRenderMaybeboard, qui ne touche qu'à #de-maybeboard-section)
   pour ne pas perdre le focus/curseur à chaque frappe. Marge du haut pour
   dégager le bouton ✕ "Fermer" (position:absolute, voir
   .de-maybeboard-close-btn) qui flotte sinon par-dessus. */
.de-maybe-search-input {
  display: block;
  width: calc(100% - .4rem);
  max-width: none;
  margin: 2.1rem auto .7rem;
  font-size: .72rem;
  padding: .4rem .7rem;
}
.de-group-toggle-btn {
  flex-shrink: 0;
  white-space: nowrap;
  background: rgba(226, 192, 105, .1);
  border: 1px solid rgba(180, 140, 40, .35);
  border-radius: 20px;
  color: #e2c069;
  font-family: 'Inter', sans-serif;
  font-size: .74rem;
  padding: .5rem .8rem;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.de-group-toggle-btn:hover { background: rgba(226, 192, 105, .2); border-color: rgba(226, 192, 105, .6); }
.de-group-toggle-btn.active { background: rgba(226, 192, 105, .28); border-color: #e2c069; color: #f0d998; }

/* Colonne centrale — commandant mis en évidence (cadre doré façon "cage
   commandant" du plateau de jeu), affiché au-dessus du reste du deck pour
   qu'il soit identifiable au premier coup d'œil. */
/* Second commandant (Partner) — les deux tuiles côte à côte, toujours
   visibles ensemble (même esprit que la maquette B du plateau de jeu) ;
   passe en colonne si la colonne centrale de l'éditeur devient trop
   étroite (redimensionnement navigateur, tablette portrait). */
.de-commander-tiles-row { display: flex; flex-wrap: wrap; gap: 12px; }
.de-commander-tile-wrap { width: 130px; margin: 0 0 1.4rem; }
.de-commander-tile {
  position: relative;
  border-radius: 10px;
  padding: 3px;
  background: linear-gradient(160deg, #e2c069, #8a6d2a);
  box-shadow: 0 0 14px rgba(226, 192, 105, .45);
}
.de-commander-tile img, .de-commander-tile .de-card-tile-img-placeholder {
  width: 100%;
  aspect-ratio: 63 / 88;
  object-fit: cover;
  display: block;
  border-radius: 8px;
}
.de-commander-tile-badge {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 8, 20, .85);
  border: 1px solid rgba(226, 192, 105, .6);
  border-radius: 10px;
  color: #e2c069;
  font-size: .58rem;
  font-family: 'Cinzel', serif;
  padding: .15rem .5rem;
  white-space: nowrap;
}
.de-commander-tile-name {
  font-size: .72rem;
  font-family: 'Cinzel', serif;
  color: #e2c069;
  margin-top: .5rem;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Colonne centrale — cartes classées par rangée */
.de-category { margin-bottom: 1.4rem; }
.de-functional-summary {
  margin: 0 0 1rem;
  padding: .55rem .7rem;
  border: 1px solid rgba(226, 192, 105, .22);
  border-radius: 7px;
  color: rgba(232, 225, 205, .68);
  background: rgba(226, 192, 105, .05);
  font-size: .68rem;
  line-height: 1.45;
}
.de-category-title {
  font-family: 'Cinzel', serif;
  font-size: .78rem;
  color: rgba(255, 255, 255, .45);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .6rem;
  padding-bottom: .3rem;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.de-active-category-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
}
.de-category-to-maybe {
  flex: 0 0 auto;
  padding: .28rem .5rem;
  border: 1px solid rgba(226, 192, 105, .28);
  border-radius: 6px;
  background: rgba(226, 192, 105, .07);
  color: rgba(232, 225, 205, .72);
  font: 600 .59rem 'Inter', sans-serif;
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
}
.de-category-to-maybe:hover {
  border-color: rgba(226, 192, 105, .6);
  background: rgba(226, 192, 105, .14);
  color: #f0d98b;
}
/* Fonctions personnalisables (tri "Par fonction") — renommer/supprimer/
   ajouter une catégorie, même esprit que les zones "Mes decks"
   (decks-board-col-*) mais empilées verticalement plutôt qu'en colonnes. */
.de-func-cat-rename { cursor: pointer; border-bottom: 1px dashed transparent; }
.de-func-cat-rename:hover { border-bottom-color: rgba(226, 192, 105, .5); color: rgba(255, 255, 255, .65); }
.de-func-cat-del {
  flex: 0 0 auto;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, .3);
  font-size: .68rem;
  cursor: pointer;
  padding: 1px 4px;
  line-height: 1;
  transition: color .15s;
}
.de-func-cat-del:hover { color: #e05555; }
.de-func-cat-add {
  display: block;
  margin: 0 0 1.4rem;
  padding: .5rem .8rem;
  background: rgba(226, 192, 105, .06);
  border: 1px dashed rgba(226, 192, 105, .3);
  border-radius: 8px;
  color: #e2c069;
  font-family: 'Inter', sans-serif;
  font-size: .74rem;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.de-func-cat-add:hover { background: rgba(226, 192, 105, .14); border-color: rgba(226, 192, 105, .6); }
/* Réordonnancement des fonctions par glisser-déposer (poignée dédiée, voir
   deWireFunctionCategoryDragReorder) — mêmes conventions visuelles que le
   drag de cartes (.de-card-tile-dragging/-drop-target) mais appliquées au
   bloc de catégorie entier plutôt qu'à une tuile. */
.de-func-cat-drag-handle {
  flex: 0 0 auto;
  cursor: grab;
  color: rgba(255, 255, 255, .3);
  font-size: .8rem;
  line-height: 1;
  user-select: none;
}
.de-func-cat-drag-handle:hover { color: rgba(226, 192, 105, .7); }
.de-func-cat-drag-handle:active { cursor: grabbing; }
.de-category-dragging { opacity: .4; }
.de-category-drop-target {
  outline: 2px dashed rgba(226, 192, 105, .7);
  outline-offset: 4px;
  border-radius: 8px;
}
/* Pastilles de dépose rapide (une par fonction), affichées juste au-dessus des
   catégories en tri "Par fonction" — voir quickDropRow dans deRenderDeckRows
   et deWireFunctionQuickDrop. Permet de réassigner une carte (typiquement
   depuis "Sans fonction") sans scroller jusqu'à sa vraie section. */
.de-func-quick-drop-section {
  margin-bottom: 1.4rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.de-func-quick-drop-label {
  font-size: .68rem;
  color: rgba(255, 255, 255, .4);
  margin-bottom: .5rem;
}
.de-func-quick-drop-row {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.de-func-quick-drop {
  padding: .3rem .6rem;
  border: 1px dashed rgba(226, 192, 105, .3);
  border-radius: 6px;
  background: rgba(226, 192, 105, .05);
  color: rgba(232, 225, 205, .6);
  font: 600 .64rem 'Inter', sans-serif;
  transition: background .15s, border-color .15s, color .15s;
}
.de-func-quick-drop-active {
  border-color: rgba(226, 192, 105, .8);
  background: rgba(226, 192, 105, .2);
  color: #f0d98b;
}
.de-deck-empty { font-size: .82rem; color: rgba(255, 255, 255, .35); text-align: center; padding: 2rem; }
/* Zone de dépôt de secours (deWireDeckSectionDrop) — retour visuel quand une
   carte glissée depuis Hésitation survole le deck en dehors de toute tuile. */
#de-deck-rows.de-deck-drop-active {
  outline: 2px dashed #e2c069;
  outline-offset: 4px;
  border-radius: 10px;
  background: rgba(226, 192, 105, .05);
}

/* ── Grille de cartes image-first (deck + résultats recherche) ──────────
   Cartes affichées en grand par défaut (pas besoin de survol pour les
   reconnaître) — le survol déclenche juste le zoom plein format partagé
   avec le plateau de jeu (showZoom/hideZoom, game.js, #game-card-zoom). */
.de-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: .8rem;
}
.de-card-tile {
  position: relative;
  border-radius: 8px;
}
.de-card-tile-addable { cursor: pointer; }
.de-card-tile-img {
  width: 100%;
  aspect-ratio: 63 / 88;
  object-fit: cover;
  display: block;
  border-radius: 8px;
  border: 1px solid rgba(226, 192, 105, .15);
  background: rgba(255, 255, 255, .04);
  transition: border-color .12s, transform .12s;
}
.de-card-tile:hover .de-card-tile-img { border-color: rgba(226, 192, 105, .5); transform: translateY(-2px); }
.de-card-tile-img-placeholder { background: rgba(255, 255, 255, .06); }
/* Réordonnancement manuel par drag-and-drop (deWireDeckDragReorder) */
.de-card-tile-dragging { opacity: .4; }
.de-card-tile-drop-target .de-card-tile-img,
.de-card-tile-drop-target .de-card-tile-img-placeholder {
  border-color: #e2c069;
  box-shadow: 0 0 0 2px rgba(226, 192, 105, .6);
}
/* Drag-and-drop entre fonctions (deWireFunctionTileDrag / deWireFunctionMaybeTileDrag) —
   toute la grille d'une fonction s'illumine pendant le survol, pas juste une
   tuile : elle reste une cible de drop valide même vide. */
.de-card-grid.de-func-grid-drop-active {
  outline: 2px dashed #e2c069;
  outline-offset: 6px;
  border-radius: 8px;
  background: rgba(226, 192, 105, .05);
}
/* Fonction sans carte, affichée quand même pour rester une cible de drop
   (voir deRenderDeckRows/deRenderMaybeboard) — indication discrète plutôt
   qu'une grille visuellement vide et ambiguë. */
.de-func-grid-empty-hint {
  grid-column: 1 / -1;
  padding: .6rem;
  font-size: .72rem;
  font-style: italic;
  text-align: center;
  color: rgba(255, 255, 255, .25);
  border: 1px dashed rgba(255, 255, 255, .12);
  border-radius: 8px;
}

/* Zone "Hésitation" (maybeboard) — cartes rattachées au deck mais exclues
   des 99, style volontairement en retrait/pointillé pour bien montrer
   qu'elles ne sont "pas vraiment dans le deck". */
.de-maybeboard-category {
  min-height: calc(100% - 2rem);
  padding: 1rem;
  border: 1px dashed rgba(255, 255, 255, .18);
  border-radius: 10px;
  background: rgba(255, 255, 255, .015);
  transition: background-color .12s, border-color .12s;
}
.de-maybeboard-title { padding-right: 1.6rem; } /* dégage le bouton ✕ (chrome fixe, voir .de-maybeboard-close-btn) */

/* Filtre couleur Hésitation (voir deMaybeColorFilterBarHtml) — 3 états par
   pastille : off (contour terne) / required (remplie, anneau doré) /
   optional (remplie en plus léger, anneau pointillé). */
.de-maybe-color-filter { display: flex; gap: .35rem; margin-top: .5rem; }
.de-maybe-color-pip {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .04);
  color: rgba(255, 255, 255, .35);
  font-size: .62rem;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background-color .12s, border-color .12s, color .12s;
}
.de-maybe-color-pip.pip-W[data-state="off"] { border-color: rgba(248, 246, 216, .3); }
.de-maybe-color-pip.pip-U[data-state="off"] { border-color: rgba(174, 203, 240, .3); }
.de-maybe-color-pip.pip-B[data-state="off"] { border-color: rgba(179, 169, 164, .3); }
.de-maybe-color-pip.pip-R[data-state="off"] { border-color: rgba(240, 166, 143, .3); }
.de-maybe-color-pip.pip-G[data-state="off"] { border-color: rgba(159, 209, 168, .3); }
.de-maybe-color-pip[data-state="required"], .de-maybe-color-pip[data-state="optional"] { color: #1a1408; }
.de-maybe-color-pip.pip-W[data-state="required"] { background: #f8f6d8; border-color: #e2c069; }
.de-maybe-color-pip.pip-U[data-state="required"] { background: #aecbf0; border-color: #e2c069; }
.de-maybe-color-pip.pip-B[data-state="required"] { background: #b3a9a4; border-color: #e2c069; }
.de-maybe-color-pip.pip-R[data-state="required"] { background: #f0a68f; border-color: #e2c069; }
.de-maybe-color-pip.pip-G[data-state="required"] { background: #9fd1a8; border-color: #e2c069; }
.de-maybe-color-pip.pip-W[data-state="optional"] { background: rgba(248, 246, 216, .5); border-color: rgba(226, 192, 105, .6); border-style: dashed; }
.de-maybe-color-pip.pip-U[data-state="optional"] { background: rgba(174, 203, 240, .5); border-color: rgba(226, 192, 105, .6); border-style: dashed; }
.de-maybe-color-pip.pip-B[data-state="optional"] { background: rgba(179, 169, 164, .5); border-color: rgba(226, 192, 105, .6); border-style: dashed; }
.de-maybe-color-pip.pip-R[data-state="optional"] { background: rgba(240, 166, 143, .5); border-color: rgba(226, 192, 105, .6); border-style: dashed; }
.de-maybe-color-pip.pip-G[data-state="optional"] { background: rgba(159, 209, 168, .5); border-color: rgba(226, 192, 105, .6); border-style: dashed; }
.de-maybe-color-pip:hover { filter: brightness(1.15); }

.de-maybeboard-body { margin-top: .6rem; }
.de-maybe-empty { padding: 1.2rem; font-style: italic; }
.de-maybe-subcategory { margin-bottom: 1.1rem; }
.de-maybe-subcategory-title { font-size: .68rem; margin-bottom: .4rem; padding-bottom: .2rem; }
.de-maybeboard-category.de-maybeboard-drop-active {
  border-color: #e2c069;
  border-style: solid;
  background: rgba(226, 192, 105, .06);
}
.de-maybe-tile .de-card-tile-img { opacity: .8; }
.de-maybe-tile:hover .de-card-tile-img { opacity: 1; }
/* Carte bannie sur ce serveur — aura rouge continue autour de la vignette,
   visible directement sur le board du deck en construction (pas seulement
   dans le popover de validation). */
.de-card-tile-banned .de-card-tile-img,
.de-card-tile-banned .de-card-tile-img-placeholder {
  border: 2px solid #e05555;
  box-shadow: 0 0 10px rgba(224, 85, 85, .7), 0 0 2px rgba(224, 85, 85, .9);
}
.de-card-tile-banned:hover .de-card-tile-img { border-color: #e05555; }
.de-card-tile-banned-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(60, 10, 10, .9);
  border: 1px solid #e05555;
  border-radius: 4px;
  font-size: .68rem;
  padding: 1px 4px;
  line-height: 1.4;
}
/* Carte stax reconnue (DE_STAX_CARDS, deckEditor.js) — aura orange, distincte
   du rouge des cartes bannies (avertissement, pas interdiction) et de l'or
   des cartes en Hésitation (#e2c069, plus proche du jaune). */
.de-card-tile-stax .de-card-tile-img,
.de-card-tile-stax .de-card-tile-img-placeholder {
  border: 2px solid #ff8a3d;
  box-shadow: 0 0 10px rgba(255, 138, 61, .7), 0 0 2px rgba(255, 138, 61, .9);
}
.de-card-tile-stax:hover .de-card-tile-img { border-color: #ff8a3d; }
.de-card-tile-stax-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(60, 30, 5, .9);
  border: 1px solid #ff8a3d;
  color: #ff8a3d;
  border-radius: 4px;
  font-size: .68rem;
  padding: 1px 4px;
  line-height: 1.4;
}
/* Carte déjà présente dans le deck — aura bleue (distincte du rouge des
   cartes bannies) pour la repérer dans les suggestions sans la masquer. */
.de-card-tile-owned .de-card-tile-img,
.de-card-tile-owned .de-card-tile-img-placeholder {
  border: 2px solid #5aa9e6;
  box-shadow: 0 0 10px rgba(90, 169, 230, .6), 0 0 2px rgba(90, 169, 230, .9);
}
.de-card-tile-owned:hover .de-card-tile-img { border-color: #5aa9e6; }
.de-card-tile-owned-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(10, 30, 55, .9);
  border: 1px solid #5aa9e6;
  color: #5aa9e6;
  border-radius: 4px;
  font-size: .68rem;
  padding: 1px 4px;
  line-height: 1.4;
}
/* Carte présente dans la zone Hésitation (pas dans les 99 actifs) — aura
   distincte du bleu "déjà dans le deck", sinon on ne peut pas la
   différencier d'une carte réellement jouable. */
.de-card-tile-maybe .de-card-tile-img,
.de-card-tile-maybe .de-card-tile-img-placeholder {
  border: 2px solid #e2c069;
  box-shadow: 0 0 10px rgba(226, 192, 105, .55), 0 0 2px rgba(226, 192, 105, .8);
}
.de-card-tile-maybe:hover .de-card-tile-img { border-color: #e2c069; }
.de-card-tile-maybe-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(40, 30, 5, .9);
  border: 1px solid #e2c069;
  color: #e2c069;
  border-radius: 4px;
  font-size: .68rem;
  padding: 1px 4px;
  line-height: 1.4;
}
/* Mode sélection multiple (bouton "☑ Sélectionner") — curseur cliquable sur
   toutes les tuiles du deck, aura verte + coche sur celles cochées. Couleur
   distincte du rouge (banni), bleu (déjà dans le deck) et or (Hésitation)
   déjà utilisés par les autres auras de tuile ci-dessus. */
.de-select-mode .de-card-tile { cursor: pointer; }
.de-card-tile-selected .de-card-tile-img,
.de-card-tile-selected .de-card-tile-img-placeholder {
  border: 2px solid #4fd67a;
  box-shadow: 0 0 10px rgba(79, 214, 122, .6), 0 0 2px rgba(79, 214, 122, .9);
}
.de-card-tile-selected::before {
  content: '✓';
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 1;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 40, 20, .9);
  border: 1px solid #4fd67a;
  color: #4fd67a;
  border-radius: 50%;
  font-size: .7rem;
  line-height: 1;
}
.de-card-tile-name {
  font-size: .66rem;
  color: rgba(255, 255, 255, .68);
  margin-top: .3rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}
.de-card-tile-rank {
  font-size: .6rem;
  color: #e2c069;
  text-align: center;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.de-card-tile-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(10, 8, 20, .85);
  border: 1px solid rgba(226, 192, 105, .4);
  color: #e2c069;
  font-size: .62rem;
  padding: 1px 5px;
  border-radius: 10px;
}
.de-card-tile-add {
  position: absolute;
  inset: 0 0 22px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 8, 20, .55);
  color: #e2c069;
  font-size: 1.6rem;
  opacity: 0;
  transition: opacity .12s;
  border-radius: 8px;
  pointer-events: none;
}
.de-card-tile:hover .de-card-tile-add { opacity: 1; }
.de-card-tile-controls {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity .12s;
}
.de-card-tile:hover .de-card-tile-controls { opacity: 1; }
.de-card-tile-controls button {
  width: 28px;
  height: 28px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, .2);
  background: rgba(10, 8, 20, .9);
  color: #e2e0d8;
  font-size: .95rem;
  cursor: pointer;
  line-height: 1;
}
.de-card-tile-controls button:hover { background: rgba(226, 192, 105, .3); }

/* Colonne droite — recherche */
.de-search-filters { display: flex; flex-direction: column; gap: .6rem; margin-bottom: .8rem; }
.de-search-filters input, .de-search-filters select {
  width: 100%;
  box-sizing: border-box;
  background: rgba(0, 0, 0, .3);
  border: 1px solid rgba(180, 140, 40, .25);
  border-radius: 6px;
  color: #e8e6f0;
  font-family: 'Inter', sans-serif;
  font-size: .74rem;
  padding: .5rem .6rem;
}
.de-search-bar { position: relative; }
.de-search-bar input { padding-left: 2rem; }
.de-search-icon {
  position: absolute;
  left: .6rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: .78rem;
  opacity: .5;
  pointer-events: none;
}
.de-search-quick-toggles { display: flex; flex-wrap: wrap; gap: .4rem; }
.de-toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  position: relative;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 6px;
  padding: .35rem .65rem;
  font-size: .7rem;
  color: rgba(255, 255, 255, .65);
  cursor: pointer;
  user-select: none;
  transition: background .12s, border-color .12s, color .12s;
}
.de-toggle-pill:hover { background: rgba(226, 192, 105, .08); }
.de-toggle-pill input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.de-toggle-pill:has(input:checked) { background: rgba(226, 192, 105, .18); border-color: #e2c069; color: #e2c069; }
.de-toggle-pill span { color: rgba(226, 192, 105, .7); font-size: .66rem; }
.de-filters-toggle {
  align-self: flex-start;
  background: none;
  border: none;
  color: rgba(226, 192, 105, .65);
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: .68rem;
  cursor: pointer;
  padding: .1rem 0;
}
.de-filters-toggle:hover { color: #e2c069; }
.de-search-actions { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.de-active-filters { flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.de-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: rgba(226, 192, 105, .1);
  border: 1px solid rgba(226, 192, 105, .3);
  border-radius: 12px;
  color: #e2c069;
  font-size: .68rem;
  padding: .25rem .4rem .25rem .6rem;
}
.de-filter-chip button {
  background: none;
  border: none;
  color: rgba(226, 192, 105, .8);
  cursor: pointer;
  font-size: .7rem;
  line-height: 1;
  padding: 0 .15rem;
}
.de-filter-chip button:hover { color: #fff; }
.de-advanced-filters-panel {
  display: flex;
  flex-direction: column;
  gap: .7rem;
  margin-top: .3rem;
  padding: .7rem .7rem .2rem;
  background: rgba(255, 255, 255, .015);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 8px;
}
.de-filter-group { display: flex; flex-direction: column; gap: .3rem; }
.de-filter-group-split { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.de-filters-label { font-size: .64rem; color: rgba(255, 255, 255, .4); text-transform: uppercase; letter-spacing: .03em; }
.de-color-toggle-group { display: flex; gap: .5rem; }
.de-filter-inline { display: flex; gap: .4rem; }
.de-filter-inline select { width: 60px; flex-shrink: 0; }
.de-color-toggle {
  width: 28px;
  height: 28px;
  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;
}
.de-color-toggle:hover { opacity: .85; transform: scale(1.08); }
.de-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 dans l'identité sans y être
   obligée — distinct visuellement de "active" (obligatoire) par un contour
   pointillé au lieu d'un halo plein, pour ne pas laisser croire aux deux
   états qu'ils filtrent pareil. */
.de-color-toggle.de-color-optional { opacity: 1; border-style: dashed; border-color: #e2c069; box-shadow: 0 0 4px rgba(226, 192, 105, .35); }
/* Vraies couleurs Magic, foncées/saturées (pas de pastel délavé) */
.de-color-toggle.de-color-W { background: var(--mtg-W-deep, #c9b97f); }
.de-color-toggle.de-color-U { background: var(--mtg-U-deep, #1f4a8f); }
.de-color-toggle.de-color-B { background: #241f2c; border-color: rgba(255, 255, 255, .28); }
.de-color-toggle.de-color-R { background: var(--mtg-R-deep, #8a2a1c); }
.de-color-toggle.de-color-G { background: var(--mtg-G-deep, #2f6938); }
.de-color-toggle.de-color-C { background: #5c5c68; }
.de-search-results { margin-top: .2rem; }
.de-search-pagination { display: flex; align-items: center; justify-content: center; gap: .8rem; margin-top: .8rem; font-size: .74rem; color: rgba(255, 255, 255, .55); }
.de-search-pagination button {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 6px;
  color: #e2e0d8;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: .78rem;
  padding: .3rem .7rem;
  cursor: pointer;
}
.de-search-pagination button:disabled { opacity: .35; cursor: default; }

@media (max-width: 1000px) {
  .deck-editor-columns { flex-direction: column; overflow-y: auto; }
  .de-col-left, .de-col-right { width: auto; border: none; }
  .de-col { overflow-y: visible; }
  /* Colonne Hésitation (maybeboard) oubliée du repli ci-dessus — restait
     figée à width:200px (règle desktop) alors que les autres colonnes
     passent déjà en largeur auto ici. La poignée de redimensionnement par
     glisser n'a plus de sens une fois les colonnes empilées verticalement. */
  .de-col-maybeboard { width: auto; }
  .de-maybeboard-resizer { display: none; }
  /* .deck-editor-topbar : padding-left:200px (dégage #account-widget fixed
     en desktop, voir plus haut) pousse Sauvegarder/Simuler/Undo hors du
     viewport mobile — #screen-editor-deck (.deck-editor-screen) est en
     overflow:hidden, donc ces boutons deviennent totalement inatteignables,
     y compris au scroll. On retire ce padding du conteneur (il s'appliquerait
     sinon à CHAQUE ligne une fois le flex-wrap activé, gaspillant la largeur
     déjà réduite du mobile) et on le reporte en margin-left sur le seul
     premier bouton (← Mes decks) via .platform-back, pour dégager la pastille
     #account-widget (fixed, top:12px/left:16px, largeur variable selon le
     pseudo) SANS décaler les lignes suivantes. */
  .deck-editor-topbar { padding-left: .8rem; flex-wrap: wrap; }
  .deck-editor-topbar .platform-back { margin-left: 190px; }
}

/* ═══ Replay (Phase 3) ═══════════════════════════════════════════════
   Réutilise les classes de cartes/rangées de game.css/immersion.css/
   arcanum-rows.css (.player-zone, .zone-row, .zone-card, .token-face…) —
   voir replayViewer.js pour le rendu. Le reste (topbar, contrôles,
   journal) est propre à cet écran, comme le reste de platform.css. */
.replay-wrapper {
  /* Le replay est une table d'analyse : il doit utiliser l'écran disponible,
     contrairement aux pages de formulaire volontairement plus étroites. */
  width: calc(100vw - 32px);
  max-width: none;
  margin-inline: auto;
}

/* Aura temporaire : uniquement la carte entrée en main pendant l'étape affichée. */
.replay-card-drawn .zone-card {
  outline: 2px solid rgba(105, 170, 255, .95);
  outline-offset: 2px;
  box-shadow: 0 0 14px rgba(85, 150, 255, .8), 0 0 28px rgba(85, 150, 255, .35);
  animation: replay-drawn-pulse 1.8s ease-in-out infinite;
}
@keyframes replay-drawn-pulse {
  50% { box-shadow: 0 0 20px rgba(105, 180, 255, 1), 0 0 38px rgba(85, 150, 255, .5); }
}

/* Prologue du replay : toutes les mains proposées pendant les mulligans. */
.replay-mulligan-panel {
  margin-bottom: .8rem;
  padding: .85rem;
  border: 1px solid rgba(154, 113, 210, .28);
  border-radius: 10px;
  background: rgba(35, 22, 62, .36);
}
.replay-mulligan-heading { display: flex; justify-content: space-between; gap: .6rem; flex-wrap: wrap; margin-bottom: .7rem; }
.replay-mulligan-heading > div { display: grid; gap: 2px; }
.replay-mulligan-heading strong { color: #e2c069; font-family: 'Cinzel', serif; font-size: .85rem; }
.replay-mulligan-heading span { color: rgba(255, 255, 255, .45); font-size: .72rem; }
.replay-mulligan-close,
.replay-mulligan-toggle {
  border: 1px solid rgba(154, 113, 210, .3);
  border-radius: 6px;
  background: rgba(154, 113, 210, .08);
  color: rgba(255, 255, 255, .62);
  padding: .28rem .55rem;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: .7rem;
  cursor: pointer;
}
.replay-mulligan-toggle { margin-left: auto; }
.replay-mulligan-close:hover,
.replay-mulligan-toggle:hover,
.replay-mulligan-toggle.active { color: #e2c069; border-color: rgba(226, 192, 105, .45); background: rgba(226, 192, 105, .1); }
.replay-mulligan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: .7rem;
  align-items: start;
}
.replay-mulligan-player {
  display: flex;
  flex-direction: column;
  align-self: start;
  gap: .35rem;
  min-width: 0;
  padding: .55rem;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 8px;
  background: rgba(8, 7, 18, .22);
}
.replay-mulligan-name {
  color: rgba(255, 255, 255, .75);
  font-size: .75rem;
  min-height: 1.2rem;
}
.replay-mulligan-hand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  min-width: 0;
  padding: .3rem .45rem;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 6px;
  background: rgba(255, 255, 255, .025);
  color: rgba(255, 255, 255, .5);
  cursor: pointer;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: .7rem;
  min-height: 43px;
  flex: 0 0 auto;
}
.replay-mulligan-hand:hover { border-color: rgba(226, 192, 105, .35); }
.replay-mulligan-hand.kept { border-color: rgba(111, 209, 122, .55); color: #9fdda7; background: rgba(70, 150, 82, .08); }
.replay-mulligan-thumbs { display: flex; gap: 2px; min-width: 0; overflow: hidden; }
.replay-mulligan-thumbs img { width: 22px; height: 31px; object-fit: cover; border-radius: 2px; cursor: zoom-in; }

/* Timeline sémantique : la hauteur et la couleur encodent le type d'événement. */
.replay-timeline-panel { margin: 0 0 1rem; }
.replay-filter-toolbar {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  flex-wrap: wrap;
  margin-bottom: .5rem;
}
.replay-filter-group { display: flex; gap: .35rem; flex: 1 1 620px; flex-wrap: wrap; }
.replay-filter-group button {
  padding: .25rem .5rem;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 999px;
  background: rgba(255, 255, 255, .035);
  color: rgba(255, 255, 255, .55);
  cursor: pointer;
  /* Famille explicite : les <button> n'héritent pas de la police → Arial sinon. */
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: .72rem;
}
.replay-filter-group button.active { border-color: rgba(226, 192, 105, .55); background: rgba(226, 192, 105, .12); color: #e2c069; }
.replay-player-filter-wrap {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-left: auto;
  color: rgba(255, 255, 255, .45);
  font-size: .7rem;
  white-space: nowrap;
}
.replay-player-filter {
  min-height: 29px;
  min-width: 150px;
  padding: .25rem 1.5rem .25rem .5rem;
  border: 1px solid rgba(226, 192, 105, .25);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(4, 3, 11, .88), rgba(17, 12, 28, .88));
  color: #e2e0d8;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: .72rem;
  box-shadow: inset 0 2px 7px rgba(0, 0, 0, .5);
}
.replay-player-filter option { color: #e2e0d8; background: #0b0918; }
.replay-event-timeline {
  display: flex;
  align-items: end;
  gap: 2px;
  min-height: 42px;
  padding: .4rem .3rem;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  overflow-x: auto;
}
.replay-event-mark {
  flex: 1 0 5px;
  min-width: 4px;
  max-width: 14px;
  height: 17px;
  padding: 0;
  border: 0;
  border-radius: 2px 2px 0 0;
  background: rgba(255, 255, 255, .18);
  cursor: pointer;
  transition: opacity .15s, transform .15s, box-shadow .15s;
}
.replay-event-mark:hover { transform: scaleY(1.18); transform-origin: bottom; }
.replay-event-mark.current { box-shadow: 0 0 0 2px #e2c069; opacity: 1; }
.replay-event-mark.filtered-out { opacity: .12; }
.replay-event-mark.event-mulligan { height: 25px; background: #8f68c9; }
.replay-event-mark.event-draw { height: 22px; background: #5798db; }
.replay-event-mark.event-play { height: 28px; background: #d0a84f; }
.replay-event-mark.event-combat { height: 31px; background: #df7a47; }
.replay-event-mark.event-life { height: 24px; background: #ca6c73; }
.replay-event-mark.event-zone { height: 20px; background: #66a991; }
.replay-event-mark.event-elimination { height: 38px; min-width: 8px; background: #e05555; }
.replay-event-caption { margin-top: .35rem; min-height: 1em; color: rgba(255, 255, 255, .45); font-size: .7rem; }

.replay-topbar {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: .8rem;
  flex-wrap: wrap;
}
.replay-turn-label {
  font-family: 'Cinzel', serif;
  color: #e2c069;
  font-size: 1rem;
  flex-shrink: 0;
}
.replay-narration {
  color: rgba(255, 255, 255, .8);
  font-size: .85rem;
  line-height: 1.4;
}
.replay-narration-muted { color: rgba(255, 255, 255, .35); font-style: italic; }

.replay-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
  min-width: 0;
}
.replay-zone {
  width: 100%;
  min-width: 0;
  max-width: none;
  min-height: 660px;
}
.replay-zone .crea-content,
.replay-hand-row {
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
}
.replay-zone-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: 3px 4px 5px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  flex-wrap: wrap;
}
.replay-zone-name {
  font-family: 'Cinzel', serif;
  color: #e2e0d8;
  font-size: .82rem;
}
.replay-zone-stats { display: flex; gap: .55rem; font-family: 'JetBrains Mono', monospace; font-size: .74rem; }
.replay-stat { color: rgba(255, 255, 255, .7); }
.replay-stat-life { color: #6fd17a; }
.replay-stat-poison { color: #7fdc7f; }

.replay-zone-footer { display: flex; gap: .8rem; padding: 4px 4px 2px; }
.replay-pile-summary {
  display: flex; flex-direction: column; gap: 2px;
  cursor: pointer; border-radius: 6px; padding: 2px 4px; margin: -2px -4px;
  transition: background .15s;
}
.replay-pile-summary:hover { background: rgba(226, 192, 105, .1); }
.replay-pile-label { font-size: .64rem; color: rgba(255, 255, 255, .45); }
.replay-pile-thumbs { display: flex; gap: 2px; }
.replay-pile-thumb { width: 24px; height: 34px; object-fit: cover; border-radius: 2px; opacity: .85; }

.replay-hand-row { display: flex; flex-wrap: wrap; gap: 3px; padding: 4px; border-top: 1px dashed rgba(255, 255, 255, .08); }
.replay-hand-card .zone-card { width: 44px; height: 62px; }
.replay-cmd-cage .zone-card { border: 2px solid rgba(226, 192, 105, .6); border-radius: 8px; }

/* ── Modale "voir tout" (cimetière/exil/bibliothèque) ──────────────────── */
.replay-pile-modal-overlay {
  position: fixed; inset: 0; z-index: 9200;
  background: rgba(5, 4, 9, .75);
  display: flex; align-items: center; justify-content: center;
  padding: 2rem;
}
.replay-pile-modal {
  background: #0b0918;
  border: 1px solid rgba(226, 192, 105, .3);
  border-radius: 12px;
  max-width: 900px; max-height: 85vh; width: 100%;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.replay-pile-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 1.2rem;
  border-bottom: 1px solid rgba(226, 192, 105, .18);
}
.replay-pile-modal-header h3 { margin: 0; font-family: 'Cinzel', serif; color: #e2c069; font-size: 1rem; }
.replay-pile-modal-close {
  background: none; border: none; color: rgba(255, 255, 255, .6);
  font-size: 1.1rem; cursor: pointer; line-height: 1;
}
.replay-pile-modal-close:hover { color: #e2c069; }
.replay-pile-modal-grid {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 1rem 1.2rem;
  overflow-y: auto;
}

.replay-controls {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: nowrap;
  background: rgba(10, 8, 20, .55);
  border: 1px solid rgba(226, 192, 105, .18);
  border-radius: 10px;
  padding: .7rem .9rem;
  margin-bottom: 1rem;
}
.replay-controls-fixed { display: flex; align-items: center; gap: .6rem; flex: 1 1 auto; min-width: 0; }
.replay-speed-group { display: flex; gap: 3px; flex-shrink: 0; }
.replay-speed-group button {
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 6px;
  color: rgba(255, 255, 255, .6);
  font-family: 'JetBrains Mono', monospace;
  font-size: .72rem;
  padding: .25rem .5rem;
  cursor: pointer;
}
.replay-speed-group button.active { color: #e2c069; border-color: rgba(226, 192, 105, .5); background: rgba(226, 192, 105, .1); }
.replay-turn-jump {
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 6px;
  color: #e2e0d8;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: .78rem;
  padding: .3rem .4rem;
}
/* La barre prend tout l'espace libéré par la suppression de l'inspecteur
   redondant, sans modifier les contrôles de lecture qui la précèdent. */
.replay-scrub { width: 260px; flex: 0 0 260px; accent-color: #e2c069; }
.replay-scrub-pos { font-family: 'JetBrains Mono', monospace; font-size: .74rem; color: rgba(255, 255, 255, .5); flex-shrink: 0; }

.replay-action-list {
  max-height: 220px;
  overflow-y: auto;
  background: rgba(10, 8, 20, .55);
  border: 1px solid rgba(226, 192, 105, .18);
  border-radius: 10px;
  padding: .4rem;
}
.replay-action-item {
  display: flex;
  gap: .6rem;
  padding: .3rem .5rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: .78rem;
  color: rgba(255, 255, 255, .6);
}
.replay-action-item:hover { background: rgba(255, 255, 255, .05); }
.replay-action-item.active { background: rgba(226, 192, 105, .12); color: #e2e0d8; }
.replay-action-turn { font-family: 'JetBrains Mono', monospace; color: rgba(226, 192, 105, .7); flex-shrink: 0; }
.replay-action-list.filter-empty::after {
  content: 'Aucune action ne correspond à ces filtres.';
  display: block;
  padding: .8rem .65rem;
  color: rgba(255, 255, 255, .4);
  font-size: .76rem;
  font-style: italic;
  text-align: center;
}

@media (max-width: 640px) {
  .replay-zone { flex: 1 1 100%; max-width: none; min-height: 0; }
  .replay-mulligan-grid { grid-template-columns: 1fr; }
  .replay-player-filter-wrap { width: 100%; margin-left: 0; }
  .replay-player-filter { flex: 1 1 auto; min-width: 0; }
  /* .replay-controls (flex-wrap:nowrap) + .replay-scrub (flex:1 1 420px,
     min-width:240px, règle #screen-replay ci-dessous) débordent largement
     un écran de 375-393px (scrollWidth ~700px pour ~340px de large
     disponible) — précédent/lecture/suivant/x1-x2-x4/sélecteur de
     tour/scrubber ne tiennent jamais sur une seule ligne sans wrap.
     .replay-controls n'a qu'un seul enfant flex (.replay-controls-fixed,
     flex:1 1 auto) qui porte réellement tous les boutons — flex-wrap doit
     donc s'appliquer à CE conteneur-là, pas juste à .replay-controls (qui
     n'a rien d'autre à wrapper). */
  .replay-controls, .replay-controls-fixed { flex-wrap: wrap; }
  #screen-replay .replay-scrub { min-width: 140px; flex-basis: 140px; }
}

/* Replay — seuls les deux contrôles validés conservent le polish :
   sélecteur de tour gravé + scrubber avec orbe dorée. */
#screen-replay .replay-turn-jump {
  min-height: 34px;
  padding: .3rem 1.6rem .3rem .55rem;
  border-color: rgba(226, 192, 105, .26);
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(4, 3, 11, .88), rgba(17, 12, 28, .88));
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, .62), 0 1px rgba(255, 255, 255, .025);
}

#screen-replay .replay-turn-jump option {
  color: #e2e0d8;
  background: #0b0918;
}

#screen-replay .replay-scrub {
  width: auto;
  min-width: 240px;
  height: 22px;
  flex: 1 1 420px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  accent-color: #e2c069;
  -webkit-appearance: none;
  appearance: none;
}

#screen-replay .replay-scrub::-webkit-slider-runnable-track {
  height: 5px;
  border: 1px solid rgba(226, 192, 105, .17);
  border-radius: 999px;
  background: linear-gradient(180deg, #030208, #171022);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .85), 0 1px rgba(255, 255, 255, .025);
}

#screen-replay .replay-scrub::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  margin-top: -6px;
  border: 1px solid #f7e39a;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 28%, #fff4bd 0 10%, #e2c069 38%, #9e7220 100%);
  box-shadow: 0 0 0 3px rgba(226, 192, 105, .09), 0 0 12px rgba(226, 192, 105, .85), 0 2px 5px rgba(0, 0, 0, .7);
  -webkit-appearance: none;
}

#screen-replay .replay-scrub::-moz-range-track {
  height: 5px;
  border: 1px solid rgba(226, 192, 105, .17);
  border-radius: 999px;
  background: linear-gradient(180deg, #030208, #171022);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .85);
}

#screen-replay .replay-scrub::-moz-range-progress {
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, #a77c27, #efd476);
  box-shadow: 0 0 7px rgba(226, 192, 105, .35);
}

#screen-replay .replay-scrub::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border: 1px solid #f7e39a;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 28%, #fff4bd 0 10%, #e2c069 38%, #9e7220 100%);
  box-shadow: 0 0 0 3px rgba(226, 192, 105, .09), 0 0 12px rgba(226, 192, 105, .85), 0 2px 5px rgba(0, 0, 0, .7);
}

/* ═══ Découvrir des cartes (accueil, bouton à côté des Règles) ═══════════
   Grille de plusieurs cartes piochées d'un coup, en assez grand pour être
   lues directement — contrairement aux tuiles minuscules de la recherche
   de l'éditeur de deck (deckEditor.js), qui comptent sur le survol/zoom. */
.cd-filters-card { margin-bottom: 1.2rem; }
.cd-filters-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1.2rem;
}
.cd-filter-group { display: flex; flex-direction: column; gap: .3rem; }
.cd-filter-group select, .cd-filter-group input {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(226, 192, 105, .18);
  border-radius: 6px;
  color: #e2e0d8;
  padding: 6px 10px;
  font-size: .78rem;
}
/* Sans ça, le menu déroulant natif du <select> (rendu par l'OS/le navigateur,
   pas par ce CSS) reste en palette claire par défaut — texte quasi blanc
   (`color` ci-dessus, pensé pour le fond sombre de la boîte fermée) sur fond
   blanc, illisible une fois le menu ouvert. color-scheme fait rendre ce menu
   en palette sombre ; les règles sur `option` sont un filet de sécurité pour
   les navigateurs qui respectent color-scheme mais laissent quand même le
   fond des <option> au navigateur (observé sur certaines versions Chrome/Edge
   Windows malgré color-scheme correctement appliqué). */
.cd-filter-group select { color-scheme: dark; }
.cd-filter-group select option {
  background: #1a1730;
  color: #e2e0d8;
}
.cd-draw-btn { margin-left: auto; }
.cd-history-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: -.4rem 0 1.2rem;
}
.cd-history-nav .platform-back { margin-bottom: 0; }
.cd-history-nav .platform-back:disabled { opacity: .35; cursor: not-allowed; }
.cd-history-label { font-size: .74rem; color: rgba(255, 255, 255, .55); }

/* ═══ Cartes bannies (accueil, bouton à côté de "Découvrir des cartes") ═══
   Même grille .cd-results-grid/.cd-card-tile que la pioche aléatoire
   ci-dessus, mais liste fixe paginée plutôt que tirée au hasard — barre
   Préc./Suiv. + saisie directe du numéro de page pour parcourir toute la
   ban-list rapidement, dupliquée en haut ET en bas des résultats. */
.cd-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 0 0 1.2rem;
}
.cd-pagination .platform-back { margin-bottom: 0; }
.cd-pagination .platform-back:disabled { opacity: .35; cursor: not-allowed; }
.cd-pagination-label {
  font-size: .74rem;
  color: rgba(255, 255, 255, .55);
  display: flex;
  align-items: center;
  gap: .45rem;
}
.cd-pagination-jump {
  width: 3.4rem;
  text-align: center;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(226, 192, 105, .18);
  border-radius: 6px;
  color: #e2e0d8;
  padding: 4px 2px;
  font-size: .78rem;
  color-scheme: dark;
}
.cd-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.4rem;
}
.cd-card-tile { text-align: center; }
.cd-card-tile img {
  width: 100%;
  border-radius: 4.5% / 3.2%;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .55);
  cursor: zoom-in;
  transition: box-shadow .18s ease;
}
/* L'agrandissement au survol se fait via #card-zoom (showZoom/moveZoom/
   hideZoom, lobby.js) — même aperçu flottant qui suit la souris que
   partout ailleurs sur le site (jeu, éditeur de deck), pas un scale() en
   place sur la tuile elle-même. */
.cd-card-tile img:hover { box-shadow: 0 10px 28px rgba(0, 0, 0, .65); }

/* ═══ Bandeau de date — écran "Nouvelles sorties" (#screen-new-releases) ═══
   Une ligne pleine largeur dans la grille .cd-results-grid (grid-column
   1/-1) avant chaque groupe de cartes partageant la même date de preview
   Scryfall — voir nrRenderCards/nrComputeDateCounts, lobby.js. */
.nr-date-header {
  grid-column: 1 / -1;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: rgba(226, 192, 105, .85);
  border-bottom: 1px solid rgba(226, 192, 105, .18);
  padding: .3rem 0 .5rem;
  margin: .4rem 0 -.2rem;
}
.nr-date-header:first-child { margin-top: 0; }
@media (max-width: 700px) {
  .cd-results-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .8rem; }
  .cd-draw-btn { margin-left: 0; width: 100%; }
}

/* ═══ Accessibilité mouvement (groupe 1, audit juillet 2026) ══════════════
   arcanum-background.css et immersion.css respectent déjà
   prefers-reduced-motion ; les écrans plateforme ne le faisaient pas
   (ex : l'aura pulsante infinie de la carte piochée dans le replay). */
@media (prefers-reduced-motion: reduce) {
  .replay-card-drawn .zone-card { animation: none !important; }
  #screen-profile *, #screen-badges *, #screen-decks *,
  #screen-deck-editor *, #screen-replay *, #screen-card-discovery * {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Deck à deux commandants (Partner) : la case est scindée en deux moitiés. */
.deck-card-banner-img.is-half { width: 50%; }
.deck-card-banner-img.is-half.is-left  { left: 0;  right: auto; }
.deck-card-banner-img.is-half.is-right { left: 50%; right: auto; border-left: 1px solid rgba(226,192,105,.7); }


/* Éditeur de deck : le commandant se choisit en premier — cadre jaune clignotant */
.platform-card.needs-commander{border:2px solid #ffd23f;animation:needsCommanderPulse 1.1s ease-in-out infinite}
.platform-card.needs-commander .de-mini-title::after{content:" — commence ici";color:#ffd23f;font-weight:400;font-size:.78em}
@keyframes needsCommanderPulse{
  0%,100%{box-shadow:0 0 0 0 rgba(255,210,63,.0),0 0 6px rgba(255,210,63,.25)}
  50%{box-shadow:0 0 0 3px rgba(255,210,63,.35),0 0 22px rgba(255,210,63,.6)}}
/* !important + durée explicite : la règle reduced-motion des écrans plateforme (plus haut) écraserait sinon le clignotement voulu. */
#screen-deck-editor .platform-card.needs-commander{animation:needsCommanderPulse 1.1s ease-in-out infinite !important}

/* Fluidité « Mes decks » : le navigateur ne dessine que les cartes visibles
   (content-visibility) et décode les images hors du fil principal. */
#screen-decks .deck-card { content-visibility: auto; contain-intrinsic-size: auto 240px; }
