/* Focused visual refinement of the restored version 2. */
:root{--bone:#fff5e1;--gold:#ecad70;--orange:#ea7b3d;--text:#fff5e1;--muted:#b8b8b3;--danger:#ff876f;--success:#d2e1bc;--cyan:#ecad70;--line:#c3a98940;color-scheme:dark}
html,body{height:100%;overflow:hidden;background:#080c0e}body::before,body::after{display:none}button{font-family:inherit;border-radius:5px;font-size:1rem;min-height:44px;background:#202626;color:var(--bone);box-shadow:inset 0 0 0 1px #aeb9b538,0 6px 18px #0004;letter-spacing:0;font-weight:600}button:hover{background:#323632;box-shadow:inset 0 0 0 1px #dda15d90}button:disabled{opacity:.38;cursor:not-allowed;transform:none}button:focus-visible,input:focus-visible{outline:3px solid #f6ba79;outline-offset:5px}button[hidden],[hidden]{display:none!important}
.game-hub{height:100svh;min-height:620px;display:block;padding:0;background:#070c0f;isolation:isolate}.haunted-office{z-index:-1;background:#081014}.office-image{width:100%;height:100%;object-fit:cover;object-position:center;opacity:.96}.haunted-office::before{z-index:1;opacity:1;animation:none;background:linear-gradient(180deg,#02060772,transparent 24%,transparent 69%,#02040740),radial-gradient(ellipse at 50% 34%,#03060780,transparent 55%)}.window-light{position:absolute;inset:0;background:linear-gradient(110deg,transparent 20%,#a9d9fa08 43%,transparent 55%);mix-blend-mode:screen;animation:windowWind 9s ease-in-out infinite;transform-origin:80% 30%}@keyframes windowWind{0%,100%{opacity:.25;transform:skewX(-5deg)}50%{opacity:.85;transform:skewX(7deg)}}
.hub-panel{position:absolute;inset:0 0 auto;width:100%;min-height:0;padding:clamp(30px,5vh,60px) 22px 0;display:flex;flex-direction:column;align-items:center;gap:clamp(14px,3vh,30px);pointer-events:none}.hub-copy{gap:14px}.hub-kicker{border:0;background:none;box-shadow:none;border-radius:0;padding:0;color:#bcbcb3;font-size:.875rem;letter-spacing:.24em;font-weight:500}.hub-title{font-family:inherit;font-size:clamp(1.4rem,2.6vw,2.6rem);font-weight:650;line-height:1.2;letter-spacing:.2em;color:var(--bone);background:none;-webkit-text-stroke:0;filter:none;text-shadow:0 2px 20px #000}.hub-timer-card{display:block;background:none;gap:0}.timer-face{width:auto;min-height:0;display:flex;flex-direction:column;gap:14px;border:0;border-radius:0;background:none;box-shadow:none;overflow:visible}.timer-face::before,.timer-face::after{display:none}.timer-main{font-family:Impact,'Arial Narrow',Haettenschweiler,sans-serif;font-variant-numeric:tabular-nums;font-size:clamp(7rem,min(24vw,31vh),24rem);line-height:1;letter-spacing:.015em;font-weight:400;color:#fff6e6;text-shadow:0 0 60px #e3dfbc20,0 8px 38px #000}.timer-caption{font-size:.875rem;letter-spacing:.2em;color:#dbd4c5;font-weight:500;line-height:1.4}.timer-main.expired{color:#ef9169}
.desk-interaction{position:absolute;left:50%;bottom:18.5%;width:clamp(140px,19vw,290px);transform:translateX(-50%);text-align:center}.desk-vault-button,button.desk-vault-button{position:relative;display:block;width:100%;padding:0;aspect-ratio:1;min-height:0;border:0;border-radius:0;background:none;box-shadow:none;animation:none;overflow:visible;transform:none}.desk-vault-button::before,button.desk-vault-button::before{display:none}.desk-vault-button img{width:100%;height:100%;object-fit:contain;display:block;transform-origin:50% 92%;animation:vaultRattle 1.5s linear infinite;filter:drop-shadow(0 18px 9px #000a);pointer-events:none}.desk-vault-button:hover{background:none;box-shadow:none;transform:none}.desk-vault-button:hover img{filter:drop-shadow(0 0 12px #eaaa6555) drop-shadow(0 18px 9px #000a)}@keyframes vaultRattle{0%,100%{transform:translate(0,0) rotate(0)}10%{transform:translate(-4px,-3px) rotate(-2deg)}18%{transform:translate(5px,-6px) rotate(2.2deg)}26%{transform:translate(-4px,0) rotate(-1.8deg)}36%{transform:translate(3px,-15px) rotate(2.4deg)}47%{transform:translate(-2px,-2px) rotate(-2deg)}54%{transform:translate(4px,0) rotate(1.8deg)}62%{transform:translate(-4px,-6px) rotate(-1.5deg)}70%{transform:translate(3px,-2px) rotate(2deg)}79%{transform:translate(-3px,-11px) rotate(-2.1deg)}89%{transform:translate(2px,0) rotate(1.2deg)}}.desk-nameplate{position:absolute;left:50%;bottom:-22px;transform:translateX(-50%);white-space:nowrap;color:#c1a177;font-size:.75rem;letter-spacing:.18em;padding:5px 15px;background:#0d1110c9;border:1px solid #79664866;box-shadow:0 5px 8px #0008}.vault-hint{position:absolute;left:0;right:0;bottom:-51px;font-size:.875rem;color:#fff1d4;text-shadow:0 2px 12px #000;letter-spacing:.04em}.room-label{position:absolute;left:32px;bottom:24px;margin:0;text-transform:uppercase;font-size:.75rem;letter-spacing:.16em;color:#c5c5bc}.room-label span{display:block;font-size:.75rem;color:#aaa99e;margin-top:8px}.loose-paper{z-index:2;width:44px;height:62px;border-radius:1px;opacity:0;background:repeating-linear-gradient(0deg,transparent 0 8px,#554f4440 8px 9px,transparent 9px 13px),linear-gradient(135deg,#cdcabb,#ece6d3);box-shadow:2px 5px 12px #0006;animation:flyPaper 12s linear infinite;will-change:transform}.loose-paper.one{left:-10%;top:68%;animation-delay:-3s}.loose-paper.two{left:-10%;right:auto;top:78%;animation-delay:-8.2s;width:56px;height:38px}.loose-paper.three{left:-10%;top:59%;animation-delay:-6.1s;width:32px;height:46px}.loose-paper.four{left:-10%;top:84%;animation-delay:-10.6s}.loose-paper.five{left:-10%;top:63%;animation-delay:-.3s;width:36px;height:48px}@keyframes flyPaper{0%{transform:translate3d(0,40px,0) rotate(0) rotateY(0);opacity:0}12%{opacity:.55}40%{transform:translate3d(48vw,-50px,0) rotate(85deg) rotateY(130deg);opacity:.65}70%{transform:translate3d(88vw,26px,0) rotate(195deg) rotateY(255deg);opacity:.4}100%{transform:translate3d(125vw,-70px,0) rotate(290deg) rotateY(360deg);opacity:0}}
.host-toggle{position:fixed;right:22px;bottom:22px;z-index:30;min-height:42px;padding:0 12px;background:#0b1010bd;border:1px solid #c3b69842;font-size:.875rem;backdrop-filter:blur(10px);display:flex;align-items:center;gap:8px}.host-toggle[aria-expanded=true]{color:#f6ba79}dialog{color:var(--bone);background:#111919;border:1px solid #e2b07766;border-radius:12px;max-height:calc(100svh - 32px);overflow:auto;width:min(500px,calc(100vw - 32px));padding:26px;box-shadow:0 30px 120px #000b}dialog::backdrop{background:#000a;backdrop-filter:blur(5px)}.host-heading{display:flex;align-items:center;justify-content:space-between;gap:20px}.host-heading h2{font-size:1.5rem;margin:0;font-weight:500}.host-heading button{font-size:1.7rem;width:44px}.host-time{font-family:monospace;font-size:3rem;margin:16px 0}.host-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px}.host-actions button{font-size:.875rem;padding:12px;text-transform:none;letter-spacing:0}.primary-action{background:#db9f67;color:#120d06;box-shadow:none}.volume-label{display:flex;gap:14px;align-items:center;margin:20px 0;font-size:1rem}.volume-label input{flex:1;accent-color:#eaaa65}.host-help,.host-feedback{font-size:.875rem;line-height:1.6;color:#c8c9c0}.host-feedback{color:#f0bc85;min-height:1.4em}#syncLinkFallback{width:100%;padding:12px;color:#fff;background:#080d0d;border:1px solid #eaaa65}
.timer-dock{display:none;top:20px;width:calc(100% - 48px);max-width:1300px;border:0;border-radius:0;background:transparent;box-shadow:none;backdrop-filter:none;gap:18px;padding:0}.timer-dock.is-visible{display:flex}.dock-time{font-size:1.7rem;color:#f8e9d2}.dock-label{font-size:.75rem;letter-spacing:.06em;flex:1}.dock-button{min-height:44px;background:#1d2525;font-size:.875rem;letter-spacing:0;text-transform:none}.site{padding:92px 5vw 62px;min-height:100svh;height:100svh;overflow:auto;grid-template-columns:minmax(0,.85fr) minmax(360px,1fr);gap:5vw;max-width:1500px;margin:auto}.site.is-active{display:grid}.stage{min-height:0;align-self:center}.vault-system{width:100%;max-width:480px;aspect-ratio:auto;display:flex;flex-direction:column;gap:20px}.ring,.vault-door{display:none}.riddle-safe{width:min(330px,70%);height:auto;filter:drop-shadow(0 30px 30px #000b);animation:riddleSafe 5s ease-in-out infinite}@keyframes riddleSafe{50%{transform:translateY(-5px) rotate(-1deg)}}.label-cluster{position:static;width:100%;display:grid;grid-template-columns:1fr;gap:0}.data-chip{border:0;border-bottom:1px solid #a49a8540;background:none;border-radius:0;box-shadow:none;backdrop-filter:none;padding:14px 0;display:flex;justify-content:space-between;gap:14px;align-items:center}.data-chip span{margin:0;font-size:.75rem;line-height:1.4}.data-chip strong{font-size:.875rem;font-weight:400;color:#e3d3b9}.control{min-height:0;margin:0;padding:0;background:none;border:0;border-radius:0;box-shadow:none;backdrop-filter:none;gap:14px}.status-row{font-size:.75rem;letter-spacing:.1em;color:#b9b7ad}.pulse{width:6px;height:6px;background:#d09c6f;box-shadow:none}.riddle-eyebrow{font-size:.875rem;letter-spacing:.15em;text-transform:uppercase;color:#d09c6f;margin:4px 0 0}.control h2{font-weight:500;font-size:clamp(1.8rem,3.1vw,3rem);line-height:1.1;margin:0;letter-spacing:-.03em}.title-gradient{color:#fff0d9;background:none;text-shadow:none}.lead{font-family:Georgia,serif;font-size:clamp(1.2rem,1.85vw,1.7rem);line-height:1.4;color:#e6e5dc}.code-help{font-size:.875rem;line-height:1.5;color:#b8b8ad;margin:0}#codeForm{display:grid;gap:14px}.terminal{background:#111a1b;border:1px solid #dfb28b4d;border-radius:8px;padding:16px;box-shadow:none}.terminal-header{color:#b9b5a7;font-size:.75rem;margin-bottom:12px;letter-spacing:.03em}.code-label{position:absolute;clip-path:inset(50%);height:1px;width:1px;overflow:hidden}#vaultCode{display:block;width:100%;height:64px;border:1px solid #d4b28b66;border-radius:5px;background:#070c0d;color:#fff4de;font-family:monospace;font-size:2.5rem;font-weight:500;letter-spacing:.35em;text-align:center;padding:0 10px}#vaultCode::placeholder{color:#838b87}.message{font-family:inherit;font-size:.875rem;min-height:1.5em;margin-top:12px;color:#b9c1b9}.keypad{gap:8px}.keypad button{min-height:46px;font-size:1.25rem}.keypad .clear,.keypad .unlock{font-size:.875rem}.unlock{background:#db9f67;color:#120d06;box-shadow:none}.control.is-locked .terminal{border-color:#f07154;background:#351915}.control.is-locked .message{color:#ffb5a4;font-weight:600}.control.is-locked .status-row{color:#ff987e}
.title-moment{position:fixed;inset:0;z-index:40;display:flex;flex-direction:column;align-items:center;justify-content:center;background:#050706;overflow:hidden;text-align:center;padding:26px;animation:titleIn .7s ease-out both}.title-moment>p{color:#d9a16b;font-size:.875rem;letter-spacing:.32em;margin:0 0 32px;animation:legendReveal 1.6s both}.title-moment h2{margin:0;font-family:Georgia,serif;font-size:clamp(3.5rem,10vw,10rem);line-height:1.02;letter-spacing:-.045em;color:#ffedce;text-shadow:0 0 90px #d9954766;animation:legendReveal 2.8s cubic-bezier(.2,.8,.2,1) both}.title-moment h2 span{display:block;font-family:inherit;font-size:.37em;font-weight:400;letter-spacing:.015em;margin-bottom:.3em}.title-rule{height:1px;width:clamp(160px,36vw,580px);margin-top:40px;background:linear-gradient(90deg,transparent,#dfa562,transparent);animation:legendReveal 3s both}.title-light{position:absolute;inset:-50%;background:linear-gradient(110deg,transparent 40%,#f3c78210 47%,#f4d5a24d 49.8%,transparent 50.1%);animation:titleSweep 5.8s ease-in-out both;pointer-events:none}@keyframes titleIn{from{opacity:0}to{opacity:1}}@keyframes legendReveal{from{opacity:0;transform:scale(.87) translateY(18px);filter:blur(5px)}to{opacity:1;transform:scale(1) translateY(0);filter:blur(0)}}@keyframes titleSweep{from{transform:translateX(-60%)}to{transform:translateX(70%)}}
.ending{background:#080e13;z-index:25;padding:24px;grid-template-rows:auto 1fr auto auto;gap:14px}.ending.is-visible{display:grid;animation:openReveal 600ms ease}.ending-header{display:flex;justify-content:space-between;align-items:center;gap:14px;color:#c6b294;font-size:.875rem;letter-spacing:.06em}.comic-scene{position:relative;align-self:center;justify-self:center;overflow:hidden;box-shadow:0 22px 80px #0009;border:1px solid #a1956f88;background:#111;max-width:100%;width:min(1180px,calc((100svh - 210px) * var(--panel-ratio,2.3)));aspect-ratio:var(--panel-ratio,2.3)}.comic-scene img{position:absolute;max-width:none;height:auto;display:block}.comic-scene.is-changing{animation:panelReveal .6s ease-out}@keyframes panelReveal{from{opacity:.3;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}.ending-status{font-size:1rem;text-align:center;color:#e5d5b7;min-height:1.4em;margin:0}.ending-controls{display:flex;justify-content:center;flex-wrap:wrap;gap:10px;padding:0 64px}.ending-controls button{padding:10px 18px;font-size:.875rem}.ending-progress{position:absolute;bottom:0;left:0;right:0;height:3px;background:#2e3638}.ending-progress span{display:block;height:100%;width:0;background:#dca065}
@media(min-width:1600px){.desk-interaction{bottom:18%}}@media(max-height:700px) and (min-width:700px){.game-hub{min-height:500px}.hub-panel{padding-top:22px;gap:8px}.hub-copy{gap:6px}.hub-title{font-size:1.45rem}.timer-main{font-size:min(24vw,30vh)}.desk-interaction{width:180px;bottom:17%}.site{padding-top:76px;gap:4vw}.control{gap:9px}.lead{font-size:1.2rem}.keypad button{min-height:40px}.terminal{padding:12px}#vaultCode{height:54px}.data-chip{padding:11px 0}.host-toggle{bottom:14px;right:16px}}
@media(max-width:700px){.game-hub{min-height:540px}.office-image{object-position:50% center}.hub-panel{padding-top:48px;gap:22px}.hub-kicker{font-size:.75rem;letter-spacing:.15em}.hub-title{font-size:clamp(1.15rem,4.2vw,1.7rem);letter-spacing:.12em}.timer-main{font-size:26vw;line-height:1}.timer-caption{font-size:.75rem;letter-spacing:.1em}.desk-interaction{width:clamp(150px,44vw,210px);bottom:24%}.room-label{left:20px;bottom:22px}.host-toggle{right:16px;bottom:18px}.site{grid-template-columns:1fr;padding:88px 22px 82px;gap:20px;max-width:540px}.stage{display:none}.control{margin:0}.control h2{font-size:2rem}.lead{font-size:1.4rem}.timer-dock{top:16px;width:calc(100% - 40px);flex-direction:row;align-items:center;gap:12px}.dock-label{display:none}.dock-time{flex:1}.ending{padding:20px 14px;gap:12px}.ending-header{font-size:.75rem}.ending-controls{padding:0;gap:7px}.ending-controls button{font-size:.75rem;padding:10px 12px}.comic-scene{width:100%;max-height:none}.ending-status{font-size:.875rem}.ending .host-toggle{display:none}}
@media(max-height:500px){html,body{overflow:auto}.game-hub{height:580px}.site{height:auto;min-height:100svh}.ending{overflow:auto}.comic-scene{width:min(900px,90vw)}.host-toggle{bottom:12px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;scroll-behavior:auto!important;transition:none!important}.loose-paper{display:none}.title-light{display:none}}

.music-credit{flex-basis:100%;margin:3px 0 0;text-align:center;font-size:.875rem;line-height:1.5;color:#b8b8b3}.music-credit a{color:#e9be8f;text-decoration:underline;text-underline-offset:3px}.ending .comic-scene{width:min(1180px,calc((100svh - 250px) * var(--panel-ratio,2.3)))}
@media(max-width:700px){.ending .comic-scene{width:100%}.music-credit{font-size:.75rem}}

/* Personal keepsakes stay beside the safe, with the supplied photo intact. */
.desk-photo{position:absolute;left:calc(50% - clamp(200px,24vw,365px));bottom:22%;width:clamp(70px,8vw,120px);margin:0;padding:5px;background:#37251a;border:3px solid #85633e;box-shadow:3px 4px 0 #251910,7px 12px 12px #0009;transform:perspective(650px) rotateY(14deg) rotateZ(-5deg);transform-origin:50% 100%;line-height:0}.desk-photo img{display:block;width:100%;height:auto;filter:brightness(.82) sepia(.08)}.desk-birthday{position:absolute;right:calc(50% - clamp(210px,24vw,365px));bottom:21%;width:clamp(100px,12vw,175px);height:auto;filter:brightness(.83) drop-shadow(4px 12px 5px #0009);pointer-events:none}.desk-interaction{z-index:2}
@media(max-height:700px) and (min-width:701px){.desk-photo{bottom:22%;width:76px;left:calc(50% - 225px)}.desk-birthday{bottom:21%;width:116px;right:calc(50% - 238px)}}
@media(max-width:700px){.desk-photo{left:5%;bottom:27%;width:clamp(55px,14vw,85px);padding:3px;border-width:2px}.desk-birthday{right:2%;bottom:25%;width:clamp(78px,22vw,120px)}}

/* Shared-start and music controls remain visible without covering the scene. */
.room-tools{position:fixed;right:22px;bottom:22px;z-index:30;display:flex;gap:8px;align-items:center}.room-tools button{min-height:44px;padding:0 12px;background:#0b1010e8;border:1px solid #c3b69860;font-size:.875rem;text-transform:none;letter-spacing:0;white-space:nowrap}.room-tools .host-toggle{position:static;backdrop-filter:none}.room-tools #musicToggle[aria-pressed=true]{color:#f3c28b;border-color:#cd9b60}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.sync-setup{margin-top:22px;padding-bottom:20px;border-bottom:1px solid #c3b69840}.sync-setup h3,.local-heading{font-size:1.1rem;color:#efbd89;margin:0 0 10px}.sync-setup p{font-size:.875rem;line-height:1.6;color:#dedbd1}.sync-setup label{font-size:.875rem;display:block;margin:13px 0 7px}.sync-schedule{display:grid;grid-template-columns:115px 1fr;gap:8px}.sync-schedule select{min-height:44px;background:#1b2524;color:#fff1d9;border:1px solid #c3b69866;border-radius:5px;padding:8px;font:inherit;font-size:.875rem}.sync-schedule button{background:#d99d63;color:#140e08;font-size:.875rem;padding:10px}.sync-link-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px}.sync-link-row input{width:100%;min-width:0;height:44px;padding:8px;background:#070d0d;color:#dfdcd2;border:1px solid #d1b08566;border-radius:5px;font-size:.875rem}.sync-link-row button{font-size:.875rem;padding:8px 12px}.sync-setup .shared-start{color:#f4c493;font-weight:600}.sync-setup .sync-note{color:#bfc1b8;font-size:.8rem}.local-heading{margin-top:22px}.host-time{font-size:2.4rem;margin:12px 0}
@media(max-width:700px){.room-tools{left:16px;right:16px;bottom:18px;justify-content:flex-end;gap:7px}.room-tools button{font-size:.8rem;padding:0 10px}.room-label{bottom:78px}.sync-schedule{grid-template-columns:100px 1fr}.sync-link-row button{padding:8px;font-size:.8rem}}

/* A front-corner launch and an immersive comic stage. */
.front-start{position:fixed;left:28px;bottom:92px;z-index:30;display:flex;align-items:center;gap:10px;min-height:46px;padding:0 17px;border:1px solid #e7b47785;background:#161b19e8;color:#ffdbac;font-size:.875rem;box-shadow:0 6px 30px #0005;backdrop-filter:blur(10px)}
.ending{padding:0;overflow:hidden;isolation:isolate;grid-template-rows:1fr;background:#070e14}
.ending.is-visible{display:block}
.ending-backdrop{position:absolute;left:50%;top:50%;width:max(100vw,calc(100svh * var(--panel-ratio,2.3)));aspect-ratio:var(--panel-ratio,2.3);overflow:hidden;transform:translate(-50%,-50%) scale(1.12);filter:blur(24px) brightness(.36);z-index:-1}
.ending-backdrop img{position:absolute;max-width:none;height:auto}
.ending-header{position:absolute;left:24px;right:24px;top:18px;z-index:4;pointer-events:none;text-shadow:0 2px 8px #000}
.ending .comic-scene{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:min(100vw,calc((100svh - 102px) * var(--panel-ratio,2.3)));max-width:none;max-height:none;border:0;box-shadow:0 20px 90px #0008}
.ending .comic-scene.is-changing{animation:cinemaPanel .65s ease-out}
@keyframes cinemaPanel{from{opacity:0;filter:blur(3px)}to{opacity:1;filter:blur(0)}}
.ending-controls{position:absolute;z-index:5;left:0;right:0;bottom:0;margin:0;padding:30px 24px 15px;background:linear-gradient(transparent,#050a0fe8 34%);transition:opacity .35s,transform .35s}
.ending-controls button{background:#132024dd;backdrop-filter:blur(12px);min-height:42px;padding:9px 16px}
.ending-header{transition:opacity .35s}
.ending.controls-hidden .ending-controls{opacity:0;transform:translateY(12px);pointer-events:none}
.ending.controls-hidden .ending-header{opacity:0}
.ending .ending-status{position:absolute;z-index:5;left:20px;right:20px;bottom:114px;pointer-events:none;text-shadow:0 2px 10px #000}
.ending .music-credit{font-size:.75rem;color:#c6c8c8;margin:0}
.ending-progress{z-index:6}
.finale-scene{position:absolute;inset:0;overflow:hidden;background:#09131c;animation:finaleReveal 1.2s ease-out both}
.finale-scene>img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center 46%}
.finale-shade{position:absolute;inset:0;background:linear-gradient(180deg,#030b1699 0%,transparent 25%,transparent 55%,#060c14d9 83%,#05080df5 100%)}
.finale-dialogue{position:absolute;top:10%;left:8%;right:8%;display:flex;justify-content:center;gap:18px;animation:legendReveal 1.4s ease both}
.finale-dialogue p{max-width:430px;margin:0;padding:14px 22px;border:1px solid #f5d7a980;border-radius:12px;background:#08131dcc;color:#fff0d8;box-shadow:0 10px 28px #0004;font-family:Georgia,serif;font-size:clamp(1rem,1.5vw,1.5rem);line-height:1.4;text-align:center;backdrop-filter:blur(12px)}
.finale-copy{position:absolute;left:3%;right:3%;bottom:17%;text-align:center;animation:legendReveal 1.8s ease both;pointer-events:none}
.finale-copy>p{margin:0 0 12px;color:#f4c986;font-size:clamp(.8rem,1.1vw,1.2rem);letter-spacing:.4em;font-weight:700}
.finale-copy h2{margin:0;font-family:Georgia,serif;font-weight:900;font-size:clamp(2.25rem,6.3vw,7rem);line-height:1.02;letter-spacing:-.035em;color:#ffbe56;text-shadow:0 5px 3px #0007,0 0 45px #f5a32a25}
.finale-copy h2 span{display:block;margin-bottom:.18em;font-size:.46em;letter-spacing:.045em;color:#fff1d3}
.ending.is-finale .ending-status{display:none}
@keyframes finaleReveal{from{opacity:0;transform:scale(1.035)}to{opacity:1;transform:scale(1)}}
@media(max-width:700px){.front-start{left:16px;bottom:133px;padding:0 14px}.ending-header{left:16px;right:16px;top:16px}.ending .comic-scene{width:100vw}.ending-controls{padding:28px 10px 12px;gap:7px}.ending-controls button{font-size:.75rem;padding:9px 12px}.ending .music-credit{line-height:1.4}.finale-scene>img{object-fit:contain;object-position:center 43%;background:#0a1521}.finale-shade{background:linear-gradient(180deg,#060c1590,transparent 30%,transparent 48%,#060c1590 62%,#060c15 80%)}.finale-dialogue{top:9%;left:5%;right:5%;gap:10px;flex-direction:column;align-items:center}.finale-dialogue p{font-size:.95rem;padding:10px 14px;max-width:360px}.finale-copy{bottom:23%;left:4%;right:4%}.finale-copy h2{font-size:clamp(2rem,8.9vw,3.5rem)}.finale-copy h2 span{font-size:.43em;line-height:1.25}.finale-copy>p{margin-bottom:10px;font-size:.75rem}.ending .ending-status{bottom:140px}}
@media(max-height:520px) and (min-width:701px){.finale-dialogue{top:10%;left:8%;right:8%;gap:12px}.finale-dialogue p{font-size:.875rem;padding:8px 12px}.finale-copy{bottom:24%}.finale-copy h2{font-size:5.4vw}.finale-copy>p{margin-bottom:5px}.ending-controls{padding-top:20px}}

/* Illustrated widescreen scenes with the original dialogue kept as text. */
.ending .comic-scene.widescreen-scene{inset:0;width:100%;height:100%;transform:none;aspect-ratio:auto;background:transparent;box-shadow:none}
.widescreen-scene #comicImage{inset:0;width:100%;height:100%;object-fit:contain;object-position:center 45%;max-width:100%}
.scene-shade{position:absolute;inset:0;background:linear-gradient(180deg,#05101ba8,transparent 28%,transparent 51%,#060c14bd 78%,#05080df5);pointer-events:none}
.scene-caption{position:absolute;top:10%;left:8%;right:8%;margin:0;color:#ffedca;font-family:Georgia,serif;font-size:clamp(1.1rem,2.1vw,2rem);line-height:1.35;text-align:center;text-wrap:balance;text-shadow:0 3px 14px #000,0 1px 3px #000}
.scene-dialogue{position:absolute;left:6%;right:6%;bottom:17%;display:flex;justify-content:center;align-items:stretch;gap:20px}
.scene-dialogue p{flex:1;max-width:660px;margin:0;padding:18px 24px;border:1px solid #f5d7a970;border-radius:12px;background:#08131de8;color:#fff0d8;box-shadow:0 10px 32px #0004;font-family:Georgia,serif;font-size:clamp(1.1rem,1.85vw,1.85rem);line-height:1.38;text-align:center;text-wrap:pretty;backdrop-filter:blur(12px)}
.scene-dialogue p:only-child{max-width:950px}
.scene-dialogue[data-count="1"] p{font-size:clamp(1.25rem,2.25vw,2.2rem)}
.scene-dialogue.is-long p{font-size:clamp(1rem,1.6vw,1.65rem)}
.ending .widescreen-backdrop{inset:0;transform:none;width:100%;height:100%;aspect-ratio:auto;filter:blur(22px) brightness(.3)}
.widescreen-backdrop img{inset:0;width:100%;height:100%;object-fit:cover}
@media(max-aspect-ratio:1/1){
  .widescreen-scene #comicImage{top:16%;height:42%;object-fit:contain;object-position:center top}
  .scene-shade{background:linear-gradient(180deg,#05101b80,transparent 24%,transparent 43%,#060c1470 55%,#05080de8 90%)}
  .scene-caption{top:7%;left:5%;right:5%;font-size:clamp(.95rem,2.6vw,1.3rem);line-height:1.3}
  .scene-dialogue{left:5%;right:5%;bottom:155px;gap:10px;flex-direction:column;align-items:center;max-height:44%;overflow:auto}
  .scene-dialogue p,.scene-dialogue[data-count="1"] p,.scene-dialogue.is-long p{font-size:clamp(1rem,2.9vw,1.35rem);padding:12px 15px;max-width:650px;flex:none;line-height:1.38}
}
@media(max-height:520px) and (min-aspect-ratio:1/1){
  .scene-caption{top:12%;font-size:1rem}
  .scene-dialogue{bottom:115px;left:4%;right:4%;gap:12px}
  .scene-dialogue p,.scene-dialogue[data-count="1"] p,.scene-dialogue.is-long p{font-size:clamp(.9rem,1.8vw,1.1rem);padding:9px 14px;line-height:1.3}
}
