/* ============================================================================
   THÈMES — choisis dans les Paramètres, posés sur <html data-theme="…">.
   Le thème par défaut (Tempête) vit dans theme.css. Chaque bloc redéfinit
   toutes les variables : les vignettes de l'écran Paramètres portent leur
   propre data-theme au milieu d'une page habillée d'un autre, et une
   variable oubliée y viendrait du thème de la page.
   ============================================================================ */

/* Parchemin — carte au trésor : fond clair, encre brune, cire rouge. */
[data-theme="parchemin"] {
  --ink: #2b1d10; --ink-dim: #4f3b26; --ink-faded: #85705a;
  --bg-deep: #e6d6b4; --bg-mid: #efe2c4; --bg-card: #f6ecd4; --bg-card-hi: #fbf4e2;
  --gold: #8a5a2b; --gold-bright: #7a3b12; --gold-glow: #b5651d; --ember: #a3341f;
  --blood: #8e2f1c; --blood-bright: #a8261a; --parchment: #c4a677;
  --border: #cdb88f; --border-gold: rgba(122, 59, 18, 0.35);
  --btn-face: linear-gradient(180deg, #fbf3df 0%, #efe1c0 100%);
  --btn-lift: 0 1px 3px rgba(80, 50, 20, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  --btn-sel: linear-gradient(180deg, #ecd1a6 0%, #dcb27a 100%);
  --btn-sel-lift: 0 1px 3px rgba(80, 50, 20, 0.3), inset 0 1px 0 rgba(255, 240, 210, 0.7);
  --btn-face-pari: linear-gradient(180deg, #f4e3c1 0%, #e9d1a4 100%);
  --btn-face-plis: linear-gradient(180deg, #f4dbd0 0%, #e9c1b0 100%);
  --ink-pari: #6b4310; --ink-plis: #7d2414; --ink-plis-titre: #a8261a;
  --font-title: 'IM Fell English SC', Georgia, serif;

  --page-bg:
    radial-gradient(ellipse at top, rgba(255, 252, 240, 0.55) 0%, transparent 60%),
    radial-gradient(ellipse at bottom, rgba(140, 90, 40, 0.2) 0%, transparent 60%),
    linear-gradient(180deg, #e9dab9 0%, #f1e5c9 50%, #e4d2ad 100%);
  --page-glow: radial-gradient(ellipse at 50% 0%, rgba(255, 250, 235, 0.6) 0%, transparent 70%);
  --page-grain: 0.2;
  --page-grain-blend: multiply;
  /* Titre à l'encre pleine : un dégradé d'une seule couleur garde le
     découpage du texte commun à tous les thèmes. */
  --title-fill: linear-gradient(#5a2a0c, #5a2a0c);
  --title-shadow: none;
  --title-filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.6));
  --glow-text: none;
  --panel-bg: linear-gradient(180deg, #f8efd9 0%, #f1e3c3 100%);
  --panel-shadow: 0 2px 8px rgba(90, 60, 25, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  --panel-line: #9a5a17;
  --corner-filter: none;
  --corner-opacity: 0.6;
  --field-bg: #fffaf0;
  --field-shadow: inset 0 1px 3px rgba(80, 50, 20, 0.25);
  --pill-bg: rgba(122, 59, 18, 0.12);
  --creux: rgba(90, 60, 25, 0.12);
  --erreur-ink: #8e1c10;
  --primary-face: linear-gradient(180deg, #a8261a 0%, #7c1a10 100%);
  --primary-ink: #fff4e6;
  --primary-text-shadow: none;
  --primary-lift: 0 2px 4px rgba(80, 20, 10, 0.35), inset 0 1px 0 rgba(255, 200, 180, 0.4);
  --sel-pari: linear-gradient(180deg, #c9822f 0%, #9a5a17 100%);
  --sel-pari-ink: #fff8ec;
  --sel-pari-text-shadow: none;
  --sel-pari-lift: 0 1px 3px rgba(80, 40, 10, 0.4);
  --sel-plis: linear-gradient(180deg, #b8321f 0%, #8a1d10 100%);
  --sel-plis-ink: #fff4ee;
  --sel-plis-text-shadow: none;
  --sel-plis-lift: 0 1px 3px rgba(80, 20, 10, 0.4);
}

/* Abysses — nuit en mer : sarcelle profonde, laiton pour le pari, corail
   pour les plis. */
[data-theme="abysses"] {
  --ink: #e4efec; --ink-dim: #a9c2bf; --ink-faded: #6a8a8a;
  --bg-deep: #04121a; --bg-mid: #082029; --bg-card: #0c2a35; --bg-card-hi: #123744;
  --gold: #9f8a4e; --gold-bright: #d9bd6a; --gold-glow: #e8cf7a; --ember: #2fa39a;
  --blood: #7a2a2a; --blood-bright: #ee6a55; --parchment: #c4a677;
  --border: #1f4652; --border-gold: rgba(217, 189, 106, 0.4);
  --btn-face: linear-gradient(180deg, #123744 0%, #0b2833 100%);
  --btn-lift: 0 2px 6px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(200, 240, 235, 0.08);
  --btn-sel: linear-gradient(180deg, #1f6f6a 0%, #145350 100%);
  --btn-sel-lift: 0 2px 6px rgba(0, 0, 0, 0.45), 0 0 16px rgba(47, 163, 154, 0.3), inset 0 1px 0 rgba(180, 255, 240, 0.18);
  --btn-face-pari: linear-gradient(180deg, #38331f 0%, #262214 100%);
  --btn-face-plis: linear-gradient(180deg, #4a1f22 0%, #311416 100%);
  --ink-pari: #e3cf8f; --ink-plis: #f2b3a9; --ink-plis-titre: #ee7d6c;
  --font-title: 'Pirata One', cursive;

  --page-bg:
    radial-gradient(ellipse at top, rgba(47, 163, 154, 0.16) 0%, transparent 55%),
    radial-gradient(ellipse at bottom, rgba(10, 40, 70, 0.5) 0%, transparent 60%),
    linear-gradient(180deg, #04121a 0%, #082029 50%, #04121a 100%);
  --page-glow: radial-gradient(ellipse at 50% 0%, rgba(80, 200, 190, 0.14) 0%, transparent 70%);
  --page-grain: 0.12;
  --page-grain-blend: normal;
  /* L'ombre de texte passerait par-dessus le dégradé : seul le filtre reste. */
  --title-fill: linear-gradient(180deg, #f6e7b0 0%, #d9bd6a 45%, #8a6f2c 100%);
  --title-shadow: none;
  --title-filter: drop-shadow(0 2px 0 #02090d) drop-shadow(0 0 12px rgba(47, 163, 154, 0.35));
  --glow-text: 0 0 16px rgba(217, 189, 106, 0.35), 0 1px 0 rgba(0, 0, 0, 0.6);
  --panel-bg: linear-gradient(180deg, #0c2a35 0%, #082029 100%);
  --panel-shadow: 0 4px 16px rgba(0, 0, 0, 0.6), 0 0 30px rgba(47, 163, 154, 0.06), inset 0 1px 0 rgba(180, 255, 240, 0.06);
  --panel-line: #d9bd6a;
  --corner-filter: none;
  --corner-opacity: 0.6;
  --field-bg: #04121a;
  --field-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
  --pill-bg: rgba(217, 189, 106, 0.14);
  --creux: rgba(0, 0, 0, 0.35);
  --erreur-ink: #ffd9cd;
  --primary-face: linear-gradient(180deg, #ecd486 0%, #b8953a 70%, #7a5f1c 100%);
  --primary-ink: #1d1806;
  --primary-text-shadow: none;
  --primary-lift: 0 2px 0 rgba(0, 0, 0, 0.5), 0 0 24px rgba(217, 189, 106, 0.3), inset 0 1px 0 rgba(255, 245, 200, 0.5);
  --sel-pari: linear-gradient(180deg, #ecd486 0%, #b8953a 100%);
  --sel-pari-ink: #1d1806;
  --sel-pari-text-shadow: none;
  --sel-pari-lift: 0 2px 7px rgba(0, 0, 0, 0.5), 0 0 16px rgba(217, 189, 106, 0.45);
  --sel-plis: linear-gradient(180deg, #f07a62 0%, #b83a2a 100%);
  --sel-plis-ink: #fff4f0;
  --sel-plis-text-shadow: none;
  --sel-plis-lift: 0 2px 7px rgba(0, 0, 0, 0.5), 0 0 16px rgba(238, 106, 85, 0.45);
}

/* Pavillon noir — contraste franc : noir, os, rouge sang. Rien ne brille. */
[data-theme="pavillon"] {
  --ink: #f3eee2; --ink-dim: #cfc8b8; --ink-faded: #8a8478;
  --bg-deep: #050505; --bg-mid: #0c0c0c; --bg-card: #131313; --bg-card-hi: #1d1d1d;
  --gold: #bdb5a2; --gold-bright: #f3eee2; --gold-glow: #ffffff; --ember: #d4231a;
  --blood: #8f1610; --blood-bright: #e2342a; --parchment: #c4a677;
  --border: #2c2c2c; --border-gold: rgba(243, 238, 226, 0.25);
  --btn-face: linear-gradient(180deg, #1e1e1e 0%, #151515 100%);
  --btn-lift: 0 2px 4px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --btn-sel: linear-gradient(180deg, #3a3a3a 0%, #2a2a2a 100%);
  --btn-sel-lift: 0 2px 4px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(243, 238, 226, 0.5);
  --btn-face-pari: linear-gradient(180deg, #262421 0%, #1b1a18 100%);
  --btn-face-plis: linear-gradient(180deg, #3a1210 0%, #260c0a 100%);
  --ink-pari: #e9e2d0; --ink-plis: #f4a59c; --ink-plis-titre: #e2342a;
  --font-title: 'Pirata One', cursive;

  --page-bg: radial-gradient(ellipse at 50% 30%, #121212 0%, #050505 75%);
  --page-glow: none;
  --page-grain: 0.08;
  --page-grain-blend: normal;
  --title-fill: linear-gradient(#f3eee2, #f3eee2);
  --title-shadow: none;
  --title-filter: drop-shadow(0 2px 0 #000);
  --glow-text: none;
  --panel-bg: #111;
  --panel-shadow: 0 4px 14px rgba(0, 0, 0, 0.7);
  --panel-line: #e2342a;
  --corner-filter: grayscale(1) brightness(1.9);
  --corner-opacity: 0.3;
  --field-bg: #050505;
  --field-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6), inset 0 0 0 1px #222;
  --pill-bg: rgba(243, 238, 226, 0.1);
  --creux: rgba(255, 255, 255, 0.06);
  --erreur-ink: #ffd9cd;
  --primary-face: #d4231a;
  --primary-ink: #fff;
  --primary-text-shadow: none;
  --primary-lift: 0 2px 0 rgba(0, 0, 0, 0.6), 0 0 20px rgba(212, 35, 26, 0.35);
  --sel-pari: #f3eee2;
  --sel-pari-ink: #0a0a0a;
  --sel-pari-text-shadow: none;
  --sel-pari-lift: 0 2px 6px rgba(0, 0, 0, 0.6);
  --sel-plis: #e2342a;
  --sel-plis-ink: #fff;
  --sel-plis-text-shadow: none;
  --sel-plis-lift: 0 2px 6px rgba(0, 0, 0, 0.6), 0 0 14px rgba(226, 52, 42, 0.45);
}
