:root {
  --bg: #0f1115; --panel: #171a21; --panel2: #1e222b; --line: #2a2f3a; --text: #e8e9ec; --muted: #9097a4;
  --red: #e5252a; --green: #2fb36d; --amber: #d99a1e; --blue: #4c8dff; --radius: 8px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--blue); }
code, .mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12.5px; }
.top { display: flex; align-items: center; gap: 24px; padding: 10px 20px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.brand { font-weight: 650; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); box-shadow: 0 0 8px var(--red); }
nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 6px; }
nav a.on, nav a:hover { color: var(--text); background: var(--panel2); }
#who { display: flex; align-items: center; gap: 10px; color: var(--muted); }
#who img { width: 24px; height: 24px; border-radius: 50%; }
main { padding: 20px; max-width: 1400px; margin: 0 auto; }
h1 { font-size: 18px; margin: 0 0 14px; }
h2 { font-size: 15px; margin: 22px 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.card h3 { margin: 0 0 8px; font-size: 14px; display: flex; justify-content: space-between; align-items: center; }
.pill { font-size: 11px; font-weight: 650; padding: 2px 8px; border-radius: 999px; background: var(--panel2); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.pill.live { background: rgba(229, 37, 42, .15); color: #ff6b6f; }
.pill.ok { background: rgba(47, 179, 109, .15); color: #5fd396; }
.pill.warn { background: rgba(217, 154, 30, .15); color: #f0bd52; }
.pill.blue { background: rgba(76, 141, 255, .15); color: #8ab4ff; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 8px 0; }
.stats div { background: var(--panel2); border-radius: 6px; padding: 6px 8px; }
.stats b { display: block; font-size: 15px; }
.stats span { font-size: 11px; color: var(--muted); }
.warnline { color: #f0bd52; font-size: 12px; min-height: 16px; }
video { width: 100%; background: #000; border-radius: 6px; display: block; }
button, .btn { background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 6px 12px; font: inherit; cursor: pointer; text-decoration: none; display: inline-block; }
button:hover, .btn:hover { border-color: #3d4452; }
button.primary { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
button.primary:hover { filter: brightness(1.1); }
button:disabled { opacity: .45; cursor: default; }
input, select, textarea { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font: inherit; }
textarea { width: 100%; min-height: 64px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; }
.teams { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.team { background: var(--panel2); border-radius: 6px; padding: 8px; }
.team b { display: block; margin-bottom: 4px; }
.team.pick { cursor: pointer; border: 2px solid transparent; }
.team.pick.on { border-color: var(--red); }
.copy { display: flex; gap: 6px; align-items: center; margin: 4px 0; }
.copy input { flex: 1; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.timeline { width: 100%; }
.inout { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
.inout b { font-variant-numeric: tabular-nums; }
.login { max-width: 420px; margin: 80px auto; text-align: center; }
.login .btn { background: #5865f2; border-color: #5865f2; color: #fff; padding: 10px 18px; font-weight: 600; }
.toast { position: fixed; bottom: 20px; right: 20px; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; max-width: 420px; z-index: 9; }
.toast.err { border-color: var(--red); }
.hidden { display: none !important; }
.grow { flex: 1; }
/* the clip timeline */
.tl { position: relative; margin: 14px 0 6px; user-select: none; }
.tl-ticks { position: relative; height: 18px; font-size: 11px; color: var(--muted); }
.tl-ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.tl-ticks span::after { content: ''; position: absolute; left: 50%; top: 16px; height: 6px; border-left: 1px solid var(--line); }
.tl-track { position: relative; height: 72px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; cursor: crosshair; touch-action: none; }
.tl-rec { position: absolute; top: 22px; height: 28px; background: rgba(76, 141, 255, .28); border-top: 2px solid var(--blue); border-radius: 2px; pointer-events: none; }
.tl-mark { position: absolute; top: 0; bottom: 0; border-left: 2px solid var(--green); pointer-events: none; }
.tl-mark.end { border-left-color: var(--muted); }
.tl-mark span { position: absolute; top: 2px; left: 4px; font-size: 11px; color: #5fd396; white-space: nowrap; }
.tl-mark.end span { color: var(--muted); }
.tl-sel { position: absolute; top: 0; bottom: 0; background: rgba(229, 37, 42, .22); border-left: 2px solid var(--red); border-right: 2px solid var(--red); }
.tl-handle { position: absolute; top: 0; bottom: 0; width: 14px; cursor: ew-resize; }
.tl-handle.in { left: -8px; }
.tl-handle.out { right: -8px; }
.tl-handle::after { content: ''; position: absolute; top: 26px; left: 4px; width: 6px; height: 20px; border-radius: 3px; background: var(--red); }
.tl-hover { position: absolute; bottom: -18px; transform: translateX(-50%); color: var(--muted); pointer-events: none; white-space: nowrap; }
.tl-nav button { padding: 6px 10px; }
button.on-live { background: rgba(229, 37, 42, .15); border-color: var(--red); color: #ff6b6f; }
.nudge { padding: 3px 7px; font-size: 12px; }
.inout { margin-top: 24px; }
/* replay */
.card.onair.live, .card.clip.live { border-color: var(--red); box-shadow: 0 0 0 1px var(--red) inset; }
.card.clip { margin-bottom: 10px; }
.card.clip video { margin-top: 10px; max-height: 420px; }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 16px; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } .stats { grid-template-columns: repeat(2, 1fr); } }
