/* ==========================================================================
   wwg-tokens.css — Wild West Games V3 design tokens (2026-11-14)

   Values come from WestHub V3 (wh-design-system.css + wh-shell-v3.css): neutral grey canvas,
   white surfaces, one blue accent, Inter. Light first; dark follows the OS unless the page pins
   a theme with data-theme="light" | "dark" (on <html> or on any element, which re-themes that
   subtree — the kit demo uses this to show both side by side).

   Rules:
   - Chrome (bars, buttons, cards) uses only the neutral + accent tokens.
   - --ag-p1..p6 are PLAYER / PIECE colours only. Never use them for chrome.
   - --ag-paper is the board / card sheet. It stays light in dark mode so boards read the same,
     and .ag-paper (wwg-ui.css) re-themes its children to light ink.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Inter+Tight:wght@600;700;800&display=swap');

:root,
[data-theme="light"] {
  color-scheme: light;

  /* ---- neutrals ---- */
  --ag-bg: #f3f4f6;
  --ag-surface: #ffffff;
  --ag-surface-alt: #f9fafb;
  --ag-chrome: #eef0f3;
  --ag-border: #e5e7eb;
  --ag-border-strong: #d1d5db;
  --ag-hover: rgba(20, 24, 33, .06);
  --ag-press: rgba(20, 24, 33, .10);
  --ag-ink: #111827;
  --ag-ink-2: #374151;
  --ag-muted: #6b7280;
  --ag-on-accent: #ffffff;              /* text on accent / success / danger fills */

  /* ---- accent + status ---- */
  --ag-accent: #2563eb;
  --ag-accent-hover: #1d4ed8;
  --ag-accent-bg: #e1eafd;
  --ag-accent-ink: #1d4ed8;
  --ag-success: #16a34a;
  --ag-success-bg: #dcfce7;
  --ag-success-ink: #15803d;
  --ag-warning: #d97706;
  --ag-warning-bg: #fef3c7;
  --ag-warning-ink: #b45309;
  --ag-danger: #dc2626;
  --ag-danger-bg: #fee2e2;
  --ag-danger-ink: #b91c1c;
  --ag-focus: #2563eb;
  --ag-scrim: rgba(17, 24, 39, .45);

  /* ---- players / pieces (never chrome) ---- */
  --ag-p1: #e5484d;
  --ag-p2: #3b82f6;
  --ag-p3: #16a34a;
  --ag-p4: #d97706;
  --ag-p5: #7c3aed;
  --ag-p6: #0891b2;
  --ag-p1-tint: rgba(229, 72, 77, .14);
  --ag-p2-tint: rgba(59, 130, 246, .14);
  --ag-p3-tint: rgba(22, 163, 74, .14);
  --ag-p4-tint: rgba(217, 119, 6, .14);
  --ag-p5-tint: rgba(124, 58, 237, .14);
  --ag-p6-tint: rgba(8, 145, 178, .14);

  /* ---- game categories (lobby chips, tile accents) ---- */
  --ag-cat-learning: #2563eb;
  --ag-cat-strategy: #0d9488;
  --ag-cat-party: #db2777;
  --ag-cat-arcade: #7c3aed;
  --ag-cat-holiday: #b91c1c;

  /* ---- board / paper ---- */
  --ag-paper: #fbfaf7;
  --ag-paper-line: #e3e5ea;
  --ag-paper-dot: #1f2937;
  --ag-paper-ink: #111827;
  --ag-paper-ink-2: #4b5563;
  --ag-paper-shadow: 0 1px 2px rgba(16, 24, 40, .10), 0 8px 24px rgba(16, 24, 40, .10);
  /* board feedback (canvas: read with WwgKit.token('board-selected') etc.) */
  --ag-board-selected: rgba(37, 99, 235, .30);   /* fill of the picked square / piece ring */
  --ag-board-last: rgba(245, 197, 24, .38);      /* from + to squares of the last move */
  --ag-board-legal: rgba(17, 24, 39, .22);       /* legal-move dot (radius ~ 16% of a cell) */
  --ag-board-capture: rgba(220, 38, 38, .55);    /* capture ring (stroke ~ 8% of a cell) */
  --ag-board-hint: rgba(22, 163, 74, .35);       /* hint / correct cell */

  /* ---- type ---- */
  --ag-font: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ag-font-display: 'Inter Tight', 'Inter', sans-serif;
  --ag-text-xs: .75rem;      /* 12 */
  --ag-text-sm: .8125rem;    /* 13 */
  --ag-text-md: .875rem;     /* 14 — default UI text */
  --ag-text-base: 1rem;      /* 16 */
  --ag-text-lg: 1.25rem;     /* 20 */
  --ag-text-xl: 1.75rem;     /* 28 */
  --ag-text-2xl: 2rem;       /* 32 */

  /* ---- shape + space ---- */
  --ag-r-sm: 4px;
  --ag-r: 8px;
  --ag-r-lg: 14px;
  --ag-r-xl: 16px;
  --ag-r-pill: 999px;
  --ag-s-1: 4px;
  --ag-s-2: 8px;
  --ag-s-3: 12px;
  --ag-s-4: 16px;
  --ag-s-5: 24px;
  --ag-s-6: 32px;
  --ag-ctl-h: 36px;          /* buttons, segments, inputs on desktop */
  --ag-touch: 44px;          /* minimum target below 768px */

  /* ---- elevation ---- */
  --ag-shadow-sm: 0 1px 2px rgba(13, 35, 51, .06), 0 1px 3px rgba(13, 35, 51, .05);
  --ag-shadow-md: 0 4px 14px rgba(13, 35, 51, .08);
  --ag-shadow-lg: 0 10px 30px -8px rgba(16, 24, 40, .22), 0 2px 6px rgba(16, 24, 40, .08);

  /* ---- shell ---- */
  --ag-appbar-h: 52px;
  --ag-bottombar-h: 56px;
  --ag-gamebar-h: 44px;
  --ag-ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---- dark: follows the OS unless the page pinned light ---- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ag-bg: #14171c;
    --ag-surface: #1e2228;
    --ag-surface-alt: #23272e;
    --ag-chrome: #0e1014;
    --ag-border: #2f343c;
    --ag-border-strong: #3d434d;
    --ag-hover: rgba(255, 255, 255, .07);
    --ag-press: rgba(255, 255, 255, .11);
    --ag-ink: #f3f4f6;
    --ag-ink-2: #d6dae2;
    --ag-muted: #9ca3af;
    --ag-accent: #5b8def;
    --ag-accent-hover: #7aa3f2;
    --ag-accent-bg: #1b2a45;
    --ag-accent-ink: #9cc0fb;
    --ag-success: #22a95a;
    --ag-success-bg: #12301f;
    --ag-success-ink: #6ee7a0;
    --ag-warning: #e08a1a;
    --ag-warning-bg: #3a2a0c;
    --ag-warning-ink: #fbbf5a;
    --ag-danger: #e5484d;
    --ag-danger-bg: #3b1618;
    --ag-danger-ink: #fca5a5;
    --ag-focus: #7aa3f2;
    --ag-scrim: rgba(0, 0, 0, .6);
    --ag-paper: #f4f2ec;
    --ag-paper-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
    --ag-shadow-sm: 0 1px 3px rgba(0, 0, 0, .55), 0 1px 2px rgba(0, 0, 0, .35);
    --ag-shadow-md: 0 4px 12px rgba(0, 0, 0, .6);
    --ag-shadow-lg: 0 12px 32px -6px rgba(0, 0, 0, .7), 0 2px 6px rgba(0, 0, 0, .45);
  }
}
:root[data-theme="dark"],
[data-theme="dark"] {
  color-scheme: dark;
  --ag-bg: #14171c;
  --ag-surface: #1e2228;
  --ag-surface-alt: #23272e;
  --ag-chrome: #0e1014;
  --ag-border: #2f343c;
  --ag-border-strong: #3d434d;
  --ag-hover: rgba(255, 255, 255, .07);
  --ag-press: rgba(255, 255, 255, .11);
  --ag-ink: #f3f4f6;
  --ag-ink-2: #d6dae2;
  --ag-muted: #9ca3af;
  --ag-accent: #5b8def;
  --ag-accent-hover: #7aa3f2;
  --ag-accent-bg: #1b2a45;
  --ag-accent-ink: #9cc0fb;
  --ag-success: #22a95a;
  --ag-success-bg: #12301f;
  --ag-success-ink: #6ee7a0;
  --ag-warning: #e08a1a;
  --ag-warning-bg: #3a2a0c;
  --ag-warning-ink: #fbbf5a;
  --ag-danger: #e5484d;
  --ag-danger-bg: #3b1618;
  --ag-danger-ink: #fca5a5;
  --ag-focus: #7aa3f2;
  --ag-scrim: rgba(0, 0, 0, .6);
  --ag-paper: #f4f2ec;
  --ag-paper-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  --ag-shadow-sm: 0 1px 3px rgba(0, 0, 0, .55), 0 1px 2px rgba(0, 0, 0, .35);
  --ag-shadow-md: 0 4px 12px rgba(0, 0, 0, .6);
  --ag-shadow-lg: 0 12px 32px -6px rgba(0, 0, 0, .7), 0 2px 6px rgba(0, 0, 0, .45);
}
