/* Le bestiaire (/character-design/) : un vieux livre de cuir dont on tourne les pages (js/livre.js).
   Un feuillet = une feuille : son recto est la page de droite, son verso devient la page de gauche
   quand on l'a tourné. La largeur d'une page (--page) règle tout le reste, textes compris.
   Sans JavaScript, les pages se lisent simplement l'une sous l'autre. */

@property --t { syntax: "<number>"; inherits: true; initial-value: 0; }

.fiche-livre {
  --page: min(46vw, calc((100dvh - 9.5rem) * .75), 44rem);
  --encre: #2b2238;
  --encre-douce: #5c4f55;
  --sang: #8e1c17;
  --or: #d9b56b;
  --japonais: "Zen Old Mincho", "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  padding: max(.75rem, env(safe-area-inset-top)) .75rem max(.75rem, env(safe-area-inset-bottom));
}
@media (max-width: 760px), (orientation: portrait) {
  .fiche-livre { --page: min(calc(100vw - 1.5rem), calc((100dvh - 9.5rem) * .75)); }
}
@media (orientation: landscape) and (max-height: 540px) {
  .fiche-livre { --page: min(46vw, calc((100dvh - 6rem) * .75)); }
  .livre-index button { min-height: 36px; font-size: .95rem; }
  .livre-commandes .tourner { width: 40px; height: 40px; }
}

.fiche-livre::backdrop { background: rgba(12, 10, 20, .84); }
.fiche-livre[open] .livre-cadre { animation: poser-livre 800ms var(--ease-sortie) both; }
@keyframes poser-livre { from { opacity: 0; transform: translateY(2.5rem) scale(.94); } }

.livre-scene {
  width: 100%; align-self: center;
  display: flex; flex-direction: column; align-items: center; gap: .55rem;
  overflow-x: clip;
}

/* ---------- L'index des lunes : pleine lune = le personnage qu'on regarde ---------- */
.livre-index { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 1.25rem; }
.livre-index button {
  display: inline-flex; align-items: center; gap: .6rem; min-height: 44px; padding: .35rem .5rem;
  border: 0; background: none; cursor: pointer;
  font: inherit; font-family: var(--ecriture); font-size: 1.05rem; color: var(--papier-doux);
  transition: color var(--duree-courte) var(--ease-sortie);
}
.livre-index button:hover, .livre-index button[aria-current="true"] { color: var(--papier); }
.lune {
  width: .95em; height: .95em; flex: none; border-radius: 50%;
  box-shadow: inset -.3em 0 0 0 currentColor, 0 0 0 1px color-mix(in srgb, currentColor 35%, transparent);
  transition: background-color .5s, box-shadow .5s;
}
.livre-index [aria-current="true"] .lune {
  background: #c8372c; box-shadow: 0 0 0 1px #c8372c, 0 0 .7em rgba(200, 55, 44, .6);
}

/* ---------- Le livre ---------- */
.livre-cadre {
  position: relative; flex: none; align-self: flex-start;
  width: calc(var(--page) * 2); height: calc(var(--page) * 4 / 3);
  margin: .6rem 0 1.5rem calc(50% - var(--page));
  perspective: calc(var(--page) * 4.5);
  touch-action: pan-y pinch-zoom;
  -webkit-user-select: none; user-select: none;   /* on tire les pages : pas de texte surligné en passant */
}
.livre {
  position: absolute; inset: 0; transform-style: preserve-3d;
  transform: translateX(calc(var(--decal, -1) * 25%));
  transition: transform 1.1s cubic-bezier(.45, .05, .25, 1);
}
/* ombre sur la table : la moitié gauche n'existe que livre ouvert */
.livre::before, .livre::after {
  content: ""; position: absolute; top: 1%; bottom: -1%; width: 50%; transform: translateZ(-3px);
  border-radius: 8px; box-shadow: 0 2.2rem 3.5rem -1.2rem rgba(0, 0, 0, .9), 0 .6rem 1.2rem -.4rem rgba(0, 0, 0, .55);
  pointer-events: none;
}
.livre::before { left: 50%; }
.livre::after { left: 0; opacity: 1; transition: opacity .9s; }
.livre[data-p="0"]::after { opacity: 0; }

/* le plat arrière (cuir) et sa garde, sous toutes les pages */
.plat-arriere {
  position: absolute; left: 50%; top: -1.6%; width: 51.4%; height: 103.2%;
  transform: translateZ(-2px); padding: 4.4% 4.4% 4.4% 2%;
  background: url("/images/bestiaire/cuir.webp") center / cover, #5b2a24;
  border-radius: 0 .6em .6em 0;
}
.plat-arriere .garde, .garde-avant .ex-libris-fond {
  height: 100%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cg fill='%23e2bf74' fill-opacity='.2'%3E%3Cpath d='M14 7a7 7 0 1 0 0 14a8.8 8.8 0 0 1 0-14z'/%3E%3Cpath d='M42 35a7 7 0 1 0 0 14a8.8 8.8 0 0 1 0-14z'/%3E%3Ccircle cx='42' cy='14' r='1.3'/%3E%3Ccircle cx='14' cy='42' r='1.3'/%3E%3C/g%3E%3C/svg%3E") 0 0 / calc(var(--page) * .085) auto,
    linear-gradient(rgba(96, 30, 26, .74), rgba(66, 20, 22, .82)), url("/images/bestiaire/papier-c.webp") center / 100% 100%;
  box-shadow: inset 0 0 1.5em rgba(0, 0, 0, .45);
}
/* l'épaisseur des pages, sur la tranche */
.tranche { position: absolute; inset: 0; transform: translateZ(-1px); pointer-events: none; }
.tranche::before, .tranche::after {
  content: ""; position: absolute; top: .5%; bottom: -.7%; width: 50%;
  --feuilles: repeating-linear-gradient(0deg, #efe3c6 0 1px, #b9a47c 1px 2px);
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .5));
}
/* seules les tranches dépassent : en bas, et sur le bord extérieur */
.tranche::before {
  left: -.5%; border-radius: 3px 0 0 4px;
  background: var(--feuilles) bottom / 100% .5rem no-repeat, repeating-linear-gradient(90deg, #efe3c6 0 1px, #b9a47c 1px 2px) left / .5rem 100% no-repeat;
  transition: visibility 0s linear .75s;          /* attend que la couverture se soit posée à gauche */
}
.tranche::after {
  left: 50.5%; border-radius: 0 3px 4px 0;
  background: var(--feuilles) bottom / 100% .5rem no-repeat, repeating-linear-gradient(90deg, #efe3c6 0 1px, #b9a47c 1px 2px) right / .5rem 100% no-repeat;
}
.livre[data-p="0"] .tranche::before { visibility: hidden; transition-delay: 0s; }

/* ---------- Feuillets et pages ---------- */
.feuillet {
  --t: 0; --z: 0;
  position: absolute; top: 0; left: 50%; width: 50%; height: 100%;
  transform-origin: 0 50%; transform-style: preserve-3d;
  transform: translateZ(calc(var(--z) * .5px)) rotateY(calc(var(--t) * -180deg));
  transition: --t var(--duree, .95s) cubic-bezier(.42, .02, .2, 1) var(--retard, 0s);
}
.feuillet.tourne { --t: 1; }

.page {
  position: absolute; inset: 0; z-index: 0;
  display: flex; flex-direction: column;
  padding: 9% 6.5% 4.5% 8.5%;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  color: var(--encre);
  background: url("/images/bestiaire/papier-a.webp") center / 100% 100% no-repeat;
  font-size: max(.75rem, calc(var(--page) * .029));
  line-height: 1.4;
}
.verso { transform: rotateY(180deg); padding: 9% 8.5% 4.5% 11%; background-image: url("/images/bestiaire/papier-b.webp"); }
/* le creux de la reliure */
.page::after {
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: linear-gradient(90deg, rgba(52, 28, 12, .5), rgba(52, 28, 12, .14) 4%, rgba(52, 28, 12, 0) 12%);
}
.verso::after { background: linear-gradient(270deg, rgba(52, 28, 12, .5), rgba(52, 28, 12, .14) 4%, rgba(52, 28, 12, 0) 12%); }
/* la page s'assombrit en se détournant de la bougie */
.page::before {
  content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none;
  background: linear-gradient(90deg, rgba(22, 11, 5, .7), rgba(22, 11, 5, .25));
  opacity: calc(min(1, var(--t) * 2) * .85);
}
.verso::before {
  background: linear-gradient(270deg, rgba(22, 11, 5, .7), rgba(22, 11, 5, .25));
  opacity: calc(min(1, (1 - var(--t)) * 2) * .85);
}
.page[inert] { pointer-events: none; }

/* la page qui s'enroule (js/livre-courbe.js) : un calque WebGL au-dessus du livre, le temps d'une tourne ;
   la feuille HTML se cache pendant ce temps et reparaît à sa place à l'arrivée */
.livre-calque {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  transform: translateX(calc(var(--decal, -1) * 25%));
  transition: transform 1.1s cubic-bezier(.45, .05, .25, 1);
}
.livre-calque canvas { position: absolute; left: -15%; top: -15%; width: 130%; height: 130%; visibility: hidden; }
.livre-calque.actif canvas { visibility: visible; }
.feuillet.courbe { visibility: hidden; }
.livre .page:not(.couv) { cursor: default; }

/* ---------- Couverture ---------- */
.couverture { top: -1.6%; width: 51.4%; height: 103.2%; }
.couv {
  align-items: center; justify-content: center; gap: 3.5%; padding: 12% 11%; text-align: center;
  color: var(--or); cursor: pointer;
  background: url("/images/bestiaire/cuir.webp") center / cover, #5b2a24;
  border-radius: 0 .6em .6em 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .45), inset .9em 0 1.2em -.7em rgba(0, 0, 0, .7);
}
.couv::after {
  inset: 6%; border: 1.5px solid rgba(217, 181, 107, .55); border-radius: 2px; background: none;
  box-shadow: 0 0 0 .35em transparent, 0 0 0 calc(.35em + 1px) rgba(217, 181, 107, .3);
}
.couv h2 {
  margin: 0; font-family: var(--ecriture); font-weight: 400; color: var(--or);
  font-size: calc(var(--page) * .088); line-height: 1.05;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, .65), 0 1px 0 rgba(255, 226, 160, .2);
}
.couv-sous {
  margin: 0; font-size: calc(var(--page) * .027); letter-spacing: .32em; text-transform: uppercase;
  color: rgba(217, 181, 107, .82); text-shadow: 0 -1px 0 rgba(0, 0, 0, .6);
}
.embleme { width: 36%; filter: drop-shadow(0 -1px 0 rgba(0, 0, 0, .6)) drop-shadow(0 1px 0 rgba(255, 228, 165, .25)); }
.coins i {
  position: absolute; width: 12%; aspect-ratio: 1;
  background: radial-gradient(circle at 30% 30%, #f1d898, #b48c46 46%, #6a4c22 88%);
  clip-path: polygon(0 0, 100% 0, 100% 24%, 24% 100%, 0 100%);
  filter: drop-shadow(1px 1px 1px rgba(0, 0, 0, .6));
}
.coins i:nth-child(1) { top: 0; left: 0; }
.coins i:nth-child(2) { top: 0; right: 0; scale: -1 1; }
.coins i:nth-child(3) { bottom: 0; left: 0; scale: 1 -1; }
.coins i:nth-child(4) { bottom: 0; right: 0; scale: -1 -1; }

/* dedans de la couverture : cuir rabattu, garde, ex-libris */
.garde-avant {
  padding: 4.4% 2% 4.4% 4.4%; justify-content: center;
  background: url("/images/bestiaire/cuir.webp") center / cover, #5b2a24;
  border-radius: .6em 0 0 .6em;
}
.garde-avant .ex-libris-fond { position: absolute; inset: 4.4% 2% 4.4% 4.4%; height: auto; }
.ex-libris {
  position: relative; margin: auto; width: 60%; padding: 9% 6% 7%; text-align: center;
  background: url("/images/bestiaire/papier-c.webp") center / 100% 100%;
  rotate: -1.4deg; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .45));
}
.ex-libris p { margin: 0; font-size: .82em; letter-spacing: .28em; text-transform: uppercase; color: var(--encre-douce); }
.ex-libris .signature {
  margin: .35em 0 .6em; font-family: var(--ecriture); font-size: 1.9em; letter-spacing: 0; text-transform: none; color: var(--encre);
}
.ex-libris img { width: 16%; height: auto; margin: 0 auto; mix-blend-mode: multiply; opacity: .9; }

/* ---------- Contenu des pages ---------- */
.page header { position: relative; padding-bottom: .55em; }   /* plus de filet sous le titre (Sarah, 2026-11-29) */
.page h3 {
  margin: 0; font-family: var(--ecriture); font-weight: 400;
  font-size: calc(var(--page) * .062); line-height: 1.08;
}
.page h3 [lang="ja"], .sous-titre [lang="ja"] {
  margin-left: .45em; font-family: var(--japonais); font-size: .46em; letter-spacing: .1em; color: var(--sang); white-space: nowrap;
}
.sous-titre { margin: .35em 0 0; color: var(--encre-douce); }
.sous-titre [lang="ja"] { font-size: .95em; }

/* rangée de lunes, comme dans un almanach */
.lunes { position: absolute; top: 3.4%; right: 8%; display: flex; gap: .4em; margin: 0; font-size: calc(var(--page) * .021); color: var(--sang); opacity: .85; }
.lunes i { width: 1em; height: 1em; border-radius: 50%; box-shadow: inset var(--o, 0) 0 0 0 currentColor, 0 0 0 .07em color-mix(in srgb, currentColor 45%, transparent); }
.lunes i:nth-child(1) { --o: -.24em; } .lunes i:nth-child(2) { --o: -.46em; } .lunes i:nth-child(3) { --o: -.66em; }
.lunes i:nth-child(5) { --o: .66em; } .lunes i:nth-child(6) { --o: .46em; } .lunes i:nth-child(7) { --o: .24em; }
.lunes .rouge { background: currentColor; }

/* le nom en japonais, en tampon vertical dans la marge */
.tampon {
  position: absolute; left: 2.4%; top: 12%; margin: 0; padding: .55em .2em;
  writing-mode: vertical-rl; font-family: var(--japonais); font-size: calc(var(--page) * .027); letter-spacing: .22em;
  color: var(--sang); border: 1.5px solid var(--sang); opacity: .82;
}

/* planche collée, coins photo */
.planche { position: relative; margin: auto 0 0; padding-top: 4%; rotate: var(--incl, 0deg); }
/* sans numéro de page en bas (Sarah, 2026-11-29), le dernier élément de la page garde la même marge libre dessous
   que la planche en a dessus : la planche reste au milieu de la page au lieu de tomber en bas */
.page[data-folio]:not(.fin) > :last-child { margin-bottom: auto; }
.planche button, .imprime button {
  position: relative; display: block; width: 100%; border: 0; cursor: zoom-in; font: inherit;
}
.planche button {
  padding: 2.2%; background: #efe4cb;
  box-shadow: 0 1px 1px rgba(40, 20, 8, .35), 0 .7em 1.2em -.6em rgba(40, 20, 8, .7);
  transition: transform var(--duree-courte) var(--ease-sortie), box-shadow var(--duree-courte) var(--ease-sortie);
}
.planche button::after {
  content: ""; position: absolute; inset: -.3em; pointer-events: none; --c: #2a1c15;
  background:
    linear-gradient(135deg, var(--c) 0 50%, transparent 51%) top left / 1.7em 1.7em no-repeat,
    linear-gradient(225deg, var(--c) 0 50%, transparent 51%) top right / 1.7em 1.7em no-repeat,
    linear-gradient(45deg, var(--c) 0 50%, transparent 51%) bottom left / 1.7em 1.7em no-repeat,
    linear-gradient(315deg, var(--c) 0 50%, transparent 51%) bottom right / 1.7em 1.7em no-repeat;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .45));
}
@media (hover: hover) {
  .planche button:hover { transform: translateY(-2px); box-shadow: 0 1px 1px rgba(40, 20, 8, .35), 0 1em 1.6em -.6em rgba(40, 20, 8, .75); }
}
.planche img, .imprime img { width: 100%; height: auto; }
.planche figcaption {
  margin-top: .75em; text-align: center; font-family: var(--ecriture); font-size: 1.05em; color: var(--encre-douce);
}
.page button:focus-visible { outline: 2px solid var(--sang); outline-offset: 3px; }

/* dessin imprimé à même la page */
.imprime { margin: auto -3% 0; }
.imprime button { padding: 0; background: none; }
.imprime img { mix-blend-mode: multiply; opacity: .94; }

.notes {
  margin: 5% 0 0; padding: 0 0 0 1.2em; list-style: "–  ";
  font-family: var(--ecriture); font-size: 1.02em; line-height: 1.45;
}

/* sommaire */
.sommaire h3 { margin-top: 12%; text-align: center; font-size: calc(var(--page) * .082); }
.sommaire > .sous-titre { text-align: center; letter-spacing: .06em; }
.sommaire ol { list-style: none; margin: 12% 0 0; padding: 0; display: grid; gap: .3em; }
/* une entrée : une lune et son nom écrit à la main par Sarah (ses mots entiers, pas la police lettre à lettre).
   Plus de numéro de chapitre, de pointillés ni de numéro de page (Sarah, 2026-11-29 : aucun numéro sur le site).
   Ne jamais nommer un élément .points ici : c'est le calque des coins cliquables des pièces (css/jeu.css, position
   absolue sur toute la page), qui couvrait tout le sommaire. */
.sommaire li button {
  display: flex; align-items: baseline; gap: .6em; width: 100%; min-height: 44px; padding: .35em 0;
  border: 0; background: none; cursor: pointer; text-align: left;
  font: inherit; font-family: var(--lecture); font-size: 1.18em; color: var(--encre);
  transition: color .2s ease;
}
.sommaire .lune { align-self: center; color: var(--sang); }
.sommaire .nom > .ecrit { --x: .62em; }
.sommaire .nom [lang="ja"] { display: inline-block; margin-left: .4em; font-family: var(--japonais); font-size: .62em; color: var(--sang); }
@media (hover: hover) { .sommaire li button:hover { color: var(--sang); } }
.cercle-lunes { width: 62%; margin: auto auto 0; color: var(--encre); opacity: .62; overflow: visible; }
.cercle-lunes .rouge { fill: var(--sang); stroke: var(--sang); }
.sommaire .mot { margin: auto 0 4%; text-align: center; font-size: .95em; color: var(--encre-douce); }

.fin { justify-content: center; text-align: center; }
.fin .lunes { position: static; justify-content: center; margin-bottom: 1.2em; font-size: calc(var(--page) * .028); }
.a-suivre { margin: 0 0 auto; font-family: var(--ecriture); font-size: 1.35em; color: var(--encre-douce); }
.fin .lunes { margin-top: auto; }

/* le signet */
.ruban {
  position: absolute; left: 53.5%; top: 97%; width: 2.1%; height: 6.5%;
  transform: translateZ(4px); pointer-events: none;
  background: linear-gradient(90deg, #6e130f, #b0261d 45%, #7d1611);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 86%, 0 100%);
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .5));
}

/* ---------- Commandes ---------- */
.livre-commandes { display: flex; align-items: center; gap: 1rem; }
.tourner {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 50%; cursor: pointer;
  border: 1px solid rgba(184, 146, 90, .55); background: rgba(15, 13, 29, .45); color: var(--laiton);
  transition: background-color var(--duree-courte), border-color var(--duree-courte), opacity var(--duree-courte);
}
.tourner:hover:not(:disabled) { background: rgba(184, 146, 90, .18); border-color: var(--laiton); }
/* une flèche tracée à la main (images/fleches/, comme .fleche dans css/jeu.css), retournée pour la page d'avant */
.tourner span {
  width: 1.5rem; height: .94rem; scale: -1 1; background: currentColor;
  -webkit-mask: url(/images/fleches/fleche.svg) no-repeat center / contain; mask: url(/images/fleches/fleche.svg) no-repeat center / contain;
}
.tourner[data-sens="1"] span { scale: none; }
.tourner:disabled { opacity: .28; cursor: default; }
.livre-folio { min-width: 11rem; margin: 0; text-align: center; font-family: var(--ecriture); font-size: 1rem; color: var(--papier-doux); }
.fiche-livre .reposer { margin: 0; }
.fiche-livre .reposer a { color: var(--papier-doux); }
.fiche-livre .reposer a:hover { color: var(--papier); }

/* ---------- Téléphone : le livre tient dans l'écran (Sarah, 2026-11-29) ----------
   La croix en haut à droite le referme (css/jeu.css, .fiche-fermer), la page prend toute la largeur, et dessous il ne
   reste qu'une ligne : deux flèches tracées à la main et le nom du chapitre. L'index des lunes s'en va : le sommaire,
   dans le livre, mène déjà à chaque personnage. */
@media (max-width: 760px), (orientation: landscape) and (max-height: 500px) {
  .js .livre-index { display: none; }
  .livre-scene { gap: 0; }
  .livre-commandes { gap: .25rem; }
  .livre-commandes .tourner { width: 52px; height: 44px; border: 0; border-radius: 0; background: none; color: var(--papier); filter: drop-shadow(0 1px 3px rgba(10, 8, 20, .9)); }
  .livre-commandes .tourner:hover:not(:disabled) { background: none; }
  .livre-commandes .tourner:is(:active, :focus-visible):not(:disabled) { color: #ffe2b0; outline: none; filter: drop-shadow(0 0 7px rgba(242, 184, 102, .85)) drop-shadow(0 1px 3px rgba(10, 8, 20, .9)); }
  .livre-commandes .tourner span { width: 1.85rem; height: 1.16rem; }
  .livre-folio { min-width: 0; width: 11.5rem; font-size: 1.05rem; color: var(--papier); }
  /* la mention du bas du sommaire débordait de la page, sous le livre */
  .sommaire .mot { display: none; }
}
@media (max-width: 760px) and (orientation: portrait) {
  .fiche-livre {
    --page: min(calc(100vw - 1.5rem), calc((100dvh - 8.6rem - max(.3rem, env(safe-area-inset-top)) - max(.75rem, env(safe-area-inset-bottom))) * .75));
    padding-top: calc(max(.3rem, env(safe-area-inset-top)) + 3.1rem);
  }
  .livre-cadre { margin-block: .25rem .7rem; }
}
@media (max-width: 760px) and (orientation: landscape), (orientation: landscape) and (max-height: 500px) {
  .fiche-livre {
    --page: min(40vw, calc((100dvh - 5rem) * .75));
    padding: .5rem calc(max(.3rem, env(safe-area-inset-right)) + 3.1rem) max(.5rem, env(safe-area-inset-bottom)) max(.75rem, env(safe-area-inset-left));
  }
  .livre-cadre { margin-block: .15rem .5rem; }
}

/* ---------- Une planche en grand ---------- */
.visionneuse-livre {
  width: 100%; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 1rem;
  border: 0; background: transparent; color: var(--papier); cursor: zoom-out;
}
.visionneuse-livre[open] { display: grid; place-items: center; align-content: center; gap: .6rem; }
.visionneuse-livre::backdrop { background: rgba(10, 8, 16, .92); }
.visionneuse-livre[open]::backdrop { animation: voile var(--duree-courte) var(--ease-sortie) both; }
.visionneuse-livre figure { display: grid; justify-items: center; gap: .6rem; margin: 0; }
.visionneuse-livre img {
  width: auto; height: auto; max-width: min(100%, 1600px); max-height: calc(100dvh - 7rem);
  box-shadow: 0 1.5rem 3rem -1rem #000;
}
.visionneuse-livre[open] img { animation: prendre 380ms var(--ease-sortie) both; }
.visionneuse-livre.fond-papier img { padding: clamp(1rem, 3vw, 2.5rem); background: url("/images/bestiaire/papier-c.webp") center / 100% 100%; }
.visionneuse-livre figcaption { font-family: var(--ecriture); font-size: 1.1rem; }
.visionneuse-livre .fermer { margin: 0; font-size: var(--t-petit); color: var(--papier-doux); }

@media (prefers-reduced-motion: reduce) {
  .feuillet, .livre, .livre::after, .lune, .livre-calque { transition: none; }
  .fiche-livre[open] .livre-cadre { animation: none; }
  .visionneuse-livre[open] img { animation: none; }
}

/* ---------- Sans JavaScript : les pages l'une sous l'autre ---------- */
html:not(.js) .fiche-livre { --page: min(calc(100vw - 2rem), 34rem); }
html:not(.js) .livre-index, html:not(.js) .livre-commandes, html:not(.js) .plat-arriere,
html:not(.js) .tranche, html:not(.js) .ruban, html:not(.js) .garde-avant, html:not(.js) .livre::before,
html:not(.js) .livre::after { display: none; }
html:not(.js) .livre-cadre { width: var(--page); height: auto; margin: 0 auto; perspective: none; align-self: center; }
html:not(.js) .livre { position: static; transform: none; display: grid; gap: 1rem; }
html:not(.js) .feuillet { display: contents; }
html:not(.js) .page { position: relative; inset: auto; min-height: calc(var(--page) * 4 / 3); transform: none; }
html:not(.js) .page::before { display: none; }
html:not(.js) .fiche-livre:target { background: var(--nuit-profonde); }

/* Ses titres écrits à la main (outils/police-ecriture.py → images/titres/*.svg), à la couleur de l'encre.
   Le texte reste dans le titre pour le lecteur d'écran et la recherche. */
.titre-main {
  display: inline-block; vertical-align: -.28em;
  height: 1.3em; aspect-ratio: var(--ratio);
  background: currentColor;
  -webkit-mask: var(--src) no-repeat center / contain; mask: var(--src) no-repeat center / contain;
}
.sommaire h3 .titre-main { height: 1.6em; }
