:root {
  color-scheme: light;
  --paper: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f3f6f8;
  --ink: #111d28;
  --muted: #657581;
  --line: #c9d5df;
  --line-strong: #aebfcd;
  --navy: #112e4a;
  --blue: #07508f;
  --orange: #e25b26;
  --gold: #e6aa30;
  --header: #dce7f1;
  --focus: #0074c8;
  --radius: 6px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
}

body {
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(172, 187, 199, 0.13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(172, 187, 199, 0.13) 1px, transparent 1px);
  background-size: 52px 52px;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  margin: 0;
  min-height: 100vh;
}

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

a {
  color: inherit;
}

button,
summary,
select {
  cursor: pointer;
}

.sr-only {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.rankings-header {
  background: rgba(248, 250, 252, 0.96);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  align-items: start;
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  margin: 0 auto;
  max-width: 1820px;
  padding: 28px 24px 24px;
}

.title-block h1,
.title-block p {
  margin: 0;
}

.title-block h1 {
  font-size: 3rem;
  font-weight: 900;
  line-height: 1;
}

.title-block p {
  color: var(--muted);
  font-size: 1.02rem;
  font-weight: 600;
  margin-top: 8px;
}

.brand-link {
  align-items: center;
  color: var(--blue);
  display: inline-flex;
  font-size: 1.28rem;
  font-weight: 800;
  gap: 7px;
  margin-top: 6px;
  min-height: 40px;
  text-decoration: none;
}

.brand-link svg {
  fill: none;
  height: 18px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 18px;
}

.brand-link:hover span,
.brand-link:focus-visible span {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.page-nav {
  align-items: center;
  display: flex;
  gap: 18px;
}

.page-nav > a:first-child {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.page-nav > a:first-child:hover,
.page-nav > a:first-child:focus-visible {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.draft-label {
  align-items: center;
  background: var(--navy);
  border-radius: 999px;
  color: #ffffff;
  display: inline-flex;
  font-size: 0.9rem;
  font-weight: 800;
  height: 42px;
  justify-content: center;
  margin-top: 2px;
  min-width: 180px;
  padding: 0 22px;
}

main {
  margin: 0 auto;
  max-width: 1820px;
  padding: 14px 24px 34px;
}

.utility-bar {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-height: 56px;
  padding: 7px 0;
}

.search-control {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  display: flex;
  height: 40px;
  max-width: 330px;
  width: 100%;
}

.search-control svg {
  fill: none;
  flex: 0 0 18px;
  height: 18px;
  margin-left: 11px;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 18px;
}

.search-control input {
  background: transparent;
  border: 0;
  color: var(--ink);
  height: 100%;
  min-width: 0;
  outline: 0;
  padding: 0 11px 0 9px;
  width: 100%;
}

.search-control:focus-within {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(0, 116, 200, 0.14);
}

.mobile-sort-controls {
  display: none;
}

.result-count {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  margin-left: auto;
  white-space: nowrap;
}

.table-shell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  isolation: isolate;
  overflow-x: auto;
  position: relative;
}

.table-watermark {
  color: rgba(76, 87, 96, 0.18);
  font-size: 11rem;
  font-weight: 900;
  left: 50%;
  line-height: 1;
  pointer-events: none;
  position: absolute;
  top: 48%;
  transform: translate(-50%, -50%) rotate(-15deg);
  white-space: nowrap;
  z-index: 2;
}

table {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1180px;
  table-layout: fixed;
  width: 100%;
}

.col-rank {
  width: 4%;
}

.col-team {
  width: 16%;
}

.col-score {
  width: 6%;
}

.col-metric,
.col-value {
  width: 7%;
}

.col-count {
  width: 6%;
}

.col-detail {
  width: 34%;
}

thead th {
  background: var(--header);
  border-bottom: 1px solid var(--line-strong);
  border-right: 1px solid var(--line);
  height: 52px;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 5;
}

thead th:last-child,
tbody td:last-child {
  border-right: 0;
}

.sort-button {
  align-items: center;
  background: transparent;
  border: 0;
  color: #344654;
  display: flex;
  font-size: 0.79rem;
  font-weight: 800;
  gap: 7px;
  height: 100%;
  justify-content: center;
  padding: 0 7px;
  position: relative;
  width: 100%;
  z-index: 3;
}

.sort-button:hover {
  background: rgba(7, 80, 143, 0.07);
  color: var(--blue);
}

.sort-button:focus-visible,
.icon-button:focus-visible,
.select-control select:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(0, 116, 200, 0.35);
  outline-offset: -3px;
}

.sort-indicator {
  height: 13px;
  position: relative;
  width: 8px;
}

.sort-indicator::before,
.sort-indicator::after {
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  content: "";
  left: 0;
  opacity: 0.28;
  position: absolute;
}

.sort-indicator::before {
  border-bottom: 5px solid currentColor;
  top: 0;
}

.sort-indicator::after {
  border-top: 5px solid currentColor;
  bottom: 0;
}

.sort-button[data-active="true"][data-direction="asc"] .sort-indicator::before,
.sort-button[data-active="true"][data-direction="desc"] .sort-indicator::after {
  opacity: 1;
}

tbody tr {
  transition: background-color 150ms ease;
}

tbody tr:nth-child(odd) td:not(.metric-cell) {
  background: rgba(255, 255, 255, 0.94);
}

tbody tr:nth-child(even) td:not(.metric-cell) {
  background: rgba(243, 246, 248, 0.94);
}

tbody tr:hover td:not(.metric-cell) {
  background: rgba(231, 239, 246, 0.97);
}

tbody td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  height: 58px;
  padding: 0;
  position: relative;
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.cell-layer {
  position: relative;
  z-index: 3;
}

.rank-cell,
.metric-cell {
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  text-align: center;
}

.team-cell .cell-layer,
.detail-cell .cell-layer {
  padding: 6px 10px;
}

.team-cell strong,
.team-cell span,
.detail-cell strong,
.detail-cell span {
  display: block;
}

.team-cell strong {
  font-size: 0.93rem;
  line-height: 1.08;
}

.team-cell span,
.detail-cell span {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.18;
  margin-top: 4px;
}

.detail-cell strong {
  font-size: 0.75rem;
  line-height: 1.18;
}

.empty-row td {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  height: 110px;
  text-align: center;
}

.mobile-rankings {
  display: none;
}

.definitions {
  border-bottom: 1px solid var(--line);
  margin-top: 14px;
}

.definitions summary {
  color: var(--navy);
  font-size: 0.88rem;
  font-weight: 800;
  padding: 11px 2px;
  width: max-content;
}

.definitions dl {
  display: grid;
  gap: 0 28px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding: 0 0 16px;
}

.definitions dl div {
  border-top: 1px solid rgba(174, 191, 205, 0.62);
  display: grid;
  gap: 12px;
  grid-template-columns: 90px 1fr;
  padding: 9px 0;
}

.definitions dt,
.definitions dd {
  font-size: 0.78rem;
  line-height: 1.35;
  margin: 0;
}

.definitions dt {
  font-weight: 800;
}

.definitions dd {
  color: var(--muted);
}

.source-footer {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.75rem;
  gap: 8px 22px;
  justify-content: space-between;
  padding: 15px 2px 0;
}

.source-footer a {
  color: var(--blue);
  font-weight: 700;
  text-underline-offset: 3px;
}

noscript {
  background: #ffffff;
  border: 1px solid var(--line);
  display: block;
  margin: 16px;
  padding: 16px;
}

@media (max-width: 959px) {
  .header-inner {
    align-items: center;
    gap: 12px 18px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 20px 16px 18px;
  }

  .title-block {
    grid-column: 1 / -1;
  }

  .title-block h1 {
    font-size: 2.2rem;
  }

  .title-block p {
    font-size: 0.86rem;
    line-height: 1.35;
  }

  .brand-link {
    font-size: 1rem;
    margin: 0;
  }

  .page-nav {
    gap: 12px;
  }

  .draft-label {
    font-size: 0.72rem;
    height: 36px;
    min-width: 122px;
    padding: 0 14px;
  }

  main {
    padding: 10px 12px 28px;
  }

  .utility-bar {
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .search-control {
    grid-column: 1 / -1;
    max-width: none;
  }

  .mobile-sort-controls {
    display: flex;
    gap: 7px;
  }

  .select-control select {
    appearance: none;
    background: #ffffff;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    color: var(--ink);
    font-size: 0.82rem;
    font-weight: 800;
    height: 40px;
    min-width: 150px;
    padding: 0 34px 0 11px;
  }

  .select-control {
    position: relative;
  }

  .select-control::after {
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--muted);
    content: "";
    pointer-events: none;
    position: absolute;
    right: 12px;
    top: 17px;
  }

  .icon-button {
    align-items: center;
    background: var(--navy);
    border: 0;
    border-radius: var(--radius);
    color: #ffffff;
    display: inline-flex;
    height: 40px;
    justify-content: center;
    padding: 0;
    width: 40px;
  }

  .icon-button svg {
    fill: none;
    height: 19px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    transition: transform 160ms ease;
    width: 19px;
  }

  .icon-button[data-direction="desc"] svg {
    transform: rotate(180deg);
  }

  .table-shell {
    display: none;
  }

  .mobile-rankings {
    display: grid;
    gap: 8px;
    position: relative;
  }

  .team-card {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
  }

  .team-card::after {
    color: rgba(73, 85, 95, 0.08);
    content: "HeHate_me";
    font-size: 3.4rem;
    font-weight: 900;
    left: 50%;
    pointer-events: none;
    position: absolute;
    top: 52%;
    transform: translate(-50%, -50%) rotate(-13deg);
    white-space: nowrap;
  }

  .card-top,
  .metric-grid,
  .card-detail {
    position: relative;
    z-index: 1;
  }

  .card-top {
    align-items: stretch;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 66px;
    min-height: 66px;
  }

  .card-rank,
  .card-score {
    align-items: center;
    display: flex;
    flex-direction: column;
    font-variant-numeric: tabular-nums;
    font-weight: 900;
    justify-content: center;
  }

  .card-rank {
    background: var(--navy);
    color: #ffffff;
    font-size: 1rem;
  }

  .card-rank small,
  .card-score small {
    font-size: 0.58rem;
    font-weight: 700;
    margin-top: 2px;
    text-transform: uppercase;
  }

  .card-team {
    min-width: 0;
    padding: 11px 10px;
  }

  .card-team strong,
  .card-team span {
    display: block;
  }

  .card-team strong {
    font-size: 1rem;
    line-height: 1.12;
  }

  .card-team span {
    color: var(--muted);
    font-size: 0.7rem;
    margin-top: 5px;
  }

  .card-score {
    color: var(--ink);
    font-size: 1.12rem;
  }

  .metric-grid {
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .metric-grid div {
    border-bottom: 1px solid var(--line);
    border-right: 1px solid var(--line);
    min-width: 0;
    padding: 8px 9px;
  }

  .metric-grid div:nth-child(3n) {
    border-right: 0;
  }

  .metric-grid div:nth-last-child(-n + 3) {
    border-bottom: 0;
  }

  .metric-grid dt,
  .metric-grid dd {
    margin: 0;
  }

  .metric-grid dt {
    color: var(--muted);
    font-size: 0.61rem;
    font-weight: 800;
    text-transform: uppercase;
  }

  .metric-grid dd {
    font-size: 0.95rem;
    font-variant-numeric: tabular-nums;
    font-weight: 900;
    margin-top: 3px;
  }

  .card-detail {
    border-top: 1px solid var(--line);
    padding: 9px 10px 10px;
  }

  .card-detail strong,
  .card-detail span {
    display: block;
  }

  .card-detail strong {
    font-size: 0.77rem;
    line-height: 1.25;
  }

  .card-detail span {
    color: var(--muted);
    font-size: 0.67rem;
    line-height: 1.28;
    margin-top: 4px;
  }

  .mobile-empty {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 700;
    padding: 34px 18px;
    text-align: center;
  }

  .definitions dl {
    grid-template-columns: 1fr;
  }

  .source-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 420px) {
  .title-block h1 {
    font-size: 1.95rem;
  }

  .brand-link span {
    font-size: 0.88rem;
  }

  .brand-link svg {
    display: none;
  }

  .page-nav {
    gap: 6px;
  }

  .page-nav > a:first-child {
    font-size: 0.68rem;
  }

  .draft-label {
    min-width: 108px;
  }

  .select-control select {
    min-width: 138px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
