/* The tally board's section of the camp window (leaderboard.js): all-time rankings on a trophy rail (phones: one "Rank
   by" row), the board for the one picked (first place on a gold strip, then the ranks, with your place pinned along
   the bottom) and "You", your record. Built on hub.css's window: the same slots, notched corners, label-value rows
   and buttons. Rows and cards are parchment with dark ink (the Lantern UI, Colin's pick A). Gold means the cursor; your
   own row has an amber ring and a "You" tag, so it never rests on colour alone. */
.lb { --lp-ink: var(--parch-ink); --lp-dim: var(--parch-ink-dim); --lp-edge: var(--parch-edge);
  --lp-fill: var(--parch-tex) 0 0 / 128px, var(--parch); --lp-ring: inset 0 0 0 var(--u) var(--parch-edge);
  --lp-on: inset 0 0 0 var(--u) var(--parch-edge), inset 0 0 0 calc(var(--u) * 2) var(--gold), inset 0 0 0 calc(var(--u) * 3) var(--parch-edge); }
/* today's standings (dailyboard.css) reuse these rows on its dark planks: the same parts, in light ink */
.db { --lp-ink: var(--plank-ink); --lp-dim: #f0d9b0; --lp-edge: var(--plank-rim); --lp-fill: rgba(28, 14, 5, 0.72); --lp-ring: inset 0 0 0 var(--u) var(--plank-rim); --lp-on: var(--ring-on); }

.lb { height: 100%; min-height: 0; }
.lb-railed { display: grid; grid-template-columns: 236px minmax(0, 1fr); height: 100%; min-height: 0; }
.lb .lb-pxi { width: 20px; height: 20px; flex: none; }
.lb .lb-rb img.pix { width: 20px; height: 20px; flex: none; image-rendering: pixelated; }

/* ---------- the trophy rail: a trophy per ranking with your place on it, then your record ---------- */
.lb-rail { display: flex; flex-direction: column; gap: 4px; min-height: 0; padding: 14px 10px 14px 14px; overflow-y: auto; box-shadow: inset calc(var(--u) * -1) 0 0 var(--win-edge); }
.lb-trophy { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 10px; min-height: 64px; padding: 8px 10px; border: 0; clip-path: var(--notch);
  background: var(--lp-fill); box-shadow: var(--lp-ring); color: var(--lp-ink); text-align: left; cursor: pointer; }
.lb-trophy:hover { background: var(--parch-lit); }
.lb-trophy.on { background: var(--parch-lit); box-shadow: var(--lp-on); }
.lb-trophy-ico { display: grid; place-items: center; width: 44px; height: 44px; overflow: hidden; }
.lb .lb-trophy-ico .lb-pxi, .lb .lb-trophy-ico > img.pix { width: 28px; height: 28px; image-rendering: pixelated; }
.lb .lb-trophy-ico > .coin-ico { width: max(35px, calc(35px / var(--ui, 1))); height: max(30px, calc(30px / var(--ui, 1))); }
.lb-trophy-ico .lb-face { box-shadow: none; background: none; }
.lb-trophy-t { display: grid; gap: 3px; min-width: 0; }
.lb-trophy-t b { font: 700 1.02rem/1.15 var(--f-label); color: var(--lp-ink); text-shadow: none; }
.lb-trophy-t small { font: 700 0.92rem/1 var(--f-label); color: var(--lp-dim); text-shadow: none; }
.lb-trophy-you { margin-top: auto; }
/* phones: the rail becomes one row of four, your place under each */
.lb-rankby { display: none; }

/* ---------- a board: the list scrolls, your place stays put underneath ---------- */
.lb-board { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-height: 0; }
.lb-list { min-height: 0; padding: 14px 18px 16px; }
.lb-head { margin: 0 0 10px; font: 700 1rem/1.3 var(--f-label); color: var(--ink-dim); text-shadow: var(--ol1); }
.lb-head b { color: var(--win-ink); }
.lb-empty { margin: 8px 0; font: 700 1rem/1.4 var(--f-label); color: var(--ink-dim); }
.lb-empty .btn { margin-top: 10px; }

/* first place: a slim gold strip over the list */
.lb-first { --mc: #ffcf4a; display: grid; grid-template-columns: 34px 48px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 68px; margin: 0 0 6px;
  padding: 8px 14px 8px 6px; clip-path: var(--notch); background: linear-gradient(90deg, rgba(255, 207, 74, 0.35), rgba(255, 207, 74, 0) 60%), var(--lp-fill);
  box-shadow: var(--lp-ring), inset 0 calc(var(--u) * 3) 0 var(--mc); }
.lb-first .lb-medal { justify-self: end; }
.lb-first .lb-name { font-size: 1.15rem; }
.lb-first .lb-val b { font-size: 1.25rem; }
.lb-first.me { box-shadow: inset 0 0 0 var(--u) var(--lp-edge), inset 0 0 0 calc(var(--u) * 2.5) var(--amber), inset 0 calc(var(--u) * 3) 0 var(--mc); }
.lb-medal { display: grid; place-items: center; width: 30px; height: 30px; clip-path: var(--notch); background: var(--mc, #ffcf4a); box-shadow: inset 0 0 0 var(--u) var(--lp-edge); font: 700 1.05rem/1 var(--f-num); color: #1a1206; }
/* the ranks below it, in rank order */
.lb-rows { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; margin: 0; padding: 0; list-style: none; }
.lb-row { display: grid; grid-template-columns: 34px 32px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 56px; padding: 6px 12px 6px 6px;
  clip-path: var(--notch); background: var(--lp-fill); box-shadow: var(--lp-ring); }
.lb-rank { font: 700 1.1rem/1 var(--f-num, var(--f-label)); color: var(--lp-dim); text-align: right; font-variant-numeric: tabular-nums; }
/* your row: lighter, an amber ring inside the frame, an amber rank and the "You" tag */
.lb-row.me { background: var(--parch-lit); box-shadow: inset 0 0 0 var(--u) var(--lp-edge), inset 0 0 0 calc(var(--u) * 2.5) var(--amber); }
.lb-row.me .lb-rank { color: var(--amber); }
.lb-who { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.lb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 1.05rem/1.15 var(--f-label); color: var(--lp-ink); text-shadow: none; }
.lb-name.guest { color: var(--lp-dim); }
.lb-who small { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font: 700 0.95rem/1.2 var(--f-label); color: var(--lp-dim); text-shadow: none; }
.lb-lvl { display: inline-block; padding: 3px 6px; clip-path: var(--notch); background: #5b2e17; box-shadow: inset 0 0 0 var(--u) #321007; font: 700 0.88rem/1 var(--f-label);
  color: var(--win-ink); text-shadow: var(--ol1); font-variant-numeric: tabular-nums; }
.lb-lvl.big { padding: 4px 8px; font-size: 0.95rem; color: #fff; background: #3c8c2a; box-shadow: inset 0 0 0 var(--u) #163d10; }
.lb-you-tag { padding: 2px 6px; background: var(--amber); color: #fff1d6; font: 700 0.85rem/1.2 var(--f-label); font-style: normal; text-shadow: none; }
.lb-val { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; text-align: right; white-space: nowrap; }
.lb-val b { display: inline-flex; align-items: center; gap: 5px; font: 700 1.08rem/1.1 var(--f-num, var(--f-label)); color: var(--lp-ink); text-shadow: none; font-variant-numeric: tabular-nums; }
.lb .lb-val-ores b { color: var(--lp-ink) !important; }   /* (leaderboard.js colours the ore for the dark window: its picture says it here) */
.lb-val b img { width: 20px; height: 20px; image-rendering: pixelated; }
.lb-val small { font: 700 0.95rem/1 var(--f-label); color: var(--lp-dim); text-shadow: none; }

/* faces: a miner's head (Profile.render's portrait), or on the podium the whole miner */
.lb-face { --s: 32px; position: relative; flex: none; display: block; width: var(--s); height: var(--s); overflow: hidden; clip-path: var(--notch);
  background: var(--well, #5f321d); box-shadow: inset 0 0 0 var(--u) var(--win-edge); }
.lb-doll { position: absolute; left: 50%; top: 0; translate: -50% 0; }
.lb-doll.avatar { position: absolute; }
.lb-face.full { width: auto; height: auto; overflow: visible; clip-path: none; background: none; box-shadow: none; }
.lb-face.full .lb-doll { display: block; position: relative; left: auto; top: auto; translate: none; overflow: visible; }
.lb-face.anon { display: grid; place-items: center; font: 700 calc(var(--s) * 0.5)/1 var(--f-label); color: var(--win-ink); }

/* a live redraw: a row whose place changed glints once (never with reduced motion) */
.lb .lb-moved { animation: lb-moved 1.2s ease-out; }
@keyframes lb-moved { from { box-shadow: inset 0 0 0 var(--u) var(--gold), inset 0 0 0 calc(var(--u) * 2) #000; } }
html[data-motion="reduce"] .lb .lb-moved { animation: none; }

/* ---------- your place, pinned along the bottom of every board ---------- */
.lb-me { display: grid; grid-template-columns: 48px minmax(min(9em, 30vw), auto) minmax(0, 1fr) auto;   /* your name keeps its room; a long place line wraps */
  align-items: center; gap: 6px 18px; padding: 10px 18px 12px; background: var(--wood-tex) 0 0 / 128px, var(--win);
  box-shadow: inset 0 var(--u) 0 var(--win-edge), inset 0 calc(var(--u) * 2) 0 var(--gold); }
.lb-me-who { display: grid; gap: 3px; min-width: 0; }
.lb-me-name { overflow-wrap: anywhere; font: 700 1.1rem/1.15 var(--f-label); color: var(--win-ink); text-shadow: var(--ol1); }
.lb-me-who small { font: 700 0.95rem/1.2 var(--f-label); color: var(--ink-dim); text-shadow: var(--ol1); }
.lb-me-place { display: grid; gap: 3px; justify-items: end; text-align: right; }
.lb-me-rank { display: flex; align-items: baseline; gap: 8px; margin: 0; white-space: nowrap; }
.lb-me-rank b { font: 700 2rem/1 var(--f-num, var(--f-label)); color: var(--gold); text-shadow: var(--ol); }
.lb-me-rank span { font: 700 1rem/1 var(--f-label); color: var(--ink-dim); text-shadow: var(--ol1); }
.lb-me-line { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 2px 10px; margin: 0; font: 700 1rem/1.25 var(--f-label); color: var(--ink-dim); text-shadow: var(--ol1); }
.lb-me-line b { color: var(--win-ink); }
.lb-me-acts { display: none; flex-wrap: wrap; gap: 6px; }
.lb-me-guest { grid-column: 1 / -1; margin: 0; font-size: 1rem; }
.lb-guest b { color: var(--ink-dim); }

/* the XP bar */
.lb-xp p { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 6px; font: 700 1rem/1.2 var(--f-label); color: var(--win-ink); }
.lb-xp p small { margin-left: auto; font-size: 0.8rem; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.lb-xp .bar { display: block; height: 14px; clip-path: var(--notch); background: rgba(40, 14, 5, 0.92); box-shadow: inset 0 0 0 var(--u) var(--win-edge); overflow: hidden; }
.lb-xp .bar i { display: block; height: 100%; background: #6fd04a; box-shadow: inset 0 calc(var(--u) * -2) 0 #3c8c2a; }
.lb-xp.compact .bar { height: 10px; }
.lb-xp .hub-note { margin-top: 6px; }

/* ---------- "You" ---------- */
.lb-you { min-height: 0; padding: 16px 18px 22px; }
.lb-hero { display: flex; align-items: center; gap: 20px; padding: 4px 4px 18px; }
.lb-hero-info { flex: 1; min-width: 0; display: grid; gap: 10px; }
.lb-hero-info .kicker { margin: 0; }
.lb-hero h2 { margin: -6px 0 0; font: 700 2rem/1.05 var(--f-label); color: var(--win-ink); text-shadow: var(--ol); overflow-wrap: anywhere; }
.lb-hero .lb-xp { max-width: 520px; }
.lb-ranks { display: flex; flex-wrap: wrap; gap: 4px; }
.lb-rank-chip { display: grid; grid-template-columns: auto auto; align-items: baseline; gap: 0 8px; min-width: 120px; padding: 7px 12px; border: 0; clip-path: var(--notch);
  background: var(--lp-fill); box-shadow: var(--lp-ring); color: var(--lp-ink); text-align: left; cursor: pointer; }
.lb-rank-chip:hover { background: var(--parch-lit); }
.lb-rank-chip span { grid-column: 1 / -1; font: 700 0.9rem/1.2 var(--f-label); color: var(--lp-dim); text-shadow: none; }
.lb-rank-chip b { font: 700 1.35rem/1 var(--f-num, var(--f-label)); color: var(--amber); text-shadow: none; }
.lb-rank-chip small { font: 700 0.9rem/1 var(--f-label); color: var(--lp-dim); }
.lb-hero .lb-face { box-shadow: inset 0 0 0 var(--u) var(--win-edge); }

.lb-cols { columns: 2 340px; column-gap: 8px; }
.lb-cols > .lb-card { break-inside: avoid; }
/* the cards: parchment, dark ink; every rule inside them (.lb-card ...) reads on cream */
.lb-card { margin: 0 0 8px; padding: 14px 16px 16px; clip-path: var(--notch); background: var(--lp-fill); box-shadow: var(--lp-ring); color: var(--lp-ink); }
.lb-card, .lb-card * { text-shadow: none; }
.lb-card h3 { margin: 0 0 10px; font: 700 1.2rem/1.1 var(--f-label); color: var(--lp-ink); }
.lb-card .hub-note, .lb-card .kicker { color: var(--lp-dim); }
.lb-card .pg-h { margin-top: 14px; color: var(--lp-ink); }

/* label–value rows, like the ledger's */
.lb-stats { display: grid; grid-template-columns: 1fr; margin: 0; }
.lb-stats > div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 6px 0; border-bottom: 2px solid rgba(82, 41, 25, 0.2); }
.lb-stats > div:last-child { border-bottom: 0; }
.lb-stats dt { font: 700 0.95rem/1.2 var(--f-label); color: var(--lp-dim); }
.lb-stats dd { margin: 0; text-align: right; font: 700 1rem/1.2 var(--f-num, var(--f-label)); color: var(--lp-ink); font-variant-numeric: tabular-nums; }
.lb .lb-stats dd[style] { color: var(--lp-ink) !important; }   /* (leaderboard.js tints a few values for the dark window) */

/* the level track and the season pass shell */
.lb-steps { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 4px; }
.lb-ms { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; clip-path: var(--notch); background: var(--slot-bg); box-shadow: var(--ring); text-align: center; }
.lb-ms > b { font: 700 1.2rem/1 var(--f-pixel); color: var(--ink-faint); text-shadow: var(--ol1); }
.lb-ms small { font: 700 0.85rem/1.1 var(--f-label); color: var(--ink-faint); }
.lb-ms.got > b { color: #6fd04a; }
.lb-ms.got small { color: var(--ink-dim); }
.lb-ms.next { box-shadow: inset 0 0 0 var(--u) var(--slot-edge), inset 0 0 0 calc(var(--u) * 2) rgba(111, 208, 74, 0.6); }
.lb-reward { display: grid; place-items: center; width: 34px; height: 34px; clip-path: var(--notch); background: rgba(40, 14, 5, 0.8); font: 700 0.7rem/1.1 var(--f-label); color: #fff; }
.lb-reward i { font: 700 1.1rem/1 var(--f-label); font-style: normal; color: var(--ink-faint); }
.lb-season { margin-top: 12px; padding: 10px 14px; clip-path: var(--notch); background: repeating-linear-gradient(135deg, rgba(255, 207, 74, 0.08) 0 8px, transparent 8px 16px), var(--slot-bg);
  box-shadow: var(--ring); font: 700 1rem/1.2 var(--f-label); color: #fff; }
.lb-season .soon { margin-left: 8px; padding: 2px 6px; background: var(--gold); color: #2a1a00; font-size: 0.85rem; }
.lb-season p { margin: 6px 0 0; font: 600 0.95rem/1.4 var(--f-text); color: var(--ink-faint); }

/* where your XP came from */
.lb-parts { display: flex; height: 14px; clip-path: var(--notch); background: rgba(40, 14, 5, 0.92); box-shadow: inset 0 0 0 var(--u) var(--win-edge); overflow: hidden; }
.lb-parts i { flex-basis: 0; min-width: 2px; }
.lb-key { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 8px 0 0; padding: 0; list-style: none; font: 700 0.92rem/1.3 var(--f-label); color: var(--lp-dim); }
.lb-key li { display: flex; align-items: center; gap: 5px; }
.lb-key i { width: 10px; height: 10px; box-shadow: 0 0 0 1px #000; }
.lb-key b { color: var(--lp-ink); font-variant-numeric: tabular-nums; }
.lb-rules { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.lb-rules li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 2px solid rgba(82, 41, 25, 0.2); font: 700 0.95rem/1.3 var(--f-label); color: var(--lp-dim); }
.lb-rules li:last-child { border-bottom: 0; }
.lb-rules b { color: var(--lp-ink); text-align: right; }
/* "How XP is earned": the rules folded under one line (leaderboard.js earned()) */
.lb-how summary { cursor: pointer; display: flex; align-items: center; gap: 6px; min-height: 40px; margin-top: 8px; list-style: none; font: 700 1rem/1.2 var(--f-label); color: var(--lp-ink); }
.lb-how summary::-webkit-details-marker { display: none; }
.lb-how summary::after { content: "›"; font-size: 1.2rem; transition: rotate .15s; }
.lb-how[open] summary::after { rotate: 90deg; }
html[data-motion="reduce"] { .lb-how summary::after { transition: none; } }

/* highlights */
.lb-hl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 4px; }
.lb-hl { --tc: #fff; display: flex; align-items: center; gap: 12px; padding: 10px 12px; clip-path: var(--notch); background: var(--parch-lit); box-shadow: inset 0 0 0 var(--u) rgba(82, 41, 25, 0.5), inset calc(var(--u) * 3) 0 0 var(--tc); min-width: 0; }
.lb-hl img { width: 36px; height: 36px; flex: none; image-rendering: pixelated; }
.lb-hl > div { min-width: 0; display: grid; gap: 2px; }
.lb-hl .kicker { margin: 0; }
.lb-hl b { font: 700 1.02rem/1.2 var(--f-label); color: var(--lp-ink); overflow-wrap: anywhere; }
.lb-hl small { font: 600 0.92rem/1.3 var(--f-text); color: var(--lp-dim); }

/* charts: flat bars, no axes but the ends */
.lb-bars { display: flex; align-items: flex-end; gap: 2px; height: 110px; padding: 0 2px; box-shadow: inset 0 calc(var(--u) * -1) 0 rgba(82, 41, 25, 0.5); }
.lb-bars i { flex: 1; min-width: 3px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.45); }
.lb-bars.hours i { background: var(--amber); }
.lb-ends { display: flex; justify-content: space-between; margin-top: 4px; font: 700 0.85rem/1 var(--f-label); color: var(--lp-dim); }
.lb-chart-note { margin: 10px 0 0; font: 700 0.9rem/1.35 var(--f-label); color: var(--lp-dim); }

/* categories */
.lb-cats { display: grid; gap: 0; max-height: 300px; overflow-y: auto; scrollbar-width: thin; }
.lb-cat { display: grid; grid-template-columns: minmax(0, 1fr) 52px 104px 56px; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 2px solid rgba(82, 41, 25, 0.2);
  font: 700 0.92rem/1.2 var(--f-label); color: var(--lp-ink); font-variant-numeric: tabular-nums; }
.lb-cat > span:not(.nm):not(.rate) { text-align: right; }
.lb-cat.head { position: sticky; top: 0; z-index: 1; background: var(--parch); color: var(--lp-dim); font-size: 0.85rem; }
.lb-cat .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-cat .rate { position: relative; height: 16px; clip-path: var(--notch); background: rgba(82, 41, 25, 0.2); }
.lb-cat .rate i { position: absolute; inset: 0 auto 0 0; background: #78b84a; }
.lb-cat .rate b { position: relative; display: block; text-align: center; font: 700 0.72rem/16px var(--f-label); color: var(--lp-ink); }

/* every prompt you've played */
.lb-dig + .lb-dig { margin-top: 12px; }
.lb-dig-head { margin: 0 0 4px; font: 700 0.95rem/1.3 var(--f-label); color: var(--lp-dim); }
.lb-dig-head b { color: var(--lp-ink); }
.lb-p { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; gap: 2px 14px; padding: 7px 10px; clip-path: var(--notch); }
.lb-p:nth-child(odd) { background: rgba(82, 41, 25, 0.08); }
.lb-p .q { font: 600 0.98rem/1.3 var(--f-body); color: var(--lp-dim); }
.lb-p .a { display: flex; align-items: center; gap: 6px; justify-content: flex-end; min-width: 0; text-align: right; }
.lb-p .a b { font: 700 0.98rem/1.2 var(--f-label); color: var(--lp-ink) !important; overflow-wrap: anywhere; }   /* (the ore beside it says which) */
.lb-p .a small { flex: none; font: 700 0.88rem/1 var(--f-label); color: var(--lp-dim); font-variant-numeric: tabular-nums; }
.lb-p .a em { font: 700 0.88rem/1.2 var(--f-label); color: var(--lp-dim); }
.lb-p .ore { width: 22px; height: 22px; flex: none; image-rendering: pixelated; }
.lb-p .tried { grid-column: 1 / -1; font: 600 0.9rem/1.3 var(--f-text); color: var(--lp-dim); }
.lb-hist > .btn { margin-top: 12px; }

/* the cursor: hub.css rings [data-nav] in gold; the rows here are plain blocks, so they need the notch to show it */
.lb [data-nav]:focus { outline: none; }
.lb-card[data-nav]:focus { box-shadow: var(--lp-on); }
.lb-hero[data-nav]:focus { box-shadow: var(--ring-on); }
.hub .lb .lb-row:focus, .hub .lb .lb-first:focus, .hub .lb .lb-p:focus, .hub .lb .lb-card[data-nav]:focus { box-shadow: var(--lp-on); }

/* ---------- phones: one column, the board then your place ---------- */
@media (max-width: 760px) {
  .lb-railed { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .lb-rail { display: none; }
  .lb-rankby { display: flex; gap: 4px; padding: 8px 10px; box-shadow: inset 0 calc(var(--u) * -1) 0 var(--win-edge); }
  .lb-rb { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; min-height: 64px; padding: 6px 2px; border: 0; clip-path: var(--notch);
    background: var(--lp-fill); box-shadow: var(--lp-ring); font: 700 0.82rem/1.05 var(--f-label); color: var(--lp-ink); text-shadow: none; cursor: pointer; }
  .lb-rb span { text-align: center; }
  .lb-rb small { font-size: 0.82rem; color: var(--lp-dim); }
  .lb-rb.on { background: var(--parch-lit); box-shadow: var(--lp-on); }
  .lb-railed > .lb-you { overflow-y: auto; overscroll-behavior: contain; }
  .lb-you { overflow: visible; padding: 12px 10px 18px; }
  .lb-hero { flex-direction: column; align-items: flex-start; gap: 12px; }
  .lb-hero h2 { font-size: 1.6rem; }
  .lb-rank-chip { flex: 1 1 calc(50% - 4px); min-width: 0; padding: 7px 8px; }
  .lb-list { padding: 10px 10px 14px; }
  /* the bar stays short: you and Your record on one line, your place under it (the sign-in note is on the You page) */
  .lb-me { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 6px 12px; padding: 10px 12px calc(env(safe-area-inset-bottom, 0px) + 10px); }
  .lb-me-who { grid-column: 2 / -1; }
  .lb-me-acts { display: flex; grid-column: 3; grid-row: 2; align-self: end; }
  .lb-me-place { grid-column: 1 / 3; grid-row: 2; justify-items: start; text-align: left; }
  .lb-me-line { justify-content: flex-start; }
  .lb-me-guest { display: none; }
  .lb-row { grid-template-columns: 26px 32px minmax(0, 1fr) auto; gap: 8px; padding-right: 8px; }
  .lb-first { grid-template-columns: 30px 48px minmax(0, 1fr) auto; gap: 8px; padding-right: 10px; }
  .lb-first .lb-val b { font-size: 1.1rem; }
  .lb-cat { grid-template-columns: minmax(0, 1fr) 40px 80px 44px; gap: 6px; }
  .lb-p { grid-template-columns: 1fr; }
  .lb-p .a { justify-content: flex-start; text-align: left; }
}

/* short screens (a phone held sideways): your place stays pinned but slim, one row, so the board above keeps three or
   more rows in view; the guest's sign-in note waits for a taller screen (Account says the same) */
@media (max-height: 500px) {
  .lb-me { gap: 4px 12px; padding: 6px 14px 8px; }
  .lb-me-guest { display: none; }
  .lb-me-rank b { font-size: 1.5rem; }
}
