:root {
  --surface: #fbf8ef;
  --panel: #fffdf6;
  --sidebar: #eeede2;
  --line: #dedfd4;
  --ink: #252d2b;
  --muted: #626961;
  --accent: #246355;
  --on-accent: #fff;
  --soft: #e5eee6;
  --hover: #f0f2e8;
  --edge: #899286;
  --shadow: 0 3px 16px rgb(48 61 44 / .04);
  --gold: #a86a12;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  color-scheme: light;
}

html[data-theme="dark"] {
  --surface: #20241f;
  --panel: #2a3029;
  --sidebar: #242a22;
  --line: #444d3f;
  --ink: #f0efe5;
  --muted: #c5cabe;
  --accent: #94c9ae;
  --on-accent: #183429;
  --soft: #344d3e;
  --hover: #354030;
  --edge: #7c8972;
  --shadow: none;
  --gold: #e0b046;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 20px;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font: 14px/1.5 var(--font);
}

button,
input,
select {
  font: inherit;
}

button,
a,
input,
select,
summary {
  touch-action: manipulation;
}

button {
  cursor: pointer;
}

button,
a,
input,
select,
summary,
[tabindex]:focus-visible {
  outline-offset: 4px;
}

:focus-visible {
  outline: 3px solid var(--accent);
}

button {
  color: inherit;
}

a {
  color: var(--accent);
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3,
.score-value,
.rank,
.brand-mark {
  font-family: "Space Grotesk", var(--font);
}

h1 {
  font-size: 23px;
  letter-spacing: -1px;
  line-height: 1.2;
}

h2 {
  letter-spacing: -1px;
}

h3 {
  font-size: 16px;
}

button {
  border: 0;
}

.skip-link {
  position: fixed;
  top: -90px;
  left: 12px;
  padding: 12px;
  background: var(--accent);
  color: var(--on-accent);
  z-index: 10;
}

.skip-link:focus {
  top: 12px;
}

.header {
  min-height: 105px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 24px 36px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 15px;
  text-decoration: none;
  color: var(--ink);
  min-width: 0;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: block;
  flex-shrink: 0;
  overflow: visible;
}

.brand-ball,
.brand-ranks {
  fill: var(--accent);
}

.brand-laces {
  fill: none;
  stroke: var(--on-accent);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tagline {
  display: block;
  color: var(--muted);
  margin-top: 5px;
  font-size: 13px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-shrink: 0;
}

.season-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--accent);
  font-weight: 650;
  letter-spacing: .35px;
  white-space: nowrap;
}

.season-label::before {
  content: "";
  width: 16px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}

.theme-button {
  background: transparent;
  border: 1px solid var(--edge);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
}

.layout {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
}

.sidebar {
  background: var(--sidebar);
  padding: 32px 21px;
  min-width: 0;
  border-right: 1px solid var(--line);
}

.sidebar-section {
  margin-bottom: 30px;
}

.eyebrow {
  display: block;
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 1.65px;
  color: var(--muted);
  margin-bottom: 12px;
}

.view-tabs {
  display: grid;
  gap: 5px;
}

.view-tabs button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  background: transparent;
  padding: 12px 13px;
  border-radius: 8px;
  font-weight: 600;
  min-height: 44px;
}

.view-tabs button[aria-selected="true"] {
  background: var(--accent);
  color: var(--on-accent);
}

.view-tabs button:hover:not([aria-selected="true"]) {
  background: var(--soft);
}

.tab-icon {
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  opacity: .8;
}

.sidebar input,
.sidebar select {
  background: var(--surface);
  border: 1px solid var(--edge);
  color: var(--ink);
  width: 100%;
  min-width: 0;
  border-radius: 8px;
  padding: 10px;
  font-size: 12px;
}

.text-button {
  background: none;
  padding: 10px 0 0;
  color: var(--accent);
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sidebar-note {
  border-top: 1px solid var(--line);
  padding-top: 25px;
  color: var(--muted);
  font-size: 12px;
}

.sidebar-note a {
  display: inline-block;
  margin-top: 16px;
  text-underline-offset: 4px;
}

.sidebar-note p {
  line-height: 1.8;
}

main {
  padding: 35px clamp(20px, 3.4vw, 60px) 0;
  min-width: 0;
  max-width: 1580px;
  width: 100%;
  margin: 0 auto;
}

.update {
  display: block;
  font-size: 10px;
  line-height: 1.7;
  color: var(--muted);
  margin-top: 16px;
}

.board {
  padding-top: 0;
}

.board-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 22px;
}

.board-heading .eyebrow {
  margin-bottom: 5px;
}

.board-heading h2 {
  font-size: 25px;
  letter-spacing: -.8px;
  font-weight: 600;
}

.board-heading p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 5px;
}

.count {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 6px 10px;
}

.team-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 9px;
}

.team-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: var(--shadow);
  padding: 16px 19px;
  display: grid;
  grid-template-columns: 30px 50px minmax(135px, 1fr) minmax(260px, 1.2fr) 31px;
  align-items: center;
  gap: 14px;
  transition: border-color .15s, background .15s;
  position: relative;
}

.team-card:hover {
  border-color: var(--edge);
  background: var(--hover);
}

.rank {
  font-size: 19px;
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.rank.top-rank {
  color: var(--accent);
}

.team-logo {
  height: 45px;
  width: 50px;
  object-fit: contain;
}

.team-name {
  font-size: 14px;
  font-weight: 650;
  line-height: 1.25;
}

.team-meta {
  color: var(--muted);
  font-size: 11px;
  margin-top: 5px;
}

.scores {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.score-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}

.score-value {
  font-size: 23px;
  font-weight: 500;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.8px;
}

.score-cell.selected .score-value {
  color: var(--accent);
}

.score-meter {
  height: 3px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}

.score-meter span {
  display: block;
  height: 100%;
  background: var(--edge);
  border-radius: 3px;
}

.score-cell.selected .score-meter span {
  background: var(--accent);
}

.score-cell.missing .score-value {
  font: 10px/1.4 var(--font);
  letter-spacing: 0;
  padding: 4px 0;
}

.details-button {
  border: 1px solid var(--line);
  background: transparent;
  width: 29px;
  height: 29px;
  border-radius: 50%;
  font-size: 16px;
  color: var(--accent);
}

.details-button:hover {
  background: var(--soft);
}

.tier-board {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  background: var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.tier-row {
  display: grid;
  grid-template-columns: 105px minmax(0, 1fr);
  min-height: 101px;
  background: var(--panel);
}

.tier-label {
  font-family: "Space Grotesk", var(--font);
  display: grid;
  place-items: center;
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  padding: 12px;
  background: var(--tier-color);
  color: #253329;
}

.tier-teams {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  min-width: 0;
}

.tier-team {
  width: 64px;
  min-height: 73px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent;
  border-radius: 8px;
  padding: 3px;
  color: var(--muted);
  font-size: 9px;
  gap: 3px;
}

.tier-team:hover {
  background: var(--soft);
}

.tier-team img {
  width: 52px;
  height: 48px;
  object-fit: contain;
}

.tier-empty {
  font-size: 11px;
  color: var(--muted);
  padding: 8px;
}

.empty,
.loading {
  text-align: center;
  color: var(--muted);
  padding: 55px 20px;
  border: 1px dashed var(--line);
  border-radius: 12px;
}

.empty h3 {
  color: var(--ink);
  margin-bottom: 8px;
}

.method {
  margin-top: 42px;
  border-top: 1px solid var(--line);
  padding: 31px 0 20px;
  font-size: 12px;
  color: var(--muted);
}

.method-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
}

.method h2 {
  font-size: 24px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -.8px;
}

.method .eyebrow {
  margin-bottom: 5px;
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 25px;
  margin: 24px 0;
}

.method h3 {
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 7px;
}

.method p {
  line-height: 1.7;
}

.method details {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}

.method summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 600;
}

.method details p {
  margin-top: 12px;
  max-width: 900px;
}

.sources {
  margin-top: 22px;
}

.sources ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 7px 16px;
  font-size: 11px;
}

.sources a {
  overflow-wrap: anywhere;
}

.fine-print {
  font-size: 10px;
  margin-top: 16px;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding: 20px 0;
  color: var(--muted);
  font-size: 10px;
}

footer span:first-child {
  font-weight: 700;
}

dialog {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 16px;
  width: min(650px, calc(100% - 24px));
  max-height: 85dvh;
  padding: 24px;
  box-shadow: 0 20px 80px rgb(0 0 0 / .2);
}

dialog::backdrop {
  background: rgb(16 27 21 / .55);
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.dialog-head .eyebrow {
  margin: 0;
}

.close-button {
  border: 1px solid var(--line);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: transparent;
  font-size: 22px;
}

.detail-identity {
  display: flex;
  align-items: center;
  gap: 17px;
  margin-bottom: 20px;
}

.detail-identity img {
  width: 74px;
  height: 74px;
  object-fit: contain;
}

.detail-identity h2 {
  font-size: 26px;
  line-height: 1.1;
}

.detail-identity p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.detail-scores {
  background: var(--soft);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 22px;
}

.detail-scores .scores {
  gap: 24px;
}

.detail-label {
  font-size: 15px;
  font-weight: 600;
  margin: 22px 0 10px;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 25px;
  margin: 0;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}

.stat-item dt {
  color: var(--muted);
}

.stat-item dd {
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.detail-note {
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
  margin-top: 15px;
}

.team-dialog-trigger {
  font: inherit;
  color: inherit;
  background: transparent;
  padding: 0;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
}

.team-dialog-trigger:hover {
  text-decoration-color: var(--accent);
}

@media (min-width: 1350px) {
  .team-card {
    grid-template-columns: 34px 58px minmax(170px, 1fr) minmax(320px, 1.2fr) 31px;
  }

  .team-logo {
    width: 58px;
    height: 49px;
  }

  .team-name {
    font-size: 15px;
  }

  .scores {
    gap: 28px;
  }
}

@media (max-width: 1050px) {
  .layout {
    grid-template-columns: 195px minmax(0, 1fr);
  }

  .sidebar {
    padding: 28px 15px;
  }

  .header {
    padding: 22px;
  }

  .team-card {
    grid-template-columns: 24px 39px minmax(110px, 1fr) 31px;
    gap: 11px;
    padding: 14px;
  }

  .team-logo {
    width: 39px;
    height: 39px;
  }

  .team-card > .scores {
    grid-column: 3/5;
    grid-row: 2;
  }

  .team-card > .details-button {
    grid-column: 4;
    grid-row: 1;
  }

  .scores {
    gap: 20px;
  }

  .score-value {
    font-size: 21px;
  }

  .method-grid {
    gap: 17px;
  }
}

@media (max-width: 720px) {
  .header {
    padding: 18px 16px;
    gap: 15px;
    align-items: flex-start;
  }

  .brand {
    gap: 10px;
  }

  .brand-mark {
    width: 36px;
    height: 42px;
  }

  h1 {
    font-size: 21px;
  }

  .tagline {
    font-size: 10px;
    max-width: 210px;
  }

  .header-actions {
    flex-direction: column-reverse;
    gap: 9px;
    align-items: flex-end;
  }

  .theme-button {
    font-size: 10px;
    padding: 5px 8px;
  }

  .season-label {
    font-size: 10px;
    gap: 5px;
  }

  .season-label::before {
    width: 10px;
  }

  .layout {
    display: block;
  }

  .sidebar {
    padding: 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    display: grid;
    grid-template-columns: 1fr 110px;
    gap: 14px;
  }

  .sidebar-section {
    margin: 0;
    min-width: 0;
  }

  .sidebar-section:first-child {
    grid-column: 1/-1;
  }

  .sidebar-section:first-child > .eyebrow {
    display: none;
  }

  .view-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
  }

  .view-tabs button {
    flex: 0 0 calc((100% - 12px)/4);
    min-width: 0;
    padding: 10px 0;
    justify-content: center;
    font-size: 11px;
    min-height: 40px;
    white-space: nowrap;
  }

  .tab-icon {
    display: none;
  }

  .sidebar .eyebrow {
    margin-bottom: 7px;
    font-size: 9px;
  }

  .sidebar-note {
    display: none;
  }

  .sidebar input,
  .sidebar select {
    font-size: 12px;
    padding: 9px;
  }

  .sidebar .text-button {
    font-size: 10px;
  }

  .sidebar-section:nth-child(2) {
    padding-bottom: 0;
  }

  main {
    padding: 24px 16px 0;
  }

  .update {
    font-size: 9px;
    margin-top: 12px;
  }

  .board {
    padding-top: 25px;
  }

  .board-heading {
    gap: 10px;
  }

  .board-heading h2 {
    font-size: 23px;
  }

  .board-heading p {
    font-size: 11px;
  }

  .board-heading .eyebrow {
    font-size: 9px;
  }

  .count {
    padding: 5px 7px;
    font-size: 10px;
  }

  .team-card {
    grid-template-columns: 22px 39px minmax(0, 1fr) 29px;
    gap: 9px 11px;
    padding: 13px;
  }

  .team-name {
    font-size: 13px;
  }

  .team-meta {
    font-size: 10px;
  }

  .team-card > .scores {
    grid-column: 2/5;
  }

  .team-card > .rank {
    font-size: 18px;
  }

  .score-label {
    font-size: 8px;
  }

  .score-value {
    font-size: 22px;
  }

  .score-meter {
    margin-top: 2px;
  }

  .tier-row {
    grid-template-columns: 75px minmax(0, 1fr);
    min-height: 88px;
  }

  .tier-label {
    font-size: 14px;
    padding: 10px 7px;
  }

  .tier-teams {
    gap: 5px;
    padding: 8px;
  }

  .tier-team {
    width: 53px;
    min-height: 65px;
  }

  .tier-team img {
    width: 44px;
    height: 42px;
  }

  .method {
    margin-top: 30px;
    padding-top: 25px;
  }

  .method-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .method h2 {
    font-size: 21px;
  }

  .method-heading {
    gap: 8px;
  }

  .stat-grid {
    gap: 0 16px;
  }

  .stat-item {
    font-size: 10px;
  }

  .detail-identity h2 {
    font-size: 23px;
  }

  dialog {
    padding: 18px;
  }
}

@media (max-width: 380px) {
  .header {
    gap: 8px;
  }

  .brand {
    gap: 8px;
  }

  .tagline {
    max-width: 145px;
  }

  .view-tabs button {
    font-size: 10px;
  }

  .scores {
    gap: 12px;
  }

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }
}

.snapshot-metadata {
  padding: 0 0 20px;
  overflow-wrap: anywhere;
}

.snapshot-metadata:has(.update:not([hidden])) {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.snapshot-metadata .update {
  margin: 0;
  font-size: 10px;
}

.snapshot-metadata .update + .update {
  margin-top: 4px;
}

.board-heading {
  align-items: flex-start;
}

.board {
  padding-top: 0;
}

.team-card-compact {
  grid-template-columns: 26px 36px minmax(0, 1fr) auto 29px;
  gap: 12px;
  padding: 10px 16px;
}

.team-card-compact > .team-logo {
  width: 36px;
  height: 36px;
}

.team-card-compact > .team-identity {
  min-width: 0;
}

.team-card-compact .team-name {
  overflow-wrap: anywhere;
}

.team-card-compact .team-meta {
  margin-top: 3px;
}

.team-card-compact > .compact-score {
  font-family: "Space Grotesk", var(--font);
  font-size: 25px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -.8px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
  color: var(--accent);
}

.team-card-compact > .details-button {
  grid-column: 5;
  grid-row: 1;
}

@media (max-width: 720px) {
  .team-card-compact {
    grid-template-columns: 20px 30px minmax(0, 1fr) auto 26px;
    gap: 7px;
    padding: 8px 10px;
  }

  .team-card-compact > .team-logo {
    width: 30px;
    height: 30px;
  }

  .team-card-compact .team-name {
    font-size: 12px;
  }

  .team-card-compact .team-meta {
    font-size: 9px;
  }

  .team-card-compact > .compact-score {
    font-size: 22px;
  }

  .team-card-compact > .details-button {
    width: 26px;
    height: 26px;
  }
}

.team-card-overall {
  cursor: pointer;
}

.team-card-overall .team-dialog-trigger::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 11px;
}

.team-card-overall:focus-within {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.team-card-overall .team-dialog-trigger:focus-visible {
  outline: none;
}

.team-card-overall > .details-button {
  display: grid;
  place-items: center;
}
