#app[data-screen=intro]{display:block;background:#f4e8d0}
.story-intro{height:100dvh;width:100%;overflow:hidden;position:relative;background:#f4e8d0 url('./story-paper.svg') repeat}
.story-tools{position:absolute;top:10px;left:12px;right:12px;display:flex;gap:9px;z-index:5}.story-tools button:last-child{margin-left:auto}
.story-intro button:not(.story-game-surface *) svg{width:22px;height:22px;display:block;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.story-intro button:not(.story-game-surface *){display:grid;place-items:center;padding:7px 12px;min-width:44px;min-height:38px;color:#3e281b;flex:none}
.story-stage{position:absolute;inset:0;overflow:hidden}
.story-paper{position:absolute;left:50%;top:calc(50% - 10px);width:3600px;height:3300px;transform-origin:0 0;will-change:transform;isolation:isolate}
.story-paper:before{content:'';position:absolute;inset:-1200px;background:#f4e8d0 url('./story-paper.svg') repeat;z-index:-1;pointer-events:none}
.story-frame{position:absolute;margin:0;transform-origin:center;isolation:isolate;cursor:pointer;background:none}
.story-window{position:absolute;inset:0;overflow:hidden}
.story-frame img{width:100%;height:100%;display:block;object-fit:cover}
.story-edge{position:absolute;inset:0;width:100%;height:100%;z-index:2;pointer-events:none;fill:none;stroke-linejoin:round}
.story-edge path{vector-effect:non-scaling-stroke}
.story-paper-lip{stroke:#f4e8d0;stroke-width:16}
.story-hand-ink{stroke:#5c412d;stroke-width:2.1;opacity:.87}
.story-pencil{stroke:#6b4d35;stroke-width:.8;opacity:.4}
.story-controls{position:absolute;bottom:12px;left:50%;translate:-50% 0;padding:4px 8px;background:#f4e8d0d9;display:flex;align-items:center;justify-content:center;gap:12px;z-index:5;flex:none;max-width:96vw}
.story-pages{display:flex;align-items:center;gap:7px}
.story-pages button{position:relative;min-width:0;width:26px;min-height:24px;height:24px;padding:6px 2px;border:0;border-image:none;background:none;box-shadow:none}
.story-pages button span{display:block;position:relative;width:100%;height:6px;background:#dbbd8b;border:1px solid #422d21;rotate:-2deg;overflow:hidden}
.story-pages button:nth-child(2n) span{rotate:2deg}
.story-pages button span:after{content:'';position:absolute;inset:0;background:#ffc74c;transform:scaleX(var(--read,0));transform-origin:left}
.story-pages button.current span{height:9px;border-color:#ffe0a2;background:#b07745}
.story-intro .story-retry{position:absolute;left:50%;top:50%;translate:-50% -50%;z-index:6}
.story-intro .story-retry[hidden]{display:none}
.story-portal{position:absolute;margin:0;overflow:visible}
.story-game-surface{position:absolute;inset:0;transform-origin:0 0;overflow:hidden}
.story-game-surface canvas{display:block;width:100%;height:100%}
.story-portal-border{position:absolute;inset:-3px;border:5px solid #5c412d;outline:12px solid #f4e8d0;rotate:-.3deg;pointer-events:none}
.story-portal.opening .story-portal-border{animation:story-border-away 1.6s both}
@keyframes story-border-away{0%,45%{opacity:1}100%{opacity:0}}
@media(max-height:550px) and (orientation:landscape){
 .story-tools{top:5px;left:8px;right:8px;gap:6px}
 .story-intro button:not(.story-game-surface *){min-height:29px;min-width:33px;padding:4px 8px}.story-intro button:not(.story-game-surface *) svg{width:18px;height:18px}
 .story-controls{bottom:5px;gap:8px;padding:3px 6px}.story-pages{gap:5px}.story-pages button{min-width:0;width:20px;min-height:24px;padding:5px 1px}
}
@media(max-height:290px) and (orientation:landscape){.story-controls{gap:5px}.story-pages{gap:3px}.story-pages button{width:18px}.story-tools button{min-width:30px;padding:3px}}


.story-entering .story-controls,.story-entering .story-tools{visibility:hidden;pointer-events:none}
.story-game-surface .game-scene{height:100%;width:100%}
