:root {
  --bg: #0b0d10;
  --bg-elevated: #14171c;
  --bg-input: #1b1f26;
  --border: #23272e;
  --text: #f2f3f5;
  --text-dim: #9aa1ab;
  --accent: #ff5a1f;
  --accent-dim: #7a2c10;
  --positive: #2fb35c;
  --negative: #e5484d;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; }

nav.topnav {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 20px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.wordmark {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
  text-decoration: none;
}
.wordmark span { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 4px;
  flex: 1;
  overflow-x: auto;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-dim);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  white-space: nowrap;
}

.nav-links a:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.nav-links a.active { color: var(--text); background: rgba(255,90,31,0.14); }

main.page {
  flex: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 20px 70px;
}

h1 { font-size: 1.5rem; margin: 0 0 4px; }
.subtitle { color: var(--text-dim); margin: 0 0 24px; font-size: 0.92rem; }

.panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 20px;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.control { display: flex; flex-direction: column; gap: 4px; }
.control label { font-size: 0.78rem; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.02em; }

select, input[type="text"], input[type="search"] {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  min-width: 140px;
  background: var(--bg-input);
  color: var(--text);
}
select:focus, input:focus { outline: 1px solid var(--accent); }

input[type="range"] { accent-color: var(--accent); }

.pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.pill {
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-dim);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.pill.active { color: var(--text); background: rgba(255,90,31,0.16); border-color: var(--accent-dim); }

table { width: 100%; border-collapse: collapse; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
th, td { padding: 9px 11px; text-align: right; border-bottom: 1px solid var(--border); font-size: 0.88rem; }
th:first-child, td:first-child { text-align: left; }
th:nth-child(2), td:nth-child(2) { text-align: left; }
th { background: rgba(255,255,255,0.03); font-weight: 600; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-dim); }
tbody tr:hover { background: rgba(255,255,255,0.02); }
tbody tr:last-child td { border-bottom: none; }

.pm-positive { color: var(--positive); font-weight: 600; }
.pm-negative { color: var(--negative); font-weight: 600; }

#status, .status { font-size: 0.85rem; color: var(--text-dim); margin-bottom: 12px; min-height: 1.2em; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-tile { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.stat-tile .value { font-size: 1.4rem; font-weight: 700; }
.stat-tile .label { font-size: 0.76rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.03em; margin-top: 2px; }

.player-checkbox { display: flex; align-items: center; gap: 6px; font-size: 0.9rem; }
.player-checkbox input:disabled + label { color: #555; }
#player-list, #compare-player-list { display: flex; flex-wrap: wrap; gap: 8px 16px; max-height: 220px; overflow-y: auto; }

.hero { text-align: center; padding: 48px 0 20px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; letter-spacing: -0.03em; }
.hero .subtitle { font-size: 1.05rem; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card:hover { border-color: var(--accent-dim); transform: translateY(-2px); }
.card .icon { font-size: 1.8rem; }
.card h2 { margin: 0; font-size: 1.3rem; }
.card p { margin: 0; color: var(--text-dim); font-size: 0.95rem; line-height: 1.5; flex: 1; }
.card .cta { color: var(--accent); font-weight: 600; font-size: 0.9rem; }

[hidden] { display: none !important; }

footer.site-footer { text-align: center; padding: 20px 0 32px; color: var(--text-dim); font-size: 0.8rem; }
