/* ── Quiz container ──────────────────────────────────────── */
.ays-quiz-container {
  max-width: 720px;
  margin: 32px auto;
  background: #1a1a1a;
  border: 1px solid #2e2e2e;
  border-radius: 10px;
  overflow: hidden;
  font-family: 'Prompt', sans-serif;
  color: #fff;
}

/* ── Start page ──────────────────────────────────────────── */
.ays-quiz-start-page {
  padding: 40px 32px;
  text-align: center;
}

.ays-quiz-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #fff;
}

.ays-quiz-cover-image {
  margin: 0 0 20px;
}

.ays-quiz-cover-image figure {
  margin: 0 auto;
  width: 100%;
  max-width: calc(320px * 16 / 9);
}

.ays-quiz-cover-image__frame {
  aspect-ratio: 16 / 9;
  max-height: 320px;
  background: #222;
  border-radius: 8px;
  overflow: hidden;
}

.ays-quiz-cover-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.ays-quiz-cover-image figure > figcaption,
.ays-quiz-cover-image__caption {
  display: block;
  width: 100%;
  font-size: 12px;
  color: #888;
  padding: 6px 0 0;
  line-height: 1.4;
  text-align: center;
}

.ays-quiz-desc {
  font-size: 14px;
  color: #aaa;
  margin: 0 0 24px;
  line-height: 1.6;
}

.ays-quiz-start-actions {
  margin-top: 8px;
}

/* ── Buttons ─────────────────────────────────────────────── */
.ays-quiz-btn {
  display: inline-block;
  padding: 12px 32px;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, color .15s;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.ays-quiz-btn--start,
.ays-quiz-btn--finish {
  background: #f72140;
  color: #fff;
}
.ays-quiz-btn--start:hover,
.ays-quiz-btn--finish:hover {
  background: #d41535;
}

.ays-quiz-btn--next {
  background: #f72140;
  color: #fff;
}
.ays-quiz-btn--next:hover {
  background: #d41535;
}

.ays-quiz-btn--prev {
  background: #2e2e2e;
  color: #ccc;
  margin-right: 8px;
}
.ays-quiz-btn--prev:hover {
  background: #3e3e3e;
  color: #fff;
}

.ays-quiz-btn--restart {
  background: #2e2e2e;
  color: #ccc;
  margin-top: 16px;
}
.ays-quiz-btn--restart:hover {
  background: #3e3e3e;
  color: #fff;
}

/* ── Question step ───────────────────────────────────────── */
.ays-quiz-step {
  padding: 32px 32px 0;
}

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

.ays-quiz-step--in {
  animation: aysQuizIn 0.28s ease forwards;
}

.ays-quiz-step--out {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

.ays-quiz-progress {
  font-size: 12px;
  color: #888;
  margin-bottom: 16px;
  text-align: right;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.ays-quiz-question-image {
  text-align: center;
  margin-bottom: 16px;
}

.ays-quiz-question-image figure {
  margin: 0 auto;
  width: 100%;
  max-width: calc(300px * 16 / 9);
}

.ays-quiz-question-image__frame {
  aspect-ratio: 16 / 9;
  max-height: 300px;
  background: #222;
  border-radius: 8px;
  overflow: hidden;
}

.ays-quiz-question-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ays-quiz-question-image figure > figcaption,
.ays-quiz-question-image__caption {
  display: block;
  width: 100%;
  font-size: 12px;
  color: #888;
  margin-top: 6px;
  padding: 0;
  line-height: 1.4;
  text-align: center;
}

.ays-quiz-question {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 20px;
  line-height: 1.5;
  color: #fff;
  text-align: center;
}

/* ── Answer options ──────────────────────────────────────── */
.ays-quiz-answers {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ays-quiz-answer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #242424;
  border: 1px solid #333;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  box-sizing: border-box;
}

.ays-quiz-answer input[type="radio"],
.ays-quiz-answer input[type="checkbox"] {
  flex-shrink: 0;
  margin: 0;
}

.ays-quiz-answer:hover {
  border-color: #f72140;
  background: #2a1a1e;
}

.ays-quiz-answer input[type="radio"],
.ays-quiz-answer input[type="checkbox"] {
  accent-color: #f72140;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.ays-quiz-answer__text {
  font-size: 14px;
  color: #ddd;
  line-height: 1.4;
}

/* Selected state */
.ays-quiz-answer.is-selected {
  border-color: #f72140;
  background: #2a1a1e;
}
.ays-quiz-answer.is-selected .ays-quiz-answer__text {
  color: #fff;
}

/* Text input */
.ays-quiz-text-input {
  width: 100%;
  padding: 12px 16px;
  background: #242424;
  border: 1px solid #333;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color .15s;
}
.ays-quiz-text-input:focus {
  outline: none;
  border-color: #f72140;
}

/* ── Navigation ──────────────────────────────────────────── */
.ays-quiz-nav {
  padding: 24px 32px 32px;
  text-align: center;
}

/* ── Result page ─────────────────────────────────────────── */
.ays-quiz-result {
  padding: 40px 32px;
  text-align: center;
}

/* Side-by-side score summary */
.ays-quiz-result__scores {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0;
  margin-bottom: 24px;
}

.ays-quiz-result__score-block {
  flex: 1;
  padding: 20px 16px;
  background: #242424;
  border-radius: 10px;
}

.ays-quiz-result__score-divider {
  width: 1px;
  background: #333;
  margin: 8px 16px;
  flex-shrink: 0;
}

.ays-quiz-result__score-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #888;
  margin-bottom: 10px;
}

.score-number {
  display: block;
  font-size: 48px;
  font-weight: 800;
  color: #f72140;
  line-height: 1;
}

.score-number--avg {
  color: #aaa;
}

.badge-pass {
  display: inline-block;
  background: #27ae60;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  vertical-align: middle;
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.badge-fail {
  display: inline-block;
  background: #e74c3c;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  vertical-align: middle;
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.ays-quiz-result__interval {
  font-size: 20px;
  font-weight: 700;
  color: #f4a023;
  margin-bottom: 16px;
  min-height: 0;
}

.ays-quiz-result__message {
  font-size: 15px;
  color: #ccc;
  margin-bottom: 12px;
  line-height: 1.6;
}

.ays-quiz-result__text {
  font-size: 14px;
  color: #aaa;
  line-height: 1.6;
}

/* ── Answer breakdown ────────────────────────────────────── */
.ays-quiz-result__breakdown {
  margin-top: 28px;
  text-align: left;
}

.ays-quiz-breakdown__title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #666;
  margin-bottom: 14px;
  text-align: center;
}

.ays-bd-item {
  border-top: 1px solid #2a2a2a;
  padding: 14px 0;
}

.ays-bd-question {
  font-size: 14px;
  font-weight: 600;
  color: #ddd;
  margin-bottom: 10px;
  line-height: 1.4;
}

.ays-bd-question__num {
  color: #666;
  font-weight: 400;
  margin-right: 4px;
}

.ays-bd-skipped {
  font-size: 11px;
  font-weight: 400;
  color: #555;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-left: 6px;
}

.ays-bd-image {
  margin-bottom: 10px;
}

.ays-bd-image figure {
  margin: 0;
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  max-height: 200px;
  background: #222;
}

.ays-bd-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ays-bd-image__caption {
  display: block;
  width: 100%;
  font-size: 11px;
  color: #666;
  padding: 5px 0 0;
  text-align: center;
}

.ays-bd-answers {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ays-bd-answer {
  font-size: 13px;
  padding: 7px 12px;
  border-radius: 6px;
  line-height: 1.4;
}

.ays-bd-answer--correct {
  background: rgba(39, 174, 96, .15);
  color: #5dca85;
  border: 1px solid rgba(39, 174, 96, .3);
}

.ays-bd-answer--wrong {
  background: rgba(231, 76, 60, .12);
  color: #e07060;
  border: 1px solid rgba(231, 76, 60, .25);
}

.ays-bd-answer--missed {
  background: rgba(39, 174, 96, .06);
  color: #666;
  border: 1px dashed rgba(39, 174, 96, .25);
}

/* ── Loading state ───────────────────────────────────────── */
.ays-quiz-btn--finish.is-loading {
  opacity: .6;
  pointer-events: none;
  cursor: not-allowed;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
  .ays-quiz-start-page,
  .ays-quiz-step,
  .ays-quiz-nav,
  .ays-quiz-result {
    padding-left: 16px;
    padding-right: 16px;
  }

  .score-number {
    font-size: 36px;
  }

  .ays-quiz-title {
    font-size: 18px;
  }
}
