/* Design tokens. Light is the default; the dark values apply when <html> has
   data-theme="dark" (set before first paint by the inline script in base.html:
   the saved choice, else the OS preference). One accent (royal blue) in both themes.
   The board colours are fixed (same navy + cream in both); the player may
   override them in the board settings later. */

:root {
  --font: 'Cairo', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --radius: 10px;
  --radius-lg: 16px;

  --bg: #f5f1e8;
  --surface: #ffffff;
  --surface-2: #faf6ec;
  --text: #14213d;
  --muted: #5f6781;
  --border: #ddd6c4;

  --accent: #2563eb;          /* fills: buttons, active clock, selected move */
  --accent-text: #ffffff;     /* text on top of --accent (5:1 contrast) */
  --accent-ink: #1d4ed8;      /* the accent used as text on the page background */
  --accent-soft: #e1eafd;
  --danger: #b3392b;
  --danger-soft: #f8e1dd;
  --good: #1e7b3a;            /* a win */
  --good-soft: #dcf2e2;
  --warn-bg: #fff3cd;
  --warn-text: #5c4400;
  --whatsapp: #25d366;
  --whatsapp-text: #07290f;

  --hero: linear-gradient(135deg, #14213d 0%, #24365f 100%);
  --hero-text: #ffffff;
  --shadow: 0 2px 10px rgba(20, 33, 61, 0.12);

  --sq-light: #e9e2cf;
  --sq-dark: #5b7399;
  --on-cream: #14213d;        /* text on the cream square colour (captured-piece chips) */
  --pal-1: #14213d;            /* Palestine's name: a gradient (dark -> flag green -> flag red) */
  --pal-2: #007a30;
  --pal-3: #c4202f;
  --side-white: #ffffff;       /* the marker for the side playing white / black (same in both themes) */
  --side-black: #1c1c1c;
  --last-move: rgba(184, 134, 11, 0.45);
  --check: rgba(224, 49, 49, 0.55);
}

:root[data-theme="dark"] {
  --bg: #111317;
  --surface: #1a1d23;
  --surface-2: #15181d;
  --text: #eceef2;
  --muted: #9aa1ad;
  --border: #2c313a;

  --accent: #6b9bff;
  --accent-text: #0a1020;
  --accent-ink: #6b9bff;
  --accent-soft: #1d2a47;
  --danger: #f2766b;
  --danger-soft: #3a1f1c;
  --good: #4cc26e;
  --good-soft: #163021;
  --warn-bg: #3d3210;
  --warn-text: #f5dd8a;

  --hero: linear-gradient(135deg, #262a33 0%, #171a20 100%);
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.4);

  --last-move: rgba(224, 177, 62, 0.45);
  --pal-1: #eceef2;
  --pal-2: #4cc26e;
  --pal-3: #ff7a7f;
}

/* Tell the browser which scheme the page uses (form controls, scrollbars). */
:root { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
