/* Juegos de Noticias Colonia. Pensado primero para el celular. */

.nc-juegos {
  --nc-texto: var(--wp--preset--color--contrast, #1d1d1f);
  --nc-fondo: var(--wp--preset--color--base, #fff);
  --nc-suave: color-mix(in srgb, var(--nc-texto) 6%, var(--nc-fondo));
  --nc-borde: color-mix(in srgb, var(--nc-texto) 18%, var(--nc-fondo));
  --nc-acento: #1f6feb;
  --nc-acento-texto: #fff;
  --nc-radio: 12px;
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
  color: var(--nc-texto);
  box-sizing: border-box;
}
.nc-juegos *, .nc-fondo * { box-sizing: border-box; }

.nc-migas { font-size: .85rem; opacity: .8; margin-bottom: .75rem; }
.nc-migas a { color: inherit; }
.nc-sep { margin: 0 .25rem; opacity: .6; }

.nc-cabecera h1 { font-size: clamp(1.5rem, 5vw, 2.2rem); line-height: 1.15; margin: 0 0 .5rem; }
.nc-bajada { margin: 0 0 .75rem; opacity: .85; }
.nc-puntos-chip {
  display: inline-block; margin: 0 0 1rem; padding: .3rem .75rem; border-radius: 999px;
  background: var(--nc-suave); font-size: .9rem;
}
.nc-puntos-chip[hidden] { display: none; }

/* --- tarjetas y listas de categorías --- */
.nc-tarjetas { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: 1rem 0 2rem; }
.nc-tarjeta, .nc-destacada {
  display: flex; flex-direction: column; gap: .3rem; padding: 1rem 1.1rem;
  border: 1px solid var(--nc-borde); border-radius: var(--nc-radio);
  color: inherit; text-decoration: none; background: var(--nc-fondo);
}
.nc-tarjeta:hover, .nc-destacada:hover { border-color: var(--nc-acento); }
.nc-tarjeta strong, .nc-destacada strong { font-size: 1.15rem; }
.nc-tarjeta-icono { font-size: 1.8rem; }
.nc-proximamente { opacity: .55; }
.nc-destacada { background: var(--nc-suave); margin: 1rem 0 1.5rem; }
.nc-etiqueta {
  align-self: flex-start; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  background: var(--nc-acento); color: var(--nc-acento-texto); padding: .1rem .5rem; border-radius: 999px;
}
.nc-grupo h2, .nc-texto h2 { font-size: 1.2rem; margin: 2rem 0 .75rem; }
.nc-categorias { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.nc-categorias a {
  display: inline-block; padding: .45rem .8rem; border: 1px solid var(--nc-borde); border-radius: 999px;
  color: inherit; text-decoration: none; font-size: .95rem;
}
.nc-categorias a:hover { border-color: var(--nc-acento); color: var(--nc-acento); }
.nc-texto p { line-height: 1.55; }
.nc-posibles { opacity: .85; }
.nc-tema-dia { margin: 0 0 .5rem; }

/* --- sopa --- */
.nc-sopa { margin: .5rem 0 1rem; scroll-margin-top: 1rem; }
.nc-sopa-barra {
  display: flex; justify-content: space-between; align-items: center; gap: .5rem;
  font-variant-numeric: tabular-nums; margin-bottom: .5rem; font-size: .95rem;
}
.nc-dificultad { font-weight: 700; padding: .15rem .6rem; border-radius: 999px; background: var(--nc-suave); }
.nc-dif-facil { background: #d8f3dc; color: #1b4332; }
.nc-dif-normal { background: #fff3c4; color: #5c4400; }
.nc-dif-dificil { background: #ffd6d6; color: #7a1010; }
.nc-tiempo { font-weight: 600; min-width: 3.5em; text-align: right; }

.nc-grilla {
  --tam: 12;
  display: grid;
  grid-template-columns: repeat(var(--tam), 1fr);
  width: 100%;
  max-width: min(100%, 560px);
  aspect-ratio: 1;
  margin: 0 auto;
  border: 1px solid var(--nc-borde);
  border-radius: var(--nc-radio);
  background: var(--nc-fondo);
  overflow: hidden;
  touch-action: none;         /* que arrastrar no mueva la página */
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  cursor: pointer;
}
.nc-celda {
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: clamp(.8rem, calc(68vw / var(--tam)), 1.45rem);
  line-height: 1;
  text-transform: uppercase;
  transition: background-color .12s;
}
.nc-sel { background: color-mix(in srgb, var(--nc-acento) 35%, transparent); }
.nc-inicio { outline: 3px solid var(--nc-acento); outline-offset: -3px; border-radius: 50%; }
.nc-error { animation: nc-temblor .3s; }
@keyframes nc-temblor { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* colores de palabras encontradas (celdas y lista) */
.nc-encontrada.nc-c0, .nc-tachada.nc-c0 { background: #ffd8a8; }
.nc-encontrada.nc-c1, .nc-tachada.nc-c1 { background: #b2f2bb; }
.nc-encontrada.nc-c2, .nc-tachada.nc-c2 { background: #a5d8ff; }
.nc-encontrada.nc-c3, .nc-tachada.nc-c3 { background: #fcc2d7; }
.nc-encontrada.nc-c4, .nc-tachada.nc-c4 { background: #d0bfff; }
.nc-encontrada.nc-c5, .nc-tachada.nc-c5 { background: #ffec99; }
.nc-encontrada.nc-c6, .nc-tachada.nc-c6 { background: #99e9f2; }
.nc-encontrada.nc-c7, .nc-tachada.nc-c7 { background: #c0eb75; }
.nc-encontrada { color: #1d1d1f; }

.nc-ayuda { text-align: center; font-size: .9rem; opacity: .75; margin: .6rem 0 0; }
.nc-ayuda[hidden] { display: none; }
.nc-subtitulo { font-size: 1rem; margin: 1rem 0 .5rem; }
.nc-palabras {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: .35rem;
}
.nc-palabras li {
  padding: .35rem .6rem; border-radius: 8px; background: var(--nc-suave);
  font-weight: 600; font-size: .95rem;
}
.nc-tachada { text-decoration: line-through; color: #1d1d1f; opacity: .85; }

.nc-acciones { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.nc-boton {
  display: inline-flex; align-items: center; justify-content: center; gap: .3rem;
  min-height: 44px; padding: .55rem 1.1rem; border-radius: 999px; border: 1px solid var(--nc-acento, #1f6feb);
  background: var(--nc-acento, #1f6feb); color: var(--nc-acento-texto, #fff); font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer;
}
.nc-boton-sec { background: transparent; color: var(--nc-acento, #1f6feb); }
.nc-aviso { padding: .75rem; border-radius: 8px; background: #fff3c4; color: #5c4400; }

/* --- quiz --- */
.nc-quiz { margin: .5rem 0 1rem; scroll-margin-top: 1rem; max-width: 680px; }
.nc-quiz-barra {
  display: flex; justify-content: space-between; align-items: center; gap: .5rem;
  font-variant-numeric: tabular-nums; margin-bottom: .5rem; font-size: .95rem;
}
.nc-progreso { height: 6px; border-radius: 999px; background: var(--nc-suave); overflow: hidden; margin-bottom: 1rem; }
.nc-progreso span { display: block; height: 100%; width: 0; background: var(--nc-acento); transition: width .3s; }
.nc-quiz-tema {
  display: inline-block; margin: 0 0 .4rem; font-size: .8rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; opacity: .7;
}
.nc-quiz-tema[hidden] { display: none; }
.nc-pregunta { font-size: clamp(1.15rem, 4.2vw, 1.45rem); line-height: 1.3; margin: 0 0 1rem; min-height: 2.6em; }
.nc-opciones { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.nc-opcion {
  display: flex; align-items: center; gap: .75rem; width: 100%; min-height: 54px; padding: .6rem .8rem;
  border: 2px solid var(--nc-borde); border-radius: var(--nc-radio); background: var(--nc-fondo); color: inherit;
  font: inherit; font-size: 1.02rem; text-align: left; cursor: pointer; touch-action: manipulation;
  transition: border-color .15s, background-color .15s;
}
.nc-opcion:hover:not(:disabled) { border-color: var(--nc-acento); }
.nc-opcion:focus-visible { outline: 3px solid var(--nc-acento); outline-offset: 2px; }
.nc-opcion:disabled { cursor: default; }
.nc-letra {
  flex: 0 0 auto; display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%;
  background: var(--nc-suave); font-weight: 700; font-size: .9rem;
}
.nc-opcion.nc-ok { border-color: #2b8a3e; background: #d3f9d8; color: #1b4332; }
.nc-opcion.nc-ok .nc-letra { background: #2b8a3e; color: #fff; }
.nc-opcion.nc-mal { border-color: #c92a2a; background: #ffe3e3; color: #7a1010; animation: nc-temblor .3s; }
.nc-opcion.nc-mal .nc-letra { background: #c92a2a; color: #fff; }
.nc-opcion:disabled:not(.nc-ok):not(.nc-mal) { opacity: .55; }
.nc-respuesta { margin: 1rem 0 0; padding: .75rem .9rem; border-radius: var(--nc-radio); background: var(--nc-suave); }
.nc-respuesta[hidden] { display: none; }
.nc-respuesta p { margin: .35rem 0 0; line-height: 1.45; }
.nc-respuesta-ok strong { color: #2b8a3e; }
.nc-respuesta-mal strong { color: #c92a2a; }
.nc-quiz .nc-acciones [data-nc-siguiente] { flex: 1 1 100%; }
.nc-quiz .nc-acciones [hidden] { display: none; }
.nc-cuadritos { font-size: 1.4rem; letter-spacing: .1em; margin: .25rem 0; }
.nc-repaso { margin: 1rem 0 0; font-size: .92rem; }
.nc-repaso summary { cursor: pointer; font-weight: 600; }
.nc-repaso ul { padding-left: 1.1rem; margin: .5rem 0 0; }
.nc-repaso li { margin: .35rem 0; }
.nc-muestra { padding-left: 1.2rem; line-height: 1.5; }
.nc-muestra li { margin: .25rem 0; }

/* --- ventanas (confirmar / fin) --- */
.nc-fondo {
  position: fixed; inset: 0; z-index: 100000; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(0, 0, 0, .45); padding: 0;
}
.nc-ventana {
  --nc-acento: #1f6feb; --nc-acento-texto: #fff;
  width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto;
  background: var(--wp--preset--color--base, #fff); color: var(--wp--preset--color--contrast, #1d1d1f);
  border-radius: 18px 18px 0 0; padding: 1.25rem 1.25rem 1.5rem; box-shadow: 0 -8px 30px rgba(0, 0, 0, .2);
  animation: nc-subir .2s ease-out;
}
@media (min-width: 640px) {
  .nc-fondo { align-items: center; padding: 1rem; }
  .nc-ventana { border-radius: 18px; }
}
@keyframes nc-subir { from { transform: translateY(30px); opacity: 0; } }
/* Cabecera con el título y la X: queda arriba aunque la ventana se desplace. */
.nc-ventana-cabeza {
  position: sticky; top: -1.25rem; z-index: 1; display: flex; align-items: flex-start; gap: .75rem;
  margin: -1.25rem -1.25rem .5rem; padding: 1.25rem 1.25rem .25rem; background: inherit;
}
.nc-ventana .nc-ventana-cabeza h2 { flex: 1; min-width: 0; margin: .35rem 0 0; }
.nc-ventana-cerrar {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; margin: -.35rem -.35rem 0 0; border-radius: 50%;
  border: 2px solid color-mix(in srgb, currentColor 25%, transparent); background: color-mix(in srgb, currentColor 6%, transparent);
  color: inherit; cursor: pointer;
}
.nc-ventana-cerrar:hover { background: color-mix(in srgb, currentColor 12%, transparent); }
.nc-ventana-cerrar:focus-visible { outline: 3px solid var(--nc-acento); outline-offset: 2px; }
.nc-ventana h2 { margin: 0 0 .5rem; font-size: 1.35rem; }
.nc-ventana h3 { margin: 1.25rem 0 .5rem; font-size: 1rem; }
.nc-ventana-botones { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.nc-ventana-botones .nc-boton { flex: 1 1 auto; }
.nc-ganados { font-size: 2rem; font-weight: 800; color: #2b8a3e; margin: .25rem 0; }
.nc-detalle, .nc-nota { font-size: .85rem; opacity: .75; margin: .25rem 0; }
.nc-total { font-weight: 600; margin: .5rem 0 0; }
.nc-compartir-texto { font-size: .9rem; background: rgba(0,0,0,.05); padding: .6rem .75rem; border-radius: 8px; margin: 0 0 .5rem; }
.nc-compartir-redes { display: flex; flex-wrap: wrap; gap: .4rem; }
.nc-red {
  display: inline-flex; align-items: center; min-height: 40px; padding: .4rem .8rem; border-radius: 999px;
  border: 1px solid rgba(0,0,0,.2); background: transparent; color: inherit; font: inherit; font-size: .9rem;
  text-decoration: none; cursor: pointer;
}
.nc-red-whatsapp { background: #25d366; border-color: #25d366; color: #fff; }
.nc-noticias { padding-left: 1.1rem; margin: 0; }
.nc-noticias li { margin: .3rem 0; }

@media (prefers-reduced-motion: reduce) {
  .nc-ventana, .nc-error, .nc-opcion.nc-mal { animation: none; }
  .nc-progreso span { transition: none; }
}

/* --- escritorio: la lista de palabras al costado de la grilla --- */
@media (min-width: 640px) {
  .nc-opciones { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 900px) {
  .nc-juegos { max-width: 980px; }
  .nc-sopa {
    display: grid;
    grid-template-columns: minmax(0, 560px) minmax(0, 1fr);
    grid-template-areas: "barra barra" "grilla lado" "ayuda lado";
    column-gap: 2rem;
    align-items: start;
  }
  .nc-sopa-barra { grid-area: barra; max-width: 560px; }
  .nc-grilla { grid-area: grilla; }
  .nc-ayuda { grid-area: ayuda; }
  .nc-lado { grid-area: lado; }
  .nc-lado .nc-subtitulo { margin-top: 0; }
  .nc-lado .nc-palabras { grid-template-columns: 1fr 1fr; }
}
