/* ============================================================
   Učimo srpski — kid-friendly styles
   Big, colorful, rounded, playful. Designed for tablets.
   ============================================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --bg1: #fff6d5;
  --bg2: #ffd6e8;
  --bg3: #d6f0ff;
  --ink: #3a2e5c;
  --shadow: 0 8px 0 rgba(0, 0, 0, 0.12);
}

html, body {
  height: 100%;
}

body {
  font-family: "Baloo 2", "Comic Sans MS", system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(135deg, var(--bg1), var(--bg2), var(--bg3));
  background-size: 300% 300%;
  animation: bgShift 18s ease infinite;
  min-height: 100vh;
  overflow-x: hidden;
  user-select: none;
}

@keyframes bgShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Floating background shapes */
.bg-shapes {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.bg-shapes span {
  position: absolute;
  font-size: 3rem;
  opacity: 0.35;
  animation: float 9s ease-in-out infinite;
}
.bg-shapes span:nth-child(1) { top: 8%; left: 6%; animation-delay: 0s; }
.bg-shapes span:nth-child(2) { top: 20%; right: 8%; animation-delay: 1.5s; }
.bg-shapes span:nth-child(3) { bottom: 12%; left: 10%; animation-delay: 3s; }
.bg-shapes span:nth-child(4) { bottom: 25%; right: 12%; animation-delay: 4.5s; font-size: 2rem; }
.bg-shapes span:nth-child(5) { top: 45%; left: 45%; animation-delay: 2s; font-size: 2.2rem; }

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

#app {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

/* ---------------- Screens ---------------- */
.screen {
  display: none;
  animation: pop 0.35s ease;
}
.screen.active {
  display: block;
}
@keyframes pop {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

/* ---------------- Home ---------------- */
.app-title {
  text-align: center;
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 800;
  margin-top: 10px;
  text-shadow: 2px 2px 0 #fff;
}
.wave {
  display: inline-block;
  animation: wave 1.6s ease-in-out infinite;
  transform-origin: 70% 70%;
}
@keyframes wave {
  0%, 60%, 100% { transform: rotate(0deg); }
  10% { transform: rotate(18deg); }
  30% { transform: rotate(-8deg); }
}
.app-subtitle {
  text-align: center;
  font-size: 1.1rem;
  opacity: 0.7;
  margin-bottom: 26px;
  font-weight: 500;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}

.category-card {
  border: none;
  border-radius: 28px;
  padding: 22px 12px 18px;
  color: #fff;
  cursor: pointer;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  font-family: inherit;
}
.category-card:active {
  transform: translateY(6px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.12);
}
.category-card .cat-icon {
  font-size: 3.4rem;
  display: block;
  filter: drop-shadow(0 3px 2px rgba(0,0,0,0.2));
}
.category-card .cat-title {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  margin-top: 8px;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.15);
}
.category-card .cat-sub {
  display: block;
  font-size: 0.9rem;
  opacity: 0.9;
  font-weight: 500;
}

/* ---------------- Back button & pills ---------------- */
.back-btn {
  position: relative;
  border: none;
  background: #fff;
  border-radius: 50%;
  width: 58px;
  height: 58px;
  font-size: 1.6rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  margin-bottom: 10px;
  transition: transform 0.12s ease;
}
.back-btn:active { transform: translateY(4px); }

.screen-title {
  text-align: center;
  font-size: 2rem;
  margin: 6px 0 26px;
  text-shadow: 1px 1px 0 #fff;
}

.progress-pill, .stars-pill {
  display: inline-block;
  background: #fff;
  border-radius: 999px;
  padding: 8px 18px;
  font-weight: 700;
  font-size: 1.1rem;
  box-shadow: var(--shadow);
  position: absolute;
  right: 16px;
  top: 20px;
}

/* ---------------- Mode select ---------------- */
.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  max-width: 560px;
  margin: 0 auto;
}
.mode-card {
  border: none;
  background: #fff;
  border-radius: 30px;
  padding: 34px 14px;
  cursor: pointer;
  box-shadow: var(--shadow);
  font-family: inherit;
  color: var(--ink);
  transition: transform 0.12s ease;
}
.mode-card:active { transform: translateY(6px); }
.mode-emoji { font-size: 4rem; display: block; }
.mode-label { display: block; font-size: 1.7rem; font-weight: 800; margin-top: 8px; }
.mode-sub { display: block; font-size: 0.95rem; opacity: 0.6; font-weight: 500; }

/* ---------------- Flashcards ---------------- */
.flashcard {
  position: relative;
  background: #fff;
  border-radius: 40px;
  padding: 40px 24px 48px;
  text-align: center;
  box-shadow: 0 12px 0 rgba(0,0,0,0.12);
  max-width: 520px;
  margin: 20px auto;
  cursor: pointer;
}
.flashcard.tap {
  animation: cardTap 0.4s ease;
}
@keyframes cardTap {
  0% { transform: scale(1); }
  40% { transform: scale(1.05) rotate(-1deg); }
  100% { transform: scale(1); }
}
.flashcard-emoji {
  font-size: clamp(6rem, 26vw, 11rem);
  line-height: 1;
  filter: drop-shadow(0 6px 4px rgba(0,0,0,0.15));
}
.flashcard-word {
  font-size: clamp(2.4rem, 9vw, 3.6rem);
  font-weight: 800;
  margin-top: 16px;
  color: var(--ink);
}
.flashcard-en {
  font-size: 1.3rem;
  opacity: 0.55;
  font-weight: 500;
  margin-top: 2px;
}
.speak-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  border: none;
  background: #ffe08a;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  font-size: 1.8rem;
  cursor: pointer;
  box-shadow: 0 5px 0 #e6b800;
  transition: transform 0.1s ease;
}
.speak-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #e6b800; }

.nav-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
}
.nav-btn {
  border: none;
  background: #fff;
  border-radius: 999px;
  padding: 16px 22px;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  font-family: inherit;
  font-weight: 700;
  color: var(--ink);
  transition: transform 0.1s ease;
}
.nav-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0,0,0,0.12); }
.nav-btn.big {
  background: #7ee081;
  color: #14532d;
  box-shadow: 0 6px 0 #4caf50;
  padding: 16px 30px;
}
.nav-btn.big:active { box-shadow: 0 2px 0 #4caf50; }

/* ---------------- Game ---------------- */
.game-question {
  text-align: center;
  font-size: 1.8rem;
  margin: 8px 0 14px;
  text-shadow: 1px 1px 0 #fff;
}
.game-question span {
  color: #e91e63;
  font-size: 2.2rem;
}
#game-replay {
  display: block;
  margin: 0 auto 22px;
}
.game-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: 520px;
  margin: 0 auto;
}
.game-option {
  border: none;
  background: #fff;
  border-radius: 30px;
  padding: 26px 10px;
  font-size: clamp(4rem, 18vw, 6rem);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease;
}
.game-option:active { transform: translateY(6px); }
.game-option.correct {
  animation: correctPulse 0.6s ease;
  background: #c8f7c5;
}
.game-option.wrong {
  animation: wrongShake 0.5s ease;
  background: #ffd0d0;
}
@keyframes correctPulse {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}
@keyframes wrongShake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(10px); }
  60% { transform: translateX(-8px); }
  80% { transform: translateX(8px); }
}

/* Celebration overlay */
.celebrate {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 20;
  background: rgba(0,0,0,0.15);
}
.celebrate.show { display: flex; animation: pop 0.3s ease; }
.celebrate-inner {
  background: #fff;
  border-radius: 40px;
  padding: 40px 50px;
  text-align: center;
  box-shadow: 0 12px 0 rgba(0,0,0,0.15);
}
.celebrate-emoji { font-size: 6rem; animation: spinPop 0.6s ease; }
.celebrate-text { font-size: 2.6rem; font-weight: 800; color: #4caf50; }
@keyframes spinPop {
  0% { transform: scale(0) rotate(-180deg); }
  100% { transform: scale(1) rotate(0deg); }
}

/* Reduce motion for sensitive users */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; }
}

/* ============================================================
   V0.2 — Home actions, Lesson, Completion, Parent, Scaffolding
   Low-distraction, responsive, touch-friendly styles.
   ============================================================ */

/* ---------------- Home Actions ---------------- */
.home-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 420px;
  margin: 0 auto 24px;
}

.home-primary-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 140px;
  border: none;
  border-radius: 32px;
  background: linear-gradient(145deg, #7ee081, #4caf50);
  color: #fff;
  padding: 28px 24px;
  cursor: pointer;
  box-shadow: 0 8px 0 #388e3c;
  font-family: inherit;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.home-primary-btn:active {
  transform: translateY(6px);
  box-shadow: 0 2px 0 #388e3c;
}
.home-primary-emoji {
  font-size: 3rem;
  display: block;
  margin-bottom: 6px;
}
.home-primary-label {
  display: block;
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  font-weight: 800;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.15);
}
.home-primary-sub {
  display: block;
  font-size: 1rem;
  opacity: 0.85;
  font-weight: 500;
  margin-top: 2px;
}

.home-secondary-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 80px;
  border: none;
  border-radius: 24px;
  background: #fff;
  color: var(--ink);
  padding: 18px 20px;
  cursor: pointer;
  box-shadow: var(--shadow);
  font-family: inherit;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.home-secondary-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 rgba(0,0,0,0.12);
}
.home-secondary-emoji {
  font-size: 1.8rem;
  display: block;
  margin-bottom: 2px;
}
.home-secondary-label {
  display: block;
  font-size: 1.3rem;
  font-weight: 700;
}
.home-secondary-sub {
  display: block;
  font-size: 0.85rem;
  opacity: 0.6;
  font-weight: 500;
}

.parent-entry-btn {
  display: block;
  margin: 0 auto;
  border: none;
  background: transparent;
  color: var(--ink);
  opacity: 0.5;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 12px 20px;
  cursor: pointer;
  border-radius: 12px;
  transition: opacity 0.15s ease;
}
.parent-entry-btn:hover,
.parent-entry-btn:focus-visible {
  opacity: 0.8;
}

/* ---------------- Lesson Screen ---------------- */
#lesson {
  position: relative;
}

.lesson-home-btn {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
  width: 48px;
  height: 48px;
  font-size: 1.4rem;
  margin-bottom: 0;
}

.lesson-progress {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  padding: 10px 0 6px;
  color: var(--ink);
  opacity: 0.7;
}

.lesson-prompt {
  background: #fff;
  border-radius: 32px;
  padding: 32px 20px;
  text-align: center;
  box-shadow: 0 8px 0 rgba(0,0,0,0.08);
  max-width: 520px;
  margin: 12px auto 16px;
}

.lesson-image {
  font-size: clamp(5rem, 22vw, 9rem);
  line-height: 1.1;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 3px rgba(0,0,0,0.12));
}

.lesson-text {
  font-size: clamp(1.6rem, 6vw, 2.4rem);
  font-weight: 800;
  color: var(--ink);
  line-height: 1.3;
}

/* Listen/Reveal — prominent image for flashcard-style presentation */
.lesson-image-prominent {
  animation: imageAppear 0.3s ease;
}
@keyframes imageAppear {
  0% { transform: scale(0.85); opacity: 0.5; }
  100% { transform: scale(1); opacity: 1; }
}

/* Listen/Reveal — subtle reveal animation for text */
.lesson-text-revealed {
  animation: textReveal 0.4s ease;
}
@keyframes textReveal {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Listen/Reveal — English helper label */
.lesson-text-en {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.75em;
  font-weight: 500;
  opacity: 0.55;
  color: var(--ink);
}

.lesson-replay-btn {
  display: block;
  margin: 10px auto 18px;
  border: none;
  background: #ffe08a;
  color: var(--ink);
  font-family: inherit;
  font-size: 1.2rem;
  font-weight: 700;
  padding: 14px 28px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 5px 0 #e6b800;
  min-height: 48px;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.lesson-replay-btn:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #e6b800;
}

/* Choice grid */
.lesson-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  max-width: 520px;
  margin: 0 auto 16px;
}

.lesson-choice {
  border: none;
  background: #fff;
  border-radius: 24px;
  padding: 20px 12px;
  font-size: clamp(3.2rem, 14vw, 5rem);
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow);
  font-family: inherit;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, background 0.2s ease, box-shadow 0.12s ease, opacity 0.2s ease;
}
.lesson-choice:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 rgba(0,0,0,0.12);
}

/* Correct — brief green pulse, no excess celebration */
.lesson-choice.correct {
  background: #c8f7c5;
  animation: lessonCorrect 0.45s ease;
}
@keyframes lessonCorrect {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

/* Wrong — brief warm indication, no punishing shake */
.lesson-choice.wrong {
  background: #ffe0cc;
  animation: lessonWrong 0.35s ease;
}
@keyframes lessonWrong {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(0.96); }
}

/* Disabled — locked during transitions */
.lesson-choice.disabled,
.lesson-choice[disabled] {
  opacity: 0.45;
  pointer-events: none;
  cursor: default;
  box-shadow: 0 4px 0 rgba(0,0,0,0.06);
}

/* Hint state — first miss, replay/hint emphasis */
.lesson-choice.hint {
  box-shadow: 0 0 0 4px #ffe08a, var(--shadow);
  animation: lessonHint 0.6s ease;
}
@keyframes lessonHint {
  0%, 100% { box-shadow: 0 0 0 4px #ffe08a, var(--shadow); }
  50% { box-shadow: 0 0 0 8px rgba(255,224,138,0.5), var(--shadow); }
}

/* Reduced state — fewer distractors, non-target fades away */
.lesson-choice.reduced {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.9);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Revealed state — supported reveal after third miss */
.lesson-choice.revealed {
  background: #d6f0ff;
  box-shadow: 0 0 0 4px #90caf9, var(--shadow);
  animation: lessonReveal 0.5s ease;
}
@keyframes lessonReveal {
  0% { transform: scale(0.95); opacity: 0.7; }
  100% { transform: scale(1); opacity: 1; }
}

/* Show/Do — action prompt styling */
.lesson-show-do {
  border: 4px dashed #e67e22;
  border-radius: 28px;
  padding: 8px;
  background: rgba(230, 126, 34, 0.06);
}

.lesson-action-label {
  display: inline-block;
  font-weight: 700;
  color: #e67e22;
  margin-right: 4px;
  font-size: 1.1em;
}

/* Mini Scene — scene frame styling */
.lesson-mini-scene {
  position: relative;
  border: 3px solid #6c5ce7;
  border-radius: 28px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.05), rgba(162, 155, 254, 0.08));
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.12);
}

/* Mini Scene — optional tap target */
.lesson-scene-tap {
  display: block;
  margin: 12px auto;
  border: none;
  background: #fff;
  border-radius: 20px;
  padding: 14px 24px;
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  color: #6c5ce7;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(108, 92, 231, 0.2);
  min-height: 48px;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  animation: sceneTapPulse 1.5s ease infinite;
}
.lesson-scene-tap:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 rgba(108, 92, 231, 0.2);
  animation: none;
}
@keyframes sceneTapPulse {
  0%, 100% { box-shadow: 0 4px 0 rgba(108, 92, 231, 0.2); }
  50% { box-shadow: 0 4px 8px rgba(108, 92, 231, 0.3); }
}

/* Advance button */
.lesson-advance-btn {
  display: block;
  width: 100%;
  max-width: 320px;
  margin: 12px auto 0;
  border: none;
  border-radius: 999px;
  background: linear-gradient(145deg, #7ee081, #4caf50);
  color: #fff;
  font-family: inherit;
  font-size: 1.4rem;
  font-weight: 800;
  padding: 18px 24px;
  cursor: pointer;
  box-shadow: 0 6px 0 #388e3c;
  min-height: 56px;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.lesson-advance-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #388e3c;
}

/* Free navigation row — move between steps without completing them */
.lesson-nav-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  max-width: 520px;
  margin: 18px auto 0;
}
.lesson-nav-btn {
  flex: 1 1 0;
  max-width: 200px;
  border: none;
  border-radius: 999px;
  background: #eef1f5;
  color: var(--ink);
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 12px 18px;
  cursor: pointer;
  box-shadow: 0 4px 0 #cfd6df;
  min-height: 48px;
  transition: transform 0.1s ease, box-shadow 0.1s ease, opacity 0.1s ease;
}
.lesson-nav-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #cfd6df;
}
.lesson-nav-btn:disabled {
  opacity: 0.4;
  cursor: default;
  box-shadow: 0 4px 0 #cfd6df;
  transform: none;
}

/* Lesson feedback overlay — brief acknowledgement */
.lesson-feedback {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 25;
  background: rgba(255,255,255,0.6);
  pointer-events: none;
}
.lesson-feedback:not([hidden]) {
  display: flex;
  animation: feedbackIn 0.3s ease;
}
@keyframes feedbackIn {
  0% { opacity: 0; transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1); }
}
.lesson-feedback-inner {
  background: #fff;
  border-radius: 28px;
  padding: 28px 36px;
  text-align: center;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ink);
  box-shadow: 0 8px 0 rgba(0,0,0,0.08);
}

/* ---------------- Completion Screen ---------------- */
.completion-header {
  text-align: center;
  padding: 20px 0 16px;
}
.completion-emoji {
  font-size: clamp(4rem, 16vw, 6rem);
  display: block;
  margin-bottom: 8px;
}
.completion-title {
  font-size: clamp(2rem, 7vw, 2.8rem);
  font-weight: 800;
  color: var(--ink);
}
.completion-subtitle {
  font-size: 1.1rem;
  opacity: 0.6;
  font-weight: 500;
  margin-top: 2px;
}

.completion-phrases,
.completion-routines {
  background: #fff;
  border-radius: 24px;
  padding: 20px 22px;
  margin: 12px auto;
  max-width: 520px;
  box-shadow: 0 4px 0 rgba(0,0,0,0.06);
}

.completion-section-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--ink);
}

.completion-phrases ul,
.completion-routines ul {
  list-style: none;
  padding: 0;
}
.completion-phrases li,
.completion-routines li {
  font-size: 1.1rem;
  font-weight: 500;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  line-height: 1.4;
}
.completion-phrases li:last-child,
.completion-routines li:last-child {
  border-bottom: none;
}

.completion-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 24px auto 0;
  max-width: 320px;
}

.completion-primary-btn {
  width: 100%;
  border: none;
  border-radius: 999px;
  background: linear-gradient(145deg, #7ee081, #4caf50);
  color: #fff;
  font-family: inherit;
  font-size: 1.4rem;
  font-weight: 800;
  padding: 18px 24px;
  cursor: pointer;
  box-shadow: 0 6px 0 #388e3c;
  min-height: 56px;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.completion-primary-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #388e3c;
}

.completion-secondary-btn {
  width: 100%;
  border: none;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 1.2rem;
  font-weight: 700;
  padding: 16px 20px;
  cursor: pointer;
  box-shadow: var(--shadow);
  min-height: 48px;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.completion-secondary-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 rgba(0,0,0,0.12);
}

/* ---------------- Parent Screen ---------------- */
.parent-summary {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 600px;
  margin: 0 auto;
}

.parent-section {
  background: #fff;
  border-radius: 20px;
  padding: 20px 22px;
  box-shadow: 0 4px 0 rgba(0,0,0,0.06);
}

.parent-section-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 2px;
}

.parent-section-desc {
  font-size: 0.9rem;
  opacity: 0.55;
  font-weight: 500;
  margin-bottom: 10px;
}

.parent-section ul {
  list-style: none;
  padding: 0;
}
.parent-section li {
  font-size: 1.05rem;
  font-weight: 500;
  padding: 6px 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  line-height: 1.4;
}
.parent-section li:last-child {
  border-bottom: none;
}

.parent-debug {
  max-width: 600px;
  margin: 20px auto 0;
  background: #fff;
  border-radius: 16px;
  padding: 0;
  box-shadow: 0 4px 0 rgba(0,0,0,0.04);
}
.parent-debug summary {
  padding: 14px 20px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  color: var(--ink);
  opacity: 0.7;
}
.parent-debug[open] summary {
  opacity: 1;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.parent-debug-content {
  padding: 16px 20px;
}
.parent-debug-content p {
  font-size: 0.95rem;
  margin-bottom: 8px;
  opacity: 0.8;
}

.parent-export-btn {
  border: none;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 12px 20px;
  cursor: pointer;
  margin-top: 8px;
  min-height: 44px;
  transition: opacity 0.15s ease;
}
.parent-export-btn:active {
  opacity: 0.8;
}

/* ---------------- Focus Visibility ---------------- */
*:focus-visible {
  outline: 3px solid #6366f1;
  outline-offset: 3px;
  border-radius: inherit;
}
.home-primary-btn:focus-visible,
.home-secondary-btn:focus-visible,
.lesson-choice:focus-visible,
.lesson-advance-btn:focus-visible,
.completion-primary-btn:focus-visible,
.completion-secondary-btn:focus-visible {
  outline: 3px solid #6366f1;
  outline-offset: 4px;
}

/* ---------------- Reduced bg-shapes motion during lesson ---------------- */
#lesson.active ~ .bg-shapes,
.screen#lesson.active ~ .bg-shapes {
  /* handled via body class — see below */
}
body.lesson-active .bg-shapes span {
  animation-play-state: paused;
  opacity: 0.15;
}

/* ---------------- Responsive — Phone (< 480px) ---------------- */
@media (max-width: 480px) {
  #app {
    padding: 12px 10px 28px;
  }

  .home-primary-btn {
    min-height: 120px;
    padding: 22px 18px;
    border-radius: 26px;
  }
  .home-primary-label {
    font-size: 1.5rem;
  }

  .home-secondary-btn {
    min-height: 68px;
    padding: 14px 16px;
    border-radius: 20px;
  }

  .lesson-prompt {
    padding: 24px 16px;
    border-radius: 24px;
    margin: 8px 12px 12px;
  }
  .lesson-image {
    font-size: clamp(4rem, 20vw, 7rem);
  }
  .lesson-text {
    font-size: clamp(1.4rem, 5.5vw, 2rem);
  }

  .lesson-choices {
    gap: 10px;
    margin: 0 8px 12px;
  }
  .lesson-choice {
    padding: 16px 8px;
    border-radius: 20px;
    min-height: 76px;
    font-size: clamp(2.8rem, 12vw, 4rem);
  }

  .lesson-advance-btn {
    font-size: 1.2rem;
    padding: 16px 20px;
    max-width: 280px;
  }

  .completion-phrases,
  .completion-routines {
    margin: 10px 8px;
    padding: 16px 16px;
    border-radius: 20px;
  }

  .completion-actions {
    max-width: 280px;
  }

  .parent-section {
    padding: 16px 16px;
    border-radius: 16px;
  }

  .back-btn {
    width: 48px;
    height: 48px;
    font-size: 1.3rem;
  }
}

/* ---------------- Responsive — Tablet (481px – 860px) ---------------- */
@media (min-width: 481px) and (max-width: 860px) {
  .lesson-choices {
    gap: 16px;
    max-width: 480px;
  }
  .lesson-choice {
    padding: 22px 14px;
    min-height: 100px;
  }

  .home-primary-btn {
    min-height: 150px;
  }
}

/* ---------------- Responsive — Large Tablet / Desktop (> 860px) ---------------- */
@media (min-width: 861px) {
  .lesson-choices {
    max-width: 560px;
    gap: 18px;
  }
  .lesson-choice {
    min-height: 110px;
    padding: 24px 16px;
  }

  .completion-phrases,
  .completion-routines {
    max-width: 580px;
  }

  .parent-summary {
    max-width: 680px;
  }
}

/* ---------------- Enhanced reduced-motion — all V0.2 animations ---------------- */
@media (prefers-reduced-motion: reduce) {
  .lesson-choice.correct,
  .lesson-choice.wrong,
  .lesson-choice.hint,
  .lesson-choice.revealed,
  .lesson-feedback:not([hidden]) {
    animation: none !important;
  }
  .lesson-choice.reduced {
    transition: none !important;
  }
  body.lesson-active .bg-shapes span {
    animation: none !important;
  }
}

/* ---------------- Iskra — lesson companion mascot ---------------- */

.mascot-host {
  position: absolute;
  top: 8px;
  right: 10px;
  width: clamp(72px, 20vw, 120px);
  z-index: 8;
  pointer-events: none; /* she's decorative; never intercepts taps */
}

.mascot {
  width: 100%;
  transform-origin: bottom center;
  animation: mascotIdle 3.2s ease-in-out infinite;
}

.mascot svg {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 4px 4px rgba(90, 50, 120, 0.18));
}

@keyframes mascotIdle {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-5px) rotate(-1deg); }
}

.mascot.cheer {
  animation: mascotCheer 0.6s ease-in-out 3;
}

@keyframes mascotCheer {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25%      { transform: translateY(-16px) rotate(-6deg); }
  75%      { transform: translateY(-16px) rotate(6deg); }
}

/* Respect reduced-motion preferences: hold her still */
@media (prefers-reduced-motion: reduce) {
  .mascot,
  .mascot.cheer {
    animation: none;
  }
}

/* Small screens: keep her from crowding the prompt */
@media (max-width: 480px) {
  .mascot-host {
    top: 6px;
    right: 6px;
    width: clamp(60px, 22vw, 96px);
  }
}

/* ---------------- Interactive verb scene (e.g. open-box) ---------------- */

.lesson-interactive-scene {
  /* Override the giant emoji font sizing when the image area hosts a scene */
  font-size: 0 !important;
}

.scene-open-box {
  position: relative;
  width: clamp(160px, 55vw, 260px);
  margin: 0 auto;
  touch-action: none;
  user-select: none;
  cursor: grab;
}

.scene-open-box:active {
  cursor: grabbing;
}

.scene-open-box svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.scene-lid {
  transform-origin: 50% 100%;
  transition: transform 0.15s ease-out;
}

.scene-hint {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 28px;
  animation: sceneHint 1.1s ease-in-out infinite;
  pointer-events: none;
  z-index: 2;
}

@keyframes sceneHint {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.5; }
  50%      { transform: translateX(-50%) translateY(-8px); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .scene-hint { animation: none; }
}

/* ---------------- Dev: scene preview control (parent debug) ---------------- */

.parent-scene-preview {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(0, 0, 0, 0.15);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.parent-scene-label {
  font-size: 0.9rem;
  font-weight: 700;
  width: 100%;
}

.parent-scene-select {
  flex: 1 1 auto;
  min-width: 140px;
  font-family: inherit;
  font-size: 0.95rem;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  background: #fff;
}

/* ---------------- Interactive verb scene: tap-to-grab ---------------- */

.scene-grab {
  position: relative;
  width: clamp(180px, 60vw, 300px);
  height: clamp(140px, 40vw, 200px);
  margin: 0 auto;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
}

.scene-grab-object {
  position: absolute;
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%);
  font-size: clamp(3.5rem, 16vw, 6rem);
  line-height: 1;
  transition: transform 0.5s cubic-bezier(.3, .8, .4, 1), opacity 0.5s;
  will-change: transform;
}

.scene-grab-paw {
  position: absolute;
  left: 50%;
  bottom: -6%;
  transform: translateX(-50%) translateY(30%);
  font-size: clamp(2.6rem, 12vw, 4.5rem);
  line-height: 1;
  transition: transform 0.35s ease-out;
  will-change: transform;
}

/* Paw reaches up toward the object on tap */
.scene-grab-paw.reaching {
  transform: translateX(-50%) translateY(-40%);
}
.scene-grab-paw.holding {
  transform: translateX(-50%) translateY(-30%);
}

/* Object travels toward the child (take / want): comes forward + grows */
.grab-to-self .scene-grab-object.grabbed {
  transform: translate(-50%, 40%) scale(1.25);
}

/* Object travels toward Iskra (give): flies to the top-right + shrinks away */
.grab-to-iskra .scene-grab-object.grabbed {
  transform: translate(120%, -180%) scale(0.4);
  opacity: 0.15;
}

.scene-grab .scene-hint {
  top: auto;
  bottom: 4%;
}

@media (prefers-reduced-motion: reduce) {
  .scene-grab-object,
  .scene-grab-paw {
    transition: none;
  }
  .scene-grab .scene-hint {
    animation: none;
  }
}
