:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #1c1f24;
  --muted: #6b7280;
  --line: #e3e5e9;
  --ct: #4a7bd0;
  --t: #c9962c;
  --live: #1f9d55;
  --warn: #b7791f;
  --leetify: #f84982;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317;
    --card: #1a1d23;
    --text: #e6e8eb;
    --muted: #9aa1ab;
    --line: #2a2e36;
    --ct: #7aa2ec;
    --t: #e0b354;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}

.brand { font-weight: 700; font-size: 18px; }
.brand span { font-weight: 400; color: var(--muted); }

.status {
  font-size: 13px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid currentColor;
}
.status.live { color: var(--live); }
.status.stale { color: var(--warn); }
.status.offline { color: var(--muted); }

main { max-width: 1100px; margin: 0 auto; padding: 20px; }

.match { text-align: center; margin-bottom: 20px; }
.map { font-size: 22px; font-weight: 700; }
.score { font-size: 44px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.score .sep { color: var(--muted); margin: 0 8px; }
.meta { color: var(--muted); font-size: 14px; }

.ct { color: var(--ct); }
.t { color: var(--t); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.card h2 { margin: 0 0 10px; font-size: 16px; }

.me-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin: 0;
}
.me-grid div { background: var(--bg); border-radius: 8px; padding: 8px 10px; }
.me-grid dt { color: var(--muted); font-size: 12px; }
.me-grid dd { margin: 0; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 7px 8px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 12px; font-weight: 600; }
th.l, td.l { text-align: left; }
tr:last-child td { border-bottom: 0; }
tr.dead td { opacity: 0.45; }
tr.is-me td.l a { font-weight: 700; }

td a { color: inherit; text-decoration: none; }
td a:hover { text-decoration: underline; }
a.leetify-link { color: var(--leetify); font-weight: 600; font-size: 12px; }

.rating { font-weight: 700; }
.muted { color: var(--muted); }

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

footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px 30px;
  color: var(--muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
footer p { margin: 0; }
footer .leetify { color: var(--leetify); font-weight: 600; }
footer .leetify-badge { display: inline-block; background: #14161b; border-radius: 8px; padding: 6px 10px; }
footer .leetify-badge img { height: 48px; display: block; }

.card h2 .sub, p.sub { color: var(--muted); font-size: 13px; font-weight: 400; margin-left: 8px; }
p.sub { margin: 10px 0 0; }
.names { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.chip { background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 13px; }
p.sub a { color: var(--ct); font-weight: 600; }
