:root {
  --paper: #fdfbf3;
  --rule: #c4dbf2;
  --margin: #f1a7a7;
  --ink: #2b2622;
  --pen: #1f2d6b;
  --red: #d62828;
  --green: #3d8b47;
  --forest: #e3a23b;
  --market: #4f74d0;
  --hand: 'Caveat', 'Noteworthy', 'Chalkboard SE', 'Comic Sans MS', casual, cursive;
  --body: 'Patrick Hand', 'Noteworthy', 'Chalkboard SE', 'Comic Sans MS', casual, sans-serif;
  --rough: 255px 15px 225px 15px / 15px 225px 15px 255px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --card: #fffef9;
  --muted: #6b655c;
  --hi: #fff3c4;
  --alt: #dff0d8;
  --shadow: rgba(43, 38, 34, .72);
  --dash: #c9c1b2;
  /* board palette (green pencil by default) */
  --b-paper: #fffef8; --b-paper-o: .7;
  --b-sq: #cfe7c4; --b-sq-o: .55;
  --b-ha: #3d8b47; --b-hb: #5aa463;
  --b-grid: #24304f;
  --trail: #7d7a73;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; height: 100%; }

body {
  background-color: var(--paper);
  background-image:
    linear-gradient(to right, transparent 34px, var(--margin) 34px, var(--margin) 36px, transparent 36px),
    repeating-linear-gradient(to bottom, transparent 0 31px, var(--rule) 31px 32px);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--body);
  font-size: 18px;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

button { font: inherit; color: inherit; cursor: pointer; }
.hand { font-family: var(--hand); }

#app { position: relative; height: 100dvh; max-width: 640px; margin: 0 auto; }

.screen {
  position: absolute; inset: 0;
  display: none; flex-direction: column; align-items: center;
  padding: 12px 16px calc(12px + var(--safe-b)) 44px;
}
.screen.active { display: flex; animation: page-in .35s ease both; }
@keyframes page-in { from { opacity: 0; transform: translateY(8px) rotate(-.3deg); } }

/* ---------- doodles in the margins ---------- */
.doodles { position: fixed; inset: 0; pointer-events: none; max-width: 640px; margin: 0 auto; }
.doodle { position: absolute; opacity: .9; }
.doodles.sky { z-index: 5; }
.doodle svg { width: 100%; height: 100%; display: block; overflow: visible; }
.d-sun { width: 64px; height: 64px; top: 6px; left: 2px; }
.d-moon { width: 56px; height: 56px; top: 8px; right: 6px; }
.d-fish { width: 74px; height: 40px; bottom: calc(84px + var(--safe-b)); left: 2px; }
.d-snail { width: 62px; height: 42px; bottom: calc(86px + var(--safe-b)); right: 8px; }
.d-bird { width: 46px; height: 34px; top: 42%; right: 2px; }
.d-ladybug { width: 30px; height: 30px; top: 55%; left: 4px; }
.d-star { width: 22px; height: 22px; top: 30%; left: 8px; }
.spin { transform-box: fill-box; transform-origin: center; animation: spin 24s linear infinite; }
.twinkle { animation: twinkle 2.4s ease-in-out infinite; }
.wiggle { transform-box: fill-box; transform-origin: center; animation: wiggle 2.8s ease-in-out infinite; }
.flap { transform-box: fill-box; transform-origin: center; animation: flap 1.8s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes twinkle { 50% { opacity: .35; } }
@keyframes wiggle { 50% { transform: rotate(6deg) translateX(3px); } }
@keyframes flap { 50% { transform: translateY(-3px) rotate(-4deg); } }
body.playing .doodles { display: none; }
body:not([data-screen=home]) :is(.d-sun, .d-moon, .d-fish, .d-snail, .d-bird) { display: none; }
.ground { flex: 1; width: 100%; max-width: 560px; position: relative; min-height: 0; overflow: hidden; z-index: 0; }
.ground > * { position: absolute; }
.ground svg { width: 100%; height: 100%; display: block; overflow: visible; }
.ground .g-fish { width: 70px; height: 38px; left: 4%; bottom: 14%; }
.ground .g-snail { width: 58px; height: 40px; right: 6%; bottom: 10%; }
.ground .g-bird { width: 44px; height: 32px; left: 46%; top: 18%; }
.ground .g-ladybug { width: 26px; height: 26px; right: 30%; top: 10%; }
.ground .waves { left: 0; right: 0; bottom: 4%; height: 14px; }

/* ---------- sketchy buttons ---------- */
.sketch-btn {
  position: relative; z-index: 1;
  background: var(--card); border: 2.5px solid var(--ink); border-radius: var(--rough);
  padding: 10px 18px; font-family: var(--hand); font-size: 24px; font-weight: 700;
  box-shadow: 2px 3px 0 var(--shadow);
  transition: transform .12s, box-shadow .12s;
  min-height: 48px;
}
.sketch-btn:active { transform: translate(2px, 3px); box-shadow: 0 0 0 rgba(0, 0, 0, 0); }
.sketch-btn.big { width: 100%; font-size: 30px; padding: 12px; background: var(--hi); }
.sketch-btn.alt { background: var(--alt); }
.sketch-btn.momo { background: #ffd84d; width: 100%; }
.sketch-btn[disabled] { opacity: .45; }

.icon-btn {
  width: 48px; height: 48px; padding: 8px; border: 0; background: none; color: var(--pen);
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn svg, .ctrl svg { width: 30px; height: 30px; }
.corner { position: absolute; top: 8px; right: 60px; z-index: 2; }

/* ---------- home ---------- */
.title-wrap { text-align: center; margin-top: 3vh; z-index: 1; }
#title { width: min(72vw, 300px); margin: 0 auto; }
.title-svg { width: 100%; display: block; overflow: visible; }
.title-svg path { stroke-dasharray: 1.02 1.02; stroke-dashoffset: 1.02; animation: draw .5s ease-in-out forwards; animation-delay: calc(var(--i) * .32s + .2s); }
.subtitle { margin: 2px 0 0; font-size: 24px; color: var(--pen); opacity: 0; animation: fade .6s 3.2s forwards; }
.home-board { position: relative; width: min(70vw, 42vh, 340px); aspect-ratio: 1; margin: auto; z-index: 1; transform: rotate(-3deg); }
.home-board .board-svg { width: 100%; height: 100%; display: block; }
.home-board .home-pieces { position: absolute; inset: calc(100% * 12 / 824); pointer-events: none; }
.home-board .guest .hopper { opacity: 0; animation: pop-in .45s cubic-bezier(.3, 1.6, .5, 1) forwards; animation-delay: var(--pop); }
.menu { width: 100%; max-width: 380px; display: grid; gap: 14px; z-index: 1; }
.menu > * { opacity: 0; animation: fade .4s forwards; }
.menu > :nth-child(1) { animation-delay: 4.6s; }
.menu > :nth-child(2) { animation-delay: 4.75s; }
.menu > :nth-child(3) { animation-delay: 4.9s; }
.menu-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.menu-row .sketch-btn { padding: 8px 4px; font-size: 21px; }
body.skip-intro .title-svg path, body.skip-intro .subtitle, body.skip-intro .menu > *,
body.skip-intro .home-board * { animation-delay: 0s !important; animation-duration: .01s !important; }

@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }
@keyframes pop-in { from { opacity: 0; transform: scale(.2) translateY(20%); } to { opacity: 1; transform: none; } }

/* ---------- board ---------- */
.board-svg .grid path { stroke-dasharray: 1.02 1.02; stroke-dashoffset: 1.02; animation: draw .32s ease-out forwards; animation-delay: calc(var(--i) * 55ms); }
.board-svg .paper { fill: var(--b-paper); opacity: var(--b-paper-o); }
.board-svg .sq-bg { fill: var(--b-sq); opacity: var(--b-sq-o); }
.board-svg .h-a { stroke: var(--b-ha); }
.board-svg .h-b { stroke: var(--b-hb); }
.board-svg .grid { stroke: var(--b-grid); }
.board-svg .kente-frame { display: none; }
.board-svg .sq { opacity: 0; animation: fade .35s forwards; animation-delay: calc(1.1s + var(--d) * 22ms); }
.board-svg.instant .grid path, .board-svg.instant .sq { animation-delay: 0s; animation-duration: .01s; }

#game { padding: 4px 12px calc(6px + var(--safe-b)) 40px; justify-content: flex-start; }
.board-frame {
  --size: min(calc(100vw - 64px), calc(100dvh - 318px), 540px);
  display: grid; grid-template-columns: 20px var(--size); grid-template-rows: var(--size) 22px;
  margin-left: -20px; z-index: 1;
}
.ranks { display: grid; grid-template-rows: repeat(8, 1fr); align-items: center; justify-items: center; }
.files { grid-column: 2; display: grid; grid-template-columns: repeat(8, 1fr); justify-items: center; }
.ranks span, .files span { font-family: var(--hand); font-size: 20px; color: var(--pen); opacity: 0; animation: fade .3s forwards; animation-delay: calc(1.2s + var(--i) * 40ms); }
.ranks span:nth-child(odd), .files span:nth-child(even) { transform: rotate(-6deg); }
.board { position: relative; width: var(--size); height: var(--size); touch-action: none; }
.board-art, .board-art .board-svg, .overlay { position: absolute; display: block; }
/* The art's viewBox has a 12-unit margin each side, so stretch it a little past the squares. */
.board-art, .overlay { inset: calc(var(--size) * -12 / 800); width: calc(var(--size) * 824 / 800); height: calc(var(--size) * 824 / 800); pointer-events: none; overflow: visible; }
.board-art .board-svg { inset: 0; width: 100%; height: 100%; overflow: visible; }
.pieces, .fx { position: absolute; inset: 0; pointer-events: none; }
.pieces { z-index: 1; }
#overlay { z-index: 2; }
.fx { z-index: 3; }

.piece {
  position: absolute; left: 0; top: 0; width: 12.5%; height: 12.5%;
  transform: translate(calc(var(--c) * 100%), calc(var(--r) * 100%));
  z-index: calc(var(--r) + 1);
}
.piece .hopper { position: absolute; left: -10%; top: -36.8%; width: 120%; height: 136.8%; }
.piece svg { width: 100%; height: 100%; display: block; overflow: visible; }
.char .bob { animation: bob 2.6s ease-in-out infinite; animation-delay: var(--delay, 0s); }
.char .eyes { transform-box: fill-box; transform-origin: center; animation: blink 4.6s infinite; animation-delay: var(--blink, 0s); }
.char .eyes-x, .char .eyes-happy, .char .m-oh, .char .m-grin, .char .crown, .char .king-ring { display: none; }
.char.king .crown, .char.king .king-ring { display: inline; }
.char .crown { transform-box: fill-box; transform-origin: center bottom; animation: crown-tilt 3.2s ease-in-out infinite; }
.char.crowning .crown { animation: crown-pop .8s cubic-bezier(.3, 1.8, .5, 1) both; }
.char.shocked .eyes, .char.shocked .m-smile, .char.cheer .eyes, .char.cheer .m-smile { display: none; }
.char.shocked .eyes-x, .char.shocked .m-oh, .char.cheer .eyes-happy, .char.cheer .m-grin { display: inline; }
.char.cheer .bob { animation: cheer .45s ease-in-out 2; }
.piece.dim { opacity: .55; }
.piece.must .hopper { animation: nudge .9s ease-in-out infinite; }
.piece.shake .hopper { animation: shake .4s; }
.char.dance .bob { animation: dance .6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-2.5px); } }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes cheer { 50% { transform: translateY(-8px) rotate(-4deg); } }
@keyframes dance { 25% { transform: translateY(-6px) rotate(-6deg); } 75% { transform: translateY(-6px) rotate(6deg); } }
@keyframes crown-tilt { 50% { transform: rotate(-5deg); } }
@keyframes crown-pop { 0% { transform: translateY(-60px) scale(.2); opacity: 0; } 60% { opacity: 1; } 100% { transform: none; } }
@keyframes nudge { 50% { transform: translateY(-6%); } }
@keyframes shake { 25% { transform: translateX(-8%); } 75% { transform: translateX(8%); } }

.overlay .ring { fill: none; stroke: var(--red); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 1.02 1.02; stroke-dashoffset: 1.02; animation: draw .3s ease-out forwards; }
.overlay .route { fill: none; stroke: var(--red); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: .1 15; opacity: 0; animation: fade .25s .12s forwards; }
.overlay .target { fill: rgba(214, 40, 40, .1); stroke: var(--red); stroke-width: 4; stroke-dasharray: 9 7; opacity: 0; animation: fade .25s .2s forwards; }
.overlay .xmark { fill: none; stroke: var(--red); stroke-width: 5; stroke-linecap: round; opacity: 0; animation: fade .25s .2s forwards; }
.overlay .hint-ring { fill: none; stroke: #e0a800; stroke-width: 5; stroke-dasharray: 10 8; stroke-linecap: round; }
.overlay .must-ring { fill: none; stroke: var(--red); stroke-width: 3.4; stroke-dasharray: 7 9; stroke-linecap: round; opacity: .7; }
#trail .last { fill: none; stroke: var(--trail); stroke-width: 4; stroke-linecap: round; stroke-dasharray: .1 12; opacity: .7; }

.spark { position: absolute; width: 12.5%; height: 12.5%; transform: translate(calc(var(--c) * 100%), calc(var(--r) * 100%)); z-index: 30; }
.spark svg { position: absolute; inset: -60%; width: 220%; height: 220%; overflow: visible; }
.spark .ray { stroke-dasharray: 1.02 1.02; stroke-dashoffset: 1.02; animation: draw .3s ease-out forwards, fade-out .45s .3s forwards; }
.spark .twk { transform-box: fill-box; transform-origin: center; animation: twk .7s ease-out forwards; }
/* Signature-move effects: 100 units span 1.5 squares, centred on the jumped piece. */
.spark.strike svg { inset: -33% -25% -17%; width: 150%; height: 150%; }
@keyframes fade-out { to { opacity: 0; } }
@keyframes twk { 0% { transform: scale(0) rotate(0); } 50% { transform: scale(1.2) rotate(40deg); } 100% { transform: scale(0) rotate(90deg); opacity: 0; } }

/* ---------- player bars, caption, controls ---------- */
.player-bar {
  width: 100%; max-width: 560px; display: flex; align-items: center; gap: 8px;
  min-height: 46px; padding: 2px 4px; z-index: 1; font-family: var(--hand); font-size: 22px;
  flex-wrap: nowrap; white-space: nowrap;
}
.player-bar .avatar { width: 40px; height: 46px; flex: none; }
.player-bar .avatar svg { width: 100%; height: 100%; overflow: visible; }
.player-bar .who { font-weight: 700; line-height: 1; position: relative; flex: none; padding: 2px 4px; }
.player-bar .who::after {
  content: ''; position: absolute; left: -4px; right: -4px; bottom: -5px; height: 7px; opacity: 0;
  background: no-repeat center / 100% 100% url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 8' preserveAspectRatio='none'%3E%3Cpath d='M2 5C30 2 60 7 98 3' fill='none' stroke='%23d62828' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
  transition: opacity .2s;
}
.player-bar.active .who::after { opacity: 1; }
.player-bar .status { flex: 1; min-width: 0; position: relative; height: 26px; overflow: hidden; }
.player-bar .sub { display: block; font-size: 18px; color: var(--muted); padding: 2px 4px; overflow: hidden; text-overflow: ellipsis; }
.player-bar .count { flex: none; display: flex; align-items: center; gap: 2px; font-size: 22px; }
.player-bar .count i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 1.6px solid var(--ink); margin-left: -3px; }
.player-bar .thinking { position: absolute; left: 4px; top: 0; font-size: 20px; color: var(--pen); visibility: hidden; }
.player-bar.thinking-on .sub { visibility: hidden; }
.player-bar.thinking-on .thinking { visibility: visible; animation: twinkle 1s infinite; }

.bunting-row { width: 100%; max-width: 560px; display: flex; align-items: flex-start; height: 40px; margin: -2px 0 4px; z-index: 1; }
.bunting-row .g-sun, .bunting-row .g-moon { flex: none; width: 40px; height: 40px; }
.bunting-row svg { overflow: visible; }
.bunting { flex: 1; height: 30px; margin: 2px -6px 0; }
.bunting svg { width: 100%; height: 100%; display: block; }
.bunting .flag { transform-box: fill-box; transform-origin: top center; animation: flutter 2.2s ease-in-out infinite; animation-delay: calc(var(--k) * -.2s); }
@keyframes flutter { 50% { transform: rotate(5deg); } }

.caption-zone { height: 40px; display: flex; align-items: center; justify-content: center; z-index: 2; width: 100%; }
.caption { font-size: 28px; font-weight: 700; color: var(--red); white-space: nowrap; display: inline-block; }
.caption.show { animation: write-in .7s steps(14, end) forwards, fade-out .5s 2.6s forwards; }
@keyframes write-in { from { clip-path: inset(-20% 100% -20% 0); } to { clip-path: inset(-20% -5% -20% 0); } }

.controls { margin-top: auto; width: 100%; max-width: 520px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; z-index: 1; }
.ctrl {
  min-height: 56px; border: 2px solid var(--ink); border-radius: var(--rough); background: var(--card);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  font-family: var(--hand); font-size: 18px; line-height: 1; color: var(--pen);
  box-shadow: 1.5px 2px 0 var(--shadow);
}
.ctrl:active { transform: translate(1px, 2px); box-shadow: none; }
.ctrl[disabled] { opacity: .4; }
.ctrl .ic { display: block; height: 30px; }

/* ---------- pages ---------- */
.page-head { width: 100%; display: flex; align-items: center; gap: 4px; z-index: 1; margin-left: -12px; }
.page-head h2 { margin: 0; font-size: 38px; color: var(--pen); }
.page-body { width: 100%; flex: 1; overflow-y: auto; padding: 4px 2px 16px; z-index: 1; -webkit-overflow-scrolling: touch; }
.page-foot { width: 100%; padding-top: 8px; z-index: 1; }
.field { margin-bottom: 14px; }
.label { display: block; font-size: 25px; font-weight: 700; margin-bottom: 4px; }
.label small { font-weight: 500; font-size: 18px; color: var(--muted); }
.seg { display: flex; gap: 8px; }
.seg button {
  flex: 1; min-height: 48px; border: 2px solid var(--ink); border-radius: var(--rough); background: var(--card);
  font-family: var(--hand); font-size: 22px; font-weight: 700; padding: 4px;
}
.seg button.on { background: var(--hi); box-shadow: inset 0 0 0 2px var(--red); }
.lineup { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.card {
  position: relative; border: 2px solid var(--ink); border-radius: var(--rough); background: var(--card);
  padding: 8px 6px 10px; display: flex; flex-direction: column; align-items: center; min-height: 112px; min-width: 0;
}
.card .pic { width: 64px; height: 73px; }
.card .pic svg { width: 100%; height: 100%; overflow: visible; }
.card .nm { font-family: var(--hand); font-size: 19px; font-weight: 700; line-height: 1.15; padding: 4px 6px 1px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .kd { font-size: 13px; color: var(--muted); line-height: 1.2; padding: 0 6px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .sk { display: block; box-sizing: border-box; width: 100%; white-space: normal; font-family: var(--hand); font-size: 14px; color: var(--red); line-height: 1.05; padding: 0 9px 3px; text-align: center; }
.card.sealed .sk { display: none; }
.card.locked { cursor: not-allowed; }
.card.locked .kd::after { content: ' · last one'; color: var(--red); }
.card.off { opacity: .4; filter: grayscale(.8); }
.card.on::after {
  content: ''; position: absolute; inset: -5px; pointer-events: none;
  background: no-repeat center / 100% 100% url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M50 3C80 2 98 22 97 50C96 80 76 98 48 97C18 96 2 76 3 48C4 22 24 5 58 4' fill='none' stroke='%23d62828' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E");
}

.prose { font-size: 19px; line-height: 1.45; }
.prose h3 { font-family: var(--hand); font-size: 28px; margin: 14px 0 2px; color: var(--pen); }
.prose ol, .prose ul { padding-left: 22px; margin: 4px 0; }
.prose li { margin: 4px 0; }
.prose .mini { float: right; width: 70px; height: 80px; margin: 0 0 4px 8px; }
.prose .mini svg { width: 100%; height: 100%; overflow: visible; }
.prose .tw { font-family: var(--hand); font-size: 22px; color: var(--red); }
.note { font-size: 22px; color: var(--muted); }

.packs { display: grid; gap: 14px; }
.pack { border: 2.5px solid var(--ink); border-radius: var(--rough); background: var(--card); padding: 12px; box-shadow: 2px 3px 0 var(--shadow); }
.pack h3 { margin: 0; font-family: var(--hand); font-size: 28px; }
.pack p { margin: 2px 0 8px; font-size: 17px; color: var(--muted); }
.pack .icons { display: flex; gap: 10px; margin-bottom: 8px; }
.pack .icons span { width: 56px; height: 56px; border-radius: 50%; background: #f4efe2; display: flex; align-items: center; justify-content: center; position: relative; }
.pack .icons svg { width: 46px; height: 46px; }
.pack .price { font-family: var(--hand); font-size: 26px; font-weight: 700; color: var(--green); }
.pack .row { display: flex; align-items: center; gap: 12px; }
.pack .row .sketch-btn { flex: 1; font-size: 22px; }

.toggle { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1.5px dashed var(--dash); z-index: 1; position: relative; }
.toggle input { position: absolute; opacity: 0; }
.toggle .box { flex: none; width: 34px; height: 34px; border: 2.4px solid var(--ink); border-radius: 6px 9px 5px 10px; background: var(--card); position: relative; margin-top: 2px; }
.toggle input:checked + .box::after {
  content: ''; position: absolute; inset: -6px -8px -2px -2px;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M6 22C10 25 13 29 16 34C21 22 28 12 37 5' fill='none' stroke='%23d62828' stroke-width='4.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.toggle input:focus-visible + .box { outline: 3px solid var(--pen); outline-offset: 2px; }
.toggle b { display: block; font-family: var(--hand); font-size: 25px; }
.toggle small { display: block; font-size: 16px; color: var(--muted); }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(43, 38, 34, .35); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal[hidden] { display: none; }
.sheet {
  width: 100%; max-width: 380px; background: var(--paper); border: 2.5px solid var(--ink); border-radius: var(--rough);
  padding: 18px 18px 16px; box-shadow: 3px 5px 0 var(--shadow); text-align: center;
  background-image: repeating-linear-gradient(to bottom, transparent 0 27px, var(--rule) 27px 28px);
  animation: sheet-in .35s cubic-bezier(.3, 1.5, .5, 1) both; max-height: 92dvh; overflow-y: auto;
}
@keyframes sheet-in { from { transform: scale(.85) rotate(-2deg); opacity: 0; } }
.sheet h2 { font-family: var(--hand); font-size: 40px; margin: 0; color: var(--pen); line-height: 1; }
.sheet p { margin: 6px 0 12px; }
.sheet .actions { display: grid; gap: 10px; margin-top: 12px; }
.sheet .party { display: flex; justify-content: center; gap: 4px; height: 82px; margin: 6px 0; }
.sheet .party .piece { position: relative; width: 62px; height: 62px; transform: none; }
.sheet .party .piece .hopper { top: -20%; }
.ad-slot {
  margin: 14px auto 0; width: 100%; max-width: 320px; height: 50px; border: 2px dashed #9b948a;
  display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 15px; color: #8a8378;
  background: repeating-linear-gradient(45deg, rgba(0, 0, 0, .025) 0 8px, transparent 8px 16px);
}
.ad-slot b { font-family: var(--hand); font-size: 20px; }
.momo-form { text-align: left; display: grid; gap: 8px; margin: 8px 0; }
.momo-form label { font-family: var(--hand); font-size: 21px; }
.momo-form input, .momo-form select {
  width: 100%; font: inherit; padding: 10px; border: 2px solid var(--ink); border-radius: 8px 12px 6px 10px; background: var(--card);
}
.stamp { display: inline-block; font-family: var(--hand); font-size: 24px; color: var(--red); border: 2.5px solid var(--red); padding: 0 10px; transform: rotate(-6deg); border-radius: 6px; margin: 6px 0; }

@media (min-height: 760px) { .caption { font-size: 32px; } }
@media (max-height: 620px) { .player-bar { min-height: 38px; } .player-bar .avatar { width: 32px; height: 38px; } .bunting-row { display: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01s !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; }
}

/* ---------- board palettes (Settings → Board) ---------- */
body[data-theme=ink] { --b-sq: #d6e4f7; --b-ha: #2747a8; --b-hb: #4f74d0; --b-grid: #1a2350; }
body[data-theme=sepia] { --b-paper: #f6ecd6; --b-paper-o: .9; --b-sq: #e2c9a0; --b-ha: #8b5a2b; --b-hb: #b07a3e; --b-grid: #4a3018; }
body[data-theme=sepia] .board-svg .kente-frame { display: inline; }
body[data-theme=berry] { --b-sq: #f2d3ea; --b-ha: #a23a8f; --b-hb: #c86ab6; --b-grid: #4b1f55; }
body[data-theme=contrast] { --b-paper: #fff; --b-paper-o: 1; --b-sq: #0b5a2e; --b-sq-o: 1; --b-ha: #e9ffe9; --b-hb: #8fd19e; --b-grid: #000; }
body[data-theme=contrast] .board-svg .grid path { stroke-width: 4.5; }

.themes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 10px 0 12px; border-bottom: 1.5px dashed var(--dash); }
.theme-btn { border: 2px solid var(--ink); border-radius: var(--rough); background: var(--card); padding: 6px 2px 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-family: var(--hand); font-size: 16px; line-height: 1.05; min-height: 76px; }
.theme-btn svg { width: 40px; height: 40px; }
.theme-btn.on { box-shadow: inset 0 0 0 2.5px var(--red); background: var(--hi); }

/* ---------- captured tray + in-game ad ---------- */
.tray { width: 100%; max-width: 560px; display: flex; gap: 8px; z-index: 1; margin-top: 2px; }
.tray-side { flex: 1; min-width: 0; height: 40px; display: flex; align-items: center; gap: 4px; padding: 0 8px; border: 1.6px dashed var(--dash); border-radius: 12px 6px 14px 8px; overflow: hidden; }
.tray-side .tl { font-family: var(--hand); font-size: 17px; color: var(--muted); flex: none; }
.tray-side .heads { display: flex; align-items: center; min-width: 0; }
.tray-side .heads span { width: 26px; height: 30px; flex: none; margin-left: -9px; }
.tray-side .heads span:first-child { margin-left: 0; }
.tray-side .heads svg { width: 100%; height: 100%; overflow: visible; }
.tray-side .heads span.new { animation: pop-in .4s cubic-bezier(.3, 1.6, .5, 1); }
.game-ad { margin: 6px auto 0; z-index: 1; flex: none; }
@media (max-height: 720px) { .game-ad { display: none; } .tray-side { height: 32px; } .tray-side .heads span { width: 20px; height: 24px; } }

/* ---------- sun / moon switch ---------- */
.d-sun, .d-moon, .g-sun, .g-moon { pointer-events: auto; cursor: pointer; border: 0; padding: 0; background: none; transition: opacity .3s; }
.sky .d-sun, .sky .d-moon { transition: left .5s, right .5s, opacity .3s; }

/* ---------- night mode: navy paper, faint rules, chalk ---------- */
body.night {
  --paper: #142039;
  --rule: rgba(214, 226, 255, .07);
  --margin: rgba(255, 140, 140, .22);
  --ink: #ece8dc;
  --pen: #cfdcff;
  --red: #ff7a6b;
  --green: #8fe3a0;
  --card: #1c2a4a;
  --muted: #a8b3cc;
  --hi: #2c3b63;
  --alt: #23413d;
  --shadow: rgba(0, 0, 0, .55);
  --dash: rgba(236, 232, 220, .25);
  --b-paper: #1b2746; --b-paper-o: .85;
  --b-sq-o: .22;
  --b-grid: #ece8dc;
  --trail: #ffe27a;
  color: var(--ink);
  text-shadow: 0 0 1px rgba(255, 255, 255, .35);
}
body.night[data-theme=pencil] { --b-ha: #7fd18a; --b-hb: #5fb36b; }
body.night[data-theme=ink] { --b-ha: #8fb0ff; --b-hb: #6a8ff0; }
body.night[data-theme=sepia] { --b-ha: #e0b07a; --b-hb: #b98a55; }
body.night[data-theme=berry] { --b-ha: #f08ad8; --b-hb: #c86ab6; }
body.night[data-theme=contrast] { --b-paper: #000; --b-paper-o: 1; --b-sq: #3b8f55; --b-sq-o: 1; --b-ha: #e9ffe9; --b-grid: #fff; }
body.night .sketch-btn, body.night .ctrl, body.night .seg button, body.night .card, body.night .pack, body.night .toggle .box, body.night .theme-btn { color: var(--ink); }
body.night .sketch-btn.momo { color: #2b2622; text-shadow: none; }
body.night .momo-form input, body.night .momo-form select { color: var(--ink); }
body.night .ad-slot { border-color: rgba(236, 232, 220, .35); color: var(--muted); }
body.night .modal { background: rgba(0, 0, 0, .5); }
body.night .pack .icons span { background: #26355a; }
body.night .sky .d-sun { left: auto; right: 6px; opacity: .45; }
body.night .sky .d-moon { right: auto; left: 2px; width: 64px; height: 64px; }
body.night .g-sun { order: 3; opacity: .45; }
body.night .g-moon { order: -1; }
body.night .title-svg g { stroke: #ece8dc; }
body.night .char svg { text-shadow: none; }
/* Glow only what's highlighted: the few overlay marks, the last-move trail and the side to move. */
body.night .overlay .route { animation: fade .25s .12s forwards, pulse 1.3s ease-in-out .4s infinite; filter: url(#glow); stroke: #ffb3a8; }
body.night .overlay .target { filter: url(#glow); fill: rgba(255, 226, 122, .18); stroke: #ffe27a; animation: fade .25s .2s forwards, pulse 1.3s ease-in-out .4s infinite; }
body.night .overlay .ring { stroke: #ff9c8f; }
body.night #trail .last { filter: url(#glow); stroke-width: 5; opacity: .95; }
body.night .player-bar.active .who { text-shadow: 0 0 6px #ffe27a, 0 0 14px rgba(255, 226, 122, .6); }
body.night .player-bar.active .avatar { filter: drop-shadow(0 0 6px rgba(255, 226, 122, .8)); }
.board::after { content: ''; position: absolute; left: 4%; right: 4%; height: 10px; border-radius: 50%; opacity: 0; pointer-events: none; transition: opacity .3s; z-index: 0; }
body.night .board[data-turn="1"]::after { opacity: 1; bottom: -9px; background: radial-gradient(closest-side, rgba(255, 226, 122, .75), transparent); }
body.night .board[data-turn="-1"]::after { opacity: 1; top: -9px; background: radial-gradient(closest-side, rgba(255, 226, 122, .75), transparent); }
@keyframes pulse { 50% { opacity: .45; } }

/* ---------- online play ---------- */
.sketch-btn.friend { background: #e6dcf7; }
body.night .sketch-btn.friend { background: #2f2950; }
.menu > :nth-child(4) { animation-delay: 5.05s; }
.text-in { width: 100%; font: inherit; font-size: 20px; padding: 10px 12px; border: 2px solid var(--ink); border-radius: 8px 12px 6px 10px; background: var(--card); color: var(--ink); }
.hint-s { display: block; font-size: 15px; color: var(--muted); margin-top: 4px; }
.or { text-align: center; font-size: 22px; color: var(--muted); margin: 16px 0 8px; }
.join-row { display: flex; gap: 8px; }
.join-row .code-in { flex: 1; text-transform: uppercase; letter-spacing: 4px; font-family: var(--hand); font-size: 28px; text-align: center; }
.ol-msg { min-height: 30px; font-size: 21px; color: var(--red); text-align: center; }
.code-big { font-size: 56px; letter-spacing: 6px; margin: 4px 0; color: var(--red); font-weight: 700; }
body[data-play=online] #undo-btn, body[data-play=online] #hint-btn { display: none; }
body:not([data-play=online]) #chat-btn { display: none; }
.controls { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
.ctrl { position: relative; }
.ctrl .dot { position: absolute; top: 6px; right: 12px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }
.ctrl .dot[hidden] { display: none; }
.player-bar { position: relative; }
.player-bar .clock { flex: none; font-size: 20px; color: var(--pen); min-width: 0; }
.player-bar .clock:empty { display: none; }
.player-bar .clock.low { color: var(--red); animation: twinkle .6s infinite; }

.bubble {
  position: absolute; left: 4px; z-index: 20; max-width: 78%; padding: 6px 12px; background: #fff; color: #2b2622;
  border: 2px solid #2b2622; border-radius: 16px 18px 14px 20px; font-family: var(--hand); font-size: 21px; line-height: 1.15;
  white-space: normal; box-shadow: 1px 2px 0 rgba(0, 0, 0, .35); animation: pop-in .3s cubic-bezier(.3, 1.6, .5, 1); text-shadow: none;
}
.bubble.up { bottom: calc(100% + 6px); }
.bubble.down { top: calc(100% + 6px); }
.bubble::after { content: ''; position: absolute; left: 16px; width: 12px; height: 12px; background: #fff; border: 2px solid #2b2622; transform: rotate(45deg); }
.bubble.up::after { bottom: -8px; border-top: 0; border-left: 0; }
.bubble.down::after { top: -8px; border-bottom: 0; border-right: 0; }

.chat {
  position: absolute; left: 36px; right: 8px; bottom: calc(70px + var(--safe-b)); z-index: 30; max-height: 62%;
  display: flex; flex-direction: column; gap: 6px; padding: 10px; background: var(--paper);
  border: 2.5px solid var(--ink); border-radius: var(--rough); box-shadow: 2px 4px 0 var(--shadow);
}
.chat[hidden] { display: none; }
.chat-head { display: flex; align-items: center; gap: 8px; }
.chat-head b { font-size: 26px; margin-right: auto; }
.chat-head .icon-btn { width: 40px; height: 40px; font-size: 20px; color: var(--ink); }
.chat-log { flex: 1; min-height: 60px; overflow-y: auto; font-size: 17px; line-height: 1.3; padding: 2px; }
.chat-log .line { margin: 2px 0; overflow-wrap: anywhere; }
.chat-log .line.note { color: var(--muted); font-style: italic; }
.chat-log .line.me b { color: var(--pen); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 36px; padding: 4px 12px; border: 1.8px solid var(--ink); border-radius: 14px 10px 16px 12px; background: var(--card); color: var(--ink); font-family: var(--hand); font-size: 19px; }
.chip.tiny { min-height: 0; padding: 0 6px; font-size: 14px; border-width: 1.2px; vertical-align: middle; }
.chips.emoji .chip { font-size: 20px; padding: 2px 8px; }
.chat-form { display: flex; gap: 6px; }
.chat-form input { flex: 1; min-width: 0; font: inherit; padding: 8px 10px; border: 2px solid var(--ink); border-radius: 8px 12px 6px 10px; background: var(--card); color: var(--ink); }
.chat-form .sketch-btn { min-height: 44px; padding: 4px 14px; font-size: 22px; }
.chat-count { text-align: right; color: var(--muted); font-size: 13px; margin-top: -4px; }

.net-banner {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 90; width: min(100%, 520px);
  display: flex; align-items: center; justify-content: center; gap: 10px; padding: 8px 12px calc(8px);
  background: #ffe9a8; color: #2b2622; border-bottom: 2px solid #2b2622; font-family: var(--hand); font-size: 20px; text-shadow: none;
}
.net-banner[hidden] { display: none; }
.net-banner .chip { background: #fff; color: #2b2622; border-color: #2b2622; }

/* ---------- phase 3: puzzles, leaderboards, unlocks, replay ---------- */
.menu-row.two { grid-template-columns: repeat(2, 1fr); }
.menu-row.two:has(> [hidden]) { grid-template-columns: 1fr; }
.menu-row .sketch-btn small { font-size: 18px; color: var(--red); }
.menu { gap: 10px; }
.menu .sketch-btn.big { font-size: 27px; padding: 8px 12px; }
.menu > :nth-child(5) { animation-delay: 5.2s; }
@media (max-height: 740px) { .home-board { width: min(62vw, 32vh, 300px); } .title-wrap { margin-top: 0; } #title { width: min(60vw, 240px); } }
.card.sealed { opacity: .55; filter: grayscale(.6); border-style: dashed; cursor: not-allowed; }
.card.sealed .kd { white-space: normal; color: var(--red); }
.unlock { margin: 8px 0; padding: 6px 10px; border: 2px dashed var(--green); border-radius: 12px 8px 14px 10px; font-size: 17px; }
.sketch-btn.wa { display: block; text-decoration: none; color: inherit; background: #d8f5d0; text-align: center; }
a.sketch-btn { display: block; text-decoration: none; color: inherit; text-align: center; }
body.night .sketch-btn.wa { background: #1f4a2c; }
.clip-canvas { width: 60%; max-width: 240px; border: 2px solid var(--ink); border-radius: 8px; display: block; margin: 8px auto; }
.clip-video { width: 100%; max-width: 280px; border: 2px solid var(--ink); border-radius: 8px; display: block; margin: 8px auto; background: #000; }
body[data-play=puzzle] #undo-btn, body[data-play=puzzle] #hint-btn { display: none; }
.board-list { list-style: none; counter-reset: rank; padding: 0; margin: 10px 0; }
.board-list li { counter-increment: rank; display: grid; grid-template-columns: 32px 1fr auto; grid-template-rows: auto auto; column-gap: 8px; align-items: baseline; padding: 6px 4px; border-bottom: 1.5px dashed var(--dash); }
.board-list li::before { content: counter(rank); grid-row: 1 / 3; font-family: var(--hand); font-size: 26px; color: var(--pen); }
.board-list li b { font-family: var(--hand); font-size: 23px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-list li .g { grid-column: 2; font-size: 14px; color: var(--muted); }
.board-list li .p { grid-column: 3; grid-row: 1 / 3; font-family: var(--hand); font-size: 26px; font-weight: 700; color: var(--green); }
.board-list li.me { background: var(--hi); }
.board-list li.loading { display: block; color: var(--muted); font-size: 21px; }
.board-list li.loading::before { content: none; }
.points-help { margin-top: 10px; font-size: 16px; }
.points-help summary { font-size: 21px; cursor: pointer; }
#lb-tabs { margin-top: 4px; }
select.text-in { appearance: auto; }

/* ---------- compact sheets that fit every screen ---------- */
.modal { padding: 12px; }
.sheet {
  position: relative; max-width: 340px; padding: 12px 14px; max-height: 88dvh;
  font-size: clamp(15px, 2.1vh, 18px);
}
.sheet h2 { font-size: clamp(26px, 4.2vh, 34px); padding: 0 30px; }
.sheet p { margin: 4px 0 8px; }
.sheet p.hand { font-size: clamp(18px, 2.6vh, 22px); }
.sheet .actions { gap: 8px; margin-top: 8px; }
.sheet .actions .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sheet .actions .pair > :only-child { grid-column: 1 / -1; }
.sheet .sketch-btn { font-size: clamp(17px, 2.5vh, 21px); min-height: clamp(38px, 5.2vh, 44px); padding: 4px 8px; box-shadow: 1.5px 2px 0 var(--shadow); }
.sheet .sketch-btn.big { font-size: clamp(19px, 2.9vh, 24px); padding: 4px 10px; }
.sheet .party { height: clamp(44px, 7.5vh, 70px); margin: 2px 0; }
.sheet .party .piece { width: clamp(40px, 6.5vh, 58px); height: clamp(40px, 6.5vh, 58px); }
.sheet .ad-slot { height: 44px; margin-top: 8px; }
.sheet .note { font-size: clamp(15px, 2.2vh, 19px); margin: 6px 0 0; }
.sheet .unlock { font-size: 15px; margin: 4px 0; }
.sheet .code-big { font-size: clamp(34px, 6.5vh, 50px); margin: 0; }
.sheet .clip-video { max-height: 46dvh; width: auto; max-width: 100%; }
.sheet .clip-canvas { max-height: 34dvh; width: auto; }
.sheet-x {
  position: absolute; top: 4px; right: 6px; z-index: 2; width: 40px; height: 40px; border: 0; background: none;
  font-size: 22px; line-height: 1; color: var(--ink); cursor: pointer;
}
@media (max-height: 600px) { .sheet .party { display: none; } .sheet .ad-slot { display: none; } }

/* ---------- chat docks under the board, in the page flow, so it never covers the game ---------- */
.chat {
  position: static; left: auto; right: auto; bottom: auto; max-height: none; z-index: 1;
  flex: 1 1 auto; min-height: 0; width: 100%; max-width: 560px; margin: 4px 0;
  display: flex; flex-direction: column; gap: 4px; padding: 6px 8px;
  border: 2px solid var(--ink); border-radius: 14px 10px 16px 12px; box-shadow: 1.5px 2px 0 var(--shadow);
}
body.chat-open .tray, body.chat-open .game-ad, body.chat-open .ground { display: none; }
.chat-log { flex: 1 1 auto; min-height: 0; font-size: 15px; line-height: 1.25; }
.chat-row { display: flex; gap: 6px; overflow-x: auto; flex: none; padding-bottom: 2px; scrollbar-width: none; }
.chat-row::-webkit-scrollbar { display: none; }
.chat-row .chips { flex-wrap: nowrap; flex: none; }
.chat-row .chip { white-space: nowrap; min-height: 34px; font-size: 17px; }
.chat-form { flex: none; align-items: center; }
.chat-in { position: relative; flex: 1; min-width: 0; display: flex; }
.chat-in input { width: 100%; padding-right: 40px; }
.chat-in .chat-count { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); margin: 0; font-size: 11px; }
.chat-form .sketch-btn { min-height: 40px; padding: 2px 12px; font-size: 20px; }
.chat-form .chip { min-height: 40px; padding: 2px 8px; font-size: 16px; }
.chat-form .icon-btn { width: 36px; height: 40px; padding: 0; font-size: 18px; color: var(--ink); }

/* Speech bubbles sit inside the player's own bar, next to their character, not on the board. */
.bubble, .bubble.up, .bubble.down {
  top: 50%; bottom: auto; left: 46px; transform: translateY(-50%); max-width: calc(100% - 54px);
  padding: 3px 10px; font-size: 18px; line-height: 1.1; max-height: 44px; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; animation: fade .2s;
}
.bubble::after, .bubble.up::after, .bubble.down::after { left: -7px; top: 50%; bottom: auto; margin-top: -6px; border: 2px solid #2b2622; border-top: 0; border-right: 0; }

/* ---------- privacy / terms pages and install row ---------- */
body.doc { overflow: auto; user-select: text; -webkit-user-select: text; }
.doc-page { max-width: 640px; margin: 0 auto; padding: 16px 18px 40px 50px; }
.doc-page h1 { font-size: 40px; color: var(--pen); margin: 4px 0 8px; line-height: 1.1; }
.doc-page a { color: var(--pen); }
.back-link { font-size: 22px; text-decoration: none; }
.legal { text-align: center; font-size: 17px; }
.legal a, .toggle small a { color: var(--pen); }
.install { padding: 10px 0; border-bottom: 1.5px dashed var(--dash); }
.install > b { font-size: 25px; display: block; }
.install p { margin: 2px 0 8px; font-size: 16px; color: var(--muted); }
.hint-s a { color: var(--pen); }

/* ---------- play over days ---------- */
#ol-mode-seg { margin-bottom: 4px; }
#ol-mode-hint { margin: 0 0 10px; }
.days-bar { width: 100%; max-width: 560px; z-index: 1; padding: 6px 8px; margin: 2px 0; border: 2px dashed var(--pen); border-radius: 14px 10px 16px 12px; background: var(--card); }
.days-bar[hidden] { display: none; }
.days-bar p { margin: 0 0 4px; font-size: 19px; line-height: 1.15; }
.days-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.days-actions .chip { min-height: 34px; font-size: 16px; text-decoration: none; display: inline-flex; align-items: center; }
.days-actions .chip.wa { background: #d8f5d0; color: #2b2622; }
.push-note { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; line-height: 1.25; }
body[data-play=days] .game-ad { display: none; }
body[data-play=days] #undo-btn, body[data-play=days] #hint-btn { display: none; }
.games-list { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 8px; }
.games-list li { display: flex; gap: 6px; align-items: stretch; }
.games-list li.empty { display: block; color: var(--muted); font-size: 21px; }
.game-row { flex: 1; text-align: left; border: 2px solid var(--ink); border-radius: var(--rough); background: var(--card); padding: 8px 12px; display: grid; gap: 1px; }
.game-row b { font-family: var(--hand); font-size: 24px; }
.game-row .st { font-family: var(--hand); font-size: 20px; color: var(--pen); }
.game-row .meta { font-size: 13px; color: var(--muted); }
.games-list li.mine .game-row { background: var(--hi); box-shadow: inset 0 0 0 2px var(--red); }
.games-list li.mine .st { color: var(--red); font-weight: 700; }
.games-list li.done .game-row { opacity: .7; }
.menu-row.two { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
.menu-row.two .sketch-btn { font-size: 19px; padding: 6px 2px; }

/* ---------- character packs in the line-up ---------- */
.pack-head { grid-column: 1 / -1; margin: 10px 0 0; font-size: 21px; font-weight: 700; color: var(--pen); }
.pack-head small { font-weight: 500; font-size: 16px; color: var(--muted); }
.card .lock { position: absolute; top: 4px; left: 50%; transform: translateX(-50%); z-index: 2; font-size: 12px; font-weight: 700; color: #fff; background: #2b2622; border-radius: 8px; padding: 1px 6px; white-space: nowrap; }
.card.sealed .pic { opacity: .45; filter: grayscale(1) brightness(.85); }

/* ---------- post-game recap ---------- */
.recap { text-align: left; margin: 4px 0 6px; border-left: 3px solid var(--margin); padding-left: 8px; }
.recap p { display: flex; align-items: center; gap: 6px; margin: 2px 0; font-size: clamp(17px, 2.4vh, 20px); line-height: 1.1; }
.recap .mini { flex: none; width: 28px; height: 32px; }
.recap .mini svg { width: 100%; height: 100%; overflow: visible; }
.recap .hand { color: var(--pen); }

/* ---------- leagues ---------- */
#lb-tabs button { font-size: 19px; }
.board-list li.league-head { display: block; counter-increment: none; border-bottom: 2px solid var(--ink); padding-bottom: 8px; }
.board-list li.league-head::before { content: none; }
.board-list li.league-head .g { display: block; }
.tier { font-family: var(--hand); font-size: 28px; }
.tier-0 { color: #8a8378; } .tier-1 { color: #b5703f; } .tier-2 { color: #4f74d0; } .tier-3 { color: #d23a2a; } .tier-4 { color: #c9890f; }
.board-list li.up { background: rgba(61, 139, 71, .12); }
.board-list li.down { background: rgba(214, 40, 40, .08); }
body.night .board-list li.up { background: rgba(143, 227, 160, .12); }
.pack { position: relative; }
.pack h3 small.price { font-size: 20px; margin-left: 6px; }
.pack .icons span.char { background: #f4efe2; }
.pack .icons span.char svg { width: 48px; height: 54px; overflow: visible; }
.pack .icons span.dim svg { opacity: .35; filter: grayscale(1); }
.pack.free .icons { flex-wrap: wrap; }
.pack.soon .stamp { position: absolute; top: 8px; right: 10px; margin: 0; font-size: 18px; }
.pack.soon { opacity: .9; }
.caption.long { font-size: 23px; } .caption.longer { font-size: 19px; }
@media (min-height: 760px) { .caption.long { font-size: 25px; } .caption.longer { font-size: 21px; } }
