:root {
  --red: #ff0000;
  --red-dark: #c40018;
  --blue: #1f8fff;
  --blue-dark: #0a5fd6;
  --bulb: #fff1c9;
  --spin-ms: 5500ms;
}

* { box-sizing: border-box; margin: 0; }

html, body { height: 100%; }

body {
    background: radial-gradient(circle at 50% 40%, #e1251b, #003057 80%);
    font-family: "Open Sans", "Segoe UI", system-ui, sans-serif;
    color: #fff;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}
.scene {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4vmin;
}

/*
  Mobile first.
  < 980px: ruleta arriba y los dos logos juntos debajo.
  >= 980px: logo a la izquierda, ruleta al centro, expo-feria a la derecha.
*/
.row {
  display: grid;
  grid-template-columns: auto;
  grid-template-areas:
    "logo"
    "wheel"
    "expo";
  justify-content: center;
  align-items: center;
  justify-items: center;
  row-gap: 6vh;
  width: 100%;
  padding: 0 4vw;
  margin-bottom: 20px;
}

.stage { grid-area: wheel; justify-self: center; }
.side--logo { grid-area: logo; }
.side--expo { grid-area: expo; }

.side {
  height: auto;
  pointer-events: none;
  filter: drop-shadow(0 .4em .6em rgba(0, 0, 0, .35));
}

.side--logo { width: min(30vw, 110px); }
.side--expo { width: min(22vw, 80px); }

/* Todo el dibujo se dimensiona en em: 1em = diámetro de la ruleta */
.stage {
  --size: min(88vw, 52vh, 560px);
  position: relative;
  width: var(--size);
  height: var(--size);
  font-size: var(--size);
}

.stage > * {
  position: absolute;
  border-radius: 50%;
}

/* Aro exterior con volumen */
.ring {
  inset: 0;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, .45), transparent 38%),
    radial-gradient(circle at 50% 50%, #ff3b22 0%, var(--red) 55%, #d10010 100%);
  box-shadow:
    inset 0 .008em .02em rgba(255, 255, 255, .7),
    inset 0 -.02em .035em rgba(90, 0, 0, .45),
    0 .026em 0 var(--red-dark),
    0 .05em .02em rgba(255, 0, 90, .45),
    0 .09em .09em rgba(0, 0, 0, .35);
}

/* Bombillas */
.lights { inset: 0; }

.bulb {
  position: absolute;
  left: 50%;
  top: 50%;
  width: .03em;
  height: .03em;
  margin: -.015em 0 0 -.015em;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #fff, var(--bulb) 55%, #ffc46b);
  box-shadow: 0 0 .012em .004em #fff6dc, 0 0 .03em .01em rgba(255, 190, 90, .85);
  transform: rotate(var(--a)) translateY(-.4625em);
}

.stage.spinning .bulb { animation: blink .5s steps(1) infinite; }
.stage.spinning .bulb:nth-child(even) { animation-delay: .25s; }

@keyframes blink {
  50% {
    background: #ffd9a0;
    box-shadow: 0 0 .006em 0 rgba(255, 214, 150, .5);
    filter: brightness(.65);
  }
}

/* Hueco donde se asienta la rueda */
.well {
  inset: 7.5%;
  background: #8e0010;
  box-shadow:
    inset 0 .012em .03em rgba(0, 0, 0, .7),
    0 .004em .008em rgba(255, 150, 130, .8);
}

/* Rueda giratoria */
.wheel {
  inset: 9.5%;
  overflow: hidden;
  transition: transform var(--spin-ms) cubic-bezier(.12, .6, .08, 1);
  will-change: transform;
}

/* Brillo glossy (no gira con el texto: va bajo las etiquetas) */
.wheel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(0, 0, 0, .28) 0, transparent 30%),
    radial-gradient(circle at 50% 50%, transparent 55%, rgba(255, 255, 255, .22) 100%);
  pointer-events: none;
}

/* Separadores en relieve entre sectores */
.wheel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-conic-gradient(
    from calc(var(--half, 30deg) * -1),
    rgba(120, 0, 10, .55) 0 .5deg,
    rgba(255, 255, 255, .35) .5deg .9deg,
    transparent .9deg var(--step, 60deg)
  );
  pointer-events: none;
}

.wheel__label {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 6.4em;
    transform-origin: 0 0;
    transform: rotate(calc(var(--a) - 90deg)) translate(3.4em, -50%);
    text-align: center;
    font-size: .04em;
    line-height: 1.15;
    font-weight: 600;
    /* text-shadow: 0 .06em .12em rgba(0, 0, 0, .55); */
    z-index: 1;
}

/* Solo "Sigue intentando": más pequeño; mismas medidas de caja (6.4em / 3.7em) escaladas a .75 */
.wheel__label--small {
    font-size: .03em;
    width: 8.53em;
    transform: rotate(calc(var(--a) - 90deg)) translate(4.1em, -50%);
}

.wheel__label small {
  display: block;
  font-size: .8em;
  font-weight: 700;
  opacity: .95;
}

/* Aguja y centro */
.needle {
  left: 50%;
  top: 50%;
  width: .03em;
  height: .14em;
  border-radius: 0;
  transform: translate(-50%, -100%);
  transform-origin: 50% 100%;
  background: linear-gradient(90deg, #ff6a50, var(--red) 50%, #a00010);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  filter: drop-shadow(0 0 .004em #fff) drop-shadow(0 .006em .008em rgba(0, 0, 0, .5));
  z-index: 4;
}

.hub {
  left: 50%;
  top: 50%;
  width: .16em;
  height: .16em;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 40% 30%, #4aa8ff, var(--blue) 50%, var(--blue-dark));
  box-shadow: 0 .012em .02em rgba(0, 0, 0, .55), inset 0 .004em .008em rgba(255, 255, 255, .7);
  z-index: 3;
}

/* Botón rojo: exactamente centrado sobre el aro azul y por encima de la aguja */
.hub-btn {
  left: 50%;
  top: 50%;
  width: .11em;
  height: .11em;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 50% 38%, #ff6b55, var(--red) 55%, #b00012);
  box-shadow: 0 0 .016em rgba(0, 0, 0, .5), inset 0 .004em .008em rgba(255, 255, 255, .55);
  z-index: 5;
}

.hint {
  font-size: clamp(14px, 2.4vmin, 20px);
  letter-spacing: .04em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .5);
  animation: pulse 1.8s ease-in-out infinite;
}

.hint.is-hidden { visibility: hidden; animation: none; }

@keyframes pulse { 50% { opacity: .55; } }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  padding: 20px;
  background: rgba(0, 12, 32, .72);
  backdrop-filter: blur(4px);
  cursor: default;
  z-index: 10;
  overflow-y: auto;
  animation: fade .25s ease-out;
}

.modal[hidden] { display: none; }

/* Estilo de la campaña: azul marino, esquinas rojas en diagonal, etiquetas en bloque */
.modal__card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  width: min(92vw, 460px);
  margin: auto;
  padding: 44px 28px 40px;
  text-align: center;
  color: #fff;
  background:
    radial-gradient(circle at 50% 0%, #0d4a9c 0, transparent 60%),
    linear-gradient(180deg, #08336f, #00244f 70%);
  border-radius: 22px;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .12), 0 26px 60px rgba(0, 0, 0, .6);
  animation: pop .45s cubic-bezier(.2, 1.4, .4, 1);
}

.modal__card::before,
.modal__card::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 34%;
  aspect-ratio: 1.6;
  background: var(--red);
}

.modal__card::before { top: 0; left: 0; clip-path: polygon(0 0, 100% 0, 0 100%); }
.modal__card::after { right: 0; bottom: 0; width: 18%; clip-path: polygon(100% 0, 100% 100%, 0 100%); }

.modal__eyebrow { margin-bottom: 14px; }

.modal__eyebrow span {
  display: inline-block;
  padding: 6px 18px;
  font-size: 1.05rem;
  font-weight: 800;
  background: var(--red);
  box-shadow: 4px 4px 0 rgba(255, 255, 255, .9);
  transform: rotate(-2deg);
}

.modal__prize {
  margin: 0 0 28px;
  font-size: clamp(1.7rem, 7vw, 2.3rem);
  font-weight: 800;
  line-height: 1.45;
  text-transform: uppercase;
  text-wrap: balance;
}

.modal__prize span {
  padding: 2px 14px;
  background: var(--blue);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
}

.modal__msg {
  margin: 0 auto 8px;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.35;
}

.modal__btn {
  font: inherit;
  font-weight: 800;
  padding: 12px 40px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(180deg, #ff4a3a, var(--red) 55%, var(--red-dark));
  box-shadow: 0 4px 0 #8c0010, 0 8px 16px rgba(0, 0, 0, .35);
  transition: transform .1s;
}

.modal__btn:hover { transform: translateY(-1px); }
.modal__btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #8c0010; }
.modal__btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }

/* Tablet: ruleta más grande, logos juntos debajo */
@media screen and (min-width: 580px) {
  .row {
    grid-template-columns: auto auto;
    grid-template-areas:
      "logo  expo"
      "wheel wheel";
    column-gap: 6vw;
    row-gap: 9vh;
  }
  .side--logo { justify-self: end; }
  .side--expo { justify-self: start; }
  .stage { --size: min(78vw, 60vh, 600px); }
  .side--logo { width: min(24vw, 190px); }
  .side--expo { width: min(18vw, 140px); }
}

/* Escritorio: logo | ruleta | expo-feria en una fila */
@media screen and (min-width: 980px) {
  .row {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    grid-template-areas: "logo wheel expo";
    column-gap: 4vw;
    padding: 0 3vw;
  }
  .stage { --size: min(78vmin, 560px); }
  .side--logo { justify-self: center; width: min(20vw, 240px); }
  .side--expo { justify-self: center; width: min(20vw, 240px); }
}

@media screen and (min-width: 1280px) {
  .stage { --size: min(80vmin, 640px); }
  .side--logo, .side--expo {
    width: min(15vw, 280px);
}
}

@media (prefers-reduced-motion: reduce) {
  .hint, .stage.spinning .bulb, .modal, .modal__card { animation: none; }
}

/* Formulario de registro (usa la misma tarjeta de la campaña) */
.form-title {
  margin: 0 0 18px;
  font-size: clamp(1.35rem, 5.5vw, 1.7rem);
  font-weight: 800;
  line-height: 1.2;
  text-wrap: balance;
}

.field,
.check { display: block; margin-bottom: 14px; text-align: left; }

.field > span {
  display: block;
  margin-bottom: 5px;
  font-size: .85rem;
  font-weight: 700;
}

.field input {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  font-size: 1rem;
  color: #00244f;
  background: #fff;
  border: 2px solid transparent;
  border-radius: 12px;
}

.field input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(31, 143, 255, .45);
}

.field.is-invalid input { border-color: var(--red); }

.phone { display: flex; align-items: stretch; }

.phone b {
  display: grid;
  place-items: center;
  padding: 0 12px;
  font-weight: 800;
  background: var(--blue);
  border-radius: 12px 0 0 12px;
}

.phone input { border-radius: 0 12px 12px 0; }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: .8rem; line-height: 1.35; }
.check input { flex: none; width: 18px; height: 18px; margin-top: 1px; accent-color: var(--red); }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-error {
  margin: 0 0 14px;
  padding: 9px 12px;
  font-size: .9rem;
  font-weight: 600;
  background: rgba(255, 0, 0, .85);
  border-radius: 10px;
}

.form-error[hidden] { display: none; }

.modal__btn:disabled { opacity: .6; cursor: wait; }

/* Botón de registro + enlace "Ya me registré" */
.field[hidden],
.check[hidden] { display: none; }

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 22px;
}

.link-btn {
  padding: 6px 2px;
  font: inherit;
  font-size: .95rem;
  font-weight: 700;
  color: #fff;
  background: none;
  border: 0;
  border-bottom: 2px solid rgba(255, 255, 255, .55);
  cursor: pointer;
}

.link-btn:hover { border-bottom-color: #fff; }
.link-btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
