/* ---------- the leaderboards (src/scenes/boards.js, art from tools/desk_art/area_boards.py) ----------
   A scroll that fills the screen: the felt, the boards' ribbons down its left side, two walnut rollers and the sheet of
   parchment between them. Every piece is placed by boards.js in css px (geo: --sa is one art pixel of the scroll, a
   whole number of device pixels; --fS, --fB, --fH and --fX the four print sizes, on whole font pixels). The pixel art
   is drawn at whole art pixels, the cards' own pictures smooth. What loops moves by transform or opacity, in steps, and
   stops under Motion Off and while the scroll is not open. */
#panel.area-boards { left: 0; top: 0; right: auto; bottom: auto; width: 100%; height: 100%; }
#panel.area-boards > .x { display: none; } /* the scroll's own close button sits in its header */

#panel .lb { position: absolute; inset: 0; overflow: hidden; pointer-events: auto; contain: strict;
  --a: var(--sa); --g: var(--sw); --u: var(--sw); --fu: calc(var(--sw) * var(--fs));
  --ink: #3b2a18; --ink-lt: #6b4a26; --gold: #f0c860; --red: #b8433c;
  font: 400 var(--fB) / 1.15 var(--font-ui); color: var(--ink); text-shadow: none; -webkit-user-select: none; user-select: none; }
#panel .lb button { margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; font: inherit; color: inherit; text-align: inherit; line-height: inherit; min-width: 0; min-height: 0; text-shadow: inherit; }
#panel .lb button:focus-visible { outline: calc(var(--sa) * 0.5) solid #ffd75a; outline-offset: 0; }
#panel .lb .lb-in, #panel .lb .lb-in > *, #panel .lb .lb-pod > *, #panel .lb .lb-me > *, #panel .lb .lb-casein > * { position: absolute; }
/* the sheet's inner layer spans the whole screen (its pieces are placed in the world's coordinates), so only its pieces
   take the pointer: the layer itself would cover the ribbons */
#panel .lb .lb-in { overflow: visible; pointer-events: none; }
#panel .lb .lb-in > * { pointer-events: auto; }
#panel .lb :is(.lb-pod, .lb-me, .lb-casein) { left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; }
#panel .lb :is(.lb-pod, .lb-me, .lb-casein) > * { pointer-events: auto; }
#panel .lb .lb-ico { display: inline-block; flex: none; width: calc(var(--sa) * 10); height: calc(var(--sa) * 10); background-size: 100% 100%; image-rendering: pixelated; vertical-align: middle; }
#panel .lb img { -webkit-user-drag: none; }

/* the felt, the rolled scroll as it lands (the opener fades it out), the rollers and the sheet */
#panel .lb .lb-felt { position: absolute; inset: 0; background: url(../../art/areas/boards/felt.png) 0 0 / calc(var(--sa) * 12) repeat; image-rendering: pixelated;
  box-shadow: inset 0 0 calc(var(--sa) * 24) rgba(8, 20, 12, 0.55); }
#panel .lb .lb-roll { position: absolute; opacity: 0; image-rendering: pixelated; pointer-events: none; z-index: 3; }
#panel .lb .lb-rol { position: absolute; z-index: 2; transform-origin: 0 0; pointer-events: none; border: 0 solid transparent;
  border-image-source: url(../../art/areas/boards/roller.png); border-image-slice: 10 0 10 0 fill; border-image-width: calc(var(--sa) * 10) 0; border-image-repeat: stretch;
  image-rendering: pixelated; filter: drop-shadow(var(--sa) calc(var(--sa) * 1.5) 0 rgba(10, 18, 12, 0.45)); }
#panel .lb .lb-sheet { position: absolute; z-index: 1; background: url(../../art/areas/boards/parch.png) 0 0 / calc(var(--sa) * 48) repeat; image-rendering: pixelated;
  box-shadow: inset calc(var(--sa) * 4) 0 calc(var(--sa) * 3) calc(var(--sa) * -2) rgba(110, 72, 30, 0.35), inset calc(var(--sa) * -4) 0 calc(var(--sa) * 3) calc(var(--sa) * -2) rgba(110, 72, 30, 0.35); }
#panel .lb .lb-sheet > .lb-in { position: absolute; image-rendering: auto; }

/* the boards' ribbons: a swallowtail on the felt, tucked under the left roller; the board on show pokes out further */
#panel .lb .lb-ribs { position: absolute; inset: 0; pointer-events: none; }
#panel .lb .lb-rib { position: absolute; pointer-events: auto; cursor: pointer; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; align-content: center; column-gap: calc(var(--sa) * 2);
  padding: 0 calc(var(--sa) * 7) 0 calc(var(--sa) * 5); border: 0 solid transparent;
  border-image-slice: 0 1 0 4 fill; border-image-width: 0 var(--sa) 0 calc(var(--sa) * 4); border-image-repeat: stretch; image-rendering: pixelated;
  color: #fff6dc; text-shadow: 0 var(--sw) 0 rgba(0, 0, 0, 0.5); filter: brightness(0.8) saturate(0.8); transition: filter 0.12s ease, translate 0.12s ease; }
#panel .lb .lb-rib:hover { filter: none; translate: calc(var(--sa) * -1) 0; }
#panel .lb .lb-rib.on { filter: drop-shadow(0 var(--sa) 0 rgba(8, 20, 12, 0.5)); translate: none; z-index: 1; }
#panel .lb .lb-rib .lb-ico { grid-row: span 2; }
#panel .lb .lb-rl { font-size: var(--fB); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#panel .lb .lb-you { grid-column: 2; font: 400 var(--fS) / 1 var(--font-ui); font-style: normal; color: #ffe9a8; white-space: nowrap; }
#panel .lb .lb-rib.on .lb-rl::after { content: ""; }

/* the header: the title on its wooden plate, the season's line, SEASON and ALL TIME stamped, the brass buttons */
#panel .lb .lb-title { display: flex; align-items: center; gap: calc(var(--sa) * 2); padding: 0 calc(var(--sa) * 5) 0 calc(var(--sa) * 4); border: 0 solid transparent;
  border-image: url(../../art/areas/boards/title.png) 4 fill / calc(var(--sa) * 4) stretch; image-rendering: pixelated; color: #fff1c8; text-shadow: 0 var(--sw) 0 #2a1a0c; }
#panel .lb .lb-title b { font: 400 var(--fH) / 1 var(--font-ui); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
#panel .lb .lb-line { display: flex; align-items: center; font-size: var(--fS); color: var(--ink-lt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#panel .lb .lb-line.under { align-items: flex-start; }
#panel .lb .lb-stamp { display: grid; place-items: center; cursor: pointer; font-size: var(--fS); color: #a8322a; opacity: 0.55; border: 0 solid transparent;
  border-image: url(../../art/areas/boards/stamp.png) 1 / var(--sa) stretch; image-rendering: pixelated; transition: opacity 0.12s ease; }
#panel .lb .lb-stamp:hover { opacity: 0.85; }
#panel .lb .lb-stamp.on { opacity: 1; color: #8f1f18; background: rgba(168, 50, 42, 0.12); rotate: -3deg; cursor: default; }
#panel .lb .hudb-brass { z-index: 3; }

/* names on their plates, in their inks: the plate's nine-slice with an engraved line, its ornament at either end
   (plate_orn.png: a 7 x 7 cell a plate, at the pin pixel --pp; the right one mirrored), the name centred at the print
   boards.js nameFit chose, so it is never cut. The plate's middle repeats across at its own pixel size (stretched, one
   speck of its grain became a smear beside the letters) */
#panel .lb .lb-pl { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; max-width: 100%; min-width: 0; height: 100%;
  padding: 0 calc(var(--sa) * 2 + var(--pp) * 8); border: 0 solid transparent; box-sizing: border-box;
  border-image-slice: 3 fill; border-image-width: calc(var(--sa) * 3); border-image-repeat: repeat stretch; image-rendering: pixelated; vertical-align: middle; }
#panel .lb .lb-pl::before, #panel .lb .lb-pl::after { content: ""; position: absolute; top: 50%; width: calc(var(--pp) * 7); height: calc(var(--pp) * 7); margin-top: calc(var(--pp) * -3.5);
  background: url(../../art/areas/boards/plate_orn.png) calc(var(--o, 0) * var(--pp) * -7) 0 / calc(var(--pp) * 133) calc(var(--pp) * 7) no-repeat; image-rendering: pixelated; pointer-events: none; }
#panel .lb .lb-pl::before { left: calc(var(--sa) * 2); }
#panel .lb .lb-pl::after { right: calc(var(--sa) * 2); transform: scaleX(-1); }
#panel .lb .lb-nm { display: block; min-width: 0; text-align: center; font: 400 var(--fB) / 1.1 var(--font-ui); white-space: nowrap; overflow: hidden; text-overflow: clip; color: #fff3d6;
  text-shadow: 0 var(--sw) 0 rgba(0, 0, 0, 0.6); image-rendering: auto; }
/* a plate's name: its letters outlined a font pixel wide in dark ink (four hard shadows, each outlining the last, so the
   corners fill too) */
#panel .lb .lb-inl { display: block; flex: 0 1 auto; min-width: 0; max-width: 100%; padding: 0 var(--ow);
  filter: drop-shadow(var(--ow) 0 0 #22160c) drop-shadow(calc(var(--ow) * -1) 0 0 #22160c) drop-shadow(0 var(--ow) 0 #22160c) drop-shadow(0 calc(var(--ow) * -1) 0 #22160c); }
#panel .lb .lb-inl > .lb-nm { text-shadow: none; }
#panel .lb .ink-cream { color: #fff3d6; } #panel .lb .ink-mint { color: #9ff0c4; } #panel .lb .ink-sky { color: #9fd4ff; }
#panel .lb .ink-coral { color: #ff9f8a; } #panel .lb .ink-lilac { color: #d6b4ff; } #panel .lb .ink-amber { color: #ffc85a; } #panel .lb .ink-rose { color: #ffa8cf; }
#panel .lb .ink-type { color: var(--ic); filter: brightness(1.35) saturate(1.1); }
/* gradients: the ink clipped to the letters, a dark drop below them so they read on any plate */
#panel .lb :is(.ink-sunset, .ink-ice, .ink-ember, .ink-aurora, .ink-toxic, .ink-holo, .ink-rainbow, .ink-gold, .ink-blacklabel, .ink-champion) {
  color: transparent; -webkit-background-clip: text; background-clip: text; text-shadow: none; filter: drop-shadow(0 var(--sw) 0 rgba(0, 0, 0, 0.7)); }
#panel .lb .ink-sunset { background-image: linear-gradient(90deg, #ffd36a, #ff8a5a 55%, #ff5f8f); }
#panel .lb .ink-ice { background-image: linear-gradient(90deg, #e8fbff, #8fdcff 60%, #c8e8ff); }
#panel .lb .ink-ember { background-image: linear-gradient(180deg, #ffe08a, #ff7a2a 60%, #d23a1a); }
#panel .lb .ink-aurora { background-image: linear-gradient(90deg, #7affc4, #6ac8ff 50%, #c88aff); }
#panel .lb .ink-toxic { background-image: linear-gradient(180deg, #e9ff7a, #6aff4a 60%, #2fbf3a); }
/* the moving inks: a band of colour that slides across the name, a few steps a second */
#panel .lb :is(.ink-holo, .ink-rainbow, .ink-gold, .ink-blacklabel, .ink-champion) { background-size: 300% 100%; animation: lbInk 3.2s steps(16) infinite; }
#panel .lb .ink-holo { background-image: linear-gradient(90deg, #dfe8f2, #a8f0ff, #ffd0f0, #fff2a8, #dfe8f2, #a8f0ff); }
#panel .lb .ink-rainbow { background-image: linear-gradient(90deg, #ff6a6a, #ffc24a, #f8ff6a, #6aff8a, #6ac8ff, #c86aff, #ff6a6a); }
#panel .lb .ink-gold { background-image: linear-gradient(90deg, #c9902a, #ffe9a0, #e2b04a, #fff6cf, #c9902a, #ffe9a0); }
#panel .lb .ink-blacklabel { background-image: linear-gradient(90deg, #e9bf52, #e9bf52 40%, #fff6c8 50%, #e9bf52 60%, #e9bf52); }
#panel .lb .ink-champion { background-image: linear-gradient(90deg, #ffd54a, #fff8d0, #ffb02a, #ffe98a, #ffd54a, #fff8d0); filter: drop-shadow(0 var(--sw) 0 #5a3500) drop-shadow(0 0 calc(var(--sa) * 1.5) rgba(255, 210, 90, 0.6)); }
#panel .lb .ink-glitch { color: #e8f4ff; animation: lbGlitch 2.4s steps(1) infinite; }
@keyframes lbInk { from { background-position: 0 0; } to { background-position: 150% 0; } }
@keyframes lbGlitch { 0%, 82%, 100% { text-shadow: 0 var(--sw) 0 rgba(0, 0, 0, 0.6); translate: 0 0; } 84% { text-shadow: var(--sa) 0 0 #ff3a8a, calc(var(--sa) * -1) 0 0 #3af0ff; translate: var(--sw) 0; }
  88% { text-shadow: calc(var(--sa) * -1) 0 0 #ff3a8a, var(--sa) 0 0 #3af0ff; translate: calc(var(--sw) * -1) 0; } 92% { text-shadow: 0 var(--sw) 0 rgba(0, 0, 0, 0.6); translate: 0 0; } }

/* pins: one 12 x 12 cell of pins.png each (27 cells), at the pin pixel (--pp: about half an art pixel, a whole number of
   device pixels, set by boards.js); a Customize tile shows them at a whole art pixel */
#panel .lb .lb-pin { display: inline-block; flex: none; width: calc(var(--pp) * 12); height: calc(var(--pp) * 12); vertical-align: middle; image-rendering: pixelated;
  background: url(../../art/areas/boards/pins.png) calc(var(--p) * var(--pp) * -12) 0 / calc(var(--pp) * 324) calc(var(--pp) * 12) no-repeat; }
#panel .lb .lb-pins { display: flex; gap: var(--sw); align-items: center; justify-content: flex-end; overflow: hidden; }

/* showcase frames, with the card's own picture or a slab inside */
#panel .lb .lb-frm { display: block; border: 0 solid transparent; border-image-slice: 3; border-image-width: calc(var(--sa) * 3); border-image-repeat: stretch; image-rendering: pixelated;
  padding: calc(var(--sa) * 2); box-sizing: border-box; filter: drop-shadow(var(--sa) calc(var(--sa) * 1.5) 0 rgba(60, 38, 14, 0.35)); transform-origin: 50% 90%; cursor: pointer; }
#panel .lb .lb-frm.f-vitrine { background: rgba(220, 240, 255, 0.18); }
#panel .lb .lb-frm.f-velvet { background: url(../../art/areas/boards/velvet.png) 0 0 / calc(var(--sa) * 12) repeat; }
#panel .lb .lb-frm > .cardpic { display: block; width: 100%; height: 100%; border-radius: calc(var(--sa) * 1); image-rendering: auto; }
#panel .lb .lb-frm > .cardpic .card-img { display: block; width: 100%; height: 100%; object-fit: cover; }
#panel .lb .lb-frm > .sl-box { width: 100%; height: 100%; }
#panel .lb .lb-frm.is-slab { border-image-width: calc(var(--sa) * 2); padding: calc(var(--sa) * 1.5); }
#panel .lb .lb-popbox .lb-frm:hover { translate: 0 calc(var(--sa) * -1); }

/* the champion's case: velvet in a walnut box, a laurel and a crown over their best piece */
#panel .lb .lb-case { position: absolute; border: 0 solid transparent; border-image: url(../../art/areas/boards/case.png) 3 / calc(var(--sa) * 3) stretch;
  background: url(../../art/areas/boards/velvet.png) 0 0 / calc(var(--sa) * 12) repeat; image-rendering: pixelated; box-shadow: 0 calc(var(--sa) * 1.5) 0 rgba(60, 38, 14, 0.35); }
#panel .lb .lb-laurel { background: url(../../art/areas/boards/laurel.png) 0 0 / 100% 100%; image-rendering: pixelated; }
#panel .lb .lb-crown { z-index: 1; }
#panel .lb :is(.lb-cht, .lb-chp) { display: block; text-align: center; font-size: var(--fS); line-height: 1.25; color: #ffe7a8; text-shadow: 0 var(--sw) 0 #1a0a12; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#panel .lb .lb-chp { color: #f2d6e6; }
#panel .lb .lb-chp .lb-v > i { color: #c4a0b8; }
#panel .lb .lb-champ-none { display: grid; place-items: center; text-align: center; font-size: var(--fS); line-height: 1.3; color: #f2d6e6; text-shadow: 0 var(--sw) 0 #1a0a12; padding: 0 var(--sa); }

/* the podium: medals, a light over the first, plates, pins and title, the value */
#panel .lb .lb-med { background: 0 0 / 100% 100% no-repeat; image-rendering: pixelated; z-index: 2; pointer-events: none; }
#panel .lb .lb-med.m1 { background-image: url(../../art/areas/boards/medal1.png); }
#panel .lb .lb-med.m2 { background-image: url(../../art/areas/boards/medal2.png); }
#panel .lb .lb-med.m3 { background-image: url(../../art/areas/boards/medal3.png); }
#panel .lb .lb-cone { pointer-events: none !important; background: radial-gradient(ellipse 50% 70% at 50% 0, rgba(255, 244, 200, 0.55), rgba(255, 244, 200, 0.15) 60%, transparent 75%); }
#panel .lb .lb-podn { display: flex; justify-content: center; cursor: pointer; }
#panel .lb .lb-podn > .lb-pl { width: 100%; height: 100%; }
#panel .lb .lb-podt { display: flex; align-items: center; justify-content: center; gap: var(--sa); font-size: var(--fS); color: var(--ink-lt); white-space: nowrap; overflow: hidden; }
#panel .lb .lb-podt > span { overflow: hidden; text-overflow: ellipsis; }
#panel .lb .lb-podv { flex: none; color: var(--ink); white-space: nowrap; margin-right: var(--sa); }
#panel .lb .lb-v { display: inline-flex; align-items: baseline; justify-content: flex-end; gap: calc(var(--sa) * 1.5); white-space: nowrap; }
#panel .lb .lb-v > b { font-size: var(--fB); font-weight: inherit; color: inherit; }
#panel .lb .lb-v > i { font-style: normal; font-size: var(--fS); color: var(--ink-lt); }
#panel .lb .lb-v.sm > b { font-size: var(--fS); }
#panel .lb .lb-v > i.per { margin-left: calc(var(--sa) * -1.5); }
#panel .lb .lb-pod.empty .lb-frm { opacity: 0.35; cursor: default; }
#panel .lb .lb-pt { display: grid; place-items: center; font-size: var(--fS); color: var(--ink-lt); opacity: 0.7; }

/* the rest of the hundred: rank, picture, plate, pins, value */
#panel .lb .lb-rows { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-template-rows: repeat(var(--rows), var(--rowH)); grid-auto-flow: column; column-gap: calc(var(--sa) * 6); }
#panel .lb .lb-row { position: relative; display: grid; grid-template-columns: var(--rankW) var(--thW) minmax(0, 1fr) var(--pinW) var(--valW); align-items: center; column-gap: calc(var(--sa) * 2);
  height: var(--rowH); padding: 0 calc(var(--sa) * 2) 0 0; cursor: pointer; overflow: hidden; box-shadow: inset 0 calc(var(--sw) * -1) 0 rgba(110, 75, 35, 0.22); }
#panel .lb .lb-row:hover { background: rgba(255, 238, 190, 0.35); }
#panel .lb .lb-row > .lb-pl { grid-column: 3; justify-self: start; width: min(100%, var(--plW)); height: calc(var(--rowH) - var(--sa) * 2); }
#panel .lb .lb-row > .lb-pins { grid-column: 4; }
#panel .lb .lb-row > .lb-val { grid-column: 5; }
#panel .lb .lb-rk { text-align: right; color: var(--ink-lt); font-size: var(--fS); font-weight: inherit; }
#panel .lb .lb-val { display: flex; justify-content: flex-end; align-items: center; white-space: nowrap; font-size: var(--fB); min-width: 0; }
#panel .lb .lb-th { display: block; width: var(--thW); min-width: 0; height: calc(var(--rowH) - var(--sa) * 2); border-radius: calc(var(--sa) * 0.5); overflow: hidden; background: #2a2018;
  box-shadow: 0 var(--sw) 0 rgba(60, 38, 14, 0.4); }
#panel .lb .lb-th img { display: block; width: 100%; height: 100%; min-width: 0; object-fit: cover; image-rendering: auto; }
#panel .lb .lb-th.none { background: rgba(110, 75, 35, 0.15); box-shadow: inset 0 0 0 var(--sw) rgba(110, 75, 35, 0.3); }
#panel .lb .lb-th.fx { box-shadow: 0 0 0 var(--sw) rgba(255, 255, 255, 0.85), 0 var(--sw) 0 rgba(60, 38, 14, 0.4); }
#panel .lb .lb-th.is-slab { padding: var(--sw); background: #e9e2d0; border-radius: calc(var(--sa) * 0.5); box-shadow: inset 0 calc(var(--sa) * 1.5) 0 #e9e2d0, 0 var(--sw) 0 rgba(60, 38, 14, 0.4); }
#panel .lb .lb-th.is-slab.l-black { background: #1c1915; box-shadow: inset 0 calc(var(--sa) * 1.5) 0 #e9bf52, 0 var(--sw) 0 rgba(60, 38, 14, 0.4); }
#panel .lb .lb-th.is-slab.l-gold { background: #eed898; box-shadow: inset 0 calc(var(--sa) * 1.5) 0 #cf9c30, 0 var(--sw) 0 rgba(60, 38, 14, 0.4); }
#panel .lb .lb-th.is-slab.l-silver { background: #d4dbe1; box-shadow: inset 0 calc(var(--sa) * 1.5) 0 #a1adb8, 0 var(--sw) 0 rgba(60, 38, 14, 0.4); }
#panel .lb .lb-th.is-slab img { border-radius: var(--sw); height: calc(100% - var(--sa)); margin-top: var(--sa); }
/* your own row: a strong gold band in a dark rule, two sparkles */
#panel .lb .lb-row.me { background: linear-gradient(90deg, rgba(246, 196, 64, 0.9), rgba(246, 196, 64, 0.6)); box-shadow: inset 0 0 0 var(--sw) #5e1a10, inset 0 0 0 var(--sa) #fbe3a0; }
#panel .lb .lb-row.me :is(.lb-rk, .lb-val) { color: #6e1810; text-shadow: 0 var(--sw) 0 rgba(255, 240, 200, 0.85); }
#panel .lb .lb-row.me .lb-v > i { color: #8a3a20; }
#panel .lb .lb-spk { position: absolute; width: calc(var(--sa) * 5); height: calc(var(--sa) * 5); background: url(../../art/areas/boards/sparkle.png) 0 0 / 100% 100%; image-rendering: pixelated; pointer-events: none;
  animation: lbTwinkle 1.8s steps(6) infinite; }
#panel .lb .lb-row .lb-spk.a { left: calc(var(--rankW) - var(--sa) * 2); top: 0; }
#panel .lb .lb-row .lb-spk.b { right: calc(var(--valW) + var(--sa) * 2); bottom: 0; animation-delay: -0.9s; }
@keyframes lbTwinkle { 0%, 100% { opacity: 0; scale: 0.4; } 35% { opacity: 1; scale: 1; } 60% { opacity: 0.7; scale: 0.8; } 80% { opacity: 0; scale: 0.5; } }

@keyframes lbBlink { from { opacity: 0.35; } to { opacity: 0.95; } }

/* the pager under the rows */
#panel .lb .lb-pager { display: flex; align-items: center; justify-content: space-between; gap: calc(var(--sa) * 3); font-size: var(--fS); color: var(--ink-lt); }
#panel .lb .lb-cnt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
#panel .lb .lb-pmid { display: flex; align-items: center; gap: calc(var(--sa) * 2); }
#panel .lb .lb-pgn { font-size: var(--fS); color: var(--ink); white-space: nowrap; }
#panel .lb .lb-pg { display: grid; place-items: center; width: calc(var(--sa) * 10); height: calc(var(--sa) * 9); cursor: pointer; border-radius: calc(var(--sa) * 1.5);
  background: #8a5a2b; box-shadow: inset 0 var(--sw) 0 #b07a44, 0 var(--sw) 0 #4a2e14; }
#panel .lb .lb-pg:disabled { opacity: 0.35; cursor: default; }
#panel .lb .lb-tri { width: 0; height: 0; border-top: calc(var(--sa) * 2.5) solid transparent; border-bottom: calc(var(--sa) * 2.5) solid transparent; }
#panel .lb .lb-tri.l { border-right: calc(var(--sa) * 3.5) solid #fff1c8; }
#panel .lb .lb-tri.r { border-left: calc(var(--sa) * 3.5) solid #fff1c8; }

/* buttons on the parchment */
#panel .lb .lb-btn { display: inline-flex; align-items: center; justify-content: center; gap: calc(var(--sa) * 1.5); padding: 0 calc(var(--sa) * 4); cursor: pointer; white-space: nowrap; overflow: hidden;
  font-size: var(--fB); color: #fff1c8; text-shadow: 0 var(--sw) 0 #2a1a0c; border-radius: calc(var(--sa) * 1.5); background: #8a5a2b; box-shadow: inset 0 var(--sw) 0 #b07a44, 0 var(--sw) 0 #4a2e14; }
#panel .lb .lb-btn.sm { font-size: var(--fS); height: calc(var(--sa) * 10); }
#panel .lb .lb-pager .lb-btn.sm { height: 100%; }
#panel .lb .lb-btn:hover { filter: brightness(1.12); }
#panel .lb .lb-btn:active { translate: 0 var(--sw); }
#panel .lb .lb-sw > i { width: calc(var(--sa) * 7); height: calc(var(--sa) * 4); border-radius: calc(var(--sa) * 2); background: #4a2e14; position: relative; flex: none; }
#panel .lb .lb-sw > i::after { content: ""; position: absolute; top: var(--sw); left: var(--sw); width: calc(var(--sa) * 3); height: calc(var(--sa) * 3); border-radius: 50%; background: #c9b89a; transition: translate 0.12s ease; }
#panel .lb .lb-sw.on > i { background: #3f7a3a; }
#panel .lb .lb-sw.on > i::after { translate: calc(var(--sa) * 3) 0; background: #fff1c8; }

/* notes while the boards load, or when they can't */
#panel .lb .lb-note { display: grid; place-items: center; align-content: center; gap: calc(var(--sa) * 4); text-align: center; color: var(--ink-lt); font-size: var(--fB); }
#panel .lb .lb-note p { margin: 0; }
#panel .lb .lb-note .lb-btn { height: calc(var(--sa) * 12); }
#panel .lb .lb-dots { display: inline-flex; gap: var(--sw); margin-left: var(--sa); vertical-align: baseline; }
#panel .lb .lb-dots > i { width: var(--sa); height: var(--sa); background: currentColor; animation: lbBlink 0.9s steps(2) infinite alternate; }
#panel .lb .lb-dots > i:nth-child(2) { animation-delay: 0.3s; } #panel .lb .lb-dots > i:nth-child(3) { animation-delay: 0.6s; }
#panel .lb .lb-empty { display: grid; place-items: center; margin: 0; color: var(--ink-lt); font-size: var(--fS); }

/* a player's showcase, opened from their row or place */
#panel .lb .lb-pop { position: absolute; inset: 0; z-index: 10; background: rgba(12, 18, 12, 0.6); cursor: pointer; }
#panel .lb .lb-popbox { position: absolute; cursor: default; background: url(../../art/areas/boards/parch.png) 0 0 / calc(var(--sa) * 48) repeat; image-rendering: pixelated; border-radius: calc(var(--sa) * 1.5);
  box-shadow: 0 0 0 var(--sa) #6b4a26, 0 0 0 calc(var(--sa) * 2) #2a1a0c, 0 calc(var(--sa) * 3) 0 calc(var(--sa) * 2) rgba(8, 14, 10, 0.5); }
#panel .lb .lb-popbox.me { box-shadow: 0 0 0 var(--sa) var(--gold), 0 0 0 calc(var(--sa) * 2) #2a1a0c, 0 calc(var(--sa) * 3) 0 calc(var(--sa) * 2) rgba(8, 14, 10, 0.5); }
#panel .lb .lb-popbox > * { position: absolute; }
#panel .lb .lb-popside { display: flex; flex-direction: column; gap: calc(var(--sa) * 2); min-width: 0; image-rendering: auto; }
#panel .lb .lb-popside > .lb-pl { width: var(--plW); height: var(--plH); align-self: flex-start; flex: none; }
#panel .lb .lb-popt { font-size: var(--fS); color: var(--ink-lt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#panel .lb .lb-poppins { display: flex; flex-wrap: wrap; gap: var(--sa) calc(var(--sa) * 3); font-size: var(--fS); color: var(--ink); }
#panel .lb .lb-poppins > span { display: inline-flex; align-items: center; gap: var(--sa); white-space: nowrap; }
#panel .lb .lb-popl { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: calc(var(--sa) * 7) minmax(0, 1fr) auto auto; grid-auto-rows: max-content;
  align-items: center; gap: var(--sw) calc(var(--sa) * 2); min-height: 0; overflow: hidden; font-size: var(--fS); }
#panel .lb .lb-popl li { display: contents; }
#panel .lb .lb-popl .lb-pbn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-lt); }
#panel .lb .lb-popl li > b { color: var(--red); font-weight: inherit; text-align: right; }
#panel .lb .lb-popl .lb-v { justify-self: end; }
#panel .lb .lb-popl .lb-ico { width: calc(var(--sa) * 7); height: calc(var(--sa) * 7); }
#panel .lb .lb-pop-none { display: grid; place-items: center; color: var(--ink-lt); font-size: var(--fB); margin: 0; }
#panel .lb .lb-popx { z-index: 2; }
#panel .lb .lb-ip { display: block; z-index: 1; animation: lbInspIn 0.22s ease-out both; filter: drop-shadow(var(--sa) calc(var(--sa) * 1.5) 0 rgba(60, 38, 14, 0.35)); }
#panel .lb .lb-ip > .tilt-in { display: block; width: 100%; height: 100%; }
#panel .lb .lb-ip .cardpic { display: block; width: 100%; height: 100%; border-radius: calc(var(--sa) * 1.5); image-rendering: auto; }
#panel .lb .lb-ip .cardpic .card-img { display: block; width: 100%; height: 100%; object-fit: cover; }
#panel .lb .lb-ipd { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-content: start; align-items: baseline; gap: calc(var(--sa) * 2) calc(var(--sa) * 3);
  animation: lbFade 0.22s ease-out 0.06s both; }
#panel .lb .lb-ipd > i { font-style: normal; font-size: var(--fS); color: var(--ink-lt); white-space: nowrap; }
#panel .lb .lb-ipd > b { font-weight: inherit; font-size: var(--fB); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
#panel .lb .lb-ipb { animation: lbFade 0.22s ease-out 0.1s both; }
@keyframes lbInspIn { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: none; } }
@keyframes lbFade { from { opacity: 0; } to { opacity: 1; } }
body.calm #panel .lb :is(.lb-ip, .lb-ipd, .lb-ipb) { animation: none; }

/* Your stats: your look, your places, your seasons, your records */
#panel .lb .lb-note-s { display: grid; place-items: center; text-align: center; margin: 0; padding: 0 calc(var(--sa) * 4); color: var(--ink-lt); font-size: var(--fS); line-height: 1.3;
  border: var(--sw) dashed rgba(110, 75, 35, 0.4); border-radius: calc(var(--sa) * 1.5); box-sizing: border-box; }
#panel .lb .lb-st { display: grid; grid-auto-rows: max-content; }
#panel .lb :is(.lb-st-h, .lb-st-r) { display: grid; grid-template-columns: calc(var(--sa) * 10) minmax(0, 1fr) var(--wS) var(--wA); align-items: center; column-gap: calc(var(--sa) * 2); }
#panel .lb .lb-st-h { font-size: var(--fS); color: var(--ink-lt); }
#panel .lb .lb-st-h > span:nth-child(n + 3) { text-align: right; white-space: nowrap; }
#panel .lb .lb-st-r { cursor: pointer; box-shadow: inset 0 calc(var(--sw) * -1) 0 rgba(110, 75, 35, 0.22); padding: 0; width: 100%; }
#panel .lb .lb-st-r:hover { background: rgba(255, 238, 190, 0.35); }
#panel .lb .lb-st-r > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: var(--fB); }
#panel .lb .lb-st-r > span:nth-child(n + 3) { text-align: right; font-size: var(--fS); }
#panel .lb .lb-st-r > span b { color: var(--red); font-weight: inherit; }
#panel .lb .lb-st-r > span.dim { color: var(--ink-lt); opacity: 0.6; }
#panel .lb .lb-rec { display: grid; grid-template-columns: var(--cols); grid-template-rows: var(--headH) repeat(var(--rows), minmax(0, 1fr)); gap: var(--sa) calc(var(--sa) * 2); }
#panel .lb .lb-rec-h { grid-column: 1 / 3; font-size: var(--fS); color: var(--ink-lt); font-weight: inherit; align-self: center; }
#panel .lb .lb-rec > span { display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: 0 calc(var(--sa) * 2); border-radius: calc(var(--sa) * 1); background: rgba(110, 75, 35, 0.12); }
#panel .lb .lb-rec > span i { font-style: normal; font-size: var(--fS); color: var(--ink-lt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#panel .lb .lb-rec > span b { font-weight: inherit; font-size: var(--fB); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#panel .lb .lb-lnk { grid-column: 3; justify-self: end; align-self: center; font-size: var(--fS); color: #2f5f8a; text-decoration: underline; cursor: pointer; }
#panel .lb .lb-seas { font-size: var(--fS); overflow: hidden; }
#panel .lb .lb-seas-h { display: block; color: var(--ink-lt); margin-bottom: var(--sa); }
#panel .lb .lb-seas ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(calc(var(--sa) * 70), 1fr)); gap: var(--sw) calc(var(--sa) * 3); }
#panel .lb .lb-seas li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#panel .lb .lb-seas li b { color: var(--red); font-weight: inherit; }
#panel .lb .lb-seas p { margin: 0; color: var(--ink-lt); }

/* Customize: paper tabs, your row as the boards draw it, a page of items */
#panel .lb .lb-tab { display: grid; place-items: center; cursor: pointer; font-size: var(--fS); color: var(--ink-lt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: #d9c08e; border-radius: calc(var(--sa) * 1.5) calc(var(--sa) * 1.5) 0 0; box-shadow: inset 0 calc(var(--sw) * -1) 0 rgba(110, 75, 35, 0.35); }
#panel .lb .lb-tab.on { background: #f3e2b4; color: var(--ink); box-shadow: inset 0 var(--sw) 0 #fff6dc; cursor: default; }
#panel .lb .lb-tab.back { background: #8a5a2b; color: #fff1c8; border-radius: calc(var(--sa) * 1.5); }
#panel .lb .lb-prev > .lb-row { grid-template-columns: calc(var(--sa) * 5) var(--thW) auto minmax(0, 1fr) auto; cursor: default; }
#panel .lb .lb-prev > .lb-row .lb-val { color: var(--ink-lt); font-size: var(--fS); }
#panel .lb .lb-grid { display: grid; grid-template-columns: repeat(var(--cols), var(--tileW)); grid-auto-rows: var(--tileH); gap: calc(var(--sa) * 3); align-content: start; }
#panel .lb .lb-tile { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sw); cursor: pointer; min-width: 0; overflow: hidden;
  padding: var(--sa); border-radius: calc(var(--sa) * 1.5); background: rgba(110, 75, 35, 0.1); box-shadow: inset 0 0 0 var(--sw) rgba(110, 75, 35, 0.25); }
#panel .lb .lb-tile:hover { background: rgba(255, 238, 190, 0.45); }
#panel .lb .lb-tile.on { background: rgba(240, 190, 60, 0.35); box-shadow: inset 0 0 0 var(--sa) #c9902a; }
#panel .lb .lb-tile.locked { cursor: default; }
#panel .lb .lb-tile.locked > .lb-smp { opacity: 0.45; filter: grayscale(0.6); }
#panel .lb .lb-smp { display: flex; align-items: center; justify-content: center; max-width: 100%; min-width: 0; height: calc(var(--fB) * 1.15 + var(--sa) * 2); }
#panel .lb .lb-smp > .lb-pl { width: min(100%, var(--plW)); height: 100%; }
#panel .lb .lb-tile.tt-pins .lb-smp .lb-pin { --pp: var(--sa); }
#panel .lb .lb-tile.tt-pins { flex-direction: row; justify-content: flex-start; gap: calc(var(--sa) * 2); padding: 0 calc(var(--sa) * 2); }
#panel .lb .lb-tile.tt-pins .lb-smp { height: calc(var(--sa) * 12); flex: none; }
#panel .lb .lb-tile.tt-pins > :is(.lb-tn, .lb-lock) { flex: 1 1 0; text-align: left; }
#panel .lb .lb-frs { display: block; width: calc(var(--sa) * 12); height: calc(var(--sa) * 16); border: 0 solid transparent; border-image-slice: 3; border-image-width: calc(var(--sa) * 3); image-rendering: pixelated; background: #2a2018; background-clip: content-box; padding: calc(var(--sa) * 2); }
#panel .lb .lb-tile.tt-frame .lb-smp { height: calc(var(--sa) * 16); }
#panel .lb .lb-tn { max-width: 100%; font-size: var(--fS); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#panel .lb .lb-lock { display: inline-flex; align-items: center; gap: var(--sa); max-width: 100%; font-size: var(--fS); color: var(--red); white-space: nowrap; overflow: hidden; }
#panel .lb .lb-lock > i { flex: none; width: calc(var(--sa) * 5); height: calc(var(--sa) * 6); background: url(../../art/areas/boards/lock.png) 0 0 / 100% 100%; image-rendering: pixelated; }
#panel .lb .lb-tile:has(.lb-lock) > .lb-tn { display: none; }
#panel .lb .lb-tile.locked:hover > .lb-tn { display: block; }
#panel .lb .lb-tile.locked:hover > .lb-lock { display: none; }
#panel .lb .lb-tick { position: absolute; right: var(--sa); top: var(--sa); width: calc(var(--sa) * 4); height: calc(var(--sa) * 2.5); border-left: var(--sa) solid #3f7a3a; border-bottom: var(--sa) solid #3f7a3a; rotate: -45deg; }
#panel .lb .lb-tile.tt-show { padding: var(--sa); }
#panel .lb .lb-tile.tt-show > .lb-th { height: 100%; width: auto; aspect-ratio: 64 / 88; }
#panel .lb .lb-tile.tt-show > .lb-slab { height: 100%; aspect-ratio: 22 / 32; width: auto; }
#panel .lb .lb-ord { position: absolute; right: var(--sw); top: var(--sw); display: grid; place-items: center; width: calc(var(--fS) * 1.25); height: calc(var(--fS) * 1.25); border-radius: 50%;
  background: var(--red); color: #fff1c8; font-size: var(--fS); font-weight: inherit; box-shadow: 0 0 0 var(--sw) #fff1c8; }

/* Motion Off, and a scroll not open yet: nothing loops */
body.calm #panel .lb *, body.calm #panel .lb *::before, body.calm #panel .lb *::after,
#panel.area-boards:not(.opened) .lb *, #panel.area-boards:not(.opened) .lb *::before, #panel.area-boards:not(.opened) .lb *::after { animation-play-state: paused !important; }
body.calm #panel .lb .lb-spk { animation: none; opacity: 0.9; }
body.calm #panel .lb .lb-rib { transition: none; }

/* touch: the ribbons and rows are already big targets; the pager's arrows grow */
#panel .lb.touch .lb-pg { width: calc(var(--sa) * 14); height: calc(var(--sa) * 11); }
