/* Local ending study: a quiet wordmark, one falling dot and a short impact. */
#scene-loading .loader-caption{letter-spacing:1px;font-size:11px}
.ending-card{position:absolute;inset:0;z-index:5;display:grid;place-items:center;overflow:hidden;background:var(--site-bg,#f5f6f8);color:var(--site-ink,#29322f)}
.ending-content{display:flex;flex-direction:column;align-items:center;width:min(740px,calc(100% - 48px));padding:55px 0 30px;gap:14px}
.ending-logo{display:flex;align-items:baseline;font-family:-apple-system,BlinkMacSystemFont,"Apple SD Gothic Neo",Arial,sans-serif;font-size:clamp(82px,10vw,128px);font-weight:800;letter-spacing:-.065em;line-height:1;padding-right:.065em}
.ending-links{position:relative;isolation:isolate;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:44px;width:100%}
.stage .ending-models{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:0;opacity:0;transition:opacity .4s ease}
.ending-links[data-models-ready=true] .ending-models{opacity:1}
.ending-link{position:relative;z-index:1;display:block;min-width:0;color:inherit;text-decoration:none;background:none;border:0}
.ending-object{display:block;width:100%;height:255px}
.ending-label{display:flex;align-items:center;justify-content:center;gap:8px;min-height:44px;font-size:15px;font-weight:650;letter-spacing:-.04em;white-space:nowrap;transition:color .2s,transform .2s}
.ending-label .ending-arrow{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;opacity:.75;transition:transform .2s}
.ending-gamepad{width:29px;height:23px;flex:none}
.ending-print-mark{font-size:25px;font-weight:400;color:#6e9787;line-height:1;width:27px;text-align:center}
.ending-link:focus-visible{outline:2px solid var(--site-brand,#385adb);outline-offset:6px}
@media(hover:hover){.ending-link:hover .ending-label{color:var(--site-brand,#385adb);transform:translateY(-2px)}.ending-link:hover .ending-arrow{transform:translateX(3px)}}
.ending-word{display:block}.ending-dot{display:block;letter-spacing:-.065em;color:var(--site-brand,#385adb);transform-origin:50% 86%}
.ending-card.is-playing{animation:ending-reveal .75s ease-out both}
.is-playing .ending-word{animation:ending-word .8s cubic-bezier(.2,.8,.2,1) .25s both}
.is-playing .ending-dot{animation:ending-dot 1.05s linear 1.05s both}
.is-playing .ending-links{animation:ending-links .7s cubic-bezier(.2,.8,.2,1) 2.1s both}
@keyframes ending-reveal{from{opacity:0}to{opacity:1}}
@keyframes ending-word{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}
@keyframes ending-links{from{opacity:0;visibility:hidden;transform:translateY(12px)}to{opacity:1;visibility:visible;transform:translateY(0)}}
@keyframes ending-dot{0%{opacity:0;transform:translateY(-230px) scale(1)}6%{opacity:1;transform:translateY(-228px) scale(1)}25%{transform:translateY(-206px) scale(1)}45%{transform:translateY(-145px) scale(.97,1.03)}65%{transform:translateY(-52px) scale(.95,1.05)}74%{transform:translateY(0) scale(1.28,.67)}82%{transform:translateY(-7px) scale(.96,1.04)}90%{transform:translateY(0) scale(1.07,.94)}100%{opacity:1;transform:translateY(0) scale(1)}}
@media(max-width:680px){.ending-content{width:calc(100% - 24px);gap:8px;padding:48px 0 14px}.ending-logo{font-size:clamp(62px,18vw,102px)}.ending-links{gap:10px}.ending-object{height:clamp(120px,39vw,225px)}.ending-label{font-size:12px;gap:4px;min-height:38px}.ending-label .ending-arrow{width:12px;height:12px}.ending-gamepad{width:22px;height:19px}.ending-print-mark{font-size:21px;width:21px}}
@media(min-width:681px) and (max-height:650px){.ending-content{width:560px;gap:6px;padding:46px 0 14px}.ending-logo{font-size:70px}.ending-object{height:155px}.ending-label{font-size:13px;min-height:34px}}
@media(prefers-reduced-motion:reduce){.ending-card.is-playing,.is-playing .ending-word,.is-playing .ending-dot,.is-playing .ending-links{animation:none!important;opacity:1;visibility:visible;transform:none}.ending-label,.ending-arrow,.ending-models{transition:none}}




/* The film keeps its original 16:9 composition; controls have their own space. */
.episode-four main{padding:19px 0 24px}
.stage{position:relative;isolation:isolate;overflow:hidden;height:max(280px,calc(100svh - var(--site-header-height,92px) - 43px));border:1px solid var(--site-line);border-radius:8px;background:var(--site-surface);display:grid;grid-template-rows:66px minmax(0,1fr)}
.film-viewport{position:relative;grid-row:2;min-height:0;overflow:hidden;background:#fff}
#film{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:contain;background:#fff}
.episode-four .episode-title{top:12px;left:16px;font-size:clamp(12px,1.1vw,17px);color:var(--site-ink)}
.episode-picker summary{min-height:40px;padding:6px 0}
.episode-four .episode-picker nav{margin-top:8px;background:var(--site-surface);border-color:var(--site-line);box-shadow:0 8px 30px #0002}
.episode-four .episode-picker a{color:var(--site-ink)}
.episode-four .episode-picker a[aria-current],.episode-four .episode-picker a:hover{color:var(--site-active);background:var(--site-soft)}
.scene-actions{position:absolute;z-index:7;top:12px;right:14px;display:flex;gap:6px}
.scene-actions button{display:grid;place-items:center;width:40px;height:40px;border:1px solid var(--site-line);border-radius:9px;background:var(--site-surface);color:var(--site-ink)}
.scene-actions button:hover{background:var(--site-soft)}
.scene-actions button:disabled{opacity:.45;cursor:wait}
.scene-actions svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.sound-off{display:none}#sound[aria-pressed=true] .sound-off{display:block}#sound[aria-pressed=true] .sound-waves{display:none}
.stage[aria-busy=true] .scene-actions{visibility:hidden}
.episode-four #scene-loading{z-index:9}
.episode-four #scene-fallback{color:var(--site-ink);background:var(--site-surface)}
.episode-four .site-credit{margin-bottom:0}
.ending-card{inset:66px 0 0}
.ending-content{padding:20px 0;gap:12px}
.ending-object{height:clamp(125px,27vh,255px)}
@media(max-width:1180px){.episode-four main{padding-top:17px}.stage{height:max(280px,calc(100svh - var(--site-header-height,92px) - 41px))}}
@media(max-width:680px){
  .episode-four main{padding:13px 0 20px}
  .stage{height:auto;min-height:0;grid-template-rows:58px auto;border-radius:6px;overflow:visible}
  .film-viewport{aspect-ratio:16/9;border-radius:0 0 6px 6px}
  .stage.is-portrait .film-viewport{aspect-ratio:9/16;max-height:max(320px,calc(100svh - var(--site-header-height) - 140px))}
  .episode-four .episode-title{top:9px;left:10px;font-size:12px}
  .episode-picker summary{min-height:38px;max-width:calc(100vw - 132px);gap:5px}
  .episode-four .episode-picker nav{min-width:230px}
  .scene-actions{top:9px;right:8px;gap:4px}.scene-actions button{width:36px;height:38px}.scene-actions svg{width:19px;height:19px}
  .episode-four .site-credit{height:auto;min-height:60px;margin-top:-20px;padding:10px 16px}
  .ending-card{position:relative;inset:auto;grid-row:2;border-radius:0 0 6px 6px;min-height:300px}
  .stage.is-ended .film-viewport{display:none}
  .ending-content{padding:20px 0}.ending-object{height:clamp(115px,36vw,225px)}
  .ending-logo{font-size:clamp(62px,18vw,90px)}
}
