/* ============================================================================
 * J.A.R.V.I.S. Tactical Security HUD — Stark-Grade Holographic Interface CSS
 * Status-Reactive Color System:
 *   - SECURE   : Cyan / Electric Blue (#00f0ff)
 *   - WARNING  : Tactical Amber (#ffaa00)
 *   - CRITICAL : Threat Crimson (#ff2a4b)
 * ============================================================================ */

:root,
[data-status="secure"] {
  --hud-primary: #00f0ff;
  --hud-secondary: #0088ff;
  --hud-rgb: 0, 240, 255;
  --hud-glow: rgba(0, 240, 255, 0.35);
  --hud-glow-strong: rgba(0, 240, 255, 0.72);
  --hud-panel-bg: rgba(6, 17, 32, 0.78);
  --hud-panel-border: rgba(0, 240, 255, 0.28);
  --core-pulse-duration: 4.2s;
  --core-spin-duration: 28s;
}

[data-status="warning"] {
  --hud-primary: #ffaa00;
  --hud-secondary: #ff6a00;
  --hud-rgb: 255, 170, 0;
  --hud-glow: rgba(255, 170, 0, 0.38);
  --hud-glow-strong: rgba(255, 170, 0, 0.78);
  --hud-panel-bg: rgba(26, 16, 5, 0.80);
  --hud-panel-border: rgba(255, 170, 0, 0.36);
  --core-pulse-duration: 2.0s;
  --core-spin-duration: 14s;
}

[data-status="critical"] {
  --hud-primary: #ff2a4b;
  --hud-secondary: #ff0055;
  --hud-rgb: 255, 42, 75;
  --hud-glow: rgba(255, 42, 75, 0.45);
  --hud-glow-strong: rgba(255, 42, 75, 0.88);
  --hud-panel-bg: rgba(28, 6, 12, 0.84);
  --hud-panel-border: rgba(255, 42, 75, 0.48);
  --core-pulse-duration: 0.95s;
  --core-spin-duration: 6s;
}

:root {
  --bg-void: #03070e;
  --bg-deep: #060e1c;
  --text-bright: #e8faff;
  --text-main: #b4dce8;
  --text-muted: #658ea1;
  --color-cyan: #00f0ff;
  --color-amber: #ffaa00;
  --color-red: #ff2a4b;
  --color-green: #00ff9d;
  --font-display: 'Orbitron', system-ui, -apple-system, sans-serif;
  --font-ui: 'Rajdhani', system-ui, -apple-system, sans-serif;
  --font-mono: 'Share Tech Mono', ui-monospace, SFMono-Regular, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  min-height: 100%;
  background-color: var(--bg-void);
  color: var(--text-bright);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.4;
  overflow-x: hidden;
  transition: background-color 0.5s ease, color 0.3s ease;
}

/* Animated Tactical Hex & Grid Background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(circle at 50% 22%, rgba(var(--hud-rgb), 0.12) 0%, transparent 60%),
    linear-gradient(rgba(var(--hud-rgb), 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--hud-rgb), 0.04) 1px, transparent 1px);
  background-size: 100% 100%, 32px 32px, 32px 32px;
  transition: background-image 0.6s ease;
}

/* Subtle CRT / Holographic Scanline Overlay */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 900;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(0, 0, 0, 0.18) 4px
  );
  opacity: 0.45;
}

/* ============================================================================
 * Boot Sequence Overlay
 * ============================================================================ */
.boot-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: radial-gradient(circle at center, #071629 0%, #02050a 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  transition: opacity 0.55s ease, visibility 0.55s ease;
}

.boot-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.boot-reactor {
  width: 118px;
  height: 118px;
  margin-bottom: 22px;
  animation: spinSlow 4s linear infinite;
  filter: drop-shadow(0 0 18px var(--color-cyan));
}

.boot-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 0.22em;
  color: var(--color-cyan);
  text-shadow: 0 0 14px rgba(0, 240, 255, 0.7);
  margin-bottom: 6px;
  text-align: center;
}

.boot-subtitle {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.14em;
  margin-bottom: 18px;
  text-transform: uppercase;
}

.boot-progress-track {
  width: min(380px, 90vw);
  height: 5px;
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 16px;
}

.boot-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0077ff, #00f0ff, #ffffff);
  box-shadow: 0 0 12px #00f0ff;
  transition: width 0.12s linear;
}

.boot-terminal {
  width: min(440px, 92vw);
  height: 155px;
  background: rgba(3, 10, 20, 0.85);
  border: 1px solid rgba(0, 240, 255, 0.28);
  border-radius: 6px;
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: #8ceeff;
  overflow-y: auto;
  margin-bottom: 20px;
  box-shadow: inset 0 0 18px rgba(0, 240, 255, 0.08);
}

.boot-terminal-line {
  margin-bottom: 4px;
  opacity: 0.92;
}

.boot-terminal-line .ok {
  color: var(--color-green);
}

/* ============================================================================
 * Login Gate Screen
 * ============================================================================ */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 1500;
  background: radial-gradient(circle at 50% 30%, #081b33 0%, #02050a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-overlay.hidden {
  display: none;
}

.auth-card {
  width: min(420px, 94vw);
  background: rgba(6, 17, 32, 0.92);
  border: 1px solid rgba(var(--hud-rgb), 0.45);
  border-radius: 10px;
  padding: 28px 22px;
  box-shadow: 0 0 36px rgba(var(--hud-rgb), 0.22), inset 0 0 24px rgba(var(--hud-rgb), 0.06);
  position: relative;
}

/* ============================================================================
 * Main HUD Layout & Top Header Bar
 * ============================================================================ */
.hud-app {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 12px 94px 12px;
}

.hud-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
  background: var(--hud-panel-bg);
  border: 1px solid var(--hud-panel-border);
  border-radius: 8px;
  backdrop-filter: blur(10px);
  box-shadow: 0 0 18px rgba(var(--hud-rgb), 0.12);
}

.hud-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hud-brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  box-shadow: 0 0 10px var(--hud-glow);
}

.hud-brand-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: var(--hud-primary);
  text-shadow: 0 0 10px var(--hud-glow);
}

.hud-brand-sub {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

.hud-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid var(--hud-primary);
  color: var(--hud-primary);
  background: rgba(var(--hud-rgb), 0.12);
  box-shadow: 0 0 12px var(--hud-glow);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hud-primary);
  box-shadow: 0 0 8px var(--hud-primary);
  animation: pulseDot 1.6s infinite ease-in-out;
}

/* ============================================================================
 * Glassmorphic HUD Panels with Corner Reticles
 * ============================================================================ */
.hud-panel {
  position: relative;
  background: var(--hud-panel-bg);
  border: 1px solid var(--hud-panel-border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 14px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45), inset 0 0 18px rgba(var(--hud-rgb), 0.04);
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.hud-panel::before,
.hud-panel::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: var(--hud-primary);
  border-style: solid;
  pointer-events: none;
  opacity: 0.75;
}

.hud-panel::before {
  top: -1px;
  left: -1px;
  border-width: 2px 0 0 2px;
  border-top-left-radius: 8px;
}

.hud-panel::after {
  bottom: -1px;
  right: -1px;
  border-width: 0 2px 2px 0;
  border-bottom-right-radius: 8px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(var(--hud-rgb), 0.18);
}

.panel-title {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--hud-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-meta {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: var(--text-muted);
}

/* ============================================================================
 * Central Arc Reactor Core Hero Section
 * ============================================================================ */
.core-hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 768px) {
  .core-hero-grid {
    grid-template-columns: 1.05fr 1.25fr;
    align-items: stretch;
  }
}

.arc-core-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px 16px;
  overflow: hidden;
}

.arc-reactor-wrap {
  position: relative;
  width: 230px;
  height: 230px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px auto 12px auto;
  cursor: pointer;
}

.arc-ring-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 14px var(--hud-glow));
}

.arc-ring-outer {
  transform-origin: 50% 50%;
  animation: spinSlow var(--core-spin-duration) linear infinite;
}

.arc-ring-mid {
  transform-origin: 50% 50%;
  animation: spinReverse calc(var(--core-spin-duration) * 0.75) linear infinite;
}

.arc-ring-core {
  transform-origin: 50% 50%;
  animation: corePulse var(--core-pulse-duration) ease-in-out infinite;
}

.arc-center-readout {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.arc-status-label {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  color: var(--text-bright);
  text-shadow: 0 0 14px var(--hud-glow-strong);
}

.arc-uptime-label {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: var(--hud-primary);
  margin-top: 3px;
}

.core-quick-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  width: 100%;
}

/* ============================================================================
 * 4 Animated Circular Gauges (CPU, RAM, DISK, NETWORK)
 * ============================================================================ */
.gauges-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.gauge-card {
  background: rgba(4, 12, 24, 0.72);
  border: 1px solid rgba(var(--hud-rgb), 0.22);
  border-radius: 8px;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

.gauge-svg-wrap {
  position: relative;
  width: 108px;
  height: 108px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gauge-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.gauge-track {
  fill: none;
  stroke: rgba(var(--hud-rgb), 0.14);
  stroke-width: 8;
}

.gauge-arc {
  fill: none;
  stroke: var(--hud-primary);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 264;
  stroke-dashoffset: 264;
  transition: stroke-dashoffset 0.65s cubic-bezier(0.22, 1, 0.36, 1), stroke 0.3s ease;
  filter: drop-shadow(0 0 6px var(--hud-glow));
}

.gauge-value-box {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.gauge-number {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-bright);
}

.gauge-unit {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--hud-primary);
}

.gauge-title {
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-main);
  margin-top: 6px;
}

.gauge-sub {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ============================================================================
 * Alert Summary Counters (24h / 7d) & Services Grid
 * ============================================================================ */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

@media (min-width: 640px) {
  .stats-strip {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-box {
  background: rgba(4, 13, 25, 0.8);
  border: 1px solid rgba(var(--hud-rgb), 0.24);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
}

.stat-box-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-box-val {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  margin-top: 4px;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.service-node {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  background: rgba(3, 11, 22, 0.76);
  border: 1px solid rgba(var(--hud-rgb), 0.22);
  border-radius: 7px;
}

.service-led {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.service-led.online {
  background: var(--color-cyan);
  box-shadow: 0 0 10px var(--color-cyan);
}

.service-led.offline {
  background: var(--color-red);
  box-shadow: 0 0 12px var(--color-red);
  animation: pulseDot 0.8s infinite;
}

.service-info {
  overflow: hidden;
}

.service-name {
  font-weight: 700;
  font-size: 0.84rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.service-unit {
  font-family: var(--font-mono);
  font-size: 0.67rem;
  color: var(--text-muted);
}

/* ============================================================================
 * World Map Origin Radar & Live Logins Feed
 * ============================================================================ */
.map-container {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 1;
  max-height: 290px;
  background: radial-gradient(circle at center, rgba(0, 42, 75, 0.35), rgba(2, 8, 16, 0.92));
  border: 1px solid rgba(var(--hud-rgb), 0.25);
  border-radius: 8px;
  overflow: hidden;
}

.world-map-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.login-feed {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
}

.login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  background: rgba(3, 11, 22, 0.72);
  border-left: 3px solid var(--color-cyan);
  border-radius: 5px;
  font-size: 0.86rem;
}

.login-row.failed {
  border-left-color: var(--color-red);
  background: rgba(32, 8, 15, 0.65);
}

.login-row.new-origin {
  border-left-color: var(--color-amber);
}

/* ============================================================================
 * Chronological Alerts / Messages Terminal Inbox
 * ============================================================================ */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.hud-input,
.hud-select {
  background: rgba(3, 11, 22, 0.9);
  border: 1px solid rgba(var(--hud-rgb), 0.35);
  color: var(--text-bright);
  padding: 10px 12px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  min-height: 44px;
}

.hud-input:focus,
.hud-select:focus {
  outline: none;
  border-color: var(--hud-primary);
  box-shadow: 0 0 12px var(--hud-glow);
}

.alerts-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.alert-card {
  padding: 12px 14px;
  background: rgba(5, 14, 28, 0.84);
  border: 1px solid rgba(var(--hud-rgb), 0.25);
  border-left: 4px solid var(--color-cyan);
  border-radius: 7px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.alert-card:hover,
.alert-card:active {
  transform: translateY(-1px);
  box-shadow: 0 0 16px rgba(var(--hud-rgb), 0.18);
}

.alert-card.sev-critical {
  border-left-color: var(--color-red);
  background: rgba(30, 8, 14, 0.82);
}

.alert-card.sev-warning {
  border-left-color: var(--color-amber);
  background: rgba(28, 18, 6, 0.82);
}

.alert-card.unread {
  box-shadow: inset 0 0 12px rgba(var(--hud-rgb), 0.12);
}

.alert-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.sev-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sev-badge.critical {
  background: rgba(255, 42, 75, 0.22);
  color: #ff6b81;
  border: 1px solid var(--color-red);
}

.sev-badge.warning {
  background: rgba(255, 170, 0, 0.22);
  color: #ffc857;
  border: 1px solid var(--color-amber);
}

.sev-badge.info {
  background: rgba(0, 240, 255, 0.16);
  color: var(--color-cyan);
  border: 1px solid var(--color-cyan);
}

.alert-title {
  font-weight: 700;
  font-size: 0.96rem;
  color: var(--text-bright);
}

.alert-msg {
  font-size: 0.85rem;
  color: var(--text-main);
  margin-top: 3px;
}

.alert-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 7px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ============================================================================
 * Buttons & Interactive Controls (Large Touch Targets for Android)
 * ============================================================================ */
.hud-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 9px 15px;
  background: rgba(var(--hud-rgb), 0.13);
  border: 1px solid var(--hud-primary);
  color: var(--hud-primary);
  border-radius: 6px;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
}

.hud-btn:hover,
.hud-btn:active {
  background: rgba(var(--hud-rgb), 0.26);
  box-shadow: 0 0 14px var(--hud-glow);
}

.hud-btn.danger {
  border-color: var(--color-red);
  color: #ff6b81;
  background: rgba(255, 42, 75, 0.15);
}

.hud-btn.amber {
  border-color: var(--color-amber);
  color: #ffc857;
  background: rgba(255, 170, 0, 0.15);
}

/* ============================================================================
 * Bottom Mobile HUD Navigation Bar
 * ============================================================================ */
.hud-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(3, 9, 19, 0.94);
  border-top: 1px solid var(--hud-panel-border);
  backdrop-filter: blur(12px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.6);
}

.nav-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 62px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  transition: color 0.2s ease;
}

.nav-tab svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}

.nav-tab.active {
  color: var(--hud-primary);
  text-shadow: 0 0 8px var(--hud-glow);
}

.nav-tab.active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--hud-primary);
  box-shadow: 0 0 10px var(--hud-primary);
}

.nav-badge {
  position: absolute;
  top: 6px;
  right: calc(50% - 22px);
  background: var(--color-red);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 1px 5px;
  border-radius: 999px;
  box-shadow: 0 0 8px var(--color-red);
}

/* ============================================================================
 * Modal Dialog (Alert Detail & Install Guide)
 * ============================================================================ */
.hud-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1800;
  background: rgba(2, 6, 14, 0.84);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.hud-modal-backdrop.hidden {
  display: none;
}

.hud-modal {
  width: min(580px, 96vw);
  max-height: 88vh;
  overflow-y: auto;
  background: #061224;
  border: 1px solid var(--hud-primary);
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 0 36px var(--hud-glow);
}

.terminal-box {
  background: #02060d;
  border: 1px solid rgba(var(--hud-rgb), 0.28);
  border-radius: 6px;
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: #9beeff;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 10px 0;
}

/* Toggle Switch */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(var(--hud-rgb), 0.12);
}

.hud-toggle {
  position: relative;
  width: 50px;
  height: 28px;
  appearance: none;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(var(--hud-rgb), 0.4);
  border-radius: 999px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.25s ease;
}

.hud-toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text-main);
  transition: transform 0.25s ease, background 0.25s ease;
}

.hud-toggle:checked {
  background: rgba(var(--hud-rgb), 0.32);
  border-color: var(--hud-primary);
}

.hud-toggle:checked::after {
  transform: translateX(22px);
  background: var(--hud-primary);
  box-shadow: 0 0 8px var(--hud-primary);
}

/* Keyframes */
@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes spinReverse {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

@keyframes corePulse {
  0%, 100% { transform: scale(0.96); opacity: 0.88; }
  50% { transform: scale(1.05); opacity: 1; }
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* Battery Saver (Lite Mode), Background Tab Pause & Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body[data-lite="true"] *,
body[data-paused="true"] * {
  animation-play-state: paused !important;
}

body[data-lite="true"] .hud-panel,
body[data-lite="true"] .hud-topbar {
  backdrop-filter: none !important;
  box-shadow: none !important;
}

body[data-lite="true"]::after {
  display: none !important;
}

