/* QRU / MCQ answer tiles — pressable, selectable, lockable */

.answer-choices {
  --answer-choice-bg: #171a30;
  --answer-choice-border: rgba(255, 255, 255, 0.16);
  --answer-choice-selected-bg: rgba(113, 125, 252, 0.22);
  --answer-choice-press-scale: 0.98;
  --answer-choice-pop-scale: 1;
  --bs-gutter-x: 14px;
  --bs-gutter-y: 14px;
}

.quiz-play {
  color: #fff;
}

.quiz-play__top {
  padding-top: 18px;
  padding-bottom: 0;
}

.quiz-play__bar {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 8px;
}

.quiz-play__close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.quiz-play__close:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.quiz-play__heading {
  text-align: center;
  min-width: 0;
}

.quiz-play__eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #9aa4ef;
  line-height: 1.2;
  margin-bottom: 2px;
}

.quiz-play__title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
}

.quiz-play__hearts {
  margin-top: 6px;
}

.quiz-play__hearts h2 {
  margin: 0;
  font-size: inherit;
}

.quiz-play__timer {
  justify-self: end;
  min-width: 44px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.quiz-play__progress {
  height: 8px;
  margin-top: 18px;
  background: #3c4160;
  border-radius: 999px;
}

.quiz-play__progress .progress-bar {
  background: linear-gradient(90deg, #7b6cff 0%, #6e7bff 100%);
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(123, 108, 255, 0.45);
}

.quiz-play__body {
  padding-top: 8px;
}

.quiz-play .card-body {
  padding: 0;
}

.quiz-play .question-instructions {
  text-align: left;
  color: #fff;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -0.02em;
  margin: 28px 0 22px;
}

.quiz-play .question-instructions .attachment__caption {
  display: none;
}

.quiz-play .question-instructions .question-image,
.adaptive-explanation .question-image {
  --question-image-w: 4;
  --question-image-h: 3;
  display: block;
  width: min(100%, calc(360px * var(--question-image-w) / var(--question-image-h)));
  aspect-ratio: var(--question-image-w) / var(--question-image-h);
  margin: 18px auto 0;
  box-sizing: border-box;
  border: 3px solid #fff;
  border-radius: 16px;
  overflow: hidden;
  background: #2c3154;
  position: relative;
}

.quiz-play .question-instructions .question-image:not(.question-image--loaded)::before,
.adaptive-explanation .question-image:not(.question-image--loaded)::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.16) 42%, transparent 64%);
  background-size: 220% 100%;
  animation: question-image-shimmer 1.2s ease-in-out infinite;
}

.quiz-play .question-instructions .question-image figure,
.quiz-play .question-instructions .question-image .attachment,
.adaptive-explanation .question-image figure,
.adaptive-explanation .question-image .attachment {
  margin: 0;
  width: 100%;
  height: 100%;
}

.quiz-play .question-instructions img,
.adaptive-explanation img {
  display: block;
  margin: 18px auto 0;
  max-width: 100%;
  max-height: 360px;
  width: auto;
  height: auto;
  border: 3px solid #fff;
  border-radius: 16px;
  background: #2c3154;
}

.quiz-play .question-instructions .question-image img,
.adaptive-explanation .question-image img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  object-fit: cover;
  border: none;
  border-radius: 0;
  background: transparent;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.quiz-play .question-instructions .question-image.question-image--loaded img,
.adaptive-explanation .question-image.question-image--loaded img {
  opacity: 1;
}

@keyframes question-image-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

body:has(.quiz-play) {
  padding-bottom: 24px;
}

.question-instructions {
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 1.5rem;
  padding-top: 0.75rem;
}

.answer-choice {
  position: relative;
  cursor: pointer;
  background: var(--answer-choice-bg);
  font-weight: 600;
  font-size: 16px;
  color: white;
  min-height: 72px;
  width: 100%;
  border-radius: 18px;
  border: 1.5px solid var(--answer-choice-border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition:
    transform 0.12s ease,
    background-color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.answer-choices .col,
.answer-choices .answer-choice-wrap {
  display: flex;
}

.answer-choices .answer-choice-wrap {
  width: 100%;
}

.answer-choices .answer-choice {
  flex: 1;
  min-height: 104px;
  margin: 0;
  padding: 18px 16px;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
  border-radius: 22px;
  border-width: 1px;
  background: var(--answer-choice-bg);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.answer-choices .answer-choice:hover {
  background-color: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.38);
}

.answer-choice--pressed {
  transform: scale(var(--answer-choice-press-scale));
  border-color: rgba(255, 255, 255, 0.5);
  background-color: rgba(255, 255, 255, 0.06);
}

.answer-choice--selected,
input[type="radio"]:checked + .answer-choice {
  background-color: var(--answer-choice-selected-bg);
  border-color: #8b97ff;
  color: white;
  transform: scale(var(--answer-choice-pop-scale));
  box-shadow: 0 0 0 1px rgba(139, 151, 255, 0.35);
}

.answer-choice--selected.answer-choice--pressed {
  transform: scale(var(--answer-choice-press-scale));
}

.answer-choice__text {
  flex: 1;
  text-align: center;
}

/* Outcome states (ready for inline reveal; unused while redirecting) */
.answer-choice--correct {
  background-color: var(--success-200, rgba(168, 244, 62, 0.12));
  border-color: var(--color-success);
  color: white;
  transform: none;
}

.answer-choice--wrong {
  background-color: var(--danger-200, rgba(253, 100, 100, 0.12));
  border-color: var(--color-danger);
  color: white;
  transform: none;
}

.answer-choices--locked {
  pointer-events: none;
}

.answer-choices--locked .answer-choice:not(.answer-choice--selected):not(.answer-choice--correct):not(.answer-choice--wrong) {
  opacity: 0.55;
}

.answer-choices--locked .answer-choice--selected {
  transform: scale(1);
}
