/* ==========================================================================
   Pantallas
   ========================================================================== */

/* =========================================================
   SPLASH / ONBOARDING
   ========================================================= */

.splash {
  min-height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: var(--s5);
  padding: var(--s6);
  text-align: center;
  background:
    radial-gradient(600px 380px at 50% 12%, var(--brand-soft), transparent 70%),
    var(--bg);
}
.splash__logo {
  font-size: 40px; font-weight: 900;
  letter-spacing: -1.4px; line-height: 1;
  background: linear-gradient(120deg, var(--brand), var(--gold-dark) 55%, var(--brand));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.splash__tag {
  font-size: var(--fs-lg); font-weight: 900;
  color: var(--ink-2); letter-spacing: 1.5px;
  text-transform: uppercase;
}
.splash__tag b { color: var(--brand); }

.ob-head { display: flex; align-items: center; gap: var(--s3); padding: var(--s4) var(--s5) 0; }
.ob-head .pbar { height: 14px; }

.ob-q {
  display: flex; flex-direction: column; gap: var(--s2);
  margin-bottom: var(--s2);
}
.ob-q__step { font-size: var(--fs-xs); font-weight: 900; color: var(--brand); text-transform: uppercase; letter-spacing: 1.2px; }

.ob-mascot-row { display: flex; align-items: flex-start; gap: var(--s3); }

.route-anim {
  display: flex; flex-direction: column; gap: 12px;
  width: 100%;
}
.route-line {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--card);
  border: 2px solid var(--line);
  font-weight: 800; font-size: var(--fs-sm);
  opacity: 0;
  animation: popIn .4s var(--ease-out) both;
}
.route-line__ico { font-size: 20px; }
.route-line.is-done { border-color: var(--green); background: var(--green-soft); color: var(--green-dark); }

/* =========================================================
   HOME — MAPA DE LA RUTA
   ========================================================= */

.home { padding-bottom: var(--s8); }

.unit-head {
  position: sticky; top: 0;
  z-index: 12;
  margin: 0 calc(var(--s5) * -1);
  padding: 12px var(--s5);
  background: var(--unit-c, var(--brand));
  color: #fff;
  box-shadow: 0 4px 0 rgba(0,0,0,.14);
  display: flex; align-items: center; gap: var(--s3);
}
.unit-head__meta { flex: 1; min-width: 0; }
.unit-head__k { font-size: 10px; font-weight: 900; letter-spacing: 1.2px; text-transform: uppercase; opacity: .82; }
.unit-head__t { font-size: var(--fs-lg); font-weight: 900; line-height: 1.15; }
.unit-head__btn {
  flex: none;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: var(--r-md);
  background: rgba(255,255,255,.2);
  color: #fff; font-size: 17px;
  transition: transform .14s var(--spring);
}
.unit-head__btn:active { transform: scale(.9); }

.path {
  position: relative;
  display: flex; flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: var(--s5) 0 var(--s6);
}

.path-node-wrap {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  align-self: center;      /* ancho de contenido: así el desplazamiento no ensancha la página */
  gap: 4px;
  /* El serpenteo va en `left` (posicionamiento relativo), no en transform
     —que lo pisaría la animación de entrada— ni en margin —que ensancharía
     el layout y desbordaría la pantalla—. */
  left: var(--dx, 0px);
  animation: nodeIn .5s var(--spring) both;
}

.node {
  position: relative;
  width: 72px; height: 66px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 28px;
  color: #fff;
  background: var(--node-c, var(--green));
  /* El segundo halo solo existe sobre el telón de la Ruta: --node-amb lo
     enciende .home en modo oscuro y en el resto de la app vale transparente. */
  box-shadow: 0 7px 0 var(--node-sh, var(--green-dark)), var(--node-amb, 0 0 transparent);
  transition: transform .12s var(--ease-out), box-shadow .12s var(--ease-out), filter .2s;
  -webkit-tap-highlight-color: transparent;
  border: 0;
}
.node::after {
  content: '';
  position: absolute; inset: 7px 12px auto;
  height: 30%;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,.32), transparent);
  pointer-events: none;
}
.node:active:not(.is-locked) { transform: translateY(7px); box-shadow: 0 0 0 var(--node-sh); }

.node.is-locked {
  --node-c: var(--line);
  --node-sh: #C9D2DF;
  color: var(--ink-3);
  cursor: not-allowed;
  filter: saturate(.2);
}
html[data-theme="dark"] .node.is-locked { --node-sh: #1A2434; }

.node.is-done { --node-c: var(--gold); --node-sh: var(--gold-dark); }
.node.is-boss {
  width: 86px; height: 78px;
  border-radius: 26px;
  font-size: 34px;
}
.node.is-active { animation: bounceHint 1.9s var(--ease-in-out) infinite; }

.node__halo {
  position: absolute; inset: -8px;
  border-radius: 50%;
  border: 4px solid var(--node-c);
  animation: haloPulse 1.9s var(--ease-out) infinite;
  pointer-events: none;
}
.node.is-boss .node__halo { border-radius: 30px; }

.node__ring {
  position: absolute; inset: -9px;
  border-radius: 50%;
  background: conic-gradient(var(--gold) calc(var(--p,0) * 1%), transparent 0);
  -webkit-mask: radial-gradient(circle, transparent 60%, #000 62%);
  mask: radial-gradient(circle, transparent 60%, #000 62%);
  pointer-events: none;
}

.node__label {
  /* 10px sobre --ink-3 daba 3:1 de contraste: los nombres de las paradas eran
     ilegibles sobre el fondo claro. Con --ink-2 y 11px se leen de verdad. */
  font-size: 11px; font-weight: 900;
  color: var(--ink-2);
  text-align: center;
  max-width: 120px;
  line-height: 1.25;
}

/* La burbuja "Empezar" se dibuja 40px por encima del nodo, es decir, encima de
   la etiqueta de la parada anterior. Se le reserva ese espacio. */
.path-node-wrap.has-bubble { margin-top: 34px; }

.node-optional {
  font-size: 10px; font-weight: 900;
  letter-spacing: .6px; text-transform: uppercase;
  color: var(--ink-3);
}
.node-crown {
  position: absolute; top: -12px; right: -6px;
  font-size: 18px;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.25));
}

.path-dots {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  align-self: center;
  gap: 5px;
  padding: 3px 0;
  left: var(--dx, 0px);
}
.path-dots i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--line);
}

.start-bubble {
  position: absolute;
  top: -40px; left: 50%;
  transform: translateX(-50%);
  padding: 7px 14px;
  border-radius: var(--r-full);
  background: var(--card);
  border: 2px solid var(--brand);
  color: var(--brand);
  font-size: var(--fs-xs); font-weight: 900;
  letter-spacing: .8px; text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 3px 0 var(--brand);
  animation: bounceHint 1.9s var(--ease-in-out) infinite;
  z-index: 3;
  pointer-events: none;   /* no debe tapar el nodo de arriba */
}
.start-bubble::after {
  content: '';
  position: absolute; bottom: -9px; left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-top-color: var(--brand);
  border-bottom: 0;
}

.daily-card {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s4);
  border-radius: var(--r-lg);
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 6px 0 var(--brand-dark);
  position: relative;
  overflow: hidden;
  text-align: left;
  width: 100%;
  transition: transform .12s;
}
.daily-card:active { transform: translateY(6px); box-shadow: 0 0 0 var(--brand-dark); }
.daily-card__ico { font-size: 32px; flex: none; align-self: flex-start; margin-top: 2px; }

/* Los tres textos van apilados en su propia columna. En flujo en línea las
   cajas de línea se solapaban (line-height < contenido) y el rótulo quedaba
   pegado al título de la misión. */
.daily-card__body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.daily-card__k {
  display: block;
  font-size: var(--fs-xs); font-weight: 800;
  letter-spacing: .6px; text-transform: uppercase;
  line-height: 1.4;
  color: #fff; opacity: .88;
}
.daily-card__t {
  display: block;
  font-size: var(--fs-lg); font-weight: 900; line-height: 1.25;
  overflow-wrap: anywhere;
}
.daily-card__s {
  display: block;
  font-size: var(--fs-sm); font-weight: 700; line-height: 1.4;
  opacity: .92;
  overflow-wrap: anywhere;
}

/* ------------------------- Retos de la semana: sección plegable -------------

   Cerrada es una barra y nada más: la Ruta sube sola porque todo esto sigue
   en el flujo normal de la columna: nada absoluto, nada de alturas fijas y
   ningún hueco reservado que dejar vacío.

   El cuerpo ocupa el ancho completo del teléfono (margen negativo) y el
   carrusel de dentro renuncia al suyo. Así el recorte que hace falta durante
   la animación cae justo donde el carrusel ya se cortaba, y abrir no ensancha
   las tarjetas de golpe al final del movimiento.
   --------------------------------------------------------------------------- */

.acc__head {
  display: flex; align-items: center; gap: var(--s3);
  width: 100%;
  min-height: 52px;
  padding: 10px var(--s4);
  border-radius: var(--r-lg);
  background: var(--card);
  border: 2px solid var(--line-2);
  box-shadow: var(--sh-1);
  text-align: left;
  transition: transform .12s var(--ease-out), border-color .2s, background .2s;
  -webkit-tap-highlight-color: transparent;
}
.acc__head:active { transform: scale(.99); }
.acc.is-open .acc__head { border-color: var(--line); }

.acc__meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
/* Una línea cada uno, siempre. Sin esto la barra cerrada mide 57 px unas veces
   y 87 px otras según lo que quepa, y eso es justo el salto que no debe haber. */
.acc__t, .acc__s { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc__t { font-size: var(--fs-sm); font-weight: 900; line-height: 1.25; color: var(--ink); }
.acc__s { font-size: var(--fs-xs); font-weight: 800; line-height: 1.3; color: var(--ink-3); }

/* El premio ganado no se esconde con la sección: se anuncia en la barra. */
.acc__premio { flex: none; font-size: var(--fs-xs); padding: 5px 10px; }
/* En un teléfono de 320 o 350 px la frase entera no cabe con el título. Se
   queda el gorro y el número —que es la señal— y las palabras se van; la
   etiqueta accesible del elemento sigue diciendo la frase completa. De 375 px
   en adelante caben las dos cosas, y si algún día no cupieran el título se
   recorta con puntos suspensivos en vez de partirse en dos líneas. */
@media (max-width: 359px) {
  .acc__premio-txt { display: none; }
}

.acc__arrow {
  flex: none;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: var(--r-full);
  background: var(--line-2);
  color: var(--ink-2);
  transition: transform .26s var(--ease-out), background .2s, color .2s;
}
.acc.is-open .acc__arrow { transform: rotate(180deg); }

.acc__body {
  /* El ancho completo del teléfono: el carrusel sangra hasta los bordes. */
  margin: 0 calc(var(--s5) * -1);
  /* Estos 260 ms tienen pareja: RETOS_MS en js/screens/home.js. Es el plazo
     tras el que la altura vuelve a `auto`. Si se cambia uno hay que cambiar
     el otro, o el cuerpo se soltaría antes de terminar de crecer. */
  transition: height .26s var(--ease-out);
}
/* El espacio entre la barra y las tarjetas va DENTRO del cuerpo, en el
   relleno del carrusel. Puesto como gap del acordeón o como margen del
   cuerpo quedaría un hueco de aire con la sección cerrada. */
.acc__body .hscroll { margin: 0; padding: 10px var(--s5) 8px; }

/* ==========================================================================
   EL TELÓN DE LA RUTA

   La Ruta dejó de ser una lista de botones sobre un fondo vacío para ser un
   escenario. Son tres capas, y ninguna se mueve sola:

     1. El telón   — va en `.phone`, el único elemento de la app que nunca se
                     desplaza. Degradado con matices, resplandores ambientales
                     y un grano finísimo. Queda quieto mientras el mapa pasa
                     por delante: eso es lo que da la sensación de avanzar por
                     dentro de un sitio en vez de mirar una lista.
     2. El mundo   — `.home::before`. Formas, símbolos y partículas de
                     emprendimiento a muy baja opacidad, en una tesela que se
                     repite a lo largo de todo el recorrido. SÍ se desplaza:
                     es el paisaje por el que se avanza.
     3. La luz     — el aura de la lección activa y la estela del camino, que
                     viven pegadas a sus nodos.

   NADA DE ESTO SE MUEVE
   No hay una sola animación nueva. Los adornos son estáticos, el grano es una
   trama repetida y los resplandores son degradados: el navegador los pinta
   una vez y no vuelve a tocarlos. La app ya tenía el rebote del nodo activo y
   el de la burbuja; añadir más habría sido ruido, y en un teléfono modesto,
   ruido que cuesta batería.

   CADA MODO CON SU POLARIDAD
   El azul marino es del modo oscuro y ahí se queda: en modo claro el mismo
   escenario se pinta en luminoso. Así ningún texto de la Ruta cambia de
   color y no hay nada que pueda quedar ilegible.
   ========================================================================== */

/* ------------------------- 1. El telón ------------------------- */

.phone[data-screen="home"] {
  background-color: var(--bg);
  background-image:
    /* grano finísimo: rompe la superficie plana sin dibujar nada */
    radial-gradient(rgba(16,32,58,.05) 1px, transparent 1.4px),
    /* ámbar arriba: la zona donde suele estar la lección activa */
    radial-gradient(115% 52% at 50% 4%, rgba(255,170,60,.16), transparent 60%),
    /* verde abajo a la izquierda: crecimiento */
    radial-gradient(88% 46% at 2% 76%, rgba(67,201,94,.13), transparent 66%),
    /* naranja de marca arriba a la derecha */
    radial-gradient(78% 42% at 100% 30%, rgba(255,107,26,.12), transparent 62%),
    linear-gradient(180deg, #FFFFFF 0%, var(--bg) 34%, #EDF1FA 70%, #EAE8F8 100%);
  background-size: 3px 3px, auto, auto, auto, auto;
}

html[data-theme="dark"] .phone[data-screen="home"] {
  background-color: #0B121F;
  background-image:
    radial-gradient(rgba(255,255,255,.05) 1px, transparent 1.4px),
    radial-gradient(115% 52% at 50% 5%, rgba(255,178,64,.11), transparent 62%),
    radial-gradient(88% 46% at 2% 76%, rgba(67,201,94,.10), transparent 66%),
    radial-gradient(78% 42% at 100% 32%, rgba(255,107,26,.11), transparent 62%),
    /* azul marino → azul algo más vivo → un matiz morado al fondo */
    linear-gradient(180deg, #0F1B33 0%, #101F3D 36%, #141B3A 70%, #1A1440 100%);
  background-size: 3px 3px, auto, auto, auto, auto;
}

/* ------------------------- 2. El mundo -------------------------

   `z-index: -1` dentro del contexto de apilamiento que crea `.home`: el
   paisaje queda por debajo de todo el contenido de la Ruta y por encima del
   telón, sin tener que tocar el z-index de una sola tarjeta.

   La opacidad va dentro del propio dibujo y no en la capa, para que los dos
   resplandores que la acompañan conserven la suya.
   ---------------------------------------------------------------------- */

.home { position: relative; z-index: 0; }

.home::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(closest-side, rgba(46,155,68,.07), transparent),
    radial-gradient(closest-side, rgba(217,164,0,.07), transparent),
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 780'><g fill='none' stroke='%2310203A' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' opacity='.05'><circle cx='352' cy='104' r='54'/><circle cx='34' cy='486' r='68'/><path d='M0 250c90 40 180-40 270 0s90 62 130 30'/><path d='M400 646c-92 40-192-30-282 6'/><g transform='translate(46 62)'><path d='M18 40a20 20 0 1 1 24 0c-4 3-5 6-5 10H23c0-4-1-7-5-10Z'/><path d='M24 58h12M26 65h8'/><path d='M30 2V-8M2 22H-8M68 22h-8M9 3 2-4M51 3l7-7'/></g><g transform='translate(292 178)'><path d='M30 0c14 12 20 28 20 44l-14 14H24L10 44C10 28 16 12 30 0Z'/><circle cx='30' cy='30' r='7'/><path d='M24 58l6 16 6-16'/><path d='M10 44-2 56l10 2M50 44l12 12-10 2'/></g><g transform='translate(50 332)'><path d='M0 70h84M8 70V48M30 70V32M52 70V40M74 70V16'/><path d='M4 22 30 6l20 12 30-18'/></g><path d='M330 400l7 18 18 7-18 7-7 18-7-18-18-7 18-7z'/><path d='M104 640l5 13 13 5-13 5-5 13-5-13-13-5 13-5z'/><g transform='translate(276 540)'><circle cx='34' cy='34' r='13'/><path d='M34 0v12M34 56v12M0 34h12M56 34h12M10 10l8 8M50 50l8 8M58 10l-8 8M18 50l-8 8'/></g><g transform='translate(160 690)'><path d='M28 58V28'/><path d='M28 36C18 36 8 28 8 14c14 0 20 8 20 22Z'/><path d='M28 42c10 0 20-8 20-22-14 0-20 8-20 22Z'/></g><g stroke='none' fill='%2310203A'><circle cx='196' cy='120' r='3'/><circle cx='250' cy='300' r='2.4'/><circle cx='120' cy='214' r='2.4'/><circle cx='360' cy='332' r='3'/><circle cx='70' cy='560' r='2.6'/><circle cx='330' cy='702' r='3'/><circle cx='210' cy='470' r='2.2'/><circle cx='150' cy='170' r='2'/></g></g></svg>");
  background-position: 10% 20%, 90% 64%, center top;
  background-size: 380px 380px, 340px 340px, 100% 780px;
  background-repeat: repeat-y, repeat-y, repeat-y;
}

html[data-theme="dark"] .home::before {
  background-image:
    radial-gradient(closest-side, rgba(67,201,94,.09), transparent),
    radial-gradient(closest-side, rgba(255,200,0,.075), transparent),
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 780'><g fill='none' stroke='%23FFFFFF' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' opacity='.055'><circle cx='352' cy='104' r='54'/><circle cx='34' cy='486' r='68'/><path d='M0 250c90 40 180-40 270 0s90 62 130 30'/><path d='M400 646c-92 40-192-30-282 6'/><g transform='translate(46 62)'><path d='M18 40a20 20 0 1 1 24 0c-4 3-5 6-5 10H23c0-4-1-7-5-10Z'/><path d='M24 58h12M26 65h8'/><path d='M30 2V-8M2 22H-8M68 22h-8M9 3 2-4M51 3l7-7'/></g><g transform='translate(292 178)'><path d='M30 0c14 12 20 28 20 44l-14 14H24L10 44C10 28 16 12 30 0Z'/><circle cx='30' cy='30' r='7'/><path d='M24 58l6 16 6-16'/><path d='M10 44-2 56l10 2M50 44l12 12-10 2'/></g><g transform='translate(50 332)'><path d='M0 70h84M8 70V48M30 70V32M52 70V40M74 70V16'/><path d='M4 22 30 6l20 12 30-18'/></g><path d='M330 400l7 18 18 7-18 7-7 18-7-18-18-7 18-7z'/><path d='M104 640l5 13 13 5-13 5-5 13-5-13-13-5 13-5z'/><g transform='translate(276 540)'><circle cx='34' cy='34' r='13'/><path d='M34 0v12M34 56v12M0 34h12M56 34h12M10 10l8 8M50 50l8 8M58 10l-8 8M18 50l-8 8'/></g><g transform='translate(160 690)'><path d='M28 58V28'/><path d='M28 36C18 36 8 28 8 14c14 0 20 8 20 22Z'/><path d='M28 42c10 0 20-8 20-22-14 0-20 8-20 22Z'/></g><g stroke='none' fill='%23FFFFFF'><circle cx='196' cy='120' r='3'/><circle cx='250' cy='300' r='2.4'/><circle cx='120' cy='214' r='2.4'/><circle cx='360' cy='332' r='3'/><circle cx='70' cy='560' r='2.6'/><circle cx='330' cy='702' r='3'/><circle cx='210' cy='470' r='2.2'/><circle cx='150' cy='170' r='2'/></g></g></svg>");
}

/* ------------------------- 3. La luz -------------------------

   El aura va delante del nodo en el DOM justamente para que se pinte debajo:
   dos elementos posicionados sin z-index se ordenan por orden de documento, y
   así no hace falta inventar una capa negativa que luego haya que vigilar.
   ------------------------------------------------------------------------- */

.node__aura {
  position: absolute;
  top: 34px; left: 50%;
  width: 200px; height: 200px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle,
    rgba(255,183,77,.30) 0%, rgba(255,140,40,.13) 40%, transparent 70%);
}
html[data-theme="dark"] .node__aura {
  background: radial-gradient(circle,
    rgba(255,196,92,.26) 0%, rgba(255,138,40,.12) 42%, transparent 72%);
}

/* El camino, con estela y con significado: dorado por donde ya se pasó, del
   color del nivel al llegar a la parada activa, apagado en lo que falta.
   La caja no cambia ni un píxel —la estela es una capa absoluta— así que el
   mapa mide exactamente lo que medía antes. */
.path-dots::before {
  content: '';
  position: absolute;
  top: -3px; bottom: -3px; left: 50%;
  width: 3px; margin-left: -1.5px;
  border-radius: var(--r-full);
  background: linear-gradient(180deg, transparent,
    var(--trail, var(--line)) 28%, var(--trail, var(--line)) 72%, transparent);
  opacity: .45;
}
/* El tramo que falta por recorrer no puede ser invisible: para quien acaba de
   entrar, ESO es el 90 % del mapa. Sube del color de una línea divisoria a un
   tono intermedio —visible, pero claramente por detrás de las paradas y de los
   tramos ya hechos, que son los que llevan color de verdad. */
.home .path-dots { --trail: #C6D2E4; }
html[data-theme="dark"] .home .path-dots { --trail: #3D4E6E; }

.path-dots i { background: var(--trail, var(--line)); }
html[data-theme="dark"] .path-dots i {
  box-shadow: 0 0 8px -1px var(--trail, transparent);
}

/* ------------------------- Profundidad -------------------------

   Sobre el telón, las superficies necesitan despegarse. El halo del nodo se
   pasa por una variable y no por una regla nueva: si se escribiera como
   `.home .node { box-shadow: … }` empataría en especificidad con
   `.node:active` y, al ir después, se quedaría con el efecto de pulsado.
   ---------------------------------------------------------------------- */

html[data-theme="dark"] .home { --node-amb: 0 14px 26px -12px rgba(0,0,0,.75); }

html[data-theme="dark"] .phone[data-screen="home"] .card,
html[data-theme="dark"] .phone[data-screen="home"] .acc__head {
  box-shadow: var(--sh-1), 0 12px 26px -16px rgba(0,0,0,.9);
}

.home .unit-head { box-shadow: 0 4px 0 rgba(0,0,0,.14), 0 14px 24px -16px rgba(6,12,26,.55); }
html[data-theme="dark"] .home .unit-head { box-shadow: 0 4px 0 rgba(0,0,0,.3), 0 16px 26px -14px rgba(0,0,0,.8); }

/* Los dos textos que se apoyan DIRECTAMENTE en el telón, sin tarjeta debajo:
   el rótulo "opcional" y el contador de XP del día. En --ink-3 se quedaban en
   4,1:1 sobre la zona iluminada del escenario —y el "opcional" ya venía de
   3,4:1 sobre el fondo plano de antes—. Es la misma corrección que ya se le
   hizo al nombre de la parada, y por el mismo motivo. */
.home .node-optional,
.home .daily-xp { color: var(--ink-2); }

/* =========================================================
   LECCIÓN
   ========================================================= */

.lesson-top {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s4) var(--s5) var(--s3);
  background: var(--bg);
  position: sticky; top: 0; z-index: 14;
}

.lesson-body {
  flex: 1;
  display: flex; flex-direction: column;
  gap: var(--s4);
  padding: 0 var(--s5) var(--s5);
}

.lesson-foot {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  padding: var(--s4) var(--s5) calc(var(--s4) + var(--safe-b));
  background: var(--card);
  border-top: 2px solid var(--line-2);
  z-index: 16;
  transition: background .28s var(--ease-out), border-color .28s;
  /* La retroalimentación ahora explica cada opción: si se alarga, el pie
     se desplaza por dentro en vez de comerse la pantalla. */
  max-height: 62vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.lesson-foot.is-ok  { background: var(--green-soft); border-color: var(--green); }
.lesson-foot.is-ko  { background: var(--red-soft); border-color: var(--red); }
.lesson-foot__msg { display: flex; align-items: flex-start; gap: 10px; margin-bottom: var(--s3); }
.lesson-foot__ico { font-size: 26px; flex: none; }
.lesson-foot__t { font-size: var(--fs-lg); font-weight: 900; line-height: 1.2; }
.lesson-foot__p { font-size: var(--fs-sm); font-weight: 700; line-height: 1.45; margin-top: 3px; }
.lesson-foot.is-ok .lesson-foot__t, .lesson-foot.is-ok .lesson-foot__p { color: var(--green-dark); }
.lesson-foot.is-ko .lesson-foot__t, .lesson-foot.is-ko .lesson-foot__p { color: var(--red-dark); }

/* ---- Desglose "por qué esta sí y las otras no" ---- */

.why { margin-bottom: var(--s3); }
.why__sum {
  list-style: none;
  cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  padding: 5px 0;
  font-size: var(--fs-xs); font-weight: 900;
  text-transform: uppercase; letter-spacing: .7px;
  color: var(--ink-2); opacity: .85;
}
.why__sum::-webkit-details-marker { display: none; }
.why__sum::after {
  content: '▾';
  font-size: 11px;
  transition: transform .22s var(--ease-out);
}
.why[open] .why__sum::after { transform: rotate(180deg); }

.why__list { display: flex; flex-direction: column; gap: 7px; margin-top: 4px; }
.why__item {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 9px 11px;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,.62);
  border-left: 4px solid var(--line);
}
html[data-theme="dark"] .why__item { background: rgba(255,255,255,.07); }
.why__item.is-ok { border-left-color: var(--green); }
.why__item.is-ko { border-left-color: var(--red); }
.why__item.is-ko .why__t { opacity: .82; }
.why__ico { flex: none; font-size: 13px; line-height: 1.6; }
.why__body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.why__t {
  font-size: var(--fs-sm); font-weight: 900; line-height: 1.35;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.why__tag {
  display: inline-block;
  margin-left: 7px;
  padding: 1px 7px;
  border-radius: 99px;
  background: var(--blue); color: #fff;
  font-size: 9px; font-weight: 900;
  letter-spacing: .5px; text-transform: uppercase;
  vertical-align: middle;
}
.why__p {
  font-size: var(--fs-sm); font-weight: 700; line-height: 1.45;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

.concept-card {
  border-radius: var(--r-lg);
  padding: var(--s5);
  background: linear-gradient(150deg, var(--card), var(--card-2));
  border: 2px solid var(--line);
  box-shadow: var(--sh-1);
}
.concept-card__tag {
  display: inline-block;
  padding: 5px 11px;
  border-radius: var(--r-full);
  background: var(--brand-soft); color: var(--brand);
  font-size: 10px; font-weight: 900;
  letter-spacing: 1px; text-transform: uppercase;
  margin-bottom: 10px;
}
.concept-card p { font-size: var(--fs-md); font-weight: 700; line-height: 1.6; color: var(--ink-2); margin-top: 10px; }
.concept-card p b { color: var(--ink); }

.keys { display: flex; flex-direction: column; gap: 8px; margin-top: var(--s4); }
.key-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 12px;
  border-radius: var(--r-md);
  background: var(--green-soft);
  font-size: var(--fs-sm); font-weight: 800;
  color: var(--green-dark);
  line-height: 1.45;
}
.key-row__ico { flex: none; }

.case-card {
  border-radius: var(--r-lg);
  padding: var(--s5);
  background: var(--blue-soft);
  border: 2px solid var(--blue);
}
.case-card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.case-card__emoji { font-size: 30px; }
.case-card__t { font-size: var(--fs-lg); font-weight: 900; color: var(--blue-dark); }
.case-card p { font-size: var(--fs-md); font-weight: 700; line-height: 1.6; color: var(--ink-2); }

.q-title { font-size: var(--fs-xl); font-weight: 900; line-height: 1.25; }
.q-sub { font-size: var(--fs-sm); font-weight: 700; color: var(--ink-3); line-height: 1.45; }

/* Simulación de consecuencias */
.sim-out { display: flex; flex-direction: column; gap: 10px; }
.sim-bar {
  display: grid;
  grid-template-columns: 96px 1fr 62px;
  align-items: center; gap: 10px;
}
.sim-bar__label { font-size: var(--fs-xs); font-weight: 900; color: var(--ink-2); text-transform: uppercase; letter-spacing: .4px; }
.sim-bar__track {
  height: 14px; border-radius: 99px;
  background: var(--line);
  position: relative; overflow: hidden;
}
.sim-bar__fill {
  position: absolute; top: 0; bottom: 0; left: 50%;
  border-radius: 99px;
  background: var(--green);
  width: 0;
  transition: width .8s var(--ease-out), left .8s var(--ease-out);
}
.sim-bar__fill.neg { background: var(--red); }
.sim-bar__val { font-size: var(--fs-sm); font-weight: 900; text-align: right; }

.slider-box {
  border-radius: var(--r-lg);
  padding: var(--s5);
  background: var(--card);
  border: 2px solid var(--line);
  display: flex; flex-direction: column; gap: var(--s4);
}
.slider-box__val {
  font-size: var(--fs-3xl); font-weight: 900;
  text-align: center; color: var(--brand);
  line-height: 1;
}
.slider-box__scale { display: flex; justify-content: space-between; font-size: var(--fs-xs); font-weight: 800; color: var(--ink-3); }

/* Match */
.match-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.match-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: stretch; }
.match-cell {
  padding: 13px;
  border-radius: var(--r-md);
  border: 2px solid var(--line);
  background: var(--card);
  box-shadow: 0 3px 0 var(--line);
  font-size: var(--fs-sm); font-weight: 800;
  line-height: 1.35;
  text-align: left;
  display: flex; align-items: center;
  transition: all .18s var(--ease-out);
}
.match-cell.is-sel { border-color: var(--blue); background: var(--blue-soft); color: var(--blue-dark); box-shadow: 0 3px 0 var(--blue-dark); }
.match-cell.is-ok  { border-color: var(--green); background: var(--green-soft); color: var(--green-dark); box-shadow: 0 3px 0 var(--green-dark); opacity: .65; pointer-events: none; }
.match-cell.is-ko  { animation: shake .4s; border-color: var(--red); }

/* Escribir */
.write-box { display: flex; flex-direction: column; gap: 10px; }
.write-count { font-size: var(--fs-xs); font-weight: 800; color: var(--ink-3); text-align: right; }

/* Resumen final de lección */
.finish {
  min-height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: var(--s5);
  padding: var(--s6);
  text-align: center;
}
.finish__stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; width: 100%; }
.finish__stat {
  border-radius: var(--r-md);
  padding: 3px;
  background: var(--st-c, var(--gold));
  box-shadow: 0 3px 0 var(--st-sh, var(--gold-dark));
}
.finish__stat b { display: block; padding: 4px; color: #fff; font-size: 10px; letter-spacing: .8px; text-transform: uppercase; }
.finish__stat span {
  display: block;
  background: var(--card);
  border-radius: 11px;
  padding: 10px 4px;
  font-size: var(--fs-xl); font-weight: 900;
  color: var(--st-c);
}

/* =========================================================
   MISIÓN
   ========================================================= */

.mission-hero {
  border-radius: var(--r-lg);
  padding: var(--s5);
  background: linear-gradient(140deg, var(--purple), #C77DFF);
  color: #fff;
  box-shadow: 0 6px 0 var(--purple-dark);
  position: relative; overflow: hidden;
}
.mission-hero__tag {
  display: inline-block; padding: 5px 11px;
  border-radius: 99px;
  background: rgba(255,255,255,.24);
  font-size: 10px; font-weight: 900; letter-spacing: 1px; text-transform: uppercase;
  margin-bottom: 8px;
}
.mission-hero h2, .mission-hero h3 { font-size: var(--fs-xl); font-weight: 900; line-height: 1.2; }
.mission-hero p { font-size: var(--fs-sm); font-weight: 700; line-height: 1.5; opacity: .95; margin-top: 8px; }

.rubric { display: flex; flex-direction: column; gap: 9px; }
.rubric-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px;
  border-radius: var(--r-md);
  border: 2px solid var(--line);
  background: var(--card);
  animation: popIn .4s var(--ease-out) both;
}
.rubric-item.ok { border-color: var(--green); background: var(--green-soft); }
.rubric-item.no { border-color: var(--gold-dark); background: var(--gold-soft); }
.rubric-item__ico { font-size: 17px; flex: none; margin-top: 1px; }
.rubric-item__t { font-size: var(--fs-sm); font-weight: 900; line-height: 1.3; }
.rubric-item__p { font-size: var(--fs-sm); font-weight: 700; color: var(--ink-2); line-height: 1.45; margin-top: 3px; }

/* Cuánto vale cada criterio: hace visible de dónde sale la nota. */
.rubric-item__pts {
  flex: none;
  align-self: flex-start;
  padding: 3px 9px;
  border-radius: var(--r-full);
  background: var(--gold-soft);
  color: var(--gold-dark);
  font-size: var(--fs-xs); font-weight: 900;
  white-space: nowrap;
}
.rubric-item__pts.is-won { background: var(--green-soft); color: var(--green-dark); }

/* ---- Desglose de la calificación ---- */

.score-card { text-align: left; }
.score-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 2px solid var(--line-2);
}
.score-row:last-child { border-bottom: 0; }
.score-row__k {
  display: flex; flex-direction: column; gap: 2px;
  min-width: 0;
  font-size: var(--fs-sm); font-weight: 800; color: var(--ink-2);
}
.score-row__hint { font-size: var(--fs-xs); font-weight: 700; color: var(--ink-3); }
.score-row__v {
  flex: none;
  font-size: var(--fs-md); font-weight: 900; color: var(--ink);
  white-space: nowrap;
}
.score-row.is-total { border-top: 2px solid var(--line); border-bottom: 0; margin-top: 2px; }
.score-row.is-total .score-row__k { color: var(--ink); font-weight: 900; }
.score-row.is-total .score-row__v { font-size: var(--fs-xl); }

.score-note {
  margin-top: 12px;
  padding: 11px 12px;
  border-radius: var(--r-sm);
  background: var(--line-2);
  font-size: var(--fs-sm); font-weight: 700; line-height: 1.5;
  color: var(--ink-2);
}
.score-note b { color: var(--ink); font-weight: 900; }
.score-note--warn { background: var(--gold-soft); color: var(--gold-dark); }
.score-note--warn b { color: var(--gold-dark); }
.score-note--ok { background: var(--green-soft); color: var(--green-dark); }
.score-note--ok b { color: var(--green-dark); }

.score-ring {
  width: 108px; height: 108px;
  border-radius: 50%;
  display: grid; place-items: center;
  margin: 0 auto;
  background: conic-gradient(var(--sc-c, var(--green)) calc(var(--p,0) * 1%), var(--line) 0);
  transition: --p 1s var(--ease-out);
}
.score-ring__in {
  width: 82%; height: 82%;
  border-radius: 50%;
  background: var(--card);
  display: grid; place-items: center;
  flex-direction: column;
}
.score-ring__n { font-size: var(--fs-2xl); font-weight: 900; color: var(--sc-c, var(--green)); line-height: 1; }

/* =========================================================
   SIMULADOR
   ========================================================= */

.sim-head {
  border-radius: var(--r-lg);
  padding: var(--s4);
  background: linear-gradient(140deg, var(--ink), #22375C);
  color: #fff;
  box-shadow: var(--sh-2);
}
.sim-head__row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.sim-head__week { font-size: 10px; font-weight: 900; letter-spacing: 1.2px; text-transform: uppercase; opacity: .7; }
.sim-head__cash { font-size: var(--fs-3xl); font-weight: 900; line-height: 1; }

.sim-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: var(--s4); }
.sim-kpi {
  background: rgba(255,255,255,.1);
  border-radius: var(--r-md);
  padding: 9px 6px;
  text-align: center;
}
.sim-kpi__l { font-size: 9px; font-weight: 900; letter-spacing: .5px; text-transform: uppercase; opacity: .68; }
.sim-kpi__v { font-size: var(--fs-md); font-weight: 900; margin-top: 2px; }

.sim-chart {
  width: 100%; height: 92px;
  border-radius: var(--r-md);
  background: rgba(255,255,255,.08);
  margin-top: var(--s3);
}

.decision-card {
  border-radius: var(--r-lg);
  padding: var(--s5);
  background: var(--card);
  border: 2px solid var(--line);
  box-shadow: var(--sh-1);
  display: flex; flex-direction: column; gap: var(--s3);
}
.decision-card__tag {
  display: inline-flex; align-self: flex-start;
  padding: 5px 11px; border-radius: 99px;
  font-size: 10px; font-weight: 900; letter-spacing: 1px; text-transform: uppercase;
  background: var(--red-soft); color: var(--red-dark);
}

.sim-result-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 13px;
  border-radius: var(--r-md);
  background: var(--card-2);
  border: 2px solid var(--line-2);
  font-size: var(--fs-sm); font-weight: 800;
  animation: popIn .4s var(--ease-out) both;
}
.sim-result-row b { font-size: var(--fs-md); font-weight: 900; }

.dial {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s4);
  border-radius: var(--r-md);
  background: var(--card);
  border: 2px solid var(--line);
}
.dial__btn {
  width: 42px; height: 42px; flex: none;
  border-radius: var(--r-md);
  background: var(--line-2);
  color: var(--ink);
  font-size: 20px; font-weight: 900;
  display: grid; place-items: center;
  transition: transform .12s var(--spring), background .2s;
}
.dial__btn:active { transform: scale(.88); background: var(--line); }
.dial__val { flex: 1; text-align: center; }
.dial__n { font-size: var(--fs-2xl); font-weight: 900; line-height: 1; }
.dial__l { font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .6px; color: var(--ink-3); }

/* =========================================================
   MENTOR
   ========================================================= */

.chat {
  display: flex; flex-direction: column;
  gap: 12px;
  padding: var(--s5) var(--s5) var(--s4);
  flex: 1;
}
.msg { display: flex; gap: 9px; align-items: flex-end; max-width: 90%; }
.msg--me { align-self: flex-end; flex-direction: row-reverse; }
/* El avatar del chat era el caso más flagrante de "Chispa parece un emoji":
   30 px de dibujo, la mitad que en cualquier otra pantalla. Ahora comparte la
   escala del resto — 56 px de caja, unos 52 de personaje — y se le quita el
   recorte circular, que le cortaba la chispa de la cabeza y los pies, que es
   justo lo que lo hace reconocible.

   No se agranda más por una razón medida: el chat guarda hasta 120 mensajes y
   cada uno instancia un SVG completo con sus dos degradados. */
.msg__av {
  width: 56px; height: 56px; flex: none;
  display: grid; place-items: center;
}
.msg__av svg { width: 100%; height: 100%; overflow: visible; }
.msg__bub {
  padding: 12px 15px;
  border-radius: 18px;
  background: var(--card);
  border: 2px solid var(--line);
  font-size: var(--fs-md); font-weight: 700;
  line-height: 1.55;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}
.msg--me .msg__bub {
  background: var(--brand);
  border-color: var(--brand-dark);
  color: #fff;
  border-bottom-right-radius: 6px;
}
.msg--bot .msg__bub { border-bottom-left-radius: 6px; }
.msg__bub b { color: var(--brand); font-weight: 900; }
.msg--me .msg__bub b { color: #fff; }
.msg__bub ul { margin: 6px 0 0; padding-left: 4px; display: flex; flex-direction: column; gap: 5px; }
.msg__bub li { display: flex; gap: 7px; font-size: var(--fs-sm); }

.chat-dock {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  padding: 10px var(--s4) calc(10px + var(--safe-b));
  background: var(--card);
  border-top: 2px solid var(--line-2);
  display: flex; flex-direction: column; gap: 9px;
  z-index: 16;
}
.chat-quick { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chat-quick::-webkit-scrollbar { display: none; }
.chat-quick button {
  flex: none;
  padding: 8px 13px;
  border-radius: 99px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: var(--fs-xs); font-weight: 900;
  white-space: nowrap;
  border: 2px solid transparent;
  transition: transform .12s var(--spring);
}
.chat-quick button:active { transform: scale(.94); }
.chat-input-row { display: flex; gap: 8px; align-items: flex-end; }
.chat-input {
  flex: 1;
  padding: 12px 15px;
  border-radius: 22px;
  border: 2px solid var(--line);
  background: var(--bg);
  font-size: var(--fs-md); font-weight: 700;
  resize: none; max-height: 110px; min-height: 46px;
  line-height: 1.4;
}
.chat-input:focus { outline: none; border-color: var(--brand); }
.chat-send {
  width: 46px; height: 46px; flex: none;
  border-radius: 50%;
  background: var(--brand); color: #fff;
  display: grid; place-items: center;
  font-size: 18px;
  box-shadow: 0 3px 0 var(--brand-dark);
  transition: transform .12s;
}
.chat-send:active { transform: translateY(3px); box-shadow: none; }
.chat-send:disabled { opacity: .4; }

/* =========================================================
   MI NEGOCIO
   ========================================================= */

.dossier-hero {
  border-radius: var(--r-lg);
  padding: var(--s5);
  background: linear-gradient(140deg, var(--teal), #3DD6C4);
  color: #fff;
  box-shadow: 0 6px 0 var(--teal-dark);
  position: relative; overflow: hidden;
}
.dossier-hero h1, .dossier-hero h2 { font-size: var(--fs-2xl); font-weight: 900; line-height: 1.15; }
.dossier-hero p { font-size: var(--fs-sm); font-weight: 700; opacity: .95; margin-top: 4px; }

.doss-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: var(--s4);
  border-radius: var(--r-md);
  background: var(--card);
  border: 2px solid var(--line);
  text-align: left; width: 100%;
  transition: border-color .2s, background .2s, transform .12s;
}
.doss-item:active { transform: scale(.99); }
.doss-item.is-filled { border-color: var(--teal); background: var(--card); }
.doss-item__ico {
  width: 40px; height: 40px; flex: none;
  border-radius: var(--r-md);
  background: var(--line-2);
  display: grid; place-items: center;
  font-size: 20px;
}
.doss-item.is-filled .doss-item__ico { background: rgba(20,184,166,.16); }
.doss-item__t { font-size: var(--fs-md); font-weight: 900; }
.doss-item__p {
  font-size: var(--fs-sm); font-weight: 700; color: var(--ink-3);
  line-height: 1.45; margin-top: 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.doss-item.is-filled .doss-item__p { color: var(--ink-2); }

/* =========================================================
   PERFIL / LIGA / TIENDA
   ========================================================= */

.profile-hero {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: var(--s5) 0;
}
.avatar {
  width: 100px; height: 100px;
  border-radius: 50%;
  background: linear-gradient(150deg, var(--brand), var(--gold));
  display: grid; place-items: center;
  box-shadow: 0 6px 0 var(--brand-dark);
  position: relative;
}
.avatar__lvl {
  position: absolute; bottom: -6px; right: -6px;
  min-width: 34px; height: 34px; padding: 0 8px;
  border-radius: 99px;
  background: var(--ink); color: #fff;
  display: grid; place-items: center;
  font-size: var(--fs-sm); font-weight: 900;
  border: 3px solid var(--bg);
}

/* Estado del respaldo: en ámbar mientras no haya una copia reciente. */
.backup-card { text-align: left; transition: border-color .25s, background .25s; }
.backup-card.is-warn { border-color: var(--gold); background: var(--gold-soft); }
.backup-card.is-warn .tiny { color: var(--gold-dark); }

.lb-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px var(--s4);
  border-radius: var(--r-md);
  background: var(--card);
  border: 2px solid var(--line-2);
  transition: transform .2s var(--ease-out);
}
.lb-row.is-me { border-color: var(--brand); background: var(--brand-soft); }
.lb-row__pos {
  width: 30px; height: 30px; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: var(--fs-sm); font-weight: 900;
  background: var(--line-2); color: var(--ink-2);
}
.lb-row__pos.p1 { background: var(--gold); color: #5A4300; }
.lb-row__pos.p2 { background: #CBD5E1; color: #334155; }
.lb-row__pos.p3 { background: #E9A26B; color: #5B3617; }
.lb-row__name { flex: 1; font-size: var(--fs-md); font-weight: 800; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-row__xp { font-size: var(--fs-sm); font-weight: 900; color: var(--gold-dark); }

.league-belt {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 8px;
  scrollbar-width: none;
  width: 100%; min-width: 0;   /* el padre centra: sin esto toma su ancho de contenido */
}
.league-belt::-webkit-scrollbar { display: none; }
.league-pin {
  flex: none;
  width: 58px; height: 58px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 26px;
  background: var(--line-2);
  filter: grayscale(1); opacity: .5;
  transition: all .3s var(--spring);
}
.league-pin.is-on { filter: none; opacity: 1; background: var(--gold-soft); transform: scale(1.06); box-shadow: 0 3px 0 var(--gold-dark); }

.shop-item {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s4);
  border-radius: var(--r-lg);
  background: var(--card);
  border: 2px solid var(--line);
  box-shadow: 0 3px 0 var(--line);
  text-align: left; width: 100%;
  transition: transform .12s;
}
.shop-item:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 0 0 var(--line); }
.shop-item:disabled { opacity: .5; }
.shop-item__ico {
  width: 52px; height: 52px; flex: none;
  border-radius: var(--r-md);
  display: grid; place-items: center;
  font-size: 26px;
  background: var(--line-2);
}
.shop-item__price {
  flex: none;
  display: flex; align-items: center; gap: 4px;
  padding: 7px 12px;
  border-radius: 99px;
  background: var(--gold-soft);
  color: var(--gold-dark);
  font-size: var(--fs-sm); font-weight: 900;
}

/* =========================================================
   EMPTY STATE / VARIOS
   ========================================================= */

.empty {
  display: flex; flex-direction: column; align-items: center;
  gap: var(--s3); padding: var(--s7) var(--s5);
  text-align: center;
}
.empty__ico { font-size: 46px; opacity: .55; }

.kv { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 2px solid var(--line-2); }
.kv:last-child { border-bottom: 0; }
.kv__k { font-size: var(--fs-sm); font-weight: 800; color: var(--ink-3); }
.kv__v { font-size: var(--fs-md); font-weight: 900; text-align: right; }

.calc-out {
  border-radius: var(--r-md);
  padding: var(--s4);
  background: var(--green-soft);
  border: 2px solid var(--green);
  color: var(--green-dark);
  font-weight: 800; font-size: var(--fs-sm); line-height: 1.55;
}

/* ---------- Explicación progresiva del error ----------

   La corrección corta vive en el pie; lo hondo espera detrás de este botón.
   Va alineado a la derecha y en tono discreto a propósito: acompaña a
   "Entendido", que es el botón que de verdad manda, y no debe competir con él. */

.lesson-foot__mas {
  display: flex;
  justify-content: flex-end;
  margin-bottom: var(--s3);
}
.lesson-foot.is-ko .lesson-foot__mas .btn {
  color: var(--red-dark);
  border-color: color-mix(in srgb, var(--red) 40%, transparent);
}

/* Bloques del panel hondo. Cada uno responde una pregunta y se lee solo. */
.exp {
  background: var(--card-2, rgba(0, 0, 0, .04));
  border-radius: var(--r-md);
  padding: var(--s3) var(--s4);
  text-align: left;
}
.exp + .exp { margin-top: var(--s2); }
.exp__t {
  font-size: var(--fs-xs);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .6px;
  opacity: .65;
}
.exp__p {
  font-size: var(--fs-sm);
  font-weight: 700;
  line-height: 1.5;
  margin-top: 4px;
}
/* El verde y el rojo solo tiñen el borde y el rótulo: el cuerpo se queda con
   el color de texto normal, que es el que se lee sin esfuerzo. */
.exp--ok { border-left: 4px solid var(--green); }
.exp--ko { border-left: 4px solid var(--red); }
.exp--ok .exp__t { color: var(--green-dark); opacity: 1; }
.exp--ko .exp__t { color: var(--red-dark); opacity: 1; }

html[data-theme="dark"] .exp { background: rgba(255, 255, 255, .07); }

/* ---------- Compartir un avance ---------- */

.comparte__estilos { display: flex; gap: 8px; }
.comparte__estilo {
  flex: 1;
  height: 46px;
  border-radius: var(--r-md);
  border: 3px solid transparent;
  font-weight: 900;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: .4px;
  transition: transform .12s var(--spring), border-color .18s;
}
.comparte__estilo.is-sel { border-color: var(--brand); transform: translateY(-2px); }

.comparte__lienzo {
  display: grid;
  place-items: center;
  min-height: 260px;
  background: var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
/* La vista previa manda sobre el alto, no sobre el ancho: los formatos son
   verticales y en un móvil ocuparían la pantalla entera si se dejara crecer. */
.comparte__img {
  max-height: 46vh;
  max-width: 100%;
  width: auto;
  border-radius: var(--r-md);
  box-shadow: var(--sh-1);
}
.comparte__cargando {
  font-size: var(--fs-sm);
  font-weight: 800;
  color: var(--ink-3);
  padding: var(--s6);
  text-align: center;
}
