.leaderboard-dialog {
  color: var(--text); background: var(--bg); border: 1px solid var(--border-light);
  border-radius: 18px; padding: clamp(16px,3vw,28px); width: min(900px, calc(100vw - 24px));
  max-height: calc(100dvh - 32px); overflow: auto; box-shadow: var(--shadow); font: 400 16px/1.5 "Inter", Arial, sans-serif;
}
.leaderboard-dialog::backdrop { background: rgba(0,0,0,.72); }
.lb-header { display: flex; gap: 12px; justify-content: space-between; align-items: center; }
.lb-header h2 { margin: 0; font: 700 30px "Barlow Condensed",Arial,sans-serif; color: var(--text); }
.lb-header-actions { display: flex; align-items: center; gap: 8px; }
.lb-close { width: 44px; min-height: 44px; padding: 0; font-size: 24px; }
.lb-description, .lb-meta, .lb-help { color: var(--text-secondary); }
.lb-help { font-size: 14px; margin: 8px 0; }
.lb-meta { font-size: 13px; }
.lb-controls { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.lb-controls label { flex: 1 1 220px; margin: 0; color: var(--text-secondary); }
.lb-controls select { margin: 6px 0 0; }
.lb-controls button { flex: 0 1 auto; width: auto; }
.lb-results { margin-top: 18px; }
.lb-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.lb-table th { text-align: left; font-size: 14px; color: var(--text-secondary); background: var(--surface-light); }
.lb-table th, .lb-table td { padding: 12px 8px; border-bottom: 1px solid var(--border); }
.lb-table td { background: var(--surface); }
.lb-table td:nth-child(2) { overflow-wrap: anywhere; }
.lb-table th:last-child, .lb-table td:last-child { text-align: right; }
.lb-table .lb-detail { display: block; color: var(--text-muted); font-size: 12px; }
.lb-table .lb-you td { background: var(--summary-bg); }
.lb-empty { padding: 24px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.lb-status { color: var(--theme-error); white-space: pre-line; font-size: 14px; }
.lb-participation { margin: 24px 0 0; border-top: 1px solid var(--border); padding-top: 18px; }
.lb-participation > summary { cursor: pointer; min-height: 44px; font-weight: 600; color: var(--text); }
.lb-preferences { padding-top: 8px; }
.lb-preferences label { color: var(--text-secondary); font-size: 14px; }
.lb-preferences select { margin-bottom: 12px; }
.lb-consent { display: flex; gap: 10px; align-items: start; }
.lb-consent input { width: 20px; height: 20px; min-height: 20px; flex-shrink: 0; margin: 2px 0 0; padding: 0; accent-color: var(--accent); }
.lb-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.lb-actions button { flex: 1 1 180px; width: auto; }
@media (max-width: 420px) { .lb-header h2 { font-size: 26px; } .lb-table th, .lb-table td { padding: 10px 5px; } }
.lb-header h2 { min-width: 0; overflow-wrap: anywhere; }
.lb-header-actions { flex-shrink: 0; }
.lb-table { table-layout: fixed; }
.lb-table th:first-child { width: 4rem; }
.lb-table th:last-child { width: 42%; }
.lb-table th, .lb-table td { overflow-wrap: anywhere; }

/* Keep the rank heading and values on one line. */
.lb-table th:first-child, .lb-table td:first-child { white-space: nowrap; overflow-wrap: normal; word-break: normal; }
