/* Tile Town: one cozy pixel look (pixel polish, 2026-10-14).
   Frames: Blit v2.6 UI kit PNGs in ui/ (16x16, 9-slice through border-image, 1 art pixel = 3 CSS px, never smoothed).
   Text: Tile Town Pixel (built from the Blitxt 5x7 skeleton, scripts/make-font.js), 1 font pixel = font-size / 10.
   Sizes: 15px (small), 20px (labels), 30px (big), 40px+ (scores). Shadows are hard offsets, never blurred. No gradients. */
@font-face { font-family: 'Tile Town Pixel'; src: url('fonts/TileTownPixel.woff2') format('woff2'); font-weight: 400; font-display: block; }
@font-face { font-family: 'Tile Town Pixel'; src: url('fonts/TileTownPixel-Bold.woff2') format('woff2'); font-weight: 700; font-display: block; }
:root {
  --ink: #3b2416; --line: #3b2416; --dim: #7a5534; --paper: #fff4dc; --paper2: #f3e2bb; --wood: #c8864a; --wood2: #8a5530;
  --gold: #ffc94d; --good: #2f8a2a; --bad: #c8402a; --pink: #ff8fb3; --leaf: #9ad86a; --sky: #4aa3e0;
  --font: 'Tile Town Pixel', monospace;
  --fs: 15px; --fm: 20px; --fl: 30px; --fx: 40px;
  --pop: steps(4, end);
  --out: 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 2px 0 var(--ink), 0 -2px 0 var(--ink), 2px 2px 0 var(--ink), -2px 2px 0 var(--ink), 2px -2px 0 var(--ink), -2px -2px 0 var(--ink), 0 4px 0 var(--ink), 2px 4px 0 var(--ink), -2px 4px 0 var(--ink);
  --p0: #4a7fd0; --p1: #e0607a;
}
/* low-density screens (most desktops): 1.5x text would land on half pixels, so small text goes to 2x */
@media (max-resolution: 1.49dppx) { :root { --fs: 20px; } }
* { box-sizing: border-box; }
html, body { margin: 0; color: var(--ink); font: 400 var(--fs)/1.4 var(--font); overflow-x: hidden; image-rendering: pixelated; -webkit-font-smoothing: none; }
b, strong, h1, h2, h3 { font-weight: 700; }
html { background: #a9dcff; }
body { min-height: 100vh; min-height: 100dvh; background: #a9dcff; -webkit-tap-highlight-color: transparent; }
body:not(.ready) #app { opacity: 0; pointer-events: none; }
#app { position: relative; z-index: 2; max-width: 600px; margin: 0 auto; padding: 0 12px calc(16px + env(safe-area-inset-bottom)); }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, summary:focus-visible, textarea:focus-visible { outline: 3px dashed var(--sky); outline-offset: 3px; }
img, canvas, .pix { image-rendering: pixelated; }

/* ---------- the frames (Blit UI kit) ---------- */
/* buttons: --up / --hov / --dn are the three states of one face; pressed = the face drops 2 art px (6 CSS px) */
.big, .icon, .tile, .modecard, .chcard, .seasoncard, .place, .smallbtn, .seedform button, .toggle, .nxcard, .buybtn, .soon {
  --up: url('ui/btn-paper-up.png'); --hov: url('ui/btn-paper-hover.png'); --dn: url('ui/btn-paper-down.png');
  --pt: 10px; --pb: 16px;
  border: 0; border-radius: 0; background: none; box-shadow: none; color: var(--ink);
  border-image: var(--up) 5 fill / 15px stretch; padding-top: var(--pt); padding-bottom: var(--pb);
}
@media (hover: hover) {
  .big:hover, .icon:hover, .tile:hover:not(:disabled), .modecard:hover, .chcard:hover:not(.locked), .place:hover, .smallbtn:hover, .seedform button:hover, .toggle:hover, .buybtn:hover, .soon:hover { border-image-source: var(--hov); }
}
.big:active, .icon:active, .tile:active:not(:disabled), .modecard:active, .chcard:active:not(.locked), .seasoncard:active, .place:active, .smallbtn:active, .seedform button:active, .toggle:active, .buybtn:active, .soon:active, .big.squish {
  border-image-source: var(--dn); padding-top: calc(var(--pt) + 6px); padding-bottom: calc(var(--pb) - 6px);
}
.big.primary, .tile.sel, .icon[aria-pressed="true"] { --up: url('ui/btn-honey-up.png'); --hov: url('ui/btn-honey-hover.png'); --dn: url('ui/btn-honey-down.png'); }
.big.green, .place, .toggle.on { --up: url('ui/btn-leaf-up.png'); --hov: url('ui/btn-leaf-hover.png'); --dn: url('ui/btn-leaf-down.png'); }
.buybtn { --up: url('ui/btn-berry-up.png'); --hov: url('ui/btn-berry-hover.png'); --dn: url('ui/btn-berry-down.png'); }
.toggle, .smallbtn, .seedform button, .nxcard { --up: url('ui/btn-parchment-up.png'); --hov: url('ui/btn-parchment-hover.png'); --dn: url('ui/btn-parchment-down.png'); }
.seasoncard[data-s="spring"] { --up: url('ui/btn-rose-up.png'); --dn: url('ui/btn-rose-down.png'); }
.seasoncard[data-s="summer"] { --up: url('ui/btn-honey-up.png'); --dn: url('ui/btn-honey-down.png'); }
.seasoncard[data-s="autumn"] { --up: url('ui/btn-parchment-up.png'); --dn: url('ui/btn-parchment-down.png'); }
.seasoncard[data-s="winter"] { --up: url('ui/btn-sky-up.png'); --dn: url('ui/btn-sky-down.png'); }
/* panels (wood frame): overlays, toasts, the loading card */
.overlay .card, .toast, .precard { border: 0; border-radius: 0; background: none; box-shadow: none; border-image: url('ui/panel-paper.png') 6 fill / 18px stretch; }
/* cards: boxes on the page */
.pill, .info, .goals, .statgrid div, .next, .review, .breakdown, .expert, .ach, .duocol, .names label, .endhead, .about .abrow > span, .chcard .who, .modecard .mi, .rung, .endh2h, .vbadge, .newbest, .turnbanner, .appperks {
  --card: url('ui/card-paper.png'); border: 0; border-radius: 0; background: none; box-shadow: none; border-image: var(--card) 5 fill / 15px stretch;
}
.pill.score, .endh2h { --card: url('ui/card-honey.png'); }
.pill.ahead { --card: url('ui/card-leaf.png'); } .pill.behind { --card: url('ui/card-rose.png'); }
.pill.other, .statgrid div, .ach, .appperks, .rung { --card: url('ui/card-parchment.png'); }
.about .abrow > span, .chcard .who, .modecard .mi { --card: url('ui/card-leaf.png'); }
.about .abrow.thanks > span, .newbest { --card: url('ui/card-rose.png'); }
.vbadge { --card: url('ui/card-night.png'); }
/* wells: text fields and bar tracks */
.seedform input, .names input, .card.share input, .card.share textarea, .timebar, .toggle .sw { border: 0; border-radius: 0; background: none; box-shadow: none; border-image: url('ui/well-paper.png') 4 fill / 12px stretch; }
.card.share textarea { border-image-source: url('ui/well-parchment.png'); }
/* tags: badges, medals */
.ach .medal, .toast .medal, .goals .g i, .toggle .sw::after, .preslots i, .soon .sp {
  --tag: url('ui/tag-paper.png'); border: 0; border-radius: 0; background: none; box-shadow: none; border-image: var(--tag) 4 fill / 8px stretch;
}
.ach .medal, .toast .medal, .toggle .sw::after { --tag: url('ui/tag-honey.png'); }
.goals .g.done i { --tag: url('ui/tag-leaf.png'); }

/* ---------- loading ---------- */
#preloader { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; padding: 16px; pointer-events: none; background: #a9dcff; }
body.ready #preloader { visibility: hidden; }
.precard { padding: 18px 22px 24px; text-align: center; min-width: 280px; }
.prebuild { width: 64px; height: 64px; margin: 0 auto 8px; background: url('art/build.png') 0 0 / 512px 64px no-repeat; animation: prebuild 1.2s steps(8) infinite; }
@keyframes prebuild { to { background-position: -512px 0; } }
.pretitle { font-weight: 700; font-size: var(--fm); color: var(--ink); margin-bottom: 12px; display: flex; justify-content: space-between; gap: 14px; }
.pretitle span { color: var(--good); }
.preslots { display: grid; grid-template-columns: repeat(8, 24px); gap: 6px; justify-content: center; }
.preslots i { display: block; width: 24px; height: 24px; --tag: url('ui/tag-parchment.png'); }
.preslots i.on { --tag: url('ui/tag-leaf.png'); }
.preslots i.on:nth-child(2n) { --tag: url('ui/tag-honey.png'); }
.preslots i.on:nth-child(3n) { --tag: url('ui/tag-sky.png'); }

/* ---------- top bar ---------- */
.top { position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; padding: calc(8px + env(safe-area-inset-top)) 0 8px; }
.brand { display: flex; align-items: center; background: none; border: 0; padding: 0; min-height: 44px; }
.brand:hover { transform: translateY(-2px); }
.tools { display: flex; gap: 6px; }
.icon { --pt: 3px; --pb: 9px; width: 48px; height: 48px; display: grid; place-items: center; padding-left: 0; padding-right: 0; }

.screen[hidden], .overlay[hidden], [hidden] { display: none !important; }
.screen.enter { animation: enter .24s steps(3, end); }
@keyframes enter { from { opacity: 0; transform: translateY(9px); } }

/* ---------- menu / welcome ---------- */
.hero { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
#menuArt { position: absolute; left: 0; top: 0; display: block; }
.wm { position: relative; z-index: 2; justify-self: center; align-self: center; }
.wm .logo { position: relative; }
#logoHop { position: absolute; left: 0; top: 0; }
.logo { display: block; margin: 0 auto; animation: bob 3.8s steps(1, end) infinite; transform-origin: 50% 100%; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 30% { transform: translateY(-6px); } 50% { transform: translateY(-3px); } 70% { transform: translateY(-3px); } 85% { transform: translateY(0); } }
#wmSpark { position: absolute; left: 0; top: 0; pointer-events: none; }
/* About */
.about .abrow { display: flex; gap: 12px; align-items: center; margin: 8px 0; }
.about .abrow > span { flex: none; display: grid; place-items: center; width: 50px; height: 50px; padding-bottom: 4px; }
.about .abrow p { margin: 0; }
.about .ver { text-align: center; color: var(--dim); margin: 10px 0 0; }
.tag { text-align: center; color: var(--dim); margin: 0; }
.big { display: block; position: relative; width: 100%; min-height: 52px; padding-left: 14px; padding-right: 14px; font-weight: 700; font-size: var(--fm); line-height: 1.2; text-align: center; }
.big small { display: block; font-weight: 400; font-size: var(--fs); color: var(--dim); margin-top: 2px; }
.big.primary small { color: #6e4a1c; }
.big.green small { color: #2e5a1c; }
/* Play: the label breathes in two steps (no smooth scaling), the button squishes (pressed frame) when tapped */
.play { --pt: 8px; --pb: 15px; }
.play .playlab { display: block; font-size: var(--fl); line-height: 1.15; animation: breathe-lab 2.6s steps(1, end) infinite; }
@keyframes breathe-lab { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.play::before { content: ''; position: absolute; right: 14px; top: 8px; width: 24px; height: 24px; background: url('art/spark.png') 0 0 / auto 24px no-repeat; opacity: 0; animation: breathe 2.6s steps(1, end) infinite; pointer-events: none; } /* one twinkle in the corner */
@keyframes breathe { 40%, 60% { opacity: 1; } 50% { opacity: .6; } }
#screenMenu .play { --pt: 4px; --pb: 11px; min-height: 0; }
#screenMenu .play .playlab { line-height: 1.05; }
#screenMenu .buybtn { --pt: 4px; --pb: 10px; min-height: 0; }
#screenMenu .big small { margin-top: 0; }
#screenMenu .row2 .big { --pt: 5px; --pb: 11px; min-height: 0; padding-left: 10px; padding-right: 10px; }
/* web edition: a Blit padlock on everything in the full game (no price tags on the front; Rick, 2026-10-15) */
.padlock { position: absolute; top: -10px; right: -4px; z-index: 3; pointer-events: none; line-height: 0; }
.padlock[hidden] { display: none; }
#btnAch { position: relative; }
.padlock.mini { top: -7px; right: -7px; }
.play small .streak { display: inline-flex; align-items: center; gap: 2px; margin-left: 8px; vertical-align: -2px; color: #8a3a12; font-weight: 700; }
.buybtn { --pt: 6px; --pb: 12px; display: flex; align-items: center; justify-content: center; gap: 10px; padding-left: 14px; padding-right: 12px; min-height: 52px; color: #fffaf0; text-align: left; overflow: visible; }
.buybtn .buylab { flex: 1; min-width: 0; font-size: var(--fm); font-weight: 700; line-height: 1.2; text-shadow: 0 2px 0 #7a2416; }
.buybtn .buylab small { color: #ffe3cc; font-size: var(--fs); font-weight: 400; text-shadow: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.buybtn .buykey { flex: none; line-height: 0; animation: key-wiggle 2.4s steps(1, end) infinite; }
@keyframes key-wiggle { 0%, 70%, 100% { transform: none; } 78% { transform: translateY(-3px); } 86% { transform: translateY(0); } 92% { transform: translateY(-2px); } }
#btnAgain canvas, #btnReplay canvas { vertical-align: -4px; margin-right: 8px; }
/* ---------- front buttons (Rick 2026-10-15: "I still hate the buttons at the bottom") ----------
   One hero Play, Challenges and Ways to play smaller and matching, Unlock full game a small friendly secondary (web only).
   The buttons are objects in the town, drawn in Blit v2.8: wooden signs on posts (fb-sign), market stalls (fb-stall) or
   cloth banners on a rod; signs won (artifacts/front-buttons/PICK.md). Pressed = the down frame. */
#screenMenu .menubody .big { min-height: 0; }
#screenMenu #btnDaily .playlab { font-size: var(--fx); line-height: 1.05; }
#screenMenu .row2 .big { font-size: var(--fm); }
#screenMenu .row2 { gap: 12px; }
#screenMenu .row2 .big { padding-left: 6px; padding-right: 6px; }
@media (max-width: 380px) { #screenMenu .row2 .big { font-size: var(--fs); } #screenMenu .row2 .big small { display: none; } } /* narrow phones: the sign names only, the small lines would wrap to three lines */
/* wooden signs, standing on posts in the meadow */
body.fb-sign #screenMenu .big { --up: url('ui/sign-parchment-up.png'); --hov: url('ui/sign-parchment-hover.png'); --dn: url('ui/sign-parchment-down.png'); border-image: var(--up) 5 fill / 15px stretch; }
body.fb-sign #screenMenu #btnDaily { --up: url('ui/sign-honey-up.png'); --hov: url('ui/sign-honey-hover.png'); --dn: url('ui/sign-honey-down.png'); --pt: 10px; --pb: 16px; }
body.fb-sign #screenMenu #btnChallenges { --up: url('ui/sign-leaf-up.png'); --hov: url('ui/sign-leaf-hover.png'); --dn: url('ui/sign-leaf-down.png'); }
body.fb-sign #screenMenu .row2 .big { --pt: 8px; --pb: 14px; }
body.fb-sign #screenMenu .row2 .big::after { content: ''; position: absolute; z-index: -1; left: 14%; right: 14%; top: calc(100% - 12px); height: var(--post, 36px); pointer-events: none;
  background: url('ui/post-foot.png') left bottom / 48px 48px no-repeat, url('ui/post-foot.png') right bottom / 48px 48px no-repeat, url('ui/post.png') left top / 48px 48px repeat-y, url('ui/post.png') right top / 48px 48px repeat-y; }
body.fb-sign #screenMenu .big:active { padding-top: calc(var(--pt) + 3px); padding-bottom: calc(var(--pb) - 3px); }
body.fb-sign #screenMenu .play::before { top: 14px; right: 18px; }
@media (hover: hover) { body.fb-sign #screenMenu .big:hover { border-image-source: var(--hov); } }
body.fb-sign #screenMenu .big:active, body.fb-sign #screenMenu .big.squish { border-image-source: var(--dn); }
/* web edition: "Coming soon on Google Play" (text + a Blit phone; no Google logo or badge art until the listing exists) */
#app:not([data-screen="screenMenu"]) #btnSoon { display: none; }
.soon { --pt: 4px; --pb: 10px; display: inline-flex; align-self: center; align-items: center; gap: 8px; padding-left: 10px; padding-right: 14px; min-height: 44px; font-size: var(--fs); font-weight: 700; text-align: left; line-height: 1.15; }
.soon .sp { flex: none; display: grid; place-items: center; width: 34px; height: 34px; --tag: url('ui/tag-sky.png'); padding-bottom: 2px; }
.soon .sp img { width: 32px; height: 32px; }
.soon small { display: block; font-weight: 400; color: var(--dim); }
.appcard .soon { margin: 2px auto 0; display: flex; width: max-content; max-width: 100%; }
.appcard .apphead { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.appcard .apphead h2 { margin: 0; }
.appcard .apphead .appkey { flex: none; line-height: 0; }
.appcard > .small { margin: 4px 0 0; }
.appperks { list-style: none; padding: 10px 12px 14px; margin: 8px 0 8px; display: flex; flex-direction: column; gap: 6px; }
.appperks li { display: flex; align-items: center; gap: 10px; }
.appperks li > span:first-child { flex: none; line-height: 0; }
.appprice { text-align: center; margin: 0 0 8px; font-size: var(--fs); color: var(--dim); }
#flyLayer { position: fixed; left: 0; top: 0; z-index: 40; pointer-events: none; }
/* time of day: the scene canvas paints the sky; the page color behind it just matches its top band */
body.tod-day { background: #a9dcff; } body.tod-morning { background: #ffd9b8; } body.tod-golden { background: #ffc9a0; } body.tod-evening { background: #b9a8e8; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seedform { display: flex; gap: 8px; }
.seedform input { flex: 1; min-width: 0; min-height: 50px; padding: 10px 12px; color: var(--ink); font: inherit; font-size: var(--fm); text-transform: uppercase; letter-spacing: 2px; }
.seedform button { --pt: 9px; --pb: 15px; min-height: 50px; padding-left: 14px; padding-right: 14px; font-weight: 700; }
.fronthelp .inl { display: inline-block; vertical-align: -3px; line-height: 0; }
.fronthelp li[hidden] { display: none; }
.fronthelp .rules canvas { background: none; border: 0; }
.statgrid div { padding: 7px 4px 11px; text-align: center; font-size: var(--fs); color: var(--dim); line-height: 1.2; }
.statgrid b { display: block; font-size: var(--fm); color: var(--ink); }

#flyLayer { position: fixed; inset: 0; pointer-events: none; z-index: 30; }
.fly { position: fixed; font-weight: 700; font-size: var(--fl); color: var(--gold); text-shadow: var(--out); will-change: transform, opacity; white-space: nowrap; }
.fly.neg { color: #ff8a70; }

/* ---------- end (Rick 2026-10-17): summary, one hero button, three small buttons, details folded ----------
   Order top to bottom: Town complete! + town line, the score, the badge beside its title, the three tiers in one row, one line
   about Mayor Bot; Play again (the front's Play sign) with a small line under it; Share score / Save postcard / Menu;
   "See how you did" closed (chart, turn tips, points, postcard, Replay this board). Nothing scrolls until that is opened. */
#screenEnd { padding-top: 2px; }
#screenEnd:not([hidden]) { display: flex; flex-direction: column; gap: 8px; }
#screenEnd > * { margin-top: 0; margin-bottom: 0; }
.endhead { text-align: center; padding: 8px 10px 12px; overflow: hidden; }
.endtitle { display: block; margin: 0 auto; }
.endtown { color: var(--good); letter-spacing: 1px; font-weight: 700; font-size: var(--fs); line-height: 1.2; }
.endscore { font-size: 48px; font-weight: 700; color: var(--gold); text-shadow: var(--out); line-height: 1; margin: 4px 0 6px; }
.reveal { position: relative; min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 8px; opacity: 0; }
.reveal.on { animation: reveal .5s steps(4, end) forwards; }
.reveal .badge { animation: none; line-height: 0; }
.reveal.on .badge { animation: drop .5s steps(4, end) .25s both; }
.reveal.lv0.on { animation-duration: .3s; }
.lvtitle { max-width: calc(100% - 60px); height: auto !important; }
@keyframes reveal { to { opacity: 1; } }
@keyframes drop { from { transform: translateY(-30px); opacity: 0; } }
.sparks { position: absolute; inset: -8px 0; pointer-events: none; }
.sparks canvas { position: absolute; opacity: 0; animation: twinkle 1.1s steps(5, end) both; }
@keyframes twinkle { 0% { opacity: 0; } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(-12px); } }
.ladder { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 6px 0 4px; }
.rung { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 2px 9px; opacity: .5; filter: grayscale(1); text-align: center; min-width: 0; }
.rung > span { min-width: 0; max-width: 100%; }
.rung b { display: block; font-size: var(--fs); line-height: 1.2; } .rung small { display: block; color: var(--dim); line-height: 1.2; }
.rung.got { opacity: 1; filter: none; --card: url('ui/card-honey.png'); }
@media (max-width: 380px) { .ladder { grid-template-columns: 1fr; gap: 4px; } .rung { flex-direction: row; gap: 6px; padding: 3px 8px 7px; text-align: left; } .rung > span { flex: 1; display: flex; justify-content: space-between; gap: 6px; } } /* narrow phones: three short rows, the names do not fit three across */
.endvs { color: var(--ink); margin-top: 4px; line-height: 1.3; }
.endgoals { margin-top: 6px; text-align: left; }
.endh2h { display: inline-block; margin-top: 6px; padding: 4px 14px 9px; color: var(--ink); font-weight: 700; font-size: var(--fm); }
.newbest { display: inline-block; margin-top: 6px; padding: 3px 12px 8px; color: #4a1a2e; font-weight: 700; animation: bump .6s steps(2, end) 2; }
/* the hero: the front's Play sign */
.endgo { display: flex; flex-direction: column; gap: 8px; }
body.fb-sign #btnAgain { --up: url('ui/sign-honey-up.png'); --hov: url('ui/sign-honey-hover.png'); --dn: url('ui/sign-honey-down.png'); border-image: var(--up) 5 fill / 15px stretch; --pt: 8px; --pb: 15px; font-size: var(--fl); line-height: 1.15; min-height: 0; }
@media (hover: hover) { body.fb-sign #btnAgain:hover { border-image-source: var(--hov); } }
body.fb-sign #btnAgain:active, body.fb-sign #btnAgain.squish { border-image-source: var(--dn); padding-top: calc(var(--pt) + 3px); padding-bottom: calc(var(--pb) - 3px); }
.endnote { text-align: center; color: var(--dim); font-size: var(--fs); line-height: 1.2; margin-top: -2px; }
.endrow { display: grid; grid-template-columns: 1fr 1.15fr .75fr; gap: 6px; }
.endrow .smallbtn { padding-left: 4px; padding-right: 4px; font-size: var(--fs); line-height: 1.2; }
/* the details: closed by default, a plain triangle that turns when open (the pixel font has no arrow glyph) */
.endmore > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 6px 2px; font-weight: 700; font-size: var(--fm); color: var(--ink); }
.endmore > summary::-webkit-details-marker { display: none; }
.endmore > summary::after { content: ''; width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent; border-top: 10px solid var(--ink); }
.endmore[open] > summary::after { border-top: 0; border-bottom: 10px solid var(--ink); }
.endmore[open] > summary { margin-bottom: 6px; }
.endmore > * + * { margin-top: 10px; }
.review { padding: 12px 12px 16px; }
.review > img { display: block; margin: 0 auto 6px; }
#reviewChart { display: block; margin: 0 auto 6px; max-width: 100%; }
.review .wait { color: var(--dim); text-align: center; padding: 6px; }
.miss { display: flex; gap: 8px; align-items: flex-start; padding: 6px 8px; margin: 6px 0; background: #ffe2d6; border-left: 6px solid var(--bad); }
.miss.good { background: #e3f6cf; border-left-color: var(--good); }
.miss .tn { flex: none; font-weight: 700; min-width: 56px; }
.review .note { color: var(--dim); margin: 6px 2px; }
.allturns summary, .breakdown summary { cursor: pointer; font-weight: 700; padding: 6px 2px; min-height: 32px; }
.allturns table { width: 100%; border-collapse: collapse; }
.allturns th { text-align: left; color: var(--dim); font-weight: 400; }
.allturns td, .allturns th { padding: 3px 4px; border-bottom: 2px dotted #dcc18e; }
.allturns tr.behind td:last-child { color: var(--bad); }
.allturns tr.ahead td:last-child { color: var(--good); }
.allturns tr.missed td:first-child { font-weight: 700; color: var(--bad); }
.breakdown { padding: 8px 12px 14px; }
.bk { border-bottom: 2px dotted #dcc18e; padding: 6px 0; }
.bk:last-child { border: 0; }
.bk .row { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.bk .row .v { margin-left: auto; }
.bk .lines { color: var(--dim); padding-left: 34px; display: flex; flex-wrap: wrap; gap: 2px 10px; }
.bk.total .row { font-size: var(--fm); color: var(--ink); }
.postcard { display: block; width: 100%; border: 3px solid var(--ink); box-shadow: 0 6px 0 var(--ink); margin: 6px 0 18px; }
@media (max-height: 599px) { .endhead { padding: 6px 10px 10px; } .endscore { font-size: 40px; margin: 2px 0 4px; } .reveal { min-height: 40px; } } /* phones on their side: a shorter summary */
/* wide screens (phones on their side, desktop): the summary on the left, the buttons and the details on the right */
@media (min-width: 900px) and (min-height: 400px) {
  #screenEnd:not([hidden]) { display: grid; grid-template-columns: minmax(300px, 440px) minmax(300px, 520px); grid-template-rows: auto 1fr; column-gap: 20px; justify-content: center; align-items: start; }
  #app[data-screen="screenEnd"] { max-width: 1000px; }
  .endhead { grid-row: 1 / 3; }
  .endmore { min-height: 0; max-height: calc(100vh - 220px); max-height: calc(100dvh - 220px); overflow-y: auto; }
}

/* ---------- challenges list ---------- */
#screenChallenges { padding-top: 2px; }
.sethead { display: flex; align-items: center; justify-content: space-between; margin: 14px 2px 6px; font-weight: 700; font-size: var(--fm); }
.sethead small { color: var(--dim); font-size: var(--fs); }
.chcard { --pt: 9px; --pb: 15px; display: flex; gap: 10px; align-items: center; width: 100%; min-height: 60px; text-align: left; margin-bottom: 8px; padding-left: 12px; padding-right: 12px; }
.chcard .who { flex: none; display: grid; place-items: center; width: 48px; height: 48px; padding-bottom: 4px; }
.chcard .t { flex: 1; min-width: 0; }
.chcard .t b { font-size: var(--fm); }
.chcard .t div { color: var(--dim); }
.chcard .st { flex: none; min-width: 28px; }
.chcard.locked { opacity: .55; filter: grayscale(.8); }

/* ---------- ways to play ---------- */
.modecard { --pt: 9px; --pb: 15px; display: flex; gap: 12px; align-items: center; width: 100%; min-height: 68px; text-align: left; margin-bottom: 9px; padding-left: 12px; padding-right: 12px; }
.modecard .mi { flex: none; display: grid; place-items: center; width: 56px; height: 56px; padding-bottom: 4px; }
.modecard .t { flex: 1; min-width: 0; } .modecard .t b { font-size: var(--fm); } .modecard .t div { color: var(--dim); }
.modecard .bst { flex: none; color: var(--dim); text-align: right; }
.modecard[data-m="zen"] .mi { --card: url('ui/card-leaf.png'); } .modecard[data-m="rush"] .mi { --card: url('ui/card-rose.png'); } .modecard[data-m="seasons"] .mi { --card: url('ui/card-honey.png'); } .modecard[data-m="duo"] .mi { --card: url('ui/card-sky.png'); } .modecard[data-m="practice"] .mi { --card: url('ui/card-parchment.png'); }
#screenModes .seedform { margin: 2px 0 12px; }
.zenbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; color: var(--ink); font-weight: 700; }
.smallbtn { --pt: 8px; --pb: 14px; min-height: 48px; padding-left: 14px; padding-right: 14px; font-weight: 700; }
#app[data-mode="zen"] #pillBot { display: none; }
#screenEnd[data-kind="zen"] .reveal, #screenEnd[data-kind="zen"] .ladder, #screenEnd[data-kind="zen"] .review { display: none; }
#board.grow { animation: grow .5s steps(3, end); }
@keyframes grow { 0% { transform: translateY(6px); } 60% { transform: translateY(-3px); } }

/* ---------- seasons ---------- */
.seasoncard { --pt: 8px; --pb: 14px; display: flex; gap: 10px; align-items: center; width: 100%; min-height: 64px; text-align: left; margin: 7px 0; padding-left: 12px; padding-right: 12px; color: var(--ink); }
.seasoncard .t { flex: 1; min-width: 0; } .seasoncard b { font-size: var(--fm); } .seasoncard .t div { color: var(--dim); }
.seasoncard .bst { flex: none; display: flex; align-items: center; gap: 4px; font-weight: 700; color: var(--dim); }
.goals.twist { flex-direction: row; align-items: center; gap: 8px; }
#app[data-season="winter"] .goals.twist { --card: url('ui/card-sky.png'); } #app[data-season="spring"] .goals.twist { --card: url('ui/card-rose.png'); } #app[data-season="autumn"] .goals.twist { --card: url('ui/card-parchment.png'); } #app[data-season="summer"] .goals.twist { --card: url('ui/card-honey.png'); }

/* ---------- rush ---------- */
#app[data-mode="rush"] #pillBot { display: none; }
.timebar { height: 24px; margin: 0 2px 6px; padding: 6px 6px 6px 9px; }
.timebar i { display: block; height: 100%; width: 100%; border-image: url('ui/bar-leaf.png') 3 fill / 6px stretch; }
.timebar.low i { border-image-source: url('ui/bar-berry.png'); }
#app[data-mode="rush"] #pillTurn.low { --card: url('ui/card-rose.png'); animation: bump .5s steps(2, end) infinite; }
#app[data-mode="rush"] #pillOther { --card: url('ui/card-rose.png'); }
#pillOther.hot b { color: #c8306a; animation: bump .3s steps(2, end); }
.turnbanner.count { font-size: 60px; padding: 4px 34px 14px; line-height: 1.1; }
.turnbanner.go { --card: url('ui/card-leaf.png'); font-size: var(--fx); }
#screenEnd[data-kind="rush"] .reveal, #screenEnd[data-kind="rush"] .ladder, #screenEnd[data-kind="rush"] .review, #screenEnd[data-kind="rush"] .breakdown, #screenEnd[data-kind="rush"] .endvs { display: none; }

/* ---------- pass and play ---------- */
#app[data-mode="duo"] #pillBot { display: none; }
#app[data-mode="duo"][data-player="0"] #board { box-shadow: 0 0 0 3px var(--p0); }
#app[data-mode="duo"][data-player="1"] #board { box-shadow: 0 0 0 3px var(--p1); }
#app[data-mode="duo"][data-player="0"] #pillTurn { --card: url('ui/card-sky.png'); } #app[data-mode="duo"][data-player="1"] #pillTurn { --card: url('ui/card-rose.png'); }
.turnbanner { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); opacity: 0; pointer-events: none; padding: 8px 22px 14px; font-size: var(--fl); font-weight: 700; color: #fff; text-shadow: var(--out); white-space: nowrap; z-index: 2; }
.turnbanner.p0 { --card: url('ui/card-sky.png'); } .turnbanner.p1 { --card: url('ui/card-rose.png'); }
.turnbanner.show { animation: banner 1.5s steps(1, end) both; }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, -40%); } 8% { opacity: 1; transform: translate(-50%, -54%); } 16% { transform: translate(-50%, -50%); } 82% { opacity: 1; transform: translate(-50%, -50%); } 90% { opacity: 1; transform: translate(-50%, -56%); } 100% { opacity: 0; transform: translate(-50%, -60%); } }
.names { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0 4px; }
.names label { min-width: 0; display: flex; flex-direction: column; gap: 4px; font-weight: 700; padding: 8px 10px 14px; }
.names .p0 { --card: url('ui/card-sky.png'); } .names .p1 { --card: url('ui/card-rose.png'); }
.names input { min-height: 46px; padding: 8px 10px; font: inherit; font-size: var(--fm); color: var(--ink); min-width: 0; }
.duobox { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0 4px; }
.duocol { padding: 8px 8px 14px; text-align: center; }
.duocol.p0 { --card: url('ui/card-sky.png'); } .duocol.p1 { --card: url('ui/card-rose.png'); } .duocol.win { outline: 4px solid var(--gold); outline-offset: 2px; }
.duocol b { display: block; font-size: var(--fm); } .duocol .sc { font-size: var(--fl); font-weight: 700; line-height: 1.1; }
.duocol canvas { display: block; margin: 4px auto; border: 3px solid var(--ink); max-width: 100%; height: auto !important; }
.duocol .lv { display: flex; align-items: center; justify-content: center; gap: 4px; color: var(--dim); min-height: 24px; }
#screenEnd[data-kind="duo"] .reveal, #screenEnd[data-kind="duo"] .ladder, #screenEnd[data-kind="duo"] .review, #screenEnd[data-kind="duo"] .breakdown { display: none; }

/* ---------- expert toggles (Challenges screen) ---------- */
.expert { padding: 10px 12px 16px; margin: 8px 0 12px; }
.xhead { display: flex; justify-content: space-between; align-items: baseline; font-size: var(--fm); margin-bottom: 4px; }
.xhead span { font-size: var(--fs); color: var(--dim); }
.toggle { --pt: 7px; --pb: 13px; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; margin: 4px 0; padding-left: 10px; padding-right: 10px; text-align: left; }
.toggle .tl { flex: 1; min-width: 0; } .toggle .tl b { display: block; font-size: var(--fm); } .toggle .tl small { display: block; color: var(--dim); font-size: var(--fs); }
.toggle .sw { flex: none; position: relative; width: 54px; height: 30px; }
.toggle .sw::after { content: ''; position: absolute; top: 5px; left: 5px; width: 20px; height: 20px; border-image: url('ui/tag-parchment.png') 4 fill / 8px stretch; }
.toggle.on .sw { border-image-source: url('ui/well-paper.png'); background: var(--leaf); background-clip: content-box; }
.toggle.on .sw::after { left: 29px; border-image-source: url('ui/tag-honey.png'); }
.xnote { color: var(--dim); margin: 6px 2px 0; }
.expert .big { margin-top: 8px; }
.vbadge { display: inline-flex; align-items: center; gap: 6px; margin: 6px 0 0 6px; padding: 4px 12px 9px 8px; color: #fff4dc; }
#app[data-variant="expert"] .pill.score, #app[data-variant="nonums"] .pill.score, #app[data-variant="nonext"] .pill.score { outline: 3px solid #6a5acd; outline-offset: 1px; }

/* ---------- achievements ---------- */
.achgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 8px; margin: 8px 0; }
.ach { padding: 8px 6px 12px; text-align: center; color: var(--dim); line-height: 1.25; }
.ach .medal { width: 48px; height: 48px; margin: 0 auto 4px; display: grid; place-items: center; padding-bottom: 2px; }
.ach b { display: block; color: var(--ink); }
.ach.locked .medal { --tag: url('ui/tag-parchment.png'); filter: grayscale(1); opacity: .6; }
.ach.locked b { color: var(--dim); }

/* ---------- toasts ---------- */
.toast { width: max-content; position: fixed; left: 50%; top: calc(8px + env(safe-area-inset-top)); transform: translate(-50%, -180%); z-index: 20; display: flex; align-items: center; gap: 10px; padding: 12px 18px 16px 12px; transition: transform .3s steps(4, end); max-width: 92vw; }
.toast.show { transform: translate(-50%, 0); }
.toast .medal { width: 44px; height: 44px; display: grid; place-items: center; flex: none; padding-bottom: 2px; }
.toast b { font-size: var(--fm); }
.toast small { display: block; color: var(--dim); font-size: var(--fs); }
.toast.upd { top: auto; bottom: calc(10px + env(safe-area-inset-bottom)); transform: translate(-50%, 200%); font: inherit; color: inherit; text-align: left; cursor: pointer; min-height: 44px; }
.toast.upd.show, .toast.copied.show { transform: translate(-50%, 0); }
.toast.copied { top: auto; bottom: calc(10px + env(safe-area-inset-bottom)); transform: translate(-50%, 200%); }
.toast.copied .medal, .toast.upd .medal { width: 38px; height: 38px; }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; background: rgba(59, 36, 22, .55); display: flex; align-items: center; justify-content: center; padding: 14px; z-index: 10; }
.overlay.enter { animation: fade .16s steps(2, end); }
.overlay.enter .card { animation: cardin .24s steps(3, end); }
@keyframes fade { from { opacity: 0; } }
@keyframes cardin { from { transform: translateY(24px); opacity: 0; } }
.overlay .card { width: 100%; max-width: 480px; max-height: 100%; overflow-y: auto; color: var(--ink); padding: 18px 20px 24px; }
.cardtitle { display: block; margin: 0 0 8px; }
.overlay h2 { margin: 0 0 6px; font-size: var(--fl); line-height: 1.15; }
.overlay h3 { margin: 12px 0 6px; font-size: var(--fm); }
.overlay p { margin: 6px 0; }
.overlay .small { color: var(--dim); }
.rules { list-style: none; padding: 0; margin: 8px 0; }
.rules li { display: flex; gap: 8px; align-items: center; padding: 3px 0; }
.rules canvas { flex: none; background: #9ad86a; border: 3px solid var(--ink); }
.levels .lvrow { display: flex; gap: 8px; align-items: center; padding: 2px 0; }
.overlay .big { margin-top: 10px; }
.card.share input, .card.share textarea { display: block; width: 100%; margin: 8px 0 0; padding: 12px; color: var(--ink); font: inherit; font-size: var(--fm); }
.card.share textarea { resize: none; font-size: var(--fs); line-height: 1.4; }
#shareBox[data-manual="1"] input { display: none; }
#shareBox[data-manual="1"] textarea { border-image-source: url('ui/well-paper.png'); user-select: text; -webkit-user-select: text; }
.card.vs { text-align: center; }
.vsscore { margin: 8px 0 4px; font-size: var(--fl); font-weight: 700; }
.vsscore:empty { display: none; }
.statgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.history { display: flex; flex-direction: column; gap: 4px; }
.history .h { display: flex; gap: 8px; align-items: center; }
.history .bar { height: 12px; background: var(--leaf); border: 3px solid var(--ink); }
.history .empty { color: var(--dim); }

/* the other screens on phones and small windows: same 6 px rhythm; the end screen's buttons come right after the score */
@media (max-width: 999px), (max-height: 599px) {
  .sethead { margin: 8px 2px 6px; }
  .modecard { --pt: 6px; --pb: 12px; min-height: 0; margin-bottom: 6px; gap: 10px; }
}
@media (max-height: 760px) and (max-width: 600px) { .tag { display: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .prebuild { background-position: -448px 0; }
}

/* Unlock full game (web only): THE call to action on the front (Rick, 2026-10-15: "eye-catching, obvious"). The one red
   Blit sign, full width, white bold label with a small line under it, the key wiggles, the sign hops now and then and a
   pixel shine sweeps across it (both in steps, so the pixels stay crisp). No price: that stays in the unlock popup. */
body #screenMenu .big.buybtn { --up: url('ui/sign-berry-up.png'); --hov: url('ui/sign-berry-hover.png'); --dn: url('ui/sign-berry-down.png'); border-image: var(--up) 5 fill / 15px stretch;
  --pt: 7px; --pb: 13px; width: 100%; min-height: 0; gap: 12px; padding-left: 16px; padding-right: 16px; color: #fffaf0; overflow: hidden; animation: buy-hop 4.8s steps(1, end) infinite; }
body #screenMenu .big.buybtn:active { border-image-source: var(--dn); padding-top: calc(var(--pt) + 3px); padding-bottom: calc(var(--pb) - 3px); }
@media (hover: hover) { body #screenMenu .big.buybtn:hover { border-image-source: var(--hov); } }
#screenMenu .buybtn .buylab { flex: none; font-size: var(--fl); line-height: 1.05; text-shadow: 0 3px 0 #7a2416; white-space: nowrap; text-align: center; }
#screenMenu .buybtn .buylab small { display: block; color: #ffe3cc; font-size: var(--fs); text-shadow: 0 2px 0 #7a2416; margin-top: 2px; }
#screenMenu .buybtn .buykey canvas { width: 32px; height: 32px; }
#screenMenu .buybtn .shine { position: absolute; top: 4px; bottom: 10px; left: -40px; width: 24px; pointer-events: none;
  background: linear-gradient(90deg, transparent 0 3px, rgba(255,255,255,.55) 3px 9px, transparent 9px 12px, rgba(255,255,255,.35) 12px 15px, transparent 15px); transform: skewX(-20deg); animation: buy-shine 4.8s steps(16, end) infinite; }
@keyframes buy-shine { 0%, 55% { left: -40px; } 85%, 100% { left: calc(100% + 20px); } }
@keyframes buy-hop { 0%, 40%, 100% { transform: none; } 44% { transform: translateY(-4px); } 48% { transform: none; } 52% { transform: translateY(-2px); } 56% { transform: none; } }
@media (max-width: 380px) { #screenMenu .buybtn .buylab { font-size: var(--fm); } }

/* ---------- the play screen and the front (re-layout, Rick 2026-10-15) ----------
   The board is THE biggest thing: .boardwrap takes every pixel the slim top bar, the hand and the one-line strip leave over,
   and game.js sizeBoard() fills it with the board at a whole art-pixel scale. Nothing scrolls. Three compositions, picked by
   game.js layMode(): body.lay-tall (phones and tablets upright: one column), body.lay-land (phones on their side: board
   left, a compact column right), body.lay-desk (big windows: top bar, board left with the strip under it, a side panel).
   The front (#app.front) is today's real board with the logo and the signs around it, in the same three shapes. */
#app[data-screen="screenGame"], #app.front { height: 100vh; height: 100dvh; max-width: none; overflow: hidden;
  padding: calc(6px + env(safe-area-inset-top)) calc(10px + env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) calc(10px + env(safe-area-inset-left)); }
#app[data-screen="screenGame"] #screenGame, #app.front #screenMenu, #app.front #screenGame, #app.front .menubody { display: contents; }
#app.front .hud, #app.front .sub, #app.front .info, #app.front .next, #app.front .goals, #app.front .timebar, #app.front .zenbar, #app.front .turnbanner { display: none; }
#app:not(.front) #btnAbout, #app.front .top .brand, #app.front #btnMute { display: none; }
#app .menubody .big, #app .row2 { margin: 0; }

/* the parts */
.top { position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: calc(8px + env(safe-area-inset-top)) 0 8px; }
#app[data-screen="screenGame"] .top, #app.front .top { padding: 0; }
.tools { gap: 4px; }
.tools .icon { flex: none; width: 44px; height: 44px; --pt: 2px; --pb: 8px; }
@media (max-width: 380px) { body.lay-tall #app.front .soon > span:last-child { display: none; } body.lay-tall #app.front .soon { padding-right: 10px; } } /* narrow phones: the Coming soon button keeps only its phone */
.brand img { max-width: 100%; height: auto; }
.hud { display: flex; gap: 6px; }
.pill { flex: 1; min-width: 0; position: relative; display: flex; justify-content: center; align-items: center; gap: 6px; padding: 3px 4px 9px; }
.pill span { font-size: var(--fs); color: var(--dim); display: flex; align-items: center; gap: 4px; line-height: 1.1; }
.pill b { font-size: var(--fm); line-height: 1; }
.pill i { display: none; }
.pill.score span { color: #6e4a1c; }
.pill.bump { animation: bump .3s steps(2, end); }
@keyframes bump { 50% { transform: translateY(-4px); } }
.sub { display: none; justify-content: space-between; gap: 8px; font-weight: 700; text-shadow: 0 2px 0 rgba(255,255,255,.6); }
.sub span:last-child { color: var(--good); text-align: right; }
.goals { display: flex; flex-direction: column; gap: 2px; padding: 5px 10px 9px; }
.goals .who { color: var(--dim); }
.goals .g { display: flex; align-items: center; gap: 8px; }
.goals .g i { font-style: normal; width: 20px; height: 20px; display: inline-grid; place-items: center; font-size: 10px; flex: none; }
.goals .g .n { margin-left: auto; font-weight: 700; color: var(--dim); }
.goals .g.done .n { color: var(--good); }
.goals .g.bad .n { color: var(--bad); }
/* the board's box: 15px all round holds the wooden frame (an ink ring, then the Blit panel's wood band outside the canvas) */
.boardwrap { grid-area: board; position: relative; display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 0; overflow: hidden; padding: 15px; }
#board { display: block; flex: none; touch-action: none; border: 0; box-shadow: 0 0 0 3px var(--ink); border-image: url('ui/panel-paper.png') 4 / 12px / 15px stretch; cursor: pointer; }
#board.shake { animation: shake .28s steps(4, end); }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
/* the strip under the board: one line, name + points, Build on a peek */
.info { flex: none; height: 54px; padding: 3px 10px 9px; display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: var(--fm); line-height: 1.2; }
.info .txt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.info .txt > div { overflow: hidden; text-overflow: ellipsis; }
.info .dim { color: var(--dim); font-size: var(--fs); }
.info .txt.dim { font-size: var(--fs); }
.info .l2 { display: flex; align-items: baseline; gap: 0; line-height: 1.15; font-weight: 400; } /* the breakdown gives way, the tap hint always shows */
.info .l2 .bk { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; border-bottom: 0; padding: 0; } /* not the end screen's .bk rows */
.info .l2 .hint { flex: none; }
@media (max-resolution: 1.49dppx) { .info { height: 60px; } } /* desktop small text is 20px, two lines need the room */
.pos { color: var(--good); } .neg { color: var(--bad); } .lucky { color: #2a7a38; font-weight: 700; }
.place { --pt: 5px; --pb: 11px; flex: none; min-height: 40px; padding-left: 16px; padding-right: 16px; font-weight: 700; font-size: var(--fm); animation: bump .3s steps(2, end); }
/* the hand: just the tile art (Rick, 2026-10-15) */
.hand { display: grid; grid-template-columns: repeat(3, auto); justify-content: center; gap: 8px; }
.tile { --pt: 6px; --pb: 12px; position: relative; display: grid; place-items: center; padding-left: 4px; padding-right: 4px; width: calc(var(--hi, 48px) + 18px); height: calc(var(--hi, 48px) + 18px); } /* square: game.js sets --hi (the art size) on #hand */
.tile canvas { display: block; }
.tile.sel { transform: translateY(-3px); }
.tile.sel canvas { animation: hop .5s steps(3, end); }
@keyframes hop { 40% { transform: translateY(-6px); } }
.tile:disabled { opacity: .5; }
.next { display: flex; justify-content: center; align-items: center; gap: 8px; padding: 4px 12px 10px; } /* Rick 2026-10-20: a small centred panel, square cards, even padding */
.next .nxlab { color: var(--dim); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.next .nxlab:only-child { grid-column: 1 / -1; text-align: center; }
.next .nxcard { --pt: 3px; --pb: 8px; display: grid; place-items: center; cursor: default; flex: none; padding-left: 0; padding-right: 0; width: calc(var(--ni, 24px) + 14px); height: calc(var(--ni, 24px) + 14px); }
.next .nxlab { margin-right: 4px; }
#app #next { width: max-content; max-width: 100%; align-self: center; justify-self: center; }
.zenbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 700; }
.timebar { flex: none; }

/* tall: one column, everything as wide as the board (game.js sets --bw), the board takes what is left */
body.lay-tall #app[data-screen="screenGame"], body.lay-tall #app.front { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding-left: calc(4px + env(safe-area-inset-left)); padding-right: calc(4px + env(safe-area-inset-right)); }
body.lay-tall #app[data-screen="screenGame"] > *, body.lay-tall #app.front > *, body.lay-tall #app .screen > *, body.lay-tall #app .menubody > * { width: min(100%, var(--bw, 100%)); flex: none; }
body.lay-tall #app .top { width: calc(100% - 8px); max-width: 760px; }
body.lay-tall #app .boardwrap { width: 100%; flex: 1 1 0; max-height: var(--bw, none); margin: 0; } /* capped at the board so spare height splits above and below the stack; the frame fills its 15px padding, so no negative margin (it hid the gap) */
body.lay-tall #app[data-screen="screenGame"] { gap: clamp(6px, 1.3vh, 12px); }
body.lay-tall #app .hud.hud, body.lay-tall #app #info { width: min(100%, max(var(--bw, 100%), 344px)); } /* the score row and strip never shrink below their text when the board steps down */ /* Rick 2026-10-20: one even gap between top bar, score, board, strip, hand and Next */
/* tall front (Rick 2026-10-16): logo, board, hand, Play, the two signs, Unlock, then the icon row; music sits in the top-right corner.
   The logo box shrinks to the logo, so its hop canvas and sparkle (left: 0 inside it) never land anywhere but on the logo. */
body.lay-tall #app.front { gap: 8px; justify-content: space-between; padding-top: calc(12px + env(safe-area-inset-top)); padding-left: calc(20px + env(safe-area-inset-left)); padding-right: calc(20px + env(safe-area-inset-right)); } /* Rick 2026-10-17: one 20px gutter both sides, spare height split evenly between the parts */
body.lay-tall #app.front > *, body.lay-tall #app.front .screen > *, body.lay-tall #app.front .menubody > * { width: min(100%, 440px); } /* the signs keep their width whatever the board does */
body.lay-tall #app.front .top { width: min(100%, 440px); }
body.lay-tall #app.front .boardwrap { width: 100%; margin: 0; }
body.lay-tall #app.front .wm { width: max-content; max-width: 100%; }
#app.front .wm { order: 1; } #app.front .boardwrap { order: 2; } #app.front .hand { order: 3; } #app.front #btnDaily { order: 4; }
#app.front #btnContinue { order: 5; } #app.front .row2 { order: 6; } #app.front #btnBuyApp { order: 7; } #app.front .top { order: 8; }
body.lay-tall #app.front .top { justify-content: center; }
body.lay-tall #app.front #btnMusic { position: fixed; top: calc(10px + env(safe-area-inset-top)); right: 10px; z-index: 6; }
/* wide (land + desk): a grid, board on the left; no row gaps (hidden parts would leave empty gaps), parts carry margins */
body.lay-land #app[data-screen="screenGame"], body.lay-land #app.front, body.lay-desk #app[data-screen="screenGame"], body.lay-desk #app.front { display: grid; column-gap: 16px; align-content: stretch; }
body.lay-land #app[data-screen="screenGame"], body.lay-land #app.front { max-width: calc(var(--bw, 100vw) + 456px + env(safe-area-inset-left) + env(safe-area-inset-right)); }
body.lay-desk #app[data-screen="screenGame"], body.lay-desk #app.front { max-width: calc(var(--bw, 100vw) + 520px); }
.top { grid-area: top; } .wm { grid-area: logo; } #btnDaily { grid-area: play; } #btnContinue { grid-area: cont; } .row2 { grid-area: row; } #btnBuyApp { grid-area: buy; }
.hud { grid-area: hud; } .sub { grid-area: sub; } .goals { grid-area: goals; } .timebar { grid-area: time; } .info { grid-area: info; } .hand { grid-area: hand; } .next { grid-area: next; } .zenbar { grid-area: zen; }
body.lay-land #app .top, body.lay-land #app .hud, body.lay-land #app .goals, body.lay-land #app .timebar, body.lay-land #app .info, body.lay-land #app .hand, body.lay-land #app .next, body.lay-land #app .wm, body.lay-land #app #btnDaily, body.lay-land #app #btnContinue, body.lay-land #app .row2 { margin-bottom: 6px; }
body.lay-desk #app .hud, body.lay-desk #app .sub, body.lay-desk #app .goals, body.lay-desk #app .timebar, body.lay-desk #app .hand, body.lay-desk #app .wm, body.lay-desk #app #btnDaily, body.lay-desk #app #btnContinue { margin-bottom: 14px; }
body.lay-desk #app .row2 { margin-bottom: 40px; }
/* land: the board fills the height on the left; top bar, score, strip, hand and Next stacked on the right (front: logo, hand, Play, signs, Unlock, icons) */
body.lay-land #app[data-screen="screenGame"] { grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); grid-template-rows: 1fr repeat(8, auto) 1fr;
  grid-template-areas: "board ." "board top" "board hud" "board goals" "board time" "board info" "board hand" "board next" "board zen" "board ."; }
body.lay-land #app.front { grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); grid-template-rows: 1fr repeat(7, auto) 1fr;
  grid-template-areas: "board ." "board logo" "board hand" "board play" "board cont" "board row" "board buy" "board top" "board ."; }
body.lay-land #app .top .brand { flex: 0 1 auto; min-width: 0; }
body.lay-land #app.front .top { justify-content: center; }
body.lay-land #app.front #btnSoon, body.lay-land #app.front .row2 .big small { display: none; }
body.lay-land #app.front .row2 .big::after { display: none; }
body.lay-land #app.front .play .playlab { display: inline; font-size: var(--fl); }
body.lay-land #app.front .play small { display: inline; margin-left: 8px; }
body.lay-land #app.front #btnDaily { --pt: 4px; --pb: 10px; }
body.lay-land #app.front .row2 .big { --pt: 6px; --pb: 12px; min-height: 44px; }
body.lay-land #screenMenu .buybtn .buylab { font-size: var(--fm); }
body.lay-land #screenMenu .buybtn .buylab small { display: none; }
body.lay-land #app .boardwrap { margin-left: -8px; }
/* desk: a top bar across, the board on the left with the strip under it, a side panel with the score, hand and Next */
body.lay-desk #app[data-screen="screenGame"] { padding-left: 24px; padding-right: 24px; column-gap: 32px; grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
  grid-template-rows: 1fr repeat(8, auto) 1fr auto;
  grid-template-areas: "board ." "board top" "board hud" "board sub" "board goals" "board time" "board hand" "board next" "board zen" "board ." "info ."; }
body.lay-desk #app[data-screen="screenGame"] .top { margin-bottom: 18px; }
body.lay-desk #app[data-screen="screenGame"] .info { justify-self: center; width: min(100%, var(--bw, 100%)); margin-top: 2px; height: auto; min-height: 66px; padding: 10px 20px 16px; } /* Rick 2026-10-18: both lines inside the frame, off the board, even side padding */
body.lay-desk #app .tools .icon { width: 48px; height: 48px; --pt: 3px; --pb: 9px; }
body.lay-desk #app .pill { flex-direction: column; gap: 0; padding: 5px 0 10px; }
body.lay-desk #app .pill b { font-size: var(--fl); margin-top: 3px; }
body.lay-desk #app .pill i { display: block; font-style: normal; font-size: 10px; line-height: 1; color: var(--dim); margin-top: 2px; }
body.lay-desk #app:not(.front) .sub { display: flex; }
body.lay-desk #app .hand { gap: 10px; }
body.lay-desk #app .tile { --pt: 10px; --pb: 16px; width: calc(var(--hi, 48px) + 26px); height: calc(var(--hi, 48px) + 26px); }
body.lay-desk #app .next { padding: 8px 16px 14px; }
body.lay-desk #app.front { padding-left: 24px; padding-right: 24px; column-gap: 40px; grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
  grid-template-rows: 1fr repeat(7, auto) 1fr;
  grid-template-areas: "board ." "board logo" "board hand" "board play" "board cont" "board row" "board buy" "board top" "board ."; }
body.lay-desk #app.front .top { justify-content: center; margin-top: 18px; }
body.lay-desk #app.front .tools { flex-wrap: wrap; justify-content: center; }

/* bug report form (2026-10-17): reuses the share card look */
.card.bug textarea { resize: vertical; user-select: text; -webkit-user-select: text; border-image-source: url('ui/well-paper.png'); }
.card.bug .small { margin: 8px 0 0; }
.card.bug .bugkind { display: flex; gap: 18px; justify-content: center; margin: 6px 0 0; }
.card.bug .bugkind label { display: flex; gap: 6px; align-items: center; cursor: pointer; }
