/**
 * poker-table.css - Natural8 / GGPoker Style 2D Orbital Poker Table Layout
 * Matches user's reference image: 6 seats distributed cleanly around the oval felt.
 */

.table-screen {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: radial-gradient(circle at 50% 50%, #0e1726 0%, #050811 100%);
  padding-top: env(safe-area-inset-top, 0px);
}

/* ========================================================
   TABLE TOPBAR
   ======================================================== */
.table-topbar {
  height: 52px;
  background: rgba(10, 15, 26, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 30;
  flex-shrink: 0;
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-topbar {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-topbar:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.28);
}

.btn-rebuy {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  border: none;
}

.btn-share {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: #fff;
  border: none;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.btn-share:hover {
  background: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%);
}

/* Quick Chat Popover */
.quick-chat-popover {
  position: absolute;
  top: 58px;
  right: 60px;
  width: 270px;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  z-index: 60;
  padding: 12px;
}

.chat-pop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.quick-emojis-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.btn-emoji-quick {
  font-size: 1.3rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-emoji-quick:hover {
  background: rgba(245, 158, 11, 0.25);
  transform: scale(1.15);
}

.quick-texts-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.btn-text-quick {
  text-align: left;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  font-size: 0.76rem;
  font-weight: 600;
}

.btn-text-quick:hover {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.table-info-badge {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.table-name {
  font-weight: 700;
  font-size: 0.92rem;
}

.table-blinds {
  font-size: 0.74rem;
  color: var(--gold-primary);
}

/* ========================================================
   2D POKER TABLE VIEWPORT & WRAPPER
   ======================================================== */
.table-viewport {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px calc(var(--controls-h, 115px) + 6px) 8px;
  overflow: hidden;
}

/* Scaled Container Managed by TableUI.fitTable() */
.table-fit {
  position: relative;
  flex-shrink: 0;
}

/* Fixed-ratio Wrapper: Scaled uniformly inside .table-fit */
.poker-table-wrapper {
  position: relative;
  width: 960px;
  height: 500px;
  transform-origin: top left;
}

/* 2D Oval Table Frame (Wood Rail & Leather Bumper) */
.poker-table {
  position: absolute;
  top: 45px;
  bottom: 45px;
  left: 55px;
  right: 55px;
  border-radius: 205px;
  background: #14532d;
  box-shadow: 
    0 0 0 16px #2b1810, 
    0 0 0 20px #451a03, 
    0 25px 65px rgba(0, 0, 0, 0.95), 
    0 0 40px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}

/* Wood Rail & Leather Edge */
.table-rail {
  position: absolute;
  inset: -14px;
  border-radius: 219px;
  border: 3px solid #78350f;
  box-shadow: inset 0 4px 10px rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

/* Green Felt Surface */
.table-felt {
  position: absolute;
  inset: 0;
  border-radius: 205px;
  background: radial-gradient(ellipse at center, #15803d 0%, #166534 50%, #0f3e20 85%, #052412 100%);
  border: 2px solid rgba(245, 158, 11, 0.35);
  overflow: visible;
}

/* Inner Felt Stitch Ring */
.felt-inner-ring {
  position: absolute;
  inset: 28px;
  border-radius: 177px;
  border: 1px dashed rgba(245, 158, 11, 0.25);
  pointer-events: none;
}

/* Felt Watermark */
.felt-watermark {
  position: absolute;
  top: 24%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0.12;
  pointer-events: none;
}

.logo-title {
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: 4px;
  color: #fff;
}

.logo-sub {
  font-size: 0.72rem;
  letter-spacing: 2px;
  font-weight: 700;
  color: var(--gold-primary);
}

/* ========================================================
   CENTRAL COMMUNITY BOARD & POT (DEAD CENTER)
   ======================================================== */
.community-board {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 10;
  pointer-events: auto;
}

/* 5 Community Card Slots */
.board-slots {
  display: flex;
  gap: 8px;
  background: rgba(0, 0, 0, 0.38);
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(245, 158, 11, 0.25);
  box-shadow: inset 0 3px 10px rgba(0, 0, 0, 0.6);
}

.card-slot {
  width: 62px;
  height: 88px;
  border-radius: 6px;
  border: 1.5px dashed rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.slot-placeholder {
  font-size: 0.62rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.25);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.card-slot.card-enter {
  animation: cardDealFlip 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cardDealFlip {
  0% { transform: scale(0.3) rotate(-15deg); opacity: 0; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* Center Pot Display (Matching reference image with chips trio) */
.center-pot-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.center-pot-pill {
  background: rgba(10, 15, 26, 0.9);
  border: 1.5px solid var(--gold-primary);
  border-radius: var(--radius-full);
  padding: 3px 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.4), inset 0 0 8px rgba(245, 158, 11, 0.15);
}

.pot-chips-trio {
  display: flex;
  align-items: center;
  margin-right: 2px;
}

.mini-chip {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  margin-right: -4px;
}

.mini-chip.mc-gold { background: #fbbf24; z-index: 3; }
.mini-chip.mc-green { background: #10b981; z-index: 2; }
.mini-chip.mc-red { background: #ef4444; z-index: 1; }

.center-pot-label {
  font-size: 0.7rem;
  font-weight: 800;
  color: #fde68a;
  letter-spacing: 1.5px;
}

.center-pot-amount {
  font-size: 1.25rem;
  font-weight: 900;
  color: #fbbf24;
  text-shadow: 0 0 10px rgba(245, 158, 11, 0.6);
  line-height: 1.1;
}

.center-side-pot-info {
  font-size: 0.68rem;
  color: #a7f3d0;
  font-weight: 600;
}

/* Stage Tag Indicator */
.board-stage-tag {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #67e8f9;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 2px 12px;
  border-radius: var(--radius-full);
}

/* ========================================================
   2D CARD GRAPHICS
   ======================================================== */
.poker-card {
  width: 62px;
  height: 88px;
  border-radius: 6px;
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3px;
  position: relative;
  border: 1px solid #cbd5e1;
  font-family: 'Arial Black', Impact, sans-serif;
  user-select: none;
}

.card-front.suit-red { color: #dc2626; }
.card-front.suit-black { color: #0f172a; }

.card-corner {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.card-rank {
  font-size: 0.88rem;
  font-weight: 900;
}

.card-suit-mini {
  font-size: 0.7rem;
}

.card-corner.bottom-right {
  transform: rotate(180deg);
}

.card-center-suit {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.45rem;
  line-height: 1;
}

/* Card Back Pattern */
.poker-card.card-back {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e1b4b 100%);
  border: 2px solid #fff;
  padding: 3px;
}

.card-back-pattern {
  width: 100%;
  height: 100%;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.1) 0, rgba(255, 255, 255, 0.1) 4px, transparent 0, transparent 8px);
}

/* ========================================================
   11 & 6 SEATS LAYER ORBITAL POSITIONS
   ======================================================== */
.seats-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 20;
}

.player-seat {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: auto;
  transform: translate(-50%, -50%);
  transition: all 0.2s ease;
}

/* 11 Seats Orbital Distribution (Mathematically Balanced) */
.seat-pos-0 { left: 480px; top: 455px; }
.seat-pos-1 { left: 250px; top: 430px; }
.seat-pos-2 { left: 95px; top: 340px; }
.seat-pos-3 { left: 60px; top: 220px; }
.seat-pos-4 { left: 155px; top: 115px; }
.seat-pos-5 { left: 355px; top: 50px; }
.seat-pos-6 { left: 605px; top: 50px; }
.seat-pos-7 { left: 805px; top: 115px; }
.seat-pos-8 { left: 900px; top: 220px; }
.seat-pos-9 { left: 865px; top: 340px; }
.seat-pos-10 { left: 710px; top: 430px; }

/* 6-Max Override When Table Is In 6-Seat Mode */
.seats-count-6 .seat-pos-0 { left: 50%; top: 450px; }
.seats-count-6 .seat-pos-1 { left: 70px; top: 375px; }
.seats-count-6 .seat-pos-2 { left: 110px; top: 115px; }
.seats-count-6 .seat-pos-3 { left: 50%; top: 45px; }
.seats-count-6 .seat-pos-4 { left: 850px; top: 115px; }
.seats-count-6 .seat-pos-5 { left: 890px; top: 375px; }

/* 11-Max Compact Styling to Prevent Overcrowding */
.table-11-max .avatar-wrapper { width: 48px; height: 48px; }
.table-11-max .player-avatar-circle { width: 44px; height: 44px; }
.table-11-max .avatar-emoji { font-size: 1.55rem; }
.table-11-max .player-details { min-width: 82px; max-width: 98px; padding: 1px 6px; }
.table-11-max .player-name { font-size: 0.68rem; }
.table-11-max .player-chips { font-size: 0.72rem; }
.table-11-max .turn-timer-ring { width: 58px; height: 58px; top: -5px; left: -5px; }
.table-11-max .seat-cards-fan .poker-card { width: 42px; height: 60px; font-size: 0.72rem; }
.table-11-max .seat-cards-fan .card-tilt-1 { margin-left: -18px; }
.table-11-max .seat-pos-0 .seat-cards-fan .poker-card { width: 50px; height: 70px; font-size: 0.8rem; }

/* Fan Hold Cards Tilted Above Avatar (Like KK and QQ in Reference Image) */
.seat-cards-fan {
  display: flex;
  margin-bottom: -18px;
  z-index: 5;
}

.seat-cards-fan .poker-card {
  width: 48px;
  height: 68px;
  font-size: 0.78rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
}

.seat-cards-fan .card-tilt-0 {
  transform: rotate(-7deg);
}

.seat-cards-fan .card-tilt-1 {
  transform: rotate(7deg);
  margin-left: -22px;
}

/* Hero Cards (Seat 0): Slightly larger for easy viewing */
.seat-pos-0 .seat-cards-fan .poker-card {
  width: 56px;
  height: 78px;
  font-size: 0.85rem;
}

.seat-pos-0 .seat-cards-fan .card-tilt-1 {
  margin-left: -24px;
}

/* Seat Avatar Circle & Timer Ring */
.avatar-wrapper {
  position: relative;
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.turn-timer-ring {
  position: absolute;
  width: 70px;
  height: 70px;
  top: -6px;
  left: -6px;
  transform: rotate(-90deg);
  pointer-events: none;
}

.turn-timer-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 4;
}

.turn-timer-ring-circle {
  fill: none;
  stroke: var(--gold-primary);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 238.76;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.8s linear, stroke 0.3s;
}

.turn-timer-ring-circle.urgent {
  stroke: #ef4444;
}

.player-avatar-circle {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.95);
  border: 2px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.6);
  transition: border-color 0.25s, box-shadow 0.25s;
}

.avatar-emoji {
  font-size: 1.9rem;
}

.player-seat.is-turn .player-avatar-circle {
  border-color: var(--gold-primary);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.8);
  animation: pulseTurn 1.5s infinite;
}

@keyframes pulseTurn {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.player-seat.is-folded {
  opacity: 0.38;
  filter: grayscale(85%);
}

.player-seat.is-allin .player-avatar-circle {
  border-color: #ef4444;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.7);
}

/* Digital Countdown Badge on Active Seat */
.seat-countdown-badge {
  position: absolute;
  top: -12px;
  right: -8px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #0f172a;
  font-size: 0.72rem;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  z-index: 28;
}

.seat-countdown-badge.urgent {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  color: #fff;
  animation: pulseUrgent 0.6s infinite alternate;
}

@keyframes pulseUrgent {
  0% { transform: scale(1); box-shadow: 0 0 8px rgba(239, 68, 68, 0.6); }
  100% { transform: scale(1.15); box-shadow: 0 0 16px rgba(239, 68, 68, 1); }
}

/* Player Meta Badges (Name Pill + Chip Balance) */
.player-details {
  background: rgba(10, 15, 26, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 2px 8px;
  margin-top: 3px;
  text-align: center;
  min-width: 95px;
  max-width: 120px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

.player-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.player-chips-badge {
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-chips {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--gold-primary);
}

/* Role Badges (D, SB, BB) */
.seat-badge {
  position: absolute;
  top: -4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 900;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  z-index: 10;
}

.badge-dealer {
  background: #ffffff;
  color: #0f172a;
  border: 2px solid #0f172a;
}

.badge-sb {
  background: #3b82f6;
  color: #fff;
}

.badge-bb {
  background: #ef4444;
  color: #fff;
}

/* Action Speech Bubble */
.action-bubble {
  position: absolute;
  top: -26px;
  background: #fbbf24;
  color: #0f172a;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  z-index: 25;
}

.animate-pop {
  animation: popBubble 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popBubble {
  0% { transform: scale(0.4); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Hand Result Badge at Showdown */
.hand-result-badge {
  background: rgba(16, 185, 129, 0.95);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  margin-top: 3px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

/* Bet Chips Positioning (Facing Center Pot) */
.seat-bet-container {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(10, 15, 26, 0.9);
  border: 1px solid var(--gold-primary);
  padding: 2px 7px;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
  z-index: 25;
}

.seat-bet-amount {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--gold-primary);
}

/* Bet Chips Positioning Facing Center Pot (Seats 0..10) */
.seat-pos-0 .seat-bet-container { top: -36px; left: 50%; transform: translateX(-50%); }
.seat-pos-1 .seat-bet-container { top: -30px; right: -30px; }
.seat-pos-2 .seat-bet-container { top: -15px; right: -50px; }
.seat-pos-3 .seat-bet-container { top: 15px; right: -55px; }
.seat-pos-4 .seat-bet-container { bottom: -25px; right: -40px; }
.seat-pos-5 .seat-bet-container { bottom: -36px; left: 50%; transform: translateX(-50%); }
.seat-pos-6 .seat-bet-container { bottom: -36px; left: 50%; transform: translateX(-50%); }
.seat-pos-7 .seat-bet-container { bottom: -25px; left: -40px; }
.seat-pos-8 .seat-bet-container { top: 15px; left: -55px; }
.seat-pos-9 .seat-bet-container { top: -15px; left: -50px; }
.seat-pos-10 .seat-bet-container { top: -30px; left: -30px; }

/* Host / Owner Badges & Controls */
.host-badge {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #0f172a;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.seat-manage-btn {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  font-size: 0.68rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 25;
  transition: transform 0.2s, background-color 0.2s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.seat-manage-btn:hover {
  background: #dc2626;
  transform: scale(1.2);
}

/* Player Info / Kick Popover */
.player-info-popover {
  position: absolute;
  z-index: 70;
  background: rgba(15, 23, 42, 0.97);
  backdrop-filter: blur(14px);
  border: 1.5px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.85);
  min-width: 240px;
  color: #fff;
}

.popover-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.popover-header h4 {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--gold-primary);
}

.popover-user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.popover-avatar {
  font-size: 2.2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.popover-user-meta {
  display: flex;
  flex-direction: column;
}

.popover-name {
  font-size: 0.92rem;
  font-weight: 800;
}

.popover-chips {
  font-size: 0.8rem;
  color: var(--gold-primary);
  font-weight: 700;
}

.popover-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 12px;
  background: rgba(0, 0, 0, 0.3);
  padding: 8px;
  border-radius: 6px;
  font-size: 0.74rem;
}

.popover-stat-item {
  display: flex;
  flex-direction: column;
}

.popover-stat-label { color: var(--text-dim); }
.popover-stat-val { font-weight: 700; color: #cbd5e1; }

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

.btn-kick-player {
  flex: 1;
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
}

.btn-kick-player:hover {
  background: #dc2626;
  transform: translateY(-1px);
}

/* Hand History Modal */
.hand-history-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.hand-history-card {
  width: 780px;
  max-width: 95vw;
  max-height: 85vh;
  background: rgba(15, 23, 42, 0.98);
  border: 1.5px solid var(--border-gold);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
}

.hand-history-header {
  padding: 16px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hand-history-header h3 {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--gold-primary);
}

.hand-history-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.history-hand-item {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 14px;
}

.history-hand-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.history-hand-num {
  font-weight: 800;
  color: var(--gold-primary);
  font-size: 0.9rem;
}

.history-hand-time {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.history-hand-pot {
  font-size: 0.82rem;
  font-weight: 800;
  color: #34d399;
}

.history-board-cards {
  display: flex;
  gap: 6px;
  align-items: center;
  margin: 8px 0;
}

.history-board-cards .poker-card {
  width: 38px;
  height: 54px;
  font-size: 0.7rem;
}

.history-winners-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

.history-winner-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
}

.history-winner-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-winning-cards {
  display: flex;
  gap: 4px;
}

.history-winning-cards .poker-card {
  width: 32px;
  height: 46px;
  font-size: 0.65rem;
}

.history-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* Showdown Enhanced Results Display */
.showdown-time-badge {
  font-size: 0.76rem;
  color: #cbd5e1;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 6px;
}

.winning-cards-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.winning-cards-title {
  font-size: 0.74rem;
  color: #fbbf24;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.winning-cards-row {
  display: flex;
  gap: 6px;
}

.winning-cards-row .poker-card {
  width: 48px;
  height: 68px;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.7);
  border: 1.5px solid #fbbf24;
}

/* Empty Seat Placeholder */
.empty-seat {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
}

.empty-icon { font-size: 1.1rem; }
.empty-label { font-size: 0.58rem; }

/* ========================================================
   BOTTOM ACTION BAR & PLAYER TURN COUNTDOWN BANNER
   ======================================================== */
.table-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(10, 15, 26, 0.96);
  backdrop-filter: blur(14px);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 8px 24px;
  z-index: 40;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.table-controls.controls-disabled {
  opacity: 0.65;
}

/* Player Turn Countdown Banner */
.player-turn-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.2) 0%, rgba(15, 23, 42, 0.85) 100%);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-sm);
  padding: 5px 16px;
  margin-bottom: 6px;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.player-turn-banner.urgent {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.3) 0%, rgba(15, 23, 42, 0.9) 100%);
  border-color: #ef4444;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.turn-banner-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.turn-pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold-primary);
  box-shadow: 0 0 8px var(--gold-primary);
  animation: pulseDot 1s infinite alternate;
}

.player-turn-banner.urgent .turn-pulse-dot {
  background: #ef4444;
  box-shadow: 0 0 10px #ef4444;
}

@keyframes pulseDot {
  0% { opacity: 0.4; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1.2); }
}

.turn-banner-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
}

.turn-timer-clock-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.timer-countdown-text {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--gold-primary);
  min-width: 38px;
  text-align: right;
}

.player-turn-banner.urgent .timer-countdown-text {
  color: #ef4444;
}

.timer-bar-track {
  width: 120px;
  height: 7px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.timer-bar-progress {
  height: 100%;
  background: var(--gold-primary);
  transition: width 0.9s linear, background-color 0.3s;
  border-radius: var(--radius-full);
}

.player-turn-banner.urgent .timer-bar-progress {
  background: #ef4444;
}

.controls-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Auto Actions Checkboxes */
.auto-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.auto-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
}

.auto-label input {
  accent-color: var(--gold-primary);
}

/* Raise Controls & Slider */
.raise-controls {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  max-width: 380px;
}

.raise-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.raise-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.raise-val-badge {
  background: rgba(245, 158, 11, 0.15);
  color: var(--gold-primary);
  border: 1px solid var(--border-gold);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 800;
  min-width: 60px;
  text-align: center;
}

.raise-slider {
  flex: 1;
  accent-color: var(--gold-primary);
  cursor: pointer;
}

.raise-presets {
  display: flex;
  gap: 6px;
}

.btn-preset {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 3px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 700;
}

.btn-preset:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Primary Action Buttons */
.action-buttons-group {
  display: flex;
  gap: 10px;
}

.btn-action {
  width: 115px;
  height: 52px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.2s ease;
}

.btn-action:hover:not(:disabled) {
  transform: translateY(-2px);
}

.btn-action:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.action-hotkey {
  position: absolute;
  top: 3px;
  left: 6px;
  font-size: 0.62rem;
  opacity: 0.6;
}

.action-title {
  font-size: 0.95rem;
  font-weight: 900;
  line-height: 1.1;
}

.action-sub {
  font-size: 0.7rem;
  font-weight: 600;
  opacity: 0.9;
}

.btn-fold {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.btn-call {
  background: linear-gradient(135deg, #10b981 0%, #047857 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-raise {
  background: var(--gold-gradient);
  color: #0f172a;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

/* Real-time Hand Strength Helper */
.user-hand-helper {
  position: absolute;
  bottom: 74px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid var(--border-gold);
  backdrop-filter: blur(8px);
  padding: 5px 16px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: #fde68a;
  z-index: 35;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* ========================================================
   ACTION LOG DRAWER
   ======================================================== */
.action-log-drawer {
  position: absolute;
  top: 0;
  right: -340px;
  width: 320px;
  height: calc(100% - 65px);
  background: rgba(10, 15, 26, 0.95);
  backdrop-filter: blur(14px);
  border-left: 1px solid var(--border-color);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.7);
  z-index: 50;
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.action-log-drawer.open {
  right: 0;
}

.log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

.log-header h3 {
  font-size: 0.92rem;
  font-weight: 700;
}

.btn-icon {
  background: transparent;
  color: var(--text-muted);
  font-size: 1.1rem;
}

.log-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.78rem;
}

.log-item {
  line-height: 1.4;
  padding: 3px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.log-time {
  color: var(--text-dim);
  font-size: 0.7rem;
  margin-right: 4px;
}

.log-header-text { color: var(--gold-primary); font-weight: 800; }
.log-action-fold { color: #f87171; }
.log-action-check { color: #94a3b8; }
.log-action-call { color: #38bdf8; }
.log-action-raise { color: #fbbf24; font-weight: 700; }
.log-action-allin { color: #ef4444; font-weight: 800; }
.log-street { color: #a7f3d0; font-weight: 700; }
.log-win { color: #34d399; font-weight: 800; }

/* ========================================================
   BIG WINNER BANNER CELEBRATION
   ======================================================== */
.winner-banner {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.banner-content {
  pointer-events: auto;
  background: radial-gradient(circle at 50% 50%, #1e1b4b 0%, #090d16 100%);
  border: 2px solid var(--gold-primary);
  border-radius: var(--radius-lg);
  padding: 28px 36px;
  max-width: min(92vw, 520px);
  text-align: center;
  box-shadow: 0 0 60px rgba(245, 158, 11, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.banner-crown {
  font-size: 3.2rem;
  animation: bounceCrown 1s infinite alternate;
}

@keyframes bounceCrown {
  0% { transform: translateY(0); }
  100% { transform: translateY(-10px); }
}

.banner-content h2 {
  font-size: 1.85rem;
  font-weight: 900;
  color: #fff;
}

.banner-hand {
  font-size: 1.1rem;
  color: #fde68a;
  font-weight: 700;
}

.banner-amount {
  font-size: 2rem;
  font-weight: 900;
  color: var(--gold-primary);
  text-shadow: 0 0 20px rgba(245, 158, 11, 0.6);
}

.animate-banner .banner-content {
  animation: zoomBanner 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes zoomBanner {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* ========================================================
   CONNECTION BADGE, CHAT BUBBLE & SHOWDOWN REVEAL OVERLAY
   ======================================================== */
.conn-badge {
  background: rgba(239, 68, 68, 0.22);
  border: 1px solid rgba(239, 68, 68, 0.6);
  color: #fca5a5;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  align-items: center;
  gap: 4px;
}

.chat-bubble {
  position: absolute;
  top: -46px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.96);
  color: #f8fafc;
  border: 1px solid var(--border-gold);
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.65);
  z-index: 35;
  animation: popBubble 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.showdown-reveal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 17, 0.78);
  backdrop-filter: blur(6px);
  z-index: 58;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  pointer-events: none;
}

.showdown-reveal-panel {
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.96);
  border: 1.5px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  width: min(94vw, 760px);
  max-height: 80dvh;
  overflow-y: auto;
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.showdown-reveal-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--gold-primary);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.showdown-cards-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.showdown-player-slot {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 130px;
}

.showdown-player-slot.is-winner {
  border-color: var(--gold-primary);
  background: rgba(245, 158, 11, 0.12);
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.3);
}

.showdown-player-name {
  font-size: 0.82rem;
  font-weight: 800;
  color: #f8fafc;
}

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

.showdown-hole-cards .poker-card {
  width: 48px;
  height: 68px;
}

.card-flip-reveal {
  animation: cardDealFlip 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.showdown-hand-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: #fde68a;
  text-align: center;
}

.showdown-best5-tag {
  font-size: 0.7rem;
  color: #cbd5e1;
  background: rgba(0, 0, 0, 0.35);
  padding: 3px 8px;
  border-radius: 6px;
  text-align: center;
}

.showdown-countdown-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.showdown-countdown-fill {
  height: 100%;
  width: 0%;
  background: var(--gold-gradient);
  transition: width 0.2s linear;
}

.showdown-countdown-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
}

/* ========================================================
   MOBILE LAYOUTS: PORTRAIT & LANDSCAPE (Driven by TableUI.fitTable)
   ======================================================== */

/* Shared compact mobile rules (portrait + landscape) */
.table-screen[data-layout="portrait"] .table-topbar,
.table-screen[data-layout="landscape"] .table-topbar {
  height: 44px;
  padding: 0 8px;
  gap: 6px;
}

.table-screen[data-layout="portrait"] .topbar-left,
.table-screen[data-layout="landscape"] .topbar-left,
.table-screen[data-layout="portrait"] .topbar-right,
.table-screen[data-layout="landscape"] .topbar-right {
  gap: 4px;
  min-width: 0;
}

.table-screen[data-layout="portrait"] .topbar-left {
  flex: 1;
  overflow: hidden;
}

.table-screen[data-layout="portrait"] .table-info-badge {
  min-width: 0;
  overflow: hidden;
}

.table-screen[data-layout="portrait"] .btn-topbar,
.table-screen[data-layout="landscape"] .btn-topbar {
  padding: 5px 6px;
  min-width: 32px;
  min-height: 34px;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.table-screen[data-layout="portrait"] .btn-topbar .label,
.table-screen[data-layout="landscape"] .btn-topbar .label,
.table-screen[data-layout="portrait"] .action-hotkey,
.table-screen[data-layout="landscape"] .action-hotkey {
  display: none;
}

.table-screen[data-layout="portrait"] .table-name,
.table-screen[data-layout="landscape"] .table-name {
  font-size: 0.74rem;
  max-width: 92px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-screen[data-layout="portrait"] .table-blinds,
.table-screen[data-layout="landscape"] .table-blinds {
  font-size: 0.66rem;
}

.table-screen[data-layout="portrait"] .host-badge,
.table-screen[data-layout="landscape"] .host-badge {
  font-size: 0.64rem;
  padding: 2px 6px;
}

/* Mobile bet chips positioned along vector towards table center (--bx, --by) */
.table-screen[data-layout="portrait"] .seat-bet-container,
.table-screen[data-layout="landscape"] .seat-bet-container {
  top: 50%;
  left: 50%;
  right: auto;
  bottom: auto;
  transform: translate(calc(-50% + var(--bx, 0px)), calc(-50% + var(--by, 0px)));
  font-size: 0.68rem;
  padding: 1px 6px;
}

/* Mobile controls: compact bottom bar with 2-tap slide-up raise drawer */
.table-screen[data-layout="portrait"] .table-controls,
.table-screen[data-layout="landscape"] .table-controls {
  padding: 6px 10px calc(8px + env(safe-area-inset-bottom, 0px)) 10px;
}

.table-screen[data-layout="portrait"] .controls-container,
.table-screen[data-layout="landscape"] .controls-container {
  flex-direction: column;
  gap: 6px;
}

.table-screen[data-layout="portrait"] .auto-actions,
.table-screen[data-layout="landscape"] .auto-actions {
  flex-direction: row;
  justify-content: center;
  gap: 16px;
  width: 100%;
}

.table-screen[data-layout="portrait"] .raise-controls,
.table-screen[data-layout="landscape"] .raise-controls {
  display: none;
  width: 100%;
  max-width: 100%;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--border-gold);
  border-radius: 10px;
  padding: 8px 10px;
}

.table-screen[data-layout="portrait"] .table-controls.raise-open .raise-controls,
.table-screen[data-layout="landscape"] .table-controls.raise-open .raise-controls {
  display: flex;
}

.table-screen[data-layout="portrait"] .btn-preset,
.table-screen[data-layout="landscape"] .btn-preset {
  padding: 7px 4px;
  font-size: 0.76rem;
  min-height: 34px;
}

.table-screen[data-layout="portrait"] .raise-slider,
.table-screen[data-layout="landscape"] .raise-slider {
  height: 28px;
}

.table-screen[data-layout="portrait"] .action-buttons-group,
.table-screen[data-layout="landscape"] .action-buttons-group {
  width: 100%;
  gap: 8px;
}

.table-screen[data-layout="portrait"] .btn-action,
.table-screen[data-layout="landscape"] .btn-action {
  flex: 1;
  width: auto;
  height: 48px;
}

.table-screen[data-layout="portrait"] .action-title,
.table-screen[data-layout="landscape"] .action-title {
  font-size: 0.86rem;
}

.table-screen[data-layout="portrait"] .player-turn-banner,
.table-screen[data-layout="landscape"] .player-turn-banner {
  padding: 4px 10px;
  margin-bottom: 5px;
}

.table-screen[data-layout="portrait"] .turn-banner-title,
.table-screen[data-layout="landscape"] .turn-banner-title {
  font-size: 0.72rem;
}

.table-screen[data-layout="portrait"] .timer-bar-track,
.table-screen[data-layout="landscape"] .timer-bar-track {
  width: 72px;
}

.table-screen[data-layout="portrait"] .user-hand-helper,
.table-screen[data-layout="landscape"] .user-hand-helper {
  bottom: calc(var(--controls-h, 100px) + 6px);
  font-size: 0.72rem;
  padding: 4px 12px;
  max-width: 92vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mobile drawers & popovers */
.table-screen[data-layout="portrait"] .action-log-drawer,
.table-screen[data-layout="landscape"] .action-log-drawer {
  width: min(88vw, 320px);
  height: 100%;
}

.table-screen[data-layout="portrait"] .quick-chat-popover,
.table-screen[data-layout="landscape"] .quick-chat-popover {
  top: 48px;
  right: 8px;
  width: min(90vw, 270px);
}

.table-screen[data-layout="portrait"] .player-info-popover {
  position: fixed;
  left: 50% !important;
  top: auto !important;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: min(92vw, 320px);
}

/* PORTRAIT SPECIFIC (400 x 600 vertical oval felt) */
.table-screen[data-layout="portrait"] .poker-table {
  top: 48px;
  bottom: 52px;
  left: 34px;
  right: 34px;
  border-radius: 165px;
  box-shadow:
    0 0 0 11px #2b1810,
    0 0 0 14px #451a03,
    0 18px 45px rgba(0, 0, 0, 0.9);
}

.table-screen[data-layout="portrait"] .table-rail {
  inset: -10px;
  border-radius: 175px;
}

.table-screen[data-layout="portrait"] .table-felt {
  border-radius: 165px;
}

.table-screen[data-layout="portrait"] .felt-inner-ring {
  inset: 18px;
  border-radius: 147px;
}

.table-screen[data-layout="portrait"] .felt-watermark {
  top: 28%;
}

.table-screen[data-layout="portrait"] .logo-title {
  font-size: 1.15rem;
  letter-spacing: 2px;
}

.table-screen[data-layout="portrait"] .board-slots {
  gap: 4px;
  padding: 5px 6px;
}

.table-screen[data-layout="portrait"] .card-slot,
.table-screen[data-layout="portrait"] .board-slots .poker-card {
  width: 44px;
  height: 62px;
}

.table-screen[data-layout="portrait"] .board-slots .card-rank { font-size: 0.74rem; }
.table-screen[data-layout="portrait"] .board-slots .card-suit-mini { font-size: 0.58rem; }
.table-screen[data-layout="portrait"] .board-slots .card-center-suit { font-size: 1.1rem; }

.table-screen[data-layout="portrait"] .center-pot-pill {
  padding: 2px 12px;
}

.table-screen[data-layout="portrait"] .center-pot-amount {
  font-size: 1rem;
}

.table-screen[data-layout="portrait"] .avatar-wrapper { width: 42px; height: 42px; }
.table-screen[data-layout="portrait"] .player-avatar-circle { width: 38px; height: 38px; }
.table-screen[data-layout="portrait"] .avatar-emoji { font-size: 1.35rem; }
.table-screen[data-layout="portrait"] .turn-timer-ring { width: 50px; height: 50px; top: -4px; left: -4px; }
.table-screen[data-layout="portrait"] .player-details { min-width: 68px; max-width: 84px; padding: 1px 4px; }
.table-screen[data-layout="portrait"] .player-name { font-size: 0.62rem; }
.table-screen[data-layout="portrait"] .player-chips { font-size: 0.66rem; }
.table-screen[data-layout="portrait"] .seat-cards-fan { margin-bottom: -14px; }
.table-screen[data-layout="portrait"] .seat-cards-fan .poker-card { width: 34px; height: 48px; }
.table-screen[data-layout="portrait"] .seat-cards-fan .card-rank { font-size: 0.64rem; }
.table-screen[data-layout="portrait"] .seat-cards-fan .card-center-suit { font-size: 0.9rem; }
.table-screen[data-layout="portrait"] .seat-cards-fan .card-tilt-1 { margin-left: -14px; }
.table-screen[data-layout="portrait"] .seat-user .seat-cards-fan .poker-card { width: 44px; height: 62px; }
.table-screen[data-layout="portrait"] .empty-seat { width: 38px; height: 38px; }
.table-screen[data-layout="portrait"] .empty-label { font-size: 0.5rem; }

/* LANDSCAPE SPECIFIC (800 x 390 wide compact felt with breathing room for top/bottom seats) */
.table-screen[data-layout="landscape"] .poker-table {
  top: 56px;
  bottom: 56px;
  left: 62px;
  right: 62px;
  border-radius: 140px;
}

.table-screen[data-layout="landscape"] .table-rail {
  inset: -10px;
  border-radius: 150px;
}

.table-screen[data-layout="landscape"] .table-felt { border-radius: 140px; }
.table-screen[data-layout="landscape"] .felt-inner-ring { inset: 18px; border-radius: 122px; }
.table-screen[data-layout="landscape"] .card-slot,
.table-screen[data-layout="landscape"] .board-slots .poker-card { width: 48px; height: 68px; }
.table-screen[data-layout="landscape"] .auto-actions { display: none; }
.table-screen[data-layout="landscape"] .btn-action { height: 40px; }
.table-screen[data-layout="landscape"] .user-hand-helper {
  top: 48px;
  bottom: auto;
  left: 10px;
  transform: none;
  max-width: 240px;
}

/* Mobile modal & winner banner tweaks */
@media (max-width: 640px) {
  .banner-content {
    padding: 20px 18px;
  }
  .banner-crown { font-size: 2.3rem; }
  .banner-content h2 { font-size: 1.3rem; }
  .banner-amount { font-size: 1.45rem; }
  .winning-cards-row .poker-card { width: 40px; height: 58px; }
  .hand-history-modal { padding: 8px; }
  .hand-history-card { max-height: 90dvh; }
  .hand-history-header, .hand-history-body { padding: 12px 14px; }
  .history-winner-pill { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ========================================================
   TOURNAMENT HUD, PRE-START PANEL & CHAMPION OVERLAY
   ======================================================== */
.tour-hud-badge {
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.55);
  color: #fde68a;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.tour-waiting-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 48;
  width: min(92vw, 430px);
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(14px);
  border: 1.5px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  text-align: center;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.85), 0 0 28px rgba(245, 158, 11, 0.28);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.tour-waiting-title {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--gold-primary);
  letter-spacing: 0.5px;
}

.tour-waiting-meta {
  font-size: 0.78rem;
  color: #cbd5e1;
  line-height: 1.45;
}

.tour-waiting-count {
  font-size: 0.88rem;
  font-weight: 800;
  color: #34d399;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

.btn-start-tournament {
  background: var(--gold-gradient);
  color: #0f172a;
  font-weight: 900;
  font-size: 0.94rem;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  min-height: 46px;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
}

.btn-start-tournament:disabled {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  box-shadow: none;
  cursor: not-allowed;
}

.tour-waiting-guest-msg {
  font-size: 0.82rem;
  color: #fde68a;
  font-weight: 600;
}

.tournament-end-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 17, 0.86);
  backdrop-filter: blur(10px);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.tournament-end-card {
  width: min(94vw, 460px);
  max-height: 88dvh;
  overflow-y: auto;
  background: radial-gradient(circle at 50% 20%, #1e1b4b 0%, #090d16 100%);
  border: 2px solid var(--gold-primary);
  border-radius: var(--radius-lg);
  padding: 26px 22px;
  text-align: center;
  box-shadow: 0 0 60px rgba(245, 158, 11, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.tour-end-kicker {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: #fde68a;
}

.tour-champion-chips {
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--gold-primary);
}

.tour-end-summary {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.tour-standings-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.tour-standing-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.8rem;
  color: #cbd5e1;
}

.tour-standing-row.is-champ {
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fde68a;
}
