/* Portrait illustrations retain the whole figure; dialogue and choices have their own column. */
html.tx-open-world .tx-story-surface[data-presentation="portrait"] {
 position:fixed!important;inset:0!important;width:100vw;height:100dvh;
}
html.tx-open-world .tx-story-surface[data-presentation="portrait"]::before {
 content:"";position:absolute;inset:-24px;background:var(--story-image) center/cover no-repeat;
 filter:blur(24px) brightness(.26);
}
html.tx-open-world .tx-story-surface[data-presentation="portrait"]>img {
 position:absolute;left:2%;top:0;width:44%;height:100%;object-fit:contain;object-position:50% 50%;z-index:1;
}
html.tx-open-world .tx-story-surface[data-presentation="portrait"]::after {
 background:linear-gradient(90deg,transparent 25%,#07191d40 44%,#07191df0 63%);z-index:2;
}
@media(min-width:961px) {
 html.tx-edition.tx-open-world.tx-story-open.tx-story-portrait #dialogue-box,
 html.tx-edition.tx-open-world.tx-story-open.tx-story-portrait #dialogue-box.choice-state {
  position:fixed!important;left:48vw!important;right:3vw!important;top:50dvh!important;bottom:auto!important;
  width:auto!important;height:var(--xc-dialogue-height,36dvh)!important;min-height:0!important;max-height:58dvh!important;transform:translateY(-50%)!important;
  padding:0!important;background:#0b242bdc;
 }
 html.tx-edition.tx-open-world.tx-story-open.tx-story-portrait #dialogue-box .dlg-main {
  position:relative!important;inset:auto!important;display:block!important;width:100%!important;height:100%!important;
  box-sizing:border-box;overflow-y:auto!important;padding:26px 30px 42px!important;
  scrollbar-width:thin;scrollbar-color:#8b805e #10252a;
 }
 html.tx-edition.tx-open-world.tx-story-open.tx-story-portrait #dialogue-box #speaker-name {
  position:static!important;width:auto!important;height:auto!important;margin:0 0 16px!important;font-size:18px;
 }
 html.tx-edition.tx-open-world.tx-story-open.tx-story-portrait #dialogue-box #dialogue-text {
  position:static!important;width:auto!important;height:auto!important;max-height:none!important;overflow:visible!important;
  font-size:17px;line-height:1.9;
 }
 html.tx-edition.tx-open-world.tx-story-open.tx-story-portrait #dialogue-box.choice-state {
  top:7dvh!important;height:var(--xc-dialogue-height,32dvh)!important;max-height:40dvh!important;transform:none!important;
 }
 html.tx-edition.tx-open-world.tx-story-open.tx-story-portrait #choices-panel {
  position:fixed!important;left:48vw!important;right:3vw!important;top:calc(7dvh + var(--portrait-dialog-height,32dvh) + 14px)!important;bottom:5dvh!important;
  width:auto!important;height:auto!important;transform:none!important;
 }
 html.tx-edition.tx-open-world.tx-story-open.tx-story-portrait #choices-list {grid-template-columns:1fr!important;gap:8px;align-content:start;grid-auto-rows:min-content;}
 /* The generic five-choice layout must not shorten this portrait column. */
 html.tx-edition.tx-open-world.tx-story-open.tx-story-portrait #game-screen:has(#choices-list.many) #dialogue-box.choice-state {
  left:48vw!important;right:3vw!important;top:7dvh!important;bottom:auto!important;
  width:auto!important;height:var(--xc-dialogue-height,40dvh)!important;max-height:40dvh!important;transform:none!important;
 }
 html.tx-edition.tx-open-world.tx-story-open.tx-story-portrait #game-screen #choices-panel:has(#choices-list.many) {
  left:48vw!important;right:3vw!important;top:calc(7dvh + var(--portrait-dialog-height,40dvh) + 14px)!important;bottom:5dvh!important;
  width:auto!important;height:auto!important;transform:none!important;
 }
}
@media(max-width:960px) and (orientation:portrait) {
 html.tx-open-world .tx-story-surface[data-presentation="portrait"]>img {
  left:0;top:0;width:100%;height:64dvh;object-fit:contain;object-position:50% 0;
 }
 html.tx-open-world .tx-story-surface[data-presentation="portrait"]::after {background:linear-gradient(transparent 32%,#07191d 72%);}
}
@media(max-width:960px) and (orientation:landscape) {
 html.tx-open-world .tx-story-surface[data-presentation="portrait"]>img {left:0;width:40%;}
}
/* Let wide rescue and duel scenes carry complete action paragraphs, below the faces. */
@media(min-width:961px) {
 html.tx-open-world.tx-story-open:has(.tx-story-surface:is([data-story-key="fairy-tournament-king-rescue"],[data-story-key="qingyue-sword-spirit-clone"],[data-story-key="qingyue-ice-cloud-domain"],[data-story-key="qingyue-chu-night-pill"]):not(.hidden)) #dialogue-box {
  position:fixed!important;left:50%!important;right:auto!important;top:auto!important;bottom:4dvh!important;
  width:min(940px,90vw)!important;height:auto!important;min-height:180px!important;max-height:44dvh!important;
  transform:translateX(-50%)!important;
 }
 html.tx-open-world.tx-story-open:has(.tx-story-surface:is([data-story-key="fairy-tournament-king-rescue"],[data-story-key="qingyue-sword-spirit-clone"],[data-story-key="qingyue-ice-cloud-domain"],[data-story-key="qingyue-chu-night-pill"]):not(.hidden)) #dialogue-box .dlg-main {
  position:relative!important;inset:auto!important;width:auto!important;height:auto!important;min-height:0!important;max-height:none!important;
  margin:30px 8% 30px 16%!important;padding:8px 18px 34px!important;box-sizing:border-box;overflow:visible!important;
 }
 html.tx-open-world.tx-story-open:has(.tx-story-surface:is([data-story-key="fairy-tournament-king-rescue"],[data-story-key="qingyue-sword-spirit-clone"],[data-story-key="qingyue-ice-cloud-domain"],[data-story-key="qingyue-chu-night-pill"]):not(.hidden)) #speaker-name {
  position:static!important;width:auto!important;height:auto!important;margin:0 0 10px!important;font-size:18px;line-height:1.5;
 }
 html.tx-open-world.tx-story-open:has(.tx-story-surface:is([data-story-key="fairy-tournament-king-rescue"],[data-story-key="qingyue-sword-spirit-clone"],[data-story-key="qingyue-ice-cloud-domain"],[data-story-key="qingyue-chu-night-pill"]):not(.hidden)) #dialogue-text {
  position:static!important;width:auto!important;height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important;
  font-size:17px;line-height:1.8;
 }
}

/* Dragon heads and the cavern eyes remain visible above the narration. */
@media(min-width:961px) {
 html.tx-open-world.tx-story-open:has(.tx-story-surface[data-story-key^="dragon-intro-"]:not(.hidden)) #game-screen #dialogue-box {
  position:fixed!important;left:50%!important;right:auto!important;top:auto!important;bottom:3.5dvh!important;
  width:min(1100px,92vw)!important;height:auto!important;min-height:0!important;max-height:58dvh!important;
  transform:translateX(-50%)!important;
 }
 html.tx-open-world.tx-story-open:has(.tx-story-surface[data-story-key^="dragon-intro-"]:not(.hidden)) #game-screen #dialogue-box .dlg-main {
  position:relative!important;inset:auto!important;width:auto!important;height:auto!important;
  max-height:calc(58dvh - 155px)!important;margin:10px 0!important;padding:0 14px 4px!important;overflow-y:auto!important;
 }
}

/* The fallen swordsman lies in the lower half; use the clear sky to the right. */
@media(min-width:961px){
 html.tx-open-world.tx-story-open:has(.tx-story-surface[data-story-key="tournament-decisive-disarm"]:not(.hidden)) #dialogue-box {
  position:fixed!important;left:56vw!important;right:3vw!important;top:20dvh!important;bottom:auto!important;width:auto!important;height:auto!important;max-height:54dvh!important;transform:none!important;
 }
 html.tx-open-world.tx-story-open:has(.tx-story-surface[data-story-key="tournament-decisive-disarm"]:not(.hidden)) #dialogue-box .dlg-main {
  position:relative!important;inset:auto!important;width:auto!important;height:auto!important;min-height:0!important;max-height:none!important;margin:18px 5%!important;padding:16px 15px 34px!important;box-sizing:border-box;overflow:visible!important;
 }
 html.tx-open-world.tx-story-open:has(.tx-story-surface[data-story-key="tournament-decisive-disarm"]:not(.hidden)) #speaker-name {position:static!important;width:auto!important;height:auto!important;margin:0 0 8px!important;font-size:17px;line-height:1.5;}
 html.tx-open-world.tx-story-open:has(.tx-story-surface[data-story-key="tournament-decisive-disarm"]:not(.hidden)) #dialogue-text {position:static!important;width:auto!important;height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important;font-size:16px;line-height:1.75;}
}
