/* Página de inicio (usa los colores y botones de base.css) */
main { max-width: 1180px; margin: 0 auto; padding: clamp(2rem, 5vw, 4rem) clamp(1rem, 4vw, 2rem) 3rem; outline: none; }

/* Portada: texto a la izquierda, muro de letras a la derecha */
.portada { display: grid; grid-template-columns: minmax(0, 37rem) auto; justify-content: space-between; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.portada h1 { font-size: clamp(2.5rem, 6.5vw, 4.6rem); line-height: 1.02; letter-spacing: -0.02em; }
.entrada { font-size: 1.25rem; color: var(--tinta-2); max-width: 34ch; margin: 1.25rem 0 2rem; }
.acciones { display: flex; flex-wrap: wrap; gap: 1rem; }

.muro { display: grid; grid-template-columns: repeat(7, 1fr); gap: clamp(6px, 1vw, 10px); }
.azulejo { aspect-ratio: 1; display: grid; place-items: center; border-radius: 12px; border: 3px solid var(--borde);
  font-weight: 700; font-size: clamp(1.1rem, 2.6vw, 2rem); overflow: hidden;
  animation: aparecer .5s cubic-bezier(.2, .9, .3, 1.3) both; animation-delay: calc(var(--i) * 35ms); }
.azulejo.talavera { background: var(--talavera); color: var(--sobre-color); }
.azulejo.rosa { background: var(--rosa); color: var(--sobre-color); }
.azulejo.jade { background: var(--jade); color: var(--sobre-color); }
.azulejo.cempasuchil { background: var(--cempasuchil); color: var(--tinta); }
.azulejo.papel { background: var(--papel); color: var(--tinta); }
.azulejo.con-sena { background: var(--papel); }
.azulejo img { width: 100%; height: 100%; object-fit: cover; }
html[data-contraste="alto"] .azulejo.cempasuchil { color: #000; }
@keyframes aparecer { from { opacity: 0; transform: scale(.6) rotate(-6deg); } to { opacity: 1; transform: none; } }

/* Juegos */
.juegos { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 2rem; margin-top: clamp(3rem, 7vw, 5rem); }
.juego { display: flex; flex-direction: column; background: var(--papel); border: 3px solid var(--borde);
  border-radius: 22px; overflow: hidden; box-shadow: 8px 8px 0 var(--sombra); }
.juego-ilustracion { border-bottom: 3px solid var(--borde); }
.juego.carrera .juego-ilustracion { background: var(--talavera); }
.juego.memorama .juego-ilustracion { background: var(--rosa); }
.juego.batalla .juego-ilustracion { background: var(--jade); }
.juego.aprender .juego-ilustracion { background: var(--cempasuchil); }
.juego-ilustracion svg { display: block; width: 100%; height: auto; max-height: 220px; }
.juego-cuerpo { display: flex; flex-direction: column; gap: 1rem; padding: 1.6rem; flex: 1; }
.juego-cuerpo h2 { font-size: 2rem; }
.juego-cuerpo p { margin: 0; }
.juego-cuerpo .boton { margin-top: auto; }
.caracteristicas { margin: 0; padding: 0; list-style: none; display: grid; gap: .4rem; }
.caracteristicas li { display: flex; gap: .6rem; align-items: baseline; font-weight: 700; }
.caracteristicas li::before { content: ""; flex: none; width: .75rem; height: .75rem; border-radius: 3px; transform: translateY(-1px);
  background: var(--cempasuchil); border: 2px solid var(--borde); }

/* Ilustraciones SVG (colores de la paleta, cambian con alto contraste) */
.pista { fill: #0B2A63; }
.borde-pista { fill: var(--cempasuchil); }
.linea { fill: #FFFFFF; }
.letrero rect { fill: var(--cempasuchil); stroke: var(--tinta); stroke-width: 3; }
.letrero text { font: 700 44px "Atkinson Hyperlegible", Verdana, sans-serif; text-anchor: middle; fill: var(--tinta); }
.letrero.chico text { font-size: 22px; }
.carta-reverso rect { fill: var(--talavera); stroke: #FFFFFF; stroke-width: 4; }
.carta-reverso text { font: 700 22px "Atkinson Hyperlegible", Verdana, sans-serif; text-anchor: middle; fill: #FFFFFF; }
.carta-frente rect { fill: #FFFFFF; stroke: var(--tinta); stroke-width: 4; }
.carta-frente text { font: 700 60px "Atkinson Hyperlegible", Verdana, sans-serif; text-anchor: middle; fill: var(--tinta); }
.carta-par circle { fill: var(--jade); stroke: #FFFFFF; stroke-width: 3; }
.carta-par path { fill: none; stroke: #FFFFFF; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
html[data-contraste="alto"] .pista { fill: #000; }
html[data-contraste="alto"] .letrero rect, html[data-contraste="alto"] .carta-frente rect { stroke: #000; }
html[data-contraste="alto"] .letrero text, html[data-contraste="alto"] .carta-frente text { fill: #000; }
html[data-contraste="alto"] .carta-reverso rect { fill: #000; }
html[data-contraste="alto"] .carta-par circle { stroke: #000; }
html[data-contraste="alto"] .carta-par path { stroke: #000; }
html[data-contraste="alto"] .juego.carrera .juego-ilustracion,
html[data-contraste="alto"] .juego.memorama .juego-ilustracion,
html[data-contraste="alto"] .juego.batalla .juego-ilustracion,
html[data-contraste="alto"] .juego.aprender .juego-ilustracion { background: #000; }

/* Inclusión */
.inclusion { margin-top: clamp(3rem, 7vw, 5rem); }
.inclusion > h2 { font-size: clamp(1.7rem, 3.5vw, 2.3rem); max-width: 24ch; }
.lista-inclusion { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 1.5rem 3rem; }
.lista-inclusion li { display: flex; gap: 1rem; align-items: flex-start; }
.lista-inclusion h3 { font-size: 1.3rem; margin-bottom: .25rem; }
.lista-inclusion p { margin: 0; color: var(--tinta-2); }
.icono-inclusion { flex: none; display: grid; place-items: center; width: 3.5rem; height: 3.5rem; border-radius: 50%;
  background: var(--cempasuchil); border: 3px solid var(--borde); }
.icono-inclusion svg { width: 1.8rem; height: 1.8rem; fill: none; stroke: #14213D; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icono-inclusion .relleno { fill: #14213D; }
html[data-contraste="alto"] .icono-inclusion svg { stroke: #000; }
html[data-contraste="alto"] .icono-inclusion .relleno { fill: #000; }
kbd { font-family: inherit; font-weight: 700; border: 2px solid var(--borde); border-bottom-width: 4px; border-radius: 6px; padding: 0 .4rem; }

.pie { border-top: 3px solid var(--borde); background: var(--papel); text-align: center; padding: 1.75rem 1rem 2.5rem; color: var(--tinta-2); }
.pie p { margin: 0 auto; max-width: 60ch; }

@media (max-width: 820px) {
  .portada { grid-template-columns: 1fr; }
  .entrada { max-width: none; }
  .muro { grid-template-columns: repeat(9, 1fr); }
  .azulejo { border-width: 2px; border-radius: 8px; }
}

/* Ilustración de la batalla */
.lado-1 { fill: var(--talavera); }
.lado-2 { fill: var(--rosa); }
.divisor { fill: #FFFFFF; }
.vs circle { fill: var(--cempasuchil); stroke: var(--tinta); stroke-width: 3; }
.vs text { font: 700 22px "Atkinson Hyperlegible", Verdana, sans-serif; text-anchor: middle; fill: var(--tinta); }
html[data-contraste="alto"] .lado-1, html[data-contraste="alto"] .lado-2 { fill: #000; }
html[data-contraste="alto"] .vs circle { stroke: #000; }
html[data-contraste="alto"] .vs text { fill: #000; }

/* Ilustración de Aprender: fichas que deletrean HOLA */
.ficha-svg rect { fill: #FFFFFF; stroke: #14213D; stroke-width: 3; }
.ficha-svg text { font: 700 34px "Atkinson Hyperlegible", Verdana, sans-serif; text-anchor: middle; fill: #14213D; }
html[data-contraste="alto"] .ficha-svg rect { fill: #000; stroke: #FFD43B; }
html[data-contraste="alto"] .ficha-svg text { fill: #FFD43B; }

/* Títulos "Juega" y "Aprende": centrados y en negrita */
.seccion-juegos { margin-top: clamp(3rem, 7vw, 5rem); }
.seccion-juegos .juegos { margin-top: 0; }
.titulo-seccion { text-align: center; font-weight: 700; font-size: clamp(2rem, 4.5vw, 2.8rem); margin: 0 0 1.5rem; }

/* Sección Aprende (debajo de los juegos) */
.aprender-inicio { margin-top: clamp(3rem, 7vw, 5rem); }
.aprender-intro { color: var(--tinta-2); max-width: 60ch; margin: -.75rem auto 1.5rem; text-align: center; }
.opciones-aprender { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 1.5rem; }
.opcion-aprender { display: flex; gap: 1rem; align-items: flex-start; height: 100%; padding: 1.4rem; border-radius: 22px;
  border: 3px solid var(--borde); border-top: 12px solid var(--cempasuchil); background: var(--papel); color: var(--tinta);
  text-decoration: none; box-shadow: 8px 8px 0 var(--sombra); }
.opcion-aprender:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.opcion-aprender strong { display: block; font-size: 1.35rem; margin-bottom: .25rem; color: var(--tinta); }
.opcion-aprender > span:last-child { color: var(--tinta-2); }
.icono-aprender { flex: none; display: grid; place-items: center; width: 3.4rem; height: 3.4rem; border-radius: 14px;
  background: var(--cempasuchil); border: 3px solid var(--borde); }
.icono-aprender svg { width: 1.8rem; height: 1.8rem; fill: none; stroke: #14213D; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
html[data-contraste="alto"] .icono-aprender svg { stroke: #000; }

/* Cruza la meta */
.juego.cruza .juego-ilustracion { background: #6A2C91; overflow: hidden; }
.suelo { fill: #2E3440; }
.flecha { fill: none; stroke: #FFD43B; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
html[data-contraste="alto"] .juego.cruza .juego-ilustracion { background: #000; }

/* =====================================================================
   Tamaños más compactos en el inicio (A+ y A++ siguen agrandando todo)
   ===================================================================== */
main { padding-top: clamp(1.5rem, 4vw, 2.75rem); }
.portada h1 { font-size: calc(clamp(2.2rem, 5.5vw, 3.6rem) + 4px); }
.portada h2 { font-size: calc(clamp(1.7rem, 3.6vw, 2.2rem) + 2px); /* mismo tamaño que «Juega» */ color: var(--tinta-2); margin-top: .4rem; }
.entrada { font-size: 1.2rem; margin: 1rem 0 1.5rem; max-width: none; text-align: left; hyphens: manual; }
.boton { min-height: 46px; padding: .5rem 1.15rem; font-size: calc(1.05rem + 2px); border-radius: 12px; box-shadow: 3px 3px 0 var(--sombra); }
/* El muro de señas mide lo mismo de alto que el texto de la izquierda (del título al último botón).
   El ancho lo calcula inicio.js; aquí la letra crece con el tamaño de cada azulejo. */
.muro { gap: 8px; --azulejo: 64px; }
.azulejo { border-radius: 10px; font-size: calc(var(--azulejo) * .42); }
.titulo-seccion { font-size: calc(clamp(1.7rem, 3.6vw, 2.2rem) + 2px); margin-bottom: 1.1rem; }
.juegos { gap: 1.5rem 4.5rem; /* filas | columnas: espacio entre tarjetas al triple */ grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); } /* 3 tarjetas por fila */
.juego { border-radius: 18px; box-shadow: 6px 6px 0 var(--sombra); }
.juego-ilustracion svg { max-height: 170px; }
.juego-cuerpo { padding: 1.2rem; gap: .75rem; }
.juego-cuerpo h2 { font-size: calc(1.6rem + 2px); }
.caracteristicas li { font-size: 1rem; }
.opcion-aprender { padding: 1.1rem; border-radius: 18px; box-shadow: 6px 6px 0 var(--sombra); }
.opcion-aprender strong { font-size: calc(1.6rem + 2px); } /* igual que el nombre de los juegos */
.inclusion > h2 { font-size: clamp(1.5rem, 3vw, 1.9rem); }
.lista-inclusion h3 { font-size: 1.15rem; }
.icono-inclusion { width: 3rem; height: 3rem; }
.encabezado { padding-top: .6rem; padding-bottom: .6rem; }
.opcion { min-width: 44px; min-height: 44px; }

/* Deletrea la palabra */
.juego.deletrea .juego-ilustracion { background: #9C3D0A; }
.boton.naranja { background: #9C3D0A; }  /* texto blanco: 6.8:1 */
.ficha-ok rect { fill: #12805C; stroke: #FFFFFF; stroke-width: 3; }
.ficha-ok text { font: 700 38px "Atkinson Hyperlegible", Verdana, sans-serif; text-anchor: middle; fill: #FFFFFF; }
.ficha-ok circle { fill: #FFFFFF; stroke: #12805C; stroke-width: 3; }
.ficha-ok path { fill: none; stroke: #12805C; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
html[data-contraste="alto"] .juego.deletrea .juego-ilustracion { background: #000; }
html[data-contraste="alto"] .boton.naranja { background: var(--talavera); }

/* Recuerda la seña */
.juego.recuerda .juego-ilustracion { background: #0B5F73; }
.boton.petroleo { background: #0B5F73; }  /* texto blanco: 7.3:1 */
.ficha-oculta rect { fill: #FFFFFF; stroke: #14213D; stroke-width: 3; }
.ficha-oculta text { font: 700 44px "Atkinson Hyperlegible", Verdana, sans-serif; text-anchor: middle; fill: #14213D; }
html[data-contraste="alto"] .juego.recuerda .juego-ilustracion { background: #000; }
html[data-contraste="alto"] .boton.petroleo { background: var(--talavera); }
