/*
  🏆 The look of the leaderboard.
*/

.hidden { display: none !important; }

.lb-page { max-width: 620px; margin: 0 auto; padding: 18px 20px 40px; display: flex; flex-direction: column; gap: 18px; }
.lb-nav { display: flex; align-items: center; justify-content: space-between; }
.lb-nav .brand { text-decoration: none; color: inherit; }
.lb-nav .btn { text-decoration: none; }
.lb-nav-right { display: flex; align-items: center; gap: 6px; }

.lb-card { padding: 24px; gap: 18px; box-shadow: var(--shadow-md); }
.lb-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lb-head h1 { margin: 0; font-size: 26px; }

.seg { display: flex; overflow: hidden; border: 1px solid var(--color-divider); border-radius: var(--radius); }
.seg-opt { flex: 1; padding: 9px 6px; font: inherit; font-size: 14px; color: var(--color-text); background: transparent; border: none; cursor: pointer; }
.seg-opt + .seg-opt { border-left: 1px solid var(--color-divider); }
.seg-opt.on { color: var(--color-accent); box-shadow: inset 0 0 0 1px var(--color-accent); }
.seg-opt:not(.on):hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }

/* ---------- the podium ---------- */

.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 10px; padding-top: 6px; }
.podium:empty { display: none; }
.spot { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.spot .avatar {
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center; font-size: 16px;
  background: var(--color-neutral-700);
}
.spot.first .avatar {
  width: 64px; height: 64px; font-size: 19px;
  background: var(--color-accent-800); color: var(--color-accent-100);
  box-shadow: 0 0 0 2px var(--color-accent), 0 0 24px color-mix(in srgb, var(--color-accent) 50%, transparent);
}
.spot .crown { font-size: 24px; line-height: 1; margin-bottom: -4px; color: var(--crown, #f5cf3a); }
.spot .nm { font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spot.me .nm { color: var(--color-accent-300); font-weight: 500; }
.block {
  width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding-top: 12px;
  border-radius: 10px 10px 0 0;
  background: linear-gradient(var(--color-neutral-800), transparent);
}
.spot.first .block { background: linear-gradient(var(--glow-strong), transparent); }
.block .place { font-size: 22px; font-weight: 500; }
.block .pts { font-size: 13px; color: color-mix(in srgb, var(--color-text) 75%, transparent); }
.spot.first .block { height: 124px; }
.spot.second .block { height: 96px; }
.spot.third .block { height: 78px; }

/* ---------- everyone else ---------- */

.rest { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.rest:empty { display: none; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius); }
.row .rk { width: 26px; font-size: 13px; color: color-mix(in srgb, var(--color-text) var(--muted), transparent); }
.row .avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: var(--color-neutral-700); flex: none; }
.row .nm { flex: 1; font-size: 15px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .pts { font-size: 15px; font-weight: 500; }
.row.me { background: color-mix(in srgb, var(--color-accent) 12%, transparent); box-shadow: inset 0 0 0 1px var(--color-accent); }
.you { color: var(--color-accent-300); font-size: 13px; }

/* ---------- messages ---------- */

.lb-message { text-align: center; padding: 26px 10px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.lb-message .big { font-size: 44px; line-height: 1; color: var(--color-accent-300); }
.lb-message .btn { height: 42px; padding: 0 20px; text-decoration: none; }
.your-spot { display: flex; align-items: center; gap: 14px; padding: 8px 16px 8px 12px; border-radius: var(--radius); font-size: 15px; background: var(--color-accent-900); box-shadow: inset 0 0 0 1px var(--color-accent-700); }
.your-spot .pip { width: 72px; margin: 2px 0 -6px; }
.footnote { font-size: 12px; text-align: center; }

/* Teachers often show this on a big classroom screen, so make it bigger there */
body.teacher-view .lb-page { max-width: 820px; }
body.teacher-view .row .nm, body.teacher-view .row .pts { font-size: 19px; }
body.teacher-view .spot .nm { font-size: 17px; }

@media (max-width: 480px) {
  .lb-page { padding: 14px 12px 28px; }
  .lb-card { padding: 18px 14px; }
  .spot .avatar { width: 44px; height: 44px; font-size: 14px; }
  .spot.first .avatar { width: 54px; height: 54px; }
}

/* Loading placeholders */
.podium-skel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-items: end; }
.podium-skel > div { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.row-skel { list-style: none; }

:root[data-theme="light"] { --crown: #d4a20c; }
