/* Self-hosted fonts (latin woff2) — replaces the Google Fonts CDN so the app is truly offline and
   sends no device data to a third party (COPPA / Apple-Kids requirement). OFL-licensed. */
@font-face{font-family:'Fredoka One';font-style:normal;font-weight:400;font-display:swap;src:url(../fonts/fredoka.woff2) format('woff2')}
@font-face{font-family:'Caveat';font-style:normal;font-weight:600 700;font-display:swap;src:url(../fonts/caveat.woff2) format('woff2')}
@font-face{font-family:'Nunito';font-style:normal;font-weight:400 900;font-display:swap;src:url(../fonts/nunito.woff2) format('woff2')}
:root{--bg:#F4EAD2;--card:#fff;--pri:#5B21B6;--pl:#7C3AED;--txt:#1C1B1F;--sub:#6B5A3A;--bdr:#E7D8B6;--sh:rgba(120,90,40,.12);
  /* Wood-gold system (single source of truth for the gold circular buttons / journal chrome) */
  --gold:#F4CE66;--gold-deep:#E0A92E;--gold-edge:#B07D12;--wood-sh:rgba(80,55,15,.3);
  /* Consolidated surfaces, card shadow, and corner scale */
  --cream-surface:#F1E7CE;--shadow-card:0 6px 22px var(--sh);--shadow-card-sm:0 2px 9px var(--sh);--radius-lg:20px;--radius-sm:14px;--radius-xl:28px;
  --ink-dark:#5B4327;--orange:#F97316;
  /* Spacing scale (C3): every padding/margin/gap should resolve to one of these. */
  --sp-1:4px;--sp-2:8px;--sp-3:12px;--sp-4:16px;--sp-5:24px;--sp-6:32px;
  /* Consolidated warm scrim (D2) + the one canonical gold gradient (D4). */
  --cream-mist:rgba(255,250,238,.9);--gold-grad:linear-gradient(160deg,var(--gold),var(--gold-deep));
  /* Type scale (D5): 8 roles, snap every font-size to one of these. */
  --fs-display:28px;--fs-h2:23px;--fs-h3:18px;--fs-lg:16px;--fs-body:14px;--fs-sm:13px;--fs-cap:12px;--fs-micro:11px;}
*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent}
.icn{width:1em;height:1em;display:inline-block;vertical-align:-0.125em;flex:none;stroke:currentColor}
body{font-family:'Nunito',sans-serif;background:var(--bg);min-height:100vh;color:var(--txt);overflow-x:hidden;}
.screen{display:none;position:relative;min-height:100vh;padding:max(22px,calc(env(safe-area-inset-top,0px) + 8px)) 18px max(28px,calc(env(safe-area-inset-bottom,0px) + 14px));max-width:420px;width:100%;margin:0 auto;flex-direction:column;justify-content:flex-start;overflow-x:hidden;box-sizing:border-box}
.screen.active{display:flex;animation:fu .3s ease both}
@keyframes fu{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}
/* Per-screen entrance variety so navigation doesn't feel like one repeated fade.
   Picker screens rise; the briefing and victory POP (reveal/reward); the hunt slides in
   like stepping into the next room; the journal eases open. */
@keyframes riseScale{from{opacity:0;transform:translateY(16px) scale(.97)}to{opacity:1;transform:translateY(0) scale(1)}}
@keyframes popIn{0%{opacity:0;transform:scale(.9)}60%{opacity:1;transform:scale(1.02)}100%{opacity:1;transform:scale(1)}}
@keyframes slideRoom{from{opacity:0;transform:translateX(26px)}to{opacity:1;transform:translateX(0)}}
@keyframes bookOpen{from{opacity:0;transform:scale(.96) rotate(-1deg)}to{opacity:1;transform:scale(1) rotate(0)}}
#s-theme.active{animation:riseScale .34s cubic-bezier(.2,.8,.2,1) both}
#s-intro.active{animation:popIn .4s cubic-bezier(.2,.85,.25,1) both}
#s-hunt.active{animation:slideRoom .32s ease both}
#s-victory.active{animation:popIn .46s cubic-bezier(.2,.9,.25,1) both}
#s-book.active,#s-bookpage.active{animation:bookOpen .36s ease both}
@media (prefers-reduced-motion:reduce){.screen.active,#s-theme.active,#s-intro.active,#s-hunt.active,#s-victory.active,#s-book.active,#s-bookpage.active{animation-duration:.01ms}}
.btn{display:block;width:100%;padding:18px 22px;border:none;border-radius:var(--radius-lg);font-family:'Nunito',sans-serif;font-size:18px;font-weight:800;cursor:pointer;transition:transform .15s,box-shadow .15s;text-align:center;box-sizing:border-box}
.btn:active{transform:scale(.96)}
@media(hover:hover){.btn:hover{transform:translateY(-1px)}}
.btn-p{background:linear-gradient(135deg,var(--pri),var(--pl));color:#fff;box-shadow:0 6px 24px rgba(91,33,182,.28)}
.btn-p:hover{box-shadow:0 8px 28px rgba(91,33,182,.38);transform:translateY(-1px)}

.sh{margin-bottom:16px}.sh h2{font-family:'Fredoka One',cursive;font-size:28px;color:#3A2810;text-shadow:0 0 5px rgba(255,250,238,.92),0 1px 1px rgba(255,250,238,.95),0 2px 6px rgba(90,60,25,.28)}.sh p{font-size:14px;color:var(--ink-dark);font-weight:700;margin-top:3px;line-height:1.45;text-shadow:0 0 4px rgba(255,250,238,.95),0 1px 1px rgba(255,250,238,.95)}
/* Keep the header title clear of the fixed top-right home FAB on screens that show it. */
#s-age .sh h2,#s-theme .sh h2{padding-right:48px}
/* welcome */
.w-body{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;text-align:center}
/* Welcome: single unified hero scene (house + Questy) with the title overlaid on the sky */
#s-welcome{padding:0;max-width:100%}
.welcome-scene{position:relative;width:100%;height:100vh;height:100dvh;border-radius:0;overflow:hidden}
.welcome-hero-img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center center;display:block}
.welcome-cta{position:absolute;left:16px;right:16px;bottom:max(18px,env(safe-area-inset-bottom,18px));width:auto;z-index:2}
.welcome-titles{position:absolute;top:max(2.5%,calc(env(safe-area-inset-top,0px) + 10px));left:0;right:0;text-align:center;padding:0 14px;z-index:2}
/* Soft cream halo behind the gradient title so it stays legible on any hero art (no hard box). */
.welcome-titles::before{content:"";position:absolute;left:50%;top:48%;transform:translate(-50%,-50%);width:min(82%,340px);height:150%;background:radial-gradient(ellipse at center,rgba(255,250,240,.92) 0%,rgba(255,250,240,.72) 42%,rgba(255,250,240,0) 72%);filter:blur(3px);z-index:-1;pointer-events:none}
.welcome-titles .w-title{filter:drop-shadow(0 2px 5px rgba(0,0,0,.22))}
/* Soft light scrim at the bottom so the purple text + white halo always reads on the photo */
.welcome-scene::after{content:"";position:absolute;left:0;right:0;bottom:0;height:52%;background:linear-gradient(transparent,rgba(255,250,240,.74));z-index:1;pointer-events:none}
/* Greeting + tagline live in one bottom flow block so they can never overlap (any length) */
.welcome-text{position:absolute;left:0;right:0;bottom:94px;z-index:2;display:flex;flex-direction:column;align-items:center;gap:10px;padding:0 16px}
.welcome-line{text-align:center;margin:0;font-size:15px;font-weight:800;color:var(--pri);line-height:1.35;text-shadow:0 1px 7px rgba(255,255,255,.95),0 0 2px rgba(255,255,255,.95)}
/* Questy's living hello, his speech bubble on the welcome scene (name + memory aware) */
/* Questy's greeting floats over the scene (no white card) so it doesn't break the art */
.welcome-greet{max-width:320px;text-align:center;font-family:'Caveat',cursive;font-weight:700;font-size:20px;line-height:1.25;color:var(--pri);text-shadow:0 1px 7px rgba(255,255,255,.97),0 0 3px rgba(255,255,255,.97),0 1px 2px rgba(255,255,255,.9)}
.welcome-greet:empty{display:none}
.w-title{font-family:'Fredoka One',cursive;font-size:clamp(38px,11vw,52px);line-height:1;background:linear-gradient(135deg,var(--pri) 20%,var(--orange) 80%);-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text}
/* age */
.age-grid{display:flex;flex-direction:column;gap:14px;flex:1}
/* Each card flexes to share the column equally so all 4 fill the screen with no dead space below. */
.age-card{background:#fff;border-radius:var(--radius-lg);padding:0;cursor:pointer;border:2.5px solid transparent;box-shadow:var(--shadow-card-sm);display:flex;flex-direction:row;align-items:stretch;transition:all .2s;overflow:hidden;flex:1;min-height:96px}
.age-card:hover{border-color:var(--pl);transform:translateY(-1px)}.age-card.sel{border-color:var(--pri)}
.age-info h3{font-size:18px;font-weight:800}.age-info p{font-size:13px;color:var(--sub);font-weight:700;margin-top:3px}
/* theme */
.theme-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;align-content:start;margin-bottom:12px}
.tc{background:#fff;border-radius:var(--radius-lg);padding:0;cursor:pointer;border:2.5px solid transparent;box-shadow:var(--shadow-card-sm);display:flex;flex-direction:column;transition:all .2s;overflow:hidden;min-width:0}
.tc:hover{transform:translateY(-2px)}
/* A real selected signal (the inline theme-colour border made the old border-color rule a no-op): white ring + lift. */
.tc.sel{transform:scale(1.03);box-shadow:0 0 0 3px #fff,0 0 0 6px var(--pri),0 8px 20px rgba(0,0,0,.22)}
.tc-img{width:100%;aspect-ratio:4/3;min-height:0;object-fit:cover;object-position:center top;display:block;border-radius:14px 14px 0 0;background:var(--tc-img-bg,var(--cream-surface))}
.tc-emoji-wrap{padding:12px 12px 0;font-size:28px;line-height:1}
.tc-body{padding:8px 12px 12px;display:flex;flex-direction:column;gap:4px;min-height:66px}
.tc-name{font-size:13px;font-weight:800;line-height:1.2;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.tc-tag{font-size:12px;color:var(--sub);font-weight:600;line-height:1.4;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.random-btn{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;margin-top:18px;padding:14px;border:2.5px solid var(--pri);border-radius:18px;background:rgba(255,249,238,.95);font-family:'Nunito',sans-serif;font-size:15px;font-weight:800;color:var(--pri);cursor:pointer;transition:all .2s;position:sticky;bottom:14px;z-index:4;box-shadow:0 4px 16px var(--sh);backdrop-filter:blur(2px)}
.random-btn:hover{border-color:var(--pl);background:color-mix(in srgb,var(--pri) 9%,transparent)}
.random-btn:active,.gh:active{transform:scale(.96)}
/* quest intro */
#s-intro{justify-content:center}
.intro-wrap{background:var(--card);border-radius:var(--radius-lg);border-top:7px solid var(--cc-accent,var(--pri));box-shadow:0 8px 24px var(--sh);padding:26px 22px;text-align:center;width:100%;max-width:340px;margin:0 auto}
.intro-hero{width:100%;border-radius:16px;overflow:hidden;margin-bottom:16px;display:flex;align-items:center;justify-content:center;height:200px;font-size:60px;line-height:1}
.intro-hero img{width:100%;height:100%;object-fit:cover;object-position:center center;display:block}
.intro-name{font-family:'Fredoka One',cursive;font-size:var(--fs-h2);color:var(--txt);line-height:1.15;margin-bottom:6px}
.intro-tag{font-size:16px;font-weight:700;line-height:1.35;margin-bottom:16px;color:var(--ink-dark)}
.intro-ready{font-size:15px;font-weight:600;color:var(--sub);margin-bottom:4px}
/* setup */
.fl{font-size:14px;font-weight:800;display:block;margin-bottom:8px;color:#3A2810;text-shadow:0 1px 2px rgba(255,250,238,.7)}
.fl-opt{font-weight:700;color:var(--sub);font-size:12px;text-shadow:none}
.fl-hint{font-size:12px;color:var(--sub);font-weight:600;margin:2px 0 10px;font-style:italic}
.ni{width:100%;padding:15px 18px;border:2.5px solid var(--bdr);border-radius:var(--radius-sm);font-size:17px;font-family:'Nunito',sans-serif;font-weight:700;outline:none;transition:border-color .2s;background:#fff;margin-bottom:16px;color:var(--txt);box-sizing:border-box}
.ni:focus{border-color:var(--pl)}.ni::placeholder{color:#D6C39A}
.ni-sm{margin-bottom:6px}
.rooms-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:12px}
.rc{position:relative;background:#fff;border:2.5px solid var(--bdr);border-radius:14px;padding:10px 28px 10px 12px;min-height:58px;cursor:pointer;transition:all .18s;display:flex;align-items:center;gap:10px;font-size:13px;font-weight:800;color:var(--ink-dark)}
.rc:hover{border-color:var(--pl)}.rc.sel{border-color:var(--pri);background:#F7EFD6;color:var(--pri)}
.rc.sel::after{content:"\2713";position:absolute;top:6px;right:6px;width:17px;height:17px;border-radius:50%;background:var(--pri);color:#fff;font-size:11px;font-weight:900;display:flex;align-items:center;justify-content:center;box-shadow:0 0 0 2px #fff}
.rc .re{font-size:19px;flex-shrink:0}
.rc .re-img{width:36px;height:36px;object-fit:contain;flex-shrink:0;filter:brightness(.72) contrast(1.1) saturate(1.12)}
.rooms-grid.pulse .rc:not(.sel){animation:roomPulse .6s ease}
@keyframes roomPulse{0%,100%{border-color:var(--bdr)}50%{border-color:var(--pri);background:#FBF4E0}}
.row2{display:flex;gap:8px;margin:8px 0 14px}
/* Two-step setup: progress dots, optional color/pet expander, step-back link */
.setup-dots{display:flex;gap:8px;justify-content:center;align-items:center;margin:0 0 10px}
.setup-dot{width:9px;height:9px;border-radius:50%;background:var(--bdr);transition:all .25s ease}
.setup-dot.on{width:24px;border-radius:5px;background:var(--pri)}
.setup-more{display:flex;align-items:center;justify-content:center;gap:7px;width:100%;min-height:44px;background:none;border:2.5px dashed rgba(91,33,182,.35);border-radius:var(--radius-sm);padding:11px 14px;margin:0 0 10px;font-family:'Nunito',sans-serif;font-weight:800;font-size:13px;color:var(--pri);cursor:pointer;transition:transform .12s,border-color .18s}
.setup-more:hover{border-color:var(--pl)}
.setup-more:active{transform:scale(.96)}
.setup-more-plus{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:50%;background:var(--pri);color:#fff;font-weight:900;font-size:15px;line-height:1}
.setup-back-link{display:flex;align-items:center;justify-content:center;gap:5px;width:100%;background:none;border:none;color:var(--ink-dark);font-family:'Nunito',sans-serif;font-weight:800;font-size:14px;cursor:pointer;padding:11px;margin:2px 0 4px;transition:transform .12s}
.setup-back-link .icn{width:17px;height:17px}
.setup-back-link:active{transform:scale(.96)}
.gh{flex:1;min-height:44px;display:flex;align-items:center;justify-content:center;background:none;border:2.5px solid var(--bdr);border-radius:var(--radius-sm);padding:11px 14px;font-family:'Nunito',sans-serif;font-size:13px;font-weight:800;cursor:pointer;color:var(--sub);transition:all .15s}
.gh:hover{border-color:var(--pri);color:var(--pri)}
.gh-all:hover{border-color:var(--pri);color:var(--pri)}
.gh-clear{color:#B0664E}.gh-clear:hover{border-color:#B0664E;color:#B0664E}
/* Sticky primary CTA so "Next" / "Begin the Quest!" is always in thumb reach */
.setup-cta{position:sticky;bottom:max(8px,env(safe-area-inset-bottom,8px));z-index:5;margin-top:8px;box-shadow:0 6px 18px rgba(91,33,182,.22)}
/* Step-2 back link, now at the TOP of the step (out of the way of the CTA) */
.setup-back-top{display:inline-flex;align-items:center;gap:5px;min-height:44px;background:none;border:none;color:var(--sub);font-family:'Nunito',sans-serif;font-weight:800;font-size:13px;cursor:pointer;padding:6px 10px 6px 2px;transition:transform .12s}
.setup-back-top .icn{width:16px;height:16px}
.setup-back-top:active{transform:scale(.96)}
/* Questy is a present companion on setup (not a tiny footnote) */
.setup-questy{margin:2px auto 6px;gap:9px}
.setup-questy .questy-img{width:62px}
.room-hint{margin:0 0 12px;font-style:normal;color:var(--ink-dark);font-weight:700}
/* Gentle shake for inline name correction (replaces the blocking modal) */
.shake{animation:fieldShake .42s ease}
@keyframes fieldShake{0%,100%{transform:translateX(0)}20%{transform:translateX(-7px)}40%{transform:translateX(6px)}60%{transform:translateX(-4px)}80%{transform:translateX(3px)}}
/* color picker */
.color-row{display:flex;gap:12px;flex-wrap:wrap;margin-bottom:14px}
/* Every swatch gets a white edge + soft ring so even the light/white colours read as tappable dots. */
.cdot{width:38px;height:38px;border-radius:50%;cursor:pointer;border:3px solid #fff;box-shadow:0 0 0 1.5px rgba(120,90,40,.3),0 1px 3px rgba(80,55,15,.2);transition:all .15s;flex-shrink:0}
.cdot:hover{transform:scale(1.15)}
.cdot.sel{box-shadow:0 0 0 3px var(--pri),0 2px 6px rgba(91,33,182,.35);transform:scale(1.14)}
/* The optional color+pet block sits in its own soft card so it groups cleanly under the explorer grid. */
#setupCustomize{background:rgba(255,253,247,.85);border:1.5px solid var(--bdr);border-radius:16px;padding:14px 14px 10px;margin-bottom:14px}

/* character selection */
.char-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:8px;padding:2px}
.char-grid::-webkit-scrollbar{width:6px}
.char-grid::-webkit-scrollbar-thumb{background:var(--bdr);border-radius:3px}
.char-card{background:#fff;border-radius:var(--radius-lg);border:2.5px solid var(--bdr);padding:9px 5px 8px;display:flex;flex-direction:column;align-items:center;gap:5px;cursor:pointer;transition:transform .15s,box-shadow .15s;box-shadow:var(--shadow-card-sm);position:relative}
.char-card:hover{transform:translateY(-2px);box-shadow:0 4px 16px var(--sh)}
.char-card:active{transform:scale(.96)}
.char-card.char-sel{border-color:var(--pri);border-width:3px;background:#EDE0FF;box-shadow:0 4px 16px rgba(91,33,182,.28)}
.char-card img{width:56px;height:56px;object-fit:contain}
.char-card-name{font-size:14px;font-weight:800;color:var(--ink-dark);text-align:center;line-height:1.2}
.char-card.char-sel .char-card-name{color:var(--pri)}
.char-tick{position:absolute;top:5px;right:5px;width:18px;height:18px;background:var(--pri);border-radius:50%;display:none;align-items:center;justify-content:center;font-size:12px;color:#fff;font-weight:900}
.char-card.char-sel .char-tick{display:flex;animation:tickPop .22s ease}
@keyframes tickPop{0%{transform:scale(0)}60%{transform:scale(1.2)}100%{transform:scale(1)}}
.char-skip{font-family:'Nunito',sans-serif;font-size:12px;font-weight:800;color:#9CA3AF;border:none;background:none;cursor:pointer;padding:4px 0;display:block;text-align:center;width:100%;margin-bottom:4px}
/* Frame the character's head/upper body (not the whole small figure) so avatars read centered regardless of each character's off-centre props (backpacks, tools). */
.char-avatar-sm{width:100%;height:100%;object-fit:cover;object-position:center 12%;border-radius:50%}
.saved-pill{display:inline-flex;align-items:center;gap:6px;background:var(--cream-surface);color:var(--pri);border-radius:100px;padding:5px 11px;font-size:11px;font-weight:800;margin-bottom:10px}
/* hunt */
.err{background:#FEF2F2;color:#DC2626;border-radius:12px;padding:12px 16px;font-size:13px;font-weight:700;margin-bottom:12px;display:none}
.tip{text-align:center;color:var(--sub);font-size:12px;font-weight:700;margin-top:10px;line-height:1.45}
.prog-row{display:flex;align-items:center;gap:12px;margin-bottom:6px}
.prog-track{flex:1 1 auto;min-width:0;background:#E8D9B4;border-radius:100px;height:6px;overflow:hidden}
.prog-fill{height:100%;border-radius:100px;transition:width .6s cubic-bezier(.4,0,.2,1)}
.prog-lbl{font-size:13px;font-weight:800;color:var(--pri);white-space:nowrap}
.goal-token{width:1.3em;height:1.3em;vertical-align:-0.28em;object-fit:contain;display:inline-block}
.theme-bar{text-align:center;font-size:12px;font-weight:800;color:var(--sub);margin-bottom:8px;line-height:1.35}
.bg-scene .theme-bar{color:var(--ink-dark);text-shadow:0 1px 3px rgba(255,250,238,.95),0 0 9px rgba(255,250,238,.75)}
/* ── QUEST CARD — Nintendo mission card style ── */
.cc{background:#fff;border-radius:var(--radius-lg);padding:14px 16px 16px;box-shadow:var(--shadow-card);display:flex;flex-direction:column;align-items:center;margin-bottom:8px;border:none;width:100%;box-sizing:border-box;overflow:hidden;position:relative}
/* Subtle top accent line instead of full border */
.cc::before{content:'';position:absolute;top:0;left:0;right:0;height:3px;background:var(--cc-accent,var(--pri));border-radius:var(--radius-lg) var(--radius-lg) 0 0}
/* Mission type badge — compact, above image */
.cc-header-pill{display:inline-flex;align-items:center;gap:5px;font-size:12px;font-weight:900;letter-spacing:.06em;text-transform:uppercase;padding:6px 13px;border-radius:100px;margin-bottom:10px;align-self:center;color:#fff;background:var(--cc-accent,var(--pri))}
/* Image — hero, floats on card.
   mix-blend-mode:multiply turns white pixels transparent against the #fff card.
   NO filter on this element — filter forces a rasterization pass that breaks blend mode.
   Shadow goes on the wrapper (.clue-emoji) instead. */
/* Storybook medallion: soft glow + gentle accent ring so Questy sits on a "badge"
   that echoes the Adventure Journal world (not a flat tinted disc). */
.clue-emoji{width:148px;height:148px;border-radius:50%;display:flex;justify-content:center;align-items:center;margin:0 auto 12px;overflow:hidden;background:radial-gradient(circle at 50% 36%,color-mix(in srgb,var(--cc-accent,var(--pri)) 5%,#fff) 0%,color-mix(in srgb,var(--cc-accent,var(--pri)) 17%,transparent) 100%);box-shadow:inset 0 0 0 2.5px color-mix(in srgb,var(--cc-accent,var(--pri)) 22%,transparent),0 6px 18px rgba(0,0,0,.08)}
.clue-img{width:auto;height:auto;max-width:76%;max-height:76%;display:block;object-fit:contain;mix-blend-mode:multiply}
/* Full-scene heroes (theme/twist illustrations) FILL the medallion as a clean circle, instead of
   floating a square in the ring. */
.clue-scene{width:100%;height:100%;object-fit:cover;display:block;border-radius:50%}
.clue-emoji-txt{font-size:88px;line-height:1;filter:drop-shadow(0 4px 14px rgba(0,0,0,.10))}
/* ── Game-feel: every selection rewards the press ── */
.tapped{animation:tapPop .3s ease}
@keyframes tapPop{0%{transform:scale(1)}45%{transform:scale(1.07)}100%{transform:scale(1)}}
.pc:active,.tc:active,.age-card:active,.char-card:active,.rc:active,.cdot:active{transform:scale(.96)}
/* Camera capture: white flash + thumbnail pop */
.cam-flash{position:fixed;inset:0;z-index:200;background:#fff;pointer-events:none;animation:camFlash .4s ease-out forwards}
@keyframes camFlash{0%{opacity:.85}100%{opacity:0}}
.clue-photo.pop-in{animation:popIn .34s cubic-bezier(.2,.85,.25,1)}
/* Boss-door finale card: gold frame + a gently swelling medallion */
.cc.is-finale{border:3px solid var(--gold-deep);box-shadow:0 0 24px color-mix(in srgb,var(--gold) 50%,transparent),0 8px 28px rgba(0,0,0,.12)}
.cc.is-finale .clue-emoji{animation:finaleSwell 1.7s ease-in-out infinite}
/* Text-heavy tiers carry longer missions — give the words the room by shrinking the hero. */
.cc.tier-seeker .clue-emoji{width:120px;height:120px;margin-bottom:9px}
.cc.tier-master .clue-emoji{width:108px;height:108px;margin-bottom:8px}
@keyframes finaleSwell{0%,100%{transform:scale(1)}50%{transform:scale(1.06)}}
/* ── Room ambience: ONE signature detail per room on the hunt card (kitchen steam, bathroom
   bubbles, bedroom Zzz...). Stroke art in the app icon style, animated on transform/opacity
   only, kept to the side gutters beside the hero medallion so mission text is never touched. ── */
.room-ambient{position:absolute;inset:0;pointer-events:none;overflow:hidden;border-radius:var(--radius-lg)}
/* Card content formally outranks ambience, so no future glow can ever cover the pill or text. */
.cc-header-pill,.clue-emoji,.clue-txt,.cc-steps{position:relative;z-index:1}
.room-ambient svg,.room-ambient span{position:absolute;color:var(--sub);overflow:visible}
/* kitchen: steam curling up, as if something warm is always on the stove */
.ra-steam{opacity:0;animation:raSteam 3.4s ease-in-out infinite}
.ra-s1{right:34px;top:74px;width:12px;height:28px}
.ra-s2{right:18px;top:84px;width:10px;height:23px;animation-delay:1.15s}
.ra-s3{right:50px;top:84px;width:8px;height:19px;animation-delay:2.3s}
@keyframes raSteam{0%{opacity:0;transform:translateY(9px)}35%{opacity:.4}100%{opacity:0;transform:translateY(-13px)}}
/* bathroom: bubbles drifting up */
.ra-bub{opacity:0;animation:raBub 4.2s ease-in-out infinite}
.ra-b1{left:24px;top:64px;width:20px;height:20px}
.ra-b2{left:44px;top:88px;width:13px;height:13px;animation-delay:1.4s}
.ra-b3{left:16px;top:98px;width:9px;height:9px;animation-delay:2.8s}
@keyframes raBub{0%{opacity:0;transform:translate(0,10px)}30%{opacity:.42}60%{transform:translate(3px,-4px)}100%{opacity:0;transform:translate(-2px,-16px)}}
/* bedroom: sleepy Zzz drifting off the pillow */
.ra-z{font-family:'Fredoka One',sans-serif;line-height:1;opacity:0;animation:raZ 3.6s ease-in-out infinite}
.ra-z1{right:42px;top:96px;font-size:19px}
.ra-z2{right:28px;top:76px;font-size:15px;animation-delay:1.2s}
.ra-z3{right:18px;top:60px;font-size:11px;animation-delay:2.4s}
@keyframes raZ{0%{opacity:0;transform:translate(0,6px)}35%{opacity:.48}100%{opacity:0;transform:translate(5px,-8px)}}
/* living room: hearth-warm flicker in the corner */
.ra-hearth{left:-34px;top:-30px;width:150px;height:150px;border-radius:50%;opacity:.65;background:radial-gradient(circle,color-mix(in srgb,var(--gold) 60%,transparent),transparent 70%);animation:raFlicker 2.6s ease-in-out infinite}
.ra-flame{left:15px;top:23px;width:23px;height:23px;color:var(--gold-deep);opacity:.55;animation:raFlame 2.6s ease-in-out infinite}
@keyframes raFlicker{0%,100%{opacity:.5}30%{opacity:.8}55%{opacity:.6}75%{opacity:.85}}
@keyframes raFlame{0%,100%{transform:scale(1)}45%{transform:scale(1.09) rotate(-2deg)}70%{transform:scale(.96) rotate(1.5deg)}}
/* laundry: sock line swaying on the breeze */
.ra-sockline{right:4px;top:32px;width:70px;height:42px;opacity:.42;transform-origin:top center;animation:raSway 4.5s ease-in-out infinite alternate}
@keyframes raSway{from{transform:rotate(-2.5deg)}to{transform:rotate(2.5deg)}}
/* garage: wrench hanging on its peg */
.ra-tool{right:20px;top:40px;width:28px;height:33px;opacity:.45;transform-origin:44% 9%;animation:raPend 3.8s ease-in-out infinite alternate}
@keyframes raPend{from{transform:rotate(-6deg)}to{transform:rotate(6deg)}}
/* dining room: candle glow over the table */
.ra-candleglow{left:8px;top:18px;width:64px;height:64px;border-radius:50%;opacity:.65;background:radial-gradient(circle,color-mix(in srgb,var(--gold) 55%,transparent),transparent 70%);animation:raFlicker 2.2s ease-in-out infinite}
.ra-candle{left:26px;top:30px;width:26px;height:38px;opacity:.5}
.ra-candle .ra-flamebit{transform-box:fill-box;transform-origin:50% 100%;animation:raFlame 2.2s ease-in-out infinite}
/* backyard: butterflies out for a wander */
.ra-fly1{left:17px;top:54px;width:30px;height:30px;opacity:.5;animation:raFly 5s ease-in-out infinite}
.ra-fly2{right:20px;top:92px;width:19px;height:19px;opacity:.4;animation:raFly 5s ease-in-out infinite reverse;animation-delay:.8s}
@keyframes raFly{0%,100%{transform:translate(0,0) rotate(-4deg)}25%{transform:translate(4px,-6px) rotate(3deg)}50%{transform:translate(-2px,-10px) rotate(-3deg)}75%{transform:translate(-5px,-4px) rotate(4deg)}}
/* entryway: keys swaying by the door */
.ra-keys{right:19px;top:36px;width:30px;height:38px;opacity:.45;transform-origin:50% 8%;animation:raPend 4.2s ease-in-out infinite alternate;animation-delay:.3s}
/* stairs: the family photo wall climbing up, under warm wall light */
.ra-wallglow{left:6px;top:40px;width:64px;height:80px;border-radius:50%;background:radial-gradient(circle,color-mix(in srgb,var(--gold) 30%,transparent),transparent 72%)}
.ra-frame{opacity:.45;animation:raGlow 4s ease-in-out infinite}
.ra-f1{left:13px;top:92px;width:19px;height:19px;transform:rotate(-3deg)}
.ra-f2{left:28px;top:66px;width:17px;height:17px;animation-delay:1.3s;transform:rotate(2deg)}
.ra-f3{left:43px;top:42px;width:15px;height:15px;animation-delay:2.6s;transform:rotate(-2deg)}
@keyframes raGlow{0%,100%{opacity:.38}50%{opacity:.58}}
/* Reduced motion: hold every signature still at its resting opacity (identity without movement). */
@media (prefers-reduced-motion:reduce){
  .room-ambient *{animation:none!important}
  .ra-steam,.ra-bub{opacity:.3}.ra-z{opacity:.4}
}
@media (prefers-reduced-motion:reduce){.tapped,.cam-flash,.clue-photo.pop-in,.cc.is-finale .clue-emoji{animation-duration:.01ms;animation-iteration-count:1}}
/* Victory screen was the one animation-dense moment without a reduced-motion guard. */
@media (prefers-reduced-motion:reduce){.cp,.sc-trophy,.star-animated,.coop-av-circle,.art-card.is-new,.sc-summit-hook{animation:none!important}}
/* Per-stop "got one!" beat: a brief Questy cheer pill (auto-fades, never blocks) + token pop. */
.stop-cheer{position:fixed;top:calc(env(safe-area-inset-top,0px) + 18%);bottom:auto;left:50%;z-index:40;display:flex;align-items:center;gap:8px;background:#fff;border:2.5px solid var(--gold-deep);border-radius:22px;padding:8px 18px 8px 10px;box-shadow:0 8px 22px rgba(0,0,0,.2);font-weight:900;font-size:15.5px;line-height:1.15;color:var(--pri);opacity:0;pointer-events:none;text-align:left;max-width:min(340px,90vw)}
.stop-cheer span{min-width:0;overflow-wrap:break-word}
.stop-cheer .cheer-questy{width:34px;height:34px;object-fit:contain}
.stop-cheer .cheer-star{width:24px;height:24px;object-fit:contain;animation:starSpin .6s ease}
@keyframes starSpin{0%{transform:scale(0) rotate(-90deg)}60%{transform:scale(1.35) rotate(10deg)}100%{transform:scale(1) rotate(0)}}
/* expanding "burst" ring behind the pill so the win reads loud */
.stop-cheer::before{content:"";position:absolute;left:50%;top:50%;width:40px;height:40px;border-radius:50%;border:3px solid var(--gold);transform:translate(-50%,-50%) scale(.4);opacity:0;z-index:-1}
.stop-cheer.show::before{animation:burstRing .6s ease-out}
@keyframes burstRing{0%{opacity:.7;transform:translate(-50%,-50%) scale(.4)}100%{opacity:0;transform:translate(-50%,-50%) scale(3.2)}}
.stop-cheer.show{animation:cheerPop 1.25s ease forwards}
@keyframes cheerPop{0%{opacity:0;transform:translate(-50%,-14px) scale(.7)}14%{opacity:1;transform:translate(-50%,5px) scale(1.12)}28%{transform:translate(-50%,0) scale(1)}74%{opacity:1}100%{opacity:0;transform:translate(-50%,-8px) scale(1)}}
.goal-token.pop{animation:tokPop .55s cubic-bezier(.2,.9,.3,1)}
@keyframes tokPop{0%{transform:scale(1) rotate(0)}40%{transform:scale(1.75) rotate(-12deg)}70%{transform:scale(1.75) rotate(12deg)}100%{transform:scale(1) rotate(0)}}
@media (prefers-reduced-motion:reduce){.stop-cheer.show,.stop-cheer.show::before,.goal-token.pop,.stop-cheer .cheer-star,.fact-box.reveal,.sc-find{animation-duration:.01ms}}
/* Tablet column-width + grids. (Hunt/card overrides live in a second block at the END of the
   file so they win against the base #s-hunt rules that appear later in source order.) */
@media (min-width:720px){
  .screen{max-width:600px}
  .age-grid{display:grid;grid-template-columns:1fr 1fr}
  .theme-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@keyframes fe{0%,100%{transform:translateY(0)}50%{transform:translateY(-7px)}}
/* Mission title */
.clue-txt{font-size:18px;font-weight:900;text-align:center;color:#1C1B1F;line-height:1.3;width:100%;overflow-wrap:break-word;word-break:break-word;padding:0 2px;margin-bottom:0}
.clue-txt.tiny{font-size:21px}
.clue-txt.junior{font-size:20px}
.clue-txt.seeker{font-size:18px}
.clue-txt.master{font-size:17px}
/* Divider between title and steps */
.cc-divider{width:32px;height:2px;border-radius:2px;background:var(--cc-accent,var(--pri));opacity:.3;margin:10px auto 10px;flex-shrink:0}
/* Numbered steps — inline, no boxy backgrounds */
.cc-steps{display:flex;flex-direction:column;gap:6px;width:100%}
.cc-detail{display:block;text-align:center;font-size:16px;font-weight:600;color:#4B5563;line-height:1.45;margin-top:10px;width:100%;overflow-wrap:break-word;word-break:break-word}
.cc-detail.seeker{font-size:15px}
.cc-detail.master{font-size:14px}
/* Two-step GO / THEN layout */
.cc-twostep{display:flex;align-items:flex-start;gap:8px;text-align:left;justify-content:flex-start}
.step-tag{flex-shrink:0;font-size:10px;font-weight:900;letter-spacing:.06em;border-radius:6px;padding:3px 7px;margin-top:3px;line-height:1}
.step-go{color:var(--cc-accent-ink,#fff);background:var(--cc-accent,var(--pri))}
.step-then{color:var(--cc-accent,var(--pri));background:rgba(0,0,0,.06)}
.step-body{flex:1}
/* Challenge countdown timer (tap to start) */
.cc-timer{position:relative;width:100%;height:46px;margin-top:12px;border:none;border-radius:var(--radius-sm);overflow:hidden;background:var(--cream-surface);cursor:pointer;font-family:'Nunito',sans-serif;padding:0;-webkit-tap-highlight-color:transparent;display:block;transition:transform .12s}
.cc-timer:active{transform:scale(.96)}
.cc-timer-bar{position:absolute;left:0;top:0;bottom:0;width:100%;background:var(--cc-accent,var(--pri));transition:width .12s linear}
.cc-timer-lbl{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:15px;font-weight:900;gap:6px;pointer-events:none}
.cc-timer-lbl-base{color:var(--cc-accent,var(--pri))}
.cc-timer-lbl-fill{color:var(--cc-accent-ink,#fff)}
.cc-timer.is-low .cc-timer-bar{background:#F97316}
.cc-timer.is-low .cc-timer-lbl-base{color:#C2410C}
/* Did You Know card */
.fact-box{width:100%;padding:10px 13px;background:#FFF8E6;border-radius:var(--radius-sm);border:1px solid #EBD49A;margin-bottom:7px;box-sizing:border-box;display:flex;gap:9px;align-items:flex-start}
.fact-box-icon{font-size:20px;flex-shrink:0;line-height:1;margin-top:1px;color:var(--gold-edge)}
.questy-fact-icon{width:34px;height:auto;display:block;margin-top:1px}
.fact-box-icon img.caught{transform-origin:50% 100%;animation:findPop .42s cubic-bezier(.2,1.6,.6,1),qBreathe 5.3s ease-in-out .6s infinite}
@media (prefers-reduced-motion:reduce){.fact-box-icon img.caught{animation-duration:.01ms}}
.fact-box-body{min-width:0}
.fact-box span{font-size:10px;color:var(--gold-edge);font-weight:800;text-transform:uppercase;letter-spacing:.07em;display:block;margin-bottom:2px}
.fact-box p{font-size:12px;color:var(--ink-dark);font-weight:700;line-height:1.45;margin:0}
/* The discovery is now EARNED on "Done" — it pops in as a found treasure, not wallpaper. */
@keyframes factReveal{0%{opacity:0;transform:translateY(8px) scale(.92)}60%{opacity:1;transform:translateY(0) scale(1.03)}100%{opacity:1;transform:translateY(0) scale(1)}}
.fact-box.reveal{animation:factReveal .5s cubic-bezier(.2,1.4,.5,1)}
/* Parent Tip — collapsed */
/* P8: calmer parchment so the grown-up note reads as a separate utility, not a twin of the golden discovery box. */
.parent-tip{width:100%;background:var(--cream-surface);border-radius:var(--radius-sm);border:1.5px solid var(--bdr);margin-bottom:7px;box-sizing:border-box;overflow:hidden}
.parent-tip-header{display:flex;align-items:center;justify-content:space-between;padding:12px 13px;cursor:pointer;-webkit-tap-highlight-color:transparent;user-select:none}
.parent-tip-header-left{display:flex;align-items:center;gap:6px}
.parent-tip span.ptip-emoji{display:inline-flex;align-items:center}
.parent-tip .ptip-questy{width:24px;height:24px;object-fit:contain;display:block;flex-shrink:0}
.parent-tip span.ptip-label{font-size:12.5px;color:#B45309;font-weight:800}
.parent-tip-chevron{font-size:13px;color:#B45309;transition:transform .2s;line-height:1}
.parent-tip-chevron.open{transform:rotate(180deg)}
.parent-tip-body{padding:0 13px 11px;border-top:1px solid #FDE68A}
.parent-tip p{font-size:12px;color:#92400E;font-weight:700;line-height:1.5;margin:8px 0 0}
.hint{text-align:center;font-size:13px;font-weight:800;color:var(--sub);margin-bottom:8px}
/* victory / share card */
#s-victory{padding:14px 18px max(18px,calc(env(safe-area-inset-bottom,0px) + 10px));justify-content:flex-start;gap:8px;overflow-y:auto}
.share-card{border-radius:var(--radius-xl);padding:18px 22px 16px;text-align:center;color:#fff;margin-bottom:8px;position:relative;overflow:hidden;width:100%;box-sizing:border-box;text-shadow:0 1px 3px rgba(0,0,0,.30);z-index:2}
.share-card::before{content:'';position:absolute;top:-40px;right:-40px;width:160px;height:160px;border-radius:50%;background:rgba(255,255,255,.08);pointer-events:none}
.share-card::after{content:'';position:absolute;bottom:-30px;left:-30px;width:120px;height:120px;border-radius:50%;background:rgba(255,255,255,.06);pointer-events:none}
.sc-brand{font-size:13px;font-weight:800;letter-spacing:.1em;text-transform:uppercase;opacity:.8;margin-bottom:10px}
.sc-trophy{font-size:80px;animation:tp .7s cubic-bezier(.2,1.6,.6,1) both;line-height:1;margin-bottom:8px}
.sc-trophy-img{width:1em;height:1em;display:inline-block;object-fit:contain}
.tier-emblem{width:1.8em;height:1.8em;vertical-align:middle;margin-right:4px;margin-top:-3px}
@keyframes tp{from{transform:scale(0) rotate(-20deg);opacity:0}to{transform:scale(1) rotate(0);opacity:1}}
.sc-name{font-family:'Fredoka One',cursive;font-size:clamp(26px,8vw,40px);line-height:1.05;margin-bottom:4px;overflow-wrap:break-word;max-width:100%}
.sc-sub{font-size:15px;font-weight:700;opacity:.94;margin-bottom:10px}
.sc-theme-pill{background:rgba(255,255,255,.2);backdrop-filter:blur(4px);border-radius:100px;padding:8px 20px;font-size:14px;font-weight:800;display:inline-block;margin-bottom:8px}
.sc-level{font-size:12px;opacity:.88;font-weight:700;margin-bottom:18px}
.sc-stars{font-size:22px;margin-bottom:8px;letter-spacing:4px}
.sc-count{font-size:13px;opacity:.84;font-weight:700;margin-bottom:4px}
/* Victory "treasures found" summary — the collection shows up at peak attention. */
.sc-finds{margin:4px auto 6px;text-align:center}
.sc-finds-head{font-size:13px;font-weight:900;color:#fff;margin:0 0 9px;line-height:1.3;text-shadow:0 1px 2px rgba(0,0,0,.18)}
.sc-finds-prog{font-size:var(--fs-sm);font-weight:800;color:#fff;opacity:.92;margin-top:9px;line-height:1.3;text-shadow:0 1px 2px rgba(0,0,0,.18)}
.sc-finds-row{display:flex;flex-wrap:wrap;justify-content:center;gap:9px;overflow:visible}
.sc-find.is-more{background:rgba(255,255,255,.22);box-shadow:none}
.sc-find-more{font-family:'Nunito',sans-serif;font-weight:900;font-size:15px;color:#fff}
.sc-find{position:relative;width:46px;height:46px;border-radius:50%;background:rgba(255,255,255,.94);box-shadow:0 3px 8px rgba(0,0,0,.18);display:flex;align-items:center;justify-content:center;opacity:0;animation:findPop .45s cubic-bezier(.2,1.6,.6,1) forwards;animation-delay:var(--fd,0ms)}
.sc-find img{width:78%;height:78%;object-fit:contain}
.sc-find.is-rare{background:linear-gradient(180deg,#FFF6DC,#FFE9A8);box-shadow:0 0 0 2px var(--gold),0 3px 9px rgba(224,169,46,.5)}
.sc-find-new{position:absolute;top:-7px;right:-8px;background:linear-gradient(135deg,var(--gold),var(--gold-deep));color:#fff;font-size:8.5px;font-weight:900;letter-spacing:.03em;padding:2px 5px;border-radius:8px;box-shadow:0 2px 5px rgba(0,0,0,.25);transform:rotate(8deg)}
@keyframes findPop{0%{opacity:0;transform:scale(.3) translateY(6px)}65%{opacity:1;transform:scale(1.18) translateY(0)}100%{opacity:1;transform:scale(1)}}
.sc-date{font-size:11px;opacity:.7;font-weight:600}
.sc-stripe{height:5px;border-radius:0 0 6px 6px;margin-top:16px;background:rgba(255,255,255,.25)}
@keyframes starPop{0%{transform:scale(0) rotate(-15deg);opacity:0}65%{transform:scale(1.25) rotate(5deg);opacity:1}100%{transform:scale(1) rotate(0);opacity:1}}
.star-animated{display:inline-block;opacity:0;animation:starPop .4s cubic-bezier(.2,1.6,.6,1) forwards}
.sc-star{width:25px;height:auto;margin:0 2px;vertical-align:middle;filter:drop-shadow(0 1px 2px rgba(0,0,0,.18))}
.v-actions{display:flex;flex-direction:column;gap:8px;width:100%}
/* C2: the one primary action is purple everywhere. Sits on the scene bg (not the theme card), so it always contrasts. */
.btn-again{background:linear-gradient(135deg,var(--pri),var(--pl));color:#fff;box-shadow:0 6px 24px rgba(91,33,182,.28)}
.btn-again:hover{box-shadow:0 8px 28px rgba(91,33,182,.38)}
/* Victory secondary actions: see the journal, or switch explorer */
/* Two compact secondary actions in one row, so only "Start Another Quest" reads as primary */
.v-actions-row{display:flex;gap:8px;width:100%}
.v-sec{flex:1;min-width:0;min-height:44px;display:flex;align-items:center;justify-content:center;gap:6px;padding:12px 8px;border:2.5px solid var(--bdr);border-radius:var(--radius-sm);background:#fff;font-family:'Nunito',sans-serif;font-size:var(--fs-sm);font-weight:800;color:var(--sub);cursor:pointer;transition:all .18s;line-height:1.1}
.v-sec:active{transform:scale(.96)}
.v-sec:hover{border-color:var(--pri);color:var(--pri)}
.v-sec .icn{width:17px;height:17px;flex:none}
.v-sec-gold{color:#9A6A20;border-color:var(--gold-deep)}
.v-sec-gold:hover{color:#7C5A1E;background:color-mix(in srgb,var(--gold) 16%,transparent);border-color:var(--gold-deep)}
/* Screenshot hint is a quiet caption, not a card competing with the buttons */
/* P9: secondary weight (no shadow, thinner text) so the purple primary above it reads as THE action. */
.btn-share{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:44px;background:#fff;border:2.5px solid var(--bdr);border-radius:var(--radius-sm);padding:12px 13px;font-family:'Nunito',sans-serif;font-size:14px;font-weight:800;color:var(--sub);cursor:pointer;transition:transform .12s,border-color .18s,color .18s}
.btn-share:hover{border-color:var(--pri);color:var(--pri)}
.btn-share .icn{width:19px;height:19px}
.btn-share:active{transform:scale(.96)}
.btn-share:disabled{opacity:.6}

/* age-card layout merged into base rule */
/* aspect-ratio matches the source art (420x300 = 7/5), so the image fills the full
   card width edge-to-edge with no letterbox bands — same clean fit as the theme cards. */
.age-img{width:108px;height:auto;align-self:stretch;flex:none;object-fit:cover;object-position:center center;display:block;background:var(--card-img-bg,var(--cream-surface))}
.age-info{flex:1;min-width:0;text-align:left;padding:12px 16px;display:flex;flex-direction:column;justify-content:center}

/* players */
.player-list{display:flex;flex-direction:column;gap:10px;flex:1;justify-content:center}
.pc{background:var(--cream-surface);border-radius:var(--radius-lg);padding:14px 16px;cursor:pointer;border:2.5px solid rgba(150,115,55,.25);box-shadow:var(--shadow-card-sm);display:flex;align-items:center;gap:14px;transition:all .2s;overflow:hidden;box-sizing:border-box;width:100%}
.pc:hover{border-color:var(--pl);transform:translateY(-1px)}
.sel-p1{border-color:var(--pri)!important;background:#F7EFD6!important;box-shadow:0 4px 16px rgba(91,33,182,.28)!important}
.sel-p2{border-color:#F97316!important;background:#FFF7ED!important;box-shadow:0 4px 16px rgba(249,115,22,.28)!important}
.pc-selpill{display:flex;align-items:center;gap:5px;font-size:12px;font-weight:800;color:var(--pri);flex-shrink:0;animation:selpillPop .32s cubic-bezier(.2,1.5,.5,1) both}
@keyframes selpillPop{0%{transform:scale(.55);opacity:0}60%{transform:scale(1.14)}100%{transform:scale(1);opacity:1}}
@media (prefers-reduced-motion:reduce){.pc-selpill{animation:none}}
.pc-selpill .icn{width:16px;height:16px}
.sel-p2 .pc-selpill{color:#C2410C}
.pc-add{border:2.5px dashed var(--bdr)!important;background:none!important;box-shadow:none!important}
.pc-add:hover{border-color:var(--pri)!important}
.bg-scene .pc-add{background:rgba(255,250,238,.5)!important}
.pc-avatar{width:56px;height:56px;border-radius:50%;background:var(--cream-surface);display:flex;align-items:center;justify-content:center;font-size:26px;flex-shrink:0}
.pc-avatar-add{background:var(--cream-surface)!important;font-size:30px!important;font-weight:700;color:var(--sub)}
.pc-info{flex:1;min-width:0}
.pc-name{font-size:16px;font-weight:800;color:var(--txt);line-height:1.15;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.pc-meta{font-size:12px;font-weight:700;color:var(--sub);margin-top:2px}
.pc-check{width:26px;height:26px;border-radius:50%;background:var(--pri);color:#fff;display:none;align-items:center;justify-content:center;font-size:14px;font-weight:900;flex-shrink:0}
.sel-p1 .pc-check,.sel-p2 .pc-check{display:flex}
.pc-badge{width:26px;height:26px;border-radius:50%;color:#fff;display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:900;flex-shrink:0;letter-spacing:0}
.pc-badge-p1{background:var(--pri)}
.pc-badge-p2{background:#F97316}
.pc-del{background:none;border:none;cursor:pointer;font-size:20px;color:#D1D5DB;min-width:44px;min-height:44px;padding:8px;line-height:1;flex-shrink:0;border-radius:8px;transition:color .15s}
.pc-del:hover{color:#EF4444}
.pc-edit{background:none;border:none;cursor:pointer;font-size:16px;min-width:44px;min-height:44px;padding:8px;line-height:1;flex-shrink:0;border-radius:8px;opacity:.55;transition:opacity .15s}
.pc-edit:hover{opacity:1}
/* Player screen — mockup look */
#s-players .sh{text-align:center;margin-bottom:6px}
#s-players .sh h2{font-size:28px;color:#3A2810;line-height:1.06;text-shadow:0 0 5px rgba(255,250,238,.92),0 1px 1px rgba(255,250,238,.95),0 2px 6px rgba(90,60,25,.28)}
#s-players .sh p{color:var(--ink-dark);text-shadow:0 0 4px rgba(255,250,238,.95),0 1px 1px rgba(255,250,238,.95)}
#s-players .pc-name{font-size:17px}
#questyPlayers{margin:2px auto 12px}
#questyPlayers .questy-img{width:86px}
.ps-party-lbl{text-align:center;font-family:'Fredoka One',cursive;font-size:14px;color:var(--ink-dark);letter-spacing:.02em;margin:2px 0 9px;text-shadow:0 0 4px rgba(255,250,238,.92),0 1px 1px rgba(255,250,238,.95)}
.ps-footer{text-align:center;font-family:'Caveat',cursive;font-size:18px;font-weight:700;color:#4A3820;margin:12px 0 10px;text-shadow:0 0 4px rgba(255,250,238,.92),0 1px 1px rgba(255,250,238,.95)}
.cta-center{display:inline-flex;align-items:center;justify-content:center;gap:8px}
#confirmPlayerBtn .icn{width:22px;height:22px}
/* co-op mode */
.party-bar{background:#fff;border-radius:16px;padding:10px 16px;box-shadow:0 2px 10px var(--sh);display:none;align-items:center;justify-content:space-between;width:100%;box-sizing:border-box}
.party-av{display:flex;flex-direction:column;align-items:center;gap:4px}
.party-av-img{width:44px;height:44px;border-radius:50%;background:var(--cream-surface);overflow:hidden;display:flex;align-items:center;justify-content:center;border:2.5px solid var(--pri);font-size:11px;font-weight:900;color:var(--pri)}
.party-av-img.p2{border-color:#10B981;background:#D1FAE5;color:#065F46}
.party-av-name{font-size:12px;font-weight:800;color:var(--txt);text-align:center;max-width:60px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.party-av-inner{display:flex;align-items:center;gap:6px}
.party-center{display:flex;flex-direction:column;align-items:center;gap:2px}
.party-heart{font-size:22px;color:var(--pri);display:flex}
.party-team-lbl{font-size:10px;font-weight:900;color:var(--pri);letter-spacing:.05em;text-transform:uppercase}
.team-mode-strip{background:var(--cream-surface);border-radius:10px;padding:7px 12px;display:flex;align-items:center;gap:6px;font-size:12px;font-weight:800;color:var(--pri);margin-bottom:8px;width:100%;box-sizing:border-box}
.coop-avatars{display:flex;justify-content:center;gap:20px;margin:0 auto 10px}
.coop-av{display:flex;flex-direction:column;align-items:center;gap:6px}
.coop-av-circle{width:72px;height:72px;border-radius:50%;background:rgba(255,255,255,.25);overflow:hidden;display:flex;align-items:center;justify-content:center;border:3px solid rgba(255,255,255,.5)}
.coop-av-name{font-size:13px;font-weight:800;color:rgba(255,255,255,.9)}
/* confetti */
.cw{position:fixed;top:0;left:0;width:100%;height:100%;pointer-events:none;z-index:9999}
.cp{position:absolute;line-height:1;user-select:none;animation:cf linear both}
@keyframes cf{0%{opacity:1;transform:translateY(-10px) rotate(0)}100%{opacity:0;transform:translateY(105vh) rotate(720deg)}}
@media (max-width: 480px){
.screen{padding:max(12px,calc(env(safe-area-inset-top,0px) + 6px)) 12px max(14px,calc(env(safe-area-inset-bottom,0px) + 8px));max-width:100%;justify-content:flex-start;min-height:100dvh}
#s-hunt{padding-top:6px;padding-bottom:calc(84px + env(safe-area-inset-bottom,0px));justify-content:flex-start;min-height:100dvh;gap:4px;overflow-y:auto;overflow-x:hidden}
#s-hunt #hintTxt{position:fixed;left:50%;bottom:calc(64px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);width:calc(100vw - 28px);max-width:420px;margin:0;z-index:5}
#s-hunt #doneBtn{position:fixed;left:50%;bottom:max(10px,env(safe-area-inset-bottom,10px));transform:translateX(-50%);width:calc(100vw - 20px);max-width:420px;z-index:5;margin:0}

.sh{margin-bottom:12px}.sh h2{font-size:24px}.sh p{font-size:13px;margin-top:2px}

.prog-row{margin-bottom:4px;gap:10px}.prog-lbl{font-size:12px}.prog-track{height:6px}
.theme-bar{margin-bottom:4px;font-size:11px;line-height:1.25}
.cc{padding:12px 14px 14px;border-radius:20px;margin-bottom:7px}
.cc-header-pill{font-size:12px;padding:6px 13px;margin-bottom:8px}
.clue-emoji-txt{font-size:68px}.clue-img{max-width:76%;max-height:76%;width:auto;height:auto;display:block;object-fit:contain;mix-blend-mode:multiply}
.clue-emoji{width:132px;height:132px;margin:0 auto 10px}
.cc.tier-seeker .clue-emoji{width:96px;height:96px;margin-bottom:6px}
.cc.tier-master .clue-emoji{width:84px;height:84px;margin-bottom:6px}
.parent-tip-header{padding:9px 13px}
.questy-fact-icon{width:28px}
.cc-divider{margin:8px auto 8px}
.clue-txt{font-size:18px}.clue-txt.tiny{font-size:21px}.clue-txt.junior{font-size:20px}.clue-txt.seeker{font-size:18px}.clue-txt.master{font-size:17px}
.cc-steps{gap:5px}
.parent-tip{margin-bottom:5px;border-radius:var(--radius-sm)}
.fact-box{padding:7px 10px;border-radius:var(--radius-sm);margin-bottom:5px}
.fact-box span{font-size:9px}.fact-box p{font-size:11px;line-height:1.4}
.hint{display:none}
.btn{padding:15px 18px;font-size:16px;border-radius:var(--radius-lg)}
#doneBtn{font-size:16px;padding:15px 18px}
.share-card{padding:16px 18px 14px;margin-bottom:8px}.sc-brand{margin-bottom:8px}.sc-trophy{font-size:52px;margin-bottom:4px}.sc-name{font-size:32px}.sc-sub{font-size:13px;margin-bottom:8px}.sc-theme-pill{padding:7px 14px;font-size:12px;margin-bottom:6px}.sc-level{font-size:11px;margin-bottom:8px}.sc-stars{font-size:18px;margin-bottom:7px}.sc-count{font-size:12px;margin-bottom:3px}.sc-date{font-size:11px}.sc-name{font-size:clamp(24px,7.5vw,32px)}.v-actions{gap:8px}.btn-share{padding:12px;font-size:14px}.sc-find{width:40px;height:40px}
}

#doneBtn{display:flex;align-items:center;justify-content:space-between;padding:18px 22px;font-size:18px;box-shadow:0 6px 22px rgba(0,0,0,.16)}
#doneBtn:hover{box-shadow:0 8px 26px rgba(0,0,0,.22)}
.btn-arr{width:32px;height:32px;border-radius:50%;background:rgba(255,255,255,.25);display:inline-flex;align-items:center;justify-content:center;font-size:16px;flex-shrink:0}

/* ── QUESTY (the guide) — speech-bubble + figure. Figure only appears when its
   pose art is loaded; the bubble is text-first so Questy can talk before the art
   lands. ── */
.questy-host{display:flex;align-items:center;justify-content:center;gap:10px;margin:6px auto 12px;max-width:340px;animation:questy-pop .35s ease both}
@keyframes questy-pop{from{opacity:0;transform:translateY(8px) scale(.96)}to{opacity:1;transform:translateY(0) scale(1)}}
.questy-fig{flex:none;display:flex}
.questy-img{width:72px;height:auto;display:block}
.questy-bubble{position:relative;background:var(--card);color:var(--txt);border:2px solid var(--bdr);border-radius:var(--radius-sm);padding:11px 14px;font-size:14px;font-weight:700;line-height:1.35;box-shadow:0 4px 14px var(--sh);text-align:left}
/* little tail pointing back toward Questy */
/* Speech-bubble tail removed everywhere — it read as a stray arrow. Bubbles are plain rounded cards. */
.questy-fig + .questy-bubble::before,.questy-fig + .questy-bubble::after{display:none}
/* Welcome: Questy is the brand face — bigger figure, bubble wraps under */
#questyWelcome{flex-direction:column;gap:8px;text-align:center;margin:4px auto 0}
#questyWelcome .questy-img{width:150px}
#questyWelcome .questy-bubble{text-align:center}
#questyWelcome .questy-fig + .questy-bubble::before,#questyWelcome .questy-fig + .questy-bubble::after{display:none}
/* Victory: celebratory, centered */
#questyVictory{flex-direction:column;gap:8px;text-align:center;margin-top:2px}
#questyVictory .questy-img{width:88px}
#questyVictory .questy-bubble{background:rgba(255,255,255,.9);border-color:rgba(255,255,255,.6);color:#1C1B1F}
#questyVictory .questy-fig + .questy-bubble::before,#questyVictory .questy-fig + .questy-bubble::after{display:none}
/* compact peek used on player-select / theme screens */
.questy-peek{margin:2px auto 10px;gap:8px}
.questy-peek .questy-img{width:52px}
.questy-peek .questy-bubble{padding:8px 11px;font-size:13px}
/* ── Living world: ambient motion pass (v=167). Everything here is decoration: slow, tiny,
   de-synced (prime-ish durations + negative delays), transform/opacity only, and fully
   removed under prefers-reduced-motion. Only the ACTIVE screen animates (others are
   display:none), so battery cost stays near zero. ── */
/* Questy is alive: a slow breath on every Questy figure + a rare, brief curious tilt.
   Breath lives on the img, the tilt on the wrapper, so the transforms never fight. */
.questy-img,.j-questy img,.clue-questy,.ptip-questy,.welcome-hero-img{transform-origin:50% 100%;animation:qBreathe 5.3s ease-in-out infinite}
.questy-fig{transform-origin:50% 92%;animation:qPeek 11.3s ease-in-out infinite}
@keyframes qBreathe{0%,100%{transform:scaleY(1) scaleX(1)}50%{transform:scaleY(1.016) scaleX(1.007)}}
@keyframes qPeek{0%,86%,100%{transform:rotate(0)}90%{transform:rotate(1.7deg)}95%{transform:rotate(-1.1deg)}}
/* Drifting dust motes / fireflies: five soft specks per scene, each on its own clock. */
.amb{position:absolute;inset:0;pointer-events:none;overflow:hidden;z-index:1}
/* Content always outranks dust: promote the real reading surfaces above the z1 mote layer. */
.player-list,.v-actions,#bookshelf,#obBody,.bp-head,.sh{position:relative;z-index:2}
.amb i{position:absolute;display:block;width:5px;height:5px;border-radius:50%;background:radial-gradient(circle,rgba(255,250,230,.95),rgba(255,250,230,0) 72%);opacity:0;animation:ambFloat var(--ad,17s) ease-in-out infinite var(--adel,0s)}
.amb i:nth-child(1){left:12%;top:230px;--ad:16.3s;--adel:-2s}
.amb i:nth-child(2){left:79%;top:150px;width:4px;height:4px;--ad:21.7s;--adel:-9s}
.amb i:nth-child(3){left:56%;top:430px;width:6px;height:6px;--ad:18.1s;--adel:-13s}
.amb i:nth-child(4){left:30%;top:530px;width:3.5px;height:3.5px;--ad:24.9s;--adel:-6s}
.amb i:nth-child(5){left:88%;top:370px;--ad:14.7s;--adel:-11s}
@keyframes ambFloat{0%{opacity:0;transform:translate(0,26px)}18%{opacity:.4}52%{opacity:.18;transform:translate(-7px,-36px)}78%{opacity:.32}100%{opacity:0;transform:translate(5px,-90px)}}
/* Victory + journal lean gold: the same dust, warmed to match the reward moment. */
.amb-gold i{background:radial-gradient(circle,color-mix(in srgb,var(--gold) 90%,transparent),transparent 72%)}
/* Welcome sky: two tiny four-point stars that twinkle once in a while (mostly asleep). */
.amb .tw{width:8px;height:8px;border-radius:0;background:rgba(255,252,235,.95);clip-path:polygon(50% 0,62% 38%,100% 50%,62% 62%,50% 100%,38% 62%,0 50%,38% 38%);animation:ambTwinkle var(--ad,9.1s) ease-in-out infinite var(--adel,0s)}
.amb .tw1{left:9%;top:15%;--ad:9.1s;--adel:-3s}
.amb .tw2{left:82%;top:9%;width:6px;height:6px;--ad:13.7s;--adel:-8s}
@keyframes ambTwinkle{0%,80%,100%{opacity:0;transform:scale(.4) rotate(0deg)}86%{opacity:.9;transform:scale(1) rotate(18deg)}92%{opacity:.2;transform:scale(.5) rotate(30deg)}}
/* SPECIAL-mission foreshadow tell: one tiny gold star twinkles by Questy's intro bubble. */
#questyIntro.tease-glint .questy-bubble{position:relative}
#questyIntro.tease-glint .questy-bubble::after{content:'';display:block;position:absolute;top:-5px;right:-3px;width:9px;height:9px;background:var(--gold-deep);clip-path:polygon(50% 0,62% 38%,100% 50%,62% 62%,50% 100%,38% 62%,0 50%,38% 38%);animation:ambTwinkle 6.7s ease-in-out -2s infinite;opacity:0}
/* A quiet sheen strolls across the gold bookshelf coin every ~9s (reward = alive). */
.book-btn{position:relative;overflow:hidden}
.book-btn::after{content:'';position:absolute;inset:0;border-radius:50%;background:linear-gradient(115deg,transparent 40%,rgba(255,255,255,.55) 50%,transparent 60%);transform:translateX(-130%);animation:goldSheen 8.9s ease-in-out infinite;pointer-events:none}
@keyframes goldSheen{0%,78%{transform:translateX(-130%)}90%,100%{transform:translateX(130%)}}
.v-sec-gold{position:relative;overflow:hidden}
.v-sec-gold::after{content:'';position:absolute;inset:0;border-radius:inherit;background:linear-gradient(115deg,transparent 40%,rgba(255,255,255,.45) 50%,transparent 60%);transform:translateX(-130%);animation:goldSheen 8.9s ease-in-out -3.4s infinite;pointer-events:none}
@media (prefers-reduced-motion:reduce){
  .amb,.book-btn::after,.v-sec-gold::after{display:none}
  #questyIntro.tease-glint .questy-bubble::after{animation:none;opacity:.7}
  .questy-img,.j-questy img,.clue-questy,.ptip-questy,.welcome-hero-img,.questy-fig{animation:none!important}
}

/* ── Modal dialogs (shared, token-based — replaces per-modal inline styles) ──
   The overlay keeps its inline display:none; JS toggles display:flex to show. */
.modal-ov{position:fixed;inset:0;background:rgba(28,27,31,.55);z-index:999;align-items:center;justify-content:center;padding:24px}
.modal-card{background:var(--card);border-radius:var(--radius-lg);padding:28px 24px;max-width:320px;width:100%;text-align:center;box-shadow:0 8px 40px rgba(0,0,0,.18)}
.modal-icon{font-size:32px;margin-bottom:8px;color:var(--pri);display:flex;justify-content:center}
.modal-card h3{font-size:18px;font-weight:800;color:var(--txt);margin:0 0 8px}
.modal-card p{font-size:14px;color:var(--sub);line-height:1.5;margin:0 0 24px}
.modal-row{display:flex;gap:10px}
.modal-btn,.modal-btn-secondary,.modal-btn-danger{padding:13px;border-radius:14px;font-family:'Nunito',sans-serif;font-size:15px;font-weight:800;cursor:pointer;transition:transform .12s}
.modal-btn:active,.modal-btn-secondary:active,.modal-btn-danger:active{transform:scale(.96)}
.modal-btn{width:100%;border:none;background:var(--pri);color:#fff}
.modal-btn-secondary{flex:1;border:2.5px solid var(--bdr);background:var(--card);color:var(--sub)}
.modal-btn-danger{flex:1;border:none;background:#EF4444;color:#fff}

/* ── Photo Missions ── */
/* Uncaptured hero: camera glyph on the accent-tinted circle (reuses .clue-emoji). */
.clue-cam{display:flex;align-items:center;justify-content:center}
.clue-cam .icn{width:54px;height:54px}
/* Questy-with-camera hero on photo missions (transparent cut-out, no blend mode). */
.clue-questy{width:auto;height:auto;max-width:84%;max-height:84%;object-fit:contain;display:block}
/* Captured hero: the photo as a rounded square + a tap-to-retake hint. */
.clue-emoji.has-photo{width:auto;max-width:230px;height:auto;border-radius:0;background:none;flex-direction:column;gap:7px;margin:0 auto 12px}
/* Show the WHOLE photo at its natural shape (was a 160px square that cropped tall/wide shots). */
.clue-photo{width:auto;height:auto;max-width:210px;max-height:200px;object-fit:contain;border-radius:18px;cursor:pointer;display:block;box-shadow:0 4px 14px rgba(0,0,0,.18);background:var(--cream-surface)}
.photo-retake-tip{font-size:11px;font-weight:800;color:var(--sub)}
/* Take Photo CTA: centered icon + label (the doneBtn is otherwise space-between). */
#doneBtn .cta-center{display:flex;align-items:center;justify-content:center;gap:8px;margin:0 auto}
#doneBtn .cta-center .icn{width:22px;height:22px}
/* Victory-screen photo gallery (the photos taken this quest), above the share tip. */
.photo-gallery{width:100%}
.pg-title{font-size:13px;font-weight:800;color:var(--ink-dark);text-align:center;margin-bottom:8px;text-shadow:0 0 4px rgba(255,250,238,.92),0 1px 1px rgba(255,250,238,.95)}
.pg-grid{display:flex;flex-wrap:wrap;gap:8px;justify-content:center}
.pg-thumb{width:72px;height:72px;border-radius:12px;overflow:hidden;background:var(--cream-surface);box-shadow:0 2px 8px rgba(0,0,0,.15)}
.pg-thumb img{width:100%;height:100%;object-fit:cover;display:block}

/* ════ ADVENTURE BOOK ════ a parchment journal, distinct from the rest of the UI ════ */
/* Entry point pill on the player-select screen */
.book-btn{align-self:flex-start;display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;background:var(--gold-grad);color:#5B4327;border:2px solid var(--gold-edge);border-radius:50%;cursor:pointer;margin-bottom:6px;box-shadow:0 3px 6px var(--wood-sh);transition:transform .12s}
.book-btn .icn{width:22px;height:22px}
/* Home button — same easy-to-see gold coin as the bookshelf button, used on every screen. */
.home-btn{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;background:var(--gold-grad);color:#5B4327;border:2px solid var(--gold-edge);border-radius:50%;cursor:pointer;box-shadow:0 0 0 5px rgba(255,250,238,.5),0 3px 8px rgba(60,40,10,.28);transition:transform .12s}
.home-btn .icn{width:22px;height:22px}
.home-btn:active{transform:scale(.92)}
/* Sound on/off — quiet sibling of the book button, parked top-right so a parent can hush it. */
/* Top controls share the gold-coin look so they stand out on the busy painted scenes (was a pale white circle that vanished). */
.mute-btn{position:absolute;top:max(12px,env(safe-area-inset-top,0px));right:14px;z-index:6;display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;background:var(--gold-grad);color:#5B4327;border:2px solid var(--gold-edge);border-radius:50%;cursor:pointer;box-shadow:0 3px 6px var(--wood-sh);transition:transform .12s}
.mute-btn .icn{width:22px;height:22px}
.mute-btn.is-muted{color:#7C6A48;border-color:#B0A078;background:linear-gradient(160deg,#E4D8BE,#C9B68A)}
.mute-btn:active{transform:scale(.92)}
.book-btn:active{transform:scale(.92)}
/* Book screens get a warm parchment page (different feel from the purple app) */
.book-screen{background:#EFE2C4;overflow-y:auto}
.book-head{display:flex;align-items:center;gap:10px;margin-bottom:14px}
.book-back{width:44px;height:44px;border-radius:50%;background:var(--gold-grad);border:2px solid var(--gold-edge);color:#5B4327;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;flex:none;box-shadow:0 3px 6px var(--wood-sh);transition:transform .12s}
.book-back .icn{width:22px;height:22px}
.book-back:active{transform:scale(.92)}
.book-h{font-family:'Fredoka One',cursive;font-size:22px;color:#5B4327;line-height:1.05;display:flex;align-items:center;gap:8px}
.book-sub{font-family:'Caveat',cursive;font-size:17px;font-weight:700;color:#6E5010;margin-top:3px}
.ob-title-emblem{width:30px;height:30px;object-fit:contain;flex:none}
/* Adventure Journal — one scrolling page on the real book frame (9-slice) */
#s-bookpage{padding:0}
#obBody{flex:1;display:flex;flex-direction:column;justify-content:safe center}
.bp-head{display:flex;align-items:center;gap:10px;padding:calc(env(safe-area-inset-top, 0px) + 26px) 14px 10px}
.bp-titlewrap{flex:1;min-width:0;text-align:center}
.bp-titlewrap .book-h{justify-content:center}
#s-bookpage .book-h{color:#3A2810;text-shadow:0 1px 3px rgba(255,248,235,.7);font-size:24px;line-height:1.1;justify-content:center}
.bp-sub{display:flex;align-items:center;justify-content:center;gap:7px;font-family:'Fredoka One',cursive;font-size:13px;color:#4F4128;margin-top:3px;text-shadow:0 1px 3px rgba(255,248,235,.7)}
.bp-sub .leaf{width:15px;height:15px;color:#9CB36A;flex:none}
.bp-sub .leaf-r{transform:scaleX(-1)}
/* slice in % (not px) so it works on any book_frame resolution — the page/cover boundary of the art. */
.spread{margin:4px 8px 18px;border-style:solid;border-width:26px 30px 34px 30px;border-color:transparent;border-image-slice:11.3% 10% 13% 10% fill;border-image-repeat:stretch;background:transparent;color:var(--ink-dark);display:flex;gap:22px;padding:16px 18px 32px}
.page{flex:1;min-width:0;display:flex;flex-direction:column;justify-content:flex-start}
/* Center the left journal entry as one tidy stack so it floats inside the flat page,
   rather than space-between pinning the caption to the curved page bottom. */
.page-l{text-align:center;justify-content:center;gap:6px}
.j-mid{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px}
.j-capwrap{margin-top:0}
.j-date{text-align:center;color:#6E5010;font-size:12px;letter-spacing:.06em;font-weight:800;text-transform:uppercase;margin-top:2px}
.j-div{display:flex;align-items:center;gap:8px;justify-content:center;margin:7px 0 12px}
.j-div span{height:1px;width:56px;background:#C9A86A}
.j-div i{width:5px;height:5px;border-radius:50%;background:#C9A86A}
.j-memo{font-family:'Caveat',cursive;font-weight:700;font-size:21px;line-height:1.2;color:var(--ink-dark);text-align:center;margin:0}
.j-questy{display:flex;flex-direction:column;align-items:center;gap:7px;margin:10px 0 2px}
.j-questy img{width:78px;height:auto;display:block}
/* Questy's spoken bubble inside the book — parchment + handwriting so it lives in the page */
.j-qbubble{position:relative;max-width:282px;background:#FFF7E6;border:2px solid #E3CFA1;border-radius:14px;padding:8px 13px;font-family:'Caveat',cursive;font-weight:700;font-size:17px;line-height:1.24;color:var(--ink-dark);text-align:center;box-shadow:0 3px 9px rgba(120,90,30,.16)}
.j-qbubble::before{content:"";position:absolute;top:-9px;left:50%;transform:translateX(-50%);border:8px solid transparent;border-top:0;border-bottom-color:#E3CFA1}
.j-qbubble::after{content:"";position:absolute;top:-6px;left:50%;transform:translateX(-50%);border:7px solid transparent;border-top:0;border-bottom-color:#FFF7E6}
.j-lbl-c{text-align:center}
.j-flo{position:relative;height:1px;background:#D9C290;margin:14px 6px 11px}
.j-flo::before{content:"";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:6px;height:6px;border-radius:50%;background:#C9A86A}
.j-lbl{font-family:'Fredoka One',cursive;font-size:13px;color:#8A7038;margin:0 0 10px}
.j-photos{display:flex;gap:10px;flex-wrap:wrap;justify-content:center}
/* Snapshots tucked onto the left page under Questy — smaller taped polaroids, diary-style. */
.j-snaps{display:flex;flex-wrap:wrap;gap:9px 11px;justify-content:center;margin:13px 2px 2px}
.j-snaps .j-photo{padding:5px 5px 13px}
.j-snaps .j-photo img{width:84px;height:64px}
.j-photo{background:#fff;padding:6px 6px 15px;border-radius:4px;border:1px solid #E3D4AD;position:relative;box-shadow:0 2px 6px rgba(80,55,15,.12)}
.j-photo img{display:block;width:104px;height:80px;object-fit:cover;border-radius:2px;background:#CDBD98}
.j-photo.tilt-a{transform:rotate(-3deg)}
.j-photo.tilt-b{transform:rotate(2.5deg)}
.j-tape{position:absolute;top:-7px;left:50%;transform:translateX(-50%) rotate(-2deg);width:44px;height:13px;background:rgba(214,196,150,.6);border-radius:2px}
.j-cap{font-family:'Caveat',cursive;font-weight:700;font-size:18px;color:#5E4D2E;text-align:center;display:flex;align-items:center;gap:6px;justify-content:center;flex-wrap:wrap}
.j-cap .icn{width:14px;height:14px;color:#C2553B}
.j-chips{display:flex;gap:10px;flex-wrap:wrap;justify-content:center}
.j-chip{width:52px;height:52px;border-radius:12px;background:#fff;border:1px solid #E3D4AD;display:flex;align-items:center;justify-content:center;box-shadow:0 2px 6px rgba(80,55,15,.1)}
.j-chip img{width:36px;height:36px;object-fit:contain}
.j-tab{display:inline-block;font-family:'Fredoka One',cursive;font-size:11px;color:#8A5A1E;background:var(--cream-surface);border:1px solid #D9BE84;border-radius:6px;padding:2px 10px;margin-bottom:6px}
.j-fact p{font-family:'Caveat',cursive;font-weight:600;font-size:18px;line-height:1.35;color:var(--ink-dark);margin:0}
.j-fdiv{border-top:1px dashed #D2BA86;margin:14px 0}
.j-nav{display:flex;align-items:center;justify-content:center;gap:16px;margin:16px 0 8px}
.j-navb{width:44px;height:44px;border-radius:50%;background:var(--gold-grad);border:2px solid var(--gold-edge);color:var(--ink-dark);display:inline-flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 3px 6px var(--wood-sh);transition:transform .12s}
.j-navb:active{transform:scale(.92)}
.j-navb .icn{width:22px;height:22px}
.j-navb.is-dis{opacity:.4;pointer-events:none}
.j-count{font-family:'Fredoka One',cursive;font-size:13px;color:#6E5C3C}
.j-pager{display:inline-flex;flex-direction:column;align-items:center;gap:5px;background:var(--cream-surface);border:1px solid #E0CFA0;border-radius:14px;padding:7px 22px;box-shadow:0 2px 5px rgba(80,55,15,.12)}
.j-dots{display:flex;gap:6px}
.j-dot{width:8px;height:8px;border-radius:50%;background:#D9C28C}
.j-dot.on{background:#7C5A2E}
.leaf-r{transform:scaleX(-1)}
.below-lbl{display:flex;align-items:center;justify-content:center;gap:8px;font-family:'Fredoka One',cursive;font-size:15px;color:#6E5C3C;margin:16px 0 12px}
.below-lbl .leaf{width:16px;height:16px;color:#9CB36A;flex:none}
.j-below{padding:6px 14px 10px;text-align:center}
.tray{position:relative;width:100%;max-width:330px;margin:0 auto}
.tray-bg{display:block;width:100%}
.tray-items{position:absolute;left:9%;right:9%;top:17%;bottom:16%;display:flex;align-items:center}
/* Each treasure gets an equal third of the tray and is centered in it, so the slots
   are perfectly even regardless of each emblem's shape. Size by height so a tall
   hourglass and a wide star read at a balanced scale. */
.tray-cell{flex:1 1 0;min-width:0;display:flex;align-items:center;justify-content:center}
.tray-emblem{width:auto;height:auto;max-width:84%;max-height:92%;object-fit:contain;filter:drop-shadow(0 3px 4px rgba(60,35,10,.35))}
/* Distribute the keepsake down the page (banner top -> crest/photos middle -> sign-off bottom) instead of clumping it dead-centre, which left the top of the page empty. */
.disc-wrap{flex:1;display:flex;flex-direction:column;justify-content:space-between;gap:6px;text-align:center}
/* Both pages center their (now balanced, short) keepsake content so neither side looks empty. */
.page-r{justify-content:center}
.disc-body{margin:auto 0;width:100%}
.disc-banner{display:block;width:fit-content;max-width:96%;margin:2px auto 0;background:linear-gradient(180deg,var(--gold),var(--gold-deep));color:var(--ink-dark);font-family:'Fredoka One',cursive;font-size:14px;padding:7px 18px;text-align:center;box-shadow:0 2px 5px rgba(80,55,15,.22);clip-path:polygon(0 0,100% 0,94% 50%,100% 100%,0 100%,6% 50%);transform:rotate(-2deg)}
/* On phones the two-page book is too narrow for the discovery list — stack to one column. */
@media (max-width:560px){
  /* Phone: KEEP the real illustrated book frame, but drop only the center "fill" slice so the
     painted center spine is gone — the book's cover/edges/corners still draw, and a parchment
     background fills the page behind the single stacked column. Book look, no spine through text. */
  /* Phone keeps the TWO-PAGE spread (not a stacked column): the book_frame `fill` paints both
     parchment pages. The book stays a normal fixed shape because BOTH pages hold only light content
     (diary left; banner+count+crest+sign-off right) — the fun facts render full-width BELOW the book.
     The book_frame PNG's outer light rim was erased at the source, so no clip-path is needed. */
  .spread{gap:5px;border-image-slice:11.3% 10% 13% 10% fill;border-width:15px 14px 21px 14px;background:transparent;padding:11px 7px 18px;margin:4px 2px 16px}
  .spread .page{min-width:0}
  /* keep content off the center gold ribbon — pad each page's inner (spine-side) edge */
  .page-l,.page-r{gap:4px}
  .page-l{padding-right:11px}
  .page-r{padding-left:11px}
  .j-date{font-size:9.5px}
  .j-div span{width:34px}
  .j-memo{font-size:15px;line-height:1.16}
  .j-questy img{width:50px}
  .j-qbubble{font-size:14px;max-width:none;padding:7px 10px;line-height:1.25}
  .j-cap{font-size:13px}
  .disc-banner{font-size:10.5px;padding:4px 10px}
  .disc-count{font-size:15px;margin:8px 0 5px}
  .j-crest img{width:48px;height:48px}
  .j-crest span{font-size:9px}
  .j-snaps .j-photo img{width:62px;height:48px}
  .page-l{justify-content:flex-start}
}
.disc-spark{color:#C9A86A;margin:14px 0 8px;opacity:.7}
.disc-spark .icn{width:34px;height:34px;fill:#E7CF8C;stroke:#C9A86A;stroke-width:1.2}
.disc-doodle{display:block;width:64px;height:auto;margin:14px auto 8px;opacity:.85}
.disc-text{display:block;font-family:'Caveat',cursive;font-weight:600;font-size:19px;line-height:1.5;color:var(--ink-dark);text-align:center}
.disc-empty{font-family:'Caveat',cursive;font-weight:600;font-size:17px;color:#7C6A48;text-align:center;margin-top:16px}
/* Bookshelf: the painted shelf scene is the stage; books are placed on the ledges */
/* Bookshelf screen: the painted scene fills the whole screen, buttons overlaid on it */
/* NO display here — .screen{display:none}/.screen.active{display:flex} must control visibility, or
   the bookshelf shows on every screen. justify-content/bg only apply when active (flex). */
#s-book{position:relative;padding:0;overflow:hidden;justify-content:center;background:#6E4A26}
#s-book .book-head{position:absolute;top:0;left:0;right:0;z-index:3;justify-content:space-between;margin:0;padding:calc(env(safe-area-inset-top,0px) + 14px) 16px 14px}
/* The shelf is a real <img> (not a background) so the books pin to the IMAGE, not the screen box —
   no status-bar/crop ambiguity. SHELF_SLOTS in app.js are % of this image's plank tops. */
.bookshelf{position:relative;width:100%;line-height:0}
.bookshelf .shelf-img{display:block;width:100%;height:auto}
/* ── Collection system: journal note, world crest, artifact grid, discovery map, passport ── */
.j-note{font-family:'Caveat',cursive;font-weight:700;font-size:16px;color:#8A7038;text-align:center;margin:2px 0 0}
.j-crest{display:flex;flex-direction:column;align-items:center;gap:2px;margin:6px 0 2px}
.j-crest img{width:76px;height:76px;object-fit:contain;filter:drop-shadow(0 3px 5px rgba(80,55,15,.35))}
.j-crest span{font-family:'Fredoka One',cursive;font-size:11px;color:#6E5010;letter-spacing:.04em}
/* discovery exhibit — a dashed-separated list on the right page (matches the journal mockup) */
.disc-count{font-family:'Caveat',cursive;font-weight:700;font-style:italic;font-size:18px;line-height:1.25;color:#6E5010;text-align:center;margin:10px 0 4px}
.disc-list{display:flex;flex-direction:column;text-align:left}
/* Discoveries gallery below the book — a readable, full-width cream "leaf" of artifact cards. */
/* Discoveries read as field notes taped onto the page, not a boxed widget: no border/shadow,
   just a faint parchment wash so the ink stays legible over the wall behind. */
.disc-gallery{max-width:400px;margin:0 auto;background:rgba(255,248,233,.6);border:none;border-radius:10px;padding:2px 16px;box-shadow:none;text-align:left}
.art-card{position:relative;display:flex;gap:11px;align-items:center;text-align:left;padding:11px 2px;border-bottom:1.5px dashed #D9C49A;opacity:0;transform:translateY(6px);animation:artIn .32s ease forwards;animation-delay:var(--ad,0ms)}
.art-card:last-child{border-bottom:none}
@keyframes artIn{to{opacity:1;transform:none}}
/* Fresh trip: each discovery lands in the book with a little pop + gold glow that settles. */
.art-card.is-new{animation:artLand 1.25s ease forwards;animation-delay:var(--ad,0ms)}
@keyframes artLand{
  0%{opacity:0;transform:translateY(10px) scale(.93)}
  16%{opacity:1;transform:translateY(0) scale(1.05)}
  34%{transform:scale(1)}
  56%{box-shadow:0 0 16px 3px rgba(231,164,30,.5)}
  100%{opacity:1;transform:none;box-shadow:0 0 0 0 rgba(231,164,30,0)}
}
/* Doodle sits DIRECTLY on the page (no box/border/fill) — just the transparent PNG, with a
   whisper of shadow so it reads like ink on the paper instead of a flat paste-in. */
.art-img{flex:none;width:52px;height:52px;display:flex;align-items:center;justify-content:center}
.art-img img{width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 1px 2px rgba(80,55,15,.22))}
.art-txt{flex:1;min-width:0}
.art-name{font-family:'Fredoka One',cursive;font-size:14px;color:#5B4327;line-height:1.12}
/* Ownership stamp: "<Name> discovered" — makes the fact below feel like the child's own find */
.art-by{font-family:'Fredoka One',cursive;font-size:11px;color:#A06D1A;line-height:1.1;margin-top:3px}
.art-note{font-family:'Caveat',cursive;font-weight:600;font-size:16px;line-height:1.28;color:var(--ink-dark);margin-top:2px;overflow-wrap:break-word}
/* green rubber-stamp "RARE FIND" — floats in the corner so it never crushes the note text */
.art-rare{position:absolute;top:6px;right:0;width:30px;text-align:center;font-family:'Fredoka One',cursive;font-size:8px;line-height:1.08;letter-spacing:.03em;text-transform:uppercase;color:var(--gold-edge);border:2px solid var(--gold-deep);border-radius:6px;padding:3px 2px;background:rgba(255,250,235,.55);transform:rotate(-7deg);opacity:.92}
.art-card.rare .art-name{padding-right:34px}
/* discovery map (collection progress + named silhouettes) */
.map-prog{max-width:300px;margin:0 auto 12px}
.map-prog-lbl{display:block;font-family:'Fredoka One',cursive;font-size:12px;color:#6E5C3C;margin-bottom:5px}
.map-prog-bar{height:9px;border-radius:6px;background:#E8D9B4;overflow:hidden;box-shadow:inset 0 1px 2px rgba(80,55,15,.18)}
.map-prog-bar span{display:block;height:100%;border-radius:6px;background:linear-gradient(90deg,var(--gold),var(--gold-deep));transition:width .5s ease}
.map-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(64px,1fr));gap:10px 8px;max-width:360px;margin:0 auto}
.map-slot{display:flex;flex-direction:column;align-items:center;gap:4px}
.map-img{position:relative;width:54px;height:54px;border-radius:12px;background:#FBF4E0;border:1px solid #E3D4AD;display:flex;align-items:center;justify-content:center;overflow:hidden}
.map-img img{width:100%;height:100%;object-fit:contain}
.map-slot:not(.got) .map-img img{filter:grayscale(1) brightness(.45) opacity(.55)}
.map-slot:not(.got) .map-img{background:#EadFc6}
.map-q{position:absolute;font-family:'Fredoka One',cursive;font-size:22px;color:#B6A57E}
.map-name{font-family:'Nunito',sans-serif;font-weight:800;font-size:10px;line-height:1.05;color:#6E5C3C;text-align:center;max-width:70px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.map-slot:not(.got) .map-name{color:#A8966E}
.map-slot.got .map-img{box-shadow:0 2px 6px rgba(80,55,15,.18)}
/* bookshelf view toggle */
.bookview-toggle{display:inline-flex;background:rgba(255,250,235,.85);border:2px solid var(--gold-edge);border-radius:999px;padding:3px;gap:2px;box-shadow:0 2px 6px var(--wood-sh)}
.bv-tab{border:none;background:none;font-family:'Fredoka One',cursive;font-size:12px;color:#8A6A2E;padding:5px 14px;border-radius:999px;cursor:pointer;transition:all .15s}
.bv-tab.on{background:var(--gold-grad);color:#5B4327;box-shadow:0 1px 3px var(--wood-sh)}
/* passport view */
.bookshelf.passport-mode{position:absolute;inset:0;overflow-y:auto;background:#EFE2C4}
.pass-wrap{padding:calc(env(safe-area-inset-top,0px) + 64px) 16px 28px}
.pass-head{text-align:center;margin-bottom:16px}
.pass-title{font-family:'Fredoka One',cursive;font-size:22px;color:#5B4327;margin:0}
.pass-sub{font-family:'Nunito',sans-serif;font-weight:800;font-size:13px;color:#6E5010;margin:2px 0 0}
.pass-filter{display:flex;flex-wrap:wrap;gap:7px;justify-content:center;margin:0 auto 18px;max-width:440px}
.pf-chip{background:rgba(255,255,255,.55);border:2px solid var(--bdr);border-radius:999px;padding:7px 15px;font-family:'Nunito',sans-serif;font-weight:800;font-size:13px;color:var(--ink-dark);cursor:pointer;transition:transform .12s,background .15s}
.pf-chip.on{background:var(--gold-grad);border-color:var(--gold-edge);color:var(--ink-dark)}
.pf-chip:active{transform:scale(.94)}
.pass-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(96px,1fr));gap:14px 10px;max-width:440px;margin:0 auto}
.pass-cell{display:flex;flex-direction:column;align-items:center;gap:6px;background:none;border:none;padding:0;cursor:pointer}
.pass-cell[disabled]{cursor:default}
.pass-crest{position:relative;width:74px;height:74px;border-radius:50%;background:rgba(255,255,255,.6);border:2.5px solid var(--gold-edge);display:flex;align-items:center;justify-content:center;overflow:hidden;box-shadow:0 3px 7px var(--wood-sh)}
.pass-crest img{width:78%;height:78%;object-fit:contain}
.pass-cell:not(.got) .pass-crest{border-color:#C9B68A;background:#E3D4AD}
.pass-cell:not(.got) .pass-crest img{filter:grayscale(1) brightness(.5) opacity(.4)}
.pass-lock{position:absolute;font-family:'Fredoka One',cursive;font-size:28px;color:#9A875E}
.pass-cell.got:active{transform:scale(.95)}
.pass-name{font-family:'Nunito',sans-serif;font-weight:800;font-size:11px;line-height:1.1;color:#5B4327;text-align:center;max-width:96px}
.pass-cell:not(.got) .pass-name{color:#9A875E}
.stage-book{position:absolute;transform:translateX(-50%);height:13%;border:none;background:none;padding:0;cursor:pointer;transition:transform .14s}
.stage-book:hover{transform:translateX(-50%) translateY(-4px)}
.stage-book:active{transform:translateX(-50%) scale(.95)}
.stage-cover{height:100%;width:auto;display:block;filter:drop-shadow(0 6px 6px rgba(30,18,5,.5))}
.stage-book .sb-emblem{position:absolute;top:27%;left:50%;transform:translate(-50%,-50%);width:30%;aspect-ratio:1/1;object-fit:contain}
.stage-book .sb-title{position:absolute;top:75.5%;left:50%;transform:translate(-50%,-50%);width:82%;font-family:'Fredoka One',cursive;font-size:9.5px;line-height:1.05;color:#3A2A14;text-align:center;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
/* "More to discover" slot — starts a new adventure */
.stage-locked{position:absolute;transform:translateX(-50%);height:15%;aspect-ratio:300/402;border:2px dashed rgba(255,244,214,.65);border-radius:5px 8px 8px 5px;background:rgba(40,26,10,.2);display:flex;align-items:center;justify-content:center;cursor:pointer;transition:transform .14s}
.stage-locked .sl-inner{display:flex;flex-direction:column;align-items:center;gap:4px;padding:0 6px}
.stage-locked .sl-note{font-family:'Fredoka One',cursive;font-size:9px;line-height:1.12;color:#FBEFD3;text-align:center;text-shadow:0 1px 2px rgba(40,26,10,.5)}
/* Quiet ghost placeholders for empty shelf slots — a collection-in-progress, not a void */
.stage-ghost{position:absolute;transform:translateX(-50%);height:13%;aspect-ratio:300/402;border:2px dashed rgba(255,244,214,.26);border-radius:5px 8px 8px 5px;background:rgba(40,26,10,.10);pointer-events:none}
.stage-locked:hover{transform:translateX(-50%) translateY(-4px)}
.stage-locked .icn{width:46%;max-width:30px;color:#FBEFD3}
/* Title written on the top shelf */
.stage-title{position:absolute;top:8%;left:50%;transform:translateX(-50%);width:max-content;max-width:92%;text-align:center;pointer-events:none;background:var(--cream-mist);border-radius:var(--radius-lg);padding:9px 20px 11px;box-shadow:0 4px 14px rgba(60,40,10,.2);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}
.st-h{font-family:'Fredoka One',cursive;font-size:23px;color:#5B4327;line-height:1.05;margin:0;text-shadow:0 1px 2px rgba(255,250,235,.65)}
.st-sub{font-family:'Caveat',cursive;font-size:16px;font-weight:700;color:#6E5010;margin:3px 0 0;text-shadow:0 1px 2px rgba(255,250,235,.65)}
/* Empty-state Questy + CTA sit on the lower shelves, below the title */
.stage-empty{position:absolute;left:7%;right:7%;top:40%;display:flex;flex-direction:column;align-items:center;text-align:center;gap:7px}
.be-fig img{width:84px;height:auto;filter:drop-shadow(0 4px 10px rgba(0,0,0,.4))}
.be-text{font-family:'Caveat',cursive;font-size:18px;font-weight:700;color:#6A4E2A;line-height:1.2;margin:0;max-width:250px;text-shadow:0 1px 2px rgba(255,255,255,.55)}
.be-cta{max-width:240px;margin-top:8px}
/* Bookshelf pagination (6 books per page) */
.book-nav{position:absolute;bottom:14px;left:0;right:0;z-index:3;display:flex;align-items:center;justify-content:center;gap:14px;margin:0}
.book-nav-btn{width:44px;height:44px;border-radius:50%;border:2px solid var(--gold-edge);background:var(--gold-grad);color:#5B4327;display:flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 3px 6px var(--wood-sh);transition:transform .12s}
.book-nav-btn .icn{width:22px;height:22px}
.book-nav-btn:active{transform:scale(.92)}
.book-nav-btn.is-dis{opacity:.4;pointer-events:none}
.book-nav-lbl{font-family:'Fredoka One',cursive;font-size:14px;color:#7C6A48;min-width:96px;text-align:center}
/* Opened book — a two-page spread: memory on the left page, photos on the right */
.ob-spread{position:relative;width:100%;max-width:430px;margin:0 auto 14px}
.ob-book-img{width:100%;height:auto;display:block}
/* Book-as-hero: the memory written across the open book */
.ob-hero{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:12% 17%;gap:6px}
.ob-date2{font-family:'Caveat',cursive;font-size:13px;font-weight:700;color:#6E5010;transform:rotate(-2deg)}
.ob-memo-hand{font-family:'Caveat',cursive;font-size:18px;font-weight:700;color:#5B4327;line-height:1.18;margin:0;max-width:96%;overflow-wrap:break-word}
.ob-q-mini{width:40px;height:auto;transform:rotate(-4deg)}
/* Polaroid photos in a row below the book */
.ob-photo-row{display:flex;flex-wrap:wrap;justify-content:center;gap:12px;margin:6px 0 14px}
.ob-photo{width:88px;background:#fff;border-radius:5px;padding:5px 5px 11px;box-shadow:0 4px 9px rgba(60,40,15,.3);position:relative}
.ob-photo img{width:100%;height:62px;object-fit:cover;border-radius:3px;display:block}
.ob-photo:nth-child(odd){transform:rotate(-3deg)}.ob-photo:nth-child(even){transform:rotate(3deg)}
.ob-photo .ob-tape{position:absolute;top:-7px;left:50%;transform:translateX(-50%) rotate(-4deg);width:30px;height:13px;background:rgba(231,180,62,.55);border:1px solid rgba(231,180,62,.6);border-radius:2px}
.ob-lbl{font-family:'Fredoka One',cursive;font-size:12px;color:#8A6A37}
.ob-collect{display:flex;gap:9px;margin:6px 0}
.ob-st{width:48px;height:48px;border-radius:11px;background:var(--cream-surface);border:2px solid #D9B458;display:flex;align-items:center;justify-content:center;box-shadow:0 2px 5px rgba(80,55,15,.15)}
.ob-st img{width:32px;height:32px;object-fit:contain}
/* Discovery facts as little taped paper notes */
.ob-note{position:relative;background:#FFF7DB;border:1px solid #E7CE86;border-radius:8px;padding:12px 12px 10px;font-family:'Caveat',cursive;font-size:18px;font-weight:700;color:#6A4E2A;line-height:1.2;margin:0 4px 14px;box-shadow:0 3px 7px rgba(60,40,15,.18);transform:rotate(-0.6deg)}
.ob-note .ob-lbl{display:block;font-size:11px;margin-bottom:2px}
.ob-note-tape{position:absolute;top:-8px;left:50%;transform:translateX(-50%) rotate(-3deg);width:46px;height:15px;background:rgba(231,180,62,.45);border:1px solid rgba(231,180,62,.5);border-radius:2px}
.ob-turn{display:flex;justify-content:space-between;margin-top:10px}
.ob-turn-btn{display:inline-flex;align-items:center;gap:5px;background:var(--cream-surface);border:2px solid rgba(150,115,55,.3);border-radius:var(--radius-sm);padding:8px 12px;font-family:'Fredoka One',cursive;font-size:13px;color:#6A4E2A;cursor:pointer;transition:transform .12s}
.ob-turn-btn .icn{width:16px;height:16px}
.ob-turn-btn:active{transform:scale(.96)}
.ob-turn-btn.is-dis{opacity:.4;pointer-events:none}
/* ── DISCOVERY MAP (dedicated screen) ───────────────────────────────────── */
#s-discovery{padding:0;background-color:#EFE2C4;overflow-y:auto;min-height:100dvh;position:relative}
/* Scene art lives on a FIXED viewport-sized layer, not on the scrolling element — otherwise the
   image scales up to cover the whole tall scroll height and looks zoomed in. JS sets --dm-bg. */
#s-discovery::before{content:"";position:fixed;inset:0;z-index:0;background-image:var(--dm-bg,none);background-size:cover;background-position:center top;background-repeat:no-repeat;pointer-events:none}
#s-discovery>*:not(.amb){position:relative;z-index:1}
#s-discovery .dm-bar-head{position:relative;margin:0;padding:calc(env(safe-area-inset-top,0px) + 12px) 16px 0}
.dm-body{padding:2px 16px 30px;max-width:600px;margin:0 auto;width:100%;box-sizing:border-box}
/* ── Cohesion scrims: keep UI readable over the illustrated scene backgrounds (a soft cream
   gradient veil is also baked into each scene's background in setBg()). ── */
.bg-scene .sh{background:rgba(255,250,238,.88);border:1.5px solid rgba(255,255,255,.6);border-radius:16px;padding:9px 14px 10px;margin-bottom:10px;box-shadow:0 4px 14px rgba(60,40,10,.22);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}
.bg-scene .sh h2{font-size:23px;line-height:1.1}
.bg-scene .room-hint,.bg-scene .fl-hint{background:rgba(255,250,238,.82);border-radius:12px;padding:5px 12px;box-shadow:0 2px 8px rgba(60,40,10,.15)}
.bg-scene .setup-back-top{background:rgba(255,250,238,.82);border-radius:11px;padding:5px 10px 5px 8px;box-shadow:0 2px 8px rgba(60,40,10,.14)}
.bg-scene .dm-head{background:rgba(255,250,238,.88);border-radius:16px;padding:10px 16px;box-shadow:0 4px 14px rgba(60,40,10,.22);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}
/* Loose / ghost interactive elements get a faint plate so they read on busy scenes */
.bg-scene .setup-more{background:rgba(255,250,238,.80);border-color:rgba(91,33,182,.5)}
.bg-scene .gh{background:rgba(255,250,238,.78)}
.bg-scene .setup-dot:not(.on){background:rgba(91,33,182,.30)}
.bg-scene .setup-back-top{text-shadow:0 1px 3px rgba(255,250,238,.95)}
/* Corner icon buttons get a soft cream halo so they separate from the scene */
.bg-scene .book-btn,.bg-scene .mute-btn{box-shadow:0 0 0 5px rgba(255,250,238,.5),0 3px 8px rgba(60,40,10,.25)}
/* Purple CTAs get a faint cream ring so they never edge-merge with purple scenery */
.bg-scene .btn-p{box-shadow:0 6px 22px rgba(91,33,182,.30),0 0 0 4px rgba(255,250,238,.42)}
/* Victory secondary pills + the orange primary CTA: seat them over the busy cottage band */
.bg-scene .v-sec{border-color:rgba(124,106,72,.5);box-shadow:0 3px 12px rgba(40,20,10,.24)}
.bg-scene .btn-again{box-shadow:0 6px 22px rgba(91,33,182,.30),0 0 0 4px rgba(255,250,238,.42)}
/* Age cards: deeper shadow so the gaps read as shadow, not as bright background leaking through */
.bg-scene .age-card{box-shadow:0 4px 16px rgba(60,40,10,.28)}
/* Warm the white cards on scene screens so they harmonize with the vibrant art instead of reading as
   cold paper. The hunt card (.cc) stays #fff because its .clue-img uses mix-blend-mode:multiply. */
.bg-scene .char-card,.bg-scene .ni,.bg-scene .rc,.bg-scene .age-card,.bg-scene .tc{background:#FBF4E4}
/* keep the SELECTED fill (the warm override above ties on specificity + would otherwise win by order) */
.bg-scene .rc.sel{background:#F7EFD6}
.bg-scene .char-card.char-sel{background:#F7EFD6}
.bg-scene .questy-bubble{background:#FBF4E4}
.bg-scene .questy-fig + .questy-bubble::after{border-right-color:#FBF4E4}
/* Setup is a form first: lay a cream wash over the whole scene (above the art, below the content via
   z-index:-1) so every floating label/hint stays readable over the busy house background. */
#s-setup.bg-scene::before{content:"";position:absolute;inset:0;background:rgba(252,247,233,.52);pointer-events:none;z-index:-1}
#s-setup .fl,#s-setup .fl-hint,#s-setup .color-pick{text-shadow:0 1px 2px rgba(255,250,238,.92)}
/* Visual room picker — tap rooms on the illustrated house. Hotspots are transparent zones over the
   art; selected rooms get a purple glow + a gold check. .zones-debug outlines zones for alignment. */
/* Rooms step: the house map stands alone on a calm parchment (the setup-house scene is removed so it
   isn't a busy background behind another house). The wash pseudo is unneeded here. */
/* Setup uses a calm parchment (no busy scene behind the form). White cards read as a clean tray. */
#s-setup{background:linear-gradient(180deg,#F6EDD6,#E9DAB6)}
/* Brown wood hue matching the house-map border so the map blends into the background (no card edge). */
#s-setup.rooms-step{background-image:none!important;background:linear-gradient(180deg,#8C5C2C,#6A3D12)}
#s-setup.rooms-step::before{display:none}
.house-map{position:relative;width:100%;max-width:460px;margin:2px auto 14px;border-radius:18px;overflow:hidden;box-shadow:0 8px 24px rgba(60,40,10,.34);line-height:0}
.house-map-img{width:100%;height:auto;display:block}
.room-hot{position:absolute;border:none;background:transparent;padding:0;margin:0;cursor:pointer;-webkit-tap-highlight-color:transparent}
.room-hot:active{transform:scale(.96)}
/* Chosen rooms show ONLY a gold checkmark (no fill/outline). Nothing on unchosen rooms. */
.rh-check{position:absolute;top:7px;right:7px;width:40px;height:40px;border-radius:50%;background:var(--gold-grad);color:#3A2A14;display:none;align-items:center;justify-content:center;box-shadow:0 2px 8px rgba(0,0,0,.5),0 0 0 3px rgba(255,255,255,.7);z-index:1}
/* Backyard is a tall garden zone; drop its check down to sit over the room (near its label). */
.room-hot[data-room="backyard"] .rh-check{top:auto;bottom:24%}
.room-hot.sel .rh-check{display:flex}
.rh-check .icn{width:22px;height:22px;stroke-width:3.2}
/* Rooms step: strip the redundant chrome so the house map dominates the page (checkmarks big + prominent). */
#s-setup.rooms-step .sh{margin-bottom:6px}
#s-setup.rooms-step .sh p{display:none}
#s-setup.rooms-step .setup-dots{margin:0 0 6px}
#s-setup.rooms-step .setup-back-top{min-height:34px;padding:4px 8px 4px 2px;margin-bottom:2px}
#s-setup.rooms-step #questySetup2{margin:0 auto 6px;gap:8px}
#s-setup.rooms-step #questySetup2 .questy-img{width:46px}
#s-setup.rooms-step .row2{margin-bottom:8px}
#s-setup.rooms-step .house-map{margin-top:0}
.house-map.zones-debug .room-hot{outline:2px dashed rgba(124,58,237,.85);background:rgba(124,58,237,.10)}
/* Discovery: plate the one un-paneled line + give the grid room to clear the corner props */
.bg-scene .dm-questy{background:rgba(255,250,235,.72);border-radius:12px;padding:5px 12px;display:inline-block}
.bg-scene .dm-body{padding-bottom:60px}
.dm-head{text-align:center;margin:0 0 12px}
.dm-title{font-family:'Fredoka One',cursive;font-size:28px;color:var(--ink-dark);margin:0;text-shadow:0 1px 2px rgba(255,250,235,.6)}
.dm-sub{font-family:'Nunito',sans-serif;font-weight:800;font-size:14px;color:var(--pl);margin:2px 0 0}
.dm-sub b{color:var(--pri)}
.dm-progrow{display:flex;align-items:center;gap:12px;margin:0 0 16px}
.dm-bar{position:relative;flex:1;height:14px;border-radius:9px;background:#E8D9B4;box-shadow:inset 0 1px 3px rgba(80,55,15,.22)}
.dm-fill{position:absolute;left:0;top:0;bottom:0;border-radius:9px;background:linear-gradient(90deg,var(--pl),var(--pri));transition:width .5s ease}
.dm-star{position:absolute;top:50%;transform:translate(-50%,-50%);width:28px;height:28px;color:var(--gold);filter:drop-shadow(0 1px 2px rgba(80,55,15,.45))}
.dm-star svg{width:100%;height:100%}
.dm-found{flex:none;background:rgba(255,250,235,.9);border:2px solid var(--gold-edge);border-radius:12px;padding:5px 13px;text-align:center;box-shadow:0 2px 6px var(--wood-sh)}
.dm-found b{display:block;font-family:'Fredoka One',cursive;font-size:18px;color:var(--pri)}
.dm-found span{font-family:'Nunito',sans-serif;font-weight:800;font-size:11px;color:#7C6A48}
.dm-medals{display:flex;justify-content:center;gap:16px;flex-wrap:wrap;margin:0 0 18px}
.dm-medal{display:flex;align-items:center;gap:7px;opacity:.58;transition:opacity .2s}
.bg-scene .dm-medals{background:rgba(255,250,238,.55);border-radius:14px;padding:8px 10px}
.dm-medal.on{opacity:1}
.dm-coin{flex:none;width:36px;height:36px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff;box-shadow:0 2px 5px var(--wood-sh)}
.dm-coin svg{width:18px;height:18px}
.dm-coin.bronze{background:linear-gradient(160deg,#D89B5A,#9A5A2A)}
.dm-coin.silver{background:linear-gradient(160deg,#DEDEE6,#9AA0AA)}
.dm-coin.gold{background:var(--gold-grad);border:2px solid var(--pl)}
.dm-mtxt b{display:block;font-family:'Fredoka One',cursive;font-size:14px;color:#5B4327;line-height:1}
.dm-mtxt span{font-family:'Nunito',sans-serif;font-weight:800;font-size:10px;color:#7C6A48}
.dm-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:11px 6px}
.dm-slot{display:flex;flex-direction:column;align-items:center;gap:5px}
.dm-tile{position:relative;width:100%;aspect-ratio:1/1;border-radius:14px;background:rgba(255,250,235,.5);border:2px solid #D9C9A0;display:flex;align-items:center;justify-content:center;overflow:hidden;box-shadow:0 2px 5px rgba(80,55,15,.12)}
/* Found discoveries sit DIRECTLY on the map (no frame), like the journal doodles. The gold
   star badge + name still mark them as earned. Locked tiles keep their mystery box. */
.dm-slot.got .dm-tile{background:transparent;border-color:transparent;box-shadow:none;overflow:visible}
.dm-tile img{width:78%;height:78%;object-fit:contain}
.dm-slot.got .dm-tile img{width:92%;height:92%;filter:drop-shadow(0 2px 3px rgba(80,55,15,.28))}
/* Recognizable grey silhouette (not a near-black blob) so a child can tell what they're hunting. */
.dm-slot:not(.got) .dm-tile img{filter:grayscale(1) brightness(.62) opacity(.55)}
/* Room sections: each is a small, winnable mini-collection. */
.dm-room{display:flex;align-items:center;gap:9px;margin:18px 2px 9px}
.dm-room-name{font-family:'Fredoka One',cursive;font-size:16px;color:#5B4327;text-shadow:0 1px 2px rgba(255,250,235,.7)}
.dm-room-count{font-family:'Nunito',sans-serif;font-weight:800;font-size:11px;color:#8A6A37;background:rgba(255,250,235,.85);border:1.5px solid var(--gold-edge);border-radius:10px;padding:2px 9px}
.dm-room-stamp{margin-left:auto;font-family:'Fredoka One',cursive;font-size:12px;color:#5E8B3A;border:2px solid #5E8B3A;border-radius:8px;padding:2px 9px;transform:rotate(-4deg);background:rgba(244,255,240,.8);box-shadow:0 1px 3px rgba(80,55,15,.18)}
.dm-room-done .dm-room-name{color:#5E8B3A}
/* New finds land with a pop + a gold NEW flag. */
@keyframes dmLand{0%{transform:scale(.3);opacity:0}55%{transform:scale(1.2)}100%{transform:scale(1);opacity:1}}
.dm-slot.dm-new .dm-tile{animation:dmLand .55s cubic-bezier(.2,1.5,.5,1) both}
.dm-newflag{position:absolute;top:-5px;right:-4px;background:linear-gradient(135deg,var(--gold),var(--gold-deep));color:#fff;font-family:'Nunito',sans-serif;font-weight:900;font-size:8px;letter-spacing:.03em;padding:2px 5px;border-radius:7px;box-shadow:0 1px 4px rgba(0,0,0,.3);transform:rotate(8deg)}
@media (prefers-reduced-motion:reduce){.dm-slot.dm-new .dm-tile{animation:none}}
.dm-questy-host{margin:4px 0 14px}
.dm-q{position:absolute;font-family:'Fredoka One',cursive;font-size:26px;color:#B6A57E}
.dm-lock{position:absolute;right:5px;bottom:5px;width:19px;height:19px;color:#9A875E;background:rgba(255,250,235,.92);border-radius:5px;padding:2px;box-sizing:border-box}
.dm-lock svg{width:100%;height:100%}
.dm-badge{position:absolute;left:5px;bottom:5px;width:21px;height:21px;color:var(--gold);filter:drop-shadow(0 1px 1px rgba(80,55,15,.45))}
.dm-badge svg{width:100%;height:100%}
.dm-label{font-family:'Nunito',sans-serif;font-weight:800;font-size:11px;line-height:1.15;color:var(--ink-dark);text-align:center;max-width:100%;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;word-break:break-word}
.dm-label.dm-hidden{color:#B6A57E}
/* journal button that opens the map */
.disc-map-btn{display:flex;align-items:center;gap:9px;width:100%;max-width:360px;margin:2px auto 14px;background:var(--gold-grad);border:2px solid var(--gold-edge);border-radius:14px;padding:13px 16px;font-family:'Fredoka One',cursive;font-size:15px;color:#5B4327;cursor:pointer;box-shadow:0 4px 12px var(--wood-sh)}
.disc-map-btn .icn{width:22px;height:22px;flex:none}
.disc-map-btn .dmb-prog{margin-left:auto;font-family:'Nunito',sans-serif;font-weight:900;font-size:13px;color:#5B4327;background:rgba(255,255,255,.55);border-radius:999px;padding:3px 10px}
.disc-map-btn:active{transform:scale(.96)}
/* Rare-find cheer: gold variant of the stop pill */
.stop-cheer.rare{border-color:var(--gold-deep);background:linear-gradient(180deg,#FFF8E6,#fff);color:#B07D12;box-shadow:0 8px 22px rgba(224,169,46,.4)}
/* Discovery Map: Questy voice line + locked-tile hint toast */
.dm-questy{font-family:'Caveat',cursive;font-weight:700;font-size:17px;line-height:1.25;color:#5B4327;text-align:center;margin:0 auto 12px;max-width:520px;text-shadow:0 1px 3px rgba(255,250,235,.85)}
.dm-slot{cursor:pointer}
.dm-slot:active{transform:scale(.96)}
/* Fact sheet: tapping any tile shows a fixed bottom card (found = its fun fact, locked = a nudge). */
.dm-tipbar{position:fixed;left:14px;right:14px;bottom:max(16px,calc(env(safe-area-inset-bottom,0px) + 12px));z-index:30;margin:0 auto;max-width:420px;text-align:center;font-family:'Nunito',sans-serif;font-weight:800;font-size:13px;color:#5B4327;background:rgba(255,250,235,.97);border:2px solid var(--gold-edge);border-radius:14px;padding:11px 15px;opacity:0;transform:translateY(10px);transition:opacity .2s,transform .2s;box-shadow:0 6px 20px rgba(80,55,15,.32);pointer-events:none}
.dm-tipbar.show{opacity:1;transform:none;pointer-events:auto}
.dm-tipbar.dm-tip-fact b{display:block;font-family:'Fredoka One',cursive;font-size:15px;color:var(--pri);margin-bottom:3px}
.dm-tipbar.dm-tip-fact span{font-family:'Caveat',cursive;font-weight:700;font-size:18px;line-height:1.25;color:var(--ink-dark)}
/* ── LIGHT THE SUMMIT: world-complete payoff ──────────────────────────────── */
/* Persistent banner pinned atop a completed album. */
.summit-banner{display:flex;align-items:center;gap:11px;margin:0 0 14px;padding:11px 13px;border-radius:var(--radius-sm);
  background:linear-gradient(135deg,#FFF6D9,#FBE7A6);border:2px solid var(--gold-edge);box-shadow:0 4px 14px var(--wood-sh)}
.summit-banner .sb-peak{flex:none;width:34px;height:34px;color:#B07D12;filter:drop-shadow(0 1px 1px rgba(80,55,15,.35))}
.summit-banner .sb-peak svg{width:100%;height:100%}
.summit-banner.lit{background:linear-gradient(135deg,#FFEEAE,#F5C64A);border-color:var(--gold-deep)}
.summit-banner.lit .sb-peak{color:#8A5A00}
.summit-banner .sb-txt{flex:1;min-width:0}
.summit-banner .sb-txt b{display:block;font-family:'Fredoka One',cursive;font-size:15px;color:#5B4327;line-height:1.1}
.summit-banner .sb-txt span{font-family:'Nunito',sans-serif;font-weight:800;font-size:11px;color:#7A5A28}
.summit-banner.lit .sb-txt span{color:#6E4A00}
.summit-banner .sb-btn{flex:none;font-family:'Fredoka One',cursive;font-size:13px;color:#fff;background:var(--gold-grad);border:2px solid var(--gold-edge);border-radius:11px;padding:11px 14px;cursor:pointer;box-shadow:0 2px 6px var(--wood-sh)}
.summit-banner .sb-btn:active{transform:scale(.95)}
/* Full-screen summit moment. */
.summit-overlay{position:fixed;inset:0;z-index:300;display:flex;align-items:center;justify-content:center;padding:22px;
  background:radial-gradient(120% 100% at 50% 20%,rgba(70,40,120,.55),rgba(28,18,50,.82));
  opacity:0;transition:opacity .28s ease;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}
.summit-overlay.show{opacity:1}
.summit-fx{position:absolute;inset:0;pointer-events:none;overflow:hidden}
.summit-card{position:relative;width:100%;max-width:360px;max-height:86vh;overflow-y:auto;text-align:center;padding:20px 20px 22px;border-radius:var(--radius-xl);
  background:linear-gradient(180deg,#FFFDF6,#FFF3D8);border:2.5px solid var(--gold-edge);box-shadow:0 18px 50px rgba(20,10,40,.5);
  transform:translateY(18px) scale(.94);transition:transform .32s cubic-bezier(.2,1.4,.4,1)}
.summit-overlay.show .summit-card{transform:none}
.summit-scene{position:relative;height:150px;margin:2px 0 6px;display:flex;align-items:flex-end;justify-content:center}
.summit-mtn{position:relative;width:130px;height:112px;clip-path:polygon(50% 0,100% 100%,0 100%);
  background:linear-gradient(180deg,#EAD9AC,#CBB37C)}
.summit-mtn::after{content:"";position:absolute;top:0;left:50%;transform:translateX(-50%);border-left:30px solid transparent;border-right:30px solid transparent;border-top:44px solid rgba(255,255,255,.9)}
.summit-glow{position:absolute;top:-14px;left:50%;width:80px;height:80px;transform:translateX(-50%);border-radius:50%;
  background:radial-gradient(circle,rgba(255,224,130,0) 60%,rgba(255,224,130,0) 61%);transition:background .4s}
.summit-flag{position:absolute;top:-6px;left:50%;transform:translateX(-50%);width:40px;height:40px;color:#9A7A3A;z-index:2;transition:color .3s,filter .3s}
.summit-flag svg{width:100%;height:100%}
/* Painted summit art (PNG) — the hero trophy; unlit src swaps to lit on tap. */
.summit-scene.has-art{height:172px}
.summit-art{height:100%;width:auto;max-width:100%;object-fit:contain;filter:drop-shadow(0 5px 10px rgba(60,40,10,.28))}
.summit-art.lit-pop{animation:summitLitPop .5s cubic-bezier(.2,1.5,.4,1)}
@keyframes summitLitPop{0%{transform:scale(.9)}55%{transform:scale(1.08)}100%{transform:scale(1)}}
/* Small Questy peeking from the mountain's base — present, not competing with the trophy. */
.summit-peek-q{position:absolute;left:2px;bottom:0;width:52px;height:52px;object-fit:contain;z-index:3;filter:drop-shadow(0 2px 3px rgba(60,40,10,.3))}
.summit-card.is-lit .summit-mtn{background:linear-gradient(180deg,#FFE9A6,#E7B24A)}
.summit-card.is-lit .summit-glow{background:radial-gradient(circle,rgba(255,214,90,.85) 0%,rgba(255,214,90,0) 70%);animation:summitPulse 1.8s ease-in-out infinite}
.summit-card.is-lit .summit-flag{color:#8A5A00;filter:drop-shadow(0 0 8px rgba(255,196,60,.9))}
@keyframes summitPulse{0%,100%{opacity:.65;transform:translateX(-50%) scale(1)}50%{opacity:1;transform:translateX(-50%) scale(1.18)}}
.summit-kicker{font-family:'Nunito',sans-serif;font-weight:900;font-size:12px;letter-spacing:.16em;color:#8A5A00;margin:2px 0 4px}
.summit-title{font-family:'Fredoka One',cursive;font-size:23px;line-height:1.15;color:var(--ink-dark);margin:0 0 8px}
.summit-line{font-family:'Nunito',sans-serif;font-weight:800;font-size:14px;line-height:1.4;color:#5B4327;margin:0 0 16px}
.summit-actions{display:flex;flex-direction:column;gap:9px}
.summit-btn{font-family:'Fredoka One',cursive;font-size:16px;line-height:1.15;border-radius:14px;padding:13px 16px;cursor:pointer;border:2px solid transparent}
.summit-btn.primary{color:#fff;background:var(--gold-grad);border-color:var(--gold-edge);box-shadow:0 5px 14px var(--wood-sh)}
.summit-btn.primary.big{font-size:18px;padding:15px 16px}
.summit-btn.ghost{color:#7A5A28;background:transparent;border-color:#E2CE9C;font-size:14px;padding:13px 10px}
.summit-btn:active{transform:scale(.96)}
.summit-btn:disabled{opacity:.7}
/* Victory-card hook: the doorway from "world complete" straight into the summit ritual. */
.sc-summit-hook{display:inline-flex;align-items:center;justify-content:center;gap:8px;margin:12px auto 2px;padding:13px 22px;border:2.5px solid var(--gold-edge);border-radius:var(--radius-sm);background:var(--gold-grad);color:#fff;font-family:'Fredoka One',cursive;font-size:16px;cursor:pointer;box-shadow:0 5px 14px var(--wood-sh);animation:summitHookPulse 1.6s ease-in-out infinite}
.sc-summit-hook svg{width:22px;height:22px;flex:none}
.sc-summit-hook:active{transform:scale(.96)}
@keyframes summitHookPulse{0%,100%{transform:scale(1)}50%{transform:scale(1.045)}}
@media (prefers-reduced-motion:reduce){.summit-overlay,.summit-card{transition:none}.summit-card.is-lit .summit-glow,.sc-summit-hook,.summit-art.lit-pop{animation:none}}
/* Setup: confirm the chosen color in words (mobile dots have no labels) */
.color-pick{font-family:'Nunito',sans-serif;font-weight:800;font-size:13px;color:var(--ink-dark);text-align:center;margin:6px 0 0;min-height:16px}
/* Theme screen: clearance so the sticky "Surprise me!" never floats over the last card row. */
#s-theme{padding-bottom:88px}
/* Tablet (END-of-file so these win over base #s-hunt / grid rules): widen the hunt CTA + card
   to the 600px column, and fan the setup grids out instead of leaving wide empty cells. */
@media (min-width:720px){
  #s-hunt #doneBtn,#s-hunt #hintTxt{max-width:564px}
  #s-hunt .cc{max-width:520px;margin-left:auto;margin-right:auto}
  .rooms-grid{grid-template-columns:repeat(3,1fr)}
  .char-grid{grid-template-columns:repeat(4,1fr)}
}

/* ── Co-op (Team Mode) specifics ───────────────────────────── */
/* The co-op hint carries the go + whose-turn instruction, so it must show on phones
   (the solo hint stays hidden at <=480px to save space). */
@media (max-width:480px){.hint.hint-coop{display:block}}
.fact-coop{color:var(--pri)}
/* Both explorers printed at the top of the co-op journal page */
.j-team{display:flex;flex-direction:column;align-items:center;gap:5px;margin-bottom:8px}
.j-team-row{display:flex;align-items:center;justify-content:center;gap:10px}
.j-team-av{display:flex;flex-direction:column;align-items:center;gap:2px}
.j-team-av img{width:40px;height:40px;border-radius:50%;object-fit:cover;object-position:center 12%}
.j-team-av b{width:40px;height:40px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:rgba(124,58,237,.15);color:var(--pri);font-size:18px;font-weight:900}
.j-team-av i{font-style:normal;font-size:11px;font-weight:800;color:#6E5010;text-transform:uppercase;letter-spacing:.04em}
.j-team-amp{color:#6E5010;font-weight:800;align-self:center}
.j-team-stamp{font-size:10px;font-weight:900;letter-spacing:.08em;color:#B07D12;border:2px solid #B07D12;border-radius:5px;padding:1px 8px;opacity:.9}
.art-with{font-size:11px;font-weight:800;color:var(--pri);margin-top:3px}
/* Victory avatar pair pops in instead of appearing flat */
.coop-av-circle{animation:coopAvPop .5s cubic-bezier(.2,1.6,.6,1) both}
.coop-av:nth-child(2) .coop-av-circle{animation-delay:.12s}
@keyframes coopAvPop{0%{opacity:0;transform:scale(.4)}100%{opacity:1;transform:scale(1)}}

/* ── Playtest fixes (per-age, v158): each tier meets kids where they are ────── */
/* Tiny + Junior: the grown-up note stays one tap away but stops competing with the
   mission (5yo playtest: "not for me, boring words"). */
#s-hunt.tier-tiny .parent-tip,#s-hunt.tier-junior .parent-tip{opacity:.72}
#s-hunt.tier-tiny .parent-tip span.ptip-label,#s-hunt.tier-junior .parent-tip span.ptip-label{font-size:11.5px}
/* Tiny victory: ONE big obvious Play again!; share/book/switch are grown-up tools and
   get demoted so they never outnumber the fun button (4yo playtest). */
.v-tiny .btn-again{font-size:19px;min-height:56px}
.v-tiny .btn-share{padding:10px 12px;font-size:13px;opacity:.85}
.v-tiny .v-sec{padding:10px 8px;font-size:12px;opacity:.85}

/* Photo-mission escape hatch: a quiet cream pill under the big CTA (photo stops must
   never dead-end when the camera is denied or a kid is camera-shy). 44px tap floor. */
.photo-skip{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(max(10px,env(safe-area-inset-bottom,10px)) + 74px);z-index:5;min-height:44px;padding:8px 20px;background:var(--cream-mist);border:1.5px solid var(--bdr);border-radius:999px;font-family:'Nunito',sans-serif;font-size:13.5px;font-weight:800;color:var(--sub);cursor:pointer;transition:transform .12s;box-shadow:0 3px 12px rgba(40,20,10,.14)}
.photo-skip:active{transform:scale(.96)}
