/* 360 Summer - tablet landscape first, responsive */
:root {
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --gold: rgba(255, 215, 120, 0.85);
  --shadow-deep: 0 12px 40px rgba(0, 0, 0, 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  overflow: hidden;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
}

.app-body {
  background: #2a1810;
}

.app {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: translateX(18px) scale(0.985);
  transition:
    opacity 0.45s var(--ease-out),
    transform 0.5s var(--ease-out);
}

.screen.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0) scale(1);
}

.screen.is-leaving {
  opacity: 0;
  transform: translateX(-22px) scale(0.98);
}

.layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.layer--bg,
.layer--rooftop {
  inset: 0;
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
}

.layer--bg { z-index: 0; }
.layer--rooftop { z-index: 1; }

.layer--bg picture,
.layer--bg img,
.layer--rooftop picture,
.layer--rooftop img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.layer--rooftop-small {
  opacity: 0.95;
}

.layer--texto {
  z-index: 2;
  align-items: flex-start;
  padding-top: clamp(18vh, 24vw, 28vh);
}

.layer--cta {
  z-index: 3;
  align-items: flex-end;
  padding-bottom: clamp(6vh, 10vw, 14vh);
}

.fill-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}

.layer--bg .fill-img {
  min-width: 100%;
  min-height: 100%;
}

.hero-texto {
  width: min(72vw, 720px);
  max-width: 92%;
  height: auto;
  filter: drop-shadow(var(--shadow-deep));
}

.btn-img {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  transform: scale(1);
  transition: transform 0.2s ease, filter 0.2s ease;
}

.btn-img img {
  width: min(42vw, 380px);
  max-width: 88%;
  height: auto;
  display: block;
  filter: drop-shadow(var(--shadow-deep));
}

.btn-img:active,
.btn-img:hover {
  transform: scale(1.04);
  filter: brightness(1.05);
}

/* Pregunta: dos columnas centradas verticalmente */
.screen--pregunta .layer--bg {
  z-index: 0;
}

.choices--split {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  justify-items: center;
  gap: clamp(0.5rem, 2vw, 2rem);
  padding: clamp(4rem, 12vh, 7rem) clamp(1rem, 4vw, 3rem) clamp(2rem, 6vh, 4rem);
}

.choice {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  width: min(38vw, 340px);
  max-width: 44%;
  transition:
    transform 0.28s var(--ease-out),
    filter 0.28s ease;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.28));
}

.choice img {
  width: 100%;
  height: auto;
  display: block;
}

.choice:hover,
.choice:focus-visible {
  transform: scale(1.04);
  outline: none;
}

.choice.is-picked {
  animation: pickPulse 0.38s ease forwards;
}

.choice.is-dim {
  opacity: 0.35;
  transform: scale(0.96);
}

@keyframes pickPulse {
  0% {
    transform: scale(1);
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.28));
  }
  40% {
    transform: scale(1.12);
    filter: drop-shadow(0 0 28px var(--gold)) brightness(1.08);
  }
  100% {
    transform: scale(1.06);
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.35));
  }
}

.pregunta-progress {
  position: absolute;
  bottom: clamp(1rem, 3vh, 2rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  color: #fff;
  font-weight: 600;
  font-size: clamp(0.9rem, 2.2vw, 1.25rem);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  letter-spacing: 0.04em;
}

/* Resultado */
.screen--resultado .layer--titulo-resultado {
  z-index: 3;
  align-items: center;
  padding-top: clamp(10vh, 16vw, 18vh);
}

.resultado-titulo-img {
  width: min(70vw, 640px);
  max-width: 92%;
  height: auto;
  animation: zoomBounce 0.85s var(--ease-out) both;
  filter: drop-shadow(var(--shadow-deep));
}

@keyframes zoomBounce {
  0% {
    opacity: 0;
    transform: scale(0.6) translateY(20px);
  }
  60% {
    opacity: 1;
    transform: scale(1.08) translateY(0);
  }
  100% {
    transform: scale(1);
  }
}

/* Formulario */
.form-wrap {
  position: relative;
  z-index: 4;
  width: min(92vw, 520px);
  max-height: 78vh;
  overflow: auto;
  margin-top: clamp(5rem, 14vh, 8rem);
  padding: clamp(1rem, 3vw, 1.5rem);
  background: rgba(20, 12, 8, 0.72);
  border-radius: 16px;
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-deep);
}

.form-title {
  margin: 0 0 1rem;
  color: #fff;
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  text-align: center;
}

.form-grid {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: #f5e6d6;
  font-size: 0.95rem;
}

.field input {
  font-size: clamp(1rem, 2.4vw, 1.15rem);
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.95);
  color: #1a120c;
}

.btn-submit {
  margin-top: 0.5rem;
  padding: 0.85rem 1.25rem;
  font-size: 1.1rem;
  font-weight: 700;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  background: linear-gradient(180deg, #ffb347, #ff7b1c);
  color: #2a1208;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: wait;
}

.form-error {
  color: #ffb4b4;
  margin: 0;
  font-size: 0.9rem;
}

/* Gracias */
.gracias-inner {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2rem;
}

.gracias-text {
  margin: 0 0 1.5rem;
  color: #fff;
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  font-weight: 800;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.btn-inicio {
  padding: 0.85rem 1.8rem;
  font-size: clamp(1rem, 2.4vw, 1.2rem);
  font-weight: 700;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  background: linear-gradient(180deg, #ffd76a, #ff7b1c);
  color: #2a1208;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease, filter 0.2s ease;
}

.btn-inicio:hover,
.btn-inicio:active {
  transform: scale(1.04);
  filter: brightness(1.05);
}

/* Confeti */
.confetti-root {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -12px;
  width: 10px;
  height: 14px;
  opacity: 0.95;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  to {
    transform: translateY(110vh) rotate(720deg);
    opacity: 0.9;
  }
}

/* Móvil / portrait: opciones apiladas */
@media (max-width: 899px), (orientation: portrait) {
  .choices--split {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    align-content: center;
    padding-top: clamp(5rem, 18vh, 8rem);
  }

  .choice {
    width: min(72vw, 420px);
    max-width: 92%;
  }

  .form-wrap {
    margin-top: clamp(4rem, 22vh, 7rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .screen,
  .choice,
  .btn-img,
  .resultado-titulo-img {
    transition: none !important;
    animation: none !important;
  }
}
