:root {
  --bg: #0b1620;
  --panel: rgba(9, 17, 24, 0.9);
  --line: rgba(255, 255, 255, 0.09);
  --text: #eef2f4;
  --muted: #8a9aa6;
  --accent: #e4f24c;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); overflow: hidden; }
canvas#view { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
[hidden] { display: none !important; }

.panel {
  position: fixed; top: 0; left: 0; bottom: 0; width: min(460px, 92vw);
  background: var(--panel); border-right: 1px solid var(--line);
  padding: 40px 40px 32px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 26px;
}
.panel.center {
  left: 50%; top: 50%; bottom: auto; transform: translate(-50%, -50%);
  width: min(440px, 92vw); border: 1px solid var(--line); border-radius: 10px; gap: 14px; padding: 36px;
}

h1 { margin: 0; font-size: 34px; font-weight: 700; letter-spacing: -0.02em; }
h2 { margin: 0; font-size: 30px; font-weight: 700; }
.sub { margin: 8px 0 0; color: var(--muted); font-size: 15px; line-height: 1.45; }
.label { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.hint { margin: -12px 0 0; color: var(--muted); font-size: 13px; }

.join { display: flex; gap: 22px; align-items: center; }
.qr { width: 164px; height: 164px; background: #fff; border-radius: 6px; padding: 8px; flex: none; }
.qr svg { width: 100%; height: 100%; display: block; }
.join-meta .label { margin-bottom: 4px; }
.code { font-size: 40px; font-weight: 700; font-variant-numeric: tabular-nums; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.url { font-size: 12px; color: var(--muted); word-break: break-all; margin-top: 6px; max-width: 220px; }
.net-status { font-size: 12px; color: var(--muted); margin-top: 10px; }
.net-status.ok { color: #9fd99a; }
.net-status.err { color: #f08f7f; }

.slots { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.slots li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px; }
.swatch { width: 4px; height: 22px; border-radius: 2px; flex: none; }
.slot-name { flex: 1; font-weight: 600; }
.slot-state { color: var(--muted); font-size: 13px; }
.slots li.on .slot-state { color: #9fd99a; }
.slots li.away .slot-state { color: #f0c27a; }

.seg { display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg button { flex: 1; border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--muted); padding: 11px 6px; font: 600 14px var(--font); cursor: pointer; }
.seg button:last-child { border-right: 0; }
.seg button.on { background: rgba(255, 255, 255, 0.08); color: var(--text); }

button { font-family: var(--font); }
button.primary, .row-btns button {
  border: 0; border-radius: 6px; padding: 15px 20px; font-size: 16px; font-weight: 700; cursor: pointer;
  background: var(--accent); color: #141a10;
}
.row-btns { display: flex; gap: 10px; margin-top: 12px; }
.row-btns button:not(.primary) { background: transparent; color: var(--text); border: 1px solid var(--line); }
button.primary:disabled { background: #2a3540; color: #6d7c87; cursor: default; }
button.link { background: none; border: 0; color: var(--muted); padding: 8px 0 0; font-size: 13px; cursor: pointer; text-align: left; text-decoration: underline; text-underline-offset: 3px; }

/* HUD */
.scorebug {
  position: fixed; top: 24px; left: 24px; min-width: 300px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px; overflow: hidden;
}
.scorebug .row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.scorebug .srv { width: 8px; height: 8px; border-radius: 50%; background: transparent; flex: none; }
.scorebug .row.serving .srv { background: var(--accent); }
.scorebug .tname { flex: 1; font-weight: 600; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.scorebug .tscore { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 32px; text-align: right; }
.scorebug .call { padding: 7px 14px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

.banner {
  position: fixed; top: 28px; left: 50%; transform: translateX(-50%);
  font-size: 30px; font-weight: 700; padding: 10px 22px; border-radius: 6px;
  background: var(--panel); border: 1px solid var(--line);
  opacity: 0; transition: opacity 0.2s;
}
.banner.show { opacity: 1; }
.banner small { display: block; font-size: 14px; font-weight: 500; color: var(--muted); text-align: center; margin-top: 2px; }
.keys { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); color: var(--muted); font-size: 13px; }

.final { font-size: 44px; font-weight: 700; font-variant-numeric: tabular-nums; }
