/* === SUNBOW VECTOR AESTHETIC === */
:root {
  --phosphor-green: #33ff33;
  --phosphor-green-dim: #1a8c1a;
  --phosphor-green-glow: #00ff00;
  --amber: #ffb000;
  --amber-dim: #8c6600;
  --alert-red: #ff3333;
  --bg-black: #050505;
  --grid-line: #0a3a0a;
  --grid-line-bright: #145214;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-black);
  font-family: 'Courier New', monospace;
  color: var(--phosphor-green);
  cursor: crosshair;
}

#grid {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

#hud {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 24px;
  z-index: 10;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--phosphor-green-dim);
  background: linear-gradient(180deg, rgba(5,5,5,0.95) 0%, transparent 100%);
}

#hud .amber {
  color: var(--amber);
  animation: amberPulse 2s ease-in-out infinite;
}

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

#integrity-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-grow: 1;
  max-width: 300px;
}

#integrity-track {
  width: 140px;
  height: 8px;
  background: var(--bg-black);
  border: 1px solid var(--phosphor-green-dim);
}

#integrity-fill {
  height: 100%;
  width: 100%;
  background: var(--phosphor-green);
  transition: width 0.3s ease, background 0.3s ease;
  box-shadow: 0 0 6px var(--phosphor-green-glow);
}

#integrity-fill.warning {
  background: var(--amber);
  box-shadow: 0 0 6px var(--amber);
}

#integrity-fill.critical {
  background: var(--alert-red);
  box-shadow: 0 0 6px var(--alert-red);
}

#entity-count, #latency-readout {
  white-space: nowrap;
}

/* CRT OVERLAY EFFECTS */
#scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 20;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.15) 2px,
    rgba(0, 0, 0, 0.15) 4px
  );
}

#vignette {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 19;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.7) 100%);
}

/* CRT flicker on load */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100;
  pointer-events: none;
  background: var(--bg-black);
  animation: crtOn 0.6s steps(4) forwards;
}

@keyframes crtOn {
  0% { opacity: 1; }
  30% { opacity: 1; }
  60% { opacity: 0.5; }
  80% { opacity: 0.8; }
  100% { opacity: 0; }
}
