/* ===================== RESET & VARIABLES ===================== */
:root {
	--wvu-blue: #002855;
	--wvu-gold: #EAAA00;
  --wv-blue: #002855;
  --wv-gold: #EAAA00;
  --wvu-gold-dark: #C49A20;
  --wv-red: #C8102E;
  --wv-light: #F5F3EE;
  --wv-white: #FFFFFF;
  --wv-gray: #6B6B6B;
  --wv-gray-light: #E8E6E0;
  --wv-green: #1A6B3C;
  --text-primary: #1A1A1A;
  --text-secondary: #555;
  --border: rgba(0,43,92,0.12);

  /* Spacing scale */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;

  /* Layout */
  --container-max: 1200px;
  --header-height: 64px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background: var(--wv-light);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
}

/* ===================== HEADER ===================== */
header {
  background: var(--wvu-blue);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 3px solid var(--wvu-gold);
}

.header-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  gap: var(--space-sm);
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.logo-emblem {
  width: 42px;
  height: 42px;
  background: var(--wvu-gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bebas Neue', cursive;
  font-size: 18px;
  color: var(--wvu-blue);
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo-text .state {
  font-family: 'Bebas Neue', cursive;
  font-size: 22px;
  color: var(--wvu-gold);
  letter-spacing: 2px;
}

.logo-text .subtitle {
  font-size: 10px;
  color: rgba(255,255,255,0.6);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 300;
  white-space: nowrap;
}

/* Nav */
nav {
  display: flex;
  gap: 4px;
}

nav button {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.7);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  text-transform: uppercase;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

nav button:hover {
  color: white;
  background: rgba(255,255,255,0.08);
}

nav button.active {
  color: var(--wvu-blue);
  background: var(--wvu-gold);
}

/* ===================== HERO ===================== */
.hero {
  background: var(--wvu-blue);
  padding: 3.5rem var(--space-lg) 3rem;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.hero-eyebrow {
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--wvu-gold);
  font-weight: 500;
  margin-bottom: 12px;
}

.hero h1 {
  font-family: 'Bebas Neue', cursive;
  font-size: clamp(40px, 8vw, 80px);
  color: white;
  letter-spacing: 3px;
  line-height: 1;
  margin-bottom: 16px;
}

.hero h1 span {
  color: var(--wvu-gold);
}

.hero p {
  font-size: clamp(14px, 2vw, 16px);
  color: rgba(255,255,255,0.6);
  max-width: 520px;
  margin: 0 auto var(--space-lg);
  font-weight: 300;
  line-height: 1.6;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: clamp(1.5rem, 5vw, 3rem);
  margin-top: var(--space-lg);
  flex-wrap: wrap;
}

.hero-stat {
  text-align: center;
}

.hero-stat .num {
  font-family: 'Bebas Neue', cursive;
  font-size: clamp(28px, 5vw, 36px);
  color: var(--wvu-gold);
  display: block;
  line-height: 1;
}

.hero-stat .lbl {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 4px;
  display: block;
}

/* ===================== PAGES ===================== */
.page {
  display: none;
}

.page.active {
  display: block;
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg);
}

/* ===================== SECTION HEADERS ===================== */
.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.section-head h2 {
  font-family: 'Bebas Neue', cursive;
  font-size: clamp(24px, 4vw, 32px);
  color: var(--wvu-blue);
  letter-spacing: 2px;
}

.section-head .count {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  background: var(--wvu-blue);
  color: var(--wvu-gold);
  padding: 3px 10px;
  border-radius: 20px;
}

/* ===================== YEAR TABS ===================== */
.year-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.year-tab {
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  padding: 8px 20px;
  border: 1.5px solid var(--wvu-blue);
  background: transparent;
  color: var(--wvu-blue);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
  font-weight: 500;
  -webkit-tap-highlight-color: transparent;
}

.year-tab:hover {
  background: var(--wvu-blue);
  color: white;
}

.year-tab.active {
  background: var(--wvu-blue);
  color: var(--wvu-gold);
  border-color: var(--wvu-blue);
}

/* ===================== SPORT TOGGLE ===================== */
.sport-toggle {
  display: inline-flex;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  gap: 4px;
  margin-bottom: var(--space-lg);
}

.sport-btn {
  padding: 8px 20px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
  color: var(--text-secondary);
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.sport-btn.active {
  background: var(--wvu-blue);
  color: var(--wvu-gold);
}

/* ===================== CHAMPIONS BANNER ===================== */
.champions-banner {
  background: var(--wvu-blue);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: 2.5rem;
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.champions-banner .trophy-label {
  font-family: 'Bebas Neue', cursive;
  font-size: clamp(16px, 3vw, 20px);
  color: var(--wvu-gold);
  letter-spacing: 2px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 2px;
}

.champions-banner .trophy-icon {
  font-size: 22px;
}

.champ-divider {
  width: 1px;
  height: 32px;
  background: rgba(255,255,255,0.2);
  flex-shrink: 0;
  align-self: center;
}

.champ-items {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.champ-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.champ-item .div-label {
  font-size: 10px;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.champ-item .team-name {
  font-size: 15px;
  font-weight: 600;
  color: white;
  line-height: 1.2;
}

/* ===================== DISTRICT CARDS ===================== */
.districts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 16px;
  margin-bottom: 2.5rem;
}

.district-card {
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.district-card:hover {
  box-shadow: 0 4px 20px rgba(0,43,92,0.1);
}

.district-card-header {
  background: var(--wvu-blue);
  padding: 10px 16px;
  font-family: 'Bebas Neue', cursive;
  font-size: 16px;
  color: var(--wvu-gold);
  letter-spacing: 1.5px;
}

.district-row {
  display: flex;
  align-items: center;
  padding: 9px 16px;
  border-bottom: 1px solid var(--wv-gray-light);
  font-size: 13px;
  gap: 10px;
}

.district-row:last-child {
  border-bottom: none;
}

.district-row .division-tag {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  background: var(--wv-light);
  color: var(--wvu-blue);
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 500;
  min-width: 64px;
  text-align: center;
  flex-shrink: 0;
}

.district-row .champ-team {
  font-weight: 600;
  color: var(--wvu-blue);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.district-row .runnerup-team {
  font-size: 11.5px;
  color: var(--text-secondary);
  text-align: right;
  flex-shrink: 0;
  max-width: 120px;
}

.district-row .runnerup-label {
  font-size: 9px;
  text-transform: uppercase;
  color: var(--wv-gray);
  letter-spacing: 0.8px;
  display: block;
}

/* ===================== STATS PAGE ===================== */
.stats-controls {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-group label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  font-weight: 500;
}

select {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  padding: 8px 30px 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  background: white;
  color: var(--text-primary);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 14 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 5L7 9L11 5' stroke='%236B6B6B' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

/* ===================== LEADERBOARD ===================== */
.leaderboard {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}

.lb-header {
  display: grid;
  grid-template-columns: 48px 1fr 90px 90px 90px;
  padding: 10px 20px;
  background: var(--wv-light);
  border-bottom: 1.5px solid var(--border);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-secondary);
  font-weight: 500;
}

.lb-row {
  display: grid;
  grid-template-columns: 48px 1fr 90px 90px 90px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--wv-gray-light);
  align-items: center;
  transition: background 0.15s;
}

.lb-row:last-child {
  border-bottom: none;
}

.lb-row:hover {
  background: #FAFAF8;
}

.lb-rank {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.lb-rank.gold   { color: var(--wvu-gold-dark); font-weight: 700; font-size: 15px; }
.lb-rank.silver { color: #8A8A8A; font-weight: 700; }
.lb-rank.bronze { color: #B87333; font-weight: 700; }

.lb-team {
  font-size: 15px;
  font-weight: 600;
  color: var(--wvu-blue);
  min-width: 0;
}

.lb-team .district-info {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 400;
  margin-top: 1px;
}

.lb-stat {
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  text-align: center;
  color: var(--text-primary);
}

.lb-stat.champs {
  color: var(--wvu-blue);
  font-weight: 700;
  font-size: 16px;
}

.bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mini-bar {
  height: 6px;
  background: var(--wvu-blue);
  border-radius: 3px;
  min-width: 4px;
}

/* ===================== HISTORY TABLE ===================== */
.history-table-wrap {
  overflow-x: auto;
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  -webkit-overflow-scrolling: touch;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  min-width: 600px;
}

.history-table th {
  background: var(--wvu-blue);
  color: var(--wvu-gold);
  font-family: 'Bebas Neue', cursive;
  font-size: 15px;
  letter-spacing: 1.5px;
  padding: 12px 16px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 2px solid var(--wvu-gold);
}

.history-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--wv-gray-light);
  color: var(--text-primary);
}

.history-table tbody tr:hover td {
  background: #F8F7F3;
}

.history-table tbody tr:last-child td {
  border-bottom: none;
}

.history-table .year-cell {
  font-family: 'DM Mono', monospace;
  font-weight: 600;
  color: var(--wvu-blue);
}

.champ-tag {
  display: inline-block;
  background: var(--wvu-blue);
  color: var(--wvu-gold);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
/* NOTES SECTION */

.notes {
    background-color: #f9f9f9;
    border-left: 5px solid var(--wvu-gold);
    padding: 20px;
    margin-top: 30px;
    border-radius: 6px;
}
/* ===================== Navbar ===================== */

.navbar {
    background-color: var(--wvu-blue);
}
.navbar-brand img {
    height: 48px;
}
.nav-link {
    color: #ffffff !important;
    font-weight: 500;
}
/* HERO / HEADER */

.page-header {
    background: linear-gradient(135deg, var(--wvu-blue), #001a3a);
    color: white;
    padding: 60px 20px 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.page-header::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("https://www.transparenttextures.com/patterns/asfalt-light.png");
    opacity: 0.08;
}
.page-header h1 {
    position: relative;
    z-index: 2;
    font-weight: 700;
}
.page-header p {
    position: relative;
    z-index: 2;
    font-size: 1.25rem;
}
/* ===================== UPDATE FORM ===================== */
.update-form {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: var(--space-lg);
  max-width: 800px;
}

.form-section {
  margin-bottom: var(--space-lg);
}

.form-section h3 {
  font-family: 'Bebas Neue', cursive;
  font-size: 22px;
  color: var(--wvu-blue);
  letter-spacing: 1.5px;
  margin-bottom: var(--space-sm);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--wvu-gold);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field label {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
}

.form-field input,
.form-field select {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--wv-light);
  color: var(--text-primary);
  transition: border-color 0.2s, background 0.2s;
  appearance: none;
  -webkit-appearance: none;
}

.form-field input:focus,
.form-field select:focus {
  outline: none;
  border-color: var(--wvu-blue);
  background: white;
}

/* ===================== BUTTONS ===================== */
.btn-primary {
  background: var(--wvu-blue);
  color: var(--wvu-gold);
  border: none;
  font-family: 'Bebas Neue', cursive;
  font-size: 18px;
  letter-spacing: 2px;
  padding: 12px 32px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary:hover {
  background: #003A7A;
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

/* ===================== TOASTS ===================== */
.success-toast {
  display: none;
  background: #D1FAE5;
  color: #065F46;
  border: 1px solid #6EE7B7;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  margin-top: 12px;
  font-weight: 500;
}

.success-toast.show {
  display: block;
}

/* ===================== SQL / CODE BOX ===================== */
.sql-box {
  background: #1A1A2E;
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-top: 2.5rem;
}

.sql-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}

.sql-box-header span {
  font-family: 'Bebas Neue', cursive;
  font-size: 18px;
  color: var(--wvu-gold);
  letter-spacing: 2px;
}

.copy-btn {
  background: rgba(244,197,66,0.15);
  border: 1px solid var(--wvu-gold);
  color: var(--wvu-gold);
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 14px;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.copy-btn:hover {
  background: rgba(244,197,66,0.25);
}

.sql-content {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: #90D1F5;
  white-space: pre;
  overflow-x: auto;
  line-height: 1.7;
  max-height: 400px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.sql-content .kw  { color: #FF79C6; }
.sql-content .str { color: #F1FA8C; }
.sql-content .num { color: #BD93F9; }
.sql-content .cm  { color: #6272A4; }

/* ===================== FOOTER ===================== */
footer {
  background: var(--wv-blue);
  color: #ccc;
  text-align: center;
  padding: var(--space-lg);
  font-size: 12px;
  border-top: 3px solid var(--wvu-gold);
  margin-top: var(--space-2xl);
}

footer strong {
  color: var(--wvu-gold);
}

/* ===================== RESPONSIVE — TABLET (≤ 768px) ===================== */
@media (max-width: 768px) {
  :root {
    --space-lg: 1.25rem;
    --space-xl: 2rem;
  }

  .header-inner {
    padding: 0 var(--space-sm);
  }

  .logo-text .subtitle {
    display: none;
  }

  nav button {
    font-size: 12px;
    padding: 7px 12px;
  }

  .hero {
    padding: 2.5rem var(--space-sm) 2rem;
  }

  .champions-banner {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .champ-divider {
    display: none;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .lb-header,
  .lb-row {
    grid-template-columns: 40px 1fr 70px 70px;
    padding: 10px 14px;
  }

  /* Hide runner-up column on tablet */
  .lb-header span:last-child,
  .lb-row .lb-stat:last-child {
    display: none;
  }

  .stats-controls {
    gap: 12px;
  }
}

/* ===================== RESPONSIVE — MOBILE (≤ 480px) ===================== */
@media (max-width: 480px) {
  :root {
    --space-lg: 1rem;
    --space-xl: 1.75rem;
  }

  .logo-emblem {
    width: 36px;
    height: 36px;
    font-size: 15px;
  }

  .logo-text .state {
    font-size: 18px;
  }

  nav button {
    font-size: 11px;
    padding: 6px 10px;
    letter-spacing: 0;
  }

  .hero-stats {
    gap: var(--space-sm);
  }

  .sport-toggle {
    width: 100%;
    justify-content: center;
  }

  .sport-btn {
    flex: 1;
    text-align: center;
    padding: 8px 10px;
    font-size: 13px;
  }

  .year-tabs {
    gap: 6px;
  }

  .year-tab {
    font-size: 13px;
    padding: 7px 14px;
  }

  .districts-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .district-row .runnerup-team {
    max-width: 90px;
    font-size: 10.5px;
  }

  /* Compact leaderboard on mobile */
  .lb-header,
  .lb-row {
    grid-template-columns: 32px 1fr 60px;
    padding: 10px 12px;
  }

  /* Hide Appearances and Runner-Up columns on mobile */
  .lb-header span:nth-child(4),
  .lb-header span:nth-child(5),
  .lb-row .lb-stat:nth-child(4),
  .lb-row .lb-stat:nth-child(5) {
    display: none;
  }

  .lb-team {
    font-size: 14px;
  }

  .lb-stat.champs {
    font-size: 14px;
  }

  .container {
    padding: var(--space-xl) var(--space-lg);
  }

  .update-form {
    padding: var(--space-sm);
  }

  .champions-banner {
    padding: var(--space-sm);
  }

  .champ-items {
    gap: var(--space-sm);
  }

  .stats-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group {
    width: 100%;
  }

  select {
    width: 100%;
  }

  .btn-primary {
    width: 100%;
    text-align: center;
  }
}

/* ===================== REDUCED MOTION ===================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
