/* cuestionario.css — la estructura de los cuestionarios. Sin un solo valor de la hoja de estilos: los colores, la
   letra, los tamaños y el aire los pone el motor en variables, leídos de /opt/aulaprimaria/estilo/estilo.json según
   el ciclo (`data-ciclo`: c1, c2, c3). Los tamaños de la hoja son para 1.024 de ancho; --e los escala (0,8 a 1,15).
   Lo que no está en la hoja (redondeos, sombras, el tamaño de los dibujos) va aquí, igual para los tres ciclos. */

.cq {
  /* lo que pone el motor, de estilo.json: --fondo --tarjeta --tinta --tinta-suave --borde --boton --boton-sombra
     --boton-letra --sel --sel-fondo --ok --ok-fondo --mal --mal-fondo --pista --pista-fondo --letra --lh-texto
     --lh-pregunta, y en px de la hoja --t-texto --t-enunciado --t-opcion --t-opcion_alto --t-boton --t-boton_letra
     --t-icono --t-borde --t-bloques --t-grupo --t-instr */
  --e: 1;
  --texto: calc(var(--t-texto) * var(--e));
  --pregunta: calc(var(--t-enunciado) * var(--e));
  --opcion: calc(var(--t-opcion) * var(--e));
  --opcion-alto: calc(var(--t-opcion_alto) * var(--e));
  --boton-alto: calc(var(--t-boton) * var(--e));
  --boton-texto: calc(var(--t-boton_letra) * var(--e));
  --icono: calc(var(--t-icono) * var(--e));
  --margen: calc(var(--t-borde) * var(--e));
  --bloques: calc(var(--t-bloques) * var(--e));
  --grupo: calc(var(--t-grupo) * var(--e));
  --instr: calc(var(--t-instr) * var(--e));
  --dibujo: calc(var(--opcion-alto) * 1.6);
  --radio: 18px; --radio-ch: 12px;
  min-height: 100vh; display: flex; flex-direction: column;
  background: var(--fondo); color: var(--tinta);
  font-family: var(--letra); font-size: var(--texto); line-height: var(--lh-texto);
  font-feature-settings: var(--cifras, normal);   /* las cifras del cole en 1.º y 2.º (CUE-008; estilo.json, letra.c1.cifras) */
  -webkit-tap-highlight-color: transparent;
}
/* el reinicio va con :where() para que no pese y cualquier clase de abajo le gane */
:where(.cq) *, :where(.cq) *::before, :where(.cq) *::after { box-sizing: border-box; }
:where(.cq) :where(h1, h2, h3, p, ol, dl, dd) { margin: 0; padding: 0; }
:where(.cq) ol { list-style: none; }
:where(.cq) :where(button, input) { font: inherit; color: inherit; }
:where(.cq) button { cursor: pointer; }
:where(.cq) button:disabled { cursor: default; }
.cq :focus-visible { outline: 3px solid var(--sel); outline-offset: 3px; }

/* ── cabecera ── */
.cq-cab { display: flex; align-items: center; gap: var(--bloques); padding: calc(var(--margen) / 2) var(--margen); }
.cq-cab.es-oculta { visibility: hidden; height: 0; padding: 0; overflow: hidden; }
.cq-cab-titulo { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.cq-cab-titulo strong { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cq-cab-titulo span { font-size: .72em; color: var(--tinta-suave); }
.cq-cab-der { display: flex; align-items: center; gap: var(--grupo); margin-left: auto; white-space: nowrap; }
.cq-icono, .cq-altavoz { flex: none; display: inline-grid; place-items: center; width: var(--icono); height: var(--icono); border-radius: 50%;
  border: 2px solid var(--borde); background: var(--tarjeta); font-size: calc(var(--icono) * .4); line-height: 1; }
.cq-icono.es-off { opacity: .4; text-decoration: line-through; }
.cq-icono:disabled { opacity: .3; }

/* los puntos de avance, en el color del botón */
.cq-progreso { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: calc(var(--grupo) * .6); row-gap: 8px; min-width: 0; flex: 1; }   /* CUE-005: un puntito por pregunta, hasta 20 */
.cq-progreso li { width: calc(var(--texto) * .9); height: calc(var(--texto) * .9); border-radius: 50%; background: var(--tarjeta); border: 2px solid var(--borde); transition: .25s; }
.cq-progreso li.es-hecha { background: var(--boton); border-color: var(--boton); }
.cq-progreso li.es-actual { border-color: var(--boton); box-shadow: 0 0 0 3px var(--boton); }

/* ── escena y base ── */
.cq-escena { flex: 1; width: 100%; max-width: calc(1040px * var(--e)); margin: 0 auto; padding: 0 var(--margen) var(--margen); }
.cq-base { display: flex; justify-content: space-between; align-items: center; gap: var(--grupo); padding: calc(var(--margen) / 2) var(--margen); font-size: 13px; color: var(--tinta-suave); }
.cq-guardado::before { content: '●'; color: var(--ok); margin-right: 6px; }
.cq-guardado.es-error::before { color: var(--mal); }
.cq-salir { color: inherit; }

/* ── botones: el color del botón del ciclo, nunca uno que signifique algo ── */
.cq-boton { display: inline-flex; align-items: center; justify-content: center; min-height: var(--boton-alto); padding: 8px calc(var(--boton-alto) * .6); border: 0; border-radius: 999px;
  background: var(--boton); color: var(--boton-letra); font-size: var(--boton-texto); font-weight: 700; text-decoration: none;
  box-shadow: 0 5px 0 var(--boton-sombra); transition: transform .08s, box-shadow .08s, opacity .2s; }
.cq-boton:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--boton-sombra); }
.cq-boton:disabled { opacity: .4; }
.cq-boton-suave { background: transparent; color: var(--tinta); box-shadow: inset 0 0 0 2px var(--borde); }

/* ── portada y final ── */
.cq-portada, .cq-final { display: flex; align-items: center; gap: var(--bloques); padding: var(--bloques); background: var(--tarjeta); border-radius: var(--radio);
  border: 1px solid var(--borde); }
.cq-portada-guia { width: calc(var(--opcion-alto) * 2.6); height: calc(var(--opcion-alto) * 2.6); border-radius: 50%; object-fit: cover; flex: none; border: 6px solid var(--tarjeta); box-shadow: 0 6px 18px rgba(20, 30, 60, .2); }
.cq-portada-texto { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: var(--grupo); }
.cq-etiqueta { display: block; font-size: .72em; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--tinta-suave); }
.cq-portada h1, .cq-final h1 { font-size: calc(var(--pregunta) * 1.6); font-weight: 700; line-height: var(--lh-pregunta); }
.cq-portada-dato { font-size: .85em; color: var(--tinta-suave); }
.cq-portada .cq-boton { margin-top: var(--grupo); }

.cq-final { flex-direction: column; text-align: center; }
.cq-final h1 { font-size: calc(var(--pregunta) * 1.3); }
.cq-final .cq-portada-guia { width: calc(var(--opcion-alto) * 1.8); height: calc(var(--opcion-alto) * 1.8); }
.cq-final-botones { display: flex; gap: var(--grupo); flex-wrap: wrap; justify-content: center; }
/* el final del cuestionario: lo que ya sabe, sin nota (decidido en Aula Primaria, 03-10-2026) */
.cq-final-sub { max-width: 560px; color: var(--tinta-suave); }
.cq-cuenta-final { display: flex; flex-direction: column; align-items: center; gap: var(--grupo); }
.cq-bolitas { display: flex; flex-wrap: wrap; justify-content: center; gap: calc(var(--grupo) * .6); max-width: 600px; }
.cq-bolitas li { width: calc(var(--texto) * 1.3); height: calc(var(--texto) * 1.3); border-radius: 50%; background: var(--borde); }
.cq-bolitas li.es-llena { background: var(--boton); box-shadow: 0 3px 0 var(--boton-sombra); }
.cq-cuenta-texto { font-size: var(--pregunta); line-height: var(--lh-pregunta); }
.cq-cuenta-texto strong { font-weight: 700; }
.cq-ideas { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--grupo); width: 100%; text-align: left; }
.cq-ideas-grupo { padding: var(--margen); border-radius: var(--radio); background: var(--fondo); }
.cq-ideas-grupo.es-ok { background: var(--ok-fondo); }
.cq-ideas-grupo h2 { font-size: 1.1em; font-weight: 700; line-height: var(--lh-pregunta); margin-bottom: var(--grupo); }
.cq-ideas-grupo ul { margin: 0; padding: 0; list-style: none; display: grid; gap: calc(var(--grupo) * .75); }
.cq-ideas-grupo li { display: flex; gap: 12px; font-weight: 700; }
.cq-ideas-grupo li::before { content: '•'; color: var(--tinta-suave); }
.cq-ideas-grupo li.es-ok::before { content: '✓'; color: var(--ok); }
.cq-detalle { width: 100%; text-align: left; border-top: 2px solid var(--borde); padding-top: var(--grupo); }
.cq-detalle summary { cursor: pointer; font-weight: 700; color: var(--tinta-suave); }
.cq-repaso { margin-top: var(--grupo); display: grid; gap: 16px; font-size: 16px; }
.cq-repaso li { display: flex; gap: 12px; padding: 14px 18px; border-radius: var(--radio-ch); background: var(--ok-fondo); }
.cq-repaso li.es-mal { background: var(--mal-fondo); }
.cq-repaso-marca { font-weight: 700; color: var(--ok); }
.cq-repaso li.es-mal .cq-repaso-marca { color: var(--mal); }
.cq-repaso em { font-style: normal; color: var(--tinta-suave); }
.cq-repaso-buena { font-weight: 700; }
.cq-repaso-porque { display: block; margin-top: 8px; }

/* ── la actividad: entre bloques, --bloques; de la pregunta a las respuestas, --instr ── */
.cq-actividad { display: flex; flex-direction: column; }
.cq-enun { display: flex; align-items: center; gap: var(--grupo); margin-bottom: var(--instr); }
.cq-guia { width: calc(var(--opcion-alto) * 1.3); height: calc(var(--opcion-alto) * 1.3); border-radius: 50%; object-fit: cover; flex: none; border: 4px solid var(--tarjeta); box-shadow: 0 4px 12px rgba(20, 30, 60, .18); }
.cq-bocadillo { position: relative; flex: 1; padding: calc(var(--margen) * .7) var(--margen); background: var(--tarjeta); border-radius: var(--radio); border: 1px solid var(--borde); }
.cq-guia + .cq-bocadillo::before { content: ''; position: absolute; left: -12px; top: 50%; width: 24px; height: 24px; margin-top: -12px; background: var(--tarjeta);
  border-left: 1px solid var(--borde); border-bottom: 1px solid var(--borde); transform: rotate(45deg); border-radius: 4px; }
.cq-preg { display: flex; align-items: center; gap: var(--grupo); margin-top: 4px; }
.cq-bocadillo h2 { flex: 1; font-size: var(--pregunta); line-height: var(--lh-pregunta); font-weight: 700; }

.cq-zona { display: flex; flex-direction: column; align-items: center; gap: var(--bloques); }
.cq-pie { display: flex; align-items: center; gap: var(--grupo); min-height: var(--boton-alto); margin-top: var(--bloques); }
.cq-aviso { flex: 1; padding: calc(var(--grupo) * .8) var(--margen); border-radius: var(--radio-ch); font-weight: 700; visibility: hidden; }
.cq-aviso.es-visible { visibility: visible; animation: cq-entra .25s both; background: var(--tarjeta); }
.cq-aviso.es-ok { background: var(--ok-fondo); color: var(--ok); }
.cq-aviso.es-mal { background: var(--mal-fondo); color: var(--mal); }
.cq-acciones { flex: none; }

/* el altavoz junto a una respuesta (desde 2.º) */
.cq-con-voz { display: flex; align-items: center; gap: calc(var(--grupo) * .6); min-width: 0; }
.cq-con-voz > :first-child { flex: 1; min-width: 0; }
.cq-ficha .cq-altavoz, .cq-tarjeta .cq-altavoz { position: absolute; top: 6px; right: 6px; width: calc(var(--icono) * .75); height: calc(var(--icono) * .75); }
.cq-frases .cq-altavoz, .cq-pista .cq-altavoz, .cq-grupo h3 .cq-altavoz { vertical-align: middle; margin-left: 12px; width: calc(var(--icono) * .75); height: calc(var(--icono) * .75); }

/* el ✓ de cada acierto */
.cq-opcion.es-ok::after, .cq-ficha.es-ok::after, .cq-tarjeta.es-ok::after, .cq-par.es-ok::after, .cq-hueco.es-ok::after {
  content: '✓'; margin-left: 10px; color: var(--ok); font-weight: 700; }
.cq-opcion.es-ok::after { margin: 0; }

/* ── figuras ──
   Aquí, solo lo común y lo que comparten varias lecciones (las bandejas de fichas, la balanza, el camino). Lo de cada
   lección, en motor/lecciones/<lección>.css (CUE-004, 06-10-2026): scripts/juntar-motor.js lo pone detrás de esto. */
.cq-figura { width: 100%; display: grid; place-items: center; }
/* las cosas que se cuentan (fichas, coches, libros): dos bandejas con lo de cada grupo (el color, de la hoja, lo pone el motor) */
.cq-fig-fichas { width: calc(var(--fw) * var(--e, 1)); max-width: 100%; height: auto; overflow: visible; }
.cq-fichas-bandeja { fill: var(--tarjeta); stroke: var(--borde); stroke-width: 3; }
.cq-ficha-contar { stroke: rgba(0, 0, 0, .22); stroke-width: 2.5; }
.cq-balda { fill: var(--tinta-suave); opacity: .45; }
.cq-par .cq-figura, .cq-tarjeta .cq-figura { margin-bottom: 10px; }
/* en las parejas, todas a la misma escala (que una ficha mida lo mismo en cada tarjeta), y nunca más anchas que ella */
.cq-par .cq-fig-fichas { width: calc(var(--fw) * .56 * var(--e, 1)); max-width: 100%; }
/* la balanza (MAT-M-004): la del vídeo y el juego (CUE-003) */
.cq-fig-balanza { width: calc(420px * var(--e, 1)); max-width: 100%; height: auto; overflow: visible; }
.cq-tarjeta .cq-fig-balanza { width: calc(340px * var(--e, 1)); }
/* en la tableta, la tarjeta de sí o no con su balanza va a lo ancho, el dibujo a un lado y lo que pone al otro: en
   columna no cabía en la pantalla con el aviso y «Seguir» */
@media (min-width: 721px) {
  .cq-tarjeta:has(.cq-fig-balanza) { flex-direction: row; max-width: 820px; gap: var(--bloques); text-align: left; }
  .cq-tarjeta:has(.cq-fig-balanza) .cq-figura { width: auto; flex: none; margin-bottom: 0; }
  .cq-tarjeta:has(.cq-fig-balanza) > p { flex: 1; }
  .cq-zona:has(.cq-tarjeta .cq-fig-balanza) .cq-sino-fila { max-width: 820px; }
}
/* la balanza del vídeo (CUE-003): lisa, del texto suave del ciclo; el plato y el ojo, ese color al 72 % con la tarjeta */
.cq-bal-pieza, .cq-bolsa-lazo { fill: var(--tinta-suave); }
.cq-bal-plato, .cq-bal-ojo { fill: color-mix(in srgb, var(--tinta-suave) 72%, var(--tarjeta)); }
.cq-kilo { fill: var(--tarjeta); stroke: var(--tinta); stroke-width: 3; }
.cq-kilo-tapa { fill: var(--sel-fondo); }
.cq-kilo-rotulo { fill: var(--tinta); font-family: var(--letra); font-weight: 700; }
.cq-rabito { stroke: var(--tinta); }
.cq-bolsa { fill: rgba(255, 255, 255, .25); stroke: var(--tinta-suave); stroke-width: 3; stroke-linejoin: round; }
.cq-bolsa-malla { fill: none; }
/* el camino del patio (MAT-N-040 y MAT-N-041): lo comparten, y por eso va aquí */
.cq-fig-camino { width: calc(var(--fw) * .38 * var(--e, 1)); max-width: 100%; height: auto; overflow: visible; }
.cq-mesa { fill: var(--tarjeta); stroke: var(--borde); stroke-width: 3; }
/* el camino del vídeo (MAT-N-041): casillas pintadas de blanco en el suelo, cada cifra debajo */
.cq-suelo { fill: color-mix(in srgb, var(--tinta-suave) 24%, var(--tarjeta)); }
.cq-camino-casilla { fill: #ffffff; fill-opacity: .38; }
.cq-camino-raya { fill: none; stroke: #ffffff; stroke-linejoin: round; }
.cq-sombra { fill: #3a3229; fill-opacity: .16; }
/* las cifras de los dibujos: con las variantes del ciclo, que heredan de .cq (en 1.º y 2.º, las del cole: CUE-008) */
.cq-cifra { fill: var(--tinta); font-family: var(--letra); font-weight: 700; }
/* lo que falta: el sitio vacío con borde discontinuo de los vídeos (`M.hueco` y el sitio de una torre) */
.cq-hueco { fill: color-mix(in srgb, var(--tinta) 5%, var(--fondo)); fill-opacity: .5; stroke: color-mix(in srgb, var(--tinta) 30%, var(--fondo)); stroke-width: 5; stroke-dasharray: 16 12; }
.cq-camino-flecha line { stroke: var(--tinta); stroke-width: 10; stroke-linecap: round; }
.cq-camino-flecha path { fill: var(--tinta); stroke: var(--tinta); stroke-width: 3; stroke-linejoin: round; }
/* en la tarjeta de sí o no, todos a la misma escala; en la tableta, el dibujo a un lado y lo que pone al otro, como la
   balanza (encima, la tarjeta no cabía en la pantalla con los botones y «Seguir»); en el móvil, encima.
   Aquí, el camino; las demás figuras, en el fichero de su lección */
.cq-tarjeta .cq-fig-camino { width: calc(var(--fw) * .29 * var(--e, 1)); }
.cq-tarjeta:has(.cq-fig-camino) { max-width: 820px; }
.cq-zona:has(.cq-tarjeta .cq-fig-camino) .cq-sino-fila { max-width: 820px; }
@media (min-width: 721px) {
  .cq-tarjeta:has(.cq-fig-camino) { flex-direction: row; gap: var(--bloques); text-align: left; }
  .cq-tarjeta:has(.cq-fig-camino) .cq-figura { width: auto; flex: none; margin-bottom: 0; }
  .cq-tarjeta:has(.cq-fig-camino) > p { flex: 1; }
}
.cq-bolsa-boca { fill: rgba(255, 255, 255, .6); stroke: var(--tinta-suave); stroke-width: 3; stroke-linejoin: round; }
.cq-lenteja { stroke: rgba(0, 0, 0, .2); stroke-width: 1; }
.cq-naranja { stroke: rgba(0, 0, 0, .15); stroke-width: 2; }
.cq-malla line { stroke: var(--tinta-suave); stroke-width: 1.4; opacity: .55; }
.cq-zona-halo { fill: transparent; stroke: transparent; stroke-width: 2.5; }
.cq-m-senalar .cq-zona-svg { cursor: pointer; }
.cq-m-senalar .cq-zona-svg:hover .cq-zona-halo, .cq-m-senalar .cq-zona-svg:focus-visible .cq-zona-halo { stroke: #fff; stroke-dasharray: 4 4; }
.cq-zona-svg:focus { outline: none; }
.cq-zona-svg.es-ok .cq-zona-halo { stroke: var(--ok); fill: var(--ok-fondo); fill-opacity: .35; stroke-width: 4; }
.cq-zona-svg.es-mal .cq-zona-halo { stroke: var(--mal); fill: var(--mal-fondo); fill-opacity: .3; stroke-width: 4; }
.cq-zona-svg.es-ayudada .cq-zona-halo { stroke: var(--pista); fill: var(--pista-fondo); fill-opacity: .35; stroke-width: 4; }
.cq-pista { font-size: var(--opcion); font-weight: 700; text-align: center; }
.cq-pista strong { font-size: 1.15em; }

/* ── elegir y marcar varias ── */
.cq-opciones { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--grupo); width: 100%; max-width: 820px; }
.cq-opcion { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: var(--opcion-alto); padding: 12px 20px;
  background: var(--tarjeta); border: 3px solid var(--borde); border-radius: var(--radio); font-weight: 700; font-size: var(--opcion); text-align: center;
  box-shadow: 0 5px 0 var(--borde); transition: transform .1s, border-color .15s, background .15s; }
.cq-opcion:hover:not(:disabled) { border-color: var(--sel); transform: translateY(-2px); }
.cq-opcion.es-ok { border-color: var(--ok); background: var(--ok-fondo); box-shadow: 0 5px 0 var(--ok); }
.cq-opcion.es-mal { border-color: var(--mal); background: var(--mal-fondo); box-shadow: none; }
.cq-opcion.es-apagada { opacity: .45; }
/* en 1.º, la opción que Tula está leyendo (MAT-G-003) */
.cq-opcion.es-leyendo:not(.es-ok):not(.es-mal) { border-color: var(--sel); background: var(--sel-fondo); box-shadow: 0 5px 0 var(--sel); transform: translateY(-2px); }
.cq-opciones-dibujo { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); max-width: 940px; }
.cq-opciones-tres { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 900px; }
.cq-dibujo { width: var(--dibujo); height: var(--dibujo); object-fit: contain; pointer-events: none; user-select: none; }
.cq-opciones-varias { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); max-width: 940px; }
.cq-opciones-varias .cq-opcion { flex-direction: row; justify-content: flex-start; text-align: left; }
.cq-casilla { flex: none; width: 26px; height: 26px; border: 3px solid var(--tinta-suave); border-radius: 7px; display: grid; place-items: center; font-style: normal; }
.cq-opcion[aria-pressed="true"] { border-color: var(--sel); background: var(--sel-fondo); }
.cq-opcion[aria-pressed="true"] .cq-casilla { background: var(--sel); border-color: var(--sel); }
.cq-opcion[aria-pressed="true"] .cq-casilla::before { content: '✓'; color: var(--tarjeta); font-weight: 700; font-size: 16px; }

/* ── sí o no: los dos botones con el color del botón; el acierto y el fallo, después ── */
.cq-cuenta { display: flex; gap: 10px; }
.cq-cuenta li { width: 16px; height: 16px; border-radius: 50%; background: var(--tarjeta); border: 2px solid var(--borde); }
.cq-cuenta li.es-actual { border-color: var(--boton); background: var(--boton); }
.cq-cuenta li.es-ok { background: var(--ok); border-color: var(--ok); }
.cq-cuenta li.es-mal { background: var(--mal); border-color: var(--mal); }
.cq-tarjeta { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--grupo); width: 100%; max-width: 560px; min-height: 180px;
  padding: var(--margen); background: var(--tarjeta); border: 4px solid var(--borde); border-radius: var(--radio); text-align: center; font-size: var(--opcion); font-weight: 700; box-shadow: 0 8px 0 var(--borde); }
.cq-tarjeta .cq-dibujo { width: calc(var(--dibujo) * 1.4); height: calc(var(--dibujo) * 1.4); }
.cq-tarjeta.es-entra { animation: cq-entra .3s both; }
.cq-tarjeta.es-ok { border-color: var(--ok); box-shadow: 0 8px 0 var(--ok); }
.cq-tarjeta.es-mal { border-color: var(--mal); box-shadow: 0 8px 0 var(--mal); }
.cq-sino-fila { display: flex; gap: var(--grupo); width: 100%; max-width: 560px; }
.cq-sino { flex: 1; display: flex; align-items: center; justify-content: center; gap: 14px; min-height: var(--opcion-alto); border: 0; border-radius: var(--radio);
  background: var(--boton); color: var(--boton-letra); box-shadow: 0 6px 0 var(--boton-sombra); font-size: var(--opcion); font-weight: 700; transition: transform .08s, opacity .2s; }
.cq-sino b { display: grid; place-items: center; width: 1.6em; height: 1.6em; border-radius: 50%; background: rgba(255, 255, 255, .3); font-size: .9em; }
.cq-sino:active:not(:disabled) { transform: translateY(4px); }
.cq-sino:disabled { opacity: .35; }
.cq-sino.es-ok { opacity: 1; background: var(--ok); color: #fff; box-shadow: 0 6px 0 var(--ok); }
.cq-sino.es-mal { opacity: 1; background: var(--mal); color: #fff; box-shadow: 0 6px 0 var(--mal); }

/* ── fichas (clasificar, ordenar, banco de palabras) ── */
.cq-ficha { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: var(--opcion-alto); padding: 12px 16px;
  background: var(--tarjeta); border: 3px solid var(--borde); border-radius: var(--radio-ch); font-weight: 700; font-size: var(--opcion); text-align: center;
  box-shadow: 0 4px 0 var(--borde); cursor: grab; user-select: none; touch-action: none; position: relative; transition: border-color .15s, box-shadow .15s; }
.cq-ficha:has(.cq-altavoz) { padding-right: calc(var(--icono) * .75 + 20px); }
/* en las fichas de solo texto, el altavoz centrado a la derecha; en las de dibujo, arriba */
.cq-ficha:not(:has(.cq-dibujo, .cq-figura)) .cq-altavoz { top: 50%; right: 8px; transform: translateY(-50%); }
.cq-ficha.es-arrastre { z-index: 30; cursor: grabbing; box-shadow: 0 14px 24px rgba(20, 30, 60, .3); transition: none; }
.cq-ficha.es-sel { border-color: var(--sel); background: var(--sel-fondo); box-shadow: 0 0 0 4px var(--sel); }
.cq-ficha[data-fija] { cursor: default; }
.cq-ficha.es-ok { border-color: var(--ok); background: var(--ok-fondo); box-shadow: none; }
.cq-ficha.es-ayudada { border-color: var(--pista); background: var(--pista-fondo); box-shadow: none; }
.cq-ficha .cq-dibujo { width: calc(var(--dibujo) * .78); height: calc(var(--dibujo) * .78); }
.cq-pieza-texto:empty { display: none; }

.cq-bandeja { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--grupo); min-height: var(--opcion-alto); width: 100%; }
.cq-bandeja-2filas { display: grid; grid-template-columns: repeat(4, minmax(0, 170px)); justify-content: center; }
.cq-bandeja.es-vacia, .cq-banco.es-vacia { display: none; }
.cq-grupos { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--grupo); width: 100%; }
.cq-grupo { min-height: 190px; padding: var(--grupo) var(--margen) var(--margen); border: 3px dashed var(--tinta-suave); border-radius: var(--radio); background: var(--tarjeta); transition: background .15s, border-color .15s; }
.hay-sel .cq-grupo { border-color: var(--sel); background: var(--sel-fondo); cursor: pointer; }
.cq-grupo h3 { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: var(--opcion); font-weight: 700; }
.cq-grupo h3 b { font-size: 1.3em; }
.cq-grupo > p { text-align: center; font-size: .8em; color: var(--tinta-suave); }
.cq-grupo-piezas { display: flex; flex-wrap: wrap; justify-content: center; gap: calc(var(--grupo) * .75); margin-top: var(--grupo); }
.cq-grupo-piezas .cq-ficha { min-height: 0; padding: 8px 12px; font-size: calc(var(--opcion) * .85); animation: cq-entra .25s both; }
.cq-grupo-piezas .cq-ficha .cq-altavoz { display: none; }
.cq-grupo-piezas .cq-ficha:has(.cq-altavoz) { padding-right: 12px; }
.cq-grupo-piezas .cq-dibujo { width: calc(var(--dibujo) * .56); height: calc(var(--dibujo) * .56); }

.cq-extremos { display: flex; justify-content: space-between; width: 100%; font-size: .85em; font-weight: 700; color: var(--tinta-suave); margin-bottom: calc(var(--bloques) * -.6); }
.cq-fila-orden { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: calc(var(--grupo) * .75); width: 100%; }
.cq-fila-orden .cq-ficha { padding: 12px 6px; font-size: calc(var(--opcion) * .8); }
.cq-fila-orden .cq-ficha:has(.cq-altavoz) { padding: calc(var(--icono) * .75 + 8px) 6px 12px; }
.cq-puesto { font-style: normal; font-size: .8em; color: var(--tinta-suave); }

/* ── emparejar ── */
.cq-parejas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: calc(var(--bloques) * 1.4); width: 100%; max-width: 760px; }
.cq-parejas h3 { text-align: center; font-size: .8em; text-transform: uppercase; letter-spacing: .06em; color: var(--tinta-suave); margin-bottom: 12px; }
.cq-col { display: flex; flex-direction: column; gap: var(--grupo); }
.cq-par { width: 100%; min-height: var(--opcion-alto); padding: 10px 20px; background: var(--tarjeta); border: 3px solid var(--borde); border-radius: var(--radio-ch); font-weight: 700; font-size: var(--opcion);
  box-shadow: 0 4px 0 var(--borde); transition: border-color .15s, background .15s; }
.cq-par.es-sel { border-color: var(--sel); background: var(--sel-fondo); box-shadow: 0 0 0 4px var(--sel); }
.cq-par.es-unida { box-shadow: none; animation: cq-entra .25s both; }
.cq-par.es-ok { border-color: var(--ok); background: var(--ok-fondo); }
.cq-par.es-ayudada { border-color: var(--pista); background: var(--pista-fondo); border-style: dashed; }

/* ── formar palabras ── */
.cq-formar { display: flex; flex-direction: column; align-items: center; gap: var(--bloques); width: 100%; }
.cq-huecos-letra, .cq-letras { display: flex; flex-wrap: wrap; justify-content: center; gap: calc(var(--grupo) * .75); }
.cq-hueco-letra, .cq-letra { width: calc(var(--opcion-alto) * .8); height: var(--opcion-alto); border-radius: var(--radio-ch); font-size: var(--pregunta); font-weight: 700; line-height: 1; }
.cq-hueco-letra { background: var(--fondo); border: 3px dashed var(--tinta-suave); }
.cq-hueco-letra:not(:empty) { background: var(--sel-fondo); border-style: solid; border-color: var(--sel); }
.cq-hueco-letra.es-ok { border-color: var(--ok); background: var(--ok-fondo); }
.cq-hueco-letra.es-ayudada { border-color: var(--pista); background: var(--pista-fondo); }
.cq-letra { background: var(--tarjeta); border: 3px solid var(--borde); box-shadow: 0 5px 0 var(--borde); }
.cq-letra.es-usada { visibility: hidden; }

/* ── completar y escribir ── */
.cq-frases { display: flex; flex-direction: column; gap: var(--grupo); width: 100%; padding: var(--margen); background: var(--tarjeta); border-radius: var(--radio); border: 1px solid var(--borde); font-size: var(--opcion); line-height: 2.3; }
.cq-hueco { display: inline-block; min-width: calc(var(--opcion-alto) * 1.6); min-height: calc(var(--opcion-alto) * .7); margin: 0 6px; padding: 2px 14px; vertical-align: middle; line-height: 1.5; background: var(--fondo); border: 3px dashed var(--tinta-suave); border-radius: var(--radio-ch); font-weight: 700; }
.cq-hueco.es-llena { border-style: solid; border-color: var(--sel); background: var(--sel-fondo); }
.cq-hueco.es-ok { border-color: var(--ok); background: var(--ok-fondo); color: var(--ok); }
.cq-hueco.es-ayudada { border-color: var(--pista); background: var(--pista-fondo); color: var(--pista); }
.hay-sel .cq-hueco:not(:disabled) { border-color: var(--sel); }
.cq-banco { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--grupo); }
.cq-palabra { flex-direction: row; padding: 8px 22px; }
.cq-palabra.es-usada { visibility: hidden; }
.cq-campo { margin: 0 6px; padding: 4px 12px; min-height: calc(var(--opcion-alto) * .7); text-align: center; font-weight: 700; background: var(--fondo); border: 3px solid var(--tinta-suave); border-radius: var(--radio-ch); }
.cq-campo:focus { outline: none; border-color: var(--sel); background: var(--sel-fondo); }
.cq-campo.es-ok { border-color: var(--ok); background: var(--ok-fondo); color: var(--ok); }
.cq-campo.es-ayudada { border-color: var(--pista); background: var(--pista-fondo); color: var(--pista); }

/* ── animaciones: cortas y que se paran (la hoja: nada de animaciones que no paran) ── */
.es-sacude { animation: cq-sacude .4s; }
@keyframes cq-sacude { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
@keyframes cq-entra { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@media (prefers-reduced-motion: reduce) { .cq *, .cq *::before { animation: none !important; transition: none !important; } }

/* ── pantallas estrechas: solo se recoloca; el tamaño lo baja --e ── */
@media (max-width: 720px) {
  .cq-cab { flex-wrap: wrap; }
  .cq-cab-titulo span { display: none; }
  .cq-progreso { order: 3; flex-basis: 100%; }
  .cq-portada { flex-direction: column; text-align: center; }
  .cq-portada-texto { align-items: center; }
  .cq-pie { flex-direction: column; align-items: stretch; }
  .cq-acciones .cq-boton { width: 100%; }
  .cq-opciones { grid-template-columns: 1fr; }
  .cq-opciones-dibujo { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cq-bandeja-2filas { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cq-parejas { gap: var(--grupo); }
  /* que las dos columnas, con su altavoz, quepan en el móvil (MAT-O-013: se salían unos 20 px) */
  .cq-par { padding: 10px 10px; }
  .cq-parejas .cq-con-voz { gap: 8px; }
  .cq-parejas .cq-con-voz .cq-altavoz { width: calc(var(--icono) * .75); height: calc(var(--icono) * .75); }
  .cq-frases { line-height: 2.6; }
}

/* Sin niño (CUE-007, 16-10-2026): mientras el servidor corrige, no se puede tocar nada (el motor pone además `inert`);
   si la red no contesta, el aviso lleva «Reintentar». Con final propio, «Un momento…» mientras se guarda el final. */
.cq-actividad.es-esperando { cursor: progress; }
.cq-actividad.es-esperando .cq-zona, .cq-actividad.es-esperando .cq-acciones { pointer-events: none; }
.cq-aviso .cq-reintentar { margin-left: var(--grupo); vertical-align: middle; }
.cq-final-espera { margin: 0; padding: var(--bloques); text-align: center; color: var(--tinta); }
