/* V18: clear answer feedback that preserves the quiet forest interface. */
.challenge {
  position: relative;
}

.choice.is-correct,
.choice.is-wrong {
  position: relative;
  padding-left: 52px;
  border: 0;
  transform: translateY(-1px);
}

.choice.is-correct {
  color: #153f31;
  background: #d8e9df;
  box-shadow: inset 4px 0 0 #34735b, 0 10px 24px rgba(31, 89, 67, 0.12);
  animation: answerChoiceCorrect 420ms cubic-bezier(0.2, 0.9, 0.25, 1.15);
}

.choice.is-wrong {
  color: #702f29;
  background: #f4dcd6;
  box-shadow: inset 4px 0 0 #c76558, 0 10px 24px rgba(145, 66, 55, 0.12);
  animation: answerChoiceWrong 360ms ease-out;
}

.choice.is-correct::after,
.choice.is-wrong::after {
  position: absolute;
  top: 50%;
  left: 12px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  font-size: 1rem;
  font-weight: 950;
  line-height: 1;
  transform: translateY(-50%);
}

.choice.is-correct::after {
  content: "✓";
  background: #34735b;
}

.choice.is-wrong::after {
  content: "×";
  background: #c76558;
}

.feedback.is-correct,
.feedback.is-wrong {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 52px;
  margin-top: 12px;
  padding: 10px 14px 10px 12px;
  border: 0;
  border-radius: 6px;
  line-height: 1.38;
  animation: answerBannerIn 360ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.feedback.is-correct {
  color: #214c3c;
  background: #dcebe2;
  box-shadow: 0 10px 26px rgba(31, 89, 67, 0.1);
}

.feedback.is-wrong {
  color: #733b34;
  background: #f5e0db;
  box-shadow: 0 10px 26px rgba(145, 66, 55, 0.1);
}

.feedback.is-timeout {
  background: #eee1d8;
}

.feedback.is-correct::before,
.feedback.is-wrong::before {
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 950;
  line-height: 1;
}

.feedback.is-correct::before {
  content: "✓";
  background: #34735b;
}

.feedback.is-wrong::before {
  content: "×";
  background: #c76558;
}

.feedback.is-correct strong,
.feedback.is-wrong strong {
  color: inherit;
}

.answer-flash {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 30;
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.45) rotate(-8deg);
}

.answer-flash[hidden] {
  display: none;
}

.answer-flash span {
  position: relative;
  display: block;
  width: 58px;
  height: 58px;
  border-radius: 50%;
}

.answer-flash.is-correct {
  color: #fff;
  background: rgba(216, 233, 223, 0.94);
  box-shadow: 0 0 0 12px rgba(216, 233, 223, 0.38), 0 18px 42px rgba(31, 89, 67, 0.24);
}

.answer-flash.is-wrong {
  color: #fff;
  background: rgba(244, 220, 214, 0.95);
  box-shadow: 0 0 0 12px rgba(244, 220, 214, 0.38), 0 18px 42px rgba(145, 66, 55, 0.22);
}

.answer-flash.is-correct span {
  background: #34735b;
}

.answer-flash.is-wrong span {
  background: #c76558;
}

.answer-flash.is-correct span::before {
  content: "";
  position: absolute;
  top: 16px;
  left: 14px;
  width: 27px;
  height: 14px;
  border-bottom: 5px solid currentColor;
  border-left: 5px solid currentColor;
  border-radius: 2px;
  transform: rotate(-45deg);
}

.answer-flash.is-wrong span::before,
.answer-flash.is-wrong span::after {
  content: "";
  position: absolute;
  top: 27px;
  left: 14px;
  width: 30px;
  height: 5px;
  border-radius: 4px;
  background: currentColor;
}

.answer-flash.is-wrong span::before { transform: rotate(45deg); }
.answer-flash.is-wrong span::after { transform: rotate(-45deg); }

.answer-flash.is-animating {
  animation: answerFlash 920ms cubic-bezier(0.18, 0.86, 0.25, 1) both;
}

@keyframes answerChoiceCorrect {
  0% { transform: scale(0.98); }
  62% { transform: scale(1.018); }
  100% { transform: translateY(-1px) scale(1); }
}

@keyframes answerChoiceWrong {
  0%, 100% { transform: translateX(0); }
  28% { transform: translateX(-4px); }
  58% { transform: translateX(3px); }
}

@keyframes answerBannerIn {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes answerFlash {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.45) rotate(-8deg); }
  24% { opacity: 1; transform: translate(-50%, -50%) scale(1.06) rotate(2deg); }
  55% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0); }
  100% { opacity: 0; transform: translate(-50%, -58%) scale(0.94); }
}

@media (max-width: 640px) and (orientation: portrait) {
  body:not(.needs-entry) .feedback.is-correct,
  body:not(.needs-entry) .feedback.is-wrong {
    min-height: 50px;
    margin-top: 4px;
    padding: 9px 11px;
    font-size: 0.74rem;
  }

  body:not(.needs-entry) .answer-flash {
    top: 54%;
    width: 80px;
    height: 80px;
  }

  body:not(.needs-entry) .answer-flash span {
    transform: scale(0.88);
  }
}

@media (prefers-reduced-motion: reduce) {
  .choice.is-correct,
  .choice.is-wrong,
  .feedback.is-correct,
  .feedback.is-wrong,
  .answer-flash.is-animating {
    animation-duration: 1ms;
  }
}
