/* public/assets/css/stage-app-unified.css */
/* ステージ制クイズ統合ページ（トップ・選択・各ステージを1ページ内でpushState遷移）専用スタイル */

.stage-unified-section {
  display: none;
}

/* body の背景は JS 側 applyBodyBackground() が
   初期表示・画面遷移のたびに document.body.style へ直接設定する。
   stage-select.css 由来の CSS変数（--start-bg-color 等）は使わない。 */

#section-select.stage-select-section {
  min-height: 100vh;
}

#section-top.main-section,
.stage-play-section.main-section {
  height: 100vh;
  width: calc(100vh * 9 / 19.5);
  flex-shrink: 0;
  margin: 0 auto;
}

/* クイズ全体のスタート画面は、元デザインの縦比率に合わせる */
#section-top .stage-start-scene .title-container > img {
  height: 28vh;
}

#section-top .stage-start-scene .start-summary-container > img {
  height: 53vh;
}

#section-top .stage-start-scene .button-container > img {
  max-height: 6.8vh;
}

/* 各ステージのスタート画面を元デザインの間隔と比率に合わせる */
.stage-play-section .stage-start-scene .title-container {
  margin-top: 1.3vh;
}

.stage-play-section .stage-start-scene .start-summary-container {
  margin-top: 1.8vh;
}

.stage-play-section .stage-start-scene .start-summary-container > img {
  height: 51.7vh;
}

.stage-play-section .stage-start-scene .button-container {
  display: flex;
  width: 37vh;
  margin: 1.5vh auto 0;
}

.stage-play-section .stage-start-scene .button-container > img {
  width: 100%;
  max-width: none;
  max-height: 6.8vh;
}

.stage-play-section .stage-start-scene .back-button-img-wrap img {
  width: 37vh;
  height: 8vh;
  object-fit: fill;
}

/* ステージ番号付きのバトル画面にも、元画面と同じ高さ基準を適用する */
.stage-play-section .stage-battle-scene {
  position: relative;
  width: 100%;
  height: 100%;
}

.stage-play-section [id^="quiz-count-"] {
  font-size: 5vh;
  font-family: var(--font-heading, inherit);
}

.stage-play-section [id^="js-question-"] {
  font-size: 2.5vh;
  font-weight: var(--font-weight-text, 500);
  font-family: var(--font-text, inherit);
}

.stage-play-section [id^="question-image-"] {
  display: block;
  max-width: 100%;
  max-height: 31vh;
  border-radius: 8px;
  margin: 6px auto 0;
  object-fit: contain;
}

.stage-play-section .quiz-progress-bar {
  position: absolute;
  bottom: 61%;
  left: 57%;
  width: 39%;
  height: 2.2vh;
  background: var(--progress-track-color, #ffffff);
  overflow: hidden;
  z-index: 10;
}

.stage-play-section .quiz-progress-fill {
  height: 100%;
  background: var(--progress-color, #f59e0b);
  width: 0%;
  transition: width 0.4s ease;
}

.stage-play-section div[id^="hero-image-box-"] {
  position: relative;
  margin-top: -3vh;
}

.stage-play-section img[id^="hero-image-"] {
  position: absolute;
  display: block;
  bottom: 0;
  z-index: 1;
}

.stage-play-section div[id^="enemy-image-box-"] {
  position: relative;
}

.stage-play-section img[id^="enemy-image-"] {
  position: absolute;
  display: block;
  bottom: 0;
  margin-bottom: -2vh;
}

/* ステージ結果画面にも通常クイズの #clear と同じ配置を適用する */
.stage-play-section .stage-clear-scene {
  display: none;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.stage-play-section .stage-clear-scene .title-container {
  margin: 2% auto auto;
}

.stage-play-section .stage-clear-scene .clear-summary-container {
  margin: 1.5vh auto 0;
}

.stage-play-section .stage-clear-scene .wrong-answers-wrap {
  width: 31vh;
  margin: 0 auto 1.5vh;
  border: 0.7vh solid;
  border-radius: 1.5vh;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.stage-play-section .stage-clear-scene .wrong-answers-wrap.is-open {
  border-radius: 2.2vh;
}

.stage-play-section .stage-clear-scene .wrong-answers-wrap .wrong-answers-list {
  width: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.stage-play-section .stage-clear-scene .wrong-answers-wrap .wrong-item {
  border-radius: 0;
  box-shadow: none;
}
