/* mgbstuff.dev tokens: the ONE file to change to reskin the site.
   1. Palette     "Red Flare" (from mgb-palette-builder, accent tweaked to #BB323A; tried as home-lab/07, live Oct 31 2026)
   2. Theme       what each color does in dark mode (the default) and in light mode
   3. Textures    the iron, ash and title-strip overlays, set separately for dark and light mode
   styles.css uses only these variables for color and texture, and fonts.css for type.
   THE RULE: red is never text on a dark background. On dark, red is only a filled block (light text on it),
   a border or a line; --iron-accent (the accent INK on dark bands) is light for that reason.
   The previous look (Ember Iron) is saved in design-assets/themes/ember-iron/ and git tag ember-iron-final. */

/* ---------- 1. Palette ---------- */
:root {
  --color-bg: #E2E7F3;          /* Frost paper (cool blue-white) */
  --color-surface: #D2DAEE;
  --color-border: #B8C2D8;
  --color-primary: #3C3D40;     /* Gunmetal */
  --color-accent: #BB323A;      /* Flare red (tweaked from #A5262E) */
  --color-text: #303030;
  --color-heading: #222222;
  --color-deep: #08090B;        /* Jet */
  --color-on-accent: #F6F7F8;   /* light text on red: 5.4:1 */
  --color-link: #3C3D40;
  --color-text-muted: #5F5F5F;
  --accent-100: #FFE4E2;        /* soft text on red: 4.8:1 */
  --accent-300: #FFA09B;
  --accent-500: #D65656;        /* hover for red blocks */
  --accent-700: #97252B;        /* red text on the grey-blue surface (light mode), where #BB323A is too faint */
  --accent-800: #76151C;
  --accent-950: #350105;
  --color-danger: #98554E;
  --danger-300: #FFA09B;

  /* Charcoal steps, mixed from Frost paper so the darks lean cool steel instead of warm */
  --char-950: color-mix(in oklab, var(--color-bg) 6%, var(--color-deep));
  --char-900: color-mix(in oklab, var(--color-bg) 11%, var(--color-deep));
  --char-800: color-mix(in oklab, var(--color-bg) 17%, var(--color-deep));
  --char-700: color-mix(in oklab, var(--color-bg) 27%, var(--color-deep));
  --char-500: color-mix(in oklab, var(--color-bg) 50%, var(--color-deep));

  /* The flare: red blocks and what goes on them */
  --flare: var(--color-accent);
  --flare-hover: var(--accent-500);
  --flare-deep: var(--accent-800);
  --on-flare: var(--color-on-accent);
  --on-flare-soft: var(--accent-100);
}

/* ---------- 2. Theme ---------- */
:root, [data-theme="dark"] {
  color-scheme: dark;
  --page: var(--char-900);
  --head-bg: var(--color-deep);
  --head-ink: var(--color-bg);
  --foot-bg: var(--color-deep);

  /* iron (dark) bands: the accent INK is light, never red */
  --iron-bg: var(--char-900);
  --iron-bg-alt: var(--char-800);
  --iron-ink: var(--color-bg);
  --iron-soft: var(--color-border);
  --iron-rule: var(--char-700);
  --iron-title: var(--color-bg);
  --iron-card: color-mix(in oklab, var(--char-950) 72%, transparent);
  --iron-accent: var(--color-bg);
  --iron-line: var(--flare);           /* red borders, notches and hover lines are fine on dark */

  /* paper (light) bands: red text allowed (4.6:1 on Frost paper) */
  --paper-bg: var(--color-bg);
  --paper-ink: var(--color-text);
  --paper-soft: var(--color-text-muted);
  --paper-rule: var(--color-border);
  --paper-title: var(--color-heading);
  --paper-card: color-mix(in oklab, white 60%, var(--color-bg));
  --paper-accent: var(--color-accent);
  --paper-line: var(--flare);

  --ember: var(--flare);               /* styles.css calls the accent "ember": here it is the red, for blocks only */
  --on-ember: var(--on-flare);
  --ember-hover: var(--flare-hover);
  --focus: var(--color-bg);
  --danger: var(--danger-300);
}

[data-theme="light"] {
  color-scheme: light;
  --page: var(--color-bg);
  --head-bg: var(--color-deep);        /* header and footer stay jet, so the rule still applies there */
  --foot-bg: var(--color-deep);

  --iron-bg: var(--color-surface);
  --iron-bg-alt: var(--color-surface);
  --iron-ink: var(--color-text);
  --iron-soft: var(--color-text-muted);
  --iron-rule: var(--color-border);
  --iron-title: var(--color-heading);
  --iron-card: color-mix(in oklab, var(--color-bg) 80%, transparent);
  --iron-accent: var(--accent-700);

  --focus: var(--color-primary);
  --danger: var(--color-danger);
}

/* ---------- 3. Textures ----------
   Three slots, each with its own DARK-mode and LIGHT-mode settings (so each mode can have its own picture,
   strength, blend, zoom and position; mgb-tune shows them as "Iron dark texture", "Iron light texture" ...):
     iron   the "band--iron" sections (dark in dark mode)    paper  the "band--paper" sections (always light)
     hero   the title strip at the top of a page. These are the site default; a page can pick its own in
            assets/css/pages/<page>.css (linked after styles.css), which is where mgb-tune saves it.
   strength = how much shows (0-1). blend = how it mixes with the band color: on dark, screen/soft-light show it,
   on light, multiply is usual. -x / -y move it (+ right / down). grain = the fine noise layer (0 = off).
   -size-phone = the zoom on phones (screens up to 600px wide): var(...-size) crops it like a computer does (you see
   its top-left corner), "100% auto" fits the whole texture across the screen, "700px auto" is anything between.
   -x-phone / -y-phone = the move on phones: var(...-x) is the same as on a computer. mgb-tune's "Scaled" sets
   size and move in vw (% of the screen width) so phones show the computer framing, smaller.
   mgb-tune's Phone preview shows these as "On phones". */
:root {
  --tex-iron-dark: url("../images/iron.webp");
  --tex-iron-dark-strength: 0.07;
  --tex-iron-dark-blend: screen;
  --tex-iron-dark-size: 1400px auto;
  --tex-iron-dark-size-phone: var(--tex-iron-dark-size);
  --tex-iron-dark-x: 0px;
  --tex-iron-dark-y: 0px;
  --tex-iron-dark-x-phone: var(--tex-iron-dark-x);
  --tex-iron-dark-y-phone: var(--tex-iron-dark-y);
  --tex-iron-dark-size-wide: var(--tex-iron-dark-size);
  --tex-iron-dark-x-wide: var(--tex-iron-dark-x);
  --tex-iron-dark-y-wide: var(--tex-iron-dark-y);
  --tex-iron-dark-repeat-wide: repeat;
  --tex-iron-dark-mask-wide: none;
  --tex-iron-dark-keys-wide: none;
  --tex-iron-dark-grain: 0;

  --tex-iron-light: url("../images/iron.webp");
  --tex-iron-light-strength: .165;
  --tex-iron-light-blend: multiply;
  --tex-iron-light-size: 1400px auto;
  --tex-iron-light-size-phone: var(--tex-iron-light-size);
  --tex-iron-light-x: 0px;
  --tex-iron-light-y: 0px;
  --tex-iron-light-x-phone: var(--tex-iron-light-x);
  --tex-iron-light-y-phone: var(--tex-iron-light-y);
  --tex-iron-light-size-wide: var(--tex-iron-light-size);
  --tex-iron-light-x-wide: var(--tex-iron-light-x);
  --tex-iron-light-y-wide: var(--tex-iron-light-y);
  --tex-iron-light-repeat-wide: repeat;
  --tex-iron-light-mask-wide: none;
  --tex-iron-light-keys-wide: none;
  --tex-iron-light-grain: 0;

  --tex-paper-dark: url("../images/ash.webp");
  --tex-paper-dark-strength: .34;
  --tex-paper-dark-blend: multiply;
  --tex-paper-dark-size: 1400px auto;
  --tex-paper-dark-size-phone: var(--tex-paper-dark-size);
  --tex-paper-dark-x: 0px;
  --tex-paper-dark-y: 0px;
  --tex-paper-dark-x-phone: var(--tex-paper-dark-x);
  --tex-paper-dark-y-phone: var(--tex-paper-dark-y);
  --tex-paper-dark-size-wide: var(--tex-paper-dark-size);
  --tex-paper-dark-x-wide: var(--tex-paper-dark-x);
  --tex-paper-dark-y-wide: var(--tex-paper-dark-y);
  --tex-paper-dark-repeat-wide: repeat;
  --tex-paper-dark-mask-wide: none;
  --tex-paper-dark-keys-wide: none;
  --tex-paper-dark-grain: 0;

  --tex-paper-light: url("../images/ash.webp");
  --tex-paper-light-strength: .187;
  --tex-paper-light-blend: multiply;
  --tex-paper-light-size: 1400px auto;
  --tex-paper-light-size-phone: var(--tex-paper-light-size);
  --tex-paper-light-x: 0px;
  --tex-paper-light-y: 0px;
  --tex-paper-light-x-phone: var(--tex-paper-light-x);
  --tex-paper-light-y-phone: var(--tex-paper-light-y);
  --tex-paper-light-size-wide: var(--tex-paper-light-size);
  --tex-paper-light-x-wide: var(--tex-paper-light-x);
  --tex-paper-light-y-wide: var(--tex-paper-light-y);
  --tex-paper-light-repeat-wide: repeat;
  --tex-paper-light-mask-wide: none;
  --tex-paper-light-keys-wide: none;
  --tex-paper-light-grain: 0;

  --tex-hero-dark: url("../images/iron.webp");
  --tex-hero-dark-strength: .16;
  --tex-hero-dark-blend: screen;
  --tex-hero-dark-size: 1400px auto;
  --tex-hero-dark-size-phone: var(--tex-hero-dark-size);
  --tex-hero-dark-x: 0px;
  --tex-hero-dark-y: 0px;
  --tex-hero-dark-x-phone: var(--tex-hero-dark-x);
  --tex-hero-dark-y-phone: var(--tex-hero-dark-y);
  --tex-hero-dark-size-wide: var(--tex-hero-dark-size);
  --tex-hero-dark-x-wide: var(--tex-hero-dark-x);
  --tex-hero-dark-y-wide: var(--tex-hero-dark-y);
  --tex-hero-dark-repeat-wide: repeat;
  --tex-hero-dark-mask-wide: none;
  --tex-hero-dark-keys-wide: none;

  --tex-hero-light: url("../images/iron.webp");
  --tex-hero-light-strength: .165;
  --tex-hero-light-blend: multiply;
  --tex-hero-light-size: 1400px auto;
  --tex-hero-light-size-phone: var(--tex-hero-light-size);
  --tex-hero-light-x: 0px;
  --tex-hero-light-y: 0px;
  --tex-hero-light-x-phone: var(--tex-hero-light-x);
  --tex-hero-light-y-phone: var(--tex-hero-light-y);
  --tex-hero-light-size-wide: var(--tex-hero-light-size);
  --tex-hero-light-x-wide: var(--tex-hero-light-x);
  --tex-hero-light-y-wide: var(--tex-hero-light-y);
  --tex-hero-light-repeat-wide: repeat;
  --tex-hero-light-mask-wide: none;
  --tex-hero-light-keys-wide: none;

  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- 3b. Book pages (Speciation) ----------
   The reading page: a sheet of old paper (grey texture multiplied over the sheet color).
   --book-paper-* = light mode (parchment, dark ink), --book-night-* = dark mode (dark paper, light ink). */
:root {
  --tex-oldpaper: url("/assets/images/oldpaper.webp");   /* full paths here: used from a page's own <style>, where ../ points elsewhere */
  --book-paper: #EDE3CC;
  --book-paper-edge: #D9C9A6;
  --book-ink: #2B2620;
  --book-soft: #6E604C;
  --book-rule: #C7B48C;
  --book-shadow: rgba(0, 0, 0, .55);
  --book-night: #262626;          /* very dark grey, no brown */
  --book-night-edge: #111111;
  --book-night-ink: #E3E3E0;
  --book-night-soft: #A0A09D;
  --book-night-rule: #474747;
  --tex-iron-tile: url("/assets/images/iron-tile.webp");   /* iron.webp evened out to repeat without seams (long pages) */
}

/* ---------- 4. Game colors: BitFlip boards ----------
   Only public/games/bitflip/ uses these. Dark = matte-black PCB with gold traces; light = white PCB with tin
   traces on brushed aluminium. --bf-* = the page around the board, --bfb-* = drawn on the board canvas,
   --bfb-die-* = the silicon-die levels.                                                                   */
:root, [data-theme="dark"] {
  --bf-page: #0c0c0c;
  --bf-panel: linear-gradient(160deg, #1a1a1a, #101010);
  --bf-rim: linear-gradient(160deg, #d7bd7a, #6f5a30 40%, #b89b5c 70%, #5a4826);
  --bf-ink: #d9bf78; --bf-soft: #8f7f58; --bf-ok: #9cbf5e; --bf-rule: #2a2618; --bf-one: #f0b45c; --bf-bad: #e0563c;
  --bf-screen: transparent; --bf-screen-ink: #d9bf78;
  --bf-fan: #3a3a3a; --bf-fan-on: #d9bf78; --bf-fan-ring: #6f5a30;
  --bf-led-off: #2e2a1c; --bf-led-on: #ffc14d; --bf-led-bad: #ff6a4d;
  --bfb-sub: #141414; --bfb-pour: transparent; --bfb-decor: #222222; --bfb-grid: #8a7442; --bfb-silk: #e8e2d0;
  --bfb-chip: #1c1c1c; --bfb-chip-top: #2a2a2a; --bfb-leg: #8c8a82; --bfb-label: #d48546; --bfb-label-soft: #b8743e;
  --bfb-ring: #6f5a30; --bfb-hole: #2a2412; --bfb-lamp-on: #ffc14d; --bfb-lamp-off: #4a4620; --bfb-ink: #e6e1d3; --bfb-io: ring;
  --bfb-t-edge: #3d3320; --bfb-t-off: #8a7a50; --bfb-t-on: #d9bf78; --bfb-t-hi: #fff0c2; --bfb-t-flow: #fff7dc; --bfb-t-glow: #e0b45a;
  --bfb-j-edge: #5a2e14; --bfb-j-off: #a8663c; --bfb-j-on: #d98b55; --bfb-j-hi: #f6c39c; --bfb-j-flow: #ffe3cc;
  --bfb-cell-in: #f2f2f0; --bfb-cell-out: #7d7d7a; --bfb-bad: #e0563c; --bfb-good: #9cbf5e; --bfb-select: #fff0c2;
  --bfb-die-sub: #1a1d26; --bfb-die-grid: #3a4152; --bfb-die-chip: #2a3040; --bfb-die-chip-top: #353c4f;
  --bfb-die-label: #c9d3ea; --bfb-die-label-soft: #8792ad;
  --bfb-b-edge: #163634; --bfb-b-off: #3f7f78; --bfb-b-on: #6fc2b6; --bfb-b-hi: #bdeee6; --bfb-b-flow: #e6fffa;   /* bottom-layer wires */
  --bfb-die-t-edge: #3b4150; --bfb-die-t-off: #7d8698; --bfb-die-t-on: #c9d2e6; --bfb-die-t-hi: #f4f7ff; --bfb-die-t-glow: #9fb6e8;
}
[data-theme="light"] {
  --bf-page: repeating-linear-gradient(90deg, #c9cbcd 0 2px, #d3d5d7 2px 3px, #cdd0d2 3px 5px);
  --bf-panel: linear-gradient(#fafaf8, #f1f1ef);
  --bf-rim: linear-gradient(160deg, #f4f5f6, #9da1a5 45%, #e2e4e6 70%, #8c9094);
  --bf-ink: #1c1c1c; --bf-soft: #55585b; --bf-ok: #2f6b2a; --bf-rule: #1c1c1c; --bf-one: #1c1c1c; --bf-bad: #b8321f;
  --bf-screen: linear-gradient(180deg, #c5c9bf, #d3d6cd); --bf-screen-ink: #1a1c18;
  --bf-fan: #1a1c18; --bf-fan-on: #1a1c18; --bf-fan-ring: #1a1c18;
  --bf-led-off: #aeb2a8; --bf-led-on: #e0802b; --bf-led-bad: #c8402a;
  --bfb-sub: #f7f7f5; --bfb-pour: #c7c9cb; --bfb-decor: transparent; --bfb-grid: #2b2b2b; --bfb-silk: #1e1e1e;
  --bfb-chip: #222222; --bfb-chip-top: #333333; --bfb-leg: #a9abad; --bfb-label: #b4b4b4; --bfb-label-soft: #8d8d8d;
  --bfb-ring: #8f9396; --bfb-hole: #3a3a3a; --bfb-lamp-on: #e0802b; --bfb-lamp-off: #3a3a3a; --bfb-ink: #1e1e1e; --bfb-io: square;
  --bfb-t-edge: #85898d; --bfb-t-off: #b4b8bb; --bfb-t-on: #c9cdd0; --bfb-t-hi: #ffffff; --bfb-t-flow: #e0802b; --bfb-t-glow: none;
  --bfb-j-edge: #9a4a12; --bfb-j-off: #e07a2e; --bfb-j-on: #ee8a38; --bfb-j-hi: #f8b57c; --bfb-j-flow: #fff1e4;
  --bfb-cell-in: #e9e9e6; --bfb-cell-out: #77736c; --bfb-bad: #c8402a; --bfb-good: #3d8a35; --bfb-select: #e0802b;
  --bfb-die-sub: #e6e8ee; --bfb-die-grid: #8d93a3; --bfb-die-chip: #c9cdd8; --bfb-die-chip-top: #d6dae3;
  --bfb-die-label: #2a3040; --bfb-die-label-soft: #5a6275;
  --bfb-b-edge: #2d5a6e; --bfb-b-off: #5f93ab; --bfb-b-on: #74abc4; --bfb-b-hi: #d7ecf5; --bfb-b-flow: #1e6f93;   /* bottom-layer wires */
  --bfb-die-t-edge: #7f8595; --bfb-die-t-off: #a9afbd; --bfb-die-t-on: #bfc5d2; --bfb-die-t-hi: #ffffff; --bfb-die-t-glow: none;
}

/* ---------- 5. Game colors: FactoryFeud ----------
   The factory floor ("Clean shop": light concrete, picked Oct 24, 2026) looks the same in both modes; only the
   menus and the asphalt outside the walls follow light/dark (dark menus are the "Worn shop" steel and yellow).
   --ff-* = the menus around the floor, --ffw-* = drawn in the world (read by the game's renderer at startup).   */
:root, [data-theme="dark"] {
  --ff-page: #25272a; --ff-panel: #34383d; --ff-card: #2b2e32; --ff-ink: #ecebe6; --ff-soft: #a9aaa5; --ff-line: #4b5056;
  --ff-accent: #e8b923; --ff-on-accent: #1b1b1a; --ff-num: #e8b923; --ff-bad: #f0907a;
  --ffw-outside: #3c3f41;
}
[data-theme="light"] {
  --ff-page: #dcdad4; --ff-panel: #f2f2f1; --ff-card: #ffffff; --ff-ink: #262624; --ff-soft: #63625e; --ff-line: #cdcdc6;
  --ff-accent: #c8692e; --ff-on-accent: #ffffff; --ff-num: #262624; --ff-bad: #b83a24;
  --ffw-outside: #6d716f;
}
:root {
  --ffw-floor: #cbc8c1; --ffw-mottle-1: #d6d3cc; --ffw-mottle-2: #bfbcb5; --ffw-seam: #bdbab3; --ffw-joint: #a9a69f;
  --ffw-wall: #4a4a47; --ffw-ink: #262624; --ffw-belt: #4a4d52; --ffw-slat: #61656b;
  --ffw-cream: #e6dfce; --ffw-metal: #8d9298; --ffw-metal-dark: #5e636a; --ffw-steel: #c3c8cc; --ffw-teal: #2f8f86;
  --ffw-blue: #3f84a3; --ffw-wood: #c98f55; --ffw-wood-dark: #8a5a32; --ffw-orange: #e07a35; --ffw-plate: #a3a8ad;
  --ffw-pad: #d8d5ce; --ffw-hazard: #e8b923; --ffw-dark: #2d3134; --ffw-ok: #3fae5a; --ffw-bad: #d9534f;
  --ffw-blue-dark: #2f6680; --ffw-wood-light: #e5b97f; --ffw-wood-pale: #f2dbb0; --ffw-bark: #7a4f2c; --ffw-grit: #8b5a3c;
  --ffw-card: #cfa874; --ffw-card-dark: #a57f4f; --ffw-tape: #94703f; --ffw-truck: #ddd2bc; --ffw-truck-dark: #a99a7c;
  --ffw-glass: #38505c; --ffw-roof: #c75b39; --ffw-bolt: #f2f2f1;
  /* Machine and belt states (GDD heatmap); each also has its own icon shape for colorblind players. */
  --ffw-running: #3fae5a; --ffw-starved: #e3a72f; --ffw-blocked: #d9534f; --ffw-saturated: #3d8bd9; --ffw-jammed: #e0483b;
}

/* ---------- 6. Living lines ----------
   Glowing lines that slowly change shape, drawn by assets/js/living-line.js (its top comment explains each setting).
   One slot so far: "menu", the line under the top menu (in place of the old flat 4px red border, Nov 2026).
   style = filament | pulse | crackle | smoke | vine | still. motion, glow and taper are 0-1 (taper 0 = runs hard to the edges).
   height = the room it has to bend in. mgb-tune shows these as "Menu line: ...". The header is jet in both modes,
   so one set of colors does (red as a line on dark: allowed by the rule). */
:root {
  --line-menu-style: filament;
  --line-menu-motion: .5;
  --line-menu-thick: 5.5px;
  --line-menu-glow: .5;
  --line-menu-taper: 0;
  --line-menu-height: 22px;
  --line-menu-glow-color: var(--accent-800);
  --line-menu-body-color: var(--flare);
  --line-menu-core-color: var(--accent-300);
}

/* ---------- 7. Game colors: mgbWord ----------
   Only public/games/mgbword/ uses these. The game table looks the same in light and dark, as approved in
   games/mgbWord/mockups/. Squares are kept clearly lighter than the board behind them.                  */
:root {
  --pl-frost: #E2E7F3; --pl-steel: #B8C2D8; --pl-jet: #08090B;
  --pl-tile-ink: #222222; --pl-tile-soft: #5F5F5F;
  --pl-950: #101114; --pl-900: #1A1B1F; --pl-800: #26282D; --pl-700: #3B3D44; --pl-500: #70747F;
  --pl-flare: #BB323A; --pl-flare-deep: #76151C; --pl-on-flare: #F6F7F8; --pl-on-flare-soft: #FFE4E2;
  --pl-sq-plain: #4A4E59; --pl-sq-dl: #5F6575; --pl-sq-tl: #9AA3B5;
  --pl-shadow: rgba(0, 0, 0, .6); --pl-tile-light: rgba(255, 255, 255, .4);
  /* Power-up coins, one color per kind: attack = takes tiles away, place = new ways to place, peek, board = time and bonuses */
  --pl-pu-attack: #BB323A; --pl-pu-place: #C9962E; --pl-pu-peek: #3E7CB1; --pl-pu-board: #3C8C6E; --pl-pu-ink: #F6F7F8; --pl-pu-ring: rgba(0, 0, 0, .35);
  /* Medals for a big play (Nov 7 2026): gold = all 7 tiles, silver = 60+ points, bronze = 50+ */
  --pl-medal-gold: #C9962E; --pl-medal-silver: #AEB8C6; --pl-medal-bronze: #B06A38; --pl-medal-shine: #FFE4E2;
  /* Multiverse (Mark's pick, Nov 11 2026): the quantum purple of the collider meter, splits, the Observer and the collapse */
  --pl-q: #8F7CFF; --pl-q-soft: #3B3566; --pl-q-light: #C4B8FF; --pl-q-ink: #120D33; --pl-q-glow: rgba(143, 124, 255, .15);
  /* Shelbot's face (Mark's pick "A Round", Nov 7 2026): the same in light and dark */
  --pl-sb-head: #F4F5F9; --pl-sb-shade: #D9DDE7; --pl-sb-ink: #1C1D22; --pl-sb-shine: #FFFFFF; --pl-sb-blush: #F48FA0;
  --pl-sb-bow: #E8485C; --pl-sb-bow-knot: #B42A3C;
  /* The Circuit picture on the game picker: pale silver on the dark page (the light mode overrides below flip it) */
  --pl-pick-wires-base: #E4E7EB; --pl-pick-wires-line: rgba(40, 44, 52, .14); --pl-pick-wires-tile: #2A2D33; --pl-pick-wires-ink: #F5F5F2;
  --pl-pick-wires-groove: #4D535C; --pl-pick-wires-metal: #9AA1AB; --pl-pick-wires-hi: #FFFFFF; --pl-pick-wires-hole: #3A3F46;

  /* Board textures from the shared library, one per theme. mgb-tune can swap them. */
  --tex-board-iron: url("../../games/mgbword/tex/iron.webp");
  --tex-board-ash: url("../../games/mgbword/tex/ash.webp");
  --tex-board-stone: url("../../games/mgbword/tex/stone.webp");
  --tex-board-concrete: url("../../games/mgbword/tex/concrete.webp");
  --tex-board-paper: url("../../games/mgbword/tex/paper.webp");
  --tex-board-space: url("../../games/mgbword/tex/space.webp");
  --tex-board-circuit: url("../../games/mgbword/tex/circuit.webp");
  --tex-board-maple: url("../../games/mgbword/tex/maple.webp");
  --tex-board-slate: url("../../games/mgbword/tex/slate.webp");
  --tex-tile-travertine: url("../../games/mgbword/tex/travertine.webp");
  --tex-board-slab: url("../../games/mgbword/tex/slab.webp");
  --tex-board-size: 100% 100%;     /* each texture is cropped square; design-assets/mgbword/build_textures.py sets the zoom */
  --tex-board-size-phone: var(--tex-board-size);

  /* These stay the same in light and dark: the tray, and text or lines that sit on the board */
  --pl-tray-top: #3B3D44; --pl-tray-side: #26282D; --pl-tray-bottom: #1A1B1F; --pl-tray-edge: #70747F;
  --pl-line-dark: #08090B; --pl-on-dark: #E2E7F3; --pl-label-bg: rgba(8, 9, 11, .78);

  /* The page behind the table: the site's dark texture. littera.css uses this url, so its path is written from there. */
  --pl-table-bg: var(--iron-bg); --pl-table-tex: url("../../assets/images/iron.webp"); --pl-table-tex-strength: var(--tex-iron-dark-strength);
  --pl-table-tex-blend: var(--tex-iron-dark-blend); --pl-table-tex-size: var(--tex-iron-dark-size);
}
/* Light mode follows the main site: its paper behind the table, and the game's controls flip to match it */
[data-theme="light"] body.pl {
  --pl-table-bg: var(--paper-bg); --pl-table-tex: url("../../assets/images/ash.webp"); --pl-table-tex-strength: var(--tex-paper-light-strength);
  --pl-table-tex-blend: var(--tex-paper-light-blend); --pl-table-tex-size: var(--tex-paper-light-size);
  --pl-frost: var(--paper-ink); --pl-steel: var(--paper-soft); --pl-jet: var(--paper-card);
  --pl-900: var(--color-surface); --pl-800: var(--paper-card); --pl-700: var(--paper-rule); --pl-500: var(--paper-soft);
  /* light mode's Circuit picture: mid steel, lighter than the dark board (Mark: too dark), still stands off the pale page */
  --pl-pick-wires-base: #9AA2AD; --pl-pick-wires-line: rgba(30, 34, 40, .14); --pl-pick-wires-tile: #2A2D33; --pl-pick-wires-ink: #F5F5F2;
  --pl-pick-wires-groove: #3A3F46; --pl-pick-wires-metal: #E4E7EB; --pl-pick-wires-hi: #FFFFFF; --pl-pick-wires-hole: #3A3F46;
}

/* Board themes (--plb-*). Any element with data-board gets that theme, so the Menu's swatches can use it too.
   base + tex + blend = the board; sq = a plain square (see-through, so the texture shows); line = the grid;
   dl, tl, dw, tw = bonus squares, each with its label color; tile, tile-ink, tile-soft, fresh = tiles;
   mark = the placing cursor, chosen to stand out on that theme. */
:root, [data-board="iron"] {
  --plb-tex: var(--tex-board-iron); --plb-base: #6B6F7B; --plb-blend: multiply;
  --plb-sq: rgba(74, 78, 89, .35); --plb-line: rgba(8, 9, 11, .75);
  --plb-dl: rgba(95, 101, 117, .92); --plb-dl-ink: #E2E7F3; --plb-tl: rgba(154, 163, 181, .95); --plb-tl-ink: #08090B;
  --plb-dw: rgba(118, 21, 28, .95); --plb-dw-ink: #FFE4E2; --plb-tw: rgba(187, 50, 58, .97); --plb-tw-ink: #F6F7F8;
  --plb-tile: #E2E7F3; --plb-tile-ink: #222222; --plb-tile-soft: #5F5F5F; --plb-fresh: #B8C2D8; --plb-tile-tex: none;
  --plb-mark: #FF3B47; --plb-star: #E2E7F3;
}
[data-board="ash"] {
  --plb-tex: var(--tex-board-ash); --plb-base: #C9A77E; --plb-blend: multiply;
  --plb-sq: rgba(150, 100, 55, .1); --plb-line: rgba(62, 36, 14, .6);
  --plb-dl: rgba(122, 78, 38, .92); --plb-dl-ink: #FFF3DF; --plb-tl: rgba(66, 39, 17, .94); --plb-tl-ink: #FFF3DF;
  --plb-dw: rgba(164, 76, 24, .95); --plb-dw-ink: #FFF3DF; --plb-tw: rgba(135, 28, 32, .96); --plb-tw-ink: #FFF3DF;
  --plb-tile: #F7ECD6; --plb-tile-ink: #1E1208; --plb-tile-soft: #6B5236; --plb-fresh: #FFD98A; --plb-tile-tex: none;
  --plb-mark: #D3121E; --plb-star: #FFF3DF;
}
[data-board="stone"] {
  --plb-tex: var(--tex-board-stone); --plb-base: #CFCDC7; --plb-blend: multiply;
  --plb-sq: rgba(255, 255, 255, .1); --plb-line: rgba(60, 60, 58, .55);
  --plb-dl: rgba(92, 100, 112, .94); --plb-dl-ink: #FFFFFF; --plb-tl: rgba(52, 58, 68, .94); --plb-tl-ink: #FFFFFF;
  --plb-dw: rgba(170, 66, 72, .93); --plb-dw-ink: #FFFFFF; --plb-tw: rgba(112, 24, 32, .95); --plb-tw-ink: #FFFFFF;
  --plb-tile: #2B2F36; --plb-tile-ink: #F5F4EF; --plb-tile-soft: #C9CBD0; --plb-fresh: #49505C; --plb-tile-tex: none;
  --plb-mark: #D3121E; --plb-star: #2B2F36;
}
[data-board="concrete"] {
  --plb-tex: var(--tex-board-concrete); --plb-base: #A6A7A6; --plb-blend: multiply;
  --plb-sq: rgba(255, 255, 255, .06); --plb-line: rgba(25, 26, 28, .6);
  --plb-dl: rgba(66, 74, 84, .94); --plb-dl-ink: #FFFFFF; --plb-tl: rgba(24, 28, 34, .95); --plb-tl-ink: #FFFFFF;
  --plb-dw: rgba(176, 78, 16, .96); --plb-dw-ink: #FFFFFF; --plb-tw: rgba(150, 26, 30, .97); --plb-tw-ink: #FFFFFF;
  --plb-tile: #F4F2EA; --plb-tile-ink: #17181A; --plb-tile-soft: #55565A; --plb-fresh: #FFD45E; --plb-tile-tex: none;
  --plb-mark: #D3121E; --plb-star: #F4F2EA;
}
[data-board="paper"] {
  --plb-tex: var(--tex-board-paper); --plb-base: #EADDBE; --plb-blend: multiply;
  --plb-sq: rgba(255, 250, 235, .15); --plb-line: rgba(92, 70, 40, .55);
  --plb-dl: rgba(66, 96, 108, .94); --plb-dl-ink: #FFFDF5; --plb-tl: rgba(38, 66, 84, .94); --plb-tl-ink: #FFFDF5;
  --plb-dw: rgba(146, 80, 42, .95); --plb-dw-ink: #FFFDF5; --plb-tw: rgba(122, 40, 28, .95); --plb-tw-ink: #FFFDF5;
  --plb-tile: #3A2E22; --plb-tile-ink: #F8F0DC; --plb-tile-soft: #CDBE9E; --plb-fresh: #5F4B35; --plb-tile-tex: none;
  --plb-mark: #C4111C; --plb-star: #3A2E22;
}
[data-board="space"] {
  --plb-tex: var(--tex-board-space); --plb-base: #6E7BFF; --plb-blend: multiply;
  --plb-sq: rgba(12, 14, 40, .35); --plb-line: rgba(190, 200, 255, .22);
  --plb-dl: rgba(24, 108, 126, .94); --plb-dl-ink: #F2FBFF; --plb-tl: rgba(44, 88, 196, .93); --plb-tl-ink: #F2F5FF;
  --plb-dw: rgba(122, 48, 184, .93); --plb-dw-ink: #F8F0FF; --plb-tw: rgba(196, 34, 112, .95); --plb-tw-ink: #FFF0F7;
  --plb-tile: #EEF1FF; --plb-tile-ink: #151833; --plb-tile-soft: #565B80; --plb-fresh: #B9C4FF; --plb-tile-tex: none;
  --plb-mark: #FF3B6B; --plb-star: #EEF1FF;
}
[data-board="circuit"] {
  /* Gray circuit (Nov 7 2026, Mark's picture, kept at a quarter of its darkness by build_textures.py); was green */
  --plb-tex: var(--tex-board-circuit); --plb-base: #AEB2B8; --plb-blend: multiply;
  --plb-sq: rgba(30, 34, 40, .1); --plb-line: rgba(20, 22, 26, .5);
  --plb-dl: rgba(118, 126, 138, .93); --plb-dl-ink: #FFFFFF; --plb-tl: rgba(48, 54, 64, .94); --plb-tl-ink: #FFFFFF;
  --plb-dw: rgba(118, 21, 28, .92); --plb-dw-ink: #FFE4E2; --plb-tw: rgba(187, 50, 58, .96); --plb-tw-ink: #FFFFFF;
  --plb-tile: #EEF0F3; --plb-tile-ink: #1E2228; --plb-tile-soft: #5D636C; --plb-fresh: #C9D1DC; --plb-tile-tex: none;
  --plb-mark: #FF2D3A; --plb-star: #EEF0F3;
}
[data-board="white"] {
  /* White (Nov 7 2026): a clean, nearly white board with the old paper's faint grain, light grid, charcoal tiles */
  --plb-tex: var(--tex-board-paper); --plb-base: #F7F7F4; --plb-blend: multiply;
  --plb-sq: rgba(255, 255, 255, 0); --plb-line: rgba(40, 44, 52, .2);
  --plb-dl: rgba(198, 214, 230, .96); --plb-dl-ink: #1D2B3A; --plb-tl: rgba(92, 126, 164, .96); --plb-tl-ink: #FFFFFF;
  --plb-dw: rgba(240, 200, 198, .97); --plb-dw-ink: #4A1418; --plb-tw: rgba(187, 50, 58, .96); --plb-tw-ink: #FFFFFF;
  --plb-tile: #2A2D33; --plb-tile-ink: #F5F5F2; --plb-tile-soft: #C3C6CC; --plb-fresh: #49505C; --plb-tile-tex: none;
  --plb-mark: #D3121E; --plb-star: #2A2D33;
}
[data-board="maple"] {
  --plb-tex: var(--tex-board-maple); --plb-base: #F6EFE2; --plb-blend: multiply;
  --plb-sq: rgba(255, 252, 245, .12); --plb-line: rgba(120, 104, 84, .6);
  --plb-dl: rgba(170, 193, 172, .96); --plb-dl-ink: #22302A; --plb-tl: rgba(127, 158, 182, .97); --plb-tl-ink: #15222C;
  --plb-dw: rgba(238, 182, 142, .97); --plb-dw-ink: #3A2415; --plb-tw: rgba(206, 138, 116, .97); --plb-tw-ink: #2C150E;
  --plb-tile: #E9D3B0; --plb-tile-ink: #33261A; --plb-tile-soft: #6B5840; --plb-fresh: #F2C98E; --plb-tile-tex: var(--tex-board-maple);
  --plb-mark: #C4111C; --plb-star: #33261A;
}
[data-board="brass"] {
  --plb-tex: var(--tex-board-iron); --plb-base: #5A6163; --plb-blend: multiply;
  --plb-sq: rgba(24, 28, 30, .3); --plb-line: rgba(186, 160, 116, .75);
  --plb-dl: rgba(184, 191, 200, .96); --plb-dl-ink: #14181C; --plb-tl: rgba(92, 122, 150, .97); --plb-tl-ink: #FFFFFF;
  --plb-dw: rgba(178, 106, 58, .97); --plb-dw-ink: #1A0E05; --plb-tw: rgba(208, 168, 66, .98); --plb-tw-ink: #1A1404;
  --plb-tile: #2B2119; --plb-tile-ink: #F1E6CF; --plb-tile-soft: #C9B795; --plb-fresh: #4A3926; --plb-tile-tex: none;
  --plb-mark: #FF3B47; --plb-star: #F1E6CF;
}
/* Circuit games' own board (Nov 7 2026, mockup v1): silver wires on dark, or darker silver on pale gray in light mode.
   --cw-*: groove (the wire's dark edge), metal, hi (its highlight), hole (pad pinhole), glow (switched on), charge, spent. */
[data-board="wires"] {
  --plb-tex: none; --plb-base: #24272C; --plb-blend: normal;
  --plb-sq: rgba(0, 0, 0, 0); --plb-line: rgba(255, 255, 255, .07);
  --plb-dl: rgba(0, 0, 0, 0); --plb-dl-ink: #E2E7F3; --plb-tl: rgba(0, 0, 0, 0); --plb-tl-ink: #E2E7F3;
  --plb-dw: rgba(0, 0, 0, 0); --plb-dw-ink: #E2E7F3; --plb-tw: rgba(0, 0, 0, 0); --plb-tw-ink: #E2E7F3;
  --plb-tile: #E2E7F3; --plb-tile-ink: #222222; --plb-tile-soft: #5F5F5F; --plb-fresh: #B8C2D8; --plb-tile-tex: none;
  --plb-mark: #FF3B47; --plb-star: #C9CED6;
  --cw-groove: #121417; --cw-metal: #8D939C; --cw-hi: #C9CED6; --cw-hole: #0C0D0F; --cw-glow: #BB323A; --cw-charge: #C9962E; --cw-spent: #6B4A2A;
}
[data-theme="light"] [data-board="wires"] {
  --plb-base: #ECEEF1; --plb-line: rgba(40, 44, 52, .12);
  --plb-tile: #2A2D33; --plb-tile-ink: #F5F5F2; --plb-tile-soft: #C3C6CC; --plb-fresh: #49505C; --plb-star: #6B717A;
  --cw-groove: #4D535C; --cw-metal: #8A919B; --cw-hi: #DFE3E8; --cw-hole: #3A3F46; --cw-spent: #C9A27A;
}
/* Letter-hood's own boards (Nov 27 2026). mgbstuff: the site's Red Flare palette (jet board with the site's iron
   texture, frost tiles, flare red trace). Neon: from Mark's Letter-hood icon (dark navy, glowing green outlined tiles).
   /games/shared/themes.css adds the glow and the tray edges (--plb-glow, --plb-on, --plb-on-ink, --plb-tray). */
[data-board="mgb"] {
  --plb-tex: url("../images/iron.webp"); --plb-base: var(--char-900); --plb-blend: soft-light;
  --plb-sq: transparent; --plb-line: var(--char-700);
  --plb-tile: var(--color-bg); --plb-tile-ink: var(--color-heading); --plb-tile-soft: var(--color-text-muted); --plb-fresh: var(--color-border);
  --plb-tile-tex: none; --plb-mark: var(--color-accent); --plb-star: var(--color-bg);
  --plb-on: var(--color-accent); --plb-on-ink: var(--color-on-accent); --plb-tray: var(--color-accent);
  /* mgbWord's bonus squares (Nov 28 2026, when mgbWord got every theme): the site's greys and reds, as Iron */
  --plb-dl: rgba(95, 101, 117, .92); --plb-dl-ink: #E2E7F3; --plb-tl: rgba(154, 163, 181, .95); --plb-tl-ink: #08090B;
  --plb-dw: rgba(118, 21, 28, .95); --plb-dw-ink: #FFE4E2; --plb-tw: rgba(187, 50, 58, .97); --plb-tw-ink: #F6F7F8;
}
[data-board="neon"] {
  --plb-tex: none; --plb-base: #04121B; --plb-blend: normal;
  --plb-sq: transparent; --plb-line: rgba(57, 255, 136, .35);
  --plb-tile: #071D24; --plb-tile-ink: #8DFFB0; --plb-tile-soft: #3FBF78; --plb-fresh: #0C3A35;
  --plb-tile-tex: none; --plb-mark: #39FF88; --plb-star: #8DFFB0;
  --plb-glow: #39FF88; --plb-on: #39FF88; --plb-on-ink: #03140D; --plb-tray: #1FD27A;
  /* mgbWord's bonus squares: deeper to brighter green, so they glow like the tiles */
  --plb-dl: rgba(57, 255, 136, .16); --plb-dl-ink: #8DFFB0; --plb-tl: rgba(57, 255, 136, .34); --plb-tl-ink: #CFFFE0;
  --plb-dw: rgba(31, 210, 122, .62); --plb-dw-ink: #03140D; --plb-tw: #39FF88; --plb-tw-ink: #03140D;
}
[data-board="slate"] {
  --plb-tex: var(--tex-board-slate); --plb-base: #9FB0C2; --plb-blend: multiply;
  --plb-sq: rgba(0, 0, 0, 0); --plb-line: rgba(214, 222, 232, .55);
  --plb-dl: rgba(150, 164, 180, .42); --plb-dl-ink: #F4F7FA; --plb-dl-edge: rgba(226, 232, 240, .35);
  --plb-tl: rgba(18, 24, 31, .6); --plb-tl-ink: #E8EEF4; --plb-tl-edge: rgba(190, 202, 216, .9);
  --plb-dw: rgba(160, 126, 86, .62); --plb-dw-ink: #FFF3D8; --plb-dw-edge: rgba(216, 180, 124, .85);
  --plb-tw: rgba(116, 70, 40, .88); --plb-tw-ink: #FBE3B4; --plb-tw-edge: rgba(226, 176, 104, .95);
  --plb-tile: #E9DAC2; --plb-tile-2: #E1C9A4; --plb-tile-3: #D6B58A; --plb-tile-ink: #2A241D; --plb-tile-soft: #5E5140; --plb-fresh: #F2DFA9; --plb-tile-tex: var(--tex-tile-travertine);
  --plb-mark: #FF5A5F; --plb-star: #F4F7FA;
}

/* ---------- 8. Practice plans (/practice/): this one page's blue palette ----------
   Same token names as section 1, so the shared styles need no changes. */
html[data-palette="practice"] {
  --color-bg: #EBF7FF; --color-surface: #DEF1FF; --color-border: #B4CDE0;
  --color-primary: #2E3032; --color-accent: #1D6AE5; --color-text: #2E3032; --color-heading: #111315;
  --color-deep: #05070A; --color-on-accent: #FFFFFF; --color-link: #0E58BB; --color-text-muted: #555555;
  --accent-100: #DEF1FF; --accent-300: #92D2FF; --accent-500: #297EF4; --accent-700: #0E58BB; --accent-800: #054584; --accent-950: #001D46;
  --pm-sky: #56A0D3; --pm-on-sky: #05070A;
}

/* ---------- 9. Game colors: Word Elevator ----------
   Only public/games/wordelevator/ uses these. Each kind of piece has its own color, on its button, its row in the
   "needs" box and on the map (open spots, numbers' rings, a tint on built pieces), so you can see what to hunt for
   (Mark, Nov 15 2026). The build area is always dark, so one set serves light and dark. Red stays a fill or a line,
   never text on dark; --wew-on-* is the text on a filled button.   */
:root {
  --wew-post: #E8B923; --wew-on-post: #08090B;     /* amber */
  --wew-floor: var(--flare); --wew-on-floor: var(--on-flare);
  --wew-tie: #9A93F2; --wew-on-tie: #08090B;       /* violet */
}
