/* Recorrido MENPEZ: una sola pantalla de celular, sin deslizar. Oscuro con la marca. */
:root {
  --tinta: #1C1730;
  --fondo: #14111f;
  --panel: #231d3a;
  --panel2: #2c2548;
  --borde: rgba(255, 255, 255, .09);
  --texto: #f4f2fb;
  --suave: #b7b0d4;
  --violeta: #6A5AE0;
  --violeta-c: #9A8CF5;
  --verde: #2FC6A4;
  --verde-c: #62D9BD;
  --ambar: #f2b441;
  --rojo: #ef5b5b;
  --gris: #9aa0ad;
  --radio: 16px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--fondo); color: var(--texto); }
body {
  font-family: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px; line-height: 1.4; -webkit-font-smoothing: antialiased;
  overscroll-behavior: none; touch-action: manipulation;
}
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

.app {
  height: 100dvh; max-width: 480px; margin: 0 auto; display: flex; flex-direction: column;
  background: var(--tinta); overflow: hidden; position: relative;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* ---- barra de arriba ---- */
.barra { padding: 10px 14px 8px; background: var(--tinta); border-bottom: 1px solid var(--borde); z-index: 5; }
.progreso { display: flex; gap: 4px; margin-bottom: 9px; }
.progreso i { flex: 1; height: 4px; border-radius: 4px; background: rgba(255,255,255,.14); overflow: hidden; position: relative; }
.progreso i b { position: absolute; inset: 0; width: 0; background: linear-gradient(90deg, var(--violeta-c), var(--verde-c)); transition: width .4s ease; }
.barra__fila { display: flex; align-items: center; gap: 10px; }
.barra__logo { height: 18px; width: auto; flex: none; }
.barra__cap { flex: 1; min-width: 0; font-size: 13px; color: var(--suave); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }
.barra__sonido { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--borde); background: var(--panel); font-size: 15px; }

/* ---- pantalla del capítulo ---- */
.pantalla { flex: 1; min-height: 0; position: relative; overflow: hidden; }
.pantalla > .cap { position: absolute; inset: 0; animation: entra .45s ease both; }
@keyframes entra { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---- subtítulo (lo que dice la voz) ---- */
.sub {
  flex: none; padding: 14px 16px 16px; background: linear-gradient(180deg, rgba(28,23,48,.0), var(--tinta) 18%);
  border-top: 1px solid var(--borde); z-index: 5; min-height: 128px; display: flex; flex-direction: column; gap: 12px;
}
.sub__texto { margin: 0; font-family: 'Bricolage Grotesque', 'Instrument Sans', sans-serif; font-weight: 600; font-size: 19px; line-height: 1.25; letter-spacing: -.01em; white-space: pre-line; text-wrap: balance; }
.sub__texto em { font-style: normal; color: var(--verde-c); }
.sub__texto > span { display: block; }
.sub__beneficio, .sub__riesgo {
  font-family: 'Instrument Sans', sans-serif; font-weight: 600; font-size: 14px; line-height: 1.3; margin-top: 6px;
  padding-left: 22px; position: relative; letter-spacing: 0;
}
.sub__beneficio { color: var(--verde-c); }
.sub__riesgo { color: #ffd27a; }
.sub__beneficio::before, .sub__riesgo::before { position: absolute; left: 0; top: 0; }
.sub__beneficio::before { content: '✓'; }
.sub__riesgo::before { content: '⚠'; }
.sub__abajo { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin-top: auto; }
.sub__pista { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--verde-c); }
.sub__pista::before { content: '👆'; }
.boton {
  border: 0; border-radius: 999px; padding: 12px 20px; font-weight: 700; font-size: 15px;
  background: linear-gradient(135deg, var(--violeta), #7d6ef0); color: #fff; box-shadow: 0 6px 18px rgba(106,90,224,.35);
  margin-left: auto; white-space: nowrap;
}
.boton--verde { background: linear-gradient(135deg, #22a98a, var(--verde)); box-shadow: 0 6px 18px rgba(47,198,164,.3); }
.boton--claro { background: var(--panel2); box-shadow: none; border: 1px solid var(--borde); }
.boton.late { animation: late 1.6s ease-in-out infinite; }
@keyframes late { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }

/* ---- lo que hay que tocar ---- */
.objetivo { position: relative; z-index: 3; cursor: pointer; }
.objetivo::after {
  content: ''; position: absolute; inset: -7px; border-radius: inherit; border: 3px solid var(--verde-c);
  animation: anillo 1.4s ease-out infinite; pointer-events: none;
}
@keyframes anillo { 0% { opacity: 1; transform: scale(.92); } 100% { opacity: 0; transform: scale(1.25); } }

/* ---- piezas comunes de las pantallas simuladas ---- */
.app-ui { position: absolute; inset: 0; padding: 14px; display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.app-ui__titulo { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; font-size: 20px; margin: 0; }
.app-ui__eyebrow { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--violeta-c); font-weight: 700; margin: 0; }
.tarjeta { background: var(--panel); border: 1px solid var(--borde); border-radius: var(--radio); padding: 12px 14px; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kpi { background: var(--panel); border: 1px solid var(--borde); border-radius: 14px; padding: 10px 12px; min-width: 0; }
.kpi__t { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--suave); font-weight: 700; }
.kpi__v { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; font-size: 20px; margin-top: 2px; white-space: nowrap; }
.kpi__d { font-size: 12px; color: var(--suave); }
.kpi--rojo .kpi__v { color: var(--rojo); }
.kpi--ambar .kpi__v { color: var(--ambar); }
.kpi--verde .kpi__v { color: var(--verde-c); }
.chip { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 9px; font-size: 12px; font-weight: 700; background: var(--panel2); border: 1px solid var(--borde); white-space: nowrap; }
.chip--rojo { color: #ff9c9c; border-color: rgba(239,91,91,.4); background: rgba(239,91,91,.12); }
.chip--ambar { color: #ffd27a; border-color: rgba(242,180,65,.4); background: rgba(242,180,65,.12); }
.chip--verde { color: var(--verde-c); border-color: rgba(47,198,164,.4); background: rgba(47,198,164,.12); }
.fila { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--borde); }
.fila:last-child { border-bottom: 0; }
.fila__n { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fila__m { font-weight: 700; white-space: nowrap; }
.aparece { animation: entra .4s ease both; }

/* ---- mapa ---- */
.mapa { position: absolute; inset: 0; background: #0e1116; overflow: hidden; container-type: size; }
.mapa__lienzo {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: max(100cqw, 56.25cqh); height: max(100cqh, 177.78cqw); background: center / 100% 100% no-repeat;
}
.mapa::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,17,31,.35), rgba(20,17,31,0) 30%, rgba(20,17,31,0) 70%, rgba(20,17,31,.55)); pointer-events: none; }
.punto {
  position: absolute; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,.92); box-shadow: 0 2px 8px rgba(0,0,0,.5); transition: background .5s ease, transform .3s ease, opacity .3s ease;
}
.punto--verde { background: var(--verde); }
.punto--ambar { background: var(--ambar); }
.punto--rojo { background: var(--rojo); }
.punto--gris { background: #c9ccd3; border-color: #7c818c; }
.punto.oculto { opacity: 0; transform: scale(.3); }
.punto.atenuado { opacity: .25; }
.punto.grande { transform: scale(1.35); z-index: 2; }
.leyenda { position: absolute; left: 12px; right: 12px; top: 12px; display: flex; flex-wrap: wrap; gap: 6px; z-index: 2; }
.leyenda .chip { background: rgba(20,17,31,.85); }
.ficha {
  position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 4; background: rgba(35,29,58,.97);
  border: 1px solid var(--borde); border-radius: 18px; padding: 14px; box-shadow: 0 12px 30px rgba(0,0,0,.45); animation: sube .35s ease both;
}
@keyframes sube { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.ficha__n { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; font-size: 18px; margin: 0 0 2px; }
.ficha__d { font-size: 13px; color: var(--suave); margin: 0 0 10px; }
.ficha__botones { display: flex; gap: 8px; margin-top: 10px; }
.ficha__botones .boton { margin: 0; flex: 1; padding: 11px 12px; font-size: 14px; display: flex; align-items: center; justify-content: center; text-align: center; }

/* ---- pantallas fijas del motor (bienvenida, ¿algo más?, final) ---- */
.portada { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px; text-align: center;
  background: radial-gradient(500px 340px at 80% 10%, rgba(106,90,224,.45), transparent 70%), radial-gradient(420px 300px at 10% 95%, rgba(47,198,164,.28), transparent 70%), var(--tinta); }
.portada__iso { width: 86px; height: 86px; }
.portada__t { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; font-size: 28px; line-height: 1.1; margin: 0; text-wrap: balance; white-space: pre-line; }
.portada__d { color: var(--suave); margin: 0; max-width: 30ch; }
.opciones { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 340px; }
.opciones .boton { margin: 0; width: 100%; padding: 14px 18px; white-space: normal; }
.campo { width: 100%; max-width: 340px; min-height: 96px; border-radius: 14px; border: 1px solid var(--borde); background: var(--panel); color: var(--texto); font: inherit; padding: 12px; resize: none; }

@media (max-height: 640px) {
  .sub { min-height: 112px; padding: 10px 14px 12px; gap: 8px; }
  .sub__texto { font-size: 17px; }
  .kpi__v { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---- elección al empezar: ciudad y temas ---- */
.portada__t--chica { font-size: 22px; }
.eleccion { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.eleccion__p { margin: 6px 0 0; font-weight: 700; font-size: 14px; }
.eleccion__p small { display: block; font-weight: 500; font-size: 12px; color: var(--suave); }
.eleccion__chips { display: flex; flex-wrap: wrap; gap: 7px; }
.eleccion__chips--falta { outline: 2px solid var(--ambar); outline-offset: 5px; border-radius: 12px; }
.eleccion__chip {
  border: 1px solid var(--borde); background: var(--panel); border-radius: 999px; padding: 9px 13px; font-size: 14px; font-weight: 600;
  color: var(--texto); min-height: 40px; transition: background .15s, border-color .15s, color .15s;
}
.eleccion__chip[aria-pressed="true"] { background: rgba(47,198,164,.16); border-color: var(--verde); color: var(--verde-c); }
.eleccion__chip[aria-pressed="true"]::before { content: '✓ '; }
.eleccion__chip--tema { flex: 1 1 46%; text-align: left; border-radius: 12px; }
.campo--chico { min-height: 42px; padding: 9px 12px; max-width: none; }
.eleccion__fila { display: flex; gap: 7px; }
.eleccion__fila .campo { flex: 1 1 0; min-width: 0; }
.eleccion__fila .eleccion__nombre { flex: 0 0 43%; }
@media (max-height: 700px) {
  .portada:has(.eleccion) { gap: 10px; padding: 14px 16px; justify-content: flex-start; }
  .eleccion__chip { padding: 7px 11px; font-size: 13px; min-height: 36px; }
  .eleccion__chips { gap: 5px; }
}
/* mientras elige, la franja de abajo se achica para que entre todo */
.app--eligiendo .sub { min-height: 0; padding: 8px 16px 10px; gap: 4px; }
.app--eligiendo .sub__texto { font-size: 14px; font-family: 'Instrument Sans', sans-serif; font-weight: 600; }
@media (max-height: 700px) {
  .portada__t--chica { font-size: 18px; }
  .eleccion__p small { display: none; }
  .campo--chico { min-height: 38px; padding: 7px 10px; }
  .eleccion { gap: 7px; }
  .eleccion__chip--tema { min-height: 34px; padding: 6px 10px; font-size: 12.5px; }
  .eleccion__p { margin-top: 2px; }
  .portada:has(.eleccion) .boton { padding: 10px 18px; }
}
/* ---- ¿qué te pareció? (final) ---- */
.caras { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.caras__p { margin: 0; font-size: 14px; font-weight: 700; color: var(--suave); }
.caras__fila { display: flex; gap: 12px; }
.caras__b { width: 56px; height: 56px; border-radius: 50%; border: 1px solid var(--borde); background: var(--panel); font-size: 28px; line-height: 1; transition: transform .15s, border-color .15s, background .15s; }
.caras__b--elegida { border-color: var(--verde); background: rgba(47,198,164,.16); transform: scale(1.12); }
@media (max-height: 700px) { .portada:has(.caras) .portada__iso { display: none; } .caras__b { width: 48px; height: 48px; font-size: 24px; } }
