/* ─── Montserrat Font ────────────────────────────────────────────────────── */
@font-face {
  font-family: 'Montserrat';
  src: url('/fonts/Montserrat-VariableFont_wght.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ─── Design Tokens ─────────────────────────────────────────────────────── */
:root {
  --navy:        #0d0d14;
  --navy-mid:    #13131e;
  --navy-light:  #1c1c2a;
  --navy-border: rgba(255,255,255,0.1);
  --gold:        #CC1020;
  --gold-light:  #e82030;
  --gold-dim:    rgba(204,16,32,0.15);
  --text:        #f0f0f5;
  --text-muted:  rgba(240,240,245,0.5);
  --green:       #2ecc71;
  --red:         #e74c3c;
  --radius:      6px;
  --shadow:      0 2px 12px rgba(0,0,0,0.5);
}

/* ─── Reset & Base ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--navy);
  color: var(--text);
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-light); }

img { max-width: 100%; }

/* ─── Public Nav ────────────────────────────────────────────────────────── */
.site-header {
  background: var(--navy-mid);
  border-bottom: 2px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 56px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text);
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.logo-img {
  height: 32px;
  width: auto;
  flex-shrink: 0;
}

.site-nav {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
}

.site-nav a {
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color 0.15s, background 0.15s;
}

.site-nav a:hover, .site-nav a.active {
  color: var(--gold);
  background: var(--gold-dim);
}

.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.4rem;
  cursor: pointer;
  margin-left: auto;
  padding: 0.25rem 0.5rem;
}

@media (max-width: 640px) {
  .hamburger { display: block; }
  .site-nav {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--navy-mid);
    border-bottom: 2px solid var(--gold);
    padding: 0.5rem;
    z-index: 200;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 0.75rem 1rem; }
}

/* ─── Hero ──────────────────────────────────────────────────────────────── */
.hero {
  background: radial-gradient(ellipse at 50% 0%, rgba(204,16,32,0.12) 0%, var(--navy) 70%),
              linear-gradient(180deg, var(--navy-mid) 0%, var(--navy) 100%);
  border-bottom: 1px solid rgba(204,16,32,0.2);
  padding: 4rem 1rem;
  text-align: center;
}

.hero-inner     { max-width: 600px; margin: 0 auto; }
.hero-logo-img  { height: 120px; width: auto; margin-bottom: 0.75rem; filter: drop-shadow(0 0 24px rgba(255,42,42,0.45)); }
.hero-title     { font-size: 2.5rem; font-weight: 800; color: var(--text); letter-spacing: -0.02em; }
.hero-subtitle { font-size: 1.1rem; color: var(--text-muted); margin-top: 0.25rem; }

.tournament-day-badge {
  display: inline-block;
  margin: 1rem 0;
  padding: 0.4rem 1.2rem;
  background: var(--gold);
  color: var(--navy);
  border-radius: 100px;
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ─── Hero button rows ───────────────────────────────────────────────────── */
.hero-row {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1rem;
}

/* Row 1: External links — dark bg, red border, white text */
.hero-btn-ext {
  padding: 0.7rem 1.5rem;
  min-width: 140px;
  text-align: center;
  background: var(--navy-light);
  border: 2px solid var(--gold);
  border-radius: 8px;
  color: var(--text);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  transition: background 0.15s, color 0.15s;
}
.hero-btn-ext:hover { background: rgba(204,16,32,0.15); color: var(--text); }

/* Divider between row 1 and row 2 */
.hero-divider {
  width: 100%;
  max-width: 520px;
  height: 2px;
  background: var(--gold);
  margin: 0.75rem auto 0;
}

/* Row 2: Internal nav — white bg, red text */
.hero-btn-int {
  padding: 0.7rem 1.5rem;
  min-width: 140px;
  text-align: center;
  background: #fff;
  border: 2px solid #fff;
  border-radius: 8px;
  color: var(--gold);
  font-weight: 700;
  font-size: 0.95rem;
  transition: background 0.15s, border-color 0.15s;
}
.hero-btn-int:hover { background: #f0f0f0; border-color: #f0f0f0; color: var(--gold); }

/* Row 3: Live Stream — solid red, full-width-ish */
.hero-btn-live {
  padding: 0.8rem 3.5rem;
  background: var(--gold);
  border: 2px solid var(--gold);
  border-radius: 8px;
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.01em;
  transition: background 0.15s;
}
.hero-btn-live:hover { background: var(--gold-light); border-color: var(--gold-light); color: #fff; }

/* Live Stream link in top nav */
.nav-livestream {
  color: var(--gold) !important;
  font-weight: 700 !important;
}

/* ─── Sections & Container ──────────────────────────────────────────────── */
.section   { padding: 2rem 0; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }

.page-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 0.25rem;
}

.page-subtitle {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* ─── Division Tabs ─────────────────────────────────────────────────────── */
.division-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}

.div-tab {
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--navy-border);
  border-radius: 100px;
  font-size: 0.82rem;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.div-tab:hover, .div-tab.active {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-dim);
}

/* ─── Day Toggle ────────────────────────────────────────────────────────── */
.day-toggle {
  display: flex;
  border: 1px solid var(--navy-border);
  border-radius: var(--radius);
  overflow: hidden;
  width: fit-content;
  margin-bottom: 1rem;
}

.day-btn {
  padding: 0.5rem 1.2rem;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.15s;
}

.day-btn:hover { background: var(--navy-light); color: var(--text); }
.day-btn.active { background: var(--gold); color: var(--navy); }

/* ─── Filter Bar ────────────────────────────────────────────────────────── */
.filter-bar, .filter-bar-public {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  align-items: center;
}

.filter-bar select, .filter-bar-public select {
  padding: 0.4rem 0.7rem;
  background: var(--navy-light);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.875rem;
  cursor: pointer;
}

/* ─── Standings Table ───────────────────────────────────────────────────── */
.division-block { margin-bottom: 2.5rem; }

.division-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--gold-dim);
}

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  min-width: 500px;
}

.standings-table th {
  text-align: center;
  padding: 0.5rem 0.6rem;
  background: var(--navy-light);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--navy-border);
}

.standings-table td {
  padding: 0.55rem 0.6rem;
  text-align: center;
  border-bottom: 1px solid var(--navy-border);
}

.standings-table .team-col { text-align: left; }
.standings-table .rank-col { color: var(--text-muted); font-size: 0.8rem; }
.standings-table .pts-col  { font-weight: 700; color: var(--gold); }
.standings-table td.pos    { color: var(--green); }
.standings-table td.neg    { color: var(--red); }
.standings-table .first-place { background: rgba(200,150,42,0.05); }

/* ─── Schedule ──────────────────────────────────────────────────────────── */
.time-block { margin-bottom: 1.5rem; }

.time-header {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold);
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--gold-dim);
  margin-bottom: 0.5rem;
}

.time-games { display: flex; flex-direction: column; gap: 0.4rem; }

.pub-game-row {
  background: var(--navy-light);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  transition: border-color 0.15s;
}

.pub-game-row.status-in_progress { border-color: var(--gold); }
.pub-game-row.status-final { opacity: 0.85; }

.pub-game-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
}

.pub-game-rink { color: var(--text-muted); }
.game-notes-icon { color: var(--text-muted); font-size: 0.75rem; }

.pub-game-matchup {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
}

.pub-team {
  font-weight: 600;
  font-size: 0.9rem;
}

.pub-team:last-child { text-align: right; }
.pub-team.winner { color: var(--gold); }

.pub-game-score { text-align: center; }

.final-score, .live-score { font-size: 1.1rem; font-weight: 700; display: block; }
.vs-text     { color: var(--text-muted); font-size: 0.85rem; }
.final-badge { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; }
.live-badge  { font-size: 0.65rem; color: var(--gold); text-transform: uppercase; animation: pulse 1.5s infinite; }

/* ─── Badges ────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  background: var(--gold-dim);
  border: 1px solid rgba(200,150,42,0.3);
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gold-light);
  white-space: nowrap;
}

.badge-sm { font-size: 0.65rem; padding: 0.1rem 0.4rem; }
.playoff-badge { font-size: 0.7rem; color: var(--text-muted); background: rgba(255,255,255,0.05); border: 1px solid var(--navy-border); border-radius: 100px; padding: 0.1rem 0.4rem; }
.live-badge-lg  { background: var(--red); color: #fff; font-size: 0.7rem; font-weight: 700; border-radius: 4px; padding: 0.15rem 0.4rem; animation: pulse 1.5s infinite; }
.final-badge-sm { background: rgba(46,204,113,0.2); color: var(--green); font-size: 0.7rem; border-radius: 4px; padding: 0.15rem 0.4rem; }

@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ─── Live Scores ───────────────────────────────────────────────────────── */
.live-scores-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.auto-refresh-info {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 1.5s infinite;
}

.live-empty {
  text-align: center;
  padding: 4rem 1rem;
}

.live-empty-icon { font-size: 3rem; margin-bottom: 1rem; }

.live-rink-block { margin-bottom: 2rem; }

.live-rink-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--gold-dim);
}

.live-games {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}

.live-game-card {
  background: var(--navy-light);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius);
  padding: 1rem;
}

.card-live { border-color: var(--gold); }

.live-game-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.live-game-rink { font-weight: 600; font-size: 0.8rem; }
.live-game-time { color: var(--text-muted); font-size: 0.8rem; margin-left: auto; }

.live-matchup { display: flex; flex-direction: column; gap: 0.4rem; }

.live-team {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.6rem;
  border-radius: 4px;
  background: rgba(255,255,255,0.03);
}

.live-team.winner { background: var(--gold-dim); }

.live-team-name { font-size: 0.95rem; font-weight: 600; }

.live-score-num {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--gold);
  min-width: 2rem;
  text-align: right;
}

/* ─── Recent Scores (home) ──────────────────────────────────────────────── */
.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 1rem;
}

.recent-scores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
}

.score-card {
  background: var(--navy-light);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius);
  padding: 0.75rem;
}

.score-card.live { border-color: var(--gold); }

.score-card-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
  font-size: 0.78rem;
}

.score-card-meta { color: var(--text-muted); margin-left: auto; }

.score-card-teams {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.score-card-team { font-size: 0.9rem; font-weight: 600; }
.score-card-team.winner { color: var(--gold); }
.score-card-scores { font-size: 1rem; font-weight: 700; color: var(--text-muted); text-align: center; }

/* ─── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.45rem 1rem;
  background: var(--navy-light);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.btn:hover { border-color: var(--gold); color: var(--gold); }
.btn-primary { background: var(--gold); border-color: var(--gold); color: var(--navy); font-weight: 700; }
.btn-primary:hover { background: var(--gold-light); border-color: var(--gold-light); color: var(--navy); }
.btn-danger { background: rgba(231,76,60,0.15); border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.8rem; }
.btn-lg { padding: 0.7rem 1.6rem; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }
.btn-link { color: var(--gold); font-size: 0.9rem; }
.btn-link:hover { color: var(--gold-light); }

/* ─── Misc ──────────────────────────────────────────────────────────────── */
.muted { color: var(--text-muted); font-size: 0.875rem; }
.empty { color: var(--text-muted); font-style: italic; }
code { background: rgba(255,255,255,0.07); padding: 0.1rem 0.35rem; border-radius: 3px; font-size: 0.85em; font-family: 'Menlo', 'Consolas', monospace; }

.status-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: capitalize;
}

.status-scheduled   { background: rgba(255,255,255,0.08); color: var(--text-muted); }
.status-in_progress { background: rgba(200,150,42,0.2); color: var(--gold); }
.status-final       { background: rgba(46,204,113,0.15); color: var(--green); }

/* ─── Tier Break rows ───────────────────────────────────────────────────── */
.tier-break-row td {
  padding: 0.25rem 0 !important;
  border-bottom: none !important;
  background: transparent !important;
}

/* ——— TIER 2 ——— line with optional centred label */
.tier-break-line {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.35rem 0.5rem;
}
.tier-break-line::before,
.tier-break-line::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gold);
  opacity: 0.5;
}

.tier-break-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
  opacity: 0.85;
}

/* ─── Championship card ─────────────────────────────────────────────────── */
.championship-card {
  border-color: var(--gold) !important;
  box-shadow: 0 0 12px rgba(204,16,32,0.25);
}
.championship-card .bracket-card-header {
  background: var(--gold-dim);
}

/* ─── Game number chip ──────────────────────────────────────────────────── */
.game-num-chip {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* ─── Filter bar text input ─────────────────────────────────────────────── */
.filter-bar input[type="text"],
.filter-bar-public input[type="text"] {
  padding: 0.4rem 0.7rem;
  background: var(--navy-light);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.875rem;
  font-family: inherit;
  min-width: 0;
  width: 160px;
}
.filter-bar input[type="text"]::placeholder,
.filter-bar-public input[type="text"]::placeholder { color: var(--text-muted); }

/* ─── Site Footer ───────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--navy-border);
  padding: 1.5rem 1rem 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 3rem;
}

.footer-sponsor {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.footer-sponsor-logo {
  height: 40px;
  width: auto;
  display: block;
}

/* ─── Sponsors Section (footer) ─────────────────────────────────────────── */
.sponsors-section {
  max-width: 860px;
  margin: 0 auto 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.sponsor-tier-block { text-align: center; }

.sponsor-tier-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: 0.9rem;
}
.sponsor-tier-heading::before,
.sponsor-tier-heading::after {
  content: '';
  flex: 1;
  max-width: 80px;
  height: 1px;
  background: var(--navy-border);
}

.sponsor-logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
}

.sponsor-logo-link {
  display: inline-flex;
  align-items: center;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.sponsor-logo-link:hover { opacity: 1; }

.sponsor-logo-gold   { height: 56px; width: auto; max-width: 160px; object-fit: contain; }
.sponsor-logo-silver { height: 40px; width: auto; max-width: 120px; object-fit: contain; }

.sponsor-name-fallback {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
}

.sponsor-bronze-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.2rem 0.65rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.sponsor-bronze-name {
  color: var(--text-muted);
  transition: color 0.2s;
}
a.sponsor-bronze-name:hover { color: var(--text); }

.sponsor-footer-divider {
  width: 60px;
  height: 1px;
  background: var(--navy-border);
  margin: 0.5rem auto 1.5rem;
}
