/* ==========================================================================
   LES SEPT COURONNES — socle de style partagé
   Charte « clair-obscur » : or gravé sur noir, capitales espacées,
   rouge en dispersion. Chargé par les 27 pages.
   ==========================================================================
   La charte AJOUTE cinq valeurs et n'en remplace aucune : les pages
   existantes qui utilisent --brass, --brass-lit, --debt ou --mech
   continuent de fonctionner sans retouche.
   ========================================================================== */

/* --------------------------------------------------------------------------
   LES POLICES SONT SERVIES AVEC LE JEU, PAS PAR GOOGLE.

   Il y avait ici un @import vers fonts.googleapis.com. Il transmettait à
   Google l'adresse IP de chaque lecteur, à chaque page — ce qu'un tribunal
   allemand a jugé contraire au RGPD en 2022 —, et il rendait la charte
   dépendante d'un domaine tiers : hors ligne, ou derrière un bloqueur, les
   trois familles retombaient sur leurs replis.

   Les fichiers ci-dessous sont sous licence SIL OFL 1.1 (voir assets/fonts/).
   Ce sont des polices VARIABLES sous-ensemblées au latin : un fichier par
   famille, tous les grammages, et l'axe de corps optique de Bodoni Moda
   toujours vivant. Fabriqués par outils/polices_web.py.
   -------------------------------------------------------------------------- */
@font-face {
  font-family: 'Bodoni Moda';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../../assets/fonts/bodoni-moda.woff2') format('woff2');
}
@font-face {
  font-family: 'Gelasio';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../../assets/fonts/gelasio.woff2') format('woff2');
}
@font-face {
  font-family: 'Gelasio';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url('../../assets/fonts/gelasio-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../../assets/fonts/cormorant.woff2') format('woff2');
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url('../../assets/fonts/cormorant-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../../assets/fonts/jetbrains-mono.woff2') format('woff2');
}

:root {
  /* --- fond : le noir descend d'un cran. Tout l'écran tient parce que
         le fond est presque sans lumière : c'est ce qui donne à la seule
         chose chaude de quoi ressortir. --- */
  --ink: #080706;
  --ink-2: #16120f;
  --panel: rgba(8, 7, 6, .86);
  --hair: rgba(185, 168, 136, .17);   /* le filet ordinaire, neutre */

  /* --- encre, inchangée ; --paper-mute nomme le gris qui existait
         déjà en dur dans .hint.locked --- */
  --paper: #f5e6c8;
  --paper-dim: #b9a888;
  /* #57514a donnait 2,57:1 sur le fond — sous le seuil pour du 11 px.
     Remonté jusqu'à passer, en restant nettement en retrait de --paper-dim. */
  --paper-mute: #aca7a0;
  --paper-soft: rgba(185, 168, 136, .75);

  /* --- or : les deux valeurs d'origine, encadrées par un reflet
         et une ombre. C'est ce qui fait du métal au lieu d'un aplat --- */
  --gold-hi: #f4e3b0;          /* nouveau */
  --brass-lit: #e8b84b;
  --brass: #d99e0d;
  --gold-lo: #7d5f10;          /* nouveau */
  --gold-line: rgba(232, 184, 75, .24);

  /* --- rouge : ce qui se paie.
         --debt reste la valeur STRUCTURELLE (aplats, filets, bordures) ;
         elle donne 2,17:1 dès qu'on en fait du texte de 11 px, d'où
         --debt-lit, qui garde l'identité de la dette en restant lisible. --- */
  --debt: #8b1a1a;
  --debt-lit: #d7998f;
  --red-lit: #e09587;          /* les particules uniquement */

  /* --- dormant : ce qui manque.
         Un état « en sommeil » doit rester LISIBLE. #3f3f46 donnait 1,93:1
         à 10,5 px : le mot « à venir » était pratiquement invisible. On garde
         le gris froid, qui distingue le dormant du chaud, mais assez clair
         pour passer le seuil. --- */
  --mech: #8b9099;
  --dormant-lit: #a2a9b2;

  /* --- sémantique : MESURÉE SUR LE PANNEAU, PAS SUR LE NOIR ---
         Le calcul précédent prenait #080706 pour fond. Or un panneau est un
         voile rgba(8,7,6,.76) posé sur la photo de la journée : le fond
         réellement vu est rgb(62,60,56) au pire cas des vingt-cinq. Contre
         lui, --ok tombait à 3,31, --ko à 3,16 — les deux couleurs qui portent
         le retour au joueur, sous le seuil AA. Éclaircies à teinte et
         saturation constantes, du minimum nécessaire. Voir verif_lisibilite. */
  --ok: #71b87e;               /* 4,64:1 sur le panneau le plus clair */
  --ko: #da9791;               /* 4,62:1 — #cc6f66 donnait 3,16 */

  /* --- formes : les panneaux perdent leur rayon, les commandes
         le gardent — arrondi veut dire pressable --- */
  --r-panel: 2px;
  --r-ctrl: 8px;
  --r: var(--r-panel);         /* alias de compatibilité */
  --touch: 44px;

  --shadow: 0 18px 50px rgba(0, 0, 0, .6);
  --display: "Bodoni Moda", Didot, "Bodoni MT", Georgia, serif;
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  padding: 20px 16px 96px;
  background-color: var(--ink);
  background-image: var(--bg, none);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--paper);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  align-items: center;
  -webkit-text-size-adjust: 100%;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 7, 6, .05), rgba(8, 7, 6, .22)),
    radial-gradient(110% 82% at 50% 0%, rgba(8, 7, 6, .03), rgba(8, 7, 6, .28));
  pointer-events: none;
  z-index: 0;
}

/* Le grain. Sans lui, un aplat aussi sombre se lit comme un écran éteint ;
   avec lui, comme une matière. Généré, donc aucun fichier à charger. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .42;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.3'/%3E%3C/svg%3E");
}

/* Clair-obscur : une seule source de lumière par écran, en haut. */
.wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  min-width: 0;
  max-width: 720px;
  background: linear-gradient(
    180deg,
    rgba(19, 16, 13, .70),
    rgba(8, 7, 6, .80)
  );
  /* Plus de cadre. Le panneau existe pour rendre le texte lisible par-dessus
     l'illustration, pas pour se dessiner : il ne garde que ses deux équerres. */
  border: 0;
  border-radius: 0;
  box-shadow: var(--shadow);
  padding: 30px 26px 26px;
  backdrop-filter: blur(3px);
}

/* Équerres de coin : deux coins en diagonale, jamais quatre. */
.wrap::before, .wrap::after {
  content: "";
  position: absolute;
  width: 15px; height: 15px;
  border: 1px solid rgba(232, 184, 75, .5);
  pointer-events: none;
}
.wrap::before { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.wrap::after  { bottom: 0; right: 0; border-left: 0; border-top: 0; }

.wrap.wide { max-width: 940px; }

/* ---------- lockup : bandeau, filet, capitales ---------- */

.eyebrow {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .3em;
  padding-left: .3em;
  text-transform: uppercase;
  color: var(--brass);
  margin: 0 0 10px;
}

h1 {
  font-family: var(--display);
  font-size: clamp(1.42rem, 5.4vw, 2rem);
  font-weight: 400;
  letter-spacing: .11em;
  padding-left: .11em;
  text-transform: uppercase;
  line-height: 1.14;
  margin: 0 0 8px;
  color: var(--paper);
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Le dégradé métallique, seulement là où il est réellement supporté :
   sans ce garde-fou, un moteur ancien afficherait un titre invisible. */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  h1 {
    background: linear-gradient(175deg, var(--gold-hi) 6%, var(--brass-lit) 46%, var(--brass) 84%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

@media (max-width: 480px) {
  h1 {
    background: none;
    color: var(--brass-lit);
    font-size: 20px;
    letter-spacing: .07em;
    padding-left: .07em;
  }
}

.sub {
  color: var(--paper-dim);
  font-style: italic;
  margin: 0 0 20px;
  overflow-wrap: anywhere;
}

/* ==========================================================================
   LES TROIS FILETS
   Toute la mise en page se construit avec ceux-là, et l'or ne sert qu'au
   deuxième. Avant, tous les traits étaient dorés : quand tout brille, plus
   rien ne hiérarchise.
   ========================================================================== */

/* 1 — le filet qui s'éteint : sépare deux choses de même rang.
   Il ne touche jamais le bord (un trait bord à bord découpe la page en
   boîtes) et il s'interrompt au centre pour laisser passer le chevron. */
hr.rule {
  border: 0;
  height: 0;
  margin: 26px 0;
  position: relative;
  overflow: visible;
  background: none;
}
hr.rule::before {
  content: "";
  position: absolute; left: 0; right: 0; top: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent, var(--hair) 16%, var(--hair) 45%,
    transparent 45.5%, transparent 54.5%,
    var(--hair) 55%, var(--hair) 84%, transparent);
}
hr.rule::after {
  content: "";
  position: absolute; left: 50%; top: 0;
  transform: translate(-50%, -50%);
  width: 15px; height: 8px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='8' viewBox='0 0 15 8'%3E%3Cpath d='M1 1l6.5 6L14 1' fill='none' stroke='%23b9a888' stroke-opacity='.55' stroke-width='1.1' stroke-linecap='round'/%3E%3C/svg%3E") center / 15px 8px no-repeat;
}

/* 2 — le séparateur ambré : sépare deux GROUPES. Le seul trait qui rayonne,
   deux ou trois fois par page au plus. */
hr.glow {
  border: 0;
  height: 1px;
  margin: 34px 0;
  background: linear-gradient(90deg, transparent,
    rgba(232, 184, 75, .30) 26%, rgba(232, 184, 75, .62) 50%,
    rgba(232, 184, 75, .30) 74%, transparent);
  box-shadow: 0 0 16px rgba(232, 184, 75, .28), 0 0 46px rgba(232, 184, 75, .12);
}

/* 3 — le filet d'appui : une ligne dans une liste. Ancré à gauche, il
   s'éteint vers la droite, donc l'œil n'est pas renvoyé au bord. */
hr.under {
  border: 0;
  height: 1px;
  margin: 0;
  background: linear-gradient(90deg, var(--hair), transparent 88%);
}

/* ---------- l'entrée ----------------------------------------------------
   Une ligne de menu : du texte posé sur un filet, sans cadre ni fond. Les
   cartes se répétaient tellement qu'elles ne distinguaient plus rien ; ce
   qui reste encadré dans le site l'est parce que c'est un instrument.
   ---------------------------------------------------------------------- */

.entry {
  position: relative;
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: var(--touch);
  padding: 17px 0 19px;
  background: none;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.25;
  letter-spacing: .22em;
  padding-left: .22em;
  text-transform: uppercase;
  color: #cfcabf;
  transition: color .25s ease, text-shadow .25s ease;
}
.entry::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent, var(--hair) 16%, var(--hair) 45%,
    transparent 45.5%, transparent 54.5%,
    var(--hair) 55%, var(--hair) 84%, transparent);
}
/* Le chevron du centre. En pseudo-élément masqué : rien à injecter dans le
   balisage, et la couleur suit le survol comme n'importe quelle propriété. */
.entry::before {
  content: "";
  position: absolute; left: 50%; bottom: -4px;
  transform: translateX(-50%);
  width: 15px; height: 8px;
  background-color: rgba(185, 168, 136, .40);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='8' viewBox='0 0 15 8'%3E%3Cpath d='M1 1l6.5 6L14 1' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") center / 15px 8px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='8' viewBox='0 0 15 8'%3E%3Cpath d='M1 1l6.5 6L14 1' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") center / 15px 8px no-repeat;
  transition: background-color .25s ease;
}
.entry:hover, .entry:focus-visible { color: #f2ecdd; text-shadow: 0 0 22px rgba(232, 184, 75, .5); }
.entry:hover::before, .entry:focus-visible::before { background-color: rgba(232, 184, 75, .85); }
.entry:focus-visible { outline: 1px solid rgba(232, 184, 75, .7); outline-offset: 5px; }

.entry .sub {
  display: block;
  margin-top: 9px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: .06em;
  padding-left: 0;
  text-transform: none;
  color: var(--paper-mute);
}
.entry .cnt {
  position: absolute; right: 2px; top: 20px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .1em;
  padding-left: 0;
  text-transform: none;
  color: #8f887c;
}
.entry.done .cnt { color: var(--ok); }
.entry.now  .cnt { color: var(--brass-lit); }
.entry.locked { color: #948d81; cursor: default; }
.entry.locked:hover { color: #948d81; text-shadow: none; }
.entry.locked:hover::before { background-color: rgba(185, 168, 136, .40); }

@media (max-width: 560px) {
  .entry { font-size: 14.5px; letter-spacing: .16em; padding-left: .16em; }
  .entry .cnt { position: static; display: block; margin-top: 7px; }
}

.quote {
  border-left: 2px solid var(--brass);
  padding: 2px 0 2px 16px;
  margin: 18px 0;
  font-style: italic;
  color: #e6d6b6;
}

/* Écouter une citation. Le contrôle se pose sous le filet de la citation,
   dans son axe : c'est la même voix qui continue, pas un objet nouveau. */
.say {
  display: inline-flex; align-items: center; gap: 9px;
  min-height: var(--touch); margin: -8px 0 18px 0; padding: 0 14px 0 10px;
  background: none; border: 1px solid rgba(184, 134, 11, .28);
  border-radius: var(--r-ctrl);
  color: var(--paper-dim); cursor: pointer;
  font-family: var(--mono); font-size: 13px; letter-spacing: .1em;
  text-transform: uppercase;
  transition: color .18s, border-color .18s, background .18s;
}
.say svg { width: 17px; height: 17px; flex: none; }
.say:hover { color: var(--brass-lit); border-color: rgba(232, 184, 75, .55); }
.say:focus-visible { outline: 2px solid var(--brass-lit); outline-offset: 2px; }
.say.on {
  color: var(--brass-lit); border-color: var(--brass-lit);
  background: rgba(184, 134, 11, .1);
}
.say.on svg { animation: sayPulse 1.6s ease-in-out infinite; }
@keyframes sayPulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .say.on svg { animation: none; } }

.note {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  color: var(--paper-soft);
}

/* ---------- champs ---------- */

.field { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

input[type=text], input[type=number] {
  flex: 1 1 200px;
  min-width: 0;
  min-height: var(--touch);
  padding: 13px 14px;
  font-family: var(--mono);
  font-size: 16px; /* < 16px déclenche le zoom auto sur iOS */
  color: var(--paper);
  background: rgba(0, 0, 0, .45);
  border: 1px solid rgba(232, 184, 75, .35);
  border-radius: var(--r-ctrl);
  outline: none;
}

input[type=text]:focus, input[type=number]:focus {
  border-color: var(--brass-lit);
  box-shadow: 0 0 0 3px rgba(184, 134, 11, .14);
}

button, .btn {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .1em;
  text-transform: uppercase;
  /* inline-flex : sans display, un <a class="btn"> ignore min-height
     et retombe sous le plancher tactile. */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  min-height: var(--touch);
  padding: 13px 20px;
  color: var(--ink);
  background: linear-gradient(180deg, var(--brass-lit), var(--brass));
  border: 0;
  border-radius: var(--r-ctrl);
  cursor: pointer;
  transition: filter .18s, transform .12s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Les composants de bouton imposent leur propre display, ce qui sinon
   prend le pas sur la règle native du navigateur pour l'attribut hidden. */
[hidden] { display: none !important; }

button:hover, .btn:hover { filter: brightness(1.12); }
button:active, .btn:active { transform: translateY(1px); }
button:disabled { opacity: .4; cursor: not-allowed; filter: none; }

button.ghost {
  background: transparent;
  color: var(--brass);
  border: 1px solid rgba(232, 184, 75, .4);
}

button.ghost:hover { background: rgba(184, 134, 11, .1); }

/* « small » ne descend plus sous le plancher tactile : c'est le corps
   du texte qui rétrécit, pas la cible. */
button.small { padding: 10px 14px; font-size: 13px; min-height: var(--touch); }

/* Lien injecte dans une phrase mais utilise comme commande de navigation. */
.touch-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  padding: 7px 9px;
  margin: 2px 1px;
  border: 1px solid rgba(232, 184, 75, .32);
  border-radius: var(--r-ctrl);
  color: var(--brass-lit);
  text-decoration: none;
}

/* Les liens prenaient le bleu du navigateur, illisible et hors charte sur le
   fond sombre (signalé par l'auteur le 1er octobre). :where() garde une
   spécificité nulle : un .btn ou un lien déjà stylé garde sa couleur. */
:where(a) { color: var(--brass-lit); text-underline-offset: 3px; }

/* Lien de navigation présenté comme un bouton secondaire. */
.btn.ghost {
  background: transparent;
  color: var(--brass);
  border: 1px solid rgba(232, 184, 75, .4);
}
.btn.ghost:hover { background: rgba(184, 134, 11, .1); }

:focus-visible { outline: 2px solid var(--brass-lit); outline-offset: 2px; }

/* ---------- verdicts : quatre états, pas deux ---------- */

.verdict {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.5;
  min-height: 1.4em;
  color: var(--paper-dim);
}
.verdict.ok   { color: var(--ok); }
.verdict.ko   { color: var(--ko); }
.verdict.near { color: var(--brass-lit); }   /* les bons éléments, mal placés */
.verdict.rule { color: var(--dormant-lit); } /* une contrainte, pas une faute */

.reveal {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(79, 157, 93, .4);
  background: rgba(79, 157, 93, .08);
  border-radius: var(--r-panel);
  animation: fadein .5s ease both;
}

@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- l'artefact à consulter ---------------------------------------
   Le livre ne porte plus que des illustrations : tout ce qui se compte, se
   lit ou se mesure vit désormais ici. Ces planches sont des DOCUMENTS — on
   les agrandit, on les fait défiler, on ne les décore pas.
   ------------------------------------------------------------------------ */

.doc {
  margin: 20px 0 6px;
  border: 1px solid var(--gold-line);
  background: rgba(0, 0, 0, .35);
  overflow: auto;
  max-height: 78vh;
  /* Agrandie, la planche se parcourt au doigt : le défilement doit rester
     souple sur iOS, et la page dessous ne doit pas partir avec elle. */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.doc img, .doc svg { display: block; width: 100%; height: auto; }

/* Agrandie, la boîte garde sa hauteur d'écran — c'est la fenêtre par
   laquelle on parcourt la gravure. La largeur, elle, est posée en pixels
   par EG.artefact, qui la plafonne à la taille de gravure. */
.doc.zoom { cursor: grab; }
.doc.zoom img { height: auto; }

.doc-cap {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  justify-content: space-between;
  font-family: var(--mono); font-size: 13px; letter-spacing: .06em;
  color: var(--paper-mute); margin: 6px 0 0;
}
.doc-cap button { font-size: 13px; padding: 9px 12px; min-height: var(--touch); }
.doc-pan { margin: 4px 0 0; text-align: center; }

/* Le serment : il se donne au dix-septième jour et se prononce au
   vingt-deuxième. Deux pages, donc une seule règle, ici. */
.oath {
  font-style: italic; line-height: 2.1; margin: 18px 0; padding-left: 18px;
  border-left: 2px solid var(--brass);
}

/* ---------- le portrait du jour ------------------------------------------
   Quand une journée met quelqu'un en face du joueur, elle le montre. Les
   quatre portraits servaient au seul jour 24, où l'on choisit qui traverse ;
   or c'est aux jours 20 et 22 qu'on a l'un d'eux devant soi pendant toute
   la scène.
   ------------------------------------------------------------------------ */

.face {
  float: right;
  width: clamp(84px, 26vw, 132px);
  margin: 0 0 12px 18px;
  border-radius: 50%;
  border: 1px solid var(--gold-line);
  background: rgba(0, 0, 0, .35);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .5);
  shape-outside: circle(50%);
}

.day-emblem {
  display: block;
  width: clamp(78px, 22vw, 108px);
  height: clamp(78px, 22vw, 108px);
  object-fit: contain;
  margin: 4px auto 18px;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .34));
}

.story-illustration {
  display: block;
  width: min(100%, 720px);
  height: auto;
  margin: 12px auto 20px;
  object-fit: contain;
  filter: drop-shadow(0 5px 10px rgba(0, 0, 0, .24));
}

.story-illustration.signature {
  width: min(78%, 340px);
  margin-top: 6px;
}

/* ---------- la plaque ----------------------------------------------------
   Le second temps des journées à machine : on retourne l'objet et on lit,
   gravée dessous, la partie que Drosselmeier y a jouée. Le registre visuel
   est donc celui du métal froid, pas celui du jeu — c'est la même page mais
   ce n'est plus le même moment.
   ------------------------------------------------------------------------ */

.plaque { animation: fadein .55s ease both; }

.plaque .pl-eyebrow {
  font-family: var(--mono); font-size: 13px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--debt-lit);
  margin: 22px 0 6px;
}

.plaque .pl-titre {
  font-size: clamp(20px, 5.4vw, 26px);
  margin: 0 0 14px;
  color: var(--paper);
}

.plaque .pl-art {
  margin: 18px 0 0;
  padding: 20px 16px;
  border: 1px solid rgba(155, 168, 180, .34);
  border-radius: var(--r-panel);
  /* laiton terni : la plaque est restée sous la machine pendant vingt ans */
  background:
    linear-gradient(158deg, rgba(196, 208, 218, .07) 0 34%, rgba(0, 0, 0, 0) 34%),
    linear-gradient(180deg, #16181b, #0c0d0f);
  box-shadow: inset 0 1px 0 rgba(214, 226, 236, .10), 0 10px 26px rgba(0, 0, 0, .45);
  overflow-x: auto;
}

.plaque .pl-legende {
  font-family: var(--mono); font-size: 13px; line-height: 1.6;
  color: var(--paper-mute); text-align: center; margin: 10px 0 0;
}

.plaque .pl-question {
  margin: 20px 0 0;
  font-size: 17px; line-height: 1.55;
  color: var(--paper);
}

/* La date de livraison : c'est elle qui donne le rang au jour 9. */
.pl-date {
  display: block; margin-top: 14px; text-align: right;
  font-family: var(--mono); font-size: 13px; letter-spacing: .08em;
  color: var(--paper-mute);
}

/* ---------- les trois sceaux ---------- */

.hints { margin-top: 24px; border-top: 1px solid var(--gold-line); padding-top: 16px; }

.hints h3 {
  font-family: var(--mono); font-size: 13px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--brass); margin: 0 0 12px;
}

.hints .list { display: flex; flex-direction: column; gap: 10px; }

.seal {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 0 13px;
  align-items: start;
  min-height: 72px;
  padding: 13px 15px 13px 11px;
  border: 1px solid rgba(232, 184, 75, .14);
  border-left: 2px solid var(--mech);
  border-radius: var(--r-panel);
  background:
    linear-gradient(rgba(10, 8, 7, .82), rgba(10, 8, 7, .82)),
    url('../../assets/pics/ui-art/panel-texture.webp') center / 520px auto;
  cursor: pointer;
  text-align: left;
  width: 100%;
  font-family: inherit;
  text-transform: none;
  letter-spacing: normal;
  color: inherit;
  transition: border-color .18s, background .18s;
}
.seal:hover { border-color: rgba(232, 184, 75, .34); }

.seal.broken {
  cursor: default;
  border-color: rgba(232, 184, 75, .24);
  border-left-color: var(--debt);
  background: rgba(232, 184, 75, .05);
}

.seal .wax { position: relative; display: grid; place-items: center; padding-top: 1px; }
.seal .wax img {
  width: 52px; height: 52px; display: block; object-fit: contain;
  filter: drop-shadow(0 4px 5px rgba(0,0,0,.5));
  transition: transform .18s, filter .18s, opacity .18s;
}
.seal:hover .wax img { transform: rotate(-2deg) scale(1.04); }
.seal.broken .wax img { opacity: .58; filter: grayscale(.35) drop-shadow(0 2px 3px rgba(0,0,0,.45)); transform: rotate(-7deg); }
.seal.broken .wax::after {
  content: ""; position: absolute; width: 48px; height: 2px;
  background: rgba(245,230,200,.55); transform: rotate(-48deg);
  box-shadow: 0 1px 0 rgba(0,0,0,.65); pointer-events: none;
}

.seal .body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.seal .head { display: flex; align-items: baseline; gap: 8px; justify-content: space-between; }
.seal .name {
  font-family: var(--display); font-size: 15px; letter-spacing: .11em;
  padding-left: .11em; text-transform: uppercase; color: var(--paper-dim);
}
.seal.broken .name { color: var(--paper); }
.seal .stamp {
  font-family: var(--mono); font-size: 13px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--paper-mute); white-space: nowrap;
}
.seal.broken .stamp { color: var(--debt-lit); }

.seal .promise { font-family: var(--mono); font-size: 13px; line-height: 1.62; color: var(--paper-soft); }
.seal .text { font-family: var(--serif); font-size: 15.5px; line-height: 1.5; color: #e6d6b6; }

.seal .warn {
  display: flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 13px; color: var(--ko);
}

/* Confirmation dans la page : window.confirm est bloqué par certains
   navigateurs intégrés (lecteurs de QR code, réseaux sociaux). */
.confirmer {
  margin: 12px 0;
  padding: 12px 15px 14px;
  border: 1px solid rgba(232, 184, 75, .34);
  border-radius: var(--r-panel);
  background: rgba(10, 8, 7, .9);
  text-align: left;
}
.seal-confirm {
  margin-top: -6px;
  padding: 12px 15px 14px;
  border: 1px solid rgba(232, 184, 75, .34);
  border-top: none;
  border-radius: 0 0 var(--r-panel) var(--r-panel);
  background: rgba(10, 8, 7, .9);
}
.confirmer p,
.seal-confirm p {
  margin: 0 0 12px; white-space: pre-line;
  font-family: var(--mono); font-size: 13px; line-height: 1.6; color: var(--paper-soft);
}
.confirmer .actions,
.seal-confirm .actions { display: flex; flex-wrap: wrap; gap: 10px; }

.hints .tally {
  display: flex; align-items: baseline; gap: 8px 18px; flex-wrap: wrap;
  margin-top: 14px; padding-top: 12px;
  border-top: 1px dashed rgba(232, 184, 75, .18);
  font-family: var(--mono); font-size: 13px; color: var(--paper-mute);
}
.hints .tally b { color: var(--brass-lit); font-weight: 500; }
.hints .tally .book b { color: var(--red-lit); }

/* ---------- toasts ---------- */

#eg-toasts {
  position: fixed; left: 50%; bottom: 76px; transform: translateX(-50%);
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
  width: min(420px, calc(100vw - 32px)); pointer-events: none;
}
.eg-toast {
  font-family: var(--mono); font-size: 13px; padding: 12px 14px;
  border-radius: var(--r-panel); background: #1c1815; color: var(--paper);
  border: 1px solid rgba(232, 184, 75, .4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  animation: toastin .25s ease both;
}
.eg-toast.ok { border-color: rgba(79, 157, 93, .6); }
.eg-toast.ko { border-color: rgba(179, 75, 75, .6); }
.eg-toast.out { animation: toastout .25s ease both; }
@keyframes toastin { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes toastout { to { opacity: 0; transform: translateY(8px); } }

/* ---------- la barre : contexte, retour, son ----------
   Remplace les deux pastilles de 38 px qui flottaient dans le seul
   coin qu'un pouce n'atteint pas. Cibles portées à 44 px. */

#eg-bar {
  position: sticky;
  top: 0;
  z-index: 500;
  width: 100%;
  max-width: 720px;
  display: grid;
  grid-template-columns: var(--touch) 1fr var(--touch);
  align-items: center;
  gap: 8px;
  height: 54px;
  margin-bottom: 14px;
  padding: 0 4px;
  background: rgba(12, 10, 9, .95);
  border-bottom: 1px solid var(--gold-line);
  backdrop-filter: blur(6px);
}
#eg-bar.wide { max-width: 940px; }

#eg-bar button {
  width: var(--touch); height: var(--touch);
  min-height: var(--touch);
  padding: 0;
  display: grid; place-items: center;
  background: transparent;
  color: var(--brass);
  border: 0;
  border-radius: var(--r-ctrl);
  text-transform: none;
}
#eg-bar button:hover { background: rgba(184, 134, 11, .1); filter: none; }
#eg-bar button svg { width: 20px; height: 20px; }

#eg-bar .ctx {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  min-width: 0;
}
#eg-bar .ctx .label {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .22em;
  padding-left: .24em; text-transform: uppercase; color: var(--brass);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
#eg-bar .ctx .label img { width: 23px; height: 23px; object-fit: contain;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.5)); flex: none; }

/* L'emblème d'acte, dessiné pour la petite taille. L'ombre portée le
   décolle du fond sans lui ajouter de détail — à 23 px, un détail de
   plus est un détail illisible de plus. */
.eg-glyph { flex: none; display: block;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .65)); }
#eg-bar .ctx .rail { width: min(160px, 42vw); }

/* ---------- éléments de jeu réutilisés ---------- */

.hud {
  display: flex; flex-wrap: wrap; gap: 10px 22px;
  font-family: var(--mono); font-size: 12px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--brass);
  margin: 0 0 18px;
}
.hud b { color: var(--paper); font-weight: 600; }

.board-shell { display: flex; justify-content: center; margin: 4px 0 18px; }

.controls { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 16px; }

table.mini {
  width: 100%; border-collapse: collapse;
  font-family: var(--mono); font-size: 13px;
}
table.mini th, table.mini td {
  border: 1px solid rgba(232, 184, 75, .18);
  padding: 8px 9px; text-align: left;
}
table.mini th {
  color: var(--brass); font-weight: 500; text-transform: uppercase;
  font-size: 11px; letter-spacing: .1em;
}

/* ---------- cadenas à molettes (jours 3, 9, 14b, 20) ----------
   56 × 70 à toutes les tailles : au-dessus du plancher tactile de
   44 px, et une seule valeur au lieu d'une bascule à 560 px que le
   JavaScript devait dupliquer. Huit molettes passent à la ligne
   proprement en 4 + 4. */

.lock { display: flex; gap: 8px; justify-content: center; margin: 26px 0 8px; flex-wrap: wrap; }
.tumbler {
  width: 56px; height: 70px; overflow: hidden; position: relative;
  background:
    /* Le chiffre se pose au centre. Sur le laiton nu, il tombait à 1,65 de
       contraste — il en faut 3 pour du 28 px. Ce médaillon sombre le rend à
       8,9 et laisse la denture du laiton visible tout autour. */
    radial-gradient(circle at 50% 50%,
      rgba(12, 9, 5, .88) 0 28%, rgba(12, 9, 5, .55) 44%, transparent 60%),
    url('../../assets/pics/pencil-ui/tumbler-wheel.webp') center / 70px 70px no-repeat,
    rgba(15, 12, 9, .72);
  border: 0; border-radius: 50%;
  box-shadow: none;
  cursor: ns-resize; touch-action: none; user-select: none;
}
.tumbler .strip { position: absolute; left: 0; width: 100%; transition: top .22s cubic-bezier(.2,.8,.2,1); }
.tumbler .glyph {
  height: 70px; display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 28px; color: var(--paper-dim);
}
/* Or gravé, pas néon : le halo diffus disparaît. */
.tumbler .glyph.on { color: var(--brass-lit); }
.tumbler::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,.66), transparent 34%, transparent 66%, rgba(0,0,0,.66));
}
.tumbler.focus { filter: brightness(1.12); }

/* ---------- le cadre ----------------------------------------------------
   Un filet fin sur tout l'écran, avec quatre équerres. Il tient l'image
   de fond, qui sans lui déborde de partout, et il donne à chaque page le
   même bord — c'est l'écrin, pas la décoration. */

#eg-frame {
  position: fixed; inset: 7px;
  border: 1px solid rgba(184, 134, 11, .16);
  pointer-events: none;
  z-index: 400;
}
#eg-frame i {
  position: absolute; width: 22px; height: 22px;
  border: 1px solid rgba(232, 184, 75, .5);
}
#eg-frame i:nth-child(1) { top: -1px;    left: -1px;  border-right: 0; border-bottom: 0; }
#eg-frame i:nth-child(2) { top: -1px;    right: -1px; border-left: 0;  border-bottom: 0; }
#eg-frame i:nth-child(3) { bottom: -1px; left: -1px;  border-right: 0; border-top: 0; }
#eg-frame i:nth-child(4) { bottom: -1px; right: -1px; border-left: 0;  border-top: 0; }

/* ---------- le rail à nœuds ---------------------------------------------
   Remplace les tirets. Une ligne, un nœud par jour : fait, en cours,
   à venir. On lit l'avancement d'un acte sans compter. */

.rail {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  min-height: 12px;
}
.rail::before {
  content: ""; position: absolute; left: 5px; right: 5px; top: 50%;
  height: 1px; background: rgba(184, 134, 11, .22);
}
.rail i {
  position: relative;
  width: 10px; height: 10px; border-radius: 50%;
  border: 1px solid rgba(184, 134, 11, .45);
  background: var(--ink);
  flex: 0 0 auto;
}
.rail i.on { background: var(--brass); border-color: var(--brass); }
.rail i.now {
  width: 12px; height: 12px;
  background: var(--brass-lit); border-color: var(--brass-lit);
  box-shadow: 0 0 0 3px rgba(12, 10, 9, 1), 0 0 0 4px rgba(232, 184, 75, .45);
}

/* ---------- dispersion ---------- */

.motes { position: absolute; inset: 0; pointer-events: none; z-index: 0; }

/* ---------- les traces de Drosselmeier ---------------------------------
   Papier, graphite et ratures : la recompense appartient au carnet, pas a
   l'interface de controle. Elle reste en dehors des planches-indices. */

.meta-day {
  position: relative;
  display: grid;
  gap: 10px;
  margin: 34px 0 4px;
  padding: 22px 22px 20px;
  color: #302a23;
  background:
    linear-gradient(rgba(238, 223, 190, .93), rgba(216, 196, 157, .94)),
    url('../../assets/pics/ui-art/panel-texture.webp') center / 540px auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .32);
  transform: rotate(-.25deg);
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.sky-rings select {
  min-height: 44px;
  font-size: 16px;
}
.meta-day::before {
  content: "";
  position: absolute;
  inset: 8px 12px;
  border-top: 1px solid rgba(64, 54, 43, .18);
  border-bottom: 1px solid rgba(64, 54, 43, .12);
  pointer-events: none;
}
.meta-day span {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #695e50;
}
.meta-day h2 {
  margin: 0;
  color: #2c2721;
  font-family: var(--display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: .04em;
}
.meta-day p { position: relative; margin: 0; color: #40382f; line-height: 1.55; }
.meta-day strong {
  font-family: "Cormorant Garamond", cursive;
  font-style: italic;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: .04em;
  color: #27231f;
}
.meta-day.meta-decoded { grid-template-columns: 1fr auto; align-items: end; gap: 5px 18px; }
.meta-day.meta-decoded > span { grid-column: 1 / -1; }
.meta-day a {
  position: relative;
  min-height: var(--touch);
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 11.5px;
  color: #54493c;
}
.meta-day.meta-new { animation: meta-mark .6s ease both; }
.meta-artefact {
  position: relative;
  min-height: 74px;
  display: grid;
  place-items: center;
  padding: 14px;
  border-top: 1px solid rgba(64, 54, 43, .19);
  border-bottom: 1px solid rgba(64, 54, 43, .15);
  color: #211d19;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 22px;
  font-style: italic;
  letter-spacing: 0;
  text-align: center;
}
.meta-artefact code { font-family: var(--mono); font-size: 15px; line-height: 1.8; color: #2e2923; }
.meta-stars { font-size: 25px !important; letter-spacing: .18em !important; }
.meta-mirror { display: inline-block; font-size: 27px !important; letter-spacing: .16em !important; }
.meta-cells, .meta-shards, .meta-tiles, .meta-rings, .meta-crowns, .meta-tabs {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
}
.meta-cells b, .meta-cells i, .meta-shards b, .meta-tiles b, .meta-rings b, .meta-crowns b, .meta-tabs b {
  min-width: 38px; min-height: 38px; display: grid; place-items: center;
  border: 1px solid rgba(48, 41, 34, .38); font: 600 18px/1 var(--mono);
}
/* 1er octobre (r45) : les cases à lettre sont les cases noires, comme le dit le fragment. */
.meta-cells b { background: #2a251f; color: #f2e6c8; }
.meta-cells i { background: transparent; }
.meta-faint { color: rgba(34, 29, 24, .45) !important; text-shadow: 0 0 5px rgba(34,29,24,.22); font-size: 27px !important; }
.meta-path, .meta-dark, .meta-bridge, .meta-runes { font-size: 23px !important; letter-spacing: .08em !important; }
.meta-dark { display: block; width: 100%; padding: 14px; color: #eee3ca !important; background: #26221e; }
.meta-extract-form { position: relative; display: grid; gap: 6px; margin-top: 2px; }
.meta-extract-form label { font: 10.5px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: #695e50; }
.meta-extract-form > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.meta-extract-form input {
  min-width: 0; min-height: var(--touch); padding: 9px 11px;
  border: 1px solid rgba(56, 47, 38, .45); background: rgba(255, 250, 237, .48);
  color: #25211d; font: 600 18px/1.2 "Cormorant Garamond", Georgia, serif;
}
.meta-extract-form button { min-height: var(--touch); padding: 8px 16px; }
.meta-extract-form output { min-height: 1.3em; font: 11px/1.4 var(--mono); }
.meta-extract-form output.ko { color: #7d271f; }
.meta-extract-form output.ok { color: #2f623d; }
.meta-day details { position: relative; color: #4f4539; }
.meta-day summary { min-height: var(--touch); display: flex; align-items: center; cursor: pointer; font: 11px/1.4 var(--mono); }
.meta-day details p { padding: 2px 0 0 14px; border-left: 2px solid rgba(63,54,44,.2); }
.meta-note-own {
  padding: 11px 12px;
  border-left: 3px solid rgba(74, 61, 46, .35);
  background: rgba(255, 250, 237, .24);
}
.meta-note-own strong { font: 600 15px/1.4 var(--display); letter-spacing: .02em; }
@keyframes meta-mark { from { opacity: .35; transform: translateY(18px) rotate(-.25deg); } }

/* Une pièce du dossier est un constat, pas une seconde énigme. Le papier
   froid la distingue des traces manuscrites d'Elias sans ajouter de cadre
   décoratif ou de faux symbole. */
.case-evidence {
  position: relative;
  margin: 34px 0 4px;
  padding: 22px 22px 20px;
  color: #272724;
  background:
    linear-gradient(rgba(231, 229, 218, .96), rgba(205, 205, 194, .96)),
    url('../../assets/pics/ui-art/panel-texture.webp') center / 540px auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .32);
}
.case-evidence::before {
  content: ""; position: absolute; left: 16px; top: 0; bottom: 0;
  width: 2px; background: rgba(91, 34, 32, .55);
}
.case-evidence > span {
  font: 10.5px/1.4 var(--mono); letter-spacing: .12em;
  text-transform: uppercase; color: #665e55;
}
.case-evidence h2 {
  margin: 7px 0 2px; color: #282722; font: 600 20px/1.25 var(--display);
}
.case-evidence p { margin: 9px 0 0; color: #3d3b35; line-height: 1.55; }
.case-evidence .case-place {
  margin-top: 3px; font: 11px/1.4 var(--mono); color: #71695f;
}
.case-evidence a {
  min-height: var(--touch); display: inline-flex; align-items: center;
  margin-top: 9px; color: #4f4940; font: 11.5px/1.4 var(--mono);
}

/* ---------- petits écrans ---------- */

@media (max-width: 560px) {
  body { padding: 0 10px 90px; font-size: 16px; }
  .wrap { padding: 22px 16px 20px; }
  #eg-bar { padding: 0 2px; }
  .meta-day { padding: 18px 15px 16px; }
  .case-evidence { padding: 18px 15px 16px 24px; }
  .meta-day.meta-decoded { grid-template-columns: 1fr; }
  .meta-day.meta-decoded a { grid-column: 1; }
  .meta-extract-form > div { grid-template-columns: 1fr; }
  .meta-path, .meta-bridge, .meta-runes { font-size: 19px !important; letter-spacing: 0 !important; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001s !important; transition-duration: .001s !important; }
}

/* Avertissement persistant, dans le flux et lisible au clavier. */
#eg-storage-warning { position:sticky; top:0; z-index:100; padding:14px; margin:0 0 16px; background:#2b1712; color:#fff4df; border:2px solid #e1ae6d; }
#eg-storage-warning p { margin:0 0 10px; }
#eg-storage-warning button { color:#fff4df; border-color:#e1ae6d; }
/* Gabarit commun des pages de jour (1er octobre, r44, reports/logique-enigmes.md).
   Trois lignes en tête de page, « Où vous êtes », « Ce qu'il faut trouver » et
   « Comment », puis l'aide de manipulation, repliée. */
.consigne { display: grid; gap: 10px; margin: 14px 0 20px; }
.consigne > div { display: grid; grid-template-columns: 10.5em 1fr; gap: 12px; }
.consigne dt { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--brass); padding-top: 3px; }
.consigne dd { margin: 0; overflow-wrap: anywhere; }
.consigne dd .etapes { margin: 0; }
.manip { margin: 10px 0 16px; }
.manip summary { cursor: pointer; padding-block: 13px; font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--brass); }
.manip p { margin: 8px 0 0; font-family: var(--mono); font-size: 13px; line-height: 1.65; color: var(--paper-soft); }
@media (max-width: 520px) { .consigne > div { grid-template-columns: 1fr; gap: 2px; } }
/* r45 : la barre du haut est collante (54 px). Ce que la page fait défiler vers le haut
   s'arrête sous elle, et les titres repliables offrent une cible de 44 px au doigt. */
html { scroll-padding-top: 64px; }
.evidence details > summary, details.rules > summary, details.mechanism > summary,
details.mobile-guide > summary { padding-block: 13px; }
