/* ELOFLOW 227 — Reduce nested panel chrome on chess tools.
   Visual-only overrides: do not change board sizing, grids, controls or behavior. */
body.elo-unified-chess .play-layout > .play-board-card,
body.elo-unified-chess .play-layout > .play-panel {
  background:transparent!important;
  border:0!important;
  border-radius:0!important;
  box-shadow:none!important;
  padding:0!important;
}
body.elo-unified-chess .play-layout > .play-panel {
  display:flex!important;
  flex-direction:column!important;
  gap:12px!important;
}
body.elo-unified-chess .play-panel > .play-bot-chat-panel,
body.elo-unified-chess .play-panel > .play-moves {
  border:1px solid #285877!important;
  border-radius:12px!important;
  background:#092237!important;
  padding:14px!important;
  box-sizing:border-box!important;
}
body.elo-unified-chess .play-panel > .play-moves {min-height:90px}
body.elo-unified-chess .play-panel > .play-status:empty {display:none!important}
body.elo-unified-chess .play-selector {
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  padding:0!important;
}
body.elo-unified-chess .play-bot-tiers {
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
}
body.elo-unified-chess .play-bot-tier {
  box-shadow:none!important;
}
body.elo-unified-chess .play-bot-tier .play-bot {
  box-shadow:none;
}
/* Analysis: keep the useful control and engine cards, remove the
   oversized parent panel and the redundant board-column surface. */
body.elo-unified-chess main.tool-page .tool-card:first-of-type:has(.analysis-three-column) {
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  border-radius:0!important;
  padding:0!important;
}
body.elo-unified-chess .analysis-three-column > .analysis-board-column {
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  border-radius:0!important;
  padding:0!important;
}
body.elo-unified-chess .analysis-player-initial {
  display:none!important;
}
body.elo-unified-chess .analysis-player-initial:has(img[src]:not([src=""])) {
  display:inline-flex!important;
}
/* Puzzles: the chessboard already provides its own visual boundary.
   Keep the mode chooser, controls, progress and leaderboards as cards. */
body.elo-unified-chess .puzzles-layout > .puzzle-board-card {
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  border-radius:0!important;
  padding:0!important;
}
body.elo-unified-chess .puzzles-layout > .puzzle-board-card #puzzle-board {
  max-width:700px!important;
}
@media(max-width:700px){
  body.elo-unified-chess .play-layout > .play-panel {gap:10px!important}
  body.elo-unified-chess .play-panel > .play-bot-chat-panel,
  body.elo-unified-chess .play-panel > .play-moves {padding:12px!important}
}

/* ELOFLOW 227 follow-up: compact control rail and aligned player names. */
body.elo-unified-chess .play-layout > .play-controls-panel {
  align-self:start!important;
  height:max-content!important;
  min-height:0!important;
}
body.elo-unified-chess .play-controls-choose {
  display:block;
  margin-top:12px;
  padding:11px 12px;
  text-align:center;
  text-decoration:none;
  font-weight:750;
  font-size:14px;
  color:#e9faff;
  background:#135576;
  border:1px solid #3684a5;
  border-radius:8px;
}
body.elo-unified-chess .play-controls-choose:hover,
body.elo-unified-chess .play-controls-choose:focus-visible {background:#197298}
@media(min-width:900px){
 body.elo-unified-chess .play-board-card .play-board-top,
 body.elo-unified-chess .play-board-card .play-board-footer {
   padding-left:clamp(0px,3vw,52px)!important;
   box-sizing:border-box!important;
 }
 body.elo-unified-chess .analysis-three-column > .analysis-board-column {
   margin-top:-28px!important;
 }
 body.elo-unified-chess .analysis-three-column .board-with-eval {
   row-gap:2px!important;
   grid-template-rows:28px minmax(0,auto) 28px!important;
 }
 body.elo-unified-chess .analysis-three-column .analysis-player-strip {
   height:28px!important;
 }
}
@media(max-width:899px){
 body.elo-unified-chess .play-board-card .play-board-top,
 body.elo-unified-chess .play-board-card .play-board-footer {padding-left:0!important}
}

/* ELOFLOW 229: close the desktop gaps without changing chessboard dimensions. */
@media (min-width:1100px) {
 body.elo-unified-chess .play-layout {
   column-gap:8px!important;
 }
 body.elo-unified-chess .play-layout > .play-controls-panel {
   position:relative!important;
   left:12px!important;
 }
 body.elo-unified-chess .play-layout > .play-panel {
   position:relative!important;
   left:-12px!important;
 }
}
@media (min-width:900px) {
 body.elo-unified-chess .analysis-three-column > .analysis-board-column {
   margin-top:-46px!important;
 }
 body.elo-unified-chess .analysis-three-column .analysis-board-column > .board-top-switch {
   min-height:22px!important;
   margin-bottom:0!important;
 }
 body.elo-unified-chess .analysis-three-column .analysis-board-column > .board-bottom-switch {
   margin-top:0!important;
 }
}
body.elo-unified-chess .review-side-stats .review-empty-metric strong {
 color:#8daabc;
 font-weight:500;
}

/* ELOFLOW 229: align empty classifications with the populated review grid. */
body.elo-unified-chess .review-side-stats .review-empty-classification {
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 38px 28px 38px!important;
  align-items:center!important;
  gap:4px!important;
}
body.elo-unified-chess .review-side-stats .review-empty-classification strong {
  background:transparent!important;
  border:0!important;
  padding:0!important;
  text-align:center!important;
  color:#d6ecf8!important;
}
body.elo-unified-chess .review-side-stats .review-empty-classification .review-class-icon {
  justify-self:center!important;
}
/* Bring the analysis board closer to the header; preserve clearance on mobile. */
@media(min-width:900px){
 body.elo-unified-chess .analysis-three-column > .analysis-board-column {
   margin-top:-70px!important;
 }
}

/* 231: keep the Analysis player strip directly under the navigation bar. */
@media(min-width:900px){
 body.elo-unified-chess .analysis-three-column > .analysis-board-column {
   margin-top:-88px!important;
 }
}
/* Overlay geometry is measured against the actual 8x8 board, not its outer card. */
body.elo-unified-chess .play-start-intro {
 inset:auto!important;
 box-sizing:border-box!important;
 border-radius:0!important;
}

/* 232: higher-specificity override of analysis-board-size-201.css margin:0.
   The prior -88px selector never won the cascade. */
@media(min-width:900px){
 body.elo-unified-chess main.tool-page .tool-card:first-of-type>.analysis-three-column>.analysis-board-column{
  margin-top:-18px!important;
 }
}
/* The intro is a child of #play-board, so only the 8x8 squares are dimmed. */
body.elo-unified-chess #play-board>.play-start-intro{
 inset:0!important;
 width:100%!important;
 height:100%!important;
 border-radius:0!important;
 padding:12px!important;
}

/* 233: visible, targeted desktop Analysis board lift.
   Earlier margin rules moved only 18px; compress the player rows as well. */
@media (min-width:900px){
 body.elo-unified-chess main.tool-page .tool-card:first-of-type>.analysis-three-column>.analysis-board-column{
   margin-top:-36px!important;
 }
 body.elo-unified-chess main.tool-page .analysis-three-column>.analysis-board-column>.board-with-eval{
   grid-template-rows:14px auto 14px!important;
   row-gap:0!important;
 }
 body.elo-unified-chess main.tool-page .analysis-three-column .analysis-player-strip{
   height:14px!important;
   min-height:14px!important;
   line-height:14px!important;
   align-items:center!important;
 }
 body.elo-unified-chess main.tool-page .analysis-three-column .analysis-player-black{
   align-self:end!important;
 }
 body.elo-unified-chess main.tool-page .analysis-three-column .analysis-player-white{
   align-self:start!important;
 }
}

/* 234: restore room for Black above the board, without large blank space. */
@media (min-width:900px) {
 body.elo-unified-chess main.tool-page .tool-card:first-of-type>.analysis-three-column>.analysis-board-column {
   margin-top:-12px!important;
 }
 body.elo-unified-chess main.tool-page .analysis-three-column>.analysis-board-column>.board-with-eval {
   grid-template-rows:20px auto 16px!important;
   row-gap:0!important;
 }
 body.elo-unified-chess main.tool-page .analysis-three-column .analysis-player-strip {
   height:auto!important;
   min-height:16px!important;
   line-height:18px!important;
 }
}

/* 235: Play Bots desktop alignment only; preserve board size and mobile layout. */
@media (min-width:1100px) {
 body.elo-unified-chess .play-layout > .play-controls-panel {
   left:28px!important;
 }
 body.elo-unified-chess .play-layout > .play-panel {
   left:-28px!important;
 }
}
@media (min-width:900px) {
 body.elo-unified-chess .play-board-card .play-board-top,
 body.elo-unified-chess .play-board-card .play-board-footer {
   padding-left:0!important;
 }
}

/* 237: align both player names with the actual 8x8 board edge.
   The board sits 55px inside its card at desktop widths. */
@media (min-width:900px) {
 body.elo-unified-chess .play-layout > .play-board-card .play-board-top,
 body.elo-unified-chess .play-layout > .play-board-card .play-board-footer {
   padding-left:64px!important;
 }
}
