@font-face { font-family: "Blockat"; src: url("/fonts/blockat.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("/fonts/poppins-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("/fonts/poppins-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("/fonts/poppins-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

/* El marco es la imagen aprobada (1520 x 2688): todo se mide en unidades de ese marco. */
:root {
  --fw: min(100vw, 100svh * 1520 / 2688);
  --u: calc(var(--fw) / 1520);
  --noche: #19150f;
  --tierra-oscura: #403229;
  --arena: #fed196;
  --arena-texto: #f6e2b8;
  --sepia: #da915a;
  --tierra: #aa6f45;
  --aqua: #0cc6b9;
  --aqua-texto: #2fd3c7;
  --verde: #4e8d25;
  --olivo: #65764c;
  --tinta: #2b1a0d;
  --error: #ffb4a1;
  --sale: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--noche);
  color: var(--arena-texto);
  font-family: "Poppins", system-ui, sans-serif;
  font-weight: 400;
  min-height: 100svh;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
::selection { background: var(--arena); color: var(--tinta); }
:focus-visible { outline: 3px solid var(--aqua); outline-offset: 4px; }
img { display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
.oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- Escenario: dunas arriba, noche abajo ---------- */
.escenario { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.escenario .fondo-noche { position: absolute; left: 0; right: 0; top: calc(740 * var(--u)); -webkit-mask-image: linear-gradient(transparent, #000 7%, #000 90%, transparent), linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent); -webkit-mask-composite: source-in; mask-image: linear-gradient(transparent, #000 7%, #000 90%, transparent), linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent); mask-composite: intersect; }
.escenario .fondo-noche img { width: 100%; height: auto; aspect-ratio: 2560 / 3070; transition: opacity 0.8s var(--sale); }
/* En pantallas de lectura el oasis baja de intensidad para que el texto se lea. */
body[data-pantalla="entrada"] .escenario .fondo-noche img, body[data-pantalla="resultado"] .escenario .fondo-noche img { opacity: 0.42; }

.app { position: relative; z-index: 1; min-height: 100svh; display: flex; flex-direction: column; }

.banda-dunas { position: relative; flex: none; height: calc(807 * var(--u)); }
.banda-dunas > picture .dunas {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  -webkit-mask-image: linear-gradient(#000 58%, rgb(0 0 0 / 0.55) 82%, transparent);
  mask-image: linear-gradient(#000 58%, rgb(0 0 0 / 0.55) 82%, transparent);
}
.marco { position: relative; width: var(--fw); height: 100%; margin-inline: auto; }
.marca {
  position: absolute; left: calc(104 * var(--u)); top: calc(62 * var(--u));
  font-family: "Blockat", sans-serif; font-size: max(17px, calc(68 * var(--u))); line-height: 1;
  letter-spacing: 0.06em; color: var(--arena); text-decoration: none;
  text-shadow: 0 calc(2 * var(--u)) calc(14 * var(--u)) rgb(25 21 15 / 0.45);
}
.oasis-meta {
  position: absolute; left: calc(1262 * var(--u)); top: calc(300 * var(--u));
  width: calc(246 * var(--u)); height: calc(284 * var(--u)); object-fit: contain;
  transition: filter 1.2s var(--sale);
}
.ruta, .ruta svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.marca { z-index: 2; }
.ruta .camino-pendiente { fill: none; stroke: var(--arena); stroke-width: 8; stroke-linecap: round; stroke-dasharray: 0 20; opacity: 0.9; }
.ruta .camino-andado { fill: none; stroke: #f9c66c; stroke-width: 13; stroke-linecap: round; filter: url(#brillo); }
.ruta .hito circle { fill: #2a1c12; stroke: var(--arena); stroke-width: 5; }
.ruta .hito text { fill: var(--arena-texto); font-family: "Poppins", sans-serif; font-weight: 700; font-size: 34px; text-anchor: middle; dominant-baseline: central; }
.ruta .hito.meta circle { fill: rgb(18 40 38 / 0.72); stroke: #d9fff8; }
.ruta .hito.alcanzado circle { stroke: #ffe3b0; }
.ruta .viajero { fill: #fff3d6; filter: url(#brillo-fuerte); }
.oasis-llegada .oasis-meta { filter: drop-shadow(0 0 calc(30 * var(--u)) rgb(12 198 185 / 0.75)); }

/* ---------- Pantallas ---------- */
.pantalla { flex: 1; display: flex; flex-direction: column; }
.pantalla .cuerpo { width: var(--fw); margin-inline: auto; flex: 1; display: flex; flex-direction: column; }

/* Pregunta */
.pantalla-pregunta .cuerpo { text-align: center; }
.bloque-pregunta { padding: calc(220 * var(--u)) calc(104 * var(--u)) 0; }
.contador { font-size: max(14px, calc(42 * var(--u))); line-height: 1.3; color: var(--arena-texto); font-variant-numeric: tabular-nums; }
.etapa { margin-top: calc(38 * var(--u)); font-size: max(15px, calc(46 * var(--u))); line-height: 1.3; font-weight: 500; letter-spacing: 0.01em; color: var(--aqua-texto); }
.pregunta {
  margin: calc(68 * var(--u)) auto 0; max-width: calc(1120 * var(--u));
  font-family: "Blockat", sans-serif; font-weight: 400; font-size: calc(125 * var(--u)); line-height: 1.01;
  color: var(--arena); text-wrap: balance; word-spacing: -0.12em;
  text-shadow: 0 0 calc(36 * var(--u)) rgb(254 209 150 / 0.32), 0 calc(4 * var(--u)) calc(18 * var(--u)) rgb(25 21 15 / 0.6);
}
.pregunta:focus { outline: none; }
.pregunta[data-largo="m"] { font-size: calc(104 * var(--u)); }
.pregunta[data-largo="l"] { font-size: calc(88 * var(--u)); }

.respuestas {
  margin-top: auto; display: grid; grid-template-columns: 1fr 1fr; gap: calc(51 * var(--u));
  padding: calc(120 * var(--u)) calc(108 * var(--u)) 0;
}
.boton {
  min-height: max(48px, calc(224 * var(--u))); border-radius: 999px; border: none;
  font-family: "Poppins", sans-serif; font-weight: 700; font-size: max(17px, calc(80 * var(--u))); line-height: 1;
  transition: transform 0.18s var(--sale), background-color 0.2s, box-shadow 0.25s var(--sale), opacity 0.2s;
  touch-action: manipulation;
}
.boton:active { transform: scale(0.97); }
.boton-lleno { background: var(--arena); color: var(--tinta); box-shadow: 0 calc(10 * var(--u)) calc(34 * var(--u)) rgb(254 209 150 / 0.22); }
.boton-lleno:hover { background: #ffdca9; }
.boton-borde { background: transparent; color: var(--arena); border: max(2px, calc(5 * var(--u))) solid var(--arena); }
.boton-borde:hover { background: rgb(254 209 150 / 0.08); }
.boton:disabled { opacity: 0.55; cursor: progress; }
.boton.marcado { transform: scale(0.97); box-shadow: 0 0 0 calc(10 * var(--u)) rgb(254 209 150 / 0.18); }

.pie-pregunta { display: flex; justify-content: center; padding: calc(30 * var(--u)) 0 max(calc(128 * var(--u)), env(safe-area-inset-bottom)); }
.enlace {
  background: none; border: none; font-size: max(14px, calc(40 * var(--u))); color: var(--arena-texto);
  text-decoration: underline; text-underline-offset: 0.3em; text-decoration-color: rgb(254 209 150 / 0.45);
  padding: 10px 14px; min-height: 44px; text-shadow: 0 1px 8px rgb(25 21 15 / 0.9);
}
.enlace:hover { text-decoration-color: var(--arena); }
.enlace:disabled { visibility: hidden; }

/* Transición de pregunta */
.bloque-pregunta.sale { animation: sale 0.2s ease-in forwards; }
.bloque-pregunta.entra { animation: entra 0.42s var(--sale) both; }
@keyframes sale { to { opacity: 0; transform: translateY(calc(-40 * var(--u))); filter: blur(6px); } }
@keyframes entra { from { opacity: 0; transform: translateY(calc(60 * var(--u))); filter: blur(8px); } }

/* ---------- Entrada ---------- */
.pantalla-entrada .cuerpo { padding: calc(150 * var(--u)) calc(104 * var(--u)) max(calc(120 * var(--u)), env(safe-area-inset-bottom)); }
.titulo {
  font-family: "Blockat", sans-serif; font-weight: 400; color: var(--arena); line-height: 1.02; text-wrap: balance;
  text-shadow: 0 0 calc(36 * var(--u)) rgb(254 209 150 / 0.28);
}
.pantalla-entrada .titulo { font-size: calc(150 * var(--u)); }
.lead { margin-top: calc(56 * var(--u)); font-size: max(16px, calc(54 * var(--u))); line-height: 1.55; color: var(--arena-texto); max-width: 34em; }
.dato-chico { margin-top: calc(28 * var(--u)); font-size: max(14px, calc(44 * var(--u))); color: var(--aqua-texto); font-weight: 500; }
.formulario { margin-top: calc(90 * var(--u)); display: grid; gap: calc(52 * var(--u)); }
.campo { display: grid; gap: 8px; }
.campo label { font-size: max(14px, calc(44 * var(--u))); font-weight: 500; color: var(--arena-texto); }
.campo input {
  font: inherit; font-size: max(16px, calc(56 * var(--u))); color: var(--arena-texto);
  background: rgb(25 21 15 / 0.62); border: 2px solid rgb(254 209 150 / 0.4); border-radius: 14px;
  min-height: max(52px, calc(190 * var(--u))); padding: 0 18px; caret-color: var(--arena);
  transition: border-color 0.2s, background-color 0.2s;
}
.campo input::placeholder { color: rgb(246 226 184 / 0.62); }
.campo input:hover { border-color: rgb(254 209 150 / 0.65); }
.campo input:focus { outline: none; border-color: var(--arena); background: rgb(25 21 15 / 0.8); }
.campo input[aria-invalid="true"] { border-color: var(--error); }
.telefono { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 2fr); gap: 10px; }
.telefono:has(#lada-otra:not([hidden])) { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.7fr) minmax(0, 1.8fr); }
.campo select {
  font: inherit; font-size: max(16px, calc(52 * var(--u))); color: var(--arena-texto); min-width: 0;
  background: rgb(25 21 15 / 0.62) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23fed196' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 14px center;
  border: 2px solid rgb(254 209 150 / 0.4); border-radius: 14px; min-height: max(52px, calc(190 * var(--u)));
  padding: 0 34px 0 14px; appearance: none; -webkit-appearance: none; text-overflow: ellipsis; cursor: pointer;
  transition: border-color 0.2s;
}
.campo select:hover { border-color: rgb(254 209 150 / 0.65); }
.campo select:focus { outline: none; border-color: var(--arena); }
.campo select option { background: #2a1c12; color: var(--arena-texto); }
.campo input { min-width: 0; }
.campo .ayuda { font-size: max(13px, calc(40 * var(--u))); color: rgb(246 226 184 / 0.78); }
.campo .error-campo { font-size: max(13px, calc(40 * var(--u))); color: var(--error); min-height: 1.2em; }
.verificacion { min-height: 65px; }
.error-general { font-size: max(14px, calc(44 * var(--u))); color: var(--error); }
.pantalla-entrada .boton { width: 100%; margin-top: calc(10 * var(--u)); }

/* ---------- Etapa (entre áreas) ---------- */
.pantalla-etapa .cuerpo { text-align: center; padding: calc(300 * var(--u)) calc(104 * var(--u)) max(calc(200 * var(--u)), env(safe-area-inset-bottom)); }
.pantalla-etapa .numero-etapa { font-size: max(15px, calc(48 * var(--u))); font-weight: 500; letter-spacing: 0.02em; color: var(--aqua-texto); }
.pantalla-etapa .titulo { margin-top: calc(40 * var(--u)); font-size: calc(170 * var(--u)); }
.pantalla-etapa .lema { margin: calc(50 * var(--u)) auto 0; font-size: max(16px, calc(56 * var(--u))); line-height: 1.5; max-width: 22em; }
.pantalla-etapa .boton { margin-top: auto; width: 100%; }
.pantalla-etapa .anima { animation: entra 0.6s var(--sale) both; }
.pantalla-etapa .anima:nth-child(2) { animation-delay: 0.08s; }
.pantalla-etapa .anima:nth-child(3) { animation-delay: 0.16s; }

/* ---------- Resultado ---------- */
.pantalla-resultado .cuerpo { padding: calc(170 * var(--u)) calc(104 * var(--u)) max(calc(180 * var(--u)), env(safe-area-inset-bottom)); }
.pantalla-resultado .titulo { font-size: calc(190 * var(--u)); }
.puntaje { margin-top: calc(40 * var(--u)); font-size: max(17px, calc(60 * var(--u))); font-weight: 500; color: var(--aqua-texto); font-variant-numeric: tabular-nums; }
.pantalla-resultado .lead { margin-top: calc(36 * var(--u)); }
.seccion { margin-top: calc(150 * var(--u)); }
.seccion h2 { font-family: "Blockat", sans-serif; font-weight: 400; font-size: calc(96 * var(--u)); line-height: 1.05; color: var(--arena); }
.seccion p { margin-top: calc(26 * var(--u)); font-size: max(16px, calc(52 * var(--u))); line-height: 1.55; }
.cuello { border-top: 2px solid rgb(254 209 150 / 0.22); padding-top: max(18px, calc(70 * var(--u))); }
.cuello .area-cuello { color: var(--aqua-texto); font-weight: 500; }
.areas { margin-top: calc(50 * var(--u)); display: grid; gap: calc(52 * var(--u)); list-style: none; }
.areas li { display: grid; gap: 10px; }
.areas .fila { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: max(15px, calc(48 * var(--u))); }
.areas .cuenta { font-variant-numeric: tabular-nums; color: rgb(246 226 184 / 0.82); white-space: nowrap; }
.areas .barra { height: max(8px, calc(26 * var(--u))); border-radius: 999px; background: rgb(254 209 150 / 0.14); overflow: hidden; }
.areas .barra span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--arena); transition: width 1.1s var(--sale); }
.areas li.es-cuello .barra span { background: var(--aqua); }
.areas li.es-cuello .nombre { color: var(--aqua-texto); }
.rueda { margin: calc(40 * var(--u)) auto 0; width: 100%; }
.rueda svg { width: 100%; height: auto; overflow: visible; }
.rueda .red { fill: none; stroke: rgb(254 209 150 / 0.2); stroke-width: 1.5; }
.rueda .forma { fill: rgb(12 198 185 / 0.22); stroke: var(--aqua); stroke-width: 3; stroke-linejoin: round; }
.rueda .punto { fill: var(--aqua); }
.rueda svg text { fill: var(--arena-texto); font-family: "Poppins", sans-serif; font-weight: 500; font-size: 26px; }
.rueda svg { max-width: 300px; margin-inline: auto; display: block; }
.ejes { list-style: none; margin-top: calc(50 * var(--u)); display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; font-size: max(14px, calc(44 * var(--u))); }
.ejes li { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px solid rgb(254 209 150 / 0.16); padding-bottom: 10px; }
.ejes li span:last-child { color: var(--aqua-texto); font-variant-numeric: tabular-nums; }
.cierre { margin-top: calc(150 * var(--u)); display: grid; gap: 6px; justify-items: start; font-size: max(14px, calc(44 * var(--u))); color: rgb(246 226 184 / 0.8); }
.pantalla-resultado .revela { animation: entra 0.7s var(--sale) both; }

@media (min-width: 900px) and (min-aspect-ratio: 1/1) {
  .pantalla-entrada .cuerpo, .pantalla-resultado .cuerpo { width: min(560px, 92vw); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0ms !important; transition-duration: 0.01ms !important; }
}
