.track-selection-ui .cheesy-official-track { width: 248px; vertical-align: top; }
.cheesy-track-best {
  position: relative;
  display: grid;
  box-sizing: border-box;
  width: 208px;
  margin: 0 16px 16px;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.2rem 0.6rem;
  padding: 0.65rem 0.75rem;
  background: var(--cheesy-color-panel-deep);
  color: var(--cheesy-color-ink);
  font: 20px var(--cheesy-font-game);
  pointer-events: auto;
}
.cheesy-best-label { color: var(--cheesy-color-muted); font-size: 16px; }
.cheesy-best-result { grid-column: 1; display: flex; flex-direction: column; gap: 4px; }
.cheesy-best-user { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cheesy-official-info > .leaderboard-ui { display: none !important; }
.cheesy-official-info > .side-panel > :is(.opponents-title, .opponents-container) { display: none !important; }
.cheesy-track-info-record {
  box-sizing: border-box; width: 600px; flex-shrink: 0; padding: 2rem;
  background: var(--cheesy-color-panel-deep); color: var(--cheesy-color-ink);
  font-family: var(--cheesy-font-game); text-align: center; pointer-events: auto;
}
.cheesy-track-info-record > img { width: 5rem; margin-top: 1rem; }
.cheesy-track-info-record > h2 { font-size: 2.5rem; font-weight: normal; }
.cheesy-info-best { font-size: 3rem; color: var(--cheesy-color-accent); }
.cheesy-info-user { font-size: 1.5rem; overflow-wrap: anywhere; }
.cheesy-info-signin { font-size: 1.1rem; color: var(--cheesy-color-muted); }
.cheesy-track-best > button { grid-column: 1; margin: 8px 0 0 !important; font-size: 20px !important; padding: 8px !important; width: 100%; }
.cheesy-leaderboard-modal {
  position: fixed;
  inset: 0;
  z-index: 410;
  box-sizing: border-box;
  width: min(76rem, calc(100% - 1.5rem));
  max-height: 90dvh;
  margin: auto;
  padding: 0;
  border: 0;
  color: var(--cheesy-color-ink);
  background: var(--cheesy-color-panel);
  font-family: var(--cheesy-font-game);
  pointer-events: auto;
}
.cheesy-leaderboard-modal::backdrop { background: var(--cheesy-color-overlay); }
.cheesy-leaderboard-modal .cheesy-account-card { box-shadow: none; padding: clamp(1rem, 2vw, 1.5rem); max-height: 90dvh; display: flex; flex-direction: column; }
.cheesy-leaderboard-header { display: flex; align-items: start; justify-content: space-between; gap: 1rem; }
.cheesy-leaderboard-header p { margin: 0 0 0.4rem; color: var(--cheesy-color-muted); }
.cheesy-leaderboard-header h2 { margin: 0; font-size: clamp(1.7rem, 5vw, 2.8rem); line-height: 1.1; }
.cheesy-leaderboard-tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-block: 0.75rem; }
.cheesy-leaderboards-menu { white-space: nowrap; }
.cheesy-leaderboard-tabs [hidden] { display: none; }
.cheesy-leaderboard-modal .button { margin: 0; min-height: 2.75rem; padding: 0.5rem 0.8rem; font-size: 1.1rem; }
.cheesy-leaderboard-tabs button[aria-pressed="true"] { background: var(--cheesy-color-accent); color: var(--cheesy-color-accent-ink); }
.cheesy-leaderboard-body { overflow: auto; max-height: 65dvh; min-height: 0; flex: 1 1 auto; }
.cheesy-leaderboard-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.75rem; }
.cheesy-grid-hint { margin: 0 0 0.75rem; color: var(--cheesy-color-muted); }
.cheesy-record-tile { min-width: 0; padding: 0.75rem; border: 1px solid transparent; background: var(--cheesy-color-panel-deep); color: var(--cheesy-color-ink); font-family: var(--cheesy-font-game); display: flex; flex-direction: column; align-items: start; text-align: left; cursor: pointer; }
.cheesy-record-heading { margin-bottom: 0.6rem; font-size: 1.3rem; }
.cheesy-record-time { color: var(--cheesy-color-accent); font-size: 1.3rem; font-variant-numeric: tabular-nums; margin-top: 0.3rem; }
.cheesy-record-user { width: 100%; overflow-wrap: anywhere; font-size: 1rem; line-height: 1.2; }
.cheesy-record-tile:hover { border-color: var(--cheesy-color-accent); }
.cheesy-record-tile:active { background: var(--cheesy-color-panel); }
.cheesy-leaderboard-header, .cheesy-leaderboard-tabs, .cheesy-leaderboard-footer { flex-shrink: 0; }
.cheesy-leaderboard-body table { width: 100%; border-collapse: collapse; text-align: left; font-size: 1.1rem; }
.cheesy-leaderboard-body :is(th, td) { padding: 0.7rem 0.5rem; border-bottom: 1px solid var(--cheesy-color-muted); overflow-wrap: anywhere; }
.cheesy-leaderboard-body th { color: var(--cheesy-color-muted); font-weight: normal; }
.cheesy-leaderboard-body td:nth-child(3) { white-space: nowrap; font-variant-numeric: tabular-nums; }
.cheesy-leaderboard-self { color: var(--cheesy-color-accent); }
.cheesy-leaderboard-footer { display: flex; gap: 1rem; align-items: center; justify-content: space-between; margin-top: 1rem; color: var(--cheesy-color-muted); }
.cheesy-leaderboard-footer p { margin: 0; line-height: 1.4; }
.cheesy-leaderboard-footer > button { flex-shrink: 0; white-space: nowrap; }
.cheesy-leaderboard-error { color: var(--cheesy-color-danger); }
.cheesy-leaderboard-paging { display: flex; gap: 0.75rem; justify-content: end; margin-top: 1rem; }
.cheesy-leaderboard-toast {
  position: fixed; z-index: 420; bottom: 1rem; left: 50%; transform: translateX(-50%);
  width: max-content; max-width: calc(100% - 3rem); padding: 1rem;
  background: var(--cheesy-color-panel-deep); color: var(--cheesy-color-ink);
  border-left: 4px solid var(--cheesy-color-accent); font: 1.1rem var(--cheesy-font-game);
  pointer-events: auto;
}
.cheesy-leaderboard-toast button { font-size: 1rem; margin-left: 0.75rem; }
.cheesy-leaderboard-modal :is(button, a):focus-visible, .cheesy-track-best button:focus-visible { outline: 3px solid var(--cheesy-color-focus); outline-offset: 2px; }
@media (max-width: 38rem) {
  .cheesy-leaderboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
  .cheesy-record-tile { padding: 0.75rem; }
  .cheesy-record-time { font-size: 1.2rem; }
  .cheesy-leaderboard-body table { font-size: 0.9rem; }
  .cheesy-leaderboard-body :is(th, td) { padding: 0.6rem 0.25rem; }
  .cheesy-leaderboard-body td .button { font-size: 0.85rem; padding: 0.5rem 0.3rem; }
  .cheesy-leaderboard-footer { align-items: start; }
}
@media (min-width: 38rem) and (max-width: 60rem) {
  .cheesy-leaderboard-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
