/* ─── Reset & Base ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --felt: #1a4a2e;
  --felt-dark: #0f2e1a;
  --felt-light: #236b3f;
  --gold: #d4af37;
  --gold-dark: #a08020;
  --card-bg: #fff;
  --red: #e63946;
  --blue: #4a90d9;
  --chip-green: #2ecc71;
  --text: #f0ead6;
  --text-dim: #a89b7a;
  --panel: rgba(0,0,0,0.45);
  --radius: 8px;
  --border: rgba(212,175,55,0.3);
}

html, body {
  height: 100%;
  font-family: 'Georgia', serif;
  background: var(--felt-dark);
  color: var(--text);
  overflow-x: hidden;
}

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: inherit; touch-action: manipulation; }
input, select, textarea { font-family: inherit; }
/* Prevent iOS Safari auto-zoom on input focus (needs ≥16px) */
@media (max-width: 480px) {
  input, select, textarea { font-size: 16px !important; }
}

/* ─── Auth Page ──────────────────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, #1a4a2e 0%, #0a1f12 100%);
  padding: 20px;
}

.auth-card {
  background: rgba(10,25,15,0.95);
  border: 2px solid var(--gold);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8), 0 0 40px rgba(212,175,55,0.1);
}

.auth-logo {
  text-align: center;
  margin-bottom: 30px;
}
.auth-logo h1 {
  font-size: 2rem;
  color: var(--gold);
  letter-spacing: 2px;
  text-transform: uppercase;
}
.auth-logo p { color: var(--text-dim); font-size: 0.9rem; margin-top: 6px; }

.auth-tabs {
  display: flex;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--border);
}
.auth-tab {
  flex: 1;
  padding: 10px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.2s;
}
.auth-tab.active {
  color: var(--gold);
  border-bottom: 2px solid var(--gold);
  margin-bottom: -2px;
}

.form-group { margin-bottom: 16px; }
.form-group label { display: block; color: var(--text-dim); font-size: 0.85rem; margin-bottom: 6px; }
.form-group input {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}
.form-group input:focus { border-color: var(--gold); }
.form-group input::placeholder { color: #666; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: bold;
  transition: all 0.15s;
  white-space: nowrap;
  touch-action: manipulation;
}
.btn-gold {
  background: linear-gradient(135deg, #d4af37, #a08020);
  color: #1a1a1a;
}
.btn-gold:hover { background: linear-gradient(135deg, #e4c047, #b09030); transform: translateY(-1px); }
.btn-full { width: 100%; }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: #c0202e; }
.btn-blue { background: var(--blue); color: #fff; }
.btn-blue:hover { background: #3870b9; }
.btn-green { background: var(--chip-green); color: #1a1a1a; }
.btn-green:hover { background: #27ae60; }
.btn-sm { padding: 7px 14px; font-size: 0.85rem; }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }

.error-msg { color: var(--red); font-size: 0.85rem; margin-top: 10px; text-align: center; }
.success-msg { color: var(--chip-green); font-size: 0.85rem; margin-top: 10px; text-align: center; }

/* ─── Lobby Page ─────────────────────────────────────────────────────────── */
.lobby-page {
  min-height: 100vh;
  background: radial-gradient(ellipse at top, #1a4a2e 0%, #0a1f12 100%);
}

.lobby-header {
  background: rgba(0,0,0,0.6);
  border-bottom: 2px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.lobby-header .logo { font-size: 1.4rem; color: var(--gold); font-weight: bold; letter-spacing: 1px; }
.lobby-header .player-info { display: flex; align-items: center; gap: 16px; }
.chip-count { display: flex; align-items: center; gap: 6px; color: var(--gold); font-size: 1.1rem; font-weight: bold; }
.chip-icon { font-size: 1.2rem; }

.jackpot-banner {
  background: linear-gradient(90deg, rgba(212,175,55,0.15), rgba(212,175,55,0.05), rgba(212,175,55,0.15));
  border-bottom: 1px solid var(--border);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 0.95rem;
}
.jackpot-amount { color: var(--gold); font-size: 1.3rem; font-weight: bold; }
.jackpot-timer { color: var(--text-dim); }

.lobby-body { padding: 24px; max-width: 1200px; margin: 0 auto; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-header h2 { color: var(--gold); font-size: 1.2rem; letter-spacing: 1px; }

.tables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.table-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: border-color 0.2s, transform 0.1s;
  cursor: pointer;
}
.table-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.table-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.table-name { font-size: 1.1rem; color: var(--gold); font-weight: bold; }
.game-badge {
  background: rgba(212,175,55,0.2);
  color: var(--gold);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.table-info { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 4px; }
.table-stakes { color: var(--text); font-size: 1rem; font-weight: bold; margin-bottom: 12px; }
.player-count { display: flex; align-items: center; gap: 4px; font-size: 0.9rem; color: var(--text-dim); margin-bottom: 14px; }
.player-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--chip-green); display: inline-block; }
.player-dot.empty { background: #555; }

.empty-state { text-align: center; color: var(--text-dim); padding: 40px; }

/* ─── Modal ──────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: #0f2e1a;
  border: 2px solid var(--gold);
  border-radius: 14px;
  padding: 32px;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal h2 { color: var(--gold); margin-bottom: 20px; font-size: 1.3rem; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ─── Lobby Seat Picker ──────────────────────────────────────────────────── */
.seat-pick-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 2px solid;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  gap: 1px;
  transition: transform 0.1s, box-shadow 0.1s;
}
.seat-pick-btn.open  { background: rgba(0,180,80,0.15); border-color: #00b450; color: #00e676; }
.seat-pick-btn.open:hover { background: rgba(0,180,80,0.3); transform: scale(1.1); }
.seat-pick-btn.open.selected { background: rgba(0,180,80,0.5); box-shadow: 0 0 10px rgba(0,230,118,0.7); transform: scale(1.15); }
.seat-pick-btn.taken { background: rgba(180,30,30,0.15); border-color: #b03030; color: #ff6b6b; cursor: not-allowed; opacity: 0.6; }
.seat-pick-btn .sp-num { font-size: 0.85rem; line-height: 1; }
.seat-pick-btn .sp-name { font-size: 0.5rem; line-height: 1; max-width: 40px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── Table Page ─────────────────────────────────────────────────────────── */
.table-page {
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--felt-dark);
  overflow: hidden;
}

.table-header {
  background: rgba(0,0,0,0.7);
  border-bottom: 1px solid var(--border);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.85rem;
}
.table-header .table-info-bar { display: flex; align-items: center; gap: 12px; color: var(--text-dim); }
.table-header .jackpot-mini { color: var(--gold); font-weight: bold; font-size: 0.95rem; }
/* Desktop: hide mobile-only header elements */
.hdr-leave-btn { display: none; }
.hdr-mob-lobby { display: none; }
.hdr-pot { display: none; }
.hdr-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hdr-icon-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 6px;
  color: var(--text);
  font-size: 1rem;
  width: 32px;
  height: 32px;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.table-main {
  display: grid;
  grid-template-columns: 1fr 260px;
  overflow: hidden;
}
/* Chat responsive handled in mobile breakpoints below */

/* ─── Poker Table Canvas Area ────────────────────────────────────────────── */
.poker-area {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 12px;
  min-height: 0;
}

.poker-table-wrap {
  position: relative;
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
}

.poker-table-oval {
  background: radial-gradient(ellipse, #1f5c35 60%, #0f3520 100%);
  border: 6px solid #2a1800;
  box-shadow: 0 0 0 3px #5c3a00, 0 20px 60px rgba(0,0,0,0.8);
  border-radius: 50%;
  aspect-ratio: 2/1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  overflow: visible;
}

.community-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 15;
}

.community-cards {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}

.pot-display {
  text-align: center;
  color: #fff;
  font-size: 0.9rem;
  margin-top: 4px;
}
.pot-display .pot-amount { font-size: 1.3rem; color: var(--gold); font-weight: bold; }
.pot-display .pot-label { color: var(--text-dim); font-size: 0.75rem; }

/* ─── Cards ──────────────────────────────────────────────────────────────── */
.card {
  width: 48px;
  height: 68px;
  background: var(--card-bg);
  border-radius: 7px;
  border: 1px solid #ccc;
  display: block;
  position: relative;
  font-size: 0.95rem;
  font-weight: bold;
  box-shadow: 2px 3px 8px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.6);
  transition: transform 0.1s;
  flex-shrink: 0;
  user-select: none;
  overflow: hidden;
}
.card.large { width: 72px; height: 104px; font-size: 1.35rem; }
.card.red  { color: #e0001e; }
.card.black { color: #000; }

/* Corner labels */
.card-corner {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  gap: 1px;
}
.card-corner.tl { top: 2px; left: 3px; }
.card-corner.br { bottom: 2px; right: 3px; transform: rotate(180deg); }
.card-rank { font-size: 0.92em; font-weight: 900; line-height: 1; }
.card-pip  { font-size: 0.76em; line-height: 1; }

/* Center content */
.card-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45em;
  pointer-events: none;
}
.card-center.ace-card { font-size: 1.85em; }
.card-center.face-card {
  flex-direction: column;
  gap: 1px;
  font-size: 1.55em;
  font-weight: 900;
  letter-spacing: -0.02em;
}
.card-face-letter { line-height: 1; }
.card-face-suit   { font-size: 0.55em; line-height: 1; }

/* Legacy selectors kept for any code that still uses .rank/.suit */
.card .rank { display: none; }
.card .suit { display: none; }

/* Card back — RabbsRoom themed with rabbit */
.card.back {
  background:
    repeating-linear-gradient(
      45deg,
      #0d3d22 0px, #0d3d22 4px,
      #0f4a28 4px, #0f4a28 8px
    );
  border: 2px solid var(--gold);
  box-shadow: inset 0 0 0 2px rgba(212,175,55,0.3), 2px 3px 8px rgba(0,0,0,0.55);
}
.card.back::after {
  content: '🐇';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1.4em;
}

.card.placeholder { background: rgba(255,255,255,0.05); border: 1px dashed rgba(255,255,255,0.2); }
.card-appear { animation: cardFlip 0.3s ease-out; }
@keyframes cardFlip {
  from { transform: rotateY(90deg) scale(0.8); opacity: 0; }
  to   { transform: rotateY(0) scale(1); opacity: 1; }
}

/* Community card: shovel/slide from dealer area (top-left of card area) */
.card-deal { animation: cardDeal 0.38s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
@keyframes cardDeal {
  from { transform: translate(-70px, -40px) rotate(-15deg) scale(0.65); opacity: 0; }
  to   { transform: translate(0, 0) rotate(0deg) scale(1); opacity: 1; }
}

/* Hole cards: slide down from table center to player's hand */
.card-deal-hole { animation: cardDealHole 0.4s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
@keyframes cardDealHole {
  from { transform: translateY(-70px) scale(0.7); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

/* ─── Player Seats ───────────────────────────────────────────────────────── */
.seats-container {
  position: absolute;
  inset: -60px;
  pointer-events: none;
}

.seat {
  position: absolute;
  pointer-events: all;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transform: translate(-50%, -50%);
}

.seat-box {
  background: rgba(0,0,0,0.75);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  padding: 6px 10px;
  min-width: 130px;
  text-align: center;
  position: relative;
  font-size: 0.78rem;
  transition: border-color 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.seat-box.active-player { border-color: var(--gold); box-shadow: 0 0 12px rgba(212,175,55,0.5); }
.seat-box.folded { opacity: 0.45; }
.seat-box.sitting-out { border-color: #666; }
.seat-box.empty { border: 1px dashed rgba(255,255,255,0.2); color: #555; cursor: pointer; }
.seat-box.empty:hover { border-color: var(--gold); color: var(--gold); }
.seat-name { font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; margin-top: 5px; }
.seat-chips { font-size: 0.80rem; line-height: 1.4; position: relative; }
.seat-bet { color: var(--chip-green); font-size: 0.78rem; min-height: 14px; }
.seat-cards { display: flex; gap: 2px; justify-content: center; margin-top: 2px; }
.seat-cards .card { width: 40px; height: 58px; font-size: 0.82rem; border-radius: 5px; }

/* ─── Chip Stack visuals ─────────────────────────────────────────────────── */
.chip-stack { display: inline-flex; align-items: center; gap: 3px; vertical-align: middle; flex-wrap: wrap; }
.chip-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid transparent;
  box-shadow:
    inset 0 2px 4px rgba(255,255,255,.30),
    inset 0 -2px 4px rgba(0,0,0,.50),
    0 2px 6px rgba(0,0,0,.7),
    0 0 0 1px rgba(255,255,255,.08);
  flex-shrink: 0;
  position: relative;
  cursor: default;
}
.chip-dot::before {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  border: 1px dashed rgba(255,255,255,.18);
}
.chip-dot::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.10);
}
.chip-dot-n {
  font-size: 7px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 1px 3px rgba(0,0,0,.9);
  z-index: 1;
  letter-spacing: -.5px;
}
.chip-total { color: var(--gold); font-size: 0.80rem; font-weight: 700; margin-left: 3px; }

/* Chip breakdown panel (shown on hover) */
.chip-breakdown {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10,20,14,.97);
  border: 1px solid rgba(0,200,80,.3);
  border-radius: 8px;
  padding: 8px 12px;
  z-index: 300;
  min-width: 150px;
  font-size: .72rem;
  box-shadow: 0 4px 20px rgba(0,0,0,.7);
  pointer-events: none;
  white-space: nowrap;
}
.seat-chips:hover .chip-breakdown { display: block; }
.chip-breakdown-row { display: flex; align-items: center; gap: 6px; padding: 2px 0; }
.chip-breakdown-dot { width:11px;height:11px;border-radius:50%;border:1.5px solid transparent;flex-shrink:0; }
.chip-breakdown-label { color: rgba(255,255,255,.7); flex:1; }
.chip-breakdown-value { color: var(--gold); font-weight: 700; }

.dealer-puck {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 26px;
  height: 26px;
  background: radial-gradient(circle, #fff 60%, #ddd);
  border: 2px solid #666;
  border-radius: 50%;
  font-size: 0.65rem;
  font-weight: 900;
  color: #222;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.5);
  z-index: 10;
}

.money-puck {
  position: absolute;
  top: -12px;
  left: -12px;
  min-width: 42px;
  height: 26px;
  background: radial-gradient(circle, var(--gold) 0%, #b8860b 100%);
  border: 2px solid #fff;
  border-radius: 13px;
  font-size: 0.62rem;
  font-weight: 900;
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  box-shadow: 0 2px 8px rgba(212,175,55,.7);
  z-index: 10;
  white-space: nowrap;
  animation: puckGlow 2s ease-in-out infinite;
}
@keyframes puckGlow {
  0%, 100% { box-shadow: 0 2px 8px rgba(212,175,55,.7); }
  50%       { box-shadow: 0 2px 18px rgba(212,175,55,1); }
}

.straddle-prompt {
  position: fixed;
  bottom: 140px;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a2e;
  border: 2px solid var(--gold);
  border-radius: 12px;
  padding: 16px 20px;
  z-index: 999;
  text-align: center;
  min-width: 260px;
  box-shadow: 0 4px 24px rgba(0,0,0,.7);
}
.straddle-prompt h4 { color: var(--gold); margin: 0 0 6px; font-size: 1rem; }
.straddle-prompt p { color: var(--text); margin: 0 0 12px; font-size: .9rem; }
.straddle-prompt .countdown { font-size: 1.4rem; font-weight: 700; color: var(--red); margin-bottom: 10px; }
.straddle-prompt .btn-row { display: flex; gap: 8px; justify-content: center; }

/* Seat positions for 9-seat table (% of oval width/height) */
/* These are set via JS/inline style based on seat count */

/* ─── My Cards Area ──────────────────────────────────────────────────────── */
.my-cards-area {
  background: rgba(0,0,0,0.5);
  border-top: 2px solid var(--border);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.my-hole-cards {
  display: flex;
  gap: 6px;
}

.action-area {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  flex: 1;
}

/* Desktop: both wrappers are transparent — children behave as direct action-area children */
.mobile-media-bar { display: contents; }
.action-btns-row  { display: contents; }

.action-btn {
  min-width: 80px;
  min-height: 56px;
  font-size: 0.95rem;
  font-weight: 800;
  border-radius: var(--radius);
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: opacity 0.1s, transform 0.1s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
  letter-spacing: 0.04em;
}
.action-btn:disabled { opacity: 0.3; cursor: not-allowed; transform: none !important; pointer-events: none; }
.action-btn:active:not(:disabled) { transform: scale(0.94); opacity: 0.85; }
.action-btn .sub { font-size: 0.78rem; font-weight: 600; opacity: 0.92; }

.btn-fold  { background: linear-gradient(160deg,#e53935,#b71c1c); color: #fff; box-shadow: 0 3px 10px rgba(229,57,53,.4); }
.btn-fold:hover:not(:disabled)  { background: linear-gradient(160deg,#ef5350,#c62828); }
.btn-call  { background: linear-gradient(160deg,#2e7d32,#1b5e20); color: #fff; box-shadow: 0 3px 10px rgba(46,125,50,.4); }
.btn-call:hover:not(:disabled)  { background: linear-gradient(160deg,#388e3c,#2e7d32); }
.btn-check { background: linear-gradient(160deg,#546e7a,#37474f); color: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.35); }
.btn-check:hover:not(:disabled) { background: linear-gradient(160deg,#607d8b,#455a64); }
.btn-raise { background: linear-gradient(160deg,#c8930a,#9a6e08); color: #fff; box-shadow: 0 3px 10px rgba(200,147,10,.4); }
.btn-raise:hover:not(:disabled) { background: linear-gradient(160deg,#d4a017,#b8860b); }
.btn-allin { background: linear-gradient(160deg,#8b0000,#c0392b); color: #fff; box-shadow: 0 3px 10px rgba(192,57,43,.4); }
.btn-allin:hover:not(:disabled) { background: linear-gradient(160deg,#a00000,#d44a39); }

.raise-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.raise-controls input[type=range] {
  width: 100px;
  accent-color: var(--blue);
}
.raise-controls input[type=number] {
  width: 80px;
  padding: 6px 8px;
  background: rgba(255,255,255,0.1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9rem;
}

.break-btn {
  background: rgba(255,255,255,0.1);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.78rem;
  padding: 6px 10px;
  border-radius: var(--radius);
}
.break-btn:hover { border-color: var(--gold); color: var(--gold); }

/* ─── Rebuy payment method buttons ──────────────────────────────────────── */
.rebuy-pay-btn {
  width: 100%;
  padding: 9px 14px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: .86rem;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.rebuy-pay-btn:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.3); }
.rebuy-pay-btn.selected { border-color: var(--gold); background: rgba(212,175,55,.12); color: var(--gold); font-weight: 600; }

/* ─── Shot Clock ─────────────────────────────────────────────────────────── */
.shot-clock {
  width: 44px;
  height: 44px;
  position: relative;
  flex-shrink: 0;
}
.shot-clock svg { transform: rotate(-90deg); }
.shot-clock-track { fill: none; stroke: rgba(255,255,255,0.1); stroke-width: 4; }
.shot-clock-fill {
  fill: none;
  stroke: var(--chip-green);
  stroke-width: 4;
  stroke-dasharray: 113;
  stroke-dashoffset: 0;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear, stroke 0.3s;
}
.shot-clock-fill.warning { stroke: var(--red); }
.shot-clock-number {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: bold;
}

/* ─── Chat Panel ─────────────────────────────────────────────────────────── */
.chat-panel {
  background: rgba(0,0,0,0.55);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--gold);
  font-size: 0.9rem;
  font-weight: bold;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
}
.chat-msg .chat-name { color: var(--gold); }
.chat-msg .chat-text { color: var(--text); }
.chat-msg.system .chat-text { color: var(--text-dim); font-style: italic; }
.chat-input-row {
  display: flex;
  border-top: 1px solid var(--border);
}
.chat-input-row input {
  flex: 1;
  padding: 10px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 0.85rem;
}
.chat-input-row button {
  padding: 10px 14px;
  background: var(--gold);
  border: none;
  color: #1a1a1a;
  font-weight: bold;
  font-size: 0.85rem;
}

/* ─── Hand Ended Overlay ─────────────────────────────────────────────────── */
.hand-result-overlay {
  position: fixed;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  background: transparent;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 500;
  pointer-events: none;
}
.hand-result-overlay.hidden { display: none; }
.hand-result-box {
  background: rgba(15,35,20,0.97);
  border: 2px solid var(--gold);
  border-radius: 14px;
  padding: 30px 40px;
  text-align: center;
  max-width: 360px;
}
.hand-result-box .winner-name { font-size: 1.5rem; color: var(--gold); font-weight: bold; }
.hand-result-box .hand-name { color: rgba(255,255,255,0.85); font-size: 1rem; margin: 4px 0; letter-spacing: 0.03em; }
.hand-result-box .won-amount { font-size: 2rem; color: var(--chip-green); font-weight: bold; margin: 8px 0; }
.hand-result-box .winner-cards { display: flex; gap: 6px; justify-content: center; margin-top: 10px; }

/* ─── Toast Notification ─────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 70px;
  right: 16px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: rgba(15,35,20,0.97);
  border: 1px solid var(--gold);
  border-radius: 8px;
  padding: 12px 16px;
  color: var(--text);
  font-size: 0.9rem;
  max-width: 280px;
  animation: toastIn 0.3s ease-out;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.toast.jackpot { border-color: var(--gold); color: var(--gold); font-weight: bold; }
.toast.error { border-color: var(--red); }
@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ─── Admin Page ─────────────────────────────────────────────────────────── */
.admin-page {
  min-height: 100vh;
  background: var(--felt-dark);
}
.admin-nav {
  background: rgba(0,0,0,0.7);
  border-bottom: 2px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.admin-nav .logo { color: var(--gold); font-size: 1.2rem; font-weight: bold; margin-right: auto; }
.admin-tab-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.9rem;
  padding: 6px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
}
.admin-tab-btn:hover, .admin-tab-btn.active { color: var(--gold); background: rgba(212,175,55,0.1); }

.admin-body { padding: 24px; max-width: 1200px; margin: 0 auto; }
.admin-panel { display: none; }
.admin-panel.active { display: block; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}
.stat-card .stat-value { font-size: 1.8rem; color: var(--gold); font-weight: bold; }
.stat-card .stat-label { color: var(--text-dim); font-size: 0.8rem; margin-top: 4px; }

/* ─── Player Type Filter Chips ─────────────────────────────────────────────── */
.ptf-btn {
  padding: 5px 12px; font-size: .78rem; border-radius: 20px; cursor: pointer;
  border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.05);
  color: var(--text-dim); font-family: inherit; transition: all .15s;
}
.ptf-btn:hover { background: rgba(255,255,255,.1); color: var(--text); }
.ptf-active { background: rgba(212,175,55,.15) !important; border-color: var(--gold) !important; color: var(--gold) !important; font-weight: 700; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.data-table th, .data-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.data-table th { color: var(--gold); font-weight: bold; background: rgba(0,0,0,0.3); }
.data-table tr:hover td { background: rgba(255,255,255,0.03); }
.data-table .actions { display: flex; gap: 6px; flex-wrap: wrap; }

.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }

/* ─── Jackpot Admin Card ─────────────────────────────────────────────────── */
.jackpot-admin-card {
  background: linear-gradient(135deg, rgba(30,20,0,0.9), rgba(50,30,0,0.9));
  border: 2px solid var(--gold);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
}
.jackpot-admin-card h3 { color: var(--gold); font-size: 1.1rem; margin-bottom: 8px; }
.jackpot-admin-amount { font-size: 2.5rem; color: var(--gold); font-weight: bold; }
.jackpot-admin-info { color: var(--text-dim); font-size: 0.85rem; margin-top: 4px; }
.jackpot-admin-actions { display: flex; flex-direction: column; gap: 8px; }

/* ─── Live Tables Overview ───────────────────────────────────────────────── */
#live-tables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.live-table-card {
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  transition: border-color 0.2s;
}

.live-table-card:hover {
  border-color: var(--gold);
}

/* ─── Player Detail Modal ────────────────────────────────────────────────── */
.player-detail-grid { margin-top: 16px; }
.pd-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.pd-row:last-child { border-bottom: none; }
.pd-label { color: var(--text-dim); font-size: .82rem; flex-shrink: 0; }
.pd-value { color: var(--text); text-align: right; word-break: break-word; }

/* ─── PTT Button ─────────────────────────────────────────────────────────── */
.ptt-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text);
  font-size: 0.78rem;
  padding: 6px 14px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  transition: all 0.15s;
  font-family: inherit;
}
.ptt-btn:hover { border-color: var(--gold); color: var(--gold); }
.ptt-btn.speaking {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  animation: ptt-pulse 0.6s ease-in-out infinite alternate;
}
@keyframes ptt-pulse {
  from { box-shadow: 0 0 6px rgba(230,57,70,0.6); }
  to   { box-shadow: 0 0 18px rgba(230,57,70,1); }
}

/* Green ring on seat box when player is speaking */
.seat-box.ptt-speaking {
  outline: 3px solid #00e676;
  outline-offset: 2px;
  box-shadow: 0 0 10px rgba(0, 230, 118, 0.7), 0 0 20px rgba(0, 230, 118, 0.3);
  animation: ptt-ring-pulse 0.7s ease-in-out infinite alternate;
}
@keyframes ptt-ring-pulse {
  from { box-shadow: 0 0 6px rgba(0,230,118,0.5); outline-color: #00e676; }
  to   { box-shadow: 0 0 18px rgba(0,230,118,0.9), 0 0 30px rgba(0,230,118,0.4); outline-color: #69f0ae; }
}

/* ─── Sound Theme Panel ──────────────────────────────────────────────────── */
.sound-theme-panel {
  position: fixed;
  z-index: 9999;
  background: #0d1a12;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,.7);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 160px;
}
.stp-title {
  font-size: .7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 0 4px 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2px;
}
.stp-btn {
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-size: .82rem;
  padding: 7px 10px;
  cursor: pointer;
  text-align: left;
  transition: background .15s, border-color .15s;
}
.stp-btn:hover { background: rgba(255,255,255,.12); border-color: var(--gold); }
.stp-btn.active { border-color: var(--gold); color: var(--gold); background: rgba(212,175,55,.12); }

/* ─── Responsive: Tablet ≤768px ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .tables-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

  /* Admin nav: horizontal scroll — no wrapping */
  .admin-nav {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding: 8px 12px;
    gap: 2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .admin-nav::-webkit-scrollbar { display: none; }
  .admin-nav .logo { flex-shrink: 0; font-size: 1rem; margin-right: 6px; }
  .admin-tab-btn { flex-shrink: 0; white-space: nowrap; padding: 6px 10px; font-size: 0.8rem; }

  /* Admin body: tighter padding */
  .admin-body { padding: 14px 12px; }
  .stats-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .jackpot-admin-card { grid-template-columns: 1fr; }
  .jackpot-admin-actions { flex-direction: row; flex-wrap: wrap; }

  /* Data tables: allow horizontal scroll */
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .data-table { min-width: 520px; }
}

/* ─── Admin: Tournament table → card layout on mobile ───────────────────── */
@media (max-width: 640px) {
  #panel-tournaments .table-wrap { border: none; background: none; }
  #panel-tournaments .data-table { min-width: unset; }
  #panel-tournaments .data-table thead { display: none; }
  #panel-tournaments .data-table tbody tr {
    display: block;
    background: rgba(255,255,255,.03);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 10px;
    padding: 10px 14px;
  }
  #panel-tournaments .data-table tbody td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: none;
    font-size: .85rem;
    gap: 8px;
  }
  #panel-tournaments .data-table tbody td::before {
    content: attr(data-label);
    color: var(--text-dim);
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    flex-shrink: 0;
  }
  #panel-tournaments .data-table tbody td[data-label=""] {
    margin-top: 8px;
    flex-direction: column;
    align-items: stretch;
  }
  #panel-tournaments .data-table tbody td[data-label=""] .actions {
    flex-direction: column;
    gap: 6px;
  }
  #panel-tournaments .data-table tbody td[data-label=""] .btn {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
}

/* ─── Responsive: Phone ≤480px ───────────────────────────────────────────── */
@media (max-width: 480px) {
  /* ── Auth page ── */
  .auth-card { padding: 20px 14px; }
  /* Stack first/last name fields vertically */
  .auth-name-row { flex-direction: column !important; gap: 0 !important; }
  .form-group input { font-size: 16px; } /* prevents iOS zoom on focus */

  /* ── Lobby ── */
  .lobby-header {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    gap: 6px;
  }
  .lobby-header .logo { font-size: 1.1rem; }
  .lobby-header .player-info { flex-wrap: wrap; gap: 4px; }
  .lobby-header .player-info .btn { padding: 6px 10px; min-height: 38px; font-size: 0.78rem; }
  .lobby-body { padding: 10px 12px; }
  .tables-grid { grid-template-columns: 1fr; gap: 10px; }
  .table-card { padding: 14px 16px; }
  .section-header h2 { font-size: 0.95rem; }
  .section-header { margin-bottom: 10px; }
  .jackpot-banner { font-size: 0.8rem; padding: 6px 12px; gap: 8px; }
  .jackpot-amount { font-size: 1.05rem; }

  /* ── Modals: bottom-sheet style ── */
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .modal {
    border-radius: 14px 14px 0 0;
    max-height: 88vh;
    padding: 20px 14px 36px;
    max-width: 100%;
    width: 100%;
  }
  .modal h2 { font-size: 1.05rem; margin-bottom: 14px; }
  .modal-footer { flex-direction: column; gap: 8px; }
  .modal-footer .btn { width: 100%; min-height: 48px; font-size: 1rem; }

  /* ── Toast: above action area ── */
  .toast-container { right: 8px; left: 8px; top: 56px; }
  .toast { font-size: 0.82rem; padding: 10px 12px; max-width: 100%; }

  /* ── Hand result overlay ── */
  .hand-result-box { padding: 18px 14px; max-width: 88vw; }
  .hand-result-box .winner-name { font-size: 1.2rem; }
  .hand-result-box .won-amount { font-size: 1.5rem; }
  .hand-result-box .winner-cards { flex-wrap: wrap; }

  /* ── Admin ── */
  .admin-body { padding: 10px 8px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
  .stat-card { padding: 12px 10px; }
  .stat-card .stat-value { font-size: 1.4rem; }
  .jackpot-admin-card { grid-template-columns: 1fr; padding: 14px; }
  .jackpot-admin-amount { font-size: 2rem; }
  .jackpot-admin-actions { flex-direction: row; flex-wrap: wrap; gap: 6px; }

  /* Player detail modal grid */
  .pd-row { flex-direction: column; gap: 2px; }
  .pd-value { text-align: left; }
}

/* ─── Responsive: Very small phones ≤390px (iPhone 14, iPhone SE) ─────────── */
@media (max-width: 390px) {
  .lobby-body { padding: 8px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
  .stat-card .stat-value { font-size: 1.25rem; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(212,175,55,0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(212,175,55,0.5); }

/* ─── Hand Rankings Modal ────────────────────────────────────────────────── */
.hr-modal { padding: 20px 18px !important; }
.hr-list { display: flex; flex-direction: column; gap: 8px; }
.hr-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.hr-meta { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.hr-num  { color: var(--text-dim); font-size: .7rem; font-weight: 700; min-width: 16px; text-align: right; }
.hr-name { color: var(--gold); font-size: .82rem; font-weight: 700; white-space: nowrap; }
.hr-desc { color: var(--text-dim); font-size: .72rem; margin-top: 1px; }
.hr-cards { display: flex; gap: 2px; flex-shrink: 0; }
.hr-cards .card { width: 26px; height: 38px; font-size: 0.55rem; border-radius: 4px; }
@media (max-width: 520px) {
  .hr-row { flex-direction: column; align-items: flex-start; }
  .hr-cards { align-self: flex-start; }
}

/* ─── Seat Timer Badge ───────────────────────────────────────────────────── */
.seat-timer {
  position: absolute;
  top: -10px;
  right: -10px;
  background: var(--gold);
  color: #000;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 10px;
  min-width: 24px;
  text-align: center;
  z-index: 10;
  pointer-events: none;
}
.seat-timer.urgent {
  background: var(--red);
  color: #fff;
  animation: pulse 0.5s ease-in-out infinite alternate;
}
@keyframes pulse {
  from { transform: scale(1); }
  to { transform: scale(1.18); }
}

/* ─── Chip Animation ─────────────────────────────────────────────────────── */
.chip-animate {
  position: fixed;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid transparent;
  box-shadow: inset 0 2px 3px rgba(255,255,255,.25), inset 0 -2px 3px rgba(0,0,0,.45), 0 2px 8px rgba(0,0,0,.7);
  z-index: 9998;
  pointer-events: none;
  transition: transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.55s ease;
  transform: translate(0, 0);
}

/* ─── Chip Stack in Seat (overrides handled by chipStack() JS) ───────────── */
.seat-chips::before { content: none; }

/* ─── PTT Speaking State ─────────────────────────────────────────────────── */
.ptt-btn.speaking {
  background: var(--red) !important;
  color: #fff !important;
  animation: ptt-pulse 0.8s ease-in-out infinite alternate;
}
@keyframes ptt-pulse {
  from { box-shadow: 0 0 0 0 rgba(230,57,70,.7); }
  to   { box-shadow: 0 0 0 10px rgba(230,57,70,0); }
}
.seat-box.ptt-speaking {
  outline: 3px solid #00e676 !important;
  outline-offset: 2px;
  box-shadow: 0 0 14px rgba(0,230,118,0.8) !important;
}

/* ─── Safe-area insets for notched iPhones (viewport-fit=cover) ────────── */
@supports (padding: env(safe-area-inset-bottom)) {
  .my-cards-area {
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
  }
  .table-header {
    padding-top: max(8px, env(safe-area-inset-top));
  }
}

/* ─── Straddle prompt: responsive ─────────────────────────────────────── */
@media (max-width: 480px) {
  .straddle-prompt {
    bottom: auto;
    top: 50%;
    transform: translate(-50%, -50%);
    min-width: 80vw;
    max-width: 92vw;
    padding: 14px 16px;
  }
}

/* ─── Slide Panels (host + mic — fixed right-side drawer) ────────────── */
.slide-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  max-width: min(88vw, 88dvw);
  height: 100%;
  height: 100dvh;
  background: rgba(8,20,12,0.98);
  border-left: 1px solid rgba(46,204,113,0.35);
  z-index: 400;
  display: flex;
  flex-direction: column;
  transform: translateX(110%);
  transition: transform 0.22s ease;
  box-shadow: -4px 0 28px rgba(0,0,0,0.75);
}
.slide-panel.open { transform: translateX(0); }

.slide-panel-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(46,204,113,0.25);
  flex-shrink: 0;
  background: rgba(8,20,12,0.98);
  position: sticky;
  top: 0;
  z-index: 1;
}
.slide-panel-title {
  color: var(--chip-green);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.slide-panel-close {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--text);
  width: 26px;
  height: 26px;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
}
.slide-panel-close:hover { background: rgba(255,255,255,0.18); }

#host-controls-inner,
#mic-controls-inner {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px 12px;
  font-size: 0.78rem;
}

/* ─── Panel FAB triggers ───────────────────────────────────────────────── */
#panel-fabs {
  position: fixed;
  top: 36px;
  right: 0;
  z-index: 350;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 3px 0;
}
.panel-fab {
  width: 32px;
  height: 32px;
  background: rgba(8,20,12,0.95);
  border: 1px solid rgba(46,204,113,0.5);
  border-right: none;
  border-radius: 6px 0 0 6px;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}
.panel-fab:active,
.panel-fab:hover { background: rgba(46,204,113,0.22); }

/* ─── Mic Controls Panel ─────────────────────────────────────────────── */

.mic-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(46,204,113,.25);
}

.mic-panel-title {
  color: var(--chip-green);
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.mic-panel-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.mic-btn {
  font-size: .72rem;
  padding: 4px 10px;
  border-radius: 5px;
  border: 1px solid;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  transition: opacity .15s;
}
.mic-btn:hover { opacity: .85; }

.mic-btn-mute-all  { background: rgba(180,20,20,.85); border-color: #e74c3c; }
.mic-btn-unmute-all { background: rgba(20,110,50,.85); border-color: var(--chip-green); }
.mic-btn-mode-ptt  { background: rgba(40,60,120,.85); border-color: #6a9fd8; }
.mic-btn-mode-open { background: rgba(180,100,0,.85); border-color: #f39c12; }

.mic-player-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 4px;
  border-radius: 5px;
  margin-bottom: 2px;
  transition: background .15s;
}
.mic-player-row:hover { background: rgba(255,255,255,.04); }

.mic-status-icon {
  font-size: 1rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.mic-status-icon.speaking {
  animation: mic-speaking-pulse 0.55s ease-in-out infinite alternate;
}

@keyframes mic-speaking-pulse {
  from { filter: drop-shadow(0 0 2px #e74c3c); opacity: .75; transform: scale(.95); }
  to   { filter: drop-shadow(0 0 7px #e74c3c); opacity: 1;   transform: scale(1.15); }
}

.mic-player-name {
  flex: 1;
  font-size: .82rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mic-toggle-btn {
  font-size: .68rem;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
}
.mic-toggle-btn.mute   { background: rgba(180,20,20,.75); border-color: #e74c3c; }
.mic-toggle-btn.unmute { background: rgba(20,110,50,.75); border-color: var(--chip-green); }

.mic-mode-bar {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: .72rem;
  color: var(--text-dim);
  text-align: center;
}

.mic-mode-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 700;
  margin-top: 4px;
}
.mic-mode-badge.ptt  { background: rgba(40,60,120,.7);  color: #a0c4f8; border: 1px solid #6a9fd8; }
.mic-mode-badge.open { background: rgba(180,100,0,.7);  color: #ffd080; border: 1px solid #f39c12; }


/* ─── Mic Panel: Collapse Button + Collapsed State ──────────────────────── */
/* ─── Host Controls Panel (collapsible) ──────────────────────────────────── */

.host-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(46,204,113,.25);
}

.host-panel-title {
  color: var(--chip-green);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.host-collapse-btn {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.2);
  color: var(--text);
  font-size: .9rem;
  font-weight: 700;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  line-height: 1;
  font-family: monospace;
}
.host-collapse-btn:hover { background: rgba(255,255,255,.18); }

#host-controls.collapsed {
  min-width: 0 !important;
  padding: 6px 10px !important;
}
#host-controls.collapsed #host-controls-inner { display: none; }
#host-controls.collapsed .host-panel-header {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.mic-collapse-btn {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.2);
  color: var(--text);
  font-size: .9rem;
  font-weight: 700;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  line-height: 1;
  font-family: monospace;
}
.mic-collapse-btn:hover { background: rgba(255,255,255,.18); }

#mic-controls-panel.collapsed {
  min-width: 0 !important;
  padding: 6px 10px !important;
}
#mic-controls-panel.collapsed #mic-controls-inner { display: none; }
#mic-controls-panel.collapsed .mic-panel-header {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}



/* ─── Seat glow animation (active player's turn) ────────────────────────── */
@keyframes rpSeatGlow {
  0%, 100% { box-shadow: 0 0 0 2px rgba(212,175,55,0.45), 0 0 10px rgba(212,175,55,0.6); }
  50%       { box-shadow: 0 0 0 3px rgba(212,175,55,0.65), 0 0 18px rgba(212,175,55,0.9); }
}

/* ─── Chat bubble button (landscape mobile only) ─────────────────────────── */
.chat-bubble-btn {
  display: none; /* only shown via landscape media query */
  position: fixed;
  bottom: 88px;
  right: 10px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(200,168,75,0.18);
  border: 2px solid rgba(200,168,75,0.55);
  color: #fff;
  font-size: 1.15rem;
  cursor: pointer;
  z-index: 140;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 14px rgba(0,0,0,0.55);
  transition: background 0.15s, transform 0.1s;
}
.chat-bubble-btn:active { transform: scale(0.92); background: rgba(200,168,75,0.3); }
.chat-bubble-btn { position: relative; }  /* anchor for badge */
.chat-close-btn { display: none; }  /* hidden on desktop, shown on mobile */

/* ─── Mobile Table Layout ────────────────────────────────────────────────── */
/*
 * Applies to any phone-sized viewport (≤768px) AND landscape phones with
 * short viewport height (≤500px in landscape). Fixed-pixel bar heights give
 * predictable game-app proportions; vmax/rem scale internal elements.
 *
 *   TOP BAR:    36px  — Leave | table name | pot
 *   TABLE AREA: flex:1 — oval fills remaining space
 *   BOTTOM BAR: 48px  — hole cards left | action buttons right
 */

/* ─── Mobile Table Layout (≤900px — phones in portrait AND landscape) ─────── */
@media (max-width: 900px) {
  html, body { margin: 0 !important; padding: 0 !important; }
  /* Full-screen flex column */
  body.table-page {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    width: 100dvw;
    margin: 0;          /* remove default body margin (fixes left black strip) */
    overflow: hidden;
    background: #040e07;
  }

  /* 36px top header */
  body.table-page .table-header {
    height: 36px;
    min-height: 36px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding: 0 8px;
    gap: 6px;
    background: rgba(0,0,0,0.9);
    font-size: 0.7rem;
  }

  /* table-main is a direct flex child — must have flex:1 to fill screen */
  body.table-page .table-main {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
  }

  /* poker-area: fixed slab between header and action bar — extra bottom clearance for seats that
     extend outside the oval via seats-container inset:-20px */
  body.table-page .poker-area {
    position: fixed;
    top: 66px;
    bottom: 110px;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    padding: 0;
  }

  /* wrap: fills poker-area so oval % sizing resolves correctly */
  body.table-page .poker-table-wrap {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: none;
    max-height: none;
    margin: 0;
  }

  body.table-page .poker-table-oval {
    width: 90%;
    max-width: 85vw;
    max-height: 75dvh;
    margin-top: -35px;
    /* height intentionally omitted: aspect-ratio:2/1 (base CSS) keeps oval
       landscape-shaped in both portrait and landscape orientations */
  }

  /* Seats: inset gives clearance outside the oval for seat avatars.
     -35px means SC extends 35px beyond oval on each side — enough for
     a 52px avatar center to clear the oval border on all positions. */
  body.table-page #seats-container {
    inset: -35px;
  }

  /* Occupied seats: strip the rectangular panel — avatar floats on felt */
  body.table-page .seat-box:not(.empty) {
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
    padding: 2px 4px;
    min-width: 0;
  }
  /* Active-player glow moves to the avatar circle */
  body.table-page .seat-box:not(.empty).active-player {
    border: none;
    box-shadow: none;
  }
  body.table-page .seat-box:not(.empty).active-player .seat-avatar {
    border-color: var(--gold);
    box-shadow: 0 0 10px rgba(212,175,55,0.7);
  }
  /* PTT-speaking outline stays on box (it uses outline not border) */
  /* Text readable against green felt */
  body.table-page .seat-name,
  body.table-page .seat-chips,
  body.table-page .seat-bet {
    text-shadow: 0 1px 3px #000, 0 0 6px rgba(0,0,0,0.9);
  }
  /* Empty seats keep their dashed box so players can see and tap them */
  body.table-page .seat-box.empty {
    min-width: 68px;
    padding: 6px 10px;
  }
  body.table-page .seat-name {
    max-width: 100px;
    font-size: 0.72rem;
  }

  /* Bottom bar: fixed at absolute bottom, always visible */
  body.table-page .my-cards-area {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    min-height: 100px;
    display: flex;
    align-items: center;
    padding: 4px 6px;
    gap: 4px;
    background: rgba(0,0,0,0.95);
    border-top: 1px solid rgba(255,255,255,0.15);
    z-index: 200;
  }

  /* Action area: row layout — action buttons left, media controls right */
  body.table-page .action-area {
    display: flex;
    flex-direction: row;
    flex: 1;
    gap: 4px;
    align-items: stretch;
    height: 100%;
  }

  body.table-page .action-btn {
    flex: 1;
    font-size: 0.52rem;
    font-weight: bold;
    padding: 1px 2px;
    border-radius: 6px;
    min-width: 0;
    min-height: 0;
  }

  body.table-page .card.large {
    width: 28px;
    height: 42px;
    font-size: 0.6rem;
  }

  body.table-page .seat-avatar {
    width: 52px;
    height: 52px;
  }

  /* Raise slider: hidden by default, floats above bottom bar when .visible */
  body.table-page .raise-controls {
    position: fixed;
    bottom: 100px;
    left: 0;
    right: 0;
    z-index: 210;
    padding: 6px 10px;
    background: rgba(4,12,6,0.96);
    border-top: 1px solid rgba(200,168,75,0.3);
    display: none;
    gap: 8px;
    align-items: center;
  }
  body.table-page .raise-controls.visible { display: flex; }
  body.table-page .raise-controls input[type=range] {
    flex: 1;
    height: 24px;
    accent-color: var(--gold);
    touch-action: none;
  }
  body.table-page .raise-controls input[type=number] {
    width: 60px;
    font-size: 0.75rem;
    padding: 3px 5px;
  }

  /* Slide panels on mobile: narrow, high z-index, inherit slide-in behavior from .slide-panel */
  body.table-page .slide-panel {
    width: 200px;
    max-width: min(88vw, 88dvw);
    z-index: 500;
  }

  /* FAB buttons: 36px circles in top-right corner */
  body.table-page #panel-fabs {
    top: 40px;
    right: 0;
    gap: 4px;
    padding: 4px 0;
    z-index: 510;
  }
  body.table-page .panel-fab {
    width: 36px;
    height: 36px;
    border-radius: 8px 0 0 8px;
    font-size: 1.1rem;
  }

  /* Chat panel: slide-up from bottom, takes 40% height, above bottom bar */
  body.table-page .chat-panel {
    position: fixed;
    bottom: 100px;
    left: 0;
    right: 0;
    height: 40vh;
    background: rgba(5,12,8,0.98);
    border-top: 1px solid var(--border);
    border-radius: 12px 12px 0 0;
    display: flex;
    flex-direction: column;
    z-index: 200;
    transform: translateY(110%);
    visibility: hidden;   /* belt-and-suspenders: stops chat-header text bleeding through */
    transition: transform 0.25s ease;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.7);
    pointer-events: none;
  }
  body.table-page .chat-panel.open {
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
  }

  /* Chat bubble: floating above bottom bar */
  body.table-page .chat-bubble-btn {
    display: flex;
    position: fixed;
    bottom: 102px;
    right: 12px;
    z-index: 140;
  }

  /* Chat close button inside header */
  body.table-page .chat-close-btn {
    display: flex;
  }

  /* Unread badge on chat bubble */
  .chat-bubble-badge {
    display: none;
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--red, #e53935);
    color: #fff;
    font-size: 0.55rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
    pointer-events: none;
  }
  .chat-bubble-badge.visible { display: flex; }

  /* Hide admin cam overlay on mobile (screen too small) */
  #admin-cam-overlay { display: none !important; }
  /* Camera feeds: show all — hiding remote feeds prevented players from seeing each other */

  /* Suppress hover chip-denomination breakdown on touch — tap triggers sticky hover */
  body.table-page .chip-breakdown { display: none !important; }

  /* Hand result: compact top toast instead of full-screen blocking overlay */
  body.table-page .hand-result-overlay {
    inset: auto;
    top: 44px;
    left: 50%;
    transform: translateX(-50%);
    background: transparent;
    z-index: 500;
    pointer-events: none;
    display: flex;
    align-items: flex-start;
    justify-content: center;
  }
  body.table-page .hand-result-overlay.hidden { display: none; }
  body.table-page .hand-result-box {
    padding: 6px 12px;
    max-width: min(64vw, 210px);
    border-radius: 8px;
  }
  body.table-page .hand-result-box .winner-name { font-size: 0.88rem; }
  body.table-page .hand-result-box .hand-name   { font-size: 0.82rem; margin: 1px 0; }
  body.table-page .hand-result-box .won-amount  { font-size: 1.05rem; margin: 2px 0; }
  body.table-page .hand-result-box .winner-cards { display: none; }
  body.table-page .hand-result-box #hr-rake     { display: none; }

  /* Hide utility buttons not needed in mobile action bar */
  body.table-page .break-btn,
  body.table-page #sound-toggle-btn,
  body.table-page #btn-rebuy,
  body.table-page #action-leave-btn,
  body.table-page #btn-hand-rankings,
  body.table-page #btn-hand-history,
  body.table-page .hdr-right,
  body.table-page #chat-toggle { display: none; }

  /* Action buttons: left side — fills remaining space */
  body.table-page .action-btns-row {
    display: flex;
    flex-direction: row;
    order: 1;
    flex: 1;
    gap: 2px;
    align-items: stretch;
    min-width: 0;
    min-height: 0;
  }
  body.table-page .action-btns-row .action-btn {
    flex: 1;
    height: 100%;
    min-width: 0;
  }

  /* Media controls: right side — compact 2×2 icon grid */
  body.table-page .mobile-media-bar {
    display: flex;
    order: 2;
    flex: 0 0 84px;
    flex-wrap: wrap;
    gap: 3px;
    height: 100%;
    align-content: stretch;
    align-items: stretch;
    flex-shrink: 0;
  }
  body.table-page .mobile-media-bar button {
    flex: 0 0 calc(50% - 2px);
    height: calc(50% - 2px);
    min-width: 0;
    font-size: 0.62rem;
    padding: 2px;
    border-radius: 5px;
    white-space: nowrap;
    overflow: hidden;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  /* Hide text labels — icon only in the compact 2×2 grid */
  body.table-page .mobile-media-bar .btn-label {
    display: none;
  }
  body.table-page .mobile-media-bar .ptt-btn {
    background: rgba(40,40,80,0.9);
    border: 1px solid rgba(100,120,200,0.5);
    color: #a0c0ff;
    font-size: 0.85rem;
    border-radius: 5px;
    min-height: unset;
    touch-action: none;
  }
  body.table-page .mobile-media-bar .ptt-btn.speaking {
    background: rgba(180,20,20,0.9);
    border-color: #e74c3c;
    color: #fff;
    animation: ptt-pulse 0.6s ease-in-out infinite alternate;
  }

  /* Mobile header: show leave + lobby buttons, shrink center info */
  body.table-page .hdr-leave-btn {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    font-size: 0.6rem;
    padding: 3px 7px;
    height: 26px;
    white-space: nowrap;
    border-radius: 5px;
  }
  body.table-page .hdr-mob-lobby {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    font-size: 0.6rem;
    padding: 3px 7px;
    height: 26px;
    white-space: nowrap;
    color: var(--gold);
    text-decoration: none;
    border: 1px solid rgba(200,168,75,0.4);
    border-radius: 5px;
    background: transparent;
  }
  body.table-page .table-info-bar {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    gap: 5px;
  }
  body.table-page .table-info-bar .hdr-lobby-link { display: none; }
  body.table-page #hdr-table-name,
  body.table-page #hdr-blinds,
  body.table-page #hdr-street {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* ─── Mobile Landscape Fixes (phones in landscape orientation) ───────────── */
/*
 * Targets landscape phones (max-height: 500px covers typical landscape phones
 * like iPhone SE/14/15 in landscape where height ≈ 375–430px).
 * Combined with max-width: 900px to avoid affecting desktop.
 *
 * Fixes:
 *   1. Shift table up 20px so bottom seat (seat 1) clears the action bar
 *   2. Constrain oval to 80vw so all seats stay on screen without clipping
 *   3. Tighten seats-container inset to keep seats close to the smaller oval
 */
@media (max-width: 900px) and (orientation: landscape) {
  /* Explicit width + aspect-ratio so oval is correctly sized in landscape */
  body.table-page .poker-table-oval {
    width: 75vw;
    aspect-ratio: 2/1;
    max-width: 75vw;
  }

  /* Match inset to main mobile block */
  body.table-page #seats-container {
    inset: -35px;
  }

  body.table-page .seat-avatar {
    width: 52px;
    height: 52px;
  }

  body.table-page .seat-cam-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
  }

  /* Narrower seats in landscape so adjacent seats clear each other */
  body.table-page .seat-box {
    min-width: 68px;
  }
  body.table-page .seat-name {
    max-width: 90px;
    font-size: 0.7rem;
  }

  /* Winner popup: move below the oval so it doesn't cover community cards */
  body.table-page .hand-result-overlay {
    top: auto;
    bottom: 115px;
  }

  /* Hole cards: larger so they're readable in landscape layout */
  body.table-page .card.large {
    width: 44px;
    height: 64px;
    font-size: 1rem;
  }

  /* Compact bottom bar so more vertical space goes to the table */
  body.table-page .my-cards-area {
    height: 64px;
    min-height: 64px;
  }
  body.table-page .poker-area {
    bottom: 74px;
  }
}

/* ─── Desktop: shrink avatars so side seats don't overlap on standard 700px oval ── */
@media (min-width: 901px) {
  body.table-page .seat-avatar {
    width: 72px;
    height: 72px;
  }
  body.table-page .seat-initials {
    font-size: 1.8rem;
  }

  /* Chat panel toggle: collapse grid column when hidden */
  .table-main.chat-hidden {
    grid-template-columns: 1fr;
  }
  .table-main.chat-hidden .chat-panel {
    display: none;
  }
}

/* Chat toggle button: highlight when panel is open */
#chat-toggle.active {
  background: rgba(212,175,55,0.2);
  border-color: var(--gold);
  color: var(--gold);
}

/* ─── Seat Avatar / Camera ──────────────────────────────────────────────── */
.seat-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(255,255,255,0.15);
  background: rgba(0,30,12,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.2s;
  cursor: pointer;
  position: relative;
}
.seat-initials {
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--gold);
  user-select: none;
  transition: opacity 0.35s ease;
  position: relative;
  z-index: 1;
}
/* Profile photo fallback */
.seat-avatar-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  transition: opacity 0.35s ease;
  z-index: 1;
}
/* Rabbit logo fallback for admin/host */
.seat-rabbit-logo {
  width: 82%;
  height: 82%;
  object-fit: contain;
  transition: opacity 0.35s ease;
  position: relative;
  z-index: 1;
}
/* Fade fallback out when video is active */
.seat-avatar.has-video .seat-initials,
.seat-avatar.has-video .seat-avatar-photo,
.seat-avatar.has-video .seat-rabbit-logo { opacity: 0; pointer-events: none; }
.seat-cam-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  opacity: 0;
  transition: opacity 0.35s ease;
  z-index: 2;
}
/* Fade video in when active */
.seat-avatar.has-video .seat-cam-video { opacity: 1; }

/* Mirror own camera — front-facing cameras are flipped by default; mirror matches expectation */
.seat-box.me .seat-cam-video { transform: scaleX(-1); }

/* Gold ring — player's turn */
.seat-box.active-player .seat-avatar {
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(212,175,55,0.7);
}
/* Green pulse ring — speaking */
.seat-box.ptt-speaking .seat-avatar {
  border-color: #00e676;
  box-shadow: 0 0 12px rgba(0,230,118,0.8);
  animation: cam-speak-pulse 0.7s ease-in-out infinite alternate;
}
@keyframes cam-speak-pulse {
  from { box-shadow: 0 0 6px rgba(0,230,118,0.5); }
  to   { box-shadow: 0 0 18px rgba(0,230,118,0.9); }
}


/* ─── Split Pot Hand Result ──────────────────────────────────────────────── */
.split-winner-cards {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 3px 6px;
  padding: 3px 8px;
  background: rgba(255,255,255,.07);
  border-radius: 6px;
}
.split-winner-name {
  font-size: .72rem;
  color: var(--chip-green);
  font-weight: 600;
  margin-right: 4px;
  white-space: nowrap;
}

/* ─── Hand History Modal ─────────────────────────────────────────────────── */
.hh-street-header {
  color: var(--gold);
  font-weight: 700;
  font-size: .72rem;
  letter-spacing: .08em;
  margin: 10px 0 3px;
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.hh-action {
  padding: 3px 2px;
  font-size: .83rem;
  color: var(--text);
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.hh-player {
  color: var(--chip-green);
  font-weight: 600;
  margin-right: 4px;
}
.hh-winner {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  padding: 4px 6px;
  background: rgba(212,175,55,.1);
  border-radius: 4px;
  margin: 2px 0;
  font-size: .82rem;
}
.hh-hand-name {
  color: var(--gold);
  font-size: .75rem;
}
.hh-amount {
  color: var(--chip-green);
  font-weight: 700;
  margin-left: auto;
}
.hh-pots {
  font-size: .72rem;
  color: rgba(255,255,255,.45);
  margin-top: 6px;
  padding-top: 4px;
  border-top: 1px solid rgba(255,255,255,.08);
}

/* ─── Showdown Winner Highlight ─────────────────────────────────────────── */
.seat-box.showdown-winner {
  border-color: var(--gold) !important;
  box-shadow: 0 0 20px rgba(212,175,55,0.8), 0 0 40px rgba(212,175,55,0.4) !important;
  animation: showdown-glow 1s ease-in-out infinite alternate;
}
@keyframes showdown-glow {
  from { box-shadow: 0 0 12px rgba(212,175,55,0.6), 0 0 24px rgba(212,175,55,0.3); }
  to   { box-shadow: 0 0 28px rgba(212,175,55,1),   0 0 50px rgba(212,175,55,0.5); }
}
.showdown-hand-badge {
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gold);
  color: #111;
  font-size: .62rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 8px;
  white-space: nowrap;
  z-index: 10;
  pointer-events: none;
}

/* ─── Leaderboard Page ───────────────────────────────────────────────────── */
.lb-tab {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.15);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: .85rem;
  cursor: pointer;
  transition: all .15s;
}
.lb-tab:hover { border-color: var(--gold); color: var(--gold); }
.lb-tab.active { background: rgba(212,175,55,.15); border-color: var(--gold); color: var(--gold); font-weight: 700; }

.lb-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(0,0,0,.3);
  border-radius: 10px;
  overflow: hidden;
}
.lb-table th {
  background: rgba(255,255,255,.05);
  color: var(--text-dim);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.lb-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,.05);
  color: var(--text);
  font-size: .88rem;
}
.lb-table tbody tr:last-child td { border-bottom: none; }
.lb-table tbody tr:hover td { background: rgba(255,255,255,.03); }
.lb-me-row td { background: rgba(212,175,55,.05) !important; }
.lb-me-row td:nth-child(2) { border-left: 3px solid var(--gold); }

/* ─── Felt Color Swatches ───────────────────────────────────────────────────── */
.felt-swatches { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.felt-swatch {
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
  border: 3px solid transparent; transition: border-color .15s, transform .1s;
  box-shadow: 0 2px 6px rgba(0,0,0,.5);
  flex-shrink: 0;
}
.felt-swatch:hover { transform: scale(1.15); }
.felt-swatch.selected { border-color: var(--gold); transform: scale(1.1); }
.felt-swatch-label { font-size: .72rem; color: var(--text-dim); text-align: center; margin-top: 4px; }

/* ─── Table Card Felt Strip ─────────────────────────────────────────────────── */
.table-card-felt {
  height: 6px; border-radius: 3px 3px 0 0;
  margin: -20px -20px 12px; /* bleed to card edges */
  opacity: .85;
}

/* ─── Tournament Blind Timer ─────────────────────────────────────────────────── */
#blind-timer-panel {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  background: rgba(8, 16, 12, .92); border: 1px solid rgba(200,168,75,.4);
  border-radius: 10px; padding: 8px 16px; z-index: 40;
  text-align: center; min-width: 200px; backdrop-filter: blur(6px);
  display: none;
}
#blind-timer-panel.paused { border-color: rgba(255,80,80,.5); }
.btp-level { font-size: .7rem; color: var(--text-dim); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 2px; }
.btp-blinds { font-size: 1.05rem; font-weight: 700; color: var(--gold); }
.btp-countdown { font-size: 1.4rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.btp-countdown.warn { color: #e74c3c; animation: btp-pulse 1s ease-in-out infinite; }
.btp-next { font-size: .72rem; color: var(--text-dim); margin-top: 2px; }
.btp-controls { display: flex; gap: 6px; justify-content: center; margin-top: 6px; }
.btp-btn {
  padding: 3px 10px; font-size: .72rem; background: rgba(255,255,255,.08);
  border: 1px solid var(--border); border-radius: 5px; color: var(--text); cursor: pointer;
}
.btp-btn:hover { background: rgba(255,255,255,.15); }

@keyframes btp-pulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }

/* Break button variant */
.btp-btn-break { color: #e8a838; border-color: rgba(232,168,56,.4); }
.btp-btn-break:hover { background: rgba(232,168,56,.12); }

/* ─── Tournament Break Banner ─────────────────────────────────────────────────── */
#tournament-break-banner {
  animation: break-fade-in .35s ease;
}
@keyframes break-fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ─── Tournament Standings Modal ─────────────────────────────────────────────── */
#standings-rows::-webkit-scrollbar { width: 4px; }
#standings-rows::-webkit-scrollbar-track { background: transparent; }
#standings-rows::-webkit-scrollbar-thumb { background: rgba(212,175,55,.35); border-radius: 2px; }

/* ─── Blind Schedule Modal ───────────────────────────────────────────────────── */
#blind-schedule-modal .sched-row {
  display: grid; grid-template-columns: 30px 1fr 1fr 1fr; gap: 8px;
  align-items: center; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.05);
  font-size: .82rem;
}
#blind-schedule-modal .sched-row:last-child { border-bottom: none; }
#blind-schedule-modal .sched-header { color: var(--text-dim); font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
#blind-schedule-modal .sched-current { color: var(--gold); font-weight: 700; }

/* ─── Lobby Table Stats ─────────────────────────────────────────────────────── */
.lobby-table-stats {
  display: flex; gap: 10px; font-size: .72rem; color: var(--text-dim);
  margin: 4px 0; flex-wrap: wrap;
}
.lobby-table-stats span { white-space: nowrap; }

/* ─── Table Stats Bar ────────────────────────────────────────────────────────── */
.table-stats-bar {
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
  background: rgba(0,0,0,.25); padding: 4px 14px; font-size: .72rem;
  color: var(--text-dim); border-bottom: 1px solid rgba(255,255,255,.06);
}
.table-stats-bar span { white-space: nowrap; }

/* ─── Straddle Badge ─────────────────────────────────────────────────────────── */
.straddle-badge {
  position: absolute; top: -8px; right: -4px;
  background: #7c3aed; color: #ede9fe;
  font-size: .6rem; font-weight: 700; padding: 1px 5px;
  border-radius: 6px; border: 1px solid #4c1d95; white-space: nowrap;
}

/* ─── Straddle Offer Prompt ──────────────────────────────────────────────────── */
.straddle-offer-prompt {
  position: fixed; bottom: 200px; left: 50%; transform: translateX(-50%);
  background: #0a1a12; border: 2px solid #7c3aed; border-radius: 12px;
  padding: 16px 22px; z-index: 9200; text-align: center;
  min-width: 220px; box-shadow: 0 8px 32px rgba(0,0,0,.7);
  animation: slideUp .25s ease;
}
.straddle-title { color: #c4b5fd; font-size: .85rem; font-weight: 700; margin-bottom: 6px; }
.straddle-desc  { color: var(--text); font-size: .82rem; margin-bottom: 10px; }
.straddle-cd    { font-size: 1.4rem; font-weight: 700; color: #7c3aed; margin-bottom: 12px; }
.straddle-btns  { display: flex; gap: 10px; justify-content: center; }

/* ─── Chat Reaction Bar ──────────────────────────────────────────────────────── */
.chat-reactions-bar {
  display: flex; gap: 4px; padding: 5px 10px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  background: rgba(0,0,0,.15);
}
.reaction-btn {
  background: none; border: none; cursor: pointer;
  font-size: 1.1rem; padding: 2px 5px; border-radius: 6px;
  transition: transform .15s, background .15s;
}
.reaction-btn:hover { background: rgba(255,255,255,.12); transform: scale(1.2); }
.sticker-btn { font-size: .9rem; }

/* ─── Floating Reaction ──────────────────────────────────────────────────────── */
.reaction-float {
  position: fixed; font-size: 1.8rem; z-index: 9100; pointer-events: none;
  animation: reactionRise 2s ease forwards;
}
@keyframes reactionRise {
  0%   { transform: translateY(0) scale(1);   opacity: 1; }
  70%  { transform: translateY(-60px) scale(1.3); opacity: .9; }
  100% { transform: translateY(-100px) scale(.8); opacity: 0; }
}

/* ─── Sticker Panel ──────────────────────────────────────────────────────────── */
.sticker-panel {
  position: fixed; bottom: 200px; left: 12px; z-index: 9100;
  background: #0a1a12; border: 1px solid var(--gold); border-radius: 10px;
  padding: 10px; display: grid; grid-template-columns: 1fr 1fr;
  gap: 5px; min-width: 160px; box-shadow: 0 4px 20px rgba(0,0,0,.6);
}
.sticker-pick-btn {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  border-radius: 6px; padding: 6px 8px; color: var(--text); cursor: pointer;
  font-size: .78rem; text-align: left; transition: background .15s;
}
.sticker-pick-btn:hover { background: rgba(255,255,255,.14); }

/* ─── Sticker Message ────────────────────────────────────────────────────────── */
.sticker { display: inline-block; font-size: 1.6rem; animation: stickerPop .3s ease; }
@keyframes stickerPop { 0% { transform: scale(0); } 70% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* ─── Rabbit Hunt ────────────────────────────────────────────────────────────── */
.rabbit-run-btn {
  display: block; margin: 8px auto 0;
  background: linear-gradient(135deg, #1a3a1a, #2d6a2d);
  border-color: var(--chip-green); font-size: .8rem;
}
.rabbit-result-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.82);
  z-index: 9500; display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.rabbit-result-box {
  background: #0a1a12; border: 2px solid var(--chip-green);
  border-radius: 16px; padding: 22px 26px; max-width: 480px;
  width: 100%; text-align: center; box-shadow: 0 8px 40px rgba(0,0,0,.8);
  animation: slideUp .25s ease;
}
.rabbit-title {
  color: var(--chip-green); font-size: 1.1rem; font-weight: 700; margin-bottom: 14px;
}
.rabbit-community { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; }
.rabbit-community .rabbit-card { animation: rabbitReveal .4s ease; }
@keyframes rabbitReveal {
  0% { transform: rotateY(90deg) scale(.8); opacity: 0; }
  100% { transform: rotateY(0) scale(1); opacity: 1; }
}
.rabbit-card .card { border-color: var(--chip-green) !important; box-shadow: 0 0 8px rgba(46,204,113,.5); }
.rabbit-folded-label { color: var(--text-dim); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.rabbit-folded { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.rabbit-player { text-align: center; }
.rabbit-player-name { display: block; color: var(--gold); font-size: .78rem; margin-bottom: 4px; }
.rabbit-player-cards { display: flex; gap: 4px; justify-content: center; }

/* ─── Profile Page ───────────────────────────────────────────────────────────── */
.stat-card {
  background: rgba(255,255,255,.04); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 12px; text-align: center;
}
.stat-value { font-size: 1.4rem; font-weight: 700; color: var(--gold); }
.stat-label { font-size: .72rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .06em; margin-top: 3px; }

@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ─── Password visibility toggle ────────────────────────────────────────────── */
.pw-wrap { position: relative; }
.pw-wrap > input { padding-right: 48px !important; }
.pw-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 6px 8px;
  touch-action: manipulation;
  line-height: 1;
  user-select: none;
  -webkit-user-select: none;
  opacity: 0.55;
  transition: opacity 0.15s;
}
.pw-toggle:hover, .pw-toggle:active { opacity: 1; }

/* ─── Button loading spinner ─────────────────────────────────────────────────── */
.btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0,0,0,0.2);
  border-top-color: rgba(0,0,0,0.7);
  border-radius: 50%;
  animation: btnSpin 0.65s linear infinite;
  vertical-align: middle;
  flex-shrink: 0;
}
@keyframes btnSpin { to { transform: rotate(360deg); } }

/* ─── Mobile form UX ─────────────────────────────────────────────────────────── */
.form-group input { min-height: 44px; }  /* minimum tap target */
@media (max-width: 768px) {
  .form-group input { font-size: 16px; }  /* prevents iOS zoom on all mobile */
}

/* ─── CSS landscape rotation fallback (table page only) ──────────────────────
   Applies when device is in portrait and orientation lock is unavailable
   (broken sensor, unsupported browser, non-PWA iOS Safari).
   html.table-page-html is added by table.js DOMContentLoaded and removed on
   pagehide, so no other page is affected. */
@media screen and (max-width: 900px) and (orientation: portrait) {
  html.table-page-html {
    transform: rotate(90deg) translateX(0) translateY(-100%);
    transform-origin: top left;
    width: 100vh;
    height: 100vw;
    position: fixed;
    top: 0;
    left: 0;
    overflow: hidden;
  }

  html.table-page-html body.table-page {
    width: 100%;
    height: 100%;
    overflow: hidden;
  }
}

/* ─── Mobile Casino Visual Polish ────────────────────────────────────────────
 * All rules scoped to body.table-page inside (max-width: 900px) media queries.
 * Desktop (≥901px) is completely unaffected.
 * ─────────────────────────────────────────────────────────────────────────── */

/* Pulsing gold ring for active player — declared at global scope for broad browser compat */
@keyframes mobileActiveSeatGlow {
  from { box-shadow: 0 0 0 2px rgba(245,208,96,0.35), 0 0 8px rgba(245,208,96,0.55); }
  to   { box-shadow: 0 0 0 4px rgba(245,208,96,0.82), 0 0 26px rgba(245,208,96,1); }
}

@media (max-width: 900px) {

  /* ── 1. Page background ── */
  body.table-page {
    background: #071510;
  }

  /* ── 2. Poker table felt — casino texture + wood rail ── */
  body.table-page .poker-table-oval {
    background: radial-gradient(ellipse at 50% 44%,
      #2f8048 0%,
      #1d5c33 38%,
      #0d3820 72%,
      #071c0e 100%
    );
    border: 10px solid #3d1f0a;
    box-shadow:
      0 0 0 2px #7a4a18,
      inset 0 0 0 3px rgba(255,255,255,0.04),
      inset 0 6px 32px rgba(0,0,0,0.52),
      0 12px 52px rgba(0,0,0,0.88);
  }

  /* ── 3. Pot display — prominent gold pill ── */
  body.table-page .pot-display {
    background: rgba(0,0,0,0.48);
    border: 1px solid rgba(212,175,55,0.42);
    border-radius: 14px;
    padding: 2px 11px 3px;
    margin-top: 2px;
  }
  body.table-page .pot-display::before {
    content: 'POT';
    display: block;
    font-size: 0.5rem;
    letter-spacing: 0.12em;
    color: rgba(255,255,255,0.42);
    font-weight: 700;
    text-align: center;
    line-height: 1;
    margin-bottom: 1px;
  }
  body.table-page .pot-display .pot-amount {
    font-size: 0.95rem;
    font-weight: 900;
    color: #f5d060;
    text-shadow: 0 0 10px rgba(212,175,55,0.65), 0 1px 3px rgba(0,0,0,1);
    letter-spacing: 0.03em;
  }

  /* ── 4. Community cards — crisp drop shadow ── */
  body.table-page .community-cards .card {
    box-shadow: 2px 3px 10px rgba(0,0,0,0.82), 0 0 0 1px rgba(0,0,0,0.1);
    border-radius: 5px;
  }

  /* ── 5. Hole cards — larger in portrait, stacked overlap ── */
  body.table-page .card.large {
    width: 40px;
    height: 58px;
    font-size: 0.78rem;
    box-shadow: 2px 4px 14px rgba(0,0,0,0.88);
  }
  body.table-page .my-hole-cards {
    gap: 0;
  }
  body.table-page .my-hole-cards .card {
    box-shadow: 3px 4px 14px rgba(0,0,0,0.88);
  }
  body.table-page .my-hole-cards .card:not(:first-child) {
    margin-left: -8px;
    box-shadow: -2px 0 4px rgba(0,0,0,0.55), 3px 4px 14px rgba(0,0,0,0.88);
  }

  /* ── 6. Active player — pulsing gold ring on avatar ── */
  body.table-page .seat-box.active-player .seat-avatar {
    border-color: #f5d060;
    border-width: 3px;
    animation: mobileActiveSeatGlow 1s ease-in-out infinite alternate;
  }

  /* ── 7. Folded — dimmed + slight desaturate ── */
  body.table-page .seat-box.folded {
    opacity: 0.34;
    filter: grayscale(0.35);
  }

  /* ── 8. Empty seat — faint dashed circle, low distraction ── */
  body.table-page .seat-box.empty {
    background: rgba(255,255,255,0.03);
    border: 2px dashed rgba(255,255,255,0.18);
    border-radius: 50%;
    width: 52px;
    height: 52px;
    min-width: 52px;
    padding: 0;
    opacity: 0.52;
    font-size: 0.45rem;
    color: rgba(255,255,255,0.48);
    overflow: hidden;
    line-height: 1.3;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
  body.table-page .seat-box.empty:hover,
  body.table-page .seat-box.empty:active {
    border-color: rgba(212,175,55,0.65);
    opacity: 0.88;
    background: rgba(212,175,55,0.06);
    color: var(--gold);
  }

  /* ── 9. Seat name + chips — sharp white text on green felt ── */
  body.table-page .seat-name {
    font-size: 0.68rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 5px rgba(0,0,0,1), 0 0 10px rgba(0,0,0,0.95);
  }
  body.table-page .seat-bet {
    font-size: 0.72rem;
    text-shadow: 0 1px 3px rgba(0,0,0,0.92);
  }

  /* ── 10. Action buttons — casino colors + 3D press effect ── */
  body.table-page .action-btn {
    border-radius: 10px;
    font-weight: 900;
    letter-spacing: 0.04em;
  }
  body.table-page .action-btn:active:not(:disabled) {
    transform: scale(0.91) translateY(2px);
    filter: brightness(0.8);
    box-shadow: none !important;
  }

  /* FOLD — deep red */
  body.table-page .btn-fold {
    background: linear-gradient(170deg, #e03030, #9e1010);
    box-shadow: 0 4px 0 #680a0a, 0 4px 12px rgba(220,50,50,0.38);
  }
  /* CHECK — steel blue */
  body.table-page .btn-check {
    background: linear-gradient(170deg, #2980b9, #1a5e8e);
    color: #fff;
    box-shadow: 0 4px 0 #0f3a5c, 0 4px 12px rgba(41,128,185,0.36);
  }
  /* CALL — rich green */
  body.table-page .btn-call {
    background: linear-gradient(170deg, #27ae60, #187a3e);
    box-shadow: 0 4px 0 #0c4824, 0 4px 12px rgba(39,174,96,0.36);
  }
  /* BET / RAISE — gold, dark text */
  body.table-page .btn-raise {
    background: linear-gradient(170deg, #e9a20a, #c07c04);
    color: #1a0800;
    box-shadow: 0 4px 0 #7a5000, 0 4px 12px rgba(233,162,10,0.38);
  }
  /* ALL IN — deep purple */
  body.table-page .btn-allin {
    background: linear-gradient(170deg, #9b59b6, #7d3c98);
    color: #fff;
    box-shadow: 0 4px 0 #4e1f72, 0 4px 12px rgba(155,89,182,0.38);
  }

  /* ── 11. Header — crisp dark bar ── */
  body.table-page .table-header {
    background: rgba(0,0,0,0.96);
    border-bottom: 1px solid rgba(212,175,55,0.22);
  }

  /* ── 12. Bottom action bar — premium dark ── */
  body.table-page .my-cards-area {
    background: rgba(4,8,5,0.98);
    border-top: 1px solid rgba(212,175,55,0.26);
  }
}

/* Restore landscape hole card size after portrait override above */
@media (max-width: 900px) and (orientation: landscape) {
  body.table-page .card.large {
    width: 44px;
    height: 64px;
    font-size: 1rem;
  }
  body.table-page .my-hole-cards .card:not(:first-child) {
    margin-left: -10px;
  }
}

/* ─── Mobile Polish Pass 2 ───────────────────────────────────────────────────
 * 1. Suit colors   2. Community cards   3. Dealer puck
 * 4. Chip display  5. Seat names        6. Mobile header chips
 * All @media rules scoped to (max-width:900px). Desktop untouched.
 * ─────────────────────────────────────────────────────────────────────────── */

@media (max-width: 900px) {

  /* 2a. Community cards — portrait: 5 cards must fit (~78vw oval) */
  body.table-page .community-cards .card {
    width: 38px;
    height: 55px;
    font-size: 0.82rem;
    border-radius: 5px;
  }
  body.table-page .community-cards .card-rank {
    font-size: 1em;
    font-weight: 900;
  }
  body.table-page .community-cards .card-pip {
    font-size: 0.82em;
  }
  body.table-page .community-cards .card-center {
    font-size: 1.3em;
  }

  /* 3. Dealer puck — prominent white casino disk */
  body.table-page .dealer-puck {
    width: 22px;
    height: 22px;
    font-size: 0.68rem;
    font-weight: 900;
    background: #fff;
    border: 2px solid #111;
    color: #000;
    box-shadow:
      0 2px 8px rgba(0,0,0,.9),
      0 0 0 1px rgba(0,0,0,.5),
      inset 0 1px 0 rgba(255,255,255,.8);
    top: -11px;
    right: -11px;
  }

  /* 4a. Seat chip count — gold total, 🪙 icon prefix */
  body.table-page .seat-chips {
    font-size: 0.7rem;
  }
  body.table-page .seat-chips .chip-stack::before {
    content: '🪙';
    font-size: 0.6rem;
    margin-right: 1px;
    vertical-align: middle;
    line-height: 1;
  }
  body.table-page .seat-chips .chip-total {
    color: #f5d060;
    font-weight: 800;
    font-size: 0.75rem;
    text-shadow: 0 1px 4px rgba(0,0,0,.95);
  }

  /* 5. Seat name — smaller font so longer names fit; ellipsis only at extremes */
  body.table-page .seat-name {
    font-size: 0.6rem;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* 6. Mobile-only header chip display — hidden on desktop */
  body.table-page .hdr-chips-mob {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    font-size: 0.64rem;
    font-weight: 800;
    color: #f5d060;
    white-space: nowrap;
    letter-spacing: 0.01em;
    text-shadow: 0 1px 3px rgba(0,0,0,.8);
  }
}

/* Hide mobile chip span on desktop */
@media (min-width: 901px) {
  .hdr-chips-mob { display: none; }
}

/* 2b. Community cards — landscape: larger, very readable */
@media (max-width: 900px) and (orientation: landscape) {
  body.table-page .community-cards .card {
    width: 46px;
    height: 66px;
    font-size: 1rem;
    border-radius: 6px;
  }
  body.table-page .community-cards .card-rank {
    font-size: 1em;
    font-weight: 900;
  }
  body.table-page .community-cards .card-center {
    font-size: 1.5em;
  }
}

/* ─── Major Mobile Landscape Overhaul (Pass 3) ──────────────────────────────
 * Features 1-9. ALL rules scoped to (max-width:900px) and (orientation:landscape)
 * unless noted (showdown/allin badges apply globally at small size).
 * Desktop (≥901px) is completely untouched.
 * ─────────────────────────────────────────────────────────────────────────── */

/* ── 1. FULL-BLEED TABLE + 3D PERSPECTIVE ────────────────────────────────── */
@media (max-width: 900px) and (orientation: landscape) {
  /* Body background matches felt edge so area outside oval blends in */
  body.table-page {
    background: #071c0e;
  }
  /* Expand poker-area: leave 36px for header, 64px for action bar, 28px quick-chat */
  body.table-page .poker-area {
    top: 36px;
    bottom: 92px;
    /* 3D perspective: vanishing point at top-center so table recedes away from viewer */
    perspective: 900px;
    perspective-origin: 50% 0%;
  }
  body.table-page .poker-table-wrap {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    /* preserve-3d on the wrap so the oval's rotateX stays in the perspective context */
    transform-style: preserve-3d;
  }
  /* Oval fills nearly the full available area edge-to-edge, tilted for 3D depth */
  body.table-page .poker-table-oval {
    width: 94vw;
    max-width: 94vw;
    height: calc(100dvh - 36px - 92px - 2px);
    max-height: none;
    margin: 0;
    aspect-ratio: unset;
    border-radius: 50%;
    flex-shrink: 0;
    /* 3D tilt: top of oval recedes, bottom comes toward viewer */
    transform: rotateX(12deg);
    /* Depth shadow strengthens the illusion of a surface receding in space */
    filter: drop-shadow(0 20px 30px rgba(0,0,0,0.6));
    /* Felt gradient: lighter at top-near edge, darker at far/bottom — matches tilt */
    background: radial-gradient(ellipse 80% 60% at 50% 30%, #2f8048 0%, #1a5c2a 50%, #071c0e 100%);
  }
}

/* ── 2. PLAYERS ON THE RAIL ──────────────────────────────────────────────── */
@media (max-width: 900px) and (orientation: landscape) {
  body.table-page #seats-container {
    inset: -38px;
  }
  body.table-page .seat-avatar {
    width: 46px;
    height: 46px;
  }
  body.table-page .seat-box:not(.empty) .seat-name {
    font-size: 0.54rem;
    max-width: 70px;
    text-align: center;
    font-weight: 700;
  }
  body.table-page .seat-box:not(.empty) .seat-chips {
    font-size: 0.5rem;
    text-align: center;
  }
  body.table-page .seat-box:not(.empty) {
    align-items: center;
  }
}

/* ── 3. HOLE CARDS — centered, prominent, fan effect ─────────────────────── */
@media (max-width: 900px) and (orientation: landscape) {
  body.table-page .my-hole-cards:has(.card) {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 202;
    gap: 2px;
    background: none;
    pointer-events: auto;
  }
  body.table-page .my-hole-cards:has(.card) .card.large {
    width: 50px;
    height: 72px;
    font-size: 1.1rem;
    box-shadow: 3px 5px 18px rgba(0,0,0,0.9);
  }
  body.table-page .my-hole-cards:has(.card) .card:nth-child(2) {
    transform: rotate(6deg) translateY(-4px);
    margin-left: -4px;
  }
  body.table-page .my-hole-cards:has(.card) .card:not(:first-child) {
    margin-left: -4px;
  }
}

/* ── 4. BET AMOUNTS — chip token style ───────────────────────────────────── */
@media (max-width: 900px) and (orientation: landscape) {
  body.table-page .seat-bet {
    background: rgba(12,36,18,0.9);
    border: 1.5px solid #f5d060;
    border-radius: 10px;
    padding: 1px 5px;
    font-size: 0.52rem;
    font-weight: 900;
    color: #f5d060;
    text-shadow: none;
    white-space: nowrap;
    margin-top: 1px;
    line-height: 1.4;
  }
}

/* ── 5. HAND STRENGTH INDICATOR ──────────────────────────────────────────── */
.hand-strength-bar {
  display: none;
  position: fixed;
  z-index: 201;
  bottom: 94px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.72);
  border: 1px solid rgba(212,175,55,0.45);
  border-radius: 8px;
  padding: 2px 10px;
  font-size: 0.6rem;
  font-weight: 700;
  color: #f5d060;
  white-space: nowrap;
  pointer-events: none;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
}
@media (max-width: 900px) and (orientation: landscape) {
  .hand-strength-bar {
    /* revealed by JS when there are hole cards; display set inline */
  }
}
@media (min-width: 901px) {
  .hand-strength-bar { display: none !important; }
}
@media (max-width: 900px) and (orientation: portrait) {
  .hand-strength-bar { display: none !important; }
}

/* ── 6. BETWEEN-HAND COUNTDOWN ───────────────────────────────────────────── */
.next-hand-countdown {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.62);
  border-radius: 10px;
  padding: 4px 14px;
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(255,255,255,0.82);
  white-space: nowrap;
  z-index: 14;
  pointer-events: none;
  display: none;
}
@media (max-width: 900px) and (orientation: portrait) {
  .next-hand-countdown { display: none !important; }
}

/* ── 7. QUICK CHAT BAR ───────────────────────────────────────────────────── */
.quick-chat-bar {
  display: none;
}
@media (max-width: 900px) and (orientation: landscape) {
  .quick-chat-bar {
    display: flex;
    position: fixed;
    bottom: 64px;
    left: 0;
    right: 0;
    height: 28px;
    gap: 6px;
    padding: 0 10px;
    background: rgba(4,10,6,0.92);
    border-top: 1px solid rgba(255,255,255,0.08);
    z-index: 198;
    align-items: center;
    justify-content: center;
    overflow-x: auto;
  }
  .quick-chat-btn {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 12px;
    padding: 2px 10px;
    font-size: 0.6rem;
    color: rgba(255,255,255,0.88);
    white-space: nowrap;
    cursor: pointer;
    flex-shrink: 0;
    line-height: 1.3;
    -webkit-tap-highlight-color: transparent;
  }
  .quick-chat-btn:active {
    background: rgba(212,175,55,0.2);
    border-color: rgba(212,175,55,0.6);
    color: #f5d060;
  }
}

/* ── 8. SHOWDOWN — gold glow on winning cards ────────────────────────────── */
@keyframes winnerCardGlow {
  from { box-shadow: 0 0 0 2px #f5d060, 0 0 10px rgba(245,208,96,0.7), 2px 3px 8px rgba(0,0,0,0.7); }
  to   { box-shadow: 0 0 0 3px #f5d060, 0 0 24px rgba(245,208,96,1),   2px 3px 14px rgba(0,0,0,0.8); }
}
.seat-box.showdown-winner .seat-cards .card {
  animation: winnerCardGlow 0.8s ease-in-out infinite alternate;
}
.showdown-hand-badge {
  background: var(--gold);
  color: #000;
  font-size: 0.5rem;
  font-weight: 900;
  border-radius: 4px;
  padding: 1px 4px;
  margin-top: 2px;
  text-align: center;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ── 9. ALL-IN GOLD BANNER ───────────────────────────────────────────────── */
@keyframes allInPulse {
  from { box-shadow: none; }
  to   { box-shadow: 0 0 8px rgba(245,208,96,0.75); }
}
.seat-allin-badge {
  display: inline-block;
  background: linear-gradient(135deg, #f5d060, #c9a000);
  color: #1a0800;
  font-size: 0.5rem;
  font-weight: 900;
  padding: 1px 5px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-top: 1px;
  animation: allInPulse 1.3s ease-in-out infinite alternate;
}
@media (max-width: 900px) {
  .seat-allin-badge {
    font-size: 0.55rem;
    padding: 1px 5px;
  }
}

/* ── PRACTICE CHIP ECONOMY ───────────────────────────────────────────────── */

/* Header practice chip count */
.practice-chip-count { color: #2ecc71; font-weight: 700; }

/* Section lock overlay */
.section-lock-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgba(0, 0, 0, 0.72);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}
.section-lock-box {
  text-align: center;
  padding: 24px;
}
.section-lock-box .lock-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}
.section-lock-box p {
  color: #ccc;
  font-size: 0.85rem;
  margin: 0;
}

/* Spin wheel container */
.spin-wheel-wrap {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 0 auto;
}
.spin-wheel {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 4px solid var(--gold, #d4af37);
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.4);
  transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}
.spin-pointer {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 18px solid var(--gold, #d4af37);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}
.spin-labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.spin-label {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 0.65rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}
