/* ChaosSwordGarden - ストーリー画面（戦闘前後のセリフ）
   戦闘画面と同じ舞台・立ち絵を使い、場面が地続きに見えるようにする。 */

#story-scene {
  position: relative;
  aspect-ratio: 3 / 2;
  width: 100%;
  border-radius: 6px;
  overflow: hidden;
  background: #05060a;
  border: 1px solid var(--border);
  font-family: "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", "MS Mincho", serif;
  cursor: pointer;
}

.story-bg {
  position: absolute;
  inset: 0;
  background-position: center 55%;
  background-size: cover;
  background-repeat: no-repeat;
  filter: brightness(0.5) saturate(0.9) contrast(1.05);
}

.story-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 62% at 50% 46%, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, 0.7) 100%),
    linear-gradient(180deg, rgba(3, 4, 8, 0.86) 0%, rgba(3, 4, 8, 0) 22%, rgba(3, 4, 8, 0) 48%, rgba(3, 4, 8, 0.95) 82%);
}

/* 立ち絵。セリフ枠に被らないよう中央やや上に置く */
#story-portrait {
  position: absolute;
  left: 50%;
  bottom: 27%;
  height: 62%;
  width: auto;
  transform: translateX(-50%);
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.9)) brightness(0.95);
  animation: storyPortraitIn 0.45s ease-out;
}

#story-portrait.hidden-portrait { display: none; }

@keyframes storyPortraitIn {
  from { opacity: 0; transform: translateX(-50%) translateY(14px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* 章題と舞台 */
#story-header {
  position: absolute;
  top: 16px;
  left: 0;
  right: 0;
  text-align: center;
  text-shadow: 0 2px 8px #000, 0 0 16px #000;
}

#story-subtitle {
  display: block;
  font-size: 20px;
  letter-spacing: 0.1em;
  color: #efe6cf;
}

#story-place {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: #b9b2a0;
}

/* セリフ枠 */
#story-window {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 5%;
  min-height: 26%;
  padding: 16px 22px 14px;
  background: linear-gradient(180deg, rgba(10, 12, 20, 0.93), rgba(6, 7, 12, 0.97));
  border: 1px solid #6e5a28;
  box-shadow: 0 6px 26px rgba(0, 0, 0, 0.8), inset 0 0 24px rgba(0, 0, 0, 0.6);
}

#story-speaker {
  font-size: 17px;
  font-weight: 600;
  color: #ffd27a;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
  min-height: 1.2em;
}

/* 心の声は話者名を出さず、地の文として斜体で見せる */
#story-window.inner #story-speaker { display: none; }
#story-window.inner #story-text {
  font-style: italic;
  color: #c9b8d8;
}

#story-text {
  margin: 0;
  font-size: 16px;
  line-height: 1.9;
  color: #f0ece2;
  letter-spacing: 0.02em;
  white-space: pre-wrap;
}

#story-hint {
  margin-top: 10px;
  text-align: right;
  font-size: 11px;
  color: var(--muted);
  font-family: "Segoe UI", "Yu Gothic UI", sans-serif;
  animation: storyHintBlink 1.4s ease-in-out infinite alternate;
}

@keyframes storyHintBlink {
  from { opacity: 0.35; }
  to   { opacity: 0.9; }
}
