/* Crosslink V287: gameplay controls off the board, with screen-filling tablet sizing.
   The Options button is moved to the playbar by layout.js, retaining game.js handlers.
   Non-game page layout and backgrounds are untouched. */
body.board-view .board-view-tools:empty {display:none!important;}
body.board-view .playbar > #boardOptionsBtn {
  display:block!important;position:static!important;inset:auto!important;
  transform:none!important;order:5!important;grid-column:1/-1!important;
  width:100%!important;max-width:none!important;min-width:0!important;
  min-height:40px!important;padding:9px 12px!important;
  border-radius:14px!important;
  background:rgba(255,255,255,.96)!important;color:#23153b!important;
  border:1px solid rgba(90,72,121,.26)!important;
  box-shadow:0 2px 8px rgba(0,0,0,.17)!important;
  font-size:14px!important;font-weight:800!important;cursor:pointer!important;
  pointer-events:auto!important;z-index:1!important;
}
body.board-view .board-options-panel {
  position:fixed!important;top:12px!important;right:12px!important;
  max-height:calc(100dvh - 24px)!important;overflow:auto!important;
  z-index:11020!important;
}
/* Landscape tablet: give the board every available pixel except the dice rail. */
@media (min-width:801px) and (max-width:1200px) and (orientation:landscape),
       (min-width:801px) and (max-width:1400px) and (pointer:coarse) and (orientation:landscape) {
  body.board-view .board-wrap,
  body.board-view:not(.classic-mode) .board-wrap,
  body.board-view.pawn-status-hidden .board-wrap,
  body.board-view:not(.classic-mode):not(.pawn-status-hidden) .board-wrap {
    --board-side:min(calc(100dvh - 20px),calc(100vw - 206px));
    gap:10px!important;padding:10px!important;
    min-height:100dvh!important;justify-content:center!important;
  }
  body.board-view:not(.classic-mode):not(.pawn-status-hidden) .board-wrap {
    --board-side:min(calc(100dvh - 20px),calc(100vw - 392px));
    padding-left:188px!important;
  }
  body.board-view .playbar,
  body.board-view:not(.classic-mode):not(.pawn-status-hidden) .playbar {
    width:174px!important;max-width:174px!important;flex:0 0 174px!important;
    gap:8px!important;padding:9px!important;
  }
}
/* Portrait tablet: retain controls under the board; make maximum use of viewport width. */
@media (min-width:801px) and (max-width:1200px) and (orientation:portrait) {
  body.board-view .board-wrap,
  body.board-view:not(.classic-mode) .board-wrap,
  body.board-view.pawn-status-hidden .board-wrap,
  body.board-view:not(.classic-mode):not(.pawn-status-hidden) .board-wrap {
    --board-side:min(calc(100vw - 20px),calc(100dvh - 248px),760px)!important;
    padding:12px 10px max(10px,env(safe-area-inset-bottom))!important;
    gap:8px!important;
  }
  body.board-view .playbar,
  body.board-view:not(.classic-mode):not(.pawn-status-hidden) .playbar {
    grid-template-columns:1fr auto 1fr!important;
    width:min(var(--board-side),760px)!important;
    padding:8px 12px!important;
  }
  body.board-view .playbar > #boardOptionsBtn {grid-row:2!important;grid-column:1/-1!important;}
}
/* Phones retain their original board/dice layout. Options follows the dice row. */
@media (max-width:800px) {
  body.board-view .playbar > #boardOptionsBtn {
    grid-row:2!important;grid-column:1/-1!important;
    min-height:36px!important;padding:7px 10px!important;
  }
  body.board-view .board-options-panel {left:12px!important;right:12px!important;width:auto!important;}
}
