@import url("dialogue-component.css?v=1");
/* Opening conversation study. Scoped so the equipment renderer is unaffected. */
#opening-dialogue{scroll-margin-top:24px}
.opening-layout{display:grid;grid-template-columns:minmax(280px,410px) minmax(260px,1fr);gap:28px;align-items:start}
.opening-stage{position:relative;isolation:isolate;aspect-ratio:390/740;max-height:790px;border-radius:24px;background:#82c8dd;box-shadow:0 12px 36px #122c4c24;overflow:hidden;border:1px solid #96bacc;container-type:inline-size}
.opening-scene{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:50% 30%;z-index:-2}
.opening-stage:after{content:'';position:absolute;inset:68% 0 0;z-index:-1;background:linear-gradient(transparent,#1b4f7528);pointer-events:none}
.opening-scene-label{position:absolute;top:18px;left:16px;font-size:11px;letter-spacing:.08em;text-transform:uppercase;padding:6px 10px;border-radius:20px;color:#17334d;background:#fffdf5dc}
.opening-card{position:absolute;left:12px;right:12px;bottom:max(14px,env(safe-area-inset-bottom));padding:24px 20px 42px;min-height:114px;border:1.5px solid #285574;border-radius:15px;background:linear-gradient(#fffdf5,#f5f1e7);box-shadow:inset 0 -3px #a6d5e9,0 3px 0 #10283f20;color:#17334d;isolation:isolate}
.opening-card:before,.opening-card:after{content:'';position:absolute;top:8px;width:26px;height:26px;opacity:.12;z-index:-1;background:repeating-radial-gradient(circle at 0 0,transparent 0 17px,#8c8069 18px,transparent 19px 22px);pointer-events:none}
.opening-card:before{left:8px}.opening-card:after{right:8px;transform:scaleX(-1)}
.opening-speaker{position:absolute;top:-13px;left:16px;min-width:88px;margin:0!important;padding:3px 13px;border-radius:9px;color:#fff8e7;background:#17334d;font-size:15px!important;line-height:22px;letter-spacing:.01em;text-align:center}
.opening-card[data-side=right] .opening-speaker{left:auto;right:16px}
.opening-line{font-size:clamp(17px,4.6cqi,19px);line-height:1.42;min-height:2.84em;margin:0!important;font-weight:650;color:#17334d}
.opening-actions{position:absolute;bottom:3px;right:8px;display:flex;gap:4px;align-items:center}
.opening-actions button{min-width:48px;min-height:44px;padding:12px 7px 4px;border:0;border-radius:8px;color:#4a6475;background:transparent;font:inherit;font-size:12px;cursor:pointer;box-shadow:none}
.opening-actions .opening-next{font-size:14px;color:#17334d;font-weight:800;min-width:62px}
.opening-actions button:hover{background:#2855740b}
.opening-actions button:focus-visible,.opening-options button:focus-visible{outline:3px solid #1689c7;outline-offset:1px}
.opening-progress{position:absolute;bottom:18px;left:22px;display:flex;gap:5px}
.opening-progress i{width:6px;height:6px;border-radius:50%;background:#b5bec3}.opening-progress i.current{background:#168cc8}
.opening-options{display:flex;gap:8px;flex-wrap:wrap;margin:16px 0}
.opening-options button{min-height:44px;padding:10px 14px;border:1px solid #9eb7c7;border-radius:10px;background:#fffdf5;color:#17334d;cursor:pointer;font:inherit;font-size:13px}
.opening-options button[aria-pressed=true]{background:#17334d;color:#fff8e7}
.opening-reference{display:block;width:min(100%,360px);height:auto;border-radius:12px;margin:16px auto 0}
.opening-caption{font-size:13px;line-height:1.6;color:#526b7c;margin-top:12px}
.opening-ended{position:absolute;inset:auto 16px 20px;padding:20px;background:#fffdf5;border:1px solid #285574;border-radius:15px;color:#17334d;font-size:16px;box-shadow:0 3px 0 #a6d5e9}
.opening-ended button{display:block;margin-top:12px;min-height:44px;border:0;border-radius:8px;background:#17334d;color:#fff8e7;padding:10px 16px;font:inherit;cursor:pointer}
.opening-stage[data-format=wide]{aspect-ratio:16/9;max-height:none}.opening-stage[data-format=wide] .opening-card{max-width:580px;margin:auto}.opening-stage[data-format=wide] .opening-scene{object-position:50% 42%}.opening-stage[data-format=wide] .opening-scene-label{display:none}
.opening-stage.large-text .opening-line{font-size:22px;line-height:1.5}
@media(max-width:760px){.opening-layout{grid-template-columns:minmax(0,1fr)}.opening-stage{max-width:410px;width:100%;margin:auto}.opening-stage[data-format=wide]{max-width:none;min-height:260px}.opening-reference{max-width:300px}}
@media(prefers-reduced-motion:reduce){#opening-dialogue *{animation:none!important;transition:none!important}}

/* Keep the character attached to the card, not enlarged across the game view. */
.opening-dock{position:absolute;left:12px;right:12px;bottom:max(14px,env(safe-area-inset-bottom));max-width:600px;margin-inline:auto;--bust:clamp(112px,33cqi,136px)}
.opening-dock[hidden]{display:none}
.opening-dock .opening-card{position:relative;inset:auto;min-height:102px;padding:22px 20px 38px;z-index:1}
.opening-portrait{position:absolute;left:10px;bottom:calc(100% - 6px);width:var(--bust);height:var(--bust);background:url('assets/opening-dialogue/speaker-busts.png') left center/200% 100% no-repeat;pointer-events:none;z-index:0}
.opening-dock[data-side=right] .opening-portrait{left:auto;right:10px;background-position:right center}
.opening-stage[data-format=wide] .opening-dock{--bust:clamp(72px,22cqi,96px)}
.opening-stage.large-text .opening-dock{--bust:108px}
.opening-stage[data-format=wide].large-text .opening-dock{--bust:64px}
.opening-stage[data-format=wide] .opening-dock .opening-card{max-width:none}
#opening-dialogue details{margin-top:16px}#opening-dialogue summary{cursor:pointer;min-height:44px;display:flex;align-items:center;color:#285574;font-size:13px}
.opening-layout:has(.opening-stage[data-format=wide]){grid-template-columns:minmax(0,1fr)}
.opening-stage[data-format=wide]{width:100%;max-width:844px;margin-inline:auto}
