/* Chess1165: a clear Play menu, compact board controls, accessible setup. */
#chessPlayChoices{display:none}.chess-setup{width:min(500px,calc(100% - 24px));max-height:calc(100dvh - 24px);padding:0;overflow:auto}.setup-content{padding:20px}.setup-content>p{font:14px/1.6 system-ui;color:#c1ceb6;margin:0 0 18px}.play-menu-choices{display:grid;gap:10px}.play-menu-choices button{text-align:left;padding:16px;min-height:76px;display:flex;flex-direction:column;gap:6px}.play-menu-choices strong{font:750 18px system-ui;color:#eef4df}.play-menu-choices small{font:13px system-ui;color:#bdcfa9}.play-menu-choices button:hover{border-color:#c5de8a;background:#425335}#pendingInviteNote{margin:16px 0 0;padding:12px;border:1px solid #8b9e62;border-radius:8px}.setup-primary{width:100%;font-size:16px;margin-top:14px}
.chess-personal{margin:0 0 20px;padding:0 0 16px;border-bottom:1px solid #647b4b}.chess-personal h3{margin:0 0 6px}.chess-personal p{font-size:13px;color:#c0cfaf;margin:0 0 12px}.chess-personal button{margin:3px 8px 3px 0;min-height:44px}#bottomStrip{min-height:36px!important}.player-strip{width:var(--chess-board);max-width:100%;margin-inline:auto}.player-name{white-space:normal;min-width:0;line-height:1.3}.chess-clock{margin-left:auto;flex:none;padding:6px 10px;border:1px solid #748268;border-radius:7px;background:#1d271e;color:#b8c9ad;font:650 17px/1.2 ui-monospace,monospace;min-width:82px;text-align:center;font-variant-numeric:tabular-nums}.chess-clock.running{background:#d6e7ba;color:#213119;border-color:#e6f3ce}.chess-clock.low{border-color:#efa68d;color:#ffc2ad;background:#5b302a}
.chess-time-picker{border:0;margin:16px 0;padding:0;min-width:0}.chess-time-picker legend,.chess-side-picker{font:650 13px/1.4 system-ui;color:#d6e5c4;margin-bottom:6px}.chess-time-picker select,.chess-side-picker select{display:block;width:100%;min-width:0;min-height:44px;padding:9px 10px;border:1px solid #809761;border-radius:8px;background:#253322;color:#eef4df;font:16px/1.3 system-ui}.time-explanation{font:13px/1.5 system-ui;color:#bfceaf;margin:8px 0 0}.club-dialog .club-choices{display:grid;grid-template-columns:minmax(160px,1.3fr) minmax(120px,1fr) auto;align-items:end;gap:10px;flex:1}.club-choices .chess-time-picker{margin:0}.club-choices .time-explanation{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.club-choices .chess-side-picker{margin:0}.chess-side-picker select{margin-top:6px}.club-choices select{min-width:0}#clubPlay{min-height:44px}.club-dialog .club-play{flex-wrap:wrap}.club-play .club-preview{flex-basis:100%}.club-preview .club-avatar{width:40px;height:40px}.club-preview strong{font-size:16px}
.chess-mobile-links{display:grid;gap:7px}.chess-mobile-links>*{text-align:left;padding:12px;min-height:46px}.studio-nav{overflow-y:auto}.studio-nav nav{flex-shrink:0}#chessMenuBtn{display:none}.waiting-count{white-space:nowrap}#ufaPlayHuman{font-size:11px!important;line-height:1.3}#boardActions:has(#undoBtn[hidden]){grid-template-columns:repeat(3,minmax(0,1fr))}#addHomeDialog ol{padding-left:22px;line-height:1.7}#addHomeDialog section{margin:14px 0}.chess-install-row #addHomeBtn{min-height:44px!important}.chess-install-row[hidden]{display:none!important}
@media(min-width:1051px) and (min-height:621px){#chessPlayBtn{display:none}#chessPlayDialog{position:fixed;margin:0;left:174px;top:110px;width:340px;max-height:calc(100dvh - 130px)}#chessPlayDialog::backdrop{background:#07120b80}}
@media(max-width:1050px),(max-height:620px){#chessMenuBtn{display:inline-flex}.nav-actions{flex-wrap:wrap}.nav-actions>a:first-of-type,.nav-actions #learnDockBtn{display:none}.chess-clock{font-size:15px;min-width:76px}.titlebar .chess-install-row{flex-basis:auto!important;width:auto!important;margin-left:auto!important}.titlebar{flex-wrap:wrap}}
@media(max-width:680px){.nav-actions{justify-content:space-between;width:100%;gap:4px}.nav-actions .chip{font-size:11px;padding:7px 9px;min-height:44px}#soundBtn{padding-inline:6px}.player-name{font-size:10px}.chess-clock{font-size:14px;padding:6px;min-width:72px}.chess-setup .panel-dialog-header h2{font-size:21px}.setup-content{padding:16px}.club-choices{flex-wrap:wrap}.club-choices>*{flex:1}.club-preview{display:none}.club-play{padding:12px}.club-dialog .club-content{padding:16px}.club-dialog header{padding:16px}#ufaPlayHuman{font-size:10px!important}.match-actions .match-buttons{gap:5px}}

.bot-time-options{border:1px solid #768d5c;border-radius:10px;padding:12px 16px;margin:0 0 18px}.bot-time-options summary{min-height:26px;cursor:pointer;font:650 15px/1.7 system-ui}.bot-time-options .chess-time-picker{margin-bottom:0}

#inviteeToast{z-index:100001!important}#inviteeToast button{min-width:0}#onlineWaiting .invite-help{font-size:12px;line-height:1.5}

@media(max-width:680px){.titlebar{flex-direction:column;align-items:stretch;gap:0}.titlebar .chess-install-row{width:100%!important;flex-basis:auto!important;text-align:right;margin:0!important;height:44px}.titlebar .nav-actions{flex:none;width:100%;margin:0}.chess-install-row #addHomeBtn{font-size:11px;padding:8px 0}}

@media(max-width:1050px),(max-height:620px){.titlebar .chess-install-row:not([hidden]){display:block!important;order:2!important}.player-strip{height:auto!important;min-height:36px!important}}
@media(max-width:680px){.titlebar .chess-install-row{order:0!important}.nav-actions{order:1}}

#topStrip{display:flex!important}

#inviteeToast{z-index:2147483647!important}

/* 1169: controls follow the board width; compact desktop rows free board height. */
#boardActions,.table-panel>.match-actions{width:var(--chess-board);max-width:100%;align-self:center}
@media(min-width:1051px) and (min-height:621px) and (pointer:fine){
  #boardActions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));margin-top:5px;gap:5px} #boardActions button{min-width:0}
  #boardActions button,.match-actions .match-buttons button{min-height:30px;height:30px;padding:4px 7px;font-size:11px;border-radius:6px}
  .match-actions{margin:4px 0 0}.match-actions .match-buttons{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}.match-actions .match-buttons button{min-width:0;padding-inline:4px}#ufaPlayHuman{min-height:30px!important;font-size:10px!important;line-height:12px;padding-block:1px}
  .board-wrap{margin-block:4px}.player-strip{height:28px;min-height:28px}
  #bottomStrip{min-height:30px!important}.chess-clock{padding:4px 8px;font-size:15px}
  .titlebar{min-height:44px;margin-bottom:6px}.shell{padding-bottom:8px}
}

/* 1215: game length is visible beside Play; captures remain above the mobile board. */
@media(max-width:680px){.club-dialog .club-choices{grid-template-columns:minmax(0,1fr) minmax(0,1fr);margin-top:0}.club-choices #clubPlay{grid-column:1/-1}.club-dialog .club-play{padding:12px 16px}}
@media(max-width:1050px),(pointer:coarse){
 .table-panel>#capturedRail{width:var(--chess-board);max-width:100%;align-self:center;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin:0 auto 6px;padding:0;border:0}
 #capturedRail .capture-card{padding:6px 8px;border-radius:7px;display:grid;grid-template-columns:minmax(0,1fr);gap:2px}
 #capturedRail .capture-card h2{font:650 10px/1.2 system-ui;margin:0}#capturedRail .capture-caption{font:9px/1.2 system-ui;margin:0}
 #capturedRail .capture-pieces{display:flex;flex-wrap:wrap;align-items:center;gap:3px;min-height:22px;margin:0}
 #capturedRail .capture-token{flex-direction:row;padding:0 2px;gap:1px;background:transparent}#capturedRail .capture-card[data-side="w"] .capture-token{background:#c5d2b6;color:#172315}#capturedRail .capture-token img{width:19px;height:21px}#capturedRail .capture-count{font-size:9px}
 #capturedRail .capture-letter,#capturedRail .capture-total,#capturedRail .capture-key{display:none}#capturedRail .capture-advantage{font:650 10px/1.2 system-ui;margin:0}#capturedRail .capture-empty{font:10px/1.3 system-ui}
}

/* 1222: one-screen mobile table; secondary profile/install actions stay in Menu. */
@media(max-width:1050px),(max-height:520px){
 html,body{height:100%;min-height:0;overflow:hidden}
 body{height:var(--chess-viewport,100dvh)}
 .shell{width:calc(100% - 16px);height:var(--chess-viewport,100dvh);min-height:0;margin:0 auto;padding:4px 0 max(4px,env(safe-area-inset-bottom));display:flex;flex-direction:column;overflow:hidden}
 .shell>.club-bar,.shell>.heading{display:none}
 .shell>.titlebar{height:44px;min-height:44px;flex:none;flex-direction:row;flex-wrap:nowrap;gap:0;margin:0 0 2px;border:0}
 .shell>.titlebar .chess-install-row,.shell>.titlebar .chess-install-row:not([hidden]){display:none!important}
 .shell>.titlebar .nav-actions{width:100%;display:flex;flex-wrap:nowrap;justify-content:space-between;gap:4px;margin:0}
 .shell>.titlebar .nav-actions .chip{min-height:44px;height:44px;padding:6px 8px;font-size:11px}
 .shell>.titlebar #rulesBtn{display:none}.club-notice{flex:none;margin:0 0 3px;font-size:11px;max-height:44px;overflow:auto}
 .layout{display:block;flex:1;min-height:0;padding:0;overflow:hidden}
 .layout>.table-panel{height:100%;max-height:100%;width:100%;display:flex;flex-direction:column;align-items:center;gap:0;padding:0;overflow:hidden}
 .layout>.pane.right{display:none}
 .table-panel>.table-heading{align-self:stretch;min-height:20px;margin:0 0 3px;gap:6px}.table-heading .status{font-size:11px;line-height:1.3}
 #recallEnd{min-height:32px!important;height:32px;padding:4px 7px!important;font-size:10px!important}
 #topStrip,#bottomStrip{height:28px!important;min-height:28px!important;gap:6px;padding:0}
 .player-strip .player-name{font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.2}
 .player-strip .player-icon.club-avatar{width:23px;height:23px;flex:none}
 .player-strip .chess-clock{font-size:13px;min-width:65px;padding:3px 5px}
 .board-wrap{margin:2px auto}
 #boardActions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));margin:3px 0 0;gap:4px}
 .table-panel>.match-actions{margin:3px 0 0;padding:0}.match-actions .match-buttons{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px}
 #boardActions button,.match-actions button{min-width:0;min-height:44px;height:44px;padding:4px 3px;font-size:10px;line-height:1.15}
 #ufaPlayHuman{min-height:44px!important;font-size:9px!important}
 .table-panel>#capturedRail{gap:4px;margin:0 auto 3px}
 #capturedRail .capture-card{padding:3px 4px;gap:2px;overflow:hidden}
 #capturedRail .capture-card h2{font-size:9px;line-height:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 #capturedRail .capture-caption{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
 #capturedRail .capture-pieces{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:1px;height:24px;min-height:24px;align-items:center}
 #capturedRail .capture-token{position:relative;display:block;padding:0;height:24px;min-width:0;border-radius:3px}
 #capturedRail .capture-token img{display:block;width:100%;max-width:23px;height:22px;margin:auto}
 #capturedRail .capture-count{position:absolute;right:0;bottom:0;font-size:8px;line-height:10px;background:#30392e;border-radius:2px;padding:0 1px;color:#f1f3e7}
 #capturedRail .capture-card[data-side="w"] .capture-count{background:#c5d2b6;color:#172315}
 #capturedRail .capture-advantage{font-size:9px;line-height:11px;white-space:nowrap}
 #capturedRail .capture-empty{font-size:9px;white-space:nowrap}
}
@media(max-height:520px) and (min-width:480px){
 .layout>.table-panel{display:grid;grid-template-columns:minmax(0,1fr) minmax(220px,40%);grid-template-rows:28px 56px minmax(0,1fr) 44px auto;gap:4px 12px;align-items:center}
 .table-panel>.table-heading{grid-column:2;grid-row:1;margin:0;align-self:center;min-width:0}
 .table-panel>#capturedRail{grid-column:2;grid-row:2;width:100%;margin:0;align-self:start}
 #topStrip{grid-column:1;grid-row:1}#bottomStrip{grid-column:1;grid-row:5;align-self:end}
 .table-panel>.board-wrap{grid-column:1;grid-row:2/6;margin:0 auto;align-self:start}
 #boardActions{grid-column:2;grid-row:4;width:100%;margin:0;align-self:stretch}
 .table-panel>.match-actions{grid-column:2;grid-row:5;width:100%;margin:0;align-self:stretch}
}
