:root {
  --bg: #03010a;
  --grid: rgba(36, 19, 64, 0.8);
  --neon-cyan: #4fe1ff;
  --neon-pink: #ff4fd8;
  --neon-lime: #7bff9c;
  --amber: #ffc34f;
  --text: #f4edff;
  --font-body: 'Space Grotesk', sans-serif;
  --font-mono: 'VT323', monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 30% -10%, rgba(79, 225, 255, 0.35), transparent 45%),
    radial-gradient(circle at 70% 0%, rgba(255, 79, 216, 0.35), transparent 40%), var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  overflow: hidden;
}

canvas#starfield {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
}

.scanline {
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.04) 1px, transparent 2px, transparent 4px);
  pointer-events: none;
  mix-blend-mode: screen;
  animation: flicker 8s steps(6) infinite;
  z-index: 2;
}

.shell {
  position: relative;
  z-index: 3;
  min-height: 100vh;
  padding: 4vw 4vw 6vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3rem;
}

.identity {
  text-align: center;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.logo {
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-family: var(--font-mono);
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: lowercase;
  text-shadow: 0 0 15px rgba(79, 225, 255, 0.7), 0 0 35px rgba(255, 79, 216, 0.5);
  color: var(--text);
}

.arena {
  width: min(90vw, 780px);
}

.chase-grid {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 32px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08), transparent 65%);
  overflow: hidden;
  box-shadow: 0 30px 120px rgba(3, 1, 10, 0.8);
}

.gridlines {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(90deg, rgba(79, 225, 255, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(79, 225, 255, 0.08) 1px, transparent 1px);
  background-size: 60px 60px;
  filter: drop-shadow(0 0 10px rgba(79, 225, 255, 0.4));
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(10px);
  opacity: 0.45;
}

.orb-a {
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(255, 79, 216, 0.6), transparent 60%);
  top: 10%;
  left: 5%;
  animation: drift 25s linear infinite;
}

.orb-b {
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(79, 225, 255, 0.7), transparent 60%);
  bottom: 8%;
  right: 10%;
  animation: drift 18s linear infinite reverse;
}

.runner {
  position: absolute;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 25px rgba(255, 79, 216, 0.6);
  background: radial-gradient(circle, rgba(255, 79, 216, 0.35), rgba(3, 1, 10, 0.8));
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: top 0.15s ease, left 0.15s ease;
}

.runner .pulse {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.5);
  animation: pulse 2s ease-in-out infinite;
}

.runner::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.35);
  animation: spin 6s linear infinite;
}

.runner.caught {
  box-shadow: 0 0 45px rgba(255, 255, 255, 0.95);
  border-color: var(--neon-lime);
}

.ghost {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4);
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  mix-blend-mode: screen;
}

.ghost::before,
.ghost::after {
  content: '';
  position: absolute;
  inset: 50% auto auto 50%;
  width: 2px;
  height: 22px;
  background: rgba(255, 255, 255, 0.45);
  transform: translate(-50%, -50%);
}

.ghost::after {
  width: 22px;
  height: 2px;
}

.alias-panel {
  width: min(90vw, 720px);
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.5rem;
}

.alias-core {
  padding: 2rem;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(2, 2, 12, 0.8);
  box-shadow: inset 0 0 60px rgba(79, 225, 255, 0.1), 0 20px 60px rgba(0, 0, 0, 0.6);
  text-align: center;
}

.alias-ticker {
  margin: 0;
  font-family: var(--font-mono);
  font-size: clamp(1.4rem, 4vw, 2.6rem);
  color: var(--neon-lime);
  text-transform: lowercase;
  text-shadow: 0 0 18px rgba(123, 255, 156, 0.4);
  letter-spacing: 0.08em;
}

.alias-ticker.glitch {
  animation: glitch 0.4s steps(2) 1;
}

.alias-stream {
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 1.4rem 1.8rem;
  background: rgba(4, 4, 18, 0.85);
  font-family: var(--font-mono);
  font-size: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-height: 180px;
  overflow: hidden;
}

.alias-stream span {
  color: rgba(255, 255, 255, 0.8);
  text-transform: lowercase;
  letter-spacing: 0.05em;
}

.alias-stream span.catch {
  color: var(--neon-lime);
}

.alias-stream span.drift {
  color: var(--neon-cyan);
}

@keyframes flicker {
  0% {
    opacity: 0.4;
  }
  50% {
    opacity: 0.75;
  }
  100% {
    opacity: 0.4;
  }
}

@keyframes spin {
  from {
    rotate: 0deg;
  }
  to {
    rotate: 360deg;
  }
}

@keyframes pulse {
  0% {
    transform: scale(0.6);
    opacity: 0.2;
  }
  50% {
    transform: scale(1);
    opacity: 0.8;
  }
  100% {
    transform: scale(0.6);
    opacity: 0.2;
  }
}

@keyframes glitch {
  0% {
    transform: translate(-2px, -1px);
  }
  25% {
    transform: translate(3px, 2px);
  }
  50% {
    transform: translate(-3px, 2px);
  }
  75% {
    transform: translate(1px, -2px);
  }
  100% {
    transform: translate(0, 0);
  }
}

@keyframes drift {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(15px, -20px, 0) scale(1.1);
  }
  100% {
    transform: translate3d(-5px, 15px, 0) scale(1);
  }
}

@media (max-width: 700px) {
  .alias-panel {
    grid-template-columns: 1fr;
  }

  .shell {
    padding: 3rem 1.5rem 4rem;
  }
}
