/* Adapted from rpinho/lean-golf's leaderboard stylesheet. */
:root {
  color-scheme: dark;
  --paper: #101917;
  --panel: #15211d;
  --tint: #1b2824;
  --ink: #f2f7f4;
  --mint: #78f4bc;
  --muted: #a9bbb4;
  --rule: #394e45;
  background: var(--paper);
  color: var(--ink);
  font: 100%/1.55 system-ui, sans-serif;
}
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --paper: #f6f7f2;
    --panel: #fff;
    --tint: #eaf0e8;
    --ink: #182c24;
    --mint: #17654a;
    --muted: #53655a;
    --rule: #c9d4ca;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; border-top: .35rem solid var(--mint); }
.wrap { width: min(100% - 2rem, 73rem); margin-inline: auto; }
header, footer { border-bottom: 1px solid var(--rule); }
.masthead, .masthead nav, .section-title, footer .wrap { display: flex; align-items: baseline; flex-wrap: wrap; gap: .5rem 1.6rem; }
.masthead, footer .wrap, .section-title { justify-content: space-between; }
.masthead { padding-block: 1rem; }
.brand { font: 700 1.25rem/1.4 ui-monospace, monospace; letter-spacing: -.06em; text-decoration: none; }
nav a { color: var(--muted); font-size: .9rem; text-decoration: none; }
nav [aria-current] { color: var(--ink); font-weight: 650; text-decoration: underline; text-underline-offset: .45em; }
main { padding-block: clamp(2rem, 4.3vw, 4rem); }
h1 { margin: 0 0 .45rem; font-size: clamp(2.6rem, 6vw, 4.8rem); line-height: 1.04; letter-spacing: -.047em; }
h2 { margin: 0; font-size: 1.45rem; letter-spacing: -.035em; }
p { margin: 0 0 1rem; color: var(--muted); }
.intro { font-size: 1.05rem; max-width: 65ch; }
a { color: var(--mint); text-underline-offset: .18em; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: .2rem; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); margin: 2rem 0 2.4rem; border-block: 1px solid var(--rule); }
.metrics div { display: flex; flex-direction: column-reverse; align-items: start; padding: .9rem 0 1.05rem; }
.metrics dt, small, time { color: var(--muted); font-size: .87rem; font-weight: 450; }
.metrics dd { margin: 0; font: 550 clamp(1.7rem, 3vw, 2.7rem)/1.15 ui-monospace, monospace; letter-spacing: -.065em; }
.section-title { margin-bottom: .8rem; }
.section-title a, footer { font-size: .9rem; }
table { width: 100%; border-collapse: collapse; background: var(--panel); }
th, td { padding: .75rem .9rem; text-align: left; border-bottom: 1px solid var(--rule); overflow-wrap: anywhere; }
th { background: var(--tint); color: var(--muted); font-size: .85rem; font-weight: 650; }
tbody tr:hover, tr:target { background: var(--tint); }
td a { font-weight: 575; }
small, .latest time { display: block; }
.rank, .held, .value { font-family: ui-monospace, monospace; }
.rank { color: var(--muted); }
.held { font-weight: 650; }
.holders .latest { width: 38%; }
.catalog { table-layout: fixed; font-size: .92rem; }
.catalog th:nth-child(1) { width: 28%; }
.catalog th:nth-child(2) { width: 9%; }
.catalog th:nth-child(3) { width: 21%; }
.catalog th:nth-child(4) { width: 22%; }
.catalog th:nth-child(5) { width: 11%; }
.catalog th:nth-child(6) { width: 9%; }
#filters { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; margin: 2rem 0 1rem; }
.buttons { display: flex; flex-wrap: wrap; gap: .4rem; }
button, input { font: inherit; color: var(--ink); border: 1px solid var(--rule); background: var(--panel); border-radius: .3rem; }
button { cursor: pointer; padding: .45rem .9rem; }
button[aria-pressed="true"] { color: var(--paper); border-color: var(--mint); background: var(--mint); }
.search { color: var(--muted); font-size: .85rem; font-weight: 600; }
input { display: block; padding: .52rem .7rem; margin-top: .2rem; font-size: 1rem; }
#result-count { margin-bottom: .5rem; font-variant-numeric: tabular-nums; }
footer { border-top: 1px solid var(--rule); border-bottom: 0; padding-block: 1.3rem; }
footer p { margin: 0; }
.notes { padding-left: 1.25rem; columns: 2 25rem; column-gap: 2rem; }
.notes li { break-inside: avoid; margin-bottom: .45rem; }
@media (max-width: 48rem) {
  .masthead nav { gap: .8rem; }
  .metrics { grid-template-columns: repeat(2, 1fr); margin-block: 1.35rem 1.7rem; }
  .metrics div { padding: .65rem 0; }
  .metrics div:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .holders, .catalog, tbody { display: block; }
  thead { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
  td { display: block; border: 0; padding: 0; }
  tbody tr { display: grid; gap: .3rem .65rem; padding: .85rem; border-bottom: 1px solid var(--rule); }
  .holders tr { grid-template-columns: 1.25rem 1fr auto; }
  .rank { grid-area: 1 / 1; }
  .handle { grid-area: 1 / 2; }
  .held { grid-area: 1 / 3; }
  .held::after { content: " held"; }
  .credit, .holders .latest { grid-column: 2 / -1; width: auto; }
  .credit:empty { display: none; }
  .credit:not(:empty)::before { content: "Self-reported · "; }
  .latest a { font-size: .91rem; font-weight: 450; }
  .catalog tr { grid-template-columns: 1fr auto; }
  .catalog td { grid-column: 1 / -1; }
  .catalog .family, .catalog .date { color: var(--muted); font-size: .85rem; }
  .catalog .evidence { grid-column: 2; grid-row: 5; }
  .catalog .date { grid-column: 1; grid-row: 5; }
  .catalog .value::before { content: "Record · "; color: var(--muted); }
  .catalog .source::before { content: "Holder or source · "; color: var(--muted); }
  .buttons { gap: .3rem; }
  button { padding: .45rem .65rem; }
  .search, .search input { width: 100%; }
  .section-title { gap: .35rem; }
}

.crumb { font-size: .87rem; margin-bottom: .8rem; }
h1.detail-title { font-size: clamp(2.1rem, 4.5vw, 3.75rem); max-width: 25ch; }
h1, .share, .prompt, .record-panel, code, .statement { overflow-wrap: anywhere; }
main section + section, main details { margin-top: 2rem; }
section h2 { margin-bottom: .45rem; }
.metrics.profile-metrics { margin-bottom: 1.2rem; }
.windows, .toolbar { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.windows { padding: .22rem; border: 1px solid var(--rule); border-radius: .4rem; width: fit-content; }
.windows a { padding: .36rem .75rem; text-decoration: none; border-radius: .23rem; font-size: .91rem; }
.windows [aria-current] { background: var(--mint); color: var(--paper); font-weight: 600; }
.toolbar { justify-content: space-between; margin: .8rem 0; }
.toolbar input { display: inline-block; margin: 0 0 0 .5rem; }
.holders th button { background: transparent; border: 0; color: inherit; padding: .25rem 0; font-weight: inherit; }
.holders th button::after { content: " ↕"; }
.holders [aria-sort="ascending"] button::after { content: " ↑"; }
.holders [aria-sort="descending"] button::after { content: " ↓"; }
.stamp { font-size: .85rem; margin: .35rem 0; }
.record-panel, .share, pre, code.block { background: var(--tint); border-radius: .35rem; padding: 1rem 1.3rem; }
.record-panel { border-left: .24rem solid var(--mint); margin: 1.4rem 0 .8rem; }
.record-panel h2 { font-size: 1rem; font-weight: 550; }
.record-panel p { margin: .35rem 0 0; }
.score { font: 600 clamp(1.3rem, 2.5vw, 2.2rem)/1.25 ui-monospace, monospace; }
.state, .stamp, .quiet { font-size: .86rem; }
.action { padding: .45rem .85rem; color: var(--paper); background: var(--mint); border-radius: .3rem; text-decoration: none; font-weight: 600; display: inline-block; }
.quiet { margin-left: .6rem; }
.share { margin: 1.25rem 0; }
.share h2 { font-size: 1.15rem; }
.share p, .split p { margin-bottom: .65rem; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 1.7rem; margin: 1.6rem 0; }
.split > div { min-width: 0; }
.prompt, code, pre { font-family: ui-monospace, monospace; font-size: .89rem; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; }
code.block { display: block; margin: .6rem 0; }
.medals { display: flex; flex-wrap: wrap; gap: .5rem; margin: .6rem 0; }
.chip { display: inline-flex; align-items: center; gap: .3rem; background: var(--panel); border: 1px solid var(--rule); border-radius: 2rem; padding: .24rem .65rem .24rem .4rem; font-size: .84rem; font-weight: 550; }
.gold svg { color: #ae7d15; } .silver svg { color: #7c9296; } .bronze svg { color: #b16d42; }
summary { cursor: pointer; color: var(--mint); }
td small { font-weight: 400; }
@media (max-width: 48rem) {
  .split { grid-template-columns: 1fr; gap: 1.2rem; }
  .masthead nav { gap: .35rem .85rem; }
  .toolbar input { width: 100%; margin: .25rem 0; }
  .holders thead { position: static; width: auto; height: auto; clip-path: none; display: block; }
  .holders thead tr { display: flex; gap: .75rem; padding: .3rem .7rem; background: var(--tint); flex-wrap: wrap; }
  .holders th { padding: 0; border: 0; font-size: .78rem; }
  .holders td.latest { grid-column: 2 / -1; }
  main table { display: block; }
  .chip { font-size: .8rem; }
}

@media (min-width: 22rem) and (max-width: 36rem) {
  .metrics:not(.profile-metrics) { grid-template-columns: repeat(4, 1fr); gap: .5rem; margin-block: 1rem; }
  .metrics:not(.profile-metrics) div { justify-content: flex-end; padding-block: .55rem; border: 0; }
  .metrics:not(.profile-metrics) dt { font-size: .77rem; }
}
