.language-control {display:flex;align-items:center;gap:.5rem;font-size:14px;white-space:nowrap}
.registration-consent{display:grid;gap:1rem;border:1px solid var(--line);border-radius:8px;padding:1rem;color:var(--text)}
.registration-consent label{display:flex!important;align-items:flex-start;gap:.6rem;font-size:14px;line-height:1.5}.registration-consent input[type="checkbox"]{flex:0 0 auto;width:20px;height:20px;margin-top:.15rem;accent-color:var(--focus)}
.registration-consent a{color:var(--text);text-decoration:underline}
.quick-match-card{flex-wrap:wrap}.fair-play-filter{display:grid;gap:.5rem;min-width:180px}.fair-play-filter input{max-width:8rem}.fair-play-benefits,#fair-play-filter-help{font-size:14px;line-height:1.6;color:var(--text-soft)}
.game-over .side-panel>.sponsor-slot{margin:.6rem auto;padding:.3rem;max-width:100%}.game-over .sponsor-creative{height:50px}
.language-control select {max-width:8rem;padding:.45rem;border:1px solid var(--line);background:var(--panel);color:inherit;border-radius:.4rem}
.portal-topbar {flex-wrap:wrap}.portal-topbar>.language-control {order:3;margin-inline-start:auto}
.top-actions {flex-wrap:wrap;justify-content:flex-end;gap:.5rem}
.game-shell .arena {display:grid;grid-template-columns:minmax(0,1fr) minmax(260px,340px);align-items:start;gap:1rem}
.game-shell .board-wrap {min-width:0;display:flex;flex-direction:column;gap:.5rem}
.game-shell .board-wrap .player-card {display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:.75rem;padding:.65rem 1rem;min-height:76px;width:100%;margin:0}
.game-shell .board-wrap .player-color-line {display:none}
.game-shell .board-wrap .clock {grid-column:2;font-size:clamp(24px,3.4vw,40px);padding:.3rem .6rem;margin:0;min-width:6ch}
.game-shell .board-wrap .player-identity {grid-column:1;grid-row:1;min-width:0}
.game-shell .board-wrap .player-resign {grid-column:3;grid-row:1;width:auto;margin:0;padding:.5rem}
.game-shell .board-wrap .material {grid-column:1;font-size:14px;color:#51d1b2}
.game-shell .board-wrap .player-card.active {border-color:#51d1b2;box-shadow:inset 4px 0 #51d1b2}
.game-shell .board-frame {width:min(100%,calc(100dvh - 290px));align-self:center}
.game-shell .player-meta {min-width:0}.game-shell .player-meta b {overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.game-overflow {position:relative}.game-overflow summary {cursor:pointer;min-height:44px;padding:.6rem 1rem;border:1px solid var(--line);border-radius:.5rem}
.game-overflow>div {position:absolute;inset-inline-end:0;top:100%;width:260px;max-height:65dvh;overflow:auto;z-index:40;display:grid;gap:.3rem;padding:.6rem;background:#152029;border:1px solid #72808b;border-radius:.5rem;box-shadow:0 12px 32px #0008}
.game-overflow button {padding:.7rem;text-align:start;min-height:44px}
.game-overflow fieldset{display:grid;gap:4px;border:0;border-top:1px solid var(--line);padding:8px 0 0;margin:0;min-width:0}
.game-overflow legend{font-weight:700;padding:0 4px;color:var(--text)}
.game-overflow small{padding:4px;font-size:13px;line-height:1.4;color:var(--text-soft)}
.game-shell .top-actions button[hidden]{display:none}
.annotation-mode .game-shell .top-actions{flex-wrap:wrap}
.game-shell .clock.low-time {color:#ffb7a7;background:#542b29;border-color:#ff9a86}
.board-annotations {position:absolute;inset:0;width:100%;height:100%;z-index:14;pointer-events:none}
.square.premove {box-shadow:inset 0 0 0 5px #49c9f2!important}
.sheet-handle {display:none}.move-san {border:0;background:transparent;font:inherit;color:inherit;text-align:start;min-height:36px}
.move-san:disabled {opacity:1;cursor:default}.move-san:not(:disabled):hover {background:#ffffff20}
.device-preferences {grid-column:1/-1;padding:1rem;border:1px solid var(--line);border-radius:.8rem;display:flex;flex-wrap:wrap;gap:1rem}
.device-preferences label {display:flex;align-items:center;gap:.5rem}.device-preferences select {max-width:12rem}
.focus-mode .side-panel,.focus-mode .board-caption,.focus-mode .mini-brand,.focus-mode .match-title {display:none!important}
.game-shell.focus-mode .arena {grid-template-columns:1fr;max-width:850px;margin:auto}
.focus-mode .game-topbar {justify-content:flex-end}.focus-mode .board-frame {width:min(100%,calc(100dvh - 230px))}
.game-shell button:focus-visible,.game-shell summary:focus-visible,.language-control select:focus-visible {outline:2px solid var(--focus);outline-offset:3px}
.portal-shell #resume-game {margin-bottom:1rem}.recovery-notice button {margin:.4rem}
.game-shell .side-panel {min-width:0}.game-shell .controls {flex-wrap:wrap}
.result-strip-mark {font-size:32px}
@media(max-width:850px){
 .game-shell .arena {grid-template-columns:minmax(0,1fr)}
 .game-shell .board-frame {width:min(100%,calc(100svh - 310px))}
 .game-shell .board-wrap .player-card {min-height:62px;padding:.35rem .6rem;grid-template-columns:minmax(0,1fr) auto}
 .game-shell .board-wrap .player-resign {display:none}
 .game-shell .top-actions #flip-board {display:inline-flex}
 .game-shell .top-actions .language-control {font-size:14px}
 .game-shell .board-wrap .clock {font-size:26px}
 .game-shell .side-panel {height:32dvh;max-height:none;overflow:auto;position:relative;display:block;padding-bottom:max(.5rem,env(safe-area-inset-bottom));transition:height .15s ease}
 .game-shell .side-panel[data-sheet="collapsed"] {height:70px}
 .game-shell .side-panel[data-sheet="expanded"] {height:65dvh}
 .sheet-handle {display:block;width:100%;min-height:44px;touch-action:none;position:sticky;top:0;z-index:3;background:#18232b}
 .game-shell .side-panel .panel-stack {max-height:none;height:auto;min-height:120px}
 .game-shell .side-panel .status-card {display:none}
 .game-shell .board-caption {display:none}
 .portal-nav {overflow:auto;max-width:100%}.portal-topbar {gap:.7rem}.portal-brand small {white-space:normal}
 .game-shell .top-actions {width:100%;justify-content:space-between}
 .game-shell .game-topbar {height:auto;flex-wrap:wrap;gap:.4rem;padding:.5rem}
 .game-shell .mini-brand {display:none}
}
@media(max-width:850px) and (orientation:landscape){
 .game-shell .arena {grid-template-columns:minmax(0,1fr) minmax(220px,.65fr)}
 .game-shell .board-frame {width:min(100%,calc(100dvh - 170px))}
 .game-shell .board-wrap .player-card {min-height:44px}
 .game-shell .board-wrap .player-avatar {display:none}
 .game-shell .side-panel {height:calc(100dvh - 90px)}
}
@media(prefers-reduced-motion:reduce){.game-shell .side-panel{transition:none}}
html[data-motion="none"] .game-shell .side-panel,html[data-motion="reduced"] .game-shell .side-panel {transition:none}
.game-shell {width:100%;max-width:1600px;margin:auto;min-width:0}
.game-shell .game-topbar {display:flex;justify-content:space-between;flex-wrap:wrap;height:auto;gap:1rem}
.game-shell .board-wrap .player-card {background:var(--panel);color:var(--text)}
.game-shell .board-wrap .player-meta b,.game-shell .board-wrap .clock,.game-shell .top-actions button {color:var(--text)}
.game-shell .board-wrap .player-meta small {color:var(--text-soft)}
.game-shell .game-overflow>div {background:var(--panel);color:var(--text)}
.game-shell .board-frame {max-width:calc(100dvh - 310px);min-width:220px;width:100%}
.game-shell .board-wrap {max-width:800px;justify-self:center;width:100%}
.game-shell .player-resign {display:none}
.game-shell .player-card.active::after {content:none}
.game-shell .top-actions {max-width:100%}
.network-actions,.local-analysis {padding:.8rem;display:grid;gap:.5rem;border-bottom:1px solid var(--line)}
.network-actions:empty {display:none}.network-actions p {margin:.3rem 0}
.community-gallery {margin-top:1.5rem}.gallery-list {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,230px),1fr));gap:1rem}
.gallery-list article {padding:1rem;border:1px solid var(--line);border-radius:.7rem;overflow-wrap:anywhere}.gallery-list button {margin:.3rem}
.clock-graph {width:100%;height:140px}.clock-graph polyline {fill:none;stroke-width:2}.clock-table {max-height:190px;overflow:auto}.clock-table table {width:100%;font-size:14px}
.cadence-group {display:flex;flex-wrap:wrap;gap:.4rem;align-content:start}.cadence-group h4 {width:100%;margin:.3rem 0}.cadence-group .preset {flex:1;min-width:90px}
.recovery-disclosure {grid-column:1/-1}.recovery-disclosure summary {padding:1rem;cursor:pointer}.field-error {color:var(--danger);display:block}.field-error[hidden]{display:none}
.annotation-mode #board {touch-action:none;cursor:crosshair}

/* Isolated post-game workspace. No selectors affect the playing board. */
.analysis-studio{box-sizing:border-box;width:min(1120px,96vw);height:min(900px,94dvh);max-width:96vw;max-height:94dvh;padding:0;border:1px solid var(--line-strong);border-radius:20px;background:var(--bg);color:var(--text);box-shadow:0 28px 100px #0009;overflow:hidden}
.analysis-studio[open]{display:grid;grid-template-rows:auto minmax(0,1fr) auto}
.analysis-studio::backdrop{background:#080e19b8;backdrop-filter:blur(7px)}
.analysis-studio button,.analysis-studio select{font:inherit;color:var(--text);background:var(--panel);border:1px solid var(--line-strong);border-radius:9px;min-height:38px;padding:7px 11px;cursor:pointer}
.analysis-studio button:hover{border-color:var(--gold)}.analysis-studio button:disabled{opacity:.45;cursor:default}.analysis-studio [hidden]{display:none!important}
.analysis-studio button:focus-visible,.analysis-studio select:focus-visible,.analysis-studio a:focus-visible{outline:3px solid var(--gold);outline-offset:2px}
.analysis-studio a{color:var(--text);text-decoration:underline}.studio-header{display:flex;justify-content:space-between;align-items:center;padding:18px 24px;border-bottom:1px solid var(--line);gap:12px}.studio-header small{letter-spacing:.15em;color:var(--text-soft);font-size:11px}.studio-header h2{font:400 30px Georgia,serif;margin:4px 0 0;color:var(--text)}
.studio-body{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(300px,1fr);gap:24px;padding:20px 24px;overflow:auto;min-height:0;overscroll-behavior:contain}
.studio-board-column{min-width:0;text-align:center}.studio-match{font-size:13px;margin-bottom:12px;color:var(--text-soft)}
.studio-board{display:grid;grid-template-columns:repeat(8,1fr);aspect-ratio:1;width:min(100%,calc(94dvh - 330px));min-width:180px;margin:auto;border:6px solid #66533f;border-radius:9px;overflow:hidden;box-shadow:0 8px 24px #0003}
.studio-board>div{position:relative;aspect-ratio:1}.studio-board .light{background:#ead9b6}.studio-board .dark{background:#866b4e}.studio-board img{width:90%;height:90%;margin:5%;filter:drop-shadow(0 2px 1px #0005)}.studio-board small{position:absolute;left:2px;bottom:1px;font-weight:700;font-size:10px;color:#322617}.studio-board .dark small{color:#fff0cc}
.studio-board{box-sizing:border-box;grid-template-columns:repeat(8,minmax(0,1fr));grid-template-rows:repeat(8,minmax(0,1fr))}.studio-board>div{min-width:0;min-height:0;aspect-ratio:auto}.studio-board img{display:block;position:absolute;inset:5%;margin:0}
.studio-nav{display:flex;align-items:center;justify-content:center;gap:5px;margin:12px 0}.studio-nav strong{font-size:13px;min-width:95px}.studio-nav button{padding:6px 9px}.studio-chart{background:var(--panel);border:1px solid var(--line);border-radius:10px;padding:8px}.studio-chart svg{display:block;width:100%;height:75px}.studio-chart small,[data-opening]{font-size:12px;color:var(--text-soft)}
.studio-inspector{min-width:0}.studio-engine{background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:16px}.studio-badge{font-size:12px;font-weight:700;letter-spacing:.03em;color:var(--text)}.studio-engine>p{font-size:12px;color:var(--text-soft);margin:5px 0}.studio-score{display:flex;align-items:center;gap:15px;margin:15px 0}.studio-score strong{font-size:42px;letter-spacing:-.04em}.studio-score span{font-size:12px;color:var(--text-soft);line-height:1.7}.studio-engine label{display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:12px}.studio-engine select{max-width:65%}.studio-actions{display:flex;flex-wrap:wrap;gap:6px;margin:12px 0}.studio-actions button{font-size:12px;flex:1}.studio-actions [data-position]{background:var(--gold);color:#201a10;border-color:var(--gold)}.studio-lines p{font-size:13px;line-height:1.7;border-top:1px solid var(--line);padding-top:8px;overflow-wrap:anywhere}.studio-tabs{display:flex;gap:5px;margin:16px 0 8px}.studio-tabs button{flex:1;font-size:12px}.studio-tabs [aria-selected=true]{border-color:var(--gold);background:var(--gold-soft)}
.studio-panel{max-height:240px;overflow:auto;overscroll-behavior:contain;font-size:13px;line-height:1.7}.studio-panel[data-panel=moves]{display:grid;grid-template-columns:1fr 1fr;gap:5px}.studio-panel button.selected{border-color:var(--gold);background:var(--gold-soft)}.studio-panel button{text-align:left}.studio-footer{border-top:1px solid var(--line);padding:6px}.studio-footer .sponsor-slot{margin:0 auto;width:min(320px,100%);min-height:0;padding:4px}.studio-footer .sponsor-creative{min-height:30px}.studio-footer:empty{display:none}
@media(max-width:700px){.analysis-studio{width:98vw;max-width:98vw;height:96dvh;max-height:96dvh;border-radius:12px}.studio-header{padding:12px}.studio-header h2{font-size:23px}.studio-body{grid-template-columns:1fr;padding:12px;gap:16px}.studio-board{width:min(100%,330px)}.studio-panel{max-height:230px}.studio-nav strong{min-width:85px}.studio-nav button{min-width:32px;padding:5px}.studio-engine label{flex-wrap:wrap}}
.portal-shell .portal-nav-btn.active,.portal-shell .mode-btn.active {color:#211b13;background:#d2b781;box-shadow:inset 0 -2px #84683e}
.portal-shell .mode-switch,.portal-shell .custom-time-fields,.game-shell .network-lobby {background:var(--panel);color:var(--text)}
.portal-shell input,.portal-shell select,.game-shell input,.game-shell select {background:var(--bg-2);color:var(--text)}
.game-shell .result-summary,.game-shell .analysis-box,.game-shell .draw-offer {background:var(--panel);color:var(--text)}
.game-shell .network-lobby strong,.game-shell .network-lobby span,.game-shell .result-summary h3,.game-shell .analysis-box h3 {color:var(--text)}
.game-shell .game-info-list b,.game-shell .result-score-line b {color:var(--text)}
.portal-shell .preset span,.portal-brand small,.portal-account small,.portal-footer {color:var(--muted)}
.confirm-card,.promotion-card {background:var(--panel);color:var(--text)}
.confirm-card h2,.promotion-card h2 {color:var(--text)}
.confirm-card p,.promotion-card p {color:var(--text-soft)}
.promotion-piece {background:var(--panel-2)}
.game-shell .material {color:var(--text-soft)!important}
.material img {width:18px;height:24px;vertical-align:middle}.material {min-height:0}.material:empty {display:none}
.game-shell .game-topbar .ghost-btn,.confirm-card .ghost-btn {background:var(--panel-2);color:var(--text)}
.move-pending #board {outline:3px dashed var(--focus);outline-offset:2px}
.sponsor-slot {width:min(100%,728px);margin:1.5rem auto .5rem;border:1px solid var(--line);border-radius:8px;background:var(--panel);color:var(--muted);padding:.5rem;text-align:center;font-size:14px;contain:layout}
.sponsor-slot small {display:block;font-size:14px;color:var(--muted)}
.sponsor-creative {height:60px;display:grid;place-items:center;max-width:100%;overflow:hidden;color:var(--text-soft)}
.sponsor-slot[hidden]{display:none}.result-summary .sponsor-slot{margin:1rem 0 0;width:100%;padding:.3rem}.result-summary .sponsor-creative{height:50px}
@media(max-width:600px){.sponsor-slot{max-width:336px}.sponsor-creative{height:50px}}
@media(max-width:850px) and (orientation:portrait){
 .game-shell {padding-bottom:110px}
 .game-shell .side-panel {position:fixed;left:0;right:0;bottom:0;z-index:35;border-radius:14px 14px 0 0;min-height:0;max-height:75dvh;background:var(--panel);box-shadow:0 -5px 25px #0005}
 .game-shell .side-panel[data-sheet="collapsed"]{height:104px;overflow:hidden}
 .game-shell .side-panel[data-sheet="half"]{height:36dvh}
 .game-shell .side-panel[data-sheet="expanded"]{height:70dvh}
 .game-shell .board-frame{max-width:min(100%,calc(100svh - 310px))}
}
@media(max-width:850px) and (orientation:landscape){.game-shell .side-panel[data-sheet]{min-height:0;height:calc(100svh - 85px)}.game-shell .sheet-handle{display:none}}
.player-card.active .clock::after{content:attr(data-turn-label);display:block;font:600 14px/1.1 system-ui;color:var(--text);text-align:end;white-space:nowrap}
.network-actions button,.local-analysis button,.gallery-list button,.community-gallery>button,.sheet-handle {background:var(--panel-2);color:var(--text);border:1px solid var(--line);border-radius:6px;padding:.6rem .8rem;min-height:44px}
@media(max-width:850px){.game-shell .board-frame {max-width:min(100%,calc(100svh - 270px));min-width:200px}.game-shell .game-topbar {gap:.3rem}.game-shell .match-title{display:none}.game-shell .side-panel{width:100%}}
@media(max-width:850px) and (orientation:landscape){
 .game-shell .arena{gap:.6rem}.game-shell .side-panel{grid-column:auto;grid-row:auto}
 .game-shell .board-wrap{gap:3px}.game-shell .board-frame{width:min(100%,calc(100svh - 195px));max-width:min(100%,calc(100svh - 195px));min-width:140px}
 .game-shell .board-wrap .player-card{min-height:44px;padding:2px 6px;gap:3px}
 .game-shell .board-wrap .clock{font-size:22px;padding:0}.game-shell .player-card.active .clock::after{font-size:12px}
 .game-shell .player-meta small{font-size:12px}.game-shell .player-meta b{font-size:14px}
}
