[hidden] { display: none !important; }
:root {
  --fondo: #fbf5ec;
  --tinta: #2a1e16;
  --suave: #7a6a5c;
  --linea: #eadfce;
  --yema: #f2a516;
  --gusta: #2f9e62;
  --paso: #e0533d;
  --encanta: #e89a00;
  --radio: 22px;
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  background: var(--fondo);
  color: var(--tinta);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { font-family: ui-rounded, "SF Pro Rounded", system-ui, sans-serif; letter-spacing: -0.02em; line-height: 1.1; }

#app { max-width: 480px; margin: 0 auto; height: 100dvh; position: relative; overflow: hidden; }
.pantalla {
  position: absolute; inset: 0;
  display: none; flex-direction: column;
  padding: max(16px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom));
}
.pantalla.activa { display: flex; animation: entra .35s ease-out; }
@keyframes entra { from { opacity: 0; transform: translateY(8px); } }

.marca { font-weight: 800; letter-spacing: .14em; text-transform: uppercase; font-size: 12px; color: var(--suave); text-align: center; }
.sub { color: var(--suave); font-size: 17px; }
.nota { color: var(--suave); font-size: 14px; text-align: center; }

/* ---------- Inicio ---------- */
.inicio-cuerpo { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.inicio-cuerpo h1 { font-size: clamp(36px, 11vw, 48px); }
.inicio-emojis { font-size: 52px; display: flex; gap: 6px; }
.inicio-emojis span { display: inline-block; animation: flota 3s ease-in-out infinite; }
.inicio-emojis span:nth-child(2) { animation-delay: .4s; }
.inicio-emojis span:nth-child(3) { animation-delay: .8s; }
@keyframes flota { 50% { transform: translateY(-6px) rotate(-4deg); } }
.inicio-pie { display: flex; flex-direction: column; gap: 10px; }

.boton-grande {
  width: 100%; padding: 18px; border-radius: 999px;
  background: var(--tinta); color: var(--fondo);
  font-weight: 700; font-size: 18px;
  transition: transform .12s ease;
}
.boton-grande:active { transform: scale(.97); }
.boton-grande:disabled { opacity: .35; }
.boton-texto { color: var(--suave); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; padding: 6px; text-align: center; }

/* ---------- Barra de progreso ---------- */
.barra { display: flex; align-items: center; gap: 12px; height: 40px; }
.progreso { flex: 1; height: 6px; border-radius: 99px; background: var(--linea); overflow: hidden; }
.progreso > div { height: 100%; width: 0; background: var(--yema); border-radius: 99px; transition: width .3s ease; }
.contador { font-variant-numeric: tabular-nums; font-size: 14px; color: var(--suave); min-width: 44px; text-align: right; }
.icono-boton { width: 40px; height: 40px; border-radius: 50%; font-size: 20px; color: var(--suave); }
.icono-boton:disabled { opacity: .25; }

/* ---------- Mazo ---------- */
.mazo { flex: 1; position: relative; margin: 12px 0 18px; }
.carta {
  position: absolute; inset: 0;
  border-radius: var(--radio); overflow: hidden;
  background: #ddd center / cover;
  box-shadow: 0 10px 30px rgba(42, 30, 22, .18), 0 2px 6px rgba(42, 30, 22, .08);
  touch-action: none; user-select: none; -webkit-user-select: none;
  transform: translateY(calc(var(--nivel) * 10px)) scale(calc(1 - var(--nivel) * .04));
  transition: transform .25s ease;
  will-change: transform;
  --o-gusta: 0; --o-paso: 0; --o-encanta: 0;
}
.carta img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; display: block; }
.carta-texto {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 70px 22px 22px;
  background: linear-gradient(to top, rgba(20, 12, 6, .88), rgba(20, 12, 6, .55) 55%, transparent);
  color: #fff;
}
.carta-texto h3 { font-size: 28px; margin-bottom: 6px; }
.carta-texto p { font-size: 16px; opacity: .92; }

.sello {
  position: absolute; top: 28px;
  padding: 6px 14px; border: 4px solid; border-radius: 12px;
  font-weight: 900; font-size: 30px; letter-spacing: .04em;
  background: rgba(255, 255, 255, .12);
  backdrop-filter: blur(2px);
}
.sello-gusta { left: 22px; color: var(--gusta); transform: rotate(-14deg); opacity: var(--o-gusta); }
.sello-paso { right: 22px; color: var(--paso); transform: rotate(14deg); opacity: var(--o-paso); }
.sello-encanta { left: 50%; top: auto; bottom: 150px; color: var(--encanta); transform: translateX(-50%) rotate(-6deg); opacity: var(--o-encanta); white-space: nowrap; font-size: 26px; }
.ve-gusta { --o-gusta: 1; }
.ve-paso { --o-paso: 1; }
.ve-encanta { --o-encanta: 1; }

.acciones { display: flex; justify-content: center; align-items: center; gap: 22px; }
.accion {
  width: 66px; height: 66px; border-radius: 50%;
  background: #fff; font-size: 28px; font-weight: 700;
  box-shadow: 0 6px 18px rgba(42, 30, 22, .12);
  transition: transform .12s ease;
}
.accion:active { transform: scale(.9); }
.accion.paso { color: var(--paso); }
.accion.gusta { color: var(--gusta); }
.accion.encanta { width: 54px; height: 54px; font-size: 24px; color: var(--encanta); }

/* ---------- Preguntas ---------- */
.pregunta { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 18px; padding-bottom: 40px; }
.casi { color: var(--suave); font-weight: 600; }
.pregunta h2 { font-size: 32px; }
.opciones { display: flex; flex-direction: column; gap: 10px; }
.opcion {
  text-align: left; padding: 17px 20px; border-radius: 16px;
  background: #fff; border: 2px solid var(--linea);
  font-size: 17px; font-weight: 600;
  transition: border-color .15s ease, background .15s ease, transform .1s ease;
}
.opcion:active { transform: scale(.98); }
.opcion[aria-pressed="true"] { border-color: var(--yema); background: #fff3d9; }

/* ---------- Perfil ---------- */
.perfil-cuerpo { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 10px; }
.eres { color: var(--suave); font-weight: 600; font-size: 18px; }
.perfil-emoji { font-size: 96px; line-height: 1; animation: rebota .7s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes rebota { from { transform: scale(.2) rotate(-20deg); opacity: 0; } }
.perfil-cuerpo h2 { font-size: 44px; }
.titulo-favs { margin-top: 18px; font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--suave); }
.favoritos { display: flex; gap: 10px; margin-top: 10px; justify-content: center; }
.favoritos figure { width: 100px; }
.favoritos img { width: 100px; height: 100px; object-fit: cover; border-radius: 16px; display: block; }
.favoritos figcaption { font-size: 12px; margin-top: 6px; color: var(--suave); line-height: 1.25; }
.perfil-pie { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.gracias { font-weight: 700; text-align: center; }

@media (min-height: 760px) { .carta-texto h3 { font-size: 30px; } }
