/* El Reto Emprendedor, RumboCR.
   Sistema v4 (DISENO-2026): "Naranja de obra", rellenos planos y neutros cálidos.
   Fondo blanco, botones píldora, Courier Prime SOLO en cifras. Sin gradientes de marca. */
:root {
  --papel: #FFFFFF;
  --bg-2: #F7F4F1;
  --tinta: #1C1614;
  --tinta-2: #3A322E;
  --gris: #5E574F;
  --gris-2: #8C857B;
  --base: #1C1614;
  --accent: #FF4013;
  --accent-deep: #D22F08;
  --accent-soft: #FFF1EC;
  --accent-claro: #FF7A45;
  --arena: #E8D9C5;
  --ambar: #F0A202;
  --oscuro-2: #2A221E;
  --oscuro-tx: #C9C1B8;
  --base-suave: #E6E1DA;
  --hairline: #E6E1DA;
  --grad: #FF4013;
  --ok: #12805C;
  --mal: #C0392B;
  --font: 'Montserrat', system-ui, -apple-system, sans-serif;
  --font-b: 'Open Sans', system-ui, -apple-system, sans-serif;
  --mono: 'Courier Prime', ui-monospace, Menlo, monospace;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  background: var(--papel); color: var(--tinta);
  font-family: var(--font-b); font-size: 16.5px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; min-height: 100vh;
}
a { color: inherit; }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

/* ── Barra superior ── */
.topbar {
  display: flex; align-items: center; gap: 12px;
  max-width: 1080px; margin: 0 auto; padding: 20px 24px 18px;
  border-bottom: 1px solid var(--hairline);
}
.topbar img { width: 31px; height: 31px; }
.topbar .marca { font-family: var(--font); font-weight: 800; font-size: 21px; letter-spacing: -.02em; text-decoration: none; color: var(--tinta); }
.topbar .senal {
  margin-left: auto; font-family: var(--font); font-weight: 700; font-size: 14px;
  color: var(--accent);
}
.stats {
  display: flex; gap: 22px; align-items: baseline;
  font-family: var(--font); font-size: 14px; font-weight: 700; color: var(--gris);
}
.stats b { font-family: var(--mono); font-size: 21px; color: var(--tinta); font-weight: 700; font-variant-numeric: tabular-nums; }
.stats .st { display: flex; gap: 8px; align-items: baseline; }
.stats .st span.lbl { font-family: var(--font); font-size: 13px; font-weight: 600; color: var(--gris-2); }

/* ── Aviso invitado ── */
.aviso-anon {
  max-width: 1080px; margin: 18px auto 0; padding: 15px 18px;
  background: var(--bg-2); border: 1px solid var(--hairline); border-radius: 14px;
  font-size: 15px; line-height: 1.5; color: var(--tinta);
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  margin-left: 24px; margin-right: 24px;
}
@media (min-width: 1130px) { .aviso-anon { margin-left: auto; margin-right: auto; } }
.aviso-anon a.crear {
  background: var(--tinta); color: #fff; text-decoration: none;
  font-family: var(--font);
  font-weight: 700; font-size: 14.5px; padding: 11px 24px; border-radius: 999px; white-space: nowrap;
  transition: background .15s;
}
.aviso-anon a.crear:hover { background: var(--accent); }
.aviso-anon .cerrar { background: none; border: none; font-size: 20px; color: var(--gris-2); margin-left: auto; line-height: 1; }
.aviso-anon .cerrar:hover { color: var(--tinta); }

/* ── Cabecera del mapa: banda oscura ── */
.hero-reto {
  position: relative;
  background: var(--tinta); color: #fff;
  padding: clamp(48px, 6.5vw, 88px) 24px clamp(44px, 5vw, 64px);
}
.hr-in { position: relative; max-width: 1080px; margin: 0 auto; }
.hero-reto .kicker {
  font-family: var(--font); font-weight: 700; font-size: 14.5px;
  color: var(--accent-claro); margin-bottom: 16px;
}
.hero-reto h1 {
  font-family: var(--font); font-size: clamp(38px, 6.8vw, 76px); font-weight: 800;
  letter-spacing: -.03em; line-height: 1.02; color: #fff; max-width: 15ch;
}
.hero-reto p.baja { margin-top: 20px; font-size: clamp(16.5px, 1.7vw, 19.5px); line-height: 1.6; color: var(--oscuro-tx); max-width: 58ch; }

/* estadísticas en tarjetas sólidas */
.hero-reto .stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px;
  max-width: 620px; margin: 32px 0 0;
}
.hero-reto .stats .st {
  display: block; background: var(--oscuro-2); border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 12px; padding: 16px 18px;
}
.hero-reto .stats b { display: block; font-size: clamp(22px, 2.6vw, 28px); color: #fff; }
.hero-reto .stats .st span.lbl { display: block; margin-top: 5px; font-size: 12.5px; color: var(--oscuro-tx); }

.hero-reto .progreso-global { margin-top: 22px; max-width: 620px; }
.progreso-global .linea { height: 6px; background: var(--base-suave); border-radius: 999px; overflow: hidden; }
.progreso-global .linea i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .6s ease; }
.progreso-global .texto { margin-top: 9px; font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--gris); font-variant-numeric: tabular-nums; }
.hero-reto .progreso-global .linea { background: rgba(255, 255, 255, .14); }
.hero-reto .progreso-global .linea i { background: var(--accent); }
.hero-reto .progreso-global .texto { color: var(--oscuro-tx); }

/* ── Mapa: unidades y sendero ── */
#mapa { max-width: 1080px; margin: 0 auto; padding: 36px 24px 100px; }
.unidad { margin-top: 48px; }
.unidad-cab { border-top: 1px solid var(--hairline); padding-top: 16px; display: flex; align-items: baseline; gap: 14px; }
.unidad-cab .letra { font-family: var(--mono); font-weight: 700; font-size: 15px; color: var(--accent); font-variant-numeric: tabular-nums; }
.unidad-cab h2 { font-family: var(--font); font-size: clamp(22px, 2.6vw, 28px); font-weight: 800; letter-spacing: -.03em; color: var(--tinta); }
.unidad-cab .conteo { margin-left: auto; font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--gris-2); font-variant-numeric: tabular-nums; }
.sendero { margin-top: 8px; }
.leccion {
  width: 100%; text-align: left; background: none; border: none;
  display: flex; align-items: center; gap: 18px;
  padding: 17px 6px; border-bottom: 1px solid var(--hairline);
  transition: background .13s;
}
.leccion:not(.bloqueada):hover { background: var(--bg-2); }
.leccion .nodo {
  width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums;
  border: 1px solid var(--hairline); color: var(--gris-2); background: #fff;
}
.leccion.actual .nodo { border: none; background: var(--accent); color: #fff; }
.leccion.hecha .nodo { border-color: var(--tinta); background: var(--tinta); color: #fff; }
.leccion.bloqueada { cursor: not-allowed; opacity: .45; }
.leccion .datos { min-width: 0; flex: 1; }
.leccion .titulo { font-family: var(--font); font-size: 17.5px; font-weight: 700; letter-spacing: -.02em; line-height: 1.3; color: var(--tinta); }
.leccion .estrellas { margin-top: 4px; font-size: 13px; letter-spacing: 2px; color: var(--ambar); }
.leccion .estrellas .off { color: var(--hairline); }
.leccion .accion {
  font-family: var(--font); font-size: 14px; font-weight: 700;
  color: var(--tinta); white-space: nowrap;
}
.leccion.actual .accion { color: var(--accent); }
.leccion.bloqueada .accion { color: var(--gris-2); }

/* ── Lección ── */
#juego { max-width: 760px; margin: 0 auto; padding: 30px 24px 100px; }
.juego-cab { display: flex; align-items: center; gap: 16px; }
.juego-cab .salir { background: none; border: none; font-size: 24px; color: var(--gris-2); line-height: 1; }
.juego-cab .salir:hover { color: var(--tinta); }
.juego-cab .barra { flex: 1; height: 8px; background: var(--base-suave); border-radius: 999px; overflow: hidden; }
.juego-cab .barra i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .35s ease; }
.juego-cab .marcador { font-family: var(--mono); font-size: 14px; font-weight: 700; color: var(--gris); font-variant-numeric: tabular-nums; }
.pregunta-zona { margin-top: 40px; }
.pregunta-tipo {
  font-family: var(--font); font-weight: 700; font-size: 15px;
  color: var(--accent); margin-bottom: 14px;
}
.pregunta-texto { font-family: var(--font); font-size: clamp(24px, 4vw, 34px); font-weight: 800; letter-spacing: -.03em; line-height: 1.15; color: var(--tinta); }
.opciones { margin-top: 30px; display: grid; gap: 12px; }
.opcion {
  text-align: left; background: #fff; border: 1px solid var(--hairline); border-radius: 12px;
  padding: 17px 19px; font-family: var(--font-b);
  font-size: 16px; font-weight: 600; line-height: 1.35; color: var(--tinta);
  display: flex; gap: 13px; align-items: center; transition: border-color .13s, background .13s;
}
.opcion:not(:disabled):hover { border-color: var(--accent); background: var(--accent-soft); }
.opcion .tecla {
  font-family: var(--mono); font-size: 12.5px; font-weight: 700; color: var(--gris-2);
  border: 1px solid var(--hairline); border-radius: 6px; padding: 3px 8px; flex-shrink: 0;
}
.opcion.elegida-ok { border-color: var(--ok); background: rgba(18, 128, 92, .07); }
.opcion.elegida-mal { border-color: var(--mal); background: rgba(192, 57, 43, .06); }
.opcion.revelada { border-color: var(--ok); border-style: dashed; }
.opcion:disabled { cursor: default; }

/* Panel de feedback */
.feedback { margin-top: 28px; border-top: 1px solid var(--hairline); padding-top: 22px; display: none; }
.feedback.on { display: block; animation: sube .25s ease; }
@keyframes sube { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .feedback.on { animation: none; } }
.feedback .veredicto { font-family: var(--font); font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.feedback.ok-fb .veredicto { color: var(--ok); }
.feedback.mal-fb .veredicto { color: var(--mal); }
.feedback .explica { margin-top: 10px; font-family: var(--font-b); font-size: 16px; line-height: 1.6; color: var(--tinta); }
.feedback .fuente { margin-top: 12px; font-size: 14px; color: var(--gris); line-height: 1.5; }
.feedback .fuente i { font-style: italic; }
.feedback .fuente a { color: var(--accent); font-weight: 600; }
.btn-continuar {
  margin-top: 24px; width: 100%; border: none; border-radius: 999px; padding: 16px 32px;
  font-family: var(--font);
  font-size: 16.5px; font-weight: 700; color: #fff; background: var(--tinta); letter-spacing: -.01em;
  transition: background .15s;
}
.btn-continuar:hover { background: var(--accent); }
.btn-continuar.neutro { background: var(--tinta); }
.btn-continuar.neutro:hover { background: var(--accent); }

/* ── Resultado: banda oscura de celebración ── */
#resultado {
  display: none; position: relative;
  background: var(--tinta); color: #fff;
  padding: clamp(60px, 8vw, 96px) 24px clamp(72px, 8vw, 104px); text-align: center;
}
.res-in { position: relative; max-width: 680px; margin: 0 auto; }
#resultado .kicker {
  font-family: var(--font); font-weight: 700; font-size: 14.5px; color: var(--accent-claro);
}
#resultado h2 { margin-top: 14px; font-family: var(--font); font-size: clamp(32px, 5.6vw, 52px); font-weight: 800; letter-spacing: -.03em; line-height: 1.04; color: #fff; }
.estrellas-final { margin-top: 22px; font-size: 44px; letter-spacing: 10px; color: var(--ambar); }
.estrellas-final .off { color: rgba(255, 255, 255, .18); }
.cifras { margin-top: 32px; display: flex; justify-content: center; gap: 12px; }
.cifras .c {
  flex: 1 1 0; min-width: 0; padding: 16px 12px;
  background: var(--oscuro-2); border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 12px;
}
.cifras .c b { font-family: var(--mono); font-weight: 700; font-size: clamp(24px, 4vw, 32px); display: block; color: #fff; font-variant-numeric: tabular-nums; }
.cifras .c span {
  font-family: var(--font); font-size: 12.5px; font-weight: 600; color: var(--oscuro-tx);
}
#resultado .acciones { margin-top: 40px; display: grid; gap: 12px; }
#resultado .acciones .btn-continuar { margin-top: 0; background: var(--accent); }
#resultado .acciones .btn-continuar:hover { background: var(--accent-deep); color: #fff; }
.btn-linea {
  background: transparent; border: 1px solid rgba(255, 255, 255, .32); border-radius: 999px; padding: 15px 32px;
  font-family: var(--font);
  font-size: 15.5px; font-weight: 700; color: #fff; text-decoration: none; display: block;
  transition: border-color .14s, background .14s, color .14s;
}
.btn-linea:hover { border-color: #fff; background: #fff; color: var(--tinta); }
#resultado .repasa { margin-top: 28px; font-size: 15px; color: var(--oscuro-tx); line-height: 1.55; }
#resultado .repasa a { color: var(--accent-claro); font-weight: 700; }

/* Confetti */
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; }

/* Pie */
.pie-reto {
  background: var(--tinta);
  padding: 40px 24px 52px; text-align: center;
  font-size: 14px; color: var(--oscuro-tx); line-height: 1.6;
}
.pie-reto a { color: var(--accent-claro); font-weight: 600; }

@media (max-width: 560px) {
  .hero-reto .stats { grid-template-columns: 1fr; gap: 9px; }
  .hero-reto .stats .st { display: flex; align-items: baseline; gap: 10px; padding: 13px 16px; }
  .hero-reto .stats b { font-size: 22px; }
  .hero-reto .stats .st span.lbl { margin-top: 0; }
  .cifras { gap: 8px; }
  .leccion .accion { display: none; }
}

/* Candado antidesplazamiento lateral: si algún elemento se pasa de ancho,
   la página no se puede arrastrar hacia los lados en el teléfono. */
html{overflow-x:hidden;max-width:100%}
body{overflow-x:hidden;max-width:100%;position:relative}

/* Firma del autor en el pie */
.firma{display:inline-block;margin-top:6px;font-size:12px;opacity:.9}
.firma a{text-decoration:underline;text-underline-offset:2px}
