:root {
  --bg: #0b1022;
  --bg-2: #0f1630;
  --surface: #141c3a;
  --surface-2: #1a2447;
  --line: #26325c;
  --text: #eef1f8;
  --muted: #95a1c3;
  --gold: #e8d46c;
  --red: #f04b4b;
  --blue: #2f7df2;
  --win: #3bcf7c;
  --draw: #e8d46c;
  --loss: #f04b4b;
  --radius: 14px;
  --display: "Anton", "Impact", sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--body);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 50% -200px, rgba(47,125,242,.22), transparent 70%),
    var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: .5px; margin: 0; line-height: 1.1; }
h1 { font-size: clamp(2rem, 6vw, 3.2rem); }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.2rem; }
.muted { color: var(--muted); }
.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 16px; }
main.container { flex: 1; padding-top: 28px; padding-bottom: 56px; outline: none; }
.loading { padding: 80px 0; text-align: center; color: var(--muted); }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(11,16,34,.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { max-width: 1100px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 40px; height: auto; }
.brand-text { font-family: var(--display); font-size: 1.35rem; color: var(--gold); letter-spacing: 1px; }
.brand-text small { font-family: var(--body); font-size: .7rem; color: var(--muted); letter-spacing: 2px; text-transform: uppercase; margin-left: 4px; }
.nav { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { padding: 8px 12px; border-radius: 999px; font-weight: 600; font-size: .9rem; color: var(--muted); transition: background .15s, color .15s; }
.nav a:hover { color: var(--text); background: var(--surface); }
.nav a.active { color: var(--bg); background: var(--gold); }
.menu-btn { display: none; margin-left: auto; background: none; border: 0; padding: 8px; cursor: pointer; }
.menu-btn span { display: block; width: 22px; height: 2px; background: var(--text); margin: 5px 0; border-radius: 2px; }

@media (max-width: 820px) {
  .menu-btn { display: block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; background: var(--bg-2); border-bottom: 1px solid var(--line); padding: 8px 16px 16px; }
  .nav.open { display: flex; }
  .nav a { border-radius: 10px; padding: 12px; }
}

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 24px 0; font-size: .85rem; }
.footer-inner { display: flex; align-items: center; gap: 14px; }

/* ---------- Generic blocks ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { margin: 6px 0 0; }
.section { margin-top: 36px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head a { color: var(--gold); font-weight: 600; font-size: .9rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.empty { padding: 28px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }

.stripe {
  height: 4px; border-radius: 4px; width: 64px; margin-bottom: 12px;
  background: linear-gradient(90deg, var(--red) 0 33%, var(--gold) 33% 66%, var(--blue) 66%);
}

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center;
  padding: 28px; border-radius: 20px;
  background: linear-gradient(135deg, var(--surface-2), var(--surface) 60%);
  border: 1px solid var(--line);
  position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -80px; top: -80px; width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(232,212,108,.18), transparent 70%);
}
.hero img { width: 150px; }
.hero h1 { color: var(--gold); }
.hero p { margin: 8px 0 0; color: var(--muted); }
@media (max-width: 600px) {
  .hero { grid-template-columns: 1fr; text-align: center; justify-items: center; padding: 22px 16px; }
  .hero img { width: 120px; }
}

/* ---------- Stat tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.tile .v { font-family: var(--display); font-size: 2rem; line-height: 1; }
.tile .l { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: 1px; margin-top: 6px; }
.tile.w .v { color: var(--win); } .tile.d .v { color: var(--draw); } .tile.l2 .v { color: var(--loss); }

/* ---------- Filters ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  padding: 7px 14px; border-radius: 999px; font: 600 .85rem var(--body); cursor: pointer;
}
.chip:hover { color: var(--text); }
.chip.on { background: var(--gold); color: var(--bg); border-color: var(--gold); }
select.chip { appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }

/* ---------- Match rows ---------- */
.matches { display: flex; flex-direction: column; gap: 10px; }
.match {
  display: grid; grid-template-columns: 92px 1fr auto; gap: 14px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; transition: border-color .15s, transform .15s;
}
.match:hover { border-color: var(--gold); transform: translateY(-1px); }
.match .date { font-size: .8rem; color: var(--muted); line-height: 1.3; }
.match .date strong { display: block; color: var(--text); font-size: .95rem; }
.match .teams { font-weight: 600; }
.match .teams .us { color: var(--gold); }
.match .meta { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.score {
  font-family: var(--display); font-size: 1.5rem; min-width: 74px; text-align: center;
  padding: 4px 10px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line);
}
.score.W { border-color: var(--win); color: var(--win); }
.score.D { border-color: var(--draw); color: var(--draw); }
.score.L { border-color: var(--loss); color: var(--loss); }
.score.tbd { font-family: var(--body); font-size: .72rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
@media (max-width: 520px) {
  .match { grid-template-columns: 1fr auto; }
  .match .date { grid-column: 1 / -1; display: flex; gap: 8px; }
  .match .date strong { display: inline; }
}

.form { display: flex; gap: 5px; }
.form span { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; font: 700 .75rem var(--body); color: var(--bg); }
.form .W { background: var(--win); } .form .D { background: var(--draw); } .form .L { background: var(--loss); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: 11px 14px; text-align: left; white-space: nowrap; }
th { font-size: .72rem; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); background: var(--bg-2); }
td { border-bottom: 1px solid rgba(38,50,92,.6); }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255,255,255,.025); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.rank { width: 44px; color: var(--muted); font-weight: 700; }
tr.top1 td.rank { color: var(--gold); }
.big { font-family: var(--display); font-size: 1.2rem; }
.player-cell { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.player-cell:hover { color: var(--gold); }

/* ---------- Avatars ---------- */
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none; overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--line);
  display: grid; place-items: center; font: 700 .75rem var(--body); color: var(--gold);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.avatar.lg { width: 120px; height: 120px; font-size: 2rem; border: 3px solid var(--gold); }

/* ---------- Roster ---------- */
.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 14px; }
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: border-color .15s, transform .15s; }
.pcard:hover { border-color: var(--gold); transform: translateY(-2px); }
.pcard .ph { aspect-ratio: 1; background: linear-gradient(160deg, var(--surface-2), var(--bg-2)); position: relative; display: grid; place-items: center; }
.pcard .ph img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.pcard .ph .ini { font-family: var(--display); font-size: 3rem; color: var(--line); }
.pcard .no { position: absolute; left: 10px; top: 8px; font-family: var(--display); font-size: 1.8rem; color: var(--gold); text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.pcard .cap { position: absolute; right: 10px; top: 10px; background: var(--gold); color: var(--bg); font: 800 .7rem var(--body); width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; }
.pcard .info { padding: 10px 12px 12px; }
.pcard .nm { font-weight: 700; line-height: 1.2; }
.pcard .sub { font-size: .78rem; color: var(--muted); margin-top: 4px; }

/* ---------- Match detail ---------- */
.scoreboard {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: center; text-align: center;
  padding: 26px 18px; border-radius: 20px; border: 1px solid var(--line);
  background: linear-gradient(135deg, var(--surface-2), var(--surface));
}
.scoreboard .team { font-family: var(--display); font-size: clamp(1.1rem, 4vw, 1.8rem); }
.scoreboard .team.us { color: var(--gold); }
.scoreboard .team img { width: 64px; margin: 0 auto 8px; }
.scoreboard .res { font-family: var(--display); font-size: clamp(2.4rem, 9vw, 4rem); line-height: 1; }
.scoreboard .res.tbd { font-family: var(--body); font-size: .9rem; color: var(--muted); }
.scoreboard .crumbs { grid-column: 1 / -1; color: var(--muted); font-size: .85rem; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font: 700 .72rem var(--body); text-transform: uppercase; letter-spacing: .5px; }
.badge.W { background: var(--win); color: var(--bg); } .badge.D { background: var(--draw); color: var(--bg); } .badge.L { background: var(--loss); color: #fff; }
.badge.tbd { background: var(--surface-2); color: var(--muted); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid rgba(38,50,92,.6); }
.list li:last-child { border-bottom: 0; }
.list .no { font-family: var(--display); color: var(--gold); width: 28px; text-align: right; }
.list .min { margin-left: auto; color: var(--muted); font-size: .85rem; }
.poster { border-radius: var(--radius); border: 1px solid var(--line); }

.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; font-size: .9rem; margin-bottom: 16px; }
.back:hover { color: var(--gold); }

/* ---------- Player detail ---------- */
.profile { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.profile .bignum { font-family: var(--display); font-size: 3.5rem; color: var(--gold); line-height: 1; margin-left: auto; }

/* ---------- Bars (leaderboard viz) ---------- */
.bar { height: 8px; border-radius: 4px; background: var(--gold); min-width: 2px; }
.bar-cell { width: 40%; min-width: 120px; }

.prose p { margin: 0 0 14px; color: #cfd6ea; max-width: 70ch; }

/* mobile hardening */
.profile > div { flex: 1; min-width: 0; }
h1 { overflow-wrap: break-word; }
@media (max-width: 520px) { .profile { flex-direction: column; text-align: center; } .profile > div { width: 100%; } .profile .stripe { margin-inline: auto; } .profile .bignum { margin: 0 auto; } }
