:root {
  --bg: #0b1020;
  --bg-soft: #121a31;
  --panel: rgba(18, 26, 49, 0.78);
  --panel-strong: rgba(20, 30, 56, 0.94);
  --border: rgba(255, 255, 255, 0.08);
  --text: #eef2ff;
  --muted: #aab7d5;
  --accent: #e2343f;
  --accent-2: #2f66d0;
  --danger: #ff9a9a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  --radius: 22px;
  --radius-sm: 14px;
  --max: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(226, 52, 63, 0.18), transparent 26%),
    radial-gradient(circle at top right, rgba(47, 102, 208, 0.18), transparent 24%),
    linear-gradient(180deg, #0a1020 0%, #0d1730 100%);
  color: var(--text);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button, input {
  font: inherit;
}

.shell {
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(16px);
  background: rgba(10, 16, 32, 0.75);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 74px;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand__eyebrow {
  font-size: 0.78rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.brand__title {
  font-size: 1.18rem;
  font-weight: 800;
  line-height: 1.1;
}

.navlinks {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.navlinks a {
  color: var(--muted);
  padding: 11px 16px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid transparent;
  transition: 180ms ease;
}

.navlinks a:hover,
.navlinks a.active {
  color: var(--text);
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.05);
}

.hero {
  padding: 54px 0 28px;
}

.hero__grid {
  display: grid;
  grid-template-columns: 1.55fr 0.95fr;
  gap: 24px;
}

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

.hero-card {
  padding: 34px;
}

.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 700;
}

.hero h1 {
  margin: 14px 0 14px;
  font-size: clamp(2rem, 3.6vw, 3.8rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.lead {
  margin: 0;
  max-width: 64ch;
  color: #cfdbf8;
  font-size: 1.02rem;
  line-height: 1.68;
}

.hero-actions {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  transition: 180ms ease;
}

.btn:hover { transform: translateY(-1px); background: rgba(255,255,255,0.08); }
.btn--primary { background: linear-gradient(135deg, rgba(226,52,63,0.30), rgba(47,102,208,0.24)); }

.kpi-wrap {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 22px;
}

.kpi {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
}

.kpi__label { color: var(--muted); font-size: 0.82rem; }
.kpi__value { margin-top: 10px; font-size: 1.7rem; font-weight: 800; }
.kpi__sub { margin-top: 6px; color: #c6d3f3; font-size: 0.9rem; }

.section {
  padding: 10px 0 28px;
}

.section__head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section__title {
  margin: 0;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}

.section__text {
  margin: 8px 0 0;
  color: var(--muted);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.leaderboard-card {
  padding: 18px;
  min-height: 100%;
}

.leaderboard-card h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.leaderboard-card p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.rank-list {
  display: grid;
  gap: 10px;
}

.rank-item {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.05);
}

.rank-item__pos {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: rgba(226,52,63,0.18);
  color: var(--accent);
}

.rank-item__name { font-weight: 700; }
.rank-item__meta { color: var(--muted); font-size: 0.83rem; margin-top: 4px; }
.rank-item__value { font-weight: 800; font-size: 1.05rem; }

.preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 18px 0;
}

.panel-header h3,
.panel-header h2 {
  margin: 0;
  font-size: 1.08rem;
}

.panel-header p { margin: 6px 0 0; color: var(--muted); }

.table-panel { overflow: hidden; }
.table-wrap { overflow: auto; }
.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  white-space: nowrap;
  text-align: left;
}

.table th {
  position: sticky;
  top: 0;
  background: rgba(10, 16, 32, 0.94);
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  z-index: 1;
}

.table td:first-child,
.table th:first-child {
  position: sticky;
  left: 0;
  background: rgba(13, 21, 40, 0.96);
  z-index: 2;
}

.table tbody tr:hover td {
  background: rgba(255,255,255,0.03);
}

.table tbody tr:hover td:first-child {
  background: rgba(25, 36, 59, 0.98);
}

.toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  padding: 18px;
}

.search {
  flex: 1 1 240px;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: var(--muted);
  min-height: 38px;
  border-radius: 999px;
  padding: 0 14px;
  cursor: pointer;
}

.chip.active {
  color: var(--text);
  background: rgba(124,199,255,0.14);
  border-color: rgba(124,199,255,0.26);
}

.page-header {
  padding: 42px 0 20px;
}

.page-header h1 {
  margin: 12px 0 8px;
  font-size: clamp(2rem, 3vw, 3rem);
  letter-spacing: -0.04em;
}

.page-header p { color: var(--muted); max-width: 70ch; line-height: 1.7; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(124,199,255,0.28);
  background: rgba(124,199,255,0.12);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 20px 0 18px;
}

.stat-tile {
  padding: 18px;
}

.stat-tile__label { color: var(--muted); font-size: 0.82rem; }
.stat-tile__value { margin-top: 10px; font-size: 1.5rem; font-weight: 800; }

.note {
  color: var(--muted);
  font-size: 0.9rem;
}

.loading, .error, .empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--muted);
}

.error { color: #ffd0d0; }

.footer {
  padding: 36px 0 48px;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer .card {
  padding: 18px 22px;
}

@media (max-width: 980px) {
  .hero__grid,
  .preview-grid,
  .grid-3,
  .stat-strip {
    grid-template-columns: 1fr;
  }

  .nav { align-items: flex-start; padding: 14px 0; }
  .nav { flex-direction: column; }
  .navlinks { width: 100%; }
  .navlinks a { flex: 1 1 calc(50% - 10px); text-align: center; }
  .kpi-wrap { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .shell { width: min(calc(100% - 20px), var(--max)); }
  .hero-card { padding: 24px; }
  .panel-header, .toolbar { padding-left: 14px; padding-right: 14px; }
  .table th, .table td { padding: 11px 12px; }
  .kpi-wrap { grid-template-columns: 1fr; }
}


.summary-stack {
  display: grid;
  gap: 18px;
}

.mini-head {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}
