/* Poker client (P2) — docs/poker/README.md § Client. PLAY-MONEY.
   Every colour/size is a --pk-* token so a designer can restyle without touching
   the wiring. Weight 400 everywhere inside the surface (shell dialect, rule 56a). */
.pk-root {
  --pk-bg: #0d0f14;
  --pk-surface: #171a22;
  --pk-surface-2: #1f2330;
  --pk-border: rgba(255, 255, 255, 0.09);
  --pk-text: #e6e9f0;
  --pk-muted: rgba(230, 233, 240, 0.62);
  --pk-felt: #0f5a45;
  --pk-felt-2: #0a3d30;
  --pk-rail: #2a1d33;
  --pk-accent: #7c5cff;
  --pk-gold: #f3c969;
  --pk-green: #2fd07e;
  --pk-danger: #ff4d4f;
  --pk-timer: #2fd07e;
  --pk-timebank: #f3c969;
  --pk-card-face: #fbfaf7;
  --pk-card-red: #d62839;
  --pk-card-black: #14161c;
  --pk-card-w: 46px;
  --pk-card-h: 64px;
  --pk-hero-card-w: 64px;
  --pk-hero-card-h: 90px;
  --pk-seat-w: 118px;
  --pk-radius: 10px;
  --pk-font: 'Bai Jamjuree', 'Exo 2', -apple-system, system-ui, sans-serif;
  --pk-font-cond: 'Barlow Condensed', 'Fira Sans Condensed', sans-serif;
  position: relative;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 64px);
  height: calc(100dvh - 64px);
  min-height: 360px;
  background: var(--pk-bg) center / cover no-repeat;
  color: var(--pk-text);
  font-family: var(--pk-font);
  overflow: hidden;
}
.pk-root, .pk-root * { font-weight: 400; box-sizing: border-box; }
.pk-root[data-mode="lobby"] { height: auto; min-height: calc(100vh - 64px); overflow: visible; }
.pk-root[data-mode="table"] { background-image: linear-gradient(rgba(8, 9, 13, 0.55), rgba(8, 9, 13, 0.75)), url('/poker/bg-room.jpg'); }
.pk-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pk-boot, .pk-noscript { padding: 40px; text-align: center; color: var(--pk-muted); }
.pk-root button { font-family: var(--pk-font-cond); letter-spacing: 0.04em; cursor: pointer; }
.pk-root button:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── generic bits ─────────────────────────────────────────────────────────── */
.pk-btn { border: 1px solid var(--pk-border); background: var(--pk-surface-2); color: var(--pk-text); padding: 8px 14px; border-radius: 8px; font-size: 0.95rem; text-transform: uppercase; }
.pk-btn:hover:not(:disabled) { border-color: rgba(255, 255, 255, 0.25); }
.pk-btn.pk-primary { background: var(--pk-accent); border-color: transparent; }
.pk-btn.pk-ghost { background: transparent; }
.pk-chip-tag { display: inline-block; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--pk-border); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--pk-muted); }
.pk-chip-tag.pk-sandbox { color: var(--pk-gold); border-color: rgba(243, 201, 105, 0.4); }
.pk-bot-tag { position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%); font-size: 0.52rem; letter-spacing: 0.06em; padding: 0 3px; border-radius: 3px; background: #4b3a99; color: #e8e2ff; line-height: 1.35; z-index: 1; }
.pk-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--pk-surface-2); border: 1px solid var(--pk-border); padding: 10px 16px; border-radius: 8px; z-index: 50; max-width: 90vw; }
.pk-conn { position: absolute; top: 8px; right: 12px; font-size: 0.75rem; color: var(--pk-muted); z-index: 5; }
.pk-conn.pk-bad { color: var(--pk-danger); }

/* ── lobby ────────────────────────────────────────────────────────────────── */
.pk-lobby { padding: 0 16px 40px; max-width: 1180px; margin: 0 auto; width: 100%; }
.pk-hero { position: relative; margin: 16px 0; min-height: 160px; border-radius: 14px; border: 1px solid var(--pk-border); background: linear-gradient(90deg, rgba(13, 15, 20, 0.92), rgba(13, 15, 20, 0.35)), url('/poker/lobby-hero.jpg') center / cover no-repeat, var(--pk-surface); padding: 22px; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.pk-hero-title { font-family: var(--pk-font-cond); font-size: 2rem; letter-spacing: 0.04em; margin: 0; }
.pk-hero-sub { color: var(--pk-muted); margin: 0; max-width: 560px; }
.pk-bank { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 6px; }
.pk-bank-amt { font-family: var(--pk-font-cond); font-size: 1.4rem; color: var(--pk-gold); }
.pk-filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 12px; }
.pk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.pk-tcard { border: 1px solid var(--pk-border); background: var(--pk-surface); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: inherit; }
.pk-tcard:hover { border-color: rgba(124, 92, 255, 0.5); }
.pk-tcard.pk-locked { opacity: 0.55; }
.pk-tcard-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pk-tcard-name { font-family: var(--pk-font-cond); font-size: 1.2rem; }
.pk-lvl { font-family: var(--pk-font-cond); font-size: 0.8rem; padding: 2px 8px; border-radius: 6px; background: var(--pk-surface-2); color: var(--pk-muted); white-space: nowrap; }
.pk-lvl[data-tier="3"] { color: #8fd3ff; } .pk-lvl[data-tier="4"] { color: #c9a7ff; } .pk-lvl[data-tier="5"] { color: var(--pk-gold); }
.pk-tcard-row { display: flex; justify-content: space-between; color: var(--pk-muted); font-size: 0.88rem; }
.pk-seatbar { display: flex; gap: 3px; }
.pk-seatbar i { width: 12px; height: 6px; border-radius: 3px; background: var(--pk-surface-2); display: block; }
.pk-seatbar i.pk-h { background: var(--pk-green); } .pk-seatbar i.pk-b { background: var(--pk-accent); }

/* ── table ────────────────────────────────────────────────────────────────── */
.pk-topbar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; flex-wrap: wrap; position: relative; z-index: 4; }
.pk-topbar .pk-title { font-family: var(--pk-font-cond); font-size: 1.15rem; }
.pk-topbar .pk-sp { flex: 1; }
.pk-topbar .pk-meta { color: var(--pk-muted); font-size: 0.85rem; }
.pk-stage { position: relative; flex: 1; min-height: 0; }
/* The table box (poker.js fit()): aspect 2.1:1 (portrait 1:1.55), centred in the stage. EVERY size on it is a multiple of
   --u = 1 % of the felt width (portrait: × 1.7) — cards, seats, chips, labels; no fixed px. Targets (% of felt width):
   board card 6.8 (5:7, gap 0.6) · hole cards 5 (hero 5.5), fanned in front of the pod · pod 11, avatar 4 · bet chip 2.5 ·
   pot text 2 · dealer 2. Text has a px floor (max(…)) so a phone stays legible. */
.pk-table { --u: 10px; position: absolute; z-index: 2; --pk-card-w: calc(var(--u) * 6.8); --pk-card-h: calc(var(--pk-card-w) * 1.4); }
.pk-felt { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(ellipse at center, var(--pk-felt) 0%, var(--pk-felt-2) 78%); box-shadow: 0 0 0 calc(var(--u) * 1.1) var(--pk-rail), 0 0 0 calc(var(--u) * 1.3) rgba(255, 255, 255, 0.06), 0 calc(var(--u) * 1.8) calc(var(--u) * 5) rgba(0, 0, 0, 0.6); }
.pk-felt.pk-img { background: url('/poker/table-felt.png') center / 100% 100% no-repeat; box-shadow: none; }
.pk-center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: calc(var(--u) * 0.6); z-index: 2; }
/* pot above the board: the board's centre is the table centre, the pot sits in the flow above it */
.pk-center { transform: translate(-50%, calc(-50% - var(--u) * 1.6)); }
.pk-pot { font-family: var(--pk-font-cond); color: var(--pk-gold); font-size: max(11px, calc(var(--u) * 2)); background: rgba(0, 0, 0, 0.35); padding: calc(var(--u) * 0.2) calc(var(--u) * 1.1); border-radius: 999px; min-height: 1.6em; }
.pk-pot:empty { visibility: hidden; }   /* no pot (between hands): no empty pill; it keeps its height so the board never jumps */
.pk-sidepots { font-size: max(10px, calc(var(--u) * 1.25)); color: var(--pk-muted); }
.pk-board { display: flex; gap: calc(var(--u) * 0.6); min-height: var(--pk-card-h); }
.pk-last { font-size: max(10px, calc(var(--u) * 1.3)); color: var(--pk-muted); min-height: 1.2em; }
.pk-pick { margin-top: calc(var(--u) * 0.4); padding: calc(var(--u) * 0.5) calc(var(--u) * 1.6); border-radius: 999px; font-size: max(12px, calc(var(--u) * 1.4));
  color: var(--pk-text); background: rgba(0, 0, 0, 0.55); border: 1px solid var(--pk-border); white-space: nowrap; }
.pk-pick[hidden] { display: none; }

.pk-seat { position: absolute; width: calc(var(--u) * 11); transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; z-index: 3; transition: opacity 0.2s; }
.pk-seat.pk-folded { opacity: 0.45; }
.pk-seat.pk-out { opacity: 0.6; }
/* hole cards: in FRONT of the pod (toward the board) — poker.js sets --pk-cdx/--pk-cdy per seat; fanned and overlapping */
.pk-seat-cards { position: absolute; left: 50%; top: 50%; display: flex; z-index: 1; transform: translate(calc(-50% + var(--pk-cdx, 0px)), calc(-50% + var(--pk-cdy, 0px))); pointer-events: none; }
.pk-seat-cards .pk-card { width: calc(var(--u) * 5); height: calc(var(--u) * 7); }
.pk-seat-cards .pk-card:first-child { transform: rotate(-7deg); margin-right: calc(var(--u) * -1.6); }
.pk-seat-cards .pk-card + .pk-card { transform: rotate(7deg); }
.pk-plate { position: relative; width: 100%; display: flex; align-items: center; gap: calc(var(--u) * 0.6); background: rgba(12, 14, 20, 0.92); border: 1px solid var(--pk-border); border-radius: 999px; padding: calc(var(--u) * 0.3) calc(var(--u) * 0.9) calc(var(--u) * 0.3) calc(var(--u) * 0.3); z-index: 2; }
.pk-seat.pk-acting .pk-plate { border-color: var(--pk-timer); box-shadow: 0 0 0 1px var(--pk-timer), 0 0 calc(var(--u) * 1.4) rgba(47, 208, 126, 0.35); }
.pk-av { position: relative; width: calc(var(--u) * 4); height: calc(var(--u) * 4); flex: none; border-radius: 50%; background: var(--pk-surface-2) center / cover no-repeat; }
.pk-ring { position: absolute; inset: calc(var(--u) * -0.3); width: calc(var(--u) * 4.6); height: calc(var(--u) * 4.6); transform: rotate(-90deg); pointer-events: none; }
.pk-ring circle { fill: none; stroke: var(--pk-timer); stroke-width: 3; stroke-linecap: round; }
.pk-ring.pk-tb circle { stroke: var(--pk-timebank); }
.pk-plate-txt { min-width: 0; flex: 1; display: flex; flex-direction: column; line-height: 1.15; }
.pk-name { font-size: max(10px, calc(var(--u) * 1.2)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pk-stack { font-family: var(--pk-font-cond); font-size: max(11px, calc(var(--u) * 1.5)); color: var(--pk-gold); }
.pk-status { position: absolute; bottom: 100%; margin-bottom: calc(var(--u) * 0.3); left: 50%; transform: translateX(-50%); font-size: max(9px, calc(var(--u) * 1.1)); text-transform: uppercase; letter-spacing: 0.08em; color: var(--pk-muted); white-space: nowrap; }
.pk-desc { font-size: max(9px, calc(var(--u) * 1.1)); color: var(--pk-green); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pk-empty { width: 100%; background: rgba(12, 14, 20, 0.6); border: 1px dashed rgba(255, 255, 255, 0.18); color: var(--pk-muted); border-radius: 999px; padding: calc(var(--u) * 1.2) calc(var(--u) * 1); font-size: max(10px, calc(var(--u) * 1.35)); text-transform: uppercase; }
.pk-empty:hover:not(:disabled) { color: var(--pk-text); border-color: var(--pk-green); }
.pk-bet { position: absolute; transform: translate(-50%, -50%); display: flex; align-items: center; gap: calc(var(--u) * 0.4); font-family: var(--pk-font-cond); font-size: max(10px, calc(var(--u) * 1.5)); z-index: 2; white-space: nowrap; transition: left 0.35s ease, top 0.35s ease, opacity 0.35s; }
.pk-chipimg { width: calc(var(--u) * 2.5); height: calc(var(--u) * 2.5); border-radius: 50%; background: var(--pk-gold) center / cover no-repeat; box-shadow: inset 0 0 0 calc(var(--u) * 0.35) rgba(0, 0, 0, 0.25); }
.pk-dealer { position: absolute; width: calc(var(--u) * 2.2); height: calc(var(--u) * 2.2); transform: translate(-50%, -50%); border-radius: 50%; background: #fff url('/poker/dealer-button.png') center / cover no-repeat; color: #111; font-size: max(9px, calc(var(--u) * 1.1)); display: flex; align-items: center; justify-content: center; z-index: 2; transition: left 0.4s, top 0.4s; }

/* ── cards ────────────────────────────────────────────────────────────────── */
.pk-card { width: var(--pk-card-w); height: var(--pk-card-h); border-radius: calc(var(--pk-card-w) * 0.12); background: var(--pk-card-face); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45); display: block; overflow: hidden; }
.pk-card svg { width: 100%; height: 100%; display: block; }
.pk-card.pk-back { background: #3b2a66 url('/poker/card-back.png') center / cover no-repeat; border: 2px solid rgba(255, 255, 255, 0.85); }
.pk-card.pk-slot { background: rgba(0, 0, 0, 0.18); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); }
.pk-card.pk-flip { animation: pk-flip 0.35s ease; }
.pk-card.pk-win { box-shadow: 0 0 0 2px var(--pk-gold), 0 0 14px rgba(243, 201, 105, 0.6); }
@keyframes pk-flip { from { transform: rotateY(90deg); } to { transform: rotateY(0); } }
.pk-fly { position: absolute; z-index: 20; pointer-events: none; transition: left 0.38s cubic-bezier(.2,.7,.2,1), top 0.38s cubic-bezier(.2,.7,.2,1), opacity 0.38s; }

/* ── hero + action bar ────────────────────────────────────────────────────── */
/* the hero's cards: in front of the hero's pod (toward the board), fanned; poker.js places the box at the seat's card anchor */
.pk-hero-cards { position: absolute; left: 50%; top: 80%; transform: translate(-50%, -50%); display: flex; z-index: 6; pointer-events: none; }
.pk-hero-cards .pk-card { width: calc(var(--u) * 5.5); height: calc(var(--u) * 7.7); }
.pk-hero-cards .pk-card:first-child { transform: rotate(-6deg); margin-right: calc(var(--u) * -1.2); }
.pk-hero-cards .pk-card + .pk-card { transform: rotate(6deg); }
/* PLO 4 / 5 hole cards: a flat overlapping fan instead of the two-card tilt (poker table config 2026-10-24) */
.pk-hero-cards.pk-hole-4 .pk-card, .pk-hero-cards.pk-hole-5 .pk-card { transform: none; margin-right: calc(var(--u) * -2.2); }
.pk-hero-cards.pk-hole-4 .pk-card:last-child, .pk-hero-cards.pk-hole-5 .pk-card:last-child { margin-right: 0; }
.pk-hero-cards.pk-hole-5 .pk-card { width: calc(var(--u) * 4.8); height: calc(var(--u) * 6.7); }
.pk-seat-cards.pk-hole-4 .pk-card, .pk-seat-cards.pk-hole-5 .pk-card { transform: none; width: calc(var(--u) * 4); height: calc(var(--u) * 5.6); margin-right: calc(var(--u) * -2.6); }
.pk-seat-cards.pk-hole-4 .pk-card:last-child, .pk-seat-cards.pk-hole-5 .pk-card:last-child { margin-right: 0; }
.pk-actions { position: relative; z-index: 7; padding: 10px 12px 14px; background: linear-gradient(transparent, rgba(8, 9, 13, 0.92) 30%); display: flex; flex-direction: column; gap: 8px; }
.pk-actions-in { display: flex; flex-direction: column; gap: 8px; }
.pk-actions-in:empty { display: none; }
.pk-seatctl { display: flex; gap: 12px; align-items: center; justify-content: flex-end; flex-wrap: wrap; color: var(--pk-muted); font-size: 0.9rem; }
.pk-seatctl label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.pk-act-row { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.pk-act { min-width: 110px; padding: 12px 16px; border-radius: 10px; border: 0; font-size: 1.05rem; text-transform: uppercase; color: #fff; }
.pk-act-fold { background: #3a3f4d; }
.pk-act-call { background: #1f7a4f; }
.pk-act-raise { background: var(--pk-accent); }
.pk-sizer { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.pk-sizer input[type="range"] { flex: 1; min-width: 140px; max-width: 360px; accent-color: var(--pk-accent); }
.pk-sizer input[type="number"] { width: 110px; background: var(--pk-surface); color: var(--pk-text); border: 1px solid var(--pk-border); border-radius: 6px; padding: 6px 8px; font-family: var(--pk-font-cond); font-size: 1rem; }
.pk-preset { padding: 6px 10px; border-radius: 6px; border: 1px solid var(--pk-border); background: var(--pk-surface); color: var(--pk-text); font-size: 0.85rem; }
.pk-pre { display: flex; gap: 14px; justify-content: flex-end; flex-wrap: wrap; color: var(--pk-muted); font-size: 0.9rem; }
.pk-pre label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.pk-info { color: var(--pk-muted); font-size: 0.9rem; text-align: right; min-height: 1.3em; }

.pk-log { display: none; position: absolute; left: 10px; top: 10px; width: 250px; max-height: 32%; overflow: auto; font-size: 0.75rem; color: var(--pk-muted); background: rgba(8, 9, 13, 0.6); border: 1px solid var(--pk-border); border-radius: 8px; padding: 6px 8px; z-index: 5; }
.pk-log p { margin: 0 0 2px; }
.pk-root.pk-log-open .pk-log { display: block; }

.pk-modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); display: flex; align-items: center; justify-content: center; z-index: 40; padding: 16px; }
.pk-modal { background: var(--pk-surface); border: 1px solid var(--pk-border); border-radius: 12px; padding: 18px; width: min(380px, 100%); display: flex; flex-direction: column; gap: 12px; }
.pk-modal h2 { margin: 0; font-family: var(--pk-font-cond); font-size: 1.3rem; }
.pk-modal-row { display: flex; gap: 8px; justify-content: flex-end; }
/* P0 2026-10-25: every poker dialog fits a short phone screen — capped to the viewport, body scrolls, the action row
   sticks to the bottom edge so its buttons are always on screen. The settings menu scrolls inside the screen too. */
@media (orientation: landscape) and (max-height: 540px) {
  .pk-modal-bg { padding: max(6px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); }
  .pk-modal:not(.pk-sitdlg) { max-height: calc(100dvh - max(6px, env(safe-area-inset-top)) - max(6px, env(safe-area-inset-bottom))); overflow-y: auto; overscroll-behavior: contain; padding: 12px 16px 0; gap: 8px; }
  .pk-modal:not(.pk-sitdlg) > .pk-modal-row { position: sticky; bottom: 0; margin-top: auto; padding: 8px 0 12px; background: inherit; }
  .pk-menu { max-height: calc(100dvh - 60px); overflow-y: auto; overscroll-behavior: contain; }
}

/* fullscreen */
.pk-root:fullscreen { min-height: 100vh; }
.pk-root:-webkit-full-screen { min-height: 100vh; }

/* ── responsive: portrait-first phone ─────────────────────────────────────── */
/* ── animations addendum ─────────────────────────────────────────────────── */
.pk-seat.pk-enter { animation: pk-fade-in 0.45s ease both; }
@keyframes pk-fade-in { from { opacity: 0; transform: translate(-50%, -40%); } to { opacity: 1; transform: translate(-50%, -50%); } }
.pk-ring.pk-late circle { stroke: var(--pk-danger); }
.pk-ring.pk-tb { animation: pk-pulse 0.9s ease-in-out infinite; }
@keyframes pk-pulse { 50% { opacity: 0.45; } }
.pk-status.pk-allin { color: #fff; background: var(--pk-danger); padding: 1px 6px; border-radius: 4px; }
.pk-eq { position: absolute; top: calc(var(--u) * -1); right: calc(var(--u) * -0.6); z-index: 3; font-family: var(--pk-font-cond); font-size: max(10px, calc(var(--u) * 1.3)); color: #fff; background: rgba(124, 92, 255, 0.85); padding: 0 6px; border-radius: 999px; }
.pk-think { display: inline-flex; gap: 3px; margin-left: 4px; }
.pk-think i { width: 4px; height: 4px; border-radius: 50%; background: var(--pk-muted); animation: pk-dot 1s infinite; }
.pk-think i:nth-child(2) { animation-delay: 0.15s; } .pk-think i:nth-child(3) { animation-delay: 0.3s; }
@keyframes pk-dot { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
.pk-riffle { position: absolute; transform: translate(-50%, -50%); z-index: 15; width: calc(var(--u) * 4); height: calc(var(--u) * 5.6); pointer-events: none; }
.pk-riffle .pk-card { position: absolute; left: 0; top: 0; width: calc(var(--u) * 4); height: calc(var(--u) * 5.6); }
.pk-banner { position: absolute; left: 50%; top: 24%; transform: translate(-50%, -50%); z-index: 18; font-family: var(--pk-font-cond); font-size: max(16px, calc(var(--u) * 2.6)); letter-spacing: 0.06em; color: var(--pk-gold); background: rgba(8, 9, 13, 0.85); border: 1px solid rgba(243, 201, 105, 0.5); padding: 6px 18px; border-radius: 10px; pointer-events: none; white-space: nowrap; }
.pk-card.pk-dim { filter: grayscale(0.7) brightness(0.6); }
.pk-seat.pk-winner .pk-plate { border-color: var(--pk-gold); box-shadow: 0 0 0 1px var(--pk-gold), 0 0 22px rgba(243, 201, 105, 0.55); }
.pk-seat.pk-lost .pk-seat-cards, .pk-hero-cards.pk-lost { filter: grayscale(1) brightness(0.55); }
.pk-stack.pk-up { color: var(--pk-green); } .pk-stack.pk-down { color: var(--pk-danger); }
.pk-bubble { position: absolute; bottom: 100%; margin-bottom: calc(var(--u) * 1.6); left: 50%; transform: translateX(-50%); background: #fff; color: #111; border-radius: 12px; padding: 2px 10px; font-size: 1rem; z-index: 8; animation: pk-fade-in-b 0.2s ease; }
@keyframes pk-fade-in-b { from { opacity: 0; } to { opacity: 1; } }
.pk-confetti { position: absolute; width: calc(var(--u) * 0.7); height: calc(var(--u) * 1.1); border-radius: 2px; z-index: 30; pointer-events: none; }
.pk-emotes { display: flex; gap: 6px; justify-content: flex-start; }
.pk-menu { position: absolute; right: 12px; top: 52px; z-index: 30; background: var(--pk-surface); border: 1px solid var(--pk-border); border-radius: 10px; padding: 10px; display: grid; grid-template-columns: repeat(3, auto); gap: 6px; }
.pk-menu-x { grid-column: 1 / -1; justify-self: end; min-width: 36px; min-height: 36px; border: 0; border-radius: 8px; background: none; color: var(--pk-muted); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.pk-menu-x:hover, .pk-menu-x:focus-visible { background: rgba(255, 255, 255, .08); color: inherit; }
.pk-menu-h { grid-column: 1 / -1; margin: 4px 0 0; color: var(--pk-muted); font-size: 0.8rem; }
.pk-preset.pk-on { border-color: var(--pk-accent); }
.pk-levelup { text-align: center; position: relative; overflow: hidden; }
.pk-levelup-kicker { color: var(--pk-gold); letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.8rem; margin: 0; }
.pk-levelup .pk-modal-row { justify-content: center; }

/* chrome only: the table itself scales with --u (poker.js fit()) at every size */
@media (max-width: 520px), (orientation: portrait) and (max-width: 900px) {
  .pk-act { min-width: 0; flex: 1; padding: 12px 8px; font-size: 0.95rem; }
  .pk-topbar .pk-meta { display: none; }
  .pk-topbar { gap: 6px; padding: 6px 8px; }
  .pk-topbar .pk-btn { padding: 5px 8px; font-size: 0.75rem; }
  .pk-topbar .pk-title { font-size: 1rem; }
  .pk-topbar .pk-chip-tag { display: none; }
}
/* short landscape (phones on their side): compact chrome so the action bar stays on screen */
@media (max-height: 500px) {
  .pk-topbar { padding: 4px 10px; flex-wrap: nowrap; overflow: hidden; }
  .pk-topbar .pk-btn { padding: 4px 8px; font-size: 0.8rem; }
  .pk-actions { padding: 4px 10px 6px; gap: 4px; }
  .pk-act { padding: 8px 12px; font-size: 0.9rem; min-width: 90px; }
  .pk-info { display: none; }
  .pk-topbar .pk-meta, .pk-topbar .pk-chip-tag { display: none; }
  .pk-sizer input[type="range"] { max-width: 220px; }
}
/* ── 2D | 3D view (Poker Club; pc-poker-3d.js draws felt, cards, chips, button — seats, text and pot stay HTML) ── */
.pk-viewtog { display: inline-flex; padding: 2px; border-radius: 999px; border: 1px solid var(--pk-border); background: var(--pk-surface); }
.pk-viewbtn { background: none; border: 0; color: var(--pk-muted); padding: 5px 11px; border-radius: 999px; font-size: 0.85rem; }
.pk-viewbtn[aria-pressed="true"] { background: var(--pk-accent); color: #fff; }
.pk-3d-host { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.pk-3d-host[hidden] { display: none; }
.pk-3d-host.is-pending { visibility: hidden; }   /* late 3D: renders unseen behind the 2D table until its first frame */
.pk-3d-canvas { display: block; width: 100%; height: 100%; }
.pk-3d .pk-felt, .pk-3d .pk-board .pk-card, .pk-3d .pk-seat-cards, .pk-3d .pk-hero-cards, .pk-3d .pk-bet .pk-chipimg, .pk-3d .pk-dealer,
.pk-3d .pk-fly.pk-card, .pk-3d .pk-riffle { visibility: hidden !important; }
.pk-below { display: flex; flex-direction: column; align-items: center; gap: calc(var(--u) * 0.6); }
/* 3D: the board slot itself is centred on the projected board; the pot hangs above it, the rest below it */
.pk-3d .pk-center { transform: translate(-50%, -50%); }
.pk-3d .pk-pot { position: absolute; left: 50%; bottom: calc(100% + var(--u) * 0.8); transform: translateX(-50%); white-space: nowrap; }
.pk-3d .pk-below { position: absolute; left: 50%; top: calc(100% + var(--u) * 0.5); transform: translateX(-50%); width: max-content; }
.pk-3d .pk-board { min-height: 0; height: var(--pk-b3h, calc(var(--pk-card-h) * 0.95)); }
.pk-3d.pk-portrait .pk-board { height: var(--pk-b3h, calc(var(--pk-card-h) * 0.5)); }
/* boot placeholder: the table's own footprint + a spinner until the first 3D frame — the 2D table is never shown first */
.pk-3d-boot .pk-table { visibility: hidden; }
.pk-3d-boot .pk-stage::after { content: ''; position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%;
  border: 3px solid var(--pk-border); border-top-color: var(--pk-gold); animation: pk-spin 0.9s linear infinite; }
@keyframes pk-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .pk-3d-boot .pk-stage::after { animation: none; }
  .pk-fly, .pk-bet, .pk-dealer { transition: none !important; }
  .pk-card.pk-flip, .pk-seat.pk-enter, .pk-ring.pk-tb, .pk-think i { animation: none; }
}
/* phones in LANDSCAPE on a table (html.pcg-mob-land — the shared overlay, /games/pcg/shell/overlay.js; operator mobile brief
   2026-10-25): the action bar is two rows at most — sizing on one line, the actions (fold / call / raise) with sit out /
   stand up on the next, right-aligned (the right thumb's zone), every button ≥ 44 px tall */
html.pcg-mob-land .pk-actions { padding: 2px max(8px, env(safe-area-inset-right, 0px)) 4px max(8px, env(safe-area-inset-left, 0px)); gap: 4px;
  flex-direction: row; flex-wrap: wrap; align-items: flex-end; justify-content: flex-end; }
html.pcg-mob-land .pk-actions-in { gap: 4px; flex: 1 1 auto; min-width: 0; }
html.pcg-mob-land .pk-sizer { flex-wrap: nowrap; gap: 4px; }
html.pcg-mob-land .pk-preset { padding: 4px 7px; min-height: 36px; min-width: 36px; font-size: 0.8rem; }
html.pcg-mob-land .pk-sizer input[type="range"] { min-width: 60px; max-width: 200px; }
html.pcg-mob-land .pk-sizer input[type="number"] { width: 76px; padding: 4px 6px; }
html.pcg-mob-land .pk-act-row { flex-wrap: nowrap; gap: 6px; }
html.pcg-mob-land .pk-act { min-height: 44px; min-width: 0; flex: 0 1 150px; padding: 6px 10px; font-size: 0.88rem; }
html.pcg-mob-land .pk-seatctl { gap: 8px; font-size: 0.8rem; }
html.pcg-mob-land .pk-seatctl .pk-btn, html.pcg-mob-land .pk-seatctl button { min-height: 44px; }
html.pcg-mob-land .pk-info { display: none; }
