/* Illustrated spreads adapt to portrait, natural landscape and the game's rotated mode. */
.picturebook-dialog{width:min(1120px,calc(100vw - 32px));max-width:none;height:min(760px,calc(100dvh - 32px));max-height:none;padding:0;border:1px solid #e0d1b6;border-radius:24px;background:#fffbef;overflow:hidden;box-shadow:0 30px 100px #263f4655;text-align:left}
.picturebook-dialog::backdrop{background:#23382be0;backdrop-filter:blur(8px)}
.picturebook-dialog #dialog-body,.picturebook-panel{height:100%;min-height:0}.picturebook-panel{display:flex;flex-direction:column}
.book-top{display:flex;align-items:center;gap:18px;padding:14px 22px;border-bottom:1px solid #e8dfcb;color:#859077;font-size:12px;flex-shrink:0}.book-top>span:first-child{font-weight:750;flex:1}.book-top button{border:0;background:#f0eadb;border-radius:20px;padding:9px 14px;font-size:12px;min-height:40px}
.book-spread{display:grid;grid-template-columns:1.18fr 1fr;min-height:0;flex:1}.book-art{display:block;position:relative;isolation:isolate;padding:0;border:0;background:#e8efdf;overflow:hidden;min-height:0;cursor:pointer;width:100%;height:100%;border-radius:0}.book-art::before{content:"";position:absolute;inset:-24px;z-index:0;background-image:var(--book-image);background-position:center;background-size:cover;filter:blur(18px);opacity:.35}.book-art img{position:relative;z-index:1;width:100%;height:100%;object-fit:contain;object-position:center;animation:book-drift 16s ease-in-out infinite alternate;filter:saturate(.92)}.book-art-note{position:absolute;bottom:14px;left:14px;right:14px;width:max-content;max-width:calc(100% - 28px);font-size:10px;color:#fffdf5;background:#394d3670;padding:7px 10px;border-radius:20px;z-index:2}.book-specks{z-index:2;position:absolute;inset:20% 5%;color:#fff6c0;font-size:45px;letter-spacing:25px;pointer-events:none;animation:specks 5s ease-in-out infinite;opacity:.8;text-shadow:0 0 15px #fff8b9}.book-spark{z-index:3;position:absolute;left:50%;top:45%;font-size:72px;color:#fff6a6;text-shadow:0 4px 18px #a58354;animation:book-spark .95s ease-out both;pointer-events:none}
.book-words{min-height:0;overflow:auto;padding:28px 32px 20px;scrollbar-width:thin;scrollbar-color:#d4d9c2 transparent}.book-speaker{display:flex;align-items:center;gap:12px;font-size:13px;font-weight:700}.book-speaker img{border-radius:50%;width:44px;height:44px}.book-speaker small{display:block;font-size:10px;font-weight:400;color:#a2a28c;margin-top:5px}.picturebook-dialog h2{font-size:30px;line-height:1.35;letter-spacing:1px;margin:18px 0;color:#4b654e}.book-narration{font-size:16px;line-height:2;color:#6d795f;margin:0}.book-words blockquote{margin:20px 0 14px;padding:14px 16px;border-radius:0 14px 14px 14px;border-left:3px solid var(--speaker);background:#f3eddb;font-size:17px;line-height:1.8;color:#647653;animation:book-line .45s ease both}.book-question{font-size:12px;line-height:1.7;color:#a08a61;margin:14px 0 0}.book-bottom{padding:10px 22px 12px;border-top:1px solid #e8dfcb;flex-shrink:0}.book-progress{height:3px;border-radius:3px;background:#e9e6d5;overflow:hidden;margin-bottom:12px}.book-progress i{display:block;height:100%;background:#ccae76;transition:width .15s linear}.book-controls{display:flex;align-items:center;gap:10px}.book-controls button{min-height:44px;padding:10px 17px;border:1px solid #dedecb;border-radius:12px;background:#fffdf3;font-size:13px;white-space:nowrap}.book-controls .primary{margin-left:auto;background:#b68f60;color:#fff}.book-controls #book-auto[aria-pressed=true]{background:#e4eedb;border-color:#a3ba8e}.book-source{display:block;font-size:9px;color:#aaa692;margin-top:8px;line-height:1.4}
.book-paused .book-art img,.book-paused .book-specks{animation-play-state:paused}.book-paused .book-art img{animation-play-state:running}
@keyframes book-drift{from{transform:scale(1.01) translate(-.3%,0)}to{transform:scale(1.025) translate(.3%,-.3%)}}@keyframes specks{50%{transform:translate(12px,-14px);opacity:.35}}@keyframes book-spark{from{opacity:0;transform:translate(-50%,20%) scale(.4)}20%{opacity:1}to{opacity:0;transform:translate(-50%,-80%) scale(1.4)}}@keyframes book-line{from{opacity:0;transform:translateY(7px)}to{opacity:1;transform:none}}
@media(max-width:650px) and (orientation:portrait){.picturebook-dialog{width:calc(100vw - 16px);height:calc(100dvh - 16px);border-radius:17px}.book-top{padding:8px 12px;gap:10px;font-size:11px}.book-spread{display:flex;flex-direction:column;overflow:auto}.book-art{min-height:210px;height:35%;max-height:300px;flex-shrink:0}.book-words{overflow:visible;padding:17px 20px 22px}.book-speaker img{width:34px;height:34px}.book-speaker small{font-size:9px}.picturebook-dialog h2{font-size:24px;margin:13px 0 10px}.book-narration{font-size:15px;line-height:1.85}.book-words blockquote{font-size:15px;line-height:1.7;padding:12px 14px;margin:15px 0 10px}.book-bottom{padding:9px 12px}.book-controls{gap:6px}.book-controls button{font-size:12px;padding:9px 11px}.book-source{font-size:8px}.book-question{font-size:11px}}
@media(orientation:landscape) and (max-height:550px){.picturebook-dialog{width:calc(100vw - 18px);height:calc(100dvh - 14px);border-radius:16px}.book-top{padding:4px 12px;font-size:10px;gap:12px}.book-top button{padding:5px 10px;min-height:32px}.book-spread{grid-template-columns:1.15fr 1fr}.book-words{padding:12px 18px}.book-speaker img{width:30px;height:30px}.book-speaker small{display:none}.picturebook-dialog h2{font-size:20px;margin:9px 0}.book-narration{font-size:13px;line-height:1.8}.book-words blockquote{font-size:13px;line-height:1.6;padding:9px 12px;margin:12px 0 9px}.book-question{font-size:10px;margin:8px 0}.book-bottom{padding:6px 12px}.book-source{display:none}.book-progress{margin-bottom:6px}.book-controls button{min-height:38px;padding:7px 12px;font-size:12px}}
body.rotated-play .picturebook-dialog{width:calc(100dvh - 18px);height:calc(100dvw - 14px);max-height:none;max-width:none;padding:0;border-radius:16px}body.rotated-play .picturebook-dialog .book-top{padding:4px 12px;font-size:10px}body.rotated-play .picturebook-dialog .book-top button{padding:5px 10px;min-height:32px}body.rotated-play .picturebook-dialog .book-spread{display:grid;grid-template-columns:1.15fr 1fr;overflow:hidden}body.rotated-play .picturebook-dialog .book-art{height:100%;min-height:0;max-height:none}body.rotated-play .picturebook-dialog .book-words{overflow:auto;padding:12px 18px}body.rotated-play .picturebook-dialog h2{font-size:20px;margin:9px 0}body.rotated-play .picturebook-dialog .book-narration{font-size:13px;line-height:1.8}body.rotated-play .picturebook-dialog blockquote{font-size:13px;line-height:1.6;padding:9px 12px;margin:12px 0 9px}body.rotated-play .picturebook-dialog .book-bottom{padding:6px 12px}body.rotated-play .picturebook-dialog .book-source{display:none}body.rotated-play .picturebook-dialog .book-speaker img{width:30px;height:30px}body.rotated-play .picturebook-dialog .book-speaker small{display:none}body.rotated-play .picturebook-dialog .book-controls button{min-height:38px;padding:7px 12px;font-size:12px}body.rotated-play .picturebook-dialog .book-progress{margin-bottom:6px}
.book-cover{width:100%;height:100%;object-fit:cover}.memory-art .book-cover{position:absolute;inset:0}.memory-art{min-height:195px}.memory-art:has(.book-cover)>small{background:#fff9e8d9;padding:6px;bottom:0;color:#7b896d}.picturebook-home{margin:18px 0 0;padding:14px 0;border-top:1px solid #dbdccb;font-size:12px;line-height:1.8;color:#7e8b6e}.theme-options{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;margin:18px 0}.theme-options button{padding:18px 12px;min-height:56px;border:1px solid #dde0d0;background:#f6f6e9;border-radius:15px;font-size:14px}.theme-options button[aria-pressed=true]{border-color:#8ca379;background:#e1ebd8}.screen-tools{gap:5px!important}#theme-screen{font-size:12px}
@media(prefers-reduced-motion:reduce){.book-art img,.book-specks,.book-spark,.book-words blockquote{animation:none!important}.book-progress i{transition:none}}
@media(orientation:landscape) and (max-height:550px){.theme-options{grid-template-columns:repeat(5,1fr);gap:6px;margin:12px 0}.theme-options button{font-size:12px;padding:12px 7px;min-height:54px}}
body.rotated-play .theme-options{grid-template-columns:repeat(5,1fr);gap:6px;margin:12px 0}body.rotated-play .theme-options button{font-size:12px;padding:12px 7px;min-height:54px}
