/* NÓMADA: paleta y tipografía del documento de diseño (docs/diseno.md §2).
   Todo en claro, con pocos acentos. El oro nunca va como texto sobre marfil. */
:root {
  --marfil: #F7F3EA;          /* fondo de todas las pantallas */
  --tinta: #1A2238;           /* texto */
  --azul-noche: #121A3A;      /* botón principal y tarjeta de la olimpiada */
  --oro: #E8B24F;             /* logo, fecha de la olimpiada y detalles */
  --terracota: #C2643A;       /* etiquetas y flechas */
  --terracota-texto: #A3482A; /* terracota cuando es texto */
  --texto-2: #5A6178;         /* texto secundario */
  --borde: #DDD3C0;
  --blanco: #FFFFFF;          /* tarjetas */
  --fondo-suave: #EFE8DA;     /* cajas y etiquetas discretas sobre marfil */
  --claro-sobre-noche: #C3CAE0; /* texto secundario sobre azul noche */

  --fuente-marca: 'Michroma', 'Sora', sans-serif;               /* solo la marca (letra tecnológica) */
  --fuente-texto: 'Sora', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --radio: 14px;
  --alto-boton: 48px;         /* botones de al menos 44–48 px */

  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--marfil);
  color: var(--tinta);
  font-family: var(--fuente-texto);
  font-size: 1rem;
  line-height: 1.55;
}

a { color: var(--azul-noche); }

h1, h2, p { margin: 0; }

/* ---------- Portada ---------- */

.portada {
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 65rem;
  margin: 0 auto;
  padding: 40px 20px 28px;
  display: flex;
  flex-direction: column;
}

/* La marca ocupa el centro de la portada; las puertas quedan abajo. */
.marca {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px 0 48px;
  text-align: center;
}

.marca-nombre {
  font-family: var(--fuente-marca);
  font-weight: 400;
  font-size: clamp(2.25rem, 10vw, 3.75rem);
  letter-spacing: 0.08em;
  line-height: 1.15;
}

.marca-raya {
  width: 40px;
  height: 2px;
  background: var(--oro);
}

.marca-eslogan {
  color: var(--texto-2);
}

.puertas {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Tarjetas grandes que llevan a otra sección (portada y «¿Quién eres?»). */
.puerta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 12px 16px 12px 18px;
  border-radius: var(--radio);
  border: 1px solid var(--borde);
  background: var(--blanco);
  color: var(--tinta);
  text-decoration: none;
}

.puerta-textos {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.puerta-titulo {
  font-size: 1.125rem;
  font-weight: 600;
}

.puerta-detalle {
  font-size: 0.8125rem;
  color: var(--texto-2);
}

.puerta-flecha {
  flex: none;
  width: 22px;
  height: 22px;
  stroke: var(--terracota-texto);
}

/* Variante oscura: la puerta de la Olimpiada y el botón principal. */
.puerta-noche {
  min-height: 76px;
  border-color: var(--azul-noche);
  background: var(--azul-noche);
  color: var(--marfil);
}

.puertas .puerta-noche .puerta-titulo { font-size: 1.25rem; font-weight: 700; }
.puerta-noche .puerta-detalle { color: var(--claro-sobre-noche); }
.puerta-noche .puerta-flecha { stroke: var(--oro); }

/* Variante con borde marcado: la segunda opción de «¿Quién eres?». */
.puerta-borde {
  min-height: 74px;
  border: 1.5px solid var(--azul-noche);
}

.pildora-oro {
  flex: none;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--oro);
  color: #141A33;
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
}

.pie {
  margin-top: 22px;
  text-align: center;
  color: var(--texto-2);
  font-size: 0.8125rem;
}

/* En computadora, las puertas van una al lado de la otra. */
@media (min-width: 720px) {
  .portada { padding: 48px 32px 28px; }
  .marca { gap: 16px; }
  .marca-raya { width: 56px; }
  .marca-eslogan { font-size: 1.25rem; }
  .puertas {
    flex-direction: row;
    gap: 18px;
  }
  .puertas .puerta {
    flex: 1 1 0;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    min-height: 132px;
    padding: 22px 24px;
    border-radius: 16px;
  }
  .puertas .puerta .puerta-titulo { font-size: 1.5rem; }
  .puertas .puerta-detalle { font-size: 0.875rem; }
  .puertas .pildora-oro { order: -1; margin-bottom: auto; }
  .puertas .puerta-flecha { display: none; }
}

/* ---------- Páginas interiores ---------- */

.encabezado {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
  padding: 0 16px 0 8px;
  border-bottom: 1px solid var(--borde);
}

.volver {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding: 0 8px;
  color: var(--tinta);
  font-size: 0.9375rem;
  text-decoration: none;
}

.volver svg { width: 20px; height: 20px; stroke: currentColor; }

.marca-mini {
  font-family: var(--fuente-marca);
  font-weight: 400;
  font-size: 0.9375rem;
  letter-spacing: 0.08em;
}

.pagina {
  min-height: calc(100vh - 58px);
  min-height: calc(100dvh - 58px);
  max-width: 34rem;
  margin: 0 auto;
  padding: 20px 20px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.cabeza {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.etiqueta {
  color: var(--terracota-texto);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.titulo-pagina {
  font-size: 1.5625rem;
  font-weight: 700;
  line-height: 1.2;
}

.subtitulo {
  color: var(--texto-2);
  font-size: 0.875rem;
}

.titulo-seccion {
  font-size: 1rem;
  font-weight: 600;
}

.al-final {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.al-final .titulo-seccion { font-size: 1.125rem; }

/* Tarjeta azul noche con la fecha y la cuenta regresiva. */
.tarjeta-fecha {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px;
  border-radius: 16px;
  background: var(--azul-noche);
  color: #F3EEE2;
}

.tarjeta-fecha-dia { font-size: 0.9375rem; font-weight: 600; }

.cuenta-regresiva {
  color: var(--oro);
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1.25;
}

.tarjeta-fecha-detalle { color: #AEB8D8; font-size: 0.8125rem; }

.seccion {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chip {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--borde);
  background: var(--blanco);
  font-size: 0.875rem;
}

/* Lista de materias de Colegio. */
.lista {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.fila {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  padding: 0 16px;
  border: 1px solid var(--borde);
  border-radius: 12px;
  background: var(--blanco);
}

.fila-nombre { font-size: 1.0625rem; font-weight: 600; }

.pildora-suave {
  flex: none;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--fondo-suave);
  font-size: 0.8125rem;
}

.caja-suave {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radio);
  background: var(--fondo-suave);
}

.boton {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--alto-boton);
  padding: 0 20px;
  border-radius: 10px;
  background: var(--azul-noche);
  color: var(--blanco);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
}

button.boton {
  width: 100%;
  border: 0;
  font-family: inherit;
  cursor: pointer;
}

button.boton:disabled { opacity: 0.6; cursor: default; }

/* Botón secundario: mismo tamaño, con borde y sin relleno. */
.boton.boton-borde {
  border: 1.5px solid var(--azul-noche);
  background: var(--blanco);
  color: var(--azul-noche);
}

/* Tarjeta blanca simple (páginas «muy pronto» y 404). */
.tarjeta {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--blanco);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 24px 20px;
}

.mensaje {
  font-size: 1.125rem;
}

/* ---------- Áreas y prácticas ---------- */

/* Aviso de las pantallas de la versión de prueba. */
.aviso-prueba {
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--fondo-suave);
  color: var(--texto-2);
  font-size: 0.8125rem;
}

.aviso-prueba strong { color: var(--terracota-texto); }

/* Tarjetas que llevan a otra pantalla: áreas y temas. */
.lista-tarjetas {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nota {
  color: var(--texto-2);
  font-size: 0.875rem;
  text-align: center;
}

.titulo-practica {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
}

.practica {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.practica-avance {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.practica-contador {
  color: var(--texto-2);
  font-size: 0.875rem;
  font-weight: 600;
}

.barra {
  height: 6px;
  border-radius: 999px;
  background: var(--fondo-suave);
  overflow: hidden;
}

.barra-relleno {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--oro);
}

.tarjeta-pregunta { gap: 18px; }

.pregunta {
  font-size: 1.0625rem;
  line-height: 1.6;
}

.pregunta:focus { outline: none; }

.opciones {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.opcion {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 10px 14px;
  border: 1.5px solid var(--borde);
  border-radius: 12px;
  background: var(--blanco);
  color: var(--tinta);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.opcion:disabled { cursor: default; }
.opcion:disabled:not(.fallada):not(.correcta) { opacity: 0.55; }

.opcion-letra {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--fondo-suave);
  font-size: 0.875rem;
  font-weight: 700;
}

.opcion.fallada {
  border-color: var(--terracota);
  background: #FBF0EA;
  color: var(--texto-2);
}

.opcion.fallada .opcion-letra { background: var(--terracota-texto); color: var(--blanco); }

.opcion.correcta {
  border-color: var(--azul-noche);
  background: #EEF0F7;
}

.opcion.correcta .opcion-letra { background: var(--azul-noche); color: var(--blanco); }

/* Respuesta escrita: el número y su unidad. */
.respuesta-numero {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.etiqueta-campo {
  font-size: 0.875rem;
  font-weight: 600;
}

.campo-numero {
  display: flex;
  align-items: center;
  gap: 10px;
}

.campo-numero input {
  flex: 1;
  min-width: 0;
  min-height: 52px;
  padding: 0 14px;
  border: 1.5px solid var(--borde);
  border-radius: 12px;
  background: var(--blanco);
  color: var(--tinta);
  font: inherit;
  font-size: 1.125rem;
}

.campo-numero input:focus {
  border-color: var(--azul-noche);
  outline: none;
  box-shadow: 0 0 0 3px rgba(18, 26, 58, 0.15);
}

.campo-numero input:read-only { background: var(--fondo-suave); }

.unidad {
  flex: none;
  min-width: 2.5em;
  font-weight: 600;
}

.ayuda-numero {
  color: var(--texto-2);
  font-size: 0.8125rem;
}

.ayuda-numero.ayuda-error { color: var(--terracota-texto); font-weight: 600; }

/* Pista, acierto y solución, debajo de la pregunta. */
.retro-zona:empty,
.acciones:empty { display: none; }

.retro {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 12px;
  border-left: 4px solid;
}

.retro-titulo { font-weight: 700; }
.retro-subtitulo { font-weight: 600; }

.retro-nota {
  color: var(--texto-2);
  font-size: 0.875rem;
}

.retro-pista {
  border-left-color: var(--terracota);
  background: var(--fondo-suave);
}

.retro-pista .retro-titulo { color: var(--terracota-texto); }

.retro-acierto {
  border-left-color: var(--azul-noche);
  background: #EEF0F7;
}

.retro-fallo {
  border: 1px solid var(--borde);
  border-left: 4px solid var(--terracota);
  background: var(--blanco);
}

.solucion {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding-left: 22px;
}

.ver-solucion summary {
  padding: 10px 0;
  color: var(--azul-noche);
  font-weight: 600;
  cursor: pointer;
}

.ver-solucion > :not(summary) + * { margin-top: 8px; }

/* Resultado al terminar. */
.tarjeta-resultado { gap: 6px; }

.puntaje {
  color: var(--texto-2);
  font-size: 1.125rem;
}

.puntaje-numero {
  margin-right: 4px;
  color: var(--azul-noche);
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.1;
}

.resumen {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.resumen-fila {
  padding: 12px 14px;
  border: 1px solid var(--borde);
  border-radius: 12px;
  background: var(--blanco);
}

.resumen-cabeza {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.resumen-numero,
.resumen-puntos {
  font-weight: 600;
}

.resumen-estado {
  color: var(--texto-2);
  font-size: 0.875rem;
}

.botones {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Fórmulas (KaTeX): un poco más chicas que su tamaño original, y las largas se desplazan
   dentro de su caja en vez de ensanchar la página. */
.katex { font-size: 1.1em; }

.katex-display {
  margin: 0.5em 0;
  overflow-x: auto;
  overflow-y: hidden;
}

/* Contorno visible al moverse con el teclado. */
.puerta:focus-visible,
.volver:focus-visible,
.boton:focus-visible,
.opcion:focus-visible,
.ver-solucion summary:focus-visible {
  outline: 3px solid var(--azul-noche);
  outline-offset: 2px;
}

/* Los títulos reciben el foco al cambiar de pantalla (para los lectores de pantalla), sin contorno. */
h1[tabindex="-1"]:focus { outline: none; }

[hidden] { display: none !important; }

/* ---------- Temario, cursos y niveles ---------- */

/* Áreas de la página Olimpiadas: cada una lleva a su temario. */
.chips a.chip {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--tinta);
  text-decoration: none;
}

.enlace-flecha {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
  min-height: 44px;
  color: var(--azul-noche);
  font-weight: 600;
  text-decoration: none;
}

.enlace-flecha svg { width: 18px; height: 18px; stroke: currentColor; }

.temario {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Fila para elegir área o curso; la opción actual va en azul noche. */
.selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.selector-opcion {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  min-height: 44px;
  padding: 0 14px;
  border: 1.5px solid var(--borde);
  border-radius: 999px;
  background: var(--blanco);
  color: var(--tinta);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
}

.selector-opcion[aria-current="page"] {
  border-color: var(--azul-noche);
  background: var(--azul-noche);
  color: var(--blanco);
}

.ayuda-temario {
  color: var(--texto-2);
  font-size: 0.875rem;
}

.unidades {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.unidad {
  border: 1px solid var(--borde);
  border-radius: 12px;
  background: var(--blanco);
}

/* Título de la unidad, con la cantidad de temas debajo y una flecha que gira al abrirla. */
.unidad-titulo {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2px 12px;
  min-height: 52px;
  padding: 12px 16px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.unidad-titulo::-webkit-details-marker { display: none; }

.unidad-titulo::after {
  content: '';
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 9px;
  height: 9px;
  margin: 0 4px 4px;
  border-right: 2px solid var(--terracota-texto);
  border-bottom: 2px solid var(--terracota-texto);
  transform: rotate(45deg);
}

.unidad[open] > .unidad-titulo::after { margin: 4px 4px 0; transform: rotate(-135deg); }

.unidad-cantidad {
  grid-column: 1;
  color: var(--texto-2);
  font-size: 0.8125rem;
  font-weight: 400;
}

.unidad-titulo:focus-visible { outline: 3px solid var(--azul-noche); outline-offset: 2px; border-radius: 12px; }

.unidad[open] .unidad-titulo { border-bottom: 1px solid var(--borde); }

.temas {
  margin: 0;
  padding: 0;
  list-style: none;
}

.tema {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
}

.tema + .tema { border-top: 1px solid var(--fondo-suave); }

.tema-titulo { font-size: 0.9375rem; font-weight: 600; }

.tema-descripcion {
  color: var(--texto-2);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.tema-pronto {
  color: var(--texto-2);
  font-size: 0.8125rem;
  font-style: italic;
}

/* Los tres niveles de un tema. */
.niveles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 6px;
}

.nivel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 56px;
  padding: 6px 4px;
  border: 1.5px solid var(--azul-noche);
  border-radius: 10px;
  background: var(--blanco);
  color: var(--azul-noche);
  text-align: center;
  text-decoration: none;
}

.nivel-nombre { font-size: 0.875rem; font-weight: 700; }
.nivel-detalle { color: var(--texto-2); font-size: 0.75rem; }
.nivel-hecho { background: #EEF0F7; }

.nivel-pronto {
  border-style: dashed;
  border-color: var(--borde);
  color: var(--texto-2);
}

.pildora-nivel {
  align-self: flex-start;
  margin-top: -8px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--fondo-suave);
  color: var(--terracota-texto);
  font-size: 0.8125rem;
  font-weight: 600;
}

/* Una fórmula corta y el signo que la sigue no se separan al cortar la línea (formulas.js). */
.sin-corte { white-space: nowrap; }

/* ---------- Dibujos de las preguntas ---------- */

.figura {
  display: block;
  width: 100%;
  max-width: 30rem;
  height: auto;
  margin: 0 auto;
}

.fig-texto { fill: var(--tinta); font-family: var(--fuente-texto); font-size: 12px; }
.fig-texto-suave { fill: var(--texto-2); font-family: var(--fuente-texto); font-size: 11px; }
.fig-texto-grande { font-size: 16px; font-weight: 700; }
.fig-via { fill: var(--fondo-suave); }
.fig-via-centro { stroke: var(--borde); stroke-width: 2; stroke-dasharray: 8 6; }
.fig-auto-azul .fig-carroceria { fill: var(--azul-noche); }
.fig-auto-terracota .fig-carroceria { fill: var(--terracota); }
.fig-ventana { fill: #DDE3F0; }
.fig-rueda { fill: var(--tinta); }
.fig-mastil { stroke: var(--tinta); stroke-width: 2; }
.fig-bandera { fill: var(--oro); }
.fig-cota { stroke: var(--texto-2); stroke-width: 1.2; }
.fig-flecha { stroke: var(--terracota-texto); stroke-width: 2; }
.fig-flecha-punta { fill: var(--terracota-texto); }
.fig-puente { fill: var(--texto-2); }
.fig-pilar { fill: var(--borde); }
.fig-suelo { stroke: var(--texto-2); stroke-width: 2; }
.fig-tren { fill: var(--terracota); }
.fig-punto { fill: var(--azul-noche); }
.fig-largada { stroke: var(--texto-2); stroke-width: 1.5; stroke-dasharray: 4 4; }
.fig-meta { stroke: var(--oro); stroke-width: 2; stroke-dasharray: 4 4; }
.fig-cuadricula { stroke: #ECE6DA; stroke-width: 1; }
.fig-eje { stroke: var(--texto-2); stroke-width: 1.5; }
.fig-texto-fuerte { font-weight: 700; }

/* Dinámica: plano inclinado, poleas y bloques. */
.fig-plano { fill: #F3EEE4; stroke: var(--texto-2); stroke-width: 1.5; stroke-linejoin: round; }
.fig-arco { fill: none; stroke: var(--texto-2); stroke-width: 1.2; }
.fig-bloque { fill: #DDE3F0; stroke: var(--azul-noche); stroke-width: 1.5; }
.fig-cuerda { stroke: var(--tinta); stroke-width: 1.5; }
.fig-polea { fill: var(--blanco); stroke: var(--azul-noche); stroke-width: 2; }
.fig-eje-polea { fill: var(--azul-noche); }
.fig-techo { stroke: var(--texto-2); stroke-width: 2; }
.fig-techo-raya { stroke: var(--texto-2); stroke-width: 1; }
.fig-mesa { fill: var(--borde); }

/* Cargas eléctricas: positivas en terracota y negativas en azul noche. */
.fig-carga-positiva { fill: var(--terracota); }
.fig-carga-negativa { fill: var(--azul-noche); }
.fig-signo { fill: var(--blanco); font-family: var(--fuente-texto); font-size: 18px; font-weight: 700; }
.fig-linea-carga { stroke: var(--texto-2); stroke-width: 1.2; stroke-dasharray: 4 4; }

/* Plano cartesiano: hasta tres rectas con colores distintos. */
.fig-recta { stroke-width: 2.5; stroke-linecap: round; }
.fig-recta-0 { stroke: var(--azul-noche); }
.fig-recta-1 { stroke: var(--terracota); }
.fig-recta-2 { stroke: var(--texto-2); stroke-dasharray: 7 5; }
.fig-recta-texto-0 { fill: var(--azul-noche); font-weight: 700; }
.fig-recta-texto-1 { fill: var(--terracota-texto); font-weight: 700; }
.fig-recta-texto-2 { fill: var(--texto-2); font-weight: 700; }

/* Química: cajas de orbitales y escala de pH. */
.fig-caja { fill: var(--blanco); stroke: var(--azul-noche); stroke-width: 1.5; }
.fig-electron { stroke: var(--tinta); stroke-width: 1.8; }
.fig-electron-punta { fill: var(--tinta); }
.fig-borde-escala { fill: none; stroke: var(--texto-2); stroke-width: 1; }
.fig-marca-ph { fill: var(--tinta); }
.fig-marca-ph-linea { stroke: var(--tinta); stroke-width: 1; }

/* Genética: cuadro de Punnett. */
.fig-celda { fill: var(--blanco); stroke: var(--borde); stroke-width: 1.5; }
.fig-celda-cabeza { fill: var(--fondo-suave); stroke: var(--borde); stroke-width: 1.5; }
.fig-oculta { fill: var(--terracota-texto); font-size: 16px; font-weight: 700; }

.fig-tramo-linea { stroke: var(--azul-noche); stroke-width: 3; stroke-linecap: round; }
.fig-tramo-halo { stroke: transparent; stroke-width: 16; stroke-linecap: round; }
.fig-tramo-toque { stroke: transparent; stroke-width: 30; stroke-linecap: round; pointer-events: stroke; }
.fig-tramo-punto { fill: var(--azul-noche); pointer-events: none; }

/* Gráfico para tocar: el tramo elegido se marca en oro; el fallado, en terracota. */
.figura-grafico[role="group"] .fig-tramo { cursor: pointer; }
.fig-tramo:focus { outline: none; }
.fig-tramo:focus-visible .fig-tramo-halo { stroke: rgba(18, 26, 58, 0.18); }
.fig-tramo.elegido .fig-tramo-halo { stroke: var(--oro); }
.fig-tramo.fallado .fig-tramo-linea { stroke: var(--terracota); stroke-dasharray: 6 5; }
.fig-tramo.correcto .fig-tramo-halo { stroke: #C9D2EC; }
.fig-tramo.correcto .fig-tramo-linea { stroke-width: 4; }
.fig-tramo.desactivado { cursor: default; }

.pregunta-grafico {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ---------- Control deslizante ---------- */

.deslizador {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.deslizador-cabeza {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.deslizador-valor {
  color: var(--azul-noche);
  font-size: 1.25rem;
  font-weight: 700;
}

.deslizador input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 44px;
  margin: 0;
  background: transparent;
}

.deslizador input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  border: 1px solid var(--borde);
  border-radius: 999px;
  background: var(--fondo-suave);
}

.deslizador input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 30px;
  height: 30px;
  margin-top: -12px;
  border: 3px solid var(--blanco);
  border-radius: 50%;
  background: var(--azul-noche);
  box-shadow: 0 1px 4px rgba(18, 26, 58, 0.35);
}

.deslizador input[type="range"]::-moz-range-track {
  height: 8px;
  border: 1px solid var(--borde);
  border-radius: 999px;
  background: var(--fondo-suave);
}

.deslizador input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border: 3px solid var(--blanco);
  border-radius: 50%;
  background: var(--azul-noche);
}

.deslizador input[type="range"]:focus-visible { outline: 3px solid var(--azul-noche); outline-offset: 2px; }
.deslizador input[type="range"]:disabled { opacity: 0.6; }
