.standings-page {
  padding: 30px 18px 42px;
}

.standings-sheet {
  --sheet-ink: #202322;
  --sheet-green: #a9b51b;
  --sheet-dark: #10231f;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: 26px 34px 22px;
  color: var(--sheet-ink);
  background-color: #f2f0e7;
  background-image: repeating-linear-gradient(0deg, rgba(45, 42, 31, 0.018) 0, rgba(45, 42, 31, 0.018) 1px, transparent 1px, transparent 4px), repeating-linear-gradient(90deg, rgba(45, 42, 31, 0.012) 0, rgba(45, 42, 31, 0.012) 1px, transparent 1px, transparent 5px);
  box-shadow: 0 14px 38px rgba(31, 35, 29, 0.12);
}

.standings-sheet::before {
  position: absolute;
  z-index: -1;
  right: -38px;
  top: 48%;
  width: 230px;
  aspect-ratio: 1;
  border: 16px solid rgba(32, 35, 33, 0.045);
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #f2f0e7 0 7px, transparent 8px), radial-gradient(circle at 70% 38%, #f2f0e7 0 8px, transparent 9px), radial-gradient(circle at 46% 70%, #f2f0e7 0 9px, transparent 10px);
  content: "";
  pointer-events: none;
}

.sheet-masthead {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 26px;
  min-height: 82px;
}

.community-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.community-name {
  font-family: 'Barlow', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 700;
  font-style: normal;
  text-transform: none;
  letter-spacing: -0.01em;
  color: var(--sheet-ink);
  line-height: 1.25;
}

.community-logo {
  display: block;
  width: 68px;
  height: 68px;
  flex: 0 0 68px;
  border-radius: 50%;
  object-fit: contain;
  background: transparent;
}

.community-monogram {
  display: grid;
  width: 68px;
  height: 68px;
  flex: 0 0 68px;
  place-items: center;
  border: 2px solid var(--sheet-dark);
  border-radius: 50%;
  color: #f2f0e7;
  background: var(--sheet-dark);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 42px;
  font-style: normal;
  font-weight: 700;
}

.cup-mark {
  text-align: center;
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.cup-logo-img {
  max-height: 96px;
  max-width: 330px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.cup-name {
  display: flex;
  align-items: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 35px;
  font-weight: 700;
  line-height: 0.82;
}

.pickleball-mark {
  display: inline-block;
  width: 22px;
  height: 22px;
  margin: 0 3px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #f2f0e7 0 1.5px, transparent 2px), radial-gradient(circle at 69% 39%, #f2f0e7 0 1.5px, transparent 2px), radial-gradient(circle at 45% 70%, #f2f0e7 0 1.5px, transparent 2px), #b4c31c;
}

.cup-caption {
  display: block;
  margin-top: 4px;
  font-size: 7px;
  font-weight: 700;
}

.sheet-motto {
  margin: 4px 0 0;
  font-size: 15px;
  line-height: 1.15;
  text-transform: uppercase;
}

.sheet-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(245px, 0.7fr);
  align-items: center;
  gap: 28px;
  margin: 12px 0 28px;
}

.sheet-heading h1 {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin: 0;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(54px, 8vw, 78px);
  font-weight: 700;
  line-height: 0.76;
  text-transform: uppercase;
}

.heading-accent {
  margin-top: 5px;
  color: var(--sheet-green);
  border-bottom: 7px solid var(--sheet-green);
  padding-bottom: 8px;
}

.event-meta {
  display: grid;
  gap: 7px;
  margin: 0;
}

.event-meta div {
  display: grid;
  grid-template-columns: minmax(105px, 0.7fr) 1fr;
  align-items: center;
  gap: 8px;
}

.event-meta dt {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
}

.event-meta dd {
  min-height: 28px;
  margin: 0;
  padding: 5px 8px;
  background: rgba(32, 35, 33, 0.07);
  font-size: 12px;
}

.standings-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
  padding: 8px 12px;
  background: rgba(32, 35, 33, 0.04);
  border: 1px dashed rgba(32, 35, 33, 0.16);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  color: rgba(32, 35, 33, 0.7);
}

.filter-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--sheet-ink);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(32, 35, 33, 0.15);
  transition: all 0.15s ease;
}

.filter-pill:hover {
  background: #ffffff;
  border-color: var(--sheet-green);
}

.filter-pill.active {
  background: var(--sheet-dark);
  color: #f2f0e7;
  border-color: var(--sheet-dark);
}

.table-scroll {
  position: relative;
  z-index: 1;
  overflow-x: auto;
  border: 1px solid rgba(16, 35, 31, 0.14);
  -webkit-overflow-scrolling: touch;
}

.standings-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-family: 'Barlow Condensed', sans-serif;
}

.standings-table th,
.standings-table td {
  height: 42px;
  padding: 7px 9px;
  border-right: 1px solid rgba(32, 35, 33, 0.14);
  border-bottom: 1px solid rgba(32, 35, 33, 0.16);
  text-align: center;
}

.standings-table thead th {
  height: 42px;
  color: #fff;
  background: var(--sheet-dark);
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
}

.standings-table thead th:first-child,
.standings-table tbody .rank-cell {
  width: 56px;
}

.standings-table thead th:nth-child(2) {
  width: 34%;
}

.standings-table tbody td,
.standings-table tbody th {
  background: rgba(255, 255, 255, 0.72);
  font-size: 16px;
  font-weight: 600;
}

.standings-table tbody .rank-cell {
  color: #fff;
  background: #99a80b;
  font-size: 18px;
}

.standings-table tbody .player-cell {
  text-align: left;
}

.standings-table tr:last-child td,
.standings-table tr:last-child th {
  border-bottom: 0;
}

.archived-notice {
  margin: 14px 0 0;
  padding: 8px 14px;
  border: 1px dashed rgba(16, 35, 31, 0.3);
  color: var(--sheet-dark);
  background: rgba(16, 35, 31, 0.05);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.standings-note {
  margin: 12px 0 6px;
  color: rgba(32, 35, 33, 0.72);
  font-size: 12px;
  text-align: center;
}

.stat-key {
  margin: 16px 0 10px;
  font-size: 10px;
  letter-spacing: 0.08em;
  line-height: 1.7;
  text-align: center;
  text-transform: uppercase;
}

.stat-key span {
  padding: 0 7px;
  color: rgba(32, 35, 33, 0.45);
}

.finals-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 7px 14px;
  background: rgba(169, 181, 27, 0.22);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 15px;
  text-transform: uppercase;
}

.trophy-mark {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  color: #74810a;
  font-size: 30px;
}

.ranking-rule {
  margin: 10px 0 20px;
  font-size: 10px;
  letter-spacing: 0.09em;
  line-height: 1.7;
  text-align: center;
  text-transform: uppercase;
}

.sheet-footer {
  display: flex;
  align-items: end;
  gap: 16px;
  min-height: 50px;
  color: rgba(32, 35, 33, 0.7);
  font-size: 11px;
  text-transform: uppercase;
}

.sheet-footer p {
  margin: 0;
}

.sheet-footer p:first-child span {
  font-size: 10px;
}

.sheet-footer .footer-event {
  margin-left: auto;
  font-style: italic;
}

.rally-seal {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  place-items: center;
  border: 2px solid var(--sheet-dark);
  border-radius: 50%;
  color: var(--sheet-dark);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 22px;
  font-weight: 700;
}

@media (max-width: 700px) {
  .standings-page {
    padding: 16px 10px 28px;
  }

  .standings-sheet {
    padding: 20px 14px 16px;
  }

  .sheet-masthead {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    min-height: auto;
    margin-bottom: 8px;
  }

  .community-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 11px;
  }

  .community-name {
    font-size: 14px;
    line-height: 1.2;
  }

  .community-logo,
  .community-monogram {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
  }

  .community-monogram {
    font-size: 26px;
  }

  .cup-mark {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
  }

  .cup-logo-img {
    max-height: 78px;
    max-width: 270px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
  }

  .cup-name {
    font-size: 26px;
  }

  .pickleball-mark {
    width: 16px;
    height: 16px;
  }

  .sheet-motto {
    margin: 4px 0 0 0;
    text-align: center;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.05em;
    line-height: 1.1;
    color: rgba(32, 35, 33, 0.75);
    white-space: nowrap;
  }

  .sheet-motto br {
    display: none;
  }

  .sheet-heading {
    grid-template-columns: 1fr;
    gap: 18px;
    margin: 18px 0 20px;
  }

  .sheet-heading h1 {
    font-size: clamp(52px, 16vw, 72px);
  }

  .event-meta {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .event-meta div {
    grid-template-columns: 105px 1fr;
  }

  .event-meta dt {
    font-size: 18px;
  }

  .table-scroll {
    overflow: visible;
    border: 0;
  }

  .standings-table,
  .standings-table tbody {
    display: block;
    width: 100%;
  }

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

  .standings-table tbody tr {
    display: grid;
    grid-template-columns: 42px repeat(4, minmax(0, 1fr));
    grid-template-rows: 34px 30px;
    margin-bottom: 8px;
    border: 1px solid rgba(32, 35, 33, 0.16);
    background: rgba(255, 255, 255, 0.72);
  }

  .standings-table th,
  .standings-table td {
    display: block;
    width: auto !important;
    height: auto;
    min-width: 0;
    padding: 5px 6px;
    border: 0;
    border-right: 1px solid rgba(32, 35, 33, 0.1);
    border-bottom: 1px solid rgba(32, 35, 33, 0.1);
    font-size: 13px;
  }

  .standings-table tbody .rank-cell {
    grid-column: 1;
    grid-row: 1 / 3;
    display: grid;
    place-items: center;
    font-size: 18px;
  }

  .standings-table tbody .player-cell {
    grid-column: 2 / -1;
    grid-row: 1;
    display: flex;
    align-items: center;
    padding-left: 10px;
    text-align: left;
  }

  .standings-table tbody td:nth-child(3) { grid-column: 2; grid-row: 2; }
  .standings-table tbody td:nth-child(4) { grid-column: 3; grid-row: 2; }
  .standings-table tbody td:nth-child(5) { grid-column: 4; grid-row: 2; }
  .standings-table tbody td:nth-child(6) { grid-column: 5; grid-row: 2; }

  .standings-table tbody td[data-label]::before {
    display: inline;
    margin-right: 2px;
    color: rgba(32, 35, 33, 0.6);
    content: attr(data-short-label);
    font-family: 'Barlow', sans-serif;
    font-size: 8px;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
  }

  .standings-table tbody .rank-cell::before {
    display: none;
  }

  .standings-table tbody td:not(.rank-cell) {
    padding-right: 2px;
    padding-left: 2px;
    font-size: 11px;
    white-space: nowrap;
  }

  .standings-note {
    font-size: 11px;
    line-height: 1.5;
  }

  .stat-key {
    font-size: 9px;
  }

  .stat-key span {
    padding: 0 3px;
  }

  .finals-banner {
    font-size: 14px;
  }

  .ranking-rule {
    font-size: 9px;
  }

  .sheet-footer {
    gap: 9px;
    font-size: 9px;
  }

  .rally-seal {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }
}