/* Shared appearance tokens. Component styles keep their original light fallbacks. */
:root{color-scheme:light;--theme-surface:#fff;--theme-soft:#f2f5fa;--theme-ink:#273246;--theme-muted:#647084;--theme-line:#dfe5ee;--theme-accent:#315bea;--theme-shadow:0 12px 36px #18243b1a}
html[data-theme="light"]{color-scheme:light}
html[data-theme="dark"]{
  color-scheme:dark;
  --ink:#e8edf4;--muted:#a8b5c6;--line:#303d4e;--paper:#18222f;
  --brand:#9bb5ff;--orange:#efb65d;--action:#4362db;--action-hover:#506fec;
  --page-bg:#111923;--surface:#18222f;--surface-muted:#151f2b;--surface-soft:#202d3d;
  --brand-soft:#25344e;--tinted-surface:#1c2c43;--image-well:#263345;
  --text-secondary:#c6d0dd;--text-soft:#a8b5c6;--text-link:#b4c9f0;
  --icon-accent:#a6bde5;--line-strong:#536177;--focus-line:#7e9bd6;
  --success:#a6ddbf;--success-soft:#19372e;--success-line:#365d4a;
  --warning:#e8cb91;--warning-soft:#362f21;--warning-line:#63563a;
  --danger:#ffb5ad;--danger-soft:#3d272c;--gold:#edc373;
  --theme-surface:#1c2837;--theme-soft:#293a51;--theme-ink:#e8edf4;
  --theme-muted:#a8b5c6;--theme-line:#3a4a60;--theme-accent:#a9c0ff;
  --theme-shadow:0 16px 48px #0006;
}
html[data-theme="dark"] ::selection{background:#3f5b92;color:#fff}
html[data-theme="dark"] .tool-logo,
html[data-theme="dark"] img.resource-icon{background:#f7f8fa;padding:2px}
html[data-theme="dark"] .provider-logo{background:#f3f5f7;color:#243043}
html[data-theme="dark"] .briefing-heading svg,
html[data-theme="dark"] .editor-pick svg{fill:#634c25}
html[data-theme="dark"] .save-item.saved svg{fill:#9bb5ff26}
html[data-theme="dark"] dialog::backdrop{background:#060b14b3}
html[data-theme="dark"] .article-body{color:var(--text-secondary)}
html[data-theme="dark"] .editorial-detail .article-body{color:var(--ink)}

/* A compact native details menu keeps appearance reachable on every screen. */
.theme-picker{position:relative;display:inline-block;flex:none;color:var(--theme-ink);font-size:14px;line-height:1.5;z-index:60}
.theme-trigger{display:flex;align-items:center;justify-content:center;list-style:none;width:36px;height:36px;padding:8px;border:1px solid transparent;border-radius:7px;color:var(--theme-muted);cursor:pointer;user-select:none}
.theme-trigger::-webkit-details-marker{display:none}
.theme-trigger::marker{content:""}
.theme-trigger>svg{width:19px;height:19px;flex:none;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.theme-trigger:hover,.theme-picker[open]>.theme-trigger{color:var(--theme-accent);background:var(--theme-soft);border-color:var(--theme-line)}
.theme-trigger:focus-visible,.theme-menu button:focus-visible{outline:2px solid var(--theme-accent);outline-offset:3px}
.theme-menu{position:absolute;right:0;top:calc(100% + 9px);width:188px;max-width:calc(100vw - 32px);padding:6px;border:1px solid var(--theme-line);border-radius:10px;background:var(--theme-surface);box-shadow:var(--theme-shadow);color:var(--theme-ink)}
.theme-menu button{display:flex;align-items:center;gap:10px;width:100%;min-height:42px;padding:9px 11px;border:0;border-radius:6px;background:transparent;color:var(--theme-ink);font:inherit;text-align:left;white-space:nowrap;cursor:pointer}
.theme-menu button+button{margin-top:2px}
.theme-menu button>svg{width:18px;height:18px;flex:none;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.theme-menu button>span:last-child{margin-left:auto}
.theme-menu .theme-check{visibility:hidden;font-size:14px}
.theme-menu button[aria-pressed="true"] .theme-check{visibility:visible}
.theme-menu button:hover,.theme-menu button[aria-pressed="true"]{background:var(--theme-soft);color:var(--theme-accent)}
.creator-header .theme-picker,.player-top .theme-picker{margin-left:0}
.creator-header nav{align-items:center}
.player-top-actions{display:flex;align-items:center;justify-content:flex-end;gap:12px;flex:none}

/* The player shell follows the site; the actual game canvas stays immersive. */
body.player-page{background:var(--page-bg,#f6f7f9);color:var(--ink,#20242c)}
.player-page .player-wrap{max-width:1800px;padding-left:32px;padding-right:32px}
.player-page .player-top{border-color:var(--line,#e8ebf0)}
.player-page .player-top .brand-name,.player-page .player-top .brand-name span{color:var(--ink,#20242c)}
.player-page .player-top-actions>a{font-size:14px;color:var(--muted,#737b8c)}
.player-page .player-top-actions>a:hover{color:var(--brand,#315bea)}
.player-page .player-heading p,.player-page .player-note{color:var(--text-secondary,#657185);font-size:14px}
.player-page .player-note a,.player-page .player-toast a{color:var(--brand,#315bea)}
.player-page .player-actions button,.player-page .player-actions a{background:var(--surface,#fff);color:var(--ink,#20242c);border-color:var(--line,#dce3ed)}
.player-page .player-actions button:hover,.player-page .player-actions a:hover{background:var(--surface-soft,#eef2fa);border-color:var(--focus-line,#98acf1)}
.player-page .download-info{background:var(--surface,#fff);border-color:var(--line,#dce3ed)}
.player-page .download-info p{color:var(--text-secondary,#657185)}
.player-page .player-toast{color:var(--warning,#86632c);font-size:14px}
.player-page .stage .player-error{color:#e8edf4}
.player-page .poster,.player-page .stage{color:#e8edf4}
@media(max-width:700px){.player-page .player-wrap{padding-left:16px;padding-right:16px}.player-top-actions{gap:8px}.player-page .player-top-actions>a{font-size:14px}}
@media(max-width:680px){.header-actions .theme-trigger{width:32px;height:32px;padding:6px}.header-actions .theme-picker{margin:0}.theme-menu{top:calc(100% + 8px)}.header-inner{gap:10px}.header-actions{gap:6px}.header-inner .brand-domain{display:none}}
@media(max-width:380px){.header-inner .brand-name{font-size:18px}.header-actions{gap:4px}.header-inner{gap:8px}.creator-header{flex-wrap:wrap;padding-top:14px;padding-bottom:14px;gap:10px}.creator-header nav{gap:13px}.player-top-actions>a{max-width:112px;line-height:1.6}}
@media print{.theme-picker{display:none!important}html[data-theme="dark"]{color-scheme:light;--ink:#20242c;--muted:#657185;--line:#dce3ed;--brand:#315bea;--surface:#fff;--page-bg:#fff;--text-secondary:#334155;--text-soft:#647084;--surface-soft:#f1f5f9;--text-link:#315bea}}
