/* L’Antre du Griffon, Tours : site d’exemple (boutique fictive) (Tigerhead Studio)
   DA : un grimoire de joueur, médiéval fantastique : nuit étoilée, parchemin vieilli (texture générée,
   outils/texture_parchemin.py), blasons, cartes de jeu génériques dessinées en SVG (cadre, gemme, rune),
   cases d'inventaire. Aucune image ni marque des jeux : leurs noms en texte seulement.
   Polices : Uncial Antiqua (titres, onciale) et Crimson Pro (texte). Couleurs en variables (coloris),
   sauf les éléments des cartes (feu, eau, forêt) et la matière (parchemin, encre). */

@font-face { font-family: "Uncial Antiqua"; src: url("polices/uncial-antiqua.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Crimson Pro"; src: url("polices/crimson-pro.woff2") format("woff2"); font-weight: 200 900; font-display: swap; }

/* Couleurs enregistrées pour que le changement de coloris se fasse en fondu */
@property --accent { syntax: "<color>"; inherits: true; initial-value: #8e1f1f; }
@property --accent-fonce { syntax: "<color>"; inherits: true; initial-value: #5e1212; }
@property --nuit { syntax: "<color>"; inherits: true; initial-value: #1f1a2e; }
@property --nuit-2 { syntax: "<color>"; inherits: true; initial-value: #2e2644; }
@property --or { syntax: "<color>"; inherits: true; initial-value: #c9962e; }
@property --or-clair { syntax: "<color>"; inherits: true; initial-value: #ebcb7c; }
html.coloris-anime { transition: --accent .5s, --accent-fonce .5s, --nuit .5s, --nuit-2 .5s, --or .5s, --or-clair .5s; }

:root {
  --accent: #8e1f1f;         /* sang de dragon : boutons, surtitres */
  --accent-fonce: #5e1212;
  --nuit: #1f1a2e;           /* ciel de l'accroche, pied */
  --nuit-2: #2e2644;
  --or: #c9962e;             /* filets, blasons, cadres */
  --or-clair: #ebcb7c;
  /* Matière (ne change pas avec le coloris) */
  --parchemin: #ecdcb4;
  --encre: #2a1a12;
  --encre-douce: #553c2a;
  --blanc: #fff8ea;
  --ombre: rgb(30 18 8 / .35);
  /* Éléments des cartes (fixes) */
  --feu: #c8441b;
  --eau: #2c6fa8;
  --foret: #3f7a3a;
  --texture: url("textures/parchemin.webp");
  --etoiles: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cg fill='%23f3e6c4'%3E%3Ccircle cx='14' cy='22' r='1'/%3E%3Ccircle cx='70' cy='60' r='.8'/%3E%3Ccircle cx='128' cy='18' r='1.3'/%3E%3Ccircle cx='190' cy='74' r='.9'/%3E%3Ccircle cx='40' cy='130' r='1.2'/%3E%3Ccircle cx='104' cy='110' r='.7'/%3E%3Ccircle cx='160' cy='150' r='1'/%3E%3Ccircle cx='206' cy='196' r='.8'/%3E%3Ccircle cx='86' cy='190' r='1.1'/%3E%3Ccircle cx='20' cy='206' r='.7'/%3E%3C/g%3E%3C/svg%3E");
  --titre: "Uncial Antiqua", "Cinzel", Georgia, serif;
  --texte: "Crimson Pro", Georgia, serif;
  --marge: clamp(1rem, 4vw, 2.5rem);
}
html[data-coloris="foret"] { --accent: #28512f; --accent-fonce: #1d3d25; --nuit: #15241b; --nuit-2: #213528; --or: #c9a24a; --or-clair: #e6cf86; }
html[data-coloris="arcane"] { --accent: #3b3f8f; --accent-fonce: #262a66; --nuit: #171a33; --nuit-2: #262b50; --or: #aab2c8; --or-clair: #dfe3ee; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; background: var(--nuit); }
body { margin: 0; background: var(--parchemin) var(--texture) 0 0 / 512px; color: var(--encre); font: 400 1.2rem/1.55 var(--texte); overflow-x: clip; }
img { display: block; max-width: 100%; height: auto; }
h1, h2 { font-family: var(--titre); }
h3 { font-family: var(--texte); font-weight: 700; }
h1, h2, h3 { font-weight: 400; font-synthesis: none; line-height: 1.15; margin: 0; }
h2 { font-size: clamp(1.9rem, 7vw, 2.8rem); color: var(--accent-fonce); margin-bottom: .8rem; }
p { margin: 0 0 1rem; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.entete :focus-visible, .accroche :focus-visible, .pied :focus-visible, .maquette :focus-visible { outline-color: var(--or-clair); }
section[id] { scroll-margin-top: 4.5rem; }

.evitement { position: absolute; left: -999px; top: 0; z-index: 50; padding: .8rem 1rem; background: var(--blanc); color: var(--encre); }
.evitement:focus { left: 1rem; }
.visuellement-cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Bandeau de maquette : discret */
.maquette { margin: 0; padding: .45rem var(--marge); background: #000; color: #e8e2d4; font: .85rem/1.4 system-ui, sans-serif; text-align: center; }
@media (max-width: 560px) { .maquette-plus { display: none; } }
.maquette a, .pied a { display: inline-block; padding: .8rem 0; margin: -.8rem 0; color: #fff; text-underline-offset: 2px; }

.surtitre { margin: 0 0 .5rem; font: 700 .9rem/1.3 var(--texte); letter-spacing: .2em; text-transform: uppercase; color: var(--accent); }
.a-confirmer { font-size: 1rem; font-style: italic; color: var(--encre-douce); padding-left: .7rem; border-left: 2px dashed var(--encre-douce); }
.insecable { white-space: nowrap; }
.lien { display: inline-block; padding: .5rem 0; font-weight: 700; color: var(--accent-fonce); text-underline-offset: .22em; }

/* ---------- En-tête ---------- */
.entete { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .8rem; padding: .45rem var(--marge); background: var(--nuit); color: var(--blanc); border-bottom: 2px solid var(--or); }
.marque { display: flex; align-items: center; gap: .55rem; min-width: 0; text-decoration: none; font: 1.35rem/1 var(--titre); color: var(--or-clair); }
.marque span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.marque-blason { flex: none; width: 2.4rem; height: 2.6rem; }
.nav { display: none; margin-left: auto; gap: .2rem; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .8rem; text-decoration: none; font-size: 1.05rem; }
.nav a:hover { color: var(--or-clair); text-decoration: underline; text-underline-offset: .3em; }
.entete > .bouton { flex: none; margin-left: auto; }
@media (min-width: 820px) { .nav { display: flex; } .entete > .bouton { margin-left: .4rem; } }
@media (max-width: 480px) { .sauf-etroit { display: none; } }
@media (max-width: 360px) { .entete .marque { font-size: .98rem; } }
@media (max-width: 480px) { .marque { font-size: 1.1rem; gap: .4rem; } .marque-blason { width: 2rem; height: 2.2rem; } .entete { gap: .5rem; } .entete > .bouton { padding-inline: .7rem; font-size: .95rem; } }

/* ---------- Boutons : un sceau de cire à filet d'or ---------- */
.bouton {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px;
  padding: .7rem 1.4rem; border: 2px solid var(--or); border-radius: 4px;
  background: var(--accent); color: var(--blanc); font: 700 1.1rem/1.2 var(--texte); letter-spacing: .02em;
  text-decoration: none; text-align: center; cursor: pointer;
  box-shadow: inset 0 0 0 2px var(--accent-fonce), 0 6px 14px -6px var(--ombre);
  transition: transform .2s, background-color .2s;
}
.bouton:hover { transform: translateY(-2px); background: var(--accent-fonce); }
.bouton-contour { background: transparent; color: var(--or-clair); box-shadow: none; }
.bouton-contour:hover { background: rgb(255 255 255 / .08); }
.bouton-petit { min-height: 44px; padding: .45rem .9rem; font-size: 1rem; }

/* ---------- Blasons (dessins communs) ---------- */
.b-ecu { fill: var(--accent); stroke: var(--or); stroke-width: 4; }
.b-filet { fill: none; stroke: var(--or); stroke-width: 1.5; opacity: .7; }
.b-carte { fill: var(--blanc); stroke: var(--or); stroke-width: 2; }
.b-couronne { fill: var(--or-clair); }

/* ---------- Accroche : nuit étoilée et éventail de cartes ---------- */
.accroche {
  position: relative; overflow: hidden; text-align: center; color: var(--blanc);
  padding: 2.6rem var(--marge) 0;
  background: radial-gradient(ellipse at 50% 110%, var(--nuit-2) 0 45%, transparent 75%), var(--etoiles) 0 0 / 220px, var(--nuit);
}
.accroche .surtitre { color: var(--or-clair); }
h1 { font-size: clamp(1.9rem, 9.4vw, 5rem); color: var(--or-clair); text-shadow: 0 2px 0 var(--accent-fonce), 0 0 24px rgb(0 0 0 / .5); overflow-wrap: anywhere; }
.sous-titre { max-width: 32rem; margin: .8rem auto 1.5rem; font-size: clamp(1.2rem, 3.6vw, 1.4rem); }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .8rem; }
.eventail { display: flex; justify-content: center; align-items: flex-end; margin-top: 2rem; padding-bottom: 0; height: clamp(11rem, 44vw, 17rem); }
.carte-cadre {
  position: relative; display: block; width: clamp(7.5rem, 30vw, 11.5rem); aspect-ratio: 250 / 350; margin: 0 -1.4rem;
  border-radius: 7%; overflow: hidden; transform-origin: 50% 120%;
  box-shadow: 0 14px 30px -8px rgb(0 0 0 / .6);
  transition: transform .4s cubic-bezier(.2,.8,.2,1);
  translate: 0 22%;
}
.carte-cadre:nth-child(1) { transform: rotate(-14deg); }
.carte-cadre:nth-child(2) { transform: translateY(-6%); z-index: 1; }
.carte-cadre:nth-child(3) { transform: rotate(14deg); }
.carte { display: block; width: 100%; height: 100%; }
/* Reflet holographique : une bande irisée qui traverse la carte au survol (composité : seul transform bouge) */
.carte-cadre::after {
  content: ""; position: absolute; inset: -20% -60%; pointer-events: none; opacity: 0;
  background: linear-gradient(110deg, transparent 38%, rgb(255 255 255 / .55) 46%, rgb(120 220 255 / .35) 50%, rgb(255 120 230 / .3) 54%, transparent 62%);
  mix-blend-mode: screen; transform: translateX(-45%);
}
@media (hover: hover) {
  .eventail:hover .carte-cadre:nth-child(1) { transform: rotate(-20deg) translateY(-4%); }
  .eventail:hover .carte-cadre:nth-child(3) { transform: rotate(20deg) translateY(-4%); }
  .carte-cadre:hover { z-index: 2; }
  .eventail .carte-cadre:hover { transform: translateY(-14%) rotate(0deg); }
  .carte-cadre:hover::after { opacity: 1; transform: translateX(45%); transition: transform .9s ease-out, opacity .2s; }
}
/* Les cartes (le symbole hérite des couleurs de l'élément) */
.carte-feu { --el: var(--feu); }
.carte-eau { --el: var(--eau); }
.carte-foret { --el: var(--foret); }
.c-bord { fill: #1a1410; stroke: var(--or); stroke-width: 3; }
.c-fond { fill: var(--el); }
.c-papier { fill: #efe1bd; }
.c-gemme { fill: var(--el); stroke: var(--or-clair); stroke-width: 2; }
.c-ligne { fill: #2a1a12; opacity: .28; }
.c-art { fill: #120e0c; stroke: var(--or); stroke-width: 2; }
.c-halo { fill: var(--el); opacity: .55; }
.rune { fill: none; stroke: #fff4d6; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.rune-pleine { fill: #fff4d6; stroke: none; }

/* ---------- Les jeux : un blason par jeu ---------- */
.jeux { padding: 3.5rem var(--marge); text-align: center; max-width: 70rem; margin: 0 auto; }
.intro { max-width: 36rem; margin: 0 auto 2rem; }
.blasons { list-style: none; margin: 0 0 2rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(6.4rem, 1fr)); gap: 1.2rem .5rem; }
.blasons a { display: grid; justify-items: center; gap: .4rem; min-height: 44px; padding: .4rem .2rem; text-decoration: none; border-radius: 6px; }
.blasons svg { width: 4.6rem; height: 5rem; transition: transform .25s; filter: drop-shadow(0 4px 4px rgb(42 26 18 / .3)); }
.blasons a:hover svg { transform: translateY(-3px) rotate(-3deg); }
.blasons span { font: 700 1.05rem/1.2 var(--texte); color: var(--encre); }
.ecu { fill: var(--accent); stroke: var(--or); stroke-width: 4; }
.ecu-b { fill: var(--nuit-2); }
.ecu-c { fill: var(--or); stroke: var(--accent-fonce); }
.charge { fill: var(--or-clair); }
.charge-trait { fill: none; stroke: var(--or-clair); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.ecu-b ~ .charge { fill: var(--or); }
.ecu-b ~ .charge-trait { stroke: var(--or); }
.ecu-c ~ .charge { fill: var(--accent-fonce); }
.ecu-c ~ .charge-trait { stroke: var(--accent-fonce); }
circle.ecu-b { stroke: none; }

/* ---------- Deux parchemins sur la nuit ---------- */
.deux-voies { padding: 4rem var(--marge); background: var(--etoiles) 0 0 / 220px, var(--nuit); display: grid; gap: 3.2rem 2rem; justify-content: center; grid-template-columns: minmax(0, 30rem); }
@media (min-width: 860px) { .deux-voies { grid-template-columns: repeat(2, minmax(0, 28rem)); } }
.parchemin {
  position: relative; padding: 2rem 1.6rem 1.4rem; color: var(--encre);
  background: var(--parchemin) var(--texture) 0 0 / 512px;
  box-shadow: inset 0 0 34px rgb(120 72 20 / .45), 0 16px 30px -12px rgb(0 0 0 / .6);
}
/* Les rouleaux du haut et du bas */
.parchemin::before, .parchemin::after {
  content: ""; position: absolute; left: -.8rem; right: -.8rem; height: 1.1rem; border-radius: .55rem;
  background: linear-gradient(#a57a3e, #e9d3a0 35%, #b88a48 70%, #7d5626);
  box-shadow: 0 3px 6px rgb(0 0 0 / .4);
}
.parchemin::before { top: -.55rem; }
.parchemin::after { bottom: -.55rem; }
.parchemin h3 { font-size: 1.9rem; color: var(--accent-fonce); margin-bottom: .6rem; }

/* ---------- Accessoires : cases d'inventaire ---------- */
.accessoires { padding: 3.5rem var(--marge); text-align: center; max-width: 64rem; margin: 0 auto; }
.inventaire { list-style: none; margin: 1.2rem 0 0; padding: 0; display: grid; gap: 1.6rem; }
@media (min-width: 700px) { .inventaire { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.inventaire svg {
  width: 6rem; height: 6rem; padding: 1rem; margin: 0 auto .8rem; display: block;
  background: var(--nuit-2); border: 2px solid var(--or); border-radius: 6px; outline: 1px solid var(--or); outline-offset: 3px;
  fill: none; stroke: var(--or-clair); stroke-width: 3; stroke-linejoin: round;
}
.inventaire h3 { font-size: 1.5rem; color: var(--accent-fonce); margin-bottom: .3rem; }
.inventaire p { margin: 0; }

/* ---------- Venir ---------- */
.venir { padding: 1rem var(--marge) 4rem; max-width: 60rem; margin: 0 auto; }
.venir h2 { text-align: center; }
.venir-grille { display: grid; gap: 1rem; }
@media (min-width: 700px) { .venir-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.carton { padding: 1.4rem 1.4rem .8rem; border: 2px solid var(--accent-fonce); outline: 1px solid var(--accent-fonce); outline-offset: -7px; background: rgb(255 248 234 / .45); }
.carton h3 { font-size: 1.6rem; color: var(--accent-fonce); margin-bottom: .5rem; }

/* ---------- Pied ---------- */
.pied { padding: 2.4rem var(--marge) 2rem; background: var(--nuit); color: #e9e1cf; text-align: center; border-top: 2px solid var(--or); font-size: 1.05rem; }
.pied-blason { width: 3.2rem; height: 3.5rem; display: block; margin: 0 auto .5rem; }
.pied-nom { font: 1.6rem/1.1 var(--titre); color: var(--or-clair); margin-bottom: .6rem; }
.pied-marques { font-size: .95rem; color: #cfc6b2; max-width: 34rem; margin: 1.2rem auto 0; }
.pied-maquette { font-size: .95rem; margin-top: 1rem; }

/* ---------- Coloris : fenêtre « Essayez d'autres coloris » (script.js) ---------- */
.coloris {
  position: fixed; z-index: 30; inset: auto 1.5rem 1.5rem auto; margin: 0;
  width: min(24rem, calc(100% - 3rem)); max-height: calc(100% - 3rem); overflow: auto;
  padding: 1.1rem 1.2rem 1rem 1.4rem;
  background: var(--parchemin) var(--texture) 0 0 / 512px; color: var(--encre);
  border: 2px solid var(--or); border-radius: 6px;
  box-shadow: inset 0 0 24px rgb(120 72 20 / .35), 0 20px 50px var(--ombre);
}
.coloris:focus { outline: none; }
.coloris[open] { animation: coloris-pop .5s cubic-bezier(.2,.8,.2,1); }
@keyframes coloris-pop { from { opacity: 0; transform: translateY(1.2rem) scale(.95); } }
.coloris-tete { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin-right: -.4rem; }
.coloris-titre { font-size: clamp(1.15rem, 4.6vw, 1.4rem); color: var(--accent-fonce); }
.coloris-fermer { flex: none; min-width: 2.75rem; min-height: 2.75rem; padding: 0 .8rem; cursor: pointer; font: 700 1rem var(--texte); background: var(--accent); color: var(--blanc); border: 0; border-radius: 4px; }
.coloris-intro { margin: .2rem 0 .9rem; font-size: 1rem; color: var(--encre-douce); }
.coloris-choix { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; }
.coloris-choix button { display: flex; flex-direction: column; align-items: center; gap: .55rem; min-width: 0; padding: .5rem .15rem; border: 0; border-radius: 6px; background: none; color: inherit; font: inherit; cursor: pointer; }
.coloris-pastille { display: block; width: 3.6rem; aspect-ratio: 1; border-radius: 50%; background: conic-gradient(var(--p1) 0 50%, var(--p2) 0 75%, var(--p3) 0); border: 3px solid var(--blanc); box-shadow: 0 0 0 1px var(--encre-douce); transition: transform .3s; }
.coloris-choix button:hover .coloris-pastille { transform: scale(1.06); }
.coloris-choix button[aria-pressed="true"] .coloris-pastille { box-shadow: 0 0 0 3px var(--blanc), 0 0 0 5px var(--accent); }
.coloris-nom { line-height: 1.2; text-align: center; font-size: .95rem; font-weight: 700; }
.coloris-choix button[aria-pressed="true"] .coloris-nom { text-decoration: underline; text-underline-offset: .3em; }
[data-coloris="origine"] { --p1: #8e1f1f; --p2: #1f1a2e; --p3: #c9962e; }
[data-coloris="foret"] { --p1: #28512f; --p2: #15241b; --p3: #c9a24a; }
[data-coloris="arcane"] { --p1: #3b3f8f; --p2: #171a33; --p3: #aab2c8; }
.coloris-onglet {
  position: fixed; z-index: 25; right: 0; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  min-width: 2.9rem; padding: .8rem .45rem; cursor: pointer;
  background: var(--nuit); color: var(--or-clair); border: 2px solid var(--or); border-right: 0; border-radius: 6px 0 0 6px;
  font: inherit;
}
.coloris-onglet[hidden] { display: none; }
.coloris-onglet-points { display: grid; gap: .3rem; }
.coloris-onglet-points span { display: block; width: .9rem; aspect-ratio: 1; border-radius: 50%; background: conic-gradient(var(--p1) 0 50%, var(--p2) 0 75%, var(--p3) 0); box-shadow: 0 0 0 1px var(--or); }
.coloris-onglet-libelle { writing-mode: vertical-rl; transform: rotate(180deg); font-size: .85rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
@media (max-width: 600px) {
  .coloris { inset: auto 12px 12px 12px; width: auto; padding: .7rem .8rem .6rem 1rem; }
  .coloris-intro { display: none; }
  .coloris-choix button { gap: .35rem; padding: .35rem .1rem; }
  .coloris-pastille { width: 3rem; }
}
@media (max-width: 360px) { .coloris-titre { font-size: 1.05rem; } .coloris-pastille { width: 2.6rem; } .coloris-nom { font-size: .85rem; } }

/* ---------- Panneau « boutique en ligne » (maquette, script.js) ---------- */
.panneau {
  width: min(30rem, calc(100% - 2rem)); padding: 0; border: 2px solid var(--or); border-radius: 6px;
  background: var(--parchemin) var(--texture) 0 0 / 512px; color: var(--encre);
  box-shadow: inset 0 0 34px rgb(120 72 20 / .45), 0 30px 60px rgb(0 0 0 / .5);
}
.panneau::backdrop { background: rgb(15 12 24 / .7); }  /* ::backdrop n'hérite pas des variables partout */
.panneau-tete { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1rem 1rem 1.5rem; border-bottom: 2px solid var(--or); }
.panneau-tete h2 { font-size: clamp(1.4rem, 5.5vw, 1.8rem); margin: 0; }
.fermer { flex: none; width: 2.75rem; height: 2.75rem; border: 2px solid var(--or); border-radius: 50%; background: var(--accent); color: var(--blanc); font-size: 1.6rem; line-height: 1; cursor: pointer; }
.panneau-corps { padding: 1.4rem 1.5rem 1.2rem; }
.badge-maquette { display: inline-block; padding: .2rem .7rem; border-radius: 999px; border: 1px solid var(--accent-fonce); color: var(--accent-fonce); font-weight: 700; font-size: .85rem; letter-spacing: .1em; text-transform: uppercase; }
.widget-fantome { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; margin: 0 0 1.2rem; padding: 1rem; border: 1px dashed var(--encre-douce); border-radius: 6px; }
.widget-fantome span { height: 4.2rem; border-radius: 4px; background: rgb(42 26 18 / .12); }
.widget-fantome .large { grid-column: 1 / -1; height: 2.6rem; background: var(--accent); opacity: .35; }

/* Mouvement réduit : rien ne bouge */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .carte-cadre::after { display: none; }
}
