/* Design tokens. Mirrors the design system; change values there first. The surfaces run in steps, the
   page, then the cards on it, then buttons, with a clear purple as the accent and a green for
   wins. Modals, menus and the phone's bar and panels float in a shade between the page and the cards;
   a field sinks a little below whatever holds it, inside a fine line (on a light page it's white inside a
   firmer one), and tabs ride a track of their own shade. Selected things take the accent's
   tint, and the bar, the panels and tabs have corners of their own.

   The colours come twice: dark, which the site opens in, and light. The html element's data-theme picks
   one (the theme script in the layouts sets it from the player's choice or the device). Anything that
   must stay dark on a light page, like a game's frame, takes .theme-dark. */
:root,
.theme-dark {
  color-scheme: dark;

  --surface-0: #14121C;
  --surface-1: #14121C;
  --surface-2: #252236;
  --surface-3: #3A3552;
  --surface-float: #1C1A29;
  --field: rgb(0 0 0 / 0.3);
  --track: rgb(0 0 0 / 0.3);
  --row-alt: #191726;
  --line: #2D2A40;
  --line-strong: #4F4A70;
  --ink: #F2F1F7;
  --ink-muted: #A9A3C3;
  --accent: #7C3AED;
  --selected: color-mix(in srgb, var(--accent) 28%, var(--surface-2));
  --on-accent: #FFFFFF;
  --win: #3DDC97;
  --danger: #F2555A;
  --danger-fill: #C8323A;
  --focus: #A78BFA;
  /* How strong shadows fall, and the veil behind a modal. */
  --shade: 1;
  --veil: rgb(8 6 16 / 0.72);
}

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

  --surface-0: #F1F0F7;
  --surface-1: #F1F0F7;
  --surface-2: #FFFFFF;
  --surface-3: #DDD9EB;
  --surface-float: #F8F7FC;
  --field: #FFFFFF;
  --track: rgb(23 20 43 / 0.07);
  --row-alt: #F6F5FB;
  --line: #D7D3E6;
  --line-strong: #A29CC0;
  --ink: #17142B;
  --ink-muted: #4F496E;
  --accent: #7C3AED;
  --selected: color-mix(in srgb, var(--accent) 20%, var(--surface-2));
  --on-accent: #FFFFFF;
  --win: #0C9B69;
  --danger: #D43D43;
  --danger-fill: #C8323A;
  --focus: #7C3AED;
  --shade: 0.3;
  --veil: rgb(23 20 43 / 0.45);
}

/* A dark island on a light page reads its text in the dark colours too. */
.theme-dark {
  color: var(--ink);
}

:root {
  --tile-blue: #2A5FE0;
  --tile-violet: #6A40E8;
  --tile-coral: #C93A30;
  --tile-teal: #14B8A6;
  --tile-amber: #F5A524;
  --tile-mint: #3DDC97;
  --on-tile-light: #FFFFFF;
  --on-tile-dark: #0B1620;

  --font-display: Outfit, "Noto Sans JP", "Noto Sans KR", "Noto Sans SC", Inter, system-ui, sans-serif;
  --font-sans: Inter, "Noto Sans JP", "Noto Sans KR", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-9: 36px;
  --space-10: 40px;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  --radius-tab: 9px;
  --radius-dock: 16px;
  --radius-panel: 20px;

  --control-sm: 40px;
  --control-md: 44px;
  --control-lg: 48px;
  --control-xl: 56px;
  --sidebar-width: 240px;
  --sidebar-rail: 76px;
  --bottom-nav-height: 70px;
  --chat-panel-width: 360px;
  --phone-header-height: 61px;
  --content-max: 1200px;
}
