:root { --bg: #0e1116; --panel: #161b22; --line: #2a313c; --text: #d8dee6; --dim: #8b949e; --accent: #e6c83c;
  --win: #2ea043; --draw: #9e7c1b; --loss: #a8323a; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: #7cb7ff; text-decoration: none; } a:hover { text-decoration: underline; }
code { font-size: 13px; background: var(--panel); padding: 1px 5px; border-radius: 4px; }
.dim { color: var(--dim); }
[hidden] { display: none !important; }

#home { max-width: 1180px; margin: 0 auto; padding: 24px 20px 40px; }
.top { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; }
h1 { margin: 0 0 6px; font-size: 28px; }
h2 { font-size: 18px; margin: 32px 0 12px; }
.lede { margin: 0; color: var(--text); max-width: 760px; font-size: 16px; }
.top nav { display: flex; gap: 14px; white-space: nowrap; padding-top: 8px; }
.note { color: var(--dim); max-width: 860px; margin: 14px 0 0; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.card { display: flex; flex-direction: column; gap: 4px; padding: 14px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; color: var(--text); }
.card:hover { border-color: var(--accent); text-decoration: none; }
.card .still { width: calc(100% + 28px); margin: -14px -14px 6px; border-radius: 10px 10px 0 0; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.card .sub { color: var(--dim); font-size: 13px; }
.card p { margin: 6px 0 8px; flex: 1; }
.set { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); }
td .set { min-width: 64px; }
.set.references { color: var(--dim); }

.chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 10px; background: var(--line); white-space: nowrap; }
.chip.win { background: var(--win); color: #fff; } .chip.draw { background: var(--draw); color: #fff; }
.chip.loss { background: var(--loss); color: #fff; }

.results { display: grid; grid-template-columns: repeat(auto-fit, minmax(440px, 1fr)); gap: 16px; align-items: start; }
table { border-collapse: collapse; width: 100%; }
caption { text-align: left; color: var(--dim); font-size: 13px; padding-bottom: 6px; }
th, td { padding: 6px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-size: 12px; color: var(--dim); font-weight: 600; white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.summary { min-width: 0; }
.summary .caption { color: var(--dim); font-size: 13px; margin: 0 0 6px; }
.summary .scroll { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.summary td.name { white-space: nowrap; }
.summary tr:last-child td { border-bottom: 0; }

.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.tabs button { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; cursor: pointer; font: inherit; font-size: 13px; }
.tabs button[aria-selected="true"] { border-color: var(--accent); }
select, input[type="search"] { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; font: inherit; font-size: 13px; }
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
#runs th { cursor: pointer; user-select: none; position: sticky; top: 0; background: var(--panel); }
#runs th.sorted::after { content: " ▲"; } #runs th.sorted.desc::after { content: " ▼"; }
#runs tbody tr { cursor: pointer; } #runs tbody tr:hover, #runs tbody tr:focus { background: #1d2430; outline: none; }
footer { margin-top: 36px; color: var(--dim); font-size: 13px; border-top: 1px solid var(--line); padding-top: 12px; }

#replay { display: flex; flex-direction: column; height: 100vh; }
.bar { display: flex; align-items: center; gap: 16px; padding: 8px 14px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.bar .what { display: flex; align-items: center; gap: 10px; flex: 1; flex-wrap: wrap; min-width: 0; }
.bar nav { display: flex; gap: 12px; font-size: 13px; }
.back { white-space: nowrap; }
.details { padding: 6px 14px; font-size: 13px; color: var(--dim); border-bottom: 1px solid var(--line); }
.checks { display: flex; flex-wrap: wrap; gap: 4px 16px; list-style: none; margin: 4px 0 0; padding: 0; }
.checks .met { color: #7ee2a0; } .checks .missed { color: #ff8b8b; }
.stage { position: relative; flex: 1; min-height: 0; }
#r-frame { width: 100%; height: 100%; border: 0; display: block; background: var(--bg); }
.status { position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%); background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 20px; }

@media (max-width: 720px) { .top { flex-direction: column; } h1 { font-size: 22px; } }
