/*
 * Reader bubble rendering v8
 * Structural implementation: unique classes + real inline SVG tails.
 * No pseudo-elements are used, so the old triangle rules cannot interfere.
 */
.story-caption-card,
.story-dialogue-card{
  position:absolute;
  z-index:4;
  background:#fff;
  color:#111;
  border:3px solid #111;
  border-radius:34px;
  box-shadow:0 5px 14px rgba(0,0,0,.28);
  overflow:visible;
  box-sizing:border-box;
}

.story-caption-card{
  left:20px;
  top:18px;
  right:auto;
  max-width:min(46%,470px);
  padding:18px 22px;
  line-height:1.65;
  font-size:15px;
  font-weight:600;
  font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

.story-dialogue-card{
  right:5%;
  left:auto;
  top:10%;
  max-width:min(32%,340px);
  padding:18px 22px;
  font-family:var(--comic);
  font-size:24px;
  text-align:center;
  line-height:1.08;
  letter-spacing:.02em;
}

.story-caption-card > span,
.story-dialogue-card > span{
  position:relative;
  z-index:2;
  display:block;
}

.story-card-tail{
  position:absolute;
  z-index:1;
  width:34px;
  height:22px;
  bottom:-20px;
  overflow:visible;
  pointer-events:none;
}

.story-caption-card .story-card-tail{left:34px}
.story-dialogue-card .story-card-tail{right:38px}

.story-card-tail .tail-fill{fill:#fff}
.story-card-tail .tail-edge{
  fill:none;
  stroke:#111;
  stroke-width:3;
  stroke-linecap:round;
  stroke-linejoin:round;
  vector-effect:non-scaling-stroke;
}

@media(max-width:820px){
  .story-caption-card{
    max-width:78%;
    font-size:12px;
    padding:14px 16px;
  }
  .story-dialogue-card{
    max-width:55%;
    font-size:17px;
    top:21%;
    padding:14px 16px;
  }
}

@media(max-width:520px){
  .story-caption-card{
    left:10px;
    top:10px;
    max-width:84%;
    font-size:11px;
    line-height:1.5;
  }
  .story-dialogue-card{
    right:10px;
    top:26%;
    max-width:64%;
    font-size:14px;
    padding:12px 14px;
  }
  .story-caption-card .story-card-tail{left:24px}
  .story-dialogue-card .story-card-tail{right:28px}
}

@media (min-width:1180px) and (max-height:820px){
  .story-caption-card{
    max-width:min(38%,430px);
    font-size:13px;
    padding:15px 18px;
  }
  .story-dialogue-card{
    max-width:min(28%,310px);
    font-size:20px;
    padding:15px 19px;
  }
}
