:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface-2: #1c2128;
  --border: #30363d;
  --text: #e6edf3;
  --muted: #7d8590;
  --green: #3fb950;
  --red: #f85149;
  --yellow: #e3b341;
  --blue: #58a6ff;
  --accent: #1f6feb;
  --radius: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--blue); text-decoration: none; }

/* ── nav ── */
.nav {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.nav-brand {
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
}

.nav-tabs {
  display: flex;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.tab-btn {
  padding: 6px 16px;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.tab-btn:hover { color: var(--text); background: var(--surface-2); }

.tab-btn.active {
  color: var(--text);
  border-color: var(--border);
  background: var(--surface-2);
}

.nav-meta { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* ── layout ── */
.page { padding: 24px; max-width: 1200px; margin: 0 auto; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.section { margin-bottom: 32px; min-width: 0; }

.section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

/* ── metric cards ── */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 0;
}

.metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.metric-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.metric-value {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.1;
}

.metric-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

.pos { color: var(--green); }
.neg { color: var(--red); }
.neu { color: var(--text); }

/* ── bankroll bar ── */
.bankroll-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.bankroll-label { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.bankroll-value { font-size: 22px; font-weight: 600; }
.bankroll-change { font-size: 13px; margin-left: auto; }

.bankroll-bar-wrap {
  flex: 1;
  min-width: 180px;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.bankroll-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s;
}

/* ── picks grid ── */
.picks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.pick-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.pick-matchup {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pick-side {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.pick-line { font-size: 13px; color: var(--muted); }

.pick-meta {
  display: flex;
  gap: 12px;
  margin-top: 10px;
  font-size: 12px;
}

.pick-edge { color: var(--yellow); }
.pick-bet { color: var(--green); font-weight: 600; }
.market-cell { color: var(--muted); }

.no-picks {
  color: var(--muted);
  font-size: 13px;
  padding: 12px 0;
}

/* ── tables ── */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 100%;
}

th {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}

td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--surface-2);
  white-space: nowrap;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface-2); }

.picks-table {
  min-width: 640px;
}

.matchup-cell {
  min-width: 180px;
  white-space: normal;
}

/* ── result pills ── */
.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pill-win { background: rgba(63,185,80,0.15); color: var(--green); }
.pill-loss { background: rgba(248,81,73,0.15); color: var(--red); }
.pill-push { background: rgba(88,166,255,0.15); color: var(--blue); }
.pill-pending { background: rgba(125,133,144,0.15); color: var(--muted); }

/* ── split bar (home/away, over/under) ── */
.split {
  display: flex;
  gap: 16px;
  margin-top: 8px;
}

.split-item { flex: 1; }
.split-label { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.split-value { font-size: 16px; font-weight: 600; }

.empty-state {
  color: var(--muted);
  font-size: 13px;
  padding: 24px 0;
  text-align: center;
}

/* ── responsive ── */
@media (max-width: 640px) {
  .nav {
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 16px;
    align-items: stretch;
  }

  .nav-brand {
    width: 100%;
  }

  .nav-tabs {
    width: 100%;
  }

  .tab-btn {
    flex: 1;
    text-align: center;
    padding: 8px 10px;
  }

  .nav-meta {
    width: 100%;
    white-space: normal;
    font-size: 11px;
  }

  .page { padding: 16px; }

  .section {
    margin-bottom: 24px;
  }

  .section-title {
    line-height: 1.4;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric {
    padding: 14px;
  }

  .metric-value {
    font-size: 22px;
  }

  .bankroll-card {
    padding: 14px 16px;
    gap: 12px;
    align-items: flex-start;
  }

  .bankroll-bar-wrap {
    order: 3;
    min-width: 100%;
  }

  .bankroll-change {
    margin-left: 0;
  }

  th,
  td {
    padding: 8px 10px;
  }
}

@media (max-width: 480px) {
  .metrics {
    grid-template-columns: 1fr;
  }

  body {
    font-size: 13px;
  }

  .tab-btn {
    font-size: 12px;
  }

  .picks-table {
    min-width: 560px;
  }
}
