/* ===== INGLES PAGE BASE ===== */
.ingles-page {
  background: #f5f0ff;
  min-height: 100vh;
  padding: 0;
}

.ingles-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem 2rem 0.8rem;
  position: relative;
}

.btn-back {
  position: absolute;
  left: 1.5rem;
  font-family: var(--font-display);
  font-size: 1rem;
  color: #7B1FA2;
  text-decoration: none;
  background: white;
  padding: 0.45rem 1.1rem;
  border-radius: 99px;
  box-shadow: 0 4px 0 rgba(0,0,0,0.1);
  transition: transform 0.15s ease;
}
.btn-back:hover { transform: translateY(-2px); }

.ingles-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 3rem);
  color: #7B1FA2;
  letter-spacing: 2px;
}

/* ===== TOPIC LANDING GRID ===== */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.4rem;
  max-width: 900px;
  margin: 1.5rem auto 0;
  padding: 0 1.5rem 3rem;
}

.topic-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  padding: 1.8rem 1rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  aspect-ratio: 1;
  box-shadow: 0 var(--shadow-depth) 0 rgba(0,0,0,0.20), 0 12px 30px rgba(0,0,0,0.08);
  opacity: 0;
  transform: translateY(24px) scale(0.96);
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s ease, opacity 0.45s ease;
  position: relative;
  overflow: hidden;
}
.topic-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 45%;
  border-radius: var(--radius) var(--radius) 60% 60% / var(--radius) var(--radius) 30% 30%;
  background: linear-gradient(180deg, rgba(255,255,255,0.30) 0%, transparent 100%);
  pointer-events: none;
}
.topic-card.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.topic-card:hover { transform: translateY(-8px) scale(1.04) rotate(-1deg); }
.topic-card:active { transform: translateY(3px) scale(0.97); }
.topic-card__emoji { font-size: clamp(2.5rem, 5vw, 3.8rem); line-height: 1; }
.topic-card__label { font-family: var(--font-display); font-size: clamp(0.9rem, 1.8vw, 1.3rem); color: rgba(0,0,0,0.72); text-align: center; }

.topic-card--saludos   { background: var(--color-ingles); }
.topic-card--familia   { background: var(--color-plastica); }
.topic-card--animales  { background: var(--color-ciencias); }
.topic-card--colores   { background: var(--color-lengua); }
.topic-card--ropa      { background: var(--color-lectura); }
.topic-card--comida    { background: var(--color-matematicas); }
.topic-card--casa      { background: var(--color-musica); }
.topic-card--verbos    { background: var(--color-ef); }

/* ===== TOPIC MENU (4 section cards) ===== */
.topic-menu-title {
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  color: #7B1FA2;
  margin: 1rem 0 1.5rem;
}
.section-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.2rem;
  max-width: 560px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}
.section-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 2rem 1rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  background: white;
  box-shadow: 0 5px 0 rgba(0,0,0,0.12), 0 8px 20px rgba(0,0,0,0.06);
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.section-card:hover { transform: translateY(-6px) scale(1.03); }
.section-card:active { transform: translateY(2px); }
.section-card__emoji { font-size: 2.8rem; }
.section-card__label { font-family: var(--font-display); font-size: 1.4rem; color: #333; }
.section-card__desc { font-size: 0.85rem; color: #aaa; font-weight: 700; }
.section-card--teoria      { border-top: 6px solid var(--color-ingles); }
.section-card--actividades { border-top: 6px solid var(--color-plastica); }
.section-card--juegos      { border-top: 6px solid var(--color-ciencias); }
.section-card--quiz        { border-top: 6px solid var(--color-matematicas); }

/* ===== SECTION HEADER (inside a section) ===== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  padding: 0.8rem 1.5rem;
  flex-wrap: wrap;
}
.btn-back-topics {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: #9c5fb5;
  background: #f3e8ff;
  border: none;
  cursor: pointer;
  padding: 0.4rem 1.1rem;
  border-radius: 99px;
  box-shadow: 0 3px 0 rgba(0,0,0,0.08);
  transition: transform 0.15s ease;
}
.btn-back-topics:hover { transform: translateY(-2px); }

.btn-topic-back {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: #7B1FA2;
  background: white;
  border: none;
  cursor: pointer;
  padding: 0.4rem 1rem;
  border-radius: 99px;
  box-shadow: 0 3px 0 rgba(0,0,0,0.1);
  transition: transform 0.15s ease;
}
.btn-topic-back:hover { transform: translateY(-2px); }
.section-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}
.section-tab {
  font-family: var(--font-display);
  font-size: 0.9rem;
  padding: 0.4rem 1rem;
  border-radius: 99px;
  border: 2px solid transparent;
  background: white;
  color: #999;
  cursor: pointer;
  transition: all 0.15s ease;
}
.section-tab.active, .section-tab:hover {
  background: #7B1FA2;
  color: white;
  border-color: #7B1FA2;
}

/* ===== SECTION CONTENT AREA ===== */
.section-content {
  max-width: 860px;
  margin: 0 auto;
  padding: 1rem 1.5rem 3rem;
}
.section-content-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: #7B1FA2;
  text-align: center;
  margin-bottom: 1.2rem;
}

/* ===== FLIP CARDS (Teoría) ===== */
.flip-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.flip-card {
  height: 130px;
  perspective: 700px;
  cursor: pointer;
}
.flip-card__inner {
  width: 100%; height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.34, 1.2, 0.64, 1);
  border-radius: 18px;
}
.flip-card.flipped .flip-card__inner { transform: rotateY(180deg); }
.flip-card__front,
.flip-card__back {
  position: absolute; inset: 0;
  border-radius: 18px;
  backface-visibility: hidden;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  box-shadow: 0 5px 0 rgba(0,0,0,0.13);
}
.flip-card__front { background: white; }
.flip-card__front .fc-emoji { font-size: 48px; }
.flip-card__front .fc-hint { font-size: 11px; color: #ccc; margin-top: 4px; font-family: var(--font-body); font-weight: 700; }
.flip-card__back { background: #7B1FA2; transform: rotateY(180deg); }
.flip-card__back .fc-emoji-sm { font-size: 22px; margin-bottom: 3px; }
.flip-card__back .fc-word-en { font-family: var(--font-display); font-size: 22px; color: white; letter-spacing: 1px; text-transform: uppercase; }
.flip-card__back .fc-word-es { font-size: 13px; color: rgba(255,255,255,0.75); margin-top: 3px; font-family: var(--font-body); font-weight: 700; }

/* ===== ACTIVIDADES ===== */
.activity-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}
.activity-step {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #e0d7f5;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 1rem;
  color: #aaa;
  transition: all 0.3s ease;
}
.activity-step.active { background: #7B1FA2; color: white; }
.activity-step.done { background: #81C784; color: white; }
.activity-connector { width: 24px; height: 3px; background: #e0d7f5; border-radius: 2px; }
.activity-box {
  background: white;
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 4px 0 rgba(0,0,0,0.08), 0 8px 24px rgba(0,0,0,0.05);
}
.activity-instruction {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: #555;
  text-align: center;
  margin-bottom: 1.2rem;
}
/* Match exercise */
.match-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  align-items: start;
}
.match-emoji-btn {
  font-size: 2.2rem;
  background: #f5f0ff;
  border: 3px solid transparent;
  border-radius: 14px;
  padding: 0.8rem;
  cursor: grab;
  transition: all 0.15s ease;
  display: flex; align-items: center; justify-content: center;
  min-height: 64px;
  user-select: none;
}
.match-emoji-btn:active { cursor: grabbing; }
.match-emoji-btn.selected { border-color: #7B1FA2; background: #ede7f6; transform: scale(1.08); box-shadow: 0 6px 16px rgba(123,31,162,0.25); }
.match-emoji-btn.correct { border-color: #81C784; background: #e8f5e9; pointer-events: none; cursor: default; }
.match-emoji-btn.wrong { border-color: #EF5350; background: #ffebee; animation: shake 0.4s ease; }
.match-word-btn {
  font-family: var(--font-display);
  font-size: 1.1rem;
  background: #f5f0ff;
  border: 3px solid transparent;
  border-radius: 14px;
  padding: 0.7rem 0.5rem;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  min-height: 54px;
}
.match-word-btn.drag-over { border-color: #7B1FA2; background: #ede7f6; transform: scale(1.04); }
.match-word-btn.correct { border-color: #81C784; background: #e8f5e9; pointer-events: none; color: #2e7d32; }
.match-word-btn.wrong { border-color: #EF5350; background: #ffebee; animation: shake 0.4s ease; }
/* Fill letter exercise */
.fill-emoji { font-size: 4rem; text-align: center; margin-bottom: 0.8rem; }
.fill-blanks {
  display: flex; gap: 6px; justify-content: center; margin-bottom: 1.2rem;
}
.fill-blank {
  width: 38px; height: 44px;
  border-bottom: 3px solid #CE93D8;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 1.4rem; color: #7B1FA2;
}
.fill-blank.hidden-slot {
  border: 2px dashed #CE93D8;
  border-radius: 8px;
  background: #f5f0ff;
  color: transparent;
}
.letter-options {
  display: flex; gap: 0.7rem; justify-content: center; flex-wrap: wrap;
}
.letter-btn {
  font-family: var(--font-display); font-size: 1.3rem;
  background: white; border: 2px solid #CE93D8;
  border-radius: 12px; padding: 0.5rem 1rem;
  cursor: pointer; color: #7B1FA2;
  transition: all 0.15s ease;
  min-width: 48px; text-align: center;
}
.letter-btn:hover { background: #7B1FA2; color: white; }
.letter-btn.wrong { border-color: #EF5350; color: #EF5350; animation: shake 0.4s ease; }
/* Choice exercise */
.choice-word {
  font-family: var(--font-display); font-size: 2.2rem;
  color: #7B1FA2; text-align: center; margin-bottom: 1.2rem;
  text-transform: uppercase;
}
.choice-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem;
}
.choice-btn {
  font-size: 2.5rem;
  background: #f5f0ff; border: 3px solid transparent;
  border-radius: 16px; padding: 1rem;
  cursor: pointer; text-align: center;
  transition: all 0.15s ease;
  min-height: 80px;
}
.choice-btn:hover { border-color: #CE93D8; transform: scale(1.05); }
.choice-btn.correct { border-color: #81C784; background: #e8f5e9; }
.choice-btn.wrong { border-color: #EF5350; background: #ffebee; animation: shake 0.4s ease; }

/* ===== JUEGOS ===== */
.games-menu {
  display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.game-select-btn {
  font-family: var(--font-display); font-size: 1.1rem;
  background: white; border: 3px solid #e0d7f5;
  border-radius: 16px; padding: 0.8rem 1.4rem;
  cursor: pointer; color: #7B1FA2;
  transition: all 0.15s ease;
}
.game-select-btn:hover, .game-select-btn.active {
  background: #7B1FA2; color: white; border-color: #7B1FA2;
}
/* Memory */
.memory-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 0.8rem; max-width: 500px; margin: 0 auto;
}
.memory-card {
  aspect-ratio: 1;
  border-radius: 14px; cursor: pointer;
  perspective: 500px;
}
.memory-card__inner {
  width: 100%; height: 100%;
  position: relative; transform-style: preserve-3d;
  transition: transform 0.4s ease;
}
.memory-card.flipped .memory-card__inner { transform: rotateY(180deg); }
.memory-card.matched .memory-card__inner { transform: rotateY(180deg); }
.memory-card__front, .memory-card__back {
  position: absolute; inset: 0;
  border-radius: 14px; backface-visibility: hidden;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 0 rgba(0,0,0,0.12);
}
.memory-card__front { background: #7B1FA2; font-size: 1.8rem; }
.memory-card__back { background: white; transform: rotateY(180deg); }
.memory-card.matched .memory-card__back { background: #e8f5e9; border: 2px solid #81C784; }
.memory-card__back .mc-emoji { font-size: 1.6rem; }
.memory-card__back .mc-word { font-family: var(--font-display); font-size: 0.85rem; color: #7B1FA2; margin-top: 2px; }
.memory-stats {
  text-align: center; margin-bottom: 1rem;
  font-family: var(--font-display); font-size: 1.1rem; color: #7B1FA2;
}
/* Atrapa la palabra */
.catch-arena {
  background: #1a0a2e;
  border-radius: 20px;
  height: clamp(340px, 52vh, 500px);
  position: relative;
  overflow: hidden;
  margin: 0 auto;
  width: 100%;
}
.catch-target {
  position: absolute; top: 1rem; left: 50%; transform: translateX(-50%);
  font-size: clamp(2.8rem, 6vw, 4rem);
  z-index: 2;
}
.catch-timer {
  position: absolute; top: 1rem; right: 1rem;
  font-family: var(--font-display); font-size: 1.1rem; color: white;
  background: rgba(255,255,255,0.15); border-radius: 20px; padding: 3px 12px;
  z-index: 2;
}
.catch-score-display {
  position: absolute; top: 1rem; left: 1rem;
  font-family: var(--font-display); font-size: 1.1rem; color: #ffd93d;
  z-index: 2;
}
.falling-word {
  position: absolute; top: -50px;
  font-family: var(--font-display);
  font-size: clamp(0.85rem, 2.5vw, 1.05rem);
  background: rgba(255,255,255,0.18); color: white;
  border-radius: 12px; padding: 6px 14px;
  cursor: pointer; border: 2px solid transparent;
  white-space: nowrap;
  transition: border-color 0.1s, background 0.1s;
  animation: fall linear forwards;
}
.falling-word:hover { border-color: rgba(255,255,255,0.5); background: rgba(255,255,255,0.28); }
.falling-word.correct-flash { background: rgba(129,199,132,0.55); border-color: #81C784; }
.falling-word.wrong-flash { background: rgba(239,83,80,0.35); border-color: #EF5350; }
@keyframes fall {
  from { transform: translateY(0); }
  to { transform: translateY(600px); }
}
/* Sopa de letras */
.wordsearch-layout {
  display: flex; gap: 1.5rem; flex-wrap: wrap; justify-content: center;
}
.wordsearch-grid {
  display: grid; grid-template-columns: repeat(8, 1fr);
  gap: 4px; flex-shrink: 0;
}
.ws-cell {
  width: 36px; height: 36px;
  background: white; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 1rem; color: #555;
  cursor: pointer; transition: all 0.15s ease;
  user-select: none;
}
.ws-cell.selecting { background: #ede7f6; color: #7B1FA2; }
.ws-cell.found { background: #7B1FA2; color: white; }
.ws-cell.start-selected { background: #CE93D8; color: white; }
.wordsearch-targets {
  display: flex; flex-direction: column; gap: 0.5rem; min-width: 120px;
}
.ws-target {
  display: flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-body); font-weight: 700; font-size: 0.95rem; color: #555;
}
.ws-target.found { color: #81C784; text-decoration: line-through; }
.ws-target__emoji { font-size: 1.2rem; }

/* ===== QUIZ ===== */
.quiz-modes {
  display: flex; gap: 1rem; justify-content: center; margin-bottom: 1.5rem;
}
.quiz-mode-btn {
  font-family: var(--font-display); font-size: 1.1rem;
  background: white; border: 3px solid #e0d7f5;
  border-radius: 16px; padding: 0.8rem 1.4rem;
  cursor: pointer; color: #7B1FA2;
  transition: all 0.15s ease;
}
.quiz-mode-btn:hover, .quiz-mode-btn.active {
  background: #7B1FA2; color: white; border-color: #7B1FA2;
}
.quiz-progress {
  display: flex; align-items: center; gap: 0.8rem; margin-bottom: 1.2rem;
}
.quiz-progress-bar {
  flex: 1; height: 10px; background: #e0d7f5; border-radius: 99px; overflow: hidden;
}
.quiz-progress-fill {
  height: 100%; background: #7B1FA2; border-radius: 99px;
  transition: width 0.4s ease;
}
.quiz-progress-text {
  font-family: var(--font-display); font-size: 1rem; color: #7B1FA2; min-width: 48px; text-align: right;
}
.quiz-question {
  text-align: center; font-size: 4rem; margin-bottom: 1rem;
}
.quiz-question-text {
  font-family: var(--font-display); font-size: 1.2rem; color: #666; text-align: center; margin-bottom: 1.2rem;
}
.quiz-options {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem;
}
.quiz-option-btn {
  font-family: var(--font-display); font-size: 1.1rem;
  background: #f5f0ff; border: 3px solid transparent;
  border-radius: 16px; padding: 0.9rem;
  cursor: pointer; text-align: center; color: #555;
  transition: all 0.15s ease; text-transform: uppercase;
}
.quiz-option-btn:hover { border-color: #CE93D8; }
.quiz-option-btn.correct { background: #e8f5e9; border-color: #81C784; color: #2e7d32; }
.quiz-option-btn.wrong { background: #ffebee; border-color: #EF5350; color: #c62828; }
/* Rapidfire */
.rapidfire-card {
  text-align: center;
  background: white; border-radius: 20px;
  padding: 2rem; box-shadow: 0 4px 0 rgba(0,0,0,0.08);
}
.rapidfire-emoji { font-size: 5rem; margin-bottom: 0.5rem; }
.rapidfire-word {
  font-family: var(--font-display); font-size: 2rem; color: #7B1FA2;
  text-transform: uppercase; margin-bottom: 1.5rem;
}
.rapidfire-buttons { display: flex; gap: 1rem; justify-content: center; }
.rapidfire-btn {
  font-size: 2rem; border: none; cursor: pointer;
  border-radius: 16px; padding: 1rem 2rem;
  box-shadow: 0 5px 0 rgba(0,0,0,0.15);
  transition: transform 0.1s ease;
}
.rapidfire-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0,0,0,0.15); }
.rapidfire-btn--yes { background: #81C784; }
.rapidfire-btn--no { background: #EF5350; }
.rapidfire-counter {
  font-family: var(--font-display); font-size: 1rem; color: #aaa; text-align: center; margin-bottom: 1rem;
}
/* Results screen */
.results-screen {
  text-align: center; padding: 1.5rem 1rem;
}
.results-stars { font-size: 3rem; margin-bottom: 0.8rem; letter-spacing: 4px; }
.results-star { display: inline-block; opacity: 0; transform: scale(0.3); transition: all 0.4s cubic-bezier(0.34,1.56,0.64,1); }
.results-star.show { opacity: 1; transform: scale(1); }
.results-msg {
  font-family: var(--font-display); font-size: 1.8rem; color: #7B1FA2; margin-bottom: 0.5rem;
}
.results-score {
  font-family: var(--font-body); font-weight: 700; font-size: 1rem; color: #aaa; margin-bottom: 1.5rem;
}
.results-buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.btn-results {
  font-family: var(--font-display); font-size: 1.1rem;
  padding: 0.7rem 1.6rem; border-radius: 99px; border: none;
  cursor: pointer; box-shadow: 0 4px 0 rgba(0,0,0,0.12);
  transition: transform 0.15s ease;
}
.btn-results:hover { transform: translateY(-3px); }
.btn-results--retry { background: #7B1FA2; color: white; }
.btn-results--back { background: white; color: #7B1FA2; }

/* ===== SHARED UTILS ===== */
.btn-next {
  display: block; margin: 1.2rem auto 0;
  font-family: var(--font-display); font-size: 1.1rem;
  background: #7B1FA2; color: white; border: none;
  border-radius: 99px; padding: 0.7rem 2rem;
  cursor: pointer; box-shadow: 0 4px 0 rgba(0,0,0,0.15);
  transition: transform 0.15s ease;
}
.btn-next:hover { transform: translateY(-3px); }
.success-msg {
  text-align: center; font-family: var(--font-display);
  font-size: 1.4rem; color: #81C784; margin-top: 1rem;
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
@keyframes pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.25); }
  100% { transform: scale(1); }
}
.celebrate { animation: pop 0.5s cubic-bezier(0.34,1.56,0.64,1); }

/* ===== RESPONSIVE ===== */
@media (max-width: 700px) {
  .topics-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .flip-grid { grid-template-columns: repeat(2, 1fr); }
  .memory-grid { grid-template-columns: repeat(3, 1fr); }
  .ws-cell { width: 30px; height: 30px; font-size: 0.85rem; }
  .catch-arena { height: clamp(280px, 45vh, 380px); }
  .falling-word { font-size: 0.8rem; padding: 5px 10px; }
}
@media (max-width: 420px) {
  .topics-grid { grid-template-columns: repeat(2, 1fr); gap: 0.8rem; padding: 0 1rem 2rem; }
  .section-grid { grid-template-columns: 1fr 1fr; gap: 0.8rem; padding: 0 1rem 2rem; }
}
