/* « Snaky Story » — la BD des sets de table, en ligne.
   Chargée uniquement sur cette page (site/layout.js). Reprend les tokens de site.css :
   aplats francs, contours noirs, ombres portées dures. */

/* ── hero ──────────────────────────────────────────────────────────── */
.sthero { position: relative; background: var(--red); color: #fff; overflow: hidden; padding: 28px 0 44px; }
.sthero-bg { position: absolute; inset: 0; pointer-events: none; }
.sthero-bg img { position: absolute; right: -14%; top: -28%; width: 86%; opacity: 0.4; }
.sthero-in { position: relative; display: grid; gap: 18px; align-items: center; }
.sthero-ep { margin-top: 12px; font-family: var(--f-display); font-size: 15px; color: var(--yellow); }
/* « Snaky Story » en .h1.mega déborde d'un écran de téléphone : deux mots longs, pas
   d'espace où couper. Or le QR du set se scanne AU TÉLÉPHONE — c'est le cas principal,
   pas le cas limite. On pose une taille propre à ce titre sous 520 px. */
@media (max-width: 519px) {
  .sthero .h1 { font-size: clamp(38px, 13vw, 60px); line-height: 1.02; }
  .sthero .lead { font-size: 16px; }
}
.sthero-vig { width: 100%; max-width: 380px; border: 3px solid var(--ink); border-radius: 14px;
  box-shadow: var(--pop); display: block; margin-inline: auto; }

/* ── la planche ────────────────────────────────────────────────────── */
.st-h { margin-bottom: 8px; max-width: 18em; }
.st-res { max-width: 46em; font-size: 17px; line-height: 1.5; color: var(--muted); margin-bottom: 22px; }
/* minmax(0, 1fr) + min-width:0 : sans eux, Safari élargit les pistes à la taille
   intrinsèque des images une fois chargées, et la grille déborde. */
.st-planche { list-style: none; display: grid; gap: 14px; padding: 0; margin: 0;
  grid-template-columns: minmax(0, 1fr); }
.st-case { min-width: 0; }
.st-case figure { position: relative; margin: 0; border: 3px solid var(--ink); border-radius: 14px;
  overflow: hidden; background: #fff; box-shadow: var(--pop); cursor: zoom-in; }
.st-case img { width: 100%; height: auto; display: block; }
.st-regle { position: absolute; top: 0; left: 0; background: var(--yellow); color: var(--ink);
  font-family: var(--f-display); font-size: 13px; padding: 6px 14px 7px 12px;
  border-right: 3px solid var(--ink); border-bottom: 3px solid var(--ink); border-radius: 0 0 12px 0; }
.st-bulle { position: absolute; left: 10px; right: 10px; bottom: 10px; background: #fff;
  border: 3px solid var(--ink); border-radius: 12px; padding: 9px 12px; text-align: center;
  font-weight: 800; font-size: 14px; line-height: 1.3; }
.st-bulle em { font-style: normal; color: var(--red); font-weight: 900; }
.st-note { margin-top: 16px; display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--muted); }
.st-note svg { flex: 0 0 auto; width: 18px; height: 18px; }

/* ── le quiz ───────────────────────────────────────────────────────── */
.st-quiz { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 14px; }
.st-q { background: #fff; border: 3px solid var(--ink); border-radius: 16px; padding: 16px 18px;
  box-shadow: var(--pop); min-width: 0; }
.st-q-t { font-weight: 800; font-size: 16px; line-height: 1.35; margin-bottom: 10px; }
.st-q-t b { font-family: var(--f-display); color: var(--red); margin-right: 4px; }
.st-rep { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; }
.st-r { width: 100%; text-align: left; font: inherit; font-weight: 700; font-size: 15px;
  background: var(--cream); border: 2.5px solid var(--ink); border-radius: 999px;
  padding: 9px 16px; cursor: pointer; transition: transform 0.12s var(--ease), background 0.12s; }
.st-r:hover:not(:disabled) { background: var(--cream-d); transform: translateX(3px); }
.st-r:disabled { cursor: default; opacity: 0.78; }
.st-r.is-ok { background: #1F7A4C; border-color: var(--ink); color: #fff; opacity: 1; }
.st-r.is-ko { background: #C0392B; border-color: var(--ink); color: #fff; opacity: 1; }
.st-mot { margin-top: 10px; font-size: 14px; line-height: 1.45; color: var(--muted);
  border-left: 4px solid var(--yellow); padding-left: 10px; }

.st-res-box { margin-top: 20px; background: var(--ink); color: #fff; border-radius: 18px;
  padding: 22px 20px; text-align: center; box-shadow: var(--pop); }
.st-res-score { font-family: var(--f-display); font-size: 46px; line-height: 1; color: var(--yellow); }
.st-res-score span { font-size: 20px; color: #CFC4AE; margin-left: 6px; }
.st-res-rank { margin-top: 10px; font-size: 17px; font-weight: 800; line-height: 1.35; }
.st-res-btns { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.st-rgpd { margin-top: 16px; display: flex; gap: 8px; align-items: flex-start; font-size: 13px;
  line-height: 1.45; color: #6B4A05; }
.st-rgpd svg { flex: 0 0 auto; width: 17px; height: 17px; margin-top: 1px; }

/* ── épisodes précédents ───────────────────────────────────────────── */
.st-prev { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 14px;
  grid-template-columns: minmax(0, 1fr); }
.st-prev-c { display: block; min-width: 0; background: rgba(255, 255, 255, 0.07);
  border: 3px solid rgba(255, 255, 255, 0.2); border-radius: 14px; overflow: hidden;
  text-decoration: none; color: #fff; }
.st-prev-c img { width: 100%; height: auto; display: block; }
.st-prev-n { display: block; padding: 10px 14px 0; font-family: var(--f-display);
  font-size: 13px; color: var(--yellow); }
.st-prev-t { display: block; padding: 2px 14px 14px; font-weight: 800; font-size: 16px; line-height: 1.25; }
.st-prev-empty { margin-top: 14px; font-size: 16px; line-height: 1.5; color: #CFC4AE; max-width: 42em; }

.st-cta-in { text-align: center; }
.st-cta-btns { margin-top: 18px; display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* ── plein écran ───────────────────────────────────────────────────── */
.st-zoom { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 96vh; }
.st-zoom::backdrop { background: rgba(33, 33, 33, 0.9); }
.st-zoom-in figure { position: relative; margin: 0; border: 4px solid var(--ink);
  border-radius: 16px; overflow: hidden; background: #fff; }
.st-zoom-in img { width: 100%; height: auto; display: block; max-height: 84vh; object-fit: contain; }
.st-zoom-x { position: absolute; top: -46px; right: 0; width: 38px; height: 38px; font-size: 26px;
  line-height: 1; background: var(--yellow); color: var(--ink); border: 3px solid var(--ink);
  border-radius: 50%; cursor: pointer; }

@media (min-width: 620px) {
  .st-planche { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-case:first-child, .st-case-fin { grid-column: 1 / -1; }
  .st-prev { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-bulle { font-size: 15px; }
}
@media (min-width: 900px) {
  .sthero-in { grid-template-columns: 1.4fr 0.8fr; gap: 34px; }
  .st-planche { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  /* l'ouverture et la chute prennent deux colonnes : sans ça la dernière case reste
     seule au bout d'une rangée vide. */
  .st-case:first-child, .st-case-fin { grid-column: span 2; }
  .st-quiz { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-prev { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
