/* The selected panel expands within its own sheet. There is no overlay or modal. */
#comicTrack{overflow-anchor:none;gap:44px;padding-left:max(12vw,28px);padding-right:max(12vw,28px)}
.gibi-sheet{position:relative}.q-panel{transform-origin:0 0}
.focus-sheet{width:clamp(360px,calc(100dvh - 265px),650px);padding:10px;z-index:12;box-shadow:7px 8px #30263b40}
.focus-sheet .sheet-title{height:25px;padding-right:110px;font-size:9px}
.focus-sheet .gibi-grid{display:block}.focus-sheet .q-panel:not(.focus-panel){display:none}
.focus-panel{position:relative;z-index:2}.focus-panel .q-visual{width:100%;margin:0;border:0}
.focus-panel .q-label{font-size:clamp(11px,1.2vw,14px);padding:6px 8px}
.focus-panel .q-caption{min-height:0;font-size:clamp(12px,1.3vw,15px);padding:9px 11px;line-height:1.3}
.focus-panel .scene-open{cursor:zoom-out}.focus-panel .scene-open span{display:none}
.scene-return{position:absolute;right:10px;top:8px;border:0;border-bottom:1px solid #30263b;background:transparent;color:#30263b;padding:3px 0;font:700 10px 'Trebuchet MS',sans-serif;z-index:10;cursor:pointer;box-shadow:none}
.inline-scene-nav{position:absolute;inset:45% -38px auto;display:flex;justify-content:space-between;pointer-events:none;z-index:10}
.inline-scene-nav button{width:32px;height:44px;padding:0;border:0;border-radius:16px;background:#fff5dfe8;color:#30263b;font:700 34px/1 sans-serif;cursor:pointer;pointer-events:auto;box-shadow:1px 2px #30263b30}
.inline-scene-nav button:disabled{opacity:.2;cursor:default}
.focus-panel .q-balloon{font-size:clamp(14px,1.65vw,20px);animation:inline-speech .4s .5s both;max-width:82%;padding:10px 14px;border-radius:24px}
.focus-panel .expanded-scene[data-mood=music] .q-balloon{left:auto;right:3%;top:15%;bottom:auto;translate:0 0;max-width:40%;font-size:clamp(13px,1.5vw,18px)}
.focus-panel .scene-effects{opacity:1}
.inline-reading #comicTrack .q-visual:not(.expanded-scene) .layer-motion,.inline-reading #comicTrack .q-visual:not(.expanded-scene) .scene-effects i{animation-play-state:paused!important}
@keyframes inline-speech{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}
/* Four drawn gestures replace the static hand and face of the music scene. */
.harp-frames{width:100%;height:100%;background-image:url('assets/layers/harp-performance.webp');background-size:200% 200%;background-position:0 0;background-repeat:no-repeat;animation:harp-performance 3.2s steps(1,end) infinite;animation-play-state:paused}
.scene-visible .harp-frames,.expanded-scene .harp-frames{animation-play-state:running}
.inline-reading .q-visual:not(.expanded-scene) .harp-frames{animation-play-state:paused}
[data-motion=harp]>.layer-motion{animation:none;transform:none}
.sheep-listen .layer-motion{animation:sheep-listen 3.2s ease-in-out infinite;animation-delay:var(--delay)}
[data-mood=music] .scene-effects i{animation-duration:3.2s;left:calc(62% + var(--n)*7%);top:calc(45% - var(--n)*6%);font-size:24px}
@keyframes harp-performance{0%,100%{background-position:0 0}25%{background-position:100% 0}50%{background-position:0 100%}75%{background-position:100% 100%}}
@keyframes sheep-listen{0%,100%{transform:rotate(-1deg)}25%{transform:translateY(-3%) rotate(2deg)}50%{transform:translateY(0) rotate(-1deg)}75%{transform:translateY(-1%) rotate(1deg)}}
body.motion-paused .harp-frames{animation-play-state:paused!important}
@media(prefers-reduced-motion:reduce){.harp-frames,.focus-panel .q-balloon{animation:none!important}.focus-panel .q-balloon{opacity:1}}
@media(max-width:760px){#comicTrack{gap:38px;padding-left:18px;padding-right:18px}.focus-sheet{width:min(calc(100vw - 38px),calc(100dvh - 230px));min-width:260px}.inline-scene-nav{inset:45% -12px auto}.inline-scene-nav button{width:28px;height:40px}.focus-sheet .sheet-title{font-size:8px}.scene-return{font-size:9px}.focus-panel .q-balloon{font-size:14px;padding:8px 10px}.focus-panel .expanded-scene[data-mood=music] .q-balloon{font-size:12px;max-width:43%}}
@media(max-height:650px){.focus-sheet{width:clamp(270px,calc(100dvh - 195px),450px)}}

body.motion-paused .focus-panel .q-balloon{animation:none!important;opacity:1;transform:none}
/* Give the first and last page enough space to sit at the viewport center. */
#comicTrack{padding-left:max(20px,calc((100vw - clamp(380px,calc(100dvh - 310px),650px))/2));padding-right:max(20px,calc((100vw - clamp(380px,calc(100dvh - 310px),650px))/2))}
.inline-reading #comicTrack{padding-left:max(20px,calc((100vw - clamp(360px,calc(100dvh - 265px),650px))/2));padding-right:max(20px,calc((100vw - clamp(360px,calc(100dvh - 265px),650px))/2))}
@media(max-width:760px){.gibi-sheet{width:min(calc(100vw - 38px),calc(100dvh - 290px));min-width:280px}.focus-sheet{width:min(calc(100vw - 38px),calc(100dvh - 230px));min-width:260px}#comicTrack,.inline-reading #comicTrack{padding-left:19px;padding-right:19px}}
