/**
 * RhyRhy English - Quiz Component Styles
 * Fill-in-the-blank, Multiple-choice, Listening & fill-in-the-blank
 */
.quiz-section-wrapper {
  margin-top: 24px;
  margin-bottom: 40px;
}

.quiz-card {
  background-color: var(--surface-color);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

/* Header & Progress Track */
.quiz-header {
  margin-bottom: 24px;
}

.quiz-step-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.quiz-badge {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary-light);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.quiz-type-tag {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 10px;
  background-color: var(--bg-color);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-full);
  color: var(--text-muted);
}

.quiz-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 5px 14px;
  background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 50%, #EC4899 100%);
  background-size: 200% 200%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius-full);
  color: #ffffff !important;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(139, 92, 246, 0.35);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  letter-spacing: 0.02em;
  position: relative;
  overflow: hidden;
}

.quiz-share-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transition: left 0.6s ease;
}

.quiz-share-btn:hover::before {
  left: 100%;
}

.quiz-share-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 18px rgba(236, 72, 153, 0.45);
  background-position: 100% 100%;
  color: #ffffff !important;
}

.quiz-share-btn:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.quiz-share-btn.copied {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%) !important;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.45) !important;
  transform: scale(1.04);
}

.quiz-share-btn svg {
  stroke: #ffffff;
  transition: transform 0.25s ease;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}

.quiz-share-btn:hover svg {
  transform: rotate(-12deg) scale(1.15);
}

.quiz-progress-track {
  width: 100%;
  height: 6px;
  background-color: var(--bg-color);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.quiz-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent-emerald));
  border-radius: var(--radius-full);
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Prompt Card */
.quiz-prompt-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  margin-bottom: 24px;
}

.quiz-korean-sentence {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
  word-break: keep-all;
}

/* Sentence Builder Box */
.sentence-builder-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 12px;
  font-size: 1.25rem;
  line-height: 2;
  color: var(--text-main);
  padding: 16px;
  background-color: var(--bg-color);
  border-radius: var(--radius-md);
  border: 1px dashed var(--surface-border);
  margin-bottom: 20px;
  text-align: center;
}

.sentence-text {
  font-weight: 500;
}

/* Blank Input */
.blank-input-wrapper {
  display: inline-block;
  vertical-align: middle;
}

.quiz-input {
  display: inline-block;
  min-width: 140px;
  max-width: 260px;
  height: 44px;
  padding: 4px 14px;
  background-color: var(--surface-color);
  border: 2px solid var(--primary);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 1.15rem;
  font-weight: 600;
  text-align: center;
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-glow);
  transition: all 0.2s ease;
}

.quiz-input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 5px rgba(99, 102, 241, 0.4);
}

.quiz-input.error {
  border-color: var(--accent-rose);
  background-color: rgba(244, 63, 94, 0.1);
  box-shadow: 0 0 0 4px rgba(244, 63, 94, 0.25);
}

[data-theme="light"] .quiz-input.error {
  color: #9F1239;
}

.quiz-input.correct {
  border-color: var(--accent-emerald) !important;
  background-color: rgba(16, 185, 129, 0.1) !important;
  box-shadow: 0 0 0 4px var(--accent-emerald-glow) !important;
  color: #6EE7B7 !important;
}

[data-theme="light"] .quiz-input.correct {
  color: #065F46 !important;
}

.quiz-input.shake {
  animation: shakeAnim 0.4s ease;
}

/* Multiple Choice Grid */
.choice-slot-preview {
  display: inline-block;
  padding: 2px 14px;
  background-color: var(--surface-color);
  border: 2px dashed var(--primary-light);
  border-radius: var(--radius-sm);
  color: var(--primary-light);
  font-weight: 600;
  font-size: 1rem;
}

.choice-slot-preview.filled {
  border-style: solid;
  border-color: var(--accent-emerald);
  color: #6EE7B7;
  background-color: rgba(16, 185, 129, 0.1);
}

[data-theme="light"] .choice-slot-preview.filled {
  color: #065F46;
}

.multiple-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.choice-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  min-height: 52px;
  background-color: var(--bg-color);
  border: 1.5px solid var(--surface-border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.choice-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background-color: rgba(99, 102, 241, 0.08);
  transform: translateY(-2px);
}

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

.choice-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background-color: var(--surface-color-alt);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.choice-btn.correct {
  border-color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.15);
  color: #6EE7B7;
  box-shadow: 0 0 0 2px var(--accent-emerald-glow);
}

[data-theme="light"] .choice-btn.correct {
  color: #065F46;
  background: rgba(16, 185, 129, 0.12);
}

.choice-btn.correct .choice-marker {
  background-color: var(--accent-emerald);
  color: #FFFFFF;
}

/* Deactivate and shake/fade on incorrect choice */
.choice-btn.shake {
  animation: shakeAnim 0.4s ease;
}

.choice-btn.fade-out.disabled {
  opacity: 0.35;
  border-color: rgba(244, 63, 94, 0.4);
  background-color: rgba(244, 63, 94, 0.05);
  text-decoration: line-through;
  cursor: not-allowed;
  pointer-events: none;
  transform: scale(0.97);
}

/* Listening & Speaker Control */
.listening-control-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px;
  margin-bottom: 20px;
}

.speaker-play-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: linear-gradient(135deg, #1E1B4B, #312E81);
  border: 2px solid var(--primary);
  border-radius: var(--radius-full);
  color: #FFFFFF;
  cursor: pointer;
  box-shadow: 0 4px 16px var(--primary-glow);
  transition: all 0.2s ease;
}

[data-theme="light"] .speaker-play-btn {
  background: linear-gradient(135deg, #4F46E5, #4338CA);
  color: #FFFFFF;
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.25);
}

.speaker-play-btn:hover {
  transform: scale(1.04);
  box-shadow: 0 6px 24px rgba(99, 102, 241, 0.4);
}

.speaker-play-btn.playing {
  border-color: var(--accent-emerald);
  box-shadow: 0 0 24px var(--accent-emerald-glow);
}

.speaker-btn-text {
  font-size: 1rem;
  font-weight: 700;
}

.audio-waves {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 20px;
}

.wave-bar {
  width: 3.5px;
  height: 8px;
  background-color: var(--accent-emerald);
  border-radius: 2px;
  transition: height 0.2s ease;
}

.speaker-play-btn.playing .wave-bar:nth-child(1) {
  animation: waveAnim 0.6s infinite alternate;
}

.speaker-play-btn.playing .wave-bar:nth-child(2) {
  animation: waveAnim 0.6s 0.2s infinite alternate;
}

.speaker-play-btn.playing .wave-bar:nth-child(3) {
  animation: waveAnim 0.6s 0.4s infinite alternate;
}

@keyframes waveAnim {
  0% {
    height: 6px;
  }

  100% {
    height: 20px;
  }
}

.listening-instructions {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-top: 10px;
  text-align: center;
}

/* ==========================================================================
   Drag-and-Drop / Word Reorder Quiz Styles
   ========================================================================== */
.word-drop-zone,
.word-slots-container {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 6px 10px;
  background-color: rgba(99, 102, 241, 0.04);
  border: 1.5px solid transparent;
  border-radius: var(--radius-lg);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  vertical-align: middle;
  margin: 6px 4px;
}

[data-theme="light"] .word-drop-zone,
[data-theme="light"] .word-slots-container {
  background-color: rgba(99, 102, 241, 0.03);
}

.sentence-drag-preview {
  display: none !important;
}

.sentence-before {
  order: 1;
}

.word-slots-container.word-drop-zone {
  order: 2;
}

.sentence-after {
  order: 3;
}

/* Individual blank slot for each section of the sentence - Underbar style */
.word-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  min-height: 44px;
  padding: 2px 8px;
  background-color: rgba(99, 102, 241, 0.08);
  border: none;
  border-bottom: 3px solid var(--primary);
  border-radius: 6px 6px 0 0;
  position: relative;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
  cursor: pointer;
  vertical-align: middle;
  margin: 3px 4px;
}

[data-theme="light"] .word-slot {
  background-color: rgba(99, 102, 241, 0.06);
  border-bottom-color: var(--primary);
}

.word-slot:hover:not(.filled) {
  background-color: rgba(99, 102, 241, 0.14);
  border-bottom-color: var(--primary-light);
}

.word-slot.drag-over {
  border-bottom-color: var(--accent-amber);
  background-color: rgba(245, 158, 11, 0.15);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
  transform: translateY(-2px);
}

.word-slot.filled {
  border-bottom-color: transparent;
  background-color: transparent;
  box-shadow: none;
  padding: 0;
}

.word-slot.correct,
.word-drop-zone.correct {
  border-bottom-color: var(--accent-emerald) !important;
  background-color: rgba(16, 185, 129, 0.12);
}

.word-slot.error,
.word-drop-zone.error {
  border-bottom-color: var(--accent-rose) !important;
  background-color: rgba(244, 63, 94, 0.1);
}

.word-slot.shake,
.word-drop-zone.shake {
  animation: shakeAnim 0.4s ease;
}

.word-slot-placeholder {
  display: none !important;
}

.word-drop-placeholder {
  font-size: 0.92rem;
  color: var(--text-muted);
  font-weight: 500;
  pointer-events: none;
  user-select: none;
  padding: 4px 8px;
}

.word-bank-wrapper {
  margin-top: 18px;
  margin-bottom: 22px;
}

.word-bank-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 0 4px;
}

.word-bank-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.45;
  word-break: keep-all;
}

.word-reset-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  background-color: transparent;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  cursor: pointer;
  white-space: nowrap;
  word-break: keep-all;
  flex-shrink: 0;
  min-width: max-content;
  line-height: 1;
  transition: all 0.2s ease;
}

.word-reset-btn span {
  white-space: nowrap;
  word-break: keep-all;
  display: inline-block;
}

.word-reset-btn svg {
  flex-shrink: 0;
}

.word-reset-btn:hover {
  color: var(--text-main);
  border-color: var(--primary-light);
  background-color: rgba(99, 102, 241, 0.08);
}

.word-bank-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 14px 16px;
  background-color: var(--bg-color);
  border: 1.5px solid var(--surface-border);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.word-bank-grid.drag-over {
  border-color: var(--accent-amber);
  background-color: rgba(245, 158, 11, 0.06);
}

.drag-word-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  background-color: var(--surface-color);
  border: 1.5px solid var(--surface-border);
  border-radius: var(--radius-full);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: grab;
  user-select: none;
  touch-action: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.drag-word-chip:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--primary-light);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.drag-word-chip:active:not(:disabled) {
  cursor: grabbing;
  transform: scale(0.97);
}

.drag-word-chip .drag-handle {
  font-size: 0.85rem;
  color: var(--text-muted);
  opacity: 0.55;
  pointer-events: none;
}

.drag-word-chip.dragging {
  opacity: 0.35;
  transform: scale(0.94);
}

.drag-word-chip.placed {
  border-color: var(--primary);
  background-color: rgba(99, 102, 241, 0.15);
  color: #A5B4FC;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

[data-theme="light"] .drag-word-chip.placed {
  color: #4338CA;
  background-color: #EEF2FF;
  border-color: #6366F1;
}

.drag-touch-ghost {
  position: fixed;
  pointer-events: none;
  z-index: 99999;
  transform: translate(-50%, -50%) scale(1.08);
  opacity: 0.92;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
  background-color: var(--surface-color);
  border: 2px solid var(--primary-light);
  border-radius: var(--radius-full);
  padding: 10px 20px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Hints & Feedback */
.quiz-hint-box {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  margin-bottom: 20px;
  animation: fadeIn 0.3s ease;
}

.hint-content {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 1.05rem;
}

.hint-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-amber);
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}

/* Container for all words with distinct separation between words */
.hint-words-container {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  /* Distinct visual space between words */
}

/* Individual word pill - groups letters of a single word together */
.hint-word {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  /* Tight, unified spacing between letters within the same word */
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.28);
  padding: 4px 10px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  white-space: nowrap;
}

/* Individual character in a hint */
.hint-char {
  font-family: 'SF Mono', 'Courier New', Courier, monospace;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
  display: inline-block;
  text-align: center;
}

/* Revealed clue letter(s) */
.hint-char.revealed {
  color: #FEF08A;
  /* Bright warm amber-gold */
  letter-spacing: 0.03em;
}

/* Missing character placeholder */
.hint-char.blank {
  color: #94A3B8;
  /* Slate gray, clean and clearly countable */
  font-weight: 900;
  min-width: 12px;
}

/* Punctuation or symbols (hyphen, apostrophe, exclamation) */
.hint-char.symbol,
.hint-char.punct {
  color: #CBD5E1;
  font-weight: 700;
}

/* Fallback if plain text hint is rendered */
.hint-letters {
  font-family: 'SF Mono', 'Courier New', Courier, monospace;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: #FEF3C7;
  word-spacing: 0.8em;
}

/* Light Mode Hint Styling - High Contrast & Maximum Legibility (Issue #25) */
[data-theme="light"] .quiz-hint-box {
  background: #FEF3C7;
  border: 1px solid #FCD34D;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.08);
}

[data-theme="light"] .hint-label {
  color: #92400E;
  font-weight: 800;
}

[data-theme="light"] .hint-word {
  background: #FFFFFF;
  border: 1.5px solid #FCD34D;
  box-shadow: 0 1px 4px rgba(180, 83, 9, 0.12);
}

[data-theme="light"] .hint-char.revealed {
  color: #92400E;
  font-weight: 800;
}

[data-theme="light"] .hint-char.blank {
  color: #334155;
  font-weight: 900;
}

[data-theme="light"] .hint-char.symbol,
[data-theme="light"] .hint-char.punct {
  color: #1E293B;
  font-weight: 800;
}

[data-theme="light"] .hint-letters {
  color: #92400E;
  font-weight: 800;
}

[data-theme="light"] .sub-hint-text {
  color: #475569;
}

.quiz-feedback {
  min-height: 28px;
  margin-bottom: 16px;
}

.feedback-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  animation: fadeIn 0.25s ease;
}

.feedback-status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1rem;
}

.feedback-explanation-box {
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-top: 4px;
  border-left: 3px solid currentColor;
}

.explanation-title {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.9;
  margin-bottom: 4px;
}

.explanation-text {
  font-size: 0.92rem;
  line-height: 1.5;
  margin: 0;
  color: #F8FAFC;
  word-break: keep-all;
}

[data-theme="light"] .explanation-text {
  color: var(--text-main);
}

.btn-next-question {
  width: 100%;
  padding: 14px 24px;
  font-size: 1.05rem;
  font-weight: 700;
  justify-content: center;
  background: linear-gradient(135deg, #4F46E5, #4338CA);
  box-shadow: 0 4px 20px var(--primary-glow);
  animation: pulseNextBtn 2s infinite ease-in-out;
}

@keyframes pulseNextBtn {

  0%,
  100% {
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
  }

  50% {
    box-shadow: 0 6px 26px rgba(99, 102, 241, 0.65);
  }
}

.quiz-feedback.success .feedback-inner {
  background-color: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6EE7B7;
}

[data-theme="light"] .quiz-feedback.success .feedback-inner {
  color: #065F46;
  background-color: rgba(16, 185, 129, 0.12);
}

.quiz-feedback.error .feedback-inner {
  background-color: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #FDA4AF;
}

[data-theme="light"] .quiz-feedback.error .feedback-inner {
  color: #9F1239;
  background-color: rgba(244, 63, 94, 0.1);
}

.quiz-feedback.skip-info .feedback-inner {
  background-color: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #C7D2FE;
}

[data-theme="light"] .quiz-feedback.skip-info .feedback-inner {
  color: #3730A3;
  background-color: rgba(99, 102, 241, 0.1);
}

/* Actions Row */
.quiz-actions {
  border-top: 1px solid var(--surface-border);
  padding-top: 18px;
}

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

.actions-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sub-hint-text {
  font-size: 0.88rem;
  color: var(--text-subtle);
  font-style: italic;
}

/* Completed Card */
.quiz-completed-card {
  text-align: center;
  padding: 40px 24px;
}

.quiz-completed-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.12);
  border: 2px solid rgba(16, 185, 129, 0.3);
  margin-bottom: 20px;
}

.quiz-completed-title {
  font-size: 1.6rem;
  margin-bottom: 12px;
}

.quiz-completed-desc {
  font-size: 1rem;
  max-width: 540px;
  margin: 0 auto 28px;
  line-height: 1.6;
}

.quiz-completed-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.btn-jump-video {
  padding: 12px 28px;
  font-size: 1.05rem;
}

/* Quiz Score Summary Card */
.quiz-score-summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 520px;
  margin: 0 auto 28px;
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.quiz-score-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
}

.quiz-score-number {
  font-size: 2.75rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #10B981, #6366F1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
}

.quiz-score-sublabel {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 6px;
}

.quiz-score-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
}

.quiz-score-stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--surface-border);
}

.quiz-score-stat-box.correct {
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.08);
}

.quiz-score-stat-box.wrong {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.08);
}

.quiz-score-stat-box.rate {
  border-color: rgba(99, 102, 241, 0.3);
  background: rgba(99, 102, 241, 0.08);
}

.stat-box-num {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
}

.quiz-score-stat-box.correct .stat-box-num {
  color: #10B981;
}

.quiz-score-stat-box.wrong .stat-box-num {
  color: #EF4444;
}

.quiz-score-stat-box.rate .stat-box-num {
  color: #818CF8;
}

.stat-box-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 4px;
}

.btn-replay-quiz {
  padding: 15px 32px;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: var(--radius-lg);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 18px rgba(79, 70, 229, 0.4);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-replay-quiz:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.55);
}

.btn-replay-quiz svg {
  transition: transform 0.35s ease;
}

.btn-replay-quiz:hover svg {
  transform: rotate(-90deg);
}

.btn-step2-secondary {
  padding: 14px 26px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--radius-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(99, 102, 241, 0.12);
  border: 1.5px solid rgba(99, 102, 241, 0.45);
  color: #A5B4FC;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.btn-step2-secondary:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: #818CF8;
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.25);
}

[data-theme="light"] .btn-step2-secondary {
  color: var(--primary);
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.35);
}

[data-theme="light"] .btn-step2-secondary:hover {
  background: rgba(99, 102, 241, 0.16);
  color: var(--primary-hover);
}

.btn-step2-secondary:active {
  transform: translateY(0);
}

.btn-goto-step2 {
  padding: 14px 26px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--radius-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #4F46E5, #7C3AED);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.35);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.btn-goto-step2:hover {
  background: linear-gradient(135deg, #6366F1, #8B5CF6);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.5);
  color: #FFFFFF;
}

.btn-goto-step2:active {
  transform: translateY(0);
}

/* Floating Bottom Quick-Jump Dock */
.bottom-video-cta-dock {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  max-width: calc(100vw - 32px);
  animation: slideUpFade 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-bottom-video-jump {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 28px;
  background: linear-gradient(135deg, #4F46E5, #7C3AED);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  color: #FFFFFF;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(79, 70, 229, 0.55), 0 2px 8px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.btn-bottom-video-jump:hover {
  transform: scale(1.04) translateY(-2px);
  box-shadow: 0 12px 36px rgba(79, 70, 229, 0.7);
  background: linear-gradient(135deg, #6366F1, #8B5CF6);
}

.btn-bottom-video-jump:active {
  transform: scale(0.98);
}

.pulse-play-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  font-size: 0.75rem;
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translate(-50%, 20px);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@media (max-width: 640px) {
  .quiz-card {
    padding: 18px 14px;
  }

  .quiz-korean-sentence {
    font-size: 1.2rem;
  }

  .sentence-builder-box {
    font-size: 1.05rem;
  }

  .quiz-input {
    min-width: 110px;
    font-size: 1rem;
    height: 40px;
  }

  .actions-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "hint hint"
      "skip check";
    gap: 10px;
    width: 100%;
  }

  .actions-left,
  .actions-right {
    display: contents;
  }

  .btn-hint {
    grid-area: hint;
    width: 100%;
    justify-content: center;
  }

  .btn-skip {
    grid-area: skip;
    width: 100%;
    justify-content: center;
  }

  .btn-check {
    grid-area: check;
    width: 100%;
    justify-content: center;
  }

  .btn-next-question,
  .actions-next-step .btn,
  .sub-hint-text {
    grid-column: 1 / -1;
    width: 100%;
  }

  .sentence-builder-box,
  .standalone-cloze-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
  }

  .sentence-before {
    order: 1;
  }

  .sentence-drag-preview {
    display: inline !important;
    order: 2;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: var(--primary-light);
    font-weight: 700;
    margin: 0 4px;
    letter-spacing: 0.5px;
  }

  [data-theme="light"] .sentence-drag-preview {
    color: var(--primary);
  }

  .sentence-after {
    order: 3;
  }

  /* On mobile: word-drop-zone is where clients interact below the strings */
  .word-slots-container.word-drop-zone {
    order: 10;
    width: 100%;
    margin-top: 14px;
    padding: 10px 6px 4px;
    border-top: 1px dashed var(--surface-border);
    background-color: transparent;
    gap: 6px;
  }

  .word-slot {
    min-width: 60px;
    min-height: 40px;
    margin: 2px 2px;
    border-bottom-width: 2.5px;
  }

  .btn-bottom-video-jump {
    padding: 12px 20px;
    font-size: 0.92rem;
    gap: 8px;
  }

  .quiz-hint-box {
    padding: 10px 14px;
    margin-bottom: 16px;
  }

  .hint-content {
    gap: 8px 10px;
  }

  .hint-words-container {
    gap: 10px;
  }

  .hint-word {
    padding: 3px 8px;
    gap: 3px;
    border-radius: 6px;
  }

  .hint-char {
    font-size: 1.05rem;
  }

  .hint-char.blank {
    min-width: 10px;
  }

  .word-bank-header {
    gap: 8px;
    align-items: center;
  }

  .word-bank-title {
    font-size: 0.82rem;
    line-height: 1.35;
  }

  .word-reset-btn {
    font-size: 0.78rem;
    padding: 5px 10px;
    gap: 4px;
    white-space: nowrap;
    word-break: keep-all;
    flex-shrink: 0;
    min-width: max-content;
  }

  .word-reset-btn span {
    white-space: nowrap;
    word-break: keep-all;
  }
}

/* ==========================================================================
   Desktop / Bigger Screen Typography Enhancement (Step 1: Quizzes)
   Optimized for senior readability and larger monitors (>= 769px)
   ========================================================================== */
@media (min-width: 769px) {
  .quiz-korean-sentence {
    font-size: 1.55rem;
    line-height: 1.45;
  }

  .sentence-builder-box {
    font-size: 1.38rem;
    line-height: 2.1;
    padding: 20px 24px;
  }

  .quiz-input {
    font-size: 1.25rem;
    min-width: 150px;
    height: 48px;
  }

  .choice-text {
    font-size: 1.16rem;
  }

  .choice-kr-hint {
    font-size: 0.96rem;
  }

  .quiz-choice-btn {
    padding: 16px 20px;
  }

  .quiz-instruction {
    font-size: 1.15rem;
  }

  .quiz-correct-sentence {
    font-size: 1.25rem;
  }

  .explanation-text {
    font-size: 1.05rem;
    line-height: 1.6;
  }

  .audio-cloze-hint-text {
    font-size: 1.05rem;
  }
}