/* Nitro: a 1990s case modder's dream. Hot pink, cyan and acid green
   neon on black-purple; every panel sits on underglow cycling through
   the colours like cold-cathode tubes; a neon tube flickers under the
   top bar; the LCD is a glowing green VFD. Meets 4.5:1 like every
   theme; the motion stops for reduced motion. */
:root[data-theme="nitro-dark"] {
  --ps-bg-primary: #07040f;
  --ps-bg-secondary: #0f0820;
  --ps-bg-tertiary: #170d2f;
  --ps-border: #45208a;
  --ps-text-primary: #f6f2ff;
  --ps-text-secondary: #c7baff;
  --ps-text-inverse: #07040f;
  --ps-accent: #ff2bd6;
  --ps-accent-hover: #ff6be3;
  --ps-accent-subtle: #2b0a27;
  --ps-success: #39ff14;
  --ps-warning: #faff00;
  --ps-danger: #ff3b5c;
  --ps-info: #00e5ff;
  --ps-nav-bg: #0a0418;
  --ps-nav-text: #00e5ff;
  --ps-input-bg: #0b0618;
  --ps-input-border: #5a2fb0;
  --ps-table-header-bg: #170d2f;
  /* A VFD: glowing green on black */
  --lcd-bg: #02140b;
  --lcd-ink: #39ff14;
  /* The accent and state colours as text, and the buttons: readable
     (4.5:1) on this theme */
  --ps-accent-text: #ff2bd6;
  --ps-info-text: #00e5ff;
  --ps-success-text: #39ff14;
  --ps-warning-text: #faff00;
  --ps-danger-text: #ff3b5c;
  --ps-on-accent: #111418;
  --ps-accent-btn: #ff2bd6;
  --ps-accent-btn-hover: #ff6be3;
}

/* Blacklight: pools of UV light across the whole page (magenta, cyan,
   violet), slowly shifting colour */
:root[data-theme="nitro-dark"] body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 43, 214, 0.22), transparent 38%),
    radial-gradient(circle at 88% 26%, rgba(0, 229, 255, 0.18), transparent 40%),
    radial-gradient(circle at 70% 85%, rgba(57, 255, 20, 0.10), transparent 40%),
    radial-gradient(ellipse at 50% 110%, rgba(150, 60, 255, 0.40), transparent 60%),
    var(--ps-bg-primary);
  animation: ps-uv 24s linear infinite;
}
@keyframes ps-uv {
  from { filter: hue-rotate(0deg); }
  to { filter: hue-rotate(360deg); }
}
/* The page's own background stays solid dark under the blacklight
   (the body is clear so the UV layer shows) */
:root[data-theme="nitro-dark"] { background: var(--ps-bg-primary); }
:root[data-theme="nitro-dark"] body { background: transparent; }

/* The top bar floats on underglow */
:root[data-theme="nitro-dark"] header[role="banner"] {
  box-shadow: 0 8px 34px -4px rgba(255, 43, 214, 0.75), 0 16px 60px -10px rgba(0, 229, 255, 0.55);
}

/* A neon tube along the bottom of the top bar, flickering */
:root[data-theme="nitro-dark"] header[role="banner"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 3px;
  background: linear-gradient(90deg, #ff2bd6, #00e5ff, #39ff14, #faff00, #ff2bd6);
  background-size: 200% 100%;
  box-shadow: 0 0 10px #ff2bd6, 0 0 22px #00e5ff;
  animation: ps-tube 6s linear infinite, ps-flicker 9s steps(1) infinite;
  pointer-events: none;
}
@keyframes ps-tube { to { background-position: 200% 0; } }
@keyframes ps-flicker {
  0%, 100% { opacity: 1; }
  41% { opacity: 0.35; } 42% { opacity: 1; } 43% { opacity: 0.5; } 44% { opacity: 1; }
  77% { opacity: 0.6; } 78% { opacity: 1; }
}

/* Panels: a neon edge, and underglow beneath that cycles through the
   colours like cold-cathode tubes (in the panel's own shadow, so a
   panel that clips its contents still glows) */
:root[data-theme="nitro-dark"] .card,
:root[data-theme="nitro-dark"] .lcd-bezel {
  border-color: #ff2bd6;
  animation: ps-neon 8s linear infinite;
}
@keyframes ps-neon {
  0%, 100% { border-color: #ff2bd6; box-shadow: 0 0 0 1px rgba(255, 43, 214, 0.7), 0 0 24px rgba(255, 43, 214, 0.55), 0 28px 46px -12px rgba(255, 43, 214, 1), 0 44px 80px -20px rgba(255, 43, 214, 0.6); }
  25% { border-color: #00e5ff; box-shadow: 0 0 0 1px rgba(0, 229, 255, 0.7), 0 0 24px rgba(0, 229, 255, 0.55), 0 28px 46px -12px rgba(0, 229, 255, 1), 0 44px 80px -20px rgba(0, 229, 255, 0.6); }
  50% { border-color: #39ff14; box-shadow: 0 0 0 1px rgba(57, 255, 20, 0.7), 0 0 24px rgba(57, 255, 20, 0.5), 0 28px 46px -12px rgba(57, 255, 20, 1), 0 44px 80px -20px rgba(57, 255, 20, 0.55); }
  75% { border-color: #faff00; box-shadow: 0 0 0 1px rgba(250, 255, 0, 0.7), 0 0 24px rgba(250, 255, 0, 0.45), 0 28px 46px -12px rgba(250, 255, 0, 0.95), 0 44px 80px -20px rgba(250, 255, 0, 0.5); }
}
/* The panels glow out of step, like separate tubes */
:root[data-theme="nitro-dark"] .module-panel:nth-child(2n) .card,
:root[data-theme="nitro-dark"] .lcd-bezel:nth-of-type(2n) { animation-delay: -2s; }
:root[data-theme="nitro-dark"] .module-panel:nth-child(3n) .card { animation-delay: -4s; }

/* Panels sit apart, so each one's underglow shows */
:root[data-theme="nitro-dark"] .module-panel + .module-panel { margin-top: 1.75rem; }

/* Neon on everything else: buttons, inputs, the On Air stops, table
   rows, links */
:root[data-theme="nitro-dark"] .btn,
:root[data-theme="nitro-dark"] button {
  box-shadow: 0 0 12px rgba(255, 43, 214, 0.7), 0 8px 18px -6px rgba(0, 229, 255, 0.8);
}
:root[data-theme="nitro-dark"] input,
:root[data-theme="nitro-dark"] select,
:root[data-theme="nitro-dark"] textarea {
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.45);
}
:root[data-theme="nitro-dark"] input:focus,
:root[data-theme="nitro-dark"] select:focus,
:root[data-theme="nitro-dark"] textarea:focus {
  box-shadow: 0 0 14px rgba(255, 43, 214, 0.9), 0 0 2px #ff2bd6;
}
:root[data-theme="nitro-dark"] .lr-node {
  box-shadow: 0 0 12px color-mix(in srgb, var(--lr-c) 45%, transparent), 0 14px 22px -10px var(--lr-c);
}
:root[data-theme="nitro-dark"] tbody tr:hover {
  box-shadow: inset 0 0 18px rgba(255, 43, 214, 0.35);
}
:root[data-theme="nitro-dark"] a {
  text-shadow: 0 0 6px rgba(255, 43, 214, 0.7);
}

/* Toasts: the card may glow, but not what is on it (its dismiss and
   action buttons, links): on a card that small the halos run into the
   message */
:root[data-theme="nitro-dark"] .toast button,
:root[data-theme="nitro-dark"] .toast a {
  box-shadow: none;
  text-shadow: none;
}

/* Headings: neon, lit */
:root[data-theme="nitro-dark"] .card h2,
:root[data-theme="nitro-dark"] main h1 {
  color: var(--ps-info-text, #00e5ff);
  text-shadow: 0 0 6px rgba(0, 229, 255, 0.8), 0 0 14px rgba(255, 43, 214, 0.5);
}

/* The VFD glows */
:root[data-theme="nitro-dark"] .lcd-screen {
  text-shadow: 0 0 8px rgba(57, 255, 20, 0.85), 0 0 2px rgba(57, 255, 20, 1);
}
/* Modes that are off are unlit segments: dim, and without the glow, so
   the ones on stand out */
:root[data-theme="nitro-dark"] .lcd-mode:not(.enabled) {
  color: color-mix(in srgb, var(--lcd-ink) 14%, transparent);
  text-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  :root[data-theme="nitro-dark"] body::before,
  :root[data-theme="nitro-dark"] header[role="banner"]::after,
  :root[data-theme="nitro-dark"] .card,
  :root[data-theme="nitro-dark"] .lcd-bezel { animation: none; }
  :root[data-theme="nitro-dark"] .card,
  :root[data-theme="nitro-dark"] .lcd-bezel { box-shadow: 0 0 0 1px rgba(255, 43, 214, 0.5), 0 0 16px rgba(255, 43, 214, 0.45), 0 22px 30px -14px rgba(255, 43, 214, 0.95); }
}
