/* ═══════════════════════════════════════════════════════════════════
   BESTIAIRE v2 : liste à gauche, fiche à droite, plein écran.
   Toutes les classes sont préfixées bst- : style.css pose des règles nues
   sur h2, h3 et p, on les neutralise ici au lieu de les subir.
   Sans JavaScript, les fiches s'empilent et la page reste lisible :
   tout ce qui masque ou fige la mise en page vit sous .bst-js.
   ═══════════════════════════════════════════════════════════════════ */

.page-bestiaire {
  --bst-nav: 62px;
  --bst-fond: #1b1013;
  --bst-panneau: #1d0d13;
  --bst-panneau-2: #28121a;
  --bst-bord: rgba(168, 137, 90, 0.18);
  --bst-bord-fort: rgba(168, 137, 90, 0.42);
  --bst-or: #a8895a;
  --bst-creme: #ebe1cf;
  --bst-doux: #b59f93;
  --bst-danger: #e07a6f;
  --bst-atout: #9cc48a;
  --bst-neutre: #c9b27e;
  background: var(--bst-fond);
  color: var(--bst-creme);
}

.page-bestiaire h2::after { content: none; }
.page-bestiaire p { margin-bottom: 0; }

/* ── Écran ──────────────────────────────────────────────────────────── */
.bst-ecran {
  padding-top: var(--bst-nav);
}

/* ── Liste ──────────────────────────────────────────────────────────── */
.bst-liste {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: linear-gradient(180deg, #200f15 0%, #170a0f 100%);
  border-right: 1px solid var(--bst-bord);
}

.bst-liste-tete {
  padding: 1.4rem 1.4rem 1rem;
  border-bottom: 1px solid var(--bst-bord);
}

.bst-retour-grimoire {
  font-family: var(--font-body);
  font-size: 0.72rem;
  color: var(--bst-doux);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}
.bst-retour-grimoire:hover { color: var(--bst-creme); }

.bst-liste-titre {
  font-family: var(--font-title);
  font-size: 2rem;
  line-height: 1.1;
  color: var(--bst-or);
  margin: 0.35rem 0 0.2rem;
  letter-spacing: 0.02em;
}

.bst-compteur {
  font-family: var(--font-title);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--bst-doux);
}

.bst-liste-defil {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.8rem 0.9rem 1.2rem;
  scrollbar-width: thin;
  scrollbar-color: #5a2a33 transparent;
}

.bst-groupe {
  font-family: var(--font-title);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--bst-doux);
  margin: 1.1rem 0.4rem 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.bst-groupe::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--bst-bord);
}
.bst-groupe-soeurs { color: var(--bst-atout); }

.bst-entree {
  --accent: var(--bst-or);
  position: relative;
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 0.85rem;
  align-items: center;
  padding: 0.5rem 0.7rem 0.5rem 0.5rem;
  margin-bottom: 0.4rem;
  border: 1px solid var(--bst-bord);
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.015), rgba(0, 0, 0, 0.1));
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.bst-entree:hover {
  border-color: var(--bst-bord-fort);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.1));
}
.bst-entree:focus-visible {
  outline: 2px solid var(--bst-or);
  outline-offset: 2px;
}
.bst-entree.est-active {
  border-color: var(--accent);
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 22%, transparent), rgba(0, 0, 0, 0.15) 70%);
  box-shadow: inset 3px 0 0 var(--accent), 0 0 18px -8px var(--accent);
}

/* Portrait : vignette 80×80 préparée hors navigateur (créature entière, réduction au plus
   proche voisin), affichée à taille réelle. Le navigateur ne redimensionne jamais du pixel art. */
.bst-portrait {
  position: relative;
  width: 80px;
  height: 80px;
  overflow: hidden;
  border-radius: 4px;
  background: radial-gradient(circle at 50% 60%, #3a1a22, #11080b 75%);
  border: 1px solid rgba(0, 0, 0, 0.35);
}
.bst-portrait img {
  display: block;
  width: 80px;
  height: 80px;
  max-width: none;
  image-rendering: pixelated;
}
.bst-portrait-guide img {
  width: 52px;
  height: 52px;
  margin: 14px;
  image-rendering: auto;
  opacity: 0.85;
}

.bst-entree-texte {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.5rem;
  min-width: 0;
}
.bst-entree-num {
  grid-row: span 2;
  font-family: var(--font-title);
  font-size: 0.7rem;
  color: var(--bst-doux);
  padding-top: 0.2rem;
  opacity: 0.7;
}
.bst-entree-nom {
  font-family: var(--font-title);
  font-size: 0.95rem;
  line-height: 1.25;
  color: var(--bst-creme);
  min-width: 0;
}
.bst-entree.est-active .bst-entree-nom { color: #fff3e0; }
.bst-entree-titre {
  font-size: 0.72rem;
  line-height: 1.3;
  color: var(--bst-doux);
  font-style: italic;
  min-width: 0;
}
.bst-entree-statut {
  grid-column: 2;
  margin-top: 0.3rem;
  font-size: 0.64rem;
  letter-spacing: 0.02em;
  color: var(--bst-doux);
}
.bst-entree-statut:empty { display: none; }
/* Pas de pointillés (règle DA du 2026-09-13) : contour en filet dégradé, marqué au centre
   et fondu aux extrémités, même procédé que les cartes du registre (.viewer-card::before). */
.bst-entree-statut.est-inconnu {
  position: relative;
  justify-self: start;
  padding: 0.05rem 0.5rem;
  border-radius: 3px;
  color: var(--bst-or);
}
.bst-entree-statut.est-inconnu::before {
  content: '';
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(168, 137, 90, 0.08), rgba(168, 137, 90, 0.8) 50%, rgba(168, 137, 90, 0.08));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask-composite: exclude;
  pointer-events: none;
}

.bst-liste-pied {
  padding: 0.7rem 1.4rem;
  border-top: 1px solid var(--bst-bord);
  font-size: 0.66rem;
  color: var(--bst-doux);
}
.bst-astuce kbd {
  display: inline-block;
  min-width: 1.4em;
  padding: 0 0.3em;
  margin-right: 0.2em;
  border: 1px solid var(--bst-bord-fort);
  border-bottom-width: 2px;
  border-radius: 3px;
  font-family: var(--font-body);
  text-align: center;
  color: var(--bst-creme);
}

/* ── Détail ─────────────────────────────────────────────────────────── */
.bst-detail {
  position: relative;
  min-width: 0;
}

.bst-ambiance {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.bst-ambiance-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(5px) brightness(0.32) saturate(0.75);
  transform: scale(1.06);
}
.bst-ambiance::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 60% at 32% 52%, color-mix(in srgb, var(--bst-accent-scene, #a8895a) 16%, transparent), transparent 70%),
    linear-gradient(90deg, rgba(27, 16, 19, 0.2), rgba(27, 16, 19, 0.55));
  transition: background 0.5s;
}

.bst-retour-liste { display: none; }

.bst-fiche {
  position: relative;
  color: var(--bst-creme);
}

/* Scène : le sprite, son numéro en filigrane, le mot de Zorbin.
   Colonne étroite depuis le 2026-09-13 (les sprites sont petits, le texte a la place) :
   ses éléments s'empilent au lieu de se superposer, rien ne peut plus chevaucher le sprite. */
.bst-scene {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  min-height: 300px;
  padding: 1.2rem 1.1rem;
  overflow: hidden;
}
.bst-filigrane {
  position: absolute;
  top: 0.4rem;
  right: 1rem;
  font-family: var(--font-title);
  font-size: clamp(4.5rem, 7vw, 8rem);
  line-height: 1;
  color: var(--accent);
  opacity: 0.09;
  user-select: none;
}
.bst-sprite {
  position: relative;
  image-rendering: pixelated;
  max-width: none;
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.55));
}


.bst-zorbin {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  column-gap: 0.8rem;
  align-items: center;
  width: 100%;
  max-width: 460px;
  padding: 0.7rem 1rem 0.75rem 0.8rem;
  background: rgba(27, 16, 19, 0.72);
  border: 1px solid var(--bst-bord);
  border-left: 3px solid var(--accent);
  border-radius: 3px;
  font-size: 0.82rem;
  line-height: 1.5;
  font-style: italic;
  color: var(--bst-creme);
  backdrop-filter: blur(2px);
}
/* Médaillon de Zorbin : portrait tiré de zorbin-idle.gif, réduit hors navigateur (48 px). */
.bst-zorbin-portrait {
  grid-row: span 2;
  align-self: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: radial-gradient(circle at 50% 40%, #3a1a22, #11080b 80%);
  box-shadow: 0 0 12px -4px var(--accent);
  image-rendering: pixelated;
  object-fit: cover;
}
.bst-zorbin-texte { grid-column: 2; }
.bst-zorbin-qui {
  grid-column: 2;
  align-self: end;
  display: block;
  font-family: var(--font-title);
  font-style: normal;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 0.15rem;
}

/* Encart des Trois Sœurs, posé dans la scène par le script */
.bst-soeurs {
  position: relative;
  order: -1;
  width: 100%;
  max-width: 460px;
  padding: 0.7rem 0.9rem 0.8rem;
  background: rgba(16, 24, 12, 0.62);
  border: 1px solid rgba(156, 196, 138, 0.28);
  border-radius: 3px;
}
.bst-soeurs-ronces {
  display: block;
  width: 84px;
  height: auto;
  margin: 0 auto 0.3rem;
  opacity: 0.9;
}
.bst-soeurs-titre {
  font-family: var(--font-title);
  font-size: 0.72rem;
  text-align: center;
  color: var(--bst-atout);
  letter-spacing: 0.04em;
  margin-bottom: 0.3rem;
}
.bst-soeurs-texte {
  font-size: 0.7rem;
  line-height: 1.5;
  color: #cfd9c3;
  font-style: italic;
}

/* Texte */
.bst-texte {
  position: relative;
  min-width: 0;
  padding: 1.6rem 1.8rem 1.8rem;
  background: linear-gradient(180deg, rgba(29, 13, 19, 0.94), rgba(27, 16, 19, 0.96));
  border-left: 1px solid var(--bst-bord);
}
.bst-texte::before {
  content: '';
  position: absolute;
  top: 1.7rem;
  left: 0;
  width: 3px;
  height: 3.4rem;
  background: var(--accent);
}

.bst-surtitre {
  font-family: var(--font-title);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
}
.bst-nom {
  font-family: var(--font-title);
  font-size: clamp(1.6rem, 2.4vw, 2.3rem);
  line-height: 1.15;
  color: #fff3e0;
  text-align: left;
  letter-spacing: 0.01em;
  margin: 0.15rem 0 0.9rem;
}

.bst-onglets {
  display: flex;
  gap: 0.3rem;
  border-bottom: 1px solid var(--bst-bord);
  margin-bottom: 1rem;
}
.bst-onglet {
  font-family: var(--font-title);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--bst-doux);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.45rem 0.9rem;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.bst-onglet:hover { color: var(--bst-creme); }
.bst-onglet[aria-selected="true"] {
  color: var(--bst-creme);
  border-bottom-color: var(--accent);
}

.bst-description {
  font-size: 0.86rem;
  line-height: 1.7;
  color: #dccab5;
  margin-bottom: 1.1rem;
}

.bst-blocs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}
.bst-bloc {
  min-width: 0;
  padding: 0.8rem 0.95rem 0.9rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--bst-bord);
  border-radius: 3px;
}
.bst-bloc-butin,
.bst-bloc-chasse { grid-column: 1 / -1; }
.bst-bloc-titre {
  font-family: var(--font-title);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--bst-or);
  margin: 0 0 0.65rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--bst-bord);
}
.bst-bloc p {
  font-size: 0.78rem;
  line-height: 1.6;
  color: #d3c0ab;
}

/* Stats en barres (lignes générées par le script depuis les variables CSS) */
.bst-stats {
  display: grid;
  gap: 0.42rem;
  margin: 0;
}
.bst-stat {
  display: grid;
  grid-template-columns: 1.1rem 5.6rem 1fr 2rem;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.74rem;
}
.bst-stat-picto {
  width: 1.1rem;
  height: 1.1rem;
  object-fit: contain;
  filter: invert(0.85) sepia(0.3);
  opacity: 0.85;
}
.bst-stat-picto-vide {
  display: block;
  width: 0.45rem;
  height: 0.45rem;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--bst-doux);
  opacity: 0.6;
}
.bst-stat dt { color: var(--bst-doux); }
.bst-stat-jauge {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.bst-stat-jauge i {
  display: block;
  height: 100%;
  width: var(--part, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 55%, #3a1a22), var(--accent));
  transition: width 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.bst-stat dd {
  margin: 0;
  text-align: right;
  font-weight: 600;
  color: var(--bst-creme);
}

/* Effets : − danger, + atout, = neutre */
.bst-effets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}
.bst-effet {
  position: relative;
  padding-left: 1.1rem;
  font-size: 0.76rem;
  line-height: 1.5;
  color: #d3c0ab;
}
.bst-effet::before {
  position: absolute;
  left: 0;
  top: 0;
  font-weight: 700;
}
.bst-effet strong { font-weight: 600; }
.bst-effet-danger::before { content: '−'; color: var(--bst-danger); }
.bst-effet-danger strong { color: var(--bst-danger); }
.bst-effet-atout::before { content: '+'; color: var(--bst-atout); }
.bst-effet-atout strong { color: var(--bst-atout); }
.bst-effet-neutre::before { content: '='; color: var(--bst-neutre); }
.bst-effet-neutre strong { color: var(--bst-neutre); }

/* Récompenses exclusives */
.bst-recompenses {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.6rem;
}
.bst-recompense {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
  padding: 0.35rem 0.8rem 0.35rem 0.35rem;
  border: 1px solid var(--bst-bord);
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.25);
}
.bst-recompense img {
  width: 64px;
  height: 64px;
  image-rendering: pixelated;
  border-radius: 4px;
  background: radial-gradient(circle, #2c1a0a, #0f070a 75%);
}
.bst-recompense-legendaire { border-color: rgba(230, 180, 80, 0.5); }
.bst-recompense-legendaire img { box-shadow: inset 0 0 0 1px rgba(230, 180, 80, 0.55), 0 0 12px -4px rgba(230, 180, 80, 0.6); }
.bst-recompense figcaption {
  font-size: 0.74rem;
  color: #f0d9a8;
}

/* Registre de chasse (données réelles du registre) */
.bst-chasse {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}
.bst-chasse-chiffre {
  text-align: center;
  padding: 0.35rem 0.2rem;
}
.bst-chasse-valeur {
  display: block;
  font-family: var(--font-title);
  font-size: 1.35rem;
  line-height: 1.2;
  color: #fff3e0;
}
.bst-chasse-libelle {
  display: block;
  font-size: 0.66rem;
  color: var(--bst-doux);
}
.bst-chasseurs {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 0.7rem;
  margin-top: 0.8rem;
  padding-top: 0.9rem;
}
/* Séparateur en filet dégradé, fondu aux deux bouts (remplace l'ancien trait en pointillés) */
.bst-chasseurs::before {
  content: '';
  position: absolute;
  top: 0;
  left: 8%;
  right: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 70%, transparent), transparent);
  pointer-events: none;
}
.bst-chasseur-carte {
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 0.8rem;
  align-items: start;
  padding: 0.8rem 0.9rem;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 3px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, transparent), rgba(0, 0, 0, 0.25) 65%);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, transform 0.2s;
}
.bst-chasseur-carte:hover { border-color: var(--accent); transform: translateY(-1px); }
.bst-chasseur-carte:focus-visible,
.bst-chasseur-ligne:focus-visible { outline: 2px solid var(--bst-or); outline-offset: 2px; }
.bst-chasseur-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  box-shadow: 0 0 14px -4px var(--accent);
  background: #11080b;
}
.bst-chasseur-rang {
  position: absolute;
  top: 0.55rem;
  left: 0.55rem;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-title);
  font-size: 0.66rem;
  color: #1b1013;
  background: var(--accent);
}
.bst-chasseur-infos {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}
.bst-chasseur-sur {
  font-family: var(--font-title);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
}
.bst-chasseur-nom {
  font-family: var(--font-title);
  font-size: 1.05rem;
  line-height: 1.2;
  color: #fff3e0;
  overflow-wrap: anywhere;
}
.bst-chasseur-role {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--bst-doux);
}
.bst-chasseur-role img { width: 18px; height: 18px; object-fit: contain; }
.bst-chasseur-devise {
  font-size: 0.72rem;
  font-style: italic;
  color: #d3c0ab;
  overflow-wrap: anywhere;
}
.bst-chasseur-exploits {
  font-size: 0.72rem;
  color: #d3c0ab;
  margin-top: 0.2rem;
}
.bst-chasseur-exploits strong { color: var(--bst-creme); font-weight: 600; }
.bst-chasseur-voir {
  font-size: 0.68rem;
  color: var(--accent);
  margin-top: 0.25rem;
}

.bst-chasseurs-suite {
  display: grid;
  /* 2e et 3e centrés verticalement face à la carte du 1er, sans vide en dessous */
  align-content: center;
  gap: 0.45rem;
}
.bst-chasseur-ligne {
  position: relative;
  display: grid;
  grid-template-columns: 1.25rem 36px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 0.55rem;
  align-items: center;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--bst-bord);
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.2);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s;
}
.bst-chasseur-ligne:hover { border-color: var(--bst-bord-fort); }
.bst-chasseur-ligne .bst-chasseur-rang {
  position: static;
  grid-row: span 2;
  background: rgba(168, 137, 90, 0.35);
  color: var(--bst-creme);
}
.bst-chasseur-mini {
  grid-row: span 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--bst-bord-fort);
  background: #11080b;
}
.bst-chasseur-ligne .bst-chasseur-nom { font-size: 0.82rem; }
.bst-chasseur-score { font-size: 0.68rem; color: var(--bst-doux); }
.bst-chasse-vide {
  font-size: 0.78rem;
  font-style: italic;
  color: var(--bst-doux);
}

/* Registre (lore) */
.bst-lore p {
  font-size: 0.86rem;
  line-height: 1.8;
  color: #dccab5;
  margin-bottom: 0.9rem;
}
.bst-lore-vide { font-style: italic; color: var(--bst-doux); }
/* Renvoi d'une fiche vers une autre (« le Mimic Patriarche »). Filet sous le mot,
   jamais de pointillés, et la couleur d'accent de la fiche où le lien est lu. */
.bst-lore a {
  color: var(--accent, var(--bst-or));
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent, var(--bst-or)) 45%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s;
}
.bst-lore a:hover,
.bst-lore a:focus-visible { text-decoration-color: var(--accent, var(--bst-or)); }
.bst-lore a:focus-visible { outline: 2px solid var(--bst-or); outline-offset: 2px; border-radius: 2px; }

/* Guide 00 */
.bst-texte-guide { border-left: none; }
.bst-texte-guide::before { content: none; }
.bst-intro p {
  font-size: 0.9rem;
  line-height: 1.75;
  color: #dccab5;
  margin-bottom: 0.7rem;
  max-width: 70ch;
}
.bst-mecaniques {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.8rem;
  margin-top: 1.3rem;
}
.bst-meca {
  padding: 0.9rem 1rem;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--bst-bord);
  border-radius: 3px;
}
.bst-meca-titre {
  font-family: var(--font-title);
  font-size: 0.86rem;
  color: var(--bst-or);
  margin-bottom: 0.4rem;
}
.bst-meca p {
  font-size: 0.78rem;
  line-height: 1.6;
  color: #d3c0ab;
}
.bst-meca strong { color: var(--bst-creme); }

/* ═══════════ Mise en page interactive (script actif) ═══════════ */

/* Grand écran : trois volets, rien ne défile hors des colonnes */
@media (min-width: 900px) {
  .bst-js.page-bestiaire,
  .bst-js .page-bestiaire { overflow: hidden; }

  .bst-js .bst-ecran {
    display: grid;
    grid-template-columns: clamp(300px, 24vw, 400px) minmax(0, 1fr);
    height: 100vh;
    height: 100dvh;
  }
  .bst-js .bst-liste,
  .bst-js .bst-detail { min-height: 0; }

  .bst-js .bst-fiche {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(240px, 34%) minmax(0, 1fr);
  }
  .bst-js .bst-fiche:not(.est-active) { display: none; }
  .bst-js .bst-fiche.est-active { animation: bst-apparition 0.35s ease both; }

  .bst-js .bst-texte {
    overflow-y: auto;
    border-left: none;
    border-top: 1px solid var(--bst-bord);
    scrollbar-width: thin;
    scrollbar-color: #5a2a33 transparent;
  }
  .bst-js .bst-fiche-guide { grid-template-rows: minmax(0, 1fr); }
  /* bandeau horizontal : Zorbin et l'encart à côté du sprite plutôt qu'en dessous */
  .bst-js .bst-scene { flex-direction: row; flex-wrap: wrap; align-content: center; }
  .bst-js .bst-texte-guide { border-top: none; background: rgba(27, 16, 19, 0.82); }
}

@media (min-width: 1280px) {
  .bst-js .bst-fiche {
    grid-template-columns: clamp(360px, 40%, 680px) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }
  .bst-js .bst-texte { padding: 1.8rem clamp(1.8rem, 3vw, 3.2rem) 2rem; }
  .bst-js .bst-texte {
    border-top: none;
    border-left: 1px solid var(--bst-bord);
  }
  .bst-js .bst-fiche-guide { grid-template-columns: minmax(0, 1fr); }
  .bst-js .bst-scene { flex-direction: column; flex-wrap: nowrap; }
  .bst-js .bst-texte-guide { padding: 2.4rem clamp(2rem, 5vw, 5rem); }
  .bst-js .bst-mecaniques { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 1200px; }
}

/* ── Aperçu d'objet au survol (Dynamite, Bâton lumineux, couvre-chefs, fleurs des Sœurs) ──
   Déclencheur : le nom dans le texte, couleur de rareté, filet plein (jamais de pointillés).
   Carte : une seule, positionnée par le script près du déclencheur, jamais hors de l'écran. */
.bst-objet {
  --rarete: var(--bst-or);
  font: inherit;
  font-weight: 600;
  color: var(--rarete);
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--rarete) 55%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s;
}
.bst-objet:hover,
.bst-objet:focus-visible,
.bst-objet[aria-expanded="true"] { text-decoration-color: var(--rarete); }
.bst-objet:focus-visible { outline: 2px solid var(--bst-or); outline-offset: 2px; border-radius: 2px; }
.bst-recompense[data-objet]:focus-visible { outline: 2px solid var(--bst-or); outline-offset: 2px; }

.bst-rarete-common    { --rarete: #b9a79c; }
.bst-rarete-uncommon  { --rarete: #6fb482; }
.bst-rarete-rare      { --rarete: #6f9fd6; }
.bst-rarete-epic      { --rarete: #b886d0; }
.bst-rarete-legendary { --rarete: #ffb347; }
.bst-rarete-cursed    { --rarete: #e3606f; }

/* Pas de --rarete ici : la classe .bst-rarete-* posée par le script doit gagner (elle est déclarée plus haut). */
.bst-apercu {
  position: fixed;
  z-index: 2000;
  width: min(320px, calc(100vw - 24px));
  padding: 0.8rem 0.9rem 0.9rem;
  background: linear-gradient(180deg, #25101a, #13090d);
  border: 1px solid color-mix(in srgb, var(--rarete) 55%, transparent);
  border-radius: 3px;
  box-shadow: 0 14px 30px -10px rgba(0, 0, 0, 0.8), 0 0 18px -10px var(--rarete);
  color: var(--bst-creme);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.bst-apercu.est-visible { opacity: 1; transform: none; }
.bst-apercu-tete {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
}
.bst-apercu-icone {
  width: 64px;
  height: 64px;
  image-rendering: pixelated;
  border-radius: 6px;
  background: radial-gradient(circle at 50% 45%, #3a1a22, #10070a 78%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rarete) 45%, transparent);
}
.bst-apercu-nom {
  display: block;
  font-family: var(--font-title);
  font-size: 1rem;
  line-height: 1.2;
  color: #fff3e0;
}
.bst-apercu-rarete {
  display: inline-block;
  margin-top: 0.3rem;
  padding: 0.05rem 0.5rem;
  border-radius: 3px;
  font-family: var(--font-title);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--rarete);
  background: color-mix(in srgb, var(--rarete) 14%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rarete) 40%, transparent);
}
.bst-apercu-combat {
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--bst-bord);
  font-size: 0.74rem;
  line-height: 1.5;
}
.bst-apercu-combat strong { color: var(--bst-atout); font-weight: 600; }
.bst-apercu-malus { color: var(--bst-danger); }
.bst-apercu-desc {
  margin-top: 0.55rem;
  font-size: 0.74rem;
  line-height: 1.55;
  font-style: italic;
  color: #d3c0ab;
  display: -webkit-box;
  -webkit-line-clamp: 7;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@keyframes bst-apparition {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* Mobile : la liste, puis la fiche en plein écran.
   Ordre de lecture : sprite, nom et texte, puis le mot de Zorbin et l'encart des Sœurs. */
@media (max-width: 899px) {
  .bst-js .bst-fiche { display: flex; flex-direction: column; }
  .bst-js .bst-fiche:not(.est-active) { display: none; }
  .bst-js .bst-scene { display: contents; }
  .bst-js .bst-scene::after { content: none; }
  .bst-js .bst-sprite { order: 1; align-self: center; margin: 2.2rem auto 1.2rem; }
  .bst-js .bst-texte { order: 2; }
  .bst-js .bst-zorbin { order: 3; margin: 0 1rem 1rem; }
  .bst-js .bst-soeurs { order: 4; margin: 0 1rem 2rem; }
  .bst-js .bst-filigrane { top: 3.2rem; }

  .bst-liste { border-right: none; }
  .bst-scene { min-height: 280px; }
  .bst-zorbin { position: relative; left: auto; bottom: auto; transform: none; width: auto; margin: 0 1rem 1rem; }
  .bst-scene { flex-direction: column; justify-content: flex-end; gap: 1rem; padding-top: 2.5rem; }
  .bst-soeurs { position: relative; top: auto; left: auto; width: auto; margin: 0 1rem; order: 3; }
  .bst-texte { border-left: none; padding: 1.3rem 1rem 2rem; }
  .bst-blocs { grid-template-columns: minmax(0, 1fr); }
  .bst-chasseurs { grid-template-columns: minmax(0, 1fr); }
  .bst-stat { grid-template-columns: 1.1rem 6.4rem minmax(0, 1fr) 2rem; }
  .bst-astuce { display: none; }

  .bst-js .bst-detail {
    position: fixed;
    top: var(--bst-nav);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    overflow-y: auto;
    background: var(--bst-fond);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.3s ease, visibility 0s linear 0.3s;
  }
  .bst-js.bst-fiche-ouverte .bst-detail {
    transform: none;
    visibility: visible;
    transition: transform 0.3s ease;
  }
  .bst-js.bst-fiche-ouverte body { overflow: hidden; }
  .bst-js .bst-fiche:not(.est-active) { display: none; }
  .bst-js .bst-retour-liste {
    display: block;
    position: sticky;
    top: 0;
    z-index: 5;
    width: 100%;
    padding: 0.75rem 1rem;
    text-align: left;
    font-family: var(--font-title);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    color: var(--bst-creme);
    background: #1d0d13;
    box-shadow: 0 6px 12px -8px rgba(0, 0, 0, 0.8);
    border: none;
    border-bottom: 1px solid var(--bst-bord);
    cursor: pointer;
  }
  .bst-js .bst-retour-liste:focus { outline: none; }
  .bst-js .bst-retour-liste:focus-visible { outline: 2px solid var(--bst-or); outline-offset: -3px; }
  .bst-ambiance { display: none; }
}

/* Sans script : fiches empilées, séparées */
html:not(.bst-js) .bst-fiche {
  border-top: 1px solid var(--bst-bord);
}
html:not(.bst-js) .bst-onglets { display: none; }
html:not(.bst-js) .bst-volet[hidden] { display: block; }

@media (prefers-reduced-motion: reduce) {
  .bst-js .bst-fiche.est-active { animation: none; }
  .bst-stat-jauge i,
  .bst-js .bst-detail { transition: none; }
}
