:root {
  --ink: #0a1a3f;
  --blue: #1f5bff;
  --muted: #637090;
  --bg: #f4f7fb;
  --line: #e6ecf4;
  font-family: Onest, sans-serif;
  background: var(--bg);
  color: var(--ink);
}
body {
  font-family: Onest, sans-serif;
}
h1,
h2,
h3,
.score,
.countdown,
.brand {
  font-family: "Fira Sans Extra Condensed", sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.015em;
}
.brand {
  font-size: 23px;
}
.brand small {
  font-family: Onest, sans-serif;
  font-size: 9px;
}
.site-header nav a {
  border-radius: 12px;
  font-size: 14px;
}
a {
  color: #1f5bff;
}
.card,
.player,
.match-row {
  border-radius: 22px;
  border-color: #e6ecf4;
  box-shadow: none;
}
.primary,
.social-button {
  border-radius: 16px;
  background: #1f5bff;
}
.next-game {
  border-radius: 28px;
  background:
    radial-gradient(ellipse at 100% 0, #28569770, transparent 70%), #0a1a3f;
  color: white;
  border: 0;
}
.next-game h1,
.next-game h2,
.next-game .when strong,
.next-game .countdown {
  color: white;
}
.next-game .eyebrow,
.next-game .muted,
.next-game .announcement,
.next-game small,
.next-game .pill {
  color: #b9c7e4;
}
.next-game .pill {
  border-color: #ffffff40;
  background: #ffffff08;
}
.next-game .vs {
  color: #7cc6ff;
}
.next-game .team-logo {
  background: #ffffff0c;
  color: white;
  border-color: #ffffff30;
}
.next-game .when {
  border-color: #ffffff25;
}
.next-game .match-bottom {
  border-color: #ffffff25;
}
.next-game .broadcast-note {
  background: #ffffff08;
  border-color: #ffffff20;
}
.next-game .broadcast-note strong,
.next-game .broadcast-note p {
  color: #dce6fa;
}
.next-game .team-emblem {
  background: white;
}
.site-footer {
  border-radius: 24px 24px 0 0;
  background: white;
}
.metrics strong {
  font-family: "Fira Sans Extra Condensed", sans-serif;
}
.filters {
  gap: 10px;
}
.page-title h1 {
  font-size: 46px;
}
.site-header .login {
  background: #e9f0ff;
  border: 0;
  color: #1f5bff;
}
@media (max-width: 600px) {
  .next-game h1 {
    font-size: 40px;
  }
  .next-game {
    padding: 24px 20px;
  }
  .site-header {
    gap: 18px;
  }
  .brand {
    font-size: 21px;
  }
  .site-header nav {
    gap: 3px;
  }
  .site-header nav a {
    font-size: 12px;
    padding: 10px 8px;
  }
  .next-game .announcement {
    font-size: 14px;
    line-height: 1.6;
  }
  .page-title h1 {
    font-size: 40px;
  }
  .next-game .teams h2 {
    font-size: 26px;
  }
  .next-game .countdown {
    font-size: 32px;
  }
}

.countdown-part { display: inline-flex; align-items: baseline; gap: .04em; white-space: nowrap; }
.countdown .countdown-unit { font-size: .45em; font-weight: 600; text-transform: none; opacity: .8; }

/* A shared desktop rhythm keeps content aligned from navigation to footer. */
.site-header, #site, .site-footer { max-width: 1480px; }
.site-header nav { gap: 8px; }
.site-header nav a { padding: 12px 16px; min-height: 44px; }
.site-header nav a[aria-current="page"] { background: #e9f0ff; color: #1749cb; }
.site-header nav a:hover { background: #e9f0ff; }
#site > *, .home-overview > *, .dashboard > * { min-width: 0; }
#site :focus-visible { outline: 3px solid #1f5bff; outline-offset: 5px; }
#site h1[tabindex="-1"]:focus { outline: 0; }
.site-status {
  max-width: 1384px; margin: 0 auto 16px; padding: 12px 20px;
  border: 1px solid #cad9ff; border-radius: 12px;
  color: #1749cb; background: #edf3ff; font-size: 14px;
}
.site-status[hidden], #photo-status[hidden], #light-image[hidden] { display: none; }
.page-loading, .page-error {
  min-height: 420px; display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 16px; padding: 48px 24px; text-align: center;
  background: white; border: 1px solid var(--line); border-radius: 28px;
}
.page-loading h1, .page-error h1 { margin: 0; font-size: 36px; }
.page-loading p, .page-error p { margin: 0; max-width: 500px; line-height: 1.7; color: var(--muted); }
.loading-mark { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; background: #e9f0ff; color: var(--blue); font-size: 42px; }
.loading-placeholder { width: min(360px, 80%); height: 12px; border-radius: 6px; background: #edf1f8; }
.loading-placeholder.short { width: min(240px, 60%); }
.page-error .primary { color: white; }
.page-error > a { padding: 12px; }
#photo-status { max-width: 420px; text-align: center; line-height: 1.6; }
.match-detail { max-width: none; }
.match-detail > .card + .card { margin-top: 24px; }
#site[data-section="player"] > .card + .card { margin-top: 24px; }
#site[data-section="player"] details { padding: 18px 0; border-bottom: 1px solid var(--line); }
#site[data-section="player"] summary { cursor: pointer; line-height: 1.6; }
#site[data-section="player"] summary:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
@media (min-width: 1100px) {
  .site-header { padding-top: 24px; padding-bottom: 28px; }
  .home-overview { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(300px, 1fr); gap: 24px; align-items: stretch; }
  .home-overview .next-game { padding: 32px; }
  .home-overview .dashboard { grid-template-columns: minmax(0, 1fr); align-content: start; margin: 0; gap: 24px; }
  .home-overview .dashboard .card { padding: 28px; }
  .home-overview .match-bottom { flex-wrap: wrap; gap: 24px; }
  .home-overview .match-bottom .when { width: 100%; justify-content: space-between; }
  .home-overview .match-bottom > .primary { margin-left: auto; }
  .home-overview .teams { margin: 24px 0; }
  .home-overview .hero-head h1 { font-size: 40px; }
  .home-overview .hero-head .pill { flex-shrink: 0; }
  .home-overview .metrics { gap: 24px; justify-content: space-between; }
  .home-overview + .card { margin-top: 24px; }
  .page-title { padding-top: 20px; padding-bottom: 32px; }
  .filters { padding: 20px; background: white; border: 1px solid var(--line); border-radius: 20px; }
  .filters > .custom-field { flex: 1; }
  .match-row { grid-template-columns: 140px minmax(0, 1fr) 100px; padding: 26px 32px; }
  .match-row:hover, .player:hover { border-color: #aac2ff; background: #fbfcff; }
  .match-row h2 { font-size: 24px; }
  .match-row .score { text-align: right; }
  .roster { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
  .photos { columns: 4; column-gap: 16px; }
  #site[data-section="player"] { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 24px; align-items: start; }
  #site[data-section="player"] > .page-title, #site[data-section="player"] > a,
  #site[data-section="player"] > .page-loading, #site[data-section="player"] > .page-error { grid-column: 1 / -1; }
  #site[data-section="player"] > .card + .card { margin: 0; }
  #site[data-section="player"] .profile-head { flex-wrap: wrap; }
}
@media (max-width: 1099px) {
  .site-status { margin: 0 24px 16px; }
}
@media (max-width: 650px) {
  .site-header nav { gap: 2px; flex-wrap: nowrap; }
  .site-header nav a { padding: 12px 8px; font-size: 12px; }
  .site-status { margin: 0 16px 12px; font-size: 13px; }
  .page-loading, .page-error { min-height: 350px; padding: 32px 20px; }
  .page-loading h1, .page-error h1 { font-size: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  .photo img, .player { transition: none; }
  .photo:hover img, .player:hover { transform: none; }
}

.next-game .empty { background: #ffffff08; border-color: #ffffff25; color: #c4d2ec; }
.next-game .empty p { max-width: 520px; margin: 16px auto 24px; line-height: 1.7; }
#site[data-section="player"] .metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 20px; }
#site[data-section="player"] .metrics > div { min-width: 0; padding: 12px; border-radius: 12px; background: #f4f7fb; }
#site[data-section="player"] .metrics small { line-height: 1.5; display: block; overflow-wrap: anywhere; }
.site-footer { margin-inline: auto; padding-inline: 48px; }
@media (max-width: 1000px) { .site-footer { padding-inline: 24px; } }
@media (max-width: 480px) { .site-footer { padding-inline: 20px; } }


/* Give match trends and player trends the full desktop content width. */
#site .public-chart-section { padding: clamp(16px, 3vw, 28px); }
@media (min-width: 768px) {
  #site[data-section="player"] > .public-chart-section { grid-column: 1 / -1; order: 1; }
  #site .public-chart-section .ms-chart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
  #site .public-chart-section .ms-chart-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.league-table-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.league-table-heading a { font-size: 14px; font-weight: 600; }
.league-table-scroll {
  overflow-x: auto;
  border: 1px solid #d7e4f3;
  border-radius: 16px;
  overscroll-behavior-x: contain;
}
.league-table {
  width: 100%;
  min-width: 580px;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
}
.league-table :is(th, td) { padding: 12px 14px; text-align: center; }
.league-table thead { color: #315778; background: #e8f1fb; }
.league-table tbody tr + tr { border-top: 1px solid #e1e9f5; }
.league-table tbody th, .league-table thead th:nth-child(2) { text-align: left; }
.league-table tbody th { font-weight: 600; }
.league-table tbody a { color: inherit; }
.league-rank {
  display: inline-grid;
  min-width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  background: #eaf1f9;
  color: #315778;
  font-weight: 700;
}
.league-table .league-own-team { background: #dcecff; color: #123d75; }
.league-own-team th { box-shadow: inset 3px 0 #245caa; }
.league-own-team .league-rank { background: #245caa; color: #fff; }
.league-table-updated { margin: 12px 0 0; font-size: 13px; color: var(--muted); }

/* Keep the public navigation on one glass surface, with a single selected tab. */
body .site-header nav a:not([aria-current="page"]):not(:hover) {
  background: transparent;
  box-shadow: none;
  color: #344f70;
}
body .site-header nav a[aria-current="page"] {
  background: #f9fcff;
  color: #174a96;
  box-shadow: inset 0 1px 0 #fff, 0 2px 5px #22365118;
}
@media (max-width: 650px) {
  body .site-header, .site-footer { padding-inline: 16px; }
  body .site-header nav { gap: 0; padding-inline: 3px; }
  body .site-header nav a { padding-inline: clamp(3px, calc(7vw - 19px), 9px); }
  #site[data-section] .page-title { padding-block: 12px 16px; }
  #site[data-section] .page-title h1 { margin: 4px 0 0; letter-spacing: -.025em; }
  #site[data-section="matches"] > .page-title + .league-note { margin: 0 0 16px; }
  #site .match-row { grid-template-columns: 56px minmax(0, 1fr) auto; padding: 16px; }
  #site .match-row h2 { color: #18395c; font-size: 18px; line-height: 1.15; }
  #site .match-row .score { justify-self: end; font-variant-numeric: tabular-nums; }
  #site[data-section="player"] .metrics { gap: 12px; }
}
