/* One continuous playing surface: seats and felt above a recessed player rail. */
body:has(#game:not([hidden])) .top{height:52px;max-width:1210px}
body:has(#game:not([hidden])) main{padding-bottom:0}
#game{max-width:1180px}
#game .game-top{margin:0 0 8px}
#game .game-nav button{min-height:32px;padding-block:4px}
#game .game-top h1{font-size:clamp(1.05rem,2.2vw,1.65rem)}
#game .table{
 --edge:clamp(9px,1.55vw,19px);--side-seat:clamp(76px,9vw,110px);
 --seat-row:36px;--felt-row:clamp(145px, calc(100svh - 430px), 335px);
 grid-template-rows:var(--seat-row) var(--felt-row) var(--seat-row) auto auto;
 gap:6px 10px;padding:var(--edge);
}
#game .table::before{inset:clamp(4px,.72vw,8px);background:
 repeating-linear-gradient(114deg,#ffffff06 0 1px,transparent 1px 4px),
 repeating-linear-gradient(30deg,#00000018 0 1px,transparent 1px 5px),
 radial-gradient(ellipse at 50% 36%,#235f4a,#134231 65%,#0d3226)}
#game .mat{padding:0 4px;min-height:0}
#game .mat-caption{padding-bottom:4px;margin:0}
#game .mat-caption h2{margin:0}
#game .table .groups{min-height:0;max-height:none;overflow:auto;gap:4px;padding-block:4px;overscroll-behavior:contain}
#game .meld-lane:not(.pending-lane){background:none;border-color:transparent;border-bottom-color:#a4c6a935;border-radius:0;padding-block:3px}
#game .meld-lane:not(.pending-lane) .lane-title{border-left:2px solid #82ad9c;padding-left:5px}
#game .meld-lane[data-team="0"] .lane-title{border-color:#83e3c6}
#game .meld-lane[data-team="1"] .lane-title{border-color:#e8b575}
#game .lane-tiles .meld:not(.target):not(.pending-meld){background:#081f1752;border-color:#bcd3b82b}

#game .table .opp{
 display:grid;grid-template-columns:25px minmax(0,auto);gap:1px 5px;
 text-align:left;padding:3px 6px;border-radius:9px;background:#112b23e6;
}
#game .table .opp .avatar{display:grid;width:24px;height:24px;font-size:.73rem}
#game .table .opp strong{font-size:.82rem;white-space:nowrap;line-height:1.14}
#game .table .opp small{text-align:left;font-size:.69rem;line-height:1.14}
#game .table .opp.active{background:#4a4931}
#game .seat-north,#game .seat-south{min-width:90px}
#game .seat-team{font-style:normal;font-size:.66em;color:#83e3c6;margin-right:.3em;vertical-align:.1em}
#game .team-1 .seat-team{color:#e8b575}
#game .team-tag i{background:none;width:auto;height:auto;color:#83e3c6;font-size:.76em;line-height:1;font-style:normal}
#game .team-tag.team-1 i{background:none;color:#e8b575}
#game .table .seat-discard{width:clamp(32px,4vw,47px);height:clamp(34px,4.2vw,49px)}
#game .table .seat-discard.vacant{opacity:.37}
#game .table .seat-discard.is-available{box-shadow:0 0 0 2px #f4ce87a8,0 0 12px #f8cc6a47}

#game .table .draw-station{
 grid-area:4/1/5/-1;justify-self:center;align-items:center;gap:7px;
 margin:0;padding:0 0 2px;border:0;
}
#game .table .draw-station>div{flex:none;width:auto}
#game .table .draw-station button,#game .table .draw-station .indbox{flex-direction:row;min-height:41px;padding:3px 9px;white-space:nowrap}

#game .play-panel{
 grid-area:5/1/6/-1;position:relative;z-index:2;min-width:0;margin:0;padding:6px 9px max(6px,env(safe-area-inset-bottom));
 border:1px solid #a57f4e8c;border-radius:11px;background:linear-gradient(#192f25,#13241d);
 box-shadow:inset 0 1px 2px #bd95653b,0 3px 5px #08171080;
}
#game .rack-head{min-height:18px;margin-bottom:4px}
#game .play-panel .rack{gap:clamp(3px,.62vw,8px);padding:6px;border-radius:7px}
#game .rack-toolbar{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:3px 8px;margin-top:5px}
#game .rack-toolbar .actions{justify-content:flex-end}
#game .rack-opening{grid-column:1/-1;margin:0;padding:0 2px;text-align:right}
#game .table-messages{margin:2px 0 0}
#game .status{border:0;background:none}
#game .rack-toolbar [data-a="discard"]:not(:disabled){background:#694443;border-color:#bc8179}

@media(max-width:640px){
 body:has(#game:not([hidden])) .top{height:42px}
 body:has(#game:not([hidden])) .top img{width:29px;height:29px}
 body:has(#game:not([hidden])) .top button{min-height:28px;font-size:.78rem;padding:3px 6px}
 #game .game-top{margin-bottom:4px}
 #game .table{
  --edge:6px;--side-seat:clamp(49px,13vw,68px);--seat-row:30px;
  --felt-row:clamp(117px,calc(100svh - 390px),225px);
  gap:4px 4px;border-radius:17px;
 }
 #game .mat{padding:0 1px}
 #game .opening-limit{font-size:0.66rem;padding:2px 3px}
 #game .mat-caption h2{font-size:.66rem;line-height:1.02}
 #game .table .opp{display:flex;flex-direction:row;flex-wrap:wrap;padding:2px 1px;gap:1px 2px;overflow:visible}
 #game .table .opp .avatar{width:14px;height:14px;font-size:.59rem}
 #game .table .opp strong{font-size:.63rem}
 #game .table .opp small{width:100%;font-size:.59rem;line-height:1.04;text-align:center}
 #game .table .opp .opening-credit{font-size:.53rem}
 #game .seat-north,#game .seat-south{min-width:74px}
 #game .table .seat-discard{padding:2px;border-radius:6px}
 #game .table .draw-station button,#game .table .draw-station .indbox{min-height:36px;padding:1px 7px}
 #game .play-panel{padding:5px 4px max(5px,env(safe-area-inset-bottom))}
 #game .play-panel .rack{gap:4px 2px;padding:4px}
 #game .rack-toolbar{grid-template-columns:1fr 1.12fr;gap:2px 4px}
 #game .rack-toolbar button{min-height:38px;padding-inline:5px}
}
@media(max-height:510px) and (orientation:landscape) and (min-width:641px){
 body:has(#game:not([hidden])) .top{height:34px}
 body:has(#game:not([hidden])) .top img{width:25px;height:25px}
 body:has(#game:not([hidden])) .top button{min-height:26px;padding-block:2px}
 #game .game-top{margin-bottom:4px}
 #game .table{--felt-row:clamp(98px,calc(100svh - 275px),190px);--edge:7px;--seat-row:30px;gap:3px}
 #game .table .draw-station button,#game .table .draw-station .indbox{min-height:33px}
 #game .play-panel .rack{grid-template-rows:repeat(2,35px);padding:3px}
 #game .rack .tile{font-size:1.22rem}
 #game .rack-toolbar button{min-height:30px}
}

@media(max-height:510px) and (orientation:landscape) and (min-width:720px){
 #game .table{
  --felt-row:clamp(102px,calc(100svh - 273px),205px);
  grid-template-rows:var(--seat-row) var(--felt-row) minmax(33px,auto) auto;
 }
 #game .table .draw-station{grid-area:3/1/4/-1;justify-self:end}
 #game .play-panel{grid-row:4}
}

#game .compact-rules{display:none}
@media(max-height:510px) and (orientation:landscape) and (min-width:720px){
 body:has(#game:not([hidden])) .top{display:none}
 #game{position:relative;padding:4px 0 0}
 #game .compact-rules{display:inline-block}
 #game .team-bar:not([hidden]){position:absolute;top:8px;left:50%;transform:translateX(-52%);justify-content:center;gap:3px;flex-wrap:nowrap;white-space:nowrap}
 #game .team-tag{font-size:.67rem;padding:3px 4px;gap:3px}
 #game .team-tag span{margin-left:0}
 #game .game-nav{gap:4px}
 #game .game-nav button{font-size:.76rem;min-height:27px;padding-inline:6px}
 #game .table{--felt-row:clamp(95px,calc(100svh - 272px),220px);--edge:6px}
 #game .table .draw-station .draw-deck,#game .table .draw-station .indbox{min-height:33px}
 #game .play-panel{padding-block:3px}
 #game .rack-head{margin-bottom:2px}
 #game .rack-toolbar{margin-top:3px}
 #game .rack-toolbar button{min-height:29px}
 #game .rack-opening,#game .status{line-height:1.18}
}
@media(max-height:510px) and (orientation:landscape) and (min-width:720px) and (max-width:800px){
 #game .team-tag b{font-size:.61rem}
 #game .team-bar:not([hidden]){transform:translateX(-56%)}
}

/* Pointer drag feedback is only shown for eligible per targets. */
#game #rack [data-t]{touch-action:none;cursor:grab;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
#game #rack .drag-origin{opacity:.45}
#game #rack .rack-slot.drop-hover{outline:2px solid #edcf8b;outline-offset:-1px}
#game .lane-tiles .meld.drop-option{border-color:#90f1ce;background:#21614c}
#game .lane-tiles .meld.drop-hover{outline:2px solid #b6ffe4;outline-offset:1px}
.tile-ghost{position:fixed;z-index:50;pointer-events:none;transform:translate(-50%,-60%);filter:drop-shadow(0 5px 5px #0008)}
.tile-ghost .tile{height:100%;padding:0;font-size:clamp(14px,4vw,28px);border-color:#a88d5b}
.tile-ghost .is-work{background:linear-gradient(160deg,#e0fff3,#94e1c7)}
