@import url('../fonts/aileron/600.css');

@font-face {
  font-family: 'Astronomicon';
  /* ?v=2 (2026-07-06) : police patchée (cmap format 14 / séquences U+FE0E) pour
     que « glyphe + FE0E » reste rendu par Astronomicon — anti-émoji iPad.
     Le ?v= doit suivre toute future re-modification du fichier (cache).
     ⚠️ Le preload d'index.html doit pointer sur la MÊME URL exactement. */
  src: url('../fonts/astronomicon/astro-symbols.woff2?v=2') format('woff2'),
       url('../fonts/astronomicon/astro-symbols.ttf?v=2')  format('truetype');
  font-weight: normal;
  font-style:  normal;
  font-display: swap;
  unicode-range:
    U+2609, U+263D, U+263F,
    U+2640, U+2642-2647,
    U+2648-2653,
    U+260A-260B,
    U+26B7,
    /* U+FE0E (2026-10-20) : SANS lui, le HTML saute Astronomicon pour les
       grappes « glyphe + FE0E » (le navigateur exige que la face couvre le
       sélecteur) et retombe sur Apple Symbols — Taureau aux cornes collées
       dans l'arbre généalogique alors que les roues (SVG) étaient justes.
       Prouvé par maquettes WebKit. La police couvre FE0E via sa cmap 14. */
    U+FE0E;
}

/* ── Variables ────────────────────────────────────────────────── */
:root {
  /* Surfaces */
  --bg:         #f8f7f4;
  --surface:    #ffffff;
  --header-bg:  #ffffff;
  --block-bg:   #ffffff;
  --block-header-grad: linear-gradient(to bottom, #fefefe, #faf9f6);
  --block-backdrop: none;
  --header-backdrop: none;
  --surface-backdrop: none;
  --modal-overlay: rgba(26,26,46,.45);
  --hover-bg:       #f3f2f8;
  --lib-item-hover: var(--hover-bg);

  /* Text */
  --text:       #1a1a2e;
  --text-muted: #6b6880;

  /* Accents */
  --indigo:     #5c6bc0;
  --indigo-l:   #9fa8da;
  --indigo-hover: #4a5ab3;
  --gold:       #c9a84c;
  --gold-l:     #e8c97a;

  /* Soft pastel signs (kept for legacy references) */
  --fire:       #fce4d6;
  --earth:      #f0ead2;
  --air:        #dce8f5;
  --water:      #d6eae6;

  /* Borders & shadows */
  --border:     #e0ddd4;
  --shadow:     0 2px 12px rgba(26,26,46,.08), 0 1px 3px rgba(26,26,46,.06);
  --shadow-drag:0 8px 32px rgba(26,26,46,.18), 0 2px 8px rgba(26,26,46,.12);
  --radius:     12px;

  /* SVG wheels — read at render time from JS */
  --wheel-bg:              #ffffff;
  --wheel-sector-alpha:    66;  /* = repli historique des moteurs : déclaré pour que le panneau Apparence des roues parte toujours de la vraie valeur du thème */
  /* Opacité du FOND des bandes de dignités. TRIPLE de l'ancienne valeur écrite en
     dur (0x20) sur les thèmes dont les couleurs d'élément ont été éclaircies au
     tiers le 2026-07-31 : par l'algèbre du mélange, une base éclaircie à opacité
     triplée redonne EXACTEMENT le rendu d'avant. Le zodiaque avait reçu cette
     compensation (--wheel-sector-alpha), pas les décans — d'où un fond devenu 3x
     plus pâle, constaté par Mélanie le 2026-08-04. Nocturne garde 20 : ses
     couleurs n'ont jamais été éclaircies. */
  --wheel-decan-alpha: 60;
  --wheel-ring:            #2A2118;
  --wheel-ring-soft:       rgba(42,33,24,0.35);
  --wheel-ring-faint:      rgba(42,33,24,0.15);
  --wheel-ring-very-faint: rgba(42,33,24,0.05);
  --wheel-text-muted:      rgba(42,33,24,0.55);
  --wheel-zodiac-border:   #2A2118; /* classique : contour sombre comme avant */
  --wheel-accent:          #B5453B;

  /* Zodiac element colours (in wheel SVG) */
  --elem-fire:  #E6C1BE;
  --elem-earth: #CED3C3;
  --elem-air:   #E2D8BE;
  --elem-water: #BFCDD4;
  /* Glyphes = couleurs HISTORIQUES du thème, épinglées : rendu par défaut
     identique au pixel près ; la base ci-dessus (claire) sert aux secteurs
     et au curseur « Contraste des glyphes » (point de départ déclaré). */
  --elem-fire-glyph:  #B5453B;
  --elem-earth-glyph: #6B7A4A;
  --elem-air-glyph:   #A88B3B;
  --elem-water-glyph: #3F6A7E;
  --elem-fire-retro:  #B5453B;
  --wheel-glyph-contrast: 48;

  /* Aspect lines (wheel) */
  --asp-opposition: #B5453B;
  --asp-trigone:    #6B7A4A;
  --asp-carre:      #B5453B;
  --asp-sextile:    #A88B3B;

  /* Timeline */
  --tl-bg:              #ffffff;
  --tl-grid:            #ede9e0;
  --tl-date-text:       #b0ada6;
  --tl-natal-head:      #8884a0;
  --tl-glyph-text:      #1a1a2e;
  --tl-legend-text:     #6b6880;
  --tl-now:             #c9a84c;
  --tl-bar-glyph:       #ffffff;
  --tl-asp-conjonction: #e8931a;
  --tl-asp-opposition:  #c94b4b;
  --tl-asp-carre:       #c94b4b;
  --tl-asp-trigone:     #4b7fc9;
  --tl-asp-sextile:     #4ba876;

  /* Wheel planet glow (off in classic theme) */
  --wheel-glow: none;
}

/* ── Liquid Glass theme ──────────────────────────────────────────
   visionOS-inspired dark glass: deep blue-violet background,
   frosted blocks, glacier-blue & soft-violet accents.
─────────────────────────────────────────────────────────────────── */
[data-theme="glass"] {
  /* Surfaces */
  --bg:                #0a0b1a;
  --surface:           rgba(42, 53, 99, 0.62);   /* menus : même marine que les blocs (2026-10-08, avant rgba(30,32,60)) */
  --header-bg:         rgba(30, 39, 80, 0.55);   /* en-tête : marine (2026-10-08, avant rgba(18,20,40)) */
  --block-bg:          rgba(27, 90, 108, 0.22);  /* pétrole, couleur de la tache du fond (essai 2026-10-08 ; avant marine rgba(42,53,99,0.32), à l'origine rgba(30,32,60,0.42)) */
  --block-header-grad: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.015) 100%);
  --block-backdrop:    blur(28px) saturate(160%);
  --header-backdrop:   blur(20px) saturate(160%);
  --surface-backdrop:  blur(24px) saturate(160%);
  --modal-overlay:     rgba(5, 6, 16, 0.65);
  --hover-bg:          rgba(255, 255, 255, 0.06);

  /* Text */
  --text:       #ecebf5;
  --text-muted: #a8a6c2;

  /* Accents */
  --indigo:       #8eb8ff;
  --indigo-l:     rgba(142, 184, 255, 0.55);
  --indigo-hover: #a8c7ff;
  --gold:         #c4a6f0;
  --gold-l:       rgba(196, 166, 240, 0.55);

  /* Pastel sign tints (subtle) */
  --fire:  rgba(255, 140, 110, 0.18);
  --earth: rgba(180, 220, 130, 0.18);
  --air:   rgba(255, 220, 110, 0.18);
  --water: rgba(130, 210, 255, 0.18);

  /* Borders & shadows */
  --border:      rgba(255, 255, 255, 0.13);
  --shadow:      0 4px 32px rgba(0,0,0,0.45), inset 0 0 0 1px rgba(255,255,255,0.04);
  --shadow-drag: 0 16px 56px rgba(0,0,0,0.65), inset 0 0 0 1px rgba(255,255,255,0.10);
  --radius:      18px;

  /* SVG wheels */
  --wheel-bg:              transparent;
  --wheel-sector-alpha:    22;  /* = repli historique des moteurs : déclaré pour que le panneau Apparence des roues parte toujours de la vraie valeur du thème */
  --wheel-decan-alpha: 20;
  --wheel-ring:            #d8dbf0;
  --wheel-ring-soft:       rgba(216, 219, 240, 0.40);
  --wheel-ring-faint:      rgba(216, 219, 240, 0.18);
  --wheel-ring-very-faint: rgba(216, 219, 240, 0.06);
  --wheel-text-muted:      rgba(216, 219, 240, 0.55);
  --wheel-zodiac-border:   #ffffff;
  --wheel-accent:          #c4a6f0;

  /* Phosphorescent element colours */
  --elem-fire:  #ff9b85;
  --elem-earth: #c7e890;
  --elem-air:   #ffe27a;
  --elem-water: #8ad9ff;
  /* Surcharge OBLIGATOIRE : les glyphes/rétro/contraste déclarés dans :root
     (Classique) s'héritent sinon jusqu'ici et écrasent les couleurs claires
     du thème sombre (vécu 2026-07-31 : Nocturne rendu avec les foncés de
     Classique). Glyphes = mêmes couleurs que la base, comme historiquement. */
  --elem-fire-glyph:  #ff9b85;
  --elem-earth-glyph: #c7e890;
  --elem-air-glyph:   #ffe27a;
  --elem-water-glyph: #8ad9ff;
  --elem-fire-retro:  #ff9b85;
  --wheel-glyph-contrast: 0;

  /* Aspect lines */
  --asp-opposition: #ff8a8a;
  --asp-trigone:    #b8e88f;
  --asp-carre:      #ff8a8a;
  --asp-sextile:    #ffe27a;

  /* Timeline — encres SOMBRES d'origine RÉTABLIES le 2026-10-10 (le « tout
     blanc » du 2026-10-05 est devenu l'option Fond blanc du rouage, qui pose
     ses encres claires via timeline.css) */
  --tl-bg:              transparent;
  --tl-grid:            rgba(255, 255, 255, 0.07);
  --tl-date-text:       rgba(236, 235, 245, 0.45);
  --tl-natal-head:      rgba(236, 235, 245, 0.55);
  --tl-glyph-text:      #ecebf5;
  --tl-legend-text:     rgba(236, 235, 245, 0.65);
  --tl-now:             #c4a6f0;
  --tl-bar-glyph:       #ffffff;
  --tl-asp-conjonction: #ffb766;
  --tl-asp-opposition:  #ff8a8a;
  --tl-asp-carre:       #ff8a8a;
  --tl-asp-trigone:     #8eb8ff;
  --tl-asp-sextile:     #95e0b3;

  /* Soft glow for planet glyphs */
  --wheel-glow: drop-shadow(0 0 6px rgba(255,255,255,0.18));
}

/* Glass — body gradient backdrop */
/* Éclairci le 2026-10-08 (retours « trop noir », couleurs choisies par Mélanie) :
   dégradé marine (#2a3563 → #34437a ; haut éclairci depuis #222c58), UNE seule tache bleu-vert pétrole en bas à
   droite (1300×900), fixe, sans grain. La couleur finale (#34437a) couvre toute
   zone hors dégradé (bande basse de l'app iPhone installée, cf. ios-standalone.css).
   Essais du jour : tache mauve rosé (0,585 → 0,50), fond #0a1a36 → #1b5a6c. */
[data-theme="glass"] body {
  background:
    radial-gradient(1200px 800px at 15% 10%, rgba(111, 154, 192, 0.35) 0%, transparent 60%),  /* halo clair haut-gauche (essai) */
    radial-gradient(1300px 900px at 90% 90%, rgba(27, 90, 108, 1) 0%, transparent 55%),
    linear-gradient(180deg, #2a3563 0%, #34437a 100%) #34437a;
  background-attachment: fixed;
}

/* Blocs Nocturne : dégradé marine → pétrole, le fond en miniature (essai C,
   2026-10-08). Posé sur .block seulement : --block-bg reste une COULEUR unie
   (la barre du crayon la passe dans color-mix(), un dégradé l'y casserait ;
   bibliothèque et Feedback la gardent). La frise, blanche par ID, l'emporte. */
[data-theme="glass"] .block:not(.block-in-sidebar):not(.block-in-dock) {
  background: linear-gradient(180deg, rgba(42, 53, 99, 0.30) 0%, rgba(27, 90, 108, 0.45) 100%);  /* haut = bleu nuit du fond, assez couvrant pour se lire ; bas pétrole (1er essai 0.22 → 0.30 invisible) */
}
/* Rangés en bibliothèque ou dans le dock : TOUJOURS UNIS, le bleu nuit du haut
   du dégradé (demande Mélanie 2026-10-08 : pas de dégradé une fois replié). */
[data-theme="glass"] .block.block-in-sidebar,
[data-theme="glass"] .block.block-in-dock {
  background: rgba(42, 53, 99, 0.30);
}

/* ── Lishu theme ─────────────────────────────────────────────────
   Parchement & blush — palette de la page d'accueil.
─────────────────────────────────────────────────────────────────── */
[data-theme="lishu"] {
  /* Surfaces */
  --bg:                #f2ebde;
  --surface:           rgba(255, 250, 240, 0.42);
  --header-bg:         rgba(242, 235, 222, 0.72);
  --block-bg:          rgba(255, 250, 240, 0.42);
  --block-header-grad: linear-gradient(180deg, rgba(255,255,255,0.55) 0%, rgba(255,250,240,0.18) 100%);
  --block-backdrop:    blur(24px) saturate(160%) brightness(104%);
  --header-backdrop:   blur(24px) saturate(160%) brightness(104%);
  --surface-backdrop:  blur(20px) saturate(150%) brightness(104%);
  --modal-overlay:     rgba(31, 26, 20, 0.14);
  --hover-bg:          rgba(255, 250, 240, 0.30);
  --lib-item-hover:    rgba(122, 76, 56, 0.10);

  /* Text */
  --text:       #1f1a14;
  --text-muted: #7a6248;

  /* Accents — terracotta/brun chaud dérivé des blobs pêche */
  --indigo:       #7a4c38;
  --indigo-l:     rgba(122, 76, 56, 0.38);
  --indigo-hover: #6a3e2c;
  --gold:         #a07830;
  --gold-l:       rgba(160, 120, 48, 0.38);

  /* Pastel sign tints */
  --fire:  rgba(246, 213, 194, 0.32);
  --earth: rgba(232, 218, 184, 0.32);
  --air:   rgba(245, 240, 218, 0.32);
  --water: rgba(240, 199, 214, 0.32);

  /* Borders & shadows */
  --border:      rgba(255, 255, 255, 0.48);
  --shadow:      0 4px 32px rgba(31,26,20,0.08), inset 0 0 0 1px rgba(255,255,255,0.68);
  --shadow-drag: 0 16px 56px rgba(31,26,20,0.14), inset 0 0 0 1px rgba(255,255,255,0.82);
  --radius:      18px;

  /* SVG wheels */
  --wheel-bg:              rgba(255, 250, 240, 0.74);
  --wheel-sector-alpha:    42;
  --wheel-decan-alpha: 60;
  --wheel-ring:            #1f1a14;
  --wheel-ring-soft:       rgba(31, 26, 20, 0.35);
  --wheel-ring-faint:      rgba(31, 26, 20, 0.16);
  --wheel-ring-very-faint: rgba(31, 26, 20, 0.06);
  --wheel-text-muted:      rgba(31, 26, 20, 0.48);
  --wheel-zodiac-border:   #ffffff;
  --wheel-accent:          #b06840;

  /* Couleurs éléments */
  --elem-fire:  #E5C4B0;
  --elem-earth: #D8CCAD;
  --elem-air:   #EAD1B9;
  --elem-water: #CDC7D8;
  /* Glyphes = couleurs HISTORIQUES du thème, épinglées : rendu par défaut
     identique au pixel près ; la base ci-dessus (claire) sert aux secteurs
     et au curseur « Contraste des glyphes » (point de départ déclaré). */
  --elem-fire-glyph:  #b05830;
  --elem-earth-glyph: #8a7028;
  --elem-air-glyph:   #c0804a;
  --elem-water-glyph: #6860a8;
  --elem-fire-retro:  #b05830;
  --wheel-glyph-contrast: 43;

  /* Aspect lines */
  --asp-opposition: #a03840;
  --asp-trigone:    #487028;
  --asp-carre:      #a03840;
  --asp-sextile:    #806020;

  /* Timeline */
  --tl-bg:              transparent;   /* fond du thème rétabli 2026-10-10 (le blanc = option du rouage) */
  --tl-grid:            rgba(31, 26, 20, 0.08);
  --tl-date-text:       rgba(31, 26, 20, 0.44);
  --tl-natal-head:      rgba(31, 26, 20, 0.58);
  --tl-glyph-text:      #1f1a14;
  --tl-legend-text:     rgba(31, 26, 20, 0.60);
  --tl-now:             #b06840;
  --tl-bar-glyph:       #ffffff;
  --tl-asp-conjonction: #b86828;
  --tl-asp-opposition:  #a03840;
  --tl-asp-carre:       #a03840;
  --tl-asp-trigone:     #306080;
  --tl-asp-sextile:     #188038;

  --wheel-glow: drop-shadow(0 0 4px rgba(176, 104, 64, 0.28));
}

/* ── Ocean theme ─────────────────────────────────────────────────
   Sable & lagon (Mélanie, 2026-07-31) : fond beige sable, 2 halos
   bleus (lagon + azur, pas de 3e halo), verre dépoli chaud, texte
   encre marine, accents bleu océan. Roues : palette validée par
   Mélanie, secteurs pastel à 52 % (alpha hex 85) + glyphes assombris
   de 51 % (--elem-*-glyph, formule _darken de wheel-colors.js).
─────────────────────────────────────────────────────────────────── */
[data-theme="ocean"] {
  /* Surfaces.
     ⚠️ --bg n'est PAS le fond de page d'Ocean : la page reste sable (#f0e8d8,
     posé en dur sur body plus bas). --bg sert ici de fond aux pilules, champs,
     sélecteurs et surfaces « creusées », éclairci à la demande de Mélanie
     (2026-07-31 : « toutes les pilules où on remplit sont trop foncées »). */
  --bg:                #faf5ea;
  --surface:           rgba(255, 252, 244, 0.42);
  --header-bg:         rgba(240, 232, 216, 0.72);
  --block-bg:          rgba(255, 252, 244, 0.42);
  --block-header-grad: linear-gradient(180deg, rgba(255,255,255,0.55) 0%, rgba(255,252,244,0.18) 100%);
  --block-backdrop:    blur(24px) saturate(160%) brightness(104%);
  --header-backdrop:   blur(24px) saturate(160%) brightness(104%);
  --surface-backdrop:  blur(20px) saturate(150%) brightness(104%);
  --modal-overlay:     rgba(20, 42, 56, 0.16);
  --hover-bg:          rgba(255, 252, 244, 0.30);
  --lib-item-hover:    rgba(46, 95, 120, 0.10);

  /* Text */
  --text:       #1e3a4a;
  --text-muted: #5c7078;

  /* Accents — bleu océan dérivé des halos */
  --indigo:       #2e5f78;
  --indigo-l:     rgba(46, 95, 120, 0.38);
  --indigo-hover: #24506a;
  --gold:         #338196;
  --gold-l:       rgba(51, 129, 150, 0.38);

  /* Pastel sign tints */
  --fire:  rgba(244, 201, 191, 0.32);
  --earth: rgba(219, 228, 198, 0.32);
  --air:   rgba(244, 230, 180, 0.32);
  --water: rgba(102, 154, 184, 0.32);

  /* Borders & shadows */
  --border:      rgba(255, 255, 255, 0.48);
  --shadow:      0 4px 32px rgba(20,42,56,0.08), inset 0 0 0 1px rgba(255,255,255,0.68);
  --shadow-drag: 0 16px 56px rgba(20,42,56,0.14), inset 0 0 0 1px rgba(255,255,255,0.82);
  --radius:      18px;

  /* SVG wheels */
  --wheel-bg:              rgba(255, 252, 244, 0.74);
  --wheel-sector-alpha:    85;
  --wheel-decan-alpha: 60;
  /* Point de départ du curseur « Contraste des glyphes » (lu par wheel-colors.js) :
     Ocean est le premier thème à base pastel, ses glyphes foncés viennent de ce
     contraste et non de la couleur de base. */
  --wheel-glyph-contrast:  54;
  --wheel-ring:            #1e3a4a;
  --wheel-ring-soft:       rgba(30, 58, 74, 0.35);
  --wheel-ring-faint:      rgba(30, 58, 74, 0.16);
  --wheel-ring-very-faint: rgba(30, 58, 74, 0.06);
  --wheel-text-muted:      rgba(30, 58, 74, 0.48);
  --wheel-zodiac-border:   #ffffff;
  --wheel-accent:          #2e5f78;

  /* Couleurs éléments : pastilles 2 des nuanciers + rose Safari de Mélanie
     (secteurs à 52 %, glyphes assombris de 54 %, ses réglages exacts) */
  --elem-fire:  #F9D3E0;
  --elem-earth: #DBE4C6;
  --elem-air:   #F4E6B4;
  --elem-water: #CCDFE8;
  --elem-fire-glyph:  #BA1950;
  --elem-earth-glyph: #70853F;
  --elem-air-glyph:   #AA8A19;
  --elem-water-glyph: #3E728A;
  /* Rétrograde : rouge lisible (le repli par défaut serait le Feu pastel) */
  --elem-fire-retro:  #BA1950;

  /* Aspect lines */
  --asp-opposition: #a03840;
  --asp-trigone:    #487028;
  --asp-carre:      #a03840;
  --asp-sextile:    #806020;

  /* Timeline */
  --tl-bg:              transparent;   /* fond du thème rétabli 2026-10-10 (le blanc = option du rouage) */
  --tl-grid:            rgba(30, 58, 74, 0.08);
  --tl-date-text:       rgba(30, 58, 74, 0.44);
  --tl-natal-head:      rgba(30, 58, 74, 0.58);
  --tl-glyph-text:      #1e3a4a;
  --tl-legend-text:     rgba(30, 58, 74, 0.60);
  --tl-now:             #2e5f78;
  --tl-bar-glyph:       #ffffff;
  --tl-asp-conjonction: #b86828;
  --tl-asp-opposition:  #a03840;
  --tl-asp-carre:       #a03840;
  --tl-asp-trigone:     #306080;
  --tl-asp-sextile:     #188038;

  --wheel-glow: drop-shadow(0 0 4px rgba(46, 95, 120, 0.28));
}

/* ── Aurora theme ────────────────────────────────────────────────
   Fond chaud pêche→rose→mauve, verre blanc dépoli, texte bordeaux.
─────────────────────────────────────────────────────────────────── */
[data-theme="aurora"] {
  /* Surfaces */
  /* 2026-07-19 : rose adouci (#F0B8D4 → #F0D3E1) + saturation du verre baissée
     (160% → 110%, brightness → 100%) — le thème ressortait « fluo » sur iPhone
     (OLED grand gamut) car le verre AMPLIFIAIT la saturation du rose vif. */
  --bg:                #F0D3E1;
  --surface:           rgba(255, 255, 255, 0.28);
  --header-bg:         rgba(255, 255, 255, 0.32);
  --block-bg:          rgba(255, 255, 255, 0.06);
  --block-header-grad: linear-gradient(180deg, rgba(255,255,255,0.40) 0%, rgba(255,255,255,0.08) 100%);
  --block-backdrop:    blur(20px) saturate(110%) brightness(100%);
  --header-backdrop:   blur(24px) saturate(110%) brightness(100%);
  --surface-backdrop:  blur(20px) saturate(110%) brightness(100%);
  --modal-overlay:     rgba(92, 46, 74, 0.18);
  --hover-bg:          rgba(255, 255, 255, 0.22);

  /* Text */
  --text:       #3A1A2A;
  --text-muted: #8A5070;

  /* Accents */
  --indigo:       #8A5070;
  --indigo-l:     rgba(138, 80, 112, 0.45);
  --indigo-hover: #7A4060;
  --gold:         #C47090;
  --gold-l:       rgba(196, 112, 144, 0.45);

  /* Pastel sign tints — utilisées dans les tables */
  --fire:  rgba(242, 196, 176, 0.25);
  --earth: rgba(232, 213, 168, 0.25);
  --air:   rgba(221, 213, 240, 0.25);
  --water: rgba(232, 196, 216, 0.25);

  /* Borders & shadows */
  --border:      rgba(255, 255, 255, 0.38);
  --shadow:      0 4px 32px rgba(58,26,42,0.10), inset 0 0 0 1px rgba(255,255,255,0.60);
  --shadow-drag: 0 16px 56px rgba(58,26,42,0.18), inset 0 0 0 1px rgba(255,255,255,0.75);
  --radius:      18px;

  /* SVG wheels */
  --wheel-bg:              rgba(255, 255, 255, 0.70);
  --wheel-sector-alpha:    48;
  --wheel-decan-alpha: 60;
  --wheel-ring:            #3A1A2A;
  --wheel-ring-soft:       rgba(58, 26, 42, 0.35);
  --wheel-ring-faint:      rgba(58, 26, 42, 0.16);
  --wheel-ring-very-faint: rgba(58, 26, 42, 0.06);
  --wheel-text-muted:      rgba(58, 26, 42, 0.50);
  --wheel-zodiac-border:   #ffffff;
  --wheel-accent:          #C47090;

  /* Couleurs éléments — secteurs + glyphes */
  --elem-fire:  #E5C7D5;
  --elem-earth: #E2D9BA;
  --elem-air:   #F1D2C3;
  --elem-water: #D2CDEA;
  /* Glyphes = couleurs HISTORIQUES du thème, épinglées : rendu par défaut
     identique au pixel près ; la base ci-dessus (claire) sert aux secteurs
     et au curseur « Contraste des glyphes » (point de départ déclaré). */
  --elem-fire-glyph:  #B05880;
  --elem-earth-glyph: #A88C30;
  --elem-air-glyph:   #D4784A;
  --elem-water-glyph: #7868C0;
  --elem-fire-retro:  #B05880;
  --wheel-glyph-contrast: 38;

  /* Aspect lines */
  --asp-opposition: #c03060;
  --asp-trigone:    #307020;
  --asp-carre:      #c03060;
  --asp-sextile:    #8a6010;

  /* Timeline */
  --tl-bg:              transparent;   /* fond du thème rétabli 2026-10-10 (le blanc = option du rouage) */
  --tl-grid:            rgba(92, 46, 74, 0.10);
  --tl-date-text:       rgba(92, 46, 74, 0.48);
  --tl-natal-head:      rgba(92, 46, 74, 0.62);
  --tl-glyph-text:      #5C2E4A;
  --tl-legend-text:     rgba(92, 46, 74, 0.65);
  --tl-now:             #C47090;
  --tl-bar-glyph:       #ffffff;
  --tl-asp-conjonction: #d06020;
  --tl-asp-opposition:  #c03060;
  --tl-asp-carre:       #c03060;
  --tl-asp-trigone:     #306090;
  --tl-asp-sextile:     #187040;

  --wheel-glow: drop-shadow(0 0 4px rgba(196, 112, 144, 0.35));
}

/* ── Forest ───────────────────────────────────────────────────── */
[data-theme="forest"] {
  /* Surfaces — base crème chaude #F0E9DB au lieu du blanc pur */
  --bg:                #D4E8C8;
  --surface:           rgba(240, 233, 219, 0.30);
  --header-bg:         rgba(240, 233, 219, 0.38);
  --block-bg:          rgba(240, 233, 219, 0.14);
  --block-header-grad: linear-gradient(180deg, rgba(240,233,219,0.50) 0%, rgba(240,233,219,0.10) 100%);
  --block-backdrop:    blur(20px) saturate(140%) brightness(105%);
  --header-backdrop:   blur(24px) saturate(140%) brightness(105%);
  --surface-backdrop:  blur(20px) saturate(140%) brightness(104%);
  --modal-overlay:     rgba(45, 74, 53, 0.18);
  --hover-bg:          rgba(240, 233, 219, 0.28);

  /* Text */
  --text:       #2D4A35;
  --text-muted: #4F7358;   /* était #8AAA90 (contraste 1,96 sur le fond, « presque grisé » — Mélanie 2026-10-13) → 4,1, dans la ligne des autres thèmes (4,4 à 5) */

  /* Accents */
  --indigo:       #4A7A58;
  --indigo-l:     rgba(74, 122, 88, 0.45);
  --indigo-hover: #3A6A48;
  --gold:         #6A9A72;
  --gold-l:       rgba(106, 154, 114, 0.45);

  /* Pastel sign tints — utilisées dans les tables */
  --fire:  rgba(212, 168, 152, 0.25);
  --earth: rgba(184, 200, 154, 0.25);
  --air:   rgba(168, 200, 192, 0.25);
  --water: rgba(168, 184, 212, 0.25);

  /* Borders & shadows */
  --border:      rgba(255, 255, 255, 0.38);
  --shadow:      0 4px 32px rgba(45,74,53,0.10), inset 0 0 0 1px rgba(255,255,255,0.60);
  --shadow-drag: 0 16px 56px rgba(45,74,53,0.18), inset 0 0 0 1px rgba(255,255,255,0.75);
  --radius:      18px;

  /* SVG wheels */
  --wheel-bg:              rgba(240, 233, 219, 0.72);
  --wheel-sector-alpha:    90;
  --wheel-decan-alpha: 60;
  --wheel-ring:            #2D4A35;
  --wheel-ring-soft:       rgba(45, 74, 53, 0.35);
  --wheel-ring-faint:      rgba(45, 74, 53, 0.16);
  --wheel-ring-very-faint: rgba(45, 74, 53, 0.06);
  --wheel-text-muted:      rgba(45, 74, 53, 0.50);
  --wheel-zodiac-border:   #ffffff;
  --wheel-accent:          #5A7A62;

  /* Couleurs éléments — secteurs + glyphes */
  --elem-fire:  #DBB9BD;
  --elem-earth: #D8CAA2;
  --elem-air:   #E7C3AB;
  --elem-water: #C8BED2;
  /* Glyphes = couleurs HISTORIQUES du thème, épinglées : rendu par défaut
     identique au pixel près ; la base ci-dessus (claire) sert aux secteurs
     et au curseur « Contraste des glyphes » (point de départ déclaré). */
  --elem-fire-glyph:  #B05880;
  --elem-earth-glyph: #A88C30;
  --elem-air-glyph:   #D4784A;
  --elem-water-glyph: #7868C0;
  --elem-fire-retro:  #B05880;
  --wheel-glyph-contrast: 33;

  /* Aspect lines */
  --asp-opposition: #A04040;
  --asp-trigone:    #4A8060;
  --asp-carre:      #A04040;
  --asp-sextile:    #808040;

  /* Timeline */
  --tl-bg:              transparent;   /* fond du thème rétabli 2026-10-10 (le blanc = option du rouage) */
  --tl-grid:            rgba(45, 74, 53, 0.10);
  --tl-date-text:       rgba(45, 74, 53, 0.48);
  --tl-natal-head:      rgba(45, 74, 53, 0.62);
  --tl-glyph-text:      #2D4A35;
  --tl-legend-text:     rgba(45, 74, 53, 0.65);
  --tl-now:             #5A7A62;
  --tl-bar-glyph:       #ffffff;
  --tl-asp-conjonction: #C06030;
  --tl-asp-opposition:  #A04040;
  --tl-asp-carre:       #A04040;
  --tl-asp-trigone:     #3A7060;
  --tl-asp-sextile:     #507040;

  --wheel-glow: drop-shadow(0 0 4px rgba(74, 122, 88, 0.35));
}

/* Forest — sauge végétal haut-gauche, aqua bas-droit */
[data-theme="forest"] body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 60% 95%, rgba(200, 221, 212, 0.55) 0%, transparent 70%),
    radial-gradient(ellipse 65% 42% at 20% 5%, rgba(232, 240, 220, 0.52) 0%, transparent 62%),
    linear-gradient(160deg, #E8F0DC 0%, #D4E8C8 40%, #C8DDD4 70%, #C0D8D0 100%);
}

/* Lishu — fond de base crème */
[data-theme="lishu"] body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: #f2ebde;
}

/* Ocean — fond de base sable (body posé en dur : --bg est réservé aux
   pilules/champs, plus clair que la page, cf. bloc de variables) */
[data-theme="ocean"] body { background: #f0e8d8; }
[data-theme="ocean"] body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: #f0e8d8;
}

/* Lishu — blobs animés (même ambiance que la page login) */
#lishu-bg {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
[data-theme="lishu"] #lishu-bg { display: block; }
/* Ocean réutilise le même conteneur de blobs, en bleus (voir plus bas) */
[data-theme="ocean"] #lishu-bg { display: block; }

[data-theme="lishu"] .lishu-blob,
[data-theme="ocean"] .lishu-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.85;
  will-change: transform;
}
[data-theme="lishu"] .lishu-blob-a {
  width: 60%; aspect-ratio: 1;
  left: -10%; top: -15%;
  background: #f6d5c2;
  animation: lishu-drift-a 22s ease-in-out infinite alternate;
}
[data-theme="lishu"] .lishu-blob-b {
  width: 55%; aspect-ratio: 1;
  right: -10%; bottom: -20%;
  background: #f0c7d6;
  animation: lishu-drift-b 28s ease-in-out infinite alternate;
}
[data-theme="lishu"] .lishu-blob-c {
  width: 40%; aspect-ratio: 1;
  left: 35%; top: 40%;
  background: #e8dab8;
  filter: blur(90px);
  opacity: 0.55;
  animation: lishu-drift-c 36s ease-in-out infinite alternate;
}
/* Ocean — mêmes blobs animés, en bleus ; 2 halos seulement (décision Mélanie) */
[data-theme="ocean"] .lishu-blob-a {
  width: 60%; aspect-ratio: 1;
  left: -10%; top: -15%;
  background: #bfe2ea;   /* halo lagon */
  animation: lishu-drift-a 22s ease-in-out infinite alternate;
}
[data-theme="ocean"] .lishu-blob-b {
  width: 55%; aspect-ratio: 1;
  right: -10%; bottom: -20%;
  background: #afceec;   /* halo azur */
  animation: lishu-drift-b 28s ease-in-out infinite alternate;
}
[data-theme="ocean"] .lishu-blob-c { display: none; }

/* Grain (bruit feTurbulence teinté, multiply 32 %) : RETIRÉ le 2026-10-13 —
   d'Océan après essai en console, puis de Lishu dans la foulée (décision
   Mélanie : « on lève le grain sur Lishu aussi »). Le <span class="lishu-grain">
   d'index.html reste, inerte. Pour le remettre : règle d'avant dans git
   (commit du 2026-10-13 matin, avant cette suppression). */
@keyframes lishu-drift-a {
  from { transform: translate3d(0,0,0) scale(1); }
  to   { transform: translate3d(8%,6%,0) scale(1.12); }
}
@keyframes lishu-drift-b {
  from { transform: translate3d(0,0,0) scale(1); }
  to   { transform: translate3d(-6%,-8%,0) scale(1.15); }
}
@keyframes lishu-drift-c {
  from { transform: translate3d(0,0,0) scale(0.9); }
  to   { transform: translate3d(-10%,4%,0) scale(1.05); }
}
@media (prefers-reduced-motion: reduce) {
  .lishu-blob { animation: none !important; }
}

/* Aurora — pêche doux puis rose, mi-chemin entre les deux versions */
[data-theme="aurora"] body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 60% 95%, rgba(253, 210, 160, 0.55) 0%, transparent 70%),
    radial-gradient(ellipse 65% 42% at 20% 5%, rgba(253, 215, 168, 0.52) 0%, transparent 62%),
    linear-gradient(160deg, #F9C5C5 0%, #F5BCC8 40%, #F0B8D4 70%, #ECC0D6 100%);
}

