/* The same four materials are used in the hand, on the felt and in flight. */
:root {
  --hs-face: url('../../assets/hit-stay/card-face.webp');
  --hs-back: url('../../assets/hit-stay/card-back.webp');
  --hs-chip: url('../../assets/hit-stay/chip.webp');
  --hs-felt: url('../../assets/hit-stay/table.webp');
}
.poker-stage { aspect-ratio: auto; margin-block: 0; padding-bottom: clamp(32px,6vw,42px); }
.poker-field {
  --felt-inset: 12.7cqw;
  --profile-radius: 47cqw;
  --hand-radius: 25.2cqw;
  position: relative;
  aspect-ratio: 1;
}
.felt-ring {
  inset: var(--felt-inset) var(--felt-inset) auto; aspect-ratio: 1;
  border: 0; outline: 0; border-radius: 0; box-shadow: none;
  background: var(--hs-felt) center / contain no-repeat;
  background-blend-mode: normal;
}
.table-deck {
  position: absolute; left: 50%; top: calc(var(--felt-inset) - clamp(7px,1.65cqw,13px));
  translate: -50% -100%; rotate: -7deg;
  width: 5%; aspect-ratio: 2 / 3; border-radius: 2px; background: #204034 var(--hs-back) center / 100% 100%;
  box-shadow: 1px 1px #d3c1a0,2px 2px #405044,3px 3px #c2b18f,4px 5px 4px #101a1280;
}
.poker-stage:is([data-phase="rank"],[data-phase="finished"]) .table-deck { opacity: 0; }
.poker-seat {
  --profile-x: calc(50cqw + var(--seat-x) * var(--profile-radius));
  --profile-y: calc(50cqw + var(--seat-y) * var(--profile-radius));
  --hand-x: calc(50cqw + var(--seat-x) * var(--hand-radius));
  --hand-y: calc(50cqw + var(--seat-y) * var(--hand-radius));
  --portrait-size: clamp(30px,8.6cqw,58px);
  position: absolute; inset: 0; display: block; pointer-events: none;
  padding: 0; color: var(--ink);
}
.seat-link {
  position: absolute; left: var(--hand-x); top: var(--hand-y);
  width: calc(var(--profile-radius) - var(--hand-radius)); height: 1px;
  transform-origin: 0 50%; translate: 0 -50%; rotate: var(--seat-angle);
  background: linear-gradient(to right,transparent 18%,#c6ab737d 40%,#c6ab737d 73%,transparent 89%);
}
.poker-seat.dimmed .seat-link { opacity: .4; }
.seat-profile,.seat-holding { position: absolute; translate: -50% -50%; display: grid; justify-items: center; }
.seat-profile {
  left: var(--profile-x); top: var(--profile-y);
  width: clamp(52px,16cqw,108px); gap: 3px;
}
.first-mark[hidden] { display: none; }
.poker-seat .first-mark { bottom: auto; top: clamp(17px,3.3cqw,23px); left: 0; translate: none; padding-inline: 1px; background: none; }
.poker-seat .identity { flex-direction: column; gap: 2px; min-width: 0; width: 100%; }
.poker-seat .identity img { width: min(100%,var(--portrait-size)); height: var(--portrait-size); }
.poker-seat.acting .identity img { filter: drop-shadow(0 1px 2px #f4d391) drop-shadow(0 0 2px #e7bb6d); }
.poker-seat.acting .identity-name b { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
.poker-seat .identity-text {
  width: 100%; min-width: 0; grid-template-rows: auto 13px; justify-items: center; gap: 2px;
}
.poker-seat .identity-name { max-width: 100%; min-width: 0; gap: 2px; font-size: clamp(10px,2.3cqw,15px); }
.poker-seat .identity-name b,.ledger-table th[scope="row"] { overflow: hidden; text-overflow: ellipsis; }
.poker-seat .identity-name small { font-size: clamp(8px,1.6cqw,10px); }
.poker-seat :is(.stay-tag,.fold-tag) { font-size: clamp(8px,1.85cqw,11px); }
.seat-holding { left: var(--hand-x); top: var(--hand-y); gap: clamp(3px,.65cqw,6px); }
.poker-seat .seat-money { justify-self: center; font-size: clamp(11px,2.45cqw,16px); }
.poker-seat .seat-handline,.overflow-cards {
  --card-width: min(4.62cqw,34px);
  display: grid; grid-template-columns: repeat(4,var(--card-width));
  gap: clamp(1px,.45cqw,3px); align-items: start; overflow: visible;
}
.seat-handline:not(:has(.hc:nth-child(4))) { grid-template-columns: repeat(3,var(--card-width)); }
:is(.seat-handline,.overflow-cards) .hc {
  width: 100%; height: auto; aspect-ratio: 2 / 3;
  font-size: clamp(11px,3.1cqw,23px);
}
.seat-wager {
  display: inline-flex; align-items: center;
  padding: 1px clamp(3px,.75cqw,6px);
  border: 1px solid #ab9565; border-radius: 20px;
  background: #18392b; color: #ffe5aa;
  font: 650 clamp(10px,2.3cqw,16px)/1.3 var(--num);
}
.seat-wager[hidden] { display: none; }
.seat-wager.dimmed { opacity: .38; filter: grayscale(1); }
.poker-overflow { container-type: inline-size; grid-column: 1; display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,154px),1fr)); gap: 14px; }
.poker-overflow:not(:has(.seat-overflow:not([hidden]))) { display: none; }
.seat-overflow { min-width: 0; border-top: 1px solid var(--line); padding-block: 8px; }
.seat-overflow.dimmed { opacity: .4; filter: grayscale(1); }
.overflow-player { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 13px; }
.overflow-player img { width: 20px; height: 20px; object-fit: contain; flex: none; }
.overflow-player b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.overflow-player span { flex: none; color: var(--dim); font-size: 11px; }
.overflow-cards { --card-width: clamp(22px,4.62cqw,34px); }
.poker-stage:is([data-phase="rank"],[data-phase="finished"]) .first-mark { visibility: hidden; }
.poker-stage:is([data-phase="rank"],[data-phase="finished"]) .seat-holding { opacity: .32; }
.table-readout { position: absolute; inset: 0 0 auto; aspect-ratio: 1; pointer-events: none; }
.table-readout .rankings { z-index: 3; }
.table-readout .showdown { pointer-events: auto; }
.poker-center:not(.rankings) {
  inset: 0; width: auto; transform: none;
  display: block; pointer-events: none;
}
.poker-center:not(.rankings) > :is(.round-limit,.poker-moment,.pot-label) {
  position: absolute; left: 50%; translate: -50% -50%;
}
.poker-center:not(.rankings) .round-limit { flex-direction: column; align-items: center; gap: 0; top: 42%; }
.poker-center .poker-moment { top: 54%; }
.poker-center .pot-label { top: 59.5%; white-space: nowrap; }
.showdown { justify-content: safe center; }
.show-seat {
  display: grid;
  grid-template-columns: 1.25em minmax(0,clamp(72px,28cqw,160px)) minmax(0,1fr) clamp(48px,14cqw,92px);
}
.show-hand {
  display: grid; grid-template-columns: repeat(4,minmax(0,clamp(17px,4cqw,29px)));
  overflow: visible;
}
.show-hand .hc { width: 100%; height: auto; aspect-ratio: 2 / 3; }
.show-first { text-align: center; }
.show-seat .identity { min-width: 0; justify-content: flex-start; }
.show-seat .identity img { flex: none; }
.show-seat .identity-text,.show-seat .identity-name { min-width: 0; max-width: 100%; }
.show-seat .identity-name b { overflow: hidden; text-overflow: ellipsis; }
.show-result { display: grid; justify-items: end; gap: 1px; text-align: end; white-space: nowrap; }
.poker-layout { align-items: start; row-gap: 12px; }
.move-panel { align-self: start; margin-top: clamp(20px,7vw,112px); }
.move-copy h2,.move-copy .turn-prompt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.move-copy .turn-prompt { min-height: 1.6em; }
.move-copy .is-my-turn { color: var(--gold); font-weight: 650; }
.move-controls { display: flow-root; min-height: 211px; }
.move-controls > .primary { margin-top: 14px; }
html:has(.poker-layout) { scrollbar-gutter: stable; }
@media (max-width:800px) {
  .move-panel { margin-top: 12px; }
  .poker-overflow { max-width: 520px; margin: 14px auto 0; }
}
.hc,.hc.private,.hc.public,.hc.hit-card {
  background: #f3e4c5 var(--hs-face) center / 100% 100% no-repeat;
  border: 1px solid #bea77c; border-radius: 3px; color: #312a21;
  box-shadow: 0 1px 1px #100f0c66; font-variant-numeric: lining-nums tabular-nums;
}
.hc.private { border-color: #c5bc9f; }
.hc.public { border-bottom: 3px solid #587b62; }
.hc.hit-card { border-bottom: 3px solid #b56d55; }
.hc.minus { color: #873c2c; }
.hc.card-back {
  background: #143528 var(--hs-back) center / 100% 100% no-repeat;
  border: 1px solid #cfba8c; box-shadow: 0 1px 1px #100f0c66;
}
.chip-value i,.flying-chip,.chip-inlay {
  background: var(--hs-chip) center / contain no-repeat; border: 0; box-shadow: none;
  border-radius: 0; height: 17px; width: 17px; flex: none;
}
.pot-label .chip-value i { width: clamp(17px,3.5cqw,25px); height: clamp(17px,3.5cqw,25px); }
.flying-chip { width: 24px; height: 24px; }

/* A hand of upright paper cards. The hit target moves with the printed sheet. */
.open-options { justify-content: center; align-items: end; gap: clamp(4px,1.1vw,15px); padding: 12px 6px 9px; }
.btn.pick-card {
  display: grid; place-items: center; position: relative; padding: 0; min-height: 0;
  grid-template: minmax(0,1fr) / minmax(0,1fr);
  width: min(29%,110px); aspect-ratio: 2 / 3; border: 0; background: transparent;
  transform-origin: 50% 95%; rotate: var(--fan,0deg); isolation: isolate;
}
.pick-card:first-child { --fan: -6deg; }.pick-card:last-child { --fan: 6deg; }
.pick-card:nth-child(2) { margin-bottom: 5px; }
.pick-card .hand-print {
  position: relative; height: 100%; width: 100%; border: 0; border-radius: 5px; pointer-events: none;
  font: 500 clamp(36px,4.5vw,64px)/1 Georgia,var(--serif);
  box-shadow: 0 1px 0 #c5b18a,0 2px 0 #a59270,0 5px 8px #080d0970;
}
.hand-print::before,.hand-print::after {
  content: attr(data-rank); position: absolute; font: 600 clamp(12px,1.35vw,18px)/1 Georgia,serif;
}
.hand-print::before { left: 10%; top: 8%; }
.hand-print::after { right: 10%; bottom: 8%; rotate: 180deg; }
.pick-card:focus-visible { outline-offset: 6px; }
.pick-card:disabled { opacity: .57; }
.pick-card.chosen { opacity: 1; translate: 0 -5px; }
.paper-band { position: absolute; bottom: 13%; background: #244535; color: #fff2d6; padding: 2px 6px; font-size: 12px; }
@media (hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference) {
  .pick-card:not(:disabled):hover,.pick-card:focus-visible { translate: 0 -6px; }
}

/* Lettering carries the action identity on both the controller and the table. */
.action-word {
  color: var(--word-color,var(--ink)); display: inline-block; white-space: nowrap;
  font: 700 clamp(18px,2.1vw,30px)/1.1 Georgia,var(--serif);
  font-variant-numeric: lining-nums; letter-spacing: -.035em;
}
.word-hit { --word-color: #ffac95; font-style: italic; letter-spacing: -.065em; }
.word-call { --word-color: #aad8ec; font-family: var(--sans); font-weight: 650; letter-spacing: .07em; }
.word-stay { --word-color: #b1dfb6; letter-spacing: .08em; border-block: 1px solid currentColor; padding: .06em 0; }
.word-fold { --word-color: #b9c0b8; font: 550 clamp(17px,1.7vw,25px)/1.2 var(--num); letter-spacing: .04em; }
.word-raise,.word-bet { --word-color: #f0ce88; }
.word-raise { font-weight: 800; font-style: italic; text-decoration: underline double; text-underline-offset: .09em; text-decoration-thickness: 1px; }
.decision { display: grid; place-items: center; gap: 1px; }
.decision .action-word { font-size: clamp(19px,5.3cqw,37px); }
.decision small { display: flex; align-items: center; gap: 4px; font: 600 clamp(10px,2.45cqw,14px)/1.1 var(--sans); }
.move-card { padding: 10px 5px; }
.move-card small { color: #d8dbce; font-variant-numeric: tabular-nums; }
.draw-options .move-card { justify-content: center; gap: 7px; }
.bet-options { display: grid; gap: 12px; }
.stake-rail { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-block: 1px 4px; }
.stake-caption { display: grid; gap: 2px; font-weight: 650; }
.stake-caption small { color: var(--dim); font-size: 12px; font-weight: 450; }
.stake-limits { display: flex; flex-wrap: wrap; gap: 1px 8px; }
.stake-limits > span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.stake-limits .chip-value i { width: 12px; height: 12px; }
.stake-controls { display: flex; align-items: center; gap: 7px; }
.stake-chip { width: clamp(23px,3vw,34px); height: auto; flex: none; object-fit: contain; }
.chip-stepper { display: grid; grid-template-columns: 44px minmax(40px,55px) 44px; align-items: stretch; background: #101813; border: 1px solid #69705d; border-radius: 4px; }
.chip-stepper .chip-step { min-height: 44px; border: 0; padding: 0; }
.chip-stepper .chip-step:enabled:hover img { filter: brightness(1.18); }
.chip-stepper .chip-step:enabled:active { background: #28382e; }
.chip-stepper input { appearance: textfield; -moz-appearance: textfield; font: 600 20px var(--num); width: 100%; min-width: 0; text-align: center; padding: 0; border: 0; border-inline: 1px solid var(--line); background: transparent; color: var(--ink); }
.chip-stepper input::-webkit-inner-spin-button,.chip-stepper input::-webkit-outer-spin-button { -webkit-appearance: none; }
.bet-verbs { display: flex; gap: 6px; }
.bet-verbs .move-card { gap: 7px; min-width: 0; }
.bet-verbs .chip-count { font: 600 15px/1 var(--num); }
.bet-verbs .chip-value i { width: 16px; height: 16px; }
.move-card.bet,.move-card.raise { background: #343126; border-color: #9d8659; }
.move-card.call { background: #263735; border-color: #718b87; }
.move-card.fold { background: transparent; border-color: #60675d; }

/* A scorekeeper's slip lies on the felt, including at the final settlement. */
.score-paper {
  background: #eee3c9; color: #302d23; border: 1px solid #b79e71;
  border-radius: 2px; box-shadow: 1px 2px 0 #987e55,0 5px 10px #0b100f55;
}
.poker-center.rankings { width: 42%; padding: clamp(4px,1.25cqw,11px); gap: 0; top: 49%; }
.ledger-head,.rankings>.ledger-head { display: flex; justify-content: space-between; align-items: center; width: 100%; gap: 4px; padding-bottom: 4px; }
.ledger-head>strong { font: 650 clamp(12px,3.1cqw,22px)/1.1 var(--serif); }
.rankings .round-limit { color: #76501c; gap: 3px; }
.rankings .round-limit span { font-size: clamp(10px,1.9cqw,13px); }
.rankings .round-limit strong { font-size: clamp(28px,6.3cqw,45px); }
.ledger-table { width: 100%; border-collapse: collapse; text-align: end; font-size: clamp(10px,2.5cqw,16px); font-variant-numeric: tabular-nums; line-height: 1.15; }
.ledger-table thead { color: #605646; border-block: 1px solid #978868; font-size: .82em; }
.ledger-table :is(th,td) { padding: clamp(1px,.42cqw,4px) 2px; white-space: nowrap; }
.ledger-table tr>*:first-child { text-align: center; width: 15%; }
.ledger-table tr>*:nth-child(2) { text-align: start; }
.ledger-table tbody tr+tr { border-top: 1px solid #c9bda1; }
.ledger-table .lead-score { background: #ded0a9; }
.ledger-table .gain { color: #245638; }.ledger-table .loss { color: #853e30; }.ledger-table .even { color: #716752; }
.ledger-table .ledger-me { color: #665a44; font: 500 .8em var(--sans); margin-left: 3px; }
.result .score-paper { margin-block: 20px; padding: 16px 20px; width: min(100%,420px); }
.result .ledger-table { font-size: 16px; }.result .ledger-table :is(th,td) { padding-block: 8px; }
@media (max-width:480px) {
  .poker-center.rankings { top: 50%; padding: 3px; }
  .ledger-head,.rankings>.ledger-head { padding-bottom: 1px; }
  .ledger-table :is(th,td) { padding: 1px; }
  .chip-value i { width: 12px; height: 12px; }
  .open-options { padding-top: 7px; gap: 7px; }
  .btn.pick-card { width: min(26%,79px); }
  .move-controls { min-height: 154px; }
}
@media (prefers-reduced-motion:reduce) {
  .pick-card,.pick-card.chosen { rotate: none; translate: none; }
}
.table-prop {
  position: fixed; z-index: 8; pointer-events: none; user-select: none; overflow: hidden;
  transform-origin: 0 0; will-change: transform,opacity;
}
.table-prop img { width: 100%; height: 100%; object-fit: contain; }
.prop-back,.prop-face { border-radius: 3px; box-shadow: 1px 3px 4px #13191155; }
.prop-back { background: #234032 var(--hs-back) center / 100% 100%; }
.prop-face { display: grid; place-items: center; background: #eadcc0 var(--hs-face) center / 100% 100%; color: #30291f; font: 550 clamp(32px,4.5vw,64px)/1 Georgia,serif; }
.prop-chip { background: var(--hs-chip) center / contain no-repeat; }
.prop-slip { background: #eee3c9; border: 1px solid #b79e71; padding: 5px; color: #302d23; }
.prop-slip .ledger-table { font-size: clamp(10px,1.1vw,16px); }
.ledger-table { table-layout: fixed; }
.ledger-table tr>*:nth-child(2) { width: 42%; }
.ledger-table td { font-family: var(--num); }
.round-receipt,.settlement-clock { display: flex; align-items: baseline; gap: 9px; padding-block: 10px; color: var(--dim); font-size: 14px; }
.round-receipt { border-block: 1px solid var(--line); margin-top: 18px; }
.round-receipt b { color: var(--ink); font: 600 29px/1 Georgia,var(--serif); }
.round-receipt small { color: var(--gold); }
.settlement-clock { justify-content: space-between; }
.settlement-clock .table-clock { color: var(--dim); font-size: 16px; }
@media (max-width:360px) {
  .poker-center.rankings { top: 52.5%; }
  .rankings .ledger-table :is(th,td) { padding-block: .5px; line-height: 1.1; }
}
.settlement-leaving { position: absolute; z-index: 5; inset: 0 0 auto; aspect-ratio: 1; pointer-events: none; }
.settlement-leaving .showdown { pointer-events: none; }
.printed-limit { display: inline-flex; align-items: baseline; gap: 6px; color: var(--gold); }
.printed-limit strong { font: 650 clamp(32px,9.7cqw,74px)/1 Georgia,serif; }
.prop-word { display: grid; place-items: center; white-space: nowrap; }
.prop-word .action-word { font-size: clamp(14px,1.7vw,25px); }
@media (prefers-reduced-motion:no-preference) {
  .poker-center .decision { animation: decision-press 1.5s both; }
  @keyframes decision-press {
    0% { opacity: 0; transform: translateY(-4px) scale(1.08); }
    13%,85% { opacity: 1; transform: none; }
    100% { opacity: 0; transform: translateY(2px); }
  }
}
