:root {
  --bg-dark: #0b0f19;
  --bg-gradient: radial-gradient(circle at 50% 40%, #172338 0%, #080c14 100%);
  --felt-gradient: radial-gradient(ellipse at center, #1c6d48 0%, #115737 60%, #093721 100%);
  --felt-border-color: rgba(245, 176, 65, 0.28);
  --table-border: #4a2e18;
  --table-rail: #2b1708;
  --gold-accent: #f5b041;
  --gold-glow: rgba(245, 176, 65, 0.5);
  --gold-gradient: linear-gradient(135deg, #ffd700 0%, #f5b041 50%, #d48e15 100%);
  --card-width: 58px;
  --card-height: 84px;
  --card-radius: 6px;
  --text-light: #f3f4f6;
  --text-muted: #9ca3af;
  --chip-gold: #ffd700;
  --color-danger: #ef4444;
  --color-success: #10b981;
  --color-blind: #8b5cf6;
  --color-seen: #059669;
}

/* ==================== Table Felt Themes ==================== */
body[data-felt-theme="classic-green"] {
  --felt-gradient: radial-gradient(ellipse at center, #1c6d48 0%, #115737 60%, #093721 100%);
  --felt-border-color: rgba(245, 176, 65, 0.28);
}

body[data-felt-theme="gold-vip"] {
  --felt-gradient: radial-gradient(ellipse at center, #2e2613 0%, #1c170a 60%, #0d0a04 100%);
  --felt-border-color: rgba(255, 215, 0, 0.5);
}

body[data-felt-theme="ruby-red"] {
  --felt-gradient: radial-gradient(ellipse at center, #781414 0%, #500a0a 60%, #2e0404 100%);
  --felt-border-color: rgba(255, 190, 100, 0.35);
}

body[data-felt-theme="sapphire-blue"] {
  --felt-gradient: radial-gradient(ellipse at center, #1e3a8a 0%, #172554 60%, #0f172a 100%);
  --felt-border-color: rgba(96, 165, 250, 0.35);
}

@media (min-width: 768px) {
  :root {
    --card-width: 68px;
    --card-height: 98px;
    --card-radius: 8px;
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-dark);
  background-image: var(--bg-gradient);
  color: var(--text-light);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.game-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  position: relative;
}

/* ==================== Top Header Bar ==================== */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(11, 15, 25, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-icon {
  color: var(--gold-accent);
  font-size: 1.3rem;
}

.brand-title {
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 2px;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.game-status-pill {
  font-size: 0.8rem;
  font-weight: 600;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.07);
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.2s;
}

.tutorial-btn {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.4);
}
.tutorial-btn:hover {
  background: rgba(59, 130, 246, 0.25);
  border-color: #60a5fa;
  transform: translateY(-1px);
}

.bonus-btn {
  background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
  color: #fff;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.4);
  animation: pulseGift 2s infinite ease-in-out;
}

@keyframes pulseGift {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); box-shadow: 0 0 15px rgba(139, 92, 246, 0.8); }
}

.cosmetics-btn {
  background: rgba(245, 176, 65, 0.15);
  color: var(--gold-accent);
  border-color: var(--gold-accent);
}

.icon-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-light);
  font-size: 0.95rem;
  padding: 5px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

/* ==================== Table Arena ==================== */
.table-arena {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  position: relative;
  overflow: hidden;
}

/* Circular/Oval Poker Table */
.poker-table {
  width: 100%;
  height: 100%;
  max-height: 720px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.table-rail {
  width: 100%;
  height: 100%;
  border-radius: 180px;
  background: linear-gradient(145deg, #3d2312 0%, #1f1107 100%);
  padding: 12px;
  box-shadow: 
    0 15px 35px rgba(0, 0, 0, 0.8),
    inset 0 3px 6px rgba(255, 255, 255, 0.2),
    inset 0 -5px 12px rgba(0, 0, 0, 0.9);
  position: relative;
  display: flex;
}

@media (max-width: 600px) {
  .table-rail {
    border-radius: 110px;
    padding: 7px;
  }
}

.table-felt {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--felt-gradient);
  position: relative;
  box-shadow: 
    inset 0 0 45px rgba(0, 0, 0, 0.65),
    inset 0 0 10px rgba(0, 0, 0, 0.8);
  border: 2px solid var(--felt-border-color);
  transition: background 0.4s ease, border-color 0.4s ease;
}

/* Inner Table Betting Line */
.table-felt::before {
  content: '';
  position: absolute;
  top: 14%;
  bottom: 14%;
  left: 10%;
  right: 10%;
  border: 1.5px dashed var(--felt-border-color);
  border-radius: 120px;
  pointer-events: none;
}

/* ==================== Center Area (Deck & Pot) ==================== */
.center-area {
  position: absolute;
  top: 48%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  z-index: 10;
  pointer-events: none;
}

/* Deck Pile */
.deck-area {
  position: relative;
  width: var(--card-width);
  height: var(--card-height);
  transform: scale(0.8);
  margin-bottom: 2px;
}

.card-deck-stack {
  position: relative;
  width: 100%;
  height: 100%;
}

.deck-card {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: var(--card-radius);
  border: 2px solid #ffd700;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.6);
}

.deck-card.layer-3 { top: -4px; left: -2px; transform: rotate(-3deg); }
.deck-card.layer-2 { top: -2px; left: 1px; transform: rotate(1deg); }
.deck-card.layer-1 { top: 0; left: 0; }

/* Pot Display */
.pot-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(10, 20, 15, 0.88);
  border: 1.5px solid var(--gold-accent);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6), 0 0 15px var(--gold-glow);
  padding: 5px 16px;
  border-radius: 20px;
  backdrop-filter: blur(6px);
  min-width: 140px;
  text-align: center;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pot-chips-visual {
  font-size: 1.1rem;
  margin-bottom: -4px;
}

.pot-label {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--gold-accent);
  text-transform: uppercase;
}

.pot-amount {
  font-family: 'Cinzel', serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.pot-meta-badges {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}

.meta-badge {
  font-size: 0.65rem;
  font-weight: 700;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 6px;
  border-radius: 8px;
}

/* ==================== Player Seats ==================== */
.player-seat {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 12;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.player-seat.is-packed {
  opacity: 0.45;
  filter: grayscale(0.85);
}

.seat-top { top: 3%; left: 50%; transform: translateX(-50%); }
.seat-left { top: 42%; left: 3%; transform: translateY(-50%); }
.seat-right { top: 42%; right: 3%; transform: translateY(-50%); }
.seat-bottom { bottom: 2%; left: 50%; transform: translateX(-50%); }

.seat-badge-row {
  display: flex;
  gap: 4px;
  margin-bottom: -6px;
  z-index: 4;
}

.seat-badge {
  font-size: 0.58rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 8px;
  letter-spacing: 0.5px;
}

.bot-badge { background: #2563eb; color: #fff; }
.user-badge { background: var(--gold-gradient); color: #111; }

.play-mode-badge {
  font-size: 0.58rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 8px;
  letter-spacing: 0.5px;
  background: var(--color-blind);
  color: #fff;
  transition: background 0.3s;
}

.play-mode-badge.is-seen { background: var(--color-seen); }
.play-mode-badge.is-packed { background: #475569; }

.avatar-ring {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #1e293b;
  border: 2.5px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  position: relative;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}

.current-user-seat .avatar-ring {
  width: 52px;
  height: 52px;
  border-color: rgba(245, 176, 65, 0.6);
}

.avatar-ring.turn-active {
  border-color: #ffd700;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.9), inset 0 0 10px rgba(255, 215, 0, 0.5);
  transform: scale(1.08);
}

.avatar-ring.turn-active .turn-pulsar {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3px solid #ffd700;
  animation: turnPulse 1.2s infinite ease-out;
  pointer-events: none;
}

@keyframes turnPulse {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}

.avatar-emoji { font-size: 1.5rem; }
.current-user-seat .avatar-emoji { font-size: 1.65rem; }

.player-info {
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 2px 8px;
  margin-top: -4px;
  text-align: center;
  min-width: 82px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.player-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: #cbd5e1;
}

.current-user-seat .player-name { color: var(--gold-accent); }

.player-chips {
  font-size: 0.75rem;
  font-weight: 800;
  color: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.chip-icon { font-size: 0.7rem; }

.action-bubble {
  position: absolute;
  top: -18px;
  background: #1e293b;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 12px;
  border: 1px solid var(--gold-accent);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
  opacity: 0;
  transform: translateY(4px) scale(0.9);
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
  z-index: 25;
}

.action-bubble.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.action-bubble.packed { background: #ef4444; border-color: #fca5a5; }
.action-bubble.chaal { background: #059669; border-color: #6ee7b7; }
.action-bubble.show-call { background: #d97706; border-color: #fde68a; }

/* ==================== Cards & Themes ==================== */
.player-hand-container {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
  min-height: calc(var(--card-height) + 4px);
  position: relative;
  perspective: 1000px;
}

.player-hand-container .playing-card:nth-child(1) { transform: rotate(-7deg) translateX(8px); z-index: 1; }
.player-hand-container .playing-card:nth-child(2) { transform: rotate(0deg) translateY(-2px); z-index: 2; }
.player-hand-container .playing-card:nth-child(3) { transform: rotate(7deg) translateX(-8px); z-index: 3; }

.player-hand-container.is-winner-hand .playing-card {
  box-shadow: 0 0 15px #ffd700, 0 4px 10px rgba(0, 0, 0, 0.8) !important;
  border-color: #ffd700 !important;
}

.playing-card {
  width: var(--card-width);
  height: var(--card-height);
  border-radius: var(--card-radius);
  position: relative;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
  flex-shrink: 0;
}

.card-front, .card-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--card-radius);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 4px;
  transition: opacity 0.25s ease;
}

/* Card Back Styles by Theme */
body[data-card-theme="crimson-royal"] .card-back,
body[data-card-theme="crimson-royal"] .deck-card,
.card-bg-crimson {
  background: #8b0000;
  background-image: radial-gradient(#b91c1c 20%, transparent 20%), radial-gradient(#5a0808 20%, transparent 20%);
  background-size: 8px 8px;
  background-position: 0 0, 4px 4px;
  border: 2px solid #ffd700;
}

body[data-card-theme="obsidian-gold"] .card-back,
body[data-card-theme="obsidian-gold"] .deck-card,
.card-bg-obsidian {
  background: #18181b;
  background-image: radial-gradient(#3f3f46 20%, transparent 20%), radial-gradient(#09090b 20%, transparent 20%);
  background-size: 8px 8px;
  background-position: 0 0, 4px 4px;
  border: 2px solid #eab308;
}

body[data-card-theme="sapphire-dragon"] .card-back,
body[data-card-theme="sapphire-dragon"] .deck-card,
.card-bg-sapphire {
  background: #1e3a8a;
  background-image: radial-gradient(#3b82f6 20%, transparent 20%), radial-gradient(#172554 20%, transparent 20%);
  background-size: 8px 8px;
  background-position: 0 0, 4px 4px;
  border: 2px solid #93c5fd;
}

body[data-card-theme="emerald-luxury"] .card-back,
body[data-card-theme="emerald-luxury"] .deck-card,
.card-bg-emerald {
  background: #064e3b;
  background-image: radial-gradient(#059669 20%, transparent 20%), radial-gradient(#022c22 20%, transparent 20%);
  background-size: 8px 8px;
  background-position: 0 0, 4px 4px;
  border: 2px solid #34d399;
}

.card-back {
  transform: rotateY(0deg);
  -webkit-transform: rotateY(0deg);
  z-index: 2;
  opacity: 1;
}

.card-back-pattern {
  width: 70%;
  height: 75%;
  border: 1px solid rgba(255, 215, 0, 0.6);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-back-emblem {
  font-size: 0.9rem;
  color: #ffd700;
  opacity: 0.9;
}

.card-front {
  background: #ffffff;
  color: #1a1a1a;
  transform: rotateY(180deg);
  -webkit-transform: rotateY(180deg);
  border: 1px solid #d1d5db;
  z-index: 1;
}

.playing-card.is-flipped .card-back {
  opacity: 0;
  pointer-events: none;
}

.playing-card.is-flipped .card-front {
  opacity: 1;
  z-index: 5;
}

.card-front.suit-hearts, .card-front.suit-diamonds { color: #dc2626; }
.card-front.suit-spades, .card-front.suit-clubs { color: #111827; }

.card-corner { display: flex; flex-direction: column; align-items: center; line-height: 0.9; }
.card-corner.top-left { align-self: flex-start; }
.card-corner.bottom-right { align-self: flex-end; transform: rotate(180deg); }

.corner-rank { font-size: 0.75rem; font-weight: 800; }
.corner-suit { font-size: 0.65rem; }
.card-center-suit {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.4rem;
}

.player-hand-container .playing-card.is-flipped:nth-child(1) { transform: rotateY(180deg) rotate(-7deg) translateX(8px); }
.player-hand-container .playing-card.is-flipped:nth-child(2) { transform: rotateY(180deg) rotate(0deg) translateY(-2px); }
.player-hand-container .playing-card.is-flipped:nth-child(3) { transform: rotateY(180deg) rotate(7deg) translateX(-8px); }

@keyframes dealSlideIn {
  0% { opacity: 0; transform: translate(var(--deal-from-x, 0px), var(--deal-from-y, 0px)) scale(0.4) rotate(45deg); }
  100% { opacity: 1; transform: translate(0, 0) scale(1) rotate(var(--final-rot, 0deg)); }
}

.playing-card.dealing { animation: dealSlideIn 0.4s cubic-bezier(0.25, 1, 0.5, 1); }

.hand-evaluation-pill {
  position: absolute;
  bottom: -22px;
  background: var(--gold-gradient);
  color: #0b0f19;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
  display: none;
  z-index: 15;
}

/* ==================== Controls Panel & Footer ==================== */
.controls-panel {
  padding: 10px 14px 12px;
  background: rgba(11, 15, 25, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 30;
}

.controls-wrapper {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 540px;
  justify-content: center;
  align-items: center;
}

.footer-copyright {
  font-size: 0.7rem;
  font-weight: 500;
  color: #64748b;
  letter-spacing: 0.8px;
  text-align: center;
  opacity: 0.85;
}

.btn {
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn:active:not(:disabled) { transform: translateY(1px) scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; filter: grayscale(0.7); }

.btn-deal {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
  flex: 1;
  font-size: 0.95rem;
  padding: 12px 24px;
}
.btn-deal:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6); }

.btn-pack { background: #dc2626; color: #ffffff; flex: 0.8; }
.btn-pack:hover:not(:disabled) { background: #b91c1c; }

.btn-see { background: #6366f1; color: #ffffff; flex: 0.9; }
.btn-see:hover:not(:disabled) { background: #4f46e5; }

.btn-multiplier {
  background: rgba(255, 255, 255, 0.1);
  color: var(--gold-accent);
  border: 1.5px solid var(--gold-accent);
  min-width: 44px;
  padding: 10px 8px;
}
.btn-multiplier.active { background: var(--gold-gradient); color: #111; box-shadow: 0 0 10px var(--gold-glow); }

.btn-chaal {
  background: linear-gradient(135deg, #10b981 0%, #047857 100%);
  color: #ffffff;
  box-shadow: 0 3px 12px rgba(16, 185, 129, 0.4);
  flex: 1.3;
}

.btn-show {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  box-shadow: 0 3px 12px rgba(245, 158, 11, 0.4);
  flex: 1;
}

.btn-ad-claim {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
  font-weight: 800;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 8px;
}

/* ==================== Generic Modals ==================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  border-radius: 20px;
  padding: 24px;
  text-align: center;
  max-width: 420px;
  width: 90%;
  position: relative;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.6rem;
  cursor: pointer;
}
.modal-close-btn:hover { color: #fff; }

.modal-header-icon {
  font-size: 2.8rem;
  margin-bottom: 8px;
}

.modal-title {
  font-family: 'Cinzel', serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: #f8fafc;
  margin-bottom: 6px;
}

.modal-desc {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 16px;
  line-height: 1.4;
}

/* ==================== Tutorial / How to Play Modal ==================== */
.tutorial-modal {
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  text-align: left;
}

.tutorial-sections-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tutorial-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px 14px;
}

.tutorial-card-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--gold-accent);
  margin-bottom: 8px;
}

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ranking-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
}

.rank-num {
  background: rgba(245, 176, 65, 0.2);
  color: var(--gold-accent);
  font-weight: 800;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  flex-shrink: 0;
}

.rank-name {
  font-weight: 700;
  color: #f1f5f9;
  min-width: 100px;
}

.rank-desc {
  color: #94a3b8;
  font-size: 0.72rem;
}

.tutorial-text {
  font-size: 0.8rem;
  color: #cbd5e1;
  line-height: 1.5;
}

.tutorial-text code {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--gold-accent);
  font-family: monospace;
}

/* Bankrupt Modal */
.urgent-modal {
  border-color: var(--color-danger);
  box-shadow: 0 0 35px rgba(239, 68, 68, 0.4);
}

.text-danger { color: #f87171; }
.text-success { color: #34d399; }

.reward-highlight-badge {
  background: rgba(245, 176, 65, 0.15);
  border: 1.5px dashed var(--gold-accent);
  padding: 10px 16px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}

.reward-amount {
  font-family: 'Cinzel', serif;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--gold-accent);
}

.modal-actions-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Retention Bonus Cards */
.bonus-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

.bonus-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.bonus-card.highlighted-card {
  background: rgba(245, 176, 65, 0.08);
  border-color: rgba(245, 176, 65, 0.4);
}

.bonus-card-icon { font-size: 1.8rem; }
.bonus-card-info { flex: 1; }
.bonus-card-title { font-size: 0.85rem; font-weight: 700; color: #f1f5f9; }
.bonus-card-reward { font-size: 0.95rem; font-weight: 800; color: var(--gold-accent); }
.bonus-timer { font-size: 0.72rem; color: #94a3b8; margin-top: 1px; }

/* Cosmetics & Themes Modal */
.cosmetic-section {
  margin-bottom: 18px;
  text-align: left;
}

.cosmetic-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--gold-accent);
  margin-bottom: 8px;
  display: block;
}

.theme-options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.theme-option-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: #cbd5e1;
  transition: all 0.2s;
}

.theme-option-card:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

.theme-option-card.active {
  border-color: var(--gold-accent);
  background: rgba(245, 176, 65, 0.12);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 0 10px var(--gold-glow);
}

.theme-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
}

.swatch-green { background: #0f5132; }
.swatch-gold { background: #2e2613; border-color: #ffd700; }
.swatch-ruby { background: #781414; }
.swatch-sapphire { background: #1e3a8a; }

.card-preview-mini {
  width: 20px;
  height: 28px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: #ffd700;
  flex-shrink: 0;
}

.theme-name { font-size: 0.75rem; }

/* Mock Rewarded Video Ad Overlay */
.ad-player-box {
  background: #090d16;
  border: 2px solid var(--gold-accent);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.9), 0 0 25px var(--gold-glow);
  border-radius: 18px;
  padding: 24px;
  width: 90%;
  max-width: 380px;
  text-align: center;
}

.ad-badge {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--gold-accent);
  letter-spacing: 1.5px;
  margin-bottom: 12px;
}

.ad-video-mock {
  background: #111827;
  border-radius: 12px;
  padding: 24px 16px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.ad-anim-spinner {
  font-size: 2.5rem;
  animation: spinAd 2s infinite linear;
}

@keyframes spinAd {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.ad-brand-name {
  font-family: 'Cinzel', serif;
  font-size: 1.2rem;
  font-weight: 900;
  color: #ffd700;
}

.ad-tagline {
  font-size: 0.78rem;
  color: #9ca3af;
}

.ad-timer-pill {
  background: rgba(0, 0, 0, 0.6);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #38bdf8;
  margin-top: 6px;
}

.ad-progress-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.ad-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--gold-gradient);
  transition: width 3s linear;
}

/* Winner Overlay */
.winner-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.winner-overlay.active { opacity: 1; pointer-events: auto; }

.winner-modal {
  background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
  border: 2px solid var(--gold-accent);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px var(--gold-glow);
  border-radius: 20px;
  padding: 24px 30px;
  text-align: center;
  max-width: 380px;
  width: 90%;
  transform: scale(0.85);
  transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.winner-overlay.active .winner-modal { transform: scale(1); }
.winner-trophy { font-size: 3rem; margin-bottom: 6px; }

.winner-title {
  font-family: 'Cinzel', serif;
  font-size: 1.6rem;
  font-weight: 800;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}

.winner-hand-desc { font-size: 0.95rem; color: #cbd5e1; margin-bottom: 12px; }
.winner-pot-claimed {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--color-success);
  margin-bottom: 20px;
  background: rgba(16, 185, 129, 0.15);
  padding: 6px 14px;
  border-radius: 12px;
  display: inline-block;
}

.btn-next-round { width: 100%; }

/* Floating Chip Animation */
@keyframes chipFly {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--target-x), var(--target-y)) scale(0.6); }
}

.flying-chip {
  position: fixed;
  font-size: 1.2rem;
  pointer-events: none;
  z-index: 120;
  animation: chipFly 0.55s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .brand-title { display: none; }
  .table-arena { padding: 4px; }
  .seat-left { left: 2%; }
  .seat-right { right: 2%; }
  .avatar-ring { width: 42px; height: 42px; }
  .current-user-seat .avatar-ring { width: 48px; height: 48px; }
  .player-info { min-width: 70px; padding: 2px 6px; }
  .player-name { font-size: 0.65rem; }
  .player-chips { font-size: 0.68rem; }
  .pot-display { min-width: 110px; padding: 3px 10px; }
  .pot-amount { font-size: 1.1rem; }
  .controls-wrapper { gap: 5px; }
  .btn { font-size: 0.78rem; padding: 8px 10px; }
  .bonus-label, .cosmetics-label, .nav-label { font-size: 0.7rem; }
}
