/* Quiz UI — scoped to #quiz-root and .quiz-* */

#quiz-root {
  width: 100%;
}

.quiz-card {
  max-width: 480px;
  margin-inline: auto;
  padding: var(--space-5, 1.5rem);
  display: flex;
  flex-direction: column;
  gap: var(--space-4, 1rem);
}

/* Landing */
.quiz-landing {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4, 1rem);
  padding-block: var(--space-6, 2rem);
}

.quiz-landing__icon {
  font-size: 3rem;
  line-height: 1;
}

.quiz-landing h2 {
  font-size: clamp(1.375rem, 1.1rem + 1.2vw, 1.85rem);
  color: var(--color-heading, #0f1728);
  line-height: 1.2;
}

.quiz-landing p {
  color: var(--color-text-muted, #4b5a71);
  max-width: 34ch;
}

/* Progress bar */
.quiz-progress {
  display: flex;
  flex-direction: column;
  gap: var(--space-2, 0.5rem);
}

.quiz-progress__label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-muted, #4b5a71);
  letter-spacing: 0.03em;
}

.quiz-progress__bar {
  height: 6px;
  background: var(--color-surface-strong, #d9e5f2);
  border-radius: 99px;
  overflow: hidden;
}

.quiz-progress__fill {
  height: 100%;
  background: var(--color-accent, #0d5bd7);
  border-radius: 99px;
  transition: width 300ms ease;
}

/* Question */
.quiz-question {
  display: flex;
  flex-direction: column;
  gap: var(--space-4, 1rem);
}

.quiz-prompt {
  font-size: clamp(1.125rem, 1.02rem + 0.5vw, 1.35rem);
  font-weight: 600;
  color: var(--color-heading, #0f1728);
  line-height: 1.35;
}

.quiz-mode-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.5rem;
  background: var(--color-surface-muted, #eef3f8);
  border-radius: var(--radius-sm, 0.375rem);
  color: var(--color-text-muted, #4b5a71);
}

.quiz-answers {
  display: flex;
  flex-direction: column;
  gap: var(--space-2, 0.5rem);
}

/* Answer buttons */
.quiz-btn {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 56px;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  text-align: left;
  border: 2px solid var(--color-border, #c9d4e3);
  border-radius: var(--radius-md, 0.75rem);
  background: var(--color-surface, #ffffff);
  color: var(--color-text, #162032);
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease, transform 100ms ease;
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(15,23,40,0.08));
  line-height: 1.3;
}

.quiz-btn:hover:not(:disabled) {
  border-color: var(--color-accent, #0d5bd7);
  background: var(--color-surface-muted, #eef3f8);
  transform: translateY(-1px);
}

.quiz-btn:active:not(:disabled) {
  transform: translateY(0);
}

.quiz-btn:focus-visible {
  outline: 2px solid var(--color-accent, #0d5bd7);
  outline-offset: 2px;
}

.quiz-btn:disabled {
  cursor: default;
  opacity: 0.9;
}

.quiz-btn--correct {
  background: #dcfce7 !important;
  border-color: #2d7a2d !important;
  color: #14532d !important;
  font-weight: 600;
}

.quiz-btn--wrong {
  background: #fee2e2 !important;
  border-color: var(--color-danger, #b91c1c) !important;
  color: #7f1d1d !important;
}

@media (prefers-color-scheme: dark) {
  .quiz-btn--correct {
    background: #14532d !important;
    border-color: #22c55e !important;
    color: #dcfce7 !important;
  }
  .quiz-btn--wrong {
    background: #7f1d1d !important;
    border-color: #f87171 !important;
    color: #fee2e2 !important;
  }
}

/* Score screen */
.quiz-score {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4, 1rem);
  padding-block: var(--space-5, 1.5rem);
}

.quiz-score__number {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  color: var(--color-accent, #0d5bd7);
  line-height: 1;
}

.quiz-score h2 {
  font-size: clamp(1.375rem, 1.1rem + 1.2vw, 1.85rem);
  color: var(--color-heading, #0f1728);
}

.quiz-score p {
  color: var(--color-text-muted, #4b5a71);
}

.quiz-score__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3, 0.75rem);
  justify-content: center;
}

/* Error state */
.quiz-error {
  text-align: center;
  padding-block: var(--space-5, 1.5rem);
  color: var(--color-danger, #b91c1c);
}

/* Next button */
.quiz-next-btn {
  align-self: flex-end;
}

/* Desktop: constrain width */
@media (min-width: 640px) {
  .quiz-card {
    padding: var(--space-6, 2rem);
  }
}

/* Quiz promo card — homepage CTA button (amber) */
.quiz-promo-card .button-primary {
  background: #f59e0b;
  color: #09111f;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(245,158,11,0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.quiz-promo-card .button-primary:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 4px 14px rgba(245,158,11,0.5);
}
.quiz-promo-card .button-primary:active {
  transform: none;
  box-shadow: 0 1px 4px rgba(245,158,11,0.3);
}

/* Proof-point line in quiz promo card */
.quiz-proof-point {
  font-size: 0.875rem;
  color: var(--color-text-muted, #4b5a71);
  letter-spacing: 0.02em;
  margin: 0;
}

/* Post-game replay button — score screen */
.quiz-score__actions #quiz-replay-btn,
.quiz-score__actions .button-primary {
  font-size: 1.15rem;
  padding: 0.85em 2em;
  background: #f59e0b;
  color: #09111f;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(245,158,11,0.35);
}

/* Inline CTA button — land/continent pages */
.quiz-inline-cta .button-primary {
  background: #f59e0b;
  color: #09111f;
  font-weight: 700;
  white-space: nowrap;
}
