/* The epilogue reuses the eighteen portraits; effects need no extra textures. */
.talk-prompt{position:absolute;left:50%;bottom:max(115px,calc(90px + env(safe-area-inset-bottom)));transform:translateX(-50%);display:flex;align-items:center;gap:13px;max-width:calc(100vw - 36px);width:max-content;min-height:52px;padding:10px 16px;pointer-events:auto;border:1px solid #ddc48d9c;border-radius:5px;background:linear-gradient(135deg,#27483bf5,#142f2bf5);box-shadow:0 4px 25px #06171250;color:var(--ivory);text-align:start}
.talk-prompt>span{min-width:0}.talk-prompt strong{display:block;font-size:13px;font-weight:500;line-height:1.5}.talk-prompt small{display:block;color:var(--gold);font-size:11px;line-height:1.6}.talk-prompt [data-icon]{width:23px;height:23px;flex:none;color:var(--gold)}.talk-prompt kbd{flex:none;font-size:10px;white-space:nowrap}.talk-prompt:hover{border-color:#f7e6b9;background:#365d47}.aiming .talk-prompt{display:none}
.conversation{display:grid;grid-template-columns:minmax(180px,.85fr) minmax(0,1.2fr);gap:36px;align-items:center;padding:16px 8px 24px}.conversation-portrait{position:relative;isolation:isolate;margin:0;aspect-ratio:1;display:grid;place-items:center}.conversation-portrait img{position:relative;width:100%;height:auto;max-height:350px;object-fit:contain;animation:conversation-breathe 6s ease-in-out infinite}.conversation-halo{position:absolute;inset:8%;border:1px solid #e6cf9c38;border-radius:50%;background:radial-gradient(circle,#d7c38f26,transparent 67%);box-shadow:0 0 0 18px #b8dca405,0 0 0 19px #e6cf9c0f}.conversation-line{min-height:132px;animation:conversation-line-in .35s ease-out}.conversation-quote{font-family:var(--serif);font-size:21px;line-height:1.95;overflow-wrap:anywhere}.conversation-question{font-size:11px;color:var(--gold);margin:0 0 10px;border-inline-start:2px solid #d3bd8177;padding-inline-start:10px;line-height:1.8}.conversation-choices{display:flex;flex-direction:column;gap:10px;margin-top:24px}.conversation-choices button{justify-content:space-between;min-height:48px;text-align:start;line-height:1.6;letter-spacing:.02em}.conversation-choices button:disabled{opacity:.4;cursor:wait}.conversation-goodbye{min-height:44px;margin-top:12px;font-size:12px}.conversation-dialog{background:radial-gradient(ellipse at 18% 55%,#28483c,#142e2afa 75%)}
.epilogue-note{padding:15px 18px;border:1px solid #ddc48d40;background:#d6c99908;border-radius:4px;margin-bottom:22px;font-size:13px;color:var(--muted);line-height:1.85}.epilogue-note strong{display:block;color:var(--gold);font-weight:500;margin-bottom:5px}.epilogue-note .text-button{font-size:12px;min-height:44px;margin-top:6px}
.ending-dialog{width:min(1040px,calc(100vw - 36px));background:radial-gradient(ellipse at 38% 20%,#284c48,#102c28 65%);border-color:#d2c48c70}.ending-dialog .dialog-top{border-color:#d2c48c25}.ending-dialog #overlay-body{padding:0 30px 22px;max-height:calc(100dvh - 185px)}.ending-ceremony{text-align:center}.ceremony-scene{position:relative;isolation:isolate;width:min(100%,700px);height:355px;margin:0 auto;overflow:hidden;contain:paint}.ceremony-dawn{position:absolute;inset:0;mask-image:radial-gradient(ellipse,#000 35%,transparent 73%);background:radial-gradient(ellipse at 50% 50%,#fff0b24d 0,#ddc67820 22%,#96dcc214 43%,transparent 68%);animation:ceremony-dawn 6s ease-out both}.ceremony-dawn:after{content:'';position:absolute;inset:0;background:conic-gradient(from 0deg at 50% 50%,transparent,#ffe7a412 15deg,transparent 27deg,transparent 60deg,#c2e6bd12 72deg,transparent 90deg,transparent 125deg,#ffe7a418 150deg,transparent 164deg,transparent 210deg,#fff6d212 240deg,transparent 256deg,transparent 300deg,#e7d2a412 334deg,transparent);animation:ceremony-rays 12s ease-out both}.ceremony-rings{position:absolute;inset:8% 7%}.ceremony-rings span{position:absolute;inset:0;border:1px solid #d3c99240;border-radius:50%;animation:ceremony-ring 4s ease-out both}.ceremony-rings span:nth-child(2){inset:18%;border-color:#badbc02e;animation-delay:.5s}.ceremony-rings span:nth-child(3){inset:32%;border-color:#f3dd9760;animation-delay:1s}.ceremony-spirit{position:absolute;left:var(--x);top:var(--y);width:64px;height:72px;margin:-36px 0 0 -32px;display:grid;place-items:center;animation:ceremony-arrive 2.2s cubic-bezier(.2,.7,.2,1) var(--delay) both}.ceremony-spirit:before{content:'';position:absolute;inset:10px;border-radius:50%;background:#deeb9c16;box-shadow:0 0 17px #dfeaaa22}.ceremony-spirit img{position:relative;width:100%;height:100%;object-fit:contain}.ceremony-keeper{position:absolute;inset:25% 35%;display:grid;place-items:center;animation:ceremony-keeper 3.8s ease-out both}.ceremony-keeper img{width:100%;height:100%;max-height:180px;object-fit:contain;filter:drop-shadow(0 0 18px #efd6a533)}.ceremony-seal{position:absolute;bottom:3px;width:100%;color:#eed9a6;font-family:var(--serif);font-size:15px;letter-spacing:.18em;animation:ceremony-reveal 1.6s 2.5s both;direction:ltr}.ceremony-motes{position:absolute;inset:0;pointer-events:none}.ceremony-motes i{position:absolute;left:var(--x);top:var(--y);width:3px;height:3px;border-radius:50%;background:#f5d894;box-shadow:0 0 7px #e9d693;opacity:0;animation:ceremony-mote 7s ease-out var(--delay) both}.ceremony-story{max-width:750px;margin:auto;padding:14px 0 8px}.ceremony-kicker{color:var(--gold);animation:ceremony-reveal 1.2s .8s both}.ceremony-story h3{font-family:var(--serif);font-size:clamp(24px,3.2vw,35px);font-weight:400;letter-spacing:.055em;line-height:1.6;margin:12px 0 20px;animation:ceremony-reveal 1.8s 1.1s both}.ceremony-poem{font-size:14px;color:#d1dfcd;line-height:2;animation:ceremony-reveal 1.4s 1.8s both}.ceremony-blessing{font-family:var(--serif);font-size:18px;color:#e6d4aa;line-height:1.9;margin:18px auto 24px;max-width:580px;animation:ceremony-reveal 1.4s 2.5s both}.ceremony-unlock{display:flex;gap:14px;align-items:center;text-align:start;margin:0 auto;max-width:570px;padding:17px 20px;border:1px solid #dcc79750;border-radius:4px;background:#f1dfa909;animation:ceremony-reveal 1.5s 3.2s both}.ceremony-unlock>[data-icon]{width:30px;height:30px;flex:none;color:#e1ce94}.ceremony-unlock h4{font-family:var(--serif);font-size:17px;font-weight:400;color:#f0ddb0;margin-bottom:6px;line-height:1.5}.ceremony-unlock p{font-size:12px;line-height:1.85;color:#c7d6c7}.ceremony-story .dialog-actions{justify-content:center;align-items:center;margin-top:24px}.ceremony-story .text-button{font-size:12px;min-height:44px}.ceremony-signature{color:#93ac9c;font-size:11px;margin-top:26px;letter-spacing:.06em;line-height:1.8}
@keyframes conversation-breathe{50%{transform:translateY(-5px)}}@keyframes conversation-line-in{from{opacity:.35;transform:translateY(4px)}to{opacity:1;transform:none}}
@keyframes ceremony-dawn{from{opacity:0;transform:scale(.6)}to{opacity:1;transform:scale(1)}}@keyframes ceremony-rays{from{opacity:0;transform:rotate(-20deg)}to{opacity:1;transform:rotate(12deg)}}@keyframes ceremony-ring{from{opacity:0;transform:scale(.6)}to{opacity:1;transform:scale(1)}}@keyframes ceremony-arrive{from{opacity:0;transform:translateY(22px) scale(.35)}to{opacity:1;transform:none}}@keyframes ceremony-keeper{from{opacity:0;transform:translateY(12px) scale(.7)}to{opacity:1;transform:none}}@keyframes ceremony-reveal{from{opacity:.05;transform:translateY(10px)}to{opacity:1;transform:none}}@keyframes ceremony-mote{0%{opacity:0;transform:translate(0,36px)}20%{opacity:.8}80%{opacity:.4}100%{opacity:0;transform:translate(var(--drift),-65px)}}
.reduced-motion .conversation *,.reduced-motion .ending-ceremony *,.reduced-motion .ceremony-dawn:after{animation:none!important}.reduced-motion .ceremony-motes{display:none}
@media(prefers-reduced-motion:reduce){.conversation *,.ending-ceremony *,.ceremony-dawn:after{animation:none!important}.ceremony-motes{display:none}}
@media(pointer:coarse),(max-width:650px),(max-height:500px) and (max-width:1000px){.talk-prompt{bottom:calc(82px + env(safe-area-inset-bottom));left:auto;right:max(18px,env(safe-area-inset-right));transform:none;width:min(230px,calc(100vw - 150px));gap:8px;padding:9px 11px}.talk-prompt kbd{display:none}.talk-prompt strong{font-size:11px}.talk-prompt small{font-size:10px}.talk-prompt [data-icon]{width:18px;height:18px}.ending-dialog #overlay-body{max-height:none;padding:0 16px 18px}.ceremony-story .dialog-actions{gap:10px}.ceremony-story .dialog-actions .primary-button{min-width:0}.epilogue-note{font-size:12px}}
@media(max-width:650px){.conversation{grid-template-columns:minmax(0,1fr);gap:8px;padding:0 0 12px}.conversation-portrait{width:142px;margin:0 auto}.conversation-portrait img{max-height:142px}.conversation-line{min-height:0}.conversation-quote{font-size:17px;line-height:1.95}.conversation-choices{margin-top:18px;gap:9px}.conversation-goodbye{margin-top:6px}.ceremony-scene{height:255px}.ceremony-spirit{width:42px;height:50px;margin:-25px 0 0 -21px}.ceremony-keeper{inset:31% 32%}.ceremony-seal{font-size:12px;bottom:5px}.ceremony-story{padding-top:10px}.ceremony-story h3{font-size:24px;line-height:1.65;margin:10px 0 15px}.ceremony-poem{font-size:12px}.ceremony-blessing{font-size:16px;margin:15px auto 20px}.ceremony-unlock{padding:13px;gap:10px}.ceremony-unlock h4{font-size:16px}.ceremony-unlock p{font-size:12px}.ceremony-story .dialog-actions{flex-direction:column;align-items:stretch}.ceremony-signature{margin-top:18px}}
@media(max-height:500px) and (orientation:landscape){.conversation{grid-template-columns:150px minmax(0,1fr);gap:20px;align-items:start;padding:0}.conversation-portrait{width:150px;position:sticky;top:0}.conversation-quote{font-size:17px}.conversation-line{min-height:0}.conversation-choices{margin-top:16px}.ceremony-scene{height:280px;width:480px;max-width:100%}.talk-prompt{bottom:max(68px,calc(60px + env(safe-area-inset-bottom)));width:180px}.ceremony-story h3{font-size:25px}}
/* Keep the ending choices outside its scrollable story. Controller focus must
   never skip past the gathering just to reach the primary button. */
.ending-dialog[open]{display:flex;flex-direction:column;max-height:calc(100dvh - 40px)}.ending-dialog .dialog-top{flex:none}.ending-dialog #overlay-body{display:flex;flex-direction:column;overflow:hidden;max-height:none;min-height:0;padding:0;flex:1 1 auto}.ending-dialog .controller-help{display:none}
.ending-ceremony{min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#637d66 transparent;padding:0 30px 20px;flex:1 1 auto}.ending-ceremony:focus-visible{outline:1px solid #ddc48d;outline-offset:-2px}.ceremony-actions.dialog-actions{flex:none;display:flex;align-items:center;justify-content:center;gap:12px;margin:0;padding:14px 24px;border-top:1px solid #d2c48c38;background:#102a26}.ceremony-actions .text-button{font-size:12px;min-height:44px;line-height:1.6}.ceremony-actions .primary-button{min-width:0;line-height:1.6}
@media(max-width:650px){.ending-dialog[open]{max-height:calc(100dvh - 24px)}.ending-ceremony{padding:0 14px 18px}.ceremony-actions.dialog-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:10px 14px}.ceremony-actions .primary-button{grid-column:1/-1;justify-content:center}.ceremony-actions .secondary-button,.ceremony-actions .text-button{font-size:11px;letter-spacing:0;padding:8px;justify-content:center;min-height:44px}}
@media(max-height:500px) and (orientation:landscape){.ceremony-actions.dialog-actions{display:flex;flex-wrap:nowrap;padding:8px 14px;gap:10px}.ceremony-actions .primary-button{font-size:11px;padding:9px 14px}.ceremony-actions .secondary-button,.ceremony-actions .text-button{font-size:10px;padding:8px}}
@media(max-width:650px) and (max-height:620px) and (orientation:portrait){.conversation-portrait{width:110px}.conversation-portrait img{max-height:110px}.conversation-quote{font-size:16px}.conversation-choices{margin-top:14px}}

.ceremony-seal{position:relative;bottom:auto;margin-top:4px}.ceremony-actions .text-button{margin-top:0;align-self:stretch}
@media(max-width:650px) and (max-height:620px) and (orientation:portrait){.ceremony-scene{height:210px}}
