.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

.poker-top {
  display: grid; grid-template-columns: 62px minmax(0, 1fr) 62px; align-items: center; gap: 4px;
  max-width: 680px; margin: auto; padding: max(8px, env(safe-area-inset-top)) max(clamp(10px, 3vw, 21px), env(safe-area-inset-right)) 7px max(clamp(10px, 3vw, 21px), env(safe-area-inset-left));
}
.poker-title { min-width: 0; text-align: center; }
.poker-title h1 { font-size: clamp(1.25rem, 6vw, 1.75rem); line-height: 1.1; letter-spacing: -.035em; text-wrap: balance; }
.poker-title p { margin-top: 3px; color: var(--muted); font-size: .82rem; font-variant-numeric: tabular-nums; }
.poker-top-button {
  display: inline-flex; justify-content: center; align-items: center; gap: 4px; justify-self: start;
  min-width: 44px; min-height: 44px; padding: 5px 8px; color: #dae9dd; background: #1b2720; border-color: #33473b;
}
.poker-top-button:last-child { justify-self: end; }
.poker-top-button span { font-size: .68rem; font-weight: 700; }
.poker-top-button .ui-icon { width: 17px; height: 17px; }
.poker-top-button:first-child .ui-icon { width: 22px; height: 22px; }

.room-main.poker-room {
  --poker-gutter: clamp(10px, 3vw, 21px);
  max-width: 680px; min-height: calc(100svh - 62px); padding: 0 max(var(--poker-gutter), env(safe-area-inset-right)) 0 max(var(--poker-gutter), env(safe-area-inset-left));
  margin: auto; display: flex; flex-direction: column; gap: 9px;
}
.poker-room .connection { padding: 4px 8px; border-radius: 8px; background: #392e24; }
.poker-felt.table-stage {
  isolation: isolate; flex: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-areas: "north-west north north-east" "center center center" "south-west . south-east";
  grid-template-rows: minmax(68px, auto) 1fr auto; gap: 5px 6px; align-items: start; align-content: stretch;
  min-height: clamp(300px, 48svh, 440px); padding: 10px 9px 12px; border: 1px solid #314d40; border-radius: 23px;
  background: #18362a; box-shadow: inset 0 0 26px #080f0b80;
}
.poker-felt.table-stage::before { display: none; }
.poker-felt.has-lower-seats { min-height: clamp(302px, 49svh, 452px); padding-bottom: 9px; }
.poker-rail {
  position: absolute; z-index: -1; inset: 44px 10px 23px;
  border: 5px solid #234d3b; border-radius: 41% / 38%;
  background: #1f4b39;
  box-shadow: 0 0 0 1px #456a55, inset 0 0 0 1px #467058, 0 8px 16px #08181080;
}
.poker-rail::before { content: ""; position: absolute; inset: 8px; border: 1px solid #9ac7a643; border-radius: inherit; }
.has-lower-seats .poker-rail { bottom: 25px; }
.poker-slot-north-west { grid-area: north-west; }
.poker-slot-north { grid-area: north; }
.poker-slot-north-east { grid-area: north-east; }
.poker-slot-south-west { grid-area: south-west; }
.poker-slot-south-east { grid-area: south-east; }

.poker-seat {
  position: relative; display: grid; gap: 2px; min-width: 0; min-height: 70px; padding: 5px 6px;
  border: 1px solid #456655; border-radius: 11px; background: #12271f; box-shadow: 0 4px 8px #071b1380;
}
.poker-seat.to-move { border-color: #89e9b7; background: #1b382a; box-shadow: inset 0 0 0 1px #a9f5c430, 0 4px 8px #071b1380; }
.poker-seat.is-folded { background: #1a2822; color: #becac1; border-color: #44554b; }
.poker-seat-top { display: flex; align-items: center; justify-content: space-between; min-width: 0; gap: 3px; min-height: 23px; }
.poker-seat-mark .ui-icon { width: 15px; height: 15px; color: #87b29a; }
.poker-seat-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: clamp(.78rem, 3vw, .9rem); }
.poker-position { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 2px; }
.poker-position abbr {
  padding: 1px 3px; border-radius: 4px; background: #415343; color: #f0e0a5;
  font-size: .58rem; font-weight: 790; line-height: 1.2; text-decoration: none;
}
.poker-stack { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; font-variant-numeric: tabular-nums; color: #daf0df; }
.poker-stack small { color: #9db7a7; font-size: .61em; }
.poker-seat-note { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; color: #b7ceb9; font-size: .75rem; font-weight: 690; }
.poker-seat-note:empty { display: none; }
.poker-seat-note .accent { color: #a9f2ca; }
.poker-street-bet { position: absolute; z-index: 1; right: 5px; top: calc(100% - 3px); padding: 2px 5px; border: 1px solid #648f75; border-radius: 999px; background: #1c392b; color: #d6f0db; font-size: .65rem; font-variant-numeric: tabular-nums; line-height: 1; }
.poker-slot-south-west .poker-street-bet, .poker-slot-south-east .poker-street-bet { top: auto; bottom: calc(100% - 3px); }
.poker-mini { display: flex; flex: none; padding-left: 7px; }
.poker-mini .card { width: 16px; height: 22px; margin-left: -7px; padding: 1px 3px; border-radius: 4px; font-size: .47rem; box-shadow: 0 2px 4px #040d088a; }
.poker-mini .card span { font-size: .58rem; }

.poker-center { grid-area: center; display: grid; align-self: center; justify-items: center; gap: 8px; min-width: 0; padding: 5px 0 6px; }
.poker-bank { position: relative; display: grid; justify-items: center; gap: 4px; width: 100%; min-width: 0; }
.poker-stock { position: absolute; left: 8%; bottom: -8px; transform: rotate(-12deg); }
.poker-stock .card { width: 24px; height: 31px; border-radius: 4px; box-shadow: 2px 2px 0 #355845, 4px 4px 0 #7ca487; }
.poker-stage { color: #bbd4c4; font-size: .75rem; font-weight: 730; }
.poker-pot {
  display: inline-flex; align-items: baseline; justify-content: center; flex-wrap: wrap; gap: 2px 7px; max-width: 76%;
  padding: 4px 9px; border: 1px solid #72ad8b; border-radius: 20px; color: #f0f8e9; background: #152e22;
  font-size: clamp(.97rem, 4.3vw, 1.3rem); line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.poker-pot > span:first-child, .poker-pot small { color: #a8c8b5; font-size: .72rem; }
.poker-board.community {
  width: min(calc(100% - 4px), 365px); min-width: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(4px, 1.4vw, 6px);
}
.poker-board .card, .poker-board .empty-card { width: 100%; height: auto; aspect-ratio: .73; min-width: 0; border-radius: 7px; }
.poker-board .card, .poker-hand .card { font-size: clamp(.86rem, 3.9vw, 1.16rem); padding: 5px 5px 4px; }
.poker-board .card span, .poker-hand .card span { font-size: clamp(1.3rem, 5vw, 1.74rem); }
.poker-board .empty-card { background: #122f2478; border-color: #9dc6ab92; }
.poker-side-pots { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px 6px; color: #e1efe2; font-size: .75rem; text-align: center; }
.poker-side-pots > span { padding: 2px 4px; background: #122c21; border-radius: 6px; }
.poker-side-pots small { font-size: .61em; }

.poker-dock {
  position: sticky; bottom: 0; z-index: 2; margin: auto calc(-1 * var(--poker-gutter)) 0;
  padding: 8px var(--poker-gutter) max(11px, env(safe-area-inset-bottom));
  border-top: 1px solid #456252; background: #111c16f7; box-shadow: 0 -10px 30px #08120c4d;
  backdrop-filter: blur(14px);
}
.poker-hero { display: grid; grid-template-columns: minmax(70px, .58fr) minmax(0, 1.42fr); gap: 7px; min-height: 65px; align-items: center; }
.poker-hero-info { min-width: 0; }
.poker-hero-title { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.poker-hero-title h2 { font-size: .77rem; color: #bbcdc0; white-space: nowrap; }
.poker-hero-stack { display: block; margin-top: 3px; font-size: clamp(.94rem, 4.3vw, 1.3rem); color: #f2f9f1; line-height: 1.15; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.poker-hero-stack small, .poker-hero-info > small { color: #a7bfaf; }
.poker-hero-stack small { font-size: .72em; }
.poker-hero-info > small { font-size: .62rem; }
.poker-hand.hand { min-height: 0; justify-content: center; padding: 1px 0 3px; overflow: visible; gap: clamp(4px, 1.5vw, 8px); }
.poker-hand .card { flex: 0 1 clamp(54px, 17vw, 70px); width: clamp(54px, 17vw, 70px); max-width: 70px; height: auto; aspect-ratio: .73; }
.poker-hand[data-hand-count="2"] .card:first-child { transform: rotate(-4deg) translateY(4px); }
.poker-hand[data-hand-count="2"] .card:last-child { transform: rotate(4deg) translateY(2px); }
.poker-hand[data-hand-count="4"] .card:nth-child(1) { transform: rotate(-7deg) translateY(5px); }
.poker-hand[data-hand-count="4"] .card:nth-child(2) { transform: rotate(-2deg) translateY(1px); }
.poker-hand[data-hand-count="4"] .card:nth-child(3) { transform: rotate(2deg) translateY(1px); }
.poker-hand[data-hand-count="4"] .card:nth-child(4) { transform: rotate(7deg) translateY(5px); }
.poker-hand.is-folded .card { filter: saturate(.35); opacity: .65; }
.poker-action-status { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 37px; padding: 4px 0; font-size: .9rem; color: #ccdbca; }
.poker-action-status > div { display: inline-flex; min-width: 0; flex-wrap: wrap; align-items: baseline; gap: 3px 5px; }
.poker-action-status .ui-icon { width: 15px; height: 15px; align-self: center; color: #9eb6a7; }
.poker-action-status small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 170px; color: #adbfae; font-size: .78rem; }
.poker-action-status.is-your-turn, .poker-action-status.is-your-turn .ui-icon { color: #a9efc8; }
.poker-clock { display: grid; place-items: center; padding: 2px 5px; min-width: 43px; border: 1px solid #4e6b58; border-radius: 7px; color: #e5f5e7; font-weight: 760; font-variant-numeric: tabular-nums; }
.poker-clock.urgent { border-color: #a9735e; color: #ffc3a5; background: #3b291e; }
.poker-actions { display: grid; grid-template-columns: minmax(0, .85fr) repeat(2, minmax(0, 1fr)); gap: 6px; }
.poker-actions:has(> :last-child:nth-child(2)) { grid-template-columns: minmax(0, .85fr) minmax(0, 2fr); }
.poker-action { display: grid; place-content: center; gap: 3px; min-height: 53px; padding: 5px 3px; line-height: 1.05; }
.poker-action strong { font-size: .92rem; }
.poker-action small { font-size: clamp(.72rem, 2.7vw, .8rem); font-weight: 700; font-variant-numeric: tabular-nums; }
.poker-fold { background: #302823; border-color: #694e44; color: #ffd1be; }
.poker-raise { background: #2d493a; border-color: #6da989; color: #bcf5d4; }

.poker-settlement {
  display: flex; gap: 7px; align-items: center; padding: 5px 7px; border: 1px solid #567362;
  border-radius: 11px; background: #1b3024; font-size: .77rem;
}
.poker-settlement > div { flex: 1; min-width: 0; }
.poker-settlement .icon-box { width: 30px; height: 30px; border-radius: 8px; }
.poker-settlement .icon-box .ui-icon { width: 17px; height: 17px; }
.poker-settlement div small { display: block; margin-top: 1px; color: #aebead; font-size: .63rem; }
.poker-share { color: #a8ecc5; font-variant-numeric: tabular-nums; font-size: .86rem; }
.poker-result-button { min-width: 34px; min-height: 34px; padding: 4px; }
.poker-result-button .ui-icon { width: 17px; height: 17px; }
.poker-sheet {
  width: min(100% - 12px, 610px); max-width: none; max-height: min(84dvh, 550px);
  margin: auto auto 0; padding: 0; overflow: auto; overscroll-behavior: contain;
  color: var(--text); background: #1a2620; border: 1px solid #547963; border-radius: 22px 22px 0 0;
  box-shadow: 0 -12px 40px #07100ab0;
}
.poker-sheet[open] { animation: poker-sheet-in .17s ease-out; }
[data-reduced-motion] .poker-sheet[open] { animation: none; }
.poker-sheet::backdrop { background: #080f0bbd; }
.poker-sheet-inner { padding: 9px clamp(13px, 4vw, 21px) max(14px, env(safe-area-inset-bottom)); }
.poker-sheet-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.poker-sheet-header h2 { flex: 1; font-size: 1.28rem; }
.poker-sheet-close { min-width: 43px; min-height: 42px; padding: 4px; }
.poker-sheet-close .ui-icon { width: 21px; height: 21px; }
.poker-wager { display: grid; gap: 8px; }
.poker-amount-input { position: relative; }
.poker-amount-input input { padding-right: 53px; font-size: max(16px, 1.13rem); font-weight: 770; }
.poker-amount-input > span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: #c5dacb; font-weight: 720; pointer-events: none; }
.poker-wager .range { min-height: 29px; height: 29px; padding: 0; accent-color: var(--accent); border: 0; background: transparent; cursor: pointer; }
.poker-wager-limits { display: flex; justify-content: space-between; gap: 5px; color: #becfc2; font-size: .74rem; font-variant-numeric: tabular-nums; }
.poker-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.poker-presets button { flex: 1 1 auto; min-height: 42px; padding-inline: 7px; font-size: .81rem; }
.poker-presets button[aria-pressed="true"] { background: #305443; border-color: #72ac8b; color: #c1f6d9; }
.poker-message { color: #ffb7a7; font-size: .81rem; }
.poker-message:empty { display: none; }
.poker-sheet input[aria-invalid="true"] { border-color: #d88d7a; }
.poker-leave { margin-top: 11px; background: #392b26; border-color: #7e584a; color: #ffd1c3; }
.poker-wager .muted { font-size: .82rem; }
@keyframes poker-sheet-in { from { transform: translateY(19px); opacity: .7; } to { transform: translateY(0); opacity: 1; } }

@media (max-width: 375px) {
  .poker-top-button:last-child { gap: 2px; padding-inline: 5px; }
  .poker-felt.table-stage { gap: 5px 5px; padding-inline: 7px; }
  .poker-board.community { width: calc(100% - 4px); }
  .poker-stock { left: 6%; }
}
@media (max-height: 650px) and (max-width: 600px) {
  .poker-felt.table-stage { min-height: 270px; }
  .poker-felt.has-lower-seats { min-height: 310px; }
  .poker-center { gap: 5px; }
  .poker-board.community { width: min(calc(100% - 8px), 315px); }
  .poker-seat { min-height: 64px; }
  .poker-dock { padding-top: 5px; }
  .poker-action { min-height: 49px; }
}
@media (min-width: 600px) {
  .poker-top { grid-template-columns: 75px minmax(0, 1fr) 75px; }
  .poker-felt.table-stage { max-height: min(64svh, 548px); padding-inline: 20px; grid-template-rows: minmax(76px, auto) 1fr auto; gap: 8px; }
  .poker-seat { padding: 7px 12px; }
  .poker-mini .card { width: 23px; height: 28px; }
  .poker-dock { margin-inline: 0; border: 1px solid #3d5b49; border-radius: 15px 15px 0 0; }
}
@media (prefers-reduced-motion: reduce) { .poker-sheet[open] { animation: none; } }

.poker-exit-button { width: 100%; min-height: 38px; margin-top: 7px; color: #e5b7ac; border-color: #684e47; background: #302824; }
