/* ==========================================================================
   SONG OF WESTEROS — style.css
   Direction artistique : « Dark Editorial Fantasy »
   Édition de luxe contemporaine × noblesse médiévale sombre.
   --------------------------------------------------------------------------
   Sommaire
   00. Polices                    12. Encarts & badges
   01. Variables                  13. Statuts des personnages
   02. Reset & base               14. Tableaux & chronologie
   03. Ambiance (grain, vignette) 15. Filtres & formulaires
   04. Typographie                16. Termes & infobulles
   05. Utilitaires                17. Modales, onglets, notifications
   06. En-tête & navigation       18. Glossaire
   07. Héros & entêtes de page    19. Recherche
   08. Boutons                    20. Maisons, membres, arbre
   09. Sections & titres          21. Espace de gestion (admin)
   10. Cartes & grilles           22. Pied de page & finitions
   11. Apparitions (.reveal)      23. Responsive, accessibilité, impression
   24. Effets cinématiques (voile, progression, tilt 3D, braises, aimantation)
   25. Finitions éditoriales (lettrines, bordures tournantes, défilement)
   --------------------------------------------------------------------------
   Les noms de classes historiques du site (français) et les alias demandés
   (.reveal, .status-*, .modal-overlay, .modal-panel…) sont stylés ensemble.
   ========================================================================== */

/* 00 — POLICES ------------------------------------------------------------ */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700&family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

/* 01 — VARIABLES ---------------------------------------------------------- */
:root {
  /* Fonds stratifiés */
  --bg-void: #090b0e;
  --bg-surface: #12151c;
  --bg-elevated: #191d26;
  --bg-glass: rgba(18, 21, 28, 0.78);
  --bg-input: #0d1015;

  /* Textes */
  --text-primary: #ebe6da;
  --text-secondary: #9da3b0;
  --text-muted: #646a77;

  /* Accents héraldiques & sémantiques */
  --gold-primary: #c9a45c;
  --gold-bright: #e5c47b;
  --gold-border: rgba(201, 164, 92, 0.25);
  --gold-hairline: rgba(201, 164, 92, 0.13);
  --gold-glow: rgba(201, 164, 92, 0.16);
  --crimson: #8f2424;
  --crimson-bright: #c44b4b;
  --crimson-text: #eeb0b0;
  --emerald: #2d6a4f;
  --emerald-text: #9fd6b8;
  --amber: #b9852d;
  --amber-text: #f0cc8c;

  /* Polices */
  --font-display: 'Cinzel', 'Trajan Pro', 'Times New Roman', serif;
  --font-serif: 'Cormorant Garamond', 'Garamond', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, 'Cascadia Code', Menlo, Consolas, monospace;

  /* Échelle typographique fluide */
  --fs-h1: clamp(2.3rem, 1.2rem + 4.6vw, 4.6rem);
  --fs-h2: clamp(1.6rem, 1.15rem + 1.9vw, 2.55rem);
  --fs-h3: clamp(1.12rem, 1rem + 0.5vw, 1.38rem);
  --fs-body: clamp(1rem, 0.96rem + 0.18vw, 1.0625rem);
  --fs-small: 0.875rem;

  /* Courbes d'animation signature */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-tactile: cubic-bezier(0.22, 1, 0.36, 1);

  /* Mise en page */
  --nav-h: 72px;
  --max: 1200px;
  --max-narrow: 860px;
  --radius: 3px;
  --radius-lg: 6px;
  --shadow-deep: 0 30px 60px -20px rgba(0, 0, 0, 0.75), 0 12px 24px -12px rgba(0, 0, 0, 0.6);
  --shadow-soft: 0 14px 30px -14px rgba(0, 0, 0, 0.7);

  color-scheme: dark;
}

/* 02 — RESET & BASE ------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scrollbar-color: var(--gold-border) var(--bg-void); scrollbar-width: thin; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.75;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
main { flex: 1; position: relative; z-index: 1; padding-top: var(--nav-h); }
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--gold-primary); text-decoration: underline; text-decoration-color: rgba(201, 164, 92, 0.35); text-decoration-thickness: 1px; text-underline-offset: 0.22em; transition: color 0.3s var(--ease-tactile), text-decoration-color 0.3s var(--ease-tactile); }
a:hover { color: var(--gold-bright); text-decoration-color: currentColor; }
[hidden] { display: none !important; }
[id] { scroll-margin-top: calc(var(--nav-h) + 1.5rem); }
:focus-visible { outline: 1px solid var(--gold-bright); outline-offset: 4px; border-radius: 1px; }
::selection { background: var(--gold-primary); color: #0a0805; }

/* Barre de défilement fine et dorée */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-void); }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, rgba(201, 164, 92, 0.45), rgba(201, 164, 92, 0.2)); border: 3px solid var(--bg-void); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-primary); }
::-webkit-scrollbar-corner { background: var(--bg-void); }

/* 03 — AMBIANCE : GRAIN & VIGNETTE --------------------------------------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 120% 80% at 50% 0%, transparent 55%, rgba(0, 0, 0, 0.45) 100%),
    radial-gradient(ellipse 60% 40% at 50% -10%, rgba(143, 36, 36, 0.08), transparent 70%);
}

/* 04 — TYPOGRAPHIE ------------------------------------------------------- */
h1, h2, h3, h4 {
  margin: 0 0 0.6em;
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.18;
  color: var(--gold-primary);
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); letter-spacing: 0.1em; text-transform: uppercase; }
h2 { font-size: var(--fs-h2); letter-spacing: 0.08em; text-transform: uppercase; }
h3 { font-size: var(--fs-h3); letter-spacing: 0.06em; color: var(--gold-bright); font-weight: 500; }
h4 { font-size: 0.8rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--text-secondary); }
p { margin: 0 0 1.15em; text-wrap: pretty; }
strong { color: #fff; font-weight: 600; }
em { font-style: italic; }
small { font-size: var(--fs-small); }
ul, ol { margin: 0 0 1.2em; padding-left: 1.35em; }
li { margin-bottom: 0.4em; }
li::marker { color: var(--gold-primary); }
hr { border: 0; height: 1px; margin: 3.5rem 0; background: linear-gradient(90deg, transparent, var(--gold-border), transparent); }
blockquote {
  position: relative;
  margin: 2.2rem 0;
  padding: 0.4rem 0 0.4rem 1.8rem;
  border-left: 1px solid var(--gold-primary);
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.55rem);
  font-style: italic;
  line-height: 1.45;
  color: var(--gold-bright);
}
code, kbd { font-family: var(--font-mono); font-size: 0.86em; }
code { padding: 0.12em 0.45em; color: var(--gold-bright); background: var(--bg-input); border: 1px solid var(--gold-hairline); border-radius: var(--radius); }
kbd { padding: 0.08em 0.42em; color: var(--text-secondary); background: var(--bg-void); border: 1px solid var(--gold-border); border-radius: var(--radius); box-shadow: inset 0 -1px 0 rgba(201, 164, 92, 0.18); }
mark { padding: 0 0.12em; color: #0a0805; background: var(--gold-bright); border-radius: 2px; }
.lead { max-width: 62ch; font-family: var(--font-serif); font-size: clamp(1.2rem, 1.05rem + 0.6vw, 1.45rem); line-height: 1.55; color: var(--text-primary); }

/* 05 — UTILITAIRES ------------------------------------------------------- */
.container { width: min(100% - 2.5rem, var(--max)); margin-inline: auto; }
.container--etroit { width: min(100% - 2.5rem, var(--max-narrow)); margin-inline: auto; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.centre { text-align: center; }
.texte-doux { color: var(--text-secondary); }
.petit { font-size: var(--fs-small); }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.pile > * + * { margin-top: 1rem; }
.lien-evitement {
  position: absolute; top: -120px; left: 1rem; z-index: 1000;
  padding: 0.7rem 1.1rem; font-weight: 600; color: #0a0805; background: var(--gold-primary); border-radius: var(--radius);
}
.lien-evitement:focus { top: 1rem; }
.a-completer { padding: 0.05em 0.45em; font-style: italic; color: var(--text-secondary); border: 1px dashed var(--gold-border); border-radius: var(--radius); }
.chargement, .vide { padding: 2.5rem 1rem; text-align: center; font-family: var(--font-serif); font-size: 1.15rem; font-style: italic; color: var(--text-secondary); }
.compteur { font-size: var(--fs-small); color: var(--text-secondary); letter-spacing: 0.02em; }

/* 06 — EN-TÊTE & NAVIGATION (glassmorphique) ---------------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--bg-glass);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--gold-hairline);
  transition: background 0.5s var(--ease-out-expo), box-shadow 0.5s var(--ease-out-expo), border-color 0.5s var(--ease-out-expo);
}
.site-header::after { /* filet doré central */
  content: ""; position: absolute; left: 50%; bottom: -1px; width: min(420px, 60vw); height: 1px; translate: -50% 0;
  background: linear-gradient(90deg, transparent, var(--gold-primary), transparent); opacity: 0.55;
}
.site-header.est-defile { background: rgba(9, 11, 14, 0.9); box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.8); border-bottom-color: var(--gold-border); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; height: 100%; }
.logo {
  display: inline-flex; align-items: center; gap: 0.7rem; white-space: nowrap; text-decoration: none;
  font-family: var(--font-display); font-size: 0.95rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-primary);
}
.logo:hover { color: var(--gold-bright); }
.logo svg { width: 30px; height: 30px; flex: none; transition: transform 0.6s var(--ease-out-expo); }
.logo:hover svg { transform: translateY(-2px) scale(1.04); }
.nav-principale ul { display: flex; gap: 0.1rem; margin: 0; padding: 0; list-style: none; }
.nav-principale li { margin: 0; }
.nav-principale a {
  position: relative; display: block; padding: 0.55rem 0.75rem; text-decoration: none;
  font-family: var(--font-display); font-size: 0.76rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-primary); transition: color 0.35s var(--ease-tactile);
}
.nav-principale a::after {
  content: ""; position: absolute; left: 0.75rem; right: 0.75rem; bottom: 0.25rem; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-bright), transparent);
  transform: scaleX(0); transform-origin: center; transition: transform 0.55s var(--ease-out-expo);
}
.nav-principale a:hover { color: var(--gold-bright); }
.nav-principale a:hover::after, .nav-principale a[aria-current="page"]::after { transform: scaleX(1); }
.nav-principale a[aria-current="page"] { color: var(--gold-primary); }
.header-actions { display: flex; align-items: center; gap: 0.55rem; }
.btn-recherche {
  display: inline-flex; align-items: center; gap: 0.6rem; height: 38px; padding: 0 0.8rem; cursor: pointer;
  color: var(--text-secondary); background: rgba(9, 11, 14, 0.5); border: 1px solid var(--gold-border); border-radius: var(--radius);
  font-size: 0.82rem; transition: color 0.35s var(--ease-tactile), border-color 0.35s var(--ease-tactile), background 0.35s var(--ease-tactile);
}
.btn-recherche:hover { color: var(--text-primary); border-color: var(--gold-primary); background: var(--bg-surface); }
.btn-recherche svg { width: 15px; height: 15px; }
.btn-recherche kbd { font-size: 0.68rem; }
.burger {
  display: none; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  width: 42px; height: 42px; padding: 0; cursor: pointer; background: transparent;
  border: 1px solid var(--gold-border); border-radius: var(--radius);
}
.burger span { width: 18px; height: 1px; background: var(--gold-bright); transition: transform 0.45s var(--ease-out-expo), opacity 0.3s; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* 07 — HÉROS & ENTÊTES DE PAGE ------------------------------------------ */
.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  min-height: calc(100vh - var(--nav-h));
  min-height: calc(100svh - var(--nav-h));
  padding: 6rem 0 7rem;
  overflow: hidden;
  text-align: center;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse 55% 45% at 50% 42%, rgba(143, 36, 36, 0.22), transparent 70%),
    radial-gradient(ellipse 80% 50% at 50% 110%, rgba(201, 164, 92, 0.1), transparent 70%),
    linear-gradient(180deg, transparent 60%, var(--bg-void));
}
.hero::after { /* cadre d'enluminure */
  content: ""; position: absolute; inset: clamp(0.75rem, 2vw, 1.75rem); pointer-events: none;
  border: 1px solid var(--gold-hairline);
  box-shadow: inset 0 0 0 6px transparent, inset 0 0 0 7px rgba(201, 164, 92, 0.06);
}
.hero__surtitre, .entete-page__surtitre {
  display: inline-flex; align-items: center; gap: 0.9rem;
  font-family: var(--font-display); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.38em; text-transform: uppercase; color: var(--text-secondary);
}
.hero__surtitre::before, .hero__surtitre::after, .entete-page__surtitre::before, .entete-page__surtitre::after {
  content: ""; width: 2.2rem; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-primary));
}
.hero__surtitre::after, .entete-page__surtitre::after { transform: scaleX(-1); }
.hero__titre {
  margin: 0.35em 0 0.2em;
  font-size: clamp(2.6rem, 1rem + 7.4vw, 6.6rem);
  font-weight: 400;
  letter-spacing: 0.15em;
  line-height: 1.02;
  text-transform: uppercase;
  background: linear-gradient(180deg, var(--gold-bright) 10%, var(--gold-primary) 55%, #8d7038 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 30px rgba(201, 164, 92, 0.18));
}
.hero__titre .hero__of {
  display: inline-block; margin: 0 0.15em; vertical-align: middle;
  font-family: var(--font-serif); font-size: 0.42em; font-style: italic; text-transform: none; letter-spacing: 0.04em;
  -webkit-text-fill-color: var(--text-secondary); color: var(--text-secondary);
}
.hero__devise { font-family: var(--font-serif); font-size: clamp(1.15rem, 1rem + 0.7vw, 1.5rem); font-style: italic; color: var(--gold-bright); letter-spacing: 0.02em; }
.hero__intro { max-width: 58ch; margin: 1.6rem auto 0; color: var(--text-primary); }
.hero__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; margin-top: 2.6rem; }
.hero__defiler { position: absolute; bottom: 2.4rem; left: 50%; translate: -50% 0; color: var(--gold-primary); opacity: 0.7; animation: sow-flotter 2.8s var(--ease-tactile) infinite; }
.hero__defiler svg { width: 26px; height: 26px; }
.hero > .container > * { animation: sow-reveal 1.2s var(--ease-out-expo) both; }
.hero > .container > *:nth-child(2) { animation-delay: 0.1s; }
.hero > .container > *:nth-child(3) { animation-delay: 0.2s; }
.hero > .container > *:nth-child(4) { animation-delay: 0.3s; }
.hero > .container > *:nth-child(n + 5) { animation-delay: 0.42s; }

.entete-page {
  position: relative;
  padding: clamp(3.5rem, 2rem + 5vw, 6rem) 0 clamp(2.5rem, 1.5rem + 3vw, 4rem);
  text-align: center;
  border-bottom: 1px solid var(--gold-hairline);
  background: radial-gradient(ellipse 55% 100% at 50% 0%, rgba(143, 36, 36, 0.17), transparent 72%);
}
.entete-page h1 { margin: 0.45em 0 0.3em; }
.entete-page p { max-width: 62ch; margin-inline: auto; color: var(--text-secondary); }
.sommaire { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.45rem 0.55rem; margin: 2rem 0 0; padding: 0; list-style: none; }
.sommaire li { margin: 0; }
.sommaire a {
  display: inline-block; padding: 0.35rem 0.95rem; font-size: 0.8rem; letter-spacing: 0.02em; text-decoration: none; color: var(--text-primary);
  border: 1px solid var(--gold-hairline); border-radius: 999px; transition: border-color 0.4s var(--ease-tactile), color 0.4s var(--ease-tactile), background 0.4s var(--ease-tactile);
}
.sommaire a:hover { color: var(--gold-bright); border-color: var(--gold-primary); background: rgba(201, 164, 92, 0.06); }

/* 08 — BOUTONS ----------------------------------------------------------- */
.btn, .btn-secondary {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 0.65rem;
  padding: 0.85rem 1.6rem; cursor: pointer; overflow: hidden; text-decoration: none; white-space: nowrap;
  font-family: var(--font-display); font-size: 0.76rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold-primary); background: transparent; border: 1px solid var(--gold-border); border-radius: var(--radius);
  transition: color 0.45s var(--ease-out-expo), border-color 0.45s var(--ease-out-expo), background 0.45s var(--ease-out-expo), box-shadow 0.45s var(--ease-out-expo), transform 0.45s var(--ease-out-expo);
}
.btn:hover, .btn-secondary:hover { color: var(--gold-bright); border-color: var(--gold-primary); background: rgba(201, 164, 92, 0.07); box-shadow: 0 0 0 1px rgba(201, 164, 92, 0.15), 0 10px 30px -12px rgba(201, 164, 92, 0.25); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 17px; height: 17px; }
.btn--plein, .btn-primary {
  color: #120e06; border-color: var(--gold-primary);
  background: linear-gradient(180deg, var(--gold-bright), var(--gold-primary) 55%, #a8843f);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 10px 30px -14px rgba(201, 164, 92, 0.6);
}
.btn--plein:hover, .btn-primary:hover { color: #120e06; background: linear-gradient(180deg, #f0d293, var(--gold-bright) 55%, var(--gold-primary)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 16px 36px -14px rgba(229, 196, 123, 0.7); }
.btn--plein::before, .btn-primary::before { /* reflet qui balaie le bouton */
  content: ""; position: absolute; inset: 0; transform: translateX(-120%) skewX(-18deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transition: transform 0.9s var(--ease-out-expo);
}
.btn--plein:hover::before, .btn-primary:hover::before { transform: translateX(120%) skewX(-18deg); }
.btn--danger, .btn-danger { color: var(--crimson-text); border-color: rgba(196, 75, 75, 0.45); }
.btn--danger:hover, .btn-danger:hover { color: #fff; background: rgba(143, 36, 36, 0.45); border-color: var(--crimson-bright); box-shadow: 0 10px 30px -14px rgba(143, 36, 36, 0.8); }
.btn--petit { padding: 0.5rem 0.9rem; font-size: 0.68rem; letter-spacing: 0.14em; }
.btn[disabled], .btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

/* 09 — SECTIONS & TITRES ------------------------------------------------- */
.section { position: relative; padding: clamp(3.5rem, 2rem + 5vw, 6.5rem) 0; }
.section--alt {
  background:
    linear-gradient(180deg, transparent, rgba(18, 21, 28, 0.65) 14%, rgba(18, 21, 28, 0.65) 86%, transparent);
}
.section--alt::before { /* filet doré d'ouverture */
  content: ""; position: absolute; top: 0; left: 50%; width: min(70%, 640px); height: 1px; translate: -50% 0;
  background: linear-gradient(90deg, transparent, var(--gold-border), transparent);
}
.titre-section { margin-bottom: clamp(2rem, 1.5rem + 2vw, 3.2rem); text-align: center; }
.titre-section h2 { margin-bottom: 0.3em; }
.titre-section p { max-width: 60ch; margin-inline: auto; font-family: var(--font-serif); font-size: 1.2rem; line-height: 1.5; color: var(--text-secondary); }
.ornement { display: flex; align-items: center; justify-content: center; gap: 0.9rem; margin: 1rem auto; color: var(--gold-primary); }
.ornement::before, .ornement::after { content: ""; width: min(140px, 22vw); height: 1px; background: linear-gradient(90deg, transparent, var(--gold-primary)); }
.ornement::after { transform: scaleX(-1); }
.ornement span { width: 7px; height: 7px; border: 1px solid var(--gold-primary); transform: rotate(45deg); box-shadow: 0 0 12px rgba(201, 164, 92, 0.45); }
.prose h2 { position: relative; margin-top: 2.8rem; padding-top: 1.2rem; }
.prose h2::before { content: ""; position: absolute; top: 0; left: 0; width: 3rem; height: 1px; background: var(--gold-primary); }
.prose .titre-section h2::before { display: none; }
.prose h3 { margin-top: 2.2rem; }
.prose > :first-child, .prose > :first-child h2 { margin-top: 0; }

/* 10 — CARTES & GRILLES (profondeur tactile) ---------------------------- */
.grille { display: grid; gap: clamp(1rem, 0.8rem + 0.8vw, 1.6rem); grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.grille--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.grille--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
@media (min-width: 1100px) { /* rythme asymétrique éditorial */
  .grille--3 > .carte--lien:nth-child(3n + 1) { transform: translateY(1.2rem); }
  .grille--3 > .carte--lien:nth-child(3n + 1):hover { transform: translateY(calc(1.2rem - 5px)); }
}
.carte {
  position: relative;
  padding: clamp(1.3rem, 1rem + 1vw, 1.8rem);
  background: linear-gradient(180deg, rgba(25, 29, 38, 0.6), transparent 60%), var(--bg-surface);
  border: 1px solid var(--gold-hairline);
  border-radius: var(--radius);
  transition: transform 0.45s var(--ease-out-expo), border-color 0.45s var(--ease-out-expo), box-shadow 0.45s var(--ease-out-expo), background-color 0.45s var(--ease-out-expo);
}
.carte::before, .carte::after { /* coins d'enluminure */
  content: ""; position: absolute; width: 14px; height: 14px; pointer-events: none;
  border: 1px solid var(--gold-primary); opacity: 0.6; transition: opacity 0.45s var(--ease-out-expo), width 0.45s var(--ease-out-expo), height 0.45s var(--ease-out-expo);
}
.carte::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.carte::after { right: -1px; bottom: -1px; border-left: 0; border-top: 0; }
.carte > :last-child { margin-bottom: 0; }
.carte--lien { display: flex; flex-direction: column; color: inherit; text-decoration: none; }
.carte--lien:hover, .carte--lien:focus-visible {
  color: inherit;
  transform: translateY(-5px);
  border-color: var(--gold-border);
  background-color: var(--bg-elevated);
  box-shadow: var(--shadow-deep), 0 0 0 1px rgba(201, 164, 92, 0.1), inset 0 40px 80px -40px var(--gold-glow);
}
.carte--lien:hover::before, .carte--lien:hover::after { width: 26px; height: 26px; opacity: 1; }
.carte__icone { width: 40px; height: 40px; margin-bottom: 1.1rem; color: var(--gold-primary); transition: transform 0.6s var(--ease-out-expo), color 0.4s; }
.carte--lien:hover .carte__icone { color: var(--gold-bright); transform: translateY(-2px) scale(1.06); }
.carte__titre { margin-bottom: 0.45rem; font-size: 1.15rem; }
.carte__texte { margin: 0; font-size: 0.95rem; color: var(--text-secondary); }
.carte__fleche { margin-top: auto; padding-top: 1.3rem; font-family: var(--font-display); font-size: 0.68rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold-primary); transition: letter-spacing 0.5s var(--ease-out-expo), color 0.4s; }
.carte--lien:hover .carte__fleche { letter-spacing: 0.28em; color: var(--gold-bright); }
.carte__etiquette { margin-bottom: 0.35rem; font-family: var(--font-display); font-size: 0.66rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-secondary); }
.carte__valeur { font-family: var(--font-serif); font-size: clamp(1.35rem, 1.2rem + 0.5vw, 1.65rem); font-weight: 500; line-height: 1.25; color: var(--gold-bright); }

.etapes { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); margin: 0; padding: 0; list-style: none; counter-reset: etape; }
.etapes > li {
  position: relative; margin: 0; padding: 1.5rem 1.4rem 1.4rem; counter-increment: etape;
  background: var(--bg-surface); border: 1px solid var(--gold-hairline); border-top: 1px solid var(--gold-border); border-radius: var(--radius);
  transition: transform 0.45s var(--ease-out-expo), border-color 0.45s var(--ease-out-expo);
}
.etapes > li:hover { transform: translateY(-3px); border-color: var(--gold-border); }
.etapes > li::before { content: counter(etape, upper-roman); display: block; margin-bottom: 0.4rem; font-family: var(--font-display); font-size: 1.9rem; line-height: 1; color: var(--gold-primary); }
.etapes h3 { margin-bottom: 0.35rem; font-size: 1.02rem; }
.etapes p { margin: 0; font-size: 0.93rem; color: var(--text-secondary); }

.appel {
  position: relative; padding: clamp(2.5rem, 1.5rem + 4vw, 4rem) clamp(1.5rem, 1rem + 3vw, 3rem); text-align: center; overflow: hidden;
  background: radial-gradient(ellipse 70% 60% at 50% 0%, rgba(143, 36, 36, 0.24), transparent 70%), var(--bg-surface);
  border: 1px solid var(--gold-border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-deep);
}

/* 11 — APPARITIONS AU DÉFILEMENT (.reveal) ------------------------------ */
@keyframes sow-reveal { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes sow-flotter { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(7px); } }
@keyframes sow-fondu { from { opacity: 0; } to { opacity: 1; } }
@keyframes sow-panneau { from { opacity: 0; transform: translateY(16px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes sow-cible { 0%, 40% { background: rgba(201, 164, 92, 0.14); } 100% { background: transparent; } }
.js .reveal, .js .apparition { opacity: 0; transform: translateY(22px); transition: opacity 1s var(--ease-out-expo), transform 1s var(--ease-out-expo); }
.js .reveal.is-visible, .js .reveal.est-visible, .js .apparition.est-visible, .js .apparition.is-visible { opacity: 1; transform: none; }
.reveal--delai-1 { transition-delay: 0.1s !important; }
.reveal--delai-2 { transition-delay: 0.2s !important; }
.reveal--delai-3 { transition-delay: 0.3s !important; }

/* 12 — ENCARTS & BADGES -------------------------------------------------- */
.encart {
  position: relative; margin: 1.6rem 0; padding: 1.25rem 1.45rem;
  background: var(--bg-surface); border: 1px solid var(--gold-hairline); border-left: 2px solid var(--gold-primary); border-radius: var(--radius);
}
.encart > :last-child { margin-bottom: 0; }
.encart__titre { display: flex; align-items: center; gap: 0.55rem; margin: 0 0 0.5rem; font-family: var(--font-display); font-size: 0.74rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-primary); }
.encart--alerte { border-left-color: var(--crimson-bright); background: linear-gradient(90deg, rgba(143, 36, 36, 0.2), var(--bg-surface) 60%); }
.encart--alerte .encart__titre { color: var(--crimson-text); }
.encart--don { border-left-color: var(--gold-bright); background: linear-gradient(90deg, rgba(201, 164, 92, 0.1), var(--bg-surface) 60%); }

.badge {
  display: inline-flex; align-items: center; gap: 0.32rem; padding: 0.16rem 0.55rem; white-space: nowrap;
  font-family: var(--font-sans); font-size: 0.66rem; font-weight: 600; letter-spacing: 0.1em; line-height: 1.55; text-transform: uppercase;
  border: 1px solid; border-radius: 2px;
}
.badge--or { color: var(--gold-bright); border-color: var(--gold-border); background: rgba(201, 164, 92, 0.08); }
.badge--doux { color: var(--text-secondary); border-color: rgba(157, 163, 176, 0.28); }
.badge--rouge { color: var(--crimson-text); border-color: rgba(196, 75, 75, 0.55); background: rgba(143, 36, 36, 0.35); }
.badge--vert { color: var(--emerald-text); border-color: rgba(45, 106, 79, 0.75); background: rgba(45, 106, 79, 0.18); }
.badge--violet, .badge--ambre { color: var(--amber-text); border-color: rgba(185, 133, 45, 0.55); background: rgba(185, 133, 45, 0.14); }

/* 13 — STATUTS DES PERSONNAGES (Vivant / Mort / Disparu) ---------------- */
.status-vivant { color: var(--emerald-text); border-color: rgba(45, 106, 79, 0.75); background: rgba(45, 106, 79, 0.18); }
.badge.status-vivant::before, .status-vivant.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #52b788; box-shadow: 0 0 8px rgba(82, 183, 136, 0.7); }
.status-disparu { color: var(--amber-text); border-color: rgba(185, 133, 45, 0.55); background: rgba(185, 133, 45, 0.14); }

/* Carte d'un personnage décédé : contenu désaturé + sceau de cire « Décédé » */
.status-mort, .membre--mort { position: relative; border-color: rgba(143, 36, 36, 0.38) !important; }
.membre--mort > *, .carte.status-mort > *, .membre.status-mort > * { filter: grayscale(0.65); opacity: 0.6; transition: filter 0.45s var(--ease-out-expo), opacity 0.45s var(--ease-out-expo); }
.membre--mort:hover > *, .status-mort:hover > * { filter: grayscale(0.3); opacity: 0.88; }
.membre--mort::after, .carte.status-mort::after, .membre.status-mort::after {
  content: "Décédé";
  position: absolute; top: 0.7rem; right: 0.7rem; z-index: 1;
  display: grid; place-items: center; width: 54px; height: 54px; padding: 0;
  font-family: var(--font-display); font-size: 0.5rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: #f4d6d6;
  background: radial-gradient(circle at 35% 30%, #b73a3a, var(--crimson) 55%, #5c1414);
  border: 0; border-radius: 47% 53% 50% 50% / 52% 48% 52% 48%;
  box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.18), inset 0 0 0 5px rgba(255, 255, 255, 0.06), 0 4px 10px rgba(0, 0, 0, 0.55);
  transform: rotate(-12deg); opacity: 0.92;
}
.membre--mort .membre__nom, .status-mort .membre__nom { padding-right: 3.6rem; }
.membre--mort .membre__badges .badge--rouge { display: none; } /* le sceau remplace le badge */
.membre--disparu, .membre.status-disparu { border-style: dashed !important; border-color: rgba(185, 133, 45, 0.45) !important; }

/* 14 — TABLEAUX & CHRONOLOGIE ------------------------------------------- */
.tableau-conteneur { margin: 1.2rem 0 1.7rem; overflow-x: auto; border: 1px solid var(--gold-hairline); border-radius: var(--radius); background: rgba(18, 21, 28, 0.5); }
.tableau { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.tableau th, .tableau td { padding: 0.78rem 1rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--gold-hairline); }
.tableau th { position: sticky; top: 0; font-family: var(--font-display); font-size: 0.68rem; font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase; white-space: nowrap; color: var(--gold-primary); background: var(--bg-elevated); }
.tableau tbody tr { transition: background 0.3s var(--ease-tactile); }
.tableau tbody tr:hover { background: rgba(201, 164, 92, 0.045); }
.tableau tbody tr:last-child td { border-bottom: 0; }
.tableau .nombre { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tableau caption { caption-side: bottom; padding: 0.65rem 1rem; text-align: left; font-size: 0.8rem; color: var(--text-secondary); border-top: 1px solid var(--gold-hairline); }

.chronologie { position: relative; margin: 0; padding: 0 0 0 2.2rem; list-style: none; }
.chronologie::before { content: ""; position: absolute; top: 0.6rem; bottom: 0.6rem; left: 0.5rem; width: 1px; background: linear-gradient(180deg, var(--gold-primary), var(--gold-hairline) 70%, transparent); }
.chronologie > li { position: relative; margin-bottom: 2rem; }
.chronologie > li::before {
  content: ""; position: absolute; top: 0.5rem; left: -2.03rem; width: 10px; height: 10px; transform: rotate(45deg);
  background: var(--bg-void); border: 1px solid var(--gold-primary); box-shadow: 0 0 0 4px var(--bg-void);
}
.chronologie > li.est-majeur::before { background: var(--crimson); border-color: var(--crimson-bright); box-shadow: 0 0 0 4px var(--bg-void), 0 0 14px rgba(196, 75, 75, 0.6); }
.chronologie__date { display: block; font-family: var(--font-display); font-size: 0.75rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-primary); }
.chronologie h3 { margin: 0.15rem 0 0.35rem; font-size: 1.12rem; }
.chronologie p { margin: 0; color: var(--text-primary); }

/* 15 — FILTRES & FORMULAIRES -------------------------------------------- */
.filtres { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; margin-bottom: 1rem; }
.filtres__label { margin-right: 0.5rem; font-family: var(--font-display); font-size: 0.66rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-muted); }
.filtre-btn {
  padding: 0.4rem 0.95rem; cursor: pointer; font-size: 0.8rem; letter-spacing: 0.01em; color: var(--text-primary);
  background: transparent; border: 1px solid var(--gold-hairline); border-radius: 999px;
  transition: border-color 0.35s var(--ease-tactile), background 0.35s var(--ease-tactile), color 0.35s var(--ease-tactile), transform 0.35s var(--ease-tactile);
}
.filtre-btn:hover { border-color: var(--gold-border); color: var(--gold-bright); }
.filtre-btn:active { transform: scale(0.97); }
.filtre-btn[aria-pressed="true"] { color: #120e06; font-weight: 600; background: var(--gold-primary); border-color: var(--gold-primary); box-shadow: 0 6px 18px -8px rgba(201, 164, 92, 0.6); }
.barre-outils {
  position: sticky; top: var(--nav-h); z-index: 20; margin-bottom: 2.2rem; padding: 1.1rem 0;
  background: linear-gradient(180deg, rgba(9, 11, 14, 0.96), rgba(9, 11, 14, 0.9));
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--gold-hairline);
}

.champ { position: relative; display: block; }
.champ__icone { position: absolute; top: 50%; left: 1rem; width: 17px; height: 17px; translate: 0 -50%; color: var(--text-muted); pointer-events: none; transition: color 0.3s; }
.champ:focus-within .champ__icone { color: var(--gold-primary); }
:where(input:not([type="checkbox"]):not([type="radio"]), select, textarea), .champ__input {
  width: 100%; padding: 0.8rem 1rem; font-size: 0.95rem; color: var(--text-primary);
  background: var(--bg-input); border: 1px solid var(--gold-hairline); border-radius: var(--radius);
  transition: border-color 0.35s var(--ease-tactile), box-shadow 0.35s var(--ease-tactile), background 0.35s var(--ease-tactile);
}
.champ__input { padding-left: 2.75rem; }
:where(input, textarea)::placeholder { color: var(--text-muted); }
:where(input, select, textarea):hover:not(:disabled) { border-color: var(--gold-border); }
:where(input, select, textarea):focus, .champ__input:focus { outline: none; border-color: var(--gold-primary); background: #0f1218; box-shadow: 0 0 0 3px rgba(201, 164, 92, 0.14), 0 0 24px -6px rgba(201, 164, 92, 0.25); }
:where(input, select, textarea):disabled { opacity: 0.55; cursor: not-allowed; }
:where(select) {
  appearance: none; -webkit-appearance: none; padding-right: 2.4rem; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--gold-primary) 50%), linear-gradient(135deg, var(--gold-primary) 50%, transparent 50%);
  background-position: calc(100% - 1.15rem) 52%, calc(100% - 0.85rem) 52%; background-size: 5px 5px; background-repeat: no-repeat;
}
select option { color: var(--text-primary); background: var(--bg-elevated); }
:where(textarea) { min-height: 110px; resize: vertical; line-height: 1.6; }
input[type="search"]::-webkit-search-cancel-button { filter: sepia(1) saturate(3) hue-rotate(5deg); cursor: pointer; }
.formulaire { display: grid; gap: 1.05rem; }
.formulaire--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.formulaire label { display: block; margin-bottom: 0.35rem; font-size: 0.74rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-secondary); }
.formulaire .pleine-largeur, .formulaire h3 { grid-column: 1 / -1; }
.formulaire__aide { margin: 0.35rem 0 0; font-size: 0.78rem; color: var(--text-muted); }
.formulaire__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.7rem; grid-column: 1 / -1; padding-top: 0.4rem; border-top: 1px solid var(--gold-hairline); margin-top: 0.4rem; }

/* Interrupteur accorder / révoquer */
.interrupteur { position: relative; display: inline-flex; align-items: center; gap: 0.6rem; cursor: pointer; font-size: 0.85rem; }
.formulaire label.interrupteur { display: inline-flex; margin: 0.2rem 0 0; font-size: 0.85rem; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--text-primary); }
.interrupteur input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.interrupteur__piste { position: relative; flex: none; width: 42px; height: 22px; background: #222733; border: 1px solid var(--gold-hairline); border-radius: 999px; transition: background 0.4s var(--ease-out-expo), border-color 0.4s var(--ease-out-expo); }
.interrupteur__piste::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: var(--text-muted); border-radius: 50%; transition: transform 0.45s var(--ease-out-expo), background 0.3s; }
.interrupteur input:checked + .interrupteur__piste { background: rgba(201, 164, 92, 0.3); border-color: var(--gold-primary); }
.interrupteur input:checked + .interrupteur__piste::after { transform: translateX(20px); background: var(--gold-bright); box-shadow: 0 0 10px rgba(229, 196, 123, 0.6); }
.interrupteur input:focus-visible + .interrupteur__piste { outline: 1px solid var(--gold-bright); outline-offset: 3px; }
.interrupteur input:disabled + .interrupteur__piste { opacity: 0.4; }

/* 16 — TERMES & INFOBULLES (style livre) -------------------------------- */
.terme-def {
  position: relative; cursor: help; color: inherit; border-bottom: 1px dotted var(--gold-primary);
  transition: color 0.3s var(--ease-tactile), border-color 0.3s var(--ease-tactile);
}
.terme-def:hover, .terme-def:focus-visible, .terme-def[aria-expanded="true"] { color: var(--gold-bright); border-bottom-style: solid; border-bottom-color: var(--gold-bright); }

/* Infobulle 100 % CSS — active quand JavaScript est indisponible
   (avec JavaScript, l'infobulle .infobulle ci-dessous prend le relais :
   elle se repositionne et fonctionne au toucher sur mobile). */
html:not(.js) .terme-def[data-definition]::after,
html:not(.js) .terme-def[data-definition]::before {
  position: absolute; left: 50%; z-index: 300; pointer-events: none;
  opacity: 0; visibility: hidden; transform: translate(-50%, 6px);
  transition: opacity 0.35s var(--ease-out-expo), transform 0.35s var(--ease-out-expo), visibility 0.35s;
}
html:not(.js) .terme-def[data-definition]::after {
  content: attr(data-definition);
  bottom: calc(100% + 12px); width: max-content; max-width: min(320px, 80vw); padding: 0.85rem 1rem;
  font-family: var(--font-sans); font-size: 0.86rem; font-weight: 400; font-style: normal; line-height: 1.55; letter-spacing: 0; text-transform: none; text-align: left; white-space: normal;
  color: var(--text-primary); background: var(--bg-elevated); border: 1px solid var(--gold-border); border-radius: var(--radius); box-shadow: var(--shadow-deep);
}
html:not(.js) .terme-def[data-definition]::before {
  content: ""; bottom: calc(100% + 6px); width: 10px; height: 10px; margin-left: -5px;
  background: var(--bg-elevated); border-right: 1px solid var(--gold-border); border-bottom: 1px solid var(--gold-border);
  transform: translate(0, 6px) rotate(45deg);
}
html:not(.js) .terme-def[data-definition]:hover::after, html:not(.js) .terme-def[data-definition]:focus::after { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
html:not(.js) .terme-def[data-definition]:hover::before, html:not(.js) .terme-def[data-definition]:focus::before { opacity: 1; visibility: visible; transform: translate(0, 0) rotate(45deg); }

/* Infobulle pilotée par script.js */
.infobulle {
  position: absolute; top: 0; left: 0; z-index: 300; max-width: min(340px, calc(100vw - 24px)); padding: 0.95rem 1.1rem;
  font-size: 0.88rem; line-height: 1.6; color: var(--text-primary);
  background: linear-gradient(180deg, rgba(201, 164, 92, 0.05), transparent 40%), var(--bg-elevated);
  border: 1px solid var(--gold-border); border-radius: var(--radius); box-shadow: var(--shadow-deep), 0 0 0 1px rgba(0, 0, 0, 0.4);
  opacity: 0; visibility: hidden; transform: translateY(6px); pointer-events: none;
  transition: opacity 0.35s var(--ease-out-expo), transform 0.35s var(--ease-out-expo), visibility 0.35s;
}
.infobulle.est-visible { opacity: 1; visibility: visible; transform: none; pointer-events: auto; }
.infobulle__terme { display: block; margin-bottom: 0.4rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--gold-hairline); font-family: var(--font-display); font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-primary); }
.infobulle__texte { display: block; font-family: var(--font-sans); }
.infobulle__lien { display: inline-block; margin-top: 0.55rem; font-size: 0.75rem; letter-spacing: 0.03em; }
.infobulle::after {
  content: ""; position: absolute; bottom: -6px; left: var(--fleche-x, 50%); width: 10px; height: 10px;
  background: var(--bg-elevated); border-right: 1px solid var(--gold-border); border-bottom: 1px solid var(--gold-border); transform: translateX(-50%) rotate(45deg);
}
.infobulle[data-position="bas"]::after { top: -6px; bottom: auto; transform: translateX(-50%) rotate(225deg); }

/* 17 — MODALES, ONGLETS, NOTIFICATIONS ---------------------------------- */
.modale, .modal-overlay {
  position: fixed; inset: 0; z-index: 500; display: none; align-items: flex-start; justify-content: center;
  padding: 7vh 1rem 2rem; overflow-y: auto;
  background: radial-gradient(ellipse at 50% 20%, rgba(25, 29, 38, 0.6), rgba(5, 6, 8, 0.88));
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.modale.est-ouverte, .modal-overlay.is-open, .modal-overlay.est-ouverte { display: flex; animation: sow-fondu 0.35s var(--ease-out-expo); }
.modale__boite, .modal-panel {
  position: relative; width: min(760px, 100%);
  background: linear-gradient(180deg, rgba(201, 164, 92, 0.04), transparent 120px), var(--bg-elevated);
  border: 1px solid var(--gold-border); border-radius: var(--radius-lg); box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.9);
  animation: sow-panneau 0.55s var(--ease-out-expo);
}
.modale__boite::before, .modal-panel::before { content: ""; position: absolute; top: -1px; left: 10%; right: 10%; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-bright), transparent); }
.modale__boite--large, .modal-panel--large { width: min(1000px, 100%); }
.modal-panel--lateral { /* fenêtre glissante depuis la droite */
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); border-radius: 0; overflow-y: auto;
  animation: sow-glisse 0.6s var(--ease-out-expo);
}
@keyframes sow-glisse { from { transform: translateX(100%); } to { transform: none; } }
.modale__entete { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.15rem 1.5rem; border-bottom: 1px solid var(--gold-hairline); }
.modale__entete h2 { margin: 0; font-size: 1.15rem; letter-spacing: 0.1em; }
.modale__corps { padding: 1.5rem; }
.modale__fermer {
  display: grid; place-items: center; width: 36px; height: 36px; padding: 0; cursor: pointer; font-size: 1.25rem; line-height: 1; color: var(--text-secondary);
  background: transparent; border: 1px solid var(--gold-hairline); border-radius: 50%; transition: color 0.3s, border-color 0.3s, transform 0.5s var(--ease-out-expo);
}
.modale__fermer:hover { color: var(--gold-bright); border-color: var(--gold-primary); transform: rotate(90deg); }
body.defilement-bloque { overflow: hidden; }

.onglets { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-bottom: 1.8rem; border-bottom: 1px solid var(--gold-hairline); }
.onglet {
  position: relative; margin-bottom: -1px; padding: 0.75rem 1.15rem; cursor: pointer; background: transparent; border: 0;
  font-family: var(--font-display); font-size: 0.72rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--text-secondary); transition: color 0.3s;
}
.onglet::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--gold-bright); transform: scaleX(0); transition: transform 0.5s var(--ease-out-expo); }
.onglet:hover { color: var(--text-primary); }
.onglet[aria-selected="true"] { color: var(--gold-bright); }
.onglet[aria-selected="true"]::after { transform: scaleX(1); }

.toast {
  position: fixed; bottom: 1.6rem; left: 50%; z-index: 600; max-width: calc(100vw - 2rem); padding: 0.8rem 1.25rem;
  font-size: 0.88rem; color: var(--text-primary); background: var(--bg-elevated); border: 1px solid var(--gold-border); border-left: 2px solid var(--gold-primary); border-radius: var(--radius);
  box-shadow: var(--shadow-deep); opacity: 0; visibility: hidden; transform: translate(-50%, 18px);
  transition: opacity 0.45s var(--ease-out-expo), transform 0.45s var(--ease-out-expo), visibility 0.45s;
}
.toast.est-visible { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.toast--erreur { color: var(--crimson-text); border-color: rgba(196, 75, 75, 0.5); border-left-color: var(--crimson-bright); }

/* 18 — GLOSSAIRE --------------------------------------------------------- */
.alphabet { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.2rem; margin-top: 0.9rem; }
.alphabet a, .alphabet span {
  display: grid; place-items: center; width: 2.05rem; height: 2.05rem; text-decoration: none;
  font-family: var(--font-display); font-size: 0.82rem; border: 1px solid transparent; border-radius: 2px; transition: border-color 0.3s, color 0.3s, background 0.3s;
}
.alphabet a:hover { color: var(--gold-bright); border-color: var(--gold-border); background: rgba(201, 164, 92, 0.06); }
.alphabet span, .alphabet a.est-vide { color: #343843; pointer-events: none; }
.glossaire-groupe { margin-bottom: 2.6rem; }
.glossaire-lettre { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 0.4rem; padding-bottom: 0.35rem; font-size: clamp(2rem, 1.6rem + 1.4vw, 2.8rem); font-weight: 400; border-bottom: 1px solid var(--gold-hairline); }
.glossaire-liste { margin: 0; }
.glossaire-entree { display: grid; grid-template-columns: minmax(170px, 240px) 1fr; gap: 0.4rem 2.2rem; padding: 1.05rem 0.7rem; border-bottom: 1px solid var(--gold-hairline); border-radius: 2px; transition: background 0.3s; }
.glossaire-entree:hover { background: rgba(201, 164, 92, 0.03); }
.glossaire-entree dt { font-family: var(--font-serif); font-size: 1.22rem; font-weight: 600; line-height: 1.35; color: var(--gold-bright); }
.glossaire-entree dd { margin: 0; color: var(--text-primary); }
.glossaire-entree__source { margin-top: 0.4rem; font-size: 0.78rem; color: var(--text-muted); }
.glossaire-entree.est-cible { animation: sow-cible 2.6s var(--ease-tactile); }

/* 19 — RECHERCHE --------------------------------------------------------- */
.recherche {
  position: fixed; inset: 0; z-index: 400; display: none; align-items: flex-start; justify-content: center; padding: 11vh 1rem 2rem;
  background: radial-gradient(ellipse at 50% 15%, rgba(25, 29, 38, 0.55), rgba(5, 6, 8, 0.88)); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.recherche.est-ouverte { display: flex; animation: sow-fondu 0.3s var(--ease-out-expo); }
.recherche__boite { display: flex; flex-direction: column; width: min(700px, 100%); max-height: 76vh; overflow: hidden; background: var(--bg-elevated); border: 1px solid var(--gold-border); border-radius: var(--radius-lg); box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.9); animation: sow-panneau 0.5s var(--ease-out-expo); }
.recherche__entete { display: flex; align-items: center; gap: 0.8rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--gold-hairline); }
.recherche__entete svg { flex: none; width: 19px; height: 19px; color: var(--gold-primary); }
.recherche .recherche__input { flex: 1; min-width: 0; padding: 0; font-size: 1.08rem; background: transparent; border: 0; box-shadow: none; }
.recherche .recherche__input:focus { background: transparent; box-shadow: none; }
.recherche__fermer { padding: 0; cursor: pointer; background: transparent; border: 0; }
.recherche__resultats { margin: 0; padding: 0.45rem; overflow-y: auto; list-style: none; }
.recherche__resultat { margin: 0; }
.recherche__resultat a { display: block; padding: 0.75rem 1rem; color: var(--text-primary); text-decoration: none; border-radius: var(--radius); border-left: 2px solid transparent; transition: background 0.25s, border-color 0.25s; }
.recherche__resultat a:hover, .recherche__resultat[aria-selected="true"] a { background: rgba(201, 164, 92, 0.08); border-left-color: var(--gold-primary); }
.recherche__page { font-family: var(--font-display); font-size: 0.64rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-primary); }
.recherche__titre { display: block; font-weight: 600; color: #fff; }
.recherche__extrait { display: block; margin-top: 0.15rem; font-size: 0.85rem; color: var(--text-secondary); }
.recherche__etat { margin: 0; padding: 1.1rem; text-align: center; font-size: 0.88rem; color: var(--text-secondary); }
.recherche__etat:empty { display: none; }
.recherche__pied { display: flex; flex-wrap: wrap; gap: 1.3rem; padding: 0.65rem 1.25rem; font-size: 0.74rem; color: var(--text-muted); border-top: 1px solid var(--gold-hairline); }

/* 20 — MAISONS, MEMBRES, ARBRE ------------------------------------------ */
.couronne-grille { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); margin-bottom: 1.7rem; }
.conseil-liste { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.conseil-liste li { display: grid; grid-template-columns: minmax(150px, 40%) 1fr; gap: 1rem; margin: 0; padding: 0.7rem 0; border-bottom: 1px solid var(--gold-hairline); }
.conseil-liste li:last-child { border-bottom: 0; }
.conseil-liste .charge { font-family: var(--font-display); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold-primary); }
.conseil-liste .note { display: block; font-size: 0.76rem; color: var(--text-muted); }

.maison {
  position: relative; margin-bottom: 2.4rem; overflow: hidden;
  background: var(--bg-surface); border: 1px solid var(--gold-hairline); border-radius: var(--radius-lg);
  transition: border-color 0.45s var(--ease-out-expo), box-shadow 0.45s var(--ease-out-expo), transform 0.45s var(--ease-out-expo);
}
.maison:hover { border-color: var(--gold-border); box-shadow: var(--shadow-soft), inset 0 60px 120px -80px var(--gold-glow); }
.maison__entete {
  position: relative; display: grid; grid-template-columns: auto 1fr auto; gap: 1.3rem; align-items: center; padding: 1.5rem 1.7rem;
  border-bottom: 1px solid var(--gold-hairline);
  background: linear-gradient(100deg, color-mix(in srgb, var(--maison-couleur, #8f2424) 30%, transparent), transparent 65%);
}
.maison__entete::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 30%; height: 1px; background: linear-gradient(90deg, var(--gold-primary), transparent); }
.blason {
  display: grid; place-items: center; flex: none; width: 56px; height: 66px;
  clip-path: polygon(0 0, 100% 0, 100% 62%, 50% 100%, 0 62%);
  background: linear-gradient(160deg, color-mix(in srgb, var(--maison-couleur, #8f2424) 100%, #fff 8%), color-mix(in srgb, var(--maison-couleur, #8f2424) 50%, #000));
  font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  box-shadow: inset 0 0 0 2px rgba(201, 164, 92, 0.6);
  transition: transform 0.6s var(--ease-out-expo);
}
.maison:hover .blason { transform: translateY(-2px) rotate(-2deg); }
.maison__titre { margin: 0; font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.6rem); letter-spacing: 0.1em; }
.maison__devise { margin: 0.15rem 0 0; font-family: var(--font-serif); font-size: 1.12rem; font-style: italic; color: var(--gold-bright); }
.maison__badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.35rem; }
.maison__corps { padding: 1.5rem 1.7rem 1.7rem; }
.maison__infos { display: grid; gap: 0.6rem 2.2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); margin: 0 0 1.3rem; }
.maison__infos div { margin: 0; }
.maison__infos dt { font-size: 0.66rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-muted); }
.maison__infos dd { margin: 0; color: var(--text-primary); }
.maison__description { max-width: 75ch; font-family: var(--font-serif); font-size: 1.15rem; line-height: 1.55; color: var(--text-primary); }
.maison details { margin-top: 1rem; padding-top: 0.9rem; border-top: 1px solid var(--gold-hairline); }
.maison summary {
  display: flex; align-items: center; gap: 0.6rem; cursor: pointer; list-style: none;
  font-family: var(--font-display); font-size: 0.74rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--gold-primary); transition: color 0.3s;
}
.maison summary::-webkit-details-marker { display: none; }
.maison summary::before { content: ""; width: 6px; height: 6px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(-45deg); transition: transform 0.4s var(--ease-out-expo); }
.maison details[open] > summary::before { transform: rotate(45deg); }
.maison summary:hover { color: var(--gold-bright); }

.membres { display: grid; gap: 0.95rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); margin-top: 1rem; }
.membre {
  position: relative; padding: 1.05rem 1.15rem; overflow: hidden;
  background: var(--bg-void); border: 1px solid var(--gold-hairline); border-radius: var(--radius);
  transition: transform 0.45s var(--ease-out-expo), border-color 0.45s var(--ease-out-expo), box-shadow 0.45s var(--ease-out-expo), background 0.45s var(--ease-out-expo);
}
.membre::before { /* halo radial discret au survol */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 50% 0%, var(--gold-glow), transparent 70%);
  transition: opacity 0.45s var(--ease-out-expo);
}
.membre:hover { transform: translateY(-5px); border-color: var(--gold-border); background: var(--bg-elevated); box-shadow: var(--shadow-soft); }
.membre:hover::before { opacity: 1; }
.membre__nom { position: relative; margin: 0 0 0.15rem; font-family: var(--font-serif); font-size: 1.22rem; font-weight: 600; letter-spacing: 0.01em; text-transform: none; line-height: 1.25; color: var(--gold-bright); }
.membre__titre { position: relative; margin: 0 0 0.55rem; font-size: 0.84rem; color: var(--text-secondary); }
.membre__badges { position: relative; display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 0.55rem; }
.membre__ligne { position: relative; margin: 0; font-size: 0.84rem; color: var(--text-primary); }
.membre__bio { position: relative; margin: 0.55rem 0 0; font-size: 0.85rem; line-height: 1.6; color: var(--text-secondary); }

.arbre, .arbre ul { margin: 0; padding: 0; list-style: none; }
.arbre ul { margin-left: 1.1rem; padding-left: 1.1rem; border-left: 1px solid var(--gold-border); }
.arbre li { position: relative; margin: 0.4rem 0; }
.arbre ul > li::before { content: ""; position: absolute; top: 0.95rem; left: -1.1rem; width: 0.85rem; height: 1px; background: var(--gold-border); }
.arbre__noeud { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; padding: 0.25rem 0.7rem; font-size: 0.88rem; background: var(--bg-void); border: 1px solid var(--gold-hairline); border-radius: var(--radius); transition: border-color 0.3s; }
.arbre__noeud:hover { border-color: var(--gold-border); }
.arbre__noeud--mort { opacity: 0.6; filter: grayscale(0.65); text-decoration: line-through; text-decoration-color: rgba(196, 75, 75, 0.7); }

.statut { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; }
.statut::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); }
.statut--ouvert::before { background: #52b788; box-shadow: 0 0 8px rgba(82, 183, 136, 0.6); }
.statut--ferme::before { background: var(--crimson-bright); }
.statut--prioritaire::before { background: var(--gold-bright); box-shadow: 0 0 0 3px rgba(229, 196, 123, 0.18), 0 0 10px rgba(229, 196, 123, 0.6); }

/* 21 — ESPACE DE GESTION (admin) ---------------------------------------- */
.connexion { max-width: 520px; margin: 0 auto; }
.session {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 2.2rem; padding: 1rem 1.25rem;
  background: var(--bg-surface); border: 1px solid var(--gold-hairline); border-left: 2px solid var(--gold-primary); border-radius: var(--radius);
}
.liste-familles { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.liste-familles button { width: 100%; text-align: left; cursor: pointer; }
.ligne-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.tableau .ligne-actions { flex-wrap: nowrap; }
.tableau select, .tableau input { padding: 0.45rem 2rem 0.45rem 0.6rem; font-size: 0.85rem; }
.tableau input[type="number"] { padding-right: 0.6rem; }
.conseil-editeur { display: grid; gap: 0.6rem; }
.conseil-editeur__ligne { display: grid; gap: 0.5rem; grid-template-columns: 1fr 1fr 1fr auto; align-items: center; }
.conseil-editeur__ligne input, .conseil-editeur__ligne select { padding: 0.55rem 0.7rem; font-size: 0.88rem; }
.conseil-editeur__ligne select { padding-right: 2rem; }

/* 22 — PIED DE PAGE & FINITIONS ----------------------------------------- */
.site-footer {
  position: relative; z-index: 1; margin-top: 4rem; padding: 3.5rem 0 2rem; font-size: 0.88rem; color: var(--text-secondary);
  background: linear-gradient(180deg, var(--bg-void), #060709); border-top: 1px solid var(--gold-hairline);
}
.site-footer::before { content: ""; position: absolute; top: -1px; left: 50%; width: min(520px, 70vw); height: 1px; translate: -50% 0; background: linear-gradient(90deg, transparent, var(--gold-primary), transparent); }
.site-footer__grille { display: grid; gap: 2.4rem; grid-template-columns: 2fr 1fr 1fr; }
.site-footer h4 { margin-bottom: 0.9rem; font-family: var(--font-display); font-size: 0.72rem; color: var(--gold-primary); }
.site-footer ul { margin: 0; padding: 0; list-style: none; }
.site-footer li { margin-bottom: 0.45rem; }
.site-footer a { color: var(--text-secondary); text-decoration: none; }
.site-footer a:hover { color: var(--gold-bright); }
.site-footer__bas { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; margin-top: 2.4rem; padding-top: 1.4rem; font-size: 0.76rem; color: var(--text-muted); border-top: 1px solid var(--gold-hairline); }

.retour-haut {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 90; display: grid; place-items: center; width: 46px; height: 46px; cursor: pointer;
  color: var(--gold-primary); background: var(--bg-glass); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid var(--gold-border); border-radius: 50%;
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity 0.5s var(--ease-out-expo), transform 0.5s var(--ease-out-expo), visibility 0.5s, border-color 0.3s, color 0.3s;
}
.retour-haut.est-visible { opacity: 1; visibility: visible; transform: none; }
.retour-haut:hover { color: var(--gold-bright); border-color: var(--gold-primary); transform: translateY(-3px); }
.retour-haut svg { width: 18px; height: 18px; }
.ancre-titre { margin-left: 0.5rem; font-family: var(--font-serif); font-size: 0.6em; vertical-align: middle; text-decoration: none; color: var(--gold-border); opacity: 0; transition: opacity 0.3s, color 0.3s; }
h2:hover .ancre-titre, h3:hover .ancre-titre, .ancre-titre:focus-visible { opacity: 1; }
.ancre-titre:hover { color: var(--gold-bright); }
.adresse-serveur { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.6rem; margin-top: 1.5rem; }
.adresse-serveur code { padding: 0.5rem 0.9rem; font-size: 1rem; letter-spacing: 0.02em; }

/* 24 — EFFETS CINÉMATIQUES (js/effets.js) -------------------------------- */

/* Voile de transition entre les pages : fondu obsidienne + filet d'or */
.voile { display: none; }
.js .voile {
  position: fixed; inset: 0; z-index: 2000; display: block; pointer-events: none;
  background: radial-gradient(ellipse at 50% 50%, #0e1116, var(--bg-void) 70%);
  opacity: 1; transition: opacity 0.9s var(--ease-out-expo) 0.2s;
}
.js .voile::before {
  content: ""; position: absolute; top: 50%; left: 50%; width: min(420px, 64vw); height: 1px; translate: -50% -50%;
  background: linear-gradient(90deg, transparent, var(--gold-bright), transparent);
  box-shadow: 0 0 18px rgba(229, 196, 123, 0.55);
  opacity: 1; transform: scaleX(0.22);
  transition: transform 0.8s var(--ease-out-expo), opacity 0.6s var(--ease-out-expo) 0.25s;
}
.js .voile::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: 7px; height: 7px; translate: -50% -50%; rotate: 45deg;
  border: 1px solid var(--gold-bright); box-shadow: 0 0 14px rgba(229, 196, 123, 0.6);
  opacity: 1; transition: opacity 0.5s var(--ease-out-expo) 0.15s;
}
html.voile-leve .voile { opacity: 0; }
html.voile-leve .voile::before { transform: scaleX(1); opacity: 0; }
html.voile-leve .voile::after { opacity: 0; }
html.voile-sortie .voile { opacity: 1; transition: opacity 0.45s var(--ease-tactile); }
html.voile-sortie .voile::before { transform: scaleX(1); opacity: 1; transition: transform 0.5s var(--ease-out-expo); }
html.voile-sortie .voile::after { opacity: 1; transition: opacity 0.3s var(--ease-tactile) 0.2s; }

/* Barre de progression de lecture */
.progression-lecture {
  position: fixed; top: 0; left: 0; right: 0; z-index: 160; height: 2px; pointer-events: none;
  transform-origin: 0 50%; transform: scaleX(var(--progression, 0));
  background: linear-gradient(90deg, rgba(201, 164, 92, 0.4), var(--gold-primary) 40%, var(--gold-bright));
  box-shadow: 0 0 12px rgba(229, 196, 123, 0.65);
}
.progression-lecture::after { /* étincelle en tête de barre */
  content: ""; position: absolute; right: 0; top: 50%; width: 6px; height: 6px; translate: 50% -50%; border-radius: 50%;
  background: #fff3d6; box-shadow: 0 0 10px 3px rgba(229, 196, 123, 0.8);
}

/* Cartes 3D tilt + reflet spéculaire */
.membre, .carte--lien, .etapes > li, .maison { --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 50%; transform-style: preserve-3d; }
.tilt-actif {
  transform: perspective(1000px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(-5px) !important;
  transition: transform 0.18s var(--ease-tactile), border-color 0.45s var(--ease-out-expo), box-shadow 0.45s var(--ease-out-expo), background-color 0.45s var(--ease-out-expo) !important;
  box-shadow: var(--shadow-deep), 0 0 0 1px rgba(201, 164, 92, 0.18), 0 0 40px -10px rgba(229, 196, 123, 0.25);
}
.maison.tilt-actif { transform: perspective(1800px) rotateX(var(--rx)) rotateY(var(--ry)) !important; }
@media (min-width: 1100px) {
  .grille--3 > .carte--lien:nth-child(3n + 1).tilt-actif { transform: perspective(1000px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(calc(1.2rem - 5px)) !important; }
}
.reflet {
  position: absolute; inset: 0; z-index: 3; pointer-events: none; border-radius: inherit; opacity: 0;
  background:
    radial-gradient(circle at var(--mx) var(--my), rgba(255, 240, 205, 0.22), rgba(229, 196, 123, 0.09) 22%, transparent 52%),
    linear-gradient(115deg, transparent 35%, rgba(255, 236, 190, 0.05) 48%, transparent 60%);
  mix-blend-mode: screen;
  transition: opacity 0.5s var(--ease-out-expo);
}
.tilt-actif > .reflet { opacity: 1; }
.maison > .reflet { background: radial-gradient(700px circle at var(--mx) var(--my), rgba(229, 196, 123, 0.07), transparent 60%); }
.membre--mort > .reflet { filter: none; opacity: 0; }
.membre--mort.tilt-actif > .reflet { opacity: 0.5; }

/* Braises & cendres du héros */
.braises { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }

/* Boutons et filtres magnétiques (le déplacement utilise « translate », indépendant de « transform ») */
.btn, .filtre-btn, .onglet, .btn-recherche, .sommaire a {
  transition: color 0.45s var(--ease-out-expo), border-color 0.45s var(--ease-out-expo), background 0.45s var(--ease-out-expo),
              box-shadow 0.45s var(--ease-out-expo), transform 0.45s var(--ease-out-expo), translate 0.7s var(--ease-out-expo);
}
.aimante { transition: color 0.3s var(--ease-tactile), border-color 0.3s var(--ease-tactile), background 0.3s var(--ease-tactile), box-shadow 0.3s var(--ease-tactile), transform 0.3s var(--ease-tactile), translate 0.16s linear !important; }

@media (prefers-reduced-motion: reduce) {
  .js .voile, .braises, .reflet { display: none !important; }
  .carte--lien:hover, .maison:hover, .appel, .hero > .container > .hero__titre, .chargement { animation: none !important; }
  .tilt-actif { transform: none !important; }
}
@media print {
  .voile, .progression-lecture, .braises, .reflet { display: none !important; }
}

/* 25 — FINITIONS ÉDITORIALES (CSS pur) ---------------------------------- */

/* Propriété animable pour les bordures dorées tournantes */
@property --angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes sow-tourner { to { --angle: 360deg; } }
@keyframes sow-eclat { 0%, 62% { background-position: 120% 50%; } 100% { background-position: -20% 50%; } }
@keyframes sow-balayage { from { transform: translateX(-130%) skewX(-20deg); } to { transform: translateX(230%) skewX(-20deg); } }
@keyframes sow-trace { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes sow-trace-x { from { transform: scaleX(0); opacity: 0; } to { transform: scaleX(1); opacity: 1; } }
@keyframes sow-resserrer { from { letter-spacing: 0.28em; opacity: 0.35; } to { letter-spacing: 0.08em; opacity: 1; } }
@keyframes sow-fondu-ligne { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes sow-cadre { from { clip-path: inset(0 50% 0 50%); } to { clip-path: inset(0 0 0 0); } }
@keyframes sow-squelette { from { background-position: 150% 0; } to { background-position: -50% 0; } }

/* Titre du héros : reflet doré qui traverse les lettres à intervalles réguliers */
.hero > .container > .hero__titre {
  background-image: linear-gradient(105deg, #8d7038 0%, var(--gold-primary) 28%, var(--gold-bright) 40%, #fff3d2 47%, var(--gold-bright) 54%, var(--gold-primary) 66%, #8d7038 100%);
  background-size: 260% 100%;
  background-position: 120% 50%;
  animation: sow-reveal 1.2s var(--ease-out-expo) 0.1s both, sow-eclat 9s var(--ease-tactile) 1.6s infinite;
}

/* Cadre d'enluminure du héros qui se dessine à l'ouverture */
.hero::after { animation: sow-cadre 1.8s var(--ease-out-expo) 0.2s both; }

/* Bordure dorée tournante au survol des cartes et des Maisons */
.carte--lien:hover, .maison:hover, .appel {
  border-color: transparent;
  background:
    linear-gradient(var(--bg-elevated), var(--bg-elevated)) padding-box,
    conic-gradient(from var(--angle), var(--gold-hairline) 0deg, var(--gold-hairline) 200deg, var(--gold-bright) 260deg, rgba(229, 196, 123, 0.2) 300deg, var(--gold-hairline) 360deg) border-box;
  animation: sow-tourner 5s linear infinite;
}
.maison:hover { background:
    linear-gradient(var(--bg-surface), var(--bg-surface)) padding-box,
    conic-gradient(from var(--angle), var(--gold-hairline) 0deg, var(--gold-hairline) 220deg, var(--gold-primary) 275deg, var(--gold-hairline) 330deg) border-box; }
.appel {
  background:
    radial-gradient(ellipse 70% 60% at 50% 0%, rgba(143, 36, 36, 0.24), transparent 70%) padding-box,
    linear-gradient(var(--bg-surface), var(--bg-surface)) padding-box,
    conic-gradient(from var(--angle), var(--gold-hairline) 0deg, var(--gold-hairline) 200deg, var(--gold-bright) 270deg, var(--gold-hairline) 340deg) border-box;
  animation-duration: 9s;
}

/* Blason : éclat lumineux au survol de la Maison */
.blason { position: relative; overflow: hidden; }
.blason::after {
  content: ""; position: absolute; inset: -20% auto -20% 0; width: 45%;
  background: linear-gradient(90deg, transparent, rgba(255, 245, 220, 0.55), transparent);
  transform: translateX(-130%) skewX(-20deg); pointer-events: none;
}
.maison:hover .blason::after { animation: sow-balayage 1.1s var(--ease-out-expo); }

/* Lettrines éditoriales */
.prose > .lead:first-of-type::first-letter,
.maison__description::first-letter {
  float: left;
  margin: 0.08em 0.14em 0 0;
  padding: 0.04em 0.12em 0;
  font-family: var(--font-display);
  font-size: 3.4em;
  font-weight: 500;
  line-height: 0.82;
  color: var(--gold-bright);
  text-shadow: 0 0 24px rgba(229, 196, 123, 0.25);
  border: 1px solid var(--gold-border);
  background: linear-gradient(160deg, rgba(143, 36, 36, 0.35), transparent 70%);
}
.maison__description::first-letter { font-size: 2.6em; }

/* Lettres géantes ajourées du glossaire */
.glossaire-lettre {
  color: transparent;
  -webkit-text-stroke: 1px var(--gold-primary);
  font-size: clamp(2.6rem, 2rem + 2.4vw, 3.8rem);
  letter-spacing: 0.04em;
}
.glossaire-lettre::after { content: ""; flex: 1; height: 1px; align-self: center; background: linear-gradient(90deg, var(--gold-border), transparent); }

/* Pied de page : grand monogramme ajouré en filigrane */
.site-footer { overflow: hidden; }
.site-footer::after {
  content: "Song of Westeros";
  position: absolute; left: 50%; bottom: -0.32em; translate: -50% 0; z-index: -1;
  font-family: var(--font-display); font-size: clamp(2.2rem, 6.6vw, 8.5rem); font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap;
  color: transparent; -webkit-text-stroke: 1px rgba(201, 164, 92, 0.09); pointer-events: none;
}
.site-footer > .container { position: relative; z-index: 1; }

/* Entêtes de page : cadre fin qui se dessine */
.entete-page::after {
  content: ""; position: absolute; left: 50%; bottom: -1px; width: min(560px, 80vw); height: 1px; translate: -50% 0;
  background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
  animation: sow-trace-x 1.6s var(--ease-out-expo) 0.3s both;
}
.entete-page h1 { text-shadow: 0 0 40px rgba(201, 164, 92, 0.16); }

/* Tableaux : filet doré sous l'en-tête, première colonne mise en valeur */
.tableau thead th { box-shadow: inset 0 -1px 0 var(--gold-border); }
.tableau tbody td:first-child { color: #fff; font-weight: 500; }
.tableau tbody tr { position: relative; }
.tableau tbody tr:hover td:first-child { box-shadow: inset 2px 0 0 var(--gold-primary); }

/* Encarts : fin grain parchemin */
.encart { background-image: radial-gradient(ellipse at 0% 0%, rgba(201, 164, 92, 0.05), transparent 55%); }
.encart--alerte { background-image: linear-gradient(90deg, rgba(143, 36, 36, 0.22), transparent 60%), radial-gradient(ellipse at 0% 0%, rgba(196, 75, 75, 0.08), transparent 55%); }

/* Chargement : texte qui scintille comme une lueur de chandelle */
.chargement {
  background: linear-gradient(90deg, var(--text-muted) 0%, var(--gold-bright) 50%, var(--text-muted) 100%) 0 0 / 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: sow-squelette 2.4s linear infinite;
}

/* Champs : curseur et cases à cocher dorés */
input, textarea { caret-color: var(--gold-bright); }
:root { accent-color: var(--gold-primary); }

/* Section ciblée par une ancre (lien partagé sur Discord) */
section:target > .container > h2:first-child,
section:target .titre-section h2,
h2:target, h3:target { text-shadow: 0 0 22px rgba(229, 196, 123, 0.45); }

/* Liens de prose : soulignement qui se remplit au survol */
.prose a:not(.btn), .encart a, .maison__infos a {
  text-decoration: none;
  background: linear-gradient(var(--gold-bright), var(--gold-bright)) 0 100% / 0 1px no-repeat,
              linear-gradient(rgba(201, 164, 92, 0.35), rgba(201, 164, 92, 0.35)) 0 100% / 100% 1px no-repeat;
  transition: background-size 0.6s var(--ease-out-expo), color 0.3s;
}
.prose a:not(.btn):hover, .encart a:hover, .maison__infos a:hover { background-size: 100% 1px, 100% 1px; }

/* Animations pilotées par le défilement (navigateurs compatibles uniquement) */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .chronologie::before {
      transform-origin: top;
      animation: sow-trace linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 55%;
    }
    .chronologie > li {
      animation: sow-fondu-ligne linear both;
      animation-timeline: view();
      animation-range: entry 5% entry 70%;
    }
    .titre-section h2 {
      animation: sow-resserrer linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 30%;
    }
    .titre-section .ornement::before, .titre-section .ornement::after {
      transform-origin: right;
      animation: sow-trace-x linear both;
      animation-timeline: view();
      animation-range: entry 10% cover 35%;
    }
    .titre-section .ornement::after { transform-origin: right; }
    .tableau tbody tr {
      animation: sow-fondu-ligne linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 80%;
    }
  }
}

/* Légende des statuts (page Maisons) */
.legende-statuts { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.4rem 0.6rem; margin-top: 0.8rem; font-family: var(--font-sans) !important; font-size: 0.82rem !important; color: var(--text-secondary); }
.legende-statuts .badge { margin-left: 0.6rem; }
.legende-statuts .badge:first-child { margin-left: 0; }

/* 26 — Calendrier, Maisons à onglets, mode édition, demandes ------------- */

/* Date en jeu dans l'en-tête */
.date-rp {
  display: inline-flex; align-items: center; gap: 0.45rem; height: 38px; padding: 0 0.75rem; white-space: nowrap;
  font-family: var(--font-display); font-size: 0.74rem; letter-spacing: 0.08em; color: var(--gold-bright);
  border: 1px solid var(--gold-hairline); border-radius: 999px; background: rgba(9, 11, 14, 0.45);
  transition: border-color 0.35s var(--ease-tactile), background 0.35s var(--ease-tactile);
}
.date-rp:hover { border-color: var(--gold-primary); background: var(--bg-surface); color: var(--gold-bright); }
.date-rp svg { width: 14px; height: 14px; flex: none; }
.carte--date .carte__valeur { color: var(--gold-bright); }

/* En-têtes et sections plus compacts */
.entete-page--compacte { padding-block: clamp(2.2rem, 1.4rem + 3vw, 3.6rem) clamp(1.6rem, 1.2rem + 2vw, 2.6rem); }
.entete-page--compacte h1 { font-size: clamp(1.9rem, 1.2rem + 2.8vw, 3.1rem); margin: 0.3em 0 0.2em; }
.entete-page--compacte .ornement { margin-block: 0.5rem; }
.section--compacte { padding-block: clamp(2rem, 1.4rem + 2.5vw, 3.6rem); }
.titre-section--compact { margin-bottom: 1.2rem; }
.titre-section--compact h2 { font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem); }
.titre-section--compact p { font-size: 1.05rem; }
.titre-section--compact .legende-statuts { margin-top: 0.4rem; }

/* Barre d'outils des Maisons */
.barre-outils--maisons { margin-bottom: 1.4rem; padding: 0.7rem 0 0; }
.maisons-outils { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.maisons-outils .champ--compact { flex: 1 1 260px; }
.champ--compact .champ__input { padding-block: 0.55rem; font-size: 0.9rem; }
.choix-compact { flex: 0 1 auto; }
.choix-compact select { padding-block: 0.55rem; font-size: 0.85rem; min-width: 11rem; }
.maisons-outils .compteur { margin-left: auto; font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; }
.onglets-regions {
  display: flex; gap: 0.2rem; margin-top: 0.6rem; overflow-x: auto; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent); mask-image: linear-gradient(90deg, #000 92%, transparent);
}
.onglets-regions::-webkit-scrollbar { display: none; }
.onglet-region {
  position: relative; flex: none; display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.55rem 0.8rem 0.65rem; cursor: pointer;
  font-family: var(--font-display); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-secondary);
  background: none; border: 0; transition: color 0.3s var(--ease-tactile);
}
.onglet-region::after { content: ""; position: absolute; left: 0.6rem; right: 0.6rem; bottom: 0; height: 2px; background: var(--gold-bright); transform: scaleX(0); transition: transform 0.45s var(--ease-out-expo); }
.onglet-region:hover { color: var(--text-primary); }
.onglet-region[aria-selected="true"] { color: var(--gold-bright); }
.onglet-region[aria-selected="true"]::after { transform: scaleX(1); }
.onglet-region__nb { font-family: var(--font-sans); font-size: 0.66rem; letter-spacing: 0; padding: 0.05rem 0.4rem; border-radius: 999px; background: var(--gold-hairline); color: var(--text-muted); }
.onglet-region[aria-selected="true"] .onglet-region__nb { background: var(--gold-glow); color: var(--gold-bright); }

/* Vue : liste des Maisons (sous-onglets) + fiche */
.maisons-vue { display: grid; grid-template-columns: minmax(200px, 240px) minmax(0, 1fr); gap: 1.6rem; align-items: start; }
.maisons-nav {
  position: sticky; top: calc(var(--nav-h) + 8.2rem); display: flex; flex-direction: column; gap: 0.15rem;
  max-height: calc(100vh - var(--nav-h) - 9.5rem); overflow-y: auto; padding-right: 0.3rem; scrollbar-width: thin;
}
.maisons-nav__item {
  display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 0.6rem; width: 100%; padding: 0.45rem 0.6rem; cursor: pointer;
  text-align: left; color: var(--text-secondary); background: none; border: 1px solid transparent; border-radius: var(--radius);
  transition: color 0.3s var(--ease-tactile), background 0.3s var(--ease-tactile), border-color 0.3s var(--ease-tactile);
}
.maisons-nav__item:hover { color: var(--text-primary); background: var(--bg-surface); }
.maisons-nav__item[aria-current="true"] { color: var(--gold-bright); background: var(--bg-elevated); border-color: var(--gold-border); }
.maisons-nav__blason {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-family: var(--font-display); font-size: 0.78rem; color: #fff;
  background: var(--maison-couleur, var(--crimson)); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}
.maisons-nav__nom { font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.maisons-nav__nb { font-size: 0.7rem; color: var(--text-muted); }
#liste-maisons > .maison { margin: 0; }

/* Sous-onglets d'une fiche */
.sous-onglets { display: flex; gap: 0.15rem; margin: 1.4rem 0 0.2rem; border-bottom: 1px solid var(--gold-hairline); overflow-x: auto; scrollbar-width: none; }
.sous-onglets::-webkit-scrollbar { display: none; }
.sous-onglet {
  position: relative; flex: none; padding: 0.5rem 0.8rem 0.6rem; cursor: pointer; background: none; border: 0;
  font-family: var(--font-display); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted);
  transition: color 0.3s var(--ease-tactile);
}
.sous-onglet::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--gold-bright); transform: scaleX(0); transition: transform 0.45s var(--ease-out-expo); }
.sous-onglet:hover { color: var(--text-primary); }
.sous-onglet[aria-selected="true"] { color: var(--gold-bright); }
.sous-onglet[aria-selected="true"]::after { transform: scaleX(1); }
.sous-panneau { padding-top: 0.6rem; }
.sous-panneau .membres { margin-top: 0.6rem; }
.sous-panneau .chronologie { margin-top: 0.8rem; }

/* Champs vides : masqués hors mode édition */
html:not(.mode-edition) [data-edit]:empty,
html:not(.mode-edition) .maison__infos > div:has(> dd:empty),
html:not(.mode-edition) .maison__devise:has(> span:empty) { display: none; }
.maison__devise > span::before { content: "« "; }
.maison__devise > span::after { content: " »"; }

/* Mode édition */
.edition-dock {
  position: fixed; left: max(1rem, env(safe-area-inset-left)); bottom: max(1rem, env(safe-area-inset-bottom)); z-index: 90;
  display: flex; align-items: center; gap: 0.4rem; padding: 0.35rem; border-radius: 999px;
  background: var(--bg-glass); border: 1px solid var(--gold-border); box-shadow: var(--shadow-deep);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.edition-dock__btn {
  height: 36px; padding: 0 0.95rem; cursor: pointer; border-radius: 999px; font-size: 0.82rem; white-space: nowrap;
  color: var(--text-primary); background: var(--bg-elevated); border: 1px solid var(--gold-hairline);
  transition: background 0.3s var(--ease-tactile), border-color 0.3s var(--ease-tactile), color 0.3s;
}
.edition-dock__btn:hover:not(:disabled) { border-color: var(--gold-primary); }
.edition-dock__btn:disabled { opacity: 0.45; cursor: default; }
.edition-dock__btn--principal { color: #120e05; background: var(--gold-primary); border-color: var(--gold-primary); font-weight: 600; }
.edition-dock__btn--principal:hover { background: var(--gold-bright); }
.edition-dock__btn--principal[aria-pressed="true"] { color: var(--gold-bright); background: var(--bg-elevated); }
.edition-dock__btn--discret { background: none; color: var(--text-secondary); }
.edition-dock__etat { font-size: 0.78rem; color: var(--text-secondary); padding-inline: 0.2rem; }
.edition-dock__etat:empty { display: none; }
.edition-dock__compte {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; font-family: var(--font-display); font-size: 0.9rem;
  color: var(--gold-bright); background: var(--bg-surface); border: 1px solid var(--gold-border);
}
.edition-dock__compte:hover { border-color: var(--gold-primary); color: var(--gold-bright); }
.mode-edition .edition-zone { outline: 1px dashed var(--gold-border); outline-offset: 10px; border-radius: 2px; cursor: text; transition: outline-color 0.3s; }
.mode-edition .edition-zone:hover { outline-color: var(--gold-primary); }
.mode-edition .edition-zone:focus { outline: 1px solid var(--gold-primary); box-shadow: 0 0 0 10px rgba(201, 164, 92, 0.04); }
.mode-edition .edition-champ {
  outline: 1px dashed var(--gold-border); outline-offset: 3px; border-radius: 2px; cursor: text; min-width: 3ch; display: inline-block;
}
.mode-edition p.edition-champ, .mode-edition h3.edition-champ, .mode-edition h4.edition-champ, .mode-edition dd.edition-champ { display: block; }
.mode-edition .edition-champ:hover { outline-color: var(--gold-primary); background: rgba(201, 164, 92, 0.05); }
.mode-edition .edition-champ:focus { outline: 1px solid var(--gold-primary); background: rgba(201, 164, 92, 0.07); }
.mode-edition [data-edit]:empty::before { content: attr(data-placeholder); color: var(--text-muted); font-style: italic; }
.maison__description:empty::first-letter { float: none; font: inherit; line-height: inherit; margin: 0; padding: 0; border: 0; background: none; color: inherit; box-shadow: none; }
.mode-edition .edition-modifie { outline-color: var(--emerald-text) !important; outline-style: solid !important; }
.mode-edition .auto-verrou { position: relative; cursor: default; }
.mode-edition .edition-zone .auto-verrou:not(svg):not([data-date-rp]):not(button):not(input):not(select)::after {
  content: "Contenu automatique"; position: absolute; top: -0.65rem; right: 0.4rem; padding: 0.05rem 0.45rem; pointer-events: none;
  font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted);
  background: var(--bg-void); border: 1px solid var(--gold-hairline); border-radius: 999px;
}
.mode-edition [data-date-rp].auto-verrou { text-decoration: underline dotted var(--gold-border); }
.edition-outil {
  display: inline-flex; align-items: center; gap: 0.3rem; margin: 0 0 0.8rem; padding: 0.3rem 0.7rem; cursor: pointer;
  font-size: 0.75rem; color: var(--text-secondary); background: var(--bg-surface); border: 1px solid var(--gold-hairline); border-radius: 999px;
}
.edition-outil:hover { color: var(--gold-bright); border-color: var(--gold-primary); }
.edition-outil--lien { margin: 0.6rem 0 0; grid-column: 1 / -1; justify-self: start; }
.mode-edition .tilt-actif { transform: none !important; }

/* Connexion par code */
.code-otp { font-family: var(--font-mono); font-size: 1.6rem !important; letter-spacing: 0.45em; text-align: center; padding-block: 0.7rem !important; }

/* Demandes de rôle */
.choix-segmente { display: inline-flex; flex-wrap: wrap; gap: 0.3rem; padding: 0.25rem; border: 1px solid var(--gold-hairline); border-radius: 999px; justify-self: start; }
.choix-segmente label { margin: 0; cursor: pointer; }
.choix-segmente input { position: absolute; opacity: 0; pointer-events: none; }
.choix-segmente span { display: block; padding: 0.45rem 1rem; border-radius: 999px; font-size: 0.85rem; color: var(--text-secondary); transition: background 0.3s, color 0.3s; }
.choix-segmente input:checked + span { color: #120e05; background: var(--gold-primary); }
.choix-segmente input:focus-visible + span { outline: 2px solid var(--gold-bright); outline-offset: 2px; }
.sous-formulaire { display: grid; gap: 1rem 1.4rem; }
.sous-formulaire[hidden] { display: none; }
@media (min-width: 700px) { .sous-formulaire { grid-template-columns: 1fr 1fr; } }
.carte--demande { max-width: 860px; margin-inline: auto; }
.demandes { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); margin-bottom: 1.6rem; }
.demande { display: grid; gap: 0.55rem; }
.demande__entete { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem; }
.demande__message { margin: 0; padding: 0.6rem 0.8rem; font-family: var(--font-serif); font-size: 1.05rem; font-style: italic; color: var(--text-secondary); border-left: 2px solid var(--gold-border); background: rgba(9, 11, 14, 0.35); }
.demande__decision { display: grid; gap: 0.5rem; padding-top: 0.6rem; border-top: 1px solid var(--gold-hairline); }
.demande__decision select, .demande__decision input[type="text"] { padding-block: 0.5rem; font-size: 0.86rem; }
.demande__attrib { display: grid; gap: 0.5rem; grid-template-columns: 1fr; }
.demande__attrib[hidden] { display: none; }
@media (min-width: 560px) { .demande__attrib { grid-template-columns: 1.4fr 1fr auto; align-items: center; } }
.demande__toggle { display: inline-flex; align-items: center; gap: 0.45rem; margin: 0; }
.demande--en_attente { border-color: var(--gold-border); }
.onglet--alerte { color: var(--amber-text); }

@media (max-width: 899px) {
  .maisons-vue { grid-template-columns: 1fr; gap: 1rem; }
  .maisons-nav {
    position: static; flex-direction: row; max-height: none; overflow-x: auto; overflow-y: hidden; padding: 0 0 0.3rem; gap: 0.35rem;
    scrollbar-width: none;
  }
  .maisons-nav::-webkit-scrollbar { display: none; }
  .maisons-nav__item { width: auto; flex: none; grid-template-columns: 22px auto auto; gap: 0.45rem; padding: 0.35rem 0.7rem 0.35rem 0.35rem; border-radius: 999px; border-color: var(--gold-hairline); }
  .maisons-nav__blason { width: 22px; height: 22px; font-size: 0.68rem; }
  .maisons-nav__nom { font-size: 0.82rem; }
}
@media (max-width: 720px) {
  .barre-outils--maisons { position: static; }
  .maisons-outils .compteur { margin-left: 0; width: 100%; }
  .choix-compact { flex: 1 1 45%; }
  .choix-compact select { min-width: 0; }
  .date-rp { padding: 0 0.6rem; font-size: 0.68rem; }
}
@media (max-width: 480px) {
  .date-rp span { display: none; }
  .date-rp { width: 38px; justify-content: center; padding: 0; }
  .edition-dock__btn { padding: 0 0.75rem; }
  .edition-dock__etat { display: none; }
}

/* Ajustements d'en-tête avec la date en jeu */
.btn-recherche, .date-rp { flex: none; }
.btn-recherche svg { flex: none; }
.nav-principale a { white-space: nowrap; }
.btn-recherche kbd { white-space: nowrap; }
@media (max-width: 1499px) and (min-width: 1280px) {
  .btn-recherche__texte, .btn-recherche kbd { display: none; }
  .nav-principale a { padding-inline: 0.6rem; letter-spacing: 0.11em; }
}
@media (max-width: 899px) { .maisons-vue { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 400px) {
  .site-header__inner { gap: 0.5rem; }
  .header-actions { gap: 0.35rem; }
  .logo { gap: 0.45rem; }
  .logo svg { width: 24px; height: 24px; }
  .logo span { font-size: 0.7rem; letter-spacing: 0.06em; }
}
@media (max-width: 340px) { .logo span { display: none; } }


/* Connexion par mot de passe */
.champ-mdp { position: relative; }
.champ-mdp input { padding-right: 3rem; }
.champ-mdp__oeil {
  position: absolute; top: 50%; right: 0.4rem; translate: 0 -50%; width: 2.3rem; height: 2.3rem; cursor: pointer;
  font-size: 1rem; line-height: 1; background: none; border: 0; border-radius: var(--radius); opacity: 0.7;
}
.champ-mdp__oeil:hover, .champ-mdp__oeil:focus-visible { opacity: 1; background: var(--gold-hairline); }
.lien-bouton { padding: 0; cursor: pointer; background: none; border: 0; font: inherit; color: var(--gold-primary); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--gold-border); }
.lien-bouton:hover { color: var(--gold-bright); text-decoration-color: currentColor; }
.formulaire__actions--entre { justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.8rem; }

/* 27 — Calendrier des événements ----------------------------------------- */
.evt-type { display: inline-flex; align-items: center; gap: 0.15rem; padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.72rem; letter-spacing: 0.04em; color: var(--gold-bright); background: var(--gold-hairline); border: 1px solid var(--gold-hairline); white-space: nowrap; }
.evt-type--mariage { color: #f0c6d4; background: rgba(176, 82, 118, 0.14); border-color: rgba(176, 82, 118, 0.3); }
.evt-type--tournoi, .evt-type--bataille { color: var(--crimson-text); background: rgba(143, 36, 36, 0.16); border-color: rgba(196, 75, 75, 0.3); }
.evt-type--fete { color: var(--amber-text); background: rgba(185, 133, 45, 0.14); border-color: rgba(185, 133, 45, 0.3); }
.evt-type--naissance { color: var(--emerald-text); background: rgba(45, 106, 79, 0.16); border-color: rgba(45, 106, 79, 0.35); }
.evt-type--funerailles { color: #b9bec9; background: rgba(120, 125, 140, 0.14); border-color: rgba(120, 125, 140, 0.3); }
.evt-type--conseil, .evt-type--ceremonie { color: #cdb9ef; background: rgba(93, 60, 134, 0.18); border-color: rgba(93, 60, 134, 0.35); }
.evt-rebours { font-size: 0.74rem; font-weight: 600; letter-spacing: 0.04em; color: var(--gold-bright); white-space: nowrap; }

/* Accueil */
.evt-accueil { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.evt-carte {
  display: grid; gap: 0.35rem; align-content: start; padding: 1.2rem 1.3rem; text-decoration: none; color: var(--text-primary);
  background: var(--bg-surface); border: 1px solid var(--gold-hairline); border-radius: var(--radius-lg);
  transition: border-color 0.4s var(--ease-out-expo), transform 0.4s var(--ease-out-expo);
}
.evt-carte:hover { border-color: var(--gold-primary); transform: translateY(-3px); color: var(--text-primary); }
.evt-carte--une { border-color: var(--gold-border); background: linear-gradient(160deg, rgba(201, 164, 92, 0.1), transparent 60%), var(--bg-surface); }
.evt-carte__haut { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; margin-bottom: 0.3rem; }
.evt-carte__titre { margin: 0; font-size: 1.15rem; letter-spacing: 0.04em; }
.evt-carte__quand { margin: 0; font-size: 0.9rem; color: var(--text-secondary); }
.evt-carte__rp, .evt__rp { margin: 0; font-family: var(--font-serif); font-style: italic; font-size: 1rem; color: var(--gold-primary); }
.evt-carte__lieu { margin: 0; font-size: 0.85rem; color: var(--text-muted); }

/* Page */
.evt-une { margin-bottom: 2rem; }
.evt-une__titre { margin: 0 0 0.9rem; font-size: 1.1rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold-bright); }
.evt-une__grille { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.evt-onglets { margin-top: 0; flex: 1 1 auto; }
#evt-liste { display: grid; gap: 1.8rem; }
.evt-jour__titre {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 0 0 0.7rem; padding-bottom: 0.45rem;
  font-size: 0.95rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-secondary); border-bottom: 1px solid var(--gold-hairline);
}
.evt-jour--aujourdhui .evt-jour__titre { color: var(--gold-bright); border-bottom-color: var(--gold-border); }
.evt-jour__rp { font-family: var(--font-serif); font-size: 1rem; letter-spacing: 0; text-transform: none; font-style: italic; color: var(--gold-primary); }
.evt-jour__liste { display: grid; gap: 0.8rem; }
.evt {
  display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 1.2rem; padding: 1.1rem 1.3rem;
  background: var(--bg-surface); border: 1px solid var(--gold-hairline); border-radius: var(--radius-lg);
  transition: border-color 0.4s var(--ease-out-expo), box-shadow 0.4s var(--ease-out-expo);
}
.evt:hover { border-color: var(--gold-border); }
.evt--etoile { border-color: var(--gold-border); box-shadow: inset 3px 0 0 var(--gold-primary); }
.evt--attente { border-style: dashed; }
.evt--cible { border-color: var(--gold-primary); box-shadow: 0 0 0 3px rgba(201, 164, 92, 0.18); }
.evt--une { grid-template-columns: 1fr; background: linear-gradient(160deg, rgba(201, 164, 92, 0.1), transparent 55%), var(--bg-elevated); border-color: var(--gold-border); }
.evt--une .evt__quand { flex-direction: row; align-items: baseline; gap: 0.8rem; border: 0; padding: 0; }
.evt--une .evt__titre { font-size: 1.35rem; }
.evt__quand { display: flex; flex-direction: column; gap: 0.2rem; padding-right: 1rem; border-right: 1px solid var(--gold-hairline); }
.evt__heure { font-family: var(--font-display); font-size: 1.35rem; color: var(--text-primary); }
.evt__fin { font-size: 0.8rem; color: var(--text-muted); }
.evt__tete { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-bottom: 0.35rem; }
.evt__titre { margin: 0 0 0.15rem; font-size: 1.15rem; letter-spacing: 0.04em; }
.evt__infos { display: flex; flex-wrap: wrap; gap: 0.3rem 1.1rem; margin: 0.45rem 0 0; padding: 0; list-style: none; font-size: 0.88rem; color: var(--text-secondary); }
.evt__infos li { margin: 0; }
.evt__desc { margin: 0.6rem 0 0; max-width: 75ch; color: var(--text-primary); white-space: pre-line; }
.evt__actions { margin-top: 0.8rem; }
.evt-apercu { color: var(--gold-primary); font-family: var(--font-serif); font-size: 1.02rem; font-style: italic; }
.evt-une-choix { display: inline-flex; align-items: center; gap: 0.5rem; }
@media (max-width: 640px) {
  .evt { grid-template-columns: 1fr; gap: 0.5rem; padding: 1rem; }
  .evt__quand { flex-direction: row; align-items: baseline; gap: 0.7rem; padding: 0 0 0.5rem; border-right: 0; border-bottom: 1px solid var(--gold-hairline); }
  .evt-jour__titre { flex-direction: column; gap: 0.1rem; }
  #evt-proposer { width: 100%; }
}

/* Comptes liés */
.comptes-lies { display: grid; gap: 0.8rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.compte-lie { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 0.9rem; padding: 0.9rem 1rem; background: var(--bg-surface); border: 1px solid var(--gold-hairline); border-radius: var(--radius-lg); }
.compte-lie__logo { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; overflow: hidden; color: #fff; font-weight: 700; }
.compte-lie__logo img { width: 100%; height: 100%; object-fit: cover; }
.compte-lie__logo--discord { background: #5865f2; }
.compte-lie__logo--steam { background: #1b2838; }
.compte-lie__logo svg { width: 24px; height: 24px; }
.compte-lie__nom { margin: 0; font-weight: 600; }
.compte-lie__etat { margin: 0; font-size: 0.82rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compte-lie--ok { border-color: rgba(45, 106, 79, 0.45); }
.compte-lie--ok .compte-lie__etat { color: var(--emerald-text); }
.btn-discord { display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem; width: 100%; color: #fff; background: #5865f2; border-color: #5865f2; }
.btn-discord:hover { color: #fff; background: #4752c4; border-color: #4752c4; }
.btn-discord svg { width: 20px; height: 20px; }
.separateur-ou { display: flex; align-items: center; gap: 0.8rem; margin: 1rem 0; font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); }
.separateur-ou::before, .separateur-ou::after { content: ""; flex: 1; height: 1px; background: var(--gold-hairline); }
.demande__comptes { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.demande__attrib--4 { grid-template-columns: 1fr; }
@media (min-width: 560px) { .demande__attrib--4 { grid-template-columns: 1fr 1fr; } }
.maison-evts { display: grid; gap: 0.4rem; margin: 0.6rem 0 0; padding: 0; list-style: none; }
.maison-evt { margin: 0; }
.maison-evt a { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr) auto; align-items: center; gap: 0.7rem; padding: 0.6rem 0.8rem; text-decoration: none; color: var(--text-primary); background: rgba(9, 11, 14, 0.35); border: 1px solid var(--gold-hairline); border-radius: var(--radius); transition: border-color 0.3s; }
.maison-evt a:hover { border-color: var(--gold-primary); color: var(--text-primary); }
.maison-evt__ico { text-align: center; }
.maison-evt__titre { font-weight: 600; }
.maison-evt__date { font-size: 0.82rem; color: var(--text-secondary); white-space: nowrap; }
.maison-evt__date em { color: var(--gold-primary); font-family: var(--font-serif); }
@media (max-width: 560px) { .maison-evt a { grid-template-columns: 1.4rem 1fr; } .maison-evt__date { grid-column: 2; white-space: normal; } }
/* 23 — RESPONSIVE, ACCESSIBILITÉ, IMPRESSION ---------------------------- */
@media (min-width: 1440px) {
  :root { --max: 1280px; }
}
@media (max-width: 1279px) {
  .burger { display: inline-flex; }
  .nav-principale {
    position: fixed; top: var(--nav-h); left: 0; right: 0; max-height: calc(100vh - var(--nav-h)); overflow-y: auto;
    background: rgba(9, 11, 14, 0.97); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--gold-border);
    opacity: 0; visibility: hidden; transform: translateY(-10px);
    transition: opacity 0.45s var(--ease-out-expo), transform 0.45s var(--ease-out-expo), visibility 0.45s;
  }
  .nav-principale.est-ouverte { opacity: 1; visibility: visible; transform: none; }
  .nav-principale ul { flex-direction: column; padding: 0.6rem 1.25rem 1.4rem; }
  .nav-principale a { padding: 1rem 0.3rem; font-size: 0.86rem; border-bottom: 1px solid var(--gold-hairline); }
  .nav-principale a::after { display: none; }
  .btn-recherche__texte, .btn-recherche kbd { display: none; }
}
@media (max-width: 820px) {
  .site-footer__grille { grid-template-columns: 1fr 1fr; }
  .site-footer__grille > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  :root { --nav-h: 64px; }
  body { line-height: 1.7; }
  .logo span { font-size: 0.8rem; letter-spacing: 0.1em; }
  .hero { padding: 4.5rem 0 6rem; }
  .hero__surtitre::before, .hero__surtitre::after { display: none; }
  .glossaire-entree { grid-template-columns: 1fr; }
  .maison__entete { grid-template-columns: auto 1fr; padding: 1.25rem; }
  .maison__badges { grid-column: 1 / -1; justify-content: flex-start; }
  .maison__corps { padding: 1.25rem; }
  .conseil-liste li { grid-template-columns: 1fr; gap: 0.1rem; }
  .conseil-editeur__ligne { grid-template-columns: 1fr !important; }
  .site-footer__grille { grid-template-columns: 1fr; }
  .recherche__pied { display: none; }
  .modale, .modal-overlay { padding: 0; align-items: stretch; }
  .modale__boite, .modal-panel { min-height: 100%; border-radius: 0; }
}
/* Légende, tableaux empilés et filtres défilants sur téléphone */
.legende-item { display: inline-flex; align-items: center; gap: 0.4rem; white-space: nowrap; }
.legende-statuts .badge { margin-left: 0; }
.legende-statuts { gap: 0.5rem 1.2rem; }
@media (max-width: 640px) {
  .tableau--empile thead { display: none; }
  .tableau--empile, .tableau--empile tbody, .tableau--empile tr { display: block; width: 100%; }
  .tableau--empile tr { padding: 0.75rem 0.95rem; border-bottom: 1px solid var(--gold-hairline); }
  .tableau--empile tbody tr:last-child { border-bottom: 0; }
  .tableau--empile td {
    display: grid; grid-template-columns: minmax(92px, 36%) 1fr; gap: 0.8rem; align-items: start;
    padding: 0.28rem 0; border: 0; text-align: left !important; white-space: normal !important;
  }
  .tableau--empile td > *, .tableau--empile td > .interrupteur { grid-column: 2; }
  .tableau--empile td:first-child > * { grid-column: auto; }
  .tableau--empile td::before {
    content: attr(data-label); padding-top: 0.25rem;
    font-family: var(--font-display); font-size: 0.6rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-primary);
  }
  .tableau--empile td:first-child { display: block; padding-bottom: 0.45rem; font-family: var(--font-serif); font-size: 1.12rem; font-weight: 600; color: var(--gold-bright); }
  .tableau--empile td:first-child::before { display: none; }
  .tableau--empile td:empty, .tableau--empile td[data-label=""] { display: none; }
  .tableau--empile caption { display: block; }
  .tableau--empile tbody tr:hover td:first-child { box-shadow: none; }
  .tableau--empile .ligne-actions { flex-wrap: wrap; }
  .tableau--empile td > select, .tableau--empile td > input { width: 100%; }
}
@media (max-width: 720px) {
  .barre-outils { position: static; }
  .barre-outils .filtres {
    flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    padding-bottom: 0.2rem; -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent); mask-image: linear-gradient(90deg, #000 82%, transparent);
  }
  .barre-outils .filtres::-webkit-scrollbar { display: none; }
  .barre-outils .filtre-btn, .barre-outils .filtres__label { flex: none; white-space: nowrap; }
  .barre-outils .filtres > :last-child { margin-right: 2.5rem; }
  .legende-statuts { justify-content: flex-start; }
}
@media (max-width: 400px) {
  .container, .container--etroit { width: min(100% - 1.75rem, var(--max)); }
  .carte, .maison__corps, .maison__entete { padding-left: 1rem; padding-right: 1rem; }
  .membres { grid-template-columns: 1fr; }
  .btn { padding: 0.8rem 1.15rem; letter-spacing: 0.14em; }
  .hero__actions .btn { width: 100%; }
}

@media (hover: none) {
  .carte--lien:hover, .membre:hover, .etapes > li:hover { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .js .reveal, .js .apparition { opacity: 1; transform: none; }
  .grille--3 > .carte--lien:nth-child(3n + 1) { transform: none !important; }
}
@media (prefers-contrast: more) {
  :root { --text-secondary: #c3c8d2; --gold-hairline: rgba(201, 164, 92, 0.4); --gold-border: rgba(201, 164, 92, 0.6); }
}
@media print {
  body::before, body::after, .site-header, .site-footer, .retour-haut, .hero__defiler, .barre-outils, .infobulle { display: none !important; }
  body { color: #000; background: #fff; }
  main { padding-top: 0; }
  h1, h2, h3, a { color: #000; -webkit-text-fill-color: #000; }
  .carte, .maison, .membre, .encart { break-inside: avoid; background: none; border-color: #999; box-shadow: none; }
}

/* Grades de l'équipe */
.select-grade { width: auto; min-width: 9.5rem; padding: 0.35rem 0.6rem; font-size: 0.85rem; }
