/* ==========================================================================
   KENKEN — PALETTE GÉNÉRÉE (clair + sombre). NE PAS MODIFIER À LA MAIN.
   Source : design/palette.config.js  →  node design/build-palette.js
   Chaque variable existe dans les deux thèmes ; les contrastes de texte sont
   vérifiés (AA) à la génération. Dans les CSS, n'utiliser que ces variables.
   ========================================================================== */

/* Thème clair */
:root,
[data-theme='light'] {
  color-scheme: light;
  --bg: #f9fafe;
  --bg-warm: #fdf8f0;
  --paper: #ffffff;
  --sunk: #f2f3fb;
  --line: #e4e6ef;
  --line-strong: #cdd0de;
  --ink: #1b2139;
  --text: #3c4358;
  --muted: #5e6477;
  --act: #4f46d9;
  --act-hover: #4338be;
  --act-press: #392fa5;
  --act-soft: #eceefe;
  --act-ink: #ffffff;
  --act-text: #4f46d9;
  --act-line: #acb1f0;
  --act-ring: rgba(79, 70, 217, 0.14);
  --hero-bg: #edebfe;
  --hero-ink: #43368e;
  --hero-chip: #ddd9fe;
  --hero-shape: #e7dcff;
  --yellow-bg: #fff2cc;
  --yellow-strong: #754b03;
  --yellow-line: #eed286;
  --gold: #f7ae0c;
  --gold-deep: #b07004;
  --ok-bg: #d4f8da;
  --ok-strong: #13662b;
  --ok-line: #89d298;
  --rev-bg: #fee6ea;
  --rev-strong: #9a2a4f;
  --rev-line: #f2afbd;
  --scrim: rgba(26, 32, 55, 0.55);
  --t-peche-bg: #fee7e0;
  --t-peche-mid: #fecebf;
  --t-peche-disc: #fef6f3;
  --t-peche-strong: #9a3b1b;
  --t-ciel-bg: #dcf0fe;
  --t-ciel-mid: #b7e1fe;
  --t-ciel-disc: #f2f9fe;
  --t-ciel-strong: #046591;
  --t-menthe-bg: #d1f7e9;
  --t-menthe-mid: #aeead6;
  --t-menthe-disc: #ecfcf6;
  --t-menthe-strong: #036e58;
  --t-lavande-bg: #f0e8ff;
  --t-lavande-mid: #e2d1ff;
  --t-lavande-disc: #f9f6ff;
  --t-lavande-strong: #6c479c;
  --t-rose-bg: #ffe5ef;
  --t-rose-mid: #ffc9df;
  --t-rose-disc: #fff5f9;
  --t-rose-strong: #933665;
  --t-sable-bg: #fdebca;
  --t-sable-mid: #f3d7a4;
  --t-sable-disc: #fff7e8;
  --t-sable-strong: #795703;
}

/* Thème sombre */
[data-theme='dark'] {
  color-scheme: dark;
  --bg: #10121c;
  --bg-warm: #191b25;
  --paper: #1a1c2a;
  --sunk: #151723;
  --line: #2c2e3d;
  --line-strong: #3f4256;
  --ink: #f2f3f9;
  --text: #cfd2df;
  --muted: #a5a8bb;
  --act: #a6a8ff;
  --act-hover: #b8bbff;
  --act-press: #9495f6;
  --act-soft: #2c2c54;
  --act-ink: #120f34;
  --act-text: #bec1fe;
  --act-line: #6767b5;
  --act-ring: rgba(166, 168, 255, 0.26);
  --hero-bg: #25233b;
  --hero-ink: #d0cafd;
  --hero-chip: #3a3558;
  --hero-shape: #312b4a;
  --yellow-bg: #382c11;
  --yellow-strong: #f4d88c;
  --yellow-line: #785f28;
  --gold: #f8bd40;
  --gold-deep: #f8bd40;
  --ok-bg: #133621;
  --ok-strong: #93eca6;
  --ok-line: #377249;
  --rev-bg: #43232a;
  --rev-strong: #febcca;
  --rev-line: #984e61;
  --scrim: rgba(2, 3, 9, 0.7);
  --t-peche-bg: #2e201c;
  --t-peche-mid: #452f28;
  --t-peche-disc: #6e3f30;
  --t-peche-strong: #fec0ad;
  --t-ciel-bg: #1a262e;
  --t-ciel-mid: #1c303d;
  --t-ciel-disc: #1a4a66;
  --t-ciel-strong: #a1d9ff;
  --t-menthe-bg: #1a2723;
  --t-menthe-mid: #1b332c;
  --t-menthe-disc: #145041;
  --t-menthe-strong: #95e4cb;
  --t-lavande-bg: #26222d;
  --t-lavande-mid: #312a3d;
  --t-lavande-disc: #4c3b64;
  --t-lavande-strong: #dbc5fe;
  --t-rose-bg: #2d2025;
  --t-rose-mid: #3c2730;
  --t-rose-disc: #613449;
  --t-rose-strong: #febad7;
  --t-sable-bg: #2a2317;
  --t-sable-mid: #4c412c;
  --t-sable-disc: #6f5626;
  --t-sable-strong: #f0cb88;
}

/* Alias : la Bibliothèque a sa propre teinte */
:root { --shelf-bg: var(--t-sable-bg); --shelf-strong: var(--t-sable-strong); }

/* Variantes de la couleur d'action (Réglages) */
[data-variant='prune'] {
  --act: #9323b0;
  --act-hover: #7e1599;
  --act-press: #6d1184;
  --act-soft: #f8e9fd;
  --act-ink: #ffffff;
  --act-text: #9323b0;
  --act-line: #d0a5dd;
  --act-ring: rgba(147, 35, 176, 0.14);
}
[data-theme='dark'][data-variant='prune'] {
  --act: #d499e6;
  --act-hover: #dfadef;
  --act-press: #c684da;
  --act-soft: #402548;
  --act-ink: #23082a;
  --act-text: #e3b3f2;
  --act-line: #8e599f;
  --act-ring: rgba(212, 153, 230, 0.26);
}
[data-variant='lagon'] {
  --act: #066f82;
  --act-hover: #025e6f;
  --act-press: #02515f;
  --act-soft: #daf5fc;
  --act-ink: #ffffff;
  --act-text: #066f82;
  --act-line: #6ec6db;
  --act-ring: rgba(6, 111, 130, 0.14);
}
[data-theme='dark'][data-variant='lagon'] {
  --act: #31c6e4;
  --act-hover: #68d4ed;
  --act-press: #0cb4d2;
  --act-soft: #033843;
  --act-ink: #011a20;
  --act-text: #73d8f0;
  --act-line: #067f94;
  --act-ring: rgba(49, 198, 228, 0.26);
}

/* Teintes d'univers : posées sur un élément, elles exposent --u-bg, --u-mid, --u-disc, --u-strong */
.t-peche { --u-bg: var(--t-peche-bg); --u-mid: var(--t-peche-mid); --u-disc: var(--t-peche-disc); --u-strong: var(--t-peche-strong); }
.t-ciel { --u-bg: var(--t-ciel-bg); --u-mid: var(--t-ciel-mid); --u-disc: var(--t-ciel-disc); --u-strong: var(--t-ciel-strong); }
.t-menthe { --u-bg: var(--t-menthe-bg); --u-mid: var(--t-menthe-mid); --u-disc: var(--t-menthe-disc); --u-strong: var(--t-menthe-strong); }
.t-lavande { --u-bg: var(--t-lavande-bg); --u-mid: var(--t-lavande-mid); --u-disc: var(--t-lavande-disc); --u-strong: var(--t-lavande-strong); }
.t-rose { --u-bg: var(--t-rose-bg); --u-mid: var(--t-rose-mid); --u-disc: var(--t-rose-disc); --u-strong: var(--t-rose-strong); }
.t-sable { --u-bg: var(--t-sable-bg); --u-mid: var(--t-sable-mid); --u-disc: var(--t-sable-disc); --u-strong: var(--t-sable-strong); }

/* Utilitaires : une classe = une couleur juste dans les deux thèmes */
.tx-ink { color: var(--ink); }
.tx-text { color: var(--text); }
.tx-muted { color: var(--muted); }
.tx-act-text { color: var(--act-text); }
.tx-hero-ink { color: var(--hero-ink); }
.tx-yellow-strong { color: var(--yellow-strong); }
.tx-ok-strong { color: var(--ok-strong); }
.tx-rev-strong { color: var(--rev-strong); }
.tx-tint { color: var(--u-strong); }
.bg-bg { background-color: var(--bg); }
.bg-paper { background-color: var(--paper); }
.bg-sunk { background-color: var(--sunk); }
.bg-act-soft { background-color: var(--act-soft); }
.bg-hero-bg { background-color: var(--hero-bg); }
.bg-yellow-bg { background-color: var(--yellow-bg); }
.bg-ok-bg { background-color: var(--ok-bg); }
.bg-rev-bg { background-color: var(--rev-bg); }
.bg-tint { background-color: var(--u-bg); }
