* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0f1117;
  color: #e4e4e7;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

/* Navbar */
.navbar {
  background: #16181f;
  border-bottom: 1px solid #2a2d38;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar .brand {
  font-size: 1.1rem;
  font-weight: 800;
  background: linear-gradient(90deg, #f97316, #ef4444);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.4rem 0.2rem;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}

.nav-links a:hover, .nav-links a.active {
  color: #f97316;
  border-bottom-color: #f97316;
}

/* Layout */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem;
}

.page-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.page-subtitle {
  color: #9ca3af;
  margin-bottom: 2rem;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid #2a2d38;
  background: #16181f;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th, td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid #232631;
}

th {
  background: #1c1f2a;
  color: #9ca3af;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
}

tr:hover td { background: #1a1d27; }

td.num, th.num { text-align: right; }

/* Rank badges */
.rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 0.85rem;
}
.rank-1 { background: #facc15; color: #000; }
.rank-2 { background: #cbd5e1; color: #000; }
.rank-3 { background: #d97706; color: #fff; }
.rank-n { background: #2a2d38; color: #9ca3af; }

/* Team tag */
.team-tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  background: #2a2d38;
  color: #f97316;
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

.card {
  background: #16181f;
  border: 1px solid #2a2d38;
  border-radius: 12px;
  padding: 1.5rem;
  transition: transform 0.2s, border-color 0.2s;
}

.card:hover {
  transform: translateY(-3px);
  border-color: #f97316;
}

.card h3 { font-size: 1.15rem; margin-bottom: 0.25rem; }
.card .abbr { color: #f97316; font-weight: 700; font-size: 0.85rem; }

.member-list {
  margin-top: 1rem;
  list-style: none;
}
.member-list li {
  padding: 0.35rem 0;
  border-bottom: 1px solid #232631;
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
}
.member-list li:last-child { border-bottom: none; }
.member-list .uid { color: #6b7280; font-size: 0.8rem; }

/* Stat highlight */
.stat-row {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.stat-box {
  background: #16181f;
  border: 1px solid #2a2d38;
  border-radius: 10px;
  padding: 1rem 1.5rem;
  flex: 1;
  min-width: 140px;
}
.stat-box .label { color: #9ca3af; font-size: 0.8rem; text-transform: uppercase; }
.stat-box .value { font-size: 1.6rem; font-weight: 800; color: #f97316; }

/* Hero */
.hero {
  background: linear-gradient(135deg, #1a1d2a 0%, #2a1a1a 100%);
  border-bottom: 1px solid #2a2d38;
  padding: 3rem 2rem;
  text-align: center;
}
.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(90deg, #f97316, #ef4444);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p { color: #9ca3af; margin-top: 0.5rem; }

footer {
  text-align: center;
  padding: 2rem;
  color: #6b7280;
  font-size: 0.85rem;
  border-top: 1px solid #2a2d38;
}

@media (max-width: 768px) {
  .nav-links { gap: 1rem; font-size: 0.85rem; }
  .page-title { font-size: 1.5rem; }
}

/* Search & Filter */
.controls {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  align-items: center;
}
.controls input, .controls select {
  background: #1c1f2a;
  border: 1px solid #2a2d38;
  color: #e4e4e7;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.95rem;
}
.controls input { flex: 1; min-width: 200px; }
.controls input:focus, .controls select:focus { outline: none; border-color: #f97316; }
.controls input::placeholder { color: #6b7280; }
.sort-btn {
  background: #1c1f2a;
  border: 1px solid #2a2d38;
  color: #9ca3af;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  font-weight: 600;
  transition: border-color 0.2s, color 0.2s;
}
.sort-btn:hover { border-color: #f97316; color: #f97316; }
.sort-btn.active { border-color: #f97316; color: #f97316; background: rgba(249,115,22,0.1); }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: #f97316; }
th.sortable::after { content: ' ↕'; font-size: 0.7rem; opacity: 0.5; }
th.sort-asc::after { content: ' ↑'; color: #f97316; opacity: 1; }
th.sort-desc::after { content: ' ↓'; color: #f97316; opacity: 1; }

/* Match / Fixture cards */
.fixture-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}
.fixture-card {
  background: #16181f;
  border: 1px solid #2a2d38;
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  transition: transform 0.2s, border-color 0.2s;
}
.fixture-card:hover { transform: translateY(-3px); border-color: #f97316; }
.fixture-card.played { border-color: #22c55e; }
.fixture-teams {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.fixture-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  flex: 1;
}
.fixture-team .tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: #f97316;
  background: #2a2d38;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
}
.fixture-team .tname { font-size: 0.85rem; color: #e4e4e7; font-weight: 600; }
.fixture-score {
  font-size: 2rem;
  font-weight: 800;
  color: #e4e4e7;
  min-width: 60px;
}
.fixture-vs {
  font-size: 1.5rem;
  font-weight: 800;
  color: #6b7280;
  min-width: 30px;
}
.fixture-status {
  font-size: 0.8rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.5rem;
}
.fixture-status.live { color: #ef4444; }
.fixture-status.done { color: #22c55e; }
.fixture-score.winner { color: #facc15; }
.fixture-score.loser { color: #6b7280; }
.fixture-team.winner-team .tag { background: rgba(250,204,21,0.2); color: #facc15; }
.fixture-team.winner-team .tname { color: #facc15; }
.fixture-team.loser-team { opacity: 0.55; }
.no-results { text-align: center; padding: 3rem; color: #6b7280; }