@font-face{
  font-family:"Fredoka";
  src:url("../fonts/Fredoka-Variable.ttf") format("truetype");
  font-weight:300 700;
  font-display:swap;
}
@font-face{
  font-family:"Nunito";
  src:url("../fonts/Nunito-Variable.ttf") format("truetype");
  font-weight:200 1000;
  font-display:swap;
}

:root{
  --green-ink:#1f4a22;
  --green:#2f6b32;
  --green-mid:#3d8a42;
  --green-soft:#e7f3d8;
  --leaf:#5da24a;
  --yellow:#f5d13a;
  --yellow-soft:#ffe98a;
  --purple:#6b3d8a;
  --purple-soft:#efe4f8;
  --red:#d42b2b;
  --blue:#2e6fdb;
  --sky:#7ec8f0;
  --cream:#fbf6e6;
  --cream-dark:#f0e4c4;
  --wood:#8b5a2b;
  --ink:#243027;
  --muted:#4d5b50;
  --card:#fffdf6;
  --shadow:0 8px 24px rgba(36,48,39,.16);
  --radius:22px;
  --topbar:64px;
  --focus:0 0 0 3px #fff, 0 0 0 6px var(--green);
}
*{box-sizing:border-box}
[hidden]{display:none !important}
html,body{margin:0;padding:0}
html{scroll-behavior:smooth}
body{
  font-family:"Nunito", "Trebuchet MS", "Segoe UI", sans-serif;
  font-size:1.05rem;
  line-height:1.45;
  color:var(--ink);
  background:
    radial-gradient(1200px 500px at 50% -80px, #cfe9a8 0%, transparent 70%),
    linear-gradient(180deg, #b7d7ef 0 180px, var(--cream) 280px);
  min-height:100dvh;
}
img{max-width:100%;height:auto;display:block}
button,a{font-family:inherit}
button{cursor:pointer}
:focus-visible{outline:none;box-shadow:var(--focus)}
.skip{
  position:absolute;left:-999px;top:8px;
  background:#fff;color:var(--green-ink);padding:.6rem 1rem;border-radius:10px;z-index:20;
}
.skip:focus{left:8px}

/* ---- top bar ---- */
.topbar{
  position:sticky;top:0;z-index:10;
  height:var(--topbar);
  display:flex;align-items:center;gap:.6rem;
  padding:.4rem .7rem;
  background:linear-gradient(180deg,rgba(31,74,34,.96),rgba(47,107,50,.94));
  color:#fff;
  box-shadow:0 2px 10px rgba(0,0,0,.18);
}
.topbar .brand-link{
  display:flex;align-items:center;gap:.5rem;
  color:#fff;text-decoration:none;min-width:0;flex:1;
}
.topbar .brand-mark{width:36px;height:36px;flex:none}
.topbar .brand-text{font-family:"Fredoka",sans-serif;font-weight:650;font-size:1.05rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.icon-btn{
  width:48px;height:48px;flex:none;
  border:0;border-radius:14px;
  background:rgba(255,255,255,.14);
  color:#fff;
  display:grid;place-items:center;
  min-width:48px;min-height:48px;
}
.icon-btn:hover{background:rgba(255,255,255,.24)}
.icon-btn svg{width:26px;height:26px}
.icon-btn[aria-pressed="false"] .icon-on{display:none}
.icon-btn[aria-pressed="true"] .icon-off{display:none}

/* ---- typography / brand ---- */
.logo-title{
  font-family:"Fredoka",sans-serif;
  font-weight:700;
  letter-spacing:.01em;
  color:var(--yellow);
  -webkit-text-stroke:0.07em var(--green-ink);
  paint-order:stroke fill;
  line-height:1.05;
  margin:0;
  text-align:center;
}
.logo-sub{
  font-family:"Fredoka",sans-serif;
  font-weight:550;
  color:var(--purple);
  text-align:center;
  margin:.25rem 0 0;
}
.byline{
  text-align:center;
  color:var(--green-ink);
  font-weight:700;
  margin:.15rem 0 0;
}

/* ---- layout ---- */
.wrap{width:min(1100px, calc(100% - 1.6rem));margin-inline:auto}
.section{padding:1.8rem 0}
.section h2{
  font-family:"Fredoka",sans-serif;
  font-size:clamp(1.5rem, 4vw, 2rem);
  color:var(--green-ink);
  margin:0 0 1rem;
  text-align:center;
}

/* ---- hero ---- */
.hero{
  position:relative;
  padding:1.2rem 0 1.6rem;
  text-align:center;
}
.hero-art{
  width:min(640px, 100%);
  margin:1rem auto 0;
  border-radius:28px;
  overflow:hidden;
  box-shadow:var(--shadow);
  border:6px solid #fff;
  background:#fff;
}
.hero-art img{width:100%;aspect-ratio:5/4;object-fit:cover;object-position:center 30%}
.tagline{
  font-size:clamp(1.05rem, 2.6vw, 1.25rem);
  color:var(--muted);
  max-width:36em;
  margin:.85rem auto 0;
}

/* ---- game cards ---- */
.game-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:1rem;
}
@media (min-width:560px){
  .game-grid{grid-template-columns:repeat(2,1fr)}
}
@media (min-width:900px){
  .game-grid{grid-template-columns:repeat(3,1fr)}
}
.game-card{
  display:flex;flex-direction:column;
  background:var(--card);
  border-radius:var(--radius);
  overflow:hidden;
  box-shadow:var(--shadow);
  border:3px solid #fff;
  color:inherit;
  text-decoration:none;
  min-height:100%;
  transition:transform .15s ease, box-shadow .15s ease;
  text-align:left;
  padding:0;
  font:inherit;
  width:100%;
}
a.game-card:hover, a.game-card:focus-visible{transform:translateY(-3px);box-shadow:0 14px 28px rgba(36,48,39,.2)}
.game-card.is-soon{opacity:.92;cursor:default}
.game-card .thumb{
  aspect-ratio:16/10;
  background:#d9ecd0;
  overflow:hidden;
  position:relative;
}
.game-card .thumb img{width:100%;height:100%;object-fit:cover}
.badge{
  position:absolute;top:.6rem;left:.6rem;
  background:var(--yellow);
  color:var(--green-ink);
  font-family:"Fredoka",sans-serif;
  font-weight:650;
  padding:.25rem .6rem;
  border-radius:999px;
  font-size:.85rem;
  box-shadow:0 2px 0 var(--green-ink);
}
.badge.soon{background:#fff;color:var(--muted);box-shadow:0 2px 0 #c8c4b6}
.game-card .body{padding:.85rem 1rem 1.05rem;display:flex;flex-direction:column;gap:.25rem;flex:1}
.game-card h3{
  font-family:"Fredoka",sans-serif;
  margin:0;
  font-size:1.25rem;
  color:var(--green-ink);
  display:flex;align-items:center;gap:.4rem;
}
.game-card p{margin:0;color:var(--muted)}
.star-earned{
  margin-left:auto;
  color:var(--yellow);
  -webkit-text-stroke:1px var(--green-ink);
  font-size:1.2rem;
}

/* ---- meet ---- */
.meet-grid{
  display:grid;
  gap:1rem;
  grid-template-columns:1fr;
}
@media (min-width:700px){
  .meet-grid{grid-template-columns:repeat(3,1fr)}
}
.who{
  background:var(--card);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:1rem 1rem 1.2rem;
  text-align:center;
  border:3px solid #fff;
}
.who img{
  height:230px;width:auto;margin:0 auto .6rem;
  object-fit:contain;
  filter:drop-shadow(0 6px 8px rgba(0,0,0,.12));
}
.who h3{font-family:"Fredoka",sans-serif;margin:0;color:var(--green-ink);font-size:1.35rem}
.who p{margin:.35rem 0 0;color:var(--muted)}
.pickle-note{
  margin-top:1rem;
  display:flex;align-items:center;gap:1rem;
  background:var(--green-soft);
  border-radius:var(--radius);
  padding:1rem;
  border:3px solid #fff;
  box-shadow:var(--shadow);
}
.pickle-note img{width:140px;height:auto;flex:none}
.pickle-note h3{font-family:"Fredoka",sans-serif;margin:0 0 .2rem;color:var(--green-ink)}
.pickle-note p{margin:0;color:var(--muted)}

/* ---- books ---- */
.book-row{
  display:grid;
  gap:1rem;
  grid-template-columns:repeat(3,1fr);
}
.book{
  background:transparent;
  text-align:center;
}
.book img{
  width:100%;
  border-radius:10px;
  box-shadow:var(--shadow);
  border:3px solid #fff;
}
.book figcaption{
  font-family:"Fredoka",sans-serif;
  margin-top:.55rem;
  color:var(--green-ink);
  font-weight:600;
  font-size:.95rem;
}

/* ---- grown-ups ---- */
.grownups{
  background:var(--purple-soft);
  border-radius:var(--radius);
  padding:1.1rem 1.2rem;
  border:3px solid #fff;
  color:var(--ink);
}
.grownups h2{margin-bottom:.4rem}
.grownups p{margin:.3rem 0 0;color:var(--muted)}

footer{
  padding:1.5rem .8rem 2.2rem;
  text-align:center;
  color:var(--green-ink);
}
footer .tiny{color:var(--muted);font-size:.9rem}

/* ---- game shells ---- */
.game-page{
  min-height:100dvh;
  display:flex;flex-direction:column;
  background:
    linear-gradient(180deg, rgba(191,223,167,.55), rgba(251,246,230,.92) 40%),
    #fbf6e6;
}
.game-page.huck{
  background:
    linear-gradient(180deg, rgba(20,40,20,.15), rgba(251,246,230,.2) 30%, rgba(251,246,230,.85)),
    url("../img/games/huckleberry-scene.jpg") center top / cover no-repeat;
}
.game-main{
  flex:1;
  display:flex;flex-direction:column;
  width:min(920px, calc(100% - 1.2rem));
  margin:0 auto;
  padding:.8rem 0 1.4rem;
}
.panel{
  background:rgba(255,253,246,.94);
  border:3px solid #fff;
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:1rem;
}
.panel h1{
  font-family:"Fredoka",sans-serif;
  text-align:center;
  color:var(--green-ink);
  margin:.1rem 0 .3rem;
  font-size:clamp(1.5rem, 4vw, 2.1rem);
}
.lead{text-align:center;color:var(--muted);margin:0 0 1rem}

.choice-row{
  display:flex;flex-wrap:wrap;justify-content:center;gap:.75rem;
}
.choice{
  appearance:none;border:0;
  background:#fff;
  border-radius:20px;
  padding:.85rem 1rem .95rem;
  min-width:min(100%, 160px);
  min-height:96px;
  box-shadow:var(--shadow);
  border:3px solid var(--green-soft);
  color:var(--green-ink);
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.25rem;
  font-family:"Fredoka",sans-serif;
  font-size:1.15rem;
  font-weight:600;
}
.choice:hover,.choice:focus-visible{border-color:var(--yellow);transform:translateY(-2px)}
.choice .pips{display:flex;gap:4px;flex-wrap:wrap;justify-content:center;max-width:90px}
.choice .pips i{
  width:10px;height:10px;border-radius:50%;background:var(--green);display:block;
}
.choice .hint{font-family:"Nunito",sans-serif;font-size:.85rem;font-weight:700;color:var(--muted)}

/* memory board */
.board{
  display:grid;
  gap:.65rem;
  margin:.2rem auto 0;
  width:min(100%, 640px);
  perspective:900px;
}
#play .board{width:min(100%, 92vw);}
.board.cols-3{grid-template-columns:repeat(3,1fr)}
.board.cols-4{grid-template-columns:repeat(4,1fr)}
.mem-card{
  aspect-ratio:1;
  border:0;padding:0;background:transparent;
  border-radius:16px;
  transform-style:preserve-3d;
  transition:transform .45s ease;
  min-width:0;
  min-height:72px;
  position:relative;
}
.mem-card.is-flipped, .mem-card.is-matched{transform:rotateY(180deg)}
.mem-card .face{
  position:absolute;inset:0;
  border-radius:16px;
  backface-visibility:hidden;
  -webkit-backface-visibility:hidden;
  overflow:hidden;
  box-shadow:0 4px 10px rgba(0,0,0,.16);
  border:3px solid #fff;
}
.mem-card .back{background:#2f5d32}
.mem-card .back img, .mem-card .front img{width:100%;height:100%;object-fit:cover}
.mem-card .front{transform:rotateY(180deg);background:#f3e1b8}
.mem-card.is-matched .front{box-shadow:0 0 0 3px var(--yellow), 0 4px 10px rgba(0,0,0,.16)}
.mem-card:disabled{cursor:default}

.fact{
  margin:.8rem auto 0;
  width:min(100%, 560px);
  background:var(--green-soft);
  border-radius:16px;
  padding:.7rem 1rem;
  min-height:3.2em;
  text-align:center;
  font-weight:700;
  color:var(--green-ink);
}
.fact:empty{visibility:hidden}

/* huckleberry */
.hud{
  display:flex;align-items:center;justify-content:center;gap:.6rem;
  margin-bottom:.6rem;
}
.big-num{
  font-family:"Fredoka",sans-serif;
  font-size:clamp(3rem, 14vw, 5.5rem);
  line-height:1;
  color:var(--green-ink);
  background:rgba(255,253,246,.92);
  border:4px solid #fff;
  border-radius:24px;
  min-width:1.4em;
  padding:.1em .25em;
  text-align:center;
  box-shadow:var(--shadow);
}
.prompt{
  font-family:"Fredoka",sans-serif;
  font-size:clamp(1.15rem, 3.4vw, 1.6rem);
  text-align:center;
  color:var(--green-ink);
  background:rgba(255,253,246,.92);
  border-radius:16px;
  padding:.55rem .8rem;
  margin:0 0 .7rem;
  border:3px solid #fff;
  box-shadow:var(--shadow);
}
.dots{display:flex;flex-wrap:wrap;justify-content:center;gap:6px;margin:.2rem 0 .2rem}
.dots span{
  width:14px;height:14px;border-radius:50%;
  background:var(--purple);
  box-shadow:inset -2px -2px 0 #2a1850;
}

.playfield{
  position:relative;
  min-height:340px;
  display:grid;
  grid-template-columns:1fr 140px;
  gap:.5rem;
  align-items:end;
}
.bush{
  position:relative;
  min-height:300px;
}
.berry{
  position:absolute;
  width:56px;height:56px;
  border:0;background:transparent;padding:0;
  filter:drop-shadow(0 3px 2px rgba(0,0,0,.25));
  transform-origin:center;
  transition:transform .12s ease;
  z-index:2;
}
.berry:hover,.berry:focus-visible{transform:scale(1.12)}
.berry img,.berry svg{width:100%;height:100%}
.berry.is-picked{pointer-events:none;opacity:0;transform:scale(.2)}
.gran-col{
  display:flex;flex-direction:column;align-items:center;justify-content:flex-end;
  position:relative;
  min-height:300px;
}
.gran-col img.gran{
  width:120px;height:auto;
  filter:drop-shadow(0 6px 6px rgba(0,0,0,.25));
  position:relative;z-index:2;
}
.bucket{
  width:108px;height:90px;
  position:relative;
  z-index:1;
  margin-top:-10px;
}
.bucket-fill{
  position:absolute;left:18px;right:18px;bottom:10px;
  background:radial-gradient(circle at 30% 30%, #8a6cff, #3b2470);
  border-radius:6px 6px 10px 10px;
  height:0%;
  transition:height .2s ease;
}
.compare{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:.7rem;
}
.compare-group{
  background:rgba(255,253,246,.92);
  border:4px solid #fff;
  border-radius:22px;
  padding:.7rem;
  min-height:180px;
  display:flex;flex-direction:column;align-items:center;gap:.4rem;
  box-shadow:var(--shadow);
}
.compare-group .berry-set{
  display:flex;flex-wrap:wrap;justify-content:center;gap:6px;
}
.compare-group .berry-set img{width:44px;height:44px}
.compare-group.is-wrong{animation:shake .45s ease}
.numpad{
  display:flex;flex-wrap:wrap;justify-content:center;gap:.45rem;
  margin-top:.8rem;
}
.numpad button{
  width:58px;height:58px;
  border:0;border-radius:16px;
  background:#fff;
  border:3px solid var(--green-soft);
  font-family:"Fredoka",sans-serif;
  font-size:1.5rem;
  font-weight:700;
  color:var(--green-ink);
  box-shadow:0 3px 0 #c9ddb8;
}
.numpad button:hover,.numpad button:focus-visible{border-color:var(--yellow);background:var(--yellow-soft)}

.actions{display:flex;justify-content:center;gap:.6rem;flex-wrap:wrap;margin-top:1rem}
.btn{
  appearance:none;border:0;
  font-family:"Fredoka",sans-serif;
  font-weight:650;
  font-size:1.1rem;
  padding:.7rem 1.15rem;
  border-radius:999px;
  min-height:48px;
  background:var(--yellow);
  color:var(--green-ink);
  box-shadow:0 3px 0 var(--green-ink);
}
.btn:hover{filter:brightness(1.05)}
.btn.secondary{background:#fff;box-shadow:0 3px 0 #c8c4b6}
.btn:disabled{opacity:.6;cursor:default}

.overlay{
  position:fixed;inset:0;
  background:rgba(31,74,34,.45);
  display:flex;align-items:center;justify-content:center;
  padding:1rem;
  z-index:20;
}
.overlay[hidden]{display:none}
.celebrate{
  background:var(--card);
  border-radius:28px;
  padding:1.4rem 1.2rem 1.3rem;
  width:min(420px, 100%);
  text-align:center;
  border:6px solid var(--yellow);
  box-shadow:var(--shadow);
}
.celebrate h2{font-family:"Fredoka",sans-serif;color:var(--green-ink);margin:.2rem 0 .4rem;font-size:1.8rem}
.celebrate p{margin:0 0 1rem;color:var(--muted)}
.celebrate img{height:140px;width:auto;margin:0 auto .4rem}

.toast{
  position:fixed;left:50%;bottom:1rem;transform:translateX(-50%);
  background:var(--green-ink);color:#fff;
  padding:.65rem 1rem;border-radius:999px;
  box-shadow:var(--shadow);
  z-index:30;
  font-weight:700;
  max-width:min(90vw, 26em);
  text-align:center;
}
.toast[hidden]{display:none}

.confetti-bit{
  position:fixed;z-index:25;pointer-events:none;
  width:10px;height:14px;border-radius:2px;
  animation:fall 1.1s ease-in forwards;
}

@keyframes shake{
  0%,100%{transform:translateX(0)}
  25%{transform:translateX(-6px)}
  75%{transform:translateX(6px)}
}
@keyframes fall{
  to{transform:translateY(80vh) rotate(200deg);opacity:0}
}

@media (prefers-reduced-motion:reduce){
  *{animation:none !important;transition:none !important}
  .mem-card,.mem-card.is-flipped,.mem-card.is-matched{transition:none}
}

/* landscape phone */
@media (max-height:500px) and (orientation:landscape){
  :root{--topbar:52px}
  .hero{padding:.4rem 0 .8rem}
  .hero-art{width:min(340px, 46vw);display:inline-block;vertical-align:middle;margin:.4rem}
  .hero .logo-title{font-size:1.8rem}
  .section{padding:1rem 0}
  .who img{height:150px}
  .playfield{min-height:230px;grid-template-columns:1fr 110px}
  .bush{min-height:220px}
  .gran-col{min-height:220px}
  .gran-col img.gran{width:90px}
  .berry{width:48px;height:48px}
  .big-num{font-size:2.6rem}
  .board{width:min(100%, 70vh)}
  .game-main{padding:.4rem 0 .8rem}
}

@media (max-width:420px){
  .book-row{gap:.5rem}
  .book figcaption{font-size:.8rem}
  .pickle-note{flex-direction:column;text-align:center}
  .berry{width:52px;height:52px}
}

/* ---- books and buy links ---- */
.book-row{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:1.1rem;
  align-items:stretch;
}
.book{
  margin:0;
  background:var(--card);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:.9rem .9rem 1rem;
  display:flex;
  flex-direction:column;
  gap:.55rem;
  min-width:0;
}
.book img{
  width:100%;
  max-width:240px;
  margin:0 auto;
  border-radius:12px;
  box-shadow:0 8px 18px rgba(36,48,39,.18);
  background:#fff;
}
.book h3{
  font-family:"Fredoka",sans-serif;
  font-size:1.12rem;
  margin:0;
  color:var(--green-ink);
  line-height:1.25;
  text-align:center;
}
.book p{
  margin:0;
  color:var(--muted);
  font-size:.95rem;
}
.buy-row{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:.25rem}
.buy-btn{
  flex:1 1 40%;
  min-height:52px;
  display:inline-flex;align-items:center;justify-content:center;
  padding:.55rem .8rem;
  border-radius:16px;
  border:0;
  background:var(--green);
  color:#fff;
  font-weight:800;
  text-decoration:none;
  text-align:center;
  box-shadow:0 4px 0 #1f4a22;
}
.buy-btn.alt{
  background:#fff;
  color:var(--green-ink);
  border:2px solid var(--green);
  box-shadow:0 4px 0 var(--cream-dark);
}
.buy-btn:hover,.buy-btn:focus-visible{filter:brightness(1.05)}
.lead{color:var(--muted);margin:0 0 1rem}

/* ---- grown-up gate ---- */
.gate{z-index:40;background:rgba(20,32,24,.55);padding:1rem}
.gate-card{
  background:var(--card);
  border-radius:28px;
  padding:1.3rem 1.2rem 1.15rem;
  width:min(440px, 100%);
  text-align:center;
  box-shadow:0 18px 40px rgba(20,32,24,.28);
}
.gate-card h2{font-family:"Fredoka",sans-serif;color:var(--green-ink);margin:.1rem 0 .4rem;font-size:1.8rem}
.gate-card p{margin:.25rem 0;color:var(--muted)}
.gate-hint{font-weight:800;color:var(--green-ink)!important;font-size:1.05rem}
.gate-hold{
  position:relative;
  display:block;
  width:100%;
  min-height:68px;
  margin:1rem 0 .7rem;
  border:0;
  border-radius:20px;
  background:var(--green-soft);
  color:var(--green-ink);
  font-weight:800;
  font-size:1.05rem;
  overflow:hidden;
  box-shadow:0 4px 0 #c3d8a8;
  touch-action:none;
  user-select:none;
}
.gate-hold.is-holding{box-shadow:0 2px 0 #c3d8a8;transform:translateY(1px)}
.gate-fill{
  position:absolute;left:0;top:0;bottom:0;width:0;
  background:linear-gradient(90deg, var(--leaf), var(--yellow));
  border-radius:20px;
  z-index:0;
}
.gate-hold-label{position:relative;z-index:1}
.gate-go{width:100%;margin:.8rem 0 .5rem;min-height:60px}
.gate-cancel{
  display:block;
  width:100%;
  min-height:76px;
  margin-top:.3rem;
  border:3px solid var(--wood);
  border-radius:22px;
  background:var(--yellow);
  color:var(--ink);
  font-family:"Fredoka",sans-serif;
  font-size:1.45rem;
  font-weight:700;
  box-shadow:0 5px 0 #c49a12;
}
.gate-cancel:active{transform:translateY(2px);box-shadow:0 3px 0 #c49a12}

/* ---- sled hill dash ---- */
body.sled-page{
  background:#b7d7ef;
}
.sled-stage{
  position:relative;
  width:min(100%, 720px);
  margin:0 auto;
  height:calc(100dvh - var(--topbar) - 7.2rem);
  min-height:280px;
  border-radius:24px;
  overflow:hidden;
  box-shadow:var(--shadow);
  background:#9fd0ef center/cover no-repeat;
  touch-action:none;
}
.sled-stage canvas{display:block;width:100%;height:100%}
.sled-hud{
  display:flex;justify-content:space-between;gap:.6rem;align-items:center;
  width:min(100%, 720px);
  margin:0 auto .5rem;
  font-weight:800;
  color:var(--green-ink);
}
.sled-pads{
  position:absolute;inset:0;display:flex;pointer-events:none;
}
.sled-pad{
  flex:1;
  display:flex;align-items:flex-end;justify-content:center;
  padding-bottom:1rem;
  pointer-events:auto;
  background:transparent;
  border:0;
  color:#1f4a22;
}
.sled-pad span{
  width:64px;height:64px;border-radius:50%;
  background:rgba(255,255,255,.72);
  display:grid;place-items:center;
  font-size:2rem;font-weight:800;
  box-shadow:0 4px 12px rgba(0,0,0,.12);
}
.sled-pad.is-held span{background:var(--yellow);transform:scale(1.06)}
.sled-pad:focus-visible span{box-shadow:var(--focus)}

/* ---- map maze ---- */
body.map-page{background:linear-gradient(180deg, #cfe8b8, var(--cream) 40%)}
.maze-wrap{
  width:min(100%, 720px);
  margin:0 auto;
  display:grid;
  gap:.7rem;
}
.maze{
  --n:5;
  display:grid;
  grid-template-columns:repeat(var(--n), 1fr);
  gap:3px;
  background:#c9b07a;
  padding:8px;
  border-radius:18px;
  box-shadow:var(--shadow);
  width:min(100%, 92vmin, 560px);
  margin:0 auto;
  aspect-ratio:1 / 1;
}
.cell{
  position:relative;
  border-radius:8px;
  background:#e7f3d8;
  min-width:0;min-height:0;
}
.cell.wall{
  background:linear-gradient(180deg,#3d8a42,#2f6b32);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.12);
}
.cell.path{background:#f4e6b8}
.cell.route{background:#ffe98a}
.cell.visited{background:#efe0a0}
.cell.start{background:#d4ecc4}
.cell.treasure{background:#f5d13a}
.cell .mark{
  position:absolute;inset:18%;
  width:auto;height:auto;
  pointer-events:none;
}
.cell .pawn{
  position:absolute;inset:4%;
  width:92%;height:92%;
  object-fit:contain;
  z-index:2;
  filter:drop-shadow(0 2px 2px rgba(0,0,0,.2));
  transition:transform .22s ease;
}
.cell.next-hint{box-shadow:inset 0 0 0 3px var(--blue)}
.dpad{
  display:grid;
  grid-template-columns:72px 72px 72px;
  grid-template-rows:72px 72px 72px;
  gap:.45rem;
  justify-content:center;
  margin:.2rem auto .4rem;
}
.dpad button{
  width:72px;height:72px;border:0;border-radius:18px;
  background:var(--green);
  color:#fff;
  font-size:1.8rem;
  font-weight:800;
  box-shadow:0 4px 0 #1f4a22;
}
.dpad button:active, .dpad button.is-held{transform:translateY(2px);box-shadow:0 2px 0 #1f4a22}
.dpad .up{grid-column:2;grid-row:1}
.dpad .left{grid-column:1;grid-row:2}
.dpad .right{grid-column:3;grid-row:2}
.dpad .down{grid-column:2;grid-row:3}
.maze-prompt{
  text-align:center;
  font-family:"Fredoka",sans-serif;
  font-size:1.25rem;
  color:var(--green-ink);
  min-height:1.6em;
  margin:0;
}

@media (max-width:800px){
  .book-row{grid-template-columns:1fr}
  .book img{max-width:200px}
}
@media (max-height:500px) and (orientation:landscape){
  .sled-stage{height:calc(100dvh - var(--topbar) - 4.6rem);min-height:200px;border-radius:16px}
  .sled-pad span{width:52px;height:52px;font-size:1.5rem}
  .maze-wrap{grid-template-columns:1fr auto;align-items:center;gap:.6rem}
  .maze{width:min(58vw, 70vh);margin:0}
  .dpad{margin:0;grid-template-columns:56px 56px 56px;grid-template-rows:56px 56px 56px}
  .dpad button{width:56px;height:56px;font-size:1.4rem}
  .book-row{grid-template-columns:repeat(3, minmax(0, 1fr));gap:.6rem}
  .book p{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
  .book h3{font-size:.95rem}
  .buy-btn{min-height:44px;font-size:.9rem}
  .gate-card{padding:1rem}
  .gate-cancel{min-height:60px;font-size:1.2rem}
}
@media (max-width:420px){
  .book-row{grid-template-columns:1fr;gap:.9rem}
  .book figcaption{font-size:.8rem}
}

.maze.shake{animation:shake .45s ease}

/* ---- zozo's star hunt ---- */
.hunt-wrap{
  width:min(100%, 900px);
  margin:0 auto;
  display:flex;
  flex-direction:column;
  gap:.6rem;
}
.scene{
  position:relative;
  width:100%;
  aspect-ratio:4 / 3;
  border-radius:18px;
  overflow:hidden;
  box-shadow:var(--shadow);
  background:#cfe8b8;
  touch-action:manipulation;
}
.scene .bg{width:100%;height:100%;object-fit:cover;display:block}
.hotspot{
  position:absolute;
  width:72px;height:72px;
  transform:translate(-50%,-50%);
  border:0;background:transparent;padding:0;
  display:grid;place-items:center;
  z-index:2;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}
.hotspot img, .hotspot .vis{
  width:var(--sz, 38px);height:auto;
  max-height:70px;
  filter:drop-shadow(0 1px 2px rgba(0,0,0,.4));
  pointer-events:none;
  transition:transform .2s ease, filter .2s ease, opacity .2s ease;
}
.hotspot.pickle img{width:var(--sz, 68px)}
.hotspot.is-found{pointer-events:none}
.hotspot.is-found img, .hotspot.is-found .vis{filter:drop-shadow(0 0 6px #f5d13a)}
.hotspot.is-hint img, .hotspot.is-hint .vis{
  animation:hintglow 1.15s ease-in-out infinite;
}
@keyframes hintglow{
  0%,100%{filter:drop-shadow(0 0 2px #fff);transform:scale(1)}
  50%{filter:drop-shadow(0 0 10px #f5d13a) drop-shadow(0 0 16px #ffe98a);transform:scale(1.14)}
}
.tray{
  display:flex;flex-wrap:wrap;gap:.4rem;justify-content:center;
  background:var(--card);
  border-radius:18px;
  padding:.45rem .5rem;
  box-shadow:var(--shadow);
}
.tray-item{
  display:flex;flex-direction:column;align-items:center;gap:.15rem;
  min-width:58px;
  padding:.25rem .3rem;
  border-radius:12px;
  background:var(--green-soft);
  color:var(--green-ink);
  font-weight:800;font-size:.72rem;text-align:center;
}
.tray-item img{width:36px;height:36px;object-fit:contain}
.tray-item.is-found{background:#ffe98a;opacity:.95}
.tray-item.is-found::after{content:" ✓"}
.tray-item.bonus{background:var(--purple-soft);color:var(--purple)}

/* ---- picture word find ---- */
.words-wrap{
  width:min(100%, 720px);
  margin:0 auto;
  display:flex;
  flex-direction:column;
  gap:.7rem;
  align-items:center;
}
.word-grid{
  --n:6;
  display:grid;
  grid-template-columns:repeat(var(--n), 1fr);
  gap:4px;
  width:min(100%, 92vmin, 520px);
  background:#c9b07a;
  padding:8px;
  border-radius:16px;
  box-shadow:var(--shadow);
  touch-action:none;
  user-select:none;
}
.letter{
  aspect-ratio:1;
  display:grid;place-items:center;
  background:#fffdf6;
  border:0;border-radius:8px;
  font-family:"Fredoka",sans-serif;
  font-weight:700;
  font-size:clamp(1rem, 5vw, 1.6rem);
  color:var(--green-ink);
  cursor:pointer;
  min-height:0;
}
.letter.is-sel{background:#ffe98a;transform:scale(1.04)}
.letter.is-found{background:#cfe8b8;color:#1f4a22}
.word-list{
  list-style:none;margin:0;padding:0;
  display:flex;flex-wrap:wrap;gap:.5rem;justify-content:center;
  width:100%;
}
.word-list li{
  display:flex;align-items:center;gap:.4rem;
  background:var(--card);
  border-radius:14px;
  padding:.3rem .7rem .3rem .35rem;
  box-shadow:var(--shadow);
  font-weight:800;
  color:var(--green-ink);
  min-height:48px;
}
.word-list li img{width:36px;height:36px;object-fit:contain}
.word-list li.is-found{background:#ffe98a}
.word-list li.is-found .w{text-decoration:line-through;opacity:.7}
.word-list li.is-current{box-shadow:0 0 0 3px var(--yellow), var(--shadow)}
.word-target{
  display:flex;align-items:center;justify-content:center;gap:.7rem;
  background:var(--card);
  border-radius:18px;
  padding:.5rem 1rem;
  box-shadow:var(--shadow);
  margin:0 auto .2rem;
  width:min(100%, 420px);
}
.word-target img{width:64px;height:64px;object-fit:contain}
.word-target .spelling{
  display:flex;gap:.25rem;
  font-family:"Fredoka",sans-serif;
  font-size:1.8rem;font-weight:700;color:var(--green-ink);
}
.word-target .spelling span{
  min-width:1.3em;text-align:center;
  background:var(--yellow-soft);
  border-radius:8px;
  padding:.1rem .15rem;
}

@media (max-height:500px) and (orientation:landscape){
  .hunt-wrap{flex-direction:row;align-items:stretch;gap:.5rem}
  .scene{width:min(70vw, 85vh);aspect-ratio:4/3;margin:0;flex:none}
  .tray{flex:1;flex-direction:column;flex-wrap:nowrap;overflow:auto;align-items:stretch;justify-content:flex-start}
  .tray-item{flex-direction:row;justify-content:flex-start;min-height:44px}
  .words-wrap{flex-direction:row;align-items:center;gap:.6rem}
  .word-grid{width:min(58vw, 70vh)}
  .word-list{flex-direction:column;width:auto;flex:1;overflow-y:auto;max-height:calc(100dvh - var(--topbar) - 5rem);align-self:stretch}
  .word-list li{min-height:40px;padding:.2rem .55rem}
  .word-target{margin:0 auto}
  .letter{font-size:clamp(.9rem, 4vh, 1.3rem)}
  /* Keep the easy-mode target and every grid row on screen in landscape. */
  body.words-page #play{
    display:grid;
    grid-template-columns:auto minmax(160px, 1fr);
    grid-template-rows:auto auto 1fr;
    align-items:center;
    justify-content:center;
    column-gap:.6rem;
    width:min(100%, 1100px);
    margin-inline:auto;
  }
  body.words-page #play #prompt{grid-column:1 / -1}
  body.words-page #play .word-target{
    grid-column:2;grid-row:2;
    width:auto;margin:0;padding:.35rem .6rem;
    justify-self:stretch;
  }
  body.words-page #play .word-target img{width:48px;height:48px}
  body.words-page #play .word-target .spelling{font-size:1.4rem}
  body.words-page #play .words-wrap{display:contents}
  body.words-page #play .word-grid{
    grid-column:1;grid-row:2 / span 2;
    width:min(52vw, calc(100dvh - var(--topbar) - 4.2rem));
    max-height:calc(100dvh - var(--topbar) - 4.2rem);
  }
  body.words-page #play .word-list{
    grid-column:2;grid-row:3;
    max-height:none;
    overflow-y:auto;
    align-self:stretch;
  }
}

@media (prefers-reduced-motion:reduce){
  .hotspot.is-hint img, .hotspot.is-hint .vis{animation:none;filter:drop-shadow(0 0 10px #f5d13a)}
}

/* Read-along stories */
.story-pick{display:grid;gap:1rem;margin-top:1rem}
@media (min-width:700px){
  .story-pick{grid-template-columns:repeat(3, minmax(0, 1fr));gap:1.1rem}
}
.story-card{
  appearance:none;border:0;background:var(--card);border-radius:var(--radius);
  box-shadow:var(--shadow);padding:0 0 1rem;text-align:left;cursor:pointer;
  color:inherit;font:inherit;display:flex;flex-direction:column;align-items:stretch;
  width:100%;
}
.story-card:focus-visible{outline:none;box-shadow:var(--focus)}
.story-card img{width:100%;aspect-ratio:3/4;object-fit:cover;border-radius:var(--radius) var(--radius) 0 0;background:var(--cream-dark)}
.story-card h2{margin:.7rem 1rem .3rem;font-size:1.15rem;color:var(--green-ink)}
.story-card p{margin:0 1rem .7rem;color:var(--muted);font-size:.95rem;flex:1}
.story-card .badge{align-self:flex-start;margin:0 1rem}
.story-meta{margin:0 0 .5rem;text-align:center;font-weight:700;color:var(--green-ink)}
.story-spread{display:flex;flex-direction:column;align-items:center;gap:.7rem}
.story-art{
  appearance:none;border:0;background:var(--cream-dark);padding:0;cursor:pointer;
  border-radius:18px;overflow:hidden;width:min(100%, 520px);box-shadow:var(--shadow);
}
.story-art:focus-visible{outline:none;box-shadow:var(--focus)}
.story-art img{display:block;width:100%;height:min(38vh, 280px);object-fit:contain;background:var(--cream)}
.story-text-wrap{width:min(100%, 640px)}
.story-text{
  margin:0;font-family:"Nunito",sans-serif;font-size:clamp(1.2rem, 5.2vw, 1.7rem);
  line-height:1.55;text-align:center;color:var(--ink);
}
.story-word{
  appearance:none;border:0;background:transparent;color:inherit;font:inherit;
  padding:.05em .12em;margin:0;border-radius:.3em;cursor:pointer;line-height:inherit;
  box-decoration-break:clone;-webkit-box-decoration-break:clone;
}
.story-word:focus-visible{outline:none;box-shadow:var(--focus)}
.story-word.is-reading{background:var(--yellow-soft);box-shadow:0 0 0 2px var(--yellow)}
.story-nav{display:flex;align-items:center;justify-content:center;gap:.7rem;margin-top:1rem}
.story-nav-btn{min-width:7.2rem;min-height:56px;font-size:1.15rem}
.story-page-num{font-weight:700;color:var(--green-ink);min-width:5.5rem;text-align:center}
.auto-toggle{
  display:flex;align-items:center;justify-content:center;gap:.55rem;
  margin:1rem auto 0;font-weight:700;color:var(--green-ink);cursor:pointer;
  font-size:1rem;
}
.auto-toggle input{width:1.35rem;height:1.35rem;accent-color:var(--green)}
@media (max-height:500px) and (orientation:landscape){
  body.readalong-page #play{
    display:flex;flex-direction:column;align-items:stretch;
    width:min(100%, 1100px);margin-inline:auto;
  }
  body.readalong-page .story-meta{margin:0 0 .3rem}
  body.readalong-page .story-spread{
    flex-direction:row;align-items:center;gap:.8rem;justify-content:center;
  }
  body.readalong-page .story-art{width:min(46vw, 420px);flex:none}
  body.readalong-page .story-art img{height:min(62vh, 260px)}
  body.readalong-page .story-text{font-size:clamp(1.05rem, 3.6vh, 1.45rem);text-align:left}
  body.readalong-page .story-nav{margin-top:.5rem}
  body.readalong-page .auto-toggle{margin-top:.45rem}
  body.readalong-page .story-pick{grid-template-columns:repeat(3, minmax(0, 1fr));gap:.6rem}
  body.readalong-page .story-card h2{font-size:1rem}
  body.readalong-page .story-card p{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
  body.readalong-page .story-card img{aspect-ratio:4/3}
}
@media (prefers-reduced-motion:reduce){
  .story-word{transition:none}
}
