/* styles.css — Omaha Poker */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --felt-green: #1a5c2a;
  --felt-dark: #0d3518;
  --table-border: #8B5E3C;
  --gold: #d4af37;
  --card-white: #f5f5f0;
  --bg-dark: #0a0a14;
  --text-light: #ecf0f1;
  --text-dim: #7f8c8d;
  --red: #e74c3c;
  --blue: #3498db;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-dark);
  color: var(--text-light);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ============ SETUP SCREEN ============ */

.setup-screen {
  max-width: 520px;
  margin: 0 auto;
  padding: 60px 24px;
  text-align: center;
}

.setup-title {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  margin-bottom: 4px;
}

.suit-red { color: var(--red); }
.suit-black { color: var(--text-light); }

.setup-subtitle {
  font-size: 1rem;
  color: var(--text-dim);
  margin-bottom: 40px;
}

.setup-form {
  background: rgba(255,255,255,0.05);
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 24px;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-group input[type="text"] {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  color: var(--text-light);
  font-size: 1.1rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus {
  border-color: var(--gold);
}

.opponent-selector {
  display: flex;
  gap: 8px;
}

.opp-btn {
  flex: 1;
  padding: 12px;
  background: rgba(255,255,255,0.06);
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--text-light);
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.opp-btn:hover { border-color: var(--gold); }

.opp-btn.active {
  background: rgba(212,175,55,0.15);
  border-color: var(--gold);
  color: var(--gold);
}

.ai-preview {
  margin: 20px 0;
  text-align: left;
}

.preview-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.ai-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-left: 3px solid;
  margin-bottom: 6px;
  background: rgba(255,255,255,0.03);
  border-radius: 0 6px 6px 0;
}

.ai-avatar { font-size: 1.3rem; }
.ai-name { font-size: 0.95rem; font-weight: 600; }

.start-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--gold), #c9960c);
  border: none;
  border-radius: 10px;
  color: #1a1a2e;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  letter-spacing: 0.03em;
}

.start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212,175,55,0.35);
}

.setup-rules {
  color: var(--text-dim);
  font-size: 0.85rem;
  line-height: 1.6;
}

.setup-rules p { margin-bottom: 4px; }

/* ============ GAME SCREEN ============ */

.game-screen {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.game-header {
  text-align: center;
  padding: 8px;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  background: rgba(0,0,0,0.4);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  position: relative;
  flex-shrink: 0;
}

.hand-counter {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.8rem;
  color: var(--text-dim);
  font-weight: 400;
}

.game-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.table-section {
  flex: 1;
  position: relative;
  min-height: 0;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============ POKER TABLE ============ */

.table-felt {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.table-oval {
  width: 88%;
  max-width: 680px;
  height: 55%;
  min-height: 200px;
  background: radial-gradient(ellipse, #1f7a3a 0%, var(--felt-green) 50%, var(--felt-dark) 100%);
  border-radius: 50%;
  border: 8px solid var(--table-border);
  box-shadow: 0 0 40px rgba(0,0,0,0.5), inset 0 0 60px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 10px;
  z-index: 1;
}

.table-info {
  text-align: center;
  margin-bottom: 4px;
}

.variant-badge {
  background: rgba(0,0,0,0.4);
  padding: 3px 14px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  display: inline-block;
  color: var(--gold);
}

.blind-info {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.5);
  margin-top: 2px;
}

/* ============ COMMUNITY CARDS ============ */

.community-cards {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 6px 0;
  flex-wrap: nowrap;
  z-index: 10;
}

.pot-display {
  text-align: center;
  margin-top: 4px;
  opacity: 0.5;
  transition: opacity 0.3s;
  z-index: 5;
}

.pot-display.pot-active { opacity: 1; }

.pot-label {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.pot-amount {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gold);
}

.side-pots {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
  justify-content: center;
}

.side-pot {
  font-size: 0.65rem;
  background: rgba(0,0,0,0.3);
  padding: 2px 8px;
  border-radius: 8px;
  color: var(--gold);
}

/* ============ CARDS — BIG ============ */

.card {
  width: 72px;
  height: 100px;
  border-radius: 8px;
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  transition: transform 0.25s, box-shadow 0.25s;
  font-family: 'Segoe UI', system-ui, sans-serif;
}

.card-back {
  background: linear-gradient(135deg, #1a3a5c, #0d2137);
  border: 2px solid #2c5f8a;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.card-pattern {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.12);
  word-break: break-all;
  text-align: center;
  line-height: 1.1;
  transform: rotate(-30deg);
}

.card-red, .card-black {
  background: var(--card-white);
  border: 1.5px solid #bbb;
  box-shadow: 2px 3px 8px rgba(0,0,0,0.35);
}

.card-red { color: var(--red); }
.card-black { color: #1a1a2e; }

.card-corner {
  position: absolute;
  line-height: 1;
  text-align: center;
}

.card-top-left { top: 5px; left: 6px; }

.card-bottom-right {
  bottom: 5px;
  right: 6px;
  transform: rotate(180deg);
}

.card-value {
  font-weight: 800;
  font-size: 1.05rem;
}

.card-suit { font-size: 0.85rem; }

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

.card-empty {
  background: rgba(255,255,255,0.04);
  border: 1.5px dashed rgba(255,255,255,0.12);
}

.card-row {
  display: flex;
  gap: 6px;
  justify-content: center;
}

/* Player cards — still large but slightly smaller than community */
.player-card {
  width: 54px;
  height: 76px;
}

.player-card .card-value { font-size: 0.85rem; }
.player-card .card-suit { font-size: 0.7rem; }
.player-card .card-center-suit { font-size: 1.5rem; }
.player-card .card-top-left { top: 4px; left: 4px; }
.player-card .card-bottom-right { bottom: 4px; right: 4px; }

.community-card {
  transform: scale(1);
  transition: transform 0.3s, box-shadow 0.3s;
}

.community-card:hover {
  transform: scale(1.08);
  z-index: 20;
}

/* ============ PLAYER SEATS ============ */

#players-area {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 3;
  overflow: visible;
}

.player-seat {
  position: absolute;
  text-align: center;
  pointer-events: auto;
  z-index: 4;
  transition: opacity 0.3s;
}

.player-seat.eliminated { opacity: 0.25; }
.player-seat.folded { opacity: 0.45; }

/* Push seats further out so cards don't overlap table center */
.seat-bottom { bottom: 2%; left: 50%; transform: translateX(-50%); }
.seat-top { top: 8%; left: 50%; transform: translateX(-50%); }
.seat-left { left: 2%; top: 50%; transform: translateY(-50%); }
.seat-right { right: 2%; top: 50%; transform: translateY(-50%); }
.seat-top-left { top: 10%; left: 8%; }
.seat-top-right { top: 10%; right: 8%; }
.seat-bottom-left { bottom: 6%; left: 8%; }
.seat-bottom-right { bottom: 6%; right: 8%; }

.player-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin: 0 auto 4px;
  background: rgba(0,0,0,0.6);
}

.player-name {
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.player-chips {
  text-align: center;
}

.player-cards {
  display: flex;
  gap: 3px;
  justify-content: center;
  margin-top: 5px;
  position: relative;
  z-index: 5;
}

.player-bet {
  font-size: 0.75rem;
  color: #fff;
  background: rgba(212,175,55,0.3);
  padding: 2px 10px;
  border-radius: 10px;
  margin-top: 4px;
  display: inline-block;
  font-weight: 600;
}

.hand-desc {
  font-size: 0.7rem;
  color: var(--gold);
  margin-top: 3px;
  font-weight: 700;
}

.dealer-chip {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  background: var(--gold);
  color: #000;
  border-radius: 50%;
  font-size: 0.65rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 6;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.active-player {
  z-index: 8;
}

.active-player .player-avatar {
  box-shadow: 0 0 14px rgba(212,175,55,0.8), 0 0 28px rgba(212,175,55,0.35);
  animation: glow-pulse 1.2s ease-in-out infinite;
}

.all-in-player .chip-amount {
  color: var(--red) !important;
  font-weight: 800;
  animation: pulse 0.8s ease-in-out 2;
}

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 10px rgba(212,175,55,0.5); }
  50% { box-shadow: 0 0 22px rgba(212,175,55,0.9), 0 0 40px rgba(212,175,55,0.35); }
}

/* ============ ACTION PANEL ============ */

#action-area {
  background: rgba(0,0,0,0.5);
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.action-panel {
  padding: 10px 16px;
  min-height: 50px;
}

.action-panel.active {
  background: rgba(212,175,55,0.05);
  border-top: 2px solid var(--gold);
}

.waiting-msg {
  text-align: center;
  color: var(--text-dim);
  padding: 12px;
  font-style: italic;
}

.hand-info {
  text-align: center;
  margin-bottom: 8px;
}

.chip-count {
  font-size: 0.85rem;
  color: var(--gold);
}

.action-buttons {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap;
}

.action-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.action-btn:hover { transform: translateY(-1px); }

.fold-btn { background: #555; color: #fff; }
.fold-btn:hover { background: #666; }

.check-btn { background: #2980b9; color: #fff; }
.check-btn:hover { background: #3498db; }

.call-btn { background: #27ae60; color: #fff; }
.call-btn:hover { background: #2ecc71; }

.raise-btn { background: var(--gold); color: #1a1a2e; }
.raise-btn:hover { background: #e6c445; }

.allin-btn { background: var(--red); color: #fff; }
.allin-btn:hover { background: #e55; }

.raise-control {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.slider-container {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.slider-container input[type="range"] {
  flex: 1;
  accent-color: var(--gold);
}

.slider-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.preset-bets {
  display: flex;
  gap: 6px;
}

.preset-btn {
  padding: 4px 10px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  color: var(--text-dim);
  font-size: 0.7rem;
  cursor: pointer;
  transition: all 0.15s;
}

.preset-btn:hover {
  background: rgba(255,255,255,0.15);
  color: var(--text-light);
}

/* ============ CHAT LOG ============ */

.chat-section {
  border-top: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.3);
  max-height: 120px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.chat-header {
  padding: 5px 16px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  background: rgba(0,0,0,0.3);
}

.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 4px 16px;
  font-size: 0.8rem;
  line-height: 1.5;
}

.chat-msg { margin-bottom: 2px; }

.chat-name {
  font-weight: 600;
  margin-right: 6px;
}

.system-msg .chat-text { color: var(--text-dim); }

.trash-talk .chat-text {
  font-style: italic;
  color: rgba(255,255,255,0.8);
}

.action-msg .chat-text {
  color: rgba(255,255,255,0.7);
}

/* ============ HAND RESULT BANNER ============ */

.hand-result-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s;
}

.hand-result-banner.visible {
  opacity: 1;
  pointer-events: auto;
}

.hand-result-card {
  background: linear-gradient(135deg, rgba(10,10,20,0.95), rgba(20,20,40,0.95));
  border: 2px solid var(--gold);
  border-radius: 20px;
  padding: 32px 48px;
  text-align: center;
  box-shadow: 0 0 60px rgba(212,175,55,0.3), 0 20px 60px rgba(0,0,0,0.6);
  transform: scale(0.8);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 500px;
  width: 90%;
}

.hand-result-banner.visible .hand-result-card {
  transform: scale(1);
}

.result-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.result-winner {
  font-size: 1.1rem;
  color: var(--text-light);
  margin-bottom: 6px;
}

.result-hand-name {
  font-size: 1rem;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 12px;
  opacity: 0.9;
}

.result-amount {
  font-size: 1.8rem;
  font-weight: 800;
  color: #2ecc71;
  margin-bottom: 16px;
}

.result-dismiss {
  font-size: 0.75rem;
  color: var(--text-dim);
  animation: blink 1.5s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* ============ VISUAL CHIP STACKS ============ */

.chip-stack-visual { display: flex; justify-content: center; margin: 2px 0; }
.chip-visual { width: 18px; height: 18px; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; font-size: 0.4rem; font-weight: 800;
  color: rgba(0,0,0,0.6); border: 1.5px solid rgba(0,0,0,0.25);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3), inset 0 1px 1px rgba(255,255,255,0.4);
  margin: 0 -3px; position: relative; }
.chip-amount { font-size: 0.75rem; color: var(--gold); font-weight: 600; }

/* Denomination colors */
.chip-25  { background: radial-gradient(circle at 35% 35%, #f5f0e1, #d4c9a8); }
.chip-100 { background: radial-gradient(circle at 35% 35%, #ff7b7b, #e74c3c); color: #fff; }
.chip-500 { background: radial-gradient(circle at 35% 35%, #81ecb0, #27ae60); }
.chip-1000 { background: radial-gradient(circle at 35% 35%, #7bc8ff, #3498db); color: #fff; }
.chip-5000 { background: radial-gradient(circle at 35% 35%, #d7b0ff, #9b59b6); color: #fff; }

/* Pot chips (clustered layout) */
.pot-chips-visual { display: flex; justify-content: center; flex-wrap: wrap;
  gap: 2px; margin-bottom: 4px; max-width: 100px; margin: 0 auto; }

/* Bet chips (small, near player) */
.bet-chips { display: flex; gap: 1px; justify-content: center; margin-top: 2px; }
.bet-chip { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0,0,0,0.3);
  box-shadow: 0 1px 2px rgba(0,0,0,0.3); }

/* Animated denomination chips (for flight animations) */
.anim-denom-chip { position: absolute; border-radius: 50%; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.45rem; font-weight: 900; z-index: 45;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4), inset 0 1px 2px rgba(255,255,255,0.3); }

/* All-in chip amount styling */
.all-in-player .chip-amount {
  color: var(--red);
  font-weight: 800;
}

/* ============ CHIP ANIMATION LAYER ============ */

#chip-animation-layer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 40;
}

.animated-chip {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f5d76e, var(--gold), #a67c00);
  border: 2px solid #a67c00;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4), inset 0 1px 2px rgba(255,255,255,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  font-weight: 900;
  color: #5a3e00;
  pointer-events: none;
}

.animated-chip::after {
  content: '$';
  font-size: 0.7rem;
}

/* ============ DIALOGS ============ */

.dialog-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.3s;
  backdrop-filter: blur(4px);
}

.dialog-overlay.active { opacity: 1; }

.dialog {
  background: #1a1a2e;
  border-radius: 16px;
  padding: 32px;
  max-width: 480px;
  width: 90%;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.dialog h2 {
  text-align: center;
  margin-bottom: 8px;
  color: var(--gold);
}

.dialog p {
  text-align: center;
  color: var(--text-dim);
  margin-bottom: 20px;
}

.variant-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.variant-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: rgba(255,255,255,0.04);
  border: 2px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.variant-btn:hover {
  border-color: var(--gold);
  background: rgba(212,175,55,0.08);
}

.variant-icon { font-size: 2rem; }

.variant-name {
  font-size: 1.1rem;
  font-weight: 700;
}

.variant-desc {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.moscow-btn:hover {
  border-color: var(--red);
  background: rgba(231,76,60,0.08);
}

/* Game Over */

.final-standings {
  margin: 16px 0;
}

.final-standings h3 {
  font-size: 0.85rem;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.standing-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 4px;
  background: rgba(255,255,255,0.03);
}

.standing-human {
  background: rgba(212,175,55,0.1);
  border: 1px solid rgba(212,175,55,0.3);
}

.standing-rank { color: var(--gold); font-weight: 700; }
.standing-chips { color: var(--text-dim); }

.play-again-btn {
  width: 100%;
  padding: 14px;
  background: var(--gold);
  border: none;
  border-radius: 8px;
  color: #1a1a2e;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s;
}

.play-again-btn:hover { transform: translateY(-2px); }

/* ============ MOSCOW ANIMATION ============ */

.moscow-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(139,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  transition: opacity 0.5s;
}

.moscow-overlay.active { opacity: 1; }

.moscow-animation {
  text-align: center;
  animation: moscow-enter 0.6s ease-out;
}

.putin-figure {
  font-size: 4rem;
  margin-bottom: 16px;
  animation: putin-bounce 0.8s ease-in-out infinite;
}

.putin-hat { font-size: 2rem; }

.moscow-title {
  font-size: 2rem;
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 0 20px rgba(212,175,55,0.5);
  margin-bottom: 12px;
  letter-spacing: 0.1em;
}

.moscow-quote {
  font-size: 1.1rem;
  font-style: italic;
  color: rgba(255,255,255,0.9);
  max-width: 400px;
  margin: 0 auto;
}

.moscow-chips-fly {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 12px;
}

.moscow-chips-fly span {
  font-size: 1.8rem;
  animation: fly-away 2s ease-in forwards;
}

.moscow-chips-fly span:nth-child(1) { animation-delay: 0.2s; }
.moscow-chips-fly span:nth-child(2) { animation-delay: 0.4s; --fly-x: -50px; }
.moscow-chips-fly span:nth-child(3) { animation-delay: 0.6s; --fly-x: 60px; }
.moscow-chips-fly span:nth-child(4) { animation-delay: 0.8s; --fly-x: -80px; }
.moscow-chips-fly span:nth-child(5) { animation-delay: 1s; --fly-x: 40px; }
.moscow-chips-fly span:nth-child(6) { animation-delay: 1.2s; --fly-x: -30px; }

.moscow-glow-card {
  box-shadow: 0 0 15px rgba(255,0,0,0.6), 0 0 30px rgba(255,0,0,0.3) !important;
  border-color: red !important;
}

@keyframes moscow-enter {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes putin-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes fly-away {
  0% { transform: translateY(0) translateX(0); opacity: 1; }
  100% { transform: translateY(-200px) translateX(var(--fly-x, 0)); opacity: 0; }
}

/* ============ ANIMATIONS ============ */

.deal-animate {
  animation: deal-in 0.4s ease-out;
}

@keyframes deal-in {
  from { transform: translateY(-40px) scale(0.5); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.card-flip {
  animation: flip 0.5s ease-in-out;
}

@keyframes flip {
  0% { transform: rotateY(0); }
  50% { transform: rotateY(90deg); }
  100% { transform: rotateY(0); }
}

.pot-win-animate {
  animation: pot-win 0.6s ease-out;
}

@keyframes pot-win {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); color: #fff; }
  100% { transform: scale(1); }
}

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

.pulse {
  animation: pulse 0.5s ease-in-out;
}

/* ─── HAND RESULT BACKDROP ─── */

.hand-result-backdrop {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.85) 100%);
  backdrop-filter: blur(6px);
}

/* ─── ALL-IN FLASH ─── */

.allin-flash {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse at center, rgba(231,76,60,0.4) 0%, transparent 70%);
  pointer-events: none;
  z-index: 45;
}

/* ─── SHOCKWAVE RING ─── */

.shockwave-ring {
  position: absolute;
  border: 3px solid rgba(231,76,60,0.8);
  border-radius: 50%;
  pointer-events: none;
  z-index: 45;
}

/* ─── THINKING DOTS ─── */

.thinking-dots {
  font-size: 1.2rem;
  color: var(--gold);
  letter-spacing: 2px;
  font-weight: 900;
  margin-top: 2px;
}

.thinking-dots span {
  display: inline-block;
  animation: thinking-bounce 1.2s ease-in-out infinite;
}

.thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes thinking-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.3; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* ─── CARD 3D PERSPECTIVE ─── */

.player-cards, .community-cards {
  perspective: 800px;
}

.player-card, .community-card {
  transform-style: preserve-3d;
  backface-visibility: hidden;
}

/* ─── ENHANCED CARD HOVER ─── */

.community-card:hover {
  transform: scale(1.12) translateY(-4px);
  z-index: 20;
  box-shadow: 4px 6px 16px rgba(0,0,0,0.5);
}

.player-card {
  transition: transform 0.2s, box-shadow 0.2s;
}

.seat-bottom .player-card:hover {
  transform: scale(1.15) translateY(-6px);
  box-shadow: 3px 5px 12px rgba(0,0,0,0.5);
  z-index: 10;
}

/* ─── MOSCOW SCANLINES ─── */

.moscow-scanlines {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.15) 2px,
    rgba(0,0,0,0.15) 4px
  );
  pointer-events: none;
  z-index: 1;
  animation: scanline-scroll 4s linear infinite;
}

@keyframes scanline-scroll {
  0% { transform: translateY(0); }
  100% { transform: translateY(4px); }
}

/* ─── MOSCOW GLOW ─── */

.moscow-glow {
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(ellipse at center, rgba(255,0,0,0.3) 0%, transparent 60%);
  pointer-events: none;
}

.moscow-glow-card {
  box-shadow: 0 0 15px rgba(255,0,0,0.6), 0 0 30px rgba(255,0,0,0.3) !important;
  border-color: #e74c3c !important;
  animation: moscow-card-pulse 0.6s ease-in-out infinite alternate;
}

@keyframes moscow-card-pulse {
  from { box-shadow: 0 0 15px rgba(255,0,0,0.6), 0 0 30px rgba(255,0,0,0.3); }
  to { box-shadow: 0 0 25px rgba(255,0,0,0.9), 0 0 50px rgba(255,0,0,0.5); }
}

/* ─── ENHANCED POT DISPLAY ─── */

.pot-amount {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gold);
  transition: transform 0.3s, color 0.3s;
}

/* ─── PLAYER SEAT TRANSITIONS ─── */

.player-seat {
  transition: opacity 0.3s, transform 0.3s;
}

/* ============ SETTINGS ============ */

.settings-dialog {
  max-width: 400px;
}

.settings-dialog .form-group input[type="password"] {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  color: var(--text-light);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
  font-family: monospace;
}

.settings-dialog .form-group input[type="password"]:focus {
  border-color: var(--gold);
}

.settings-toggle-group {
  margin-top: 8px;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-light);
  text-transform: none;
  letter-spacing: 0;
}

.toggle-label input[type="checkbox"] {
  accent-color: var(--gold);
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.settings-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.settings-save-btn {
  flex: 1;
  padding: 12px;
  font-size: 1rem;
}

.settings-close-btn {
  flex: 1;
  padding: 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  color: var(--text-light);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.settings-close-btn:hover {
  background: rgba(255,255,255,0.15);
}

/* ============ SPEAKER ICON ============ */

.speaker-icon {
  font-size: 0.7rem;
  margin-left: 6px;
  opacity: 0.4;
  vertical-align: middle;
}

.trash-talk:hover .speaker-icon {
  opacity: 0.8;
}

/* ============ SCROLLBAR ============ */

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }

/* ============ PAUSE ============ */

.game-paused .game-layout {
  opacity: 0.5;
  pointer-events: none;
}

.game-paused .game-header::after {
  content: 'PAUSED';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.15em;
}

.game-paused .hand-counter {
  display: none;
}

/* ============ AUTH UI ============ */

.header-actions {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}

.header-btn:hover {
  color: var(--gold);
  background: rgba(255,255,255,0.08);
}

.header-btn.tts-active {
  color: var(--gold);
}

.auth-profile {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.auth-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-light);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-btn {
  padding: 5px 12px;
  border: none;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.auth-signin {
  background: rgba(255,255,255,0.1);
  color: var(--text-light);
  border: 1px solid rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  gap: 6px;
}

.auth-signin:hover {
  background: rgba(255,255,255,0.18);
}

.google-icon {
  flex-shrink: 0;
}

.auth-signout {
  background: rgba(255,255,255,0.06);
  color: var(--text-dim);
  border: 1px solid rgba(255,255,255,0.1);
}

.auth-signout:hover {
  background: rgba(231,76,60,0.15);
  color: var(--red);
  border-color: rgba(231,76,60,0.3);
}

/* ============ LEADERBOARD ============ */

.leaderboard-dialog {
  max-width: 550px;
}

.lb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.lb-header h2 {
  margin-bottom: 0;
}

.lb-close-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.6rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.2s;
}

.lb-close-btn:hover {
  color: var(--text-light);
}

.leaderboard-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
}

.lb-tab {
  flex: 1;
  padding: 8px 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.lb-tab:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text-light);
}

.lb-tab.active {
  background: rgba(212,175,55,0.15);
  border-color: var(--gold);
  color: var(--gold);
}

.lb-content {
  max-height: 400px;
  overflow-y: auto;
}

.lb-header-row {
  display: grid;
  grid-template-columns: 32px 1fr 90px 70px;
  gap: 8px;
  padding: 6px 8px;
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-dim);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 4px;
}

.lb-row {
  display: grid;
  grid-template-columns: 32px 1fr 90px 70px;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border-radius: 6px;
  margin-bottom: 2px;
  background: rgba(255,255,255,0.02);
  font-size: 0.85rem;
}

.lb-row:hover {
  background: rgba(255,255,255,0.05);
}

.lb-col-rank {
  color: var(--gold);
  font-weight: 700;
  text-align: center;
}

.lb-col-player {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.lb-avatar-placeholder {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--text-dim);
  flex-shrink: 0;
}

.lb-col-stat {
  text-align: right;
  font-weight: 600;
  color: var(--gold);
}

.lb-col-winrate {
  text-align: right;
  color: var(--text-dim);
  font-size: 0.8rem;
}

.lb-loading, .lb-empty, .lb-error {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.lb-error { color: var(--red); }

/* ============ GAME OVER ADDITIONS ============ */

.stats-saved {
  text-align: center;
  color: #2ecc71;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.stats-not-saved {
  text-align: center;
  color: #f39c12;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.game-over-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.game-over-actions .play-again-btn {
  flex: 1;
}

.leaderboard-link-btn {
  flex: 1;
  padding: 14px;
  background: transparent;
  border: 2px solid var(--gold);
  border-radius: 8px;
  color: var(--gold);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.leaderboard-link-btn:hover {
  background: rgba(212,175,55,0.12);
  transform: translateY(-2px);
}

/* ============ MOBILE ============ */

@media (max-width: 600px) {
  .setup-screen { padding: 30px 16px; }
  .setup-title { font-size: 2.2rem; }

  .card { width: 52px; height: 74px; }
  .card-value { font-size: 0.85rem; }
  .card-center-suit { font-size: 1.5rem; }

  .player-card { width: 40px; height: 58px; }
  .player-card .card-center-suit { font-size: 1.2rem; }

  .player-avatar { width: 34px; height: 34px; font-size: 1rem; }
  .player-name { font-size: 0.7rem; }
  .chip-amount { font-size: 0.55rem; }
  .chip-visual { width: 14px; height: 14px; font-size: 0.3rem; }
  .bet-chip { width: 11px; height: 11px; }

  .action-btn { padding: 8px 12px; font-size: 0.8rem; }

  .table-oval { width: 95%; }

  .moscow-title { font-size: 1.4rem; }
  .putin-figure { font-size: 3rem; }

  .hand-result-card { padding: 24px 20px; }
  .result-title { font-size: 1.2rem; }
  .result-amount { font-size: 1.4rem; }

  .header-actions { gap: 4px; right: 8px; }
  .auth-name { display: none; }
  .auth-btn { font-size: 0.7rem; padding: 4px 8px; }
  .auth-signin span { display: none; }

  .game-over-actions { flex-direction: column; }
  .leaderboard-link-btn { padding: 10px; font-size: 0.9rem; }

  .lb-header-row, .lb-row {
    grid-template-columns: 28px 1fr 70px 50px;
    font-size: 0.75rem;
  }
  .lb-tab { font-size: 0.65rem; padding: 6px 4px; }
}
