/* VAULTED theme palettes (2026-12-03, when the bot went theme-free as Kel). Nothing sets html[data-palette] anymore, so
   none of these apply; base.css holds the one palette (No Theme). Kept to bring back with their themes:
   hyrule (the original green, Cinzel titles), train (Night Train), polar (Polar Express, with snow); Termina is in
   termina.css. Their display fonts (Cinzel, Playfair Display) are no longer loaded in index.html. */

/* ---- Hyrule: the original green ----------------------------------------------------------------------------- */
:root[data-palette="hyrule"] {
  color-scheme: light;
  --bg: #EDF0EA;
  --surface: #FBFCFA;
  --sunken: #E3E8E1;
  --ink: #1C2A24;
  --muted: #5B6A62;
  --line: #CBD4CC;
  --accent: #2F6B57;
  --on-accent: #FFFFFF;
  --gold: #94700F;
  --gold-fill: #C9A227;
  --danger: #A8402F;
  --glow: rgba(47, 107, 87, .25);
  --gold-glow: rgba(201, 162, 39, .32);
  --display: "Cinzel", "Iowan Old Style", Georgia, serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root[data-palette="hyrule"]:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111916;
    --surface: #1A2520;
    --sunken: #141D19;
    --ink: #E6ECE7;
    --muted: #93A29A;
    --line: #2E3D36;
    --accent: #7CC3A8;
    --on-accent: #0F1714;
    --gold: #E2BC55;
    --gold-fill: #E2BC55;
    --danger: #E5856F;
    --glow: rgba(124, 195, 168, .32);
    --gold-glow: rgba(226, 188, 85, .38);
  }
}
:root[data-palette="hyrule"][data-theme="dark"] {
    color-scheme: dark;
  --bg: #111916;
  --surface: #1A2520;
  --sunken: #141D19;
  --ink: #E6ECE7;
  --muted: #93A29A;
  --line: #2E3D36;
  --accent: #7CC3A8;
  --on-accent: #0F1714;
  --gold: #E2BC55;
  --gold-fill: #E2BC55;
  --danger: #E5856F;
  --glow: rgba(124, 195, 168, .32);
  --gold-glow: rgba(226, 188, 85, .38);
}


/* ---- Night Train: ticket-paper cream by day; a navy night with brass trim and velvet-red seats after dark ------- */
:root[data-palette="train"] {
  --bg: #F1EDE5; --surface: #FDFBF7; --sunken: #E8E2D6; --ink: #1C2233; --muted: #5E6273; --line: #D8D0C0;
  --accent: #8E2C3F; --on-accent: #FFFFFF; --gold: #80601A; --gold-fill: #C29A3E; --danger: #B0402A;
  --glow: rgba(142, 44, 63, .22); --gold-glow: rgba(194, 154, 62, .32);
  --display: "Playfair Display", "Iowan Old Style", Georgia, serif;
}
@media (prefers-color-scheme: dark) {
  :root[data-palette="train"]:not([data-theme="light"]) {
    --bg: #0B1020; --surface: #141A2D; --sunken: #0F1526; --ink: #ECE6DA; --muted: #9AA0B4; --line: #27304C;
    --accent: #E38A97; --on-accent: #1A0D12; --gold: #D9B45E; --gold-fill: #D9B45E; --danger: #EF8069;
    --glow: rgba(227, 138, 151, .3); --gold-glow: rgba(217, 180, 94, .36);
  }
}
:root[data-palette="train"][data-theme="dark"] {
  --bg: #0B1020; --surface: #141A2D; --sunken: #0F1526; --ink: #ECE6DA; --muted: #9AA0B4; --line: #27304C;
  --accent: #E38A97; --on-accent: #1A0D12; --gold: #D9B45E; --gold-fill: #D9B45E; --danger: #EF8069;
  --glow: rgba(227, 138, 151, .3); --gold-glow: rgba(217, 180, 94, .36);
}

/* ---- Polar Express: the train's December run. Midnight blue and snow, cranberry red, gold ---------------------- */
:root[data-palette="polar"] {
  --bg: #EDF2F8; --surface: #FBFDFF; --sunken: #E1E9F2; --ink: #14243A; --muted: #546479; --line: #C8D5E3;
  --accent: #B3263A; --on-accent: #FFFFFF; --gold: #8A640C; --gold-fill: #CFA22A; --danger: #A3402A;
  --glow: rgba(179, 38, 58, .2); --gold-glow: rgba(207, 162, 42, .32);
  --display: "Playfair Display", "Iowan Old Style", Georgia, serif;
}
@media (prefers-color-scheme: dark) {
  :root[data-palette="polar"]:not([data-theme="light"]) {
    --bg: #09142A; --surface: #112039; --sunken: #0C1830; --ink: #EAF1F8; --muted: #9DB1C8; --line: #223757;
    --accent: #F0707F; --on-accent: #1A0A0E; --gold: #E8C36A; --gold-fill: #E8C36A; --danger: #F59A7A;
    --glow: rgba(240, 112, 127, .3); --gold-glow: rgba(232, 195, 106, .38);
  }
}
:root[data-palette="polar"][data-theme="dark"] {
  --bg: #09142A; --surface: #112039; --sunken: #0C1830; --ink: #EAF1F8; --muted: #9DB1C8; --line: #223757;
  --accent: #F0707F; --on-accent: #1A0A0E; --gold: #E8C36A; --gold-fill: #E8C36A; --danger: #F59A7A;
  --glow: rgba(240, 112, 127, .3); --gold-glow: rgba(232, 195, 106, .38);
}

/* Night sky for both train palettes: a few stars (like Termina's) and, after dark, a faint glow of towns on the
   horizon. On the page itself (html), so panels stay solid on top. */
:root[data-palette="train"], :root[data-palette="polar"] {
  background:
    radial-gradient(1.5px 1.5px at 14% 16%, color-mix(in srgb, var(--ink) 40%, transparent) 50%, transparent 51%),
    radial-gradient(1px 1px at 31% 8%, color-mix(in srgb, var(--ink) 35%, transparent) 50%, transparent 51%),
    radial-gradient(1px 1px at 52% 19%, color-mix(in srgb, var(--ink) 30%, transparent) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 69% 9%, color-mix(in srgb, var(--ink) 35%, transparent) 50%, transparent 51%),
    radial-gradient(1px 1px at 86% 24%, color-mix(in srgb, var(--ink) 30%, transparent) 50%, transparent 51%),
    radial-gradient(1px 1px at 9% 39%, color-mix(in srgb, var(--ink) 22%, transparent) 50%, transparent 51%),
    radial-gradient(90% 26% at 50% 106%, color-mix(in srgb, var(--gold-fill) 9%, transparent), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
:root[data-palette="train"] body, :root[data-palette="polar"] body { background: transparent; }

/* Polar Express snow: two layers of flakes drifting down behind everything. Still when motion is reduced. */
:root[data-palette="polar"] body::before {
  content: ""; position: fixed; inset: -320px 0 0; z-index: -1; pointer-events: none;
  background-image:
    radial-gradient(2px 2px at 20px 30px, color-mix(in srgb, var(--ink) 35%, transparent) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 110px 140px, color-mix(in srgb, var(--ink) 30%, transparent) 50%, transparent 51%),
    radial-gradient(2.5px 2.5px at 190px 70px, color-mix(in srgb, var(--ink) 25%, transparent) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 60px 250px, color-mix(in srgb, var(--ink) 28%, transparent) 50%, transparent 51%),
    radial-gradient(3px 3px at 150px 300px, color-mix(in srgb, var(--ink) 18%, transparent) 50%, transparent 51%),
    radial-gradient(2px 2px at 260px 200px, color-mix(in srgb, var(--ink) 22%, transparent) 50%, transparent 51%);
  background-size: 320px 320px;
  animation: polar-snow 38s linear infinite;
}
:root[data-palette="polar"] body::after {
  content: ""; position: fixed; inset: -280px 0 0; z-index: -1; pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 40px 60px, color-mix(in srgb, var(--ink) 30%, transparent) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 170px 20px, color-mix(in srgb, var(--ink) 22%, transparent) 50%, transparent 51%),
    radial-gradient(1px 1px at 230px 190px, color-mix(in srgb, var(--ink) 26%, transparent) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 90px 220px, color-mix(in srgb, var(--ink) 20%, transparent) 50%, transparent 51%);
  background-size: 280px 280px;
  animation: polar-snow-far 60s linear infinite;
}
@keyframes polar-snow { to { transform: translate3d(40px, 320px, 0); } }
@keyframes polar-snow-far { to { transform: translate3d(-30px, 280px, 0); } }
@media (prefers-reduced-motion: reduce) {
  :root[data-palette="polar"] body::before, :root[data-palette="polar"] body::after { animation: none; }
}

/* The logo ring follows the palette's trim; Polar adds a red ribbon edge like a wrapped present. */
:root[data-palette="polar"] .brand .logo {
  box-shadow: 0 0 0 1px var(--line), 0 0 0 4px var(--surface), 0 0 0 5px var(--gold-fill),
    0 0 0 7px color-mix(in srgb, var(--accent) 50%, transparent), 0 0 16px 4px var(--gold-glow);
}

