/* New School 99: the hiscores page. Tokens, the podium stage, lanes, finder and windows come from ns.css. */

/* ---------- the top: title over the dusk still the home page already fetched ---------- */
/* No stacking context on .hs-top (no isolation, no z-index): the finder's list (z-index 30) has to open above the
   sticky rack (20) and the panels below. The still stays behind the words by order: it is painted first, and
   .hs-top-in is positioned so it is painted after it. */
.hs-top { position: relative; padding: clamp(34px, 5vw, 64px) 0 26px; }
.hs-top::before { content: ""; position: absolute; inset: calc(-1 * var(--nav-h)) 0 -120px; pointer-events: none;
  background: linear-gradient(180deg, rgba(10,19,26,.55) 0, rgba(10,19,26,.82) 55%, var(--night) 100%), url("/media/site/hero-dusk.webp") 50% 34% / cover no-repeat;
  -webkit-mask-image: linear-gradient(180deg, #000 60%, transparent); mask-image: linear-gradient(180deg, #000 60%, transparent); }
@media (min-width: 1100px) { .hs-top::before { background-image: linear-gradient(180deg, rgba(10,19,26,.55) 0, rgba(10,19,26,.82) 55%, var(--night) 100%), url("/media/site/hero-dusk-1080.webp"); } }
/* The welcome-back strip sits in a second .wrap of the band: positioned too, or the still is painted over it. */
.hs-top > .wrap { position: relative; }
.hs-top-in { position: relative; display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 18px 40px; }
.hs-top h1 { font-size: clamp(48px, 7vw, 92px); line-height: .96; letter-spacing: -.022em; color: var(--ink); text-shadow: 0 4px 30px rgba(0,0,0,.7); }
.hs-sub { margin-top: 12px; font-size: 20px; color: var(--ink-2); min-height: 30px; }
.hs-sub b { color: var(--gold-hi); }
.hs-mode { display: inline-flex; margin-top: 14px; border: 1px solid var(--line, rgba(228, 185, 100, .28)); border-radius: 999px; overflow: hidden; background: rgba(5, 10, 9, .55); }
.hs-mode-btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 16px; font-family: inherit; font-size: 15px; font-weight: 600; line-height: 1.2; color: var(--ink-2); background: transparent; border: 0; cursor: pointer; transition: color .15s, background .15s; }
.hs-mode-btn + .hs-mode-btn { border-left: 1px solid var(--line, rgba(228, 185, 100, .2)); }
.hs-mode-btn:hover { color: var(--ink, #f3e9d2); }
.hs-mode-btn.is-active { color: var(--gold-hi); background: rgba(228, 185, 100, .14); }
.hs-mode-btn:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: -2px; }
.hs-mode-btn img { width: 18px; height: 18px; object-fit: contain; }
.hs-find { width: min(380px, 100%); margin-bottom: 4px; }
.hs-find > svg { z-index: 1; }
.hs-find input { height: 52px; background: rgba(13,23,31,.86); backdrop-filter: blur(6px); }

/* ---------- the rack: one medallion per board, stays in reach while the list scrolls ---------- */
.rack { position: sticky; top: var(--nav-h); z-index: 20; margin-top: 8px; background: linear-gradient(180deg, rgba(10,19,26,.94), rgba(10,19,26,.86)); backdrop-filter: blur(8px); border-block: 1px solid var(--frame); }
.rack-in { display: flex; justify-content: space-between; gap: 2px; width: min(var(--wrap), 100% - 2 * var(--gut)); margin-inline: auto; padding: 8px 0 9px; }
.rack-item { position: relative; flex: 0 1 44px; min-width: 0; display: grid; justify-items: center; text-decoration: none; color: var(--ink); border-radius: 6px; padding: 3px 0 5px; }
.rack-item .medal { width: 40px; height: 40px; opacity: .62; transition: opacity .15s, transform .2s cubic-bezier(.2,.8,.2,1), filter .2s; }
.rack-item:hover .medal, .rack-item:focus-visible .medal { opacity: 1; transform: translateY(-3px); }
.rack-item[aria-current] .medal { opacity: 1; transform: translateY(-4px) scale(1.16); filter: drop-shadow(0 6px 12px rgba(228,184,106,.6)); }
.rack-item[aria-current]::after { content: ""; position: absolute; left: 18%; right: 18%; bottom: -10px; height: 3px; border-radius: 2px; background: var(--gold); }
.rack-name { position: absolute; top: calc(100% + 12px); left: 50%; transform: translateX(-50%); padding: 3px 9px; border-radius: 4px; background: var(--panel-2); border: 1px solid var(--frame-hi); font-size: 14px; font-weight: 700; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 2; }
.rack-item:hover .rack-name, .rack-item:focus-visible .rack-name { opacity: 1; }
.medal { flex: none; border-radius: 50%; }
.medal--all { display: grid; place-items: center; width: 40px; height: 40px; background: radial-gradient(circle at 50% 35%, #6b4a1c, #2a1b07 72%); box-shadow: inset 0 0 0 2px #b98a3c, inset 0 0 0 3px #3a2609, 0 1px 0 #000; color: var(--gold-hi); }
.medal--all svg { width: 58%; height: 58%; }

/* ---------- the board ---------- */
.board { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 26px 40px; align-items: start; padding-top: 34px; padding-bottom: 20px; }
.board-main { min-width: 0; overflow-x: clip; }      /* the light beams of the podium never widen the page */
.board-head { display: flex; align-items: center; gap: 18px; }
.board-icon .medal { width: 84px; height: 84px; filter: drop-shadow(0 8px 18px rgba(0,0,0,.6)); }
.board-title { min-width: 0; }
.board-title h2 { font-size: clamp(38px, 4.6vw, 58px); }
.board-title p { color: var(--ink-2); margin-top: 4px; }
.board-me { margin-left: auto; }

.legend { list-style: none; margin: 22px 0 0; padding: 0; display: flex; gap: 4px; }
.legend li { flex: 1 1 0; min-width: 74px; display: grid; justify-items: center; gap: 1px; padding: 8px 4px 7px; border-bottom: 2px solid color-mix(in srgb, var(--tier) 28%, transparent); opacity: .42; font-size: 14px; line-height: 1.15; text-align: center; }
.legend li.is-here { opacity: 1; border-bottom-color: var(--tier); background: linear-gradient(0deg, color-mix(in srgb, var(--tier) 14%, transparent), transparent 70%); }
.legend .shield { width: 34px; height: 34px; margin-bottom: 3px; }
.legend b { font-weight: 700; }
.legend span { color: var(--ink-3); }

.podium-slot { position: relative; margin-top: 70px; perspective: 900px; }
.podium-slot .pod--1 .pod-beam { top: -64px; }
.podium-slot .pod-beam { top: -40px; }
.podium-slot::before { content: ""; position: absolute; inset: -30px -12px 0; z-index: -1; pointer-events: none; background: radial-gradient(58% 70% at 50% 100%, rgba(228,184,106,.10), transparent 70%), linear-gradient(180deg, transparent, rgba(13,23,31,.7) 80%); border-bottom: 1px solid var(--frame); }
.podium-slot[hidden] + .lanes { margin-top: 26px; }
.podium-slot .stage { max-width: 760px; margin-inline: auto; }
.podium-slot .empty { padding: 60px 0; font-size: 20px; text-align: center; }
.pod .move { margin-left: 6px; font-size: 15px; }
/* the flip: the shields turn over when the board changes */
.podium-slot.is-out .pod .shield { transform: rotateY(90deg); transition: transform .16s ease-in; }
.podium-slot.is-out .pod-name, .podium-slot.is-out .pod-stat { opacity: 0; transition: opacity .12s; }
.podium-slot.is-in .pod .shield { animation: flip-in .55s cubic-bezier(.2,.8,.2,1) both; }
.podium-slot.is-in .pod--2 .shield { animation-delay: .07s; } .podium-slot.is-in .pod--3 .shield { animation-delay: .14s; }
.podium-slot.is-in .pod-name, .podium-slot.is-in .pod-stat { animation: rise .4s .12s both; }
@keyframes flip-in { from { transform: rotateY(-90deg); } to { transform: rotateY(0); } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

.lanes { margin-top: 14px; transition: opacity .16s; }
.lanes.is-out { opacity: 0; }
.lane.is-found { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold); animation: found 1.8s ease-out; }
.pod.is-found .pod-block { box-shadow: 0 0 0 2px var(--gold) inset; }
@keyframes found { 0% { background: rgba(228,184,106,.34); } 100% { background: rgba(13,23,31,.75); } }
.move { display: inline-flex; align-items: center; gap: 1px; margin-left: 8px; font-size: 14px; font-weight: 700; vertical-align: middle; }
.move svg { width: 11px; height: 11px; }
.move.up { color: var(--wisp); } .move.down { color: var(--ember); }

.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-top: 18px; }
.pager-say { color: var(--ink-2); }
.pager-say b { color: var(--ink); }
.pager-nums { display: flex; align-items: center; gap: 4px; }
.pg { min-width: 42px; height: 42px; padding: 0 8px; display: grid; place-items: center; border-radius: 4px; border: 1px solid var(--frame); background: rgba(13,23,31,.75); color: var(--ink); text-decoration: none; font-weight: 700; font-variant-numeric: tabular-nums; }
a.pg:hover { border-color: var(--gold); }
.pg[aria-current] { background: var(--gold); border-color: var(--gold); color: #221604; }
.pg svg { width: 18px; height: 18px; }
.pg--prev svg { transform: rotate(180deg); }
.pg.is-off { opacity: .3; }
.pg-gap { color: var(--ink-3); padding: 0 2px; }
.board-foot { margin-top: 14px; font-size: 16px; min-height: 24px; }

/* ---------- beside the board ---------- */
.board-side { display: grid; gap: 16px; position: sticky; top: calc(var(--nav-h) + 86px); }
.side .gwin-head { margin: 0; font-family: var(--text); line-height: 1.2; letter-spacing: 0; }
.side .gwin-head svg { color: var(--gold); }
.side .gwin-head svg.hot { color: var(--ember); }
.side-list { list-style: none; margin: 0; padding: 6px 14px 10px; }
.side-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid rgba(42,57,60,.6); }
.side-list li:last-child { border-bottom: 0; }
.side-who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; }
.side-num { flex: none; font-weight: 800; white-space: nowrap; text-decoration: none; }
.side-num.hot { color: var(--ember); }
a.side-num.hot:hover { text-decoration: underline; }
.side-num.live { color: var(--wisp); }
.side-crowns { flex: none; display: inline-flex; align-items: center; gap: 2px; }
.side-crowns img { width: 22px; height: 22px; }
.side-crowns b { margin-left: 6px; color: var(--gold-hi); font-size: 19px; min-width: 14px; text-align: right; }
.club { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 14px 14px; }
.club-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 5px; border-radius: 999px; background: var(--deep); border: 1px solid var(--frame); color: var(--gold-hi); text-decoration: none; }
.club-chip:hover { border-color: var(--gold); }
.club .empty { padding: 0; }

/* ---------- on each other's heels ---------- */
.heels { padding-bottom: clamp(20px, 3vw, 40px); }
.heels-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.duel .gwin-head { margin: 0; font-family: var(--text); line-height: 1.2; letter-spacing: 0; font-size: 18px; }
.duel .gwin-head a { color: var(--ink); text-decoration: none; font-weight: 800; }
.duel .gwin-head a:hover { color: var(--gold-hi); text-decoration: underline; }
.duel .gwin-head .medal { width: 26px; height: 26px; }
.duel .gwin-note.hot { display: inline-flex; align-items: center; gap: 4px; color: var(--ember); font-weight: 700; font-size: 15px; }
.duel .gwin-note svg { width: 14px; height: 14px; }
.duel-body { padding: 14px 16px 6px; display: grid; gap: 12px; }
.duel-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; }
.duel-row .shield { width: 36px; height: 36px; grid-row: 1 / span 2; }
.duel-name { font-size: 21px; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duel-row.is-lead .who { color: var(--gold-hi); }
.duel-val { color: var(--ink-2); font-weight: 700; }
.duel-bar { grid-column: 2 / -1; height: 7px; border-radius: 2px; background: rgba(255,255,255,.08); overflow: hidden; }
.duel-bar i { display: block; height: 100%; width: calc(var(--p, 0) * 100%); background: linear-gradient(90deg, var(--bronze), var(--gold)); transition: width .9s cubic-bezier(.2,.8,.2,1); }
.duel-row.is-chase .duel-bar i { background: linear-gradient(90deg, #8f2a17, var(--ember)); }
.duel-foot { margin: 8px 16px 0; padding: 10px 0 12px; border-top: 1px solid var(--frame); font-size: 16px; font-weight: 700; }
.duel-foot a { display: inline-flex; align-items: center; gap: 8px; }
.duel-foot svg { width: 18px; height: 18px; }

/* ---------- the crown in every skill ---------- */
.wall { padding-top: clamp(30px, 4vw, 56px); background: radial-gradient(60% 40% at 50% 0, rgba(228,184,106,.06), transparent 70%); }
.wall-grid { --cols: 5; --gap: 12px; display: flex; flex-wrap: wrap; justify-content: center; gap: var(--gap); }      /* 27 cards: the last row sits in the middle */
.wall-grid > .crown-card { flex: 0 0 calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols)); }
.crown-card { position: relative; display: grid; justify-items: center; align-content: start; gap: 2px; padding: 18px 10px 16px; text-align: center; background: linear-gradient(180deg, color-mix(in srgb, var(--tier) 12%, var(--panel)), var(--deep) 62%); border: 1px solid var(--frame); border-top: 3px solid var(--tier); border-radius: 4px; min-width: 0; transition: transform .2s, border-color .2s; }
.crown-card:hover { transform: translateY(-4px); border-color: var(--tier); }
.crown-card.is-me { box-shadow: 0 0 0 1px var(--wisp); }
.crown-skill { display: grid; justify-items: center; gap: 6px; text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: 17px; line-height: 1.1; }
.crown-skill .medal { width: 64px; height: 64px; filter: drop-shadow(0 6px 12px rgba(0,0,0,.6)); }
.crown-skill:hover { color: var(--gold-hi); }
.crown-who { max-width: 100%; margin-top: 8px; font-size: 22px; line-height: 1.1; overflow-wrap: anywhere; }
.crown-who .who { color: var(--gold-hi); }
.crown-n { display: inline-flex; align-items: center; gap: 2px; margin-left: 6px; color: var(--gold); font-size: 15px; font-weight: 800; vertical-align: middle; }
.crown-n svg { width: 15px; height: 15px; }
.crown-stat { display: grid; color: var(--ink-3); font-size: 15px; line-height: 1.25; }
.crown-stat b { color: var(--ink); font-size: 17px; }
.crown-card.is-open { opacity: .6; }
.crown-none { margin-top: 8px; color: var(--ink-3); }

/* ---------- the way in ---------- */
.hs-join { margin-top: clamp(40px, 6vw, 80px); border-top: 1px solid var(--frame); background: linear-gradient(180deg, rgba(228,184,106,.07), transparent 70%); padding: clamp(40px, 5vw, 64px) 0; }
.hs-join-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 22px 40px; }
.hs-join h2 { font-size: clamp(32px, 3.8vw, 48px); }
.hs-join .lede { margin-top: 10px; }

/* ---------- narrower screens ---------- */
@media (max-width: 1240px) {
  .rack-in { justify-content: flex-start; overflow-x: auto; scrollbar-width: none; padding-bottom: 6px; gap: 0; scroll-snap-type: x proximity; }
  .rack-in::-webkit-scrollbar { display: none; }
  .rack-item { flex: 0 0 74px; padding: 6px 0 4px; scroll-snap-align: center; }
  .rack-name { position: static; transform: none; opacity: 1; background: none; border: 0; padding: 0; margin-top: 4px; font-size: 12.5px; font-weight: 500; color: var(--ink-3); max-width: 72px; overflow: hidden; text-overflow: ellipsis; }
  .rack-item[aria-current] .rack-name { color: var(--gold-hi); font-weight: 700; }
  .rack-item[aria-current]::after { display: none; }
  .rack-item[aria-current] .medal { transform: scale(1.12); }
}
@media (max-width: 1080px) {
  .board { grid-template-columns: minmax(0, 1fr); }
  .board-side { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .heels-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wall-grid { --cols: 4; }
}
@media (max-width: 700px) {
  .hs-top h1 { font-size: 52px; }
  .hs-sub { font-size: 18px; }
  .board { padding-top: 24px; }
  .board-icon .medal { width: 60px; height: 60px; }
  .board-head { gap: 12px; flex-wrap: wrap; }
  .board-title { flex: 1 1 0; }
  .board-title p { font-size: 16px; }
  .board-me { margin-left: 0; }
  .legend { overflow-x: auto; scrollbar-width: none; margin-inline: calc(-1 * var(--gut)); padding-inline: var(--gut); }
  .legend::-webkit-scrollbar { display: none; }
  .legend li { flex: 0 0 76px; }
  .podium-slot { margin-top: 44px; }
  .podium-slot .pod--1 .pod-beam { top: -36px; }
  .board-side, .heels-grid { grid-template-columns: minmax(0, 1fr); }
  .wall-grid { --cols: 2; --gap: 8px; }
  .crown-skill .medal { width: 52px; height: 52px; }
  .crown-who { font-size: 19px; }
  .pager { justify-content: center; }
  .pg { min-width: 38px; height: 40px; padding: 0 5px; }
  .hs-join .btn { width: 100%; justify-content: center; }
}
