/* ==========================================================================
   ENGLISH QUEST ENGINE - DUOLINGO & APOLLO GAMIFIED LEARNING STYLES
   ========================================================================== */

/* Top HUD Bar */
.quest-hud-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(243, 244, 246, 0.95));
  backdrop-filter: blur(12px);
  border: 1.5px solid #E5E7EB;
  border-radius: 20px;
  padding: 0.65rem 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hud-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 1rem;
}

.hud-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.flame-anim {
  animation: flameFlicker 1.8s infinite ease-in-out;
}

@keyframes flameFlicker {
  0%, 100% { transform: scale(1) rotate(-2deg); }
  50% { transform: scale(1.15) rotate(3deg); }
}

.hud-streak .hud-value {
  color: #F97316;
}

.hud-gems .hud-value {
  color: #06B6D4;
}

.hud-hearts .hearts-row {
  display: flex;
  gap: 3px;
  align-items: center;
}

.hud-heart {
  font-size: 1.15rem;
  transition: transform 0.2s;
}

.hud-heart.active {
  animation: heartPulse 2.5s infinite ease-in-out;
}

@keyframes heartPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

.refill-btn {
  background: #EF4444;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 0.7rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: 4px;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
  transition: transform 0.15s;
}

.refill-btn:hover {
  transform: scale(1.18);
}

.xp-progress-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.xp-bar-bg {
  width: 90px;
  height: 12px;
  background: #E5E7EB;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #F59E0B, #10B981);
  border-radius: 999px;
  transition: width 0.4s ease-out;
}

.xp-text {
  font-size: 0.8rem;
  color: #4B5563;
}

/* Duolingo Winding Quest Map */
.quest-map-scroll {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 650px;
  margin: 0 auto;
  padding-bottom: 3rem;
}

.quest-unit-card {
  background: #ffffff;
  border: 2px solid #E5E7EB;
  border-radius: 28px;
  padding: 1.5rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s;
}

.quest-unit-card.unit-locked {
  opacity: 0.65;
  filter: grayscale(0.2);
}

.quest-unit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px dashed #E5E7EB;
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.unit-badge {
  background: #10B981;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  padding: 3px 10px;
  border-radius: 999px;
  text-transform: uppercase;
}

.unit-title {
  margin: 6px 0 2px;
  font-size: 1.35rem;
  font-weight: 800;
  color: #111827;
}

.unit-subtitle {
  margin: 0;
  font-size: 0.9rem;
  color: #6B7280;
}

.unit-crowns {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #FEF3C7;
  border: 1.5px solid #F59E0B;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 800;
  color: #B45309;
}

/* Winding Path Layout */
.quest-path-track {
  display: flex;
  flex-direction: column;
  gap: 2.2rem;
  align-items: center;
  position: relative;
  padding: 1rem 0;
}

.quest-node-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  transition: transform 0.3s;
}

.node-center {
  transform: translateX(0);
}

.node-offset-right {
  transform: translateX(60px);
}

.node-offset-left {
  transform: translateX(-60px);
}

.quest-node-btn {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  box-shadow: 0 8px 0 #059669, 0 12px 20px rgba(16, 185, 129, 0.3);
  background: #10B981;
  color: #fff;
  transition: transform 0.15s, box-shadow 0.15s;
}

.quest-node-btn:active {
  transform: translateY(6px);
  box-shadow: 0 2px 0 #059669, 0 4px 10px rgba(16, 185, 129, 0.3);
}

.quest-node-btn.locked {
  background: #D1D5DB;
  box-shadow: 0 6px 0 #9CA3AF;
  cursor: not-allowed;
}

.quest-node-btn.locked .node-icon {
  filter: grayscale(1);
  opacity: 0.5;
}

.quest-node-btn.pulse-active {
  animation: nodeBouncePulse 1.8s infinite;
  box-shadow: 0 8px 0 #D97706, 0 0 0 10px rgba(245, 158, 11, 0.2);
  background: #F59E0B;
}

@keyframes nodeBouncePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.node-icon {
  font-size: 2rem;
  line-height: 1;
}

.node-stars {
  font-size: 0.75rem;
  position: absolute;
  bottom: -6px;
  background: #ffffff;
  border: 1.5px solid #F59E0B;
  border-radius: 999px;
  padding: 0 6px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.node-active-crown {
  position: absolute;
  top: -24px;
  background: #F59E0B;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 999px;
  letter-spacing: 0.05em;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.node-title-label {
  margin-top: 8px;
  font-size: 0.85rem;
  font-weight: 800;
  color: #374151;
  text-align: center;
}

/* ==========================================================================
   LESSON RUNNER MODAL
   ========================================================================== */
.quest-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(17, 24, 39, 0.7);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.quest-modal-card {
  background: #ffffff;
  width: 100%;
  max-width: 620px;
  border-radius: 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 92vh;
}

.quest-runner-top {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem 0.75rem;
}

.quest-close-btn {
  background: transparent;
  border: none;
  font-size: 1.35rem;
  color: #9CA3AF;
  cursor: pointer;
  font-weight: 900;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, transform 0.15s;
  z-index: 10;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.quest-close-btn:hover {
  background: #F3F4F6;
  color: #111827;
}

.quest-close-btn:active {
  transform: scale(0.92);
}

.quest-progress-track {
  flex: 1;
  height: 16px;
  background: #E5E7EB;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.quest-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10B981, #059669);
  border-radius: 999px;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.quest-runner-hearts {
  display: flex;
  gap: 3px;
}

.quest-runner-body {
  padding: 1rem 1.5rem 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.quest-q-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.quest-q-prompt {
  font-size: 1.15rem;
  font-weight: 800;
  color: #1F2937;
  display: block;
  margin-bottom: 0.75rem;
}

.quest-audio-bubble {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 0.5rem 0;
}

.quest-big-audio-btn {
  background: linear-gradient(135deg, #3B82F6, #2563EB);
  color: #fff;
  border: none;
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.15s;
}

.quest-big-audio-btn:hover {
  transform: scale(1.05);
}

.quest-slow-audio-btn {
  background: #EFF6FF;
  color: #2563EB;
  border: 1.5px solid #BFDBFE;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.quest-ipa-badge {
  display: inline-block;
  background: #F3F4F6;
  color: #4B5563;
  font-family: monospace;
  font-size: 1rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 8px;
  margin-top: 6px;
}

/* Apollo 4-Card Picture Grid */
.quest-apollo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.quest-apollo-card {
  background: #F9FAFB;
  border: 2.5px solid #E5E7EB;
  border-radius: 20px;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 0 #D1D5DB;
}

.quest-apollo-card:hover {
  transform: translateY(-4px);
  border-color: #3B82F6;
  background: #EFF6FF;
}

.quest-apollo-card.selected {
  border-color: #10B981;
  background: #ECFDF5;
  box-shadow: 0 4px 0 #059669, 0 8px 20px rgba(16, 185, 129, 0.25);
  transform: translateY(-2px);
}

.apollo-img-box {
  width: 100%;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.apollo-img-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.apollo-card-label {
  font-size: 1.1rem;
  font-weight: 800;
  color: #111827;
}

.apollo-card-vi {
  font-size: 0.85rem;
  color: #6B7280;
  margin-top: 2px;
}

/* Duolingo Word Bank & Slots */
.quest-sentence-hint {
  font-size: 1.15rem;
  color: #4B5563;
  margin-bottom: 1rem;
}

.quest-sentence-slots {
  min-height: 64px;
  background: #F9FAFB;
  border: 2px dashed #D1D5DB;
  border-radius: 16px;
  padding: 8px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 1.5rem;
}

.slot-placeholder {
  color: #9CA3AF;
  font-size: 0.95rem;
  font-style: italic;
}

.quest-placed-chip {
  background: #10B981;
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 3px 0 #059669;
  transition: transform 0.1s;
}

.quest-placed-chip:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #059669;
}

.quest-word-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  padding: 1rem;
  background: #F3F4F6;
  border-radius: 20px;
}

.quest-chip-btn {
  background: #ffffff;
  border: 2px solid #E5E7EB;
  border-radius: 14px;
  padding: 10px 18px;
  font-size: 1.05rem;
  font-weight: 800;
  color: #1F2937;
  cursor: pointer;
  box-shadow: 0 4px 0 #E5E7EB;
  transition: all 0.15s;
}

.quest-chip-btn:hover {
  border-color: #3B82F6;
  background: #EFF6FF;
}

.quest-chip-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #E5E7EB;
}

.quest-chip-btn.used {
  opacity: 0.3;
  pointer-events: none;
  background: #E5E7EB;
  box-shadow: none;
}

/* Elsa Speaking Practice */
.quest-speaking-hero {
  text-align: center;
  margin-bottom: 1.5rem;
}

.speaking-hero-img {
  width: 140px;
  height: 140px;
  object-fit: contain;
  margin-bottom: 12px;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.12));
}

.speaking-word-title {
  font-size: 2rem;
  font-weight: 900;
  color: #111827;
  letter-spacing: -0.02em;
}

.speaking-word-ipa {
  font-size: 1.15rem;
  color: #6B7280;
  font-family: monospace;
  margin: 4px 0;
}

.speaking-word-vi {
  font-size: 1.05rem;
  color: #10B981;
  font-weight: 700;
}

.speaking-audio-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.quest-audio-pill {
  background: #EFF6FF;
  border: 1.5px solid #BFDBFE;
  color: #2563EB;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
}

.quest-mic-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 1rem 0;
}

.quest-mic-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #EF4444, #DC2626);
  border: none;
  font-size: 2.2rem;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 8px 0 #B91C1C, 0 12px 24px rgba(239, 68, 68, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
}

.quest-mic-circle:active {
  transform: translateY(6px);
  box-shadow: 0 2px 0 #B91C1C;
}

.quest-mic-circle.listening {
  background: linear-gradient(135deg, #10B981, #059669);
  box-shadow: 0 8px 0 #047857, 0 0 0 12px rgba(16, 185, 129, 0.25);
  animation: micListenPulse 1.2s infinite;
}

@keyframes micListenPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.speech-waves {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  margin-top: 12px;
}

.speech-waves span {
  width: 4px;
  height: 100%;
  background: #10B981;
  border-radius: 999px;
  animation: waveAnim 0.8s infinite ease-in-out;
}

.speech-waves span:nth-child(2) { animation-delay: 0.15s; }
.speech-waves span:nth-child(3) { animation-delay: 0.3s; }
.speech-waves span:nth-child(4) { animation-delay: 0.45s; }
.speech-waves span:nth-child(5) { animation-delay: 0.6s; }

@keyframes waveAnim {
  0%, 100% { transform: scaleY(0.3); }
  50% { transform: scaleY(1); }
}

.speech-feedback-box {
  background: #F3F4F6;
  border-radius: 16px;
  padding: 12px;
  margin-top: 12px;
  text-align: center;
}

/* Runner Footer */
.quest-runner-footer {
  padding: 1.25rem 1.5rem;
  border-top: 2px solid #E5E7EB;
  background: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.25s, border-color 0.25s;
}

.quest-runner-footer.footer-correct {
  background: #D1FAE5;
  border-top-color: #10B981;
}

.quest-runner-footer.footer-wrong {
  background: #FEE2E2;
  border-top-color: #EF4444;
}

.feedback-banner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.feedback-icon {
  font-size: 2.2rem;
}

.quest-submit-btn,
.quest-continue-btn {
  background: #10B981;
  color: #fff;
  border: none;
  padding: 14px 28px;
  border-radius: 18px;
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  cursor: pointer;
  box-shadow: 0 5px 0 #059669;
  transition: all 0.15s;
}

.quest-submit-btn:hover,
.quest-continue-btn:hover {
  background: #059669;
}

.quest-submit-btn:active,
.quest-continue-btn:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #059669;
}

.quest-continue-btn.btn-wrong {
  background: #EF4444;
  box-shadow: 0 5px 0 #DC2626;
}

.quest-continue-btn.btn-wrong:hover {
  background: #DC2626;
}

/* Summary Celebration Screen */
.quest-summary-card {
  text-align: center;
  padding: 2.5rem 1.5rem;
}

.summary-mascot {
  font-size: 4rem;
  margin-bottom: 0.5rem;
  animation: mascotCelebrate 1.2s infinite ease-in-out;
}

@keyframes mascotCelebrate {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-10px) rotate(4deg); }
}

.summary-stars {
  font-size: 2.4rem;
  margin: 1rem 0;
  letter-spacing: 4px;
}

.summary-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}

.stat-pill {
  background: #F3F4F6;
  border: 1.5px solid #E5E7EB;
  border-radius: 20px;
  padding: 1rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-icon {
  font-size: 1.6rem;
  margin-bottom: 4px;
}

.stat-val {
  font-size: 1.4rem;
  font-weight: 900;
  color: #111827;
}

.stat-lbl {
  font-size: 0.8rem;
  color: #6B7280;
  font-weight: 700;
}

/* Sổ Tay Từ Khó (Mistakes View) */
.mistakes-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  border: 1.5px solid #E5E7EB;
  border-radius: 20px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  flex-wrap: wrap;
  gap: 1rem;
}

.drill-mistakes-btn {
  background: linear-gradient(135deg, #EF4444, #DC2626);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
  transition: transform 0.15s;
}

.drill-mistakes-btn:hover {
  transform: scale(1.05);
}

.mistakes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.mistake-card {
  background: #ffffff;
  border: 1.5px solid #E5E7EB;
  border-radius: 20px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s, box-shadow 0.2s;
}

.mistake-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.mistake-img-wrap {
  width: 100%;
  height: 120px;
  background: #F9FAFB;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.mistake-img-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.mistake-content {
  flex: 1;
}

.mistake-word {
  font-size: 1.25rem;
  color: #111827;
}

.sound-mini-btn {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.mistake-ipa {
  font-size: 0.9rem;
  color: #6B7280;
  font-family: monospace;
}

.mistake-vi {
  font-size: 0.95rem;
  font-weight: 700;
  color: #10B981;
  margin: 4px 0;
}

.mistake-fail-tag {
  display: inline-block;
  background: #FEE2E2;
  color: #B91C1C;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  margin-top: 4px;
}

.remove-mistake-btn {
  margin-top: 12px;
  background: #F3F4F6;
  border: 1.5px solid #D1D5DB;
  border-radius: 12px;
  padding: 8px;
  font-size: 0.85rem;
  font-weight: 800;
  color: #4B5563;
  cursor: pointer;
  transition: all 0.15s;
}

.remove-mistake-btn:hover {
  background: #D1FAE5;
  border-color: #10B981;
  color: #065F46;
}

.empty-mistakes-box {
  background: #ffffff;
  border: 2px dashed #E5E7EB;
  border-radius: 24px;
  padding: 3rem 1.5rem;
  text-align: center;
}

/* ==========================================================================
   DUOLINGO WINDING SVG ROAD & MASCOT COMPANION
   ========================================================================== */
.quest-path-track {
  position: relative;
  overflow: visible;
}

.quest-winding-svg {
  position: absolute;
  top: 38px;
  left: 50%;
  transform: translateX(-50%);
  width: 320px;
  height: calc(100% - 76px);
  pointer-events: none;
  z-index: 1;
}

.quest-winding-svg path.trail-bg {
  stroke: #E5E7EB;
  stroke-width: 16px;
  stroke-linecap: round;
  fill: none;
}

.quest-winding-svg path.trail-fill {
  stroke: #10B981;
  stroke-width: 12px;
  stroke-linecap: round;
  stroke-dasharray: 8 12;
  animation: trailFlow 20s linear infinite;
  fill: none;
  filter: drop-shadow(0 2px 6px rgba(16, 185, 129, 0.4));
}

@keyframes trailFlow {
  to { stroke-dashoffset: -1000; }
}

.quest-node-wrap {
  position: relative;
  z-index: 2;
}

/* Duo Mascot Companion */
.duo-mascot-companion {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, #ECFDF5, #F0FDF4);
  border: 2px solid #A7F3D0;
  border-radius: 22px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.08);
  position: relative;
}

.mascot-avatar-wrap {
  font-size: 2.8rem;
  line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
  animation: mascotWiggle 3.5s infinite ease-in-out;
  cursor: pointer;
  user-select: none;
}

@keyframes mascotWiggle {
  0%, 100% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(-5deg) scale(1.05); }
  75% { transform: rotate(5deg) scale(1.05); }
}

.mascot-speech-bubble {
  position: relative;
  background: #ffffff;
  border: 1.5px solid #6EE7B7;
  border-radius: 16px;
  padding: 0.65rem 1rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: #065F46;
  flex: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.mascot-speech-bubble::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-right: 8px solid #6EE7B7;
}

/* ==========================================================================
   DUOLINGO GEM & POWER-UP SHOP MODAL
   ========================================================================== */
.shop-open-btn {
  background: linear-gradient(135deg, #06B6D4, #3B82F6);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.35);
  transition: transform 0.15s;
}

.shop-open-btn:hover {
  transform: scale(1.06);
}

.quest-shop-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.65);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.quest-shop-card {
  background: #ffffff;
  border-radius: 28px;
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  padding: 1.75rem;
  position: relative;
  animation: modalPop 0.3s ease-out;
}

.shop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px dashed #E5E7EB;
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
}

.shop-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.shop-title {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 800;
  color: #111827;
}

.shop-user-gems {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #ECFEFF;
  border: 1.5px solid #06B6D4;
  color: #0891B2;
  font-weight: 900;
  font-size: 1.05rem;
  padding: 6px 14px;
  border-radius: 999px;
}

.shop-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.shop-item-card {
  background: #F9FAFB;
  border: 2px solid #E5E7EB;
  border-radius: 20px;
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s, border-color 0.2s;
}

.shop-item-card:hover {
  transform: translateY(-3px);
  border-color: #3B82F6;
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.1);
}

.shop-item-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.shop-item-icon {
  font-size: 2.2rem;
  line-height: 1;
}

.shop-item-name {
  font-weight: 800;
  color: #1F2937;
  font-size: 1.05rem;
  margin: 0 0 4px;
}

.shop-item-desc {
  font-size: 0.82rem;
  color: #6B7280;
  margin: 0;
  line-height: 1.35;
}

.shop-item-bottom {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.shop-price-tag {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 900;
  color: #0891B2;
}

.shop-buy-btn {
  background: #10B981;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 7px 16px;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 3px 0 #059669;
  transition: all 0.15s;
}

.shop-buy-btn:hover {
  background: #059669;
  transform: translateY(-1px);
}

.shop-buy-btn:active {
  transform: translateY(2px);
  box-shadow: none;
}

.shop-buy-btn.equipped {
  background: #6B7280;
  box-shadow: none;
  cursor: default;
}

/* ==========================================================================
   APOLLO ENGLISH PHONICS & DUAL AUDIO RECORDING STUDIO
   ========================================================================== */
.apollo-syllables-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 8px 0;
}

.syllable-chip {
  background: #FEF3C7;
  border: 1.5px solid #F59E0B;
  color: #92400E;
  font-weight: 900;
  font-size: 1rem;
  padding: 4px 10px;
  border-radius: 8px;
  letter-spacing: 0.05em;
}

.apollo-dual-audio {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.apollo-playback-btn {
  background: linear-gradient(135deg, #EC4899, #8B5CF6) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3) !important;
}

/* Elsa Phoneme Alignment */
.phoneme-highlight-row {
  display: flex;
  justify-content: center;
  gap: 3px;
  margin: 10px 0;
  font-size: 1.6rem;
  font-weight: 900;
  font-family: monospace;
}

.phoneme-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 38px;
  border-radius: 8px;
  border: 2px solid transparent;
  transition: transform 0.2s;
}

.phoneme-letter.match {
  background: #D1FAE5;
  color: #065F46;
  border-color: #10B981;
  animation: letterPop 0.3s ease-out;
}

.phoneme-letter.mismatch {
  background: #FEE2E2;
  color: #991B1B;
  border-color: #EF4444;
}

@keyframes letterPop {
  0% { transform: scale(0.7); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* ==========================================================================
   COLOR-CODED GRAMMAR SENTENCE BUILDER (MONTESSORI & DUOLINGO)
   ========================================================================== */
.grammar-subject {
  background: #EFF6FF !important;
  border-color: #3B82F6 !important;
  color: #1D4ED8 !important;
}

.grammar-verb {
  background: #ECFDF5 !important;
  border-color: #10B981 !important;
  color: #047857 !important;
}

.grammar-adj {
  background: #FAF5FF !important;
  border-color: #A855F7 !important;
  color: #6B21A8 !important;
}

.grammar-noun {
  background: #FFF7ED !important;
  border-color: #F97316 !important;
  color: #C2410C !important;
}

.grammar-prep {
  background: #F0FDFA !important;
  border-color: #14B8A6 !important;
  color: #0F766E !important;
}

/* ==========================================================================
   SPACED REPETITION (SM-2 SRS LEITNER SYSTEM) STUDIO
   ========================================================================== */
.srs-studio-container {
  max-width: 720px;
  margin: 0 auto;
  padding-bottom: 3rem;
}

.srs-boxes-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 1.5rem;
}

.srs-box-tab {
  background: #ffffff;
  border: 2px solid #E5E7EB;
  border-radius: 14px;
  padding: 8px 6px;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
}

.srs-box-tab.active-box {
  border-color: #3B82F6;
  background: #EFF6FF;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.srs-box-num {
  font-size: 0.72rem;
  font-weight: 800;
  color: #6B7280;
  text-transform: uppercase;
}

.srs-box-count {
  font-size: 1.25rem;
  font-weight: 900;
  color: #1F2937;
  margin: 2px 0;
}

.srs-box-interval {
  font-size: 0.7rem;
  color: #9CA3AF;
}

.srs-card-stage {
  perspective: 1000px;
  width: 100%;
  max-width: 440px;
  height: 340px;
  margin: 0 auto 1.5rem;
}

.srs-flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
  cursor: pointer;
}

.srs-flip-inner.is-flipped {
  transform: rotateY(180deg);
}

.srs-card-front, .srs-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 26px;
  border: 2px solid #E5E7EB;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.srs-card-back {
  transform: rotateY(180deg);
  background: linear-gradient(135deg, #F9FAFB, #EFF6FF);
  border-color: #BFDBFE;
}

.srs-rating-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  max-width: 440px;
  margin: 0 auto;
}

.srs-rate-btn {
  border: none;
  border-radius: 14px;
  padding: 10px 4px;
  font-weight: 800;
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: transform 0.15s;
}

.srs-rate-btn:hover {
  transform: translateY(-2px);
}

.srs-btn-again { background: #FEE2E2; color: #991B1B; }
.srs-btn-hard { background: #FEF3C7; color: #92400E; }
.srs-btn-good { background: #D1FAE5; color: #065F46; }
.srs-btn-easy { background: #DBEAFE; color: #1E40AF; }

/* ==========================================
   STRUCTURED CURRICULUM HERO & STAGE TABS
   ========================================== */

/* Hero Resume Card */
.duo-hero-resume-card {
  background: linear-gradient(135deg, #10B981, #059669);
  color: #ffffff;
  border-radius: 24px;
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.75rem;
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
}

.duo-hero-resume-card::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 140px;
  height: 140px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  pointer-events: none;
}

.hero-resume-left {
  flex: 1;
  min-width: 260px;
  position: relative;
  z-index: 1;
}

.hero-resume-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 8px;
  backdrop-filter: blur(4px);
}

.hero-resume-title {
  margin: 0 0 6px;
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.hero-resume-step {
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.95;
  font-weight: 600;
}

.hero-resume-btn {
  background: #ffffff;
  color: #065F46;
  border: none;
  border-radius: 18px;
  padding: 14px 24px;
  font-size: 1.05rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 6px 0 #D1FAE5, 0 10px 20px rgba(0, 0, 0, 0.1);
  transition: all 0.15s;
  position: relative;
  z-index: 1;
}

.hero-resume-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 #D1FAE5, 0 12px 24px rgba(0, 0, 0, 0.15);
}

.hero-resume-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #D1FAE5;
}

/* Stage Selector Tabs (7 Stages) */
.quest-stage-tabs {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 6px 4px 16px 4px;
  margin-bottom: 1.75rem;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.stage-tab-btn {
  flex: 0 0 auto;
  min-width: 220px;
  max-width: 280px;
  background: #ffffff;
  border: 2px solid #E5E7EB;
  border-radius: 20px;
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  text-align: left;
}

.unit-stage-badge-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  color: #3b82f6;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 4px 10px;
  border-radius: 12px;
}

.stage-tab-btn:hover {
  border-color: #CBD5E1;
  background: #F8FAFC;
}

.stage-tab-btn.active {
  border-color: #3B82F6;
  background: linear-gradient(135deg, #EFF6FF, #DBEAFE);
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.18);
  transform: translateY(-2px);
}

.stage-tab-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.stage-tab-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: #1E293B;
  margin-bottom: 2px;
}

.stage-tab-sub {
  font-size: 0.75rem;
  color: #64748B;
  font-weight: 600;
}

.unit-warmup-song-btn {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FDE68A;
  border-radius: 12px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

.unit-warmup-song-btn:hover {
  background: #FDE68A;
  transform: translateY(-1px);
}



/* ==========================================================================
   DAILY 15-MINUTE ADVENTURE (CHUYẾN PHIÊU LƯU 15 PHÚT HÔM NAY - ZERO STRESS)
   ========================================================================== */
.daily-adventure-banner {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 45%, #ec4899 100%);
  border-radius: 24px;
  padding: 1.75rem 2rem;
  margin-bottom: 2rem;
  color: #ffffff;
  box-shadow: 0 12px 35px rgba(79, 70, 229, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  position: relative;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.daily-adventure-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.adventure-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.adventure-badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.adventure-streak-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f97316;
  color: #fff;
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 800;
  font-size: 0.9rem;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4);
}

.adventure-main-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.adventure-info-col {
  flex: 1;
  min-width: 280px;
}

.adventure-title {
  font-size: 1.65rem;
  font-weight: 900;
  margin: 0 0 0.5rem 0;
  line-height: 1.25;
  text-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.adventure-desc {
  font-size: 1rem;
  opacity: 0.95;
  margin: 0 0 1.25rem 0;
  line-height: 1.5;
}

/* 4 Adventure Stations Row */
.adventure-stations-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.adventure-station-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px);
  padding: 8px 14px;
  border-radius: 14px;
  font-size: 0.88rem;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.25);
  transition: transform 0.2s, background 0.2s;
}

.adventure-station-pill:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.28);
}

.adventure-station-arrow {
  font-size: 0.9rem;
  opacity: 0.7;
}

/* Big Glowing CTA Button */
.adventure-cta-btn {
  background: #ffffff;
  color: #4f46e5;
  border: none;
  border-radius: 18px;
  padding: 1rem 2rem;
  font-size: 1.15rem;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18), 0 0 20px rgba(255, 255, 255, 0.6);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: ctaGlow 2.5s infinite ease-in-out;
}

.adventure-cta-btn:hover {
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25), 0 0 30px rgba(255, 255, 255, 0.9);
  color: #4338ca;
}

.adventure-cta-btn:active {
  transform: scale(0.98);
}

@keyframes ctaGlow {
  0%, 100% { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18), 0 0 15px rgba(255, 255, 255, 0.5); }
  50% { box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22), 0 0 30px rgba(255, 255, 255, 0.85); }
}

.adventure-mascot-avatar {
  font-size: 5rem;
  line-height: 1;
  animation: mascotBounce 2.8s infinite ease-in-out;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.25));
  user-select: none;
}

@keyframes mascotBounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(4deg); }
}

/* Completed State Card */
.adventure-completed-card {
  background: linear-gradient(135deg, #059669 0%, #10b981 60%, #34d399 100%);
  border-radius: 24px;
  padding: 1.75rem 2rem;
  margin-bottom: 2rem;
  color: #ffffff;
  box-shadow: 0 12px 35px rgba(16, 185, 129, 0.28);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Adventure Interactive Modal */
.adventure-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(10px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.25s ease-out;
}

.adventure-modal-card {
  background: #ffffff;
  border-radius: 28px;
  width: 100%;
  max-width: 820px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.adventure-modal-header {
  padding: 1.25rem 1.75rem;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.adventure-step-indicator {
  display: flex;
  gap: 8px;
  align-items: center;
}

.adventure-step-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transition: all 0.25s;
}

.adventure-step-dot.active {
  background: #fbbf24;
  transform: scale(1.35);
  box-shadow: 0 0 10px #fbbf24;
}

.adventure-step-dot.done {
  background: #10b981;
}

.adventure-close-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.adventure-close-btn:hover {
  background: rgba(255, 255, 255, 0.35);
}

.adventure-modal-body {
  padding: 1.75rem 2rem;
  overflow-y: auto;
  flex: 1;
}

/* Phonics Button */
.phonics-btn {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
  border: 1.5px solid #f59e0b;
  border-radius: 12px;
  padding: 8px 16px;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.15s, box-shadow 0.15s;
}

.phonics-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

/* Sentence Bubble */
.sentence-bubble-card {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 18px;
  padding: 1rem 1.25rem;
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: border-color 0.2s;
}

.sentence-bubble-card:hover {
  border-color: #6366f1;
}

.sentence-text-en {
  font-size: 1.15rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 4px;
}

.sentence-text-vi {
  font-size: 0.9rem;
  color: #64748b;
  font-weight: 600;
}
