/* The leaderboard block under the end screen's banner (Leaderboard.js):
   the run line, the top runs, and a guest's sign-in link. Shared by the
   player page's end-state and the builder preview's end screen, so it
   carries its own look and takes only its width from the page. */
.leaderboard {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--font-size);
  color: var(--color-text);
}

.leaderboard.visible {
  display: flex;
}

.leaderboard-run {
  margin: 0;
  font-weight: var(--font-weight-bold);
}

.leaderboard-top {
  width: 100%;
  max-width: 300px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: leaderboard;
}

.leaderboard-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  padding: var(--space-1) 0;
  counter-increment: leaderboard;
  color: var(--color-text-dark);
}

.leaderboard-row::before {
  content: counter(leaderboard) '.';
  min-width: var(--space-4);
  text-align: right;
}

.leaderboard-row.is-me {
  color: var(--color-text);
  font-weight: var(--font-weight-bold);
}

.leaderboard-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

/* Placeholder rows while the board loads: shimmer bars the width of a
   typical name and value, so the block is its final height at once. The
   shimmer itself is the shared skeleton rule in Section.css, which the
   player page loads. */
.leaderboard-row.is-loading .leaderboard-name,
.leaderboard-row.is-loading .leaderboard-value {
  flex: none;
  border-radius: var(--radius-sm);
}

.leaderboard-row.is-loading .leaderboard-name {
  width: 8em;
}

.leaderboard-row.is-loading .leaderboard-value {
  width: 3em;
}

.leaderboard-signin {
  padding: 0;
  border: none;
  background: none;
  font-size: var(--font-size-sm);
  color: var(--color-text-dark);
  cursor: pointer;
}
