@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.app-shell {
  max-width: 1220px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.hero {
  background: linear-gradient(135deg, #0f3c77, #1f5fd8);
  color: #fff;
  border-radius: 1.5rem;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-shadow: 0 20px 60px rgba(15, 60, 119, 0.35);
}

.hero-top {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.badge {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 0.35rem 1rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-title {
  font-size: clamp(2rem, 4vw, 3.2rem);
  margin: 0;
}

.hero-text {
  margin: 0;
  max-width: 600px;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.92);
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.hero-tag {
  background: rgba(255, 255, 255, 0.2);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
}

.hero-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
}

.hero-stat {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 1rem;
  padding: 1rem;
  text-align: center;
}

.hero-stat span {
  font-size: 2rem;
  font-weight: 700;
  display: block;
}

.module-panel {
  margin-top: 2rem;
  background: #fdfdff;
  border-radius: 1.5rem;
  padding: 1.5rem;
  box-shadow: 0 20px 50px rgba(21, 54, 109, 0.08);
}

.global-module {
  display: grid;
  gap: 1.5rem;
}

.global-card {
  border-radius: 1.4rem;
  background: linear-gradient(135deg, #fef6d7, #ffd6e8);
  padding: 1.5rem;
  display: grid;
  gap: 1.5rem;
}

.word-letter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 0.5rem;
  justify-content: center;
}

.original-word {
  margin: 0.2rem 0 0.8rem;
  font-size: 1rem;
  color: rgba(15, 35, 68, 0.7);
  text-transform: capitalize;
}

.global-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.global-figure {
  margin: 1rem 0;
  border-radius: 1.2rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

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

.global-figure-media {
  width: min(260px, 100%);
  border-radius: 1rem;
  overflow: hidden;
  position: relative;
  box-shadow: 0 15px 30px rgba(15, 35, 68, 0.2);
}

.image-placeholder {
  width: 100%;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(
    45deg,
    rgba(15, 35, 68, 0.08),
    rgba(15, 35, 68, 0.08) 10px,
    rgba(15, 35, 68, 0.15) 10px,
    rgba(15, 35, 68, 0.15) 20px
  );
  color: #0f2344;
  font-weight: 700;
  border-radius: inherit;
}

.global-figure-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.image-badge {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 10px;
  background: rgba(15, 35, 68, 0.85);
  color: #fff;
  font-size: 0.75rem;
  padding: 0.25rem 0.8rem;
  border-radius: 999px;
}

.global-figure p {
  margin: 0;
  color: #333f63;
}

.spelling-panel {
  flex: 1;
  min-width: 220px;
  display: grid;
  gap: 0.4rem;
}

.spelling-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin: 0;
  color: #0f3c77;
}

.letter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
}

.letter-card {
  min-width: 48px;
  padding: 0.6rem 0.9rem;
  border-radius: 0.9rem;
  background: #0f2344;
  color: #fff;
  font-size: 1.3rem;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 12px 20px rgba(15, 35, 68, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.letter-card:hover {
  background: #ffb347;
  color: #09203f;
  transform: translateY(-4px);
  box-shadow: 0 16px 28px rgba(15, 35, 68, 0.35);
}

.letter-card.big {
  min-width: 58px;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  padding: 0.75rem 1rem;
}

.global-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.6rem;
}

.choice-button {
  border: none;
  border-radius: 1rem;
  padding: 0.9rem;
  font-size: 1rem;
  font-weight: 700;
  background: rgba(15, 35, 68, 0.08);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.choice-button.correct {
  background: rgba(15, 145, 84, 0.15);
  color: #0b6834;
}

.choice-button.incorrect {
  background: rgba(201, 50, 50, 0.15);
  color: #862424;
}

.choice-feedback {
  font-weight: 700;
  margin: 0.4rem 0;
}

.choice-feedback.ok {
  color: #0b6834;
}

.choice-feedback.oops {
  color: #a52b2b;
}

.chip {
  padding: 0.2rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(16, 35, 68, 0.15);
  color: #0f2344;
}

.global-description {
  font-size: 1.1rem;
  margin: 0.4rem 0 0;
  color: #2c3454;
}

.global-progress {
  margin-top: 0.75rem;
}

.progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(15, 35, 68, 0.15);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff7e5f, #feb47b);
  transition: width 0.2s ease;
}

.controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.control-button {
  border: none;
  border-radius: 999px;
  padding: 0.65rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  background: #fff;
  color: #0f2344;
  box-shadow: 0 10px 20px rgba(15, 35, 68, 0.15);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.control-button:hover {
  transform: translateY(-2px);
}

.control-button.primary {
  background: linear-gradient(135deg, #ffb347, #ffcc33);
  color: #09203f;
}

.control-button.active {
  background: #10233f;
  color: #fff;
}

.speed-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.speed-button {
  border: none;
  background: rgba(16, 35, 68, 0.12);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.speed-button.active {
  background: #0f3c77;
  color: #fff;
}

.global-lists {
  display: grid;
  gap: 1rem;
}

.panel {
  background: #fff;
  border-radius: 1.2rem;
  padding: 1rem;
  box-shadow: inset 0 0 0 1px rgba(15, 35, 68, 0.05);
}

.panel h3 {
  margin: 0 0 0.6rem;
}

.history-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.history-chip {
  padding: 0.35rem 0.75rem;
  background: rgba(12, 57, 145, 0.08);
  border-radius: 0.8rem;
  font-weight: 600;
}

.favorites-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.favorite-chip {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 0.9rem;
  padding: 0.35rem 0.8rem;
  box-shadow: 0 8px 16px rgba(15, 35, 68, 0.15);
}

/* Fonética */
.phonics-grid {
  display: grid;
  gap: 1.5rem;
}

.phoneme-scroll {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
}

.phoneme-button {
  border: none;
  border-radius: 1rem;
  padding: 0.85rem;
  text-align: center;
  font-weight: 700;
  background: #fff;
  box-shadow: 0 15px 30px rgba(85, 106, 168, 0.15);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.phoneme-button.active {
  background: linear-gradient(135deg, #78ffd6, #a8ff78);
}

.phoneme-detail {
  background: #fff;
  border-radius: 1.2rem;
  padding: 1.25rem;
  box-shadow: inset 0 0 0 1px rgba(15, 35, 68, 0.05);
}

.syllable-lab {
  background: linear-gradient(135deg, #eef2ff, #f5f9ff);
  border-radius: 1.2rem;
  padding: 1.25rem;
  display: grid;
  gap: 1rem;
}

.vowel-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.vowel-button {
  border: none;
  border-radius: 0.9rem;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  font-weight: 700;
  background: rgba(16, 35, 68, 0.08);
}

.vowel-button.active {
  background: #0f3c77;
  color: #fff;
}

.syllable-display {
  font-size: 2.8rem;
  font-weight: 800;
  text-align: center;
  color: #10233f;
}

.track {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.track-item {
  background: #fff;
  border-radius: 0.85rem;
  padding: 0.45rem 0.9rem;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(15, 35, 68, 0.1);
}

/* Historias */
.story-grid {
  display: grid;
  gap: 1.5rem;
}

.story-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.story-card {
  background: #fff;
  border-radius: 1.2rem;
  padding: 1rem;
  border: 2px solid transparent;
  cursor: pointer;
  box-shadow: 0 12px 25px rgba(13, 40, 80, 0.08);
  transition: transform 0.15s ease, border 0.15s ease;
}

.story-card.active {
  border-color: #ffd347;
}

.story-card h4 {
  margin: 0 0 0.3rem;
}

.story-detail {
  background: linear-gradient(135deg, #fff4d9, #ffe7ff);
  border-radius: 1.2rem;
  padding: 1.25rem;
  box-shadow: 0 15px 40px rgba(45, 28, 81, 0.15);
}

.prompt-box {
  background: rgba(255, 255, 255, 0.85);
  border-radius: 1rem;
  padding: 0.9rem;
  margin-top: 0.8rem;
  position: relative;
}

.prompt-actions {
  margin-top: 0.6rem;
  display: flex;
  gap: 0.5rem;
}

.note-area {
  width: 100%;
  border-radius: 1rem;
  border: none;
  padding: 0.8rem;
  font-family: inherit;
  resize: none;
  min-height: 90px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.questions-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-left: 1rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.6);
}

.copied {
  font-size: 0.8rem;
  color: #0b6834;
  font-weight: 700;
}

@media (min-width: 900px) {
  .hero {
    flex-direction: row;
    justify-content: space-between;
  }
  .hero-card {
    max-width: 320px;
  }
}
