.chess-main{max-width:1320px;margin:82px auto 0;padding:38px 28px 72px}
.chess-intro{display:flex;justify-content:space-between;align-items:flex-end;gap:24px;margin-bottom:22px}
.chess-intro h1{font-size:clamp(2rem,4vw,3rem);font-weight:650;letter-spacing:-.035em;line-height:1.1;margin:0 0 8px}
.chess-intro p{margin:0;color:var(--text-secondary);font-size:1.0625rem}
.chess-live-state{display:inline-flex;align-items:center;gap:10px;white-space:nowrap;color:var(--text-secondary);font-weight:600}
.chess-live-dot{width:10px;height:10px;border-radius:50%;background:var(--accent2);box-shadow:0 0 0 4px color-mix(in srgb,var(--accent2) 16%,transparent)}
.chess-game[hidden]{display:none}
.chess-game{position:relative;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-areas:"first second" "toolbar toolbar" "rocker rocker";gap:20px;outline-offset:6px}
.chess-face{position:relative;isolation:isolate;overflow:hidden;display:flex;align-items:center;justify-content:center;min-width:0;min-height:clamp(250px,27vw,350px);padding:28px;border:1px solid var(--border);border-radius:20px;background:var(--bg-alt);color:var(--text);touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;cursor:pointer;text-align:center;transition:border-color .18s ease,background .18s ease,transform .1s ease}
.chess-face::before{content:"";position:absolute;z-index:-1;inset:0;background:radial-gradient(ellipse at 50% 100%,color-mix(in srgb,var(--accent2) 13%,transparent),transparent 64%);opacity:0;transition:opacity .2s ease}
.chess-face:focus-visible,.chess-rocker:focus-visible,.chess-page button:focus-visible,.chess-page summary:focus-visible{outline:3px solid var(--accent2);outline-offset:3px}
.chess-face[data-player=white]{background:linear-gradient(145deg,var(--card-bg),var(--bg-alt))}
.chess-face[data-player=black]{background:linear-gradient(145deg,var(--bg-alt),color-mix(in srgb,var(--bg) 45%,var(--bg-alt)))}
.chess-face.is-active{border:2px solid var(--accent2);box-shadow:0 8px 28px color-mix(in srgb,var(--accent2) 18%,transparent)}
.chess-face.is-active::before{opacity:1}
.chess-face.is-active .chess-turn{color:var(--accent2);font-weight:650}
.chess-face:not(.is-active){color:var(--text-secondary)}
.chess-face.is-flagged{border:3px double #d17a57}
.chess-face.is-pressed{transform:translateY(2px)}
.chess-face[aria-disabled=true]{cursor:default}
.chess-first{grid-area:first}.chess-second{grid-area:second}
.chess-face-content{display:flex;flex-direction:column;align-items:center;gap:12px;width:100%;min-width:0}
.chess-color{font-size:1.25rem;font-weight:650;letter-spacing:.01em}
.chess-time{display:block;max-width:100%;font-size:clamp(4rem,9.2vw,8.25rem);font-weight:650;font-variant-numeric:tabular-nums;line-height:1;letter-spacing:-.04em;white-space:nowrap;color:var(--digit-color)}
.chess-turn{min-height:1.6em;font-size:1rem;color:var(--text-secondary)}
.chess-opposed .chess-first .chess-face-content{transform:rotate(180deg)}
.chess-toolbar{grid-area:toolbar;align-self:center;position:relative;padding:6px 0 0}
.chess-main-controls{display:flex;align-items:center;justify-content:center;gap:12px;flex-wrap:wrap}
.chess-main-controls button,.chess-main-controls summary,.chess-dialog button,.chess-focus>header button,.chess-control-summary button,.chess-editor-actions button,.chess-notice button{min-height:48px;padding:11px 18px;border:1px solid var(--input-border);border-radius:10px;background:var(--card-bg);color:var(--text);font:inherit;font-weight:600;cursor:pointer}
.chess-main-controls .btn-primary,.chess-dialog .btn-primary,.chess-editor-actions .btn-primary{background:var(--accent);color:var(--bg);border-color:var(--accent)}
.chess-page button:disabled{cursor:not-allowed;opacity:.55}
.chess-reset{background:transparent!important}
.chess-main-controls summary{display:flex;align-items:center;list-style:none}.chess-main-controls summary::-webkit-details-marker{display:none}
.chess-more-panel{position:absolute;right:0;bottom:calc(100% + 8px);z-index:10;width:min(340px,90vw);max-height:min(380px,65dvh);overflow:auto;background:var(--card-bg);border:1px solid var(--input-border);border-radius:14px;padding:14px;box-shadow:var(--shadow-lg);backdrop-filter:blur(14px)}
.chess-more-panel>span{display:block;padding:5px 8px 12px;color:var(--text-secondary);font-variant-numeric:tabular-nums}
.chess-more-panel button{display:block;width:100%;text-align:left;margin:0 0 7px}
.chess-more-panel p{font-size:.875rem;color:var(--text-secondary);line-height:1.5;padding:4px 8px}
.chess-message{text-align:center;margin:10px 0 0;min-height:1.6em;color:var(--text-secondary);font-size:.9375rem}
.chess-control-summary{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:20px;margin:16px 0 24px;padding:22px 24px;border:1px solid var(--border);border-radius:16px;background:var(--surface)}
.chess-control-summary>div:first-child{display:flex;align-items:center;gap:12px 20px;flex-wrap:wrap}
.chess-control-summary strong{font-size:1.125rem}
#chessControl{display:inline-flex;align-items:center;min-height:40px;padding:6px 12px;border:1px solid var(--input-border);border-radius:999px;color:var(--text-secondary);font-variant-numeric:tabular-nums}
#chessFocusOpen{white-space:nowrap}
#chessLockedControl{grid-column:1/-1;margin:0;padding:14px 0 0;border:0;border-top:1px solid var(--border);color:var(--text-secondary)}
.chess-editor{margin:0 0 24px;border:1px solid var(--border);border-radius:16px;padding:0 20px;background:var(--surface)}
.chess-editor>summary{min-height:56px;display:flex;align-items:center;cursor:pointer;font-weight:650}
.chess-editor[open]>summary{border-bottom:1px solid var(--border)}
.chess-editor .chess-settings-form{border:0;padding:22px 0}
.chess-settings-form fieldset{border:0;margin:0;padding:0}
.chess-settings-form legend{font-size:1.125rem;font-weight:650;margin-bottom:16px}
.chess-presets{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px}
.chess-presets button{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;min-height:82px;padding:12px;border:1px solid var(--input-border);border-radius:12px;background:var(--card-bg);color:var(--text);font:inherit;cursor:pointer}
.chess-presets button[aria-pressed=true]{border:2px solid var(--accent2);padding:11px;background:color-mix(in srgb,var(--accent2) 8%,var(--card-bg))}
.chess-presets button strong{font-size:1rem}.chess-presets button span{font-size:.8125rem;color:var(--text-secondary)}.chess-presets button small{font-size:.75rem;color:var(--text-secondary)}
.chess-presets button[aria-pressed=true] strong::after{content:" · выбрано";font-size:.7rem;color:var(--accent2)}
.chess-settings-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-top:22px}
.chess-page label{display:block;font-size:.9375rem}.chess-page input[type=number],.chess-page select{display:block;width:100%;min-height:48px;margin-top:7px;padding:10px 12px;border:1px solid var(--input-border);border-radius:9px;background:var(--input-bg);color:var(--text);font:inherit}
.chess-page input:focus-visible,.chess-page select:focus-visible{outline:3px solid var(--accent2);outline-offset:2px}
.chess-options{display:flex;flex-wrap:wrap;gap:14px 28px;margin-top:18px}.chess-options label{display:flex;align-items:center;gap:9px}.chess-options input{width:18px;height:18px;accent-color:var(--accent)}
#chessPresetChoice,#chessDraftPreview,#chessSettingsStatus{margin:12px 0 0;color:var(--text-secondary)}
.chess-editor-actions{display:flex;gap:10px;flex-wrap:wrap;margin:16px 0 8px}
.chess-notice:empty{display:none}.chess-notice{padding:12px 14px;border:1px solid var(--border);border-radius:10px;font-size:.9375rem}
.chess-policy{color:var(--text-secondary);font-size:.9375rem;line-height:1.6;margin:18px 0 32px;background:var(--glass);border:1px solid var(--glass-border);border-radius:14px;padding:24px 28px;backdrop-filter:blur(12px)}
.chess-help{max-width:76ch;margin:32px auto 0;color:var(--text-secondary);background:var(--glass);border:1px solid var(--glass-border);border-radius:14px;padding:24px 28px;backdrop-filter:blur(12px)}.chess-help h2{margin:30px 0 8px;color:var(--text);font-size:1.25rem}.chess-help h2:first-child{margin-top:0}.chess-help p{margin:0 0 12px}.chess-help p:last-child{margin-bottom:0}.chess-help a{text-decoration:underline;text-underline-offset:3px}
.chess-page button,.chess-page summary{min-height:44px}
.chess-dialog{width:min(520px,calc(100vw - 28px));max-height:min(88dvh,700px);margin:auto;padding:26px;border:1px solid var(--input-border);border-radius:18px;background:var(--bg);color:var(--text);box-shadow:var(--shadow-lg)}
.chess-dialog::backdrop{background:rgb(3 8 18 / .65);backdrop-filter:blur(3px)}.chess-dialog h2{font-size:1.375rem;line-height:1.25;margin:0 0 12px}.chess-dialog p{margin:0 0 12px;color:var(--text-secondary)}.chess-dialog label{margin:12px 0}.chess-dialog-actions{display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap;margin-top:20px}
.chess-focus{inset:0;width:100vw;max-width:none;height:100dvh;max-height:none;margin:0;padding:12px;border:0;background:var(--bg);color:var(--text)}
.chess-focus::backdrop{background:var(--bg)}.chess-focus>header{display:flex;align-items:center;justify-content:space-between;min-height:48px;padding:0 max(6px,env(safe-area-inset-left)) 8px;font-weight:650}.chess-focus>.chess-game{height:calc(100dvh - 80px);grid-template-rows:minmax(0,1fr) auto minmax(0,1fr);gap:14px;padding:10px}
.chess-focus .chess-face{min-height:0;padding:16px}.chess-focus .chess-time{font-size:clamp(2.5rem,14vw,10rem)}
.chess-rocker{grid-area:rocker;display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:58px;padding:8px 18px;border:1px solid var(--border);border-radius:12px;background:var(--surface);color:var(--text);font:inherit;cursor:pointer}
.chess-rocker:disabled{opacity:.65}.chess-rocker span{margin:0;color:var(--text-secondary)}.chess-rocker .rocker-action{color:var(--text);font-weight:650}.chess-rocker .rocker-action>span{display:block;font-size:.8rem;font-weight:400}
.chess-game[data-phase=running][data-active-side=first] .chess-rocker{border-color:var(--accent2)}.chess-game[data-phase=running][data-active-side=second] .chess-rocker{border-color:var(--accent2)}
.chess-focus-open{overflow:hidden}
@media(max-width:900px){.chess-settings-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.chess-presets{grid-template-columns:repeat(3,minmax(0,1fr))}.chess-time{font-size:clamp(3.5rem,10vw,7rem)}}
@media(max-width:700px) and (orientation:portrait){.chess-main{margin-top:72px;padding:28px 16px 54px}.chess-intro{align-items:flex-start;flex-direction:column;gap:10px}.chess-intro h1{font-size:2rem}.chess-game{grid-template-columns:minmax(0,1fr);grid-template-areas:"first" "toolbar" "second" "rocker";gap:15px}.chess-face{min-height:clamp(178px,30vh,260px);padding:22px 14px}.chess-time{font-size:clamp(4rem,19vw,6.5rem)}.chess-toolbar{padding:0}.chess-main-controls{gap:8px}.chess-main-controls button,.chess-main-controls summary{padding:9px 12px}.chess-control-summary{grid-template-columns:1fr;gap:12px;padding:17px}.chess-control-summary>div:first-child{gap:10px}.chess-settings-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.chess-focus>.chess-game{height:calc(100dvh - 80px);padding:6px;grid-template-rows:minmax(0,1fr) auto minmax(0,1fr);grid-template-areas:"first" "toolbar" "second";gap:8px}.chess-focus .chess-rocker{display:none}.chess-focus .chess-face{min-height:0;padding:8px}.chess-focus .chess-time{font-size:clamp(2rem,18vw,6rem)}.chess-focus .chess-face-content{gap:5px}}
@media(max-height:480px) and (orientation:landscape){.chess-focus>.chess-game{height:calc(100dvh - 80px);grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto;grid-template-areas:"first second" "toolbar toolbar";gap:8px}.chess-focus .chess-rocker{display:none}.chess-focus .chess-face{padding:8px}.chess-focus .chess-time{font-size:clamp(2rem,13vh,5rem)}.chess-focus .chess-turn{font-size:.8rem}}
@media(prefers-reduced-motion:reduce){.chess-face,.chess-face::before{transition:none!important}}
@media(forced-colors:active){.chess-face,.chess-rocker,.chess-main-controls button,.chess-control-summary,.chess-editor{border:1px solid ButtonText;box-shadow:none}.chess-face.is-active{border:3px solid Highlight;color:HighlightText}.chess-face.is-active::before{display:none}}

/* Scene 04: live clock surfaces over the isolated original king pixels. */
body.chess-page{background:#020e1c url('/assets/concept-ui/chess/starfield-horizon-v1.8fb66b26ce4a.webp') center 0/100% auto no-repeat;color:var(--text)}
.chess-main{max-width:1586px;margin-top:54px;padding:24px clamp(20px,2.9vw,46px) 64px}
body.chess-page .chess-main{--text:#f5fbff;--text-secondary:#b8d3e8;--text-muted:#91b8d4;--digit-color:#fff;--surface:#071d32;--card-bg:#071d32;--glass:rgba(2,19,32,.83);--glass-border:rgba(40,161,204,.5);--input-bg:#0a2742;--input-border:#3d7194;color:#f5fbff}
.chess-page .chess-help,.chess-page .footer{--accent:#65d8f4;--accent2:#68ead5;--text-muted:#91b8d4;--text-secondary:#b8d3e8}
.chess-breadcrumb{display:flex;flex-wrap:wrap;gap:14px;align-items:center;margin:0 0 10px;color:#aac9e1;font-size:.9rem}.chess-breadcrumb a{color:#aac9e1;text-decoration:none}.chess-breadcrumb a:hover{text-decoration:underline}
.chess-intro{margin-bottom:20px;align-items:flex-start}
.chess-intro>div{min-width:0}
.chess-intro h1{font-size:clamp(2.35rem,4vw,4rem);font-weight:760;letter-spacing:-.045em;margin-bottom:-7px}
.chess-intro>div>p{font-size:clamp(1rem,1.4vw,1.375rem)}
.chess-intro-status{display:flex;align-items:center;flex-wrap:wrap;gap:16px;margin-top:5px}
.chess-live-state{color:#1de4ef;font-weight:600}
.chess-live-dot{width:18px;height:18px;background:#00dce9;box-shadow:0 0 20px #00dce9a6}
.chess-top-control{display:inline-block;padding:6px 18px;border:1px solid #315a7b;border-radius:999px;background:#061d36cc;color:#d9e8f8;font-size:.95rem}
.chess-focus-open{min-height:48px;margin-top:4px;padding:10px 17px;border:1px solid #66b5e8;border-radius:11px;background:#03172baa;color:#f7fbff;font:inherit;white-space:nowrap;cursor:pointer}
.chess-game{gap:18px;grid-template-areas:"first second" "toolbar toolbar"}
.chess-face{min-height:337px;justify-content:flex-start;padding:30px 30px 8px clamp(155px,13vw,190px);border:1px solid #5aafe9;border-radius:24px;background:linear-gradient(125deg,#123753b3,#03172edd 58%,#071c35eb)!important;box-shadow:inset 0 0 35px #7ccafc18,0 14px 34px #0009;color:#f7fbff!important;backdrop-filter:blur(12px)}
.chess-face[data-player=black]{background:linear-gradient(125deg,#173650d1,#07172ae8 58%,#09182be8)!important}
.chess-face::before{z-index:0;opacity:1;background:linear-gradient(180deg,transparent 72%,#07538f39 79%,#001326d9 82%),radial-gradient(ellipse at 40% 100%,#10a7ef33,transparent 55%)}
.chess-face::after{content:"";position:absolute;inset:auto 0 11%;height:2px;background:linear-gradient(90deg,transparent,#36a9e97b 24%,#0475c88a 65%,transparent);box-shadow:0 0 13px #1fa7ec79;pointer-events:none}
.chess-face:not(.is-active)::after{background:linear-gradient(90deg,transparent,#254a6680 25%,#193b5680 75%,transparent);box-shadow:none}
.chess-face.is-active{border:2px solid #00e6f6;box-shadow:inset 0 0 40px #00a8f569,0 0 0 2px #00ceef94,0 0 23px #00d8f8d8,0 16px 38px #00172c}
.chess-face.is-active::before{opacity:1;background:linear-gradient(180deg,#009dea0a 0%,transparent 56%,#03c5ee22 100%),radial-gradient(ellipse at 50% 100%,#00b7ff25,transparent 60%)}
.chess-floor-surface{position:absolute;z-index:0;inset:auto 0 0;width:100%;height:74px;overflow:hidden;pointer-events:none;opacity:.62;mask-image:linear-gradient(to bottom,transparent,#000 25%,#000)}
.chess-king{position:absolute;z-index:1;left:clamp(18px,3vw,50px);top:12px;width:clamp(94px,8vw,124px);height:273px;object-fit:contain;overflow:hidden;pointer-events:none;filter:drop-shadow(0 12px 8px #000b)}
.chess-floor-reflection{position:absolute;z-index:1;left:clamp(15px,2.8vw,45px);bottom:3px;width:clamp(115px,9.5vw,150px);height:52px;overflow:hidden;pointer-events:none;opacity:.7;mask-image:radial-gradient(ellipse at 50% 12%,#000 24%,transparent 72%)}
.chess-face-content{position:relative;z-index:2;align-items:stretch;gap:4px;text-align:left}
.chess-color{text-transform:uppercase;font-size:clamp(1.15rem,2vw,2rem);font-weight:760;letter-spacing:.01em;color:#f4f8ff}
.chess-color::after{content:"ОЖИДАЮТ ХОДА";float:right;margin-top:2px;padding:7px 13px;border:1px solid #4f91c3;border-radius:999px;color:#a8d3f2;font-size:clamp(.65rem,1vw,.95rem);font-weight:600;letter-spacing:0;text-transform:none;white-space:nowrap}
.chess-face.is-active .chess-color::after{content:"ВАШ ХОД";background:#00dbe9;border-color:#00dbe9;color:#001625;box-shadow:0 0 18px #00cdea91}
.chess-time{font-size:clamp(4.4rem,11.5vw,11.5rem);font-weight:800;letter-spacing:-.03em;line-height:1.04;color:#fff;text-shadow:0 3px 8px #0008}
.chess-turn{font-size:clamp(.95rem,1.35vw,1.4rem);color:#b8d8f0;text-align:center;white-space:normal}
.chess-face.is-active .chess-turn{color:#9cecff}
.chess-turn-hint{display:flex;align-items:center;justify-content:center;gap:clamp(8px,1vw,16px);min-width:0;min-height:clamp(24px,3vw,44px)}
.chess-move-hand{display:none;flex:none;width:clamp(16px,2.2vw,32px);height:clamp(24px,3vw,44px);color:#e7faff;filter:drop-shadow(0 0 3px #51d9ff);pointer-events:none}
.chess-face.is-active .chess-move-hand{display:block}
@media(forced-colors:active){.chess-move-hand{color:CanvasText;filter:none}}
.chess-toolbar{display:grid;grid-template-columns:1fr auto 1fr;grid-template-areas:"sound controls rocker" ". message .";align-items:center;padding-top:2px}
.chess-sound-toggle{grid-area:sound;justify-self:start;min-height:44px;padding:8px 12px;border:0;background:transparent;color:#c2ddf1;font:inherit;cursor:pointer}
.chess-control-icon{display:inline-block;vertical-align:middle;flex:none;width:28px;height:28px;pointer-events:none}
.chess-focus-open,.chess-reset,.chess-sound-toggle{display:inline-flex;align-items:center;justify-content:center;gap:12px}
.chess-reset .chess-control-icon{color:#71e7f5;width:32px;height:32px}
.chess-focus-open .chess-control-icon{width:24px;height:24px}
.chess-speaker-waves{display:none}
.chess-sound-toggle[aria-pressed=true] .chess-speaker-waves{display:block}
.chess-sound-toggle[aria-pressed=true] .chess-speaker-mute{display:none}
.chess-main-controls{gap:14px}
.chess-main-controls{grid-area:controls}
.chess-main-controls button,.chess-main-controls summary{min-height:56px;padding:12px 22px;border:1px solid #4c9dd0;border-radius:13px;background:#041a30b8;color:#f5fbff}
.chess-game[data-phase=running] #chessRun{min-width:230px;border-color:#ffd06c;background:linear-gradient(125deg,#6b461e,#291b13 70%);color:#ffe7b7;box-shadow:inset 0 0 14px #f3b84350,0 0 17px #efaa49a8}
.chess-game[data-phase=running] #chessRun::before{content:"Ⅱ";margin-right:16px;font-size:1.4em;color:#ffc453}
.chess-control-summary,.chess-layout-summary,.chess-editor{background:linear-gradient(145deg,#08213aca,#03182bc9);border-color:#316590;backdrop-filter:blur(12px)}
.chess-info-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px;margin-top:34px}
.chess-control-summary,.chess-layout-summary{display:block;margin:0;min-height:170px;padding:15px 24px;color:#e5f2ff;border:1px solid #316590;border-radius:12px}
.chess-control-summary>div:first-child{display:block}
.chess-info-title{display:flex;align-items:center;gap:18px;font-size:1.25rem;font-weight:700;color:#fff}.chess-info-icon{width:36px;height:36px;flex:none;color:#00deed}
.chess-control-values{display:grid;grid-template-columns:260px minmax(0,1fr);gap:0;margin:13px 0 8px 52px}.chess-control-values>span{min-width:0;padding-left:32px;border-left:1px solid #527b9a}.chess-control-values>span:first-child{padding-left:0;border-left:0}.chess-control-values b{display:block;font-size:3rem;line-height:1;color:#fff}.chess-control-values small,.chess-control-summary small{display:block;color:#a5c9e5;font-size:1.0625rem}
.chess-layout-value{display:flex;align-items:center;gap:24px;margin:6px 0 2px;padding-left:52px;font-size:2.25rem;font-weight:750;color:#fff}.chess-layout-value strong{font-weight:750}.chess-chairs{width:110px;height:68px;flex:none}.chess-layout-summary p{margin:0 0 0 60px;color:#a5c9e5;font-size:1.0625rem}.chess-layout-summary button{float:right;margin-top:-65px;border:0;background:transparent;color:#00e3ec;font:inherit;cursor:pointer}.chess-control-summary button{min-height:36px;margin-left:8px;padding:6px 12px;border:1px solid #3c7eaa;border-radius:8px;background:transparent;color:#dceefa;font:inherit;cursor:pointer}
.chess-control-summary #chessEditControl[hidden]{display:none}
.chess-rocker{justify-self:end;max-width:210px;min-height:44px;padding:4px 10px;background:#071d32e8;border-color:#306b94;color:#f4faff}.chess-rocker .rocker-side{display:none}.chess-rocker .rocker-action>span{display:none}
.chess-message{grid-area:message;margin:0;min-height:0;font-size:.85rem}
.chess-page .chess-policy,.chess-page .chess-help{color:var(--text-secondary)}
@media(max-width:900px){.chess-intro{flex-wrap:wrap}.chess-info-grid{grid-template-columns:minmax(0,1fr)}.chess-layout-value{padding-left:0;gap:12px;font-size:1.75rem}.chess-chairs{width:80px;height:56px}.chess-layout-summary p{margin-left:0}.chess-time{font-size:clamp(2rem,8vw,7rem)}}
@media(max-width:900px){.chess-face{min-height:285px;padding-left:clamp(115px,15vw,155px)}.chess-king{left:14px;width:clamp(85px,11vw,110px)}.chess-time{font-size:clamp(3.6rem,8.8vw,7rem)}.chess-color::after{padding:5px 8px}}
@media(max-width:700px){body.chess-page{background-size:auto 780px;background-position:56% 0}.chess-main{padding:26px 16px 52px}.chess-intro{margin-bottom:18px;flex-wrap:wrap}.chess-intro>.chess-focus-open{align-self:flex-end}.chess-game{gap:12px;grid-template-areas:"first" "toolbar" "second"}.chess-page .chess-face{min-height:230px;padding:18px 15px 16px clamp(110px,27vw,150px)}.chess-king{left:10px;top:10px;width:clamp(68px,20vw,90px);height:auto}.chess-floor-reflection{left:8px;width:90px}.chess-color{font-size:1.25rem}.chess-time{font-size:clamp(3.5rem,17vw,6.6rem)}.chess-turn{font-size:.95rem}.chess-toolbar{grid-template-columns:1fr;grid-template-areas:"controls" "rocker" "sound" "message"}.chess-rocker{justify-self:center}.chess-sound-toggle{justify-self:center}.chess-more-panel{bottom:auto;top:calc(100% + 8px)}.chess-info-grid{grid-template-columns:minmax(0,1fr)}.chess-control-summary,.chess-layout-summary{min-width:0}.chess-info-title{display:block;overflow-wrap:anywhere}.chess-info-icon{vertical-align:middle;margin-right:8px}.chess-control-values{grid-template-columns:minmax(0,1fr) minmax(0,1fr);margin-left:0}.chess-control-values>span{min-width:0;padding-left:12px}.chess-control-values b{font-size:2rem}.chess-control-values small{overflow-wrap:anywhere}.chess-layout-value{padding-left:0;gap:10px;font-size:1.75rem}.chess-chairs{width:78px;height:54px}.chess-layout-summary p{margin-left:0}.chess-layout-summary button{float:none;margin-top:12px}}
@media(max-width:390px){.chess-intro h1{overflow-wrap:anywhere}.chess-live-state{white-space:normal}.chess-rocker{flex-wrap:wrap}.chess-rocker span{min-width:0}.chess-presets{grid-template-columns:repeat(2,minmax(0,1fr))}.chess-presets button{min-width:0}.chess-presets button span{max-width:100%;overflow-wrap:anywhere}.chess-settings-grid{grid-template-columns:minmax(0,1fr)}.chess-settings-grid label{overflow-wrap:anywhere}.chess-face{padding-left:102px}.chess-king{width:90px}.chess-time{font-size:clamp(2rem,15vw,4rem)}.chess-color::after{font-size:.6rem}.chess-info-title{display:block;overflow-wrap:anywhere}.chess-info-icon{width:28px;height:28px;vertical-align:middle;margin-right:8px}.chess-control-values{grid-template-columns:minmax(0,1fr);gap:8px}.chess-control-values>span{padding-left:0;border-left:0}.chess-control-values b{font-size:2rem}.chess-control-values small{font-size:.9rem;overflow-wrap:anywhere}}
@media(max-width:390px){.chess-layout-value{padding-left:0;gap:10px;font-size:1.75rem}.chess-chairs{width:78px;height:54px}.chess-layout-summary p{margin-left:0}}
.chess-focus .chess-face{min-height:0}.chess-focus .chess-king{height:calc(100% - 20px);width:min(17vw,124px)}.chess-focus .chess-face-content{margin-left:0}
@media(max-width:700px) and (orientation:portrait){.chess-focus .chess-face{padding-left:clamp(85px,24vw,125px)}.chess-focus .chess-king{width:clamp(68px,20vw,100px)}.chess-focus .chess-time{font-size:clamp(2.7rem,16vw,6rem)}}
@media(max-height:480px) and (orientation:landscape){.chess-focus .chess-face{padding-left:clamp(80px,13vw,130px)}.chess-focus .chess-king{width:clamp(65px,10vw,100px)}.chess-focus .chess-time{font-size:clamp(2.4rem,10vh,5rem)}}
@media(forced-colors:active){.chess-king{display:none}.chess-face,.chess-control-summary{background:Canvas!important;color:CanvasText!important}}
.chess-page .chess-focus .chess-face{min-height:0}
.chess-focus{--text-secondary:#b8d3e8;--text-muted:#91b8d4;font-family:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;background:#06172a;color:#eefaff}
.chess-focus>header button{background:#071f37;color:#eefaff;border-color:#5295c2}
.chess-page .chess-focus .chess-face{padding:16px 18px 16px clamp(170px,14vw,220px)}
.chess-focus .chess-king{top:auto;bottom:65px;width:124px;height:273px}
.chess-focus>.chess-game{grid-template-rows:minmax(0,1fr) auto;grid-template-areas:"first second" "toolbar toolbar"}
@media(max-width:700px) and (orientation:portrait){.chess-focus>.chess-game{grid-template-rows:minmax(0,1fr) auto minmax(0,1fr);grid-template-areas:"first" "toolbar" "second"}.chess-page .chess-focus .chess-face{padding:8px 8px 8px clamp(75px,22vw,110px)}.chess-focus .chess-king{top:6px;bottom:auto;width:clamp(55px,18vw,80px);height:calc(100% - 12px)}}
@media(max-height:480px) and (orientation:landscape){.chess-focus>.chess-game{grid-template-rows:minmax(0,1fr) auto;grid-template-areas:"first second" "toolbar toolbar"}.chess-page .chess-focus .chess-face{padding:8px 8px 8px clamp(70px,12vw,110px)}.chess-focus .chess-king{top:5px;bottom:auto;width:clamp(55px,9vw,85px);height:calc(100% - 10px)}}


/* Normal phone play keeps both players visible; focus mode retains its own layout. */
@media(max-width:700px){
 .chess-main{padding:14px 14px 32px}.chess-intro{gap:8px;margin-bottom:12px;align-items:center}.chess-intro h1{font-size:1.75rem;line-height:1.1;margin-bottom:5px}.chess-intro p{font-size:.875rem}.chess-live-state{font-size:.875rem;gap:6px;flex-wrap:wrap}.chess-focus-open{min-height:44px;margin:0;padding:8px 10px;font-size:.875rem}
 .chess-page:not(.chess-focus) .chess-game{gap:10px;grid-template-areas:"first" "second" "toolbar"}
 .chess-page .chess-face{min-height:156px;padding:12px 12px 10px 88px;border-radius:16px}.chess-page .chess-king{left:10px;top:7px;width:65px;height:142px;object-fit:contain}
 .chess-face-content{width:100%;gap:3px}.chess-color{font-size:1rem}.chess-color::after{float:none;display:inline-block;padding:4px 6px;margin:0 0 0 6px;font-size:.625rem}
 .chess-page .chess-time{font-size:clamp(2.75rem,14vw,3.5rem);line-height:1.04}.chess-turn{font-size:.875rem}.chess-turn-hint{min-height:24px}.chess-move-hand{width:18px;height:24px}.chess-floor-surface{height:35px}.chess-floor-reflection{height:25px;width:66px}
 .chess-toolbar{grid-template-columns:1fr auto;grid-template-areas:"controls controls" "rocker sound" "message message";gap:4px 8px;padding:0}.chess-main-controls{display:flex;flex-wrap:wrap;gap:8px;justify-content:center}
 .chess-main-controls button,.chess-main-controls summary{min-height:44px;padding:9px 12px;font-size:.875rem}.chess-game[data-phase=running] #chessRun{min-width:0}.chess-game[data-phase=running] #chessRun::before{margin-right:8px}
 .chess-rocker{justify-self:start;font-size:.875rem;min-height:44px}.chess-sound-toggle{justify-self:end;padding:6px;font-size:.875rem;gap:5px}.chess-sound-toggle .chess-control-icon{width:22px;height:22px}.chess-info-grid{margin-top:20px}
}
@media(max-width:700px) and (orientation:portrait){
 .chess-page .chess-focus>.chess-game{grid-template-areas:"first" "toolbar" "second"}.chess-page .chess-focus .chess-face{min-height:0}.chess-page .chess-focus .chess-king{height:calc(100% - 12px);width:clamp(55px,18vw,80px)}
}
@media(max-width:700px) and (max-height:480px) and (orientation:landscape){
 .chess-page .chess-focus>.chess-game{grid-template-areas:"first second" "toolbar toolbar"}
 .chess-page .chess-focus .chess-face{padding-left:clamp(76px,14vw,100px)}
 .chess-page .chess-focus .chess-time{font-size:clamp(2rem,10vh,3rem)}
 .chess-focus .chess-toolbar{grid-template-columns:1fr auto 1fr;grid-template-areas:"sound controls ." "message message message"}
}

/* Intrinsic text growth reflows the public game without shrinking its artwork or clocks. */
@media(max-width:700px){
 .chess-page #chessHome .chess-face{flex-wrap:wrap;gap:0 10px;padding:6px 12px}
 .chess-page #chessHome .chess-king{position:static;flex:0 0 65px;width:65px;height:142px}
 .chess-page #chessHome .chess-face-content{flex:1 1 calc(3 * clamp(2.75rem,14vw,3.5rem));width:auto;min-width:0;max-width:100%}
 .chess-page #chessHome .chess-turn-hint,.chess-page #chessHome .chess-turn{min-width:0;white-space:normal}
 .chess-page #chessHome .chess-move-hand{flex:none}
 .chess-page #chessHome .chess-toolbar{display:flex;flex-wrap:wrap;gap:4px 8px}
 .chess-page #chessHome .chess-main-controls{order:0;flex:1 0 100%;min-width:0;max-width:100%}
 .chess-page #chessHome .chess-main-controls>button{min-width:0;max-width:100%;white-space:normal}
 .chess-page #chessHome .chess-rocker{order:1;flex:1 1 8rem;width:auto;min-width:0;max-width:100%}
 .chess-page #chessHome .chess-sound-toggle{order:2;flex:1 1 5rem;min-width:0;max-width:100%}
 .chess-page #chessHome .chess-message{order:3;flex:1 0 100%;min-width:0;max-width:100%}
}

/* 04 settings: blue inset controls; the player faces and engine remain independent. */
.chess-settings-form input:not([type=checkbox]),.chess-settings-form select,.chess-adjust-dialog input{background:var(--control-fill);border-color:var(--control-edge);box-shadow:var(--control-light)}
#chessMore>summary{display:flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;padding:8px;border-color:#306b94;background:#071d32e8;color:#eef7ff;list-style:none}#chessMore>summary [data-control-label]{display:none}#chessMore>summary::-webkit-details-marker{display:none}

/* Stage 3B P2 (L05): light frosted chess arena, AAA contrast, and luminous player cards. */
html[data-theme="light"] body.chess-page{background-color:#f2f8fc;background-image:var(--vf-sky);background-size:max(100%,1586px) auto;background-position:center top;background-repeat:no-repeat;color:#142b3d}
html[data-theme="light"] body.chess-page .chess-main{--text:#142b3d;--text-secondary:#2b4357;--text-muted:#3b5369;--digit-color:#102437;--surface:rgba(255,255,255,.84);--card-bg:rgba(255,255,255,.88);--glass:rgba(255,255,255,.86);--glass-border:rgba(88,148,188,.38);--input-bg:#fff;--input-border:rgba(68,128,168,.42);color:#142b3d}
html[data-theme="light"] .chess-page .chess-help,html[data-theme="light"] .chess-page .footer{--accent:#075770;--accent2:#075770;--text-muted:#3b5369;--text-secondary:#2b4357}
html[data-theme="light"] .chess-intro h1{color:#142b3d}
html[data-theme="light"] .chess-intro>div>p,html[data-theme="light"] #chessMessage{color:#2b4357}
html[data-theme="light"] .chess-help a,html[data-theme="light"] .chess-page .footer a{color:#075770}
html[data-theme="light"] .chess-breadcrumb,html[data-theme="light"] .chess-breadcrumb a{color:#3b5369}
html[data-theme="light"] .chess-live-state{color:#076a7e}
html[data-theme="light"] .chess-live-dot{background:#08a4be;box-shadow:0 0 12px rgba(8,164,190,.42)}
html[data-theme="light"] .chess-top-control{background:rgba(255,255,255,.86);border-color:rgba(88,148,188,.38);color:#142b3d}
html[data-theme="light"] .chess-focus-open{background:rgba(255,255,255,.9);border-color:rgba(88,148,188,.45);color:#142b3d;box-shadow:0 4px 14px rgba(24,74,114,.08)}
html[data-theme="light"] .chess-face{background:linear-gradient(135deg,rgba(255,255,255,.92),rgba(235,246,254,.88))!important;border-color:rgba(88,148,188,.45);box-shadow:0 14px 34px rgba(24,74,114,.1),inset 0 1px 0 #fff;color:#142b3d!important}
html[data-theme="light"] .chess-face[data-player=black]{background:linear-gradient(135deg,rgba(247,251,255,.92),rgba(227,240,250,.88))!important}
html[data-theme="light"] .chess-face::before{background:linear-gradient(180deg,transparent 74%,rgba(148,202,235,.22) 86%,rgba(220,238,250,.55) 100%)}
html[data-theme="light"] .chess-face::after{background:linear-gradient(90deg,transparent,rgba(88,168,214,.35) 25%,rgba(88,168,214,.35) 75%,transparent);box-shadow:none}
html[data-theme="light"] .chess-face.is-active{border:2px solid #08a9c4;box-shadow:inset 0 0 28px rgba(10,192,224,.16),0 0 0 2px rgba(245,186,62,.35),0 14px 34px rgba(24,74,114,.14)}
html[data-theme="light"] .chess-face.is-active::after{background:linear-gradient(90deg,transparent,#20c6e0 30%,#f3b038 70%,transparent);box-shadow:0 0 10px rgba(32,198,224,.45)}
html[data-theme="light"] .chess-floor-surface,html[data-theme="light"] .chess-floor-reflection{opacity:0}
html[data-theme="light"] .chess-king{filter:drop-shadow(0 10px 8px rgba(20,43,61,.22)) brightness(1.06)}
html[data-theme="light"] .chess-color{color:#142b3d}
html[data-theme="light"] .chess-color::after{border-color:rgba(88,148,188,.45);background:rgba(255,255,255,.85);color:#3b5369}
html[data-theme="light"] .chess-face.is-active .chess-color::after{background:linear-gradient(135deg,#ffe27f,#f4b23f);border-color:#f6c85e;color:#1d1404;box-shadow:0 4px 12px rgba(235,168,45,.32)}
html[data-theme="light"] .chess-time{color:#102437;text-shadow:none}
html[data-theme="light"] .chess-turn{color:#3b5369}
html[data-theme="light"] .chess-face.is-active .chess-turn{color:#142b3d}
html[data-theme="light"] .chess-move-hand{color:#086b88;filter:none}
html[data-theme="light"] .chess-sound-toggle{color:#2b4357}
html[data-theme="light"] .chess-main-controls button,html[data-theme="light"] .chess-main-controls summary,html[data-theme="light"] #chessMore>summary,html[data-theme="light"] .chess-rocker{background:rgba(255,255,255,.92);border-color:rgba(88,148,188,.45);color:#142b3d;box-shadow:0 6px 18px rgba(24,74,114,.08)}
html[data-theme="light"] .chess-reset .chess-control-icon{color:#086b88}
html[data-theme="light"] .chess-main-controls #chessRun,html[data-theme="light"] .chess-game[data-phase=running] #chessRun{background:linear-gradient(125deg,#ffe16d,#f5b53d);border-color:#ffd76d;color:#1e1504;box-shadow:0 8px 24px rgba(235,168,45,.32)}
html[data-theme="light"] .chess-game[data-phase=running] #chessRun::before{color:#1e1504}
html[data-theme="light"] .chess-control-summary,html[data-theme="light"] .chess-layout-summary,html[data-theme="light"] .chess-editor{background:rgba(255,255,255,.86);border-color:rgba(88,148,188,.34);color:#142b3d;box-shadow:var(--shadow)}
html[data-theme="light"] .chess-info-title,html[data-theme="light"] .chess-control-values b,html[data-theme="light"] .chess-layout-value{color:#142b3d}
html[data-theme="light"] .chess-info-icon{color:#0888a6}
html[data-theme="light"] .chess-control-values>span{border-left-color:rgba(88,148,188,.32)}
html[data-theme="light"] .chess-control-values small,html[data-theme="light"] .chess-control-summary small,html[data-theme="light"] .chess-layout-summary p{color:#3b5369}
html[data-theme="light"] .chess-layout-summary button{color:#075770}
html[data-theme="light"] .chess-control-summary button{border-color:rgba(88,148,188,.45);color:#142b3d;background:rgba(255,255,255,.8)}
html[data-theme="light"] .chess-chairs g circle,html[data-theme="light"] .chess-chairs g path:first-of-type,html[data-theme="light"] .chess-chairs g path:nth-of-type(2){stroke:#0888a6}
html[data-theme="light"] .chess-chairs g path:nth-of-type(n+3){stroke:#2d6d8e}
html[data-theme="light"] .chess-focus{background:#f2f8fc;color:#142b3d;--text-secondary:#2b4357;--text-muted:#3b5369}
html[data-theme="light"] .chess-focus>header button{background:#fff;color:#142b3d;border-color:rgba(88,148,188,.45)}

