/* Shared theme tokens. Literal fallbacks in component styles preserve the dark palette.
   New UI should use these roles instead of adding theme-specific selector overrides. */
:root{color-scheme:dark}
:root[data-theme="light"]{
 color-scheme:light;
 --creep-on-bg:#d8f7e5;--creep-on-border:#28754a;--creep-on-text:#125432;
 --bg:#f4f6fa;--panel:#fff;--panel2:#edf1f7;--border:#c5cdda;
 --text:#202b3c;--muted:#526079;--green:#216d47;--danger:#a82f40;
 --accent:#7440a7;--soft:#f0e8f8;
 --ink:#202b3c;--ink-muted:#526079;--on-accent:#fff;
 --ink-blue:#245c91;--ink-purple:#7440a7;--ink-gold:#795611;
 --ink-green:#216d47;--ink-teal:#176d70;--ink-red:#a82f40;
 --surface-field:#fff;--surface:#f5f7fb;--surface-hover:#e5eaf3;--surface-raised:#edf1f7;
 --surface-blue:#e7f0fa;--surface-purple:#f0e8f8;--surface-gold:#fcf1d9;
 --surface-green:#e5f2e9;--surface-teal:#e0f1f0;--surface-red:#fbe8eb;
 --line-neutral:#c5cdda;--line-blue:#8aaed0;--line-purple:#b5a0cd;
 --line-gold:#c4a86c;--line-green:#88b99b;--line-teal:#81b5b6;--line-red:#d095a0;
 --zerg-accent:#7440a7;--zerg-soft:#f0e8f8;
 --terran-accent:#245c91;--terran-soft:#e7f0fa;
 --protoss-accent:#795611;--protoss-soft:#fcf1d9;
 --side-blue-accent:#245c91;--side-blue-soft:#e7f0fa;--side-blue-button:#d4e5f7;
 --side-red-accent:#a82f40;--side-red-soft:#fbe8eb;--side-red-button:#f5d6dd;
}
.theme-switch{display:inline-flex;align-items:center;gap:7px;flex:0 0 auto;font-size:11px;color:var(--muted,#a3b4c7)}
.theme-switch select{min-height:38px;max-width:130px;padding:7px 9px;border:1px solid var(--border,#32485e);border-radius:7px;background:var(--surface-field,#171d29);color:var(--text,#e4edf5);font:inherit;font-size:12px;font-weight:600;cursor:pointer}
.theme-switch select:focus-visible{outline:2px solid var(--accent,#65cdb1);outline-offset:3px}
@media(max-width:700px){.theme-switch select{min-height:44px}.theme-switch>span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}}
/* Cinematic artwork retains its own palette; images, QR codes and printable cards
   are never inverted or filtered. */
[data-theme="light"] .hero{--accent:var(--art-accent,#be8aff);color:#f3f2fa;--muted:#b8bbcc}
[data-theme="light"] .unit-image{--accent:var(--art-accent,#be8aff)}
[data-theme="light"] .race-card.selected{box-shadow:0 0 0 1px var(--accent)}
[data-theme="light"] .play-screen .play-army-switch [data-side="me"][aria-pressed="true"]{background:var(--soft);color:var(--own-accent)}
[data-theme="light"] .play-resume-group .play-resume .primary{background:var(--surface-teal);color:var(--ink-teal);border-color:var(--line-teal)}
[data-theme="light"] #toast{box-shadow:0 8px 30px #18263d26}
/* Stats shares the same preference and readable palette. */
[data-theme="light"] .metric strong{color:var(--ink-teal)}
[data-theme="light"] .bars span,[data-theme="light"] .legend i{background:var(--ink-teal)}
[data-theme="light"] .bars .unique,[data-theme="light"] .legend i.unique,[data-theme="light"] .usage-track i{background:var(--ink-blue)}
