/* Endings keep the authored shot still. The veil, result and actions arrive in order. */
@keyframes ending-reveal{from{opacity:0}to{opacity:1}}
@keyframes ending-actions{from{opacity:0;visibility:hidden}to{opacity:1;visibility:visible}}
@keyframes ending-dim-label{from{opacity:1}to{opacity:.5}}

.game[data-ending=normal] .end-card{animation:ending-reveal 2200ms ease-in-out both}
.game[data-ending=normal] .end-ordinal{animation:ending-reveal 1800ms ease-in-out 650ms both}
.game[data-ending=normal] .end-copy h2{animation:ending-reveal 2500ms ease-in-out 850ms both}
.game[data-ending=normal] .end-rule{animation:ending-reveal 1800ms ease-in-out 1400ms both}
.game[data-ending=normal] .end-caption{animation:ending-reveal 2000ms ease-in-out 1700ms both}
.game[data-ending=normal] .end-music{animation:ending-reveal 1800ms ease-in-out 2000ms both}

.game[data-ending=bad] .scene-shade::after{content:'';position:absolute;inset:0;background:linear-gradient(#0d0908cc,#0b090877 50%,#0b0908f2);animation:ending-reveal 2200ms ease-in-out both}
.game[data-ending=bad] .chapter{animation:ending-dim-label 2200ms ease-in-out both}
.game[data-ending=bad] .end-badge>span{display:inline-block;animation:ending-reveal 1800ms ease-in-out 650ms both}
.game[data-ending=bad] .end-badge strong{animation:ending-reveal 2500ms ease-in-out 850ms both}
.game[data-ending=bad] .message-window{animation:ending-reveal 2000ms ease-in-out 1700ms both}
.game[data-ending=bad] .input-hint{animation:ending-reveal 1000ms ease-in-out 3000ms both}
.game[data-ending=bad] .commands.is-ending,.game[data-ending=normal] .commands.is-ending{animation:ending-actions 900ms ease-out 3400ms both}

.scene-transition[data-kind=false-ending] #transition-time{animation:ending-reveal 2500ms ease-in-out 850ms both}
.scene-transition[data-kind=false-ending] #transition-pov{animation:ending-reveal 1800ms ease-in-out 1500ms both}
.scene-transition[data-kind=false-ending] .transition-copy{opacity:1;transition:opacity 1200ms ease-in-out}
.scene-transition[data-kind=false-ending].is-ending-fading .transition-copy{opacity:0}

/* Reduced motion still shows the complete result and usable controls immediately. */
@media(prefers-reduced-motion:reduce){
 .game[data-ending=normal] .end-card,.game[data-ending=normal] .end-copy>*,.game[data-ending=bad] .scene-shade::after,.game[data-ending=bad] .chapter,.game[data-ending=bad] .end-badge>*,.game[data-ending=bad] .message-window,.game[data-ending=bad] .input-hint,.game[data-ending=bad] .commands.is-ending,.game[data-ending=normal] .commands.is-ending,.scene-transition[data-kind=false-ending] .transition-copy>*{animation:none}
 .scene-transition[data-kind=false-ending] .transition-copy{transition:none}
}
:root[data-motion=reduce] .game[data-ending=normal] .end-card,:root[data-motion=reduce] .game[data-ending=normal] .end-copy>*,:root[data-motion=reduce] .game[data-ending=bad] .scene-shade::after,:root[data-motion=reduce] .game[data-ending=bad] .chapter,:root[data-motion=reduce] .game[data-ending=bad] .end-badge>*,:root[data-motion=reduce] .game[data-ending=bad] .message-window,:root[data-motion=reduce] .game[data-ending=bad] .input-hint,:root[data-motion=reduce] .game[data-ending=bad] .commands.is-ending,:root[data-motion=reduce] .game[data-ending=normal] .commands.is-ending,:root[data-motion=reduce] .scene-transition[data-kind=false-ending] .transition-copy>*{animation:none}
:root[data-motion=reduce] .scene-transition[data-kind=false-ending] .transition-copy{transition:none}
