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

:root {
  --bg-deep: #080c14;
  --bg-mid: #0d1520;
  --accent-cyan: #22d3ee;
  --accent-blue: #3b82f6;
  --accent-violet: #8b5cf6;
  --accent-amber: #f59e0b;
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.07);
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-dim: #475569;
  --green: #4ade80;
  --red: #f87171;
  --epiphany: #c084fc;
}

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

#root { min-height: 100vh; }

/* Neural network background */
.neural-field {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse at 30% 40%, rgba(34, 211, 238, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 60%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 20%, rgba(59, 130, 246, 0.04) 0%, transparent 40%),
    linear-gradient(180deg, #060a12 0%, #0a1020 40%, #0d0a18 100%);
}

.neural-field::before, .neural-field::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
}

.neural-field::before {
  background-image:
    radial-gradient(2px 2px at 8% 15%, rgba(34,211,238,0.5), transparent),
    radial-gradient(1.5px 1.5px at 22% 35%, rgba(139,92,246,0.4), transparent),
    radial-gradient(2px 2px at 38% 12%, rgba(59,130,246,0.5), transparent),
    radial-gradient(1px 1px at 52% 58%, rgba(34,211,238,0.3), transparent),
    radial-gradient(1.5px 1.5px at 68% 25%, rgba(139,92,246,0.5), transparent),
    radial-gradient(2px 2px at 82% 48%, rgba(34,211,238,0.4), transparent),
    radial-gradient(1px 1px at 15% 72%, rgba(59,130,246,0.3), transparent),
    radial-gradient(1.5px 1.5px at 45% 82%, rgba(139,92,246,0.4), transparent),
    radial-gradient(2px 2px at 62% 8%, rgba(34,211,238,0.3), transparent),
    radial-gradient(1px 1px at 88% 75%, rgba(59,130,246,0.4), transparent),
    radial-gradient(1.5px 1.5px at 32% 92%, rgba(34,211,238,0.3), transparent),
    radial-gradient(1px 1px at 75% 88%, rgba(139,92,246,0.3), transparent);
  animation: synapseFlicker1 5s ease-in-out infinite alternate;
}

.neural-field::after {
  background-image:
    radial-gradient(1px 1px at 5% 45%, rgba(34,211,238,0.4), transparent),
    radial-gradient(2px 2px at 18% 28%, rgba(59,130,246,0.3), transparent),
    radial-gradient(1.5px 1.5px at 35% 65%, rgba(139,92,246,0.5), transparent),
    radial-gradient(1px 1px at 48% 38%, rgba(34,211,238,0.3), transparent),
    radial-gradient(1.5px 1.5px at 62% 78%, rgba(59,130,246,0.4), transparent),
    radial-gradient(2px 2px at 78% 12%, rgba(139,92,246,0.3), transparent),
    radial-gradient(1px 1px at 92% 55%, rgba(34,211,238,0.5), transparent),
    radial-gradient(1.5px 1.5px at 12% 88%, rgba(59,130,246,0.3), transparent),
    radial-gradient(1px 1px at 55% 22%, rgba(139,92,246,0.4), transparent),
    radial-gradient(2px 2px at 42% 48%, rgba(34,211,238,0.3), transparent);
  animation: synapseFlicker2 6s ease-in-out infinite alternate;
}

@keyframes synapseFlicker1 {
  0% { opacity: 0.5; }
  100% { opacity: 1; }
}
@keyframes synapseFlicker2 {
  0% { opacity: 1; }
  100% { opacity: 0.4; }
}

/* Glass panels */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 16px;
}

.glass-sm {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 10px;
}

/* Idea button */
.idea-btn {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.08s ease;
  filter: drop-shadow(0 0 20px rgba(34, 211, 238, 0.3));
}
.idea-btn:active {
  transform: scale(0.90) !important;
}
.idea-btn:hover {
  filter: drop-shadow(0 0 35px rgba(34, 211, 238, 0.6));
}

/* Glow pulse */
.idea-glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.15) 0%, rgba(139, 92, 246, 0.05) 50%, transparent 70%);
  animation: glowPulse 2.5s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.4; }
  50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.7; }
}

/* Float particle */
.float-particle {
  position: absolute;
  pointer-events: none;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: var(--accent-cyan);
  text-shadow: 0 0 10px rgba(34, 211, 238, 0.6);
  animation: floatUp 1s ease-out forwards;
  z-index: 100;
}

@keyframes floatUp {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  70% { opacity: 0.7; }
  100% { opacity: 0; transform: translateY(-90px) scale(0.5); }
}

/* Shimmer on milestone */
@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

.shimmer-text {
  background: linear-gradient(90deg, var(--accent-cyan) 0%, #fff 25%, var(--accent-violet) 50%, #fff 75%, var(--accent-cyan) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 2s linear infinite;
}

/* Generator item */
.generator-item {
  transition: all 0.15s ease;
  cursor: pointer;
}
.generator-item:hover {
  background: rgba(34, 211, 238, 0.04) !important;
  transform: translateX(2px);
}
.generator-item.affordable {
  border-left: 3px solid var(--green);
}
.generator-item.unaffordable {
  opacity: 0.5;
  border-left: 3px solid transparent;
}

/* Upgrade card */
.upgrade-card {
  transition: all 0.15s ease;
  cursor: pointer;
  position: relative;
}
.upgrade-card:hover {
  transform: scale(1.05);
  border-color: var(--accent-cyan);
}
.upgrade-card.purchased {
  opacity: 0.4;
  cursor: default;
}
.upgrade-card.purchased:hover {
  transform: none;
}

/* Insight event (floating bonus) */
.insight-orb {
  position: fixed;
  cursor: pointer;
  font-size: 48px;
  z-index: 200;
  animation: orbFloat 1.2s ease-in-out infinite alternate, orbAppear 0.3s ease-out;
  filter: drop-shadow(0 0 18px rgba(139, 92, 246, 0.8));
  transition: transform 0.1s;
}
.insight-orb:hover {
  transform: scale(1.2);
}
.insight-orb:active {
  transform: scale(0.9);
}

@keyframes orbFloat {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(-12px) rotate(5deg); }
}
@keyframes orbAppear {
  0% { opacity: 0; transform: scale(0.3); }
  100% { opacity: 1; transform: scale(1); }
}

/* Achievement toast */
.achievement-toast {
  animation: toastSlideIn 0.4s ease-out, toastSlideOut 0.4s ease-in 2.6s forwards;
}

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

/* Event banner */
.event-banner {
  animation: bannerPulse 0.5s ease-in-out infinite alternate;
}
@keyframes bannerPulse {
  0% { box-shadow: 0 0 10px rgba(139, 92, 246, 0.3); }
  100% { box-shadow: 0 0 25px rgba(139, 92, 246, 0.6); }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

/* Tab buttons */
.tab-btn {
  transition: all 0.15s ease;
}
.tab-btn.active {
  background: rgba(34, 211, 238, 0.12);
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

/* Modal overlay */
.modal-overlay {
  animation: fadeIn 0.2s ease-out;
}
@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

/* Combo text */
.combo-text {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  animation: comboFlash 0.3s ease-out;
}
@keyframes comboFlash {
  0% { transform: scale(1.5); opacity: 0; }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

/* Transcend button glow */
.transcend-btn {
  animation: transcendGlow 2s ease-in-out infinite;
}
@keyframes transcendGlow {
  0%, 100% { box-shadow: 0 0 15px rgba(192, 132, 252, 0.3), inset 0 0 15px rgba(192, 132, 252, 0.1); }
  50% { box-shadow: 0 0 30px rgba(192, 132, 252, 0.6), inset 0 0 20px rgba(192, 132, 252, 0.2); }
}

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

/* Brain click target animation */
.brain-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Neural rings around the brain */
.neural-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(34, 211, 238, 0.15);
  pointer-events: none;
  animation: ringPulse 3s ease-in-out infinite;
}

.neural-ring:nth-child(2) { animation-delay: 1s; }
.neural-ring:nth-child(3) { animation-delay: 2s; }

@keyframes ringPulse {
  0%, 100% { transform: scale(1); opacity: 0.3; }
  50% { transform: scale(1.08); opacity: 0.6; }
}

/* Synapse lines animation */
@keyframes synapseTrace {
  0% { stroke-dashoffset: 100; opacity: 0; }
  30% { opacity: 0.6; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .idea-btn { font-size: 80px !important; }
}