/* The Moonstone Map (GR2, 2026-10-19; GR3 2026-10-21): Grandpa Bo's map, the Attic, Firefly Wood and the Explorer's Journal.
   Menus are drawn as part of the world: a painted map, a leather journal, parchment cards. Big buttons for small hands
   (64px+), nothing tappable on the very bottom edge in play, and no reading needed for Little explorers. */
:root { --night-0: #0b1128; --night-1: #121b40; --parch: #f3e7cc; --parch-2: #e8d6ae; --ink-b: #3d2b1b; --ink-b2: #6b4f35; --gold-l: #f2c86b; --glow: #ffd987; }
[hidden] { display: none !important; }
html, body.game { margin: 0; height: 100%; overflow: hidden; background: var(--night-0); overscroll-behavior: none; }
body.game { color: var(--parch); font-family: var(--body); -webkit-tap-highlight-color: transparent; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
body.game button:not(.wnav__music) { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
body.game img { -webkit-user-drag: none; user-select: none; }
.wnav { display: none !important; } /* full-screen game: the back arrow goes to the Games Room, which has the site menu */

/* ── the place ─────────────────────────────────────────────────────────── */
#scene { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; touch-action: none; opacity: 0; transition: opacity .7s; }
body.playing #scene { opacity: 1; }
#vignette { position: fixed; inset: 0; pointer-events: none; opacity: 0; transition: opacity .7s;
  background: radial-gradient(130% 95% at 50% 46%, transparent 62%, rgba(6, 10, 30, .38) 100%); }
body.playing #vignette { opacity: 1; }
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 30; overflow: hidden; }
.ripple { position: absolute; width: 64px; height: 26px; margin: -13px 0 0 -32px; border-radius: 50%; border: 2.5px solid rgba(255, 232, 170, .8); animation: rip .6s ease-out forwards; }
@keyframes rip { from { transform: scale(.3); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }
.fly { position: absolute; width: 84px; height: 84px; margin: -42px 0 0 -42px; object-fit: contain; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .45)); will-change: transform; }
.fly--card { border-radius: 14px; background: var(--parch); padding: 6px; box-shadow: 0 0 0 3px rgba(242, 200, 107, .85), 0 10px 24px rgba(0, 0, 0, .4); }

#hud { position: fixed; z-index: 40; inset: 0 0 auto 0; display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left)); }
#hud > *, .hud__r > * { pointer-events: auto; }
.hud__r { display: flex; gap: 10px; align-items: flex-start; }
.pbtn { position: relative; display: grid; place-items: center; width: 68px; height: 68px; padding: 0; border: 0; border-radius: 22px; background: rgba(14, 21, 48, .38);
  box-shadow: inset 0 0 0 1.5px rgba(243, 231, 204, .28), 0 8px 20px -8px rgba(0, 0, 0, .6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: transform .18s; text-decoration: none; color: var(--parch); }
.pbtn img { width: 86%; height: 86%; object-fit: contain; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .45)); }
.pbtn:active { transform: scale(.9); }
.pbtn--sound { width: 52px; height: 52px; border-radius: 18px; margin-top: 8px; }
.pbtn--sound svg { width: 26px; height: 26px; }
.pbtn--sound[aria-pressed="true"] .off, .pbtn--sound[aria-pressed="false"] .on { display: none; }
.pbtn--journal img { width: 96%; height: 96%; }
.pbtn.bump { animation: bump .5s ease; }
@keyframes bump { 40% { transform: scale(1.22) rotate(-5deg); } 70% { transform: scale(.95); } }
.newdot { position: absolute; top: 4px; right: 4px; width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle, #fff8d8 0 30%, var(--gold-l) 60%, rgba(242, 200, 107, 0) 72%); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.35); } }

.edge { position: fixed; z-index: 35; top: 50%; width: 64px; height: 120px; margin-top: -60px; border: 0; padding: 0; background: none; opacity: .9; }
.edge--l { left: 0; } .edge--r { right: 0; }
.edge i { position: absolute; inset: 0; background: radial-gradient(60% 50% at var(--gx, 0%) 50%, rgba(255, 217, 135, .55), rgba(255, 217, 135, 0) 70%); }
.edge--r i { --gx: 100%; }
.edge::after { content: ""; position: absolute; top: 50%; width: 22px; height: 22px; margin-top: -11px; border: solid #fff4d2; border-width: 0 0 4px 4px; border-radius: 3px; filter: drop-shadow(0 0 6px rgba(255, 210, 120, .9)); animation: nudge 1.4s ease-in-out infinite; }
.edge--l::after { left: 14px; transform: rotate(45deg); } .edge--r::after { right: 14px; transform: rotate(-135deg); }
@keyframes nudge { 50% { translate: var(--nx, -5px) 0; } } .edge--r::after { --nx: 5px; }

/* Big explorer: the picture-word card, top centre so the children stay in view */
#card { position: fixed; z-index: 36; left: 50%; top: calc(max(12px, env(safe-area-inset-top)) + 80px); transform: translateX(-50%); width: min(560px, calc(100vw - 32px));
  display: flex; align-items: center; gap: 16px; padding: 14px 20px 14px 14px; border-radius: 22px; color: var(--ink-b);
  background: linear-gradient(170deg, #fbf3df, var(--parch) 60%, var(--parch-2)); box-shadow: 0 0 0 2px rgba(201, 160, 82, .65), 0 18px 40px -14px rgba(0, 0, 0, .65); }
#card.in { animation: cardIn .35s cubic-bezier(.2, .9, .3, 1.3); }
@keyframes cardIn { from { transform: translateX(-50%) translateY(-14px) scale(.9); opacity: 0; } }
#cardPic { flex: none; width: 104px; height: 104px; object-fit: contain; border-radius: 16px; background: radial-gradient(circle at 50% 45%, #2b3b78, #121b40 75%); padding: 6px; }
.card__w { min-width: 0; }
.card__word { margin: 0; font-family: var(--hand); font-size: clamp(44px, 12vw, 64px); line-height: 1; color: var(--ink-b); letter-spacing: .02em; }
.card__word .l { display: inline-block; opacity: 0; transform: translateY(6px); animation: letter .3s forwards; }
@keyframes letter { to { opacity: 1; transform: none; } }
.card__line { margin: 8px 0 0; font-size: clamp(17px, 4.6vw, 21px); line-height: 1.3; font-weight: 700; color: var(--ink-b2); }
.card__line span { white-space: nowrap; transition: color .15s, background .15s; border-radius: 6px; padding: 0 2px; }
.card__line span.on { color: #3a2410; background: rgba(242, 200, 107, .55); }

#sign { position: fixed; z-index: 36; left: 50%; top: calc(max(12px, env(safe-area-inset-top)) + 2px); transform: translateX(-50%); width: min(250px, 56vw); aspect-ratio: 426 / 360;
  border: 0; padding: 0; background: url(art/sign.webp) center / contain no-repeat; color: #3a2614; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .5)); transform-origin: 50% 0; transition: top .45s cubic-bezier(.3, 1.3, .5, 1); }
#sign.low { top: 33%; }
#sign.in { animation: signIn .6s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes signIn { from { transform: translateX(-50%) rotate(-8deg) translateY(-30px); opacity: 0; } }
#sign.ok b { color: #2f6b2a; }
.sign__in { position: absolute; left: 7%; right: 7%; top: 37%; bottom: 7%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.sign__k { font-family: var(--hand); font-size: clamp(14px, 3.8vw, 17px); color: #6b4a2c; line-height: 1; }
#sign b { font-family: var(--hand); font-weight: 400; font-size: clamp(30px, 8.6vw, 44px); line-height: 1.05; margin-top: 2px; white-space: nowrap; }

/* parchment sheets (place complete, level) */
.sheet { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(6, 10, 30, .45); }
.parch { position: relative; width: min(560px, 100%); padding: 22px 22px 24px; text-align: center; color: var(--ink-b); border-radius: 26px;
  background: radial-gradient(120% 90% at 30% 20%, #fdf6e4, var(--parch) 55%, #e9d7b0); box-shadow: 0 0 0 2px rgba(201, 160, 82, .7), 0 24px 60px -20px rgba(0, 0, 0, .8); animation: cardIn2 .45s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes cardIn2 { from { transform: scale(.88) translateY(20px); opacity: 0; } }
.parch__k { margin: 0; font-family: var(--hand); font-size: 20px; color: var(--ink-b2); }
.parch h2 { margin: 4px 0 6px; font-family: var(--hand); font-weight: 400; font-size: clamp(32px, 8vw, 44px); line-height: 1.05; color: var(--ink-b); }
.done__stone { width: 110px; height: 96px; object-fit: contain; filter: drop-shadow(0 0 18px rgba(150, 190, 255, .8)); animation: bob 3s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(3deg); } }
.done__row, .level__row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 10px; }
.pick, .lvl { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px 14px; border: 0; border-radius: 20px; color: var(--ink-b);
  background: rgba(255, 250, 236, .75); box-shadow: inset 0 0 0 2px rgba(201, 160, 82, .55), 0 8px 18px -10px rgba(60, 40, 10, .6); transition: transform .15s; }
.pick:active, .lvl:active { transform: scale(.94); }
.pick img { width: 72px; height: 72px; object-fit: contain; }
.pick span { font-family: var(--hand); font-size: 20px; line-height: 1.1; }
#doneAgain { background: rgba(255, 236, 190, .95); box-shadow: inset 0 0 0 3px rgba(226, 170, 70, .9), 0 0 24px rgba(255, 210, 120, .6); }
.level__row { grid-template-columns: 1fr 1fr; }
.lvl img { width: 96px; height: 110px; object-fit: contain; }
.lvl b { font-family: var(--hand); font-weight: 400; font-size: 24px; }
.lvl span { font-size: 15px; line-height: 1.3; color: var(--ink-b2); }
.lvl[aria-pressed="true"] { background: rgba(255, 236, 190, .95); box-shadow: inset 0 0 0 3px rgba(226, 170, 70, .9); }
.level__note { margin: 14px 0 0; font-size: 14px; color: var(--ink-b2); }

/* ── Grandpa Bo's map ──────────────────────────────────────────────────── */
#map { position: fixed; inset: 0; z-index: 20; overflow: hidden; background: radial-gradient(120% 90% at 50% 45%, #18224d, var(--night-0) 75%); transition: opacity .6s; }
#map::before { content: ""; position: absolute; inset: -40px; background: url(art/map.webp) center / cover; filter: blur(26px) brightness(.45) saturate(1.1); }
body.playing #map { opacity: 0; pointer-events: none; }
.map__stage { position: absolute; inset: 0; display: grid; place-items: center; }
.map__paper { position: relative; height: 100%; aspect-ratio: 2 / 3; flex: none; transform-origin: var(--ox, 49%) var(--oy, 70%); }
@media (max-aspect-ratio: 2/3) { .map__paper { height: auto; width: max(100%, calc(100dvh * 2 / 3)); } }
.map__img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; animation: breathe 16s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.018) translate(0, -.4%); } }
.map__paper.zoom { transition: transform .95s cubic-bezier(.55, 0, .7, .4), filter .95s; transform: scale(3.4); filter: brightness(1.25); }
.map__paper.unzoom { animation: unzoom .9s cubic-bezier(.2, .7, .2, 1); }
@keyframes unzoom { from { transform: scale(3); filter: brightness(1.3); } }
.map__motes { position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(circle, rgba(255, 220, 140, .95) 0 1.5px, transparent 3px), radial-gradient(circle, rgba(255, 220, 140, .7) 0 1px, transparent 2.5px);
  background-size: 23% 17%, 31% 23%; background-position: 10% 20%, 70% 60%; animation: motes 24s linear infinite; mix-blend-mode: screen; opacity: .7; }
@keyframes motes { to { background-position: 10% -80%, 70% -40%; } }
.spot { position: absolute; left: var(--x); top: var(--y); width: 46%; height: 12.5%; transform: translate(-50%, -50%); border: 0; padding: 0; background: none; border-radius: 40%; }
.spot::before { content: ""; position: absolute; inset: -6% -4%; border-radius: 50%; pointer-events: none; }
.spot--soon::before { background: radial-gradient(closest-side, rgba(14, 22, 52, .5), rgba(14, 22, 52, .3) 70%, rgba(14, 22, 52, 0)); }
.spot--open::before { background: radial-gradient(closest-side, rgba(255, 214, 120, .75), rgba(255, 214, 120, .25) 60%, rgba(255, 214, 120, 0)); mix-blend-mode: screen; animation: glowP 2.6s ease-in-out infinite; }
@keyframes glowP { 50% { opacity: .45; transform: scale(1.06); } }
.spot__n { position: absolute; left: 50%; top: 96%; transform: translateX(-50%); white-space: nowrap; font-family: var(--hand); font-weight: 400; font-size: clamp(15px, 2.6dvh, 26px); color: var(--ink-b); text-shadow: 0 0 6px rgba(243, 231, 204, .9), 0 0 2px rgba(243, 231, 204, 1); }
.spot--open .spot__n { font-size: clamp(19px, 3.3dvh, 32px); color: #2a1a0c; }
.spot__s { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.8); white-space: nowrap; padding: 6px 14px; border-radius: 999px; font-family: var(--hand); font-size: clamp(15px, 2.3dvh, 22px); color: var(--parch); background: rgba(14, 21, 48, .78); opacity: 0; transition: opacity .3s, transform .3s; pointer-events: none; }
.spot.wig .spot__s { opacity: 1; transform: translate(-50%, -50%) scale(1); transition-delay: 0s; }
.spot.told .spot__s { opacity: 0; transition-delay: 1.6s; }
.spot__stone { position: absolute; left: 1%; top: 2%; width: 22%; filter: drop-shadow(0 0 10px rgba(150, 200, 255, .95)); animation: bob 3s ease-in-out infinite; }
.spot.wig { animation: wig .5s ease; }
@keyframes wig { 25% { transform: translate(-50%, -50%) rotate(-3deg); } 60% { transform: translate(-50%, -50%) rotate(2.5deg); } }
.map__glim { position: absolute; left: 66%; top: 60.5%; width: 13%; pointer-events: none; filter: drop-shadow(0 0 14px rgba(255, 210, 110, .95)); animation: glim 3.4s ease-in-out infinite; }
@keyframes glim { 50% { transform: translate(-12%, -16%) rotate(-6deg); } }
.map__tap { position: absolute; left: 49%; top: 70.5%; width: 12%; aspect-ratio: 1; margin: -6% 0 0 -6%; border-radius: 50%; border: 3px solid rgba(255, 244, 210, .95); box-shadow: 0 0 18px rgba(255, 210, 120, .9); pointer-events: none; animation: tapR 1.8s ease-out infinite; }
@keyframes tapR { from { transform: scale(.5); opacity: 1; } to { transform: scale(1.7); opacity: 0; } }
body.map-known .map__tap { display: none; }
.map__bar { position: absolute; z-index: 3; left: 0; right: 0; top: max(12px, env(safe-area-inset-top)); display: flex; justify-content: space-between; align-items: center; padding: 0 max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left)); pointer-events: none; }
.map__bar > * { pointer-events: auto; }
.pbtn--back svg { width: 30px; height: 30px; }
.map__r { display: flex; gap: 10px; align-items: flex-start; }
.pbtn--music { width: 52px; height: 52px; border-radius: 18px; margin-top: 8px; font-size: 0 !important; overflow: hidden; }
.pbtn--music::before { content: "\266A"; font-size: 24px; font-family: system-ui, sans-serif; }
.pbtn--music[aria-pressed="true"] { color: var(--glow); box-shadow: inset 0 0 0 2px rgba(255, 217, 135, .7), 0 0 16px rgba(255, 210, 120, .5); }
.levelpill { position: absolute; z-index: 3; left: max(14px, env(safe-area-inset-left)); bottom: calc(max(14px, env(safe-area-inset-bottom)) + 30px); display: flex; flex-direction: column; align-items: center; padding: 6px 14px 7px; border: 0; border-radius: 16px; background: rgba(14, 21, 48, .5); box-shadow: inset 0 0 0 1.5px rgba(243, 231, 204, .3); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); line-height: 1.1; }
.levelpill span { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; opacity: .75; }
.levelpill b { font-family: var(--hand); font-weight: 400; font-size: 18px; color: var(--glow); }
.bookbtn { position: absolute; z-index: 3; right: max(14px, env(safe-area-inset-right)); bottom: calc(max(14px, env(safe-area-inset-bottom)) + 26px); display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; color: var(--parch); font-family: var(--hand); font-size: 16px; }
.bookbtn img { width: 62px; height: 84px; object-fit: cover; border-radius: 6px; box-shadow: 0 0 0 2px rgba(242, 200, 107, .7), 0 8px 18px rgba(0, 0, 0, .55); transform: rotate(4deg); }
.bookbtn span { text-shadow: 0 1px 6px rgba(0, 0, 0, .8); }
.map__foot { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; margin: 0; padding: 18px 16px max(5px, env(safe-area-inset-bottom)); text-align: center; font-size: 10.5px; line-height: 1.3; color: rgba(243, 231, 204, .75); background: linear-gradient(transparent, rgba(6, 10, 30, .75)); pointer-events: none; }
@media (min-aspect-ratio: 1/1) { .bookbtn { right: max(24px, env(safe-area-inset-right)); bottom: 50%; transform: translateY(50%); } .bookbtn img { width: 92px; height: 124px; } .bookbtn { font-size: 20px; } }

/* ── the Explorer's Journal ────────────────────────────────────────────── */
#journal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom)); background: rgba(5, 8, 24, .72); }
#journal.in .jbook { animation: jopen .5s cubic-bezier(.2, .9, .3, 1.1); }
@keyframes jopen { from { transform: perspective(1200px) rotateY(-28deg) scale(.6); opacity: 0; } }
.jbook { position: relative; width: min(100%, calc((100dvh - 24px) * 1.5)); aspect-ratio: 3 / 2; background: url(art/journal-open.webp) center / 100% 100%; display: grid; grid-template-columns: 1fr 1fr; padding: 8.5% 10.5% 10.5% 12.5%; column-gap: 11%; color: var(--ink-b); filter: drop-shadow(0 20px 40px rgba(0, 0, 0, .7)); }
.jpage { min-height: 0; display: flex; flex-direction: column; align-items: center; text-align: center; overflow: hidden; }
.jkick { margin: 0; font-family: var(--hand); font-size: clamp(12px, 1.8vw, 18px); color: var(--ink-b2); }
.jpage h2 { margin: .1em 0 .2em; font-family: var(--hand); font-weight: 400; font-size: clamp(22px, 3.6vw, 40px); line-height: 1; }
.jplace { width: 92%; height: 19%; flex: none; object-fit: cover; border-radius: 10px; box-shadow: 0 4px 12px -4px rgba(60, 40, 10, .6); }
.jlabel { margin: .7em 0 .3em; font-family: var(--hand); font-size: clamp(13px, 1.8vw, 19px); color: var(--ink-b2); }
.jlabel--r { margin-top: 0; }
.jstones { display: flex; gap: 4%; justify-content: center; width: 100%; }
.jstone { width: 13%; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle, rgba(120, 100, 70, .16), rgba(120, 100, 70, 0) 70%); border: 1.5px dashed rgba(107, 79, 53, .35); }
.jstone img { width: 115%; object-fit: contain; filter: drop-shadow(0 0 8px rgba(140, 190, 255, .9)); }
.jask { margin-top: auto; padding: .5em .7em; border-radius: 12px; background: rgba(255, 248, 228, .6); font-size: clamp(11px, 1.45vw, 15px); line-height: 1.3; text-align: left; }
.jask b { font-family: var(--hand); font-weight: 400; font-size: 1.2em; color: #8a4f22; }
.jbook-link { display: flex; align-items: center; gap: 8px; margin-top: .5em; text-decoration: none; color: var(--ink-b); font-size: clamp(11px, 1.4vw, 15px); text-align: left; line-height: 1.2; }
.jbook-link img { width: 30px; height: 40px; object-fit: cover; border-radius: 3px; box-shadow: 0 2px 6px rgba(0, 0, 0, .4); }
.jbook-link b { display: block; font-family: var(--hand); font-weight: 400; font-size: 1.3em; }
.jgrid { flex: 1; min-height: 0; width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; gap: 5px 4%; align-content: start; }
.jcard { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 0; padding: 4px 2px 2px; border: 0; border-radius: 12px; background: rgba(255, 250, 236, .55); box-shadow: inset 0 0 0 1.5px rgba(201, 160, 82, .45); color: var(--ink-b); }
.jcard img { width: 100%; height: 70%; min-height: 0; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35)); }
.jcard span { font-family: var(--hand); font-size: clamp(12px, 1.9vw, 21px); line-height: 1.05; }
.jcard--off { background: rgba(120, 100, 70, .07); box-shadow: inset 0 0 0 1.5px rgba(107, 79, 53, .22); }
.jcard--off img { filter: brightness(0) opacity(.26); }
.jcard--off.jcard--photo img { filter: grayscale(1) blur(5px) opacity(.3); border-radius: 10px; }
.jcard--off span { opacity: 0; }
.jcard--new { animation: newcard 1.2s ease 2; }
@keyframes newcard { 30% { box-shadow: inset 0 0 0 3px rgba(242, 200, 107, 1), 0 0 18px rgba(255, 210, 120, .8); transform: scale(1.06); } }
.jcard.say { animation: wig .45s ease; }
.jgrid { grid-template-columns: repeat(4, 1fr); }
.jcard:nth-child(9) { grid-column: 2; }
#journal .jclose { color: var(--parch); }
.jclose { position: absolute; top: 1%; right: 1.5%; width: 52px; height: 52px; border: 0; border-radius: 50%; display: grid; place-items: center; background: rgba(14, 21, 48, .75); color: var(--parch); box-shadow: 0 0 0 2px rgba(242, 200, 107, .6); }
.jclose svg { width: 24px; height: 24px; }
/* phones held upright: one tall page (the spread would be tiny) */
@media (max-aspect-ratio: 4/5) {
  .jbook { width: 100%; height: 100%; aspect-ratio: auto; display: flex; flex-direction: column; gap: 10px; padding: 64px 22px 22px; border-radius: 18px; overflow-y: auto;
    background: url(art/journal-page.webp) center / 100% 100% no-repeat, var(--parch); box-shadow: 0 0 0 6px #1f4b4a, 0 0 0 8px rgba(201, 160, 82, .8), 0 20px 40px rgba(0, 0, 0, .6); filter: none; }
  .jpage { overflow: visible; flex: none; }
  .jplace { max-height: 120px; }
  .jkick { font-size: 16px; } .jpage h2 { font-size: 36px; } .jlabel { font-size: 17px; } .jask { font-size: 14px; margin-top: 10px; } .jbook-link { font-size: 14px; }
  .jgrid { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 116px; gap: 10px; }
  .jcard:nth-child(9) { grid-column: auto; } .jcard:nth-child(10) { grid-column: 2; }
  .jcard span { font-size: 19px; }
  .jstones { gap: 8px; } .jstone { width: 46px; }
  .jclose { top: 10px; right: 10px; }
}

#fade { position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: 0; background: radial-gradient(circle at 50% 55%, #1f2c63, #0b1128 70%); transition: opacity .55s; }
#fade.on { opacity: 1; }
#loading { position: fixed; inset: 0; z-index: 91; display: grid; place-items: center; pointer-events: none; }
#loading img { width: 120px; filter: drop-shadow(0 0 24px rgba(255, 210, 110, .95)); animation: loadfly 1.6s ease-in-out infinite; }
@keyframes loadfly { 0% { transform: translate(-40px, 10px) rotate(-8deg); } 50% { transform: translate(40px, -12px) rotate(6deg); } 100% { transform: translate(-40px, 10px) rotate(-8deg); } }
.nojs { position: fixed; inset: 40% 16px auto; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .map__img, .map__motes, .map__glim, .spot--open::before, .done__stone, .spot__stone, .newdot, .edge::after, #loading img { animation: none !important; }
  .map__paper.zoom { transition: filter .4s; transform: none; }
  .map__tap { animation-duration: 3.6s; }
}

/* ── GR3 (2026-10-21) ──────────────────────────────────────────────────── */
/* the map: Glimmer waits by the next place to explore */
.map__paper[data-next="attic"] .map__glim { left: 67%; top: 78%; }
.map__paper[data-next="attic"] .map__tap { left: 49.5%; top: 86.5%; }
/* Little explorer: the word writes itself in under the thing as Lily says it */
.tword { position: absolute; margin: 0; padding: 2px 14px 6px; white-space: nowrap; font-family: var(--hand); font-size: clamp(34px, 9.5vw, 50px); line-height: 1; color: #fff8e4; letter-spacing: .02em;
  text-shadow: 0 0 10px rgba(255, 205, 110, .85), 0 0 3px rgba(60, 35, 10, .9), 0 2px 6px rgba(10, 14, 40, .9); transition: opacity .6s, transform .6s; }
.tword .l { display: inline-block; opacity: 0; transform: translateY(8px) scale(.8); animation: letter .32s forwards; }
.tword.out { opacity: 0; transform: translateY(-8px); }
/* Little explorer (Attic): Glimmer's picture clue */
#clue { position: fixed; z-index: 36; left: 50%; top: calc(max(12px, env(safe-area-inset-top)) + 4px); transform: translateX(-50%); width: 112px; height: 112px; padding: 10px; border: 0; border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, #fdf6e4, var(--parch) 62%, #e2cd9f); box-shadow: 0 0 0 3px rgba(226, 170, 70, .9), 0 0 26px rgba(255, 214, 130, .75), 0 14px 26px -10px rgba(0, 0, 0, .7); }
#clue img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .35)); }
.clue__q { position: absolute; right: -6px; bottom: -4px; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: #2c3a78; color: var(--glow); font-family: var(--hand); font-size: 26px; box-shadow: 0 0 0 2px rgba(255, 217, 135, .8); }
#clue.in { animation: clueIn .55s cubic-bezier(.3, 1.5, .5, 1); }
#clue.say { animation: wig .45s ease; }
@keyframes clueIn { from { transform: translateX(-50%) scale(.3); opacity: 0; } }
/* Big explorer (Attic): the list of things to find */
#list { position: fixed; z-index: 36; left: 50%; top: calc(max(12px, env(safe-area-inset-top)) + 2px); transform: translateX(-50%); max-width: min(560px, calc(100vw - 180px)); padding: 6px 14px 8px; border-radius: 16px; color: var(--ink-b);
  background: linear-gradient(170deg, #fbf3df, var(--parch) 60%, var(--parch-2)); box-shadow: 0 0 0 2px rgba(201, 160, 82, .65), 0 14px 30px -12px rgba(0, 0, 0, .7); text-align: center; }
#list.in { animation: cardIn .4s cubic-bezier(.2, .9, .3, 1.3); }
.list__k { margin: 0; font-family: var(--hand); font-size: 15px; color: var(--ink-b2); line-height: 1; }
#listItems { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 0 12px; }
#listItems button { position: relative; border: 0; padding: 2px 4px; background: none; font-family: var(--hand); font-size: clamp(20px, 5.4vw, 28px); line-height: 1.15; color: var(--ink-b); }
#listItems button.got { color: #2f6b2a; }
#listItems button.got::after { content: ""; position: absolute; left: 0; right: 0; top: 54%; height: 3px; border-radius: 2px; background: rgba(47, 107, 42, .8); transform-origin: left; animation: strike .45s ease-out; }
@keyframes strike { from { transform: scaleX(0); } }
/* grown-ups: turn the phone sideways (once, small, dismissible, never in the way) */
#turn { position: fixed; z-index: 45; left: 50%; bottom: calc(max(14px, env(safe-area-inset-bottom)) + 6px); transform: translateX(-50%); display: flex; align-items: center; gap: 10px; width: max-content; max-width: calc(100vw - 32px);
  padding: 8px 8px 8px 14px; border-radius: 16px; background: rgba(14, 21, 48, .78); box-shadow: inset 0 0 0 1.5px rgba(243, 231, 204, .3), 0 10px 24px -10px rgba(0, 0, 0, .7); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  color: var(--parch); font-size: 14px; line-height: 1.3; transition: opacity .4s, transform .4s; }
#turn > svg { width: 30px; height: 30px; flex: none; color: var(--glow); animation: tilt 2.4s ease-in-out infinite; }
#turn b { color: var(--glow); font-weight: 700; }
#turn.in { animation: turnIn .5s cubic-bezier(.2, .9, .3, 1.2); }
#turn.out { opacity: 0; transform: translateX(-50%) translateY(12px); }
@keyframes turnIn { from { opacity: 0; transform: translateX(-50%) translateY(16px); } }
@keyframes tilt { 0%, 30% { transform: rotate(0); } 55%, 80% { transform: rotate(-90deg); } }
#turnX { flex: none; width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 12px; background: rgba(243, 231, 204, .12); }
#turnX svg { width: 20px; height: 20px; }
/* the journal: one page per place */
.jtabs { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin: 0 0 .35em; }
.jtab { border: 0; padding: 4px 12px; border-radius: 999px; font-family: var(--hand) !important; font-size: clamp(13px, 1.7vw, 18px) !important; color: var(--ink-b2) !important; background: rgba(120, 100, 70, .1); box-shadow: inset 0 0 0 1.5px rgba(107, 79, 53, .3); }
.jtab[aria-pressed="true"] { color: var(--ink-b) !important; background: rgba(255, 236, 190, .95); box-shadow: inset 0 0 0 2px rgba(226, 170, 70, .9); }
@media (max-aspect-ratio: 4/5) { .jtabs { margin-bottom: 8px; } .jtab { font-size: 17px !important; padding: 8px 14px; } }
@media (prefers-reduced-motion: reduce) { .tword .l, #clue.in, #turn > svg { animation: none !important; opacity: 1; transform: none; } }
@media (max-width: 700px) { #list { top: calc(max(12px, env(safe-area-inset-top)) + 84px); max-width: calc(100vw - 32px); } #clue { width: 100px; height: 100px; } }
/* the Attic sits at the bottom of the map: its name goes on the cottage's ground, clear of the Grown-ups and book buttons */
.spot[data-place="attic"] .spot__n { top: 17%; left: 8%; transform: translateX(-30%); }

/* ── GR4 (2026-10-30): the last four places, the Big-explorer riddle sign, and the finished map ───────────── */
/* the map: Glimmer and the tap ring wait by the next place to explore */
.map__paper[data-next="doors"] .map__glim { left: 69%; top: 46%; } .map__paper[data-next="doors"] .map__tap { left: 52%; top: 55.5%; }
.map__paper[data-next="bridge"] .map__glim { left: 63%; top: 31%; } .map__paper[data-next="bridge"] .map__tap { left: 46%; top: 40.5%; }
.map__paper[data-next="hill"] .map__glim { left: 76%; top: 19%; } .map__paper[data-next="hill"] .map__tap { left: 59%; top: 28.5%; }
.map__paper[data-next="cave"] .map__glim { left: 65%; top: 5.5%; } .map__paper[data-next="cave"] .map__tap { left: 49.5%; top: 15%; }
.map__paper[data-next="done"] .map__tap { display: none; } .map__paper[data-next="done"] .map__glim { left: 64%; top: 52%; }
/* places you have already finished glow more softly; the one to explore next glows most */
.spot--open.has::before { opacity: .62; }
.map__paper.complete .spot--open::before { opacity: 1; background: radial-gradient(closest-side, rgba(255, 226, 150, .85), rgba(255, 214, 120, .3) 62%, rgba(255, 214, 120, 0)); animation-duration: 4.2s; }
.map__paper.complete .map__img { filter: brightness(1.12) saturate(1.08); }
.spot__n { pointer-events: none; }
/* Big explorer: the riddle or request on a parchment banner (Lily says it too; tap to hear it again) */
#ask { position: fixed; z-index: 36; left: 50%; top: calc(max(12px, env(safe-area-inset-top)) + 2px); transform: translateX(-50%); display: flex; align-items: center; gap: 10px; max-width: min(600px, calc(100vw - 180px)); padding: 8px 16px 10px 12px; border: 0; border-radius: 18px; color: var(--ink-b);
  background: linear-gradient(170deg, #fbf3df, var(--parch) 60%, var(--parch-2)); box-shadow: 0 0 0 2px rgba(201, 160, 82, .75), 0 14px 30px -12px rgba(0, 0, 0, .7); text-align: left; }
#ask svg { width: 30px; height: 30px; flex: none; color: #b3741f; }
#ask span { font-family: var(--hand); font-size: clamp(22px, 5.6vw, 30px); line-height: 1.12; }
#ask.in { animation: cardIn .4s cubic-bezier(.2, .9, .3, 1.3); }
@media (max-width: 700px) { #ask { top: calc(max(12px, env(safe-area-inset-top)) + 84px); max-width: calc(100vw - 32px); } }
/* the finished map */
.parch--fin { padding-top: 0; overflow: hidden; }
.fin__pic { display: block; width: calc(100% + 44px); margin: 0 -22px 12px; height: clamp(110px, 26dvh, 200px); object-fit: cover; object-position: 50% 62%; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.fin__stones { display: flex; gap: 6px; justify-content: center; margin: 2px 0 4px; }
.fin__stones img { width: 15%; max-width: 58px; object-fit: contain; filter: drop-shadow(0 0 10px rgba(140, 190, 255, .9)); animation: bob 3.4s ease-in-out infinite; }
.fin__stones img:nth-child(2n) { animation-delay: -.8s; } .fin__stones img:nth-child(3n) { animation-delay: -1.6s; }
.fin__say { margin: 4px 0 6px; font-size: 16px; color: var(--ink-b2); }
a.pick { text-decoration: none; }
#finAgain { background: rgba(255, 236, 190, .95); box-shadow: inset 0 0 0 3px rgba(226, 170, 70, .9), 0 0 24px rgba(255, 210, 120, .6); }
@media (prefers-reduced-motion: reduce) { .fin__stones img { animation: none !important; } }
.done__stone { display: block; margin: 2px auto 6px; } /* GR4: the moonstone sits in the middle of the card (it sat at the left before) */
/* GR4 fixes after the first review recording: the finished-map picture fills its card; the moonstone marks on the map sit at each place's top right, clear of the names; six journal tabs fit in two rows on a phone */
.fin__pic { max-width: none; }
.spot__stone { left: auto; right: -2%; top: 6%; width: 19%; }
@media (max-aspect-ratio: 4/5) { .jtabs { gap: 5px; } .jtab { flex: 1 1 29%; padding: 7px 4px !important; font-size: 14px !important; line-height: 1.1; } }
.spot[data-place="hill"] .spot__n { transform: translateX(-66%); } .spot[data-place="hill"] .spot__stone { top: -4%; right: 1%; }
@media (max-height: 560px) { .parch--fin { padding: 10px 18px 12px; width: min(620px, 100%); } .fin__pic { display: none; } .parch--fin h2 { font-size: 30px; margin: 0 0 2px; } .fin__stones img { max-width: 36px; } .fin__say { margin: 0 0 4px; font-size: 14px; } .parch--fin .pick { padding: 6px 6px 8px; flex-direction: row; justify-content: center; gap: 8px; } .parch--fin .pick img { width: 44px; height: 44px; } .parch--fin .pick span { font-size: 18px; } }

/* ── GR6 (2026-11-08): back buttons with words, hints, Next place ─────────────────────────────────────────── */
.pbtn--pill { width: auto; height: 52px; margin-top: 8px; padding: 0 18px 0 10px; border-radius: 26px; display: inline-flex; align-items: center; gap: 2px; color: var(--parch); text-decoration: none; font-family: var(--hand); font-size: 22px; line-height: 1; }
.pbtn--pill svg { width: 26px; height: 26px; flex: none; }
.pbtn--pill span { white-space: nowrap; }
.pbtn--back.pbtn--pill svg { width: 26px; height: 26px; }
.map__bar .pbtn--pill { margin-top: 8px; }
.pbtn--hint { width: 52px; height: 52px; margin-top: 8px; border-radius: 50%; color: var(--glow); font-family: var(--hand); font-size: 32px; line-height: 1; box-shadow: inset 0 0 0 2px rgba(255, 217, 135, .65); }
.pbtn--hint span { transform: translateY(-1px); }
.pbtn--hint.on { background: rgba(255, 217, 135, .85); color: #3a2410; }
#journal .jclose, .jclose { width: auto; height: 52px; padding: 0 18px 0 8px; border-radius: 26px; display: inline-flex; align-items: center; gap: 2px; font-family: var(--hand); font-size: 22px; }
.jclose svg { width: 26px; height: 26px; }
#hintRing { position: fixed; z-index: 38; left: 0; top: 0; width: 80px; height: 80px; margin: -40px 0 0 -40px; border-radius: 50%; pointer-events: none; border: 4px solid #ffe8aa;
  box-shadow: 0 0 0 3px rgba(60, 40, 10, .35), 0 0 22px 6px rgba(255, 214, 120, .85), inset 0 0 18px rgba(255, 214, 120, .6); animation: hintPulse 1.3s ease-in-out infinite; }
#hintRing.rect { border-radius: 22px; }
@keyframes hintPulse { 0%, 100% { transform: scale(1); opacity: .95; } 50% { transform: scale(1.14); opacity: .55; } }
#hintBar { position: fixed; z-index: 44; left: 50%; bottom: calc(max(14px, env(safe-area-inset-bottom)) + 8px); transform: translateX(-50%); max-width: min(560px, calc(100vw - 28px)); padding: 11px 22px 12px; border-radius: 26px; color: var(--ink-b); text-align: center;
  background: radial-gradient(120% 120% at 30% 20%, #fdf6e4, var(--parch) 60%, #e9d7b0); box-shadow: 0 0 0 2px rgba(201, 160, 82, .8), 0 12px 30px -10px rgba(0, 0, 0, .8); font-family: var(--hand); font-size: clamp(21px, 5.2vw, 27px); line-height: 1.15; animation: turnIn .4s cubic-bezier(.2, .9, .3, 1.2); pointer-events: none; }
body.has-dock #hintBar { bottom: calc(max(14px, env(safe-area-inset-bottom)) + 86px); }
#hintBar.out { opacity: 0; transition: opacity .4s; }
#dock { position: fixed; z-index: 43; left: 0; right: 0; bottom: calc(max(14px, env(safe-area-inset-bottom)) + 6px); display: flex; justify-content: center; align-items: center; gap: 12px; padding: 0 12px; pointer-events: none; flex-wrap: wrap; }
#dock > * { pointer-events: auto; }
.dock__map { display: inline-flex; align-items: center; gap: 2px; height: 56px; padding: 0 20px 0 10px; border: 0; border-radius: 28px; color: var(--parch); background: rgba(14, 21, 48, .72); box-shadow: inset 0 0 0 2px rgba(242, 200, 107, .55); font-family: var(--hand); font-size: 22px; }
.dock__map svg { width: 26px; height: 26px; }
.dock__next, .nextbig { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 64px; padding: 0 26px 0 30px; border: 0; border-radius: 32px; color: #3a2410; font-family: var(--hand); font-size: 30px; line-height: 1;
  background: linear-gradient(180deg, #ffe9a8, #f2c86b); box-shadow: inset 0 0 0 3px rgba(226, 170, 70, .95), 0 0 26px rgba(255, 210, 120, .7), 0 10px 22px -8px rgba(0, 0, 0, .7); }
.dock__next svg { width: 28px; height: 28px; }
#dock.fresh .dock__next { animation: dockPulse 1.9s ease-in-out infinite; }
@keyframes dockPulse { 50% { transform: scale(1.06); box-shadow: inset 0 0 0 3px rgba(226, 170, 70, .95), 0 0 40px rgba(255, 220, 130, 1), 0 10px 22px -8px rgba(0, 0, 0, .7); } }
.dock__next:active, .nextbig:active, .dock__map:active { transform: scale(.95); }
.nextbig--wide { width: 100%; margin-top: 14px; }
.nextbig--quiet { background: rgba(255, 250, 236, .85); box-shadow: inset 0 0 0 2px rgba(201, 160, 82, .7); font-size: 26px; }
.parch--leave { padding: 24px 22px; } .parch--leave p { margin: 6px 0 16px; font-size: 18px; line-height: 1.35; } .leave__row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; } .leave__row .nextbig { flex: 1 1 140px; padding: 0 16px; }
.levelback { position: absolute; top: 10px; left: 10px; display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px 0 6px; border-radius: 22px; color: var(--ink-b2); text-decoration: none; font-family: var(--hand); font-size: 19px; background: rgba(255, 250, 236, .6); box-shadow: inset 0 0 0 2px rgba(201, 160, 82, .45); }
.levelback svg { width: 24px; height: 24px; }
.parch--level { padding-top: 62px; }
.fin__row { grid-template-columns: repeat(2, 1fr); } @media (min-width: 640px) { .fin__row { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 420px) { .pbtn--pill { font-size: 19px; padding: 0 14px 0 8px; } .dock__next { font-size: 26px; padding: 0 20px 0 24px; } .dock__map { font-size: 19px; padding: 0 14px 0 6px; } }
@media (prefers-reduced-motion: reduce) { #hintRing { animation: none; transform: none; opacity: 1; border-width: 5px; } #hintBar { animation: none; } #dock.fresh .dock__next { animation: none; } }
/* the base rule `body.game button { font: inherit; color: inherit }` is stronger than a lone class, so these say it again */
body.game button.dock__next, body.game button.nextbig { color: #3a2410; font-family: var(--hand); font-size: 30px; line-height: 1; }
body.game button.nextbig--quiet { color: var(--ink-b); font-size: 26px; }
body.game button.dock__map { color: var(--parch); font-family: var(--hand); font-size: 22px; line-height: 1; }
body.game button.pbtn--hint { color: var(--glow); font-family: var(--body); font-weight: 800; font-size: 30px; line-height: 1; }
body.game button.pbtn--hint.on { color: #3a2410; }
body.game button.pbtn--pill, body.game button.jclose { font-family: var(--hand); font-size: 22px; line-height: 1; }
@media (max-width: 420px) { body.game button.pbtn--pill { font-size: 19px; } body.game button.dock__next { font-size: 26px; } body.game button.dock__map { font-size: 19px; } }
#hintBar { width: max-content; }
#hintBar.over, #hintRing.over { z-index: 70; }
#hintBar.over { bottom: calc(max(14px, env(safe-area-inset-bottom)) + 8px); }
@media (max-width: 440px) { #dock { gap: 8px; padding: 0 8px; } body.game button.dock__map { font-size: 17px; height: 52px; padding: 0 12px 0 4px; } body.game button.dock__next { font-size: 24px; min-height: 60px; padding: 0 14px 0 18px; } .dock__map svg { width: 22px; height: 22px; } .dock__next svg { width: 24px; height: 24px; } }

/* W5 2026-11-17: the finish card ends on ONE big button to the next book; small things under it */
.fin__next { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 14px auto 6px; max-width: 360px; min-height: 72px; padding: 10px 22px 10px 12px; border-radius: 999px; text-decoration: none; color: #fff; background: #B8432C; box-shadow: 0 12px 24px -12px rgba(110, 30, 20, .8); font-family: var(--hand); font-size: 24px; line-height: 1.05; }
.fin__next img { width: 44px; height: 62px; object-fit: cover; border-radius: 4px 8px 8px 4px; box-shadow: 0 4px 10px -4px rgba(0, 0, 0, .5); }
.fin__next small { display: block; font-family: var(--body, sans-serif); font-weight: 700; font-size: 15px; opacity: .95; margin-top: 3px; }
.fin__next:active { transform: scale(.97); }
.fin__row { margin-top: 8px; }
.fin__row .pick img { width: 54px; height: 54px; }
.parch--fin [data-qr-makers] { margin: 12px auto 0; }
.fin__foot { padding: 10px 0 0; color: inherit; font-size: 12px; opacity: .85; }
