/* V447 — LES AFFICHES VS : l'affiche d'avant-combat (calque posé sur l'arène) et l'album (le mur des 78 affiches).
   Tout est borné par .af-avant-combat, .af-couche et .af-entree-coffret ; chaque racine est son propre
   conteneur (unités cq*), rien ne dépend de paysage-mobile.css. */

/* ---------- L'AFFICHE D'AVANT-COMBAT ---------- */
.af-avant-combat {
  position: absolute;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  overflow: hidden;
  container-type: size;
  background: #05060a;
  color: #ffffff;
  font-family: var(--tl-ui, "Barlow", "Segoe UI", system-ui, sans-serif);
  opacity: 0;
  transition: opacity 0.26s ease;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.af-avant-combat[hidden] { display: none; }
.af-avant-combat.af-montre { opacity: 1; }
.af-avant-combat .af-fond {
  position: absolute;
  inset: -8%;
  background-position: center;
  background-size: cover;
  filter: blur(22px) saturate(1.15) brightness(0.6);
}
.af-avant-combat::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, rgba(4, 5, 10, 0.82), rgba(4, 5, 10, 0.2) 50%, rgba(4, 5, 10, 0.82));
  pointer-events: none;
}
.af-avant-combat .af-affiche {
  position: relative;
  z-index: 2;
  grid-column: 2;
  width: auto;
  height: 94cqh;
  aspect-ratio: 9 / 16;
  object-fit: contain;
  border: max(2px, 0.4cqh) solid rgba(255, 255, 255, 0.86);
  background: #000000;
  box-shadow: 0 2cqh 7cqh rgba(0, 0, 0, 0.78);
  opacity: 0;
  transform: translateY(6cqh) scale(1.05);
  transition: transform 0.55s var(--tl-sortie, cubic-bezier(0.16, 1, 0.3, 1)), opacity 0.3s ease;
}
.af-avant-combat.af-montre .af-affiche { opacity: 1; transform: none; }
.af-avant-combat .af-cote {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 2cqh;
  min-width: 0;
  padding: 0 2.5cqw;
  text-align: center;
  opacity: 0;
  transition: transform 0.5s var(--tl-sortie, cubic-bezier(0.16, 1, 0.3, 1)) 0.12s, opacity 0.35s ease 0.12s;
}
.af-avant-combat .af-cote-gauche { grid-column: 1; transform: translateX(-5cqw); }
.af-avant-combat .af-cote-droite { grid-column: 3; transform: translateX(5cqw); }
.af-avant-combat.af-montre .af-cote { opacity: 1; transform: none; }
.af-avant-combat .af-joueur {
  padding: 0.42em 1em 0.36em;
  border-radius: 99px;
  background: var(--af-couleur, #ffffff);
  color: #05060a;
  font: 900 clamp(11px, 4cqh, 34px) / 1 "Arial Black", var(--tl-ui, Arial, sans-serif);
  letter-spacing: 0.08em;
}
.af-avant-combat .af-cote strong {
  max-width: 100%;
  padding-bottom: 0.2em;
  border-bottom: max(3px, 0.8cqh) solid var(--af-couleur, #ffffff);
  font: 900 clamp(15px, min(8.5cqh, 3.9cqw), 84px) / 1.04 "Arial Black", var(--tl-ui, Arial, sans-serif);
  text-transform: uppercase;
  text-wrap: balance;
  overflow-wrap: anywhere;
  text-shadow: 0 0.07em 0 rgba(3, 4, 8, 0.92), 0 0 0.55em rgba(0, 0, 0, 0.85);
}
.af-avant-combat .af-bandeau,
.af-avant-combat .af-passer {
  position: absolute;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.35s ease 0.2s;
}
.af-avant-combat.af-montre .af-bandeau,
.af-avant-combat.af-montre .af-passer { opacity: 1; }
.af-avant-combat .af-bandeau {
  top: 5cqh;
  left: 2.5cqw;
  color: rgba(255, 255, 255, 0.86);
  font: 400 clamp(7px, 2.5cqh, 20px) / 1.2 var(--tl-pixel, "Press Start 2P", ui-monospace, monospace);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.af-avant-combat .af-bandeau.af-nouveau { color: #ffd166; }
.af-avant-combat .af-passer {
  right: 2.5cqw;
  bottom: 4.5cqh;
  color: rgba(255, 255, 255, 0.66);
  font-size: clamp(10px, 2.9cqh, 18px);
  font-weight: 600;
}
.mfx-calme .af-avant-combat .af-affiche,
.mfx-calme .af-avant-combat .af-cote { transform: none; transition: opacity 0.2s ease; }
@media (prefers-reduced-motion: reduce) {
  .af-avant-combat .af-affiche,
  .af-avant-combat .af-cote { transform: none; transition: opacity 0.2s ease; }
}

/* ---------- L'ENTRÉE DE L'ALBUM, DANS LE COFFRET ---------- */
.coffret-band > .af-entree-coffret {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  margin-top: 10px;   /* les trois compteurs du Coffret ne touchent pas le bouton */
  padding: 10px 14px;
  border: 1px solid rgba(255, 209, 102, 0.5);
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(255, 209, 102, 0.14), rgba(255, 255, 255, 0.03));
  color: #fff9e6;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.coffret-band > .af-entree-coffret strong { color: #ffd166; font-size: 1.1em; }
.coffret-band > .af-entree-coffret:hover,
.coffret-band > .af-entree-coffret:focus-visible { border-color: #ffd166; background: rgba(255, 209, 102, 0.22); }
.coffret-band > .af-entree-coffret:focus-visible { outline: 3px solid #ffffff; outline-offset: 2px; }

/* ---------- L'ALBUM : LE MUR DES AFFICHES ---------- */
.af-couche {
  --af-or: #ffd166;
  --af-rouge: #ff5c6c;
  --af-encre: #08070d;
  position: fixed;
  inset: 0;
  z-index: 10043;
  display: grid;
  padding: 12px;
  background:
    radial-gradient(circle at 50% -10%, rgba(255, 209, 102, 0.16), transparent 46%),
    rgba(5, 4, 9, 0.97);
  color: var(--tl-texte, #eef1f6);
  font-family: var(--tl-ui, "Barlow", "Segoe UI", system-ui, sans-serif);
}
.af-couche.hidden { display: none !important; }
/* Le cadre de l'album est le conteneur de mesure (cqw / cqh) ; sa grille est l'élément d'en dessous,
   parce qu'une requête de conteneur ne peut pas restyler le conteneur lui-même. */
.af-racine {
  position: relative;
  container: af / size;
  box-sizing: border-box;
  width: min(1320px, 100%);
  height: 100%;
  min-height: 0;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(255, 209, 102, 0.42);
  border-radius: 16px;
  background: linear-gradient(180deg, #14101c, #08070d 55%);
  box-shadow: 0 0 60px rgba(255, 189, 39, 0.12);
}
.af-grille {
  box-sizing: border-box;
  display: grid;
  /* Les combattants (ou les genres) en colonne à gauche, le mur d'affiches à droite. */
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  grid-template-areas: "entete entete" "onglets onglets" "puces salle" "pied pied";
  gap: 10px 14px;
  height: 100%;
  min-height: 0;
  padding: 14px 16px 10px;
}
.af-entete { grid-area: entete; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 14px; }
.af-retour { min-height: 44px; }
/* Le fronton : un caisson lumineux bordé d'ampoules, comme au-dessus d'une salle. */
.af-fronton {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 8px 18px 7px;
  border-radius: 10px;
  background:
    radial-gradient(circle at 8px 4px, var(--af-or) 0 2.2px, transparent 2.8px) 0 0 / 16px 8px repeat-x,
    linear-gradient(180deg, #2a2030, #17121f);
  box-shadow: inset 0 0 0 1px rgba(255, 209, 102, 0.35);
}
.af-kicker { margin-top: 5px; color: var(--af-or); font: 400 9px / 1 var(--tl-pixel, "Press Start 2P", monospace); letter-spacing: 0.12em; }
.af-fronton h2 { margin: 0; color: #fff7de; font-size: clamp(20px, 3.4cqw, 34px); font-weight: 800; letter-spacing: 0.12em; line-height: 1.1; }
.af-compte { display: flex; align-items: baseline; gap: 5px; color: var(--tl-texte-2, #b0b9c9); font-size: 15px; }
.af-compte strong { color: var(--af-or); font-size: 30px; line-height: 1; }
.af-credits { padding: 7px 12px; border: 1px solid var(--tl-ligne-forte, #3b4964); border-radius: 8px; background: rgba(255, 255, 255, 0.04); font-weight: 700; white-space: nowrap; }

.af-onglets { grid-area: onglets; display: flex; gap: 6px; min-width: 0; overflow-x: auto; scrollbar-width: thin; }
.af-puces { grid-area: puces; display: flex; flex-direction: column; gap: 4px; width: 204px; min-height: 0; padding: 2px 4px 2px 2px; overflow-x: hidden; overflow-y: auto; scrollbar-width: thin; }
/* L'habillage des boutons du jeu (styles.css : « button », et l'habillage arcade
   « body[data-ui-skin="arcade"] .app-shell button », plus fort qu'une classe : fond, bordure, capitales,
   ombre, enfoncement) repeindrait ceux de l'album — l'onglet choisi ne se verrait plus. Leurs règles
   passent donc par #albumAffichesV447. Le bouton « Retour », lui, reste celui du jeu. */
#albumAffichesV447 :is(.af-onglet, .af-puce, .af-bouton, .af-carte) { letter-spacing: normal; text-transform: none; box-shadow: none; }
#albumAffichesV447 :is(.af-onglet, .af-puce, .af-bouton, .af-carte):active { transform: none; box-shadow: none; }
#albumAffichesV447 :is(.af-onglet, .af-puce, .af-bouton) {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 7px 13px;
  border: 1px solid var(--tl-ligne-forte, #3b4964);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--tl-texte, #eef1f6);
  font: 600 14px / 1.15 var(--tl-ui, "Barlow", system-ui, sans-serif);
  cursor: pointer;
}
.af-onglet b, .af-puce b { margin-left: 4px; color: var(--tl-texte-3, #8691a4); font-weight: 600; }
#albumAffichesV447 .af-onglet.selected { border-color: var(--af-or); background: var(--af-or); color: #1b1300; font-weight: 800; }
.af-onglet.selected b { color: #1b1300; }
#albumAffichesV447 .af-puce { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 34px; padding: 4px 11px; font-size: 13px; text-align: left; }
#albumAffichesV447 .af-puce.selected { border-color: var(--af-or); background: rgba(255, 209, 102, 0.16); color: #fff7de; }
.af-puce.af-complete b { color: var(--af-or); }
.af-puce.af-complete b::before { content: "★ "; }
#albumAffichesV447 :is(.af-onglet, .af-puce, .af-bouton):is(:hover, :focus-visible) { border-color: var(--af-or); }
#albumAffichesV447 :is(.af-puce, .af-bouton):is(:hover, :focus-visible) { background: rgba(255, 209, 102, 0.1); }
#albumAffichesV447 .af-puce.selected:is(:hover, :focus-visible) { background: rgba(255, 209, 102, 0.2); }
#albumAffichesV447 .af-onglet:not(.selected):is(:hover, :focus-visible) { background: rgba(255, 209, 102, 0.1); }
#albumAffichesV447 .af-onglet.selected:is(:hover, :focus-visible) { background: var(--af-or); }
.af-couche :is(button, select):focus-visible { outline: 3px solid #ffffff; outline-offset: 2px; }

.af-salle { grid-area: salle; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 8px; min-height: 0; }
.af-vue-vente .af-salle { grid-column: 1 / -1; }
.af-regle { margin: 0; color: var(--tl-texte-2, #b0b9c9); font-size: 14px; line-height: 1.35; }
/* Le mur : la largeur d'une affiche (--af-l) est calculée pour que tout le mur tienne sans défiler —
   deux rangées de six pour un combattant (12 affiches), deux de quatre pour un genre (7 ou 8),
   une rangée de quatre, plus grandes, pour la vente de la semaine. */
.af-mur {
  --af-colonnes: 6;
  --af-l: clamp(84px, min((100cqh - 368px) * 0.28125, (100cqw - 344px) / 6), 190px);
  display: grid;
  grid-template-columns: repeat(var(--af-colonnes), var(--af-l));
  justify-content: center;
  align-content: start;
  gap: 14px 12px;
  min-height: 0;
  padding: 4px 4px 10px;
  overflow-y: auto;
  scrollbar-width: thin;
}
/* Par genre, le titre complet (« Mister VHS vs Capitaine Corner ») tient sur deux lignes : le mur en tient compte. */
.af-mur-genre { --af-colonnes: 4; --af-l: clamp(84px, min((100cqh - 404px) * 0.28125, (100cqw - 344px) / 6), 190px); }
.af-mur-genre .af-nom { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; min-height: 2.4em; white-space: normal; text-wrap: balance; }
.af-mur-vente { --af-colonnes: 4; --af-l: clamp(96px, min((100cqh - 374px) * 0.5625, (100cqw - 122px) / 4), 250px); }
#albumAffichesV447 .af-carte {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 4px;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: center;
  cursor: pointer;
}
#albumAffichesV447 .af-carte:is(:hover, :focus-visible) { border: 0; background: none; }
.af-cadre {
  display: block;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border: 3px solid #2c2436;
  border-radius: 4px;
  background: #000000;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.55);
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.af-cadre img { display: block; width: 100%; height: 100%; object-fit: cover; }
.af-carte:hover .af-cadre, .af-carte:focus-visible .af-cadre { transform: translateY(-3px); border-color: var(--af-or); }
.af-carte.af-a-moi .af-cadre { border-color: #b98a2f; }
/* À gagner : la silhouette de l'affiche, pas l'affiche. */
.af-carte.af-a-gagner .af-cadre img { filter: grayscale(1) brightness(0.36) contrast(1.2) blur(2.5px); transform: scale(1.06); }
.af-carte.af-a-gagner .af-cadre { position: relative; }
.af-carte.af-a-gagner .af-cadre::after { content: "?"; position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255, 255, 255, 0.4); font: 400 22px / 1 var(--tl-pixel, "Press Start 2P", monospace); }
.af-carte.af-en-vente .af-cadre { border-color: var(--af-rouge); }
.af-nom { overflow: hidden; font-size: 13px; font-weight: 700; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.af-etat { color: var(--tl-texte-3, #8691a4); font-size: 12px; font-weight: 600; }
.af-a-moi .af-etat { color: var(--af-or); }
.af-en-vente .af-etat { color: var(--af-rouge); font-weight: 800; }

.af-pied { grid-area: pied; display: flex; align-items: center; gap: 16px; padding-top: 8px; border-top: 1px solid var(--tl-ligne, #263042); color: var(--tl-texte-3, #8691a4); font-size: 13px; }
.af-pied p { margin: 0; }
.af-reglage { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; color: var(--tl-texte, #eef1f6); font-weight: 600; }
.af-reglage select { min-height: 40px; padding: 6px 10px; border: 1px solid var(--tl-ligne-forte, #3b4964); border-radius: 8px; background: #14101c; color: inherit; font: inherit; }

/* La fiche : l'affiche en grand, au-dessus du mur. */
.af-fiche {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: auto minmax(0, 420px);
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 3cqw, 40px);
  padding: 2.5cqh 3cqw;
  background: rgba(5, 4, 9, 0.95);
}
.af-fiche-image { height: 93cqh; aspect-ratio: 9 / 16; overflow: hidden; border: 3px solid #b98a2f; border-radius: 4px; background: #000000; box-shadow: 0 16px 50px rgba(0, 0, 0, 0.75); }
.af-fiche-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
.af-fiche-image.af-voilee { border-color: #2c2436; }
.af-fiche-image.af-voilee img { object-fit: cover; filter: grayscale(1) brightness(0.22) contrast(1.25) blur(9px); transform: scale(1.1); }
.af-fiche-texte { display: grid; gap: 10px; align-content: center; min-width: 0; }
.af-genre { color: var(--af-or); font: 400 10px / 1.3 var(--tl-pixel, "Press Start 2P", monospace); letter-spacing: 0.08em; text-transform: uppercase; }
.af-fiche-texte h3 { margin: 0; color: #fff7de; font-size: clamp(22px, 5cqh, 40px); font-weight: 800; line-height: 1.08; text-wrap: balance; }
.af-accroche { margin: 0; color: var(--tl-texte, #eef1f6); font-size: 17px; font-style: italic; }
.af-comment, .af-manque { margin: 0; color: var(--tl-texte-2, #b0b9c9); font-size: 15px; line-height: 1.4; }
.af-manque { color: var(--af-rouge); }
#albumAffichesV447 .af-bouton.af-acheter,
#albumAffichesV447 .af-bouton.af-acheter:is(:hover, :focus-visible) { min-height: 48px; border-color: var(--af-or); background: var(--af-or); color: #1b1300; font-size: 16px; font-weight: 800; }
#albumAffichesV447 .af-bouton.af-acheter:hover { filter: brightness(1.08); }
.af-fiche-nav { display: flex; gap: 8px; margin-top: 6px; }
#albumAffichesV447 .af-fiche-nav .af-bouton { min-width: 44px; min-height: 44px; }

/* Écran étroit (≤ 980 px de large) : la fiche se replie. */
@container af (max-width: 980px) {
  .af-fiche { grid-template-columns: auto minmax(0, 1fr); }
}
/* Écran étroit (≤ 760 px de large) ou bas (≤ 420 px de haut) : les combattants repassent en rangée
   défilante au-dessus du mur, qui reprend toute la largeur. */
@container af ((max-width: 760px) or (max-height: 420px)) {
  .af-grille { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto minmax(0, 1fr) auto; grid-template-areas: "entete" "onglets" "puces" "salle" "pied"; }
  .af-puces { flex-direction: row; width: auto; padding: 0 0 2px; overflow-x: auto; overflow-y: hidden; }
  #albumAffichesV447 .af-puce { flex: 0 0 auto; justify-content: flex-start; }
  .af-mur, .af-mur-vente { --af-l: auto; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); justify-content: stretch; }
  .af-credits { padding: 5px 8px; font-size: 13px; }
}
/* Téléphone en paysage (≤ 420 px de haut) : tout tient sans défiler, le mur devient une rangée. */
@container af (max-height: 420px) {
  .af-entete { gap: 8px; }
  .af-fronton { padding: 6px 12px 3px; }
  .af-fronton h2 { font-size: 16px; }
  .af-kicker { display: none; }
  .af-compte strong { font-size: 20px; }
  #albumAffichesV447 .af-onglet { min-height: 34px; padding: 4px 10px; font-size: 13px; }
  #albumAffichesV447 .af-puce { min-height: 32px; padding: 3px 9px; font-size: 12px; }
  .af-regle, .af-pied p { display: none; }
  .af-salle { grid-template-rows: minmax(0, 1fr); }
  .af-mur, .af-mur-vente { grid-auto-flow: column; grid-auto-columns: 96px; grid-template-columns: none; grid-template-rows: minmax(0, 1fr); justify-content: start; gap: 8px; overflow-x: auto; overflow-y: hidden; padding-bottom: 4px; }
  #albumAffichesV447 .af-carte { grid-template-rows: minmax(0, 1fr) auto auto; }
  .af-cadre { height: 100%; width: auto; justify-self: center; max-width: 100%; }
  .af-nom { font-size: 11px; }
  .af-etat { font-size: 10px; }
  .af-pied { padding-top: 4px; }
  .af-reglage select { min-height: 32px; padding: 2px 8px; }
  .af-fiche-texte h3 { font-size: 20px; }
  .af-accroche { font-size: 14px; }
  .af-comment, .af-manque { font-size: 12px; }
}
.af-couche.af-calme .af-cadre { transition: none; }
@media (prefers-reduced-motion: reduce) { .af-cadre { transition: none; } }
