/* Comic lettering is shared by the playable scenes. The stage places each voice. */
.scene-bubble {
  --bubble-edge:#292c43;
  --bubble-paper:#e9f2ff;
  --bubble-tail-x:20px;
  position:relative; isolation:isolate; display:inline-block;
  width:fit-content; max-width:100%; padding:7px 13px 8px;
  border:1.8px solid var(--bubble-edge); border-radius:13px 13px 13px 8px;
  background:var(--bubble-paper); color:#172d4b;
  box-shadow:1px 2px 0 #23233840; text-align:start;
  font:650 clamp(12px,1.64dvh + 6px,18px)/1.23 var(--body);
  overflow-wrap:break-word; text-wrap:pretty; pointer-events:none;
}
.scene-bubble-speaker {
  display:block; margin:0 0 3px; color:#244a73;
  font:800 clamp(9px,1.15dvh + 4px,12px)/1 var(--mono);
  text-transform:uppercase; letter-spacing:.09em;
}
.scene-bubble-text {display:block;white-space:pre-line}
.scene-bubble[data-kind=hero] {--bubble-paper:#b5d8ff}
.scene-bubble[data-kind=npc] {
  --bubble-paper:#fffaf0; --bubble-tail-x:calc(100% - 32px);
  color:#332f36; border-radius:13px 13px 8px 13px;
}
.scene-bubble[data-kind=npc] .scene-bubble-speaker {color:#65505b}
.scene-bubble:is([data-kind=hero],[data-kind=npc])::after {
  content:""; position:absolute; bottom:-7px; left:var(--bubble-tail-x);
  width:11px; height:11px; border:solid var(--bubble-edge); border-width:0 1.8px 1.8px 0;
  background:var(--bubble-paper); transform:skewY(-23deg) rotate(47deg);
}
.scene-bubble[data-kind=npc]::after {transform:skewY(22deg) rotate(44deg)}
.scene-bubble[data-kind=thought] {
  --bubble-paper:#ffefe0; --bubble-tail-x:14px; border:0;
  border-radius:0; padding:13px 22px; background:transparent;
  color:#423445; box-shadow:none;
  filter:drop-shadow(1px 2px 0 #28213c38);
}
.scene-bubble[data-kind=thought] .scene-bubble-speaker {color:#745362}
.scene-bubble[data-kind=thought]::before {
  content:""; position:absolute; inset:0; z-index:-1;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='85' viewBox='0 0 240 85' preserveAspectRatio='none'%3E%3Cpath d='M16 22Q14 6 42 8Q54 1 74 6Q91 1 111 5Q143 0 156 5Q181 1 193 7Q219 3 224 17Q239 19 235 36Q244 50 231 59Q232 75 209 75Q194 84 177 78Q152 85 136 79Q109 85 91 80Q58 86 47 78Q21 82 17 70Q2 68 6 54Q-2 41 8 33Q5 25 16 22Z' fill='%23ffefe0' stroke='%2348394b' stroke-width='1.7' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
.scene-bubble[data-kind=thought]::after {
  content:""; position:absolute; left:var(--bubble-tail-x); bottom:-5px; width:8px; height:6px;
  border:1.5px solid #48394b; border-radius:50%; background:var(--bubble-paper);
  box-shadow:-7px 6px 0 -2px var(--bubble-paper),-7px 6px 0 -1px #48394b;
}
#speech {
  position:absolute; z-index:6; inset:auto;
  top:calc(19% + 4px); left:clamp(12px, calc(var(--thought-anchor,40%) + 15px), 62%);
  max-width:min(33%,310px); padding:0; border:0; background:transparent; text-align:left;
}
#speech .scene-bubble {width:max-content;max-width:100%}
@media(max-height:350px) {
  .scene-bubble {font-size:12px;padding:6px 10px}
  .scene-bubble[data-kind=thought] {padding:10px 17px}
}
