:root {
  --bg-deep: #06060e;
  --bg-card: rgba(14, 14, 30, 0.85);
  --bg-card-hover: rgba(20, 20, 45, 0.95);
  --accent-purple: #b44aff;
  --accent-cyan: #00f0ff;
  --accent-gold: #ffd700;
  --accent-crimson: #ff2a6d;
  --text-primary: #e0e0f0;
  --text-dim: #7878a0;
  --border-glow: rgba(180, 74, 255, 0.3);
}

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

html, body, #root {
  height: 100%;
  width: 100%;
  overflow: hidden;
}

body {
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: 'Oxanium', sans-serif;
}

/* Starfield */
.starfield {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.starfield::before,
.starfield::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 200%; height: 200%;
  background-image:
    radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 30% 80%, rgba(180,74,255,0.5), transparent),
    radial-gradient(1.5px 1.5px at 50% 10%, rgba(0,240,255,0.4), transparent),
    radial-gradient(1px 1px at 70% 60%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 90% 40%, rgba(180,74,255,0.3), transparent),
    radial-gradient(1px 1px at 15% 55%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1.5px 1.5px at 40% 35%, rgba(0,240,255,0.3), transparent),
    radial-gradient(1px 1px at 60% 90%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 85% 15%, rgba(180,74,255,0.4), transparent),
    radial-gradient(1px 1px at 25% 70%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 5% 95%, rgba(0,240,255,0.3), transparent),
    radial-gradient(1px 1px at 75% 25%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1.5px 1.5px at 95% 75%, rgba(180,74,255,0.4), transparent),
    radial-gradient(1px 1px at 45% 50%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 55% 5%, rgba(0,240,255,0.4), transparent);
  animation: drift 120s linear infinite;
}

.starfield::after {
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1.5px 1.5px at 40% 70%, rgba(0,240,255,0.3), transparent),
    radial-gradient(1px 1px at 60% 20%, rgba(180,74,255,0.4), transparent),
    radial-gradient(1px 1px at 80% 50%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 10% 85%, rgba(0,240,255,0.3), transparent),
    radial-gradient(1px 1px at 35% 15%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 55% 65%, rgba(180,74,255,0.3), transparent),
    radial-gradient(1.5px 1.5px at 75% 85%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 95% 5%, rgba(0,240,255,0.4), transparent),
    radial-gradient(1px 1px at 50% 45%, rgba(255,255,255,0.3), transparent);
  animation: drift 180s linear infinite reverse;
}

@keyframes drift {
  from { transform: translate(0, 0); }
  to { transform: translate(-50%, -50%); }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(6,6,14,0.5);
}
::-webkit-scrollbar-thumb {
  background: rgba(180,74,255,0.4);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(180,74,255,0.7);
}

/* Glow text */
.glow-text {
  text-shadow: 0 0 10px rgba(180,74,255,0.6), 0 0 40px rgba(180,74,255,0.3);
}

.glow-cyan {
  text-shadow: 0 0 10px rgba(0,240,255,0.6), 0 0 40px rgba(0,240,255,0.3);
}

.glow-gold {
  text-shadow: 0 0 10px rgba(255,215,0,0.6), 0 0 40px rgba(255,215,0,0.3);
}

/* Button pulse */
@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.5); opacity: 0; }
}

.click-btn {
  position: relative;
  transition: all 0.15s ease;
}

.click-btn:active {
  transform: scale(0.95);
}

.click-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 2px solid var(--accent-purple);
  opacity: 0;
  pointer-events: none;
}

.click-btn:active::after {
  animation: pulse-ring 0.4s ease-out;
}

/* Prestige flash */
@keyframes prestige-flash {
  0% { opacity: 0.8; }
  100% { opacity: 0; }
}

.prestige-flash {
  animation: prestige-flash 0.6s ease-out forwards;
}

/* Tab glow */
@keyframes tab-pulse {
  0%, 100% { box-shadow: 0 0 5px rgba(180,74,255,0.3); }
  50% { box-shadow: 0 0 15px rgba(180,74,255,0.6); }
}

.tab-new {
  animation: tab-pulse 2s ease-in-out infinite;
}

/* Slide in */
@keyframes slideIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.slide-in {
  animation: slideIn 0.4s ease-out forwards;
}

/* Number font */
.num {
  font-family: 'JetBrains Mono', monospace;
}

/* Card style */
.game-card {
  background: var(--bg-card);
  border: 1px solid rgba(180,74,255,0.15);
  border-radius: 8px;
  backdrop-filter: blur(10px);
  transition: border-color 0.3s, background 0.3s;
}

.game-card:hover {
  border-color: rgba(180,74,255,0.35);
  background: var(--bg-card-hover);
}

/* Notification toast */
@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes toastOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

.toast-enter {
  animation: toastIn 0.3s ease-out forwards;
}

.toast-exit {
  animation: toastOut 0.3s ease-in forwards;
}

/* Ripple */
@keyframes ripple {
  to { transform: scale(4); opacity: 0; }
}

/* News ticker */
.news-ticker {
  position: relative;
  z-index: 20;
}

@keyframes newsSlide {
  0% { opacity: 0; transform: translateY(-8px); }
  10% { opacity: 1; transform: translateY(0); }
  90% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(8px); }
}

.news-text-anim {
  animation: newsSlide 6s ease-in-out forwards;
}

/* Buy button */
.buy-btn {
  background: linear-gradient(135deg, rgba(180,74,255,0.2), rgba(0,240,255,0.1));
  border: 1px solid rgba(180,74,255,0.3);
  transition: all 0.2s;
}

.buy-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(180,74,255,0.4), rgba(0,240,255,0.2));
  border-color: rgba(180,74,255,0.6);
  box-shadow: 0 0 15px rgba(180,74,255,0.2);
}

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

/* Prestige button */
.prestige-btn {
  background: linear-gradient(135deg, rgba(255,215,0,0.2), rgba(255,42,109,0.1));
  border: 2px solid rgba(255,215,0,0.4);
  transition: all 0.3s;
}

.prestige-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(255,215,0,0.4), rgba(255,42,109,0.2));
  border-color: rgba(255,215,0,0.7);
  box-shadow: 0 0 25px rgba(255,215,0,0.3);
}

/* Upgrade card */
.upgrade-card {
  position: relative;
  overflow: hidden;
}

.upgrade-card.purchased {
  border-color: rgba(0,240,255,0.4);
}

.upgrade-card.purchased::after {
  content: '✓';
  position: absolute;
  top: 8px;
  right: 8px;
  color: var(--accent-cyan);
  font-size: 20px;
  font-weight: bold;
}

/* Mobile bottom nav */
@media (max-width: 768px) {
  .tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: rgba(6,6,14,0.95);
    border-top: 1px solid rgba(180,74,255,0.2);
    backdrop-filter: blur(10px);
  }
}

/* Floating number */
@keyframes floatUp {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-60px) scale(0.8); }
}

.float-number {
  animation: floatUp 0.8s ease-out forwards;
  pointer-events: none;
}

/* Progress bar shimmer */
@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

.progress-shimmer {
  background: linear-gradient(90deg, 
    rgba(180,74,255,0.3) 0%, 
    rgba(0,240,255,0.5) 50%, 
    rgba(180,74,255,0.3) 100%);
  background-size: 200% 100%;
  animation: shimmer 2s ease-in-out infinite;
}