/* Học Với Sữa - Styles */
:root {
  --primary: #ff6b9d;
  --primary-light: #ffd6e5;
  --secondary: #6bcfff;
  --secondary-light: #d6f0ff;
  --accent: #ffb84d;
  --success: #6bcf7f;
  --error: #ff7a7a;
  --bg: #fff8f5;
  --card: #ffffff;
  --text: #2c2c2c;
  --text-light: #6c6c6c;
  --border: #ffe0eb;
  --shadow: 0 4px 12px rgba(255, 107, 157, 0.1);
  --radius: 16px;
  --radius-sm: 10px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, "Segoe UI", "Helvetica Neue", "Noto Sans", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  font-size: 16px;
}

/* Topbar */
.topbar {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  padding: 16px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.topbar h1 {
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
}
#nav {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.nav-btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.nav-btn:hover, .nav-btn.active {
  background: white;
  color: var(--primary);
}

/* Main */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
  padding-bottom: 80px;
}
.view {
  display: none;
  animation: fadeIn 0.3s;
}
.view.active {
  display: block;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hero */
.hero {
  text-align: center;
  padding: 20px 0;
}
.hero h2 {
  font-size: 28px;
  margin-bottom: 8px;
  color: var(--primary);
}
.hero p {
  color: var(--text-light);
  font-size: 16px;
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 24px 0;
}
.big-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 20px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow);
  text-align: center;
}
.big-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(255, 107, 157, 0.2);
  border-color: var(--primary);
}
.big-card-icon {
  font-size: 56px;
  margin-bottom: 12px;
}
.big-card-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}
.big-card-sub {
  font-size: 13px;
  color: var(--text-light);
}

.quick-row {
  text-align: center;
  margin-top: 20px;
}
.quick-btn {
  background: linear-gradient(135deg, var(--accent), #ff9a3d);
  color: white;
  border: none;
  border-radius: 25px;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(255, 184, 77, 0.3);
  transition: all 0.2s;
}
.quick-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 184, 77, 0.4);
}

/* Week grid */
.week-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.week-btn {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.week-btn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}
.week-btn .week-num {
  display: block;
  font-size: 22px;
  color: var(--primary);
  margin-bottom: 4px;
}
.week-btn .week-label {
  font-size: 12px;
  color: var(--text-light);
  font-weight: 400;
}

/* Type grid */
.type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.type-btn {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 12px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.type-btn:hover {
  border-color: var(--secondary);
  background: var(--secondary-light);
}
.type-btn .type-count {
  background: var(--secondary);
  color: white;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
}

/* Lesson list */
.lesson-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}
.lesson-item {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.2s;
}
.lesson-item:hover {
  border-color: var(--primary);
  transform: translateX(4px);
}
.lesson-item .lesson-title {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.lesson-item .lesson-meta {
  font-size: 12px;
  color: var(--text-light);
}

/* Practice */
.practice-header {
  margin-bottom: 20px;
}
.progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--success), var(--primary));
  width: 0%;
  transition: width 0.3s;
}
.practice-stats {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text-light);
}
#q-score {
  color: var(--accent);
  font-weight: 600;
}

.question-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  min-height: 200px;
}
.q-instruction {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.6;
}
.q-content {
  font-size: 16px;
  color: var(--text-light);
  margin-bottom: 16px;
  white-space: pre-wrap;
}
.q-image-desc {
  background: var(--bg);
  border-left: 4px solid var(--primary);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 16px;
  font-style: italic;
}

/* Image / SVG */
.q-image {
  background: linear-gradient(135deg, #fafafa, #f0f8ff);
  border: 2px dashed #ccc;
  border-radius: 12px;
  padding: 12px;
  margin: 12px 0;
  text-align: center;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.q-svg {
  max-width: 100%;
  height: auto;
}
.q-img-original {
  max-width: 100%;
  max-height: 600px;
  height: auto;
  width: auto;
  border-radius: 4px;
  cursor: zoom-in;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s;
  background: white;
  display: block;
  object-fit: contain;
  object-position: center;
}
.q-img-original:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.q-img-fallback {
  color: #666;
  font-style: italic;
  font-size: 13px;
  line-height: 1.5;
  max-width: 100%;
  padding: 12px;
}
.q-img-note {
  text-align: center;
  color: #ff6b9d;
  font-size: 13px;
  margin-top: 6px;
  padding: 4px 8px;
  background: #fff3f8;
  border-radius: 6px;
  border: 1px dashed #ffb6cc;
}

/* Question action buttons row */
.q-actions-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.btn-mini {
  background: white;
  border: 1.5px solid var(--border);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-mini:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}
.btn-mini:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* AI Hint Box */
.ai-hint {
  background: linear-gradient(135deg, #fff3cd, #ffeaa7);
  border-left: 4px solid #ffc107;
  border-radius: 8px;
  padding: 12px 16px;
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.6;
  color: #664d03;
}
.ai-hint-content b {
  color: #b8860b;
}

/* Solution box - lời giải từng bước */
.solution-box {
  background: linear-gradient(135deg, #fff5e6 0%, #fff0d4 100%);
  border: 2px solid #ffd6a0;
  border-left: 6px solid #ff9933;
  border-radius: 10px;
  padding: 16px 20px;
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.7;
  color: #5a3a00;
}
.solution-title {
  font-weight: bold;
  color: #cc6600;
  font-size: 1.05em;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #ffd6a0;
}
.solution-step {
  margin-top: 12px;
  margin-bottom: 6px;
  color: #cc6600;
  font-size: 1.02em;
}
.solution-line {
  margin-left: 8px;
  margin-bottom: 3px;
}
.solution-arrow {
  color: #ff9933;
  font-weight: bold;
  margin-right: 4px;
}

/* Image Modal (xem đề gốc) */
.img-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s;
}
.img-modal img {
  max-width: 95%;
  max-height: 95%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
.img-modal-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 36px;
  cursor: pointer;
  font-weight: 300;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  z-index: 1001;
}
.img-modal-close:hover {
  background: rgba(255, 0, 0, 0.5);
}
.q-meta {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.q-diff, .q-type {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 10px;
  font-weight: 600;
}
.q-diff-easy { background: #d6f5dc; color: #1e7e34; }
.q-diff-medium { background: #fff3cd; color: #997404; }
.q-diff-hard { background: #ffd6d6; color: #c0392b; }
.q-type { background: #e8f5ff; color: #0066cc; }

/* Image / SVG */
.q-image {
  background: linear-gradient(135deg, #fafafa, #f0f8ff);
  border: 2px dashed #ccc;
  border-radius: 12px;
  padding: 12px;
  margin: 12px 0;
  text-align: center;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.q-svg {
  max-width: 100%;
  height: auto;
}
.q-img-fallback {
  color: #666;
  font-style: italic;
  font-size: 13px;
  line-height: 1.5;
  max-width: 100%;
}

/* Multiple choice */
.choices {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}
.choice-btn {
  background: white;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 16px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 12px;
}
.choice-btn:hover {
  border-color: var(--secondary);
  background: var(--secondary-light);
}
.choice-btn .choice-letter {
  width: 32px;
  height: 32px;
  background: var(--secondary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}
.choice-btn.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}
.choice-btn.correct {
  border-color: var(--success);
  background: #d6f5dc;
}
.choice-btn.wrong {
  border-color: var(--error);
  background: #ffd6d6;
}
.choice-btn:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

/* Fill in blank */
.fill-input {
  font-size: 24px;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  width: 100%;
  max-width: 200px;
  text-align: center;
  font-weight: 600;
  outline: none;
  transition: border-color 0.2s;
}
.fill-input:focus {
  border-color: var(--primary);
}

/* Buttons */
.practice-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 16px;
}
.btn {
  border: none;
  border-radius: 25px;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 120px;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), #ff8fb1);
  color: white;
  box-shadow: 0 4px 12px rgba(255, 107, 157, 0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 107, 157, 0.4);
}
.btn-secondary {
  background: var(--card);
  color: var(--text);
  border: 2px solid var(--border);
}
.btn-secondary:hover {
  border-color: var(--secondary);
  background: var(--secondary-light);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.hidden {
  display: none !important;
}

/* Feedback */
.feedback.unknown {
  border-left-color: var(--secondary);
}
.feedback-title {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-top: 16px;
  border-left: 4px solid var(--success);
  font-size: 15px;
  animation: fadeIn 0.3s;
}
.feedback.wrong {
  border-left-color: var(--error);
}
.feedback.correct {
  border-left-color: var(--success);
}
.feedback-title {
  font-weight: 700;
  margin-bottom: 4px;
}
.feedback-correct {
  color: var(--success);
}
.feedback-wrong {
  color: var(--error);
}

/* Result */
.result-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  box-shadow: var(--shadow);
}
.result-card h2 {
  font-size: 32px;
  color: var(--primary);
  margin-bottom: 16px;
}
.big-score {
  font-size: 64px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 16px 0;
}
.result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
  flex-wrap: wrap;
}

/* AI Gen */
.ai-form {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 500px;
}
.ai-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  font-size: 14px;
}
.ai-form select, .ai-form input {
  font-size: 16px;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  outline: none;
}
.ai-form select:focus, .ai-form input:focus {
  border-color: var(--primary);
}
.ai-loading {
  text-align: center;
  padding: 20px;
  color: var(--text-light);
  font-size: 14px;
}
.ai-loading::after {
  content: '...';
  animation: dots 1.5s infinite;
}
@keyframes dots {
  0% { content: ''; }
  33% { content: '.'; }
  66% { content: '..'; }
  100% { content: '...'; }
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-num {
  font-size: 36px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 4px;
}
.stat-label {
  font-size: 13px;
  color: var(--text-light);
}

/* Back button */
.back-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 16px;
  cursor: pointer;
  margin-bottom: 12px;
  padding: 4px 0;
}
.back-btn:hover {
  text-decoration: underline;
}

/* Footer */
.footer {
  text-align: center;
  padding: 16px;
  font-size: 12px;
  color: var(--text-light);
}

/* Mobile */
@media (max-width: 600px) {
  .topbar h1 { font-size: 18px; }
  .nav-btn { font-size: 12px; padding: 5px 10px; }
  .hero h2 { font-size: 24px; }
  .big-card-icon { font-size: 48px; }
  .q-instruction { font-size: 16px; }
  .btn { padding: 12px 20px; font-size: 15px; min-width: 100px; }
}

/* Print */
@media print {
  .topbar, .footer, .practice-actions, .feedback, .mascot, .confetti-container { display: none; }
  .question-card { box-shadow: none; border: 1px solid #ccc; }
}

/* ============================================================ */
/* MVP EXTRAS - Confetti, Mascot, Achievements, Quick Start */
/* ============================================================ */

/* Confetti */
.confetti-container {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}
.confetti-piece {
  position: absolute;
  top: -20px;
  border-radius: 2px;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0.5; }
}

/* Mascot Sữa */
.mascot {
  position: fixed;
  bottom: 16px;
  left: 16px;
  width: 88px;
  height: 100px;
  z-index: 800;
  cursor: pointer;
  user-select: none;
  transition: transform 0.3s;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
}
.mascot.idle {
  animation: mascotFloat 3s ease-in-out infinite;
}
@keyframes mascotFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.mascot.bounce {
  animation: mascotBounce 0.6s ease-in-out 2;
}
@keyframes mascotBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-20px) scale(1.1); }
}
.mascot.sad {
  animation: mascotSad 0.6s ease-in-out;
}
@keyframes mascotSad {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-8deg); }
  75% { transform: rotate(8deg); }
}
.mascot.wave {
  animation: mascotWave 0.8s ease-in-out;
}
@keyframes mascotWave {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-15deg) scale(1.05); }
  75% { transform: rotate(15deg) scale(1.05); }
}
.mascot-body {
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.mascot-body svg {
  width: 100%;
  height: 100%;
  display: block;
}
.mascot-bubble {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: white;
  color: #c2185b;
  padding: 8px 14px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 2px solid #ffd6e5;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  margin-bottom: 8px;
}
.mascot-bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-top-color: white;
  filter: drop-shadow(0 2px 0 #ffd6e5);
}
.mascot-bubble.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Achievement popup */
.achievement-popup {
  position: fixed;
  top: 80px;
  right: 20px;
  background: linear-gradient(135deg, #ffd700, #ffb84d);
  color: #5a3a00;
  padding: 12px 18px;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(255, 184, 77, 0.4);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 9500;
  transform: translateX(120%);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 280px;
  border: 2px solid white;
}
.achievement-popup.show {
  transform: translateX(0);
}
.achievement-icon {
  font-size: 36px;
  line-height: 1;
}
.achievement-text {
  font-weight: 600;
}
.achievement-name {
  font-size: 12px;
  opacity: 0.7;
  font-weight: 500;
  margin-bottom: 2px;
}
.achievement-desc {
  font-size: 14px;
  font-weight: 700;
}

/* Quick start button */
.quick-start-btn {
  background: linear-gradient(135deg, #ff6b9d, #ff9ec3);
  color: white;
  border: none;
  border-radius: 25px;
  padding: 16px 32px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(255, 107, 157, 0.4);
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 4px;
}
.quick-start-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 28px rgba(255, 107, 157, 0.5);
}
.quick-start-btn:active {
  transform: translateY(0) scale(0.98);
}
.quick-start-btn.secondary {
  background: linear-gradient(135deg, #6bcfff, #9bd8ff);
  box-shadow: 0 6px 20px rgba(107, 207, 255, 0.4);
}
.quick-start-btn.secondary:hover {
  box-shadow: 0 10px 28px rgba(107, 207, 255, 0.5);
}
.quick-start-btn.tertiary {
  background: linear-gradient(135deg, #ffb84d, #ffd97a);
  box-shadow: 0 6px 20px rgba(255, 184, 77, 0.4);
}
.quick-start-btn.tertiary:hover {
  box-shadow: 0 10px 28px rgba(255, 184, 77, 0.5);
}

.quick-start-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0;
  padding: 0 12px;
}

/* Lesson done marker */
.lesson-done-marker {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--success);
  color: white;
  font-size: 13px;
  line-height: 20px;
  text-align: center;
  margin-right: 6px;
  vertical-align: middle;
  font-weight: 700;
  flex-shrink: 0;
}
.lesson-undone-marker {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #ddd;
  margin-right: 6px;
  vertical-align: middle;
  flex-shrink: 0;
}

/* TTS Read button */
.tts-btn {
  background: linear-gradient(135deg, #6bcfff, #9bd8ff);
  color: white;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 18px;
  cursor: pointer;
  margin-left: 8px;
  vertical-align: middle;
  box-shadow: 0 2px 6px rgba(107, 207, 255, 0.3);
  transition: all 0.2s;
}
.tts-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 10px rgba(107, 207, 255, 0.5);
}
.tts-btn:active {
  transform: scale(0.95);
}
.tts-btn.speaking {
  background: linear-gradient(135deg, #ff7a7a, #ff9b9b);
  animation: ttsPulse 1s infinite;
}
@keyframes ttsPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 122, 122, 0.5); }
  50% { box-shadow: 0 0 0 8px rgba(255, 122, 122, 0); }
}

.q-instruction-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* Audio settings */
.audio-toggle {
  position: fixed;
  bottom: 16px;
  right: 16px;
  background: white;
  border: 2px solid var(--border);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 20px;
  cursor: pointer;
  z-index: 800;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.audio-toggle:hover {
  border-color: var(--primary);
  transform: scale(1.05);
}
.audio-toggle.muted {
  opacity: 0.5;
  filter: grayscale(50%);
}

/* Achievement grid in parent view */
.achievement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.achievement-card {
  background: white;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 8px;
  text-align: center;
  font-size: 12px;
  transition: all 0.2s;
}
.achievement-card.earned {
  background: linear-gradient(135deg, #fff8d4, #fff0a0);
  border-color: #ffb84d;
  box-shadow: 0 2px 8px rgba(255, 184, 77, 0.2);
}
.achievement-card .icon {
  font-size: 32px;
  margin-bottom: 4px;
  filter: grayscale(100%);
  opacity: 0.4;
}
.achievement-card.earned .icon {
  filter: none;
  opacity: 1;
}
.achievement-card .name {
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 2px;
}
.achievement-card .desc {
  color: var(--text-light);
  font-size: 10px;
}

/* Mobile: thu nhỏ mascot */
@media (max-width: 600px) {
  .mascot { width: 64px; height: 76px; bottom: 12px; left: 12px; }
  .mascot-bubble { font-size: 11px; padding: 6px 10px; }
  .achievement-popup { right: 12px; left: 12px; max-width: none; }
  .audio-toggle { width: 40px; height: 40px; font-size: 18px; bottom: 12px; right: 12px; }
  .quick-start-btn { font-size: 16px; padding: 14px 20px; }
}
