/* Design tokens — single source of truth for the whole app.
   Imported first by styles.css (and read by the u-* utility layer), so colours,
   spacing, radius, elevation and interaction primitives live in one place.
   The dark theme only redefines the handful of tokens that differ; everything
   else (accents, spacing, radius…) is shared between light and dark. */

:root {
  color-scheme: light; /* native controls/scrollbars follow the effective theme */
  /* ---- palette ---- */
  --teal: #2ba8a2;
  --teal-light: #3cc4bd;
  --teal-dark: #1e8c86;
  --teal-bg: #e8f6f5;
  --teal-ink: #156a65; /* --teal-dark assombri, texte sur teinte teal */
  --teal-ink-deep: #0d4f4b;
  --teal-hover-dark: #5ad3cc; /* survol des pastilles pleines en sombre */

  --gold: #ffd23f;
  --gold-light: #ffe47a;
  --gold-dark: #e6b800;

  /* Triplets RGB des couleurs de marque, pour les rgba() transparents de
     styles.css (lueurs, teintes). Valeurs du thème clair, partagées par le
     sombre ; un thème de saison (seasons.css) les redéfinit. */
  --teal-rgb: 43, 168, 162;
  --teal-light-rgb: 60, 196, 189;
  --teal-dark-rgb: 30, 140, 134;
  --gold-rgb: 255, 210, 63;
  --gold-dark-rgb: 230, 184, 0;

  --coral: #ef6c4a;
  --coral-light: #ff8a6a;
  --coral-dark: #d45233;

  --cream: #fff8e7;
  --sky: #5dade2;
  --sky-dark: #3d8fc4;

  /* Flip 7 Vengeance accent */
  --vengeance: #3631a0; /* lighter gradient stop */
  --vengeance-dark: #242074; /* base / border */
  --vengeance-glow: rgba(36, 32, 116, 0.45);

  /* Flip 7 (classic) accent */
  --classic: #009da2; /* lighter gradient stop / base */
  --classic-dark: #007a7e; /* darker stop / border */
  --classic-glow: rgba(0, 157, 162, 0.45);

  /* Skyjo accent */
  --skyjo: #51b47c; /* lighter gradient stop / base */
  --skyjo-dark: #3a8a5c; /* darker stop / border */
  --skyjo-glow: rgba(81, 180, 124, 0.45);

  /* Speed Bac accent (orange de la boîte) */
  --speedbac: #ef7d22; /* lighter gradient stop / base */
  --speedbac-dark: #c45f0f; /* darker stop / border */
  --speedbac-glow: rgba(239, 125, 34, 0.45);

  /* Non merci ! accent (bleu clair de la boîte) */
  --nothanks: #68c5d3;
  --nothanks-dark: #3f9aa9;
  --nothanks-glow: rgba(104, 197, 211, 0.45);

  /* Dékal accent (violet) */
  --dekal: #7a4dc8;
  --dekal-dark: #5a3699;
  --dekal-glow: rgba(122, 77, 200, 0.45);

  /* 6 qui prend ! accent (rouge cramoisi, plus profond que le Ligretto) */
  --sixquiprend: #c8102e;
  --sixquiprend-dark: #9a0c23;
  --sixquiprend-glow: rgba(200, 16, 46, 0.45);

  /* Ligretto accent (rouge, choix de Lucas) */
  --ligretto: #d12c18;
  --ligretto-dark: #a82212;
  --ligretto-glow: rgba(209, 44, 24, 0.45);

  /* Time's Up! accent (yellow — needs dark text) */
  --timesup: #fcdd0b; /* lighter gradient stop / base */
  --timesup-dark: #d4b800; /* darker stop / border */
  --timesup-glow: rgba(252, 221, 11, 0.45);

  /* Qwirkle accent */
  --qwirkle: #c5191c; /* lighter gradient stop / base */
  --qwirkle-dark: #9c1316; /* darker stop / border */
  --qwirkle-glow: rgba(197, 25, 28, 0.45);

  /* Contrée accent */
  --contree: #6f9e69; /* lighter gradient stop / base */
  --contree-dark: #577e52; /* darker stop / border */
  --contree-glow: rgba(111, 158, 105, 0.45);

  /* Yams accent */
  --yams: #d82d21; /* lighter gradient stop / base */
  --yams-dark: #ab2019; /* darker stop / border */
  --yams-glow: rgba(216, 45, 33, 0.45);

  /* Bombu accent */
  --bombu: #1375c4; /* lighter gradient stop / base */
  --bombu-dark: #0f5a97; /* darker stop / border */
  --bombu-glow: rgba(19, 117, 196, 0.45);

  /* Loup-Garou accent */
  --werewolf: #b32d1b; /* lighter gradient stop / base */
  --werewolf-dark: #8a2114; /* darker stop / border */
  --werewolf-glow: rgba(179, 45, 27, 0.45);

  /* Fléchettes accent */
  --darts: #2e8b57; /* lighter gradient stop / base */
  --darts-dark: #236b43; /* darker stop / border */
  --darts-glow: rgba(46, 139, 87, 0.45);

  /* Pétanque accent (gris acier des boules) */
  --petanque: #5f6575; /* lighter gradient stop / base */
  --petanque-dark: #474c59; /* darker stop / border */
  --petanque-glow: rgba(95, 101, 117, 0.45);

  /* Mölkky accent (bois clair des quilles — fond clair, texte sombre) */
  /* Badminton accent (vert) */
  --badminton: #73b695;
  --badminton-dark: #528f71;
  --badminton-glow: rgba(115, 182, 149, 0.45);

  /* Mouton Mouton accent (jaune — needs dark text) */
  --mouton: #ffda00;
  --mouton-dark: #d4b500;
  --mouton-glow: rgba(255, 218, 0, 0.45);

  --molkky: #f4d9bc; /* lighter gradient stop / base */
  --molkky-dark: #d9b28a; /* darker stop / border */
  --molkky-glow: rgba(244, 217, 188, 0.45);

  /* Cible de fléchettes (SVG) — couleurs thémables. La cible importée porte des
     classes .cls-1..5 (rouge / lits blancs / lits noirs / vert / chiffres) ;
     styles.css les remappe sur ces tokens pour suivre le thème. */
  --db-red: #ed1c24; /* doubles/triples rouges */
  --db-green: #009444; /* doubles/triples verts */
  --db-bed-light: #f3e9cf; /* lits clairs ("blancs") */
  --db-bed-dark: #262626; /* lits sombres ("noirs") */
  --db-number: #ffffff; /* chiffres autour de la cible */
  --db-wire: #1a1a1a; /* fil / contours */

  --surface: #eff8f7; /* page bg */
  --card: #ffffff; /* card bg */
  --topbar-bg: rgba(255, 248, 231, 0.7); /* barre du haut, translucide */
  --raised-dark: #25453f; /* sombre : lignes surélevées (saisie) */
  --scrim-rgb: 30, 60, 58; /* voile des dialogs / exploits (rgba(var(--scrim-rgb), a)) */
  --overlay-floor: #91a3a2; /* fond de <html> sous le voile (bande safe-area) */
  --well-dark: #102220; /* sombre : champs en creux */

  --success: #27ae60;
  --success-dark: #1e8e4e;
  --error: #e74c3c;

  /* text / ink */
  --text: #1e3a38;
  --muted: #6b8b88;
  --ink: #233038; /* retro outline / borders on cream */

  /* ---- type scale ----
     Toutes les tailles de texte fixes de l'app en viennent (styles.css). Les
     tailles relatives (em) et fluides (clamp) des écrans de score et du
     copilote restent proportionnelles à leur conteneur. */
  --fs-3xs: 0.625rem; /* 10px — micro-étiquettes (beta, tags) */
  --fs-2xs: 0.6875rem; /* 11px — capitales espacées, pastilles */
  --fs-xs: 0.75rem; /* 12px — légendes, badges */
  --fs-sm: 0.875rem; /* 14px — texte secondaire, boutons compacts, dialogs */
  --fs-md: 1rem; /* 16px — texte courant */
  --fs-lg: 1.125rem; /* 18px — titres de carte */
  --fs-xl: 1.25rem; /* 20px — titres de section */
  --fs-2xl: 1.5rem; /* 24px — titres d'écran, valeurs en avant */
  --fs-3xl: 2rem; /* 32px — grands chiffres */

  /* ---- radius ---- */
  --r-sm: 0.375rem; /* 6px */
  --r-md: 0.75rem; /* 12px */
  --r-lg: 1rem; /* 16px */
  --r-xl: 1.375rem; /* 22px */
  --r-round: 62.5rem; /* pill */

  /* ---- spacing ---- */
  --xs: 0.25rem; /* 4px */
  --sm: 0.5rem; /* 8px */
  --md: 0.75rem; /* 12px */
  --lg: 1rem; /* 16px */
  --xl: 1.5rem; /* 24px */

  /* ---- elevation: colored glow system ---- */
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.16);
  --shadow-card: 0 2px 10px rgba(var(--teal-rgb), 0.1);
  --shadow-coral-glow: 0 2px 10px rgba(239, 108, 74, 0.35);
  --shadow-teal-glow: 0 2px 10px rgba(var(--teal-rgb), 0.3);
  --shadow-accent-glow: 0 2px 10px rgba(var(--gold-rgb), 0.4);
  --shadow-sky-glow: 0 2px 8px rgba(93, 173, 226, 0.3);
  --shadow-focus: 0 0 0 4px rgba(var(--teal-rgb), 0.15);

  --bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* ---- interaction primitives (shared hover / press / tab transition) ---- */
  --hover-bright: brightness(1.04); /* filter on hover for tabs & buttons */
  --press-scale: scale(0.96); /* transform on :active press */
  --transition-tab: transform 0.12s var(--bounce), filter 0.15s ease;
}

/* Dark theme: only the tokens that differ. Higher specificity than :root, so it
   wins regardless of source order. */
html.theme-dark {
  color-scheme: dark; /* dark native controls/scrollbars */
  --surface: #0c1a18; /* page background (darkest) */
  --card: #18322e; /* cards / panels — a clear step above the page */
  --cream: #22423d; /* "cream" surfaces: inputs, pills — lighter, they pop */
  --teal-bg: #163330; /* subtle teal tint: subtotal rows, badges */

  --text: #e9f5f3;
  --muted: #9bb7b3;
  --teal-dark: #54d1ca; /* dark-text accent → bright so it reads on dark */
  --topbar-bg: rgba(20, 40, 37, 0.72);
  --overlay-floor: #142927; /* même voile, calculé sur le --surface sombre */

  /* deeper shadows for separation against the dark background */
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 6px 24px rgba(0, 0, 0, 0.6);
  --shadow-card: 0 2px 10px rgba(0, 0, 0, 0.45);

  /* dartboard: lits adoucis pour le fond sombre, rouge/vert un peu désaturés */
  --db-red: #c83b32;
  --db-green: #1f8a55;
  --db-bed-light: #4b6e68;
  --db-bed-dark: #11201d;
  --db-number: #eef5f3;
  --db-wire: #0a100f;
}
