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

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-panel: #161622;
  --text-primary: #e0e0e0;
  --text-secondary: #888;
  --golden: #FFD700;
  --golden-dark: #FFA500;
  --median: #4A9EFF;
  --median-dark: #2D7DD2;
  --regret: #FF2E2E;
  --regret-dark: #CC0000;
  --cyan: #00e5ff;
}

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

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #555;
}

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

@keyframes titleGlow {
  0%, 100% { text-shadow: 0 0 20px rgba(0,229,255,0.3), 0 0 40px rgba(255,215,0,0.15); }
  50% { text-shadow: 0 0 30px rgba(0,229,255,0.6), 0 0 60px rgba(255,215,0,0.3); }
}

@keyframes nodePulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.15); opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

@keyframes scanPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,229,255,0.4); }
  50% { box-shadow: 0 0 0 20px rgba(0,229,255,0); }
}

@keyframes scanRing {
  0% { transform: scale(0.8); opacity: 1; border-width: 3px; }
  100% { transform: scale(2.5); opacity: 0; border-width: 1px; }
}

@keyframes barFill {
  from { width: 0%; }
}

@keyframes drawPath {
  from { stroke-dashoffset: 2000; }
  to { stroke-dashoffset: 0; }
}

@keyframes nodeAppear {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes flickerGlow {
  0%, 100% { opacity: 0.6; filter: blur(4px); }
  25% { opacity: 0.9; filter: blur(6px); }
  50% { opacity: 0.4; filter: blur(3px); }
  75% { opacity: 0.8; filter: blur(5px); }
}

@keyframes spinScan {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes textPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

@keyframes particleFloat {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translateY(-100vh) translateX(50px); opacity: 0; }
}

.portal-bg {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 600px;
  height: 600px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(0,229,255,0.08) 0%, rgba(255,215,0,0.04) 30%, transparent 70%);
  border-radius: 50%;
  animation: portalPulse 4s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

.title-glow {
  animation: titleGlow 3s ease-in-out infinite;
}

.node-pulse {
  animation: nodePulse 2s ease-in-out infinite;
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out forwards;
}

.fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}

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

.bar-fill {
  animation: barFill 0.8s ease-out forwards;
}

.scan-ring {
  animation: scanRing 1.5s ease-out infinite;
}

.spin-scan {
  animation: spinScan 2s linear infinite;
}

.text-pulse {
  animation: textPulse 1.5s ease-in-out infinite;
}

.particle {
  position: fixed;
  width: 2px;
  height: 2px;
  background: var(--cyan);
  border-radius: 50%;
  pointer-events: none;
  animation: particleFloat linear infinite;
  z-index: 0;
}

.timeline-path {
  stroke-dasharray: 2000;
  stroke-dashoffset: 2000;
  animation: drawPath 2s ease-out forwards;
}

.golden-glow { filter: drop-shadow(0 0 8px rgba(255,215,0,0.6)); }
.median-glow { filter: drop-shadow(0 0 8px rgba(74,158,255,0.6)); }
.regret-glow { filter: drop-shadow(0 0 8px rgba(255,46,46,0.5)); animation: flickerGlow 3s ease-in-out infinite; }

.glass-panel {
  background: rgba(22, 22, 34, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.06);
}

.orbitron {
  font-family: 'Orbitron', sans-serif;
}

.space-mono {
  font-family: 'Space Mono', monospace;
}

.gradient-border-cyan {
  border: 2px solid transparent;
  background-image: linear-gradient(var(--bg-secondary), var(--bg-secondary)), 
                    linear-gradient(135deg, var(--cyan), var(--golden));
  background-origin: border-box;
  background-clip: padding-box, border-box;
}

.btn-scan {
  background: linear-gradient(135deg, rgba(0,229,255,0.15), rgba(255,215,0,0.15));
  border: 2px solid;
  border-image: linear-gradient(135deg, var(--cyan), var(--golden)) 1;
  transition: all 0.3s ease;
}

.btn-scan:hover {
  background: linear-gradient(135deg, rgba(0,229,255,0.3), rgba(255,215,0,0.3));
  transform: scale(1.03);
  box-shadow: 0 0 30px rgba(0,229,255,0.3), 0 0 60px rgba(255,215,0,0.15);
}

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

@media (max-width: 768px) {
  .portal-bg {
    width: 300px;
    height: 300px;
  }
}