/* Dialogue belongs to the close shot, with a quiet, fixed place for replies. */
.talking:before{content:'';position:fixed;inset:0;z-index:6;pointer-events:none;background:linear-gradient(180deg,#16251d38,transparent 18%,transparent 52%,#13231b80 100%)}
.talking .game-ui,.talking .atlas-mini,.talking .npc-label,.talking .world-tooltip,.talking .travel-hud{visibility:hidden;pointer-events:none}
.speech-bubble{left:50%;top:auto;bottom:max(28px,env(safe-area-inset-bottom));transform:translateX(-50%);width:min(760px,calc(100vw - 64px));max-width:none;max-height:calc(100dvh - 48px);overflow-y:auto;overscroll-behavior:contain;padding:22px 28px 18px;border:1px solid #fff3d6a3;border-radius:22px;background:#fff6e6ee;color:#3e5038;box-shadow:0 12px 48px #152c2540;backdrop-filter:blur(12px);font-family:var(--hud-font);animation:conversation-in .35s ease-out;transform-origin:center}
.speech-bubble:after{display:none}
.speech-name{position:static;display:block;width:fit-content;max-width:calc(100% - 52px);margin:0 0 10px;padding:0;border:0;border-radius:0;background:none;color:#73864f;box-shadow:none;font:500 16px/1.3 var(--hud-font)}
.speech-close{top:10px;right:12px;width:44px;height:44px;padding:13px;background:none;color:#7c886c;border:1px solid transparent;border-radius:13px}
.speech-close:hover{background:#e8ecd6;border-color:#cbd5b5}
.speech-bubble p{max-width:62ch;margin:0;font:400 22px/1.45 var(--hud-font);overflow-wrap:anywhere}
.speech-choices{display:grid;grid-template-columns:repeat(var(--reply-count,3),minmax(0,1fr));gap:8px;margin-top:18px;padding-top:14px;border-top:1px solid #a5b48b52}
.speech-choices button,.speech-next{min-height:46px;padding:11px 16px;border:1px solid #bccaa361;border-radius:12px;background:#eff0df99;color:#536a42;font:400 16px/1.3 var(--hud-font)}
.speech-choices button{gap:7px;justify-content:flex-start;text-align:left;align-items:center}
.speech-choices button:hover,.speech-next:hover{background:#e0e8ca;border-color:#a9be86}
.speech-next{margin-top:18px;justify-content:space-between;width:100%}
.speech-bubble button:focus-visible{outline:2px solid #bc754c;outline-offset:3px}
.speech-tools{display:flex;align-items:center;justify-content:flex-end;gap:6px;margin-top:10px;padding-top:4px;flex-wrap:wrap}
.speech-tools button{min-height:36px;padding:7px 9px;border:0;border-radius:8px;background:none;color:#748261;font:400 14px/1.25 var(--hud-font)}
.speech-tools button:hover{background:#e8ecd6;color:#405b35}.speech-tools #talkNext{margin-right:auto}
.speech-bubble{max-height:min(44dvh,390px);scroll-padding:16px}
@keyframes conversation-in{from{opacity:0;translate:0 8px}to{opacity:1;translate:0 0}}
@media(max-width:760px){
  .speech-bubble{bottom:max(16px,env(safe-area-inset-bottom));width:calc(100vw - 32px);max-height:46dvh;padding:18px 20px 12px;border-radius:20px}
  .speech-name{font-size:15px;margin-bottom:9px}.speech-bubble p{font-size:18px;line-height:1.45}
  .speech-close{top:6px;right:8px}.speech-choices{grid-template-columns:1fr;margin-top:12px;padding-top:10px;gap:5px}
  .speech-choices button,.speech-next{font-size:15px;padding:10px 12px;min-height:44px}.speech-next{margin-top:14px}
}
@media(max-height:500px) and (min-width:600px){
  .speech-bubble{bottom:12px;width:min(740px,calc(100vw - 48px));padding:12px 20px}
  .speech-name{font-size:14px;margin-bottom:5px}.speech-bubble p{font-size:17px;line-height:1.3}
  .speech-choices{grid-template-columns:repeat(var(--reply-count,3),minmax(0,1fr));margin-top:8px;padding-top:8px}.speech-next{margin-top:8px}
}
@media(prefers-reduced-motion:reduce){.speech-bubble{animation:none}}
