/* ==========================================================================
   APRENDE ESPAÑOL - ESTILOS CSS MODERNOS PARA PWA MÓVIL
   ========================================================================== */

:root {
  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --primary-light: #EFF6FF;
  --success: #16A34A;
  --success-light: #DCFCE7;
  --warning: #EA580C;
  --warning-light: #FFEDD5;
  --danger: #DC2626;
  --purple: #7C3AED;
  --purple-light: #F3E8FF;
  
  --bg-main: #F8FAFC;
  --card-bg: #FFFFFF;
  --text-main: #0F172A;
  --text-muted: #64748B;
  --border-color: #E2E8F0;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.12);
  
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-full: 9999px;
}

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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: #0F172A;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
}

/* Contenedor tipo móvil en pantallas grandes / 100% en pantallas móviles */
#app-container {
  width: 100%;
  max-width: 480px;
  height: 100vh;
  max-height: 920px;
  background-color: var(--bg-main);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
}

@media (min-width: 500px) {
  #app-container {
    height: 94vh;
    border-radius: 36px;
    border: 8px solid #1E293B;
  }
}

/* Cabecera superior */
.app-header {
  padding: 14px 18px;
  background: #FFFFFF;
  border-bottom: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 20;
  min-height: 68px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-title-container {
  display: flex;
  flex-direction: column;
}

.header-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.header-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Botones de acción principales */
.btn-back {
  background: #F1F5F9;
  border: none;
  color: #1E293B;
  font-size: 1rem;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
}

.btn-back:active {
  transform: scale(0.94);
  background: #E2E8F0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-stop-audio {
  background: #EF4444;
  color: #FFFFFF;
  border: 2px solid #DC2626;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 0.92rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
  animation: pulse-stop 1.2s infinite;
  transition: all 0.15s ease;
}

.btn-stop-audio:active {
  transform: scale(0.92);
  background: #DC2626;
}

@keyframes pulse-stop {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.btn-speaker-header {
  background: #FEF3C7;
  border: 2px solid #F59E0B;
  color: #92400E;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.btn-speaker-header:active {
  transform: scale(0.9);
}

.btn-speaker-header.speaking {
  animation: pulse-ring 1s infinite;
  background: #FDE68A;
  border-color: #D97706;
}

@keyframes pulse-ring {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.6); }
  70% { transform: scale(1.08); box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* Área de contenido con scroll suave */
.content-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  -webkit-overflow-scrolling: touch;
}

/* PANTALLA: SELECTOR DE NIVELES */
.banner-welcome {
  background: linear-gradient(135deg, #2563EB, #1D4ED8);
  color: #FFFFFF;
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.banner-text h2 {
  font-size: 1.35rem;
  font-weight: 900;
  margin-bottom: 4px;
}

.banner-text p {
  font-size: 0.85rem;
  opacity: 0.92;
}

.banner-badge {
  font-size: 2.2rem;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2));
}

.levels-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.level-card {
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.level-card.active {
  border: 3px solid #2563EB;
  background: linear-gradient(180deg, #FFFFFF, #EFF6FF);
  box-shadow: var(--shadow-md);
}

.level-card.active:active {
  transform: scale(0.97);
}

.level-card.locked {
  background: #F8FAFC;
  border-color: #E2E8F0;
  opacity: 0.75;
  cursor: pointer;
}

.level-card.locked:active {
  transform: scale(0.98);
}

.level-icon-badge {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
}

.level-icon-active {
  background: #DBEAFE;
  color: #1D4ED8;
}

.level-icon-locked {
  background: #E2E8F0;
  color: #94A3B8;
  font-size: 1.4rem;
}

.level-info {
  flex: 1;
}

.level-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}

.level-title {
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--text-main);
}

.level-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.badge-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-start {
  background: #22C55E;
  color: #FFFFFF;
  box-shadow: 0 2px 4px rgba(34, 197, 94, 0.4);
}

.badge-locked {
  background: #E2E8F0;
  color: #64748B;
}

/* PANTALLA: NIVEL 0 - HUB DE ALFABETIZACIÓN */
.hub-intro {
  background: #FFFFFF;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 14px;
}

.hub-intro-text {
  font-size: 0.92rem;
  color: #334155;
  font-weight: 600;
  line-height: 1.4;
}

.blocks-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* 3 Bloques Apilados */
.hub-block {
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--shadow-md);
  border: 2px solid transparent;
  position: relative;
}

.hub-block:active {
  transform: scale(0.96);
}

/* Bloque 1: Azul Suave */
.hub-block-blue {
  background: linear-gradient(135deg, #E0F2FE 0%, #BAE6FD 100%);
  border-color: #38BDF8;
}

.hub-block-blue .block-icon-box {
  background: #0284C7;
  color: #FFFFFF;
}

.hub-block-blue .block-title {
  color: #0369A1;
}

/* Bloque 2: Verde Suave */
.hub-block-green {
  background: linear-gradient(135deg, #DCFCE7 0%, #BBF7D0 100%);
  border-color: #4ADE80;
}

.hub-block-green .block-icon-box {
  background: #16A34A;
  color: #FFFFFF;
}

.hub-block-green .block-title {
  color: #15803D;
}

/* Bloque 3: Naranja Suave */
.hub-block-orange {
  background: linear-gradient(135deg, #FFEDD5 0%, #FED7AA 100%);
  border-color: #FB923C;
}

.hub-block-orange .block-icon-box {
  background: #EA580C;
  color: #FFFFFF;
}

.hub-block-orange .block-title {
  color: #C2410C;
}

/* Bloque 4: Morado / Púrpura (Sílabas Directas) */
.hub-block-purple {
  background: linear-gradient(135deg, #F3E8FF 0%, #E9D5FF 100%);
  border-color: #C084FC;
}

.hub-block-purple .block-icon-box {
  background: #7E22CE;
  color: #FFFFFF;
}

.hub-block-purple .block-title {
  color: #6B21A8;
}

/* Bloque 5: Ámbar / Dorado (Vocabulario Cotidiano) */
.hub-block-amber {
  background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
  border-color: #FBBF24;
}

.hub-block-amber .block-icon-box {
  background: #D97706;
  color: #FFFFFF;
}

.hub-block-amber .block-title {
  color: #B45309;
}

.block-icon-box {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.block-content {
  flex: 1;
}

.block-number {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  opacity: 0.8;
  margin-bottom: 2px;
}

.block-title {
  font-size: 1.25rem;
  font-weight: 900;
  margin-bottom: 4px;
}

.block-desc {
  font-size: 0.82rem;
  color: #334155;
  font-weight: 500;
}

.block-arrow {
  font-size: 1.5rem;
  opacity: 0.7;
}

/* SUB-PANTALLA 1: EL ABECEDARIO (VOCALES Y CONSONANTES) */
.tabs-segmented {
  display: flex;
  background: #E2E8F0;
  padding: 4px;
  border-radius: var(--radius-md);
  gap: 4px;
  margin-bottom: 8px;
}

.tab-segmented-btn {
  flex: 1;
  padding: 10px 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: #475569;
  font-weight: 800;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.tab-segmented-btn.active {
  background: #FFFFFF;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.letter-selector-wrapper {
  width: 100%;
}

.vocales-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.consonantes-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  max-height: 190px;
  overflow-y: auto;
  padding: 4px 2px;
  background: #FFFFFF;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  -webkit-overflow-scrolling: touch;
}

.btn-letter,
.btn-vocal {
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  border: 3px solid transparent;
  background: #FFFFFF;
  font-size: 1.6rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
  color: #1E293B;
}

.btn-letter:active,
.btn-vocal:active {
  transform: scale(0.9);
}

.btn-letter.active,
.btn-vocal.selected {
  transform: scale(1.05);
  box-shadow: var(--shadow-lg);
  border-color: #0F172A;
  background: #EFF6FF;
  color: var(--primary);
}

.vocal-A { color: #DC2626; background: #FEE2E2; }
.vocal-E { color: #16A34A; background: #DCFCE7; }
.vocal-I { color: #9333EA; background: #F3E8FF; }
.vocal-O { color: #EA580C; background: #FFEDD5; }
.vocal-U { color: #0284C7; background: #E0F2FE; }

.vocal-display-card {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  border: 2px solid var(--border-color);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: var(--shadow-md);
  margin-top: 4px;
}

.vocal-huge-letter {
  font-size: 4.5rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 12px;
}

.vocal-emoji-container {
  width: 140px;
  height: 140px;
  background: #F8FAFC;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  margin-bottom: 16px;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.06);
  border: 4px dashed #CBD5E1;
  animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.vocal-word-title {
  font-size: 2rem;
  font-weight: 900;
  color: var(--text-main);
  margin-bottom: 6px;
}

.vocal-word-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 18px;
}

.btn-audio-repeat {
  background: #2563EB;
  color: #FFFFFF;
  border: none;
  font-size: 1.1rem;
  font-weight: 800;
  padding: 14px 28px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  transition: all 0.15s ease;
  width: 100%;
  justify-content: center;
}

.btn-audio-repeat:active {
  transform: scale(0.96);
  background: #1D4ED8;
}

/* SUB-PANTALLA: SÍLABAS DIRECTAS */
.section-intro-card {
  background: #FFFFFF;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}

.section-intro-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.silabas-consonants-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.silaba-consonant-chip {
  min-width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border-color);
  background: #F8FAFC;
  color: #1E293B;
  font-weight: 900;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.silaba-consonant-chip:active {
  transform: scale(0.92);
}

.silaba-consonant-chip.active {
  background: #7E22CE;
  color: #FFFFFF;
  border-color: #7E22CE;
  box-shadow: 0 4px 10px rgba(126, 34, 206, 0.35);
  transform: scale(1.06);
}

.silabas-action-card {
  background: #FAF5FF;
  border: 2px solid #E9D5FF;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.silabas-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.silaba-badge-current {
  width: 44px;
  height: 44px;
  background: #9333EA;
  color: #FFFFFF;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 900;
  box-shadow: var(--shadow-sm);
}

.silabas-title-header {
  font-size: 1.05rem;
  font-weight: 900;
  color: #581C87;
  line-height: 1.2;
}

.silabas-subtitle-header {
  font-size: 0.76rem;
  color: #7E22CE;
  font-weight: 600;
}

.btn-play-all-silabas {
  background: #9333EA;
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-full);
  padding: 9px 16px;
  font-weight: 800;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(147, 51, 234, 0.35);
  white-space: nowrap;
  transition: all 0.15s ease;
}

.btn-play-all-silabas:active {
  transform: scale(0.93);
  background: #7E22CE;
}

.silabas-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.silaba-item-card {
  background: #FFFFFF;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--shadow-sm);
}

.silaba-item-card:active {
  transform: scale(0.97);
}

.silaba-item-card.speaking {
  border-color: #9333EA;
  background: #FAF5FF;
  transform: scale(1.02);
  box-shadow: 0 6px 16px rgba(147, 51, 234, 0.25);
}

.silaba-big-tag {
  min-width: 66px;
  height: 54px;
  background: #F3E8FF;
  color: #7E22CE;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  font-weight: 900;
  letter-spacing: 0.5px;
  border: 2px solid #E9D5FF;
  flex-shrink: 0;
}

.silaba-item-body {
  flex: 1;
}

.silaba-item-word {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.silaba-item-prompt {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.silaba-speaker-icon {
  font-size: 1.3rem;
  color: #9333EA;
  opacity: 0.8;
}

/* SUB-PANTALLA: VOCABULARIO COTIDIANO */
.vocab-categories-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.vocab-tab-btn {
  background: #FFFFFF;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
}

.vocab-tab-btn span {
  font-size: 1.4rem;
}

.vocab-tab-btn:active {
  transform: scale(0.94);
}

.vocab-tab-btn.active {
  background: #FEF3C7;
  border-color: #F59E0B;
  color: #92400E;
  transform: scale(1.03);
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.25);
}

.vocab-header-banner {
  background: #FFFFFF;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 12px 16px;
  box-shadow: var(--shadow-sm);
}

.vocab-category-title {
  font-size: 1.15rem;
  font-weight: 900;
  color: #B45309;
  margin-bottom: 2px;
}

.vocab-category-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.vocab-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.vocab-card {
  background: #FFFFFF;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--shadow-sm);
  position: relative;
}

.vocab-card:active {
  transform: scale(0.95);
}

.vocab-card.speaking {
  border-color: #F59E0B;
  background: #FFFBEB;
  transform: scale(1.03);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

.vocab-card-emoji {
  font-size: 2.8rem;
  line-height: 1;
  margin-top: 2px;
}

.vocab-card-word {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--text-main);
  line-height: 1.2;
}

.vocab-card-phrase {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.25;
  font-weight: 600;
}

.vocab-card-speaker {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.95rem;
  opacity: 0.6;
}

/* SUB-PANTALLA 4: TRAZAR LETRAS */
.trace-group-selector {
  display: flex;
  background: #E2E8F0;
  padding: 4px;
  border-radius: var(--radius-sm);
  gap: 4px;
}

.btn-trace-mode {
  flex: 1;
  padding: 8px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-weight: 800;
  font-size: 0.88rem;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-trace-mode.active {
  background: #FFFFFF;
  color: #16A34A;
  box-shadow: var(--shadow-sm);
}
.trace-selector-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.btn-trace-nav {
  background: #FFFFFF;
  border: 2px solid var(--border-color);
  color: var(--text-main);
  font-size: 1.1rem;
  font-weight: 800;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-trace-nav:active {
  background: #F1F5F9;
}

.trace-pills {
  display: flex;
  gap: 6px;
}

.trace-pill {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: #FFFFFF;
  border: 2px solid var(--border-color);
  font-weight: 800;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.trace-pill.active {
  background: #16A34A;
  color: #FFFFFF;
  border-color: #16A34A;
  box-shadow: 0 2px 6px rgba(22, 163, 74, 0.35);
}

.blackboard-frame {
  background: #0F172A;
  border: 6px solid #475569;
  border-radius: var(--radius-lg);
  padding: 8px;
  position: relative;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
}

#traceCanvas {
  background: #1E293B;
  border-radius: var(--radius-md);
  width: 100%;
  height: 290px;
  touch-action: none;
  cursor: crosshair;
}

.trace-instruction-tag {
  margin-top: 8px;
  color: #94A3B8;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.trace-actions-row {
  display: flex;
  gap: 12px;
  width: 100%;
}

.btn-trace-clear {
  flex: 1;
  background: #FFFFFF;
  color: #DC2626;
  border: 2px solid #FCA5A5;
  font-size: 1.05rem;
  font-weight: 800;
  padding: 14px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.btn-trace-clear:active {
  transform: scale(0.96);
  background: #FEE2E2;
}

.btn-trace-listen {
  flex: 1;
  background: #16A34A;
  color: #FFFFFF;
  border: none;
  font-size: 1.05rem;
  font-weight: 800;
  padding: 14px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(22, 163, 74, 0.3);
}

.btn-trace-listen:active {
  transform: scale(0.96);
  background: #15803D;
}

/* SUB-PANTALLA 3: PRIMERAS PALABRAS */
.quiz-header-card {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  border: 2px solid var(--border-color);
  padding: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}

.quiz-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}

.stars-container {
  display: flex;
  gap: 4px;
  font-size: 1.1rem;
}

.quiz-speaker-main {
  background: linear-gradient(135deg, #EA580C, #C2410C);
  color: #FFFFFF;
  border: none;
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.6rem;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(234, 88, 12, 0.4);
  transition: all 0.15s ease;
  animation: pulse-speaker 2s infinite;
}

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

.quiz-speaker-main:active {
  transform: scale(0.92);
}

.quiz-prompt-text {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--text-main);
}

.quiz-options-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quiz-option-card {
  background: #FFFFFF;
  border: 3px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 18px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--shadow-sm);
}

.quiz-option-card:active {
  transform: scale(0.96);
}

.quiz-option-card.correct {
  border-color: #22C55E !important;
  background: #DCFCE7 !important;
  transform: scale(1.02);
  animation: bounceCorrect 0.5s;
}

@keyframes bounceCorrect {
  0%, 100% { transform: scale(1.02); }
  50% { transform: scale(1.08); }
}

.quiz-option-card.wrong {
  border-color: #EF4444 !important;
  background: #FEE2E2 !important;
  animation: shakeWrong 0.4s;
}

@keyframes shakeWrong {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.quiz-option-emoji {
  font-size: 3.2rem;
  width: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F8FAFC;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.quiz-option-label {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text-main);
}

/* Modal / Toast informativo */
.toast-msg {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #1E293B;
  color: #FFFFFF;
  padding: 12px 22px;
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  font-weight: 700;
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 100;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  white-space: nowrap;
}

.toast-msg.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Efecto confetti/estrellas */
.celebrate-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  opacity: 0;
  transition: opacity 0.3s;
}

.celebrate-overlay.show {
  opacity: 1;
  animation: zoomStar 0.8s ease-out forwards;
}

@keyframes zoomStar {
  0% { transform: scale(0.2); opacity: 0; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(1); opacity: 0; }
}

/* Clases de utilidad */
.hidden {
  display: none !important;
}
