@font-face{font-family:GrandmasterUI;src:local("Segoe UI");font-display:swap}
/* Shared color tokens keep dialogs, controls and the board surround in sync. */
:root {
  color-scheme:dark;
  --bg:#0e1714;--panel:#16231e;--line:#2c3c32;--muted:#94a69b;--text:#edece4;--accent:#d4b47b;--success:#9ed3ad;
  --success-glow:#9ed3ad50;--success-text:#b4cbb8;--icon-bg:#1c3027c9;--icon-line:#49634e55;--icon-hover:#31483b;
  --avatar-bg:#1e3027;--thinking-line:#6f5b3d;--stage-bg:#182622;--stage-line:#344738;--board-shadow:#0004;
  --caption:#a7ad9c;--caption-muted:#77877a;--human-bg:#2a3022;--soft-text:#819888;--panel-start:#1c2c23;--panel-end:#14221c;
  --on-accent:#24271c;--accent-hover:#e4c58e;--button-bg:#203229;--button-line:#34483b;--button-text:#c4cec2;--button-hover:#30473a;
  --scrollbar:#4f624f;--row-bg:#ffffff04;--secondary-text:#bdc9bb;--loading-bg:#15251ff5;--dialog-line:#4f624b;--dialog-bg:#192b22;
  --dialog-shadow:#000a;--backdrop:#050d09ba;--input-bg:#102219;--input-line:#3d5543;--promotion-bg:#263d2d;--promotion-line:#4d644a;
  --notice-bg:#3c3022;--notice-text:#f1d6aa;--notice-line:#8b6d41;--notice-shadow:#0006;--banner-bg:#243b2e;--banner-shadow:#0008;
  --danger-line:#df796e;--danger-text:#ed958b;
  font-family:GrandmasterUI,"Segoe UI",system-ui,sans-serif;color:var(--text);background:var(--bg)
}
:root[data-theme="mint"] {
  color-scheme:light;
  --bg:#f3f8f3;--panel:#ffffff;--line:#cdded4;--muted:#526b5e;--text:#203e32;--accent:#236d56;--success:#2b7956;
  --success-glow:#2b795620;--success-text:#286248;--icon-bg:#f5fcf5ed;--icon-line:#a0b8a9;--icon-hover:#dcefe2;
  --avatar-bg:#e6f1e9;--thinking-line:#739e84;--stage-bg:#d9e7dc;--stage-line:#a9c2b1;--board-shadow:#234b3220;
  --caption:#263e30;--caption-muted:#344e3d;--human-bg:#e1efe0;--soft-text:#5b7163;--panel-start:#ffffff;--panel-end:#eaf4eb;
  --on-accent:#ffffff;--accent-hover:#19533f;--button-bg:#e6f1e8;--button-line:#b0c8b8;--button-text:#2b513d;--button-hover:#d4e8da;
  --scrollbar:#93ae9e;--row-bg:#236d5609;--secondary-text:#3f604c;--loading-bg:#f3f8f3f5;--dialog-line:#adc6b5;--dialog-bg:#f8fcf7;
  --dialog-shadow:#1c402d33;--backdrop:#173a2b61;--input-bg:#ffffff;--input-line:#98b7a4;--promotion-bg:#e8f3e9;--promotion-line:#a1bfab;
  --notice-bg:#fff7e6;--notice-text:#684917;--notice-line:#b9a46e;--notice-shadow:#30472d25;--banner-bg:#f3fcf2;--banner-shadow:#234b3233;
  --danger-line:#b64442;--danger-text:#ac3333;
}
:root[data-theme="blue"] {
  color-scheme:light;
  --bg:#f1f4f8;--panel:#ffffff;--line:#d0dbe8;--muted:#53677f;--text:#24364b;--accent:#2d64ae;--success:#39735c;
  --success-glow:#39735c20;--success-text:#32664e;--icon-bg:#f8fbffed;--icon-line:#aabdd5;--icon-hover:#e1ebf7;
  --avatar-bg:#e4ecf7;--thinking-line:#8faed2;--stage-bg:#e0e7f0;--stage-line:#b5c5d9;--board-shadow:#274e7820;
  --caption:#31465f;--caption-muted:#4c617a;--human-bg:#e1ecfa;--soft-text:#5d7086;--panel-start:#ffffff;--panel-end:#eaf0f8;
  --on-accent:#ffffff;--accent-hover:#214e8b;--button-bg:#e7eef8;--button-line:#b7c8df;--button-text:#33557f;--button-hover:#d7e5f5;
  --scrollbar:#9aafc9;--row-bg:#2d64ae09;--secondary-text:#486380;--loading-bg:#f1f4f8f5;--dialog-line:#b7c8df;--dialog-bg:#f9fbfe;
  --dialog-shadow:#243b5833;--backdrop:#243b5861;--input-bg:#ffffff;--input-line:#9eb5d2;--promotion-bg:#e9f0fa;--promotion-line:#b0c4dd;
  --notice-bg:#fff6e8;--notice-text:#6d4c23;--notice-line:#bea276;--notice-shadow:#30476025;--banner-bg:#f5f9ff;--banner-shadow:#274e7833;
  --danger-line:#b5424b;--danger-text:#aa2e3d;
}
:root[data-theme="rose"] {
  color-scheme:light;
  --bg:#fcf4f7;--panel:#fffafd;--line:#e5cedc;--muted:#795b71;--text:#492d47;--accent:#984b70;--success:#41745e;
  --success-glow:#41745e20;--success-text:#38664f;--icon-bg:#fff8fced;--icon-line:#caa8bf;--icon-hover:#f2dfea;
  --avatar-bg:#f2e3ee;--thinking-line:#b67f9b;--stage-bg:#efdfeb;--stage-line:#cbaebe;--board-shadow:#6f345520;
  --caption:#462d40;--caption-muted:#583b50;--human-bg:#f6e0e8;--soft-text:#7e6276;--panel-start:#fffdfd;--panel-end:#f3e8f3;
  --on-accent:#ffffff;--accent-hover:#7e395d;--button-bg:#f5e7f0;--button-line:#d4b4c8;--button-text:#6b3e5e;--button-hover:#edd6e6;
  --scrollbar:#bd97b4;--row-bg:#984b7009;--secondary-text:#73516b;--loading-bg:#fcf4f7f5;--dialog-line:#d3b3c7;--dialog-bg:#fff8fc;
  --dialog-shadow:#58274133;--backdrop:#48263e61;--input-bg:#fffdfd;--input-line:#c19ab3;--promotion-bg:#f4e7f2;--promotion-line:#caa6be;
  --notice-bg:#fff1eb;--notice-text:#794a3a;--notice-line:#c59b88;--notice-shadow:#58304725;--banner-bg:#fff4fa;--banner-shadow:#6f345533;
  --danger-line:#b43b51;--danger-text:#ad2946;
}
*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button,a,input,select{touch-action:manipulation}button{cursor:pointer}button:disabled{opacity:.38;cursor:not-allowed}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,canvas:focus-visible{outline:2px solid var(--accent);outline-offset:4px}button[hidden],[hidden]{display:none!important}a{color:inherit;text-decoration:none}p{line-height:1.55}button{color:inherit}h1,h2,h3,p{margin:0}.topbar{height:88px;padding:0 4vw;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:20px}.brand{display:flex;align-items:center;gap:13px;font-size:15px;letter-spacing:2.4px;font-weight:600}.brand small{display:block;margin-top:4px;color:var(--muted);letter-spacing:3.8px;font-size:9px;font-weight:500}.header-actions{display:flex;gap:14px;align-items:center}.offline-pill{font-size:12px;color:var(--muted);display:flex;align-items:center;gap:8px}.offline-pill i{height:6px;width:6px;border-radius:50%;background:var(--accent)}.offline-pill.ready i{background:var(--success);box-shadow:0 0 10px var(--success-glow)}.offline-pill.ready{color:var(--success-text)}.icon-button{background:var(--icon-bg);border:1px solid var(--icon-line);border-radius:10px;font-size:21px;width:42px;height:42px;display:grid;place-items:center}.icon-button:hover{background:var(--icon-hover)}.icon-button[aria-pressed=true]{color:var(--accent);border-color:var(--accent)}main{max-width:1560px;margin:auto;padding:36px 4vw 0}.intro{display:flex;align-items:flex-end;justify-content:space-between;gap:22px;margin-bottom:30px}.eyebrow{font-size:10px;letter-spacing:2.1px;font-weight:600;color:var(--accent)}h1{font:400 clamp(26px,3vw,40px)/1.2 Georgia,serif;margin-top:11px;letter-spacing:-.7px}.intro p{color:var(--muted);font-size:13px;padding-bottom:3px}.game-layout{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:30px}.board-column{min-width:0}.player-line{display:flex;align-items:center;gap:12px;padding:0 4px 17px}.avatar{width:41px;height:41px;display:grid;place-items:center;border:1px solid var(--line);border-radius:12px;font-size:29px;background:var(--avatar-bg)}.player-line strong{font-size:13px;font-weight:500}.player-line div>span{display:block;font-size:11px;color:var(--muted);margin-top:4px}.engine-state{margin-left:auto;font-size:11px;border:1px solid var(--line);padding:6px 10px;border-radius:20px;color:var(--muted)}.engine-state.thinking{color:var(--accent);border-color:var(--thinking-line)}.board-stage{position:relative;background:var(--stage-bg);border:1px solid var(--stage-line);border-radius:14px;overflow:hidden;aspect-ratio:1.18;box-shadow:0 18px 55px var(--board-shadow);min-height:320px}canvas{display:block;width:100%;height:100%;touch-action:none}.stage-toolbar{position:absolute;top:14px;right:14px;display:flex;gap:7px}.board-caption{position:absolute;bottom:16px;left:22px;right:22px;display:flex;justify-content:space-between;color:var(--caption);font-size:9px;letter-spacing:2px;pointer-events:none}.board-caption span{color:var(--caption-muted)}.human-line{padding:19px 4px 12px}.human-avatar{color:var(--accent);background:var(--human-bg)}.time-mode{margin-left:auto;color:var(--muted);font-size:9px;letter-spacing:1.7px}.move-entry{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:10px}.move-entry label{font-size:11px;color:var(--muted)}.move-entry input{width:115px;padding:9px 12px;letter-spacing:1px}.move-entry .button{padding:9px 13px;min-height:36px}.camera-tip{margin-left:auto;font-size:10px;color:var(--soft-text)}.sidebar{display:flex;flex-direction:column;gap:18px;padding-top:58px;min-width:0}.sidebar>section{flex-shrink:0}.match-panel,.moves-panel{border:1px solid var(--line);border-radius:14px;background:linear-gradient(125deg,var(--panel-start),var(--panel-end));padding:23px}.match-panel h2{font:400 26px/1.23 Georgia,serif;margin:14px 0 12px}.match-panel p{font-size:12px;color:var(--muted);margin-bottom:22px;min-height:56px}.button{border:1px solid transparent;border-radius:8px;padding:12px 15px;min-height:43px;font-size:12px;font-weight:500;display:inline-flex;align-items:center;justify-content:center;gap:10px;transition:background .15s}.button.primary{background:var(--accent);color:var(--on-accent)}.button.primary:hover{background:var(--accent-hover)}.button.subtle{background:var(--button-bg);border-color:var(--button-line);color:var(--button-text)}.button.subtle:hover{background:var(--button-hover)}.match-panel>.button{width:100%;justify-content:space-between}.secondary-actions{display:flex;gap:9px;margin-top:10px}.secondary-actions .button{flex:1;padding:10px 6px;font-size:11px}.match-panel>#claim-draw,.match-panel>#retry-engine{margin-top:10px}.section-title{display:flex;align-items:center;justify-content:space-between}.section-title h3{font-weight:500;font-size:13px}.section-title span{font-size:10px;color:var(--muted)}.moves-panel{padding:20px 22px;flex:1;min-height:205px}.moves-list{max-height:220px;min-height:130px;overflow:auto;margin-top:16px;scrollbar-width:thin;scrollbar-color:var(--scrollbar) transparent}.empty-moves{text-align:center;color:var(--soft-text);padding:9px 0 17px}.empty-moves>span{font-size:32px;display:block;color:var(--soft-text)}.empty-moves p{font-size:12px;margin-top:4px}.move-row{display:grid;grid-template-columns:30px 1fr 1fr;gap:8px;border-radius:5px;padding:8px;font-size:12px;font-variant-numeric:tabular-nums}.move-row:nth-child(odd){background:var(--row-bg)}.move-number{color:var(--soft-text)}.move-row .latest{color:var(--accent)}.text-button{border:0;padding:0;background:none;color:var(--accent);font-size:11px;text-align:left}.text-button:hover{text-decoration:underline}.moves-panel>.text-button{margin-top:17px;padding-top:14px;border-top:1px solid var(--line);width:100%}.local-panel{display:flex;gap:12px;padding:4px 8px;color:var(--muted)}.local-icon{color:var(--accent);font-size:24px}.local-panel strong{font-size:11px;color:var(--secondary-text);font-weight:500}.local-panel p{font-size:10px;margin:6px 0 9px}.local-panel button{font-size:10px}footer{flex-wrap:wrap;line-height:1.6;border-top:1px solid var(--line);padding:23px 0;margin-top:28px;display:flex;gap:20px;justify-content:space-between;color:var(--soft-text);font-size:10px}footer a{color:var(--muted)}.loading{position:absolute;inset:0;background:var(--loading-bg);display:flex;align-items:center;justify-content:center;flex-direction:column;gap:18px;z-index:4}.loading h2{font:400 25px Georgia,serif;text-align:center}.loading p{font-size:12px;color:var(--muted)}progress{width:min(260px,70%);height:4px;accent-color:var(--accent);border:0;border-radius:4px;overflow:hidden}dialog{border:1px solid var(--dialog-line);border-radius:18px;background:var(--dialog-bg);color:var(--text);width:min(440px,calc(100% - 30px));padding:30px;box-shadow:0 25px 100px var(--dialog-shadow)}dialog::backdrop{background:var(--backdrop);backdrop-filter:blur(7px)}dialog h2{font:400 30px Georgia,serif;margin:10px 0 24px}dialog p{color:var(--muted);font-size:13px}dialog label:not(.checkbox-label){display:block;font-size:12px;margin:22px 0 9px}input,select{background:var(--input-bg);border:1px solid var(--input-line);color:var(--text);border-radius:7px;padding:12px;max-width:100%}dialog select{width:100%}input[type=file]{width:100%;font-size:11px;padding:10px}.field-note{font-size:11px!important;margin:10px 0 0!important;line-height:1.6}.dialog-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:27px}.checkbox-label{display:flex;gap:12px;align-items:center;font-size:13px;margin:22px 0}.checkbox-label input{accent-color:var(--accent)}#cache-retry{margin-top:20px}.promotion-options{display:flex;gap:10px;margin:20px 0}.promotion-options button{flex:1;min-width:0;background:var(--promotion-bg);border:1px solid var(--promotion-line);border-radius:8px;font-size:40px;padding:12px 0;color:var(--accent)}.promotion-options small{display:block;color:var(--text);font:11px "Segoe UI",sans-serif}.notice{position:fixed;bottom:25px;left:50%;transform:translateX(-50%);max-width:calc(100vw - 30px);width:520px;padding:16px 20px;background:var(--notice-bg);color:var(--notice-text);border:1px solid var(--notice-line);border-radius:10px;box-shadow:0 5px 30px var(--notice-shadow);z-index:20;font-size:13px;line-height:1.5}
@media(min-width:781px){.topbar{height:76px}main{padding-top:26px}.intro{margin-bottom:24px}h1{font-size:34px}.board-stage{height:clamp(360px,calc(100dvh - 390px),730px);aspect-ratio:auto}.moves-list{max-height:145px}}
@media(min-width:1500px){.sidebar{gap:22px}.moves-list{max-height:210px}}
@media(max-width:1080px){.game-layout{grid-template-columns:minmax(0,1fr) 280px;gap:20px}.intro p{display:none}.match-panel,.moves-panel{padding:18px}.board-stage{aspect-ratio:1}.camera-tip{display:none}.sidebar{padding-top:58px}.time-mode{letter-spacing:.7px;font-size:8px}}
@media(max-width:780px){.topbar{height:72px;padding:0 20px}.brand{font-size:12px;letter-spacing:1.4px}.brand img{width:34px;height:34px}.brand small{font-size:8px}.header-actions{gap:8px}.offline-pill{font-size:10px;max-width:125px}.header-actions .icon-button{width:36px;height:36px}main{padding:27px 18px 0}.intro{margin-bottom:23px}h1{font-size:29px}.game-layout{grid-template-columns:1fr}.board-stage{aspect-ratio:1.06;min-height:280px}.sidebar{padding-top:0;display:grid;grid-template-columns:1fr 1fr;gap:14px}.match-panel h2{font-size:23px}.local-panel{grid-column:1/-1}.moves-panel{min-height:250px}.moves-list{max-height:150px}.board-caption{font-size:8px;letter-spacing:1.2px;left:15px;right:15px}.move-entry{margin-bottom:8px}footer{flex-wrap:wrap;gap:12px;line-height:1.6}}
@media(max-width:480px){.topbar{padding:0 14px}.brand{gap:8px}.brand small{letter-spacing:2.5px}.offline-pill{max-width:95px;font-size:9px}.header-actions{gap:6px}main{padding:23px 12px 0}h1{font-size:27px}.intro{padding:0 5px}.sidebar{grid-template-columns:1fr}.match-panel{padding:22px}.match-panel p{min-height:0}.moves-panel{min-height:180px}.moves-list{min-height:70px}.empty-moves{padding:0}.empty-moves>span{display:none}.empty-moves p br{display:none}.board-caption span{display:none}.stage-toolbar{top:9px;right:9px}.stage-toolbar .icon-button{width:36px;height:36px}.board-stage{min-height:280px;aspect-ratio:1}.time-mode{display:none}.player-line{padding-left:5px;padding-right:5px}.engine-state{font-size:10px}.move-entry{padding:0 5px}.move-entry label{font-size:10px}.move-entry input{width:105px}.loading h2{font-size:21px}dialog{padding:23px}footer{padding-left:5px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}
.compatibility-status{font-size:12px;line-height:1.5;color:var(--muted);padding:12px 16px;border:1px solid var(--line);border-radius:8px;margin-bottom:20px}.loading.failed{padding:22px;gap:12px;justify-content:flex-start;overflow:auto}.loading.failed>img{width:36px;height:36px}.loading.failed h2{font-size:23px}.loading.failed p{font-size:13px;line-height:1.5;max-width:520px;overflow-wrap:anywhere}.loading.failed details{font-size:12px;max-width:100%;text-align:left}.loading.failed summary{cursor:pointer;color:var(--accent)}.loading.failed pre{white-space:pre-wrap;overflow-wrap:anywhere;font-size:11px;max-width:520px}.loading.failed>.button{flex-shrink:0}
@media(max-width:360px){.topbar{gap:7px}.brand{font-size:9px;letter-spacing:.7px;gap:6px}.brand img{width:28px;height:28px}.brand small{font-size:7px;letter-spacing:1.4px}.offline-pill{max-width:42px}.header-actions .button{padding:7px;font-size:9px;min-height:36px;max-width:60px}.header-actions .icon-button{width:30px;height:34px}}

.collapse-icon{display:none}#expand-board[aria-pressed=true] .expand-icon{display:none}#expand-board[aria-pressed=true] .collapse-icon{display:block}
body.board-expanded{overflow:hidden}.board-expanded .board-column{position:fixed;inset:0;z-index:15;width:100%;height:100dvh;padding:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px);display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:minmax(0,1fr) auto;background:var(--bg)}
.board-expanded .board-column>.player-line:not(.human-line){display:none}.board-expanded .board-stage{grid-column:1/-1;width:100%;height:100%;min-height:0;aspect-ratio:auto;border:0;border-radius:0;box-shadow:none}.board-expanded .human-line{padding:8px 16px;gap:9px;min-width:0}.board-expanded .human-line .avatar{width:30px;height:30px;font-size:23px}.board-expanded .human-line strong{font-size:11px}.board-expanded .human-line div>span{margin-top:2px}.board-expanded .time-mode,.board-expanded .camera-tip{display:none}.board-expanded .move-entry{margin:0;padding:8px 16px;gap:8px;flex-wrap:nowrap}.board-expanded .board-caption{bottom:12px}.board-expanded .stage-toolbar{z-index:5}
@media(max-width:600px){.board-expanded .board-column{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto auto}.board-expanded .human-line{padding:5px 12px}.board-expanded .human-line strong,.board-expanded .human-line div>span{display:inline;margin:0;font-size:11px}.board-expanded .human-line div>span{margin-left:8px}.board-expanded .human-line .avatar{width:25px;height:25px;font-size:20px}.board-expanded .move-entry{padding:3px 12px 8px}.board-expanded .move-entry input{flex:1;width:100px;min-width:0;padding:7px 10px}.board-expanded .move-entry .button{min-height:32px;padding:7px 11px}}
footer nav{display:flex;flex-wrap:wrap;gap:10px 18px}footer a:hover{text-decoration:underline}footer a[aria-current=page]{color:var(--accent)}.legal-header{max-width:980px;margin:auto;padding:28px 24px;display:flex;justify-content:space-between;align-items:center;gap:20px}.legal-content{max-width:850px;padding:30px 24px 40px}.legal-content h1{font-size:clamp(29px,5vw,44px);overflow-wrap:anywhere}.legal-lead{font-size:18px;color:var(--secondary-text);margin-top:22px}.legal-date{font-size:12px;color:var(--muted);margin-top:10px}.legal-content section{margin-top:32px}.legal-content h2{font:400 23px/1.3 Georgia,serif;margin-bottom:12px}.legal-content p,.legal-content address{font-size:15px;line-height:1.75;overflow-wrap:anywhere}.legal-content p+p{margin-top:13px}.legal-content address{font-style:normal}.legal-content section a{color:var(--accent);text-decoration:underline;text-underline-offset:3px}.legal-content footer{margin-top:42px;color:var(--muted);font-size:12px;flex-wrap:wrap}.legal-content footer nav{gap:12px 20px}@media(max-width:480px){.legal-header{padding:20px 16px;gap:10px}.legal-header .brand{font-size:10px}.legal-header .brand img{width:30px;height:30px}.legal-header .button{padding:10px;white-space:nowrap}.legal-content{padding:24px 20px 30px}.legal-lead{font-size:16px}.legal-content h2{font-size:21px}}
.board-stage{overscroll-behavior:contain}.touch-tip{display:none;font-size:10px;line-height:1.5;color:var(--muted);width:100%}.update-banner{position:fixed;bottom:max(16px,env(safe-area-inset-bottom));right:16px;width:min(390px,calc(100vw - 32px));z-index:25;padding:20px;background:var(--banner-bg);border:1px solid var(--accent);border-radius:14px;box-shadow:0 12px 45px var(--banner-shadow)}.update-banner strong{color:var(--accent);font-size:17px}.update-banner p{font-size:13px;margin:7px 0 14px}.update-banner>div{display:flex;gap:10px;flex-wrap:wrap}#check-update{margin-top:20px}
@media(pointer:coarse){.touch-tip{display:block}.camera-tip{display:none}.board-expanded .touch-tip{display:none}}
@media(max-width:480px){.header-actions #update-open{font-size:10px;padding:5px 8px;min-height:36px;max-width:70px}.header-actions:has(#update-open:not([hidden])) .offline-pill{display:none}}

.human-line>div{min-width:0}.human-line #turn-status{overflow-wrap:anywhere}
.human-line[data-alert=check] .human-avatar,.human-line[data-alert=mate] .human-avatar{border-color:var(--danger-line)}
.human-line[data-alert=check] #turn-status,.human-line[data-alert=mate] #turn-status{color:var(--danger-text);font-weight:500}
/* Independent background music controls. */
dialog .music-volume-label{display:flex!important;align-items:center;justify-content:space-between;margin:0 0 8px!important}#music-volume-value{color:var(--accent);font-variant-numeric:tabular-nums}#music-volume{display:block;width:100%;padding:0;min-height:32px;accent-color:var(--accent)}#music-volume:disabled{opacity:.4}

/* Native radios provide keyboard navigation and an explicit selected state. */
.theme-options{border:0;padding:0;margin:0;min-width:0;display:grid;gap:8px}
.theme-options legend{font-size:12px;font-weight:600;margin-bottom:12px;padding:0}
dialog .theme-choice{display:flex!important;align-items:center;gap:12px;margin:0!important;padding:12px;border:1px solid var(--line);border-radius:10px;background:var(--input-bg);cursor:pointer}
.theme-choice:hover{border-color:var(--accent)}
.theme-choice:has(input:checked){border-color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent);background:var(--button-bg)}
.theme-choice:has(input:focus-visible){outline:2px solid var(--accent);outline-offset:3px}
.theme-choice input{accent-color:var(--accent);flex-shrink:0;margin:0;width:16px;height:16px}
.theme-choice strong{display:block;font-size:12px;font-weight:600}
.theme-choice small{display:block;color:var(--muted);font-size:10px;line-height:1.5;margin-top:3px}
.theme-swatch{display:flex;flex-shrink:0;border:1px solid #80808055;border-radius:7px;overflow:hidden;width:48px;height:30px}
.theme-swatch i{flex:1}
.swatch-classic i:nth-child(1){background:#0e1714}.swatch-classic i:nth-child(2){background:#31483b}.swatch-classic i:nth-child(3){background:#d4b47b}
.swatch-mint i:nth-child(1){background:#f3f8f3}.swatch-mint i:nth-child(2){background:#b9d1c2}.swatch-mint i:nth-child(3){background:#236d56}
.swatch-rose i:nth-child(1){background:#fcf4f7}.swatch-rose i:nth-child(2){background:#d9bdcf}.swatch-rose i:nth-child(3){background:#984b70}
.swatch-blue i:nth-child(1){background:#ffffff}.swatch-blue i:nth-child(2){background:#c9d4e3}.swatch-blue i:nth-child(3){background:#2d64ae}

/* A compact app header and a centered playing area on phones and tablets. */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
@media(max-width:780px){
  .topbar{position:sticky;top:0;z-index:10;height:auto;min-height:64px;padding:calc(8px + env(safe-area-inset-top,0px)) max(14px,env(safe-area-inset-right,0px)) 8px max(14px,env(safe-area-inset-left,0px));gap:12px;background:var(--panel);box-shadow:0 2px 12px var(--board-shadow)}
  .topbar .brand{gap:9px;font-size:12px;letter-spacing:1.3px;flex-shrink:0}
  .topbar .brand img{width:32px;height:32px}
  .topbar .brand small{font-size:8px;letter-spacing:2.4px;margin-top:3px}
  .topbar .header-actions{gap:10px;min-width:0}
  .topbar .offline-pill{font-size:10px;line-height:1.3;max-width:112px;gap:6px}
  .topbar .offline-pill.ready{white-space:nowrap}
  .topbar .offline-pill i{flex-shrink:0}
  .topbar .header-actions .icon-button{width:44px;height:44px;flex-shrink:0}
  .topbar .header-actions .button{font-size:10px;padding:7px 9px;min-height:40px;max-width:86px}
  .topbar:has(.header-actions .button:not(.header-statistics):not([hidden])) .offline-pill{display:none}
  .topbar:has(#update-open:not([hidden])) #install{display:none}
  main{padding:14px max(12px,env(safe-area-inset-right,0px)) 0 max(12px,env(safe-area-inset-left,0px))}
  .intro{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
  .game-layout{gap:16px}
  body:not(.board-expanded) .board-column{width:100%;max-width:620px;margin-inline:auto}
  body:not(.board-expanded) .board-column>.player-line{padding:0 4px 12px;gap:10px}
  body:not(.board-expanded) .player-line .avatar{width:34px;height:34px;border-radius:10px;font-size:25px;flex-shrink:0}
  body:not(.board-expanded) .player-line strong{font-size:12px}
  body:not(.board-expanded) .player-line div>span{font-size:11px;margin-top:3px}
  .engine-state{font-size:10px;padding:5px 9px}
  body:not(.board-expanded) .board-stage{display:grid;grid-template-rows:auto 52px;width:100%;height:auto;min-height:0;aspect-ratio:auto;border-radius:14px;box-shadow:0 8px 24px var(--board-shadow)}
  body:not(.board-expanded) #canvas{grid-area:1/1;width:100%;height:auto;min-width:0;aspect-ratio:1.06}
  body:not(.board-expanded) .stage-toolbar{position:static;grid-area:2/1;justify-content:center;align-items:center;gap:16px;padding:4px;background:var(--panel);border-top:1px solid var(--line)}
  body:not(.board-expanded) .stage-toolbar .icon-button{width:44px;height:44px;border-radius:9px;font-size:22px}
  body:not(.board-expanded) .loading{bottom:52px}
  .board-caption{display:none}
  body:not(.board-expanded) .board-column>.human-line{padding:12px 4px 4px}
  .time-mode{display:none}
  body:not(.board-expanded) .move-entry{padding:0 4px;margin:10px 0 0;gap:8px}
  body:not(.board-expanded) .move-entry label{font-size:11px}
  body:not(.board-expanded) .move-entry input{flex:1;min-width:65px;width:100px;max-width:180px;font-size:16px;padding:10px}
  body:not(.board-expanded) .move-entry .button{min-height:44px;padding:10px 14px}
  .touch-tip{font-size:10px;line-height:1.5}
  .sidebar{width:100%;max-width:620px;margin-inline:auto}
  .match-panel{padding:16px}
  .match-panel>.eyebrow{display:none}
  .match-panel h2{font-size:21px;margin:0 0 8px}
  .match-panel p{min-height:0;margin-bottom:14px}
}
@media(max-width:360px){
  .topbar{gap:8px;padding-inline:10px}
  .topbar .brand{font-size:11px;letter-spacing:1px;gap:7px}
  .topbar .header-actions{gap:7px}
  .topbar .offline-pill{font-size:9px}
}

/* Equal action sizes and one short note per setting. */
.header-statistics{color:var(--accent);background:var(--button-bg);border-color:var(--accent);height:44px;white-space:nowrap;flex-shrink:0}
.header-statistics:hover{background:var(--button-hover)}
.header-statistics svg{flex-shrink:0}
.header-actions #settings-open{width:44px;height:44px;flex-shrink:0}
#settings-dialog{width:min(560px,calc(100% - 28px));max-height:calc(100dvh - 28px);padding:24px;overflow:hidden}
#settings-dialog[open]{display:flex;flex-direction:column}
.settings-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;padding-bottom:18px;border-bottom:1px solid var(--line);flex-shrink:0}
.settings-heading h2{margin:6px 0 0}
.settings-heading .icon-button{flex-shrink:0;width:44px;height:44px}
.settings-content{overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--scrollbar) transparent;padding:22px 6px 22px 0;min-height:0}
.settings-section{display:grid;gap:20px}
.settings-section+.settings-section{border-top:1px solid var(--line);margin-top:24px;padding-top:24px}
.settings-section h3{font-size:11px;letter-spacing:1.5px;text-transform:uppercase;color:var(--accent);font-weight:600}
.settings-field{min-width:0}
#settings-dialog .settings-field>label:not(.checkbox-label){margin:0 0 8px;font-weight:500}
#settings-dialog .settings-field>.button{display:flex;width:100%;min-height:44px;margin:0}
#settings-dialog .settings-field>select{min-height:44px}
#settings-dialog .settings-field>.field-note{margin:6px 0 0!important;font-size:11px!important;line-height:1.5}
#settings-dialog .settings-toggle{justify-content:space-between;gap:16px;margin:0;min-height:26px;font-size:12px;font-weight:500;cursor:pointer}
.settings-toggle input{width:18px;height:18px;margin:0;flex-shrink:0}
#settings-dialog .theme-options legend{margin-bottom:10px;font-weight:500}
.settings-footer{border-top:1px solid var(--line);padding:16px 6px 0 0;margin:0;flex-shrink:0}
.settings-footer>.button{width:100%;min-height:44px}
@media(min-width:600px){#settings-dialog .theme-options{grid-template-columns:repeat(2,minmax(0,1fr))}#settings-dialog .theme-choice{gap:9px;padding:10px}.settings-heading h2{font-size:28px}}
@media(max-width:900px){
  .topbar .offline-pill{max-width:none;gap:0;flex-shrink:0}
  .topbar .offline-label{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
}
@media(max-width:780px){.topbar .header-actions .header-statistics{max-width:none;min-height:44px}}
@media(max-width:600px){
  .topbar .header-actions .header-statistics{max-width:none;min-height:44px;padding:8px 10px;gap:7px;font-size:12px}
  .topbar .header-actions{gap:8px}
  .topbar:has(.header-actions>.button:not(.header-statistics):not([hidden])) .brand>span{display:none}
  #settings-dialog{padding:20px}
  .settings-heading h2{font-size:26px}
}
@media(max-width:380px){.topbar .header-actions{gap:6px}.topbar .header-actions .header-statistics{padding:8px;gap:5px;font-size:11px}.header-statistics svg{width:18px;height:18px}.topbar .brand{font-size:10px;letter-spacing:.8px}.topbar .brand small{letter-spacing:1.7px}}

/* The same playing area hosts either the 3D canvas or a square vector board. */
.rating-panel{border:1px solid var(--line);border-radius:14px;background:var(--panel);padding:18px 22px}
.rating-line{display:flex;align-items:center;gap:12px;margin-top:10px}.rating-line>strong{font-size:30px;font-weight:600;font-variant-numeric:tabular-nums}.rating-line>span{font-size:11px;color:var(--muted);line-height:1.5}.rating-panel p{font-size:11px;color:var(--muted);margin:8px 0 12px}
.statistics-dialog{width:min(1120px,calc(100% - 28px));max-height:calc(100dvh - 28px);overflow:auto}
.statistics-heading{display:flex;align-items:center;justify-content:space-between;gap:15px}.statistics-heading h2{margin-bottom:8px}.statistics-heading>.icon-button{flex-shrink:0}
.statistics-heading{position:sticky;top:-30px;z-index:6;background:var(--dialog-bg);padding:8px 0}
.statistics-nav{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:8px 0 16px}.statistics-nav>.button{min-width:0;min-height:44px;padding:8px 10px}
.statistics-info{font-size:12px;color:var(--muted);margin-bottom:12px}.statistics-info summary{cursor:pointer;color:var(--accent)}
#statistics-overview,#archive-section,#game-review{scroll-margin-top:100px}
@media(max-width:780px){.statistics-heading{top:-20px}.statistics-nav{grid-template-columns:repeat(2,minmax(0,1fr))}}
.statistics-overview{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:24px}.statistics-overview>div{background:var(--panel);border:1px solid var(--line);border-radius:10px;padding:16px}.statistics-overview span{display:block;color:var(--muted);font-size:11px;line-height:1.5}.statistics-overview strong{display:block;font-size:25px;margin-top:6px;font-variant-numeric:tabular-nums}
.elo-history{margin-top:24px;border-bottom:1px solid var(--line)}.statistics-chart{display:block;width:100%;height:auto;max-height:200px;margin-top:12px}
.statistics-tables{display:grid;grid-template-columns:1fr 1fr;gap:20px;margin:24px 0}.statistics-dialog h3{font-size:15px;font-weight:600;margin-bottom:10px}.statistics-table-scroll{overflow:auto}.statistics-dialog table{width:100%;border-collapse:collapse;font-size:11px}.statistics-dialog th,.statistics-dialog td{padding:9px 6px;text-align:right;border-bottom:1px solid var(--line);font-variant-numeric:tabular-nums}.statistics-dialog th:first-child{text-align:left}.statistics-dialog thead th{color:var(--muted);font-weight:500}
.statistics-facts{margin:0}.statistics-facts>div{display:flex;justify-content:space-between;gap:12px;padding:8px 0;font-size:12px;border-bottom:1px solid var(--line)}.statistics-facts dt{color:var(--muted)}.statistics-facts dd{margin:0;text-align:right;font-variant-numeric:tabular-nums}
.archive-layout{display:grid;grid-template-columns:minmax(230px,.75fr) minmax(0,1.5fr);gap:24px;border-top:1px solid var(--line);padding-top:24px}.archive-panel{min-width:0}.archive-panel input,.archive-panel select{width:100%}.archive-list{max-height:340px;overflow:auto;margin:12px 0 16px}.archive-entry{display:block;width:100%;text-align:left;border:1px solid var(--line);border-radius:8px;padding:12px;margin-bottom:8px;background:var(--panel);color:var(--text)}.archive-entry[aria-pressed=true]{border-color:var(--accent);background:var(--button-bg)}.archive-entry strong{display:flex;justify-content:space-between;gap:8px;font-size:12px}.archive-entry strong>span{color:var(--accent);font-variant-numeric:tabular-nums}.archive-entry small{display:block;font-size:10px;color:var(--muted);line-height:1.6;margin-top:5px}.archive-import{margin-top:18px}.archive-import summary{font-size:12px;color:var(--accent);cursor:pointer}
.review-surface{position:relative;aspect-ratio:1;width:100%;max-width:480px;margin:16px auto 0;border:1px solid var(--line);border-radius:8px;overflow:hidden}.review-controls{display:flex;gap:8px;justify-content:center;margin:10px 0}.review-controls .button{min-width:44px}.game-review #review-position{font-size:11px;margin:12px 0 4px}.game-review>input[type=range]{display:block;width:100%;padding:0;min-height:32px;accent-color:var(--accent)}.review-moves{display:flex;flex-wrap:wrap;gap:5px;max-height:130px;overflow:auto;margin-top:8px}.review-moves>button{border:1px solid var(--line);border-radius:5px;background:var(--panel);padding:5px 8px;font-size:11px}.review-moves>button[aria-current=step]{background:var(--accent);color:var(--on-accent)}.analysis-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:18px}.analysis-moves{max-height:280px;overflow:auto}.analysis-move{width:100%;display:grid;grid-template-columns:75px 1fr;gap:4px 12px;border:0;border-bottom:1px solid var(--line);padding:10px 6px;text-align:left;background:none;color:var(--text);font-size:11px}.analysis-move small{grid-column:2;color:var(--muted)}#analysis-progress{display:block;width:100%;margin-top:16px}
.archive-import a{color:var(--accent);text-decoration:underline;text-underline-offset:3px}
.optional-label{font-weight:400;color:var(--muted);margin-left:5px;font-size:10px}
.archive-import textarea{display:block;width:100%;min-height:150px;max-height:360px;resize:vertical;background:var(--input-bg);border:1px solid var(--input-line);color:var(--text);border-radius:7px;padding:12px;font:12px/1.6 ui-monospace,Consolas,monospace;overflow-wrap:anywhere}
textarea:focus-visible{outline:2px solid var(--accent);outline-offset:4px}
.archive-import>.button{width:100%;margin-top:12px}
#import-pgn-label{scroll-margin-top:105px}
.archive-panel #archive-backup{width:100%}
.archive-entry small,.game-review p,.analysis-move{overflow-wrap:anywhere}
.move-explanation{margin-top:16px;padding:16px;border:1px solid var(--line);border-radius:10px;background:var(--panel)}
.move-explanation>strong{font-size:13px;color:var(--accent)}
.move-explanation>p:not(.field-note){font-size:12px;margin-top:8px;line-height:1.6;color:var(--text)}
.explanation-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.explanation-actions>.button{flex:1;min-width:150px;padding:10px;min-height:44px}
.analysis-list-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:20px 0 10px}
.analysis-list-heading h3{margin:0}
dialog .analysis-list-heading label{margin:0;font-size:10px;color:var(--muted)}
.analysis-list-heading select{display:block;min-height:36px;padding:6px;margin-top:4px;font-size:11px}
.analysis-moves{max-height:440px}
.analysis-move{border:1px solid var(--line);border-left:3px solid var(--accent);border-radius:8px;margin:0 0 8px;padding:12px;line-height:1.6;background:var(--panel);grid-template-columns:minmax(65px,auto) minmax(0,1fr)}
.analysis-move[data-grade=blunder],.analysis-move[data-grade=mistake]{border-left-color:var(--danger-text)}
.analysis-move[aria-current=step]{border-color:var(--accent);background:var(--button-bg)}
.analysis-move small{grid-column:1/-1;font-size:11px}
.analysis-move .analysis-reason{color:var(--text);margin-top:4px}
#review-return{display:block;margin:10px 0;font-size:12px;min-height:44px}
.review-surface{scroll-margin-top:100px}
.review-practice-actions{margin:16px 0;padding:16px;border:1px solid var(--line);border-radius:10px;background:var(--panel)}
.review-practice-actions>.button,.review-practice-actions select,#review-variation-open{width:100%}
#review-variation-open{margin-top:8px}
.practice-dialog{width:min(1040px,calc(100% - 28px));max-height:calc(100dvh - 28px);overflow:auto}
.practice-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;position:sticky;top:-30px;z-index:6;padding:8px 0;background:var(--dialog-bg);border-bottom:1px solid var(--line)}
.practice-heading h2{margin:6px 0 12px}.practice-heading .icon-button{flex-shrink:0;width:44px;height:44px}
.practice-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(240px,290px);gap:24px;margin-top:14px}
.practice-board-column,.practice-options{min-width:0}.practice-board-column .review-surface{margin-top:0}
.practice-status{text-align:center;min-height:24px;font-size:13px;margin-top:12px;color:var(--accent)}
.practice-options>select{width:100%;min-height:44px}
.practice-options>label:first-child{margin-top:0}
.practice-options .settings-toggle{justify-content:space-between;margin:18px 0 0;font-size:13px;cursor:pointer}
.practice-options .settings-toggle input{width:18px;height:18px;margin:0}
.practice-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.practice-actions>.button{flex:1;min-height:44px;min-width:120px;padding:10px}
.practice-move-form{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;margin-top:14px}
.practice-move-form>label{grid-column:1/-1;margin:0!important}.practice-move-form>input{width:100%;min-width:0}
.practice-coach-hint{margin-top:12px;font-size:13px;color:var(--accent);line-height:1.6}
#practice-feedback{overflow-wrap:anywhere}
@media(max-width:780px){.practice-dialog{padding:20px}.practice-heading{top:-20px}.practice-heading h2{font-size:26px}.practice-layout{grid-template-columns:minmax(0,1fr);gap:24px}.practice-options{border-top:1px solid var(--line);padding-top:20px}.practice-move-form>input{font-size:16px}.practice-actions>.button{min-width:130px}}
@media(max-width:780px){.archive-import textarea,.archive-import input[type=text]{font-size:16px}.explanation-actions{flex-direction:column}.explanation-actions>.button{width:100%}.analysis-move{grid-template-columns:1fr}.analysis-move>span{font-size:11px}}
@media(max-width:780px){.rating-panel{grid-column:1/-1}.statistics-dialog{padding:20px}.statistics-overview{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.statistics-overview>div{padding:12px}.statistics-overview strong{font-size:21px}.archive-layout{grid-template-columns:1fr}.statistics-tables{grid-template-columns:1fr}.archive-list{max-height:220px}.statistics-heading h2{font-size:25px}.statistics-heading .icon-button{width:44px;height:44px}}
.player-clock{flex-shrink:0;min-width:86px;padding:8px 12px;border:1px solid var(--line);border-radius:10px;background:var(--panel);color:var(--text);font-size:21px;font-weight:600;line-height:1.2;text-align:center;font-variant-numeric:tabular-nums;letter-spacing:.5px}
.player-clock[data-active=true]{background:var(--button-bg);border-color:var(--accent);box-shadow:inset 3px 0 var(--accent)}
.player-clock[data-low=true]{color:var(--danger-text);border-color:var(--danger-line)}
.human-line>.player-clock{margin-left:auto}
.human-line:has(.player-clock:not([hidden])) .time-mode{margin-left:0;max-width:160px;text-align:right;line-height:1.5}
#custom-minutes{width:100%}
@media(max-width:780px){.player-clock{min-width:76px;font-size:18px;padding:7px 9px}.player-line:has(.player-clock:not([hidden])) .engine-state{display:none}}
:root{--flat-light:#dbc8a8;--flat-dark:#967957;--flat-trail:#e5cf5266;--flat-selected:#356e53;--flat-target:#24473488}
:root[data-theme=mint]{--flat-light:#eef1df;--flat-dark:#8da68f;--flat-trail:#3e9a6e4d;--flat-selected:#236d56;--flat-target:#174b3c88}
:root[data-theme=rose]{--flat-light:#f6e8e0;--flat-dark:#b68f9e;--flat-trail:#c761964d;--flat-selected:#88375f;--flat-target:#60233f88}
:root[data-theme=blue]{--flat-light:#edf2f7;--flat-dark:#91aaca;--flat-trail:#367fd34d;--flat-selected:#235b9f;--flat-target:#143f7888}
.board-surface{position:relative;width:100%;height:100%;min-width:0;min-height:0}
.stage-toolbar{z-index:5}
#view{font-size:13px;font-weight:700;letter-spacing:.3px}
.flat-board{position:absolute;inset:0;display:grid;place-items:center;background:var(--stage-bg);user-select:none;-webkit-user-select:none}
.chess-grid{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));grid-template-rows:repeat(8,minmax(0,1fr));overflow:hidden}
.board-square{position:relative;display:block;border:0;border-radius:0;padding:0;min-width:0;min-height:0;line-height:1;touch-action:manipulation;isolation:isolate}
.board-square.light-square{background:var(--flat-light);color:#35413d}
.board-square.dark-square{background:var(--flat-dark);color:#fffdf5}
.board-square::before{content:"";position:absolute;inset:0;pointer-events:none;z-index:0}
.board-square.last-square::before{background:var(--flat-trail)}
.board-square.selected-square{box-shadow:inset 0 0 0 4px var(--flat-selected)}
.board-square.move-target::after{content:"";position:absolute;left:35%;top:35%;width:30%;height:30%;border-radius:50%;background:var(--flat-target);pointer-events:none;z-index:2}
.board-square.capture-target::after{content:"";position:absolute;inset:3%;border:4px solid var(--flat-selected);border-radius:50%;pointer-events:none;z-index:2}
.board-square.check-square{background-image:radial-gradient(ellipse at center,#e34d53dd 5%,#df4a4a99 45%,transparent 75%)}
.board-square.mate-square{box-shadow:inset 0 0 0 3px #b62032}
.board-square:focus-visible{outline:3px solid var(--flat-selected);outline-offset:-3px;z-index:2}
.board-square[aria-disabled=true]{cursor:default}
.square-piece{position:absolute;inset:0;display:grid;place-items:center;pointer-events:none;z-index:1}
.flat-piece{display:block;width:88%;height:88%;stroke-width:1.8;stroke-linejoin:round;stroke-linecap:round;overflow:visible}
.flat-piece.piece-white{fill:#fffdf4;stroke:#28313b;filter:drop-shadow(0 1px 1px #14223544)}
.flat-piece.piece-black{fill:#272e37;stroke:#111922;filter:drop-shadow(0 0 .8px #fffdf4)}
.flat-piece .piece-detail{fill:none;stroke-width:1.4}
.flat-piece.piece-black .piece-detail{stroke:#cbd1da}
.flat-piece .piece-eye{fill:#28313b;stroke:none}
.flat-piece.piece-black .piece-eye{fill:#fffdf4}
.square-file,.square-rank{position:absolute;z-index:1;pointer-events:none;font-weight:600;font-variant-numeric:tabular-nums}
.square-file{bottom:3%;right:5%}.square-rank{top:5%;left:5%}
.board-stage[data-mode="2d"]{display:grid;grid-template-rows:minmax(0,1fr) 52px;aspect-ratio:auto}
.board-stage[data-mode="2d"] .stage-toolbar{position:static;justify-content:center;align-items:center;gap:16px;padding:4px;background:var(--panel);border-top:1px solid var(--line)}
.board-stage[data-mode="2d"] .stage-toolbar .icon-button{width:44px;height:44px}
.board-stage[data-mode="2d"] .loading,.board-stage[data-mode="2d"] .board-caption{display:none!important}
@media(max-width:780px){
  body:not(.board-expanded) .board-surface{grid-area:1/1;height:auto;aspect-ratio:1.06}
  body:not(.board-expanded) #canvas{height:100%;aspect-ratio:auto}
  body:not(.board-expanded) .loading{bottom:0}
  body:not(.board-expanded) .board-stage[data-mode="2d"]{grid-template-rows:auto 52px}
  body:not(.board-expanded) .board-stage[data-mode="2d"] .board-surface{aspect-ratio:1}
  body:not(.board-expanded) .stage-toolbar #view{font-size:13px}
}
