/* Shared semantic palette. Light declarations retain their existing fallbacks. */
:root {color-scheme:light;--theme-focus:#9b6b19;--theme-muted:#415a6b}
:root[data-theme="dark"] {
  color-scheme:dark;
  --bg:#101c28;--paper:#1a2b3a;--ink:#e3edf4;--muted:#b1c3d1;--green:#85daba;--line:#425b6c;
  --theme-ink:#e3edf4;--theme-muted:#b1c3d1;--theme-accent:#85daba;
  --theme-surface:#1a2b3a;--theme-subtle:#213646;--theme-raised:#304b5c;
  --theme-line:#425b6c;--theme-warm:#44391f;--theme-success:#203f37;--theme-focus:#ffd17b;
}
.theme-toggle {display:inline-flex;align-items:center;justify-content:center;gap:7px;min-width:44px;min-height:44px;padding:9px 12px;border:1px solid var(--theme-line,#b5c8d4);border-radius:10px;background:var(--theme-surface,#fff);color:var(--theme-ink,#24465e);flex-shrink:0;font-size:13px;font-weight:600;white-space:nowrap}
.theme-toggle svg {width:20px;height:20px}
.theme-moon {display:block}.theme-sun {display:none}
[data-theme="dark"] .theme-moon {display:none}
[data-theme="dark"] .theme-sun {display:block}
.theme-toggle:focus-visible {outline:3px solid var(--theme-focus);outline-offset:3px}
/* Resource drawings and seat badges retain their original recognizable colors. */
[data-theme="dark"] .brand img {background:#f3f6f8;border-radius:10px;padding:5px 9px}
[data-theme="dark"] .resource-art {background-color:#edf3e7}
[data-theme="dark"] .art-wood {background-color:#c9e9cf}
[data-theme="dark"] .art-brick {background-color:#f8d6c8}
[data-theme="dark"] .art-wool {background-color:#e2efbe}
[data-theme="dark"] .art-grain {background-color:#ffebae}
[data-theme="dark"] .art-ore {background-color:#d9e5ef}
[data-theme="dark"] .player-badge {background:#fff!important}
[data-theme="dark"] .scene-wrap,[data-theme="dark"] .board3d {background:#16384d}
[data-theme="dark"] input::placeholder,[data-theme="dark"] textarea::placeholder {color:#a6bdcd;opacity:1}
[data-theme="dark"] .primary,[data-theme="dark"] .roll-action,[data-theme="dark"] .end-action {background:#126b50;color:#fff}
[data-theme="dark"] :is(button,a,input,select,textarea):focus-visible {outline-color:var(--theme-focus)}
@media(max-width:650px) {
 .site-header>.theme-toggle {padding:7px;min-width:40px;min-height:40px}
 .site-header>.theme-toggle .theme-label {display:none}
}
/* Website sections carry local legacy variables as well as the root palette. */
[data-theme="dark"] .website {--ink:#e3edf4;--muted:#b1c3d1;--green:#85daba;--paper:#1a2b3a;--line:#425b6c}
[data-theme="dark"] textarea {background:#1a2b3a;color:#e3edf4}
[data-theme="dark"] .play-screen .activity-log .event-row .event-actor,
[data-theme="dark"] .mobile-game-log .activity-log .event-row .event-actor {color:color-mix(in srgb,var(--player-color) 45%,#fff)!important}
.play-screen .player-top small {color:var(--theme-muted)}
[data-theme="dark"] .play-screen .player-top>b small {color:#43596a}
/* Keep the red die distinct without losing its pips against the dark panel. */
[data-theme="dark"] .ck-game .dice-pair>span:nth-child(2) {color:#ff8d9a}
[data-theme="dark"] .ck-track i.filled {background:#e3edf4}
.play-screen .player-top>b {color:#17374d!important;background:#fff;border-radius:6px;padding:0 5px;border-bottom:2px solid var(--player-color)}
@media(max-width:650px) {
 .website .site-header {gap:6px 8px}
 .website .site-header .brand img {width:clamp(100px,32vw,150px)}
 .website .site-header .profile-link {font-size:14px;padding:8px;min-width:0;max-width:132px}
 .website .site-header .profile-link>svg {display:none}
 .website .site-header .profile-link>span {overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
}
.play-screen .mobile-expansion-actions .build-action {background:var(--theme-subtle,#f2f6f9);color:var(--theme-ink,#17374d);border-color:var(--theme-line,#b8ccd8)}
.play-title i {color:var(--theme-muted)}

/* Match the existing toolbar controls; no separate control in focus mode. */
.play-tools .theme-toggle {min-height:34px;min-width:0;padding:6px 10px;border-radius:7px}
.play-tools .theme-toggle svg {width:16px;height:16px}
