:root {
  --navy: #16213e;
  --navy-deep: #0f1830;
  --navy-secondary: #62708f;
  --orange: #f2672b;
  --page-bg: #eef1f7;
  --card-bg: #ffffff;
  --border: #e1e6f0;
  --border-strong: #c9d1e0;
  --win-green: #16a34a;
  --loss-red: #dc2626;
}

* { box-sizing: border-box; }

body {
  font-family: 'Manrope', system-ui, sans-serif;
  background: var(--page-bg);
  color: var(--navy);
  margin: 0;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
a:hover { opacity: 0.75; }

h1, h2, h3 { font-family: 'Oswald', sans-serif; font-weight: 600; margin: 0; }

.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 40px 72px;
}

.subtitle { color: var(--navy-secondary); font-size: 14px; font-weight: 600; margin: 2px 0 0; }

/* Hero band used on the team landing page */
.hero {
  width: 100%;
  background-image: linear-gradient(180deg, var(--navy-deep) 0%, var(--navy) 100%);
  color: #ffffff;
}
.hero-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 40px 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.hero-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}
.hero-identity { display: flex; align-items: center; gap: 16px; }
.crest { width: 60px; height: 60px; border-radius: 50%; display: block; }
.hero-title { font-size: 40px; letter-spacing: 0.01em; color: #ffffff; }
.hero-subtitle { margin-top: 2px; font-size: 14px; font-weight: 600; color: var(--orange); }

.hero-nav { display: flex; gap: 16px; margin-top: 12px; }
.hero-nav a {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.55);
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
}
.hero-nav a:hover { opacity: 1; color: rgba(255, 255, 255, 0.85); }
.hero-nav a.active { color: #ffffff; border-bottom-color: var(--orange); }

.player-photo-wrap { position: relative; width: 72px; height: 72px; flex-shrink: 0; }
.player-photo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.75);
}
.player-photo svg { width: 38px; height: 38px; }
.jersey-badge {
  position: absolute;
  right: -4px;
  bottom: -4px;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--orange);
  color: #ffffff;
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--navy-deep);
}

.filters { display: flex; align-items: center; gap: 12px; }
.filters select {
  font-family: 'Manrope', system-ui, sans-serif;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
}
.stat-card {
  background: var(--card-bg);
  border: 0.5px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}
.hero .stat-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.stat-card .label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--navy-secondary);
  margin: 0 0 10px;
}
.hero .stat-card .label { color: rgba(255, 255, 255, 0.55); }
.stat-card .value {
  font-family: 'Oswald', sans-serif;
  font-size: 32px;
  font-weight: 600;
  margin: 0;
  color: var(--navy);
}
.hero .stat-card .value { color: var(--orange); }

.section { display: flex; flex-direction: column; gap: 28px; margin-top: 28px; }

.card {
  background: var(--card-bg);
  border: 0.5px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.card h2 { font-size: 20px; }
.card h3 { font-size: 17px; margin-bottom: 4px; }

.card-link { font-size: 13px; font-weight: 700; color: var(--orange); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
table th {
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--navy-secondary);
  padding: 0 0 10px;
  border-bottom: 0.5px solid var(--border);
}
table th.num { text-align: right; }
table td { padding: 12px 0; border-top: 0.5px solid var(--border); font-weight: 600; }
table td.num { text-align: right; }
table td.muted { color: var(--navy-secondary); font-weight: 400; }
table td.muted a { color: var(--orange); font-weight: 600; }
.game-sublabel { display: block; margin-top: 2px; font-size: 12px; font-weight: 400; color: var(--navy-secondary); }

.result-win { color: var(--win-green); font-weight: 700; }
.result-loss { color: var(--loss-red); font-weight: 700; }
.result-tie { color: var(--navy-secondary); font-weight: 700; }

.dnp-row { opacity: 0.45; }
.dnp-cell { font-style: italic; font-weight: 400; color: var(--navy-secondary); text-align: left; }

.leaderboard-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.leaderboard-grid table td { font-weight: 600; white-space: nowrap; }
.leaderboard-grid table td.num {
  font-family: 'Oswald', sans-serif;
  font-size: 17px;
  color: var(--orange);
}

.card-header-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 2px; }
.card-count { font-size: 11px; font-weight: 700; color: var(--navy-secondary); }

.scroll-wrap { position: relative; }
.scroll-list { max-height: 160px; overflow-y: auto; }
.scroll-list::-webkit-scrollbar,
.games-scroll-list::-webkit-scrollbar { width: 6px; }
.scroll-list::-webkit-scrollbar-track,
.games-scroll-list::-webkit-scrollbar-track { background: transparent; }
.scroll-list::-webkit-scrollbar-thumb,
.games-scroll-list::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
.scroll-fade {
  position: absolute;
  left: 0;
  right: 6px;
  bottom: 0;
  height: 26px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.95));
  pointer-events: none;
}

.games-scroll-wrap { position: relative; }
.games-scroll-list { max-height: 720px; overflow-y: auto; }

.leaderboard-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 2px;
  border-top: 0.5px solid var(--border);
  font-weight: 600;
}
.leaderboard-row .leaderboard-value {
  font-family: 'Oswald', sans-serif;
  font-size: 17px;
  color: var(--orange);
}

.goalie-heatmap-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }

.table-scroll { overflow-x: auto; }
.table-scroll table { min-width: 480px; }

.game-log { table-layout: fixed; }
.game-log .col-date { width: 150px; }
.game-log .col-type { width: 180px; }
.game-log .col-result { width: 100px; }
.game-log .col-num-sm { width: 56px; }
.game-log .col-num-md { width: 70px; }
.table-scroll table.game-log { min-width: 820px; }
.table-scroll table.game-log.team-games-table { min-width: 700px; }
.table-scroll table.game-log.goalie-log-table { min-width: 860px; }

@media (max-width: 640px) {
  .page { padding: 20px 16px 48px; }
  .hero-inner { padding: 20px 16px 24px; gap: 20px; }
  .hero-header { flex-direction: column; align-items: flex-start; }
  .hero-title { font-size: 30px; }
  .filters { flex-wrap: wrap; width: 100%; }
  .filters > div { flex: 1 1 140px; }
  .filters select { width: 100%; }
  .leaderboard-grid { grid-template-columns: 1fr; }
  .card { padding: 18px; }
}
