/* Served from here so viewers' browsers don't contact Google. Licences are in public/fonts. */
@font-face { font-family: "Pixelify Sans"; font-weight: 500 600; font-display: swap; src: url(/static/fonts/pixelify-sans-v3-cyrillic.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Pixelify Sans"; font-weight: 500 600; font-display: swap; src: url(/static/fonts/pixelify-sans-v3-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Pixelify Sans"; font-weight: 500 600; font-display: swap; src: url(/static/fonts/pixelify-sans-v3-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Schibsted Grotesk"; font-weight: 400 700; font-display: swap; src: url(/static/fonts/schibsted-grotesk-v7-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Schibsted Grotesk"; font-weight: 400 700; font-display: swap; src: url(/static/fonts/schibsted-grotesk-v7-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Leaderboards. Same dusk palette and type as the staff and production sites. */
:root {
  --bg: #f4f2fa; --panel: #ffffff; --raised: #faf9fd; --sunken: #ece8f6; --line: #e3ddf0; --line-strong: #cfc6e4;
  --text: #1c1631; --muted: #665f80; --accent: #c2410c; --accent-hover: #9a3412; --link: #b13b0b;
  --s-m: #c2410c; --s-v: #2257d6; --s-d: #008573;
  --gold: #a16207; --silver: #5f6880; --bronze: #9a5a1f;
  --cap-gold: #e6b325; --cap-silver: #b4bccd; --cap-bronze: #c4813f; --cap: #8a7cc0;
  --pillar: #4a3d78; --course: rgb(0 0 0 / .16); --rim: rgb(255 196 150 / .75);
  --ground: #ffffff; --sun: #ffb14e;
  --sky: linear-gradient(180deg, #f4f2fa 0 14%, #f0eaf8 14% 28%, #eee1f3 28% 42%, #f1d8ea 42% 56%, #f6d0dc 56% 67%, #f9c8c6 67% 77%, #fbbea9 77% 85%, #fdb189 85% 92%, #ffa368 92% 97%, #ff9650 97% 100%);
  --shadow: 0 1px 2px rgb(28 22 49 / .06), 0 12px 32px -18px rgb(28 22 49 / .3);
  --ui: "Schibsted Grotesk", system-ui, sans-serif;
  --display: "Pixelify Sans", var(--ui);
  --wrap: 1120px;
  --gutter: clamp(16px, 3vw, 28px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15112a; --panel: #1b1634; --raised: #211b3e; --sunken: #120e25; --line: #2d2650; --line-strong: #3d3468;
    --text: #f1ecff; --muted: #a69dc8; --accent: #ff8a3d; --accent-hover: #ffa262; --link: #ffb07a;
    --s-m: #e96a14; --s-v: #5f8bf0; --s-d: #0fa896;
    --gold: #f2c14e; --silver: #c9d0e0; --bronze: #e0a070;
    --cap-gold: #f2c14e; --cap-silver: #c9d0e0; --cap-bronze: #d08a4e; --cap: #6a5cab;
    --pillar: #2e2558; --course: rgb(0 0 0 / .24); --rim: rgb(255 160 90 / .6);
    --ground: #120e25; --sun: #ffc75f;
    --sky: linear-gradient(180deg, #15112a 0 14%, #1c1538 14% 28%, #281a4a 28% 42%, #3a1f59 42% 56%, #57265f 56% 67%, #7f2f5e 67% 77%, #ad3f52 77% 85%, #d95a3f 85% 92%, #f58434 92% 97%, #ffb14e 97% 100%);
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 16px 36px -20px rgb(0 0 0 / .7);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 400 15px/1.5 var(--ui); }
a { color: var(--link); text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.loading { padding: 80px 16px; text-align: center; color: var(--muted); }
.muted { margin: 6px 0 0; color: var(--muted); font-size: .88rem; }

/* ---- header and tabs ---- */
.top { max-width: var(--wrap); margin: 0 auto; padding: 20px var(--gutter) 8px; }
.top-link { display: inline-flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; }
.top-icon { width: 48px; height: 48px; border-radius: 12px; flex: none; background: var(--sunken); }
.top-text { display: flex; flex-direction: column; min-width: 0; }
.top-name { font: 600 1.75rem/1.15 var(--display); }
.top-sub { color: var(--muted); }

.tabs { position: sticky; top: 0; z-index: 5; background: var(--bg); box-shadow: 0 1px 0 var(--line); }
.tabs-inner { display: flex; max-width: var(--wrap); margin: 0 auto; padding: 0 calc(var(--gutter) - 10px); overflow-x: auto; scrollbar-width: none; }
.tabs-inner::-webkit-scrollbar { display: none; }
.tab { flex: none; padding: 11px 10px; color: var(--muted); font-weight: 500; text-decoration: none; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab[aria-current] { color: var(--text); font-weight: 600; box-shadow: inset 0 -3px 0 var(--accent); }
.tab:focus-visible { outline-offset: -2px; }
.tab-stats { margin-left: auto; }

/* ---- the skyline: the top ten stand on the horizon ---- */
.skyline { position: relative; --sky-h: clamp(240px, 38vh, 380px); background: var(--ground); }
.sky { position: absolute; inset: 0 0 auto; height: var(--sky-h); overflow: hidden; background: var(--sky); }
/* Centred in the free sky right of the pillars on wide screens, behind the shortest ones otherwise. */
.sun { position: absolute; bottom: 0; right: max(16px, calc((100vw - var(--wrap)) / 4 - 120px)); width: clamp(112px, 14vw, 240px); height: auto; fill: var(--sun); }
.cols { position: relative; display: flex; gap: clamp(4px, .8vw, 10px); max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; color: inherit; text-decoration: none; }
.col:focus-visible { outline-offset: -2px; }
.col-sky { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: var(--sky-h); padding-top: 12px; }
.col-head { flex: none; display: flex; height: clamp(40px, 5vw, 54px); align-items: flex-end; }
.col-avatar { display: block; width: clamp(34px, 4.4vw, 48px); height: clamp(34px, 4.4vw, 48px); margin-bottom: 6px; border-radius: 9px; background: var(--sunken); }
.col-bar {
  display: block; flex: none; width: 100%; min-height: 12px;
  height: calc((100% - clamp(40px, 5vw, 54px)) * var(--h, 0));
  border-top: 8px solid var(--cap);
  background: repeating-linear-gradient(to top, transparent 0 15px, var(--course) 15px 16px), var(--pillar);
  box-shadow: inset -3px 0 0 var(--rim);
  transition: height .45s cubic-bezier(.2, .8, .2, 1);
}
.col.rank-1 .col-bar { border-top-color: var(--cap-gold); }
.col.rank-2 .col-bar { border-top-color: var(--cap-silver); }
.col.rank-3 .col-bar { border-top-color: var(--cap-bronze); }
.col.is-empty .col-bar { min-height: 0; border-top-width: 0; box-shadow: none; background: none; }
.col[href]:hover .col-bar { filter: brightness(1.18); }
.col[href]:hover .col-name { text-decoration: underline; }
.col-ground { display: flex; flex-direction: column; align-items: center; min-height: 86px; padding: 10px 1px 14px; text-align: center; }
.col-rank { font-size: 1.05rem; font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; }
.col.rank-1 .col-rank { color: var(--gold); }
.col.rank-2 .col-rank { color: var(--silver); }
.col.rank-3 .col-rank { color: var(--bronze); }
.col-name { max-width: 100%; overflow: hidden; font-size: .86rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.col-value { font-size: .84rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.col-value b { font-weight: 600; }
.col-value small { color: var(--muted); font-size: .76rem; }
.sky-note { position: absolute; inset: calc(var(--sky-h) / 2 - 12px) 0 auto; margin: 0; text-align: center; font-weight: 600; }

.boost { max-width: var(--wrap); margin: 16px auto 0; padding: 0 var(--gutter); color: var(--accent); font-weight: 600; }

/* ---- numbers ---- */
.numbers { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; max-width: var(--wrap); margin: 22px auto 26px; padding: 0 var(--gutter); }
.numbers-wide { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.number { display: flex; flex-direction: column-reverse; justify-content: flex-end; min-width: 0; }
.number dt { color: var(--muted); font-size: .85rem; }
.number dd { margin: 0; font-size: 1.5rem; font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; }

/* ---- the list ---- */
.board { max-width: var(--wrap); margin: 0 auto 36px; padding: 0 var(--gutter); }
.board-bar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin-bottom: 12px; }
.board-title { margin: 0; font: 600 1.6rem/1.2 var(--display); }
.board-note { margin: 2px 0 0; color: var(--muted); font-size: .9rem; }
.find { width: min(100%, 260px); padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel); color: var(--text); font: inherit; }
.find::placeholder { color: var(--muted); }

.list-head, .row { display: grid; align-items: center; column-gap: 12px; grid-template-columns: 52px minmax(0, 1fr) 130px; }
.list-head[data-extras="1"], .row[data-extras="1"] { grid-template-columns: 52px minmax(0, 1fr) 108px 130px; }
.list-head[data-extras="2"], .row[data-extras="2"] { grid-template-columns: 52px minmax(0, 1fr) repeat(2, 108px) 130px; }
.list-head[data-extras="3"], .row[data-extras="3"] { grid-template-columns: 52px minmax(0, 1fr) repeat(3, 108px) 130px; }
.list-head { padding: 0 12px 6px; color: var(--muted); font-size: .82rem; }
.rows { margin: 0; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); list-style: none; }
.rows-empty { padding: 28px 16px; color: var(--muted); text-align: center; }
.rows > li + li { border-top: 1px solid var(--line); }
.row { position: relative; padding: 9px 12px 10px; color: inherit; text-decoration: none; }
.row:hover { background: var(--raised); }
.row:hover .row-name { text-decoration: underline; }
.row:focus-visible { outline-offset: -2px; }
.cell-rank { text-align: center; }
.row .cell-rank { font-size: 1rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.row.rank-1 .cell-rank { color: var(--gold); }
.row.rank-2 .cell-rank { color: var(--silver); }
.row.rank-3 .cell-rank { color: var(--bronze); }
.cell-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.row-avatar { flex: none; width: 36px; height: 36px; border-radius: 8px; background: var(--sunken); }
.row-names { display: flex; flex-direction: column; min-width: 0; }
.row-name { overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { display: none; overflow: hidden; color: var(--muted); font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.cell-extra, .cell-value { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row .cell-extra { color: var(--muted); font-size: .92rem; }
.row .cell-value b { font-size: 1.02rem; font-weight: 700; }
.row .cell-value small { color: var(--muted); font-size: .78rem; }
.meter { position: absolute; inset: auto 0 0; height: 2px; }
.meter i { display: block; height: 100%; background: var(--accent); opacity: .4; }
.more { display: block; margin: 14px auto 0; padding: 9px 18px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.more:hover { background: var(--raised); }

/* ---- stats and member pages ---- */
.stats-view, .member-view { max-width: var(--wrap); margin: 0 auto; padding: 22px var(--gutter) 36px; }
.stats-view .numbers, .member-view .numbers { margin: 0 0 22px; padding: 0; }
.stats-view .boost { margin: 0 0 14px; padding: 0; }
.stats-title { margin: 0 0 18px; font: 600 1.75rem/1.2 var(--display); }
.stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.span-2 { grid-column: span 2; }
.stack { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.stack > .panel:last-child { flex: 1; }
.panel { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.panel h2 { margin: 0 0 12px; font-size: 1rem; font-weight: 650; }

.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 8px; color: var(--muted); font-size: .85rem; }
.legend-item { display: inline-flex; align-items: center; }
.swatch { flex: none; display: inline-block; width: 10px; height: 10px; margin-right: 7px; border-radius: 2px; }
.s-m { fill: var(--s-m); background: var(--s-m); }
.s-v { fill: var(--s-v); background: var(--s-v); }
.s-d { fill: var(--s-d); background: var(--s-d); }
.chart { min-height: 40px; }
.chart-svg { display: block; touch-action: pan-y; }
.grid { stroke: var(--line); stroke-width: 1; }
.axis { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.lift { fill: transparent; }
.lift.on { fill: var(--sunken); }
.chart-table { margin-top: 8px; font-size: .88rem; }
.chart-table summary { width: fit-content; color: var(--muted); cursor: pointer; }
.table-wrap { max-height: 260px; margin-top: 6px; overflow: auto; }
.chart-table table { width: 100%; border-collapse: collapse; }
.chart-table th, .chart-table td { padding: 5px 8px; border-bottom: 1px solid var(--line); font-weight: 400; text-align: left; }
.chart-table th { color: var(--muted); }
.chart-table .num { text-align: right; font-variant-numeric: tabular-nums; }

.tip { position: fixed; z-index: 20; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--raised); box-shadow: var(--shadow); font-size: .85rem; pointer-events: none; }
.tip-title { margin-bottom: 3px; color: var(--muted); }
.tip-line { display: flex; align-items: center; gap: 7px; }
.tip-line b { font-variant-numeric: tabular-nums; }
.tip-line span:last-child { color: var(--muted); }
.tip-key { flex: none; width: 12px; height: 2px; border-radius: 1px; }

.hbars { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: .88rem; }
.hbar { display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: center; gap: 10px; }
.hbar-label { color: var(--muted); white-space: nowrap; }
.hbar-track { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hbar-fill { flex: none; height: 14px; border-radius: 0 4px 4px 0; background: var(--s-m); }
.hbar-value { font-variant-numeric: tabular-nums; }

.source-bar { display: flex; gap: 2px; height: 16px; overflow: hidden; border-radius: 4px; }
.source-bar span { flex: 1 1 0; min-width: 2px; }
.source-list { display: grid; gap: 6px; margin: 12px 0 0; padding: 0; font-size: .9rem; list-style: none; }
.source-list li { display: flex; align-items: center; }
.source-name { flex: 1; min-width: 0; }
.source-value { font-variant-numeric: tabular-nums; }
.source-share { width: 44px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }

.records { margin: 0; padding: 0; list-style: none; }
.record { display: grid; grid-template-columns: 136px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 0; font-size: .92rem; }
.record + .record { border-top: 1px solid var(--line); }
.record-label { color: var(--muted); }
.record-who { display: flex; align-items: center; gap: 8px; min-width: 0; color: inherit; font-weight: 600; text-decoration: none; }
a.record-who:hover span { text-decoration: underline; }
.record-who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.record-avatar { flex: none; width: 24px; height: 24px; border-radius: 6px; background: var(--sunken); }
.record-value { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }

.back { display: inline-block; margin-bottom: 16px; }
.member-head { display: flex; align-items: center; gap: 20px; margin-bottom: 22px; }
.member-avatar { flex: none; width: 104px; height: 104px; border-radius: 16px; background: var(--sunken); }
.member-title { flex: 1; min-width: 0; }
.member-title h1 { margin: 0; font-size: 1.9rem; font-weight: 700; line-height: 1.15; overflow-wrap: anywhere; }
.member-level { margin: 4px 0 6px; font-weight: 600; }
.level-track { max-width: 420px; height: 10px; overflow: hidden; border-radius: 3px; background: var(--sunken); }
.level-fill { display: block; height: 100%; background: var(--accent); }
.rank-rows { margin: 0; padding: 0; list-style: none; }
.rank-rows > li + li { border-top: 1px solid var(--line); }
.rank-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 60px; align-items: center; gap: 10px; padding: 8px 0; color: inherit; text-decoration: none; }
.rank-row:hover .rank-board { text-decoration: underline; }
.rank-value { color: var(--muted); font-size: .92rem; font-variant-numeric: tabular-nums; }
.rank-pos { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.rank-pos.rank-1 { color: var(--gold); }
.rank-pos.rank-2 { color: var(--silver); }
.rank-pos.rank-3 { color: var(--bronze); }

.foot { max-width: var(--wrap); margin: 0 auto; padding: 16px var(--gutter) 28px; color: var(--muted); font-size: .82rem; }
.foot p { margin: 0 0 2px; }

/* ---- smaller screens ---- */
/* Without free sky beside the pillars the sun only shows as slivers in the gaps. */
@media (max-width: 1200px) {
  .sun { display: none; }
}
@media (max-width: 1000px) {
  .col:nth-child(n + 8) { display: none; }
  .list-head[data-extras="1"], .row[data-extras="1"] { grid-template-columns: 44px minmax(0, 1fr) 84px 110px; }
  .list-head[data-extras="2"], .row[data-extras="2"] { grid-template-columns: 44px minmax(0, 1fr) repeat(2, 84px) 110px; }
  .list-head[data-extras="3"], .row[data-extras="3"] { grid-template-columns: 44px minmax(0, 1fr) repeat(3, 84px) 110px; }
  .numbers { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .numbers-wide { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}
@media (max-width: 760px) {
  .list-head { display: none; }
  .row, .row[data-extras] { grid-template-columns: 38px minmax(0, 1fr) auto; column-gap: 8px; padding-inline: 8px 12px; }
  .row .cell-extra { display: none; }
  .row-sub { display: block; }
  .stats-grid { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
}
@media (max-width: 640px) {
  .col:nth-child(n + 6) { display: none; }
  .col-value small { display: none; }
  .top-name { font-size: 1.45rem; }
  .number dd { font-size: 1.25rem; }
  .board-bar { display: block; }
  .find { display: block; width: 100%; margin-top: 10px; font-size: 16px; }
  .member-head { gap: 14px; }
  .member-avatar { width: 72px; height: 72px; border-radius: 12px; }
  .member-title h1 { font-size: 1.55rem; }
  .record { grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; }
  .record-label { grid-column: 1 / -1; font-size: .82rem; }
  .panel { padding: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .col-bar { transition: none; }
}
