:root {
  --bg: #0d1117;
  --panel: #161b22;
  --line: #30363d;
  --text: #e6edf3;
  --dim: #8b949e;
  --accent: #2f81f7;
  --good: #3fb950;
  --warn: #d29922;
  --bad: #f85149;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
  -webkit-text-size-adjust: 100%;
}

header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 10;
}
header h1 { font-size: 15px; margin: 0; font-weight: 600; letter-spacing: .04em; }
header .spacer { flex: 1; }

.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--bad); display: inline-block; }
.dot.up { background: var(--good); }

main { padding: 16px; max-width: 1400px; margin: 0 auto; }

video {
  width: 100%;
  background: #000;
  border-radius: 8px;
  border: 1px solid var(--line);
  aspect-ratio: 16 / 9;
  object-fit: contain;
  display: block;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.grid { display: grid; gap: 14px; }
@media (min-width: 900px) { .grid.split { grid-template-columns: 2fr 1fr; } }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.stat { background: #0d1117; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
.stat .k { color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.stat .v { font-size: 19px; margin-top: 2px; }

button {
  font: inherit;
  color: var(--text);
  background: #21262d;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 14px;
  cursor: pointer;
  touch-action: manipulation;
}
button:hover { border-color: var(--accent); }
button:active { background: var(--accent); }
button.on { background: var(--accent); border-color: var(--accent); }
button.danger { background: var(--bad); border-color: var(--bad); color: #fff; font-weight: 700; }
button:disabled { opacity: .4; cursor: not-allowed; }

.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 0; }

h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); margin: 0 0 10px; }

/* D-pad — thumb-sized, because this gets used on a phone */
.dpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 280px; margin: 0 auto; }
.dpad button { aspect-ratio: 1; font-size: 20px; }
.dpad .sp { visibility: hidden; }

.bars { display: grid; gap: 6px; }
.bar { display: grid; grid-template-columns: 62px 1fr 34px; align-items: center; gap: 8px; font-size: 13px; }
.bar .track { background: #0d1117; border-radius: 4px; height: 16px; overflow: hidden; border: 1px solid var(--line); }
.bar .fill { background: var(--accent); height: 100%; width: 0; transition: width .15s linear; }

#chat { height: 260px; overflow-y: auto; font-size: 13px; }
#chat div { padding: 2px 0; border-bottom: 1px solid #21262d; word-break: break-word; }
#chat .u { color: var(--accent); }
#chat .p { color: var(--dim); font-size: 11px; }

.banner { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; font-weight: 700; text-align: center; }
.banner.estop { background: var(--bad); color: #fff; }
.banner.off { display: none; }

.muted { color: var(--dim); font-size: 13px; }
label { display: block; color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
input { font: inherit; width: 100%; padding: 10px; background: #0d1117; border: 1px solid var(--line); border-radius: 6px; color: var(--text); }
