
/* Zero-flash initial paint: the browser lays out the full chess console offscreen.
   Show no transitional text, inherited Gomoku UI or unfinished controls. */
html:root.chess-booting,body.chess-console.chess-booting{background:#002529!important}
body.chess-console.chess-booting > :not(#chess-initial-load){visibility:hidden!important;opacity:0!important;pointer-events:none!important}
body.chess-console #chess-initial-load{display:none!important}
/* Fail visibly after 12s if a module is blocked instead of leaving an endless blank page. */
body.chess-console.chess-booting #chess-initial-load{
 position:fixed;inset:0;z-index:10000;display:flex!important;flex-direction:column;
 align-items:center;justify-content:center;gap:10px;padding:20px;box-sizing:border-box;
 visibility:visible!important;opacity:0;animation:chess-boot-timeout 1ms steps(1,end) 12s forwards;
 background:#002529;color:#fbf6e6;text-align:center;font:500 16px/1.5 system-ui,sans-serif
}
@keyframes chess-boot-timeout{to{opacity:1}}
.chess-console .chess-board{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));grid-template-rows:repeat(8,minmax(0,1fr));aspect-ratio:1/1;width:100%;margin:auto;overflow:hidden}.chess-console .chess-square{border:0;padding:0;display:grid;place-items:center;min-width:0;aspect-ratio:1;font-size:clamp(18px,3.5vw,55px);line-height:1;cursor:pointer}.chess-console .chess-square.light{background:#e3d8bd}.chess-console .chess-square.dark{background:#479b99}.chess-console .chess-square.chess-selected{box-shadow:inset 0 0 0 5px #e8c15f}.chess-console .chess-square.chess-target{box-shadow:none}.chess-console .chess-preview-notice{padding:10px;border:1px solid #bca16e;border-radius:8px;color:#fff2c9;background:#092d32;text-align:center;font-weight:700}.chess-console .chess-online-actions[hidden]{display:none}.chess-console .chess-actions{display:flex;gap:10px;justify-content:center;margin:8px auto}.chess-console .chess-actions button,.chess-console .chess-promote{border:1px solid #bd9b61;border-radius:8px;background:#103d44;color:#fff3d5;padding:8px 12px;cursor:pointer}.chess-console .chess-promote{font-size:24px}.chess-console .chess-moves{color:#c4d9db;font-size:12px;text-align:center}.chess-console button:disabled{opacity:.55;cursor:not-allowed}
/* Chess premium: one integrated console, no secondary control bar below the board. */
.chess-console .layout{grid-template-columns:clamp(255px,19vw,320px) minmax(0,1fr);height:100dvh;max-height:100dvh;max-width:none}
.chess-console .boardarea{grid-template-columns:minmax(0,1fr) clamp(270px,20.5vw,330px);grid-template-rows:clamp(52px,7vh,68px) clamp(31px,4.5vh,41px) minmax(0,1fr) clamp(36px,5.5vh,48px);column-gap:clamp(8px,1vw,15px);padding:clamp(7px,1vh,12px)}
.chess-console .board-center{grid-column:1;grid-row:3;min-width:0;min-height:0;height:100%;display:grid;place-items:center;overflow:hidden}
.chess-console .boardframe{box-sizing:border-box;display:block;align-self:center;justify-self:center;width:auto;height:100%;max-height:100%;max-width:100%;aspect-ratio:1;padding:clamp(6px,.75vw,11px);margin:0;border-radius:clamp(16px,1.6vw,26px)}
.chess-console .chess-board{box-sizing:border-box;width:100%;height:100%;aspect-ratio:1;grid-template-columns:repeat(8,minmax(0,1fr));grid-template-rows:repeat(8,minmax(0,1fr))}
.chess-console .chess-square{height:100%;width:100%;aspect-ratio:auto;min-height:0;min-width:0;font-size:clamp(22px,3.3vw,61px)}
.chess-console .side-dock{grid-column:2;grid-row:1 / 5;align-self:stretch;min-height:0;max-height:none;margin:clamp(45px,6.5vh,70px) 0 clamp(43px,6vh,65px);padding:9px;overflow:hidden}
.chess-console .match-panel{min-height:0;flex:1}
.chess-console .chess-status{grid-column:1;grid-row:2;display:flex;align-items:center;justify-content:center;font-size:clamp(12px,1.12vw,18px);padding:4px 10px}
.chess-console .bottom{grid-column:1;grid-row:4}
.chess-console .chess-chat-message{padding:7px 10px;margin:4px 2px;border-radius:9px;background:#104147;border:1px solid #32696b;color:#e7f6ef;overflow-wrap:anywhere;font-size:13px}
.chess-console .chess-chat-message strong{color:#f2c978}
.chess-console .chess-move-row{padding:6px 9px;border-bottom:1px solid #275359;color:#e1f6f2;font-variant-numeric:tabular-nums}
.chess-console #replay-game,.chess-console #undo-move,.chess-console #analyze-position,.chess-console #game-settings,.chess-console #remove-player,.chess-console #block-player{display:none!important}
.chess-console .side-dock .game-tools{display:none}
.chess-console .chess-square.chess-selected{box-shadow:inset 0 0 0 5px #f2c76d}
.chess-console .chess-square.chess-target{box-shadow:none}
@media(min-width:801px) and (max-height:650px){
 .chess-console .layout{min-height:0}
 .chess-console .boardarea{grid-template-rows:49px 30px minmax(0,1fr) 35px;gap:4px}
 .chess-console .side-dock{margin:35px 0}
}
@media(max-width:1100px) and (min-width:801px){
 .chess-console .layout{grid-template-columns:245px minmax(0,1fr)}
 .chess-console .boardarea{grid-template-columns:minmax(0,1fr) 250px}
 .chess-console .side-dock{padding:6px}
}
@media(max-width:800px){
 .chess-console .layout{display:flex;flex-direction:column;height:auto;max-height:none;min-height:100dvh}
 .chess-console .sidebar{width:100%;max-height:none}
 .chess-console .boardarea{display:flex;flex-direction:column;gap:10px;padding:10px;width:100%;height:auto;max-height:none}
 .chess-console .board-center{width:100%;height:auto;min-height:0;display:flex;overflow:visible}
 .chess-console .boardframe{width:min(100%,calc(100dvw - 20px),650px);height:auto;max-width:100%;aspect-ratio:1}
 .chess-console .side-dock{width:100%;margin:0;max-height:none}
 .chess-console .match-panel{min-height:300px}
 .chess-console .layout:not(.game-focus) .chess-status{min-height:36px}
}

/* Chess side navigation: Gomoku tile heights; long captions wrap inside the tile. */
.chess-console .sidebar .sidebar-footer .side-links a{white-space:normal;line-height:1.1;text-align:center}

/* P5 Premium: activate the already-existing Gomoku console chrome for chess only. */
.chess-console .side-dock>.game-tools{display:grid!important;grid-template-columns:repeat(7,minmax(0,1fr));gap:5px;min-height:42px;width:100%;flex:0 0 auto}
.chess-console .side-dock>.game-tools[hidden]{display:none!important}
.chess-console .side-dock>.game-tools .tool-btn{display:grid!important;place-items:center;min-height:39px;height:43px;min-width:0;width:100%;padding:2px}
.chess-console .side-dock>.game-tools .tool-btn[disabled]{opacity:.5;cursor:not-allowed}
.chess-console #undo-move,.chess-console #analyze-position,.chess-console #game-settings,
.chess-console #remove-player,.chess-console #block-player,.chess-console #fullscreen-game,
.chess-console #invite-friend{display:grid!important}
.chess-console .player .player-icon{display:none}
.chess-console .player{gap:clamp(2px,.55vw,9px)}
.chess-console .player>div{flex:1 1 auto;min-width:0}
.chess-console.chess-large-chat .chess-chat-message{font-size:17px}
@media(max-width:800px){
 .chess-console .side-dock>.game-tools{grid-template-columns:repeat(7,minmax(0,1fr))}
}


/* Chess layout R3: geometry follows the approved full Gomoku console, not focus mode. */
@media(min-width:801px){
 body.chess-console .layout:not(.game-focus){display:grid;grid-template-columns:clamp(355px,26vw,465px) minmax(0,1fr);width:100%;height:100dvh;min-height:0;max-height:100dvh}
 body.chess-console .layout:not(.game-focus)>.sidebar{width:100%;min-width:0;overflow-y:auto;overflow-x:hidden}
 body.chess-console .layout:not(.game-focus)>.boardarea{display:grid;grid-template-columns:minmax(0,1fr) clamp(290px,20vw,355px);width:100%;height:100%;padding-right:clamp(14px,2.3vw,36px);column-gap:clamp(12px,1.35vw,23px)}
 body.chess-console .layout:not(.game-focus) .side-dock{grid-column:2;grid-row:1/5;min-width:0;margin:clamp(40px,6vh,62px) 0 clamp(34px,5vh,53px)}
 body.chess-console .layout:not(.game-focus) .board-center{grid-column:1;grid-row:3;max-width:100%;min-height:0}
 body.chess-console .layout:not(.game-focus) .boardframe{width:auto;height:min(100%,calc(100vw - clamp(355px,26vw,465px) - clamp(290px,20vw,355px) - 100px));max-height:100%;aspect-ratio:1}
 body.chess-console .layout:not(.game-focus) .bottom{grid-column:1;grid-row:4}
 body.chess-console .layout:not(.game-focus) #game-state{grid-column:1;grid-row:2}
 body.chess-console .sidebar .sidecard.training-records{min-width:0}
 body.chess-console .sidebar .training-records .records-heading h2{font-size:clamp(17px,1.5vw,23px);line-height:1.2;white-space:normal;overflow-wrap:anywhere}
}
@media(min-width:801px) and (max-width:1180px){
 body.chess-console .layout:not(.game-focus){grid-template-columns:clamp(310px,28vw,345px) minmax(0,1fr)}
 body.chess-console .layout:not(.game-focus)>.boardarea{grid-template-columns:minmax(0,1fr) 260px;padding-right:12px;column-gap:8px}
 body.chess-console .layout:not(.game-focus) .boardframe{height:auto;width:min(100%,calc(100dvh - 195px))}
}
@media(max-width:800px){
 body.chess-console .sidebar .training-records h2{font-size:17px;white-space:normal}
}
/* Focus mode uses the native Gomoku .layout.game-focus geometry (no chess-only copy). */
body.chess-console .layout.game-focus #focus-start{display:none!important}

/* Functional side-console controls for chess only. */
body.chess-console #console-config-modal[hidden],body.chess-console #howto-modal[hidden]{display:none!important}
body.chess-console #howto-modal .howto-board-area[hidden]{display:none!important}
body.chess-console #replay-game,body.chess-console .replay-shortcut{display:none!important}
body.chess-console #howto-open{cursor:pointer}

/* Disabled preview squares must retain full contrast; disabled still blocks moves. */
body.chess-console .chess-board .chess-square:disabled{opacity:1!important;cursor:default}

/* FIDE draw claims appear only when a participant has a valid claim. */
body.chess-console .chess-claim-draw:not([hidden]){display:block;width:100%;padding:9px 12px;margin:8px 0;border:1px solid #cfaa65;border-radius:9px;background:linear-gradient(125deg,#0e5054,#07313e);color:#ffe2a9;font-weight:700;cursor:pointer}
body.chess-console .chess-claim-draw[hidden]{display:none!important}

/* Chess R5: keep online lobby/status text inside the premium gold-bordered rails. */
body.chess-console .layout:not(.game-focus) .boardarea #game-state{
 box-sizing:border-box;width:100%;max-width:100%;min-width:0;min-height:0;
 display:flex;align-items:center;justify-content:center;text-align:center;
 padding:2px clamp(8px,1vw,14px);line-height:1.15;
 font-size:clamp(11px,.9vw,15px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
body.chess-console .boardarea>.bottom{min-width:0;max-width:100%;box-sizing:border-box;display:flex;align-items:center;gap:clamp(4px,.55vw,9px);justify-content:space-between;flex-wrap:nowrap}
body.chess-console .boardarea>.bottom #move-count{flex:0 0 auto;min-width:0}
body.chess-console .boardarea>.bottom #board-help{flex:1 1 auto;min-width:0;max-width:none;margin:0;text-align:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.chess-console .boardarea>.bottom #turn-label{
 box-sizing:border-box;flex:0 1 auto;min-width:0;max-width:45%;width:auto;
 padding:clamp(6px,.5vw,9px) clamp(8px,.8vw,13px);
 display:inline-flex;align-items:center;justify-content:center;
 font-size:clamp(11px,1vw,16px);line-height:1.1;text-align:center;
 white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
body.chess-console .players .player-clock.clock-preview{color:#ffebbd;border-color:#d7b568;box-shadow:inset 0 1px #5cb0a267}
@media(max-width:1100px){
 body.chess-console .boardarea #game-state{font-size:clamp(10px,1.15vw,13px)}
 body.chess-console .boardarea>.bottom #turn-label{font-size:clamp(10px,1.15vw,13px);padding:5px 7px}
 body.chess-console .boardarea>.bottom #board-help{font-size:10px}
}
@media(max-width:800px){
 /* Phones: wrap long status/help text in the scrolling console; board-only focus keeps Gomoku's fixed rails. */
 body.chess-console .layout:not(.game-focus) .boardarea #game-state{white-space:normal;overflow-wrap:anywhere;min-height:34px}
 body.chess-console .layout:not(.game-focus) .boardarea>.bottom{flex-wrap:wrap;justify-content:space-between}
 body.chess-console .layout:not(.game-focus) .boardarea>.bottom #board-help{order:3;flex-basis:100%;white-space:normal}
 body.chess-console .layout:not(.game-focus) .boardarea>.bottom #turn-label{max-width:55%}
}

/* Original opaque SVG reliefs: inset leaves selection/capture rings visible. */
body.chess-console .chess-square.white-piece,body.chess-console .chess-square.black-piece{text-shadow:none}
body.chess-console .chess-square .chess-piece{display:block;width:88%;height:88%;pointer-events:none;user-select:none}
body.chess-console .chess-square:focus-visible{outline:3px solid #fff3bd;outline-offset:-3px}
body.chess-console .chess-promote{display:inline-grid;place-items:center;flex:0 0 42px;width:42px;height:42px;padding:2px}
body.chess-console .chess-promote .chess-piece{display:block;width:100%;height:100%;pointer-events:none}
body.chess-console .boardarea #game-state:has(.chess-promote){flex-wrap:wrap;white-space:normal;overflow:visible;min-height:48px}
/* Chess only: remove inherited curved golden decoration; preserve the gold frame. */
body.chess-console .boardarea::after{content:none!important;display:none!important}
/* CONSOLE-1TO1-02: unify outer console geometry with Gomoku, retain square 8x8 chessboard. */
@media (min-width:801px){
 body.chess-console .layout:not(.game-focus){
  grid-template-columns:27.5% minmax(0,1fr);max-width:1920px;
  min-height:590px;height:100dvh;max-height:100dvh
 }
 body.chess-console .layout:not(.game-focus)>.boardarea{
  display:grid;grid-template-columns:minmax(0,1fr) clamp(315px,23vw,390px);
  grid-template-rows:var(--console-players-height,60px) var(--console-status-height,38px) minmax(0,1fr) var(--console-bottom-height,45px);
  padding:28px clamp(10px,1vw,18px) 9px;row-gap:6px;
  column-gap:clamp(10px,1.1vw,19px);min-width:0;min-height:0
 }
 body.chess-console .layout:not(.game-focus) .side-dock{
  grid-column:2;grid-row:1 / 5;
  margin:72px 0 49px;padding:9px;
  align-self:stretch;justify-content:stretch;min-height:0;max-height:none
 }
 body.chess-console .layout:not(.game-focus) .match-panel{
  min-height:0;max-height:none;flex:1 1 auto
 }
 body.chess-console .layout:not(.game-focus) .side-dock .game-tools{
  box-sizing:border-box;flex:0 0 42px;height:42px;min-height:42px;max-height:42px
 }
 body.chess-console .layout:not(.game-focus) .board-center{
  grid-column:1;grid-row:3;display:flex;align-items:center;justify-content:center;
  width:100%;height:100%;min-width:0;min-height:0;overflow:hidden
 }
 body.chess-console .layout:not(.game-focus) .boardframe{
  box-sizing:border-box;width:calc(100dvh - 200px);height:auto;
  min-width:0;max-width:100%;max-height:100%;aspect-ratio:1;
  margin:0;justify-self:center;align-self:center
 }
 body.chess-console .layout:not(.game-focus) .bottom{
  grid-column:1;grid-row:4;min-width:0;min-height:0
 }
}
@media (min-width:801px) and (max-width:1190px){
 body.chess-console .layout:not(.game-focus){grid-template-columns:27% minmax(0,1fr)}
 body.chess-console .layout:not(.game-focus)>.boardarea{
  grid-template-columns:minmax(0,1fr) clamp(240px,24vw,290px)
 }
}
@media (max-width:800px){
 body.chess-console .layout:not(.game-focus)>.boardarea{padding:10px}
 body.chess-console .layout:not(.game-focus) .side-dock{
  box-sizing:border-box;padding:13px;height:452px;min-height:452px;max-height:none;
  gap:10px;flex:0 0 452px
 }
 body.chess-console .layout:not(.game-focus) .match-panel{
  box-sizing:border-box;min-height:0;height:auto;flex:1 1 auto
 }
 body.chess-console .layout:not(.game-focus) .side-dock .game-tools{
  box-sizing:border-box;flex:0 0 44px;height:44px;min-height:44px;max-height:44px
 }
 body.chess-console .layout:not(.game-focus) .board-center{min-width:0;max-width:100%}
 body.chess-console .layout:not(.game-focus) .boardframe{
  width:min(100%,620px);max-width:620px;min-width:0;height:auto;aspect-ratio:1
 }
}
@media (min-width:641px) and (max-width:800px){body.chess-console .layout:not(.game-focus)>.boardarea{padding:12px}}
/* R6: the chess focus layout must not reintroduce height:100% in narrow/zoomed view. */
@media (max-width:800px){
 body.chess-console .layout.game-focus .board-center{
  box-sizing:border-box;display:flex;align-items:center;justify-content:center;
  width:100%;height:100%;min-width:0;min-height:0;max-width:100%
 }
 body.chess-console .layout.game-focus .boardframe{
  box-sizing:border-box;display:block;flex:0 0 auto;
  width:min(100%,calc(100dvh - 210px));height:auto;
  max-width:100%;max-height:100%;min-width:0;min-height:0;
  aspect-ratio:1 / 1;margin:auto
 }
 body.chess-console .layout.game-focus .chess-board{
  box-sizing:border-box;width:100%;height:100%;aspect-ratio:1 / 1;
 }
}
/* CONSOLE-INTERACTION-1TO1-03: stable left-panel settings slot (same contract as Warcaby).
   Computer and online settings share one slot sized to the taller panel, so mode
   switches never move or push out the footer and the console configurator launcher.
   The inactive panel stays [hidden] for assistive technology and keyboard focus. */
body.chess-console .console-settings-slot{display:flex;flex-direction:column;gap:inherit;min-width:0}
body.chess-console .console-settings-slot>*{flex:none;min-width:0}
body.chess-console .chess-opponent-row{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:10px;margin:0 0 8px}
body.chess-console .chess-opponent-row>label{margin:0}
body.chess-console .chess-opponent-row>select{width:100%;min-width:0}
@media (min-width:801px){
 body.chess-console .layout:not(.game-focus) .console-settings-slot{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto;row-gap:inherit;align-content:start}
 /* Short windows: only the slot scrolls; header, mode buttons and footer stay in view.
    The 6px inline/bottom gutter keeps focus outlines of full-width fields visible. */
 body.chess-console .layout:not(.game-focus)>.sidebar>.console-settings-slot{flex:0 1 auto;min-height:0;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;padding:0 6px 6px;margin:0 -6px -6px}
 body.chess-console .layout:not(.game-focus) .console-settings-slot>#training-settings{grid-area:1/1}
 body.chess-console .layout:not(.game-focus) .console-settings-slot>#training-records{grid-area:2/1}
 body.chess-console .layout:not(.game-focus) .console-settings-slot>#online-settings{grid-area:1/1/3/2}
 body.chess-console .layout.console-hide-training-records:not(.game-focus) .console-settings-slot{row-gap:0}
 /* Hidden side panels release their columns exactly like Gomoku's console-hide-* rules. */
 body.chess-console .layout.console-hide-sidebar:not(.game-focus){grid-template-columns:minmax(0,1fr)}
 body.chess-console .layout:not(.game-focus):not(.console-hide-training-settings) .console-settings-slot>#training-settings[hidden],
 body.chess-console .layout:not(.game-focus):not(.console-hide-training-records) .console-settings-slot>#training-records[hidden],
 body.chess-console .layout:not(.game-focus):not(.console-hide-online-settings) .console-settings-slot>#online-settings[hidden]{display:block!important;visibility:hidden!important;pointer-events:none}
}
/* Very short desktop windows: mirror Gomoku's (max-height:650px) rails and dock end. */
@media (min-width:801px) and (max-height:650px){
 body.chess-console .layout:not(.game-focus)>.boardarea{row-gap:5px;padding-right:11px;padding-bottom:7px;padding-left:11px}
 body.chess-console .layout:not(.game-focus) .side-dock{margin-bottom:37px}
}
/* Board-only focus mode (desktop CSS widths): the 8x8 frame is the largest square that fits the
   Gomoku board row, also when the row is taller than wide (portrait tablets wider than 800px).
   Narrow/zoomed widths keep the R6 rule above (no height:100%). */
@media (min-width:801px){
 body.chess-console .layout.game-focus .board-center{container-type:inline-size}
 body.chess-console .layout.game-focus .boardframe{box-sizing:border-box;width:auto;height:100%;max-width:100%;max-height:min(100%,100cqi);aspect-ratio:1;margin:auto}
 body.chess-console .layout.game-focus .boardframe>.chess-board{width:100%;height:100%;aspect-ratio:1}
}
/* Chrome 145: entering board-only focus re-evaluates the players/player-panel container
   queries and dropped the VS emblem's box (0x0) until reload, so the second player card slid
   into the VS track. A focus-dependent rule on the emblem forces its restyle on enter and exit;
   min-width:0 is already its computed value, so the look is unchanged. */
body.chess-console .layout.game-focus .players>.versus{min-width:0}
/* Same no-collision contract as Warcaby (e2e/warcaby-layout.browser.mjs): restore-layout gear on the
   right edge below navigation and clocks; with the chat dock hidden the top navigation stays in the
   layout at the right end of the status row instead of covering the white player's clock. */
body.chess-console #console-config-fab:not([hidden]){position:fixed;top:clamp(275px,30vh,340px);right:14px;left:auto;z-index:9000;box-sizing:border-box;width:46px;height:46px;max-width:46px;padding:0;overflow:hidden;white-space:nowrap;font-size:0;display:grid;place-items:center;border:1px solid #f4d18b;border-radius:13px;background:linear-gradient(145deg,#116369 0%,#06333c 48%,#041f2c 100%);box-shadow:inset 0 1px 0 #fff2c077,0 0 0 1px #94652e,0 7px 22px #0009,0 0 17px #b8975277;color:#ffe5a6}
body.chess-console #console-config-fab:not([hidden])::before{content:"⚙";color:#ffe5a6;font:800 23px/1 "Segoe UI",sans-serif}
body.chess-console #console-config-fab:not([hidden]):is(:hover,:focus-visible){border-color:#fff1b9;background:linear-gradient(145deg,#16848a,#073b48 65%,#072834);box-shadow:inset 0 1px 0 #fff5c888,0 0 0 1px #e5b96b,0 8px 24px #0009,0 0 19px #eed58b88}
@media(max-width:800px){body.chess-console #console-config-fab:not([hidden]){top:auto;bottom:calc(12px + env(safe-area-inset-bottom));right:10px;width:42px;height:42px;max-width:42px}}
@media (min-width:801px){
 body.chess-console .layout.console-hide-dock:not(.game-focus):not(.console-hide-quicklinks)>.boardarea{grid-template-columns:minmax(0,1fr) auto!important}
 body.chess-console .layout.console-hide-dock:not(.game-focus):not(.console-hide-quicklinks) :is(.players,.board-center,.bottom){grid-column:1 / -1}
 body.chess-console .layout.console-hide-dock:not(.game-focus):not(.console-hide-quicklinks) .premium-quick-links{position:relative;top:auto;right:auto;grid-column:2;grid-row:2;align-self:center;justify-self:end;width:auto}
 body.chess-console .layout.console-hide-dock.console-hide-status:not(.game-focus):not(.console-hide-quicklinks){--console-status-height:auto}
}
/* P1: legal move markers are centered dots, never square outlines. Occupied capture targets get a round ring. */
body.chess-console .chess-board .chess-square.chess-target{position:relative;box-shadow:none}
body.chess-console .chess-board .chess-square.chess-target::after{content:"";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:23%;height:23%;border-radius:50%;background:#0d583fb8;box-shadow:0 0 0 2px #f8e6b175;pointer-events:none;z-index:2}
body.chess-console .chess-board .chess-square.chess-target:is(.white-piece,.black-piece)::after{width:88%;height:88%;box-sizing:border-box;background:transparent;border:5px solid #0d583fc9;box-shadow:0 0 0 1px #f8e6b175}
body.chess-console .chess-board .chess-square.chess-target.chess-drop-hover{box-shadow:none}
body.chess-console .chess-board .chess-square.chess-target.chess-drop-hover::after{background:#f3cb7d;box-shadow:0 0 0 3px #0d583faa}
body.chess-console .chess-board .chess-square.chess-target.chess-drop-hover:is(.white-piece,.black-piece)::after{background:transparent;border-color:#f3cb7d;box-shadow:0 0 0 2px #0d583faa}
/* Legal destinations must show only their circular markers, even with keyboard focus. */
body.chess-console .chess-board .chess-square.chess-target:is(:focus,:focus-visible,.chess-selected,.chess-drop-hover){outline:none;box-shadow:none}
/* CHESS-COORD-P1: chessboard coordinates at the left and bottom edges, following board flip. */
body.chess-console .chess-board .chess-square{position:relative}
body.chess-console .chess-board .chess-coordinate{position:absolute;z-index:4;pointer-events:none;user-select:none;font:700 clamp(10px,1vw,13px)/1 'Segoe UI',Arial,sans-serif;text-shadow:0 1px 1px #0003}
body.chess-console .chess-board .chess-coordinate-rank{top:3px;left:3px}
body.chess-console .chess-board .chess-coordinate-file{right:3px;bottom:3px}
body.chess-console .chess-board .chess-square.light .chess-coordinate{color:#265a55}
body.chess-console .chess-board .chess-square.dark .chess-coordinate{color:#edf7d4}
/* CHESS-HOVER-P1: understated square-color feedback; never draw rectangular frames. */
body.chess-console .chess-board .chess-square.chess-selected{box-shadow:none!important;outline:none;background-color:#c3d8bc}
body.chess-console .chess-board .chess-square.dark.chess-selected{background-color:#5daca1}
body.chess-console .chess-board .chess-square.chess-target:hover,
body.chess-console .chess-board .chess-square.chess-drop-hover{box-shadow:none!important;outline:none!important;transition:background-color .1s ease}
body.chess-console .chess-board .chess-square.light:is(.chess-target:hover,.chess-drop-hover){background-color:#d1e0ca}
body.chess-console .chess-board .chess-square.dark:is(.chess-target:hover,.chess-drop-hover){background-color:#72b8ac}
body.chess-console .chess-board .chess-square.chess-drop-hover::after{opacity:0}
body.chess-console .chess-board .chess-square.chess-target:hover::after{opacity:0}
/* Active selected piece uses background tint; keep keyboard-visible focus for other squares. */
/* CHESS-DRAG-P1: drag & drop. The ghost is position:fixed on <body>, so the board, clocks and panels
   never move. Only squares holding a piece that may move now block touch scrolling (no global lock). */
body.chess-console .chess-board .chess-square{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
body.chess-console .chess-board .chess-square.chess-draggable{cursor:grab;touch-action:none}
body.chess-console .chess-board.chess-dragging,body.chess-console .chess-board.chess-dragging .chess-square{cursor:grabbing}
body.chess-console .chess-board .chess-square.chess-drag-origin .chess-piece{visibility:hidden}
body.chess-console .chess-board .chess-square.chess-drop-hover:not(.chess-target){box-shadow:inset 0 0 0 4px #fff3bd}
body.chess-console .chess-board .chess-square.chess-target.chess-drop-hover{box-shadow:none}
body.chess-console .chess-drag-ghost{position:fixed;left:0;top:0;z-index:13000;display:grid;place-items:center;pointer-events:none;will-change:transform;filter:drop-shadow(0 7px 9px #000a)}
body.chess-console .chess-drag-ghost .chess-piece{display:block;width:88%;height:88%;transform:scale(1.08);pointer-events:none}
body.chess-console .chess-drag-ghost.chess-drag-return{transition:transform .16s ease-out}
@media (prefers-reduced-motion:reduce){
 body.chess-console .chess-drag-ghost .chess-piece{transform:none}
 body.chess-console .chess-drag-ghost.chess-drag-return{transition:none}
}
/* Piece input options inside the existing studio row; same chips as the layout presets. */
body.chess-console .console-config-presets>.chess-input-modes{display:flex;align-items:center;flex-wrap:wrap;gap:7px;margin-left:auto}
body.chess-console .chess-input-modes>span{font:700 11px "Segoe UI",sans-serif;color:#ddc18a;margin-right:5px}
body.chess-console .chess-input-mode{position:relative;box-sizing:border-box;display:inline-flex;align-items:center;min-height:33px;padding:8px 12px;border:1px solid #a88e5e;border-radius:9px;background:linear-gradient(#12444b,#062732);color:#ffe6b9;font:700 11px "Segoe UI",sans-serif;cursor:pointer}
body.chess-console .chess-input-mode>input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}
body.chess-console .chess-input-mode:has(input:checked){border-color:#fff0ba;background:linear-gradient(#fff0b4,#edbc58,#bf862c);color:#142e32}
body.chess-console .chess-input-mode:has(input:focus-visible){outline:2px solid #83ffe4;outline-offset:2px}

/* The dock is a direct child of boardarea in this layout, including on phones.
   Give BOTH tabs the same definite flex allocation; content-sized height:auto
   collapsed the mobile moves list to its single 26px empty-state row. */
body.chess-console .layout:not(.game-focus) .side-dock .match-panel{
  display:flex;flex-direction:column;box-sizing:border-box;
  flex:1 0 300px;height:300px;min-height:300px;max-height:none;overflow:hidden
}
body.chess-console .layout:not(.game-focus) .side-dock .dock-content{
  flex:1 1 0;min-height:0;overflow:hidden
}
body.chess-console .layout:not(.game-focus) .side-dock #moves-list,
body.chess-console .layout:not(.game-focus) .side-dock #chat-messages{
  flex:1 1 0;min-height:0;max-height:none;overflow:auto
}
body.chess-console .layout:not(.game-focus) .side-dock>.players{
  display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
  gap:6px!important;width:100%;min-width:0;flex:0 0 66px;align-items:stretch
}
body.chess-console .layout:not(.game-focus) .side-dock>.players>.versus{display:none!important}
body.chess-console .layout:not(.game-focus) .side-dock>.players>.player{
  box-sizing:border-box;display:flex!important;min-width:0;width:100%;max-width:100%;height:66px;
  padding:5px 7px!important;gap:5px!important;font-size:12px!important
}
body.chess-console .layout:not(.game-focus) .side-dock>.players>.player strong{
  max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px!important
}
body.chess-console .layout:not(.game-focus) .side-dock>.players .player-clock{
  display:inline-flex!important;align-items:center;justify-content:center;min-width:51px;font-size:12px!important
}
body.chess-console .layout:not(.game-focus) .side-dock>#game-state{
  flex:0 0 38px;height:38px;white-space:normal;overflow-wrap:anywhere;font-size:12px
}
body.chess-console .layout:not(.game-focus) .side-dock>#game-state:has(.chess-promote){flex-basis:100px;height:auto}
body.chess-console .layout:not(.game-focus) .side-dock>.sidebar{
  display:flex!important;flex-direction:column;flex:0 0 auto;box-sizing:border-box;
  position:static!important;width:100%!important;height:auto!important;max-height:none!important;
  min-height:0!important;overflow:visible!important;padding:0!important;margin:0!important;
  background:transparent!important;border:0!important;box-shadow:none!important
}
body.chess-console .layout:not(.game-focus) .side-dock>.sidebar .side-header{display:none!important}
body.chess-console .layout:not(.game-focus) .side-dock .sidecard{padding:5px 0!important;margin:0!important}
body.chess-console .layout:not(.game-focus) .side-dock .sidebar-footer{margin:0!important;padding:0!important}
body.chess-console .layout:not(.game-focus) .side-dock .side-links{gap:4px!important}
body.chess-console .chess-reference-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:5px}
body.chess-console .chess-reference-actions #restart{width:100%;margin:0!important;min-width:0}
body.chess-console .chess-reference-invite{
  border:1px solid #e4b75a;border-radius:12px;background:#07343a;color:#fff0c3;
  font:700 clamp(12px,.95vw,16px)/1.2 Georgia,serif;cursor:pointer;min-width:0;padding:8px 5px
}
body.chess-console .chess-reference-invite:hover{background:#125257}
body.chess-console .layout:not(.game-focus) .boardframe{
  padding:0!important;border:0!important;border-radius:0!important;box-shadow:none!important;background:transparent!important
}
body.chess-console .layout:not(.game-focus) .chess-board{border:0;border-radius:0!important}
body.chess-console .layout.game-focus .chess-reference-heading{display:none}
/* Reserve a real slot for restoring settings; a fixed mobile gear can cover
   clocks/status when the player scrolls the newly combined right panel. */
body.chess-console .layout:not(.game-focus)>.boardarea>#console-config-fab:not([hidden]){
  position:relative;inset:auto;grid-column:1;grid-row:1;justify-self:end;align-self:center;order:-1
}
/* Preserve configurator choices after reparenting sidebar/players/heading. */
body.chess-console .layout.console-hide-sidebar:not(.game-focus) .side-dock>.sidebar,
body.chess-console .layout.console-hide-dock:not(.game-focus) .side-dock,
body.chess-console .layout.console-hide-players:not(.game-focus) .side-dock>.players,
body.chess-console .layout.console-hide-heading .chess-reference-heading{display:none!important}
@media (min-width:801px){
  body.chess-console .layout:not(.game-focus){display:block!important;position:fixed;inset:0;width:auto;height:auto!important;min-height:0;max-height:none;overflow:hidden}
  body.chess-console .layout:not(.game-focus)>.boardarea{
    box-sizing:border-box;display:grid!important;grid-template-columns:minmax(0,1fr) clamp(370px,29vw,485px)!important;
    grid-template-rows:60px minmax(0,1fr) 42px!important;gap:8px 18px;
    width:100%;height:100%;padding:8px 20px 12px!important;min-height:0
  }
  body.chess-console .layout:not(.game-focus) .chess-reference-heading{
    grid-column:1;grid-row:1;display:flex;align-items:center;justify-content:flex-start;min-width:0
  }
  body.chess-console .layout:not(.game-focus) .chess-reference-heading .gomoku-heading{margin:0!important}
  body.chess-console .layout:not(.game-focus) .arena{
    grid-column:1!important;grid-row:2!important;display:grid!important;grid-template-columns:minmax(0,1fr);place-items:center;
    width:100%;height:100%;min-width:0;min-height:0;overflow:hidden
  }
  body.chess-console .layout:not(.game-focus) .board-center{
    display:grid!important;place-items:center!important;width:100%;height:100%;min-width:0;min-height:0;
    grid-column:auto!important;grid-row:auto!important;overflow:hidden;container-type:size
  }
  body.chess-console .layout:not(.game-focus) .boardframe{
    box-sizing:border-box!important;width:min(100cqw,100cqh)!important;height:min(100cqw,100cqh)!important;
    max-height:100%!important;max-width:100%!important;aspect-ratio:1!important;margin:auto!important
  }
  body.chess-console .layout:not(.game-focus) .side-dock{
    box-sizing:border-box;grid-column:2!important;grid-row:1/4!important;display:flex!important;
    flex-direction:column;gap:8px;margin:58px 0 0!important;padding:8px!important;
    width:100%;height:calc(100% - 58px);min-height:0;max-height:none!important;
    overflow-y:auto;overflow-x:hidden;align-self:stretch
  }
  body.chess-console .layout:not(.game-focus) .side-dock>.sidebar{
    flex:0 1 auto;min-height:300px!important;overflow:hidden!important
  }
  /* Keep the existing overlapping settings grid: hidden online controls reserve
     their row, rather than stacking a second invisible panel below training. */
  body.chess-console .layout:not(.game-focus) .side-dock .console-settings-slot{
    display:grid;gap:5px;flex:1 1 auto;min-height:0;margin:0;padding:0;overflow-y:auto;overflow-x:hidden
  }
  body.chess-console .layout:not(.game-focus) .side-dock>.game-tools{flex:0 0 42px}
  body.chess-console .layout:not(.game-focus) .bottom{
    grid-column:1!important;grid-row:3!important;width:100%;min-width:0;min-height:0
  }
  body.chess-console .layout:not(.game-focus) .premium-quick-links{
    grid-column:2!important;grid-row:1!important;align-self:start;justify-self:end;
    position:relative!important;top:0!important;right:0!important;margin:0!important;z-index:3
  }
}
@media (max-width:800px){
  body.chess-console .chess-reference-heading{order:-2;display:flex;justify-content:center}
  body.chess-console .layout:not(.game-focus)>.boardarea>#console-config-fab:not([hidden]){align-self:flex-end}
  body.chess-console .layout:not(.game-focus)>.boardarea{display:flex!important;flex-direction:column!important}
  body.chess-console .layout:not(.game-focus) .arena{order:0;display:flex;justify-content:center;min-height:0}
  body.chess-console .layout:not(.game-focus) .side-dock{
    order:2;display:flex;flex-direction:column;height:auto!important;min-height:0;max-height:none!important;flex:0 0 auto!important
  }
}

/* OWNER COMPACT CHESS — preserve the exact coordinate-labelled board and game handlers.
   Only the chess visual layout changes; Gomoku and Warcaby retain their rules. */
body.chess-console .layout:not(.game-focus) .side-dock>.sidebar .sidebar-footer{display:none!important}
body.chess-console .layout:not(.game-focus) .side-dock .mode{
  display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  align-items:center;gap:0!important;margin:0 0 7px!important;
  padding:0!important;background:transparent!important;border:0!important;box-shadow:none!important
}
body.chess-console .layout:not(.game-focus) .side-dock .mode-choice{
  min-height:40px!important;height:40px!important;display:flex!important;
  align-items:center;justify-content:center!important;gap:0!important;
  padding:0 6px!important;margin:0!important;
  border:0!important;border-radius:0!important;background:transparent!important;
  box-shadow:none!important;font:700 clamp(15px,1.1vw,19px)/1.2 Georgia,serif!important;
  color:#e3edf0!important;cursor:pointer
}
body.chess-console .layout:not(.game-focus) .side-dock .mode-choice.active{
  color:#ffd47b!important;border-bottom:2px solid #dfb96e!important
}
body.chess-console .layout:not(.game-focus) .side-dock .mode-choice .mode-icon,
body.chess-console .layout:not(.game-focus) .side-dock .mode-choice .mode-arrow,
body.chess-console .layout:not(.game-focus) .side-dock .mode-choice small{display:none!important}
body.chess-console .layout:not(.game-focus) .side-dock .mode-choice>span{margin:0!important}
body.chess-console .layout:not(.game-focus) .side-dock .mode-choice strong{font:inherit!important;color:inherit!important}
body.chess-console .layout:not(.game-focus) .side-dock .console-settings-slot{
  flex:0 0 auto!important;display:block!important;height:auto!important;
  min-height:0!important;max-height:none!important;overflow:visible!important;
  padding:0!important;margin:0!important
}
body.chess-console .layout:not(.game-focus) .side-dock>.sidebar{
  min-height:0!important;flex:0 0 auto!important;overflow:visible!important
}
body.chess-console .layout:not(.game-focus) .side-dock #training-records:not([hidden]){display:block!important}
body.chess-console .layout:not(.game-focus) .side-dock #training-records[hidden]{display:none!important}
body.chess-console .layout:not(.game-focus) .side-dock #training-settings{
  display:flex!important;flex-direction:column;gap:4px;min-height:0!important;
  max-height:none!important;overflow:visible!important
}
body.chess-console .layout:not(.game-focus) .side-dock #training-settings[hidden],
body.chess-console .layout:not(.game-focus) .side-dock #online-settings[hidden]{display:none!important}
body.chess-console .layout:not(.game-focus) .side-dock #training-settings>h2{
  font:700 clamp(16px,1.2vw,21px)/1.25 Georgia,serif!important;
  margin:0 0 2px!important;padding:0!important
}
body.chess-console .layout:not(.game-focus) .side-dock #training-settings>.panel-help{margin:0 0 4px!important}
body.chess-console .layout:not(.game-focus) .side-dock .chess-owner-options{
  display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  gap:9px;align-items:center;min-width:0;margin:4px 0 7px
}
body.chess-console .layout:not(.game-focus) .side-dock .chess-owner-options .chess-opponent-row,
body.chess-console .layout:not(.game-focus) .side-dock .chess-owner-options .chess-owner-level{
  display:grid!important;grid-template-columns:auto minmax(0,1fr);
  align-items:center;gap:5px;margin:0!important;min-width:0
}
body.chess-console .layout:not(.game-focus) .side-dock .chess-owner-options label{
  display:block;margin:0!important;font-size:clamp(10px,.8vw,12px);white-space:nowrap
}
body.chess-console .layout:not(.game-focus) .side-dock .chess-owner-options select{
  min-width:0!important;width:100%!important;max-width:100%!important;
  height:34px!important;font-size:clamp(11px,.8vw,13px)!important;padding:0 20px 0 7px!important
}
body.chess-console .layout:not(.game-focus) .side-dock .chess-owner-level:has(>select[hidden]){display:none!important}
/* Advanced training controls stay usable and scrollable below the chat;
   they are not removed or made invisible to tests or keyboard users. */
body.chess-console .layout:not(.game-focus) .side-dock .chess-owner-advanced{
  display:flex;flex-direction:column;gap:5px;padding:10px 5px;
  border-top:1px solid #6a807950;margin-top:8px;flex:0 0 auto
}
body.chess-console .layout:not(.game-focus) .side-dock:has(#training-settings[hidden]) .chess-owner-advanced{display:none!important}
body.chess-console .layout:not(.game-focus) .side-dock .chess-owner-advanced>select{width:100%;max-width:100%}
body.chess-console .layout:not(.game-focus) .side-dock .chess-owner-advanced>label{font-size:12px}

body.chess-console .layout:not(.game-focus) .side-dock .match-panel{
  flex:0 0 340px!important;min-height:340px!important;height:340px!important;
  max-height:none!important
}
body.chess-console .layout:not(.game-focus) .side-dock .match-panel:not(.moves-only) #chat-panel{
  display:flex!important;flex:1 1 auto!important;min-height:155px!important;overflow:hidden
}
body.chess-console .layout:not(.game-focus) .side-dock .match-panel:not(.moves-only) #chat-messages{
  display:block!important;flex:1 1 auto!important;min-height:125px!important;max-height:none!important;
  overflow-y:auto!important
}
body.chess-console .layout:not(.game-focus) .side-dock .match-panel:not(.moves-only) .mini-chat{
  flex:0 0 auto!important;min-height:0!important;height:auto!important
}
body.chess-console .layout:not(.game-focus) .side-dock .mini-chat .chat-preview{display:none!important}
body.chess-console .layout:not(.game-focus) .side-dock .dock-tabs{
  flex:0 0 auto;order:-1;margin-top:0!important
}
body.chess-console .layout:not(.game-focus) .side-dock .chess-reference-actions{
  display:grid!important;grid-template-columns:1fr 1fr;
  gap:7px;margin:3px 0 0;padding:0
}
body.chess-console .layout:not(.game-focus) .side-dock #game-state{flex:0 0 auto}
body.chess-console .layout:not(.game-focus) .bottom{
  display:grid!important;grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;gap:10px;padding:0!important;border:0!important;background:transparent!important
}
body.chess-console .layout:not(.game-focus) .bottom .info-pill{
  background:rgba(0,25,30,.58)!important;border:0!important;border-radius:9px!important;
  box-shadow:none!important;padding:4px 9px!important;font-size:clamp(12px,1vw,18px)!important
}
body.chess-console .layout:not(.game-focus) .bottom #turn-label{
  width:auto!important;min-width:0!important;max-width:100%!important;flex:0 0 auto!important;
  white-space:nowrap!important;text-overflow:clip!important;
}
body.chess-console .layout:not(.game-focus) .bottom .help{
  text-align:center;font-size:clamp(10px,.8vw,13px);min-width:0
}
body.chess-console .layout:not(.game-focus)>.boardarea>.players{
  display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
  grid-column:1;grid-row:1;align-self:end;justify-self:center;
  width:min(100%,720px)!important;max-width:100%;height:30px!important;
  min-height:0!important;gap:10px!important;margin:0!important;
  padding:0!important;overflow:visible!important
}
body.chess-console .layout.console-hide-players:not(.game-focus)>.boardarea>.players{display:none!important}
body.chess-console .layout:not(.game-focus)>.boardarea>.players>.player{
  justify-content:space-between!important
}
body.chess-console .layout:not(.game-focus)>.boardarea>.players .player-clock{
  box-sizing:border-box!important;flex:0 0 74px!important;width:74px!important;
  max-width:74px!important;justify-content:center!important
}
@media (min-width:801px){
  body.chess-console .layout:not(.game-focus) .side-dock>.sidebar{
    box-sizing:border-box!important;flex:0 0 205px!important;height:205px!important;
    min-height:205px!important;max-height:205px!important;overflow:hidden!important
  }
  body.chess-console .layout:not(.game-focus) .side-dock .console-settings-slot{
    flex:1 1 auto!important;min-height:0!important;max-height:100%!important;
    overflow-x:hidden!important;overflow-y:auto!important;scrollbar-width:thin
  }
  body.chess-console .layout:not(.game-focus)>.boardarea>#console-config-fab:not([hidden]){
    position:fixed!important;inset:auto 12px 12px auto!important;
    grid-column:auto!important;grid-row:auto!important;z-index:20
  }
}
body.chess-console .layout:not(.game-focus)>.boardarea>.players>.versus{display:none!important}
body.chess-console .layout:not(.game-focus)>.boardarea>.players>.player{
  display:flex!important;align-items:center;justify-content:center;
  min-width:0!important;max-width:none!important;width:100%!important;
  min-height:0!important;height:30px!important;padding:0 4px!important;
  gap:6px!important;background:transparent!important;border:0!important;
  border-radius:0!important;box-shadow:none!important;
  font-size:clamp(11px,.87vw,15px)!important
}
body.chess-console .layout:not(.game-focus)>.boardarea>.players .player-clock{
  display:inline-flex!important;min-width:44px!important;align-items:center;
  font-size:clamp(12px,1vw,17px)!important;font-weight:800;color:#ffd47b;
  border:0!important;background:transparent!important;box-shadow:none!important
}
body.chess-console .layout:not(.game-focus)>.boardarea>.players .player-icon{display:none!important}
body.chess-console .layout:not(.game-focus)>.boardarea>.players .player strong,
body.chess-console .layout:not(.game-focus)>.boardarea>.players .player small{
  font-size:clamp(10px,.83vw,13px)!important;white-space:nowrap
}
@media (min-width:801px){
  body.chess-console .layout:not(.game-focus)>.boardarea{
    grid-template-rows:96px minmax(0,1fr) 36px!important
  }
  body.chess-console .layout:not(.game-focus) .chess-reference-heading{
    grid-column:1;grid-row:1;justify-content:center!important;align-self:start!important
  }
  body.chess-console .layout:not(.game-focus) .side-dock{
    gap:6px!important;margin:62px 0 0!important;
    height:calc(100% - 62px)!important
  }
  body.chess-console .layout:not(.game-focus) .side-dock>.game-tools{flex:0 0 auto!important}
}
/* During browser fullscreen the top quick links must not overlay the game
   status inside the right dock when the dock has been scrolled. */
@media (min-width:801px){
  html:fullscreen body.chess-console .layout:not(.game-focus) .premium-quick-links{
    grid-column:1!important;grid-row:1!important;justify-self:end!important;
    right:auto!important;z-index:5
  }
}
@media (max-width:800px){
  body.chess-console .layout:not(.game-focus)>.boardarea>.players{
    order:-1;align-self:stretch;height:auto!important;min-height:30px!important;
    width:100%!important;gap:4px!important;margin:1px 0 6px!important
  }
  body.chess-console .layout:not(.game-focus)>.boardarea>.players>.player{
    display:grid!important;grid-template-columns:15px minmax(0,1fr) 54px!important;
    padding:1px!important;height:auto!important;gap:3px!important;
    justify-content:stretch!important
  }
  body.chess-console .layout:not(.game-focus)>.boardarea>.players>.player>div{
    min-width:0!important;max-width:100%!important;overflow:hidden!important
  }
  body.chess-console .layout:not(.game-focus)>.boardarea>.players .player-clock{
    width:54px!important;min-width:54px!important;max-width:54px!important;flex:0 0 54px!important;
    justify-content:center!important
  }
  body.chess-console .layout:not(.game-focus)>.boardarea>.players .player strong,
  body.chess-console .layout:not(.game-focus)>.boardarea>.players .player small{font-size:10px!important}
  body.chess-console .layout:not(.game-focus) .side-dock .chess-owner-options{gap:5px}
  body.chess-console .layout:not(.game-focus) .side-dock .chess-owner-options .chess-opponent-row,
  body.chess-console .layout:not(.game-focus) .side-dock .chess-owner-options .chess-owner-level{
    grid-template-columns:1fr;gap:2px
  }
  body.chess-console .layout:not(.game-focus) .side-dock .chess-owner-options label{font-size:11px}
  body.chess-console .layout:not(.game-focus) .side-dock .match-panel{
    flex:0 0 340px!important;min-height:340px!important;height:340px!important
  }
  body.chess-console .layout:not(.game-focus) .bottom{
    grid-template-columns:1fr 1fr;order:1;gap:3px
  }
  body.chess-console .layout:not(.game-focus) .bottom .help{
    grid-column:1/-1;grid-row:2
  }
}

body.chess-console .layout:not(.game-focus) .boardframe,
body.chess-console .layout:not(.game-focus) .board-center,
body.chess-console .layout:not(.game-focus) .chess-board{
  border:0!important;border-radius:0!important;box-shadow:none!important;
  outline:0!important;background:transparent!important;padding:0!important
}
body.chess-console .layout:not(.game-focus) .side-dock,
body.chess-console .layout:not(.game-focus) .side-dock :is(
  .sidebar,.sidecard,.match-panel,.dock-header,.dock-tabs,.dock-tab,.dock-content,
  .dock-title,.players,.player,.mini-chat,.chat-compose,.game-tools,.tool-btn,
  .chess-reference-actions,.chess-reference-invite,.chess-owner-options select,
  .chess-time-row select,.mode,.mode-choice,.chat-form input,.chat-form button,
  .chess-minimal-more,.chess-owner-advanced
){
  border:0!important;box-shadow:none!important;border-radius:0!important;
  background-image:none!important
}
body.chess-console .layout:not(.game-focus) .side-dock :is(.sidecard,.sidebar,.match-panel,.dock-content,.dock-header,.dock-title,.mini-chat,.game-tools,.mode,.console-settings-slot){
  background:transparent!important
}
body.chess-console .layout:not(.game-focus) .side-dock :is(button,input,select,textarea){
  border:0!important;border-radius:0!important;box-shadow:none!important;background-image:none!important
}
body.chess-console .layout:not(.game-focus) .side-dock :is(button,input,select,summary):focus-visible{
  outline:2px solid #e8d8ac!important;outline-offset:2px!important
}
body.chess-console .layout:not(.game-focus) .side-dock .dock-header,
body.chess-console .layout:not(.game-focus) .side-dock .dock-title,
body.chess-console .layout:not(.game-focus) .side-dock .chat-footnote,
body.chess-console .layout:not(.game-focus) .side-dock .dock-tab-icon,
body.chess-console .layout:not(.game-focus) .side-dock .chat-led,
body.chess-console .layout:not(.game-focus) .side-dock #training-settings>h2,
body.chess-console .layout:not(.game-focus) .side-dock #training-settings>.panel-help,
body.chess-console .layout:not(.game-focus) .side-dock .mini-chat .chat-preview{
  display:none!important
}
body.chess-console .layout:not(.game-focus) .side-dock .mode-choice{
  font:700 14px/1.2 system-ui,sans-serif!important;
  min-height:34px!important;height:34px!important;padding:4px 6px!important;
  background:#174b51!important;color:#d8e9e6!important
}
body.chess-console .layout:not(.game-focus) .side-dock .mode-choice.active{
  background:#317a78!important;color:#fff8e8!important;border:0!important
}
body.chess-console .layout:not(.game-focus) .side-dock .console-settings-slot{
  margin:0!important;padding:0!important;overflow:visible!important
}
body.chess-console .layout:not(.game-focus) .side-dock .chess-owner-options{
  display:grid!important;grid-template-columns:1fr 1fr;gap:6px!important;
  margin:2px 0 5px!important
}
body.chess-console .layout:not(.game-focus) .side-dock .chess-owner-options .chess-opponent-row,
body.chess-console .layout:not(.game-focus) .side-dock .chess-owner-options .chess-owner-level{
  display:flex!important;flex-direction:column;align-items:stretch;gap:3px!important
}
body.chess-console .layout:not(.game-focus) .side-dock .chess-owner-options label,
body.chess-console .layout:not(.game-focus) .side-dock .chess-time-row label{
  font:500 10px/1.2 system-ui,sans-serif!important;color:#b5d6d4!important
}
body.chess-console .layout:not(.game-focus) .side-dock .chess-owner-options select,
body.chess-console .layout:not(.game-focus) .side-dock .chess-time-row select{
  box-sizing:border-box;min-width:0!important;height:30px!important;
  padding:0 20px 0 7px!important;font:500 12px system-ui,sans-serif!important;
  background:#16474c!important;color:#f4f0de!important
}
body.chess-console .layout:not(.game-focus) .side-dock .chess-time-row{
  display:flex;align-items:center;justify-content:space-between;gap:8px;
  min-height:30px;margin:0 0 5px;padding:0
}
body.chess-console .layout:not(.game-focus) .side-dock .chess-time-row select{width:112px!important;flex:0 0 112px}
body.chess-console .layout:not(.game-focus) .side-dock .chess-reference-actions{
  display:grid!important;grid-template-columns:1fr 1fr!important;gap:5px!important;
  margin:0!important;padding:0!important
}
body.chess-console .layout:not(.game-focus) .side-dock .chess-reference-actions :is(button,#restart){
  min-height:30px!important;height:30px!important;margin:0!important;
  padding:0 5px!important;font:600 12px system-ui,sans-serif!important;
  background:#1c565a!important;color:#e6f4ed!important;border:0!important
}
body.chess-console .layout:not(.game-focus) .side-dock #game-state{
  box-sizing:border-box;height:auto!important;min-height:26px!important;
  padding:4px 2px!important;font:500 11px/1.3 system-ui,sans-serif!important;
  color:#d8e8dc!important;background:transparent!important;border:0!important
}
body.chess-console .layout:not(.game-focus) .side-dock .dock-tabs{
  display:grid!important;grid-template-columns:1fr 1fr;gap:0!important;
  padding:0!important;margin:0!important;background:transparent!important
}
body.chess-console .layout:not(.game-focus) .side-dock .dock-tab{
  min-height:31px!important;padding:4px 5px!important;
  font:700 13px system-ui,sans-serif!important;text-align:center;
  color:#cfdfdd!important;background:#174b51!important
}
body.chess-console .layout:not(.game-focus) .side-dock .dock-tab.active{
  color:#f5f1df!important;background:#317a78!important
}
body.chess-console .layout:not(.game-focus) .side-dock .match-panel{
  min-width:0!important;min-height:160px!important;height:auto!important;
  display:flex!important;flex-direction:column;padding:0!important;
  background:transparent!important;overflow:hidden!important
}
body.chess-console .layout:not(.game-focus) .side-dock .match-panel .dock-content{
  flex:1 1 0!important;min-height:0!important;padding:0!important;overflow:hidden
}
body.chess-console .layout:not(.game-focus) .side-dock #chat-messages,
body.chess-console .layout:not(.game-focus) .side-dock #moves-list{
  box-sizing:border-box;min-height:0!important;height:100%!important;
  padding:8px 7px!important;background:#10383d!important;overflow-y:auto!important
}
body.chess-console .layout:not(.game-focus) .side-dock .mini-chat{
  flex:0 0 auto!important;margin:0!important;padding:0!important;
  background:transparent!important
}
body.chess-console .layout:not(.game-focus) .side-dock .chat-compose{
  display:grid!important;grid-template-columns:minmax(0,1fr) 32px;
  align-items:center;gap:4px;min-height:36px!important;padding:0!important;
  background:transparent!important
}
body.chess-console .layout:not(.game-focus) .side-dock #chat-input{
  min-width:0!important;width:100%!important;min-height:34px!important;
  background:#16474c!important;color:#fff!important;
  padding:0 9px!important;font:12px system-ui,sans-serif!important
}
body.chess-console .layout:not(.game-focus) .side-dock #chat-send{
  width:32px!important;height:34px!important;min-width:0!important;
  background:#317a78!important;color:#fff!important;padding:0!important
}
body.chess-console .layout:not(.game-focus) .side-dock .game-tools{
  display:flex!important;justify-content:space-evenly!important;
  min-height:30px!important;gap:2px!important;margin:0!important;padding:0!important;
  background:transparent!important
}
body.chess-console .layout:not(.game-focus) .side-dock .tool-btn{
  width:auto!important;min-width:28px!important;height:30px!important;
  min-height:30px!important;padding:0 4px!important;
  background:#174b51!important;color:#d8e9e6!important
}
body.chess-console .layout:not(.game-focus) .side-dock .chess-minimal-more{
  margin:0;padding:0;min-width:0;color:#b9d2d0;font:11px system-ui,sans-serif
}
body.chess-console .layout:not(.game-focus) .side-dock .chess-minimal-more>summary{
  cursor:pointer;padding:4px 2px;list-style:none;color:#b9d2d0
}
body.chess-console .layout:not(.game-focus) .side-dock .chess-minimal-more>summary::before{content:'+';margin-right:6px}
body.chess-console .layout:not(.game-focus) .side-dock .chess-minimal-more[open]>summary::before{content:'−'}
body.chess-console .layout:not(.game-focus) .side-dock .chess-minimal-more #focus-game{
  display:block!important;min-height:30px!important;padding:5px 3px!important;margin:0!important;
  width:100%!important;text-align:left!important;font:12px system-ui,sans-serif!important;
  color:#d6e8e2!important;background:#16474c!important;border:0!important;
  border-radius:0!important;box-shadow:none!important
}
body.chess-console .layout:not(.game-focus) .side-dock .chess-owner-advanced{
  display:flex!important;max-height:170px!important;overflow-y:auto!important;
  border:0!important;margin:0!important;padding:4px 0!important;background:transparent!important
}
@media(min-width:801px){
  body.chess-console,body.chess-console .layout:not(.game-focus){background:#e3ebe7!important}
  body.chess-console .layout:not(.game-focus)>.boardarea{
    box-sizing:border-box!important;display:grid!important;
    grid-template-columns:minmax(0,1fr) clamp(276px,20vw,338px)!important;
    grid-template-rows:minmax(0,1fr)!important;
    gap:8px!important;width:100%!important;height:100%!important;
    padding:0 0 0 5px!important;overflow:hidden!important
  }
  body.chess-console .layout:not(.game-focus) .chess-reference-heading,
  body.chess-console .layout:not(.game-focus)>.boardarea>.bottom,
  body.chess-console .layout:not(.game-focus) .premium-quick-links,
  body.chess-console .layout:not(.game-focus) .boardtop{display:none!important}
  body.chess-console .layout:not(.game-focus) .arena{
    grid-column:1!important;grid-row:1!important;
    width:100%!important;height:100%!important;min-height:0!important;
    margin:0!important;padding:0!important;display:grid!important;place-items:center!important
  }
  body.chess-console .layout:not(.game-focus) .board-center{
    width:100%!important;height:100%!important;min-height:0!important;
    display:grid!important;place-items:center!important;container-type:size
  }
  body.chess-console .layout:not(.game-focus) .boardframe{
    width:min(100cqw,100cqh)!important;height:min(100cqw,100cqh)!important;
    max-width:100%!important;max-height:100%!important;aspect-ratio:1!important;
    margin:0 auto!important
  }
  body.chess-console .layout:not(.game-focus) .side-dock{
    box-sizing:border-box!important;grid-column:2!important;grid-row:1!important;
    display:flex!important;flex-direction:column!important;
    gap:5px!important;align-self:stretch;
    height:100%!important;min-height:0!important;max-height:100%!important;
    width:100%!important;margin:0!important;padding:10px 10px 8px!important;
    background:#092e33!important;overflow-x:hidden!important;overflow-y:auto!important;
    scrollbar-width:thin
  }
  body.chess-console .layout:not(.game-focus) .side-dock>.players{
    order:1;box-sizing:border-box;display:grid!important;
    grid-template-columns:1fr!important;grid-template-rows:repeat(2,33px)!important;
    flex:0 0 70px!important;width:100%!important;height:70px!important;
    gap:4px!important;margin:0!important;padding:0!important
  }
  body.chess-console .layout:not(.game-focus) .side-dock>.players>.versus{display:none!important}
  body.chess-console .layout:not(.game-focus) .side-dock>.players>.player{
    box-sizing:border-box!important;display:flex!important;
    justify-content:space-between!important;align-items:center!important;
    width:100%!important;height:33px!important;min-height:33px!important;
    padding:0 8px!important;gap:5px!important;background:#16474c!important
  }
  body.chess-console .layout:not(.game-focus) .side-dock>.players>.player small,
  body.chess-console .layout:not(.game-focus) .side-dock>.players>.player-icon,
  body.chess-console .layout:not(.game-focus) .side-dock>.players>.player .stone{
    display:none!important
  }
  body.chess-console .layout:not(.game-focus) .side-dock>.players>.player strong{
    color:#e2eee8!important;font:600 12px system-ui,sans-serif!important
  }
  body.chess-console .layout:not(.game-focus) .side-dock>.players .player-clock{
    display:inline-flex!important;align-items:center;justify-content:center;
    min-width:70px!important;width:70px!important;height:31px!important;
    color:#fff0bd!important;font:700 19px system-ui,sans-serif!important;
    background:transparent!important;border:0!important
  }
  body.chess-console .layout:not(.game-focus) .side-dock>.sidebar{
    order:2;box-sizing:border-box!important;flex:0 0 auto!important;
    width:100%!important;height:auto!important;min-height:0!important;
    max-height:none!important;overflow:visible!important;padding:0!important
  }
  body.chess-console .layout:not(.game-focus) .side-dock .console-settings-slot{
    max-height:none!important;height:auto!important;flex:0 0 auto!important
  }
  body.chess-console .layout:not(.game-focus) .side-dock>.chess-reference-actions{
    order:3;flex:0 0 auto
  }
  body.chess-console .layout:not(.game-focus) .side-dock>#game-state{
    order:4;flex:0 0 auto!important
  }
  body.chess-console .layout:not(.game-focus) .side-dock>#match-panel{
    order:5;flex:1 1 160px!important;min-height:160px!important;height:auto!important
  }
  body.chess-console .layout:not(.game-focus) .side-dock>.game-tools{
    order:6;flex:0 0 auto!important
  }
  body.chess-console .layout:not(.game-focus) .side-dock>.chess-minimal-more{
    order:7;flex:0 0 auto
  }
  body.chess-console .layout:not(.game-focus)>.boardarea>#console-config-fab{display:none!important}
}
@media(max-width:800px){
  body.chess-console .layout:not(.game-focus) .side-dock .chess-time-row{display:grid;grid-template-columns:1fr 112px}
  body.chess-console .layout:not(.game-focus) .side-dock .chess-minimal-more{margin:8px 0}
}

/* No enclosing rounded frame, bevel or shadow around the chess canvas. */
body.chess-console .layout:not(.game-focus),
body.chess-console .layout:not(.game-focus) > .boardarea{
  border:0!important;border-radius:0!important;box-shadow:none!important;
  outline:0!important;filter:none!important
}
body.chess-console .layout:not(.game-focus)::before,
body.chess-console .layout:not(.game-focus)::after{
  display:none!important
}
/* The older parity layout reserves an invisible online form. In the compact
   design it must release its height, or the chat is pushed below the viewport. */
body.chess-console .layout:not(.game-focus):not(.console-hide-online-settings) .side-dock .console-settings-slot > #online-settings[hidden],
body.chess-console .layout:not(.game-focus):not(.console-hide-training-settings) .side-dock .console-settings-slot > #training-settings[hidden],
body.chess-console .layout:not(.game-focus):not(.console-hide-training-records) .side-dock .console-settings-slot > #training-records[hidden]{
  display:none!important
}
/* Reserve a constant compact settings height across Computer and Online:
   changing mode must not move the chat or clocks in the desktop console. */
@media(min-width:801px){
  body.chess-console .layout:not(.game-focus) .side-dock > .sidebar{
    flex:0 0 172px!important;height:172px!important;min-height:172px!important;
    max-height:172px!important;overflow-y:auto!important;overflow-x:hidden!important;
    scrollbar-width:thin
  }
}
/* Keep the old full-board action interactive only while its disclosure is open;
   otherwise it is visually clipped by the native details element. */
body.chess-console .layout:not(.game-focus) .side-dock .chess-minimal-more:not([open]) #focus-game{
  display:none!important
}

/* GRACZ.PL mobile chess: approved one-column, frameless board console. */
@media (max-width:800px){
  html:has(body.chess-console),body.chess-console{
    width:100%;max-width:100%;margin:0;overflow-x:clip;background:#e2f2ef!important
  }
  body.chess-console .layout:not(.game-focus){
    box-sizing:border-box!important;display:block!important;position:static!important;
    width:100%!important;height:auto!important;min-height:100dvh!important;
    max-height:none!important;margin:0!important;padding:0!important;
    overflow:visible!important;background:#e2f2ef!important
  }
  body.chess-console .layout:not(.game-focus)>.boardarea{
    box-sizing:border-box!important;display:flex!important;flex-direction:column!important;
    width:100%!important;min-width:0!important;max-width:100%!important;
    height:auto!important;min-height:100dvh!important;max-height:none!important;
    margin:0!important;padding:0 0 max(12px,env(safe-area-inset-bottom))!important;
    gap:0!important;overflow:visible!important;background:#e2f2ef!important
  }
  body.chess-console .layout:not(.game-focus)>.boardarea>.chess-reference-heading,
  body.chess-console .layout:not(.game-focus)>.boardarea>.premium-quick-links,
  body.chess-console .layout:not(.game-focus)>.boardarea>.bottom,
  body.chess-console .layout:not(.game-focus)>.boardarea>.boardtop,
  body.chess-console .layout:not(.game-focus)>.boardarea>#console-config-fab{
    display:none!important
  }
  body.chess-console .layout:not(.game-focus) .chess-mobile-heading{
    box-sizing:border-box!important;order:0!important;
    display:flex!important;align-items:center;justify-content:space-between;
    gap:10px;min-height:50px;width:100%;padding:8px 12px!important;
    background:#07575d!important;color:#fff!important;border:0!important;
    font:700 17px/1.2 system-ui,sans-serif!important
  }
  body.chess-console .chess-mobile-heading a{
    color:#fff!important;text-decoration:none!important;font-weight:800!important;
    letter-spacing:.025em
  }
  body.chess-console .chess-mobile-heading strong{
    color:#fff!important;font-weight:650!important;font-size:16px!important
  }
  body.chess-console .layout:not(.game-focus)>.boardarea>.chess-mobile-mode{
    box-sizing:border-box!important;order:1!important;
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
    width:100%!important;min-height:46px!important;margin:0!important;padding:4px 6px!important;
    gap:5px!important;background:#08777b!important;border:0!important;
    box-shadow:none!important;border-radius:0!important
  }
  body.chess-console .layout:not(.game-focus)>.boardarea>.chess-mobile-mode .mode-choice{
    box-sizing:border-box!important;display:flex!important;justify-content:center!important;
    align-items:center!important;min-height:38px!important;height:38px!important;
    min-width:0!important;margin:0!important;padding:4px 5px!important;
    border:0!important;border-radius:0!important;box-shadow:none!important;
    background:#12676a!important;color:#efffff!important;
    font:700 clamp(13px,4vw,16px)/1.1 system-ui,sans-serif!important
  }
  body.chess-console .layout:not(.game-focus)>.boardarea>.chess-mobile-mode .mode-choice.active{
    color:#064b4d!important;background:#f4e9c9!important
  }
  body.chess-console .layout:not(.game-focus)>.boardarea>.chess-mobile-mode .mode-choice :is(.mode-icon,.mode-arrow,small){
    display:none!important
  }
  body.chess-console .layout:not(.game-focus)>.boardarea>.players{
    box-sizing:border-box!important;order:2!important;display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    width:100%!important;height:52px!important;min-height:52px!important;
    max-height:52px!important;max-width:100%!important;
    margin:0!important;padding:6px!important;gap:7px!important;
    background:#08777b!important;border:0!important;box-shadow:none!important;
    overflow:visible!important
  }
  body.chess-console .layout:not(.game-focus)>.boardarea>.players>.versus{
    display:none!important
  }
  body.chess-console .layout:not(.game-focus)>.boardarea>.players>.player{
    box-sizing:border-box!important;display:flex!important;flex-direction:row!important;
    align-items:center!important;justify-content:space-between!important;
    width:100%!important;min-width:0!important;height:40px!important;min-height:40px!important;
    margin:0!important;padding:3px 7px!important;gap:4px!important;
    background:#f3eacb!important;color:#103d40!important;
    border:0!important;border-radius:0!important;box-shadow:none!important
  }
  body.chess-console .layout:not(.game-focus)>.boardarea>.players>.player.second{order:0!important}
  body.chess-console .layout:not(.game-focus)>.boardarea>.players>.player.first{order:1!important}
  body.chess-console .layout:not(.game-focus)>.boardarea>.players>.player>.stone,
  body.chess-console .layout:not(.game-focus)>.boardarea>.players>.player>.player-icon,
  body.chess-console .layout:not(.game-focus)>.boardarea>.players>.player small{
    display:none!important
  }
  body.chess-console .layout:not(.game-focus)>.boardarea>.players>.player>div{
    min-width:0!important;overflow:hidden!important
  }
  body.chess-console .layout:not(.game-focus)>.boardarea>.players>.player strong{
    display:block!important;max-width:100%!important;overflow:hidden!important;
    white-space:nowrap!important;text-overflow:ellipsis!important;
    color:#10494d!important;font:650 clamp(10px,2.9vw,12px)/1.15 system-ui,sans-serif!important
  }
  body.chess-console .layout:not(.game-focus)>.boardarea>.players>.player .player-clock:not([hidden]){
    display:inline-flex!important;align-items:center!important;justify-content:flex-end!important;
    width:74px!important;flex:0 0 74px!important;max-width:74px!important;
    height:34px!important;min-height:34px!important;margin:0!important;padding:0!important;
    background:transparent!important;border:0!important;border-radius:0!important;
    color:#092d30!important;font:750 clamp(16px,5vw,22px)/1 system-ui,sans-serif!important;
    font-variant-numeric:tabular-nums!important
  }
  body.chess-console .layout:not(.game-focus)>.boardarea>.players>.player .player-clock[hidden]{
    display:none!important
  }
  body.chess-console .layout:not(.game-focus)>.boardarea>.players>.player:has(.player-clock[hidden])::after{
    content:'∞';margin-left:auto;color:#174e50;font:bold 20px system-ui,sans-serif
  }
  body.chess-console .layout:not(.game-focus)>.boardarea>.arena{
    box-sizing:border-box!important;order:3!important;display:flex!important;
    width:100%!important;max-width:100%!important;height:auto!important;
    min-height:0!important;max-height:none!important;
    margin:0!important;padding:0!important;justify-content:center!important;
    align-items:stretch!important;background:transparent!important;overflow:visible!important
  }
  body.chess-console .layout:not(.game-focus) .board-center{
    box-sizing:border-box!important;display:block!important;container-type:normal!important;
    width:100%!important;height:auto!important;min-width:0!important;min-height:0!important;
    max-width:100%!important;max-height:none!important;
    margin:0!important;padding:0!important;overflow:visible!important
  }
  body.chess-console .layout:not(.game-focus) .board-center>.boardtop{
    display:none!important
  }
  body.chess-console .layout:not(.game-focus) .boardframe{
    box-sizing:border-box!important;display:block!important;
    width:100%!important;height:auto!important;min-height:0!important;
    max-width:100%!important;max-height:none!important;aspect-ratio:1/1!important;
    margin:0!important;padding:0!important;overflow:hidden!important;
    border:0!important;border-radius:0!important;box-shadow:none!important
  }
  body.chess-console .layout:not(.game-focus) .chess-board{
    box-sizing:border-box!important;display:grid!important;
    width:100%!important;height:100%!important;max-width:100%!important;
    grid-template-columns:repeat(8,minmax(0,1fr))!important;
    grid-template-rows:repeat(8,minmax(0,1fr))!important;
    aspect-ratio:1/1!important;margin:0!important;padding:0!important;
    overflow:hidden!important;border:0!important;border-radius:0!important;box-shadow:none!important
  }
  body.chess-console .layout:not(.game-focus) .chess-board .chess-square{
    position:relative!important;box-sizing:border-box!important;
    width:100%!important;min-width:0!important;height:100%!important;
    margin:0!important;padding:0!important;overflow:hidden!important;
    border:0!important;border-radius:0!important;
    box-shadow:none!important;outline-offset:-2px!important
  }
  body.chess-console .chess-board .chess-coordinate{
    display:block!important;position:absolute!important;z-index:5!important;
    pointer-events:none!important;user-select:none!important;
    width:auto!important;height:auto!important;margin:0!important;padding:0!important;
    font:750 clamp(10px,3vw,14px)/1 system-ui,sans-serif!important;
    text-shadow:none!important;transform:none!important
  }
  body.chess-console .chess-board .chess-coordinate-rank{
    top:3px!important;left:3px!important;right:auto!important;bottom:auto!important
  }
  body.chess-console .chess-board .chess-coordinate-file{
    right:3px!important;bottom:3px!important;top:auto!important;left:auto!important
  }
  body.chess-console .chess-board .chess-square.light .chess-coordinate{color:#1e6665!important}
  body.chess-console .chess-board .chess-square.dark .chess-coordinate{color:#ecf5d9!important}
  body.chess-console .layout:not(.game-focus)>.boardarea>.side-dock{
    box-sizing:border-box!important;order:4!important;display:flex!important;
    flex-direction:column!important;gap:0!important;position:static!important;
    width:100%!important;min-width:0!important;height:auto!important;
    min-height:0!important;max-height:none!important;flex:0 0 auto!important;
    margin:0!important;padding:0!important;
    background:#d9f1ed!important;border:0!important;border-radius:0!important;
    box-shadow:none!important;overflow:visible!important
  }
  body.chess-console .layout:not(.game-focus) .side-dock>.sidebar{
    box-sizing:border-box!important;order:1!important;display:flex!important;
    flex:0 0 auto!important;flex-direction:column!important;
    width:100%!important;min-width:0!important;height:auto!important;
    min-height:0!important;max-height:none!important;overflow:visible!important;
    margin:0!important;padding:0!important;
    border:0!important;border-radius:0!important;box-shadow:none!important;
    background:#c2ece8!important
  }
  body.chess-console .layout:not(.game-focus) .side-dock>.sidebar>.side-header,
  body.chess-console .layout:not(.game-focus) .side-dock .sidebar-footer,
  body.chess-console .layout:not(.game-focus) .side-dock #training-settings>h2,
  body.chess-console .layout:not(.game-focus) .side-dock #training-settings>.panel-help{
    display:none!important
  }
  body.chess-console .layout:not(.game-focus) .side-dock .console-settings-slot{
    box-sizing:border-box!important;display:block!important;
    width:100%!important;height:auto!important;min-height:0!important;
    max-height:none!important;margin:0!important;padding:0!important;
    overflow:visible!important;background:transparent!important
  }
  body.chess-console .layout:not(.game-focus) .side-dock #training-settings:not([hidden]){
    box-sizing:border-box!important;display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    width:100%!important;margin:0!important;padding:7px 6px!important;
    gap:5px!important;align-items:start!important;
    border:0!important;border-radius:0!important;box-shadow:none!important;
    background:#c2ece8!important
  }
  body.chess-console .layout:not(.game-focus) .side-dock .chess-owner-options{
    display:contents!important
  }
  body.chess-console .layout:not(.game-focus) .side-dock .chess-owner-options :is(.chess-opponent-row,.chess-owner-level),
  body.chess-console .layout:not(.game-focus) .side-dock .chess-time-row{
    box-sizing:border-box!important;display:flex!important;
    flex-direction:column!important;align-items:stretch!important;
    justify-content:flex-start!important;gap:3px!important;
    width:100%!important;min-width:0!important;height:auto!important;
    min-height:0!important;margin:0!important;padding:0!important
  }
  body.chess-console .layout:not(.game-focus) .side-dock .chess-owner-options label,
  body.chess-console .layout:not(.game-focus) .side-dock .chess-time-row label{
    display:block!important;min-width:0!important;
    color:#145a5d!important;white-space:nowrap!important;overflow:hidden!important;
    text-overflow:ellipsis!important;
    font:650 clamp(9px,2.7vw,11px)/1.2 system-ui,sans-serif!important
  }
  body.chess-console .layout:not(.game-focus) .side-dock .chess-owner-options select,
  body.chess-console .layout:not(.game-focus) .side-dock .chess-time-row select{
    box-sizing:border-box!important;display:block!important;appearance:auto!important;
    width:100%!important;max-width:100%!important;min-width:0!important;
    height:34px!important;min-height:34px!important;
    padding:0 2px!important;overflow:hidden!important;
    color:#103d41!important;background:#e7f7f3!important;
    border:0!important;border-radius:0!important;box-shadow:none!important;
    font:600 clamp(10px,2.9vw,12px)/1.2 system-ui,sans-serif!important
  }
  /* The older responsive rule assigned a 112px flex basis to the time select.
     On a column flex layout that becomes a 112px *height*. Keep one compact row. */
  body.chess-console .layout:not(.game-focus) .side-dock .chess-time-row select{
    flex:0 0 34px!important;width:100%!important;height:34px!important;
    min-height:34px!important;max-height:34px!important
  }
  body.chess-console .layout:not(.game-focus) .side-dock #online-settings:not([hidden]){
    display:block!important;max-height:180px!important;overflow-y:auto!important;
    margin:0!important;padding:8px!important;scrollbar-width:thin!important;
    background:#c2ece8!important;border:0!important;box-shadow:none!important
  }
  body.chess-console .layout:not(.game-focus) .side-dock #game-state{
    box-sizing:border-box!important;order:2!important;display:block!important;
    width:100%!important;min-height:30px!important;height:auto!important;
    margin:0!important;padding:5px 9px!important;
    background:#d9f1ed!important;border:0!important;border-radius:0!important;box-shadow:none!important;
    color:#215f60!important;font:550 12px/1.35 system-ui,sans-serif!important;
    overflow-wrap:anywhere!important
  }
  body.chess-console .layout:not(.game-focus) .side-dock #match-panel{
    box-sizing:border-box!important;order:3!important;display:flex!important;
    flex-direction:column!important;flex:0 0 270px!important;
    width:100%!important;min-width:0!important;
    height:270px!important;min-height:270px!important;max-height:none!important;
    margin:0!important;padding:0!important;gap:0!important;
    border:0!important;border-radius:0!important;box-shadow:none!important;
    background:#e6f5f1!important;overflow:hidden!important
  }
  body.chess-console .layout:not(.game-focus) .side-dock #match-panel .dock-header,
  body.chess-console .layout:not(.game-focus) .side-dock #match-panel .dock-title,
  body.chess-console .layout:not(.game-focus) .side-dock #match-panel .chat-footnote,
  body.chess-console .layout:not(.game-focus) .side-dock #match-panel .chat-preview,
  body.chess-console .layout:not(.game-focus) .side-dock #match-panel .dock-tab-icon,
  body.chess-console .layout:not(.game-focus) .side-dock #match-panel .chat-led{
    display:none!important
  }
  body.chess-console .layout:not(.game-focus) .side-dock #match-panel .dock-tabs{
    box-sizing:border-box!important;display:grid!important;order:0!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:0!important;
    flex:0 0 42px!important;width:100%!important;height:42px!important;
    margin:0!important;padding:0!important;border:0!important;border-radius:0!important;
    box-shadow:none!important;background:#08777b!important
  }
  body.chess-console .layout:not(.game-focus) .side-dock #match-panel .dock-tab{
    box-sizing:border-box!important;display:flex!important;align-items:center!important;
    justify-content:center!important;width:100%!important;min-height:42px!important;
    height:42px!important;margin:0!important;padding:5px!important;
    border:0!important;border-radius:0!important;box-shadow:none!important;
    color:#efffff!important;background:#08777b!important;
    font:700 16px/1.2 system-ui,sans-serif!important
  }
  body.chess-console .layout:not(.game-focus) .side-dock #match-panel .dock-tab.active{
    background:#f3eacb!important;color:#075359!important
  }
  body.chess-console .layout:not(.game-focus) .side-dock #match-panel .dock-content{
    box-sizing:border-box!important;flex:1 1 0!important;
    min-height:0!important;width:100%!important;
    margin:0!important;padding:0!important;overflow:hidden!important;
    background:#e6f5f1!important
  }
  body.chess-console .layout:not(.game-focus) .side-dock :is(#chat-messages,#moves-list){
    box-sizing:border-box!important;display:block!important;
    width:100%!important;height:100%!important;min-height:0!important;
    max-height:none!important;margin:0!important;padding:10px!important;
    background:#eaf7f3!important;color:#153e42!important;overflow-y:auto!important;
    scrollbar-width:thin!important
  }
  body.chess-console .layout:not(.game-focus) .side-dock #match-panel .mini-chat{
    box-sizing:border-box!important;flex:0 0 auto!important;
    height:auto!important;min-height:0!important;width:100%!important;
    margin:0!important;padding:6px!important;
    background:#ccebe6!important;border:0!important;border-radius:0!important;
    box-shadow:none!important
  }
  body.chess-console .layout:not(.game-focus) .side-dock #match-panel .chat-compose{
    box-sizing:border-box!important;display:grid!important;
    grid-template-columns:minmax(0,1fr) 43px!important;align-items:center!important;
    gap:5px!important;width:100%!important;
    min-height:44px!important;margin:0!important;padding:0!important;
    background:transparent!important;border:0!important;box-shadow:none!important
  }
  body.chess-console .layout:not(.game-focus) .side-dock #chat-input{
    box-sizing:border-box!important;width:100%!important;min-width:0!important;
    height:44px!important;min-height:44px!important;margin:0!important;padding:0 9px!important;
    color:#163f42!important;background:#fff!important;
    border:0!important;border-radius:0!important;box-shadow:none!important;
    font:14px system-ui,sans-serif!important
  }
  body.chess-console .layout:not(.game-focus) .side-dock #chat-send{
    box-sizing:border-box!important;width:43px!important;min-width:43px!important;
    height:44px!important;min-height:44px!important;margin:0!important;padding:0!important;
    background:#08777b!important;color:#fff!important;
    border:0!important;border-radius:0!important;box-shadow:none!important;
    font:700 20px system-ui,sans-serif!important
  }
  body.chess-console .layout:not(.game-focus) .side-dock>.chess-reference-actions{
    box-sizing:border-box!important;order:4!important;display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:4px!important;margin:0!important;padding:4px 6px!important;
    border:0!important;background:#d9f1ed!important
  }
  body.chess-console .layout:not(.game-focus) .side-dock>.chess-reference-actions button{
    box-sizing:border-box!important;height:35px!important;min-height:35px!important;
    margin:0!important;padding:3px 4px!important;
    background:#bee2de!important;color:#15585c!important;
    border:0!important;border-radius:0!important;box-shadow:none!important;
    font:650 12px system-ui,sans-serif!important
  }
  body.chess-console .layout:not(.game-focus) .side-dock>.game-tools{
    box-sizing:border-box!important;order:5!important;display:flex!important;
    flex:0 0 auto!important;justify-content:space-evenly!important;
    gap:4px!important;min-height:34px!important;height:auto!important;
    width:100%!important;margin:0!important;padding:4px 6px!important;
    background:#d9f1ed!important;border:0!important;box-shadow:none!important
  }
  body.chess-console .layout:not(.game-focus) .side-dock>.game-tools .tool-btn{
    box-sizing:border-box!important;flex:1 1 0!important;width:auto!important;
    min-width:32px!important;min-height:32px!important;height:32px!important;
    padding:0 3px!important;margin:0!important;
    border:0!important;border-radius:0!important;box-shadow:none!important;
    color:#e9f8f6!important;background:#17666a!important
  }
  body.chess-console .layout:not(.game-focus) .side-dock>.chess-minimal-more{
    box-sizing:border-box!important;order:6!important;flex:0 0 auto!important;
    width:100%!important;margin:0!important;padding:5px 8px!important;
    border:0!important;border-radius:0!important;box-shadow:none!important;
    background:#d9f1ed!important;color:#15565a!important
  }
  body.chess-console .layout:not(.game-focus) .side-dock>.chess-minimal-more>#console-config-open{
    box-sizing:border-box!important;display:flex!important;align-items:center!important;
    justify-content:flex-start!important;width:100%!important;
    min-width:0!important;max-width:100%!important;min-height:36px!important;
    height:36px!important;margin:5px 0!important;padding:5px 9px!important;
    font:650 12px system-ui,sans-serif!important;color:#10555a!important;
    background:#c4e8e3!important;border:0!important;border-radius:0!important;
    box-shadow:none!important
  }
  body.chess-console .layout:not(.game-focus) .side-dock>.chess-minimal-more>summary{
    box-sizing:border-box!important;min-height:30px!important;
    padding:5px 0!important;color:#15565a!important;
    font:600 12px system-ui,sans-serif!important
  }
  body.chess-console .layout:not(.game-focus) .side-dock :is(button,select,input,summary):focus-visible{
    outline:2px solid #09767e!important;outline-offset:-2px!important
  }
  body.chess-console .layout.console-hide-mode:not(.game-focus)>.boardarea>.chess-mobile-mode,
  body.chess-console .layout.console-hide-players:not(.game-focus)>.boardarea>.players,
  body.chess-console .layout.console-hide-dock:not(.game-focus)>.boardarea>.side-dock{
    display:none!important
  }
}
/* Keep full-board mode independent of the responsive mobile console. */
body.chess-console .layout.game-focus .chess-mobile-heading,
body.chess-console .layout.game-focus .chess-mobile-mode{display:none!important}

body.chess-console .layout:not(.game-focus) {
  background:#003739!important;
}
body.chess-console .layout:not(.game-focus) .chess-board .chess-square{
  position:relative!important;box-sizing:border-box!important;
  min-width:0!important;min-height:0!important;padding:0!important;
  border:0!important;border-radius:0!important;overflow:hidden!important
}
body.chess-console .layout:not(.game-focus) .chess-board .chess-coordinate{
  position:absolute!important;display:block!important;
  pointer-events:none!important;user-select:none!important;z-index:3!important;
  padding:0!important;margin:0!important;
  font:750 clamp(10px,1.1vw,15px)/1 system-ui,sans-serif!important
}
body.chess-console .layout:not(.game-focus) .chess-board .chess-coordinate-rank{
  top:3px!important;left:3px!important;bottom:auto!important;right:auto!important
}
body.chess-console .layout:not(.game-focus) .chess-board .chess-coordinate-file{
  right:3px!important;bottom:3px!important;left:auto!important;top:auto!important
}
/* Only the mode switch, two actual clocks, three actions and chat/moves are visible.
   Keep the existing settings and status nodes mounted for the chess game engine. */
body.chess-console .layout:not(.game-focus) .side-dock{
  background:#faf2df!important;color:#074749!important;
  border:0!important;box-shadow:none!important;
  border-radius:18px!important;
  gap:12px!important;padding:12px!important;
}
body.chess-console .layout:not(.game-focus) .side-dock>.sidebar{
  box-sizing:border-box!important;order:0!important;
  flex:0 0 auto!important;height:auto!important;
  min-height:0!important;max-height:none!important;
  padding:0!important;margin:0!important;overflow:visible!important
}
body.chess-console .layout:not(.game-focus) .side-dock .mode{
  margin:0!important;min-height:46px!important;height:46px!important;
  border-radius:10px!important;overflow:hidden!important;
  background:#006b6a!important
}
body.chess-console .layout:not(.game-focus) .side-dock .mode-choice{
  box-sizing:border-box!important;min-height:46px!important;
  height:46px!important;font:750 15px system-ui,sans-serif!important;
  background:#006b6a!important;color:#fff6df!important
}
body.chess-console .layout:not(.game-focus) .side-dock .mode-choice.active{
  background:#f5e8c5!important;color:#00494b!important
}
body.chess-console .layout:not(.game-focus) .side-dock .console-settings-slot,
body.chess-console .layout:not(.game-focus) .side-dock #training-records,
body.chess-console .layout:not(.game-focus) .side-dock .chess-owner-advanced,
body.chess-console .layout:not(.game-focus) .side-dock>.chess-minimal-more,
body.chess-console .layout:not(.game-focus) .side-dock>.game-tools{
  display:none!important
}
/* Online still exposes the pre-existing accepted-game and invitation controls. */
body.chess-console .layout:not(.game-focus):has(#online-mode.active) .side-dock .console-settings-slot,
body.chess-console .layout:not(.game-focus) .side-dock>.sidebar:has(#online-mode.active) .console-settings-slot{
  display:block!important;min-height:0!important;max-height:180px!important;
  overflow-y:auto!important;margin:6px 0 0!important;padding:4px 0!important
}
body.chess-console .layout:not(.game-focus) .side-dock #online-settings:not([hidden]){
  display:block!important;max-height:170px!important;overflow-y:auto!important
}
body.chess-console .layout:not(.game-focus) .side-dock>.chess-owner-claim-draw:not([hidden]){
  display:block!important;order:2!important;flex:0 0 auto!important;
  width:100%!important;min-height:36px!important;padding:7px!important;
  border:0!important;border-radius:8px!important;
  background:#006b6a!important;color:#f5e8c5!important;
  font:700 13px system-ui,sans-serif!important;cursor:pointer
}
body.chess-console .layout:not(.game-focus) .side-dock>#game-state:not(:has(.chess-promote)){
  display:none!important
}
body.chess-console .layout:not(.game-focus) .side-dock>#game-state:has(.chess-promote){
  position:static!important;order:2!important;display:flex!important;
  width:100%!important;min-height:52px!important;height:auto!important;
  flex-wrap:wrap!important;clip-path:none!important;overflow:visible!important;
  color:#06464b!important;background:#f5e8c5!important
}
body.chess-console .layout:not(.game-focus) .side-dock>.players{
  box-sizing:border-box!important;order:1!important;display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  grid-template-rows:1fr!important;flex:0 0 auto!important;
  width:100%!important;height:65px!important;min-height:65px!important;
  margin:0!important;padding:7px 0!important;gap:9px!important;
  background:#006b6a!important;border-radius:10px!important
}
body.chess-console .layout:not(.game-focus) .side-dock>.players>.player{
  box-sizing:border-box!important;display:flex!important;align-items:center!important;
  justify-content:space-between!important;
  min-width:0!important;width:100%!important;height:50px!important;
  min-height:50px!important;max-height:50px!important;
  padding:4px 9px!important;gap:5px!important;
  background:#f5e8c5!important;color:#063e40!important;
  border:0!important;border-radius:8px!important;box-shadow:none!important
}
body.chess-console .layout:not(.game-focus) .side-dock>.players>.player.first{
  background:#004b4d!important;color:#fff4d4!important
}
body.chess-console .layout:not(.game-focus) .side-dock>.players>.player strong{
  color:inherit!important;font:650 clamp(10px,.95vw,13px) system-ui,sans-serif!important
}
body.chess-console .layout:not(.game-focus) .side-dock>.players>.player .player-clock:not([hidden]){
  flex:0 0 auto!important;display:inline-flex!important;
  width:94px!important;min-width:94px!important;max-width:94px!important;
  flex:0 0 94px!important;justify-content:flex-end!important;
  padding:0!important;margin:0!important;height:auto!important;
  color:inherit!important;background:transparent!important;
  font:800 clamp(18px,2vw,29px)/1 system-ui,sans-serif!important;
  font-variant-numeric:tabular-nums!important
}
body.chess-console .layout:not(.game-focus) .side-dock>.chess-reference-actions{
  box-sizing:border-box!important;order:2!important;
  display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;
  width:100%!important;gap:6px!important;
  margin:0!important;padding:0!important;
  background:transparent!important
}
body.chess-console .layout:not(.game-focus) .side-dock>.chess-reference-actions button{
  box-sizing:border-box!important;display:block;
  min-width:0!important;min-height:43px!important;height:43px!important;
  padding:5px 4px!important;margin:0!important;
  border:0!important;border-radius:11px!important;box-shadow:none!important;
  background:#d5ebe3!important;color:#064b4d!important;
  font:750 clamp(10px,1vw,14px)/1.2 system-ui,sans-serif!important;
  white-space:normal!important;cursor:pointer
}
body.chess-console .layout:not(.game-focus) .side-dock>.chess-reference-actions button[hidden]{
  display:none!important
}
/* Online uses its own invitation-based New game, never show duplicate reset. */
body.chess-console .layout:not(.game-focus):has(#online-mode.active) .side-dock>.chess-reference-actions #restart{
  display:none!important
}
body.chess-console .layout:not(.game-focus) .side-dock>.chess-reference-actions button:disabled{
  opacity:.55!important;cursor:not-allowed!important
}
body.chess-console .layout:not(.game-focus) .side-dock>#match-panel{
  box-sizing:border-box!important;order:3!important;display:flex!important;
  flex:1 1 270px!important;width:100%!important;
  min-height:225px!important;height:auto!important;max-height:none!important;
  margin:0!important;padding:0!important;
  border:0!important;border-radius:11px!important;
  background:#faf2df!important;overflow:hidden!important
}
body.chess-console .layout:not(.game-focus) .side-dock #match-panel .dock-tabs{
  background:#006b6a!important;border-radius:10px!important;overflow:hidden!important
}
body.chess-console .layout:not(.game-focus) .side-dock #match-panel .dock-tab{
  color:#f5f2e5!important;background:#006b6a!important;
  font:750 15px system-ui,sans-serif!important
}
body.chess-console .layout:not(.game-focus) .side-dock #match-panel .dock-tab.active{
  color:#06484b!important;background:#f5e8c5!important
}
body.chess-console .layout:not(.game-focus) .side-dock #match-panel .dock-content{
  box-sizing:border-box!important;border-radius:11px!important;
  background:#fbf5e9!important;min-height:0!important
}
body.chess-console .layout:not(.game-focus) .side-dock :is(#chat-messages,#moves-list){
  background:#fbf5e9!important;color:#163f42!important;
}
body.chess-console .layout:not(.game-focus) .side-dock #chat-input{
  border-radius:7px!important;background:#fff!important;color:#173f41!important
}
body.chess-console .layout:not(.game-focus) .side-dock #chat-send{
  border-radius:7px!important;background:#006b6a!important
}
/* Online settings were pale gold/white on mint: keep all field labels legible. */
body.chess-console .layout:not(.game-focus) .side-dock #online-settings{
  color:#074749!important
}
body.chess-console .layout:not(.game-focus) .side-dock #online-settings :is(h2,h3,p,small,label,legend,span,strong,summary){
  color:#074749!important;text-shadow:none!important
}
/* Empty chat text must be readable against the warm-cream chat surface. */
body.chess-console .layout:not(.game-focus) .side-dock #match-panel .dock-empty{
  color:#557377!important
}
@media(min-width:801px){
  /* The mobile heading must not appear unstyled under the desktop board. */
  body.chess-console .layout:not(.game-focus) .chess-mobile-heading{display:none!important}

  body.chess-console .layout:not(.game-focus)>.boardarea{
    grid-template-columns:minmax(0,1fr) clamp(345px,31vw,510px)!important;
    gap:12px!important;padding:8px 12px!important
  }
  body.chess-console .layout:not(.game-focus) .side-dock{
    height:100%!important;max-height:100%!important;
    overflow-x:hidden!important;overflow-y:auto!important
  }
}
@media(max-width:800px){
  body.chess-console .layout:not(.game-focus) .chess-board .chess-coordinate{
    font-size:clamp(10px,3vw,14px)!important
  }
  body.chess-console .layout:not(.game-focus)>.boardarea>.chess-mobile-mode{
    background:#006b6a!important
  }
  body.chess-console .layout:not(.game-focus)>.boardarea>.players{
    order:2!important;display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:7px!important;padding:5px 7px!important;
    border-radius:0!important
  }
  body.chess-console .layout:not(.game-focus)>.boardarea>.players>.player{
    height:40px!important;min-height:40px!important;max-height:40px!important;
    padding:4px 6px!important;
  }
  body.chess-console .layout:not(.game-focus)>.boardarea>.players>.player .player-clock:not([hidden]){
    width:70px!important;min-width:70px!important;max-width:70px!important;
    flex:0 0 70px!important;justify-content:flex-end!important;
    font-size:clamp(16px,4.7vw,21px)!important
  }
  body.chess-console .layout:not(.game-focus)>.boardarea>.side-dock{
    width:100%!important;height:auto!important;min-height:260px!important;
    max-height:none!important;padding:8px!important;
    border-radius:0!important;overflow:visible!important
  }
  body.chess-console .layout:not(.game-focus)>.boardarea>.side-dock>.sidebar .mode{
    display:none!important
  }
  body.chess-console .layout:not(.game-focus)>.boardarea>.side-dock>.chess-reference-actions button{
    min-height:42px!important;height:42px!important;
    font-size:clamp(10px,3.2vw,13px)!important
  }
  body.chess-console .layout:not(.game-focus)>.boardarea>.side-dock>#match-panel{
    flex:0 0 290px!important;min-height:290px!important;height:290px!important
  }
}

/* Final owner-approved chess console: real board, no illustration or second controls. */
body.chess-console .layout:not(.game-focus) .side-dock{gap:9px!important}
body.chess-console .layout:not(.game-focus) .side-dock>.players{
  order:0!important;flex:0 0 54px!important;min-height:54px!important;
  height:54px!important;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:12px!important;padding:0!important;margin:0!important;
  background:transparent!important;border:0!important;border-radius:0!important
}
body.chess-console .layout:not(.game-focus) .side-dock>.players>.player,
body.chess-console .layout:not(.game-focus) .side-dock>.players>.player.first{
  background:transparent!important;color:#073d40!important;border:0!important;
  border-radius:0!important;height:54px!important;min-height:54px!important;
  padding:3px!important;box-shadow:none!important
}
body.chess-console .layout:not(.game-focus) .side-dock>.players>.player .player-clock:not([hidden]){
  font-size:clamp(20px,2vw,29px)!important;color:#063c3f!important
}
body.chess-console .layout:not(.game-focus) .side-dock>.sidebar{order:1!important}
body.chess-console .layout:not(.game-focus) .side-dock>.chess-reference-actions{order:2!important}
body.chess-console .layout:not(.game-focus) .side-dock>#match-panel{
  order:3!important;min-height:245px!important;overflow:visible!important
}
body.chess-console .layout:not(.game-focus):has(#online-mode.active) .side-dock .console-settings-slot,
body.chess-console .layout:not(.game-focus) .side-dock>.sidebar:has(#online-mode.active) .console-settings-slot{
  display:block!important;height:auto!important;min-height:0!important;max-height:none!important;
  overflow:visible!important;margin:9px 0 0!important;padding:0!important
}
body.chess-console .layout:not(.game-focus) .side-dock #online-settings:not([hidden]){
  display:block!important;width:100%!important;height:auto!important;
  min-height:0!important;max-height:none!important;overflow:visible!important;
  margin:0!important;padding:0!important;background:transparent!important;
  border:0!important;box-shadow:none!important
}
body.chess-console .layout:not(.game-focus) .side-dock .chess-final-grid{
  display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
  gap:10px!important;width:100%!important;align-items:stretch!important
}
body.chess-console .layout:not(.game-focus) .side-dock .chess-final-room-card,
body.chess-console .layout:not(.game-focus) .side-dock .chess-final-create-card{
  box-sizing:border-box!important;min-width:0!important;margin:0!important;
  padding:9px!important;border-radius:12px!important;border:1px solid #dce5d8!important;
  background:#fdf7e9!important;color:#073f41!important;box-shadow:none!important
}
body.chess-console .layout:not(.game-focus) .side-dock .chess-final-card-title{
  display:flex;align-items:center;justify-content:space-between;gap:6px;
  margin:-9px -9px 8px!important;padding:9px!important;
  background:#dcefe6!important;border-radius:11px 11px 0 0!important
}
body.chess-console .layout:not(.game-focus) .side-dock .chess-final-card-title h2,
body.chess-console .layout:not(.game-focus) .side-dock .chess-final-card-title h3{
  font:800 clamp(13px,1.15vw,18px)/1.2 system-ui,sans-serif!important;
  margin:0!important;color:#074749!important
}
body.chess-console .layout:not(.game-focus) .side-dock .chess-final-refresh{
  background:transparent!important;color:#075f61!important;
  border:0!important;padding:2px 5px!important;min-height:28px!important;
  font:800 17px system-ui,sans-serif!important;cursor:pointer
}
body.chess-console .layout:not(.game-focus) .side-dock #account-note{
  margin:0 0 6px!important;font:500 11px/1.35 system-ui,sans-serif!important
}
body.chess-console .layout:not(.game-focus) .side-dock .chess-final-room-list{
  display:flex!important;flex-direction:column!important;gap:0!important;
  width:100%!important;min-height:55px!important
}
body.chess-console .layout:not(.game-focus) .side-dock .chess-final-room-row{
  display:flex!important;align-items:center;justify-content:space-between;gap:6px;
  min-height:39px!important;padding:4px 1px!important;
  border-bottom:1px solid #dbe7e1!important;font:600 12px/1.3 system-ui,sans-serif!important
}
body.chess-console .layout:not(.game-focus) .side-dock .chess-final-room-name{
  min-width:0;overflow-wrap:anywhere;color:#08484a!important
}
body.chess-console .layout:not(.game-focus) .side-dock .chess-final-room-row button,
body.chess-console .layout:not(.game-focus) .side-dock .room-creator #create-room{
  flex:0 0 auto!important;min-height:31px!important;padding:5px 10px!important;
  border-radius:8px!important;border:0!important;box-shadow:none!important;
  background:#006b6a!important;color:#fff!important;cursor:pointer;
  font:700 12px system-ui,sans-serif!important
}
body.chess-console .layout:not(.game-focus) .side-dock .chess-final-no-rooms{
  margin:5px 0!important;color:#426467!important;
  font:500 12px/1.45 system-ui,sans-serif!important
}
body.chess-console .layout:not(.game-focus) .side-dock .chess-final-native{
  display:none!important
}
body.chess-console .layout:not(.game-focus) .side-dock .chess-final-room-card>.textlink{
  display:block!important;margin-top:7px!important;font:600 11px/1.3 system-ui,sans-serif!important;
  color:#075f61!important
}
body.chess-console .layout:not(.game-focus) .side-dock .chess-final-create-card .room-creator{
  display:flex!important;flex-direction:column!important;gap:5px!important;
  margin:0!important;padding:0!important;border:0!important;
  background:transparent!important;overflow:visible!important
}
body.chess-console .layout:not(.game-focus) .side-dock .chess-final-create-card .room-creator>h3{display:none!important}
body.chess-console .layout:not(.game-focus) .side-dock .chess-final-create-card .room-creator label{
  margin:0!important;color:#074749!important;font:700 11px/1.2 system-ui,sans-serif!important
}
body.chess-console .layout:not(.game-focus) .side-dock #create-room-friend,
body.chess-console .layout:not(.game-focus) .side-dock #create-room-increment{
  box-sizing:border-box!important;display:block!important;width:100%!important;
  min-width:0!important;height:34px!important;min-height:34px!important;
  margin:0!important;padding:4px 8px!important;
  border:1px solid #ccdcd6!important;border-radius:8px!important;
  background:#fff!important;color:#104549!important;
  font:500 12px system-ui,sans-serif!important
}
body.chess-console .layout:not(.game-focus) .side-dock #create-room-time{
  position:absolute!important;width:1px!important;height:1px!important;
  overflow:hidden!important;clip-path:inset(50%)!important
}
body.chess-console .layout:not(.game-focus) .side-dock .chess-final-times{
  display:flex!important;flex-wrap:wrap!important;gap:3px!important;margin:0!important
}
body.chess-console .layout:not(.game-focus) .side-dock .chess-final-times button{
  flex:1 1 42px!important;min-width:0!important;min-height:30px!important;
  padding:4px!important;border-radius:7px!important;border:1px solid #d5ddd7!important;
  background:#fff9ed!important;color:#155054!important;
  font:700 11px system-ui,sans-serif!important;cursor:pointer
}
body.chess-console .layout:not(.game-focus) .side-dock .chess-final-times button[aria-pressed="true"]{
  background:#006b6a!important;color:#fff!important;border-color:#006b6a!important
}
body.chess-console .layout:not(.game-focus) .side-dock .room-creator .panel-help{
  margin:0!important;font:500 11px system-ui,sans-serif!important
}
body.chess-console .layout:not(.game-focus) .side-dock .room-creator #create-room{
  width:100%!important;min-height:35px!important;margin-top:3px!important
}
body.chess-console .layout:not(.game-focus) .side-dock .chess-reference-actions button{
  background:#006b6a!important;color:#fff!important;min-height:41px!important;
  font:750 clamp(11px,1vw,15px)/1.2 system-ui,sans-serif!important
}
body.chess-console .layout:not(.game-focus) .side-dock #match-panel .dock-tabs{
  display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important
}
body.chess-console .layout:not(.game-focus) .side-dock #match-panel .chess-final-info{
  box-sizing:border-box!important;flex:1 1 0!important;min-height:0!important;
  padding:12px!important;overflow-y:auto!important;
  background:#fbf5e9!important;color:#15464b!important;
  font:500 13px/1.5 system-ui,sans-serif!important
}
body.chess-console .layout:not(.game-focus) .side-dock #match-panel .chess-final-info[hidden]{
  display:none!important
}
body.chess-console .layout:not(.game-focus) .side-dock #match-panel .chess-final-info a{color:#006b6a!important}
body.chess-console .layout:not(.game-focus) .side-dock #match-panel:not(.moves-only) .mini-chat{
  display:block!important;flex:0 0 auto!important
}
@media(min-width:801px){
  body.chess-console .layout:not(.game-focus)>.boardarea{
    grid-template-columns:minmax(0,1fr) minmax(410px,46%)!important;
    padding:8px 13px!important;gap:10px!important
  }
  body.chess-console .layout:not(.game-focus) .side-dock{
    margin:0!important;height:100%!important;max-height:100%!important;
    overflow-y:auto!important;overflow-x:hidden!important;scrollbar-width:thin!important
  }
}
@media(max-width:800px){
  body.chess-console .layout:not(.game-focus)>.boardarea>.players{order:1!important}
  body.chess-console .layout:not(.game-focus)>.boardarea>.chess-mobile-mode{order:2!important}
  body.chess-console .layout:not(.game-focus)>.boardarea>.arena{order:3!important}
  body.chess-console .layout:not(.game-focus)>.boardarea>.side-dock{order:4!important}
  body.chess-console .layout:not(.game-focus) .side-dock #online-settings:not([hidden]){
    max-height:none!important;overflow:visible!important
  }
  body.chess-console .layout:not(.game-focus) .side-dock .chess-final-grid{
    grid-template-columns:1fr!important
  }
  body.chess-console .layout:not(.game-focus)>.boardarea>.side-dock #match-panel{
    flex:0 0 300px!important;min-height:300px!important;height:300px!important
  }
}

/* MOBILE-TOPBAR-MAIL-01: approved header, compact modes and real unread badge. */
@media(max-width:800px){
 /* Keep requested mode selector above both clocks, despite new online-panel base CSS. */
 body.chess-console .layout:not(.game-focus)>.boardarea>.chess-mobile-mode{order:1!important}
 body.chess-console .layout:not(.game-focus)>.boardarea>.players{order:2!important}

 body.chess-console .layout:not(.game-focus)>.boardarea>.chess-mobile-heading.chess-mobile-topbar{
  box-sizing:border-box!important;display:flex!important;align-items:center!important;
  justify-content:space-between!important;position:relative!important;z-index:50!important;
  width:100%!important;height:60px!important;min-height:60px!important;
  padding:5px 9px!important;gap:5px!important;margin:0!important;
  background:#00595d!important;color:#fff!important;border:0!important;
  border-radius:0!important;box-shadow:none!important;overflow:visible!important
 }
 body.chess-console .chess-mobile-topbar .chess-mobile-brand-line{
  display:flex;flex:1 1 auto;align-items:center;gap:6px;min-width:0!important;
  white-space:nowrap!important;overflow:hidden!important
 }
 body.chess-console .chess-mobile-topbar .chess-mobile-brand-icon{
  color:#fff;flex:0 0 auto;line-height:1;font:normal clamp(20px,6.5vw,30px)/1 Georgia,serif
 }
 body.chess-console .chess-mobile-topbar .chess-mobile-brand-icon svg{
  display:block!important;width:26px!important;height:26px!important;fill:currentColor!important
 }
 body.chess-console .chess-mobile-topbar .chess-mobile-brand-link{
  flex:0 1 auto!important;min-width:0!important;color:#fff!important;text-decoration:none!important;
  letter-spacing:0!important;white-space:nowrap!important;
  font:800 clamp(13px,3.8vw,19px)/1.1 system-ui,sans-serif!important
 }
 body.chess-console .chess-mobile-topbar .chess-mobile-brand-divider{
  display:block;flex:0 0 1px;height:27px;margin:0 3px;background:#bde4e0
 }
 body.chess-console .chess-mobile-topbar .chess-mobile-game-name{
  flex:0 0 auto;white-space:nowrap!important;color:#fff!important;
  font:700 clamp(13px,3.8vw,18px)/1.1 system-ui,sans-serif!important
 }
 body.chess-console .chess-mobile-topbar .chess-mobile-header-actions{
  display:flex;flex:0 0 auto;align-items:center;gap:1px;margin:0;min-width:0
 }
 body.chess-console .chess-mobile-topbar .chess-mobile-header-action,
 body.chess-console .chess-mobile-topbar .chess-mobile-menu-toggle{
  box-sizing:border-box!important;display:flex!important;position:relative!important;
  align-items:center!important;justify-content:center!important;
  flex:0 0 33px!important;width:33px!important;height:39px!important;min-height:39px!important;
  margin:0!important;padding:3px!important;border:0!important;border-radius:0!important;
  box-shadow:none!important;background:transparent!important;color:#fff!important;
  cursor:pointer!important;text-decoration:none!important
 }
 body.chess-console .chess-mobile-topbar .chess-mobile-header-action svg,
 body.chess-console .chess-mobile-topbar .chess-mobile-menu-toggle svg{
  display:block!important;width:24px!important;height:24px!important;flex:none!important
 }
 body.chess-console .chess-mobile-topbar .chess-mobile-mail-badge:not([hidden]){
  box-sizing:border-box!important;display:flex!important;position:absolute!important;z-index:2!important;
  align-items:center!important;justify-content:center!important;
  top:-1px!important;right:-3px!important;min-width:17px!important;height:17px!important;
  border-radius:12px!important;padding:0 3px!important;border:1px solid #fff!important;
  background:#e12734!important;color:#fff!important;
  font:750 10px/1 system-ui,sans-serif!important;letter-spacing:0!important;
  pointer-events:none!important;box-shadow:none!important
 }
 body.chess-console .chess-mobile-topbar .chess-mobile-mail-badge[hidden]{display:none!important}
 body.chess-console .chess-mobile-topbar .chess-mobile-menu{position:static!important;flex:0 0 33px}
 body.chess-console .chess-mobile-topbar .chess-mobile-menu-toggle{list-style:none!important}
 body.chess-console .chess-mobile-topbar .chess-mobile-menu-toggle::-webkit-details-marker{display:none!important}
 body.chess-console .chess-mobile-topbar .chess-mobile-menu-panel{
  position:absolute!important;top:100%!important;right:5px!important;z-index:110!important;
  display:grid!important;gap:0!important;min-width:190px!important;max-width:calc(100vw - 12px)!important;
  padding:4px!important;border:1px solid #337e7c!important;border-radius:0!important;
  background:#06454b!important;box-shadow:0 4px 12px #002c3033!important
 }
 body.chess-console .chess-mobile-topbar .chess-mobile-menu:not([open]) .chess-mobile-menu-panel{
  display:none!important
 }
 body.chess-console .chess-mobile-topbar .chess-mobile-menu-panel a{
  display:block!important;min-height:37px!important;padding:10px 12px!important;
  color:#fff!important;text-decoration:none!important;background:transparent!important;
  font:600 13px/1.3 system-ui,sans-serif!important
 }
 body.chess-console .chess-mobile-topbar .chess-mobile-menu-panel a:focus-visible,
 body.chess-console .chess-mobile-topbar .chess-mobile-header-action:focus-visible,
 body.chess-console .chess-mobile-topbar .chess-mobile-menu-toggle:focus-visible{
  outline:2px solid #fff4ca!important;outline-offset:-2px!important
 }
 body.chess-console .chess-mobile-topbar .chess-mobile-menu-panel a:hover{background:#17636a!important}
 body.chess-console .layout:not(.game-focus)>.boardarea>.chess-mobile-mode .mode-choice{
  display:flex!important;justify-content:center!important;align-items:center!important;
  flex-direction:row!important;gap:5px!important;
  font-size:clamp(13px,4vw,17px)!important
 }
 body.chess-console .layout:not(.game-focus)>.boardarea>.chess-mobile-mode .chess-mobile-mode-symbol{
  display:flex!important;flex:0 0 22px!important;align-items:center!important;justify-content:center!important
 }
 body.chess-console .layout:not(.game-focus)>.boardarea>.chess-mobile-mode .chess-mobile-mode-symbol svg{
  display:block!important;width:21px!important;height:21px!important;fill:none!important
 }
}
body.chess-console .layout.game-focus .chess-mobile-topbar{display:none!important}
@media(min-width:801px){
 body.chess-console .chess-mobile-mode-symbol{display:none!important}
}

/* Dark notation on the pale history background, on mobile and desktop. */
body.chess-console .layout:not(.game-focus) #moves-panel .chess-move-row{
 color:#173f42!important;background:transparent!important;
 border-bottom:1px solid #c7d9d3!important;
 font:600 14px/1.5 system-ui,sans-serif!important;
 padding:7px 9px!important;overflow-wrap:anywhere
}
body.chess-console .layout:not(.game-focus) #moves-panel:not([hidden]){
 display:flex!important;flex-direction:column!important;min-height:0!important
}
body.chess-console .layout:not(.game-focus) #moves-panel[hidden]{display:none!important}

/* Numbered move-table with read-only, clickable SAN position replay. */
body.chess-console #moves-panel .chess-history-turn{
 display:grid!important;grid-template-columns:36px minmax(0,1fr) minmax(0,1fr)!important;
 align-items:stretch!important;width:100%!important;gap:0!important;
 min-height:34px!important;border-bottom:1px solid #d4e0dc!important
}
body.chess-console #moves-panel .chess-history-turn:nth-child(even){background:#e8f3f0!important}
body.chess-console #moves-panel .chess-history-number{
 display:flex!important;align-items:center!important;justify-content:center!important;
 font:600 12px system-ui,sans-serif!important;color:#4b6c6c!important
}
body.chess-console #moves-panel .chess-history-blank{display:block;min-width:0}
body.chess-console #moves-panel .chess-move-row{
 display:flex!important;align-items:center!important;justify-content:flex-start!important;
 box-sizing:border-box!important;min-width:0!important;width:100%!important;
 min-height:34px!important;padding:5px 9px!important;margin:0!important;
 background:transparent!important;border:0!important;border-radius:0!important;
 color:#173e42!important;font:650 13px/1.4 system-ui,sans-serif!important;
 cursor:pointer!important;text-align:left!important;box-shadow:none!important
}
body.chess-console #moves-panel .chess-move-row:hover:not(:disabled){background:#d0e6e1!important}
body.chess-console #moves-panel .chess-move-row.chess-history-selected{
 background:#f3e5bd!important;color:#073f45!important;font-weight:800!important
}
body.chess-console #moves-panel .chess-move-row:disabled{opacity:.5!important;cursor:default!important}
body.chess-console #moves-panel :is(.chess-move-row,.chess-history-action):focus-visible{
 outline:2px solid #087e83!important;outline-offset:-2px!important
}
body.chess-console .layout:not(.game-focus) #moves-panel:not([hidden]){
 display:flex!important;flex-direction:column!important;min-height:0!important
}
body.chess-console .layout:not(.game-focus) #moves-panel #moves-list{
 flex:1 1 0!important;min-height:0!important;height:auto!important;
 max-height:none!important;overflow-y:auto!important;padding:3px 0!important
}
body.chess-console #moves-panel .chess-history-nav{
 box-sizing:border-box!important;display:grid!important;
 grid-template-columns:repeat(4,34px) minmax(0,1fr) 44px 43px!important;
 align-items:center!important;justify-content:stretch!important;
 gap:3px!important;width:100%!important;min-height:43px!important;
 margin:0!important;padding:4px!important;border-top:1px solid #c2d9d4!important;
 background:#d8eeea!important;flex:0 0 auto!important
}
body.chess-console #moves-panel .chess-history-action{
 display:flex!important;align-items:center!important;justify-content:center!important;
 box-sizing:border-box!important;min-height:33px!important;
 padding:3px!important;border:0!important;border-radius:0!important;
 background:#bfded9!important;color:#125359!important;
 box-shadow:none!important;font:700 16px/1 system-ui,sans-serif!important;cursor:pointer!important
}
body.chess-console #moves-panel .chess-history-action.chess-history-live{
 background:#08767a!important;color:#fff!important;font:700 11px/1 system-ui,sans-serif!important
}
body.chess-console #moves-panel .chess-history-action:disabled{opacity:.38!important;cursor:default!important}
body.chess-console #moves-panel .chess-history-nav-status{
 display:block!important;min-width:0!important;padding:0 3px!important;
 color:#215b60!important;text-align:center!important;overflow:hidden!important;
 white-space:nowrap!important;text-overflow:ellipsis!important;
 font:600 10px/1.2 system-ui,sans-serif!important
}
@media(max-width:360px){
 body.chess-console #moves-panel .chess-history-nav{
  grid-template-columns:repeat(4,30px) minmax(0,1fr) 40px 35px!important;gap:2px!important
 }
 body.chess-console #moves-panel .chess-history-action{font-size:13px!important}
}

/* Visible immediately when a saved/active game contains chess moves. */
body.chess-console #moves-panel .chess-history-columns{
 box-sizing:border-box!important;display:grid!important;
 grid-template-columns:36px minmax(0,1fr) minmax(0,1fr)!important;
 width:100%!important;min-height:29px!important;flex:0 0 29px!important;
 align-items:center!important;margin:0!important;padding:0!important;
 color:#f8ffff!important;background:#176b70!important;
 font:700 12px/1.2 system-ui,sans-serif!important
}
body.chess-console #moves-panel .chess-history-columns span{
 display:block!important;min-width:0!important;text-align:left!important;padding:5px 9px!important
}
body.chess-console #moves-panel .chess-history-columns span:first-child{
 text-align:center!important;padding:5px 0!important
}
body.chess-console #moves-panel[hidden] .chess-history-columns{display:none!important}

/* ===== CHESS-CONSOLE-OWNER-P1 (#814) ===== */
body.chess-console.cc-owner #game .side-dock{
  --cc-bg:#faf3e1;--cc-surface:#fffdf7;--cc-soft:#f1e7cf;--cc-line:#e0d4b8;
  --cc-ink:#0a3a3d;--cc-muted:#526e6c;--cc-accent:#006b6a;--cc-accent-hover:#005857;
  --cc-on-accent:#ffffff;--cc-focus:#c8891a;--cc-badge:#d92633;--cc-shadow:#00191b33;color-scheme:light
}
body.chess-console.cc-owner[data-cc-theme="dark"] #game .side-dock{
  --cc-bg:#0f2a2d;--cc-surface:#163538;--cc-soft:#1d4145;--cc-line:#2c5155;
  --cc-ink:#e8f2ef;--cc-muted:#a5c1bd;--cc-accent:#1c7a75;--cc-accent-hover:#22908a;
  --cc-on-accent:#ffffff;--cc-focus:#f0c25a;--cc-badge:#e3404c;--cc-shadow:#0006;color-scheme:dark
}
/* Small text navigation above the board (desktop); phones keep the existing top bar menu. */
body.chess-console.cc-owner #game>.boardarea>.cc-site-nav{display:none}
body.chess-console.cc-owner #game.game-focus .cc-site-nav{display:none!important}
@media (min-width:801px){
  body.chess-console.cc-owner #game:not(.game-focus){
    --cc-panel:clamp(372px,29vw,440px);
    --cc-board:max(240px,min(calc(100vh - 56px),calc(100vw - var(--cc-panel) - 56px)))
  }
  body.chess-console.cc-owner #game:not(.game-focus)>.boardarea{
    display:grid!important;box-sizing:border-box!important;
    grid-template-columns:minmax(0,var(--cc-board)) var(--cc-panel)!important;
    grid-template-rows:28px minmax(0,1fr)!important;
    justify-content:center!important;align-content:stretch!important;
    column-gap:22px!important;row-gap:8px!important;
    width:100%!important;height:100%!important;padding:6px 17px 14px!important
  }
  body.chess-console.cc-owner #game.console-hide-dock:not(.game-focus)>.boardarea{
    grid-template-columns:minmax(0,min(calc(100vh - 56px),calc(100vw - 34px)))!important
  }
  body.chess-console.cc-owner #game:not(.game-focus)>.boardarea>.cc-site-nav{
    display:flex;grid-column:1;grid-row:1;align-self:center;align-items:center;
    gap:clamp(14px,2.2vw,34px);min-width:0;overflow:hidden;white-space:nowrap
  }
  body.chess-console.cc-owner #game:not(.game-focus)>.boardarea>.arena{
    grid-column:1!important;grid-row:2!important;width:100%!important;height:100%!important;
    min-width:0!important;min-height:0!important
  }
  body.chess-console.cc-owner #game:not(.game-focus) .boardframe{margin:0 auto!important}
  body.chess-console.cc-owner #game:not(.game-focus)>.boardarea>.side-dock{
    grid-column:2!important;grid-row:2!important;width:100%!important;height:100%!important;
    max-height:100%!important;min-height:0!important;margin:0!important;
    overflow-x:hidden!important;overflow-y:auto!important;align-self:stretch!important
  }
  body.chess-console.cc-owner #game:not(.game-focus) .side-dock>#match-panel{
    flex:1 1 0!important;height:auto!important;min-height:250px!important;max-height:none!important
  }
}
body.chess-console.cc-owner .cc-site-nav a{
  color:#f3ead3;text-decoration:none;font:600 15px/1.2 system-ui,-apple-system,'Segoe UI',sans-serif;
  padding:4px 0;border-bottom:2px solid transparent
}
body.chess-console.cc-owner .cc-site-nav a:hover{border-bottom-color:#e8c46b;color:#fff}
body.chess-console.cc-owner .cc-site-nav a:focus-visible{outline:2px solid #e8c46b;outline-offset:3px;border-radius:2px}
@media (max-width:800px){
  body.chess-console.cc-owner #game:not(.game-focus)>.boardarea>.chess-mobile-heading{order:0!important}
  body.chess-console.cc-owner #game:not(.game-focus)>.boardarea>.arena{order:3!important}
  body.chess-console.cc-owner #game:not(.game-focus)>.boardarea>.side-dock{
    order:4!important;align-self:stretch!important;width:auto!important;max-width:none!important;
    height:auto!important;max-height:none!important;margin:10px 8px 16px!important;overflow:visible!important
  }
  body.chess-console.cc-owner #game:not(.game-focus) .side-dock>#match-panel{
    flex:0 0 340px!important;height:340px!important;min-height:340px!important;max-height:340px!important
  }
}
/* ---- one coherent panel ---- */
body.chess-console.cc-owner #game:not(.game-focus):not(.console-hide-dock)>.boardarea>.side-dock{
  display:flex!important;flex-direction:column!important;gap:10px!important;
  box-sizing:border-box!important;padding:14px!important;position:relative!important;
  background:var(--cc-bg)!important;color:var(--cc-ink)!important;border:0!important;
  border-radius:18px!important;box-shadow:0 10px 28px var(--cc-shadow)!important;scrollbar-width:thin
}
body.chess-console.cc-owner #game:not(.game-focus) .side-dock>.cc-top{order:0}
body.chess-console.cc-owner #game:not(.game-focus) .side-dock>.sidebar{order:1!important}
body.chess-console.cc-owner #game:not(.game-focus) .side-dock>.chess-reference-actions{order:2!important}
body.chess-console.cc-owner #game:not(.game-focus) .side-dock>.chess-owner-claim-draw{order:3!important}
body.chess-console.cc-owner #game:not(.game-focus) .side-dock>#game-state{order:3!important}
body.chess-console.cc-owner #game:not(.game-focus) .side-dock>#match-panel{order:4!important}
body.chess-console.cc-owner #game:not(.game-focus) .side-dock>.cc-tools{order:5}
body.chess-console.cc-owner #game:not(.game-focus) .side-dock :focus-visible{outline:2px solid var(--cc-focus)!important;outline-offset:2px!important}
/* Top row: Czarne | Białe clocks, envelope with live badge, profile. */
body.chess-console.cc-owner #game .side-dock>.cc-top{
  display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:6px;
  flex:0 0 auto;min-height:58px
}
body.chess-console.cc-owner #game:not(.game-focus) .cc-top>.players{
  display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;grid-template-rows:auto!important;
  align-items:center!important;gap:0!important;position:static!important;order:0!important;
  width:auto!important;height:auto!important;min-height:0!important;max-height:none!important;
  margin:0!important;padding:0!important;background:transparent!important;border:0!important;
  border-radius:0!important;box-shadow:none!important;overflow:visible!important
}
body.chess-console.cc-owner #game.console-hide-players:not(.game-focus) .cc-top>.players{display:none!important}
body.chess-console.cc-owner #game:not(.game-focus) .cc-top .players>.versus,
body.chess-console.cc-owner #game:not(.game-focus) .cc-top .player>.stone,
body.chess-console.cc-owner #game:not(.game-focus) .cc-top .player>.player-icon,
body.chess-console.cc-owner #game:not(.game-focus) .cc-top .player small{display:none!important}
body.chess-console.cc-owner #game:not(.game-focus) .cc-top .players>.player{
  display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;
  gap:3px!important;min-width:0!important;width:auto!important;height:auto!important;min-height:54px!important;
  max-height:none!important;margin:0!important;padding:2px 6px!important;background:transparent!important;
  border:0!important;border-radius:0!important;box-shadow:none!important;color:var(--cc-ink)!important
}
body.chess-console.cc-owner #game:not(.game-focus) .cc-top .players>.player.second{border-left:1px solid var(--cc-line)!important}
body.chess-console.cc-owner #game:not(.game-focus) .cc-top .player>div{
  display:block!important;min-width:0!important;max-width:100%!important;width:auto!important;
  margin:0!important;padding:0!important;text-align:center!important
}
body.chess-console.cc-owner #game:not(.game-focus) .cc-top .player strong{
  display:block!important;max-width:100%!important;overflow:hidden!important;text-overflow:ellipsis!important;
  white-space:nowrap!important;color:var(--cc-ink)!important;text-shadow:none!important;
  font:600 13px/1.2 system-ui,-apple-system,'Segoe UI',sans-serif!important
}
body.chess-console.cc-owner #game:not(.game-focus) .cc-top .player>div>strong:not(#cc-none){
  position:absolute!important;display:block!important;width:1px!important;height:1px!important;margin:-1px!important;
  padding:0!important;border:0!important;overflow:hidden!important;clip:rect(0 0 0 0)!important;clip-path:inset(50%)!important;
  white-space:nowrap!important
}
body.chess-console.cc-owner #game:not(.game-focus) .cc-top .player>div{position:relative!important}
body.chess-console.cc-owner .cc-side{
  display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--cc-ink);
  font:600 14px/1.2 system-ui,-apple-system,'Segoe UI',sans-serif
}
body.chess-console.cc-owner #game.game-focus .cc-side{display:none!important}
body.chess-console.cc-owner #game:not(.game-focus) .cc-top .player-clock{
  display:block!important;position:static!important;box-sizing:border-box!important;
  width:3.3em!important;min-width:3.3em!important;max-width:100%!important;height:auto!important;min-height:0!important;
  margin:0!important;padding:0 4px 2px!important;background:transparent!important;border:0!important;
  border-radius:4px!important;box-shadow:none!important;color:var(--cc-ink)!important;text-shadow:none!important;
  font:800 clamp(23px,2vw,30px)/1.05 system-ui,-apple-system,'Segoe UI',sans-serif!important;
  font-variant-numeric:tabular-nums!important;letter-spacing:0!important;text-align:center!important
}
body.chess-console.cc-owner #game:not(.game-focus) .cc-top .player-clock.clock-running{
  color:var(--cc-accent)!important;box-shadow:inset 0 -3px 0 var(--cc-accent)!important
}
body.chess-console.cc-owner[data-cc-theme="dark"] #game:not(.game-focus) .cc-top .player-clock.clock-running{color:#7fd6cf!important}
body.chess-console.cc-owner #game:not(.game-focus) .cc-top .player-clock.clock-warning{color:#b25f00!important}
body.chess-console.cc-owner #game:not(.game-focus) .cc-top .player-clock.clock-critical{color:#c4232d!important}
body.chess-console.cc-owner .cc-account{display:flex;align-items:center;gap:2px}
body.chess-console.cc-owner #game.game-focus .cc-account{display:none!important}
body.chess-console.cc-owner .cc-icon-link{
  position:relative;display:inline-flex;align-items:center;justify-content:center;
  width:44px;height:44px;border-radius:10px;color:var(--cc-ink);text-decoration:none
}
body.chess-console.cc-owner .cc-icon-link:hover{background:var(--cc-soft)}
body.chess-console.cc-owner .cc-icon-link svg{width:30px;height:30px}
body.chess-console.cc-owner .cc-mail-badge{
  position:absolute;top:0;right:-1px;box-sizing:border-box;min-width:20px;height:20px;padding:0 5px;
  border-radius:999px;border:2px solid var(--cc-bg);background:var(--cc-badge);color:#fff;
  font:750 11px/16px system-ui,-apple-system,'Segoe UI',sans-serif;text-align:center;pointer-events:none
}
body.chess-console.cc-owner .cc-mail-badge[hidden]{display:none!important}
/* Mode switch: Komputer | Online, the active choice filled with the accent. */
body.chess-console.cc-owner #game:not(.game-focus):not(.console-hide-sidebar) .side-dock>.sidebar{
  display:block!important;flex:0 0 auto!important;position:static!important;width:auto!important;
  height:auto!important;min-height:0!important;max-height:none!important;margin:0!important;padding:0!important;
  background:transparent!important;border:0!important;box-shadow:none!important;overflow:visible!important
}
/* :not(#cc-none) lifts specificity above the older :has(#online-mode.active) rules. */
body.chess-console.cc-owner #game:not(.game-focus) .side-dock>.sidebar>:not(.mode):not(#cc-none){display:none!important}
body.chess-console.cc-owner #game:not(.game-focus):not(.console-hide-mode) .side-dock .mode{
  display:grid!important;grid-template-columns:1fr 1fr!important;gap:4px!important;
  width:auto!important;height:auto!important;min-height:0!important;margin:0!important;padding:4px!important;
  border:1px solid var(--cc-line)!important;border-radius:14px!important;background:var(--cc-soft)!important;
  box-shadow:none!important;overflow:visible!important
}
body.chess-console.cc-owner #game:not(.game-focus) .side-dock .mode-choice{
  display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:center!important;
  gap:9px!important;box-sizing:border-box!important;width:auto!important;height:48px!important;min-height:48px!important;
  margin:0!important;padding:0 10px!important;border:0!important;border-radius:10px!important;
  background:transparent!important;color:var(--cc-ink)!important;box-shadow:none!important;cursor:pointer;
  font:700 16px/1 system-ui,-apple-system,'Segoe UI',sans-serif!important
}
body.chess-console.cc-owner #game:not(.game-focus) .side-dock .mode-choice:hover:not(.active){background:var(--cc-surface)!important}
body.chess-console.cc-owner #game:not(.game-focus) .side-dock .mode-choice.active{background:var(--cc-accent)!important;color:var(--cc-on-accent)!important}
body.chess-console.cc-owner #game:not(.game-focus) .side-dock .mode-choice :is(.mode-icon,.mode-arrow,small){display:none!important}
body.chess-console.cc-owner #game:not(.game-focus) .side-dock .mode-choice>span:not([class]){display:inline!important;padding:0!important;margin:0!important}
body.chess-console.cc-owner #game:not(.game-focus) .side-dock .mode-choice strong{color:inherit!important;font:inherit!important;text-shadow:none!important}
body.chess-console.cc-owner #game:not(.game-focus) .side-dock .mode-choice .chess-mobile-mode-symbol{
  display:inline-flex!important;flex:0 0 24px!important;width:24px!important;height:24px!important;align-items:center!important;justify-content:center!important
}
body.chess-console.cc-owner #game:not(.game-focus) .side-dock .mode-choice .chess-mobile-mode-symbol svg{display:block!important;width:24px!important;height:24px!important;fill:none!important}
/* Four equal actions in the same fixed-width dock. */
body.chess-console.cc-owner #game:not(.game-focus) .side-dock>.chess-reference-actions{
  display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:0!important;
  flex:0 0 auto!important;margin:0!important;padding:0!important
}
body.chess-console.cc-owner #game:not(.game-focus) .side-dock>.chess-reference-actions>button{
  position:relative!important;display:flex!important;flex-direction:column!important;align-items:center!important;
  justify-content:center!important;gap:5px!important;box-sizing:border-box!important;width:auto!important;min-width:0!important;
  height:auto!important;min-height:62px!important;margin:0!important;padding:6px 4px!important;border:0!important;
  border-radius:10px!important;background:transparent!important;color:var(--cc-ink)!important;box-shadow:none!important;
  cursor:pointer;font:650 clamp(11px,.95vw,14px)/1.15 system-ui,-apple-system,'Segoe UI',sans-serif!important;text-shadow:none!important
}
body.chess-console.cc-owner #game:not(.game-focus) .side-dock>.chess-reference-actions>button[hidden]{display:none!important}
body.chess-console.cc-owner #game:not(.game-focus) .side-dock>.chess-reference-actions>button:not([hidden])~button:not([hidden])::before{
  content:'';position:absolute;left:0;top:14px;bottom:14px;border-left:1px solid var(--cc-line)
}
body.chess-console.cc-owner #game:not(.game-focus) .side-dock>.chess-reference-actions>button:hover:not(:disabled){background:var(--cc-soft)!important}
body.chess-console.cc-owner #game:not(.game-focus) .side-dock>.chess-reference-actions>button:disabled{opacity:.42!important;cursor:not-allowed!important}
body.chess-console.cc-owner .cc-action-icon{width:26px;height:26px;flex:none}
body.chess-console.cc-owner #game .chess-reference-actions .cc-action-label{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:inherit!important;color:inherit!important}

body.chess-console .chess-undo-overlay[hidden]{display:none!important}
body.chess-console .chess-undo-overlay{position:fixed;inset:0;z-index:10055;display:grid;place-items:center;padding:15px;background:rgba(0,17,21,.74)}
body.chess-console .chess-undo-card{box-sizing:border-box;width:min(420px,100%);border-radius:18px;border:1px solid #d4be91;background:#fbf6e6;color:#00363c;padding:26px 24px;box-shadow:0 14px 50px #001c2050;text-align:center;font-family:system-ui,-apple-system,'Segoe UI',sans-serif}
body.chess-console .chess-undo-card h2{font-size:21px;margin:0 0 12px}
body.chess-console .chess-undo-card p{font-size:15px;line-height:1.5;margin:0 0 22px}
body.chess-console .chess-undo-choices{display:grid;grid-template-columns:1fr 1fr;gap:12px}
body.chess-console .chess-undo-choices button{min-height:44px;border-radius:10px;border:1px solid #0a6267;background:#006b6f;color:white;font-weight:700;cursor:pointer}
body.chess-console .chess-undo-choices .chess-undo-reject{background:transparent;color:#00363c}
body.chess-console .chess-undo-choices button:disabled{opacity:.55;cursor:wait}
/* Tabs Czat | Ruchy | Info and the shared content area (same height for every tab). */
body.chess-console.cc-owner #game:not(.game-focus) .side-dock>#match-panel{
  display:flex!important;flex-direction:column!important;gap:8px!important;position:relative!important;
  box-sizing:border-box!important;margin:0!important;padding:0!important;overflow:hidden!important;
  background:transparent!important;border:0!important;border-radius:0!important;box-shadow:none!important
}
body.chess-console.cc-owner #game:not(.game-focus) #match-panel>.dock-header{display:none!important}
body.chess-console.cc-owner #game:not(.game-focus) #match-panel>.dock-tabs{
  display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:0!important;
  flex:0 0 auto!important;box-sizing:border-box!important;height:auto!important;min-height:48px!important;max-height:none!important;
  margin:0!important;padding:0!important;border:1px solid var(--cc-line)!important;
  border-radius:12px!important;overflow:hidden!important;background:var(--cc-surface)!important;box-shadow:none!important
}
body.chess-console.cc-owner #game:not(.game-focus) #match-panel .dock-tab{
  display:flex!important;align-items:center!important;justify-content:center!important;gap:8px!important;
  box-sizing:border-box!important;width:auto!important;min-width:0!important;height:46px!important;min-height:46px!important;
  margin:0!important;padding:0 8px!important;border:0!important;border-radius:0!important;background:transparent!important;
  color:var(--cc-ink)!important;box-shadow:none!important;cursor:pointer;text-shadow:none!important;
  font:700 16px/1 system-ui,-apple-system,'Segoe UI',sans-serif!important
}
body.chess-console.cc-owner #game:not(.game-focus) #match-panel .dock-tab+.dock-tab{border-left:1px solid var(--cc-line)!important}
body.chess-console.cc-owner #game:not(.game-focus) #match-panel .dock-tab:hover:not(.active){background:var(--cc-soft)!important}
body.chess-console.cc-owner #game:not(.game-focus) #match-panel .dock-tab.active{background:var(--cc-accent)!important;color:var(--cc-on-accent)!important}
body.chess-console.cc-owner #game:not(.game-focus) #match-panel .dock-tab :is(.dock-tab-icon,.chat-led){display:none!important}
body.chess-console.cc-owner #game:not(.game-focus) #match-panel .dock-tab .dock-tab-text{display:inline!important;color:inherit!important;font:inherit!important}
body.chess-console.cc-owner .cc-tab-icon{width:21px;height:21px;flex:none}
body.chess-console.cc-owner #game:not(.game-focus) #match-panel>.replay-shortcut{display:none!important}
body.chess-console.cc-owner #game:not(.game-focus) #match-panel>.dock-content:not([hidden]),
body.chess-console.cc-owner #game:not(.game-focus) #match-panel>#chess-final-info-panel:not([hidden]){
  flex:1 1 0!important;min-height:0!important;height:auto!important;max-height:none!important;
  margin:0!important;background:transparent!important;border:0!important;box-shadow:none!important
}
body.chess-console.cc-owner #game:not(.game-focus) #chat-panel>.dock-title,
body.chess-console.cc-owner #game:not(.game-focus) #moves-panel>.dock-title{display:none!important}
body.chess-console.cc-owner #game:not(.game-focus) #chat-panel:not([hidden]){display:flex!important;flex-direction:column!important}
body.chess-console.cc-owner #game:not(.game-focus):not(.console-hide-chat-history) #chat-messages{
  flex:1 1 0!important;min-height:0!important;max-height:none!important;overflow:auto!important;
  background:transparent!important;border:0!important;padding:4px 2px!important
}
body.chess-console.cc-owner #game:not(.game-focus) #chat-messages:has(>.dock-empty:only-child){
  display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important
}
body.chess-console.cc-owner #game:not(.game-focus) #chat-messages>.dock-empty{
  margin:0!important;padding:0 12px 18px!important;text-align:center!important;color:var(--cc-muted)!important;
  font:500 15px/1.4 system-ui,-apple-system,'Segoe UI',sans-serif!important;background:transparent!important
}
body.chess-console.cc-owner #game:not(.game-focus) #chat-messages>.dock-empty::before{
  content:'';display:block;width:46px;height:34px;margin:0 auto 14px;box-sizing:border-box;
  border:2.5px solid var(--cc-muted);border-radius:20px 20px 20px 5px;opacity:.75
}
body.chess-console.cc-owner #game:not(.game-focus):not(.console-hide-chat-input) #match-panel:not(.moves-only)>.mini-chat{
  display:block!important;flex:0 0 auto!important;margin:0!important;padding:0!important;
  background:transparent!important;border:0!important;box-shadow:none!important
}
body.chess-console.cc-owner #game:not(.game-focus) .mini-chat>.chat-preview,
body.chess-console.cc-owner #game:not(.game-focus) .mini-chat>.chat-footnote{display:none!important}
body.chess-console.cc-owner #game:not(.game-focus) .mini-chat .chat-form{margin:0!important;padding:0!important;background:transparent!important;border:0!important}
body.chess-console.cc-owner #game:not(.game-focus) .mini-chat .chat-compose{
  display:flex!important;align-items:stretch!important;gap:8px!important;margin:0!important;padding:0!important;
  background:transparent!important;border:0!important;box-shadow:none!important
}
body.chess-console.cc-owner #game:not(.game-focus) #chat-input{
  flex:1 1 auto!important;box-sizing:border-box!important;width:auto!important;min-width:0!important;height:48px!important;
  margin:0!important;padding:0 14px!important;border:1px solid var(--cc-line)!important;border-radius:12px!important;
  background:var(--cc-surface)!important;color:var(--cc-ink)!important;box-shadow:none!important;
  font:500 15px/1.2 system-ui,-apple-system,'Segoe UI',sans-serif!important
}
body.chess-console.cc-owner #game:not(.game-focus) #chat-input::placeholder{color:var(--cc-muted)!important;opacity:1}
body.chess-console.cc-owner #game:not(.game-focus) #chat-send{
  display:inline-flex!important;align-items:center!important;justify-content:center!important;
  flex:0 0 54px!important;width:54px!important;min-width:54px!important;height:48px!important;margin:0!important;padding:0!important;
  border:0!important;border-radius:12px!important;background:var(--cc-accent)!important;color:var(--cc-on-accent)!important;
  box-shadow:none!important;cursor:pointer
}
body.chess-console.cc-owner #game:not(.game-focus) #chat-send:hover:not(:disabled){background:var(--cc-accent-hover)!important}
body.chess-console.cc-owner #game:not(.game-focus) :is(#chat-send,#chat-input):disabled{opacity:.55!important;cursor:not-allowed!important}
body.chess-console.cc-owner #chat-send svg{width:24px;height:24px}
/* Info: real data about the current game and rules links only. */
body.chess-console.cc-owner #game:not(.game-focus) #chess-final-info-panel{
  overflow:auto!important;padding:6px 4px!important;color:var(--cc-ink)!important;
  font:500 14px/1.45 system-ui,-apple-system,'Segoe UI',sans-serif!important
}
body.chess-console.cc-owner .cc-info-heading{margin:0 0 8px;font:750 13px/1.2 system-ui,-apple-system,'Segoe UI',sans-serif;letter-spacing:.04em;text-transform:uppercase;color:var(--cc-muted)}
body.chess-console.cc-owner .cc-info-list{display:grid;grid-template-columns:auto minmax(0,1fr);gap:7px 14px;margin:0 0 16px}
body.chess-console.cc-owner .cc-info-list dt{color:var(--cc-muted);font-weight:600}
body.chess-console.cc-owner .cc-info-list dd{margin:0;color:var(--cc-ink);font-weight:650;overflow-wrap:anywhere}
body.chess-console.cc-owner .cc-info-links{display:grid;gap:6px;margin:0;padding:0;list-style:none}
body.chess-console.cc-owner #game #chess-final-info-panel .cc-info-links :is(a,button){
  display:inline;padding:0;margin:0;border:0;background:none;box-shadow:none;cursor:pointer;text-align:left;
  color:var(--cc-accent)!important;text-decoration:underline;text-underline-offset:2px;font:650 14px/1.4 system-ui,-apple-system,'Segoe UI',sans-serif
}
body.chess-console.cc-owner[data-cc-theme="dark"] #game #chess-final-info-panel .cc-info-links :is(a,button){color:#8fdcd5!important}
/* Five configuration icons under the conversation. */
body.chess-console.cc-owner #game.game-focus .cc-tools{display:none!important}
body.chess-console.cc-owner #game .side-dock>.cc-tools{
  display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:0;flex:0 0 auto;
  margin:0;padding:10px 0 0;border-top:1px solid var(--cc-line)
}
body.chess-console.cc-owner #game .cc-tool{
  display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:5px;min-width:0;min-height:60px;
  margin:0;padding:6px 2px;border:0;container-type:inline-size;border-radius:10px;background:transparent;color:var(--cc-ink);box-shadow:none;cursor:pointer;
  font:600 12px/1.15 system-ui,-apple-system,'Segoe UI',sans-serif;text-align:center
}
@media (min-width:1300px){body.chess-console.cc-owner #game .cc-tool{font-size:13px}}
body.chess-console.cc-owner #game .cc-tool svg{width:28px;height:28px;flex:none}
body.chess-console.cc-owner #game .cc-tool:hover{background:var(--cc-soft)}
body.chess-console.cc-owner #game .cc-tool:is([aria-expanded="true"],[aria-pressed="true"]){
  background:var(--cc-soft);color:var(--cc-accent);box-shadow:inset 0 -3px 0 var(--cc-accent)
}
body.chess-console.cc-owner[data-cc-theme="dark"] #game .cc-tool:is([aria-expanded="true"],[aria-pressed="true"]){color:#8fdcd5}
/* Label size follows the button width (cqi): with any system font (Inter, Segoe UI, DejaVu Sans)
   "Ustawienia" fits its fifth of the row; only "Pełny ekran" may wrap, top-aligned like the rest. */
body.chess-console.cc-owner #game .cc-tool .cc-tool-label{
  display:block;max-width:100%;overflow-wrap:normal;word-break:normal;hyphens:none;white-space:normal;
  font-weight:500;font-size:clamp(10px,17cqi,13px);line-height:1.15;letter-spacing:0
}
/* In-panel sheets (settings, board, pieces, theme, online games): cover only the content area. */
body.chess-console.cc-owner #game .cc-sheet{
  position:absolute;inset:0;z-index:30;display:flex;flex-direction:column;box-sizing:border-box;
  background:var(--cc-bg);color:var(--cc-ink);border:1px solid var(--cc-line);border-radius:14px;
  box-shadow:0 8px 22px #00262a24;overflow:hidden
}
body.chess-console.cc-owner #game .cc-sheet[hidden]{display:none!important}
body.chess-console.cc-owner #game .cc-sheet-head{
  display:flex;align-items:center;justify-content:space-between;gap:8px;flex:0 0 auto;
  padding:8px 8px 8px 14px;border-bottom:1px solid var(--cc-line);background:var(--cc-surface)
}
body.chess-console.cc-owner #game .cc-sheet-title{margin:0;color:var(--cc-ink);font:750 16px/1.2 system-ui,-apple-system,'Segoe UI',sans-serif;text-shadow:none}
body.chess-console.cc-owner #game .cc-sheet-close{
  display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;margin:0;padding:0;
  border:0;border-radius:10px;background:transparent;color:var(--cc-ink);box-shadow:none;cursor:pointer
}
body.chess-console.cc-owner #game .cc-sheet-close:hover{background:var(--cc-soft)}
body.chess-console.cc-owner #game .cc-sheet-close svg{width:22px;height:22px}
body.chess-console.cc-owner #game .cc-sheet-body{
  display:flex;flex-direction:column;gap:12px;flex:1 1 auto;min-height:0;overflow:auto;
  padding:12px 14px 14px;scrollbar-width:thin
}
body.chess-console.cc-owner #game .cc-sheet-body>*{flex-shrink:0!important}
body.chess-console.cc-owner #game .cc-note{margin:0;color:var(--cc-muted);font:500 13px/1.45 system-ui,-apple-system,'Segoe UI',sans-serif}
body.chess-console.cc-owner #game .cc-sheet-status:empty{display:none}
body.chess-console.cc-owner #game .cc-group{display:grid;gap:8px;margin:0;padding:0;border:0;min-width:0}
body.chess-console.cc-owner #game .cc-group[hidden]{display:none!important}
body.chess-console.cc-owner #game .cc-group>legend,body.chess-console.cc-owner #game .cc-group-title{
  margin:0 0 2px;padding:0;color:var(--cc-muted);font:750 12px/1.2 system-ui,-apple-system,'Segoe UI',sans-serif;
  letter-spacing:.05em;text-transform:uppercase
}
body.chess-console.cc-owner #game .cc-option{
  display:flex;align-items:center;gap:12px;box-sizing:border-box;min-height:52px;margin:0;padding:8px 12px;
  border:1px solid var(--cc-line);border-radius:12px;background:var(--cc-surface);color:var(--cc-ink);cursor:pointer;
  font:650 14px/1.25 system-ui,-apple-system,'Segoe UI',sans-serif
}
body.chess-console.cc-owner #game .cc-option:has(input:checked){border-color:var(--cc-accent);box-shadow:inset 0 0 0 1px var(--cc-accent)}
body.chess-console.cc-owner #game .side-dock .cc-option input{flex:none!important;width:18px!important;height:18px!important;margin:0!important;padding:0!important;appearance:auto!important;accent-color:var(--cc-accent)!important;box-shadow:none!important}
body.chess-console.cc-owner #game .cc-option-text{display:grid;gap:2px;min-width:0}
body.chess-console.cc-owner #game .cc-option-text small{color:var(--cc-muted);font:500 12px/1.3 system-ui,-apple-system,'Segoe UI',sans-serif}
body.chess-console.cc-owner #game .cc-swatch{display:grid;grid-template-columns:repeat(2,15px);grid-template-rows:repeat(2,15px);flex:none;margin-left:auto;border-radius:3px;overflow:hidden;box-shadow:0 0 0 1px #00000026}
body.chess-console.cc-owner #game .cc-swatch>i:nth-child(1),body.chess-console.cc-owner #game .cc-swatch>i:nth-child(4){background:var(--sw-l)}
body.chess-console.cc-owner #game .cc-swatch>i:nth-child(2),body.chess-console.cc-owner #game .cc-swatch>i:nth-child(3){background:var(--sw-d)}
body.chess-console.cc-owner #game .cc-swatch[data-variant="original"]{--sw-l:#e3d8bd;--sw-d:#479b99}
body.chess-console.cc-owner #game .cc-swatch[data-variant="walnut"]{--sw-l:#ecd8b6;--sw-d:#a77a52}
body.chess-console.cc-owner #game .cc-swatch[data-variant="slate"]{--sw-l:#dfe3e1;--sw-d:#6b7b80}
body.chess-console.cc-owner #game .cc-swatch[data-variant="azure"]{--sw-l:#e2eaee;--sw-d:#6a95ae}
body.chess-console.cc-owner #game .cc-swatch[data-variant="light"]{--sw-l:#faf3e1;--sw-d:#006b6a}
body.chess-console.cc-owner #game .cc-swatch[data-variant="dark"]{--sw-l:#0f2a2d;--sw-d:#1c7a75}
body.chess-console.cc-owner #game .cc-preview{display:flex;gap:2px;flex:none;margin-left:auto;padding:2px 4px;border-radius:8px;background:#e3d8bd}
body.chess-console.cc-owner #game .cc-preview .chess-piece{display:block;width:34px;height:34px}
body.chess-console.cc-owner #game .cc-row{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
body.chess-console.cc-owner #game .side-dock .cc-button{
  display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:6px!important;
  box-sizing:border-box!important;width:auto!important;min-height:40px!important;height:auto!important;margin:0!important;
  padding:8px 12px!important;border:1px solid var(--cc-line)!important;border-radius:10px!important;
  background:var(--cc-surface)!important;color:var(--cc-ink)!important;box-shadow:none!important;cursor:pointer;
  text-align:center!important;text-shadow:none!important;font:650 13px/1.2 system-ui,-apple-system,'Segoe UI',sans-serif!important
}
body.chess-console.cc-owner #game .side-dock .cc-button:hover{background:var(--cc-soft)!important}
body.chess-console.cc-owner #game .side-dock .cc-button[aria-pressed="true"]{border-color:var(--cc-accent)!important;box-shadow:inset 0 0 0 1px var(--cc-accent)!important;color:var(--cc-accent)!important}
body.chess-console.cc-owner[data-cc-theme="dark"] #game .side-dock .cc-button[aria-pressed="true"]{color:#8fdcd5!important}
body.chess-console.cc-owner #game .cc-reset{margin-top:auto;align-self:flex-start}
/* Existing computer-game settings inside the Ustawienia sheet. */
body.chess-console.cc-owner #game #cc-sheet-settings #training-settings{
  display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:none!important;grid-auto-flow:row!important;gap:12px!important;position:static!important;width:auto!important;height:auto!important;
  min-height:0!important;max-height:none!important;margin:0!important;padding:0!important;overflow:visible!important;
  background:transparent!important;border:0!important;box-shadow:none!important
}
body.chess-console.cc-owner #game #cc-sheet-settings #training-settings[hidden],
body.chess-console.cc-owner #game #cc-sheet-settings [hidden]{display:none!important}
body.chess-console.cc-owner #game #cc-sheet-settings #training-settings>:is(h2,details,.chess-claim-draw){display:none!important}
body.chess-console.cc-owner #game #cc-sheet-settings :is(.chess-owner-options,.chess-opponent-row,.chess-owner-level,.chess-time-row,.cc-bonus-row){
  display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:5px!important;position:static!important;
  width:auto!important;height:auto!important;min-height:0!important;margin:0!important;padding:0!important;
  background:transparent!important;border:0!important;box-shadow:none!important
}
body.chess-console.cc-owner #game #cc-sheet-settings .chess-owner-options{gap:12px!important}
body.chess-console.cc-owner #game #cc-sheet-settings #training-settings *{grid-column:auto!important;grid-row:auto!important;max-width:100%!important;min-width:0!important}
body.chess-console.cc-owner #game #cc-sheet-settings label{
  display:block!important;position:static!important;width:auto!important;height:auto!important;margin:0!important;
  clip:auto!important;clip-path:none!important;overflow:visible!important;color:var(--cc-ink)!important;
  text-shadow:none!important;font:700 13px/1.25 system-ui,-apple-system,'Segoe UI',sans-serif!important
}
body.chess-console.cc-owner #game #cc-sheet-settings select{
  display:block!important;position:static!important;box-sizing:border-box!important;width:100%!important;height:42px!important;
  min-height:42px!important;margin:0!important;padding:0 10px!important;clip:auto!important;clip-path:none!important;
  border:1px solid var(--cc-line)!important;border-radius:10px!important;background:var(--cc-surface)!important;
  color:var(--cc-ink)!important;box-shadow:none!important;opacity:1!important;
  font:600 14px/1.2 system-ui,-apple-system,'Segoe UI',sans-serif!important
}
/* Online games sheet: the existing accepted-game list and invitation clock settings. */
body.chess-console.cc-owner #game #cc-sheet-online #online-settings:not([hidden]){
  display:block!important;position:static!important;width:auto!important;height:auto!important;min-height:0!important;
  max-height:none!important;margin:0!important;padding:0!important;overflow:visible!important;
  background:transparent!important;border:0!important;box-shadow:none!important
}
body.chess-console.cc-owner #game #cc-sheet-online .chess-final-grid{grid-template-columns:minmax(0,1fr)!important}
body.chess-console.cc-owner #game #cc-sheet-online :is(label[for="create-room-friend"],#create-room-friend){display:none!important}
/* Panel theme: dark variant for the right panel only (board colours untouched). */
body.chess-console.cc-owner[data-cc-theme="dark"] #game #moves-panel .chess-move-row{color:var(--cc-ink)!important}
body.chess-console.cc-owner[data-cc-theme="dark"] #game #moves-panel .chess-history-turn:nth-child(even){background:#163a3d!important}
body.chess-console.cc-owner[data-cc-theme="dark"] #game #moves-panel .chess-history-turn{border-bottom-color:var(--cc-line)!important}
body.chess-console.cc-owner[data-cc-theme="dark"] #game #moves-panel .chess-history-number{color:var(--cc-muted)!important}
body.chess-console.cc-owner[data-cc-theme="dark"] #game #moves-panel .chess-move-row.chess-history-selected{background:#3d5a3a!important;color:#fff!important}
body.chess-console.cc-owner[data-cc-theme="dark"] #game #moves-panel .chess-move-row:hover:not(:disabled){background:#21494d!important}
body.chess-console.cc-owner[data-cc-theme="dark"] #game #moves-panel .chess-history-nav{background:#163538!important;border-top-color:var(--cc-line)!important}
body.chess-console.cc-owner[data-cc-theme="dark"] #game #moves-panel .chess-history-action{background:#21474b!important;color:var(--cc-ink)!important}
body.chess-console.cc-owner[data-cc-theme="dark"] #game #moves-panel .chess-history-action.chess-history-live{background:var(--cc-accent)!important;color:#fff!important}
body.chess-console.cc-owner[data-cc-theme="dark"] #game #moves-panel :is(.chess-history-nav-status,#moves-list,.history-footer){color:var(--cc-muted)!important;background:transparent!important}
body.chess-console.cc-owner[data-cc-theme="dark"] #game .side-dock #online-settings :is(h2,h3,p,small,label,legend,span,strong,summary){color:var(--cc-ink)!important}
body.chess-console.cc-owner[data-cc-theme="dark"] #game .side-dock :is(.chess-final-room-card,.chess-final-create-card){background:var(--cc-surface)!important;border-color:var(--cc-line)!important;color:var(--cc-ink)!important}
body.chess-console.cc-owner[data-cc-theme="dark"] #game .side-dock .chess-final-card-title{background:var(--cc-soft)!important}
body.chess-console.cc-owner[data-cc-theme="dark"] #game .side-dock :is(.chess-final-card-title h2,.chess-final-card-title h3,.chess-final-room-name,.chess-final-refresh){color:var(--cc-ink)!important}
body.chess-console.cc-owner[data-cc-theme="dark"] #game .side-dock .chess-final-times button{background:var(--cc-soft)!important;color:var(--cc-ink)!important;border-color:var(--cc-line)!important}
body.chess-console.cc-owner[data-cc-theme="dark"] #game .side-dock .chess-final-times button[aria-pressed="true"]{background:var(--cc-accent)!important;color:#fff!important}
body.chess-console.cc-owner[data-cc-theme="dark"] #game .side-dock :is(#create-room-increment,#chess-final-room-list a,.chess-final-room-card>.textlink){color:var(--cc-ink)!important}
body.chess-console.cc-owner[data-cc-theme="dark"] #game .side-dock #create-room-increment{background:var(--cc-surface)!important;border-color:var(--cc-line)!important}
body.chess-console.cc-owner[data-cc-theme="dark"] #game .side-dock #game-state:has(.chess-promote){background:var(--cc-soft)!important;color:var(--cc-ink)!important}
body.chess-console.cc-owner[data-cc-theme="dark"] #game .side-dock .chess-owner-claim-draw{background:var(--cc-accent)!important;color:#fff!important}
/* Board appearance (only after an explicit choice; default = the original board). */
body.chess-console[data-cc-board="walnut"]{--ccb-l:#ecd8b6;--ccb-d:#a77a52;--ccb-ls:#e4c78a;--ccb-ds:#c2965f;--ccb-lh:#e5cfa2;--ccb-dh:#b98a5e;--ccb-lc:#7a5230;--ccb-dc:#fbf0dd}
body.chess-console[data-cc-board="slate"]{--ccb-l:#dfe3e1;--ccb-d:#6b7b80;--ccb-ls:#cdd9cb;--ccb-ds:#86a19a;--ccb-lh:#d2dad6;--ccb-dh:#7d9094;--ccb-lc:#3c4f56;--ccb-dc:#f1f5f3}
body.chess-console[data-cc-board="azure"]{--ccb-l:#e2eaee;--ccb-d:#6a95ae;--ccb-ls:#cfe0d5;--ccb-ds:#86b0b9;--ccb-lh:#d4e1e7;--ccb-dh:#7ea6bc;--ccb-lc:#2f5a72;--ccb-dc:#f2f8fb}
body.chess-console[data-cc-board] #board .chess-square.light{background-color:var(--ccb-l)!important}
body.chess-console[data-cc-board] #board .chess-square.dark{background-color:var(--ccb-d)!important}
body.chess-console[data-cc-board] #board .chess-square.light.chess-selected{background-color:var(--ccb-ls)!important}
body.chess-console[data-cc-board] #board .chess-square.dark.chess-selected{background-color:var(--ccb-ds)!important}
body.chess-console[data-cc-board] #board .chess-square.light:is(.chess-target:hover,.chess-drop-hover){background-color:var(--ccb-lh)!important}
body.chess-console[data-cc-board] #board .chess-square.dark:is(.chess-target:hover,.chess-drop-hover){background-color:var(--ccb-dh)!important}
body.chess-console[data-cc-board] #board .chess-square.light .chess-coordinate{color:var(--ccb-lc)!important}
body.chess-console[data-cc-board] #board .chess-square.dark .chess-coordinate{color:var(--ccb-dc)!important}
/* Piece appearance: recolours the same original vectors (no external assets). */
body.chess-console[data-cc-pieces="flat"] .chess-piece[data-color="white"]:not(.cc-preview *)>path[data-body],
body.chess-console .cc-preview[data-variant="flat"] .chess-piece[data-color="white"]>path[data-body]{fill:#fbfaf6!important;stroke:#1d2b32!important}
body.chess-console[data-cc-pieces="flat"] .chess-piece[data-color="white"]:not(.cc-preview *)>path:nth-of-type(2),
body.chess-console .cc-preview[data-variant="flat"] .chess-piece[data-color="white"]>path:nth-of-type(2){stroke:#5f6f76!important}
body.chess-console[data-cc-pieces="flat"] .chess-piece[data-color="white"]:not(.cc-preview *)>path:nth-of-type(3),
body.chess-console .cc-preview[data-variant="flat"] .chess-piece[data-color="white"]>path:nth-of-type(3){stroke:#fbfaf6!important}
body.chess-console[data-cc-pieces="flat"] .chess-piece[data-color="black"]:not(.cc-preview *)>path[data-body],
body.chess-console .cc-preview[data-variant="flat"] .chess-piece[data-color="black"]>path[data-body]{fill:#1f2a31!important;stroke:#091217!important}
body.chess-console[data-cc-pieces="flat"] .chess-piece[data-color="black"]:not(.cc-preview *)>path:nth-of-type(2),
body.chess-console .cc-preview[data-variant="flat"] .chess-piece[data-color="black"]>path:nth-of-type(2){stroke:#8e9ea6!important}
body.chess-console[data-cc-pieces="flat"] .chess-piece[data-color="black"]:not(.cc-preview *)>path:nth-of-type(3),
body.chess-console .cc-preview[data-variant="flat"] .chess-piece[data-color="black"]>path:nth-of-type(3){stroke:#1f2a31!important}
body.chess-console[data-cc-pieces="wood"] .chess-piece[data-color="white"]:not(.cc-preview *)>path[data-body],
body.chess-console .cc-preview[data-variant="wood"] .chess-piece[data-color="white"]>path[data-body]{fill:#f1ddb7!important;stroke:#5b3c1f!important}
body.chess-console[data-cc-pieces="wood"] .chess-piece[data-color="white"]:not(.cc-preview *)>path:nth-of-type(2),
body.chess-console .cc-preview[data-variant="wood"] .chess-piece[data-color="white"]>path:nth-of-type(2){stroke:#a27a4f!important}
body.chess-console[data-cc-pieces="wood"] .chess-piece[data-color="white"]:not(.cc-preview *)>path:nth-of-type(3),
body.chess-console .cc-preview[data-variant="wood"] .chess-piece[data-color="white"]>path:nth-of-type(3){stroke:#fff6e4!important}
body.chess-console[data-cc-pieces="wood"] .chess-piece[data-color="black"]:not(.cc-preview *)>path[data-body],
body.chess-console .cc-preview[data-variant="wood"] .chess-piece[data-color="black"]>path[data-body]{fill:#5a3920!important;stroke:#21130a!important}
body.chess-console[data-cc-pieces="wood"] .chess-piece[data-color="black"]:not(.cc-preview *)>path:nth-of-type(2),
body.chess-console .cc-preview[data-variant="wood"] .chess-piece[data-color="black"]>path:nth-of-type(2){stroke:#a9845f!important}
body.chess-console[data-cc-pieces="wood"] .chess-piece[data-color="black"]:not(.cc-preview *)>path:nth-of-type(3),
body.chess-console .cc-preview[data-variant="wood"] .chess-piece[data-color="black"]>path:nth-of-type(3){stroke:#8c6545!important}
@media (max-width:800px){
  body.chess-console.cc-owner #game .cc-tool{min-height:58px}
  body.chess-console.cc-owner #game:not(.game-focus) .cc-top .player strong{font-size:12px!important}
  body.chess-console.cc-owner #game:not(.game-focus) .cc-top .players>.player{padding:2px 3px!important}
  body.chess-console.cc-owner .cc-account{gap:0}
  body.chess-console.cc-owner .cc-icon-link{width:40px}
  body.chess-console.cc-owner #game:not(.game-focus) .side-dock>.chess-reference-actions>button{font-size:14px!important}
}
@media (max-width:360px){
  body.chess-console.cc-owner #game:not(.game-focus) .cc-top .player strong{font-size:11px!important}
  body.chess-console.cc-owner #game .cc-tool{font-size:11px}
  body.chess-console.cc-owner .cc-icon-link{width:36px}
}
@media (prefers-reduced-motion:reduce){body.chess-console.cc-owner #game .cc-sheet{transition:none}}

/* CHESS-002: overlay-only status; no changes to board or approved right console geometry. */
body.chess-console .chess-feedback-pill[hidden],body.chess-console .chess-feedback-overlay[hidden]{display:none!important}
body.chess-console .chess-feedback-pill{
 position:fixed;bottom:max(12px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);
 z-index:10040;max-width:min(510px,calc(100vw - 20px));box-sizing:border-box;
 padding:9px 15px;border:1px solid #b4dbcf;border-radius:11px;
 background:#fff9e9;color:#08484a;box-shadow:0 7px 25px #001b2442;
 font:650 13px/1.45 system-ui,sans-serif;text-align:center;overflow-wrap:anywhere;
 pointer-events:none
}
body.chess-console .chess-feedback-pill[data-kind="check"]{background:#f5e8c5;border-color:#d4af5a;color:#603c00}
body.chess-console .chess-feedback-pill[data-kind="error"]{background:#fff2ea;border-color:#d67751;color:#842f19}
body.chess-console .chess-feedback-overlay{
 position:fixed;inset:0;z-index:10080;display:grid;place-items:center;
 padding:16px;box-sizing:border-box;background:#001e25b8
}
body.chess-console .chess-feedback-card{
 position:relative;box-sizing:border-box;width:min(430px,100%);max-height:90dvh;overflow:auto;
 padding:27px 23px 23px;text-align:center;background:#fff8e9;border:1px solid #dcc7a2;
 border-radius:17px;color:#0a4547;box-shadow:0 18px 56px #001b235c
}
body.chess-console .chess-feedback-close{
 position:absolute;right:9px;top:7px;width:35px;height:35px;background:transparent;
 border:0;color:#164d4e;font:400 27px/1 system-ui,sans-serif;cursor:pointer
}
body.chess-console .chess-feedback-symbol{
 width:48px;height:48px;margin:0 auto 12px;display:grid;place-items:center;
 border-radius:12px;background:#f5e6c5;color:#06605e;font:34px/1 Georgia,serif
}
body.chess-console #chess-feedback-title{font:800 22px/1.3 system-ui,sans-serif!important;color:#08484b!important;margin:0 0 9px!important}
body.chess-console #chess-feedback-description{
 font:600 15px/1.5 system-ui,sans-serif!important;margin:0 0 20px!important;color:#2b5758!important;overflow-wrap:anywhere
}
body.chess-console .chess-feedback-review{
 border:0;border-radius:9px;background:#006b6b;color:#fff8ed;min-height:43px;
 padding:9px 17px;font:700 13px/1.3 system-ui,sans-serif;cursor:pointer
}
body.chess-console .chess-feedback-overlay button:focus-visible{outline:3px solid #dba33f;outline-offset:3px}
@media(max-width:450px){
 body.chess-console .chess-feedback-pill{font-size:12px;padding:7px 11px}
 body.chess-console .chess-feedback-card{padding:24px 16px 19px}
}