:root {
  --bg: #0f1419;
  --panel: #1a2129;
  --panel-2: #222c36;
  --line: #2e3a46;
  --text: #e6edf3;
  --muted: #8b97a4;
  --accent: #ffb000;       /* mug gold */
  --accent-2: #4ea1ff;     /* team A / north blue */
  --win: #3fb950;
  --loss: #f06868;
  --guest: #b07bff;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 "Segoe UI", system-ui, -apple-system, sans-serif;
}

header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px; background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: 12px; }
.brand h1 { margin: 0; font-size: 22px; letter-spacing: .5px; }
.tag {
  color: var(--bg); background: var(--accent);
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  padding: 2px 8px; border-radius: 4px;
}
.controls { display: flex; align-items: center; gap: 8px; }
.controls label { color: var(--muted); font-size: 12px; }
select {
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 6px;
  padding: 6px 10px; font-size: 14px;
}

.tabs {
  display: flex; gap: 4px; padding: 0 22px;
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.tab {
  background: none; border: none; color: var(--muted);
  padding: 12px 16px; font-size: 14px; cursor: pointer;
  border-bottom: 2px solid transparent;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

main { padding: 22px; max-width: 1200px; margin: 0 auto; }
.loading { color: var(--muted); }
.error { color: var(--loss); }

h2.section { margin: 4px 0 14px; font-size: 17px; }
.sub { color: var(--muted); font-size: 12px; margin: -8px 0 16px; }
.sub.career-caveat {
  border-left: 3px solid var(--accent); padding: 6px 10px; margin: 0 0 16px;
  background: rgba(255, 176, 0, .06);
}

/* tables */
table.grid {
  width: 100%; border-collapse: collapse; font-size: 13px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  overflow: hidden;
}
table.grid th, table.grid td {
  padding: 7px 10px; text-align: right; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.grid th {
  background: var(--panel-2); color: var(--muted);
  font-weight: 600; cursor: pointer; user-select: none; position: relative;
}
table.grid th:hover { color: var(--text); }
table.grid th.sorted::after { content: " \25BE"; color: var(--accent); }
table.grid th.sorted.asc::after { content: " \25B4"; }
table.grid td.player-cell, table.grid th.left { text-align: left; }
table.grid tbody tr:hover { background: var(--panel-2); }
table.grid tr.guest td.player-cell { color: var(--guest); }
.guest-badge {
  font-size: 10px; color: var(--bg); background: var(--guest);
  padding: 1px 5px; border-radius: 3px; margin-left: 6px; font-weight: 700;
}
.player-link { color: var(--accent-2); cursor: pointer; }
.player-link:hover { text-decoration: underline; }
tr.total td { font-weight: 700; background: var(--panel-2); }
.pos { color: var(--win); }
.neg { color: var(--loss); }

/* win prob */
.chart-wrap { background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.game-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 10px; }
.game-head .score { font-size: 22px; font-weight: 700; }
.team-a { color: var(--loss); }
.team-b { color: var(--accent-2); }
.pill { font-size: 12px; color: var(--muted); }

/* player profile */
.cards { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 12px 16px; min-width: 110px;
}
.card .k { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.card .v { font-size: 22px; font-weight: 700; margin-top: 2px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .two-col { grid-template-columns: 1fr; } }

#meta-bar { padding: 10px 22px; color: var(--muted); font-size: 12px;
  border-top: 1px solid var(--line); }

/* nav can wrap to 2 rows now that there are 8 tabs */
.tabs { flex-wrap: wrap; }

/* head-to-head matrix */
table.grid.h2h td { text-align: center; min-width: 44px; }
table.grid.h2h td.diag { color: var(--muted); background: var(--panel-2); }
table.grid.h2h th { text-align: center; }

/* logging-quality grade badges */
.grade { font-weight: 700; padding: 1px 8px; border-radius: 4px; color: var(--bg); }
.grade-A { background: var(--win); }
.grade-B { background: #9ccc4f; }
.grade-C { background: var(--accent); }
.grade-D { background: #f0904a; }
.grade-F { background: var(--loss); }

/* integrity manual resolution note */
.resolved { color: var(--accent); font-style: italic; }

code { background: var(--panel-2); padding: 1px 5px; border-radius: 4px;
  font-size: 12px; }

/* tables can get wide — let the page scroll them */
main { overflow-x: auto; }

/* spacing between the many stacked sections in the larger views */
h2.section { margin-top: 26px; }
h2.section:first-of-type { margin-top: 4px; }
