:root {
  --bg: #0f141b;
  --panel: #171d26;
  --panel-2: #1f2631;
  --border: #2a3340;
  --text: #e8edf3;
  --muted: #9aa6b2;
  --accent: #f4c542;
  --link: #68a7ff;
  --win: #1f8f55;
  --loss: #a94442;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, sans-serif;
}

a {
  color: var(--link);
  text-decoration: underline;
}

a:hover {
  color: var(--accent);
}

.topbar {
  height: 64px;
  background: #20262f;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.topbar-right a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.15s ease;
}

.topbar-right a:hover {
  color: var(--accent);
}

.menu-button,
.menu-close {
  background: transparent;
  color: var(--text);
  border: none;
  font-size: 24px;
  cursor: pointer;
}

.brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
  transition: color 0.15s ease;
  color: #ffd76a;
}

.page-shell {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 60px;
}

.hero {
  text-align: center;
  margin-bottom: 28px;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: 2rem;
}

.subtitle {
  margin: 0;
  color: var(--muted);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel + .panel,
.stats-grid + .panel {
  margin-top: 24px;
}

.panel-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-2);
}

.panel-header h2,
.prose-panel h2 {
  margin: 0;
  font-size: 1.1rem;
}

.prose-panel {
  padding: 24px;
}

.prose-panel p {
  line-height: 1.5;
  margin: 0 0 16px;
}

.table-wrap {
  overflow-x: auto;
}

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

.league-table th,
.league-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

.league-table th {
  background: #2a3038;
  color: #f4f6f8;
  font-size: 0.95rem;
}

.league-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.empty-cell {
  color: var(--muted);
  text-align: center;
}

.table-link {
  color: var(--link);
  transition: color 0.15s ease;
}

.table-link:hover {
  text-decoration: underline;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.stat-label {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
}

.result-pill {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
}

.result-pill.win {
  background: rgba(31, 143, 85, 0.2);
  color: #7be0a7;
}

.result-pill.loss {
  background: rgba(169, 68, 66, 0.2);
  color: #ff9a97;
}

.muted {
  color: var(--muted);
}

.side-menu {
  position: fixed;
  top: 0;
  left: -280px;
  width: 280px;
  height: 100%;
  background: #171d26;
  border-right: 1px solid var(--border);
  z-index: 200;
  transition: left 0.22s ease;
  padding: 18px;
}

.side-menu.open {
  left: 0;
}

.side-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  font-weight: 700;
}

.side-menu-links {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.side-menu-links a {
  color: var(--text);
  font-size: 1rem;
  text-decoration: none;
  transition: color 0.15s ease;
}

.side-menu-links a:hover {
  color: var(--accent);
}

.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: 0.22s ease;
  z-index: 150;
}

.menu-overlay.open {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 900px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .topbar {
    padding: 0 12px;
  }

  .topbar-right {
    gap: 14px;
    font-size: 0.95rem;
  }

  .page-shell {
    width: calc(100% - 20px);
    padding-top: 24px;
  }

  .hero h1 {
    font-size: 1.6rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .league-table th,
  .league-table td {
    padding: 12px;
  }
}
