/* クイズコンテナのスタイル */
.quiz-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  width: 100%;
  height: 880px;
  overflow: hidden;
}

.quiz-content{
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  width: 800px;
  height: 100%;
}

.quiz-bg-image{
  position: absolute;
  top: 50%  ;
  left: 50%;
  transform: translate(-59%, -50%);
  width: 1130px;
  height: 662px;
  z-index: -1;
}

.quiz-bg {
  width: 100%;
  height: 100%;
}

.question-index-container{
  position: absolute;
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: flex-start;
  width: 100%;
  height: 100%;
  top: 50%;
  left: 50%;
  transform: translate(-25%, -52%);
  gap: 15px;
  z-index: -50;
}

.question-index{
  width: 142px;
  height: 151px;
  transform: scaleX(-1);
  z-index: -50;
}

.quiz-title-tag{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-125%, -150%);
  width: 350px;
  height: 320px;
}

.quiz-question-container{
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 95%;
  height: 115px;
}

.question-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  width: 95%;
  height: 115px;
  font-size: 28px;
  font-family: var(--primary-font);
  font-weight: bold;
  letter-spacing: 0;
  line-height: 1.5;
  margin-bottom: 25px;
  text-align: start;
}

.choices {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 24px;
  margin-bottom: 12px;
}

.choice {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 190px;
  height: 135px;
  background-color: #fff;
  padding: 28px;
  border-radius: 16px;
  cursor: pointer;
  border: 2px solid transparent;
  gap: 10px;
  box-shadow: 0 4px 4px rgba(0,0,0,0.25);
  outline: 4px solid transparent;
}

.choice.selected {
  outline: 4px solid #EA0029;
}

.choice-number {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background-color: #D9D9D9;
  border-radius: 50%;
  font-size: 24px;
  font-family: var(--primary-font);
  font-weight: bold;
  letter-spacing: 0;
  line-height: 1.5;
  color: #fff;
}

.choice-text {
  font-size: 28px;
  font-family: var(--primary-font);
  font-weight: bold;
  letter-spacing: 0;
  line-height: 1.5;
  color: #4E4E4E;
}

/* 「これだ！」バッジのスタイル */
.choice-badge {
  position: absolute;
  display: flex;
  justify-content: center;
  align-items: center;
  top: -20px;
  right: -20px;
  width: 59px;
  height: 59px;
  background-color: #EA0029;
  color: white;
  border-radius: 50%;
  font-family: var(--primary-font);
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 0;
  line-height: 1.5;
  transform: scale(0);
  transition: transform 0.3s ease;
}

/* 選択された時のバッジ表示 */
.choice.selected .choice-badge {
  transform: scale(1);
}


.answer-button-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-top: 36px;
}

.answer-button {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 394px;
  height: 80px;
  background-color: #FFFFFF;
  color: #EA0029;
  border: solid 3px #EA0029;
  padding: 15px 30px;
  cursor: pointer;
  border-radius: 64px;
  font-family: var(--primary-font);
  font-weight: bold;
  letter-spacing: 0;
  line-height: 1.5;
  font-size: 28px;
  margin-top: 20px;
  pointer-events: auto;
}

.answer-button:disabled {
  color: #D9D9D9;
  border: solid 3px #D9D9D9;
  cursor: not-allowed;
}

.answer-button:hover:not(:disabled) {
  background-color: #EA0029;
  color: #FFF;
}

/* 解答結果表示 */
.answer-result {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 770px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding-top: 20px;
  text-align: center;
}

.correct-answer {
  display: flex;
  justify-content: flex-start;
  width: 540px;
  margin-bottom: 34px;
}

.correct-answer span {
  font-size: 28px;
  font-family: var(--primary-font);
  font-weight: bold;
  letter-spacing: 0;
  line-height: 1.5;
  color: #000000;
  top: 0px;
  margin-top: 31px;
  margin-right: 38px;
}

.correct-choice {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 190px;
  height: 135px;
  background-color: #fff;
  padding: 24px;
  border-radius: 16px;
  cursor: pointer;
  border: 2px solid transparent;
  gap: 21px;
  box-shadow: 0 4px 4px rgba(0,0,0,0.25);
}

.explanation {
  font-size: 16px;
  font-family: var(--primary-font);
  font-weight: bold;
  letter-spacing: 0;
  line-height: 2;
  height: 160px;
} 

/* 解説画像のスタイル */
.explanation-img-container {
  position: absolute;
  width: 275px;
  height: 180px;
  top: 50%;
  right: 50%;
  transform: translate(155%, -120%) rotateZ(15.25deg);
  z-index: 400;
  display: none;
}

.explanation-img {
  width: 275px;
  height: 180px;
  background-size: 100%;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 400 !important;
}

.explanation-img{
  &.category-earth {
    background-image: url(../images/quiz/explanation_earth.png);
  }

  &.category-organism {
    background-image: url(../images/quiz/explanation_organism.png);
  }

  &.category-geography {
    background-image: url(../images/quiz/explanation_geography.png);
  }

  &.category-history {
    background-image: url(../images/quiz/explanation_history.png);
  }

  &.category-food {
    background-image: url(../images/quiz/explanation_food.png);
  }

  &.category-living {
    background-image: url(../images/quiz/explanation_living.png);
  }

  &.category-science {
    background-image: url(../images/quiz/explanation_science.png);
  }

  &.category-other {
    background-image: url(../images/quiz/explanation_other.png);
  }
}

/* 解答結果表示時のみ表示 */
.answer-result[style*="display: flex"] ~ .explanation-img-container {
  display: block;
}

.correct-animation-container{
  position: absolute;
  width: 100%;
  height: 100%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(255, 255, 255, 0.8);
  z-index: 0;
  display: none;
} 

#correct-animation {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 100;
  width: 500px;
  height: auto;
}

.next-button-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.next-button {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 330px;
  background-color: #FFFFFF;
  color: #EA0029;
  border: solid 3px #EA0029;
  padding: 15px 30px;
  cursor: pointer;
  border-radius: 64px;
  font-family: var(--primary-font);
  font-weight: bold;
  letter-spacing: 0;
  line-height: 1.5;
  font-size: 28px;
  pointer-events: auto;
}

.next-button:disabled {
  color: #D9D9D9;
  border: solid 3px #D9D9D9;
  cursor: not-allowed;
}

.next-button:hover:not(:disabled) {
  background-color: #EA0029;
  color: #FFF;
}

.water-quiz-link{
  position: absolute;
  bottom: 50%;
  left: 50%;
  transform: translate(30%, 850%);
  font-size: 28px;
  font-family: var(--primary-font);
  font-weight: bold;
  letter-spacing: 0;
  line-height: 1.5;
  color: #47A8F1;
}

/* レスポンシブ対応 */
@media (max-width: 1024px) {

  .quiz-container {
    height: 1148px;
  }

  .quiz-bg-image {
    width: 868px;
    height: 848px;
  }

  .quiz-bg {
    content: url(../images/quiz/quiz_tablet_bg.svg);
  }

  .question-index {
    width: 100px;
  }

  .quiz-title-tag {
    width: 320px;
    height: 320px;
    transform: translate(-90%, -170%);
  }

  .water-quiz-link {
    transform: translate(-15%, 1150%);
    font-size: 28px;
  }

  .quiz-content {
    width: 540px;
  }
  
  .question-text {
    height: 146px;
  }

  .choices {
    flex-direction: column;
    width: 540px;
    height: 372px;
    gap: 23px;
  }

  .choice {
    width: 484px;
    height: 109px;
    flex-direction: row;
    gap: 22px;
  }

  .choice-number {
    width: 24px;
    height: 24px;
    font-size: 16px;
  }

  .choice-text {
    font-size: 24px;
  }

  .answer-result {
    display: flex;
    justify-content: center;
    width: 540px;
    z-index: 100;
  }

  .correct-answer {
    width: 100%;
    flex-direction: column;
    justify-content: flex-start;
    text-align: left;
  }

  .correct-answer span {
    margin-bottom: 20px;
  }

  .correct-choice {
    width: 484px;
    height: 52px;
    flex-direction: row;
  }

  .explanation {
    height: 313px;
  }

  .explanation-img-container {
    width: 400px;
    height: 260px;
    transform: translate(90%, -180%) rotateZ(15.25deg);
  }

  .explanation-img {
    width: 400px;
    height: 260px;
  }
}

@media (max-width: 767px) {
  .quiz-container {
    height: 910px;
  }

  .quiz-question-container {
    height: 100%;
  }

  .quiz-bg-image {
    width: 768px;
    height: 628px;
    transform: translate(-55%, -50%);
  }

  .quiz-bg {
    content: url(../images/quiz/quiz_sp_bg.svg);
  }

  .question-index-container {
    transform: translate(-15%, -57%);
    gap: 12px;
  }

  .question-index {
    width: 50px;
  }

  .quiz-title-tag {
    width: 220px;
    height: 220px;
    transform: translate(-70%, -190%);
  }

  .water-quiz-link {
    width: 300px;
    transform: translate(-30%, 1200%);
    font-size: 20px;
  }

  .quiz-content {
    width: 320px;
  }
  
  .question-text {
    height: 132px;
    font-size: 16px;
    margin-bottom: 23px;
  }

  .choices {
    width: 298px;
    height: 200px;
    gap: 16px;
  }

  .choice {
    width: 252px;
    height: 58px;
    padding: 18px 17px;
    gap: 10px;
    border-radius: 8px;
  }

  .choice-number {
    width: 16px;
    height: 16px;
    font-size: 8px;
  }

  .choice-text {
    font-size: 16px;
  }

  .answer-button {
    width: 244px;
    height: 48px;
    font-size: 16px;
  }

  .answer-result {
    width: 274px;
    padding-top: 40px;
  }

  .correct-answer {
    width: 100%;
    flex-direction: column;
    justify-content: flex-start;
    text-align: left;
  }

  .correct-answer span {
    margin-bottom: 5px;
    font-size: 14px;
  }

  .correct-choice {
    width: 242px;
    height: 26px;
    padding: 16px;
    flex-direction: row;
  }

  .choice-text {
    font-size: 14px;
  }

  .explanation {
    height: 313px;
    font-size: 14px;
    margin-bottom: 0px;
    text-align: start;
    display: flex;
    align-items: center;
  }

  .explanation-img-container {
    width: 215px;
    height: 140px;
    transform: translate(90%, -225%) rotateZ(15.25deg);
  }

  .explanation-img {
    width: 215px;
    height: 140px;
  }

  .next-button {
    width: 240px;
    height: 40px;
    padding: 0px;
    font-size: 16px;
  }

  #correct-animation {
    width: 300px;
  }
}

@media (max-width: 359px) {
  .quiz-container {
    height: 910px;
  }

  .quiz-bg-image {
    width: 768px;
    height: 628px;
    transform: translate(-55%, -50%);
  }

  .quiz-bg {
    content: url(../images/quiz/quiz_sp_bg.svg);
  }

  .quiz-content {
    width: 260px;
  }
  
  .question-text {
    height: 143px;
    font-size: 14px;
    margin-bottom: 1px;
  }

  .choices {
    width: 254px;
    height: 190px;
    gap: 8px;
  }

  .choice {
    width: 218px;
    height: 26px;
    padding: 18px 16px;
    gap: 10px;
  }

  .choice-badge {
    width: 40px;
    height: 40px;
    top: -5px;
    right: -5px;
    font-size: 8px;
  }

  .answer-result {
    width: 247px;
    padding-top: 70px;
  }

  .correct-answer {
    width: 100%;
    flex-direction: column;
    justify-content: flex-start;
    text-align: left;
    margin-bottom: 18px;
  }

  .correct-answer span {
    margin-bottom: 5px;
    font-size: 14px;
  }

  .correct-choice {
    width: 220px;
    height: 26px;
    padding: 16px;
    flex-direction: row;
  }

  .choice-text {
    font-size: 14px;
  }

  .explanation {
    height: 168px;
    font-size: 10px;
    margin-bottom: 0px;
    text-align: start;
    display: flex;
    align-items: center;
  }

  .explanation-img-container {
    width: 160px;
    height: 105px;
    transform: translate(90%, -155%) rotateZ(15.25deg);
  }

  .explanation-img {
    width: 160px;
    height: 105px;
  }
}