.ending-screen{position:fixed;inset:0;z-index:1000;background:#000;color:#fff;overflow:hidden;isolation:isolate;font-family:system-ui,-apple-system,"Noto Sans SC","Noto Sans JP",sans-serif;touch-action:manipulation}
.ending-screen[hidden],.ending-screen [hidden]{display:none!important}
.ending-running .shell{visibility:hidden}.ending-running .toast{display:none}
.ending-canvas{position:absolute;inset:0;width:100%;height:100%;z-index:-2}
.ending-screen[data-phase="roll"]::before,.ending-screen[data-phase="finale"]::before{content:"";position:absolute;inset:0;z-index:-1;background:linear-gradient(90deg,transparent,rgba(0,7,18,.5) 26%,rgba(0,7,18,.5) 74%,transparent)}
.ending-roll{position:absolute;top:0;left:50%;width:min(690px,calc(100% - 40px));margin-left:max(-345px,calc(-50% + 20px));text-align:center;font-size:clamp(16px,2vw,22px);line-height:1.9;letter-spacing:.035em;text-shadow:0 2px 9px #000,0 0 3px #000;will-change:transform;padding-bottom:12vh}
.ending-roll p{white-space:pre-line;margin:0 0 3.25em}.ending-roll .ending-emphasis{font-size:1.12em;font-weight:650;letter-spacing:.07em}.ending-heading{margin:0 0 4em}.ending-heading small{font-size:.65em;letter-spacing:.16em;opacity:.85}.ending-heading h1{font-size:2.2em;font-weight:450;letter-spacing:.18em;margin:1em 0 .4em}.ending-heading b{font-size:1.3em;letter-spacing:.24em;font-weight:500}.ending-heading p{font-size:.85em;letter-spacing:.2em;margin-top:2em}
.ending-finale{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:24px;text-align:center;text-shadow:0 2px 14px #000;padding:32px;animation:ending-reveal 2s ease both}.ending-finale p{font-size:clamp(13px,1.8vw,19px);letter-spacing:.2em;margin:0}.ending-finale h2{font-size:clamp(30px,5vw,60px);font-weight:450;letter-spacing:.2em;margin:12px 0}.ending-finale strong{font-size:24px;font-weight:400;letter-spacing:.4em}.ending-finale .ending-dedication{max-width:620px;font-size:clamp(12px,1.5vw,16px);letter-spacing:.04em;line-height:1.9;margin-top:36px}
.ending-teaser{position:absolute;inset:0;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;gap:28px;padding:40px 24px 90px;font-family:ui-monospace,monospace;line-height:1.85;font-size:clamp(13px,1.8vw,19px);color:#d1dfdf;letter-spacing:.04em}.ending-teaser small{font-size:.78em;opacity:.65}.ending-teaser p{margin:.65em 0}.ending-sequel p:first-child{color:#fff;font-size:clamp(28px,5vw,58px);letter-spacing:.16em}.ending-sequel p:last-child{font-size:.85em;letter-spacing:.16em}
.ending-controls{position:absolute;bottom:max(20px,env(safe-area-inset-bottom));left:20px;right:20px;display:flex;flex-wrap:wrap;gap:8px;justify-content:center}.ending-controls button{border:1px solid #ffffff50;background:#0009;border-radius:100px;color:#fff;font-size:12px;padding:9px 16px;min-height:40px;cursor:pointer}.ending-controls button:hover,.ending-controls button:focus-visible{background:#253545;border-color:#fff;outline:2px solid #c8e5ff;outline-offset:3px}.ending-hint{position:absolute;top:max(25px,env(safe-area-inset-top));left:24px;right:24px;text-align:center;font-size:12px;line-height:1.7;color:#fff;text-shadow:0 2px 4px #000}.ending-paused .ending-finale{animation-play-state:paused}
@keyframes ending-reveal{from{opacity:0}to{opacity:1}}@media(prefers-reduced-motion:reduce){.ending-finale{animation:none}}@media(max-width:600px){.ending-controls{left:10px;right:10px;gap:6px}.ending-controls button{font-size:10px;padding:9px 12px}.ending-roll{line-height:1.85}.ending-roll p{margin-bottom:2.8em}}
.ending-screen .sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
