/* The book is a living scene beside the game, never a card inside the game. */
.game-shell.story-game{display:grid;grid-template-columns:minmax(280px,38%) minmax(0,62%);grid-template-rows:auto auto minmax(0,1fr) auto;width:100%;max-width:none;min-height:calc(100dvh - 76px);height:auto;padding:0;gap:0;background:var(--paper)}
.game-shell.story-game .game-stage{display:contents!important}
.game-shell.story-game>.game-topline{grid-column:2;grid-row:1;padding:22px 28px 10px;display:flex;flex-wrap:wrap;gap:10px 18px;align-items:center}
.game-shell.story-game .game-mode-label{margin-right:auto;gap:9px}
.game-shell.story-game .game-stats{gap:15px;margin:0;font-size:11px}
.game-shell.story-game .game-stats b{font-size:16px}
.game-shell.story-game .player-options{margin:0 0 0 auto}
.game-shell.story-game>.lesson-progress{grid-column:2;grid-row:2;margin:0 28px;padding-bottom:12px;min-width:0}
.game-shell.story-game .game-stage>.story-character-scene{grid-column:1;grid-row:1/5;position:relative;isolation:isolate;align-self:stretch;justify-self:stretch;display:flex;flex-direction:column;justify-content:flex-end;width:100%;max-width:none;min-height:620px;height:100%;margin:0;border:0;border-radius:0;background:#e8d8af;box-shadow:none;overflow:hidden}
.story-character-scene .story-environment{position:absolute;inset:0;z-index:-2;width:100%;height:100%;object-fit:cover;object-position:42% center;user-select:none;pointer-events:none}
.story-character-scene:before{content:'';position:absolute;inset:0;z-index:-1;background:linear-gradient(180deg,#fff9e410,#fff6df10 45%,#f8edcf99 77%,#f8edcfef)}
.story-character-stage{display:grid;place-items:center;flex:1;min-height:280px;padding:20px 0 0;pointer-events:none}
.story-character-scene .story-player-actor{width:min(94%,390px);background-position:0 0!important;filter:drop-shadow(0 12px 3px #514b3424);transform-origin:50% 92%;animation:story-player-breathe 4s ease-in-out infinite}
.story-character-scene[data-pose="1"] .story-player-actor{background-position:100% 0!important}
.story-character-scene[data-pose="2"] .story-player-actor{background-position:0 100%!important}
.story-character-scene[data-pose="3"] .story-player-actor{background-position:100% 100%!important;animation:story-player-cheer 560ms cubic-bezier(.2,.75,.3,1) both}
.game-shell.story-game .story-character-scene figcaption{position:relative;display:grid;grid-template-columns:minmax(0,1fr) 44px;gap:8px 14px;text-align:left;padding:24px 28px 28px;background:#fff9e4ef;border:0;border-top:1px solid #e0d9bd88;backdrop-filter:blur(8px);color:#3e523d;flex-shrink:0}
.story-character-scene .scene-page-label{grid-column:1;grid-row:1;font-size:12px!important;color:#758167;line-height:1.4;margin:0}
.story-character-scene .scene-caption-heading{display:contents}
.story-character-scene .scene-caption-heading>strong{grid-column:1;grid-row:2;font-size:24px!important;letter-spacing:-.5px;line-height:1.25;color:#2e4935}
.story-character-scene .scene-caption-heading>.icon-btn{grid-column:2;grid-row:1/3;width:44px;height:44px;align-self:center;justify-self:end;background:#fffdf1;border:1px solid #e4dec7;box-shadow:0 3px 0 #8c97651a}
.game-shell.story-game .story-character-scene figcaption>p{grid-column:1/-1;grid-row:3;margin:2px 0 0;font-size:16px;line-height:1.6;text-align:left;color:#637255}
.game-shell.story-game .story-character-scene .scene-steps{grid-column:1/-1;grid-row:4;display:flex;gap:7px;margin-top:13px}
.game-shell.story-game .story-character-scene .scene-steps>i{flex:1;height:5px;border-radius:5px;background:#e2e5d3;box-shadow:none}
.game-shell.story-game .story-character-scene .scene-steps>i.complete{background:var(--story-accent)}
.game-shell.story-game .story-character-scene .scene-steps>i.active{background:#bdcc9a;box-shadow:none}
.game-shell.story-game .story-play-space{grid-column:2;grid-row:3;display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:0;min-height:420px;width:100%;padding:22px 28px 18px;gap:0}
.game-shell.story-game .story-play-space>*{grid-column:auto;grid-row:auto;min-width:0;max-width:100%}
.game-shell.story-game .story-play-space>.target-text,.game-shell.story-game .story-play-space>.reading-prompt{width:100%;font-size:clamp(30px,3vw,44px);line-height:1.45;margin:0 0 24px;text-align:center}
.game-shell.story-game .story-play-space>.helper-subtitle{font-size:21px;margin:0 0 20px;text-align:center;line-height:1.5}
.game-shell.story-game .story-play-space>.typing-box{width:100%;max-width:none;margin:0}
.game-shell.story-game .story-play-space .word-slots{font-size:clamp(26px,2.5vw,36px);gap:12px 15px;min-height:80px}
.game-shell.story-game .story-play-space>.game-instruction{margin:8px 0 0;min-height:20px;font-size:13px}
.game-shell.story-game .story-play-space>.keyboard-guide{width:100%;max-width:none;margin:28px 0 0;padding:0;flex-shrink:0}
.game-shell.story-game .story-play-space .guide-key,.game-shell.story-game .story-play-space .guide-key.has-legend{height:clamp(28px,4.5dvh,42px);font-size:12px}
.game-shell.story-game .story-play-space .guide-key.decorative{font-size:9px}
.game-shell.story-game .story-play-space .guide-key .key-legend{font-size:8px}
.game-shell.story-game .story-play-space .guide-layout{display:none}
.game-shell.story-game .story-play-space>.round-result{width:100%;margin:0}
.game-shell.story-game .story-play-space>.listening-stage,.game-shell.story-game .story-play-space>.recall-ready,.game-shell.story-game .story-play-space>.reading-tools{width:100%;margin:0 0 20px}
.game-shell.story-game .story-play-space>.meaning-check{width:100%;margin-top:14px}
.game-shell.story-game .story-play-space .meaning-option{min-height:50px;font-size:16px}
.game-shell.story-game>.game-actions{grid-column:2;grid-row:4;display:flex;justify-content:center;gap:24px;margin:0;padding:12px 28px 18px;min-height:52px;font-size:12px;border:0}
.game-shell.story-game>.game-actions button{min-height:40px}
@keyframes story-player-breathe{0%,100%{transform:translateY(0) rotate(-.6deg)}50%{transform:translateY(-5px) rotate(.6deg)}}
@keyframes story-player-cheer{0%{transform:translateY(0) scale(.97)}40%{transform:translateY(-22px) rotate(-4deg)}75%{transform:translateY(0) rotate(2deg)}100%{transform:translateY(0) rotate(0)}}
@media(min-width:761px) and (max-width:1100px){.game-shell.story-game{grid-template-columns:minmax(270px,36%) minmax(0,64%)}.game-shell.story-game .game-stats{gap:9px}.game-shell.story-game .player-options{width:100%;display:flex;justify-content:flex-end}.game-shell.story-game .story-play-space{padding-inline:22px}.game-shell.story-game .story-character-scene figcaption{padding-inline:22px}.story-character-scene .scene-caption-heading>strong{font-size:22px!important}}
@media(max-width:760px){.game-shell.story-game{grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto auto minmax(0,1fr) auto;min-height:calc(var(--app-height) - 60px);height:auto!important;padding:0}.game-shell.story-game .game-stage>.story-character-scene{grid-column:1;grid-row:1;display:grid;grid-template-columns:120px minmax(0,1fr);min-height:190px;height:auto!important;max-height:none;border-radius:0;margin:0!important}.story-character-scene .story-environment{object-position:center 65%}.story-character-stage{grid-column:1;grid-row:1;min-height:190px;padding:0;align-items:end}.story-character-scene .story-player-actor{width:150px;max-width:none;margin-left:12px}.game-shell.story-game .story-character-scene figcaption{grid-column:2;grid-row:1;align-self:center;background:#fff9e4e6;padding:15px 16px 17px;margin:12px 12px 12px 20px;border:0;border-radius:16px;gap:5px 8px}.story-character-scene .scene-caption-heading>strong{font-size:19px!important}.game-shell.story-game .story-character-scene figcaption>p{font-size:13px;line-height:1.5}.story-character-scene .scene-page-label{font-size:10px!important}.game-shell.story-game .story-character-scene .scene-steps{margin-top:8px}.game-shell.story-game>.game-topline{grid-column:1;grid-row:2;padding:14px 18px 5px;display:flex;flex-wrap:wrap;gap:8px}.game-shell.story-game .game-stats{gap:10px}.game-shell.story-game .game-stats b{font-size:14px!important}.game-shell.story-game>.lesson-progress{grid-column:1;grid-row:3;margin-inline:18px;padding-bottom:0}.game-shell.story-game .story-play-space{grid-column:1;grid-row:4;min-height:280px;padding:24px 18px 18px}.game-shell.story-game .story-play-space>.target-text,.game-shell.story-game .story-play-space>.reading-prompt{font-size:28px!important;margin:0 0 20px!important}.game-shell.story-game .story-play-space>.helper-subtitle{font-size:18px;margin-bottom:16px!important}.game-shell.story-game .story-play-space>.keyboard-guide{margin-top:20px}.game-shell.story-game>.game-actions{grid-column:1;grid-row:5;padding:0 18px 8px;gap:12px;min-height:48px}.game-shell.story-game>.game-actions button{min-height:48px}.phone-keyboard .game-shell.story-game .game-stage>.story-character-scene{min-height:92px;grid-template-columns:85px minmax(0,1fr)}.phone-keyboard .story-character-stage{min-height:92px}.phone-keyboard .story-character-scene .story-player-actor{width:97px;margin-left:0}.phone-keyboard .game-shell.story-game .story-character-scene figcaption{margin:8px 10px 8px 8px;padding:10px 12px}.phone-keyboard .story-character-scene .scene-caption-heading>strong{font-size:16px!important}.phone-keyboard .game-shell.story-game .story-play-space{min-height:170px;padding-top:18px}}
@media(max-width:760px) and (orientation:landscape){.game-shell.story-game{grid-template-columns:34% minmax(0,66%);grid-template-rows:auto auto minmax(0,1fr) auto}.game-shell.story-game .game-stage>.story-character-scene{grid-column:1;grid-row:1/5;display:flex;min-height:370px;height:100%!important}.story-character-stage{min-height:170px}.story-character-scene .story-player-actor{width:180px;margin:0}.game-shell.story-game .story-character-scene figcaption{margin:0;border-radius:0;padding:12px;width:100%}.game-shell.story-game>.game-topline{grid-column:2;grid-row:1;padding:10px 16px 5px}.game-shell.story-game>.lesson-progress{grid-column:2;grid-row:2;margin-inline:16px}.game-shell.story-game .story-play-space{grid-column:2;grid-row:3;min-height:220px;padding:16px}.game-shell.story-game>.game-actions{grid-column:2;grid-row:4}}
@media(prefers-reduced-motion:reduce){.story-character-scene .story-player-actor{animation:none!important;transform:none!important}}
.less-motion .story-character-scene .story-player-actor{animation:none!important;transform:none!important}
