/* ─── Light mode ──────────────────────────────────────────────────────
   Every rule is scoped under html.theme-light, set before first paint from localStorage
   ('civdbTheme') by templates/header.php and toggled from the sun/moon button in the navbar.
   Most of the site runs off the tokens below; the rest are surfaces that were hard-coded dark.
   Feature cards that are dark on purpose (the Civ Bowl hero, rink graphics) are left dark. */

html.theme-light {
    color-scheme: light;
    --bg: #f3f5f8;
    --bg-card: #ffffff;
    --bg-elevated: #ffffff;
    --bg-hover: #eef1f5;
    --bg-input: #f0f2f6;
    --border: #dfe3ea;
    --border-light: #cfd5de;
    --text: #12161c;
    --text-secondary: #3e4652;
    --text-muted: #6b7380;
    --accent: #16a35a;
    --accent-hover: #12904f;
    --accent-subtle: rgba(22, 163, 90, 0.11);
    --red: #d9423e;
    --yellow: #b7860f;
    --green: #16a35a;
    --blue: #2f74c0;
    --shadow: 0 8px 24px rgba(20, 30, 45, 0.10);
    /* Feature palettes */
    --hkp-card: #ffffff;
    --hkp-card-2: #f6f8fb;
    --hkp-edge: rgba(20, 30, 45, .1);
    --hkb-track: #e3e7ee;
    --hkb-glow: rgba(47, 116, 192, .08);
    --hkb-accent: #2f74c0;
}
html.theme-light.dv2 { --dv2-surface: #ffffff; --dv2-surface-2: #f6f8fb; --dv2-line: #e1e5ec; }
html.theme-light .hk3 {
    --hk3-card: #ffffff; --hk3-raised: #f6f8fb; --hk3-sunk: #eef1f5; --hk3-line: #dfe3ea; --hk3-line-soft: #eceff4; --hk3-chip: #e3e7ee;
    --hk3-text: #12161c; --hk3-text-2: #3e4652; --hk3-muted: #6b7380; --hk3-green: #16a35a; --hk3-blue: #2f74c0; --hk3-gold: #b7860f;
}
html.theme-light .hkb-scope { --hkb-track: #e3e7ee; --hkb-glow: rgba(47, 116, 192, .08); --hkb-accent: #2f74c0; }
html.theme-light .hkc { --hkc-line: #dfe3ea; }

/* Page chrome */
html.theme-light .nav-glow { display: none; }
html.theme-light .navbar { background: rgba(255, 255, 255, .88); }
html.theme-light .mobile-tabbar { background: rgba(255, 255, 255, .95) !important; }
html.theme-light body:has(.hkb-hockey) { background: radial-gradient(1200px 520px at 50% -120px, rgba(47, 116, 192, .07), transparent 70%), var(--bg); }
html.theme-light .stats-intro-pills span { background: var(--bg-card); }
html.theme-light ::-webkit-scrollbar-thumb { background: #c9cfd8; }
html.theme-light .card, html.theme-light .table-wrap { box-shadow: 0 1px 2px rgba(20, 30, 45, .05); }
html.theme-light tbody tr:hover td { background: rgba(20, 30, 45, .03); }
html.theme-light .btn-primary { color: #fff; }
html.theme-light .hst-tabbar button[aria-selected="true"],
html.theme-light .cmp-foot a.is-primary { color: #fff; }

/* Toggle icon: moon in dark mode, sun in light mode */
.nav-theme-toggle .i-sun { display: none; }
html.theme-light .nav-theme-toggle .i-sun { display: block; }
html.theme-light .nav-theme-toggle .i-moon { display: none; }

/* Hard-coded dark surfaces found by a scan of the main pages */
html.theme-light.dv2 .fx-score { background: var(--bg-input); box-shadow: none; }
html.theme-light .shops-panel, html.theme-light .shops-panel-header { background: rgba(255, 255, 255, .94) !important; }
html.theme-light .world-switch, html.theme-light .map-ctrl-group, html.theme-light .map-info-content, html.theme-light .coord-display,
html.theme-light .rails-coord { background: rgba(255, 255, 255, .9) !important; color: var(--text); }
html.theme-light .shops-search-row input, html.theme-light .shops-panel-body select,
html.theme-light .shops-enchant-row select, html.theme-light .shops-enchant-row input[type="number"] { background: var(--bg-input); border-color: var(--border); }
