/* =========================================
   Soccer Standings — Netherite Theme
   ========================================= */

:root {
  --bg: #000000;
  --card: rgba(20, 14, 35, 0.9);
  --row: rgba(25, 18, 42, 0.9);
  --row-hover: rgba(32, 22, 55, 0.92);
  --row-alt: rgba(22, 16, 38, 0.9);
  --border: rgba(140, 100, 220, 0.12);
  --fg: #e2e8f0;
  --muted: #8a8a9a;
  --dim: #5a5a6a;
  --gold: #ffd54f;
  --silver: #bdbdbd;
  --bronze: #ffab40;
  --accent: #a78bfa;
  --green: #66bb6a;
  --blue: #42a5f5;
  --orange: #ffa726;
  --red: #ef5350;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Inter', -apple-system, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* Netherite texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    repeating-conic-gradient(#0a0a0a 0% 25%, #070707 0% 50%) 0 0 / 4px 4px,
    linear-gradient(145deg, #0c0c0c 0%, #050505 30%, #0a0808 50%, #060606 70%, #080706 100%);
}

body > * { position: relative; z-index: 1; }

::selection { background: rgba(167, 139, 250, 0.25); color: #a78bfa; }
a { color: var(--muted); text-decoration: none; }
a:hover { color: var(--fg); }

/* =========================================
   Layout
   ========================================= */
.wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 1.5rem 2rem;
}

.page-title {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  padding: 1.25rem 0 0;
  background: linear-gradient(135deg, #e2e8f0 0%, #66bb6a 60%, #ffd54f 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* =========================================
   League Tabs
   ========================================= */
.league-tabs {
  display: flex;
  gap: 0;
  justify-content: center;
  padding: 1rem 0 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.league-tab {
  padding: 0.5rem 1rem;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.league-tab:hover { color: var(--fg); }

.league-tab.active {
  color: var(--fg);
  border-bottom-color: var(--green);
}

/* =========================================
   Info Bar
   ========================================= */
.info-bar {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.fg {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.fg label {
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dim);
}

.fg select {
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg);
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  outline: none;
  cursor: pointer;
  min-width: 90px;
}

.fg select:focus { border-color: var(--accent); }

.back-link {
  font-size: 0.8rem;
  font-weight: 500;
  margin-left: auto;
  align-self: center;
}

/* =========================================
   Rankings Card
   ========================================= */
.rankings-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem;
  overflow-x: auto;
}

.state {
  padding: 3rem;
  text-align: center;
  color: var(--dim);
  font-size: 0.88rem;
}

/* =========================================
   Standings Table
   ========================================= */
.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  min-width: 550px;
}

.standings-table thead th {
  padding: 0.5rem 0.5rem;
  text-align: left;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--dim);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.12s;
  user-select: none;
}

.standings-table thead th:hover { color: var(--muted); }
.standings-table thead th.active { color: var(--accent); }

.standings-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  transition: background 0.1s;
}

.standings-table tbody tr:hover { background: var(--row-hover); }
.standings-table tbody tr:nth-child(even) { background: var(--row-alt); }
.standings-table tbody tr:nth-child(even):hover { background: var(--row-hover); }

.standings-table td {
  padding: 0.5rem 0.5rem;
  white-space: nowrap;
}

/* Column types */
.col-rank {
  width: 30px;
  text-align: center;
  font-weight: 700;
  color: var(--dim);
}

.col-rank.gold { color: var(--gold); }
.col-rank.silver { color: var(--silver); }
.col-rank.bronze { color: var(--bronze); }

/* Zone indicators */
.col-zone {
  width: 4px;
  padding: 0 !important;
}

.zone-ucl { background: var(--green); }
.zone-uel { background: var(--orange); }
.zone-uecl { background: var(--blue); }
.zone-rel { background: var(--red); }

.col-team {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 500;
}

.team-logo {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  object-fit: contain;
}

.col-stat {
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  min-width: 36px;
}

.col-stat.active {
  color: var(--accent);
  font-weight: 700;
}

.col-stat.pts {
  font-weight: 700;
  color: var(--fg);
}

/* =========================================
   Footer
   ========================================= */
.foot {
  text-align: center;
  padding: 2rem 0 1rem;
  font-size: 0.72rem;
  color: var(--dim);
}

.foot a { color: var(--muted); }

/* =========================================
   Responsive
   ========================================= */
@media (max-width: 700px) {
  .wrap { padding: 0.5rem 0.5rem 1rem; }
  .rankings-card { padding: 0.5rem; }
  .info-bar { flex-direction: column; align-items: stretch; gap: 0.5rem; }
  .fg select { width: 100%; }
  .back-link { margin-left: 0; }
  .league-tabs { justify-content: flex-start; }
}
