:root {
  --bg: #02050a;
  --cyan: #00ffff;
  --pink: #ff007f;
  --green: #00ff66;
  --fg: #e8f0f4;
  --panel: rgba(6, 12, 20, 0.55);
  --border: rgba(0, 255, 200, 0.25);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; background: var(--bg); overflow: hidden; }
body { font-family: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace; color: var(--fg); }

#canvas-container { position: fixed; inset: 0; z-index: 0; }

#ui-overlay { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
#ui-overlay .hud { position: absolute; pointer-events: auto; }

.top-left { top: 18px; left: 18px; }
.top-right { top: 18px; right: 18px; }

.brand { font-size: 20px; font-weight: 700; letter-spacing: 2px; text-shadow: 0 0 12px var(--cyan); }
.brand .v { font-size: 11px; font-weight: 400; opacity: 0.6; letter-spacing: 1px; }

.row { margin-top: 10px; font-size: 12px; opacity: 0.85; }
.row .label { opacity: 0.5; margin-right: 6px; }

.status { font-weight: 700; padding: 1px 6px; border-radius: 3px; font-size: 11px; }
.status.disconnected, .status.error { color: #ff5a5a; }
.status.connected { color: var(--green); }
.status.demo { color: #ffcc33; }

.stats { margin-top: 12px; font-size: 12px; line-height: 1.8; }
.stats .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: middle; }
.stats span[id] { color: #fff; margin-left: 6px; }
.dot.cyan { background: var(--cyan); box-shadow: 0 0 6px var(--cyan); }
.dot.pink { background: var(--pink); box-shadow: 0 0 6px var(--pink); }
.dot.green { background: var(--green); box-shadow: 0 0 6px var(--green); }
.muted { opacity: 0.5; font-size: 11px; }

.styles { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.style-btn {
  pointer-events: auto; cursor: pointer; font-family: inherit; font-size: 12px;
  color: var(--fg); background: var(--panel); border: 1px solid var(--border);
  padding: 6px 12px; border-radius: 5px; backdrop-filter: blur(8px); transition: 0.15s;
}
.style-btn:hover { border-color: var(--cyan); }
.style-btn.active { color: var(--bg); background: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 14px rgba(0, 255, 255, 0.5); font-weight: 700; }

.bottom-bar { bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; max-width: 96vw; }
.btn {
  pointer-events: auto; cursor: pointer; font-family: inherit; font-size: 13px;
  color: var(--fg); background: var(--panel); border: 1px solid var(--border);
  padding: 9px 16px; border-radius: 6px; backdrop-filter: blur(8px); transition: 0.15s;
}
.btn:hover { border-color: var(--cyan); transform: translateY(-1px); }
.btn.primary { color: var(--bg); background: var(--green); border-color: var(--green); font-weight: 700; }
.btn.active { color: var(--bg); background: var(--cyan); border-color: var(--cyan); font-weight: 700; box-shadow: 0 0 14px rgba(0, 255, 255, 0.5); }
.btn.ghost { opacity: 0.8; }
.hint { font-size: 11px; opacity: 0.5; margin-left: 4px; }

.banner {
  display: none; position: absolute; top: 64px; left: 50%; transform: translateX(-50%);
  background: rgba(255, 204, 51, 0.12); border: 1px solid rgba(255, 204, 51, 0.4);
  color: #ffcc33; font-size: 12px; padding: 6px 14px; border-radius: 20px; white-space: nowrap;
  max-width: 92vw; overflow: hidden; text-overflow: ellipsis;
}
/* Tactical HUD draws its own text panels — hide the redundant stat block + banner. */
body.tactical .top-left .stats, body.tactical .banner { display: none !important; }

/* Channel-scan checklist */
#chan-select {
  display: none; position: absolute; top: 58px; left: 50%; transform: translateX(-50%);
  align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; max-width: 94vw;
  pointer-events: auto; background: rgba(6, 12, 20, 0.9); border: 1px solid var(--border);
  border-radius: 9px; padding: 6px 10px; backdrop-filter: blur(8px); z-index: 20;
}
#chan-select.show { display: flex; }
.cs-label { font-size: 11px; color: var(--cyan); letter-spacing: 1px; margin-right: 2px; }
.cs-preset {
  pointer-events: auto; cursor: pointer; font-family: inherit; font-size: 11px; color: var(--fg);
  background: var(--panel); border: 1px solid var(--border); padding: 3px 8px; border-radius: 5px;
}
.cs-preset:hover { border-color: var(--cyan); }
.cs-chips { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.cs-chip {
  pointer-events: auto; cursor: pointer; font-family: inherit; font-size: 11px; min-width: 26px;
  color: #7a8a9a; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border);
  padding: 3px 0; border-radius: 4px; text-align: center;
}
.cs-chip.on { color: var(--bg); background: var(--cyan); border-color: var(--cyan); font-weight: 700; }

/* Minimize chrome for maximum data coverage (toggle with M) */
body.chrome-hidden .top-right,
body.chrome-hidden .bottom-bar,
body.chrome-hidden #chan-select { display: none !important; }
#chrome-hint {
  display: none; position: fixed; right: 10px; bottom: 5px; z-index: 30;
  font-size: 10px; color: #566575; pointer-events: none; letter-spacing: 0.5px;
}
body.chrome-hidden #chrome-hint { display: block; }

.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0.8);
  align-items: center; justify-content: center;
}
.modal {
  pointer-events: auto; width: min(560px, 92vw); background: #060d14;
  border: 1px solid var(--border); border-radius: 12px; padding: 26px; box-shadow: 0 0 60px rgba(0, 255, 200, 0.15);
}
.modal h1 { margin: 0 0 12px; font-size: 20px; color: var(--cyan); }
.modal p { font-size: 13px; line-height: 1.6; opacity: 0.85; }
.modal .warn { color: #ffcc33; opacity: 1; }
.modal-actions { display: flex; gap: 10px; margin: 16px 0; }
#flash-log { background: #01060b; border: 1px solid var(--border); border-radius: 6px; padding: 10px; font-size: 11px; max-height: 220px; overflow: auto; white-space: pre-wrap; margin: 0; }

@media (max-width: 640px) {
  .hint { display: none; }
  .top-right { top: auto; bottom: 120px; right: 12px; }
  .brand { font-size: 16px; }
}
