/* =====================================================================
   Colour themes (Menu → Theme). Each theme only sets the base colours;
   everything else (hover, disabled, warnings, dimmed tiles...) is mixed
   from them in css/style.css :root.

   Aimed at long, comfortable sessions:
   - no pure black or pure white: text is off-white on soft dark grey,
     about 10-12:1 contrast instead of 17-21:1, which cuts glare and halo
   - surfaces step up gently in lightness instead of using borders and glow
   - accents are desaturated and used sparingly (the "you can do this" signal)
   - the village picture is toned down slightly so it doesn't outshine the panel

   No data-theme (or "portal") = the Games Portal colours in style.css.
   ===================================================================== */

/* Village: colours from the scene itself. Night forest panels, wheat-gold buttons, sky-blue highlights. */
html[data-theme="village"] {
  --bg: #1a2218; --panel: #202a1e; --panel-2: #273325; --panel-3: #313f2e;
  --line: #374634; --edge: #4a5d45;
  --text: #e4e1cc; --muted: #a5ad95;
  --accent: #d6b25c; --on-accent: #1d2318; --accent-2: #8fb8d6;
  --good: #9ccb70; --bad: #db8670; --warn: #e3c063;
  --body-bg: var(--bg);
  --hint-bg: color-mix(in srgb, var(--accent-2) 16%, var(--panel-2)); --hint-line: color-mix(in srgb, var(--accent-2) 30%, var(--panel-2));
  --hint-text: var(--text); --hint-strong: #fff8e4;
  --tab-on-bg: #c9d9a8; --tab-on-text: #1a2218;
  --scene-filter: brightness(.95) saturate(.94);
}

/* Slate: cool blue-grey, frosty blue accent. Calm and neutral. */
html[data-theme="slate"] {
  --bg: #242a33; --panel: #2b313b; --panel-2: #323944; --panel-3: #3c4450;
  --line: #424b58; --edge: #545e6d;
  --text: #dbe1ea; --muted: #9da7b6;
  --accent: #86a6c6; --on-accent: #1d232b; --accent-2: #8cc2cf;
  --good: #a3c08d; --bad: #d08b8f; --warn: #e3c78b;
  --body-bg: var(--bg);
  --hint-bg: color-mix(in srgb, var(--accent) 18%, var(--panel-2)); --hint-line: color-mix(in srgb, var(--accent) 32%, var(--panel-2));
  --hint-text: var(--text); --hint-strong: #f2f5f9;
  --tab-on-bg: #c9d3e0; --tab-on-text: #242a33;
  --scene-filter: brightness(.9) saturate(.88);
}

/* Hearth (the default since 2026-11-20): warm charcoal like a dim room by the fire, soft amber accent. Easiest at night. */
html[data-theme="hearth"] {
  --bg: #1e1c1a; --panel: #252220; --panel-2: #2d2a26; --panel-3: #37332e;
  --line: #3f3a34; --edge: #534c44;
  --text: #e2dbcf; --muted: #a59c8f;
  --accent: #cc9a5e; --on-accent: #1f1b16; --accent-2: #93b38d;
  --good: #9fbd8b; --bad: #d1826f; --warn: #dab36b;
  --body-bg: var(--bg);
  --hint-bg: color-mix(in srgb, var(--accent) 15%, var(--panel-2)); --hint-line: color-mix(in srgb, var(--accent) 30%, var(--panel-2));
  --hint-text: var(--text); --hint-strong: #fff5e6;
  --tab-on-bg: #ddd3c3; --tab-on-text: #1e1c1a;
  --scene-filter: brightness(.88) saturate(.85) sepia(.06);
}

/* Moss: soft grey-green with a sage accent. Low contrast, very gentle. */
html[data-theme="moss"] {
  --bg: #23292a; --panel: #2a3131; --panel-2: #313939; --panel-3: #3b4443;
  --line: #424b4a; --edge: #55605e;
  --text: #dcdcc9; --muted: #a0a797;
  --accent: #a7bf82; --on-accent: #1f251f; --accent-2: #86c0a6;
  --good: #a7c080; --bad: #df8c86; --warn: #dbbc7f;
  --body-bg: var(--bg);
  --hint-bg: color-mix(in srgb, var(--accent-2) 15%, var(--panel-2)); --hint-line: color-mix(in srgb, var(--accent-2) 30%, var(--panel-2));
  --hint-text: var(--text); --hint-strong: #f4f4e6;
  --tab-on-bg: #d0d6bf; --tab-on-text: #23292a;
  --scene-filter: brightness(.9) saturate(.86);
}

/* Graphite: plain neutral grey, steel-blue accent. Nothing tinted at all. */
html[data-theme="graphite"] {
  --bg: #1d1f22; --panel: #232629; --panel-2: #2a2e32; --panel-3: #34393e;
  --line: #3a3f45; --edge: #4b5158;
  --text: #d8dadc; --muted: #979ca3;
  --accent: #82a5c9; --on-accent: #171a1d; --accent-2: #74b6ae;
  --good: #86c19c; --bad: #da8b8b; --warn: #dab874;
  --body-bg: var(--bg);
  --hint-bg: color-mix(in srgb, var(--accent) 14%, var(--panel-2)); --hint-line: color-mix(in srgb, var(--accent) 28%, var(--panel-2));
  --hint-text: var(--text); --hint-strong: #f3f4f5;
  --tab-on-bg: #cfd3d8; --tab-on-text: #1d1f22;
  --scene-filter: brightness(.9) saturate(.88);
}

/* theme picker swatches (Menu → Theme) */
.theme-list { display: flex; flex-direction: column; gap: 6px; }
.theme-opt { display: flex; align-items: center; gap: 10px; text-align: left; }
.theme-opt .sw { display: flex; flex: none; border-radius: 6px; overflow: hidden; border: 1px solid #0006; }
.theme-opt .sw i { width: 14px; height: 22px; }
.theme-opt .tn { display: flex; flex-direction: column; line-height: 1.2; }
.theme-opt .tn small { font-weight: 400; opacity: .8; }
.theme-opt.on { outline: 2px solid var(--accent); outline-offset: 1px; }
/* the picker sits in the corner without dimming the game, so you can compare live */
#modal.peek { background: transparent !important; align-items: flex-start; justify-content: flex-end; pointer-events: none; padding-top: 70px; }
#modal.peek .modal-card { pointer-events: auto; width: min(360px, 100%); }
