@charset "utf-8";

/* 
Base style
*/
body {
  font-size: 15px;
  line-height: 1.5;
  color: #333;
  background: #993400;
  height: 100vh;
  display: flex;
  justify-content: center;
}

a {
  text-decoration: none;
  color: #333;
}

button {
  cursor: pointer;
  color: #333;
}

/*
start-scene
*/
#start-scene {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.title-container {
  background-color: #fff;
  border-radius: 2vh;
  border: solid 0.7vh #e17a02;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  margin-top: 2.5vh;
  flex-shrink: 0;
}

.title-container>img {
  display: block;
  width: auto;
  max-width: 100%;
  height: 25vh;
}

.start-summary-container {
  background-color: #fff;
  border: solid 0.7vh #e17a02;
  border-radius: 2vh;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  margin-top: 2vh;
  flex-shrink: 1;
  min-height: 0;
}

.start-summary-container>img {
  display: block;
  max-height: 45vh;
  width: auto;
  max-width: 100%;
  height: auto;
}

.mute-btn {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 999;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(6px);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #374151;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  transition: background 0.15s, transform 0.1s;
  pointer-events: auto;
}
.mute-btn:hover { background: rgba(255, 255, 255, 1); transform: scale(1.08); }
.mute-btn:active { transform: scale(0.95); }

.last-play-badge {
  display: flex;
  align-items: center;
  gap: 0.5em;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 1.5vh;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.5vh 1.4vh;
  margin-top: 1vh;
  max-width: 90%;
  line-height: 1.4;
  backdrop-filter: blur(4px);
}
.last-play-label {
  font-size: 1.5vh;
  font-weight: 400;
  opacity: 0.75;
}
.last-play-wrong {
  font-size: 1.1vh;
  opacity: 0.8;
}
.last-play-date {
  font-size: 1.5vh;
  opacity: 0.65;
  margin-left: 0.2em;
}

.button-container {
  background-color: #fff;
  border: solid 0.7vh #e17a02;
  border-radius: 2vh;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  margin-top: 2vh;
  flex-shrink: 0;
}

.button-container>img {
  display: block;
  max-height: 6.45vh;
  width: auto;
  max-width: 100%;
  height: auto;
  border-radius: 0;
  cursor: pointer;
}

.clear-summary-container {
  background-color: #fff;
  border: solid 0.7vh #e17a02;
  border-radius: 2vh;
  margin: auto;
  display: inline-flex;
  overflow: hidden;
}

.clear-summary-container>img {
  display: block;
  height: 45vh;
  width: auto;
}

.failure-summary-container {
  background-color: #fff;
  border: solid 0.7vh #e17a02;
  border-radius: 2vh;
  margin: 5% auto auto auto;
  display: inline-flex;
  overflow: hidden;
}

.failure-summary-container>img {
  display: block;
  height: 47vh;
  width: auto;
}

/*
main-section
*/
.main-section {
  height: 100vh;
  width: calc(100vh * 9 / 19.5);
  flex-shrink: 0;
}

#battle-scene {
  display: none;
  height: 100%;
  width: 100%;
  position: relative;
}

.question-container {
  background-color: #fff;
  height: 30%;
  overflow-y: auto;
  margin: 5% auto auto auto;
  padding: 3% 3% 0 3%;
  border: solid 0.7vh #e17a02;
  border-radius: 2vh;
  font-size: 3vh;
  font-weight: var(--font-weight-text, 400);
}

.question-container>h2 {
  margin: 0;
  font-weight: var(--font-weight-heading, 500);
  font-style: normal;
  font-family: var(--font-heading, inherit);
  font-size: 6vh;
}

#quiz-count {
  font-size: 5vh;
  font-family: var(--font-heading, inherit);
}

#js-question {
  font-size: 2.5vh;
  font-weight: var(--font-weight-text, 500);
  font-style: normal;
  font-family: var(--font-text, inherit);
}

#question-image {
  display: block;
  max-width: 100%;
  max-height: 31vh;
  border-radius: 8px;
  margin: 6px auto 0;
  object-fit: contain;
}

.enemy-container>p {
  position: absolute;
  bottom: calc(3% + 0.8vh + 0.8vh);
  left: 65%;
  bottom: 69%;
  margin: 0;
  font-size: 3.2vh;
  font-weight: var(--font-weight-comprehension-label, 500);
  color: #333;
  font-family: var(--font-comprehension-label, 'Noto Sans JP', sans-serif);
  z-index: 10;
}

#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;
}

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

.battle-container {
  position: relative;
  height: 44%;
  margin: 5% auto auto auto;
  border: solid 0.7vh;
  border-radius: 2vh;
  overflow: hidden;
  pointer-events: none;
}

.background-image {
  width: 100%;
  height: auto;
  display: block;
}

.enemy-container {
  position: relative;
  margin-top: -23vh;
  height: 60%;
}

.enemy-image {
  width: 42%;
  height: auto;
  display: block;
  text-align: right;
  margin-left: 53%;
}

.enemy-hp-image {
  width: 40%;
  height: auto;
  display: block;
  margin-left: 55%;
  margin-top: 2vh;
}

.hero-container {
  height: 60%;
  margin-top: -15%;
  display: flex;
}

.hero-images {
  width: 80%;
}

.hero-image {
  width: 70%;
  height: auto;
  display: block;
  margin-left: -2%;
  position: relative;
  bottom: 0;
}

.hero-hp-image {
  height: 6vh;
  width: auto;
  display: block;
  margin-top: 0%;
  margin-left: 3%;
}

.hero-container>.move {
  margin-top: 15%;
  width: 40%;
  margin-left: 3%;
}

.move>div {
  font-size: 2vh;
  border: solid 0.2vh #333;
  display: block;
  text-align: center;
  margin-top: 5%;
  width: 70%;
}

#heal {
  height: 20%;
  margin-bottom: 5%;
  width: auto;
  display: block;
  cursor: pointer;
}

#attack {
  height: 20%;
  margin-bottom: 5%;
  width: auto;
  display: block;
  cursor: pointer;
}

#gard {
  height: 20%;
  margin-bottom: 5%;
  width: auto;
  display: block;
  cursor: pointer;
}

.answers-container {
  margin: 5% auto auto auto;
  height: 20%;
}

.answers-contents {
  display: flex;
}

.answers-contents-options {
  background-color: #fff;
  height: auto;
  width: 50%;
  aspect-ratio: 3.2 / 1;
  font-size: 2.4vh;
  text-align: center;
  line-height: 2.8vh;
  border: none;
  border: solid 0.7vh #e17a02;
  border-radius: 2vh;
  font-weight: var(--font-weight-button, 500);
  font-style: normal;
  font-family: var(--font-button, inherit);
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.answers-contents-options.btn-correct {
  background-color: #dcfce7 !important;
  border-color: #16a34a !important;
  color: #166534 !important;
}

.answers-contents-options.btn-wrong {
  background-color: #fee2e2 !important;
  border-color: #dc2626 !important;
  color: #991b1b !important;
}

.answers-contents>button {
  color: #333;
  font-weight: var(--font-weight-button, 400);
}

.answers-contents-left-top {
  margin-bottom: 2.5%;
  margin-right: 2.5%;
}

.answers-contents-right-top {
  margin-bottom: 2.5%;
  margin-left: 2.5%;
}

.answers-contents-left-bottom {
  margin-top: 2.5%;
  margin-right: 2.5%;
}

.answers-contents-right-bottom {
  margin-top: 2.5%;
  margin-left: 2.5%;
}

/* 5択レイアウト（5行1列） */
.answers-container.is-column {
  height: 34%;
}

.answers-container.is-column .answers-contents {
  justify-content: center;
  margin: 2.5% 0;
}

.answers-container.is-column .answers-contents-options {
  width: 100%;
  aspect-ratio: 7 / 1;
  font-size: 2.1vh;
}

/* 2択 ○✖ レイアウト（標準グリッドと同じ横並び） */
.answers-container.is-ox {
  height: 20%;
  margin-left: 0.7vh;
  margin-right: 0.7vh;
}

.answers-contents.is-ox-row {
  justify-content: center;
  gap: 5%;
}

.answers-contents.is-ox-row .answers-contents-options {
  width: 48.8%;
}

.ox-choice-img {
  height: 55%;
  width: auto;
  object-fit: contain;
  pointer-events: none;
  display: block;
  margin: auto;
}

.modal {
  display: none;
  background-color: #fff;
  height: 44%;
  padding: 3%;
  margin: 5% auto auto auto;
  border: solid 0.7vh #e17a02;
  border-radius: 2vh;
}

.correct-image {
  margin: auto;
  width: 37%;
  height: auto;
  display: block;
}

.wrong-image {
  margin: auto;
  width: 40%;
  height: auto;
  display: block;
}

.explanation {
  margin-top: 3%;
  font-size: 1.9vh;
  height: 30%;
  font-weight: var(--font-weight-text, 500);
  font-style: normal;
  font-family: var(--font-text, inherit);
}

.next-quiz {
  width: 50%;
  text-align: center;
  display: block;
  margin-top: 10%;
  margin-left: 57%;
  font-size: 3vh;
  cursor: pointer;
  font-weight: 600;
  font-style: normal;
}

#clear {
  display: none;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

#clear .title-container {
  margin: 2% auto auto auto;
}

#clear .clear-summary-container {
  margin: 1.5vh auto 0;
}

#clear .button-container {
  margin: 2% auto auto auto;
}

.play-again-btn {
  display: block;
  margin: 1.5vh auto;
  padding: 1vh 3vh;
  background: #e68600;
  color: #fff;
  border: solid 0.5vh #e68600;
  border-radius: 99px;
  font-size: 2.5vh;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
  transition: background 0.15s, transform 0.1s;
  width: 85%;
}
.play-again-btn:hover  { filter: brightness(1.1); }
.play-again-btn:active { transform: scale(0.97); }

.clear-summary-container>img {
  display: block;
  height: 45vh;
  background-color: #fff;
  margin: auto;
  border-radius: 1vh;
}

.select-hero {
  margin: 20% auto 15% auto;
  height: auto;
  width: 60%;
  display: block;
}

.select-item {
  display: flex;
}

.rest {
  display: block;
  height: auto;
  width: 40%;
  margin: auto;
}

.dance {
  display: block;
  height: auto;
  width: 40%;
  margin: auto;
}

.you-win {
  margin: 20% auto 5% auto;
  height: auto;
  width: 70%;
  display: block;
}

.style {
  height: 4.3vh;
  width: auto;
  display: block;
  margin: 10% auto 5% auto;
}

.retry {
  display: block;
  width: 45%;
  margin: auto;
}

.unit-select {
  width: 70%;
  margin: auto;
  display: block;
}

.course-select {
  width: 70%;
  margin: auto;
  display: block;
}

.next-unit {
  width: 55%;
  margin: auto;
  display: block;
}

.you-lose {
  margin: 40% auto 15% auto;
  height: auto;
  width: 70%;
  display: block;
}

/* 
ジャンプ
*/
#hero-image-box {
  position: relative;
  margin-top: -3vh;
}

.wrong-action {
  position: absolute;
  display: none;
  width: 55%;
  height: auto;
  top: 2%;
  left: 3%;
  z-index: 10;
}

#hero-image {
  position: absolute;
  display: block;
  bottom: 0;
  z-index: 1;
}

#enemy-image-box {
  position: relative;
}

.correct-action {
  position: absolute;
  display: none;
  width: 50%;
  height: auto;
  top: 31%;
  right: -2%;
  z-index: 10;
}

#enemy-image {
  position: absolute;
  display: block;
  bottom: 0;
  margin-bottom: -2vh;
}

/* 間違えた問題の復習パネル */
#wrong-answers-wrap {
  width: 85%;
  margin: 0 auto 1.5vh;
  border: 2px solid #e68600;
  border-radius: 10vh;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

#wrong-answers-wrap.is-open {
  border-radius: 2.2vh;
}

.wrong-answers-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 0.4em;
  width: 100%;
  margin: 0;
  padding: 1vh 3vh;
  position: relative;
  background: rgba(255, 255, 255, 0.88);
  border: none;
  border-radius: 0;
  font-size: 1.5vh;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  color: #374151;
  box-shadow: none;
  transition: background 0.15s;
  white-space: nowrap;
  overflow: hidden;
}
.wrong-answers-toggle:hover { background: rgba(255, 255, 255, 1); }

.toggle-arrow {
  position: absolute;
  right: 1.5vh;
  flex-shrink: 0;
  font-size: 1.2vh;
}

.wrong-answers-list {
  width: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1vh;
}

/* open時: リストアイテムの角丸を除去（wrap が全体を囲む） */
#wrong-answers-wrap.is-open .wrong-answers-list {
  gap: 0;
}
#wrong-answers-wrap.is-open .wrong-item {
  border-radius: 0;
  box-shadow: none;
}

.wrong-item {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 1vh;
  padding: 1.2vh 1.5vh;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.wrong-item-q {
  margin: 0 0 0.6vh 0;
  font-size: 1.5vh;
  font-weight: 700;
  color: #1f2937;
  line-height: 1.5;
}

.wrong-item-your {
  margin: 0 0 0.4vh 0;
  font-size: 1.4vh;
  color: #374151;
}

.wrong-answer-text {
  color: #dc2626;
  font-weight: 700;
}

.wrong-item-correct {
  margin: 0 0 0.4vh 0;
  font-size: 1.4vh;
  color: #374151;
} 

.correct-answer-text {
  color: #16a34a;
  font-weight: 700;
}

.wrong-item-exp {
  margin: 0.5vh 0 0 0;
  font-size: 1.3vh;
  color: #6b7280;
  line-height: 1.5;
  border-top: 1px solid #e5e7eb;
  padding-top: 0.5vh;
}

/* ② スタート画面：問題数バッジ */
.quiz-question-count {
  color: #333;
  font-size: 1.6vh;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-top: 1.5vh;
  background: #b1b1b174;
  border-radius: 99px;
  padding: 0.5vh 2vh;
}

/* ③ スタート画面：不正解ルール説明 */
.quiz-rule-hint {
  color: rgb(255, 255, 255);
  font-size: 1.2vh;
  margin: 0.8vh 0 0;
  text-align: center;
}

/* ④ バトル画面：やめるボタン */
.quit-btn {
  position: absolute;
  top: 1.5vh;
  right: 1.5vh;
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.2vh;
  font-weight: 600;
  padding: 0.6vh 1.2vh;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: background 0.2s, color 0.2s;
  z-index: 10;
  text-decoration: none;
}

.quit-btn:hover {
  background: rgba(0, 0, 0, 0.45);
  color: rgba(255, 255, 255, 0.95);
}

/* ① 結果画面：導線ナビ */
.result-nav-links {
  display: flex;
  gap: 1.5vh;
  justify-content: center;
  margin-bottom: 1.5vh;
  flex-wrap: wrap;
}

.result-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  background: rgba(255, 255, 255, 0.82);
  color: #333;
  border: 0.4vh solid #e68600;
  border-radius: 10vh;
  padding: 0.9vh 2.5vh;
  font-size: 1.5vh;
  font-weight: 600;
  transition: background 0.2s;
  text-decoration: none;
  white-space: nowrap;
  width: 41%;
}

.result-nav-btn svg {
  width: 1.5vh;
  height: 1.5vh;
  flex-shrink: 0;
}

button.result-nav-btn {
  cursor: pointer;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
}

.result-nav-btn:hover {
  background: rgba(255, 255, 255, 1);
  color: #111;
}