.scene-preview { margin-bottom: 24px; padding: 24px; border-color: var(--gold-dim); }
.scene-preview h3 { margin: 4px 0 8px; font-size: 1.35rem; }
.scene-preview .scene-eyebrow { color: var(--gold); font-size: .78rem; letter-spacing: .12em; }
.scene-preview p { margin-top: 0; }
.scene-library { margin-bottom: 36px; }
.scene-search { display: block; color: #c7b7a8; font-size: .8rem; margin-top: 22px; }
.scene-search input { display: block; margin-top: 8px; width: min(100%, 520px); min-height: 48px; padding: 12px 16px; box-sizing: border-box; border: 1px solid #c6ad7955; background: #111a29; color: #f9e7d6; border-radius: 24px; font: inherit; font-size: 16px; }
.scene-search input:focus-visible { outline: 2px solid #e7bb92; outline-offset: 3px; }
.scene-book-character { color: #e4bc99; font-size: .77rem; margin: -8px 0 18px; }
.scene-library > h2 { margin: 8px 0 12px; font-size: clamp(1.35rem, 4vw, 2rem); }
.scene-library .scene-eyebrow { color: var(--gold); font-size: .8rem; letter-spacing: .06em; }
.scene-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.scene-filter { min-height: 44px; padding: 9px 18px; border: 1px solid #b8a17d55; border-radius: 24px; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.scene-filter[aria-pressed="true"] { background: #e8c78a; color: #211b13; border-color: #e8c78a; }
.scene-filter:focus-visible { outline: 3px solid #e8c78a; outline-offset: 3px; }
.scene-library-status { color: var(--text-muted, #b6ad9e); font-size: .85rem; min-height: 1.5em; margin: 16px 0; }
.scene-book-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.scene-book { min-width: 0; overflow: hidden; border: 1px solid #c6ad7933; border-radius: 14px; background: #121a29; }
.scene-book > img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; object-position: center 35%; }
.scene-book-body { padding: 16px; display: flex; flex-direction: column; align-items: flex-start; }
.scene-book-meta { margin: 0 0 7px; font-size: .75rem; color: #dac394; }
.scene-book h3 { font-size: 1.05rem; margin: 0 0 8px; line-height: 1.5; }
.scene-book-description { margin: 0 0 18px; color: #c0bbaf; line-height: 1.65; font-size: .85rem; min-height: 2.8em; }
.scene-book .btn { min-height: 44px; margin-top: auto; }
.season-stories-details { padding-top: 20px; border-top: 1px solid #c6ad7933; }
.season-stories-details > summary { cursor: pointer; min-height: 44px; color: #dac394; }
#season-stories { margin-top: 20px; }
@media (min-width: 1000px) { .scene-book-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 420px) { .scene-book-grid { grid-template-columns: 1fr; } }

html:has(.scene-player[open]) { overflow: hidden; }
.scene-player {
  position: fixed; inset: 0; margin: 0; padding: 0; border: 0;
  width: 100vw; max-width: none; height: 100%; height: 100dvh; max-height: none;
  color: #fff7e7; background: #090e19; overflow: hidden;
  font-family: inherit;
}
.scene-player::backdrop { background: #090e19; }
.scene-art, .scene-art img, .scene-shade { position: absolute; inset: 0; width: 100%; height: 100%; }
.scene-art img { object-fit: cover; }
.scene-shade {
  pointer-events: none;
  background: linear-gradient(180deg, #050915ab 0%, transparent 22%, transparent 42%, #05091580 64%, #050915f5 100%);
}
.scene-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 1;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: max(16px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 16px max(20px, env(safe-area-inset-left));
  font-size: .85rem;
}
.scene-top span { text-shadow: 0 2px 8px #000; }
.scene-top button { flex-shrink: 0; min-height: 44px; }
.scene-content {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: min(100%, 660px); max-height: calc(100% - 86px); overflow-y: auto;
  padding: 20px max(22px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(22px, env(safe-area-inset-left));
  background: linear-gradient(180deg, transparent, #080e19a6 24%);
  scrollbar-width: thin;
}
.scene-content h2 { margin: 0 0 8px; color: #f7d99b; font-size: 1.5rem; text-shadow: 0 2px 12px #000; }
.scene-content h2:focus { outline: none; }
.scene-summary { margin: 0 0 20px; line-height: 1.8; font-size: 1.02rem; text-shadow: 0 1px 8px #000; }
.scene-choices { display: grid; gap: 10px; }
.scene-player[data-phase="dialogue"] .scene-choices,
.scene-player[data-phase="dialogue"] .scene-end-note { visibility: hidden; }
.scene-player[data-phase="ready"] .scene-choices { animation: scene-choices-in 240ms ease-out; }
@keyframes scene-choices-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.scene-choice {
  width: 100%; min-height: 52px; padding: 13px 18px; border: 1px solid #e0be7e99;
  border-radius: 8px; background: #0d1729e8; color: #fff3d7;
  font: inherit; text-align: left; line-height: 1.5; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.scene-choice:hover { background: #293247; border-color: #f4d297; }
.scene-choice:focus-visible { outline: 3px solid #ffe1a3; outline-offset: 3px; }
.scene-end-note { color: #ded5c2; font-size: .85rem; line-height: 1.6; }
.scene-feedback {
  position: absolute; inset: 35% 24px auto; text-align: center;
  max-width: 520px; margin: auto; line-height: 1.8;
}
.scene-feedback .btn { min-height: 48px; }
@media (max-height: 540px) and (min-width: 600px) {
  .scene-content { left: auto; right: 12px; transform: none; width: 46%; padding: 12px 18px; background: #080e19dc; border-radius: 12px 12px 0 0; }
  .scene-art img { object-position: 50% 28% !important; }
  .scene-summary { margin-bottom: 10px; }
  .scene-content h2 { font-size: 1.1rem; }
  .scene-choice { min-height: 44px; padding: 10px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .scene-choice { transition: none; }
  .scene-player[data-phase="ready"] .scene-choices { animation: none; }
}

/* 정사각형 삽화는 원본 구도를 보존하고 아래/옆에 읽기 영역을 둔다. */
.scene-player[data-art-layout="square"] .scene-art { top: 56px; height: min(100vw, 65dvh); }
.scene-player[data-art-layout="square"] .scene-art img { object-fit: contain; object-position: 50% 0 !important; }
.scene-player[data-art-layout="square"] .scene-shade { background: linear-gradient(180deg, transparent 48%, #090e1900 55%, #090e19 73%); }
.scene-player[data-art-layout="square"] .scene-content { background: linear-gradient(180deg, #090e19e8, #090e19); max-height: 49%; }
@media (min-aspect-ratio: 1/1) {
  .scene-player[data-art-layout="square"] .scene-art { top: 70px; width: 58%; height: calc(100% - 80px); }
  .scene-player[data-art-layout="square"] .scene-art img { object-position: 50% 50% !important; }
  .scene-player[data-art-layout="square"] .scene-shade { display: none; }
  .scene-player[data-art-layout="square"] .scene-content { left: auto; right: 0; top: 70px; bottom: 0; transform: none; width: 42%; max-height: calc(100% - 70px); background: #090e19; display: flex; flex-direction: column; justify-content: center; }
  .scene-player[data-art-layout="square"] .scene-content[hidden] { display: none; }
  .scene-player[data-art-layout="square"] .scene-choices { flex-shrink: 0; }
}
@media (min-aspect-ratio: 1/1) and (max-height: 650px) {
  .scene-player[data-art-layout="square"] .scene-content { justify-content: flex-start; }
}

/* 대화 컷: 인물 클로즈업을 화면 전체에 두고 짧은 대사만 아래에 겹친다. */
.scene-player[data-presentation="dialogue"] .scene-art { inset: 0; width: 100%; height: 100%; }
.scene-player[data-presentation="dialogue"] .scene-art img { object-fit: cover; }
.scene-player[data-presentation="dialogue"] .scene-shade {
  display: block;
  background: linear-gradient(180deg, #05091585, transparent 16%, transparent 50%, #05091575 70%, #050915ef);
}
.scene-player[data-presentation="dialogue"] .scene-content {
  top: auto; bottom: 0; left: 50%; right: auto; transform: translateX(-50%);
  display: block; width: min(100%, 900px); max-height: calc(100% - 90px);
  padding: 20px max(22px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(22px, env(safe-area-inset-left));
  background: transparent;
}
.scene-player[data-presentation="dialogue"] .scene-content[hidden] { display: none; }
.scene-player[data-presentation="dialogue"] .scene-content h2 { font-size: 1rem; letter-spacing: .06em; margin-bottom: 8px; }
.scene-player[data-presentation="dialogue"] .scene-summary { font-size: clamp(1.05rem, 2.4vw, 1.3rem); line-height: 1.7; margin-bottom: 18px; word-break: keep-all; overflow-wrap: anywhere; }
@media (min-width: 760px) {
  .scene-player[data-presentation="dialogue"] .scene-choices:has(> :nth-child(2)) { grid-template-columns: 1fr 1fr; }
}
@media (max-height: 480px) and (min-aspect-ratio: 1/1) {
  .scene-player[data-presentation="dialogue"] .scene-content { padding-top: 10px; padding-bottom: 12px; }
  .scene-player[data-presentation="dialogue"] .scene-summary { margin-bottom: 10px; font-size: 1rem; }
  .scene-player[data-presentation="dialogue"] .scene-choice { min-height: 44px; padding: 8px 14px; }
}
/* Free-input pilot belongs to its story card, alongside the authored edition. */
.scene-free-entry { margin-top: 10px; width: 100%; }
.scene-free-note { font-size: .75rem !important; margin-top: 8px; line-height: 1.55; }
