/*
 * play.css — Styles for the live-play surface (web/play.html).
 *
 * Reuses CSS custom properties defined in styles.css (loaded first).
 * All play-specific classes are prefixed to avoid collisions.
 */

/* ── Page scaffold ─────────────────────────────────────────────────────────── */

.play-page {
  margin-top: 56px;        /* below fixed top-nav */
  min-height: calc(100vh - 56px);
}

.play-page-content {
  max-width: 680px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#playNav {
  min-width: 0;
}

#playNavUser {
  min-width: 0;
  max-width: min(300px, 32vw);
  overflow: hidden;
}

#playNavUser span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Chips-only badge ──────────────────────────────────────────────────────── */

.chips-only-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid rgba(226, 180, 91, 0.35);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
  background: var(--gold-soft);
  user-select: none;
}

/* ── Create-room card ──────────────────────────────────────────────────────── */

.create-room-card {
  width: 100%;
  max-width: 680px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 42px;
}

.create-room-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}

.create-room-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.create-room-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.form-section-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 20px 0 10px;
}

.form-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.form-row.form-row-check {
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 120px;
}

.form-field.full-width {
  flex: 1 1 100%;
}

.form-field label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-strong);
}

.form-field input[type="text"],
.form-field input[type="number"],
.form-field select {
  padding: 12px 14px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-family: var(--font-sans);
  width: 100%;
}

.form-field input:focus,
.form-field select:focus {
  border-color: var(--gold);
  outline: none;
}

.check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: var(--text-soft);
  cursor: pointer;
  user-select: none;
}

.check-label input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--gold);
  cursor: pointer;
}

.form-radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-soft);
  cursor: pointer;
  user-select: none;
}

.radio-label input[type="radio"] {
  width: 15px;
  height: 15px;
  accent-color: var(--gold);
  cursor: pointer;
}

.radio-label-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.radio-label-disabled input[type="radio"] {
  cursor: not-allowed;
}

.create-room-btn {
  margin-top: 28px;
  width: 100%;
  padding: 14px;
  font-size: 13px;
}

.play-error {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--rose-soft);
  border: 1px solid rgba(240, 109, 121, 0.25);
  color: var(--rose);
  font-size: 13px;
}

/* ── Pre-join overlay ──────────────────────────────────────────────────────── */

.prejoin-overlay {
  position: fixed;
  inset: 56px 0 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-fixed);
  background: var(--bg);
  padding: 24px;
}

.prejoin-card {
  width: 100%;
  max-width: 500px;
  background: var(--glass-bg-strong);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 40px;
}

.prejoin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.prejoin-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.prejoin-room-info {
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 18px;
  line-height: 1.6;
}

.prejoin-signin-hint {
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  margin-top: 14px;
}

.prejoin-signin-hint a {
  color: var(--gold);
  text-decoration: none;
}

.prejoin-signin-hint a:hover {
  text-decoration: underline;
}

/* ── Table layout ──────────────────────────────────────────────────────────── */

/* container-type goes on the PARENT (#tableView) so @container rules can
   target .table-layout itself (which is what the responsive grid switch
   needs). A rule inside @container can't target its own container — only
   descendants. */
#tableView {
  container-type: inline-size;
  container-name: table-layout;
}

.table-layout {
  --right-panel-width: clamp(248px, 22vw, 300px);
  --table-area-height: calc(100dvh - 180px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--right-panel-width);
  grid-template-rows: minmax(0, 1fr) auto;
  height: calc(100dvh - 56px);
  overflow: hidden;
}

.table-area {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 24px clamp(12px, 2vw, 28px) 30px;
  min-width: 0;
  min-height: 0;
}

/* ── Table top bar (connection status + room info) ─────────────────────────── */

.table-top-bar {
  position: absolute;
  top: 12px;
  left: 12px;
  right: clamp(248px, 24vw, 300px);
  transform: none;
  z-index: var(--z-seat-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  width: auto;
}

/* ── Connection status ─────────────────────────────────────────────────────── */

.conn-status {
  position: static;
  top: auto;
  left: auto;
  transform: none;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  z-index: var(--z-seat-overlay);
  transition: color var(--dur-mid) var(--ease), border-color var(--dur-mid) var(--ease);
}

.conn-status.connected { color: #4caf82; border-color: rgba(76,175,130,0.3); }
.conn-status.disconnected { color: var(--rose); border-color: rgba(240,109,121,0.3); }
.conn-status.reconnecting { color: var(--gold); border-color: var(--border-strong); }

.room-info-bar {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  white-space: nowrap;
}

/* ── Oval table ────────────────────────────────────────────────────────────── */

.table-oval {
  --table-aspect: 1.68;
  --table-max-width: 760px;
  --center-lane-width: min(56%, 430px);
  --center-lane-wide-width: min(66%, 520px);
  --table-center-gap: 12px;
  --seat-avatar-size: 64px;
  --seat-avatar-font-size: 23px;
  --seat-zone-width: 132px;
  --seat-zone-height: 178px;
  --seat-info-width: 118px;
  --seat-info-offset: 40px;
  --seat-name-width: 92px;
  --seat-name-font-size: 12px;
  --seat-stack-min-width: 50px;
  --seat-stack-font-size: 12px;
  --seat-status-width: 112px;
  --seat-hole-card-width: 32px;
  --seat-hole-card-height: 44px;
  --seat-hole-card-font-size: 12px;
  --seat-hole-card-suit-font-size: 10px;
  --seat-hole-cards-width: 70px;
  --seat-wide-info-width: 194px;
  --seat-strength-width: 116px;
  --seat-meta-offset: 39px;
  --seat-stack-offset: 59px;
  --seat-status-offset: 80px;
  --seat-hole-offset: 99px;
  --seat-strength-offset: 148px;
  --seat-bet-below-center-offset: 42px;
  --seat-bet-above-center-offset: 42px;
  --seat-bet-side-center-offset: 44px;
  position: relative;
  width: min(var(--table-max-width), 100%, calc(var(--table-area-height) * var(--table-aspect)));
  aspect-ratio: var(--table-aspect) / 1;
  max-width: 100%;
}

.table-oval[data-seats="2"] {
  --table-aspect: 1.54;
  --table-max-width: 560px;
  --center-lane-width: min(68%, 460px);
  --center-lane-wide-width: min(74%, 520px);
}
.table-oval[data-seats="3"],
.table-oval[data-seats="4"] {
  --table-aspect: 1.6;
  --table-max-width: 650px;
  --center-lane-width: min(62%, 440px);
  --center-lane-wide-width: min(72%, 520px);
}
.table-oval[data-seats="5"],
.table-oval[data-seats="6"] {
  --table-aspect: 1.68;
  --table-max-width: 760px;
}
.table-oval[data-seats="7"],
.table-oval[data-seats="8"] {
  --table-aspect: 1.62;
  --table-max-width: 840px;
  --seat-avatar-size: 60px;
  --seat-avatar-font-size: 22px;
  --seat-zone-width: 96px;
  --seat-zone-height: 88px;
  --seat-info-width: 112px;
  --seat-name-width: 86px;
  --seat-status-width: 104px;
  --seat-strength-width: 108px;
  --seat-meta-offset: 37px;
  --seat-stack-offset: 55px;
  --seat-status-offset: 75px;
  --seat-hole-offset: 93px;
  --seat-strength-offset: 140px;
}
.table-oval[data-seats="9"],
.table-oval[data-seats="10"] {
  --table-aspect: 1.58;
  --table-max-width: 900px;
  --center-lane-width: min(50%, 390px);
  --center-lane-wide-width: min(58%, 460px);
  --table-center-gap: 10px;
  --seat-avatar-size: 56px;
  --seat-avatar-font-size: 21px;
  --seat-zone-width: 84px;
  --seat-zone-height: 80px;
  --seat-info-width: 104px;
  --seat-info-offset: 37px;
  --seat-name-width: 80px;
  --seat-name-font-size: 11px;
  --seat-status-width: 96px;
  --seat-hole-card-width: 28px;
  --seat-hole-card-height: 39px;
  --seat-hole-card-font-size: 11px;
  --seat-hole-card-suit-font-size: 9px;
  --seat-hole-cards-width: 62px;
  --seat-wide-info-width: 176px;
  --seat-strength-width: 100px;
  --seat-meta-offset: 34px;
  --seat-stack-offset: 51px;
  --seat-status-offset: 70px;
  --seat-hole-offset: 88px;
  --seat-strength-offset: 132px;
  --seat-bet-below-center-offset: 38px;
  --seat-bet-above-center-offset: 38px;
  --seat-bet-side-center-offset: 40px;
}

.table-oval[data-layout-density="busy"] {
  --center-lane-width: min(50%, 390px);
  --center-lane-wide-width: min(58%, 460px);
  --table-center-gap: 10px;
}

.table-oval[data-layout-density="crowded"] {
  --center-lane-width: min(46%, 360px);
  --center-lane-wide-width: min(54%, 430px);
  --table-center-gap: 8px;
  --seat-zone-width: 108px;
  --seat-zone-height: 150px;
  --seat-info-width: 96px;
  --seat-info-offset: 35px;
  --seat-name-width: 72px;
  --seat-status-width: 90px;
  --seat-hole-card-width: 26px;
  --seat-hole-card-height: 36px;
  --seat-hole-card-font-size: 10px;
  --seat-hole-card-suit-font-size: 8px;
  --seat-hole-cards-width: 58px;
  --seat-wide-info-width: 164px;
  --seat-strength-width: 92px;
  --seat-meta-offset: 32px;
  --seat-stack-offset: 48px;
  --seat-status-offset: 66px;
  --seat-hole-offset: 83px;
  --seat-strength-offset: 122px;
  --seat-bet-below-center-offset: 36px;
  --seat-bet-above-center-offset: 36px;
  --seat-bet-side-center-offset: 38px;
}

.table-felt {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at center, rgba(47, 112, 77, 0.82) 0%, rgba(25, 70, 48, 0.96) 58%, #123022 100%);
  border: 8px solid #0e2418;
  box-shadow:
    inset 0 0 0 3px rgba(255,255,255,0.045),
    inset 0 0 58px rgba(0,0,0,0.3),
    0 0 0 5px #08170f,
    0 12px 46px rgba(0,0,0,0.62);
  display: flex;
  align-items: center;
  justify-content: center;
}

.table-felt-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--table-center-gap);
  position: relative;
  z-index: var(--z-seat-base);
  width: var(--center-lane-width);
  max-width: calc(100% - 104px);
  min-width: 0;
}

/* ── Pot display ───────────────────────────────────────────────────────────── */

.pot-display {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0,0,0,0.42);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  padding: 7px 18px;
  view-transition-name: pot;
}

.pot-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
}

.pot-amount {
  font-size: 22px;
  font-weight: 700;
  color: var(--gold);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ── Board cards ───────────────────────────────────────────────────────────── */

.board-cards {
  display: flex;
  gap: 8px;
  min-height: 66px;
  align-items: center;
  view-transition-name: board;
}

.card {
  position: relative;
  width: 44px;
  height: 64px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.16);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.1;
  box-shadow: 0 4px 10px rgba(0,0,0,0.42);
  user-select: none;
  flex-shrink: 0;
}

.card .rank { color: #111; }
.card .suit { font-size: 14px; }

/* Default: 4-color deck — improves suit-readability and accessibility. */
.card.spades   .suit { color: var(--suit-spades); }
.card.hearts   .suit { color: var(--suit-hearts); }
.card.diamonds .suit { color: var(--suit-diamonds); }
.card.clubs    .suit { color: var(--suit-clubs); }

/* Classic 2-color override — opt-in via body.deck-2color. */
body.deck-2color .card.spades   .suit,
body.deck-2color .card.clubs    .suit { color: var(--suit-spades); }
body.deck-2color .card.hearts   .suit,
body.deck-2color .card.diamonds .suit { color: var(--suit-hearts); }

.card.best-card {
  transform: translateY(-3px);
  box-shadow:
    0 0 0 2px rgba(226,180,91,0.9),
    0 0 16px rgba(226,180,91,0.5),
    0 3px 8px rgba(0,0,0,0.45);
}

.card-back {
  width: 44px;
  height: 64px;
  background: #1a4a8a;
  border-radius: 6px;
  border: 2px solid rgba(255,255,255,0.15);
  box-shadow: 0 4px 10px rgba(0,0,0,0.42);
  flex-shrink: 0;
}

.card.card-back {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.12) 0 12%, transparent 12% 22%, rgba(255,255,255,0.08) 22% 34%, transparent 34%),
    linear-gradient(135deg, #1f5ca3 0%, #123b78 52%, #1f5ca3 100%);
  border: 2px solid rgba(255,255,255,0.18);
  color: transparent;
}

.card.card-back::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 4px;
}

/* ── Showdown display ─────────────────────────────────────────────────────── */

.showdown-display {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid rgba(226,180,91,0.22);
  border-radius: var(--radius-sm);
  background: rgba(8,10,16,0.34);
}

.showdown-kicker {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}

.showdown-winner-text {
  max-width: 100%;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text);
  text-align: center;
  overflow-wrap: anywhere;
}

.table-oval[data-layout-density="crowded"] .showdown-display {
  gap: 6px;
  padding: 8px 10px;
}

.table-oval[data-layout-density="crowded"] .showdown-winner-text {
  font-size: 13px;
}

.next-hand-countdown {
  width: 100%;
  margin-top: 2px;
}

.next-hand-countdown-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.58);
}

.next-hand-progress-track {
  width: 100%;
  height: 5px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.11);
}

.next-hand-progress-bar {
  width: 100%;
  height: 100%;
  transform-origin: left center;
  transform: scaleX(1);
  background: linear-gradient(90deg, var(--gold), #4caf82);
  transition: transform calc(160ms * var(--motion-scale)) linear;
}

/* ── Table status text ─────────────────────────────────────────────────────── */

.table-status-text {
  position: static;
  flex: 1 1 220px;
  z-index: var(--z-seat-overlay);
  width: auto;
  max-width: min(380px, 48vw);
  margin: 0;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(8,10,16,0.84);
  box-shadow: 0 8px 20px rgba(0,0,0,0.28);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-soft);
  text-align: center;
  min-height: 24px;
  line-height: 1.25;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bomb-pot-pending {
  display: inline-block;
  margin-top: -4px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #ffd166;
  background: rgba(255, 209, 102, 0.12);
  border: 1px solid rgba(255, 209, 102, 0.35);
  border-radius: var(--radius-pill);
  text-align: center;
}

/* Active bomb-pot badge — shown mid-hand when variant === 'plo_bomb' */
.bomb-pot-active {
  display: inline-block;
  margin-top: -4px;
  padding: 5px 13px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: #ffd166;
  background: rgba(255, 209, 102, 0.18);
  border: 1.5px solid rgba(255, 209, 102, 0.55);
  border-radius: var(--radius-pill);
  text-align: center;
  text-shadow: 0 0 8px rgba(255, 209, 102, 0.45);
  animation: bombPotGlow 2s ease-in-out infinite alternate;
}

@keyframes bombPotGlow {
  from { box-shadow: 0 0 4px rgba(255, 209, 102, 0.2); }
  to   { box-shadow: 0 0 12px rgba(255, 209, 102, 0.5); }
}

/* Drawmaha draw-round selection: hero clicks cards to mark for discard. */
.seat-slot.drawmaha-draw-active .seat-info-box {
  pointer-events: auto;
}

.seat-hole-cards .card.drawmaha-discard-target {
  cursor: pointer;
  pointer-events: auto;
  transition:
    transform var(--dur-mid) var(--ease),
    box-shadow var(--dur-mid) var(--ease),
    border-color var(--dur-mid) var(--ease);
}
.seat-hole-cards .card.drawmaha-discard-target:hover {
  transform: translateY(-5px);
}
.card.selected-for-discard {
  z-index: var(--z-seat-overlay);
  border-color: rgba(226, 180, 91, 0.96);
  box-shadow:
    0 0 0 2px rgba(226, 180, 91, 0.92),
    0 8px 18px rgba(0,0,0,0.5);
  transform: translateY(-12px);
}
.card.selected-for-discard:hover {
  transform: translateY(-14px);
}

/* Drawmaha showdown split rows */
.showdown-split-row {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.35;
}
.showdown-split-row .showdown-split-label {
  font-weight: 600;
  color: var(--gold, #e2b45b);
  margin-right: 4px;
}

/* Pot-limit hint label near bet input */
.pot-limit-hint {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  margin-top: 3px;
  letter-spacing: 0.03em;
}

/* Bomb-pot second board: similar to runout but with a yellow accent */
.second-board-container.bomb-pot {
  border-color: rgba(255, 209, 102, 0.4);
  background: rgba(40, 35, 10, 0.22);
}

.btn-armed {
  background: rgba(255, 209, 102, 0.18) !important;
  border-color: rgba(255, 209, 102, 0.5) !important;
  color: #ffd166 !important;
}

/* ── Seat slots ────────────────────────────────────────────────────────────── */

#seatSlots { position: absolute; inset: 0; pointer-events: none; overflow: visible; }

.seat-slot {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: none;
  display: block;
  width: var(--seat-zone-width);
  height: var(--seat-zone-height);
  z-index: var(--z-seat-elevated);
}

.seat-slot > * {
  pointer-events: auto;
}

.seat-avatar {
  width: var(--seat-avatar-size);
  height: var(--seat-avatar-size);
  border-radius: var(--radius-circle);
  border: 2px solid var(--border);
  background: var(--panel-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--seat-avatar-font-size);
  font-weight: 800;
  color: var(--muted);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: var(--z-seat-elevated);
}

.seat-avatar:hover { border-color: var(--gold); background: var(--panel); }

.seat-slot.empty .seat-avatar { border-style: dashed; }
.seat-slot.empty .seat-avatar:hover::after {
  content: "+";
  position: absolute;
  font-size: 28px;
  color: var(--gold);
}

.seat-slot.active-actor .seat-avatar {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

.seat-slot.hero .seat-avatar {
  border-color: #4caf82;
}

.seat-slot.showdown-winner .seat-avatar {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(226,180,91,0.18), 0 0 22px rgba(226,180,91,0.35);
}

.seat-slot.dealer-btn .seat-avatar::before {
  content: "D";
  position: absolute;
  top: -10px;
  right: -10px;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-circle);
  background: var(--gold);
  color: var(--text-on-gold);
  font-size: 10px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-seat-base);
}

.seat-slot.sb-btn .seat-avatar::after {
  content: "SB";
  position: absolute;
  bottom: -10px;
  left: -10px;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-circle);
  background: var(--sb-color);
  color: #fff;
  font-size: 8px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-seat-base);
}

.seat-slot.bb-btn .seat-avatar::after {
  content: "BB";
  position: absolute;
  bottom: -10px;
  left: -10px;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-circle);
  background: var(--bb-color);
  color: #fff;
  font-size: 8px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-seat-base);
}

.seat-position-badge {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  pointer-events: none;
  white-space: nowrap;
  z-index: var(--z-seat-elevated);
}

.seat-position-badge.hidden {
  display: none;
}

.seat-emote {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 28px;
  pointer-events: none;
  z-index: var(--z-seat-overlay);
  animation: seat-emote-in calc(0.2s * var(--motion-scale)) ease forwards,
             seat-emote-out calc(2.3s * var(--motion-scale)) ease calc(0.2s * var(--motion-scale)) forwards;
}

@keyframes seat-emote-in {
  0%   { transform: translateX(-50%) scale(0); opacity: 0; }
  70%  { transform: translateX(-50%) scale(1.2); opacity: 1; }
  100% { transform: translateX(-50%) scale(1); opacity: 1; }
}

@keyframes seat-emote-out {
  0%   { transform: translateX(-50%) translateY(0) scale(1); opacity: 1; }
  100% { transform: translateX(-50%) translateY(-20px) scale(1); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .seat-emote {
    animation: none;
    opacity: 1;
    transform: translateX(-50%);
  }
}

.seat-info-box {
  position: absolute;
  left: 50%;
  top: calc(50% + var(--seat-info-offset));
  transform: translateX(-50%);
  z-index: var(--z-seat-elevated);
  width: var(--seat-info-width);
  max-width: var(--seat-info-width);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 6px 8px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  background: rgba(8,10,16,0.82);
  box-shadow: 0 8px 22px rgba(0,0,0,0.42);
  backdrop-filter: blur(6px);
  pointer-events: none;
}

.seat-slot.wide-hole-cards .seat-info-box {
  width: min(var(--seat-wide-info-width), calc(100vw - 24px));
  max-width: min(var(--seat-wide-info-width), calc(100vw - 24px));
}

.seat-zone-top .seat-info-box {
  top: auto;
  bottom: calc(50% + var(--seat-info-offset));
}

.seat-info-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.seat-name {
  min-width: 0;
  font-size: var(--seat-name-font-size);
  font-weight: 700;
  color: var(--text-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}

.seat-stack {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--seat-stack-font-size);
  color: var(--gold);
  font-weight: 600;
  text-align: right;
  min-width: 0;
  max-width: 48px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  /* D5: subtle flash when stack changes after an action */
  transition: color calc(150ms * var(--motion-scale)) ease, transform calc(150ms * var(--motion-scale)) ease;
}

.seat-bet {
  position: absolute;
  left: 50%;
  top: calc(50% + var(--seat-bet-below-center-offset));
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 13px;
  color: #fff;
  font-weight: 900;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 10px 4px 6px;
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, rgba(34,38,49,0.96), rgba(8,10,16,0.92));
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 8px 18px rgba(0,0,0,0.42);
  display: none;
  /* D5: smooth appearance/disappearance as bets are placed/collected */
  transition: color calc(150ms * var(--motion-scale)) ease, transform calc(150ms * var(--motion-scale)) ease, opacity calc(150ms * var(--motion-scale)) ease;
  z-index: var(--z-seat-base);
}

.seat-bet.visible { display: inline-flex; }

.seat-slot.bet-above .seat-bet {
  top: calc(50% - var(--seat-bet-above-center-offset));
  transform: translate(-50%, -100%);
}

.seat-slot.bet-left .seat-bet {
  left: calc(50% - var(--seat-bet-side-center-offset));
  top: 50%;
  transform: translate(-100%, -50%);
}

.seat-slot.bet-right .seat-bet {
  left: calc(50% + var(--seat-bet-side-center-offset));
  top: 50%;
  transform: translateY(-50%);
}

.seat-bet-chips {
  position: relative;
  width: 24px;
  height: 21px;
  display: inline-block;
  flex: 0 0 24px;
}

.seat-bet-chip {
  position: absolute;
  left: 2px;
  width: 19px;
  height: 7px;
  border-radius: 50%;
  background: #d74848;
  border: 1px solid rgba(255,255,255,0.42);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.24);
}

.seat-bet-chip:nth-child(1) { bottom: 0; }
.seat-bet-chip:nth-child(2) { bottom: 6px; background: #f0c85d; }
.seat-bet-chip:nth-child(3) { bottom: 12px; background: #3f8fd8; }

.seat-bet-amount {
  min-width: 14px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.seat-status-badge {
  width: 100%;
  max-width: 100%;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 3px 6px;
  border-radius: 2px;
  display: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

.seat-status-badge.folded { display: block; background: rgba(0,0,0,0.5); color: var(--muted); }
.seat-status-badge.all-in { display: block; background: var(--rose-soft); color: var(--rose); border: 1px solid rgba(240,109,121,0.3); }
.seat-status-badge.sitting-out { display: block; background: var(--panel); color: var(--muted); border: 1px solid var(--border); }
.seat-status-badge.rebuy-pending { display: block; background: rgba(226,180,91,0.14); color: var(--gold); border: 1px solid rgba(226,180,91,0.35); }
.seat-status-badge.disconnected { display: block; background: rgba(60,60,80,0.7); color: rgba(160,160,180,0.85); border: 1px solid rgba(120,120,140,0.3); font-style: italic; }

.seat-slot.rebuy-pending .seat-avatar {
  border-color: rgba(226,180,91,0.7);
  box-shadow: 0 0 0 2px rgba(226,180,91,0.12), 0 0 18px rgba(226,180,91,0.22);
}

/* A5: Disconnected seat — desaturated avatar, italic name */
.seat-slot.disconnected .seat-avatar {
  filter: grayscale(70%);
  opacity: 0.65;
  border-color: rgba(120, 120, 140, 0.4);
}

.seat-slot.disconnected .seat-name {
  color: var(--muted);
  font-style: italic;
}

/* A5: Host kick button — shown on disconnected seats for the host */
.seat-kick-btn {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-circle);
  background: rgba(220, 60, 60, 0.85);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  line-height: 22px;
  text-align: center;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.25);
  z-index: var(--z-seat-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background calc(0.15s * var(--motion-scale));
}

.seat-kick-btn:hover {
  background: rgba(200, 40, 40, 0.95);
}

/* Hole cards shown on seats for the viewer's hand and public showdown reveals */
.seat-hole-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 100%;
  min-height: var(--seat-hole-card-height);
}

.seat-hole-cards[data-card-count="4"],
.seat-hole-cards[data-card-count="5"] {
  flex-wrap: nowrap;
}

.seat-hole-cards:empty {
  display: none;
}

.seat-hole-cards .card {
  width: var(--seat-hole-card-width);
  height: var(--seat-hole-card-height);
  font-size: var(--seat-hole-card-font-size);
}

.seat-hole-cards .card .suit { font-size: var(--seat-hole-card-suit-font-size); }

.seat-hand-strength {
  width: 100%;
  max-width: 100%;
  min-height: 17px;
  padding: 3px 6px;
  border-radius: var(--radius-pill);
  background: rgba(8,10,16,0.62);
  border: 1px solid rgba(226,180,91,0.28);
  color: var(--gold);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  white-space: normal;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.seat-zone-middle .seat-hand-strength {
  width: min(var(--seat-strength-width), 96px);
}

/* ── Host controls ─────────────────────────────────────────────────────────── */

.host-controls {
  position: absolute;
  top: 12px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px 12px;
}

.host-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 11px;
}

/* ── Right panel ───────────────────────────────────────────────────────────── */

.right-panel {
  grid-column: 2;
  grid-row: 1;
  width: auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-left: 1px solid var(--glass-border);
  overflow: hidden;
}

/* ── Hero panel ────────────────────────────────────────────────────────────── */

.hero-panel {
  grid-column: 1 / -1;
  grid-row: 2;
  padding: 12px 20px;
  border-top: 1px solid var(--glass-border);
  min-height: 92px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 16px;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: 0 -12px 30px rgba(0,0,0,0.22);
  z-index: var(--z-seat-overlay);
}

.hero-sit-panel {
  flex: 0 1 460px;
}

.hero-sit-label {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  padding: 8px 0;
}

.hero-buyin-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  min-width: min(420px, 100%);
}

.hero-buyin-row .form-field { flex: 1; }

.player-settings-btn {
  flex: 0 0 auto;
  align-self: center;
  opacity: 0.78;
  white-space: nowrap;
}

.player-settings-btn:hover {
  opacity: 1;
}

.emote-picker-wrap {
  position: relative;
  flex: 0 0 auto;
  align-self: center;
}

.emote-picker-btn {
  opacity: 0.78;
  font-size: 18px;
  padding: 4px 8px;
}

.emote-picker-btn:hover {
  opacity: 1;
}

.emote-popover {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 18px rgba(0,0,0,0.42);
  z-index: var(--z-seat-overlay);
  white-space: nowrap;
}

.emote-opt {
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 22px;
  padding: 4px 6px;
  line-height: 1;
  transition: background calc(0.12s * var(--motion-scale)) ease, border-color calc(0.12s * var(--motion-scale)) ease;
}

.emote-opt:hover {
  background: var(--panel-soft);
  border-color: var(--border);
}

/* ── Action controls ───────────────────────────────────────────────────────── */

.action-controls {
  display: flex;
  flex: 1 1 640px;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: min(640px, 100%);
  max-width: 980px;
}

.bet-slider-row {
  display: flex;
  flex-direction: column;
  flex: 1 1 360px;
  gap: 6px;
  min-width: 260px;
  border-radius: var(--radius-sm);
  transition: box-shadow var(--dur-fast) var(--ease);
}

.bet-slider-row.bet-entry-active {
  box-shadow: 0 0 0 2px rgba(226, 180, 91, 0.34);
}

.bet-slider-row input[type="range"] {
  width: 100%;
  accent-color: var(--gold);
}

.bet-number-input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 6px 10px;
  font-size: 14px;
  width: 100%;
  text-align: right;
}

.bet-number-input:focus { border-color: var(--gold); outline: none; }

.action-buttons {
  display: grid;
  grid-template-columns: repeat(4, minmax(86px, 1fr));
  flex: 1 1 420px;
  gap: 6px;
  max-width: 560px;
}

.action-btn {
  min-height: 42px;
  padding: 10px 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: background var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
}

.action-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.action-hotkey {
  min-width: 20px;
  padding: 2px 5px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.66);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  text-transform: none;
}

.action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.action-btn.fold,
.pre-action-btn.pre-action-fold {
  background: transparent;
  border-color: var(--border);
  color: var(--rose);
  grid-column: span 1;
}

.action-btn.fold:hover:not(:disabled),
.pre-action-btn.pre-action-fold:hover:not(:disabled) {
  background: var(--rose-soft);
  border-color: rgba(240,109,121,0.4);
}

.action-btn.check,
.action-btn.call,
.pre-action-btn.pre-action-check,
.pre-action-btn.pre-action-call {
  background: var(--panel-strong);
  border-color: var(--border);
  color: var(--text-soft);
  grid-column: span 1;
}

.action-btn.check:hover:not(:disabled),
.action-btn.call:hover:not(:disabled),
.pre-action-btn.pre-action-check:hover:not(:disabled),
.pre-action-btn.pre-action-call:hover:not(:disabled) {
  border-color: var(--border-strong);
  color: var(--text);
}

.action-btn.bet,
.action-btn.raise {
  background: var(--gold-soft);
  border-color: rgba(226,180,91,0.3);
  color: var(--gold);
  grid-column: span 1;
}

.action-btn.bet:hover:not(:disabled),
.action-btn.raise:hover:not(:disabled) {
  background: rgba(226,180,91,0.2);
  border-color: var(--gold);
}

.action-btn.drawmaha-confirm {
  background: var(--gold-soft);
  border-color: rgba(226,180,91,0.3);
  color: var(--gold);
  grid-column: 1 / -1;
}

.action-btn.drawmaha-confirm:hover:not(:disabled) {
  background: rgba(226,180,91,0.2);
  border-color: var(--gold);
}

/* ── Pre-action panel ──────────────────────────────────────────────────────── */

.pre-action-panel {
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 2px 0;
}

.pre-action-options {
  margin: 0 auto;
}

.pre-action-btn.active {
  border-color: var(--gold);
  color: var(--gold);
}

.pre-action-cancel {
  opacity: 0.7;
}

.pre-action-cancel:hover {
  opacity: 1;
}

/* ── Seated controls ───────────────────────────────────────────────────────── */

.seated-controls {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.rebuy-panel {
  flex: 1 1 560px;
  max-width: 760px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: min(560px, 100%);
}

.rebuy-header {
  flex: 0 0 116px;
  min-width: 0;
}

.rebuy-title {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.58);
}

.rebuy-timer {
  margin-top: 2px;
  font-size: 18px;
  font-weight: 900;
  color: var(--gold);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.rebuy-progress-track {
  flex: 1 1 140px;
  min-width: 120px;
}

.rebuy-actions {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex: 0 1 360px;
}

.rebuy-amount-field {
  min-width: 130px;
}

/* ── Log panel ─────────────────────────────────────────────────────────────── */

.log-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.log-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.log-tab {
  flex: 1;
  padding: 10px 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
  margin-bottom: -1px;
}

.log-tab.active {
  color: var(--text);
  border-bottom-color: var(--gold);
}

.log-tab-hotkey {
  min-width: 17px;
  padding: 1px 4px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.68);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  text-transform: none;
}

.log-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.fairness-panel {
  color: var(--text-soft);
}

/* ── Chat panel ─────────────────────────────────────────────────────────────── */

.chat-panel {
  display: flex;
  flex-direction: column;
  padding: 0;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-message {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-message-meta {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.chat-message-meta strong {
  color: var(--text-soft);
  font-weight: 700;
}

.chat-message-text {
  font-size: 13px;
  color: var(--text);
  word-break: break-word;
}

.chat-input-row {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  background: var(--surface2, #1e2130);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  padding: 6px 10px;
  outline: none;
}

.chat-input:focus {
  border-color: var(--gold);
}

.chat-send-btn {
  background: var(--gold);
  border: none;
  border-radius: 6px;
  color: #000;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  cursor: pointer;
  white-space: nowrap;
}

.chat-send-btn:hover {
  opacity: 0.85;
}

.fairness-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.fairness-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.fairness-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.fairness-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}

.fairness-state {
  flex-shrink: 0;
  padding: 3px 8px;
  border: 1px solid rgba(226, 180, 91, 0.35);
  border-radius: var(--radius-sm);
  color: var(--gold);
  background: var(--gold-soft);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.fairness-row,
.fairness-participant {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.025);
}

.fairness-label,
.fairness-participant-label,
.fairness-section-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.fairness-value {
  display: block;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.45;
  color: var(--text);
  background: transparent;
}

.fairness-section-title {
  margin-top: 2px;
}

.fairness-participants {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.fairness-empty {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  padding: 10px 0;
}

.fairness-empty.compact {
  padding: 4px 0;
  font-size: 11px;
}

.fairness-actions {
  display: flex;
  gap: 8px;
}

.fairness-verify-btn {
  width: 100%;
  border: 1px solid rgba(226, 180, 91, 0.35);
  border-radius: var(--radius-sm);
  background: rgba(226, 180, 91, 0.12);
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  padding: 8px 10px;
  cursor: pointer;
}

.fairness-verify-btn:hover {
  background: rgba(226, 180, 91, 0.18);
}

.fairness-proof-page {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

.fairness-proof-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 28px auto 48px;
}

.fairness-proof-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.fairness-proof-header h1,
.fairness-proof-main h2,
.fairness-proof-side h2 {
  margin: 0;
  letter-spacing: 0;
}

.fairness-proof-header h1 {
  font-size: 28px;
}

.fairness-proof-main h2,
.fairness-proof-side h2 {
  font-size: 16px;
  margin-bottom: 12px;
}

.fairness-proof-status {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.fairness-proof-status[data-state="passed"] {
  border-color: rgba(88, 214, 141, 0.45);
  color: #58d68d;
  background: rgba(88, 214, 141, 0.10);
}

.fairness-proof-status[data-state="failed"] {
  border-color: rgba(255, 107, 107, 0.45);
  color: #ff8a8a;
  background: rgba(255, 107, 107, 0.10);
}

.fairness-proof-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  gap: 18px;
  margin-top: 18px;
}

.fairness-proof-main,
.fairness-proof-side {
  min-width: 0;
}

.proof-checks,
.proof-material {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.proof-check,
.proof-field {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.025);
}

.proof-check {
  padding: 12px;
}

.proof-check.pass {
  border-color: rgba(88, 214, 141, 0.28);
}

.proof-check.fail {
  border-color: rgba(255, 107, 107, 0.34);
}

.proof-check-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.proof-check-top strong {
  font-size: 13px;
}

.proof-check-top span {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 900;
  color: var(--muted);
}

.proof-check.pass .proof-check-top span {
  color: #58d68d;
}

.proof-check.fail .proof-check-top span {
  color: #ff8a8a;
}

.proof-check p {
  margin: 8px 0 0;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.5;
}

.proof-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  padding: 8px;
  margin-top: 8px;
}

.proof-material .proof-field {
  margin-top: 0;
}

.proof-field span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.proof-field code {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: normal;
}

@media (max-width: 860px) {
  .fairness-proof-grid {
    grid-template-columns: 1fr;
  }

  .fairness-proof-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Hand log entries */
.log-entry {
  font-size: 11px;
  color: var(--text-soft);
  padding: 3px 0;
  line-height: 1.5;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.log-entry.street-header {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 8px;
}

.log-entry.hand-divider {
  border-top: 1px solid var(--border);
  margin: 6px 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.log-entry.winner {
  color: var(--gold);
  font-weight: 700;
}

.log-entry .action-name {
  font-weight: 700;
  color: var(--text);
}

/* Ledger */
.ledger-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.ledger-summary-cell {
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03);
}

.ledger-summary-label {
  display: block;
  margin-bottom: 4px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.ledger-summary-value {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
}

.ledger-summary-value.positive,
.ledger-net.positive,
.ledger-detail-net .positive {
  color: #4caf82;
}

.ledger-summary-value.negative,
.ledger-net.negative,
.ledger-detail-net .negative {
  color: var(--rose);
}

.ledger-summary-value.balanced {
  color: var(--gold);
}

.ledger-player-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.025);
  margin-bottom: 8px;
  overflow: hidden;
}

.ledger-player-toggle {
  width: 100%;
  min-height: 52px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.ledger-player-toggle:hover {
  background: rgba(255,255,255,0.04);
}

.ledger-player-main {
  min-width: 0;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
}

.ledger-chevron {
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 5px solid var(--muted);
  transform-origin: 40% 50%;
  transition: transform var(--dur-fast) var(--ease);
}

.ledger-player-toggle[aria-expanded="true"] .ledger-chevron {
  transform: rotate(90deg);
}

.ledger-subline {
  grid-column: 2;
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ledger-player-numbers {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 68px;
}

.ledger-stack {
  color: var(--muted);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 10px;
}

.ledger-player-details {
  padding: 0 10px 10px 28px;
}

.ledger-entry-details {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 8px;
  margin-top: 2px;
}

.ledger-entry-label {
  margin-bottom: 6px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.ledger-detail-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 4px 0;
  font-size: 11px;
  color: var(--text-soft);
}

.ledger-detail-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.ledger-detail-kind {
  color: var(--text);
  font-weight: 700;
}

.ledger-detail-time {
  color: var(--muted);
  font-size: 10px;
}

.ledger-detail-amount,
.ledger-detail-total span:last-child,
.ledger-detail-net span:last-child {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.ledger-detail-amount.cash-out {
  color: #4caf82;
}

.ledger-detail-total {
  border-top: 1px solid rgba(255,255,255,0.05);
  margin-top: 5px;
  padding-top: 6px;
}

.ledger-detail-net {
  color: var(--text);
  font-weight: 800;
}

.ledger-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.ledger-name { color: var(--text); font-weight: 600; }
.ledger-net  { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 700; }

.ledger-empty {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding: 20px 0;
}

/* ── Bank panel ──────────────────────────────────────────────────────────────── */

.bank-empty {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding: 20px 0;
}

.bank-section-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 0 6px;
}
.bank-section-label:first-child { padding-top: 2px; }

/* Request cards (host view) */
.chip-request-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.chip-request-card.chip-request-approved {
  border-color: rgba(76, 175, 130, 0.35);
  background: rgba(76, 175, 130, 0.07);
}
.chip-request-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.chip-request-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chip-request-seat {
  font-size: 10px;
  color: var(--muted);
}
.chip-request-amount {
  font-size: 11px;
  font-weight: 600;
  color: var(--gold);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.chip-request-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.chip-request-approved-badge {
  font-size: 11px;
  font-weight: 700;
  color: #4caf82;
  flex-shrink: 0;
}

.btn-approve,
.btn-deny {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-approve:hover, .btn-deny:hover { opacity: 0.8; }
.btn-approve {
  background: #4caf82;
  color: #fff;
}
.btn-deny {
  background: rgba(255,255,255,0.1);
  color: var(--text-soft);
}

/* Player bank view — CTA */
.bank-cta {
  padding: 14px 0 10px;
  text-align: center;
}
.bank-cta-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}
.bank-cta-sub {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

/* Player bank view — form */
.bank-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
}
.bank-match-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-soft);
  cursor: pointer;
  user-select: none;
}
.bank-submit-btn {
  width: 100%;
  padding: 10px;
  font-size: 13px;
  font-weight: 700;
}
.bank-cancel-edit-btn {
  width: 100%;
  margin-top: -2px;
}

/* Player bank view — live request state */
.bank-request-live {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 6px;
}
.bank-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bank-dot {
  width: 9px;
  height: 9px;
  border-radius: var(--radius-circle);
  flex-shrink: 0;
}
.bank-dot-pending  { background: var(--gold); animation: pulse-dot 1.6s ease-in-out infinite; }
.bank-dot-approved { background: #4caf82; }
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}
.bank-status-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}
.bank-request-amount {
  font-size: 20px;
  font-weight: 800;
  color: var(--gold);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.bank-request-note {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}
.bank-request-btns {
  display: flex;
  gap: 8px;
  padding-top: 4px;
}
.bank-request-btns .btn-secondary {
  flex: 1;
}

/* ── Responsive: stack layout when the table needs the full width ───────────── */

@container table-layout (max-width: 980px) {
  .table-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto minmax(220px, 38vh);
    height: auto;
    min-height: calc(100dvh - 56px);
    overflow: auto;
  }

  .table-area {
    grid-column: 1;
    grid-row: 1;
    min-height: clamp(500px, 78vw, 720px);
    padding: 34px 8px 26px;
  }

  .table-oval,
  .table-oval[data-seats="2"],
  .table-oval[data-seats="3"],
  .table-oval[data-seats="4"],
  .table-oval[data-seats="5"],
  .table-oval[data-seats="6"],
  .table-oval[data-seats="7"],
  .table-oval[data-seats="8"],
  .table-oval[data-seats="9"],
  .table-oval[data-seats="10"] {
    --table-aspect: 1.32;
    --table-max-width: 760px;
    --center-lane-width: min(50%, 360px);
    --center-lane-wide-width: min(58%, 430px);
    --table-center-gap: 10px;
    --seat-avatar-size: 56px;
    --seat-avatar-font-size: 20px;
    --seat-zone-width: 116px;
    --seat-zone-height: 112px;
    --seat-info-width: 104px;
    --seat-info-offset: 37px;
    --seat-name-width: 76px;
    --seat-name-font-size: 11px;
    --seat-stack-min-width: 44px;
    --seat-stack-font-size: 11px;
    --seat-status-width: 96px;
    --seat-hole-card-width: 28px;
    --seat-hole-card-height: 39px;
    --seat-hole-card-font-size: 11px;
    --seat-hole-card-suit-font-size: 9px;
    --seat-hole-cards-width: 62px;
    --seat-wide-info-width: 176px;
    --seat-strength-width: 96px;
    --seat-meta-offset: 34px;
    --seat-stack-offset: 51px;
    --seat-status-offset: 70px;
    --seat-hole-offset: 88px;
    --seat-strength-offset: 132px;
    --seat-bet-below-center-offset: 38px;
    --seat-bet-above-center-offset: 38px;
    --seat-bet-side-center-offset: 40px;
    width: min(94vw, var(--table-max-width));
  }

  .table-oval[data-seats="7"],
  .table-oval[data-seats="8"] {
    --table-aspect: 1.28;
    --table-max-width: 800px;
    --seat-zone-width: 76px;
    --seat-zone-height: 76px;
  }

  .table-oval[data-seats="9"],
  .table-oval[data-seats="10"] {
    --table-aspect: 1.22;
    --table-max-width: 820px;
    --seat-avatar-size: 52px;
    --seat-avatar-font-size: 19px;
    --seat-name-width: 72px;
    --seat-zone-width: 68px;
    --seat-zone-height: 64px;
    --seat-info-width: 98px;
    --seat-info-offset: 35px;
    --seat-strength-width: 92px;
    --seat-meta-offset: 32px;
    --seat-stack-offset: 49px;
    --seat-status-offset: 67px;
    --seat-hole-offset: 84px;
    --seat-strength-offset: 124px;
    --seat-bet-below-center-offset: 36px;
    --seat-bet-above-center-offset: 36px;
    --seat-bet-side-center-offset: 38px;
  }

  .table-felt {
    border-width: 6px;
    box-shadow:
      inset 0 0 0 2px rgba(255,255,255,0.04),
      inset 0 0 38px rgba(0,0,0,0.28),
      0 0 0 4px #08170f,
      0 8px 30px rgba(0,0,0,0.55);
  }

  .board-cards {
    gap: 6px;
    min-height: 58px;
  }

  .card,
  .card-back {
    width: 38px;
    height: 56px;
  }

  .card {
    font-size: 14px;
  }

  .card .suit {
    font-size: 12px;
  }

  .seat-bet {
    font-size: 12px;
  }

  .seat-hand-strength {
    font-size: 9px;
  }

  .hero-panel {
    grid-column: 1;
    grid-row: 2;
    min-height: auto;
    padding: 12px;
    align-items: stretch;
  }

  .hero-sit-panel,
  .action-controls,
  .seated-controls,
  .rebuy-panel,
  .player-settings-btn {
    flex: 1 1 100%;
    min-width: 0;
    width: 100%;
  }

  .hero-sit-label {
    text-align: center;
  }

  .hero-buyin-row {
    min-width: 0;
  }

  .action-controls {
    flex-direction: column;
    flex: 0 0 auto;
    gap: 10px;
    max-width: none;
  }

  .bet-slider-row {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
  }

  .action-buttons {
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .action-btn {
    min-height: 50px;
    padding: 8px 6px;
  }

  .seated-controls {
    justify-content: center;
    margin-left: 0;
  }

  .rebuy-panel {
    flex-direction: column;
    align-items: stretch;
    max-width: none;
  }

  .rebuy-header {
    flex: 0 0 auto;
    text-align: center;
  }

  .rebuy-actions {
    flex: 1 1 auto;
    width: 100%;
  }

  .rebuy-actions .btn-primary,
  .rebuy-actions .btn-secondary {
    flex: 1;
  }

  .player-settings-btn {
    max-width: 220px;
  }

  .right-panel {
    grid-column: 1;
    grid-row: 3;
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--border);
    max-height: 45vh;
  }
}

@container table-layout (max-width: 480px) {
  .table-area {
    min-height: clamp(430px, 118vw, 560px);
    padding-inline: 6px;
  }

  .table-oval[data-seats="7"],
  .table-oval[data-seats="8"] {
    --table-aspect: 1.18;
    --seat-avatar-size: 48px;
    --seat-avatar-font-size: 18px;
    --seat-zone-width: 56px;
    --seat-zone-height: 56px;
    --seat-info-width: 92px;
    --seat-info-offset: 33px;
    --seat-name-width: 68px;
    --seat-status-width: 86px;
    --seat-hole-card-width: 26px;
    --seat-hole-card-height: 36px;
    --seat-hole-card-font-size: 10px;
    --seat-hole-card-suit-font-size: 8px;
    --seat-hole-cards-width: 58px;
    --seat-wide-info-width: 164px;
    --seat-strength-width: 86px;
    --seat-meta-offset: 30px;
    --seat-stack-offset: 46px;
    --seat-status-offset: 63px;
    --seat-hole-offset: 79px;
    --seat-strength-offset: 117px;
    --seat-bet-below-center-offset: 34px;
    --seat-bet-above-center-offset: 34px;
    --seat-bet-side-center-offset: 36px;
  }

  .table-oval[data-seats="9"],
  .table-oval[data-seats="10"] {
    --table-aspect: 1.12;
    --seat-avatar-size: 44px;
    --seat-avatar-font-size: 17px;
    --seat-name-width: 62px;
    --seat-name-font-size: 10px;
    --seat-stack-min-width: 38px;
    --seat-stack-font-size: 10px;
    --seat-zone-width: 54px;
    --seat-zone-height: 54px;
    --seat-info-width: 86px;
    --seat-info-offset: 31px;
    --seat-status-width: 82px;
    --seat-hole-card-width: 24px;
    --seat-hole-card-height: 34px;
    --seat-hole-card-font-size: 10px;
    --seat-hole-card-suit-font-size: 8px;
    --seat-hole-cards-width: 54px;
    --seat-wide-info-width: 154px;
    --seat-strength-width: 82px;
    --seat-meta-offset: 29px;
    --seat-stack-offset: 44px;
    --seat-status-offset: 60px;
    --seat-hole-offset: 75px;
    --seat-strength-offset: 111px;
    --seat-bet-below-center-offset: 32px;
    --seat-bet-above-center-offset: 32px;
    --seat-bet-side-center-offset: 34px;
  }

  .table-oval[data-seats="9"] .seat-stack,
  .table-oval[data-seats="10"] .seat-stack {
    padding: 1px 5px;
  }
}

/* ── PR 7: Timers and time bank ─────────────────────────────────────────────── */

/* Countdown badge on the active seat */
.timer-countdown {
  position: absolute;
  top: calc(50% - 42px);
  left: 50%;
  transform: translate(-50%, -100%);
  min-width: 28px;
  height: 28px;
  line-height: 28px;
  text-align: center;
  padding: 0 5px;
  border-radius: 14px;
  background: rgba(30, 36, 48, 0.88);
  border: 1.5px solid var(--gold);
  color: var(--gold);
  font-family: var(--font-mono, monospace);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  pointer-events: none;
  z-index: var(--z-seat-overlay);
  transition: color calc(0.2s * var(--motion-scale)), border-color calc(0.2s * var(--motion-scale));
}

/* Flash red when <= 5 seconds */
.timer-countdown.urgent {
  color: var(--rose, #e85d6a);
  border-color: var(--rose, #e85d6a);
  animation: timerUrgentPulse 0.5s ease-in-out infinite alternate;
}

@keyframes timerUrgentPulse {
  from { opacity: 1; }
  to   { opacity: 0.55; }
}

/* Time bank remaining badge */
.time-bank-badge {
  position: absolute;
  left: 50%;
  top: calc(50% - 58px);
  transform: translate(-50%, -100%);
  font-size: 10px;
  font-family: var(--font-mono, monospace);
  font-weight: 600;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 4px);
  padding: 1px 5px;
  pointer-events: none;
  white-space: nowrap;
  z-index: var(--z-seat-overlay);
}

/* Paused overlay — covers the table area */
.paused-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 22, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-table-overlay);
  border-radius: inherit;
  backdrop-filter: blur(2px);
  pointer-events: none;
}

.paused-overlay-text {
  font-size: 28px;
  font-weight: 800;
  color: var(--gold, #e2b45b);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}

/* Host controls panel — pinned to the top of the right panel */
.host-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

.host-add-time-btn {
  background: rgba(226, 180, 91, 0.12);
  border: 1px solid rgba(226, 180, 91, 0.3);
  color: var(--gold, #e2b45b);
  border-radius: var(--radius-sm, 4px);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  cursor: pointer;
  transition: background calc(0.15s * var(--motion-scale));
}

.host-add-time-btn:hover {
  background: rgba(226, 180, 91, 0.22);
}

/* ── Premium host room controls ───────────────────────────────────────────── */

.room-controls-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal-stacked);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 7, 12, 0.72);
  backdrop-filter: blur(4px);
}

.room-controls-dialog {
  width: min(920px, 96vw);
  max-height: min(760px, calc(100vh - 48px));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--glass-bg-strong);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
}

.room-controls-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.room-controls-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
}

.room-controls-title {
  margin: 2px 0 0;
  font-size: 18px;
  color: var(--text);
}

.room-controls-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-circle);
  border: 1px solid var(--border);
  background: var(--panel-strong);
  color: var(--text-soft);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.room-controls-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 12px 0;
  background: #141821;
}

.room-control-tab {
  padding: 9px 14px;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.room-control-tab.active {
  color: var(--text);
  background: #171b24;
  border-color: rgba(255,255,255,0.08);
}

.room-controls-body {
  overflow-y: auto;
  padding: 18px 20px 20px;
}

.room-controls-status {
  display: none;
  padding: 10px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  color: var(--gold);
  font-size: 12px;
}

.room-control-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
}

.room-player-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.room-player-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) 72px 96px repeat(4, auto);
  gap: 8px;
  align-items: center;
  padding: 10px;
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
}

.room-player-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
}

.room-player-sub {
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
}

.room-player-stack {
  font-size: 13px;
  font-weight: 800;
  color: var(--gold);
  text-align: right;
}

.room-chip-input,
.room-session-controls input,
.room-settings-form input,
.room-settings-form select {
  width: 100%;
  padding: 8px 10px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.room-control-small-btn {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-soft);
  background: var(--panel-strong);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.room-control-small-btn:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--border-strong);
}

.room-control-small-btn:disabled,
.room-settings-form button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.room-settings-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.room-settings-section {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
  padding: 12px;
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
}

.room-settings-title {
  grid-column: 1 / -1;
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.room-settings-form label,
.room-session-controls label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted-strong);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.room-settings-form .room-toggle {
  grid-column: span 1;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  min-height: 36px;
  color: var(--text-soft);
  text-transform: none;
  letter-spacing: 0;
}

.player-settings-dialog {
  width: min(540px, 94vw);
}

.player-settings-form {
  grid-template-columns: minmax(0, 1fr);
}

.player-hotkeys-section {
  grid-template-columns: minmax(0, 1fr);
}

.auto-rebuy-section {
  grid-template-columns: minmax(0, 1fr);
}

.auto-rebuy-amount-input {
  padding: 5px 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 5px;
  color: var(--text);
  font-size: 13px;
}

.auto-rebuy-amount-input:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.hotkey-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.hotkey-row:last-child {
  border-bottom: 0;
}

.hotkey-action-label {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 800;
}

.hotkey-capture {
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 5px;
  background: rgba(255,255,255,0.045);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.hotkey-capture:hover,
.hotkey-capture.listening {
  border-color: rgba(226,180,91,0.55);
  background: rgba(226,180,91,0.12);
  color: var(--gold);
}

.room-settings-actions,
.room-session-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.room-settings-locked {
  margin-right: auto;
  color: var(--muted);
  font-size: 12px;
}

.room-session-controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.room-controls-empty {
  padding: 22px;
  border: 1px dashed var(--border);
  border-radius: 6px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

@media (max-width: 780px) {
  .room-player-row {
    grid-template-columns: 1fr 70px;
  }

  .room-chip-input,
  .room-player-row .room-control-small-btn {
    grid-column: span 1;
  }

  .room-settings-form {
    grid-template-columns: 1fr;
  }
}

/* ── Rabbit hunting (PR 8) ─────────────────────────────────────────────────── */

/*
 * Container sits below the board area and is VISUALLY DISTINCT from the
 * official board.  Dashed border + muted background communicate that these
 * cards are informational only and did NOT affect the outcome.
 */
.rabbit-hunt-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 16px;
  border: 2px dashed rgba(150, 150, 160, 0.45);
  border-radius: var(--radius-md, 8px);
  background: rgba(60, 60, 70, 0.18);
}

/* Label above the rabbit cards */
.rabbit-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(180, 180, 195, 0.75);
  user-select: none;
}

/* Row of rabbit cards */
.rabbit-cards {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Individual rabbit card — greyed-out version of the normal .card */
.rabbit-cards .rabbit-card {
  opacity: 0.55;
  filter: grayscale(40%);
  cursor: default;
  pointer-events: none;
}

/* "Reveal remaining board" button */
.rabbit-reveal-btn {
  padding: 7px 16px;
  border: 1px solid rgba(150, 150, 160, 0.5);
  border-radius: var(--radius-sm, 4px);
  background: rgba(80, 80, 90, 0.25);
  color: rgba(200, 200, 210, 0.9);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background calc(0.15s * var(--motion-scale)), border-color calc(0.15s * var(--motion-scale));
}

.rabbit-reveal-btn:hover:not(:disabled) {
  background: rgba(100, 100, 115, 0.4);
  border-color: rgba(180, 180, 195, 0.7);
}

.rabbit-reveal-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

/* Hand log entries for rabbit events */
.log-entry.rabbit-available {
  color: rgba(170, 170, 185, 0.7);
  font-style: italic;
  font-size: 11px;
}

.log-entry.rabbit-revealed {
  color: rgba(160, 170, 200, 0.85);
  font-style: italic;
}

/* ── Run-it-twice (PR 9) ──────────────────────────────────────────────────── */

/* RIT vote modal overlay */
.rit-vote-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal-backdrop);
}

.rit-vote-modal-inner {
  background: var(--surface, #1e1f26);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 34px 36px;
  max-width: 560px;
  width: min(94vw, 560px);
  text-align: left;
  box-shadow: 0 26px 90px rgba(0,0,0,0.55);
}

.rit-vote-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.rit-vote-title {
  font-size: 30px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.rit-vote-desc {
  font-size: 17px;
  color: rgba(200, 200, 215, 0.8);
  margin-bottom: 24px;
  line-height: 1.5;
}

.rit-vote-timer {
  min-width: 58px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(226,180,91,0.13);
  border: 1px solid rgba(226,180,91,0.32);
  color: var(--gold, #e2b45b);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 18px;
  font-weight: 900;
  text-align: center;
}

.rit-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.rit-choice-btn {
  min-height: 58px;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
}

.rit-choice-btn:hover:not(:disabled),
.rit-choice-btn.selected {
  border-color: var(--gold, #e2b45b);
  background: rgba(226,180,91,0.13);
}

.rit-choice-btn:disabled {
  opacity: 0.72;
  cursor: default;
}

.rit-vote-roster {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 6px 0 22px;
}

.rit-player-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 7px;
  background: rgba(255,255,255,0.035);
  font-size: 15px;
}

.rit-player-row.hero {
  border-color: rgba(76,175,130,0.36);
}

.rit-player-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.rit-player-choice {
  color: var(--gold, #e2b45b);
  font-weight: 800;
}

.rit-player-state {
  min-width: 82px;
  text-align: center;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.07);
  color: rgba(220,220,230,0.78);
  font-size: 12px;
  font-weight: 800;
}

.rit-player-state.confirmed {
  background: rgba(76,175,130,0.16);
  color: #76d6a5;
}

.rit-vote-buttons {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.rit-btn {
  min-height: 50px;
  padding: 0 28px;
  border-radius: 6px;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: background calc(0.15s * var(--motion-scale)), opacity calc(0.15s * var(--motion-scale));
  border: none;
}

.rit-approve {
  background: #2a9d56;
  color: #fff;
}

.rit-approve:hover {
  background: #25873f;
}

.rit-deny {
  background: rgba(200, 60, 60, 0.85);
  color: #fff;
}

.rit-deny:hover {
  background: rgba(180, 40, 40, 0.9);
}

/* Second board container (RIT approved) */
.second-board-container {
  width: min(100%, var(--center-lane-wide-width));
  margin: 10px auto 0;
  padding: 12px 14px;
  border: 1px dashed rgba(120, 180, 255, 0.35);
  border-radius: var(--radius-sm);
  background: rgba(40, 60, 100, 0.18);
  display: grid;
  gap: 8px;
}

.second-board-container.runout {
  border-color: rgba(226, 180, 91, 0.42);
  background: rgba(30, 28, 18, 0.28);
}

.rit-board-group {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.board-label {
  font-size: 11px;
  font-weight: 800;
  color: rgba(160, 190, 240, 0.75);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: right;
  white-space: nowrap;
}

.rit-board-row {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  min-height: 46px;
  align-items: center;
  justify-content: flex-start;
}

.table-oval[data-layout-density="crowded"] .second-board-container {
  padding: 10px;
  gap: 6px;
}

.table-oval[data-layout-density="crowded"] .rit-board-group {
  grid-template-columns: 1fr;
  gap: 4px;
}

.table-oval[data-layout-density="crowded"] .board-label {
  text-align: center;
}

.table-oval[data-layout-density="crowded"] .rit-board-row {
  justify-content: center;
}

.rit-board-row .card {
  width: 32px;
  height: 46px;
  border-radius: 5px;
  font-size: 13px;
  flex: 0 0 auto;
}

.rit-board-row .card .suit { font-size: 11px; }

.rit-board-pending {
  color: var(--muted);
  font-size: 11px;
  font-style: italic;
}

/* Hand-log RIT entries */
.log-entry.rit-prompt {
  color: rgba(180, 200, 240, 0.75);
  font-style: italic;
  font-size: 11px;
}

.log-entry.rit-approved {
  color: rgba(80, 200, 140, 0.9);
  font-weight: 600;
}

.log-entry.rit-denied {
  color: rgba(220, 120, 80, 0.9);
  font-weight: 600;
}

/* ── Danger button ─────────────────────────────────────────────────────────── */

.btn-danger {
  background: var(--red, #c0392b);
  color: #fff;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 600;
}
.btn-danger:hover { filter: brightness(1.1); }

/* ── Final ledger modal ────────────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal-backdrop);
}

.modal-card {
  position: relative;
  background: var(--glass-bg-strong);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg, 12px);
  padding: 40px 36px 30px;
  min-width: min(420px, 92vw);
  max-width: 92vw;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-close-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.modal-close-btn:hover { color: var(--text); background: var(--hover, rgba(255,255,255,0.07)); }

.modal-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0;
}

.modal-subtitle {
  margin: -6px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.ledger-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
.ledger-table th,
.ledger-table td {
  padding: 8px 10px;
  text-align: right;
  border-bottom: 1px solid var(--border);
}
.ledger-table th:first-child,
.ledger-table td:first-child {
  text-align: left;
}

.net-positive { color: var(--green, #27ae60); font-weight: 700; }
.net-negative { color: var(--red, #c0392b);   font-weight: 700; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ── Session-closed bar ──────────────────────────────────────────────────────── */

.session-closed-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-top: 1px solid var(--glass-border);
  font-size: 14px;
}

.session-closed-label {
  color: var(--muted);
}

/* ── D1: Side-pot breakdown (shown at settlement when pots.length > 1) ──────── */

.side-pots-display {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
  width: 100%;
  min-width: 0;
}

.side-pot-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  line-height: 1.4;
  min-width: 0;
}

.side-pot-label {
  font-weight: 700;
  color: var(--text-soft);
  white-space: nowrap;
}

.side-pot-amount {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
}

.side-pot-eligible {
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* ── D2: Bet preset buttons ─────────────────────────────────────────────────── */

.bet-presets {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.preset-btn {
  flex: 1;
  min-width: 0;
  padding: 4px 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: var(--panel-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease);
}

.preset-btn:hover {
  background: var(--gold-soft);
  border-color: rgba(226, 180, 91, 0.4);
  color: var(--gold);
}

.preset-btn.all-in {
  background: var(--rose-soft);
  border-color: rgba(240, 109, 121, 0.3);
  color: var(--rose);
}

.preset-btn.all-in:hover {
  background: rgba(240, 109, 121, 0.2);
  border-color: var(--rose);
}

.preset-hotkey {
  min-width: 13px;
  padding: 1px 3px;
  font-size: 9px;
}

/* ── Bet confirmation modal ────────────────────────────────────────────────── */
.bet-confirm-modal {
  position: fixed; inset: 0; z-index: var(--z-modal-stacked);
  background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
}
.bet-confirm-dialog {
  background: var(--glass-bg-strong); color: #f4f4f5;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-radius: 8px; padding: 30px 32px 24px;
  min-width: min(380px, 92vw); max-width: 480px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  border: 1px solid var(--glass-border);
}
.bet-confirm-title { font-size: 16px; opacity: 0.7; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 8px; }
.bet-confirm-amount { font-size: 36px; font-weight: 800; color: var(--gold, #e2b45b); margin-bottom: 16px; }
.fold-confirm-message { font-size: 22px; font-weight: 700; line-height: 1.25; margin-bottom: 22px; }
.bet-confirm-hint { font-size: 15px; opacity: 0.7; margin-bottom: 22px; }
.bet-confirm-actions { display: flex; gap: 10px; justify-content: flex-end; }
.bet-confirm-actions button { min-height: 44px; padding: 0 18px; }

/* ── Toast notifications ───────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: var(--z-modal-stacked);
  max-width: min(360px, calc(100vw - 32px));
  pointer-events: none; /* container doesn't block; individual toasts opt in */
}

.toast {
  pointer-events: auto;
  background: #1f2329;
  color: #f4f4f5;
  border: 1px solid rgba(255,255,255,0.06);
  border-left: 3px solid var(--gold, #e2b45b);
  border-radius: 6px;
  padding: 10px 32px 10px 14px;
  position: relative;
  font-size: 13px;
  line-height: 1.4;
  box-shadow: 0 6px 22px rgba(0,0,0,0.4);
  cursor: pointer;
  user-select: none;
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity calc(200ms * var(--motion-scale, 1)) ease-out,
    transform calc(200ms * var(--motion-scale, 1)) ease-out;
}
.toast.toast-visible { opacity: 1; transform: translateY(0); }
.toast.toast-leaving {
  opacity: 0;
  transform: translateY(-4px);
  transition:
    opacity calc(160ms * var(--motion-scale, 1)) ease-in,
    transform calc(160ms * var(--motion-scale, 1)) ease-in;
}

.toast-info    { border-left-color: var(--gold, #e2b45b); }
.toast-success { border-left-color: var(--green, #4caf82); }
.toast-warn    { border-left-color: #e2a23a; }
.toast-error   { border-left-color: var(--rose, #f06d79); }

.toast-close {
  position: absolute;
  top: 6px;
  right: 8px;
  background: transparent;
  border: 0;
  color: rgba(255,255,255,0.55);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
  min-width: 24px;
  min-height: 24px;
}
.toast-close:hover { color: #fff; }

.play-upgrade-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal-stacked);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0,0,0,0.68);
}

.play-upgrade-dialog {
  position: relative;
  width: min(440px, 100%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md, 8px);
  background: var(--glass-bg-strong, #151a22);
  padding: 28px;
  box-shadow: 0 24px 70px rgba(0,0,0,0.45);
}

.play-upgrade-dialog h2 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 24px;
}

.play-upgrade-dialog p {
  margin: 0 0 22px;
  color: var(--muted-strong);
  line-height: 1.55;
  font-size: 14px;
}

.play-upgrade-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.play-upgrade-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
}

.pro-lock-note {
  margin: -2px 0 10px;
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 1.45;
}

.pro-locked {
  opacity: 0.55;
}

.pro-lock-link {
  border: 0;
  background: transparent;
  color: var(--gold);
  padding: 0;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

@media (max-width: 720px) {
  .toast-container {
    right: 8px;
    bottom: 8px;
    left: 8px;
    max-width: none;
  }
}

/* ── Action button feedback (P3-B) ─────────────────────────────────────────── */

/* Sub-100ms press feedback — :active is browser-driven, no JS required. */
.action-buttons button:active:not(:disabled),
.preset-btn:active:not(:disabled),
.bet-confirm-actions button:active:not(:disabled) {
  transform: scale(0.97);
  transition: transform calc(60ms * var(--motion-scale, 1)) ease-out;
}

/* 200ms colored ring pulse on commit. Class is added briefly by JS,
   self-removed on animationend. Honors motion-scale. */
@keyframes actionFlashPulse {
  0%   { box-shadow: 0 0 0 0 rgba(226, 180, 91, 0.55); }
  60%  { box-shadow: 0 0 0 8px rgba(226, 180, 91, 0); }
  100% { box-shadow: 0 0 0 0 rgba(226, 180, 91, 0); }
}
.action-flash {
  animation: actionFlashPulse calc(200ms * var(--motion-scale, 1)) ease-out;
}
/* When motion is fully off, suppress the animation entirely. */
@media (prefers-reduced-motion: reduce) {
  .action-flash { animation: none; }
}

/* Disabled state for action buttons during in-flight commit. */
.action-buttons button:disabled,
.preset-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ── Accessibility: focus-visible (P3-C) ───────────────────────────────────── */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--gold, #e2b45b);
  outline-offset: 2px;
}

/* ── Mobile parity & touch targets (P3-D) ──────────────────────────────────── */

/* ±chip-stack buttons next to the bet input */
.bet-input-row {
  display: flex;
  align-items: stretch;
  gap: 4px;
  width: 100%;
}
.bet-input-row .bet-number-input {
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
}
.bet-step-btn {
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  padding: 0 8px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.bet-step-btn:hover {
  background: rgba(226,180,91,0.08);
  border-color: var(--gold, #e2b45b);
}
.bet-step-btn:active:not(:disabled) {
  transform: scale(0.95);
  transition: transform calc(60ms * var(--motion-scale, 1)) ease-out;
}

/* Mobile breakpoint — touch targets and one-handed reachability */
@media (max-width: 720px) {
  .rit-vote-modal-inner {
    padding: 26px 22px;
  }
  .rit-vote-title {
    font-size: 24px;
  }
  .rit-vote-desc {
    font-size: 15px;
  }
  .rit-choice-grid {
    grid-template-columns: 1fr;
  }
  .rit-player-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }
  .rit-player-state {
    width: fit-content;
  }
  .second-board-container {
    width: min(100%, var(--center-lane-wide-width));
    padding: 9px 10px;
  }
  .rit-board-group {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .board-label {
    text-align: center;
  }
  .rit-board-row {
    justify-content: center;
  }

  #playNav {
    gap: 8px;
    padding: 0 12px;
  }

  #playNav .nav-logo {
    flex: 0 1 auto;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #playNav .nav-links {
    flex: 0 0 auto;
    margin-left: auto;
  }

  #playNav .nav-link {
    padding: 0 8px;
  }

  #playNavUser {
    max-width: 74px;
    margin-left: 0 !important;
  }

  #playNavUser span {
    display: none;
  }

  #playNavUser a,
  #playNavUser button {
    max-width: 74px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .host-controls {
    position: static;
    width: min(100%, 360px);
    margin: 8px auto 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
  }

  .host-label {
    grid-column: 1 / -1;
    text-align: center;
  }

  .host-controls .btn-sm {
    width: 100%;
    min-height: 38px;
    padding: 6px 8px;
    font-size: 10px;
  }

  /* Action + preset + step buttons → 44px+ tappable */
  .action-buttons button,
  .preset-btn,
  .bet-step-btn,
  .room-controls-close,
  .hotkey-capture {
    min-height: 44px;
  }
  .action-buttons button {
    min-width: 80px;
    padding: 0 10px;
  }
  .preset-btn {
    min-width: 64px;
    padding: 0 12px;
  }

  /* Slider thumb — easier to drag with a thumb */
  #betSlider {
    height: 32px;
  }
  #betSlider::-webkit-slider-thumb {
    width: 28px;
    height: 28px;
  }
  #betSlider::-moz-range-thumb {
    width: 28px;
    height: 28px;
  }

  /* Bet number input — bigger tap area */
  .bet-number-input {
    min-height: 44px;
    font-size: 16px; /* prevents iOS auto-zoom on focus */
  }

  /* Form inputs — 16px prevents iOS auto-zoom on focus */
  .form-field input,
  .form-field select {
    font-size: 16px;
  }

  /* Modal close buttons — 44×44 minimum */
  .room-controls-close {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    font-size: 20px;
  }

  /* Bet step buttons — compact text on narrow screens */
  .bet-step-btn {
    font-size: 11px;
    padding: 0 4px;
  }
}

/* Tighter mobile (≤480px) — hide the ±10×BB buttons; keep ±BB only */
@container table-layout (max-width: 480px) {
  #betDecBigBtn,
  #betIncBigBtn {
    display: none;
  }
}

/* ── Portrait additive layer (≤500px) ────────────────────────────────────
 * The 480px @container block above already handles seat geometry per
 * data-seats; this block only layers UI improvements for portrait phones
 * (status bar, action buttons, bet slider, bottom sheet) on top of that.
 * --------------------------------------------------------------------- */
@container table-layout (max-width: 500px) {
  /* Compact status bar: connection dot + blinds + ellipsised status text */
  .conn-status {
    font-size: 0;
    padding: 0;
    width: 10px;
    height: 10px;
    border-radius: var(--radius-circle);
    flex-shrink: 0;
    border: none;
    background: var(--muted);
  }
  .conn-status.connected    { background: #4caf82; }
  .conn-status.disconnected { background: var(--rose); }
  .conn-status.reconnecting { background: var(--gold); }
  .table-top-bar { gap: 4px; flex-wrap: nowrap; }
  .room-info-bar { font-size: 11px; padding: 3px 7px; flex-shrink: 0; }
  .table-status-text {
    font-size: 11px;
    padding: 3px 7px;
    max-width: none;
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Action buttons — larger thumb-reach tap targets */
  .action-btn { min-height: 52px; }

  /* Bet slider stacks vertically: presets / slider / +/- buttons */
  .bet-slider-row { display: flex; flex-direction: column; gap: 4px; }
  #betSlider { width: 100%; }

  /* Right panel is a collapsible bottom sheet; tab row stays visible. */
  .right-panel { max-height: none; }
  .log-content {
    max-height: 0;
    overflow: hidden;
    padding: 0;
    transition: max-height 0.25s ease, padding 0.25s ease;
  }
  .right-panel.sheet-expanded .log-content:not([style*="display: none"]):not([style*="display:none"]) {
    max-height: 50vh;
    overflow-y: auto;
    padding: 12px;
  }
}

@media (max-width: 720px) {
  .table-top-bar {
    left: 12px;
    right: 12px;
  }
}

/* ── Portrait — logo shrink (global nav, viewport-driven) ───────────────── */
@media (max-width: 400px) {
  #playNav .nav-logo span { display: none; }
}
@media (max-width: 320px) {
  #playNav .nav-logo { font-size: 0; }
  #playNav .nav-logo::before {
    content: "PN";
    font-size: 15px;
    font-weight: 900;
    color: var(--gold);
    letter-spacing: 0.04em;
  }
}

/* ── Card deal stagger (P3-E) ──────────────────────────────────────────────── */

@keyframes cardDealIn {
  0%   { opacity: 0; transform: translateY(-8px) scale(0.96); }
  100% { opacity: 1; transform: translateY(0)    scale(1);    }
}
@keyframes cardFaceReveal {
  0%   { opacity: 0.35; transform: rotateY(86deg) scale(0.98); filter: brightness(1.28); }
  58%  { opacity: 1;    transform: rotateY(-8deg) scale(1.03); filter: brightness(1.08); }
  100% { opacity: 1;    transform: rotateY(0) scale(1);       filter: brightness(1);    }
}
.card.card-dealing,
.card-back.card-dealing {
  animation: cardDealIn calc(150ms * var(--motion-scale, 1)) ease-out backwards;
}
.card.card-revealing {
  animation: cardFaceReveal calc(340ms * var(--motion-scale, 1)) cubic-bezier(0.2, 0.8, 0.2, 1) both;
  transform-origin: center;
  transform-style: preserve-3d;
}

.board-cards,
.seat-hole-cards,
.rit-board-row {
  perspective: 700px;
}
/* Per-card stagger via :nth-child fallback; JS can override via inline animation-delay. */
.board-cards .card.card-dealing:nth-child(1),
.seat-hole-cards .card.card-dealing:nth-child(1) { animation-delay: calc(0ms   * var(--motion-scale, 1)); }
.board-cards .card.card-dealing:nth-child(2),
.seat-hole-cards .card.card-dealing:nth-child(2) { animation-delay: calc(50ms  * var(--motion-scale, 1)); }
.board-cards .card.card-dealing:nth-child(3),
.seat-hole-cards .card.card-dealing:nth-child(3) { animation-delay: calc(100ms * var(--motion-scale, 1)); }
.board-cards .card.card-dealing:nth-child(4),
.seat-hole-cards .card.card-dealing:nth-child(4) { animation-delay: calc(150ms * var(--motion-scale, 1)); }
.board-cards .card.card-dealing:nth-child(5)     { animation-delay: calc(200ms * var(--motion-scale, 1)); }
@media (prefers-reduced-motion: reduce) {
  .card.card-dealing,
  .card-back.card-dealing,
  .card.card-revealing { animation: none; }
}

/* ── Fold animation (P3-E) ─────────────────────────────────────────────────── */

@keyframes foldFadeOut {
  0%   { opacity: 1; transform: translateY(0);    }
  100% { opacity: 0; transform: translateY(-8px); }
}
.seat-hole-cards.is-folding,
.seat-hole-cards.is-folding .card {
  animation: foldFadeOut calc(200ms * var(--motion-scale, 1)) ease-in forwards;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .seat-hole-cards.is-folding,
  .seat-hole-cards.is-folding .card { animation: none; }
}

/* ── Chip-to-pot / pot-to-winner animations (P3-E) ─────────────────────────── */

.chip-fly {
  position: fixed;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gold, #e2b45b);
  border: 2px solid #fff;
  box-shadow: 0 3px 8px rgba(0,0,0,0.45);
  pointer-events: none;
  z-index: var(--z-modal);
  transition: transform calc(350ms * var(--motion-scale, 1)) ease-out,
              opacity   calc(350ms * var(--motion-scale, 1)) ease-out;
  will-change: transform, opacity;
}
.chip-fly.chip-fly-win {
  width: 30px;
  height: 30px;
  transition: transform calc(450ms * var(--motion-scale, 1)) ease-out,
              opacity   calc(450ms * var(--motion-scale, 1)) ease-out;
}
@media (prefers-reduced-motion: reduce) {
  .chip-fly,
  .chip-fly.chip-fly-win { transition: none; }
}

/* ── View Transitions ──────────────────────────────────────────────────────── */

::view-transition-old(*),
::view-transition-new(*) {
  animation-duration: 240ms;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation-duration: 0s;
  }
}
