/* TLTJB — The League That Johnny Built */
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;600;700&family=Open+Sans:wght@400;600&display=swap');

:root {
  --primary: #500000;
  --primary-dark: #3a0000;
  --primary-light: #6b0000;
  --secondary: #ffffff;
  --accent: #8B0000;
  --gold: #c8a951;
  --bg: #0d0d0d;
  --bg-card: #1a1a1a;
  --bg-card-hover: #222222;
  --border: #333333;
  --text: #e8e8e8;
  --text-muted: #888888;
  --green: #2ecc71;
  --red: #e74c3c;
  --font-head: 'Oswald', sans-serif;
  --font-body: 'Open Sans', sans-serif;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── NAVBAR ─────────────────────────────────────────────────────── */
.navbar {
  background: var(--primary-dark);
  border-bottom: 3px solid var(--primary);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,0.6);
}
.nav-inner {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 60px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}
.nav-brand img { height: 38px; width: auto; }
.nav-brand span {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--secondary);
  letter-spacing: 0.05em;
}
.nav-links {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
  list-style: none;
}
.nav-links a {
  display: block;
  padding: 0.4rem 0.85rem;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-head);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}
.nav-links a:hover, .nav-links a.active {
  background: var(--primary);
  color: var(--secondary);
}
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--secondary);
  transition: transform 0.25s;
}
.mobile-menu {
  display: none;
  background: var(--primary-dark);
  border-top: 1px solid var(--border);
  padding: 0.5rem 1rem 1rem;
}
.mobile-menu.open { display: block; }
.mobile-menu a {
  display: block;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-head);
  letter-spacing: 0.05em;
}
.mobile-menu a:last-child { border-bottom: none; }

/* ── HERO ───────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #1a0000 60%, #0d0d0d 100%);
  padding: 3.5rem 1.5rem 2.5rem;
  text-align: center;
  border-bottom: 3px solid var(--primary);
}
.hero-logo { height: 140px; width: auto; margin-bottom: 1rem; filter: drop-shadow(0 4px 16px rgba(0,0,0,0.6)); }
.hero-title {
  font-family: var(--font-head);
  font-size: 2.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: 0.25rem;
}
.hero-subtitle {
  font-family: var(--font-head);
  font-size: 1rem;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}
.hero-champ-banner {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
  border: 1px solid var(--gold);
  border-radius: 8px;
  padding: 0.6rem 1.5rem;
  font-family: var(--font-head);
  font-size: 1rem;
  color: var(--gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hero-champ-banner .trophy { font-size: 1.3rem; }

/* ── PAGE HEADER ────────────────────────────────────────────────── */
.page-header {
  background: linear-gradient(90deg, var(--primary-dark), #1a0000);
  border-bottom: 3px solid var(--primary);
  padding: 2rem 1.5rem 1.5rem;
  text-align: center;
}
.page-header h1 {
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--secondary);
}
.page-header p { color: var(--text-muted); margin-top: 0.3rem; font-size: 0.9rem; }

/* ── LAYOUT ─────────────────────────────────────────────────────── */
.container { max-width: 1300px; margin: 0 auto; padding: 2rem 1.5rem; }
.section { margin-bottom: 3rem; }
.section-title {
  font-family: var(--font-head);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--secondary);
  border-left: 4px solid var(--primary);
  padding-left: 0.75rem;
  margin-bottom: 1.25rem;
}

/* ── CARDS ──────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.nav-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  text-decoration: none;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
  display: block;
}
.nav-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  background: var(--bg-card-hover);
}
.nav-card .nav-card-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.nav-card .nav-card-title {
  font-family: var(--font-head);
  font-size: 1rem;
  color: var(--secondary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}
.nav-card .nav-card-desc { font-size: 0.8rem; color: var(--text-muted); }

/* ── TABLES ─────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: 8px; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  background: var(--bg-card);
}
thead th {
  background: var(--primary-dark);
  color: var(--secondary);
  font-family: var(--font-head);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.7rem 0.85rem;
  text-align: left;
  border-bottom: 2px solid var(--primary);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
thead th:hover { background: var(--primary); }
thead th.sorted-asc::after { content: ' ▲'; font-size: 0.7em; }
thead th.sorted-desc::after { content: ' ▼'; font-size: 0.7em; }
tbody tr { border-bottom: 1px solid var(--border); transition: background 0.1s; }
tbody tr:hover { background: var(--bg-card-hover); }
tbody tr:last-child { border-bottom: none; }
td {
  padding: 0.65rem 0.85rem;
  white-space: nowrap;
}
td.name-col { white-space: normal; min-width: 130px; }
.rank-num { color: var(--text-muted); font-size: 0.8rem; }
.champ-row td { background: rgba(200,169,81,0.08); }
.champ-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--gold);
  color: #000;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-left: 0.4rem;
}

/* ── BADGES ─────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-regular { background: #1a3a5c; color: #7eb8f7; }
.badge-playoffs { background: #3a2a00; color: var(--gold); }
.badge-championship { background: #3a2a00; color: var(--gold); border: 1px solid var(--gold); }
.badge-quarters { background: #1a1a3a; color: #a0a8f7; }
.badge-semis { background: #1a2a1a; color: #7af7a0; }

/* ── CHAMPIONSHIP GRID ──────────────────────────────────────────── */
.champ-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.champ-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  text-align: center;
  position: relative;
}
.champ-card.latest { border-color: var(--gold); }
.champ-card .champ-year {
  font-family: var(--font-head);
  font-size: 1.5rem;
  color: var(--gold);
  font-weight: 700;
}
.champ-card .champ-name {
  font-family: var(--font-head);
  font-size: 1rem;
  color: var(--secondary);
  margin: 0.25rem 0;
  letter-spacing: 0.04em;
}
.champ-card .champ-score {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.champ-card .trophy-icon { font-size: 1.5rem; margin-bottom: 0.25rem; }

/* ── RECORDS STRIP ──────────────────────────────────────────────── */
.records-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.record-tile {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}
.record-tile .record-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}
.record-tile .record-value {
  font-family: var(--font-head);
  font-size: 1.4rem;
  color: var(--gold);
  font-weight: 700;
}
.record-tile .record-holder {
  font-size: 0.8rem;
  color: var(--text);
  margin-top: 0.2rem;
}
.record-tile .record-meta { font-size: 0.73rem; color: var(--text-muted); }

/* ── SEASON SELECTOR ────────────────────────────────────────────── */
.season-selector {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.season-selector label {
  font-family: var(--font-head);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.season-selector select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-head);
  font-size: 1rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
}
.season-selector select:focus { border-color: var(--primary); }

/* ── CHAMPION CALLOUT ───────────────────────────────────────────── */
.champ-callout {
  background: linear-gradient(90deg, var(--primary-dark), rgba(80,0,0,0.3));
  border: 1px solid var(--gold);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}
.champ-callout .trophy { font-size: 2rem; }
.champ-callout .champ-text { flex: 1; }
.champ-callout .champ-text .label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--gold);
  font-family: var(--font-head);
}
.champ-callout .champ-text .name {
  font-family: var(--font-head);
  font-size: 1.5rem;
  color: var(--secondary);
  font-weight: 700;
}
.champ-callout .champ-text .score { font-size: 0.85rem; color: var(--text-muted); }

/* ── OWNER CARDS ────────────────────────────────────────────────── */
.owner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.owner-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
  text-align: center;
}
.owner-card:hover { transform: translateY(-3px); border-color: var(--primary); }
.owner-card.selected { border-color: var(--gold); }
.owner-card .owner-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.owner-card .owner-name {
  font-family: var(--font-head);
  font-size: 1rem;
  color: var(--secondary);
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}
.owner-card .owner-meta { font-size: 0.78rem; color: var(--text-muted); line-height: 1.7; }
.owner-card .owner-titles { color: var(--gold); font-weight: 600; }

/* ── STATS GRID ─────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.stat-tile {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.9rem;
  text-align: center;
}
.stat-tile .stat-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}
.stat-tile .stat-value {
  font-family: var(--font-head);
  font-size: 1.4rem;
  color: var(--secondary);
  font-weight: 700;
}

/* ── STREAK CARDS ───────────────────────────────────────────────── */
.streak-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}
.streak-card {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  border-left: 4px solid var(--border);
}
.streak-card.win { border-left-color: var(--green); }
.streak-card.loss { border-left-color: var(--red); }
.streak-card .streak-team { font-family: var(--font-head); font-size: 0.9rem; color: var(--secondary); }
.streak-card .streak-num {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 700;
}
.streak-card.win .streak-num { color: var(--green); }
.streak-card.loss .streak-num { color: var(--red); }
.streak-card .streak-label { font-size: 0.75rem; color: var(--text-muted); }

/* ── H2H ────────────────────────────────────────────────────────── */
.h2h-summary {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
}
.h2h-team { font-family: var(--font-head); font-size: 1.1rem; color: var(--secondary); }
.h2h-record {
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
}
.h2h-divider { font-size: 1.5rem; color: var(--text-muted); }

/* ── DROPDOWNS ──────────────────────────────────────────────────── */
.dropdown-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.dropdown-row select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-head);
  font-size: 0.95rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  flex: 1;
  min-width: 160px;
  outline: none;
}
.dropdown-row select:focus { border-color: var(--primary); }
.vs-label {
  font-family: var(--font-head);
  font-size: 1.1rem;
  color: var(--text-muted);
}

/* ── PLAYOFF BRACKET ────────────────────────────────────────────── */
.bracket-round { margin-bottom: 1.5rem; }
.bracket-round-title {
  font-family: var(--font-head);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.75rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
}
.bracket-games { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.bracket-game {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 260px;
  overflow: hidden;
}
.bracket-game .bg-team {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.85rem;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border);
}
.bracket-game .bg-team:last-child { border-bottom: none; }
.bracket-game .bg-team.winner { background: rgba(80,0,0,0.25); }
.bracket-game .bg-team .team-name { font-family: var(--font-head); color: var(--secondary); }
.bracket-game .bg-team.winner .team-name { color: var(--gold); }
.bracket-game .bg-team .team-pts { font-weight: 600; color: var(--secondary); }

/* ── PROFILE VIEW ───────────────────────────────────────────────── */
.profile-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.4rem 0;
  margin-bottom: 1.25rem;
  background: none;
  border: none;
  font-family: var(--font-body);
}
.profile-back:hover { color: var(--secondary); }

/* ── FOOTER ─────────────────────────────────────────────────────── */
footer {
  background: var(--primary-dark);
  border-top: 2px solid var(--primary);
  text-align: center;
  padding: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 3rem;
}
footer a { color: var(--primary-light); text-decoration: none; }

/* ── CHART CONTAINER ────────────────────────────────────────────── */
.chart-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  position: relative;
  height: 280px;
}

/* ── UTIL ────────────────────────────────────────────────────────── */
.text-gold { color: var(--gold); }
.text-muted { color: var(--text-muted); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.hidden { display: none !important; }
.loading { text-align: center; padding: 3rem; color: var(--text-muted); font-family: var(--font-head); letter-spacing: 0.1em; }
.prompt-state { text-align: center; padding: 3rem; color: var(--text-muted); }
.prompt-state p { font-size: 1rem; }

/* ── RESPONSIVE ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .hero-title { font-size: 1.8rem; }
  .hero-logo { height: 100px; }
  .records-strip { grid-template-columns: repeat(2, 1fr); }
  .champ-grid { grid-template-columns: repeat(2, 1fr); }
  .card-grid { grid-template-columns: 1fr 1fr; }
  .h2h-summary { grid-template-columns: 1fr; }
  .h2h-divider { display: none; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .owner-grid { grid-template-columns: repeat(2, 1fr); }
  .streak-cards { grid-template-columns: repeat(2, 1fr); }
  .bracket-game { min-width: 100%; }
  .container { padding: 1rem; }
  .section { margin-bottom: 2rem; }
}
@media (max-width: 480px) {
  .records-strip { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .owner-grid { grid-template-columns: 1fr; }
  .streak-cards { grid-template-columns: 1fr; }
  .hero-title { font-size: 1.5rem; }
}
