/* My Bible Land: a cheerful toy look. Warm saturated palette, chunky outlined shapes, big glossy buttons. No external fonts or files. */
:root {
  --ink: #4a2712;
  --ink-2: #6b3b1c;
  --cream: #fff6dc;
  --cream-2: #ffe7a6;
  --cream-3: #f7d68a;
  --shade: rgba(58, 22, 8, 0.38);
  --green: #59d13a; --green-d: #24851a; --green-l: #b2f77a;
  --orange: #ffa02e; --orange-d: #bf5a08; --orange-l: #ffd684;
  --blue: #3db4ff; --blue-d: #1670c4; --blue-l: #a5e0ff;
  --purple: #b56be6; --purple-d: #71349f; --purple-l: #e3bcff;
  --red: #ff5d4a; --red-d: #b3271a; --red-l: #ffab9e;
  --grey: #c9ccd6; --grey-d: #7a7f90; --grey-l: #eceef3;
  --gold: #ffd23f;
  --font: "Arial Rounded MT Bold", ui-rounded, "SF Pro Rounded", "Baloo 2", "Nunito", "Trebuchet MS", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sat: env(safe-area-inset-top, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --gut: 10px;
  --bar-h: 96px;
  --top-h: 150px;     /* the real height of the top HUD: Hud.measure() keeps it true; banners sit below it */
  --stack-h: 0px;     /* how high the dock or the open card stands above the bottom bar: toasts sit above it */
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; height: 100dvh; overflow: hidden; background: #46b8e6; overscroll-behavior: none; }
body { font-family: var(--font); color: var(--ink); -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: none; }
canvas#land { position: fixed; inset: 0; display: block; touch-action: none; cursor: grab; outline: none; }
canvas#land.dragging { cursor: grabbing; }
img { -webkit-user-drag: none; pointer-events: none; }
[hidden] { display: none !important; }
button { font-family: inherit; }

/* ---------- outlined chunky text ---------- */
.outlined, .btn span, .era-name, .chip b, .goal-tag, .badge { -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; }

/* ---------- glossy buttons ---------- */
.btn {
  --c1: var(--green-l); --c2: var(--green); --c3: #3fb126; --dark: var(--green-d);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 56px; min-height: 56px; padding: 8px 14px; margin: 0; border: 3px solid var(--ink); border-radius: 22px; cursor: pointer;
  font: 900 19px/1 var(--font); letter-spacing: 0.5px; color: #fff; text-align: center; touch-action: manipulation;
  background: linear-gradient(var(--c1) 0%, var(--c2) 46%, var(--c3) 54%, var(--c2) 100%);
  box-shadow: 0 6px 0 var(--dark), 0 6px 0 3px var(--ink), 0 12px 16px rgba(58, 22, 8, 0.32), inset 0 3px 0 rgba(255, 255, 255, 0.6), inset 0 -3px 0 rgba(0, 0, 0, 0.1);
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.15s;
}
.btn::before { content: ""; position: absolute; left: 8%; right: 8%; top: 4px; height: 38%; border-radius: 16px 16px 40% 40%; background: linear-gradient(rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.05)); pointer-events: none; }
.btn:active, .btn.pressed { transform: translateY(5px); box-shadow: 0 1px 0 var(--dark), 0 1px 0 3px var(--ink), 0 4px 8px rgba(58, 22, 8, 0.3), inset 0 3px 0 rgba(255, 255, 255, 0.5); }
.btn:focus-visible, .chip:focus-visible, .goal:focus-visible, .era-badge:focus-visible, .gear:focus-visible, .pill:focus-visible { outline: 4px solid #fff; outline-offset: 2px; }
.btn img.ico, .btn img { width: 34px; height: 34px; flex: none; filter: drop-shadow(0 2px 0 rgba(58, 22, 8, 0.35)); }
.btn.orange { --c1: var(--orange-l); --c2: var(--orange); --c3: #ec8410; --dark: var(--orange-d); }
.btn.blue { --c1: var(--blue-l); --c2: var(--blue); --c3: #2a9ae8; --dark: var(--blue-d); }
.btn.purple { --c1: var(--purple-l); --c2: var(--purple); --c3: #9a4fd0; --dark: var(--purple-d); }
.btn.red { --c1: var(--red-l); --c2: var(--red); --c3: #ec4030; --dark: var(--red-d); }
.btn.grey { --c1: var(--grey-l); --c2: var(--grey); --c3: #b3b7c4; --dark: var(--grey-d); color: #fff; filter: saturate(0.85); }
.btn.round { border-radius: 50%; width: 64px; height: 64px; padding: 0; }
.btn:disabled, .btn.disabled { filter: grayscale(0.55) brightness(0.98); cursor: default; }
.btn.small { min-height: 56px; font-size: 16px; padding: 6px 12px; border-radius: 18px; }
.btn.wide { width: 100%; }

/* ---------- HUD ---------- */
.hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
.hud > * { pointer-events: auto; }
.top {
  position: absolute; left: 0; right: 0; top: 0; pointer-events: none;
  padding: calc(var(--sat) + 8px) calc(var(--sar) + var(--gut)) 0 calc(var(--sal) + var(--gut));
  display: grid; gap: 8px 8px; align-items: start;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas: "era mp gear" "goal goal goal" "goods goods goods";
}
.top > * { pointer-events: auto; }
.era-badge { grid-area: era; }
.goal { grid-area: goal; }
.chip-mp { grid-area: mp; }
.goods { grid-area: goods; }
.gear { grid-area: gear; }

.era-badge {
  display: flex; align-items: center; gap: 8px; min-height: 56px; max-width: 330px; padding: 4px 10px 4px 4px; border: 3px solid var(--ink); border-radius: 30px; cursor: pointer; text-align: left;
  background: linear-gradient(#fff9e6, var(--cream-2)); color: var(--ink); box-shadow: 0 4px 0 var(--ink), 0 8px 12px rgba(58, 22, 8, 0.3), inset 0 2px 0 #fff;
}
.era-medal { flex: none; width: 48px; height: 48px; border-radius: 50%; border: 3px solid var(--ink); background: radial-gradient(circle at 35% 30%, #d2f7ff, #57c6ee); display: grid; place-items: center; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.12); overflow: hidden; }
.era-medal img { width: 40px; height: 40px; }
.era-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.era-name { font: 900 14px/1 var(--font); color: #fff; letter-spacing: 0.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; -webkit-text-stroke: 3.5px var(--ink); }
.era-bar { position: relative; display: block; height: 20px; border-radius: 12px; border: 3px solid var(--ink); background: #fff1cf; overflow: hidden; box-shadow: inset 0 2px 0 rgba(0, 0, 0, 0.1); }
.era-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 40%; background: linear-gradient(var(--green-l), var(--green) 55%, #3fb126); border-radius: 10px; transition: width 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.1); }
.era-bar i::after { content: ""; position: absolute; left: 4px; right: 4px; top: 2px; height: 4px; border-radius: 3px; background: rgba(255, 255, 255, 0.55); }
.era-bar em { position: absolute; inset: 0; display: grid; place-items: center; font: 900 11px/1 var(--font); font-style: normal; color: #fff; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; }
.era-next { flex: none; position: relative; width: 36px; height: 36px; border-radius: 50%; background: #c6d6ee; border: 3px solid var(--ink); display: grid; place-items: center; overflow: hidden; }
.era-next img:first-child { width: 28px; height: 28px; opacity: 0.85; }
.era-next .era-lock { position: absolute; width: 18px; height: 18px; right: -1px; bottom: -2px; }

.goal {
  position: relative; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 6px 44px 6px 10px; border: 3px solid var(--ink); border-radius: 18px; cursor: pointer; text-align: left;
  background: linear-gradient(#fffbe9, var(--cream-2)); color: var(--ink); box-shadow: 0 4px 0 var(--ink), 0 8px 12px rgba(58, 22, 8, 0.3), inset 0 2px 0 #fff;
}
.goal-tag { flex: none; padding: 5px 9px; border-radius: 12px; font: 900 11px/1 var(--font); letter-spacing: 0.6px; color: #fff; background: linear-gradient(#ffb95a, #ff8a1e); border: 2.5px solid var(--ink); -webkit-text-stroke: 3px var(--ink); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.5); }
.goal-text { flex: 1; min-width: 0; font: 800 14px/1.15 var(--font); color: var(--ink); }
.goal-tail { flex: none; font: 900 15px/1 var(--font); color: #fff; -webkit-text-stroke: 3.5px var(--ink); paint-order: stroke fill; }
.goal-tail:empty { display: none; }
.goal-hand { position: absolute; right: 8px; top: 50%; width: 30px; height: 30px; margin-top: -15px; transform: rotate(-90deg); animation: nudge 1s ease-in-out infinite; }
.goal.static .goal-hand { display: none; }
@keyframes nudge { 0%, 100% { translate: 0 0; } 50% { translate: 6px 0; } }

.chip { position: relative; display: inline-flex; align-items: center; gap: 4px; height: 40px; padding: 0 10px 0 4px; border: 3px solid var(--ink); border-radius: 22px; color: #fff; cursor: pointer; font: 900 16px/1 var(--font);
  background: linear-gradient(#5b6f9c, #34456e); box-shadow: 0 3px 0 var(--ink), 0 6px 10px rgba(58, 22, 8, 0.28), inset 0 2px 0 rgba(255, 255, 255, 0.3); touch-action: manipulation; }
.chip::after { content: ""; position: absolute; inset: -14px -8px; }   /* insets are measured from the padding box: this makes every counter a 56+ px tap target */
.chip img { width: 30px; height: 30px; flex: none; margin: -4px 0; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.3)); }
.chip b { font: 900 16px/1 var(--font); font-variant-numeric: tabular-nums; -webkit-text-stroke: 3.5px var(--ink); paint-order: stroke fill; min-width: 14px; text-align: right; }
.chip-mp { height: 46px; padding: 0 14px 0 6px; background: linear-gradient(#ffdc68, #f0a21e); }
.chip-mp img { width: 38px; height: 38px; }
.chip-mp b { font-size: 21px; }
/* the STREAK chip: a flame and the days in a row, on the top line next to the area badge (the grid below makes room only while the server has sent a streak: Hud sets .has-streak) */
.card.gift { border-color: #e8a114; background: linear-gradient(#fffbe0, #ffe9a0); box-shadow: 0 4px 0 #b97a0c, 0 0 0 3px rgba(255, 214, 80, 0.55); }   /* a streak gift waiting in the bag */
.chip-streak { grid-area: streak; height: 44px; padding: 0 9px 0 4px; gap: 2px; background: linear-gradient(#ffb862, #ea5a22); }
.chip-streak img { width: 32px; height: 32px; }
.chip-streak b { font-size: 19px; min-width: 12px; }
.chip-streak .sprout { width: 17px; height: 17px; margin: -14px -2px 0 -4px; }   /* the small green flame of Sprout, beside the number and a little above it */
.chip-streak .crown { position: absolute; left: 1px; top: -4px; width: 24px; height: 24px; margin: 0; transform: rotate(-13deg); filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.4)); object-fit: contain; }   /* Jubilee (365 days): the gold crown rests on the flame chip's corner (art piece streak_crown) */
.chip-streak.gold { background: linear-gradient(#8d6af0, #4a309f); }   /* Forty Days and up: a golden flame on royal purple (gold on gold would vanish) */
.chip-streak.out { background: linear-gradient(#d9dce6, #8d93a6); }
.chip-streak.out b { -webkit-text-stroke-color: #4b5063; }
.chip.bump { animation: bump 0.4s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes bump { 0% { transform: scale(1); } 35% { transform: scale(1.25); } 100% { transform: scale(1); } }
.goods { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }   /* 8 goods: two tidy rows of four on a phone */
.goods .chip { min-width: 0; padding: 0 6px 0 2px; height: 40px; gap: 1px; justify-content: center; }
.goods .chip img { width: 26px; height: 26px; }
.goods .chip b { font-size: 14px; min-width: 12px; }
.goods .chip.zero { filter: saturate(0.55) brightness(0.9); }
.gear { display: grid; place-items: center; width: 46px; height: 46px; padding: 0; border: 3px solid var(--ink); border-radius: 50%; background: linear-gradient(#8a93aa, #566079); cursor: pointer; box-shadow: 0 3px 0 var(--ink), 0 6px 10px rgba(58, 22, 8, 0.28), inset 0 2px 0 rgba(255, 255, 255, 0.3); position: relative; }
.gear::after { content: ""; position: absolute; inset: -10px; }
.gear img { width: 30px; height: 30px; }

.pill { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 6px 14px 6px 8px; border: 3px solid var(--ink); border-radius: 26px; cursor: pointer;
  font: 900 14px/1 var(--font); color: var(--ink); background: linear-gradient(#fffbe9, var(--cream-2)); box-shadow: 0 4px 0 var(--ink), 0 8px 12px rgba(58, 22, 8, 0.28), inset 0 2px 0 #fff; touch-action: manipulation; }
.pill::after { content: ""; position: absolute; inset: -8px; }
.pill img { width: 30px; height: 30px; }
/* the dock: COLLECT ALL lives in ONE box above the bottom bar (the "verses need a home" pill is gone: the hammer side of VERSES says it).
   Nothing else is drawn there: the object card takes its place, banners hide it, toasts sit above it (--stack-h). */
.dock { position: absolute; left: calc(var(--sal) + var(--gut)); right: calc(var(--sar) + var(--gut)); bottom: calc(var(--bar-h) + var(--sab) + 12px); display: grid; justify-items: center; gap: 10px; pointer-events: none; }
.dock > * { pointer-events: auto; }
.dock .collect-all { grid-row: 1; font-size: 20px; padding: 8px 20px; animation: floaty 1.2s ease-in-out infinite; }
/* the BAG (learn a new verse): a small square in the bottom-left corner above the bottom bar, NOT a row of the dock: a fourth dock row pushed the other pills up over the plants (harness group u could not tap a plant).
   Short pills of the dock are centered and never reach the corner. */
.learn-bag { position: absolute; left: calc(var(--sal) + var(--gut)); bottom: calc(var(--bar-h) + var(--sab) + 12px); z-index: 2; flex-direction: column; justify-content: center; gap: 2px; width: 68px; min-height: 68px; padding: 4px 3px; border-radius: 20px; text-align: center; background: linear-gradient(#fff6d6, #ffdf8a); }
.learn-bag[hidden] { display: none; }
.learn-bag img { width: 34px; height: 34px; }
.learn-bag span { font: 900 10.5px/1.05 var(--font); letter-spacing: 0.2px; }
.learn-bag.sealed { background: linear-gradient(#f1ebdc, #d9cfb4); color: #6b5a3a; }
.learn-bag.sealed img { filter: grayscale(0.6); }
body.card-open .learn-bag, body:has(.era-banner) .learn-bag, body:has(.story-banner) .learn-bag { visibility: hidden; }
.collect-all img { transform: rotate(180deg); }
@keyframes floaty { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }   /* (a transform, not a margin: a moving margin would move the toasts above it) */
body.card-open .dock, body:has(.era-banner) .dock, body:has(.story-banner) .dock { visibility: hidden; }

/* ---------- bottom row ---------- */
.bottom { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: flex-end; gap: 8px; pointer-events: none; padding: 0 calc(var(--sar) + var(--gut)) calc(var(--sab) + 10px) calc(var(--sal) + var(--gut)); }
.bottom .btn { pointer-events: auto; flex: 1 1 0; flex-direction: column; gap: 3px; height: 72px; padding: 6px 4px 8px; font-size: 12px; line-height: 1.05; border-radius: 20px; min-width: 0; }
.bottom .btn img { width: 34px; height: 34px; }
.bottom .btn.big { flex: 1.9 1 0; height: 84px; font-size: 19px; border-radius: 26px; gap: 4px; }
.bottom .btn.big img { width: 46px; height: 46px; }
.bottom .btn span { -webkit-text-stroke: 3.5px var(--ink); }
.bottom .btn.big span { -webkit-text-stroke: 4.5px var(--ink); letter-spacing: 1px; }
.bottom .btn.big.calling { animation: throb 1.5s ease-in-out infinite; }
@keyframes throb { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.045); } }
.badge { position: absolute; right: -6px; top: -10px; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 14px; border: 3px solid var(--ink); background: linear-gradient(#ff8a7a, #f0402e); color: #fff; font: 900 15px/22px var(--font); font-style: normal; text-align: center; -webkit-text-stroke: 3px var(--ink); }
/* DUE TODAY (Kept Verses): the PRACTICE badge turns orange and gets a gold ring, no second row in the dock (aria-label and tooltip on the button say "6 due today") */
.badge.due { background: linear-gradient(#ffd27a, #ff9a3d); box-shadow: 0 0 0 3px #fff6c8, 0 0 0 6px var(--ink); }

.place-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center; gap: 14px; padding: 0 calc(var(--sar) + var(--gut)) calc(var(--sab) + 12px) calc(var(--sal) + var(--gut)); pointer-events: none; }
.place-bar .btn { pointer-events: auto; }
.place-ok { flex: 1 1 auto; max-width: 320px; height: 68px; font-size: 20px; gap: 10px; }
.place-ok span { -webkit-text-stroke: 4px var(--ink); }
.place-ok small { display: block; font: 900 12px/1 var(--font); -webkit-text-stroke: 3px var(--ink); margin-top: 3px; }
.place-bar .btn.round { width: 68px; height: 68px; }
/* BUILD AGAIN: once a thing was placed the next of its kind is in the hand, and the red cross becomes a DONE button (the way out says what it does) */
.place-bar .done-txt { display: none; }
.place-bar .btn.round.done { width: auto; min-width: 92px; padding: 0 18px; border-radius: 34px; font-size: 20px; }
.place-bar .btn.round.done img { display: none; }
.place-bar .btn.round.done .done-txt { display: inline; }
.hud.placing .bottom, .hud.placing .learn-bag, .hud.placing .collect-all, .hud.placing .more-menu { display: none; }

/* ---------- panels ---------- */
.backdrop { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: calc(var(--sat) + 12px) calc(var(--sar) + 12px) calc(var(--sab) + 12px) calc(var(--sal) + 12px); background: rgba(30, 60, 90, 0.5); animation: fadeIn 0.18s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.panel { position: relative; width: min(100%, 640px); max-height: 100%; display: flex; flex-direction: column; border: 4px solid var(--ink); border-radius: 26px; background: linear-gradient(#fff9e6, #ffeab0); box-shadow: 0 8px 0 var(--ink), 0 20px 40px rgba(0, 0, 0, 0.35), inset 0 3px 0 #fff; animation: popIn 0.28s cubic-bezier(0.2, 1.4, 0.4, 1); overflow: hidden; }
@keyframes popIn { from { transform: scale(0.85) translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.panel-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 18px; background: linear-gradient(#ffb95a, #ff8a1e); border-bottom: 4px solid var(--ink); }
.panel-head h2 { flex: 1; margin: 0; font: 900 26px/1 var(--font); color: #fff; letter-spacing: 1px; -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; text-shadow: 0 3px 0 rgba(58, 22, 8, 0.35); }
.panel-head .btn { min-height: 56px; }
.panel-body { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; padding: 14px; touch-action: pan-y; overscroll-behavior: contain; }
.panel-body.center { text-align: center; }
.panel-body p { margin: 6px 0; font: 800 17px/1.3 var(--font); }
.panel.green .panel-head { background: linear-gradient(#a6f26e, #46bf2a); }
.panel.blue .panel-head { background: linear-gradient(#a5e0ff, #2f9be8); }
.panel.purple .panel-head { background: linear-gradient(#e3bcff, #9a4fd0); }

.sec { margin: 6px 0 10px; }
.sec h3 { margin: 4px 4px 8px; font: 900 16px/1 var(--font); color: var(--ink-2); letter-spacing: 1.5px; text-transform: uppercase; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 10px; }
.card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 8px 10px; border: 3px solid var(--ink); border-radius: 20px; background: linear-gradient(#fffdf3, #ffedb8); box-shadow: 0 4px 0 var(--ink), inset 0 2px 0 #fff; text-align: center; }
.card canvas { width: 92px; height: 92px; }
.card .nm { font: 900 16px/1.05 var(--font); color: var(--ink); }
.card .blurb { font: 700 12px/1.15 var(--font); color: var(--ink-2); min-height: 28px; }
.card .cost { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.cost .c { display: inline-flex; align-items: center; gap: 1px; height: 26px; padding: 0 7px 0 2px; border-radius: 14px; border: 2.5px solid var(--ink); background: #fff; font: 900 13px/1 var(--font); color: var(--ink); }
.cost .c img { width: 22px; height: 22px; margin: -2px 0; }
.cost .c.short { background: #ffd3cc; color: #b3271a; }
.cost .c.ok { background: #e2f9d0; }
.card .work { display: flex; align-items: center; gap: 3px; font: 800 12px/1 var(--font); color: var(--ink-2); }
.card .work img { width: 18px; height: 18px; }
.card.locked { background: linear-gradient(#e9eef8, #c9d3e6); }
.card.locked .nm { color: #5a6b8c; }
.card.locked { cursor: pointer; }
.card.locked canvas { filter: grayscale(1) opacity(0.62); }   /* greyed, but you can still see what it is */
.card .gives { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 3px; font: 800 12px/1.15 var(--font); color: var(--ink-2); }
.card .gives img { width: 22px; height: 22px; margin: -3px 0; }
.card .gives b { font: 900 15px/1 var(--font); color: var(--ink); }
.card.locked .gives { color: #6a7b9c; }
.card .btn.more { min-height: 48px; font-size: 15px; margin-top: 0; }
/* ---------- the MORE sheet: one thing, level by level ---------- */
.morebody { display: grid; gap: 10px; }
.morehead { display: flex; align-items: center; gap: 12px; }
.morehead canvas { flex: none; width: 76px; height: 76px; }
.moreinfo { display: grid; gap: 4px; min-width: 0; }
.moreinfo .blurb { font: 700 14px/1.2 var(--font); color: var(--ink-2); }
.morebody .gives { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font: 900 15px/1.15 var(--font); color: var(--ink); }
.morebody .gives img { width: 26px; height: 26px; margin: -3px 0; }
.lockline { display: flex; align-items: center; gap: 6px; font: 900 14px/1.1 var(--font); color: #4a5f86; }
.lockline img { width: 24px; height: 24px; }
.srcline { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 3px solid var(--ink); border-radius: 16px; background: #fff; font: 800 15px/1.2 var(--font); }
.srcline img { flex: none; width: 32px; height: 32px; }
.srclist { display: grid; gap: 6px; }
.srclist h3 { margin: 2px 4px; font: 900 14px/1 var(--font); color: var(--ink-2); letter-spacing: 1.2px; text-transform: uppercase; }
.lvtable { display: grid; gap: 8px; }
.lv { display: grid; gap: 5px; padding: 8px 10px 9px; border: 3px solid var(--ink); border-radius: 18px; background: linear-gradient(#fffdf3, #ffedb8); box-shadow: 0 3px 0 var(--ink), inset 0 2px 0 #fff; }
.lv.locked { background: linear-gradient(#f0f3fa, #d9e0ee); }
.lv { grid-template-columns: 62px 1fr; column-gap: 10px; }   /* the level's picture on the left, its words on the right */
.lv > :not(.lvpic) { grid-column: 2; }
.lv .lvpic { grid-column: 1; grid-row: 1 / span 4; align-self: center; display: flex; align-items: center; justify-content: center; }
.lv .lvpic canvas { width: 60px; height: 60px; }
.lv .lvn { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.lv .lvn b { font: 900 18px/1 var(--font); }
.lv .lvneed { padding: 4px 9px; border-radius: 12px; background: var(--ink); color: #fff; font: 800 12px/1 var(--font); }
.lv.locked .lvneed { background: #5a6b8c; }
.lv .lvgain { display: flex; align-items: center; gap: 6px; font: 900 17px/1.15 var(--font); }
.lv .lvgain img { width: 30px; height: 30px; margin: -3px 0; }
.lv .lvcost { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.lv .lvcost em { font: 800 12px/1 var(--font); font-style: normal; color: var(--ink-2); min-width: 54px; }
.lv .lvcost .work { display: flex; align-items: center; gap: 3px; font: 800 12px/1 var(--font); color: var(--ink-2); }
.lv .lvcost .work img { width: 18px; height: 18px; }
.lv .lvelse { font: 700 13px/1.2 var(--font); color: var(--ink-2); }
.morebody .moreok { width: 100%; min-height: 56px; }
.card .tag { position: absolute; top: 6px; right: 6px; padding: 3px 7px; border-radius: 10px; background: var(--ink); color: #fff; font: 800 10px/1 var(--font); }
.card .btn { width: 100%; min-height: 56px; font-size: 16px; border-radius: 16px; margin-top: 2px; }
.card .needbox { width: 100%; display: flex; flex-direction: column; gap: 4px; padding: 6px 8px; border: 2px dashed #c9892b; border-radius: 12px; background: #fff3d6; text-align: center; }
.needline { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 6px; }
.needline b { font: 900 13px/1.2 var(--font); color: #b3261e; }
.needchips { display: inline-flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.needhow { display: flex; align-items: center; justify-content: center; gap: 4px; font: 800 12px/1.25 var(--font); color: #2b6a14; text-align: left; }
.needhow img { width: 20px; height: 20px; flex: none; }
.upgsec { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 8px 0; padding: 10px; border: 3px solid var(--ink); border-radius: 18px; background: linear-gradient(#fff7e0, #ffe3a8); }
.upgsec .upgname { font: 900 16px/1 var(--font); color: #b34a00; text-transform: uppercase; letter-spacing: 1px; }
.upgsec .upgline { font: 800 13px/1.25 var(--font); color: var(--ink-2); text-align: center; }
.upgsec .upgprice { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.upgsec .upgprice .cost { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.upgsec .btn.upgbig { width: 100%; min-height: 64px; font-size: 20px; }
.upgsub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.card .upg { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 6px; padding-top: 8px; border-top: 3px dashed var(--ink-2); }
.card .upgname { font: 900 15px/1 var(--font); color: #b34a00; text-transform: uppercase; letter-spacing: 1px; }
.card .upgline { font: 700 12px/1.25 var(--font); color: var(--ink-2); text-align: center; }
.card .btn.upgbig { min-height: 64px; font-size: 19px; letter-spacing: 0; gap: 4px; padding-left: 6px; padding-right: 6px; }
.card .btn.upgbig img { width: 24px; height: 24px; }
.card .lockmsg { font: 900 13px/1.1 var(--font); color: #4a5f86; padding: 8px 4px; min-height: 56px; display: grid; place-items: center; }
.card .lockico { position: absolute; top: 34px; left: 50%; width: 34px; height: 34px; translate: -50% 0; }
.note { padding: 8px 12px; border-radius: 14px; background: #fff; border: 3px dashed var(--ink-2); font: 800 14px/1.25 var(--font); margin-bottom: 10px; }

/* the object card */
/* the card never grows into the HUD: on a small screen its own content scrolls (the close button is inside it, so it is never cut off) */
.objcard { max-height: calc(100vh - var(--top-h) - var(--bar-h) - var(--sab) - 34px); max-height: calc(100dvh - var(--top-h) - var(--bar-h) - var(--sab) - 34px); overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; }
.objcard { position: fixed; left: calc(50% + (var(--sal) - var(--sar)) / 2); translate: -50% 0; bottom: calc(var(--bar-h) + var(--sab) + 16px); z-index: 12; width: min(calc(100% - 20px - var(--sal) - var(--sar)), 460px); display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; padding: 10px 12px 12px; border: 4px solid var(--ink); border-radius: 24px; background: linear-gradient(#fffdf3, #ffe9ae); box-shadow: 0 6px 0 var(--ink), 0 14px 26px rgba(58, 22, 8, 0.4), inset 0 3px 0 #fff; animation: popIn 0.22s cubic-bezier(0.2, 1.5, 0.4, 1); }
.objcard canvas { width: 76px; height: 76px; grid-row: span 2; align-self: center; }
.objcard h3 { margin: 2px 0 0; font: 900 19px/1.05 var(--font); color: var(--ink); }
.objcard .sub { font: 800 13px/1.2 var(--font); color: var(--ink-2); }
.objcard .status { display: inline-block; margin-top: 4px; padding: 3px 9px; border-radius: 12px; border: 2.5px solid var(--ink); background: #fff; font: 900 12px/1 var(--font); }
.objcard .status.ripe { background: #fff2a0; }
.objcard .acts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.objcard .acts .btn { flex: 1 1 150px; min-height: 56px; font-size: 15px; padding: 6px 8px; border-radius: 18px; }
.objcard .acts .btn.sec { flex: 0 1 88px; }   /* MOVE / STORE: narrow, so the main buttons keep their room */
.objcard .acts .btn.again { flex: 1 1 170px; }   /* BUILD ANOTHER: the label with its price under it */
.objcard .again-txt { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; }
.objcard .again-txt .cost { flex-wrap: nowrap; }
.objcard .again-txt .cost span { -webkit-text-stroke: 0; }   /* (the button's outlined letters would blur the price chips) */
.objcard .nobuild { font-style: italic; }
.objcard .upgsub .work { display: inline-flex; align-items: center; gap: 3px; font: 800 12px/1 var(--font); color: var(--ink-2); }   /* (the card's price line: its hammer was drawn at the picture's own size) */
.objcard .work img { width: 18px; height: 18px; }
.objcard .acts .btn img { width: 26px; height: 26px; }
.objcard .close { position: absolute; top: 6px; right: 6px; width: 44px; height: 44px; min-height: 44px; min-width: 44px; padding: 0; border-radius: 50%; z-index: 1; }
.objcard .ohead { padding-right: 40px; min-width: 0; }
.objcard .close::after { content: ""; position: absolute; inset: -8px; }
.objcard .close img { width: 22px; height: 22px; }

/* tooltip */
.tip { position: fixed; z-index: 30; max-width: 220px; padding: 8px 12px; border: 3px solid var(--ink); border-radius: 14px; background: #fffbe8; box-shadow: 0 4px 0 var(--ink), 0 8px 14px rgba(58, 22, 8, 0.3); font: 800 13px/1.2 var(--font); color: var(--ink); pointer-events: none; animation: popIn 0.16s ease; }
.tip b { display: block; font-size: 15px; }

.notes { position: fixed; left: calc(var(--sal) + 8px); right: calc(var(--sar) + 8px); bottom: calc(var(--bar-h) + var(--sab) + var(--stack-h) + 8px); z-index: 40; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
body:has(.wm:not([hidden])) .notes { display: none; }
.notes.top { top: calc(var(--top-h) + 10px); bottom: auto; }
body:has(.backdrop) .toast.hint, body:has(.practice) .toast.hint, body.card-open .toast.hint { visibility: hidden; }   /* a hint already on screen waits while a menu or a round is open */   /* nothing of the land is said over the world map (App.toast also queues them until it closes) */
.toast { max-width: min(92vw, 440px); padding: 10px 16px; border: 3px solid var(--ink); border-radius: 18px; background: #fffbe8; box-shadow: 0 4px 0 var(--ink), 0 10px 18px rgba(58, 22, 8, 0.3); font: 800 15px/1.2 var(--font); text-align: center; color: var(--ink); animation: toastIn 0.25s cubic-bezier(0.2, 1.4, 0.4, 1); }
.toast.bad { background: #ffe0da; }
.toast.out { animation: toastOut 0.3s ease forwards; }
@keyframes toastIn { from { transform: translateY(16px) scale(0.9); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toastOut { to { transform: translateY(-10px); opacity: 0; } }

#flyers { position: fixed; inset: 0; z-index: 35; pointer-events: none; overflow: hidden; }
#flyers img { position: absolute; left: 0; top: 0; width: 44px; height: 44px; margin: -22px 0 0 -22px; filter: drop-shadow(0 3px 0 rgba(58, 22, 8, 0.4)); will-change: transform; }

/* era banner */
.era-banner { position: fixed; left: var(--sal); right: var(--sar); top: calc(var(--top-h) + 58px); z-index: 38; display: grid; place-items: center; pointer-events: none; }
.era-banner .ribbon { position: relative; width: min(92vw, 560px); padding: 16px 20px 18px; border: 4px solid var(--ink); border-radius: 26px; text-align: center; background: linear-gradient(#ffe98a, #ffb62e); box-shadow: 0 8px 0 var(--ink), 0 24px 40px rgba(58, 22, 8, 0.4), inset 0 3px 0 rgba(255, 255, 255, 0.7); animation: bannerIn 0.6s cubic-bezier(0.2, 1.6, 0.4, 1); pointer-events: auto; }
.era-banner.out .ribbon { animation: bannerOut 0.45s ease forwards; }
@keyframes bannerIn { from { transform: scale(0.3) translateY(-60px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes bannerOut { to { transform: translateY(-40px) scale(0.9); opacity: 0; } }
.era-banner .up { font: 900 15px/1 var(--font); letter-spacing: 3px; color: #fff; -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; }
.era-banner h2 { margin: 6px 0 4px; font: 900 34px/1 var(--font); color: #fff; -webkit-text-stroke: 8px var(--ink); paint-order: stroke fill; text-shadow: 0 4px 0 rgba(58, 22, 8, 0.4); }
.era-banner .look { font: 800 15px/1.25 var(--font); color: var(--ink); margin: 4px 0 8px; }
.era-banner .unlock { display: inline-block; padding: 6px 12px; border-radius: 14px; border: 3px solid var(--ink); background: #fffbe8; font: 800 13px/1.2 var(--font); }
.era-banner .nextera { margin-top: 10px; display: inline-flex; align-items: center; gap: 8px; font: 800 13px/1 var(--font); color: #5a4a2a; }
.era-banner .nextera .sil { width: 40px; height: 40px; border-radius: 50%; background: #dfe7f5; border: 3px solid var(--ink); display: grid; place-items: center; }
.era-banner .nextera img { width: 30px; height: 30px; opacity: 0.8; }
.era-banner .medal { position: absolute; left: 50%; top: -42px; translate: -50% 0; width: 84px; height: 84px; border-radius: 50%; border: 4px solid var(--ink); background: radial-gradient(circle at 35% 30%, #d2f7ff, #57c6ee); display: grid; place-items: center; box-shadow: 0 5px 0 var(--ink); }
.era-banner .medal img { width: 64px; height: 64px; }
.era-banner .ribbon.hasmedal { padding-top: 52px; }

/* loading */
.loading { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: calc(var(--sat) + 12px) calc(var(--sar) + 12px) calc(var(--sab) + 12px) calc(var(--sal) + 12px); background: linear-gradient(#8fe0f5, #3fb4e2); transition: opacity 0.4s; }
.loading.gone { opacity: 0; pointer-events: none; }
.loading-card { display: grid; place-items: center; gap: 8px; padding: 24px 32px; border: 4px solid var(--ink); border-radius: 26px; background: linear-gradient(#fff9e6, #ffeab0); box-shadow: 0 8px 0 var(--ink); }
.loading-card img { width: 72px; height: 72px; }
.loading-card b { font: 900 26px/1 var(--font); -webkit-text-stroke: 0; color: var(--ink); }
.loading-card span { font: 800 15px/1 var(--font); color: var(--ink-2); }

/* ---------- practice round (demo) ---------- */
.practice { position: fixed; inset: 0; z-index: 25; display: flex; flex-direction: column; padding: calc(var(--sat) + 10px) calc(var(--sar) + 12px) calc(var(--sab) + 12px) calc(var(--sal) + 12px); background: linear-gradient(#9be6ff 0%, #d6f6ff 55%, #b9f08c 55.2%, #7fd044 100%); animation: fadeIn 0.2s ease; overflow: hidden; }
.practice::before { content: ""; position: absolute; left: -10%; right: -10%; bottom: 0; height: 46%; background: radial-gradient(120% 90% at 50% 100%, #8fdc4c 0 60%, transparent 61%), radial-gradient(90% 70% at 15% 100%, #6fc73a 0 60%, transparent 61%); pointer-events: none; }
.practice .top-row { position: relative; z-index: 2; display: flex; align-items: center; gap: 10px; }
.practice .title { flex: 1; min-width: 0; }
.practice .title h2 { margin: 0; font: 900 24px/1 var(--font); color: #fff; letter-spacing: 1px; -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; text-shadow: 0 3px 0 rgba(58, 22, 8, 0.35); }
.practice .title p { margin: 6px 0 0; display: inline-block; padding: 4px 10px; border-radius: 12px; border: 3px solid var(--ink); background: #fffbe8; font: 900 14px/1 var(--font); }
.practice .stage { position: relative; z-index: 2; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; min-height: 0; }
.practice .stars { display: flex; gap: 8px; }
.practice .stars img { width: 40px; height: 40px; filter: grayscale(1) brightness(1.3) opacity(0.55); transition: filter 0.3s, transform 0.3s; }
.practice .stars img.on { filter: none; transform: scale(1.2) rotate(-8deg); }
.practice .sentence { display: flex; flex-wrap: wrap; gap: 8px 8px; justify-content: center; align-items: center; max-width: 760px; padding: 14px 16px; border: 4px solid var(--ink); border-radius: 26px; background: linear-gradient(#fffdf3, #fff0c2); box-shadow: 0 6px 0 var(--ink), inset 0 3px 0 #fff; font: 900 28px/1.3 var(--font); color: var(--ink); text-align: center; }
.practice .gap { display: inline-grid; place-items: center; min-width: 96px; height: 52px; padding: 0 12px; border: 4px dashed var(--ink-2); border-radius: 16px; background: #fff; color: var(--ink); font: 900 26px/1 var(--font); }
.practice .gap.now { border-style: solid; border-color: #ff8a1e; background: #fff4c9; animation: throb 1s ease-in-out infinite; }
.practice .gap.filled { border-style: solid; border-color: var(--green-d); background: #dcf9c4; color: #1d6b12; animation: fillpop 0.4s cubic-bezier(0.3, 1.8, 0.5, 1); }
@keyframes fillpop { from { transform: scale(0.6); } to { transform: scale(1); } }
.practice .bank { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; max-width: 720px; }
.practice .word { min-width: 92px; min-height: 60px; padding: 8px 18px; font-size: 24px; border-radius: 22px; }
.practice .word.wrong { animation: wrongShake 0.4s ease; }
.practice .word.used { visibility: hidden; }
@keyframes wrongShake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-9px); } 40% { transform: translateX(9px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(6px); } }
.practice .hint { margin: 0; font: 800 15px/1.2 var(--font); color: var(--ink); padding: 6px 12px; border-radius: 12px; background: rgba(255, 251, 232, 0.9); border: 3px solid var(--ink); }
.practice .demo-note { position: relative; z-index: 2; text-align: center; margin-top: 6px; font: 800 12px/1.2 var(--font); color: var(--ink); }
.practice .win { position: absolute; z-index: 5; inset: 0; display: grid; place-items: center; background: rgba(255, 246, 200, 0.55); animation: fadeIn 0.2s ease; }
.practice .win .bubble { display: grid; place-items: center; gap: 10px; padding: 22px 30px; border: 4px solid var(--ink); border-radius: 28px; background: linear-gradient(#fffbe8, #ffe38a); box-shadow: 0 8px 0 var(--ink), 0 18px 34px rgba(58, 22, 8, 0.35); animation: bannerIn 0.5s cubic-bezier(0.2, 1.6, 0.4, 1); text-align: center; }
.practice .win h3 { margin: 0; font: 900 34px/1 var(--font); color: #fff; -webkit-text-stroke: 8px var(--ink); paint-order: stroke fill; }
.practice .win .big { width: 92px; height: 92px; animation: spinPop 0.9s cubic-bezier(0.3, 1.5, 0.5, 1); }
@keyframes spinPop { from { transform: scale(0.2) rotate(-200deg); } to { transform: none; } }
.practice .win p { margin: 0; font: 800 16px/1.2 var(--font); }
.practice .done-card { position: relative; z-index: 2; display: grid; place-items: center; gap: 12px; padding: 24px 22px; max-width: 460px; text-align: center; border: 4px solid var(--ink); border-radius: 28px; background: linear-gradient(#fffdf3, #ffeab0); box-shadow: 0 8px 0 var(--ink), inset 0 3px 0 #fff; }
.practice .done-card h3 { margin: 0; font: 900 26px/1.1 var(--font); }
.practice .done-card p { margin: 0; font: 800 17px/1.25 var(--font); }
.practice .done-card img { width: 72px; height: 72px; }
.practice .win .big, .practice .done-card img { object-fit: contain; }   /* (the painted result pictures are taller than wide) */

/* settings + people + dev */
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 6px; border-bottom: 3px dotted rgba(74, 39, 18, 0.25); }
.row:last-child { border-bottom: 0; }
.row b { font: 900 17px/1.1 var(--font); }
.row small { display: block; font: 700 12px/1.2 var(--font); color: var(--ink-2); margin-top: 3px; }
.row .fsbtn { flex: 0 1 auto; min-width: 176px; }   /* EXIT FULL SCREEN: two lines (it broke into three, one word each, in a 117-142 px button) */
.silh-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 12px 0 4px; }
.silh { display: grid; place-items: center; gap: 4px; width: 92px; padding: 8px 4px; border: 3px solid var(--ink); border-radius: 18px; background: linear-gradient(#e9eef8, #c9d3e6); font: 800 11px/1.1 var(--font); color: #4a5f86; text-align: center; }
.silh canvas { width: 54px; height: 54px; }

.devtab { position: fixed; right: calc(var(--sar) + 0px); top: 46%; translate: 0 -50%; z-index: 45; padding: 10px 6px; border: 3px solid #1c2a4a; border-radius: 12px 0 0 12px; opacity: 0.85; background: #ff5d8f; color: #fff; font: 900 12px/1 var(--font); letter-spacing: 1px; writing-mode: vertical-rl; cursor: pointer; }
.devpanel { position: fixed; left: calc(var(--sal) + 8px); top: calc(var(--sat) + 8px); bottom: calc(var(--sab) + 8px); z-index: 46; width: min(300px, calc(100% - 16px)); overflow: auto; padding: 12px; border: 4px solid #1c2a4a; border-radius: 18px; background: #eef4ff; color: #1c2a4a; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); touch-action: pan-y; }
.devpanel h4 { margin: 8px 0 6px; font: 900 13px/1 var(--font); letter-spacing: 1px; text-transform: uppercase; color: #ff3d78; }
.devpanel .g { display: flex; flex-wrap: wrap; gap: 6px; }
.devpanel button { min-height: 44px; padding: 6px 10px; border: 3px solid #1c2a4a; border-radius: 12px; background: #fff; font: 900 13px/1 var(--font); color: #1c2a4a; cursor: pointer; }
.devpanel button:active { background: #ffe1ea; }
.devpanel .st { margin-top: 8px; font: 700 12px/1.3 ui-monospace, monospace; white-space: pre-wrap; }

/* ---------- layouts ---------- */
/* wide screens: era badge left, goal in the middle, counters on the right (the spec's screen) */
@media (min-width: 720px) {
  .top { grid-template-columns: minmax(230px, 300px) minmax(0, 1fr) auto auto; grid-template-areas: "era goal mp gear" ". goods goods goods"; }
  .goods { display: flex; justify-content: flex-end; flex-wrap: nowrap; }
  .goods .chip { flex: 0 0 auto; min-width: 54px; }
  .goal { max-width: 640px; justify-self: center; }
}
/* landscape phones: everything shrinks so the land keeps room */
@media (max-height: 480px) and (orientation: landscape) {
  :root { --bar-h: 64px; --gut: 8px; }
  .top { grid-template-columns: minmax(190px, 230px) minmax(0, 1fr) auto auto; grid-template-areas: "era goal mp gear" ". goods goods goods"; gap: 4px 8px; padding-top: calc(var(--sat) + 4px); }
  .era-badge { min-height: 48px; }
  .era-medal { width: 40px; height: 40px; } .era-medal img { width: 32px; height: 32px; }
  /* the NEXT GOAL card is ONE line: the words never wrap (one word per line was the bug), a long goal ends in "..." and the whole text is still the button's name */
  .goal { min-height: 48px; padding: 4px 36px 4px 8px; gap: 8px; }
  .goal::after { content: ""; position: absolute; inset: -4px 0; }   /* keeps the banner a 56 px tap target although it is drawn 48 px high */
  .goal-text { font-size: 13px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .goal-tag { padding: 4px 7px; font-size: 10px; }
  .goal-hand { width: 24px; height: 24px; margin-top: -12px; right: 6px; }
  .goods { display: flex; flex-wrap: nowrap; justify-content: flex-end; }
  .goods .chip { height: 40px; min-width: 48px; max-width: 58px; }
  .bottom { gap: 8px; padding-bottom: calc(var(--sab) + 6px); }
  .bottom .btn { flex-direction: row; height: 56px; font-size: 14px; gap: 6px; padding: 4px 8px; }
  .bottom .btn img { width: 30px; height: 30px; }
  .bottom .btn.big { flex: 1.5 1 0; height: 62px; font-size: 18px; min-width: 190px; }
  .bottom .btn.big img { width: 38px; height: 38px; }
  .objcard { grid-template-columns: auto 1fr auto; width: min(calc(100% - 20px - var(--sal) - var(--sar)), 620px); bottom: calc(var(--bar-h) + var(--sab) + 8px); gap: 2px 10px; padding: 6px 10px 8px; }
  .objcard canvas { width: 50px; height: 50px; grid-row: span 1; }
  .objcard .acts { gap: 6px; } .objcard .acts .btn { min-height: 48px; } .objcard .sub, .objcard .facts { font-size: 12px; line-height: 1.15; } .objcard .close { top: 4px; right: 4px; }
  .objcard .acts { grid-column: 1 / -1; }
  /* BUILD AGAIN: on a short sideways phone the card's buttons (the main one, BUILD ANOTHER, MOVE ...) stand in a column at its right, so the first two are always in view (they were below the
     fold, one scroll away); the title and the facts keep the left side, and the goods row steps aside while a card is open (more room for the card) */
  body.card-open .goods { display: none; }
  .objcard { padding-right: 54px; max-height: calc(100dvh - var(--top-h) - var(--bar-h) - var(--sab) - 20px); }
  .objcard .acts { grid-column: 3; grid-row: 1 / span 8; flex-direction: column; flex-wrap: nowrap; width: 190px; align-self: start; }
  .objcard .acts .btn, .objcard .acts .btn.sec, .objcard .acts .btn.again { flex: 0 0 auto; width: 100%; }
  .objcard > [style*="grid-column"] { grid-column: 1 / 3 !important; }
  .objcard .again-txt { flex-direction: row; gap: 6px; } .objcard .acts .btn.again img { display: none; }   /* BUILD ANOTHER and its price on ONE line */
  .objcard h3 { font-size: 17px; }
  .panel-head h2 { font-size: 22px; }
  .panel-head { padding: 6px 8px 6px 14px; }
  .card canvas { width: 64px !important; height: 64px !important; }   /* !important: canvasClone sets an inline size */
  .card { padding: 6px 6px 8px; gap: 3px; } .card .blurb { display: none; } .card .nm { font-size: 15px; } .card .lockico { top: 22px; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 8px; }
  /* short landscape screens: the Build menu is ONE grid of compact side-by-side cards (no section headings), so several are visible at once */
  .buildbody { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; align-content: start; }
  .buildbody .sec, .buildbody .cards { display: contents; }
  .buildbody .sec h3, .buildbody .card .work { display: none; }
  .buildbody .card { display: grid; grid-template-columns: 64px 1fr; grid-auto-rows: min-content; column-gap: 8px; row-gap: 2px; align-items: center; text-align: left; padding: 6px 8px 8px; }
  .buildbody .card canvas { grid-column: 1; grid-row: 1 / span 2; width: 64px !important; height: 64px !important; }
  .buildbody .card .nm { grid-column: 2; align-self: end; }
  .buildbody .card .cost { grid-column: 2; justify-content: flex-start; align-self: start; }
  .buildbody .card .btn, .buildbody .card .lockmsg, .buildbody .card .upg, .buildbody .card .needbox { grid-column: 1 / -1; margin-top: 2px; }
  .buildbody .card .gives { grid-column: 2; justify-content: flex-start; text-align: left; }
  .buildbody .card .btn.more { min-height: 44px; }
  .buildbody .card .lockico { left: 30px; top: 18px; translate: none; width: 26px; height: 26px; }
  .buildbody .card .tag { top: 4px; right: 6px; }
  .panel-body { padding: 8px 10px; } .panel-body .note { display: none; } .sec h3 { margin: 2px 4px 6px; font-size: 14px; }
  .panel-head .btn.round { width: 56px; height: 56px; } .panel-head h2 { font-size: 20px; }
  .place-ok { height: 58px; } .place-bar .btn.round { width: 58px; height: 58px; }
  .practice .sentence { font-size: 22px; padding: 8px 12px; } .practice .gap { height: 42px; min-width: 80px; font-size: 21px; }
  .practice .word { min-height: 56px; font-size: 20px; padding: 6px 14px; }
  .practice .stage { gap: 8px; } .practice .stars img { width: 30px; height: 30px; }
  .practice .title h2 { font-size: 20px; }
}
/* narrow phones */
@media (max-width: 520px) {
  .era-next { display: none; }
  .era-medal { width: 42px; height: 42px; } .era-medal img { width: 34px; height: 34px; }
  .era-name { font-size: 12.5px; letter-spacing: 0; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.08; }   /* a long area name wraps instead of being cut */
}
/* small phones: the object card is tighter (its buttons stay 48 px tall) */
@media (max-width: 520px) { .objcard { gap: 4px 10px; padding: 8px 10px 10px; } .objcard .acts { gap: 6px; } .objcard .acts .btn { min-height: 48px; } .objcard .facts, .objcard .sub { font-size: 12px; } }
/* 360 px phones: the Build menu keeps TWO cards per row (the panel is 300 px wide there) */
@media (max-width: 380px) { .cards { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 8px; } .card .nm { font-size: 15px; } .panel-body { padding: 10px; } .story-row .btn img { display: none; } .story-row .btn { min-width: 72px; } .story-row { gap: 8px; padding: 8px 10px; } }
@media (max-width: 400px) {
  .goods .chip { padding: 0 4px 0 1px; }
  .goods .chip b { font-size: 13px; }
  .goal-text { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .goal-hand, .collect-all, .bottom .btn.big.calling, .practice .gap.now { animation: none !important; }
  .panel, .backdrop, .toast, .objcard, .era-banner .ribbon, .practice { animation-duration: 0.01s !important; }
  .era-bar i { transition: none; }
  .btn { transition: none; }
}
body.calm .goal-hand, body.calm .collect-all, body.calm .bottom .btn.big.calling, body.calm .practice .gap.now { animation: none !important; }

/* ---------- garden slots: level pips, growth, the map of areas ---------- */
.pips, .growth { display: inline-flex; align-items: center; gap: 3px; margin: 3px 0 1px; }
.pips i, .growth i { width: 12px; height: 12px; border-radius: 50%; border: 2.5px solid var(--ink); background: #fff; }
.pips i.on { background: linear-gradient(#fff08a, #f0a11c); }
.growth i.on { background: linear-gradient(var(--green-l), var(--green)); }
.pips em, .growth em { margin-left: 4px; font: 900 11px/1 var(--font); font-style: normal; color: var(--ink-2); }
.objcard .facts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font: 800 13px/1.2 var(--font); color: var(--ink-2); }
.objcard .facts .yield { display: inline-flex; align-items: center; gap: 4px; }
.objcard .facts .yield img { width: 22px; height: 22px; }
.areas { display: grid; gap: 10px; }
.area { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 3px solid var(--ink); border-radius: 20px; background: linear-gradient(#fffdf3, #ffedb8); box-shadow: 0 4px 0 var(--ink), inset 0 2px 0 #fff; }
.area.here { background: linear-gradient(#f4ffe4, #c9f2a0); }
.area.next, .area.soon { background: linear-gradient(#e9eef8, #c9d3e6); }
.area .aicon { flex: none; width: 64px; height: 64px; }
.area .aicon img { width: 64px; height: 64px; }
.area .ainfo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.area .ainfo b { font: 900 19px/1.05 var(--font); }
.area .ablurb { font: 700 13px/1.2 var(--font); color: var(--ink-2); }
.area .astats { display: flex; flex-wrap: wrap; gap: 4px 10px; font: 900 13px/1 var(--font); }
.area .astats em { font-style: normal; display: inline-flex; align-items: center; gap: 3px; padding: 3px 8px; border-radius: 12px; border: 2.5px solid var(--ink); background: #fff; }
.area .astats img { width: 18px; height: 18px; }
.area .btn { flex: none; min-width: 84px; }
.area .lockico { flex: none; width: 36px; height: 36px; }
.area .abar { position: relative; display: block; height: 20px; border-radius: 12px; border: 3px solid var(--ink); background: #fff1cf; overflow: hidden; }
.area .abar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(var(--green-l), var(--green) 55%, #3fb126); border-radius: 10px; }
.area .abar em { position: absolute; inset: 0; display: grid; place-items: center; font: 900 11px/1 var(--font); font-style: normal; color: #fff; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; }

.objcard.arming { pointer-events: none; }
.objcard .status.needs { background: #dfe8f6; }   /* (not "practice": that class is the practice round's full-screen layer) */
.objcard .status.done { background: #dff6cf; }
.objcard .status.voice { background: #e3d4ff; }   /* the spoken check: a verse that must be said out loud */

/* ---- world map ---- */
.wm { position: fixed; inset: 0; z-index: 24; overflow: hidden; background: #7fc3de; opacity: 0; transition: opacity 0.25s ease; touch-action: none; }
.wm.show { opacity: 1; }
.wm:focus { outline: none; }
.wm canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.wm .wm-marks { touch-action: none; cursor: grab; outline: none; }
.wm-top { position: absolute; left: 0; right: 0; top: 0; z-index: 3; display: flex; align-items: center; gap: 10px; padding: calc(var(--sat) + 10px) calc(var(--sar) + 12px) 8px calc(var(--sal) + 12px); pointer-events: none; }
.wm-top .btn { pointer-events: auto; }
.wm-back { flex: none; min-height: 52px; padding: 6px 14px; border-radius: 20px; font-size: 15px; }
.wm-title { flex: 1; min-width: 0; margin: 0; text-align: right; font: 900 22px/1 var(--font); color: #fff; letter-spacing: 0.5px; -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; text-shadow: 0 3px 0 rgba(58, 22, 8, 0.35); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wm-zoom { position: absolute; z-index: 3; right: calc(var(--sar) + 14px); top: calc(var(--sat) + 74px); display: flex; flex-direction: column; gap: 12px; }
.wm-zbtn { width: 46px; height: 46px; min-width: 46px; min-height: 46px; }
.wm-zbtn span { font: 900 28px/1 var(--font); }
.wm-zbtn canvas { position: static; width: 30px; height: 30px; }
.wm-credit { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; margin: 0; padding: 8px calc(var(--sar) + 12px) calc(var(--sab) + 6px) calc(var(--sal) + 12px); text-align: center; font: 700 10.5px/1.25 var(--font); color: var(--ink); background: linear-gradient(rgba(255, 246, 220, 0), rgba(255, 246, 220, 0.88) 42%); pointer-events: none; }
.wm-pulse { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none; }
.wm-pulse i { position: absolute; left: -36px; top: -36px; width: 72px; height: 72px; border-radius: 50%; border: 4px solid #ffd23f; box-shadow: 0 0 0 2.5px rgba(74, 39, 18, 0.55), inset 0 0 0 2.5px rgba(74, 39, 18, 0.35); opacity: 0; animation: wmPulse 2s ease-out infinite; }
.wm-pulse i + i { animation-delay: 1s; }
@keyframes wmPulse { 0% { transform: scale(0.22); opacity: 0.95; } 100% { transform: scale(1.35); opacity: 0; } }
.wm-msg { position: absolute; z-index: 5; left: 50%; top: 42%; translate: -50% -50%; max-width: calc(100% - 40px); padding: 12px 18px; border: 4px solid var(--ink); border-radius: 20px; background: #fffbe8; box-shadow: 0 5px 0 var(--ink); font: 800 16px/1.25 var(--font); color: var(--ink); text-align: center; }
.wm-card { position: absolute; z-index: 4; left: calc(50% + (var(--sal) - var(--sar)) / 2); translate: -50% 0; bottom: calc(var(--sab) + 46px); width: min(calc(100% - 28px - var(--sal) - var(--sar)), 420px); display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: center; padding: 12px 14px 14px; border: 4px solid var(--ink); border-radius: 24px; background: linear-gradient(#fffdf3, #ffe9ae); box-shadow: 0 6px 0 var(--ink), 0 14px 26px rgba(58, 22, 8, 0.4), inset 0 3px 0 #fff; animation: wmPop 0.22s cubic-bezier(0.2, 1.5, 0.4, 1); }
.wm-card[data-status="current"] { background: linear-gradient(#f4ffe4, #c9f2a0); }
.wm-card[data-status="next"], .wm-card[data-status="later"] { background: linear-gradient(#f3f6fd, #cbd5e8); }
@keyframes wmShake { 0%, 100% { translate: -50% 0; } 20% { translate: calc(-50% - 7px) 0; } 40% { translate: calc(-50% + 7px) 0; } 60% { translate: calc(-50% - 5px) 0; } 80% { translate: calc(-50% + 5px) 0; } }
.wm-card.wm-shake { animation: wmShake 0.4s ease-out 1; }   /* a locked land answers a tap with "not yet": a short shake of the card (not under reduced motion: WorldMap skips the class) */
@keyframes wmPop { from { opacity: 0; transform: translateY(14px) scale(0.96); } to { opacity: 1; transform: none; } }
.wm-card-ico { grid-row: span 2; width: 46px; height: 46px; display: grid; place-items: center; }
.wm-card-ico canvas { position: static; }
.wm-card-ico.dot::before { content: ""; width: 20px; height: 20px; border-radius: 50%; background: var(--cream); border: 3px solid var(--ink); box-shadow: 0 2px 0 rgba(58, 22, 8, 0.3); }
.wm-card h3 { margin: 0; font: 900 20px/1.08 var(--font); color: var(--ink); }
.wm-card-meta { display: flex; flex-wrap: wrap; gap: 5px; }
.wm-chip { display: inline-block; padding: 3px 9px; border-radius: 12px; border: 2.5px solid var(--ink); background: #fff; font: 900 12px/1 var(--font); color: var(--ink); }
.wm-chip.here { background: #fff2a0; }
.wm-note, .wm-need, .wm-fine { grid-column: 1 / -1; margin: 2px 0 0; color: var(--ink); }
.wm-note { font: 800 14px/1.3 var(--font); }
.wm-need { font: 900 16px/1.2 var(--font); }
.wm-fine { font: 700 12px/1.25 var(--font); color: var(--ink-2); }
.wm-go { grid-column: 1 / -1; width: 100%; min-height: 56px; font-size: 18px; margin-top: 4px; }
.wm-card-x { position: absolute; top: -18px; right: -10px; width: 44px; height: 44px; padding: 0; border: 3px solid var(--ink); border-radius: 50%; background: linear-gradient(#fffdf3, #ffe9ae); box-shadow: 0 3px 0 var(--ink); font: 900 26px/1 var(--font); color: var(--ink); cursor: pointer; }
.wm-card-x::after { content: ""; position: absolute; inset: -6px; }
.wm-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wm-back:focus-visible, .wm-zbtn:focus-visible, .wm-go:focus-visible, .wm-card-x:focus-visible { outline: 4px solid #fff; outline-offset: 2px; }
@media (max-height: 480px) and (orientation: landscape) {
  .wm-top { padding-top: calc(var(--sat) + 6px); }
  .wm-back { min-height: 44px; font-size: 13px; padding: 4px 12px; }
  .wm-title { font-size: 18px; -webkit-text-stroke-width: 5px; }
  .wm-zoom { gap: 10px; top: calc(var(--sat) + 62px); }
  .wm-zbtn { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
  .wm-card { padding: 8px 12px 10px; gap: 3px 10px; bottom: calc(var(--sab) + 38px); }
  .wm-card h3 { font-size: 18px; }
  .wm-go { min-height: 48px; font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .wm { transition: none; }
  .wm-card { animation: none; }
  .wm-pulse i { animation: none; opacity: 0.9; transform: scale(0.7); }
  .wm-pulse i + i { display: none; }
}
body.calm .wm { transition: none; }
body.calm .wm-card { animation: none; }
body.calm .wm-pulse i { animation: none; opacity: 0.9; transform: scale(0.7); }
body.calm .wm-pulse i + i { display: none; }
/* ---- end world map ---- */

/* ---- story (src/story/): the intro of an act, the "New story unlocked!" banner, the Story book ---- */
#story-root { position: fixed; inset: 0; z-index: 37; pointer-events: none; }
body.story-on .hud { opacity: 0; pointer-events: none; transition: opacity 0.3s; }
body.story-on .objcard, body.story-on .tip, body.story-on .toast-wrap { display: none; }
.story-text { margin: 0; }
.story-stage { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; opacity: 0; transition: opacity 0.3s; }
.story-stage.in { opacity: 1; } .story-stage.out { opacity: 0; }
.story-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(var(--sat) + 12px) calc(var(--sar) + 12px) 0 calc(var(--sal) + 12px); }
.story-dots { display: flex; gap: 7px; padding: 8px 12px; border: 3px solid var(--ink); border-radius: 18px; background: rgba(255, 246, 220, 0.92); box-shadow: 0 3px 0 var(--ink); }
.story-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2.5px solid var(--ink); background: #fff; }
.story-dots i.done { background: var(--green); } .story-dots i.now { background: var(--gold); transform: scale(1.25); }
.story-skip { pointer-events: auto; min-width: 84px; }
.story-title { position: absolute; left: 50%; top: calc(var(--sat) + 74px); translate: -50% 0; max-width: calc(100% - 32px); padding: 6px 16px; border: 3px solid var(--ink); border-radius: 16px; background: linear-gradient(#ffb95a, #ff8a1e); color: #fff; font: 900 18px/1.1 var(--font); text-align: center; -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; }
.story-caption { align-self: center; margin: 0 0 calc(var(--sab) + 26px); width: min(calc(100% - 24px), 580px); min-height: 92px; display: flex; align-items: center; justify-content: center; padding: 16px 20px 18px; border: 4px solid var(--ink); border-radius: 26px; background: linear-gradient(#fffdf0, #ffeab0); box-shadow: 0 6px 0 var(--ink), 0 14px 24px rgba(58, 22, 8, 0.35); color: var(--ink); text-align: center; font: 900 clamp(22px, 6.2vw, 31px)/1.2 var(--font); }
.story-caption .w { opacity: 0.14; transition: opacity 0.28s ease; }
.story-caption .w.on { opacity: 1; }
.story-caption.outro { font-size: clamp(20px, 5.4vw, 26px); color: var(--ink-2); }
.story-banner { position: absolute; left: var(--sal); right: var(--sar); top: calc(var(--top-h) + 14px); display: grid; place-items: center; pointer-events: none; animation: storyIn 0.45s cubic-bezier(0.2, 1.2, 0.3, 1) both; }
.story-banner.out { animation: bannerOut 0.4s ease forwards; }
.story-banner .ribbon { position: relative; width: min(92vw, 520px); padding: 18px 20px 20px; border: 4px solid var(--ink); border-radius: 26px; text-align: center; background: linear-gradient(#ffe98a, #ffb62e); box-shadow: 0 8px 0 var(--ink), 0 18px 30px rgba(58, 22, 8, 0.4), inset 0 3px 0 rgba(255, 255, 255, 0.6); pointer-events: auto; }
.story-banner .up { font: 900 15px/1 var(--font); letter-spacing: 2px; color: #fff; -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; }
.story-banner h2 { margin: 8px 0 4px; font: 900 32px/1.05 var(--font); color: #fff; -webkit-text-stroke: 8px var(--ink); paint-order: stroke fill; text-shadow: 0 4px 0 rgba(58, 22, 8, 0.4); }
.story-banner .look { font: 800 15px/1.25 var(--font); color: var(--ink); margin: 4px 0 8px; }
.story-banner .unlock { display: inline-block; padding: 5px 12px; border-radius: 14px; border: 3px solid var(--ink); background: #fffbe8; font: 800 13px/1.2 var(--font); }
.story-btns { display: flex; gap: 12px; justify-content: center; align-items: center; margin-top: 14px; }
.story-play { position: relative; overflow: hidden; min-width: 150px; font-size: 22px; gap: 8px; }
.story-play span, .story-later span { -webkit-text-stroke: 4px var(--ink); }
.story-count { position: absolute; left: 0; bottom: 0; height: 6px; width: 100%; background: rgba(255, 255, 255, 0.85); transform-origin: left; animation: storyCount linear both; }
.storybook .story-list { display: grid; gap: 10px; }
.story-row { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 3px solid var(--ink); border-radius: 20px; background: linear-gradient(#fffdf3, #ffedb8); box-shadow: 0 4px 0 var(--ink), inset 0 2px 0 #fff; }
.story-row.new { background: linear-gradient(#f4ffe4, #c9f2a0); }
.story-row.locked { background: linear-gradient(#e9eef8, #c9d3e6); color: #55617c; }
.story-num { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; border: 3px solid var(--ink); background: #fff; font: 900 22px/1 var(--font); }
.story-row.locked .story-num { background: #b7c2d8; }
.story-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.story-info b { font: 900 19px/1.1 var(--font); } .story-info span { font: 700 13px/1.2 var(--font); color: var(--ink-2); }
.story-row.locked .story-info span { color: #55617c; }
.story-new { align-self: flex-start; padding: 2px 8px; border-radius: 10px; border: 2.5px solid var(--ink); background: var(--orange); color: #fff; font: 900 11px/1.2 var(--font); font-style: normal; letter-spacing: 1px; }
.story-row .btn { flex: none; min-width: 92px; }
.story-row .lockico { flex: none; width: 36px; height: 36px; }
.story-note { font-weight: 900 !important; color: var(--purple-d) !important; }
@keyframes storyIn { from { opacity: 0; transform: translateY(-24px) scale(0.92); } to { opacity: 1; transform: none; } }
@keyframes storyCount { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (max-height: 480px) and (orientation: landscape) {
  .story-caption { min-height: 64px; padding: 8px 14px 10px; font-size: 21px; margin-bottom: calc(var(--sab) + 10px); } .story-title { top: calc(var(--sat) + 62px); font-size: 15px; }
  /* short screens: both banners shrink so they fit between the HUD and the bottom bar */
  .story-banner { top: calc(var(--top-h) + 8px); } .story-banner .ribbon { padding: 8px 18px 12px; } .story-banner h2 { font-size: 24px; margin: 4px 0 2px; -webkit-text-stroke-width: 6px; } .story-banner .look { margin: 2px 0 4px; font-size: 13px; } .story-banner .unlock { display: none; } .story-btns { margin-top: 6px; }
  .era-banner { top: calc(var(--top-h) + 38px); } .era-banner .ribbon { padding: 10px 18px 12px; } .era-banner .ribbon.hasmedal { padding-top: 34px; } .era-banner .medal { width: 62px; height: 62px; top: -32px; } .era-banner .medal img { width: 48px; height: 48px; }
  .era-banner h2 { font-size: 26px; margin: 2px 0; -webkit-text-stroke-width: 6px; } .era-banner .look { font-size: 13px; margin: 2px 0 4px; } .era-banner .unlock { padding: 3px 10px; font-size: 12px; } .era-banner .nextera { display: none; }
}
/* a short portrait phone (320x568: the HUD alone is 296 px tall, the bottom bar starts at 474): the new-place banner shrinks like the sideways one, the blurb goes (the unlock line stays: it says what to tap), it sits just under the HUD */
@media (max-width: 400px) and (max-height: 600px) and (orientation: portrait) {
  .era-banner { top: calc(var(--top-h) + 8px); } .era-banner .ribbon { padding: 10px 14px 12px; } .era-banner .ribbon.hasmedal { padding-top: 34px; }
  .era-banner .medal { width: 62px; height: 62px; top: -32px; } .era-banner .medal img { width: 48px; height: 48px; }
  .era-banner h2 { font-size: 24px; margin: 2px 0; -webkit-text-stroke-width: 6px; } .era-banner .look { display: none; } .era-banner .unlock { padding: 3px 10px; font-size: 12px; } .era-banner .nextera { display: none; }
}
@media (prefers-reduced-motion: reduce) { .story-stage, .story-caption .w, .story-banner { transition: none !important; animation-duration: 0.01s !important; } .story-count { animation: none; display: none; } }
body.calm .story-stage, body.calm .story-caption .w { transition: none; } body.calm .story-banner { animation-duration: 0.01s; } body.calm .story-count { animation: none; display: none; }
/* the bottom bar on a phone: PRACTICE, BUILD, MAP, STORY and a MORE button (MY PEOPLE and VISIT live in its small menu): five buttons, each 56+ px wide and with a label you can read.
   MORE is shown at EVERY width (it holds ALBUM, TRIBES, LISTS, VERSE PACKS and the leader tools: from 600 px wide it used to be hidden, a sideways phone had no door to them); from 600 px MY PEOPLE and VISIT stay in the row too. */
#btn-more { display: inline-flex; }
.bottom .btn .dots { display: flex; align-items: center; justify-content: center; gap: 4px; width: 34px; height: 34px; -webkit-text-stroke: 0; }
.dots i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #fff; border: 2.5px solid var(--ink); box-sizing: content-box; }
.more-menu { position: absolute; z-index: 9; right: calc(var(--sar) + var(--gut)); bottom: calc(var(--bar-h) + var(--sab) + 10px); display: flex; flex-direction: column; gap: 10px; padding: 10px; max-height: calc(100vh - var(--sat) - var(--bar-h) - var(--sab) - 60px); max-height: calc(100dvh - var(--sat) - var(--bar-h) - var(--sab) - 60px); overflow-y: auto; overscroll-behavior: contain; border: 3px solid var(--ink); border-radius: 22px; background: linear-gradient(#fff9e6, var(--cream-2)); box-shadow: 0 5px 0 var(--ink), 0 12px 20px rgba(58, 22, 8, 0.3), inset 0 2px 0 #fff; animation: popIn 0.16s ease; }
.more-menu .btn { flex-direction: row; justify-content: flex-start; gap: 10px; min-width: 200px; min-height: 56px; font-size: 17px; padding: 6px 16px 6px 12px; }
.more-menu .btn span { -webkit-text-stroke: 4px var(--ink); }
@media (max-width: 599px) {
  #btn-people, #btn-visit { display: none; }
  .bottom { gap: 6px; }
  .bottom .btn { font-size: 11.5px; padding: 6px 2px 8px; letter-spacing: 0; }
  .bottom .btn.big { flex: 1.5 1 0; font-size: 13px; }
  .bottom .btn span { -webkit-text-stroke-width: 3.5px; }
}
@media (max-width: 400px) { .bottom { gap: 5px; } .bottom .btn.big { flex: 1.6 1 0; } }
@media (max-width: 380px) { .bottom .btn { font-size: 11px; } .bottom .btn.big { font-size: 12.5px; } .bottom .btn span { -webkit-text-stroke-width: 3px; } }
/* ---- end story ---- */

/* ---- real mode: the sign-in gate, a purchase in flight, the practice button that goes to Hide the Word ---- */
.gate { z-index: 70; }
.gate[hidden] { display: none; }
.gate-card { max-width: min(92vw, 380px); text-align: center; gap: 12px; padding: 26px 24px 24px; }
.gate-card img { width: 72px; height: 72px; }
.gate-card p { margin: 0; font: 800 18px/1.25 var(--font); color: var(--ink); }
.gate-card .btn { min-width: 220px; }
.gate-card .btn span { color: #fff; font: 900 20px/1.1 var(--font); letter-spacing: 0.5px; -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; }
.buy-status { position: relative; max-width: min(92vw, 440px); display: flex; align-items: center; gap: 10px; padding: 9px 18px 9px 14px; border: 3px solid var(--ink); border-radius: 22px; background: #fffbe8; box-shadow: 0 4px 0 var(--ink), 0 10px 18px rgba(58, 22, 8, 0.3); font: 900 15px/1 var(--font); color: var(--ink); pointer-events: none; }
.buy-status[hidden] { display: none; }
.buy-status .spin { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 4px solid #cfe9f7; border-top-color: var(--blue-d, #2b8ec4); animation: buySpin 0.8s linear infinite; }
.buy-status.retry { background: #fff1c9; }
@keyframes buySpin { to { transform: rotate(360deg); } }
body.buying #place-ok { opacity: 0.55; }
body.buying #place-ok, body.buying .card .btn.green, body.buying .card .btn.orange, body.buying .acts .btn.orange { pointer-events: none; filter: grayscale(0.55); }
.btn .sub { display: block; white-space: nowrap; font: 800 10px/1 var(--font); letter-spacing: -0.3px; margin-top: 1px; color: #fff; -webkit-text-stroke: 2.5px var(--ink); paint-order: stroke fill; text-transform: none; }
@media (max-height: 480px) and (orientation: landscape) { .btn .sub { display: none; } }
@media (prefers-reduced-motion: reduce) { .buy-status .spin { animation-duration: 2.4s; } }
body.calm .buy-status .spin { animation-duration: 2.4s; }
/* ---- end real mode ---- */

/* ---- reduced motion, for EVERYTHING (the system setting, and the in-game CALM switch which puts `calm` on the body): no looping or moving animation, transitions are instant.
   (The "Buying..." spinner only turns slowly: it is the one thing that tells a child the game is working.) ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
  .buy-status .spin { animation-duration: 2.4s !important; animation-iteration-count: infinite !important; }
}
body.calm *, body.calm *::before, body.calm *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
body.calm .buy-status .spin { animation-duration: 2.4s !important; animation-iteration-count: infinite !important; }
@media (max-width: 400px) { .btn .sub { font-size: 9.5px; letter-spacing: -0.4px; } }   /* real mode's PRACTICE says "in Hide the Word" under its name: it has to fit the big button on a 360 px phone */

/* small portrait phones (owner request): ALL EIGHT goods in ONE line, icon over its number, every icon whole inside its button (the tall wheat was cut at the top) */
@media (max-width: 520px) and (orientation: portrait) {
  .goods { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 2px; }   /* (2 px, not 3: a 360 px phone's counters are 40.7 px wide, not 39.9) */
  .goods .chip { flex-direction: column; justify-content: center; gap: 1px; height: 44px; padding: 3px 0 2px; border-radius: 14px; }
  .goods .chip::after { inset: -6px -1px; }
  .goods .chip img { width: 24px; height: 22px; margin: 0; object-fit: contain; }
  .goods .chip b { font-size: 12px; min-width: 0; text-align: center; line-height: 1; -webkit-text-stroke: 3px var(--ink); }
}
/* a 320 px phone: eight counters in one line would be 35 px wide (under the 40 px minimum), so they take TWO rows of four, the icon beside its number */
@media (max-width: 349px) and (orientation: portrait) {
  .goods { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .goods .chip { flex-direction: row; gap: 3px; height: 42px; padding: 0 2px; }
  .goods .chip::after { inset: -2px; }
  .goods .chip img { width: 28px; height: 26px; }
  .goods .chip b { font-size: 15px; }
}

/* ---------- the streak chip's room in the top line (after every layout above, so it wins; only while .has-streak) ---------- */
.top.has-streak { grid-template-columns: minmax(0, 1fr) auto auto auto; grid-template-areas: "era streak mp gear" "goal goal goal goal" "goods goods goods goods"; }
@media (min-width: 720px) { .top.has-streak { grid-template-columns: minmax(230px, 300px) auto minmax(0, 1fr) auto auto; grid-template-areas: "era streak goal mp gear" ". goods goods goods goods"; } }
@media (max-height: 480px) and (orientation: landscape) { .top.has-streak { grid-template-columns: minmax(190px, 230px) auto minmax(0, 1fr) auto auto; grid-template-areas: "era streak goal mp gear" ". goods goods goods goods"; } }
/* phones up to 400 px wide (a 360 px phone is the tightest): the flame, the points chip, the gear and the area badge all give a little so the area name still has room (two short lines);
   the small green sprout flame becomes a badge on the flame chip's corner; the tap targets stay 56 px (the ::after of .chip and .gear grow them) */
@media (max-width: 400px) {
  .top.has-streak { gap: 8px 6px; }
  .top.has-streak .chip-streak { height: 42px; padding: 0 6px 0 2px; gap: 1px; }
  .top.has-streak .chip-streak img:not(.sprout) { width: 28px; height: 28px; }
  .top.has-streak .chip-streak b { font-size: 17px; min-width: 10px; }
  .top.has-streak .chip-streak .sprout { position: absolute; right: -7px; top: -7px; width: 17px; height: 17px; margin: 0; }
  .top.has-streak .chip-mp { height: 42px; padding: 0 6px 0 3px; }
  .top.has-streak .chip-mp img { width: 28px; height: 28px; }
  .top.has-streak .chip-mp b { font-size: 17px; }
  .top.has-streak .gear { width: 38px; height: 38px; }
  .top.has-streak .gear img { width: 25px; height: 25px; }
  .top.has-streak .era-badge { padding: 4px 8px 4px 3px; gap: 5px; }
  .top.has-streak .era-medal { width: 38px; height: 38px; } .top.has-streak .era-medal img { width: 31px; height: 31px; }
  .top.has-streak .era-bar em { font-size: 9px; letter-spacing: -0.3px; white-space: nowrap; }
  .top.has-streak .chip-streak.wide b { font-size: 15px; }   /* three digits (100 days and more) on the narrowest phone */
}
/* the verse card's Kept Verses line: the step in green, then what the next one needs */
.objcard .tier-line b { color: #2e7a2a; }

/* ---- THE STREAK SCREEN and the gift party (ui/StreakScreen.js, App.streakGiftParty): warm, never red */
.streakscr { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }   /* minmax(0, 1fr): a wide child (the calendar, the name buttons) scrolls or wraps inside its section instead of pushing every section past the panel */
.ss-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }   /* (wraps: the Best / title chip drops under the number on a 360 px phone, never past the panel) */
.ss-flame { width: 64px; height: 64px; }
.ss-days b { font: 900 44px/1 var(--font); color: #ea5a22; margin-right: 6px; }
.ss-days span, .ss-best { font: 800 15px/1.2 var(--font); color: var(--ink-2); }
.ss-best { margin-left: auto; display: grid; gap: 4px; justify-items: end; }
.ss-title { background: #ffe9a0; border: 2px solid #e8a114; border-radius: 12px; padding: 2px 10px; color: #7a4c00; }
.ss-sec { background: #fffdf4; border: 2px solid #e6d9b0; border-radius: 16px; padding: 10px 12px; display: grid; gap: 8px; }
.ss-sec h3 { margin: 0; font: 900 14px/1 var(--font); color: var(--ink-2); letter-spacing: 1.5px; text-transform: uppercase; }
.ss-mend { background: #eef6ff; border-color: #9cc4ee; }
.ss-soft { color: #2d6a3a; font-weight: 800; }
.ss-bar { height: 14px; background: #d8e6f6; border-radius: 8px; overflow: hidden; border: 2px solid #9cc4ee; }
.ss-bar i { display: block; height: 100%; background: linear-gradient(#7fd06a, #3fa04a); }
.ss-lambs { display: flex; gap: 8px; }
.ss-lamb { width: 46px; height: 46px; border-radius: 50%; background: #e9edf5; display: grid; place-items: center; opacity: 0.45; }
.ss-lamb.on { background: #dff0ff; opacity: 1; }
.ss-lamb img { width: 40px; height: 40px; }
.ss-nextrow { display: flex; align-items: center; gap: 12px; }
.ss-sealed { width: 84px; height: 84px; border-radius: 16px; background: linear-gradient(#b8a6f0, #6a4fc8); color: #fff; font: 900 46px/84px var(--font); text-align: center; flex: none; }
.ss-left { font: 900 14px/1 var(--font); color: #b05a10; margin-top: 4px; }
.ss-ladder { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
.ss-rung { display: grid; justify-items: center; gap: 2px; padding: 6px 2px; border-radius: 12px; background: #f3f0e4; border: 2px solid #e0d8bc; text-align: center; opacity: 0.8; }
.ss-rung.got { background: #e4f5d8; border-color: #8fcf6a; opacity: 1; }
.ss-rung.next { border-color: #e8a114; background: #fff3c4; opacity: 1; box-shadow: 0 0 0 3px rgba(255, 214, 80, 0.5); }
.ss-rung b { font: 900 18px/1 var(--font); }
.ss-rung .nm { font: 800 11px/1.1 var(--font); color: var(--ink-2); }
.ss-rung canvas { width: 44px; height: 44px; }
.ss-q { width: 44px; height: 44px; font: 900 28px/44px var(--font); color: #9a8fc8; }
.ss-calhead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.ss-calhead b { font: 900 17px/1 var(--font); }
.ss-dow, .ss-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.ss-dow span { text-align: center; font: 900 12px/1 var(--font); color: var(--ink-2); }
.ss-month { display: grid; gap: 4px; }
.ss-day { position: relative; aspect-ratio: 1; min-height: 38px; border-radius: 10px; background: #f3f0e4; border: 2px solid #e6dfc6; display: grid; place-items: center; }
.ss-day .n { position: absolute; top: 1px; left: 4px; font: 800 10px/1 var(--font); color: #8a8470; }
.ss-day .ss-ic { width: 26px; height: 26px; }
.ss-day.flame { background: #fff0d0; border-color: #f0a030; }
.ss-day.rest { background: #e6f0ff; border-color: #9cb8e8; }
.ss-day.stitch { background: #fde8dc; border-color: #e8a080; }
.ss-day.today { border-color: #ea5a22; border-style: dashed; }
.ss-day.future, .ss-day.blank, .ss-day.before { background: transparent; border-color: transparent; }
.ss-day.future .n { color: #c8c2ae; }
.ss-year { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 9px); gap: 3px; overflow-x: auto; padding: 4px 0; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: #e6dfc6; }
.dot.flame { background: #f0902a; } .dot.rest { background: #7fa6e8; } .dot.stitch { background: #e8845a; } .dot.today { background: #fff; border: 2px solid #ea5a22; box-sizing: border-box; } .dot.future, .dot.before { background: transparent; }
.ss-legend { display: flex; flex-wrap: wrap; gap: 10px; font: 800 12px/1 var(--font); color: var(--ink-2); align-items: center; }
.ss-legend span { display: inline-flex; align-items: center; gap: 4px; } .ss-legend .ss-ic { width: 20px; height: 20px; }
.ss-names { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.streak-party { position: fixed; inset: 0; display: grid; place-items: center; z-index: 60; background: rgba(40, 30, 10, 0.35); animation: fadein 0.3s; }
.streak-party.out { opacity: 0; transition: opacity 0.4s; }
.sp-card { width: min(92vw, 360px); background: linear-gradient(#fffbe0, #ffe9a0); border: 4px solid #e8a114; border-radius: 22px; padding: 16px; display: grid; gap: 8px; justify-items: center; text-align: center; box-shadow: 0 8px 0 #b97a0c, 0 0 0 6px rgba(255, 214, 80, 0.5); }
.sp-up { font: 900 18px/1 var(--font); color: #b05a10; letter-spacing: 1.5px; }
.sp-sealed { font: 900 14px/1 var(--font); color: #5a3fb8; }
.sp-card h2 { margin: 0; font: 900 24px/1.1 var(--font); }
.sp-verse { font: italic 800 14px/1.3 var(--font); color: #6a5a30; }
.sp-blurb { font: 700 14px/1.3 var(--font); color: var(--ink-2); }
.sp-btns { display: flex; gap: 10px; margin-top: 4px; }
.sp-card { max-height: calc(100vh - 12px); overflow-y: auto; box-sizing: border-box; }   /* (a short sideways phone: the card scrolls instead of hiding its button) */
@media (max-height: 480px) and (orientation: landscape) { .sp-card { gap: 3px; padding: 8px 14px; } .sp-card canvas, .sp-card .ss-badge { width: 68px !important; height: 68px !important; } .sp-card h2 { font-size: 20px; } .sp-verse, .sp-blurb { font-size: 13px; line-height: 1.2; } .sp-btns { margin-top: 2px; } }

/* ---------- VERSES: the big button bottom-left (it replaced PRACTICE). Two tap sides inside one button: the open book (verses ready to practice, tap = practice them one after the other,
   due today first) and the hammer (verses waiting for a home, tap = go and place the next one). A side with 0 is dimmed; the word VERSES sits between them. ---------- */
.verses { padding: 0; gap: 0; cursor: default; }
.bottom .btn.verses .vside { position: absolute; top: 0; bottom: 19px; width: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; margin: 0; padding: 4px 0 0; border: 0; background: none; color: #fff; font: inherit; cursor: pointer; touch-action: manipulation; z-index: 1; }
.verses .vbook { left: 0; border-radius: 20px 0 0 20px; } .verses .vhome { right: 0; border-radius: 0 20px 20px 0; box-shadow: inset 2px 0 0 rgba(58, 22, 8, 0.28); }
.verses .vside:active { background: rgba(58, 22, 8, 0.12); } .verses .vside:focus-visible { outline: 3px solid #fff; outline-offset: -5px; }
.bottom .btn.verses .vside img { width: 28px; height: 28px; }
.vnum { font: 900 15px/1 var(--font); font-style: normal; font-variant-numeric: tabular-nums; min-width: 14px; text-align: center; color: #fff; -webkit-text-stroke: 3.5px var(--ink); paint-order: stroke fill; }
.vside.due .vnum { padding: 3px 5px 2px; border-radius: 12px; background: linear-gradient(#ffd27a, #ff9a3d); -webkit-text-stroke: 3px var(--ink); box-shadow: 0 0 0 2px #fff6c8, 0 0 0 4px var(--ink); }   /* DUE TODAY: the book's number turns orange with a ring (as the PRACTICE badge did) */
.verses .vside.zero { opacity: 0.5; filter: saturate(0.5); }
.bottom .btn.verses .vlabel { position: absolute; left: 0; right: 0; bottom: 4px; text-align: center; pointer-events: none; font: 900 11px/1 var(--font); letter-spacing: 0.5px; -webkit-text-stroke: 3px var(--ink); }
@media (max-width: 340px) { .bottom .btn.big.verses { flex: 2.2 1 0; } }   /* a 320 px phone: each side of VERSES is 46 px wide (was 40: the throb made it 39); the four others stay 45 px */
@media (max-height: 480px) and (orientation: landscape) {
  .bottom .btn.verses .vside { flex-direction: row; bottom: 0; padding: 0 12px; gap: 5px; }
  .bottom .btn.verses .vbook { justify-content: flex-start; } .bottom .btn.verses .vhome { justify-content: flex-end; }
  .bottom .btn.verses .vside img { width: 34px; height: 34px; }
  .vnum { font-size: 17px; }
  .bottom .btn.verses .vlabel { top: 50%; bottom: auto; transform: translateY(-50%); font-size: 13px; }
  .bottom .btn.big.verses { min-width: 244px; }
  .era-next { display: none; }   /* (the grey next-level medal: the name and the chapter count need its room) */
  /* a phone held sideways (832x384, 844x390, 915x412 as well as 650x254): nine buttons in one row overlapped their own icons, so MY PEOPLE and VISIT go behind MORE (the same menu as a portrait phone: it is the door to
     ALBUM, TRIBES, LISTS, VERSE PACKS and the leader tools, and the Settings panel repeats every one of those doors) */
  #btn-people, #btn-visit, .bottom #btn-tent, .bottom #btn-oldapp { display: none; }   /* (the leader's tent and the old-app link have their rows in MORE; ".bottom #id" beats the style those two buttons inject for themselves) */
  .bottom .btn .dots { width: 28px; height: 28px; gap: 2px; } .dots i { width: 4px; height: 4px; }   /* (the three dots shrink: MORE is a row here, dots and word side by side) */
  .more-menu { flex-direction: row; flex-wrap: wrap; justify-content: flex-end; align-content: flex-start; max-width: calc(100% - var(--sal) - var(--sar) - 2 * var(--gut)); bottom: calc(var(--bar-h) + var(--sab) + 4px); gap: 8px; padding: 8px; }   /* (up to nine buttons: they wrap into rows, and the box scrolls when even that is too tall: none is ever cut off) */
  .more-menu .btn { min-width: 0; min-height: 44px; font-size: 14px; padding: 4px 12px 4px 8px; }
}

/* ---------- SHORT LANDSCAPE (a phone held sideways with its browser bars: 650x254, 740x300): ONE top row (area badge, streak, NEXT GOAL, points, settings), the eight goods as a 2x4 block under it at the
   right, ONE bottom row. The map keeps the middle. Tap targets are 44 px high; the goods are 40 px (see the report). ---------- */
@media (max-height: 340px) and (orientation: landscape) {
  :root { --bar-h: 54px; }
  .bottom .btn .dots { display: none; }   /* (650 and 740 px wide: the word MORE alone, the button is only 64 px wide) */
  .top, .top.has-streak { gap: 0 6px; grid-template-columns: minmax(0, 178px) minmax(0, 1fr) auto auto; grid-template-areas: "era goal mp gear"; }
  .top.has-streak { grid-template-columns: minmax(0, 178px) auto minmax(0, 1fr) auto auto; grid-template-areas: "era streak goal mp gear"; }
  .era-badge { min-height: 44px; max-width: none; padding: 3px 8px 3px 3px; gap: 6px; border-radius: 26px; }
  .era-medal { width: 36px; height: 36px; } .era-medal img { width: 29px; height: 29px; }
  .era-name { font-size: 12.5px; } .era-bar { height: 17px; } .era-bar em { font-size: 10px; } .era-next { display: none; }
  .top .chip-streak, .top .chip-mp, .top .gear { height: 44px; }
  .top .chip-streak { padding: 0 8px 0 3px; } .top .chip-mp { padding: 0 10px 0 4px; } .top .gear { width: 44px; }
  .goal { min-height: 44px; padding: 3px 8px 3px 7px; gap: 6px; }
  .goal::after { inset: -6px 0; }
  .goal-hand { display: none; }   /* (no room for the pointing hand: the card is plainly a button, the words get the width) */
  .goal-text { font-size: 12.5px; }
  .goal-tail { font-size: 14px; -webkit-text-stroke-width: 3px; }
  .top .chip-mp img { width: 32px; height: 32px; } .top .chip-mp b { font-size: 19px; } .top .chip-mp { padding: 0 8px 0 4px; }
  .goods { position: absolute; grid-area: auto; right: calc(var(--sar) + var(--gut)); top: calc(var(--sat) + 52px); display: grid; grid-template-columns: repeat(4, 44px); gap: 4px; justify-content: end; }
  .goods .chip { flex-direction: column; justify-content: center; gap: 1px; height: 40px; min-width: 0; max-width: none; padding: 2px 0 1px; border-radius: 14px; }
  .goods .chip::after { inset: -2px; }
  .goods .chip img { width: 22px; height: 20px; margin: 0; object-fit: contain; }
  .goods .chip b { font-size: 12px; min-width: 0; text-align: center; line-height: 1; -webkit-text-stroke: 3px var(--ink); }
  .bottom { gap: 6px; padding-bottom: calc(var(--sab) + 7px); }
  .bottom .btn { height: 44px; min-height: 44px; min-width: 0; font-size: 13px; padding: 2px 6px; gap: 4px; border-radius: 16px; box-shadow: 0 3px 0 var(--dark), 0 3px 0 3px var(--ink), 0 6px 10px rgba(58, 22, 8, 0.3), inset 0 3px 0 rgba(255, 255, 255, 0.6), inset 0 -3px 0 rgba(0, 0, 0, 0.1); }
  .bottom .btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--dark), 0 0 0 3px var(--ink), inset 0 3px 0 rgba(255, 255, 255, 0.5); }
  .bottom .btn img { width: 26px; height: 26px; }
  .bottom .btn.big { height: 48px; min-height: 48px; font-size: 13px; border-radius: 18px; }
  .bottom .btn.big.verses { min-width: 214px; }
  .bottom .btn.verses .vside { padding: 0 9px; gap: 4px; } .bottom .btn.verses .vside img { width: 26px; height: 26px; }
  .vnum { font-size: 15px; } .bottom .btn.verses .vlabel { font-size: 12px; }
  .bottom .btn .badge { min-width: 22px; height: 22px; padding: 0 4px; font: 900 12px/16px var(--font); -webkit-text-stroke-width: 2.5px; right: -4px; top: -9px; }   /* (STORY's news badge: smaller, it sat on the last letter) */
  .dock { bottom: calc(var(--bar-h) + var(--sab) + 6px); }
  .dock .collect-all { min-height: 44px; padding: 4px 16px; font-size: 16px; }
  .learn-bag { bottom: calc(var(--bar-h) + var(--sab) + 6px); flex-direction: row; width: auto; min-height: 44px; padding: 4px 12px 4px 8px; gap: 6px; border-radius: 22px; }
  .learn-bag img { width: 28px; height: 28px; } .learn-bag span { font-size: 11px; white-space: nowrap; }
}
@media (max-height: 480px) and (max-width: 899px) and (orientation: landscape) { .goal-tag { display: none; } }   /* 650, 740 and 844 px wide: the words get the room, the tag would take a quarter of the card */
/* ---------- rewarded ads: the Free gifts shelf, the small WATCH buttons and the TEST AD card (src/ui/Panels.js, src/ads/TestAdCard.js; docs/REWARDED_ADS.md) ---------- */
.sec.ads { padding: 8px 8px 10px; border: 3px solid #b97a0c; border-radius: 22px; background: linear-gradient(#fff6c9, #ffe28a); box-shadow: 0 4px 0 #b97a0c, inset 0 2px 0 #fff; }
.sec.ads .adshead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 2px 4px 6px; }
.sec.ads .adshead h3 { margin: 0; color: #8a4f00; }
.sec.ads .adsleft { padding: 4px 9px; border-radius: 12px; background: var(--ink); color: #fff; font: 800 12px/1 var(--font); white-space: nowrap; }
.sec.ads .adsnote { margin: 0 4px 8px; font: 800 13px/1.25 var(--font); color: var(--ink-2); }
.sec.ads .card.pack { border-color: #b97a0c; }
.sec.ads .card.pack .blurb { min-height: 30px; }
.card .btn.watch { --c1: #d8f9a8; --c2: #7fdc45; --c3: #4fbd24; --dark: #2c8a14; }
.card .btn.watchsmall, .upg .btn.watchsmall, .upgsec .btn.watchsmall { min-height: 46px; font-size: 13px; letter-spacing: 0; gap: 4px; padding: 4px 8px; margin-top: 2px; }
.card .btn.watchsmall { width: 100%; }
.watchico { display: inline-block; width: 18px; height: 18px; border: 2.5px solid var(--ink); border-radius: 5px; background: #fff; position: relative; flex: none; box-shadow: 0 2px 0 rgba(58, 22, 8, 0.35); }
.watchico::after { content: ""; position: absolute; left: 5px; top: 2.5px; border-style: solid; border-width: 4.5px 0 4.5px 8px; border-color: transparent transparent transparent #2c8a14; }
.objcard .acts .btn.watchsmall { flex: 1 1 150px; }
.adtest { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: calc(var(--sat) + 16px) calc(var(--sar) + 16px) calc(var(--sab) + 16px) calc(var(--sal) + 16px); background: rgba(24, 12, 40, 0.92); touch-action: none; }
.adt-card { width: min(100%, 420px); display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 20px 16px 16px; border: 4px solid var(--ink); border-radius: 26px; background: linear-gradient(#fffdf3, #e6dcff); box-shadow: 0 6px 0 var(--ink), 0 14px 30px rgba(0, 0, 0, 0.45); text-align: center; max-height: 100%; overflow: auto; }
.adt-ribbon { padding: 8px 26px; border: 3px solid var(--ink); border-radius: 14px; background: linear-gradient(#ff8a7a, #f0402e); color: #fff; font: 900 26px/1 var(--font); letter-spacing: 3px; -webkit-text-stroke: 5px var(--ink); paint-order: stroke fill; transform: rotate(-3deg); }
.adt-title { font: 900 22px/1.1 var(--font); color: var(--ink); }
.adt-body { font: 800 14px/1.3 var(--font); color: var(--ink-2); }
.adt-ring { display: grid; place-items: center; width: 112px; height: 112px; border: 5px solid var(--ink); border-radius: 50%; background: #fff; box-shadow: inset 0 3px 0 rgba(0, 0, 0, 0.08); }
.adt-ring b { font: 900 52px/1 var(--font); color: #6b2fa3; font-variant-numeric: tabular-nums; }
.adt-ring span { margin-top: -26px; font: 800 12px/1 var(--font); color: var(--ink-2); }
.adt-bar { width: 100%; height: 18px; border: 3px solid var(--ink); border-radius: 12px; background: #fff; overflow: hidden; }
.adt-fill { display: block; height: 100%; width: 0; background: linear-gradient(#b2f77a, #59d13a); transition: width 0.12s linear; }
.adt-note { min-height: 20px; font: 900 15px/1.2 var(--font); color: #2b6a14; }
.adt-card .adt-go { width: 100%; min-height: 64px; font-size: 22px; }
.adt-card .adt-go[hidden], .adt-card .adt-stop[hidden] { display: none; }
.adt-stop { margin-top: 2px; padding: 12px 16px; min-height: 44px; border: 0; background: none; color: #5a6b8c; font: 800 13px/1 var(--font); text-decoration: underline; cursor: pointer; }
.adt-card.done .adt-ring b { color: #2b6a14; }
@media (max-height: 560px) { .adt-card { gap: 6px; padding: 12px 12px 10px; } .adt-ribbon { font-size: 20px; padding: 5px 20px; } .adt-title { font-size: 18px; } .adt-body { font-size: 12px; } .adt-ring { width: 72px; height: 72px; } .adt-ring b { font-size: 32px; } .adt-ring span { display: none; } .adt-card .adt-go { min-height: 56px; font-size: 19px; } }
@media (prefers-reduced-motion: reduce) { .adt-fill { transition: none; } .adt-ribbon { transform: none; } }
@media (max-height: 480px) and (orientation: landscape) {   /* a phone held sideways: the FREE GIFTS box stays one box across the Build menu's grid */
  .buildbody .sec.ads { display: block; grid-column: 1 / -1; padding: 6px 8px 8px; }
  .buildbody .sec.ads h3 { display: block; }
  .buildbody .sec.ads .cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
}
