/* The leaderboard, one look on every page that shows it: a podium for the top three, then a table of everyone
   after them. Used by the home page (a preview: the top 20) and /leaderboard.html (everyone, searchable and
   sortable). Everything is under .lb-, so it never collides with a page's own styles. */

/* ---------- the podium ---------- */
.lb-podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 16px; align-items: end; }
.lb-spot { position: relative; text-align: center; padding: 26px 18px 22px; border-radius: 22px; background: rgba(8, 8, 26, .62); border: 1px solid var(--line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); overflow: hidden; }
.lb-bg { position: absolute; inset: 0; background-size: cover; background-position: center; image-rendering: pixelated; opacity: .13; filter: saturate(.8);
  -webkit-mask: linear-gradient(transparent, #000 25%, #000 70%, transparent); mask: linear-gradient(transparent, #000 25%, #000 70%, transparent); }
.lb-spot > :not(.lb-bg) { position: relative; } /* everything else sits above the picture */
.lb-spot::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--m); box-shadow: 0 0 20px var(--m); }
.lb-spot.p1 { --m: var(--gold, #ffd76a); padding-top: 38px; box-shadow: 0 0 70px rgba(255, 215, 106, .16); }
.lb-spot.p2 { --m: #d6e2f5; } .lb-spot.p3 { --m: #e0a064; }
.lb-frame { position: relative; width: 96px; height: 96px; margin: 0 auto; }
.lb-spot.p1 .lb-frame { width: 120px; height: 120px; }
.lb-frame .lb-pic { width: 100%; height: 100%; border-radius: 20px; font-size: 38px; border: 2px solid var(--m); box-shadow: 0 0 22px color-mix(in srgb, var(--m) 45%, transparent); }
.lb-spot.p1 .lb-frame .lb-pic { font-size: 48px; }
.lb-frame .lb-pic.open { border-style: dashed; background: rgba(160, 180, 255, .05); color: var(--dim); box-shadow: none; }
.lb-medal { position: absolute; right: -10px; bottom: -8px; font-size: 26px; color: var(--m); filter: drop-shadow(0 0 8px var(--m)) drop-shadow(0 2px 4px rgba(0, 0, 0, .8)); }
.lb-spot.p1 .lb-medal { font-size: 32px; }
.lb-place { font: 900 11px var(--display); letter-spacing: .3em; color: var(--m); margin: 16px 0 6px; }
.lb-name { font: 800 18px var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-sats { font: 800 26px var(--mono); margin-top: 8px; font-variant-numeric: tabular-nums; }
.lb-spot.empty { border-style: dashed; background: rgba(6, 5, 20, .3); }
.lb-rec { font-size: 11px; color: var(--dim); margin-top: 4px; } /* an open spot's 'Your name here' */
.lb-spot.empty .lb-name, .lb-spot.empty .lb-sats { color: var(--dim); }
.lb-spot.you { outline: 1px solid var(--cyan); box-shadow: 0 0 40px rgba(34, 230, 255, .25); }
.lb-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 10px; }
.lb-chip { font-size: 10.5px; color: var(--soft); border: 1px solid var(--line); border-radius: 99px; padding: 3px 9px; }
.lb-spot .lb-wallet { margin-top: 12px; display: flex; justify-content: center; }

/* ---------- a player's picture: their NFT icon, or a tile with their initial ---------- */
.lb-pic { display: grid; place-items: center; flex-shrink: 0; border-radius: 10px; font: 900 14px var(--display); color: #050414; object-fit: cover; image-rendering: pixelated; }

/* ---------- the table ---------- */
.lb-table { --cols: 56px minmax(160px, 1.5fr) minmax(150px, 1.1fr) 110px minmax(120px, .9fr) 150px 130px; margin-top: 16px; border-radius: 18px; overflow: hidden; background: rgba(8, 8, 26, .66); border: 1px solid var(--line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
/* one game's own board (leaderboard.html?game=…): no MOST PLAYED column */
.lb-table.one-game { --cols: 56px minmax(160px, 1.5fr) minmax(150px, 1.1fr) 110px 150px 130px; }
.lb-table.one-game .lb-mostcell { display: none; }
.lb-head, .lb-row { display: grid; grid-template-columns: var(--cols); gap: 14px; align-items: center; padding: 0 20px; }
.lb-head { position: sticky; top: 0; z-index: 2; background: rgba(10, 9, 30, .96); border-bottom: 1px solid var(--line-hi); }
.lb-head > * { display: inline-flex; align-items: center; gap: 6px; padding: 14px 0; border: 0; background: transparent; color: var(--dim); font: 800 9.5px var(--display); letter-spacing: .16em; text-align: left; }
.lb-head button { cursor: pointer; }
.lb-head button:hover { color: var(--ink); }
.lb-head [aria-sort] { color: var(--cyan); }
.lb-head .arrow { font-size: 10px; opacity: 0; }
.lb-head [aria-sort] .arrow { opacity: 1; }
.lb-head .lb-num { justify-content: flex-end; }
.lb-row { min-height: 62px; border-top: 1px solid var(--line); transition: background .2s; }
.lb-row:first-child { border-top: 0; }
.lb-row:hover { background: rgba(255, 255, 255, .03); }
.lb-row.you { background: linear-gradient(90deg, rgba(34, 230, 255, .12), transparent 70%); }
.lb-rk { font: 900 13px var(--display); color: var(--dim); } /* #4, #5 … */
.lb-rk.r1 { color: var(--gold, #ffd76a); } .lb-rk.r2 { color: #d6e2f5; } .lb-rk.r3 { color: #e0a064; }
.lb-player { display: flex; align-items: center; gap: 12px; min-width: 0; }
.lb-player .lb-pic { width: 38px; height: 38px; }
.lb-player b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-player .anon { color: var(--dim); font-weight: 600; }
.lb-you { display: inline-block; font: 800 8.5px var(--display); letter-spacing: .18em; color: var(--cyan); border: 1px solid var(--cyan); border-radius: 99px; padding: 2px 7px; margin-left: 8px; flex-shrink: 0; vertical-align: 3px; }
.lb-wallet a { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--soft); text-decoration: none; padding: 5px 9px; border-radius: 8px; border: 1px solid var(--line); }
.lb-wallet a:hover { color: var(--cyan); border-color: var(--cyan); }
.lb-wallet .none { font-size: 12px; color: var(--dim); }
.lb-games { font-variant-numeric: tabular-nums; font-size: 13px; }
.lb-games small { color: var(--dim); font-size: 11px; margin-left: 4px; }
.lb-most { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--soft); padding: 5px 9px; border-radius: 8px; background: rgba(157, 123, 255, .1); border: 1px solid rgba(157, 123, 255, .3); white-space: nowrap; }
.lb-num { text-align: right; }
.lb-row .lb-num { font: 800 15px var(--mono); font-variant-numeric: tabular-nums; } /* the values; the headings keep the heading font */
.lb-row .lb-usd { font-weight: 600; font-size: 14px; }
.lb-up { color: var(--ok); text-shadow: 0 0 14px rgba(57, 255, 136, .35); } .lb-down { color: #ff7a88; } .lb-muted { color: var(--dim); font-weight: 400; }

/* ---------- narrower screens: the table's rows become cards, the podium stacks ---------- */
@media (max-width: 1000px) {
  .lb-head { display: none; }
  .lb-row { grid-template-columns: 44px minmax(0, 1fr) auto; grid-template-areas: "rank player sats" "rank wallet usd" "rank games most"; gap: 8px 12px; padding: 14px 16px; }
  .lb-row > :nth-child(1) { grid-area: rank; align-self: start; padding-top: 10px; }
  .lb-row > :nth-child(2) { grid-area: player; }
  .lb-row > :nth-child(3) { grid-area: wallet; }
  .lb-row > :nth-child(4) { grid-area: games; }
  .lb-row > :nth-child(5) { grid-area: most; justify-self: end; }
  .lb-row > :nth-child(6) { grid-area: sats; }
  .lb-row > :nth-child(7) { grid-area: usd; }
}
@media (max-width: 760px) {
  .lb-podium { grid-template-columns: 1fr; }
  .lb-podium .p1 { order: -1; }
}

/* the bitcoin sign in front of a sats amount */
.lb-btc { margin-right: .18em; opacity: .85; font-weight: 700; }
