/* ══════════════════════════════════════════════════════════════════════
   Hermes Mission Control — Dark Retro Cyber Theme
   ══════════════════════════════════════════════════════════════════════ */

:root {
  --bg-primary:     #08080e;
  --bg-secondary:   #0d0f1a;
  --bg-tertiary:    #141627;
  --bg-card:        #06060c;
  --border:         #1e2133;
  --border-active:  #58a6ff;
  --text-primary:   #cfd7e3;
  --text-secondary: #89929e;
  --text-muted:     #4a5166;
  --accent-blue:    #58a6ff;
  --accent-green:   #3fb950;
  --accent-red:     #f85149;
  --accent-yellow:  #d29922;
  --accent-purple:  #bc8cff;
  --accent-cyan:    #39d2c0;
  --accent-orange:  #f0883e;
  --neon-glow-blue: rgba(88, 166, 255, 0.25);
  --neon-glow-green: rgba(63, 185, 80, 0.25);
  --shadow:         0 1px 3px rgba(0,0,0,0.5);
  --radius:         8px;
  --radius-sm:      4px;
  --font:           ui-monospace, SFMono-Regular, 'Cascadia Code', 'Fira Code', Menlo, Consolas, monospace;
  --font-sans:      -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-pixel:     'Press Start 2P', ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 15px; }

/* ── CRT Scanline + Vignette (body overlay) ──────────────────────── */

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* CRT scanline pattern — extremely subtle */
body::after {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.06) 2px,
    rgba(0, 0, 0, 0.06) 4px
  );
}

/* CRT vignette — darker corners */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9998;
  background: radial-gradient(
    ellipse at center,
    transparent 60%,
    rgba(0, 0, 0, 0.4) 100%
  );
}

/* ── Header ──────────────────────────────────────────────────────── */

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
  animation: header-flicker 4s infinite step-end;
}

@keyframes header-flicker {
  0%, 97%, 100% { opacity: 1; }
  98% { opacity: 0.97; }
  99% { opacity: 0.99; }
}

.header-left { display: flex; align-items: center; gap: 1rem; }
.header-right { display: flex; align-items: center; gap: 1rem; }

header h1 {
  font-family: var(--font-pixel);
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0;
  color: var(--accent-blue);
  letter-spacing: 0.06em;
  text-shadow:
    0 0 4px var(--neon-glow-blue),
    0 0 12px var(--neon-glow-blue),
    1px 1px 0 rgba(0,0,0,0.5);
}

.conn-status {
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
}
.clock {
  font-family: var(--font);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── Dots ─────────────────────────────────────────────────────────── */

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-offline { background: var(--text-muted); }
.dot-online {
  background: var(--accent-green);
  box-shadow: 0 0 6px var(--accent-green);
  animation: terminal-blink 2s step-end infinite;
}
.dot-error { background: var(--accent-red); }
.dot-warn { background: var(--accent-yellow); }

.dot-pulse {
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(63,185,80,0.5); }
  50% { opacity: 0.5; box-shadow: 0 0 0 6px rgba(63,185,80,0); }
}

/* Terminal-style blink for live status */
@keyframes terminal-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ── Stats Row ────────────────────────────────────────────────────── */

.stats-row {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  overflow-x: auto;
  flex-wrap: nowrap;
}

.stat-card {
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1.25rem;
  min-width: 130px;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.stat-card:hover {
  border-color: var(--accent-blue);
  box-shadow:
    0 0 8px var(--neon-glow-blue),
    inset 0 0 8px rgba(88,166,255,0.03);
}

.stat-value {
  font-family: var(--font-pixel);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-blue);
  line-height: 1.3;
  text-shadow:
    0 0 4px var(--neon-glow-blue),
    0 0 10px rgba(88,166,255,0.1);
}
.stat-label {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

/* ── Dashboard Grid ───────────────────────────────────────────────── */

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding: 0 1.5rem 1.5rem;
}

/* ── Panels ───────────────────────────────────────────────────────── */

.panel {
  position: relative;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.35);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.panel:hover {
  border-color: var(--accent-blue);
  box-shadow:
    3px 3px 0 rgba(0,0,0,0.35),
    0 0 10px var(--neon-glow-blue);
}
.panel-full { grid-column: 1 / -1; }

.panel h2 {
  font-family: var(--font-pixel);
  font-size: 0.65rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--border);
  color: var(--accent-blue);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-shadow:
    0 0 4px var(--neon-glow-blue),
    0 0 8px rgba(88,166,255,0.08);
}

/* Pixel corner accents on panels */
.panel::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 6px;
  height: 6px;
  border-top: 2px solid var(--accent-blue);
  border-left: 2px solid var(--accent-blue);
  opacity: 0.35;
  pointer-events: none;
}
.panel::after {
  content: '';
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  border-bottom: 2px solid var(--accent-blue);
  border-right: 2px solid var(--accent-blue);
  opacity: 0.35;
  pointer-events: none;
}

.subhead {
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 600;
  margin: 0.75rem 0 0.4rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge-count {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.65rem;
  padding: 1px 8px;
  border-radius: 10px;
  margin-left: auto;
}

/* ── Gateway Panel ────────────────────────────────────────────────── */

#gateway-content { font-size: 0.8rem; }
.gw-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  border-bottom: 1px solid rgba(30,33,51,0.5);
}
.gw-row:last-of-type { border-bottom: none; }
.gw-label { color: var(--text-secondary); }
.gw-value { font-family: var(--font); color: var(--text-primary); }

.gw-platform {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 0;
  font-size: 0.78rem;
}
.gw-platform .plat-name { color: var(--text-secondary); }
.gw-platform .plat-status { font-family: var(--font); }

/* ── Log Stream ───────────────────────────────────────────────────── */

.log-stream {
  flex: 1;
  max-height: 320px;
  overflow-y: auto;
  font-family: var(--font);
  font-size: 0.72rem;
  line-height: 1.5;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  border: 1px solid rgba(30,33,51,0.4);
}

.log-entry {
  padding: 2px 4px;
  border-bottom: 1px solid rgba(30,33,51,0.2);
  word-break: break-all;
  transition: background 0.15s;
}
.log-entry:hover { background: var(--bg-tertiary); }
.log-entry .log-ts { color: var(--text-muted); margin-right: 6px; }
.log-entry .log-level { display: inline-block; width: 4.5em; font-weight: 600; }
.log-level.info { color: var(--accent-blue); }
.log-level.warn { color: var(--accent-yellow); }
.log-level.error { color: var(--accent-red); }
.log-level.debug { color: var(--text-muted); }
.log-empty { color: var(--text-muted); text-align: center; padding: 2rem 0; }

/* ── Token Bars ───────────────────────────────────────────────────── */

#token-content { display: flex; flex-direction: column; gap: 6px; }

.token-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
}
.token-label {
  width: 7em;
  color: var(--text-secondary);
  text-align: right;
  flex-shrink: 0;
}
.token-bar-wrap {
  flex: 1;
  height: 14px;
  background: var(--bg-card);
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid rgba(30,33,51,0.3);
}
.token-bar {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-blue), #79c0ff);
  border-radius: 7px;
  transition: width 0.5s ease;
  box-shadow: 0 0 6px var(--neon-glow-blue);
}
.token-bar.bar-out {
  background: linear-gradient(90deg, var(--accent-purple), #d2a8ff);
  box-shadow: 0 0 6px rgba(188,140,255,0.25);
}
.token-bar.bar-cache {
  background: linear-gradient(90deg, var(--accent-cyan), #56d4c4);
  box-shadow: 0 0 6px rgba(57,210,192,0.25);
}
.token-bar.bar-reason {
  background: linear-gradient(90deg, var(--accent-orange), #f8a55a);
  box-shadow: 0 0 6px rgba(240,136,62,0.25);
}
.token-val {
  font-family: var(--font);
  font-size: 0.72rem;
  color: var(--text-primary);
  width: 7em;
  text-align: right;
  white-space: nowrap;
}

.token-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}
.token-total .token-label { width: auto; }
.token-cost {
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-green);
  text-shadow: 0 0 8px var(--neon-glow-green);
}

/* ── Tables ───────────────────────────────────────────────────────── */

.table-wrap {
  flex: 1;
  overflow-x: auto;
  max-height: 320px;
  overflow-y: auto;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  white-space: nowrap;
}

.dash-table th {
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  padding: 6px 8px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
  z-index: 1;
  font-family: var(--font-pixel);
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.dash-table th.num { text-align: right; }

.dash-table td {
  padding: 4px 8px;
  border-bottom: 1px solid rgba(30,33,51,0.3);
  font-family: var(--font);
}
.dash-table td.num { text-align: right; }
.dash-table tr:hover td {
  background: var(--bg-tertiary);
}
/* Alternating row stripes for readability */
.dash-table tbody tr:nth-child(even) td {
  background: rgba(20, 22, 39, 0.4);
}
.dash-table tbody tr:nth-child(even):hover td {
  background: var(--bg-tertiary);
}

.loading-cell {
  text-align: center !important;
  color: var(--text-muted);
  padding: 2rem !important;
}

/* Status badges in tables */
.status-badge {
  display: inline-block;
  font-size: 0.65rem;
  padding: 1px 8px;
  border-radius: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-family: var(--font);
}
.status-badge.running,
.status-badge.active    { background: rgba(63,185,80,0.12); color: var(--accent-green); box-shadow: 0 0 4px rgba(63,185,80,0.15); }
.status-badge.todo,
.status-badge.pending   { background: rgba(138,146,158,0.12); color: var(--text-secondary); }
.status-badge.ready     { background: rgba(88,166,255,0.12); color: var(--accent-blue); box-shadow: 0 0 4px rgba(88,166,255,0.15); }
.status-badge.done,
.status-badge.completed { background: rgba(63,185,80,0.12); color: var(--accent-green); box-shadow: 0 0 4px rgba(63,185,80,0.15); }
.status-badge.blocked   { background: rgba(248,81,73,0.12); color: var(--accent-red); box-shadow: 0 0 4px rgba(248,81,73,0.15); }
.status-badge.error,
.status-badge.failed    { background: rgba(248,81,73,0.12); color: var(--accent-red); box-shadow: 0 0 4px rgba(248,81,73,0.15); }
.status-badge.scheduled { background: rgba(210,153,34,0.12); color: var(--accent-yellow); box-shadow: 0 0 4px rgba(210,153,34,0.15); }

/* ── Kanban Board ─────────────────────────────────────────────────── */

.kanban-board {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 4px;
  min-height: 200px;
}

.kanban-col {
  min-width: 220px;
  max-width: 280px;
  flex: 1;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.kanban-col-header {
  padding: 0.5rem 0.75rem;
  font-family: var(--font-pixel);
  font-size: 0.58rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 2px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--accent-blue);
  text-shadow: 0 0 4px var(--neon-glow-blue);
}
.kanban-col-header .col-count {
  background: var(--bg-tertiary);
  padding: 0 8px;
  border-radius: 10px;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.65rem;
}

.kanban-cards {
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  max-height: 400px;
}

.kanban-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.65rem;
  font-size: 0.72rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.kanban-card:hover {
  border-color: var(--accent-blue);
  box-shadow: 0 0 6px var(--neon-glow-blue);
}
.kanban-card .card-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
  word-break: break-word;
}
.kanban-card .card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}
.kanban-card .card-assignee {
  font-size: 0.65rem;
  color: var(--accent-purple);
}
.kanban-card .card-priority {
  font-size: 0.6rem;
  color: var(--text-muted);
}

/* ── Profile Grid ─────────────────────────────────────────────────── */

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.profile-card:hover {
  border-color: var(--accent-blue);
  box-shadow: 0 0 6px var(--neon-glow-blue);
}

.profile-card .prof-name {
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.profile-card .prof-model {
  font-size: 0.72rem;
  color: var(--text-secondary);
}
.profile-card .prof-desc {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.profile-card .prof-gw {
  font-size: 0.68rem;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}
.prof-gw .gw-running { color: var(--accent-green); }
.prof-gw .gw-stopped { color: var(--accent-red); }

/* ── Agent Arena ──────────────────────────────────────────────────── */

.arena-panel {
  margin-bottom: 0.5rem;
  overflow: hidden;
}

.arena-canvas-controls {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

.arena-status-badge {
  font-family: var(--font-pixel);
  font-size: 0.58rem;
  color: var(--accent-green);
  letter-spacing: 0.08em;
  text-shadow: 0 0 4px var(--neon-glow-green);
  animation: terminal-blink 2.5s step-end infinite;
}

.arena-canvas-wrap {
  position: relative;
  width: 100%;
  height: 460px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  box-shadow: inset 0 0 40px rgba(0,0,0,0.5);
  overflow: hidden;
}

#arena-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: default;
}

.arena-overlay-msg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
  pointer-events: none;
}

/* ── Scrollbar (retro style) ──────────────────────────────────────── */

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track {
  background: var(--bg-primary);
  border-left: 1px solid var(--border);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 0;
  border: 1px solid var(--bg-primary);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
::-webkit-scrollbar-corner {
  background: var(--bg-primary);
}

/* ── Focus / Keyboard Accessibility ──────────────────────────────── */

:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ── Selection ────────────────────────────────────────────────────── */

::selection {
  background: var(--accent-blue);
  color: var(--bg-primary);
}

/* ── Animations ───────────────────────────────────────────────────── */

@keyframes terminal-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(63,185,80,0.4); }
  50% { opacity: 0.5; box-shadow: 0 0 0 8px rgba(63,185,80,0); }
}

@keyframes header-flicker {
  0%, 97%, 100% { opacity: 1; }
  98% { opacity: 0.97; }
  99% { opacity: 0.99; }
}

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

@media (max-width: 900px) {
  .dash-grid { grid-template-columns: 1fr; }
  .panel-full { grid-column: 1; }
  header { flex-wrap: wrap; gap: 0.5rem; }
  .stats-row { flex-wrap: wrap; }
  .stat-card { min-width: 100px; flex: 1 1 calc(50% - 0.75rem); }
  .profile-grid { grid-template-columns: 1fr; }
  .kanban-board { flex-wrap: nowrap; }
  .kanban-col { min-width: 200px; max-width: 240px; }
  html { font-size: 14px; }
}

@media (max-width: 768px) {
  .arena-canvas-wrap { height: 320px; }
}

@media (max-width: 480px) {
  header { padding: 0.5rem 0.75rem; }
  .dash-grid { padding: 0 0.75rem 0.75rem; gap: 0.75rem; }
  .stats-row { padding: 0.5rem 0.75rem; gap: 0.5rem; }
  .stat-card { min-width: 80px; padding: 0.5rem 0.75rem; }
  .stat-value { font-size: 1rem; }
  .kanban-col { min-width: 170px; }
  .dash-table { font-size: 0.65rem; }
  .arena-canvas-wrap { height: 260px; }
}

/* ══════════════════════════════════════════════════════════════════════
   Retro CRT HUD Overlay — scanlines, vignette, pixel border, HUD elements
   ══════════════════════════════════════════════════════════════════════ */

/* ── Overlay Container ──────────────────────────────────────────── */
.retro-hud {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  border-radius: 6px;
  overflow: hidden;
  /* Pixel border via stacked shadows */
  box-shadow:
    inset 0 0 0 2px rgba(88,166,255,0.12),
    inset 0 0 0 1px rgba(88,166,255,0.06);
}

/* ── Scanlines (subtle CRT horizontal lines) ────────────────────── */
.retro-hud::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.06) 2px,
    rgba(0,0,0,0.06) 4px
  );
  z-index: 1;
  pointer-events: none;
}

/* ── Vignette (edges darken toward corners) ─────────────────────── */
.retro-hud::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 55%,
    rgba(0,0,0,0.35) 100%
  );
  z-index: 2;
  pointer-events: none;
}

/* ── HUD Corner Positions ───────────────────────────────────────── */
.hud-corner {
  position: absolute;
  z-index: 3;
  pointer-events: none;
}
.hud-tl { top: 8px; left: 10px; }
.hud-tr { top: 8px; right: 10px; text-align: right; }
.hud-bl { bottom: 8px; left: 10px; }
.hud-br { bottom: 8px; right: 10px; }

/* ── Pixel Corner Brackets (via pseudo-element) ─────────────────── */
.hud-corner::before {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: rgba(88,166,255,0.2);
  border-style: solid;
  pointer-events: none;
}
.hud-tl::before {
  top: -5px; left: -5px;
  border-width: 2px 0 0 2px;
}
.hud-tr::before {
  top: -5px; right: -5px;
  border-width: 2px 2px 0 0;
}
.hud-bl::before {
  bottom: -5px; left: -5px;
  border-width: 0 0 2px 2px;
}
.hud-br::before {
  bottom: -5px; right: -5px;
  border-width: 0 2px 2px 0;
}

/* ── HUD Corner background tile ─────────────────────────────────── */
.hud-corner {
  padding: 4px 6px;
  background: rgba(13,17,23,0.4);
  border: 1px solid rgba(88,166,255,0.08);
  border-radius: 2px;
}

/* ── System Health Bars (top-left) ──────────────────────────────── */
.hud-bar-label {
  font-family: 'Press Start 2P', ui-monospace, monospace;
  font-size: 0.55rem;
  color: var(--accent-blue);
  margin-bottom: 4px;
  letter-spacing: 0.1em;
  text-shadow: 0 0 6px rgba(88,166,255,0.3);
}
.hud-bar-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 2px;
}
.hud-bar-name {
  font-family: 'Press Start 2P', ui-monospace, monospace;
  font-size: 0.4rem;
  color: var(--text-secondary);
  width: 2.8em;
  letter-spacing: 0.05em;
}
.hud-bar-track {
  display: inline-block;
  width: 55px;
  height: 7px;
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(88,166,255,0.25);
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.4);
}
.hud-bar-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #2ea043, var(--accent-green), #6bdd7e);
  transition: width 0.5s ease;
  box-shadow: 0 0 4px rgba(63,185,80,0.3);
}
.hud-bar-fill.fill-mem {
  background: linear-gradient(90deg, #2563eb, var(--accent-blue), #79c0ff);
  box-shadow: 0 0 4px rgba(88,166,255,0.3);
}

/* ── Score / FPS (top-right) ────────────────────────────────────── */
.hud-score {
  font-family: 'Press Start 2P', ui-monospace, monospace;
  font-size: 0.55rem;
  color: var(--accent-green);
  text-shadow: 0 0 6px rgba(63,185,80,0.3);
  line-height: 1.8;
}
.hud-score-val {
  color: var(--accent-cyan);
  text-shadow: 0 0 6px rgba(57,210,192,0.3);
  font-size: 0.65rem;
}

/* ── Bottom Labels ──────────────────────────────────────────────── */
.hud-label {
  font-family: 'Press Start 2P', ui-monospace, monospace;
  font-size: 0.45rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  line-height: 1.6;
}

/* ── Responsive: scale down HUD on mobile ───────────────────────── */
@media (max-width: 600px) {
  .hud-corner { padding: 3px 4px; }
  .hud-bar-label { font-size: 0.45rem; }
  .hud-bar-name { font-size: 0.35rem; width: 2.4em; }
  .hud-bar-track { width: 40px; height: 6px; }
  .hud-score { font-size: 0.45rem; }
  .hud-score-val { font-size: 0.5rem; }
  .hud-label { font-size: 0.38rem; }
  .hud-tl { top: 5px; left: 6px; }
  .hud-tr { top: 5px; right: 6px; }
  .hud-bl { bottom: 5px; left: 6px; }
  .hud-br { bottom: 5px; right: 6px; }
}

@media (max-width: 400px) {
  .hud-bar-track { width: 28px; height: 5px; }
  .hud-bar-label { font-size: 0.38rem; }
  .hud-bar-name { font-size: 0.3rem; width: 2em; }
  .hud-score { font-size: 0.38rem; }
  .hud-label { font-size: 0.33rem; }
}
