/* Shared surfaces and accessible accents. Game media retain their original colour. */
html[data-theme="dark"]{--theme-bg:#121b20;--theme-ink:#f1eee5;--theme-muted:#aab6b8;--theme-line:#34434a;--theme-surface:#1c2a30;--theme-raised:#24353c;--theme-accent:#bada9b;--theme-button:#17271d;--theme-error:#ffaaa0;--theme-warning:#efca86;--theme-shadow:#060d1244}
html[data-theme="light"]{--theme-bg:#f7f4ec;--theme-ink:#263a33;--theme-muted:#63736a;--theme-line:#d0d7c9;--theme-surface:#eeeee5;--theme-raised:#fffdf7;--theme-accent:#385b43;--theme-button:#fffdf7;--theme-error:#9c3830;--theme-warning:#795514;--theme-shadow:#25332d0c}
html[data-theme],html[data-theme] body{--bg:var(--theme-bg);--paper:var(--theme-bg);--ink:var(--theme-ink);--muted:var(--theme-muted);--line:var(--theme-line);--surface:var(--theme-surface);--accent:var(--theme-accent);--on-accent:var(--theme-button);--button-ink:var(--theme-button);color:var(--ink);background:var(--bg)}
html[data-theme="dark"][data-theme-game="compound"]{--theme-accent:#f3a58c;--theme-button:#35231d}
html[data-theme="dark"][data-theme-game="counterweight"],html[data-theme="dark"][data-theme-game="ballpark"]{--theme-accent:#efbe7b;--theme-button:#322616}
html[data-theme="dark"][data-theme-game="real-sound"]{--theme-accent:#c5a8ec;--theme-button:#2a2038}
html[data-theme="light"][data-theme-game="compound"]{--theme-accent:#a7442c}
html[data-theme="light"][data-theme-game="counterweight"],html[data-theme="light"][data-theme-game="ballpark"]{--theme-accent:#875221}
html[data-theme="light"][data-theme-game="real-sound"]{--theme-accent:#71528c}
html[data-theme="dark"][data-theme-game="pinpoint"],html[data-theme="dark"][data-theme-game="capital-hop"]{--theme-accent:#8edbd7;--theme-button:#153337}
html[data-theme="dark"][data-theme-game="outline"]{--theme-accent:#b9b2ef;--theme-button:#25223c}
html[data-theme="dark"][data-theme-game="headcount"]{--theme-accent:#edbb85;--theme-button:#332616}
html[data-theme="light"][data-theme-game="pinpoint"],html[data-theme="light"][data-theme-game="capital-hop"]{--theme-accent:#236d73}
html[data-theme="light"][data-theme-game="outline"]{--theme-accent:#65569c}
html[data-theme="light"][data-theme-game="headcount"]{--theme-accent:#84531e}
html{scroll-padding-top:24px}button,a,input,select,textarea{outline-offset:4px}input,select,textarea{color-scheme:inherit}button{transition:background .15s,transform .15s}button:active:enabled{transform:translateY(1px)}
.suite-nav{background:var(--bg);color:var(--ink);border-color:var(--line);gap:22px}.suite-nav>div{gap:18px;overflow-x:auto;flex-wrap:nowrap;scrollbar-width:thin;min-width:0}.suite-nav .suite-progress{white-space:nowrap}.suite-nav a[aria-current]{color:var(--accent)}
.theme-toggle,.home-header .theme-toggle{display:inline-flex;flex:none;align-items:center;justify-content:center;gap:7px;min-height:42px;min-width:70px;padding:7px 10px;border:1px solid var(--line);border-radius:9px;background:transparent;color:var(--ink);font:12px system-ui;white-space:nowrap}.theme-toggle>span:first-child{font-size:20px;line-height:1}.theme-toggle:hover{background:var(--surface)}
#shared-dialog{background:var(--bg);color:var(--ink);border-color:var(--line);box-shadow:0 20px 100px #0005}#shared-dialog .dialog-close{color:var(--muted)}#shared-dialog textarea,.account-form input:not([type=checkbox]),.archive-form input{background:var(--theme-raised);color:var(--ink);border-color:var(--line)}
.button,#shared-dialog .button{background:var(--accent);color:var(--button-ink);border-radius:9px}.button.danger{background:var(--theme-error);color:var(--bg)}.share-preview,.recovery-code,.archive-links a{background:var(--surface);color:var(--ink)}.practice-option{background:var(--surface);color:var(--ink);border-color:var(--line)}.practice-option:hover{background:var(--theme-raised);border-color:var(--accent)}.practice-option small{color:var(--muted)}.form-error,.error{color:var(--theme-error)}.suite-save-status.warning{color:var(--theme-warning)}
.home-header #progress-button{border-color:var(--line);border-radius:9px;min-height:42px}.home-header nav{gap:23px}.intro em{color:var(--accent)}.daily-note{background:var(--surface);border-color:var(--line);box-shadow:0 15px 35px var(--theme-shadow)}.note-star{color:var(--accent)}.daily-note #daily-progress{border-color:var(--line)}.game-card{border-color:var(--line)}.game-card:hover{box-shadow:0 12px 35px var(--theme-shadow)}.game-card.complete .game-status{color:var(--accent)}.tiny-label{color:var(--muted)}.card-bottom,.pill{border-color:var(--line)}
html[data-theme="dark"] .real-time-card{background:#20352f;color:#e4f0d5}html[data-theme="dark"] .sound-card{background:#302a40;color:#e7d9f7}html[data-theme="dark"] .ballpark-card{background:#3a3027;color:#f2dbc0}html[data-theme="dark"] .balance-card{background:#26392f;color:#dfedda}html[data-theme="dark"] .compound-card{background:#33332a;color:#edead8}html[data-theme="dark"] .speed-decoration{background:#1a2b28ed;color:#dce8d5}html[data-theme="dark"] .word-art span{background:#494a38;border-color:#666647;color:#f1eccf}html[data-theme="dark"] .mini-dots{background-image:radial-gradient(#e9bd7433 2px,transparent 2px)}
.progress-overview{background:var(--line);border-color:var(--line)}.progress-metric,.account-bar{background:var(--surface);border-color:var(--line)}.progress-metric strong{color:var(--accent)}.activity-day{background:var(--surface);color:var(--muted)}.activity-day.played{background:var(--accent);color:var(--button-ink)}.activity-day.archive{background:var(--theme-raised);color:var(--theme-warning);border-color:var(--theme-warning)}.activity-day.today{border-color:var(--accent)}.activity-caption,.game-stat small{color:var(--muted)}.game-stat,.progress-section .backup-actions{border-color:var(--line)}.progress-section .backup-actions button,.progress-section .backup-actions label{color:var(--accent)!important}.text-control,.progress-heading .tiny-label{color:var(--accent)}.sync-status{background:var(--surface);color:var(--ink)}.sync-status[data-warning=true]{background:var(--surface);color:var(--theme-warning)}
/* Compound */
.tile{background:var(--theme-raised);border-color:var(--line);box-shadow:0 3px 0 var(--line)}.tile:hover:enabled{box-shadow:0 7px 0 var(--line)}.tile strong{color:var(--ink)}.tile.used{background:var(--surface);border-color:var(--line);box-shadow:0 2px 0 var(--line)}.tile.used strong{color:var(--muted)}.tile .used-number{background:var(--accent);color:var(--button-ink);box-shadow:0 0 0 5px var(--theme-shadow)}.tile.finished-unused{opacity:.5}.board-top,.board-bottom,.board-top>span:first-child,.word-counter>span,.word-counter strong small,.example-caption,.chain-placeholder,.chain-tip,.latest-word,.latest-word small,.lock-note,.solution-label{color:var(--muted)}.closed-badge b,.word-counter strong,.latest-word strong{color:var(--accent)}.mini-example span,.chain-box,.solution-box,.progress-blocks i{background:var(--surface);border-color:var(--line)}.chain-box.drag-over{background:var(--theme-raised);border-color:var(--accent)}.progress-blocks i.filled{background:var(--accent)}.chain-word,.solution-box .chain-word{background:var(--theme-raised);border-color:var(--line);color:var(--ink)}.chain-word:hover{background:var(--surface)}.chain-tools button,.word-list button{border-color:var(--line);color:var(--muted)}.chain-summary,.chain-summary strong{color:var(--ink)}
html[data-theme="dark"] body.playing #mobile-tools{background:#121b20f5;border-color:var(--line)}#mobile-tools small{color:var(--muted)}#mobile-tools strong{color:var(--accent)}#mobile-tools button{background:var(--surface);border-color:var(--line);color:var(--ink)}
/* Counterweight and the listening/percentage games */
.apparatus,.stage-bottom{background:var(--surface);border-color:var(--line)}.object-labels b,.mass-table strong{color:var(--ink)}.object-labels small,.stage-top,.stage-top span:first-child,.stage-bottom,.arm-meters small,.slider-labels,.instruction,.mass-table small{color:var(--muted)}.object-labels .count{background:var(--theme-raised);color:var(--ink)}.nudge-controls button{background:var(--surface);color:var(--ink);border-color:var(--line)}.score-box strong,.release-status{color:var(--accent)}.sound-stage{background:var(--surface)}.dot-grid i,.sound-progress{background:var(--line)}.dot-grid i.filled{background:var(--accent)}.listen-button,.sound-tabs button[aria-pressed=true]{color:var(--button-ink)}.sound-tabs button{border-color:var(--line)}.sound-tabs button[aria-pressed=true]{border-color:var(--accent)}.credit-row{border-color:var(--line)}
/* Real Time's film remains dark; surrounding controls follow the selected theme. */
[data-theme-game="real-time"] .subject,[data-theme-game="real-time"] .screen-top>span:first-child{color:var(--ink)}[data-theme-game="real-time"] :is(.home-stats small,.library-link,.speed-readout>span,.speed-caption,.control-note,.keyboard-hints,.gauge-labels,.result-row .result-name small,.result-row button small,.personal-result,.fresh-copy,.credits-row small,.credits-row a,.source-count,.stats-grid small,.history-row,.empty-history,.screen-top,.screen-bottom,#game-top,#player-credit){color:var(--muted)}
[data-theme-game="real-time"] :is(.home-stats strong,.running-total,.score-box strong,.gauge-labels span:nth-child(2),.result-row button,.result-row button b,.personal-result strong,.credits-row strong,.stats-grid strong,.history-row strong){color:var(--accent)}
[data-theme-game="real-time"] :is(.fresh-badge,.subject-category,.observation,.practice-pills button,.stats-grid>div,.bias-note){background:var(--surface);border-color:var(--line);color:var(--ink)}[data-theme-game="real-time"] .observation b{color:var(--accent)}[data-theme-game="real-time"] :is(.home-stats,.personal-result,.share-tools button,.keyboard-hints kbd,.result-row .result-index){border-color:var(--line);color:var(--muted)}[data-theme-game="real-time"] .round-track>span{border-color:var(--line);color:var(--muted)}[data-theme-game="real-time"] .round-track>span.current{color:var(--accent);border-color:var(--accent);background:var(--surface)}[data-theme-game="real-time"] .round-track>span.done{background:var(--accent);color:var(--button-ink);border-color:var(--accent)}[data-theme-game="real-time"] .practice-pills button[aria-pressed=true]{background:var(--accent);color:var(--button-ink);border-color:var(--accent)}
@media(max-width:760px){.suite-nav{gap:8px 12px}.suite-nav>div{order:4;margin:0;width:100%;flex-basis:100%;gap:20px}.suite-nav .suite-progress{margin-left:auto;font-size:10px}.theme-toggle,.home-header .theme-toggle{min-width:42px;gap:5px;padding:6px 9px}.suite-nav .theme-toggle{margin-left:0}.home-header nav{gap:8px}.home-header .theme-toggle>span:last-child{display:none}.suite-nav .theme-toggle>span:last-child{display:none}}
@media(prefers-reduced-motion:reduce){button{transition:none}}
