:root {
  --bg: #111214; --panel: #1c1d21; --edge: #2c2d33; --row: #232429;
  --text: #eeeef0; --muted: #8c8e96; --gold: #f5c518;
  --win: #43b581; --loss: #e84d4d; --live: #5865f2; --tie: #a0a0aa;
  color-scheme: dark;
}
* { 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;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--gold); }
.muted { color: var(--muted); }
.center { text-align: center; }
.gold { color: var(--gold); }
.win { color: var(--win); } .loss { color: var(--loss); }

header {
  display: flex; align-items: center; gap: 16px;
  max-width: 980px; margin: 0 auto; padding: 24px 16px 8px;
}
header img.badge { width: 84px; height: 84px; }
header h1 { margin: 0; color: var(--gold); font-size: 30px; }
header .sub { color: var(--muted); font-size: 14px; }
header > div { flex: 1; min-width: 0; }
header .join {
  margin-left: auto; padding: 10px 18px; border-radius: 999px; white-space: nowrap;
  background: var(--live); color: #fff; font-weight: 600;
}
header .join:hover { color: #fff; filter: brightness(1.12); }

nav {
  position: sticky; top: 0; z-index: 5; background: var(--bg);
  display: flex; gap: 6px; overflow-x: auto;
  max-width: 980px; margin: 0 auto; padding: 10px 16px; border-bottom: 1px solid var(--edge);
}
nav a {
  padding: 7px 14px; border-radius: 999px; background: var(--panel); border: 1px solid var(--edge);
  white-space: nowrap; font-weight: 600; font-size: 14px;
}
nav a.on { background: var(--gold); color: #111; border-color: var(--gold); }

main { max-width: 980px; margin: 0 auto; padding: 16px; }
h2 { color: var(--gold); margin: 26px 0 10px; font-size: 20px; }
h3 { color: var(--muted); text-transform: uppercase; font-size: 12px; letter-spacing: .06em; margin: 22px 0 8px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.tile { background: var(--panel); border: 1px solid var(--edge); border-radius: 12px; padding: 12px; text-align: center; }
.tile b { display: block; font-size: 22px; }
.tile span { color: var(--muted); font-size: 12px; }

.panel { background: var(--panel); border: 1px solid var(--edge); border-radius: 14px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
     padding: 10px 12px; cursor: pointer; white-space: nowrap; user-select: none; }
td { padding: 8px 12px; white-space: nowrap; }
tbody tr:nth-child(even) td { background: var(--row); }
td.num, th.num { text-align: right; }
img.th { width: 24px; height: 24px; vertical-align: middle; }
img.th.small { width: 20px; height: 20px; }
img.star { width: 15px; height: 15px; vertical-align: -2px; }
img.league { width: 22px; height: 22px; vertical-align: middle; margin-right: 4px; }

.chip { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; color: #fff; }
.chip.W { background: var(--win); } .chip.L { background: var(--loss); } .chip.T { background: var(--tie); }
.chip.inWar { background: var(--live); } .chip.preparation { background: var(--tie); }
.chip.role { background: var(--live); } .chip.leader { background: #c4a03c; } .chip.admin { background: var(--win); }
.labels { display: flex; flex-wrap: wrap; gap: 6px; }
.labels span { background: var(--panel); border: 1px solid var(--edge); border-radius: 999px; padding: 3px 12px; font-size: 13px; }

.score { text-align: center; padding: 18px; }
.score .big { font-size: 40px; font-weight: 800; }
.score .big img { width: 30px; height: 30px; vertical-align: 2px; }
.score .vs { color: var(--muted); margin: 0 14px; }
.def { font-size: 12px; }

.rounds a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; }
.rounds a:nth-child(even) { background: var(--row); }
.rounds .opp { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

select { background: var(--panel); color: var(--text); border: 1px solid var(--edge); border-radius: 8px;
         padding: 6px 10px; font: inherit; margin-right: 8px; }
.rank { display: inline-block; width: 26px; text-align: center; font-weight: 700; color: var(--muted); }
.rank.r1 { color: var(--gold); } .rank.r2 { color: #c0c6ce; } .rank.r3 { color: #cd7f32; }

footer { max-width: 980px; margin: 30px auto; padding: 0 16px 30px; color: var(--muted); font-size: 12px; text-align: center; }

@media (max-width: 600px) {
  header { flex-wrap: wrap; }
  header .join { margin-left: 0; width: 100%; text-align: center; }
  header img.badge { width: 60px; height: 60px; }
  header h1 { font-size: 24px; }
  .score .big { font-size: 30px; }
  td, th { padding: 7px 8px; }
}
