:root {
  color-scheme: dark;
  --bg: #09090b;
  --card: #18181b;
  --line: #27272a;
  --ink: #fafafa;
  --muted: #a1a1aa;
  --gold: #d6b25e;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 ui-sans-serif, system-ui, sans-serif;
}
.top, main, .tabs { width: min(1100px, calc(100% - 2rem)); margin-inline: auto; }
.top { padding-top: 1.5rem; }
h1 { margin: 0.3rem 0; font-size: 2rem; }
h2 { margin: 0 0 0.8rem; font-size: 1.15rem; }
.lede, .note { color: var(--muted); }
.badges span, .tag {
  display: inline-block;
  margin: 0 0.35rem 0.35rem 0;
  padding: 0.15rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.85rem;
}
.tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; padding: 0.5rem 0 1rem; }
.tabs button, select, button.go {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
}
.tabs button.on { border-color: var(--gold); color: var(--gold); }
.metrics, .split, .pick { display: grid; gap: 0.8rem; }
.metrics { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-bottom: 1rem; }
.card, .bar-row, table { background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.card { padding: 0.8rem 1rem; }
.card b { display: block; font-size: 1.4rem; }
.card span, .muted { color: var(--muted); }
.split { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.bar-row { display: grid; grid-template-columns: 7rem 1fr auto; gap: 0.6rem; align-items: center; padding: 0.35rem 0.7rem; margin-bottom: 0.35rem; }
.track { height: 0.7rem; background: #09090b; border-radius: 99px; overflow: hidden; }
.track i { display: block; height: 100%; background: var(--gold); }
table { width: 100%; border-collapse: collapse; overflow: hidden; }
th, td { padding: 0.45rem 0.6rem; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; }
.controls { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1rem; align-items: flex-start; }
.finder { position: relative; flex: 1 1 16rem; }
.finder input {
  width: 100%;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
}
.menu {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  margin: 0;
  padding: 0.25rem;
  list-style: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  max-height: 18rem;
  overflow: auto;
}
.menu button {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  width: 100%;
  text-align: left;
  background: transparent;
  color: inherit;
  border: 0;
  border-radius: 6px;
  padding: 0.4rem 0.55rem;
}
.menu button.on, .menu button:hover { background: #27272a; }
.menu .klass, .menu .empty { color: var(--muted); }
.menu .empty { padding: 0.4rem 0.55rem; }
select { min-width: 12rem; }
.pick { grid-template-columns: repeat(3, 1fr); margin: 1rem 0; }
section { margin-bottom: 1.5rem; }
.hidden { display: none; }
.tree { display: flex; gap: 1.6rem; overflow-x: auto; padding: 0.2rem 0.2rem 1rem; }
.col { min-width: 210px; display: flex; flex-direction: column; }
.col h3 { margin: 0 0 0.45rem; font-size: 0.82rem; color: var(--gold); font-weight: 600; white-space: nowrap; }
.col h3 .bo, .muted { color: var(--muted); font-weight: 500; }
.slots { display: flex; flex-direction: column; }
.slot { flex: 1; display: flex; align-items: center; position: relative; min-height: 68px; }
.slot.flat { min-height: 0; }
.match { width: 100%; background: #121214; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.who { display: grid; grid-template-columns: 4px 1.5rem minmax(0, 1fr) auto; gap: 0.35rem; align-items: stretch; min-height: 1.7rem; padding: 0.22rem 0.4rem 0.22rem 0; border-top: 1px solid var(--line); }
.who:first-child { border-top: 0; }
.who i { display: block; background: #3f3f46; }
.who .seed { color: var(--muted); font-size: 0.72rem; align-self: center; text-align: right; }
.who .nm { font-size: 0.84rem; align-self: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who .rec { color: var(--muted); font-size: 0.7rem; align-self: center; }
.who.won { background: rgba(214, 178, 94, 0.14); }
.who.lost { opacity: 0.45; }
.who.pending .nm { color: var(--muted); }
.col.merge .slot::before { content: ""; position: absolute; left: -1.6rem; width: 1.05rem; top: 25%; height: 50%; border: 2px solid #3f3f46; border-right: 0; border-radius: 8px 0 0 8px; }
.col.merge .slot::after { content: ""; position: absolute; left: -0.55rem; width: 0.55rem; top: 50%; border-top: 2px solid #3f3f46; }
.col.straight .slot::before { content: ""; position: absolute; left: -1.6rem; width: 1.6rem; top: 50%; border-top: 2px solid #3f3f46; }
.playins { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.6rem; }
.final { max-width: 280px; }
.form { display: grid; gap: 0.75rem; max-width: 36rem; }
.form label { display: grid; gap: 0.3rem; color: var(--muted); font-size: 0.9rem; }
.form input, .form textarea { width: 100%; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 0.5rem 0.7rem; font: inherit; }
.form textarea { min-height: 8rem; resize: vertical; }
.form input:focus, .form textarea:focus { outline: 2px solid var(--gold); border-color: transparent; }
.honey { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.status { min-height: 1.4rem; }
a { color: var(--gold); }
@media (max-width: 700px) {
  .pick { grid-template-columns: 1fr; }
}
