/* Import Outfit & Montserrat from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;700&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Felt Color system */
  --felt: #123e2b;
  --felt-light: #1c5e42;
  --felt-dark: #0a2218;
  --leather-rail: #151518;
  --inner-border: #d4af37; /* Gold */
  
  /* Text and muted colors */
  --text: #f8fafc;
  --text-muted: #94a3b8;
  
  /* Action colors */
  --primary: #3b82f6;      /* Blue */
  --check: #10b981;        /* Green */
  --raise: #f59e0b;        /* Orange/Gold */
  --allin: #ef4444;        /* Crimson Red */
  --fold: #64748b;         /* Slate */
  --call: #0ea5e9;         /* Light Blue */
  --gold: #f59e0b;
  
  /* Card colors */
  --card-suit-red: #e11d48;
  --card-suit-black: #0f172a;
  
  /* Stats colors */
  --profit-pos: #4ade80;
  --profit-neg: #f87171;
  
  /* Glassmorphism backgrounds */
  --glass-bg: rgba(15, 23, 42, 0.5);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-blur: blur(16px);
  
  /* Shadows */
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
  --glow-hero: 0 0 20px rgba(59, 130, 246, 0.45);
  --glow-bot: 0 0 20px rgba(245, 158, 11, 0.45);
}

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

body {
  min-height: 100vh;
  font-family: 'Outfit', 'Montserrat', "Segoe UI", "PingFang SC", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top, #13271f 0%, #050d0a 80%), #050d0a;
  padding: 12px 12px 24px;
  overflow-x: hidden;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

.app {
  max-width: 1400px;
  margin: 0 auto;
}

/* Topbar Header styling */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 12px 18px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-lg);
}

.topbar h1 {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: #1e293b;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  padding: 3px 8px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.subtitle {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Layout Grid system */
.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  align-items: start;
}

/* Left sidebar panel - Glassmorphism */
.profit-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 20px;
}

.profit-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.8) 100%);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 20px;
  text-align: center;
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-lg);
}

.profit-label {
  display: block;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.profit-value {
  display: block;
  font-size: 2.3rem;
  font-weight: 800;
  margin: 10px 0;
  line-height: 1;
  font-family: 'Outfit', sans-serif;
  letter-spacing: -1px;
}

.profit-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.mini-stats {
  display: grid;
  gap: 10px;
}

.mini-stat {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: var(--glass-blur);
}

.mini-stat span {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
}

.mini-stat strong {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  font-family: 'Outfit', sans-serif;
}

/* Action Log Console styling */
.gto-feed {
  background: rgba(10, 15, 30, 0.7);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 16px;
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gto-feed h3 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gold);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 8px;
}

.bot-feed-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 250px;
  overflow-y: auto;
  padding-right: 4px;
}

/* Game Log Entry items */
.log-item {
  font-size: 0.82rem;
  line-height: 1.4;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid transparent;
  animation: logFadeIn 0.25s ease-out;
}

.log-item.type-hero {
  border-left-color: var(--primary);
  color: #93c5fd;
}

.log-item.type-bot {
  border-left-color: var(--gold);
  color: #fde047;
}

.log-item.type-system {
  border-left-color: #94a3b8;
  color: #cbd5e1;
}

/* Street divider banner in logs */
.log-item.street-banner {
  background: rgba(212, 175, 55, 0.08);
  border-left: none;
  text-align: center;
  color: var(--gold);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 1.5px;
  margin: 6px 0;
  border: 1px dashed rgba(212, 175, 55, 0.25);
}

@keyframes logFadeIn {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Poker Table Scene ---- */
.table-scene {
  min-width: 0;
}

.table {
  background: radial-gradient(circle, var(--felt-light) 0%, var(--felt) 60%, var(--felt-dark) 100%);
  border: 16px solid var(--leather-rail);
  border-radius: 32px;
  min-height: 600px;
  padding: 30px;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.85), 0 20px 50px rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
}

/* Table decorative design lines */
.table::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 10px;
  right: 10px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 20px;
  pointer-events: none;
}

.table::after {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 10px;
  right: 10px;
  border: 1.5px solid var(--inner-border);
  border-radius: 20px;
  pointer-events: none;
  opacity: 0.45;
}

.opponent-area,
.hero-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  z-index: 5;
}

.center-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  width: 100%;
  margin: 15px 0;
  position: relative;
}

/* Player Badges - Glassmorphism Pill Shapes */
.player-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 99px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  margin-bottom: 10px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.player-badge .avatar-icon {
  font-size: 1.1rem;
}

.player-badge .name {
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.5px;
}

.player-badge.you {
  border-color: rgba(59, 130, 246, 0.35);
}

.player-badge.gto {
  border-color: rgba(245, 158, 11, 0.35);
}

/* Position flags BTN/SB/BB */
.position {
  font-size: 0.72rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  color: #1e293b;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: 'Outfit', sans-serif;
}

/* Opponent/Bot action banners */
.action-banner {
  margin: 4px auto 10px;
  padding: 6px 16px;
  border-radius: 99px;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  animation: bannerPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.action-banner.tone-aggressive {
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  color: #ffffff;
}

.action-banner.tone-allin {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  color: #ffffff;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.45);
}

.action-banner.tone-call {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: #ffffff;
}

.action-banner.tone-fold {
  background: #475569;
  color: #e2e8f0;
}

.action-banner.tone-passive {
  background: #64748b;
  color: #f8fafc;
}

/* Card Styles */
.card-row, .board {
  display: flex;
  justify-content: center;
  gap: 12px;
  min-height: 94px;
  margin: 6px 0;
}

.card {
  width: 66px;
  height: 92px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
  color: var(--card-suit-black);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px 6px;
  position: relative;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  user-select: none;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.6);
}

.card.back {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 2px solid var(--inner-border);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45);
}

.card.back::after {
  content: "AI";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--inner-border);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 2px;
  opacity: 0.85;
}

.card .rank {
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1;
  font-family: 'Outfit', sans-serif;
}

.card .suit {
  font-size: 1.45rem;
  align-self: flex-end;
  line-height: 1;
}

.card.red {
  color: var(--card-suit-red);
}

/* Floating Bet Chips (glowing coin design) */
.bet-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  background: rgba(245, 158, 11, 0.15);
  border: 1.5px solid var(--gold);
  color: var(--gold);
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.15), 0 0 10px rgba(0,0,0,0.3);
  animation: fadeIn 0.3s ease;
  margin-top: 8px;
}

.bet-chip::before {
  content: "🪙";
  font-size: 0.95rem;
}

.bet-chip.hero-chip {
  background: rgba(14, 165, 233, 0.15);
  border-color: var(--call);
  color: #38bdf8;
  box-shadow: 0 4px 10px rgba(14, 165, 233, 0.15), 0 0 10px rgba(0,0,0,0.3);
}

/* ── Flying chip animation (chip flies from player to pot) ── */
.flying-chip {
  position: fixed;
  transform: translate(-50%, -50%);
  z-index: 9999;
  pointer-events: none;

  /* Appearance: gold coin badge */
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  background: rgba(245, 158, 11, 0.92);
  border: 1.5px solid #fbbf24;
  color: #1a1000;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.7), 0 4px 12px rgba(0,0,0,0.5);
  white-space: nowrap;

  /* Smooth flight */
  transition: transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1),
              opacity 0.55s ease;
  opacity: 1;
}

.flying-chip-hero {
  background: rgba(14, 165, 233, 0.92);
  border-color: #38bdf8;
  color: #001824;
  box-shadow: 0 0 14px rgba(14, 165, 233, 0.7), 0 4px 12px rgba(0,0,0,0.5);
}

/* Center area details */
.street-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--inner-border);
  background: rgba(0, 0, 0, 0.4);
  padding: 4px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.pot-line {
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 600;
  margin-top: 12px;
}

.pot-line strong {
  color: var(--gold);
  font-size: 1.25rem;
  font-family: 'Outfit', sans-serif;
  margin-left: 2px;
}

.stack-line {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.stack-line strong {
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
}

/* Hand winner/loser message banner */
.hand-message {
  margin-top: 15px;
  padding: 12px 24px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  display: inline-block;
  font-weight: 600;
  font-size: 0.95rem;
  text-align: center;
  animation: bannerPop 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.hand-message.win {
  border-color: rgba(74, 222, 128, 0.45);
  box-shadow: 0 0 25px rgba(74, 222, 128, 0.25);
  color: #86efac;
}

.hand-message.lose {
  border-color: rgba(248, 113, 113, 0.45);
  box-shadow: 0 0 25px rgba(248, 113, 113, 0.25);
  color: #fca5a5;
}

/* ---- Action Dock (Control Panel) ---- */
.hero-zone {
  width: 100%;
}

.hero-area {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 8px;
}

.action-dock {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 16px 20px 20px;
  backdrop-filter: var(--glass-blur);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  transition: all 0.3s ease;
  width: 90%;
  max-width: 820px;
  margin: 0 auto;
}

/* Turn Breathing Glow Indicating logic */
.action-dock.your-turn {
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 0 25px rgba(59, 130, 246, 0.35), var(--shadow-lg);
}

.action-dock-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  min-height: 28px;
}

.turn-indicator {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.5px;
}

.action-dock.your-turn .turn-indicator {
  color: #38bdf8;
  animation: turnPulse 2s infinite ease-in-out;
}

.call-info {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

/* Action buttons dock list */
.action-buttons {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.action-btn {
  flex: 1;
  min-height: 54px;
  border: none;
  border-radius: 12px;
  font-size: 1.02rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  color: white;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.action-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.35);
  filter: brightness(1.1);
}

.action-btn:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
}

.action-btn:disabled {
  opacity: 0.22;
  cursor: not-allowed;
  box-shadow: none;
}

/* Action button distinct gradient theme colors */
.fold-btn {
  background: linear-gradient(180deg, #64748b 0%, #475569 100%);
  flex: 0.8;
}

.check-btn {
  background: linear-gradient(180deg, #10b981 0%, #059669 100%);
}

.call-btn {
  background: linear-gradient(180deg, #0ea5e9 0%, #0284c7 100%);
}

.bet-btn,
.raise-btn {
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
  color: #1e293b;
  text-shadow: none;
  flex: 1.15;
}

.allin-btn {
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
  flex: 0.9;
}

/* Custom Betting Range Slider Panel */
.bet-panel {
  margin-bottom: 12px;
  padding: 12px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.bet-panel-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.bet-panel-row label {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.bet-panel-row strong {
  color: var(--gold);
  font-size: 1.3rem;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
}

/* Stylized inputs range */
.bet-panel input[type="range"] {
  width: 100%;
  margin: 8px 0 12px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.1);
  outline: none;
  -webkit-appearance: none;
}

.bet-panel input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--gold);
  cursor: pointer;
  box-shadow: 0 0 10px var(--gold);
  transition: transform 0.1s ease;
}

.bet-panel input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.25);
}

.bet-presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.bet-presets .preset {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 600;
  font-size: 0.78rem;
  border-radius: 8px;
  padding: 6px 12px;
  color: var(--text);
  transition: all 0.15s ease;
}

.bet-presets .preset:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
}

#btn-cancel-bet {
  margin-left: auto;
  background: linear-gradient(180deg, #475569 0%, #334155 100%) !important;
  color: #ffffff;
  border-radius: 10px;
  padding: 7px 16px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

#btn-confirm-bet {
  margin-left: 8px;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%) !important;
  color: #1e293b;
  border-radius: 10px;
  padding: 7px 16px;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.25);
}

.next-hand-btn {
  min-height: 52px;
  font-size: 1.05rem;
  letter-spacing: 0.5px;
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%) !important;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.35);
}

.btn {
  border: none;
  border-radius: 12px;
  padding: 10px 18px;
  cursor: pointer;
  font-weight: 600;
  color: white;
  background: rgba(255, 255, 255, 0.08);
  transition: all 0.2s ease;
  font-family: 'Outfit', sans-serif;
}

.btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.28;
  cursor: not-allowed;
}

.btn.primary {
  background: var(--primary);
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-muted);
}

.btn.secondary:hover {
  color: white;
  background: rgba(255,255,255,0.12);
}

.btn.full {
  width: 100%;
}

.hidden {
  display: none !important;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes bannerPop {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes turnPulse {
  0%, 100% { opacity: 0.75; text-shadow: 0 0 5px rgba(59, 130, 246, 0.3); }
  50% { opacity: 1; text-shadow: 0 0 15px rgba(59, 130, 246, 0.8); }
}

/* GTO Badge Thinking Glow */
@keyframes thinkingGlow {
  0%, 100% { border-color: rgba(245, 158, 11, 0.35); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35); }
  50% { border-color: rgba(245, 158, 11, 0.85); box-shadow: 0 0 15px rgba(245, 158, 11, 0.6); }
}

.player-badge.gto.thinking {
  animation: thinkingGlow 1s infinite ease-in-out;
}

/* Badge Action Pulses */
@keyframes badgePulseAggressive {
  0% { transform: scale(1); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35); border-color: rgba(245, 158, 11, 0.35); }
  30% { transform: scale(1.15); box-shadow: 0 0 30px rgba(245, 158, 11, 0.8); border-color: rgba(245, 158, 11, 1); }
  100% { transform: scale(1); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35); border-color: rgba(245, 158, 11, 0.35); }
}

@keyframes badgePulsePassive {
  0% { transform: scale(1); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35); border-color: rgba(245, 158, 11, 0.35); }
  30% { transform: scale(1.1); box-shadow: 0 0 25px rgba(14, 165, 233, 0.6); border-color: rgba(14, 165, 233, 0.8); }
  100% { transform: scale(1); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35); border-color: rgba(245, 158, 11, 0.35); }
}

.badge-pulse-aggressive {
  animation: badgePulseAggressive 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.badge-pulse-passive {
  animation: badgePulsePassive 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Bet Chips Slide Animations */
@keyframes chipSlideFromTop {
  from { transform: translateY(-40px) scale(0.5); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

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

.chip-animate {
  animation: chipSlideFromTop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chip-animate-hero {
  animation: chipSlideFromBottom 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}


/* Media Queries for Responsiveness */
@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .profit-panel {
    position: static;
    order: 2;
  }
  .table-scene {
    order: 1;
  }
  .table {
    border-radius: 40px;
    min-height: 550px;
  }
}

@media (max-width: 640px) {
  .action-buttons {
    flex-wrap: wrap;
  }
  .action-btn {
    flex: 1 1 calc(50% - 6px);
    min-height: 48px;
    font-size: 0.95rem;
  }
  .fold-btn {
    flex: 1 1 100%;
    order: 3;
  }
  .action-dock-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

/* --- Sidebar Tabs --- */
.tab-headers {
  display: flex;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 4px 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.tab-btn:hover {
  color: var(--text);
}

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

.tab-btn.active::after {
  content: "";
  position: absolute;
  bottom: -9px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gold);
}

.tab-content {
  display: flex;
  flex-direction: column;
}

/* --- History List & Items --- */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 4px;
}

.history-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.history-item:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

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

.history-item-header .hand-title {
  font-size: 0.82rem;
  color: var(--text);
}

.history-item-header .profit {
  font-size: 0.82rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
}

.history-item-body {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* --- Account Key Management Card --- */
.account-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 16px;
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.account-card h4 {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 6px;
}

.account-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.key-row, .import-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.key-row input, .import-row input {
  flex: 1;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--text);
  font-size: 0.72rem;
  font-family: 'Outfit', sans-serif;
  outline: none;
}

.key-row input[readonly] {
  color: var(--text-muted);
  cursor: default;
}

.key-row input:focus, .import-row input:focus {
  border-color: rgba(255, 255, 255, 0.2);
}

/* --- Modal Popup Dialog --- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: modalFadeIn 0.3s ease;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
}

.modal-content {
  position: relative;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  border-radius: 24px;
  width: 90%;
  max-width: 580px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 10;
  animation: modalSlideUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gold);
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s ease;
}

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

.modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-game-info {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-info-row span {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

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

.modal-cards .card {
  width: 44px;
  height: 60px;
  border-radius: 6px;
  padding: 4px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.modal-cards .card .rank {
  font-size: 1rem;
}

.modal-cards .card .suit {
  font-size: 0.95rem;
}

.modal-cards .card.back::after {
  font-size: 0.7rem;
  letter-spacing: 0px;
}

.modal-cards .muted-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

.modal-log-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 4px;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalSlideUp {
  from { transform: translateY(20px) scale(0.95); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

/* Real-time Hand Strength Badge */
.hand-strength-badge {
  display: inline-block;
  background: rgba(14, 165, 233, 0.2);
  border: 1px solid rgba(14, 165, 233, 0.55);
  color: #38bdf8;
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 0.98rem;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  margin: 6px 0 2px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.18);
  animation: fadeIn 0.25s ease-out;
}

/* Rabbit Hunt Button and Card Styles */
.rabbit-btn {
  background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%) !important;
  color: white;
  box-shadow: 0 4px 10px rgba(124, 58, 237, 0.35);
  margin-top: 8px;
  animation: fadeIn 0.3s ease;
}

.rabbit-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #b55fe6 0%, #8b4ced 100%) !important;
  box-shadow: 0 6px 14px rgba(124, 58, 237, 0.45);
}

.card.rabbit {
  opacity: 0.65;
  border: 2px dashed #a855f7 !important;
  box-shadow: 0 4px 10px rgba(168, 85, 247, 0.2) !important;
  transform: translateY(-2px);
  animation: rabbitPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes rabbitPop {
  0% { transform: scale(0.6) translateY(20px); opacity: 0; }
  100% { transform: scale(1) translateY(-2px); opacity: 0.65; }
}

.hand-over-buttons {
  display: flex;
  gap: 10px;
  width: 100%;
  margin-top: 8px;
}

.hand-over-buttons .btn {
  flex: 1;
  margin-top: 0 !important;
}

/* Overlapping 3D Poker Chips Pile for Pot */
.pot-chips {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 6px;
  height: 24px;
}

.poker-chip {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.2px dashed rgba(255, 255, 255, 0.65);
  box-shadow: 0 3px 5px rgba(0,0,0,0.5), inset 0 0 3px rgba(0,0,0,0.6);
  display: inline-block;
  margin: 0 -3px; /* slight horizontal overlap */
  position: relative;
  transition: all 0.3s ease;
}

.poker-chip.red {
  background: radial-gradient(circle, #f43f5e 50%, #be123c 100%);
  transform: rotate(-12deg) translateY(2px);
  z-index: 3;
}

.poker-chip.blue {
  background: radial-gradient(circle, #3b82f6 50%, #1d4ed8 100%);
  transform: rotate(6deg) translateY(-2px);
  z-index: 2;
}

.poker-chip.green {
  background: radial-gradient(circle, #10b981 50%, #047857 100%);
  transform: rotate(-6deg) translateY(1px);
  z-index: 1;
}

/* Pot Size text update pulse */
@keyframes potPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); color: var(--gold); text-shadow: 0 0 10px rgba(245, 158, 11, 0.4); }
  100% { transform: scale(1); }
}

.pot-pulse {
  display: inline-block;
  animation: potPulse 0.4s ease-out;
}

/* Chip Collecting Animations */
@keyframes gtoCollect {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(140px) scale(0.5); opacity: 0; }
}

@keyframes heroCollect {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(-140px) scale(0.5); opacity: 0; }
}

.collecting-gto {
  animation: gtoCollect 0.6s cubic-bezier(0.25, 1, 0.5, 1) forwards !important;
  pointer-events: none;
}

.collecting-hero {
  animation: heroCollect 0.6s cubic-bezier(0.25, 1, 0.5, 1) forwards !important;
  pointer-events: none;
}


