/* serpientejuego.com — Design tokens (v1, draft for owner approval)
   Themes: clasico (default), oscuro (default if system dark), nokia (Retro Nokia).
   Also: noche, desierto, nieve + festival (muertos, navidad), same variable names.
   Game fonts: system fonts only. Site fonts (design v6): Baloo 2 + Nunito, OFL, served from
   /assets/fonts/ (our own server, no external font service). */

:root {
  /* Fonts */
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: ui-rounded, "SF Pro Rounded", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", "Courier New", monospace;

  /* Type scale */
  --fs-xs: 0.8125rem;   /* 13px  labels, legal */
  --fs-sm: 0.9375rem;   /* 15px  HUD, table */
  --fs-md: 1.0625rem;   /* 17px  body */
  --fs-lg: 1.25rem;     /* 20px  H3 */
  --fs-xl: clamp(1.375rem, 1.1rem + 1vw, 1.75rem);   /* H2 */
  --fs-2xl: clamp(1.625rem, 1.1rem + 2vw, 2.375rem); /* H1 */
  --fw-regular: 400;
  --fw-bold: 700;
  --fw-black: 800;
  --lh-tight: 1.2;
  --lh-body: 1.6;

  /* Spacing (4px base) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  /* Shape */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  /* Layout */
  --page-max: 1120px;
  --content-max: 760px;
  --board-max: 680px;
  --tap: 44px;             /* minimum touch target */

  /* Motion */
  --dur-fast: 120ms;
  --dur: 200ms;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Site look (design v6): the PAGE around the game ----------
   The page is always white; a game theme (Navidad, Nokia, Noche…) only colours the game.
   Only the system dark mode makes the page dark. Game tokens (below) are separate.
   --site-apple is the logo/graphics red (named so it never clashes with the game's --apple). */
:root {
  --site-font-head: "Baloo 2", "Baloo 2 Fallback", ui-rounded, system-ui, sans-serif;
  --site-font-body: "Nunito", "Nunito Fallback", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --site-bg: #FFFFFF;
  --site-ink: #1F2A22;
  --site-muted: #56625A;
  --site-line: #E2E7DF;
  --site-card: #FFFFFF;
  --brand: #1C5D33;
  --brand-deep: #144727;
  --on-brand: #FFFFFF;          /* text on --brand (nav pill, table header) */
  --site-apple: #E23B2E;        /* logo apple, scroll snake apples (never a button) */
  --apple-btn: #D42F24;         /* main button, white text 4.96:1 */
  --apple-btn-edge: #9A2119;    /* the 3 px darker edge under the main button */
  --cream: #FFF7E8;
  --amber-soft: #FCE9BD;
  --amber: #F2B134;
  --site-snake: #3C6FD6;        /* scroll snake (Clásico blue) */
  --site-snake-dark: #2C55AD;
  --site-hover: #EEF4EC;
  --footer-ink: #E2EEE4;
  --site-shadow: 0 1px 2px rgba(31, 42, 34, .06), 0 4px 14px rgba(31, 42, 34, .07);
}
@media (prefers-color-scheme: dark) {
  :root {
    --site-bg: #121614;
    --site-ink: #E7ECE8;
    --site-muted: #A9B4AC;
    --site-line: #2A332D;
    --site-card: #1B211D;
    --brand: #8FD19E;
    --brand-deep: #0D2416;
    --on-brand: #121614;
    --site-apple: #FF6B5E;
    --apple-btn: #D42F24;
    --apple-btn-edge: #8A1C15;
    --cream: #1B211D;
    --amber-soft: #3A2E12;
    --amber: #F2B134;
    --site-snake: #5AA2FF;
    --site-snake-dark: #3B7FE0;
    --site-hover: #1F2823;
    --footer-ink: #D5E3D8;
    --site-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .3);
  }
}

/* ---------- Clásico (default) ---------- */
:root,
[data-theme="clasico"] {
  color-scheme: light;
  --bg: #f5f8ef;
  --surface: #ffffff;
  --surface-2: #e9f1dc;
  --text: #1c2a1e;
  --text-muted: #4f5f52;
  --border: #d5e0c6;
  --primary: #2e7a34;          /* buttons, links */
  --primary-contrast: #ffffff;
  --accent: #e8452f;           /* apple red, highlights */
  --streak: #e8871e;
  --focus: #1f5fd1;
  --shadow-1: 0 1px 2px rgba(28, 42, 30, .08), 0 2px 8px rgba(28, 42, 30, .06);
  --shadow-2: 0 8px 28px rgba(28, 42, 30, .14);

  --board-a: #b3d96b;          /* checkerboard light */
  --board-b: #a6cf5d;          /* checkerboard dark */
  --board-frame: #4c8a3b;
  --snake: #3c6fd6;
  --snake-dark: #2c55ad;
  --snake-mirror: #f08a24;          /* Yin Yang: second snake */
  --snake-mirror-dark: #c46a12;
  --snake-eye: #ffffff;
  --apple: #e8452f;
  --apple-leaf: #3f8f2f;
  --wall: #7a6a58;              /* Muro blocks */
  --wall-light: #9c8b76;
  --snake-style: round;        /* read by canvas: round | pixel */
  --hud-bg: #3f7f35;
  --hud-text: #ffffff;
  --ad-bg: #eef2e8;
}

/* ---------- Oscuro ---------- */
[data-theme="oscuro"] {
  color-scheme: dark;
  --bg: #0f1512;
  --surface: #18211c;
  --surface-2: #1f2a24;
  --text: #e6eee8;
  --text-muted: #a3b2a8;
  --border: #2c3a32;
  --primary: #6fcf73;
  --primary-contrast: #0c140f;
  --accent: #ff6a55;
  --streak: #ffa64a;
  --focus: #8ab4ff;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 10px 30px rgba(0, 0, 0, .5);

  --board-a: #1e2b23;
  --board-b: #233229;
  --board-frame: #34503d;
  --snake: #5aa2ff;
  --snake-dark: #3b7fe0;
  --snake-mirror: #ffb15c;          /* Yin Yang: second snake */
  --snake-mirror-dark: #e08a2c;
  --snake-eye: #ffffff;
  --apple: #ff5a48;
  --apple-leaf: #6fcf73;
  --wall: #56626d;
  --wall-light: #74818d;
  --snake-style: round;
  --hud-bg: #233229;
  --hud-text: #e6eee8;
  --ad-bg: #151d18;
}

/* ---------- Retro Nokia ---------- */
[data-theme="nokia"] {
  color-scheme: light;
  --font-display: var(--font-mono);
  --bg: #c9d6a3;
  --surface: #bccb8f;
  --surface-2: #b0c083;
  --text: #22301a;
  --text-muted: #3e4f31;
  --border: #8fa266;
  --primary: #22301a;
  --primary-contrast: #c9d6a3;
  --accent: #22301a;
  --streak: #22301a;
  --focus: #000000;
  --shadow-1: none;
  --shadow-2: none;
  --radius-sm: 0;
  --radius-md: 2px;
  --radius-lg: 4px;
  --radius-pill: 2px;

  --board-a: #a9bd72;          /* flat LCD, no checkerboard */
  --board-b: #a9bd72;
  --board-frame: #22301a;
  --snake: #22301a;
  --snake-dark: #22301a;
  --snake-mirror: #6b7d47;          /* Yin Yang: second snake */
  --snake-mirror-dark: #6b7d47;
  --snake-eye: #a9bd72;
  --apple: #22301a;
  --apple-leaf: #22301a;
  --wall: #22301a;
  --wall-light: #22301a;
  --snake-style: pixel;
  --hud-bg: #22301a;
  --hud-text: #c9d6a3;
  --ad-bg: #bccb8f;
}

/* ---------- Noche ---------- */
[data-theme="noche"] {
  color-scheme: dark;
  --bg: #0d1630;
  --surface: #16213f;
  --surface-2: #1c2a50;
  --text: #e6ecff;
  --text-muted: #a7b3d6;
  --border: #2b3a66;
  --primary: #8fb0ff;
  --primary-contrast: #0b1430;
  --accent: #ff6b6b;
  --streak: #ffb44a;
  --focus: #ffd166;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 10px 30px rgba(0, 0, 0, .5);

  --board-a: #18264a;
  --board-b: #1d2d56;
  --board-frame: #2a3d73;
  --snake: #ffd166;            /* moon-gold: stands out on navy */
  --snake-dark: #d9a93a;
  --snake-mirror: #7fe0c4;          /* Yin Yang: second snake */
  --snake-mirror-dark: #52bfa2;
  --snake-eye: #ffffff;
  --apple: #ff5d5d;
  --apple-leaf: #7fe0a0;
  --wall: #3a4a7a;
  --wall-light: #52639a;
  --snake-style: round;
  --hud-bg: #1c2a50;
  --hud-text: #e6ecff;
  --ad-bg: #121c38;
}

/* ---------- Desierto ---------- */
[data-theme="desierto"] {
  color-scheme: light;
  --bg: #faf3e3;
  --surface: #fffaf0;
  --surface-2: #f2e4c4;
  --text: #3b2a17;
  --text-muted: #6e5536;
  --border: #e2cfa6;
  --primary: #9c4f17;
  --primary-contrast: #ffffff;
  --accent: #d9462b;
  --streak: #d97a1e;
  --focus: #1f5fd1;
  --shadow-1: 0 1px 2px rgba(59, 42, 23, .08), 0 2px 8px rgba(59, 42, 23, .06);
  --shadow-2: 0 8px 28px rgba(59, 42, 23, .16);

  --board-a: #ecd4a0;
  --board-b: #e3c88f;
  --board-frame: #b98a4e;
  --snake: #2f7d6d;            /* desert teal */
  --snake-dark: #22594e;
  --snake-mirror: #b8432a;          /* Yin Yang: second snake */
  --snake-mirror-dark: #8f321e;
  --snake-eye: #ffffff;
  --apple: #d9462b;
  --apple-leaf: #5c8a2f;
  --wall: #9a7a55;
  --wall-light: #b8976d;
  --snake-style: round;
  --hud-bg: #a8743c;
  --hud-text: #ffffff;
  --ad-bg: #f5ead2;
}

/* ---------- Nieve ---------- */
[data-theme="nieve"] {
  color-scheme: light;
  --bg: #f3f8fc;
  --surface: #ffffff;
  --surface-2: #e3eef7;
  --text: #1b2a3a;
  --text-muted: #4f6275;
  --border: #cfdeea;
  --primary: #2a6fb0;
  --primary-contrast: #ffffff;
  --accent: #e04848;
  --streak: #e0882a;
  --focus: #1f5fd1;
  --shadow-1: 0 1px 2px rgba(27, 42, 58, .08), 0 2px 8px rgba(27, 42, 58, .06);
  --shadow-2: 0 8px 28px rgba(27, 42, 58, .14);

  --board-a: #f4f9fd;
  --board-b: #e3eef8;
  --board-frame: #9cbdd8;
  --snake: #3466c9;
  --snake-dark: #284f9c;
  --snake-mirror: #f08a24;          /* Yin Yang: second snake */
  --snake-mirror-dark: #c46a12;
  --snake-eye: #ffffff;
  --apple: #e04848;
  --apple-leaf: #3a9a5a;
  --wall: #8aa4ba;
  --wall-light: #a9c0d3;
  --snake-style: round;
  --hud-bg: #5b8db8;
  --hud-text: #ffffff;
  --ad-bg: #eaf2f8;
}

/* ---------- Festival: Día de Muertos (only shown late Oct – early Nov) ---------- */
[data-theme="muertos"] {
  color-scheme: dark;
  --bg: #1d0f2b;
  --surface: #2a1640;
  --surface-2: #341c4f;
  --text: #fbeee0;
  --text-muted: #d2b9d9;
  --border: #4a2a68;
  --primary: #f2a541;          /* cempasúchil (marigold) */
  --primary-contrast: #1d0f2b;
  --accent: #e83f6f;
  --streak: #f2a541;
  --focus: #7fd8ff;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 10px 30px rgba(0, 0, 0, .5);

  --board-a: #2a1640;
  --board-b: #321a4c;
  --board-frame: #f28c28;
  --snake: #f2a541;
  --snake-dark: #c97f22;
  --snake-mirror: #5fd3f3;          /* Yin Yang: second snake */
  --snake-mirror-dark: #36aed0;
  --snake-eye: #ffffff;
  --apple: #e83f6f;
  --apple-leaf: #5fcf8a;
  --wall: #6b3f8f;
  --wall-light: #8c5cb3;
  --snake-style: round;
  --hud-bg: #6b2f8f;
  --hud-text: #fbeee0;
  --ad-bg: #24123a;
}

/* ---------- Festival: Navidad (only shown in December) ---------- */
[data-theme="navidad"] {
  color-scheme: light;
  --bg: #f7f3ec;
  --surface: #ffffff;
  --surface-2: #efe6d8;
  --text: #2b1d1d;
  --text-muted: #5e4a46;
  --border: #e2d5c2;
  --primary: #b3262e;
  --primary-contrast: #ffffff;
  --accent: #d42a35;
  --streak: #d98a1e;
  --focus: #1f5fd1;
  --shadow-1: 0 1px 2px rgba(43, 29, 29, .08), 0 2px 8px rgba(43, 29, 29, .06);
  --shadow-2: 0 8px 28px rgba(43, 29, 29, .14);

  --board-a: #e8f1e4;
  --board-b: #dae8d5;
  --board-frame: #b3262e;
  --snake: #1f7a3d;            /* fir green */
  --snake-dark: #155a2c;
  --snake-mirror: #c9a227;          /* Yin Yang: second snake */
  --snake-mirror-dark: #a3821a;
  --snake-eye: #ffffff;
  --apple: #d42a35;
  --apple-leaf: #1f7a3d;
  --wall: #8a6a4a;
  --wall-light: #a98a68;
  --snake-style: round;
  --hud-bg: #1f7a3d;
  --hud-text: #ffffff;
  --ad-bg: #f1eadf;
}
