/* ===== FONTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700;900&family=Inter:wght@400;500;600&display=swap');

/* ===== VARIABLES ===== */
:root {
  --felt-green: #1a6b3a;
  --felt-mid: #165f33;
  --felt-dark: #114d29;
  --felt-line: rgba(255,255,255,0.08);
  --table-wood: #5c2e0a;
  --table-wood-dark: #3d1e07;
  --card-white: #f8f4e8;
  --card-back: #c0392b;
  --card-back-pattern: #991f1f;
  --chip-green: #27ae60;
  --chip-blue: #2471a3;
  --chip-red: #c0392b;
  --chip-purple: #7d3c98;
  --chip-white: #bdc3c7;
  --gold: #d4af37;
  --gold-bright: #f5c518;
  --dark-bg: #0a0e14;
  --darker-bg: #060a0f;
  --panel-bg: rgba(0,0,0,0.6);
  --text-light: #f0ece0;
  --text-muted: #a0998a;
  --text-gold: #d4af37;
  --btn-fold: #922b21;
  --btn-fold-h: #c0392b;
  --btn-check: #1e6b3e;
  --btn-check-h: #27ae60;
  --btn-call: #1a4f7a;
  --btn-call-h: #2471a3;
  --btn-raise: #7e5109;
  --btn-raise-h: #d4ac0d;
  --btn-allin: #4a235a;
  --btn-allin-h: #7d3c98;
  --font-serif: 'Playfair Display', 'Georgia', serif;
  --font-sans: 'Inter', 'Helvetica Neue', sans-serif;
  --radius: 8px;
  --card-w: 60px;
  --card-h: 84px;
  --transition: 0.3s ease;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; }
body {
  background: var(--dark-bg);
  color: var(--text-light);
  font-family: var(--font-sans);
  overflow: hidden;
  user-select: none;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--darker-bg); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }

/* ============================
   LOBBY / INDEX PAGE
   ============================ */
.lobby-page {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, #1a1a2e 0%, var(--darker-bg) 70%);
  overflow: auto;
}

.lobby-logo {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 0 30px rgba(212,175,55,0.5), 0 2px 8px rgba(0,0,0,0.8);
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
  text-align: center;
}

.lobby-subtitle {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 3rem;
  text-align: center;
}

.lobby-suits {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 3rem;
  font-size: 1.5rem;
}
.lobby-suits span:nth-child(1),
.lobby-suits span:nth-child(4) { color: #cc3333; }
.lobby-suits span:nth-child(2),
.lobby-suits span:nth-child(3) { color: #e8e0d0; }

.lobby-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(212,175,55,0.2);
  border-radius: 16px;
  padding: 2rem 2.5rem;
  width: min(420px, 92vw);
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.lobby-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.lobby-tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  letter-spacing: 0.05em;
}
.lobby-tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}
.lobby-tab:hover:not(.active) { color: var(--text-light); }

.tab-pane { display: none; }
.tab-pane.active { display: block; }

.form-group {
  margin-bottom: 1rem;
}
.form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}
.form-group input {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  color: var(--text-light);
  font-family: var(--font-sans);
  font-size: 1rem;
  padding: 0.7rem 1rem;
  outline: none;
  transition: border-color var(--transition);
}
.form-group input:focus { border-color: var(--gold); }
.form-group input::placeholder { color: rgba(255,255,255,0.25); }

.form-divider {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 1.25rem 0;
  position: relative;
}
.form-divider::before,
.form-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: rgba(255,255,255,0.1);
}
.form-divider::before { left: 0; }
.form-divider::after { right: 0; }

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #b8960c, var(--gold));
  border: none;
  border-radius: var(--radius);
  color: #1a1200;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  padding: 0.85rem 1rem;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: all var(--transition);
  text-transform: uppercase;
  margin-top: 0.5rem;
  box-shadow: 0 4px 15px rgba(212,175,55,0.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--gold), #e8c84a);
  box-shadow: 0 6px 20px rgba(212,175,55,0.5);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  width: 100%;
  background: transparent;
  border: 1px solid rgba(212,175,55,0.4);
  border-radius: var(--radius);
  color: var(--gold);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.75rem 1rem;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: all var(--transition);
  text-transform: uppercase;
  margin-top: 0.5rem;
}
.btn-secondary:hover {
  background: rgba(212,175,55,0.1);
  border-color: var(--gold);
}

.game-code-display {
  text-align: center;
  margin: 1.5rem 0;
}
.game-code-value {
  font-family: var(--font-serif);
  font-size: 3rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.2em;
  text-shadow: 0 0 20px rgba(212,175,55,0.4);
}
.game-code-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 0.25rem;
}

.waiting-players {
  margin-top: 1rem;
}
.waiting-players h4 {
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.player-slot {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.player-slot-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gold);
  border: 1px solid rgba(212,175,55,0.3);
}
.player-slot-name { font-size: 0.9rem; }
.player-slot-status { margin-left: auto; font-size: 0.75rem; color: var(--chip-green); }
.player-slot.empty .player-slot-name { color: var(--text-muted); font-style: italic; }
.player-slot.empty .player-slot-status { color: var(--text-muted); }

.form-error {
  color: #e74c3c;
  font-size: 0.82rem;
  margin-top: 0.5rem;
  display: none;
}
.form-error.visible { display: block; }

/* ============================
   GAME PAGE WRAPPER
   ============================ */
.game-page {
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse at center, #16202e 0%, var(--darker-bg) 70%);
}

/* ============================
   INTRO OVERLAY
   ============================ */
.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease;
}
.intro-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}
.intro-video-wrap {
  position: relative;
  width: min(720px, 90vw);
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 60px rgba(212,175,55,0.3);
  border: 1px solid rgba(212,175,55,0.2);
}
.intro-video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.intro-video-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, #1a1a2e 0%, #000 70%);
  gap: 1rem;
  position: absolute;
  top: 0; left: 0;
  z-index: 0;
}
#intro-video {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.dealer-animation {
  position: relative;
  width: 120px;
  height: 120px;
}
.dealer-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(ellipse, #2c2c2c, #1a1a1a);
  border: 3px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  animation: dealerPulse 2s ease-in-out infinite;
}
@keyframes dealerPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(212,175,55,0.3); }
  50% { box-shadow: 0 0 40px rgba(212,175,55,0.6); }
}
.intro-title {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--gold);
  text-align: center;
  text-shadow: 0 0 20px rgba(212,175,55,0.5);
}
.intro-message {
  color: var(--text-muted);
  font-size: 1.1rem;
  text-align: center;
  max-width: 400px;
  line-height: 1.5;
}
.intro-cards-anim {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}
.intro-card {
  width: 50px;
  height: 70px;
  background: linear-gradient(135deg, var(--card-back), var(--card-back-pattern));
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.2);
  animation: cardFloat 3s ease-in-out infinite;
  box-shadow: 2px 3px 8px rgba(0,0,0,0.5);
}
.intro-card:nth-child(2) { animation-delay: 0.3s; }
.intro-card:nth-child(3) { animation-delay: 0.6s; }
.intro-card:nth-child(4) { animation-delay: 0.9s; }
.intro-card:nth-child(5) { animation-delay: 1.2s; }
@keyframes cardFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.deal-btn {
  display: none;
  background: linear-gradient(135deg, #b8960c, var(--gold));
  border: none;
  border-radius: 50px;
  color: #1a1200;
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  padding: 1rem 3rem;
  cursor: pointer;
  letter-spacing: 0.1em;
  margin-top: 1.5rem;
  box-shadow: 0 8px 30px rgba(212,175,55,0.4);
  transition: all 0.3s ease;
  animation: dealBtnPulse 1.5s ease-in-out infinite;
}
.deal-btn.visible { display: block; }
.deal-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 40px rgba(212,175,55,0.6);
}
@keyframes dealBtnPulse {
  0%, 100% { box-shadow: 0 8px 30px rgba(212,175,55,0.4); }
  50% { box-shadow: 0 8px 50px rgba(212,175,55,0.7); }
}

/* ============================
   HUD / TOP BAR
   ============================ */
.game-hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1.5rem;
  background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
}
.hud-level {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold);
}
.hud-blinds {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}
.hud-center {
  text-align: center;
}
.hud-logo {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.05em;
}
.hud-timer-wrap {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.15rem;
}
.hud-timer {
  color: var(--text-light);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.hud-blind-progress {
  width: 100px;
  height: 3px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
  margin: 0.25rem auto 0;
  overflow: hidden;
}
.hud-blind-bar {
  height: 100%;
  background: var(--gold);
  border-radius: 2px;
  transition: width 1s linear;
}
.hud-right {
  text-align: right;
}
.hud-hand {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.hud-players {
  font-size: 0.85rem;
  color: var(--text-light);
}

/* ============================
   POKER TABLE
   ============================ */
.table-container {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 20px 160px;
}

.table {
  position: relative;
  width: min(880px, calc(100vw - 40px));
  aspect-ratio: 1.9;
  max-height: calc(100vh - 280px);
}

.table-felt {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 45%, var(--felt-mid) 0%, var(--felt-green) 50%, var(--felt-dark) 100%);
  border: 12px solid var(--table-wood);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.05),
    inset 0 0 40px rgba(0,0,0,0.4),
    0 0 0 4px var(--table-wood-dark),
    0 20px 60px rgba(0,0,0,0.7),
    0 0 0 5px var(--table-wood);
}

.table-felt::before {
  content: '';
  position: absolute;
  inset: 16px;
  border-radius: 50%;
  border: 1px solid var(--felt-line);
}

.table-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  z-index: 5;
}

/* ============================
   COMMUNITY CARDS
   ============================ */
.community-cards {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
}
.community-card-slot {
  width: var(--card-w);
  height: var(--card-h);
  border-radius: 5px;
  border: 1px dashed rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.2);
  position: relative;
}
.community-card-slot .card { position: absolute; inset: 0; }

/* ============================
   POT DISPLAY
   ============================ */
.pot-display {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(212,175,55,0.3);
  border-radius: 20px;
  padding: 0.3rem 1rem;
}
.pot-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.pot-amount {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.side-pots {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}
.side-pot {
  font-size: 0.72rem;
  color: var(--text-muted);
  background: rgba(0,0,0,0.4);
  border-radius: 10px;
  padding: 0.1rem 0.5rem;
}

/* ============================
   CARDS
   ============================ */
.card {
  width: var(--card-w);
  height: var(--card-h);
  border-radius: 5px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.4s ease;
  cursor: default;
  flex-shrink: 0;
}
.card.face-down { transform: rotateY(180deg); }
.card-face,
.card-back {
  position: absolute;
  inset: 0;
  border-radius: 5px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.card-face {
  background: var(--card-white);
  border: 1px solid #d0c8b8;
  display: flex;
  flex-direction: column;
  padding: 3px 4px;
  box-shadow: 2px 3px 8px rgba(0,0,0,0.4);
}
.card-back {
  background: repeating-linear-gradient(
    45deg,
    var(--card-back) 0px,
    var(--card-back) 4px,
    var(--card-back-pattern) 4px,
    var(--card-back-pattern) 8px
  );
  border: 1px solid rgba(255,255,255,0.15);
  transform: rotateY(180deg);
  box-shadow: 2px 3px 8px rgba(0,0,0,0.4);
}
.card-back::after {
  content: '';
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 3px;
}
.card-rank {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
}
.card-suit-corner {
  font-size: 0.75rem;
  line-height: 1;
}
.card-center-suit {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}
.card-corner-bl {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  transform: rotate(180deg);
}
.card.red .card-rank,
.card.red .card-suit-corner,
.card.red .card-center-suit { color: #cc2222; }
.card.black .card-rank,
.card.black .card-suit-corner,
.card.black .card-center-suit { color: #1a1a1a; }

.card.dealing {
  animation: dealCard 0.35s ease-out;
}
@keyframes dealCard {
  from { transform: translateY(-80px) scale(0.8) rotateY(90deg); opacity: 0; }
  to { transform: translateY(0) scale(1) rotateY(0deg); opacity: 1; }
}
.card.face-down.dealing {
  animation: dealCardDown 0.35s ease-out;
}
@keyframes dealCardDown {
  from { transform: translateY(-80px) scale(0.8) rotateY(90deg); opacity: 0; }
  to { transform: translateY(0) scale(1) rotateY(180deg); opacity: 1; }
}
.card.reveal {
  animation: flipCard 0.5s ease-in-out;
}
@keyframes flipCard {
  0% { transform: rotateY(180deg); }
  100% { transform: rotateY(0deg); }
}

/* ============================
   PLAYER SEATS
   ============================ */
.seat {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  z-index: 6;
  transition: all var(--transition);
}

/* 8-seat positions around oval */
.seat[data-seat="0"] { left: 50%; top: 92%; }
.seat[data-seat="1"] { left: 79%; top: 80%; }
.seat[data-seat="2"] { left: 96%; top: 50%; }
.seat[data-seat="3"] { left: 79%; top: 20%; }
.seat[data-seat="4"] { left: 50%; top: 8%; }
.seat[data-seat="5"] { left: 21%; top: 20%; }
.seat[data-seat="6"] { left: 4%; top: 50%; }
.seat[data-seat="7"] { left: 21%; top: 80%; }

.seat-info {
  background: rgba(0,0,0,0.75);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 4px 8px;
  min-width: 90px;
  text-align: center;
  backdrop-filter: blur(4px);
}
.seat.active .seat-info {
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(212,175,55,0.4);
}
.seat.hero .seat-info {
  border-color: rgba(255,255,255,0.25);
}
.seat.folded .seat-info { opacity: 0.45; }
.seat.eliminated .seat-info { opacity: 0.25; }
.seat.all-in .seat-info { border-color: var(--chip-purple); }

.seat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.2);
  overflow: hidden;
  margin: 0 auto 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 600;
  color: var(--gold);
  position: relative;
}
.seat.active .seat-avatar { border-color: var(--gold); }
.seat.all-in .seat-avatar { border-color: var(--chip-purple); }

.seat-name {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
}
.seat.ai .seat-name { color: var(--text-muted); }

.seat-stack {
  font-size: 0.7rem;
  color: var(--gold);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.seat-status {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 1px 5px;
  border-radius: 3px;
  display: none;
}
.seat.folded .seat-status { display: block; color: #999; }
.seat.all-in .seat-status { display: block; color: var(--chip-purple); }
.seat.eliminated .seat-status { display: block; color: #666; }

.seat-hole-cards {
  display: flex;
  gap: 3px;
  justify-content: center;
  margin-top: 2px;
}
.seat-hole-cards .card {
  --card-w: 38px;
  --card-h: 54px;
  width: 38px;
  height: 54px;
}
.seat[data-seat="0"] .seat-hole-cards .card {
  --card-w: 52px;
  --card-h: 74px;
  width: 52px;
  height: 74px;
}

.seat-bet {
  position: absolute;
  font-family: var(--font-serif);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--gold);
  background: rgba(0,0,0,0.7);
  border: 1px solid rgba(212,175,55,0.4);
  border-radius: 10px;
  padding: 2px 6px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 7;
}
/* Bet chip positions relative to seat */
.seat[data-seat="0"] .seat-bet { top: -30px; }
.seat[data-seat="1"] .seat-bet { top: -30px; left: -20px; }
.seat[data-seat="2"] .seat-bet { left: -60px; }
.seat[data-seat="3"] .seat-bet { bottom: -30px; left: -20px; }
.seat[data-seat="4"] .seat-bet { bottom: -30px; }
.seat[data-seat="5"] .seat-bet { bottom: -30px; right: -20px; }
.seat[data-seat="6"] .seat-bet { right: -60px; }
.seat[data-seat="7"] .seat-bet { top: -30px; right: -20px; }

/* ============================
   DEALER BUTTON
   ============================ */
.dealer-btn {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle, #f5f5f0, #ddd);
  border: 2px solid #999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 900;
  color: #333;
  z-index: 8;
  transition: all 0.5s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  pointer-events: none;
}

/* Dealer button positions per seat */
.dealer-btn[data-near="0"] { left: calc(50% - 40px); top: calc(92% - 55px); transform: translate(-50%, -50%); }
.dealer-btn[data-near="1"] { left: calc(79% - 50px); top: calc(80% - 45px); transform: translate(-50%, -50%); }
.dealer-btn[data-near="2"] { left: calc(96% - 65px); top: calc(50% - 20px); transform: translate(-50%, -50%); }
.dealer-btn[data-near="3"] { left: calc(79% - 50px); top: calc(20% + 45px); transform: translate(-50%, -50%); }
.dealer-btn[data-near="4"] { left: calc(50% + 40px); top: calc(8% + 55px); transform: translate(-50%, -50%); }
.dealer-btn[data-near="5"] { left: calc(21% + 50px); top: calc(20% + 45px); transform: translate(-50%, -50%); }
.dealer-btn[data-near="6"] { left: calc(4% + 65px); top: calc(50% - 20px); transform: translate(-50%, -50%); }
.dealer-btn[data-near="7"] { left: calc(21% + 50px); top: calc(80% - 45px); transform: translate(-50%, -50%); }

/* ============================
   ACTION TIMER
   ============================ */
.action-timer {
  position: absolute;
  bottom: -8px;
  left: 4px;
  right: 4px;
  height: 3px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
  display: none;
}
.seat.active .action-timer { display: block; }
.action-timer-bar {
  height: 100%;
  background: var(--gold);
  border-radius: 2px;
  transition: width 1s linear, background 0.5s;
}
.action-timer-bar.warning { background: #e67e22; }
.action-timer-bar.danger { background: #e74c3c; }

/* ============================
   ACTION PANEL
   ============================ */
.action-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  padding: 0.75rem 1rem 1rem;
  background: linear-gradient(to top, rgba(0,0,0,0.95) 60%, transparent);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.action-panel.hidden { display: none; }

.action-buttons {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.action-btn {
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.7rem 1.4rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  min-width: 90px;
}
.action-btn:hover { transform: translateY(-2px); }
.action-btn:active { transform: translateY(0); }
.action-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-fold {
  background: var(--btn-fold);
  color: #ffcccc;
  border: 1px solid rgba(192,57,43,0.5);
}
.btn-fold:hover { background: var(--btn-fold-h); box-shadow: 0 4px 15px rgba(192,57,43,0.4); }

.btn-check {
  background: var(--btn-check);
  color: #ccffdd;
  border: 1px solid rgba(39,174,96,0.5);
}
.btn-check:hover { background: var(--btn-check-h); box-shadow: 0 4px 15px rgba(39,174,96,0.4); }

.btn-call {
  background: var(--btn-call);
  color: #cce0ff;
  border: 1px solid rgba(36,113,163,0.5);
}
.btn-call:hover { background: var(--btn-call-h); box-shadow: 0 4px 15px rgba(36,113,163,0.4); }

.btn-raise {
  background: var(--btn-raise);
  color: #fff0cc;
  border: 1px solid rgba(126,81,9,0.5);
}
.btn-raise:hover { background: var(--btn-raise-h); box-shadow: 0 4px 15px rgba(212,172,13,0.4); }

.btn-allin {
  background: var(--btn-allin);
  color: #f0ccff;
  border: 1px solid rgba(125,60,152,0.5);
}
.btn-allin:hover { background: var(--btn-allin-h); box-shadow: 0 4px 15px rgba(125,60,152,0.5); }

.raise-controls {
  display: none;
  align-items: center;
  gap: 0.75rem;
  max-width: 500px;
  margin: 0 auto;
  width: 100%;
}
.raise-controls.visible { display: flex; }
.raise-slider {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  outline: none;
}
.raise-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gold);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(212,175,55,0.5);
}
.raise-amount {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
  min-width: 80px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.raise-presets {
  display: flex;
  gap: 0.35rem;
}
.raise-preset {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 5px;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.3rem 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
}
.raise-preset:hover {
  background: rgba(212,175,55,0.15);
  border-color: var(--gold);
  color: var(--gold);
}

.action-info {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  min-height: 1rem;
}
.action-info strong { color: var(--text-light); }

/* ============================
   CHIP STACKS
   ============================ */
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 0.5rem;
  font-weight: 700;
  border: 2px solid rgba(255,255,255,0.3);
  box-shadow: 0 2px 4px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.2);
  position: relative;
}
.chip.green { background: var(--chip-green); color: #fff; }
.chip.blue { background: var(--chip-blue); color: #fff; }
.chip.red { background: var(--chip-red); color: #fff; }
.chip.purple { background: var(--chip-purple); color: #fff; }
.chip.white { background: var(--chip-white); color: #333; }
.chip-stack {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 60px;
}

/* ============================
   WINNER OVERLAY
   ============================ */
.winner-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}
.winner-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}
.winner-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.winner-title {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 0 40px rgba(212,175,55,0.7);
  text-align: center;
  animation: winnerPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes winnerPop {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.winner-name {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  color: #fff;
  text-align: center;
}
.winner-amount {
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 3vw, 2rem);
  color: var(--gold);
  text-align: center;
}
.winner-hand {
  font-size: 1rem;
  color: var(--text-muted);
  text-align: center;
  font-style: italic;
}
.winner-cards {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}
.winner-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}
.winner-actions button {
  padding: 0.75rem 2rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

/* Split offer overlay */
.split-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(0,0,0,0.8);
  display: none;
  align-items: center;
  justify-content: center;
}
.split-overlay.visible { display: flex; }
.split-card {
  background: rgba(20,20,30,0.95);
  border: 1px solid rgba(212,175,55,0.4);
  border-radius: 16px;
  padding: 2.5rem;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.split-card h2 {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  color: var(--gold);
  margin-bottom: 0.75rem;
}
.split-card p { color: var(--text-muted); margin-bottom: 1.5rem; }
.split-card .split-amounts {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}
.split-amount {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 0.75rem 1.25rem;
}
.split-amount .name { font-size: 0.8rem; color: var(--text-muted); }
.split-amount .chips {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: var(--gold);
  font-weight: 700;
}
.split-btns { display: flex; gap: 0.75rem; justify-content: center; }

/* ============================
   TOASTS / NOTIFICATIONS
   ============================ */
.toast-container {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
.toast {
  background: rgba(20,20,30,0.95);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 0.6rem 1.2rem;
  font-size: 0.85rem;
  color: var(--text-light);
  text-align: center;
  animation: toastIn 0.3s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  white-space: nowrap;
}
.toast.gold { border-color: rgba(212,175,55,0.5); color: var(--gold); }
.toast.red { border-color: rgba(192,57,43,0.5); color: #ff8888; }
@keyframes toastIn {
  from { transform: translateY(-10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes toastOut {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(-10px); opacity: 0; }
}

/* ============================
   ACTION INDICATOR
   ============================ */
.action-indicator {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(212,175,55,0.9);
  color: #1a1200;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 9;
  display: none;
}
.seat.active .action-indicator { display: block; }

/* ============================
   GAME LOG (SIDE PANEL)
   ============================ */
.game-log {
  position: fixed;
  right: 0;
  top: 60px;
  bottom: 0;
  width: 220px;
  background: rgba(0,0,0,0.7);
  border-left: 1px solid rgba(255,255,255,0.05);
  padding: 1rem 0.75rem;
  overflow-y: auto;
  font-size: 0.72rem;
  color: var(--text-muted);
  display: none;
  z-index: 5;
}
.game-log-entry {
  padding: 0.3rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  line-height: 1.4;
}
.game-log-entry .actor { color: var(--text-light); font-weight: 600; }
.game-log-entry .action-fold { color: #ff6b6b; }
.game-log-entry .action-raise { color: var(--gold); }
.game-log-entry .action-call { color: #74b9ff; }

/* ============================
   LOADING STATE
   ============================ */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: var(--darker-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  transition: opacity 0.5s ease;
}
.loading-overlay.hidden { opacity: 0; pointer-events: none; }
.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(212,175,55,0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--text-muted);
}

/* ============================
   CONFETTI PIECES
   ============================ */
.confetti-piece {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 1px;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  0% { transform: translateY(-10px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* ============================
   HAND STRENGTH INDICATOR
   ============================ */
.hand-strength {
  position: absolute;
  bottom: 160px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.7);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 0.4rem 1rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  z-index: 15;
  pointer-events: none;
  transition: opacity 0.3s;
}
.hand-strength .name {
  color: var(--gold);
  font-weight: 600;
  font-size: 0.85rem;
}

/* ============================
   MOBILE (375px – 480px portrait)
   ============================ */
@media (max-width: 480px) {
  :root {
    --card-w: 38px;
    --card-h: 53px;
  }

  /* Taller oval suits portrait screens */
  .table-container {
    padding: 56px 20px 118px;
  }
  .table {
    aspect-ratio: 1.3;
    max-height: calc(100vh - 200px);
  }

  /* 8 seats on a tighter oval.
     Side seats at 14%/86% so a 60px info box clears the viewport edge
     with ~37px to spare on a 375px screen (vs ~10px at the old 7%/93%). */
  .seat[data-seat="0"] { left: 50%; top: 94%; }
  .seat[data-seat="1"] { left: 80%; top: 81%; }
  .seat[data-seat="2"] { left: 86%; top: 50%; }
  .seat[data-seat="3"] { left: 80%; top: 19%; }
  .seat[data-seat="4"] { left: 50%; top:  6%; }
  .seat[data-seat="5"] { left: 20%; top: 19%; }
  .seat[data-seat="6"] { left: 14%; top: 50%; }
  .seat[data-seat="7"] { left: 20%; top: 81%; }

  /* Dealer button positions updated to match new seat layout */
  .dealer-btn[data-near="0"] { left: calc(50% - 40px); top: calc(94% - 55px); transform: translate(-50%,-50%); }
  .dealer-btn[data-near="1"] { left: calc(80% - 50px); top: calc(81% - 45px); transform: translate(-50%,-50%); }
  .dealer-btn[data-near="2"] { left: calc(86% - 65px); top: calc(50% - 20px); transform: translate(-50%,-50%); }
  .dealer-btn[data-near="3"] { left: calc(80% - 50px); top: calc(19% + 45px); transform: translate(-50%,-50%); }
  .dealer-btn[data-near="4"] { left: calc(50% + 40px); top: calc( 6% + 55px); transform: translate(-50%,-50%); }
  .dealer-btn[data-near="5"] { left: calc(20% + 50px); top: calc(19% + 45px); transform: translate(-50%,-50%); }
  .dealer-btn[data-near="6"] { left: calc(14% + 65px); top: calc(50% - 20px); transform: translate(-50%,-50%); }
  .dealer-btn[data-near="7"] { left: calc(20% + 50px); top: calc(81% - 45px); transform: translate(-50%,-50%); }

  /* Seat info — compact but legible */
  .seat-info {
    min-width: 60px;
    padding: 3px 5px;
  }
  .seat-avatar {
    width: 26px;
    height: 26px;
    font-size: 0.75rem;
  }
  .seat-name {
    font-size: 0.65rem;
    max-width: 52px;
  }
  .seat-stack { font-size: 0.65rem; }

  /* Hole cards */
  .seat-hole-cards .card { width: 24px; height: 34px; }
  .seat[data-seat="0"] .seat-hole-cards .card { width: 38px; height: 53px; }

  /* Community cards */
  .community-cards { gap: 4px; }
  .community-card-slot { width: 38px; height: 53px; }

  /* Pot */
  .pot-display { padding: 0.2rem 0.7rem; }
  .pot-amount  { font-size: 0.88rem; }
  .pot-label   { font-size: 0.62rem; }

  /* HUD */
  .game-hud       { padding: 0.35rem 0.75rem; }
  .hud-level      { font-size: 0.9rem; }
  .hud-blinds     { font-size: 0.75rem; }
  .hud-logo       { font-size: 1rem; }
  .hud-timer-wrap { font-size: 0.72rem; }
  .hud-hand       { font-size: 0.72rem; }
  .hud-players    { font-size: 0.8rem; }

  /* Action panel */
  .action-panel {
    padding: 0.55rem 0.75rem 0.85rem;
    gap: 0.5rem;
  }

  /* Action buttons — 48px minimum touch target */
  .action-buttons { gap: 0.4rem; }
  .action-btn {
    font-size: 0.9rem;
    font-weight: 700;
    padding: 0.85rem 1rem;
    min-width: 74px;
    min-height: 48px;
    border-radius: 10px;
  }

  /* Raise controls */
  .raise-controls { gap: 0.5rem; }
  .raise-amount   { font-size: 1rem; min-width: 68px; }
  .raise-slider::-webkit-slider-thumb { width: 22px; height: 22px; }
  .raise-preset {
    padding: 0.35rem 0.5rem;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
  }

  /* Action info label */
  .action-info { font-size: 0.76rem; }

  /* Hand strength — above action panel */
  .hand-strength { bottom: 128px; font-size: 0.76rem; }
}

/* Blind legend */
.hud-blinds {
  display: flex;
  align-items: center;
  gap: 6px;
}
.blind-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sb-dot { background: #3b82f6; }
.bb-dot { background: #ef4444; }

/* Tap to Enter */
.tap-to-enter {
  position: fixed;
  inset: 0;
  background: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.tap-to-enter.hidden { display: none; }
.tap-to-enter-inner {
  text-align: center;
}
.tap-logo {
  font-size: 2rem;
  font-weight: bold;
  color: #c9a84c;
  margin-bottom: 2rem;
  letter-spacing: 2px;
}
.tap-btn {
  background: #c9a84c;
  color: #0a0a0a;
  border: none;
  padding: 1.2rem 3rem;
  font-size: 1.3rem;
  font-weight: bold;
  border-radius: 50px;
  cursor: pointer;
  letter-spacing: 1px;
}
.tap-btn:active { opacity: 0.8; }

/* Mobile viewport fix — account for browser chrome (address bar, nav bar) */
@media (max-width: 600px) {
  .game-page {
    height: 100dvh;
    height: -webkit-fill-available;
  }
  .action-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding-bottom: max(0.85rem, env(safe-area-inset-bottom));
  }
  .table-container {
    padding-bottom: 160px !important;
  }
}
