/* === Cyberpsychosis Danger HUD — Grid Protocol === */

.cp-hud {
  position: relative;
  z-index: 9990;
  pointer-events: none;
  display: flex;
  justify-content: center;
  padding: 6px 0;
  background: rgb(12 12 14 / 0.92);
  border-bottom: 1px solid var(--line);
}
.cp-hud-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cp-hud-label { color: var(--fg-muted); white-space: nowrap; }

.cp-hud-bar-track {
  width: 110px;
  height: 4px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.cp-hud-bar-fill {
  height: 100%;
  width: 100%;
  background: var(--fg);
  transition: width 280ms ease;
}

.cp-hud-pct {
  color: var(--fg);
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  min-width: 42px;
  text-align: right;
}

.cp-hud.cp-unstable .cp-hud-label { color: var(--fg); }
.cp-hud.cp-critical,
.cp-hud.cp-cyberpsych {
  box-shadow: var(--shadow-glow);
}
.cp-hud.cp-critical .cp-hud-label,
.cp-hud.cp-cyberpsych .cp-hud-label {
  color: var(--fg);
  font-weight: 600;
}

/* Edge-only silver vignette. No scanlines, no RGB split, no flicker. */
.cp-glitch {
  position: fixed;
  inset: 0;
  z-index: 9985;
  pointer-events: none;
  background: transparent;
}
.cp-glitch.cp-glitch-l2 { box-shadow: inset 0 0 90px rgb(255 255 255 / 0.03); }
.cp-glitch.cp-glitch-l3 { box-shadow: inset 0 0 70px rgb(255 255 255 / 0.06); }
.cp-glitch.cp-glitch-l4 { box-shadow: inset 0 0 48px rgb(255 255 255 / 0.1); }

/* === Warning overlay === */
.cp-warn-overlay {
  position: fixed;
  inset: 0;
  z-index: 9995;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgb(5 5 6 / 0.78);
  backdrop-filter: blur(6px);
}
.cp-warn-box {
  position: relative;
  text-align: center;
  max-width: 440px;
  padding: 32px 28px;
  background: var(--bg-elevated);
}

.cp-warn-icon {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 12px;
}

.cp-warn-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg);
  margin-bottom: 12px;
}

.cp-warn-msg {
  font-size: 16px;
  color: var(--fg-muted);
  line-height: 1.5;
  margin-bottom: 24px;
}

.cp-warn-actions { display: flex; gap: 12px; justify-content: center; }

.cp-warn-btn {
  font-size: 14px;
  font-weight: 600;
  padding: 8px 14px;
  border: 1px solid var(--fg);
  border-radius: 4px;
  background: var(--fg);
  color: var(--bg);
  cursor: pointer;
  letter-spacing: 0.04em;
  box-shadow: var(--shadow-glow);
  transition: opacity 180ms ease, transform 180ms ease;
}
.cp-warn-btn:hover { opacity: 0.88; }
.cp-warn-btn:active { transform: translateY(1px); }
.cp-warn-btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--fg);
  box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  .cp-hud-bar-fill,
  .cp-warn-btn { transition: none; }
}
