:root {
  color-scheme: dark;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --bg: #070c09;
  --panel: #0d1612;
  --panel-hover: #13221b;
  --panel-border: #1f3629;
  --panel-border-focus: #10b981;
  --accent: #10b981;
  --accent-light: #34d399;
  --accent-glow: rgba(16, 185, 129, 0.4);
  --gold: #fbbf24;
  --gold-glow: rgba(251, 191, 36, 0.4);
  --red: #ef4444;
  --blue: #0284c7;
  --text: #ffffff;
  --text-muted: #cbd5e1;
  --text-dim: #94a3b8;
  --font-mono: ui-monospace, 'SFMono-Regular', 'Menlo', 'Monaco', 'Consolas', monospace;
  --felt-1: #144933;
  --felt-2: #0b2c1f;
  --felt-edge: #05160f;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --mobile-nav-h: 56px;
  --mobile-header-h: 48px;
  --play-toolbar-h: 50px;
  --hero-action-zone-h: 120px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
  touch-action: manipulation;
}

button, .btn, .preset-btn, .mobile-nav-item {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

/* =====================================================================
   AUTHENTICATION OVERLAY
   ===================================================================== */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(4, 8, 6, 0.95);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: min(100%, 400px);
  background: var(--panel);
  border: 1.5px solid var(--panel-border);
  border-radius: 16px;
  padding: 32px 26px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
}

.login-logo {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.login-logo span {
  color: var(--gold);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.form-group label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-input {
  background: rgba(0, 0, 0, 0.45);
  border: 1.5px solid var(--panel-border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: all 0.15s ease;
}

.form-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

/* =====================================================================
   HEADER & TOP NAVBAR
   ===================================================================== */
header {
  height: auto;
  min-height: 58px;
  background: rgba(13, 22, 18, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1.5px solid var(--panel-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 18px;
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 10px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.brand-icon {
  color: var(--gold);
  font-size: 1.25rem;
}

.brand-badge {
  font-size: 0.65rem;
  font-weight: 800;
  background: rgba(251, 191, 36, 0.15);
  color: var(--gold);
  border: 1px solid rgba(251, 191, 36, 0.4);
  padding: 2px 7px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.nav-tabs {
  display: flex;
  gap: 6px;
  background: rgba(0, 0, 0, 0.35);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--panel-border);
}

.nav-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 7px 15px;
  font-size: 0.84rem;
  font-weight: 750;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.12s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.nav-tab-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-tab-btn.active {
  color: #040806;
  background: var(--gold);
  font-weight: 850;
  box-shadow: 0 2px 8px var(--gold-glow);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--panel-border);
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 0.8rem;
  color: #ffffff;
  white-space: nowrap;
}

.user-stat-tag {
  background: rgba(251, 191, 36, 0.16);
  color: var(--gold);
  border: 1px solid rgba(251, 191, 36, 0.35);
  font-size: 0.68rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 99px;
  font-family: var(--font-mono);
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 800;
  font-family: var(--font-mono);
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-light);
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 4px 10px;
  border-radius: 99px;
  white-space: nowrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-light);
}

.btn-logout {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  font-size: 0.75rem;
  font-weight: 750;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-logout:hover {
  color: #ffffff;
  background: var(--red);
  border-color: var(--red);
}

/* =====================================================================
   MAIN LAYOUT & TAB PANELS
   ===================================================================== */
main {
  flex: 1;
  width: min(100%, 1440px);
  margin: 0 auto;
  padding: 14px;
}

.btn, .preset-btn, .mobile-nav-item, .matrix-cell, .nav-tab-btn, .btn-logout, .form-input {
  touch-action: manipulation;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.table-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 12px;
  align-items: stretch;
}

.table-layout.pokerok-layout {
  min-height: calc(100vh - 110px);
}

.table-stage {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

/* =====================================================================
   POKEROK FULL-BLEED TABLE
   ===================================================================== */
.table-viewport {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: min(62vh, 560px);
  aspect-ratio: 1.55;
  max-height: 640px;
  background:
    radial-gradient(ellipse at 50% 42%, #1a5c40 0%, #0e3d2a 42%, #0a2a1d 72%, #061810 100%);
  border: 10px solid #0a0e0c;
  border-radius: 50% / 46%;
  box-shadow:
    inset 0 0 0 3px #1a1f1c,
    inset 0 0 80px rgba(0, 0, 0, 0.55),
    0 0 0 1px #2a2f2c,
    0 18px 50px rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  user-select: none;
}

.felt-racetrack {
  position: absolute;
  inset: 11%;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 50% / 46%;
  pointer-events: none;
}

.felt-watermark {
  position: absolute;
  font-size: clamp(2.2rem, 7vw, 4.2rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.045);
  text-transform: uppercase;
  user-select: none;
  pointer-events: none;
  transform: translateY(-8%);
}

.table-center-pot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 5;
  transform: translateY(-6%);
}

.pot-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.pot-caption {
  font-size: 0.72rem;
  font-weight: 700;
  color: #fbbf24;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

#pot-value-text {
  font-size: 1.05rem;
  font-weight: 900;
  color: #fde68a;
  font-family: var(--font-mono);
  text-shadow: 0 2px 6px rgba(0,0,0,0.9);
}

.table-meta {
  font-size: 0.68rem;
  color: rgba(226, 232, 240, 0.55);
  text-align: center;
  line-height: 1.35;
  max-width: 220px;
}

.board-container {
  display: flex;
  gap: 5px;
  min-height: 54px;
  align-items: center;
  justify-content: center;
}

/* =====================================================================
   POKEROK PLAYER PODS — avatar + name/stack, cards tucked behind
   ===================================================================== */
.seats-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.seat-box {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 92px;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  pointer-events: auto;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.seat-box.hero {
  width: 118px;
  z-index: 18;
}

.seat-box.turn-active .seat-info {
  box-shadow: 0 0 0 2px var(--accent), 0 0 16px var(--accent-glow);
  animation: pulse-turn 1.4s infinite alternate ease-in-out;
}

@keyframes pulse-turn {
  0% { box-shadow: 0 0 0 2px var(--accent), 0 0 10px var(--accent-glow); }
  100% { box-shadow: 0 0 0 2px #34d399, 0 0 22px rgba(52, 211, 153, 0.75); }
}

.seat-box.winner .seat-info {
  box-shadow: 0 0 0 2px var(--gold), 0 0 18px var(--gold-glow);
}

.seat-box.busted {
  opacity: 0.4;
  filter: grayscale(1);
}

.seat-box.folded {
  opacity: 0.55;
}

.seat-box.folded .seat-hole-cards {
  opacity: 0.25;
}

.seat-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(145deg, #2a3a32, #121a16);
  border: 2px solid #3d4f45;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  z-index: 3;
  box-shadow: 0 4px 12px rgba(0,0,0,0.7);
  margin-bottom: -10px;
}

.seat-box.hero .seat-avatar {
  width: 48px;
  height: 48px;
  border-color: var(--gold);
}

.seat-avatar.hero {
  background: linear-gradient(145deg, #3a4a28, #1a2210);
}

.seat-info {
  width: 100%;
  background: rgba(8, 12, 10, 0.88);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 10px 6px 5px;
  text-align: center;
  z-index: 2;
  backdrop-filter: blur(4px);
}

.seat-name {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.seat-stack-val {
  display: block;
  font-size: 0.78rem;
  font-weight: 850;
  color: #7dd3fc;
  font-family: var(--font-mono);
  margin-top: 1px;
  line-height: 1.15;
}

.seat-stack-chips {
  display: block;
  font-size: 0.62rem;
  font-weight: 600;
  color: rgba(148, 163, 184, 0.85);
  font-family: var(--font-mono);
  margin-top: 1px;
}

.seat-bounty-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.22) 0%, rgba(180, 83, 9, 0.32) 100%);
  border: 1px solid rgba(245, 158, 11, 0.55);
  color: #fbbf24;
  font-size: 0.62rem;
  font-weight: 800;
  font-family: var(--font-mono);
  padding: 1px 6px;
  border-radius: 4px;
  margin: 2px 0 1px;
  letter-spacing: 0.2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.seat-box.hero .seat-bounty-badge {
  font-size: 0.68rem;
  padding: 2px 8px;
}

.seat-hud-pill {
  display: inline-block;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  font-size: 0.58rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 1px 5px;
  border-radius: 3px;
  margin-top: 2px;
  white-space: nowrap;
}

.pos-badge {
  position: absolute;
  top: 28px;
  right: -2px;
  font-size: 0.55rem;
  font-weight: 900;
  padding: 1px 4px;
  border-radius: 3px;
  background: #1e293b;
  color: #e2e8f0;
  z-index: 4;
  border: 1px solid #334155;
}

.pos-badge.pos-btn { background: #854d0e; color: #fef08a; border-color: #ca8a04; }
.pos-badge.pos-sb { background: #5b21b6; color: #e9d5ff; border-color: #7c3aed; }
.pos-badge.pos-bb { background: #1e3a8a; color: #bfdbfe; border-color: #3b82f6; }

.seat-hole-cards {
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 2px;
  z-index: 1;
  pointer-events: none;
}

.seat-box.hero .seat-hole-cards {
  position: relative;
  top: auto;
  left: auto;
  transform: none;
  margin-top: 4px;
  z-index: 5;
  gap: 4px;
}

.seat-box:not(.hero) .seat-hole-cards .card-face {
  width: 22px;
  height: 30px;
  font-size: 0.62rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.6);
}

.seat-box:not(.hero) .card-face.hidden {
  /* tucked slightly behind the info box */
  margin-bottom: 0;
}

.seat-rank-label {
  font-size: 0.62rem;
  font-weight: 800;
  color: var(--gold);
  text-align: center;
  margin-top: 3px;
  white-space: nowrap;
}

.seat-action-pill {
  position: absolute;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  top: auto;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.75);
  z-index: 20;
  animation: pill-pop 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pill-pop {
  0% { transform: translateX(-50%) scale(0.6); opacity: 0; }
  100% { transform: translateX(-50%) scale(1); opacity: 1; }
}

.seat-action-pill.action-fold {
  background: #374151;
  color: #e5e7eb;
  border: 1px solid #4b5563;
}

.seat-action-pill.action-check {
  background: #1e3a8a;
  color: #bfdbfe;
  border: 1px solid #3b82f6;
}

.seat-action-pill.action-call {
  background: #0e7490;
  color: #a5f3fc;
  border: 1px solid #06b6d4;
}

.seat-action-pill.action-raise {
  background: #b45309;
  color: #fef08a;
  border: 1px solid #f59e0b;
}

.seat-action-pill.action-allin {
  background: #991b1b;
  color: #fecaca;
  border: 1px solid #ef4444;
  animation: pill-pop 0.22s ease, allin-glow 1s infinite alternate;
}

.seat-action-pill.action-blind {
  background: #581c87;
  color: #e9d5ff;
  border: 1px solid #8b5cf6;
}

@keyframes allin-glow {
  0% { box-shadow: 0 0 6px rgba(239, 68, 68, 0.5); }
  100% { box-shadow: 0 0 14px rgba(239, 68, 68, 0.95); }
}

.seat-bet-chip {
  position: absolute;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.72);
  border: 1.5px solid rgba(251, 191, 36, 0.75);
  color: #fde68a;
  font-size: 0.72rem;
  font-weight: 800;
  font-family: var(--font-mono);
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
  z-index: 16;
  pointer-events: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.dealer-puck {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fbbf24;
  color: #111;
  font-size: 0.72rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  z-index: 9;
  box-shadow: 0 2px 8px rgba(0,0,0,0.7);
}

.seat-timer-bar-wrap {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  margin-top: 4px;
  overflow: hidden;
}

.seat-timer-bar {
  height: 100%;
  background: linear-gradient(90deg, #10b981 0%, #f59e0b 70%, #ef4444 100%);
  width: 100%;
  transform-origin: left center;
}

.seat-timer-bar.hero-turn {
  animation: timer-shrink 25s linear forwards;
}

.seat-timer-bar.pacing {
  animation: timer-shrink 2s linear forwards;
}

.seat-timer-bar.thinking {
  animation: timer-think-pulse 1.1s ease-in-out infinite;
  background: linear-gradient(90deg, #06b6d4 0%, #8b5cf6 50%, #06b6d4 100%);
  background-size: 200% 100%;
}

.seat-timer-bar.idle {
  width: 40%;
  opacity: 0.45;
  background: var(--gold);
}

@keyframes timer-think-pulse {
  0% { width: 22%; opacity: 0.45; background-position: 0% 50%; }
  50% { width: 92%; opacity: 1; background-position: 100% 50%; }
  100% { width: 22%; opacity: 0.45; background-position: 0% 50%; }
}

@keyframes timer-shrink {
  0% { width: 100%; }
  100% { width: 0%; }
}

.showdown-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 30;
  background: rgba(6, 12, 9, 0.92);
  border: 1.5px solid rgba(251, 191, 36, 0.55);
  border-radius: 12px;
  padding: 12px 16px;
  min-width: min(88%, 280px);
  text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,0.85);
}

.showdown-overlay.showdown-toast {
  top: auto;
  bottom: 10%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 140px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}

.seat-box.cards-revealed .seat-hole-cards {
  position: relative;
  top: auto;
  left: auto;
  transform: none;
  margin-bottom: 4px;
  z-index: 6;
  order: -1;
}

.seat-box.cards-revealed .seat-hole-cards .card-face {
  width: 28px;
  height: 38px;
  font-size: 0.72rem;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.75);
}

.showdown-title {
  font-size: 0.95rem;
  font-weight: 900;
  color: var(--gold);
}

.showdown-detail {
  font-size: 0.78rem;
  color: #e2e8f0;
  margin-top: 4px;
}

.showdown-countdown-bar {
  width: 100%;
  height: 4px;
  background: rgba(251, 191, 36, 0.2);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}

.showdown-countdown-fill {
  height: 100%;
  background: var(--gold);
  width: 100%;
  animation: timer-shrink 5s linear forwards;
}

.tournament-result-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.72);
  pointer-events: auto;
}

.tournament-result-card {
  width: min(92%, 320px);
  background: linear-gradient(160deg, rgba(20, 28, 24, 0.98), rgba(8, 12, 10, 0.98));
  border: 1.5px solid rgba(251, 191, 36, 0.55);
  border-radius: 16px;
  padding: 18px 16px;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.85);
}

.tournament-result-card.hero-win {
  border-color: rgba(16, 185, 129, 0.65);
}

.tournament-result-card.hero-bust {
  border-color: rgba(239, 68, 68, 0.55);
}

.tournament-result-title {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--gold);
  margin-bottom: 6px;
}

.tournament-result-winner {
  font-size: 1.35rem;
  font-weight: 900;
  color: #fff;
  margin: 8px 0 4px;
}

.tournament-result-sub {
  font-size: 0.82rem;
  color: #cbd5e1;
  margin-bottom: 14px;
}

.tournament-result-overlay .btn.primary {
  width: 100%;
  min-height: 48px;
  font-size: 1rem;
}

.table-viewport.tournament-finished .seat-box:not(.hero):not(.winner) {
  opacity: 0.35;
}

.table-viewport.tournament-finished .seat-hole-cards,
.table-viewport.tournament-finished .seat-rank-label {
  display: none !important;
}

.table-viewport.showdown-active:not(.tournament-finished) .seat-box.folded {
  opacity: 0.45;
}

.table-viewport.showdown-active:not(.tournament-finished) .seat-box:not(.winner):not(.hero) .seat-rank-label {
  display: none;
}

.action-toolbar {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.format-select {
  width: auto;
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  background: #141c18;
  border-color: #24352b;
  color: var(--gold);
  border-radius: 6px;
}

.btn-compact {
  padding: 5px 10px !important;
  font-size: 0.75rem !important;
  min-height: 0 !important;
}

/* =====================================================================
   FOUR-COLOR DECK CARDS (PRO POKER SPEC)
   ===================================================================== */
.card-face {
  width: 34px;
  height: 48px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 5px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  font-size: 0.84rem;
  font-weight: 900;
  font-family: var(--font-mono);
  line-height: 1;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.75), 0 1px 2px rgba(0, 0, 0, 0.4);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card-face .card-rank {
  font-size: 0.9em;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.card-face .card-suit {
  font-size: 1em;
  line-height: 0.9;
}

.card-face.hero-card {
  width: 48px;
  height: 68px;
  font-size: 1.35rem;
  border: 2px solid #ffffff;
  border-radius: 6px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.85), 0 0 14px rgba(255, 255, 255, 0.35);
}

.card-face.hero-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.9), 0 0 18px rgba(255, 255, 255, 0.5);
}

.card-face.board {
  width: 50px;
  height: 70px;
  border-radius: 6px;
  font-size: 1.35rem;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.85), 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* 4-Color Deck Standards:
   ♠ Spades: Obsidian (#0f172a)
   ♥ Hearts: Crimson (#dc2626)
   ♦ Diamonds: Royal Blue (#2563eb)
   ♣ Clubs: Emerald (#15803d) */
.card-face.spade {
  color: #0f172a;
  text-shadow: 0 0.5px 0 rgba(0, 0, 0, 0.2);
}

.card-face.heart {
  color: #dc2626;
  text-shadow: 0 0.5px 0 rgba(220, 38, 38, 0.2);
}

.card-face.diamond {
  color: #2563eb;
  text-shadow: 0 0.5px 0 rgba(37, 99, 235, 0.2);
}

.card-face.club {
  color: #15803d;
  text-shadow: 0 0.5px 0 rgba(21, 128, 61, 0.2);
}

.card-face.hidden {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid #334155;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.85), 0 3px 8px rgba(0, 0, 0, 0.7);
  position: relative;
}

.card-face.hidden::after {
  content: '♠';
  color: #f59e0b;
  opacity: 0.8;
  font-size: 1.2rem;
  filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.4));
}

/* =====================================================================
   HERO ACTION CONTROLLER
   ===================================================================== */
.action-controller {
  margin-top: 14px;
  background: var(--panel);
  border: 1.5px solid var(--panel-border);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.action-bar-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.hotkeys-hint {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--font-mono);
  user-select: none;
}

@media (max-width: 768px) {
  .hotkeys-hint {
    display: none;
  }
}

.action-presets-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.preset-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #e2e8f0;
  padding: 5px 12px;
  font-size: 0.82rem;
  font-weight: 800;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.12s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.preset-btn:hover {
  background: var(--gold);
  color: #040806;
  border-color: var(--gold);
  transform: translateY(-1px);
}

.preset-key {
  font-size: 0.65rem;
  font-weight: 900;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--gold);
  padding: 1px 4px;
  border-radius: 3px;
  font-family: var(--font-mono);
  line-height: 1;
}

.preset-btn:hover .preset-key {
  background: rgba(0, 0, 0, 0.7);
  color: #fbbf24;
}

.btn-hotkey {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.95);
  margin-left: 6px;
  vertical-align: middle;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.action-btns-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn {
  background: var(--panel);
  border: 1.5px solid var(--panel-border);
  color: var(--text);
  padding: 9px 16px;
  font-size: 0.88rem;
  font-weight: 800;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
}

.btn:hover:not(:disabled) {
  border-color: var(--text-muted);
  background: var(--panel-hover);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #04140c;
  font-weight: 900;
  box-shadow: 0 4px 14px var(--accent-glow);
}

.btn.primary:hover:not(:disabled) {
  background: var(--accent-light);
  box-shadow: 0 6px 20px rgba(52, 211, 153, 0.6);
}

.btn.fold {
  color: #ffffff;
  border-color: #b91c1c;
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn.fold:hover {
  background: linear-gradient(180deg, #f87171 0%, #ef4444 100%);
  border-color: #ef4444;
  transform: translateY(-1px);
}

.btn.call {
  color: #ffffff;
  border-color: #0369a1;
  background: linear-gradient(180deg, #0284c7 0%, #0369a1 100%);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn.call:hover {
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%);
  border-color: #38bdf8;
  transform: translateY(-1px);
}

.btn.raise {
  color: #ffffff;
  border-color: #047857;
  background: linear-gradient(180deg, #10b981 0%, #059669 100%);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn.raise:hover {
  background: linear-gradient(180deg, #34d399 0%, #10b981 100%);
  border-color: #34d399;
  transform: translateY(-1px);
}

/* =====================================================================
   SIDE PANELS & EV BREAKDOWN
   ===================================================================== */
.side-panels {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel-card {
  background: var(--panel);
  border: 1.5px solid var(--panel-border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel-header {
  font-size: 0.95rem;
  font-weight: 850;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 8px;
}

.ev-breakdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ev-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ev-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 800;
  font-family: var(--font-mono);
}

.ev-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  overflow: hidden;
}

.ev-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.3s ease;
}

.ev-fill.best {
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold-glow);
}

.gto-badge {
  background: rgba(16, 185, 129, 0.12);
  border: 1.5px solid rgba(16, 185, 129, 0.4);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.84rem;
  font-family: var(--font-mono);
}

/* =====================================================================
   GTO MATRIX EXPLORER
   ===================================================================== */
.gto-explorer {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gto-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  background: var(--panel);
  border: 1.5px solid var(--panel-border);
  border-radius: 12px;
  padding: 12px 14px;
}

.gto-legend {
  margin-left: auto;
  display: flex;
  gap: 14px;
  font-size: 0.8rem;
  font-weight: 750;
  flex-wrap: wrap;
  align-items: center;
}

.gto-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #e2e8f0;
}

.gto-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
  flex-shrink: 0;
}

.gto-dot.push { background: #ef4444; }
.gto-dot.raise { background: #10b981; }
.gto-dot.call { background: #38bdf8; }
.gto-dot.fold { background: rgba(255, 255, 255, 0.2); border: 1px solid rgba(255, 255, 255, 0.4); }

.matrix-grid-wrapper {
  overflow-x: auto;
  background: var(--panel);
  border: 1.5px solid var(--panel-border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  justify-content: center;
}

.matrix-grid {
  display: grid;
  grid-template-columns: repeat(13, minmax(24px, 46px));
  gap: 3px;
}

.matrix-cell {
  aspect-ratio: 1;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: clamp(0.52rem, 1.1vw, 0.76rem);
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.1s;
  user-select: none;
  font-family: var(--font-mono);
}

.matrix-cell:hover {
  transform: scale(1.18);
  z-index: 20;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.9);
}

/* =====================================================================
   BENCHMARK TAB
   ===================================================================== */
.benchmark-layout {
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 16px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.stat-card {
  background: rgba(0, 0, 0, 0.35);
  border: 1.5px solid var(--panel-border);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 0.72rem;
  font-weight: 750;
  color: var(--text-muted);
  text-transform: uppercase;
}

.stat-metric {
  font-size: 1.35rem;
  font-weight: 850;
  color: #ffffff;
  font-family: var(--font-mono);
}

/* =====================================================================
   TABLE & HISTORY
   ===================================================================== */
.table-data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.table-data th,
.table-data td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--panel-border);
}

.table-data th {
  font-size: 0.74rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 800;
}

/* =====================================================================
   MOBILE NAVIGATION
   ===================================================================== */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(56px + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(13, 22, 18, 0.98);
  backdrop-filter: blur(12px);
  border-top: 1.5px solid var(--panel-border);
  z-index: 100;
  justify-content: space-around;
  align-items: center;
}

.mobile-nav-item {
  background: none;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 0.68rem;
  font-weight: 750;
  cursor: pointer;
  padding: 4px 8px;
}

.mobile-nav-item.active {
  color: var(--gold);
}

/* =====================================================================
   RESPONSIVE MEDIA QUERIES (TABLETS & PHONES)
   ===================================================================== */
@media (max-width: 900px) {
  .table-layout,
  .table-layout.pokerok-layout {
    grid-template-columns: 1fr;
  }
  .side-panels {
    display: none;
  }
  .benchmark-layout {
    grid-template-columns: 1fr;
  }
  .nav-tabs {
    display: none;
  }
  .mobile-bottom-nav {
    display: flex;
  }
  .table-layout.pokerok-layout {
    min-height: calc(100dvh - 120px);
  }
  .table-viewport {
    min-height: calc(100dvh - 280px);
    max-height: none;
    aspect-ratio: auto;
    height: calc(100dvh - 280px);
    border-radius: 48% / 42%;
    border-width: 8px;
  }
}

/* SMARTPHONE / IPHONE OPTIMIZATIONS (< 600px) */
@media (max-width: 600px) {
  .login-overlay {
    align-items: flex-start;
    padding: calc(16px + var(--safe-top)) 12px calc(16px + var(--safe-bottom));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .login-card {
    padding: 22px 16px;
    margin: auto 0;
  }

  header {
    padding: 6px 10px;
    gap: 6px;
  }

  .brand {
    font-size: 0.95rem;
  }

  .brand-badge {
    display: none;
  }

  .user-pill {
    padding: 3px 7px;
    font-size: 0.72rem;
  }

  .user-stat-tag {
    display: none;
  }

  .status-pill {
    padding: 3px 6px;
    font-size: 0.68rem;
  }

  .btn-logout {
    padding: 4px 8px;
    font-size: 0.7rem;
  }

  main {
    padding: 4px 6px;
    padding-bottom: calc(64px + var(--safe-bottom));
  }

  /* PokerOK: table fills almost the whole phone screen */
  body {
    background: #000;
  }

  .table-layout.pokerok-layout {
    min-height: calc(100dvh - 88px);
  }

  .table-viewport {
    width: 100%;
    height: calc(100dvh - 220px);
    min-height: 460px;
    max-height: none;
    aspect-ratio: auto;
    border: 7px solid #050505;
    border-radius: 46% / 44%;
  }

  .action-controller {
    background: rgba(0, 0, 0, 0.92);
    border-radius: 12px;
    padding: 8px 10px;
  }

  .felt-watermark {
    font-size: clamp(1.8rem, 12vw, 2.8rem);
    transform: translateY(-4%);
  }

  .showdown-overlay {
    top: auto;
    bottom: calc(118px + var(--safe-bottom));
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    max-width: 240px;
    padding: 8px 12px;
  }

  .showdown-overlay.showdown-toast {
    top: auto;
    bottom: calc(118px + var(--safe-bottom));
    transform: translateX(-50%);
  }

  #header-hand-info {
    display: none;
  }

  .seat-box {
    width: clamp(72px, 20vw, 88px);
  }

  .seat-box.hero {
    width: clamp(100px, 28vw, 120px);
  }

  .seat-avatar {
    width: 36px;
    height: 36px;
    font-size: 0.95rem;
    margin-bottom: -8px;
  }

  .seat-box.hero .seat-avatar {
    width: 42px;
    height: 42px;
  }

  .seat-name {
    font-size: 0.62rem;
  }

  .seat-stack-val {
    font-size: 0.72rem;
  }

  .seat-stack-chips,
  .seat-hud-pill,
  .btn-hotkey,
  .preset-key,
  .hotkeys-hint {
    display: none;
  }

  .seat-bounty-badge {
    font-size: 0.52rem;
    padding: 0 4px;
    margin: 1px 0 0;
    gap: 0;
  }

  .seat-box.hero .seat-bounty-badge {
    font-size: 0.58rem;
    padding: 1px 5px;
  }

  .seat-info {
    padding: 8px 4px 4px;
  }

  .seat-box:not(.hero) .seat-hole-cards .card-face {
    width: 18px;
    height: 26px;
  }

  .card-face {
    width: 20px;
    height: 29px;
    font-size: 0.68rem;
    border-radius: 3px;
  }

  .card-face.hero-card {
    width: 40px;
    height: 56px;
    font-size: 1.05rem;
    border-width: 1.5px;
  }

  .card-face.board {
    width: 32px;
    height: 46px;
    font-size: 0.95rem;
    border-radius: 4px;
  }

  .seat-bet-chip {
    font-size: 0.68rem;
    padding: 2px 7px;
    z-index: 16;
  }

  .dealer-puck {
    width: 18px;
    height: 18px;
    font-size: 0.58rem;
  }

  .action-controller {
    padding: 8px;
    gap: 6px;
  }

  .action-presets-row {
    gap: 4px;
  }

  .preset-btn {
    padding: 8px 6px;
    font-size: 0.78rem;
    flex: 1 1 0;
    min-height: 44px;
    min-width: 44px;
    text-align: center;
  }

  .action-btns-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .btn {
    padding: 10px 8px;
    font-size: 0.88rem;
    min-height: 48px;
  }

  .form-input,
  input,
  select,
  textarea {
    font-size: 16px;
  }

  .matrix-grid {
    grid-template-columns: repeat(13, 22px);
    gap: 2px;
  }

  .matrix-cell {
    font-size: 0.55rem;
  }

  body.on-table-tab.mobile-immersive .table-viewport {
    height: auto !important;
    min-height: 0 !important;
  }

  body.on-table-tab.mobile-immersive .table-layout.pokerok-layout {
    min-height: 0 !important;
  }
}

/* =====================================================================
   MOBILE IMMERSIVE TABLE MODE (PokerOK-inspired)
   ===================================================================== */
@media (max-width: 900px) {
  body.on-table-tab header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    transition: transform 0.28s ease, opacity 0.28s ease;
  }

  body.on-table-tab .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.28s ease, opacity 0.28s ease;
  }

  body.on-table-tab:not(.chrome-revealed) header {
    transform: translateY(-110%);
    opacity: 0;
    pointer-events: none;
  }

  body.on-table-tab:not(.chrome-revealed) .mobile-bottom-nav {
    transform: translateY(calc(110% + var(--safe-bottom)));
    opacity: 0;
    pointer-events: none;
  }

  body.on-table-tab.mobile-immersive main {
    padding: 0;
    height: 100dvh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  body.on-table-tab.mobile-immersive.chrome-revealed main {
    padding-top: var(--mobile-header-h);
    padding-bottom: calc(var(--mobile-nav-h) + var(--safe-bottom));
    height: 100dvh;
  }

  body.on-table-tab.mobile-immersive #tab-table {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  body.on-table-tab.mobile-immersive .table-layout.pokerok-layout {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    height: auto;
  }

  body.on-table-tab.mobile-immersive .table-stage {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  body.on-table-tab.mobile-immersive .table-viewport {
    flex: 1 1 0;
    min-height: 0 !important;
    height: auto !important;
    width: 100%;
    max-height: none !important;
    margin: 0;
    aspect-ratio: unset;
    border-radius: 44% / 40%;
  }

  body.on-table-tab.mobile-immersive .action-controller {
    flex-shrink: 0;
    position: static;
    margin: 0;
    border-radius: 12px 12px 0 0;
    padding: 6px 8px calc(6px + var(--safe-bottom));
    background: rgba(0, 0, 0, 0.94);
    box-shadow: none;
    backdrop-filter: none;
  }

  body.on-table-tab.mobile-immersive:not(.hero-turn):not(.hand-end) .action-btns-grid {
    display: none;
  }

  body.on-table-tab.mobile-immersive:not(.hero-turn):not(.hand-end) .action-bar-top {
    margin: 0;
    gap: 4px;
  }

  body.on-table-tab.mobile-immersive:not(.hero-turn):not(.hand-end) #hero-action-title {
    display: none;
  }

  body.on-table-tab.mobile-immersive:not(.chrome-revealed):not(.hero-turn) .action-toolbar .format-select {
    display: none;
  }

  body.on-table-tab.mobile-immersive .btn-step-mini {
    min-height: 44px !important;
    min-width: 44px !important;
    padding: 6px 12px !important;
    font-size: 0.85rem !important;
    opacity: 0.95;
  }

  body.on-table-tab.mobile-immersive .hotkeys-hint {
    display: none !important;
  }

  body.on-table-tab.mobile-immersive:not(.hero-turn):not(.hand-end) .hero-action-zone {
    display: none;
  }

  body.on-table-tab.mobile-immersive:not(.chrome-revealed) .format-select-mobile {
    display: none;
  }

  body.on-table-tab.mobile-immersive .play-toolbar {
    flex-wrap: nowrap;
  }

  body.on-table-tab.mobile-immersive .play-toolbar .btn-compact {
    min-height: 40px;
    padding: 6px 10px;
    font-size: 0.78rem;
  }

  body.on-table-tab.mobile-immersive.hero-turn .action-controller {
    padding: 8px 10px calc(10px + var(--safe-bottom));
    max-height: none;
    overflow: visible;
  }

  body.on-table-tab.mobile-immersive.hero-turn #hero-action-title,
  body.on-table-tab.mobile-immersive.hero-turn .hotkeys-hint,
  body.on-table-tab.mobile-immersive.hero-turn .btn-hotkey,
  body.on-table-tab.mobile-immersive.hero-turn .preset-key {
    display: none;
  }

  body.on-table-tab.mobile-immersive.hero-turn .action-toolbar .format-select {
    display: none;
  }

  body.on-table-tab.mobile-immersive.hero-turn .action-presets-row {
    display: flex !important;
    grid-column: 1 / -1;
    width: 100%;
    gap: 5px;
    flex-wrap: wrap;
    padding-bottom: 2px;
  }

  body.on-table-tab.mobile-immersive.hero-turn .preset-btn {
    flex: 1 1 28%;
    min-height: 44px;
    min-width: 56px;
    font-size: 0.8rem;
    padding: 8px 4px;
  }

  body.on-table-tab.mobile-immersive.hero-turn .action-btns-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  body.on-table-tab.mobile-immersive.hero-turn .action-btns-grid .btn {
    min-height: 52px;
    font-size: 0.95rem;
    padding: 10px 6px;
    line-height: 1.15;
    font-weight: 800;
    border-radius: 10px;
  }

  body.on-table-tab.mobile-immersive .auto-speed-control {
    flex: 1;
    max-width: none;
  }

  body.on-table-tab.mobile-immersive .showdown-overlay.showdown-toast {
    bottom: calc(var(--play-toolbar-h) + var(--safe-bottom) + 8px);
    top: auto;
    left: 50%;
    transform: translateX(-50%);
  }

  /* Override smartphone fixed heights when immersive is active */
  body.on-table-tab.mobile-immersive .table-layout.pokerok-layout {
    min-height: 0;
  }

  body:not(.on-table-tab) main {
    padding-bottom: calc(var(--mobile-nav-h) + var(--safe-bottom) + 12px);
  }

  body:not(.on-table-tab) .tab-content {
    padding: 8px 10px 16px;
  }
}
