/* The view from the player's chair. Keep the scenery in the room, not on the felt. */
body[data-screen="game"] { --poker-edge: clamp(9px,1.35vw,24px); background:#19241e; }
body[data-screen="game"]::before { background: #202b25 url('/lodge.jpg') 58% 45% / cover no-repeat; filter: saturate(.85) brightness(.9); }
body[data-screen="game"]::after { content:''; background:linear-gradient(180deg,#1117103c 0%,#12181236 39%,#1117107f 76%,#111710eb 100%); }
body[data-screen="game"] .site-header { background:linear-gradient(#181b14c7,#181b141b); box-shadow:none; }
body[data-screen="game"] .brand { color:#f4ecd9; }
body[data-screen="game"] .brand-seal { color:#d4bb90; }
body[data-screen="game"] .brand-ko { font:650 clamp(17px,1.7vw,23px)/1 var(--serif); }
body[data-screen="game"] .header-tools :is(.hu-guide-button,#admin-open,#invite) { color:#eee3cd; text-shadow:0 1px 3px #181810; }

.game {
  --card-width: clamp(47px,min(8.5vw,12svh),151px);
  --own-card-width: clamp(49px,min(6vw,10svh),104px);
  --seat-card-width: clamp(25px,min(3.45vw,7.4svh),68px);
  --rack-width: clamp(370px,41vw,570px);
  --layout-top: clamp(41px,7.4svh,94px);
  --layout-bottom: max(10px,env(safe-area-inset-bottom));
  --hero-stacks: clamp(94px,13vw,180px);
  --linen:#f7efdc;
  --poker-muted:#e2dfd2;
  width:100%; max-width: none; justify-items:center; align-content:start;
  padding-inline: max(0px, env(safe-area-inset-left), env(safe-area-inset-right));
}
.game .table {
  --rail:clamp(12px,1.8vw,38px); --curve:48% / 40%; --board-y:43%;
  width:min(96%,2300px); height:clamp(278px,64svh,950px);
  border-color:#745742;
  background:var(--wood-grain) center / 520px 220px, linear-gradient(165deg,#725644,#4e382d 49%,#32251f);
  background-blend-mode:soft-light,normal;
  box-shadow:inset 0 1px 1px #e0b58a42,inset 0 -4px 3px #251a15,0 4px #281e18,0 15px 28px #0c110cc2;
}
.game .table::before {
  inset:var(--rail) var(--rail) calc(var(--rail) * 1.5);
  border-color:#1d3328;
  background:var(--felt-grain) center / 120px 120px,radial-gradient(ellipse at 48% 35%,#37664e,#2b503e 68%,#214033);
  box-shadow:0 1px 1px #a77e594a,inset 0 2px 9px #111d16ad;
}
.game .table::after { display:none; }
.game .table:has(.table-outcome:not(:empty)) { --board-y:45%; }
.game .table-meta { z-index:6; right:var(--game-gutter); color:#e8dfcc; text-shadow:0 1px 4px #131912; }
.game .table-meta .meta-blinds { color:#f2e8d3; }
.game .poker-tools { z-index:6; left:var(--game-gutter); flex-direction:row; }
.game .poker-tools :is(#table-options,#away-toggle,#stand-toggle) { background:#261f18e8; color:#efe7d0; border-color:#b8986f55; }

.game .seat.pos0 { --seat-y:90%; }
.game .seat.pos1 { --seat-x:20%; --seat-y:82%; }
.game .seat.pos2 { --seat-x:9%; --seat-y:63%; }
.game .seat.pos3 { --seat-x:9%; --seat-y:34%; }
.game .seat.pos4 { --seat-x:22%; --seat-y:13%; }
.game .seat.pos5 { --seat-y:4%; }
.game .seat.pos6 { --seat-x:78%; --seat-y:13%; }
.game .seat.pos7 { --seat-x:91%; --seat-y:34%; }
.game .seat.pos8 { --seat-x:91%; --seat-y:63%; }
.game .seat.pos9 { --seat-x:80%; --seat-y:82%; }
.game .seat:not(.own) { --identity-width:clamp(57px,6vw,132px); --plaque-gap:5px; }
.game .seat:not(.own) .seat-identity { background:#232c247a; border-color:#bcb5994f; }
.game .seat:not(.own).acting .seat-identity { background:#f0ead7; border-color:#f3ead2; color:#20291e; box-shadow:0 0 12px #eadbb34d; }
.game .seat:not(.own) .player-name { font-size:clamp(10px,1.14vw,19px); }
.game .seat:not(.own) .stack { font-size:clamp(12px,1.3vw,22px); }
.game .seat:not(.own) .last-action { white-space:nowrap; }

.game .seat.own.pos0 {
  --hero-pocket:calc(var(--own-card-width) * 1.82);
  --hero-gap:clamp(4px,1.25vw,20px);
  --hero-span: min(calc(100vw - 34px),calc(var(--hero-pocket) + 2 * var(--hero-stacks) + 2 * var(--hero-gap)));
  width:var(--hero-span); min-height:0;
  grid-template-columns:minmax(0,1fr) var(--hero-pocket) minmax(0,1fr);
  grid-template-rows:auto; align-items:center; gap:0 var(--hero-gap);
  z-index:4;
}
.game .seat.own .pocket { grid-area:1 / 2; max-width:none; z-index:2; align-self:center; }
.game .seat.own .pocket .card { --w:var(--own-card-width); width:var(--w); }
.game .seat.own .pocket .card:nth-child(1):not(.empty) { transform:rotate(-4deg); }
.game .seat.own .pocket .card:nth-child(2):not(.empty) { transform:rotate(4deg); }
.game .seat.own.acting .pocket > .card:not(.empty) { outline:1px solid #e9c98f; outline-offset:2px; }
.game .seat.own .seat-identity, .game .seat.own.acting .seat-identity {
  grid-area:1 / 1; justify-self:end; width:auto; max-width:100%; min-width:0; min-height:0;
  padding:5px 7px; gap:2px; border:0; border-radius:0;
  background:none; box-shadow:none; color:#fff0d4; text-shadow:0 1px 3px #151a13;
}
.game .seat.own .player-name {
  grid-area:2 / 1; max-width:100%; text-align:right;
  font:680 clamp(12px,1.35vw,21px)/1.15 var(--sans);
  white-space:normal; overflow:visible; overflow-wrap:anywhere; text-overflow:clip;
}
.game .seat.own .hero-seat-tag {
  grid-area:1 / 1; display:flex; align-items:center; justify-content:flex-end; gap:4px;
}
.game .seat.own .seat-you { color:#e4d4b4; font:650 10px/1.1 var(--sans); }
.game .seat.own .turn-track { position:static; grid-area:4 / 1; width:100%; min-width:25px; margin:2px 0 0; border-radius:4px; background:#172b227a; }
.game .seat.own .dealer-mark { position:static; inset:auto; width:15px; aspect-ratio:1; font-size:9px; }
.game .seat.own .hero-bank {
  grid-area:1 / 3; align-self:center; display:grid; gap:5px;
  min-width:0; margin:0; color:#fff6e5; text-shadow:0 1px 3px #142018;
}
.game .seat.own .hero-bank-copy { display:flex; flex-wrap:wrap; gap:1px 6px; align-items:baseline; min-width:0; }
.game .hero-bank-copy dt { color:#eee0c7; font:630 clamp(10px,1.04vw,14px)/1.2 var(--sans); white-space:nowrap; }
.game .hero-bank-copy dd { margin:0; min-width:0; max-width:100%; overflow-wrap:anywhere; font:800 clamp(15px,1.85vw,25px)/1.08 var(--sans); font-variant-numeric:tabular-nums; }
.game .hero-wager dd { color:#f7ddb2; }
.game .seat.own .hand-caption { position:static; grid-area:3 / 1; justify-self:end; width:auto; max-width:100%; padding:0; transform:none; background:none; text-shadow:0 1px 2px #142018; text-align:right; }
.game .seat.own .hand-caption .hu-hand { text-align:right; font-size:clamp(10px,1vw,14px); overflow-wrap:anywhere; }
.game .seat.own .hand-caption .hu-hand-detail { display:inline; }
.game .seat.own .last-action { display:none; }

.game .table .pot { gap:7px; margin-bottom:clamp(7px,1vw,15px); border-color:#cfb3814a; border-radius:5px; background:#172c2380; box-shadow:none; }
.game .pot-label { white-space:nowrap; }

.game .controls { justify-self:center; justify-items:center; align-self:start; margin:8px auto 0; padding:0; z-index:5; text-align:center; gap:5px; }
.game .decision-heading,.game .turn-copy { justify-content:center; min-height:20px; color:#efe7d4; font-size:clamp(12px,1.16vw,17px); text-shadow:0 1px 3px #171c15; }
.game .controls.controls-active .decision-heading { color:#ffe7b7; }
.game .action-row { justify-content:center; }
.game .action-row > .btn { min-height:clamp(45px,4.1vw,60px); }
.game .controls .btn { background:#262a23; color:#f1e9d8; border:1px solid #b6a68b70; border-bottom:2px solid #181a15; border-radius:5px; }
.game .controls .btn.primary { border:1px solid #ded6bc; border-bottom:2px solid #9c957b; background:#ede4cd; color:#242820; }
.game .controls .btn[data-action="toggleRaise"]:not(:disabled),.game .controls .btn[data-action="allin"]:not(:disabled) { border-color:#9dbba0a6; background:#294236; color:#f7ebd5; }
.game .controls-waiting .action-row .btn:disabled { opacity:.57; background:#222920; color:#ddd6c3; }
.game .controls:has(.raise-panel) > .action-row, .game .raise-panel { grid-row:auto; }
.game .controls .raise-panel { width:100%; justify-content:center; background:#252d25; }
.game .controls .raise-panel .bet-shortcuts,.game .controls .raise-panel .raise-entry { justify-content:center; }

@media (min-width:901px) and (max-height:620px) {
  .game { --layout-top:39px; --own-card-width:clamp(29px,9svh,54px); --card-width:clamp(35px,12svh,70px); }
  .game .table { height:clamp(315px,64svh,400px); }
}
@media (max-width:650px), (max-width:900px) and (orientation:portrait) {
  body[data-screen="game"]::before { background-position:66% 44%; }
  .game { --layout-top:48px; --own-card-width:clamp(39px,12.8vw,78px); --seat-card-width:clamp(17px,5.4vw,36px); --card-width:clamp(36px,12vw,70px); --rack-width:440px; --hero-stacks:clamp(70px,23vw,145px); }
  .game .table { --rail:clamp(9px,2.7vw,19px); --curve:49% / 33%; --board-y:46%; width:calc(100% - 12px); height:clamp(331px,calc(100svh - 211px),725px); }
  .game .table:has(.table-outcome:not(:empty)) { --board-y:46%; }
  .game .seat:not(.own) { --identity-width:clamp(43px,12.8vw,81px); --plaque-gap:3px; }
  .game .seat:is(.pos2,.pos3,.pos7,.pos8):not(.own) { --identity-width:clamp(43px,12.8vw,81px); }
  .game .seat.pos0 { --seat-y:92%; }
  .game .seat.pos1 { --seat-x:15%; --seat-y:77.5%; }
  .game .seat.pos2 { --seat-x:14%; --seat-y:64%; }
  .game .seat.pos3 { --seat-x:14%; --seat-y:29.5%; }
  .game .seat.pos4 { --seat-x:21%; --seat-y:15.5%; }
  .game .seat.pos5 { --seat-y:5.5%; }
  .game .seat.pos6 { --seat-x:79%; --seat-y:15.5%; }
  .game .seat.pos7 { --seat-x:86%; --seat-y:29.5%; }
  .game .seat.pos8 { --seat-x:86%; --seat-y:64%; }
  .game .seat.pos9 { --seat-x:85%; --seat-y:77.5%; }
  .game .seat:not(.own) .stack { font-size:clamp(11px,3.1vw,16px); }
    .game .controls { width:min(calc(100% - 22px),var(--rack-width)); margin-top:3px; z-index:5; }
  .game .controls .btn { min-height:44px; }
  .game .controls .decision-heading { min-height:19px; }
  .game .poker-tools { top:2px; }
  .game .poker-tools :is(#table-options,#away-toggle,#stand-toggle) { min-height:41px; }
  .game .table-meta { top:8px; }
}
@media (max-width:390px) {
  .game .seat.own.pos0 { --hero-gap:4px; }
  .game .seat.own .seat-identity { padding-inline:3px; }
}
@media (min-width:901px) and (max-width:1110px) {
  .pd-dock { width:min(205px,22vw); }
}

/* The name has the full plaque width. Opponent cards sit on their own line. */
.game .table .seat[data-seat]:not(.own) {
  --name-width:clamp(110px,12vw,175px);
  --opp-card:clamp(20px,2.8vw,47px);
  width:var(--name-width); min-height:0;
  grid-template-columns:minmax(0,1fr); grid-template-rows:auto;
}
.game .table .seat[data-seat]:not(.own) .pocket {
  position:absolute; grid-area:auto; bottom:calc(100% - 3px); left:50%;
  width:max-content; transform:translateX(-50%); opacity:1; pointer-events:none;
}
.game .table .seat[data-seat]:not(.own) .pocket:empty { display:none; }
.game .table .seat[data-seat]:not(.own) .pocket .card { --w:var(--opp-card); width:var(--w); }
.game .table .seat[data-seat]:not(.own) .pocket .card + .card { margin-left:calc(var(--opp-card)*-.23); }
.game .table .seat[data-seat]:not(.own).folded .pocket { opacity:.43; }
.game .table .seat[data-seat]:not(.own) .seat-identity {
  grid-area:1 / 1; width:100%; min-height:0; padding:3px 4px 4px;
  gap:1px; border-radius:4px; border-color:#a9a68858; background:#1b281fe8;
  text-align:center; justify-items:center; color:#f9f4e7;
}
.game .table .seat[data-seat]:not(.own).acting .seat-identity {
  background:#eee7d5; color:#272c21; border-color:#e7d4a4; box-shadow:0 1px 7px #191b15aa;
}
.game .table .seat[data-seat]:not(.own).acting .turn-track { bottom:0; height:2px; }
.game .table .seat[data-seat]:not(.own) .player-name {
  align-self:center; display:grid; align-content:center; min-height:2.16em; overflow:visible;
  color:inherit; font:700 clamp(13px,1.21vw,19px)/1.08 var(--sans);
  letter-spacing:-.02em; text-align:center; white-space:normal;
  overflow-wrap:anywhere; word-break:normal; text-overflow:clip;
}
.game .table .seat[data-seat]:not(.own) .seat-money { grid-area:2 / 1; display:flex; gap:4px; align-items:baseline; justify-content:center; max-width:100%; }
.game .table .seat[data-seat]:not(.own) .stack { width:auto; color:inherit; font:630 clamp(11px,1.06vw,16px)/1.12 var(--sans); }
.game .seat-status { color:#ddd8be; font:630 10px/1.05 var(--sans); white-space:nowrap; }
.game .seat.acting .seat-status { color:#4b5240; }
.game .table .seat[data-seat]:not(.own) .dealer-mark { inset:auto auto -8px -5px; width:16px; font-size:10px; }
.game .table .seat[data-seat]:not(.own).folded .player-name { color:inherit; }
.game .opponent-bet-row { grid-area:3 / 1; min-height:1.2em; font:700 clamp(10px,1.04vw,14px)/1.12 var(--sans); }
.game .opponent-bet { display:inline-block; max-width:100%; padding:1px 5px; border-radius:3px; background:#111d16; color:#f6dcad; overflow-wrap:anywhere; font-variant-numeric:tabular-nums; }
.game .seat-status.motion-action-on,.game .hero-wager.motion-action-on,.game .hero-seat-tag.motion-action-on { animation:seat-action-ink 600ms ease-out var(--action-delay,0ms) both; }
@keyframes seat-action-ink { 0%,100% { filter:none; } 35% { filter:brightness(1.3); } }
@media (prefers-reduced-motion:reduce) { .game .seat .motion-action-on { animation:none; } }

.game .controls-waiting .decision-heading { min-height:44px; }
.game .call-short { font-size:.72em; }
.game .bet-editor {
  width:100%; display:grid; gap:4px; padding:5px 7px 7px;
  border:1px solid #b6a68b55; border-radius:5px; background:#202820;
  color:#efe8d8; text-align:left; box-sizing:border-box;
}
.game .bet-sizing { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:6px; min-width:0; }
.game .bet-stepper { display:grid; grid-template-columns:38px minmax(0,1fr) 38px; gap:2px; min-width:0; }
.game .bet-stepper label { display:flex; gap:4px; justify-content:center; align-items:center; white-space:nowrap; font-size:11px; color:#e1d6bf; min-width:0; }
.game .bet-stepper input { color:#fff5e0; width:min(100%,6em); min-width:0; min-height:38px; margin:0; padding:3px 4px; border:0; border-bottom:1px solid #9c9e82; border-radius:0; background:#101a13; text-align:center; font:750 16px/1.2 var(--sans); font-variant-numeric:tabular-nums; }
.game .bet-stepper input[aria-invalid="true"] { border-color:#e1a99b; }
.game .bet-stepper button,.game .bet-presets button,.game .bet-back { min-height:38px; min-width:0; padding:3px 5px; color:#f1e8d4; border:1px solid #a89e825e; border-radius:3px; background:transparent; font:620 13px/1.15 var(--sans); cursor:pointer; white-space:nowrap; }
.game .bet-stepper button { font-size:18px; }
.game .bet-presets { display:flex; gap:3px; flex-wrap:nowrap; }
.game .bet-presets button { min-width:36px; }
.game .bet-back { min-width:51px; }
.game .bet-editor button:disabled { opacity:.55; cursor:default; }
.game .bet-editor input[type="range"] { width:100%; min-height:26px; height:26px; margin:0; padding:0; accent-color:#ded3b6; cursor:ew-resize; }
.game .bet-commit { display:grid; grid-template-columns:auto minmax(0,1fr); align-items:stretch; gap:7px; }
.game .bet-summary { display:grid; grid-template-columns:minmax(0,1fr); gap:2px; justify-items:stretch; }
.game .bet-summary [data-bet-delta] { text-align:right; font:550 11px/1.15 var(--sans); color:#e5d9bf; min-height:13px; }
.game .bet-summary .btn { width:100%; min-height:42px; padding:4px 8px; font-size:15px; white-space:nowrap; }
.game .bet-editor:has(.bet-sizing) .bet-back { margin-top:15px; }
@media (max-width:650px), (max-width:900px) and (orientation:portrait) {
  .game .table .seat[data-seat]:not(.own) { --name-width:clamp(86px,24.5vw,120px); --opp-card:clamp(15px,4.85vw,29px); }
  .game .table .seat[data-seat]:not(.own) .seat-identity { padding-inline:2px; }
  .game .table .seat[data-seat]:not(.own) .player-name { font-size:12px; }
  .game .table .seat.pos5:not(.own) { --seat-y:6%; }
  .game .table .seat:is(.pos1,.pos9):not(.own) { --seat-y:77%; }
  .game .table .seat:is(.pos2,.pos8):not(.own) { --seat-y:63%; }
  .game .table .seat.pos1,.game .table .seat.pos2 { --seat-x:15%; }
  .game .table .seat.pos8,.game .table .seat.pos9 { --seat-x:85%; }
  .game .table .seat:is(.pos3,.pos7):not(.own) { --seat-y:32%; }
  .game .table .seat.pos3 { --seat-x:15%; }
  .game .table .seat.pos7 { --seat-x:85%; }
  .game .table .seat:is(.pos4,.pos6):not(.own) { --seat-y:17.25%; }
  .game .table .seat.pos4 { --seat-x:17%; }
  .game .table .seat.pos6 { --seat-x:83%; }
  .game .bet-stepper { grid-template-columns:35px minmax(0,1fr) 35px; }
}
@media (max-width:360px) {
  .game { --layout-top:62px; }
  .game .table { --board-y:42%; min-height:490px; }
  .game .table:has(.table-outcome:not(:empty)) { --board-y:47%; }
  .game .table-outcome { width:min(100%,52vw); margin-inline:auto; overflow-wrap:anywhere; }
  .game .table .seat:is(.pos1,.pos9):not(.own) { --seat-y:78%; }
  .game .table .seat:is(.pos2,.pos8):not(.own) { --seat-y:64%; }
  .game .table .seat[data-seat]:not(.own) { --name-width:85px; }
  .game .table .seat[data-seat]:not(.own) .player-name { font-size:11.5px; }
  .game .bet-sizing { gap:4px; }
  .game .bet-presets { gap:2px; }
  .game .bet-presets button { min-width:31px; font-size:11px; }
}
