/* ===== CSS VARIABLES ===== */
:root {
  --bg: #020617;
  --bg2: #0a0f1e;
  --bg3: #0f1729;
  --card: #0d1525;
  --card-border: #1e2d4a;
  --neon-blue: #00d4ff;
  --neon-purple: #a855f7;
  --neon-pink: #ff2d78;
  --neon-green: #00ff9d;
  --gold: #ffd700;
  --text: #e2e8f0;
  --text-muted: #64748b;
  --glow-blue: 0 0 20px #00d4ff55, 0 0 40px #00d4ff22;
  --glow-purple: 0 0 20px #a855f755, 0 0 40px #a855f722;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Rajdhani', sans-serif;
  font-size: 16px;
  overflow-x: hidden;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--neon-blue); border-radius: 3px; }

/* ===== NAVBAR ===== */
.navbar {
  position: fixed; top: 0; width: 100%; z-index: 100;
  background: rgba(2,6,23,0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--card-border);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1.5rem;
}
.logo {
  font-family: 'Orbitron', monospace; font-weight: 900;
  font-size: 1.4rem; color: var(--neon-blue);
  text-decoration: none; letter-spacing: 2px;
}
.logo span { color: var(--neon-purple); }
.nav-right { display: flex; align-items: center; gap: 1rem; }
.coins-display {
  background: linear-gradient(135deg, #1a2540, #0d1525);
  border: 1px solid var(--gold);
  border-radius: 20px; padding: 0.35rem 0.9rem;
  font-family: 'Orbitron', monospace; font-size: 0.85rem;
  color: var(--gold); display: flex; align-items: center; gap: 0.4rem;
}
.user-badge {
  font-size: 0.8rem; color: var(--text-muted);
  font-family: 'Orbitron', monospace;
}
.btn-login {
  background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
  border: none; border-radius: 20px; padding: 0.4rem 1.2rem;
  color: #fff; font-family: 'Rajdhani', sans-serif;
  font-weight: 600; font-size: 0.9rem; cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
}
.btn-login:hover { opacity: 0.85; transform: translateY(-1px); }

/* ===== HERO ===== */
.hero {
  min-height: 100vh; display: flex; align-items: center;
  position: relative; overflow: hidden;
  padding: 6rem 1.5rem 3rem;
}
.hero-bg {
  position: absolute; inset: 0;
  background: 
    radial-gradient(ellipse 80% 60% at 20% 50%, #0a1a4055 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 30%, #1a0a4055 0%, transparent 60%),
    radial-gradient(ellipse 40% 60% at 50% 80%, #001a3055 0%, transparent 60%);
  animation: bgPulse 8s ease-in-out infinite alternate;
}
@keyframes bgPulse {
  0% { opacity: 0.6; }
  100% { opacity: 1; }
}
.hero-content {
  position: relative; z-index: 2;
  max-width: 600px; margin: 0 auto;
  text-align: center;
}
.hero-tag {
  display: inline-block;
  background: rgba(168,85,247,0.15);
  border: 1px solid var(--neon-purple);
  border-radius: 20px; padding: 0.3rem 1rem;
  font-size: 0.8rem; letter-spacing: 1px;
  color: var(--neon-purple); margin-bottom: 1.5rem;
  animation: fadeInUp 0.6s ease both;
}
.hero-title {
  font-family: 'Orbitron', monospace; font-weight: 900;
  font-size: clamp(2.5rem, 8vw, 5rem);
  line-height: 1.05; margin-bottom: 1rem;
  animation: fadeInUp 0.6s 0.1s ease both;
}
.hero-title .glow {
  color: var(--neon-blue);
  text-shadow: var(--glow-blue);
}
.hero-sub {
  color: var(--text-muted); font-size: 1.1rem;
  margin-bottom: 2rem; line-height: 1.6;
  animation: fadeInUp 0.6s 0.2s ease both;
}
.hero-ctas {
  display: flex; gap: 1rem; justify-content: center;
  margin-bottom: 3rem;
  animation: fadeInUp 0.6s 0.3s ease both;
}
.btn-primary {
  background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
  border: none; border-radius: 8px; padding: 0.8rem 2rem;
  color: #fff; font-family: 'Orbitron', monospace;
  font-size: 0.85rem; font-weight: 700;
  cursor: pointer; text-decoration: none;
  display: inline-block; letter-spacing: 1px;
  transition: all 0.2s;
  box-shadow: 0 0 20px #00d4ff44;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px #00d4ff77;
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--card-border);
  border-radius: 8px; padding: 0.8rem 2rem;
  color: var(--text); font-family: 'Orbitron', monospace;
  font-size: 0.85rem; font-weight: 700;
  cursor: pointer; text-decoration: none;
  display: inline-block; letter-spacing: 1px;
  transition: all 0.2s;
}
.btn-ghost:hover {
  border-color: var(--neon-blue);
  color: var(--neon-blue);
  transform: translateY(-2px);
}
.hero-stats {
  display: flex; gap: 2rem; justify-content: center;
  animation: fadeInUp 0.6s 0.4s ease both;
}
.stat { text-align: center; }
.stat-num {
  display: block; font-family: 'Orbitron', monospace;
  font-size: 1.6rem; font-weight: 900; color: var(--neon-blue);
  text-shadow: var(--glow-blue);
}
.stat-label { font-size: 0.75rem; color: var(--text-muted); letter-spacing: 1px; }
.hero-visual {
  position: absolute; right: 5%; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 1rem;
  z-index: 1;
}
.floating-card {
  width: 70px; height: 70px;
  background: linear-gradient(135deg, var(--card), var(--bg3));
  border: 1px solid var(--card-border);
  border-radius: 16px; display: flex;
  align-items: center; justify-content: center;
  font-size: 2rem;
  animation: float 3s var(--d, 0s) ease-in-out infinite alternate;
  box-shadow: 0 0 20px #00d4ff22;
}
@keyframes float {
  0% { transform: translateY(0) rotate(-3deg); }
  100% { transform: translateY(-12px) rotate(3deg); }
}

/* ===== TICKER ===== */
.ticker-bar {
  background: linear-gradient(90deg, var(--bg2), var(--bg3));
  border-top: 1px solid var(--card-border);
  border-bottom: 1px solid var(--card-border);
  padding: 0.6rem 0; display: flex; align-items: center;
  overflow: hidden; gap: 1rem;
}
.ticker-label {
  font-family: 'Orbitron', monospace; font-size: 0.7rem;
  color: var(--neon-pink); letter-spacing: 2px;
  padding: 0 1.5rem; white-space: nowrap;
  background: rgba(255,45,120,0.1); border-right: 1px solid var(--neon-pink);
  padding: 0.4rem 1rem;
}
.ticker-track {
  display: flex; gap: 4rem;
  animation: ticker 25s linear infinite;
  white-space: nowrap;
}
.ticker-track span {
  font-size: 0.85rem; color: var(--text-muted);
}
@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ===== SECTIONS ===== */
.section {
  max-width: 1200px; margin: 0 auto;
  padding: 4rem 1.5rem;
}
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 2rem;
}
.section-header h2 {
  font-family: 'Orbitron', monospace; font-size: 1.4rem;
  font-weight: 700; color: var(--text);
}
.see-all {
  color: var(--neon-blue); text-decoration: none;
  font-size: 0.85rem; letter-spacing: 1px;
  transition: color 0.2s;
}
.see-all:hover { color: var(--neon-purple); }

/* ===== GAMES GRID ===== */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
.game-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px; overflow: hidden;
  text-decoration: none; color: var(--text);
  position: relative; cursor: pointer;
  transition: all 0.3s;
  display: block;
}
.game-card:hover {
  border-color: var(--neon-blue);
  transform: translateY(-4px);
  box-shadow: 0 0 30px #00d4ff22;
}
.game-card:hover .play-overlay { opacity: 1; }
.game-thumb {
  height: 160px; display: flex; align-items: center;
  justify-content: center; font-size: 4rem;
  position: relative; overflow: hidden;
}
.slots-thumb { background: linear-gradient(135deg, #1a0a40, #2d1260); }
.plinko-thumb { background: linear-gradient(135deg, #001a30, #003060); }
.dice-thumb { background: linear-gradient(135deg, #0a1a00, #1a3a00); }
.card-thumb { background: linear-gradient(135deg, #1a0010, #3a0025); }
.wheel-thumb { background: linear-gradient(135deg, #1a1000, #3a2a00); }
.crash-thumb { background: linear-gradient(135deg, #1a0500, #3a1500); }
.game-info { padding: 1rem 1.25rem 1.25rem; }
.game-info h3 {
  font-family: 'Orbitron', monospace; font-size: 1rem;
  font-weight: 700; margin-bottom: 0.3rem;
}
.game-info p { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 0.75rem; }
.game-meta { display: flex; align-items: center; justify-content: space-between; }
.badge {
  font-size: 0.7rem; padding: 0.2rem 0.6rem;
  border-radius: 20px; background: rgba(255,255,255,0.08);
  border: 1px solid var(--card-border);
}
.badge.hot { background: rgba(255,45,120,0.15); border-color: var(--neon-pink); color: var(--neon-pink); }
.badge.new { background: rgba(0,255,157,0.1); border-color: var(--neon-green); color: var(--neon-green); }
.xp { font-size: 0.75rem; color: var(--neon-blue); font-family: 'Orbitron', monospace; }
.play-overlay {
  position: absolute; inset: 0;
  background: rgba(0,212,255,0.12);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Orbitron', monospace; font-size: 1.2rem;
  font-weight: 900; color: var(--neon-blue);
  opacity: 0; transition: opacity 0.3s;
  letter-spacing: 3px;
  text-shadow: var(--glow-blue);
}

/* ===== LEADERBOARD PREVIEW ===== */
.leaderboard-preview { background: transparent; }
.lb-list { display: flex; flex-direction: column; gap: 0.75rem; }
.lb-item {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px; padding: 1rem 1.25rem;
  display: flex; align-items: center; gap: 1rem;
  transition: border-color 0.2s;
}
.lb-item:hover { border-color: var(--neon-blue); }
.lb-rank {
  font-family: 'Orbitron', monospace; font-weight: 900;
  font-size: 1.1rem; width: 2rem; text-align: center;
}
.lb-rank.gold { color: var(--gold); text-shadow: 0 0 10px var(--gold); }
.lb-rank.silver { color: #c0c0c0; }
.lb-rank.bronze { color: #cd7f32; }
.lb-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.lb-name { flex: 1; font-weight: 600; font-size: 1rem; }
.lb-score {
  font-family: 'Orbitron', monospace; font-size: 0.85rem;
  color: var(--gold);
}

/* ===== DAILY BANNER ===== */
.daily-banner {
  background: linear-gradient(135deg, #0a1525, #151030);
  border-top: 1px solid #a855f733;
  border-bottom: 1px solid #a855f733;
  padding: 2.5rem 1.5rem;
}
.daily-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 2rem; flex-wrap: wrap;
}
.daily-left h3 {
  font-family: 'Orbitron', monospace; font-size: 1.2rem;
  margin-bottom: 0.4rem;
}
.daily-left p { color: var(--text-muted); }

/* ===== FOOTER ===== */
.footer {
  background: var(--bg2);
  border-top: 1px solid var(--card-border);
  padding: 2rem 1.5rem; text-align: center;
}
.footer-inner { max-width: 1200px; margin: 0 auto; }
.footer .logo { font-size: 1.2rem; margin-bottom: 0.75rem; display: block; text-decoration: none; }
.footer p { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 0.4rem; }
.footer-small { font-size: 0.75rem; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 20px; padding: 2rem;
  width: 90%; max-width: 400px;
  position: relative;
  animation: modalIn 0.3s ease;
}
@keyframes modalIn {
  from { transform: scale(0.9) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}
.modal h2 {
  font-family: 'Orbitron', monospace; margin-bottom: 0.5rem;
  color: var(--neon-blue);
}
.modal p { color: var(--text-muted); margin-bottom: 1.5rem; }
.modal-close {
  position: absolute; top: 1rem; right: 1rem;
  background: none; border: none; color: var(--text-muted);
  font-size: 1.2rem; cursor: pointer;
}
.btn-social {
  width: 100%; padding: 0.8rem;
  background: var(--bg3); border: 1px solid var(--card-border);
  border-radius: 8px; color: var(--text);
  font-family: 'Rajdhani', sans-serif; font-size: 1rem;
  cursor: pointer; margin-bottom: 0.75rem;
  transition: border-color 0.2s, background 0.2s;
}
.btn-social:hover { border-color: var(--neon-blue); background: #0a1525; }
.or-divider {
  text-align: center; color: var(--text-muted);
  font-size: 0.8rem; margin: 1rem 0;
  position: relative;
}
.or-divider::before, .or-divider::after {
  content: ''; position: absolute; top: 50%;
  width: 42%; height: 1px;
  background: var(--card-border);
}
.or-divider::before { left: 0; }
.or-divider::after { right: 0; }
.input-field {
  width: 100%; padding: 0.75rem 1rem;
  background: var(--bg); border: 1px solid var(--card-border);
  border-radius: 8px; color: var(--text);
  font-family: 'Rajdhani', sans-serif; font-size: 1rem;
  margin-bottom: 0.75rem;
  transition: border-color 0.2s;
}
.input-field:focus { outline: none; border-color: var(--neon-blue); }
.modal-note { font-size: 0.75rem; color: var(--text-muted); text-align: center; margin-top: 1rem; margin-bottom: 0; }

/* ===== GAME PAGE STYLES ===== */
.game-page {
  min-height: 100vh; padding: 5rem 1.5rem 2rem;
  max-width: 900px; margin: 0 auto;
}
.game-header { margin-bottom: 2rem; }
.game-header .back-link {
  color: var(--text-muted); text-decoration: none; font-size: 0.85rem;
  display: inline-flex; align-items: center; gap: 0.4rem;
  margin-bottom: 1rem; letter-spacing: 1px;
  transition: color 0.2s;
}
.game-header .back-link:hover { color: var(--neon-blue); }
.game-header h1 {
  font-family: 'Orbitron', monospace; font-size: clamp(1.5rem, 5vw, 2.5rem);
  font-weight: 900; color: var(--neon-blue);
  text-shadow: var(--glow-blue);
}
.game-layout {
  display: grid; grid-template-columns: 1fr 280px; gap: 2rem;
}
.game-arena {
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: 20px; padding: 2rem;
  display: flex; flex-direction: column; align-items: center;
  min-height: 450px;
}
.game-sidebar {
  display: flex; flex-direction: column; gap: 1rem;
}
.sidebar-card {
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: 16px; padding: 1.25rem;
}
.sidebar-card h3 {
  font-family: 'Orbitron', monospace; font-size: 0.85rem;
  color: var(--text-muted); margin-bottom: 1rem; letter-spacing: 1px;
}
.balance-big {
  font-family: 'Orbitron', monospace; font-size: 2rem;
  font-weight: 900; color: var(--gold);
  text-shadow: 0 0 15px #ffd70066;
}
.balance-label { font-size: 0.75rem; color: var(--text-muted); }
.bet-controls { display: flex; flex-direction: column; gap: 0.5rem; }
.bet-row { display: flex; gap: 0.5rem; }
.bet-btn {
  flex: 1; padding: 0.5rem;
  background: var(--bg3); border: 1px solid var(--card-border);
  border-radius: 8px; color: var(--text);
  font-family: 'Orbitron', monospace; font-size: 0.7rem;
  cursor: pointer; transition: all 0.2s;
}
.bet-btn:hover { border-color: var(--neon-blue); color: var(--neon-blue); }
.bet-input {
  width: 100%; padding: 0.6rem;
  background: var(--bg); border: 1px solid var(--card-border);
  border-radius: 8px; color: var(--gold);
  font-family: 'Orbitron', monospace; font-size: 1rem;
  text-align: center; margin-bottom: 0.5rem;
}
.bet-input:focus { outline: none; border-color: var(--gold); }
.btn-spin {
  width: 100%; padding: 1rem;
  background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
  border: none; border-radius: 12px;
  color: #fff; font-family: 'Orbitron', monospace;
  font-size: 1rem; font-weight: 700; cursor: pointer;
  letter-spacing: 2px; transition: all 0.2s;
  box-shadow: 0 0 20px #00d4ff44;
}
.btn-spin:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 0 30px #00d4ff88;
}
.btn-spin:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.history-list { display: flex; flex-direction: column; gap: 0.4rem; max-height: 200px; overflow-y: auto; }
.history-item {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.8rem; padding: 0.3rem 0;
  border-bottom: 1px solid var(--card-border);
}
.win-text { color: var(--neon-green); font-family: 'Orbitron', monospace; font-size: 0.75rem; }
.lose-text { color: var(--neon-pink); font-family: 'Orbitron', monospace; font-size: 0.75rem; }
.result-banner {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0);
  z-index: 300; text-align: center;
  pointer-events: none; transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.result-banner.show { transform: translate(-50%, -50%) scale(1); }
.result-banner .result-text {
  font-family: 'Orbitron', monospace; font-size: clamp(2rem, 8vw, 4rem);
  font-weight: 900;
}
.result-banner.win .result-text { color: var(--neon-green); text-shadow: 0 0 30px var(--neon-green); }
.result-banner.lose .result-text { color: var(--neon-pink); text-shadow: 0 0 30px var(--neon-pink); }
.result-banner .result-coins { font-family: 'Orbitron', monospace; font-size: 1.5rem; color: var(--gold); }
.demo-tag {
  display: inline-block; background: rgba(168,85,247,0.1);
  border: 1px solid var(--neon-purple); border-radius: 20px;
  padding: 0.25rem 0.75rem; font-size: 0.7rem; color: var(--neon-purple);
  letter-spacing: 1px; margin-bottom: 1rem;
}

/* ===== GAMES PAGE ===== */
.page-hero {
  padding: 6rem 1.5rem 3rem;
  text-align: center;
  background: linear-gradient(180deg, #0a1525 0%, transparent 100%);
}
.page-hero h1 {
  font-family: 'Orbitron', monospace; font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 900; margin-bottom: 0.75rem;
}
.page-hero p { color: var(--text-muted); font-size: 1.1rem; }
.filter-bar {
  display: flex; gap: 0.75rem; flex-wrap: wrap;
  justify-content: center; margin: 1.5rem 0 3rem;
}
.filter-btn {
  padding: 0.5rem 1.25rem;
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: 20px; color: var(--text-muted);
  font-family: 'Rajdhani', sans-serif; font-size: 0.9rem;
  cursor: pointer; transition: all 0.2s;
}
.filter-btn:hover, .filter-btn.active {
  border-color: var(--neon-blue); color: var(--neon-blue);
  background: rgba(0,212,255,0.08);
}

/* ===== LEADERBOARD PAGE ===== */
.leaderboard-table { width: 100%; }
.lb-header {
  display: grid; grid-template-columns: 60px 1fr 120px 120px 100px;
  gap: 1rem; padding: 0.75rem 1.25rem;
  font-size: 0.75rem; color: var(--text-muted);
  letter-spacing: 1px; font-family: 'Orbitron', monospace;
  border-bottom: 1px solid var(--card-border);
}
.lb-row {
  display: grid; grid-template-columns: 60px 1fr 120px 120px 100px;
  gap: 1rem; padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--card-border);
  align-items: center; transition: background 0.2s;
}
.lb-row:hover { background: rgba(0,212,255,0.04); }
.lb-row.top-1 { background: rgba(255,215,0,0.05); border-color: #ffd70033; }
.lb-row.top-2 { background: rgba(192,192,192,0.05); }
.lb-row.top-3 { background: rgba(205,127,50,0.05); }
.level-badge {
  display: inline-block; font-size: 0.7rem;
  background: rgba(168,85,247,0.15); border: 1px solid var(--neon-purple);
  border-radius: 4px; padding: 0.1rem 0.4rem;
  color: var(--neon-purple); font-family: 'Orbitron', monospace;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
.shake {
  animation: shake 0.4s ease;
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
.bounce {
  animation: bounce 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes bounce {
  0% { transform: scale(0.8); }
  100% { transform: scale(1); }
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {
  .hero-visual { display: none; }
  .hero-ctas { flex-direction: column; align-items: center; }
  .hero-stats { gap: 1rem; }
  .game-layout { grid-template-columns: 1fr; }
  .lb-header, .lb-row { grid-template-columns: 50px 1fr 100px; }
  .lb-header > *:nth-child(n+4), .lb-row > *:nth-child(n+4) { display: none; }
  .daily-inner { flex-direction: column; text-align: center; }
  .user-badge { display: none; }
}
