/* =====================================================
   KSI – Performance styles for Snax quizzes (v17.1.0-eng)
   ===================================================== */

/* --- Mobile (touch devices): no transitions for faster paint --- */
@media (hover: none) {
  .snax-quiz-answer {
    transition: none !important;
    animation: none !important;
    will-change: auto !important;
    contain: paint !important;
  }
}

/* --- Desktop (hover devices): light transitions only on colors --- */
@media (hover: hover) {
  .snax-quiz-answer {
    transition: background-color 150ms ease-in-out, color 150ms ease-in-out !important;
  }
}

/* === INP: Kill AMP FCP animation (common bottleneck) === */
.amp-fcp,
.amp-fcp-anim,
div[class*="amp-fcp"] {
  animation: none !important;
  transition: none !important;
  opacity: 1 !important;
  will-change: auto !important;
}

/* === INP: Stop background-color animations on answers (mobile) === */
@media (hover: none) {
  .snax-quiz-answer,
  .snax-quiz-answer.snax-quiz-answer-checked,
  .snax-quiz-answer.snax-quiz-answer-correct,
  .snax-quiz-answer.snax-quiz-answer-wrong {
    animation: none !important;
    transition: none !important;
    will-change: auto !important;
    contain: paint !important;
  }

  /* Natychmiastowy finalny kolor dla zaznaczenia */
  .snax-quiz-answer.snax-quiz-answer-checked {
    background-color: var(--snax-checked-bg, #97cbff) !important;
  }
}

/* === Accessibility: respect prefers-reduced-motion === */
@media (prefers-reduced-motion: reduce) {
  .snax-quiz-answer,
  .snax-quiz-answer * {
    animation: none !important;
    transition: none !important;
  }
}

/* === INP: isolate repaint of each quiz answer === */
.snax-quiz-answer {
  contain: layout paint !important;
  will-change: transform, opacity !important;
  transform: translateZ(0);
}

/* Avoid repainting whole quiz container */
.snax-quiz-answers {
  contain: layout paint !important;
  transform: translateZ(0);
}

/* === Neutralize heavy paint triggers === */
.snax-quiz-answer,
.snax-quiz-answer * {
  box-shadow: none !important;
  filter: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  text-shadow: none !important;
}

/* =====================================================
   RESULTS PAGE EXCEPTIONS (apply only after quiz ends)
   ===================================================== */

/* Inside reveal container, allow transitions again */
.snax-quiz-question-reveal-answers .snax-quiz-answer,
.snax-quiz-question-reveal-answers .snax-quiz-answer * {
  animation: initial !important;
  transition: background-color 0.25s ease !important;
  will-change: auto !important;
  contain: paint !important;
}

/* Correct answer */
.snax-quiz-question-reveal-answers .snax-quiz-answer-right {
  background-color: #bfe895 !important;
}

/* Wrong answer */
.snax-quiz-question-reveal-answers .snax-quiz-answer-wrong {
  background-color: #ff8ca4 !important;
}

/* Variables fallback */
:root {
  --snax-checked-bg: #97cbff;
  --snax-correct-bg: #bfe895;
  --snax-wrong-bg: #ff8ca4;
}
