/* Scoped cinematic presentation. Does not resize approved Online dialogs or combat controls. */
#storyEnding{box-sizing:border-box;height:var(--app-height,100dvh);min-height:0;padding:max(12px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));overflow:auto;scrollbar-width:none}
#storyEnding::-webkit-scrollbar{display:none}
#storyEnding #endingCard{box-sizing:border-box;display:grid;justify-items:center;align-content:center;gap:clamp(6px,1.5dvh,16px);width:min(1040px,100%);min-width:0;min-height:0}
#storyEnding #endingTitle{margin:0;font-size:clamp(26px,5vw,64px);line-height:1.06;overflow-wrap:anywhere}
#storyEnding #endingText{margin:0;max-width:52ch;font-size:clamp(17px,2.3vw,28px);line-height:1.3;overflow-wrap:anywhere}
#storyEnding #endingCast{display:flex;gap:clamp(12px,3vw,34px);align-items:center;justify-content:center;height:min(38dvh,340px);width:100%;min-height:0}
#storyEnding #endingCast[hidden]{display:none}
#storyEnding .credit-portrait{margin:0;height:100%;width:min(34vw,340px);min-width:0;display:flex;align-items:center;justify-content:center;overflow:hidden}
#storyEnding .credit-portrait>img,#storyEnding .credit-portrait>svg{display:block;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain;object-position:center;aspect-ratio:auto;transform:none;filter:none}
#storyEnding #endingCast .credit-as{flex:0 0 auto;font:900 clamp(20px,3vw,32px)/1 Arial;color:#23e6ff}
#storyEnding .ending-actions{display:flex;flex-wrap:wrap;gap:12px;justify-content:center;align-items:center}
#storyEnding #endingAction,#storyEnding #endingExit,#storyEnding #endingBoxes button{box-sizing:border-box;margin:0;min-height:44px;max-width:100%;padding:10px 18px;font:900 clamp(15px,2vw,19px)/1.2 Arial;cursor:pointer;border:3px solid #ff329e;background:#ffec45;color:#10101c;white-space:normal}
#storyEnding #endingExit{font-size:15px;color:#fff;background:#071327;border-color:#32dcff}
#storyEnding :is(button):focus-visible{outline:4px solid #fff;outline-offset:4px;box-shadow:0 0 18px #ff329e}
#storyEnding #endingBoxes{display:flex;flex-wrap:wrap;justify-content:center;gap:14px}
#storyEnding #endingBoxes button{width:clamp(64px,12vw,110px);height:clamp(64px,12vw,110px);font-size:clamp(35px,7vw,54px)}
#storyEnding #endingCounter{margin:0;font:800 12px/1.2 Arial;letter-spacing:2px;color:#82dffc}
#storyEnding #endingError{font:700 15px/1.3 Arial;max-width:62ch;margin:0;color:#ffa5c4;overflow-wrap:anywhere}
#storyEnding #endingError:empty{display:none}
#storyEnding #endingCard.credit-fade{animation:none;opacity:var(--credit-opacity,1)}
@media(max-height:500px){#storyEnding #endingTitle{font-size:clamp(24px,4vw,36px)}#storyEnding #endingText{font-size:clamp(16px,2.3vw,20px)}#storyEnding #endingCast{height:34dvh}#storyEnding #endingCard{gap:6px}#storyEnding .ending-actions{gap:10px}#storyEnding #endingAction,#storyEnding #endingExit{padding:8px 14px}}
@media(prefers-reduced-motion:reduce){#storyEnding #endingCard.credit-fade{opacity:1!important}}

#storyEnding #endingCard.unlock-notice{display:flex;flex-direction:column;justify-content:center;gap:24px;min-height:45dvh;text-align:center;align-items:center;--credit-opacity:1}
#storyEnding #endingCard.unlock-notice #endingTitle{font-size:clamp(30px,4.8vw,66px);opacity:1;animation:none;transform:none}
#storyEnding #endingCard.unlock-notice #endingText{font-size:clamp(22px,2.7vw,36px);line-height:1.4;white-space:pre-line;opacity:1;animation:none;transform:none;max-width:48ch}
#storyEnding #endingCard.unlock-notice :is(#endingAction,#endingExit)[hidden]{display:none!important}
@media(max-height:500px){#storyEnding #endingCard.unlock-notice{gap:14px;min-height:0;padding:18px}#storyEnding #endingCard.unlock-notice #endingTitle{font-size:clamp(26px,4vw,38px)}#storyEnding #endingCard.unlock-notice #endingText{font-size:clamp(18px,2.4vw,24px)}}

#storyEnding #endingCard.unlock-notice #endingCast,#storyEnding #endingCard.unlock-notice #endingBoxes{display:none!important}
