/* Temple du Savoir — feuille de style unique.
   Les couleurs et polices se règlent dans le bloc :root ci-dessous. */

@font-face {
  font-family: "Pinyon Script";
  src: url("/assets/fonts/PinyonScript-Regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  --papier: #e8dfc3;          /* fond des pages */
  --papier-ombre: #d3c69f;    /* bords du parchemin (vignettage) */
  --encre: #15110a;           /* texte */
  --lien: #2b1d07;
  --lien-survol: #7a4b0c;
  --accent: #8a5a12;          /* couleur d'ornement (or bruni) : ornements, survols */
  --menu-haut: #9a9479;       /* dégradé de la barre de menu */
  --menu-bas: #625d49;
  --menu-texte: #f6f2e2;
  --sous-menu: #4c4837;
  --fiche-haut: rgba(140, 132, 92, .62);
  --fiche-bas: rgba(108, 101, 68, .62);
  --pied: #26231a;
  --script: "Pinyon Script", "Snell Roundhand", "Brush Script MT", cursive;
  --largeur: 980px;
  /* texture de papier (bruit fin, sans fichier image) */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .38 0 0 0 0 .27 0 0 0 0 .1 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  color: var(--encre);
  font: 15px/1.45 "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: #1d1b14 url("/assets/img/fond-bibliotheque.jpg") center top / cover fixed no-repeat;
}

::selection { background: rgba(138, 90, 18, .35); }

img { max-width: 100%; height: auto; }

a {
  color: var(--lien);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  text-decoration-color: rgba(43, 29, 7, .45);
  transition: color .15s, text-decoration-color .15s;
}
a:hover, a:focus-visible { color: var(--lien-survol); text-decoration-color: currentColor; }

.lien-evitement {
  position: absolute; left: -999px; top: 0; background: #fff; color: #000; padding: 8px 12px; z-index: 100;
}
.lien-evitement:focus { left: 8px; top: 8px; }

/* ---- Cadre général : le « livre » posé devant la bibliothèque --------------------- */
.page {
  max-width: var(--largeur);
  margin: 0 auto;
  min-height: 100vh;
  background:
    var(--grain),
    radial-gradient(ellipse at 50% 0%, rgba(255, 250, 230, .55), transparent 60%),
    var(--papier);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, .55),
    0 12px 30px rgba(0, 0, 0, .55),
    0 30px 90px rgba(0, 0, 0, .55);
  display: flex;
  flex-direction: column;
}
main {
  flex: 1; padding: 24px 36px 48px;
  /* bords du parchemin légèrement assombris + ombre portée par la barre de menu */
  box-shadow:
    inset 0 14px 14px -12px rgba(0, 0, 0, .4),
    inset 0 0 110px rgba(140, 105, 50, .28);
  animation: apparition .45s ease-out both;
}
@keyframes apparition { from { opacity: 0; } to { opacity: 1; } }

.entete { line-height: 0; position: relative; }
.entete img { width: 100%; display: block; }
.entete::after {           /* léger assombrissement des bords de la bannière */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 60px rgba(60, 35, 5, .45);
}

/* ---- Menu ---------------------------------------------------------------- */
.menu {
  background: linear-gradient(var(--menu-haut), var(--menu-bas));
  border-top: 1px solid rgba(0, 0, 0, .5);
  border-bottom: 1px solid rgba(0, 0, 0, .6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), inset 0 -1px 0 rgba(255, 255, 255, .08), 0 4px 10px rgba(0, 0, 0, .35);
  position: relative;
  z-index: 20;
}
.menu-bouton { display: none; }
.menu-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; }
.menu-liste a { text-decoration: none; }

.niveau1 { position: relative; }
.niveau1 > a {
  display: block; padding: 12px 16px; color: var(--menu-texte); font-size: 13px; letter-spacing: .03em;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .55);
  transition: background .15s, box-shadow .15s;
}
.niveau1:hover > a, .niveau1:focus-within > a, .niveau1 > a.actif {
  background: linear-gradient(rgba(0, 0, 0, .34), rgba(0, 0, 0, .18)); color: #fff;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, .45);
}
.niveau1 > a.actif { box-shadow: inset 0 2px 5px rgba(0, 0, 0, .45), inset 0 -2px 0 #e0b85c; }

.sm-fleche { display: none; }

.sous-menu {
  position: absolute; left: 0; top: 100%; min-width: 250px; margin: 0; padding: 6px 0;
  list-style: none; background: linear-gradient(#57533f, var(--sous-menu));
  border: 1px solid rgba(0, 0, 0, .55); border-top: 2px solid #e0b85c; border-radius: 0 0 4px 4px;
  box-shadow: 0 14px 26px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .12);
  max-height: 80vh; overflow-y: auto;
  visibility: hidden; opacity: 0; transform: translateY(-6px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
}
.niveau1:last-child .sous-menu, .niveau1:nth-last-child(2) .sous-menu, .niveau1:nth-last-child(3) .sous-menu { left: auto; right: 0; }
.niveau1:hover > .sous-menu, .niveau1:focus-within > .sous-menu { visibility: visible; opacity: 1; transform: none; }
.sous-menu a {
  display: block; padding: 7px 18px; color: var(--menu-texte); font-size: 13px; text-shadow: 0 1px 1px rgba(0, 0, 0, .5);
  border-left: 3px solid transparent; transition: background .12s, border-color .12s, padding .12s;
}
.sous-menu a:hover, .sous-menu a:focus-visible {
  background: rgba(0, 0, 0, .32); color: #fff; border-left-color: #e0b85c; padding-left: 22px;
}
.sous-menu .groupe {
  padding: 10px 18px 3px; font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: #d6c78f;
}
.sous-menu.deux-colonnes { columns: 2; column-gap: 0; min-width: 460px; max-height: none; overflow: visible; }
.sous-menu li { break-inside: avoid; }
.sous-menu .groupe:not(:first-child) { border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 6px; }

/* ---- Contenu ---------------------------------------------------------------- */
h1 {
  position: relative;
  font: 400 46px/1.15 var(--script);
  text-align: center;
  margin: 10px 0 22px;
  padding-bottom: 22px;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, .55), 2px 3px 5px rgba(70, 45, 10, .35);
}
/* filet orné : trait dégradé + losange central */
h1::before {
  content: ""; position: absolute; left: 6%; right: 6%; bottom: 8px; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(60, 40, 10, .65) 25%, rgba(60, 40, 10, .65) 75%, transparent);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .5);
}
h1::after {
  content: ""; position: absolute; left: 50%; bottom: 3px; width: 12px; height: 12px;
  background: var(--accent); transform: translateX(-50%) rotate(45deg);
  box-shadow: 0 0 0 4px var(--papier), 0 0 0 5px rgba(60, 40, 10, .55), 1px 2px 4px rgba(0, 0, 0, .4);
}
h2 { font: 400 34px/1.25 var(--script); margin: 1.3em 0 .5em; text-shadow: 1px 1px 0 rgba(255, 255, 255, .5), 1px 2px 3px rgba(70, 45, 10, .25); }
h3 {
  font: 400 21px/1.3 Georgia, "Times New Roman", serif; margin: 1.5em 0 .5em; padding-bottom: 4px;
  border-bottom: 1px solid rgba(60, 40, 10, .25); text-shadow: 0 1px 0 rgba(255, 255, 255, .45);
}

p, ul, ol { margin: 0 0 .85em; }
main p { text-align: justify; hyphens: auto; }
ul, ol { padding-left: 1.4em; }
li { margin-bottom: .25em; }
li::marker { color: var(--accent); }

.c { text-align: center !important; }
.r { text-align: right !important; }

figure { margin: 1.3em auto; text-align: center; }
figure img {
  display: inline-block; border: 4px solid rgba(255, 252, 240, .55); border-radius: 3px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 18px rgba(40, 25, 5, .45);
}

.intro {
  position: relative; border: 1px solid rgba(21, 17, 10, .85); background: rgba(255, 255, 255, .28);
  padding: 10px 14px; margin: 16px 0 22px; font-style: italic;
  outline: 1px solid rgba(21, 17, 10, .3); outline-offset: 3px;
  box-shadow: inset 0 0 22px rgba(110, 75, 25, .22), 0 3px 8px rgba(40, 25, 5, .28);
}
.intro p:last-child { margin-bottom: 0; }

.fiche {
  float: left; width: 300px; max-width: 100%; margin: 4px 26px 16px 0; padding: 14px 18px;
  background: linear-gradient(var(--fiche-haut), var(--fiche-bas));
  border: 1px solid rgba(45, 35, 10, .6); border-radius: 3px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .35), inset 0 0 26px rgba(50, 38, 8, .28),
    0 2px 3px rgba(0, 0, 0, .3), 0 10px 22px rgba(30, 20, 4, .4);
}
.fiche p { text-align: left; }
.fiche p:last-child, .fiche ul:last-child { margin-bottom: 0; }

.credits {
  clear: both; margin-top: 2.6em; padding-top: 1em; font: italic 12px/1.5 Georgia, "Times New Roman", serif; text-align: center;
  border-top: 1px solid transparent;
  border-image: linear-gradient(90deg, transparent, rgba(60, 40, 10, .45), transparent) 1;
}
.credits p { text-align: center; margin: 0 0 .3em; }

.lien-a-definir { text-decoration: underline dotted; cursor: help; }

.musique {
  text-align: center; margin: 0 auto 20px; max-width: 760px; padding: 10px 12px 12px;
  background: rgba(255, 255, 255, .22); border-radius: 4px;
  box-shadow: inset 0 0 14px rgba(110, 75, 25, .2), 0 3px 8px rgba(40, 25, 5, .25);
}
.musique p { margin: 0 0 6px; font-size: 14px; text-align: center; font-style: italic; }
.musique iframe { width: 100%; height: 116px; border: 0; border-radius: 3px; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }

/* ---- Liste des races -------------------------------------------------------- */
.grille-races { list-style: none; margin: 14px 0 34px; padding: 0; display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; }
.grille-races li { margin: 0; width: 158px; }
.grille-races a {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%;
  padding: 16px 8px 12px; text-decoration: none; border-radius: 4px;
  border: 1px solid rgba(60, 40, 10, .4);
  background: linear-gradient(rgba(255, 253, 240, .62), rgba(214, 198, 150, .5));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 -10px 18px -12px rgba(90, 60, 15, .35),
    0 2px 3px rgba(0, 0, 0, .28), 0 8px 16px -6px rgba(40, 25, 5, .45);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.grille-races a:hover, .grille-races a:focus-visible {
  transform: translateY(-5px);
  border-color: var(--accent);
  background: linear-gradient(rgba(255, 255, 250, .85), rgba(232, 215, 165, .7));
  box-shadow:
    inset 0 1px 0 #fff, 0 0 0 2px rgba(224, 184, 92, .55),
    0 4px 6px rgba(0, 0, 0, .25), 0 16px 26px -6px rgba(40, 25, 5, .55);
}
.grille-races .sprites { display: flex; gap: 4px; align-items: flex-end; justify-content: center; min-height: 68px; }
.grille-races .sprites img {
  height: 62px; width: auto; max-width: 56px;
  filter: drop-shadow(0 3px 2px rgba(30, 20, 5, .5)); transition: transform .18s ease;
}
.grille-races a:hover .sprites img { transform: scale(1.08); }
.grille-races .nom { font: 400 25px/1 var(--script); color: var(--encre); text-shadow: 0 1px 0 rgba(255, 255, 255, .6); }

/* ---- Accueil ---------------------------------------------------------------- */
.accueil main { padding-top: 0; box-shadow: inset 0 0 110px rgba(140, 105, 50, .28); }
.hero {
  margin: 0 -36px 28px; padding: 74px 24px;
  background: #222 url("/assets/img/accueil-village.jpg") center / cover no-repeat;
  box-shadow: inset 0 0 130px rgba(0, 0, 0, .65), inset 0 12px 18px -8px rgba(0, 0, 0, .6), 0 6px 14px rgba(0, 0, 0, .35);
}
.hero-boite {
  max-width: 470px; margin: 0 auto; padding: 24px 28px; color: #fff; text-align: center;
  background: rgba(20, 18, 14, .72);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  border: 1px solid rgba(255, 255, 255, .8);
  box-shadow: 0 0 0 5px rgba(20, 18, 14, .55), 0 0 0 6px rgba(255, 255, 255, .3), 0 18px 45px rgba(0, 0, 0, .65);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .7);
}
.hero-boite h1 {
  font: 400 40px/1.15 "Helvetica Neue", Helvetica, Arial, sans-serif; margin: 0 0 14px; padding: 0; color: #fff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, .7);
}
.hero-boite h1::before, .hero-boite h1::after { display: none; }
.hero-boite p { text-align: center; font-size: 13px; margin: 0 0 12px; }
.hero-boite p:last-child { margin-bottom: 0; }
.hero-boite a { color: #f3d9a0; }

.bandeau { text-align: center; margin: 24px 0; }
.bandeau .bouton {
  display: inline-block; padding: 11px 26px; color: #fff; text-decoration: none; font-weight: 700; letter-spacing: .03em;
  background: linear-gradient(#8f8a72, #5b5743); border: 1px solid rgba(0, 0, 0, .6); border-radius: 3px;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 2px 3px rgba(0, 0, 0, .35), 0 8px 14px -4px rgba(0, 0, 0, .45);
  transition: transform .15s, box-shadow .15s, background .15s;
}
.bandeau .bouton:hover, .bandeau .bouton:focus-visible {
  color: #fff; transform: translateY(-2px);
  background: linear-gradient(#a19b80, #67624d);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 0 0 2px rgba(224, 184, 92, .6), 0 12px 18px -4px rgba(0, 0, 0, .5);
}

/* ---- Pied de page ----------------------------------------------------------- */
.pied {
  background: linear-gradient(#33301f, var(--pied)); color: #e8dfc3; text-align: center; padding: 22px 16px; font-size: 13px;
  border-top: 2px solid #b48a3c; box-shadow: inset 0 8px 14px -8px rgba(0, 0, 0, .6);
}
.pied p { margin: 0 0 6px; }
.pied a { color: #f0e6c4; margin: 0 8px; }
.pied .copyright { color: #a9a18a; margin: 0; }

/* ---- Mobile --------------------------------------------------------------------- */
@media (max-width: 800px) {
  main { padding: 16px 16px 34px; }
  h1 { font-size: 36px; }
  .fiche { float: none; width: auto; margin: 0 0 18px; }
  .hero { margin: 0 -16px 20px; padding: 36px 12px; }
  .hero-boite h1 { font-size: 30px; }

  .menu-bouton {
    display: block; width: 100%; padding: 12px; background: transparent; border: 0; color: var(--menu-texte);
    font: 700 14px Helvetica, Arial, sans-serif; letter-spacing: .08em; text-transform: uppercase; cursor: pointer;
  }
  .menu-liste { display: none; flex-direction: column; flex-wrap: nowrap; }
  .menu-liste.ouvert { display: flex; }
  .niveau1 { display: flex; flex-wrap: wrap; border-top: 1px solid rgba(255, 255, 255, .12); }
  .niveau1 > a { flex: 1; padding: 12px 16px; }
  .sm-fleche {
    display: block; width: 48px; background: rgba(0, 0, 0, .18); border: 0; color: var(--menu-texte);
    font-size: 16px; cursor: pointer;
  }
  .sous-menu {
    position: static; display: none; width: 100%; box-shadow: none; max-height: none; border: 0; border-radius: 0;
    visibility: visible; opacity: 1; transform: none; transition: none;
  }
  .sous-menu.deux-colonnes { columns: 1; min-width: 0; }
  .niveau1:hover > .sous-menu, .niveau1:focus-within > .sous-menu { display: none; }
  .niveau1.ouvert > .sous-menu { display: block; }
  .grille-races li { width: calc(50% - 9px); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

@media print {
  body { background: #fff; }
  .menu, .pied, .musique { display: none; }
  .page { box-shadow: none; }
}

/* ---- Décor pâle derrière le texte + galeries ---------------------------------- */
main.avec-fond { position: relative; isolation: isolate; }
main.avec-fond::before {
  content: ""; position: absolute; z-index: -1; top: 0; left: 0; right: 0; height: min(100%, 1250px);
  background: var(--fond) center top / 100% auto no-repeat;
  opacity: .17; filter: sepia(.55) saturate(.8);
  -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent);
  image-rendering: pixelated; pointer-events: none;
}
.galerie { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; align-items: flex-start; margin: 1.3em 0; clear: both; }
.galerie figure { margin: 0; }

/* ============================================================================================
   Pages de races : sprites dans le titre, jauges de magie, sommaire, navigation, filtres
   ============================================================================================ */

/* ---- Titre encadré par les sprites de la race ------------------------------------------- */
.titre-race { display: flex; align-items: flex-end; justify-content: center; gap: 18px; }
.titre-race h1 { flex: 0 1 auto; margin-left: 0; margin-right: 0; }
.titre-race h1::before { left: -10%; right: -10%; }
.sprites-titre { display: flex; gap: 4px; align-items: flex-end; padding-bottom: 26px; }
.sprites-titre img {
  width: auto; height: 62px; max-width: 56px; image-rendering: pixelated;
  filter: drop-shadow(0 4px 2px rgba(30, 20, 5, .5));
}
.sprites-titre.miroir img { transform: scaleX(-1); }

/* ---- Jauges de magie : bandes de parchemin, remplissage en pixels ----------------------- */
.jauges { list-style: none; padding: 0; margin: 0 0 .85em; }
.jauge { display: grid; grid-template-columns: 1fr auto; column-gap: 8px; align-items: baseline; margin: 0 0 10px; }
.jauge-nom { font-size: 14px; }
.jauge-val { font: 700 14px Georgia, "Times New Roman", serif; text-align: right; white-space: nowrap; }
.jauge-note { font-weight: 400; font-style: italic; font-size: 12px; }
.jauge-piste {
  grid-column: 1 / -1; display: block; height: 14px; margin-top: 3px; padding: 2px;
  background: linear-gradient(#efe6c6, #d9cb9c);
  border: 2px solid #3b2a10; border-radius: 0;
  box-shadow: inset 0 2px 3px rgba(60, 40, 10, .45), 1px 1px 0 rgba(255, 255, 255, .35);
}
.jauge-barre {
  display: block; height: 100%; width: var(--pct); min-width: 0;
  /* segments de 6 px = « gros pixels » */
  background:
    repeating-linear-gradient(90deg, transparent 0 4px, rgba(0, 0, 0, .28) 4px 6px),
    linear-gradient(rgba(255, 255, 255, .28) 0 25%, transparent 25% 75%, rgba(0, 0, 0, .22) 75% 100%),
    var(--encre-jauge, #555);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .55);
  transform-origin: left; animation: remplir .9s steps(12, end) both;
}
@keyframes remplir { from { width: 0; } }
.jauge-tenebre { --encre-jauge: #4b2a66; }
.jauge-vitale  { --encre-jauge: #a23a2c; }
.jauge-mana    { --encre-jauge: #2b62a3; }

/* ---- Sommaire ------------------------------------------------------------------------------ */
.sommaire {
  margin: 0 0 20px; padding: 0; background: linear-gradient(rgba(255, 253, 240, .7), rgba(224, 208, 160, .6));
  border: 1px solid rgba(60, 40, 10, .45); border-radius: 3px;
  box-shadow: inset 0 1px 0 #fff, 0 2px 3px rgba(0, 0, 0, .25), 0 8px 16px -6px rgba(40, 25, 5, .4);
}
.sommaire summary {
  cursor: pointer; padding: 9px 14px; font: 400 22px/1 var(--script); list-style: none; user-select: none;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .6);
}
.sommaire summary::-webkit-details-marker { display: none; }
.sommaire summary::after { content: " ▾"; font: 12px Helvetica, Arial, sans-serif; color: var(--accent); }
.sommaire[open] summary::after { content: " ▴"; }
.sommaire ol { list-style: none; margin: 0; padding: 0 8px 10px; }
.sommaire li { margin: 0; }
.sommaire a {
  display: block; padding: 4px 8px; font-size: 13px; text-decoration: none; border-left: 3px solid transparent;
  transition: background .12s, border-color .12s;
}
.sommaire .n3 a { padding-left: 20px; }
.sommaire a:hover, .sommaire a:focus-visible { background: rgba(255, 255, 255, .5); border-left-color: var(--accent); }
.sommaire a.en-cours { border-left-color: var(--accent); background: rgba(255, 255, 255, .55); font-weight: 700; }
h2[id], h3[id] { scroll-margin-top: 16px; }

/* Grand écran : le sommaire flotte dans la marge de droite */
@media (min-width: 1480px) {
  .sommaire {
    position: fixed; top: 96px; left: calc(50% + var(--largeur) / 2 + 22px); width: 230px; margin: 0;
    max-height: calc(100vh - 130px); overflow-y: auto;
  }
  .sommaire summary { cursor: default; pointer-events: none; }
  .sommaire summary::after { content: ""; }
}

/* ---- Navigation entre les races ------------------------------------------------------------- */
.voisines {
  clear: both; display: flex; gap: 12px; align-items: stretch; justify-content: space-between; flex-wrap: wrap;
  margin-top: 36px; padding-top: 22px;
  border-top: 1px solid transparent; border-image: linear-gradient(90deg, transparent, rgba(60, 40, 10, .5), transparent) 1;
}
.voisines a {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px; text-decoration: none;
  background: linear-gradient(rgba(255, 253, 240, .65), rgba(214, 198, 150, .5));
  border: 1px solid rgba(60, 40, 10, .4); border-radius: 3px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 2px 3px rgba(0, 0, 0, .28), 0 8px 14px -6px rgba(40, 25, 5, .4);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.voisines a:hover, .voisines a:focus-visible {
  transform: translateY(-3px); border-color: var(--accent);
  box-shadow: inset 0 1px 0 #fff, 0 0 0 2px rgba(224, 184, 92, .5), 0 12px 18px -6px rgba(40, 25, 5, .5);
}
.voisines img { height: 46px; width: auto; filter: drop-shadow(0 2px 1px rgba(30, 20, 5, .5)); image-rendering: pixelated; }
.voisines span { display: flex; flex-direction: column; font: 400 24px/1.05 var(--script); }
.voisines small { font: 11px Helvetica, Arial, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: #5b4a25; }
.voisines .suiv { flex-direction: row-reverse; text-align: right; }
.voisines .retour { align-self: center; font-size: 13px; padding: 9px 16px; }

/* ---- Filtres de la liste des races ------------------------------------------------------------ */
.filtres { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 4px 0 10px; }
.filtres[hidden], .compteur[hidden], .groupe-races[hidden], .grille-races li[hidden] { display: none; }
.filtres button {
  font: 700 13px Helvetica, Arial, sans-serif; padding: 8px 16px; cursor: pointer; color: var(--encre);
  background: linear-gradient(rgba(255, 253, 240, .7), rgba(214, 198, 150, .55));
  border: 1px solid rgba(60, 40, 10, .5); border-radius: 3px;
  box-shadow: inset 0 1px 0 #fff, 0 2px 3px rgba(0, 0, 0, .25);
  transition: transform .15s, box-shadow .15s, background .15s;
}
.filtres button:hover, .filtres button:focus-visible { transform: translateY(-2px); box-shadow: inset 0 1px 0 #fff, 0 0 0 2px rgba(224, 184, 92, .55), 0 6px 10px -3px rgba(0, 0, 0, .35); }
.filtres button.actif {
  color: #fff; background: linear-gradient(#7d7861, #57533f); text-shadow: 0 1px 1px rgba(0, 0, 0, .6);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, .45), inset 0 -2px 0 #e0b85c;
}
.compteur { font-size: 13px; font-style: italic; margin: 0 0 6px; }

@media (max-width: 800px) {
  .titre-race { flex-wrap: wrap; }
  .titre-race h1 { order: 2; flex-basis: 100%; }
  .sprites-titre { order: 1; padding-bottom: 0; }
  .voisines { flex-direction: column; }
  .voisines .retour { order: 3; }
}

/* ============================================================================================
   Bord de parchemin pixellisé (encadrés, sommaire, cartes)
   Image : « Parchment GUI » de zwonky, domaine public (CC0) — opengameart.org/content/parchment-gui
   Le cadre est multiplié avec le papier et légèrement désaturé pour se fondre dans la page.
   ============================================================================================ */
.fiche, .intro, .sommaire, .musique, .grille-races a, .voisines a { position: relative; }
.fiche::after, .intro::after, .sommaire::after, .musique::after, .grille-races a::after, .voisines a::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  border: 8px solid transparent;
  border-image: url("/assets/img/panneau-parchemin.png") 8 / 8px repeat;
  image-rendering: pixelated;
  mix-blend-mode: multiply;
  filter: grayscale(.45) sepia(.75) saturate(.55) brightness(.9) contrast(1.05);
}
/* grands encadrés : pixels doublés (bord plus marqué) */
.fiche::after, .intro::after { border-width: 16px; border-image-width: 16px; }
.fiche { border: 0; padding: 24px 26px; }
.intro { border: 0; outline: 0; padding: 20px 26px; }
.sommaire, .musique, .grille-races a, .voisines a { border-color: transparent; }
.sommaire summary { padding: 14px 18px 8px; }
.sommaire ol { padding: 0 16px 16px; }
.musique { padding: 16px 18px 18px; }
/* Sommaire flottant : le cadre reste fixe et seule la liste défile (sinon le cadre défilait avec elle) */
@media (min-width: 1480px) {
  .sommaire { position: fixed; overflow: visible; max-height: none; }
  .sommaire ol { max-height: calc(100vh - 190px); overflow-y: auto; margin: 0 12px 14px 10px; padding: 0 6px 0 4px; scrollbar-width: thin; }
}
@media (max-width: 800px) { .fiche { padding: 22px 20px; } .intro { padding: 18px 20px; } }
