:root {
  --bg-primary: #0a0a1a;
  --bg-secondary: #111128;
  --bg-tertiary: #1a1a3e;
  --bg-card: #141432;
  --border-color: #2a2a5e;
  --cyan: #00d2ff;
  --cyan-dim: #007a99;
  --amber: #f5a623;
  --amber-dim: #c4841c;
  --green: #00ff88;
  --red: #ff4455;
  --text-primary: #e0e0f0;
  --text-secondary: #8888aa;
  --text-dim: #555577;
}

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

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Rajdhani', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image:
    linear-gradient(rgba(0,210,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,210,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

#root {
  position: relative;
  z-index: 1;
}

.font-mono {
  font-family: 'JetBrains Mono', monospace !important;
}

.font-display {
  font-family: 'Rajdhani', sans-serif !important;
}

/* Scanline effect */
@keyframes scanline {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100vh); }
}

.scanline-overlay {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(to bottom, transparent, rgba(0,210,255,0.08), transparent);
  animation: scanline 4s linear infinite;
  pointer-events: none;
  z-index: 100;
}

/* Pulse glow */
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 8px rgba(0,210,255,0.2), inset 0 0 8px rgba(0,210,255,0.05); }
  50% { box-shadow: 0 0 20px rgba(0,210,255,0.4), inset 0 0 15px rgba(0,210,255,0.1); }
}

.pulse-active {
  animation: pulseGlow 2s ease-in-out infinite;
}

/* Ripple effect */
@keyframes ripple {
  0% { transform: scale(0); opacity: 0.6; }
  100% { transform: scale(4); opacity: 0; }
}

.ripple-circle {
  position: absolute;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  background: rgba(0,210,255,0.3);
  pointer-events: none;
  animation: ripple 0.6s ease-out forwards;
}

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

.float-number {
  position: absolute;
  pointer-events: none;
  animation: floatUp 1s ease-out forwards;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: var(--cyan);
  text-shadow: 0 0 10px rgba(0,210,255,0.8);
  z-index: 50;
}

/* Progress ring */
@keyframes progressSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Toast animation */
@keyframes slideIn {
  0% { transform: translateX(120%); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
  0% { transform: translateX(0); opacity: 1; }
  100% { transform: translateX(120%); opacity: 0; }
}

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

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

/* Flow line animation */
@keyframes flowDash {
  0% { stroke-dashoffset: 20; }
  100% { stroke-dashoffset: 0; }
}

.flow-line {
  stroke-dasharray: 8 4;
  animation: flowDash 1s linear infinite;
}

/* Building tile hover */
.building-tile {
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
}

.building-tile:hover {
  transform: translateY(-2px);
  border-color: var(--cyan) !important;
}

.building-tile:active {
  transform: scale(0.97);
}

/* Lock shimmer */
@keyframes lockShimmer {
  0% { background-position: -200px 0; }
  100% { background-position: 200px 0; }
}

.locked-tile {
  position: relative;
  overflow: hidden;
}

.locked-tile::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.02), transparent);
  background-size: 200px 100%;
  animation: lockShimmer 3s linear infinite;
}

/* Upgrade item */
.upgrade-item {
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.upgrade-item:hover:not(.locked) {
  border-left-color: var(--cyan);
  background: rgba(0,210,255,0.05) !important;
}

.upgrade-item.purchased {
  border-left-color: var(--green);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--cyan-dim);
}

/* Modal backdrop */
.modal-backdrop {
  backdrop-filter: blur(4px);
}

/* Header pulse */
@keyframes headerPulse {
  0%, 100% { border-bottom-color: rgba(0,210,255,0.2); }
  50% { border-bottom-color: rgba(0,210,255,0.5); }
}

.header-bar {
  animation: headerPulse 3s ease-in-out infinite;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .building-tile {
    min-width: 0 !important;
  }
}

/* Progress bar fill */
.progress-fill {
  transition: width 0.1s linear;
}

/* Prestige glow */
@keyframes prestigeGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(245,166,35,0.3); }
  50% { box-shadow: 0 0 40px rgba(245,166,35,0.6), 0 0 60px rgba(245,166,35,0.2); }
}

.prestige-glow {
  animation: prestigeGlow 2s ease-in-out infinite;
}