body {
  margin: 0;
  font-family: "Segoe UI", sans-serif;
  background-image: url("../img/soft-clouds-bg-min.png");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  color: #4b3b2a;
}

.background {
  position: relative;
  min-height: 100vh;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.title {
  font-size: 2.5em;
  font-weight: bold;
  color: #6b4f3b;
  margin-bottom: 20px;
  text-shadow: 1px 1px 0 #fff;
}

.label {
  font-size: 1.2em;
  margin-bottom: 5px;
  color: #4b3b2a;
}

.select {
  font-size: 1.2em;
  padding: 10px 16px;
  border-radius: 12px;
  border: 2px solid #d8bfa3;
  background-color: #fff8e7;
  color: #4b3b2a;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  appearance: none;
  margin-bottom: 20px;
}

.select:focus {
  outline: none;
  border-color: #f5c76a;
}

.btn {
  background-color: #fbd68d;
  color: #4b3b2a;
  border: none;
  padding: 10px 24px;
  font-size: 1.1em;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  margin: 10px;
  transition: background-color 0.3s ease;
}

.btn:hover {
  background-color: #f5c76a;
}

.question-area {
  margin: 24px auto;
  padding: 20px;
  width: 90%;
  max-width: 600px;
  background-color: #fff;
  border: 2px solid #d8bfa3;
  border-radius: 16px;
  font-size: 1.3em;
  box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.1);
}

.answer-input {
  font-size: 1.5em;
  padding: 8px;
  border-radius: 8px;
  border: 2px solid #d8bfa3;
  background-color: #fff8e7;
  margin: 5px;
  color: #4b3b2a;
}

.answer-input.correct {
  border-color: #4caf50;
  background-color: #e0ffe0;
  animation: pop 0.4s ease;
}

.answer-input.wrong {
  border-color: #f44336;
  background-color: #ffe0e0;
  animation: shake 0.5s ease;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }

  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-5px);
  }

  20%,
  40%,
  60%,
  80% {
    transform: translateX(5px);
  }
}

/* レベル別サイズ調整 */
.answer-input.level-easy,
.choice-option.level-easy span {
  font-size: 2rem;
  padding: 12px;
}

.answer-input.level-medium,
.choice-option.level-medium span {
  font-size: 1.5rem;
  padding: 8px;
}

.answer-input.level-hard,
.choice-option.level-hard span {
  font-size: 1.2rem;
  padding: 6px;
}

.result-area {
  margin-top: 20px;
  font-size: 1.3rem;
  font-weight: bold;
  text-align: center;
}

.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.timer-display {
  font-size: 1rem;
  font-weight: bold;
}

.progress-bar {
  margin-bottom: 15px;
}

.mascot-container {
  position: relative;
  margin-top: 30px;
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  align-items: flex-end;
  gap: 12px;
}

.mascot {
  width: 120px;
  animation: float 3s ease-in-out infinite;
}

.speech-bubble {
  background: #fff8e7;
  border: 2px solid #d8bfa3;
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 1.1em;
  color: #4b3b2a;
  max-width: 200px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  position: relative;
}

.speech-bubble::after {
  content: "";
  position: absolute;
  bottom: 10px;
  right: -10px;
  border-width: 10px;
  border-style: solid;
  border-color: transparent transparent transparent #fff8e7;
}

/* 図形選択UI */
.shape-option input[type="radio"],
.choice-option input[type="radio"] {
  display: none;
}

.shape-option,
.choice-option {
  display: inline-block;
  font-size: 2rem;
  margin: 0 5px;
  cursor: pointer;
}

.shape-option input:checked + span,
.choice-option input:checked + span {
  background-color: #cfc;
  border-radius: 5px;
  padding: 2px 6px;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

/* 正解アニメーション */
.correct-animate {
  animation: pop 0.4s ease;
}

@keyframes pop {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.3);
  }

  100% {
    transform: scale(1);
  }
}

.animation-area .step {
  font-size: 1.6rem;
  margin-bottom: 8px;
  animation: fadeIn 0.5s ease;
}

.explanation-area .explanation {
  background: #fff8e7;
  border: 2px solid #d8bfa3;
  padding: 12px;
  border-radius: 12px;
  font-size: 1.2rem;
  color: #4b3b2a;
  animation: fadeIn 1s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hint-area {
  margin-top: 10px;
  font-size: 1.2rem;
  color: #3a3a3a;
}

.hint-box {
  background-color: #fffbea;
  border: 2px solid #ffd966;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 10px;
  margin: 16px 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.btn-choice {
  display: block;
  margin: 10px 0;
  padding: 12px 16px;
  border: 2px solid #d8bfa3;
  border-radius: 12px;
  background-color: #fff8e7;
  box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.btn-choice:hover {
  background-color: #f5eac2;
  border-color: #f5c76a;
}

.highlight-number {
  font-size: 1.5rem;
  font-weight: bold;
  color: #2a2a2a;
}

.question-area .question-text strong {
  font-size: 1.5rem;
  font-weight: bold;
  color: #2a2a2a;
}

.result-area div {
  font-size: 1.3rem;
  margin: 8px 0;
  padding: 8px 12px;
  border-radius: 8px;
}

.result-area .correct {
  background-color: #e0ffe0;
  border: 2px solid #4caf50;
  color: #2e7d32;
}

.result-area .wrong {
  background-color: #ffe0e0;
  border: 2px solid #f44336;
  color: #c62828;
}

.question-block {
  margin: 20px auto;
  padding: 16px;
  max-width: 600px;
  background-color: #fff;
  border: 2px solid #ddd;
  border-radius: 12px;
  box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.1);
}

.answer-label {
  display: block;
  margin: 10px 0;
  font-size: 1.1rem;
  color: #4b3b2a;
}

.answer-label input {
  display: block;
  margin-top: 6px;
  font-size: 1.4rem;
  width: 100%;
  box-sizing: border-box;
}
