/* Stories inherits the existing Word Garden paper, palettes, and local type. */
.stories-page {--story-shadow:0 8px 22px #1523321a}
.stories-page ::selection{background:var(--bright);color:var(--ink)}
#book-shelf{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:28px}
.book-choice{background:none;border:0;padding:0 0 18px;color:var(--ink);text-align:left;font:inherit;cursor:pointer}
.book-choice img{width:100%;aspect-ratio:3/2;object-fit:cover;border-radius:12px;box-shadow:var(--story-shadow);display:block;margin-bottom:18px}
.book-choice h2{font:600 30px/1.15 var(--display);margin:0 0 10px}
.book-choice strong{display:block;font-size:17px}.book-choice p{margin:5px 0 0;font-size:17px}
.book-choice:hover img{outline:3px solid var(--ink);outline-offset:4px}
.reader-heading{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:16px 0 8px}.reader-heading h1{font-size:32px;margin:0}.reader-heading span{white-space:nowrap;font-size:16px}
.reader-toolbar{display:flex;justify-content:space-between;gap:16px;margin:0 0 12px}.reader-toolbar .icon-button{background:var(--paper)}
#story-content{max-width:900px;margin:auto}
.story-scene{position:relative;margin:0 auto;container-type:inline-size;max-width:690px}
.story-scene>img{display:block;width:100%;aspect-ratio:3/2;object-fit:contain;border-radius:12px}
.scene-letter{position:absolute;transform:translate(-50%,-50%);font-family:Andika,sans-serif;font-weight:700;line-height:1.2;color:#25323b;pointer-events:none}
.story-text{font:400 34px/1.55 Andika,sans-serif;text-align:center;margin:14px auto 4px;max-width:850px;white-space:normal}
.story-sentence{border-radius:6px}.story-sentence.active-sentence{background:color-mix(in srgb,var(--bright) 25%,var(--paper))}
.story-word{display:inline-block;border-radius:6px;padding:0 3px}.story-word.reading{background:var(--bright);color:var(--ink);text-decoration:underline;text-underline-offset:6px;text-decoration-thickness:2px}
button.story-word{background:transparent;color:var(--ink);border:0;font:inherit;min-height:52px;padding:0 6px 10px;position:relative;vertical-align:baseline;cursor:pointer}
button.story-word.reading{background:var(--bright)}button.story-word.glowing{background:var(--bright);text-decoration:underline;text-underline-offset:6px;animation:word-invite 2s ease-in-out infinite}
button.story-word.child-done{background:color-mix(in srgb,var(--bright) 35%,var(--paper))}
.story-word .sight-leaf{position:absolute;left:calc(50% - 8px);bottom:-1px;width:16px;height:12px;stroke:var(--ink);fill:var(--soft);stroke-width:1.5}
#page-controls{display:flex;justify-content:space-between;gap:24px;max-width:900px;margin:18px auto 28px;min-height:64px}
#next-page{margin-left:auto;background:var(--bright)}#page-controls .icon-button{width:72px;height:72px}
#start-story{position:relative;display:block;max-width:650px;width:100%;padding:0;background:none;border:0;margin:0 auto;cursor:pointer;color:var(--ink)}
#start-story>img{width:100%;display:block;border-radius:12px;box-shadow:var(--story-shadow)}
.start-play{display:grid;place-items:center;width:96px;height:96px;position:absolute;left:calc(50% - 48px);top:calc(50% - 48px);background:var(--paper);border:3px solid var(--ink);border-radius:50%}
.start-play svg{width:40px;height:40px;stroke:var(--ink);fill:var(--bright);stroke-width:2}
.question-guide{display:block;margin:0 auto 16px;width:190px;height:190px;object-fit:contain}
.story-choices{display:flex;justify-content:center;align-items:stretch;gap:24px;flex-wrap:wrap}
.story-answer{min-width:96px;min-height:96px;width:220px;height:190px;background:var(--white);border:3px solid transparent;border-radius:14px;padding:12px;cursor:pointer;color:var(--ink);font:700 96px Andika,sans-serif;position:relative}
.story-answer img{width:100%;height:100%;object-fit:contain;pointer-events:none}
.story-answer .story-scene{width:100%;height:100%;display:flex;align-items:center}
.story-answer .story-scene>img{width:100%;height:auto}
.story-answer:hover{border-color:var(--ink)}.story-answer.correct{border-color:var(--ink);background:var(--bright)}
.story-answer.correct:after{content:'';position:absolute;right:10px;top:10px;width:18px;height:10px;border-bottom:4px solid var(--ink);border-left:4px solid var(--ink);transform:rotate(-45deg)}
.story-finish{display:flex;flex-direction:column;align-items:center;gap:20px;padding:20px}.story-finish img{width:260px;height:260px;object-fit:contain}.story-finish h2{font:600 42px var(--display);margin:0}
.story-finish .finish-actions{display:flex;gap:24px}
@keyframes word-invite{50%{background:color-mix(in srgb,var(--bright) 55%,var(--paper))}}
@media(min-width:701px) and (max-height:850px){.story-scene{max-width:560px}.reader-heading{padding-top:12px}.stories-page .sounds-header{padding-block:4px}.story-text{margin-top:10px}.reader-toolbar{margin-bottom:8px}}
@media(max-width:700px){
 #book-shelf{grid-template-columns:1fr;gap:25px}.book-choice{display:grid;grid-template-columns:42% 1fr;gap:0 18px;align-items:start}.book-choice img{grid-row:1/4;margin:0}.book-choice h2{font-size:25px}.book-choice strong,.book-choice p{font-size:15px}
 .stories-page .sounds-welcome{min-height:205px}.stories-page .sounds-welcome h1{font-size:36px}.reader-heading h1{font-size:28px}.reader-heading{gap:8px}.story-text{font-size:28px;line-height:1.6}.story-choices{gap:8px}.story-answer{width:calc((100% - 16px)/3);height:130px;padding:3px;min-width:96px}.question-guide{width:170px;height:170px}.story-answer:has(.story-scene){width:100%;height:auto;min-height:130px;max-width:290px}.story-answer .story-scene{max-width:none}#page-controls{margin-top:16px}.start-play{width:80px;height:80px;left:calc(50% - 40px);top:calc(50% - 40px)}
}
@media(prefers-reduced-motion:reduce){.stories-page *{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

#theater-pick{width:100%;margin:0 0 32px;padding:0;display:flex;align-items:center;gap:clamp(14px,3vw,38px);text-align:left;color:var(--ink);background:color-mix(in srgb,var(--bright) 18%,var(--paper));border:0;border-radius:12px;overflow:hidden;font:inherit;cursor:pointer}
#theater-pick>img{display:block;width:36%;max-width:330px;height:auto}
#theater-pick>span{display:grid;gap:5px;padding-block:10px}
#theater-pick small,.theater-caption small{font:700 16px/1.25 Andika,sans-serif}
#theater-pick strong{font:600 clamp(25px,4vw,47px)/1.05 var(--display)}
#theater-pick b{font:400 46px/1 Andika,sans-serif;margin-left:auto;margin-right:4%}
#story-reader[data-book="three-little-taps"]{max-width:940px;margin:0 auto}
#story-reader[data-book="three-little-taps"] .reader-heading{padding:14px 0}
#story-reader[data-book="three-little-taps"] .reader-toolbar{margin-bottom:8px}
.leaf-stage{position:relative;display:block;width:min(100%,calc((100svh - 380px)*1.8));min-width:min(100%,360px);margin:auto;border:0;border-radius:12px;background:transparent;padding:0;overflow:hidden}
button.leaf-stage{cursor:pointer}
.leaf-stage img{width:100%;height:auto;display:block}
.leaf-action{position:absolute;bottom:2.5%;left:50%;transform:translateX(-50%);background:var(--paper);color:var(--ink);border:1.5px solid currentColor;border-radius:100px;padding:4px 18px;font:700 clamp(14px,2vw,19px)/1.4 Andika,sans-serif;white-space:nowrap}
.theater-caption{text-align:center;margin:10px auto 0;color:var(--ink)}
.theater-caption p{margin:2px auto;font:400 clamp(24px,3vw,34px)/1.25 Andika,sans-serif}
#story-reader[data-book="three-little-taps"] #page-controls{margin:10px auto 16px;max-width:760px;min-height:0}
#continue-act{background:var(--bright)}
@media(max-width:600px){#theater-pick{gap:12px}#theater-pick>img{width:33%;align-self:stretch;object-fit:cover}#theater-pick>span>span{font-size:15px}#theater-pick b{font-size:30px;margin-right:10px}.leaf-stage{width:100%}}
