.theme-toggle{display:grid;place-items:center;flex:none;width:40px;height:40px;border:1px solid #9BC4FF;border-radius:11px;background:#194DC2;color:#FFF;cursor:pointer}
.theme-toggle svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.8}
.theme-toggle .theme-sun{display:none}
[data-theme="dark"] .theme-toggle .theme-sun{display:block}
[data-theme="dark"] .theme-toggle .theme-moon{display:none}
.header-profile{display:flex;align-items:center;gap:10px}
.share-result-button{width:100%}
.result-share-dialog{width:min(520px,calc(100vw - 28px));max-height:calc(100dvh - 32px);padding:22px;border:1px solid var(--line);border-radius:22px;background:var(--panel);color:var(--text);box-shadow:0 24px 80px #06182B66;overflow:auto}
.result-share-dialog::backdrop{background:#07162ABB}
.share-dialog-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px}
.share-dialog-head h2{font-size:21px;margin:0;line-height:1.3}
.share-close{border:0;background:transparent;color:var(--muted);font-size:30px;width:40px;height:40px;border-radius:10px}
.share-close:hover{background:var(--bg)}
.share-result-card{background:#0F2243;color:#FFF;border-top:5px solid #2563EB;border-radius:15px;padding:24px}
.share-brand{font-size:25px;letter-spacing:-1px}.share-brand span{color:#00F0FF;margin-inline-start:4px;font-size:14px}
.share-map{font-size:23px;font-weight:750;margin:22px 0 6px;line-height:1.25;overflow-wrap:anywhere}
.share-mode{color:#AFCFFF;margin:0 0 20px;font-size:14px}
.share-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.share-stats>div{background:#19365C;border-radius:10px;padding:13px 8px}
.share-stats strong{display:block;color:#00F0FF;font-size:27px;line-height:1.2}
.share-stats span{display:block;font-size:11px;color:#D6E6FF;margin-top:6px;overflow-wrap:anywhere}
.share-xp{color:#A5E97C;font-weight:750;font-size:20px;margin:18px 0 12px}.share-result-card small{color:#AFC2DC}
.share-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:18px}.share-actions button{flex:1 1 150px;margin:0;font-size:14px}
.share-status{min-height:1.5em;color:var(--muted);font-size:13px;margin:14px 0 0}
.share-fallback{width:100%;min-height:180px;margin-top:12px;padding:12px;border:1px solid var(--line);border-radius:10px;background:var(--bg);color:var(--text);font:inherit;font-size:13px}
/* The dark theme changes surfaces and the map palette together. Blue/cyan remain
   the brand colors; answer grades keep their existing meaning. */
:root[data-theme="dark"]{color-scheme:dark;--bg:#0B1424;--panel:#142339;--line:#30455F;--muted:#A6BCD2;--text:#ECF4FF;--accent:#6CA9FF;--ink:#FFFFFF;--map-ocean:#132A3C;--map-land:#408B87;--map-context:#294959;--map-border:#9DCAC7;--map-label:#F1FCFF;--map-label-halo:#132A3C}
[data-theme="dark"] body{background:var(--bg);color:var(--text)}
[data-theme="dark"] ::selection{background:#396EC1;color:white}
[data-theme="dark"] .site-header{background:#123C91;box-shadow:0 2px 18px #0003}
[data-theme="dark"] .theme-toggle{background:#1D4DA2;border-color:#74B1FF}
[data-theme="dark"] :is(.game-screen,.game-toolbar,.map-card,.map-tools,.map-bottom,.activity-card,.atlas-map-browser,.atlas-modal,.atlas-account-dialog,.atlas-achievements,.atlas-progress,.hardcore-setup-record){background:var(--panel);border-color:var(--line);color:var(--text);box-shadow:0 3px 0 #07101D}
[data-theme="dark"] :is(h1,h2,h3,h4,.activity-card h2,.atlas-browser-head h2,.atlas-progress-heading,.atlas-account-dialog h2,.atlas-account-dialog h3,.atlas-progress-stats strong,.detail strong,.score strong,.atlas-completion-stats strong,.hardcore-record strong,.hardcore-live strong){color:var(--text)}
[data-theme="dark"] :is(.activity-card p,.setup-intro,.setup-status,.mode-description,.meta,.check,.controls-note,.scope,.round-save-status,.scene-caption,.scene-bottom,.atlas-progress-storage,.atlas-progress-stats span,.atlas-progress-xp>span,.atlas-completion-stats span,.atlas-achievement,.atlas-achievement small,.atlas-browser-country-note,.atlas-browser-status,.browser-status,.game-mode-label,.map-bottom,.answer-legend){color:var(--muted)}
[data-theme="dark"] :is(.field label,.setup-fields .field:nth-child(2) label){color:#C6DEFF}
[data-theme="dark"] :is(.atlas-map-choice,.setup-fields .field:nth-child(2) select,.select-wrap select,.game-mode-label select,.voice-control select,.site-header .language-toggle,.site-header .voice-control select,.header-profile #account-button,.answer-form,.language-list,.browser-search,.atlas-browser-search input,.atlas-account-field input){background:#192E49;color:var(--text);border-color:#466994;box-shadow:none}
[data-theme="dark"] :is(.select-wrap select option,.setup-fields select option,.game-mode-label select option,.voice-control select option){background:#192E49;color:var(--text)}
[data-theme="dark"] .setup-screen{background:#142D40;border-color:#33586B;box-shadow:0 4px 0 #081523}
[data-theme="dark"] .setup-map path{fill:#347E7A}
[data-theme="dark"] .setup-map .preview-context{fill:#284956}
[data-theme="dark"] .setup-map .preview-water{fill:#142D40}
[data-theme="dark"] .setup-shade{background:linear-gradient(105deg,#0B1424ED 0%,#0B1424B8 43%,#0B142435 79%,#0B14241C 100%)}
[data-theme="dark"] .setup-content>.eyebrow{background:#123B60;border-color:#287BA6;color:#8CEAFB}
[data-theme="dark"] .setup-content>h1{color:#EFF7FF}
[data-theme="dark"] :is(.secondary,.atlas-action-secondary,.browser-map-row,.browser-country-row,.browser-parent,.browser-more,.browser-level,.atlas-browser-levels button,.atlas-browser-head button,.zoom button,.province-list li,.atlas-account-secondary){background:#203855;color:#D9EBFF;border-color:#405D7D;box-shadow:none}
[data-theme="dark"] :is(.secondary:hover,.atlas-action-secondary:hover,.browser-map-row:hover,.browser-country-row:hover,.browser-more:hover,.zoom button:hover){background:#2A4C72;border-color:#6EA7E7}
[data-theme="dark"] :is(.language-toggle:hover,.language-option:hover,.language-option[aria-selected="true"],.language-option[data-active="true"]){background:#24466C;border-color:#5F94CD}
[data-theme="dark"] .language-option{color:var(--text)}
[data-theme="dark"] .language-native{color:#79B2FF}
[data-theme="dark"] :is(.language-separator,.language .language-chevron,.back-button,.field-icon){color:#B0CEE9;stroke:#B0CEE9}
[data-theme="dark"] .answer-form input{color:var(--text);caret-color:#7EB5FF}
[data-theme="dark"] .answer-form input::placeholder{color:#A0B7D1}
[data-theme="dark"] .answer-form button{background:#26456D;color:#C0DEFF;border-color:#486B97}
[data-theme="dark"] :is(.ad-slot,.ad-bottom,.ad-bottom-preview,.ad-bottom-tab){background:#142339;border-color:#30455F;color:#A6BCD2}
[data-theme="dark"] .ad-slot>span{color:#91ADC7}
[data-theme="dark"] .feedback{background:#233E5C;border-color:#3E6283;color:#D7EBFF}
[data-theme="dark"] .feedback.bad{background:#4A2936;color:#FFC0C4;border-color:#865367}
[data-theme="dark"] .feedback.good{background:#1C453C;color:#A9EDC7;border-color:#3B7D62}
[data-theme="dark"] :is(.score div,.atlas-completion-stats>div,.atlas-progress-stats>div){background:#203952;color:#C3D8E9}
[data-theme="dark"] :is(.score div:first-child,.atlas-progress-stats>div:nth-child(2)){background:#1D4239}
[data-theme="dark"] :is(.score div:last-child,.atlas-progress-stats>div:first-child){background:#493725}
[data-theme="dark"] .atlas-progress-stats>div:nth-child(3){background:#1F3D60}
[data-theme="dark"] .atlas-progress-level{background:#1C473D;border-color:#3D7962;color:#9CE3AC}
[data-theme="dark"] .atlas-progress-xp{color:#A2EBC0}
[data-theme="dark"] :is(.progress,.atlas-progress-track){background:#2D425D;border-color:#3D5673}
[data-theme="dark"] :is(.atlas-achievement-symbol,.hardcore-live,.hardcore-record){background:#203855;color:#A8D4FD;border-color:#3C5A7A}
[data-theme="dark"] .atlas-achievement.is-unlocked{color:#B7F0D1}
[data-theme="dark"] .atlas-achievement.is-unlocked .atlas-achievement-symbol{background:#1B4A3E;color:#9AE6C4;border-color:#387F65}
[data-theme="dark"] .map-tooltip{background:#162D46;color:#F0F7FF;border-color:#6589AC;box-shadow:0 5px 18px #0004}
[data-theme="dark"] .map-outline{stroke:#000}
[data-theme="dark"] :is(.sprint-clock,.flag-notice){background:#233F60;border-color:#53759D;color:#D1E9FF}
[data-theme="dark"] .sprint-clock.is-ending{background:#493725;color:#FFD29C}
[data-theme="dark"] :is(footer,footer a,.scope a,.atlas-action-link,.atlas-account-link){color:#9BBFEA}
[data-theme="dark"] :is(.detail,.atlas-browser-head,.atlas-account-header,.atlas-account-footer){border-color:var(--line)}
[data-theme="dark"] :is(.atlas-account-note,.atlas-account-label,.atlas-account-form label,.browser-map-row small,.browser-country-row small){color:var(--muted)}
[data-theme="dark"] :is(.atlas-account-form input,.atlas-browser-search input,.browser-search input){background:#192E49;color:var(--text);border-color:#466994}
[data-theme="dark"] :is(.mobile-orientation-card,.orientation-card){background:var(--panel);color:var(--text);border-color:var(--line)}
[data-theme="dark"] :is(#browser-search,.mode-dropdown-trigger,.mode-dropdown-menu,.atlas-account-tabs,.atlas-account-menu button){background:#192E49;color:var(--text);border-color:#466994;box-shadow:none}
[data-theme="dark"] :is(.mode-dropdown-option[aria-selected="true"],.mode-dropdown-option[data-active="true"],.atlas-account-tabs button.is-active){background:#28517D;color:#ECF4FF;border-color:#6FA9E8}
[data-theme="dark"] :is(#browser-subtitle,#browser-status,.browser-map-row span,.browser-level-row,.hardcore-record span,.hardcore-result-map,.hardcore-live span,.atlas-account-help,.atlas-account-divider,.atlas-account-field>span){color:var(--muted)}
[data-theme="dark"] :is(.hardcore-result-score strong,.hardcore-live-score strong,.hardcore-setup-record strong){color:#8DC6FF}
[data-theme="dark"] .hardcore-result-score span{color:#B4CCE5}
[data-theme="dark"] .activity-card>.eyebrow{color:#85DFFF}
[data-theme="dark"] .atlas-dialog-close{background:#233F60!important;color:#DBEDFF!important;border-color:#48688A!important}
[data-theme="dark"] #ad-bottom-preview .ad-slot{background:#142339;border-color:#30455F}
[data-theme="dark"] :is(#ad-bottom-preview,.ad-bottom-control,#orientation-dialog){background:var(--panel);color:var(--text);border-color:var(--line)}
[data-theme="dark"] #orientation-message{color:var(--muted)}
[data-theme="dark"] #ad-bottom-reopen{background:#1A3451;color:#C4DDF5;border-color:#48688A}
[data-theme="dark"] .play-button:disabled{background:#263B55;color:#A3B8D0;border-color:#3C5673;box-shadow:none}
@media(max-width:760px){.header-profile{gap:6px}.theme-toggle{width:35px;height:35px;border-radius:9px}.result-share-dialog{padding:16px}.share-result-card{padding:19px}.share-map{font-size:21px}}
