/* Shared appearance tokens. Component styles keep their original light fallbacks. */
:root{
  color-scheme:light;
  --font:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Hiragino Sans GB","Noto Sans SC","Microsoft YaHei",sans-serif;
  --font-mono:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,monospace;
  --space-1:4px;--space-2:8px;--space-3:12px;--space-4:16px;--space-5:20px;--space-6:24px;--space-8:32px;--space-10:40px;--space-12:48px;
  --text-xs:12px;--text-sm:13px;--text-md:14px;--text-base:16px;--text-lg:18px;--text-xl:20px;--text-2xl:24px;--text-3xl:32px;--text-4xl:40px;
  --leading-tight:1.25;--leading-snug:1.4;--leading-body:1.6;
  --ink:#111827;--text-secondary:#3f4b5f;--muted:#667085;--text-soft:#98a2b3;
  --line:#e6eaf0;--line-strong:#d0d5dd;--paper:#fff;--page-bg:#f5f6f8;
  --surface:#fff;--surface-muted:#f8fafc;--surface-soft:#f2f4f7;
  --brand:#315bea;--brand-soft:#eef2ff;--tinted-surface:#eef2f9;
  --action:#315bea;--action-hover:#2547c4;--orange:#ee9d35;
  --focus-line:#8da4ff;--icon-accent:#315bea;--text-link:#315bea;--image-well:#e8edf5;
  --success:#18794e;--success-soft:#e9f7ef;--success-line:#bfe5d0;
  --warning:#86632c;--warning-soft:#fff8e8;--warning-line:#e8d39a;
  --danger:#b42318;--danger-soft:#fdecee;--gold:#c9852a;
  --radius-sm:6px;--radius-md:8px;--radius-lg:12px;--radius-xl:16px;--radius-full:999px;
  --shadow-xs:0 1px 2px #1018280d;
  --shadow-sm:0 1px 2px #1018280f,0 1px 3px #1018280a;
  --shadow-md:0 8px 24px #10182814;
  --shadow-lg:0 16px 40px #1018281a;
  --header-h:64px;
  --theme-surface:#fff;--theme-soft:#f2f4f7;--theme-ink:#111827;--theme-muted:#667085;
  --theme-line:#e6eaf0;--theme-accent:#315bea;--theme-shadow:var(--shadow-md)
}
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;
  --shadow-xs:0 1px 2px #0006;
  --shadow-sm:0 1px 2px #0006,0 4px 12px #0003;
  --shadow-md:0 10px 28px #0006;
  --shadow-lg:0 18px 48px #0008;
  --theme-surface:#1c2837;--theme-soft:#293a51;--theme-ink:#e8edf4;
  --theme-muted:#a8b5c6;--theme-line:#3a4a60;--theme-accent:#a9c0ff;
  --theme-shadow:var(--shadow-lg)
}
html{font-family:var(--font)}
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}}
