.leaderboard-page {
  min-height: 100vh;
  background: #f7f7f5;
}

.leaderboard-main {
  padding: 148px 24px 92px;
}

.leaderboard-wrap {
  width: min(880px, 100%);
  margin: 0 auto;
}

.leaderboard-header {
  margin-bottom: 14px;
}

.leaderboard-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.leaderboard-heading-lockup {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 13px;
}

.leaderboard-gary {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  width: 62px;
  height: 62px;
  overflow: hidden;
  place-items: end center;
  border: 1px solid rgba(82, 118, 89, .18);
  border-radius: 20px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .92), transparent 42%),
    #e7eee8;
  box-shadow: 0 8px 20px rgba(43, 67, 48, .08);
}

.leaderboard-gary::after {
  content: "";
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 9px;
  height: 9px;
  border-right: 2px solid #df493f;
  border-bottom: 2px solid #df493f;
}

.leaderboard-gary img {
  width: 59px;
  height: auto;
  transform: translateY(6px) rotate(-1.5deg);
  transform-origin: bottom center;
}

.leaderboard-title-row h1 {
  margin: 0;
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 44px);
  font-weight: 850;
  letter-spacing: -.055em;
  line-height: .95;
}

.leaderboard-kicker {
  display: block;
  margin-bottom: 5px;
  color: #66826b;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .13em;
  line-height: 1;
  text-transform: uppercase;
}

.leaderboard-count {
  margin: 9px 0 0;
  color: var(--color-text-secondary);
  font-size: 13px;
  font-weight: 650;
  line-height: 1;
}

.leaderboard-privacy {
  position: relative;
  z-index: 4;
}

.leaderboard-privacy > summary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(17, 17, 17, .1);
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  color: #4a664f;
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
  list-style: none;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.leaderboard-privacy > summary::-webkit-details-marker {
  display: none;
}

.leaderboard-privacy > summary::marker {
  content: "";
}

.leaderboard-privacy > summary:hover,
.leaderboard-privacy[open] > summary {
  border-color: rgba(82, 118, 89, .32);
  background: #fff;
}

.leaderboard-privacy svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.leaderboard-privacy p {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  width: min(370px, calc(100vw - 48px));
  margin: 0;
  padding: 14px 15px;
  border: 1px solid rgba(17, 17, 17, .1);
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 14px 38px rgba(17, 17, 17, .12);
  color: var(--color-text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.leaderboard-privacy strong {
  color: #39523e;
}

.leaderboard-privacy p a {
  color: #39523e;
  font-weight: 750;
  text-underline-offset: 2px;
}

.leaderboard-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 24px;
}

.leaderboard-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(145px, 1fr));
  overflow: hidden;
  border: 1px solid rgba(17, 17, 17, .1);
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset;
}

.leaderboard-filters label {
  position: relative;
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px 39px 9px 13px;
  cursor: pointer;
}

.leaderboard-filters label + label {
  border-left: 1px solid rgba(17, 17, 17, .08);
}

.leaderboard-filters label::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 14px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid #737a75;
  border-bottom: 1.5px solid #737a75;
  pointer-events: none;
  transform: translateY(-65%) rotate(45deg);
}

.leaderboard-filters label > span {
  color: var(--color-text-tertiary);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .09em;
  line-height: 1;
  text-transform: uppercase;
}

.leaderboard-filters select {
  width: 100%;
  min-width: 0;
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--color-text);
  font: 700 14px/1.2 var(--font-body);
  letter-spacing: -.02em;
  cursor: pointer;
}

.leaderboard-filters select:focus {
  outline: none;
}

.leaderboard-filters label:focus-within {
  background: rgba(107, 143, 113, .08);
  box-shadow: inset 0 0 0 2px rgba(82, 118, 89, .48);
}

.leaderboard-join {
  display: none;
}

.leaderboard-board {
  overflow: hidden;
  border: 1px solid rgba(17, 17, 17, .095);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(17, 17, 17, .045);
}

.leaderboard-ledger {
  margin: 0;
  padding: 0;
  list-style: none;
}

.leaderboard-row {
  transition: background-color 150ms ease;
}

.leaderboard-row-link {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 62px 18px;
  align-items: center;
  gap: 12px;
  min-height: 74px;
  padding: 11px 20px;
  color: inherit;
  text-decoration: none;
}

.leaderboard-row + .leaderboard-row {
  border-top: 1px solid rgba(17, 17, 17, .075);
}

.leaderboard-row:hover,
.leaderboard-row:focus-within {
  background: #fafaf8;
}

.leaderboard-row--first {
  background: rgba(107, 143, 113, .085);
  box-shadow: inset 3px 0 0 rgba(82, 118, 89, .64);
}

.leaderboard-row--first:hover,
.leaderboard-row--first:focus-within {
  background: rgba(107, 143, 113, .115);
}

.leaderboard-rank {
  color: var(--color-text-secondary);
  font: 750 13px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
}

.leaderboard-row--first .leaderboard-rank,
.leaderboard-row--first .leaderboard-score {
  color: #4b7052;
}

.leaderboard-member {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
}

.leaderboard-member > span:last-child {
  min-width: 0;
}

.leaderboard-avatar {
  display: grid;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(17, 17, 17, .1);
  border-radius: 50%;
  background: #f1f2ef;
  color: #506455;
  font: 800 12px/1 var(--font-body);
  letter-spacing: .02em;
  overflow: hidden;
}

.leaderboard-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.leaderboard-member strong {
  display: block;
  overflow: hidden;
  color: var(--color-text);
  font-size: 15px;
  font-weight: 750;
  letter-spacing: -.025em;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-member small {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: var(--color-text-secondary);
  font-size: 12px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-member small b {
  padding: 0 3px;
  color: var(--color-text-tertiary);
}

.leaderboard-score {
  color: var(--color-text);
  font: 800 29px/.9 ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.06em;
  text-align: right;
}

.leaderboard-row-arrow {
  color: #a1a7a2;
  font-size: 14px;
  line-height: 1;
  transform: translate(-1px, 1px);
  transition: color 150ms ease, transform 150ms ease;
}

.leaderboard-row:hover .leaderboard-row-arrow,
.leaderboard-row:focus-within .leaderboard-row-arrow {
  color: #4b7052;
  transform: translate(1px, -1px);
}

.leaderboard-proof-mark {
  display: inline-flex;
  align-items: center;
  margin-left: 7px;
  color: #4b7052;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .01em;
}

.leaderboard-proof-mark::before {
  content: "";
  width: 4px;
  height: 4px;
  margin-right: 5px;
  border-radius: 50%;
  background: #6b8f71;
}

.leaderboard-more {
  display: grid;
  padding: 15px;
  border-top: 1px solid rgba(17, 17, 17, .075);
  place-items: center;
}

.leaderboard-more button {
  min-height: 42px;
  border: 1px solid rgba(17, 17, 17, .12);
  border-radius: 999px;
  padding: 0 18px;
  background: #fff;
  color: #2f4233;
  font: 800 12px/1 var(--font-body);
  cursor: pointer;
}

.leaderboard-more button:hover:not(:disabled) {
  border-color: rgba(82, 118, 89, .35);
  background: #f4f7f3;
}

.leaderboard-more button:disabled {
  cursor: wait;
  opacity: .62;
}

.leaderboard-community-note {
  margin: 16px 2px 0;
  color: #7a817b;
  font-size: 11px;
  text-align: center;
}

.leaderboard-community-note a {
  color: #4b7052;
  font-weight: 750;
  text-underline-offset: 2px;
}

.leaderboard-state {
  display: grid;
  min-height: 220px;
  padding: 34px 24px;
  place-items: center;
  align-content: center;
  color: var(--color-text-secondary);
  font-size: 14px;
  text-align: center;
}

.leaderboard-state strong {
  display: block;
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: 21px;
  letter-spacing: -.04em;
}

.leaderboard-state p {
  max-width: 420px;
  margin: 7px 0 0;
  line-height: 1.45;
}

.leaderboard-state--error button {
  margin-top: 16px;
  border: 1px solid rgba(17, 17, 17, .14);
  border-radius: 999px;
  padding: 9px 14px;
  background: #fff;
  color: var(--color-text);
  font: 800 13px/1 var(--font-body);
  cursor: pointer;
}

.leaderboard-spinner {
  width: 18px;
  height: 18px;
  margin-bottom: 10px;
  border: 2px solid rgba(107, 143, 113, .22);
  border-top-color: var(--color-sage);
  border-radius: 50%;
  animation: leaderboard-spin .7s linear infinite;
}

.leaderboard-privacy > summary:focus-visible,
.leaderboard-join:focus-visible,
.leaderboard-state button:focus-visible,
.leaderboard-row-link:focus-visible,
.leaderboard-more button:focus-visible {
  outline: 3px solid rgba(82, 118, 89, .38);
  outline-offset: 3px;
}

.leaderboard-row-link:focus-visible {
  border-radius: 12px;
  outline-offset: -4px;
}

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

@media (max-width: 760px) {
  .leaderboard-main {
    padding: 106px 14px 58px;
  }

  .leaderboard-title-row {
    gap: 14px;
  }

  .leaderboard-heading-lockup {
    gap: 10px;
  }

  .leaderboard-gary {
    width: 50px;
    height: 50px;
    border-radius: 16px;
  }

  .leaderboard-gary::after {
    right: 5px;
    bottom: 5px;
    width: 7px;
    height: 7px;
  }

  .leaderboard-gary img {
    width: 49px;
    transform: translateY(5px) rotate(-1.5deg);
  }

  .leaderboard-title-row h1 {
    font-size: 34px;
  }

  .leaderboard-count {
    margin-top: 7px;
  }

  .leaderboard-privacy > summary {
    min-height: 32px;
    padding: 0 10px;
  }

  .leaderboard-privacy p {
    width: min(340px, calc(100vw - 28px));
  }

  .leaderboard-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
    gap: 9px;
    margin-top: 19px;
  }

  .leaderboard-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .leaderboard-filters label {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .leaderboard-join {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid #111;
    border-radius: 12px;
    background: #171717;
    color: #fff;
    font-size: 13px;
    font-weight: 750;
    line-height: 1;
    text-decoration: none;
  }

  .leaderboard-board {
    border-radius: 16px;
  }

  .leaderboard-row-link {
    grid-template-columns: 26px minmax(0, 1fr) 45px 13px;
    gap: 8px;
    min-height: 69px;
    padding: 10px 14px;
  }

  .leaderboard-avatar {
    width: 36px;
    height: 36px;
    font-size: 11px;
  }

  .leaderboard-member {
    gap: 9px;
  }

  .leaderboard-member strong {
    font-size: 14px;
  }

  .leaderboard-member small {
    font-size: 11px;
  }

  .leaderboard-score {
    font-size: 25px;
  }
}

@media (max-width: 360px) {
  .leaderboard-heading-lockup {
    gap: 7px;
  }

  .leaderboard-gary {
    width: 42px;
    height: 42px;
    border-radius: 13px;
  }

  .leaderboard-gary img {
    width: 41px;
  }

  .leaderboard-title-row h1 {
    font-size: 27px;
  }

  .leaderboard-title-row {
    gap: 9px;
  }

  .leaderboard-privacy > summary {
    padding: 0 9px;
  }

  .leaderboard-row-link {
    grid-template-columns: 22px minmax(0, 1fr) 42px 11px;
    padding-right: 11px;
    padding-left: 11px;
  }

  .leaderboard-proof-mark {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .leaderboard-spinner {
    animation: none;
  }

  .leaderboard-row,
  .leaderboard-privacy > summary,
  .leaderboard-row-arrow {
    transition: none;
  }
}
