/* Table scene. Felt and wood are image textures. Game rules live elsewhere. */

body:has(#gameBoard){
  background:#14080c !important;
  --rack-half:min(390px, 29vw);
}
body:has(#gameBoard) .game-container,
body:has(#gameBoard) .game-board{
  background:
    radial-gradient(ellipse at 50% 100%, #3a1018 0%, #19151A 46%, #0c0608 100%) !important;
  box-shadow:none !important;
}
body:has(#gameBoard) .game-board:before{content:none !important}

body:has(#gameBoard) .table-center{
  width:min(1680px, calc(100vw - 88px)) !important;
  height:calc(100vh - 36px) !important;
  top:50% !important;
  left:50% !important;
  transform:translate(-50%,-50%) !important;
  z-index:4 !important;
  box-sizing:border-box !important;
  padding:64px 72px 210px !important;
  border-radius:54px !important;
  background-color:#542719 !important;
  background-image:
    linear-gradient(180deg, rgba(255,214,150,.16), transparent 18%),
    url('../asset/wood.svg') !important;
  background-size:auto, 280px 180px !important;
  box-shadow:
    inset 0 1px 0 rgba(255,226,170,.45),
    inset 0 0 0 3px #E9B943,
    inset 0 0 0 16px #3a1c10,
    inset 0 -14px 22px rgba(0,0,0,.35),
    0 0 0 3px #2a120c,
    0 26px 48px rgba(0,0,0,.55) !important;
}
body:has(#gameBoard) .felt-board{
  width:100%;
  height:100%;
  border-radius:22px !important;
  background-color:#2b143f !important;
  background-image:
    radial-gradient(ellipse at 50% 42%, rgba(255,255,255,.05), transparent 46%),
    radial-gradient(ellipse at 50% 60%, transparent 40%, rgba(0,0,0,.38) 100%),
    url('../asset/felt.svg?v=3') !important;
  background-size:auto, auto, 180px 180px !important;
  box-shadow:
    inset 0 0 0 2px rgba(233,185,67,.7),
    inset 0 22px 36px rgba(255,255,255,.04),
    inset 0 -18px 40px rgba(0,0,0,.35),
    inset 0 0 90px rgba(0,0,0,.48) !important;
}
body.felt-green:has(#gameBoard) .felt-board{
  background-color:#086454 !important;
  background-image:
    radial-gradient(ellipse at 50% 42%, rgba(255,255,255,.06), transparent 46%),
    radial-gradient(ellipse at 50% 60%, transparent 40%, rgba(0,0,0,.34) 100%),
    url('../asset/felt-green.svg?v=2') !important;
}
body:has(#gameBoard) .throw-well:not(:has(.mini-tile)):not(:has(.sprite-face)){
  background:transparent !important;
  box-shadow:none !important;
  border:0 !important;
}
body:has(#gameBoard) .across-slot span{font-size:8px !important;opacity:.65}
body:has(#gameBoard) .indicator-section{
  background:transparent !important;
  border:0 !important;
  box-shadow:none !important;
  padding:0 !important;
  backdrop-filter:none !important;
  min-width:0 !important;
}
body:has(#gameBoard) .indicator-section:after{content:none !important}
body:has(#gameBoard) .meld-lane .opened-group{
  background:rgba(12,6,16,.22) !important;
  border-color:rgba(233,185,67,.22) !important;
}
body:has(#gameBoard) #meldSeries{padding-left:18px !important}
body:has(#gameBoard) #meldPairs{padding-right:18px !important}
body:has(#gameBoard) .lane-tag{color:rgba(233,185,67,.8) !important}

body:has(#gameBoard) #scoreboard{
  width:300px !important;
  max-height:min(52vh, 460px) !important;
  overflow:auto !important;
  padding:10px 10px 8px !important;
}
body:has(#gameBoard) #scoreboard .panel-header{
  font-size:12px !important;
  letter-spacing:.04em;
  margin-bottom:6px;
}
body:has(#gameBoard) .hand-log{
  display:grid;
  gap:3px;
  min-width:0;
}
body:has(#gameBoard) .hand-line{
  display:grid;
  grid-template-columns:34px repeat(var(--score-cols, 4), minmax(0, 1fr));
  gap:4px;
  align-items:center;
  padding:4px 2px;
  border-bottom:1px solid rgba(233,185,67,.12);
  color:#f6ecd4;
  font-size:11px;
}
body:has(#gameBoard) .hand-line.head{
  color:#E9B943;
  font-size:10px;
  letter-spacing:.02em;
}
body:has(#gameBoard) .hand-line.total{
  border-bottom:0;
  margin-top:2px;
  font-size:12px;
}
body:has(#gameBoard) .hand-line b{
  font-weight:800;
  text-align:right;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
body:has(#gameBoard) .hand-line b.good{color:#8dffb0}
body:has(#gameBoard) .hand-line b.bad{color:#ff9a9a}
body:has(#gameBoard) #scoreboard .score-rule{margin:8px 0 0;font-size:10px;color:#d9c48a}
body:has(#gameBoard) .finish-rack .rack-row{gap:1px !important}
body:has(#gameBoard) .finish-rack .sprite-face.group-start{margin-left:8px}
body:has(#gameBoard) .match-purse{
  margin-top:12px;
  padding:10px 12px;
  border-radius:14px;
  background:rgba(24,6,12,.45);
  border:1px solid rgba(233,185,67,.35);
  text-align:left;
}
body:has(#gameBoard) .match-purse.hidden{display:none}
body:has(#gameBoard) .match-purse strong{display:block;color:#ffe7a8;font-size:16px;margin-bottom:8px;text-shadow:none}
body:has(#gameBoard) .match-purse b{font-size:13px !important;text-shadow:none !important;color:#fff6ea !important}
body:has(#gameBoard) .match-purse ul{list-style:none;margin:0;padding:0;display:grid;gap:6px}
body:has(#gameBoard) .match-purse li{display:grid;grid-template-columns:minmax(0,1.2fr) auto auto;gap:10px;align-items:center;color:#f6ecd4;font-size:13px}
body:has(#gameBoard) .match-purse em{font-style:normal;color:#ffe7a8}
body:has(#gameBoard) #scoreboard,
body:has(#gameBoard) .game-status-panel{
  background:#19151A !important;
  border:1px solid rgba(233,185,67,.5) !important;
  border-radius:12px !important;
  box-shadow:0 10px 22px rgba(0,0,0,.35) !important;
  color:#f6ecd4 !important;
}
body:has(#gameBoard) .panel-header,
body:has(#gameBoard) .status-item .label{color:#E9B943 !important}
body:has(#gameBoard) .status-item .value,
body:has(#gameBoard) .stat-score{color:#f6ecd4 !important}
body:has(#gameBoard) .leave-table-btn{
  background:#650B20 !important;
  color:#f6ecd4 !important;
  border:1px solid rgba(233,185,67,.55) !important;
  border-radius:12px !important;
}
body:has(#gameBoard) .turn-flash{
  top:7% !important;
  font-size:16px !important;
  letter-spacing:.16em !important;
}
body:has(#gameBoard) .turn-flash.mine{font-size:18px !important}

body:has(#gameBoard) .player-info,
body:has(#gameBoard) #topPlayerInfo,
body:has(#gameBoard) #leftPlayerInfo,
body:has(#gameBoard) #rightPlayerInfo,
body:has(#gameBoard) #bottomPlayerInfo{
  background:transparent !important;
  border:0 !important;
  box-shadow:none !important;
  min-width:0 !important;
  width:88px !important;
  max-width:88px !important;
  padding:0 !important;
  gap:3px !important;
  border-radius:0 !important;
  flex-direction:column !important;
  align-items:center !important;
}
body:has(#gameBoard) .opponent-area.left,
body:has(#gameBoard) .opponent-area.right{
  width:88px !important;
  max-width:88px !important;
  z-index:40 !important;
}
body:has(#gameBoard) .avatar-wrapper,
body:has(#gameBoard) .player-avatar{
  width:52px !important;
  height:52px !important;
}
body:has(#gameBoard) .player-avatar{
  border:2px solid #E9B943 !important;
  box-shadow:0 0 0 2px #542719, 0 6px 12px rgba(0,0,0,.45) !important;
  object-fit:cover;
}
body:has(#gameBoard) .player-details{
  align-items:center;
  text-align:center;
  max-width:88px;
}
body:has(#gameBoard) .player-name,
body:has(#gameBoard) .player-meta,
body:has(#gameBoard) .team-badge{
  display:block;
  max-width:88px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
body:has(#gameBoard) .player-name{
  font-size:11px !important;
  color:#fff6e4 !important;
  text-shadow:0 1px 2px rgba(0,0,0,.75);
}
body:has(#gameBoard) .player-name{
  background:#19151A;
  border:1px solid rgba(233,185,67,.45);
  border-radius:999px;
  padding:2px 8px;
}
body:has(#gameBoard) .player-score{
  font-size:11px !important;
  color:#E9B943 !important;
  font-weight:800;
}
body:has(#gameBoard) .player-meta,
body:has(#gameBoard) .seat-status,
body:has(#gameBoard) .seat-social,
body:has(#gameBoard) .rack-chip,
body:has(#gameBoard) .tile-count-badge{display:none !important}
body:has(#gameBoard) .player-info.current-turn{
  transform:none !important;
  box-shadow:none !important;
}
body:has(#gameBoard) #bottomPlayerInfo,
body:has(#gameBoard) #bottomPlayerInfo.current-turn{
  position:absolute !important;
  left:50% !important;
  right:auto !important;
  margin:0 !important;
  width:88px !important;
  transform:translateX(-50%) !important;
}
body:has(#gameBoard) .player-info.current-turn:after{content:none !important}
body:has(#gameBoard) .player-info.current-turn .player-avatar{
  animation:none !important;
  box-shadow:0 0 0 2px #E9B943, 0 4px 8px rgba(0,0,0,.4) !important;
}
@keyframes casino-ring{
  from{box-shadow:0 0 0 2px #E9B943, 0 0 8px rgba(233,185,67,.35)}
  to{box-shadow:0 0 0 5px rgba(233,185,67,.25), 0 0 16px rgba(233,185,67,.7)}
}
body:has(#gameBoard) .opponent-area.top{top:2.2vh !important;z-index:40 !important}
body:has(#gameBoard) .opponent-area.left{left:max(10px, calc(50vw - min(840px, 49vw) + 8px)) !important;top:42% !important}
body:has(#gameBoard) .opponent-area.right{right:max(10px, calc(50vw - min(840px, 49vw) + 8px)) !important;top:42% !important}
body:has(#gameBoard) #rightPlayerInfo{position:relative !important;right:auto !important;top:auto !important;width:88px !important}

body:has(#gameBoard) .player-area.bottom{bottom:12vh !important;z-index:30 !important}
body:has(#gameBoard) .cue-row{min-height:74px !important}
body:has(#gameBoard) .tile-slot{
  flex-basis:50px !important;
  width:50px !important;
  min-width:50px !important;
  max-width:50px !important;
  height:72px !important;
}
body:has(#gameBoard) .tile-slot .tile-sprite{
  width:42px !important;
  height:58px !important;
}
body:has(#gameBoard) .cue-container{width:calc(var(--rack-half) * 2) !important;max-width:calc(var(--rack-half) * 2) !important}
body:has(#gameBoard) .cue-wood,
body:has(#gameBoard) .cue-wood.frame-king,
body:has(#gameBoard) .cue-wood.frame-diamond,
body:has(#gameBoard) .cue-wood.frame-ruby,
body:has(#gameBoard) .cue-wood.frame-night,
body:has(#gameBoard) .cue-wood.frame-pearl,
body:has(#gameBoard) .cue-wood.frame-gold{
  background-color:#71331F !important;
  background-image:url('../asset/istaka.jpg') !important;
  background-size:cover !important;
  background-position:center !important;
  border-radius:14px !important;
  border:3px solid #3a1a10 !important;
  box-shadow:inset 0 0 0 2px #E9B943, 0 12px 22px rgba(0,0,0,.45) !important;
}

body:has(#gameBoard) .tile-slot{border-color:transparent !important}
body:has(#gameBoard) .tile-face{
  border-radius:6px;
  background:#ffffff !important;
  background-image:none !important;
  background-blend-mode:normal !important;
  mix-blend-mode:normal !important;
  filter:none !important;
  opacity:1 !important;
}
body:has(#gameBoard) .tile-face .tile-ink{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  display:block;
  pointer-events:none;
  background:#ffffff;
}
body:has(#gameBoard) .tile-face{
  border-radius:6px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.9),
    inset 0 -3px 0 rgba(120,96,60,.22),
    0 1px 0 #efe6d6,
    0 3px 0 #d4c6ae,
    0 7px 8px rgba(0,0,0,.38);
}
body:has(#gameBoard) .sprite-face{overflow:hidden}
body:has(#gameBoard) .sprite-face .tile-face{
  position:absolute !important;
  inset:0 !important;
  width:auto !important;
  height:auto !important;
  transform:none !important;
}
body:has(#gameBoard) .tile-slot .tile-sprite{
  background-image:none !important;
  mix-blend-mode:normal !important;
}
body:has(#gameBoard) .sprite-face{
  border-radius:6px !important;
  box-shadow:
    0 1px 0 #efe6d6,
    0 3px 0 #d4c6ae,
    0 7px 8px rgba(0,0,0,.38) !important;
}
body:has(#gameBoard) .cue-row{gap:7px !important}
body:has(#gameBoard) .tile-slot .tile-sprite{transition:transform .16s ease}
body:has(#gameBoard) .tile-slot:hover .tile-sprite:not(.okey):not(.selected){
  transform:translate(-50%, calc(-50% - 5px)) scale(1.16) !important;
}
body:has(#gameBoard) .tile-slot .tile-sprite.selected:not(.okey){
  transform:translate(-50%, calc(-50% - 9px)) scale(1.16) !important;
}
body:has(#gameBoard) .pile-tile-back{
  background:linear-gradient(165deg, #fbf7ef, #eadfcb) !important;
  border:1px solid #cbb892 !important;
  border-radius:6px !important;
  box-shadow:
    inset 0 0 0 2px rgba(90,52,24,.22),
    inset 0 1px 0 rgba(255,255,255,.8),
    0 2px 0 #cbb892,
    0 5px 6px rgba(0,0,0,.35) !important;
}
body:has(#gameBoard) .pile-tile-back:nth-child(1){top:-10px !important;left:-4px !important}
body:has(#gameBoard) .pile-tile-back:nth-child(2){top:-5px !important;left:-1px !important}
body:has(#gameBoard) .pile-tile-back:nth-child(3){top:0 !important;left:2px !important}
body:has(#gameBoard) .rack-actions{display:contents !important}
body:has(#gameBoard) #sortPairsBtn,
body:has(#gameBoard) #sortSeriesBtn,
body:has(#gameBoard) #openPairsBtn,
body:has(#gameBoard) #openHandBtn,
body:has(#gameBoard) #processTileBtn,
body:has(#gameBoard) #swapOkeyBtn,
body:has(#gameBoard) #showIndicatorBtn,
body:has(#gameBoard) #returnTileBtn{
  position:absolute !important;
  z-index:46 !important;
  width:82px !important;
  min-width:0 !important;
  max-width:82px !important;
  min-height:0 !important;
  padding:7px 4px !important;
  font-size:12px !important;
  line-height:1.15 !important;
}
body:has(#gameBoard) #sortPairsBtn,
body:has(#gameBoard) #sortSeriesBtn{
  height:86px !important;
  width:92px !important;
  max-width:92px !important;
  bottom:108px !important;
  border-radius:16px !important;
  font-size:13px !important;
}
body:has(#gameBoard) #sortPairsBtn,
body:has(#gameBoard) #openPairsBtn{left:calc(50% - var(--rack-half) - 112px) !important;right:auto !important}
body:has(#gameBoard) #sortSeriesBtn,
body:has(#gameBoard) #openHandBtn,
body:has(#gameBoard) #processTileBtn,
body:has(#gameBoard) #swapOkeyBtn,
body:has(#gameBoard) #showIndicatorBtn,
body:has(#gameBoard) #returnTileBtn{left:auto !important;right:calc(50% - var(--rack-half) - 112px) !important}
body:has(#gameBoard) #openPairsBtn,
body:has(#gameBoard) #openHandBtn{bottom:24px !important;height:36px !important}
body:has(#gameBoard) #processTileBtn{bottom:206px !important;height:40px !important}
body:has(#gameBoard) #swapOkeyBtn{bottom:254px !important}
body:has(#gameBoard) #showIndicatorBtn{bottom:298px !important}
body:has(#gameBoard) #returnTileBtn{bottom:342px !important}
body:has(#gameBoard) .player-area.bottom{justify-content:center !important}
body:has(#gameBoard) .felt-theme{
  border:1px solid rgba(233,185,67,.55);
  background:#650B20;
  color:#f6ecd4;
  border-radius:999px;
  padding:4px 8px;
  font-size:11px;
  font-weight:800;
  cursor:pointer;
}
body:has(#gameBoard) .end-actions,
body:has(#gameBoard) .finish-actions{display:flex;gap:10px;justify-content:center;margin-top:14px}
body:has(#gameBoard) #endLeaveBtn,
body:has(#gameBoard) #finishLeave{
  background:linear-gradient(180deg,#c43848,#8d1528) !important;
  color:#fff8f4 !important;
  border:0 !important;
  border-radius:12px !important;
  min-width:120px;
  padding:10px 16px;
  font-weight:800;
  cursor:pointer;
}

body:has(#gameBoard) .action-btn{
  border-radius:10px !important;
  transition:transform .12s ease, filter .12s ease;
}
body:has(#gameBoard) .action-btn:hover{filter:brightness(1.06)}
body:has(#gameBoard) .action-btn:active{transform:translateY(1px)}
body:has(#gameBoard) #sortSeriesBtn,
body:has(#gameBoard) #sortPairsBtn,
body:has(#gameBoard) #openHandBtn,
body:has(#gameBoard) #openPairsBtn{
  background:linear-gradient(180deg,#2ea35a,#087B50) !important;
  color:#f4fff6 !important;
  border:1px solid #E9B943 !important;
  box-shadow:0 6px 12px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.28) !important;
}
body:has(#gameBoard) #processTileBtn,
body:has(#gameBoard) #swapOkeyBtn,
body:has(#gameBoard) #showIndicatorBtn,
body:has(#gameBoard) #returnTileBtn{
  background:#19151A !important;
  color:#f6ecd4 !important;
  border:1px solid rgba(233,185,67,.65) !important;
}

body:has(#gameBoard) #gameEndModal .modal-content,
body:has(#gameBoard) #finishShow .finish-copy{
  background:
    linear-gradient(180deg, rgba(101,11,32,.2), transparent 28%),
    #19151A !important;
  border:1px solid rgba(233,185,67,.55) !important;
  border-radius:18px !important;
  box-shadow:0 24px 50px rgba(0,0,0,.5) !important;
  color:#f6ecd4 !important;
}
body:has(#gameBoard) #winnerText,
body:has(#gameBoard) #finishShow .finish-copy b{
  color:#E9B943 !important;
  text-shadow:0 8px 24px rgba(0,0,0,.45);
}
body:has(#gameBoard) #newRoundBtn,
body:has(#gameBoard) #finishContinue{
  background:linear-gradient(180deg,#2ea35a,#087B50) !important;
  color:#f4fff6 !important;
  border:0 !important;
  border-radius:12px !important;
}
body:has(#gameBoard) .final-scores,
body:has(#gameBoard) .finish-hands article{
  background:#120d12 !important;
  border:1px solid rgba(233,185,67,.22) !important;
  border-radius:12px !important;
}
body:has(#gameBoard) .score-row{color:#f6ecd4}
body:has(#gameBoard) .radio-dock,
body:has(#gameBoard) .voice-dock,
body:has(#gameBoard) .table-chat-toggle{
  background:#19151A !important;
  border:1px solid rgba(233,185,67,.35) !important;
  color:#f6ecd4 !important;
}

body:has(#gameBoard) .game-board.my-turn-glow{box-shadow:none !important}
body:has(#gameBoard) .seat-live .player-info{animation:none !important}
body:has(#gameBoard) .cue-wood.rack-arrive,
body:has(#gameBoard) .cue-wood.rack-swap{
  animation:none !important;
  filter:none !important;
}
body:has(#gameBoard) .cue-wood::before{
  content:none !important;
  animation:none !important;
  opacity:0 !important;
}
body:has(#gameBoard) .turn-flash.mine{
  background:rgba(42,16,24,.92) !important;
  color:#f6ecd4 !important;
  box-shadow:none !important;
  border:1px solid rgba(233,185,67,.45);
  font-size:16px !important;
}
body:has(#gameBoard) .finish-hands .finish-who{
  border:0;
  background:transparent;
  padding:0;
  margin:0;
  color:#ffe7a8;
  font:800 14px/1.2 inherit;
  cursor:pointer;
  text-decoration:underline;
  text-underline-offset:3px;
}
body:has(#gameBoard) .table-chat{
  background:
    radial-gradient(circle at 100% 0%, rgba(255,210,120,.16), transparent 28%),
    linear-gradient(180deg, #8a2450 0%, #5a1430 42%, #3a0e20 100%) !important;
  border:1px solid rgba(233,185,67,.5) !important;
  color:#fff6ea !important;
  border-radius:28px !important;
}
body:has(#gameBoard) .table-chat-head{
  border-bottom:0 !important;
  padding:12px 12px 0 !important;
}
body:has(#gameBoard) .chat-tabs{
  display:flex;
  gap:4px;
  margin:0;
  padding:4px;
  border-radius:16px;
  background:rgba(24,6,12,.4);
  border:1px solid rgba(233,185,67,.22);
}
body:has(#gameBoard) .chat-tabs button{
  position:relative;
  flex:1 1 0;
  min-width:0;
  height:34px;
  border:0;
  border-radius:12px;
  background:transparent;
  color:#f6ecd4;
  font-size:12px;
  font-weight:800;
}
body:has(#gameBoard) .chat-tabs button.on{
  background:linear-gradient(180deg,#ffe08a,#e0a63a);
  color:#4a2408;
}
body:has(#gameBoard) .table-chat-messages{
  background:rgba(24,6,12,.28);
  border:1px solid rgba(233,185,67,.22);
  border-radius:16px;
  margin:10px 12px;
}
body:has(#gameBoard) .chat-msg{
  background:rgba(16,4,8,.45);
  border-radius:16px;
  padding:10px;
}
body:has(#gameBoard) .chat-msg.mine{background:rgba(255,220,150,.16)}
body:has(#gameBoard) .chat-msg .name{color:#ffe7a8}
body:has(#gameBoard) .table-chat-form,
body:has(#gameBoard) .dm-bar{
  background:transparent !important;
}
body:has(#gameBoard) .table-chat-form input{
  background:rgba(24,6,12,.55) !important;
  border:1px solid rgba(233,185,67,.32) !important;
  color:#fff6ea !important;
  border-radius:14px !important;
}
body:has(#gameBoard) .dm-bar{
  display:flex;
  align-items:center;
  gap:8px;
  margin:10px 12px 0;
}
body:has(#gameBoard) .dm-bar.hidden{display:none}
body:has(#gameBoard) .dm-bar button{
  border:1px solid rgba(243,212,138,.5);
  background:transparent;
  color:#ffe7a8;
  border-radius:999px;
  padding:6px 12px;
  font-weight:800;
  cursor:pointer;
}
body:has(#gameBoard) .dm-bar b{color:#ffe7a8;font-size:14px}
body:has(#gameBoard) .dm-pick button{
  background:rgba(16,4,8,.45);
  color:#fff6ea;
  border-color:rgba(233,185,67,.35);
}
body:has(#gameBoard) .dm-count,
body:has(#gameBoard) .table-chat-toggle i{
  display:inline-grid;
  place-items:center;
  min-width:18px;
  height:18px;
  padding:0 5px;
  margin-left:4px;
  border-radius:999px;
  background:#e23b4a;
  color:#fff;
  font-style:normal;
  font-size:11px;
  font-weight:900;
}
body:has(#gameBoard) .dm-count.hidden,
body:has(#gameBoard) .table-chat-toggle i.hidden{display:none}

@media (prefers-reduced-motion:reduce){
  body:has(#gameBoard) .player-info.current-turn .player-avatar,
  body:has(#gameBoard) .tile-slot .tile-sprite{animation:none;transition:none}
}
@media (max-width:1440px){
  body:has(#gameBoard){--rack-half:min(340px, 28vw)}
  body:has(#gameBoard) .table-center{padding:40px 44px 176px !important}
}
body:has(#gameBoard){
  --lane:min(228px, 24vw);
  --lane-top:clamp(78px, 11vh, 118px);
  --lane-bottom:clamp(248px, calc(12vh + 214px), 360px);
}
body:has(#gameBoard) .opponent-area.top{
  left:0 !important;
  right:0 !important;
  width:auto !important;
  transform:none !important;
  align-items:center !important;
}
body:has(#gameBoard) .opponent-area.top .across-board{
  width:auto !important;
  max-width:none !important;
  justify-content:center !important;
  gap:0 !important;
}
body:has(#gameBoard) .across-slot:has(#wellAcrossThrow),
body:has(#gameBoard) #myLeftDiscard{
  position:fixed !important;
  left:calc(50% - var(--lane)) !important;
  right:auto !important;
  transform:none !important;
  margin:0 !important;
  z-index:42 !important;
  width:72px !important;
}
body:has(#gameBoard) .across-slot:has(#wellRightThrow),
body:has(#gameBoard) #myRightDiscard{
  position:fixed !important;
  left:calc(50% + var(--lane) - 72px) !important;
  right:auto !important;
  transform:none !important;
  margin:0 !important;
  z-index:42 !important;
  width:72px !important;
}
body:has(#gameBoard) .across-slot:has(#wellAcrossThrow),
body:has(#gameBoard) .across-slot:has(#wellRightThrow){
  top:var(--lane-top) !important;
  bottom:auto !important;
  display:flex !important;
  flex-direction:column !important;
  align-items:center !important;
}
body:has(#gameBoard) #myLeftDiscard,
body:has(#gameBoard) #myRightDiscard{
  top:auto !important;
  bottom:var(--lane-bottom) !important;
  height:auto !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  background:transparent !important;
  border:0 !important;
  box-shadow:none !important;
  padding:0 !important;
}
body:has(#gameBoard) .player-name,
body:has(#gameBoard) .player-meta{
  max-width:132px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
body:has(#gameBoard) #scoreboard,
body:has(#gameBoard) .game-status-panel,
body:has(#gameBoard) .radio-dock{
  overflow:auto;
  max-width:min(280px, calc(100vw - 24px));
}

@media (max-width:1100px){
  body:has(#gameBoard){--rack-half:min(330px, 31vw)}
  body:has(#gameBoard) .table-center{
    width:calc(100vw - 16px) !important;
    height:calc(100vh - 12px) !important;
    padding:18px 16px 168px !important;
    border-radius:24px !important;
  }
  body:has(#gameBoard) .cue-row{gap:4px !important}
  body:has(#gameBoard) .tile-slot{
    flex-basis:44px !important;
    width:44px !important;
    min-width:44px !important;
    max-width:44px !important;
    height:64px !important;
  }
  body:has(#gameBoard) .tile-slot .tile-sprite{
    width:38px !important;
    height:52px !important;
  }
  body:has(#gameBoard) .voice-dock{
    width:160px !important;
    left:8px !important;
    bottom:8px !important;
    z-index:20 !important;
  }
  body:has(#gameBoard) #sortPairsBtn,
  body:has(#gameBoard) #sortSeriesBtn{
    width:72px !important;
    max-width:72px !important;
    height:58px !important;
    bottom:calc(12vh + 78px) !important;
  }
  body:has(#gameBoard) #openPairsBtn,
  body:has(#gameBoard) #openHandBtn{bottom:calc(12vh + 8px) !important}
  body:has(#gameBoard) #processTileBtn{bottom:calc(12vh + 168px) !important}
  body:has(#gameBoard) #swapOkeyBtn{bottom:calc(12vh + 216px) !important}
  body:has(#gameBoard) #showIndicatorBtn{bottom:calc(12vh + 256px) !important}
  body:has(#gameBoard) #returnTileBtn{bottom:calc(12vh + 296px) !important}
}
