:root {
  --bg: #0b0d10;
  --panel: #13161b;
  --panel-2: #1a1e25;
  --line: #262b34;
  --text: #eef1f5;
  --muted: #8b93a1;
  --jev: #c6ff3d;
  --llm: #ff9f43;
  --bad: #ff4d5e;
  --mid: #ffc53d;
  --good: #3ddc84;
  --churn: #b18cff;
  --empty: #20252d;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}
button, select, input { font: inherit; color: inherit; }

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.title h1 { margin: 0; font-size: 20px; letter-spacing: -0.01em; }
.title p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.controls { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
select {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
}
button {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
button.primary { background: var(--jev); color: #0b0d10; border-color: var(--jev); }
button:disabled { opacity: 0.45; cursor: default; }

.keys {
  margin: 14px 20px 0;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  display: flex;
  gap: 12px 24px;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
}
.keys-copy { font-size: 13px; color: var(--muted); max-width: 520px; line-height: 1.5; }
.keys-copy b { color: var(--text); }
.key-links { display: block; margin-top: 2px; }
.keys a { color: var(--jev); }
.key-fields { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.key-fields input[type="password"] {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px;
  width: 220px;
  max-width: 100%;
  text-transform: none;
  letter-spacing: 0;
}
.remember { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); padding-bottom: 8px; }
@media (max-width: 720px) { .keys { margin-left: 16px; margin-right: 16px; } }

.arena {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 14px 20px;
  min-height: 0;
}
@media (max-aspect-ratio: 1/1) {
  .arena { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .top, .arena { padding-left: 16px; padding-right: 16px; }
}

.lane {
  --accent: var(--jev);
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}
.lane[data-side="llm"] { --accent: var(--llm); }
.lane.running { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }

.lane-head { padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.who { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.who .name { font-size: 22px; font-weight: 800; color: var(--accent); }
.who .model { font-size: 12px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.replay-tag { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 1px 8px; }

.stats { display: grid; grid-template-columns: 1.5fr 1.2fr 1fr 1fr; gap: 8px; margin-top: 8px; }
.stat { display: flex; flex-direction: column; min-width: 0; }
.stat .value { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat.big .value { font-size: 34px; color: var(--accent); line-height: 1.05; }
.stat .label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

.progress { position: relative; height: 22px; margin-top: 10px; background: var(--empty); border-radius: 6px; overflow: hidden; }
.progress .bar { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--accent); transition: width 120ms linear; }
.progress .pct { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; mix-blend-mode: difference; }

.heat {
  display: grid;
  grid-template-columns: repeat(var(--cols, 50), 1fr);
  gap: 2px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}
.heat i { aspect-ratio: 1; border-radius: 2px; background: var(--empty); }
.heat i.lit { animation: pop 380ms ease-out; }
@keyframes pop { 0% { transform: scale(2); } 100% { transform: scale(1); } }

.table-wrap { flex: 1; overflow: auto; min-height: 180px; scrollbar-width: thin; }
table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--panel);
  text-align: left; font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 8px 8px; border-bottom: 1px solid var(--line);
}
th:nth-child(1) { width: 44px; } th:nth-child(2) { width: 30px; }
th:nth-child(4) { width: 92px; } th:nth-child(5) { width: 118px; } th:nth-child(6) { width: 58px; } th:nth-child(7) { width: 72px; }
td { padding: 6px 8px; border-bottom: 1px solid #1b1f26; vertical-align: middle; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
td.num, td.stars { color: var(--muted); font-variant-numeric: tabular-nums; }
td.text { color: #c8ced8; }
tr.filled td.cell { animation: fill 520ms ease-out; }
@keyframes fill { 0% { background: color-mix(in srgb, var(--accent) 45%, transparent); } 100% { background: transparent; } }
tr.hidden-row { display: none; }

.pending { display: inline-block; width: 100%; height: 10px; border-radius: 4px; background: var(--empty); }
.meter { position: relative; height: 12px; border-radius: 4px; background: var(--empty); overflow: hidden; }
.meter b { position: absolute; inset: 0 auto 0 0; border-radius: 4px; }
.chip { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 700; color: #0b0d10; }
.chip.bug { background: #ff7a85; } .chip.pricing { background: #ffd166; } .chip.usability { background: #6ec8ff; }
.chip.feature_request { background: #b18cff; } .chip.praise { background: #3ddc84; } .chip.other { background: #8b93a1; }
.bugpct { font-weight: 700; font-variant-numeric: tabular-nums; }

.finish {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -30%);
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  backdrop-filter: blur(6px);
  border: 2px solid var(--accent); border-radius: 16px;
  padding: 18px 26px; text-align: center; min-width: 260px;
  box-shadow: 0 20px 60px #000a;
  animation: land 420ms cubic-bezier(.2,1.4,.4,1);
}
.finish .flag { font-size: 13px; letter-spacing: 0.14em; color: var(--accent); font-weight: 800; }
.finish .ftime { font-size: 46px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.finish .fcost { font-size: 18px; color: var(--muted); font-variant-numeric: tabular-nums; }
.finish .fqual { font-size: 13px; color: var(--muted); margin-top: 6px; }
@keyframes land { from { opacity: 0; transform: translate(-50%, -10%) scale(.9); } }

.offline { flex: 1; display: grid; place-items: center; text-align: center; padding: 30px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.offline code { color: var(--text); background: var(--panel-2); padding: 1px 6px; border-radius: 4px; }

.verdict {
  margin: 0 20px 14px;
  padding: 14px 20px;
  border-radius: 14px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--jev) 18%, var(--panel)), var(--panel));
  border: 1px solid color-mix(in srgb, var(--jev) 40%, var(--line));
  display: flex; gap: 28px; align-items: center; flex-wrap: wrap;
  animation: land-v 500ms ease-out;
}
@keyframes land-v { from { opacity: 0; transform: translateY(10px); } }
.verdict .big { font-size: 30px; font-weight: 800; color: var(--jev); font-variant-numeric: tabular-nums; }
.verdict .small { font-size: 13px; color: var(--muted); }
.verdict .item { display: flex; flex-direction: column; }

.rerank { margin: 0 20px 20px; padding: 14px 20px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.rerank-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.rerank h2 { margin: 0; font-size: 18px; }
.rerank h2 em { color: var(--jev); font-style: normal; }
.rerank p { margin: 0; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.sliders { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 18px; margin-top: 10px; align-items: end; }
.sliders label:not(.field) { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; font-size: 12px; color: var(--muted); }
.sliders input[type="range"] { grid-column: 1 / -1; accent-color: var(--jev); width: 100%; }
.sliders output { color: var(--text); font-variant-numeric: tabular-nums; }
