/* 2026-10-08 บทนำแบบภาพยนตร์ (js/prologue-scene.js): ฉากต้นไม้วาดด้วยโค้ดใต้ตัวหนังสือ + แถบดำบน-ล่าง */
#prologue .pl-scene { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#prologue .pl-bar { position: absolute; left: 0; right: 0; height: 9vh; background: #000; pointer-events: none; transition: transform 1.2s cubic-bezier(.2,.7,.2,1); z-index: 1; }
#prologue .pl-bar-t { top: 0; transform: translateY(-100%); }
#prologue .pl-bar-b { bottom: 0; transform: translateY(100%); }
#prologue.show .pl-bar { transform: none; }
#prologue .pl-skip { z-index: 2; }
#prologue .pl-lines .pl-line { text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9), 0 0 2px rgba(0, 0, 0, 0.9); }
@media (prefers-reduced-motion: reduce) { #prologue .pl-bar { transition: none; } }
/* ตัวหนังสืออยู่กลางทรงพุ่มต้นไม้ → แผ่นมืดนุ่ม ๆ ใต้ข้อความให้อ่านออก */
#prologue .pl-lines { padding: 18px 28px; background: radial-gradient(ellipse at center, rgba(4, 6, 15, 0.82) 0%, rgba(4, 6, 15, 0.6) 45%, rgba(4, 6, 15, 0) 75%); }
/* ฉากเล่าเรื่องที่มีภาพแนวนอน (UI.illust → #illust.scene): เต็มจอใต้กล่องคุย หรี่ขอบ + แถบดำบน-ล่าง • ปิดฉาก = กลับเกม */
#illust.scene { inset: 0; left: 0; width: 100%; height: 100%; z-index: 95; transform: scale(1.04); transition: opacity .6s ease, transform 6s ease-out; background: #05040a; }
#illust.scene.show { transform: none; }
#illust.scene img { width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: center 30%; filter: none; }
#illust.scene::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, #000 0 8vh, rgba(0,0,0,0) 22vh, rgba(0,0,0,0) 55vh, rgba(5,4,10,.85) 82vh, #000 92vh),
              radial-gradient(ellipse at 50% 40%, rgba(0,0,0,0) 45%, rgba(0,0,0,.55) 100%); }
#illust.scene { right: 0; }
/* กล่องคุยระหว่างฉาก: ลงล่างแบบนิยายภาพ ไม่บังหน้าตัวละคร */
body:has(#illust.scene.show) #w-dialog.win:not(.hidden) { top: auto !important; bottom: calc(10vh + var(--sb, 0px)) !important; left: 50% !important; right: auto !important; transform: translateX(-50%) !important; }
/* ภาพนิ่งที่ขยับได้ (ระดับ 1): กล้องค่อย ๆ ซูม/เลื่อน + แสงหายใจ • ประกายลอยวาดใน js/prologue-scene.js */
#illust.scene.show img { animation: scene-drift 16s ease-in-out infinite alternate; transform-origin: 50% 35%; }
@keyframes scene-drift { from { transform: scale(1) translate(0, 0); } to { transform: scale(1.09) translate(-1.6%, -1.2%); } }
#illust.scene::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; mix-blend-mode: screen;
  background: radial-gradient(ellipse at 50% 45%, rgba(255, 170, 90, .22), rgba(255, 170, 90, 0) 60%); animation: scene-breath 3.6s ease-in-out infinite; }
@keyframes scene-breath { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
#illust.scene::after { z-index: 3; }
#illust .scene-motes { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { #illust.scene.show img, #illust.scene::before { animation: none; } }
/* ฉากเต็มจอไม่หยุดเกม (มอนที่เหลือยังตีได้) → แผงเลือด/SP ของเราลอยเหนือฉากเสมอ */
body:has(#illust.scene.show) #basic-info { z-index: 96; }
/* 2.5D (js/scene-depth.js): แคนวาส WebGL แทนภาพนิ่งเมื่อมีแผนที่ความลึก */
#illust .scene-depth { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
#illust.scene.depth img { visibility: hidden; }
