:root {
  --bg-sky: #f0f9ff;
  --bg-gradient: linear-gradient(180deg, #dff3ff 0%, #fff9eb 55%, #fef2f8 100%);
  --ink: #1e293b;
  --muted: #64748b;
  --card-bg: #ffffff;
  --radius-lg: 24px;
  --radius-md: 16px;
  --shadow-card: 0 8px 0 rgba(30, 41, 59, 0.08), 0 14px 24px rgba(30, 41, 59, 0.08);
  --font-display: 'Fredoka', 'Comic Sans MS', 'Trebuchet MS', sans-serif;
  --font-body: 'Nunito', 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background: var(--bg-gradient);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Fondo decorativo */
.sky-decor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.cloud,
.star-float {
  position: absolute;
  opacity: 0.45;
  animation: floatSlow 7s ease-in-out infinite;
}

.cloud-1 { top: 4%; left: 4%; font-size: 3.5rem; }
.cloud-2 { top: 10%; right: 6%; font-size: 4rem; animation-delay: 2s; }
.star-1 { top: 28%; left: 2%; font-size: 2rem; animation-delay: 1s; }
.star-2 { bottom: 18%; right: 3%; font-size: 2.2rem; animation-delay: 3s; }
.star-3 { bottom: 6%; left: 6%; font-size: 2.5rem; animation-delay: 1.5s; }

@keyframes floatSlow {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

/* Header */
.app-header {
  position: relative;
  z-index: 2;
  padding: 24px 20px 10px;
}

.header-inner {
  max-width: 1220px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border: 3px solid #ffffff;
  border-radius: 28px;
  padding: 20px 26px;
  box-shadow: 0 10px 30px rgba(25, 130, 196, 0.12);
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.brand-badge {
  background: linear-gradient(135deg, #ff595e, #ff924c);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  padding: 12px 18px;
  border-radius: 20px;
  box-shadow: 0 5px 0 #d9383d;
}

.brand h1 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  color: #1e293b;
  line-height: 1.1;
}

.subtitle {
  color: var(--muted);
  font-weight: 700;
  margin-top: 4px;
  font-size: 0.98rem;
}

.controls-bar {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-group,
.action-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pill-btn,
.action-btn {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  border: 2px solid #e2e8f0;
  background: #f8fafc;
  color: var(--ink);
  padding: 9px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
  box-shadow: 0 4px 0 #cbd5e1;
}

.pill-btn:hover,
.action-btn:hover {
  transform: translateY(-2px);
}

.pill-btn:active,
.action-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #cbd5e1;
}

.pill-btn.active {
  background: #3a86ff;
  color: #fff;
  border-color: #2563eb;
  box-shadow: 0 4px 0 #1d4ed8;
}

.game-btn {
  background: #ffca3a;
  border-color: #eab308;
  box-shadow: 0 4px 0 #ca8a04;
}

.sound-btn {
  background: #8ac926;
  color: #fff;
  border-color: #65a30d;
  box-shadow: 0 4px 0 #4d7c0f;
}

.sound-btn[aria-pressed='false'] {
  background: #94a3b8;
  border-color: #64748b;
  box-shadow: 0 4px 0 #475569;
}

/* Grid del Abecedario */
.main-content {
  position: relative;
  z-index: 2;
  max-width: 1220px;
  margin: 22px auto 40px;
  padding: 0 20px;
}

.alphabet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 18px;
}

.letter-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 16px 14px 14px;
  border: 3px solid var(--card-color, #3a86ff);
  box-shadow: 0 7px 0 var(--card-color, #3a86ff), 0 12px 22px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.16s ease;
  position: relative;
  overflow: hidden;
}

.letter-card:hover,
.letter-card:focus-visible {
  transform: translateY(-6px) scale(1.02);
  outline: none;
}

.letter-card:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 var(--card-color, #3a86ff);
}

.card-type-dot {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--card-accent, #eff6ff);
  color: var(--ink);
}

.card-letter {
  font-family: var(--font-display);
  font-size: 3.1rem;
  font-weight: 700;
  color: var(--card-color, #3a86ff);
  line-height: 1.05;
  margin-top: 6px;
}

.card-icons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 8px 0 6px;
  background: var(--card-accent, #f8fafc);
  padding: 8px 14px;
  border-radius: 16px;
  width: 100%;
}

.card-main-emoji {
  font-size: 2.2rem;
  line-height: 1;
}

.card-sub-emojis {
  display: flex;
  gap: 4px;
  font-size: 1.2rem;
  opacity: 0.9;
}

.card-word {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--ink);
}

.card-syl-preview {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--muted);
  margin-top: 3px;
  letter-spacing: 0.03em;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(5px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  background: #ffffff;
  width: 100%;
  max-width: 920px;
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 30px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.3);
  position: relative;
  animation: popIn 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.close-btn:hover {
  transform: scale(1.08);
}

.modal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 24px 20px;
  background: var(--modal-accent, #ffe5e6);
  border-bottom: 3px solid rgba(30, 41, 59, 0.08);
}

.nav-arrow {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid rgba(30, 41, 59, 0.12);
  background: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(30, 41, 59, 0.12);
}

.nav-arrow:active {
  transform: translateY(2px);
}

.modal-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-letter-badge {
  width: 112px;
  height: 112px;
  border-radius: 26px;
  background: #ffffff;
  border: 4px solid var(--modal-color, #ff595e);
  box-shadow: 0 7px 0 var(--modal-color, #ff595e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 3.4rem;
  font-weight: 700;
  color: var(--modal-color, #ff595e);
}

.hero-info {
  max-width: 460px;
}

.hero-badges {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}

.type-badge,
.name-badge {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
}

.hero-info h2 {
  font-family: var(--font-display);
  font-size: 1.85rem;
}

.sound-hint {
  font-weight: 700;
  color: #334155;
  margin: 4px 0 10px;
}

.speak-pill {
  font-family: var(--font-display);
  font-size: 0.96rem;
  background: #3a86ff;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 0 #1d4ed8;
}

.speak-pill:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #1d4ed8;
}

/* Tabs */
.modal-tabs {
  display: flex;
  gap: 8px;
  padding: 14px 22px 0;
  border-bottom: 2px solid #f1f5f9;
  flex-wrap: wrap;
}

.tab-btn {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 600;
  background: #f1f5f9;
  color: var(--muted);
  border: none;
  padding: 10px 18px;
  border-radius: 14px 14px 0 0;
  cursor: pointer;
}

.tab-btn.active {
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 -3px 0 var(--modal-color, #3a86ff) inset;
}

.tab-panel {
  display: none;
  padding: 22px;
}

.tab-panel.active {
  display: block;
}

/* Sílabas */
.syllables-section {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 20px;
  padding: 16px 18px;
  margin-bottom: 20px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.section-head h3 {
  font-family: var(--font-display);
  font-size: 1.18rem;
}

.hint-small {
  font-size: 0.84rem;
  color: var(--muted);
  font-weight: 700;
}

.syllables-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.syl-pill {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  min-width: 72px;
  padding: 10px 16px;
  border-radius: 16px;
  background: #ffffff;
  border: 2px solid var(--modal-color, #3a86ff);
  color: var(--ink);
  box-shadow: 0 4px 0 var(--modal-color, #3a86ff);
  cursor: pointer;
  transition: transform 0.12s ease;
}

.syl-pill:hover {
  transform: translateY(-2px);
}

.syl-pill:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--modal-color, #3a86ff);
}

.syllable-words-row {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.syl-word-chip {
  font-size: 0.88rem;
  font-weight: 800;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  padding: 4px 12px;
  border-radius: 999px;
  color: #334155;
}

/* Trio Animal / Cosa / Objeto */
.trio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.discovery-card {
  border-radius: 20px;
  padding: 16px;
  border: 2px solid #e2e8f0;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
}

.animal-card { background: #fff7ed; border-color: #fed7aa; }
.cosa-card { background: #f0f9ff; border-color: #bae6fd; }
.objeto-card { background: #fdf4ff; border-color: #f5d0fe; }

.card-tag {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  margin-bottom: 8px;
}

.card-emoji {
  font-size: 3.4rem;
  line-height: 1.1;
  margin: 4px 0;
}

.discovery-card h4 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-bottom: 4px;
}

.discovery-card p {
  font-size: 0.92rem;
  color: #475569;
  line-height: 1.35;
  margin-bottom: 12px;
  flex: 1;
}

.mini-speak {
  font-family: var(--font-display);
  font-size: 0.86rem;
  border: 1.5px solid #cbd5e1;
  background: #fff;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.mini-speak:hover {
  background: #f8fafc;
}

.fun-fact-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fefce8;
  border: 2px solid #fde047;
  border-radius: 18px;
  padding: 14px 16px;
}

.fact-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}

.fun-fact-text {
  flex: 1;
}

.fun-fact-box p {
  margin-top: 2px;
  color: #475569;
  font-weight: 600;
}

.fact-speak-btn {
  flex-shrink: 0;
  margin-left: auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #eab308;
  background: #ffffff;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 0 #eab308;
  transition: transform 0.12s ease;
}

.fact-speak-btn:hover {
  transform: scale(1.06);
}

.fact-speak-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #eab308;
}

/* Pizarra de trazo */
.trace-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.crayon-palette {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}

.crayon-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px #cbd5e1;
  cursor: pointer;
}

.crayon-btn.active {
  box-shadow: 0 0 0 3px #1e293b;
  transform: scale(1.12);
}

.clear-btn {
  font-family: var(--font-display);
  padding: 8px 14px;
  border-radius: 12px;
  border: 2px solid #cbd5e1;
  background: #f8fafc;
  cursor: pointer;
  font-weight: 600;
}

.trace-canvas-wrap {
  background: #fffdf7;
  border: 3px dashed #cbd5e1;
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  justify-content: center;
}

#trace-canvas {
  width: 100%;
  max-width: 680px;
  height: auto;
  touch-action: none;
  cursor: crosshair;
}

.trace-tip {
  text-align: center;
  margin-top: 10px;
  color: var(--muted);
  font-weight: 700;
}

.trace-mode-bar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.trace-mode-btn {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 999px;
  border: 2px solid #cbd5e1;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 3px 0 #cbd5e1;
  transition: transform 0.12s ease;
}

.trace-mode-btn:hover {
  transform: translateY(-2px);
}

.trace-mode-btn.active {
  background: #3a86ff;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 3px 0 #1d4ed8;
}

/* Hoja A4 Print Tab */
.print-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 22px;
  align-items: start;
}

@media (max-width: 780px) {
  .print-layout {
    grid-template-columns: 1fr;
  }
}

.print-info h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin-bottom: 8px;
}

.print-info p,
.print-info li {
  color: #475569;
  line-height: 1.5;
  font-weight: 600;
}

.print-info ul {
  margin: 10px 0 18px 20px;
}

.print-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.download-btn,
.print-btn {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 700;
  padding: 14px 20px;
  border-radius: 16px;
  border: none;
  cursor: pointer;
  text-align: center;
}

.download-btn {
  background: #06d6a0;
  color: #064e3b;
  box-shadow: 0 5px 0 #059669;
}

.print-btn {
  background: #3a86ff;
  color: #ffffff;
  box-shadow: 0 5px 0 #1d4ed8;
}

.download-btn:active,
.print-btn:active {
  transform: translateY(2px);
}

.print-preview-wrap {
  background: #e2e8f0;
  padding: 12px;
  border-radius: 18px;
  display: flex;
  justify-content: center;
}

#a4-preview-canvas {
  width: 100%;
  max-width: 320px;
  height: auto;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
}

/* Mini-Juego */
.game-card {
  max-width: 560px;
  padding: 28px 24px;
  text-align: center;
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-right: 36px;
}

.game-badge,
.score-badge {
  background: #fef9c3;
  border: 2px solid #facc15;
  padding: 5px 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.9rem;
}

.game-prompt {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 10px 0 12px;
  color: #1e293b;
}

.game-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin: 20px 0 14px;
}

.game-opt-btn {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  padding: 18px;
  border-radius: 20px;
  border: 3px solid #cbd5e1;
  background: #f8fafc;
  cursor: pointer;
  box-shadow: 0 5px 0 #cbd5e1;
  transition: transform 0.12s ease;
}

.game-opt-btn:hover {
  transform: translateY(-2px);
}

.game-opt-btn.correct {
  background: #dcfce7;
  border-color: #22c55e;
  box-shadow: 0 5px 0 #16a34a;
}

.game-opt-btn.wrong {
  background: #fee2e2;
  border-color: #ef4444;
  box-shadow: 0 5px 0 #dc2626;
}

.game-feedback {
  font-family: var(--font-display);
  font-size: 1.15rem;
  min-height: 28px;
  margin-bottom: 10px;
}

.hidden {
  display: none !important;
}

.app-footer {
  text-align: center;
  padding: 18px;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.92rem;
}

/* Pupiletras */
.pupi-btn {
  background: #9b5de5;
  color: #ffffff;
  border-color: #7c3aed;
  box-shadow: 0 4px 0 #5b21b6;
}

.pupi-card {
  max-width: 960px;
  padding: 24px;
}

.pupi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-right: 40px;
  margin-bottom: 14px;
}

.pupi-header h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin-top: 6px;
}

.pupi-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  background: #f8fafc;
  padding: 12px 14px;
  border-radius: 18px;
  border: 2px solid #e2e8f0;
  margin-bottom: 18px;
}

.pupi-diff-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pupi-diff-btn {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  border: 2px solid #cbd5e1;
  background: #ffffff;
  cursor: pointer;
  box-shadow: 0 3px 0 #cbd5e1;
}

.pupi-diff-btn.active {
  background: #06d6a0;
  color: #064e3b;
  border-color: #059669;
  box-shadow: 0 3px 0 #047857;
}

.pupi-body {
  display: grid;
  grid-template-columns: 1fr 270px;
  gap: 20px;
  align-items: start;
}

@media (max-width: 820px) {
  .pupi-body {
    grid-template-columns: 1fr;
  }
}

.pupi-board-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pupi-grid {
  display: grid;
  gap: 5px;
  padding: 12px;
  background: #eff6ff;
  border: 3px solid #93c5fd;
  border-radius: 20px;
  user-select: none;
  touch-action: none;
  width: 100%;
  max-width: 520px;
}

.pupi-cell {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(0.9rem, 2.4vw, 1.35rem);
  background: #ffffff;
  border: 2px solid #dbeafe;
  border-radius: 10px;
  color: #1e293b;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.12s ease;
}

.pupi-cell.selecting {
  background: #fde047;
  border-color: #eab308;
  transform: scale(1.06);
}

.pupi-cell.found {
  color: #1e293b;
  border-color: rgba(30, 41, 59, 0.25);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.08);
}

.pupi-hint {
  margin-top: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
}

.pupi-sidebar {
  background: #fffbeb;
  border: 2px solid #fde68a;
  border-radius: 20px;
  padding: 16px;
}

.pupi-sidebar h3 {
  font-family: var(--font-display);
  font-size: 1.12rem;
  margin-bottom: 12px;
}

.pupi-word-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pupi-word-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.pupi-word-chip.found {
  text-decoration: line-through;
  opacity: 0.68;
  transform: scale(0.98);
}

.pupi-win-banner {
  margin-top: 14px;
  padding: 12px;
  border-radius: 14px;
  background: #dcfce7;
  border: 2px solid #22c55e;
  color: #14532d;
  font-family: var(--font-display);
  font-weight: 700;
  text-align: center;
  animation: popIn 0.25s ease;
}

/* Popup Completar Palabra por Sílaba */
.syl-popup-card {
  max-width: 600px;
  padding: 28px 24px;
  text-align: center;
}

.syl-popup-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding-right: 32px;
}

.syl-popup-word {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #1e293b;
  background: #eff6ff;
  border: 3px solid #93c5fd;
  border-radius: 20px;
  padding: 12px 22px;
  display: inline-block;
  margin: 6px 0 10px;
}

.syl-popup-sub {
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 16px;
}

.syl-popup-slots {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  outline: none;
}

.syl-slot {
  width: 52px;
  height: 60px;
  border-radius: 14px;
  border: 3px solid #cbd5e1;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 700;
  color: #94a3b8;
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
}

.syl-slot.current {
  border-color: #3a86ff;
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(58, 134, 255, 0.2);
  transform: translateY(-2px);
}

.syl-slot.filled {
  border-color: #22c55e;
  background: #dcfce7;
  color: #15803d;
  box-shadow: 0 4px 0 #16a34a;
}

.syl-slot.shake {
  animation: slotShake 0.28s ease;
  border-color: #ef4444;
  background: #fee2e2;
  color: #b91c1c;
}

@keyframes slotShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.syl-popup-hidden-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

/* Mini-Juego de Oraciones en Burbujas */
.bubble-game-btn {
  background: #00bbf9;
  color: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 4px 0 #0369a1;
}

.sent-card {
  max-width: 650px;
  padding: 28px 24px;
  text-align: center;
}

.sent-card h2 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  margin: 6px 0 12px;
}

.sent-display {
  margin: 22px 0;
  padding: 20px 18px;
  background: #f8fafc;
  border: 3px solid #e2e8f0;
  border-radius: 22px;
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 3vw, 1.75rem);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.sent-blank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 115px;
  padding: 4px 16px;
  border-radius: 14px;
  border: 3px dashed #3a86ff;
  background: #eff6ff;
  color: #3a86ff;
  font-weight: 700;
  transition: all 0.22s ease;
}

.sent-blank.correct {
  border-style: solid;
  border-color: #16a34a;
  background: #dcfce7;
  color: #15803d;
  box-shadow: 0 4px 0 #16a34a;
  animation: popIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sent-blank.wrong {
  border-style: solid;
  border-color: #dc2626;
  background: #fee2e2;
  color: #b91c1c;
  animation: slotShake 0.3s ease;
}

.sent-bubbles {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 34px;
  min-height: 155px;
  margin: 10px 0 14px;
  flex-wrap: wrap;
}

.word-bubble {
  position: relative;
  min-width: 145px;
  height: 145px;
  padding: 0 22px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.9);
  background: radial-gradient(circle at 30% 28%, #ffffff 0%, #bae6fd 35%, #38bdf8 85%, #0284c7 100%);
  box-shadow: inset -6px -8px 14px rgba(2, 132, 199, 0.28), 0 12px 24px rgba(14, 165, 233, 0.28);
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  color: #0c4a6e;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: bubbleFloat 3.2s ease-in-out infinite;
  transition: transform 0.14s ease;
}

.word-bubble:nth-child(2) {
  background: radial-gradient(circle at 30% 28%, #ffffff 0%, #fbcfe8 35%, #f472b6 85%, #db2777 100%);
  box-shadow: inset -6px -8px 14px rgba(219, 39, 119, 0.28), 0 12px 24px rgba(244, 114, 182, 0.28);
  color: #831843;
  animation-delay: 0.7s;
}

.word-bubble::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 26px;
  width: 30px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  transform: rotate(-28deg);
  pointer-events: none;
}

.word-bubble:hover:not(.popping) {
  transform: scale(1.07);
}

.word-bubble.popping {
  pointer-events: none;
  animation: bubbleBurst 0.38s ease-out forwards;
}

.word-bubble.popping::after {
  content: '💥';
  position: absolute;
  font-size: 2.6rem;
  animation: sparkFade 0.38s ease-out forwards;
}

@keyframes bubbleFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

@keyframes bubbleBurst {
  0% { transform: scale(1); opacity: 1; }
  45% { transform: scale(1.32); opacity: 0.7; }
  100% { transform: scale(1.65); opacity: 0; }
}

@keyframes sparkFade {
  0% { transform: scale(0.4); opacity: 1; }
  100% { transform: scale(1.4); opacity: 0; }
}

.sent-feedback-ok {
  color: #15803d;
}

.sent-feedback-err {
  color: #dc2626;
}

/* Mini-Juego: Emparejar Imagen y Palabra */
.match-game-btn {
  background: #f15bb5;
  color: #ffffff;
  border-color: #db2777;
  box-shadow: 0 4px 0 #be185d;
}

.match-card {
  max-width: 720px;
  padding: 28px 24px;
  text-align: center;
}

.match-card h2 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  margin: 6px 0 18px;
}

.match-board {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.match-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.match-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.match-img-box {
  width: 100%;
  height: 120px;
  border-radius: 20px;
  border: 3px solid #bae6fd;
  background: #f0f9ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4.2rem;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06);
  user-select: none;
}

.match-dropzone {
  width: 100%;
  height: 60px;
  border-radius: 14px;
  border: 3px dashed #94a3b8;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: #94a3b8;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.match-dropzone.drag-over {
  border-color: #3a86ff;
  background: #eff6ff;
  transform: scale(1.03);
}

.match-dropzone.filled {
  border-style: solid;
  border-color: #16a34a;
  background: #dcfce7;
  color: #15803d;
  box-shadow: 0 4px 0 #16a34a;
  animation: popIn 0.22s ease;
}

.match-dropzone.wrong {
  border-style: solid;
  border-color: #dc2626;
  background: #fee2e2;
  color: #b91c1c;
  animation: slotShake 0.3s ease;
}

.match-words-tray {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding-top: 8px;
}

.match-word-slot {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.match-word-box {
  width: 100%;
  height: 58px;
  border-radius: 14px;
  border: 3px solid #3a86ff;
  background: #ffffff;
  box-shadow: 0 5px 0 #2563eb;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  user-select: none;
  touch-action: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.match-word-box:hover {
  transform: translateY(-2px);
}

.match-word-box.dragging {
  position: fixed;
  z-index: 200;
  cursor: grabbing;
  pointer-events: none;
  transform: scale(1.06);
  box-shadow: 0 14px 28px rgba(30, 41, 59, 0.24);
}

.match-word-box.placed {
  visibility: hidden;
  pointer-events: none;
}

@media (max-width: 560px) {
  .match-columns,
  .match-words-tray {
    gap: 10px;
  }
  .match-img-box {
    height: 96px;
    font-size: 3.2rem;
  }
  .match-word-box,
  .match-dropzone {
    font-size: 1rem;
  }
}

/* Hub de Mini-Juegos */
.hub-btn {
  background: linear-gradient(135deg, #ffca3a, #ff924c);
  color: #1e293b;
  border-color: #eab308;
  box-shadow: 0 4px 0 #ca8a04;
}

.hub-modal-card {
  max-width: 960px;
  padding: 28px 24px;
  text-align: center;
}

.hub-header h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  margin-top: 8px;
}

.hub-sub {
  color: var(--muted);
  font-weight: 700;
  margin: 4px 0 18px;
}

.games-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 14px;
}

.hub-game-card {
  background: #ffffff;
  border: 3px solid var(--hub-c, #3a86ff);
  box-shadow: 0 6px 0 var(--hub-c, #3a86ff), 0 10px 18px rgba(15, 23, 42, 0.06);
  border-radius: 20px;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 5px;
  cursor: pointer;
  transition: transform 0.14s ease;
}

.hub-game-card:hover {
  transform: translateY(-4px) scale(1.02);
}

.hub-game-card:active {
  transform: translateY(2px);
}

.hub-emoji {
  font-size: 2.4rem;
  line-height: 1.1;
}

.hub-game-card strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--ink);
}

.hub-game-card small {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  line-height: 1.25;
}

/* Modal Compartido de los 7 Nuevos Juegos */
.arcade-card {
  max-width: 720px;
  padding: 28px 24px;
  text-align: center;
}

.arcade-card h2 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  margin: 6px 0 16px;
}

.arcade-stage {
  margin-bottom: 14px;
}

/* 1. Memorama */
.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  max-width: 520px;
  margin: 0 auto;
}

.memory-card {
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  border: 3px solid #93c5fd;
  background: linear-gradient(135deg, #3a86ff, #60a5fa);
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 5px 0 #2563eb;
  transition: transform 0.14s ease, background 0.14s ease;
}

.memory-card.flipped {
  background: #ffffff;
  color: var(--ink);
  border-color: #fbbf24;
  box-shadow: 0 5px 0 #d97706;
}

.memory-card.matched {
  background: #dcfce7;
  color: #15803d;
  border-color: #22c55e;
  box-shadow: 0 4px 0 #16a34a;
  cursor: default;
}

/* 2. Tren del Abecedario */
.train-track {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 20px;
}

.train-engine {
  font-size: 2.5rem;
  margin-right: 4px;
}

.train-car {
  width: 62px;
  height: 62px;
  border-radius: 14px;
  border: 3px solid #8ac926;
  background: #f0f9e2;
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 0 #65a30d;
}

.train-car.blank {
  border-style: dashed;
  border-color: #3a86ff;
  background: #eff6ff;
  color: #3a86ff;
  box-shadow: none;
}

.train-car.filled {
  border-style: solid;
  border-color: #16a34a;
  background: #dcfce7;
  color: #15803d;
}

.train-choices {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* 3. ¿Con qué sílaba empieza? & 7. Descubre */
.syl-quiz-hero {
  font-size: 4.5rem;
  line-height: 1.1;
  margin: 6px 0;
}

.syl-quiz-word {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 14px;
}

.syl-quiz-opts {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.arcade-opt-btn {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  min-width: 96px;
  padding: 14px 22px;
  border-radius: 18px;
  border: 3px solid #cbd5e1;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 5px 0 #cbd5e1;
  transition: transform 0.12s ease;
}

.arcade-opt-btn:hover {
  transform: translateY(-2px);
}

.arcade-opt-btn.correct {
  background: #dcfce7;
  border-color: #22c55e;
  box-shadow: 0 5px 0 #16a34a;
}

.arcade-opt-btn.wrong {
  background: #fee2e2;
  border-color: #ef4444;
  box-shadow: 0 5px 0 #dc2626;
}

/* 4. Explota la Letra */
.pop-target-bar {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.pop-arena {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  max-width: 480px;
  margin: 0 auto;
  padding: 14px;
  background: #f0f9ff;
  border: 3px solid #bae6fd;
  border-radius: 22px;
}

.pop-bubble {
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 3px solid #ffffff;
  background: radial-gradient(circle at 30% 30%, #ffffff 0%, #bae6fd 40%, #38bdf8 95%);
  box-shadow: 0 6px 14px rgba(14, 165, 233, 0.25);
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  color: #0c4a6e;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease;
}

.pop-bubble:hover {
  transform: scale(1.07);
}

.pop-bubble.popped-ok {
  background: #dcfce7;
  color: #15803d;
  border-color: #22c55e;
  transform: scale(0.9);
  opacity: 0.45;
  pointer-events: none;
}

.pop-bubble.popped-bad {
  background: #fee2e2;
  color: #dc2626;
  border-color: #ef4444;
  animation: slotShake 0.25s ease;
}

/* 5. Arma la Palabra */
.build-slots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 14px 0 18px;
  flex-wrap: wrap;
}

.build-slot {
  min-width: 72px;
  height: 56px;
  padding: 0 14px;
  border-radius: 14px;
  border: 3px dashed #3a86ff;
  background: #eff6ff;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  color: #3a86ff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.build-slot.filled {
  border-style: solid;
  border-color: #16a34a;
  background: #dcfce7;
  color: #15803d;
}

/* 6. Vocales vs Consonantes */
.vc-letter-card {
  width: 112px;
  height: 112px;
  margin: 10px auto 20px;
  border-radius: 26px;
  border: 4px solid #8338ec;
  background: #f5f3ff;
  font-family: var(--font-display);
  font-size: 3.4rem;
  font-weight: 700;
  color: #6d28d9;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 7px 0 #7c3aed;
}

.baskets-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: 460px;
  margin: 0 auto;
}

.basket-box {
  padding: 18px 14px;
  border-radius: 20px;
  border: 3px solid #fbbf24;
  background: #fffbeb;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 5px 0 #d97706;
}

.basket-box.cons {
  border-color: #38bdf8;
  background: #f0f9ff;
  box-shadow: 0 5px 0 #0284c7;
}

/* 7. Descubre el Dibujo */
.reveal-wrap {
  position: relative;
  width: 210px;
  height: 210px;
  margin: 0 auto 16px;
  border-radius: 22px;
  border: 3px solid #f77f00;
  background: #fff7ed;
  overflow: hidden;
}

.reveal-emoji-bg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 6.5rem;
  user-select: none;
}

.reveal-grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
}

.reveal-tile {
  background: #ff9f1c;
  border: 1.5px solid #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.reveal-tile.open {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8);
}

/* Check de letras vistas / realizadas */
.progress-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #dcfce7;
  border: 2px solid #22c55e;
  border-radius: 999px;
  padding: 5px 10px 5px 14px;
  font-family: var(--font-display);
  font-weight: 700;
  color: #15803d;
  box-shadow: 0 3px 0 #16a34a;
}

.reset-progress-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: #ffffff;
  cursor: pointer;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
}

.reset-progress-btn:hover {
  transform: rotate(30deg);
}

.card-check-btn {
  position: absolute;
  top: 9px;
  left: 9px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2.5px solid #cbd5e1;
  background: #ffffff;
  color: #cbd5e1;
  font-size: 1rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: transform 0.14s ease, background 0.14s ease, border-color 0.14s ease;
}

.card-check-btn:hover {
  transform: scale(1.1);
  border-color: #22c55e;
}

.card-check-btn.checked {
  background: #22c55e;
  border-color: #16a34a;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(34, 197, 94, 0.4);
}

.hero-actions-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.seen-toggle-btn {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 999px;
  border: 2px solid #cbd5e1;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 3px 0 #cbd5e1;
}

.seen-toggle-btn.checked {
  background: #dcfce7;
  border-color: #22c55e;
  color: #15803d;
  box-shadow: 0 3px 0 #16a34a;
}

/* Pantalla de Login Infantil */
.login-screen {
  position: relative;
  z-index: 5;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.login-card {
  width: 100%;
  max-width: 460px;
  background: rgba(255, 255, 255, 0.96);
  border: 4px solid #ffffff;
  border-radius: 32px;
  padding: 32px 28px;
  text-align: center;
  box-shadow: 0 12px 0 rgba(58, 134, 255, 0.16), 0 24px 50px rgba(15, 23, 42, 0.14);
  animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.login-mascot {
  font-size: 3.1rem;
  letter-spacing: 6px;
  margin-bottom: 8px;
  animation: floatSlow 3.5s ease-in-out infinite;
}

.login-card h1 {
  font-family: var(--font-display);
  font-size: 1.95rem;
  color: #1e293b;
}

.login-sub {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.96rem;
  margin: 6px 0 18px;
}

.login-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: #f1f5f9;
  padding: 5px;
  border-radius: 16px;
  margin-bottom: 18px;
}

.login-mode-btn {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 9px 12px;
  border-radius: 12px;
  cursor: pointer;
}

.login-mode-btn.active {
  background: #ffffff;
  color: #1e293b;
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.08);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}

.input-group label {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.98rem;
  margin-bottom: 6px;
  color: #334155;
}

.input-group input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1.08rem;
  font-weight: 700;
  padding: 12px 16px;
  border-radius: 16px;
  border: 2.5px solid #cbd5e1;
  background: #f8fafc;
  color: #1e293b;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.input-group input:focus {
  border-color: #3a86ff;
  background: #ffffff;
}

.password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrap input {
  padding-right: 48px;
}

.toggle-pass-btn {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
}

.login-error {
  background: #fee2e2;
  border: 2px solid #ef4444;
  color: #b91c1c;
  font-weight: 800;
  font-size: 0.92rem;
  padding: 10px 14px;
  border-radius: 14px;
  text-align: center;
}

.login-submit-btn {
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  padding: 14px;
  border-radius: 18px;
  border: none;
  background: linear-gradient(135deg, #06d6a0, #1982c4);
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 5px 0 #0f766e;
  transition: transform 0.12s ease;
}

.login-submit-btn:hover {
  transform: translateY(-2px);
}

.login-submit-btn:active {
  transform: translateY(2px);
}

.login-hint-box {
  margin-top: 18px;
  background: #fef9c3;
  border: 2px dashed #eab308;
  border-radius: 14px;
  padding: 10px 14px;
  font-size: 0.88rem;
  color: #713f12;
  font-weight: 700;
}

.login-hint-box code {
  background: #ffffff;
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 800;
}

.user-greeting {
  font-family: var(--font-display);
  font-size: 0.95rem;
  background: #eff6ff;
  border: 2px solid #93c5fd;
  color: #1e40af;
  padding: 7px 14px;
  border-radius: 999px;
}

.logout-btn {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
  box-shadow: 0 4px 0 #ef4444;
}

/* Popup de Progreso y Puntos */
.progress-pill-btn {
  border: none;
  background: transparent;
  font-family: var(--font-display);
  font-size: 0.96rem;
  font-weight: 700;
  color: #15803d;
  cursor: pointer;
}

.progress-pill-btn:hover {
  text-decoration: underline;
}

.progress-modal-card {
  max-width: 820px;
  padding: 28px 24px;
  text-align: center;
}

.progress-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 14px;
  margin: 16px 0 20px;
}

.summary-stat-card {
  border-radius: 20px;
  padding: 16px 12px;
  border: 3px solid #e2e8f0;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-points {
  background: #fefce8;
  border-color: #facc15;
}

.stat-explored {
  background: #eff6ff;
  border-color: #60a5fa;
}

.stat-level {
  background: #f0fdf4;
  border-color: #4ade80;
}

.stat-icon {
  font-size: 2rem;
}

.summary-stat-card strong {
  font-family: var(--font-display);
  font-size: 1.65rem;
  color: var(--ink);
}

.summary-stat-card small {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--muted);
}

.progress-bar-section {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 20px;
  padding: 14px 16px;
  margin-bottom: 18px;
}

.progress-bar-head {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-display);
  font-weight: 700;
  margin-bottom: 8px;
}

.progress-bar-track {
  width: 100%;
  height: 18px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 14px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #06d6a0, #3a86ff);
  border-radius: 999px;
  transition: width 0.35s ease;
}

.prog-letters-map {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.prog-letter-dot {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #ffffff;
  border: 2px solid #cbd5e1;
  color: #94a3b8;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.prog-letter-dot.done {
  background: #dcfce7;
  border-color: #22c55e;
  color: #15803d;
}

.progress-games-section h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 12px;
}

.prog-games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
  text-align: left;
}

.prog-game-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  font-weight: 700;
}

.prog-game-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  color: var(--ink);
  line-height: 1.2;
}

.prog-game-pts {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: 0.98rem;
  background: #fef9c3;
  border: 1.5px solid #facc15;
  color: #854d0e;
  padding: 4px 10px;
  border-radius: 999px;
}

.progress-footer-actions {
  margin-top: 18px;
}

/* Mini-Juegos por Letra dentro del Modal */
.lg-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.lg-play-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.lg-arcade-wrap {
  text-align: center;
  padding: 8px 0;
}


/* 8. Dictado de Palabras (Audio y Escritura) */
.dictation-box {
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.dictation-top-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  background: #f0f9ff;
  border: 3px solid #bae6fd;
  border-radius: 24px;
  padding: 16px 20px;
  width: 100%;
}

.dictation-mystery {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  border: 3px dashed #38bdf8;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.4rem;
  box-shadow: 0 5px 14px rgba(14, 165, 233, 0.12);
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
  user-select: none;
}

.dictation-mystery.revealed {
  border-style: solid;
  border-color: #22c55e;
  background: #f0fdf4;
  transform: scale(1.06);
  animation: popIn 0.25s ease;
}

.dictation-audio-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.dictation-listen-btn {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #118ab2, #3a86ff);
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 5px 0 #1d4ed8;
  transition: transform 0.12s ease;
}

.dictation-listen-btn:hover {
  transform: translateY(-2px);
}

.dictation-listen-btn:active {
  transform: translateY(2px);
}

.dictation-sub-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.dictation-sec-btn {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 999px;
  border: 2px solid #93c5fd;
  background: #ffffff;
  color: #0369a1;
  cursor: pointer;
  box-shadow: 0 3px 0 #93c5fd;
  transition: transform 0.12s ease;
}

.dictation-sec-btn.hint {
  border-color: #fcd34d;
  color: #92400e;
  background: #fffbeb;
  box-shadow: 0 3px 0 #f59e0b;
}

.dictation-sec-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.dictation-slots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  cursor: text;
}

.dictation-slot {
  width: 50px;
  height: 58px;
  border-radius: 14px;
  border: 3px solid #cbd5e1;
  background: #f8fafc;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 0 #cbd5e1;
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

.dictation-slot.current {
  border-color: #3a86ff;
  background: #eff6ff;
  color: #3a86ff;
  transform: translateY(-3px);
  box-shadow: 0 4px 0 #2563eb;
}

.dictation-slot.typed {
  border-color: #64748b;
  background: #ffffff;
  color: #1e293b;
}

.dictation-slot.slot-ok {
  border-color: #22c55e;
  background: #dcfce7;
  color: #15803d;
  box-shadow: 0 4px 0 #16a34a;
}

.dictation-slot.slot-err {
  border-color: #ef4444;
  background: #fee2e2;
  color: #b91c1c;
  box-shadow: 0 4px 0 #dc2626;
  animation: slotShake 0.3s ease;
}

.dictation-slot.correct {
  border-color: #16a34a;
  background: #dcfce7;
  color: #15803d;
  box-shadow: 0 4px 0 #15803d;
  animation: popIn 0.22s ease;
}

.dictation-form {
  width: 100%;
}

.dictation-input-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: stretch;
  flex-wrap: wrap;
}

.dictation-input {
  flex: 1 1 210px;
  max-width: 280px;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  text-transform: uppercase;
  text-align: center;
  letter-spacing: 2px;
  padding: 12px 16px;
  border-radius: 16px;
  border: 3px solid #93c5fd;
  background: #ffffff;
  color: #1e293b;
  outline: none;
  box-shadow: inset 0 2px 4px rgba(15, 23, 42, 0.05);
}

.dictation-input::placeholder {
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.98rem;
  color: #94a3b8;
}

.dictation-input:focus {
  border-color: #2563eb;
  background: #f8fafc;
}

.dictation-enie-btn {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  padding: 0 16px;
  border-radius: 16px;
  border: 3px solid #c084fc;
  background: #faf5ff;
  color: #6b21a8;
  cursor: pointer;
  box-shadow: 0 4px 0 #9333ea;
}

.dictation-back-btn {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  padding: 0 14px;
  border-radius: 16px;
  border: 3px solid #cbd5e1;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
  box-shadow: 0 4px 0 #94a3b8;
  transition: transform 0.12s ease;
}

.dictation-help-btn {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 700;
  padding: 12px 18px;
  border-radius: 16px;
  border: 3px solid #f59e0b;
  background: linear-gradient(135deg, #fde047, #f59e0b);
  color: #78350f;
  cursor: pointer;
  box-shadow: 0 5px 0 #d97706;
  transition: transform 0.12s ease;
}

.dictation-help-btn:hover,
.dictation-back-btn:hover,
.dictation-enie-btn:hover {
  transform: translateY(-2px);
}

.dictation-help-btn:disabled,
.dictation-back-btn:disabled,
.dictation-enie-btn:disabled,
.dictation-input:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
}


/* 9. Cuentos con Pictogramas (Estilo Libro de Cuentos + Modos Intercambiables) */
.arcade-card.storybook-wide {
  max-width: 840px;
}

.storybook-stage {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.storybook-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.storybook-mode-switch {
  display: inline-flex;
  background: #f1f5f9;
  border: 2px solid #e2e8f0;
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
}

.sb-mode-btn {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  border: none;
  background: transparent;
  color: #64748b;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.sb-mode-btn.active {
  background: linear-gradient(135deg, #ec4899, #f43f5e);
  color: #ffffff;
  box-shadow: 0 3px 8px rgba(236, 72, 153, 0.3);
}

.storybook-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.picto-hint-btn {
  padding: 9px 18px;
  font-size: 0.96rem;
  border-radius: 999px;
}

.storybook-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fff7ed;
  border: 2.5px solid #fed7aa;
  border-radius: 20px;
  padding: 10px 14px;
}

.sb-nav-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2.5px solid #fdba74;
  background: #ffffff;
  color: #c2410c;
  font-size: 1rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 3px 0 #fb923c;
  transition: transform 0.12s ease;
}

.sb-nav-btn:hover {
  transform: scale(1.06);
}

.sb-header-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.sb-counter {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  color: #ea580c;
  background: #ffedd5;
  padding: 2px 10px;
  border-radius: 999px;
}

.sb-title {
  font-family: var(--font-display);
  font-size: 1.32rem;
  color: #7c2d12;
  margin: 0;
}

/* Página estilo libro infantil abierto */
.storybook-page {
  position: relative;
  background: linear-gradient(180deg, #fffef9 0%, #fef9eb 100%);
  border: 3px solid #fcd34d;
  border-left: 14px solid #f59e0b;
  border-radius: 14px 26px 26px 14px;
  padding: 22px 24px 16px;
  text-align: left;
  box-shadow: 0 8px 0 #eab308, 0 14px 28px rgba(120, 53, 15, 0.1);
  transition: border-color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

.storybook-page.story-complete {
  background: linear-gradient(180deg, #f0fdf4 0%, #dcfce7 100%);
  border-color: #4ade80;
  border-left-color: #16a34a;
  box-shadow: 0 8px 0 #16a34a, 0 14px 28px rgba(22, 163, 74, 0.14);
}

.storybook-paragraph {
  line-height: 2.35;
  font-family: var(--font-body);
  font-size: 1.24rem;
  font-weight: 800;
  color: #334155;
}

.sb-text {
  vertical-align: middle;
}

.sb-slot {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  margin: 4px 5px;
  min-width: 82px;
  padding: 5px 10px;
  border-radius: 16px;
  border: 2.5px dashed #94a3b8;
  background: #ffffff;
  cursor: pointer;
  box-shadow: 0 3px 0 #cbd5e1;
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease, box-shadow 0.14s ease;
}

.sb-slot:hover {
  transform: translateY(-2px);
}

.sb-slot.filled {
  border-style: solid;
  border-color: #64748b;
}

.sb-slot.active {
  border-style: solid;
  border-color: #3a86ff;
  background: #eff6ff;
  box-shadow: 0 4px 0 #2563eb, 0 0 0 3px rgba(58, 134, 255, 0.2);
  transform: translateY(-2px);
}

.sb-slot.swap-armed {
  border-color: #8b5cf6;
  background: #f5f3ff;
  box-shadow: 0 4px 0 #7c3aed, 0 0 0 3px rgba(139, 92, 246, 0.25);
}

.sb-slot.drag-over {
  border-color: #ec4899;
  background: #fdf2f8;
  transform: scale(1.05);
}

.sb-slot.slot-ok,
.sb-slot.solved {
  border-style: solid;
  border-color: #16a34a;
  background: #dcfce7;
  box-shadow: 0 4px 0 #15803d;
}

.sb-slot.slot-err {
  border-style: solid;
  border-color: #ef4444;
  background: #fee2e2;
  box-shadow: 0 4px 0 #dc2626;
  animation: slotShake 0.3s ease;
}

.sb-slot-visual {
  font-size: 1.95rem;
  line-height: 1.1;
}

.sb-slot:not(.filled):not(.solved) .sb-slot-visual {
  opacity: 0.45;
  font-size: 1.55rem;
}

.storybook-stage .sb-slot-label {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  color: #1e293b;
  background: #f1f5f9;
  padding: 1px 7px;
  border-radius: 999px;
  margin-top: 2px;
  line-height: 1.25;
}

.sb-slot.active .sb-slot-label {
  background: #dbeafe;
  color: #1d4ed8;
}

.sb-slot.slot-ok .sb-slot-label,
.sb-slot.solved .sb-slot-label {
  background: #bbf7d0;
  color: #14532d;
}

.sb-slot.slot-err .sb-slot-label {
  background: #fecaca;
  color: #991b1b;
}

.sb-tip {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1.5px dashed #fde68a;
  font-size: 0.86rem;
  font-weight: 700;
  color: #92400e;
  text-align: center;
}

/* Bandeja de stickers de dibujos o fichas de palabras */
.storybook-tray {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  padding: 6px 4px;
}

.sb-sticker-btn {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  border: 3px solid #ec4899;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 5px 0 #db2777;
  transition: transform 0.12s ease, opacity 0.15s ease;
}

.sb-sticker-btn:hover {
  transform: translateY(-3px) scale(1.04);
}

.sb-sticker-emoji {
  font-size: 2.5rem;
  line-height: 1;
}

.sb-sticker-btn.used,
.picto-choice-btn.used {
  opacity: 0.35;
  cursor: default;
  transform: none;
}

.picto-choice-btn {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  padding: 11px 20px;
  border-radius: 18px;
  border: 3px solid #ec4899;
  background: #ffffff;
  color: #1e293b;
  cursor: pointer;
  box-shadow: 0 5px 0 #db2777;
  transition: transform 0.12s ease, opacity 0.15s ease;
}

.picto-choice-btn:hover {
  transform: translateY(-2px);
}
