/* AlgoBet remote dashboard — a read-only terminal mirror.
   The 16 colour classes are the ConsoleColor palette; nothing else here knows anything
   about the dashboard's contents. */

:root {
  --bg: #0b0f14;
  --panel: #121820;
  --line: #1e2733;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: #cbd5e1;
  font: 14px/1.45 var(--sans);
  -webkit-text-size-adjust: 100%;
}

/* ── header ───────────────────────────────────────────────────────────────── */

.bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: 8px max(10px, env(safe-area-inset-left));
  background: rgba(11, 15, 20, .9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.mark { width: 24px; height: 24px; fill: #22d3ee; opacity: .7; }
.spacer { flex: 1; }

.conn { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #6b7280; }
.conn i { width: 8px; height: 8px; border-radius: 50%; background: #6b7280; }
.conn[data-state="live"]  { color: #4ade80; } .conn[data-state="live"]  i { background: #4ade80; box-shadow: 0 0 8px #4ade80; }
.conn[data-state="stale"] { color: #d99a2b; } .conn[data-state="stale"] i { background: #d99a2b; }
.conn[data-state="down"]  { color: #f87171; } .conn[data-state="down"]  i { background: #f87171; }

/* ── the console frame ────────────────────────────────────────────────────── */

.screen {
  margin: 0;
  padding: 12px max(10px, env(safe-area-inset-left)) 16px;
  overflow-x: auto;                       /* the frame is fixed-width text: it scrolls itself */
  font-family: var(--mono);
  font-size: clamp(9.5px, 2.35vw, 13px);  /* shrink to fit narrow screens before scrolling */
  line-height: 1.5;
  white-space: pre;
  tab-size: 8;
}
.screen.down { opacity: .4; filter: saturate(.4); }

/* ConsoleColor 0–15, in enum order. */
.c0  { color: #000000; } .c1  { color: #1e40af; } .c2  { color: #15803d; } .c3  { color: #0e7490; }
.c4  { color: #991b1b; } .c5  { color: #86198f; } .c6  { color: #d99a2b; } .c7  { color: #cbd5e1; }
.c8  { color: #6b7280; } .c9  { color: #60a5fa; } .c10 { color: #4ade80; } .c11 { color: #22d3ee; }
.c12 { color: #f87171; } .c13 { color: #e879f9; } .c14 { color: #facc15; } .c15 { color: #ffffff; }

/* ── token dialog ─────────────────────────────────────────────────────────────── */

.btn {
  font: 500 12px/1 var(--sans);
  min-height: 32px; padding: 8px 12px;
  border-radius: 6px; border: 1px solid var(--line);
  background: #18202b; color: #cbd5e1; cursor: pointer;
}
.btn.go { background: #163038; border-color: #1d5b6b; color: #22d3ee; }
.btn:focus-visible, input:focus-visible { outline: 2px solid #22d3ee; outline-offset: 2px; }

dialog {
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel); color: #cbd5e1;
  width: min(400px, calc(100vw - 24px)); padding: 18px;
}
dialog::backdrop { background: rgba(0, 0, 0, .65); }
dialog h3 { margin: 0 0 12px; font-size: 15px; color: #22d3ee; font-family: var(--mono); }
dialog .sub { margin: -6px 0 12px; color: #6b7280; font-size: 12px; }
dialog label { display: block; margin-bottom: 10px; font-size: 12px; color: #6b7280; }
dialog input {
  display: block; width: 100%; margin-top: 5px;
  min-height: 38px; padding: 8px 10px;
  background: #0d131a; border: 1px solid var(--line); border-radius: 6px;
  color: #cbd5e1; font-family: var(--mono); font-size: 14px;
}
dialog menu { display: flex; justify-content: flex-end; gap: 8px; margin: 14px 0 0; padding: 0; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
