/* Polices de My_Assets/13_Polices : Trans800 pour l'affichage (titres, onglets, boutons, chiffres),
   Cyberbit pour le texte courant. */
@font-face {
  font-family: "Trans800";
  src: url("../fonts/Trans800.woff2") format("woff2"), url("../fonts/Trans800.otf") format("opentype");
  font-display: swap; /* texte affiché tout de suite en police de secours pendant le chargement */
}
/* Texte courant : Cyberbit réduite aux caractères latins (fonts/Cyberbit-latin.woff2, 13 Ko au lieu de 13 Mo),
   générée par tools/polices.py depuis My_Assets/13_Polices/Cyberbit.ttf */
@font-face {
  font-family: "Cyberbit";
  src: url("../fonts/Cyberbit-latin.woff2") format("woff2");
  font-display: swap;
}
/* Japonais : Cyberbit réduite aux kanas, ponctuation japonaise et kanjis des traductions (fonts/Cyberbit-ja.woff2,
   ≈ 200 Ko, tools/polices.py ja). Famille citée seulement sous html:lang(ja) : les autres langues ne la téléchargent pas.
   Les chiffres et lettres latines restent dans Cyberbit-latin (même alignement vertical qu'en français). */
@font-face {
  font-family: "Cyberbit JA";
  src: url("../fonts/Cyberbit-ja.woff2") format("woff2");
  unicode-range: U+2010-25FF, U+2700-27BF, U+3000-30FF, U+31F0-31FF, U+4E00-9FFF, U+FF01-FFE6;
  font-display: swap;
}
html:lang(ja) {
  --font-title: "Trans800", "Cyberbit JA", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-text: "Cyberbit", "Cyberbit JA", Georgia, "Times New Roman", serif;
}
:root {
  --font-title: "Trans800", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-text: "Cyberbit", Georgia, "Times New Roman", serif;
  --bg: #1d1712;
  --panel: #2b221a;
  --panel-2: #362a20;
  --border: #4a3a2b;
  --text: #f1e6d4;
  --muted: #a8977f;
  --gold: #e9b949;
  --accent: #d9822b;
  --good: #6fbf73;
  --bad: #d9584a;
  --blue: #5fa8d3;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  /* Fond cuir vert aux lanternes (img/fond, agrandi par Lanczos : 2560 px, et 3840 px pour les écrans 4K / Retina).
     Calé en haut pour garder les lanternes visibles sur les écrans larges. */
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-text);
  font-size: 16px;
  min-height: 100vh;
}
/* Image de fond sur un calque fixe, et non « background-attachment: fixed » : celui-ci redessine toute la page à chaque pas de
   défilement (notes, « Fluidité du défilement »). Même cadrage, même rendu. */
html:not(.tel) body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: var(--bg) url("../img/fond/fond.jpg") center top / cover no-repeat;
}
@media (min-width: 1921px), (min-resolution: 1.5dppx) {
  html:not(.tel) body::before { background-image: url("../img/fond/fond_4k.jpg"); }
}

h1 { font-size: 20px; margin: 0; letter-spacing: .5px; }
h2 { font-size: 16px; margin: 0 0 10px; }
h3 { font-size: 15px; margin: 14px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
small { font-size: 13px; }
.muted { color: var(--muted); }
.empty { color: var(--muted); font-style: italic; text-align: center; padding: 20px 0; margin: 0; }

/* ---------- Barre du haut ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  padding: 10px 16px;
  /* Bandeau de Noël (img/fond/bandeau_noel.webp) derrière la barre, légèrement assombri pour garder les textes lisibles */
  background: linear-gradient(rgba(12, 9, 6, .45), rgba(12, 9, 6, .45)), url("../img/fond/bandeau_noel.webp") center / cover no-repeat, #15100c;
  border-bottom: 2px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.hud { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hud-item {
  display: flex; align-items: center; gap: 6px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 20px;
  padding: 4px 12px;
}
.hud-item b { color: var(--gold); font-size: 15px; }
.hud-item.level { flex-direction: column; align-items: stretch; gap: 2px; border-radius: 10px; min-width: 140px; }
.hud-item.level small { color: var(--muted); text-align: center; }

/* ---------- Grille ---------- */
.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); /* largeur fixe : le contenu ne la fait pas varier (icônes de catégories figées) */
  grid-template-areas:
    "counter ."
    "quests  ."
    "stock   ."
    "racks   ."
    "dungeons dungeons"
    "heroes  heroes"
    "city    city";
  grid-template-rows: auto auto auto 1fr auto auto auto;
  gap: 14px;
  padding: 6px 16px 14px; /* haut : 6 px + les 8 px sous les onglets */
  max-width: 1700px; margin: 0 auto; /* même largeur pour tous les onglets et la barre d'onglets */
  align-items: start;
}
.counter { grid-area: counter; }
.racks { grid-area: racks; }
.stock { grid-area: stock; }
.city { grid-area: city; }
.heroes-panel { grid-area: heroes; }
.quests-panel { grid-area: quests; }

/* ---------- Quêtes ---------- */
.quests { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.quest { background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.quest.complete { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(233,185,73,.3) inset; }
.quest-head { display: flex; gap: 8px; align-items: flex-start; }
.quest-head .avatar { font-size: 30px; }
.bubble { position: relative; flex: 1; background: #efe4cf; color: #2a1f15; border-radius: 10px; padding: 6px 10px; font-size: 15px; }
.bubble::before { content: ''; position: absolute; left: -6px; top: 12px; border: 6px solid transparent; border-left: 0; border-right-color: #efe4cf; }
.bubble .muted { color: #7a6a55; }
.bubble div { font-style: italic; margin-top: 2px; }
.qsection { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-top: 4px; }
.qsection::before, .qsection::after { content: ''; flex: 1; border-top: 1px solid var(--border); }
.qobjs { display: grid; gap: 4px; }
.qobj { display: flex; gap: 8px; align-items: center; padding: 3px 6px; border-radius: 6px; background: rgba(0,0,0,.15); }
.qobj.ok { background: rgba(111,191,115,.12); }
.qobj-icon { font-size: 22px; }
.qobj-icon.oc-link { flex: 0 0 auto; }
/* Objet demandé au comptoir (icône et nom) : clic = sa fiche (openProg) */
.customer .wish .w-item, .customer .wish .w-ico { cursor: pointer; }
.customer .wish .w-ico:hover img { filter: brightness(1.2); }
.customer .wish .w-item:hover, .customer .wish .w-item:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
.customer .wish .w-item:focus-visible, .customer .wish .w-ico:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.qobj-body { flex: 1; min-width: 0; }
.qobj-name { font-weight: 600; font-size: 15px; }
.qobj-count { font-size: 14px; }
.qobj.ok .qobj-count { color: var(--good); }
.qrewards { display: flex; flex-wrap: wrap; gap: 5px; }
.qreward { background: rgba(0,0,0,.2); border: 1px solid var(--border); border-radius: 12px; padding: 2px 8px; font-size: 14px; }
.qreward.gift { border-color: var(--q); color: var(--q); cursor: pointer; transition: transform .12s, box-shadow .12s, filter .12s; }
.qreward.gift:hover { transform: translateY(-2px); filter: brightness(1.2); box-shadow: 0 0 0 2px var(--q), 0 4px 10px rgba(0, 0, 0, .45); }
/* Fiche d'un objet (fenêtre Progrès) : nom à la qualité, niveau, prix, puissance, XP, stock */
.item-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 6px 10px; padding: 10px 12px; border-radius: 12px;
  background: rgba(24, 16, 10, .94); border: 1px solid #5b3a1c; color: #f3e4c4; }
/* Bulle de statistiques d'un objet du stock (appui maintenu) */
.item-pop { position: fixed; z-index: 100000; pointer-events: none; max-width: min(520px, calc(100vw - 16px)); box-shadow: 0 6px 20px rgba(0, 0, 0, .6); border-radius: 12px; }
.item-pop { inset: auto; margin: 0; padding: 0; border: 0; background: none; overflow: visible; color: inherit; }
.item-pop .item-stats { margin: 0; }
.is-skill { flex: 1 1 100%; display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 10px; background: rgba(255, 255, 255, .06); border: 1px solid #5b3a1c; }
.is-skill.ok { border-color: var(--good, #6fcf6f); }
.is-skill.off { opacity: .7; }
.is-skill > span:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.is-skill small { color: #cdb68c; font-size: 13px; }
.is-sk-ico { flex: none; display: inline-flex; width: 32px; height: 32px; align-items: center; justify-content: center; }
.is-sk-ico img { max-width: 100%; max-height: 100%; object-fit: contain; }
#inventory .item, .recipe > .tile, .fu-card, .ep-card { -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
.is-head { display: flex; align-items: center; gap: 10px; margin-right: auto; min-width: 0; }
.is-head > span:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.is-head small { color: #cdb68c; font-size: 13px; }
.is-ico { width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; border: 2px solid var(--q, #5b3a1c); border-radius: 10px; background: rgba(0, 0, 0, .3); }
.is-ico img { width: 44px; height: 44px; object-fit: contain; }
.is-cell { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 72px; padding: 4px 10px; border-radius: 10px; background: rgba(255, 255, 255, .06); }
.is-cell small { color: #cdb68c; font-size: 12px; }
.is-cell b { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.is-cell img.ui-ico { height: 1.2em; width: auto; }
/* Livraison partielle (commandes, quêtes de héros) : déjà livré + disponible en stock */
.oc-line.can .oc-n { color: #9fe0a6; }
.oc-plus { color: #7be08a; font-weight: 700; }
.quest-actions { display: flex; gap: 6px; justify-content: space-between; align-items: center; margin-top: 2px; }
.quest-actions .btn.primary { flex: 1; }

/* ---------- Héros ---------- */
.hero-class h3 { text-transform: none; letter-spacing: 0; font-size: 16px; color: var(--text); display: flex; align-items: center; gap: 6px; }
.hero-class h3:has(.away-toggle) { flex-wrap: wrap; }
.hero-class h3 .away-toggle { margin: 0 8px 8px auto; flex: none; min-height: 24px; padding: 0; border: 0; background: none; color: inherit; font: inherit; line-height: 1.1; cursor: pointer; display: flex; align-items: center; gap: 9px; opacity: .6; }
.hero-class h3 .away-toggle img { width: 24px; height: 24px; flex: none; object-fit: contain; display: block; }
.hero-class h3 .away-toggle:hover, .hero-class h3 .away-toggle.on { opacity: 1; }
.hero-class h3 .away-toggle.on img { filter: drop-shadow(0 0 4px #f4c542); }
.hero { background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.hero.is-hired { border-color: var(--good); }
.hero.locked { opacity: .55; }
/* Emplacements d'équipement : cartes (img/boutons/card_*.png, de My_Assets/16_Bouton) */
.hslots { display: grid; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 4px; }
.hcard {
  position: relative; aspect-ratio: 65 / 75; padding: 14% 8% 0; border: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 4px;
  background: url("../img/boutons/card_default.png") center / 100% 100% no-repeat;
  font: inherit; color: #fff; transition: filter .15s, transform .05s;
}
.hcard:hover:not(:disabled) { filter: brightness(1.06); }
.hcard:active:not(:disabled) { transform: translateY(1px); background-image: url("../img/boutons/card_default_down.png"); }
.hcard.full { background-image: url("../img/boutons/card_yellow.png"); }
.hcard.full:active:not(:disabled) { background-image: url("../img/boutons/card_yellow_down.png"); }
.hcard.dark { background-image: url("../img/boutons/card_dark.png"); cursor: default; }
.hcard:disabled { cursor: default; }
.hcard.empty { filter: grayscale(1) brightness(.7); opacity: .75; }
.hcard-icons { display: flex; justify-content: center; align-items: center; gap: 2px; height: 24px; max-width: 100%; }
/* Icônes de types acceptés (un emplacement en liste jusqu'à 4) : grille qui reste dans la carte
   1 icône = 26 px ; 2 = 22 px côte à côte ; 3 ou 4 = 2 colonnes de 18 px (la 3e centrée) */
.hcard-icons[data-n] { display: grid; grid-template-columns: repeat(2, 18px); justify-content: center; align-content: center; justify-items: center; gap: 2px 3px; height: auto; min-height: 24px; width: 100%; }
.hcard-icons[data-n="1"] { grid-template-columns: 26px; }
.hcard-icons[data-n="2"] { grid-template-columns: repeat(2, 22px); }
.hcard-icons[data-n="3"] .htype:last-child { grid-column: 1 / -1; }
.hcard-icons[data-n="1"] .htype { width: 26px; height: 26px; }
.hcard-icons[data-n="2"] .htype { width: 22px; height: 22px; }
.hcard-icons[data-n="3"] .htype, .hcard-icons[data-n="4"] .htype { width: 16px; height: 16px; }
.hcard:has(> .hcard-icons[data-n="3"]), .hcard:has(> .hcard-icons[data-n="4"]) { padding-top: 9%; gap: 3px; }
.hcard-icons[data-n="3"], .hcard-icons[data-n="4"] { gap: 1px 3px; min-height: 0; grid-template-columns: repeat(2, 16px); }
/* Icônes de type en blanc cerné de brun (préférée en doré), comme sur la maquette */
.htype { width: 20px; height: 20px; object-fit: contain; flex-shrink: 1; min-width: 0;
  /* Couleur et contour déjà dessinés dans l'image (img/types/<id>_blanc|or|gris.png, tools/icones_types.py) : plus aucun filtre CSS,
     qui ralentissait fortement le défilement de l'écran des héros. L'image a une marge pour le contour : agrandie de 1,15. */
  transform: scale(1.15); }
.htype.dim { opacity: .35; }
.hcard.dark .htype { opacity: .8; }
.hcard-icons.is-item { height: 26px; font-size: 22px; filter: drop-shadow(0 0 2px var(--q)) drop-shadow(0 0 1px var(--q)); }
.hcard-icons.is-item img.ii { width: 26px; height: 26px; }
/* Libellé blanc à contour brun, comme sur la maquette */
.hcard-label {
  font-family: var(--font-title); font-size: 14px; line-height: 1; white-space: nowrap; letter-spacing: .3px;
  text-shadow: -1px -1px 0 #4a2a10, 1px -1px 0 #4a2a10, -1px 1px 0 #4a2a10, 1px 1px 0 #4a2a10, 0 2px 0 #4a2a10;
}
.hcard.dark .hcard-label { font-size: 11px; }
/* Pastille verte : un objet en stock convient à cet emplacement */
.hcard.can::after { content: ""; position: absolute; top: 9%; right: 12%; width: 8px; height: 8px; border-radius: 50%;
  background: var(--good); box-shadow: 0 0 0 1.5px #4a2a10; }
.hired { color: var(--good); font-size: 14px; font-weight: 600; }
.fav { color: #e05a7a; margin-left: 4px; }

/* ---------- Ville ---------- */
.hint { font-size: 16px; line-height: 1.4; margin: 0 0 10px; } /* textes d’aide des onglets et fenêtres (14 → 16 px, 29/11/2026) */
.city-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.b-icon { font-size: 24px; }
.b-lock { position: absolute; right: -2px; bottom: -2px; font-style: normal; font-size: 18px; }
.b-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.b-name { font-weight: 600; }
.b-effect { color: var(--good); }
.b-block { font-style: italic; }
.bar.invest i { background: var(--gold); }
.b-actions { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.b-actions small { flex: 1; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: 0 4px 14px rgba(0,0,0,.3);
}
/* Ordinateur : ombre sur un pseudo-élément, sinon Chrome ne reconnaît plus le fond opaque du panneau et perd le lissage ClearType
   du texte dès que la page défile sur un calque à part (notes, « Fluidité du défilement ») */
:where(html:not(.tel)) .panel { position: relative; box-shadow: none; }
:where(html:not(.tel)) .panel::before { content: ""; position: absolute; inset: -1px; z-index: -1; border-radius: inherit; box-shadow: 0 4px 14px rgba(0,0,0,.3); pointer-events: none; }
/* Échoppe : un calque par panneau. Contexte d'empilement : un menu ouvert qui dépasse du panneau doit le surélever (mêmes z-index qu'avant) */
:where(html:not(.tel)) .ech-col > .panel { will-change: opacity; }
:where(html:not(.tel)) .ech-col > .panel:has(.customer.sug-open) { z-index: 6; }
:where(html:not(.tel)) .ech-col > .panel:has(.customer.menu-open) { z-index: 5; }
:where(html:not(.tel)) .ech-col > .panel:has(.qf-list:not([hidden])), :where(html:not(.tel)) .ech-col > .panel.tip-top { will-change: auto; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.panel-head h2 { margin: 0; }

/* ---------- Boutons ---------- */
/* Visuels de My_Assets/16_Bouton (img/boutons/), étirés en 9 zones : les bouts arrondis gardent leur forme.
   Le fond est dessiné par ::before (border-image) pour garder un padding libre.
   jaune = normal, vert = action principale (.primary), bleu = secondaire (.ghost),
   rouge = action destructrice (.danger, Congédier, Abandonner, ↺), gris = désactivé. */
.btn {
  --btn-img: url("../img/boutons/nets/yellow.png"); --btn-img-down: url("../img/boutons/nets/yellow_down.png");
  --btn-img-s: url("../img/boutons/nets/yellow_s.png"); --btn-img-s-down: url("../img/boutons/nets/yellow_down_s.png");
  --btn-ink: #3a2410;
  --btn-shadow: rgba(255, 240, 200, .5);
  position: relative; isolation: isolate;
  background: none; border: 0; color: var(--btn-ink);
  text-shadow: 0 1px 0 var(--btn-shadow);
  min-height: 36px; padding: 6px 16px 8px; font: inherit; cursor: pointer;
  transition: filter .15s, transform .05s;
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  border-style: solid; border-width: 15px 18px 16px;
  border-image: var(--btn-img) 15 18 16 fill / 15px 18px 16px stretch;
}
.btn:hover:not(:disabled) { filter: brightness(1.08); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:active:not(:disabled)::before { border-image-source: var(--btn-img-down); }
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 18px; }
.btn.primary {
  --btn-img: url("../img/boutons/nets/green.png"); --btn-img-down: url("../img/boutons/nets/green_down.png");
  --btn-img-s: url("../img/boutons/nets/green_s.png"); --btn-img-s-down: url("../img/boutons/nets/green_down_s.png");
  --btn-ink: #fff; --btn-shadow: #0b3d22; --btn-outline: 1; font-weight: normal;
}
.btn.ghost {
  --btn-img: url("../img/boutons/nets/blue.png"); --btn-img-down: url("../img/boutons/nets/blue_down.png");
  --btn-img-s: url("../img/boutons/nets/blue_s.png"); --btn-img-s-down: url("../img/boutons/nets/blue_down_s.png");
  --btn-ink: #fff; --btn-shadow: #0d2c5a; --btn-outline: 1;
}
.btn.danger, .btn[data-action="refuse"], .btn[data-action="abandonQuest"], .btn[data-action="reset"] {
  --btn-img: url("../img/boutons/nets/red.png"); --btn-img-down: url("../img/boutons/nets/red_down.png");
  --btn-img-s: url("../img/boutons/nets/red_s.png"); --btn-img-s-down: url("../img/boutons/nets/red_down_s.png");
  --btn-ink: #fff; --btn-shadow: #5a0f0f; --btn-outline: 1;
}
.btn.primary, .btn.ghost, .btn.danger, .btn[data-action="refuse"], .btn[data-action="abandonQuest"], .btn[data-action="reset"] {
  text-shadow: -1px -1px 0 var(--btn-shadow), 1px -1px 0 var(--btn-shadow), -1px 1px 0 var(--btn-shadow), 1px 1px 0 var(--btn-shadow), 0 2px 2px var(--btn-shadow), 0 0 4px var(--btn-shadow);
}
.btn:disabled {
  --btn-img: url("../img/boutons/nets/disabled.png"); --btn-img-down: url("../img/boutons/nets/disabled.png");
  --btn-img-s: url("../img/boutons/nets/disabled_s.png"); --btn-img-s-down: url("../img/boutons/nets/disabled_s.png");
  --btn-ink: #5c554b; --btn-shadow: rgba(255, 255, 255, .35);
  cursor: not-allowed; filter: none;
}
.btn.small { min-height: 30px; padding: 4px 12px 6px; font-size: 14px; }
.btn.small::before { border-width: 12px 15px 13px; border-image: var(--btn-img-s) 12 15 13 fill / 12px 15px 13px stretch; }
.btn.small:active:not(:disabled)::before { border-image-source: var(--btn-img-s-down); }
/* Images des boutons déjà à leur taille d'affichage (tools/boutons_nets.py) : plus de « rayures » aux jointures des
   9 morceaux. Écrans haute définition : versions @2x, tranches doublées. */
@media (min-resolution: 1.25dppx) {
  .btn { --btn-img: url("../img/boutons/nets/yellow@2x.png"); --btn-img-down: url("../img/boutons/nets/yellow_down@2x.png");
  --btn-img-s: url("../img/boutons/nets/yellow_s@2x.png"); --btn-img-s-down: url("../img/boutons/nets/yellow_down_s@2x.png"); }
  .btn.primary { --btn-img: url("../img/boutons/nets/green@2x.png"); --btn-img-down: url("../img/boutons/nets/green_down@2x.png");
  --btn-img-s: url("../img/boutons/nets/green_s@2x.png"); --btn-img-s-down: url("../img/boutons/nets/green_down_s@2x.png"); }
  .btn.ghost { --btn-img: url("../img/boutons/nets/blue@2x.png"); --btn-img-down: url("../img/boutons/nets/blue_down@2x.png");
  --btn-img-s: url("../img/boutons/nets/blue_s@2x.png"); --btn-img-s-down: url("../img/boutons/nets/blue_down_s@2x.png"); }
  .btn.danger, .btn[data-action="refuse"], .btn[data-action="abandonQuest"], .btn[data-action="reset"] { --btn-img: url("../img/boutons/nets/red@2x.png"); --btn-img-down: url("../img/boutons/nets/red_down@2x.png");
  --btn-img-s: url("../img/boutons/nets/red_s@2x.png"); --btn-img-s-down: url("../img/boutons/nets/red_down_s@2x.png"); }
  .btn:disabled { --btn-img: url("../img/boutons/nets/disabled@2x.png"); --btn-img-down: url("../img/boutons/nets/disabled@2x.png");
  --btn-img-s: url("../img/boutons/nets/disabled_s@2x.png"); --btn-img-s-down: url("../img/boutons/nets/disabled_s@2x.png"); }
  .btn::before { border-image-slice: 30 36 32 fill; }
  .btn.small::before { border-image-slice: 24 30 26 fill; }
}
/* Bouton de fermeture (croix) */
.btn.close {
  min-height: 0; width: 32px; height: 32px; padding: 0; font-size: 0; color: transparent; text-shadow: none;
  background: url("../img/boutons/close.png") center / contain no-repeat;
}
.btn.close::before { content: none; }
.btn.close:active { background-image: url("../img/boutons/close_down.png"); }
select {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 7px; padding: 4px 6px; font: inherit; font-size: 14px;
}

/* ---------- Barres ---------- */
.bar { height: 6px; background: #1a140f; border-radius: 3px; overflow: hidden; margin: 4px 0 2px; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s linear; }
.bar.xp i { background: var(--gold); }
.bar.patience i { background: var(--good); }
.bar.patience i.low { background: var(--bad); }
.bar.res-bar i { background: var(--blue); }

/* ---------- Comptoir ---------- */
.customer {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px;
}
.customer.new { animation: arrive .35s ease-out; }
.customer.can-sell { border-color: var(--good); box-shadow: 0 0 0 1px rgba(111,191,115,.3) inset; }
@keyframes arrive { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.avatar { font-size: 30px; line-height: 1; }
/* Portraits des héros (img/heros/) */
img.av { height: 1.5em; width: 1.5em; object-fit: contain; vertical-align: -0.45em; }
.avatar img.av { width: 48px; height: 48px; display: block; filter: drop-shadow(0 2px 2px rgba(0,0,0,.5)); }
.hero.locked .avatar img.av { filter: grayscale(1); }
.cust-name { font-weight: 600; }
.cust-class { color: var(--muted); font-size: 14px; }
.stock-line { font-size: 14px; color: var(--good); }
.missing { color: var(--bad); }
.mod-tag { text-align: center; font-size: 14px; padding: 4px 6px; border-radius: 8px; background: rgba(0,0,0,.25); }
.mod-tag.surcharge { color: #f0b36a; }
.mod-tag.remise { color: #8fd98f; }
.cust-actions .btn { font-size: 14px; padding: 5px 6px; white-space: nowrap; }
.cust-actions .btn { min-width: 0; max-width: 100%; box-sizing: border-box; }

/* ---------- Atelier ---------- */
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 8px; }
/* Artisans : tuiles violettes, objet au centre, temps restant en bas */
.slot {
  position: relative; aspect-ratio: 0.9; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(#6b2fa8, #4a1b7c); border: 3px solid #c98a3c; border-radius: 14px;
  box-shadow: inset 0 0 0 2px #2d0f4d, 0 2px 4px rgba(0,0,0,.4);
}
/* Annuler la fabrication : petite croix rouge en haut à droite de l'artisan occupé */
.slot-cancel {
  position: absolute; top: 3px; right: 3px; z-index: 2; width: 20px; height: 20px; padding: 0; display: flex; align-items: center; justify-content: center;
  font-size: 11px; line-height: 1; color: #fff; cursor: pointer; background: linear-gradient(#e0584a, #a8281e); border: 1.5px solid #4a120c; border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .6); opacity: .9;
}
.slot-cancel:hover { opacity: 1; filter: brightness(1.15); }
.slot-cancel:active { transform: translateY(1px); }
.slot.idle { background: var(--panel-2); border: 2px dashed var(--border); box-shadow: none; opacity: .75; }
.slot-icon { font-size: 30px; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; padding-bottom: 14px; box-sizing: border-box; }
.slot-icon img { max-width: 80%; max-height: 80%; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0,0,0,.6)); }
.slot-icon img.ui-ico { height: 70%; max-height: none; }
.slot-time { position: absolute; left: 0; right: 0; bottom: 4px; text-align: center; font-family: var(--font-title); font-size: 15px; color: #fff; text-shadow: 0 1px 0 #000, 0 0 3px #000, 0 0 3px #000; white-space: nowrap; }
.slot .bar { position: absolute; left: 6px; right: 6px; bottom: 2px; height: 4px; margin: 0; }

/* Artisans en colonne verticale collée au bord droit de l'écran (placeSlotsRail : top d'après la barre d'onglets, comme le rail d'expéditions à gauche) */
.slots.rail {
  position: fixed; z-index: 5; display: flex; flex-direction: column; gap: 14px; box-sizing: content-box;
  width: 96px; padding: 10px; max-height: calc(100vh - 140px); overflow-y: auto; scrollbar-width: none;
}
.slots.rail::-webkit-scrollbar { display: none; }
.slots.rail .slot { flex: none; width: 96px; height: 104px; aspect-ratio: auto; }
.slots.rail.two { flex-direction: row; flex-wrap: wrap; align-content: flex-start; width: 206px; } /* 2 colonnes : 2 × 96 px + 14 px */
/* Page trop étroite pour la colonne (ex. 1920 px) : artisans en ligne, sur la même ligne que le bandeau d'expéditions, collés au bord droit de la page */
.slots.rail.row { flex-direction: row; gap: 8px; width: auto; padding: 0; max-height: none; overflow: visible; max-width: calc(100vw - 16px); }
.slots.rail.row .slot { width: 68px; height: 76px; }
/* Fenêtre étroite, hors Échoppe : ligne dans le flux sous les onglets, centrée */
.slots.rail.row.flow { position: static; flex-wrap: wrap; justify-content: center; margin: 0 auto 10px; }

.recipes { display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px; } /* minmax(0) : une carte ne peut pas élargir la colonne */
.recipe {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px; border-radius: 8px; background: rgba(255,255,255,.02);
}
.recipe:hover { background: rgba(255,255,255,.05); }
.recipe.locked { opacity: .7; }
.recipe.locked .r-name { color: var(--muted); }
.unlock-req { color: var(--gold); }
.bar.unlock { max-width: 220px; }
.bar.unlock i { background: var(--gold); }
/* Déblocages lisibles (02/12/2026) : conditions colorées (vert remplie, orange en cours, rouge bloquée), prérequis cliquable,
   pastille « Débloque » sur la recette prérequise. Seuls la tuile et le nom de la carte verrouillée restent atténués. */
.recipe.locked { opacity: 1; }
.recipe.locked .locked-tile, .recipe.locked .r-name { opacity: .7; }
.unlock-req .ur-go, .unlock-req .ur-cat { white-space: nowrap; }
.unlock-req .ur .ui-ico { height: 14px; width: auto; vertical-align: -2px; margin-right: 3px; }
.unlock-req .ur.ok { color: #9be09d; }
.unlock-req .ur.go { color: #f3b04c; }
.unlock-req .ur.ko { color: #ff9c8f; }
.unlock-req .ur-sep { font-style: normal; color: var(--muted); }
.unlock-req .ur-cat { color: var(--muted); }
.unlock-req .ur-go { all: unset; cursor: pointer; color: inherit; font-weight: bold; text-decoration: underline; text-underline-offset: 2px; }
.unlock-req .ur-go:hover, .unlock-req .ur-go:focus-visible { color: #fff3d6; }
.unlock-req .ur-go:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 3px; }
.unlock-req .ur-go img { height: 16px; width: auto; vertical-align: -3px; }
.bar.unlock.go i { background: #f3b04c; }
.bar.unlock.ko i { background: #d9584a; }
.unl-tag { display: inline-flex; flex: none; align-items: center; gap: 4px; padding: 2px 6px; border-radius: 99px; cursor: pointer; white-space: nowrap;
  font: 12px/1 var(--font-text), serif; background: rgba(233, 185, 73, .14); border: 1px solid rgba(233, 185, 73, .6); color: #f5d98a; }
.unl-tag:hover, .unl-tag:focus-visible { background: rgba(233, 185, 73, .28); }
.unl-tag .ui-ico { height: 14px; width: auto; }
.unl-tag b { font: 12px/1 var(--font-title), serif; }
.r-icon { font-size: 22px; width: 28px; text-align: center; }
.r-body { flex: 1; min-width: 0; }
.r-name { font-weight: 600; }
.r-cost { font-size: 14px; color: var(--muted); }
.r-meta { font-size: 13px; color: var(--muted); }
.cost { color: var(--text); white-space: nowrap; }
.cost.comp { color: var(--gold); }
.cost.lack { color: var(--bad); }
.stars { color: var(--gold); font-size: 13px; letter-spacing: 1px; }


/* ---------- Qualités ---------- */
.qchips { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 2px; }
.qchip {
  background: transparent; color: var(--q); border: 1px solid var(--q);
  border-radius: 12px; padding: 1px 8px; font: inherit; font-size: 13px; cursor: pointer; opacity: .6;
}
.qchip.sel { opacity: 1; background: rgba(255,255,255,.06); font-weight: 600; }
.btn.alt { text-align: left; color: var(--text); text-shadow: none; background: var(--panel-2); border: 1px solid var(--q); border-radius: 7px; min-height: 0; }
.btn.alt::before { content: none; }
.btn.alt:disabled { opacity: .4; }
.btn.alt { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; }
.btn.alt .alt-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn.alt .alt-price, .btn.alt .alt-nrg { white-space: nowrap; text-align: right; }

/* ---------- Râteliers ---------- */
.resources { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.res { display: flex; gap: 8px; align-items: center; background: var(--panel-2); border-radius: 8px; padding: 6px 8px; }
.res-icon { font-size: 22px; display: inline-flex; }
/* Image de ressource : hauteur relative au texte environnant */
img.ri { height: 1.25em; width: auto; vertical-align: -0.3em; object-fit: contain; }
.res-icon img.ri { height: 32px; vertical-align: middle; }
/* Image d'objet (img/objets) : même principe, un peu plus grande que le texte */
img.ii { height: 1.5em; width: 1.5em; vertical-align: -0.4em; object-fit: contain; filter: drop-shadow(0 1px 1px rgba(0,0,0,.5)); }
.item-icon img.ii, .slot-icon img.ii, .qobj-icon img.ii { height: 1.3em; width: 1.3em; }
/* Tuile de recette avec l'image de l'objet : fond sombre, cadre à la couleur de la qualité */
.recipe .tile.item-tile { background: radial-gradient(circle at 50% 40%, #4a3a28, #1e1710); }
.tile.item-tile .tile-img.item { object-fit: contain; padding: 4px; box-sizing: border-box; filter: drop-shadow(0 2px 2px rgba(0,0,0,.6)); }
.res-body { flex: 1; }
.res-top { display: flex; justify-content: space-between; font-size: 14px; }
.rack-list { display: grid; gap: 5px; }
.rack { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,.05); }
.rack-group { background: rgba(255,255,255,.02); border: 1px solid rgba(255,255,255,.05); border-radius: 8px; padding: 4px 8px; }
.rack-group-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 2px 0 4px; border-bottom: 1px solid rgba(255,255,255,.06); }
.rack-group .rack { padding-left: 22px; }
.rack-group .rack:last-child { border-bottom: 0; }
.counter-up { flex: 1; min-width: 0; margin-left: 16px; }
.counter-up .rack { align-items: center; }
.counter-up .rack > span { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.counter-up .rack-up { align-self: center; }
.counter-up .rack { border-bottom: 0; padding: 0; }
.rack-up { min-width: 130px; text-align: right; }
.rack-up .bar i { background: var(--gold); }

/* ---------- Stock ---------- */
/* Grille qui remplit toute la largeur : les cases s'étirent un peu pour que la dernière colonne touche le bord droit
   (même bord que les boutons « Coffres & plans / Salle des trésors / Roulette » en dessous) */
.inventory { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.inventory > .empty { grid-column: 1 / -1; } /* message « aucun objet » sur toute la largeur (en japonais, il tenait dans une case de 52 px) */
.item {
  position: relative; width: auto; aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel-2); border: 2px solid var(--q, var(--border)); border-radius: 8px;
}
/* Objet réclamé par un client : une pastille, jamais un anneau de couleur (le cadre ne dit que la qualité) */
.item-want { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; object-fit: contain; pointer-events: none; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .7)); }
.inventory .item { cursor: pointer; transition: transform .12s, filter .12s; }
.inventory .item:hover { transform: translateY(-2px); filter: brightness(1.15); }
.item.locked { background: linear-gradient(rgba(240, 190, 80, .16), rgba(0, 0, 0, .25)), var(--panel-2); }
.item-lock { position: absolute; top: -6px; left: -6px; width: 20px; height: 20px; object-fit: contain; pointer-events: none; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .7)); }
.item-icon { font-size: 26px; }
.item-qty {
  position: absolute; bottom: -4px; right: -4px;
  background: var(--accent); color: #1d1209; font-weight: 700; font-size: 13px;
  border-radius: 10px; padding: 0 6px;
}
.stats { font-size: 14px; margin: 12px 0 0; }

/* ---------- Notifications ---------- */
/* Messages d'erreur seulement, en bas de l'écran (au-dessus du bandeau « nouvelle version » quand il est affiché) */
.toasts { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 24px); z-index: 2001; pointer-events: none; }
body:has(.update-banner:not([hidden])) .toasts { bottom: 110px; }
.toasts .toast:not(:last-child) { display: none; } /* seule la plus récente est affichée */
.toast {
  min-height: 44px; box-sizing: border-box; display: flex; align-items: center; justify-content: center;
  background: #15100c; border: 1px solid var(--border); border-left: 4px solid var(--accent);
  padding: 2px 12px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,.4);
  font-size: 14px; line-height: 1.2; overflow: hidden;
  animation: arrive .25s ease-out; transition: opacity .4s;
}
.toast.good { border-left-color: var(--good); }
.toast.bad { border-left-color: var(--bad); }
.toast.level { border-left-color: var(--gold); }
.toast.out { opacity: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .grid { grid-template-columns: 1fr; grid-template-rows: none;
    grid-template-areas: "counter" "quests" "stock" "racks" "dungeons" "heroes" "city"; padding: 10px 16px; }
  h1 { font-size: 17px; }
}

/* ---------- Donjons & équipement ---------- */
.dungeons-panel { grid-area: dungeons; }
#expeditions:not(:empty) { margin-bottom: 10px; }
.zone, .expedition {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px;
}
.expedition { border-color: var(--accent); }
.zone.locked { opacity: .6; }
.zone.locked .z-img img { filter: grayscale(1); }
.zone.boss { border-color: var(--bad, #c0504d); }
.z-boss { color: var(--bad, #e07060); font-weight: 600; }
.z-img { position: relative; flex: 0 0 96px; width: 96px; height: 84px; display: flex; align-items: center; justify-content: center; }
.z-img img { max-width: 96px; max-height: 84px; object-fit: contain; }
.z-icon { flex: 0 0 40px; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; }
.z-icon img { max-width: 40px; max-height: 40px; object-fit: contain; }
.zone .b-body small { display: block; }
.zone .b-body { align-self: stretch; }
.zone .b-actions { margin-top: auto; padding-top: 4px; }
/* ---------- Fenêtre « Choisir les héros » d'une expédition (partyDialogHtml, maquette docs/maquette_equipes_donjon.html) : style de la
   fiche du héros (fond crème sans contour, bannière, onglets, bande jaune). Taille fixe : seules la liste des héros et le
   récapitulatif défilent. De haut en bas : en-tête, « Mes équipes », barre d'actions, héros | chef / talents, pied. ---------- */
.party-back { position: fixed; inset: 0; z-index: 900; background: rgba(0, 0, 0, .65); }
.party { position: fixed; z-index: 901; box-sizing: border-box; width: min(1700px, calc(100vw - 32px)); height: min(1000px, calc(100dvh / var(--page-zoom, 1) - 32px));
  display: flex; flex-direction: column; gap: 10px; padding: 22px; overflow: hidden auto; container: pty / inline-size;
  font-size: 16px; color: #3a2412; background: #fdeecc; border-radius: 18px; box-shadow: 0 10px 40px rgba(0, 0, 0, .6); }
.pty-head { flex: none; display: flex; align-items: center; gap: 16px; }
.pty-ban { flex: 0 1 50%; min-width: 0; height: 74px; box-sizing: border-box; display: flex; align-items: center; gap: 16px; padding: 6px 18px 6px 12px; border-radius: 12px; background: #1f5440; color: #fff; }
.pty-ban > img { flex: none; width: 70px; height: 60px; object-fit: contain; }
.pty-ban > i { flex: none; width: 2px; align-self: stretch; margin: 6px 0; background: rgba(200, 240, 215, .4); border-radius: 1px; }
.pty-ban > div { min-width: 0; display: flex; flex-direction: column; }
.pty-ban h2 { margin: 0; font: 400 28px/1.15 var(--font-title); color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .35); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pty-ban small { display: flex; align-items: center; gap: 10px; font: 17px/1.3 var(--font-title); color: #cdead9; white-space: nowrap; overflow: hidden; }
.pty-boss { display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; border-radius: 8px; background: #7d1214; color: #fff; }
.pty-boss .ui-ico { height: 18px; width: auto; margin: 0; }
.pty-head .pg2-bar { flex: 1 1 auto; height: 30px; margin: 0; }
.pty-head .pg2-bar i.ko { background: linear-gradient(#f08a6a, #c23b28); }
.pty-head .pg2-bar > span { gap: 8px; }
.pty-head .pg2-bar img.ui-ico { height: 20px; margin: 0; }
.pty-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0; font: 400 21px/1.1 var(--font-title); color: #3a2412; text-transform: none; letter-spacing: 0; }
.pty-title small { font: 15px var(--font-text); color: #7a5a38; }
/* « Mes équipes » : boutons Set 1 / Set 2, même aspect que les cartes d'équipe (actif = jaune) */
.pty-tm-head { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.pty-sets { flex: none; display: flex; gap: 9px; } /* 9 px : au moins 8 à l'écran avec le zoom de page de 90 % */
.pty-set { box-sizing: border-box; display: flex; align-items: center; justify-content: center; min-width: 84px; height: 30px; padding: 0 14px; border: 0; border-radius: 10px; background: rgba(214, 190, 140, .34); font: 17px/1 var(--font-title); color: #3a2412; cursor: pointer; }
.pty-set:hover { filter: brightness(1.04); }
.pty-set.on { background: #f7dc97; box-shadow: inset 0 0 0 2px #e9b949; }
.pty-set:focus-visible { outline: 2px solid #7a4a12; outline-offset: -4px; }
/* Ensembles : libellé long « Ensemble n » (.ps-l) ou court « n » (.ps-n). Court dans les fenêtres dès 4 ensembles (.many),
   et sur la page Héros quand la largeur manque ; jamais de retour à la ligne dans un bouton */
.pty-set { white-space: nowrap; }
.pty-set .ps-n { display: none; }
.pty-sets.many .pty-set:not(.hero-set-ar) { min-width: 44px; padding: 0 12px; }
.pty-sets.many .ps-l { display: none; }
.pty-sets.many .ps-n { display: inline; font-variant-numeric: tabular-nums; }
.hero-sets > .pty-sets.many .pty-set:not(.hero-set-ar) { min-width: 84px; padding: 0 14px; }
.hero-sets > .pty-sets.many .ps-l { display: inline; }
.hero-sets > .pty-sets.many .ps-n { display: none; }
/* Téléphone : la rangée prend toute la largeur, les numéros se la partagent (une seule ligne jusqu'à 6 ensembles + Arène) */
html.tel .hero-sets > .pty-sets.many { flex: 1 1 100%; min-width: 0; }
html.tel .hero-sets > .pty-sets.many .pty-set:not(.hero-set-ar) { flex: 1 1 0; min-width: 0; padding: 0 4px; }
html.tel .hero-sets > .pty-sets.many .hero-set-ar { flex: none; min-width: 0; padding: 0 12px; }
html.tel .hero-sets > .pty-sets.many .ps-l { display: none; }
html.tel .hero-sets > .pty-sets.many .ps-n { display: inline; }
@media (max-width: 1100px) {
  .hero-sets > .pty-sets.many .pty-set:not(.hero-set-ar) { min-width: 44px; padding: 0 12px; }
  .hero-sets > .pty-sets.many .ps-l { display: none; }
  .hero-sets > .pty-sets.many .ps-n { display: inline; }
}
.pty-count { min-width: 40px; text-align: center; font-variant-numeric: tabular-nums; }
/* Ensembles d'équipement : onglet Héros (fond sombre) et fiche du héros */
.hero-sets { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 9px 14px; margin: 0 0 12px; }
.hero-sets > b { font: 400 18px/1.1 var(--font-title); color: var(--text); }
.hero-sets > small { flex: 1 1 260px; min-width: 0; font-size: 16px; color: var(--muted); }
.hero-sets .hero-set-fill { flex: none; width: 250px; margin-left: auto; }
.hero-all { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.hero-all > b { font: 400 16px/1.1 var(--font-title); color: var(--text); }
.hero-all .btn { white-space: nowrap; }
.hero-all .shield-ico { width: 1.3em; height: 1.3em; vertical-align: -0.3em; }
/* « Tout déséquiper » : petit bouton rouge (danger), un peu à l'écart des deux boutons d'équipement */
.hero-all .hero-strip { margin-left: 8px; }
#strip-dialog { width: min(480px, calc(100vw - 32px)); max-height: calc(100vh - 32px); box-sizing: border-box; padding: 20px; border: 0; border-radius: 18px; background: #f4e7c8; color: #3a2410; text-align: center; }
#strip-dialog::backdrop { background: rgba(0, 0, 0, .6); }
#strip-dialog h2 { margin: 0; font-size: 20px; }
#strip-dialog ul { margin: 14px 0 18px; padding: 0 0 0 20px; display: flex; flex-direction: column; gap: 8px; text-align: left; font-size: 16px; }
html.dark-win #strip-dialog { background: var(--dw-bg); color: var(--dw-ink); color-scheme: dark; }
.hero-prio { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.hero-prio > span[role] { flex: 1 1 260px; min-width: 0; font-size: 16px; color: var(--muted); }
.hero-grp { --op-on: #3fae6a; --op-off: #6b5236; --op-knob: #f1e6d4; --op-accent: #e9b949; flex: none; display: flex; align-items: center; gap: 9px; margin-right: 8px; font-size: 16px; line-height: 1.1; color: var(--text); }
.hero-grp .op-sw { flex: none; }
.hero-grp > b { font: 400 16px/1.1 var(--font-title); }
.hrow .hr-name b img.hr-cls { width: 21px; height: 21px; object-fit: contain; margin: 0 0 0 7px; vertical-align: top; }
/* Couronne : chef d'une équipe enregistrée (heroChiefIco), après le nom, sans changer la hauteur de la ligne */
.hrow .hr-name b img.hr-chief { width: 20px; height: 20px; object-fit: contain; margin: 0 0 0 8px; vertical-align: top; }
.hs-id b img.hr-chief { width: .8em; height: .8em; object-fit: contain; margin-left: 10px; vertical-align: .05em; }
#heroes .pty-set { background: #4a3721; color: #f3e3c4; }
#heroes .pty-set.on { background: #f7dc97; color: #3a2412; }
.hs-sets { display: flex; justify-content: center; margin-top: 10px; }
/* Équipes enregistrées : une carte par emplacement */
.pty-teams { flex: none; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 320px)); gap: 10px; } /* 320 px au plus : peu d'équipes = cartes de taille raisonnable */
.pty-team { box-sizing: border-box; height: 118px; min-width: 0; display: grid; grid-template: 24px 40px 22px / minmax(0, 1fr); align-content: center; justify-items: center; gap: 8px; padding: 8px 10px;
  border: 0; border-radius: 12px; background: rgba(214, 190, 140, .34); font: inherit; color: inherit; text-align: center; cursor: pointer; }
.pty-team:hover:not(:disabled) { filter: brightness(1.04); }
.pty-team:disabled { cursor: default; }
.pty-team.on { background: #f7dc97; box-shadow: inset 0 0 0 3px #e9b949; }
.pty-team.target { box-shadow: inset 0 0 0 3px #2fa86f; }
.pty-team > b { max-width: 100%; font: 400 19px/24px var(--font-title); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pty-faces { width: 100%; min-width: 0; display: flex; justify-content: center; gap: 2px; }
.pty-face { position: relative; flex: 0 1 38px; min-width: 0; height: 40px; display: flex; align-items: center; justify-content: center; }
.pty-face img.av { width: 100%; height: 100%; object-fit: contain; }
.pty-face.away img.av { filter: grayscale(1) opacity(.45); }
.pty-face.away::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 17px; height: 17px; background: url("../img/ui/temps.png") center / contain no-repeat; }
.pty-meta { max-width: 100%; display: flex; justify-content: center; align-items: center; gap: 6px; overflow: hidden; font-size: 15px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pty-meta img.ui-ico { height: 20px; width: auto; margin: 0; }
.pty-meta .ok { color: #27692f; }
.pty-meta .ko { color: #a82a1c; }
.pty-meta .warn { color: #7d500c; }
.pty-meta .warn::before { content: "· "; }
.pty-team.vide { grid-template-rows: auto auto; background: rgba(214, 190, 140, .18); color: #7a5a38; }
.pty-team.vide > b { font: 700 34px/34px var(--font-text); } /* Trans800 n'a pas de « + » lisible */
.pty-team.vide > span { font-size: 15px; line-height: 1.2; }
/* Une équipe par emplacement d'expédition (1 à 9) : une seule ligne tant que chaque carte garde 165 px (largeur de contenu = n × 175 − 10),
   sinon deux lignes équilibrées (--n2 = moitié arrondie au-dessus) de cartes compactes : nom et puissance sur une ligne, visages dessous. La hauteur ne dépend que du nombre d'emplacements : fixe d'un onglet ou d'un mode à l'autre. */
@container pty (max-width: 1564px) {
  .pty-teams[data-n="9"] { grid-template-columns: repeat(var(--n2), minmax(0, 320px)); }
  .pty-teams[data-n="9"] .pty-team { height: 88px; }
  .pty-teams[data-n="9"] .pty-team:not(.vide) { grid-template: "nom pui" 24px "vis vis" 40px / minmax(0, 1fr) auto; justify-items: stretch; gap: 8px 10px; padding: 8px 12px; }
  .pty-teams[data-n="9"] .pty-team:not(.vide) > b { grid-area: nom; text-align: left; }
  .pty-teams[data-n="9"] .pty-team:not(.vide) .pty-faces { grid-area: vis; height: 40px; justify-content: flex-start; }
  .pty-teams[data-n="9"] .pty-team:not(.vide) .pty-meta { grid-area: pui; flex-wrap: nowrap; }
  .pty-teams[data-n="9"] .pty-meta .warn { display: none; } /* absents : visages grisés avec horloge, le nom garde sa place */
  .pty-teams[data-n="9"] .pty-team:not(.vide) .pty-face { height: 40px; flex-basis: 38px; }
}
@container pty (max-width: 1389px) {
  .pty-teams[data-n="8"] { grid-template-columns: repeat(var(--n2), minmax(0, 320px)); }
  .pty-teams[data-n="8"] .pty-team { height: 88px; }
  .pty-teams[data-n="8"] .pty-team:not(.vide) { grid-template: "nom pui" 24px "vis vis" 40px / minmax(0, 1fr) auto; justify-items: stretch; gap: 8px 10px; padding: 8px 12px; }
  .pty-teams[data-n="8"] .pty-team:not(.vide) > b { grid-area: nom; text-align: left; }
  .pty-teams[data-n="8"] .pty-team:not(.vide) .pty-faces { grid-area: vis; height: 40px; justify-content: flex-start; }
  .pty-teams[data-n="8"] .pty-team:not(.vide) .pty-meta { grid-area: pui; flex-wrap: nowrap; }
  .pty-teams[data-n="8"] .pty-meta .warn { display: none; } /* absents : visages grisés avec horloge, le nom garde sa place */
  .pty-teams[data-n="8"] .pty-team:not(.vide) .pty-face { height: 40px; flex-basis: 38px; }
}
@container pty (max-width: 1214px) {
  .pty-teams[data-n="7"] { grid-template-columns: repeat(var(--n2), minmax(0, 320px)); }
  .pty-teams[data-n="7"] .pty-team { height: 88px; }
  .pty-teams[data-n="7"] .pty-team:not(.vide) { grid-template: "nom pui" 24px "vis vis" 40px / minmax(0, 1fr) auto; justify-items: stretch; gap: 8px 10px; padding: 8px 12px; }
  .pty-teams[data-n="7"] .pty-team:not(.vide) > b { grid-area: nom; text-align: left; }
  .pty-teams[data-n="7"] .pty-team:not(.vide) .pty-faces { grid-area: vis; height: 40px; justify-content: flex-start; }
  .pty-teams[data-n="7"] .pty-team:not(.vide) .pty-meta { grid-area: pui; flex-wrap: nowrap; }
  .pty-teams[data-n="7"] .pty-meta .warn { display: none; } /* absents : visages grisés avec horloge, le nom garde sa place */
  .pty-teams[data-n="7"] .pty-team:not(.vide) .pty-face { height: 40px; flex-basis: 38px; }
}
@container pty (max-width: 1039px) {
  .pty-teams[data-n="6"] { grid-template-columns: repeat(var(--n2), minmax(0, 320px)); }
  .pty-teams[data-n="6"] .pty-team { height: 88px; }
  .pty-teams[data-n="6"] .pty-team:not(.vide) { grid-template: "nom pui" 24px "vis vis" 40px / minmax(0, 1fr) auto; justify-items: stretch; gap: 8px 10px; padding: 8px 12px; }
  .pty-teams[data-n="6"] .pty-team:not(.vide) > b { grid-area: nom; text-align: left; }
  .pty-teams[data-n="6"] .pty-team:not(.vide) .pty-faces { grid-area: vis; height: 40px; justify-content: flex-start; }
  .pty-teams[data-n="6"] .pty-team:not(.vide) .pty-meta { grid-area: pui; flex-wrap: nowrap; }
  .pty-teams[data-n="6"] .pty-meta .warn { display: none; } /* absents : visages grisés avec horloge, le nom garde sa place */
  .pty-teams[data-n="6"] .pty-team:not(.vide) .pty-face { height: 40px; flex-basis: 38px; }
}
.pty-teams[data-n="7"] .pty-team, .pty-teams[data-n="8"] .pty-team, .pty-teams[data-n="9"] .pty-team { padding: 8px 6px; }
/* Barre d'actions des équipes : hauteur fixe */
.pty-bar { flex: none; box-sizing: border-box; height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 8px 0 14px; border-radius: 12px; background: rgba(214, 190, 140, .28); }
.pty-msg { flex: 1; min-width: 0; max-height: 40px; overflow: hidden; line-height: 20px; }
.pty-msg em { font-style: normal; color: #8a5a10; }
.pty-bar input { box-sizing: border-box; flex: 0 1 260px; min-width: 120px; height: 36px; padding: 0 12px; border: 2px solid #cdb383; border-radius: 9px; background: #fff8e6; color: #3a2412; font: 17px var(--font-text); }
.pty-bar input:focus-visible { outline: 2px solid #e9b949; outline-offset: 1px; }
.party .btn.act { flex: none; display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 3px 18px 6px; font: 17px/1.1 var(--font-title); color: #3a2412; text-shadow: none; white-space: nowrap; }
.party .btn.act:not(.danger):not(:disabled)::before { border-width: 15px 16px 16px; border-image: url("../img/fiche/bouton_jaune.webp") 30 32 32 32 fill / 15px 16px 16px stretch; }
.party .btn.act.danger { color: #fff; }
.party .btn.act:disabled { color: #5a5048; }
/* Corps : héros à gauche, chef / talents à droite */
.pty-body { flex: 1 1 0; min-height: 190px; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr) 320px; gap: 16px; }
.pty-list, .pty-sum { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.pty-grid { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); grid-auto-rows: 154px; align-content: start; gap: 10px; padding-right: 6px; }
.pty-cell { position: relative; min-width: 0; }
/* Carte : portrait, nom, niveau · puissance, compétence de chef (ou retour d'expédition) aux mêmes emplacements */
.pty-card { position: relative; box-sizing: border-box; width: 100%; height: 100%; display: grid; grid-template: 72px 22px 22px 22px / minmax(0, 1fr); justify-items: center; align-content: center; align-items: center; gap: 3px; padding: 6px;
  border: 0; border-radius: 12px; background: rgba(214, 190, 140, .28); font: inherit; color: inherit; text-align: center; cursor: pointer; }
.pty-card:hover:not(:disabled) { filter: brightness(1.04); }
.pty-card.sel { background: #f7dc97; box-shadow: inset 0 0 0 3px #e9b949; }
.pty-card:disabled { cursor: default; }
.pty-card:focus-visible, .pty-team:focus-visible { outline: 2px solid #7a4a12; outline-offset: -5px; }
.pty-av { display: flex; align-items: flex-end; justify-content: center; height: 72px; }
.pty-av img.av { width: 72px; height: 72px; object-fit: contain; }
.pty-card:disabled .pty-av img.av { filter: grayscale(1) opacity(.45); }
.pty-name { max-width: 100%; font: 400 18px/22px var(--font-title); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pty-stats, .pty-skill, .pty-gone { display: flex; align-items: center; justify-content: center; gap: 5px; max-width: 100%; min-width: 0; overflow: hidden; white-space: nowrap; font-size: 15px; font-variant-numeric: tabular-nums; }
.pty-stats img.ui-ico, .pty-gone img.ui-ico { height: 18px; width: auto; margin: 0; }
.pty-stats { gap: 4px; font-size: 14px; } /* niveau, icône et un montant en milliards tiennent dans une carte de 140 px */
.pty-skill { font-size: 14px; color: #7d500c; }
.pty-gone { color: #7a5a38; }
.pty-skill .ui-ico.crown { height: 18px; width: auto; flex: none; margin: 0; }
.pty-sk-name { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Coin haut gauche : sexe puis classe du héros (infobulle sur chaque icône), emplacements fixes */
.pty-marks { position: absolute; top: 8px; left: 8px; z-index: 1; display: grid; grid-template-rows: 18px 18px; gap: 4px; pointer-events: none; }
.pty-marks img.ui-ico { grid-row: 2; width: 18px; height: 18px; margin: 0; object-fit: contain; pointer-events: auto; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .35)); }
.pty-marks img.pty-sex { grid-row: 1; }
.pty-card:disabled .pty-marks img.ui-ico { opacity: .55; }
.pty-badge { position: absolute; top: 6px; right: 6px; padding: 1px 8px 2px; border-radius: 8px; font: 14px/1.3 var(--font-title); color: #fff; background: #7d1214; }
/* Infobulle de la compétence de chef : au survol de la compétence et au focus clavier de la carte (dans la carte : jamais coupée) */
.pty-tip { display: none; position: absolute; left: 4px; right: 4px; bottom: 32px; z-index: 3; flex-direction: column; gap: 4px; max-height: 118px; overflow: hidden;
  padding: 8px 10px; border-radius: 8px; background: #3a2412; color: #fdeecc; box-shadow: 0 6px 18px rgba(0, 0, 0, .45); font-size: 14px; line-height: 1.25; text-align: left; pointer-events: none; }
.pty-tip small { font-size: 12px; color: #d9c497; }
.pty-tip b { color: #ffd34a; }
.pty-cell:has(.pty-skill:hover) .pty-tip, .pty-card:focus-visible + .pty-tip { display: flex; }
/* Équipement par-dessus « Choisir les héros » (#pty-eq, renderPartyEq) : taille fixe, tuiles de la fiche du héros sur 4 colonnes */
#pty-eq { position: relative; z-index: 950; } /* devant .party (901), sous les messages (2001) */
.peq { position: fixed; z-index: 1; box-sizing: border-box; width: min(460px, calc(100vw / var(--page-zoom, 1) - 18px)); max-height: calc(100dvh / var(--page-zoom, 1) - 18px); overflow: auto;
  display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: 18px; background: #fdeecc; color: #3a2412; font-size: 16px; box-shadow: 0 10px 34px rgba(0, 0, 0, .6); }
.peq-head { flex: none; display: grid; grid-template-columns: 52px minmax(0, 1fr) auto 40px; align-items: center; gap: 10px; }
.peq-av img.av { display: block; width: 52px; height: 52px; object-fit: contain; }
.peq-name { font: 400 22px/1.2 var(--font-title); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.peq-head .hs-pow b { font-size: 24px; -webkit-text-stroke-width: 4px; }
.peq-head .hs-pow b img { height: 30px; }
.peq-head .hs-close { width: 40px; height: 40px; }
.peq .hs-slots { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 14px; padding-top: 9px; }
.peq .hs-under { min-height: 60px; } /* même hauteur pleine ou vide : taille fixe */
.peq .hs-pw { font-size: 20px; }
.peq-fit { align-self: start; aspect-ratio: 139 / 150; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.peq-fit .flag-ico { width: 20px; height: 24px; }
.peq-fit b { font: 400 20px/1.2 var(--font-title); white-space: nowrap; }
.peq-fit small { font: 15px/1.2 var(--font-title); }
.peq-fit.on { color: #2f7a3b; }
.peq-foot { flex: none; display: grid; gap: 10px; }
.peq-foot .pty-sets { justify-content: center; }
.peq-btns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.peq-btns .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 4px 10px 7px; font: 18px/1.1 var(--font-title); color: #3a2412; text-shadow: none; white-space: nowrap; }
.peq-btns .btn::before { border-width: 15px 16px 16px; border-image: url("../img/fiche/bouton_jaune.webp") 30 32 32 32 fill / 15px 16px 16px stretch; }
.peq-btns .btn img.ui-ico, .peq-btns .btn img.shield-ico { flex: none; height: 22px; width: auto; margin: 0; vertical-align: 0; }
html.dark-win .peq { background: #3f3022; color: var(--dw-ink); color-scheme: dark; }
html.dark-win .peq-fit.on { color: var(--dw-ok); }
/* Récapitulatif : chef ou talents du groupe */
.hs-tabs.pty-tabs { flex: none; grid-template-columns: repeat(2, minmax(0, 1fr)); } /* deux classes : passe devant .hs-tabs (3 colonnes), défini plus bas */
.pty-panes { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.pty-lead { display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: center; gap: 12px; }
.pty-av.none { box-sizing: border-box; width: 64px; height: 64px; margin: 4px; border: 2px dashed #cdb383; border-radius: 50%; }
.pty-lead b { display: block; font: 400 22px/1.2 var(--font-title); overflow-wrap: anywhere; }
.pty-lead div > span { color: #7a5a38; }
.pty-line { flex: none; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 4px 8px; padding: 8px 10px; border-radius: 10px; background: rgba(214, 190, 140, .28); }
.pty-line > .ui-ico, .pty-tk-ico img { height: 22px; width: auto; margin: 0; justify-self: center; }
.pty-tk-ico { display: flex; align-items: center; justify-content: center; }
.pty-line b { min-width: 0; overflow-wrap: anywhere; }
.pty-line small { color: #7a5a38; font-size: 14px; text-align: right; }
.pty-line p { grid-column: 2 / -1; margin: 0; font-size: 15px; color: #5a3a1b; }
.pty-line.pet .pty-tk-ico { grid-row: span 2; align-self: center; }
.pty-line.pet .pty-tk-ico img { width: 28px; height: 28px; object-fit: contain; }
.pty-line.pet b { color: var(--q); font: 400 18px/1.2 var(--font-title), serif; letter-spacing: .02em; -webkit-text-stroke: 3px #4a2e14; paint-order: stroke fill; } /* comme .pet-card .pet-name : couleur de rareté lisible sur le crème */
.pty-muted { margin: 0; color: #7a5a38; }
/* Places du groupe (partySlotsHtml) : pastilles, puis une ligne par source de place */
.pty-slots { flex: none; display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 10px; background: rgba(214, 190, 140, .28); }
.pty-slots-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 4px; font: 400 18px/1.2 var(--font-title); }
.pty-pips { display: flex; gap: 6px; }
.pty-pips i { box-sizing: border-box; width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.pty-pips .took { background: #2f7a4f; border: 2px solid #1f5440; }
.pty-pips .free { border: 2px solid #2f7a4f; background: #fff8e6; }
.pty-pips .lock { border: 2px dashed #b9a079; }
.pty-pips .lock img { height: 12px; width: auto; margin: 0; opacity: .7; }
.pty-slot { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 8px; color: #6f5230; }
.pty-slot.on { color: #3b2410; }
.pty-slot img { height: 18px; width: auto; margin: 0; justify-self: center; }
.pty-slot:not(.on) img { opacity: .6; }
.pty-slot b { text-align: right; font-weight: 400; }
.pty-slots p { margin: 4px 0 0; font-size: 15px; color: #5a3a1b; }
/* Pied : bande jaune */
.pty-foot { flex: none; box-sizing: border-box; min-height: 76px; display: flex; align-items: center; gap: 18px; padding: 8px 18px; border-radius: 14px; background: #f7dc97; }
.pty-foot .hs-pow > img { height: 30px; width: auto; margin: 0; }
.pty-why { flex: 1; min-width: 0; text-align: right; line-height: 1.25; color: #a82a1c; }
.pty-why.ok { color: #27692f; }
.pty-why.risk { color: #934a00; font-weight: 700; } /* départ possible mais défaite possible (boss sous la puissance recommandée) */
/* Message à gauche, pastilles (réussite, bonus de groupe, explorations) collées au bouton Partir */
.pty-why { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.pty-txt { flex: 1 1 140px; min-width: 0; } /* le message passe à la ligne avant les pastilles */
.pty-sure { display: block; font-weight: 400; line-height: 1.2; }
.pty-sure b { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.pty-sure .ui-ico { width: 20px; height: 20px; margin: 0; }
.pty-chip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; box-sizing: border-box; padding: 0 14px 0 8px; border-radius: 18px; font-size: 16px; font-weight: 700; line-height: 1; white-space: nowrap; cursor: help; color: #fff; box-shadow: inset 0 -2px 0 rgba(0,0,0,.18); }
.pty-chip > img { width: 26px; height: 26px; margin: 0; }
.pty-chip.bonus { background: #2d62a8; }
.pty-chip.risk { background: #c86a12; }
.pty-chip.risk.low { background: #b0322a; }
.pty-chip.explo { background: #ecd08c; color: #5a3a18; box-shadow: inset 0 0 0 2px #c9a35a; }
/* Pied serré : d'abord sans « Puissance » / « Durée », puis pastilles réduites à leur valeur (libellé dans l'infobulle) */
@container pty (max-width: 1270px) { .pty-foot .hs-pow small { display: none; } }
@container pty (max-width: 1130px) { .pty-chip .pty-lbl { display: none; } }
html.dark-win .pty-chip.explo { background: #4a3a22; color: #f3dfb0; box-shadow: inset 0 0 0 2px #7a6038; }
.party .btn.pty-go { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 220px; min-height: 54px; font: 24px/1 var(--font-title); }
@media (max-height: 800px) {
  .party { gap: 9px; padding: 14px; } /* 9 px : au moins 8 à l'écran avec le zoom de page de 90 % */
  .pty-team { height: 100px; gap: 4px; }
  .pty-foot { min-height: 64px; }
  .party .btn.pty-go { min-height: 48px; }
}
/* Grande fenêtre (1920 × 1080 et au-delà) : 9 héros par ligne, les 25 tiennent sans défiler */
@container pty (min-width: 1500px) {
  .pty-body { grid-template-columns: minmax(0, 1fr) 300px; }
  .pty-grid { grid-template-columns: repeat(auto-fill, minmax(134px, 1fr)); scrollbar-gutter: stable; } /* place de la barre toujours comptée : 9 colonnes qu'elle soit là ou non */
  .pty-card { padding: 6px 1px; }
}
@media (min-height: 900px) {
  @container pty (min-width: 1500px) {
    .pty-team { height: 124px; grid-template-rows: 24px 46px 22px; }
    .pty-faces, .pty-face { height: 46px; }
    .pty-face { flex-basis: 46px; }
  }
}
@container pty (max-width: 960px) {
  .pty-body { grid-template-columns: minmax(0, 1fr) 260px; }
  .pty-team { height: 134px; grid-template-rows: 24px 40px 38px; gap: 6px; }
  .pty-meta { flex-wrap: wrap; align-content: center; gap: 0 6px; line-height: 19px; } /* carte étroite : les absents passent à la ligne */
  .pty-meta .warn::before { content: none; }
  .pty-foot { gap: 12px; padding: 8px 12px; }
  .pty-foot .hs-pow small { display: none; }
  .pty-foot .hs-pow b { font-size: 24px; }
  .party .btn.pty-go { width: 150px; }
  .pty-bar { height: 96px; flex-wrap: wrap; align-content: center; gap: 6px 10px; }
  .pty-msg { flex-basis: 100%; }
}
/* Fenêtre étroite : une colonne, la fenêtre entière défile */
@container pty (max-width: 640px) {
  .pty-ban { flex: 1 1 0; }
  .pty-head .pg2-bar { display: none; }
  .pty-teams[data-n] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pty-body { flex: none; grid-template: auto auto / minmax(0, 1fr); }
  .pty-grid { flex: none; max-height: 340px; }
  .pty-foot { flex-wrap: wrap; }
  .pty-why { flex-basis: 100%; text-align: center; justify-content: center; }
  .party .btn.pty-go { width: 100%; }
}
.pchip {
  background: transparent; color: var(--text); border: 1px solid var(--border); border-radius: 12px;
  padding: 2px 8px; font: inherit; font-size: 14px; cursor: pointer;
}
.pchip.sel { border-color: var(--good); background: rgba(111,191,115,.15); }
.party-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; }
.ok { color: var(--good); } .mid { color: var(--gold); } .ko { color: var(--bad); }
.hero-stats { display: flex; justify-content: space-between; font-size: 14px; }
.bar.hxp { position: relative; height: 18px; border-radius: 9px; margin: 6px 0 8px; border: 1px solid rgba(255,255,255,.12); }
.bar.hxp i { background: linear-gradient(#5aa0e8, #2f6fc0); }
.bar.hxp span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #fff; text-shadow: 0 1px 2px #000, 0 0 3px #000; pointer-events: none; }
.equip {
  background: rgba(0,0,0,.2); color: var(--text); border: 1px solid var(--q); border-radius: 5px;
  padding: 0 5px; font: inherit; font-size: 15px; cursor: pointer;
}
.equip small { color: var(--q); }
.away { color: var(--accent); font-size: 14px; font-weight: 600; }
.cost.mat { color: #c792ea; }
.mats { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 12px; margin-bottom: 6px; }
.mat-chip { display: flex; align-items: center; justify-content: space-between; gap: 6px; background: rgba(199,146,234,.12); border: 1px solid rgba(199,146,234,.4); border-radius: 12px; padding: 2px 8px; font-size: 14px; }
.mat-chip .mc-name { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.mat-chip img.ri { height: 1.5em; width: 1.5em; vertical-align: middle; flex: none; object-fit: contain; }

/* ---------- Progression des objets ---------- */
.pips { display: inline-flex; gap: 2px; margin-left: 4px; vertical-align: middle; cursor: help; }
.pip { font-size: 12px; width: 19px; height: 19px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 1px solid var(--border); filter: grayscale(1); opacity: .45; }
.pip.on { filter: none; opacity: 1; border-color: var(--gold); background: rgba(233,185,73,.15); }
.prog { display: flex; align-items: center; gap: 8px; margin-top: 4px; cursor: help; }
.prog-bar { position: relative; flex: 1; height: 22px; border-radius: 11px; overflow: hidden;
  background: #140f0a; border: 2px solid #4a2f18; box-shadow: inset 0 2px 4px rgba(0,0,0,.7); }
.prog-bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(#f3cf6a, #d49a2a); border-radius: 9px; }
.prog.done { justify-content: center; }
.mastered { position: relative; display: inline-block; margin-left: 8px; vertical-align: middle; cursor: help; font-family: var(--font-title); text-transform: uppercase; font-size: 17px; line-height: 1; letter-spacing: 1px;
  color: #7a2a05; -webkit-text-stroke: 4px #7a2a05; filter: drop-shadow(0 2px 0 #3d1402); }
.mastered::after { content: attr(data-t); position: absolute; inset: 0; -webkit-text-stroke: 0;
  background: linear-gradient(#ffe45c 20%, #ff9d00 85%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.prog.done .prog-bar i { background: linear-gradient(#7fd88a, #3fa355); }
.prog-bar span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-title); font-size: 15px; color: #fff; letter-spacing: .5px;
  text-shadow: -1px -1px 0 #2a1808, 1px -1px 0 #2a1808, -1px 1px 0 #2a1808, 1px 1px 0 #2a1808, 0 2px 2px #000; }
.prog-ico { flex: none; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; font-size: 18px;
  border-radius: 50%; border: 3px solid #e0a82e; background: radial-gradient(circle at 35% 30%, #fff1b0, #e9b94d 55%, #b9791c);
  box-shadow: 0 2px 3px rgba(0,0,0,.6), inset 0 -2px 3px rgba(120,60,0,.5); }
.prog.done .prog-ico { border-color: #4fae5e; background: radial-gradient(circle at 35% 30%, #d6ffd9, #6fbf73 55%, #2f7a3a); color: #fff; }
.r-progress { margin-top: 2px; }
.r-progress small { color: var(--gold); font-size: 13px; }
.r-progress.done { font-size: 13px; color: var(--good); }

/* ---------- Thème des icônes de catégories ----------
   Tuiles arrondies colorées par famille, cerclées de doré, avec une icône blanche. */
:root {
  --fam-armes: #d23b33;       --fam-armes-dk: #8f1f1a;
  --fam-armures: #26a3e0;     --fam-armures-dk: #11608f;
  --fam-accessoires: #27a865; --fam-accessoires-dk: #13663b;
  --fam-valeurs: #f0b52d;     --fam-valeurs-dk: #a8700b;
  --tile-ring: #b97a2e;       --tile-ring-lt: #f2c46b;
}
/* Les 4 familles côte à côte, 2 lignes chacune (13 colonnes en tout) ; la taille des tuiles s'adapte à la largeur */
.cat-tabs { display: flex; flex-wrap: wrap; gap: 10px 14px; margin-bottom: 6px; container-type: inline-size; }
.family { display: grid; grid-template-rows: repeat(2, auto); grid-auto-flow: column; gap: 6px; }
/* même écart (6 px) que entre deux tuiles quand les familles tiennent sur une seule rangée ; sinon (colonne étroite) pas de décalage : les rangées restent alignées à gauche */
@container (min-width: 720px) { .family.fam-valeurs { margin-left: -8px; } }
.fam-armes       { --c: var(--fam-armes);       --c-dk: var(--fam-armes-dk); }
.fam-armures     { --c: var(--fam-armures);     --c-dk: var(--fam-armures-dk); }
.fam-accessoires { --c: var(--fam-accessoires); --c-dk: var(--fam-accessoires-dk); }
.fam-valeurs     { --c: var(--fam-valeurs);     --c-dk: var(--fam-valeurs-dk); }

.cat-tab, .tile {
  position: relative; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 46px; height: 46px; border-radius: 14px; padding: 0;
  background: radial-gradient(circle at 50% 30%, var(--c) 0%, var(--c) 55%, var(--c-dk) 100%);
  border: 3px solid var(--tile-ring);
  box-shadow: inset 0 0 0 2px var(--tile-ring-lt), inset 0 -4px 0 rgba(0,0,0,.25), 0 2px 4px rgba(0,0,0,.4);
}
.cat-tab { cursor: pointer; transition: transform .1s, box-shadow .15s; }
.cat-tab:hover { transform: translateY(-2px); }
.cat-tab.sel { box-shadow: inset 0 0 0 2px var(--tile-ring-lt), inset 0 -4px 0 rgba(0,0,0,.25), 0 0 0 3px #fff3, 0 0 12px 2px var(--c); transform: translateY(-2px); }
.cat-tab.locked, .tile.locked-tile { --c: #a39b8f; --c-dk: #6b645a; }
.cat-tab.locked .glyph { opacity: .55; }
/* Icône blanche : l'emoji est transformé en silhouette */
.glyph { font-size: 24px; line-height: 1; filter: brightness(0) invert(1) drop-shadow(0 1px 0 rgba(0,0,0,.35)); }
.cat-title { display: flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font-size: 15px; color: var(--text); margin: 6px 0 8px; }
.tile.small { width: 28px; height: 28px; border-radius: 9px; border-width: 2px; }
.tile.small .glyph { font-size: 16px; }

/* Icônes des recettes agrandies */
.recipe { gap: 12px; padding: 8px; }
.recipe .tile { width: 60px; height: 60px; border-radius: 16px; border-color: var(--qc, var(--tile-ring)); }
.recipe .tile .glyph { font-size: 32px; }
.tile-qty {
  position: absolute; bottom: -6px; right: -6px; background: #fff; color: #2a1f15; font-weight: 700; font-size: 13px;
  border-radius: 10px; padding: 0 6px; border: 2px solid var(--tile-ring);
}
/* Tuiles de catégories : bouton « pilule » de la couleur de la famille (img/boutons/), étiré en carré arrondi
   (les bouts ronds deviennent les coins), + icône de type (img/types/) passée en blanc.
   Rouge = armes, bleu = armures, vert = consommables (accessoires), jaune = accessoires (objets de valeur). */
.cat-btn { position: relative; --cb: url("../img/boutons/red.png"); --cb-down: url("../img/boutons/red_down.png"); }
.cat-btn.fam-armures { --cb: url("../img/boutons/blue.png"); --cb-down: url("../img/boutons/blue_down.png"); }
.cat-btn.fam-accessoires { --cb: url("../img/boutons/green.png"); --cb-down: url("../img/boutons/green_down.png"); }
.cat-btn.fam-valeurs { --cb: url("../img/boutons/yellow.png"); --cb-down: url("../img/boutons/yellow_down.png"); }
.cat-btn::before {
  content: ""; position: absolute; inset: 0; border: 0 solid;
  border-image: var(--cb) 30 38 32 fill / 30% 32% 31% stretch;
}
.cat-btn img {
  position: absolute; left: 22%; top: 19%; width: 56%; height: 56%; object-fit: contain;
  filter: brightness(0) invert(1) drop-shadow(0 1px 1px rgba(0, 0, 0, .45));
}
.cat-tab.sel .cat-btn::before, .cat-tab:active .cat-btn::before { border-image-source: var(--cb-down); }
.cat-tab.sel .cat-btn img { top: 21%; }
.has-img { background: none; border: none; box-shadow: none; border-radius: 28%; }
.tile-img { width: 100%; height: 100%; display: block; pointer-events: none; }
.cat-tab.has-img { width: 36px; height: 36px; /* taille fixe ; les familles passent à la ligne si besoin */ padding: 0; filter: drop-shadow(0 2px 2px rgba(0,0,0,.45)); }
.cat-tab.has-img.sel { box-shadow: none; filter: drop-shadow(0 0 6px var(--gold)) drop-shadow(0 0 2px #fff8); }
.cat-tab.locked .tile-img { filter: grayscale(1) brightness(.75); opacity: .7; }
.tile.small.has-img { width: 32px; height: 32px; }
/* Anneau de qualité minimale autour de la tuile de recette */
.recipe .tile.has-img {
  /* Cadre de qualité : vraie bordure (et non un « outline ») pour que les rayons intérieur et extérieur s'emboîtent proprement aux angles */
  width: 64px; height: 64px; box-sizing: border-box; outline: none;
  border: 3px solid var(--qc); border-radius: 17px;
  box-shadow: 0 0 0 1.5px rgba(0, 0, 0, .55), inset 0 0 0 1.5px rgba(0, 0, 0, .5), inset 0 -5px 8px rgba(0, 0, 0, .3);
}
.recipe .tile.has-img .tile-img.item { border-radius: 13px; }
.recipe.locked .tile { width: 60px; height: 60px; border-radius: 16px; }
.recipe.locked .tile .glyph { font-size: 26px; }

.sub-head { display: flex; justify-content: space-between; align-items: center; }
.sub-head h3 { margin: 14px 0 8px; }

/* ---------- Barre de ressources (toujours visible dans l'en-tête) ---------- */
/* Jamais plus étroite que son contenu (sinon elle débordait sous le niveau et l'or) : faute de place, le bandeau la passe à la ligne.
   .topbar.res-row (fitTopbar, game.js) : ligne à elle seule sous la marque et les boutons, ressources à la ligne si besoin. */
.resbar { flex: 1 1 auto; min-width: max-content; display: flex; flex-wrap: nowrap; justify-content: center; gap: calc(8px / var(--page-zoom, 1)); } /* 8 px à l'écran malgré le zoom de page de 90 % */
.topbar.res-row .resbar { order: 3; flex-basis: 100%; min-width: 0; flex-wrap: wrap; }
.topbar.res-row .hud { margin-left: auto; }
.resbar .res-body { flex: 0 0 auto; min-width: 6.2ch; }
.resbar:empty { display: none; }
.resbar .res {
  flex: 0 0 auto; min-width: 0; padding: 3px 5px; gap: 4px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
}
.resbar .res-icon { font-size: 18px; flex: 0 0 26px; justify-content: center; }
.resbar .res-icon img.ri { height: 24px; }
.resbar .res-top { gap: 8px; align-items: baseline; justify-content: center; text-align: center; white-space: nowrap; font-size: 16px; line-height: 1.15; }
.resbar .res-top span { font-weight: 600; font-variant-numeric: tabular-nums; }
.resbar .bar { margin: 3px 0 0; }
/* Paliers de resserrement (fitTopbar, game.js) : classes cumulées fit1 à fit5, posées seulement si le contenu ne tient pas sur une ligne.
   Au-delà du dernier palier : .res-row, sans resserrement. Chaque palier garde 8 px entre éléments et les montants en 16 px. */
.brand > *, .hud > * { flex: 0 0 auto; white-space: nowrap; }
/* 1 : montants ajustés, barre d'XP et écarts réduits */
.topbar.fit1 .resbar .res { padding: 3px 4px; }
.topbar.fit1 .resbar .res-icon img.ri { max-width: 100%; object-fit: contain; }
.topbar.fit1 .resbar .res-body { min-width: 5ch; }
.topbar.fit1 .hud { gap: calc(8px / var(--page-zoom, 1)); }
.topbar.fit1 .hud-item.level .bar.xp { width: 160px; }
/* 2 : boutons, pastilles et titre resserrés */
.topbar.fit2 .brand { gap: calc(8px / var(--page-zoom, 1)); }
.topbar.fit2 .hud .btn.small { min-width: 42px; padding: 0 8px; }
.topbar.fit2 .hud-item { padding: 4px 10px; }
.topbar.fit2 .lang-cur { padding: 0 7px; }
.topbar.fit2 h1 { font-size: 21px; }
/* 3 : titre réduit à son icône */
.topbar.fit3 h1 { font-size: 0; letter-spacing: 0; }
.topbar.fit3 h1 .brand-ico { height: 28px; vertical-align: middle; }
/* 4 : icônes et boutons au plus court */
.topbar.fit4 .hud .btn.small { min-width: 38px; padding: 0 5px; }
.topbar.fit4 .hud-item { padding: 4px 8px; gap: 4px; }
.topbar.fit4 .resbar .res { padding: 3px; gap: 3px; }
.topbar.fit4 .resbar .res-icon { flex-basis: 24px; }
.topbar.fit4 .resbar .res-icon img.ri { height: 22px; }
.topbar.fit4 .resbar .res-body { min-width: 4.6ch; }
/* 5 : barre d'XP en filet sous le niveau (montant toujours à l'infobulle), derniers pixels des icônes et boutons */
.topbar.fit5 .hud-item.level { position: relative; padding-bottom: 4px; height: 36px; box-sizing: border-box; }
.topbar.fit5 .hud-item.level > span { margin-bottom: 6px; line-height: 1; }
.topbar.fit5 .hud-item.level .bar.xp { position: absolute; left: 12px; right: 12px; bottom: 3px; width: auto; height: 7px; border-width: 1px; border-radius: 4px; }
.topbar.fit5 .hud-item.level .bar.xp small { opacity: 0; }
.topbar.fit5 .hud .btn.small { min-width: 36px; padding: 0 4px; }
.topbar.fit5 .resbar .res { padding: 3px 2px; gap: 2px; }
.topbar.fit5 .resbar .res-body { min-width: 4.2ch; }
.topbar.fit5 .resbar .res-icon { flex-basis: 22px; }

/* ---------- Onglets principaux ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; max-width: 1700px; margin: 6px auto 0; padding: 8px 16px; }
/* Onglets toujours visibles (ordinateur) : collés sous le bandeau, avec le fond de la page pour masquer le contenu qui défile dessous.
   --topbar-h et --sticky-h (bandeau + onglets) : mesurées par syncStickyBars (game.js). z-index sous le bandeau (menu des langues),
   les fenêtres, infobulles et messages. */
@media (min-width: 861px) {
  /* Même portion du fond que la page derrière (image carrée en « cover ») : --fond-w = côté de l'image, --tabs-y = haut des onglets (syncTabsBg) */
  .tabs { position: sticky; top: var(--topbar-h, 0px); z-index: 9;
    background: var(--bg) url("../img/fond/fond.jpg") 50% calc(-1 * var(--tabs-y, 0px)) / var(--fond-w, 100vw) auto no-repeat; }
}
@media (min-width: 1921px), (min-width: 861px) and (min-resolution: 1.5dppx) {
  .tabs { background-image: url("../img/fond/fond_4k.jpg"); }
}
/* Les défilements automatiques (scrollIntoView, focus clavier) s'arrêtent sous les barres ; leurs propres boutons ne font pas défiler */
/* Page en train de défiler (game.js, « defile ») : effets qui redessinent à chaque image suspendus */
html.defile :is(.slot-tile, .fu-tile, .xt, .tab.gd-glow) { animation-play-state: paused !important; }
html.defile :is(.bar, .pat-bar) i { transition: none !important; }
/* scrollbar-gutter : place de la barre de défilement toujours réservée, la page ne glisse plus de ~8 px quand un onglet court (Marché…) succède à un onglet long */
html { scroll-padding-top: var(--sticky-h, 0px); scrollbar-gutter: stable; }
.topbar *, .tabs, .tabs * { scroll-margin-top: calc(-1 * var(--sticky-h, 0px)); }
.tab {
  background: var(--panel); color: var(--muted); border: 1px solid var(--border); border-radius: 10px 10px 0 0;
  padding: 9px 18px; font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; border-bottom-width: 3px;
}
.tab:hover { color: var(--text); background: var(--panel-2); }
.tab.sel { color: var(--text); background: var(--panel-2); border-bottom-color: var(--accent); }
/* Onglets réordonnables par glisser-déposer (29/11/2026) : onglet saisi estompé, repère doré du côté où il sera posé */
.tab.tab-drag { opacity: .45; }
.tab.tab-over-l { box-shadow: inset 4px 0 0 var(--accent); }
.tab.tab-over-r { box-shadow: inset -4px 0 0 var(--accent); }
.tab-badge { margin-left: 4px; font-size: 12px; font-weight: 600; color: #1d1209; background: var(--gold); border-radius: 10px; padding: 1px 7px; vertical-align: 2px; }

/* Échoppe : comptoir, quêtes, stock, râteliers, atelier */
main[data-tab="echoppe"] {
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); /* comptoir plus large : 3 clients par ligne ; minmax(0) = colonnes fixes, les icônes de catégories ne bougent plus */
  /* Écran moyen : à gauche comptoir, quêtes, chaudron, stock, râteliers ; à droite l'atelier puis la liste des recettes */
  /* le comptoir couvre 2 lignes : la liste commence juste sous l'atelier, la 2e ligne (1fr) absorbe la différence de hauteur */
  grid-template-areas: "counter ." "counter list" "quests list" "cauldron list" "stock list" "racks list";
  grid-template-rows: auto 1fr auto auto auto auto;
}
.recipes-panel { grid-area: list; min-width: 0; }
.recipes-panel .cat-title { margin-top: 0; }
main[data-tab="echoppe"] .dungeons-panel,
main[data-tab="echoppe"] .heroes-panel,
main[data-tab="echoppe"] .city,
main[data-tab="echoppe"] .orders-panel,
main[data-tab="echoppe"] .market-panel,
main[data-tab="echoppe"] .arena-panel { display: none; }
/* Autres onglets : un seul panneau, pleine largeur, toujours déplié */
main:not([data-tab="echoppe"]) { display: block; }
main:not([data-tab="echoppe"]) > .panel { display: none; }
main[data-tab="donjons"] > .dungeons-panel,
main[data-tab="heros"] > .heroes-panel,
main[data-tab="ville"] > .city,
main[data-tab="commandes"] > .orders-panel,
main[data-tab="marche"] > .market-panel,
main[data-tab="arene"] > .arena-panel { display: block; }
#dungeons-toggle, #heroes-toggle, #city-toggle { display: none; }

@media (max-width: 860px) {
  main[data-tab="echoppe"] { grid-template-columns: 1fr; grid-template-areas: "counter" "quests" "list" "cauldron" "stock" "racks"; grid-template-rows: none; }
  .tab { padding: 7px 12px; font-size: 15px; }
}

/* ---------- Sauvegarde ---------- */
#save-btn.warn { color: var(--bad); border-color: var(--bad); }
.save-dialog {
  width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto;
  background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 16px;
}
.save-dialog::backdrop { background: rgba(0, 0, 0, .6); }
.save-box h2 { margin: 0; font-size: 20px; }
.save-box h3 { margin: 16px 0 6px; font-size: 16px; color: var(--gold); }
.save-box p { margin: 6px 0; }
.save-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.save-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.save-row label.btn { cursor: pointer; }
.save-warn { color: var(--bad); font-weight: 600; }
.small-text { font-size: 14px; }
#save-code { width: 100%; box-sizing: border-box; font: 13px monospace; background: var(--panel-2); color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 6px; resize: vertical; }
.save-backups { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.save-backups li { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; }
.paused { position: fixed; inset: 0; z-index: 1000; background: rgba(0, 0, 0, .75); display: flex; align-items: center; justify-content: center; padding: 16px; }
.paused[hidden] { display: none; }
.paused-box { max-width: 440px; background: var(--panel); border: 1px solid var(--gold); border-radius: 10px; padding: 20px; text-align: center; }
.paused-box h2 { margin-top: 0; font-size: 20px; }

/* ---------- Police d'affichage ---------- */
h1, h2, h3, .tab, .btn, .hud-item b, .hud-item.level span, .b-name, .qobj-name, .tab-badge, .paused-box h2 {
  font-family: var(--font-title);
  font-weight: normal;          /* Trans800 est déjà grasse : pas de faux gras */
  letter-spacing: .4px;
}
h1 { font-size: 24px; }
h2 { font-size: 18px; }
h2 small { margin-left: 8px; }
.btn small, .b-name small, .tab small { font-family: var(--font-text); letter-spacing: 0; }

/* Icônes d'interface (img/ui/) à la place des emojis : onglets, titres de panneaux */
img.ui-ico { height: 1.5em; width: auto; vertical-align: -0.4em; object-fit: contain; filter: drop-shadow(0 1px 1px rgba(0,0,0,.5)); }
img.ui-ico.nrg { height: 1.2em; vertical-align: -0.25em; margin: 0 1px; }
.hud-item img.ui-ico.nrg { height: 1.6em; vertical-align: middle; }
img.ui-ico.gold { height: 1.15em; vertical-align: -0.2em; margin: 0 1px; }
.hud-item img.ui-ico.gold { height: 1.6em; vertical-align: middle; }
img.ui-ico.time { height: 1.1em; vertical-align: -0.2em; }
img.ui-ico.anvil { height: 1.5em; vertical-align: -0.35em; }
img.ui-ico.pow { height: 1.6em; vertical-align: -0.45em; margin-right: 2px; }
.hcard-label img.ui-ico.pow { height: 17px; vertical-align: -4px; filter: none; }
/* Petite tuile d'interface (carré coloré + symbole blanc), à la taille d'une icône de texte */
.cat-btn.ui-tile { display: inline-block; width: 1.6em; height: 1.6em; vertical-align: -0.45em; }

/* Bouton avec icône à gauche (centrée en hauteur) et texte centré dans le reste */
.btn:has(> img.ui-ico.map) { display: inline-flex; align-items: center; gap: 8px; }
.btn img.ui-ico.map { height: 2em; width: 2em; flex: none; vertical-align: middle; }
.btn .btn-txt { flex: 1; text-align: center; }

/* Casse et panoplie de l'équipement des héros */
/* Pourcentage de casse : pastille sombre, police du jeu, bordure de la couleur du risque (lisible sur la carte jaune) ;
   la carte équipée descend un peu l'icône pour ne pas passer dessous */
.hcard-break { position: absolute; top: 4%; left: 6%; z-index: 2; padding: 2px 5px 3px; border-radius: 9px; border: 1.5px solid currentColor;
  background: rgba(34, 19, 8, .9); font-family: var(--font-title); font-size: 12px; font-weight: 400; line-height: 1; letter-spacing: .2px; white-space: nowrap;
  text-shadow: none; box-shadow: 0 1px 2px rgba(0, 0, 0, .5); pointer-events: none; }
.hcard-break.low { color: #8ff08f; }
.hcard-break.mid { color: #ffcf6a; }
.hcard-break.high { color: #ff8070; }
.hcard.full { padding-top: 24%; }
.hcard.broken { filter: grayscale(.6) brightness(.85); outline: 2px solid #c0392b; outline-offset: -3px; }
.hcard.broken .hcard-icons { opacity: .6; }
.set-on { color: #8fd98f; font-size: 13px; }

/* Emplacements d'expédition (tuiles « Quête ! ») */
#expeditions:not(:empty) { margin-bottom: 14px; }
.exp-slots { display: flex; flex-wrap: nowrap; gap: 14px; overflow-x: auto; padding: 28px 28px 32px; margin: -24px -24px -24px; scrollbar-width: none; } /* une seule ligne */
.exp-slots::-webkit-scrollbar { display: none; }
.slot-tile {
  position: relative; flex: 0 1 108px; min-width: 84px; height: 118px; box-sizing: border-box; padding: 6px 4px 4px;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  border: 4px solid #f0a02d; border-radius: 20px; font-family: var(--font-title), serif; color: #fff; cursor: default;
  box-shadow: 0 0 0 3px #4a2411, 0 4px 8px rgba(0, 0, 0, .55), inset 0 0 0 2px rgba(255, 255, 255, .25);
}
.slot-tile.free {
  cursor: pointer; background: linear-gradient(#35c2ff, #1479d8);
  animation: slotPulse 1.8s ease-in-out infinite;
}
.slot-tile.free:hover { filter: brightness(1.12); transform: translateY(-2px); }
.slot-tile.free:active { transform: translateY(1px); }
.slot-ico { height: 66px; width: auto; margin-top: 2px; filter: drop-shadow(0 2px 0 rgba(8, 60, 120, .7)) drop-shadow(0 0 2px rgba(8, 60, 120, .8)); }
.slot-txt { font-size: 24px; line-height: 1; margin-bottom: 4px; color: #fff; -webkit-text-stroke: 5px #0b3a73; paint-order: stroke fill; letter-spacing: .5px; }
@keyframes slotPulse {
  0%, 100% { box-shadow: 0 0 0 3px #4a2411, 0 4px 8px rgba(0, 0, 0, .55), 0 0 6px 1px rgba(80, 200, 255, .4), inset 0 0 0 2px rgba(255, 255, 255, .25); }
  50% { box-shadow: 0 0 0 3px #4a2411, 0 4px 8px rgba(0, 0, 0, .55), 0 0 18px 6px rgba(80, 200, 255, .85), inset 0 0 0 2px rgba(255, 255, 255, .25); }
}
.slot-tile.busy { background: linear-gradient(#4b3a2a, #2c2118); border-color: #8a6a3a; gap: 2px; }
.slot-zone { width: 64px; height: 44px; object-fit: contain; flex: none; } /* icônes détourées de ratio variable (0,9 à 1,3) : entières, jamais rognées */
.slot-heroes { font-size: 15px; line-height: 1; }
.slot-tile.busy .bar { width: 86%; height: 7px; margin: 0; }
.slot-time { font-size: 15px; color: #f5e6c8; }
.slot-tile.locked { background: linear-gradient(#7b7b7b, #4b4b4b); border-color: #9a9a9a; cursor: pointer; justify-content: center; gap: 6px; }
.slot-tile.locked:disabled { cursor: default; opacity: .75; }
.slot-lock { font-size: 34px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .5)); }
.slot-cost { font-size: 15px; }
@media (prefers-reduced-motion: reduce) { .slot-tile.free { animation: none; } }
/* Colonne des expéditions à gauche de l'Échoppe (renderExpRail / placeExpRail : left et top calculés d'après #main) */
.exp-rail-col {
  position: fixed; z-index: 5; display: flex; flex-direction: column; gap: 14px;
  overflow-y: auto; padding: 10px; /* max-height : placeExpRail(), d'après la hauteur de l'écran et le zoom de la page */
}
/* Trop de tuiles pour la hauteur : barre fine et discrète, logée dans la marge droite (largeur de la colonne inchangée) */
.exp-rail-col.scroll { padding-right: 4px; }
.exp-rail-col::-webkit-scrollbar { width: 6px; height: 6px; }
.exp-rail-col::-webkit-scrollbar-track { background: transparent; }
.exp-rail-col::-webkit-scrollbar-thumb { background: rgba(240, 160, 45, .45); border-radius: 3px; }
.exp-rail-col::-webkit-scrollbar-thumb:hover { background: rgba(240, 160, 45, .75); }
@supports not selector(::-webkit-scrollbar) { .exp-rail-col { scrollbar-width: thin; scrollbar-color: rgba(240, 160, 45, .45) transparent; } }
.exp-rail-col.off {
  position: static; flex-direction: row; max-width: 1700px; margin: 0 auto;
  max-height: none; overflow-x: auto;
}
.exp-rail-col .slot-tile { flex: none; width: 96px; height: 104px; }
.exp-rail-col .slot-txt { font-size: 20px; }
.exp-rail-col .slot-tile.done .slot-txt { font-size: 16px; }
.exp-rail-col .slot-ico { height: 56px; }
.exp-rail-col .slot-zone { width: 60px; height: 40px; }

/* Fenêtre « expéditions disponibles » (cartes crème, image qui déborde en haut) */
.dp-back { position: fixed; inset: 0; z-index: 900; background: rgba(0, 0, 0, .7); }
.dp { position: fixed; z-index: 901; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(96vw, 1100px); max-height: 92vh; }
.dp.xp { width: min(calc(100vw - 32px), 1700px); } /* Expéditions disponibles : largeur de la page (≈ 9 donjons visibles) */
.dp-title { display: flex; justify-content: space-between; align-items: center; font-family: var(--font-title), serif; font-size: 24px; color: #fff; margin: 0 6px 6px; text-shadow: 0 2px 3px #000; }
.dp-row { display: flex; justify-content: safe center; gap: 16px; overflow-x: auto; padding: 78px 10px 14px; align-items: flex-start; }
.dp-card {
  position: relative; flex: 0 0 168px; box-sizing: border-box; padding: 78px 6px 8px; margin: 0;
  display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer;
  background: linear-gradient(#fbeacb, #f3d9a8); color: #5a3a1b; font-family: var(--font-title), serif;
  border: 4px solid #e49a38; border-radius: 22px; box-shadow: 0 0 0 3px #5b3112, 0 6px 12px rgba(0, 0, 0, .6);
}
.dp-card:hover { filter: brightness(1.06); transform: translateY(-3px); }
.dp-card:active { transform: translateY(1px); }
.dp-card.dp-raid { background: linear-gradient(#ffe9aa, #ffc75a); }
.dp-raid .dp-time { color: #5a3a1b; -webkit-text-stroke: 0; }
[data-raid-schedule] { display: flex; flex-wrap: wrap; gap: 4px 8px; font-variant-numeric: tabular-nums; }
.dp-raid [data-raid-schedule] { justify-content: center; font-size: 16px; line-height: 1.15; }
.dp-img { position: absolute; left: 50%; top: -62px; transform: translateX(-50%); width: 150px; height: 108px; object-fit: contain; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .55)); pointer-events: none; }
/* Pastille « pouvoir requis » : posée au pied de l'image, dans l'espace libre au-dessus du nom (gabarit de carte inchangé) */
.dp-need { position: absolute; left: 50%; top: 46px; transform: translateX(-50%); z-index: 1; height: 24px; box-sizing: border-box; padding: 0 9px 0 5px; border-radius: 12px; background: #3a2412; border: 2px solid #e49a38; box-shadow: 0 2px 4px rgba(0, 0, 0, .45); display: flex; align-items: center; gap: 4px; white-space: nowrap; pointer-events: auto; }
.dp-need.ok { background: #1d7a34; border-color: #0e4a1d; } /* le meilleur groupe libre atteint la valeur */
.dp-need.ko { background: #b0291e; border-color: #5e130d; } /* aucun groupe libre assez fort */
.dp-need img { width: 18px; height: 18px; object-fit: contain; }
.dp-need b { font-weight: 400; font-size: 16px; line-height: 1; color: #fff; font-variant-numeric: tabular-nums; }
.dp-name { font-size: 18px; line-height: 1.05; text-align: center; color: #fff; -webkit-text-stroke: 4px #3a2412; paint-order: stroke fill; min-height: 38px; display: flex; align-items: center; justify-content: center; }
.dp-bar { position: relative; width: 92%; height: 18px; border-radius: 9px; background: #2b2118; border: 2px solid #3a2412; overflow: hidden; }
.dp-bar i { display: block; height: 100%; background: linear-gradient(#58e06c, #1fa043); }
.dp-bar.boss i { background: linear-gradient(#ff7a6a, #c0392b); }
.dp-bar span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; color: #fff; -webkit-text-stroke: 3px #1d150e; paint-order: stroke fill; }
.dp-done { font-size: 22px; line-height: 18px; height: 18px; color: #ffc533; -webkit-text-stroke: 4px #7a3d0b; paint-order: stroke fill; letter-spacing: .5px; }
.dp-mat { height: 76px; display: flex; align-items: center; justify-content: center; margin-top: 6px; }
.dp-mat img.ri { width: 72px; height: 72px; object-fit: contain; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .45)); }
.dp-pow { font-size: 22px; color: #6b4a2a; display: flex; align-items: center; gap: 6px; }
.dp-time { width: 100%; box-sizing: border-box; margin-top: 4px; padding: 6px 4px; border-radius: 14px; background: rgba(255, 255, 255, .45); font-size: 22px; color: #27a3ff; -webkit-text-stroke: 4px #0b3a73; paint-order: stroke fill; display: flex; align-items: center; justify-content: center; gap: 6px; }
.dp-time img.ui-ico { height: 1.1em; -webkit-text-stroke: 0; }
.dp-pow img.ui-ico { height: 1.2em; }

.dp-card.locked { cursor: default; background: linear-gradient(#d9d4cb, #b9b2a6); border-color: #9c9588; filter: none; }
.dp-card.locked:hover { transform: none; filter: none; }
.dp-card:disabled { cursor: default; }
.dp-card:disabled:hover { transform: none; filter: none; }
.dp-card.locked .dp-img { filter: grayscale(1) brightness(.7) drop-shadow(0 4px 4px rgba(0, 0, 0, .55)); }
.dp-card.locked .dp-mat img.ri { filter: grayscale(.7) brightness(.8) drop-shadow(0 3px 3px rgba(0, 0, 0, .45)); }
.dp-done.lock { font-size: 17px; color: #fff; -webkit-text-stroke: 4px #4a4a4a; }
.dp-matname { font-size: 14px; line-height: 1.1; text-align: center; color: #5a4a3a; min-height: 30px; }
.dp-why { width: 100%; box-sizing: border-box; padding: 6px 4px; border-radius: 14px; background: rgba(255, 255, 255, .5); font-size: 15px; line-height: 1.15; text-align: center; color: #b3261e; display: flex; flex-direction: column; gap: 2px; min-height: 40px; justify-content: center; }

.dp-bar.lock i { background: linear-gradient(#b9b2a6, #7a7468); }
.dp-stock { font-size: 24px; color: #6b4a2a; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 30px; }
.dp-stock b.zero { color: #c0392b; }
/* Stock d'un matériau au plafond (MAT_CAP) : « Max », avertissement du groupe, part perdue au retour */
.mat-max { flex: none; padding: 2px 8px 3px; border-radius: 999px; background: #c9571c; color: #fff; font-size: 14px; line-height: 1.15; font-weight: 400; font-style: normal; white-space: nowrap; }
.dp-stock .mat-max { margin-left: -2px; padding: 2px 6px 3px; font-size: 13px; }
.dp-stock:has(.mat-max) { gap: 6px; font-size: 21px; }
.dgr-mat > .mat-max { margin-left: auto; line-height: 1.15; overflow-wrap: normal; }
.dgr-mat > .mat-max + .dgr-stock { margin-left: 0; }
.dgs-val .mat-max { margin-right: 8px; }
.pty-foot .pty-max { display: block; font-size: 14px; font-weight: 400; color: #a83a06; }
html.dark-win .pty-foot .pty-max { color: #f0a54a; }
.fh-lost, .fe-lost { font-style: normal; color: #ffb36b; }
.fh-prize .fh-lost { font-size: 14px; line-height: 1.15; }
.fe-team.has-lost .fh-prize { min-height: 58px; }
.fh-b .fh-lost { display: block; }
.fh-st.warn { color: #ffb36b; }
.chest-ico { height: 30px; width: auto; filter: drop-shadow(0 1px 1px rgba(0,0,0,.45)); }

.dp-row { scrollbar-width: none; -ms-overflow-style: none; cursor: grab; user-select: none; }
.dp-row.dragging { cursor: grabbing; }
.dp-row::-webkit-scrollbar { display: none; }






#expeditions.city-grid { display: block; } /* les emplacements d'expédition occupent toute la largeur, sur une seule ligne */

/* Inventaire d'un emplacement de héros (mêmes cartes crème que les expéditions) */
.ep-card { padding-top: 84px; flex-basis: 178px; }
.ep-img { display: flex; align-items: center; justify-content: center; top: -66px; width: 170px; height: 120px; filter: drop-shadow(0 0 10px var(--q)) drop-shadow(0 4px 4px rgba(0, 0, 0, .55)); }
.ep-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.ep-emoji { font-size: 64px; }
.ep-name { min-height: 44px; font-size: 19px; }
.ep-opt { display: flex; align-items: center; gap: 6px; font-size: 20px; color: #fff; -webkit-text-stroke: 4px #3a2412; paint-order: stroke fill; }
.flag-ico { width: 22px; height: 26px; -webkit-text-stroke: 0; }
.ep-pow { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 8px; font-size: 34px; color: #ffc533; -webkit-text-stroke: 5px #7a3d0b; paint-order: stroke fill; }
.ep-pow b.neg { color: #ff8a7a; }
.ep-pow img.ui-ico { height: 1.1em; -webkit-text-stroke: 0; }
.ep-break { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-top: 6px; color: #6b4a2a; }
.ep-break small { font-size: 16px; }
.ep-break span { display: flex; align-items: center; gap: 6px; font-size: 26px; color: #ffc533; -webkit-text-stroke: 4px #7a3d0b; paint-order: stroke fill; }
.shield-ico { width: 30px; height: 30px; object-fit: contain; -webkit-text-stroke: 0; }
/* Fiche du héros : « Équiper le meilleur » et « Équiper le moins risqué » côte à côte */
.equip-btns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.equip-btns .btn { white-space: nowrap; justify-content: center; min-width: 0; }
.equip-btns .shield-ico { width: 1.3em; height: 1.3em; vertical-align: -0.3em; }
.ep-foot { width: 100%; display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 8px; padding: 6px 8px; box-sizing: border-box; background: rgba(255, 255, 255, .45); border-radius: 14px; font-size: 22px; color: #3a2412; }
.ep-foot.ep-shared { gap: 8px; white-space: nowrap; font-size: 18px; }
.ep-foot.ep-shared img.ui-ico { height: 28px; }
.ep-info { width: 28px; height: 28px; border-radius: 50%; background: #2a90e8; border: 3px solid #e49a38; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; }
.ep-empty { color: #fff; font-size: 18px; text-align: center; padding: 30px 10px; text-shadow: 0 2px 3px #000; width: 100%; }

.hud-item.level img.ui-ico.lvl, img.ui-ico.lvl { height: 1.7em; vertical-align: -0.45em; margin-right: 2px; }

#profile-btn img.ui-ico { height: 1.3em; vertical-align: middle; }
img.info-ico { flex: none; width: 26px; height: 26px; vertical-align: middle; cursor: help; margin-left: 4px; }
.r-body { position: relative; }
.r-name .nw { white-space: nowrap; }
.r-name img.info-ico { position: static; width: 24px; height: 24px; min-width: 24px; aspect-ratio: 1; object-fit: contain; margin-left: 6px; vertical-align: middle; }

/* Fenêtre des paliers de progression */
/* Cartes de même hauteur (étirées) : le texte long d'une compétence agrandit toutes les cartes, et les enclumes restent alignées en bas */
.pg-row { padding-top: 14px; align-items: stretch; }
.pg-card { flex: 0 0 168px; box-sizing: border-box; padding: 10px 6px 10px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: linear-gradient(#fbeacb, #f3d9a8); color: #5a3a1b; font-family: var(--font-title), serif; border: 4px solid #e49a38; border-radius: 22px;
  box-shadow: 0 0 0 3px #5b3112, 0 6px 12px rgba(0, 0, 0, .6); opacity: .7; filter: saturate(.6); }
.pg-card.done { opacity: 1; filter: none; }
.pg-card.next { opacity: 1; filter: none; border-color: #ffc533; }
.pg-ico { position: relative; width: 120px; height: 96px; display: flex; align-items: center; justify-content: center; font-size: 56px; }
.pg-ico img.ui-ico, .pg-ico img.ri, .pg-ico img.ii { height: 84px; width: 84px; object-fit: contain; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .45)); }
.pg-ico b { position: absolute; right: 0; bottom: 0; font-size: 28px; line-height: 1; color: #fff; -webkit-text-stroke: 5px #3a2412; paint-order: stroke fill; }
.pg-lbl { font-size: 18px; line-height: 1.1; text-align: center; min-height: 58px; flex: 1 1 auto; display: flex; flex-direction: column; justify-content: center; }
.pg-lbl small { font-size: 13px; color: #7a5a38; margin-top: 2px; }
.pg-at { display: flex; align-items: center; gap: 6px; font-size: 26px; margin-top: auto; }
.pg-at img.ui-ico { height: 1.2em; }
.pg-ok { color: #2f9a45; font-size: 22px; }
.dp-title small { font-size: 15px; margin-left: 10px; color: #e6d3a8; }
.pg-plan { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.pg-plan img { height: 52px; width: 52px; }
.pg-ico img.ui-ico[src*=plans] { height: 96px; width: 80px; }
img.info-ico { cursor: pointer; transition: transform .12s ease, filter .12s ease; }
img.info-ico:hover { transform: scale(1.18); filter: brightness(1.2) drop-shadow(0 0 5px rgba(90, 200, 255, .9)); }
img.info-ico:active { transform: scale(.95); }

/* Palier de qualité : halo, cadre et libellé à la couleur de la qualité */
.pg-card.is-q { border-color: var(--q); background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--q) 45%, #fbeacb), #f3d9a8 70%); }
.pg-card.is-q .pg-ico { filter: drop-shadow(0 0 6px var(--q)) drop-shadow(0 0 14px var(--q)); }
.pg-card.is-q .pg-lbl small { color: var(--q); font-size: 15px; -webkit-text-stroke: 3px #3a2412; paint-order: stroke fill; }

/* Classement */
.board-dialog { width: min(560px, calc(100vw - 32px)); }
.board-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.board-list { max-height: 50vh; overflow: auto; }
.board-table { width: 100%; border-collapse: collapse; }
.board-table td { padding: 5px 8px; border-bottom: 1px solid rgba(255,255,255,.07); }
.board-table td:first-child { width: 44px; text-align: center; color: var(--gold); font-family: var(--font-title); }
.board-table td:last-child { text-align: right; font-family: var(--font-title); color: var(--gold); }
.board-table td small { color: var(--muted, #b9a98a); margin-left: 4px; }
.board-table tr.me { background: rgba(233, 185, 73, .15); font-weight: 700; }
.board-table tr.sep td { border-top: 2px dashed rgba(255,255,255,.2); }
.board-join { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.board-join input { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; font: inherit; }
.board-note { display: contents; }
.board-foot { display: none; }
/* Ordinateur : fenêtre de taille fixe adaptée à l'écran, rangs sur deux colonnes, seule la liste défile */
html:not(.tel) #board-dialog {
  --bd-bg: #fdeecc; --bd-ink: #3a2412; --bd-muted: #6b4c2c; --bd-accent: #8a5a10; --bd-ko: #a82a1c;
  --bd-line: rgba(120, 80, 30, .2); --bd-me: #f7dc97; --bd-field: #fff8e6; --bd-bar: #b98d45;
  --bd-f: clamp(16px, 10.5px + .42vw, 22px); /* texte : 16 px jusqu'à 1 280, 22 px vers 2 700 */
  --bd-val: 4.2em; --bd-row: calc(2.1em + 10px);
  box-sizing: border-box; width: min(1700px, 100% - 36px); height: calc(100% - 36px); /* en % : hors barre de défilement et zoom de page */ max-width: none; max-height: none;
  padding: 16px; overflow: hidden; border: 0; border-radius: 18px; background: var(--bd-bg); color: var(--bd-ink); box-shadow: 0 10px 40px rgba(0, 0, 0, .6); font-size: var(--bd-f);
}
html.dark-win:not(.tel) #board-dialog {
  --bd-bg: var(--dw-bg); --bd-ink: var(--dw-ink); --bd-muted: #c4ae8e; --bd-accent: var(--dw-accent); --bd-ko: var(--dw-ko);
  --bd-line: var(--dw-line); --bd-me: var(--dw-band); --bd-field: var(--dw-field); --bd-bar: #a07a3c; color-scheme: dark;
}
html:not(.tel) #board-dialog .save-box { height: 100%; display: flex; flex-direction: column; gap: 10px; }
html:not(.tel) #board-dialog .kind-plans { --bd-val: 5.4em; }
html:not(.tel) #board-dialog .kind-honor { --bd-val: 7.4em; }
html:not(.tel) #board-dialog .save-box > * { flex: none; margin: 0; }
html:not(.tel) #board-dialog .save-box p { margin: 0; }
html:not(.tel) #board-dialog h2 { font-size: 1.4em; }
html:not(.tel):not(.dark-win) #board-dialog .btn.close { filter: drop-shadow(0 2px 2px rgba(58, 36, 18, .6)); }
html:not(.tel) #board-dialog .muted, html:not(.tel) #board-dialog small { color: var(--bd-muted); }
html:not(.tel) #board-dialog .small-text, html:not(.tel) #board-dialog small { font-size: max(16px, .85em); }
html:not(.tel) #board-dialog .save-warn { color: var(--bd-ko); }
html:not(.tel) #board-dialog .board-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(136px, 1fr)); gap: 8px; }
html:not(.tel) #board-dialog .board-tabs .btn { font-size: max(16px, .9em); min-height: 40px; }
html:not(.tel) #board-dialog .board-note { display: block; min-height: 1.4em; line-height: 1.4; }
html:not(.tel) #board-dialog .save-box > .board-list { flex: 1; min-height: 0; max-height: none; overflow: hidden auto; scrollbar-gutter: stable; scrollbar-color: var(--bd-bar) transparent; }
html:not(.tel) #board-dialog .board-table, html:not(.tel) #board-dialog .board-table tbody { display: grid; grid-template-columns: minmax(0, 1fr); }
html:not(.tel) #board-dialog .board-table tr { display: grid; grid-template-columns: 2.8em minmax(0, 1fr) var(--bd-val); align-items: center; column-gap: 8px; min-height: var(--bd-row); padding: 0 6px 0 2px; border-bottom: 1px solid var(--bd-line); }
html:not(.tel) #board-dialog .board-table td { padding: 0; border: 0; width: auto; white-space: nowrap; min-width: 0; }
html:not(.tel) #board-dialog .board-table td:first-child, html:not(.tel) #board-dialog .board-table td:last-child { color: var(--bd-accent); }
html:not(.tel) #board-dialog .board-table td[colspan] { grid-column: 1 / -1; padding: 8px 0; text-align: left; color: var(--bd-muted); }
html:not(.tel) #board-dialog .board-table tr.me { background: var(--bd-me); border-radius: 10px; }
html:not(.tel) #board-dialog .board-list tr.sep, html:not(.tel) #board-dialog .board-list > .board-table + p { display: none; } /* repris dans .board-foot */
html:not(.tel) #board-dialog .rk-ico { height: 2.1em; }
html:not(.tel) #board-dialog .lb-who { grid-template-columns: minmax(0, 1fr) max(102px, 5em) 3.5em; }
html:not(.tel) #board-dialog .lb-who small { text-align: right; }
html:not(.tel) #board-dialog .ar-badge { font-size: 13px; }
html:not(.tel) #board-dialog .board-foot { display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; gap: 8px 16px; min-height: calc(2.1em + 10px); overflow: hidden; scrollbar-gutter: stable; }
html:not(.tel) #board-dialog .board-foot tr { border: 0; }
html:not(.tel) #board-dialog .board-foot p { text-align: right; padding-right: 8px; }
html:not(.tel) #board-dialog .board-join input { background: var(--bd-field); color: var(--bd-ink); border-color: var(--bd-bar); }
html:not(.tel) #board-dialog .board-join .btn { font-size: max(16px, .9em); }
@media (min-width: 1240px) {
  html:not(.tel) #board-dialog { --bd-row: max(2.1em + 10px, min(72px, (100dvh / var(--page-zoom, 1) - 320px) / 25)); } /* très grand écran : les 25 lignes remplissent la hauteur */
  html:not(.tel) #board-dialog .board-list tbody, html:not(.tel) #board-dialog .board-foot { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; }
  html:not(.tel) #board-dialog .board-foot p { grid-column: 2; }
}
@media (min-width: 1240px) and (max-width: 1439px) { /* honneur : rang sous le montant, pour un pseudo entier de 16 caractères */
  html:not(.tel) #board-dialog .kind-honor { --bd-val: 4.4em; }
  html:not(.tel) #board-dialog .kind-honor td:last-child { line-height: 1.1; }
  html:not(.tel) #board-dialog .kind-honor td:last-child small { display: block; margin: 0; }
}

/* Niveau de boutique : à gauche, à côté du titre, sur une seule ligne de la hauteur des autres pastilles */
.brand { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.hud-item.level { flex-direction: row; align-items: center; gap: 10px; border-radius: 20px; min-width: 0; }
.hud-item.level .bar.xp { position: relative; width: 190px; height: 24px; margin: 0; border-radius: 12px; }
.hud-item.level .bar.xp i { display: block; height: 100%; }
.hud-item.level .bar.xp small { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #fff; text-shadow: 0 1px 2px #000; }
.hud-item.level .bar.xp { background: #120d09; border: 2px solid #3a2412; box-shadow: 0 0 0 1px #000, 0 2px 5px rgba(0, 0, 0, .7), inset 0 2px 4px rgba(0, 0, 0, .8); }
.hud-item.level .bar.xp i { box-shadow: inset 0 -3px 4px rgba(120, 70, 0, .45), inset 0 2px 3px rgba(255, 255, 255, .35); }
.hud-item.level .bar.xp small { color: #fff; font-weight: 700; -webkit-text-stroke: 2px #1d150e; paint-order: stroke fill; text-shadow: 0 1px 3px #000; }
.hud-item.level .bar.xp small { padding-bottom: 2px; box-sizing: border-box; } /* centre l'encre des chiffres (la police les place ~1,5 px trop bas dans sa boîte) */

/* Profil : onglets et réalisations */
#profile-btn.has-claim { box-shadow: 0 0 0 2px var(--gold), 0 0 10px var(--gold); }
.save-warn { overflow-wrap: anywhere; }

/* Sauvegarde en ligne */
.cloud-key { flex: 1; min-width: 200px; background: var(--panel-2); color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; font: 14px monospace; }
.cloud-code { font: 16px monospace; background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px; padding: 2px 8px; letter-spacing: 1px; user-select: all; }
.cloud-conflict { border: 2px solid var(--gold); border-radius: 10px; padding: 8px 12px; margin: 8px 0; background: rgba(233, 185, 73, .1); }
/* Conflit de sauvegarde en ligne (#cloud-dialog) : deux colonnes fixes, la plus avancée en évidence */
.cloud-dialog { width: min(640px, calc(100vw - 32px)); }
.cloud-box { display: flex; flex-direction: column; gap: 12px; }
.cloud-box h2 { display: flex; align-items: center; gap: 8px; }
.cc-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1fr); column-gap: 8px; }
.cc-grid > span { padding: 7px 10px; min-width: 0; overflow-wrap: anywhere; }
.cc-l { color: var(--muted); align-self: center; }
.cc-h { font: 17px var(--font-title); text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; border-radius: 10px 10px 0 0; }
.cc-v { text-align: right; font-variant-numeric: tabular-nums; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; border-top: 1px solid var(--border); }
.cc-n { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.cc-v small { font-size: 13px; color: var(--muted); }
.cc-grid .best { background: rgba(123, 224, 138, .1); }
.cc-grid .cc-v.best { color: #b6f0bf; }
.cc-tag { font: 13px var(--font-text); color: #7be08a; min-height: 1.2em; }
.cc-btns { justify-content: flex-end; }

/* Nouvelle version disponible */
.update-banner { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 2000; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center;
  width: min(640px, calc(100vw - 24px)); box-sizing: border-box; padding: 10px 14px; background: #2a1d10; color: var(--text); border: 2px solid var(--gold); border-radius: 12px; box-shadow: 0 6px 20px rgba(0, 0, 0, .7); }
.update-banner[hidden] { display: none; }

/* Boutons de quête : même hauteur, contenu centré (icône du coffre + texte) */
.quest-actions { align-items: stretch; }
.quest-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding-top: 5px; padding-bottom: 7px; line-height: 1; }
.quest-actions .btn img.chest-ico { height: 1.5em; width: auto; flex: none; margin: 0; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .5)); }

img.ui-ico.gem { height: 1.3em; vertical-align: -0.25em; margin: 0 1px; }
.hud-item img.ui-ico.gem { height: 1.6em; vertical-align: middle; }

/* ===== Coffres et plans ===== */
.plans-dialog .save-box { max-width: 640px; }
.plan-chests { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.plan-chest { display: grid; grid-template-columns: 1fr 3rem 4.5rem 5rem auto; align-items: center; gap: 8px; padding: 4px 8px; background: rgba(0,0,0,.18); border-radius: 6px; }
.plan-chest .pc-name { display: flex; align-items: center; gap: 6px; }
.plan-chest .pc-n { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.plan-chest img.ii, .mat-chip img.ii { width: 1.4em; height: 1.4em; vertical-align: middle; }
.plans-list { max-height: 46vh; overflow-y: auto; margin-top: 8px; display: flex; flex-direction: column; gap: 3px; }

/* ===== Compétences des héros ===== */
.hskills { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.hskills .skill { font-size: 13px; padding: 1px 7px; border-radius: 10px; background: rgba(120,180,90,.18); border: 1px solid rgba(120,180,90,.5); white-space: nowrap; }
.hskills .skill small { opacity: .75; }
.hskills .skill.off { opacity: .5; background: rgba(0,0,0,.2); border-color: rgba(255,255,255,.15); }
.hskills .skill.aside { background: rgba(150,150,150,.15); border: 1px dashed rgba(200,200,200,.4); }
.hskills.items { margin-top: 0; }
.hskills.items .skill { background: rgba(230,180,80,.16); border-color: rgba(230,180,80,.5); }
.hskills.items .skill.off { background: rgba(0,0,0,.2); border-color: rgba(255,255,255,.15); }
.hskills.items .skill.off img.ii { filter: grayscale(1); }
img.sk { width: 1.5em; height: 1.5em; vertical-align: middle; object-fit: contain; margin-right: 2px; }
.hskills .skill { display: inline-flex; align-items: center; gap: 4px; }
.hskills .skill.off img.sk { filter: grayscale(1); }

/* Barre d'XP du profil : même rendu que celle de l'en-tête (cadre brun, relief, chiffres cernés et centrés sur l'encre) */
.slot-tile .slot-lvl { display: block; font-size: 12px; opacity: .85; margin-top: 4px; }

/* ===== Commandes spéciales ===== */
.orders { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; margin-top: 12px; }
.order-giver { background: rgba(0,0,0,.2); border: 1px solid var(--border); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.og-head { display: flex; align-items: center; gap: 12px; }
.og-head img.og-face { height: 64px; width: auto; flex: none; }
.og-head .og-name { font: 22px var(--font-title); color: #fff; }
.og-head small { color: var(--muted); }
.og-steps { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; max-width: 55%; justify-content: flex-end; }
.og-step { min-width: 28px; text-align: center; font-size: 13px; padding: 2px 6px; border-radius: 8px; background: rgba(0,0,0,.3); border: 1px solid var(--border); color: var(--muted); }
.og-step.done { background: rgba(120,180,90,.25); border-color: rgba(120,180,90,.6); color: #cfe9bf; }
.og-step.cur { border-color: var(--gold); color: var(--gold); }
.order-card { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid var(--border); }
.order-card.locked { opacity: .65; }
.oc-title { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font: 18px var(--font-title); }
.oc-title small { color: var(--muted); font: 14px var(--font-text); }
.oc-lines { display: flex; flex-direction: column; gap: 8px; }
.oc-line { display: grid; grid-template-columns: 2.2rem 1fr auto; align-items: center; gap: 10px; padding: 4px 8px; border-radius: 8px; background: rgba(0,0,0,.2); }
.oc-line img.ii { width: 2rem; height: 2rem; object-fit: contain; }
.oc-line.ok { background: rgba(120,180,90,.18); }
.oc-line .oc-q { font-size: 13px; }
.oc-line .oc-n { white-space: nowrap; font-weight: 700; }
.oc-rew-title { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 1px; }
.oc-rewards { display: flex; flex-wrap: wrap; gap: 10px; }
.oc-rew { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 10px; background: rgba(0,0,0,.25); border: 1px solid var(--border); white-space: nowrap; }
.oc-rew img.ii, .oc-rew img.ui-ico { height: 1.6em; width: 1.6em; object-fit: contain; }
.oc-foot { display: flex; justify-content: flex-end; }

/* ===== Arène (PvP) ===== */
.arena { display: flex; flex-direction: column; gap: 16px; margin-top: 12px; }
.ar-card { background: rgba(0,0,0,.2); border: 1px solid var(--border); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.ar-card h3 { margin: 0; font-size: 20px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ar-card h3 small { font: 14px var(--font-text); }
.ar-ico { object-fit: contain; flex: none; vertical-align: middle; }
.ar-ico.big { height: 84px; width: auto; filter: drop-shadow(0 2px 3px rgba(0,0,0,.6)); }
.ar-ico.sm { height: 1.6em; width: 1.6em; }
.ar-head { display: grid; grid-template-columns: auto minmax(220px, 1fr) auto; align-items: center; gap: 18px; }
.ar-rank { display: flex; align-items: center; gap: 14px; }
.ar-title { font: 26px var(--font-title); color: #fff; }
.ar-rank small { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.ar-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.ar-bar { height: 14px; background: #120d09; border: 2px solid #3a2412; border-radius: 8px; overflow: hidden; box-sizing: border-box; }
.ar-bar i { display: block; height: 100%; background: linear-gradient(#f2c35a, #c98a1c); box-shadow: inset 0 2px 3px rgba(255,255,255,.35); }
.ar-stats { display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.ar-stats span { display: flex; align-items: center; gap: 6px; }
.ar-stats img.ri { height: 1.5em; width: 1.5em; object-fit: contain; }
/* Attrait du PvP (29/11/2026) : 1re victoire du jour, bandeau « sans risque » et week-end, note du résultat */
.ar-stats .ar-fw { flex-wrap: wrap; }
.ar-stats .ar-fw.done { color: var(--muted); }
.ar-safe { grid-column: 1 / -1; margin: 0; padding: 6px 12px; border-radius: 10px; background: rgba(90, 160, 80, .14); font-size: 15px; }
.ar-note { margin: 0 0 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* Défi du Guerrier (héros à vaincre, DUEL_HEROES, 29/11/2026) */
.du-card { border-color: #b8862e; background: linear-gradient(135deg, rgba(120, 30, 40, .35), rgba(20, 60, 50, .3)); }
.du-head { display: flex; align-items: center; gap: 14px; }
.du-head h3 { margin: 0 0 4px; }
.du-head p { margin: 0; }
.du-face { width: 72px; height: 72px; object-fit: contain; flex: none; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .6)); }
.du-state { margin: 10px 0 8px; }
.du-card .ar-bar { max-width: 420px; }
.ar-note.du-win { color: #ffd86b; font-size: 17px; }
.ar-team { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.ar-slot { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 10px; text-align: center; border-radius: 12px;
  background: linear-gradient(#41332a, #2f251d); border: 2px solid #6b4a22; }
.ar-slot.empty { justify-content: center; min-height: 160px; background: rgba(0,0,0,.18); border: 2px dashed var(--border); }
.ar-slot img.av { width: 64px; height: 64px; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0,0,0,.5)); }
.ar-slot[draggable="true"] { cursor: grab; }
.ar-slot.dragging { opacity: .45; }
.ar-slot.drop { outline: 2px dashed var(--gold, #e0b050); outline-offset: 2px; }
.ar-slot img { -webkit-user-drag: none; }
.ar-pos { position: absolute; left: 8px; top: 8px; width: 30px; height: auto; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0,0,0,.55)); }
.ar-name { font: 18px var(--font-title); color: #fff; }
.ar-slot small { display: inline-flex; align-items: center; gap: 4px; }
.ar-abs { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.ar-ab { padding: 5px 8px; border-radius: 8px; border: 1px solid var(--border); background: rgba(0,0,0,.28); color: var(--text); font: 14px var(--font-text); cursor: pointer; }
.ar-ab:hover { border-color: var(--gold); }
.ar-ab.sel { background: rgba(233,185,73,.22); border-color: var(--gold); color: #fff; }
.ar-abdesc { margin: 0; font-size: 14px; line-height: 1.35; color: var(--muted); min-height: 5.4em; }
.dp.ae { width: min(94vw, 640px); max-height: 92vh; overflow-y: auto; box-sizing: border-box; padding: 16px; background: var(--panel); border: 2px solid #6b4a22; border-radius: 14px; display: flex; flex-direction: column; gap: 12px; }
.dp.ae .dp-title { margin: 0; }
.ae-mode { display: flex; flex-wrap: wrap; gap: 10px; }
.ae-slots { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 10px; }
.ae-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.ae-foot > span:first-child { display: inline-flex; align-items: center; gap: 6px; font-size: 18px; }
.ae-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.ar-slot .btn.small { margin-top: 2px; }
.ar-pending { border-color: var(--gold); background: rgba(233,185,73,.1); }
.ar-pend { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.ar-rew { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ar-rew .oc-rew img.ii, .ar-rew .oc-rew img.ui-ico, .ar-rew .oc-rew img.ar-ico { height: 1.5em; width: 1.5em; object-fit: contain; }
.ar-hists { display: flex; flex-wrap: wrap; gap: 8px; }
.ar-hist { padding: 3px 10px; border-radius: 10px; background: rgba(0,0,0,.25); border: 1px solid var(--border); font-size: 14px; }
.ab-ico { width: 22px; height: 22px; object-fit: contain; vertical-align: -5px; flex: none; filter: drop-shadow(0 1px 2px rgba(0,0,0,.55)); }
.ab-ico.big { width: 46px; height: 46px; vertical-align: baseline; }
.hq-ab { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border-radius: 10px; background: rgba(0,0,0,.25); border: 1px solid var(--border); }
.hq-ab-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hq-ab-name { font-size: 17px; color: #fff; }
.hq-ab-name small { color: var(--gold); font-size: 13px; }
.hq-ab p { margin: 0; font-size: 15px; line-height: 1.35; }
.hq-abs { display: flex; flex-direction: column; gap: 10px; }
.og-step.ab { position: relative; min-width: 34px; height: 34px; padding: 3px; display: inline-flex; align-items: center; justify-content: center; }
.og-step.ab .ab-ico { width: 26px; height: 26px; vertical-align: middle; }
.og-step.ab:not(.done) .ab-ico { filter: grayscale(1) brightness(.75); }
.og-step.ab.cur .ab-ico { filter: grayscale(.4); }
.og-step.ab .ab-ok { position: absolute; right: -4px; bottom: -4px; width: 15px; height: 15px; display: block; font-style: normal; }
.og-step.ab .ab-ok .ui-ico { width: 15px; height: 15px; display: block; filter: drop-shadow(0 1px 1px rgba(0,0,0,.6)); }
/* RÈGLE : icônes et textes alignés entre eux. Chaque bouton de capacité = 3 colonnes fixes (icône · nom · repère : palier ou cadenas) */
.ar-ab { display: grid; grid-template-columns: 26px minmax(0, 1fr) 22px; align-items: center; gap: 8px; min-height: 48px; padding: 6px 10px; text-align: left; box-sizing: border-box; }
.ar-ab .ab-ico { width: 26px; height: 26px; justify-self: center; vertical-align: middle; }
.ar-ab-name { line-height: 1.15; }
.ar-ab-end { display: flex; align-items: center; justify-content: center; color: var(--gold); font-size: 13px; }
.ar-ab-end .ui-ico { width: 16px; height: 16px; }
.ar-ab.locked .ab-ico { filter: grayscale(1) brightness(.7); }
.ar-ab.locked .ar-ab-name { color: var(--muted); }
img.ui-ico.flip { transform: scaleX(-1); }
.ar-actions .btn, .ae-btns .btn, .ar-slot .btn.small { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.ar-mv .btn .ui-ico { width: 18px; height: 18px; }
.ar-slot .btn.small .ui-ico { width: 1.2em; height: 1.2em; }
.hq-ico .ui-ico { width: 1.6rem; height: 1.6rem; }
.oc-n .ui-ico { width: 1.3rem; height: 1.3rem; vertical-align: middle; }
.oc-line > .hq-ico { width: 2rem; height: 2rem; }
.oc-line > :first-child { justify-self: center; display: inline-flex; align-items: center; justify-content: center; }
.hq-title { margin: 22px 0 4px; font-size: 22px; }
.hq-title small { font: 14px var(--font-text); }
.hero-quests { margin-top: 10px; }
.hq-face img.av { width: 52px; height: 52px; object-fit: contain; }
.hq-ico { display: inline-flex; align-items: center; justify-content: center; font-size: 20px; }
.hq-ico img.av { width: 2rem; height: 2rem; object-fit: contain; }
.hq-desc { margin: 0; font-size: 15px; color: var(--muted); }
.order-giver.hq-ready { border-color: var(--gold); background: rgba(233,185,73,.08); }
.order-giver.hq-done { opacity: .75; }
.ar-ab.locked { opacity: .55; cursor: not-allowed; }
.ar-ab small { margin-left: 4px; color: var(--gold); font-size: 12px; }
.ar-abdesc small { display: block; margin-top: 6px; color: var(--gold); }
.ar-mv { display: flex; gap: 8px; justify-content: center; }
.ar-q { display: inline-block; min-width: 20px; height: 20px; line-height: 20px; margin-left: 4px; text-align: center; border-radius: 10px; background: #1d150e; border: 1px solid var(--gold); color: var(--gold); font: 700 13px var(--font-title); vertical-align: 1px; }
.ar-duel i { font-style: normal; font-size: 12px; margin-left: 6px; }
.ar-duel i.up { color: var(--good); } .ar-duel i.down { color: var(--bad); }
.ar-log { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; align-items: start; }
.ar-log li { display: grid; grid-template-columns: 36px minmax(0, 1fr) 22px; align-items: center; column-gap: 10px; padding: 8px 10px; border-radius: 8px; background: rgba(0,0,0,.22); border-left: 4px solid var(--good); }
.ar-log li.foe { border-left-color: var(--bad); }
.ar-log li.open { grid-column: 1 / -1; }
.ar-log li > .ab-ico { width: 36px; height: 36px; object-fit: contain; justify-self: center; }
.ar-log .al-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; line-height: 1.2; }
.ar-log .al-when { color: var(--muted); font-size: 13px; }
.ar-log .al-hero { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ar-log .al-hero b { font-family: var(--font-title); }
.ar-log .al-foe { color: var(--bad); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.ar-log .al-ab { color: var(--gold, #e8c56a); overflow-wrap: anywhere; }
.ar-log li > .info-ico { width: 22px; height: 22px; cursor: pointer; justify-self: center; }
.ar-log .al-card { grid-column: 1 / -1; margin-top: 8px; }
.ar-rosterhead { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 1px; }
.ar-roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; } /* remplit toute la largeur (04/12/2026) */
/* Héros disponibles : pastilles identiques (colonnes fixes), nom tronqué, puissance alignée à droite (retouche du 03/12/2026) */
.ar-hero { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 10px; align-items: center;
  width: 100%; min-width: 0; padding: 6px 12px; border-radius: 10px; border: 1px solid var(--border); background: rgba(0,0,0,.25); color: var(--text); cursor: pointer; text-align: left; }
.ar-hero:hover:not(:disabled) { border-color: var(--gold); background: rgba(233,185,73,.12); }
.ar-hero:disabled { opacity: .45; cursor: not-allowed; }
.ar-hero img.av { grid-row: 1 / 3; width: 40px; height: 40px; object-fit: contain; }
.ar-hero b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ar-hero small { display: flex; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ar-hero.in { border-color: var(--gold); background: rgba(233,185,73,.16); }
.ar-hero.in img.av { opacity: .55; }
.ar-hero .ar-in { position: absolute; left: 4px; top: 4px; min-width: 20px; height: 20px; padding: 0 4px; border-radius: 10px; display: grid; place-items: center;
  font-style: normal; font-size: 13px; font-weight: 700; line-height: 1; color: #2a1a08; background: var(--gold, #e0b050); box-shadow: 0 1px 3px rgba(0,0,0,.5); }
.ar-team.ar-mine { grid-auto-rows: minmax(var(--ar-h, 160px), auto); }
@media (max-width: 560px) { .ar-roster { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }
.ar-oppname { font-size: 18px; }
.ar-duels { display: flex; flex-direction: column; gap: 8px; }
.ar-duel { display: grid; grid-template-columns: 1fr 56px 1fr; align-items: center; gap: 10px; padding: 6px 12px; border-radius: 10px; background: rgba(0,0,0,.25); border: 1px solid var(--border); }
.ar-duel.ahead { border-color: rgba(111,191,115,.55); }
.ar-duel.behind { border-color: rgba(217,88,74,.55); }
.ar-duel.win { background: rgba(120,180,90,.18); border-color: rgba(120,180,90,.6); }
.ar-duel.lose { background: rgba(217,88,74,.14); border-color: rgba(217,88,74,.5); }
.ar-last.fresh .ar-duel { animation: ar-in .45s ease both; animation-delay: calc(var(--i) * .35s - var(--ar-el, 0s)); } /* --ar-el : temps déjà écoulé si l'onglet a été reconstruit */
@keyframes ar-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.ar-side { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ar-side.right { justify-content: flex-end; text-align: right; }
.ar-side img.av { width: 44px; height: 44px; object-fit: contain; flex: none; }
.ar-side > span { display: flex; flex-direction: column; min-width: 0; }
.ar-side small { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.ar-side.right small { justify-content: flex-end; }
.ar-vs { text-align: center; font: 700 16px var(--font-title); color: var(--muted); }
.ar-res { height: 40px; width: auto; justify-self: center; }
.ar-res[src$="defaite.png"] { height: 26px; }
.ar-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.ar-gain { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 16px; flex-wrap: wrap; }
.ar-gain-top { display: inline-flex; margin: 0 12px; font-size: 16px; vertical-align: middle; }
.ar-gain .up { color: var(--good); } .ar-gain .down { color: var(--bad); }
.ar-last.won { border-color: rgba(120,180,90,.6); }
.ar-last.lost { border-color: rgba(217,88,74,.5); }
/* Résultat du combat d'arène en fenêtre (au-dessus de .dp-back) */
.dp.ar-fightres { width: min(96vw, 1100px); max-height: 92vh; overflow-y: auto; box-sizing: border-box; background: var(--panel); border-width: 2px; }
.ar-res-head { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; }
.ar-res-foot { justify-content: center; }
/* Rangs : une ligne par palier, colonnes fixes alignées d'un palier à l'autre (en-tête · 8 badges · récompenses) */
.ar-tiers { container-type: inline-size; display: flex; flex-direction: column; }
.ar-tier { display: grid; grid-template-columns: 190px max-content minmax(0, 1fr); align-items: center; gap: 8px 16px; padding: 8px 0; }
.ar-tier + .ar-tier { border-top: 1px solid rgba(255,255,255,.06); }
.ar-tierhead { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ar-tierhead > img { height: 32px; width: 32px; object-fit: contain; flex: none; }
.ar-tiername { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ar-tiername > span { font: 18px var(--font-title); }
.ar-tiername small { font: 14px var(--font-text); }
.ar-ranks { display: grid; grid-template-columns: repeat(8, 58px); gap: 8px; }
.ar-r { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 2px; border-radius: 10px; background: rgba(0,0,0,.22); border: 1px solid var(--border); opacity: .55; }
.ar-r img { height: 42px; width: auto; }
.ar-r small { color: var(--muted); font-size: 13px; white-space: nowrap; }
.ar-tierrew { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.ar-tierrew .ar-rew { display: contents; } /* pastilles renvoyées à la ligne une à une, à la suite de « Fin de saison : » */
.ar-tierrew .oc-rew { padding: 2px 8px; font-size: 15px; }
/* Largeur moyenne : badges à côté de l'en-tête, récompenses dessous (alignées sous les badges) */
@container (max-width: 1150px) {
  .ar-tier { grid-template-columns: 190px minmax(0, 1fr); }
  .ar-tierrew { grid-column: 2; }
}
/* Étroit (téléphone) : en-tête, badges puis récompenses, empilés */
@container (max-width: 720px) {
  .ar-tier { grid-template-columns: minmax(0, 1fr); }
  .ar-tierrew { grid-column: 1; }
  .ar-ranks { grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); }
  .ar-tiername { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 8px; }
}
.ar-r.done { opacity: 1; }
.ar-r.cur { opacity: 1; border-color: var(--gold); background: rgba(233,185,73,.16); }
@media (max-width: 860px) { .ar-head { grid-template-columns: 1fr; } .ar-duel { grid-template-columns: 1fr 44px 1fr; padding: 6px 8px; } }

/* ---------- Salle des trésors (ouverture des sacs de butin) ---------- */
/* Décor : mur sombre, deux piliers à torches (léger balancement façon caméra), piédestal, sac qui flotte.
   Ouverture (.is-open) : le sac tremble (--reveal), éclate (flash, anneaux, rayons) puis les lots jaillissent un à un
   (--step entre deux lots, --fly de vol). Les durées viennent de BAG_ANIM (game.js). */
.bags-dialog {
  width: min(920px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 0; overflow: hidden;
  background: #07060c; color: var(--text); border: 2px solid #6b4a22; border-radius: 12px;
}
.bags-dialog::backdrop { background: rgba(0, 0, 0, .78); }
.bags-room { position: relative; height: min(620px, calc(100vh - 28px)); min-height: 460px; overflow: hidden; isolation: isolate; user-select: none; }
.bags-room.is-open { cursor: pointer; }
.bags-room img { -webkit-user-drag: none; }
.br-wall {
  position: absolute; inset: -40px; z-index: 0;
  background:
    radial-gradient(ellipse at 50% 52%, rgba(120, 100, 200, .38) 0%, rgba(50, 40, 100, .25) 38%, transparent 72%),
    linear-gradient(#1b1733, #0a0814 75%);
  animation: brSway 11s ease-in-out infinite alternate;
}
.br-pillars { position: absolute; inset: 0; z-index: 1; pointer-events: none; animation: brSway 11s ease-in-out infinite alternate; --sway: 26px; }
.br-pillar { position: absolute; bottom: calc(70px + var(--dy, 0px)); height: 74%; }
.br-pillar img { height: 100%; width: auto; display: block; filter: brightness(.5) saturate(.65) sepia(.3) drop-shadow(0 0 18px rgba(0, 0, 0, .8)); }
.br-pillar.l { left: 10%; }
.br-pillar.r { right: 10%; }
.br-pillar.r img { transform: scaleX(-1); }
.flame {
  position: absolute; left: 50%; top: 2px; width: 96px; height: 96px; margin: -92px 0 0 -48px;
  background: url("../img/tresor/flamme.png") 0 0 / 288px 288px no-repeat;
  mix-blend-mode: screen; filter: sepia(1) saturate(8) hue-rotate(-16deg) brightness(1.5);
  animation: brFlame .9s step-end infinite;
}
.br-pillar.r .flame { animation-delay: -.45s; }
.br-light {
  position: absolute; top: 3%; width: 380px; height: 380px; z-index: 1; pointer-events: none; mix-blend-mode: screen;
  background: radial-gradient(circle, rgba(255, 150, 40, .42) 0%, rgba(255, 110, 20, .16) 38%, transparent 66%);
  animation: brFlicker 2.1s ease-in-out infinite alternate;
}
.br-light.l { left: -90px; }
.br-light.r { right: -90px; animation-delay: -1s; }
.br-floor {
  position: absolute; left: 0; right: 0; bottom: 0; height: calc(190px + var(--dy, 0px)); z-index: 1;
  background: radial-gradient(ellipse at 50% 30%, rgba(130, 115, 230, .26), transparent 62%), linear-gradient(rgba(23, 19, 42, 0), #0b0914 70%);
  /* début du sol fondu : aucune arête horizontale entre le mur et le sol */
  -webkit-mask-image: linear-gradient(transparent, #000 45%); mask-image: linear-gradient(transparent, #000 45%);
}
.br-ped { position: absolute; left: 50%; bottom: calc(92px + var(--dy, 0px)); width: 320px; height: 112px; margin-left: -160px; z-index: 2; }
.ped-top {
  position: absolute; left: 0; right: 0; top: 0; height: 70px; border-radius: 50%;
  background: radial-gradient(ellipse at 50% 40%, #6a5a8a 0%, #3a2f55 55%, #241c38 100%);
  border: 3px solid #b8892f; box-shadow: 0 0 0 5px rgba(0, 0, 0, .35), inset 0 -6px 12px rgba(0, 0, 0, .5), 0 0 30px rgba(190, 130, 255, .25);
}
.ped-body {
  position: absolute; left: 12px; right: 12px; top: 35px; height: 74px; z-index: -1;
  background: linear-gradient(90deg, #14101f, #3a2f55 30%, #4a3d68 50%, #3a2f55 70%, #14101f);
  border-radius: 0 0 50% 50% / 0 0 40% 40%; border-bottom: 3px solid #8a6424;
}
.br-stage { position: absolute; left: 50%; bottom: calc(168px + var(--dy, 0px)); width: 0; height: 0; z-index: 3; }
.bag-bag {
  position: absolute; left: 0; bottom: 0; width: clamp(112px, 23vw, 160px); transform: translateX(-50%);
  padding: 0; border: 0; background: none; z-index: 3; cursor: pointer;
}
.bag-bag img {
  display: block; width: 100%; height: auto;
  filter: drop-shadow(0 10px 8px rgba(0, 0, 0, .7)) drop-shadow(0 0 14px rgba(200, 120, 255, .5));
  animation: bagFloat 3.4s ease-in-out infinite;
}
button.bag-bag:hover img, button.bag-bag:focus-visible img { filter: drop-shadow(0 10px 8px rgba(0, 0, 0, .7)) drop-shadow(0 0 22px rgba(255, 210, 120, .85)) brightness(1.12); }
button.bag-bag:focus-visible { outline: none; }
.bag-aura {
  position: absolute; left: -170px; bottom: -70px; width: 340px; height: 340px; pointer-events: none; mix-blend-mode: screen;
  background: radial-gradient(circle, rgba(200, 130, 255, .5) 0%, rgba(140, 80, 220, .22) 40%, transparent 68%);
  animation: bagBreathe 3.4s ease-in-out infinite;
}
.bag-rays, .bag-ring { position: absolute; pointer-events: none; opacity: 0; mix-blend-mode: screen; background-repeat: no-repeat; background-position: center; background-size: contain; }
.bag-rays { left: -280px; bottom: -200px; width: 560px; height: 560px; background-image: url("../img/tresor/eclat.png"); }
.bag-ring { left: -140px; bottom: -60px; width: 280px; height: 280px; background-image: url("../img/tresor/anneau.png"); filter: sepia(1) saturate(5) brightness(1.5); }
.bag-flash {
  position: absolute; inset: 0; z-index: 6; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 50% 56%, #fff 0%, rgba(255, 236, 190, .85) 30%, rgba(255, 200, 120, 0) 72%);
}
.br-loot { position: absolute; left: 50%; top: 4%; transform: translateX(-50%); width: min(96%, 880px); z-index: 5; display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; padding-top: 62px; pointer-events: none; }
.bag-reward {
  position: relative; width: 118px; padding: 8px 6px 7px; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center;
  background: linear-gradient(#43331f, #261c12); border: 2px solid var(--gold); border-radius: 12px;
  box-shadow: 0 0 16px rgba(233, 185, 73, .45), inset 0 0 12px rgba(0, 0, 0, .4);
}
.bag-reward.k-gold { border-color: #ffd34d; }
.bag-reward.k-material { border-color: #c792ea; box-shadow: 0 0 16px rgba(199, 146, 234, .5), inset 0 0 12px rgba(0, 0, 0, .4); }
.bag-reward.k-chest, .bag-reward.k-key, .bag-reward.k-fragment { border-color: #6fd0ff; box-shadow: 0 0 16px rgba(111, 208, 255, .5), inset 0 0 12px rgba(0, 0, 0, .4); }
.bag-reward.has-q { border-color: var(--q); box-shadow: 0 0 16px color-mix(in srgb, var(--q) 50%, transparent), inset 0 0 12px rgba(0, 0, 0, .4); }
.bag-reward .bg-ico { height: 48px; display: flex; align-items: center; justify-content: center; font-size: 38px; line-height: 1; }
.bag-reward .bg-ico img, .bag-reward .bg-ico img.ui-ico { height: 48px; width: auto; max-width: 64px; object-fit: contain; }
.bag-reward b { font-size: 20px; color: var(--gold); line-height: 1.1; }
.bag-reward small { font-size: 12px; color: var(--text); opacity: .85; line-height: 1.15; max-height: 2.3em; overflow: hidden; }
.bag-reward.k-gold::before {
  content: ""; position: absolute; top: -14px; right: -12px; width: 32px; height: 32px;
  background: url("../img/tresor/pieces.png") 0 0 / 96px 96px no-repeat; animation: brCoin .7s step-end infinite;
}
.bg-spk { position: absolute; left: 50%; top: 40%; width: 0; height: 0; pointer-events: none; }
.bg-spk i { position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; background: url("../img/tresor/etoile.png") center / contain no-repeat; opacity: 0; mix-blend-mode: screen; }
.br-title {
  position: absolute; left: -6px; top: 16px; z-index: 7; padding: 6px 30px 7px 22px; text-align: left;
  background: linear-gradient(#f0b24f, #b9701f); border: 2px solid #5a3510; border-left: 0; border-radius: 0 12px 12px 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .45); color: #fff; text-shadow: 0 2px 2px rgba(60, 25, 0, .8);
}
.br-title b { display: block; font-size: 22px; line-height: 1.15; }
.br-title small { display: block; font-size: 14px; line-height: 1.2; color: #ffeccc; }
.br-close { position: absolute; right: 12px; top: 12px; z-index: 8; }
.br-hint {
  position: absolute; left: 12px; right: 12px; bottom: calc(62px + var(--dy, 0px)); z-index: 4; text-align: center; font-size: 18px; line-height: 24px; color: #fff;
  text-shadow: 0 2px 3px #000, 0 0 8px rgba(0, 0, 0, .8); pointer-events: none;
}
.is-idle .br-hint { animation: brPulse 1.8s ease-in-out infinite; }
.br-actions { position: absolute; left: 50%; bottom: calc(62px + var(--dy, 0px)); z-index: 7; transform: translateX(-50%); display: flex; gap: 12px; opacity: 0; pointer-events: none; }
.is-done .br-actions { opacity: 1; pointer-events: auto; transition: opacity .35s .1s; }
.br-bar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 56px; z-index: 7; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 0 12px;
  background: linear-gradient(#2e2213, #17100a); border-top: 2px solid #6b4a22;
}
.br-chip {
  display: flex; align-items: center; gap: 8px; padding: 3px 12px; min-height: 40px; cursor: pointer;
  background: rgba(255, 255, 255, .06); border: 2px solid transparent; border-radius: 10px; color: #fff;
}
.br-chip img { height: 34px; width: auto; display: block; }
.br-chip b { font-size: 18px; line-height: 1; }
.br-chip.none { opacity: .55; }
.br-chip.sel { border-color: var(--gold); background: rgba(233, 185, 73, .18); opacity: 1; }
.br-chip:disabled { cursor: not-allowed; }

/* Phase d'ouverture */
.is-open .bag-bag img { animation: bagShake var(--reveal) ease-in both, bagBurst .38s ease-out var(--reveal) forwards; }
.is-open .bag-aura { animation: auraBuild var(--reveal) ease-in both, auraFade .9s ease-out var(--reveal) forwards; }
.is-open .bag-rays { animation: brRays 1.5s ease-out var(--reveal) forwards; }
.is-open .bag-ring { animation: brRing 1s ease-out var(--reveal) forwards; }
.is-open .bag-ring.r2 { animation-delay: calc(var(--reveal) + 170ms); }
.is-open .bag-flash { animation: brFlash .75s ease-out calc(var(--reveal) - 50ms) forwards; }
.is-open .bag-reward { animation: lootFly var(--fly) cubic-bezier(.2, 1.15, .35, 1) calc(var(--reveal) + var(--i) * var(--step)) both; }
.is-open .bg-spk i { animation: brSpark .85s ease-out calc(var(--reveal) + var(--i) * var(--step) + 520ms) both; }
.is-done .bag-reward { animation: brCardIdle 3s ease-in-out calc(var(--i) * -.6s) infinite alternate; }
.is-done .bg-spk { display: none; }

@keyframes brSway { from { transform: translateX(calc(var(--sway, 12px) * -1)); } to { transform: translateX(var(--sway, 12px)); } }
@keyframes brFlicker { from { opacity: .72; transform: scale(.96); } to { opacity: 1; transform: scale(1.04); } }
@keyframes brFlame {
  0% { background-position: 0 0; } 11.1% { background-position: -96px 0; } 22.2% { background-position: -192px 0; }
  33.3% { background-position: 0 -96px; } 44.4% { background-position: -96px -96px; } 55.5% { background-position: -192px -96px; }
  66.6% { background-position: 0 -192px; } 77.7% { background-position: -96px -192px; } 88.8% { background-position: -192px -192px; }
}
@keyframes brCoin {
  0% { background-position: 0 0; } 11.1% { background-position: -32px 0; } 22.2% { background-position: -64px 0; }
  33.3% { background-position: 0 -32px; } 44.4% { background-position: -32px -32px; } 55.5% { background-position: -64px -32px; }
  66.6% { background-position: 0 -64px; } 77.7% { background-position: -32px -64px; } 88.8% { background-position: -64px -64px; }
}
@keyframes bagFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes bagBreathe { 0%, 100% { opacity: .75; transform: scale(.95); } 50% { opacity: 1; transform: scale(1.06); } }
@keyframes brPulse { 0%, 100% { opacity: .7; } 50% { opacity: 1; } }
@keyframes bagShake {
  0% { transform: translate(0, 0) rotate(0) scale(1); } 14% { transform: translate(-2px, 0) rotate(-3deg) scale(1.02); }
  28% { transform: translate(3px, -2px) rotate(4deg) scale(1.05); } 42% { transform: translate(-4px, 0) rotate(-6deg) scale(1.08); }
  56% { transform: translate(5px, -3px) rotate(8deg) scale(1.11); } 70% { transform: translate(-6px, 0) rotate(-10deg) scale(1.15); }
  84% { transform: translate(7px, -4px) rotate(12deg) scale(1.2); } 100% { transform: translate(0, 0) rotate(0) scale(1.26); }
}
@keyframes bagBurst {
  0% { transform: scale(1.26); opacity: 1; filter: brightness(1); } 35% { transform: scale(1.6); opacity: 1; filter: brightness(3.2); }
  100% { transform: scale(.3); opacity: 0; filter: brightness(4); }
}
@keyframes auraBuild { from { opacity: .6; transform: scale(.9); } to { opacity: 1; transform: scale(1.7); } }
@keyframes auraFade { from { opacity: 1; transform: scale(1.7); } to { opacity: 0; transform: scale(2.4); } }
@keyframes brRays { 0% { opacity: 0; transform: scale(.2) rotate(0); } 18% { opacity: 1; } 100% { opacity: 0; transform: scale(2) rotate(60deg); } }
@keyframes brRing { 0% { opacity: .95; transform: scale(.2); } 100% { opacity: 0; transform: scale(3.6); } }
@keyframes brFlash { 0% { opacity: 0; } 22% { opacity: 1; } 100% { opacity: 0; } }
@keyframes lootFly {
  0% { opacity: 0; transform: translate(var(--sx), 150px) scale(.15) rotate(-28deg); }
  8% { opacity: 1; }
  55% { transform: translate(calc(var(--sx) * .2), -30px) scale(1.2) rotate(5deg); }
  78% { transform: translate(0, 6px) scale(.95) rotate(-1deg); }
  100% { opacity: 1; transform: translate(0, 0) scale(1) rotate(0); }
}
@keyframes brSpark {
  0% { opacity: 0; transform: rotate(var(--a)) translateX(0) scale(.2); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--a)) translateX(var(--d)) scale(1.3); }
}
@keyframes brCardIdle { from { transform: translateY(0); } to { transform: translateY(-5px); } }
@media (max-width: 640px) {
  .bag-reward { width: 96px; }
  .bag-reward .bg-ico, .bag-reward .bg-ico img { height: 38px; font-size: 30px; }
  .br-pillar { height: 58%; }
  .br-title b { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .br-wall, .br-pillars, .bag-bag img, .flame, .bag-aura, .br-light { animation: none; }
}

/* ---------- Salle des trésors : aperçu « Contenu possible » (#loot-dialog, renderLootDialog, 05/12/2026) ---------- */
.br-peek {
  position: absolute; left: 12px; top: 84px; z-index: 7; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px 0 6px; cursor: pointer;
  background: linear-gradient(#3a2a16, #1e150b); border: 2px solid #b8892f; border-radius: 18px; color: #fff; font: 16px var(--font-text); line-height: 1;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .55);
}
.br-peek img { width: 26px; height: 26px; object-fit: contain; display: block; }
.br-peek span { padding-top: 1px; }
.br-peek:hover, .br-peek:focus-visible { border-color: #ffd36b; box-shadow: 0 0 12px rgba(255, 210, 120, .7); outline: none; }
dialog#loot-dialog { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: none; color: inherit; overflow: visible; }
dialog#loot-dialog::backdrop { background: none; }
.lp-back { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); }
.lp {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); box-sizing: border-box;
  width: min(620px, calc(100vw - 16px)); height: min(700px, calc(100dvh - 24px));
  display: flex; flex-direction: column; border: 0; border-radius: 18px; background: #fdeecc; color: #3a2412;
  font: 16px var(--font-text); box-shadow: 0 10px 40px rgba(0, 0, 0, .6); overflow: hidden;
}
.lp-head { flex: none; display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px; background: #f4dca6; }
.lp-head > img { width: 52px; height: 52px; object-fit: contain; flex: none; }
.lp-id { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lp-id b { font-family: var(--font-title), serif; font-size: 22px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-id small { font-size: 16px; line-height: 1.2; color: #6b4a22; }
.lp-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 16px 12px; overscroll-behavior: contain; }
.lp-sec { margin-top: 12px; }
.lp-sec h4 { margin: 0 0 6px; font-size: 17px; color: #6b3a10; }
.lp-row, .lp-item { display: grid; align-items: center; gap: 8px; min-height: 40px; padding: 2px 8px; border-radius: 10px; }
.lp-row { grid-template-columns: 32px minmax(0, 1fr) auto 8.4em 4.4em; }
.lp-pct { justify-self: end; text-align: right; white-space: nowrap; font-size: 15px; font-variant-numeric: tabular-nums; color: #5a3a1b; }
.lp-row:nth-of-type(odd), .lp-item:nth-child(odd) { background: rgba(110, 92, 58, .1); }
.lp-ico { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; font-size: 24px; line-height: 1; }
.lp-ico img { max-width: 32px; max-height: 32px; width: auto; height: auto; margin: 0; object-fit: contain; }
.lp-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-name .lp-wrap { display: block; white-space: normal; line-height: 1.2; padding: 3px 0; } /* ligne regroupée des matériaux : sur deux lignes au besoin */
.lp-name .lp-sub { display: block; font-size: 13px; line-height: 1.15; color: #6b4a22; overflow: hidden; text-overflow: ellipsis; } /* « selon le donjon tiré » sous l'or */
.lp .qname { color: color-mix(in srgb, var(--q) 58%, #2a160a); font-weight: bold; }
.lp-qty { justify-self: end; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lp-rar { justify-self: stretch; text-align: center; padding: 4px 6px 3px; border-radius: 12px; font-size: 14px; line-height: 1.15; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-rar.r-sure { background: #2f7a4f; }
.lp-rar.r-common { background: #7a6a52; }
.lp-rar.r-uncommon { background: #3f8a3a; }
.lp-rar.r-rare { background: #2f6fa8; }
.lp-rar.r-vrare { background: #7a3fb8; }
.lp-rar.r-except { background: #b8501f; }
.lp-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 8px; }
.lp-item { grid-template-columns: 32px minmax(0, 1fr) 2.2em; }
.lp-item:nth-child(odd) { background: none; }
.lp-item:nth-child(4n + 1), .lp-item:nth-child(4n + 2) { background: rgba(110, 92, 58, .1); }
.lp-note { margin: 6px 0 0; font-size: 14px; line-height: 1.3; color: #6b4a22; }
.lp-foot { flex: none; padding: 8px 16px 10px; font-size: 14px; line-height: 1.3; color: #6b4a22; background: #f4dca6; }
@media (max-width: 560px) {
  .lp-items { grid-template-columns: minmax(0, 1fr); }
  .lp-item:nth-child(n) { background: none; }
  .lp-item:nth-child(odd) { background: rgba(110, 92, 58, .1); }
  /* Téléphone : nom sur toute la largeur, puis quantité, rareté et pourcentage dessous (les longues fourchettes d'or n'écrasent plus le nom) */
  .lp-row { grid-template-columns: 30px minmax(0, 1fr) 6.4em 4em; grid-template-areas: "ico name name name" "qty qty rar pct"; gap: 2px 6px; padding: 4px 6px; }
  .lp-row > .lp-ico { grid-area: ico; } .lp-row > .lp-name { grid-area: name; } .lp-row > .lp-qty { grid-area: qty; }
  .lp-row > .lp-rar, .lp-row > .lp-gap { grid-area: rar; } .lp-row > .lp-pct { grid-area: pct; }
  .lp-row > .lp-qty { white-space: normal; min-width: 0; line-height: 1.2; } .lp-row > .lp-name { line-height: 1.25; } .lp-nw { white-space: nowrap; display: inline-block; }
  .lp-rar { font-size: 12.5px; padding: 4px 3px 3px; }
  .lp-pct { font-size: 13.5px; }
  .lp-ico { width: 30px; height: 30px; }
  .lp-ico img { max-width: 30px; max-height: 30px; }
  .lp-body { padding: 4px 10px 10px; }
  .br-peek { top: 76px; left: 8px; height: 34px; }
}

/* ---------- Salle des trésors : coffres, clés, flèches (d'après la vidéo de l'utilisateur) ---------- */
.bag-bag.chest { width: clamp(130px, 25vw, 200px); }
.bag-bag.chest img { filter: drop-shadow(0 10px 8px rgba(0, 0, 0, .7)) drop-shadow(0 0 16px rgba(255, 170, 60, .4)); }
.bags-room:not(.is-open) .bag-bag.chest img { animation: chestIdle 3.6s ease-in-out infinite; }
.bag-bag.chest.locked img { filter: drop-shadow(0 10px 8px rgba(0, 0, 0, .7)) brightness(.65) saturate(.7); animation: none !important; }
.is-chest .bag-aura { background: radial-gradient(circle, rgba(255, 190, 90, .45) 0%, rgba(220, 130, 40, .2) 40%, transparent 68%); }
.br-key {
  position: absolute; left: calc(50% + clamp(92px, 17vw, 150px)); bottom: calc(176px + var(--dy, 0px)); z-index: 4; display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  padding: 0; border: 0; background: none; color: #fff; cursor: pointer; text-align: left;
}
.br-key:disabled { cursor: default; }
.bk-ring {
  width: 66px; height: 66px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle, rgba(20, 70, 40, .85) 0%, rgba(8, 30, 18, .9) 70%); border: 3px solid #3fe08a;
  box-shadow: 0 0 14px rgba(63, 224, 138, .8), inset 0 0 12px rgba(63, 224, 138, .5); animation: keyPulse 1.8s ease-in-out infinite;
}
.bk-ring img { width: 40px; height: 40px; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .7)); }
.br-key:hover .bk-ring, .br-key:focus-visible .bk-ring { transform: scale(1.08); }
.br-key:focus-visible { outline: none; }
.bk-txt { display: flex; flex-direction: column; gap: 1px; text-shadow: 0 2px 3px #000, 0 0 8px rgba(0, 0, 0, .8); }
.bk-txt b { font-size: 16px; line-height: 1.15; }
.bk-txt small { font-size: 14px; line-height: 1.15; color: #7dffb0; }
.br-key.off .bk-ring { border-color: #6a6a6a; box-shadow: none; animation: none; background: rgba(30, 30, 30, .8); }
.br-key.off .bk-ring img { filter: grayscale(1) brightness(.7); }
.br-key.off .bk-txt small { color: #bbb; }
.br-gems {
  position: absolute; right: 62px; top: 14px; z-index: 8; display: flex; align-items: center; gap: 6px; padding: 3px 14px 3px 10px; height: 32px;
  background: linear-gradient(#17283f, #0d1625); border: 2px solid #4b6a95; border-radius: 16px; color: #fff; font-size: 16px;
}
.br-gems img.ui-ico { height: 22px; margin: 0; }
.br-arrow {
  position: absolute; top: 44%; z-index: 7; width: 52px; height: 64px; padding: 0; border: 0; background: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: transform .15s;
}
.br-arrow.l { left: 8px; } .br-arrow.r { right: 8px; }
.br-arrow img { width: 40px; height: auto; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .8)); }
.br-arrow:hover img { filter: drop-shadow(0 0 10px rgba(255, 210, 120, .9)); }
.br-arrow.l:hover { transform: translateX(-3px); } .br-arrow.r:hover { transform: translateX(3px); }
.br-bar { overflow-x: auto; justify-content: safe center; scrollbar-width: none; }
.br-bar::-webkit-scrollbar { display: none; }
.br-chip { flex: 0 0 auto; padding: 3px 9px; gap: 5px; }
.br-chip img.kk { height: 24px; margin-left: 4px; }
/* Salle des trésors (pas la Roulette) : tous les sacs et coffres visibles, en grille sur plusieurs lignes.
   --dy = hauteur ajoutée à la barre : la fenêtre grandit et le décor remonte d'autant. */
@media (min-width: 641px) {
  .bags-room:not(.rl-room) { --dy: 48px; height: min(668px, calc(100vh - 28px)); }
  .bags-room:not(.rl-room) .br-bar { display: grid; grid-template-columns: repeat(6, minmax(max-content, 1fr)); gap: 8px; height: calc(56px + var(--dy)); align-content: center; overflow: visible; }
  .bags-room:not(.rl-room) .br-chip { justify-content: center; min-width: 0; padding: 0 4px; gap: 4px; }
  .bags-room:not(.rl-room) .br-chip img { height: 30px; max-width: 38px; object-fit: contain; }
  .bags-room:not(.rl-room) .br-chip img.kk { height: 22px; margin-left: 2px; }
  .bags-room:not(.rl-room) .br-chip b { font-size: 16px; }
}
@media (min-width: 641px) and (max-width: 899px) {
  .bags-room:not(.rl-room) { --dy: 96px; height: min(716px, calc(100vh - 28px)); }
  .bags-room:not(.rl-room) .br-bar { grid-template-columns: repeat(4, minmax(max-content, 1fr)); }
}
@keyframes chestIdle { 0%, 100% { filter: drop-shadow(0 10px 8px rgba(0, 0, 0, .7)) drop-shadow(0 0 12px rgba(255, 170, 60, .3)); } 50% { filter: drop-shadow(0 10px 8px rgba(0, 0, 0, .7)) drop-shadow(0 0 24px rgba(255, 190, 90, .7)) brightness(1.06); } }
@keyframes keyPulse { 0%, 100% { box-shadow: 0 0 10px rgba(63, 224, 138, .6), inset 0 0 10px rgba(63, 224, 138, .4); } 50% { box-shadow: 0 0 22px rgba(63, 224, 138, 1), inset 0 0 14px rgba(63, 224, 138, .7); } }
@media (max-width: 640px) { .br-key { left: calc(50% + 84px); bottom: 190px; } .bk-ring { width: 54px; height: 54px; } .bk-ring img { width: 32px; height: 32px; } .br-arrow { width: 36px; } .br-arrow img { width: 28px; } }

/* ---------- Roulette (même salle que les sacs : .bags-room, fond .br-wall) ---------- */
.rl-room .br-wall, .rl-room .br-light { animation-play-state: running; }
.rl-box { position: absolute; left: 50%; top: 82px; width: min(330px, 56vh); aspect-ratio: 1; transform: translateX(-50%); z-index: 3; }
.rl-wheel {
  position: absolute; inset: 0; border-radius: 50%; border: 8px solid #b8892f;
  box-shadow: 0 0 0 4px #5a3510, 0 10px 24px rgba(0, 0, 0, .7), 0 0 36px rgba(255, 200, 90, .28), inset 0 0 22px rgba(0, 0, 0, .55);
  will-change: transform;
}
.rl-lines { position: absolute; inset: 0; border-radius: 50%; background: repeating-conic-gradient(from 0deg, rgba(0, 0, 0, .55) 0 1.4deg, transparent 1.4deg 30deg); pointer-events: none; }
.rl-ico {
  position: absolute; left: 50%; top: 50%; width: 15%; aspect-ratio: 1; margin: -7.5% 0 0 -7.5%;
  transform: rotate(var(--a)) translateY(-205%) rotate(calc(var(--a) * -1));
}
.rl-ico img { width: 100%; height: 100%; object-fit: contain; display: block; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .75)); }
.rl-hub {
  position: absolute; left: 50%; top: 50%; width: 21%; aspect-ratio: 1; margin: -10.5% 0 0 -10.5%; border-radius: 50%; z-index: 2;
  background: radial-gradient(circle at 40% 35%, #f6d27a, #b8892f 60%, #6d4a14); border: 3px solid #5a3510; box-shadow: 0 3px 8px rgba(0, 0, 0, .6);
  display: flex; align-items: center; justify-content: center;
}
.rl-hub img { width: 80%; height: auto; display: block; }
.rl-arrow { position: absolute; left: 50%; top: -34px; width: 42px; height: auto; margin-left: -21px; z-index: 4; transform: scaleY(-1); filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .7)); }
.rl-streak {
  position: absolute; left: 12px; top: 84px; z-index: 6; max-width: 210px; display: flex; align-items: center; gap: 8px; padding: 6px 10px;
  background: rgba(14, 11, 24, .78); border: 1px solid rgba(233, 185, 73, .5); border-radius: 12px;
}
.rl-streak img { width: 38px; height: auto; flex: none; }
.rl-streak b { display: block; font-size: 17px; color: var(--gold); line-height: 1.2; }
.rl-streak small { display: block; font-size: 12px; line-height: 1.25; color: var(--text); opacity: .9; }
.rl-result { position: absolute; left: 50%; bottom: 66px; z-index: 5; transform: translateX(-50%); width: min(96%, 760px); display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; pointer-events: none; }
.rl-room .bag-reward { animation: rlPop .55s cubic-bezier(.2, 1.3, .4, 1) calc(var(--i) * 140ms) both; }
.rl-room.rl-shown .bag-reward { animation: none; }
.rl-room .br-hint { bottom: 70px; }
.rl-bar { gap: 18px; }
.rl-info { display: inline-flex; align-items: center; gap: 6px; color: #fff; font-size: 15px; }
.rl-info b { color: var(--gold); font-size: 18px; }
.rl-info img.ui-ico { width: 30px; height: auto; }
.rl-room.is-spin { cursor: pointer; }
@keyframes rlPop { 0% { opacity: 0; transform: translateY(40px) scale(.4); } 70% { opacity: 1; transform: translateY(-6px) scale(1.08); } 100% { opacity: 1; transform: none; } }
@media (max-width: 640px) {
  .rl-streak { top: 76px; max-width: 150px; }
  .rl-streak small { display: none; }
}
img.ui-ico.frag { height: 1.3em; width: auto; vertical-align: -0.25em; margin: 0 1px; }
.plan-total { margin: 6px 0 10px; }
.plan-total b { color: var(--gold); }

/* Matériaux de donjon du Stock */
.stock-mats .mats { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin-top: 8px; }
.stock-mats .qsection { margin-top: 10px; }
/* Titre « Matériaux de donjon » cliquable (replier / déplier) : même apparence que les autres titres de section */
.qsection.qs-fold { width: 100%; background: none; border: 0; padding: 0; font-family: inherit; line-height: inherit; cursor: pointer; }
.qsection.qs-fold:hover, .qsection.qs-fold:focus-visible { color: var(--text); }
.qs-fold .qs-arrow { font-size: 10px; margin-left: -4px; }
.stock .panel-head { margin-bottom: 8px; }
.inventory[hidden], .stock-mats[hidden] { display: none; }

/* Recettes favorites */
.fav-btn { background: none; border: 0; padding: 0 6px 0 0; margin: 0; font-size: 20px; line-height: 1; color: #8a7a5a; cursor: pointer; vertical-align: -1px; }
.fav-btn:hover { color: var(--gold); }
.fav-btn.on { color: var(--gold); text-shadow: 0 0 6px rgba(233, 185, 73, .7); }
.cat-tab.fav-tab .tile-img { width: 100%; height: 100%; object-fit: contain; }
.cat-tab.fav-tab:not(.sel) .tile-img { filter: saturate(.85) brightness(.92); }
.board-table .rk-ico { height: 34px; width: auto; display: block; margin: 0 auto; }

/* Stock possédé entre parenthèses (vert si suffisant, rouge s'il manque : hérite de .cost.lack) */
.cost .have { color: var(--good, #7bd88f); font-weight: 700; }
.cost.lack .have { color: var(--bad); }

/* Boutons de l'en-tête (classement, profil, langue, sauvegarde, remise à zéro) : même hauteur que les cellules or / énergie / gemmes (36 px) */
.hud .btn.small { height: 36px; min-height: 36px; min-width: 46px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; line-height: 1; }
.hud .btn.small img.ui-ico { height: 26px; width: auto; margin: 0; vertical-align: middle; }

/* Qualité d'un objet demandé ou offert : nom de l'objet dans la couleur de la qualité (plus de pastille) */
.qname { font-weight: 700; text-shadow: 0 1px 1px rgba(0, 0, 0, .5); }

.qwant { font-size: 13px; color: var(--q, var(--text)); align-self: center; margin-right: 4px; }
.qchip small { margin-left: 4px; color: var(--good, #7bd88f); }

/* Niveau d'un héros : écusson rouge (img/ui/niveau_heros.png, de level_heroes_empty) avec le nombre au centre */
.hrow .lvl-badge { margin-left: auto; flex: 0 0 auto; position: relative; width: 44px; height: 46px; background: url("../img/ui/niveau_heros.png") center / contain no-repeat; display: flex; align-items: center; justify-content: center; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .5)); }
.lvl-badge b { color: #fff; font-family: var(--font-title); font-size: 20px; line-height: 1; padding-bottom: 2px; text-shadow: -1px -1px 0 #3a0c0c, 1px -1px 0 #3a0c0c, -1px 1px 0 #3a0c0c, 1px 1px 0 #3a0c0c, 0 2px 0 #3a0c0c; }
.lvl-badge.d2 b { font-size: 18px; } .lvl-badge.d3 b { font-size: 14px; }

/* « NIVEAU MAX » sous le héros au niveau maximum : lettres jaune-orangé, contour brun (deux calques superposés) */
.lvl-max { text-align: center; padding: 2px 0 4px; }
.lvl-max .lm, .lm.sm { display: inline-grid; font-family: var(--font-title); font-size: 24px; line-height: 1.1; letter-spacing: .5px; filter: drop-shadow(0 2px 0 #3a1204); }
.lvl-max .lm i, .lm.sm i { grid-area: 1 / 1; font-style: normal; }
.lvl-max .lm-out, .lm.sm .lm-out { -webkit-text-stroke: 6px #6b1f0a; color: #6b1f0a; }
.lvl-max .lm-in, .lm.sm .lm-in { background: linear-gradient(#fff36b 15%, #ffc41f 55%, #ff8a14); -webkit-background-clip: text; background-clip: text; color: transparent; }

.lm.sm { font-size: 17px; }
.lm.sm .lm-out { -webkit-text-stroke: 5px #6b1f0a; }

/* Fenêtre des paliers (#prog-modal) : <dialog> plein écran, sans le style par défaut du navigateur */
dialog#prog-modal { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: none; color: inherit; overflow: visible; }
dialog#prog-modal::backdrop { background: none; }
.pr-name img.info-ico { width: 22px; height: 22px; margin-left: 6px; vertical-align: -5px; }

/* Onglets de la fenêtre Plans (trois lignes et « Mes plans »), de bord à bord */
.plan-tabs { display: grid; grid-template-columns: 1fr 1fr 1.25fr 1fr; gap: 8px; margin: 6px 0; }
.plan-tabs .btn { justify-content: center; white-space: nowrap; }

/* Fenêtre « Plans » (renderPlansDialog, game.js) : même habillage que la fenêtre Options (crème, ou brun avec « Fenêtres sombres »),
   taille fixe quel que soit l'onglet, seule la liste défile. Lignes en colonnes fixes : icône, nom, niveau, coût, info, action / état.
   Les lignes verrouillées gardent leur texte plein (seule l'image est estompée). */
#plans-dialog {
  --pl-bg: #fdeecc; --pl-ink: #3a2412; --pl-muted: #6b4c2c; --pl-accent: #8a5a10; --pl-ko: #a82a1c;
  --pl-card: rgba(214, 190, 140, .28); --pl-done: rgba(90, 160, 70, .2); --pl-sel: #f7dc97; --pl-bar: #b98d45;
  width: min(880px, calc(100vw - 32px)); height: min(900px, calc(100dvh - 32px)); max-height: none; padding: 20px; overflow: hidden;
  border: 0; border-radius: 18px; background: var(--pl-bg); color: var(--pl-ink); box-shadow: 0 10px 40px rgba(0, 0, 0, .6); font-size: 16px;
}
html.dark-win #plans-dialog {
  --pl-bg: var(--dw-bg); --pl-ink: var(--dw-ink); --pl-muted: #c4ae8e; --pl-accent: var(--dw-accent); --pl-ko: var(--dw-ko);
  --pl-card: var(--dw-card); --pl-done: rgba(120, 190, 90, .16); --pl-sel: var(--dw-band); --pl-bar: #a07a3c; color-scheme: dark;
}
#plans-dialog .save-box { max-width: none; height: 100%; display: flex; flex-direction: column; gap: 12px; }
#plans-dialog .save-box > * { flex: none; margin: 0; }
#plans-dialog .save-box > .plans-list { flex: 1; min-height: 0; max-height: none; gap: 4px; padding-right: 8px; scrollbar-gutter: stable; scrollbar-color: var(--pl-bar) transparent; }
#plans-dialog .muted { color: var(--pl-muted); }
#plans-dialog .small-text { font-size: 16px; line-height: 1.35; }
#plans-dialog .plan-total { font-size: 18px; }
#plans-dialog .plan-total b { color: var(--pl-accent); }
#plans-dialog .plan-tabs .btn { font-size: 17px; min-height: 40px; }
#plans-dialog .plan-tabs .btn small { font-size: 16px; }
.plan-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) 76px 92px 28px 224px; align-items: center; gap: 12px; min-height: 48px; flex: none; padding: 4px 12px; background: var(--pl-card); border-radius: 10px; }
.plan-row.done { background: var(--pl-done); }
.plan-row.ready { background: var(--pl-sel); }
.plan-row .pr-ico { display: flex; align-items: center; justify-content: center; }
.plan-row .pr-ico img.ii { width: 36px; height: 36px; object-fit: contain; margin: 0; }
.plan-row .pr-name { font-size: 17px; line-height: 1.2; overflow-wrap: anywhere; }
.plan-row .pr-lvl, .plan-row .pr-cost { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.plan-row .pr-lvl { color: var(--pl-muted); }
.plan-row .pr-lvl.low { color: var(--pl-ko); }
.plan-row .pr-cost { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.plan-row .pr-cost img { height: 1.2em; width: auto; }
.plan-row .pr-info { display: flex; justify-content: center; }
.plan-row .pr-info img.info-ico { margin: 0; }
.plan-row .pr-act { display: flex; justify-content: flex-end; text-align: right; }
.plan-row .pr-act small { font-size: 16px; line-height: 1.2; }
.plan-row.wait .pr-name, .plan-row.nokeys .pr-name, .plan-row.wait .pr-cost, .plan-row.nokeys .pr-cost { color: var(--pl-muted); }
.plan-row.wait .pr-ico img, .plan-row.nokeys .pr-ico img { opacity: .5; }
/* Onglet « Mes plans » (ownedPlansHtml) : section (cadeaux, achetés, fragments), groupe, lignes */
#plans-dialog .po-sec { display: flex; flex: none; justify-content: space-between; align-items: center; gap: 12px; margin: 12px 0 4px; padding: 8px 12px; font-size: 19px; border-radius: 10px; background: var(--pl-sel); color: inherit; }
#plans-dialog .po-sec:first-child { margin-top: 0; }
#plans-dialog .po-sec.gift { background: var(--pl-done); }
#plans-dialog .po-sec span { display: flex; align-items: center; gap: 8px; min-width: 0; }
#plans-dialog .po-sec img { height: 1.4em; width: auto; margin: 0; }
#plans-dialog .po-grp { display: flex; flex: none; justify-content: space-between; gap: 12px; padding: 8px 12px 4px; font-size: 17px; }
#plans-dialog .po-grp small { font-size: 16px; color: var(--pl-muted); margin-left: 8px; }
#plans-dialog .po-grp > b, #plans-dialog .po-sec > b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.plan-row.own { grid-template-columns: 40px minmax(0, 1fr) 62px 84px 28px 272px; min-height: 50px; }
html:not(.tel) .plan-row.own { padding-block: 2px; } html:not(.tel) .plan-row.own .po-name { padding: 2px 0; }
.plan-row .po-name { appearance: none; padding: 4px 0; border: 0; background: none; box-shadow: none; color: inherit; font: inherit; font-size: 17px; text-align: left; overflow-wrap: break-word; cursor: pointer; }
.plan-row .po-name:hover { text-decoration: underline; }
.plan-row.own .pr-ico { cursor: pointer; }
.plan-row .po-ok { color: var(--pl-accent); }
.plan-row .po-ko { color: var(--pl-ko); }
.plan-row .po-ko img { height: 1.3em; width: auto; vertical-align: middle; }
#plans-dialog .po-empty { margin: auto; padding: 24px; max-width: 480px; text-align: center; font-size: 17px; }
img.ui-ico.lineico { height: 1.2em; width: auto; vertical-align: -0.2em; margin-right: 2px; filter: brightness(0) invert(1) drop-shadow(0 1px 1px rgba(0, 0, 0, .5)); }


/* Héros bloqué par le niveau de son bâtiment */
.lvl-cap { margin: 6px 0; padding: 5px 8px; text-align: center; font-size: 13px; line-height: 1.3; color: #ffd9a0; background: rgba(233, 150, 49, .14); border: 1px solid rgba(233, 150, 49, .55); border-radius: 8px; }
.lvl-cap b { color: var(--gold); }


/* Emplacements d'équipement des héros, d'après la maquette : icônes blanches cernées de brun (l'or reste réservé à la catégorie préférée quand
   un emplacement en accepte plusieurs), libellé plus gros et plus lisible, contour brun épais */
.hcard { container-type: inline-size; }
.hcard-icons[data-n] .htype.dim { opacity: .85; }
.hcard-icons[data-n="1"] .htype { width: 46cqw; height: 46cqw; }
.hcard-icons[data-n="2"] .htype { width: 36cqw; height: 36cqw; }
.hcard-icons[data-n="1"] { grid-template-columns: 46cqw; }
.hcard-icons[data-n="2"] { grid-template-columns: repeat(2, 36cqw); }
.hcard-label { font-size: 25cqw; letter-spacing: 0; font-weight: 400;
  text-shadow: -2px -2px 0 #4a2a10, 2px -2px 0 #4a2a10, -2px 2px 0 #4a2a10, 2px 2px 0 #4a2a10, 0 -2px 0 #4a2a10, 0 2px 0 #4a2a10, -2px 0 0 #4a2a10, 2px 0 0 #4a2a10, 0 3px 0 #4a2a10; }
.hcard.dark .hcard-label { font-size: 17cqw; }

/* Pastille de casse : petit rectangle (et non plus une pilule) pour que « 63 % » tienne sans déborder ; posé dans l'angle haut-gauche de la carte */
.hcard-break { top: 7%; left: 7%; padding: 1px 4px 2px; border-radius: 4px; border-width: 1.5px; font-size: 11.5px; line-height: 1.1; min-width: 2.6em; text-align: center;
  background: linear-gradient(rgba(52, 30, 12, .95), rgba(30, 17, 7, .95)); box-shadow: 0 1px 0 rgba(0, 0, 0, .6), inset 0 0 0 1px rgba(255, 255, 255, .08); }
.hcard-break { top: 5%; left: 8%; font-size: 11px; padding: 0 4px 1px; }
.hcard.full { padding-top: 29%; gap: 2px; }

/* ---------- Emplacement d'expédition terminé (clic = récupérer les gains) ---------- */
.slot-tile.done { cursor: pointer; background: linear-gradient(#ffd25a, #e08a12); border-color: #fff1b0; gap: 2px; animation: slotDone 1.2s ease-in-out infinite; }
.slot-tile.done:hover { filter: brightness(1.1); transform: translateY(-2px); }
.slot-tile.done:active { transform: translateY(1px); }
.slot-tile.done .slot-txt { font-size: 19px; -webkit-text-stroke: 5px #7a3a06; }
@keyframes slotDone {
  0%, 100% { box-shadow: 0 0 0 3px #4a2411, 0 4px 8px rgba(0, 0, 0, .55), 0 0 6px 1px rgba(255, 210, 90, .5), inset 0 0 0 2px rgba(255, 255, 255, .35); }
  50% { box-shadow: 0 0 0 3px #4a2411, 0 4px 8px rgba(0, 0, 0, .55), 0 0 22px 8px rgba(255, 210, 90, .95), inset 0 0 0 2px rgba(255, 255, 255, .35); }
}
@media (prefers-reduced-motion: reduce) { .slot-tile.done { animation: none; } }
/* Retour éclair (talent ex-Soigneur, 06/12/2026) : groupe rentré dès le départ ; teinte plus claire et reflet qui balaie la tuile */
.slot-tile.done.flash { background: linear-gradient(#fff2a8, #f2b13a); overflow: hidden; }
.slot-tile.done.flash .slot-txt { font-size: 13px; white-space: nowrap; letter-spacing: -.2px; -webkit-text-stroke: 3.5px #7a3a06; }
.slot-tile.done.flash::after, .xt.done.flash::after { content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .75) 50%, transparent 65%) no-repeat; background-size: 250% 100%; animation: flashSweep 2.4s ease-in-out infinite; }
@keyframes flashSweep { 0% { background-position: 130% 0; } 55%, 100% { background-position: -130% 0; } }
@media (prefers-reduced-motion: reduce) { .slot-tile.done.flash::after, .xt.done.flash::after { animation: none; opacity: 0; } }

/* ---------- Fin de donjon : célébration et loteries des héros (renderFete) ---------- */
/* --intro : arrivée du titre ; chaque héros (--d) lance sa loterie (--spin), puis son lot apparaît et ses bonus jaillissent (--bonus chacun).
   .skip (clic ou fin) : tout passe à l'état final. Durées : FETE_ANIM (game.js). */
.fete-dialog {
  width: min(1100px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 0; overflow: hidden;
  background: #0b0810; color: var(--text); border: 2px solid #e0a82e; border-radius: 12px;
  /* Cadre doré (exception voulue à « pas de traits sur les bords ») : liseré sombre extérieur, halo doré, ombre portée */
  box-shadow: 0 0 0 2px #3a2208, 0 0 0 3px rgba(255, 214, 120, .35), 0 0 28px rgba(233, 185, 73, .3), 0 24px 70px rgba(0, 0, 0, .9);
}
/* Second liseré intérieur, fixe (ne défile pas avec le contenu) */
.fete-dialog::after {
  content: ''; position: absolute; inset: 3px; z-index: 5; pointer-events: none;
  border: 1px solid rgba(255, 226, 150, .45); border-radius: 8px; box-shadow: inset 0 0 18px rgba(0, 0, 0, .6);
}
.fete-dialog::backdrop { background: rgba(0, 0, 0, .85); }
.fete { position: relative; display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 22px 16px 18px; min-height: 460px; overflow: hidden auto; max-height: calc(100vh - 28px); box-sizing: border-box; isolation: isolate; }
.fete[data-action] { cursor: pointer; }
/* Fond flouté dans le cadre (inset 0, sans transform) : un débord créait une barre de défilement inutile */
.fe-bg { position: absolute; inset: 0; z-index: -3; background: center / cover no-repeat; filter: blur(14px) brightness(.35) saturate(1.2); }
.fe-rays {
  position: absolute; z-index: -2; left: 50%; top: 70px; width: 720px; height: 720px; margin: -360px 0 0 -360px;
  background: url("../img/tresor/eclat.png") center / contain no-repeat; mix-blend-mode: screen; opacity: 0;
  animation: feRaysIn var(--intro) ease-out both, feRaysTurn 24s linear infinite;
}
.fete.is-lose .fe-rays { display: none; }
.fe-coins { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.fe-coins i {
  position: absolute; left: var(--x); top: -40px; width: 30px; height: 30px; transform: scale(var(--s));
  background: url("../img/tresor/pieces.png") 0 0 / 90px 90px no-repeat; opacity: 0;
  animation: feCoin var(--f) linear calc(var(--intro) * .4 + var(--t)) 2 both, feCoinSpin .6s step-end infinite;
}
.fe-head { position: relative; display: flex; align-items: center; gap: 16px; animation: fePop var(--intro) cubic-bezier(.2, 1.4, .4, 1) both; }
.fe-zone { width: 110px; height: 110px; object-fit: contain; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .8)); }
.fe-txt { display: flex; flex-direction: column; gap: 6px; }
.fe-title { font: 40px/1 var(--font-title), serif; color: #ffe08a; -webkit-text-stroke: 6px #5a2a06; paint-order: stroke fill; letter-spacing: .5px; text-shadow: 0 4px 6px rgba(0, 0, 0, .7); }
.fete.is-lose .fe-title { color: #e6d6c0; -webkit-text-stroke-color: #3a2a1c; }
.fe-txt small { font-size: 16px; color: #f5e6c8; text-shadow: 0 1px 2px #000; }
.fe-stars { position: absolute; inset: -18px -30px; pointer-events: none; }
.fe-stars i {
  position: absolute; width: 26px; height: 26px; background: url("../img/tresor/etoile.png") center / contain no-repeat; mix-blend-mode: screen; opacity: 0;
  animation: feTwinkle 1.6s ease-in-out calc(var(--intro) + var(--k) * 260ms) infinite both;
}
.fe-stars i:nth-child(1) { left: 0; top: 10%; } .fe-stars i:nth-child(2) { left: 24%; top: -6%; } .fe-stars i:nth-child(3) { right: 18%; top: -10%; }
.fe-stars i:nth-child(4) { right: 0; top: 30%; } .fe-stars i:nth-child(5) { right: 30%; bottom: -8%; } .fe-stars i:nth-child(6) { left: 12%; bottom: -4%; }

/* Tous les héros sur une ligne (6 au plus) : les cartes se resserrent si la fenêtre est étroite, et ne passent à la ligne que sur téléphone */
.fe-team { display: flex; flex-wrap: nowrap; justify-content: center; align-items: flex-start; gap: 12px; width: 100%; }
@media (max-width: 760px) { .fe-team { flex-wrap: wrap; } }
.fh {
  width: 160px; flex: 0 1 160px; min-width: 132px; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 8px 10px; box-sizing: border-box;
  background: linear-gradient(rgba(60, 42, 24, .92), rgba(28, 19, 11, .94)); border: 2px solid #8a6a3a; border-radius: 14px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .6), inset 0 0 0 1px rgba(255, 255, 255, .06);
  animation: feCardIn 500ms ease-out calc(var(--d) - 350ms) both;
}
/* Loterie : fenêtre d'une case, la bande défile puis s'arrête sur la case gagnante (dernière) */
.fh-reel {
  position: relative; width: 84px; height: var(--cell); overflow: hidden; border-radius: 10px;
  background: radial-gradient(circle, #3a2a50 0%, #120c1c 75%); border: 3px solid #e9b949;
  box-shadow: 0 0 0 2px #4a2411, inset 0 0 12px rgba(0, 0, 0, .9);
}
.fh-reel::before, .fh-reel::after { content: ""; position: absolute; left: 0; right: 0; height: 14px; z-index: 2; pointer-events: none; }
.fh-reel::before { top: 0; background: linear-gradient(rgba(0, 0, 0, .75), transparent); }
.fh-reel::after { bottom: 0; background: linear-gradient(transparent, rgba(0, 0, 0, .75)); }
.fh-strip { display: flex; flex-direction: column; animation: feSpin var(--spin) cubic-bezier(.12, .62, .22, 1) var(--d) both; }
.fh-cell { flex: 0 0 var(--cell); height: var(--cell); display: flex; align-items: center; justify-content: center; }
.fh-cell img, .fh-cell img.ri, .fh-cell img.ui-ico, .fh-cell img.ii { height: 42px; width: auto; max-width: 56px; object-fit: contain; vertical-align: middle; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .7)); }
.fh-shine { position: absolute; inset: -40%; z-index: 3; pointer-events: none; background: url("../img/tresor/eclat.png") center / contain no-repeat; mix-blend-mode: screen; opacity: 0;
  animation: feShine 900ms ease-out calc(var(--d) + var(--spin)) both; }
.fh-prize { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 40px; text-align: center; animation: fePrize 450ms cubic-bezier(.2, 1.6, .4, 1) calc(var(--d) + var(--spin)) both; }
.fh-prize b { font: 22px/1 var(--font-title), serif; color: var(--gold); text-shadow: 0 2px 2px #000; }
.fh-prize small { font-size: 13px; line-height: 1.15; color: #f5e6c8; }
.fh-bonus { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.fh-b {
  display: grid; grid-template-columns: 34px auto 1fr; align-items: center; gap: 6px; height: 42px; box-sizing: border-box; padding: 0 8px; border-radius: 10px;
  background: rgba(30, 60, 90, .55); border: 2px solid #6fd0ff; box-shadow: 0 0 12px rgba(111, 208, 255, .45);
  animation: fePrize 450ms cubic-bezier(.2, 1.6, .4, 1) calc(var(--d) + var(--spin) + var(--bonus) * (var(--k) + 1)) both;
}
/* Montant au-dessus du nom : tient dans la carte même avec un gros montant (nom long : points de suspension, nom complet au survol) */
.fh-b { grid-template-columns: 34px minmax(0, 1fr); grid-template-rows: auto auto; row-gap: 2px; column-gap: 4px; padding: 0 6px; align-content: center; }
.fh-bi { grid-row: 1 / 3; }
.fh-b b, .fh-b small { grid-column: 2; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.fh-b.k-bag, .fh-b.k-gold { border-color: #e9b949; background: rgba(90, 60, 20, .6); box-shadow: 0 0 12px rgba(233, 185, 73, .5); }
.fh-b.k-material { border-color: #c792ea; background: rgba(60, 30, 80, .55); box-shadow: 0 0 12px rgba(199, 146, 234, .5); }
.fh-bi { display: flex; align-items: center; justify-content: center; }
.fh-bi img, .fh-bi img.ri, .fh-bi img.ui-ico, .fh-bi img.ii { height: 30px; width: auto; max-width: 34px; object-fit: contain; vertical-align: middle; }
.fh-b b { font: 16px/1 var(--font-title), serif; color: var(--gold); }
.fh-b small { font-size: 12px; line-height: 1.1; color: #f5e6c8; text-align: left; }
/* Familier rapporté (petArrival, demande de l'utilisateur, 05/12/2026) : l'icône surgit avec un rebond et un halo de la couleur de sa rareté (--q),
   puis se pose dans sa ligne. Nouveau familier : grand rebond, éclat et 8 étincelles (même esprit que l'évolution .pet-evo) ; doublon : petit rebond.
   Purement décoratif (pointer-events: none, positions absolues : la carte ne change pas de taille) ; « Passer » et prefers-reduced-motion l'amènent à l'état final. */
.fh-b.k-pet { --pt: calc(var(--d) + var(--spin) + var(--bonus) * (var(--k) + 1)); border-color: var(--q, #6fd0ff); background: rgba(45, 32, 20, .7);
  box-shadow: 0 0 12px color-mix(in srgb, var(--q, #6fd0ff) 55%, transparent); }
.fh-b.k-pet .fh-bi { position: relative; }
.fh-b.k-pet .fh-bi img { position: relative; z-index: 2; filter: drop-shadow(0 0 3px var(--q)); }
.fh-b.pet-dup .fh-bi img { animation: fhPetDup 750ms cubic-bezier(.2, 1.5, .4, 1) var(--pt) both; }
.fh-b.pet-new .fh-bi img { animation: fhPetNew 1500ms ease-out var(--pt) both; }
.fh-pglow, .fh-pp { position: absolute; pointer-events: none; }
.fh-pglow { inset: -16px; z-index: 1; background: url("../img/tresor/eclat.png") center / contain no-repeat; mix-blend-mode: screen; opacity: 0;
  filter: drop-shadow(0 0 6px var(--q)); animation: fhPetGlow 900ms ease-out calc(var(--pt) + 150ms) both; }
.pet-new .fh-pglow { inset: -26px; animation-duration: 1300ms; }
.fh-pp { left: 50%; top: 50%; z-index: 3; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: var(--q); box-shadow: 0 0 6px var(--q), 0 0 2px #fff; opacity: 0;
  animation: fhPetPart 800ms ease-out calc(var(--pt) + 300ms) both; }
@keyframes fhPetDup { 0% { opacity: 0; transform: scale(.4); } 60% { opacity: 1; transform: scale(1.25); filter: drop-shadow(0 0 8px var(--q)); } 100% { transform: none; filter: drop-shadow(0 0 3px var(--q)); } }
@keyframes fhPetNew {
  0% { opacity: 0; transform: translateY(6px) scale(.2); }
  25% { opacity: 1; transform: translateY(-10px) scale(1.9); filter: drop-shadow(0 0 10px var(--q)) drop-shadow(0 0 4px #fff) brightness(1.5); }
  45% { transform: translateY(-6px) scale(1.7); filter: drop-shadow(0 0 12px var(--q)) brightness(1.2); }
  70% { transform: translateY(1px) scale(.9); }
  85% { transform: translateY(-2px) scale(1.06); }
  100% { opacity: 1; transform: none; filter: drop-shadow(0 0 3px var(--q)); }
}
@keyframes fhPetGlow { 0% { opacity: 0; transform: scale(.3) rotate(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: scale(1.3) rotate(60deg); } }
@keyframes fhPetPart { 0% { opacity: 1; transform: rotate(var(--a)) translateY(0) scale(1); } 100% { opacity: 0; transform: rotate(var(--a)) translateY(-30px) scale(.4); } }
/* Butin du groupe / « Tout récupérer » : pastille aux couleurs de la rareté ; un nouveau familier fait un seul petit rebond (rien ne s'empile) */
.fe-chip.k-pet { border-color: var(--q, #6fd0ff); }
.fete.skip .fe-chip.pet-new img { animation: fhPetDup 750ms cubic-bezier(.2, 1.5, .4, 1) 250ms both !important; }
@media (prefers-reduced-motion: reduce) {
  .fete .fh-pglow, .fete .fh-pp { display: none; }
  .fete.skip .fe-chip.pet-new img, .fete .fh-b.k-pet .fh-bi img { animation: none !important; }
}
.fh-hero { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-top: 2px; }
.fh-hero img.av { width: 68px; height: 68px; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .7)); animation: feHop 500ms ease-out calc(var(--d) + var(--spin)) both; }
.fh-hero b { font: 16px/1.1 var(--font-title), serif; color: #fff; }
.fh-hero small { font-size: 12px; color: var(--muted); }
.fh-xp, .fh-st { display: grid; grid-template-columns: 22px auto; align-items: center; gap: 6px; font-size: 14px; color: #f5e6c8; }
.fh-xp img, .fh-st img, .fh-st img.ii, .fh-st img.ui-ico { height: 20px; width: 20px; object-fit: contain; vertical-align: middle; }
.fh-st.bad { color: #ff9d8a; }
.fh-st.ok { color: #9fe39f; }
.fh-xp, .fh-st, .fh-lvl { animation: feFade 400ms ease-out calc(var(--d) + var(--spin) + 150ms) both; }
.fh-lvl { padding: 2px 10px 3px; border-radius: 999px; font: 14px/1.2 var(--font-title), serif; color: #1c1406; background: linear-gradient(#ffe08a, #e9a93a); box-shadow: 0 0 10px rgba(255, 210, 90, .7); }
.fe-actions { display: flex; gap: 10px; animation: feFade 400ms ease-out var(--intro) both; }
.fe-actions .btn { min-width: 160px; }

/* Passer : tout à l'état final */
.fete.skip *, .fete.skip *::before, .fete.skip *::after { animation-delay: 0s !important; animation-duration: .01s !important; }
.fete.skip .fe-rays { animation: feRaysTurn 24s linear infinite !important; opacity: .55; }
.fete.skip .fe-stars i { animation: feTwinkle 1.6s ease-in-out calc(var(--k) * 260ms) infinite both !important; }
.fete.skip .fe-coins i { display: none; }
@media (prefers-reduced-motion: reduce) {
  .fete *, .fete *::before, .fete *::after { animation-delay: 0s !important; animation-duration: .01s !important; animation-iteration-count: 1 !important; }
  .fete .fe-coins { display: none; }
}
@media (max-width: 560px) { .fe-title { font-size: 28px; } .fe-zone { width: 72px; height: 72px; } .fh { width: 138px; } }

@keyframes feRaysIn { from { opacity: 0; transform: scale(.3); } to { opacity: .55; transform: scale(1); } }
@keyframes feRaysTurn { from { rotate: 0deg; } to { rotate: 360deg; } }
@keyframes fePop { 0% { opacity: 0; transform: scale(.3); } 100% { opacity: 1; transform: none; } }
@keyframes feCardIn { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes feSpin { 0% { transform: translateY(0); } 88% { transform: translateY(calc(var(--end) - 8px)); } 100% { transform: translateY(var(--end)); } }
@keyframes feShine { 0% { opacity: 0; transform: scale(.3) rotate(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: scale(1.4) rotate(50deg); } }
@keyframes fePrize { 0% { opacity: 0; transform: scale(.3); } 100% { opacity: 1; transform: none; } }
@keyframes feHop { 0% { transform: none; } 40% { transform: translateY(-10px); } 100% { transform: none; } }
@keyframes feFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes feTwinkle { 0%, 100% { opacity: 0; transform: scale(.4) rotate(0); } 50% { opacity: 1; transform: scale(1.1) rotate(45deg); } }
@keyframes feCoin { 0% { opacity: 0; translate: 0 0; } 8% { opacity: 1; } 90% { opacity: 1; } 100% { opacity: 0; translate: 0 560px; } }
@keyframes feCoinSpin {
  0% { background-position: 0 0; } 11.1% { background-position: -30px 0; } 22.2% { background-position: -60px 0; }
  33.3% { background-position: 0 -30px; } 44.4% { background-position: -30px -30px; } 55.5% { background-position: -60px -30px; }
  66.6% { background-position: 0 -60px; } 77.7% { background-position: -30px -60px; } 88.8% { background-position: -60px -60px; }
}

/* ---------- Fin de donjon, v2 : rebond, gros lot, chef, barres d'XP et de progression, butin du groupe ---------- */
/* Loterie : décélère (ease-out), dépasse la case gagnante puis revient en rebondissant */
@keyframes feSpin2 {
  0% { transform: translateY(0); animation-timing-function: cubic-bezier(.1, .55, .2, 1); }
  84% { transform: translateY(calc(var(--end) - 18px)); animation-timing-function: ease-in-out; }
  93% { transform: translateY(calc(var(--end) + 6px)); animation-timing-function: ease-in-out; }
  100% { transform: translateY(var(--end)); }
}
.fh-strip { animation: feSpin2 var(--spin) linear var(--d) both; }
.fh { position: relative; isolation: isolate; }
/* Chef du groupe : cadre doré et insigne « Meneur » */
.fh.leader { border-color: #e9b949; box-shadow: 0 6px 14px rgba(0, 0, 0, .6), 0 0 0 2px rgba(233, 185, 73, .35), inset 0 0 0 1px rgba(255, 230, 150, .2); }
.fh-chef { position: absolute; top: -12px; left: -10px; width: 34px; height: 34px; object-fit: contain; z-index: 4; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .8)); }
/* Gros lot : la carte s'illumine (or ou bleu) et des rayons tournent derrière elle */
.fh.rare { animation: feCardIn 500ms ease-out calc(var(--d) - 350ms) both, feRareGlow 1.6s ease-in-out calc(var(--d) + var(--rt)) infinite; }
.fh.r-gold { --rare: rgba(255, 205, 80, .9); }
.fh.r-blue { --rare: rgba(111, 208, 255, .9); }
.fh.rare.r-gold { border-color: #ffd25a; }
.fh.rare.r-blue { border-color: #6fd0ff; }
.fh-rays { position: absolute; z-index: -1; left: 50%; top: 40px; width: 300px; height: 300px; margin: -150px 0 0 -150px; pointer-events: none;
  background: url("../img/tresor/eclat.png") center / contain no-repeat; mix-blend-mode: screen; opacity: 0;
  animation: feRareIn 600ms ease-out calc(var(--d) + var(--rt)) both, feRaysTurn 9s linear infinite; }
.fh.r-blue .fh-rays { filter: hue-rotate(170deg) saturate(1.6); }
@keyframes feRareIn { from { opacity: 0; transform: scale(.2); } to { opacity: .8; transform: scale(1); } }
@keyframes feRareGlow {
  0%, 100% { box-shadow: 0 6px 14px rgba(0, 0, 0, .6), 0 0 8px 1px var(--rare); }
  50% { box-shadow: 0 6px 14px rgba(0, 0, 0, .6), 0 0 26px 8px var(--rare); }
}
/* Barre d'XP : se remplit ; en cas de montée de niveau elle déborde, repart de zéro, puis « Niveau N ! » */
.fh-xpbar { width: 86%; height: 8px; border-radius: 99px; background: rgba(0, 0, 0, .55); border: 1px solid #6a5030; overflow: hidden; }
.fh-xpbar i { display: block; height: 100%; width: var(--f1); border-radius: 99px; background: linear-gradient(#ffe08a, #e9a93a);
  animation: feXp var(--xpd) ease-out calc(var(--d) + var(--spin) + 150ms) both; }
.fh-xpbar.up i { animation-name: feXpUp; }
@keyframes feXp { from { width: var(--f0); } to { width: var(--f1); } }
@keyframes feXpUp { 0% { width: var(--f0); } 45% { width: 100%; } 50% { width: 0; } 100% { width: var(--f1); } }
.fh-lvl-slot:empty { display: none; }
.fh-lvl { animation: fePrize 450ms cubic-bezier(.2, 1.6, .4, 1) calc(var(--d) + var(--spin) + 150ms + var(--xpd) * .5) both !important; }
/* Progression du donjon sous le titre */
.fe-prog { display: grid; grid-template-columns: auto 160px auto; align-items: center; gap: 8px; font-size: 14px; color: #f5e6c8; animation: feFade 400ms ease-out var(--intro) both; }
.fe-prog b { font: 15px/1 var(--font-title), serif; color: var(--gold); }
.fe-pbar { height: 10px; border-radius: 99px; background: rgba(0, 0, 0, .6); border: 1px solid #6a5030; overflow: hidden; }
.fe-pbar i { display: block; height: 100%; width: var(--p1); background: linear-gradient(#8fe0ff, #2f9be0); border-radius: 99px;
  animation: feProg 1100ms ease-out calc(var(--intro) + 200ms) both; }
.fe-pbar.full i { background: linear-gradient(#ffe08a, #e9a93a); box-shadow: 0 0 10px rgba(255, 210, 90, .8); }
@keyframes feProg { from { width: var(--p0); } to { width: var(--p1); } }
/* Boss et donjon terminé : plus de rayons, rayons plus chauds */
.fete.is-boss .fe-rays { width: 860px; height: 860px; margin: -430px 0 0 -430px; }
.fe-rays.r2 { animation: feRaysIn var(--intro) ease-out both, feRaysTurn 36s linear infinite reverse; filter: sepia(1) saturate(4) hue-rotate(-20deg); }
.fete.skip .fe-rays.r2 { animation: feRaysTurn 36s linear infinite reverse !important; }
.fete.is-final .fe-title { color: #fff2b0; font-size: 46px; }
.fete.is-final .fe-bg { filter: blur(14px) brightness(.45) saturate(1.6) sepia(.4); }
/* Butin du groupe et boutons de fin : seulement une fois l'animation finie */
.fe-sum { display: none; flex-direction: column; align-items: center; gap: 8px; width: 100%; }
.fete.ended .fe-sum { display: flex; animation: feFade 400ms ease-out both; }
.fe-sum-t { font: 16px var(--font-title), serif; color: #f5e6c8; }
.fe-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.fe-chip { display: grid; grid-template-columns: 28px auto auto; align-items: center; gap: 6px; height: 36px; box-sizing: border-box; padding: 0 10px; border-radius: 10px;
  background: rgba(20, 14, 8, .75); border: 1px solid #6a5030; }
.fe-chip img, .fe-chip img.ri, .fe-chip img.ui-ico, .fe-chip img.ii { height: 26px; width: auto; max-width: 28px; object-fit: contain; vertical-align: middle; justify-self: center; }
.fe-chip b { font: 15px/1 var(--font-title), serif; color: var(--gold); }
.fe-chip small { font-size: 13px; color: #f5e6c8; }
.fe-chip.k-chest, .fe-chip.k-key, .fe-chip.k-bag { border-color: #e9b949; }
.fe-chip.k-fragment { border-color: #6fd0ff; }
/* Stock du matériau de donjon après le gain (feteStock, game.js) : pastille claire, orange au plafond comme .mat-max */
.fe-chip.has-stock { grid-template-columns: 28px auto auto auto; height: auto; min-height: 36px; padding-top: 4px; padding-bottom: 4px; } /* libellé sur 2 lignes (téléphone) : la pastille grandit */
.fe-stock { display: inline-flex; align-items: center; justify-content: center; height: 22px; margin-left: 2px; box-sizing: border-box; padding: 0 8px; border-radius: 999px;
  background: rgba(245, 230, 200, .14); border: 1px solid rgba(245, 230, 200, .3); color: #f5e6c8; font: 13px/1 var(--font-title), serif; white-space: nowrap; }
.fe-stock.full { background: #c9571c; border-color: #c9571c; color: #fff; }
.fe-actions { flex-wrap: wrap; justify-content: center; gap: 10px; }
.fe-actions .btn { min-width: 0; display: inline-flex; align-items: center; gap: 8px; }
.fe-actions .btn .ui-ico { height: 22px; width: auto; }
.fe-after { display: none !important; }
.fete.ended .fe-after { display: inline-flex !important; }
.fete.ended .fe-skipbtn { display: none; }
.fe-skipbtn { min-width: 160px !important; justify-content: center; }
/* Case d'expédition : portraits superposés (3 au plus) puis « +n » */
.slot-heroes { display: flex; align-items: center; justify-content: center; }
.slot-heroes img.av { width: 24px; height: 24px; vertical-align: middle; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .7)); }
.slot-heroes img.av + img.av { margin-left: -7px; }
.slot-more { margin-left: 3px; font: 13px/1 var(--font-title), serif; color: #fff; -webkit-text-stroke: 3px #4a2411; paint-order: stroke fill; }
/* Tuile « Tout récupérer » */
.slot-tile.claim-all { cursor: pointer; background: linear-gradient(#5fe08a, #1f9a4a); border-color: #c8ffd8; justify-content: center; gap: 4px; animation: slotDone 1.2s ease-in-out infinite; }
.slot-tile.claim-all:hover { filter: brightness(1.1); transform: translateY(-2px); }
.slot-tile.claim-all .slot-ico { height: 40px; width: auto; }
.slot-tile.claim-all .slot-txt { font-size: 15px; line-height: 1.05; text-align: center; -webkit-text-stroke: 4px #0b4a22; }
.slot-n { position: absolute; top: -10px; right: -10px; min-width: 26px; height: 26px; box-sizing: border-box; padding: 0 6px; border-radius: 99px; display: flex; align-items: center; justify-content: center;
  font: 15px/1 var(--font-title), serif; color: #fff; background: #d9584a; border: 2px solid #fff; box-shadow: 0 2px 3px rgba(0, 0, 0, .5); }
.fete.skip .fh.rare { animation: feRareGlow 1.6s ease-in-out infinite !important; }
.fete.skip .fh-rays { animation: feRaysTurn 9s linear infinite !important; opacity: .8; }

/* ---------- Mécanique de vente : humeur, réputation, série, fidélité, clients spéciaux, aperçu des gains ---------- */
.counter-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -2px 0 10px; }
.cs-chip { display: inline-grid; grid-auto-flow: column; align-items: center; gap: 6px; height: 30px; box-sizing: border-box; padding: 0 10px; border-radius: 99px;
  background: rgba(0, 0, 0, .3); border: 1px solid var(--border); font-size: 14px; white-space: nowrap; }
.cs-chip img.ui-ico { height: 22px; width: auto; vertical-align: middle; }
.cs-chip b { font: 15px/1 var(--font-title), serif; color: var(--gold); }
.cs-chip small { color: var(--muted); font-size: 13px; }
.cs-chip.streak:not(.on) { opacity: .6; }
.cs-chip.streak.on { border-color: #e9b949; }
.cs-bar { display: block; width: 64px; height: 8px; border-radius: 99px; background: rgba(0, 0, 0, .55); border: 1px solid #6a5030; overflow: hidden; }
.cs-bar i { display: block; height: 100%; background: linear-gradient(#8fe0ff, #2f9be0); border-radius: 99px; }

.cust-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cust-badge { display: inline-flex; align-items: center; gap: 2px; }
.cust-badge img.ui-ico { height: 18px; width: auto; vertical-align: middle; }
.cust-badge.loyal b { font: 13px/1 var(--font-title), serif; color: #ff9db0; }
.cust-badge.spec img.ui-ico { height: 20px; } /* cœur + 8 px + couronne tiennent sous le portrait (64 px) */
/* Demande ambitieuse (CUSTOMER.amb*) : pastille dorée à côté du nom du client */
.cust-amb { flex: none; align-self: center; display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px 0 4px; border-radius: 99px; background: rgba(0, 0, 0, .4); border: 1px solid #c9a24a; color: #ffd36b; font: 600 12px/1 var(--font-title), serif; white-space: nowrap; }
.cust-amb img.ui-ico { height: 14px; width: auto; }
.cust-amb.short { padding: 0 4px; } /* nom du client trop serré (fitCustomers) : écusson seul, le texte reste dans l'infobulle */
.cust-amb.short .amb-txt { display: none; }
/* Humeur : visage + barre de patience (couleur selon l'humeur) */
.cust-pat { display: grid; grid-template-columns: 22px 1fr; align-items: center; gap: 6px; }
.cust-pat img.v-mood { height: 22px; width: 22px; object-fit: contain; }
.pat-bar { display: block; height: 8px; border-radius: 99px; background: rgba(0, 0, 0, .55); border: 1px solid #5a4430; overflow: hidden; }
.pat-bar i { display: block; height: 100%; border-radius: 99px; transition: width .25s linear; }
.cust-pat.m1 .pat-bar i { background: linear-gradient(#7ff0b0, #2fb36a); }
.cust-pat.m2 .pat-bar i { background: linear-gradient(#ffe08a, #e9b93a); }
.cust-pat.m3 .pat-bar i { background: linear-gradient(#ffb36a, #e07a2a); }
.cust-pat.m4 .pat-bar i { background: linear-gradient(#ff8a7a, #d9384a); animation: patWarn 1s ease-in-out infinite; }
@keyframes patWarn { 50% { opacity: .55; } }
/* Bonus actifs sur la vente */
.v-bonus { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.vb { display: inline-grid; grid-auto-flow: column; align-items: center; gap: 4px; height: 26px; box-sizing: border-box; padding: 0 8px; border-radius: 8px;
  font: 13px/1 var(--font-title), serif; background: rgba(0, 0, 0, .3); border: 1px solid var(--border); color: var(--gold); }
.vb img.ui-ico { height: 18px; width: auto; vertical-align: middle; }
.vb.prime { border-color: #8fd98f; color: #b6f0b6; box-shadow: 0 0 8px rgba(111, 191, 115, .45); }
.vb.loyal { border-color: #ff9db0; color: #ffc0cc; }
.vb.spec { border-color: #e9b949; }
/* Clients spéciaux : cadre coloré */
/* Clients spéciaux : 2e pixel du contour en ombre intérieure, pour ne pas décaler le contenu par rapport aux autres cartes */
.customer.k-presse { border-color: #ff9d6a; box-shadow: inset 0 0 0 1px #ff9d6a, 0 0 10px rgba(255, 140, 80, .35); }
.customer.k-collection { border-color: #c792ea; box-shadow: inset 0 0 0 1px #c792ea, 0 0 10px rgba(199, 146, 234, .4); }
.customer.k-marchand { border-color: #6fd0ff; box-shadow: inset 0 0 0 1px #6fd0ff, 0 0 10px rgba(111, 208, 255, .35); }
/* Échoppe (ordinateur) : le halo extérieur passe sur un pseudo-élément découpé, pour ne pas déborder du fond opaque du panneau (ClearType, « Fluidité du défilement ») */
html:not(.tel) .ech-col .customer.k-presse { position: relative; box-shadow: inset 0 0 0 1px #ff9d6a; --halo: rgba(255, 140, 80, .35); }
html:not(.tel) .ech-col .customer.k-collection { position: relative; box-shadow: inset 0 0 0 1px #c792ea; --halo: rgba(199, 146, 234, .4); }
html:not(.tel) .ech-col .customer.k-marchand { position: relative; box-shadow: inset 0 0 0 1px #6fd0ff; --halo: rgba(111, 208, 255, .35); }
html:not(.tel) .ech-col .customer:is(.k-presse, .k-collection, .k-marchand)::after { content: ""; position: absolute; inset: -1px; z-index: -1; border-radius: inherit;
  box-shadow: 0 0 10px var(--halo); clip-path: inset(-11px); pointer-events: none; }
.cust-actions .btn small img.ui-ico { height: 14px; width: auto; vertical-align: -2px; }

/* ---------- Icônes à la place des anciens emoji ---------- */
h1 .brand-ico { height: 1.15em; width: auto; vertical-align: -0.2em; }
.slot-lock img.ui-ico { height: 34px; width: auto; }
.glyph img.ui-ico { height: 1em; width: auto; filter: none; }
.b-lock img.ui-ico { height: 18px; width: auto; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .8)); }
.slot-cancel img.ui-ico { height: 10px; width: 10px; }
.pg-ok img.ui-ico, .og-step img.ui-ico.ok { height: 1em; width: auto; vertical-align: -0.15em; }
.fav-btn { display: inline-flex; align-items: center; vertical-align: -3px; }
.fav-btn img.ui-ico { height: 20px; width: 20px; }
img.ui-ico.fav.off { filter: grayscale(1) brightness(.75); opacity: .65; }
.fav-btn:hover img.ui-ico.fav.off { filter: none; opacity: 1; }
.fav-btn.on img.ui-ico { filter: drop-shadow(0 0 4px rgba(233, 185, 73, .8)); }
.city-col h3 img.ui-ico, .hero-class h3 img.ui-ico { height: 1.4em; width: auto; vertical-align: -0.35em; }
.dp-bar span img.ui-ico, .z-boss img.ui-ico { height: 1.1em; width: auto; vertical-align: -0.2em; }


/* ---------- Filtre « Demandés » de l'atelier ---------- */
.want-tab { position: relative; }
/* Option « Voir les demandes du comptoir » sur Non : cloche estompée et barrée d'une croix */
.want-tab.off .tile-img { opacity: .55; }
.want-tab .want-bar { position: absolute; left: 50%; top: 50%; width: 70%; height: 70%; transform: translate(-50%, -50%); object-fit: contain; pointer-events: none; }
/* Menu Options */
.options-dialog .save-box { max-width: 520px; }
.opt-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); }
.opt-txt { display: flex; flex-direction: column; gap: 2px; }
.opt-txt small { font-size: 13px; }
.opt-choice { display: grid; grid-template-columns: 64px 64px; gap: 8px; }
.opt-choice .btn { width: 100%; }
.opt-choice.opt-vol { grid-template-columns: 88px 48px; align-items: center; }
.opt-vol input[type="range"] { width: 100%; accent-color: var(--gold, #e0b050); cursor: pointer; }
.opt-vol span { text-align: right; font-variant-numeric: tabular-nums; }
.opt-choice .btn[aria-pressed="false"] { opacity: .55; }
.save-head h2 img.ui-ico { height: 1.1em; width: auto; vertical-align: -0.15em; }
.want-n { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; box-sizing: border-box; padding: 0 4px; border-radius: 99px;
  display: flex; align-items: center; justify-content: center; font: 11px/1 var(--font-title), serif; color: #fff; background: #d9584a; border: 1.5px solid #fff; }
.want-tag { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; padding: 2px 8px; border-radius: 99px; white-space: nowrap;
  font: 12px/1 var(--font-text), serif; font-weight: normal; vertical-align: 1px; }
.want-tag img.ui-ico { height: 14px; width: auto; }
.want-tag b { font: 12px/1 var(--font-title), serif; }
.want-tag.ok { background: rgba(111, 191, 115, .15); border: 1px solid rgba(111, 191, 115, .55); color: #b6f0b6; }
.want-tag.ko { background: rgba(217, 88, 74, .16); border: 1px solid rgba(217, 88, 74, .6); color: #ffb3a8; }
/* Détail des demandes sous le nom (listes Comptoir / Commandes) */
.r-want { display: flex; flex-wrap: wrap; column-gap: 12px; row-gap: 2px; font-size: 12px; color: var(--muted); margin: 1px 0 2px; }
.r-want > span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.r-want img.ui-ico { height: 14px; width: auto; }

/* ---------- Objectifs du jour (panneau Quêtes) ---------- */
.daily { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; padding: 10px 12px; border-radius: var(--radius);
  background: rgba(0, 0, 0, .22); border: 1px solid var(--border); }
.dl-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 2px; }
.dl-head b { font: 17px var(--font-title), serif; color: var(--gold); }
.dl-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) 76px 112px 96px; align-items: center; gap: 10px; min-height: 36px; }
.dl-ico { display: flex; justify-content: center; }
.dl-ico img.ui-ico { height: 24px; width: auto; max-width: 28px; object-fit: contain; }
.dl-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: 14px; }
.dl-bar { display: block; height: 6px; border-radius: 99px; background: rgba(0, 0, 0, .5); overflow: hidden; }
.dl-bar i { display: block; height: 100%; background: linear-gradient(#8fe0ff, #2f9be0); border-radius: 99px; }
.dl-row.ready .dl-bar i, .dl-row.claimed .dl-bar i { background: linear-gradient(#a8f0a8, #4caf50); }
.dl-n { text-align: right; font-size: 14px; color: var(--muted); }
.dl-rw { display: grid; grid-template-columns: 18px auto 18px auto; align-items: center; gap: 4px; justify-content: end; font-size: 13px; }
.dl-rw img.ui-ico { height: 16px; width: auto; justify-self: center; }
.dl-rw b { font: 13px/1 var(--font-title), serif; color: var(--gold); }
.dl-act { display: flex; justify-content: flex-end; }
.dl-act > img.ui-ico { height: 22px; width: auto; margin-right: 30px; }
.dl-row.claimed { opacity: .6; }
.dl-row.bonus { border-top: 1px dashed var(--border); padding-top: 6px; }
.dl-done { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 36px; font-size: 15px; color: var(--muted); }
.dl-done > img.ui-ico { height: 22px; width: auto; }
.dl-done b { color: var(--gold); font-weight: normal; }
@media (max-width: 560px) { .dl-row { grid-template-columns: 24px minmax(0, 1fr) 60px; } .dl-rw { display: none; } .dl-act { grid-column: 2 / -1; } }
/* Objectifs du jour, panneau étroit (colonne de l'Échoppe rétrécie) : récompenses et bouton sous le texte */
html:not(.tel) .quests-panel { container: qstp / inline-size; }
@container qstp (max-width: 440px) {
  html:not(.tel) .dl-row { grid-template-columns: 28px minmax(0, 1fr) auto; row-gap: 4px; }
  html:not(.tel) .dl-rw { display: grid; grid-column: 2; justify-content: start; }
  html:not(.tel) .dl-act { grid-column: 3; }
}

/* ---------- Listes en colonnes fixes (règle `.plan-row`) : présentoirs ---------- */
.rg-ico { display: flex; justify-content: center; }
.rg-ico img { height: 20px; width: auto; }
.sh-lv { text-align: right; white-space: nowrap; }
/* Panneau « Bâtiments de maîtrise » (renderMastery) : groupes Fabrication (3 cases), Chaudron (2) et Vitesse (4). Largeur du contenu :
   ≥ 780 px 5 cases de front puis 4, 480 à 779 px 3 puis 2 puis 4 (2 × 2 sous 690 px), en dessous une case par ligne, couchée (image à gauche). */
.panel.mastery { container: mstp / inline-size; }
.mastery .panel-head { gap: 8px; }
.mastery .panel-head > h2 { flex: 1 1 0; min-width: 0; }
#mastery-cap { flex: none; display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; min-width: 44px; white-space: nowrap; font-size: 16px; } /* place gardée sans chantier : le titre ne passe pas sur deux lignes au lancement */
.mst-go { display: none; } /* téléphone seulement (mobile.css) */
.mst-groups { display: grid; gap: 14px 10px; }
.mst-group { display: grid; gap: 8px; min-width: 0; }
.mst-gh h3 { margin: 0; }
.mst-gh p { margin: 2px 0 0; font-size: 15px; line-height: 1.25; }
.mst-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mst-group.n2 .mst-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mst-group.n4 .mst-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@container mstp (min-width: 690px) { .mst-group.n4 .mst-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@container mstp (min-width: 690px) and (max-width: 779px) { .mst-group.n4 .mst-rows .mst-r { gap: 4px; font-size: 14px; } }
@container mstp (min-width: 780px) {
  .mst-group.n4 { grid-column: 1 / -1; margin-top: 6px; }
  .mst-groups:has(.n2) { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); grid-template-rows: auto auto; row-gap: 8px; }
  .mst-groups:has(.n2) > .mst-group { grid-row: span 2; grid-template-rows: subgrid; }
}
.mst-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px; text-align: center; border-radius: 12px;
  background: linear-gradient(rgba(255, 220, 160, .08), rgba(0, 0, 0, .2)); border: 1px solid var(--border); min-width: 0; }
.mst-name { font: 15px/1.15 var(--font-title); color: #fff; min-height: 2.3em; display: flex; align-items: center; justify-content: center; }
.mst-img { width: 100%; max-width: 130px; height: 84px; object-fit: contain; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .55)); }
.mst-card.unbuilt .mst-img { filter: grayscale(.6) brightness(.75) drop-shadow(0 3px 3px rgba(0, 0, 0, .55)); }
.mst-card.locked .mst-img { filter: grayscale(1) brightness(.5); }
.mst-r { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; font-size: 15px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.mst-r > span { min-width: 0; text-align: left; color: var(--muted); }
.mst-r > b { flex: none; display: inline-flex; align-items: center; gap: 4px; text-align: right; white-space: nowrap; }
.mst-r > b img { width: 18px; height: 18px; margin: 0; object-fit: contain; }
.mst-lv > b { color: var(--gold, #e0b050); }
.mst-fx { line-height: 1.25; min-height: 2.5em; font-size: 14px; }
.mst-next { white-space: nowrap; }
/* Pied de case, même hauteur dans tous les états : coût et durée puis bouton, chantier en cours, bloqué ou MAX */
.mst-b { display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; width: 100%; min-height: 90px; margin-top: auto; }
.mst-rows { display: grid; gap: 2px; }
.mst-card .btn.small { width: 100%; min-height: 40px; line-height: 1.15; }
.mst-lock, .mst-max { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; color: var(--muted); font-size: 15px; }
.mst-up { width: 100%; min-width: 0; text-align: center; }
@container mstp (max-width: 479px) {
  .mst-grid, .mst-group.n2 .mst-grid, .mst-group.n4 .mst-grid { grid-template-columns: minmax(0, 1fr); }
  .mst-card { display: grid; grid-template-columns: 84px minmax(0, 1fr); grid-template-rows: auto auto minmax(36px, auto) auto; align-items: start; column-gap: 12px; row-gap: 2px; text-align: left; }
  .mst-img { grid-area: 1 / 1 / 4 / 2; align-self: center; width: 84px; height: 76px; }
  .mst-name { min-height: 0; justify-content: flex-start; font-size: 17px; }
  .mst-fx { min-height: 0; }
  .mst-b { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: stretch; min-height: 48px; margin-top: 4px; gap: 12px; }
  .mst-b > * { flex: 1 1 0; min-width: 0; }
  .mst-b > .mst-rows { flex: 1 1 0; min-width: max-content; }
}
img.ui-ico.mst { height: 1.6em; width: auto; }
/* Tutoriel de nouveauté (#tuto-dialog) */
.tuto-dialog { width: min(640px, calc(100vw - 32px)); }
.tuto-box { display: flex; flex-direction: column; gap: 12px; }
.tuto-box h2 { display: flex; align-items: center; gap: 8px; }
.tuto-body p { margin: 8px 0; line-height: 1.45; }
.tuto-imgs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 12px 0; }
.tuto-imgs figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border-radius: 12px; background: rgba(0, 0, 0, .25); border: 1px solid var(--border); }
.tuto-imgs img { width: 100%; max-width: 150px; height: 100px; object-fit: contain; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .55)); }
.tuto-imgs figcaption { font: 15px/1.15 var(--font-title); color: #fff; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.tuto-imgs figcaption small { font: 13px var(--font-text); color: var(--muted); }
.tuto-list { margin: 8px 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; line-height: 1.4; }
.tuto-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 14px; }
.tuto-table th, .tuto-table td { padding: 5px 8px; text-align: right; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.tuto-table th:first-child, .tuto-table td:first-child { text-align: left; }
.tuto-table thead th { color: var(--muted); font-weight: 400; }
.tuto-table td b { color: #7be08a; }
.tuto-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tuto-dots { display: inline-flex; gap: 8px; }
.tuto-dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, .2); }
.tuto-dots i.on { background: var(--gold, #e0b050); }
.tuto-btns { display: inline-flex; gap: 8px; }
@media (max-width: 520px) { .tuto-imgs { grid-template-columns: 1fr; } }
/* Chances de qualité d'une recette (fenêtre Progrès) */
.pg-odds { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; margin: 10px 6px 0; color: #e6d3a8; font-size: 14px; }
.pg-odds .odd { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 10px; background: rgba(0, 0, 0, .45); border: 1px solid #5b3a1c; }
.pg-odds .odd b { color: #fff; font-variant-numeric: tabular-nums; }
.pg-odds .odd i { font-style: normal; color: #7be08a; font-size: 12px; }
.rk-act { display: flex; justify-content: flex-end; min-width: 0; }
.rack.sh-grid { display: grid; grid-template-columns: 24px minmax(0, 1fr) 52px minmax(0, 200px); gap: 8px; }
.sh-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.party-foot .warn { color: #f0b36a; }

/* Interrupteur « Jouer sans patience » (en-tête du comptoir) */
.cs-switch { display: inline-grid; grid-template-columns: 38px auto; align-items: center; gap: 8px; height: 30px; box-sizing: border-box; padding: 0 10px; border-radius: 99px;
  background: rgba(0, 0, 0, .3); border: 1px solid var(--border); font-size: 14px; cursor: pointer; user-select: none; }
.cs-switch input { position: absolute; opacity: 0; pointer-events: none; }
.cs-switch .sw-track { position: relative; width: 38px; height: 20px; border-radius: 99px; background: #4a3a28; border: 1px solid #6a5030; transition: background .2s; }
.cs-switch .sw-track i { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #d8c8a8; transition: transform .2s; }
.cs-switch.on { border-color: #8fd98f; }
.cs-switch.on .sw-track { background: #3f8f4f; }
.cs-switch.on .sw-track i { transform: translateX(18px); background: #fff; }
.cs-switch small { color: var(--muted); font-size: 13px; }
.cs-switch:focus-within { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Packs premium */
/* Fenêtre « Packs » (renderPacksDialog, game.js) : habillage de la fenêtre Plans (crème, ou brun avec « Fenêtres sombres »), sans contour,
   taille fixe quel que soit le contenu, seule la liste défile (agrandie le 06/12/2026, demande de l'utilisateur) */
#packs-dialog {
  --pl-bg: #fdeecc; --pl-ink: #3a2412; --pl-muted: #6b4c2c; --pl-accent: #8a5a10; --pl-ko: #a82a1c;
  --pl-card: rgba(214, 190, 140, .28); --pl-done: rgba(90, 160, 70, .2); --pl-sel: #f7dc97; --pl-bar: #b98d45;
  width: min(720px, calc(100vw - 32px)); height: min(860px, calc(100dvh - 32px)); max-height: none; padding: 20px; overflow: hidden;
  border: 0; border-radius: 18px; background: var(--pl-bg); color: var(--pl-ink); box-shadow: 0 10px 40px rgba(0, 0, 0, .6); font-size: 16px;
}
html.dark-win #packs-dialog {
  --pl-bg: var(--dw-bg); --pl-ink: var(--dw-ink); --pl-muted: #c4ae8e; --pl-accent: var(--dw-accent); --pl-ko: var(--dw-ko);
  --pl-card: var(--dw-card); --pl-done: rgba(120, 190, 90, .16); --pl-sel: var(--dw-band); --pl-bar: #a07a3c; color-scheme: dark;
}
#packs-dialog .save-box { max-width: none; height: 100%; display: flex; flex-direction: column; gap: 10px; }
#packs-dialog .save-box > * { flex: none; margin: 0; }
#packs-dialog .save-box > .plans-list { flex: 1; min-height: 0; max-height: none; gap: 0; padding-right: 8px; scrollbar-gutter: stable; scrollbar-color: var(--pl-bar) transparent; }
#packs-dialog .muted { color: var(--pl-muted); }
#packs-dialog .small-text { font-size: 16px; line-height: 1.35; }
#packs-dialog .plan-total { font-size: 18px; }
#packs-dialog .plan-total b { color: var(--pl-accent); }
#packs-dialog .pk-card { background: var(--pl-card); }
#packs-dialog .pk-card.done { background: var(--pl-done); opacity: 1; }
#packs-dialog .pk-head h3 { color: var(--pl-accent); font-size: 18px; }
#packs-dialog .pk-row { min-height: 40px; padding: 3px 10px; background: rgba(255, 255, 255, .35); font-size: 17px; }
html.dark-win #packs-dialog .pk-row { background: rgba(0, 0, 0, .14); }
html:not(.dark-win) #packs-dialog .btn.close { filter: drop-shadow(0 2px 2px rgba(58, 36, 18, .6)); }
#packs-dialog .pk-row .pr-lvl { color: var(--pl-muted); text-align: right; white-space: nowrap; }
#packs-dialog .pk-row .pr-lvl.low { color: var(--pl-ko); }
#packs-dialog .save-box h3.pk-cat { flex: none; color: var(--pl-ink); background: var(--pl-sel); border: 0; border-radius: 10px; }
.pk-card { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; padding: 8px; background: rgba(0,0,0,.14); border-radius: 8px; }
.pk-card.done { opacity: .75; }
.pk-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.pk-head h3 { margin: 0; }
.save-box h3.pk-cat { margin: 4px 0 8px; padding: 4px 0; text-align: center; font-size: 20px; letter-spacing: .08em; color: #f4e6c4; background: linear-gradient(90deg, transparent, rgba(233,185,73,.22), transparent); border-bottom: 1px solid rgba(233,185,73,.45); }
.save-box h3.pk-cat ~ h3.pk-cat { margin-top: 8px; }
.pk-row { display: grid; grid-template-columns: 2rem 1fr 3.3rem 26px; align-items: center; gap: 8px; padding: 3px 8px; background: rgba(0,0,0,.14); border-radius: 6px; }

/* ===== « Atomisé » : perfect subi en arène (écran façon jeu de combat, #ko-dialog, koShow) ===== */
.ko-dialog { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; color: var(--text); overflow: clip; }
.ko-dialog::backdrop { background: rgba(0, 0, 0, .85); }
.ko-stage { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; cursor: pointer; isolation: isolate; overflow: clip;
  background: radial-gradient(ellipse at center, #5a0a0a 0%, #1a0306 55%, #000 100%); }
.ko-dialog.go .ko-stage { animation: koShake .55s 0.55s cubic-bezier(.36,.07,.19,.97) both; }
.ko-lines { position: absolute; left: 50%; top: 50%; width: 180vmax; height: 180vmax; margin: -90vmax 0 0 -90vmax; z-index: -2; opacity: 0; mix-blend-mode: screen; filter: sepia(1) saturate(6) hue-rotate(-30deg); }
.ko-dialog.go .ko-lines { animation: koLines 1.2s .5s ease-out both, koSpin 9s linear infinite; }
.ko-smoke { position: absolute; z-index: -1; width: 60vmin; height: 60vmin; opacity: 0; filter: brightness(.5) sepia(1) hue-rotate(-30deg) saturate(3); }
.ko-smoke.s1 { left: 5%; top: 30%; } .ko-smoke.s2 { right: 5%; top: 20%; transform: scaleX(-1); }
.ko-dialog.go .ko-smoke { animation: koSmoke 3s .6s ease-out both; }
.ko-impact { position: absolute; left: 50%; top: 42%; width: 80vmin; height: 80vmin; margin: -40vmin 0 0 -40vmin; z-index: 0; opacity: 0; mix-blend-mode: screen; pointer-events: none; }
.ko-dialog.go .ko-impact { animation: koImpact .7s .5s ease-out both; }
.ko-flash { position: absolute; inset: 0; background: #fff; opacity: 0; z-index: 5; pointer-events: none; }
.ko-dialog.go .ko-flash { animation: koFlash .45s .5s ease-out both; }
.ko-word { position: relative; z-index: 2; font-family: var(--font-title); font-size: clamp(64px, 15vw, 210px); line-height: 1; font-style: italic; letter-spacing: .02em;
  color: #ffd84a; background: linear-gradient(180deg, #fff6b0 0%, #ffcf2e 45%, #e85a10 55%, #a81808 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 3px #2a0400; filter: drop-shadow(0 8px 0 #2a0400) drop-shadow(0 0 30px rgba(255, 120, 0, .7)); transform: skewX(-12deg); opacity: 0; }
.ko-dialog.go .ko-word { animation: koSlam .5s .1s cubic-bezier(.2, 1.6, .4, 1) both; }
.ko-score { z-index: 2; display: flex; align-items: center; gap: 18px; font-family: var(--font-title); font-size: clamp(36px, 6vw, 72px); color: #fff; text-shadow: 0 4px 0 #2a0400, 0 0 18px #ff3a1a; opacity: 0; }
.ko-score i { font-style: normal; color: #ff6a3a; }
.ko-dialog.go .ko-score { animation: koPop .35s 1.1s cubic-bezier(.2, 1.6, .4, 1) both; }
.ko-msg { z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 0 16px; opacity: 0; }
.ko-dialog.go .ko-msg { animation: koUp .5s 1.6s ease-out both; }
.ko-msg p { margin: 0; }
.ko-line1, .ko-line2 { font-family: var(--font-title); font-size: clamp(24px, 4.2vw, 48px); color: #fff; text-shadow: 0 3px 0 #000, 0 0 14px #ff2a1a; }
.ko-line2 { color: #ffd84a; }
.ko-dialog.go .ko-line2 { animation: koWobble 1.4s 2.2s ease-in-out infinite; }
.ko-by { color: #e9d9c0; font-size: 18px; max-width: 640px; }
.ko-by b { color: #ff8a5a; font-family: var(--font-title); }
.ko-team { display: flex; gap: 10px; margin: 6px 0; }
.ko-hero img.av { width: 56px; height: 56px; filter: drop-shadow(0 3px 3px #000); }
.ko-dialog.go .ko-hero { animation: koPop .3s calc(2s + var(--i) * .1s) cubic-bezier(.2, 1.6, .4, 1) both; }
.ko-btns { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
@keyframes koSlam { 0% { opacity: 0; transform: skewX(-12deg) scale(4); } 70% { opacity: 1; transform: skewX(-12deg) scale(.9); } 100% { opacity: 1; transform: skewX(-12deg) scale(1); } }
@keyframes koPop { 0% { opacity: 0; transform: scale(0); } 100% { opacity: 1; transform: scale(1); } }
@keyframes koUp { 0% { opacity: 0; transform: translateY(30px); } 100% { opacity: 1; transform: none; } }
@keyframes koFlash { 0% { opacity: .95; } 100% { opacity: 0; } }
@keyframes koImpact { 0% { opacity: 1; transform: scale(.2) rotate(0); } 100% { opacity: 0; transform: scale(2.4) rotate(40deg); } }
@keyframes koLines { 0% { opacity: 0; } 30% { opacity: .9; } 100% { opacity: .35; } }
@keyframes koSpin { to { rotate: 360deg; } }
@keyframes koSmoke { 0% { opacity: 0; transform: scale(.4); } 30% { opacity: .7; } 100% { opacity: 0; transform: scale(1.6); } }
@keyframes koShake { 10%, 90% { transform: translate(-4px, 2px); } 20%, 80% { transform: translate(8px, -4px); } 30%, 50%, 70% { transform: translate(-14px, 6px); } 40%, 60% { transform: translate(14px, -6px); } }
@keyframes koWobble { 0%, 100% { transform: rotate(-2deg) scale(1); } 50% { transform: rotate(2deg) scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .ko-dialog.go * { animation-duration: .01s !important; animation-iteration-count: 1 !important; } }
.ar-perfect { margin: 4px 0 8px; font-family: var(--font-title); color: #ffcf2e; text-shadow: 0 0 10px rgba(255, 90, 20, .6); }

/* ===== Arène : prestige (rang + badge), journal des attaques subies, revanche, série ===== */
.ar-ico.xs { height: 1.4em; width: 1.4em; }
.ar-prestige { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; }
.ar-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-family: var(--font-title); font-size: 12px; line-height: 1.5; letter-spacing: .03em; color: #1a1008; }
.ar-badge.elite { background: linear-gradient(180deg, #d8e6f2, #8fa9c2); }
.ar-badge.champion { background: linear-gradient(180deg, #ffe58a, #e0a22a); }
.ar-revenge { display: inline-block; margin-left: 8px; padding: 2px 10px; border-radius: 999px; background: rgba(200, 60, 40, .25); border: 1px solid var(--bad); color: #ffb39a; font-size: 13px; }
.ar-news { border-color: var(--good); }
.ar-news h3 { display: flex; align-items: center; gap: 8px; }
.ar-news .up { color: var(--good); } .ar-news .down { color: var(--bad); }
.ar-streakrew { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--gold); }
.dl-atks { display: grid; gap: 8px; }
.dl-atk { display: grid; grid-template-columns: 32px minmax(0, 1fr) minmax(0, 1.4fr) 110px minmax(0, 130px); align-items: center; column-gap: 12px; padding: 8px 12px; border-radius: 8px; background: rgba(0,0,0,.22); border-left: 4px solid var(--good); }
.dl-atk.lost { border-left-color: var(--bad); }
.dl-atk > .ar-ico { justify-self: center; }
.dl-atk > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; line-height: 1.25; }
.dl-atk small { font-size: 13px; }
.dla-gain { align-items: flex-end; text-align: right; }
.dla-gain { flex-direction: column; }
.dla-act { align-items: flex-end; }
@media (max-width: 700px) { .dl-atk { grid-template-columns: 28px minmax(0, 1fr) 90px; row-gap: 6px; } .dla-res { grid-column: 2 / 4; grid-row: 2; } .dla-gain { display: none !important; } .dla-act { grid-column: 3; grid-row: 1; } }
.dla-h { display: inline-flex; align-items: center; gap: 4px; color: var(--good); white-space: nowrap; }
.dla-l { color: var(--bad); }

.ar-elo { margin: 8px 0; font-size: 15px; } .ar-elo .up { color: var(--good); } .ar-elo .down { color: var(--bad); }

/* Arène : saison et historique des attaques subies côte à côte */
/* Rang (réduit) et Saison côte à côte ; « Attaques subies » en pleine largeur dessous */
.ar-row1 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: stretch; }
/* Textes des cartes Rang et Saison agrandis (demande de l'utilisateur, 29/11/2026, comme les textes d'aide) */
.ar-row1 small, .ar-row1 .ar-card h3 small, .ar-row1 .ar-head .ar-stats { font-size: 16px; }
.ar-row1 .ar-head { grid-template-columns: auto minmax(0, 1fr); gap: 10px 16px; align-content: start; }
.ar-row1 .ar-head .ar-stats { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 16px; font-size: 14px; }
.ar-row1 .ar-head .ar-stats > span { display: block; line-height: 1.5; }
.ar-row1 .ar-head .ar-stats > span:last-child { grid-column: 1 / -1; }
.ar-row1 .ar-head .ar-stats img { vertical-align: middle; }
.ar-row1 .ar-ico.big { height: 60px; }
.ar-row1 .ar-title { font-size: 22px; }
.ar-row1 .ar-rank { gap: 10px; }
@media (max-width: 1000px) { .ar-row1 { grid-template-columns: 1fr; } }
.ar-row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: stretch; }
/* « Attaques subies » prend la hauteur du panneau Adversaire (demande de l'utilisateur, 29/11/2026) : la liste remplit la carte et défile */
.ar-row2 > .ar-hist-card { display: flex; flex-direction: column; gap: 8px; }
.ar-row2 > .ar-hist-card > * { margin-top: 0; margin-bottom: 0; }
.ar-row2 > .ar-hist-card .dh-list { flex: 1 1 0; height: 0; min-height: 120px; max-height: none; align-content: start; }
.ar-row2 > .ar-hist-card.folded { align-self: start; }
.ar-hist-card h3 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ar-hist-card h3 .btn { margin-left: auto; }
.dh-strip { display: flex; gap: 6px; flex-wrap: wrap; }
.dh-vd { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 6px; font: 15px/1 var(--font-title), serif; color: #fff; padding-top: 2px; box-sizing: border-box; }
.dh-vd.won { background: #2f8f4a; } .dh-vd.lost { background: #b8402f; }
.dh-list { display: grid; gap: 8px; max-height: 260px; overflow-y: auto; padding-right: 2px; }
.dh-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) 64px 40px 62px minmax(0, 96px); align-items: center; column-gap: 10px; padding: 6px 10px; border-radius: 8px; background: rgba(0,0,0,.22); border-left: 4px solid var(--good); min-height: 40px; }
.dh-row.lost { border-left-color: var(--bad); }
.dh-who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dh-t, .dh-d, .dh-g { text-align: right; white-space: nowrap; }
.dh-act { display: flex; justify-content: flex-end; }
@media (max-width: 1000px) { .ar-row2 { grid-template-columns: 1fr; } .ar-row2 > .ar-hist-card .dh-list { flex: none; height: auto; max-height: 260px; } }

/* Classement : pseudo | rang d'arène | niveau en colonnes fixes */
.lb-who { display: grid; grid-template-columns: minmax(0, 1fr) 84px 56px; align-items: center; column-gap: 8px; }
.lb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-ico { display: flex; justify-content: center; align-items: center; gap: 4px; }
.board-table .lb-who small { margin-left: 0; text-align: left; white-space: nowrap; }

/* Artisan Super : emplacement amélioré (bordure dorée) */
.slot.super { border-color: var(--gold); box-shadow: 0 0 10px rgba(233, 185, 73, .55), inset 0 0 8px rgba(233, 185, 73, .25); }

/* Recettes : nom à gauche, « Maîtrisé » + « i » toujours calés à droite (même position pour tous les objets) */
.r-name { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; column-gap: 8px; row-gap: 2px; } /* trop étroit : « Maîtrisé » passe à la ligne au lieu de recouvrir le nom */
.r-name .rn-l { min-width: 0; }
.r-name .nw { flex: none; display: inline-flex; align-items: center; margin-left: auto; }
.r-name .nw .mastered { margin-left: 0; }

/* Artisans occupés : normaux = fond bleu, Super = fond violet (bordure dorée) */
.slot.busy:not(.super) { background: linear-gradient(#2f7fd1, #1b4f94); box-shadow: inset 0 0 0 2px #0e2d57, 0 2px 4px rgba(0,0,0,.4); }

/* Objet cassé sur la fiche d'un héros : carte « réparer » + petite croix pour le jeter */
.hc-wrap { position: relative; display: flex; }
.hc-wrap > .hcard { width: 100%; }
.hc-trash { position: absolute; top: -4px; right: -4px; z-index: 3; width: 20px; height: 20px; padding: 0; border-radius: 50%; border: 2px solid #fff3d6; background: #c0392b; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.hc-trash img.ui-ico { height: 9px; width: 9px; }
.hc-trash:hover:not(:disabled) { filter: brightness(1.15); }
.hc-trash:disabled { opacity: .5; cursor: default; }
/* Cadenas d'un emplacement équipé (S.equipLocks) : ouvert et discret tant qu'il n'est pas mis, fermé et net une fois verrouillé */
.eq-lock { position: absolute; z-index: 3; padding: 0; border: 0; background: none; cursor: pointer; line-height: 0; opacity: .45; transition: opacity .15s, transform .05s; }
.eq-lock img { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .45)); }
.eq-lock.on { opacity: 1; }
.eq-lock:hover, .eq-lock:focus-visible, .hc-wrap:hover > .eq-lock, .hs-slot:hover > .eq-lock { opacity: 1; }
.eq-lock:active { transform: translateY(1px); }
.hc-lock { top: -4px; left: -4px; width: 22px; height: 22px; }
.hs-lock { top: -8px; left: -8px; width: 28px; height: 28px; }

/* ---------- Chaudron de fusion ---------- */
.fu-cauldron { display: flex; justify-content: center; }
.fu-cauldron img { max-width: 70%; height: auto; max-height: 150px; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0,0,0,.5)); }
.fu-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 10px; }
.fu-tile { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 84px; padding: 8px 6px; border-radius: 14px; border: 3px solid #c98a3c; font: 15px var(--font-title), serif; color: #fff; cursor: pointer; text-shadow: 0 1px 0 #000, 0 0 3px #000; box-sizing: border-box; }
.fu-tile img { height: 38px; width: auto; }
.fu-tile.idle { background: linear-gradient(#35b4f0, #1673c2); box-shadow: inset 0 0 0 2px #0b3a73; }
.fu-tile.idle:hover { filter: brightness(1.1); transform: translateY(-2px); }
.fu-tile.idle:hover::after, .rk-badge:hover:not(:disabled)::after { content: ""; position: absolute; inset: auto 0 -6px; height: 6px; } /* tuile soulevée : son bord bas reste cliquable */
.fu-tile.busy { background: linear-gradient(#6b2fa8, #4a1b7c); box-shadow: inset 0 0 0 2px #2d0f4d; cursor: default; }
.fu-tile.busy .bar { position: absolute; left: 8px; right: 8px; bottom: 5px; height: 5px; margin: 0; }
.fu-tile.done { background: linear-gradient(#ffd25a, #e08a12); border-color: #fff1b0; animation: slotDone 1.2s ease-in-out infinite; }
.fu-tile.done .fu-res img.ii { height: 40px; width: auto; }
.fu-tile.buy { background: rgba(0,0,0,.25); border: 2px dashed var(--border); color: var(--muted); }
.fu-tile.buy:disabled { opacity: .55; cursor: default; }
.fu-tile.buy b { font-size: 26px; line-height: 1; }
.fu-tile small { font-size: 13px; }
.fusion-dialog .fu-box { max-width: 760px; }
.fu-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; margin: 8px 0; }
.fu-sels { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.fu-sl { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 76px; border-radius: 12px; border: 2px dashed var(--border); background: rgba(0,0,0,.2); color: var(--muted); font-size: 12px; padding: 4px; box-sizing: border-box; }
.fu-sl b { font-size: 26px; line-height: 1; }
.fu-sl.full { border: 2px solid var(--q, #c98a3c); background: linear-gradient(#fbe9c6, #e6c98d); color: #3b2410; cursor: pointer; }
.fu-ico img.ii { width: 32px; height: 32px; }
.fu-ico { display: inline-flex; filter: drop-shadow(0 0 2px var(--q, transparent)); }
/* Aperçu d'une fusion au survol (fusionPeek, game.js) : anneau d'attente dans le coin de la tuile, puis bulle sombre comme .item-pop */
.fpk-load { position: fixed; z-index: 100000; width: 20px; height: 20px; inset: auto; margin: 0; padding: 0; border: 0; background: none; overflow: visible; pointer-events: none; opacity: 0; animation: fpkIn .12s .1s linear forwards; }
.fpk-load svg { display: block; width: 100%; height: 100%; transform: rotate(-90deg); filter: drop-shadow(0 0 2px rgba(0, 0, 0, .8)); }
.fpk-load circle { fill: none; stroke-width: 3.5; }
.fpk-load .fpk-bg { stroke: rgba(24, 16, 10, .7); }
.fpk-load .fpk-arc { stroke: var(--gold, #e9b949); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; animation: fpkFill var(--fpk-ms, 550ms) linear forwards; }
@keyframes fpkIn { to { opacity: 1; } }
@keyframes fpkFill { to { stroke-dashoffset: 0; } }
.fpk-pop { display: grid; gap: 8px; min-width: 220px; max-width: min(360px, calc(100vw - 16px)); padding: 10px 12px; background: rgba(24, 16, 10, .94); color: #f3e4c4; font-size: 16px; }
.fpk-h { font: 15px var(--font-title), serif; color: #e9b949; }
.fpk-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.fpk-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.fpk-name .qname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fpk-name small { font-size: 13px; color: #c9b48f; }
.fpk-row > b { text-align: right; white-space: nowrap; }
.fu-tile.busy:focus-visible { outline: 3px solid #fff1b0; outline-offset: 2px; }
.fu-results { display: flex; flex-direction: column; gap: 6px; }
.fu-rt { font: 15px var(--font-title), serif; color: var(--gold); margin-top: 2px; }
.fu-out { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 8px; background: rgba(0,0,0,.22); }
.fu-out b { font: 17px var(--font-title), serif; color: #8ff08f; text-align: right; }
.fu-out.best b { color: var(--gold); }
.fu-on { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.fu-on small { color: var(--muted); font-size: 12px; }
.fu-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin: 6px 0; }
.fu-foot > span { margin-right: auto; }
.fu-foot .fu-dur { display: inline-flex; align-items: center; gap: 6px; font-size: 16px; }
.fu-foot .fu-dur img.ui-ico { height: 22px; width: auto; }
.fu-foot .fu-chance { color: #f3e8d0; opacity: .85; }
.fu-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; max-height: 34vh; overflow-y: auto; padding: 2px; }
.fu-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px 4px; border-radius: 10px; border: 2px solid var(--q, #c98a3c); background: linear-gradient(#fbe9c6, #e6c98d); color: #3b2410; cursor: pointer; font-size: 12px; text-align: center; }
.fu-card:hover:not(:disabled) { filter: brightness(1.06); }
.fu-card:disabled { opacity: .5; cursor: default; }
.fu-cn { font-weight: 700; line-height: 1.1; }
.fu-n { position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; border-radius: 99px; background: #fff; border: 2px solid #c98a3c; display: flex; align-items: center; justify-content: center; font: 13px var(--font-title), serif; color: #3b2410; }
@media (max-width: 700px) { .fu-main { grid-template-columns: 1fr; } }
/* Colonne du milieu (écran large) : atelier (artisans, réserves, catégories), puis chaudron, stock et râteliers.
   La liste des recettes occupe la 3e colonne. Hors écran large, le conteneur s'efface (display: contents)
   et chaque panneau reprend sa place dans la grille. */
.work-col { display: contents; }
.cauldron { grid-area: cauldron; }
main:not([data-tab="echoppe"]) > .work-col, main:not([data-tab="echoppe"]) > .recipes-panel { display: none; }
@media (min-width: 1250px) {
  main[data-tab="echoppe"] { max-width: 1700px; grid-template-columns: minmax(0, 1.3fr) minmax(0, .9fr) minmax(0, 1fr); grid-template-areas: "counter work list" "quests work list"; grid-template-rows: auto 1fr; }
  main[data-tab="echoppe"] > .work-col { grid-area: work; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
  main[data-tab="echoppe"] > .work-col > .panel { margin: 0; }
}
main:not([data-tab="echoppe"]) > .cauldron { display: none; }

/* Barre d'onglets étirée sur toute la largeur du contenu (de la bordure du comptoir à celle du chaudron) */
.tabs .tab { flex: 1 1 auto; text-align: center; justify-content: center; }

/* Boutons du comptoir : si le texte est trop long pour la carte, le détail (énergie, %) passe à la ligne au lieu de sortir du bouton */
.cust-actions .btn { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; column-gap: 6px; row-gap: 0; white-space: normal; line-height: 1.2; }
.cust-actions .btn small { white-space: nowrap; }

/* ---------- Cadeau de Noël (#noel-dialog) : neige, étoiles, paquet à ouvrir, traîneau (img/noel/traineau.png si fourni), cadeaux qui tombent ---------- */
.noel-dialog { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; color: var(--text); overflow: clip; }
.noel-dialog::backdrop { background: rgba(4, 10, 28, .88); }
.nl-stage { position: absolute; inset: 0; overflow: clip; isolation: isolate; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 110%, rgba(120, 170, 255, .28), transparent 60%), linear-gradient(#071433, #10224a 60%, #1b2f5c); }
.nl-snow { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.nl-flake { position: absolute; top: -40px; left: var(--x); width: var(--s); height: var(--s); opacity: var(--o); animation: nlFall var(--d) linear var(--t) infinite; }
@keyframes nlFall { 0% { transform: translate(0, 0); } 50% { transform: translate(var(--w), 55vh); } 100% { transform: translate(0, calc(100vh + 60px)); } }
.nl-star { position: absolute; left: var(--x); top: var(--y); width: 22px; height: 22px; z-index: 0; animation: nlTwinkle 2.6s ease-in-out var(--t) infinite; }
@keyframes nlTwinkle { 0%, 100% { opacity: .25; transform: scale(.7); } 50% { opacity: 1; transform: scale(1.15); } }
.nl-box-wrap, .nl-content { position: relative; z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; padding: 16px; }
.nl-title { margin: 0; font: 34px/1.1 var(--font-title); color: #ffe7a0; -webkit-text-stroke: 5px #6b1010; paint-order: stroke fill; text-shadow: 0 4px 10px rgba(0, 0, 0, .6); }
.nl-title.big { font-size: 58px; animation: nlPop .6s .5s cubic-bezier(.2, 1.6, .4, 1) both; }
.nl-gift { background: none; border: 0; padding: 0; cursor: pointer; animation: nlShake 1.6s ease-in-out infinite; }
.nl-gift img { width: 190px; height: 190px; object-fit: contain; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .6)) drop-shadow(0 0 22px rgba(255, 220, 120, .35)); }
@keyframes nlShake { 0%, 60%, 100% { transform: rotate(0) scale(1); } 66% { transform: rotate(-7deg) scale(1.04); } 72% { transform: rotate(6deg) scale(1.06); } 78% { transform: rotate(-4deg); } 84% { transform: rotate(3deg); } }
.nl-btn { font-size: 18px; min-width: 200px; }
.nl-flash { position: absolute; inset: 0; z-index: 2; pointer-events: none; background: radial-gradient(circle, #fff, rgba(255, 240, 200, .6) 30%, transparent 70%); opacity: 0; animation: nlFlash .7s ease-out both; }
@keyframes nlFlash { 0% { opacity: 1; } 100% { opacity: 0; } }
.nl-sleigh { position: absolute; z-index: 2; top: 9%; left: 0; width: 260px; height: auto; pointer-events: none; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .5)); animation: nlSleigh 7s linear .4s infinite; }
@keyframes nlSleigh { 0% { transform: translate(-320px, 40px) rotate(-4deg); } 50% { transform: translate(50vw, -10px) rotate(2deg); } 100% { transform: translate(calc(100vw + 320px), 30px) rotate(-3deg); } }
.nl-fall { position: absolute; z-index: 2; top: -80px; left: var(--x); width: var(--s); height: var(--s); object-fit: contain; pointer-events: none; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .5));
  animation: nlDrop 1.6s cubic-bezier(.45, 0, .7, 1) var(--t) both, nlBounce 1.4s ease-in-out calc(var(--t) + 1.6s) infinite; }
@keyframes nlDrop { from { transform: translateY(0) rotate(var(--r)); } to { transform: translateY(calc(100vh - 20px)) rotate(0); } }
@keyframes nlBounce { 0%, 100% { transform: translateY(calc(100vh - 20px)); } 50% { transform: translateY(calc(100vh - 42px)); } }
.nl-sub { margin: 0; max-width: 640px; font-size: 18px; color: #eef3ff; text-shadow: 0 2px 4px rgba(0, 0, 0, .7); animation: nlUp .5s 1s ease-out both; }
.nl-packs { display: grid; grid-template-columns: repeat(3, minmax(0, 260px)); gap: 16px; justify-content: center; max-width: 100%; }
.nl-pack { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px; border-radius: 16px; min-width: 0;
  background: linear-gradient(#fdf3dc, #f1d9a8); color: #5a2a10; border: 4px solid #c8282d; box-shadow: 0 0 0 3px #6b1010, 0 10px 20px rgba(0, 0, 0, .55);
  animation: nlPop .5s calc(1.3s + var(--i) * .25s) cubic-bezier(.2, 1.6, .4, 1) both; }
.nl-pack-img { width: 140px; height: 120px; object-fit: contain; }
.nl-pack-name { font: 20px var(--font-title); color: #fff; -webkit-text-stroke: 4px #8a1414; paint-order: stroke fill; }
.nl-items { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.nl-item { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 8px; text-align: left; font-size: 14px; }
.nl-item .nl-ico { display: flex; justify-content: center; }
.nl-item .nl-ico img { width: 32px; height: 32px; object-fit: contain; }
.nl-item small { color: #8a5a30; }
.nl-content .nl-btn { animation: nlUp .4s 2.2s ease-out both; }
img.ui-ico.nl-ico-t { height: 1.4em; width: auto; }
@keyframes nlPop { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }
@keyframes nlUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@media (max-width: 760px) { .nl-packs { grid-template-columns: 1fr; } .nl-title.big { font-size: 40px; } .nl-pack-img { width: 90px; height: 76px; } .nl-content { max-height: 100vh; overflow-y: auto; } }
@media (prefers-reduced-motion: reduce) { .nl-flake, .nl-sleigh, .nl-fall, .nl-gift, .nl-star { animation-duration: 0s; animation-iteration-count: 1; } }
.nl-packs { grid-template-columns: repeat(var(--n, 3), minmax(0, 260px)); }
/* Thème Thanksgiving (GIFTS.thanks2026, .th-thanks) : ciel de couchant, soleil bas, feuilles d'automne en CSS, dinde qui se dandine */
.noel-dialog.th-thanks::backdrop { background: rgba(30, 12, 4, .9); }
.nl-stage.th-thanks { background: radial-gradient(ellipse at 50% 105%, rgba(255, 170, 60, .45), transparent 62%), linear-gradient(#3a1606, #7a2e0c 55%, #b5561a); }
.nl-sun { position: absolute; z-index: 0; left: 50%; bottom: -18vh; width: 70vh; height: 70vh; translate: -50% 0; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 214, 120, .75), rgba(255, 150, 50, .35) 45%, transparent 70%); animation: nlSun 6s ease-in-out infinite; }
@keyframes nlSun { 0%, 100% { opacity: .8; scale: 1; } 50% { opacity: 1; scale: 1.06; } }
.nl-leaf { position: absolute; top: -40px; left: var(--x); width: var(--s); height: var(--s); opacity: var(--o); background: var(--c);
  border-radius: 0 70% 0 70%; box-shadow: inset -2px -2px 0 rgba(0, 0, 0, .18); animation: nlLeaf var(--d) linear var(--t) infinite; }
.nl-leaf::after { content: ''; position: absolute; left: 8%; top: 50%; width: 86%; height: 2px; background: rgba(60, 20, 0, .45); rotate: -45deg; }
@keyframes nlLeaf { 0% { transform: translate(0, 0) rotate(0); } 25% { transform: translate(var(--w), 25vh) rotate(calc(var(--r) * .25)); }
  50% { transform: translate(calc(var(--w) * -.6), 52vh) rotate(calc(var(--r) * .5)); } 75% { transform: translate(var(--w), 78vh) rotate(calc(var(--r) * .75)); }
  100% { transform: translate(0, calc(100vh + 60px)) rotate(var(--r)); } }
.th-thanks .nl-title { color: #ffe2a8; -webkit-text-stroke-color: #6a2a08; }
.th-thanks .nl-gift { animation: nlWaddle 1.4s ease-in-out infinite; transform-origin: 50% 100%; }
.th-thanks .nl-gift img { width: 170px; height: 220px; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .6)) drop-shadow(0 0 26px rgba(255, 190, 90, .45)); }
@keyframes nlWaddle { 0%, 100% { transform: rotate(-6deg) translateY(0); } 25% { transform: rotate(0) translateY(-10px); } 50% { transform: rotate(6deg) translateY(0); } 75% { transform: rotate(0) translateY(-10px); } }
.th-thanks .nl-sub { color: #fff1dc; }
.th-thanks .nl-pack { border-color: #d07a1e; box-shadow: 0 0 0 3px #6a2a08, 0 10px 20px rgba(0, 0, 0, .55); }
.th-thanks .nl-pack-name { -webkit-text-stroke-color: #7a3408; }
.th-thanks .nl-pack-img { width: 170px; height: 140px; }
@media (max-width: 760px) { .nl-packs { grid-template-columns: minmax(0, 340px); } .th-thanks .nl-pack-img { width: 110px; height: 90px; } .th-thanks .nl-gift img { width: 130px; height: 170px; } }
@media (prefers-reduced-motion: reduce) { .nl-leaf, .nl-sun, .th-thanks .nl-gift { animation-duration: 0s; animation-iteration-count: 1; } }
/* Thème raid de ville (GIFTS.raidPack, .th-raid) : nuit violette de la Montagne Hurlante, neige, emblème du raid, cadre doré */
.noel-dialog.th-raid::backdrop { background: rgba(14, 6, 28, .9); }
.nl-stage.th-raid { background: radial-gradient(ellipse at 50% 110%, rgba(170, 120, 255, .32), transparent 62%), linear-gradient(#120a2a, #2a1752 60%, #3d2470); }
.th-raid .nl-title { color: #fff0c0; -webkit-text-stroke-color: #3a1a6a; }
.th-raid .nl-gift img { filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .6)) drop-shadow(0 0 28px rgba(200, 160, 255, .55)); }
.th-raid .nl-pack { border-color: #d9a520; box-shadow: 0 0 0 3px #3a1a6a, 0 10px 20px rgba(0, 0, 0, .55); }
.th-raid .nl-pack-name { -webkit-text-stroke-color: #3a1a6a; }
.th-raid .nl-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
.th-raid .nl-packs { grid-template-columns: minmax(0, 560px); }
@media (max-width: 760px) { .th-raid .nl-items { grid-template-columns: 1fr; } }

/* ---------- Administration (#admin-dialog) : réglages d'équilibrage pour tous les joueurs ---------- */
.admin-dialog { width: min(760px, calc(100vw - 32px)); }
.adm-box { display: flex; flex-direction: column; gap: 10px; }
.adm-login { display: flex; gap: 8px; align-items: center; }
.adm-login input, .adm-save input[type="text"] { flex: 1; min-width: 0; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: rgba(0, 0, 0, .3); color: var(--text); font: inherit; }
.adm-msg { margin: 0; padding: 8px 10px; border-radius: 8px; background: rgba(240, 190, 80, .12); border: 1px solid rgba(240, 190, 80, .4); }
.adm-list { display: flex; flex-direction: column; gap: 6px; max-height: 55vh; overflow-y: auto; padding-right: 4px; }
.adm-group { margin: 10px 0 2px; font-size: 16px; color: var(--gold, #e0b050); }
.adm-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px 76px; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 8px; border: 1px solid transparent; }
.adm-row.changed { border-color: rgba(123, 224, 138, .5); background: rgba(123, 224, 138, .07); }
.adm-lbl { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.adm-lbl small { font-size: 12px; line-height: 1.3; }
.adm-in { display: flex; align-items: center; gap: 6px; }
.adm-in input[type="text"] { width: 100%; min-width: 0; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--border); background: rgba(0, 0, 0, .3); color: var(--text); font: inherit; text-align: right; }
.adm-unit { min-width: 28px; color: var(--muted); font-size: 13px; }
.adm-check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.adm-save { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-top: 8px; border-top: 1px solid var(--border); }
.adm-hist { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 14px; }
.opt-choice.opt-admin { grid-template-columns: auto; }
.adm-tabs, .adm-periods { display: flex; gap: 8px; flex-wrap: wrap; }
.adm-tabs > .hs-tab { flex: 1; }
.adm-views { display: grid; grid-template-columns: minmax(0, 1fr); }
.adm-view { grid-area: 1 / 1; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.adm-view.off { visibility: hidden; }
/* les statistiques prennent la hauteur des réglages et défilent dedans */
.adm-stats { display: block; height: 0; min-height: 100%; overflow-y: auto; padding-right: 4px; }
.adm-st { display: grid; grid-template-columns: minmax(0, 1fr) 76px 56px 90px; gap: 8px; padding: 4px 8px; border-radius: 6px; font-size: 16px; }
.adm-st > :not(:first-child) { text-align: right; }
.adm-st:nth-child(even) { background: rgba(128, 128, 128, .12); }
.adm-st-head { font-size: 13px; color: var(--muted); }
@media (max-width: 560px) { .adm-st { grid-template-columns: minmax(0, 1fr) 56px 44px 62px; font-size: 14px; } }
@media (max-width: 560px) { .adm-row { grid-template-columns: minmax(0, 1fr) 110px; } .adm-row > .btn { grid-column: 1 / -1; justify-self: end; } }

/* Énergie retirée (25/11/2026) : compteur de l'en-tête et présentoirs masqués */
.hud-item[hidden], #shop-racks-wrap[hidden] { display: none !important; }

/* Carte de donjon (onglet Donjons) : image + ressource dessous, une ligne par information, texte plus grand et aéré */
.z-side { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 0 0 96px; }
.z-mat { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: rgba(0, 0, 0, .3); border: 1px solid var(--border); font-size: 14px; }
.z-mat img.ri { width: 28px; height: 28px; object-fit: contain; }
.z-info { display: flex; flex-direction: column; gap: 5px; margin: 6px 0 8px; }
.z-row { display: grid; grid-template-columns: 24px minmax(0, 1fr); align-items: center; gap: 8px; font-size: 15px; line-height: 1.35; }
.z-row .z-ico { display: flex; align-items: center; justify-content: center; }
.z-row .z-ico img { width: 22px; height: 22px; object-fit: contain; }
.z-row.muted { color: var(--muted); }
.zone .b-name { font-size: 17px; }
/* Boutons du comptoir : contenu centré sur la face claire (au-dessus du rebord 3D du bas), petit texte (Cyberbit) aligné sur le grand (Trans800) */
.cust-actions .btn { padding-top: 4px; padding-bottom: 6px; }
.cust-actions .btn small { position: relative; top: -1px; }
/* Panneaux repliables (Comptoir, Quêtes, Chaudron, Attaques subies) : seul l'en-tête reste visible */
.panel.folded > :not(.panel-head) { display: none !important; }
.panel.folded > .panel-head { margin-bottom: 0; }
.fold-btn { flex: none; }
.quests-panel .panel-head h2 { margin: 0; }
.ar-hist-card .fold-btn { margin-left: 0; }
/* Onglet Donjons : 5 donjons par ligne (plus de place par carte), moins sur les écrans étroits */
#dungeons.city-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1400px) { #dungeons.city-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1100px) { #dungeons.city-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 820px) { #dungeons.city-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 540px) { #dungeons.city-grid { grid-template-columns: minmax(0, 1fr); } }
/* En-têtes avec bouton Réduire : jamais de chevauchement. Chaudron : le bouton Améliorer garde sa largeur, l'en-tête passe à la ligne si besoin */
.cauldron .panel-head, .counter .panel-head { flex-wrap: wrap; gap: 8px; }
.cauldron #fusion-up { flex: 0 0 auto; margin-left: auto; min-width: max-content; }
.cauldron #fusion-up .btn { white-space: nowrap; }
.panel-head .fold-btn { flex: 0 0 auto; }

/* ---------- Disposition de l'Échoppe : 3 colonnes de panneaux déplaçables (S.ui.layout, applyLayout) ---------- */
main[data-tab="echoppe"] { grid-template-areas: none !important; grid-template-rows: none !important; align-items: start;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, .85fr) minmax(0, 1.05fr) !important; } /* liste des recettes un peu plus large (noms et ingrédients) */
.ech-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ech-col > .panel { margin: 0; grid-area: auto !important; }
main:not([data-tab="echoppe"]) > .ech-col { display: none; }
@media (max-width: 1249px) {
  main[data-tab="echoppe"] { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) !important; grid-template-areas: "c0 c1" "c0 c2" !important; grid-template-rows: auto 1fr !important; }
  .ech-col[data-col="0"] { grid-area: c0; } .ech-col[data-col="1"] { grid-area: c1; } .ech-col[data-col="2"] { grid-area: c2; }
}
@media (max-width: 860px) {
  main[data-tab="echoppe"] { grid-template-columns: minmax(0, 1fr) !important; grid-template-areas: "c0" "c1" "c2" !important; grid-template-rows: none !important; }
}
.drag-handle { cursor: grab; touch-action: none; user-select: none; }
.drag-handle:hover { text-shadow: 0 0 8px rgba(240, 190, 80, .55); }
.ech-col > .panel.ech-dragging { position: fixed; left: 0; top: 0; z-index: 950; pointer-events: none; opacity: .92; box-shadow: 0 18px 40px rgba(0, 0, 0, .6); max-height: 70vh; overflow: hidden; }
.ech-ph { border: 2px dashed var(--gold, #e0b050); border-radius: 12px; background: rgba(240, 190, 80, .08); }
body.ech-drag-on, body.ech-drag-on * { cursor: grabbing !important; user-select: none; }
/* Poignées de largeur entre les colonnes (ordinateur, colonnes côte à côte ; echGutSync, game.js). Non positionnées : les menus et
   infobulles qui débordent d'un panneau passent devant. Les colonnes ont une place explicite, la même que celle du placement automatique. */
.ech-gut { display: none; }
@media (min-width: 1250px) {
  html:not(.tel) main[data-tab="echoppe"] > .ech-col { grid-row: 1; grid-column: 1; }
  html:not(.tel) main[data-tab="echoppe"] > .ech-col[data-col="1"] { grid-column: 2; }
  html:not(.tel) main[data-tab="echoppe"] > .ech-col[data-col="2"] { grid-column: 3; }
  html:not(.tel) main[data-tab="echoppe"] > .ech-col[data-col="3"] { grid-column: 4; }
  html:not(.tel) main[data-tab="echoppe"] > .ech-col[data-col="4"] { grid-column: 5; }
  html:not(.tel) main[data-tab="echoppe"] > .ech-gut { display: block; grid-row: 1; align-self: stretch; justify-self: start; width: 14px; min-height: 120px; margin-left: -14px;
    cursor: col-resize; touch-action: pan-y; user-select: none; outline: 0; }
  .ech-gut::before { content: ""; display: block; position: sticky; top: calc(50vh / var(--page-zoom, 1) - 40px); width: 6px; height: 80px; margin: 0 auto; border-radius: 99px; background: var(--gold, #e0b050); opacity: 0; transition: opacity .12s; }
  .ech-gut:hover::before { opacity: .7; }
  .ech-gut:focus-visible::before, .ech-gut.on::before { opacity: 1; }
  .ech-gut:focus-visible { box-shadow: inset 0 0 0 2px var(--gold, #e0b050); border-radius: 7px; }
}
body.ech-drag-on .ech-gut { visibility: hidden; }
body.ech-gut-on, body.ech-gut-on * { cursor: col-resize !important; user-select: none !important; }

.work-col[hidden] { display: none !important; }

/* Changelog : ouvert depuis les Options (26/11/2026, voulu par l'utilisateur) ; pastille rouge sur le bouton Options de l'en-tête
   et sur le bouton « Voir » des Options tant que la dernière version n'a pas été ouverte */
#options-btn { position: relative; }
.cl-dot { position: absolute; top: -4px; right: -4px; width: 14px; height: 14px; border-radius: 50%; background: #e2463a; border: 2px solid #2a1a0c; animation: clPulse 1.6s ease-in-out infinite; pointer-events: none; }
.cl-dot[hidden] { display: none; }
.opt-cl-btn, .tm-t { text-decoration: none; }
.opt-cl-btn { position: relative; display: inline-flex; align-items: center; gap: 8px; }
.opt-cl-btn img.ui-ico { height: 1.2em; width: auto; }
@keyframes clPulse { 50% { transform: scale(1.25); } }
.changelog-dialog { width: min(680px, calc(100vw - 32px)); }
.cl-box { display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 80px); }
.cl-box h2 { display: flex; align-items: center; gap: 8px; }
.cl-list { overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding-right: 6px; }
/* Ascenseur vertical visible (la classe .cl-list sert aussi au registre de la Ville, qui met overflow: hidden) */
.changelog-dialog .cl-list { overflow-x: hidden; overflow-y: scroll; min-height: 0; flex: 1 1 auto; margin-top: 0; padding: 0 10px 0 0;
  background: none; border: 0; border-radius: 0; container-type: normal; scrollbar-width: auto; scrollbar-color: var(--gold, #e0b050) rgba(0, 0, 0, .3); }
.changelog-dialog .cl-list::-webkit-scrollbar { width: 12px; }
.changelog-dialog .cl-list::-webkit-scrollbar-track { background: rgba(0, 0, 0, .3); border-radius: 6px; }
.changelog-dialog .cl-list::-webkit-scrollbar-thumb { background: var(--gold, #e0b050); border-radius: 6px; border: 2px solid rgba(0, 0, 0, .3); }
.cl-entry { padding: 12px 14px; border-radius: 12px; background: rgba(0, 0, 0, .25); border: 1px solid var(--border); }
.cl-entry.latest { border-color: var(--gold, #e0b050); }
.cl-entry h3 { margin: 0 0 8px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cl-entry h3 small { font: 14px var(--font-text); color: var(--muted); }
.cl-entry ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; line-height: 1.4; }

/* Tutoriel : liste avec icônes et schéma animé du glisser-déposer des panneaux */
.tuto-list.tuto-ico { list-style: none; padding-left: 0; gap: 12px; }
.tuto-list.tuto-ico li { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; align-items: start; }
.tuto-list.tuto-ico img.ui-ico { width: 32px; height: 32px; object-fit: contain; justify-self: center; }
.tuto-drag { --h: 46px; --g: 8px; position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 12px 0; padding: 12px; border-radius: 12px; background: rgba(0, 0, 0, .3); border: 1px solid var(--border); }
.td-col { display: flex; flex-direction: column; padding: 6px; border-radius: 8px; background: rgba(255, 255, 255, .04); min-height: calc(var(--h) * 3 + var(--g) * 2); }
.td-p { display: flex; flex-direction: column; gap: 5px; height: var(--h); margin-bottom: var(--g); box-sizing: border-box; border-radius: 6px; overflow: hidden; background: #4a3220; border: 1px solid #7a5530; }
.td-p i { height: 12px; background: #8a5f30; }
.td-p b { height: 5px; margin: 0 8px; border-radius: 3px; background: rgba(255, 255, 255, .18); }
.td-p b + b { width: 55%; }
.td-ph, .td-sp { display: block; box-sizing: border-box; border-radius: 6px; }
.td-ph { height: 0; margin-bottom: 0; border: 2px dashed var(--gold, #e0b050); opacity: 0; animation: tdPh 4.5s ease-in-out infinite; }
.td-sp { height: var(--h); margin-bottom: var(--g); animation: tdSp 4.5s ease-in-out infinite; }
/* le panneau qui voyage de la 3e colonne (en haut) à la 1re (2e place) */
.td-p.td-move { position: absolute; width: calc((100% - 24px - 20px) / 3 - 12px); left: calc(12px + 6px + (100% - 24px - 20px) / 3 * 2 + 20px); top: 18px; margin: 0; z-index: 2; border-color: var(--gold, #e0b050); animation: tdMove 4.5s ease-in-out infinite; }
.td-p.td-move i { background: #c08a3e; }
@keyframes tdMove {
  0% { opacity: 0; }
  6%, 14% { opacity: 1; transform: none; box-shadow: none; left: calc(12px + 6px + (100% - 24px - 20px) / 3 * 2 + 20px); top: 18px; }
  22% { transform: scale(1.06) rotate(-2deg); box-shadow: 0 10px 20px rgba(0, 0, 0, .6); left: calc(12px + 6px + (100% - 24px - 20px) / 3 * 2 + 20px); top: 18px; }
  64% { transform: scale(1.06) rotate(-2deg); box-shadow: 0 10px 20px rgba(0, 0, 0, .6); left: 18px; top: calc(18px + var(--h) + var(--g)); }
  74%, 92% { opacity: 1; transform: none; box-shadow: none; left: 18px; top: calc(18px + var(--h) + var(--g)); }
  100% { opacity: 0; left: 18px; top: calc(18px + var(--h) + var(--g)); }
}
@keyframes tdPh { 0%, 22% { height: 0; margin-bottom: 0; opacity: 0; } 60%, 92% { height: var(--h); margin-bottom: var(--g); opacity: 1; } 100% { height: 0; margin-bottom: 0; opacity: 0; } }
@keyframes tdSp { 0%, 22% { height: var(--h); margin-bottom: var(--g); } 60%, 92% { height: 0; margin-bottom: 0; } 100% { height: var(--h); margin-bottom: var(--g); } }
@media (prefers-reduced-motion: reduce) { .td-p.td-move, .td-ph, .td-sp { animation: none; } .td-p.td-move { left: 18px; top: calc(18px + var(--h) + var(--g)); } .td-sp { height: 0; margin: 0; } .td-ph { height: var(--h); margin-bottom: var(--g); opacity: 1; } }


/* ===== Sélecteur de langue de l'en-tête (#lang-pick, js/lang.js) =====
   Un drapeau (langue en cours, img/langues/drapeau_<fr|en|de>.png) ; au clic, menu déroulant des autres drapeaux. */
.lang-pick { position: relative; display: inline-flex; align-items: center; height: 36px; }
.lang-cur { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 10px; background: var(--panel); border: 1px solid var(--border); border-radius: 20px; cursor: pointer; }
.lang-cur:hover, .lang-cur[aria-expanded="true"] { border-color: var(--gold, #e8b64c); }
.lang-cur img { height: 24px; width: 24px; display: block; border-radius: 5px; }
.lang-caret { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid var(--muted, #b8a98a); }
.lang-menu { position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; padding: 8px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 6px 18px rgba(0, 0, 0, .5); }
.lang-menu[hidden] { display: none; }
.lang-btn { display: inline-flex; align-items: center; justify-content: center; height: 32px; padding: 4px 10px; background: none; border: 1px solid transparent; border-radius: 8px; cursor: pointer; }
.lang-btn[hidden] { display: none; }
.lang-btn img { height: 24px; width: 24px; display: block; border-radius: 5px; }
.lang-btn:hover { border-color: var(--gold, #e8b64c); background: rgba(255, 255, 255, .08); }

/* Pseudo de boutiquier obligatoire (#pseudo-dialog) */
.pseudo-row { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.pseudo-row input { flex: 1; min-width: 0; font-size: 16px; padding: 8px 10px; }
#pseudo-msg:empty { display: none; }

/* Audit UI (25/11/2026) : accessibilité clavier et tactile, sans changer la mise en page bureau */
/* UI-05 : focus clavier visible sur toutes les commandes */
:where(button, [data-action], a[href], input, select, textarea, summary, [tabindex]):focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.tab:focus-visible, .cat-tab:focus-visible, .lang-cur:focus-visible { outline-offset: -3px; }
/* Titre de recettes vide (avant le premier rendu) : pas de bloc fantôme */
#cat-title:empty { display: none; }
/* Ligne de titre des recettes : nom | « + Artisan » au centre exact | filtres. Le bouton passe à la ligne si le panneau est étroit */
.recipes-panel > .cat-title { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); column-gap: 8px; }
.ct-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.ct-slot { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; text-align: center; } /* « + Artisan » puis « Artisan Super » */
.ct-slot .btn { max-width: 176px; line-height: 1.15; padding-left: 12px; padding-right: 12px; } /* niveau requis : 2e ligne */
.ct-slot #buy-super { max-width: none; white-space: nowrap; } /* « Artisan Super (50 gemmes) » sur une ligne */
.ct-toggles { display: flex; justify-content: flex-end; }
.recipes-panel { container: recp / inline-size; }
@container recp (max-width: 414px) {
  .recipes-panel > .cat-title { grid-template-columns: minmax(0, 1fr) auto; row-gap: 8px; }
  .ct-slot { grid-row: 2; grid-column: 1 / -1; }
  .ct-toggles { grid-row: 1; grid-column: 2; }
}
/* Avec « Artisan Super » à côté de « + Artisan » : la paire passe sur sa propre ligne plus tôt (le titre garde sa place) */
@container recp (max-width: 600px) {
  .recipes-panel > .cat-title:has(#buy-super) { grid-template-columns: minmax(0, 1fr) auto; row-gap: 8px; }
  .recipes-panel > .cat-title:has(#buy-super) .ct-slot { grid-row: 2; grid-column: 1 / -1; }
  .recipes-panel > .cat-title:has(#buy-super) .ct-toggles { grid-row: 1; grid-column: 2; }
}
/* UI-06 / UI-15 : cibles tactiles confortables (zone de clic élargie, sans bouger la mise en page) */
.fav-btn, .info-ico, .qreward.gift { position: relative; }
.fav-btn::after, .info-ico::after { content: ""; position: absolute; inset: -8px; }
@media (pointer: coarse), (max-width: 700px) {
  .btn.small { min-height: 40px; }
  .btn.small.fold-btn { min-width: 44px; }
  .qreward.gift { min-height: 36px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

/* Lignes parasites sur les boutons : la cause est le 9-slice (border-image). Aux zooms 90/110/125/150 %, les bordures de 15/18/16 px
   tombent sur des pixels écran fractionnaires (ex. 15 px × 1,1 = 16,5) ; le navigateur filtre alors les jointures entre tranches
   et laisse un trait clair. On arrondit donc l'épaisseur des bordures au pixel ÉCRAN entier (--dpr est posé par index.html). */
@supports (width: round(1.4px, 1px)) {
  .btn { --bt: calc(round(15px * var(--dpr, 1), 1px) / var(--dpr, 1)); --br: calc(round(18px * var(--dpr, 1), 1px) / var(--dpr, 1)); --bb: calc(round(16px * var(--dpr, 1), 1px) / var(--dpr, 1)); }
  .btn.small { --bt: calc(round(12px * var(--dpr, 1), 1px) / var(--dpr, 1)); --br: calc(round(15px * var(--dpr, 1), 1px) / var(--dpr, 1)); --bb: calc(round(13px * var(--dpr, 1), 1px) / var(--dpr, 1)); }
  .btn::before, .btn.small::before { border-width: var(--bt) var(--br) var(--bb); border-image-width: var(--bt) var(--br) var(--bb); }
}
/* Fenêtre « choix des héros » : centrée par inset + margin auto (pas de demi-pixels), donc sans flou ni jointures sur ses boutons */
.party { transform: none; inset: 0; margin: auto; }

/* ---------- Tutoriels (js/tutoriel.js) : bulle contextuelle, contour doré, fenêtre d'accueil, centre d'aide, badges ---------- */
.gd-ring { position: fixed; z-index: 950; pointer-events: none; border: 2px solid var(--gold); border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .6), 0 0 16px 3px rgba(233, 185, 73, .45); }
.gd-ring.dim { box-shadow: 0 0 0 1px rgba(0, 0, 0, .6), 0 0 16px 3px rgba(233, 185, 73, .45), 0 0 0 100vmax rgba(0, 0, 0, .28); }
.gd-ring::after { content: ""; position: absolute; inset: -6px; border-radius: 16px; border: 2px solid rgba(233, 185, 73, .55); animation: gdPulse 1.8s ease-out infinite; }
@keyframes gdPulse { from { opacity: .9; transform: scale(1); } to { opacity: 0; transform: scale(1.06); } }
.gd-bubble { position: fixed; z-index: 951; left: 0; top: 0; width: min(360px, calc(100vw - 16px)); box-sizing: border-box; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 8px; color: var(--text); font-size: 15px; line-height: 1.4;
  background: linear-gradient(180deg, #3b2c1f, #2a2018); border: 2px solid #b8893a; border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .65), inset 0 0 0 1px rgba(255, 220, 150, .1); }
.gd-bubble[hidden] { display: none; }
.gd-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gd-title { display: flex; align-items: center; gap: 8px; font: 17px/1.2 var(--font-title); color: var(--gold); }
.gd-title .ui-ico { height: 22px; width: auto; }
.gd-body p { margin: 0 0 6px; }
.gd-body p:last-child { margin-bottom: 0; }
.gd-do { color: #fff; }
.gd-pts { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.gd-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.gd-foot .tuto-btns { margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.gd-find { display: flex; justify-content: center; }
.gd-find[hidden] { display: none; }
.gd-link { background: none; border: 0; padding: 4px 0; color: var(--muted); font: 13px var(--font-text); text-decoration: underline; cursor: pointer; }
.gd-link:hover { color: var(--text); }
.gd-note { margin: 6px 0 0; font-size: 15px; }
/* Flèche vers la cible (carré tourné, mêmes couleurs que la bulle) */
.gd-arrow { position: absolute; width: 14px; height: 14px; background: #3b2c1f; border: 2px solid #b8893a; transform: translate(-50%, -50%) rotate(45deg); }
.gd-bubble[data-side="below"] .gd-arrow { top: 0; border-right: 0; border-bottom: 0; }
.gd-bubble[data-side="above"] .gd-arrow { top: 100%; background: #2a2018; border-left: 0; border-top: 0; }
.gd-bubble[data-side="right"] .gd-arrow { left: 0; border-right: 0; border-top: 0; }
.gd-bubble[data-side="left"] .gd-arrow { left: 100%; border-left: 0; border-bottom: 0; }
.gd-bubble[data-side="none"] .gd-arrow { display: none; }
/* Fenêtre d'accueil / de fin */
.guide-dialog { width: min(520px, calc(100vw - 32px)); border: 2px solid #b8893a; background: linear-gradient(180deg, #3b2c1f, #2a2018); }
.gd-modal { align-items: center; text-align: center; }
.gd-modal h2 { justify-content: center; color: var(--gold); }
.gd-modal .tuto-foot { width: 100%; }
.gd-illu { width: 96px; height: 96px; object-fit: contain; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .6)); }
/* Centre d'aide (bouton « ? ») */
.help-btn { font: 18px/1 var(--font-title); min-width: 36px; }
/* Centre d'aide « Aide et tutoriels » (Guide.renderHelp, tutoriel.js ; refonte du 03/12/2026) : même gabarit que les Options
   (.op-head, .op-tabs, .op-body, .op-sec, .op-row, .op-sw, variables --op-*). Fond crème uni arrondi (brun sombre avec « Fenêtres sombres »),
   jamais de contour sur les bords, taille fixe quel que soit l'onglet ou le filtre : seul le corps (.ad-body) défile. */
.aide-dialog {
  --op-bg: #fdeecc; --op-ink: #3a2412; --op-ink-2: #5a3a1b; --op-muted: #7a5a38; --op-accent: #8a5a10; --op-line: #e3cc9c;
  --op-card: rgba(214, 190, 140, .28); --op-sel: #f7dc97; --op-off: #c4ab80; --op-on: #2f9a5a; --op-knob: #fffaf0; --ad-ok: #2f7a3b;
  width: min(900px, calc(100vw - 32px)); height: min(860px, calc(100dvh - 32px)); max-height: none; box-sizing: border-box;
  padding: 20px; overflow: hidden; border: 0; border-radius: 18px; background: var(--op-bg); color: var(--op-ink);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .6); font-size: 16px;
}
html.dark-win .aide-dialog {
  --op-bg: var(--dw-bg); --op-ink: var(--dw-ink); --op-ink-2: var(--dw-ink-2); --op-muted: var(--dw-ink-3); --op-accent: var(--dw-accent); --op-line: var(--dw-line);
  --op-card: var(--dw-card); --op-sel: var(--dw-band); --op-off: #6b5236; --op-on: #3fae6a; --op-knob: #f1e6d4; --ad-ok: var(--dw-ok); color-scheme: dark;
}
.aide-dialog .op-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ad-filters { flex: none; display: flex; flex-wrap: wrap; gap: 8px; }
.ad-chip { display: inline-flex; align-items: center; gap: 8px; height: 38px; box-sizing: border-box; padding: 0 8px 0 12px; border: 0; border-radius: 19px;
  background: var(--op-card); color: var(--op-ink-2); font: 16px/1 var(--font-text); white-space: nowrap; cursor: pointer; }
.ad-chip:first-child { padding-left: 14px; }
.ad-chip img { width: 24px; height: 24px; object-fit: contain; }
.ad-chip small { min-width: 24px; height: 22px; box-sizing: border-box; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 11px; background: rgba(90, 58, 24, .12); font-size: 13px; font-variant-numeric: tabular-nums; }
.ad-chip:hover { color: var(--op-ink); }
.ad-chip.on { background: var(--op-sel); color: var(--op-ink); box-shadow: inset 0 0 0 2px #e9b949; }
.ad-chip:focus-visible, .ad-card .btn:focus-visible { outline: 2px solid var(--op-accent); outline-offset: 2px; }
.ad-sec h3 { font-size: 16px; }
.ad-sec h3 img { width: 28px; height: 28px; object-fit: contain; }
.ad-here { padding: 4px 10px 3px; border-radius: 10px; background: #1f5440; color: #fff; font: normal 12px/1 var(--font-title); letter-spacing: .04em; text-transform: none; }
.ad-sec h3:has(.ad-here)::after { margin-left: 2px; }
.ad-grid { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ad-card { display: grid; grid-template-columns: 52px minmax(0, 1fr) 104px; align-items: center; gap: 12px; min-height: 88px; box-sizing: border-box;
  padding: 10px 12px; border-radius: 12px; background: var(--op-card); }
.ad-card.ad-new { background: var(--op-sel); }
.ad-ico { width: 52px; height: 52px; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .3)); }
.ad-txt { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ad-txt b { font-size: 17px; line-height: 1.2; color: var(--op-ink); overflow-wrap: anywhere; }
.ad-txt small { font-size: 14px; line-height: 1.35; color: var(--op-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ad-side { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.ad-pill { align-self: center; max-width: 100%; box-sizing: border-box; padding: 4px 10px 3px; border-radius: 10px; background: rgba(90, 58, 24, .12); color: var(--op-muted);
  font: 12px/1.1 var(--font-title); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-new .ad-pill { background: #7be08a; color: #1d1209; }
.ad-run .ad-pill { background: #e9b949; color: #1d1209; }
.ad-done .ad-pill { background: rgba(47, 154, 90, .16); color: var(--ad-ok); }
.ad-side .btn { width: 100%; justify-content: center; }
.ad-foot { margin: 16px 0 4px; text-align: center; }
.ad-rico { width: 40px; height: 40px; object-fit: contain; justify-self: center; }
.ad-rule { font-size: 16px; line-height: 1.4; color: var(--op-ink-2); }
html.dark-win .ad-chip small, html.dark-win .ad-pill { background: rgba(0, 0, 0, .28); }
html.dark-win .ad-new .ad-pill { background: #7be08a; } html.dark-win .ad-run .ad-pill { background: #e9b949; }
html.dark-win .ad-done .ad-pill { background: rgba(120, 190, 90, .16); }
@media (max-width: 760px) { .ad-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) {
  .aide-dialog { padding: 16px; }
  .ad-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .ad-chip { flex: none; }
  .ad-card { grid-template-columns: 44px minmax(0, 1fr) 96px; gap: 10px; padding: 10px; }
  .ad-ico { width: 44px; height: 44px; }
  .aide-dialog .op-row.op-val .op-ctrl { grid-column: 2 / -1; justify-content: flex-start; }
}
/* Téléphone : plein écran (l'emporte sur la règle générale des .save-dialog de mobile.css) */
html.tel dialog#aide-dialog { width: 100%; height: 100dvh; max-width: none; max-height: none; margin: 0; border-radius: 0;
  padding: calc(10px + var(--st)) calc(12px + var(--sr)) calc(12px + var(--sb)) calc(12px + var(--sl)); }
/* Déblocages : badge « Nouveau », léger halo ; cadenas d'un prochain déblocage */
.tab-badge.gd-new { background: #7be08a; }
.tab.gd-glow { box-shadow: 0 0 10px 1px rgba(233, 185, 73, .55); animation: gdGlow 2.4s ease-in-out infinite; }
@keyframes gdGlow { 50% { box-shadow: 0 0 4px 0 rgba(233, 185, 73, .25); } }
.tab.gd-locked { opacity: .75; }
.tab-lock .ui-ico { height: 16px; width: auto; vertical-align: -2px; }
.gd-new-panel { position: relative; }
.gd-new-panel::after { content: attr(data-gd-new); position: absolute; top: -10px; right: 8px; font: 12px/1 var(--font-title); color: #1d1209; background: #7be08a;
  border-radius: 10px; padding: 3px 8px; box-shadow: 0 0 10px rgba(123, 224, 138, .6); pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .gd-ring::after, .tab.gd-glow { animation: none; } }

/* Jointures des boutons : sous le 9-slice, deux barres pleines en croix (couleur du bouton, calées à l'intérieur du contour doré,
   à 7 px des bords) recouvrent les 4 lignes de jointure entre tranches. Si le navigateur laisse un demi-pixel transparent à une
   jointure (zoom 110 / 125 %), on voit la couleur du bouton et non le fond sombre : plus de trait clair. */
.btn { --btn-fill: #ffd35d; }
.btn.primary { --btn-fill: #28c88e; }
.btn.ghost { --btn-fill: #09b8f1; }
.btn.danger, .btn[data-action="refuse"], .btn[data-action="abandonQuest"], .btn[data-action="reset"] { --btn-fill: #cd3434; }
.btn:disabled { --btn-fill: #b5a998; }
.btn:active:not(:disabled) { --btn-fill: #be7e25; }
.btn.primary:active:not(:disabled) { --btn-fill: #127956; }
.btn.ghost:active:not(:disabled) { --btn-fill: #05698b; }
.btn.danger:active:not(:disabled), .btn[data-action="refuse"]:active:not(:disabled), .btn[data-action="abandonQuest"]:active:not(:disabled), .btn[data-action="reset"]:active:not(:disabled) { --btn-fill: #9f2323; }
.btn::before {
  background-origin: border-box; background-repeat: no-repeat;
  background-image: linear-gradient(var(--btn-fill), var(--btn-fill)), linear-gradient(var(--btn-fill), var(--btn-fill));
  background-position: 7px 14px, 17px 7px;
  background-size: calc(100% - 14px) calc(100% - 29px), calc(100% - 34px) calc(100% - 14px);
}
.btn.small::before {
  background-position: 6px 11px, 14px 6px;
  background-size: calc(100% - 12px) calc(100% - 23px), calc(100% - 28px) calc(100% - 12px);
}

/* ===== Spec UI PC ===== */

/* Icônes de talent et d'équipement : mêmes tailles partout, quel que soit le nombre de types acceptés */
.hskills .skill img.sk { width: 20px; height: 20px; flex: none; margin: 0; }
.hskills .skill { white-space: normal; line-height: 1.2; }
.hcard-icons[data-n="1"] .htype { width: 40cqw; height: 40cqw; }
.hcard-icons[data-n="1"] { grid-template-columns: 40cqw; }
.hcard-icons[data-n="2"] .htype { width: 32cqw; height: 32cqw; }
.hcard-icons[data-n="2"] { grid-template-columns: repeat(2, 32cqw); }
.hcard-icons[data-n="3"] .htype, .hcard-icons[data-n="4"] .htype { width: 26cqw; height: 26cqw; }
.hcard-icons[data-n="3"], .hcard-icons[data-n="4"] { grid-template-columns: repeat(2, 26cqw); }

/* 03 · Message de plafond de niveau = bouton qui ouvre le bâtiment dans la Ville */
button.lvl-cap { display: block; width: 100%; box-sizing: border-box; font: inherit; font-size: 13px; line-height: 1.3; cursor: pointer; position: relative; padding-right: 22px; }
button.lvl-cap:hover, button.lvl-cap:focus-visible { background: rgba(233, 150, 49, .28); border-color: var(--gold); outline: none; }
button.lvl-cap:focus-visible { box-shadow: 0 0 0 2px var(--gold); }
button.lvl-cap .lc-go { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 20px; color: var(--gold); }

/* 04 · Objet de commande / de récompense : l'icône et le nom ouvrent la fiche de l'objet */
.oc-link { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; display: inline-flex; align-items: center; }
.oc-link.oc-ico { justify-content: center; }
.oc-link:not(.oc-ico):hover, .oc-link:not(.oc-ico):focus-visible { text-decoration: underline; text-underline-offset: 3px; }
.oc-link:hover.oc-ico { filter: brightness(1.2); transform: scale(1.06); }
.oc-link:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }

/* 06 · Emplacement d'expédition finançable : icône déverrouillée, halo doré, états survol et clavier */
.slot-lock img.ui-ico, .slot-lock img { height: 34px; width: auto; vertical-align: middle; }
.slot-tile.locked.ready { background: linear-gradient(#ffd45a, #d98a12); border-color: #fff1b0; cursor: pointer; animation: slotReady 1.8s ease-in-out infinite; }
.slot-tile.locked.ready:hover, .slot-tile.locked.ready:focus-visible { filter: brightness(1.12); transform: translateY(-2px); outline: none; }
.slot-tile.locked.ready:focus-visible { box-shadow: 0 0 0 3px #4a2411, 0 0 0 6px #fff; }
.slot-tile.locked.ready:active { transform: translateY(1px); }
.slot-tile.locked:disabled { cursor: not-allowed; }
@keyframes slotReady {
  0%, 100% { box-shadow: 0 0 0 3px #4a2411, 0 4px 8px rgba(0, 0, 0, .55), 0 0 6px 1px rgba(255, 210, 80, .4), inset 0 0 0 2px rgba(255, 255, 255, .25); }
  50% { box-shadow: 0 0 0 3px #4a2411, 0 4px 8px rgba(0, 0, 0, .55), 0 0 18px 6px rgba(255, 210, 80, .85), inset 0 0 0 2px rgba(255, 255, 255, .25); }
}
@media (prefers-reduced-motion: reduce) { .slot-tile.locked.ready { animation: none; } }

/* 07 · Recettes : « Maîtrisé » + « i » et « Fabriquer » dans une même colonne d'actions, centrés sur le même axe ;
   plus de place pour le nom et les ingrédients (colonne de liste un peu plus large, texte qui passe à la ligne) */
.recipe .r-cost { overflow-wrap: anywhere; line-height: 1.3; }

/* 08 · Fenêtre « Équipement d'arène » : centrée sans translate(-50%) (demi-pixels qui faisaient apparaître des traits sur les boutons
   Équipement de quête / d'arène). Les jointures du 9-slice sont aussi couvertes par le composant .btn (voir plus haut). */
.dp.ae { transform: none; inset: 0; left: 0; top: 0; margin: auto; height: fit-content; }
.dp.ae .btn.small { will-change: auto; }

/* 09 · Effets courts (js/game.js : fxAt / fxSale / fxPulse). Jamais cliquables ; sans déplacement si « réduire les animations » (.still) */
#fx-layer { position: fixed; inset: 0; z-index: 2000; pointer-events: none; overflow: hidden; }
.fx { position: fixed; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 2px; pointer-events: none;
  font-family: var(--font-title), serif; color: #fff; text-shadow: 0 2px 3px #000, 0 0 6px #000; white-space: nowrap; }
.fx .fx-txt { font-size: 20px; -webkit-text-stroke: 4px #3a2412; paint-order: stroke fill; }
.fx img.ui-ico, .fx img { height: 1.4em; width: auto; }
.fx-sale .fx-coin { display: block; animation: fxCoin .95s cubic-bezier(.2, .7, .3, 1) both; }
.fx-sale .fx-coin img { height: 34px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .6)); }
.fx-sale .fx-txt { color: #ffd45a; animation: fxRise 1.2s ease-out both; }
@keyframes fxCoin {
  0% { transform: translateY(14px) scale(.5); opacity: 0; } 14% { opacity: 1; }
  42% { transform: translateY(-70px) scale(1.15); } 62% { transform: translateY(-34px) scale(1); }
  76% { transform: translateY(-52px); } 88% { transform: translateY(-42px); } 100% { transform: translateY(-42px); opacity: 0; }
}
.nowrap { white-space: nowrap; }
/* Client fortuné (fxFortune) : vente payée × CITY.fortuneMult */
.fx-fortune .fx-coin { animation: fxPopBig 1s cubic-bezier(.2, 1.4, .4, 1) both; }
.fx-fortune .fx-coin img { height: 56px; filter: drop-shadow(0 0 14px #ffd45a) drop-shadow(0 2px 3px rgba(0, 0, 0, .6)); }
.fx-fortune .fx-txt { font-size: 26px; animation: fxRise 2s ease-out both; }
.fx-fortune .fx-up { animation-duration: 2s; }
.fx-fortune .fx-ring { top: 28px; }
.fx-rain { position: absolute; left: 50%; top: 0; animation: fxRain 1.3s cubic-bezier(.3, .6, .5, 1) var(--dl) both; }
.fx-rain img { height: 22px; }
@keyframes fxRain { 0% { transform: translate(0, 20px) scale(.4); opacity: 0; } 15% { opacity: 1; } 45% { transform: translate(var(--dx), -80px) scale(1) rotate(180deg); } 100% { transform: translate(calc(var(--dx) * 1.4), 40px) rotate(400deg); opacity: 0; } }
@keyframes fxRise { 0%, 25% { transform: translateY(0); opacity: 0; } 40% { opacity: 1; } 100% { transform: translateY(-46px); opacity: 0; } }
.fx-refuse .fx-no { animation: fxShake .5s ease-out both; }
.fx-refuse .fx-no img { height: 30px; }
.fx-refuse .fx-txt { color: #ff8a7a; animation: fxRise 1s ease-out both; }
@keyframes fxShake { 0% { transform: translateX(0) scale(.6); opacity: 0; } 20% { transform: translateX(-6px) scale(1.1); opacity: 1; } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } 100% { transform: none; opacity: 1; } }
.fx-fuse .fx-item { display: flex; font-size: 56px; animation: fxPop .7s cubic-bezier(.2, 1.4, .4, 1) both; filter: drop-shadow(0 0 12px var(--q)) drop-shadow(0 3px 3px rgba(0, 0, 0, .6)); }
.fx-fuse .fx-item img { height: 76px; }
.fx-fuse .fx-txt { animation: fxRise 1.4s ease-out both; }
.fx-fuse.up .fx-item { animation: fxPopBig 1s cubic-bezier(.2, 1.4, .4, 1) both; filter: drop-shadow(0 0 22px var(--q)) drop-shadow(0 0 8px #fff8) drop-shadow(0 3px 3px rgba(0, 0, 0, .6)); }
.fx-fuse.up .fx-item img { height: 92px; }
.fx-up { font-size: 17px; color: #ffe45c; -webkit-text-stroke: 3px #7a2a05; paint-order: stroke fill; animation: fxRise 1.8s ease-out both; }
.fx-ring { position: absolute; left: 50%; top: 40px; width: 90px; height: 90px; margin: -45px 0 0 -45px; border-radius: 50%; border: 4px solid #ffe45c; box-shadow: 0 0 18px #ffd45a; animation: fxRing .9s ease-out both; }
@keyframes fxPop { 0% { transform: scale(.3) translateY(10px); opacity: 0; } 55% { transform: scale(1.2); opacity: 1; } 100% { transform: scale(1); } }
@keyframes fxPopBig { 0% { transform: scale(.2) rotate(-12deg); opacity: 0; } 50% { transform: scale(1.45) rotate(4deg); opacity: 1; } 75% { transform: scale(.95); } 100% { transform: scale(1.1); } }
@keyframes fxRing { 0% { transform: scale(.3); opacity: 1; } 100% { transform: scale(2.4); opacity: 0; } }
/* Fin de fabrication (fxCraft) : la révélation de fusion à la taille d'un artisan ; texte qui monte peu, pour ne pas couvrir le voisin */
.fx-craft .fx-item { font-size: 36px; }
.fx-craft .fx-item img { height: 48px; }
.fx-craft.up .fx-item img { height: 56px; }
.fx-craft .fx-txt { font-size: 16px; animation-name: fxRiseSmall; }
.fx-craft .fx-up { font-size: 14px; animation-name: fxRiseSmall; }
.fx-craft .fx-ring { top: 28px; width: 60px; height: 60px; margin: -30px 0 0 -30px; }
@keyframes fxRiseSmall { 0% { transform: translateY(0); opacity: 0; } 20% { opacity: 1; } 75% { opacity: 1; } 100% { transform: translateY(-14px); opacity: 0; } }
.fx-level .fx-star { display: flex; animation: fxPop .8s cubic-bezier(.2, 1.4, .4, 1) both; } .fx-level .fx-star img { height: 40px; }
.fx-level .fx-txt, .fx-build .fx-txt, .fx-unlock .fx-txt { color: #ffd45a; animation: fxRise 1.5s ease-out both; }
.fx-unlock .fx-star { display: flex; animation: fxPop .7s cubic-bezier(.2, 1.4, .4, 1) both; } .fx-unlock .fx-star img { height: 40px; }
.fx.still, .fx.still * { animation-duration: .01ms !important; animation-delay: 0s !important; }
.fx.still .fx-txt, .fx.still .fx-up { opacity: 1 !important; transform: none !important; }
.fx-pulse { animation: fxPulseK 1.2s ease-out; }
@keyframes fxPulseK { 0% { box-shadow: 0 0 0 0 rgba(255, 210, 80, .9); } 60% { box-shadow: 0 0 0 14px rgba(255, 210, 80, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 210, 80, 0); } }
@media (prefers-reduced-motion: reduce) { .fx-pulse { animation: none; } }

/* 10 · Fenêtre de fusion : large sur PC, emplacements sur une ligne, contrastes renforcés, filtres, grille à défilement vertical */
/* hauteur fixe : filtrer la liste ne redimensionne pas la fenêtre (la liste prend la place restante) */
.fusion-dialog { width: min(1500px, calc(100vw - 32px)); height: calc(100vh - 32px); max-height: calc(100vh - 32px); overflow: hidden; }
.fusion-dialog[open] { display: flex; flex-direction: column; }
.fusion-dialog .fu-box { max-width: none; display: flex; flex-direction: column; min-height: 0; flex: 1; }
.fusion-dialog .small-text { color: #f3e8d0; font-size: 15px; line-height: 1.4; }
.fu-main { grid-template-columns: minmax(0, 1fr); gap: 10px; }
.fu-sels { display: flex; flex-wrap: wrap; gap: 8px; }
.fu-sl { flex: 1 1 78px; max-width: 120px; min-height: 84px; color: #d9c9a6; border-color: #8a7452; background: rgba(0, 0, 0, .35); font-size: 13px; }
.fu-sl.full { color: #2a1706; }
.fu-sl.full small { font-size: 13px; line-height: 1.15; overflow-wrap: anywhere; text-align: center; }
.fu-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 6px 12px; align-items: start; }
.fu-results > .fu-rt { grid-column: 1 / -1; }
.fu-rt { color: #ffd45a; font-size: 17px; }
.fu-out { background: rgba(0, 0, 0, .45); border: 1px solid #6b5535; padding: 6px 10px; }
.fu-out b { font-size: 18px; color: #a6ffa6; }
.fu-out.best { border-color: var(--gold); background: rgba(233, 185, 73, .16); }
.fu-on { font-size: 15px; overflow-wrap: anywhere; }
.fu-on small { color: #e6d6b4; font-size: 13px; }
.fu-foot > span { color: #f3e8d0; }
.fu-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 6px 0 8px; padding: 8px 10px; border-radius: 10px; background: rgba(0, 0, 0, .3); border: 1px solid var(--border); }
.fu-filters label { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; color: #f3e8d0; }
.fu-filters select { min-width: 150px; height: 34px; padding: 0 8px; font: inherit; font-size: 15px; color: var(--text); background: var(--panel-2); border: 1px solid #8a7452; border-radius: 8px; }
.fu-filters select:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.fu-count { margin-left: auto; color: #e6d6b4; font-size: 14px; }
.fu-pick { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); max-height: none; flex: 1 1 auto; min-height: 150px; overflow-y: auto; overflow-x: hidden; padding: 8px 8px 4px; align-content: start; }
.fusion-dialog .fu-box .fu-pick { flex: 1 1 0; max-height: none; min-height: 120px; }
/* sous l'en-tête (titre et croix fixes) : le contenu défile quand la hauteur manque, la liste garde 120 px */
.fu-body { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: hidden auto; margin: 0 -4px; padding: 0 4px; }
.fu-body > * { flex: none; }
.fu-card { padding: 8px 6px 6px; font-size: 13px; color: #2a1706; }
.fu-cn { font-size: 14px; line-height: 1.15; overflow-wrap: anywhere; }
.fu-card small { font-size: 13px; color: #4a3218; }
.fu-empty { grid-column: 1 / -1; text-align: center; color: #f3e8d0; font-size: 16px; padding: 24px 8px; margin: 0; }
@media (max-width: 700px) { .fu-results { grid-template-columns: 1fr; } .fu-sl { max-width: none; } }
/* Fiches de fusion : fond sombre pour que les noms en couleur de qualité restent lisibles */
.fu-card, .fu-sl.full { background: linear-gradient(#3d2e20, #2a2018); color: #f6ecd4; }
.fu-card small, .fu-sl.full small { color: #e6d6b4; }
.fu-card .fu-n { background: #fff6dc; }
/* Filtre Talents : cercle à la couleur de la qualité exigée, étoile estompée tant que le talent n'est pas débloqué */
.fu-tal { position: absolute; top: -6px; left: -6px; width: 24px; height: 24px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border-radius: 50%; border: 2px solid var(--tq); background: #1f1812; }
.fu-tal img { width: 16px; height: 16px; object-fit: contain; }
.fu-tal.off img { filter: grayscale(1); opacity: .5; }
.fu-card:hover:not(:disabled) { filter: brightness(1.15); }

/* ===== Lot de modifications du 25/11 (suite) ===== */
/* Sélecteur d'objets d'arène : collé en haut de l'écran ; la fenêtre « Équipement d'arène » passe en bas (voir snapDialogs) */
/* Filtre par catégorie (stock et chaudron) : mêmes tuiles que l'onglet Recettes */
.cat-filter { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 10px; } /* pas de 42 px (36 + 6) : colonnes alignées d'une rangée à l'autre */
.cat-filter[hidden] { display: none; }
.cat-filter { align-items: flex-start; flex-wrap: nowrap; container-type: inline-size; }
/* mêmes lignes que les Recettes : 9 colonnes (chaudron : voir « Type du chaudron » plus bas), tuiles réduites de quelques px si la place manque */
.cat-filter .cat-tab.has-img { width: min(36px, calc((100cqw - 48px) / 9)); height: min(36px, calc((100cqw - 48px) / 9)); min-width: 0; }
.cat-filter .cat-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cat-filter .cat-row { display: flex; gap: 6px; }
.cat-filter .family.fam-accessoires, .cat-filter .family.fam-valeurs { display: flex; gap: 6px; }
.cat-filter .cat-tab:disabled { cursor: default; transform: none; filter: none; }
.cat-filter .cat-tab:disabled .tile-img { filter: grayscale(1) brightness(.75); opacity: .45; }
.cat-filter .cat-tab.cf-all { flex: none; padding: 0; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--border); color: var(--text); font: 600 13px var(--font-text); display: inline-flex; align-items: center; justify-content: center; }
.cat-filter .cat-tab.cf-all.sel { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 0 2px var(--gold); }
.fu-filters .fu-cats { margin: 0; flex: 1 1 100%; }
@media (max-height: 900px) { .dp.ae.ae-high .hint { display: none; } .dp.ae.ae-high { padding: 10px 14px; gap: 8px; } }

/* Recettes : tuiles sur une grille régulière (pas de 42 px), sans écart supplémentaire entre familles ni décalage de la dernière */
.cat-tabs { gap: 6px; }
@container (min-width: 720px) { .family.fam-valeurs { margin-left: 0; } }
/* Rangs du chaudron : icônes de rang (niveau d'objet), 25 par ligne ; « + » déplie la suite */
.fu-ranks { display: flex; align-items: flex-start; gap: 10px; flex: 1 1 100%; }
.fu-rk-lbl { font-size: 15px; color: #f3e8d0; line-height: 38px; }
.fu-rk-grid { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.fu-rk-row { display: grid; grid-template-columns: repeat(25, minmax(0, 1fr)); gap: 4px; max-width: 1200px; }
.fu-rk-row[hidden] { display: none; }
.rk-badge { position: relative; aspect-ratio: 145 / 152; max-height: 40px; width: 100%; padding: 0; border: 0; background: url("../img/ui/niveau_heros.png") center / contain no-repeat; cursor: pointer; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .5)); transition: transform .1s, filter .15s; display: flex; align-items: center; justify-content: center; }
.rk-badge b { color: #fff; font-family: var(--font-title); font-size: 15px; line-height: 1; padding-bottom: 2px; text-shadow: -1px -1px 0 #3a0c0c, 1px -1px 0 #3a0c0c, -1px 1px 0 #3a0c0c, 1px 1px 0 #3a0c0c; }
.rk-badge b.d2 { font-size: 14px; }
.rk-badge:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.15) drop-shadow(0 2px 2px rgba(0, 0, 0, .5)); }
.rk-badge.sel { filter: drop-shadow(0 0 6px var(--gold)) drop-shadow(0 0 2px #fff8); transform: translateY(-2px); }
.rk-badge.none { opacity: .35; filter: grayscale(.8); cursor: default; }
.rk-badge:focus-visible, .rk-more:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 8px; }
.rk-more { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--gold); background: var(--panel-2); color: var(--gold); font: 700 22px/1 var(--font-title); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0 0 3px; }
.rk-more:hover { filter: brightness(1.2); }
@media (max-width: 900px) { .fu-rk-row { grid-template-columns: repeat(13, minmax(0, 1fr)); } }

/* ===== Cartes de recette (Atelier) : refonte d'après la maquette « Bottes rouges avec / sans compétence ===== */
.recipe .r-lv { padding: 1px 8px; border: 1px solid var(--border); border-radius: 99px; font-size: 13px; white-space: nowrap; }
.recipe .r-cost { display: flex; flex-direction: column; gap: 2px; }
.recipe .r-res { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.recipe .r-line { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; column-gap: 8px; padding: 1px 0; border-top: 1px solid rgba(255, 255, 255, .08); color: var(--text); white-space: normal; }
.recipe .r-line .cl-ico { display: inline-flex; justify-content: center; }
.recipe .r-line .cl-name { min-width: 0; overflow-wrap: anywhere; }
.recipe .r-line .have { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.recipe .r-line.lack { color: var(--text); }
/* Composant requis cliquable → sa recette (action goRecipe) ; carte d'arrivée mise en évidence */
.recipe .r-line[data-action="goRecipe"] { cursor: pointer; border-radius: 4px; }
.recipe .r-line[data-action="goRecipe"]:hover { background: rgba(255, 255, 255, .07); }
.recipe .r-line[data-action="goRecipe"]:hover .cl-name { text-decoration: underline; text-underline-offset: 3px; }
.recipe.rc-flash { animation: rcFlash 1.6s ease-out; }
@keyframes rcFlash { 0%, 40% { box-shadow: inset 0 0 0 3px var(--gold); } 100% { box-shadow: inset 0 0 0 0 transparent; } }
.recipe .r-meta .sep { font-style: normal; opacity: .5; margin: 0 4px; }
.recipe .r-act .btn:disabled { opacity: .55; filter: grayscale(.5); cursor: not-allowed; }
.r-skill { position: relative; display: flex; align-items: center; gap: 6px; width: 100%; height: 100%; box-sizing: border-box; padding: 0 8px; border-radius: 10px; border: 1px solid #3f6fb5; background: rgba(40, 80, 150, .22); color: var(--text); font-size: 14px; cursor: help; }
.r-skill.off { opacity: .6; filter: grayscale(.5); }
.r-skill .sk-ico { flex: none; display: inline-flex; width: 22px; justify-content: center; }
.r-skill .sk-name { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-skill .sk-tip { display: none; position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 20; width: max-content; max-width: 260px; padding: 8px 10px; border-radius: 10px; background: rgba(24, 16, 10, .97); border: 1px solid #5b3a1c; color: #f3e4c4; font-size: 13px; line-height: 1.35; white-space: normal; box-shadow: 0 6px 18px rgba(0, 0, 0, .6); pointer-events: none; }
.r-skill:hover .sk-tip, .r-skill:focus .sk-tip, .r-skill:focus-visible .sk-tip { display: block; }
.recipes { container: recipes / inline-size; }
/* Liste des recettes (ordinateur) : seules les cartes défilent. Hauteur --rc-h (syncRecipesH) : place libre à l'écran, au moins 4 cartes.
   Fond opaque : texte lissé (notes, « Fluidité du défilement »). Arrivée au bord, la molette fait défiler la page (pas d'overscroll-behavior). */
html:not(.tel) .recipes { max-height: var(--rc-h, 560px); box-sizing: border-box; overflow: hidden auto; scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: #8a6a3c transparent;
  padding: 4px 2px 4px 4px; margin: -4px -11px -8px -4px; background: var(--panel); scroll-padding: 8px; align-content: start; will-change: scroll-position; } /* sans will-change, Chrome redessine tout le panneau à chaque pas */
.r-skill.tip-down .sk-tip { bottom: auto; top: calc(100% + 6px); }
/* Ligne « N recettes plus anciennes » */
.rc-more { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; column-gap: 16px; width: 100%; min-height: 48px; box-sizing: border-box; margin: 3px 0; padding: 4px 12px; border: 0; border-radius: 8px; background: rgba(255, 255, 255, .06); color: var(--text); font: inherit; font-size: 16px; line-height: 1.2; text-align: left; cursor: pointer; }
.rc-more:hover { background: rgba(255, 255, 255, .1); }
.rc-more:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }
.rc-more img { width: 30px; height: 30px; object-fit: contain; justify-self: center; }
.rc-more b { font-weight: 400; color: var(--gold); white-space: nowrap; text-align: right; }
.rc-old { display: grid; grid-template-columns: minmax(0, 1fr); gap: inherit; }
.rc-old[hidden] { display: none; }


/* ===== Cartes de recette (Atelier), version compacte (maquette « Deux bâtons dans une forge compacte ») =====
   Grille : illustration | contenu (minmax(0, 1fr) : un nom long se tronque sans pousser les actions) | actions.
   Favori ancré en haut à gauche de l'illustration, stock en bas à droite. En-tête sur une ligne : nom | niveau | ⓘ.
   Actions : 1fr | bouton | 1fr, « Maîtrisé » au-dessus, compétence en dessous ; hauteur minimale commune pour les deux badges,
   donc ni la carte ni le bouton ne bougent selon les badges. Recette maîtrisée : la ligne de progression reste vide. */
.recipe { display: grid; grid-template-columns: 64px minmax(0, 1fr) clamp(150px, 30%, 240px); align-items: center; column-gap: 16px; padding: 8px 12px; }
.recipe.locked { grid-template-columns: 64px minmax(0, 1fr); }
.recipe > .tile { position: relative; width: 64px; height: 64px; }
.recipe > .tile .fav-btn { position: absolute; top: -8px; left: -8px; z-index: 1; width: 26px; height: 26px; padding: 0; justify-content: center;
  border-radius: 50%; background: rgba(30, 22, 15, .9); box-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.recipe > .tile .fav-btn img.ui-ico { width: 18px; height: 18px; }
/* Badge « NEW » (recette débloquée jamais fabriquée) : pastille dorée centrée sous l'illustration, à cheval sur le bas du cadre.
   Rangée absolue 1fr | badge | 1fr avec le stock dans la colonne de droite (même place que .tile-qty seul) : si le stock est large,
   la colonne de droite grandit et le badge glisse vers la gauche au lieu de le recouvrir. N'ajoute aucune hauteur à la carte. */
.recipe > .tile .r-foot { position: absolute; left: -6px; right: -6px; bottom: -6px; display: grid; grid-template-columns: minmax(auto, 1fr) auto minmax(auto, 1fr);
  column-gap: 3px; align-items: end; pointer-events: none; }
.recipe > .tile .r-foot .tile-qty { position: static; grid-column: 3; justify-self: end; }
.recipe > .tile .r-new { grid-column: 2; margin-bottom: -3px; padding: 2px 7px 1px; border-radius: 99px; border: 1.5px solid #8a5a14;
  background: linear-gradient(180deg, #ffe58a 0%, #ffd35d 50%, #f0b232 100%); color: #3a2208;
  font: 12px/1 var(--font-title); font-weight: bold; letter-spacing: .4px; white-space: nowrap; text-shadow: 0 1px 0 rgba(255, 240, 200, .6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 1px 3px rgba(0, 0, 0, .6); pointer-events: auto; cursor: default; }
.recipe .r-body { display: flex; flex-direction: column; gap: 2px; }
.recipe .r-name { display: grid; grid-template-columns: minmax(0, 1fr) auto 24px; align-items: center; column-gap: 12px; line-height: 1.25; }
.recipe .r-name .rn-l { display: flex; align-items: center; gap: 8px; min-width: 0; }
.recipe .r-name .r-nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recipe .r-name .want-tag { flex: none; margin-left: 0; padding: 2px 6px; }
.recipe .r-name .want-tag > span { display: none; } /* pastille réduite à l'icône + nombre (texte complet en infobulle) : le nom garde sa place */
.recipe .r-lv { padding: 0 8px; border: 1px solid var(--border); border-radius: 99px; font-size: 13px; white-space: nowrap; }
.recipe .r-name img.info-ico { margin: 0; width: 22px; height: 22px; min-width: 22px; justify-self: end; cursor: pointer; }
.recipe .prog { height: 18px; margin: 2px 0 0; gap: 12px; }
.recipe .prog-bar { height: 9px; border-width: 1px; border-radius: 5px; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .7); }
.recipe .prog-bar i { border-radius: 4px; }
.recipe .prog-n { flex: none; min-width: 3.2em; font-size: 14px; line-height: 1; text-align: right; font-variant-numeric: tabular-nums; }
.recipe .prog-empty { visibility: hidden; }
.recipe .r-act { --badge-h: 28px; align-self: stretch; display: grid; grid-template-rows: minmax(var(--badge-h), 1fr) auto minmax(var(--badge-h), 1fr);
  grid-template-columns: minmax(0, 1fr); row-gap: 8px; min-height: calc(2 * var(--badge-h) + 16px + 34px); min-width: 0;
  padding-left: 12px; border-left: 1px solid rgba(255, 255, 255, .1); }
.recipe .r-act .btn { width: 100%; min-height: 34px; }
.recipe .r-act .btn:disabled { opacity: .55; filter: grayscale(.5); cursor: not-allowed; }
.recipe .r-act .r-top, .recipe .r-act .r-slot { display: flex; justify-content: center; min-width: 0; }
.recipe .r-act .r-top { align-items: flex-end; }
.recipe .r-act .r-slot { align-items: flex-start; }
.recipe .r-act .r-slot .r-skill { height: var(--badge-h); }
/* « MAÎTRISÉ » dans la DA du jeu (maquette de l'utilisateur, 27/11/2026) : capitales Trans800, dégradé jaune → orange,
   contour brun foncé. Contour en drop-shadow (pas -webkit-text-stroke) car le remplissage est un dégradé (background-clip: text). */
.r-mastered { display: inline-flex; align-items: center; justify-content: center; height: 28px; padding: 0 4px; box-sizing: border-box; white-space: nowrap; cursor: help; }
.r-mastered .rm-txt { font: 18px/1 var(--font-title); text-transform: uppercase; letter-spacing: .6px; padding: 2px 1px 0;
  color: #ffc533; background: linear-gradient(180deg, #fff5a0 0%, #ffd21f 42%, #ffa412 62%, #f06c0a 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(1px 0 0 #4a1f06) drop-shadow(-1px 0 0 #4a1f06) drop-shadow(0 1px 0 #4a1f06) drop-shadow(0 -1px 0 #4a1f06)
    drop-shadow(1px 0 0 #4a1f06) drop-shadow(-1px 0 0 #4a1f06) drop-shadow(0 1px 0 #4a1f06) drop-shadow(0 -1px 0 #4a1f06) drop-shadow(0 2px 1px rgba(0, 0, 0, .55)); }
/* Liste étroite (téléphone) : même disposition large (illustration | contenu | actions en colonne, voulu par l'utilisateur le 27/11/2026),
   colonnes et espacements resserrés ; le nom se tronque (nom complet en infobulle). */
@container recipes (max-width: 470px) {
  .recipe { grid-template-columns: 64px minmax(0, 1fr) 104px; column-gap: 10px; padding: 8px 10px; }
  /* nom sur toute la largeur, niveau et ⓘ à droite sur la ligne suivante */
  .recipe .r-name { grid-template-columns: minmax(0, 1fr) auto 22px; column-gap: 8px; row-gap: 2px; }
  .recipe .r-name .rn-l { grid-column: 1 / -1; }
  .recipe .r-name .r-lv { grid-column: 2; }
  .recipe .r-name img.info-ico { grid-column: 3; }
  .recipe .r-act { padding-left: 8px; }
  .recipe .r-act .btn { padding-left: 8px; padding-right: 8px; }
  .r-mastered .rm-txt { font-size: 16px; letter-spacing: .3px; }
}
/* Liste moyenne (colonne de l'Atelier à côté des autres panneaux) : colonnes et espacements resserrés pour laisser de la place au nom */
@container recipes (min-width: 471px) and (max-width: 640px) {
  .recipe { grid-template-columns: 64px minmax(0, 1fr) 136px; column-gap: 12px; padding: 8px 10px; }
  .recipe .r-name { column-gap: 8px; }
  .recipe .r-act { padding-left: 10px; }
}

/* ===== Comptoir (maquette « Comptoir marchand aux six acheteurs ») =====
   En-tête : Comptoir | acheteurs | niveau … Améliorer, Réduire ; 2e ligne : réputation, « Jouer sans patience », série.
   Cartes : deux colonnes selon la largeur du PANNEAU (requête de conteneur), portrait | contenu, actions ancrées en bas
   (grid-template-rows: 1fr auto). Action principale sur toute la largeur, puis Surfacturer / Refuser (plus large) et Proposer.
   « Congédier » est dans le menu ⋯ de la carte. */
.panel.counter { container: counter / inline-size; }
.counter .panel-head { align-items: center; column-gap: 16px; row-gap: 8px; }
.counter .ch-cap, .counter .ch-lv { padding-left: 16px; border-left: 1px solid rgba(255, 255, 255, .18); line-height: 1.6; white-space: nowrap; }
.counter .ch-cap { font-size: 17px; }
.counter .counter-up { flex: 1; min-width: 0; margin-left: 0; }
.counter .ch-lvrow { display: flex; align-items: center; gap: 16px; }
.counter .ch-lv { font: 18px/1.6 var(--font-title), serif; }
.counter .ch-lvrow > .btn, .counter .ch-lvrow > .rack-up { margin-left: auto; }
.counter-stats { column-gap: 16px; row-gap: 8px; margin: 0 0 12px; }

.customers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@container counter (max-width: 560px) { .customers { grid-template-columns: minmax(0, 1fr); } }
@container counter (min-width: 900px) { .customers { grid-template-columns: repeat(3, minmax(0, 1fr)); } } /* largeur intérieure : panneau de 930 px, cartes d'au moins 293 px */
.customers > .hint, .customers > .empty { grid-column: 1 / -1; }
.customer { display: grid; grid-template-columns: 64px minmax(0, 1fr); grid-template-rows: 1fr auto; column-gap: 12px; row-gap: 12px;
  min-width: 0; padding: 12px; container: cust / inline-size; }
.customer.menu-open { position: relative; z-index: 5; }
/* Portrait puis icônes de statut (fidélité, client spécial) : hors de la colonne du nom, qui reste à la même hauteur partout */
.cust-side { grid-row: 1; align-self: start; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.cust-side img.av { width: 64px; height: 64px; }
.cust-badges { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 22px; } /* place réservée même sans icône */
.cust-main { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.cust-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.cust-top .cust-name { min-width: 0; font-size: 18px; line-height: 1.3; }
.customer .wish { display: flex; flex-wrap: wrap; align-items: center; column-gap: 8px; row-gap: 2px; margin: 0; min-height: 2.6em; } /* 2 lignes réservées : le bouton reste à la même place */
.customer .wish .w-lbl { color: var(--muted); }
.customer .wish .w-item { min-width: 0; overflow-wrap: anywhere; }
.customer .stock-line { font-size: 15px; }
.cust-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.cust-tags .qchip, .cust-tags .vb { margin: 0; }
.cust-actions { grid-column: 1 / -1; grid-row: 2; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 3fr); gap: 8px; margin: 0; } /* 70/30 : Surcharge tient sur une ligne */
.cust-actions .ca-main { grid-column: 1 / -1; }
.cust-actions .mod-tag { display: flex; align-items: center; justify-content: center; min-height: 36px; box-sizing: border-box; }
/* Hiérarchie des boutons : l'action principale (verte) sur toute la largeur, les secondaires côte à côte dessous (à toutes les largeurs) */
.customer { row-gap: 8px; }
.cust-main { gap: 4px; }
/* Qualité demandée : texte clair sur le fond brun, couleur de qualité conservée en contour */
.cust-tags .qchip.sel { color: #f6e8c8; background: rgba(0, 0, 0, .35); border-width: 2px; box-shadow: inset 0 0 0 1px var(--q); cursor: default; }
/* Menu ⋯ (Congédier) */
.cust-menu { position: relative; flex: none; }
.cust-more { display: inline-flex; align-items: center; justify-content: center; gap: 4px; width: 44px; height: 28px; padding: 0; cursor: pointer;
  border-radius: 99px; border: 1px solid var(--border); background: rgba(0, 0, 0, .25); }
.cust-more i { width: 4px; height: 4px; border-radius: 50%; background: #e8dcc0; }
.cust-more:hover, .cust-more[aria-expanded="true"] { border-color: var(--gold); }
.cm-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 220px; padding: 6px; box-sizing: border-box;
  border-radius: 10px; background: rgba(24, 16, 10, .98); border: 1px solid #5b3a1c; box-shadow: 0 8px 22px rgba(0, 0, 0, .6); }
.cm-list[hidden] { display: none; }
.cm-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; padding: 8px 10px; border: 0; border-radius: 6px;
  background: none; color: var(--text); font: inherit; text-align: left; white-space: nowrap; cursor: pointer; }
.cm-item:hover, .cm-item:focus-visible { background: rgba(255, 255, 255, .08); }
.cm-item small { color: var(--muted); font-size: 14px; }
.cm-item small img.ui-ico { height: 16px; width: auto; vertical-align: -3px; }
/* Panneau moyen : écarts resserrés pour garder « Améliorer 128 M 550 · 16h » sur une ligne */
@container counter (max-width: 760px) {
  .counter .panel-head { column-gap: 10px; }
  .counter .ch-cap, .counter .ch-lv { padding-left: 10px; }
  .counter .ch-lvrow { gap: 10px; }
}
/* Panneau étroit : niveau + « Améliorer » passent sur leur propre ligne, sous le titre (rien ne déborde) */
@container counter (max-width: 560px) {
  .counter .fold-btn { order: 2; margin-left: auto; }
  .counter .counter-up { order: 3; flex: 1 1 100%; }
  .counter .ch-lvrow { flex-wrap: wrap; row-gap: 8px; min-width: 0; }
  .counter .ch-lv { padding-left: 0; border-left: 0; }
}

/* Comptoir : boutons secondaires jaunes du jeu (Surcharge, Proposer) ; Surcharge = « Surcharge +gain [pièce] » + pastille de chance */
.cust-actions .sug-wrap { position: relative; min-width: 0; display: flex; }
.cust-actions .sug-wrap > .btn { flex: 1; min-width: 0; }
.cust-actions .sug-wrap.ca-main { grid-column: 1 / -1; }
.cust-actions .btn.ca-sur { display: flex; flex-wrap: nowrap; align-items: center; justify-content: center; column-gap: 4px; row-gap: 2px; padding-left: 8px; padding-right: 8px; }
.cust-actions .btn.ca-sur.two-lines { flex-wrap: wrap; }
.cust-actions .sug-wrap.ca-sug > .btn { padding-left: 6px; padding-right: 6px; }
/* Proposer : pastille du nombre d'objets proposables, coin haut droit du bouton (le toucher passe au bouton) */
.cust-actions .sug-n { position: absolute; top: -7px; right: -6px; z-index: 1; pointer-events: none; display: flex; align-items: center; justify-content: center; box-sizing: border-box;
  min-width: 20px; height: 20px; padding: 0 5px 1px; border-radius: 10px; background: #1d130d; color: #f6e8c8; font-size: 12px; font-weight: 700; line-height: 1; white-space: nowrap; }
.cust-actions .sug-n.zero { background: #b3313f; color: #fff; }
.btn.ca-sur .sur-amt { white-space: nowrap; }
.btn.ca-sur .sur-pct { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 99px; background: #6b3a10; color: #fbe9c6;
  font-size: min(13px, 1em); line-height: 1; text-shadow: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
.btn.ca-sur:disabled .sur-pct { background: #5a5048; }
/* Panneau flottant « Proposer à … » : sous le bouton, défilement propre ; la carte garde sa hauteur */
.customer.sug-open { position: relative; z-index: 6; }
.sug-pop { position: absolute; top: calc(100% + 12px); right: 0; z-index: 40; width: min(320px, calc(100vw - 32px)); box-sizing: border-box;
  display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 12px; background: #2a1d12; border: 2px solid var(--gold);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .65); text-align: left; }
.sug-pop::before { content: ""; position: absolute; top: -9px; right: 40px; width: 14px; height: 14px; background: #2a1d12;
  border-left: 2px solid var(--gold); border-top: 2px solid var(--gold); transform: rotate(45deg); }
.sug-wrap.ca-main .sug-pop { left: 0; right: auto; margin: 0 auto; right: 0; }
.sug-wrap.ca-main .sug-pop::before { right: calc(50% - 7px); }
.sug-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font: 18px var(--font-title), serif; color: #f6e8c8; }
.sug-list { display: grid; gap: 6px; max-height: 240px; overflow-y: auto; padding-right: 4px; grid-auto-rows: max-content; }
.sug-list .btn.alt { min-height: 38px; font-size: 15px; }
.cust-actions .sug-pop .btn.alt { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; justify-content: stretch; align-items: center; column-gap: 8px;
  padding: 4px 10px; text-align: left; white-space: nowrap; }
/* Chaudron replié : le bouton « Améliorer » est masqué avec le reste (seuls le titre et « Afficher » restent) */
.panel.cauldron.folded #fusion-up { display: none; }
/* Comptoir replié : « Améliorer » (ou la jauge d'amélioration) masqué, le niveau reste affiché */
.panel.counter.folded #counter-up .ch-lvrow > :not(.ch-lv) { display: none; }
/* En-tête du Chaudron : « Chaudron », « Améliorer » et Réduire / Afficher (juste à droite d'« Améliorer ») toujours sur la
   1re ligne ; la ligne d'infos (niveau, objets…) se place à côté du titre si la place suffit, sinon dessous ; panneau réduit :
   seuls le titre et « Afficher » restent. */
.panel.cauldron { container: cauldron / inline-size; }
.cauldron .panel-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; align-items: center; column-gap: 10px; row-gap: 8px; }
.cauldron .panel-head > h2 { grid-area: 1 / 1; white-space: nowrap; }
.cauldron #fusion-cap { grid-area: 1 / 2; min-width: 0; }
.cauldron #fusion-up { grid-area: 1 / 3; margin-left: 0; }
.cauldron .panel-head > .fu-mini-btn { grid-area: 1 / 4; white-space: nowrap; }
.cauldron .panel-head > .fold-btn { grid-area: 1 / 5; white-space: nowrap; }
.cauldron #fusion-cap:empty, .cauldron #fusion-up:empty { display: none; }
/* Panneau étroit : les infos descendent sur leur ligne (une ligne vide n'est pas créée), les boutons restent en haut */
@container cauldron (max-width: 700px) {
  .cauldron .panel-head { grid-template-columns: minmax(max-content, 1fr) auto auto auto; }
  .cauldron #fusion-up { grid-area: 1 / 2; }
  .cauldron .panel-head > .fu-mini-btn { grid-area: 1 / 3; }
  .cauldron .panel-head > .fold-btn { grid-area: 1 / 4; }
  .cauldron #fusion-cap { grid-area: auto / 1 / auto / -1; }
}
/* Panneau moyen (bouton Miniature en plus) : « Améliorer » passe sous le titre, sur sa ligne, pour que l'en-tête ne déborde pas */
@container cauldron (max-width: 540px) {
  .cauldron #fusion-up { grid-area: auto / 1 / auto / -1; justify-self: start; }
}
/* Panneau très étroit : boutons de l'en-tête resserrés pour laisser la place au titre, même avec un gros montant */
@container cauldron (max-width: 340px) {
  .cauldron .panel-head .btn.small { padding-left: 7px; padding-right: 7px; }
  .cauldron #fusion-up.long { grid-area: auto / 1 / auto / -1; justify-self: start; }
}
.panel.cauldron.folded #fusion-cap { display: none; }
/* Chaudron en miniature (S.ui.fusionMini, renderFusion) : titre, « Vue complète » et Réduire / Afficher, puis les emplacements
   seuls (avec « Tout collecter ») ; image, infos, « Améliorer », achat et amélioration d'emplacement masqués */
.cauldron .fu-mini-btn[hidden], .panel.cauldron.folded .fu-mini-btn { display: none; }
.panel.cauldron.fu-mini #fusion-cap, .panel.cauldron.fu-mini #fusion-up, .panel.cauldron.fu-mini .mst-go { display: none; }

/* ===== Onglet Héros : liste compacte (une ligne par héros), fiche dépliable sous la ligne (maquettes du 26/11/2026) =====
   Grille commune à toutes les lignes : identité + chevron | blason | progression (barre d'XP ou prérequis, même hauteur) | puissance |
   7 emplacements (tuiles de 60 à 68 px, même place vides ou équipés) | statut compact (« En expédition » ou les 2 boutons empilés).
   Colonnes à largeur fixe, le surplus réparti entre elles (justify-content) : alignées d'une ligne à l'autre.
   Plus étroit : espacements réduits, puis l'équipement sur sa propre ligne sous les informations, puis (téléphone) 4 + 3 tuiles. */
#heroes { container: heroes / inline-size; }
.hero-list { display: flex; flex-direction: column; gap: 8px; }
.hrow { --tile: 96px; --tile-min: 66px; --tgap: 10px; --act-w: 160px;
  --eq-min: calc(7 * var(--tile-min) + 6 * var(--tgap)); --eq-max: calc(7 * var(--tile) + 6 * var(--tgap));
  display: grid; grid-template-columns: 210px 46px 220px 110px minmax(var(--eq-min), var(--eq-max)) var(--act-w);
  grid-template-areas: "id badge prog val eq act" "det det det det det det";
  justify-content: space-between; align-items: center; column-gap: 12px; row-gap: 0; padding: 4px 12px; }
.hrow > * { min-width: 0; }
/* Poignée de déplacement (priorité des héros) : bord gauche de la ligne, trois rangées de deux points */
.hrow { padding-left: 32px !important; }
.hrow .hr-grip { grid-area: id; justify-self: start; align-self: center; width: 24px; height: 48px; margin: 0 0 0 -28px; border: 0; border-radius: 8px; cursor: grab; opacity: .55;
  background: radial-gradient(circle, var(--gold) 0 2px, transparent 2.6px) center / 8px 8px; background-origin: content-box; background-clip: content-box; padding: 12px 4px; box-sizing: border-box; }
.hrow .hr-grip:hover, .hrow .hr-grip:focus-visible { opacity: 1; }
.hrow.hr-dragging { outline: 2px dashed var(--gold, #e0b050); outline-offset: -2px; opacity: .85; box-shadow: 0 8px 22px rgba(0, 0, 0, .5); }
.hrow .hr-id { grid-area: id; display: grid; grid-template-columns: 52px minmax(0, 1fr) 16px; align-items: center; column-gap: 10px;
  box-sizing: border-box; min-height: 60px; padding: 2px 4px; margin: 0; border: 0; border-radius: 8px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.hrow .hr-id:hover { background: rgba(255, 255, 255, .05); }
.hrow .avatar img.av { width: 52px; height: 52px; }
.hrow .hr-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.hrow .hr-name b { font-family: var(--font-title); font-weight: 400; font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hrow .hr-name small { color: var(--muted); font-size: 14px; } /* titre entier, sur deux lignes si besoin (place réservée : .hr-id) */
.hrow .hr-chev { width: 8px; height: 8px; justify-self: center; border-right: 2px solid var(--gold); border-bottom: 2px solid var(--gold); transform: translateY(-2px) rotate(45deg); transition: transform .15s; }
.hrow.open .hr-chev { transform: translateY(2px) rotate(-135deg); }
.hrow .lvl-badge { grid-area: badge; margin: 0; }
/* Progression : « Niveau max. » puis une zone de hauteur fixe (barre d'XP, prérequis de bâtiment, blessure ou NIVEAU MAX) :
   passer de l'une à l'autre ne décale ni la puissance ni les tuiles */
.hrow .hr-prog { grid-area: prog; display: grid; grid-template-rows: 18px 32px; row-gap: 4px; align-items: center; }
.hrow .hr-prog > small { font-size: 14px; line-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hrow .hr-prog > :not(small) { margin: 0; min-width: 0; max-height: 32px; }
.hrow .hr-prog .bar.hxp { height: 22px; border-radius: 11px; }
.hrow .hr-prog .bar.hxp span { font-size: 14px; padding-bottom: 1px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hrow .hr-prog .lvl-max { text-align: left; padding: 0; }
.hrow .hr-prog .lvl-max .lm { font-size: 18px; }
.hrow .hr-cap { height: 32px; padding: 0 26px 0 10px; font-size: 14px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hrow .hr-val { grid-area: val; justify-self: end; white-space: nowrap; font-size: 17px; font-variant-numeric: tabular-nums; }
.hrow .hr-val b { font-family: var(--font-title); font-weight: 400; }
/* Équipement : 7 colonnes fixes, mêmes positions vides ou équipés ; tuile = pastille de casse en haut, illustration, puissance en bas
   (trois bandes distinctes : rien ne chevauche l'illustration) */
.hrow .hr-eq { grid-area: eq; display: grid; grid-auto-flow: column; grid-template-columns: repeat(7, minmax(0, var(--tile))); gap: var(--tgap); width: 100%; }
.hrow:has(.hr-eq.pets) { --eq-min: calc(8 * var(--tile-min) + 7 * var(--tgap)); --eq-max: calc(8 * var(--tile) + 7 * var(--tgap)); }
.hrow .hr-eq.pets { grid-template-columns: repeat(8, minmax(0, var(--tile))); } /* 8e carte : familier (PETS_ON) */
.hrow .hr-eq > .hcard, .hrow .hr-eq > .hc-wrap { width: 100%; }
.hrow .hr-eq .hcard, .ae-slots .hcard { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 15% minmax(0, 1fr) auto; justify-content: stretch; justify-items: center; align-items: center; gap: 1px;
  padding: 4% 5% 11%; box-sizing: border-box; }
.hrow .hr-eq .hcard > .hcard-break { position: static; grid-row: 1; align-self: start; min-width: 0; font-size: clamp(11px, 13cqw, 14px); line-height: 1.15; padding: 0 4px; }
.hrow .hr-eq .hcard > .hcard-icons, .ae-slots .hcard > .hcard-icons { grid-row: 2; }
.hrow .hr-eq .hcard > .hcard-label, .ae-slots .hcard > .hcard-label { grid-row: 3; font-size: 22cqw; line-height: 1.05; text-align: center; }
.hrow .hr-eq .hcard:not(.full) > .hcard-icons, .ae-slots .hcard:not(.full) > .hcard-icons { grid-row: 1 / 3; align-self: center; }
.hrow .hr-eq .hcard-icons.is-item, .ae-slots .hcard-icons.is-item { height: auto; width: 100%; display: flex; justify-content: center; align-items: center; font-size: 34cqw; }
.hrow .hr-eq .hcard-icons.is-item img.ii, .ae-slots .hcard-icons.is-item img.ii { width: 54cqw; height: 54cqw; }
.hrow .hr-eq .hcard-label img.ui-ico.pow, .ae-slots .hcard-label img.ui-ico.pow { height: 1.05em; vertical-align: -0.2em; }
.hrow .hr-eq .hcard.can::after, .ae-slots .hcard.can::after { top: 7%; right: 9%; }
.hrow .hr-act { grid-area: act; display: flex; justify-content: center; }
.hrow .hr-act .equip-btns { width: 100%; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.hrow .hr-act .equip-btns .btn { padding-top: 4px; padding-bottom: 4px; overflow: hidden; text-overflow: ellipsis; }
.hrow .hr-act .away { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.hrow .hr-det { grid-area: det; display: flex; flex-direction: column; gap: 8px; margin: 8px 0 4px; padding: 10px 12px; border-radius: 8px;
  background: rgba(0, 0, 0, .22); border: 1px solid rgba(255, 255, 255, .08); }
.hrow .hr-det[hidden] { display: none; }
.hrow .hd-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.hrow .hd-lbl { color: var(--muted); font-size: 14px; }
.hrow .hd-line .hskills { margin: 0; }
.hrow .hd-req { margin: 0; }
.hrow .hd-line .lvl-cap { margin: 0; width: auto; }
/* Héros pas encore recruté : ligne compacte (identité + prérequis ou « Recruter »), sans cases d'équipement */
.hrow:not(.is-hired) { grid-template-columns: 210px minmax(0, 1fr); grid-template-areas: "id lock" "det det"; justify-content: stretch; padding: 6px 12px; }
.hrow .hr-lock { grid-area: lock; }
.hrow.locked { opacity: .6; }
.hrow.locked .avatar img.av { filter: grayscale(1); }
.hrow .hr-req { display: inline-block; padding: 4px 12px; border-radius: 8px; background: rgba(0, 0, 0, .25); border: 1px solid rgba(255, 255, 255, .12); }
.hrow .hr-req img.ui-ico, .hrow .hd-req img.ui-ico { height: 1.3em; width: auto; vertical-align: -0.3em; }
/* Les tuiles grandissent avec la place libre (66 à 96 px) ; en dessous de 66 px, l'équipement passe sur une ligne dédiée
   sous les informations du héros (tuiles de nouveau jusqu'à 96 px) */
/* Avec la 8e carte (familier) : la ligne unique demande 1 448 px, l'équipement passe dessous plus tôt */
@container heroes (max-width: 1449px) {
  .hrow.is-hired:where(:has(.hr-eq.pets)) { grid-template-columns: 210px 46px 220px 110px var(--act-w);
    grid-template-areas: "id badge prog val act" "eq eq eq eq eq" "det det det det det"; column-gap: 12px; row-gap: 8px; padding: 6px 12px 10px; }
  .hrow.is-hired:where(:has(.hr-eq.pets)) .hr-det { margin-top: 0; }
}
@container heroes (max-width: 1379px) {
  .hrow.is-hired { grid-template-columns: 210px 46px 220px 110px var(--act-w);
    grid-template-areas: "id badge prog val act" "eq eq eq eq eq" "det det det det det"; column-gap: 12px; row-gap: 8px; padding: 6px 12px 10px; }
  .hrow .hr-det { margin-top: 0; }
}
/* Panneau moyen : informations sur deux rangées */
@container heroes (max-width: 839px) {
  .hrow.is-hired { grid-template-columns: minmax(0, 1fr) 46px 110px 150px; grid-template-areas: "id badge val act" "prog prog prog act" "eq eq eq eq" "det det det det"; justify-content: stretch; }
  .hrow .hr-prog { max-width: 320px; }
}
/* Téléphone : identité + blason, puis progression, puissance et statut, puis les emplacements en 4 + 3 */
@container heroes (max-width: 560px) {
  .hrow.is-hired { --tgap: 8px; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "id badge" "prog val" "act act" "eq eq" "det det"; column-gap: 8px; row-gap: 8px; padding: 8px 10px; }
  .hrow .lvl-badge { justify-self: end; }
  .hrow .hr-val { align-self: end; padding-bottom: 2px; }
  .hrow:not(.is-hired) { grid-template-columns: minmax(0, 1fr); grid-template-areas: "id" "lock" "det"; }
  .hrow .hr-prog { max-width: none; }
  .hrow .hr-act { justify-content: flex-start; }
  .hrow .hr-act .equip-btns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hrow .hr-eq, .hrow .hr-eq.pets { grid-auto-flow: row; grid-template-columns: repeat(4, minmax(0, var(--tile))); justify-content: start; }
}

/* ---------- Panneau Ressources : une ligne par matière, emplacements dépliables (renderRacks, maquette du 26/11/2026) ---------- */
.rs-list { display: grid; gap: 8px; container: rs / inline-size; font-variant-numeric: tabular-nums; }
.rs-grid { display: grid; grid-template-columns: minmax(0, 1fr) 96px 84px minmax(150px, 220px); gap: 8px; align-items: center; }
.rs-head { padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: rgba(255, 255, 255, .04);
  font: 16px/1.2 var(--font-title); color: var(--text); }
.rs-head > span:first-child { padding-left: 44px; }
.rs-num { text-align: right; white-space: nowrap; }
.rs-sth { text-align: center; }
.rs-tier { display: flex; align-items: center; gap: 12px; margin: 4px 0 0; color: var(--text); font: 15px/1 var(--font-title); }
.rs-tier::before, .rs-tier::after { content: ""; flex: 1; height: 1px; background: rgba(233, 185, 73, .3); }
.rs-tier span { padding: 4px 14px 5px; border: 1px solid rgba(233, 185, 73, .35); border-radius: 99px; background: rgba(0, 0, 0, .2); }
.rs-item { border: 1px solid var(--border); border-radius: var(--radius); background: rgba(255, 255, 255, .03); }
.rs-item.open { background: rgba(255, 255, 255, .05); border-color: #5d4934; }
.rs-row { position: relative; min-height: 46px; padding: 3px 12px; }
.rs-row:hover { background: rgba(255, 230, 180, .04); border-radius: var(--radius); }
/* Le bouton de la matière couvre toute la ligne (clic n'importe où) ; seul le contenu de la 1re colonne est le sien */
.rs-tg { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.rs-tg::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.rs-tg:focus-visible { outline: none; }
.rs-tg:focus-visible::after { outline: 2px solid var(--gold); outline-offset: -2px; }
.rs-chev { flex: none; width: 26px; height: 26px; border: 1px solid #6a5238; border-radius: 6px; background: rgba(0, 0, 0, .25); position: relative; }
.rs-chev::before { content: ""; position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; border: solid var(--text); border-width: 0 2px 2px 0;
  transform: translate(-65%, -50%) rotate(-45deg); }
.rs-item.open .rs-chev::before { transform: translate(-50%, -70%) rotate(45deg); }
.rs-ico { flex: none; width: 34px; display: flex; justify-content: center; font-size: 24px; line-height: 1; }
.rs-ico img { height: 32px; width: auto; }
.rs-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.rs-name b { font: 17px/1.15 var(--font-title); font-weight: normal; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-cnt { color: var(--muted); font-size: 14px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rs-prod, .rs-cap { font: 17px/1.2 var(--font-title); color: var(--text); padding-top: 2px; }
.rs-lbl { display: none; }
.rs-st { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 42px; padding: 3px 10px;
  border: 1px solid #5d4934; border-radius: 8px; background: rgba(0, 0, 0, .18); text-align: center; line-height: 1.15; }
.rs-stm { font: 15px/1.2 var(--font-title); color: var(--text); }
.rs-stm .rs-av { color: var(--gold); font-weight: normal; }
.rs-sts { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.rs-sts img.ui-ico { height: 1.2em; vertical-align: middle; }
/* Détail : un emplacement par ligne (numéro et niveau | production et capacité | action) */
.rs-detail { margin: 0 8px 8px; border: 1px solid #4f3e2d; border-radius: 8px; background: rgba(0, 0, 0, .18); }
.rs-dgrid { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.rs-slot { min-height: 44px; padding: 4px 8px 4px 14px; } /* même hauteur à payer, en chantier ou au maximum : rien ne bouge au clic ni à la fin du chantier */
.rs-slot + .rs-slot { border-top: 1px solid rgba(255, 255, 255, .07); }
.rs-slot:focus { outline: none; }
.rs-slot:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.rs-sl { font: 15px/1.2 var(--font-title); font-weight: normal; color: var(--text); white-space: nowrap; }
.rs-new .rs-sl { color: var(--muted); }
.rs-ss { color: var(--muted); font-size: 15px; white-space: nowrap; padding-left: 12px; border-left: 1px solid #5d4934; }
.rs-sa { display: flex; justify-content: flex-end; min-width: 0; }
.rs-buy { display: inline-flex; align-items: center; border: 1px solid #5d4934; border-radius: 99px; background: rgba(0, 0, 0, .25); }
.rs-buy .btn { flex: none; }
.rs-price { display: inline-flex; align-items: center; gap: 8px; padding: 0 12px 0 10px; white-space: nowrap; font: 15px/1 var(--font-title); color: var(--text); }
.rs-price > span { display: inline-flex; align-items: center; gap: 4px; }
.rs-price img.ui-ico { height: 1.25em; vertical-align: middle; }
.rs-price.lack .rs-cost { color: var(--bad); }
.rs-sep { width: 1px; height: 16px; background: #6a5238; }
.rs-run { display: flex; flex-direction: column; width: 220px; max-width: 100%; text-align: right; }
.rs-run small { color: var(--text); font-size: 14px; display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; }
.rs-run small img.ui-ico { height: 1.2em; vertical-align: middle; }
.rs-run .bar { height: 8px; }
.rs-run .bar i { background: var(--gold); }
.rs-max { color: var(--muted); font-size: 15px; display: inline-flex; align-items: center; gap: 4px; }
/* Panneau étroit : colonnes resserrées */
@container rs (max-width: 620px) {
  .rs-grid { grid-template-columns: minmax(0, 1fr) 84px 64px minmax(130px, 170px); }
  .rs-dgrid { grid-template-columns: 104px minmax(0, 1fr) auto; }
  .rs-ss { padding-left: 8px; }
}
/* Téléphone : matière + état sur la 1re ligne, production et capacité libellées sur la 2e ; coût et bouton sous les statistiques */
@container rs (max-width: 500px) {
  .rs-head { display: none; }
  .rs-grid { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "mat st" "prod cap"; row-gap: 4px; }
  .rs-tg { grid-area: mat; }
  .rs-st { grid-area: st; min-width: 120px; max-width: 170px; }
  .rs-prod { grid-area: prod; justify-self: start; padding-left: 34px; }
  .rs-cap { grid-area: cap; justify-self: end; }
  .rs-prod, .rs-cap { display: inline-flex; align-items: baseline; gap: 6px; font-size: 15px; }
  .rs-lbl { display: inline; font: 13px var(--font-text); color: var(--muted); }
  .rs-row { padding: 6px 10px; }
  .rs-chev { width: 24px; height: 24px; }
  .rs-dgrid { grid-template-columns: auto minmax(0, 1fr); row-gap: 6px; }
  .rs-sa { grid-column: 1 / -1; justify-content: flex-start; }
  .rs-slot { min-height: 72px; padding: 6px 10px; }
  .rs-run { width: 100%; text-align: left; }
  .rs-run small { justify-content: flex-start; }
  .rs-buy { max-width: 100%; flex-wrap: wrap; }
}

/* ---------- Onglet Ville : filtres, registre (une ligne par bâtiment) et fiche du bâtiment sélectionné (renderCity, maquette du 26/11/2026) ----------
   Grand écran : registre (~2/3) | fiche collante (~1/3, sous le bandeau du haut). Moins de 900 px : une colonne, la fiche s'ouvre sous la ligne.
   Registre étroit (< 640 px, requête de conteneur « creg ») : nom + niveau sur une ligne, Investir / Max à parts égales dessous. */
#city { container: city / inline-size; }
#city-level { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-left: 8px; vertical-align: middle; }
#city-level .ch-hall { display: inline-flex; align-items: center; gap: 6px; padding-left: 12px; border-left: 1px solid var(--border); color: var(--text); font-size: 17px; }
#city-level .ch-hall img.ui-ico { height: 32px; width: auto; }
#city-level .ch-hall i { color: var(--muted); }
#city-level .ch-ready { font-family: var(--font-text); font-size: 13px; font-weight: 600; color: #1d1209; background: var(--gold); border-radius: 10px; padding: 1px 8px; }
.city-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.cf { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--panel-2); color: var(--text); font: inherit; font-family: var(--font-title); font-size: 17px; line-height: 1.15; cursor: pointer; text-align: center; }
.cf:hover { border-color: #6b5230; background: #3d3024; }
.cf img.ui-ico { height: 28px; width: auto; flex: 0 0 auto; }
.cf.on { background: linear-gradient(#f6cd63, #d99a26); color: #2a1a08; border-color: #ffd77a; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); }
.city-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(340px, 1fr); gap: 16px; align-items: start; }
.city-main { min-width: 0; }
.city-side { position: sticky; top: calc(var(--sticky-h, 0px) + 12px); max-height: calc(100vh - var(--sticky-h, 0px) - 24px); overflow: auto; min-width: 0; }
.city-side[hidden] { display: none; }
.city-side { container: cside / inline-size; }
@container cside (max-width: 440px) {
  .city-side .cs-id { grid-template-columns: 88px minmax(0, 1fr); gap: 12px; }
  .city-side .cs-img { width: 88px; height: 88px; }
  .city-side .cs-name { font-size: 22px; }
}
@media (max-width: 900px) { .city-layout { grid-template-columns: minmax(0, 1fr); } }

/* Registre */
.city-reg, .cl-list { container: creg / inline-size; background: rgba(0, 0, 0, .18); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.cr-head, .cr { display: grid; grid-template-columns: minmax(0, 1fr) 56px 190px 166px; grid-template-areas: "id lvl inv max"; column-gap: 12px; align-items: center; padding: 0 12px; }
.cr-head { min-height: 44px; font-family: var(--font-title); font-size: 17px; border-bottom: 1px solid var(--border); background: rgba(0, 0, 0, .2); }
.cr-head .cr-h-inv { grid-column: inv-start / max-end; }
.cr-lp { display: none; }
.cr-lvl { grid-area: lvl; text-align: right; font-size: 17px; font-variant-numeric: tabular-nums; }
.cr-cat { display: flex; align-items: center; gap: 8px; padding: 10px 12px 4px; color: var(--muted); font-size: 14px; letter-spacing: .04em; text-transform: uppercase; }
.cr-cat:not(:nth-child(2)) { border-top: 1px solid var(--border); }
.cr-cat img.ui-ico { height: 20px; width: auto; }
.cr { position: relative; min-height: 56px; border-top: 1px solid rgba(255, 255, 255, .06); cursor: pointer; }
.cr-cat + .cr, .cl-list > .cr:first-child { border-top: 0; }
.cr:hover { background: rgba(255, 255, 255, .035); }
.cr.sel { background: rgba(233, 185, 73, .13); box-shadow: inset 4px 0 0 var(--gold), inset 0 0 0 1px rgba(233, 185, 73, .55); }
.cr-id { grid-area: id; display: grid; grid-template-columns: 48px minmax(0, max-content) auto auto; justify-content: start; align-items: center; column-gap: 12px; min-width: 0; min-height: 48px;
  margin: 4px 0; padding: 0 4px 0 0; border: 0; border-radius: 6px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.cr-img { width: 48px; height: 48px; object-fit: contain; }
.cr-name { font-family: var(--font-title); font-size: 18px; line-height: 1.15; min-width: 0; overflow-wrap: break-word; }
.cr-boost img.ui-ico { height: 22px; width: auto; display: block; }
.cr-chev { width: 8px; height: 8px; margin-left: 4px; border-right: 2px solid var(--gold); border-bottom: 2px solid var(--gold); transform: translateY(-2px) rotate(45deg); transition: transform .15s; }
.cr.sel .cr-chev { transform: translateY(2px) rotate(-135deg); }
.cr .btn { width: 100%; min-width: 0; min-height: 40px; white-space: nowrap; font-size: 15px; }
.cr .btn b { font-weight: 700; font-variant-numeric: tabular-nums; }
.cr-inv { grid-area: inv; }
.cr-max { grid-area: max; }
.cr-why { grid-column: inv-start / max-end; grid-row: inv-start / inv-end; display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; color: var(--muted); font-style: italic; }
.cr-why span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-why img.ui-ico, .cr-req img.ui-ico { height: 20px; width: auto; flex: 0 0 auto; }
.cr.flash { animation: crFlash 1.4s ease-out; }
@keyframes crFlash { 0%, 40% { box-shadow: inset 0 0 0 3px var(--gold); } 100% { box-shadow: inset 0 0 0 0 transparent; } }
.cr-empty { margin: 0; padding: 14px 12px; }

/* Bâtiments verrouillés */
.city-locked:empty { display: none; }
.city-locked { margin-top: 12px; }
.cl-head { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 14px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--panel-2); color: var(--text); font: inherit; font-family: var(--font-title); font-size: 17px; text-align: left; cursor: pointer; }
.cl-head:hover { background: #3d3024; }
.cl-head img.ui-ico { height: 22px; width: auto; }
.cl-chev { width: 9px; height: 9px; margin: 0 4px; border-right: 2px solid var(--gold); border-bottom: 2px solid var(--gold); transform: translateY(-2px) rotate(45deg); transition: transform .15s; }
.cl-head[aria-expanded="true"] .cl-chev { transform: translateY(2px) rotate(-135deg); }
.cl-list { margin-top: 8px; }
.cl-list[hidden] { display: none; }
.cr.locked { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "id req"; }
.cr.locked .cr-img { filter: grayscale(1) brightness(.75); opacity: .7; }
.cr.locked .cr-name { color: var(--muted); }
.cr-req { grid-area: req; display: flex; align-items: center; justify-content: flex-end; gap: 8px; color: var(--muted); text-align: right; }

/* Registre étroit (colonne de gauche réduite, téléphone) */
@container creg (max-width: 640px) {
  .cr-head { display: none; }
  .cr { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "id id" "inv max"; row-gap: 6px; padding: 0 10px 10px; }
  .cr-lvl { grid-area: id; justify-self: end; pointer-events: none; }
  .cr-lp { display: inline; color: var(--muted); font-size: 14px; }
  .cr-id { padding-right: 52px; }
  .cr-why { justify-content: flex-start; }
  .cr.locked { grid-template-columns: minmax(0, 1fr); grid-template-areas: "id" "req"; row-gap: 0; }
  .cr-req { justify-content: flex-start; text-align: left; padding-left: 60px; }
}

/* Fiche du bâtiment */
.cs { display: flex; flex-direction: column; gap: 14px; padding: 16px; background: rgba(0, 0, 0, .18); border: 1px solid var(--border); border-radius: 8px; }
.cs.inline { margin: 0 8px 10px; padding: 12px; background: rgba(0, 0, 0, .28); cursor: auto; }
.cs-id { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 16px; align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.cs-img { width: 128px; height: 128px; object-fit: contain; }
.cs-img.dim { filter: grayscale(1) brightness(.75); opacity: .75; }
.cs-title { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cs-name { margin: 0; text-transform: none; font-size: 28px; line-height: 1.1; overflow-wrap: normal; word-break: normal; hyphens: manual; }
.cs-lvl { font-size: 18px; font-style: italic; }
.cs-cat { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; }
.cs-cat img.ui-ico { height: 20px; width: auto; }
.cs-sec h4 { margin: 0 0 8px; color: var(--gold); font-family: var(--font-title); font-weight: 400; font-size: 19px; }
.cs-fund-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; font-size: 17px; font-variant-numeric: tabular-nums; }
.cs-fund-row small { color: var(--muted); font-size: 14px; }
.cs-fund-v img.ui-ico.gold { height: 1.3em; vertical-align: -0.3em; }
.bar.cs-gauge { height: 14px; width: auto; margin: 8px 0 0; border-radius: 7px; border: 1px solid #6b5230; background: #120d09; }
.bar.cs-gauge i { background: linear-gradient(#f6cd63, #c98a1c); }
.cs-poor { display: block; margin-top: 6px; color: #f08a6a; font-size: 14px; }
.cs-fx { width: 100%; border-collapse: collapse; font-size: 16px; }
.cs-fx th, .cs-fx td { padding: 7px 10px; border: 1px solid var(--border); }
.cs-fx thead th { font-family: var(--font-title); font-weight: 400; text-align: right; white-space: nowrap; background: rgba(0, 0, 0, .2); }
.cs-fx thead th:first-child { text-align: left; }
.cs-fx tbody th { text-align: left; font-weight: 400; }
.cs-fx tbody th { display: table-cell; }
.cs-fx tbody th img.ui-ico, .cs-fx tbody th img.ri { height: 22px; width: auto; vertical-align: -0.35em; margin-right: 8px; }
.cs-fx td { text-align: right; color: var(--good); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cs-fx td.nx { color: #ffe08a; }
.cs-line { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; align-items: start; font-size: 16px; line-height: 1.35; }
.cs-line > img.ui-ico { height: 28px; width: auto; }
.cs-line small { display: block; font-size: 14px; }
.cs-line .cs-nx { color: #ffe08a; }
.cs-line .good, .cs-line b.good { color: var(--good); }
.cs-line img.ri { height: 1.2em; width: auto; vertical-align: -0.25em; }
.cs-lbl { color: var(--text); }
.cs-boost:not(.on) .cb-on, .cs-boost.on .cb-off { display: none; }
.cs-boost .cb-time { display: inline; color: var(--muted); }
.cs-note { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px 12px; border-radius: 8px; background: rgba(0, 0, 0, .25); border: 1px solid rgba(255, 255, 255, .12); }
.cs-note > img.ui-ico { height: 26px; width: auto; }
.cs-note div > b, .cs-note div > span { display: block; }
.cs-note.lock { border-color: rgba(240, 138, 106, .45); }
.cs-note.done { border-color: rgba(111, 191, 115, .5); }
.cs-go { margin-top: 6px; padding: 0; border: 0; background: none; color: var(--gold); font: inherit; text-decoration: underline; cursor: pointer; text-align: left; }
.cs-heroes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cs-heroes li { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.cs-heroes img.av { width: 40px; height: 40px; border-radius: 6px; }
.cs-heroes li.wait { opacity: .6; }
.cs-heroes li.wait img.av { filter: grayscale(1); }
.csh-name small, .csh-st small { display: block; color: var(--muted); font-size: 13px; }
.csh-st { text-align: right; font-size: 14px; }
.cs-heroes li.hired .csh-st { color: var(--good); }
.cs-heroes li.open .csh-st { color: var(--gold); }

/* Largeur de la page Ville */
@container city (max-width: 760px) {
  .city-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container city (max-width: 480px) {
  .cs-id { grid-template-columns: 88px minmax(0, 1fr); gap: 12px; }
  .cs-img { width: 88px; height: 88px; }
  .cs-name { font-size: 22px; }
  .cs-fx th, .cs-fx td { padding: 6px 6px; }
  .cs-fx tbody th img.ui-ico, .cs-fx tbody th img.ri { margin-right: 4px; }
  #city-level .ch-hall { font-size: 15px; }
}

/* ===== Onglet Commandes : cartes Thomas / Catherine et quêtes de héros compactes (maquette de l'utilisateur, 26/11/2026, renderOrders, hqCardHtml) ===== */
.orders-panel { container: ordp / inline-size; }
#orders-info .oc-badge { font-size: 15px; padding: 2px 12px; vertical-align: 3px; }
#orders.orders { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.orders.hero-quests { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 12px 16px; }
@container ordp (max-width: 860px) { #orders.orders { grid-template-columns: minmax(0, 1fr); } }
@container ordp (max-width: 980px) { .orders.hero-quests { grid-template-columns: minmax(0, 1fr); } }
/* Lignes d'objets : icône | nom | quantités alignées à droite (« 0 / 12 », puis « livrées · 1 en stock ») */
.oc-line { grid-template-columns: 2.2rem minmax(0, 1fr) auto; }
.oc-line .oc-n { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: baseline; column-gap: 8px; text-align: right; font-variant-numeric: tabular-nums; }
.oc-line .oc-n > b { white-space: nowrap; }
.oc-st { white-space: nowrap; font-weight: 600; font-size: 15px; color: var(--muted); }
.oc-stock { color: #8fdc98; }
.oc-line.warn .oc-n { color: #e9b949; }
/* Quête bloquée par le réglage « qualité supérieure » : la raison, sous la ligne */
.q-why { font-size: 14px; line-height: 1.25; color: #e9b949; }
.oc-line > .q-why { grid-column: 2 / -1; }
/* « (voir Options) » : lien vers le réglage « Qualité supérieure autorisée » (action goQuestOption) */
.q-optlink { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.q-optlink:hover, .q-optlink:focus-visible { color: #ffd87a; text-decoration-thickness: 2px; }
.oc-foot { flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.oc-foot .oc-rewards { flex: 1 1 auto; min-width: 0; }
.oc-foot .oc-give { margin-left: auto; }
/* Quêtes de héros : carte repliée (portrait, nom, n° de quête, capacité, prochaine action, bouton) */
.hqc { background: rgba(0,0,0,.2); border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px; min-width: 0; container: hqc / inline-size; }
.hqc.hq-ready { border-color: var(--gold); background: rgba(233,185,73,.08); }
.hqc-sum { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto 34px; grid-template-areas: "face main act chev" "face next act chev"; align-items: center; gap: 4px 12px; }
.hqc-face { grid-area: face; align-self: start; display: flex; }
.hqc-face img.av { width: 56px; height: 56px; object-fit: contain; }
.hqc-main { grid-area: main; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hqc-top { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 12px; }
.hqc-name { background: none; border: 0; padding: 0; color: #fff; font: 20px var(--font-title); cursor: pointer; text-align: left; }
.hqc-name:hover { text-decoration: underline; text-underline-offset: 3px; }
.hqc-name:focus-visible, .hqc-chev:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.hqc-n { color: var(--muted); font-size: 15px; white-space: nowrap; }
.hqc-ab { display: flex; align-items: center; gap: 6px; font-size: 15px; color: var(--muted); min-width: 0; }
.hqc-ab b { color: var(--text); font-weight: 600; }
.hqc-next { grid-area: next; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; min-width: 0; padding: 4px 10px; border-radius: 8px; background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.06); font-size: 15px; }
.hqc-cond { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.hqc-cond img.ii, .hqc-cond .ui-ico, .hqc-cond img.av { width: 1.4rem; height: 1.4rem; object-fit: contain; flex: none; }
.hqc-next.warn { color: #e9b949; border-color: rgba(233,185,73,.35); }
.hqc-next.miss { color: var(--text); }
.hqc-next.ok { color: #8fdc98; border-color: rgba(120,180,90,.45); background: rgba(120,180,90,.12); }
.hqc-more { margin-left: auto; padding: 0 8px; border-radius: 10px; border: 1px solid var(--border); color: var(--muted); font-size: 13px; white-space: nowrap; }
.hqc-act { grid-area: act; }
.hqc-chev { grid-area: chev; width: 34px; height: 34px; border: 1px solid #6a5238; border-radius: 8px; background: rgba(0,0,0,.25); position: relative; cursor: pointer; padding: 0; }
.hqc-chev i { position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; border: solid var(--gold); border-width: 0 2px 2px 0; transform: translate(-50%, -70%) rotate(45deg); transition: transform .15s; }
.hqc.open .hqc-chev i { transform: translate(-50%, -30%) rotate(-135deg); }
.hqc-det { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.hqc-steps { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; justify-content: space-between; }
.hqc-steps .og-steps { max-width: none; }
@container hqc (max-width: 520px) {
  .hqc-sum { grid-template-columns: 48px minmax(0, 1fr) 34px; grid-template-areas: "face main chev" "next next next" "act act act"; }
  .hqc-face img.av { width: 48px; height: 48px; }
  .hqc-act .btn { width: 100%; }
}
/* Pastille « N livraisons possibles » de l'onglet : le nombre seul sur téléphone (la navigation ne bouge pas) */
.tab-badge .tb-short { display: none; }
@media (max-width: 600px) {
  .tab-badge.tb-del .tb-long { display: none; }
  .tab-badge.tb-del .tb-short { display: inline; }
  .oc-foot .oc-give { width: 100%; }
}
/* Carte étroite (téléphone, panneau étroit) : « livrées · n en stock » passe sous la ligne, aligné à droite, le nom garde sa place */
.order-card, .hqc-det { container: occ / inline-size; }
@container occ (max-width: 480px) {
  .oc-line .oc-n { display: contents; }
  .oc-line .oc-n > b { grid-column: 3; grid-row: 1; justify-self: end; }
  .oc-line .oc-st { grid-column: 2 / 4; grid-row: 2; justify-self: end; }
  .oc-line:has(.oc-st) { row-gap: 0; }
  .oc-line:has(.oc-st) > .oc-ico { grid-row: 1 / span 2; }
}

/* ===== Onglet Donjons : bandeau « Expéditions en cours », liste à 4 colonnes et fiche (maquette de l'utilisateur, 26/11/2026, renderDungeons / dgBandHtml / renderDungeonList / dgSheetHtml) =====
   Largeur = celle du panneau (requête de conteneur « dgb ») : fiche à droite (~1/3), sous la liste quand elle ne tient plus ; liste étroite (< 600 px) = 2 lignes par donjon. */
.dungeons-panel { container: dgb / inline-size; }
#expeditions.city-grid { margin-bottom: 14px; }
.xb { background: rgba(0, 0, 0, .18); border: 1px solid var(--border); border-radius: 8px; padding: 12px; }
.xb-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin-bottom: 10px; }
.xb-head h2 { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 22px; }
.xb-head h2 img.ui-ico { height: 32px; width: auto; }
.xb-count { font-size: 16px; padding-left: 16px; border-left: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.xb-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.xt { position: relative; min-width: 0; min-height: 88px; box-sizing: border-box; display: flex; flex-direction: column; justify-content: space-between; gap: 6px; padding: 8px 10px; text-align: left;
  background: linear-gradient(#4b3a2a, #2c2118); border: 3px solid #8a6a3a; border-radius: 12px; color: var(--text); font: inherit; box-shadow: 0 0 0 2px #1d130b, inset 0 0 0 1px rgba(255, 255, 255, .12); }
button.xt { cursor: pointer; }
button.xt:hover:not(:disabled) { filter: brightness(1.1); }
button.xt:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.xt-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.xt-img { width: 44px; height: 32px; object-fit: contain; flex: none; }
.xt-name { font-family: var(--font-title); font-weight: 400; font-size: 16px; line-height: 1.15; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xt-boss img { height: 20px; width: auto; vertical-align: middle; }
.xt-mid { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.xt-mid .slot-heroes { justify-content: flex-start; gap: 0; }
.xt-mid .slot-heroes img.av { width: 30px; height: 30px; vertical-align: middle; margin-right: -4px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .6)); }
.xt-mid .slot-more { font-size: 13px; margin-left: 6px; color: var(--muted); }
.xt-time { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.xt-bar.bar { height: 6px; margin: 0; background: #120d09; border: 1px solid #6b5230; }
.xt-bar i { background: linear-gradient(#f6cd63, #c98a1c); }
.xt-sub { display: block; font-size: 14px; color: #e6d3a8; }
.xt.done { border-color: #fff1b0; background: linear-gradient(#e0a02a, #a8640e); animation: slotDone 1.2s ease-in-out infinite; }
.xt.done .xt-time { color: #fff; }
.xt.done.flash { background: linear-gradient(#f0c040, #b8741a); overflow: hidden; }
.xt.done.flash .xt-time { display: inline-flex; align-items: center; gap: 4px; }
.xt.done.flash .xt-time img.sk { width: 20px; height: 20px; }
.xt.free, .xt.claimall, .xt.buy { flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px; }
.xt.free { background: linear-gradient(#35a9e8, #1a69b8); border-color: #9fe0ff; }
.xt.free .slot-ico { height: 44px; width: auto; flex: none; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .5)); }
.xt.claimall { background: linear-gradient(#4fcf7a, #1d8a44); border-color: #c8ffd8; }
.xt.claimall .xt-ico { height: 40px; width: auto; flex: none; }
.xt-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.xt.buy { background: linear-gradient(#5a5a5a, #3b3b3b); border-color: #8f8f8f; border-style: dashed; }
.xt.buy.ready { background: linear-gradient(#ffd45a, #d98a12); border-color: #fff1b0; border-style: solid; color: #2a1a08; }
.xt.buy.ready .xt-sub { color: #3a2410; }
.xt.buy:disabled { cursor: not-allowed; opacity: .85; }
.xt-lock { font-size: 28px; flex: none; display: flex; }
.xt-lock img { height: 36px; width: auto; }
.xt-cost { display: flex; align-items: center; gap: 4px; font-weight: 700; font-size: 16px; }
.xt-cost img.ui-ico { height: 1.2em; width: auto; }
.xt-miss { font-size: 13px; color: #f0b090; }
/* Emplacements d'expédition améliorés en gemmes (expUpHtml) : pied sous chaque tuile, pastille de relances sur le rail (.slot-rl) */
.xt-slot { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.xt-slot > .xt { flex: 1; }
.xt-up { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 8px; min-height: 32px; padding: 0 2px; font-size: 16px; }
.xt-up-lv { display: inline-flex; align-items: center; gap: 4px; color: #e6d3a8; white-space: nowrap; font-variant-numeric: tabular-nums; }
.xt-up-lv img.ui-ico { height: 20px; width: auto; }
.xt-run { display: flex; align-items: center; gap: 4px; font-size: 14px; color: #ffe08a; white-space: nowrap; font-variant-numeric: tabular-nums; }
.xt-run img.ui-ico { height: 16px; width: auto; }
.xt.done .xt-run { color: #fff; }
.xt-up-buy, .xt-up-max { flex: none; }
.xt-up-buy { display: inline-flex; align-items: center; gap: 4px; height: 32px; box-sizing: border-box; padding: 0 8px; border-radius: 8px; border: 2px dashed #8f8f8f;
  background: linear-gradient(#5a5a5a, #3b3b3b); color: #f5e6c8; font: inherit; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; cursor: not-allowed; opacity: .85; }
.xt-up-buy.ready { border: 2px solid #fff1b0; background: linear-gradient(#ffd45a, #d98a12); color: #2a1a08; cursor: pointer; opacity: 1; }
.xt-up-buy.ready:hover { filter: brightness(1.1); }
.xt-up-buy.ready:active { transform: translateY(1px); }
.xt-up-buy:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.xt-up-buy img.ui-ico { height: 18px; width: auto; }
.xt-up-cost { margin-left: 2px; }
/* « +1 relance » après le prix, séparé par un filet : « +1 100 » se lisait « 1 100 » (correction de l'utilisateur, 05/12/2026) */
.xt-up-plus { display: inline-flex; align-items: center; gap: 2px; margin-left: 4px; padding-left: 8px; border-left: 2px solid currentColor; line-height: 1; }
.xt-up-buy .xt-up-plus img.ui-ico { height: 16px; }
.xt-up-max { font-weight: 700; color: #ffe08a; }
.slot-rl { position: absolute; top: 3px; left: 3px; z-index: 2; display: inline-flex; align-items: center; gap: 2px; height: 20px; padding: 0 5px 0 3px; box-sizing: border-box;
  border-radius: 10px; background: rgba(0, 0, 0, .6); color: #ffe08a; font-size: 13px; line-height: 1; }
.slot-rl img.ui-ico { height: 13px; width: auto; }
@media (prefers-reduced-motion: reduce) { .xt.done { animation: none; } }

.dg-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.dg-list { min-width: 0; container: dgl / inline-size; background: rgba(0, 0, 0, .18); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.dgr-head, .dgr { display: grid; grid-template-columns: minmax(140px, 1.1fr) minmax(190px, 1.5fr) 100px minmax(110px, 1fr); grid-template-areas: "name mat dur boss"; column-gap: 12px; align-items: center; padding: 0 12px; }
.dgr-head { min-height: 44px; font-family: var(--font-title); font-size: 17px; border-bottom: 1px solid var(--border); background: rgba(0, 0, 0, .2); }
.dgr-head .dgr-dur { justify-content: flex-end; }
.dgr { width: 100%; box-sizing: border-box; min-height: 56px; border: 0; border-top: 1px solid rgba(255, 255, 255, .06); border-radius: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.dgr-head + .dgr { border-top: 0; }
.dgr:hover { background: rgba(255, 255, 255, .035); }
.dgr.dgr-raid { background: rgba(233, 185, 73, .13); }
.dgr.dgr-raid:hover { background: rgba(233, 185, 73, .22); }
.dgr-raid [data-raid-schedule] { color: var(--gold); justify-content: flex-end; text-align: right; }
.dgr:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }
.dgr.sel { background: rgba(233, 185, 73, .13); box-shadow: inset 4px 0 0 var(--gold), inset 0 0 0 1px rgba(233, 185, 73, .55); }
.dgr-name { grid-area: name; display: flex; align-items: center; gap: 10px; min-width: 0; padding: 4px 0; }
.dgr-name img { width: 44px; height: 44px; object-fit: contain; flex: none; }
.dgr-name > span { display: flex; flex-direction: column; min-width: 0; }
.dgr-name b { font-family: var(--font-title); font-weight: 400; font-size: 17px; line-height: 1.15; overflow-wrap: anywhere; }
.dgr-name small { font-size: 14px; color: var(--muted); }
.dgr-mat { grid-area: mat; display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 16px; }
.dgr-mat img { height: 28px; width: auto; max-width: 32px; object-fit: contain; flex: none; }
.dgr-mat > span { min-width: 0; line-height: 1.15; overflow-wrap: anywhere; }
.dgr-stock { margin-left: auto; flex: none; min-width: 44px; box-sizing: border-box; padding: 2px 10px 3px; border-radius: 999px; background: rgba(0, 0, 0, .38); border: 1px solid rgba(233, 185, 73, .35); color: var(--gold); font-style: normal; font-size: 15px; line-height: 1.25; text-align: right; font-variant-numeric: tabular-nums; }
.dgr-stock::before { content: "×"; font-size: .8em; opacity: .7; margin-right: 2px; }
.dgr-stock.zero { color: var(--muted); border-color: rgba(255, 255, 255, .12); background: rgba(0, 0, 0, .2); }
.dgr-dur { grid-area: dur; display: flex; align-items: center; justify-content: flex-end; gap: 6px; font-size: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dgr-dur img.ui-ico { height: 1.2em; width: auto; }
.dgr-boss { grid-area: boss; min-width: 0; font-size: 16px; }
.dg-prog { display: flex; flex-direction: column; gap: 3px; font-variant-numeric: tabular-nums; }
.dg-prog .bar { height: 6px; margin: 0; background: #120d09; border: 1px solid #5a4528; }
.dg-prog .bar i { background: linear-gradient(#f6cd63, #c98a1c); }
.dg-st.boss { color: #ff8a78; font-weight: 700; }
.dg-st.done { color: var(--good); }
.dg-req { display: inline-flex; align-items: center; gap: 6px; color: #f0c070; }
.dg-req img { height: 22px; width: auto; }
.dgr.locked .dgr-name img, .dgr.locked .dgr-mat img { filter: grayscale(1) brightness(.75); opacity: .75; }
.dgr.locked .dgr-name b, .dgr.locked .dgr-mat, .dgr.locked .dgr-dur { color: var(--muted); }
.dgr.boss .dgr-name b { color: #ffd0c8; }
.dg-req.lock { flex-wrap: wrap; gap: 2px 12px; }
.dg-req.lock > span { display: inline-flex; align-items: center; gap: 6px; }
/* Donjons verrouillés : bouton de la liste et récompenses possibles (lecture seule) */
.dg-more { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto 72px; align-items: center; column-gap: 10px; width: 100%; box-sizing: border-box; min-height: 48px; padding: 4px 12px; border: 0; border-top: 1px solid rgba(255, 255, 255, .06); border-radius: 0; background: rgba(255, 255, 255, .04); color: inherit; font: inherit; font-size: 16px; text-align: left; cursor: pointer; grid-column: 1 / -1; }
.dg-more:hover { background: rgba(255, 255, 255, .08); }
.dg-more:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }
.dg-more img { height: 24px; width: auto; justify-self: center; }
.dg-more em { font-style: normal; min-width: 28px; box-sizing: border-box; padding: 2px 8px; border-radius: 999px; background: rgba(0, 0, 0, .38); color: var(--gold); text-align: center; font-variant-numeric: tabular-nums; }
.dg-more b { text-align: right; font-weight: 400; color: var(--gold); }
.dgs.locked { max-height: calc(100dvh - var(--sticky-h, 0px) - 24px); box-sizing: border-box; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #6b5334 transparent; }
.dgs.locked > * { flex: none; }
.dgw { display: flex; flex-direction: column; gap: 10px; }
.dgw h4 { margin: 0; text-transform: none; letter-spacing: 0; font-family: var(--font-title); font-weight: 400; font-size: 18px; color: var(--text); }
.dgw p { margin: 0; font-size: 14px; line-height: 1.35; color: var(--muted); }
.dgw-g { border-radius: 8px; background: rgba(0, 0, 0, .25); overflow: hidden; }
.dgw-r { display: grid; column-gap: 8px; align-items: center; padding: 4px 8px; min-height: 30px; box-sizing: border-box; font-size: 16px; line-height: 1.2; }
.dgw-t { grid-template-columns: minmax(0, 1fr) 52px 62px 62px; }
.dgw-l { grid-template-columns: 28px minmax(0, 1fr) 48px 52px; }
.dgw-r + .dgw-r { border-top: 1px solid rgba(255, 255, 255, .06); }
.dgw-r b { font-weight: 400; text-align: right; color: #fff4d6; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dgw-h { font-size: 14px; color: var(--muted); }
.dgw-t.dgw-h > :not(:first-child), .dgw-l.dgw-h > :nth-child(n+3) { text-align: right; }
.dgw-r img { height: 24px; width: auto; max-width: 28px; object-fit: contain; margin: 0; vertical-align: middle; }
.dgw-n small { display: block; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }

.dg-side { position: sticky; top: calc(var(--sticky-h, 0px) + 12px); min-width: 0; }
.dgs { display: flex; flex-direction: column; gap: 12px; padding: 16px; background: rgba(0, 0, 0, .18); border: 1px solid var(--border); border-radius: 8px; }
.dgs:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.dgs, .dgr { scroll-margin-top: 8px; } /* en plus du scroll-padding-top de la page */
.dgs.boss { border-color: #b5483c; }
.dgs-back { display: none; align-self: flex-start; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel-2); color: var(--gold); font: inherit; font-size: 15px; cursor: pointer; }
.dgs-id { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 14px; align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.dgs-id img { width: 112px; height: 100px; object-fit: contain; }
.dgs-id img.dim { filter: grayscale(1) brightness(.75); opacity: .75; }
.dgs-id h3 { margin: 0; text-transform: none; letter-spacing: 0; color: var(--text); font-family: var(--font-title); font-weight: 400; font-size: 26px; line-height: 1.1; overflow-wrap: anywhere; }
.dgs-tier { display: block; margin-top: 2px; font-size: 18px; color: var(--muted); }
.dgs-badge { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 3px 12px; border: 2px solid #c0504d; border-radius: 8px; background: rgba(192, 80, 77, .25); color: #ff9a88; font-weight: 700; font-size: 16px; }
.dgs-badge img { height: 22px; width: auto; }
.dgs-rows { display: flex; flex-direction: column; gap: 10px; }
.dgs-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; column-gap: 10px; font-size: 16px; line-height: 1.3; }
.dgs-ico { display: flex; align-items: center; justify-content: center; }
.dgs-ico img { height: 26px; width: auto; max-width: 28px; object-fit: contain; }
.dgs-val { text-align: right; font-variant-numeric: tabular-nums; color: #fff4d6; max-width: 14em; }
.dgs-val .zero { color: #e07060; }
.dgs-row.risk .dgs-val { color: #f0a54a; } /* « Victoire assurée » contre un boss : au-dessus du pouvoir requis */
.dgs-row.prog { grid-template-columns: 28px minmax(0, 1fr); }
.dgs-row.prog .dgs-lbl { display: none; }
.dgs-row.prog .dgs-val { text-align: left; font-weight: 400; color: var(--muted); }
.dgs-note { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 8px; background: rgba(0, 0, 0, .25); font-size: 15px; line-height: 1.35; }
.dgs-note.lock { border-color: rgba(240, 138, 106, .45); }
.dgs-note img { height: 24px; width: auto; flex: none; }
.dgs-btn { width: 100%; min-height: 52px; font-size: 20px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.dgs-btn img { height: 28px; width: auto; }
.dgs-btn:disabled { opacity: .55; cursor: not-allowed; }

@container dgb (max-width: 900px) {
  .dg-layout { grid-template-columns: minmax(0, 1fr); }
  .dg-side { position: static; }
  .dgs-back { display: inline-block; }
  .dgs.locked { max-height: none; overflow: visible; }
  .dgs-id { grid-template-columns: 88px minmax(0, 1fr); }
  .dgs-id img { width: 88px; height: 80px; }
  .dgs-id h3 { font-size: 22px; }
}
@container dgl (max-width: 640px) {
  .dgr-head { display: none; }
  .dgr { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name dur" "mat boss"; row-gap: 4px; padding: 6px 10px 10px; }
  .dgr-boss { justify-self: end; text-align: right; min-width: 120px; }
  .dg-req.lock { justify-content: flex-end; }
  .dg-prog { min-width: 120px; }
}
@container dgb (max-width: 520px) {
  .xb-tiles { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .xb-count { border-left: 0; padding-left: 0; }
}

/* Échoppe (26/11/2026) : icônes de craft en tête du panneau Recettes (3 lignes + colonne des demandes),
   bâtiments de maîtrise : panneau à part depuis le 30/11/2026 (.mst-groups) */
.recipes-panel > .rec-head { margin: 0 0 10px; }
.recipes-panel > .cat-tabs.cat-seq { flex-wrap: nowrap; align-items: flex-start; gap: 6px; margin: 0 0 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.recipes-panel > .cat-title { margin-top: 0; }
.cat-tabs .cat-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 0 1 auto; }
/* rangée 1 = armes + armures (2 lignes), rangée 2 = accessoires + objets de valeur ; une famille passe à la ligne si la place manque */
.cat-tabs .cat-row { display: flex; flex-wrap: wrap; gap: 6px; }
/* ligne 3 : accessoires puis objets de valeur et Favoris, chacun sur une seule ligne */
.recipes-panel .family.fam-accessoires, .recipes-panel .family.fam-valeurs { display: flex; gap: 6px; }
/* Commandes, Comptoir, Quêtes : en colonne à droite des armures, alignés sur les 3 lignes */
.cat-tabs .want-group { display: flex; flex-direction: column; gap: 6px; flex: none; margin-left: 4px; }
.cat-tabs .want-group:empty { display: none; }
#racks-body[hidden] { display: none; }
/* colonne un peu étroite : tuiles réduites de quelques px pour garder les 10 colonnes (9 de catégories + celle des demandes) */
@container (min-width: 340px) { .recipes-panel .cat-tabs .cat-tab.has-img { width: min(36px, calc((100cqw - 60px) / 10)); height: min(36px, calc((100cqw - 60px) / 10)); } }

/* ===== Filtre par qualité : Stock (menu flottant de l'en-tête) et Fusion (ligne « Qualité ») — 26/11/2026 ===== */
/* Repère de couleur : losange à la couleur de QUALITIES ; « Toutes » = toutes les couleurs */
.q-dot { flex: none; width: 10px; height: 10px; border-radius: 2px; transform: rotate(45deg); background: var(--q); box-shadow: 0 0 0 1px rgba(0, 0, 0, .5); }
.q-dot.all { background: conic-gradient(#c9bba5 0 14%, #6fbf73 0 28%, #5fa8d3 0 43%, #b07cf0 0 57%, #e05ab8 0 71%, #e9b949 0 86%, #ff5a3c 0); }
/* Stock : bouton doré à côté de « Réduire », menu ancré dessous (position absolue : ni les filtres de type ni les tuiles ne bougent) */
.stock .panel-head { gap: 8px; }
.stock-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
.sq-wrap { position: relative; }
.sq-wrap[hidden] { display: none; }
.sq-btn { white-space: nowrap; }
.sq-caret { display: inline-block; width: 0; height: 0; margin-left: 8px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid currentColor; transition: transform .15s; }
.sq-btn[aria-expanded="true"] .sq-caret { transform: rotate(180deg); }
.sq-list { z-index: 60; min-width: 210px; overflow-y: auto; overscroll-behavior: contain; }
.sq-list.up { top: auto; bottom: calc(100% + 6px); }
.sq-item { justify-content: flex-start; gap: 12px; font-size: 16px; }
.sq-item + .sq-item { margin-top: 2px; }
.sq-item .sq-name { flex: 1; }
.sq-item .sq-check { width: 16px; color: var(--gold); font-weight: 700; text-align: center; }
.sq-item.sel { background: rgba(255, 255, 255, .06); }
.sq-item:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
/* Fusion : grille à 2 colonnes (libellés | boutons) ; rang, type et qualité partent du même bord gauche */
.fu-filters { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: start; gap: 10px 16px; }
.fu-flbl { display: flex; align-items: center; min-height: 36px; font-size: 16px; color: #f3e8d0; }
.fu-flbl.fl-rank { min-height: 40px; }
.fu-filters .fu-ranks, .fu-filters .fu-cats { flex: none; min-width: 0; }
/* Type du chaudron : 2 lignes (« Tout » + 13 colonnes : 4 armes, 5 armures, 2 accessoires, 2 objets de valeur), chaque famille remplie par colonnes de 2 ;
   sous 500 px de large, 3 lignes comme le Stock (tuiles trop petites sinon) */
.cat-filter.fu-cats, .cat-filter.fu-cats .cat-main, .cat-filter.fu-cats .cat-row, .cat-filter.fu-cats .cat-row .family { gap: 8px; }
.cat-filter.fu-cats .cat-tab.has-img { width: min(36px, calc((100cqw - 72px) / 10)); height: min(36px, calc((100cqw - 72px) / 10)); }
@container (min-width: 500px) {
  .cat-filter.fu-cats .cat-main { flex-direction: row; }
  .cat-filter.fu-cats .family.fam-accessoires, .cat-filter.fu-cats .family.fam-valeurs { display: grid; }
  .cat-filter.fu-cats .cat-tab.has-img { width: min(36px, calc((100cqw - 104px) / 14)); height: min(36px, calc((100cqw - 104px) / 14)); }
}
/* Bouclier aussi large que son image (38 px pour 40 de haut), calé à gauche de sa case : bord gauche aligné ET chiffre centré */
.fu-filters .rk-badge { width: min(100%, 38px); justify-self: start; background-position: center; }
.fu-quals { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.fq-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px 2px; box-sizing: border-box; border-radius: 10px; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text); font: 15px var(--font-text); white-space: nowrap; transition: filter .15s; }
.fq-btn:hover { filter: brightness(1.2); }
.fq-btn.sel { --q: var(--gold); border: 2px solid var(--q); padding: 0 13px 2px; box-shadow: 0 0 8px var(--q); }
.fq-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.fq-check { color: var(--q, var(--gold)); font-weight: 700; }
/* ===== Filtre multi-qualités (Stock, chaudron, choix d'objet du héros) — 03/12/2026, voir QF dans game.js =====
   Ordinateur : pastilles à la couleur de la qualité ; allumée = pleine et lumineuse, éteinte = estompée. Téléphone : menu à cases (.qf-list). */
.qf-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.qf-pill { --q: var(--gold); box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; min-width: 36px; margin: 0; padding: 0 12px 2px;
  border: 2px solid color-mix(in srgb, var(--q) 40%, transparent); border-radius: 999px; background: rgba(0, 0, 0, .28); color: #a99c88; font: 15px var(--font-text); line-height: 1; white-space: nowrap;
  cursor: pointer; opacity: .6; transition: opacity .15s, background .15s, box-shadow .15s; -webkit-touch-callout: none; user-select: none; }
.qf-pill .qf-dot { flex: none; box-sizing: border-box; width: 12px; height: 12px; border: 2px solid var(--q); border-radius: 50%; }
.qf-pill .q-dot { width: 10px; height: 10px; }
.qf-pill.on { opacity: 1; border-color: var(--q); background: color-mix(in srgb, var(--q) 22%, #1d130a); color: var(--q); box-shadow: 0 0 6px color-mix(in srgb, var(--q) 55%, transparent); }
.qf-pill.on .qf-dot { background: var(--q); }
.qf-pill:hover:not(:disabled) { opacity: 1; }
.qf-pill.last { cursor: default; }
.qf-pill:disabled { opacity: .22; cursor: default; box-shadow: none; }
.qf-pill:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.qf-all.on { color: var(--gold); }
/* Stock : pastilles rondes sans libellé (nom au survol), libellés affichés si le panneau est large */
.qf-host { container-type: inline-size; margin-bottom: 8px; }
.qf-host[hidden] { display: none; }
.qf-stock { gap: 8px; }
.qf-stock .qf-pill { --qs: min(32px, calc((100cqw - 56px) / 8)); width: var(--qs); min-width: 0; height: var(--qs); padding: 0; } /* 8 pastilles sur une ligne */
.qf-stock .qf-dot { width: 14px; height: 14px; }
.qf-stock .q-dot { width: 12px; height: 12px; }
.qf-opt { display: none; }
@container (min-width: 820px) {
  .qf-stock .qf-pill { width: auto; height: 32px; padding: 0 12px 2px; }
  .qf-stock .qf-opt { display: inline; }
}
/* Stock, ordinateur : filtres en moins de lignes quand le panneau est large (03/12/2026). Pastilles et catégories regroupées dans .stock-filters (index.html).
   ≥ 540 px : catégories sur 2 lignes (familles côte à côte, 14 colonnes) ; ≥ 700 px : qualités en bloc 4 × 2 devant (18 colonnes, 2 lignes en tout) ;
   ≥ 1150 px : noms des qualités affichés. Tuiles et pastilles de même taille (--sf-t), 8 px dans un groupe, 12 px entre groupes. */
html:not(.tel) .panel.stock { container: stockf / inline-size; } /* sur le panneau : un conteneur ne peut pas se styler lui-même */
@container stockf (min-width: 540px) {
  html:not(.tel) .stock-filters .cat-filter { --sf-t: min(36px, calc((100cqw - 120px) / 14)); container-type: normal; }
  html:not(.tel) .stock-filters .cat-main { flex-direction: row; align-items: flex-end; gap: 12px; }
  html:not(.tel) .stock-filters .cat-row { display: contents; }
  html:not(.tel) .stock-filters .cat-filter .family { display: grid; grid-template-rows: repeat(2, var(--sf-t)); grid-auto-flow: column; grid-auto-columns: var(--sf-t); gap: 8px; margin: 0; }
  html:not(.tel) .stock-filters .cat-filter .cat-tab.has-img { width: var(--sf-t); height: var(--sf-t); }
}
@container stockf (min-width: 700px) {
  html:not(.tel) .stock-filters { display: flex; align-items: flex-start; gap: 12px; }
  html:not(.tel) .stock-filters > .qf-host, html:not(.tel) .stock-filters > .cat-filter { --sf-t: min(36px, calc((100cqw - 156px) / 18)); container-type: normal; margin: 0 0 10px; }
  html:not(.tel) .stock-filters > .qf-host { flex: none; }
  html:not(.tel) .stock-filters .qf-stock { display: grid; grid-template-columns: repeat(4, var(--sf-t)); grid-auto-rows: var(--sf-t); gap: 8px; }
  html:not(.tel) .stock-filters .qf-stock .qf-pill { width: var(--sf-t); height: var(--sf-t); padding: 0; }
  html:not(.tel) .stock-filters .qf-stock .qf-opt { display: none; }
}
@container stockf (min-width: 1150px) {
  html:not(.tel) .stock-filters .qf-stock { grid-template-columns: repeat(4, auto); }
  html:not(.tel) .stock-filters .qf-stock .qf-pill { width: auto; padding: 0 12px 2px; }
  html:not(.tel) .stock-filters .qf-stock .qf-opt { display: inline; }
}
/* Chaudron : 2 lignes de 4 (« Toutes » + 7 qualités), comme avant */
.fu-quals.qf-row { display: grid; }
.fu-fqual .qf-pill { padding: 0 8px 2px; }
/* Choix d'objet du héros : mêmes dimensions que les autres filtres de la barre (.ep-f) */
.ep-fq .qf-pill { height: 44px; min-width: 48px; padding: 0 12px; border-radius: 12px; background: #4a2f18; font: 16px var(--font-title), serif; color: #d9c7a6; }
.ep-fq .qf-pill.on { background: #2e1c0c; color: var(--q); box-shadow: inset 0 0 0 3px var(--q); }
.ep-fq .qf-all.on { color: #f6e6c8; box-shadow: inset 0 0 0 3px #f4c542; }
.ep-fq .qf-pill .qf-dot { width: 14px; height: 14px; }
.ep-fq .qf-pill .q-dot { width: 12px; height: 12px; }
@media (max-width: 1360px) { html:not(.tel) .ep-fq .qf-pill { padding: 0 8px; } }
@media (max-width: 1240px) { /* pastille de couleur seule, nom au survol */
  html:not(.tel) .ep-fq .qf-pill:not(.qf-all) .qf-name { display: none; }
  html:not(.tel) .ep-fq .qf-pill .qf-dot { width: 20px; height: 20px; }
}
/* Menu à cases (téléphone) : « Tout » / « Rien » puis une case par qualité */
.qf-wrap { position: relative; }
.qf-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 2px 2px 8px; margin-bottom: 4px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.qf-quick .btn { justify-content: center; }
.qf-item .qf-box { flex: none; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; padding-bottom: 1px;
  border: 2px solid #8d7b62; border-radius: 5px; color: #1d130a; font-weight: 700; font-size: 15px; line-height: 1; }
.qf-item.sel .qf-box { background: var(--gold); border-color: var(--gold); }
.qf-item:disabled { opacity: .35; }
.qf-tel { display: block; }
.fu-fbar { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* ----- Chaudron : emplacements améliorés (case de copie), 26/11/2026 ----- */
.fu-tile.idle.super { background: linear-gradient(#3fd68a, #138a55); border-color: var(--gold); box-shadow: inset 0 0 0 2px #0a4a2c, 0 0 10px rgba(233, 185, 73, .6); }
#fusion-slots { display: flex; flex-direction: column; gap: 10px; }
.fu-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fu-sl.copy { border: 2px dashed var(--gold); color: var(--gold); cursor: default; }
.fu-sl.full.copy { border-style: dashed; border-color: var(--gold); cursor: default; opacity: .92; }
.fu-sl.copy small { color: var(--gold); font-weight: 700; }
.fu-sup-note { margin-top: -4px; }

/* ----- Fenêtre de fusion, ordinateur (.fu-desk), 02/12/2026 : règles dans une bulle, bande cases + boutons, résultats en cartes, filtres resserrés ; la liste prend le reste ----- */
.fu-desk { position: relative; }
.fu-desk .save-head { justify-content: flex-start; }
.fu-desk .save-head .btn.close { margin-left: auto; }
.fu-help-btn { width: 30px; height: 30px; font-size: 18px; padding: 0 0 2px; }
.fu-help-btn.on { background: var(--gold); color: #2a1706; }
.fu-help { position: absolute; z-index: 30; top: 52px; left: 0; width: min(720px, 100%); box-sizing: border-box; padding: 12px 16px; border-radius: 12px; background: #1f1812; box-shadow: 0 10px 28px rgba(0, 0, 0, .65); }
.fu-help[hidden] { display: none; }
.fu-help p { margin: 0; font-size: 16px; }
.fu-help p + p { margin-top: 8px; }
.fu-desk .fu-body { gap: 10px; }
.fu-band { display: flex; align-items: center; gap: 16px; }
.fu-band .fu-sels { flex: 0 1 auto; flex-wrap: nowrap; min-width: 0; }
.fu-band .fu-sl { flex: 0 1 92px; width: 92px; min-width: 64px; }
.fu-go { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; margin-left: auto; }
.fu-btns { display: flex; gap: 8px; align-items: center; }
/* Plafond de Méticuleux (chaudron) et d'Intendant (fenêtre de fabrication) : « icône total / plafond », doré au plafond (talentCapPill) */
.cap-pill { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 3px 12px; border-radius: 999px; background: rgba(255, 248, 230, .1); color: #f3e8d0; font-size: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cap-pill b { font-weight: 600; padding-bottom: 1px; } /* chiffres Cyberbit un peu bas : remontés */
.cap-pill img.sk { width: 22px; height: 22px; margin: 0; }
.cap-pill.full { background: rgba(233, 185, 73, .22); color: #f5c95a; box-shadow: inset 0 0 0 1px rgba(233, 185, 73, .55); }
.pg2-pill.cap-pill { color: #5a3a1b; font-size: 20px; }
.pg2-pill.cap-pill.full { background: rgba(233, 185, 73, .35); color: #7a4d00; }
/* Intendant : sous l'image de l'objet (colonne 1 du pied), au-dessus des pastilles quand l'image est masquée (≤ 900 px) */
.dp.pg2 .pg2-foot > .pg2-cap { grid-column: 1; grid-row: 1; justify-self: center; align-self: center; min-width: 0; min-height: 40px; box-sizing: border-box; padding: 6px 12px; font-size: 18px; }
.dp.pg2 .pg2-foot > .pg2-cap ~ .pg2-pills { grid-row: 1; }
@media (max-width: 900px) { .dp.pg2 .pg2-foot { row-gap: 10px; } .dp.pg2 .pg2-foot > .pg2-cap ~ .pg2-pills { grid-row: 2; } }
/* résultats : une ligne de cartes de hauteur fixe (le contenu ne pousse pas la liste quand on ajoute des objets) */
/* résultats entre les cases et les boutons : une seule rangée de cartes (les suivantes, moins importantes, sont masquées ; liste complète au survol) */
.fu-oline { flex: 1 1 0; min-width: 230px; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); grid-template-rows: auto; grid-auto-rows: 0; gap: 0 8px; overflow: hidden; align-items: stretch; align-self: center; }
.fu-oc { min-height: 60px; box-sizing: border-box; row-gap: 0; align-content: center; }
.fu-oc .fu-tag { grid-column: 1 / -1; }
.fu-oc .fu-on { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.fu-oc { padding: 4px 10px; }
.fu-oc .fu-on > span { font-size: 14px; line-height: 1.15; overflow-wrap: anywhere; }
.fu-oc b { font-size: 17px; }
/* 3 résultats ou plus : cartes basses sur 2 rangées dans la hauteur des cases (84 px), remplies par colonnes ; étiquettes en infobulle, le meilleur reste doré */
.fu-oline.many { grid-template-rows: repeat(2, 38px); grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); grid-template-columns: none; gap: 8px; overflow: hidden; }
.fu-oline.many .fu-oc { min-height: 0; height: 38px; padding: 2px 8px; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 6px; }
.fu-oline.many .fu-ico img.ii { width: 28px; height: 28px; }
.fu-oline.many .fu-on > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.fu-oline.many .fu-on small { font-size: 12px; line-height: 1.1; }
.fu-oline.many .fu-oc b { font-size: 16px; }
.fu-tag { font-style: normal; font-size: 12px; line-height: 1.15; color: #ffd45a; }
.fu-hint { grid-column: 1 / -1; align-self: center; margin: 0; color: #e6d6b4; font-size: 16px; }
/* filtres : ligne Rang (+ Réinitialiser, compteur), puis Type et Qualité côte à côte quand la place le permet */
.fu-filters.fu-fd { display: flex; flex-direction: column; align-items: stretch; gap: 8px; margin: 0; }
.fu-frow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; min-width: 0; }
.fu-frank .fu-ranks { flex: 1 1 500px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.fu-frank .fu-fbar { flex: none; gap: 12px; }
.fu-frank .fu-count { margin-left: 0; }
.fu-ftq { align-items: flex-start; }
.fu-fgrp { display: flex; align-items: flex-start; gap: 16px; min-width: 0; }
.fu-ftype { flex: none; }
.fu-ftype .fu-cats { flex: none; width: 616px; margin: 0; } /* 14 tuiles de 36 px + 13 écarts de 8 px : (100cqw - 104) / 14 = 36 */
.fu-fqual { flex: 1 1 400px; }
.fu-fd .fu-flbl { min-width: 56px; }
.fu-fd .fu-flbl.fl-rank { min-height: 40px; }
.fu-fqual .fu-quals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); flex: 1; max-width: 640px; } /* 2 lignes de 4 : même hauteur que les 2 lignes de Type */
.fu-fqual .fq-btn { padding: 0 10px 2px; }
.fu-fqual .fq-btn.sel { padding: 0 9px 2px; }
.fu-desk .fu-pick { min-height: 200px; }

/* Fond des fenêtres à cartes (Progrès, Expéditions disponibles, Inventaire) : panneau parchemin en 9 tranches */
.dp.pg, .dp.xp, .dp.ep { box-sizing: border-box; padding: 12px 18px 20px; border: 16px solid transparent; border-bottom-width: 20px; border-image: url(../img/fond/popup.png) 16 16 20 16 fill / 16px 16px 20px 16px stretch; overflow-y: auto; filter: drop-shadow(0 10px 24px rgba(0, 0, 0, .6)); }
.dp.pg .dp-title, .dp.xp .dp-title, .dp.ep .dp-title { color: #3a2412; text-shadow: none; margin: 0 0 8px; }
.dp.pg .dp-title small, .dp.xp .dp-title small, .dp.ep .dp-title small { color: #7a5a38; }
.dp.pg .pg-odds { color: #5a4a3a; }
.dp.pg .pg-odds .odd { background: #2b1e13; border-color: #6b4a22; }
.dp.pg .btn.close, .dp.xp .btn.close, .dp.ep .btn.close { filter: drop-shadow(0 2px 2px rgba(58, 36, 18, .6)); }
/* Chances de qualité : un bloc par qualité, sur une seule ligne dont la largeur est celle des cartes de paliers au-dessus (--pg-w) */
.dp.pg .pg-odds { gap: 8px; padding: 0; margin: 6px auto 0; width: min(100%, var(--pg-w, 100%)); flex-wrap: wrap; justify-content: center; }
.dp.pg .pg-odds > span:first-child { flex: 1 1 100%; text-align: center; font-size: 16px; margin-bottom: -2px; }
.dp.pg .pg-odds .odd { flex: 1 1 0; min-width: 104px; box-sizing: border-box; flex-direction: column; justify-content: center; gap: 2px; padding: 6px 6px 7px; min-height: 62px; text-align: center; font-size: 15px; line-height: 1.15; }
.dp.pg .pg-odds .odd b { font-size: 19px; }
.dp.pg .pg-odds .odd i { font-size: 13px; }

/* Fenêtre Progrès : en-tête violet (niveau, nom, qualité, barre vers le prochain palier), visuel de l'objet, cartes de paliers, chances de qualité, pastilles de stats */
.dp.pg2 { width: min(96vw, 1180px); padding: 0 0 12px; overflow-x: hidden; }
.pg2-head { display: flex; align-items: center; gap: 16px; margin: 0; padding: 8px 14px 8px 8px; border-radius: 12px 12px 0 0; background: linear-gradient(100deg, #5a2a99 0%, #6e34b8 55%, #6e34b8 62%, transparent 62.2%); color: #fff; }
.pg2-lvl { flex: none; width: 58px; height: 64px; display: flex; align-items: center; justify-content: center; font-family: var(--font-title), serif; font-size: 30px; -webkit-text-stroke: 4px #2c1050; paint-order: stroke fill; background: linear-gradient(#8a52e0, #4a2285); border: 4px solid #e9b949; border-radius: 12px 12px 50% 50% / 12px 12px 60% 60%; box-shadow: 0 3px 5px rgba(0, 0, 0, .45); }
.pg2-id { display: flex; flex-direction: column; min-width: 0; flex: 0 1 36%; }
.pg2-id b { font-family: var(--font-title), serif; font-weight: 400; font-size: 28px; line-height: 1.05; -webkit-text-stroke: 4px #2c1050; paint-order: stroke fill; overflow-wrap: anywhere; }
.pg2-id small { font-size: 15px; font-family: var(--font-title), serif; -webkit-text-stroke: 3px #2c1050; paint-order: stroke fill; }
.pg2-bar { position: relative; flex: 1 1 200px; height: 26px; border-radius: 13px; background: #15100b; border: 2px solid #0d2b25; overflow: hidden; margin-left: auto; }
.pg2-bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(#58e06c, #1fa043); border-radius: 12px; }
.pg2-bar > span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--font-title), serif; font-size: 18px; color: #fff; -webkit-text-stroke: 4px #15100b; paint-order: stroke fill; }
.pg2-bar img.ui-ico { height: 1em; width: auto; }
.pg2-head .btn.close { flex: none; }
.pg2-body { display: flex; gap: 16px; align-items: stretch; padding: 14px 18px 0; }
.pg2-art { flex: 0 0 210px; display: flex; align-items: center; justify-content: center; }
.pg2-art img { max-width: 100%; max-height: 230px; object-fit: contain; filter: drop-shadow(0 8px 8px rgba(58, 36, 18, .45)); }
.pg2-art span { font-size: 120px; }
.pg2-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.dp.pg2 .pg-row { gap: 12px; padding: 4px 0 8px; align-items: flex-start; justify-content: safe center; }
.pg-col { flex: 0 0 152px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.dp.pg2 .pg-card { flex: none; width: 100%; box-sizing: border-box; min-height: 190px; padding: 12px 6px 10px; border: 0; border-radius: 26px; background: rgba(110, 92, 58, .22); box-shadow: inset 0 0 0 1px rgba(90, 58, 27, .12); opacity: 1; filter: none; justify-content: space-between; }
.dp.pg2 .pg-card:not(.done) .pg-ico { opacity: .85; }
.dp.pg2 .pg-card.done { background: rgba(120, 170, 80, .22); }
.dp.pg2 .pg-card.next { box-shadow: inset 0 0 0 3px #e9b949; background: rgba(233, 185, 73, .2); }
.dp.pg2 .pg-card.is-q { background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--q) 38%, transparent), rgba(110, 92, 58, .22) 75%); box-shadow: inset 0 0 0 2px var(--q); }
.dp.pg2 .pg-lbl { min-height: 0; font-size: 17px; color: #5a3a1b; }
.dp.pg2 .pg-at { margin-top: 0; font-size: 26px; color: #6b5a45; }
.pg2-foot { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; padding: 10px 18px 0; margin-top: 8px; border-top: 2px solid rgba(90, 58, 27, .15); }
.pg2-pill { display: inline-flex; align-items: center; gap: 8px; min-width: 110px; justify-content: center; padding: 6px 16px; border-radius: 999px; background: rgba(110, 92, 58, .2); font-family: var(--font-title), serif; font-size: 20px; color: #5a3a1b; font-variant-numeric: tabular-nums; }
.pg2-pill img { height: 1.3em; width: auto; }
@media (max-width: 900px) { .pg2-art { display: none; } .pg2-head { background: linear-gradient(100deg, #5a2a99, #6e34b8); flex-wrap: wrap; } .pg2-id { flex-basis: 50%; } }

/* Fiche du héros (#hero-modal, renderHeroModal) : maquette de l'utilisateur (27/11/2026) et ses assets (My_Assets/17_Fiche_heros → img/fiche/,
   tools/assets_fiche.py) : cadre crème à contour brun, bannière rouge (niveau | nom, classe), XP ou plafond à droite, bouton rond « × »,
   portrait, onglets (images actif / inactif), 7 tuiles (pleine / vide), ligne « Bonus de panoplie n / 7 », bande jaune des pouvoirs et boutons pilules */
dialog#hero-modal { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: none; color: inherit; overflow: visible; }
dialog#hero-modal::backdrop { background: none; }
.dp.hs { width: min(96vw, 1180px); max-height: 94vh; box-sizing: border-box; display: flex; flex-direction: column; padding: 0; overflow: visible; color: #3a2412;
  border: 32px solid transparent; border-image: url("../img/fiche/cadre.webp") 64 fill / 32px stretch; filter: drop-shadow(0 10px 24px rgba(0, 0, 0, .6)); }
.hs-scroll { flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; margin: 0 -12px; padding: 0 12px; } /* 12 px : les croix de retrait débordent de 9 px */
/* En-tête */
.hs-head { flex: none; display: flex; align-items: center; gap: 16px; margin: -6px 0 6px; }
.hs-ban { flex: 0 1 46%; min-width: 0; min-height: 74px; box-sizing: border-box; display: flex; align-items: center; gap: 16px; padding: 6px 20px 6px 14px; border-radius: 12px; background: #7d1214; color: #fff; }
.hs-lvl { flex: none; width: 58px; height: 62px; background: url("../img/ui/niveau_heros.png") center / contain no-repeat; display: flex; align-items: center; justify-content: center; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .45)); }
.hs-lvl b { font-size: 26px; padding-bottom: 3px; }
.hs-lvl.d3 b { font-size: 20px; }
.hs-vsep { flex: none; width: 2px; align-self: stretch; margin: 6px 0; background: rgba(255, 214, 190, .45); border-radius: 1px; }
.hs-id { display: flex; flex-direction: column; min-width: 0; }
.hs-id b { font-family: var(--font-title), serif; font-weight: 400; font-size: 30px; line-height: 1.05; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .35); overflow-wrap: anywhere; }
.hs-id small { font-family: var(--font-title), serif; font-size: 18px; line-height: 1.2; color: #f3d9bd; }
.hs-id small img.ui-ico { height: 1.1em; vertical-align: -.2em; }
.hs-right { flex: 1 1 200px; display: flex; justify-content: center; align-items: center; min-width: 0; }
.hs-right .lvl-max { padding: 0; }
.hs-right .lvl-max .lm { font-size: 34px; }
.hs-right .pg2-bar { flex: 1 1 auto; max-width: 440px; height: 30px; margin: 0; }
.hs-right .lvl-cap { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: auto; max-width: 100%; margin: 0; padding: 7px 26px 8px; border: 2px solid #e5c374; border-radius: 9px;
  background: #f7e1ab; color: #5a3a1b; font-family: var(--font-title), serif; font-size: 18px; line-height: 1.15; text-align: center; }
.hs-right .lvl-cap .lc-go { position: static; color: #8a5a10; }
.hs-right button.lvl-cap:hover, .hs-right button.lvl-cap:focus-visible { background: #fbe7b5; border-color: #d9a94a; }
.hs-state { font-family: var(--font-title), serif; font-size: 17px; line-height: 1.2; color: #5a3a1b; text-align: center; padding: 7px 18px; border: 2px solid #e5c374; border-radius: 9px; background: #f7e1ab; }
.hs-close { flex: none; width: 46px; height: 46px; padding: 0; border: 0; background: none; cursor: pointer; transition: filter .15s, transform .05s; }
.hs-close img { width: 100%; height: 100%; object-fit: contain; display: block; }
.hs-close:hover { filter: brightness(1.05); }
.hs-close:active { transform: translateY(1px); }
.hs-close:focus-visible { outline: 2px solid #e9b949; outline-offset: 2px; border-radius: 50%; }
/* Corps : portrait | onglets et contenu */
.hs-body { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; padding: 10px 0 0; }
.hs-portrait { display: flex; align-items: center; justify-content: center; align-self: center; }
.hs-portrait img.av { width: 190px; height: 190px; object-fit: contain; filter: drop-shadow(0 6px 6px rgba(58, 36, 18, .35)); }
.dp.hs.ro .hs-portrait img.av { filter: grayscale(.6) drop-shadow(0 6px 6px rgba(58, 36, 18, .35)); }
/* Buste HD (HERO_BUSTS, choix de l'utilisateur du 02/12/2026, cadrage revu le même jour) : dans la colonne du portrait (même largeur : la fenêtre
   garde sa taille), image entière (contain) calée en haut, juste sous la bannière ; elle déborde de 12 px de chaque côté (8 px restent avant les tuiles).
   Les fondus des bords coupés sont dans l'image (tools/bustes_heros.py) : aucune coupe nette. Sous 900 px : la tête habituelle. */
.dp.hs .hs-bust { display: none; }
@media (min-width: 901px) {
  .dp.hs.has-art .hs-portrait { align-self: stretch; position: relative; min-height: 320px; }
  .dp.hs.has-art .hs-portrait img.av { visibility: hidden; }
  .dp.hs.has-art .hs-bust { display: block; position: absolute; left: -12px; top: -8px; width: calc(100% + 24px); height: calc(100% + 8px); object-fit: contain; object-position: 50% 0;
    pointer-events: none; filter: drop-shadow(0 6px 6px rgba(58, 36, 18, .3)); }
  .dp.hs.has-art.ro .hs-bust { filter: grayscale(.6) drop-shadow(0 6px 6px rgba(58, 36, 18, .3)); }
}
.hs-main { min-width: 0; display: flex; flex-direction: column; }
.hs-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 0 2px; border-bottom: 2px solid #cdb383; }
.hs-tab { box-sizing: border-box; min-width: 0; height: 46px; margin-bottom: -2px; padding: 0 6px; border-style: solid; border-width: 12px 13px 3px 13px; background: none; cursor: pointer;
  border-image: url("../img/fiche/onglet_inactif.webp") 24 26 6 26 fill / 12px 13px 3px 13px stretch;
  font-family: var(--font-title), serif; font-size: 20px; line-height: 1; color: #6b4a22; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hs-tab:hover { filter: brightness(1.04); }
.hs-tab.on { border-image-source: url("../img/fiche/onglet_actif.webp"); color: #3a2412; }
.hs-tab:focus-visible { outline: 2px solid #e9b949; outline-offset: -4px; }
.hs-pane { padding: 14px 0 0; }
/* Onglets empilés dans la même cellule (renderHeroModal) : la fenêtre garde la hauteur du plus grand onglet */
.hs-pane, .dp.hs .hs-btns, .pf-panes { display: grid; }
.hs-layer { grid-area: 1 / 1; min-width: 0; }
.hs-layer.off { visibility: hidden; pointer-events: none; }
.hs-btns > .hs-layer { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; align-items: center; }
.hs-hint { margin: 10px auto 0; padding: 5px 14px; width: fit-content; max-width: 100%; box-sizing: border-box; border-radius: 9px; background: #f7e1ab; color: #5a3a1b; font-size: 16px; text-align: center; }
/* Tuiles d'emplacement (img/fiche/tuile_pleine|tuile_vide.webp) */
.hs-slots { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; max-width: 900px; margin: 0 auto; width: 100%; }
.hs-slots.pets { grid-template-columns: repeat(8, minmax(0, 1fr)); max-width: 1020px; } /* 8e case : familiers (PETS_ON) */
.hs-slot { position: relative; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.hs-tile { position: relative; width: 100%; aspect-ratio: 139 / 150; border: 0; cursor: pointer; container-type: inline-size;
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 3px; padding: 15% 14% 19%; overflow: visible;
  background: url("../img/fiche/tuile_vide.webp") center / 100% 100% no-repeat; font: inherit; color: #fff; transition: filter .15s, transform .05s; }
.hs-tile.full { background-image: url("../img/fiche/tuile_pleine.webp"); }
.hs-tile:hover:not(:disabled) { filter: brightness(1.05); }
.hs-tile:active:not(:disabled) { transform: translateY(1px); }
.hs-tile:disabled { cursor: default; }
.hs-tile.empty { filter: saturate(.35) brightness(.92); }
.hs-tile.full.broken .hs-art { filter: grayscale(1) brightness(.75); flex: 0 1 auto; }
.hs-tile.can::after { content: ""; position: absolute; top: -3px; right: -3px; width: 13px; height: 13px; border-radius: 50%; background: #2fc25b; box-shadow: 0 0 0 2.5px #fff, 0 1px 3px rgba(0, 0, 0, .35); }
.hs-art { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; width: 100%; min-height: 0; font-size: 40cqw; line-height: 1; }
.hs-art img { display: block; width: 74cqw; height: 74cqw; object-fit: contain; filter: drop-shadow(0 0 2px var(--q, transparent)) drop-shadow(0 3px 3px rgba(0, 0, 0, .3)); }
.hs-tile .hcard-icons { flex: none; width: 100%; }
.hs-lbl { font-family: var(--font-title); font-size: clamp(12px, 18cqw, 19px); line-height: 1.1; white-space: nowrap; letter-spacing: .3px; text-align: center;
  text-shadow: -1px -1px 0 #4a2a10, 1px -1px 0 #4a2a10, -1px 1px 0 #4a2a10, 1px 1px 0 #4a2a10, 0 2px 0 #4a2a10; }
.hs-lbl img.ui-ico { height: 1.1em; width: auto; vertical-align: -.2em; }
.hs-rm { position: absolute; top: -9px; right: -9px; z-index: 2; width: 30px; height: 30px; padding: 0; border: 0; background: url("../img/fiche/fermer.webp") center / contain no-repeat; cursor: pointer; }
.hs-rm img { display: none; }
.hs-rm:hover:not(:disabled) { filter: brightness(1.06); }
.hs-flag { display: block; height: 24px; margin: -12px 0 2px; position: relative; z-index: 2; line-height: 0; }
.hs-flag .flag-ico, .hs-set .flag-ico { width: 20px; height: 24px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .3)); }
.hs-under { min-height: 64px; display: flex; flex-direction: column; align-items: center; gap: 1px; padding-top: 2px; max-width: 100%; }
.hs-pw { font-family: var(--font-title), serif; font-weight: 400; font-size: 22px; line-height: 1.1; color: #ffd34a; -webkit-text-stroke: 4px #6b2a0a; paint-order: stroke fill; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hs-pw.muted { color: #c9b9a0; -webkit-text-stroke: 3px #5a4a3a; font-size: 17px; }
.hs-bk { display: inline-flex; align-items: center; gap: 3px; font-family: var(--font-title), serif; font-size: 17px; color: #2f8a3e; white-space: nowrap; }
.hs-bk img.shield-ico { width: 18px; height: 18px; }
/* Arène : copier depuis l'ensemble de quête (sous une case vide), pastille sur un objet partagé */
.hs-copy { width: 48px; height: 52px; margin-top: 4px; padding: 0 0 4px; border: 0; cursor: pointer; display: flex; align-items: center; justify-content: center;
  background: url("../img/fiche/tuile_pleine.webp") center / 100% 100% no-repeat; transition: filter .15s, transform .05s; }
.hs-copy:hover { filter: brightness(1.06); }
.hs-copy:active { transform: translateY(1px); }
.hs-copy .hs-copy-ico { width: 24px; height: auto; }
.hs-shared { position: absolute; right: 0; bottom: 68px; z-index: 2; pointer-events: none; line-height: 0; }
.hs-shared .hs-copy-ico { width: 22px; height: auto; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .4)); }
/* Ligne « Bonus de panoplie n / 7 » entre deux filets */
.hs-set { display: flex; align-items: center; gap: 16px; margin: 10px 0 2px; }
.hs-set > i { flex: 1 1 0; height: 2px; background: #d9c497; border-radius: 1px; }
.hs-set > span { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-title), serif; font-size: 22px; line-height: 1.2; color: #3a2412; white-space: nowrap; }
.hs-set.on > span { color: #2f7a3b; }
/* Habiletés */
.hs-abs { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.hs-ab { display: flex; flex-direction: column; border-radius: 12px; background: rgba(214, 190, 140, .28); box-shadow: inset 0 0 0 1px rgba(90, 58, 27, .15); }
.hs-ab.sel { background: rgba(247, 220, 151, .65); box-shadow: inset 0 0 0 3px #e9b949; }
.hs-ab.locked { opacity: .78; }
.hs-ab .hq-ab { background: none; border: 0; color: #3a2412; }
.hs-ab .hq-ab-name { color: #3a2412; }
.hs-ab .hq-ab-name small { color: #8a5a10; }
.hs-ab .hq-ab .muted { color: #7a5a38; }
.hs-ab-act { display: flex; justify-content: flex-end; align-items: center; padding: 0 12px 10px; margin-top: auto; min-height: 32px; }
.hs-ab-sel, .hs-ab-lock { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-title), serif; font-size: 17px; color: #2f7a3b; }
.hs-ab-lock { color: #7a5a38; font-size: 16px; }
.hs-ab-sel img, .hs-ab-lock img { height: 18px; width: auto; }
.dp.hs .muted.hint { color: #7a5a38; text-align: center; margin: 10px 0 0; }
/* Pied : bande jaune, pouvoirs séparés par un filet, boutons pilules (img/fiche/bouton_jaune.webp) */
.hs-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 14px; padding: 10px 18px; border-radius: 14px; background: #f7dc97; }
.hs-pow { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.hs-pow > img { height: 30px; width: auto; flex: none; }
.hs-pow small { font-family: var(--font-title), serif; font-size: 20px; line-height: 1; color: #3a2412; }
.hs-pow b { display: inline-flex; align-items: center; gap: 8px; margin-left: 4px; font-family: var(--font-title), serif; font-weight: 400; font-size: 30px; line-height: 1; color: #ffd34a; -webkit-text-stroke: 5px #6b2a0a; paint-order: stroke fill; font-variant-numeric: tabular-nums; }
.hs-pow b img { height: 40px; width: auto; }
.hs-sep { flex: none; width: 2px; height: 42px; background: rgba(110, 72, 30, .28); border-radius: 1px; }
.hs-btns { margin-left: auto; display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.dp.hs .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; line-height: 1.1; }
.dp.hs .hs-btns .btn { min-height: 44px; padding: 4px 20px 7px; font-family: var(--font-title), serif; font-size: 18px; color: #3a2412; text-shadow: none; }
.dp.hs .hs-btns .btn:not(.danger)::before { border-width: 15px 16px 16px; border-image: url("../img/fiche/bouton_jaune.webp") 30 32 32 32 fill / 15px 16px 16px stretch; }
.dp.hs .hs-btns .btn.danger { color: #fff; }
.dp.hs .btn img.ui-ico, .dp.hs .btn img.shield-ico { height: 22px; width: auto; margin: 0; vertical-align: 0; flex: none; }
/* Portraits cliquables (Comptoir, onglet Héros, Arène) : ouvrent la fiche du héros */
button.avatar.hs-open { padding: 0; border: 0; background: none; font: inherit; color: inherit; }
.hs-open { cursor: pointer; border-radius: 10px; transition: filter .15s, transform .05s; }
.hs-open:hover { filter: brightness(1.12); }
.hs-open:active { transform: translateY(1px); }
.hs-open:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
@media (max-width: 900px) {
  .hs-head { flex-wrap: wrap; gap: 10px; }
  .hs-ban { flex: 1 1 0; min-height: 66px; }
  .hs-right { order: 3; flex-basis: 100%; }
  .hs-right .lvl-max .lm { font-size: 28px; }
  .hs-body { grid-template-columns: 120px minmax(0, 1fr); gap: 14px; }
  .hs-portrait img.av { width: 116px; height: 116px; }
  .hs-tab { font-size: 17px; }
  .hs-slots { gap: 8px; }
  .hs-pow b { font-size: 26px; }
}
@media (max-width: 640px) {
  .dp.hs { width: 100vw; max-height: 100dvh; border-width: 22px; }
  .hs-head { margin-top: -4px; }
  .hs-ban { gap: 10px; padding: 6px 12px 6px 8px; }
  .hs-lvl { width: 48px; height: 52px; }
  .hs-id b { font-size: 24px; }
  .hs-id small { font-size: 16px; }
  .hs-close { width: 40px; height: 40px; }
  .hs-body { grid-template-columns: minmax(0, 1fr); }
  .hs-portrait { display: none; }
  .hs-slots, .hs-slots.pets { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 8px; }
  .hs-tabs { gap: 3px; padding: 0; }
  .hs-tab { font-size: 15px; padding: 0 2px; white-space: normal; line-height: 1; }
  .hs-set > span { font-size: 18px; }
  .hs-set { gap: 10px; }
  .hs-foot { padding: 10px 12px; gap: 8px 10px; }
  .hs-sep { display: none; }
  .hs-pow { flex: 1 1 100%; justify-content: center; }
  .hs-pow small { font-size: 17px; }
  .hs-pow b { font-size: 24px; }
  .hs-pow b img { height: 32px; }
  .hs-btns { flex-basis: 100%; justify-content: center; margin-left: 0; }
  .hs-btns > .hs-layer { justify-content: center; }
  .hs-abs { grid-template-columns: minmax(0, 1fr); }
}
/* Fiche du héros : icônes de type des cases vides à l'échelle de la tuile (comme la maquette) */
.hs-tile .hcard-icons[data-n] { min-height: 0; gap: 2cqw 4cqw; }
.hs-tile .hcard-icons[data-n="1"] { grid-template-columns: 34cqw; }
.hs-tile .hcard-icons[data-n="1"] .htype { width: 34cqw; height: 34cqw; }
.hs-tile .hcard-icons[data-n="2"] { grid-template-columns: repeat(2, 28cqw); }
.hs-tile .hcard-icons[data-n="2"] .htype { width: 28cqw; height: 28cqw; }
.hs-tile .hcard-icons[data-n="3"], .hs-tile .hcard-icons[data-n="4"] { grid-template-columns: repeat(2, 22cqw); }
.hs-tile .hcard-icons[data-n="3"] .htype, .hs-tile .hcard-icons[data-n="4"] .htype { width: 22cqw; height: 22cqw; }
.hs-right .lvl-cap .lc-go { font-size: 24px; line-height: .8; margin-top: -2px; }
/* Onglet Héros : seule l'image des cases change (tuiles de la fiche du héros, img/fiche/tuile_vide|tuile_pleine.webp) ; taille, marges et disposition inchangées */
/* Même habillage pour la fenêtre « Équipement d'arène » de l'onglet Arène, modes quête et arène (voulu par l'utilisateur, 27/11/2026) */
.hrow .hr-eq .hcard, .hrow .hr-eq .hcard:active:not(:disabled), .ae-slots .hcard, .ae-slots .hcard:active:not(:disabled) { background-image: url("../img/fiche/tuile_vide.webp"); }
.hrow .hr-eq .hcard.full, .hrow .hr-eq .hcard.full:active:not(:disabled), .ae-slots .hcard.full, .ae-slots .hcard.full:active:not(:disabled) { background-image: url("../img/fiche/tuile_pleine.webp"); }
.hrow .hr-eq .hcard:not(.full) > .hcard-label, .ae-slots .hcard:not(.full) > .hcard-label { transform: translateY(-8cqw); }
.ae-slots .hcard:not(.full) > .hcard-label { font-size: 18cqw; } /* tuiles plus petites que l'onglet Héros : « Consommable » tient dans la tuile */ /* « Équiper » dans la face de la tuile, pas sur la bordure du bas */
/* Fenêtres de choix d'objet (quête et arène) : cadre de la fiche du héros (img/fiche/cadre.webp, assets de l'utilisateur) ; bordures de même largeur qu'avant (disposition inchangée) */
.dp.ep { border-image: none; background: #fdeecc; border-radius: 18px; } /* fond crème uni, sans contour ni filet sur les marges (voulu par l'utilisateur) */
/* Fenêtre de choix d'objet : ni portrait ni titre (voulu par l'utilisateur, 27/11/2026), bouton de fermeture dans le coin ; taille et grille : bloc « Choix d'objet » en fin de fichier */
.dp.ep .ep-close { position: absolute; top: 6px; right: 6px; z-index: 3; }
/* Fenêtre Progrès (descriptif d'un objet, renderProgModal) : mêmes assets que la fiche du héros (voulu par l'utilisateur, 27/11/2026) :
   cadre img/fiche/cadre.webp, bannière violette arrondie (niveau, nom), bouton rond « × », bande jaune des pastilles en pied */
.dp.pg.pg2 { padding: 0; border: 32px solid transparent; border-image: url("../img/fiche/cadre.webp") 64 fill / 32px stretch; }
.dp.pg2 .pg2-head { background: none; padding: 0; margin: 0 0 4px; border-radius: 0; gap: 16px; }
.pg2-ban { flex: 0 1 46%; min-width: 0; min-height: 74px; box-sizing: border-box; display: flex; align-items: center; gap: 16px; padding: 6px 18px 6px 10px; border-radius: 12px; background: #5a2a99; }
.pg2-ban .pg2-id { flex: 1 1 auto; }
.dp.pg2 .pg2-head .pg2-bar { margin-left: 0; }
.dp.pg2 .pg2-body { padding: 10px 0 0; }
.dp.pg2 .pg2-foot { border-top: 0; margin-top: 12px; padding: 10px 18px; border-radius: 14px; background: #f7dc97; }
.dp.pg2 .pg2-pill { background: rgba(255, 248, 230, .55); }
@media (max-width: 900px) { .dp.pg2 .pg2-head { background: none; } .pg2-ban { flex: 1 1 100%; } }
/* Chances de qualité : toutes les pastilles à la même hauteur (« Normal » n'a pas de ligne de bonus) */
.dp.pg .pg-odds { align-items: stretch; }
/* Fiche du héros et fenêtre Progrès : fond crème uni, JAMAIS de contour ni de trait sur les marges (règle de l'utilisateur, 27/11/2026) */
.dp.hs, .dp.pg.pg2 { border-image: none; background: #fdeecc; border-radius: 18px; }
/* Expéditions disponibles : même fond crème uni, cartes renvoyées à la ligne (plus de défilement horizontal),
   fenêtre jamais plus haute que l'écran (au-delà, elle défile verticalement) — voulu par l'utilisateur, 27/11/2026 */
.dp.xp { border-image: none; background: #fdeecc; border-radius: 18px; max-height: calc(100dvh - 32px); }
.dp.xp .dp-row { flex-wrap: wrap; justify-content: center; overflow: visible; row-gap: 78px; cursor: default; }
/* Marges réduites à une fine bordure de 12 px entre le fond et le contenu (voulu par l'utilisateur) ; 66 px au-dessus des cartes pour l'image qui déborde */
.dp.xp { border-width: 0; padding: 12px; width: fit-content; max-width: min(calc(100vw - 32px), 1700px); left: 0; right: 0; margin: 0 auto; transform: translateY(-50%); } /* largeur des cartes (centrée sans left: 50%, qui limiterait fit-content à la moitié de l'écran) */
.dp.xp .dp-title { margin: 0; }
.dp.xp .dp-row { padding: 66px 0 0; }
/* Fenêtre Progrès : sans le libellé « Chances de qualité : », enclumes un peu écartées du bas des cartes de palier (voulu par l'utilisateur) */
.dp.pg2 .pg-odds > span:first-child { display: none; }
.dp.pg2 .pg-at { margin-top: 10px; }
/* Cartes de palier toutes à la hauteur de la plus haute : les enclumes restent alignées (voulu par l'utilisateur) */
.dp.pg2 .pg-row { align-items: stretch; }
.dp.pg2 .pg-card { flex: 1 0 auto; }
.pg-lbl small .pg-q { font-style: normal; font-size: 15px; margin: 0 2px; color: var(--q); -webkit-text-stroke: 3px #3a2412; paint-order: stroke fill; }
/* Fenêtre Progrès : pastilles du pied alignées sur les chances de qualité (de « Normal » à « Mythique ») : même colonne que le corps, même largeur (--pg-w) */
.dp.pg2 .pg2-foot { display: grid; grid-template-columns: 210px minmax(0, 1fr); column-gap: 16px; padding: 10px 0; }
.pg2-pills { grid-column: 2; width: min(100%, var(--pg-w, 100%)); margin: 0 auto; display: flex; gap: 8px; }
.pg2-pills .pg2-pill { flex: 1 1 0; min-width: 0; padding: 6px 8px; }
/* Cases de qualité cliquables (28/11/2026) : la sélection se voit sans changer la taille de la case */
.dp.pg .pg-odds button.odd { margin: 0; font-family: inherit; color: inherit; cursor: pointer; transition: filter .15s; }
.dp.pg .pg-odds button.odd:hover { filter: brightness(1.25); }
.dp.pg .pg-odds button.odd[aria-pressed="true"] { background: color-mix(in srgb, var(--q) 30%, #2b1e13); border-color: var(--q); box-shadow: 0 0 0 3px var(--q), 0 3px 8px rgba(58, 36, 18, .5); }
.dp.pg .pg-odds button.odd:focus-visible { outline: 2px solid #3a2412; outline-offset: 5px; }
@media (max-width: 900px) { .dp.pg2 .pg2-foot { grid-template-columns: minmax(0, 1fr); } .pg2-pills { grid-column: 1; } }
/* Raid de ville */
/* Fenêtre (maquette validée : docs/maquette_raid_fenetre.html) : même présentation que la fiche du héros, fond crème sans contour.
   Le <dialog> est transparent ; toute l'apparence est portée par .dp.hs.rw. */
#raid-dialog { width: min(96vw, 1180px); max-width: 96vw; max-height: 94dvh; padding: 0; border: 0; background: none; color: inherit; overflow: visible; }
#raid-dialog::backdrop { background: rgba(0, 0, 0, .7); }
.dp.hs.rw { position: static; transform: none; width: 100%; max-height: 94dvh; }
.rw .hs-ban { background: #1f4a7a; flex-basis: 42%; }
.rw .hs-ban > img { width: 62px; height: 62px; object-fit: contain; flex: none; }
.rw .hs-right { gap: 12px; justify-content: flex-end; min-height: 46px; }
.rw .hs-right > img { width: 34px; height: 34px; object-fit: contain; flex: none; }
.rw .hs-right .pg2-bar { max-width: 360px; min-width: 200px; }
.rw-chip { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; box-sizing: border-box; padding: 4px 16px; border-radius: 999px;
  background: #f7dc97; font: 18px/1.1 var(--font-title), serif; color: #3a2412; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rw .rw-chip img { width: 26px; height: 26px; object-fit: contain; }
.rw .hs-body { grid-template-columns: 270px minmax(0, 1fr); align-items: stretch; }
.rw-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.rw-land { position: relative; flex: 1; min-height: 150px; border-radius: 14px; overflow: hidden; }
.rw .rw-land > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 54% center; }
.rw-land b { position: absolute; inset: auto 0 0; padding: 28px 8px 8px; text-align: center; font: 400 21px/1.15 var(--font-title), serif; color: #fff; background: linear-gradient(transparent, rgba(30, 18, 8, .85)); }
.rw-bonus { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 14px; background: #f7dc97; text-align: center; }
.rw-bonus > b { font: 400 19px/1.1 var(--font-title), serif; }
.rw-heroes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.rw-heroes span { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; font: 15px/1.1 var(--font-title), serif; color: #5a3a1b; }
.rw .rw-heroes img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 12px; }
/* Thème Essaim mortel (RAID_THEMES.essaim) : rose sur fond de clairière, portraits habituels des héros (fond transparent) */
.rw-essaim .rw-land { background: radial-gradient(circle at 50% 38%, #8fe0c4 0%, #3fb59c 42%, #1c6f6c 78%, #123f4a 100%); }
.rw.rw-essaim .rw-land > img { inset: 6% 8% auto; width: 84%; height: 68%; object-fit: contain; object-position: center; }
.rw-land b small { display: block; margin-top: 4px; font: 15px/1.2 var(--font-text); }
.rw.rw-essaim .rw-heroes img { object-fit: contain; background: #fbeec6; }
/* Décor de Noël de la fenêtre du raid (.rw-noel, isNoelDecor) : bandeau rouge, houx, étoiles, neige sur l'illustration */
.rw.rw-noel .hs-ban { position: relative; background: radial-gradient(circle at 30% 0, rgba(255, 255, 255, .18), transparent 60%), linear-gradient(#c8272f, #8e1219); overflow: visible; }
.rw-holly { position: absolute; width: 34px; height: auto; pointer-events: none; z-index: 2; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .35)); }
.rw-holly.l { left: -16px; top: -16px; transform: rotate(-22deg); }
.rw-holly.r { right: -8px; bottom: -12px; transform: scaleX(-1) rotate(160deg); }
.rw-star { position: absolute; width: 16px; height: 16px; pointer-events: none; animation: nlTwinkle 2.6s ease-in-out infinite; }
.rw-star.s1 { right: 18%; top: 8px; } .rw-star.s2 { right: 9%; bottom: 10px; width: 12px; height: 12px; animation-delay: -1.3s; }
.rw.rw-noel .rw-bonus { position: relative; background: linear-gradient(#fff8ea, #f7dc97 38%); box-shadow: inset 0 3px 0 #fff; }
.rw-holly.b { left: -6px; top: -10px; width: 30px; transform: rotate(-20deg); }
/* Fond de la fiche bleu, blanc et neige pendant Noël (demande de l'utilisateur, 04/12/2026) : remplace le cadre crème, sans contour */
.dp.hs.rw.rw-noel { border-image: none; border-radius: 28px; background:
    radial-gradient(ellipse 60% 9% at 18% 100%, #fff 65%, transparent 67%),
    radial-gradient(ellipse 55% 8% at 78% 101%, #fff 65%, transparent 67%),
    radial-gradient(circle, rgba(255, 255, 255, .95) 1.6px, transparent 2.2px) 0 0 / 34px 34px,
    radial-gradient(circle, rgba(255, 255, 255, .7) 1.1px, transparent 1.6px) 17px 11px / 23px 23px,
    linear-gradient(170deg, #f3f9ff 0%, #d4e8fb 45%, #a9cdef 100%) border-box; }
.rw.rw-noel .rw-card, .rw.rw-noel .rw-row { background: rgba(255, 255, 255, .62); }
.rw.rw-noel .rw-row.head { background: #f3f8fc; } /* opaque : la liste défile dessous */
.rw.rw-noel .rw-two .next { background: rgba(255, 248, 225, .85); }
.rw.rw-noel .hs-foot, .rw.rw-noel .rw-chip { background: rgba(255, 255, 255, .8); }
/* Thème sombre des fenêtres (html.dark-win) : la fiche de Noël garde son fond clair, donc la palette claire du jeu (textes foncés).
   Signalé par l'utilisateur le 04/12/2026 : textes crème illisibles sur le fond enneigé. Les onglets restent sombres, texte clair. */
html.dark-win .dp.hs.rw.rw-noel { --dw-bg: #fdeecc; --dw-band: #f7dc97; --dw-card: rgba(214, 190, 140, .28); --dw-card-2: rgba(214, 190, 140, .14);
  --dw-sel: rgba(247, 220, 151, .65); --dw-ink: #3a2412; --dw-ink-2: #5a3a1b; --dw-ink-3: #7a5a38; --dw-accent: #8a5a10; --dw-ok: #2f7a3b; --dw-ko: #a82a1c;
  --dw-line: #cdb383; color: #3a2412; color-scheme: light; }
html.dark-win .rw.rw-noel .pg2-pill, html.dark-win .rw.rw-noel .rw-state { background: rgba(255, 255, 255, .75); color: #5a3a1b; }
html.dark-win .rw.rw-noel .rw-state.ok { background: rgba(120, 190, 90, .25); }
html.dark-win .rw.rw-noel .hs-tab { color: #e2cfae; }
html.dark-win .rw.rw-noel .hs-tab.on { color: #f1e6d4; }
.rw-snow { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.rw .rw-snow img { position: absolute; top: -20px; height: auto; opacity: .95; filter: drop-shadow(0 0 2px rgba(20, 60, 80, .7)); animation: rwSnow linear infinite; }
@keyframes rwSnow { from { transform: translate(0, 0) rotate(0); } 50% { transform: translate(10px, 130px) rotate(180deg); } to { transform: translate(-6px, 280px) rotate(360deg); } }
.rw-land b { z-index: 2; }
@media (prefers-reduced-motion: reduce) { .rw-star { animation: none; } .rw-snow { display: none; } }
.rw .hs-tab { display: flex; align-items: center; justify-content: center; }
.rw-sum { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 12px 0 0; }
.rw-sum .pg2-pill { min-width: 0; min-height: 44px; box-sizing: border-box; font-size: 19px; text-align: center; }
.rw-sum .pg2-pill:only-child { grid-column: 1 / -1; }
/* Onglet Récompenses : « Tout récupérer », palier à prendre en surbrillance, paliers pris atténués (04/12/2026) */
.rw-sum:has(.rw-all) { grid-template-columns: repeat(2, minmax(0, 1fr)) auto; }
.rw-sum .rw-all { min-height: 44px; padding: 0 16px; white-space: nowrap; font-size: 17px; }
.rw .rw-row.ready { background: rgba(255, 205, 100, .5); box-shadow: inset 0 0 0 2px #d99a2b; }
.rw .rw-row.next { box-shadow: inset 0 0 0 2px rgba(150, 110, 50, .45); }
.rw .rw-row.got { opacity: .7; }
/* Hauteur unique pour les 3 onglets : la fenêtre ne change jamais de taille */
.rw-pane { height: clamp(240px, calc(94dvh - 440px), 330px); margin-top: 10px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #c9a45e transparent; }
.rw-card { flex: none; border-radius: 12px; background: rgba(214, 190, 140, .28); padding: 12px 16px; }
.rw-card h4 { margin: 0 0 6px; font: 400 20px/1.15 var(--font-title), serif; color: #3a2412; }
.rw-card p { margin: 0; font-size: 16px; line-height: 1.45; }
.rw-story { display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: center; gap: 14px; }
.rw .rw-story > img { width: 72px; height: 72px; object-fit: contain; }
.rw-two { flex: 1 0 auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.rw-two .rw-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-width: 0; text-align: center; }
.rw-two .rw-card h4 { margin: 0; }
/* Icône à gauche du texte (demande de l'utilisateur, 04/12/2026) : l'Aperçu tient sans ascenseur */
.rw-two .rw-card { display: grid; grid-template-columns: 64px minmax(0, 1fr); column-gap: 14px; row-gap: 2px; padding-block: 10px; align-content: center; justify-items: start; text-align: left; }
.rw-two .rw-card > * { grid-column: 2; }
.rw .rw-two .rw-card > img { grid-column: 1; grid-row: 1 / span 3; align-self: center; justify-self: center; }
.rw .rw-two .rw-top > img { grid-row: 1 / span 4; }
.rw .rw-two .rw-card > img { width: 64px; height: 64px; object-fit: contain; }
.rw .rw-two .rw-top > img { width: 48px; height: 48px; }
.rw-two .next { background: rgba(247, 220, 151, .65); box-shadow: inset 0 0 0 3px #e9b949; }
.rw-two strong { max-width: 100%; font: 400 22px/1.2 var(--font-title), serif; }
.rw-two strong.who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rw-two small { color: #7a5a38; font-size: 15px; }
.rw-inline { display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.rw .rw-inline img { width: 24px; height: 24px; object-fit: contain; }
/* Listes à colonnes fixes (Récompenses puis Participants) */
.rw-row { flex: none; display: grid; grid-template-columns: 48px minmax(0, 1fr) 124px 76px 150px; align-items: center; column-gap: 8px; min-height: 58px; box-sizing: border-box; padding: 4px 10px;
  border-radius: 12px; background: rgba(214, 190, 140, .28); font-size: 16px; font-variant-numeric: tabular-nums; }
.rw-row > * { min-width: 0; }
.rw .rw-row > img { width: 48px; height: 48px; object-fit: contain; justify-self: center; }
.rw-row > .n { text-align: right; }
.rw-row > :last-child { justify-self: center; }
.rw-row.head { position: sticky; top: 0; z-index: 2; min-height: 34px; background: #f7dc97; font: 17px/1.1 var(--font-title), serif; }
.rw-row.head > :first-child { text-align: center; }
.rw-row .name { display: flex; align-items: center; gap: 8px; }
.rw .rw-row .name img { width: 36px; height: 36px; margin: 0; flex: none; object-fit: contain; }
.rw-state { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 30px; padding: 0 12px; border-radius: 999px; background: rgba(110, 92, 58, .2); font: 15px/1.1 var(--font-title), serif; color: #5a3a1b; text-align: center; }
.rw .rw-state img { width: 18px; height: 18px; object-fit: contain; }
.rw-state.ok { background: rgba(120, 170, 80, .3); color: #2f6a32; }
.rw-row.rw-person { grid-template-columns: 48px minmax(0, 1fr) 124px 220px; min-height: 48px; }
.rw-row.rw-person > :last-child { justify-self: stretch; }
.rw-row.rw-person > .g { text-align: center; }
.rw-person > b { text-align: center; font: 400 22px var(--font-title), serif; }
.rw-person .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rw-person.me { background: rgba(247, 220, 151, .65); box-shadow: inset 0 0 0 3px #e9b949; }
.rw-none { text-align: center; color: #7a5a38; }
/* Gains du classement : un type de coffre (nombre, coffre, clé) par colonne fixe, 2 au plus (fenêtre et panneau de l'Échoppe) */
.rw-gains { display: grid; grid-template-columns: repeat(2, 104px); justify-content: center; gap: 8px; }
.rw-gains > span { display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; font: 17px/1 var(--font-title), serif; white-space: nowrap; }
.rw-gains > span:only-child { grid-column: 2; }
.rw-gains img.ii { width: 32px; height: 32px; margin: 0; object-fit: contain; }
.rw .hs-foot { justify-content: space-between; }
.rw-need { display: inline-flex; align-items: center; gap: 10px; font: 22px/1.15 var(--font-title), serif; }
.rw .rw-need img { width: 44px; height: 44px; object-fit: contain; }
.rw-send { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; min-height: 44px; margin-left: auto; }
.rw-send > span:not(.rw-gains) { font: 18px var(--font-title), serif; margin-right: 4px; }
.dp.hs.rw .rw-send .btn { min-width: 56px; min-height: 44px; font: 18px var(--font-title), serif; }
.dp.hs.rw .rw-send .btn.primary { padding-inline: 26px; margin-left: 12px; }
@media (max-width: 1000px) { .rw .hs-body { grid-template-columns: 200px minmax(0, 1fr); }
  .rw .hs-head { flex-wrap: wrap; } .rw .hs-ban { flex: 1 1 0; } .rw .hs-right { order: 3; flex-basis: 100%; justify-content: center; } }
/* Fenêtre étroite : l'illustration passe au-dessus pour laisser toute la largeur aux listes */
@media (max-width: 900px) { .rw .hs-body { grid-template-columns: minmax(0, 1fr); }
  .rw-side { flex-direction: row; } .rw-bonus { flex: 0 0 280px; } }
@media (max-width: 640px) { .dp.hs.rw { width: 100%; }
  .rw-side { display: none; } .rw-sum, .rw-two { grid-template-columns: minmax(0, 1fr); } .rw-sum:has(.rw-all) { grid-template-columns: minmax(0, 1fr); }
  .rw-row { grid-template-columns: 36px minmax(0, 1fr) 92px; row-gap: 4px; } .rw-row > :nth-child(4) { grid-column: 2; text-align: left; } .rw-row > :nth-child(5) { grid-column: 3; }
  .rw-row.head:not(.rw-person) { display: none; }
  .rw-row.rw-person { grid-template-columns: 36px minmax(0, 1fr) 100px; } .rw-row.rw-person > :nth-child(4) { grid-column: 2 / -1; }
  .rw-row.head.rw-person > .g { display: none; } }

/* Appel du raid dans l'Échoppe : mêmes barre (.pg2-bar) et bouton (.btn.primary) que le reste du jeu */
.raid-panel #raid-alert { display: flex; flex-direction: column; gap: 10px; }
.raid-panel .raid-call { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; }
.raid-panel .raid-call > img { width: 56px; height: 56px; object-fit: contain; }
.raid-panel .raid-call b { display: block; font: 17px/1.25 var(--font-title), serif; }
.raid-panel .raid-call small { display: block; margin-top: 4px; color: var(--muted); font-size: 14px; }
.raid-panel .raid-time { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 16px; font-variant-numeric: tabular-nums; }
.raid-panel .raid-time img { width: 22px; height: 22px; object-fit: contain; }
.raid-panel .raid-goal { display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: center; gap: 8px; }
.raid-panel .raid-goal > img { width: 32px; height: 32px; object-fit: contain; }
.raid-panel .raid-goal .pg2-bar { margin: 0; }
.raid-panel .raid-next { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: 16px; }
.raid-panel .raid-next > span:last-child { display: inline-flex; align-items: center; gap: 8px; text-align: right; }
.raid-panel .raid-next img { width: 32px; height: 32px; object-fit: contain; }
.raid-panel .raid-go { width: 100%; min-height: 44px; font: 18px var(--font-title), serif; }

/* Recettes : bouton « masquer les recettes maîtrisées » (bord droit du titre) ; Options : liste et case numérique */
.cat-title .mastered-toggle { margin-right: 8px; flex: none; width: 36px; height: 36px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; opacity: .6; }
.cat-title .mastered-toggle img { width: 100%; height: 100%; object-fit: contain; display: block; }
.cat-title .mastered-toggle:hover, .cat-title .mastered-toggle.on { opacity: 1; }
.cat-title .mastered-toggle.on img { filter: drop-shadow(0 0 4px #f4c542); }
.cat-title .mastered-toggle.na, .cat-title .mastered-toggle.na:hover { opacity: .3; cursor: help; filter: grayscale(1); } /* filtres inactifs dans Comptoir / Quêtes / Commandes */
/* Humeur : petite jauge entre le nom et le menu ⋯ */
.cust-top { align-items: center; }
.cust-top .cust-pat { flex: 1 1 0; max-width: 84px; min-width: 44px; margin-left: auto; grid-template-columns: 16px 1fr; gap: 4px; } /* la jauge prend la place laissée par le nom */
.cust-top .cust-name { flex: 0 1 auto; }
.cust-top .cust-pat img.v-mood { width: 16px; height: 16px; }
.cust-top .cust-pat .pat-bar { height: 6px; }
.customer .wish { flex-wrap: nowrap; }
.customer .wish .w-item { flex: 1 1 auto; white-space: nowrap; } /* police ajustée par fitCustomers() */
.customer .wish .w-item.two-lines { white-space: normal; }
/* Stock : pastille au coin de l'icône de l'objet demandé ; elle s'élargit vers la gauche, jamais sur le nom (d'où l'écart de 14 px) */
.customer .wish { column-gap: 14px; }
.wish .w-ico { position: relative; flex: none; display: flex; }
.wish .w-ico img { width: 36px; height: 36px; object-fit: contain; }
.wish .w-stock { position: absolute; right: -6px; bottom: -2px; display: flex; align-items: center; justify-content: center; box-sizing: border-box;
  min-width: 18px; height: 18px; padding: 0 4px 1px; border-radius: 9px; background: #1d130d; color: #f6e8c8; font-size: 12px; font-weight: 700; line-height: 1; white-space: nowrap; }
.wish .w-stock.zero { background: #b3313f; color: #fff; }
/* Cartes compactes (ordinateur, 01/12/2026, demande de l'utilisateur) : portrait 52 + statuts 20 = nom 28 + 4 + objet 40 (2 lignes) ; carte de 178 px au lieu de 208.
   « Proposer » prend 30 % de la ligne, ou juste sa largeur quand la carte est étroite : le reste va à « Surcharge » / « Refuser l'offre ». */
html:not(.tel) .customers { gap: 10px; }
html:not(.tel) .customer { grid-template-columns: 60px minmax(0, 1fr); column-gap: 8px; padding: 8px 10px; }
html:not(.tel) .cust-side { gap: 0; }
html:not(.tel) .cust-side img.av { width: 52px; height: 52px; }
html:not(.tel) .cust-badges { min-height: 20px; height: 20px; }
html:not(.tel) .cust-badge.loyal img.ui-ico { height: 16px; }
html:not(.tel) .cust-badge.spec img.ui-ico { height: 18px; }
html:not(.tel) .cust-top { height: 28px; }
html:not(.tel) .cust-more { width: 40px; }
html:not(.tel) .customer .wish { height: 40px; min-height: 40px; }
html:not(.tel) .customer .wish .w-item { line-height: 1.25; }
html:not(.tel) .cust-actions { grid-template-columns: minmax(0, 1fr) minmax(max-content, 30%); }
html:not(.tel) .cust-actions .ca-mod:not(.ca-sur, .two-lines) { flex-wrap: nowrap; white-space: nowrap; } /* police ajustée par fitCustomers() */
.opt-select, .opt-input { font: inherit; font-size: 16px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel-2); color: var(--text); }
.opt-select { min-width: 140px; }
.opt-input { width: 72px; text-align: right; }
.opt-choice.opt-num { display: flex; align-items: center; gap: 6px; }

/* ----- Chaudron : bâtiments de fusion (Alambic, Table des arcanes) sous les emplacements, 28/11/2026 : voir .mst-groups (panneau « Bâtiments de maîtrise ») ----- */

/* ===== Chronique de la veille (#recap-dialog, renderRecap) : parchemin à deux rouleaux, maquette validée par l'utilisateur le 28/11/2026 =====
   Feuille crème sans contour (grain SVG + ombres internes), ruban img/ui/ruban.png teinté rouge, étincelles img/ui/scintille.png */
dialog#recap-dialog { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 24px 56px; box-sizing: border-box;
  border: 0; background: none; color: #3a2412; overflow-x: hidden; overflow-y: auto; }
dialog#recap-dialog[open] { display: flex; }
dialog#recap-dialog::backdrop { background: radial-gradient(ellipse at 50% 45%, rgba(40, 24, 8, .45), rgba(8, 5, 2, .82) 70%); backdrop-filter: blur(3px); }
#recap-dialog .rj { position: relative; width: min(100%, 720px); margin: auto; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .7)); }
#recap-dialog .rj::before { content: ""; position: absolute; inset: -60px -90px; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse at 50% 50%, rgba(255, 196, 90, .30), rgba(255, 150, 40, .10) 45%, transparent 70%); animation: rjHalo 4s ease-in-out infinite alternate; }
@keyframes rjHalo { from { opacity: .65; transform: scale(.98); } to { opacity: 1; transform: scale(1.03); } }
#recap-dialog .rj-body { animation: rjOpen .8s cubic-bezier(.2, .9, .3, 1.12) both; }
@keyframes rjOpen { from { clip-path: inset(47% -60px 47% -60px); } to { clip-path: inset(-60px -60px -60px -60px); } }
/* Rouleaux */
#recap-dialog .rj-rod { position: relative; z-index: 3; height: 34px; margin: 0 -30px; border-radius: 17px;
  background: repeating-linear-gradient(178.6deg, transparent 0 5px, rgba(70, 35, 10, .16) 5px 6px, transparent 6px 11px, rgba(255, 225, 180, .10) 11px 12px),
    linear-gradient(#5a3416 0%, #d79a5a 18%, #f0c08a 26%, #a86a34 48%, #6b3e18 72%, #3a1f0a 100%);
  box-shadow: 0 6px 8px rgba(40, 20, 5, .55), inset 0 -2px 3px rgba(0, 0, 0, .35); }
#recap-dialog .rj-rod.top { box-shadow: 0 10px 12px -4px rgba(60, 30, 5, .55), inset 0 -2px 3px rgba(0, 0, 0, .35); }
#recap-dialog .rj-rod::before, #recap-dialog .rj-rod::after { content: ""; position: absolute; top: -8px; width: 40px; height: 50px; border-radius: 14px / 18px;
  background: radial-gradient(ellipse at 50% 50%, transparent 52%, rgba(90, 55, 5, .55) 56%, transparent 62%),
    radial-gradient(circle at 38% 28%, #fffbe0 0 7%, #ffd877 16%, #e2a63a 42%, #a8701a 70%, #5f3c08 100%);
  box-shadow: 0 4px 6px rgba(0, 0, 0, .5), inset 0 -3px 4px rgba(80, 45, 0, .55), inset 0 2px 2px rgba(255, 245, 200, .6); }
#recap-dialog .rj-rod::before { left: -18px; } #recap-dialog .rj-rod::after { right: -18px; }
/* Feuille */
#recap-dialog .rj-sheet { position: relative; z-index: 1; margin: -8px 0; padding: 30px 40px 32px; overflow: hidden;
  background: linear-gradient(rgba(120, 70, 20, .30), transparent 7%, transparent 93%, rgba(120, 70, 20, .30)),
    linear-gradient(90deg, rgba(150, 95, 35, .16), transparent 6%, transparent 94%, rgba(150, 95, 35, .16)),
    radial-gradient(ellipse at 30% 25%, rgba(255, 252, 235, .75), transparent 45%),
    radial-gradient(ellipse at 75% 80%, rgba(225, 180, 110, .28), transparent 50%),
    radial-gradient(ellipse at 50% 50%, #fdeecc 55%, #f3d7a2 100%); }
#recap-dialog .rj-sheet::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .32; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .55  0 0 0 0 .38  0 0 0 0 .18  0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
#recap-dialog .rj-sheet::after { content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: multiply;
  background: radial-gradient(circle at 8% 62%, rgba(170, 110, 40, .14), transparent 9%), radial-gradient(circle at 93% 22%, rgba(170, 110, 40, .12), transparent 8%),
    radial-gradient(circle at 64% 96%, rgba(170, 110, 40, .12), transparent 10%); }
#recap-dialog .rj-sheet > * { position: relative; z-index: 1; }
/* Ruban-titre */
#recap-dialog .rj-banner { position: relative; width: min(100%, 540px); aspect-ratio: 512 / 94; margin: -10px auto 4px;
  display: flex; align-items: center; justify-content: center; filter: drop-shadow(0 6px 4px rgba(70, 20, 5, .45)); }
#recap-dialog .rj-rays { position: absolute; left: 50%; top: 42%; width: 420px; height: 420px; margin: -210px 0 0 -210px; z-index: -1; pointer-events: none; opacity: .5;
  background: repeating-conic-gradient(from 0deg, rgba(255, 210, 120, .55) 0deg 6deg, transparent 6deg 18deg);
  -webkit-mask: radial-gradient(circle, #000 10%, transparent 62%); mask: radial-gradient(circle, #000 10%, transparent 62%); animation: rjSpin 40s linear infinite; }
@keyframes rjSpin { to { transform: rotate(360deg); } }
#recap-dialog .rj-banner::before, #recap-dialog .rj-banner::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  -webkit-mask: url("../img/ui/ruban.png") center / 100% 100% no-repeat; mask: url("../img/ui/ruban.png") center / 100% 100% no-repeat; }
#recap-dialog .rj-banner::before { background: url("../img/ui/ruban.png") center / 100% 100% no-repeat; background-color: #e0342a; background-blend-mode: multiply; }
#recap-dialog .rj-banner::after { background: linear-gradient(105deg, transparent 40%, rgba(255, 235, 200, .45) 50%, transparent 60%) -200% 0 / 200% 100% no-repeat;
  animation: rjShine 5s ease-in-out 1.2s infinite; }
@keyframes rjShine { 0% { background-position: -200% 0; } 35%, 100% { background-position: 200% 0; } }
#recap-dialog .rj-banner h2 { position: relative; z-index: 1; margin: -12px 0 0; font-family: var(--font-title); font-weight: normal; font-size: 31px; line-height: 1.1; color: #fff6dc; text-align: center;
  -webkit-text-stroke: 5px #4a0c0a; paint-order: stroke fill; letter-spacing: .5px; text-shadow: 0 3px 0 #4a0c0a; }
#recap-dialog .rj-date { text-align: center; font-size: 17px; color: #7a5a38; margin: 0 0 18px; font-style: italic; text-shadow: 0 1px 0 rgba(255, 255, 255, .6); }
#recap-dialog .rj-spark { position: absolute; width: 22px; height: 22px; pointer-events: none; z-index: 2; background: url("../img/ui/scintille.png") center / contain no-repeat;
  filter: drop-shadow(0 0 4px rgba(255, 200, 80, .95)) sepia(.4) saturate(3); animation: rjTwinkle 2.4s ease-in-out infinite; }
@keyframes rjTwinkle { 0%, 100% { opacity: 0; transform: scale(.3) rotate(0); } 50% { opacity: 1; transform: scale(1) rotate(45deg); } }
/* Cartouches en relief */
#recap-dialog .rj-card { position: relative; border-radius: 18px; background: linear-gradient(180deg, rgba(255, 250, 235, .55), rgba(225, 195, 140, .35));
  box-shadow: 0 1px 0 rgba(255, 255, 255, .85), 0 4px 8px rgba(110, 70, 25, .22), inset 0 -3px 0 rgba(150, 105, 50, .25), inset 0 2px 0 rgba(255, 255, 255, .7);
  animation: rjPop .5s cubic-bezier(.2, .9, .3, 1.35) both; animation-delay: calc(.55s + var(--i, 0) * .09s); transition: transform .15s, box-shadow .15s; }
#recap-dialog .rj-card:hover { transform: translateY(-3px); box-shadow: 0 1px 0 rgba(255, 255, 255, .85), 0 9px 14px rgba(110, 70, 25, .28), inset 0 -3px 0 rgba(150, 105, 50, .25), inset 0 2px 0 rgba(255, 255, 255, .7); }
@keyframes rjPop { from { opacity: 0; transform: translateY(14px) scale(.92); } to { opacity: 1; transform: none; } }
#recap-dialog .rj-ico { position: relative; display: grid; place-items: center; width: 70px; height: 70px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 50% 40%, rgba(255, 250, 230, .9), rgba(220, 180, 115, .55) 70%); box-shadow: inset 0 3px 6px rgba(110, 70, 25, .35), 0 1px 0 rgba(255, 255, 255, .9); }
#recap-dialog .rj-ico img { max-width: 54px; max-height: 54px; filter: drop-shadow(0 4px 3px rgba(58, 36, 18, .45)); }
#recap-dialog .rj-ico .rj-emoji { font-size: 44px; line-height: 1; }
#recap-dialog .rj-card:hover .rj-ico img { animation: rjBob .6s ease-in-out; }
@keyframes rjBob { 50% { transform: translateY(-4px) rotate(-6deg); } }
/* Or gagné et valeur nette */
#recap-dialog .rj-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
#recap-dialog .rj-big { display: flex; align-items: center; gap: 14px; padding: 12px 18px; min-width: 0; }
#recap-dialog .rj-big .rj-ico { width: 76px; height: 76px; }
#recap-dialog .rj-big .rj-ico img { max-width: 60px; max-height: 60px; }
#recap-dialog .rj-big > div:last-child { display: flex; flex-direction: column; min-width: 0; }
#recap-dialog .rj-big small { font-size: 16px; color: #7a5a38; }
#recap-dialog .rj-big b { font-family: var(--font-title); font-weight: normal; font-size: 36px; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
#recap-dialog .rj-big.gold b { color: transparent; background: linear-gradient(180deg, #ffe28a 0%, #f0b52d 45%, #b9770e 55%, #e7a52a 100%); -webkit-background-clip: text; background-clip: text;
  filter: drop-shadow(0 2px 0 #6b4207) drop-shadow(0 0 1px #6b4207); }
#recap-dialog .rj-big.gold .rj-ico { background: radial-gradient(circle at 50% 40%, #fff6cf, #f3c96a 55%, rgba(210, 150, 50, .6) 75%); }
#recap-dialog .rj-big.gold .rj-ico img { animation: rjCoin 3s ease-in-out 1.3s infinite; }
@keyframes rjCoin { 0%, 70%, 100% { transform: rotateY(0); } 85% { transform: rotateY(180deg); } }
#recap-dialog .rj-big.up b { color: #2f8a3a; text-shadow: 0 2px 0 rgba(20, 70, 25, .3), 0 1px 0 #fff; }
#recap-dialog .rj-big.down b { color: #b3261e; text-shadow: 0 2px 0 rgba(90, 20, 15, .25), 0 1px 0 #fff; }
#recap-dialog .rj-big .delta { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; margin-top: 2px; padding: 2px 10px 3px; border-radius: 999px;
  background: linear-gradient(#5fcf6c, #2f9a3e); color: #fff; font-family: var(--font-title); font-size: 14px; box-shadow: 0 2px 0 #1f6a2a; white-space: nowrap; }
#recap-dialog .rj-big .delta::before { content: "▲"; font-size: 11px; }
#recap-dialog .rj-big.down .delta { background: linear-gradient(#e2675b, #b3261e); box-shadow: 0 2px 0 #7a1712; }
#recap-dialog .rj-big.down .delta::before { content: "▼"; }
/* Filet « Hauts faits » */
#recap-dialog .rj-sep { display: flex; align-items: center; gap: 12px; margin: 8px 0 12px; color: #8a6238; font-family: var(--font-title); font-size: 21px; text-shadow: 0 1px 0 #fff; }
#recap-dialog .rj-sep::before, #recap-dialog .rj-sep::after { content: ""; flex: 1; height: 10px;
  background: radial-gradient(circle, #c99a52 0 3px, transparent 3.5px) center / 10px 10px no-repeat, linear-gradient(90deg, transparent, rgba(122, 90, 56, .55), transparent) center / 100% 2px no-repeat; }
/* Tuiles */
#recap-dialog .rj-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
#recap-dialog .rj-tile { display: grid; grid-template-rows: 72px auto auto; justify-items: center; align-items: center; gap: 4px; padding: 12px 8px 14px; text-align: center; min-width: 0; }
#recap-dialog .rj-tile b { font-family: var(--font-title); font-weight: normal; font-size: 30px; line-height: 1.1; font-variant-numeric: tabular-nums; color: #3a2412; text-shadow: 0 2px 0 rgba(255, 255, 255, .8); white-space: nowrap; }
#recap-dialog .rj-tile span { font-size: 16px; color: #7a5a38; line-height: 1.2; }
#recap-dialog .rj-tile img.rj-res { width: 64px; height: 64px; max-width: none; max-height: none; object-fit: cover; object-position: 50% 45%; }
#recap-dialog .rj-tile.wide { grid-column: span 2; grid-template-rows: none; grid-template-columns: 96px minmax(0, 1fr) auto; column-gap: 14px; justify-items: start; text-align: left; padding: 12px 24px 12px 14px; }
#recap-dialog .rj-tile.wide .rj-ico { width: 92px; height: 92px; background: radial-gradient(circle, rgba(255, 214, 120, .7), rgba(255, 200, 90, .2) 55%, rgba(220, 180, 115, .4) 72%); }
#recap-dialog .rj-tile.wide .rj-ico img { max-width: 84px; max-height: 84px; animation: rjFloat 3s ease-in-out infinite; }
@keyframes rjFloat { 50% { transform: translateY(-5px) rotate(-4deg); } }
#recap-dialog .rj-tile.wide div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
#recap-dialog .rj-tile .rj-iname { font-size: 21px; font-weight: 700; color: #7d1214; text-shadow: 0 1px 0 #fff; overflow-wrap: break-word; }
#recap-dialog .rj-tile .rj-iname.none { color: #8a6a48; font-weight: normal; font-style: italic; }
#recap-dialog .rj-tile.wide b.rj-x { font-size: 44px; justify-self: end; color: #5a3a1b; }
#recap-dialog .rj-tile.wide b.rj-x span { font: inherit; color: inherit; }
/* Objet le plus vendu et donjon le plus parcouru (29/11/2026) : une carte pleine largeur par ligne sous la grille */
#recap-dialog .rj-tops { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 12px; }
#recap-dialog .rj-top { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto; align-items: center; column-gap: 14px; padding: 8px 24px 8px 14px; min-width: 0; }
#recap-dialog .rj-top div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
#recap-dialog .rj-top span { font-size: 16px; color: #7a5a38; line-height: 1.2; }
#recap-dialog .rj-top .rj-iname { font-size: 18px; font-weight: 700; color: #7d1214; text-shadow: 0 1px 0 #fff; overflow-wrap: break-word; }
#recap-dialog .rj-top img.rj-zone { width: 62px; height: 62px; max-width: none; max-height: none; object-fit: cover; border-radius: 50%; }
#recap-dialog .rj-top b.rj-x { font-family: var(--font-title); font-weight: normal; font-size: 30px; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; color: #5a3a1b; text-shadow: 0 2px 0 rgba(255, 255, 255, .8); }
#recap-dialog .rj-top b.rj-x span { font: inherit; color: inherit; }
html.dark-win #recap-dialog .rj-top div span { color: var(--dw-ink-3); text-shadow: none; }
html.dark-win #recap-dialog .rj-top .rj-iname { color: #ff9b8a; text-shadow: none; }
html.dark-win #recap-dialog .rj-top b.rj-x { color: var(--dw-ink-2); text-shadow: none; }
/* Pied */
#recap-dialog .rj-arena { display: flex; align-items: center; gap: 10px; margin: 14px 0 0; padding: 8px 12px; border-radius: 10px; background: rgba(120, 70, 20, .1); color: #4a2f14; font-size: 15px; }
#recap-dialog .rj-arena img { width: 32px; height: 32px; object-fit: contain; flex: none; }
html.dark-win #recap-dialog .rj-arena { color: var(--dw-ink-2); background: rgba(255, 255, 255, .06); }
#recap-dialog .rj-quote { margin: 18px 0 14px; text-align: center; font-style: italic; font-size: 17px; color: #5a3a1b; text-shadow: 0 1px 0 rgba(255, 255, 255, .6); }
#recap-dialog .rj-foot { display: flex; justify-content: center; }
#recap-dialog .rj-foot .btn { min-width: 240px; min-height: 56px; font-family: var(--font-title); font-size: 24px; animation: rjPulse 2.2s ease-in-out 1.8s infinite; }
@keyframes rjPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
#recap-dialog .rj-seal { position: absolute; z-index: 3; right: 18px; bottom: 12px; width: 82px; height: 82px; display: grid; place-items: center;
  border-radius: 48% 52% 46% 54% / 53% 47% 55% 45%; background: radial-gradient(circle at 36% 30%, #ff7a6a, #c42a20 40%, #8a1510 75%, #5e0b08);
  box-shadow: 0 5px 8px rgba(0, 0, 0, .45), inset 0 -4px 6px rgba(60, 0, 0, .5), inset 0 3px 4px rgba(255, 170, 150, .5); animation: rjStamp .45s cubic-bezier(.3, 1.6, .5, 1) 1.5s both; }
#recap-dialog .rj-seal::before { content: ""; position: absolute; inset: 12px; border-radius: 50%; box-shadow: inset 0 3px 4px rgba(60, 0, 0, .55), 0 1px 0 rgba(255, 160, 140, .45); }
#recap-dialog .rj-seal span { font-family: var(--font-title); font-size: 21px; color: #7a120d; text-shadow: 0 1px 0 rgba(255, 170, 150, .6), 0 -1px 0 rgba(0, 0, 0, .4); transform: rotate(-12deg); }
@keyframes rjStamp { from { opacity: 0; transform: scale(2.2) rotate(-30deg); } to { opacity: 1; transform: scale(1) rotate(0); } }
@media (max-width: 820px) { #recap-dialog .rj-sheet { padding: 26px 24px 28px; } #recap-dialog .rj-seal { right: 8px; bottom: 6px; width: 66px; height: 66px; } }
@media (prefers-reduced-motion: reduce) { #recap-dialog .rj *, #recap-dialog .rj *::before, #recap-dialog .rj *::after, #recap-dialog .rj::before { animation: none !important; } }

/* ===== Thomas présente la chronique de la veille (js/thomas.js, #recap-dialog.tb) ===== */
dialog#recap-dialog.tb { padding-left: var(--tb-pad, 56px); }
#recap-dialog.tb-load .rj { visibility: hidden; }
#recap-dialog.tb .rj-body { animation: none; position: relative; z-index: 3; transform-origin: 50% 50%; }
#recap-dialog.tb-wait .rj-card, #recap-dialog.tb-wait .rj-seal { animation-play-state: paused; }
#recap-dialog.tb-wait .rj::before, #recap-dialog.tb-wait .rj-sheet > * { visibility: hidden; }
#recap-dialog.tb-skipped .rj-card, #recap-dialog.tb-skipped .rj-seal { animation: none; }
/* .rj porte un filtre (donc son propre plan) : c'est lui qu'on passe devant ou derrière Thomas */
#recap-dialog.tb .rj { z-index: 3; }
#recap-dialog.tb-front .rj { z-index: 1; }
#recap-dialog .tb-canvas { position: fixed; left: 0; top: 0; z-index: 2; pointer-events: none; transform: translate(-200vw, 0); will-change: transform;
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .65)); }
/* Bulle */
#recap-dialog .tb-bubble { position: fixed; z-index: 4; left: -999px; top: 0; max-width: 260px; box-sizing: border-box; padding: 12px 18px; border-radius: 18px; background: #fdeecc; color: #3a2412;
  font-family: var(--font-title); font-size: 19px; line-height: 1.25; text-align: center; pointer-events: none; box-shadow: 0 8px 18px rgba(0, 0, 0, .5), inset 0 -3px 0 rgba(150, 105, 50, .3);
  opacity: 0; transform: scale(.4); transform-origin: var(--tail, 50%) 100%; }
#recap-dialog .tb-bubble::after { content: ""; position: absolute; left: var(--tail, 50%); bottom: -11px; margin-left: -11px; border: 11px solid transparent; border-bottom: 0; border-top: 12px solid #e8d0a0; }
#recap-dialog.tb-done .tb-bubble { opacity: 1; transform: none; transition: opacity .2s, transform .35s cubic-bezier(.2, .9, .3, 1.5); }
#recap-dialog .tb-skip { position: fixed; z-index: 5; right: 24px; top: 20px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
#recap-dialog .tb-skip[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { #recap-dialog .tb-bubble { transition: none !important; } }

/* ===== Stock : objets cassés et suppression (bouton corbeille, mode « Supprimer », confirmation) ===== */
#stock-del[hidden], #stock-broken[hidden], #stock-del-bar[hidden] { display: none; }
.btn.sdel-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 46px; padding-left: 12px; padding-right: 12px; }
.ico-trash { height: 18px; width: auto; filter: brightness(0) invert(1) drop-shadow(1px 0 0 #5a0f0f) drop-shadow(-1px 0 0 #5a0f0f) drop-shadow(0 1px 0 #5a0f0f) drop-shadow(0 -1px 0 #5a0f0f); }
.btn:disabled .ico-trash { opacity: .6; }
.sbk-title { margin: 12px 0 10px; color: #e89a8f; }
.item.is-broken { background: #3a201c; }
.item.is-broken .item-icon { filter: grayscale(.85) brightness(.75); }
.item-crack { position: absolute; top: -4px; left: -4px; width: 22px; height: 22px; object-fit: contain; pointer-events: none; }
.inventory .item.sdel-open { box-shadow: 0 0 0 3px var(--gold); }
.inventory .item.sdel-on { box-shadow: 0 0 0 3px var(--bad); }
.inventory .item.sdel-off, .inventory .item.sdel-off:hover { opacity: .35; cursor: not-allowed; transform: none; filter: none; }
.sdel-n { position: absolute; top: -8px; right: -6px; min-width: 22px; height: 22px; padding: 0 4px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border-radius: 11px; background: #cd3434; color: #fff; font-size: 13px; pointer-events: none; }
.sbk-pop { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(24, 16, 10, .94); border: 1px solid var(--gold); }
.sbk-txt { flex: 1 1 180px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sbk-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; justify-content: flex-end; }
.sbk-pop .btn, .sdel-go { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
/* La barre reste en bas de l'écran quand le stock est long */
#stock-del-bar { position: sticky; bottom: 8px; z-index: 8; margin-top: 12px; }
.sdel-bar { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 12px; background: rgba(24, 16, 10, .96); border: 1px solid var(--bad); }
.sdel-hint { margin: 0; font-size: 16px; color: var(--muted); }
.sdel-rows { display: flex; flex-direction: column; gap: 8px; max-height: min(220px, 30vh); overflow: auto; }
.sdel-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.sdel-name { flex: 1 1 140px; min-width: 0; }
.sdel-step { display: grid; grid-template-columns: 40px 120px 40px 56px; align-items: center; gap: 8px; margin-left: auto; text-align: center; }
.sdel-step .btn { padding-left: 4px; padding-right: 4px; }
.sdel-step b { font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Confirmation : fond crème uni arrondi, sans contour */
#stock-dialog { width: min(440px, calc(100vw - 32px)); max-height: calc(100vh - 32px); box-sizing: border-box; padding: 20px; border: 0; border-radius: 18px; background: #f4e7c8; color: #3a2410; text-align: center; }
#stock-dialog::backdrop { background: rgba(0, 0, 0, .6); }
#stock-dialog h2 { margin: 0; font-size: 20px; }
#stock-dialog ul { list-style: none; margin: 14px 0; padding: 10px 12px; max-height: 40vh; overflow: auto; display: flex; flex-direction: column; gap: 8px; text-align: left; border-radius: 12px; background: #3a2a1c; color: #f1e6d4; }
#stock-dialog li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; }
#stock-dialog li b { text-align: right; font-variant-numeric: tabular-nums; }
.sdel-btns { display: flex; justify-content: center; gap: 12px; }
.sdel-btns .btn { min-width: 130px; }
/* Suppression groupée des objets cassés : taille identique case cochée ou non */
.sbk-title { flex-wrap: wrap; justify-content: space-between; }
.sbk-title::before, .sbk-title::after { display: none; }
.sbk-title .btn { margin-left: auto; }
.sbk-undo { margin: 0 0 12px; }
.sbk-title > *, .sbk-title .btn { white-space: nowrap; }
.sdel-bulk li, .sdel-sum { grid-template-columns: minmax(0, 1fr) minmax(84px, auto) !important; }
#stock-dialog.sdel-bulk { max-height: calc(100dvh - 16px) !important; }
#stock-dialog.sdel-bulk ul { max-height: max(92px, min(40vh, 100dvh - 450px)); }
.sdel-bulk li.kept .sdel-name { opacity: .55; }
.sdel-sum { display: grid; gap: 8px 12px; padding: 10px 12px; border-radius: 12px; background: #3a2a1c; color: #f1e6d4; font-size: 16px; text-align: left; }
.sdel-sum b { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
#stock-dialog .sdel-rare { display: flex; align-items: center; justify-content: center; box-sizing: border-box; min-height: 60px; margin: 10px 0 0; padding: 8px 12px; border-radius: 12px; background: #a52222; color: #fff; font-size: 16px; }
#stock-dialog .sdel-rare.ok { background: #2f5c32; }
.sdel-keep { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; margin-top: 10px; font-size: 16px; cursor: pointer; }
.sdel-keep input { width: 22px; height: 22px; flex: none; margin: 0; }

/* ---------- En-tête du panneau Ressources : titre et bouton Masquer ; dessous, Salle des trésors et Roulette ----------
   Plans et Packs sont passés à droite de la recherche des recettes (#rec-acts, 06/12/2026). Panneau étroit : le libellé du repli laisse la place à l'icône. */
.racks .panel-head { flex-wrap: wrap; gap: 8px; container: rkh / inline-size; }
.rk-acts { display: flex; flex: 0 0 auto; align-items: stretch; gap: 8px; min-width: 0; margin-left: auto; }
.rk-acts .btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding-left: 10px; padding-right: 10px; line-height: 1.15; white-space: nowrap; }
.rk-lv { display: inline-block; white-space: nowrap; } /* niveau requis : passe entier à la ligne */
.rk-acts > #racks-toggle { flex: none; min-width: 44px; }
.rk-extra { display: flex; flex: 1 1 100%; flex-wrap: wrap; gap: 8px; }
.rk-extra > span { display: contents; }
.rk-extra .btn { flex: 1 1 auto; }
.rk-extra:not(:has(.btn)) { display: none; }
@container rkh (max-width: 439px) {
  #racks-toggle .rk-lbl { display: none; }
}
.ech-col[data-col="1"] .racks .panel-head > h2 { flex: none; }
.ech-col[data-col="1"] #racks-toggle .rk-lbl { display: none; }
/* ancien index.html en cache : Plans et Packs encore dans l'en-tête Ressources */
.rk-acts > #shop-actions { display: contents; }
.rk-acts > #shop-actions > .btn { flex: 1 0 auto; min-width: 44px; }

/* Panneaux pas encore débloqués (syncUnlocks) */
.panel.quests-panel[hidden], .panel.cauldron[hidden], .panel.raid-panel[hidden], .panel.mastery[hidden], #city-raid[hidden] { display: none !important; }

/* Fenêtre de déblocage : puces alignées à gauche */
.gd-modal .gd-pts { text-align: left; }

/* ===== Tchat (js/tchat.js, maquette docs/maquette_tchat.html) : bouton d'en-tête et fenêtre flottante à taille fixe ===== */
.tc-btn { position: relative; }
.tc-new { width: 14px; height: 14px; margin-right: 5px; border-radius: 50%; background: #e2463a; box-shadow: 0 0 0 2px #fdeecc; animation: clPulse 1.6s ease-in-out infinite; }
.tc-btn.on::before { filter: brightness(1.15); }
.tc { position: fixed; top: 70px; right: 16px; z-index: 50; width: min(860px, calc(100vw - 32px)); height: min(620px, calc(100vh - 100px)); min-height: min(460px, calc(100vh - 100px));
  display: flex; flex-direction: column; gap: 10px; padding: 16px; box-sizing: border-box;
  background: #fdeecc; border-radius: 18px; color: #3a2412; box-shadow: 0 10px 40px rgba(0,0,0,.6); font-size: 16px; }
.tc[hidden] { display: none; }
.tc button, .tc input { font-family: var(--font-text); }
.tc-head { flex: none; display: flex; align-items: center; gap: 12px; }
.tc-ban { flex: 1 1 auto; min-width: 0; height: 58px; box-sizing: border-box; display: flex; align-items: center; gap: 12px; padding: 4px 16px 4px 10px; border-radius: 12px; background: #1f5440; color: #fff; }
.tc-ban > img { height: 44px; width: 46px; object-fit: contain; }
.tc-ban div { min-width: 0; display: flex; flex-direction: column; }
.tc-ban b { font: 400 24px/1.1 var(--font-title); text-shadow: 0 2px 0 rgba(0,0,0,.35); }
.tc-ban small { font: 15px/1.2 var(--font-title); color: #cdead9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-ban small i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 50%; background: #6fdc8c; box-shadow: 0 0 0 2px #1f5440, 0 0 6px #6fdc8c; }
.tc-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 12px; }
.tc-side { min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.tc-add { flex: none; display: flex; gap: 8px; }
.tc-add[hidden] { display: none; }
.tc-add input, .tc-input input { min-width: 0; height: 38px; padding: 0 12px; box-sizing: border-box; border: 2px solid #cdb383; border-radius: 9px; background: #fff8e6; color: #3a2412; font-size: 16px; }
.tc-add input { flex: 1; }
.tc-add .btn { flex: none; width: 46px; padding: 0 0 2px; font: 22px/1 var(--font-title); }
.tc-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding-right: 2px; }
.tc-sec { display: flex; align-items: center; gap: 8px; margin: 8px 4px 2px; font: 15px/1 var(--font-title); color: #7a5a38; letter-spacing: .04em; text-transform: uppercase; }
.tc-sec::after { content: ""; flex: 1; height: 2px; background: #e3cc9c; }
.tc-sec label { order: 2; display: inline-flex; align-items: center; gap: 6px; font: 13px var(--font-text); text-transform: none; letter-spacing: 0; cursor: pointer; white-space: nowrap; }
.tc-row { flex: none; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 56px; padding: 6px 10px 6px 6px; box-sizing: border-box;
  border: 0; border-radius: 12px; background: rgba(214,190,140,.26); color: inherit; text-align: left; cursor: pointer; }
.tc-row:hover { filter: brightness(1.04); }
.tc-row.on { background: #f7dc97; box-shadow: inset 0 0 0 3px #e9b949; }
.tc-av { position: relative; flex: none; width: 44px; height: 44px; border-radius: 50%; background: #e8d3a4; display: flex; align-items: center; justify-content: center; }
.tc-av img { width: 44px; height: 44px; object-fit: contain; border-radius: 50%; }
.tc-av.room img { width: 34px; height: 34px; border-radius: 0; }
.tc-av .st { position: absolute; right: -1px; bottom: -1px; width: 13px; height: 13px; border-radius: 50%; background: #a99a82; box-shadow: 0 0 0 2px #fdeecc; }
.tc-av .st.on { background: #34b05a; }
.tc-row.off .tc-av img { filter: grayscale(.7) opacity(.75); }
.tc-txt { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tc-txt b { font: 400 18px/1.15 var(--font-title); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-txt small { font-size: 14px; color: #7a5a38; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-txt small.on { color: #2f7a3b; }
.tc-badge { min-width: 24px; height: 24px; padding: 1px 6px 0; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border-radius: 12px; background: #e2463a; color: #fff; font: 14px/1 var(--font-title); }
.tc-req { grid-template-columns: 44px minmax(0, 1fr); cursor: default; background: rgba(233,185,73,.22); }
.tc-req .tc-act { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; }
.tc-ign { grid-template-columns: minmax(0, 1fr) auto; min-height: 46px; padding-left: 12px; cursor: default; }
.tc-empty { padding: 10px 8px; font-size: 14px; color: #7a5a38; text-align: center; }
.tc-conv { min-height: 0; display: flex; flex-direction: column; border-radius: 12px; background: rgba(214,190,140,.2); }
.tc-ch { flex: none; height: 52px; box-sizing: border-box; display: flex; align-items: center; gap: 10px; padding: 0 10px 0 14px; border-bottom: 2px solid #e3cc9c; }
.tc-ch b { flex: 1; min-width: 0; font: 400 20px/1 var(--font-title); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-ch small { font-size: 14px; color: #7a5a38; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-ch .tc-av, .tc-ch .tc-av img { width: 36px; height: 36px; }
.tc-msgs { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; }
.tc-day { align-self: center; padding: 2px 12px; border-radius: 10px; background: rgba(214,190,140,.45); font-size: 13px; color: #6b4a22; }
.tc-m { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; align-items: start; max-width: 88%; }
.tc-m .tc-av, .tc-m .tc-av img { width: 36px; height: 36px; }
.tc-bub { min-width: 0; padding: 6px 12px 8px; border-radius: 4px 12px 12px 12px; background: #fff8e6; box-shadow: 0 1px 0 rgba(140,100,50,.25); }
.tc-meta { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.tc-who { min-width: 0; padding: 0; border: 0; background: none; color: #1f5440; font: 400 16px/1.3 var(--font-title); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
button.tc-who { cursor: pointer; }
button.tc-who:hover { text-decoration: underline; }
.tc-meta .lv { flex: none; font-size: 13px; color: #8a6a40; }
.tc-meta time { flex: none; margin-left: auto; font-size: 13px; color: #9a7f5a; font-variant-numeric: tabular-nums; }
.tc-bub p { margin: 2px 0 0; line-height: 1.35; overflow-wrap: anywhere; }
.tc-m.me { align-self: flex-end; grid-template-columns: minmax(0, 1fr); }
.tc-m.me .tc-av { display: none; }
.tc-m.me .tc-bub { border-radius: 12px 4px 12px 12px; background: #f7dc97; }
.tc-m.me .tc-who { color: #6b4a22; }
.tc-hid { font-style: italic; color: #9a7f5a; }
.tc-tr { display: block; margin-top: 2px; padding: 0; border: 0; background: none; color: #1f5440; font: 13px/1.4 var(--font-text); cursor: pointer; text-align: left; }
.tc-tr:hover:not(:disabled) { text-decoration: underline; }
.tc-tr:disabled { color: #9a7f5a; cursor: default; }
.tc-sys { align-self: center; max-width: 90%; font-size: 14px; color: #7a5a38; text-align: center; font-style: italic; }
.tc-notice { flex: none; padding: 6px 14px; font-size: 14px; color: #6b4a22; background: rgba(233,185,73,.25); }
.tc-notice[hidden] { display: none; }
.tc-input { flex: none; height: 64px; box-sizing: border-box; display: flex; align-items: center; gap: 8px; padding: 0 10px; border-top: 2px solid #e3cc9c; }
.tc-input input { flex: 1; }
.tc-input .cnt { flex: none; width: 60px; text-align: right; font-size: 13px; color: #9a7f5a; font-variant-numeric: tabular-nums; }
.tc-input .btn { flex: none; min-width: 112px; }
.tc-note { flex: 1; font-size: 15px; color: #7a5a38; line-height: 1.25; }
.tc-note.ko { color: #a82a1c; }
.tc-menu { position: absolute; z-index: 2; min-width: 220px; display: flex; flex-direction: column; padding: 6px; border-radius: 12px; background: #fff8e6; box-shadow: 0 6px 20px rgba(0,0,0,.35); }
.tc-menu[hidden] { display: none; }
.tc-menu b { padding: 6px 10px 8px; margin-bottom: 4px; border-bottom: 2px solid #e3cc9c; font: 400 18px/1 var(--font-title); }
.tc-menu button { padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: #3a2412; text-align: left; font-size: 16px; cursor: pointer; }
.tc-menu button:hover:not(:disabled) { background: rgba(214,190,140,.35); }
.tc-menu button:disabled { opacity: .5; cursor: default; }
.tc-menu button.ko { color: #a82a1c; }
/* Fenêtre étroite : une colonne, la liste ou la conversation */
.tc.narrow { left: 8px; right: 8px; width: auto; padding: 12px; }
.tc.narrow .tc-body { grid-template-columns: minmax(0, 1fr); }
.tc.narrow.in-conv .tc-side, .tc.narrow:not(.in-conv) .tc-conv { display: none; }
.tc-back { display: none; flex: none; }
.tc.narrow .tc-back { display: inline-flex; }
.tc.narrow .tc-ch small { display: none; }
/* Administration > Tchat : messages signalés */
.adm-chat { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 10px; background: rgba(214,190,140,.22); }
.adm-chat.off p { opacity: .6; text-decoration: line-through; }
.adm-chat p { margin: 0; overflow-wrap: anywhere; }
.adm-chat-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.adm-chat-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.adm-bot { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: rgba(214,190,140,.22); }
.adm-bot-head { display: grid; grid-template-columns: minmax(0, 1fr) 84px 92px 72px; gap: 8px; align-items: center; }
.adm-bot-head > b { overflow-wrap: anywhere; }
.adm-bot-head > :not(:first-child) { text-align: right; white-space: nowrap; }
.adm-bot-head > .adm-bot-lv { padding: 2px 8px; border-radius: 999px; font-weight: 700; font-size: 14px; text-align: center; background: rgba(128,128,128,.25); }
.adm-bot.lv2 .adm-bot-lv { background: #d9942b; color: #2a1800; }
.adm-bot.lv3 .adm-bot-lv { background: #b3362b; color: #fff; }
.adm-bot ul { list-style: none; margin: 6px 0 4px; padding: 0; }
.adm-bot li { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 8px; padding: 2px 0; }
@media (max-width: 560px) { .adm-bot-head { grid-template-columns: minmax(0, 1fr) 92px 72px; } .adm-bot-head > .muted { display: none; } .adm-bot li { grid-template-columns: 104px minmax(0, 1fr); } .adm-tabs > .hs-tab { flex: 1 1 auto; padding-left: 6px; padding-right: 6px; } }

/* ===== Fenêtres sombres (option « Fenêtres sombres », S.opts.darkWin, classe html.dark-win posée par syncDarkWin dans game.js) =====
   Les fenêtres crème (Choisir les héros, fiche du héros, raid, fiche d'objet / Progrès, expéditions, choix d'objet, tchat, chronique)
   passent sur un fond brun sombre façon bois / parchemin sombre, accents or. Seules des couleurs changent : tailles, marges et images
   (boutons, tuiles, bannières, cartes d'expédition) restent celles du mode clair. Toujours fond uni arrondi, jamais de contour sur les bords. */
html.dark-win {
  --dw-bg: #2e2219;          /* fond de la fenêtre (à la place du crème #fdeecc) */
  --dw-band: #4a3721;        /* bandes de pied et têtes de liste (à la place du jaune #f7dc97) */
  --dw-card: rgba(255, 226, 170, .08);   /* cartes internes (à la place de rgba(214, 190, 140, .28)) */
  --dw-card-2: rgba(255, 226, 170, .04); /* cartes vides */
  --dw-sel: rgba(233, 185, 73, .22);     /* carte choisie */
  --dw-ink: #f1e6d4;         /* texte principal (à la place de #3a2412) */
  --dw-ink-2: #e2cfae;       /* texte secondaire fort (#5a3a1b) */
  --dw-ink-3: #b9a283;       /* texte grisé (#7a5a38) */
  --dw-accent: #e9b949;      /* accents (#8a5a10) */
  --dw-ok: #7fd08a;          /* vert lisible sur fond sombre (#2f7a3b) */
  --dw-ko: #ff8a7a;          /* rouge lisible sur fond sombre (#a82a1c) */
  --dw-line: #5a4630;        /* séparateurs internes (#cdb383, #e3cc9c, #d9c497) */
  --dw-field: #1d1712;       /* champs de saisie (#fff8e6) */
  --dw-field-bd: #6b5236;
}
/* Fonds */
html.dark-win .party, html.dark-win .dp.hs, html.dark-win .dp.pg.pg2, html.dark-win .dp.xp, html.dark-win .dp.ep, html.dark-win .tc,
html.dark-win #recap-dialog .tb-bubble { background: var(--dw-bg); color: var(--dw-ink); color-scheme: dark; }
html.dark-win #recap-dialog .tb-bubble::after { border-top-color: var(--dw-bg); }
html.dark-win .pty-team.on, html.dark-win .pty-set.on, html.dark-win .pty-card.sel, html.dark-win .pty-foot, html.dark-win .hs-foot, html.dark-win .dp.pg2 .pg2-foot,
html.dark-win .rw-chip, html.dark-win .rw-bonus, html.dark-win .rw-row.head, html.dark-win .tc-row.on, html.dark-win .tc-m.me .tc-bub { background: var(--dw-band); }
html.dark-win .pty-team, html.dark-win .pty-set, html.dark-win .pty-card, html.dark-win .pty-bar, html.dark-win .pty-line, html.dark-win .pty-slots, html.dark-win .hs-ab, html.dark-win .rw-card, html.dark-win .rw-row,
html.dark-win .tc-row, html.dark-win .tc-conv, html.dark-win .dp.pg2 .pg-card { background: var(--dw-card); }
html.dark-win .pty-team.vide { background: var(--dw-card-2); color: var(--dw-ink-3); }
html.dark-win .hs-ab.sel, html.dark-win .rw-two .next, html.dark-win .rw-person.me { background: var(--dw-sel); }
html.dark-win .hs-ab { box-shadow: inset 0 0 0 1px rgba(255, 226, 170, .08); }
html.dark-win .hs-ab.sel { box-shadow: inset 0 0 0 3px #e9b949; }
html.dark-win .dp.pg2 .pg-card { box-shadow: inset 0 0 0 1px rgba(255, 226, 170, .08); }
html.dark-win .dp.pg2 .pg-card.done { background: rgba(120, 190, 90, .16); }
html.dark-win .dp.pg2 .pg-card.next { background: rgba(233, 185, 73, .16); box-shadow: inset 0 0 0 3px #e9b949; }
html.dark-win .dp.pg2 .pg-card.is-q { background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--q) 30%, transparent), var(--dw-card) 75%); box-shadow: inset 0 0 0 2px var(--q); }
html.dark-win .pg2-pill, html.dark-win .dp.pg2 .pg2-pill, html.dark-win .rw-state { background: rgba(0, 0, 0, .28); color: var(--dw-ink-2); }
html.dark-win .rw-state.ok { background: rgba(120, 190, 90, .22); color: var(--dw-ok); }
html.dark-win .hs-right .lvl-cap, html.dark-win .hs-state, html.dark-win .hs-hint { background: var(--dw-band); border-color: #8a6a3a; color: var(--dw-ink-2); }
html.dark-win .hs-right button.lvl-cap:hover, html.dark-win .hs-right button.lvl-cap:focus-visible { background: #5a4429; border-color: #c9a45e; }
html.dark-win .hs-right .lvl-cap .lc-go { color: var(--dw-accent); }
/* Textes */
html.dark-win .pty-title, html.dark-win .pty-set, html.dark-win .pty-slot.on, html.dark-win .hs-set > span, html.dark-win .hs-ab .hq-ab, html.dark-win .hs-ab .hq-ab-name, html.dark-win .hs-pow small,
html.dark-win .rw-chip, html.dark-win .rw-card h4, html.dark-win .dp.pg .dp-title, html.dark-win .dp.xp .dp-title, html.dark-win .dp.ep .dp-title,
html.dark-win .tc-menu button { color: var(--dw-ink); }
html.dark-win .pty-line p, html.dark-win .pty-slots p, html.dark-win .dp.pg2 .pg-lbl, html.dark-win .rw-heroes span, html.dark-win .dp.pg2 .pg-at, html.dark-win .dp.pg .pg-odds { color: var(--dw-ink-2); }
html.dark-win .pty-title small, html.dark-win .pty-gone, html.dark-win .pty-lead div > span, html.dark-win .pty-slot, html.dark-win .pty-line small, html.dark-win .pty-muted, html.dark-win .pty-why small,
html.dark-win .hs-ab .hq-ab .muted, html.dark-win .hs-ab-lock, html.dark-win .dp.hs .muted.hint, html.dark-win .rw-two small, html.dark-win .rw-none,
html.dark-win .dp.pg .dp-title small, html.dark-win .dp.xp .dp-title small, html.dark-win .dp.ep .dp-title small,
html.dark-win .tc-sec, html.dark-win .tc-txt small, html.dark-win .tc-empty, html.dark-win .tc-ch small, html.dark-win .tc-sys, html.dark-win .tc-note,
html.dark-win .tc-meta .lv, html.dark-win .tc-meta time, html.dark-win .tc-hid, html.dark-win .tc-input .cnt, html.dark-win .tc-tr:disabled { color: var(--dw-ink-3); }
html.dark-win .pty-meta .warn, html.dark-win .pty-msg em, html.dark-win .pty-skill, html.dark-win .hs-ab .hq-ab-name small { color: var(--dw-accent); }
html.dark-win .pty-meta .ko, html.dark-win .pty-why, html.dark-win .tc-note.ko, html.dark-win .tc-menu button.ko { color: var(--dw-ko); }
html.dark-win .pty-why.risk, html.dark-win .dgs-row.risk .dgs-val { color: #f0a54a; }
html.dark-win .pty-meta .ok, html.dark-win .pty-why.ok, html.dark-win .hs-set.on > span, html.dark-win .hs-ab-sel, html.dark-win .hs-bk, html.dark-win .tc-txt small.on, html.dark-win .pg-ok { color: var(--dw-ok); }
html.dark-win .tc-who, html.dark-win .tc-tr { color: #8fd6b0; }
html.dark-win .tc-m.me .tc-who { color: #f0c870; }
html.dark-win .tc-tr:disabled { color: var(--dw-ink-3); }
html.dark-win .tc-day { background: rgba(255, 226, 170, .1); color: var(--dw-ink-2); }
html.dark-win .tc-notice { background: rgba(233, 185, 73, .16); color: var(--dw-ink-2); }
html.dark-win .tc-req { background: rgba(233, 185, 73, .14); }
/* Séparateurs internes, focus */
html.dark-win .hs-tabs { border-bottom-color: var(--dw-line); }
html.dark-win .hs-set > i, html.dark-win .tc-sec::after { background: var(--dw-line); }
html.dark-win .hs-sep { background: rgba(255, 226, 170, .2); }
html.dark-win .pg2-foot { border-top-color: rgba(255, 226, 170, .12); }
html.dark-win .tc-ch, html.dark-win .tc-menu b { border-bottom-color: var(--dw-line); }
html.dark-win .tc-input { border-top-color: var(--dw-line); }
html.dark-win .pty-av.none { border-color: var(--dw-line); }
html.dark-win .pty-pips .took { border-color: var(--dw-ok); } /* pastille prise : vert sombre, cerclé de clair */
html.dark-win .pty-card:focus-visible, html.dark-win .pty-team:focus-visible, html.dark-win .pty-set:focus-visible, html.dark-win .dp.pg .pg-odds button.odd:focus-visible { outline-color: #e9b949; }
html.dark-win .tc-new, html.dark-win .tc-av .st { box-shadow: 0 0 0 2px var(--dw-bg); }
html.dark-win .tc-av { background: #4a3721; }
/* Onglets de la fiche du héros : mêmes dimensions, images crème remplacées par des onglets bois sombre (bords transparents, aucun contour) */
html.dark-win .hs-tab { border-image: none; border-color: transparent; border-radius: 12px 12px 0 0; background: #3d2e21; color: var(--dw-ink-3); }
html.dark-win .hs-tab.on { border-image: none; background: #5a4429; color: var(--dw-ink); box-shadow: inset 0 3px 0 #c9a45e; }
html.dark-win .hs-tab:hover { filter: brightness(1.15); }
/* Champs de saisie et menus */
html.dark-win .pty-bar input, html.dark-win .tc-add input, html.dark-win .tc-input input { background: var(--dw-field); border-color: var(--dw-field-bd); color: var(--dw-ink); }
html.dark-win .pty-bar input::placeholder, html.dark-win .tc-add input::placeholder, html.dark-win .tc-input input::placeholder { color: #8a7660; }
html.dark-win .tc-bub, html.dark-win .tc-menu { background: #3a2c20; }
html.dark-win .tc-m.me .tc-bub { background: var(--dw-band); }
html.dark-win .tc-bub { box-shadow: 0 1px 0 rgba(0, 0, 0, .35); }
html.dark-win .tc-menu button:hover:not(:disabled) { background: rgba(255, 226, 170, .1); }
/* Chronique de la veille : feuille de parchemin sombre ; rouleaux, ruban et sceau inchangés */
html.dark-win #recap-dialog .rj-sheet { background: linear-gradient(rgba(0, 0, 0, .35), transparent 7%, transparent 93%, rgba(0, 0, 0, .35)),
  linear-gradient(90deg, rgba(0, 0, 0, .25), transparent 6%, transparent 94%, rgba(0, 0, 0, .25)),
  radial-gradient(ellipse at 30% 25%, rgba(255, 220, 160, .08), transparent 45%), radial-gradient(ellipse at 50% 50%, #33261b 55%, #261b13 100%); }
html.dark-win #recap-dialog .rj-sheet::before, html.dark-win #recap-dialog .rj-sheet::after { mix-blend-mode: normal; opacity: .15; }
html.dark-win #recap-dialog .rj-card { background: linear-gradient(180deg, rgba(255, 226, 170, .1), rgba(255, 226, 170, .04));
  box-shadow: 0 4px 8px rgba(0, 0, 0, .35), inset 0 -3px 0 rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 226, 170, .12); }
html.dark-win #recap-dialog .rj-card:hover { box-shadow: 0 9px 14px rgba(0, 0, 0, .45), inset 0 -3px 0 rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 226, 170, .12); }
html.dark-win #recap-dialog .rj-ico { background: radial-gradient(circle at 50% 40%, rgba(255, 226, 170, .22), rgba(255, 226, 170, .05) 70%); box-shadow: inset 0 3px 6px rgba(0, 0, 0, .4); }
html.dark-win #recap-dialog .rj-big.gold .rj-ico { background: radial-gradient(circle at 50% 40%, #fff6cf, #f3c96a 55%, rgba(210, 150, 50, .6) 75%); }
html.dark-win #recap-dialog .rj-date, html.dark-win #recap-dialog .rj-big small, html.dark-win #recap-dialog .rj-tile span { color: var(--dw-ink-3); text-shadow: none; }
html.dark-win #recap-dialog .rj-sep { color: #d9b77a; text-shadow: none; }
html.dark-win #recap-dialog .rj-tile b { color: var(--dw-ink); text-shadow: 0 2px 0 rgba(0, 0, 0, .5); }
html.dark-win #recap-dialog .rj-tile.wide b.rj-x, html.dark-win #recap-dialog .rj-quote { color: var(--dw-ink-2); text-shadow: none; }
html.dark-win #recap-dialog .rj-tile .rj-iname { color: #ff9b8a; text-shadow: none; }
html.dark-win #recap-dialog .rj-tile .rj-iname.none { color: var(--dw-ink-3); }
html.dark-win #recap-dialog .rj-big.up b { color: var(--dw-ok); text-shadow: 0 2px 0 rgba(0, 0, 0, .5); }
html.dark-win #recap-dialog .rj-big.down b { color: var(--dw-ko); text-shadow: 0 2px 0 rgba(0, 0, 0, .5); }

/* ===== Fenêtre Options (renderOptionsDialog, game.js) : 4 onglets Sons / Mécaniques / Visuels / Profil, rubriques titrées, interrupteurs =====
   Fond crème uni arrondi (brun sombre avec « Fenêtres sombres »), jamais de contour sur les bords. Taille fixe quel que soit l'onglet :
   seul le corps (.op-body) défile. Couleurs dans les variables --op-* ci-dessous. */
.options-dialog {
  --op-bg: #fdeecc; --op-ink: #3a2412; --op-ink-2: #5a3a1b; --op-muted: #7a5a38; --op-accent: #8a5a10; --op-line: #e3cc9c;
  --op-card: rgba(214, 190, 140, .28); --op-sel: #f7dc97; --op-field: #fff8e6; --op-field-bd: #cdb383;
  --op-off: #c4ab80; --op-on: #2f9a5a; --op-knob: #fffaf0;
  width: min(600px, calc(100vw - 32px)); height: min(930px, calc(100dvh - 32px)); max-height: none; box-sizing: border-box;
  padding: 20px; overflow: hidden; border: 0; border-radius: 18px; background: var(--op-bg); color: var(--op-ink);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .6); font-size: 16px;
}
html.dark-win .options-dialog {
  --op-bg: var(--dw-bg); --op-ink: var(--dw-ink); --op-ink-2: var(--dw-ink-2); --op-muted: var(--dw-ink-3); --op-accent: var(--dw-accent); --op-line: var(--dw-line);
  --op-card: var(--dw-card); --op-sel: var(--dw-band); --op-field: var(--dw-field); --op-field-bd: var(--dw-field-bd);
  --op-off: #6b5236; --op-on: #3fae6a; --op-knob: #f1e6d4; color-scheme: dark;
}
.op-box { height: 100%; display: flex; flex-direction: column; gap: 12px; }
.op-head { flex: none; display: flex; align-items: center; gap: 12px; }
.op-head h2 { flex: 1; min-width: 0; height: 56px; box-sizing: border-box; margin: 0; display: flex; align-items: center; gap: 12px; padding: 4px 16px 4px 12px;
  border-radius: 12px; background: #1f5440; color: #fff; font: 400 24px/1.1 var(--font-title); text-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
.op-head h2 img.ui-ico { height: 36px; width: auto; margin: 0; }
.op-head .btn.close { flex: none; width: 36px; height: 36px; }
.op-tabs { flex: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.op-tabs:lang(ja) { grid-template-columns: repeat(4, auto); } /* japonais : « プロフィール » deux fois plus long que les autres onglets (tronqué sur téléphone) */
.op-tab { min-height: 42px; padding: 2px 8px 0; border: 0; border-radius: 10px; background: var(--op-card); color: var(--op-ink-2); cursor: pointer;
  font: 400 18px/1 var(--font-title); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.op-tab:hover { color: var(--op-ink); }
.op-tab.on { background: var(--op-sel); color: var(--op-ink); box-shadow: inset 0 -3px 0 #e9b949; }
.op-tab:focus-visible, .op-sw:focus-visible { outline: 2px solid var(--op-accent); outline-offset: 2px; }
.op-body { flex: 1; min-height: 0; overflow-y: auto; padding-right: 6px; scrollbar-gutter: stable; }
.op-sec + .op-sec { margin-top: 12px; }
.op-sec h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; padding-top: 2px; font: 400 15px/1.2 var(--font-title); letter-spacing: .06em; text-transform: uppercase; color: var(--op-accent); }
.op-sec h3::after { content: ""; flex: 1; height: 2px; border-radius: 1px; background: var(--op-line); }
.op-row { display: grid; grid-template-columns: 52px minmax(0, 1fr); align-items: center; gap: 12px; padding: 8px 0; }
.op-row.op-val { grid-template-columns: 52px minmax(0, 1fr) auto; }
/* Réglage atteint par un lien (goQuestOption) : halo doré qui s'efface */
.op-row.op-flash { animation: opFlash 2.4s ease-out; border-radius: 8px; }
@keyframes opFlash { 0%, 45% { background: rgba(233, 185, 73, .35); box-shadow: 0 0 0 4px rgba(233, 185, 73, .35); } 100% { background: transparent; box-shadow: 0 0 0 4px transparent; } }
.op-row.op-val .op-txt { grid-column: 2; }
.op-txt { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.op-txt b { font-size: 16px; color: var(--op-ink); }
.op-txt small { font-size: 14px; line-height: 1.35; color: var(--op-muted); }
.op-ctrl { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
/* Interrupteur : piste arrondie + pastille ; vert = activé */
.op-sw { position: relative; width: 52px; height: 30px; padding: 0; border: 0; border-radius: 15px; background: var(--op-off); cursor: pointer; transition: background .15s; }
.op-sw i { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--op-knob); box-shadow: 0 1px 3px rgba(0, 0, 0, .35); transition: transform .15s; }
.op-sw[aria-checked="true"] { background: var(--op-on); }
.op-sw[aria-checked="true"] i { transform: translateX(22px); }
@media (prefers-reduced-motion: reduce) { .op-sw, .op-sw i { transition: none; } }
.op-vol { display: inline-flex; align-items: center; gap: 8px; }
.op-vol input[type="range"] { width: 150px; accent-color: var(--op-on); cursor: pointer; }
.op-vol span { min-width: 48px; text-align: right; font-variant-numeric: tabular-nums; }
.op-num { display: inline-flex; align-items: center; gap: 6px; }
/* « Ne pas vendre au-dessus de la rareté » : boutons du filtre Qualité du chaudron (.fq-btn), sous le texte, 2 lignes */
.op-row.op-val .op-ctrl:has(.op-quals) { grid-column: 2 / -1; justify-content: stretch; }
.op-quals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); flex: 1; }
.op-quals .fq-btn { padding: 0 8px 2px; }
.op-quals .fq-btn.sel { padding: 0 7px 2px; }
.op-quals .fq-btn:first-child { grid-column: span 2; } /* « Aucune limite » : libellé long */
/* Japonais : « レジェンダリー », « パーフェクト »… plus larges que les cases de 4 colonnes → 3 colonnes (2 sur téléphone) */
html:lang(ja) .op-quals { grid-template-columns: repeat(3, minmax(0, 1fr)); }
html:lang(ja) .op-quals .fq-btn:first-child { grid-column: 1 / -1; }
@media (max-width: 560px) { html:lang(ja) .op-quals { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.options-dialog .opt-select, .options-dialog .opt-input { background: var(--op-field); color: var(--op-ink); border: 2px solid var(--op-field-bd); }
/* Onglet Profil : grille des portraits du tchat (tous les héros), le portrait affiché entouré d'or */
.op-note { margin: 4px 0 12px; font-size: 14px; line-height: 1.35; color: var(--op-muted); }
.op-avs { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.op-av { aspect-ratio: 1; padding: 4px; border: 0; border-radius: 12px; background: var(--op-card); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.op-av img { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
.op-av:hover { background: var(--op-sel); }
.op-av.on { background: var(--op-sel); box-shadow: inset 0 0 0 3px #e9b949; }
.op-av:focus-visible { outline: 2px solid var(--op-accent); outline-offset: 2px; }
.op-foot { flex: none; display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 2px solid var(--op-line); }
.op-foot-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.op-foot small { font-size: 13px; line-height: 1.35; color: var(--op-muted); }
@media (max-width: 520px) {
  .options-dialog { padding: 16px; }
  .op-row.op-val .op-ctrl { grid-column: 2 / -1; justify-content: flex-start; }
  .op-tab { font-size: 16px; }
  .op-avs { grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); }
}

/* Annonce du Guerrier : css/guerrier.css (refonte du 02/12/2026) */

/* ===== Célébration des fabrications rares (js/celebration.js, 29/11/2026) =====
   Mythique : <dialog> modal plein écran (voile, flash, ondes de choc, rayons, particules Canvas, tremblement) ; Légendaire : popover
   non bloquant (halo doré, pluie d'étincelles). Ruban img/ui/ruban.png teinté, étincelles img/ui/scintille.png, carte crème sans contour.
   État final = état de base des éléments : « Réduire les animations » (.cc-still) coupe simplement les animations. */
dialog#cc-dialog, #cc-pop { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: none; color: var(--text); font-family: var(--font-text); overflow: hidden; transition: opacity .35s ease; }
dialog#cc-dialog { cursor: pointer; }
dialog#cc-dialog::backdrop { background: none; }
#cc-pop { pointer-events: none; z-index: 2100; }
#cc-pop:not([popover]) { display: none; }
#cc-pop.cc-on { display: block; }
.cc.cc-out { opacity: 0; }
.cc { --cy: 42%; --item: 180px; }
.cc-stage { position: absolute; inset: 0; overflow: hidden; isolation: isolate; }
.cc-myth .cc-stage { animation: ccShake .65s .12s linear both; }
@keyframes ccShake { 0%, 100% { transform: none; } 10% { transform: translate(-12px, 7px) rotate(-.6deg); } 20% { transform: translate(11px, -9px) rotate(.5deg); } 30% { transform: translate(-9px, -6px); }
  40% { transform: translate(8px, 8px) rotate(-.3deg); } 55% { transform: translate(-5px, 3px); } 70% { transform: translate(4px, -3px); } 85% { transform: translate(-2px, 1px); } }
.cc-veil { position: absolute; inset: -40px; background: radial-gradient(circle at 50% var(--cy), rgba(90, 22, 8, .55), rgba(12, 5, 2, .9) 72%); animation: ccFade .35s ease-out both; }
@keyframes ccFade { from { opacity: 0; } }
.cc-flash { position: absolute; inset: 0; z-index: 4; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 50% var(--cy), #fff, rgba(255, 230, 190, .85) 25%, rgba(255, 120, 60, .3) 55%, transparent 80%); animation: ccFlash .8s ease-out both; }
@keyframes ccFlash { 0% { opacity: 1; } 100% { opacity: 0; } }
.cc-wave { position: absolute; left: 50%; top: var(--cy); width: 160px; height: 160px; margin: -80px 0 0 -80px; border-radius: 50%; z-index: 2; pointer-events: none; opacity: 0;
  border: 10px solid var(--q); box-shadow: 0 0 40px var(--q), inset 0 0 30px var(--q); animation: ccWave 1.1s cubic-bezier(.15, .7, .3, 1) .05s both; }
.cc-wave.w2 { border-color: #fff4dc; box-shadow: 0 0 30px #fff; border-width: 5px; animation-delay: .2s; }
.cc-wave.w3 { border-color: #ffd25a; box-shadow: 0 0 30px #ffb52e; animation-delay: .45s; animation-duration: 1.4s; }
@keyframes ccWave { 0% { transform: scale(.2); opacity: 1; } 100% { transform: scale(12); opacity: 0; border-width: 1px; } }
.cc-rays { position: absolute; left: 50%; top: var(--cy); width: 1100px; height: 1100px; margin: -550px 0 0 -550px; z-index: 1; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--q) 70%, #fff4d0) 0deg 5deg, transparent 5deg 15deg);
  -webkit-mask: radial-gradient(circle, #000 6%, rgba(0, 0, 0, .6) 25%, transparent 58%); mask: radial-gradient(circle, #000 6%, rgba(0, 0, 0, .6) 25%, transparent 58%);
  opacity: .85; animation: ccRaysIn .9s .15s cubic-bezier(.2, 1.3, .4, 1) both, ccSpin 18s linear infinite; }
.cc-leg .cc-rays { width: 700px; height: 700px; margin: -350px 0 0 -350px; opacity: .55; background: repeating-conic-gradient(from 0deg, rgba(255, 215, 110, .8) 0deg 6deg, transparent 6deg 18deg); }
@keyframes ccRaysIn { from { transform: scale(0) rotate(-40deg); opacity: 0; } }
@keyframes ccSpin { to { rotate: 360deg; } }
.cc-glow { position: absolute; left: 50%; top: var(--cy); width: 640px; height: 640px; margin: -320px 0 0 -320px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 215, 110, .55), rgba(233, 185, 73, .25) 35%, transparent 68%); animation: ccFade .5s ease-out both; }
.cc-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; }
.cc-center { position: absolute; left: 50%; top: var(--cy); width: min(94vw, 620px); margin: calc(var(--item) / -2) 0 0; transform: translateX(-50%); z-index: 5;
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.cc-halo { position: absolute; left: 50%; top: calc(var(--item) / 2); width: calc(var(--item) * 1.5); height: calc(var(--item) * 1.5); margin: calc(var(--item) * -.75) 0 0 calc(var(--item) * -.75);
  border-radius: 50%; background: radial-gradient(circle, #fff 0, color-mix(in srgb, var(--q) 80%, #fff) 22%, color-mix(in srgb, var(--q) 45%, transparent) 45%, transparent 70%);
  z-index: -1; animation: ccHalo 1.8s ease-in-out .3s infinite alternate; }
@keyframes ccHalo { from { transform: scale(.85); opacity: .75; } to { transform: scale(1.12); opacity: 1; } }
.cc-item { position: relative; width: var(--item); height: var(--item); display: grid; place-items: center; font-size: calc(var(--item) * .62); line-height: 1;
  filter: drop-shadow(0 0 18px var(--q)) drop-shadow(0 0 6px #fff) drop-shadow(0 6px 6px rgba(0, 0, 0, .6)); }
.cc-item img { width: 86%; height: 86%; object-fit: contain; }
.cc-myth .cc-item { animation: ccItemMyth 1.2s .1s cubic-bezier(.2, 1.3, .4, 1) both, ccFloat 2.4s 1.3s ease-in-out infinite alternate; }
.cc-leg .cc-item { animation: ccItemLeg .8s cubic-bezier(.2, 1.5, .4, 1) both, ccFloat 2s .8s ease-in-out infinite alternate; }
@keyframes ccItemMyth { 0% { transform: scale(0) rotate(-30deg); opacity: 0; } 35% { transform: scale(1.7) rotate(10deg); opacity: 1; } 55% { transform: scale(.92) rotate(-4deg); } 75% { transform: scale(1.08); } 100% { transform: none; } }
@keyframes ccItemLeg { 0% { transform: scale(.2) translateY(30px); opacity: 0; } 60% { transform: scale(1.15); opacity: 1; } 100% { transform: none; } }
@keyframes ccFloat { to { transform: translateY(-8px); } }
.cc-spark { position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px; pointer-events: none; background: url("../img/ui/scintille.png") center / contain no-repeat;
  transform: rotate(var(--a)) translate(calc(var(--item) * .62)) scale(.8); filter: drop-shadow(0 0 5px var(--q)); animation: ccTwinkle 1.6s ease-in-out var(--d) infinite; }
@keyframes ccTwinkle { 0%, 100% { opacity: 0; transform: rotate(var(--a)) translate(calc(var(--item) * .55)) scale(.3); } 50% { opacity: 1; transform: rotate(var(--a)) translate(calc(var(--item) * .68)) scale(1) rotate(45deg); } }
.cc-banner { position: relative; width: min(92vw, 560px); aspect-ratio: 512 / 94; margin-top: 4px; display: flex; align-items: center; justify-content: center;
  filter: drop-shadow(0 6px 5px rgba(0, 0, 0, .55)); --rib: #e0342a; --ink: #4a0c0a; }
.cc-leg .cc-banner { width: min(86vw, 440px); --rib: #e9b13a; --ink: #5a3306; }
.cc-banner::before, .cc-banner::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  -webkit-mask: url("../img/ui/ruban.png") center / 100% 100% no-repeat; mask: url("../img/ui/ruban.png") center / 100% 100% no-repeat; }
.cc-banner::before { background: url("../img/ui/ruban.png") center / 100% 100% no-repeat; background-color: var(--rib); background-blend-mode: multiply; }
.cc-banner::after { background: linear-gradient(105deg, transparent 40%, rgba(255, 240, 210, .6) 50%, transparent 60%) -200% 0 / 200% 100% no-repeat; animation: ccShine 2.2s ease-in-out 1s infinite; }
@keyframes ccShine { 0% { background-position: -200% 0; } 50%, 100% { background-position: 200% 0; } }
.cc-banner h2 { position: relative; z-index: 1; margin: -12px 0 0; font: normal 44px/1.1 var(--font-title); color: #fff6dc; letter-spacing: 1.5px; white-space: nowrap;
  -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; text-shadow: 0 3px 0 var(--ink), 0 0 18px rgba(255, 210, 120, .7); }
.cc-leg .cc-banner h2 { font-size: 34px; -webkit-text-stroke-width: 5px; letter-spacing: .5px; }
.cc-myth .cc-banner { animation: ccSlam .55s .55s cubic-bezier(.3, 1.6, .5, 1) both; }
.cc-leg .cc-banner { animation: ccPop .5s .25s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes ccSlam { 0% { transform: scale(3.2); opacity: 0; } 60% { transform: scale(.94); opacity: 1; } 100% { transform: none; } }
@keyframes ccPop { 0% { transform: scale(.4); opacity: 0; } 100% { transform: none; } }
.cc-card { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 10px; max-width: 100%; padding: 10px 22px 12px; border-radius: 18px;
  background: linear-gradient(#fdeecc, #f3d9a8); color: #5a3a1b; box-shadow: 0 10px 24px rgba(0, 0, 0, .5), inset 0 2px 0 rgba(255, 255, 255, .7), inset 0 -3px 0 rgba(150, 105, 50, .25); }
.cc-card .qname { font: normal 26px/1.15 var(--font-title); -webkit-text-stroke: 4px #3a1608; paint-order: stroke fill; text-shadow: 0 2px 0 #3a1608; overflow-wrap: anywhere; }
.cc-card small { flex-basis: 100%; font-size: 16px; font-style: italic; }
.cc-count { font: normal 20px/1 var(--font-title); color: #fff6dc; background: #b0321f; border-radius: 999px; padding: 5px 10px 3px; }
.cc-count[hidden] { display: none; }
.cc-myth .cc-card { animation: ccRise .5s 1s ease-out both; }
.cc-leg .cc-card { animation: ccRise .4s .45s ease-out both; }
@keyframes ccRise { from { transform: translateY(16px); opacity: 0; } }
.cc-hint { font-size: 16px; color: rgba(255, 240, 220, .8); text-shadow: 0 1px 2px #000; animation: ccFade .6s 2.2s both; }
html.dark-win .cc-card { background: var(--dw-bg); color: var(--dw-ink); }
.cc-still .cc-stage, .cc-still .cc-stage * { animation: none !important; }
.cc-still .cc-flash, .cc-still .cc-wave { display: none; }
.cc-still .cc-spark { opacity: .8; }
@media (max-width: 600px) { .cc { --item: 130px; --cy: 38%; } .cc-banner h2 { font-size: 32px; } .cc-leg .cc-banner h2 { font-size: 26px; } .cc-card .qname { font-size: 21px; } }
.cc-epic { --item: 140px; }
.cc-epic .cc-rays { width: 520px; height: 520px; margin: -260px 0 0 -260px; opacity: .45; background: repeating-conic-gradient(from 0deg, rgba(255, 150, 220, .8) 0deg 6deg, transparent 6deg 18deg); }
.cc-epic .cc-glow { width: 460px; height: 460px; margin: -230px 0 0 -230px; background: radial-gradient(circle, rgba(255, 140, 215, .5), rgba(224, 90, 184, .22) 35%, transparent 68%); }
.cc-epic .cc-banner { width: min(80vw, 360px); --rib: #d84aa8; --ink: #4a0c38; }
.cc-epic .cc-banner h2 { font-size: 28px; }
.cc-epic .cc-card .qname { font-size: 22px; }
.op-btns { display: inline-flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- Écrans très larges (≥ 3 600 px CSS, 29/11/2026, demande de l'utilisateur pour un joueur en 5 120 × 1 440) ----------
   Seuil : au-dessus de l'ultra-large courant (3 440) et d'un 2 560 dézoomé à 75 % (3 413) ; touche le 5 120 et la 4K à 100 %.
   1 280, 1 440, 1 920, 2 560 et 3 440 ne changent pas. Même seuil que ECH_WIDE_MQ (game.js, Échoppe sur 4 colonnes, S.ui.layout4).
   Plafond de la page et de la banderole : 4 000 px, en laissant 140 px de chaque côté aux colonnes d'expéditions et d'artisans. */
/* Échoppe sur 4 ou 5 colonnes (#main[data-cols], posé par applyLayout : automatique au-delà du seuil, ou option « Colonnes de l'Échoppe »
   si la fenêtre les loge, jamais sous 2 186 px) : page et banderole élargies sur l'Échoppe comme sur les écrans très larges */
main[data-tab="echoppe"][data-cols], body:has(#main[data-tab="echoppe"][data-cols]) .tabs { max-width: min(4000px, calc(100vw - 280px)); }
main[data-tab="echoppe"][data-cols="4"] { grid-template-columns: minmax(0, 1.3fr) minmax(0, .85fr) minmax(0, .85fr) minmax(0, 1.05fr) !important; }
main[data-tab="echoppe"][data-cols="5"] { grid-template-columns: minmax(0, 1.3fr) minmax(0, .85fr) minmax(0, .85fr) minmax(0, .85fr) minmax(0, 1.05fr) !important; }
/* Largeurs choisies par le joueur (S.ui.colW, echGrid) : variable non héritée, la changer à chaque image ne recalcule pas tout le contenu */
@property --ech-g { syntax: "*"; inherits: false; }
@media (min-width: 1250px) {
  main[data-tab="echoppe"][data-colw] { grid-template-columns: var(--ech-g) !important; }
  /* Option « Largeur de l'Échoppe : Tout l'écran » (3 colonnes) : page et banderole, sur l'Échoppe seulement ; vw ignore le zoom de la page */
  main[data-tab="echoppe"][data-wide]:not([data-cols]), body:has(#main[data-tab="echoppe"][data-wide]:not([data-cols])) .tabs { max-width: max(1700px, min(4000px, calc(100vw / var(--page-zoom, 1) - 280px))); }
}
@media (min-width: 3600px) {
  :root { --page-max: min(4000px, calc(100vw - 280px)); }
  .grid, .tabs, .exp-rail-col.off { max-width: var(--page-max); }
  main[data-tab="echoppe"] { max-width: var(--page-max); }
  /* Ville et Donjons : fiche de largeur fixe, registre et liste sur 3 colonnes (en-tête répété par renderCity / renderDungeonList) */
  .city-layout, .dg-layout { grid-template-columns: minmax(0, 1fr) 760px; }
  .city-reg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 16px; align-content: start; }
  .city-reg > .cr-cat, .city-reg > .cr-empty { grid-column: 1 / -1; }
  .city-reg > .cr-head-x + .cr-cat { border-top: 0; }
  .dg-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 16px; align-content: start; }
  .dg-list > .dgr:nth-child(-n+6) { border-top: 0; }
  /* Héros : les classes sur 2 colonnes (une ligne de héros complète tient dans une colonne) */
  #heroes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; align-items: start; }
  #heroes > .hero-class.free { grid-column: 1 / -1; justify-self: center; width: 100%; max-width: 1960px; }
  /* Commandes : 4 donneurs d'ordre et 4 quêtes de héros par ligne */
  #orders.orders, .orders.hero-quests { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  /* Arène : les deux rangées de cartes côte à côte, puis l'équipe et les actions côte à côte */
  #arena.arena { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  #arena.arena > * { grid-column: 1 / -1; }
  /* Expéditions disponibles : jusqu'à la largeur de la page */
  .dp.xp { max-width: min(calc(100vw - 32px), var(--page-max)); }
  #arena.arena > .ar-row1, #arena.arena > .ar-row2, #arena.arena > .ar-card:has(> .ar-team), #arena.arena > .ar-card:has(> .ar-actions) { grid-column: auto; }
}

/* ===== Onglet Marché : emplacements, liste compacte des matériaux, formulaire, mes ordres (29/11/2026, js/marche.js) ===== */
.market { display: flex; flex-direction: column; gap: 12px; }
.market h3 { margin: 0; font: 18px var(--font-title); }
.market h3 small { font: 14px var(--font-text); margin-left: 8px; }
.mk-top { display: grid; grid-template-columns: 360px minmax(0, 1fr) 280px; gap: 12px 20px; align-items: start; }
@media (max-width: 1180px) { .mk-top { grid-template-columns: 360px minmax(0, 1fr); } .mk-top-card { grid-column: 1 / -1; } }
@media (max-width: 900px) { .mk-top { grid-template-columns: 1fr; } }
/* Contributeur de la semaine */
.mk-top-card { display: flex; flex-direction: column; gap: 8px; min-height: 176px; padding: 10px 12px; border-radius: 12px; background: rgba(233,185,73,.14); }
.mk-top-card h3 { text-align: center; color: var(--gold); }
.mk-top-card p { margin: auto; text-align: center; font-size: 15px; }
.mk-who { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; align-items: center; margin: auto 0; }
.mk-who > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mk-who small { font-size: 14px; line-height: 1.2; }
.mk-av { position: relative; width: 76px; height: 76px; border-radius: 50%; background: rgba(0,0,0,.3); }
.mk-av > img { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; object-position: top; display: block; }
.mk-av > i { position: absolute; left: 50%; top: -14px; transform: translateX(-50%); line-height: 0; }
.mk-av > i img { width: 30px; height: 30px; object-fit: contain; }
.mk-pseudo { font: 18px var(--font-title); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-lead { font-size: 14px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-top-l, .mk-top-r { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.mk-top-r > p { margin: 0; }
.mk-slots { display: flex; flex-wrap: wrap; gap: 8px; }
.mk-slot { width: 84px; height: 84px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2px;
  padding: 6px 4px; text-align: center; border-radius: 12px; background: rgba(0,0,0,.18); border: 2px solid var(--border); font: inherit; color: inherit; }
.mk-slot img { width: 34px; height: 34px; object-fit: contain; position: static; margin: 0; flex: none; }
.mk-slot small { font-size: 13px; line-height: 1.1; white-space: nowrap; }
.mk-slot b { font: 15px var(--font-title); line-height: 1; }
.mk-slot.mk-free { opacity: .6; }
.mk-slot.mk-offre { border-color: #09b8f1; background: rgba(9,184,241,.16); }
.mk-slot.mk-demande { border-color: #28c88e; background: rgba(40,200,142,.16); }
.mk-slot.mk-buy { cursor: pointer; border-style: dashed; }
.mk-slot.mk-buy img { width: 28px; height: 28px; }
.mk-slot.mk-prem { border-color: #a35bd9; background: rgba(163,91,217,.18); }
.mk-slot.mk-buy:hover { filter: brightness(1.12); }
.mk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mk-bar .mk-side { min-width: 130px; }
.mk-bar .mk-side.mk-off { opacity: .55; }
.mk-msg { flex: 1; min-width: 0; }
.mk-main { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 12px; align-items: start; }
@media (max-width: 1500px) { .mk-main { grid-template-columns: minmax(0, 1fr) 320px; } }
@media (max-width: 1100px) { .mk-main { grid-template-columns: 1fr; } }
.mk-left { min-width: 0; container: mkl / inline-size; }
.mk-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; align-items: start; }
.mk-list { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mk-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) 62px 92px 92px 50px; align-items: center; gap: 8px;
  padding: 4px 8px; min-height: 46px; border-radius: 8px; background: rgba(0,0,0,.16); border: 1px solid transparent;
  font: inherit; color: inherit; text-align: left; cursor: pointer; width: 100%; }
.mk-row:not(.mk-head):hover { background: rgba(0,0,0,.26); }
.mk-row.on { border-color: var(--gold); background: rgba(233,185,73,.16); }
.mk-row.mk-head { cursor: default; background: none; min-height: 0; font-size: 14px; color: var(--muted); }
.mk-ico img { width: 32px; height: 32px; object-fit: contain; display: block; }
.mk-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.mk-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mk-money { white-space: nowrap; }
.mk-take { align-self: stretch; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; margin: -4px 0; border-radius: 6px; }
.mk-head > :nth-child(4), .mk-head > :nth-child(5) { text-align: center; }
.mk-ask.mk-take:hover { box-shadow: inset 0 0 0 2px #28c88e; background: rgba(40,200,142,.16); }
.mk-bid.mk-take:hover { box-shadow: inset 0 0 0 2px #09b8f1; background: rgba(9,184,241,.16); }
.mk-q { display: block; font-size: 13px; line-height: 1.1; color: var(--muted); }
.mk-lvl { align-self: start; min-width: 0; }
.mk-lvl small { display: block; font-size: 14px; }
.mk-lvs { display: grid; grid-template-columns: max-content minmax(48px, max-content); grid-auto-rows: 22px; gap: 2px 8px; justify-content: end; align-items: center; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mk-lv { display: contents; }
.mk-money .ui-ico { width: 18px; height: 18px; vertical-align: -3px; }
/* Colonnes étroites : sans le nombre d'ordres, puis une seule colonne */
@container mkl (max-width: 1080px) {
  .mk-row { grid-template-columns: 32px minmax(0, 1fr) 58px 86px 86px; gap: 6px; padding: 4px 6px; }
  .mk-row > :nth-child(6) { display: none; }
}
@container mkl (max-width: 760px) { .mk-cols { grid-template-columns: 1fr; } .mk-list + .mk-list > .mk-head { display: none; } }
.mk-note { margin: 4px 0 0; font-size: 14px; }
.mk-form { padding: 12px; border-radius: 12px; background: rgba(0,0,0,.18); display: flex; flex-direction: column; gap: 10px; position: sticky; top: calc(var(--sticky-h, 0px) + 8px); }
.mk-form.mk-f-offre { box-shadow: inset 0 0 0 2px rgba(9,184,241,.55); }
.mk-form.mk-f-demande { box-shadow: inset 0 0 0 2px rgba(40,200,142,.55); }
.mk-form.mk-empty { min-height: 120px; justify-content: center; text-align: center; }
.mk-f-mat { display: grid; grid-template-columns: 48px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; }
.mk-f-mat img { width: 48px; height: 48px; object-fit: contain; grid-row: 1 / 3; }
.mk-f-mat b { font: 18px var(--font-title); }
.mk-grid { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 12px; align-items: center; }
@media (max-width: 1500px) { .mk-grid { grid-template-columns: 96px minmax(0, 1fr); gap: 8px; } }
.mk-grid > label { color: var(--muted); font-size: 15px; }
.mk-grid .mk-val { text-align: right; }
.mk-grid .mk-total { font: 18px var(--font-title); }
.mk-grid .mk-tax { text-align: right; font-size: 13px; }
.mk-curs { display: flex; gap: 8px; justify-content: flex-end; }
.mk-cur .ui-ico { width: 22px; height: 22px; }
.mk-step { display: grid; grid-template-columns: 38px minmax(0, 1fr) 38px; gap: 8px; align-items: center; }
.btn.small.mk-pm { padding: 0 0 2px; min-width: 38px; min-height: 34px; font-size: 22px; line-height: 1; }
.mk-in { width: 100%; min-width: 0; text-align: right; font: 16px var(--font-text); padding: 4px 4px; border-radius: 8px; /* 4 px : un prix à 9 chiffres (400 M) tient */
  border: 1px solid var(--border); background: rgba(255,255,255,.85); color: #2b1d10; }
.mk-create { align-self: stretch; }
.mk-exec { text-align: center; font-size: 14px; min-height: 1.4em; margin-top: -4px; } /* aperçu de l'échange sous le bouton de validation */
.mk-why { color: var(--bad); text-align: center; font-size: 14px; }
.mk-orders { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 471px), 1fr)); gap: 4px 8px; }
.mk-ord .mk-ico img { width: 24px; height: 24px; }
.mk-ord .mk-money .ui-ico { width: 15px; height: 15px; }
.btn.small.mk-x { padding: 0; min-width: 30px; width: 30px; overflow: hidden; min-height: 26px; height: 26px; display: grid; place-items: center; }
.btn.small.mk-x img { width: 13px; height: 13px; margin: 0; }
.mk-ord { display: grid; grid-template-columns: 54px 24px minmax(0, 1fr) 62px 77px 44px 30px; align-items: center; gap: 4px; font-size: 14px;
  padding: 2px 6px; min-height: 34px; border-radius: 8px; background: rgba(0,0,0,.16); }
.mk-badge { font-size: 12px; padding: 1px 2px; border-radius: 99px; text-align: center; color: #fff; }
.mk-offre .mk-badge { background: #09b8f1; }
.mk-demande .mk-badge { background: #28c88e; }

/* ===== Compte Google (js/compte.js) : fenêtre de choix à taille fixe, bloc des fenêtres Sauvegarde et Options, lien de l'accueil ===== */
.compte-dialog { width: min(640px, calc(100vw - 32px)); height: min(520px, calc(100dvh - 32px)); box-sizing: border-box; border: 0; border-radius: 18px; padding: 20px; overflow: hidden; }
.cp-box { height: 100%; display: flex; flex-direction: column; gap: 12px; }
.cp-body { flex: 1; min-height: 0; overflow-y: auto; font-size: 16px; line-height: 1.4; }
.cp-body p { margin: 0 0 12px; }
.cp-body .cc-grid { margin: 0 0 12px; }
.cp-foot { flex: none; margin: 0; gap: 10px; justify-content: flex-end; }
.cp-body .cc-n { white-space: normal; overflow-wrap: anywhere; text-align: right; }
.options-dialog .cp-sec .muted { color: var(--op-muted); }
.cp-foot a.btn, .cp-url { text-decoration: none; overflow-wrap: anywhere; }
.cp-word { display: flex; flex-direction: column; gap: 8px; margin: 0 0 12px; }
.cp-word .cloud-key { flex: none; min-width: 0; min-height: 40px; font-size: 16px; }
.cp-sec { margin: 0 0 12px; }
.cp-link { color: inherit; text-decoration: underline; }
.cp-welcome { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; font-size: 16px; }
.cp-welcome .gd-link { font-size: 16px; color: inherit; opacity: 1; }
.cp-box .save-head h2 { text-wrap: balance; }
html.tel .compte-dialog.save-dialog { height: 100dvh; }
html.tel .cp-foot .btn { min-height: 44px; }

/* Choix d'objet (01/12/2026, voulu par l'utilisateur) : grande fenêtre de taille fixe, filtres en haut, cartes renvoyées à la ligne comme les expéditions, défilement vertical.
   Trois lignes entières dès 900 px de haut, deux au-dessous ; le zoom des cartes suit la hauteur. */
html:not(.tel) .dp.ep {
  --ep-up: 66px; /* débord de l'image au-dessus de sa carte */
  inset: 0; margin: auto; transform: none; display: flex; flex-direction: column; gap: 8px; box-sizing: border-box; overflow: hidden;
  width: min(calc(100vw - 32px), 1700px); height: min(calc(100dvh - 32px), 1400px); max-height: none;
  border: 0; padding: 8px 60px 12px 46px; /* 60 px à droite : la croix reste hors des filtres, des cartes et de la barre */
}
html:not(.tel) .dp.ep .dp-row {
  flex: 1; min-width: 0; min-height: 0; flex-wrap: wrap; justify-content: center; align-items: stretch; align-content: safe center;
  gap: calc(var(--ep-up) + 10px) 16px; padding: calc(var(--ep-up) + 8px) 12px 8px; box-sizing: border-box;
  overflow: hidden auto; overscroll-behavior: contain; scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: #b07a3a transparent; cursor: default;
}
html:not(.tel) .dp.ep .ep-foot { margin-top: auto; }
html:not(.tel) .dp.ep .ep-empty { color: #5a3a1b; text-shadow: none; }
html.dark-win:not(.tel) .dp.ep .ep-empty { color: var(--dw-ink); }
.ep-empty .btn { margin-left: 8px; }
/* Filtres type et qualité (ordinateur et téléphone) */
.ep-bar { flex: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 32px; }
.ep-fg { display: flex; gap: 8px; }
.ep-f {
  box-sizing: border-box; min-width: 48px; height: 44px; margin: 0; padding: 0 12px; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  border: 0; border-radius: 12px; background: #4a2f18; color: #f6e6c8; font: 16px var(--font-title), serif; line-height: 1; white-space: nowrap;
}
.ep-f-q:not([data-v=""]) { color: var(--q); }
.ep-f img { width: 30px; height: 30px; object-fit: contain; transform: scale(1.15); }
.ep-f-cat:has(img), .ep-f-tal { padding: 0; }
html:not(.tel) .ep-card .fu-tal { top: 6px; left: 6px; width: 32px; height: 32px; }
html:not(.tel) .ep-card .fu-tal img { width: 22px; height: 22px; }
.ep-f .q-dot { flex: none; width: 14px; height: 14px; margin: 0; }
.ep-f:hover:not(:disabled) { background: #62401f; }
.ep-f.on { background: #2e1c0c; box-shadow: inset 0 0 0 3px #f4c542; }
.ep-f:disabled { opacity: .35; cursor: default; }
.ep-f:focus-visible { outline: 3px solid #f08a24; outline-offset: 2px; }
@media (max-width: 1360px) { /* 4 types + Talents + 8 qualités sur une ligne */
  html:not(.tel) .ep-bar { column-gap: 20px; }
  html:not(.tel) .ep-f { padding: 0 8px; }
  html:not(.tel) :is(.ep-f-cat:has(img), .ep-f-tal) { padding: 0; }
}
@media (max-width: 1240px) {
  html:not(.tel) .ep-fn { display: none; } /* pastille de couleur seule, nom au survol */
  html:not(.tel) .ep-f .q-dot { width: 20px; height: 20px; }
}
@media (max-height: 1239px) {
  /* Cartes resserrées */
  html:not(.tel) .dp.ep { --ep-up: 44px; }
  html:not(.tel) .dp.ep .ep-card { padding-top: 46px; padding-bottom: 6px; gap: 2px; }
  html:not(.tel) .dp.ep .ep-img { top: -46px; height: 92px; }
  html:not(.tel) .dp.ep .ep-name { min-height: 38px; font-size: 18px; }
  html:not(.tel) .dp.ep .ep-opt { font-size: 18px; }
  html:not(.tel) .dp.ep .ep-opt .flag-ico { width: 18px; height: 22px; }
  html:not(.tel) .dp.ep .ep-pow { margin-top: 0; font-size: 28px; }
  html:not(.tel) .dp.ep .ep-break { margin-top: 0; gap: 0; }
  html:not(.tel) .dp.ep .ep-break small { font-size: 17px; }
  html:not(.tel) .dp.ep .ep-break span { font-size: 22px; }
  html:not(.tel) .dp.ep .ep-break .shield-ico { width: 26px; height: 26px; }
  html:not(.tel) .dp.ep .ep-foot { padding: 2px 8px; font-size: 18px; }
  html:not(.tel) .dp.ep .ep-foot img { height: 26px; }
}
/* Trois lignes */
@media (min-height: 1300px) and (max-height: 1369px) { html:not(.tel) .dp.ep .dp-row { zoom: .95; } }
@media (min-height: 1240px) and (max-height: 1299px) { html:not(.tel) .dp.ep .dp-row { zoom: .9; } }
@media (min-height: 940px) and (max-height: 994px) { html:not(.tel) .dp.ep .dp-row { zoom: .94; } }
@media (min-height: 900px) and (max-height: 939px) { html:not(.tel) .dp.ep .dp-row { zoom: .9; } }
@media (min-height: 640px) and (max-height: 699px) { html:not(.tel) .dp.ep .dp-row { zoom: .9; } }
@media (max-height: 639px) { html:not(.tel) .dp.ep .dp-row { zoom: .8; } }

/* ===== Familiers (8e case de la fiche, choix, panneau Collection, fiche du donjon ; notes « Familiers ») ===== */
.pet-img { display: block; object-fit: contain; }
.pet-img.shadow { filter: brightness(0) opacity(.35); }
.hs-tile.pet-tile .hs-art .pet-img { width: 88cqw; height: 88cqw; filter: drop-shadow(0 0 3px var(--q, transparent)) drop-shadow(0 3px 3px rgba(0, 0, 0, .3)); }
.hs-tile.pet-tile:disabled .hs-art .pet-img { filter: grayscale(.8) opacity(.7); }
.pet-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 190px; padding: 10px 8px; box-sizing: border-box;
  border-radius: 12px; background: #fff8e6; border: 2px solid var(--q, #c9bba5); color: #4a2e14; font: inherit; font-size: 15px; text-align: center;
  box-shadow: 0 4px 8px rgba(110, 70, 25, .22); transition: box-shadow .15s, filter .15s; } /* ombre reprise de .rj-card */
html.dark-win .pet-card { box-shadow: 0 4px 8px rgba(0, 0, 0, .35); }
.pet-card.unknown { box-shadow: none; }
button.pet-card { cursor: pointer; }
button.pet-card:hover { filter: brightness(1.04); }
.pet-card .pet-cimg { display: flex; align-items: center; justify-content: center; width: 112px; height: 112px; }
.pet-card .pet-cimg .pet-img { width: 104px; height: 104px; filter: drop-shadow(0 0 4px var(--q, transparent)); }
.pet-card .pet-cimg .pet-img.shadow { filter: brightness(0) opacity(.3); }
.pet-card .pet-name { font-family: var(--font-title), serif; font-size: 18px; -webkit-text-stroke: 3px #4a2e14; paint-order: stroke fill; }
.pet-card.unknown { background: #efe3c7; border-style: dashed; }
.pet-card.unknown .pet-name { color: #8a7458; -webkit-text-stroke: 0; }
/* Indice unique à la place des familiers des donjons verrouillés (collection progressive) */
.pet-card.pet-more { justify-content: center; }
.pet-card.pet-more .pet-more-ico { width: 64px; height: 64px; opacity: .55; }
.pet-card.pet-more p { margin: 0; color: #6b5538; font-size: 15px; line-height: 1.3; font-style: italic; }
.pet-lvl { display: flex; justify-content: center; width: 100%; padding: 0 4px; box-sizing: border-box; font-size: 14px; }
.pet-lvl b { font-variant-numeric: tabular-nums; }
.pet-eff { font-size: 14px; line-height: 1.25; color: #2f6b2a; }
.pet-zone, .pet-who { font-size: 13px; color: #7a6040; }
.pet-who { min-height: 34px; display: flex; align-items: center; justify-content: center; margin-top: auto; } /* porteur et Nourrir collés en bas : mêmes hauteurs d’une carte à l’autre */
.pet-who-av img.av { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--q, #c9bba5); background: #3a2716; display: block; }
.pet-coll .pet-card[data-action] { cursor: pointer; }
/* Relief des cartes (demande de l'utilisateur, 03/12/2026) : biseau clair en haut, sombre en bas ; au survol à la souris, la carte s'incline
   vers le pointeur avec un reflet (variables --rx, --ry, --mx, --my posées par petTilt dans game.js ; rien si mouvements réduits) */
.pet-coll .pet-card:not(.unknown) { box-shadow: 0 4px 8px rgba(0, 0, 0, .35), inset 0 2px 0 rgba(255, 255, 255, .85), inset 0 -4px 0 rgba(150, 105, 50, .2);
  transform: perspective(700px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--lift, 0px)); transition: transform .25s ease-out, box-shadow .15s, filter .15s; }
.pet-coll .pet-card[data-action]:hover { filter: brightness(1.04); --lift: -4px;
  box-shadow: 0 0 0 2px var(--q), 0 12px 18px rgba(0, 0, 0, .45), inset 0 2px 0 rgba(255, 255, 255, .85), inset 0 -4px 0 rgba(150, 105, 50, .2); }
.pet-coll .pet-card.tilt { transition: transform .06s linear, box-shadow .15s, filter .15s; }
.pet-coll .pet-card:not(.unknown)::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .2s;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, .45), rgba(255, 255, 255, 0) 55%); }
.pet-coll .pet-card.tilt::after { opacity: 1; }
.pet-coll .pet-card:not(.unknown) .pet-cimg .pet-img { transition: transform .25s ease-out; }
.pet-coll .pet-card[data-action]:hover .pet-cimg .pet-img { transform: scale(1.06) translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .pet-coll .pet-card:not(.unknown), .pet-coll .pet-card[data-action]:hover .pet-cimg .pet-img { transform: none; } }
/* Fiche d'un familier */
.dp.pet-sheet { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; width: min(94vw, 860px); background: #fdeecc; border: 3px solid var(--q); border-radius: 18px; padding: 22px 24px; box-sizing: border-box; overflow-y: auto; color: #4a2e14; }
.pts-left { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.pts-art { width: 260px; height: 260px; display: flex; align-items: center; justify-content: center; border-radius: 16px; background: radial-gradient(circle, color-mix(in srgb, var(--q) 30%, #fff8e6) 0, #fff3d8 70%); }
.pts-art .pet-img { width: 240px; height: 240px; object-fit: contain; filter: drop-shadow(0 0 8px var(--q)) drop-shadow(0 6px 6px rgba(0, 0, 0, .25)); }
.pts-forms { display: flex; gap: 10px; }
.pts-form { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px; border-radius: 10px; background: #f3e4c2; border: 2px solid transparent; font-size: 13px; }
.pts-form.on { border-color: var(--q); background: #fff8e6; }
.pts-form .pet-img { width: 60px; height: 60px; }
.pts-form .pet-img.shadow { filter: brightness(0) opacity(.3); }
.pts-right { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pts-name { margin: 0 40px 0 0; font-family: var(--font-title), serif; font-size: 32px; -webkit-text-stroke: 4px #4a2e14; paint-order: stroke fill; }
.pts-sub { font-size: 17px; }
.pts-meta { font-size: 15px; color: #7a6040; }
.pts-eff { padding: 10px 12px; border-radius: 12px; background: #fff8e6; border: 1px solid #e3cfa6; }
.pts-eff-n { display: block; font-family: var(--font-title), serif; font-weight: 400; font-size: 18px; color: #5a3a1b; }
.pts-eff-v { display: block; margin: 2px 0 4px; font-size: 18px; font-weight: bold; color: #2f6b2a; }
.pts-eff ul { margin: 0; padding-left: 18px; font-size: 15px; line-height: 1.4; }
.pts-hero { display: flex; align-items: center; gap: 14px; margin-top: auto; padding: 10px 14px; border-radius: 14px; border: 2px solid var(--q); background: #3a2716; color: #fff3d6; font: inherit; text-align: left; cursor: pointer; }
.pts-hero:hover { filter: brightness(1.1); }
.pts-hero.free { cursor: default; background: #efe3c7; color: #5a3a1b; border-style: dashed; }
.pts-hero-art { flex: none; width: 120px; height: 120px; border-radius: 12px; overflow: hidden; display: flex; align-items: flex-end; justify-content: center; background: radial-gradient(circle at 50% 40%, #6b4a2b, #2a1a0c); }
.pts-bust { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.pts-hero-art img.av.pts-av { width: 104px; height: 104px; align-self: center; }
.pts-hero-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pts-hero-txt small { font-size: 14px; opacity: .8; }
.pts-hero-txt b { font-family: var(--font-title), serif; font-weight: 400; font-size: 26px; }
.pts-hero-txt span { font-size: 15px; opacity: .85; }
@media (max-width: 700px) {
  .dp.pet-sheet { grid-template-columns: minmax(0, 1fr); padding: 16px; max-height: 92vh; }
  .pts-art { width: 200px; height: 200px; } .pts-art .pet-img { width: 184px; height: 184px; }
  .pts-name { font-size: 26px; }
  .pts-hero-art { width: 88px; height: 88px; }
}
.pet-feed { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; margin-top: 4px; }
.pet-feed .ri { width: 20px; height: 20px; }
.pet-feed small { flex-basis: 100%; font-size: 12px; }
.pet-foot { align-self: stretch; min-height: 76px; display: flex; align-items: flex-start; justify-content: center; } /* jauge + bouton avec doublons : porteurs alignés */
/* Jauge de nourrissage (petFeedHtml) : matériau déjà versé pour le prochain niveau */
.pet-feedbox { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%; }
.pet-gauge { position: relative; width: min(100%, 160px); height: 16px; margin-top: 4px; border-radius: 8px; background: rgba(90, 58, 27, .18); overflow: hidden; }
.pet-gauge > i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: linear-gradient(#f1c95a, #c9952a); }
.pet-gauge > span { position: relative; display: block; font-size: 12px; line-height: 16px; text-align: center; color: #4a2e14; font-variant-numeric: tabular-nums; font-weight: bold; }
.dp.pet-sheet .pet-gauge { width: min(100%, 240px); height: 18px; } .dp.pet-sheet .pet-gauge > span { line-height: 18px; font-size: 13px; }
.pet-feed.max { font-size: 14px; color: #a0781e; font-weight: bold; min-height: 30px; box-sizing: border-box; } /* même hauteur que le bouton Nourrir */
.pet-card.evolved { animation: pet-evolve 1.2s ease-out 2; }
@keyframes pet-evolve { 0% { box-shadow: 0 0 0 0 var(--q); transform: scale(1); } 40% { box-shadow: 0 0 22px 8px var(--q); transform: scale(1.06); } 100% { box-shadow: 0 0 0 0 var(--q); transform: scale(1); } }
/* Panneaux Familiers et Équipes de l'onglet Héros : bois un peu plus clair que les lignes de héros (#362a20), sans contour, cartes crème posées dessus */
.pet-coll { margin: 10px 0 14px; padding: 10px 14px 14px; border-radius: 12px; background: #3e3024; box-shadow: inset 0 1px 0 rgba(255, 226, 170, .08); }
.pet-coll-h { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; color: #f3e4c4; }
.pet-coll-h > span { color: #e9b949; }
.pet-coll-h small { flex: 1; color: #d9c49c; opacity: 1; }
.pet-coll > .hint { color: #e8d6b0; opacity: 1; margin: 0 0 10px; }
.pet-coll.folded { padding-bottom: 10px; }
.pet-grid { display: grid; grid-template-columns: repeat(auto-fill, 190px); gap: 10px; justify-content: center; }
.dp.pet-pick { background: #fdeecc; border-radius: 18px; padding: 14px 16px 16px; box-sizing: border-box; overflow-y: auto; }
.pp-close { position: absolute; top: 6px; right: 6px; z-index: 3; }
.pp-h { margin: 0 44px 12px; text-align: center; color: #5a3a1b; font-family: var(--font-title), serif; font-size: 22px; }
.pp-empty { color: #5a3a1b; font-size: 16px; text-align: center; padding: 20px 10px; }
.pet-zrow .dgs-ico .pet-img { width: 28px; height: 28px; }
.pet-pity { display: inline-block; width: 38px; height: 6px; margin-left: 8px; border-radius: 3px; vertical-align: middle;
  background: linear-gradient(90deg, #2fc25b calc(var(--p) * 100%), rgba(255, 255, 255, .2) 0); }
@media (max-width: 700px) {
  .pet-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pet-card { width: auto; }
}
.fh-bi .pet-img, .fe-chip .pet-img { width: 32px; height: 32px; }
/* Familier dans la ligne d'un héros (onglet Héros) */
.hrow .hr-eq .hcard.pet-hc .hcard-icons.is-item img.pet-img { width: 70cqw; height: 70cqw; object-fit: contain; }
.tuto-imgs .pet-img.pet-myst { width: 72px; height: 72px; filter: brightness(0) drop-shadow(0 0 6px rgba(150, 120, 255, .7)); opacity: .85; } /* annonce mystérieuse des familiers */
/* Animation d'évolution d'un familier (petEvoShow) : 1 s de charge, flash et particules, nouvelle forme ; clic pour passer */
.pet-evo { position: fixed; inset: 0; z-index: 2000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: rgba(10, 6, 2, .86); cursor: pointer; animation: pe-in .25s ease-out; }
.pet-evo.out { opacity: 0; transition: opacity .3s; }
.pe-stage { position: relative; width: 240px; height: 240px; }
.pe-stage > span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.pe-stage .pet-img { width: 220px; height: 220px; object-fit: contain; }
.pe-old .pet-img { animation: pe-charge 1.05s ease-in forwards; }
.pe-new { opacity: 0; animation: pe-born .7s 1.05s cubic-bezier(.2, 1.4, .4, 1) forwards; }
.pe-new .pet-img { filter: drop-shadow(0 0 14px var(--q)) drop-shadow(0 0 30px var(--q)); }
.pe-parts i { position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px; border-radius: 50%; background: var(--q); box-shadow: 0 0 8px var(--q), 0 0 2px #fff; opacity: 0;
  animation: pe-part .8s 1s ease-out forwards; }
.pe-flash { position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none; animation: pe-flash .5s .95s ease-out forwards; }
.pe-txt { display: flex; flex-direction: column; align-items: center; gap: 4px; opacity: 0; animation: pe-txt .5s 1.35s ease-out forwards; text-align: center; }
.pe-txt b { font-family: var(--font-title), serif; font-weight: 400; font-size: 40px; color: var(--q); -webkit-text-stroke: 5px #2a1a0c; paint-order: stroke fill; }
.pe-txt span { font-size: 20px; color: #fff3d6; text-shadow: 0 2px 3px #000; }
@keyframes pe-in { from { opacity: 0; } }
@keyframes pe-charge {
  0% { transform: translate(0, 0); filter: brightness(1); }
  20% { transform: translate(-3px, 1px); } 30% { transform: translate(3px, -1px); }
  40% { transform: translate(-4px, 0); } 48% { transform: translate(4px, 1px); } 55% { transform: translate(-5px, -1px); }
  61% { transform: translate(5px, 0); } 66% { transform: translate(-6px, 1px); } 71% { transform: translate(6px, -1px); }
  75% { transform: translate(-6px, 0); } 79% { transform: translate(6px, 1px); } 83% { transform: translate(-7px, 0); }
  86% { transform: translate(7px, -1px); } 89% { transform: translate(-7px, 1px); } 92% { transform: translate(7px, 0); filter: brightness(2.2) drop-shadow(0 0 18px var(--q)); }
  100% { transform: scale(1.1); filter: brightness(6) drop-shadow(0 0 30px #fff); opacity: 0; }
}
@keyframes pe-flash { 0% { opacity: 0; } 25% { opacity: .9; } 100% { opacity: 0; } }
@keyframes pe-born { 0% { opacity: 0; transform: scale(.55); } 100% { opacity: 1; transform: scale(1); } }
@keyframes pe-part { 0% { opacity: 1; transform: rotate(var(--a)) translateY(0) scale(1); } 100% { opacity: 0; transform: rotate(var(--a)) translateY(calc(-1 * var(--d))) scale(.4); } }
@keyframes pe-txt { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
/* Version adoucie : simple fondu de l'ancienne forme vers la nouvelle, sans tremblement, flash ni particules */
.pet-evo.calm .pe-old .pet-img { animation: pe-fade-out .6s ease forwards; }
.pet-evo.calm .pe-new { animation: pe-fade-in .6s .4s ease forwards; }
.pet-evo.calm .pe-parts, .pet-evo.calm .pe-flash { display: none; }
.pet-evo.calm .pe-txt { animation-delay: .6s; }
@keyframes pe-fade-out { to { opacity: 0; } }
@keyframes pe-fade-in { to { opacity: 1; } }
@media (max-width: 700px) { .pe-stage { width: 180px; height: 180px; } .pe-stage .pet-img { width: 168px; height: 168px; } .pe-txt b { font-size: 32px; } }

/* ===== Onglet Héros : panneau « Équipes » (heroTeamsHtml, demande de l'utilisateur, 03/12/2026) ===== */
.ht-panel > .hint { font-size: 15px; }
.ht-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 10px; }
.ht-team { min-width: 0; padding: 8px 10px 10px; border-radius: 10px; background: #fdeecc; }
.ht-head { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; color: #5a3a1b; font-size: 16px; }
.ht-head b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ht-pow { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ht-pow img { width: 18px; height: 18px; }
.ht-slots { display: grid; grid-template-columns: repeat(var(--k), minmax(0, 56px)); justify-content: space-between; gap: 8px; }
.ht-slot { position: relative; aspect-ratio: 1; border-radius: 8px; display: grid; place-items: center; background: rgba(90, 58, 27, .08); }
.ht-slot.empty { border: 2px dashed rgba(90, 58, 27, .3); }
.ht-slot.locked { opacity: .55; }
.ht-slot.locked img { width: 22px; height: 22px; }
.ht-slot.full { cursor: grab; background: rgba(90, 58, 27, .14); }
.ht-slot.full.away, html.tel .ht-slot.full { cursor: pointer; } /* pas de glisser : le clic mène à la ligne du héros */
.ht-slot.full img.av { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.ht-slot.away { cursor: default; }
.ht-slot.away img.av, .ht-slot.over-cap img.av { filter: grayscale(1) opacity(.5); }
.ht-slot .ht-crown { position: absolute; left: -4px; top: -6px; width: 18px; height: 18px; }
.ht-slot .ht-gone { position: absolute; right: -3px; bottom: -3px; width: 18px; height: 18px; }
.ht-slot .ht-x { position: absolute; right: -6px; top: -6px; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center;
  background: #fff8e6; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); cursor: pointer; opacity: 0; transition: opacity .12s; }
.ht-slot .ht-x img { width: 12px; height: 12px; }
.ht-slot:hover .ht-x, .ht-slot .ht-x:focus-visible { opacity: 1; }
@media (pointer: coarse) { .ht-slot .ht-x { opacity: 1; } }
.ht-slot.over { outline: 3px solid var(--gold, #e0b050); outline-offset: 1px; background: rgba(224, 176, 80, .3); }
.ht-src { opacity: .4; }
.ht-ghost { position: fixed; left: 0; top: 0; z-index: 2000; width: 56px; height: 56px; pointer-events: none; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .45)); }
.ht-ghost img { width: 100%; height: 100%; object-fit: contain; }
body.ht-drag-on .ht-slot.empty, body.ht-drag-on .ht-slot.full:not(.away) { background: rgba(224, 176, 80, .18); }
.hrow.is-hired:not(.away-row) .hr-id .avatar { cursor: grab; }
.hrow .hr-name .ht-pill { align-self: flex-start; max-width: 100%; margin: 4px 0 0; padding: 1px 8px; border-radius: 999px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 13px; line-height: 18px; color: #fff8e6; background: #1f5440; }
.hrow .hr-name .ht-pill b { font: inherit; font-weight: 700; }
.hero-class h3 .ht-free { flex: none; margin: 0 0 8px auto; }
.hero-class h3 .ht-free.on { background: #1f5440; color: #fff8e6; }
.hero-class h3 .ht-free + .away-toggle { margin-left: 8px; }
/* « Sans équipe » et « Ordre des équipes » groupés : passent à la ligne ensemble */
.hero-class h3 .ht-btns { flex: none; display: flex; gap: 8px; margin: 0 0 8px auto; }
.hero-class h3 .ht-btns .ht-free { margin: 0; }
.hero-class h3 .ht-btns + .away-toggle { margin-left: 8px; }
/* Clic sur un portrait d'équipe : la ligne du héros est brièvement surlignée (htJumpGo) */
.hrow.ht-flash { animation: ht-flash 1.6s ease-out; }
@keyframes ht-flash { 0%, 35% { box-shadow: 0 0 0 3px #f7dc97, 0 0 18px 4px rgba(247, 220, 151, .7); } 100% { box-shadow: 0 0 0 3px rgba(247, 220, 151, 0), 0 0 18px 4px rgba(247, 220, 151, 0); } }
@media (prefers-reduced-motion: reduce) { .hrow.ht-flash { animation: none; box-shadow: 0 0 0 3px #f7dc97; } }
.hrow .hr-act { position: relative; flex-wrap: wrap; gap: 8px; }
.ht-mwrap { position: relative; display: inline-flex; width: 100%; }
.ht-mbtn { width: 100%; }
.ht-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 220px; padding: 8px; border-radius: 10px; display: grid; gap: 6px;
  background: #fff8e6; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
.ht-mi { display: grid; grid-template-columns: 1fr auto 20px; align-items: center; gap: 8px; min-height: 40px; padding: 4px 10px; border: 0; border-radius: 8px;
  background: rgba(90, 58, 27, .08); color: #5a3a1b; font: inherit; font-size: 16px; text-align: left; cursor: pointer; }
.ht-mi small { text-align: right; color: #7a5a38; }
.ht-mi img { width: 18px; height: 18px; }
.ht-mi.on { background: rgba(31, 84, 64, .18); }
.ht-mi:disabled { opacity: .5; cursor: default; }
/* Arène : case témoin invisible de arenaTeamHold (hauteur d'une case occupée) */
.ar-team.ar-mine { position: relative; }
.ar-team.ar-mine > .ar-probe { position: absolute; left: 0; top: 0; visibility: hidden; pointer-events: none; }
/* Arène : aperçu d'une place libre de l'équipe (arenaGhostRow), même hauteur qu'une ligne de duel */
.ar-duel.ghost > .ar-side:first-child { opacity: .6; }
.ar-duel.ghost .ar-ghost-av { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 8px; border: 2px dashed var(--border); }
.ar-duel.ghost .ar-ghost-av img.ar-pos { width: 26px; height: 26px; }
.ar-duel.ghost .ar-side b, .ar-duel.ghost .ar-side small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ar-duel.ghost .ar-side small { display: block; }

/* ----- Récapitulatif du retour (#retour-dialog, retourCheck dans game.js ; audit du tutoriel, 03/12/2026) ----- */
#retour-dialog .rt-box { width: 480px; max-width: 100%; box-sizing: border-box; }
.rt-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.rt-list li { display: grid; grid-template-columns: 32px 1fr; align-items: center; gap: 8px; font-size: 16px; }
.rt-ico { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; }
.rt-ico img { width: 28px; height: 28px; object-fit: contain; }

/* Onglet Héros : vue « Arène » (heroArenaView) : objet partagé avec l'ensemble de quête, dans la bande haute de la carte (place de la pastille de casse) */
.hrow .hr-eq .hcard > .hcard-shared { grid-row: 1; align-self: start; line-height: 0; }
.hrow .hr-eq .hcard > .hcard-shared .hs-copy-ico { width: clamp(14px, 20cqw, 22px); height: auto; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .4)); }

/* Quêtes favorites (05/12/2026) : étoile en haut à droite de la fiche de quête, repère sur le filtre « Quêtes » de l'atelier */
.quest-head .quest-fav { flex: none; align-self: flex-start; width: 32px; height: 32px; padding: 0; justify-content: center; }
.quest-head .quest-fav img.ui-ico { width: 28px; height: 28px; }
.quest-head .quest-fav.on img.ui-ico { filter: drop-shadow(0 0 3px rgba(255, 210, 90, 1)) drop-shadow(0 0 6px rgba(233, 185, 73, .9)); }
.want-tab .want-fav { position: absolute; bottom: -5px; right: -5px; width: 16px; height: 16px; pointer-events: none; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .6)); }
.ct-qfav { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- Recherche dans les recettes (#rec-search, 05/12/2026) : sur la ligne du titre « Recettes », à droite ---------- */
.rec-search { position: relative; display: inline-flex; vertical-align: middle; align-items: center; gap: 6px; width: min(280px, calc(100% - 140px)); height: 28px; margin: -5px 0 -5px 4px; padding: 0 4px 0 8px;
  border: 1px solid var(--border); border-radius: 8px; background: rgba(0, 0, 0, .3); color: var(--text); box-sizing: border-box; }
/* titre et recherche sur la même ligne, juste à droite de « Recettes » ; hauteur du panneau inchangée (marges négatives du champ) */
.recipes-panel > .rec-head { display: inline-block; vertical-align: top; margin-bottom: 16px; } /* +6 px : 8 px entre le champ et les icônes */
.recipes-panel > .rec-search { vertical-align: top; width: min(280px, calc(100% - 100px - var(--ra-w, 0px))); }
/* Plans et Packs (06/12/2026, demande de l'utilisateur) : à droite du champ, 8 px d'écart, même hauteur (28 px) et mêmes marges négatives ;
   --ra-w = place qu'ils prennent, retirée de la largeur du champ ; panneau étroit : icônes seules */
.recipes-panel { --ra-w: 196px; }
.rec-acts { display: inline-flex; vertical-align: top; gap: 8px; height: 28px; margin: -5px 0 -5px 8px; }
.rec-acts:empty { display: none; }
.rec-acts .btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; box-sizing: border-box; height: 28px; min-height: 0; padding: 0 10px; line-height: 1.15; white-space: nowrap; }
.rec-acts .btn img { height: 20px; width: auto; }
@container recp (max-width: 560px) {
  .rec-acts .rk-lbl { display: none; }
  .rec-acts .btn { min-width: 40px; padding: 0 8px; }
}
@container recp (max-width: 560px) { .rec-search { --ra-w: 96px; } }
.rec-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(217, 130, 43, .35); }
.rec-search .rs-ico { flex: none; width: 18px; height: 18px; opacity: .8; pointer-events: none; }
.rec-search input { flex: 1 1 auto; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: none; color: inherit; font: inherit; font-size: 16px; -webkit-appearance: none; appearance: none; }
.rec-search input::placeholder { color: var(--muted); opacity: 1; }
.rec-search input::-webkit-search-cancel-button, .rec-search input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }
.rec-search .rs-n { flex: none; font-size: 13px; color: var(--muted); white-space: nowrap; }
.rec-search .rs-n.none { color: #e0a080; }
.rec-search .rs-n:empty { display: none; }
.rec-search .rs-clear { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 6px; background: none; cursor: pointer; }
.rec-search .rs-clear:hover, .rec-search .rs-clear:focus-visible { background: rgba(255, 255, 255, .08); }
.rec-search .rs-clear img { width: 16px; height: 16px; }
.rec-search .rs-clear[hidden] { display: none; }
/* Autres catégories qui ont des résultats (bas de liste pendant une recherche) */
.rs-else { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 0; color: var(--muted); }
.rs-else .rs-cat { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 2px; border: 1px solid var(--border); border-radius: 8px; background: rgba(0, 0, 0, .25); color: var(--text); font: inherit; cursor: pointer; }
.rs-else .rs-cat:hover, .rs-else .rs-cat:focus-visible { border-color: var(--accent); }
.rs-else .rs-cat .tile-img { width: 28px; height: 28px; }

/* En-tête des recettes : héros qui peuvent porter la catégorie choisie (05/12/2026) */
.recipes-panel > .cat-title .ct-name { flex-wrap: nowrap; white-space: nowrap; overflow: hidden; }
.ct-heroes { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.ct-heroes[hidden] { display: none; }
.ct-hero { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; background: rgba(0, 0, 0, .35); box-shadow: 0 0 0 1px var(--border); }
.ct-hero[hidden] { display: none; }
.ct-more { font-size: 13px; color: var(--muted); font-weight: normal; padding-left: 2px; }
.ct-more[hidden] { display: none; }
