/* ============================================================
   JUEGOS · HUMANIZACIÓN DEL SERVICIO EN LA PRIMERA INFANCIA
   Unidad 1 · Introducción → Lección 1.3
   Ubicación: /public/theme/own-styles/juegos_hum.css
   Carga (HTML Adicional → Dentro del HEAD):
     <link rel="stylesheet" href=".../own-styles/juegos_hum.css">
   Todo el CSS está scopeado bajo .juegos-humanizacion
   para no afectar otros cursos ni el resto del sitio.
   ============================================================ */

.juegos-humanizacion {
  --turquesa: #00A9A5;
  --amarillo: #FFC845;
  --coral:    #FF6B6B;
  --verde:    #7FB800;
  --morado:   #6A4C93;
  --crema:    #FFF9F0;
  --tinta:    #2E2A3F;

  font-family: 'Nunito', system-ui, -apple-system, sans-serif;
  color: var(--tinta);
  max-width: 960px;
  margin: 0 auto;
  line-height: 1.55;
}

.juegos-humanizacion *,
.juegos-humanizacion *::before,
.juegos-humanizacion *::after { box-sizing: border-box; }

/* ---------- Selector de juegos (pestañas) ---------- */
.juegos-humanizacion .jh-selector {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 0 0 1.5rem;
  padding: .4rem;
  background: var(--crema);
  border: 2px solid var(--morado);
  border-radius: 16px;
}
.juegos-humanizacion .jh-tab {
  flex: 1 1 auto;
  min-width: 140px;
  padding: .7rem 1rem;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--morado);
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  transition: background .2s, color .2s, transform .1s;
}
.juegos-humanizacion .jh-tab:hover { background: #ffffff; }
.juegos-humanizacion .jh-tab.jh-activo {
  background: var(--morado);
  color: #fff;
  box-shadow: 0 4px 0 rgba(106,76,147,.35);
}
.juegos-humanizacion .jh-tab:focus-visible {
  outline: 3px solid var(--amarillo);
  outline-offset: 2px;
}

/* ---------- Panel de juego ---------- */
.juegos-humanizacion .jh-panel { display: none; }
.juegos-humanizacion .jh-panel.jh-activo { display: block; }

.juegos-humanizacion .jh-encabezado {
  background: linear-gradient(135deg, var(--turquesa), var(--morado));
  color: #fff;
  padding: 1.2rem 1.4rem;
  border-radius: 16px 16px 0 0;
}
.juegos-humanizacion .jh-encabezado h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.5rem;
  margin: 0 0 .2rem;
  font-weight: 600;
}
.juegos-humanizacion .jh-encabezado p { margin: 0; opacity: .95; font-size: .95rem; }

.juegos-humanizacion .jh-cuerpo {
  background: #fff;
  border: 2px solid var(--crema);
  border-top: none;
  border-radius: 0 0 16px 16px;
  padding: 1.4rem;
}

/* ---------- Barra de estado / puntaje ---------- */
.juegos-humanizacion .jh-estado {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem 1rem;
  margin-bottom: 1rem;
  padding: .6rem .9rem;
  background: var(--crema);
  border-radius: 12px;
  font-weight: 700;
}
.juegos-humanizacion .jh-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .25rem .7rem;
  border-radius: 999px;
  background: #fff;
  border: 2px solid var(--turquesa);
  color: var(--turquesa);
  font-size: .9rem;
}
.juegos-humanizacion .jh-boton {
  padding: .55rem 1.1rem;
  border: none;
  border-radius: 10px;
  background: var(--verde);
  color: #fff;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  cursor: pointer;
  transition: filter .15s, transform .1s;
}
.juegos-humanizacion .jh-boton:hover { filter: brightness(1.07); }
.juegos-humanizacion .jh-boton:active { transform: translateY(1px); }
.juegos-humanizacion .jh-boton.jh-sec { background: var(--coral); }
.juegos-humanizacion .jh-boton.jh-alt { background: var(--morado); }
.juegos-humanizacion .jh-boton:focus-visible {
  outline: 3px solid var(--amarillo);
  outline-offset: 2px;
}

/* ============================================================
   1) CRUCIGRAMA
   ============================================================ */
.juegos-humanizacion .jh-cruci-layout {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.4rem;
  align-items: start;
}
@media (max-width: 720px) {
  .juegos-humanizacion .jh-cruci-layout { grid-template-columns: 1fr; }
}
.juegos-humanizacion .jh-grid {
  display: grid;
  gap: 2px;
  background: var(--morado);
  padding: 2px;
  border-radius: 8px;
  width: max-content;
  margin: 0 auto;
}
.juegos-humanizacion .jh-celda {
  width: 34px; height: 34px;
  position: relative;
  background: #fff;
}
.juegos-humanizacion .jh-celda.jh-vacia { background: transparent; }
.juegos-humanizacion .jh-celda input {
  width: 100%; height: 100%;
  border: none;
  text-align: center;
  text-transform: uppercase;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  color: var(--tinta);
  background: transparent;
  caret-color: var(--turquesa);
}
.juegos-humanizacion .jh-celda input:focus {
  outline: 2px solid var(--turquesa);
  background: #FFFDF5;
}
.juegos-humanizacion .jh-celda.jh-ok input { background: #E7F6E7; color: var(--verde); }
.juegos-humanizacion .jh-celda .jh-num {
  position: absolute;
  top: 1px; left: 2px;
  font-size: .55rem;
  font-weight: 800;
  color: var(--coral);
  line-height: 1;
  pointer-events: none;
}
.juegos-humanizacion .jh-pistas h4 {
  font-family: 'Fraunces', serif;
  color: var(--morado);
  margin: 0 0 .4rem;
  font-size: 1.05rem;
}
.juegos-humanizacion .jh-pistas ol { margin: 0 0 1rem; padding-left: 1.3rem; }
.juegos-humanizacion .jh-pistas li { margin-bottom: .4rem; font-size: .92rem; cursor: pointer; }
.juegos-humanizacion .jh-pistas li:hover { color: var(--turquesa); }
.juegos-humanizacion .jh-pistas li.jh-resuelta {
  text-decoration: line-through;
  color: var(--verde);
  opacity: .7;
}

/* ============================================================
   2) SOPA DE LETRAS
   ============================================================ */
.juegos-humanizacion .jh-sopa-layout {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.4rem;
  align-items: start;
}
@media (max-width: 720px) {
  .juegos-humanizacion .jh-sopa-layout { grid-template-columns: 1fr; }
}
.juegos-humanizacion .jh-sopa {
  display: grid;
  gap: 1px;
  background: var(--turquesa);
  padding: 3px;
  border-radius: 10px;
  width: max-content;
  margin: 0 auto;
  user-select: none;
  touch-action: none;
}
.juegos-humanizacion .jh-sopa-celda {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: #fff;
  font-weight: 800;
  font-size: .95rem;
  cursor: pointer;
  border-radius: 4px;
  transition: background .1s, color .1s;
}
.juegos-humanizacion .jh-sopa-celda.jh-sel { background: var(--amarillo); color: var(--tinta); }
.juegos-humanizacion .jh-sopa-celda.jh-hallada { background: var(--verde); color: #fff; }
.juegos-humanizacion .jh-lista h4 {
  font-family: 'Fraunces', serif;
  color: var(--morado);
  margin: 0 0 .5rem;
  font-size: 1.05rem;
}
.juegos-humanizacion .jh-lista ul { list-style: none; margin: 0; padding: 0; }
.juegos-humanizacion .jh-lista li {
  padding: .3rem .6rem;
  margin-bottom: .3rem;
  border-radius: 8px;
  background: var(--crema);
  font-weight: 700;
  font-size: .9rem;
}
.juegos-humanizacion .jh-lista li.jh-hallada {
  background: #E7F6E7;
  color: var(--verde);
  text-decoration: line-through;
}

/* ============================================================
   3) JUEGO DE MEMORIA (cartas ocultas con volteo)
   ============================================================ */
.juegos-humanizacion .jh-tarj-ayuda {
  font-size: .9rem;
  color: var(--tinta);
  background: var(--crema);
  padding: .6rem .9rem;
  border-radius: 10px;
  margin: 0 0 1rem;
}
.juegos-humanizacion .jh-mem-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .6rem;
}
@media (min-width: 560px) {
  .juegos-humanizacion .jh-mem-grid { grid-template-columns: repeat(4, 1fr); }
}
.juegos-humanizacion .jh-mem-carta {
  position: relative;
  min-height: 150px;
  border-radius: 12px;
  cursor: pointer;
  perspective: 800px;
  background: transparent;
}
.juegos-humanizacion .jh-mem-inner {
  position: absolute;
  inset: 0;
  transition: transform .4s;
  transform-style: preserve-3d;
}
.juegos-humanizacion .jh-mem-carta.jh-flip .jh-mem-inner,
.juegos-humanizacion .jh-mem-carta.jh-done .jh-mem-inner {
  transform: rotateY(180deg);
}
.juegos-humanizacion .jh-mem-cara {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: .6rem;
}
.juegos-humanizacion .jh-mem-dorso {
  background: linear-gradient(135deg, var(--turquesa), var(--morado));
  color: #fff;
  font-size: 1.8rem;
  font-weight: 800;
}
.juegos-humanizacion .jh-mem-dorso span { opacity: .9; }
.juegos-humanizacion .jh-mem-frente {
  background: #fff;
  border: 2px solid var(--crema);
  transform: rotateY(180deg);
  flex-direction: column;
  gap: .28rem;
  overflow: hidden;
  padding: .55rem;
}
.juegos-humanizacion .jh-mem-frente.jh-T { border-color: var(--amarillo); }
.juegos-humanizacion .jh-mem-frente.jh-D { border-color: var(--turquesa); }
.juegos-humanizacion .jh-mem-tag {
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 1px 8px;
  border-radius: 20px;
}
.juegos-humanizacion .jh-mem-frente.jh-T .jh-mem-tag { background: #FDF1D8; color: #8A6116; }
.juegos-humanizacion .jh-mem-frente.jh-D .jh-mem-tag { background: #E2F2EA; color: #0B5E5C; }
.juegos-humanizacion .jh-mem-txt {
  font-size: .8rem;
  font-weight: 600;
  line-height: 1.3;
}
.juegos-humanizacion .jh-mem-frente.jh-T .jh-mem-txt {
  font-family: 'Fraunces', serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--morado);
}
.juegos-humanizacion .jh-mem-src { font-size: .62rem; color: #94A3B8; }
.juegos-humanizacion .jh-mem-badge {
  position: absolute;
  top: 5px; right: 6px;
  min-width: 18px; height: 18px;
  border-radius: 9px;
  color: #fff;
  font-size: .62rem;
  font-weight: 800;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
  background: var(--morado);
}
.juegos-humanizacion .jh-mem-carta.jh-done { cursor: default; }
.juegos-humanizacion .jh-mem-carta.jh-done .jh-mem-badge { display: flex; }
.juegos-humanizacion .jh-mem-carta.jh-err .jh-mem-frente {
  border-color: var(--coral);
  background: #FDEEEE;
  animation: jh-temblar .3s;
}
@keyframes jh-temblar {
  0%,100% { transform: rotateY(180deg) translateX(0); }
  25% { transform: rotateY(180deg) translateX(-4px); }
  75% { transform: rotateY(180deg) translateX(4px); }
}

/* ---------- Mensaje de victoria ---------- */
.juegos-humanizacion .jh-victoria {
  margin-top: 1rem;
  padding: 1rem 1.2rem;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--amarillo), var(--coral));
  color: #fff;
  font-weight: 800;
  text-align: center;
  display: none;
}
.juegos-humanizacion .jh-victoria.jh-visible {
  display: block;
  animation: jh-aparecer .4s ease;
}
@keyframes jh-aparecer {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .juegos-humanizacion * { transition: none !important; animation: none !important; }
}
