/* ==========================================================================
   JJ8 design tokens, v2 (skill pack v2, 2 Dec 2026)
   Superset of the live /css/jj8-ds-tokens.css: every live token keeps its live
   name AND value. v2 only ADDS tokens. Proposed changes to live values sit in
   the opt-in block at the bottom ([data-jj8-proposals]) and are NOT live.
   JJ8 only. Nothing here comes from MD88.
   Contrast ratios: WCAG 2.x relative luminance, computed 2 Dec 2026.
   ========================================================================== */
:root {
  /* ---- 1. Primitives (live) ------------------------------------------- */
  --jj8-ink-900: #191921;   /* brand bg */
  --jj8-ink-800: #1F222B;   /* brand surface */
  --jj8-ink-700: #262A33;   /* raised */
  --jj8-ink-600: #35383F;   /* control fill / active tab */
  --jj8-ink-500: #686C75;   /* input border */
  --jj8-gray-400: #9A9CA3;  /* muted text */
  --jj8-gray-300: #C9CCD3;  /* secondary text */
  --jj8-white: #FFFFFF;
  --jj8-green-500: #2CD97D; /* BUTTON green (James, 2 Dec 2026) */
  --jj8-green-400: #24EE89; /* LOGO / ACCENT green (James, 2 Dec 2026) */
  --jj8-green-600: #24C56F; /* green on light: fill/icon only */
  --jj8-red-600: #D9363E;   /* live / error fill */
  --jj8-red-400: #F2676C;   /* danger text */
  --jj8-amber-400: #E8B84E; /* warning / pending / jackpot */

  /* ---- 1b. Primitives (v2, additive) ---------------------------------- */
  --jj8-green-550: #27C470; /* pressed button fill; ink on it 7.67 */
  --jj8-green-800: #1A7F4A; /* green TEXT on white/light only; 5.03 on #FFF */

  /* ---- 2. Semantic colour (live) --------------------------------------
     text        bg 17.47 · surface 15.89 · raised 14.37 · control 11.74
     text-2      bg 10.86 · surface 9.88  · raised 8.94  · control 7.30
     text-muted  bg 6.37  · surface 5.79  · raised 5.24  · control 4.28 (FAIL, never)
     accent-text bg 11.37 · surface 10.34 · raised 9.35  · control 7.64
     on-accent   on #2CD97D 9.42 · on #24EE89 11.37 · on #27C470 7.67
     danger-text bg 5.77  · surface 5.24  · raised 4.74  · control 3.88 (FAIL, never)
     warning     bg 9.48  · surface 8.62  · raised 7.80
     white on live #D9363E 4.62
     border-input vs surface 3.02 · vs bg 3.32 · vs raised 2.73 (FAIL, never)   */
  --color-bg: var(--jj8-ink-900);
  --color-surface: var(--jj8-ink-800);
  --color-surface-raised: var(--jj8-ink-700);
  --color-control: var(--jj8-ink-600);
  --color-border: rgb(255 255 255 / 0.08);
  --color-border-input: var(--jj8-ink-500);
  --color-text: var(--jj8-white);
  --color-text-2: var(--jj8-gray-300);
  --color-text-muted: var(--jj8-gray-400);
  --color-accent: var(--jj8-green-500);
  --color-accent-hover: var(--jj8-green-400);
  --color-accent-text: var(--jj8-green-400);
  --color-accent-on-light: var(--jj8-green-600);
  --color-on-accent: var(--jj8-ink-900);
  --color-focus: var(--jj8-green-400);
  --color-live: var(--jj8-red-600);
  --color-danger-text: var(--jj8-red-400);
  --color-warning: var(--jj8-amber-400);
  --color-scrim: rgb(0 0 0 / 0.7);

  /* ---- 2b. Semantic colour (v2, additive) ------------------------------
     State tints are 12% of the state colour over --color-surface.
     Text on them: white >= 12.2, text-2 >= 7.5, own state text >= 4.8.    */
  --color-accent-pressed: var(--jj8-green-550);
  --color-accent-text-on-light: var(--jj8-green-800);
  --color-disabled-bg: var(--jj8-ink-700);        /* disabled fill */
  --color-disabled-text: var(--jj8-gray-400);     /* 5.24 on it */
  --color-success: var(--jj8-green-400);          /* text/icon */
  --color-success-bg: #213835;                    /* 12% #2CD97D on surface */
  --color-error: var(--jj8-red-400);              /* text/icon */
  --color-error-fill: var(--jj8-red-600);         /* solid badge, white text */
  --color-error-bg: #35242D;                      /* 12% #D9363E on surface; #F2676C on it 4.81 */
  --color-warn: var(--jj8-amber-400);
  --color-warn-bg: #37342F;                       /* 12% amber on surface; amber on it 6.73 */
  --color-win: var(--jj8-green-400);              /* a settled win, cash-out credited */
  --color-win-bg: #203A36;                        /* accent on it 7.95 */
  --color-jackpot: var(--jj8-amber-400);          /* jackpot / VIP metal only */
  --color-live-dot: var(--jj8-red-600);           /* "Live" badge fill + dot */
  --color-info: var(--jj8-gray-300);              /* neutral info: no blue in JJ8 */
  --color-info-bg: var(--jj8-ink-600);
  --color-border-strong: rgb(255 255 255 / 0.16); /* section divider you must see (1.66, decorative) */

  /* ---- 3. Type (live) --------------------------------------------------- */
  --font-sans: Montserrat, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-12: 12px; --fs-14: 14px; --fs-16: 16px; --fs-20: 20px;
  --fs-24: 24px; --fs-32: 32px; --fs-48: 48px;
  --fw-regular: 400; --fw-semibold: 600; --fw-bold: 700; --fw-heavy: 800;
  --lh-tight: 1.2; --lh-ui: 1.3; --lh-body: 1.5;

  /* ---- 3b. Type (v2, additive): line-heights on the 4px grid ----------- */
  --lh-12: 16px; --lh-14: 20px; --lh-16: 24px; --lh-20: 28px;
  --lh-24: 32px; --lh-32: 40px; --lh-48: 56px;
  --ls-display: -0.02em;  /* 32px and up */
  --ls-heading: -0.01em;  /* 20-24px */
  --ls-body: 0;           /* 14-16px */
  --ls-caption: 0.01em;   /* 12px only, helps Montserrat at small size */
  --num: tabular-nums;    /* amounts, odds, timers, counters */

  /* ---- 4. Space (live) -------------------------------------------------- */
  --space-hair: 2px; --space-1: 4px; --space-2: 8px; --space-3: 12px;
  --space-4: 16px; --space-5: 20px; --space-6: 24px; --space-8: 32px;
  --space-12: 48px; --space-16: 64px;
  /* ---- 4b. Space (v2, additive) ---------------------------------------- */
  --space-10: 40px;  /* mobile section padding */
  --space-20: 80px;  /* desktop section padding, the only step above 64 */
  --inset-page: var(--space-4);   /* 16, confirmed */
  --gap-tile: var(--space-3);     /* 12, confirmed */

  /* ---- 5. Radius (live) ------------------------------------------------ */
  --radius-sm: 6px; --radius-md: 10px; --radius-lg: 16px; --radius-full: 999px;

  /* ---- 6. Elevation (live) --------------------------------------------- */
  --shadow-0: none;
  --shadow-1: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-2: 0 8px 24px rgb(0 0 0 / 0.45);
  /* v2, additive: the ONE glow, primary CTA only, max one per screen */
  --glow-cta: 0 6px 20px -6px rgb(44 217 125 / 0.55);
  --ring-focus: 0 0 0 2px var(--color-bg), 0 0 0 4px var(--color-focus);

  /* ---- 7. Motion (live) ------------------------------------------------ */
  --dur-fast: 120ms; --dur-base: 200ms; --dur-slow: 320ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);

  /* ---- 8. Component sizes (live) --------------------------------------- */
  --control-sm: 32px; --control-md: 40px; --control-lg: 48px;
  --tile-radius: var(--radius-md);
  /* v2, additive */
  --tap-min: 44px;            /* every target's hit box */
  --control-xl: 56px;         /* sticky register bar on pages with no bottom nav */
  --icon-sm: 16px; --icon-md: 20px; --icon-lg: 24px;

  /* ---- 9. Z layers (live) ---------------------------------------------- */
  --z-sticky: 100; --z-dropdown: 200; --z-overlay: 300; --z-modal: 400;

  /* ---- Legacy aliases (live) -------------------------------------------- */
  --jj-canvas: var(--color-bg); --jj-surface: var(--color-surface);
  --jj-surface-raised: var(--color-surface-raised); --jj-border: var(--color-border);
  --jj-text: var(--color-text); --jj-muted: var(--color-text-muted);
  --jj-green: var(--color-accent); --jj-green-2: var(--color-accent-text);
  --jj-on-green: var(--color-on-accent); --jj-green-soft-text: var(--color-accent-text);
  --jj-font: var(--font-sans); --jj-radius-control: var(--radius-md);
  --jj-radius-card: var(--radius-md); --jj-radius-panel: var(--radius-lg);
  --jj-focus: var(--color-focus); --jj-text-muted: var(--color-text-muted);
  --jj-surface-1: var(--color-surface);
}

@media (prefers-reduced-motion: reduce) {
  :root { --dur-fast: 0ms; --dur-base: 0ms; --dur-slow: 0ms; }
}

/* ==========================================================================
   PROPOSED changes to LIVE values (not live; need James's OK).
   Turn on in a mock with <html data-jj8-proposals>. See token-changes.md.
   ========================================================================== */
:root[data-jj8-proposals] {
  --control-md: 44px;   /* T1: 40 -> 44 so standalone md buttons meet the 44px target */
}
/* T2 (line-heights to px tokens), T3 (bottom-nav muted label) and T4 (retire #22C55F / #F5B544)
   are component edits, not token swaps. See token-changes.md. */
