/* Quiet, stationary reading plane over a live orbital scene. */
html:has(dialog.nex-cinema[open]) { overflow:hidden; }
.nex-scene-renderer { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.nex-cinema[data-scene-renderer="webgl"]:not([data-phase="battle"])::before { background: none; }
.nex-cinema[data-scene-renderer="fallback"] .nex-scene-renderer { visibility: hidden; }
.nex-cinema[data-scene-renderer="fallback"]:not([data-phase="battle"])::before {
  background: linear-gradient(90deg,#030811f2,#03081155),url('../../../assets/cinematics/story-background.png.webp') right center/cover;
}
.nex-cinema[data-scene-renderer="fallback"][data-scene-mood="chapter"]::before,
.nex-cinema[data-scene-renderer="fallback"][data-scene-mood="dawn"]::before {
  background-image: linear-gradient(90deg,#030811e6,#03081177),url('../../../assets/cinematics/chapter-background.png.webp');
}
.nex-story-frame { position:absolute; left:7%; top:50%; transform:translateY(-50%); width:min(43%,620px); max-height:calc(100% - 110px); overflow:auto; scrollbar-width:thin; scrollbar-color:#7196a644 transparent; padding:12px 8px; box-sizing:border-box; }
.nex-story-frame:focus-visible { outline:1px solid #b0d8d7; outline-offset:5px; }
.nex-story-frame .nex-eyebrow { color:#e3c690; font:12px/1.8 "Microsoft YaHei",sans-serif; letter-spacing:.16em; }
.nex-story-frame .nex-eyebrow i { color:#627c8a; font-style:normal; margin:0 .7em; }
.nex-story-frame h1 { color:#ece5d7; font-family:"Songti SC","STSong","SimSun",serif; font-size:clamp(30px,3.7vw,56px); font-weight:400; letter-spacing:.16em; line-height:1.3; margin:20px 0 28px; }
.nex-story-frame p { color:#c8d3d8; font:clamp(15px,1.25vw,18px)/2 "Microsoft YaHei","PingFang SC",sans-serif; letter-spacing:.035em; margin:0 0 1em; text-wrap:pretty; }
.nex-story-frame p:last-child { margin-bottom:0; }
.nex-story-frame .nex-story-signal { color:#b0d8d7; font-family:"Consolas","Microsoft YaHei",monospace; letter-spacing:.16em; margin:.5em 0; }
.nex-story-location { position:absolute; top:24px; right:6%; color:#8da9b7; font-size:11px; letter-spacing:.12em; }
.nex-story-timeline { position:absolute; left:calc(7% + 8px); bottom:28px; width:min(42%,600px); display:flex; gap:7px; }
.nex-story-timeline > span { display:block; height:2px; flex:1; background:#bdd9e21c; overflow:hidden; }
.nex-story-timeline i { display:block; width:100%; height:100%; transform-origin:left; transform:scaleX(var(--read,0)); background:#e3c690; }
.nex-story-timeline [data-state="read"] i { background:#7c9ca7; }
.nex-cinema[data-phase="story"] .nex-cinema-header,
.nex-cinema[data-phase="story"] .nex-cinema-controls { background:#03081170; border-color:#b9dce510; }
.nex-cinema[data-phase="story"] .nex-cinema-controls { min-height:64px; }
.nex-cinema[data-phase="arrival"] .nex-title-card,
.nex-cinema[data-phase="chapter"] .nex-chapter-card { position:absolute; left:7%; width:43%; box-sizing:border-box; padding:16px; text-align:left; }
.nex-cinema[data-phase="chapter"] .nex-chapter-card i { margin:25px 0; background:#e3c690; }
.nex-cinema[data-phase="chapter"] .nex-chapter-card h1 { font-family:"Songti SC","STSong","SimSun",serif; font-size:clamp(32px,5vw,64px); color:#ece5d7; }
.nex-cinema[data-phase="chapter"] .nex-chapter-card h2 { letter-spacing:.12em; }
@media (max-aspect-ratio: 85/100) {
  .nex-story-location { top:18px; right:0; width:100%; text-align:center; font-size:10px; }
  .nex-story-frame { left:6%; top:auto; bottom:45px; width:88%; max-height:48%; transform:none; padding:6px 2px; }
  .nex-story-frame h1 { font-size:clamp(28px,7.5vw,42px); margin:12px 0 18px; }
  .nex-story-frame .nex-eyebrow { font-size:10px; }
  .nex-story-frame p { font-size:14px; line-height:1.85; }
  .nex-story-timeline { left:6%; bottom:24px; width:88%; gap:5px; }
  .nex-cinema[data-phase="story"] .nex-cinema-controls { display:grid; grid-template-columns:1fr 1fr; min-height:66px; gap:7px 12px; padding:8px 6% max(12px,env(safe-area-inset-bottom)); }
  .nex-cinema[data-phase="story"] .nex-cinema-controls > span { grid-column:1/-1; grid-row:1; font-size:10px; text-align:center; }
  .nex-cinema[data-phase="story"] .nex-cinema-controls > button { grid-row:2; }
  .nex-cinema[data-phase="story"] .nex-cinema-controls > button:first-child { grid-column:1; }
  .nex-cinema[data-phase="arrival"] .nex-title-card,
  .nex-cinema[data-phase="chapter"] .nex-chapter-card { left:6%; width:88%; bottom:6%; padding:0; }
  .nex-cinema[data-phase="arrival"] .nex-title-card h1 { font-size:26px; letter-spacing:.03em; margin:12px 0; }
  .nex-cinema[data-phase="chapter"] .nex-chapter-card h1 { font-size:36px; }
  .nex-cinema[data-phase="chapter"] .nex-chapter-card h2 { font-size:21px; }
}
@media (max-height:520px) and (min-aspect-ratio:85/100) {
  .nex-story-frame { left:5%; width:46%; max-height:calc(100% - 40px); padding:4px; }
  .nex-story-frame h1 { font-size:28px; margin:6px 0 10px; }
  .nex-story-frame p { font-size:12px; line-height:1.7; margin-bottom:.6em; }
  .nex-story-frame .nex-eyebrow { font-size:10px; }
  .nex-story-location { top:15px; font-size:10px; }
  .nex-story-timeline { left:5.5%; bottom:9px; width:44%; }
  .nex-cinema[data-phase="story"] .nex-cinema-controls { min-height:48px; padding-block:5px; }
}
@media (max-width:360px) and (min-height:521px) {
  .nex-story-frame { max-height:60%; }
  .nex-story-frame h1 { margin:10px 0 14px; }
}
