/* ---- The public leaderboard | The desk on the P = NP home (design home-leaderboard-desk): two matching panels; linked by pnp.html only. ---- */
.home-pair { display: grid; grid-template-columns: minmax(0, 700fr) minmax(0, 516fr); gap: 24px; padding: 72px var(--gutter) 88px; }
.home-pair > .leaderboard[hidden] + .home-desk { grid-column: 1 / -1; }
.home-pair > .leaderboard, .home-desk { display: flex; flex-direction: column; gap: 20px; min-width: 0; padding: 24px; border: 1px solid var(--color-rule); border-radius: var(--radius-16); background: var(--color-surface-raised); }
.home-pair > .leaderboard[hidden] { display: none; }
.home-pair .lb-head h2, .home-desk h2 { margin: 0; font: 400 30px/1.3 var(--serif); color: var(--color-ink); }
.home-pair .lb-say { margin-top: 10px; font-size: 15px; }
.home-pair .lb-controls, .home-pair .lb-rows { margin-top: 0; }
.home-pair .lb-all { font-size: 14px; }
.count a, .counts a { color: inherit; text-decoration: none; } .count a:hover, .counts a:hover { text-decoration: underline; }
@media (min-width: 1024px) {
  .home-pair .lb-head, .hd-head { flex-wrap: nowrap; }
  .home-pair .lb-head > div, .hd-title { flex: 1 1 0; min-width: 0; }
  .home-pair .lb-all, .hd-go { flex: none; }
}
.home-pair .lb-row.yours { grid-template-columns: 24px 32px minmax(0, 1fr) auto; }
.home-pair .lb-row.yours > .move, .home-pair .lb-row.yours > .lb-spark { display: none; }

.hd-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 32px; }
.hd-title { flex: 1 1 240px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.hd-line { margin: 0; font: 400 15px/1.45 var(--sans); color: var(--color-ink-muted); }
.hd-go, .hd-all { display: inline-flex; gap: 4px; font: 600 13px/1.25 var(--sans); color: var(--color-ink); text-underline-offset: 3px; }
.hd-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; }
.hd-controls button { padding: 7px 14px; font-size: 13px; cursor: pointer; }
.hd-legend { margin: 0; font: 400 12px/1.4 var(--sans); color: var(--color-ink-meta); }
.hd-paused { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0; padding: 10px 14px; border-radius: var(--radius-8); background: var(--color-strip-stale-fill); font: 400 13px/1.4 var(--sans); color: var(--color-ink-secondary); }
.hd-paused[hidden] { display: none; }
.hd-resume { padding: 5px 12px; border: 1px solid var(--color-rule-strong); border-radius: var(--radius-6); background: var(--color-surface-raised); font: 600 13px/1.2 var(--sans); color: var(--color-ink); cursor: pointer; }
.hd-scroll { position: relative; flex: 1 1 0; min-height: 520px; overflow: hidden; }
.hd-scroll::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 72px; pointer-events: none; background: linear-gradient(to bottom, transparent, var(--color-surface-raised)); }
.home-desk[data-state='empty'] .hd-scroll::after, .home-desk[data-state='loading'] .hd-scroll::after { display: none; }
.hd-rows { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0 0 72px; overflow-y: auto; list-style: none; scrollbar-width: thin; }
.hd-row { position: relative; flex: none; display: flex; flex-direction: column; gap: 6px; padding: 10px 14px; border: 1px solid var(--color-rule); border-radius: var(--radius-10); background: var(--color-surface-raised); }
.hd-row:first-child { border-color: var(--color-rule-strong); background: var(--color-surface-sunk2); }
.hd-row:hover { border-color: var(--color-ink-faint); }
.hd-link { position: absolute; inset: 0; border-radius: inherit; }
.hd-top, .hd-title-line, .hd-foot { position: relative; pointer-events: none; } .hd-who { pointer-events: auto; display: flex; } .lb-say a { white-space: nowrap; } .hd-who + .hd-who, .hd-who + .dk-disc { margin-left: -6px; } /* the whole row opens its card: its pictures and words sit under the row's link */ .hd-link:focus-visible { outline: 2px solid var(--color-ink); outline-offset: 2px; }
.hd-top, .hd-foot { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hd-chips { flex: 1 1 0; display: flex; gap: 6px; min-width: 0; }
.hd-pts { display: inline-flex; align-items: baseline; gap: 4px; white-space: nowrap; }
.hd-pts b { font: 500 18px/1.3 var(--mono); color: var(--color-ink); } .hd-pts span { font: 400 12px/1.4 var(--sans); color: var(--color-ink-meta); }
.hd-title-line { margin: 0; font: 400 17px/1.25 var(--serif); color: var(--color-ink); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.hd-count { font: 400 12px/1.4 var(--sans); color: var(--color-ink-meta); white-space: nowrap; }
.hd-id { margin-left: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 400 11px/1.3 var(--mono); color: var(--color-ink-meta); }
.hd-id time { font: inherit; color: inherit; }
.hd-skel { flex: none; height: 92px; border-radius: var(--radius-10); background: var(--color-surface-sunk2); animation: hd-wait 1.4s ease-in-out infinite; }
@keyframes hd-wait { 50% { opacity: 0.5; } }
@media (prefers-reduced-motion: reduce) { .hd-skel { animation: none; } }
.hd-empty { flex: none; display: flex; flex-direction: column; gap: 6px; padding: 32px 20px; border: 1px dashed var(--color-rule-strong); border-radius: var(--radius-10); text-align: center; font: 400 14px/1.4 var(--sans); color: var(--color-ink-muted); }
.hd-empty p { margin: 0; } .hd-empty-big { font: 400 20px/1.3 var(--serif); color: var(--color-ink); }
.hd-all { display: none; align-self: flex-start; } .home-desk[data-more] .hd-all { display: inline-flex; } /* fewer rows than the count: See all N */

@media (max-width: 1023px) {
  .home-pair { grid-auto-flow: row; padding: 48px var(--gutter) 56px; }
  .home-pair { grid-template-columns: minmax(0, 1fr); }
  .hd-scroll { flex: none; min-height: 0; height: 600px; }
}
@media (max-width: 600px) {
  .home-pair > .leaderboard, .home-desk { padding: 20px 16px; }
  .home-pair .lb-head h2, .home-desk h2 { font-size: 26px; }
  .hd-scroll { height: auto; overflow: visible; }
  .hd-scroll::after { display: none; }
  .hd-rows { position: static; padding: 0; overflow: visible; }
  .hd-rows > .hd-row:nth-child(n + 5) { display: none; }
  .hd-all { display: inline-flex; }
  .hd-go { display: none; }
  .hd-id { flex-basis: 100%; margin-left: 0; }
  .hd-foot { flex-wrap: wrap; }
}
@media (max-width: 760px) { .home-pair > .leaderboard { display: grid; gap: 0; } }
