/* ==========================================================================
   The Pickle Codex · Herramientas interactivas
   Hoja compartida por las 6 herramientas. Reglas:
   - solo variables de la hoja principal (--tinta, --pista, --lima…), sin colores fijos;
   - solo clases con prefijo h- (los selectores de elemento van siempre dentro de una clase h-);
   - zonas táctiles de 44 px, foco visible y sin desbordamiento a 360 px.
   ========================================================================== */

/* ---------- Contenedor y base ---------- */
.h-herramienta {
  position: relative;
  margin: 0 0 2rem;
  padding: clamp(1rem, 3.5vw, 1.75rem);
  max-width: 100%;
  min-width: 0;
  background: var(--superficie);
  color: var(--tinta);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  font-family: var(--fuente-texto);
  line-height: 1.5;
  overflow-wrap: break-word;
}
.h-herramienta *, .h-herramienta *::before, .h-herramienta *::after { box-sizing: border-box; }
.h-herramienta [hidden] { display: none !important; }
.h-herramienta :focus { outline: none; }
.h-herramienta :focus-visible { outline: 3px solid var(--pista-hondo); outline-offset: 2px; }
.h-herramienta [tabindex="-1"]:focus-visible { outline-offset: 4px; }
.h-herramienta img, .h-herramienta svg { max-width: 100%; }
.h-herramienta p { margin: 0 0 .75rem; }
.h-herramienta a { color: var(--pista-hondo); text-underline-offset: .15em; }

.h-titulo {
  margin: 0 0 .35rem;
  font-family: var(--fuente-titulos);
  font-size: clamp(1.2rem, 3.2vw, 1.5rem);
  line-height: 1.2;
  color: var(--tinta);
}
.h-subtitulo { margin: 1.5rem 0 .5rem; font-family: var(--fuente-titulos); font-size: 1.1rem; line-height: 1.25; }
.h-ayuda { color: var(--gris); font-size: .92rem; }
.h-nota { color: var(--gris); font-size: .85rem; }
.h-oculto {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.h-etiqueta-sup {
  display: inline-block; margin: 0 0 .5rem; padding: .15rem .6rem; border-radius: 999px;
  background: var(--lima); color: var(--tinta); font-size: .75rem; font-weight: 600; letter-spacing: .02em;
}

/* ---------- Sin JavaScript / fallo ---------- */
.h-sinjs {
  padding: 1rem 1.1rem;
  border-left: 4px solid var(--pista);
  background: var(--pista-velo);
  border-radius: var(--radio);
  color: var(--tinta);
}
.h-sinjs p:last-child, .h-sinjs ul:last-child { margin-bottom: 0; }
.h-sinjs ul { margin: .5rem 0 0; padding-left: 1.2rem; }

/* ---------- Botones ---------- */
.h-boton {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  min-height: 44px; min-width: 44px; padding: .55em 1.1em;
  border: 2px solid var(--pista); border-radius: var(--radio);
  background: var(--pista); color: var(--blanco);
  font: 600 1rem/1.2 var(--fuente-texto); text-align: center; text-decoration: none;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background-color .15s, border-color .15s, color .15s;
}
.h-herramienta a.h-boton { color: var(--blanco); }
.h-boton:hover { background: var(--pista-hondo); border-color: var(--pista-hondo); }
.h-boton-sec, .h-herramienta a.h-boton-sec { background: var(--blanco); color: var(--pista-hondo); }
.h-boton-sec:hover, .h-herramienta a.h-boton-sec:hover { background: var(--pista-velo); color: var(--pista-hondo); border-color: var(--pista-hondo); }
.h-boton-amazon, .h-herramienta a.h-boton-amazon { background: var(--lima); border-color: var(--lima); color: var(--tinta); }
.h-boton-amazon:hover, .h-herramienta a.h-boton-amazon:hover { background: var(--lima); border-color: var(--lima-hondo); color: var(--tinta); text-decoration: underline; }
.h-boton-texto {
  display: inline-flex; align-items: center; min-height: 44px; padding: .4em .25em;
  border: 0; background: none; color: var(--pista-hondo); font: 600 1rem/1.2 var(--fuente-texto);
  text-decoration: underline; text-underline-offset: .15em; cursor: pointer;
}
.h-boton[disabled], .h-boton[aria-disabled="true"], .h-boton-texto[disabled] { opacity: .45; cursor: not-allowed; }
.h-boton-grande { min-height: 56px; font-size: 1.05rem; padding: .7em 1.2em; }
.h-boton small, .h-boton-grande small { display: block; font-weight: 400; font-size: .8rem; opacity: .9; }
.h-botonera { display: flex; flex-wrap: wrap; gap: .6rem; align-items: stretch; margin: 1rem 0; }
.h-botonera > * { min-width: 0; }
.h-pila { display: flex; flex-direction: column; gap: .5rem; }
.h-pila > .h-boton { width: 100%; }

/* ---------- Campos ---------- */
.h-rejilla { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); align-items: end; }
.h-campo { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.h-campo > label, .h-etiqueta { font-weight: 600; font-size: .95rem; }
.h-entrada {
  width: 100%; max-width: 100%; min-height: 44px; padding: .5rem .75rem;
  border: 2px solid var(--borde); border-radius: var(--radio);
  background: var(--blanco); color: var(--tinta); font: 400 1rem/1.3 var(--fuente-texto);
}
.h-entrada:hover { border-color: var(--gris); }
.h-entrada:focus-visible { border-color: var(--pista); outline: 3px solid var(--pista-hondo); outline-offset: 1px; }
.h-entrada[aria-invalid="true"] { border-color: var(--coral); }
.h-con-unidad { display: flex; gap: .5rem; align-items: stretch; min-width: 0; }
.h-con-unidad .h-entrada { flex: 1 1 6rem; min-width: 0; }
.h-unidad { display: inline-flex; align-items: center; color: var(--gris); font-weight: 600; }
.h-error { color: var(--tinta); font-weight: 600; border-left: 4px solid var(--coral); padding-left: .6rem; }
.h-grupo { border: 0; margin: 0; padding: 0; min-width: 0; }
.h-grupo > legend { padding: 0; margin: 0 0 .35rem; font-weight: 600; font-size: .95rem; }

/* Segmentos (radios con aspecto de botones) */
.h-segmentos { display: inline-flex; flex-wrap: wrap; border: 2px solid var(--pista); border-radius: var(--radio); overflow: hidden; background: var(--blanco); max-width: 100%; }
.h-segmentos label { position: relative; display: flex; flex: 1 1 auto; }
.h-segmentos input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.h-segmentos span {
  display: flex; align-items: center; justify-content: center; width: 100%;
  min-height: 44px; min-width: 44px; padding: .3rem .9rem;
  color: var(--pista-hondo); font-weight: 600; cursor: pointer;
}
.h-segmentos label + label span { border-left: 2px solid var(--pista); }
.h-segmentos input:checked + span { background: var(--pista); color: var(--blanco); }
.h-segmentos input:focus-visible + span { outline: 3px solid var(--pista-hondo); outline-offset: -6px; box-shadow: inset 0 0 0 2px var(--blanco); }

/* ---------- Opciones (asistente y quiz) ---------- */
.h-opciones { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); margin: 1rem 0; padding: 0; list-style: none; }
.h-opcion {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: .15rem;
  width: 100%; min-height: 56px; padding: .7rem 2.6rem .7rem 1rem;
  border: 2px solid var(--borde); border-radius: var(--radio);
  background: var(--blanco); color: var(--tinta);
  font: 600 1rem/1.3 var(--fuente-texto); text-align: left; cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.h-opcion small { font-weight: 400; font-size: .85rem; color: var(--gris); }
.h-opcion:hover:not([disabled]) { border-color: var(--pista); }
.h-opcion[aria-pressed="true"] { border-color: var(--pista); background: var(--pista-velo); box-shadow: inset 0 0 0 1px var(--pista); }
.h-opcion::after {
  content: ""; position: absolute; right: .9rem; top: 50%; width: 1.1rem; height: 1.1rem; margin-top: -.55rem;
  border: 2px solid var(--borde); border-radius: 50%; background: var(--blanco);
}
.h-opcion[data-multi]::after { border-radius: 4px; }
.h-opcion[aria-pressed="true"]::after { border-color: var(--pista); background: var(--pista); box-shadow: inset 0 0 0 3px var(--blanco); }
.h-opcion[disabled] { cursor: default; }
.h-opcion-correcta, .h-opcion-correcta[disabled] { border-color: var(--lima-hondo); background: var(--superficie); box-shadow: inset 0 0 0 2px var(--lima-hondo); }
.h-opcion-fallada, .h-opcion-fallada[disabled] { border-color: var(--coral); box-shadow: inset 0 0 0 2px var(--coral); }
.h-opcion-correcta::after, .h-opcion-fallada::after { display: none; }
.h-marca-respuesta { font-size: .8rem; font-weight: 600; color: var(--tinta); }

/* ---------- Progreso ---------- */
.h-progreso { height: 10px; border-radius: 999px; background: var(--pista-velo); overflow: hidden; margin: .25rem 0 1rem; }
.h-progreso-barra { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--pista); transition: width .25s ease; }
.h-paso { margin: 0; color: var(--gris); font-size: .9rem; font-weight: 600; }
.h-cabecera-fila { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem 1rem; }

/* ---------- Chips ---------- */
.h-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0 .75rem; padding: 0; list-style: none; }
.h-chip {
  display: inline-flex; align-items: center; gap: .3rem; max-width: 100%;
  padding: .25rem .65rem; border-radius: 14px; border: 1px solid var(--borde);
  background: var(--blanco); color: var(--tinta); font-size: .85rem; line-height: 1.3;
}
.h-chip-si { border-color: var(--lima-hondo); background: var(--superficie); }
.h-chip-si .h-chip-icono { color: var(--lima-hondo); }
.h-chip-no .h-chip-icono { color: var(--coral); }
.h-chip-nose { border-style: dashed; color: var(--gris); }
.h-chip-icono { font-weight: 700; }

/* ---------- Avisos y cajas ---------- */
.h-estado { min-height: 1.5em; margin: .5rem 0; color: var(--gris); font-size: .92rem; }
.h-caja { padding: 1rem 1.1rem; border-radius: var(--radio); background: var(--blanco); border: 1px solid var(--borde); }
.h-caja-ayuda { padding: .8rem 1rem; border-radius: var(--radio); background: var(--pista-velo); color: var(--tinta); font-size: .95rem; }
.h-honesto { margin-top: 1rem; padding: .8rem 1rem; border-left: 4px solid var(--lima-hondo); background: var(--blanco); border-radius: 0 var(--radio) var(--radio) 0; color: var(--tinta); }
.h-aviso-pie { margin-top: 1rem; color: var(--gris); font-size: .8rem; line-height: 1.45; }

/* ==========================================================================
   1. Comparador
   ========================================================================== */
.h-combo { position: relative; max-width: 36rem; }
.h-sugerencias-lista {
  position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px);
  max-height: min(22rem, 60vh); overflow-y: auto; margin: 0; padding: .25rem; list-style: none;
  background: var(--blanco); border: 2px solid var(--pista); border-radius: var(--radio); box-shadow: var(--sombra);
}
.h-sugerencia {
  display: flex; flex-direction: column; justify-content: center; min-height: 44px; padding: .45rem .7rem;
  border-radius: calc(var(--radio) - 4px); cursor: pointer; line-height: 1.3;
}
.h-sugerencia small { color: var(--gris); font-size: .8rem; }
.h-sugerencia:hover, .h-sugerencia-activa { background: var(--pista-velo); }
.h-sugerencia-activa { box-shadow: inset 0 0 0 2px var(--pista); }
.h-sugerencia-vacia { padding: .6rem .7rem; color: var(--gris); }

.h-elegidas { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 .25rem; padding: 0; list-style: none; }
.h-elegida {
  display: inline-flex; align-items: center; gap: .35rem; max-width: 100%;
  padding: .1rem .1rem .1rem .75rem; border-radius: 999px;
  border: 2px solid var(--borde); background: var(--blanco); font-weight: 600; font-size: .92rem;
}
.h-elegida-texto { min-width: 0; overflow-wrap: anywhere; }
.h-quitar {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; color: var(--gris);
  font-size: 1.35rem; line-height: 1; cursor: pointer;
}
.h-quitar:hover { background: var(--pista-velo); color: var(--tinta); }
.h-muestra { display: inline-block; flex: 0 0 auto; width: 26px; height: 14px; }
.h-muestra svg { display: block; width: 26px; height: 14px; }

.h-ejemplos { margin: 1.25rem 0 .5rem; }
.h-ejemplos .h-botonera { margin: .5rem 0 0; }
.h-ejemplo { flex: 1 1 15rem; flex-direction: column; align-items: flex-start; text-align: left; }
.h-ejemplo small { opacity: 1; color: var(--gris); font-size: .8rem; }

.h-vacio { margin: 1.25rem 0; padding: 1.5rem 1rem; border: 2px dashed var(--borde); border-radius: var(--radio); color: var(--gris); text-align: center; }

.h-tabla-envoltorio {
  position: relative; max-width: 100%; margin: 1rem 0; overflow-x: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--borde); border-radius: var(--radio); background: var(--blanco);
}
.h-tabla { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .95rem; }
.h-tabla caption { text-align: left; }
.h-tabla th, .h-tabla td { padding: .6rem .75rem; border-bottom: 1px solid var(--borde); text-align: left; vertical-align: top; }
.h-tabla tr:last-child > * { border-bottom: 0; }
.h-tabla thead th, .h-tabla thead td { background: var(--pista-velo); font-family: var(--fuente-titulos); font-size: 1rem; line-height: 1.25; vertical-align: bottom; }
.h-tabla td { min-width: 9.5rem; }
.h-tabla th[scope="row"], .h-tabla .h-esquina {
  position: sticky; left: 0; z-index: 2; width: 9rem; min-width: 9rem; max-width: 11rem;
  background: var(--superficie); font-weight: 600; font-size: .88rem; color: var(--gris);
  box-shadow: 1px 0 0 var(--borde);
}
.h-tabla thead .h-esquina { background: var(--pista-velo); }
.h-col-nombre { display: flex; align-items: flex-start; gap: .4rem; }
.h-tabla img { display: block; width: 100%; max-width: 6.5rem; height: auto; aspect-ratio: 3 / 4; object-fit: contain; border-radius: calc(var(--radio) - 4px); background: var(--superficie); }
.h-sin-dato { color: var(--gris); }
.h-detalle { display: block; color: var(--gris); font-size: .8rem; }
.h-extremo {
  display: inline-block; margin-top: .3rem; padding: .1rem .5rem; border-radius: 999px;
  background: var(--pista-velo); color: var(--pista-hondo); font-size: .75rem; font-weight: 600; line-height: 1.4;
}
.h-tabla .h-pila { min-width: 9rem; }
.h-tabla .h-boton { font-size: .9rem; padding: .45em .8em; }

.h-radar { margin: 1.5rem 0 0; padding: 1rem; border: 1px solid var(--borde); border-radius: var(--radio); background: var(--blanco); }
.h-radar figcaption { margin: 0 0 .5rem; font-family: var(--fuente-titulos); font-weight: 700; font-size: 1.05rem; }
.h-herramienta .h-radar-svg { display: block; width: 100%; max-width: 32rem; height: auto; margin: 0 auto; overflow: visible; }
.h-radar-anillo { fill: none; stroke: var(--borde); stroke-width: 1; }
.h-radar-anillo-ext { stroke: var(--gris); stroke-opacity: .5; }
.h-radar-eje { stroke: var(--borde); stroke-width: 1; }
.h-radar-etiqueta { fill: var(--tinta); font: 600 15px var(--fuente-texto); }
.h-radar-rango { margin: .5rem 0 0; text-align: center; }
.h-poligono { fill-opacity: .12; stroke-width: 2.5; stroke-linejoin: round; }
.h-vertice { stroke: var(--blanco); stroke-width: 1.5; }
.h-serie-0 .h-poligono, .h-serie-0 .h-vertice, .h-serie-0.h-linea { fill: var(--pista); stroke: var(--pista); }
.h-serie-1 .h-poligono, .h-serie-1 .h-vertice, .h-serie-1.h-linea { fill: var(--coral); stroke: var(--coral); }
.h-serie-2 .h-poligono, .h-serie-2 .h-vertice, .h-serie-2.h-linea { fill: var(--lima-hondo); stroke: var(--lima-hondo); }
.h-serie-3 .h-poligono, .h-serie-3 .h-vertice, .h-serie-3.h-linea { fill: var(--tinta); stroke: var(--tinta); }
.h-serie-0 .h-vertice, .h-serie-1 .h-vertice, .h-serie-2 .h-vertice, .h-serie-3 .h-vertice { stroke: var(--blanco); }
.h-serie-1 .h-poligono, .h-serie-1.h-linea { stroke-dasharray: 9 5; }
.h-serie-2 .h-poligono, .h-serie-2.h-linea { stroke-dasharray: 2 4; }
.h-serie-3 .h-poligono, .h-serie-3.h-linea { stroke-dasharray: 12 4 3 4; }
.h-linea { fill: none; stroke-width: 2.5; }
.h-leyenda { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; margin: .75rem 0 0; padding: 0; list-style: none; font-size: .9rem; }
.h-leyenda li { display: flex; align-items: center; gap: .45rem; min-width: 0; }
.h-leyenda small { color: var(--gris); }

/* ==========================================================================
   2. Elige tu pala
   ========================================================================== */
.h-pregunta { margin: 0; }
.h-pregunta > legend { padding: 0; }
.h-asistente-pie { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem; margin-top: 1rem; }
.h-resultados { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); margin: 1rem 0; padding: 0; list-style: none; }
.h-tarjeta {
  display: flex; flex-direction: column; gap: .35rem; min-width: 0; padding: 1rem;
  border: 1px solid var(--borde); border-radius: var(--radio); background: var(--blanco);
}
.h-tarjeta-cabecera { display: flex; gap: .75rem; align-items: flex-start; }
.h-tarjeta-cabecera img { flex: 0 0 auto; width: 56px; height: 75px; object-fit: contain; border-radius: 6px; background: var(--superficie); }
.h-tarjeta-titulo { margin: 0; font-family: var(--fuente-titulos); font-size: 1.05rem; line-height: 1.25; }
.h-puesto {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 2rem; height: 2rem; border-radius: 50%; background: var(--pista); color: var(--blanco); font-weight: 700; font-size: .9rem;
}
.h-encaje { margin: 0; color: var(--gris); font-size: .85rem; font-weight: 600; }
.h-tarjeta .h-pila { margin-top: auto; padding-top: .5rem; }
.h-resumen-respuestas { color: var(--gris); font-size: .9rem; }

/* ==========================================================================
   3. ¿Falta o no falta?
   ========================================================================== */
.h-situacion { margin: .5rem 0 0; font-size: 1.12rem; font-weight: 600; line-height: 1.45; }
.h-marcador { margin: 0; font-weight: 700; color: var(--pista-hondo); }
.h-respuesta { margin: 1rem 0; padding: 1rem 1.1rem; border-radius: var(--radio); background: var(--blanco); border: 1px solid var(--borde); }
.h-respuesta-si { border-left: 5px solid var(--lima-hondo); }
.h-respuesta-no { border-left: 5px solid var(--coral); }
.h-veredicto { font-family: var(--fuente-titulos); font-size: 1.15rem; font-weight: 700; }
.h-regla { color: var(--gris); font-size: .9rem; }
.h-final-cifra { margin: .25rem 0; font-family: var(--fuente-titulos); font-size: clamp(2.4rem, 9vw, 3.6rem); font-weight: 700; line-height: 1; color: var(--pista); }
.h-record { display: inline-block; padding: .2rem .7rem; border-radius: 999px; background: var(--lima); color: var(--tinta); font-weight: 600; font-size: .9rem; }
.h-lista-repaso { margin: .5rem 0 0; padding-left: 1.2rem; }
.h-lista-repaso li { margin: .3rem 0; }

/* ==========================================================================
   4. ¿Quién saca?
   ========================================================================== */
.h-qs-marcador { display: grid; gap: .25rem; margin: 0 0 .75rem; }
.h-qs-tanteo {
  margin: 0; font-family: var(--fuente-titulos); font-weight: 700; line-height: 1;
  font-size: clamp(2.6rem, 11vw, 4.2rem); letter-spacing: .02em; color: var(--pista-hondo);
  font-variant-numeric: tabular-nums;
}
.h-qs-tanteo small { display: block; margin-bottom: .3rem; font: 600 .8rem/1.2 var(--fuente-texto); letter-spacing: .04em; text-transform: uppercase; color: var(--gris); }
.h-qs-quien { margin: 0; font-weight: 600; font-size: 1.05rem; }
.h-qs-frase { margin: 0; color: var(--tinta); }
.h-qs-equipos { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin: .25rem 0 0; padding: 0; list-style: none; color: var(--gris); font-size: .9rem; }
.h-qs-equipos strong { color: var(--tinta); }
.h-qs-pista-envoltorio { margin: .5rem 0; border-radius: var(--radio); overflow: hidden; background: var(--superficie); }
.h-herramienta .h-qs-pista { display: block; width: 100%; max-width: 42rem; height: auto; margin: 0 auto; }
.h-qs-fondo { fill: var(--superficie); }
.h-qs-suelo { fill: var(--pista); }
.h-qs-cocina { fill: var(--pista-hondo); }
.h-qs-objetivo { fill: var(--lima); fill-opacity: .35; }
.h-qs-linea { stroke: var(--blanco); stroke-width: 2; fill: none; }
.h-qs-red { stroke: var(--tinta); stroke-width: 5; }
.h-qs-poste { fill: var(--tinta); }
.h-qs-rotulo { fill: var(--blanco); font: 600 11px var(--fuente-texto); letter-spacing: .08em; opacity: .85; }
.h-qs-rotulo-lado { fill: var(--blanco); font: 400 11px var(--fuente-texto); opacity: .75; }
.h-qs-rotulo-red { fill: var(--gris); font: 600 11px var(--fuente-texto); }
.h-qs-jugador .h-qs-cuerpo { stroke: var(--blanco); stroke-width: 3; }
.h-qs-equipo-0 .h-qs-cuerpo { fill: var(--coral); }
.h-qs-equipo-1 .h-qs-cuerpo { fill: var(--lima); }
.h-qs-inicial { font: 700 16px var(--fuente-texto); }
.h-qs-equipo-0 .h-qs-inicial { fill: var(--blanco); }
.h-qs-equipo-1 .h-qs-inicial { fill: var(--tinta); }
.h-qs-placa rect { fill: var(--blanco); }
.h-qs-placa text { fill: var(--tinta); font: 600 13px var(--fuente-texto); }
.h-qs-saca .h-qs-cuerpo { stroke: var(--lima); stroke-width: 5; }
.h-qs-equipo-1.h-qs-saca .h-qs-cuerpo { stroke: var(--blanco); }
.h-qs-jugador .h-qs-halo { fill: none; stroke: var(--lima); stroke-width: 2.5; stroke-dasharray: 4 3; }
.h-qs-compacta .h-qs-placa text { font-size: 19px; }
.h-qs-compacta .h-qs-inicial { font-size: 23px; }
.h-qs-compacta .h-qs-rotulo, .h-qs-compacta .h-qs-rotulo-lado, .h-qs-compacta .h-qs-rotulo-red { font-size: 15px; }
.h-qs-flecha { fill: none; stroke: var(--lima); stroke-width: 3.5; stroke-linecap: round; }
.h-qs-punta { fill: var(--lima); }
.h-qs-truco { margin: .5rem 0 0; }
.h-qs-botones { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); margin: 1rem 0 .6rem; }
.h-qs-botones .h-boton-grande { flex-direction: column; width: 100%; }
.h-qs-secundarios { display: flex; flex-wrap: wrap; gap: .6rem; }
.h-qs-secundarios .h-boton { flex: 1 1 8rem; }
.h-qs-fin { margin: 1rem 0; padding: 1rem 1.1rem; border-radius: var(--radio); background: var(--lima); color: var(--tinta); }
.h-qs-fin p { font-weight: 700; font-size: 1.15rem; }
.h-desplegable { margin-top: 1.25rem; border: 1px solid var(--borde); border-radius: var(--radio); background: var(--blanco); }
.h-desplegable > summary {
  display: flex; align-items: center; min-height: 48px; padding: .5rem 1rem; cursor: pointer;
  font-weight: 600; list-style-position: inside;
}
.h-desplegable[open] > summary { border-bottom: 1px solid var(--borde); }
.h-desplegable-cuerpo { display: grid; gap: 1rem; padding: 1rem; }
.h-nombres { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); }

/* ==========================================================================
   5. Calorías
   ========================================================================== */
.h-cal-resultado { margin: 1.25rem 0 .5rem; padding: 1rem 1.1rem; border-radius: var(--radio); background: var(--pista-velo); }
.h-cal-cifra { margin: 0; font-family: var(--fuente-titulos); font-size: clamp(2.2rem, 8vw, 3.2rem); font-weight: 700; line-height: 1.05; color: var(--pista-hondo); }
.h-cal-cifra small { font-size: .45em; font-weight: 600; }
.h-tabla-simple { width: 100%; border-collapse: collapse; font-size: .92rem; }
.h-tabla-simple th, .h-tabla-simple td { padding: .55rem .6rem; border-bottom: 1px solid var(--borde); text-align: left; vertical-align: top; }
.h-tabla-simple thead th { color: var(--gris); font-size: .82rem; font-weight: 600; }
.h-tabla-simple .h-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.h-tabla-simple .h-actual > * { background: var(--pista-velo); font-weight: 600; }
.h-tabla-simple .h-detalle { font-weight: 400; margin-top: .1rem; }
.h-tabla-simple thead .h-detalle { display: inline; margin: 0; }
.h-tabla-simple caption { text-align: left; font-weight: 600; padding: .7rem .6rem .3rem; }

/* ==========================================================================
   6. Test de forma física
   ========================================================================== */
.h-pruebas { display: grid; gap: 1rem; }
.h-prueba { min-width: 0; padding: 1rem 1.1rem; border: 1px solid var(--borde); border-radius: var(--radio); background: var(--blanco); }
.h-prueba-titulo { margin: 0 0 .5rem; font-family: var(--fuente-titulos); font-size: 1.15rem; line-height: 1.25; }
.h-prueba-pasos { margin: .25rem 0 .75rem; padding-left: 1.3rem; }
.h-prueba-pasos li { margin: .25rem 0; }
.h-seguridad { margin: .5rem 0 1rem; padding: .7rem .9rem; border-left: 4px solid var(--coral); background: var(--superficie); border-radius: 0 var(--radio) var(--radio) 0; font-size: .93rem; }
.h-prueba-form { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; }
.h-prueba-form .h-campo { flex: 1 1 12rem; }
.h-signo { flex: 0 0 auto; padding: 0; width: 44px; font-size: 1.25rem; }
.h-prueba-resultado { margin-top: 1rem; }
.h-prueba-resultado:empty { margin: 0; }
.h-herramienta .h-barra, .h-hoja-impresion .h-barra { display: block; width: 100%; max-width: 40rem; height: auto; overflow: visible; }
.h-barra-eje { stroke: var(--borde); stroke-width: 10; stroke-linecap: round; }
.h-barra-ref { fill: var(--pista); }
.h-barra-ref-texto { fill: var(--pista-hondo); font: 600 13px var(--fuente-texto); }
.h-barra-tu { fill: var(--lima); stroke: var(--tinta); stroke-width: 2; }
.h-barra-tu-texto { fill: var(--tinta); font: 700 14px var(--fuente-texto); }
.h-barra-limite { fill: var(--gris); font: 400 12px var(--fuente-texto); }
.h-refs { margin: .5rem 0; padding-left: 1.3rem; font-size: .92rem; }
.h-refs li { margin: .2rem 0; }
.h-refs small { color: var(--gris); }
.h-lectura { margin: .5rem 0; padding: .7rem .9rem; border-radius: var(--radio); background: var(--pista-velo); }

/* ---------- Ajustes de pantalla estrecha ---------- */
@media (max-width: 480px) {
  .h-tabla { font-size: .9rem; }
  .h-tabla th[scope="row"], .h-tabla .h-esquina { width: 6.75rem; min-width: 6.75rem; max-width: 6.75rem; padding: .55rem .5rem; font-size: .8rem; }
  .h-tabla td { min-width: 9rem; padding: .55rem .6rem; }
  .h-radar-etiqueta { font-size: 21px; }
  .h-barra-ref-texto, .h-barra-tu-texto, .h-barra-limite { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .h-herramienta * { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Impresión (test de forma física: botón «Imprimir mis resultados») ----------
   El JS crea una hoja limpia (.h-hoja-impresion) al final de <body>, añade .h-imprimiendo a <body>
   y llama a window.print(); al terminar, la quita. Si se imprime desde el navegador, se imprime la página normal. */
.h-hoja-impresion { display: none; }
@media print {
  .h-imprimiendo > :not(.h-hoja-impresion) { display: none !important; }
  .h-imprimiendo > .h-hoja-impresion { display: block !important; }
  .h-hoja-impresion { margin: 0; padding: 0; color: var(--tinta); background: none; font: 400 11pt/1.45 var(--fuente-texto); }
  .h-hoja-impresion .h-hoja-titulo { margin: 0 0 2mm; font: 700 18pt/1.2 var(--fuente-titulos); }
  .h-hoja-impresion .h-hoja-fecha { margin: 0 0 6mm; color: var(--gris); }
  .h-hoja-impresion .h-hoja-prueba { margin: 0 0 7mm; padding: 4mm 5mm; border: 1px solid var(--borde); border-radius: 3mm; break-inside: avoid; page-break-inside: avoid; }
  .h-hoja-impresion .h-hoja-prueba h2 { margin: 0 0 1mm; font: 700 13pt/1.25 var(--fuente-titulos); }
  .h-hoja-impresion .h-hoja-valor { margin: 0 0 2mm; font-weight: 600; }
  .h-hoja-impresion .h-barra { max-width: 160mm; }
  .h-hoja-impresion .h-lectura { background: none; border: 1px solid var(--borde); }
  .h-hoja-impresion .h-hoja-pie { margin-top: 6mm; color: var(--gris); font-size: 9pt; }
}

/* Arranque sin saltos de maquetación (CLS): con JS (clase .js en <html>, puesta en el <head>) la interfaz
   ocupa desde el primer pintado el alto que tendrá, invisible, y aparece entera cuando el script la rellena. */
html:not(.js) [data-h-ui], html:not(.js) [data-catalogo-filtros] { display: none; }
[data-h-ui][hidden], [data-catalogo-filtros][hidden] { display: none; }
.js .h-herramienta:not([data-h-listo]) [data-h-ui] { min-height: var(--h-reserva, 0px); visibility: hidden; }
.h-comparador { --h-reserva: 760px; }
.h-herramienta[data-h="elige-pala"] { --h-reserva: 525px; }
.h-herramienta[data-h="falta-quiz"] { --h-reserva: 386px; }
.h-herramienta[data-h="quien-saca"] { --h-reserva: 990px; }
.h-herramienta[data-h="calorias"] { --h-reserva: 1480px; }
.h-herramienta[data-h="test-forma"] { --h-reserva: 5800px; }
@media (min-width: 900px) {
  .h-comparador { --h-reserva: 420px; }
  .h-herramienta[data-h="elige-pala"] { --h-reserva: 320px; }
  .h-herramienta[data-h="falta-quiz"] { --h-reserva: 232px; }
  .h-herramienta[data-h="quien-saca"] { --h-reserva: 855px; }
  .h-herramienta[data-h="calorias"] { --h-reserva: 840px; }
  .h-herramienta[data-h="test-forma"] { --h-reserva: 2840px; }
}

/* ---------- Rediseño 2026-10: botones en píldora y títulos en Archivo ---------- */
.h-boton { border-radius: 999px; font-weight: 650; }
.h-boton-grande { border-radius: 18px; }
.h-entrada { border-radius: 999px; padding-left: 1rem; padding-right: 1rem; }
textarea.h-entrada { border-radius: var(--radio-chico); }
.h-titulo, .h-subtitulo { font-weight: 700; letter-spacing: -.015em; }
.h-herramienta { border-color: var(--borde-suave); box-shadow: 0 1px 2px rgba(11, 31, 68, .04), 0 12px 32px rgba(11, 31, 68, .07); }
