/* VOIDRUNNER — the leaderboard page. The game's own colours: the void, its
   cyan, and the podium's gold, silver and bronze. */
:root {
  --bg: #05060a;
  --panel: rgba(8, 13, 22, .92);
  --line: rgba(103, 232, 249, .22);
  --line-hi: rgba(103, 232, 249, .6);
  --cyan: #67e8f9;
  --ink: #e2e8f0;
  --text: #cbd5e1;
  --dim: #64748b;
  --faint: #334155;
  --gold: #fbbf24;
  --silver: #cbd5e1;
  --bronze: #d97706;
  --bad: #f87171;
  --pink: #f472b6;
  --platinum: #67e8f9;
  --void: #c084fc;
  /* the rows' panels: solid, since a see-through cell shows a seam where it meets the next */
  --row: #0c1321;
  --row-hi: #16213a;
  --radius: 12px;
  /* osu!'s OutQuint: off quickly, settling slowly */
  --out: cubic-bezier(.22, 1, .36, 1);
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --head: 'Chakra Petch', Barlow, system-ui, sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
/* hidden means hidden, whatever display a rule below gives the element */
[hidden] { display: none !important; }
/* the page's own background is the html element's, so LB_ART.backdrop's
   canvas (z-index -1) shows through the body; without the hook, this is it */
html {
  background: var(--bg);
  background-image: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(103, 232, 249, .09), transparent 70%);
}
body {
  min-height: 100vh; background: transparent; color: var(--text);
  font-family: Barlow, 'Segoe UI', system-ui, sans-serif; line-height: 1.45;
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--cyan); }

.top { max-width: 980px; margin: 0 auto; padding: 22px 16px 6px; text-align: center; position: relative; }
.back {
  position: absolute; left: 16px; top: 18px; text-decoration: none;
  font: 600 11px var(--head); letter-spacing: .14em; color: var(--dim);
}
.back:hover { color: var(--cyan); }
h1 {
  font: 700 clamp(26px, 6vw, 40px) var(--head); letter-spacing: .14em; color: var(--ink);
  text-shadow: 0 0 28px rgba(103, 232, 249, .45); margin-top: 18px;
}
.cal { font: 500 11px var(--mono); letter-spacing: .12em; color: var(--dim); margin-top: 4px; }

main { max-width: 980px; margin: 0 auto; padding: 8px 16px 40px; }
h2 { font: 700 11px var(--head); letter-spacing: .2em; color: var(--dim); margin-bottom: 8px; }

/* your placement */
.mine { margin-top: 16px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.card {
  text-align: left; cursor: pointer; padding: 12px 14px; border-radius: calc(var(--radius) + 4px);
  background: var(--panel); border: 1px solid var(--line);
  transition: transform .4s var(--out), border-color .2s;
  animation: lb-rise .8s var(--out) backwards;
}
.cards > :nth-child(2) { animation-delay: 70ms; }
.cards > :nth-child(3) { animation-delay: 140ms; }
.card:hover { border-color: var(--line-hi); }
button.card:hover { transform: translateY(-2px); }
.card .k { font: 700 10px var(--head); letter-spacing: .16em; color: var(--dim); }
.card .v { font: 700 24px var(--mono); color: var(--ink); margin-top: 2px; }
.card .v small { font-size: 12px; color: var(--dim); font-weight: 500; }
.card .s { font: 500 11px var(--mono); color: var(--dim); }
.card.none { cursor: default; }
.card.none .v { color: var(--faint); font-size: 16px; }

/* search */
.find { display: flex; gap: 8px; margin-top: 18px; }
.find input {
  flex: 1; min-width: 0; padding: 11px 14px; border-radius: var(--radius); outline: none;
  background: rgba(2, 6, 14, .9); border: 1px solid var(--line); color: var(--ink);
  font: 600 14px var(--mono);
}
.find input:focus { border-color: var(--cyan); box-shadow: 0 0 0 2px rgba(103, 232, 249, .14); }
.find button, .pager button {
  padding: 0 18px; border-radius: var(--radius); cursor: pointer; background: rgba(103, 232, 249, .14);
  border: 1px solid rgba(103, 232, 249, .65); color: var(--cyan); font: 700 11px var(--head); letter-spacing: .14em;
}
.find button:hover, .pager button:hover:not(:disabled) { background: rgba(103, 232, 249, .24); }
.found { margin-top: 10px; display: grid; gap: 8px; }
.player {
  padding: 10px 12px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line);
  animation: lb-rise .7s var(--out) backwards;
}
.player:nth-child(2) { animation-delay: 50ms; } .player:nth-child(3) { animation-delay: 100ms; }
.player:nth-child(n+4) { animation-delay: 150ms; }
.player .who { font: 700 15px var(--mono); color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip {
  cursor: pointer; padding: 4px 9px; border-radius: 999px; background: rgba(2, 6, 14, .9);
  border: 1px solid var(--line); font: 600 11px var(--mono); color: var(--text);
}
.chip:hover { border-color: var(--line-hi); color: var(--ink); }
.chip b { color: var(--cyan); }
.chip.off { cursor: default; color: var(--faint); }
.found .empty { color: var(--dim); font-size: 13px; }

/* tabs and the board picker */
.tabs { display: flex; gap: 4px; margin-top: 22px; border-bottom: 1px solid var(--line); overflow-x: auto;
        scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  position: relative; padding: 10px 14px 12px; background: none; border: 0; cursor: pointer;
  font: 700 12px var(--head); letter-spacing: .16em; color: var(--dim); white-space: nowrap;
  transition: color .2s;
}
/* under the chosen tab, a rounded bar that grows out from its middle */
.tabs button::after {
  content: ''; position: absolute; left: 10px; right: 10px; bottom: 0; height: 3px; border-radius: 3px;
  background: var(--cyan); box-shadow: 0 0 10px rgba(103, 232, 249, .6);
  transform: scaleX(0); opacity: 0; transition: transform .45s var(--out), opacity .2s;
}
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--cyan); }
.tabs button[aria-selected="true"]::after { transform: none; opacity: 1; }
.bar { display: flex; align-items: center; gap: 12px; margin: 12px 0 8px; min-height: 34px; }
.bar select {
  padding: 7px 12px; border-radius: var(--radius); background: rgba(2, 6, 14, .9); border: 1px solid var(--line);
  font: 600 12px var(--mono); color: var(--ink);
}
.count { font: 500 11px var(--mono); color: var(--dim); margin-left: auto; }

/* the board, osu!-style: every row its own rounded panel, floating over the
   backdrop rather than boxed in a table */
.board { width: 100%; border-collapse: separate; border-spacing: 0 5px; margin-top: -5px; font-size: 14px; }
.board th {
  text-align: left; padding: 6px 12px 0; font: 700 10px var(--head); letter-spacing: .16em; color: var(--dim);
}
.board tr { --cell: var(--row); }
/* each cell reaches a hair under the next one (--fill): at a zoom, or on a
   125% screen, cells sit on fractions of a pixel and would show a seam where
   they meet. The row's last cell doesn't, so its corners stay round. */
.board td {
  --fill: 1.5px 0 0 var(--cell);
  padding: 10px 12px; white-space: nowrap; background-color: var(--cell); box-shadow: var(--fill);
  transition: background-color .25s, box-shadow .25s;
}
.board td:last-child { box-shadow: none; }
.board td:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.board td:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.board .r { width: 52px; text-align: right; font-family: var(--mono); color: var(--dim); }
.board .n { text-align: right; font-family: var(--mono); }
.board td.score { color: var(--ink); font-weight: 700; }
.board .name { font: 700 14px var(--mono); color: var(--ink); }
.board tr.p1 .r { color: var(--gold); } .board tr.p1 .name { color: var(--gold); }
.board tr.p2 .r { color: var(--silver); }
.board tr.p3 .r { color: var(--bronze); }
.board tr.mark .name { color: var(--cyan); }
.acct {
  display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 999px; vertical-align: 1px;
  border: 1px solid rgba(103, 232, 249, .4); color: var(--cyan); font: 600 10px var(--mono);
}
.note {
  padding: 26px 16px; text-align: center; color: var(--dim); border-radius: calc(var(--radius) + 4px);
  background: var(--row); animation: lb-fade .4s backwards;
}
.note.bad { color: var(--bad); }

.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 14px; }
.pager button { height: 34px; border-radius: 999px; }
.pager button:disabled { opacity: .35; cursor: default; }
.pager span { font: 500 12px var(--mono); color: var(--dim); }

/* the PVP tab: the leagues on a panel, the ladder's rows under it like any board's */
.pvp-head {
  margin: 6px 0 12px; padding: 22px 20px; text-align: center; border-radius: calc(var(--radius) + 6px);
  background: var(--panel); border: 1px solid var(--line); animation: lb-rise .8s var(--out) backwards;
}
.pvp-head h2 { color: var(--cyan); }
.pvp-head p { max-width: 60ch; margin: 0 auto; color: var(--text); font-size: 14px; }
.lgn { display: block; margin-top: 1px; font: 700 13px var(--mono); color: var(--ink); animation: lb-fade .5s .5s backwards; }
.ladder .lgc { font: 700 11px var(--head); letter-spacing: .14em; }
.ladder .lg-mini { width: 22px; height: 22px; vertical-align: middle; margin: -3px 7px 0 0; }
.lg-bronze { color: var(--bronze); } .lg-silver { color: var(--silver); } .lg-gold { color: var(--gold); }
.lg-platinum { color: var(--platinum); }
.lg-void { background: linear-gradient(90deg, var(--cyan), var(--void), var(--pink));
           -webkit-background-clip: text; background-clip: text; color: transparent; }

/* a name that leads to a profile */
a.to { text-decoration: none; }
a.name.to:hover, a.pname.to:hover, a.pm-name.to:hover { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; }
a.acct.to { transition: background-color .2s; }
a.acct.to:hover { background-color: rgba(103, 232, 249, .16); }
.player .who .pname { color: var(--ink); }
.chip.prof { text-decoration: none; color: var(--cyan); }
.card.prof { display: block; text-decoration: none; color: inherit; }
.card.prof .v { font-size: 16px; color: var(--cyan); padding: 5px 0 3px; }

/* ------------------------------- a profile -------------------------------
   One account's page, after osu!'s: a header with a title bar, a cover
   (LB_ART.profileBanner), the emblem standing half over it beside the name,
   and the numbers under them; a bar of the page's sections held at the top
   as it scrolls; then the placements, the hangar and the podiums, and the
   PvP record with the latest matches laid out like osu!'s score rows. The
   same rounded panels as the rest, arriving one after another. */
.profile { margin-top: 6px; }
.toboards { display: inline-block; margin: 8px 0 10px; text-decoration: none;
            font: 600 11px var(--head); letter-spacing: .14em; color: var(--dim); }
.toboards:hover { color: var(--cyan); }
.phead {
  position: relative; overflow: hidden; border-radius: calc(var(--radius) + 6px);
  background: var(--panel); border: 1px solid var(--line); animation: lb-rise .8s var(--out) backwards;
}
.ptitle {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 20px;
  background: rgba(2, 6, 14, .7); border-bottom: 1px solid var(--line);
}
.ptitle b { font: 700 12px var(--head); letter-spacing: .2em; color: var(--ink); }
.ptitle b::before {
  content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 10px; vertical-align: 1px;
  border-radius: 2px; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); transform: rotate(45deg);
}
.ptitle span { font: 500 11px var(--mono); letter-spacing: .1em; color: var(--dim); }
.pcover { position: relative; height: 200px; }
.pbanner { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* the emblem stands half over the cover, the name beside it at the cover's foot */
.pdet {
  position: relative; z-index: 1; display: flex; align-items: flex-end; justify-content: space-between;
  flex-wrap: wrap; gap: 14px 24px; margin-top: -64px; padding: 0 24px 18px;
}
.pid { display: flex; align-items: flex-end; gap: 18px; min-width: 0; }
.pavatar { flex: none; width: 128px; height: 128px; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .55)); }
.pnm { min-width: 0; padding-bottom: 4px; }
.profile h2.pname {
  margin: 0; font: 700 clamp(26px, 5vw, 38px) var(--head); letter-spacing: .05em; color: var(--ink);
  line-height: 1.1; overflow-wrap: anywhere; text-shadow: 0 2px 14px rgba(0, 0, 0, .8);
  animation: lb-slide .6s .1s var(--out) backwards;
}
.psub {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 6px;
  font: 500 11px var(--mono); letter-spacing: .08em; color: var(--dim); animation: lb-fade .6s .25s backwards;
}
.psub .acct { margin: 0; }
.psub b { color: var(--text); }
.plg { display: flex; align-items: center; gap: 10px; padding-bottom: 4px; animation: lb-fade .6s .3s backwards; }
.plg-crest { width: 76px; height: 76px; }
.plg-t { display: grid; }
.plg-t b { font: 700 13px var(--head); letter-spacing: .2em; color: var(--ink); }
.plg-t strong { font: 700 28px var(--mono); line-height: 1.1; color: var(--ink); }
.plg-t span { font: 600 11px var(--mono); color: var(--dim); }

/* under the cover: the league's progress, the podiums counted, the best run */
.pinfo {
  display: grid; grid-template-columns: minmax(0, 1.2fr) auto minmax(0, 1.5fr); gap: 18px 30px; align-items: start;
  padding: 16px 24px 20px; background: rgba(2, 6, 14, .45); border-top: 1px solid var(--line);
}
.pk { display: block; margin-bottom: 8px; font: 700 10px var(--head); letter-spacing: .18em; color: var(--dim); }
.pprog { --acc: var(--cyan); --acc2: var(--cyan); }
.pprog.pp-bronze { --acc: var(--bronze); --acc2: #ffd6b0; }
.pprog.pp-silver { --acc: var(--silver); --acc2: #ffffff; }
.pprog.pp-gold { --acc: var(--gold); --acc2: #fff5c4; }
.pprog.pp-platinum { --acc: var(--platinum); --acc2: #effffe; }
.pprog.pp-void { --acc: var(--void); --acc2: var(--pink); }
.pp-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.pp-top b { font: 700 12px var(--head); letter-spacing: .18em; color: var(--acc); }
.pp-top span { font: 600 10px var(--head); letter-spacing: .14em; color: var(--dim); }
.pbar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.pbar i, .pwl i {
  display: block; height: 100%; width: var(--k); border-radius: inherit;
  animation: lb-grow 1.4s .5s var(--out) backwards;
}
.pbar i { background: linear-gradient(90deg, var(--acc), var(--acc2)); box-shadow: 0 0 12px var(--acc); }
.pprog.pp-void .pbar i { background: linear-gradient(90deg, var(--cyan), var(--void), var(--pink)); }
.pprog small { display: block; margin-top: 7px; font: 600 10px var(--mono); letter-spacing: .08em; color: var(--dim); }
.ppods-row { display: flex; gap: 14px; }
.ppod { display: flex; align-items: center; gap: 6px; }
.ppod-art { width: 28px; height: 28px; }
.ppod b { font: 700 15px var(--mono); color: var(--ink); }
.ppod b.zero { color: var(--faint); }
.pkv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 22px; }
.pkv div { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; border-bottom: 1px dashed rgba(103, 232, 249, .1); }
.pkv dt { font: 700 10px var(--head); letter-spacing: .14em; color: var(--dim); }
.pkv dd { font: 700 12px var(--mono); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* the sections' bar: osu!'s page tabs, held at the top while the page scrolls */
.pnav {
  position: sticky; top: 0; z-index: 5; display: flex; gap: 2px; margin: 12px 0 0; padding: 0 10px;
  overflow-x: auto; scrollbar-width: none; border-radius: var(--radius);
  background: rgba(5, 8, 16, .88); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); animation: lb-fade .6s .3s backwards;
}
.pnav::-webkit-scrollbar { display: none; }
.pnav button {
  position: relative; padding: 11px 14px 13px; background: none; border: 0; cursor: pointer; white-space: nowrap;
  font: 700 11px var(--head); letter-spacing: .16em; color: var(--dim); transition: color .2s;
}
.pnav button::after {
  content: ''; position: absolute; left: 12px; right: 12px; bottom: 0; height: 3px; border-radius: 3px;
  background: var(--pink); box-shadow: 0 0 10px rgba(244, 114, 182, .6);
  transform: scaleX(0); opacity: 0; transition: transform .45s var(--out), opacity .2s;
}
.pnav button:hover { color: var(--text); }
.pnav button[aria-current="true"] { color: var(--ink); }
.pnav button[aria-current="true"]::after { transform: none; opacity: 1; }
.psec, .pcard { scroll-margin-top: 56px; }

/* each section's title, osu!-style: big, with a short bar under it */
.psec h3, .pcard h3 {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 14px; padding-bottom: 8px;
  position: relative; font: 700 15px var(--head); letter-spacing: .18em; color: var(--ink);
}
.psec h3::after, .pcard h3::after {
  content: ''; position: absolute; left: 0; bottom: 0; width: 28px; height: 3px; border-radius: 3px; background: var(--cyan);
}
.psec h3 small, .pcard h3 small { font: 600 10px var(--mono); letter-spacing: .1em; color: var(--dim); }
.psec { margin-top: 20px; }
.psec h3 { margin-left: 4px; }

.pstats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.ptile {
  position: relative; overflow: hidden; text-align: left; min-height: 96px; padding: 13px 16px 16px;
  border-radius: calc(var(--radius) + 4px); background: var(--panel); border: 1px solid var(--line);
  transition: transform .4s var(--out), border-color .2s; animation: lb-rise .8s var(--out) backwards;
}
.pstats > :nth-child(2) { animation-delay: 60ms; } .pstats > :nth-child(3) { animation-delay: 120ms; }
.pstats > :nth-child(4) { animation-delay: 180ms; }
button.ptile { cursor: pointer; }
button.ptile:hover { border-color: var(--line-hi); transform: translateY(-2px); }
.ptile-art { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.phead > :not(.art), .ptile > :not(.art), .pmatch > :not(.art) { position: relative; z-index: 1; }
.ptile .k { font: 700 10px var(--head); letter-spacing: .16em; color: var(--dim); }
.ptile .v { margin-top: 4px; font: 700 28px var(--mono); line-height: 1.15; color: var(--ink); }
.ptile.none .v { padding: 8px 0 4px; font-size: 15px; color: var(--faint); }
.ptile .s { font: 500 11px var(--mono); color: var(--dim); }

.pgrid { display: grid; grid-template-columns: 3fr 2fr; gap: 10px; margin-top: 12px; }
.pcard {
  padding: 18px 20px 20px; border-radius: calc(var(--radius) + 4px); background: var(--panel);
  border: 1px solid var(--line); animation: lb-rise .8s .2s var(--out) backwards;
}
.pcard h4 { margin: 20px 0 10px; font: 700 10px var(--head); letter-spacing: .18em; color: var(--dim); }
.pnone { color: var(--dim); font-size: 13px; }
.ppilots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ppilot { text-align: center; }
.pbadge { display: block; width: 84px; height: 84px; margin: 0 auto 6px; }
.ppilot figcaption { font: 700 11px var(--head); letter-spacing: .08em; color: var(--ink); }
.ppilot small { font: 600 9px var(--mono); letter-spacing: .12em; color: var(--cyan); }
.ppilot.awake small { color: var(--pink); }
.ppilot.locked figcaption, .ppilot.locked small { color: var(--faint); }
/* the podiums, a grid of medals the way osu! hangs its own */
.pawards { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 12px 8px; }
.pawards li { display: grid; justify-items: center; text-align: center; }
.paward { width: 64px; height: 64px; margin-bottom: 4px; }
.pawards b { font: 700 11px var(--head); letter-spacing: .1em; color: var(--ink); }
.pawards span { font: 600 11px var(--mono); color: var(--dim); }

.ppvp { margin-top: 12px; animation-delay: .3s; }
.precord { display: flex; flex-wrap: wrap; gap: 10px 32px; }
.pnum b { display: block; font: 700 24px var(--mono); color: var(--ink); }
.pnum span { font: 700 10px var(--head); letter-spacing: .16em; color: var(--dim); }
.pwl { height: 6px; margin-top: 14px; border-radius: 99px; overflow: hidden; background: rgba(248, 113, 113, .75); }
.pwl i { background: #4ade80; box-shadow: 2px 0 0 #05060a; }
.pmatches { list-style: none; display: grid; gap: 5px; }
/* a match: the result's plate (72 px) and the score's panel (84 px) are
   LB_ART.matchRow's; the rest sits between them */
.pmatch {
  position: relative; overflow: hidden; display: grid; align-items: center; gap: 0 14px;
  grid-template-columns: 72px minmax(0, 1fr) auto 84px; min-height: 54px;
  border-radius: var(--radius); background: var(--row); font-size: 13px; transition: background-color .2s;
  animation: lb-rise .7s var(--out) backwards; animation-delay: calc(.35s + min(var(--i, 0), 10) * 45ms);
}
.pmatch:hover { background: var(--row-hi); }
.pmatch-art { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.pm-res { display: grid; justify-items: center; padding-right: 6px; color: #05060a; }
.pm-res b { font: 700 14px var(--head); letter-spacing: .1em; }
.pm-res small { font: 700 8px var(--head); letter-spacing: .12em; opacity: .75; }
.pmatch.nc .pm-res { color: #e2e8f0; }
.pm-vs { display: grid; min-width: 0; }
.pm-who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-who i { font: 600 10px var(--head); font-style: normal; letter-spacing: .12em; color: var(--dim); }
.pm-name { font: 700 14px var(--mono); color: var(--ink); }
.pm-vs small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 10px var(--mono); letter-spacing: .08em; color: var(--dim); }
.pm-meta span + span::before { content: ' · '; }
.pm-pilots { display: flex; align-items: center; gap: 8px; }
.pm-pilots > i { font: 700 9px var(--head); font-style: normal; letter-spacing: .12em; color: var(--faint); }
.pm-pilot { display: flex; align-items: center; gap: 6px; }
.pm-badge { width: 30px; height: 30px; flex: none; }
.pm-pilot small { font: 600 10px var(--head); letter-spacing: .1em; color: var(--text); }
.pm-score { text-align: center; padding-left: 10px; font: 700 17px var(--mono); color: var(--ink); }

@keyframes lb-grow { from { width: 0; } }
@media (max-width: 860px) {
  .pinfo { grid-template-columns: minmax(0, 1fr) auto; }
  .pbest { grid-column: 1 / -1; }
  .pkv { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pm-pilot small { display: none; }
}
@media (max-width: 760px) {
  .pstats { grid-template-columns: repeat(2, 1fr); }
  .pgrid { grid-template-columns: 1fr; }
}

footer {
  max-width: 980px; margin: 0 auto; padding: 0 16px 28px; display: flex; justify-content: space-between;
  gap: 12px; font-size: 12px; color: var(--faint);
}

/* ------------------------------ the art's places ------------------------------
   Where the canvases of art.js sit and how big they are. What is drawn in
   them is art.js's business. */
.art-bg { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: -1; pointer-events: none; }
.crest-slot .crest { display: block; width: 140px; height: 96px; margin: 2px auto -10px; }
.podium { margin: 4px 0 12px; }
.podium-art { display: block; width: 100%; height: 220px; }
.board td.r .medal { width: 24px; height: 24px; vertical-align: middle; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.card { position: relative; overflow: hidden; }
.card > :not(.art) { position: relative; z-index: 1; }
.card-art { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.note .empty-art { display: block; width: 160px; height: 90px; margin: 0 auto 10px; }
#pvpArt .empty-art { display: block; width: 160px; height: 90px; margin: 0 auto 8px; }
.leagues { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 18px; margin-top: 20px; }
.leagues figure { text-align: center; }
.leagues .league { display: block; width: 76px; height: 76px; margin: 0 auto 6px; }
.leagues figcaption { font: 700 10px var(--head); letter-spacing: .18em; color: var(--dim); animation: lb-fade .5s backwards; }
/* each league's name in its own metal, arriving with its crest */
.leagues figure:nth-child(1) figcaption { color: var(--bronze); animation-delay: .25s; }
.leagues figure:nth-child(2) figcaption { color: var(--silver); animation-delay: .34s; }
.leagues figure:nth-child(3) figcaption { color: var(--gold); animation-delay: .43s; }
.leagues figure:nth-child(4) figcaption { color: var(--platinum); animation-delay: .52s; }
.leagues figure:nth-child(5) figcaption {
  animation-delay: .61s; background: linear-gradient(90deg, var(--cyan), var(--void), var(--pink));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* the rows: brighter under the pointer, the podium places washed in their
   metal, the row you jumped to in cyan (osu! marks your own score the same
   way), each of those with a bar of its colour down the left. --cell is the
   row's colour, --accent the bar's. The bar is a background, not an inset
   shadow: on a fraction of a pixel an inset shadow leaves a hairline down
   the far side of its cell. */
.board tr.p1 { --cell: color-mix(in srgb, var(--gold) 9%, var(--row)); --accent: var(--gold); }
.board tr.p2 { --cell: color-mix(in srgb, var(--silver) 7%, var(--row)); --accent: var(--silver); }
.board tr.p3 { --cell: color-mix(in srgb, var(--bronze) 9%, var(--row)); --accent: var(--bronze); }
.board tr.mark { --cell: color-mix(in srgb, var(--cyan) 16%, var(--row)); --accent: var(--cyan); }
.board tbody tr:hover { --cell: var(--row-hi); }
@supports not (color: color-mix(in srgb, red, blue)) {
  .board tr.p1, .board tr.p2, .board tr.p3, .board tr.mark { --cell: var(--row); }
}
.board tr.p1 td:first-child, .board tr.p2 td:first-child, .board tr.p3 td:first-child, .board tr.mark td:first-child {
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 3px 100%; background-repeat: no-repeat;
}

/* a new page comes in the way osu!'s leaderboard does: each row rises into
   place a beat after the one above it (--i is its place on the page, set by
   leaderboard.js), its name slides in from the right just behind it, and its
   numbers fade up last */
@keyframes lb-rise { from { opacity: 0; transform: translateY(24px); } }
@keyframes lb-slide { from { opacity: 0; transform: translateX(40px); } }
@keyframes lb-fade { from { opacity: 0; } }
@keyframes lb-ink { from { color: transparent; } }
.board tbody tr { --d: calc(min(var(--i, 0), 18) * 45ms); }
.board tbody td { animation: lb-rise .8s var(--out) backwards; animation-delay: var(--d); }
.board tbody td .name { display: inline-block; }      /* so it can slide; .acct already is a box */
.board tbody td .name, .board tbody td .acct {
  animation: lb-slide .5s var(--out) backwards; animation-delay: calc(var(--d) + 100ms);
}
.board tbody td.n, .board tbody td.opt {
  animation: lb-rise .8s var(--out) backwards, lb-ink .35s linear backwards;
  animation-delay: var(--d), calc(var(--d) + 320ms);
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* a narrow window: the date goes first, and each row's panel ends at the time */
@media (max-width: 860px) {
  .board th:nth-child(9), .board td:nth-child(9) { display: none; }
  .board td:nth-child(8) { border-radius: 0 var(--radius) var(--radius) 0; box-shadow: none; }
}

/* a phone: the columns that matter, and the rest out of the way */
@media (max-width: 640px) {
  .opt { display: none; }
  .back { position: static; display: inline-block; }
  h1 { margin-top: 10px; }
  .board td, .board th { padding-left: 8px; padding-right: 8px; }
  /* the wave is the last column showing: the row's panel ends there */
  .board td:nth-child(4) { border-radius: 0 var(--radius) var(--radius) 0; box-shadow: none; }
  .board .r { width: 40px; }
  .acct { display: block; margin: 2px 0 0; width: max-content; }
  footer { flex-direction: column; }
  /* the three placements side by side, small, rather than a column of cards */
  .cards { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .card { padding: 9px 8px; }
  .card .k { font-size: 8px; letter-spacing: .1em; }
  .card .v { font-size: 18px; }
  .card .v small { display: block; font-size: 10px; }
  .card .s { display: none; }
  .card.none .v { font-size: 11px; }
  .podium-art { height: 190px; }
  .tabs { gap: 0; }
  .tabs button { padding: 10px 10px; letter-spacing: .1em; flex: 1; }
  /* a profile on a phone: a shorter cover, the emblem smaller, the matches to what counts */
  .ptitle { padding: 9px 14px; }
  .pcover { height: 130px; }
  .pdet { margin-top: -44px; padding: 0 16px 14px; }
  .pid { gap: 12px; }
  .pavatar { width: 88px; height: 88px; }
  .plg-crest { width: 56px; height: 56px; }
  .plg-t strong { font-size: 22px; }
  .pinfo { grid-template-columns: 1fr; padding: 14px 16px 16px; }
  .pkv { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pnav { padding: 0 4px; }
  .pnav button { flex: 1; padding: 10px 8px 12px; letter-spacing: .1em; }
  .ptile .v { font-size: 22px; }
  .pbadge { width: 64px; height: 64px; }
  .pcard { padding: 16px 14px; }
  .pmatch { grid-template-columns: 72px minmax(0, 1fr) 84px; }
  .pm-pilots, .pm-bo { display: none; }
}

/* ----------------------------- THE LOOKS ---------------------------------
   A profile's decals in a row under its name, and CUSTOMIZE: the panel a
   signed-in player changes their own banner, picture and decals in. */
.pdecals { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pdecal { display: block; width: 40px; height: 40px; cursor: help; }
.pdecal-art { display: block; width: 100%; height: 100%; }
.pedit {
  margin-left: auto; padding: 6px 12px; border-radius: 8px; cursor: pointer;
  background: rgba(103, 232, 249, .08); border: 1px solid var(--line-hi); color: var(--cyan);
  font: 700 11px var(--head); letter-spacing: .16em; transition: background .2s, transform .2s var(--out);
}
.pedit:hover { background: rgba(103, 232, 249, .18); transform: translateY(-1px); }
.pedit:focus-visible, .looktile:focus-visible, .lookbtn:focus-visible, .lookx:focus-visible, .looktabs button:focus-visible {
  outline: 2px solid var(--cyan); outline-offset: 2px;
}
html.lookopen { overflow: hidden; }
.lookdlg {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px;
  background: rgba(2, 4, 9, .72); backdrop-filter: blur(4px); animation: lb-fade .25s var(--out) backwards;
}
.lookbox {
  width: min(880px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line); border-radius: calc(var(--radius) + 6px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .6); animation: lb-rise .4s var(--out) backwards;
}
.lookhead {
  display: flex; align-items: center; justify-content: space-between; padding: 12px 18px;
  background: rgba(2, 6, 14, .7); border-bottom: 1px solid var(--line);
}
.lookhead b { font: 700 12px var(--head); letter-spacing: .2em; color: var(--ink); }
.lookx { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: none; cursor: pointer; font: 400 20px/1 var(--head); color: var(--dim); }
.lookx:hover { color: var(--ink); border-color: var(--line-hi); }
.lookprev { position: relative; flex: none; height: 150px; overflow: hidden; border-bottom: 1px solid var(--line); }
.lookprev-banner { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.lookprev-row { position: absolute; left: 18px; bottom: 12px; display: flex; align-items: flex-end; gap: 14px; }
.lookprev-avatar { width: 84px; height: 84px; display: block; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .55)); }
.lookprev-name b { font: 700 22px var(--head); letter-spacing: .05em; color: var(--ink); text-shadow: 0 2px 12px rgba(0, 0, 0, .8); }
.lookprev-name .pdecals { margin-top: 4px; }
.lookprev-name .pdecal { width: 32px; height: 32px; }
.looktabs { flex: none; display: flex; gap: 2px; padding: 0 12px; border-bottom: 1px solid var(--line); }
.looktabs button {
  position: relative; padding: 10px 14px 12px; background: none; border: 0; cursor: pointer;
  font: 700 12px var(--head); letter-spacing: .16em; color: var(--dim);
}
.looktabs button small { font: 600 10px var(--mono); letter-spacing: 0; color: var(--faint); }
.looktabs button[aria-pressed="true"] { color: var(--ink); }
.looktabs button[aria-pressed="true"]::after {
  content: ''; position: absolute; left: 10px; right: 10px; bottom: 0; height: 3px; border-radius: 3px;
  background: var(--cyan); box-shadow: 0 0 10px rgba(103, 232, 249, .6);
}
.lookgrid {
  flex: 1; overflow-y: auto; padding: 14px 18px 18px; display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start;
}
.lookgrid.banner { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.lookgrid.decal { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.looknote { grid-column: 1 / -1; font: 600 10px var(--mono); letter-spacing: .12em; color: var(--dim); }
.looktile {
  position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 8px;
  border-radius: var(--radius); background: var(--row); border: 1px solid var(--line); cursor: pointer; text-align: left;
  transition: border-color .2s, transform .2s var(--out), background .2s;
}
.looktile:hover { border-color: var(--line-hi); transform: translateY(-2px); }
.looktile.on { border-color: var(--cyan); background: var(--row-hi); box-shadow: 0 0 0 1px var(--cyan), 0 0 18px rgba(103, 232, 249, .25); }
.looktile.locked { cursor: not-allowed; }
.looktile.locked .looktile-art { filter: grayscale(1) brightness(.45); }
.looktile.locked:hover { transform: none; border-color: var(--line); }
.looktile-art { display: block; width: 100%; aspect-ratio: 1; border-radius: 8px; }
.lookgrid.banner .looktile-art { aspect-ratio: 3 / 1; }
.lookgrid.decal .looktile { flex-direction: row; align-items: center; }
.lookgrid.decal .looktile-art { width: 44px; flex: none; }
.looktx { display: flex; flex-direction: column; min-width: 0; }
.looktx b { font: 700 12px var(--head); letter-spacing: .12em; color: var(--ink); }
.looktx small { font: 500 10px var(--mono); letter-spacing: .04em; color: var(--dim); }
.looktile.locked .looktx b { color: var(--dim); }
.looktile.locked .looktx small::before { content: '🔒 '; }
.looknum {
  position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  background: var(--cyan); color: #04121a; font: 700 11px var(--mono); font-style: normal;
}
/* (the page's own footer rule is not this one's: no max width, no margin, a row on a phone too) */
.lookfoot { flex: none; display: flex; flex-direction: row; align-items: center; gap: 8px; max-width: none; margin: 0; padding: 12px 18px;
  border-top: 1px solid var(--line); background: rgba(2, 6, 14, .5); font-size: inherit; color: inherit; }
.lookmsg { flex: 1; min-width: 0; font: 600 11px var(--mono); letter-spacing: .06em; color: var(--pink); }
.lookbtn {
  padding: 9px 16px; border-radius: 8px; cursor: pointer; border: 1px solid var(--line); background: none;
  font: 700 11px var(--head); letter-spacing: .16em; color: var(--text);
}
.lookbtn:hover { border-color: var(--line-hi); color: var(--ink); }
.lookbtn.go { background: var(--cyan); border-color: var(--cyan); color: #04121a; }
.lookbtn.go:hover { filter: brightness(1.1); }
.lookbtn[disabled] { opacity: .5; cursor: wait; }
a.lookbtn { display: inline-block; text-decoration: none; }
.lookbtn.small { padding: 7px 12px; font-size: 10px; }
/* the supporter strip (the Patreon link): gold for a supporter, pink for news that isn't good */
.lookpat {
  flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 18px;
  border-bottom: 1px solid var(--line); background: rgba(251, 191, 36, .05);
}
.lookpat-tx { flex: 1 1 260px; min-width: 0; font: 600 11px var(--mono); letter-spacing: .06em; color: var(--text); }
.lookpat.good .lookpat-tx { color: var(--gold); }
.lookpat.bad .lookpat-tx { color: var(--pink); }
.lookpat-where { font: 600 10px var(--mono); letter-spacing: .08em; color: var(--dim); }
.lookbtn.pat { border-color: rgba(251, 191, 36, .6); color: var(--gold); }
.lookbtn.pat:hover { background: rgba(251, 191, 36, .12); color: var(--gold); }
/* a word back from Patreon where there is no panel to say it in */
.lbtoast {
  position: fixed; left: 16px; right: 16px; bottom: 20px; z-index: 60; width: fit-content; max-width: 560px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px;
  background: var(--panel); border: 1px solid var(--line-hi); border-radius: var(--radius); box-shadow: 0 16px 40px rgba(0, 0, 0, .6);
  font: 600 11px var(--mono); letter-spacing: .06em; color: var(--ink); animation: lb-rise .4s var(--out) backwards;
}
.lbtoast.good { color: var(--gold); border-color: rgba(251, 191, 36, .6); }
.lbtoast.bad { color: var(--pink); border-color: rgba(244, 114, 182, .5); }
.lbtoast-x { flex: none; width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--line); background: none; cursor: pointer;
  font: 400 18px/1 var(--head); color: var(--dim); }
.lbtoast-x:hover { color: var(--ink); border-color: var(--line-hi); }
.lbtoast-x:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
@keyframes lb-fade { from { opacity: 0; } }
@media (max-width: 640px) {
  .pdecal { width: 34px; height: 34px; }
  .lookdlg { padding: 0; place-items: stretch; }
  .lookbox { max-height: 100vh; height: 100%; border-radius: 0; }
  .lookprev { height: 110px; }
  .lookprev-avatar { width: 64px; height: 64px; }
  .lookprev-name b { font-size: 18px; }
  .looktabs { padding: 0 4px; }
  .looktabs button { flex: 1; padding: 10px 6px 12px; letter-spacing: .08em; }
  .lookgrid { padding: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lookgrid.banner, .lookgrid.decal { grid-template-columns: 1fr; }
  .lookpat { padding: 10px 12px; }
  .lbtoast { bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .lookdlg, .lookbox, .lbtoast { animation: none; }
  .looktile, .pedit { transition: none; }
}
