/* DFS ResultsDB — self-contained, no external fonts or CDNs. */

:root {
  --bg: #0e1116;
  --bg-elev: #161b23;
  --bg-soft: #1c222c;
  --line: #262e3a;
  --text: #e7ecf3;
  --text-dim: #9aa7b8;
  --text-faint: #6b7787;
  --accent: #4c8dff;
  --pos: #35c98a;
  --neg: #ff6b6b;
  --warn: #f5b544;
  --radius: 12px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

:root[data-theme="light"] {
  --bg: #f6f8fb;
  --bg-elev: #ffffff;
  --bg-soft: #eef2f7;
  --line: #dbe2ec;
  --text: #131820;
  --text-dim: #5b6878;
  --text-faint: #8592a3;
  --accent: #1f6feb;
  --pos: #128a5a;
  --neg: #cf3030;
  --warn: #a86b00;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ── top bar ─────────────────────────────────────────────── */
.topbar {
  border-bottom: 1px solid var(--line);
  background: var(--bg-elev);
  position: sticky; top: 0; z-index: 20;
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; }
.brand { display: flex; align-items: center; gap: 12px; }
.mark { font-size: 26px; line-height: 1; }
.topbar h1 { margin: 0; font-size: 17px; letter-spacing: -0.01em; }
.sub { margin: 1px 0 0; font-size: 12.5px; color: var(--text-dim); }

.ghost {
  background: var(--bg-soft); color: var(--text-dim);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 11px; cursor: pointer; font-size: 15px;
}
.ghost:hover { color: var(--text); border-color: var(--accent); }

/* ── corpus stat strip ───────────────────────────────────── */
.statstrip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; margin: 22px 0 20px;
}
.statstrip div { background: var(--bg-elev); padding: 13px 15px; }
.statstrip .k { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); }
.statstrip .v { font-size: 19px; font-weight: 640; font-variant-numeric: tabular-nums; margin-top: 3px; }

/* ── tabs ────────────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; flex-wrap: wrap; }
.tab {
  background: none; border: 0; border-bottom: 2px solid transparent;
  color: var(--text-dim); padding: 10px 14px; cursor: pointer;
  font-size: 14px; font-family: inherit; font-weight: 550;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }

/* ── search ──────────────────────────────────────────────── */
.searchbox { position: relative; margin-bottom: 22px; }
#q {
  width: 100%; padding: 15px 17px; font-size: 16px; font-family: inherit;
  background: var(--bg-elev); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius); outline: none;
}
#q:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
#q::placeholder { color: var(--text-faint); }

.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30;
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; max-height: 340px; overflow-y: auto;
  box-shadow: 0 12px 34px rgba(0,0,0,.42);
}
.suggest button {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  width: 100%; text-align: left; background: none; border: 0;
  border-bottom: 1px solid var(--line); color: var(--text);
  padding: 10px 15px; cursor: pointer; font-family: inherit; font-size: 14px;
}
.suggest button:last-child { border-bottom: 0; }
.suggest button:hover, .suggest button.on { background: var(--bg-soft); }
.suggest .meta { color: var(--text-faint); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ── cards / profile ─────────────────────────────────────── */
.card {
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; margin-bottom: 16px;
}
.card h2 { margin: 0 0 4px; font-size: 21px; letter-spacing: -0.01em; }
.card h3 { margin: 0 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); }

.who { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.who .handle { font-size: 25px; font-weight: 680; letter-spacing: -0.02em; word-break: break-all; }
.who .span { color: var(--text-dim); font-size: 13px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: 13px 15px; }
.kpi .k { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); }
.kpi .v { font-size: 22px; font-weight: 680; font-variant-numeric: tabular-nums; margin-top: 3px; letter-spacing: -0.02em; }

.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px 26px; }
.row { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.row:last-child { border-bottom: 0; }
.row .k { color: var(--text-dim); }
.row .v { font-variant-numeric: tabular-nums; font-weight: 560; text-align: right; }

.pos { color: var(--pos); }
.neg { color: var(--neg); }

/* ── tables ──────────────────────────────────────────────── */
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 9px 11px; text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
thead th {
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-faint); font-weight: 600;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg-elev);
}
tbody tr { border-bottom: 1px solid var(--line); }
tbody tr:last-child { border-bottom: 0; }
tbody tr:hover { background: var(--bg-soft); }
td.num { font-variant-numeric: tabular-nums; }
td.handle { font-weight: 600; }
td.handle button {
  background: none; border: 0; color: var(--accent); cursor: pointer;
  font: inherit; font-weight: 600; padding: 0; text-align: left;
}
td.handle button:hover { text-decoration: underline; }
.rank { color: var(--text-faint); width: 34px; }

/* season net bar */
.bar { position: relative; height: 5px; border-radius: 3px; background: var(--bg-soft); min-width: 60px; }
.bar span { position: absolute; top: 0; bottom: 0; border-radius: 3px; }

/* ── controls ────────────────────────────────────────────── */
.controls { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.controls label { display: flex; flex-direction: column; gap: 5px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); }
.controls select {
  background: var(--bg-elev); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 11px; font-family: inherit; font-size: 14px; text-transform: none; letter-spacing: 0;
}

/* ── misc ────────────────────────────────────────────────── */
.msg { color: var(--text-dim); padding: 34px 20px; text-align: center; }
.msg strong { color: var(--text); }
.prose p { color: var(--text-dim); max-width: 68ch; }
.prose strong { color: var(--text); }
.muted { color: var(--text-faint); font-size: 13px; }
.foot { padding: 26px 20px 40px; color: var(--text-faint); font-size: 12.5px; text-align: center; }
.mono { font-family: var(--mono); font-size: 12.5px; }

@media (max-width: 600px) {
  .kpi .v { font-size: 19px; }
  .who .handle { font-size: 21px; }
  .statstrip { grid-template-columns: repeat(2, 1fr); }
}
