*{box-sizing:border-box}html{color-scheme:light}body{margin:0;background:#faf4e8;color:#17332e;font:17px/1.45 "Trebuchet MS",sans-serif}header{height:68px;background:#102d29;color:#fff3d2;padding:0 max(5vw,20px);display:flex;align-items:center;border-bottom:1px solid #ae8b58}header a{font:600 23px Georgia,serif;letter-spacing:.02em}a{color:inherit;text-decoration:none}.star{color:#f6cc82;margin-right:7px}main{min-height:calc(100vh - 68px);outline:none}h1,h2,p{margin:0}h1,h2,.activity b{font-family:Georgia,serif;font-weight:500;line-height:1.08}h1{font-size:clamp(36px,6vw,74px);letter-spacing:-.045em}h2{font-size:clamp(27px,3.6vw,46px)}button,.button,select{font:inherit;color:inherit;cursor:pointer}button,.button{background:#fff9eb;border:1px solid #baa680;border-radius:22px;padding:9px 20px;min-height:44px;font-weight:bold}.primary{background:#1b4b3d;color:white;border-color:#1b4b3d}button:disabled{opacity:.48;cursor:default}:is(a,button,select):focus-visible{outline:4px solid #e99627;outline-offset:4px}button:hover:enabled,.button:hover{filter:brightness(.95)}.shelf{background:radial-gradient(ellipse at 50% 48%,#305448 0,#163a30 52%,#0d2523 100%);color:#fff1cf;text-align:center;padding:clamp(26px,5vh,60px) 18px 65px;min-height:calc(100vh - 68px)}.shelf h1{margin-bottom:25px}.book{position:relative;display:block;width:min(56vw,245px);margin:auto;box-shadow:9px 8px 3px #1d211b,14px 15px 20px #071611a1;border-radius:4px 7px 6px 4px;transform:rotate(-2deg);border-left:7px solid #684322;background:#be9c60}.book img{width:100%;display:block;border-radius:0 4px 4px 0}.ledge{height:23px;margin:0 auto 25px;width:min(540px,92%);background:linear-gradient(#e0ad73 0%,#a97844 18%,#6c442b 26%,#815131 80%,#50301e);box-shadow:0 13px 18px #061d1780;border-radius:3px}.shelf h2{font-size:clamp(24px,3vw,35px);margin-bottom:14px}.shelf .button{color:#352917;background:#f4d599;display:inline-block}.wrap{max-width:1060px;margin:auto;padding:20px clamp(16px,4vw,44px) 45px}.back{display:inline-block;font-weight:bold;text-decoration:underline;text-underline-offset:4px;margin-bottom:18px}.hero{padding:clamp(25px,5vw,60px);min-height:235px;display:flex;align-items:end;color:white;border-radius:16px;background:linear-gradient(90deg,#0a2827f5,#14241b8c 55%,#13271e26),url('art/hero.webp') center/cover}.hero h1{max-width:10em;text-shadow:0 2px 12px #0d201a}.grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-top:22px}.activity,.sheet-choice{overflow:hidden;display:block;background:#fffaf0;border:1px solid #d4c39f;border-radius:12px;box-shadow:0 4px 12px #634a2210}.activity img{width:100%;height:135px;object-fit:cover;display:block}.activity.card img{object-position:center 37%}.activity b,.activity small{display:block;margin:13px 17px 0}.activity b{font-size:31px}.activity small{font-size:16px;margin:4px 17px 18px}.top,.controls,.palette{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.controls{justify-content:center;margin:12px 0}.top{justify-content:space-between}.reader{display:block;max-width:100%;max-height:69vh;margin:12px auto;box-shadow:0 5px 20px #3d342238}.zoom{display:block;padding:0;background:transparent;border:0;margin:auto}.zoom.full{width:100%;overflow-x:auto}.zoom.full img{max-width:none;max-height:none;width:max(1050px,100%)}.play{text-align:center;margin:24px auto;max-width:620px}.play h2{margin:12px 0}.playing-card{width:min(200px,48vw);border-radius:12px;box-shadow:0 5px 14px #342c1940;margin:14px auto;display:block}.letters button{min-width:66px;font:700 30px Georgia}.status{min-height:1.6em}.sheet-choice{padding:0 0 12px;font:600 18px Georgia;text-align:center}.sheet-choice img{display:block;width:100%;height:145px;object-fit:cover;object-position:50% 32%;margin-bottom:8px}.palette{justify-content:center;margin:14px 0}.swatch{padding:0;width:44px;height:44px;border:3px solid white;box-shadow:0 0 0 1px #b7a787}.swatch[aria-pressed=true]{outline:3px solid #253e35;outline-offset:1px}.paper{position:relative;margin:auto;width:min(100%,450px);border:1px solid #bdb19b;background:white}.paper img{display:block;width:100%}.paper canvas{position:absolute;inset:0;width:100%;height:100%;mix-blend-mode:multiply;touch-action:none}.sheet-title{text-align:center}.count{font-size:15px;color:#5c614f}.sr{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%)}@media(max-width:640px){header{height:55px}.shelf,main{min-height:calc(100svh - 55px)}.grid{gap:10px}.activities{grid-template-columns:1fr}.activity{display:grid;grid-template-columns:115px 1fr;grid-template-rows:auto auto}.activity img{grid-row:span 2;height:99px}.activity b{font-size:25px;align-self:end}.activity small{margin-bottom:10px}.hero{min-height:160px}.gallery{grid-template-columns:repeat(2,1fr)}.wrap{padding-top:14px}.reader{margin:10px auto}.top{gap:4px}.controls button{padding-inline:14px}}
.cardback{height:270px;width:min(193px,48vw);margin:14px auto;display:grid;place-items:center;background:repeating-linear-gradient(45deg,transparent 0 8px,#e4c59815 8px 9px),#80332d;border:8px double #edcb8a;color:#f1cf8d;font:66px Georgia;border-radius:12px;box-shadow:0 5px 14px #342c1940}

body.reading { overflow: hidden; }
.reading > header { display: none; }
.story-screen {
  position: fixed; inset: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  background: #102b28; color: #fff4d7;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.story-tools, .story-tools div { display: flex; align-items: center; gap: 8px; }
.story-tools { justify-content: space-between; padding: 4px 12px; }
.story-tools a { display: grid; place-items: center; min-height: 44px; padding-inline: 8px; }
.story-tools button { width: 46px; padding: 0; font-size: 1.4rem; color: #16382e; }
.story-art { container-type: size; overflow: auto; display: flex; min-height: 0; min-width: 0; }
.story-zoom { display: block; flex: none; margin: auto; width: calc(min(100cqw, 129.37595cqh) * var(--story-scale)); aspect-ratio: 1700 / 1314; padding: 0; background: transparent; border: 0; border-radius: 0; cursor: zoom-in; }
.story-zoom[aria-pressed="true"] { cursor: zoom-out; }
.story-zoom img { display: block; width: 100%; height: auto; }
.story-screen .story-bar #prev { order: -1; }
.story-bar { display: flex; align-items: center; gap: 10px; padding: 5px 12px; border-top: 1px solid #aa905a; }
.story-bar a { display: grid; place-items: center; min-height: 44px; padding: 0 6px; }
.story-bar span { flex: 1; text-align: center; font-size: .9rem; }
.story-bar button { min-width: 48px; padding: 3px 12px; background: #fff3d6; color: #16382e; font-size: 1.35rem; }

.story-tools #listen { width: auto; min-width: 80px; padding-inline: 9px; font-size: 1rem; }

body.at-shelf, .at-shelf main { background: #000; }
.at-shelf > header { display: none; }
.shelf.portal {
  min-height: 100svh; display: grid; align-content: center; justify-items: center;
  gap: clamp(12px, 2.5vh, 26px); background: #000; color: #fff0ca;
  padding: clamp(16px, 3vh, 36px) 16px;
}
.portal h1 {
  margin: 0; font: 500 clamp(44px, 8vw, 82px)/1 Georgia, serif;
  letter-spacing: -.045em; color: #f6d795;
}
.poster-link { display: grid; justify-items: center; max-width: 100%; }
.poster-frame {
  width: min(76vw, 44svh, 445px); overflow: hidden; aspect-ratio: 850 / 1100;
  border: 1px solid #c2a265; box-shadow: 0 0 45px #8c602a24;
}
.poster-frame img { display: block; width: 100%; height: 100%; transform: scale(1.065); }
.poster-ledge {
  width: min(88vw, 55svh, 545px); height: 9px; border-radius: 2px;
  background: linear-gradient(#e0b778, #8a5c38 35%, #45291d 65%, #241910);
}
.portal .cover-wordmark { display: block; width: min(84vw, 440px); height: auto; }
.poster-open {
  margin-top: 18px;
  display: inline-flex; align-items: center; gap: 12px; min-height: 44px;
  padding: 7px 23px; border-radius: 24px; color: #25180c; background: #f0d19b; font-weight: bold;
}
@media (prefers-reduced-motion: no-preference) {
  .portal.opening > * { animation: poster-reveal .55s ease-out .85s backwards; }
  .portal.opening:focus-within > * { animation: none; }
  @keyframes poster-reveal { from { opacity: 0; } to { opacity: 1; } }
}

.more-books, .shop-back { display: inline-flex; align-items: center; gap: .6em; min-height: 44px; color: #efd49f; padding: 0 12px; }
.more-books:hover, .shop-back:hover { text-decoration: underline; }
.collection { min-height: 100svh; max-width: 960px; margin: auto; padding: 12px 16px 40px; background: #000; color: #fff3d7; }
.shop-window { display: block; width: 100%; height: auto; border: 1px solid #71582e; border-radius: 4px; }
.shop-invite { margin: clamp(22px, 4vh, 42px) auto 0; max-width: 620px; text-align: center; }
.shop-invite h1 { color: #f5dc9e; font: 500 clamp(36px, 6vw, 64px)/1.04 Georgia, serif; text-wrap: balance; }
.shop-invite p { margin: 12px auto; line-height: 1.5; text-wrap: pretty; }
.shop-invite h2 { font: 500 clamp(23px, 4vw, 31px)/1.2 Georgia, serif; margin: 25px auto 0; }
.shop-buy { display: inline-block; padding: 14px 24px; margin-top: 4px; background: #f3d399; color: #281b0c; border-radius: 28px; font-weight: bold; }

.shelf.portal { position: relative; isolation: isolate; }
.christmas-trim { position: absolute; inset: 0; pointer-events: none; z-index: -1; }
.christmas-trim::before, .christmas-trim::after {
  content: ""; position: absolute; top: 0; width: min(37vw, 570px);
  aspect-ratio: 768 / 780; background: top center / contain no-repeat;
}
.christmas-trim::before { left: 0; background-image: url("art/garland-left.webp"); }
.christmas-trim::after { right: 0; background-image: url("art/garland-right.webp"); }
@media (max-width: 640px) {
  .shelf.portal { padding-top: max(84px, 20vw); }
}

.story-screen.with-rabbit { grid-template-rows: auto minmax(0, 1fr) auto auto; }
.rabbit-card {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  background: #fff2d7; color: #193d32; border-top: 2px solid #b58b4d; padding: 6px 12px;
}
.rabbit-card small { display: block; font-size: .8rem; }
.rabbit-card b { display: block; font: bold 2.3rem/1.15 Georgia, serif; }
.rabbit-card p { font-size: 1.3rem; }
#rabbit-help { width: 68px; height: 68px; padding: 0; position: relative; border: 2px solid #916a32; border-radius: 16px; }
#rabbit-help img { display: block; width: 100%; height: 100%; border-radius: 14px; }
#rabbit-help span { position: absolute; right: -4px; bottom: -4px; background: #194837; color: white; border: 1px solid #e9c987; border-radius: 50%; width: 24px; line-height: 22px; }
@media (orientation: landscape) and (max-height: 500px) {
  .rabbit-card { padding: 3px 10px; }
  #rabbit-help { width: 46px; height: 46px; }
  .rabbit-card div { display: grid; grid-template-columns: auto auto; align-items: baseline; column-gap: 16px; }
  .rabbit-card small { grid-column: span 2; }
  .rabbit-card b { font-size: 1.65rem; }
}
.books-row {display:flex; align-items:end; justify-content:center; gap:clamp(20px,5vw,80px); flex-wrap:wrap; width:100%}
.alice-cover .poster-frame {aspect-ratio:792/612;width:min(84vw,55svh,520px)}
.alice-cover .poster-frame img {transform:none}
.alice-hero {background:linear-gradient(#10281988,#102819bb),url('wonderland/scene-3.webp') center/cover;color:white}
@media(max-width:720px){.books-row {flex-direction:column;align-items:center;gap:36px}}

.goldilocks-hero {background:linear-gradient(#291a0d77,#291a0dcc),url('goldilocks/scene-3.webp') center/cover;color:white}

.pinocchio-hero {background:linear-gradient(#25190d77,#25190dcc),url('pinocchio/scene-3.webp') center/cover;color:white}

.duckling-hero {background:linear-gradient(#18281177,#182811cc),url('duckling/scene-3.webp') center/cover;color:white}

.books-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(220px,90%),1fr));gap:1.5rem;max-width:75rem;margin:auto;padding:1rem}.books-row .poster-link{width:100%;max-width:25rem;justify-self:center}.books-row .poster-frame img{object-fit:contain;width:100%;height:auto}.peter-hero{background:linear-gradient(#15281d66,#15281daa),url('peter/scene-3.webp') center/cover;color:white}.book-audio{display:grid;gap:.5em;margin:1rem auto;width:min(100%,28rem)}.book-audio audio{width:100%}
.story-tools details{background:#19271f;color:white;border-radius:.5rem;padding:.4rem}.story-tools details audio{display:block;max-width:min(17rem,82vw)}.story-tools{flex-wrap:wrap}
.shelf.portal{grid-template-columns:minmax(0,1fr);width:100%}.books-row .poster-link{min-width:0;grid-template-columns:minmax(0,1fr)}.books-row .poster-frame{width:100%;max-width:100%;height:auto}.books-row .poster-ledge{width:100%}@media(max-width:600px){.books-row{grid-template-columns:minmax(0,1fr)}}
