@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg: #080B14;
  --bg-deep: #04060B;
  --panel: rgba(20, 27, 43, 0.72);
  --panel-solid: #131B2C;
  --ink: #E7ECF7;
  --ink-soft: #8592AC;
  --ink-faint: #566079;
  --cyan: #3FE8D0;
  --magenta: #FF5C8A;
  --line: rgba(143, 163, 199, 0.16);
  --line-bright: rgba(143, 163, 199, 0.32);
  --glow-cyan: rgba(63, 232, 208, 0.35);
  --glow-magenta: rgba(255, 92, 138, 0.32);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(ellipse 1200px 600px at 50% -10%, rgba(63, 232, 208, 0.08), transparent 60%),
    radial-gradient(ellipse 900px 500px at 100% 30%, rgba(255, 92, 138, 0.06), transparent 60%),
    repeating-linear-gradient(to right, rgba(143,163,199,0.045) 0, rgba(143,163,199,0.045) 1px, transparent 1px, transparent 48px),
    repeating-linear-gradient(to bottom, rgba(143,163,199,0.045) 0, rgba(143,163,199,0.045) 1px, transparent 1px, transparent 48px),
    var(--bg);
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3 { font-family: 'Space Grotesk', sans-serif; margin: 0; }

.mono { font-family: 'JetBrains Mono', monospace; }

a { color: inherit; }

/* ---------- top bar ---------- */

.topbar {
  border-bottom: 1px solid var(--line);
  background: linear-gradient(to bottom, rgba(63,232,208,0.04), transparent);
}

.topbar .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 28px;
  padding-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}

.brand h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
  background: linear-gradient(90deg, var(--ink) 40%, var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand p {
  margin: 6px 0 0;
  color: var(--ink-faint);
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.02em;
}

.players-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--ink-faint);
  text-align: right;
  letter-spacing: 0.04em;
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  padding: 56px 0 48px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 32px;
  align-items: end;
}

.hero-primary .hero-label,
.hero-secondary .hero-label {
  font-size: 12px;
  color: var(--ink-faint);
  margin-bottom: 10px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-primary .hero-value {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 80px;
  line-height: 0.95;
  letter-spacing: -0.02em;
  text-shadow: 0 0 40px var(--glow-cyan);
}

.hero-secondary .hero-value {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 32px;
}

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

/* ---------- glass panels ---------- */

section.panel {
  background: var(--panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 2px;
  margin: 24px 0;
  padding: 32px;
  position: relative;
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 22px 100%, 0 calc(100% - 22px));
}

section.panel::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--cyan), transparent 60%);
  opacity: 0.6;
}

section.panel h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

section.panel .section-note {
  color: var(--ink-faint);
  font-size: 13px;
  margin: 0 0 20px;
  font-family: 'JetBrains Mono', monospace;
}

/* ---------- tables ---------- */

table { width: 100%; border-collapse: collapse; }

th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-faint);
  padding: 0 10px 12px 0;
  border-bottom: 1px solid var(--line);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

td {
  padding: 13px 10px 13px 0;
  border-bottom: 1px solid var(--line);
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
}

td.name-cell {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 15px;
}

tr:last-child td { border-bottom: none; }

.empty-note {
  font-family: 'Inter', sans-serif;
  color: var(--ink-faint);
  font-style: italic;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 640px) {
  .stat-grid { grid-template-columns: 1fr; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-primary .hero-value { font-size: 58px; }
}

.stat-block h3 {
  font-size: 14px;
  margin-bottom: 12px;
  color: var(--ink-soft);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
}

/* ---------- sortable headers ---------- */

th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--cyan); }

.sort-arrow {
  display: inline-block;
  width: 12px;
  font-size: 9px;
  margin-left: 2px;
  color: var(--cyan);
}

/* ---------- bankroll chart ---------- */

.chart-wrap { width: 100%; }

.chart-wrap svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

/* ---------- filter chips ---------- */

.filter-bar { margin-bottom: 4px; }
.filter-group { margin-bottom: 10px; }

.chip {
  display: inline-block;
  padding: 7px 15px;
  margin: 0 8px 8px 0;
  border: 1px solid var(--line-bright);
  border-radius: 2px;
  background: rgba(20, 27, 43, 0.5);
  color: var(--ink-soft);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip:hover {
  border-color: var(--cyan);
  color: var(--ink);
}

.chip.active {
  background: rgba(63, 232, 208, 0.12);
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 16px var(--glow-cyan);
}

.filter-summary {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0 0 18px;
}

.leg-row.dimmed { opacity: 0.25; }

/* ---------- weekly ledger cards ---------- */

.week-card {
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 20px 22px;
  margin-bottom: 16px;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
}

.week-card:last-child { margin-bottom: 0; }

.week-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.week-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 18px;
  margin-right: 10px;
}

.week-date {
  color: var(--ink-faint);
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
}

.week-odds {
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 15px;
  display: flex;
  gap: 14px;
  align-items: baseline;
}

.week-profit { font-size: 13px; }

.leg-list { display: flex; flex-direction: column; gap: 10px; }

.leg-row {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 8px 0;
}

.leg-mark {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--bg-deep);
}

.leg-row.win .leg-mark { background: var(--cyan); box-shadow: 0 0 10px var(--glow-cyan); }
.leg-row.loss .leg-mark { background: var(--magenta); box-shadow: 0 0 10px var(--glow-magenta); }
.leg-row.push .leg-mark { background: var(--ink-faint); color: var(--bg-deep); }

.leg-desc {
  font-weight: 600;
  font-size: 14px;
  font-family: 'Space Grotesk', sans-serif;
}

.leg-odds {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 400;
  color: var(--ink-faint);
  font-size: 12px;
  margin-left: 6px;
}

.leg-score {
  font-size: 12px;
  color: var(--ink-faint);
  margin-top: 3px;
  font-family: 'JetBrains Mono', monospace;
}

.leg-player {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--ink-soft);
  text-align: right;
  white-space: nowrap;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---------- footer ---------- */

footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 48px;
}

footer p {
  color: var(--ink-faint);
  font-size: 12px;
  margin: 0;
  font-family: 'JetBrains Mono', monospace;
}
