/* Reference composition: 1672 × 941. Fit inside the existing cabinet. */
#endingPanel{--end-gold:#dfb568;--end-paper:#fff0c8;display:grid;place-items:center;grid-template-columns:1fr;grid-template-rows:1fr;background:#080909;color:var(--end-paper)}
#endingLayout{position:relative;display:grid;grid-template-columns:72.73% 27.27%;grid-template-rows:88.42% 11.58%;width:min(100cqw,177.6833cqh);height:min(100cqh,56.28cqw);container-type:size;overflow:hidden;background:#0d0d0d}
#endingPanel .ending-stage{grid-column:1;grid-row:1;position:relative;display:block;min-width:0;min-height:0;overflow:hidden;background:#0a0b0b}
#endingPanel #endingCanvas{position:absolute;inset:0;display:block;width:100%;height:100%;min-height:0;background:transparent}
#endingPanel .ending-heading{position:absolute;inset:0 0 auto;height:28%;padding:0;z-index:1;pointer-events:none;text-shadow:none;isolation:isolate}
#endingPanel .ending-heading::before{content:'';position:absolute;inset:0 0 -8%;z-index:-1;background:linear-gradient(170deg,#080909 48%,#15120eec 75%,#18120f70);clip-path:polygon(0 0,100% 0,100% 53%,0 100%)}
#endingPanel .ending-heading>span{position:absolute;left:5.2%;top:12%;font-size:1.2cqw;line-height:1;letter-spacing:.43em;font-weight:900;color:#f6d797}
#endingPanel .ending-heading h2{position:absolute;left:2.6%;top:14%;width:65%;height:67%;margin:0;overflow:visible;display:block}
#endingPanel .ending-title-art{display:block;position:absolute;width:112%;height:auto;max-width:none;left:-6%;top:-20%;mix-blend-mode:screen}
#endingPanel .ending-heading p{position:absolute;left:4.5%;top:75%;margin:0;font-size:1.35cqw;line-height:1.2;font-weight:600;letter-spacing:.045em;color:#f1e7d5;transform:rotate(-2deg);transform-origin:left}
.ending-signature{position:absolute;right:4.6%;top:17%;font:italic 2.6cqw/.85 'Segoe Print','Comic Sans MS',cursive;color:#b48b4e;transform:rotate(-13deg);font-weight:400;text-align:right}
#endingPanel .ending-credits{position:relative;grid-column:2;grid-row:1;display:flex;flex-direction:column;min-width:0;min-height:0;padding:0 1.35cqw;border:0;border-left:1px solid #b58b4d;background:radial-gradient(ellipse at 100% 98%,#78614035,transparent 65%),#0b0c0c;box-shadow:-2px 0 12px #dfac4d17}
.ending-thanks{position:relative;flex:none;height:14%;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0;text-align:center;color:#edca85}
.ending-thanks>span{font-size:1.5cqw;font-weight:900;letter-spacing:.19em;line-height:1.3}
.ending-thanks>small{font-size:.54cqw;letter-spacing:.5em;margin-top:.35cqw;font-weight:700}
.ending-laurel{position:absolute;left:19%;top:28%;width:2.2cqw;height:3.5cqw;color:#b7904d}
.ending-thanks::after{content:'';position:absolute;right:19%;top:28%;width:2.2cqw;height:3.5cqw;background:currentColor;clip-path:polygon(54% 0,67% 15%,62% 29%,79% 10%,88% 21%,72% 38%,88% 26%,96% 42%,76% 53%,98% 47%,97% 62%,73% 67%,93% 69%,87% 82%,60% 80%,74% 89%,58% 99%,43% 87%,36% 78%,55% 72%,33% 70%,28% 55%,49% 59%,29% 49%,30% 36%,49% 46%,39% 31%,42% 18%,53% 31%);transform:rotate(12deg);color:#b7904d}
#endingPanel .ending-credits-window{flex:1;min-height:0;position:relative;overflow:hidden}
#endingPanel .ending-credits-window:has(.continuous-roll){mask-image:linear-gradient(transparent,#000 3%,#000 94%,transparent);-webkit-mask-image:linear-gradient(transparent,#000 3%,#000 94%,transparent)}
#endingCreditsRoll.continuous-roll .credit-page,#endingCreditsRoll .credit-page{box-sizing:border-box;display:flex;flex-direction:column;justify-content:center;gap:.55cqw;padding:.8cqw .95cqw 1.8cqw;text-align:left;overflow:hidden}
#endingCreditsRoll .credit-page::before{content:'';position:absolute;inset:0 0 .85cqw;z-index:-1;border:1px solid #c69a50;border-radius:.65cqw;background:linear-gradient(130deg,#1d1a1640,transparent 70%,#bd924631);box-shadow:inset 0 0 .6cqw #e9bc3820,0 0 .4cqw #e2b14713;pointer-events:none}
#endingCreditsRoll .credit-page{isolation:isolate}
#endingCreditsRoll .credit-page h3{font-size:1.35cqw;line-height:1.3;letter-spacing:.01em;color:#ffedbe;font-weight:900;margin:0}
#endingCreditsRoll .credit-page p{font-size:1.08cqw;line-height:1.55;margin:0;letter-spacing:.015em;font-weight:500;color:#e9e6df;white-space:pre-line;overflow-wrap:anywhere}
#endingCreditsRoll .credit-page small{font-size:.78cqw;line-height:1.4;color:#bda579;margin:0}
#endingCreditsRoll .credit-page[data-portraits]{display:grid;grid-template-columns:29.5% minmax(0,1fr);grid-template-rows:auto auto;align-content:center;column-gap:1.05cqw;row-gap:.4cqw}
#endingCreditsRoll .credit-page[data-portraits] h3{grid-column:2;grid-row:1;align-self:end}
#endingCreditsRoll .credit-page[data-portraits] p{grid-column:2;grid-row:2;align-self:start}
.credit-portraits{grid-column:1;grid-row:1/3;display:flex;align-items:stretch;gap:.2cqw;min-width:0;align-self:center}
.credit-face{display:block;aspect-ratio:.9;width:100%;min-width:0;border:1px solid #d4b47a;background-color:#1c1b18;background-repeat:no-repeat}
[data-portraits="4"] .credit-portraits{display:grid;grid-template-columns:1fr 1fr;gap:.2cqw}[data-portraits="4"] .credit-face{aspect-ratio:.9}
#endingCreditsRoll .credit-page .credit-role{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.ending-gratitude{height:11.5%;flex:none;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:.7cqw;color:#e3c990;font:italic 1.65cqw/1.2 'DFKai-SB','KaiTi',serif;letter-spacing:.13em;white-space:nowrap}
.ending-gratitude small{font:500 .44cqw/1.3 sans-serif;letter-spacing:.47em;color:#bda57e}
#endingPanel .ending-controls{position:absolute;bottom:2%;left:5%;right:5%;padding:0;border:0;background:#111e;z-index:4;text-align:center}
#endingPanel .ending-controls:has(#endingRetry.hidden){width:1px;height:1px;clip-path:inset(50%);overflow:hidden}
#endingPanel .ending-controls p{font-size:.8cqw;line-height:1.5;margin:0}#endingPanel .ending-controls>div:empty{display:none}
#endingPanel .ending-controls button{font-size:.9cqw;padding:.4cqw;min-height:0}
#endingPanel .ending-lyrics{position:relative;grid-column:1/-1;grid-row:2;display:flex;align-items:center;justify-content:center;gap:4cqw;min-height:0;padding:0 12% 0 18%;border-top:1px solid #e4b764;background:radial-gradient(ellipse at 48% 0%,#70513124,transparent 70%),#101011;box-shadow:0 -.15cqw 1cqw #edb44c44;overflow:hidden;color:#fae7bf}
.lyric-label{flex:none;min-width:8.5cqw;font-size:.82cqw;line-height:1.7;letter-spacing:.18em;font-weight:700;text-align:right;color:#dabb7c;border-right:1px solid #ab864b;padding-right:3cqw}
.lyric-label b{display:block;margin-top:.2cqw;font-size:.85cqw}
.lyric-lines{display:flex;gap:1em;justify-content:center;text-align:center;min-width:29%;font-size:2.35cqw;line-height:1.25;letter-spacing:.035em;font-weight:900;color:#ffedcc;text-shadow:0 2px 2px #56361d}
.lyric-lines span:empty{display:none}
.lyric-lines{opacity:var(--lyric-opacity,0);mask-image:linear-gradient(90deg,#000 calc(var(--lyric-reveal,0%) - 12%),transparent var(--lyric-reveal,0%));-webkit-mask-image:linear-gradient(90deg,#000 calc(var(--lyric-reveal,0%) - 12%),transparent var(--lyric-reveal,0%));will-change:opacity}
#endingPanel .ending-lyrics{padding-left:12%}
#endingPanel.ending-photo .ending-speech{display:none}
.lyric-equalizer{display:flex;align-items:flex-end;gap:.16cqw;height:3cqw;min-width:7cqw;opacity:.85;align-self:center}
.lyric-equalizer i{width:.23cqw;height:calc(var(--bar)*.1cqw);background:repeating-linear-gradient(to top,#ca9a51 0 .1cqw,transparent .1cqw .19cqw);transform-origin:bottom;animation:ending-eq .75s var(--delay) infinite alternate ease-in-out}
#endingPauseHint{position:absolute;right:2.5%;bottom:31%;font-size:.72cqw;color:#bca98b;letter-spacing:.05em;white-space:nowrap}
.ending-paused .lyric-equalizer i{animation-play-state:paused}
@keyframes ending-eq{to{transform:scaleY(.3)}}
#endingCreditsRoll .credit-honors li{font-size:1.05cqw;padding:.6cqw 0;gap:.5cqw;grid-template-columns:1.4cqw minmax(0,1fr) auto}
#endingCreditsRoll .credit-page[data-kind^="audience-"] .credit-honors li span:last-child{font-size:1.35cqw}
#endingCreditsRoll .credit-page[data-kind^="audience-"] p{font-size:1.03cqw;margin:0}
#endingPanel.ending-photo #endingLayout{grid-template-columns:1fr;grid-template-rows:1fr;cursor:pointer}
#endingPanel.ending-photo .ending-heading,#endingPanel.ending-photo .ending-credits,#endingPanel.ending-photo .ending-lyrics,#endingPanel.ending-photo .ending-speech{display:none}
#endingPanel.ending-photo .ending-stage{grid-column:1;grid-row:1}
.ending-photo .ending-stage::after{content:'END · 點畫面查看成績'}
@media(prefers-reduced-motion:reduce){.lyric-equalizer i{animation:none}}
/* Crop the raster's black production margin; blend only over the header backdrop. */
#endingPanel .ending-heading{isolation:auto}
#endingPanel .ending-heading::before{z-index:0}
#endingPanel .ending-heading>span,#endingPanel .ending-heading h2,#endingPanel .ending-heading p,.ending-signature{z-index:1}
#endingPanel .ending-heading h2{overflow:hidden}
#endingPanel .ending-title-art{top:-40%}
#endingPanel .ending-heading p{top:87%}
#endingPanel .ending-heading h2{mix-blend-mode:screen}
#endingPanel .ending-heading .ending-title-art{mix-blend-mode:normal}
#endingPanel .ending-heading>span{z-index:3}
#endingPanel #endingCreditsRoll .credit-page:first-child p,#endingPanel #endingCreditsRoll .credit-page:last-child p{font-size:1.08cqw;color:#e9e6df}

/* v82: soft theatrical scrim; no diagonal edge over the reaction portrait. */
#endingPanel .ending-heading::before{inset:0 0 -30%;clip-path:none;background:linear-gradient(180deg,#080909 0%,#080909f5 38%,#0c0c0bbc 62%,#0c0c0b38 82%,transparent 100%);mask-image:linear-gradient(110deg,#000 65%,#000b);}
#endingPanel .ending-heading h2{mask-image:linear-gradient(180deg,transparent,#000 9%,#000 78%,transparent),linear-gradient(90deg,transparent,#000 4%,#000 94%,transparent);mask-composite:intersect}
#endingCreditsRoll .credit-page[data-kind="audience-summary"]{gap:.4cqw;padding:.85cqw 1cqw 1.5cqw}
#endingCreditsRoll .credit-page[data-kind="audience-summary"] .credit-honors{display:grid;grid-template-columns:1fr 1fr;gap:.6cqw;margin:.5cqw 0;padding:0}
#endingCreditsRoll .credit-page[data-kind="audience-summary"] .credit-honors li{display:flex;flex-direction:column;align-items:flex-start;gap:.25cqw;padding:.6cqw;background:#d2ac5910;border-bottom:1px solid #d2ac5938;font-size:.95cqw}
#endingCreditsRoll .credit-page[data-kind="audience-summary"] .credit-honors li span:first-child{display:none}
#endingCreditsRoll .credit-page[data-kind="audience-summary"] .credit-honors li span:last-child{font-size:1.55cqw;font-weight:900;color:#ffe2a1}
#endingCreditsRoll .credit-page[data-kind="audience-summary"] small{font-size:.7cqw}
#endingPanel .ending-credits-window:has(.continuous-roll){mask-image:linear-gradient(transparent,#000 6%,#000 91%,transparent);-webkit-mask-image:linear-gradient(transparent,#000 6%,#000 91%,transparent)}
