* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Nunito', cursive;
  background: linear-gradient(135deg, #fdf2f8 0%, #ede9fe 50%, #dbeafe 100%);
  min-height: 100vh;
}
#app { max-width: 480px; margin: 0 auto; padding: 20px 16px; }

.card { background: white; border-radius: 24px; padding: 20px; box-shadow: 0 8px 24px rgba(0,0,0,0.1); margin-bottom: 16px; }

.header { text-align: center; margin-bottom: 24px; }
.header .star { font-size: 52px; display: block; margin-bottom: 8px; }
.header h1 { font-size: 28px; font-weight: 900; color: #9333ea; }
.header p { color: #6b7280; font-size: 14px; margin-top: 4px; }
.stats { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
.stat-pill { padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: 13px; }
.stat-stars { background: #fef9c3; color: #854d0e; }
.stat-badges { background: #f3e8ff; color: #6b21a8; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.subject-btn {
  border: none; border-radius: 24px; padding: 24px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  cursor: pointer; font-family: 'Nunito', cursive; font-size: 17px;
  font-weight: 900; color: #374151; box-shadow: 0 6px 18px rgba(0,0,0,0.1);
  transition: transform 0.15s, box-shadow 0.15s; width: 100%;
}
.subject-btn:active { transform: scale(0.95); }
.subject-btn .emoji { font-size: 40px; }
.btn-math { background: #dbeafe; }
.btn-french { background: #fce7f3; }
.btn-science { background: #dcfce7; }
.btn-trophy { background: #fef9c3; }

.back-btn { background: white; border: none; border-radius: 14px; padding: 8px 14px; font-size: 22px; cursor: pointer; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }

.module-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.module-title { font-size: 22px; font-weight: 900; }
.module-title.math { color: #2563eb; }
.module-title.french { color: #db2777; }
.module-title.science { color: #16a34a; }
.module-title.trophy { color: #ca8a04; }
.badge-count { margin-left: auto; padding: 4px 12px; border-radius: 999px; font-weight: 700; font-size: 13px; }
.badge-math { background: #dbeafe; color: #1d4ed8; }
.badge-french { background: #fce7f3; color: #9d174d; }
.badge-science { background: #dcfce7; color: #15803d; }

.progress-bar { height: 10px; background: #e5e7eb; border-radius: 999px; margin-bottom: 20px; }
.progress-fill { height: 100%; border-radius: 999px; transition: width 0.4s ease; }
.progress-math { background: #3b82f6; }
.progress-french { background: #ec4899; }
.progress-science { background: #22c55e; }

.question-card { background: white; border-radius: 24px; padding: 28px 20px; text-align: center; box-shadow: 0 8px 24px rgba(0,0,0,0.1); margin-bottom: 20px; }
.question-card p { font-size: 22px; font-weight: 900; color: #1f2937; line-height: 1.4; }

.choices { display: flex; flex-direction: column; gap: 12px; }
.choices.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice-btn {
  border: 2px solid #e5e7eb; border-radius: 18px; padding: 16px 18px;
  background: white; text-align: left; cursor: pointer;
  font-family: 'Nunito', cursive; font-size: 17px; font-weight: 700; color: #374151;
  box-shadow: 0 4px 12px rgba(0,0,0,0.07); transition: transform 0.15s;
}
.choice-btn:hover { transform: scale(1.02); }
.choice-btn.correct { background: #bbf7d0; border-color: #22c55e; }
.choice-btn.wrong { background: #fecaca; border-color: #ef4444; }

.result-screen { text-align: center; padding: 20px; }
.result-emoji { font-size: 72px; display: block; margin-bottom: 16px; }
.result-title { font-size: 26px; font-weight: 900; color: #7c3aed; margin-bottom: 8px; }
.result-score { font-size: 18px; color: #374151; margin-bottom: 8px; }
.category-tabs {
 display: flex; flex-wrap: wrap; gap: 6px;
 }

.primary-btn {
  display: block; width: 100%; padding: 16px; border: none; border-radius: 18px;
.category-tabs  cursor: pointer; color: white; transition: transform 0.15s, opacity 0.15s;
}
.math-category-tabs.btn-purple { background: #8b5cf6; }
.btn-blue { background: #3b82f6; }
.btn-pink { background: #ec4899; }
.btn-green { background: #22c55e; }
.btn-yellow { background: #f59e0b; }

.trophies-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.trophy-card { background: white; border-radius: 18px; padding: 16px; text-align: center; box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.trophy-icon { font-size: 36px; display: block; margin-bottom: 6px; }
.trophy-value { font-size: 28px; font-weight: 900; color: #ca8a04; }
.trophy-label { font-size: 13px; color: #6b7280; }
.badges-list { display: flex; flex-direction: column; gap: 10px; }
.badge-item { background: #faf5ff; border: 2px solid #e9d5ff; border-radius: 14px; padding: 12px 16px; font-weight: 700; color: #374151; }
.empty-msg { color: #9ca3af; text-align: center; padding: 20px; font-size: 15px; }

.parental-lock { text-align: center; }
.pin-input {
  border: 2px solid #e5e7eb; border-radius: 14px; padding: 14px;
  text-align: center; font-size: 28px; font-weight: 900; width: 100%;
  font-family: 'Nunito', cursive; outline: none; letter-spacing: 8px; margin-bottom: 12px;
}
.pin-input:focus { border-color: #8b5cf6; }
.pin-input.error { border-color: #ef4444; }
.error-msg { color: #ef4444; font-size: 14px; margin-bottom: 12px; }
.parent-info { background: #f3f4f6; border-radius: 12px; padding: 16px; font-size: 14px; color: #4b5563; line-height: 1.6; margin-top: 16px; }
.parental-link { display: block; text-align: center; color: #9ca3af; font-size: 13px; text-decoration: underline; cursor: pointer; margin-top: 16px; background: none; border: none; font-family: 'Nunito', cursive; }


/* === BUG #9 FIX: Math category tabs overflow === */
.math-category-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.math-category-tabs button { flex: 0 0 auto; padding: 6px 12px; border: none; border-radius: 20px; background: #dbeafe; color: #1d4ed8; font-family: 'Nunito', cursive; font-size: 13px; font-weight: 700; cursor: pointer; transition: background 0.15s; }
.math-category-tabs button:hover { background: #bfdbfe; }
.math-category-tabs button.active { background: #3b82f6; color: white; }

/* === BUG #10 FIX: Sticker album horizontal scrollbar === */
.sticker-grid { overflow-x: hidden; }
.card { overflow-x: hidden; }

/* ===================== DEVOIRS DU JOUR (TDAH-FRIENDLY) ===================== */

/* Bouton principal Devoirs */
.homework-main-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: linear-gradient(135deg, #9333ea, #7c3aed);
  color: white;
  border: none;
  border-radius: 24px;
  padding: 20px 24px;
  margin-bottom: 16px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(147, 51, 234, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
  font-family: 'Nunito', cursive;
}

.homework-main-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(147, 51, 234, 0.5);
}

.homework-main-btn:active {
  transform: scale(0.98);
}

.homework-btn-content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.homework-btn-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.homework-btn-title {
  font-size: 1.3rem;
  font-weight: 900;
}

.homework-btn-subtitle {
  font-size: 0.85rem;
  opacity: 0.85;
}

.homework-btn-arrow {
  font-size: 1.5rem;
  animation: bounceArrow 1s ease-in-out infinite;
}

@keyframes bounceArrow {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(5px); }
}

/* Section devoirs */
.homework-date-card {
  text-align: center;
  background: linear-gradient(135deg, #f3e8ff, #ede9fe);
  border: 2px solid #d8b4fe;
}

.homework-section {
  border-left: 4px solid #9333ea;
}

.homework-header {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 10px;
  border-radius: 12px;
  transition: background 0.2s;
}

.homework-header:hover {
  background: #f9fafb;
}

.homework-toggle {
  margin-left: auto;
  font-size: 0.9rem;
  color: #6b7280;
}

.homework-content {
  display: none;
  padding: 15px 10px;
  border-top: 1px solid #e5e7eb;
  margin-top: 10px;
}

.homework-text {
  background: #fef9c3;
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 12px;
  font-weight: 600;
  white-space: pre-wrap;
}

.homework-input {
  width: 100%;
  min-height: 100px;
  border: 2px solid #e5e7eb;
  border-radius: 16px;
  padding: 14px;
  font-family: 'Nunito', cursive;
  font-size: 1rem;
  resize: vertical;
  margin-bottom: 12px;
}

.homework-input:focus {
  outline: none;
  border-color: #9333ea;
}

.homework-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 16px;
  font-family: 'Nunito', cursive;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  margin-bottom: 10px;
  transition: transform 0.2s;
}

.homework-btn:active {
  transform: scale(0.95);
}

.homework-btn.math-btn {
  background: #dbeafe;
  color: #1d4ed8;
}

.homework-btn.french-btn {
  background: #fce7f3;
  color: #9d174d;
}

.homework-btn.ai-btn {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

/* Focus Timer (Pomodoro) */
.focus-timer-card {
  background: linear-gradient(135deg, #dcfce7, #bbf7d0);
  border: 2px solid #86efac;
}

.focus-timer-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 15px;
}

.focus-timer-display {
  font-size: 4rem;
  font-weight: 900;
  text-align: center;
  color: #16a34a;
  margin: 20px 0;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.focus-timer-buttons {
  display: flex;
  gap: 10px;
}

.focus-btn {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 16px;
  font-family: 'Nunito', cursive;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s;
}

.focus-btn:active {
  transform: scale(0.95);
}

.focus-btn.start {
  background: #22c55e;
  color: white;
}

.focus-btn.pause {
  background: #f59e0b;
  color: white;
}

.focus-btn.reset {
  background: #e5e7eb;
  color: #374151;
}

/* AI Exercises */
.ai-exercises-card {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border: 2px solid #86efac;
}

.ai-exercise-item {
  background: white;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.ai-exercise-q {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: #1f2937;
}

.ai-exercise-hint {
  font-size: 0.9rem;
  color: #6b7280;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: #fef9c3;
  border-radius: 8px;
}

.ai-exercise-check {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border: none;
  border-radius: 12px;
  font-family: 'Nunito', cursive;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s;
}

.ai-exercise-check:active {
  transform: scale(0.95);
}

/* Motivation Card */
.motivation-card {
  background: linear-gradient(135deg, #fef9c3, #fde68a);
  border: 2px solid #facc15;
  text-align: center;
}

/* Bouton icône */
.btn-icon {
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  width: 44px;
  height: 44px;
  font-size: 1.3rem;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.btn-icon:hover {
  background: #f3f4f6;
  transform: scale(1.1);
}

/* ===================== LEÇONS TDAH/AUTISME ===================== */

/* Bouton Leçons */
.lessons-main-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border: none;
  border-radius: 24px;
  padding: 20px 24px;
  margin-bottom: 16px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
  font-family: 'Nunito', cursive;
}

.lessons-main-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(16, 185, 129, 0.5);
}

.lessons-btn-content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lessons-btn-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.lessons-btn-title {
  font-size: 1.3rem;
  font-weight: 900;
}

.lessons-btn-subtitle {
  font-size: 0.85rem;
  opacity: 0.85;
}

.lessons-btn-arrow {
  font-size: 1.5rem;
  animation: bounceArrow 1s ease-in-out infinite;
}

/* Level selector */
.level-selector-card {
  text-align: center;
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border: 2px solid #86efac;
}

.level-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.level-tab {
  flex: 1;
  padding: 12px;
  border: 2px solid #d1d5db;
  border-radius: 16px;
  background: white;
  font-family: 'Nunito', cursive;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.level-tab.active {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border-color: #059669;
}

.level-description {
  color: #666;
  font-size: 0.9rem;
}

/* Subject selector */
.subject-selector-card {
  background: white;
}

.subject-tabs {
  display: flex;
  gap: 10px;
}

.subject-tab {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 12px;
  font-family: 'Nunito', cursive;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.subject-tab.math {
  background: #dbeafe;
  color: #1d4ed8;
}

.subject-tab.math.active {
  background: #3b82f6;
  color: white;
}

.subject-tab.french {
  background: #fce7f3;
  color: #9d174d;
}

.subject-tab.french.active {
  background: #ec4899;
  color: white;
}

/* Lessons container */
.lessons-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lesson-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: white;
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.lesson-card:hover {
  transform: translateX(5px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.lesson-icon {
  font-size: 2.5rem;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  border-radius: 16px;
}

.lesson-info {
  flex: 1;
}

.lesson-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #1f2937;
  margin-bottom: 6px;
}

.lesson-meta {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}

.lesson-duration, .lesson-type {
  font-size: 0.8rem;
  color: #6b7280;
  background: #f3f4f6;
  padding: 2px 8px;
  border-radius: 8px;
}

.lesson-steps-preview {
  display: flex;
  gap: 4px;
  align-items: center;
}

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d1d5db;
}

.more-dots {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-left: 4px;
}

.lesson-arrow {
  font-size: 1.5rem;
  color: #9ca3af;
}

/* Mascot lessons card */
.mascot-lessons-card {
  background: linear-gradient(135deg, #fef9c3, #fde68a);
  border: 2px solid #facc15;
  text-align: center;
}

.mascot-lessons-anim {
  margin-bottom: 12px;
}

.mascot-anim {
  font-size: 2rem;
  margin: 0 5px;
}

.mascot-anim.squirrel { animation: squirrelBounce 2s ease-in-out infinite; }
.mascot-anim.jelly { animation: jellySwim 1.8s ease-in-out infinite; }
.mascot-anim.seal { animation: sealWiggle 2.2s ease-in-out infinite; }

.mascot-lessons-tip {
  font-style: italic;
  color: #666;
  margin-bottom: 8px;
}

.mascot-lessons-name {
  color: #9333ea;
  font-weight: 700;
}

/* Lesson detail */
.lesson-progress-badge {
  background: #10b981;
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 700;
}

.lesson-progress-bar-container {
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  margin-bottom: 20px;
  overflow: hidden;
}

.lesson-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #059669);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.lesson-steps-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lesson-step {
  display: flex;
  gap: 16px;
  background: white;
  border-radius: 20px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
}

.lesson-step:hover {
  background: #f9fafb;
}

.lesson-step.current {
  border-color: #10b981;
  background: #f0fdf4;
}

.lesson-step.completed {
  opacity: 0.7;
}

.step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: #666;
  flex-shrink: 0;
}

.step-number.done {
  background: #10b981;
  color: white;
}

.step-content {
  flex: 1;
}

.step-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 8px;
}

.step-visual {
  display: none;
  background: #fef9c3;
  padding: 12px;
  border-radius: 12px;
  font-size: 0.95rem;
  line-height: 1.6;
  white-space: pre-wrap;
  margin-bottom: 10px;
}

.step-visual.show {
  display: block;
}

.step-tip {
  font-size: 0.9rem;
  color: #059669;
  font-style: italic;
}

/* Lesson exercises */
.lesson-exercises-card {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border: 2px solid #86efac;
  margin-top: 20px;
}

.lesson-exercise {
  background: white;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
}

.exercise-q {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 12px;
}

.exercise-input-area {
  display: flex;
  gap: 10px;
}

.lesson-answer-input {
  flex: 1;
  padding: 12px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-family: 'Nunito', cursive;
  font-size: 1rem;
}

.lesson-answer-input:focus {
  outline: none;
  border-color: #10b981;
}

.lesson-check-btn {
  padding: 12px 20px;
  background: #10b981;
  color: white;
  border: none;
  border-radius: 12px;
  font-family: 'Nunito', cursive;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s;
}

.lesson-check-btn:active {
  transform: scale(0.95);
}

.exercise-hint {
  margin-top: 10px;
  padding: 8px 12px;
  background: #fef9c3;
  border-radius: 8px;
  color: #92400e;
  font-size: 0.9rem;
}

/* Continue card */
.lesson-continue-card {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  border: 2px solid #93c5fd;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
}

.continue-message {
  display: flex;
  align-items: center;
  gap: 12px;
}

.continue-emoji {
  font-size: 2.5rem;
}

.continue-message p {
  color: #1e40af;
  font-weight: 600;
}

.continue-mascot {
  font-size: 3rem;
}

/* Finish lesson button */
.btn-finish-lesson {
  width: 100%;
  padding: 16px;
  margin-top: 20px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border: none;
  border-radius: 20px;
  font-family: 'Nunito', cursive;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
  transition: transform 0.2s;
}

.btn-finish-lesson:active {
  transform: scale(0.98);
}