/* ============================================================
   RETRODEX — hud.css — Persistent HUD (DOCTRINE §V)
   ============================================================
   Zelda hearts + FF cursor + arcade score counter + MGS radar
   Sticky top, present on all pages. Injected by hud.js.
   ============================================================ */

/* ── HUD Container ───────────────────────────────────────── */

.rdx-hud {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--rdx-bg);
  border-bottom: 1px solid var(--rdx-border);
  padding: 10px var(--rdx-gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--rdx-content-max);
  margin: 0 auto;
  font-family: var(--rdx-font-system);
}

/* ── Nav Tabs — FF cursor style ──────────────────────────── */

.rdx-hud-nav {
  display: flex;
  gap: 0;
}

.rdx-hud-tab {
  padding: 6px 16px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #4A4A42;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color var(--rdx-transition-fast), border-color var(--rdx-transition-fast);
}

.rdx-hud-tab:hover {
  color: var(--rdx-phosphor-dim);
}

.rdx-hud-tab.active {
  color: var(--rdx-phosphor);
  border-bottom-color: var(--rdx-phosphor);
}

/* ── Progress Bar — Zelda hearts style ───────────────────── */

.rdx-hud-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--rdx-phosphor-dim);
}

.rdx-hud-bar {
  width: 120px;
  height: 4px;
  background: var(--rdx-phosphor-off);
  border-radius: 2px;
  overflow: hidden;
}

.rdx-hud-bar-fill {
  height: 100%;
  background: var(--rdx-phosphor);
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* ── Value Counter — Arcade score ────────────────────────── */

.rdx-hud-value {
  font-size: 12px;
  color: var(--rdx-gold);
  font-weight: var(--rdx-weight-medium);
}

/* ── Codec Status — MGS radar ────────────────────────────── */

.rdx-hud-codec {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rdx-phosphor);
  opacity: 0.4;
}

.rdx-hud-codec.has-message {
  animation: codec-pulse 2s ease-in-out infinite;
  opacity: 1;
}

@keyframes codec-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; box-shadow: 0 0 6px var(--rdx-phosphor); }
}

/* ── Toggle Controls — CRT + Audio ───────────────────────── */

.rdx-hud-toggles {
  display: flex;
  gap: 4px;
  align-items: center;
}

.rdx-toggle {
  font-family: var(--rdx-font-system);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: #4A4A42;
  cursor: pointer;
  padding: 4px 8px;
  user-select: none;
}

.rdx-toggle:hover {
  color: var(--rdx-phosphor-dim);
}

/* ── Auth-gated elements ─────────────────────────────────── */

.rdx-hud-authed {
  display: none;
}

body.rdx-logged-in .rdx-hud-authed {
  display: flex;
}

body.rdx-logged-in .landing-cta-secondary[href*="auth"] {
  display: none;
}

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 640px) {
  .rdx-hud {
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px var(--rdx-gutter);
  }

  .rdx-hud-tab {
    padding: 4px 10px;
    font-size: 10px;
  }

  .rdx-hud-progress,
  .rdx-hud-value,
  .rdx-hud-toggles {
    display: none;
  }
}
