.character-portrait {
  position:absolute;
  display:block;
  overflow:hidden;
  pointer-events:none;
}
.character-portrait img {
  position:absolute;
  inset:0 auto auto 0;
  width:100%;
  height:100%;
  object-fit:cover;
  user-select:none;
}
.character-portrait.has-art .portrait-placeholder { display:none; }
.portrait-placeholder {
  display:grid;
  place-items:center;
  align-content:center;
  gap:10px;
  min-height:100%;
  padding:8px;
  text-align:center;
  color:#f1dbb9;
  font:700 clamp(.73rem,2.6vw,1rem)/1.35 serif;
}
.portrait-placeholder::before {
  content:"";
  width:clamp(26px,7vw,44px);
  aspect-ratio:1;
  background:url('assets/ui-crest_tomoe.png') center / contain no-repeat;
}
.story-portraits { position:absolute; inset:0; z-index:-1; pointer-events:none; }
.stage-portrait {
  top:24%;
  bottom:14%;
  width:39%;
  filter:brightness(.68) drop-shadow(0 8px 12px #080a12aa);
  transition:filter .2s;
}
.stage-portrait.speaking { filter:brightness(1) drop-shadow(0 8px 12px #080a12aa); }
.stage-portrait img { object-fit:contain; object-position:center bottom; }
.portrait-left { left:2%; }
.portrait-right { right:2%; }
.stage-portrait.framed-art img {
  object-fit:cover;
  top:auto;
  bottom:0;
  height:66%;
  object-position:center 30%;
  mask-image:linear-gradient(180deg,#000 73%,transparent),linear-gradient(90deg,transparent,#000 11%,#000 89%,transparent);
  mask-composite:intersect;
}
.stage-portrait .portrait-placeholder {
  position:absolute;
  inset:auto 12% 9%;
  min-height:32%;
  background:linear-gradient(180deg,transparent,#151c23cb);
  border-bottom:1px solid #ceb2839c;
}
.leader-portrait {
  inset:0 auto 0 0;
  width:34%;
  mask-image:linear-gradient(90deg,#000 77%,transparent);
}
.leader-portrait .portrait-placeholder { opacity:.7; }
.leader-portrait img { object-position:center 35%; }
.battle-quote { display:grid; grid-template-columns:54px minmax(0,1fr); gap:2px 10px; }
.battle-quote .quote-portrait {
  position:relative;
  grid-row:1 / span 2;
  width:54px;
  align-self:start;
  aspect-ratio:1;
  border:1px solid #ae8c62;
  border-radius:6px;
}
.world-dialogue-stage {
  position:relative;
  isolation:isolate;
  overflow:hidden;
  min-height:clamp(265px,48vh,420px);
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  gap:16px;
  padding:18px 12px 12px;
  border:1px solid #826947;
  border-radius:8px;
  background:linear-gradient(#17233240,#15181f91),url('assets/ui-harbor_background.png') center 50% / cover;
}
.world-dialogue-stage .stage-portrait { top:12%; bottom:8%; }
.world-dialogue-copy {
  color:#faeed8;
  background:#232c34ed;
  border:1px solid #a9875d;
  border-radius:5px;
  padding:8px 12px;
}
#worldContent .world-dialogue-copy p { margin:.25em 0; }
@media (min-width:760px) {
  .story { max-width:920px; }
  .story-panel { margin-inline:clamp(1rem,5vw,2.75rem); }
  .stage-portrait { top:16%; bottom:12%; }
}
@media (max-height:540px) and (orientation:landscape) {
  .story-title { padding-top:12px; }
  .story-practice-actions { margin-top:.4rem; }
}
@media (prefers-reduced-motion: reduce) {
  .stage-portrait { transition:none; }
}
