/* Opening artwork, editable narration and controls stay inside the phone frame. */
#game-entry.story-opening{display:block;padding:0;background:#09161f;color:#f8e8c7}
.opening-page{height:100%;position:relative;isolation:isolate;overflow:hidden;display:flex;flex-direction:column;justify-content:space-between}
.opening-art{position:absolute;inset:0 0 165px;z-index:-2;overflow:hidden;background:#152b34}
.opening-art img{width:100%;height:100%;max-width:none;object-fit:cover;object-position:50% 36%;transform-origin:50% 42%}
.opening-art:after{content:"";position:absolute;inset:0;background:linear-gradient(#06101b7a,transparent 23%,transparent 72%,#09161f)}
.opening-light{position:absolute;inset:0;background:radial-gradient(ellipse at 67% 46%,#ffd88522,transparent 44%);mix-blend-mode:screen;pointer-events:none}
.opening-grain{position:absolute;inset:0;background:radial-gradient(#0b192533 .6px,transparent .8px);background-size:4px 4px;opacity:.18;pointer-events:none}
.opening-top{display:flex;justify-content:space-between;align-items:center;gap:14px;padding:calc(16px + env(safe-area-inset-top)) 18px 12px;flex-shrink:0}
.opening-top>img{width:100px;height:auto;filter:drop-shadow(0 2px 3px #0009)}
.opening-top-actions{display:flex;align-items:center;gap:10px}
.opening-top #opening-skip{border:1px solid #f2dbb65e;border-radius:4px;background:#0b1a26bd;color:#f5e6c8;font-size:12px;padding:8px 12px;min-height:38px;backdrop-filter:blur(8px)}
.story-opening .entry-music{position:static;width:38px;height:38px;min-height:38px;padding:9px;border-radius:50%;background:#0b1a26bd;box-shadow:none;flex-shrink:0}
.story-opening .entry-music svg{width:18px;height:18px}
.opening-copy{position:relative;flex-shrink:0;padding:20px 22px calc(22px + env(safe-area-inset-bottom));background:linear-gradient(0deg,#09161f 86%,#09161fe8);isolation:isolate}
.opening-copy:before{content:"";position:absolute;inset:-58px 0 99%;background:linear-gradient(transparent,#09161fe8);z-index:-1;pointer-events:none}
.opening-progress{display:flex;gap:5px;margin:0 0 13px}
.opening-progress i{height:2px;flex:1;background:#6a736e55}
.opening-progress i.read{background:#bc965a}
.opening-progress i.current{height:3px;background:#ffc362;box-shadow:0 0 8px #ffc36266}
.opening-counter{display:flex;justify-content:space-between;gap:8px;color:#d8b475;font-size:10px;font-weight:700;letter-spacing:1px;margin-bottom:11px}
.opening-counter b{color:#9d9b8b;font-size:10px;letter-spacing:1.2px;font-weight:600}
.opening-narration h1{font-size:clamp(21px,5.7vw,29px);line-height:1.28;letter-spacing:.1px;font-weight:900;color:#ffe9bd;margin:0 0 10px;text-wrap:balance}
.opening-body{font-size:13px;line-height:1.75;color:#e1e1d3;margin:0;max-width:40em}
.opening-aside{font-size:11px;line-height:1.6;color:#c9a46a;margin:10px 0 0;padding-left:9px;border-left:2px solid #b78b45;text-wrap:pretty}
.opening-controls{display:flex;gap:10px;margin-top:18px}
.opening-controls button{border-radius:4px;min-height:46px;font-weight:800;font-size:14px;letter-spacing:.4px}
#opening-back{padding:8px 13px;background:transparent;border:1px solid #b8945955;color:#d1bd98}
#opening-back:disabled{opacity:.24}
#opening-next{position:relative;overflow:hidden;flex:1;padding:9px 12px;background:linear-gradient(120deg,#ffce71,#ffa02e);border:1px solid #ffdf99;color:#14232b;box-shadow:2px 4px 0 #030b12}
#opening-next:after{content:"";position:absolute;inset:0;background:radial-gradient(#603c1e55 .65px,transparent .8px);background-size:4px 4px;opacity:.13;pointer-events:none}
.opening-image-error{position:absolute;left:20px;right:20px;top:35%;text-align:center;color:#fff0d1;font-size:13px}
.opening-page[data-motion="true"] .opening-art img{animation:opening-camera 13s ease-out both}
.opening-page[data-motion="true"] .opening-narration{animation:opening-copy-in .35s ease-out both}
.opening-page[data-motion="true"] .opening-light{animation:opening-lamplight 5s ease-in-out infinite alternate}
[data-scene="escort"] .opening-light{background:linear-gradient(108deg,transparent 30%,#fff0c925 48%,transparent 62%);transform-origin:70% 12%}
[data-scene="escort"] .opening-page[data-motion="true"] .opening-light{animation:opening-searchlight 5s ease-in-out infinite alternate}
[data-scene="collector"] .opening-art img{object-position:50% 46%}
@keyframes opening-camera{from{transform:scale(1.015)}to{transform:scale(1.07) translateY(-.5%)}}
@keyframes opening-copy-in{from{opacity:.2;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes opening-lamplight{from{opacity:.5}to{opacity:1}}
@keyframes opening-searchlight{from{transform:rotate(-12deg);opacity:.35}to{transform:rotate(13deg);opacity:.8}}
@media(max-height:740px){.opening-top{padding:12px 15px}.opening-top>img{width:86px}.opening-copy{padding:14px 18px calc(16px + env(safe-area-inset-bottom))}.opening-counter{margin-bottom:8px}.opening-progress{margin-bottom:10px}.opening-narration h1{font-size:23px;margin-bottom:8px}.opening-body{font-size:12px;line-height:1.65}.opening-aside{font-size:10px;margin-top:8px}.opening-controls{margin-top:13px}.opening-controls button{min-height:43px;font-size:13px}.opening-art{bottom:160px}}
@media(max-width:350px){.opening-copy{padding-inline:15px}.opening-narration h1{font-size:21px}.opening-counter{font-size:9px;letter-spacing:.3px}.opening-body{font-size:12px}.opening-controls{gap:8px}#opening-back{padding-inline:10px}}
@media(prefers-reduced-motion:reduce){.opening-page *, .opening-page *:before,.opening-page *:after{animation:none!important;transition:none!important}}
