.app {
  max-width: 560px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(40px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  display: grid;
  gap: 16px;
}
.cargando { padding: 40vh 0; text-align: center; color: var(--tinta-suave); }
.cabecera { display: flex; align-items: center; justify-content: space-between; flex-direction: row-reverse; min-height: 48px; }
.logo { display: block; height: 30px; width: auto; }
.titulo { font-size: clamp(30px, 8vw, 42px); margin: 8px 0 4px; }
.titulo-chico { font-size: clamp(24px, 6vw, 30px); letter-spacing: 0.005em; }
.pie { text-align: center; color: var(--tinta-suave); font-size: 15px; margin-top: 8px; }

/* Tarjetas */
.tarjeta { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); padding: 22px 20px; display: grid; gap: 14px; }
.tarjeta-dia, .tarjeta-desafio { background: var(--fuerte-fondo); color: var(--fuerte-texto); border-color: transparent; --foco: #f2f3ee; }
.tarjeta-dia .detalle, .tarjeta-desafio .detalle, .tarjeta-dia .cuenta { color: var(--fuerte-suave); }
.tarjeta-dia .eyebrow, .tarjeta-desafio .eyebrow { color: var(--fuerte-acento); }
.tarjeta-dia a, .tarjeta-dia .boton.secundario, .tarjeta-desafio .boton.texto { color: var(--fuerte-texto); }
.tarjeta-dia .boton.secundario { border-color: var(--fuerte-texto); }
.fila-eyebrow { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.eyebrow { font-weight: 700; font-size: 15px; letter-spacing: 0.02em; color: var(--bosque); }
.racha { font-size: 14px; font-weight: 600; padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); }
.pregunta-chica { font-family: var(--serif); font-size: 22px; line-height: 1.25; letter-spacing: 0.005em; }
.pregunta-grande { font-size: clamp(24px, 6.4vw, 30px); }
.detalle { color: var(--tinta-suave); }
.cuenta { font-variant-numeric: tabular-nums; font-size: 15px; }
.etiqueta { font-family: var(--sans); font-size: 15px; font-weight: 700; color: var(--tinta-suave); letter-spacing: 0.02em; }

/* Botones */
.boton {
  display: inline-flex; align-items: center; justify-content: center; text-align: center;
  min-height: 48px; padding: 0 26px; border-radius: 999px; border: 2px solid transparent;
  font-weight: 700; font-size: 17px; line-height: 1.2; cursor: pointer; text-decoration: none; background: none;
  transition: transform 0.12s ease, filter 0.12s ease;
}
.boton:active { transform: scale(0.98); }
.boton:disabled { opacity: 0.55; cursor: default; }
.boton.primario { background: var(--ocre); color: #17140f; }
.boton.primario:hover:not(:disabled) { filter: brightness(1.06); }
.boton.secundario { border-color: var(--bosque); color: var(--bosque); }
.boton.texto { min-height: 44px; padding: 0 12px; color: var(--bosque); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.boton.grande { min-height: 56px; font-size: 18px; width: 100%; }
.acciones { display: grid; gap: 12px; margin-top: 4px; }
.acciones .boton { width: 100%; }
.acciones .boton.texto { width: auto; justify-self: start; }

/* Pregunta y deslizador */
.progreso { height: 8px; border-radius: 999px; background: var(--borde); overflow: hidden; }
.progreso-barra { display: block; height: 100%; width: calc(var(--p, 0) * 100%); background: var(--bosque); transition: width 0.4s ease; }
.zona-pregunta { display: grid; gap: 14px; padding-top: 4px; }
.pregunta { font-size: clamp(26px, 7vw, 34px); line-height: 1.18; }
.deslizador.bloqueado { opacity: 0.6; }
.deslizador.bloqueado .rango { cursor: default; }
.deslizador { margin: 6px 0 4px; }
.rango-fila { display: flex; align-items: flex-end; gap: 8px; }
.rango-caja { position: relative; flex: 1; padding-top: 64px; min-width: 0; }
.rango-valor {
  position: absolute; top: 0; left: calc(22px + (100% - 44px) * var(--p, 0)); transform: translateX(calc(-100% * var(--p, 0.5)));
  font-family: var(--serif); font-weight: 500; font-size: 36px; line-height: 1; color: var(--bosque); white-space: nowrap;
}
.rango { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 44px; margin: 0; background: transparent; cursor: pointer; touch-action: pan-y; }
.rango::-webkit-slider-runnable-track {
  height: 10px; border-radius: 999px;
  background: linear-gradient(to right, var(--bosque) calc(22px + (100% - 44px) * var(--p, 0)), var(--borde) 0);
}
.rango::-moz-range-track { height: 10px; border-radius: 999px; background: var(--borde); }
.rango::-moz-range-progress { height: 10px; border-radius: 999px; background: var(--bosque); }
.rango::-webkit-slider-thumb { -webkit-appearance: none; width: 44px; height: 44px; margin-top: -17px; border-radius: 50%; background: var(--ocre); border: 3px solid var(--tinta); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); }
.rango::-moz-range-thumb { width: 38px; height: 38px; border-radius: 50%; background: var(--ocre); border: 3px solid var(--tinta); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); }
.rango:focus-visible { outline: none; }
.rango:focus-visible::-webkit-slider-thumb { outline: 3px solid var(--foco); outline-offset: 3px; }
.rango:focus-visible::-moz-range-thumb { outline: 3px solid var(--foco); outline-offset: 3px; }
.rango-extremos { display: flex; justify-content: space-between; font-size: 14px; color: var(--tinta-suave); padding: 0 4px; }
.ajuste { flex: none; width: 44px; height: 44px; margin-bottom: 18px; border-radius: 50%; border: 2px solid var(--bosque); background: transparent; color: var(--bosque); font-size: 26px; line-height: 1; cursor: pointer; }
.rango-unidad { text-align: center; color: var(--tinta-suave); font-size: 18px; margin-top: 4px; }

/* Resultado de una pregunta */
.resultado-caja { display: grid; gap: 16px; }
.resultado-caja:empty { display: none; }
.resultado { display: grid; gap: 8px; padding: 20px; border-radius: var(--radio); background: var(--superficie); border: 1px solid var(--borde); }
.real { font-family: var(--serif); font-weight: 500; font-size: clamp(60px, 18vw, 92px); line-height: 1; color: var(--bosque); font-variant-numeric: lining-nums; }
.real-unidad { font-size: 0.34em; letter-spacing: 0; }
.tu-franja { color: var(--tinta-suave); }
.error { font-weight: 700; font-size: 19px; }
.puntos { color: var(--bosque); }
.dato { color: var(--tinta); }
.fuente { font-size: 14px; color: var(--tinta-suave); overflow-wrap: anywhere; }
.racha-grande { text-align: center; font-weight: 700; }

/* Pantalla final */
.tarjeta-puntaje { text-align: center; justify-items: center; }
.puntaje { font-family: var(--serif); font-weight: 500; font-size: 104px; line-height: 1; letter-spacing: -0.03em; }
.sobre-cien { font-size: 34px; color: var(--tinta-suave); letter-spacing: 0; }
.nivel { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 36px; color: var(--bosque); }
.circulos { display: flex; gap: 10px; }
.circulo { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--bosque); }
.circulo-exacto { background: var(--bosque); }
.circulo-lejos { border-color: var(--tinta-suave); opacity: 0.55; }
.fuerte { color: var(--tinta-suave); }
.fuerte strong { color: var(--tinta); }
.mail { display: grid; gap: 12px; margin-top: 6px; }
.mail form { display: grid; gap: 12px; }
.etiqueta-campo { font-weight: 700; font-size: 15px; }
.campo { width: 100%; min-height: 48px; padding: 0 16px; border-radius: 14px; border: 2px solid var(--borde); background: var(--fondo); }
.consentimiento { display: grid; grid-template-columns: 24px 1fr; gap: 12px; align-items: start; font-size: 15px; color: var(--tinta-suave); }
.consentimiento input { width: 24px; height: 24px; margin: 0; accent-color: var(--bosque); }
.estado { min-height: 1.4em; font-size: 15px; }
.error-texto { color: var(--ladrillo); font-weight: 600; }

/* Comparación */
.marcador { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 12px; text-align: center; }
.marcador-num { font-family: var(--serif); font-weight: 400; font-size: 84px; line-height: 0.95; letter-spacing: -0.04em; }
.marcador-nombre { color: var(--tinta-suave); font-weight: 600; overflow-wrap: anywhere; }
.marcador-vs { color: var(--tinta-suave); padding-bottom: 34px; }
.marcador-col.gana .marcador-num { color: var(--bosque); }

/* Diálogo, avisos, instalación */
.dialogo { width: min(92vw, 460px); border: 0; border-radius: var(--radio); padding: 24px; background: var(--superficie); color: var(--tinta); }
.dialogo::backdrop { background: rgba(10, 14, 11, 0.6); }
.dialogo form { display: grid; gap: 14px; }
.avisos { position: fixed; left: 0; right: 0; bottom: max(16px, env(safe-area-inset-bottom)); display: grid; justify-items: center; gap: 8px; padding: 0 16px; pointer-events: none; z-index: 30; }
.aviso, .actualizacion { pointer-events: auto; background: #17140f; color: #f2f3ee; padding: 12px 18px; border-radius: 999px; font-weight: 600; font-size: 15px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3); display: flex; align-items: center; gap: 14px; }
.actualizacion .boton { min-height: 36px; padding: 0 16px; font-size: 15px; }
.instalar { border-style: dashed; }
.instalar ol { margin: 0; padding-left: 20px; color: var(--tinta-suave); }

/* Páginas simples (privacidad) */
.texto-largo { max-width: 640px; display: grid; gap: 14px; }
.texto-largo h2 { font-size: 24px; margin-top: 12px; }
.texto-largo ul { margin: 0; padding-left: 22px; display: grid; gap: 6px; }

@media (min-width: 700px) {
  .app { padding-top: 32px; }
  .tarjeta { padding: 28px; }
}

/* ---------- Vida: animaciones y emojis ---------- */
@keyframes sube { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(0.3); opacity: 0; } 60% { transform: scale(1.18); opacity: 1; } 100% { transform: scale(1); } }
@keyframes rebote { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-9px); } 70% { transform: translateY(-3px); } }
@keyframes saludo { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(16deg); } 20%, 40% { transform: rotate(-10deg); } 50% { transform: rotate(8deg); } }
@keyframes llama { 0%, 100% { transform: scale(1) rotate(-3deg); } 50% { transform: scale(1.22) rotate(4deg); } }
@keyframes latido { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@keyframes vuela { 0% { opacity: 0; transform: translate(0, 0) scale(0.4); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(1.1); } }
@keyframes bumpvalor { 0% { transform: translateX(calc(-100% * var(--p, 0.5))) scale(0.92); } 60% { transform: translateX(calc(-100% * var(--p, 0.5))) scale(1.08); } 100% { transform: translateX(calc(-100% * var(--p, 0.5))) scale(1); } }

.app > * { animation: sube 0.45s cubic-bezier(0.2, 0.8, 0.3, 1) both; }
.app > *:nth-child(2) { animation-delay: 0.05s; }
.app > *:nth-child(3) { animation-delay: 0.12s; }
.app > *:nth-child(4) { animation-delay: 0.19s; }
.app > *:nth-child(5) { animation-delay: 0.26s; }
.app > *:nth-child(n + 6) { animation-delay: 0.32s; }
.resultado-caja > * { animation: sube 0.4s ease both; }
.resultado-caja > *:nth-child(2) { animation-delay: 0.12s; }
.resultado-caja > *:nth-child(3) { animation-delay: 0.22s; }

.saludo { display: inline-block; transform-origin: 70% 70%; animation: saludo 2.2s 0.6s ease-in-out 2; }
.llama { display: inline-block; animation: llama 1.6s ease-in-out infinite; }
.racha { background: rgba(232, 181, 58, 0.22); }

/* Emoji que acompaña a cada botón (no cambia el texto del botón) */
.boton[data-e]::before { content: attr(data-e); margin-right: 8px; display: inline-block; transition: transform 0.2s ease; }
.boton[data-e]:hover:not(:disabled)::before { transform: rotate(-12deg) scale(1.25); }
.boton { transition: transform 0.15s cubic-bezier(0.3, 1.6, 0.5, 1), filter 0.12s ease, box-shadow 0.15s ease; }
.boton.primario:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(232, 181, 58, 0.35); }
.boton:active:not(:disabled) { transform: scale(0.95); }
.boton.primario.grande:not(:disabled) { animation: latido 2.6s ease-in-out 1.2s infinite; }

.tarjeta { transition: transform 0.2s ease, box-shadow 0.2s ease; }
@media (hover: hover) { .tarjeta:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(23, 20, 15, 0.08); } }

/* Deslizador */
.rango-valor.salta { animation: bumpvalor 0.22s ease-out; }
.rango::-webkit-slider-thumb { transition: transform 0.15s cubic-bezier(0.3, 1.6, 0.5, 1); }
.rango:active::-webkit-slider-thumb { transform: scale(1.18); }
.rango:active::-moz-range-thumb { transform: scale(1.18); }
.ajuste { transition: transform 0.15s cubic-bezier(0.3, 1.6, 0.5, 1), background 0.15s; }
.ajuste:active:not(:disabled) { transform: scale(0.85); background: rgba(31, 77, 58, 0.12); }
.progreso-barra { transition: width 0.6s cubic-bezier(0.3, 1.4, 0.5, 1); }

/* Resultado */
.resultado { position: relative; }
.reaccion { position: absolute; top: 12px; right: 16px; font-size: 40px; line-height: 1; animation: pop 0.5s 0.25s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
.acierto { border-color: var(--ocre); box-shadow: 0 0 0 3px rgba(232, 181, 58, 0.3); }
.real { animation: pop 0.5s cubic-bezier(0.3, 1.6, 0.5, 1) both; transform-origin: left center; }
.confeti { position: absolute; left: 50%; top: 40%; width: 0; height: 0; pointer-events: none; z-index: 5; }
.pieza { position: absolute; font-size: 22px; opacity: 0; animation: vuela 1.6s var(--d, 0ms) cubic-bezier(0.1, 0.7, 0.3, 1) forwards; }

/* Pantalla final */
.tarjeta-puntaje { position: relative; overflow: visible; }
.trofeo { display: block; font-size: 52px; line-height: 1; animation: rebote 1s 0.5s ease 2, pop 0.6s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
.circulo { animation: pop 0.4s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
.circulo:nth-child(1) { animation-delay: 0.3s; } .circulo:nth-child(2) { animation-delay: 0.4s; } .circulo:nth-child(3) { animation-delay: 0.5s; }
.circulo:nth-child(4) { animation-delay: 0.6s; } .circulo:nth-child(5) { animation-delay: 0.7s; } .circulo:nth-child(6) { animation-delay: 0.8s; } .circulo:nth-child(7) { animation-delay: 0.9s; }
.nivel { animation: sube 0.6s 0.9s ease both; }

/* Botón de sonido */
.sonido { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; font-size: 22px; line-height: 1; cursor: pointer; transition: transform 0.15s cubic-bezier(0.3, 1.6, 0.5, 1); }
.sonido:active { transform: scale(0.85); }
.cabecera { gap: 8px; }
.cab-botones { display: flex; align-items: center; gap: 4px; }
