/* ═══════════════════════════════════════════════════════════════════════════
   AETHERION — L'Aube Écarlate · Feuille de style UI
   ─────────────────────────────────────────────────────────────────────────
   Direction artistique : dark fantasy ceremonial — or ancien, écarlate, aether.
   Aucune image externe : uniquement dégradés, ombres, pseudo-éléments, animations.
   Typographie : Cinzel (titres, capitales espacées) · EB Garamond (corps).
   Espacements : 4 / 8 / 12 / 16 / 24 — Rayons : 2 à 6 px (angles fins, jamais
   de bulles arrondies). Cibles : 1280 → 1920 px, tout en clamp().
   ═══════════════════════════════════════════════════════════════════════════ */


/* ═════════════════════════════ 01 · FONDATIONS ═════════════════════════════ */

:root {
  /* — Palette officielle — */
  --nuit:            #0b0e1d;
  --nuit-2:          #10142b;
  --nuit-3:          #171c3a;
  --panneau:         rgba(10, 14, 30, .82);
  --panneau-clair:   rgba(18, 23, 48, .88);
  --panneau-sombre:  rgba(6, 8, 18, .9);

  --or:              #c9a227;
  --or-clair:        #f4d58d;
  --or-sombre:       #8a6d1a;
  --or-creux:        #5c4a12;

  --ecarlate:        #a4161a;
  --ecarlate-vif:    #e5383b;
  --ecarlate-nuit:   #5f0d10;

  --ivoire:          #f5f0e6;
  --ivoire-voile:    rgba(245, 240, 230, .62);

  --aether:          #7bf1e0;
  --aether-sombre:   #2e8f84;
  --aether-nuit:     #103b38;

  /* — Accents secondaires — */
  --violet-brisure:  #8d5bd3;
  --violet-nuit:     #2c1650;
  --vert-soin:       #8df0b0;
  --rose-affinite:   #e8a7c0;
  --ambre:           #e0b054;

  /* — Bordures — */
  --bordure:         rgba(201, 162, 39, .5);
  --bordure-fine:    rgba(201, 162, 39, .28);
  --bordure-sombre:  rgba(0, 0, 0, .55);
  --bordure-aether:  rgba(123, 241, 224, .45);

  /* — Typographies — */
  --titre:           'Cinzel', 'Georgia', 'Times New Roman', serif;
  --corps:           'EB Garamond', 'Georgia', serif;

  /* — Rythme (4 / 8 / 12 / 16 / 24) — */
  --esp-1: 4px;
  --esp-2: 8px;
  --esp-3: 12px;
  --esp-4: 16px;
  --esp-6: 24px;

  /* — Rayons (angles fins) — */
  --rayon-fin:   2px;
  --rayon:       3px;
  --rayon-large: 6px;

  /* — Mouvements — */
  --trans-douce: 220ms cubic-bezier(.22, .68, .36, 1);
  --trans-barre: 400ms cubic-bezier(.22, .68, .36, 1);
  --trans-lente: 700ms cubic-bezier(.3, .75, .3, 1);

  /* — Ombres de lisibilité (texte sur fond 3D chargé) — */
  --ombre-texte: 0 1px 2px rgba(4, 5, 12, .9), 0 2px 10px rgba(4, 5, 12, .65);
  --ombre-texte-forte: 0 2px 0 rgba(4, 5, 12, .85), 0 4px 16px rgba(4, 5, 12, .8);
  --ombre-panneau: 0 10px 34px rgba(2, 3, 8, .6), 0 2px 6px rgba(2, 3, 8, .5);

  /* — Taille du coin orné — */
  --coin: 14px;
}


/* ═════════════════════════════ 02 · RESET & BASE ════════════════════════════ */

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

html,
body {
  height: 100%;
  overflow: hidden;
  background: var(--nuit);
}

body {
  font-family: var(--corps);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ivoire);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#app {
  position: fixed;
  inset: 0;
  overflow: hidden;
  user-select: none;
  cursor: default;
}

h1, h2, h3, h4 {
  font-family: var(--titre);
  font-weight: 700;
  color: var(--or-clair);
  text-shadow: var(--ombre-texte);
  line-height: 1.25;
}

ul {
  list-style: none;
}

em {
  font-style: italic;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

canvas {
  display: block;
}


/* ════════════════════ 03 · SCROLLBAR, SÉLECTION, FOCUS ═════════════════════ */

html {
  scrollbar-width: thin;
  scrollbar-color: #6a551c rgba(11, 14, 29, .55);
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-track {
  background: rgba(7, 9, 20, .72);
  box-shadow: inset 0 0 3px rgba(0, 0, 0, .8);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #8a6d1a, #4c3d0e 55%, #8a6d1a);
  border: 1px solid rgba(244, 213, 141, .22);
  border-radius: var(--rayon-fin);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #c9a227, #6a551c 55%, #c9a227);
}

::selection {
  background: rgba(201, 162, 39, .88);
  color: #0b0e1d;
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--or);
  outline-offset: 2px;
  border-radius: var(--rayon-fin);
  box-shadow: 0 0 10px rgba(201, 162, 39, .4);
}


/* ═══════════════════════ 04 · ANIMATIONS GLOBALES ══════════════════════════ */

/* Balayage métallique doré — barres, jauges, chargement */
@keyframes shimmer {
  0%   { background-position: 220% 0; }
  100% { background-position: -220% 0; }
}

/* Pulsation lumineuse douce — pastilles, badges, liserés */
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 4px 1px rgba(244, 213, 141, .28); }
  50%      { box-shadow: 0 0 14px 3px rgba(244, 213, 141, .6); }
}

@keyframes pulse-texte {
  0%, 100% { opacity: .85; text-shadow: 0 0 4px rgba(123, 241, 224, .25); }
  50%      { opacity: 1;   text-shadow: 0 0 12px rgba(123, 241, 224, .7); }
}

/* Apparition générale — glissement vertical léger + fondu */
@keyframes apparition {
  0%   { opacity: 0; transform: translateY(14px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Entrée des modales — échelle .96 → 1 + fondu 220 ms */
@keyframes floatIn {
  0%   { opacity: 0; transform: translate(-50%, -48%) scale(.96); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* Clignotement discret du curseur de visée (losange FF) */
@keyframes curseur_visee {
  0%, 100% { opacity: .75; transform: rotate(45deg) scale(1); }
  50%      { opacity: 1;   transform: rotate(45deg) scale(1.12); }
}

/* Flottement vertical de la flèche de ciblage */
@keyframes fleche-flotte {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(5px); }
}

/* Scintillement lent du voile d'étoiles de l'écran titre */
@keyframes scintille {
  0%, 100% { opacity: .65; }
  50%      { opacity: 1; }
}

/* Brume de l'écran titre — très lente rotation */
@keyframes brume-tourne {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Reflet balayant le logotype */
@keyframes reflet-or {
  0%   { background-position: 0 0, 240% 0; }
  100% { background-position: 0 0, -140% 0; }
}

/* Carte de lieu — le texte se resserre et émerge */
@keyframes resserrement {
  0%   { opacity: 0; letter-spacing: .68em; }
  100% { opacity: 1; letter-spacing: .18em; }
}

/* Liseré horizontal qui s'étend (carte de lieu, annonce de chapitre) */
@keyframes etend-lisere {
  0%   { transform: scaleX(0); }
  100% { transform: scaleX(1); }
}

/* Annonce « ENGAGEMENT ! » — échelle + fondu */
@keyframes annonce-combat {
  0%   { opacity: 0; transform: scale(1.6); letter-spacing: .6em; }
  12%  { opacity: 1; transform: scale(1.03); }
  20%  { transform: scale(1); letter-spacing: .3em; }
  76%  { opacity: 1; }
  100% { opacity: 0; transform: scale(.985); }
}

/* Chiffres de dégâts — montée + fondu + échelle 900 ms */
@keyframes degats-montee {
  0%   { opacity: 0; transform: translate(-50%, -50%) translateY(8px) scale(.55); }
  10%  { opacity: 1; transform: translate(-50%, -50%) translateY(-4px) scale(1.18); }
  22%  { transform: translate(-50%, -50%) translateY(-12px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) translateY(-78px) scale(.94); }
}

/* Critique — même montée, avec tremblement au départ */
@keyframes degats-critique {
  0%   { opacity: 0; transform: translate(-50%, -50%) translateX(0) translateY(10px) scale(.5); }
  8%   { opacity: 1; transform: translate(-50%, -50%) translateX(-4px) translateY(-2px) scale(1.5); }
  14%  { transform: translate(-50%, -50%) translateX(4px) scale(1.68); }
  20%  { transform: translate(-50%, -50%) translateX(-3px) scale(1.6); }
  26%  { transform: translate(-50%, -50%) translateX(2px) scale(1.6); }
  32%  { transform: translate(-50%, -50%) translateX(0) scale(1.6); }
  80%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) translateY(-84px) scale(1.5); }
}

/* Éclat doré derrière un chiffre de frappe de faiblesse */
@keyframes eclat-faiblesse {
  0%   { opacity: 0; transform: scale(.3); }
  18%  { opacity: .95; transform: scale(1.05); }
  100% { opacity: 0; transform: scale(1.55); }
}

/* Spirale de la jauge de Limite pleine */
@keyframes spirale {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Éclat radial de l'écran de victoire */
@keyframes burst-victoire {
  0%   { opacity: 0; transform: scale(.55); }
  35%  { opacity: .8; transform: scale(1); }
  100% { opacity: .25; transform: scale(1.28); }
}

/* Montée lente du titre de victoire */
@keyframes victoire-entree {
  0%   { opacity: 0; transform: scale(1.25); letter-spacing: .5em; }
  100% { opacity: 1; transform: scale(1); letter-spacing: .14em; }
}

/* Défaite — le texte émerge très lentement des ténèbres */
@keyframes defaite-lente {
  0%   { opacity: 0; letter-spacing: .55em; }
  100% { opacity: 1; letter-spacing: .22em; }
}

/* Toasts — glissement d'entrée / fondu de sortie */
@keyframes toast-entree {
  0%   { opacity: 0; transform: translateX(34px); }
  100% { opacity: 1; transform: translateX(0); }
}

@keyframes toast-sortie {
  0%   { opacity: 1; transform: translateX(0); }
  100% { opacity: 0; transform: translateX(26px); }
}

/* Indicateur « continuer » — clignotement feutré */
@keyframes clignote-discret {
  0%, 100% { opacity: .38; }
  50%      { opacity: .95; }
}

/* Pointe lumineuse qui suit le remplissage des jauges */
@keyframes pointe-lumineuse {
  0%, 100% { filter: brightness(1); }
  50%      { filter: brightness(1.5); }
}


/* ═══════════════ 05 · UTILITAIRES — PANNEAUX & COINS ORNÉS ═════════════════ */

/*
 * Panneau verre-fumé : double liseré or (box-shadow inset) + grain léger.
 * .orné ajoute les quatre pointes d'or (dégradés coniques) via ::before.
 * Les composants appliquent ces deux règles par sélection groupée ci-dessous.
 */
.panneau-style,
#visee,
#sous-menu,
.journal-encart,
.pause-panneau,
.modale-boite,
.bestiaire-fiche,
.fenetre-objet-boite {
  position: relative;
  background:
    repeating-linear-gradient(48deg, rgba(244, 213, 141, .014) 0 1px, transparent 1px 3px),
    linear-gradient(160deg, rgba(23, 28, 58, .5), rgba(10, 14, 30, .24) 42%, rgba(6, 8, 18, .5)),
    var(--panneau);
  backdrop-filter: blur(10px) saturate(1.15);
  -webkit-backdrop-filter: blur(10px) saturate(1.15);
  border: 1px solid var(--bordure-fine);
  border-radius: var(--rayon);
  box-shadow:
    inset 0 0 0 1px rgba(201, 162, 39, .16),
    inset 0 1px 0 rgba(244, 213, 141, .1),
    var(--ombre-panneau);
}

/* Quatre pointes d'or coniques aux angles — la signature du jeu */
.ornee::before,
#visee::before,
#sous-menu::before,
.journal-encart::before,
.pause-panneau::before,
.modale-boite::before,
.bestiaire-fiche::before,
.fenetre-objet-boite::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    conic-gradient(from 180deg at 0 0, rgba(244, 213, 141, .62) 90deg, transparent 90deg) top left / var(--coin) var(--coin),
    conic-gradient(from 90deg at 100% 0, rgba(244, 213, 141, .62) 90deg, transparent 90deg) top right / var(--coin) var(--coin),
    conic-gradient(from 270deg at 100% 100%, rgba(244, 213, 141, .62) 90deg, transparent 90deg) bottom right / var(--coin) var(--coin),
    conic-gradient(from 0deg at 0 100%, rgba(244, 213, 141, .62) 90deg, transparent 90deg) bottom left / var(--coin) var(--coin);
  background-repeat: no-repeat;
  border-radius: inherit;
}

/* Voile sombre plein écran pour les menus et modales */
.voile-sombre,
#menu-pause,
.fenetre-modale,
#ecran-victoire,
#ecran-defaite {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(23, 28, 58, .38), transparent 60%),
    rgba(4, 6, 13, .62);
  backdrop-filter: blur(3px) brightness(.92);
  -webkit-backdrop-filter: blur(3px) brightness(.92);
}


/* ═════════════════ 06 · VISIBILITÉ — ÉTAT .cache DES ÉCRANS ════════════════ */

/*
 * Toute section pilotée par l'intégrateur : masquée par défaut, révélée
 * dès que .cache est retiré. Aucun !important nécessaire.
 */
#ecran-titre,
#hud,
#boite-dialogue,
#hud-combat,
#menu-pause,
.fenetre-modale,
#ecran-victoire,
#ecran-defaite,
#visee,
#menu-commandes,
#sous-menu,
#carte-lieu,
#annonce-chapitre,
#chargement,
#annonce-combat {
  display: none;
}

#ecran-titre:not(.cache),
#hud:not(.cache),
#boite-dialogue:not(.cache),
#hud-combat:not(.cache),
#menu-pause:not(.cache),
.fenetre-modale:not(.cache),
#ecran-victoire:not(.cache),
#ecran-defaite:not(.cache),
#visee:not(.cache),
#menu-commandes:not(.cache),
#sous-menu:not(.cache),
#carte-lieu:not(.cache),
#annonce-chapitre:not(.cache),
#chargement:not(.cache),
#annonce-combat:not(.cache) {
  display: flex;
}

/* Sécurité pour les éléments à classe seule (toasts, encarts, indicateurs…) */
.cache {
  display: none;
}


/* ═══════════════════════ 07 · SCÈNE & VIGNETTE ═════════════════════════════ */

#scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* Vignettage radial sombre + trame halftone à peine perceptible */
#vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 48%, rgba(5, 7, 15, .34) 76%, rgba(3, 4, 10, .62) 100%),
    radial-gradient(rgba(11, 14, 29, .16) .8px, transparent 1.1px);
  background-size: 100% 100%, 3px 3px;
}


/* ═══════════════════════ 08 · ÉCRAN DE CHARGEMENT ══════════════════════════ */

#chargement {
  z-index: 100;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(70% 55% at 50% 42%, rgba(201, 162, 39, .07), transparent 70%),
    radial-gradient(120% 90% at 50% 115%, rgba(95, 13, 16, .34), transparent 60%),
    var(--nuit);
}

.chargement-boite {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--esp-4);
  animation: apparition 600ms both;
}

.chargement-titre {
  font-family: var(--titre);
  font-weight: 900;
  font-size: clamp(34px, 3.6vw, 52px);
  letter-spacing: .34em;
  padding-left: .34em; /* compense le suivi pour un centrage optique exact */
  background: linear-gradient(180deg, #fceec0, #f4d58d 26%, #c9a227 55%, #8a6d1a 78%, #c9a227);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 0 rgba(95, 13, 16, .55)) drop-shadow(0 10px 26px rgba(0, 0, 0, .8));
}

.chargement-barre {
  width: clamp(260px, 26vw, 380px);
  height: 8px;
  background: rgba(7, 9, 20, .9);
  border: 1px solid var(--bordure-fine);
  border-radius: var(--rayon-fin);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .9), 0 0 12px rgba(201, 162, 39, .12);
  overflow: hidden;
}

.chargement-remplissage {
  height: 100%;
  width: 0;
  background:
    linear-gradient(100deg, transparent 32%, rgba(255, 248, 220, .55) 50%, transparent 68%),
    linear-gradient(90deg, #8a6d1a, #c9a227 55%, #f4d58d);
  background-size: 220% 100%, 100% 100%;
  box-shadow: 0 0 8px rgba(244, 213, 141, .55);
  transition: width 300ms cubic-bezier(.22, .68, .36, 1);
  animation: shimmer 1.7s linear infinite;
}

.chargement-statut {
  font-style: italic;
  font-size: 15px;
  color: var(--ivoire-voile);
  letter-spacing: .06em;
  text-shadow: var(--ombre-texte);
}


/* ══════════════════════════ 09 · ÉCRAN TITRE ═══════════════════════════════ */

#ecran-titre {
  z-index: 30;
  position: absolute;
  inset: 0;
  overflow: hidden;
  animation: apparition 900ms both;
}

/* Ciel : nuit → écarlate profond dans les basses terres */
.titre-fond {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(130% 80% at 50% 118%, rgba(164, 22, 26, .5), rgba(95, 13, 16, .22) 42%, transparent 66%),
    radial-gradient(90% 60% at 50% -12%, rgba(23, 28, 58, .9), transparent 70%),
    linear-gradient(180deg, #05060f 0%, #0b0e1d 38%, #141126 72%, #200f18 100%);
}

/* Voile d'étoiles — constellation posée en ombres multiples */
.titre-fond::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: transparent;
  box-shadow:
    6vw 10vh 0 0 rgba(244, 213, 141, .8),
    13vw 4vh 0 -0.5px rgba(245, 240, 230, .5),
    21vw 16vh 0 0 rgba(123, 241, 224, .55),
    29vw 7vh 0 -0.5px rgba(244, 213, 141, .65),
    36vw 20vh 0 0 rgba(245, 240, 230, .38),
    44vw 5vh 0 0 rgba(244, 213, 141, .7),
    52vw 13vh 0 -0.5px rgba(229, 56, 59, .5),
    60vw 3vh 0 0 rgba(245, 240, 230, .5),
    67vw 15vh 0 0 rgba(244, 213, 141, .72),
    75vw 6vh 0 -0.5px rgba(123, 241, 224, .42),
    83vw 18vh 0 0 rgba(245, 240, 230, .55),
    91vw 9vh 0 0 rgba(244, 213, 141, .62),
    9vw 26vh 0 0 rgba(245, 240, 230, .42),
    33vw 30vh 0 -0.5px rgba(244, 213, 141, .5),
    57vw 28vh 0 0 rgba(123, 241, 224, .35),
    78vw 31vh 0 -0.5px rgba(245, 240, 230, .45),
    16vw 38vh 0 0 rgba(244, 213, 141, .34),
    48vw 41vh 0 -0.5px rgba(229, 56, 59, .32),
    70vw 44vh 0 0 rgba(245, 240, 230, .28),
    89vw 39vh 0 0 rgba(244, 213, 141, .38),
    25vw 47vh 0 -0.5px rgba(245, 240, 230, .22),
    62vw 52vh 0 0 rgba(123, 241, 224, .18);
  animation: scintille 5.5s ease-in-out infinite;
}

/* Deux nappes de brume en rotation lente — le monde respire */
.titre-fond::after {
  content: "";
  position: absolute;
  inset: -28%;
  background:
    radial-gradient(38% 30% at 30% 68%, rgba(164, 22, 26, .13), transparent 70%),
    radial-gradient(34% 26% at 72% 60%, rgba(46, 143, 132, .09), transparent 70%),
    radial-gradient(30% 22% at 50% 82%, rgba(244, 213, 141, .05), transparent 70%);
  filter: blur(52px);
  opacity: .8;
  animation: brume-tourne 150s linear infinite;
}

.titre-contenu {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 1.8vh, 20px);
  padding: var(--esp-6);
}

.titre-surtitre {
  font-family: var(--titre);
  font-size: clamp(13px, 1.05vw, 17px);
  font-weight: 600;
  letter-spacing: .58em;
  padding-left: .58em;
  text-transform: uppercase;
  color: var(--ivoire-voile);
  text-shadow: var(--ombre-texte);
  display: flex;
  align-items: center;
  gap: var(--esp-4);
}

/* Filets latéraux du surtitre */
.titre-surtitre::before,
.titre-surtitre::after {
  content: "";
  display: inline-block;
  width: clamp(36px, 5vw, 88px);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(244, 213, 141, .65));
}

.titre-surtitre::after {
  background: linear-gradient(270deg, transparent, rgba(244, 213, 141, .65));
}

/* Logotype — or métallique, reflet balayant, liseré écarlate en taille */
.titre-logo {
  font-family: var(--titre);
  font-weight: 900;
  font-size: clamp(64px, 9vw, 178px);
  letter-spacing: .12em;
  padding-left: .12em;
  line-height: 1.04;
  background:
    linear-gradient(180deg, #8a6d1a 0%, #fceec0 14%, #f4d58d 30%, #c9a227 46%, #6b5416 52%, #a9852a 58%, #f4d58d 78%, #8a6d1a 100%),
    linear-gradient(105deg, transparent 38%, rgba(255, 250, 232, .85) 50%, transparent 62%);
  background-size: 100% 100%, 260% 100%;
  background-position: 0 0, 240% 0;
  background-repeat: no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter:
    drop-shadow(0 3px 0 rgba(95, 13, 16, .82))
    drop-shadow(0 5px 1px rgba(43, 6, 7, .9))
    drop-shadow(0 22px 44px rgba(0, 0, 0, .85));
  animation: reflet-or 7s cubic-bezier(.45, .2, .35, .8) infinite;
}

.titre-sous {
  font-family: var(--corps);
  font-style: italic;
  font-size: clamp(17px, 1.5vw, 24px);
  letter-spacing: .38em;
  padding-left: .38em;
  color: #eda4a6;
  text-shadow: var(--ombre-texte-forte);
}

/* Menu principal — colonne sacrée, losange d'or au survol */
.menu-principal {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--esp-1);
  margin-top: clamp(16px, 4vh, 44px);
  min-width: clamp(280px, 22vw, 360px);
}

.menu-principal li {
  position: relative;
  font-family: var(--titre);
  font-weight: 600;
  font-size: clamp(16px, 1.25vw, 20px);
  letter-spacing: .22em;
  text-transform: uppercase;
  text-align: center;
  color: var(--ivoire-voile);
  padding: var(--esp-2) var(--esp-6) var(--esp-2) calc(var(--esp-6) + 18px);
  cursor: pointer;
  text-shadow: var(--ombre-texte);
  transition: color 200ms ease, transform 260ms cubic-bezier(.22, .68, .36, 1), letter-spacing 260ms ease;
}

/* Losange-curseur */
.menu-principal li::before {
  content: "◆";
  position: absolute;
  left: calc(var(--esp-6) - 4px);
  top: 50%;
  translate: 0 -50%;
  font-size: 11px;
  color: var(--or-clair);
  opacity: 0;
  transform: translateX(-9px) scale(.6);
  transition: opacity 200ms ease, transform 260ms cubic-bezier(.34, 1.45, .5, 1);
  text-shadow: 0 0 8px rgba(244, 213, 141, .8);
}

/* Soulignement lumineux */
.menu-principal li::after {
  content: "";
  position: absolute;
  left: 22%;
  right: 22%;
  bottom: 2px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--or-clair), transparent);
  box-shadow: 0 0 8px 1px rgba(244, 213, 141, .55);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 300ms cubic-bezier(.22, .68, .36, 1);
}

.menu-principal li:hover,
.menu-principal li.sel,
.menu-principal li:focus-visible {
  color: var(--ivoire);
  transform: translateX(6px);
  letter-spacing: .26em;
}

.menu-principal li:hover::before,
.menu-principal li.sel::before,
.menu-principal li:focus-visible::before {
  opacity: 1;
  transform: translateX(0) scale(1);
}

.menu-principal li:hover::after,
.menu-principal li.sel::after,
.menu-principal li:focus-visible::after {
  transform: scaleX(1);
}

/* Récit d'ouverture — italique discret au bas de la composition */
.titre-lore {
  margin-top: clamp(24px, 6vh, 64px);
  max-width: min(620px, 78vw);
  text-align: center;
  font-style: italic;
  font-size: 16px;
  line-height: 1.75;
  color: rgba(232, 226, 212, .58);
  text-shadow: var(--ombre-texte);
  animation: apparition 1.8s .5s both;
}

.titre-version {
  position: absolute;
  bottom: clamp(12px, 2.4vh, 24px);
  left: 0;
  right: 0;
  text-align: center;
  font-size: 12px;
  letter-spacing: .18em;
  color: rgba(232, 226, 212, .38);
  text-shadow: var(--ombre-texte);
}


/* ═══════════════════════ 10 · HUD EXPLORATION ══════════════════════════════ */

#hud {
  z-index: 10;
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#hud > * {
  pointer-events: auto;
}

/* Bandeau de lieu — haut gauche, filigrane losange */
.hud-lieu {
  position: absolute;
  top: clamp(14px, 2vh, 22px);
  left: clamp(14px, 1.6vw, 26px);
  padding: var(--esp-2) var(--esp-4) var(--esp-2) var(--esp-3);
  border-left: 2px solid var(--or);
  background:
    repeating-linear-gradient(48deg, rgba(244, 213, 141, .04) 0 2px, transparent 2px 7px),
    linear-gradient(90deg, rgba(8, 11, 24, .88), rgba(10, 14, 30, .55));
  border-radius: 0 var(--rayon) var(--rayon) 0;
  box-shadow: 0 4px 18px rgba(2, 3, 8, .55), inset 0 1px 0 rgba(244, 213, 141, .1);
  max-width: min(460px, 40vw);
}

.hud-lieu #hud-lieu-nom {
  display: block;
  font-family: var(--titre);
  font-weight: 700;
  font-size: clamp(16px, 1.3vw, 21px);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--or-clair);
  text-shadow: var(--ombre-texte);
}

.hud-lieu #hud-chapitre {
  display: block;
  font-size: 14px;
  font-style: italic;
  letter-spacing: .06em;
  color: var(--aether);
  opacity: .85;
  text-shadow: var(--ombre-texte);
}

/* Encart du journal — liseré aether, haut droite sous la boussole */
.journal-encart {
  position: absolute;
  top: clamp(96px, 13vh, 128px);
  right: clamp(14px, 1.6vw, 26px);
  width: min(300px, 24vw);
  padding: var(--esp-3) var(--esp-4);
  border-left: 2px solid var(--bordure-aether);
  box-shadow:
    inset 0 0 0 1px rgba(201, 162, 39, .16),
    inset 0 1px 0 rgba(244, 213, 141, .1),
    -2px 0 18px rgba(46, 143, 132, .12),
    0 8px 26px rgba(2, 3, 8, .55);
}

.journal-encart h4 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--aether);
  margin-bottom: var(--esp-1);
}

#journal-objectif {
  font-size: 15px;
  line-height: 1.5;
  color: var(--ivoire-voile);
}

/* Aide contrôles — bas centre, très effacé */
.indice {
  position: absolute;
  bottom: clamp(10px, 1.8vh, 18px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  letter-spacing: .1em;
  color: rgba(232, 226, 212, .5);
  text-shadow: var(--ombre-texte);
  white-space: nowrap;
  transition: opacity 600ms ease;
}

/* Pastille d'interaction « E — Parler » */
.indicateur-interaction {
  position: absolute;
  bottom: clamp(150px, 24vh, 240px);
  left: 50%;
  transform: translateX(-50%);
  padding: var(--esp-1) var(--esp-4);
  font-family: var(--titre);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--or-clair);
  background: linear-gradient(180deg, rgba(18, 23, 48, .92), rgba(8, 11, 24, .92));
  border: 1px solid var(--bordure);
  border-radius: var(--rayon-large);
  box-shadow: 0 0 0 1px rgba(4, 5, 12, .8);
  animation: pulse 2.2s ease-in-out infinite;
  text-shadow: var(--ombre-texte);
}

/* Boussole gravée — haut droite */
.boussole {
  position: absolute;
  top: clamp(14px, 2vh, 22px);
  right: clamp(14px, 1.6vw, 26px);
  width: clamp(58px, 4.6vw, 72px);
  height: clamp(58px, 4.6vw, 72px);
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 32%, rgba(46, 58, 110, .4), transparent 62%),
    radial-gradient(circle, rgba(8, 11, 24, .92) 58%, rgba(16, 20, 43, .94) 72%);
  border: 1px solid var(--bordure);
  box-shadow:
    inset 0 0 0 3px rgba(6, 8, 18, .9),
    inset 0 0 0 4px rgba(201, 162, 39, .24),
    inset 0 2px 12px rgba(0, 0, 0, .85),
    0 6px 20px rgba(2, 3, 8, .55);
}

/* Rosace graduée gravée */
.boussole::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: repeating-conic-gradient(rgba(244, 213, 141, .34) 0deg .8deg, transparent .8deg 30deg);
  opacity: .38;
}

.boussole-aiguille {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2px;
  height: 62%;
  margin: -31% 0 0 -1px;
  transform-origin: 50% 50%;
  /* La rotation est pilotée en style inline par le moteur (cap du joueur) */
}

/* Pointe écarlate (nord) et contrepoids doré */
.boussole-aiguille::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 15px solid var(--ecarlate-vif);
  filter: drop-shadow(0 0 3px rgba(229, 56, 59, .7));
}

.boussole-aiguille::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-top: 11px solid var(--or);
  opacity: .8;
}

.boussole-nord {
  position: absolute;
  top: 3px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--titre);
  font-size: 9px;
  font-weight: 700;
  color: var(--or-clair);
  text-shadow: 0 1px 2px #000;
}


/* ═════════════════ 11 · CARTES PERSONNAGE & JAUGES (partagées) ═════════════ */

.hud-gauche {
  position: absolute;
  top: clamp(74px, 10.5vh, 100px);
  left: clamp(14px, 1.6vw, 26px);
  display: flex;
  flex-direction: column;
  gap: var(--esp-2);
}

/* Colonne des cartes en combat : même ancrage */
#combat-groupe {
  top: clamp(64px, 9vh, 88px);
}

.carte-perso {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--esp-3);
  width: clamp(264px, 21vw, 312px);
  padding: var(--esp-2) var(--esp-3);
  background:
    repeating-linear-gradient(48deg, rgba(244, 213, 141, .012) 0 1px, transparent 1px 3px),
    linear-gradient(150deg, rgba(20, 25, 52, .62), rgba(8, 11, 24, .78));
  border: 1px solid var(--or);
  border-radius: var(--rayon);
  box-shadow:
    inset 0 0 0 1px rgba(201, 162, 39, .14),
    inset 0 1px 0 rgba(244, 213, 141, .08),
    0 6px 20px rgba(2, 3, 8, .55);
  transition: transform var(--trans-douce), box-shadow var(--trans-douce), filter 400ms ease;
  animation: apparition 500ms both;
}

.carte-perso:nth-child(2) { animation-delay: 60ms; }
.carte-perso:nth-child(3) { animation-delay: 120ms; }
.carte-perso:nth-child(4) { animation-delay: 180ms; }

/* Portée au clavier / tour actif */
.carte-perso.actif,
.carte-perso.sel {
  transform: translateX(8px);
  border-color: var(--or-clair);
  box-shadow:
    inset 0 0 0 1px rgba(244, 213, 141, .3),
    0 0 16px rgba(201, 162, 39, .28),
    0 6px 20px rgba(2, 3, 8, .55);
}

.carte-perso.mort,
.carte-perso.ko {
  filter: grayscale(.92) brightness(.55);
  border-color: rgba(140, 140, 150, .3);
}

/* Écusson octogonal — initiales en Cinzel sur dégradé de rôle */
.carte-perso .ecusson {
  flex: 0 0 auto;
  width: clamp(44px, 3.4vw, 52px);
  height: clamp(44px, 3.4vw, 52px);
  display: grid;
  place-items: center;
  clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, .16), transparent 42%),
    linear-gradient(200deg, #2a2416, #12152b 68%);
  box-shadow: inset 0 0 0 1px rgba(244, 213, 141, .3);
}

.carte-perso .initiales {
  font-family: var(--titre);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: .04em;
  color: var(--or-clair);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .9);
}

/* Teintures d'écusson par personnage */
.carte-perso[data-id="kael"] .ecusson {
  background: linear-gradient(160deg, rgba(255, 246, 214, .28), transparent 45%), linear-gradient(200deg, #4a3d14, #14183a 70%);
}
.carte-perso[data-id="seraphine"] .ecusson {
  background: linear-gradient(160deg, rgba(255, 190, 160, .22), transparent 45%), linear-gradient(200deg, #5c1418, #1b1030 70%);
}
.carte-perso[data-id="nyx"] .ecusson {
  background: linear-gradient(160deg, rgba(190, 160, 255, .2), transparent 45%), linear-gradient(200deg, #2c1650, #101226 70%);
}
.carte-perso[data-id="ysolde"] .ecusson {
  background: linear-gradient(160deg, rgba(160, 255, 236, .18), transparent 45%), linear-gradient(200deg, #103b38, #10203c 70%);
}
.carte-perso[data-id="aldric"] .ecusson {
  background: linear-gradient(160deg, rgba(255, 220, 170, .18), transparent 45%), linear-gradient(200deg, #4d3410, #16182e 70%);
}
.carte-perso[data-id="kairo"] .ecusson {
  background: linear-gradient(160deg, rgba(170, 220, 255, .2), transparent 45%), linear-gradient(200deg, #14324d, #101233 70%);
}

.carte-perso .infos {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.carte-perso .nom {
  font-family: var(--titre);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ivoire);
  text-shadow: var(--ombre-texte);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Barres : le remplissage est l'enfant direct (transition width 400 ms) ── */
.barre-pv,
.barre-pm,
.barre-atb,
.jauge-limite {
  position: relative;
  height: 6px;
  background: rgba(5, 7, 14, .92);
  border-radius: var(--rayon-fin);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .7), inset 0 1px 2px rgba(0, 0, 0, .95);
  overflow: hidden;
}

.barre-pm { height: 4px; }
.barre-atb { height: 5px; }

.barre-pv > *,
.barre-pm > *,
.barre-atb > * {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: inherit;
  transition: width 400ms cubic-bezier(.22, .68, .36, 1);
}

/* PV — écarlate profond vers or ; liseré lumineux au flanc */
.barre-pv > * {
  background: linear-gradient(90deg, #6d0f12, #a4161a 34%, #e5383b 68%, #f4d58d 135%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .28),
    inset 0 -1px 0 rgba(0, 0, 0, .45),
    0 0 6px rgba(229, 56, 59, .45);
}

.barre-pv.critique > * {
  animation: pointe-lumineuse 1.1s ease-in-out infinite;
}

/* PM — bleu-aether */
.barre-pm > * {
  background: linear-gradient(90deg, #14454e, #2e8f84 45%, #7bf1e0 130%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .24),
    0 0 6px rgba(123, 241, 224, .4);
}

/* ATB — or ; scintille quand la jauge est pleine (classe .pleine) */
.barre-atb > * {
  background: linear-gradient(90deg, #8a6d1a, #c9a227 55%, #f4d58d);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .3),
    0 0 6px rgba(201, 162, 39, .45);
}

.barre-atb.pleine > * {
  background:
    linear-gradient(100deg, transparent 30%, rgba(255, 250, 224, .75) 50%, transparent 70%),
    linear-gradient(90deg, #8a6d1a, #c9a227 55%, #f4d58d);
  background-size: 220% 100%, 100% 100%;
  animation: shimmer 1.5s linear infinite;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .35),
    0 0 12px rgba(244, 213, 141, .7);
}

/* Jauge de Limite — filet doré, spirale quand pleine */
.jauge-limite {
  height: 3px;
  margin-top: 1px;
}

.jauge-limite > * {
  background: linear-gradient(90deg, #6b5416, #f4d58d);
  box-shadow: 0 0 5px rgba(244, 213, 141, .5);
}

.jauge-limite.pleine::after {
  content: "";
  position: absolute;
  right: -14px;
  top: 50%;
  width: 9px;
  height: 9px;
  margin-top: -4.5px;
  border-radius: 50%;
  background: conic-gradient(#f4d58d, transparent 32%, #c9a227 58%, transparent 84%, #f4d58d);
  animation: spirale 1.15s linear infinite;
  filter: drop-shadow(0 0 4px rgba(244, 213, 141, .85));
}

/* Badges de statut — pastilles à icône pulsante */
.badge-statut {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  font-size: 11px;
  line-height: 1;
  color: var(--ivoire);
  background: rgba(20, 14, 34, .92);
  border: 1px solid rgba(201, 162, 39, .4);
  border-radius: var(--rayon-fin);
  text-shadow: 0 1px 1px #000;
  animation: pulse 1.8s ease-in-out infinite;
}

.carte-perso .badges {
  position: absolute;
  right: 6px;
  bottom: 5px;
  display: flex;
  gap: var(--esp-1);
}


/* ═══════════════════════ 12 · BOÎTE DE DIALOGUE ════════════════════════════ */

#boite-dialogue {
  z-index: 20;
  position: absolute;
  left: 50%;
  bottom: clamp(14px, 3.4vh, 36px);
  transform: translateX(-50%);
  width: min(1120px, 94vw);
  min-height: clamp(168px, 24vh, 216px);
  align-items: stretch;
  gap: var(--esp-4);
  padding: var(--esp-4) clamp(var(--esp-4), 2vw, var(--esp-6));
  background:
    repeating-linear-gradient(48deg, rgba(244, 213, 141, .016) 0 1px, transparent 1px 3px),
    linear-gradient(165deg, rgba(22, 27, 56, .6), rgba(6, 8, 18, .66) 55%),
    var(--panneau);
  backdrop-filter: blur(12px) saturate(1.12);
  -webkit-backdrop-filter: blur(12px) saturate(1.12);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  /* Double liseré d'or */
  box-shadow:
    inset 0 0 0 1px rgba(201, 162, 39, .18),
    inset 0 1px 0 rgba(244, 213, 141, .12),
    0 -2px 0 rgba(95, 13, 16, .55),
    0 14px 44px rgba(2, 3, 8, .72);
  animation: apparition 320ms both;
}

/* Pointes d'or aux quatre angles de la boîte */
#boite-dialogue::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    conic-gradient(from 180deg at 0 0, rgba(244, 213, 141, .7) 90deg, transparent 90deg) top left / var(--coin) var(--coin),
    conic-gradient(from 90deg at 100% 0, rgba(244, 213, 141, .7) 90deg, transparent 90deg) top right / var(--coin) var(--coin),
    conic-gradient(from 270deg at 100% 100%, rgba(244, 213, 141, .7) 90deg, transparent 90deg) bottom right / var(--coin) var(--coin),
    conic-gradient(from 0deg at 0 100%, rgba(244, 213, 141, .7) 90deg, transparent 90deg) bottom left / var(--coin) var(--coin);
  background-repeat: no-repeat;
}

/* Portrait octogonal à cadre ciselé */
.portrait-cadre {
  position: relative;
  flex: 0 0 auto;
  align-self: flex-end;
  width: clamp(128px, 10vw, 156px);
  height: clamp(128px, 10vw, 156px);
  padding: 5px;
  clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%);
  background:
    linear-gradient(135deg, #f4d58d, #8a6d1a 26%, #c9a227 52%, #5c4a12 78%, #f4d58d);
  filter: drop-shadow(0 6px 16px rgba(2, 3, 8, .6));
  margin-top: clamp(8px, 2vh, 20px);
}

.portrait-canvas {
  width: 100%;
  height: 100%;
  clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%);
  background: radial-gradient(circle at 42% 34%, rgba(46, 58, 110, .55), rgba(8, 11, 24, .95) 78%);
}

.dialogue-corps {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding-bottom: var(--esp-2);
}

/* Plaque du locuteur */
.nom-locuteur {
  align-self: flex-start;
  margin-top: calc(-1 * var(--esp-4) - 10px);
  margin-bottom: var(--esp-2);
  padding: var(--esp-1) var(--esp-4);
  font-family: var(--titre);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--or-clair);
  background: linear-gradient(180deg, rgba(95, 13, 16, .88), rgba(24, 8, 12, .92));
  border: 1px solid var(--bordure);
  border-radius: var(--rayon-fin);
  box-shadow: inset 0 1px 0 rgba(244, 213, 141, .22), 0 4px 14px rgba(2, 3, 8, .6);
  text-shadow: 0 1px 2px #000;
}

.texte-dialogue {
  flex: 1 1 auto;
  font-size: 19px;
  line-height: 1.72;
  color: var(--ivoire);
  text-shadow: 0 1px 2px rgba(4, 5, 12, .92), 0 2px 12px rgba(4, 5, 12, .7);
  min-height: 3.4em;
}

/* Liste de choix — colonne à losanges */
.choix-dialogue {
  display: flex;
  flex-direction: column;
  gap: var(--esp-1);
  margin-top: var(--esp-2);
}

.choix-dialogue li {
  position: relative;
  padding: var(--esp-1) var(--esp-4) var(--esp-1) var(--esp-6);
  font-size: 17px;
  color: var(--ivoire-voile);
  cursor: pointer;
  border-left: 1px solid transparent;
  transition: color 180ms ease, padding-left 220ms ease, background 220ms ease;
  text-shadow: var(--ombre-texte);
}

.choix-dialogue li::before {
  content: "◆";
  position: absolute;
  left: 10px;
  top: 50%;
  translate: 0 -50%;
  font-size: 9px;
  color: var(--or);
  opacity: .45;
  transition: opacity 200ms ease, color 200ms ease, text-shadow 200ms ease;
}

.choix-dialogue li:hover,
.choix-dialogue li.sel,
.choix-dialogue li:focus-visible {
  color: var(--ivoire);
  padding-left: calc(var(--esp-6) + 6px);
  background: linear-gradient(90deg, rgba(201, 162, 39, .12), transparent 72%);
  border-left-color: var(--or-clair);
}

.choix-dialogue li:hover::before,
.choix-dialogue li.sel::before,
.choix-dialogue li:focus-visible::before {
  opacity: 1;
  color: var(--or-clair);
  text-shadow: 0 0 8px rgba(244, 213, 141, .9);
}

/* Choix d'affinité — lueur rose et or, souffle romantique */
.choix-dialogue li.affinite,
.choix-dialogue li [data-affinite],
.choix-dialogue li[data-affinite] {
  font-style: italic;
}

.choix-dialogue li.affinite::after,
.choix-dialogue li[data-affinite]::after {
  content: "❧";
  position: absolute;
  right: 12px;
  top: 50%;
  translate: 0 -50%;
  font-size: 13px;
  color: var(--rose-affinite);
  opacity: .75;
  text-shadow: 0 0 8px rgba(232, 167, 192, .65);
}

.choix-dialogue li.affinite:hover,
.choix-dialogue li[data-affinite]:hover,
.choix-dialogue li.affinite.sel,
.choix-dialogue li[data-affinite].sel {
  background: linear-gradient(90deg, rgba(232, 167, 192, .12), rgba(201, 162, 39, .07) 60%, transparent);
  border-left-color: var(--rose-affinite);
  box-shadow: inset 0 0 18px rgba(232, 167, 192, .08);
}

/* Indicateur « continuer », clignotement feutré */
.indicateur-suite {
  align-self: flex-end;
  margin-top: var(--esp-1);
  font-family: var(--titre);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .22em;
  color: var(--or);
  text-shadow: var(--ombre-texte);
  animation: clignote-discret 1.9s ease-in-out infinite;
}


/* ═══════════════════ 13 · HUD COMBAT — STRUCTURE ═══════════════════════════ */

#hud-combat {
  z-index: 15;
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#hud-combat > * {
  pointer-events: auto;
}

#combat-groupe {
  position: absolute;
  z-index: 2;
}


/* ═══════════════════════════ 14 · VISÉE ════════════════════════════════════ */

#visee {
  position: absolute;
  top: clamp(16px, 3vh, 30px);
  right: clamp(16px, 2vw, 34px);
  z-index: 3;
  flex-direction: column;
  gap: var(--esp-2);
  width: clamp(264px, 21vw, 320px);
  padding: var(--esp-3) var(--esp-4);
  animation: apparition 300ms both;
}

.visee-nom {
  font-family: var(--titre);
  font-weight: 700;
  font-size: clamp(15px, 1.2vw, 19px);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ecarlate-vif);
  text-shadow: var(--ombre-texte-forte);
}

/* Pastilles de faiblesses élémentaires */
.visee-faiblesses {
  display: flex;
  flex-wrap: wrap;
  gap: var(--esp-1);
}

.visee-faiblesses > * {
  padding: 2px var(--esp-2);
  font-family: var(--titre);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ivoire);
  background: rgba(20, 14, 34, .85);
  border: 1px solid rgba(244, 213, 141, .4);
  border-radius: var(--rayon-fin);
  text-shadow: 0 1px 1px #000;
}

.visee-faiblesses > [data-element="feu"],
.visee-faiblesses > [data-el="feu"] {
  border-color: #ff5a2a;
  box-shadow: 0 0 8px rgba(255, 90, 42, .35);
}
.visee-faiblesses > [data-element="glace"],
.visee-faiblesses > [data-el="glace"] {
  border-color: #9ad7f5;
  box-shadow: 0 0 8px rgba(154, 215, 245, .35);
}
.visee-faiblesses > [data-element="foudre"],
.visee-faiblesses > [data-el="foudre"] {
  border-color: #f0e05a;
  box-shadow: 0 0 8px rgba(240, 224, 90, .35);
}
.visee-faiblesses > [data-element="vent"],
.visee-faiblesses > [data-el="vent"] {
  border-color: #a9f5b8;
  box-shadow: 0 0 8px rgba(169, 245, 184, .3);
}
.visee-faiblesses > [data-element="terre"],
.visee-faiblesses > [data-el="terre"] {
  border-color: #c98f5a;
  box-shadow: 0 0 8px rgba(201, 143, 90, .3);
}
.visee-faiblesses > [data-element="eau"],
.visee-faiblesses > [data-el="eau"] {
  border-color: #6ab8f5;
  box-shadow: 0 0 8px rgba(106, 184, 245, .3);
}
.visee-faiblesses > [data-element="lumiere"],
.visee-faiblesses > [data-el="lumiere"] {
  border-color: #f4d58d;
  box-shadow: 0 0 8px rgba(244, 213, 141, .4);
}
.visee-faiblesses > [data-element="ombre"],
.visee-faiblesses > [data-el="ombre"] {
  border-color: #a98af5;
  box-shadow: 0 0 8px rgba(169, 138, 245, .35);
}
.visee-faiblesses > [data-element="ether"],
.visee-faiblesses > [data-el="ether"] {
  border-color: #7bf1e0;
  box-shadow: 0 0 8px rgba(123, 241, 224, .4);
}

.visee-pv {
  position: relative;
  height: 7px;
  background: rgba(5, 7, 14, .92);
  border-radius: var(--rayon-fin);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .7);
  overflow: hidden;
}

.visee-pv-remplissage {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #6d0f12, #a4161a 40%, #e5383b 80%, #f4d58d);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 0 7px rgba(229, 56, 59, .5);
  transition: width 400ms cubic-bezier(.22, .68, .36, 1);
}

/* Brisure — jauge violette segmentée en trois */
.visee-brisure {
  position: relative;
  height: 5px;
  background: rgba(20, 12, 34, .92);
  border-radius: var(--rayon-fin);
  box-shadow: inset 0 0 0 1px rgba(141, 91, 211, .28);
  overflow: hidden;
}

.visee-brisure::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 calc(33.33% - 2px), rgba(5, 7, 14, .95) calc(33.33% - 2px) 33.33%);
  pointer-events: none;
  z-index: 2;
}

.visee-brisure-remplissage {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #4b2a85, #8d5bd3 70%, #c3a5f5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 0 7px rgba(141, 91, 211, .55);
  transition: width 320ms cubic-bezier(.22, .68, .36, 1);
}


/* ═══════════════════════ 15 · MENU DE COMMANDES ════════════════════════════ */

#menu-commandes {
  position: absolute;
  left: 50%;
  bottom: clamp(14px, 3vh, 30px);
  transform: translateX(-50%);
  z-index: 4;
  flex-direction: column;
  align-items: center;
  gap: var(--esp-2);
  animation: floatIn-menu 320ms both;
}

@keyframes floatIn-menu {
  0%   { opacity: 0; transform: translate(-50%, 16px); }
  100% { opacity: 1; transform: translate(-50%, 0); }
}

.commande-actif {
  min-height: 24px;
  font-family: var(--titre);
  font-size: clamp(14px, 1.1vw, 18px);
  font-weight: 700;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--or-clair);
  text-shadow: var(--ombre-texte-forte);
  animation: apparition 260ms both;
}

.cmds {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: var(--esp-2);
}

/* Anneau : léger arc des plaques vers le haut aux extrémités */
.cmd {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: clamp(88px, 7vw, 108px);
  height: clamp(62px, 5.2vw, 78px);
  font-family: var(--titre);
  font-size: clamp(11px, .85vw, 13px);
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ivoire-voile);
  cursor: pointer;
  background:
    linear-gradient(180deg, rgba(42, 36, 22, .88), rgba(18, 21, 40, .92) 58%, rgba(10, 13, 26, .94));
  border: 1px solid rgba(201, 162, 39, .38);
  border-radius: var(--rayon);
  box-shadow:
    inset 0 1px 0 rgba(244, 213, 141, .18),
    inset 0 -6px 12px rgba(0, 0, 0, .5),
    0 6px 18px rgba(2, 3, 8, .55);
  text-shadow: 0 1px 2px #000;
  transition:
    color 180ms ease,
    border-color 180ms ease,
    box-shadow 220ms ease,
    transform 240ms cubic-bezier(.34, 1.4, .5, 1),
    filter 220ms ease;
}

/* Courbure d'anneau — chaque plaque s'élève vers le centre */
.cmds .cmd:nth-child(1) { transform: translateY(10px) rotate(-4deg); }
.cmds .cmd:nth-child(2) { transform: translateY(3px) rotate(-2.5deg); }
.cmds .cmd:nth-child(3) { transform: translateY(0) rotate(-1deg); }
.cmds .cmd:nth-child(4) { transform: translateY(-2px); }
.cmds .cmd:nth-child(5) { transform: translateY(0) rotate(1deg); }
.cmds .cmd:nth-child(6) { transform: translateY(3px) rotate(2.5deg); }
.cmds .cmd:nth-child(7) { transform: translateY(10px) rotate(4deg); }

.cmd-icone {
  font-style: normal;
  font-size: clamp(19px, 1.6vw, 24px);
  line-height: 1;
  color: var(--or-clair);
  text-shadow: 0 2px 4px rgba(0, 0, 0, .8);
  transition: transform 240ms cubic-bezier(.34, 1.5, .5, 1), text-shadow 220ms ease;
}

/* Survol exalté — la plaque s'illumine, l'icône s'exhausse */
.cmd:hover,
.cmd.sel,
.cmd:focus-visible {
  color: var(--ivoire);
  border-color: var(--or-clair);
  box-shadow:
    inset 0 1px 0 rgba(244, 213, 141, .35),
    inset 0 -6px 14px rgba(0, 0, 0, .4),
    0 0 18px rgba(201, 162, 39, .38),
    0 8px 22px rgba(2, 3, 8, .6);
  filter: brightness(1.18);
}

.cmd:hover,
.cmd.sel,
.cmd:focus-visible,
.cmds .cmd:nth-child(1):hover,
.cmds .cmd:nth-child(2):hover,
.cmds .cmd:nth-child(3):hover,
.cmds .cmd:nth-child(5):hover,
.cmds .cmd:nth-child(6):hover,
.cmds .cmd:nth-child(7):hover {
  transform: translateY(-6px) scale(1.05);
}

.cmd:hover .cmd-icone,
.cmd.sel .cmd-icone,
.cmd:focus-visible .cmd-icone {
  transform: translateY(-2px) scale(1.14);
  text-shadow: 0 0 12px rgba(244, 213, 141, .9);
}

/* Commande indisponible — atténuée,_inactive */
.cmd.desactive,
.cmd[disabled],
.cmd[aria-disabled="true"] {
  opacity: .38;
  filter: grayscale(.7);
  pointer-events: none;
}

/* Limte prête — l'étoile s'embrase (classe .pret posée par le moteur) */
.cmd[data-cmd="limite"].pret,
.cmd[data-cmd="limite"].prete {
  border-color: var(--or-clair);
  box-shadow:
    inset 0 1px 0 rgba(244, 213, 141, .4),
    0 0 20px rgba(244, 213, 141, .45),
    0 8px 22px rgba(2, 3, 8, .6);
  animation: pulse 2s ease-in-out infinite;
}

.cmd[data-cmd="limite"].pret .cmd-icone,
.cmd[data-cmd="limite"].prete .cmd-icone {
  color: #ffe9a8;
  text-shadow: 0 0 14px rgba(255, 233, 168, .95);
}


/* ═══════════════════════ 16 · SOUS-MENU (sorts) ════════════════════════════ */

/*
 * Chaque ligne est un enfant direct de #sous-menu :
 * .sort-nom (nom), .sort-cout (coût PM, aligné à droite), .sort-desc (petite
 * description). Les lignes alternent ; le coût s'aligne automatiquement à droite.
 */
#sous-menu {
  position: absolute;
  left: 50%;
  bottom: clamp(120px, 21vh, 190px);
  transform: translateX(-50%);
  z-index: 5;
  flex-direction: column;
  width: min(620px, 60vw);
  max-height: min(430px, 52vh);
  overflow-y: auto;
  padding: var(--esp-2);
  gap: 2px;
  animation: apparition 260ms both;
}

#sous-menu > * {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--esp-1) var(--esp-3);
  padding: var(--esp-2) var(--esp-3);
  border-radius: var(--rayon-fin);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease;
}

/* Zébrage feutré */
#sous-menu > *:nth-child(even) {
  background: rgba(244, 213, 141, .045);
}

#sous-menu > *:hover,
#sous-menu > *.sel,
#sous-menu > *:focus-visible {
  background: linear-gradient(90deg, rgba(201, 162, 39, .16), rgba(201, 162, 39, .04) 70%);
  border-color: rgba(244, 213, 141, .35);
  box-shadow: inset 0 0 14px rgba(201, 162, 39, .08);
}

#sous-menu .sort-nom,
#sous-menu .nom {
  font-family: var(--titre);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--ivoire);
  text-shadow: var(--ombre-texte);
}

#sous-menu .sort-cout,
#sous-menu .cout {
  margin-left: auto;
  font-family: var(--titre);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--aether);
  text-shadow: 0 1px 2px #000;
  white-space: nowrap;
}

#sous-menu .sort-desc,
#sous-menu .desc {
  flex-basis: 100%;
  font-style: italic;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ivoire-voile);
}

#sous-menu .indisponible,
#sous-menu > *.desactive {
  opacity: .4;
  pointer-events: none;
  filter: grayscale(.5);
}


/* ═══════════════════════ 17 · ORDRE DU TOUR ════════════════════════════════ */

#ordre-tour {
  position: absolute;
  right: clamp(14px, 1.8vw, 30px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--esp-2);
  padding: var(--esp-3) var(--esp-2);
  background: linear-gradient(180deg, rgba(8, 11, 24, .72), rgba(8, 11, 24, .38));
  border: 1px solid var(--bordure-fine);
  border-radius: var(--rayon);
  box-shadow: 0 8px 26px rgba(2, 3, 8, .5);
}

/* Frise des portraits à venir */
#ordre-tour > * {
  position: relative;
  width: clamp(40px, 3.2vw, 50px);
  height: clamp(40px, 3.2vw, 50px);
  display: grid;
  place-items: center;
  clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%);
  background: linear-gradient(160deg, rgba(255, 255, 255, .12), transparent 46%), linear-gradient(200deg, #2a2416, #12152b 70%);
  box-shadow: inset 0 0 0 1px rgba(244, 213, 141, .32);
  font-family: var(--titre);
  font-weight: 700;
  font-size: 13px;
  color: var(--or-clair);
  text-shadow: 0 1px 2px #000;
  animation: apparition 320ms both;
}

#ordre-tour > *:nth-child(2) { animation-delay: 70ms; }
#ordre-tour > *:nth-child(3) { animation-delay: 140ms; }
#ordre-tour > *:nth-child(4) { animation-delay: 210ms; }
#ordre-tour > *:nth-child(5) { animation-delay: 280ms; }

/* Celui qui agit maintenant */
#ordre-tour > *:first-child {
  box-shadow: inset 0 0 0 1px rgba(244, 213, 141, .75), 0 0 14px rgba(201, 162, 39, .5);
  animation: apparition 320ms both, pulse 2.4s 400ms ease-in-out infinite;
}

/* Ennemis dans la frise */
#ordre-tour > .ennemi,
#ordre-tour > [data-camp="ennemi"] {
  background: linear-gradient(160deg, rgba(255, 120, 120, .1), transparent 46%), linear-gradient(200deg, #3d1013, #170f1e 70%);
  color: #f3b0b2;
  box-shadow: inset 0 0 0 1px rgba(229, 56, 59, .45);
}


/* ═══════════════════════ 18 · ANNONCE DE COMBAT ════════════════════════════ */

#annonce-combat {
  z-index: 25;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  font-family: var(--titre);
  font-weight: 900;
  font-size: clamp(48px, 6.5vw, 118px);
  letter-spacing: .3em;
  padding-left: .3em;
  text-align: center;
  text-transform: uppercase;
  color: transparent;
  background: linear-gradient(180deg, #fceec0, #f4d58d 30%, #c9a227 55%, #8a6d1a);
  -webkit-background-clip: text;
  background-clip: text;
  filter:
    drop-shadow(0 3px 0 rgba(95, 13, 16, .9))
    drop-shadow(0 18px 40px rgba(0, 0, 0, .9));
  animation: annonce-combat 1.6s cubic-bezier(.16, .8, .32, 1) both;
}

/* Raies d'aube derrière l'annonce */
#annonce-combat::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 140vw;
  height: 2px;
  transform: translate(-50%, -50%);
  background: linear-gradient(90deg, transparent, rgba(229, 56, 59, .0) 30%, rgba(229, 56, 59, .55) 50%, rgba(229, 56, 59, 0) 70%, transparent);
  animation: etend-lisere 1.6s cubic-bezier(.16, .8, .32, 1) both;
}


/* ═══════════════ 19 · CURSEURS & FLÈCHES DE VISÉE (au-dessus des cibles) ════ */

/*
 * .curseur-visee : losange d'or flottant — positionné par le moteur en
 * left/top inline. Ne pas utiliser transform pour le placement.
 */
.curseur-visee {
  position: absolute;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  pointer-events: none;
  z-index: 8;
}

.curseur-visee::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 2px solid var(--or-clair);
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(244, 213, 141, .75), inset 0 0 6px rgba(244, 213, 141, .3);
  animation: curseur_visee 1.15s ease-in-out infinite;
}

.curseur-visee::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 5px;
  margin: -2.5px 0 0 -2.5px;
  transform: rotate(45deg);
  background: var(--ecarlate-vif);
  box-shadow: 0 0 8px rgba(229, 56, 59, .9);
}

/* Variante ennemie — écarlate */
.curseur-visee.ennemi::before {
  border-color: var(--ecarlate-vif);
  box-shadow: 0 0 10px rgba(229, 56, 59, .8), inset 0 0 6px rgba(229, 56, 59, .3);
}

/* Flèche indicatrice au-dessus de la cible */
.fleche-visee {
  position: absolute;
  width: 0;
  height: 0;
  margin-left: -8px;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 11px solid var(--or-clair);
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .8)) drop-shadow(0 0 6px rgba(244, 213, 141, .6));
  animation: fleche-flotte 1.1s ease-in-out infinite;
  pointer-events: none;
  z-index: 8;
}


/* ═══════════════════════ 20 · CHIFFRES DE DÉGÂTS ═══════════════════════════ */

#num-degats-container {
  position: absolute;
  inset: 0;
  z-index: 55;
  pointer-events: none;
  overflow: hidden;
}

.num-degats {
  position: absolute;
  font-family: var(--titre);
  font-weight: 900;
  font-size: clamp(26px, 2vw, 38px);
  line-height: 1;
  color: var(--ivoire);
  text-shadow:
    0 2px 0 rgba(4, 5, 12, .88),
    0 0 14px rgba(4, 5, 12, .65);
  animation: degats-montee 900ms cubic-bezier(.2, .8, .3, 1) both;
  will-change: transform, opacity;
}

/* Soins — vert-aether */
.num-degats.soin,
.num-degats.soins,
.num-degats.heal {
  color: var(--vert-soin);
  text-shadow:
    0 2px 0 rgba(4, 5, 12, .88),
    0 0 14px rgba(93, 224, 158, .55);
}

/* Critiques — écarlate, 1,6×, tremblement */
.num-degats.crit,
.num-degats.critique {
  font-size: calc(clamp(26px, 2vw, 38px) * 1.6);
  color: var(--ecarlate-vif);
  text-shadow:
    0 3px 0 rgba(43, 6, 7, .92),
    0 0 20px rgba(229, 56, 59, .7),
    0 0 4px rgba(255, 220, 200, .5);
  animation: degats-critique 900ms cubic-bezier(.2, .8, .3, 1) both;
}

/* Frappe de faiblesse — éclat doré diffus derrière le chiffre */
.num-degats.faiblesse,
.num-degats.faible {
  color: var(--or-clair);
  text-shadow:
    0 2px 0 rgba(4, 5, 12, .88),
    0 0 16px rgba(244, 213, 141, .75);
}

.num-degats.faiblesse::before,
.num-degats.faible::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 55%;
  width: 130%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 244, 200, .55) 0%, rgba(244, 213, 141, .22) 42%, transparent 68%);
  animation: eclat-faiblesse 900ms cubic-bezier(.2, .8, .3, 1) both;
  z-index: -1;
}


/* ═══════════ 21 · CINÉMATIQUE — LETTERBOX, LIEU, CHAPITRE, FONDU ═══════════ */

/* Bandes noires — coulisses 700 ms */
.lettre-cine {
  position: absolute;
  left: 0;
  right: 0;
  height: clamp(46px, 8.5vh, 100px);
  background: #030409;
  z-index: 40;
  transition: transform 700ms cubic-bezier(.3, .75, .3, 1);
}

.lettre-haut {
  top: 0;
  transform: translateY(-101%);
  box-shadow: inset 0 -1px 0 rgba(201, 162, 39, .22), 0 4px 18px rgba(0, 0, 0, .55);
}

.lettre-bas {
  bottom: 0;
  transform: translateY(101%);
  box-shadow: inset 0 1px 0 rgba(201, 162, 39, .22), 0 -4px 18px rgba(0, 0, 0, .55);
}

/* Ouverture (le moteur pose .visible, .ouverte ou .active) */
.lettre-cine.visible,
.lettre-cine.ouverte,
.lettre-cine.active {
  transform: translateY(0);
}

/* Carte de lieu cinématique — centrée, tracking qui se resserre */
#carte-lieu {
  z-index: 45;
  position: absolute;
  inset: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--esp-3);
  pointer-events: none;
  padding: var(--esp-6);
  text-align: center;
}

#carte-lieu-titre {
  font-family: var(--titre);
  font-weight: 700;
  font-size: clamp(34px, 3.6vw, 60px);
  letter-spacing: .18em;
  padding-left: .18em;
  text-transform: uppercase;
  color: var(--or-clair);
  text-shadow: var(--ombre-texte-forte);
  animation: resserrement 2.2s cubic-bezier(.2, .7, .3, 1) both;
}

#carte-lieu-sous {
  font-style: italic;
  font-size: clamp(16px, 1.35vw, 22px);
  letter-spacing: .12em;
  color: var(--ivoire-voile);
  text-shadow: var(--ombre-texte);
  animation: apparition 1.4s .5s both;
}

/* Liseré d'or horizontal qui s'étend sous le titre */
#carte-lieu::after {
  content: "";
  width: min(560px, 52vw);
  height: 1px;
  margin-top: var(--esp-1);
  background: linear-gradient(90deg, transparent, var(--or-clair) 22%, #fff6d8 50%, var(--or-clair) 78%, transparent);
  box-shadow: 0 0 12px 1px rgba(244, 213, 141, .5);
  transform-origin: center;
  animation: etend-lisere 1.6s .35s cubic-bezier(.2, .7, .3, 1) both;
}

/* Annonce de chapitre — pleine page, citation en italique */
#annonce-chapitre {
  z-index: 50;
  position: absolute;
  inset: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--esp-4);
  padding: var(--esp-6);
  text-align: center;
  background: radial-gradient(90% 70% at 50% 50%, rgba(4, 6, 13, .78), rgba(3, 4, 10, .94));
}

#annonce-chapitre-titre {
  position: relative;
  display: inline-block;
  font-family: var(--titre);
  font-weight: 700;
  font-size: clamp(28px, 3vw, 48px);
  letter-spacing: .3em;
  padding: 0 var(--esp-6) var(--esp-4);
  text-transform: uppercase;
  color: var(--or-clair);
  text-shadow: var(--ombre-texte-forte);
  animation: resserrement 2s cubic-bezier(.2, .7, .3, 1) both;
}

/* Filets latéraux du chapitre */
#annonce-chapitre-titre::before,
#annonce-chapitre-titre::after {
  content: "";
  position: absolute;
  top: 50%;
  width: clamp(40px, 6vw, 110px);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(244, 213, 141, .7));
  animation: etend-lisere 1.4s .3s both;
}

#annonce-chapitre-titre::before {
  left: calc(-1 * clamp(40px, 6vw, 110px) - var(--esp-2));
  transform-origin: right;
}

#annonce-chapitre-titre::after {
  right: calc(-1 * clamp(40px, 6vw, 110px) - var(--esp-2));
  background: linear-gradient(270deg, transparent, rgba(244, 213, 141, .7));
  transform-origin: left;
}

#annonce-chapitre-texte {
  max-width: min(640px, 70vw);
  font-style: italic;
  font-size: clamp(16px, 1.3vw, 21px);
  line-height: 1.8;
  color: var(--ivoire-voile);
  text-shadow: var(--ombre-texte);
  animation: apparition 1.6s .6s both;
}

/* Fondu-au-noir total — opacité pilotée en inline par le moteur */
#fondu {
  position: absolute;
  inset: 0;
  z-index: 90;
  background: #020308;
  opacity: 1;
  pointer-events: none;
}


/* ═══════════════════════════ 22 · MENU PAUSE ═══════════════════════════════ */

#menu-pause {
  z-index: 60;
  align-items: center;
  justify-content: center;
  animation: apparition 240ms both;
}

.pause-panneau {
  width: 80%;
  max-width: 1520px;
  height: min(82vh, 900px);
  display: flex;
  flex-direction: column;
  animation: floatIn-pause 260ms cubic-bezier(.2, .8, .3, 1) both;
}

@keyframes floatIn-pause {
  0%   { opacity: 0; transform: translateY(18px) scale(.965); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Onglets — plaques métalliques supérieures */
.pause-onglets {
  display: flex;
  align-items: flex-end;
  gap: var(--esp-1);
  padding: 0 var(--esp-4);
}

.onglet {
  position: relative;
  padding: var(--esp-2) var(--esp-4);
  font-family: var(--titre);
  font-size: clamp(12px, .95vw, 15px);
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ivoire-voile);
  cursor: pointer;
  background: linear-gradient(180deg, rgba(42, 36, 22, .66), rgba(13, 16, 32, .82));
  border: 1px solid rgba(201, 162, 39, .26);
  border-bottom: none;
  border-radius: var(--rayon) var(--rayon) 0 0;
  box-shadow: inset 0 1px 0 rgba(244, 213, 141, .14);
  text-shadow: 0 1px 2px #000;
  transition: color 180ms ease, background 220ms ease, box-shadow 220ms ease;
}

.onglet:hover {
  color: var(--ivoire);
  background: linear-gradient(180deg, rgba(58, 48, 26, .72), rgba(18, 22, 44, .85));
}

/* Onglet actif — plaque relevée, soulignement d'or lumineux */
.onglet.actif {
  color: var(--or-clair);
  padding-bottom: calc(var(--esp-2) + 3px);
  background: linear-gradient(180deg, rgba(64, 52, 24, .8), rgba(23, 28, 56, .92));
  border-color: rgba(201, 162, 39, .5);
  box-shadow:
    inset 0 1px 0 rgba(244, 213, 141, .3),
    0 -6px 18px rgba(201, 162, 39, .1);
}

.onglet.actif::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--or-clair), #fff6d8, var(--or-clair), transparent);
  box-shadow: 0 0 10px 1px rgba(244, 213, 141, .65);
  border-radius: var(--rayon-fin);
}

/* Zone de contenu défilable */
.pause-contenu {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: var(--esp-6);
  border-top: 1px solid var(--bordure-fine);
  scroll-behavior: smooth;
}

.pause-pied {
  padding: var(--esp-2) var(--esp-4);
  font-size: 13px;
  letter-spacing: .14em;
  color: rgba(232, 226, 212, .45);
  text-align: center;
  border-top: 1px solid rgba(201, 162, 39, .18);
  background: rgba(5, 7, 15, .5);
  border-radius: 0 0 var(--rayon) var(--rayon);
}


/* ═══════ 23 · CONTENU PAUSE — SECTIONS, OBJETS, ÉQUIPEMENT, OPTIONS ════════ */

/* En-têtes de section */
.pause-contenu h3,
.pause-contenu .section-titre {
  font-size: clamp(17px, 1.35vw, 22px);
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--or-clair);
  margin: var(--esp-6) 0 var(--esp-3);
  padding-bottom: var(--esp-1);
  border-bottom: 1px solid rgba(201, 162, 39, .3);
  display: flex;
  align-items: center;
  gap: var(--esp-2);
}

.pause-contenu h3::before,
.pause-contenu .section-titre::before {
  content: "◆";
  font-size: 10px;
  color: var(--or);
  opacity: .8;
}

.pause-contenu h3:first-child,
.pause-contenu .section-titre:first-child {
  margin-top: 0;
}

.pause-contenu h4 {
  font-size: 14px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--aether);
  margin: var(--esp-4) 0 var(--esp-2);
}

/* Lignes d'objets — quantité alignée à droite */
.pause-contenu .ligne-objet,
.pause-contenu .objet-ligne {
  display: flex;
  align-items: baseline;
  gap: var(--esp-3);
  padding: var(--esp-2) var(--esp-3);
  border-radius: var(--rayon-fin);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease;
}

.pause-contenu .ligne-objet:nth-child(even),
.pause-contenu .objet-ligne:nth-child(even) {
  background: rgba(244, 213, 141, .04);
}

.pause-contenu .ligne-objet:hover,
.pause-contenu .objet-ligne:hover,
.pause-contenu .ligne-objet.sel,
.pause-contenu .objet-ligne.sel {
  background: linear-gradient(90deg, rgba(201, 162, 39, .14), transparent 75%);
  border-color: rgba(244, 213, 141, .3);
}

.pause-contenu .ligne-objet .nom-objet,
.pause-contenu .objet-ligne .nom {
  font-family: var(--titre);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--ivoire);
}

.pause-contenu .ligne-objet .quantite,
.pause-contenu .ligne-objet .qte,
.pause-contenu .objet-ligne .quantite {
  margin-left: auto;
  font-family: var(--titre);
  font-size: 13px;
  font-weight: 600;
  color: var(--or-clair);
  white-space: nowrap;
}

/* Descriptions en italique */
.pause-contenu .desc,
.pause-contenu .description,
.pause-contenu .objet-desc {
  font-style: italic;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ivoire-voile);
}

.pause-contenu .ligne-objet .desc,
.pause-contenu .ligne-objet .description,
.pause-contenu .objet-ligne .desc {
  flex-basis: 100%;
  padding-left: var(--esp-2);
}

/* Équipement — deux colonnes */
.pause-contenu .equipement {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--esp-2) var(--esp-6);
}

.pause-contenu .ligne-stat {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: var(--esp-1) 0;
  border-bottom: 1px dotted rgba(201, 162, 39, .18);
  font-size: 16px;
}

.pause-contenu .ligne-stat .valeur,
.pause-contenu .ligne-stat b {
  font-family: var(--titre);
  font-weight: 700;
  color: var(--or-clair);
}

/* Journal & quêtes */
.pause-contenu .journal .quete {
  padding: var(--esp-2) 0 var(--esp-2) var(--esp-4);
  border-left: 2px solid rgba(123, 241, 224, .4);
  margin-bottom: var(--esp-3);
}

.pause-contenu .journal .quete.principale {
  border-left-color: var(--or);
}

.pause-contenu .journal .quete h5,
.pause-contenu .journal .quete .quete-nom {
  font-family: var(--titre);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--ivoire);
  margin-bottom: 2px;
}

.pause-contenu .journal .etepe,
.pause-contenu .journal .etape {
  font-size: 14.5px;
  font-style: italic;
  color: var(--aether);
}

/* Ruban de requête */
.ribbon-requete {
  display: inline-block;
  padding: 2px var(--esp-3);
  font-family: var(--titre);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #ffe3e4;
  background: linear-gradient(180deg, var(--ecarlate-vif), var(--ecarlate) 70%, #6d0f12);
  border-radius: var(--rayon-fin);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 2px 8px rgba(95, 13, 16, .5);
  vertical-align: middle;
}

/* Options — lignes réglage + curseurs */
.pause-contenu .option-ligne,
.options .option-ligne {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--esp-4);
  padding: var(--esp-2) 0;
  border-bottom: 1px dotted rgba(201, 162, 39, .18);
}

.pause-contenu .option-ligne label,
.options .option-ligne label {
  font-size: 16.5px;
  color: var(--ivoire);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: min(240px, 26vw);
  height: 4px;
  background: rgba(5, 7, 14, .92);
  border: 1px solid rgba(201, 162, 39, .3);
  border-radius: var(--rayon-fin);
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, #fff3c8, #f4d58d 38%, #8a6d1a);
  border: 1px solid rgba(92, 74, 18, .9);
  box-shadow: 0 0 8px rgba(244, 213, 141, .55);
}

input[type="range"]::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, #fff3c8, #f4d58d 38%, #8a6d1a);
  border: 1px solid rgba(92, 74, 18, .9);
  box-shadow: 0 0 8px rgba(244, 213, 141, .55);
}

select,
option {
  background: #10142b;
  color: var(--ivoire);
  border: 1px solid var(--bordure-fine);
  border-radius: var(--rayon-fin);
  padding: var(--esp-1) var(--esp-2);
  font-family: var(--corps);
  font-size: 15px;
}

input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: #c9a227;
  cursor: pointer;
}


/* ═════════════════ 24 · ARBRES / CONSTELLATIONS ════════════════════════════ */

.pause-contenu .arbre,
.pause-contenu .constellation {
  position: relative;
  min-height: 340px;
  background:
    radial-gradient(60% 46% at 50% 40%, rgba(46, 58, 110, .22), transparent 75%),
    rgba(5, 7, 15, .4);
  border: 1px solid rgba(201, 162, 39, .18);
  border-radius: var(--rayon);
  overflow: auto;
}

/* Nœuds — astres de la constellation */
.arbre-noeud {
  position: absolute;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: var(--titre);
  font-size: 12px;
  font-weight: 700;
  color: var(--ivoire-voile);
  background: radial-gradient(circle at 38% 30%, rgba(46, 58, 110, .55), rgba(8, 11, 24, .95) 78%);
  border: 1px solid rgba(201, 162, 39, .34);
  box-shadow: inset 0 0 8px rgba(0, 0, 0, .7);
  cursor: pointer;
  transition: transform 220ms cubic-bezier(.34, 1.4, .5, 1), box-shadow 220ms ease, border-color 200ms ease, color 200ms ease;
}

.arbre-noeud:hover,
.arbre-noeud:focus-visible {
  transform: scale(1.14);
  border-color: var(--or-clair);
  color: var(--ivoire);
  box-shadow: inset 0 0 8px rgba(0, 0, 0, .5), 0 0 16px rgba(244, 213, 141, .45);
}

/* Nœud disponible — il appelle le joueur */
.arbre-noeud.disponible,
.arbre-noeud.achetable {
  border-color: var(--or);
  animation: pulse 2.6s ease-in-out infinite;
}

/* Nœud acquis — astre allumé */
.arbre-noeud.acquis,
.arbre-noeud.debloque {
  color: #141021;
  background: radial-gradient(circle at 38% 30%, #fff6d8, #f4d58d 42%, #c9a227 82%);
  border-color: #f4d58d;
  box-shadow: 0 0 14px rgba(244, 213, 141, .6);
}

/* Nœud verrouillé */
.arbre-noeud.verrouille {
  opacity: .32;
  filter: grayscale(.85);
  cursor: not-allowed;
}

/* Liens — traits d'étoiles (div positionnés ou segments SVG) */
.arbre-lien {
  position: absolute;
  height: 1px;
  background: rgba(201, 162, 39, .3);
  transform-origin: left center;
}

.arbre-lien.actif,
.arbre-lien.debloque {
  background: linear-gradient(90deg, var(--or-clair), var(--or));
  box-shadow: 0 0 6px rgba(244, 213, 141, .5);
}

path.arbre-lien,
line.arbre-lien {
  stroke: rgba(201, 162, 39, .3);
  stroke-width: 1;
  fill: none;
}

path.arbre-lien.actif,
line.arbre-lien.actif {
  stroke: var(--or-clair);
  filter: drop-shadow(0 0 3px rgba(244, 213, 141, .6));
}


/* ═══════════════ 25 · BOUTIQUE, FENÊTRES MODALES & OBJETS ══════════════════ */

.fenetre-modale {
  z-index: 70;
  align-items: center;
  justify-content: center;
  animation: apparition 220ms both;
}

.modale-boite {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(1180px, 92vw);
  max-height: min(86vh, 940px);
  display: flex;
  flex-direction: column;
  padding: clamp(var(--esp-4), 2vw, var(--esp-6));
  gap: var(--esp-4);
  animation: floatIn 220ms cubic-bezier(.2, .8, .3, 1) both;
}

.modale-titre {
  position: relative;
  font-size: clamp(22px, 1.9vw, 32px);
  font-weight: 700;
  letter-spacing: .3em;
  padding: 0 var(--esp-6) var(--esp-3) 0;
  text-transform: uppercase;
  text-align: center;
  border-bottom: 1px solid rgba(201, 162, 39, .35);
}

/* Trait lumineux sous le titre de modale */
.modale-titre::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--or-clair), #fff6d8, var(--or-clair), transparent);
  box-shadow: 0 0 8px rgba(244, 213, 141, .6);
}

.boutique-grille {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: var(--esp-4);
}

/* Liste marchande */
.boutique-liste {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: var(--esp-1);
}

.boutique-liste > * {
  display: flex;
  align-items: baseline;
  gap: var(--esp-3);
  padding: var(--esp-2) var(--esp-3);
  border-radius: var(--rayon-fin);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease;
}

.boutique-liste > *:nth-child(even) {
  background: rgba(244, 213, 141, .045);
}

.boutique-liste > *:hover,
.boutique-liste > *.sel,
.boutique-liste > *:focus-visible {
  background: linear-gradient(90deg, rgba(201, 162, 39, .16), transparent 78%);
  border-color: rgba(244, 213, 141, .35);
}

.boutique-liste .nom,
.boutique-liste .nom-objet {
  font-family: var(--titre);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .05em;
  color: var(--ivoire);
}

.boutique-liste .prix {
  margin-left: auto;
  font-family: var(--titre);
  font-size: 13px;
  font-weight: 600;
  color: var(--or-clair);
  white-space: nowrap;
}

.boutique-liste .rupture {
  opacity: .4;
  pointer-events: none;
}

/* Aperçu de l'article sélectionné */
.boutique-apercu {
  display: flex;
  flex-direction: column;
  gap: var(--esp-2);
  padding: var(--esp-4);
  background: rgba(5, 7, 15, .45);
  border: 1px solid rgba(201, 162, 39, .22);
  border-radius: var(--rayon);
  overflow-y: auto;
}

.boutique-apercu h4,
.boutique-apercu strong {
  font-family: var(--titre);
  font-size: 17px;
  letter-spacing: .1em;
  color: var(--or-clair);
}

.boutique-apercu p,
.boutique-apercu .desc {
  font-style: italic;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ivoire-voile);
}

/* Pied de boutique — bourse en pièces d'or */
.boutique-pied {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--esp-4);
  padding-top: var(--esp-3);
  border-top: 1px solid rgba(201, 162, 39, .28);
}

#boutique-gil {
  display: inline-flex;
  align-items: center;
  gap: var(--esp-2);
  font-family: var(--titre);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--or-clair);
  text-shadow: var(--ombre-texte);
}

/* La pièce de gil — entièrement dessinée en CSS */
#boutique-gil::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, #fff6d8, #f4d58d 34%, #c9a227 62%, #8a6d1a 96%);
  box-shadow:
    inset 0 0 0 2.5px rgba(140, 108, 26, .55),
    inset 0 1px 2px rgba(255, 255, 255, .6),
    0 0 8px rgba(244, 213, 141, .45);
}

/* Compteur de gil générique (hors boutique) */
.gil {
  display: inline-flex;
  align-items: center;
  gap: var(--esp-2);
  font-family: var(--titre);
  font-weight: 700;
  color: var(--or-clair);
}

.gil::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #fff6d8, #f4d58d 34%, #c9a227 62%, #8a6d1a 96%);
  box-shadow: inset 0 0 0 2px rgba(140, 108, 26, .55), 0 0 6px rgba(244, 213, 141, .4);
}

/* Fenêtre d'objet (modale générique) */
.fenetre-objet {
  position: absolute;
  inset: 0;
  z-index: 72;
  align-items: center;
  justify-content: center;
  background: rgba(4, 6, 13, .6);
}

.fenetre-objet-boite {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(560px, 90vw);
  padding: var(--esp-6);
  animation: floatIn 220ms cubic-bezier(.2, .8, .3, 1) both;
}

.fenetre-objet-boite h4 {
  font-size: 19px;
  letter-spacing: .16em;
  text-transform: uppercase;
  margin-bottom: var(--esp-3);
}


/* ═══════════════════ 26 · BESTIAIRE & PORTRAITS ════════════════════════════ */

.bestiaire-fiche {
  display: flex;
  flex-direction: column;
  gap: var(--esp-2);
  padding: var(--esp-4);
  margin-bottom: var(--esp-3);
}

.bestiaire-fiche h4 {
  font-size: 16px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ecarlate-vif);
}

.bestiaire-fiche .desc,
.bestiaire-fiche p {
  font-style: italic;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ivoire-voile);
}

.bestiaire-fiche dl {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  gap: var(--esp-1) var(--esp-3);
  font-size: 14.5px;
}

.bestiaire-fiche dt {
  font-family: var(--titre);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--aether);
  align-self: baseline;
}

.bestiaire-fiche dd {
  color: var(--ivoire);
  align-self: baseline;
}

/* Grille de portraits (auberge, sélection d'équipe) */
.portraits {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: var(--esp-3);
}

.portraits > * {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%);
  background: linear-gradient(160deg, rgba(255, 255, 255, .1), transparent 46%), linear-gradient(200deg, #2a2416, #12152b 72%);
  box-shadow: inset 0 0 0 1px rgba(244, 213, 141, .28);
  cursor: pointer;
  font-family: var(--titre);
  font-weight: 700;
  color: var(--or-clair);
  transition: transform 220ms cubic-bezier(.34, 1.4, .5, 1), box-shadow 220ms ease;
}

.portraits > *:hover,
.portraits > *.sel,
.portraits > *.actif {
  transform: translateY(-4px) scale(1.05);
  box-shadow: inset 0 0 0 1px rgba(244, 213, 141, .7), 0 0 16px rgba(201, 162, 39, .4);
}


/* ═══════════════════ 27 · VICTOIRE & DÉFAITE ═══════════════════════════════ */

#ecran-victoire {
  z-index: 80;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 4vh, 40px);
  background:
    radial-gradient(80% 60% at 50% 44%, rgba(201, 162, 39, .14), transparent 68%),
    radial-gradient(120% 100% at 50% 0%, rgba(23, 28, 58, .4), transparent 60%),
    rgba(4, 6, 13, .78);
}

/* Éclat radial animé derrière le titre */
#ecran-victoire::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 42%;
  width: min(1100px, 90vw);
  aspect-ratio: 1.6 / 1;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(ellipse, rgba(255, 246, 216, .2) 0%, rgba(244, 213, 141, .12) 34%, transparent 66%);
  animation: burst-victoire 2.8s cubic-bezier(.2, .7, .3, 1) infinite alternate;
  pointer-events: none;
}

.victoire-titre {
  font-family: var(--titre);
  font-weight: 900;
  font-size: clamp(64px, 8vw, 158px);
  letter-spacing: .14em;
  padding-left: .14em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #8a6d1a 0%, #fceec0 16%, #f4d58d 34%, #c9a227 52%, #6b5416 60%, #a9852a 70%, #f4d58d 88%, #8a6d1a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter:
    drop-shadow(0 3px 0 rgba(95, 13, 16, .6))
    drop-shadow(0 24px 48px rgba(0, 0, 0, .9));
  animation: victoire-entree 1.5s cubic-bezier(.16, .8, .32, 1) both;
}

/* Tableau des récompenses — lignes élégantes */
.victoire-details {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--esp-1);
  min-width: min(460px, 80vw);
  padding: var(--esp-3) var(--esp-6);
  animation: apparition 900ms .45s both;
}

.victoire-details > * {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--esp-6);
  padding: var(--esp-1) 0;
  border-bottom: 1px solid rgba(201, 162, 39, .22);
  font-size: 17.5px;
  color: var(--ivoire-voile);
}

.victoire-details > *:last-child {
  border-bottom: none;
}

.victoire-details b,
.victoire-details strong,
.victoire-details .valeur {
  font-family: var(--titre);
  font-weight: 700;
  color: var(--or-clair);
  letter-spacing: .06em;
}

.victoire-suite {
  font-family: var(--titre);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--ivoire-voile);
  text-shadow: var(--ombre-texte);
  animation: clignote-discret 2.4s ease-in-out infinite, apparition 1s .8s both;
}

/* Défaite — abysse écarlate, émergence lente */
#ecran-defaite {
  z-index: 80;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--esp-4);
  background:
    radial-gradient(90% 70% at 50% 60%, rgba(95, 13, 16, .34), transparent 70%),
    radial-gradient(120% 100% at 50% 110%, rgba(26, 5, 7, .8), transparent 60%),
    rgba(3, 3, 7, .93);
}

.defaite-titre {
  font-family: var(--titre);
  font-weight: 900;
  font-size: clamp(38px, 4.6vw, 84px);
  letter-spacing: .22em;
  padding-left: .22em;
  text-transform: uppercase;
  color: #b04a4e;
  text-shadow:
    0 2px 0 rgba(15, 2, 3, .95),
    0 0 34px rgba(164, 22, 26, .5),
    0 10px 40px rgba(0, 0, 0, .95);
  animation: defaite-lente 4s cubic-bezier(.2, .6, .3, 1) both;
}

.defaite-texte {
  font-style: italic;
  font-size: clamp(16px, 1.4vw, 22px);
  color: rgba(232, 226, 212, .6);
  text-shadow: var(--ombre-texte);
  animation: apparition 2.4s 1.2s both;
}

.defaite-choix {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--esp-1);
  margin-top: var(--esp-4);
  animation: apparition 2s 1.8s both;
}

.defaite-choix li {
  position: relative;
  font-family: var(--titre);
  font-size: clamp(15px, 1.15vw, 19px);
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ivoire-voile);
  padding: var(--esp-2) var(--esp-6);
  cursor: pointer;
  text-shadow: var(--ombre-texte);
  transition: color 200ms ease, letter-spacing 260ms ease;
}

.defaite-choix li::before {
  content: "◆";
  position: absolute;
  left: calc(var(--esp-6) - 2px);
  top: 50%;
  translate: 0 -50%;
  font-size: 10px;
  color: var(--or-clair);
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 200ms ease, transform 240ms ease;
}

.defaite-choix li:hover,
.defaite-choix li.sel,
.defaite-choix li:focus-visible {
  color: var(--ivoire);
  letter-spacing: .24em;
}

.defaite-choix li:hover::before,
.defaite-choix li.sel::before,
.defaite-choix li:focus-visible::before {
  opacity: 1;
  transform: translateX(0);
}


/* ═════════════════ 28 · NOTIFICATIONS (TOASTS) & BOUTONS ═══════════════════ */

#toast-zone {
  position: absolute;
  right: clamp(14px, 1.8vw, 28px);
  bottom: clamp(14px, 3vh, 30px);
  z-index: 95;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--esp-2);
  pointer-events: none;
}

.toast {
  position: relative;
  max-width: min(420px, 38vw);
  padding: var(--esp-2) var(--esp-4) var(--esp-2) calc(var(--esp-4) + 8px);
  font-size: 15.5px;
  line-height: 1.45;
  color: var(--ivoire);
  background:
    repeating-linear-gradient(48deg, rgba(244, 213, 141, .014) 0 1px, transparent 1px 3px),
    linear-gradient(160deg, rgba(20, 25, 52, .92), rgba(8, 11, 24, .94));
  border: 1px solid rgba(201, 162, 39, .3);
  border-left-width: 3px;
  border-left-color: var(--or);
  border-radius: var(--rayon);
  box-shadow: 0 10px 30px rgba(2, 3, 8, .65);
  text-shadow: var(--ombre-texte);
  animation: toast-entree 260ms cubic-bezier(.2, .8, .3, 1) both;
}

/* Liseré gauche selon le type */
.toast.succes   { border-left-color: var(--vert-soin); }
.toast.info     { border-left-color: var(--aether); }
.toast.avertissement,
.toast.avis     { border-left-color: var(--ambre); }
.toast.erreur   { border-left-color: var(--ecarlate-vif); }

.toast.sortie,
.toast.meurt {
  animation: toast-sortie 300ms ease both;
}

/* Bouton gravé discret — fermeture des fenêtres */
.btn-fermer {
  padding: var(--esp-1) var(--esp-4);
  font-family: var(--titre);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ivoire-voile);
  background: linear-gradient(180deg, rgba(42, 36, 22, .6), rgba(10, 13, 26, .85));
  border: 1px solid rgba(201, 162, 39, .32);
  border-radius: var(--rayon-fin);
  box-shadow: inset 0 1px 0 rgba(244, 213, 141, .16), inset 0 -3px 6px rgba(0, 0, 0, .5);
  text-shadow: 0 1px 2px #000;
  transition: color 180ms ease, border-color 200ms ease, box-shadow 220ms ease;
}

.btn-fermer:hover,
.btn-fermer:focus-visible {
  color: var(--or-clair);
  border-color: rgba(244, 213, 141, .55);
  box-shadow: inset 0 1px 0 rgba(244, 213, 141, .28), 0 0 12px rgba(201, 162, 39, .3);
}


/* ═══════════════ 29 · ACCESSIBILITÉ & RESPONSIVE (1280 → 1920) ═════════════ */

/* Réduction des mouvements — l'élégance sans le vertige */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: .01ms;
    animation-iteration-count: 1;
    transition-duration: .01ms;
  }
}

/* Sous la cible 1280 : compactage maîtrisé, rien ne se perd */
@media (max-width: 1279px) {

  .carte-perso {
    width: 236px;
  }

  #sous-menu {
    width: 86vw;
    bottom: 104px;
  }

  .cmds .cmd {
    width: 78px;
    height: 58px;
  }

  #ordre-tour {
    padding: var(--esp-2) 6px;
  }

  .boutique-grille {
    grid-template-columns: 1fr;
  }

  .pause-onglets {
    overflow-x: auto;
  }

  .hud-lieu {
    max-width: 52vw;
  }
}

/* Écrans étroits de secours — le jeu reste jouable */
@media (max-width: 760px) {

  .hud-gauche {
    top: 96px;
  }

  .carte-perso {
    width: 208px;
  }

  .journal-encart {
    display: none;
  }

  .boussole {
    display: none;
  }

  .portrait-cadre {
    width: 96px;
    height: 96px;
  }

  .texte-dialogue {
    font-size: 17px;
  }

  .equipement {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   POLISH VAGUE VISUELLE — flash des Limites, assombrissement pause
   ═══════════════════════════════════════════════════════════════════ */
#flash-blanc {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 42%, rgba(255, 250, 235, 0.98), rgba(255, 214, 170, 0.8));
  mix-blend-mode: screen;
  pointer-events: none;
  opacity: 0;
  z-index: 70;
}
#menu-pause {
  background: rgba(4, 7, 16, 0.5);
  backdrop-filter: blur(5px) saturate(0.9);
}
#num-degats-container .num-degats {
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.85), 0 2px 2px rgba(0, 0, 0, 0.9), 0 0 14px rgba(244, 213, 141, 0.25);
}
#num-degats-container .num-degats.critique {
  text-shadow: 0 0 8px rgba(164, 22, 26, 0.9), 0 2px 3px rgba(0, 0, 0, 0.95), 0 0 22px rgba(229, 56, 59, 0.55);
}

/* ═══════════════════════════════════════════════════════════════════
   POLISH V2 — lisibilité logo, marges dialogue, notifications hors texte
   ═══════════════════════════════════════════════════════════════════ */
.titre-logo {
  background: linear-gradient(180deg, #fff3c4 0%, #f4d58d 30%, #c9a227 62%, #8a6d1a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 22px rgba(201, 162, 39, 0.45)) drop-shadow(0 2px 2px rgba(0, 0, 0, 0.85));
}
.texte-dialogue {
  padding-right: 36px;
  overflow-wrap: break-word;
  word-break: normal;
}
#toast-zone {
  bottom: 250px;
  max-width: 380px;
}

/* Lore de l'écran titre : jamais tronqué ni chevauché par le footer */
.titre-lore {
  max-height: 21vh;
  overflow: hidden;
  margin-bottom: 30px;
  font-size: 0.94rem;
  line-height: 1.55;
}
