/* games.joemorrow.com/leaderboards/ (2026-10-26, Ava's mockup View 1, Jordan build).
   Loads AFTER /style.css, which supplies the fonts, tokens, top bar, den, ticker, footer, .play and the
   dialog.rn note. Everything here is prefixed lbp- or scoped to .boards / .board so nothing on the front page
   can collide with it. Themed: light by default, dark via html[data-theme="dark"] (spec team/specs/arcade-dark-mode-2026-11-10.md; this file's dark block is at the end). */

/* ---------- top bar: three links, the current one in gold ---------- */
.lbp-nav { gap: 8px; }
.top-link.lbp-link--plain { background: transparent; box-shadow: none; color: #e9dcc0; }
.top-link.lbp-link--plain:hover { background: rgba(233, 220, 192, .12); }
@media (max-width: 600px) {
  .top { flex-wrap: wrap; justify-content: center; row-gap: 2px; }
  .lbp-nav { gap: 2px; }
  .top-link { padding: 0 9px; }
}

.lbp-sign { transform: rotate(-1deg); text-align: center; }
.lbp-sign h1 .lbp-accent { font-size: .62em; margin-top: 4px; }
.lbp-sign .den-note { max-width: 38ch; margin-inline: auto; }

/* ---------- shelf head: title + the 30 days / all-time toggle ---------- */
.lbp-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px 18px; flex-wrap: wrap; margin-bottom: 20px; }
.lbp-head h2 { font: 800 clamp(24px, 3vw, 32px)/1.05 var(--display); font-stretch: 112%; color: var(--olive-ink); letter-spacing: -.01em; }
.lbp-hint { margin-top: 4px; font: 19px/1.2 var(--hand); color: var(--red-ink); }
.lbp-window { display: inline-flex; border: 2px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--paper); box-shadow: 0 3px 0 var(--shadow); }
.lbp-window[hidden] { display: none; }
.lbp-window button {
  min-height: 44px; padding: 0 16px; border: 0; background: transparent; cursor: pointer;
  font: 700 14px/1 var(--body); color: var(--ink);
}
.lbp-window button + button { border-left: 2px solid var(--line); }
.lbp-window button[aria-pressed="true"] { background: var(--olive); color: var(--on-accent); }
.lbp-window button:focus-visible { outline: 3px solid var(--red-ink); outline-offset: -5px; }
/* two labelled switches side by side (2026-10-27): Scores = All runs / One per player, Plays = 30 days / all-time.
   The scores switch presses teal so the two never read as one control. They stack on a phone. */
.lbp-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 16px; }
.lbp-controls[hidden], .lbp-ctl[hidden] { display: none; }
.lbp-ctl { display: grid; gap: 5px; justify-items: start; }
.lbp-ctl-label { font: 700 11px/1 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.lbp-view button[aria-pressed="true"] { background: var(--teal); color: var(--on-accent); }
@media (max-width: 600px) {
  .lbp-controls { width: 100%; }
  .lbp-ctl, .lbp-ctl .lbp-window { width: 100%; }
  .lbp-ctl .lbp-window button { flex: 1; padding: 0 10px; }
}

.lbp-closed { padding: 18px 20px; border: 2px dashed color-mix(in srgb, var(--line) 45%, transparent); border-radius: 10px; font: 700 15px/1.4 var(--body); color: var(--ink-2); background: var(--paper); }
.lbp-closed[hidden] { display: none; }
.lbp-counts-note { margin-top: 22px; font-size: 14px; line-height: 1.45; color: var(--ink-2); text-align: center; }

/* ---------- the board grid: 3 across on iPad landscape and up, 2 on iPad portrait, 1 on phones ---------- */
.boards { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(18px, 2.4vw, 26px); grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
.boards[hidden] { display: none; }

.board {
  --stripe: var(--olive);
  position: relative; display: flex; flex-direction: column; background: var(--paper); border-radius: 10px; overflow: hidden;
  border: 2px solid var(--line); box-shadow: 5px 6px 0 var(--shadow);
}
.board[data-stripe="red"] { --stripe: var(--red); }
.board[data-stripe="gold"] { --stripe: var(--gold); }
.board[data-stripe="teal"] { --stripe: var(--teal); }
.board.is-moving { z-index: 5; }
.board.is-rising { box-shadow: 10px 12px 0 var(--gold); }
.board::before { content: ""; height: 8px; flex: none; background: repeating-linear-gradient(90deg, var(--stripe) 0 22px, color-mix(in srgb, var(--stripe) 70%, #000) 22px 26px); }

.board-head { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; padding: 14px 16px 10px; }
.seal {
  width: 58px; height: 58px; border-radius: 50%; display: grid; place-content: center; text-align: center; flex: none;
  background: var(--gold); color: var(--ink-fixed); border: 2px solid var(--line-fixed); box-shadow: 0 3px 0 var(--shadow);
}
.seal b { display: block; font: 800 24px/1 var(--display); font-stretch: 112%; }
.seal small { display: block; font: 700 8px/1.05 var(--body); letter-spacing: .08em; text-transform: uppercase; margin-top: 2px; }
.board.no-plays .seal { visibility: hidden; }   /* keeps the title column aligned across cards */
.board[data-pos="1"] .seal { background: var(--red); color: var(--on-accent); }
.board-series { font: 700 11px/1 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--stripe); filter: brightness(var(--series-b)); }
.board-title { margin-top: 5px; font: 700 21px/1.08 var(--display); color: var(--ink); letter-spacing: -.01em; }
.board-title a { text-decoration: none; }
.board-title a:hover { text-decoration: underline; text-underline-offset: 3px; }
.board-rule { margin-top: 5px; font-size: 13px; line-height: 1.35; color: var(--ink-2); }
.board-rule em { font-style: normal; font-weight: 700; color: var(--ink); }

.plays { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 6px; margin-top: 7px; font-size: 13px; color: var(--ink-2); }
.plays b { font: 800 18px/1 var(--display); font-stretch: 105%; color: var(--ink); font-variant-numeric: tabular-nums; }
.delta { display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; border-radius: 999px; font: 700 11px/1.4 var(--body); letter-spacing: .04em; opacity: 0; transition: opacity .3s; }
.delta.on { opacity: 1; }
.delta.up { background: var(--delta-up-bg); color: var(--delta-up-fg); }
.delta.down { background: var(--delta-dn-bg); color: var(--delta-dn-fg); }

/* difficulty tabs: real 44px targets */
.tabs { display: flex; gap: 6px; padding: 0 16px 10px; }
.tabs button {
  flex: 1; min-height: 44px; border-radius: 8px; cursor: pointer; font: 700 14px/1 var(--body); color: var(--ink);
  background: var(--paper-2); border: 2px solid var(--line); box-shadow: 0 2px 0 var(--shadow);
}
.tabs button[aria-selected="true"] { background: var(--olive); color: var(--on-accent); }
.tabs button:focus-visible { outline: 3px solid var(--red-ink); outline-offset: 2px; }

/* the top-10 table */
.lb-wrap { position: relative; margin: 0 10px; border-top: 2px solid var(--line); }
.lb { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.lb th { text-align: left; font: 700 10px/1 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); padding: 9px 6px 7px; }
.lb th.num, .lb td.num { text-align: right; }
.lb td { padding: 0 6px; height: 31px; border-top: 1px dashed var(--rule); white-space: nowrap; }
.lb tbody tr:nth-child(even) td { background: var(--row-alt); }
.lb td.rk { width: 34px; }
.rk i { display: inline-grid; place-content: center; width: 24px; height: 24px; border-radius: 50%; font: 800 12px/1 var(--display); font-style: normal; color: var(--ink-2); }
/* medals only on filled slots (tr.has), so a 1-entry board doesn't show silver and bronze on empty rows */
.lb tr.has:nth-child(1) .rk i { background: var(--gold); color: var(--ink-fixed); border: 1.5px solid var(--line-fixed); }
.lb tr.has:nth-child(2) .rk i { background: #cfc8b4; color: var(--ink-fixed); border: 1.5px solid var(--line-fixed); }
.lb tr.has:nth-child(3) .rk i { background: #c98a55; color: var(--ink-fixed); border: 1.5px solid var(--line-fixed); }
.lb td.nm { font-weight: 700; color: var(--ink); max-width: 0; width: 100%; overflow: hidden; text-overflow: ellipsis; }
.lb td.mt { font: 800 15px/1 var(--display); font-stretch: 104%; color: var(--ink); }
.lb td.tb { font-size: 12px; color: var(--ink-2); }
.lb td.dt { font-size: 12px; color: var(--ink-2); width: 52px; }
/* a run this browser posted (the in-game module's own record): a teal bar on the rank cell and a teal name */
.lb tr.mine td.rk { box-shadow: inset 4px 0 var(--teal); }
.lb tr.mine td.nm { color: var(--teal-ink); }

/* empty board: the ten slots stay, so a card is the same height empty or full and the grid never jumps */
.lb.is-empty td { color: color-mix(in srgb, var(--ink-2) 55%, transparent); }
.lb.is-empty td.nm::after { content: ""; display: block; height: 0; border-bottom: 2px dotted color-mix(in srgb, var(--ink-2) 35%, transparent); margin-top: 2px; }
.empty-card {
  position: absolute; left: 50%; top: 52%; translate: -50% -50%; rotate: -2deg; width: min(84%, 250px); text-align: center;
  padding: 14px 14px 12px; background: var(--paper); border: 2px solid var(--line); border-radius: 8px; box-shadow: 4px 5px 0 var(--shadow);
}
.empty-card p:first-child { font: 26px/1 var(--hand); color: var(--red-ink); }
.empty-card p + p { margin-top: 6px; font: 700 13px/1.35 var(--body); color: var(--ink-2); }

.board-kept { margin: 6px 16px 0; font-size: 12px; color: var(--ink-2); text-align: right; }
.board-foot { display: flex; align-items: stretch; gap: 10px; padding: 10px 16px 14px; margin-top: auto; }
.board-foot .play { flex: 1; min-height: 48px; font-size: 17px; }
.lbp-about {
  flex: none; min-height: 48px; padding: 0 14px; border-radius: 8px; cursor: pointer;
  font: 700 14px/1 var(--body); color: var(--ink); background: var(--paper-2); border: 2px solid var(--line); box-shadow: 0 3px 0 var(--shadow);
}
.lbp-about:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--shadow); }
.lbp-about:focus-visible { outline: 3px solid var(--olive); outline-offset: 3px; }

/* ---------- page footer: nickname rule, delete, back link ---------- */
.lbp-foot { max-width: 1240px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px) 34px; display: grid; gap: 12px; }
.lbp-notice { padding: 14px 18px; border: 2px dashed color-mix(in srgb, var(--line) 45%, transparent); border-radius: 10px; font-size: 14px; color: var(--ink-2); }
.lbp-foot-links { display: flex; gap: 8px 18px; flex-wrap: wrap; align-items: center; font-size: 14px; }
.lbp-foot-links a, .lbp-del {
  display: inline-flex; align-items: center; min-height: 44px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px;
  font: 400 14px/1.2 var(--body); background: none; border: 0; padding: 0; cursor: pointer;
}
.lbp-del.armed { color: var(--red-ink); font-weight: 700; }
.lbp-del:focus-visible, .lbp-foot-links a:focus-visible { outline: 3px solid var(--olive); outline-offset: 2px; border-radius: 3px; }
.lbp-del-confirm { font-size: 13px; color: var(--red-ink); }
.lbp-del-confirm[hidden] { display: none; }
.lbp-del-status { font-size: 13px; color: var(--ink-2); min-height: 1em; }
.lbp-del-status:empty { display: none; }

/* About-this-board note: reuses the front page's dialog.rn look from /style.css */
.rn-body a { color: var(--teal-ink); font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  .delta { transition: none; }
}

/* AFTER HOURS (2026-11-10, spec section 5). Every leaderboard surface reads the shared tokens that style.css re-points under
   html[data-theme="dark"]: --paper fill, --line border, --shadow stamp, --ink / --ink-2 text, --row-alt even rows, --rule dashed rules,
   --teal-ink for tr.mine, --red-ink for the armed delete, --delta-* chips. Medal ranks keep their fills with --ink-fixed text and
   --line-fixed rims. So this file needs no dark block of its own: nothing here hard-codes a surface colour any more. */
