/* Fichier généré (scripts/quiz-pages/lib.mjs) : ne pas modifier ici. */
/* Polices du jeu — servies depuis public/assets/fonts/ (plus d'appel à
   Google Fonts). Rapatriées le 2026-08-13 pour trois raisons :
   - les joueurs sous bloqueur de pub voyaient tout le jeu en police système ;
   - l'appel direct à Google exposait l'IP des visiteurs (RGPD) ;
   - en dev, les polices arrivaient après plus de 250 modules Vite, d'où un
     long passage en typo générique au chargement.
   Sous-ensembles latin + latin-ext uniquement (suffisant pour le français).
   Ce fichier est importé EN PREMIER dans main.tsx : les @font-face doivent
   être connus avant les feuilles qui s'en servent. */

@font-face {
  font-family: 'Piedra';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/piedra-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Piedra';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/piedra-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Cinzel';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/cinzel-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Cinzel';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/cinzel-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Cinzel';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/cinzel-600-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Cinzel';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/cinzel-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/montserrat-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/montserrat-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/montserrat-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/montserrat-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/montserrat-600-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/montserrat-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/montserrat-700-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/montserrat-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'MedievalSharp';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/medievalsharp-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'MedievalSharp';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/medievalsharp-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Écriture de plume (signature de l'émote premium Elfe). Great Vibes, licence OFL. */
@font-face {
  font-family: 'Great Vibes';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/greatvibes-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'IM Fell English';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/imfellenglish-400italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* The game owns its palette (parchment hub / stone combat) and never follows
     the OS theme. `only light` opts out of Chrome/Android "auto dark" which
     would invert ink text to white over the parchment gradients. */
  color-scheme: only light;

  /* ─── Typography ────────────────────────────────────────────────────── */
  /* Ornamental — page titles, hero text. */
  --kingdom-font-heading: 'Piedra', 'MedievalSharp', cursive;
  /* Display — card titles, section labels, buttons, meta. */
  --kingdom-font-display: 'Cinzel', serif;
  /* Prose — italic flavor text, dialog, empty states. */
  --kingdom-font-prose: 'IM Fell English', serif;
  /* Body — forms, inputs, anything utilitarian. */
  --kingdom-font-body: 'Montserrat', sans-serif;
  /* Script — signatures manuscrites (émote premium Elfe), à garder pour 2-3 mots. */
  --kingdom-font-script: 'Great Vibes', 'IM Fell English', cursive;

  /* ─── Gold (metallic, for borders + highlights) ─────────────────────── */
  --kingdom-gold-dark: #8a6a1e;
  --kingdom-gold: #d4a94a;
  --kingdom-gold-bright: #f1c75c;
  --kingdom-gold-deep: #b8860b;   /* saturated old gold — gradient ends, gold text on parchment */

  /* ─── Spectral (Mort-vivant: émotes premium, flammes d'âme) ────────── */
  --kingdom-spectral-dark: #1f7a52;
  --kingdom-spectral: #4fe39a;
  --kingdom-spectral-bright: #c4ffe0;
  --kingdom-imperial: #d4343e;          /* pourpre impérial (émote premium Humain) */
  --kingdom-imperial-bright: #ffb09a;
  --kingdom-fairy: #7fe6d2;             /* menthe des ailes (émote premium Fée) */
  --kingdom-fairy-bright: #e6fff8;
  --kingdom-fairy-pink: #ff9ecb;
  --kingdom-elf: #4fd08a;               /* vert feuille (émote premium Elfe) */
  --kingdom-elf-bright: #e2ffec;
  --kingdom-elf-glow: #7be8ff;          /* volutes cyan du parfum */
  --kingdom-blood: #c8242c;             /* sang (émote premium Nain) */
  --kingdom-blood-bright: #ff9a8f;
  --kingdom-sweat: #8fd8ff;             /* sueur */
  --kingdom-steel: #d7dee8;             /* acier */
  --kingdom-steel-bright: #ffffff;
  --kingdom-forge: #ff9a2e;             /* étincelles de forge */

  /* ─── Castagne (Skraug brand accent — the PvP "La Castagne" mode) ────── */
  --kingdom-castagne: #e0312b;        /* brand red — titles / accents */
  --kingdom-castagne-deep: #b02626;   /* blood-red glow */
  --kingdom-win: #3e6e3a;             /* victory green — W/D records, positive deltas */

  /* ─── Couronnes (premium currency accent — Boutique) ─────────────────── */
  --kingdom-crowns: #b18cf0;          /* laurel-gem violet — prices, purse, exclusives */
  --kingdom-crowns-deep: #7a5cc4;     /* borders / gradients */
  /* Couronne EN TEXTE sur une surface claire (parchemin, panneau doré) : les
     deux teintes ci-dessus sont faites pour du fond sombre et tombent sous le
     seuil de lisibilité sur parchemin (1,3:1 et 4,2:1). Celle-ci tient 5,5:1.
     Même rampe de teinte (~260°), donc la Couronne reste reconnaissable. */
  --kingdom-crowns-ink: #6a4aad;

  /* ─── Podium (médaillons de classement — or/argent/bronze) ──────────── */
  --kingdom-silver: #c8ced7;          /* 2e place — argent */
  --kingdom-bronze: #c17e3a;          /* 3e place — bronze */

  /* ─── Plaques bronze (panneaux translucides posés sur une image —
         accueils d'expédition, scènes Citadelle) ───────────────────────── */
  --kingdom-plate-border: #8b6f3a;          /* liseré bronze */
  --kingdom-plate-warm: rgba(48, 30, 14, 0.92);   /* haut/bas du dégradé */
  --kingdom-plate-dark: rgba(30, 18, 8, 0.92);    /* cœur du dégradé */

  /* ─── Stone (dark palette — adventure, combat, immersive surfaces) ──── */
  --kingdom-stone-0: #0f0a08;   /* deepest — page background */
  --kingdom-stone-1: #1a1410;   /* card body */
  --kingdom-stone-2: #231a14;   /* elevated panel */
  --kingdom-stone-3: #2e2218;   /* highlight / banner top */

  /* ─── Parchment (light palette — hub, dashboard, accueil) ───────────── */
  --kingdom-parchment-highlight: #f4e4bc;  /* panel top (lightest) */
  --kingdom-parchment-mid: #e6d19b;        /* panel middle */
  --kingdom-parchment: #ecd8a8;            /* text on stone surfaces */
  --kingdom-parchment-muted: #d9c087;      /* subdued text on stone */
  --kingdom-parchment-shadow: #d4bf7a;     /* panel bottom (darker) */
  --kingdom-parchment-dark: #8a6a3a;       /* faded / locked text */

  /* ─── Ink (dark text readable on parchment) ─────────────────────────── */
  --kingdom-ink: #2d1810;         /* primary dark text */
  --kingdom-ink-mid: #654321;     /* secondary */
  --kingdom-ink-soft: #8b7355;    /* muted / metadata */
  --kingdom-ink-warm: #3a2415;    /* accents, rivet borders */
  /* Result/preparation-screen ink pair — darker than ink-mid/ink-soft, do not merge. */
  --kingdom-ink-parchment: #3d2e14;       /* primary text (result & prep screens) */
  --kingdom-ink-parchment-soft: #5a4320;  /* secondary text (result & prep screens) */

  /* ─── Difficulté (vocabulaire de jeu — partagé Citadelle / Tri des
         Archives / HUD de combat) ──────────────────────────────────────── */
  --kingdom-difficulty-easy: #4c8a3f;
  --kingdom-difficulty-medium: #b98a2e;
  --kingdom-difficulty-hard: #b05a2a;
  --kingdom-difficulty-nightmare: #7c3aa0;

  /* ─── Statuts (pastille « en ligne », retours de formulaire sur pierre) ── */
  --kingdom-status-online: #22c55e;
  --kingdom-status-ok-text: #86efac;
  --kingdom-status-error-text: #ff9b7a;
  --kingdom-status-danger: #c0392b;

  /* ─── Glace (Troll Trek) ────────────────────────────────────────────────
     Troisième matière du royaume, après la pierre et le parchemin : réservée
     au mode Course (monde troll, glace et montagne). Même or, mêmes polices,
     mêmes rayons — seule la SURFACE change. Posée par `CourseIceSkin.css`. */
  --kingdom-ice-night: #06101d;   /* nuit polaire — fond de page */
  --kingdom-ice-deep: #0c2340;    /* dalle sombre — panneaux */
  --kingdom-ice-mid: #1d5079;     /* glace profonde — dégradés, ombres bleues */
  --kingdom-ice-blue: #5fb1dc;    /* glace vive — liserés, remplissages */
  --kingdom-ice-light: #a9def4;   /* glace claire — texte secondaire sur nuit */
  --kingdom-ice-pale: #d9f1fb;    /* givre — corps des blocs de réponse */
  --kingdom-ice-white: #f3fbff;   /* reflet — texte principal sur nuit */
  --kingdom-ice-ink: #0b2a47;     /* texte posé SUR la glace claire */
  --kingdom-ice-glow: rgba(120, 205, 255, 0.55);
  --kingdom-ice-aurora-a: rgba(64, 224, 190, 0.16);  /* voile vert d'aurore */
  --kingdom-ice-aurora-b: rgba(122, 140, 255, 0.14); /* voile violet d'aurore */
  /* Givre : grain bleuté très léger, tuilé. */
  --kingdom-ice-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='f' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' seed='5' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .78  0 0 0 0 .92  0 0 0 0 1  .5 0 0 0 -.16'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23f)'/%3E%3C/svg%3E");
  /* Stalactites de glace : masque tuilé en x, pointes irrégulières. */
  --kingdom-ice-icicles: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 24'%3E%3Cpolygon points='0,0 160,0 160,5 152,5 148,17 144,5 130,5 126,11 122,5 104,5 99,24 94,5 78,5 74,14 70,5 52,5 47,20 42,5 26,5 22,10 18,5 0,5'/%3E%3C/svg%3E");

  /* ─── Radii ─────────────────────────────────────────────────────────── */
  /* L'échelle est VOLONTAIREMENT courte : quatre pas + la pastille. Si une
     valeur semble manquer, prendre le pas le plus proche — ne pas ajouter un
     cran. Et surtout : ne jamais écrire `var(--kingdom-radius-xxx, 6px)` avec
     un nom qui n'existe pas ici, le repli est silencieux et fabrique un rayon
     de plus sans que rien ne le signale (déjà arrivé sur la Citadelle). */
  --kingdom-radius-sharp: 2px;    /* pills, stamps, selects */
  --kingdom-radius-soft: 4px;     /* stone panels, cards */
  --kingdom-radius-md: 8px;       /* nested tiles within a panel */
  --kingdom-radius-round: 12px;   /* large rounded surfaces (golden panels) */
  --kingdom-radius-pill: 999px;   /* fully rounded — chips, badges, statuts */

  /* ─── Shadows ───────────────────────────────────────────────────────── */
  --kingdom-shadow-panel: 0 10px 24px rgba(0, 0, 0, 0.5);
  --kingdom-shadow-panel-hover: 0 16px 30px rgba(0, 0, 0, 0.6);
  --kingdom-shadow-glow-gold: 0 0 30px rgba(212, 169, 74, 0.25);
  --kingdom-shadow-glow-gold-strong: 0 0 30px rgba(212, 169, 74, 0.4);
  --kingdom-shadow-glow-parchment: 0 0 20px rgba(212, 169, 74, 0.25);
  --kingdom-shadow-inset-dark: inset 0 0 22px rgba(0, 0, 0, 0.6);
  --kingdom-shadow-inset-panel: inset 0 0 0 1px rgba(0, 0, 0, 0.4);
  --kingdom-shadow-inset-golden: inset 0 1px 2px rgba(255, 255, 255, 0.3);
}
:root {
  --kingdom-paper-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .36  0 0 0 0 .24  0 0 0 0 .08  .34 0 0 0 -.07'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
  /* Fibres plus larges : donne du « nuage » au parchemin, évite l'aplat. */
  --kingdom-paper-cloud: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='560'%3E%3Cfilter id='c' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.007 .011' numOctaves='3' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .55  0 0 0 0 .38  0 0 0 0 .12  .36 0 0 0 -.11'/%3E%3C/filter%3E%3Crect width='900' height='560' filter='url(%23c)'/%3E%3C/svg%3E");

  /* Grain de pierre : bruit froid, sombre. DÉSACTIVÉ (décision Nicolas 2026-10-10 :
     nuisait à la lecture) — `--kingdom-stone-grain` vaut `none`, ce qui est une
     couche d'image valide : tous les `background: var(--kingdom-stone-grain), …`
     retombent sur leur dégradé. Retour arrière : lui redonner la valeur ci-dessous. */
  --kingdom-stone-grain: none;
  --kingdom-stone-grain-fine: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='s' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.65' numOctaves='3' seed='11' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .75  0 0 0 0 .62  0 0 0 0 .45  .5 0 0 0 -.14'/%3E%3C/filter%3E%3Crect width='260' height='260' filter='url(%23s)'/%3E%3C/svg%3E");

  /* Fond de page des écrans de navigation : dégradé lisse, sans motif (le mur de
     briques `dark_stone.jpg` passait derrière le texte). */
  --kingdom-page-bg: radial-gradient(ellipse 120% 70% at 50% 0%, var(--kingdom-stone-3) 0%, var(--kingdom-stone-1) 55%, var(--kingdom-stone-0) 100%) fixed;

  /* Plaque sombre (bronze/ébène) — cartouches, VS, compteurs. */
  --combat-plate-bg: linear-gradient(180deg, #46331f 0%, #2b1d11 55%, #1d130b 100%);
  --combat-plate-edge: #8a6a1e;
  --combat-plate-text: #f1dfb0;
}
/* Pages de quiz publiques (/quiz-<thème>) : pages FIXES, hors application React,
   générées par scripts/build-quiz-pages.mjs. Les jetons --kingdom-* et les
   @font-face sont recopiés de src/styles/theme.css et fonts.css par le
   générateur, en tête de ce fichier : ne jamais écrire une couleur de la
   palette ici, lire le jeton (transparences via color-mix). */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body.qp {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(1100px 520px at 50% -120px, var(--kingdom-stone-3), transparent 70%),
    var(--kingdom-stone-0);
  color: var(--kingdom-parchment);
  font-family: var(--kingdom-font-body);
  font-size: 16px;
  line-height: 1.6;
}

.qp a:not(.qp-btn) { color: var(--kingdom-gold-bright); }
.qp-wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 16px; }

/* ── Barre du haut ───────────────────────────────────────────────── */
.qp-nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px;
  background: color-mix(in srgb, var(--kingdom-stone-0) 90%, transparent);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--kingdom-gold-dark);
}
.qp-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; min-height: 44px; }
.qp-brand img { width: 36px; height: 36px; object-fit: contain; }
.qp-brand span {
  font-family: var(--kingdom-font-display); font-weight: 600; font-size: 13px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--kingdom-parchment);
}

/* ── Boutons ─────────────────────────────────────────────────────── */
.qp-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 24px;
  font-family: var(--kingdom-font-display); font-weight: 600; font-size: 14px;
  letter-spacing: 0.14em; text-transform: uppercase; text-decoration: none; white-space: nowrap;
  border-radius: var(--kingdom-radius-soft); border: 0; cursor: pointer;
  transition: transform .15s ease, filter .15s ease;
}
.qp-btn--gold {
  color: var(--kingdom-ink);
  background: linear-gradient(180deg, var(--kingdom-gold-bright), var(--kingdom-gold));
  box-shadow: 0 2px 0 var(--kingdom-gold-dark), 0 8px 18px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.qp-btn--ghost {
  color: var(--kingdom-parchment);
  background: color-mix(in srgb, var(--kingdom-stone-0) 45%, transparent);
  border: 1px solid color-mix(in srgb, var(--kingdom-gold) 60%, transparent);
}
.qp-nav .qp-btn { min-height: 44px; padding: 0 14px; font-size: 12px; letter-spacing: 0.1em; }
@media (max-width: 480px) { .qp-brand span { display: none; } }
@media (hover: hover) {
  .qp-btn:hover { transform: translateY(-1px); filter: brightness(1.06); }
}
.qp-btn:active { transform: translateY(1px); }

/* ── En-tête de page ─────────────────────────────────────────────── */
.qp-crumbs {
  margin: 22px 0 0; padding: 0; list-style: none;
  display: flex; flex-wrap: wrap; gap: 6px;
  font-family: var(--kingdom-font-display); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--kingdom-parchment-muted);
}
.qp-crumbs li + li::before { content: "›"; margin-right: 6px; color: var(--kingdom-gold-dark); }
.qp-crumbs a { color: var(--kingdom-parchment-muted); text-decoration: none; }

.qp h1 {
  margin: 14px 0 6px;
  font-family: var(--kingdom-font-heading); font-weight: 400;
  font-size: clamp(34px, 8vw, 54px); line-height: 1.05;
  color: var(--kingdom-gold-bright);
  text-shadow: 0 2px 0 var(--kingdom-stone-0), 0 0 28px color-mix(in srgb, var(--kingdom-gold) 35%, transparent);
}
.qp-meta {
  margin: 0 0 18px;
  font-family: var(--kingdom-font-display); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--kingdom-gold);
}
.qp-intro p {
  margin: 0 0 14px;
  font-family: var(--kingdom-font-prose); font-style: italic; font-size: 19px; line-height: 1.5;
  color: var(--kingdom-parchment);
}

.qp h2 {
  margin: 44px 0 14px;
  font-family: var(--kingdom-font-heading); font-weight: 400; font-size: clamp(24px, 5.5vw, 32px);
  color: var(--kingdom-gold-bright);
}

/* ── Carte du quiz (parchemin) ───────────────────────────────────── */
.qp-quiz {
  margin: 26px 0 0; padding: 20px 16px 22px;
  background: linear-gradient(180deg, var(--kingdom-parchment-highlight), var(--kingdom-parchment-mid));
  color: var(--kingdom-ink);
  border: 1px solid var(--kingdom-gold-dark);
  border-radius: var(--kingdom-radius-round);
  box-shadow: var(--kingdom-shadow-panel), var(--kingdom-shadow-inset-golden);
}
.qp-list { margin: 0; padding: 0; list-style: none; counter-reset: q; }
.qp-item { counter-increment: q; padding: 4px 0 22px; }
.qp-item + .qp-item { border-top: 1px solid color-mix(in srgb, var(--kingdom-parchment-dark) 45%, transparent); padding-top: 20px; }

.qp-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-family: var(--kingdom-font-display); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--kingdom-ink-soft);
}
.qp-head::before { content: "Question " counter(q) " / " attr(data-total); }
.qp-diff { padding: 2px 10px; border-radius: var(--kingdom-radius-pill); color: var(--kingdom-parchment-highlight); }
.qp-diff--easy { background: var(--kingdom-difficulty-easy); }
.qp-diff--medium { background: var(--kingdom-difficulty-medium); }
.qp-diff--hard { background: var(--kingdom-difficulty-hard); }

.qp h3.qp-q {
  margin: 10px 0 14px;
  font-family: var(--kingdom-font-display); font-weight: 600; font-size: 19px; line-height: 1.35;
  color: var(--kingdom-ink);
}
.qp-opts { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.qp-opt {
  width: 100%; min-height: 52px; padding: 10px 14px;
  display: flex; align-items: center; gap: 12px; text-align: left;
  font-family: var(--kingdom-font-display); font-weight: 600; font-size: 16px; color: var(--kingdom-ink);
  background: linear-gradient(180deg, var(--kingdom-parchment-highlight), var(--kingdom-parchment));
  border: 1px solid var(--kingdom-parchment-dark);
  border-radius: var(--kingdom-radius-md);
  box-shadow: 0 2px 0 var(--kingdom-parchment-dark);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .2s ease;
}
.qp-opt::before {
  content: attr(data-letter);
  flex: 0 0 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--kingdom-gold-bright);
  background: var(--kingdom-stone-2); border: 1px solid var(--kingdom-gold-dark);
}
@media (hover: hover) {
  .qp-opt:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 3px 0 var(--kingdom-parchment-dark), var(--kingdom-shadow-glow-parchment); }
}
.qp-opt:not(:disabled):active { transform: translateY(1px); box-shadow: none; }
.qp-opt:disabled { cursor: default; }
.qp-opt.is-right { background: color-mix(in srgb, var(--kingdom-difficulty-easy) 30%, var(--kingdom-parchment-highlight)); border-color: var(--kingdom-win); box-shadow: 0 2px 0 var(--kingdom-win); }
.qp-opt.is-wrong { background: color-mix(in srgb, var(--kingdom-status-danger) 26%, var(--kingdom-parchment-highlight)); border-color: var(--kingdom-status-danger); box-shadow: 0 2px 0 var(--kingdom-status-danger); }
.qp-opt.is-dim { opacity: 0.55; }

.qp-note {
  margin: 14px 0 0; padding: 12px 14px;
  font-size: 15px; line-height: 1.5; color: var(--kingdom-ink-parchment);
  background: color-mix(in srgb, var(--kingdom-parchment-shadow) 55%, transparent);
  border-left: 3px solid var(--kingdom-gold-deep);
  border-radius: var(--kingdom-radius-soft);
}
.qp-note strong { font-family: var(--kingdom-font-display); letter-spacing: 0.04em; }
.qp-next { margin-top: 16px; width: 100%; }

/* Mode interactif (posé par quiz.js) : une question à la fois. */
.qp-quiz.is-live .qp-item { display: none; border-top: 0; padding-top: 4px; }
.qp-quiz.is-live .qp-item.is-current { display: block; animation: qp-rise .28s ease both; }
.qp-quiz.is-live .qp-note,
.qp-quiz.is-live .qp-next { display: none; }
.qp-quiz.is-live .qp-item.is-answered .qp-note { display: block; }
.qp-quiz.is-live .qp-item.is-answered .qp-next { display: inline-flex; }
.qp-quiz:not(.is-live) .qp-next { display: none; }
@keyframes qp-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.qp-bar { height: 6px; margin: 0 0 16px; border-radius: var(--kingdom-radius-pill); background: color-mix(in srgb, var(--kingdom-parchment-dark) 35%, transparent); overflow: hidden; }
.qp-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--kingdom-gold-deep), var(--kingdom-gold-bright)); transition: width .3s ease; }

/* ── Résultat ────────────────────────────────────────────────────── */
.qp-result { text-align: center; padding: 10px 4px 4px; }
.qp-result[hidden] { display: none; }
.qp-score { font-family: var(--kingdom-font-heading); font-size: 64px; line-height: 1; color: var(--kingdom-gold-deep); }
.qp-score small { font-size: 28px; color: var(--kingdom-ink-soft); }
.qp-verdict { margin: 8px 0 6px; font-family: var(--kingdom-font-display); font-weight: 600; font-size: 20px; color: var(--kingdom-ink); }
.qp-pitch { margin: 0 auto 18px; max-width: 46ch; font-family: var(--kingdom-font-prose); font-style: italic; font-size: 18px; color: var(--kingdom-ink-parchment); }
.qp-actions { display: grid; gap: 10px; }
.qp-result .qp-btn--ghost { color: var(--kingdom-ink); background: transparent; border-color: var(--kingdom-parchment-dark); }

/* ── Sous le quiz ────────────────────────────────────────────────── */
.qp-after p { margin: 0 0 14px; font-size: 17px; color: var(--kingdom-parchment); }
.qp-after .qp-btn { margin-top: 6px; }
.qp-links { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.qp-links a {
  display: flex; align-items: center; min-height: 48px; padding: 8px 14px;
  font-family: var(--kingdom-font-display); font-size: 15px; letter-spacing: 0.04em; text-decoration: none;
  color: var(--kingdom-parchment);
  background: var(--kingdom-stone-2);
  border: 1px solid color-mix(in srgb, var(--kingdom-gold) 35%, transparent);
  border-radius: var(--kingdom-radius-soft);
}
@media (hover: hover) { .qp-links a:hover { border-color: var(--kingdom-gold); } }

.qp-foot {
  margin-top: 56px; padding: 22px 16px 34px; text-align: center;
  border-top: 1px solid var(--kingdom-stone-3);
  font-size: 13px; color: var(--kingdom-parchment-muted);
}
.qp-foot a { color: var(--kingdom-parchment-muted); margin: 0 8px; display: inline-block; padding: 8px 0; }

@media (min-width: 481px) {
  .qp-quiz { padding: 26px 26px 28px; }
  .qp-actions { grid-template-columns: 1fr 1fr; }
  .qp-links { grid-template-columns: 1fr 1fr; }
  .qp-next { width: auto; }
}
@media (min-width: 769px) {
  .qp-nav { padding: 12px 32px; }
  .qp-brand span { font-size: 14px; }
  .qp-opts { grid-template-columns: 1fr 1fr; }
}
/* ── Aperçu du combat (au-dessus des questions) ──────────────────────
   Même mise en scène que le mini-duel de la page d'accueil (LandingDuel.css) :
   une bonne réponse = le héros frappe, une mauvaise = l'adversaire riposte.
   C'est ce qui distingue la page d'un quiz nu. Sans JavaScript, l'arène reste
   affichée, immobile. */
.qp-quiz { scroll-margin-top: 76px; }
.qp-arena {
  --qp-lunge: clamp(50px, 16vw, 130px);
  position: relative; overflow: hidden;
  margin: -20px -16px 18px;
  aspect-ratio: 16 / 9; max-height: 300px; width: calc(100% + 32px);
  border-radius: calc(var(--kingdom-radius-round) - 1px) calc(var(--kingdom-radius-round) - 1px) 0 0;
  border-bottom: 2px solid var(--kingdom-gold);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--kingdom-stone-0) 50%, transparent) 0%, transparent 30%, transparent 70%, color-mix(in srgb, var(--kingdom-stone-0) 55%, transparent) 100%),
    url('/assets/backgrounds/forest.jpg') center 62% / cover no-repeat,
    var(--kingdom-stone-2);
}
.qp-hud {
  position: absolute; top: 8px; left: 10px; right: 10px; z-index: 4;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 8px;
}
.qp-side { min-width: 0; }
.qp-side--right { text-align: right; }
.qp-name {
  display: inline-block; max-width: 100%; margin-bottom: 4px; padding: 2px 8px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom;
  font-family: var(--kingdom-font-display); font-weight: 600; font-size: 11px; letter-spacing: 0.06em;
  color: var(--kingdom-parchment);
  background: var(--kingdom-stone-2);
  border: 1px solid var(--kingdom-gold-dark); border-radius: var(--kingdom-radius-sharp);
}
.qp-hp {
  position: relative; height: 22px; overflow: hidden;
  background: var(--kingdom-stone-0);
  border: 2px solid var(--kingdom-gold); border-radius: var(--kingdom-radius-pill);
}
.qp-hp i { position: absolute; inset: 0 auto 0 0; width: 100%; transition: width .6s cubic-bezier(.22, .61, .36, 1); }
.qp-side--right .qp-hp i { inset: 0 0 0 auto; }
.qp-hp--you i { background: linear-gradient(180deg, var(--kingdom-difficulty-easy), var(--kingdom-win)); }
.qp-hp--foe i { background: linear-gradient(180deg, var(--kingdom-gold-bright), var(--kingdom-forge)); }
.qp-hp b {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--kingdom-font-display); font-weight: 600; font-size: 12px;
  color: var(--kingdom-steel-bright); text-shadow: 0 1px 3px var(--kingdom-stone-0);
}
.qp-vs {
  display: grid; place-items: center; width: 38px; aspect-ratio: 1; border-radius: 50%;
  font-family: var(--kingdom-font-heading); font-size: 14px; color: var(--kingdom-gold-bright);
  background: radial-gradient(circle at 35% 30%, var(--kingdom-stone-3), var(--kingdom-stone-0));
  border: 2px solid var(--kingdom-gold);
}
.qp-fighter { position: absolute; bottom: 5%; z-index: 2; width: clamp(96px, 34%, 170px); aspect-ratio: 1; }
.qp-fighter img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.45));
  animation: qp-breath 3.4s ease-in-out infinite;
}
.qp-fighter--you { left: 7%; }
.qp-fighter--foe { right: 7%; }
/* `scale` et non transform : la respiration écraserait un scaleX(-1). */
.qp-fighter--you img { scale: -1 1; }
.qp-shadow { position: absolute; left: 14%; right: 14%; bottom: 6%; height: 12%; border-radius: 50%; background: rgba(0, 0, 0, 0.35); filter: blur(5px); }
.qp-fighter--you.is-attack { animation: qp-lunge-r .9s ease-in-out; z-index: 3; }
.qp-fighter--foe.is-attack { animation: qp-lunge-l .9s ease-in-out; z-index: 3; }
.qp-fighter.is-hurt { animation: qp-shake .5s ease-in-out; }
.qp-fighter.is-defeat img { animation: none; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.45)) saturate(.7); }
.qp-pop {
  position: absolute; z-index: 5; bottom: 42%; pointer-events: none;
  font-family: var(--kingdom-font-heading); font-size: clamp(30px, 9vw, 46px); line-height: 1;
  color: var(--kingdom-steel-bright);
  -webkit-text-stroke: 2px var(--kingdom-ink); paint-order: stroke fill;
  text-shadow: 0 3px 0 var(--kingdom-ink), 0 0 18px var(--kingdom-castagne);
  animation: qp-pop 1.4s ease-out forwards;
}
.qp-pop--foe { right: 16%; }
.qp-pop--you { left: 16%; }
@keyframes qp-breath { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2%); } }
@keyframes qp-lunge-r { 0%, 100% { transform: translateX(0); } 40% { transform: translateX(var(--qp-lunge)); } }
@keyframes qp-lunge-l { 0%, 100% { transform: translateX(0); } 40% { transform: translateX(calc(var(--qp-lunge) * -1)); } }
@keyframes qp-shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 45% { transform: translateX(6px); } 70% { transform: translateX(-3px); } }
@keyframes qp-pop { 0% { opacity: 0; transform: translateY(14px) scale(.6); } 18% { opacity: 1; transform: translateY(-6px) scale(1.25); } 100% { opacity: 0; transform: translateY(-58px) scale(1); } }

/* Capture du vrai jeu, sous le quiz. */
.qp-shot { margin: 6px 0 18px; }
.qp-shot img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--kingdom-gold-dark); border-radius: var(--kingdom-radius-md);
  box-shadow: var(--kingdom-shadow-panel);
}
.qp-shot figcaption { margin-top: 8px; font-family: var(--kingdom-font-prose); font-style: italic; font-size: 16px; color: var(--kingdom-parchment-muted); text-align: center; }

@media (max-width: 480px) {
  .qp-shot img { max-width: 250px; margin: 0 auto; }
}
@media (min-width: 481px) {
  .qp-arena { margin: -26px -26px 22px; width: calc(100% + 52px); aspect-ratio: 16 / 6.6; }
  .qp-name { font-size: 12px; }
  .qp-fighter { width: clamp(120px, 24%, 190px); }
  .qp-fighter--you { left: 14%; }
  .qp-fighter--foe { right: 14%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .qp * { animation: none !important; transition: none !important; }
}
