/* ═══════════════════════════════════════════════════════════════════
   AURALIS · Quiz Wizard v2.0 — chat.php token system
   ───────────────────────────────────────────────────────────────────
   Neumorphism light + glass dark, без champagne references.
   ═══════════════════════════════════════════════════════════════════ */

.quiz-screen {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-top: 8px;
  animation: fadeInUp 0.5s var(--ease-spring) both;
}

/* ═══════════════════════════════════════════════════════════════════
   TOP ROW · back + question counter + spacer
   ═══════════════════════════════════════════════════════════════════ */

.quiz-top {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 8px;
}

.quiz-back-spacer {
  display: block;
  width: 40px;
  height: 40px;
}

.quiz-progress-text {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════════
   PROGRESS BAR · gradient hue1 → hue2 → hue3
   ═══════════════════════════════════════════════════════════════════ */

.quiz-progress-track {
  height: 6px;
  border-radius: var(--radius-pill);
  overflow: hidden;
}

[data-theme="light"] .quiz-progress-track,
:root:not([data-theme]) .quiz-progress-track {
  background: var(--surface);
  box-shadow: var(--shadow-pressed);
}

[data-theme="dark"] .quiz-progress-track {
  background: hsl(220 25% 4%);
}

.quiz-progress-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg,
    hsl(var(--hue1) 70% 55%),
    hsl(var(--hue2) 70% 55%),
    hsl(var(--hue3) 65% 55%));
  transition: width var(--dur) var(--ease-spring);
}

[data-theme="dark"] .quiz-progress-fill {
  box-shadow: 0 0 12px hsl(var(--hue1) 80% 50% / 0.5);
}

/* ═══════════════════════════════════════════════════════════════════
   QUESTION title
   ═══════════════════════════════════════════════════════════════════ */

.quiz-question {
  font-family: var(--font);
  font-size: 19px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.015em;
  text-align: center;
  color: var(--text);
  margin: 8px 0;
  padding: 0 8px;
}

/* ═══════════════════════════════════════════════════════════════════
   OPTION BUTTONS · 64px min-height (canon ключово действие)
   Neumorphism light / glass dark
   ═══════════════════════════════════════════════════════════════════ */

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.quiz-option {
  width: 100%;
  min-height: 64px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur) var(--ease);
}

[data-theme="light"] .quiz-option,
:root:not([data-theme]) .quiz-option {
  background: var(--surface);
  box-shadow: var(--shadow-card);
  border: none;
}

[data-theme="light"] .quiz-option:active,
:root:not([data-theme]) .quiz-option:active {
  box-shadow: var(--shadow-pressed);
  transform: scale(var(--press));
}

[data-theme="dark"] .quiz-option {
  background: hsl(220 25% 6% / 0.65);
  border: 1px solid hsl(var(--hue2) 12% 20%);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-card-sm);
}

[data-theme="dark"] .quiz-option:active {
  transform: scale(var(--press));
}

.quiz-option-letter {
  flex-shrink: 0;
  width: 28px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.quiz-option-text {
  flex: 1;
  line-height: 1.4;
}

.quiz-option-mark {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  opacity: 0;
  transform: scale(0.6);
  transition:
    opacity var(--dur) var(--ease),
    transform var(--dur) var(--ease-spring);
}

.quiz-option-mark svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* === Selected state === */

.quiz-option.is-selected {
  color: white;
  background: linear-gradient(135deg, hsl(var(--hue1) 70% 55%), hsl(var(--hue2) 65% 55%));
  border: none;
}

[data-theme="light"] .quiz-option.is-selected,
:root:not([data-theme]) .quiz-option.is-selected {
  box-shadow: 0 8px 20px hsl(var(--hue1) 60% 50% / 0.4), inset 0 1px 0 hsl(0 0% 100% / 0.3);
}

[data-theme="dark"] .quiz-option.is-selected {
  box-shadow: 0 8px 24px hsl(var(--hue1) 70% 45% / 0.55), inset 0 1px 0 hsl(0 0% 100% / 0.2);
}

.quiz-option.is-selected .quiz-option-letter {
  color: hsl(0 0% 100% / 0.85);
}

.quiz-option.is-selected .quiz-option-mark {
  opacity: 1;
  transform: scale(1);
}

/* ═══════════════════════════════════════════════════════════════════
   RESULTS · hero
   ═══════════════════════════════════════════════════════════════════ */

.quiz-results-hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
}

.quiz-results-laurel {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-icon);
  background: linear-gradient(135deg, hsl(var(--hue1) 75% 55%), hsl(var(--hue3) 70% 55%));
  box-shadow: 0 6px 20px hsl(var(--hue1) 70% 45% / 0.45);
  color: white;
}

.quiz-results-laurel svg {
  width: 28px;
  height: 28px;
  stroke: currentColor;
  fill: currentColor;
  stroke-width: 1.5;
}

.quiz-results-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  color: var(--text-muted);
  margin: 0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.quiz-results-title {
  font-family: var(--font);
  font-size: 22px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0;
}

.quiz-results-description {
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

/* ═══════════════════════════════════════════════════════════════════
   DI CARD (.glass)
   ═══════════════════════════════════════════════════════════════════ */

.quiz-di-card {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-di-card > * { position: relative; z-index: 5; }

.quiz-di-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.quiz-di-eyebrow {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 4px 0;
}

.quiz-di-score {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.quiz-di-num {
  font-family: var(--font);
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1;
}

.quiz-di-max {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.quiz-di-tag {
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* DI tag цветове — приемане, не страх (БЕЗ червено) */
[data-theme="light"] .quiz-di-tag--low,
:root:not([data-theme]) .quiz-di-tag--low {
  background: var(--surface);
  box-shadow: var(--shadow-card-sm);
  color: var(--text-muted);
}

[data-theme="dark"] .quiz-di-tag--low {
  background: hsl(220 25% 8%);
  color: var(--text-muted);
}

[data-theme="light"] .quiz-di-tag--medium,
:root:not([data-theme]) .quiz-di-tag--medium {
  background: oklch(0.92 0.08 70 / 0.6);
  color: hsl(38 80% 35%);
}

[data-theme="dark"] .quiz-di-tag--medium {
  background: hsl(38 50% 12%);
  color: hsl(38 90% 65%);
}

[data-theme="light"] .quiz-di-tag--high,
:root:not([data-theme]) .quiz-di-tag--high {
  background: oklch(0.92 0.08 285 / 0.6);
  color: hsl(var(--hue1) 60% 40%);
}

[data-theme="dark"] .quiz-di-tag--high {
  background: hsl(var(--hue1) 50% 14%);
  color: hsl(var(--hue1) 80% 70%);
}

.quiz-di-bar {
  height: 8px;
  border-radius: var(--radius-pill);
  overflow: hidden;
}

[data-theme="light"] .quiz-di-bar,
:root:not([data-theme]) .quiz-di-bar {
  background: var(--surface);
  box-shadow: var(--shadow-pressed);
}

[data-theme="dark"] .quiz-di-bar {
  background: hsl(220 25% 4%);
}

.quiz-di-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg,
    var(--text-muted),
    hsl(38 80% 55%),
    hsl(var(--hue1) 70% 55%));
  transition: width 0.6s var(--ease-spring);
}

.quiz-di-intensity {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.5;
  margin: 0;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}

[data-theme="light"] .quiz-di-intensity,
:root:not([data-theme]) .quiz-di-intensity {
  border-top: 1px solid hsl(220 18% 80%);
}

.quiz-di-intensity strong {
  font-weight: 800;
  color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════════════
   RECOMMENDED MIXES
   ═══════════════════════════════════════════════════════════════════ */

.quiz-mixes {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-mixes-title {
  font-family: var(--font);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.005em;
  color: var(--text);
  margin: 0;
}

.quiz-mixes-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}

@media (min-width: 420px) {
  .quiz-mixes-list { grid-template-columns: 1fr 1fr; }
}

.quiz-mix-card {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: transform var(--dur-fast) var(--ease);
}

[data-theme="light"] .quiz-mix-card,
:root:not([data-theme]) .quiz-mix-card {
  background: var(--surface);
  box-shadow: var(--shadow-card-sm);
}

[data-theme="dark"] .quiz-mix-card {
  background: hsl(220 25% 6% / 0.6);
  border: 1px solid hsl(var(--hue2) 12% 18%);
}

.quiz-mix-card:hover { transform: translateY(-2px); }

.quiz-mix-label {
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.005em;
}

.quiz-mix-code {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* ═══════════════════════════════════════════════════════════════════
   Disclaimer + actions
   ═══════════════════════════════════════════════════════════════════ */

.quiz-results-disclaimer {
  font-size: 12px;
  color: var(--text-faint);
  font-style: italic;
  text-align: center;
  line-height: 1.5;
  margin: 0;
}

.quiz-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════════════
   AA3: QUIZ PROGRESS + QUESTION ANIMATIONS
   ═══════════════════════════════════════════════════════════════════ */

/* Progress bar champagne gradient + pulse */
.quiz-progress-fill {
  background: linear-gradient(90deg, hsl(38 60% 40%), hsl(38 80% 55%));
  transition: width 0.4s var(--ease);
}
.quiz-progress-fill.is-advancing {
  animation: qzProgressPulse 0.4s ease;
}
@keyframes qzProgressPulse {
  0%, 100% { transform: scaleY(1); }
  50%      { transform: scaleY(1.4); }
}

/* Question number counter animation */
.quiz-counter {
  transition: transform 0.2s var(--ease);
}
.quiz-counter.is-changing {
  animation: qzCountUp 0.3s ease;
}
@keyframes qzCountUp {
  from { transform: translateY(8px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* Question text fade transition */
.quiz-question-text {
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.quiz-question-text.is-exiting {
  opacity: 0;
  transform: translateY(-6px);
}
.quiz-question-text.is-entering {
  animation: qzQuestionIn 0.2s ease both;
}
@keyframes qzQuestionIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Option cards slide-in from right (stagger) */
.quiz-option {
  animation: qzOptionSlide 0.3s var(--ease) both;
}
.quiz-option:nth-child(1) { animation-delay: 0ms; }
.quiz-option:nth-child(2) { animation-delay: 50ms; }
.quiz-option:nth-child(3) { animation-delay: 100ms; }
.quiz-option:nth-child(4) { animation-delay: 150ms; }
.quiz-option:nth-child(5) { animation-delay: 200ms; }

@keyframes qzOptionSlide {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ═══════════════════════════════════════════════════════════════════
   REDUCED MOTION
   ═══════════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
