:root {
  color-scheme: dark;
  --bg: #060d17;
  --bg-soft: #101b2b;
  --panel: rgba(12, 20, 32, 0.94);
  --panel-strong: rgba(17, 28, 42, 0.98);
  --line: rgba(123, 146, 183, 0.22);
  --text: #edf3ff;
  --muted: #9bb0c9;
  --accent: #3ce0b9;
  --accent-2: #ff5c64;
  --gold: #ffd166;
  --shadow: rgba(1, 6, 14, 0.6);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top, rgba(46, 92, 136, 0.45) 0%, rgba(8, 16, 28, 0.98) 26%, rgba(4, 9, 16, 1) 100%);
  color: var(--text);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  background: rgba(7, 13, 21, 0.94);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 10px 30px var(--shadow);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #0f8f71);
  color: #03150d;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.brand strong {
  display: block;
  letter-spacing: 0.12em;
  font-size: 0.85rem;
}

.brand small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  letter-spacing: 0.14em;
  font-size: 0.6rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  border: 1px solid rgba(32, 52, 71, 0.8);
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #2ed1bd);
  color: #051812;
  font-weight: 800;
  padding: 10px 15px;
  letter-spacing: 0.04em;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn.secondary {
  background: #111d2f;
  color: var(--text);
}
.btn.ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.sidebar {
  background: rgba(8, 14, 22, 0.98);
  border-right: 1px solid var(--line);
  padding: 22px 18px 18px;
}

nav {
  display: grid;
  gap: 8px;
}

nav a {
  padding: 11px 12px;
  border-radius: 12px;
  color: var(--muted);
  font-weight: 700;
  transition: all 0.15s ease;
}

nav a.active, nav a:hover {
  background: linear-gradient(90deg, rgba(48, 88, 130, 0.45), rgba(16, 28, 40, 0.6));
  color: var(--text);
  border: 1px solid rgba(105, 148, 196, 0.24);
}

.sidebar-card {
  margin-top: 22px;
  padding: 14px 14px 12px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px rgba(255,255,255,0.04);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 10px;
  font-weight: 900;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(21, 94, 72, 0.35);
  color: var(--accent);
  font-weight: 800;
  border: 1px solid rgba(60, 224, 185, 0.28);
}

.status-pill.offline {
  background: rgba(132, 38, 58, 0.28);
  color: #ff9aa2;
  border-color: rgba(255, 92, 100, 0.45);
}

.note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

main {
  padding: 24px;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.hero,
.panel,
.team-card,
.card,
.playoff-round,
.metric {
  background: linear-gradient(180deg, rgba(18, 30, 44, 0.96), rgba(9, 16, 23, 0.98));
  border: 1px solid var(--line);
  box-shadow: inset 0 1px rgba(255,255,255,0.03);
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 24px;
  border-radius: 24px;
}

.hero h1 {
  margin: 6px 0 10px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.05;
}

.hero p {
  margin: 0;
  color: var(--muted);
  max-width: 750px;
}

.hero-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(110px, 1fr));
  gap: 10px;
  min-width: 230px;
}

.metric {
  padding: 14px 16px;
  border-radius: 14px;
}

.metric small {
  display: block;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 10px;
}

.metric strong {
  display: block;
  margin-top: 6px;
  font-size: 1.6rem;
  font-weight: 800;
}

.panel {
  margin-top: 18px;
  padding: 18px;
  border-radius: 18px;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.page-head h2 {
  margin: 0;
  font-size: clamp(1.2rem, 2vw, 1.8rem);
}

.card-list,
.team-grid,
.playoff-bracket {
  display: grid;
  gap: 12px;
}

.card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 14px 15px;
  border-radius: 14px;
}

.card .team,
.team-card .team {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.team-name-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.team-name-wrap strong,
.team-card strong {
  display: block;
  font-size: 0.95rem;
}

.team-name-wrap small,
.team-card small {
  color: var(--muted);
}

.flag,
.team-badge,
.team-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}

.flag {
  width: 36px;
  height: 36px;
  font-size: 11px;
  font-weight: 900;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.06);
}

.team-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  padding: 3px;
  background: rgba(255,255,255,0.05);
}

.badge,
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.badge {
  background: rgba(60, 224, 185, 0.12);
  color: var(--accent);
  border: 1px solid rgba(60, 224, 185, 0.2);
}

.rank-badge {
  background: rgba(255, 209, 102, 0.12);
  color: var(--gold);
  border: 1px solid rgba(255, 209, 102, 0.2);
  min-width: 34px;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.table th {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 10px;
}

.table tr:hover td {
  background: rgba(255,255,255,0.02);
}

.team-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.team-card {
  padding: 15px;
  border-radius: 16px;
}

.team-card .meta {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.6;
}

.conference-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.conference-filter-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,0.02);
  color: var(--text);
  padding: 7px 10px;
}

.conference-filter-btn.active {
  background: linear-gradient(135deg, var(--accent), #3bb5d1);
  color: #02190f;
  border-color: transparent;
  font-weight: 800;
}

.matchup-card {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto minmax(140px, 1fr);
  align-items: center;
  gap: 10px;
}

.matchup-side {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02);
}

.matchup-vs {
  color: var(--muted);
  font-weight: 800;
}

.matchup-summary {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.78rem;
}

.playoff-bracket {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.playoff-round {
  border-radius: 18px;
  padding: 14px;
}

.playoff-round-header {
  margin: 0 0 10px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 10px;
  font-weight: 900;
}

.playoff-match {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
}

.playoff-match strong {
  font-size: 0.8rem;
}

.playoff-match div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ticker-wrap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  border-top: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(8, 14, 22, 0.96), rgba(17, 32, 46, 0.96));
  overflow: hidden;
}

.ticker {
  display: flex;
  align-items: center;
  gap: 18px;
  width: max-content;
  padding: 12px 18px;
  white-space: nowrap;
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
  animation: marquee 24s linear infinite;
}

.ticker .piece {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}

.ticker-teams {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (max-width: 920px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  main { padding: 16px; }
  .hero { flex-direction: column; align-items: flex-start; }
  .matchup-card { grid-template-columns: 1fr; }
  .matchup-vs { display: none; }
  .topbar { gap: 12px; flex-wrap: wrap; }
}

