/**
 * Divisha's Game Universe - Core Stylesheet
 * Cyber Cosmic Design System, Glassmorphism, Neon Glows & Responsive Layouts
 */

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

:root {
  --bg-space: #060714;
  --bg-surface: rgba(14, 17, 40, 0.7);
  --bg-card: rgba(18, 22, 54, 0.65);
  --bg-card-hover: rgba(26, 32, 78, 0.85);
  --border-neon: rgba(0, 240, 255, 0.25);
  --border-card: rgba(255, 255, 255, 0.08);

  --neon-cyan: #00f0ff;
  --neon-pink: #ff007f;
  --neon-purple: #9d4edd;
  --neon-amber: #ffb703;
  --neon-green: #00ff88;

  --text-primary: #ffffff;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --font-display: 'Orbitron', -apple-system, sans-serif;
  --font-body: 'Outfit', -apple-system, sans-serif;

  --glow-cyan: 0 0 18px rgba(0, 240, 255, 0.45);
  --glow-pink: 0 0 18px rgba(255, 0, 127, 0.45);
  --glow-purple: 0 0 20px rgba(157, 78, 221, 0.5);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
}

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

html, body {
  width: 100%;
  min-height: 100vh;
  background-color: var(--bg-space);
  color: var(--text-primary);
  font-family: var(--font-body);
  overflow-x: hidden;
  position: relative;
}

body.in-game {
  overflow: hidden;
}

/* Background Canvas Starfield */
#starfield-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
}

/* Nebula Gradient Glows */
.nebula-glow {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.25;
}

.nebula-1 {
  top: -150px;
  right: -100px;
  background: radial-gradient(circle, var(--neon-purple), transparent 70%);
}

.nebula-2 {
  bottom: -200px;
  left: -150px;
  background: radial-gradient(circle, var(--neon-cyan), transparent 70%);
}

/* App Container */
.universe-app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: 50px;
}

/* Header & Top Navigation Bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(6, 7, 20, 0.75);
  border-bottom: 1px solid var(--border-card);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  text-decoration: none;
}

.brand-icon-spin {
  font-size: 1.8rem;
  animation: cosmic-float 4s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 10px var(--neon-cyan));
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 1px;
  background: linear-gradient(135deg, #ffffff 0%, var(--neon-cyan) 50%, var(--neon-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--neon-cyan);
  box-shadow: var(--glow-cyan);
}

.icon-btn.active {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
}

.icon-btn.highlight-btn {
  background: rgba(0, 255, 200, 0.12);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  animation: pulse-glow 2.5s infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 5px rgba(0, 255, 200, 0.2); }
  50% { box-shadow: 0 0 15px rgba(0, 255, 200, 0.5); }
}

/* User Profile Pill */
.user-profile-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-card);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.25s ease;
}

.user-profile-pill:hover {
  border-color: var(--neon-purple);
  background: rgba(157, 78, 221, 0.15);
  box-shadow: var(--glow-purple);
}

.profile-avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.profile-info {
  display: flex;
  flex-direction: column;
}

.profile-name {
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

.profile-badge {
  font-size: 0.7rem;
  color: var(--neon-amber);
  font-family: var(--font-display);
}

/* Hero Section */
.hero-section {
  text-align: center;
  padding: 60px 24px 35px;
  max-width: 1100px;
  margin: 0 auto;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.3);
  padding: 6px 18px;
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 1.5px;
  color: var(--neon-cyan);
  margin-bottom: 20px;
  text-transform: uppercase;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 16px;
  text-shadow: 0 0 35px rgba(0, 240, 255, 0.3);
}

.hero-title .text-gradient {
  background: linear-gradient(135deg, #ffffff 0%, var(--neon-cyan) 40%, var(--neon-pink) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 680px;
  margin: 0 auto 30px;
  line-height: 1.6;
}

/* Hero Stats Bar */
.hero-stats-bar {
  display: inline-flex;
  gap: 32px;
  background: var(--bg-surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-card);
  padding: 14px 28px;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-val {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--neon-cyan);
}

.stat-lbl {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 2px;
}

/* Control Hub & Search Filter Bar */
.filter-hub-bar {
  max-width: 1200px;
  margin: 20px auto 35px;
  padding: 0 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.category-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.category-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  padding: 8px 18px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.category-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.category-chip.active {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(157, 78, 221, 0.2));
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  box-shadow: var(--glow-cyan);
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box input {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  padding: 10px 18px 10px 38px;
  border-radius: var(--radius-full);
  outline: none;
  font-family: var(--font-body);
  font-size: 0.9rem;
  width: 240px;
  transition: all 0.3s ease;
}

.search-box input:focus {
  width: 280px;
  border-color: var(--neon-cyan);
  box-shadow: var(--glow-cyan);
}

.search-icon {
  position: absolute;
  left: 14px;
  font-size: 0.9rem;
  color: var(--text-muted);
  pointer-events: none;
}

/* Games Grid */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.game-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.game-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  padding: 1.5px;
  background: linear-gradient(135deg, transparent, transparent);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  transition: all 0.35s ease;
}

.game-card:hover {
  transform: translateY(-8px) scale(1.015);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(0, 240, 255, 0.2);
  border-color: rgba(0, 240, 255, 0.4);
}

.game-card.hidden-card {
  display: none;
}

.game-card-banner {
  height: 170px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(14, 18, 50, 0.8), rgba(26, 15, 60, 0.8));
  overflow: hidden;
}

.game-banner-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-family: var(--font-display);
  color: var(--neon-cyan);
  text-transform: uppercase;
}

.fav-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.fav-btn:hover {
  color: #ff007f;
  transform: scale(1.15);
}

.fav-btn.active {
  color: #ff007f;
  border-color: #ff007f;
  box-shadow: var(--glow-pink);
}

.game-banner-art {
  font-size: 4.5rem;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.5));
}

.game-card:hover .game-banner-art {
  transform: scale(1.18) rotate(6deg);
}

.game-card-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.game-card-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.game-card-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
  flex-grow: 1;
}

.game-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.game-tags {
  display: flex;
  gap: 6px;
}

.tag-pill {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 8px;
  border-radius: 4px;
  color: var(--text-muted);
}

.play-now-btn {
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
  color: #060714;
  border: none;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 9px 20px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.25s ease;
}

.play-now-btn:hover {
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.6);
  transform: scale(1.05);
}

/* Cosmic Buttons & Component Styles */
.cosmic-btn {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.cosmic-btn.btn-primary {
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
  color: #060714;
}

.cosmic-btn.btn-primary:hover {
  box-shadow: var(--glow-cyan);
  transform: translateY(-2px);
}

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

.cosmic-btn.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--neon-cyan);
}

/* Fullscreen Game Modal */
.game-modal {
  position: fixed;
  inset: 0;
  background: rgba(6, 7, 20, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 100;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

.game-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border-card);
  background: rgba(14, 18, 48, 0.6);
}

.game-modal-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--neon-cyan);
}

.game-modal-close {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.game-modal-close:hover {
  background: rgba(255, 0, 127, 0.2);
  border-color: var(--neon-pink);
  box-shadow: var(--glow-pink);
}

.game-modal-body {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

/* Profile Modal & Achievements Drawer */
.dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px 16px;
  overflow-y: auto;
}

.dialog-backdrop.hidden {
  display: none;
}

.cosmic-dialog-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-neon);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), var(--glow-cyan);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 24px;
  margin: auto;
  position: relative;
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  position: sticky;
  top: -24px;
  background: var(--bg-surface);
  padding: 6px 0;
  z-index: 10;
}

.dialog-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--neon-cyan);
}

.dialog-close {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 1.2rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dialog-close:hover {
  background: rgba(255, 0, 85, 0.35);
  border-color: #ff0055;
  color: #fff;
  transform: scale(1.1);
}

/* Eye-Catching PWA Header Pill Button */
.pwa-header-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(0, 255, 200, 0.15), rgba(255, 183, 3, 0.15));
  border: 1px solid var(--neon-cyan);
  border-radius: 30px;
  padding: 6px 14px;
  color: #fff;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 0 12px rgba(0, 255, 200, 0.3);
  transition: all 0.25s ease;
  animation: cosmic-pwa-pulse 2.2s infinite;
}

.pwa-header-pill:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(0, 255, 200, 0.6);
}

.pwa-pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--neon-green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--neon-green);
}

.pwa-vip-badge {
  font-size: 0.65rem;
  background: linear-gradient(135deg, var(--neon-amber), #ff0055);
  color: #000;
  font-weight: 900;
  padding: 1px 6px;
  border-radius: 10px;
}

@keyframes cosmic-pwa-pulse {
  0%, 100% {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 8px rgba(0, 255, 200, 0.25);
  }
  50% {
    border-color: var(--neon-amber);
    box-shadow: 0 0 18px rgba(255, 183, 3, 0.5);
  }
}

.avatar-selector-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin: 16px 0;
}

.avatar-choice {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  font-size: 1.6rem;
  padding: 10px 0;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.avatar-choice:hover {
  background: rgba(255, 255, 255, 0.15);
}

.avatar-choice.selected {
  border-color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.2);
  box-shadow: var(--glow-cyan);
}

.dialog-input-group {
  margin: 18px 0;
}

.dialog-input-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.dialog-input-group input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  outline: none;
  font-size: 1rem;
}

.dialog-input-group input:focus {
  border-color: var(--neon-cyan);
  box-shadow: var(--glow-cyan);
}

/* Achievements Slide-over Drawer */
.slide-drawer {
  position: fixed;
  top: 0;
  right: -450px;
  width: 100%;
  max-width: 420px;
  height: 100vh;
  background: rgba(10, 13, 34, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-left: 1px solid var(--border-neon);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.8);
  z-index: 250;
  transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.slide-drawer.open {
  right: 0;
}

.drawer-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.achievement-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-card);
  padding: 14px;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.achievement-item.unlocked {
  border-color: rgba(0, 240, 255, 0.4);
  background: rgba(0, 240, 255, 0.06);
}

.achievement-item.locked {
  opacity: 0.55;
}

.ach-icon-badge {
  font-size: 1.8rem;
  min-width: 40px;
  text-align: center;
}

.ach-info {
  flex-grow: 1;
}

.ach-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 2px;
}

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

.ach-xp {
  font-family: var(--font-display);
  font-size: 0.75rem;
  color: var(--neon-amber);
  white-space: nowrap;
}

/* Toast Container */
#toast-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.cosmic-toast {
  background: rgba(14, 18, 48, 0.95);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-neon);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8), var(--glow-cyan);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 14px;
  transform: translateY(30px) scale(0.9);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
  max-width: 360px;
}

.cosmic-toast.show {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.toast-icon {
  font-size: 1.8rem;
}

.toast-tag {
  font-family: var(--font-display);
  font-size: 0.65rem;
  color: var(--neon-cyan);
  letter-spacing: 1px;
}

.toast-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin: 2px 0;
}

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

.xp-badge {
  color: var(--neon-amber);
  font-weight: 600;
}

/* Leaderboard Modal & Tabs */
.lb-tabs-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-card);
}

.lb-tab {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 0.8rem;
  white-space: nowrap;
  transition: all 0.2s ease;
}

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

.lb-tab.active {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  box-shadow: var(--glow-cyan);
}

.lb-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 380px;
  overflow-y: auto;
}

.lb-row {
  display: grid;
  grid-template-columns: 50px 1fr 120px;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-card);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 4px;
  transition: background 0.2s;
}

.lb-first {
  background: rgba(255, 215, 0, 0.1);
  border-color: rgba(255, 215, 0, 0.4);
}

.lb-second {
  background: rgba(192, 192, 192, 0.08);
  border-color: rgba(192, 192, 192, 0.3);
}

.lb-third {
  background: rgba(205, 127, 50, 0.08);
  border-color: rgba(205, 127, 50, 0.3);
}

.lb-you {
  background: rgba(0, 255, 255, 0.08);
  border-color: rgba(0, 255, 255, 0.35);
  box-shadow: 0 0 8px rgba(0, 255, 255, 0.15);
}

.lb-rank {
  font-weight: 700;
  font-family: var(--font-display);
}

.lb-pilot {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.lb-score {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--neon-cyan);
  text-align: right;
}

.lb-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
}

/* Auth Buttons & User Photo */
.auth-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--neon-cyan);
}

.google-signin-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin: 20px 0;
}

.google-btn-custom {
  background: #ffffff;
  color: #1f1f1f;
  border: none;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.google-btn-custom:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.4);
}

/* Support VIP Modal */
.vip-tier-card {
  background: linear-gradient(135deg, rgba(255, 183, 3, 0.12), rgba(255, 0, 127, 0.12));
  border: 1px solid var(--neon-amber);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  margin: 16px 0;
  box-shadow: 0 0 20px rgba(255, 183, 3, 0.2);
}

.vip-price {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--neon-amber);
  margin: 6px 0;
}

.upi-qr-wrapper {
  margin: 14px 0 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.upi-qr-frame {
  background: #ffffff;
  padding: 10px;
  border-radius: 12px;
  box-shadow: 0 0 25px rgba(255, 183, 3, 0.35);
  display: inline-block;
  line-height: 0;
}

.upi-qr-img {
  width: 170px;
  height: 170px;
  border-radius: 4px;
  display: block;
}

.upi-app-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.upi-badge {
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 3px 8px;
  border-radius: 20px;
  color: var(--text-secondary);
}

.upi-pay-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 13px 0;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  box-shadow: 0 4px 16px rgba(0, 255, 200, 0.3);
}

.upi-copy-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.85rem;
}

.upi-id-text {
  color: var(--neon-cyan);
  font-family: monospace;
  font-size: 0.9rem;
}

.upi-copy-btn {
  background: rgba(0, 255, 200, 0.15);
  border: 1px solid var(--neon-cyan);
  color: var(--neon-cyan);
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  transition: all 0.2s;
}

.upi-copy-btn:hover {
  background: var(--neon-cyan);
  color: #060814;
}

/* Footer Section */
.universe-footer {
  margin-top: 80px;
  padding: 40px 24px 20px;
  border-top: 1px solid var(--border-card);
  background: rgba(6, 7, 20, 0.85);
  backdrop-filter: blur(16px);
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--neon-cyan);
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Keyframes */
@keyframes cosmic-float {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-8px) rotate(8deg); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .topbar {
    padding: 12px 16px;
  }
  .brand-title {
    font-size: 1.1rem;
  }
  .profile-name {
    display: none;
  }
  .hero-section {
    padding: 40px 16px 20px;
  }
  .hero-stats-bar {
    gap: 16px;
    padding: 10px 16px;
  }
  .filter-hub-bar {
    padding: 0 16px;
    flex-direction: column;
    align-items: stretch;
  }
  .search-box input {
    width: 100%;
  }
  .search-box input:focus {
    width: 100%;
  }
  .games-grid {
    grid-template-columns: 1fr;
    padding: 0 16px;
  }
  .lb-row {
    grid-template-columns: 40px 1fr 80px;
  }
  .lb-date {
    display: none;
  }
}

/* ==========================================================================
   8. QUANTUM TETRIS STYLES
   ========================================================================== */
.tetris-wrapper {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 20px;
  max-width: 580px;
  margin: 0 auto;
}

.tetris-sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 120px;
}

.tetris-box {
  background: rgba(13, 20, 36, 0.85);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 10px;
  text-align: center;
}

.tetris-box-title {
  display: block;
  font-size: 0.75rem;
  color: var(--neon-cyan);
  font-weight: 700;
  font-family: var(--font-display);
  margin-bottom: 6px;
}

.tetris-stats-card {
  background: rgba(13, 20, 36, 0.85);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tetris-controls-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.6;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 10px;
}

.tetris-controls-hint kbd {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 0.7rem;
  color: var(--neon-cyan);
}

.tetris-main-area {
  position: relative;
  border: 2px solid var(--border-card);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.1);
  line-height: 0;
}

.tetris-overlay {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 20, 0.92);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 10;
}

.tetris-touch-bar {
  display: none;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.touch-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-card);
  color: #fff;
  font-size: 1rem;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
}

.touch-btn:active {
  background: rgba(0, 255, 255, 0.2);
  border-color: var(--neon-cyan);
}

.touch-btn-action {
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-blue));
  color: #060814;
  font-weight: 700;
  border: none;
}

@media (max-width: 600px) {
  .tetris-wrapper {
    flex-direction: column;
    align-items: center;
  }
  .tetris-sidebar {
    flex-direction: row;
    width: 100%;
    justify-content: center;
  }
  .tetris-controls-hint {
    display: none;
  }
  .tetris-touch-bar {
    display: flex;
  }
}

/* ==========================================================================
   9. ASTRO DASH (FLAPPY) STYLES
   ========================================================================== */
.flappy-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 440px;
  margin: 0 auto;
}

.flappy-hud {
  display: flex;
  justify-content: space-between;
  width: 100%;
  background: rgba(13, 20, 36, 0.85);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
}

.flappy-canvas-box {
  position: relative;
  border: 2px solid var(--border-card);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 0 24px rgba(139, 92, 246, 0.15);
  line-height: 0;
  cursor: pointer;
}

.flappy-overlay {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 20, 0.88);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  line-height: 1.5;
  z-index: 10;
}

.flappy-overlay h2 {
  font-family: var(--font-display);
  color: var(--neon-cyan);
  margin-bottom: 8px;
}

.flappy-overlay p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.flappy-controls-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

/* ==========================================================================
   10. COSMIC AD BANNERS
   ========================================================================== */
.cosmic-ad-container {
  max-width: 960px;
  margin: 28px auto 0;
  padding: 0 24px;
  text-align: center;
}

.cosmic-ad-banner {
  background: rgba(13, 20, 36, 0.6);
  border: 1px dashed rgba(0, 255, 255, 0.2);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s;
}

.cosmic-ad-banner:hover {
  border-color: rgba(0, 255, 255, 0.4);
}

.ad-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

