/* Taxes & Furious : dossier administratif détourné, façon bande dessinée.
   Fond clair, couleurs en dur, aucune ressource distante (polices système). */

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  /* Contexte de formatage propre : la marge de <main> (panneau sur décor) ne déborde pas du body,
     sinon elle s'ajoute à min-height et fait défiler un écran qui tient dans la fenêtre. */
  display: flow-root;
  color: #2b2118;
  background-color: #f4ead5;
  /* Papier : fines lignes de cahier, sans image externe. */
  background-image:
    repeating-linear-gradient(0deg, rgba(120, 90, 50, 0.07) 0 1px, transparent 1px 28px),
    radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.6), transparent 60%);
  font-family: "Segoe UI", "Trebuchet MS", system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  overflow-x: hidden;
}

main {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

[hidden] { display: none !important; }

/* ------------------------------------------------------------ décor illustré (EX-150, EX-151) */
/* Fond de l'écran (object-fit: cover), décoratif. Le contenu reste sur un panneau opaque : le texte
   ne se lit jamais directement sur l'image. Fondu de 250 ms, coupé sous prefers-reduced-motion. */

.decor {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.decor-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 250ms ease-in-out;
}
.decor-image.decor-visible { opacity: 1; }
.decor-image:not([src]) { display: none; }

body.avec-decor main {
  margin: 32px auto;
  background: #fffaf0;
  border: 3px solid #2b2118;
  border-radius: 14px;
  box-shadow: 6px 6px 0 #2b2118;
}

@media (prefers-reduced-motion: reduce) {
  .decor-image { transition: none; }
}

h1, h2, h3, h4 {
  font-family: "Comic Sans MS", "Chalkboard SE", "Comic Neue", "Segoe Print", "Trebuchet MS", sans-serif;
  line-height: 1.2;
  margin: 0 0 12px;
}

:focus { outline: none; }
:focus-visible {
  outline: 4px solid #1f5fbf;
  outline-offset: 3px;
  border-radius: 6px;
}
/* Titres focalisés par le script (lecteurs d'écran) : pas de cadre, ce ne sont pas des commandes. */
[tabindex="-1"]:focus-visible { outline: none; }

.chargement { text-align: center; font-style: italic; color: #6b5640; }

/* ------------------------------------------------------------ boutons */

.bouton {
  display: inline-block;
  font: inherit;
  font-weight: 700;
  color: #2b2118;
  background: #fffaf0;
  border: 3px solid #2b2118;
  border-radius: 10px;
  padding: 10px 20px;
  box-shadow: 4px 4px 0 #2b2118;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.bouton:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 #2b2118; }
.bouton:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 #2b2118; }
.bouton-principal { background: #f7c948; }
.bouton-discret { box-shadow: none; border-width: 2px; background: transparent; margin-top: 20px; }

/* ------------------------------------------------------------ chemise (titre, fin) */

.chemise {
  position: relative;
  max-width: 720px;
  margin: 24px auto 0;
  padding: 48px 28px 36px;
  background: #d9b98a;
  background-image: repeating-linear-gradient(45deg, rgba(90, 60, 20, 0.05) 0 6px, transparent 6px 12px);
  border: 3px solid #2b2118;
  border-radius: 6px 18px 6px 6px;
  box-shadow: 6px 6px 0 #2b2118;
  text-align: center;
}
.chemise::before {
  /* onglet de la chemise */
  content: "";
  position: absolute;
  top: -22px;
  left: 28px;
  width: 160px;
  height: 22px;
  background: #d9b98a;
  border: 3px solid #2b2118;
  border-bottom: none;
  border-radius: 10px 10px 0 0;
}
.chemise-etiquette {
  display: inline-block;
  margin: 0 0 18px;
  padding: 4px 12px;
  background: #fffaf0;
  border: 2px solid #2b2118;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.titre-jeu {
  font-size: clamp(2.2rem, 7vw, 4rem);
  color: #2b2118;
  text-shadow: 3px 3px 0 #fffaf0;
}
.sous-titre { font-size: 1.15rem; margin: 0 0 24px; }

.tampon {
  display: inline-block;
  margin: 0 0 24px;
  padding: 4px 14px;
  border: 4px double currentColor;
  border-radius: 8px;
  font-family: "Courier New", Courier, monospace;
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transform: rotate(-6deg);
  opacity: 0.88;
}
.tampon-rouge { color: #b3261e; }

.avertissement {
  max-width: 720px;
  margin: 28px auto 0;
  padding: 10px 14px;
  background: #fffaf0;
  border: 2px dashed #6b5640;
  font-size: 0.9rem;
  text-align: center;
}

/* ------------------------------------------------------------ choix du profil */

.titre-ecran { font-size: clamp(1.6rem, 5vw, 2.4rem); text-align: center; }
.consigne { text-align: center; margin: 0 0 20px; }

.liste-profils {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 20px;
}
.carte-case { display: flex; }
.carte-profil {
  position: relative;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  width: 100%;
  min-width: 0;
  padding: 18px 16px 16px;
  font: inherit;
  text-align: left;
  color: #2b2118;
  background: #fffaf0;
  border: 3px solid #2b2118;
  border-radius: 10px;
  box-shadow: 5px 5px 0 #2b2118;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.carte-profil:hover { transform: translate(-2px, -2px) rotate(-0.4deg); box-shadow: 7px 7px 0 #2b2118; }
.carte-trombone {
  position: absolute;
  top: -12px;
  right: 22px;
  width: 16px;
  height: 36px;
  border: 3px solid #7d8a99;
  border-radius: 8px;
}
.carte-portrait {
  flex: 0 0 auto;
  width: 88px;
  height: 88px;
  border: 2px solid #2b2118;
  border-radius: 8px;
  background: #e3f6f5;
}
.carte-texte { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.carte-nom { font-weight: 800; font-size: 1.1rem; }
.carte-entreprise { font-style: italic; color: #6b3d12; }
.carte-accroche { font-size: 0.95rem; }
.carte-meilleur {
  align-self: flex-start;
  margin-top: 6px;
  padding: 2px 8px;
  border: 2px solid #1e6b3a;
  border-radius: 6px;
  color: #1e6b3a;
  font-size: 0.85rem;
  font-weight: 700;
}
.indisponibles { text-align: center; font-size: 0.85rem; color: #6b5640; font-style: italic; margin-top: 16px; }
#ecran-choix { text-align: center; }
#ecran-choix .liste-profils { text-align: left; }

/* ------------------------------------------------------------ partie : bandeau et jauges */

.bandeau {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: stretch;
  justify-content: space-between;
  padding: 12px 14px;
  margin-bottom: 20px;
  background: #fffaf0;
  border: 3px solid #2b2118;
  border-radius: 10px;
  box-shadow: 4px 4px 0 #2b2118;
}
.bandeau-dossier { flex: 1 1 220px; min-width: 0; display: flex; align-items: flex-start; gap: 12px; }
.bandeau-titres { flex: 1 1 auto; min-width: 0; }
.bandeau-profil { margin: 0; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; color: #6b3d12; }
.bandeau-chapitre { margin: 2px 0 0; font-size: 1.3rem; }

/* ------------------------------------------------------------ retour à l'accueil (EX-130) */

.bouton-accueil { flex: 0 0 auto; padding: 6px 14px; font-size: 0.9rem; box-shadow: 3px 3px 0 #2b2118; }
.entete-fin { display: flex; justify-content: flex-end; }

.boite {
  width: min(440px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  padding: 24px 20px 20px;
  color: #2b2118;
  background: #fffaf0;
  border: 3px solid #2b2118;
  border-radius: 10px;
  box-shadow: 6px 6px 0 #2b2118;
}
.boite::backdrop { background: rgba(43, 33, 24, 0.55); }
.boite-texte { margin: 0 0 20px; font-size: 1.1rem; font-weight: 700; }
.boite-boutons { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; }
.boite-boutons .bouton { flex: 0 1 auto; }

.jauges { display: flex; flex-wrap: wrap; gap: 10px; flex: 2 1 420px; min-width: 0; }
.jauge {
  flex: 1 1 120px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 10px;
  border: 2px solid #2b2118;
  border-radius: 8px;
  background: #f4ead5;
}
.jauge-libelle { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700; }
.jauge-montant { font-family: "Courier New", Courier, monospace; font-size: 1.35rem; font-weight: 700; color: #b3261e; }
.jauge-chiffre { font-family: "Courier New", Courier, monospace; font-weight: 700; font-size: 0.95rem; }

/* Thermomètre : tube horizontal + réservoir. */
.thermo {
  position: relative;
  display: block;
  height: 16px;
  margin-left: 12px;
  background: #fffaf0;
  border: 2px solid #2b2118;
  border-radius: 0 10px 10px 0;
}
.thermo::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 50%;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
  border: 2px solid #2b2118;
  border-radius: 50%;
  background: var(--couleur-jauge, #1e6b3a);
}
.thermo-niveau {
  position: absolute;
  inset: 2px auto 2px 0;
  width: var(--niveau, 0%);
  background: var(--couleur-jauge, #1e6b3a);
  border-radius: 0 6px 6px 0;
  transition: width 0.35s ease;
}
[data-jauge="patience"] { --couleur-jauge: #1e6b3a; }
[data-jauge="stress"] { --couleur-jauge: #c46a12; }
[data-jauge="patience"].jauge-alerte { --couleur-jauge: #b3261e; }
[data-jauge="stress"].jauge-alerte { --couleur-jauge: #b3261e; }
.jauge-alerte { background: #fde3df; }

/* ------------------------------------------------------------ scène */

.scene, .encadre {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px 22px;
  align-items: start;
}
.orateur { grid-column: 1; grid-row: 1 / span 3; }
.orateur-figure { margin: 0; text-align: center; }
.orateur .portrait {
  display: block;
  width: 140px;
  height: 140px;
  margin: 0 auto;
  border: 3px solid #2b2118;
  border-radius: 12px;
  background: #e3f6f5;
  box-shadow: 4px 4px 0 #2b2118;
}
.orateur-nom { margin-top: 8px; font-weight: 800; font-size: 0.95rem; }
/* Repli d'un portrait introuvable (EX-152) : initiales dans un disque, aux dimensions du portrait. */
.portrait-initiales {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50% !important;
  background: #6b3d12 !important;
  color: #fffaf0;
  font-weight: 800;
  font-size: 2.2rem;
  letter-spacing: 0.04em;
}
.carte-portrait.portrait-initiales { font-size: 1.6rem; }
.orateur-narrateur { display: none; }

.bulle {
  grid-column: 2;
  position: relative;
  padding: 16px 18px;
  background: #ffffff;
  border: 3px solid #2b2118;
  border-radius: 18px;
  box-shadow: 4px 4px 0 #2b2118;
  font-size: 1.1rem;
  white-space: pre-line;
}
.bulle::before {
  /* pointe de la bulle vers le portrait */
  content: "";
  position: absolute;
  left: -16px;
  top: 26px;
  border-width: 10px 16px 10px 0;
  border-style: solid;
  border-color: transparent #2b2118 transparent transparent;
}
.bulle.bulle-narrateur {
  grid-column: 1 / -1;
  border-radius: 4px;
  background: #fff3c4;
  font-style: italic;
  box-shadow: 4px 4px 0 #6b5640;
  border-color: #6b5640;
}
.bulle.bulle-narrateur::before { display: none; }
.scene:has(.orateur-narrateur) .bulle,
.scene:has(.orateur-narrateur) .scene-jeu { grid-column: 1 / -1; }

/* Zone rendue par le type de scène (js/types/) ; un mini-jeu occupe toute la largeur. */
.scene-jeu { grid-column: 2; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.scene:not([data-type="choix"]) .scene-jeu { grid-column: 1 / -1; }

.consigne-choix { margin: 8px 0 0; font-weight: 700; }

.liste-choix {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.choix {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  text-align: left;
  color: #2b2118;
  background: #fffaf0;
  border: 2px solid #2b2118;
  border-radius: 10px;
  box-shadow: 3px 3px 0 #2b2118;
  cursor: pointer;
}
.choix:hover { background: #fff3c4; }
.choix-lettre {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 2px solid #2b2118;
  border-radius: 50%;
  background: #f7c948;
  font-weight: 800;
}
.choix-texte { min-width: 0; overflow-wrap: anywhere; }

/* ------------------------------------------------------------ type "tri" (EX-112) */

.tri { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.tri-resume {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.tri-resume-bac {
  flex: 1 1 120px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: #d9b98a;
  border: 3px solid #2b2118;
  border-top-width: 8px;
  border-radius: 4px 4px 12px 12px;
  font-weight: 700;
  min-width: 0;
}
.tri-resume-nom { overflow-wrap: anywhere; }
.tri-resume-nombre { font-family: "Courier New", Courier, monospace; }
.tri-pieces { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tri-piece {
  padding: 10px 12px;
  background: #fffaf0;
  border: 2px dashed #6b5640;
  border-radius: 6px;
}
.tri-piece[data-range] { border-style: solid; border-color: #2b2118; background: #ffffff; }
.tri-groupe { border: 0; margin: 0; padding: 0; min-width: 0; }
.tri-piece-texte {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  margin-bottom: 8px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.tri-piece-portrait { flex: 0 0 auto; width: 40px; height: 40px; border: 2px solid #2b2118; border-radius: 8px; background: #e3f6f5; }
.tri-bacs { display: flex; flex-wrap: wrap; gap: 8px; }
.tri-bac { position: relative; flex: 1 1 110px; min-width: 0; cursor: pointer; }
/* Bouton radio natif conservé (clavier, lecteurs d'écran), habillé en étiquette de bac. */
.tri-bac input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.tri-bac-nom {
  display: block;
  padding: 8px 10px;
  text-align: center;
  background: #fffaf0;
  border: 2px solid #2b2118;
  border-radius: 10px;
  box-shadow: 3px 3px 0 #2b2118;
  overflow-wrap: anywhere;
}
.tri-bac:hover .tri-bac-nom { background: #fff3c4; }
.tri-bac input:checked + .tri-bac-nom { background: #f7c948; font-weight: 800; transform: translate(2px, 2px); box-shadow: 1px 1px 0 #2b2118; }
.tri-bac input:focus-visible + .tri-bac-nom { outline: 4px solid #1f5fbf; outline-offset: 3px; }
.tri-manque { margin: 0; color: #b3261e; font-weight: 700; }
.tri-valider { align-self: flex-end; }

/* ------------------------------------------------------------ encadré après choix */

.encadre-titre { grid-column: 1 / -1; font-size: 1.6rem; margin: 0; }
.verdict { display: none; }
.encadre[data-juste="true"] .verdict-juste,
.encadre[data-juste="false"] .verdict-faux {
  display: inline-block;
  padding: 2px 14px;
  border: 4px double currentColor;
  border-radius: 8px;
  font-family: "Courier New", Courier, monospace;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transform: rotate(-3deg);
}
.verdict-juste { color: #1e6b3a; }
.verdict-faux { color: #b3261e; }
.encadre-choix { grid-column: 1 / -1; margin: 0; }
.petit-libelle { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; color: #6b3d12; }
.encadre .orateur { grid-row: auto; }
.encadre .orateur .portrait { width: 100px; height: 100px; }
.reaction { grid-column: 2; }
.encadre:has(.orateur-narrateur) .reaction { grid-column: 1 / -1; }

.loi {
  grid-column: 1 / -1;
  padding: 16px 18px;
  background: #e8f1fb;
  border: 3px solid #1f4e8c;
  border-left-width: 10px;
  border-radius: 6px;
}
.loi-titre { color: #1f4e8c; font-size: 1.15rem; }
.loi-explication { margin: 0 0 10px; }
.loi-references { margin: 0; padding-left: 20px; font-size: 0.92rem; }
.loi-reference + .loi-reference { margin-top: 6px; }
.loi-article { color: #1f4e8c; }
#bouton-suivant { grid-column: 1 / -1; justify-self: end; }

/* ------------------------------------------------------------ animations (EX-113, js/animations.js) */
/* Une entrée du registre = une classe ici ; durée <= 600 ms ; aucune sous prefers-reduced-motion. */

/* Le tampon part agrandi : rogné aux bords de l'élément (pas de défilement horizontal, EX-035). */
.anim-tampon { position: relative; overflow: clip; overflow-clip-margin: 8px; }
.anim-tampon::after {
  content: "Vérifié";
  position: absolute;
  top: 8px;
  right: 12px;
  padding: 2px 12px;
  border: 4px double #1e6b3a;
  border-radius: 8px;
  color: #1e6b3a;
  font-family: "Courier New", Courier, monospace;
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transform: rotate(-8deg);
  opacity: 0.9;
  pointer-events: none;
  animation: anim-tampon 600ms cubic-bezier(0.2, 0.9, 0.3, 1.3) both;
}
@keyframes anim-tampon {
  0% { transform: scale(2.4) rotate(-20deg); opacity: 0; }
  70% { transform: scale(0.92) rotate(-6deg); opacity: 1; }
  100% { transform: scale(1) rotate(-8deg); opacity: 0.9; }
}

.anim-secousse { animation: anim-secousse 450ms ease-in-out; }
@keyframes anim-secousse {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px) rotate(-0.6deg); }
  40% { transform: translateX(7px) rotate(0.5deg); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(3px); }
}

@media (prefers-reduced-motion: reduce) {
  .anim-tampon::after, .anim-secousse { animation: none; }
}

/* ------------------------------------------------------------ fin */

.titre-fin { font-size: clamp(1.8rem, 6vw, 2.8rem); }
.fin-texte { font-size: 1.1rem; max-width: 560px; margin: 0 auto 20px; }
.score {
  max-width: 420px;
  margin: 0 auto 24px;
  padding: 12px 18px;
  background: #fffaf0;
  border: 2px solid #2b2118;
  text-align: left;
}
.score-ligne { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.score-ligne + .score-ligne { border-top: 1px dashed #6b5640; }
.score dt { font-weight: 700; }
.score dd { margin: 0; font-family: "Courier New", Courier, monospace; font-weight: 700; white-space: nowrap; }
.boutons-fin { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }

/* ------------------------------------------------------------ personnages illustrés (EX-156, EX-157) */
/* Illustrations en pied 3:4 (768x1024) : carte de profil, fiche de présentation, fin, emblème du titre.
   Sans illustration, l'interface ne montre que le portrait (mêmes cadres que les portraits). */

.carte-illustration,
.fiche-illustration,
.fin-illustration,
.embleme-illustration {
  display: block;
  flex: 0 0 auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border: 3px solid #2b2118;
  border-radius: 10px;
  background: #e3f6f5;
}
.carte-illustration { width: 72px; height: 96px; border-width: 2px; border-radius: 8px; }

/* Écran titre avec emblème : affiche de film, le contrôleur à gauche, le titre et l'action à droite. */
.titre-corps { display: flex; align-items: center; justify-content: center; gap: 28px; }
.titre-texte { min-width: 0; }
.titre-corps:has(> .embleme:not([hidden])) { margin-bottom: 18px; }
.titre-corps:has(> .embleme:not([hidden])) .titre-texte { text-align: left; }
.embleme { margin: 0; }
.embleme-illustration { height: clamp(180px, 40vh, 340px); width: auto; box-shadow: 5px 5px 0 #2b2118; }
.embleme-portrait,
.fin-portrait {
  display: block;
  width: 120px;
  height: 120px;
  margin: 0 auto;
  border: 3px solid #2b2118;
  border-radius: 12px;
  background: #e3f6f5;
  box-shadow: 4px 4px 0 #2b2118;
}

/* Écran de fin : le vérificateur à gauche du verdict (titre et texte), le score en dessous. */
.fin-corps { display: flex; align-items: center; justify-content: center; gap: 24px; margin: 0 0 20px; }
.fin-corps-texte { min-width: 0; text-align: left; }
.fin-corps .fin-texte { margin: 0; }
.fin-verificateur { flex: 0 0 auto; margin: 0; }
.fin-illustration { height: clamp(140px, 26vh, 220px); width: auto; box-shadow: 5px 5px 0 #2b2118; }

.fiche {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px 28px;
  align-items: center;
  padding: 18px 20px 20px;
  background: #fffaf0;
  border: 3px solid #2b2118;
  border-radius: 10px;
  box-shadow: 5px 5px 0 #2b2118;
}
.fiche-etiquette {
  grid-column: 1 / -1;
  justify-self: start;
  margin: 0;
  padding: 2px 10px;
  border: 2px solid #2b2118;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b3d12;
}
.fiche-images { grid-column: 1; grid-row: 2 / span 2; position: relative; justify-self: center; margin: 0 14px 14px 0; }
.fiche-illustration { height: clamp(200px, 48vh, 420px); width: auto; }
/* Portrait épinglé au coin de l'illustration ; seul (illustration introuvable), il reste à sa place. */
.fiche-portrait-cadre { position: absolute; right: -14px; bottom: -14px; }
.fiche-portrait-cadre:only-child { position: static; }
.fiche-portrait {
  display: block;
  width: 96px;
  height: 96px;
  border: 3px solid #2b2118;
  border-radius: 8px;
  background: #e3f6f5;
  box-shadow: 3px 3px 0 #2b2118;
}
.fiche-texte { grid-column: 2; grid-row: 2; align-self: end; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.fiche-nom { margin: 0; font-size: 1.7rem; overflow-wrap: anywhere; }
.fiche-description { margin: 0; font-size: 1.05rem; }
#bouton-fiche-suivant { grid-column: 2; grid-row: 3; align-self: start; justify-self: start; }

/* ------------------------------------------------------------ mobile */

@media (max-width: 640px) {
  body { font-size: 16px; }
  main { padding: 16px 12px 36px; }
  .chemise { padding: 40px 16px 28px; }
  .chemise::before { width: 110px; left: 16px; }
  .scene, .encadre { grid-template-columns: minmax(0, 1fr); }
  .orateur, .bulle, .scene-jeu, .reaction { grid-column: 1; grid-row: auto; }
  .scene:not([data-type="choix"]) .scene-jeu { grid-column: 1; }
  .tri-valider { align-self: stretch; }
  .orateur-figure { display: flex; align-items: center; gap: 12px; text-align: left; }
  .orateur .portrait, .encadre .orateur .portrait { width: 72px; height: 72px; margin: 0; box-shadow: 3px 3px 0 #2b2118; }
  .orateur-nom { margin: 0; }
  .bulle::before { left: 26px; top: -16px; border-width: 0 10px 16px 10px; border-color: transparent transparent #2b2118 transparent; }
  .jauges { flex-basis: 100%; gap: 6px; }
  .jauge { flex: 1 1 90px; padding: 4px 6px; }
  .jauge-montant { font-size: 1.1rem; }
  .jauge-libelle { font-size: 0.66rem; letter-spacing: 0; overflow-wrap: anywhere; }
  .carte-portrait { width: 72px; height: 72px; }
  /* Panneau pleine largeur : même largeur utile qu'avec le fond uni (351 px de contenu à 375 px). */
  body.avec-decor main { margin: 48px 0 24px; padding: 16px 9px 36px; border-radius: 10px; box-shadow: none; }
  #bouton-suivant { justify-self: stretch; }
  .boite-boutons .bouton { flex: 1 1 100%; }
  .fiche { grid-template-columns: auto minmax(0, 1fr); gap: 10px 14px; padding: 12px 12px 14px; }
  .fiche-images { grid-row: 2; margin: 0 10px 10px 0; }
  .fiche-texte { align-self: center; }
  .fiche-illustration { height: min(24vh, 180px); }
  .fiche-portrait-cadre { right: -10px; bottom: -10px; }
  .fiche-portrait { width: 56px; height: 56px; border-width: 2px; }
  .fiche-texte { gap: 6px; }
  .fiche-nom { font-size: 1.2rem; }
  .fiche-description { font-size: 0.92rem; line-height: 1.4; }
  #bouton-fiche-suivant { grid-column: 1 / -1; grid-row: 3; justify-self: stretch; }
  .titre-corps { gap: 12px; }
  .titre-corps:has(> .embleme:not([hidden])) .titre-jeu { font-size: 1.9rem; }
  .titre-corps:has(> .embleme:not([hidden])) .sous-titre { font-size: 1rem; margin-bottom: 0; }
  .embleme-illustration { height: min(24vh, 180px); }
  /* Écran de fin compact : verdict, score et boutons tiennent en 375x740 avec l'illustration. */
  .chemise-fin { padding: 30px 14px 20px; }
  .chemise-fin .chemise-etiquette { margin-bottom: 10px; }
  .chemise-fin .score { margin-bottom: 14px; padding: 8px 12px; }
  #ecran-fin .avertissement { margin-top: 16px; }
  .fin-corps { gap: 12px; align-items: flex-start; margin-bottom: 12px; }
  .fin-illustration { height: 112px; border-width: 2px; box-shadow: 3px 3px 0 #2b2118; }
  .fin-corps .titre-fin { font-size: 1.5rem; margin-bottom: 6px; }
  .fin-corps .fin-texte { font-size: 1rem; line-height: 1.4; }
  .embleme-portrait { width: 96px; height: 96px; }
  .fin-portrait { width: 72px; height: 72px; border-width: 2px; box-shadow: 3px 3px 0 #2b2118; }
}
