/* =============================================================================
   Degen Arena — Premium Casino Design System (High-Fidelity Web3 Style)
   ============================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Outfit:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* ── Variables & Color System ────────────────────────────────────────────────── */
:root {
  --bg-void:       #030308;
  --bg-base:       #070714;
  --bg-surface:    rgba(15, 15, 34, 0.45);
  --bg-raised:     rgba(25, 25, 55, 0.35);
  --bg-card:       rgba(20, 20, 45, 0.55);

  --neon-purple:   #8b5cf6;
  --neon-violet:   #a78bfa;
  --neon-pink:     #ff007f;
  --neon-cyan:     #00f0ff;
  --neon-green:    #39ff14;
  --neon-gold:     #ffd700;
  --neon-red:      #ff3333;

  --text-primary:  #f3f4f6;
  --text-secondary:#9ca3af;
  --text-gold:     #fbbf24;

  --border-subtle: rgba(139, 92, 246, 0.15);
  --border-glow:   rgba(139, 92, 246, 0.35);

  font-family: 'Space Grotesk', 'Outfit', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ── Reset & Ambient Background ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; scroll-behavior: smooth; }
body {
  min-height: 100%;
  background-color: var(--bg-void);
  background-image: 
    linear-gradient(rgba(10, 10, 26, 0.6) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10, 10, 26, 0.6) 1px, transparent 1px),
    radial-gradient(circle at 50% 15%, rgba(139, 92, 246, 0.15) 0%, transparent 60%),
    radial-gradient(circle at 80% 80%, rgba(0, 240, 255, 0.05) 0%, transparent 50%);
  background-size: 40px 40px, 40px 40px, 100% 100%, 100% 100%;
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* Moving grid background underlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(circle at center, transparent 20%, var(--bg-void) 90%);
  pointer-events: none;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { 
  background: linear-gradient(180deg, var(--neon-purple), var(--neon-pink)); 
  border-radius: 3px; 
}

/* ── Layout ───────────────────────────────────────────────────────────────── */
.container { width: 100%; max-width: 1400px; margin: 0 auto; padding: 0 1.5rem; }
.main-layout { padding-top: 2rem; padding-bottom: 4rem; }

/* ── Navbar ───────────────────────────────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(7, 7, 20, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(139, 92, 246, 0.25);
  padding: 1rem 0;
}
.nav-inner {
  display: flex; align-items: center; gap: 2rem;
}
.logo {
  display: flex; align-items: center; gap: 0.75rem;
}
.logo-icon { 
  font-size: 1.6rem; 
  filter: drop-shadow(0 0 8px var(--neon-pink));
  animation: logo-float 3s ease-in-out infinite; 
}
@keyframes logo-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-4px) rotate(8deg); }
}
.logo-text {
  font-weight: 800; font-size: 1.3rem; letter-spacing: -0.01em;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple), var(--neon-pink));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.3));
}
.nav-links { display: flex; gap: 0.5rem; }
.nav-link {
  padding: 0.5rem 1rem; border-radius: 0.75rem;
  font-size: 0.9rem; font-weight: 600; color: var(--text-secondary);
  transition: all 0.25s ease;
  border: 1px solid transparent;
}
.nav-link:hover, .nav-link.active {
  color: #fff;
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.25);
  text-shadow: 0 0 8px rgba(139, 92, 246, 0.6);
}
#wallet-btn { margin-left: auto; }

/* ── Buttons (Casino Neon Spark) ─────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.8rem 1.6rem; border-radius: 0.75rem;
  font-size: 0.95rem; font-weight: 700; border: none; outline: none;
  cursor: pointer; transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); 
  white-space: nowrap; text-decoration: none;
  letter-spacing: 0.03em;
  position: relative; overflow: hidden;
}
.btn::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}
.btn:hover::before { transform: translateX(100%); }

.btn-primary {
  background: linear-gradient(135deg, var(--neon-purple), #6d28d9); 
  color: white;
  border: 1px solid rgba(167, 139, 250, 0.4);
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.45);
}
.btn-primary:hover  { 
  transform: translateY(-2px); 
  box-shadow: 0 0 25px rgba(139, 92, 246, 0.75), inset 0 0 10px rgba(255, 255, 255, 0.2); 
}
.btn-primary:active { transform: translateY(0); }

.btn-gold {
  background: linear-gradient(135deg, #ffd700, #ff8c00); 
  color: #030308;
  font-weight: 800; 
  border: 1px solid rgba(255, 215, 0, 0.5);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.45);
}
.btn-gold:hover  { 
  transform: translateY(-2px); 
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.8), inset 0 0 8px rgba(255, 255, 255, 0.4); 
}
.btn-gold:active { transform: translateY(0); }

.btn-ghost {
  background: rgba(139, 92, 246, 0.05); 
  border: 1px solid var(--border-glow);
  color: var(--text-primary);
}
.btn-ghost:hover { 
  background: rgba(139, 92, 246, 0.15); 
  border-color: var(--neon-cyan);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.25);
}

.btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ── Badges ───────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.25rem 0.75rem; border-radius: 2rem;
  font-size: 0.725rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase;
}
.badge-purple { 
  background: rgba(139, 92, 246, 0.15); 
  color: #c4b5fd; 
  border: 1px solid rgba(139, 92, 246, 0.35); 
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.15);
}
.badge-gold   { 
  background: rgba(251, 191, 36, 0.15);  
  color: #fcd34d; 
  border: 1px solid rgba(251, 191, 36, 0.35); 
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.15);
}
.badge-green  { 
  background: rgba(57, 255, 20, 0.1);  
  color: #39ff14; 
  border: 1px solid rgba(57, 255, 20, 0.3); 
  box-shadow: 0 0 8px rgba(57, 255, 20, 0.15);
}
.badge-red    { 
  background: rgba(255, 51, 51, 0.1);   
  color: #ff6666; 
  border: 1px solid rgba(255, 51, 51, 0.3); 
  box-shadow: 0 0 8px rgba(255, 51, 51, 0.15);
}
.badge-demo   { 
  background: rgba(0, 240, 255, 0.1);   
  color: var(--neon-cyan); 
  border: 1px solid rgba(0, 240, 255, 0.3); 
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.15);
}

/* ── Card (Glassmorphism Overhaul) ────────────────────────────────────────── */
.card {
  background: rgba(18, 18, 43, 0.55);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid rgba(139, 92, 246, 0.18);
  border-radius: 1.25rem; padding: 1.5rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.card:hover { 
  border-color: rgba(139, 92, 246, 0.45); 
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.15), 0 15px 50px rgba(0, 0, 0, 0.55);
  transform: translateY(-2px);
}

/* ── Input ────────────────────────────────────────────────────────────────── */
.input {
  width: 100%;
  background: rgba(7, 7, 20, 0.6); 
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 0.875rem; padding: 0.9rem 3.5rem 0.9rem 1.25rem;
  color: var(--text-primary); font-size: 1.1rem; outline: none;
  transition: all 0.2s ease;
  font-family: 'JetBrains Mono', monospace;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.5);
}
.input:focus { 
  border-color: var(--neon-cyan); 
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.25), inset 0 2px 8px rgba(0,0,0,0.5); 
}
.input::placeholder { color: var(--text-secondary); }

/* ── Mega Pot Alert ───────────────────────────────────────────────────────── */
.mega-pot-alert {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: linear-gradient(90deg, #7f1d1d, #991b1b, #7f1d1d);
  border-bottom: 2px solid #ef4444;
  padding: 0.6rem 1rem; text-align: center;
  font-weight: 800; font-size: 1rem; letter-spacing: 0.08em;
  color: #fef2f2; text-shadow: 0 0 10px rgba(239,68,68,0.8);
  animation: alert-pulse 1s ease-in-out infinite;
}
@keyframes alert-pulse { 0%,100% { opacity:1; } 50% { opacity:0.85; } }

/* ── Controls row ─────────────────────────────────────────────────────────── */
.controls-row {
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: center;
  margin-bottom: 1.5rem;
}
.room-selector { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.room-btn.active { background: linear-gradient(135deg,#7c3aed,#5b21b6); }

/* ── Mode toggle ──────────────────────────────────────────────────────────── */
.mode-toggle {
  display: flex; background: var(--bg-raised);
  border: 1px solid var(--border-subtle); border-radius: 0.75rem;
  padding: 0.25rem; gap: 0.25rem; margin-left: auto;
}
.mode-toggle button {
  flex: 1; padding: 0.45rem 1rem; border-radius: 0.5rem;
  font-size: 0.875rem; font-weight: 600;
  background: transparent; border: none; color: var(--text-secondary);
  transition: all 0.15s;
}
.mode-toggle button.active {
  background: linear-gradient(135deg,rgba(124,58,237,0.3),rgba(91,33,182,0.4));
  color: white; box-shadow: 0 0 14px rgba(124,58,237,0.2);
}
.mode-toggle.demo-active button.active {
  background: linear-gradient(135deg,rgba(6,182,212,0.3),rgba(8,145,178,0.4));
  color: #22d3ee;
}

/* ── Arena grid ───────────────────────────────────────────────────────────── */
.arena-grid {
  display: grid;
  grid-template-columns: 1fr minmax(280px,360px);
  gap: 1.5rem; align-items: start;
}
.arena-left  { display: flex; flex-direction: column; gap: 1rem; align-items: center; }
.arena-right { display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 5rem; }

/* ── Status bar ───────────────────────────────────────────────────────────── */
.status-bar { width: 100%; display: flex; align-items: center; gap: 0.75rem; }
.ws-status  { font-size: 0.75rem; color: var(--text-secondary); margin-left: auto; }

/* ── Arena ring & pie ─────────────────────────────────────────────────────── */
.arena-wrapper { border-radius: 50%; padding: 0.5rem; transition: all 0.5s ease; }
.arena-ring    { position: relative; border-radius: 50%; }
#pie-canvas    { display: block; }

.pie-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  pointer-events: none;
}
.pie-label   { font-size: 0.65rem; color: var(--text-secondary); letter-spacing: 0.1em; }
.pie-amount  {
  font-size: 1.25rem; font-weight: 700; color: var(--text-gold);
  font-family: 'JetBrains Mono', monospace;
  text-shadow: 0 0 18px rgba(245,158,11,0.6);
}
.pie-players { font-size: 0.65rem; color: var(--text-secondary); margin-top: 2px; }

/* Pool level ring animations */
.arena-level-0 .arena-ring { border: 3px solid rgba(80,60,160,0.3); box-shadow: 0 0 18px rgba(80,60,160,0.08); }
.arena-level-1 .arena-ring { border: 3px solid rgba(124,58,237,0.8); animation: pulse1 2s ease-in-out infinite; }
@keyframes pulse1 {
  0%,100% { box-shadow: 0 0 30px rgba(124,58,237,0.35), 0 0 60px rgba(124,58,237,0.1); }
  50%      { box-shadow: 0 0 60px rgba(124,58,237,0.7), 0 0 120px rgba(124,58,237,0.3); }
}
.arena-level-2 .arena-ring { border: 3px solid rgba(245,158,11,0.9); animation: pulse2 1.5s ease-in-out infinite; }
@keyframes pulse2 {
  0%,100% { box-shadow: 0 0 40px rgba(245,158,11,0.4), 0 0 80px rgba(245,158,11,0.15); }
  50%      { box-shadow: 0 0 80px rgba(245,158,11,0.8), 0 0 150px rgba(245,158,11,0.35); }
}
.arena-level-3 .arena-ring { border: 4px solid rgba(239,68,68,1); animation: pulse3 0.8s ease-in-out infinite; }
@keyframes pulse3 {
  0%,100% { box-shadow: 0 0 50px rgba(239,68,68,0.6), 0 0 100px rgba(249,115,22,0.3); }
  50%      { box-shadow: 0 0 90px rgba(239,68,68,1.0), 0 0 180px rgba(249,115,22,0.6); }
}
.screen-shake { animation: shake 0.3s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes shake {
  10%,90%  { transform: translate3d(-2px,0,0); }
  20%,80%  { transform: translate3d(4px,0,0); }
  30%,50%,70% { transform: translate3d(-4px,0,0); }
  40%,60%  { transform: translate3d(4px,0,0); }
}

/* ── Timer ────────────────────────────────────────────────────────────────── */
.timer-section { width: 100%; max-width: 360px; }
.timer-header  { display: flex; justify-content: space-between; margin-bottom: 0.375rem; font-size: 0.75rem; }
.timer-label   { color: var(--text-secondary); }
.timer-countdown { font-family: 'JetBrains Mono', monospace; font-weight: 700; transition: color 0.3s; }
.timer-countdown.urgent { color: var(--neon-red); }
.timer-bar-bg  { height: 6px; background: rgba(80,60,160,0.2); border-radius: 3px; overflow: hidden; }
.timer-bar-fill {
  height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, #7c3aed, #ec4899);
  transition: width 1s linear;
}
.timer-bar-fill.urgent { background: linear-gradient(90deg, #ef4444, #f97316); }

/* ── Player list ──────────────────────────────────────────────────────────── */
.player-card { width: 100%; max-width: 420px; padding: 1rem; }
.player-card-header { font-size: 0.75rem; font-weight: 700; color: var(--text-secondary); letter-spacing: 0.06em; margin-bottom: 0.75rem; }
.player-list { display: flex; flex-direction: column; gap: 0.375rem; }
.empty-msg   { color: var(--text-secondary); font-size: 0.8rem; text-align: center; padding: 1rem 0; }

.player-row {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.55rem 0.75rem; border-radius: 0.5rem;
  border: 1px solid transparent;
  transition: background 0.15s;
}
.player-row:hover { background: rgba(124,58,237,0.07); }
.player-row.is-me {
  background: rgba(124,58,237,0.08);
  border-color: rgba(124,58,237,0.2);
}
.player-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700; font-family: 'JetBrains Mono', monospace;
}
.player-info { flex: 1; min-width: 0; }
.player-name { font-size: 0.8rem; font-family: monospace; font-weight: 500; display: flex; align-items: center; gap: 0.375rem; }
.player-bar-bg  { margin-top: 3px; height: 3px; background: rgba(255,255,255,0.05); border-radius: 2px; }
.player-bar-fill { height: 100%; border-radius: 2px; opacity: 0.7; transition: width 0.5s ease; }
.player-amounts { text-align: right; flex-shrink: 0; }
.player-sol { font-size: 0.825rem; font-weight: 700; font-family: monospace; }
.player-pct { font-size: 0.65rem; color: var(--text-secondary); }

/* ── Bet panel ────────────────────────────────────────────────────────────── */
.bet-panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.bet-panel-header h2 { font-size: 1rem; font-weight: 700; }
.quick-amounts { display: flex; gap: 0.375rem; flex-wrap: wrap; margin-bottom: 0.875rem; }
.quick-btn { padding: 0.375rem 0.75rem; font-size: 0.8rem; flex: 1 0 auto; }
.input-wrap { position: relative; margin-bottom: 0.5rem; }
.input-suffix {
  position: absolute; right: 1rem; top: 50%; transform: translateY(-50%);
  color: var(--text-secondary); font-family: 'JetBrains Mono', monospace; font-size: 0.875rem;
}
.lamport-preview { font-size: 0.75rem; color: var(--text-secondary); font-family: monospace; margin-bottom: 0.5rem; }
.bet-feedback {
  padding: 0.5rem 0.75rem; border-radius: 0.5rem; font-size: 0.8rem;
  margin-bottom: 0.75rem;
  animation: fade-in 0.2s ease;
}
@keyframes fade-in { from { opacity:0; transform: translateY(-4px); } to { opacity:1; transform: none; } }
.bet-feedback.error   { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: #f87171; }
.bet-feedback.success { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.3); color: #34d399; }
.bet-cta    { width: 100%; font-size: 1rem; padding: 0.875rem; margin-top: 0.5rem; }
.connect-hint { font-size: 0.75rem; color: var(--text-secondary); text-align: center; margin-top: 0.5rem; }

/* ── Rain / Jackpot widgets ───────────────────────────────────────────────── */
.rain-widget {
  background: linear-gradient(135deg, rgba(6,182,212,0.08), rgba(8,145,178,0.04));
  border: 1px solid rgba(6,182,212,0.2); border-radius: 0.875rem; padding: 1rem 1.25rem;
}
.jackpot-widget {
  background: linear-gradient(135deg, rgba(245,158,11,0.08), rgba(217,119,6,0.04));
  border: 1px solid rgba(245,158,11,0.2); border-radius: 0.875rem; padding: 1rem 1.25rem;
}
.widget-row    { display: flex; justify-content: space-between; align-items: flex-start; }
.widget-label  { font-size: 0.65rem; color: var(--text-secondary); letter-spacing: 0.08em; margin-bottom: 0.2rem; }
.widget-amount { font-size: 1.05rem; font-weight: 700; font-family: 'JetBrains Mono', monospace; }
.widget-timer-col { text-align: right; }
.widget-sub    { font-size: 0.65rem; color: var(--text-secondary); margin-bottom: 0.2rem; }
.widget-countdown { font-family: 'JetBrains Mono', monospace; font-size: 1.05rem; font-weight: 700; letter-spacing: 0.05em; }

/* ── Pool level card ──────────────────────────────────────────────────────── */
.pool-level-card { padding: 0.875rem 1rem; }
.pool-level-bars { display: flex; gap: 0.5rem; margin: 0.5rem 0 0.4rem; }
.pool-bar { flex: 1; height: 6px; border-radius: 3px; background: rgba(255,255,255,0.06); transition: all 0.4s ease; }
.pool-bar.active-0 { background: #503080; }
.pool-bar.active-1 { background: #7c3aed; box-shadow: 0 0 8px #7c3aed; }
.pool-bar.active-2 { background: #f59e0b; box-shadow: 0 0 8px #f59e0b; }
.pool-bar.active-3 { background: #ef4444; box-shadow: 0 0 8px #ef4444; }
.pool-level-label { font-size: 0.7rem; color: var(--text-secondary); }

/* ── Particle canvas ──────────────────────────────────────────────────────── */
#particle-canvas {
  position: fixed; bottom: 0; left: 0; width: 100%; height: 60vh;
  pointer-events: none; z-index: 5; opacity: 0; transition: opacity 0.8s ease;
}
#particle-canvas.active { opacity: 1; }

/* ── Spin overlay ─────────────────────────────────────────────────────────── */
.spin-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(5,5,15,0.92); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  animation: fade-in 0.25s ease;
}
.overlay-content { text-align: center; padding: 2rem; max-width: 460px; }
.overlay-spinner { font-size: 5rem; display: inline-block; animation: spin-fast 1.2s linear infinite; }
@keyframes spin-fast { to { transform: rotate(360deg); } }
.overlay-spinner.done { animation: pop 0.4s ease; }
@keyframes pop { 0% { transform: scale(0.5); opacity:0; } 100% { transform: scale(1); opacity:1; } }
.overlay-title  { font-size: 1.5rem; font-weight: 800; margin-top: 0.75rem; color: var(--text-primary); }
.overlay-wallet { font-size: 0.85rem; font-family: monospace; color: var(--text-secondary); margin-top: 0.25rem; }
.overlay-amount { font-size: 1.75rem; font-weight: 800; color: #fbbf24; margin-top: 0.25rem; text-shadow: 0 0 20px rgba(245,158,11,0.6); }
.overlay-tx-link { font-size: 0.75rem; color: var(--neon-cyan); display: block; margin-top: 0.75rem; }
.overlay-seed   { font-size: 0.6rem; color: var(--text-secondary); font-family: monospace; margin-top: 0.5rem; word-break: break-all; }
.overlay-winner { color: #fbbf24; }

/* ── Leaderboard page specifics ───────────────────────────────────────────── */
.page-header { padding: 2rem 0 1.5rem; }
.page-header h1 { font-size: 2rem; margin-bottom: 0.25rem; }
.page-header p  { color: var(--text-secondary); }
.tab-bar { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; }
.lb-table-wrap { border-radius: 1rem; overflow: hidden; border: 1px solid var(--border-subtle); }
.lb-table { width: 100%; border-collapse: collapse; }
.lb-table thead tr { background: var(--bg-raised); font-size: 0.75rem; color: var(--text-secondary); letter-spacing: 0.06em; }
.lb-table th, .lb-table td { padding: 0.875rem 1rem; text-align: left; }
.lb-table th:last-child, .lb-table td:last-child { text-align: right; }
.lb-table tbody tr { border-top: 1px solid var(--border-subtle); transition: background 0.15s; }
.lb-table tbody tr:hover { background: rgba(124,58,237,0.05); }
.lb-rank { font-weight: 700; }
.lb-empty { text-align: center; padding: 3rem; color: var(--text-secondary); }
.promo-badge { padding: 0.2rem 0.6rem; border-radius: 2rem; font-size: 0.75rem; font-weight: 600; }
.promo-rain    { background: rgba(6,182,212,0.2); color: #22d3ee; border: 1px solid rgba(6,182,212,0.3); }
.promo-jackpot { background: rgba(245,158,11,0.2); color: #fbbf24; border: 1px solid rgba(245,158,11,0.3); }

/* ── Spinner (loading) ────────────────────────────────────────────────────── */
.loading { text-align: center; padding: 3rem; color: var(--text-secondary); }
.spinner-icon { display: inline-block; animation: spin-fast 0.8s linear infinite; font-size: 1.5rem; }

/* ── SVG Animations & Design System Upgrades ─────────────────────────────── */
.pie-center-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform-origin: center;
  pointer-events: none;
  opacity: 0.2;
  transition: opacity 0.5s ease;
  animation: svg-spin 20s linear infinite;
}
.arena-level-1 .pie-center-svg { opacity: 0.5; }
.arena-level-2 .pie-center-svg { opacity: 0.8; }
.arena-level-3 .pie-center-svg { opacity: 1.0; }

.pie-center-svg circle {
  fill: none;
  stroke-width: 2px;
}
.pie-center-svg circle.track-ring {
  stroke: rgba(124, 58, 237, 0.08);
}
.pie-center-svg circle.glow-ring {
  stroke: url(#neon-grad);
  stroke-dasharray: 20 10 40 10;
  filter: drop-shadow(0 0 3px rgba(124, 58, 237, 0.5));
}

@keyframes svg-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Spin overlay SVG upgrade */
.overlay-spinner-wrapper {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 0 auto 1.5rem;
}
.svg-arena-spinner {
  width: 100%;
  height: 100%;
}
.svg-arena-spinner circle {
  fill: none;
  stroke-width: 3px;
}
.svg-arena-spinner circle.spinner-track {
  stroke: rgba(255, 255, 255, 0.05);
}
.svg-arena-spinner circle.spinner-dash {
  stroke: url(#neon-grad);
  stroke-dasharray: 60 120;
  stroke-linecap: round;
  transform-origin: center;
  animation: spin-fast 1.5s cubic-bezier(0.4, 0.1, 0.2, 1) infinite;
  filter: drop-shadow(0 0 5px #7c3aed);
}
.spinning-hash {
  transform-origin: center;
  animation: spin-fast 2.5s linear infinite;
}

/* Glassmorphism card enhancements */
.card {
  background: rgba(15, 15, 34, 0.6);
  border: 1px solid rgba(120, 80, 255, 0.15);
  backdrop-filter: blur(24px) saturate(120%);
  -webkit-backdrop-filter: blur(24px) saturate(120%);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.card:hover {
  border-color: rgba(124, 58, 237, 0.5);
  box-shadow: 0 12px 40px 0 rgba(124, 58, 237, 0.15);
  transform: translateY(-2px);
}

/* ── Three Column Dashboard Layout ── */
.three-column-grid {
  display: grid;
  grid-template-columns: 280px 1fr 300px;
  gap: 1.5rem;
  align-items: start;
}

/* Sidebar styling */
.sidebar-left, .sidebar-right {
  position: sticky;
  top: 5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.sidebar-card {
  padding: 1.25rem;
}
.sidebar-header h3 {
  font-size: 0.825rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.5rem;
}

/* Room selector vertical */
.room-selector-vertical {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.lobby-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.2s ease;
}
.lobby-item:hover {
  background: rgba(124, 58, 237, 0.08);
  border-color: rgba(124, 58, 237, 0.3);
}
.lobby-item.active {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(236, 72, 153, 0.15));
  border-color: var(--neon-purple);
  box-shadow: 0 0 14px rgba(124, 58, 237, 0.25);
}
.lobby-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.lobby-icon-badge {
  font-size: 1.1rem;
}
.lobby-title-text {
  font-size: 0.875rem;
  font-weight: 700;
}
.lobby-status {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.lobby-players-count {
  font-size: 0.7rem;
  color: var(--text-secondary);
}
.lobby-pot-value {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-gold);
  font-family: 'JetBrains Mono', monospace;
}
.lobby-lock {
  font-size: 0.75rem;
  opacity: 0.6;
}
.mode-toggle-wrapper {
  margin-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1rem;
}

/* Center Column Styling */
.center-column {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Section Title */
.section-title {
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}
.section-title.text-center {
  text-align: center;
}

/* Giveaways: розіграші */
.giveaways-section {
  padding: 1.25rem;
}
.giveaways-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.giveaway-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: 0.75rem;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.giveaway-box:hover {
  border-color: rgba(124, 58, 237, 0.25);
  background: rgba(255, 255, 255, 0.03);
}
.giveaway-header {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}
.giveaway-amount-wrapper {
  margin-bottom: 0.5rem;
}
.giveaway-amount {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-gold);
  font-family: 'JetBrains Mono', monospace;
  text-shadow: 0 0 14px rgba(253, 186, 116, 0.3);
}
.giveaway-timer-wrapper {
  display: flex;
  gap: 0.25rem;
  font-size: 0.75rem;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}
.giveaway-timer-wrapper .widget-countdown {
  font-weight: 700;
  color: var(--text-primary);
}

/* Play panel: грати */
.play-section {
  padding: 1.5rem;
}
.play-layout-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
}
.play-chart-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--border-subtle);
  padding-right: 2rem;
}
.play-form-wrapper {
  display: flex;
  flex-direction: column;
}

/* Lobbies List (лоббі) */
.lobbies-list-section {
  padding: 1.25rem;
}
.lobbies-vertical-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.lobby-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.25rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.2s ease;
}
.lobby-row:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(124, 58, 237, 0.3);
}
.lobby-row.active {
  background: rgba(124, 58, 237, 0.04);
  border-color: rgba(124, 58, 237, 0.4);
}
.lobby-row-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.lobby-capacity {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.2rem 0.5rem;
  border-radius: 0.35rem;
}
.lobby-row.active .lobby-capacity {
  color: var(--text-primary);
  background: rgba(124, 58, 237, 0.2);
}
.lobby-row-name {
  font-size: 0.875rem;
  font-weight: 600;
}
.lobby-row-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 0.25rem;
}
.lobby-row-badge.public {
  background: rgba(16, 185, 129, 0.1);
  color: var(--neon-green);
}
.lobby-row-badge.private {
  background: rgba(239, 68, 68, 0.1);
  color: var(--neon-red);
}

/* Mini Leaderboard List */
.mini-leaderboard-container {
  display: flex;
  flex-direction: column;
}
.mini-lb-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.mini-lb-row:last-child {
  border-bottom: none;
}
.mini-lb-rank {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  width: 18px;
  color: var(--text-secondary);
}
.mini-lb-row:nth-child(1) .mini-lb-rank { color: #fbbf24; }
.mini-lb-row:nth-child(2) .mini-lb-rank { color: #cbd5e1; }
.mini-lb-row:nth-child(3) .mini-lb-rank { color: #cd7f32; }

.mini-lb-wallet {
  font-size: 0.8rem;
  font-family: monospace;
  flex: 1;
  color: var(--text-primary);
}
.mini-lb-won {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--neon-green);
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .three-column-grid {
    grid-template-columns: 1fr;
  }
  .sidebar-left, .sidebar-right {
    position: static;
  }
}
@media (max-width: 900px) {
  .play-layout-grid {
    grid-template-columns: 1fr;
  }
  .play-chart-wrapper {
    border-right: none;
    padding-right: 0;
    margin-bottom: 1.5rem;
  }
}
@media (max-width: 600px) {
  .container { padding: 0 1rem; }
  .nav-links { display: none; }
  .giveaways-row {
    grid-template-columns: 1fr;
  }
}
