:root {
  color-scheme: light;
  --ink: #17211b;
  --ink-soft: #445149;
  --muted: #6d776f;
  --canvas: #f4f6f0;
  --surface: #ffffff;
  --surface-soft: #f8faf6;
  --line: #dfe5dc;
  --line-strong: #cbd4c8;
  --accent: #315c3c;
  --accent-deep: #24472e;
  --lime: #d9f24f;
  --lime-soft: #eff8bd;
  --win: #3f8751;
  --loss: #d55f52;
  --retired: #d99731;
  --other: #8a918b;
  --focus: #2864dc;
  --shadow-sm: 0 1px 2px rgb(19 31 23 / 5%);
  --shadow-md: 0 14px 36px rgb(28 48 34 / 8%);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --page-width: 1480px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 92% 4%, rgb(217 242 79 / 13%), transparent 20rem),
    var(--canvas);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgb(40 100 220 / 34%);
  outline-offset: 2px;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  transform: translateY(-150%);
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: white;
}

.skip-link:focus {
  transform: translateY(0);
}

.page-shell {
  width: min(calc(100% - 40px), var(--page-width));
  margin-inline: auto;
}

.site-header {
  border-bottom: 1px solid rgb(203 212 200 / 75%);
  background: rgb(244 246 240 / 88%);
  backdrop-filter: blur(16px);
}

.header-inner {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 760;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
}

.brand-mark svg {
  width: 28px;
  fill: var(--lime);
}

.brand-mark circle {
  stroke: var(--lime);
  stroke-width: 1.4;
}

.brand-mark path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.4;
}

.hero {
  min-height: 290px;
  padding-block: 56px 48px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(40px, 5.2vw, 72px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.hero-copy {
  max-width: 650px;
  margin: 22px 0 0;
  color: var(--ink-soft);
  font-size: clamp(16px, 1.5vw, 19px);
}

.toolbar {
  display: grid;
  grid-template-columns: 130px 190px minmax(220px, 1fr) 190px 170px auto;
  align-items: end;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgb(255 255 255 / 90%);
  box-shadow: var(--shadow-md);
}

.field label {
  display: block;
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.select-wrap,
.search-wrap {
  position: relative;
}

.select-wrap::after {
  position: absolute;
  top: 50%;
  right: 14px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--ink-soft);
  border-bottom: 1.5px solid var(--ink-soft);
  content: "";
  pointer-events: none;
  transform: translateY(-70%) rotate(45deg);
}

select,
input[type="search"],
input[type="number"] {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

select {
  padding: 0 38px 0 13px;
  appearance: none;
}

input[type="search"] {
  padding: 0 14px 0 42px;
}

input[type="number"] {
  padding: 0 92px 0 13px;
  appearance: textfield;
  font-variant-numeric: tabular-nums;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

input[type="search"]::placeholder {
  color: #969e98;
}

select:hover,
input[type="search"]:hover,
input[type="number"]:hover {
  border-color: #aebaaa;
}

.search-wrap svg {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 18px;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-width: 1.6;
  transform: translateY(-50%);
}

.number-wrap {
  position: relative;
}

.number-wrap select {
  position: absolute;
  top: 50%;
  right: 5px;
  width: 84px;
  height: 34px;
  padding: 0 22px 0 8px;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0 7px 7px 0;
  background-color: var(--surface);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  transform: translateY(-50%);
}

.number-wrap::after {
  position: absolute;
  z-index: 1;
  top: 50%;
  right: 13px;
  width: 5px;
  height: 5px;
  border-right: 1px solid var(--muted);
  border-bottom: 1px solid var(--muted);
  content: "";
  pointer-events: none;
  transform: translateY(-70%) rotate(45deg);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.button {
  min-height: 46px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 730;
  white-space: nowrap;
}

.button-secondary {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.button-secondary:hover {
  background: var(--accent-deep);
}

.results-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 30px 2px 18px;
}

.result-count {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
}

.result-count strong {
  font-weight: 600;
}

.timezone-summary {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.form-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.form-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-title {
  color: var(--ink);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.view-state {
  display: none;
  min-height: 230px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 13px;
  padding: 40px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: rgb(255 255 255 / 50%);
  text-align: center;
}

.view-state.is-visible {
  display: flex;
}

.view-state h2,
.view-state p {
  margin: 0;
}

.view-state h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  font-weight: 500;
}

.view-state p {
  max-width: 480px;
  color: var(--muted);
}

.loader {
  width: 28px;
  height: 28px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.match-groups {
  display: grid;
  gap: 14px;
  padding-bottom: 44px;
}

.competition {
  overflow: clip;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.competition-header {
  display: grid;
  width: 100%;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 19px 21px;
  border: 0;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}

.competition-header:hover {
  background: var(--surface-soft);
}

.competition-index {
  color: var(--accent);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  font-style: italic;
}

.competition-title {
  min-width: 0;
}

.competition-title strong {
  display: block;
  overflow: hidden;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  font-weight: 560;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.competition-title small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.competition-action {
  display: flex;
  align-items: center;
  gap: 16px;
}

.competition-count {
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--lime-soft);
  color: var(--accent-deep);
  font-size: 11px;
  font-weight: 780;
}

.chevron {
  width: 9px;
  height: 9px;
  border-right: 1.5px solid var(--ink-soft);
  border-bottom: 1.5px solid var(--ink-soft);
  transform: rotate(45deg);
  transition: transform 180ms ease;
}

.competition-header[aria-expanded="true"] .chevron {
  transform: translateY(3px) rotate(225deg);
}

.competition-content[hidden] {
  display: none;
}

.table-scroll {
  overflow-x: auto;
  border-top: 1px solid var(--line);
}

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

.match-table caption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.match-table th {
  position: sticky;
  z-index: 2;
  top: 0;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-align: left;
  text-transform: uppercase;
}

.match-table td {
  padding: 15px 14px;
  border-bottom: 1px solid #e9ede7;
  vertical-align: middle;
}

.match-table tbody:last-child tr:last-child td,
.match-table tbody:last-child .detail-row:last-child td {
  border-bottom: 0;
}

.match-table tbody:nth-of-type(even) .match-row {
  background: #fcfdfb;
}

.match-row {
  transition: background 140ms ease;
}

.match-row:hover {
  background: #f8faf5 !important;
}

.match-row.is-open {
  background: #f7f9f4 !important;
}

.col-time {
  width: 96px;
  padding-right: 6px !important;
  padding-left: 21px !important;
}

.col-status {
  width: 112px;
}

.col-round {
  width: 48px;
  padding-right: 6px !important;
  padding-left: 6px !important;
}

.col-matchup {
  width: 25%;
}

.col-rank {
  width: 94px;
}

.col-form {
  width: 25%;
}

.col-gap {
  width: 88px;
  text-align: right !important;
}

.col-action {
  width: 136px;
  padding-right: 21px !important;
  padding-left: 6px !important;
  text-align: right !important;
}

.match-time {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-weight: 720;
  white-space: nowrap;
}

.match-time-date {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 560;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 999px;
  background: #edf4eb;
  color: var(--accent-deep);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-badge::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--win);
  content: "";
}

.status-badge.status-tbd {
  background: #f1f1ef;
  color: #686d69;
}

.status-badge.status-tbd::before {
  background: var(--other);
}

.round-label {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.player-stack,
.rank-stack,
.form-stack {
  display: grid;
  gap: 11px;
}

.player,
.rank-value,
.form-line {
  min-height: 21px;
}

.player {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.player-names {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.player-name {
  display: block;
  overflow: hidden;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-group {
  display: grid;
  min-height: 21px;
  align-content: center;
  gap: 2px;
}

.rank-value {
  display: flex;
  align-items: center;
  color: var(--ink-soft);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.rank-value.is-better {
  color: var(--accent-deep);
  font-weight: 830;
}

.form-line {
  display: flex;
  align-items: center;
  gap: 4px;
}

.team-form-group {
  display: grid;
  min-height: 21px;
  align-content: center;
  gap: 3px;
}

.member-form-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.member-form-label {
  flex: 0 0 auto;
  width: 18px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.member-form-row .form-line {
  min-width: 0;
}

.member-form-row .outcome-dot {
  width: 14px;
  height: 14px;
  font-size: 7px;
}

.outcome-dot {
  display: inline-grid;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: white;
  font-size: 8px;
  font-weight: 850;
  line-height: 1;
}

.outcome-w {
  background: var(--win);
}

.outcome-l {
  background: var(--loss);
}

.outcome-r {
  background: var(--retired);
}

.outcome-o,
.outcome-unknown {
  background: var(--other);
}

.no-form {
  color: var(--muted);
  font-size: 12px;
}

.rank-gap {
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.rank-gap.is-highlighted {
  display: inline-grid;
  min-width: 39px;
  min-height: 29px;
  place-items: center;
  padding: 3px 8px;
  border: 1px solid #d8e985;
  border-radius: 999px;
  background: var(--lime-soft);
  color: var(--accent-deep);
  font-weight: 820;
}

.details-button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font-size: 11px;
  font-weight: 760;
}

.details-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.details-button::after {
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  content: "";
  transform: translateY(-2px) rotate(45deg);
}

.details-button[aria-expanded="true"]::after {
  transform: translateY(2px) rotate(225deg);
}

.detail-row[hidden] {
  display: none;
}

.detail-cell {
  padding: 0 !important;
  background: #f7f9f4;
}

.detail-panel {
  padding: 22px 24px 25px;
  border-bottom: 1px solid var(--line);
  box-shadow: inset 0 8px 14px -14px rgb(25 43 30 / 30%);
}

.detail-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 19px;
}

.surface-tabs {
  display: inline-flex;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.surface-tab {
  min-width: 58px;
  padding: 6px 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.surface-tab[aria-selected="true"] {
  background: var(--accent);
  color: white;
}

.match-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 760;
  text-decoration: none;
}

.match-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.match-link svg {
  width: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.player-comparison {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr);
  align-items: stretch;
  gap: 16px;
}

.versus {
  display: grid;
  place-items: center;
  color: #929a94;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  font-style: italic;
}

.player-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.player-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 17px;
}

.player-card-name {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  font-weight: 560;
  letter-spacing: -0.01em;
}

.player-meta {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.ranking-pill {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 760;
}

.card-members {
  min-width: 0;
}

.team-member + .team-member {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.team-member-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 15px;
}

.team-member-name {
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 560;
  letter-spacing: -0.01em;
}

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

.stat-block {
  min-width: 0;
}

.stat-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.stat-label span:last-child {
  color: var(--ink-soft);
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}

.detail-outcomes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 20px;
  margin-bottom: 11px;
}

.detail-outcomes .outcome-dot {
  width: 18px;
  height: 18px;
  font-size: 9px;
}

.percentage-bar {
  display: flex;
  width: 100%;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8ece6;
}

.percentage-segment {
  min-width: 0;
  height: 100%;
}

.percentage-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
}

.percentage-legend span {
  white-space: nowrap;
}

.no-surface-data {
  padding: 28px 15px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  color: var(--muted);
  text-align: center;
}

.site-footer {
  padding: 24px 0 34px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-inner p {
  margin: 0;
}

.footer-meta {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.noscript-message {
  position: fixed;
  right: 20px;
  bottom: 20px;
  left: 20px;
  padding: 14px;
  border-radius: 10px;
  background: var(--loss);
  color: white;
  text-align: center;
}

@media (max-width: 1100px) {
  .toolbar {
    grid-template-columns: 1fr 1.25fr 2fr;
  }

  .field-sort {
    grid-column: 1 / 3;
  }

  .field-gap {
    grid-column: 3;
  }

  .button-secondary {
    grid-column: 1 / -1;
  }

}

@media (max-width: 760px) {
  .page-shell {
    width: min(calc(100% - 24px), var(--page-width));
  }

  .site-header {
    background: rgb(244 246 240 / 96%);
  }

  .header-inner {
    min-height: 62px;
  }

  .hero {
    min-height: 0;
    padding-block: 42px 35px;
  }

  h1 {
    font-size: clamp(40px, 13vw, 58px);
  }

  .toolbar {
    grid-template-columns: 1fr 1fr;
    padding: 14px;
    border-radius: 16px;
  }

  .field-search,
  .field-sort,
  .field-gap {
    grid-column: 1 / -1;
  }

  .button-secondary {
    grid-column: 1 / -1;
  }

  .results-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 15px;
    padding-top: 25px;
  }

  .form-legend {
    flex-wrap: wrap;
  }

  .competition-header {
    grid-template-columns: 26px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 16px 13px;
  }

  .competition-title strong {
    font-size: 16px;
  }

  .competition-title small {
    font-size: 10px;
  }

  .competition-count {
    display: none;
  }

  .competition-action {
    gap: 5px;
  }

  .detail-panel {
    padding: 18px;
  }

  .detail-topline {
    align-items: flex-start;
    flex-direction: column;
  }

  .surface-tabs {
    width: 100%;
  }

  .surface-tab {
    min-width: 0;
    flex: 1;
    padding-inline: 5px;
  }

  .player-comparison {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
  }

  .versus {
    height: 18px;
  }

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

@media (max-width: 460px) {
  .toolbar {
    grid-template-columns: 1fr;
  }

  .field-dataset,
  .field-timezone,
  .field-search,
  .field-sort,
  .field-gap,
  .button-secondary {
    grid-column: 1;
  }

  .brand {
    font-size: 14px;
  }

  .result-count {
    font-size: 20px;
  }
}

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