/* Visual de campaña: Godzilla Memory Match
   Cielo de tormenta azul verdoso + franja azul eléctrico → cian. */
:root {
  --c-bg: #050c14;
  --c-bg-2: #0d1d2a;
  --c-card: rgba(10, 22, 34, .86);
  --c-card-solid: #0b1824;
  --c-input: #06111b;
  --c-text: #f2f7fb;
  --c-muted: #a3b7c6;
  --c-border: rgba(120, 190, 230, .26);
  --c-blue: #0050ff;
  --c-blue-2: #00c2ff;
  --c-navy: #1a1270;
  --c-red: #e5484d;     /* solo para errores */
  --c-red-2: #ff6b6b;
  --c-error: #ff8a8a;
  --c-error-bg: rgba(229, 72, 77, .12);
  --c-ok: #4ade9a;
  --franja: linear-gradient(90deg, var(--c-navy) 0%, var(--c-blue) 55%, var(--c-blue-2) 100%);
  --glow-blue: 0 0 24px rgba(0, 80, 255, .5), 0 0 2px rgba(0, 194, 255, .9);
  --radius: 18px;
  --font: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Anton", "Arial Narrow", Impact, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--c-text);
  background-color: var(--c-bg);
  background-image:
    radial-gradient(800px 500px at 90% 0%, rgba(214, 228, 200, .10), transparent 60%),
    radial-gradient(900px 600px at 0% 60%, rgba(70, 140, 160, .14), transparent 60%),
    radial-gradient(900px 600px at 100% 100%, rgba(0, 80, 255, .14), transparent 60%);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.5;
}

a { color: var(--c-blue-2); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 0 0 72px; text-align: center; }
/* Fondo: el arte de campaña desenfocado (si falta el nuevo, el póster anterior), fundido hacia la página */
.hero::before {
  content: ""; position: absolute; inset: -40px;
  background: url("../img/godzilla-memory-match.jpg") center 30% / cover no-repeat, url("../img/godzilla-poster.jpg") center 60% / cover no-repeat;
  filter: blur(28px) saturate(1.2); opacity: .45;
  -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 55%, transparent 100%);
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(5, 12, 20, .6) 0%, rgba(5, 12, 20, .2) 40%, rgba(5, 12, 20, 0) 100%);
}
.hero > * { position: relative; z-index: 1; }

.hero__barra { display: flex; justify-content: center; padding: 18px 16px; }
.hero__logo { display: block; height: 28px; width: auto; }

.hero__inner { max-width: 1080px; margin: 0 auto; padding: 0 16px; display: grid; gap: 28px; justify-items: center; }
/* Arte de campaña "Godzilla Memory Match" (1024×1280), completo */
.hero__poster {
  display: block; width: 100%; max-width: 520px; height: auto;
  aspect-ratio: 1024 / 1280; object-fit: cover;
  border-radius: var(--radius);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 60px rgba(0, 194, 255, .2);
}
/* Respaldo con el póster anterior: se recorta su pie ("Descubre cómo en…") */
.hero__poster.es-respaldo { aspect-ratio: 1600 / 1690; object-position: top; }
.hero__copy { max-width: 520px; }
.hero__titulo {
  margin: 0; font-family: var(--font-display); font-weight: 400;
  /* La franja de Anton mide ~1.53em de alto: con 1.72 queda un espacio entre franjas y no se pisan */
  font-size: clamp(2rem, 8.4vw, 3.3rem); line-height: 1.72; text-transform: uppercase; letter-spacing: .01em;
  text-shadow: 0 4px 24px rgba(0, 0, 0, .5);
}
.hero__titulo span {
  padding: 0 10px; border-radius: 8px; color: #fff; text-shadow: none;
  background: var(--franja); box-shadow: var(--glow-blue);
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.hero__sub { margin: 16px auto 0; max-width: 520px; color: var(--c-muted); font-size: 1.05rem; }
.hero__sub strong { color: #fff; }
.hero__cta { margin-top: 24px; }

@media (min-width: 900px) {
  .hero__barra { max-width: 1080px; margin: 0 auto; justify-content: flex-start; padding: 24px 16px; }
  .hero__logo { height: 34px; }
  .hero__inner { grid-template-columns: minmax(0, 420px) minmax(0, 1fr); align-items: center; gap: 56px; text-align: left; }
  .hero__poster { justify-self: end; max-width: 420px; }
  .hero__copy { justify-self: start; max-width: none; }
  .hero__sub { margin-left: 0; }
  /* La franja "juega por un viaje a Japón" va en una sola línea: el título escala con el ancho
     disponible de la columna (≈ 11.8 px de ancho de franja por cada px de fuente). */
  .hero__titulo { font-size: clamp(2.1rem, calc((min(100vw, 1080px) - 508px) / 11.8), 2.9rem); }
  .hero__titulo span { white-space: nowrap; }
}

/* ---------- Layout ---------- */
.container { max-width: 680px; margin: -40px auto 0; padding: 0 16px 40px; position: relative; }
.container > * + * { margin-top: 24px; }
.container > [hidden] + * { margin-top: 0; } /* una sección oculta no deja espacio de más */

.card {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .45);
  padding: 26px 20px;
  scroll-margin-top: 16px;
  backdrop-filter: blur(6px);
}
.card h2 {
  margin: 0 0 6px; font-family: var(--font-display); font-weight: 400;
  font-size: 2rem; line-height: 1.05; text-transform: uppercase; letter-spacing: .01em;
}
.card__intro { margin: 0 0 22px; color: var(--c-muted); }
.card__intro strong { color: #fff; }

select:disabled { opacity: .55; cursor: not-allowed; }

@media (min-width: 560px) {
  .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
  .card { padding: 34px; }
  .card h2 { font-size: 2.4rem; }
}

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Cómo participar ---------- */
.pasos__lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.pasos__item {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 18px; border-radius: var(--radius);
  background: var(--c-card); border: 1px solid var(--c-border);
}
.pasos__item strong { display: block; font-size: 1rem; }
.pasos__item p { margin: 3px 0 0; color: var(--c-muted); font-size: .9rem; }
.pasos__num {
  flex-shrink: 0; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(160deg, var(--c-navy) 0%, var(--c-blue) 55%, var(--c-blue-2) 100%);
  box-shadow: var(--glow-blue);
  font-family: var(--font-display); font-size: 1.25rem; color: #fff;
}
@media (min-width: 680px) {
  .pasos__lista { grid-template-columns: repeat(3, 1fr); }
  .pasos__item { flex-direction: column; }
}

/* ---------- Campos ---------- */
.field { margin-bottom: 16px; }
.field label, .field .label { display: block; font-weight: 600; margin-bottom: 7px; font-size: .92rem; }

input[type="text"], input[type="email"], input[type="tel"], input[type="date"], input[type="time"], select {
  width: 100%; min-height: 50px; padding: 10px 14px;
  font: inherit; font-size: 16px; /* evita el zoom automático en iOS */
  color: var(--c-text); background: var(--c-input);
  border: 1.5px solid var(--c-border); border-radius: 12px;
  transition: border-color .15s, box-shadow .15s;
  appearance: none; -webkit-appearance: none;
  color-scheme: dark;
}
input::placeholder { color: #5f7099; }
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--c-blue-2) 50%), linear-gradient(135deg, var(--c-blue-2) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px;
}
select option { background: var(--c-card-solid); color: var(--c-text); }
input:focus, select:focus { outline: none; border-color: var(--c-blue-2); box-shadow: 0 0 0 3px rgba(0, 194, 255, .2), 0 0 16px rgba(0, 80, 255, .35); }

.field__hint { margin: 6px 0 0; font-size: .84rem; color: var(--c-muted); }
.field__error { margin: 6px 0 0; font-size: .85rem; color: var(--c-error); font-weight: 600; }
.field__error:empty { display: none; }
.has-error input, .has-error select { border-color: var(--c-red-2); background-color: var(--c-error-bg); }

/* Casillas */
.checks { margin: 8px 0 4px; padding: 16px; background: rgba(6, 17, 27, .7); border: 1px solid var(--c-border); border-radius: 12px; }
.field--check { margin-bottom: 10px; }
.field--check:last-child { margin-bottom: 0; }
.check { display: flex !important; gap: 12px; align-items: flex-start; font-weight: 400 !important; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; flex-shrink: 0; accent-color: var(--c-blue); }
.field--check.has-error .check span { color: var(--c-error); }

/* Selector Taquilla / Internet */
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.segmented__opt { position: relative; margin: 0 !important; }
.segmented__opt input { position: absolute; opacity: 0; pointer-events: none; }
.segmented__opt span {
  display: flex; align-items: center; justify-content: center; min-height: 50px;
  border: 1.5px solid var(--c-border); border-radius: 12px; background: var(--c-input);
  font-weight: 600; letter-spacing: .04em; cursor: pointer; transition: all .15s;
}
.segmented__opt input:checked + span {
  border-color: var(--c-blue-2); color: #fff;
  background: linear-gradient(90deg, rgba(0, 80, 255, .35), rgba(0, 194, 255, .2));
  box-shadow: 0 0 14px rgba(0, 80, 255, .4);
}
.segmented__opt input:focus-visible + span { box-shadow: 0 0 0 3px rgba(0, 194, 255, .35); }
.has-error .segmented__opt span { border-color: var(--c-red-2); }

.field--codigo input { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; letter-spacing: .15em; text-transform: uppercase; }

/* Aviso de actividad cerrada o aún no abierta */
.aviso-horario { margin: 0 0 18px; padding: 14px 16px; border-radius: 12px; font-weight: 600; text-align: center; color: #fff; background: rgba(0, 80, 255, .18); border: 1px solid var(--c-blue-2); }
.aviso-horario[hidden] { display: none; }
#form-registro.cerrado .datos-persona, #form-registro.cerrado #lista-boletas, #form-registro.cerrado .checks { opacity: .45; pointer-events: none; }

/* Datos de la persona */
.datos-persona { margin-bottom: 20px; }
.datos-persona__nota { margin: 0 0 14px; padding: 10px 14px; border-radius: 10px; font-size: .85rem; color: var(--c-muted); background: rgba(0, 80, 255, .1); border: 1px solid rgba(0, 194, 255, .25); }

/* Ayuda: dónde está el código de la boleta */
.ayuda-codigo { margin: 0 0 18px; padding: 14px; border-radius: 14px; background: rgba(6, 17, 27, .6); border: 1px solid var(--c-border); }
.ayuda-codigo__titulo { margin: 0 0 12px; font-family: var(--font-display); font-weight: 400; font-size: 1.15rem; letter-spacing: .03em; text-transform: uppercase; }
.ayuda-codigo__grid { display: grid; gap: 14px; }
@media (min-width: 560px) { .ayuda-codigo__grid { grid-template-columns: 1fr 1fr; } }
.ayuda-codigo__item { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.ayuda-codigo__subtitulo {
  align-self: flex-start; padding: 4px 12px; border-radius: 8px;
  background: var(--franja); color: #fff; font-weight: 700; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase;
}
.ayuda-codigo__enlace { display: block; border-radius: 10px; overflow: hidden; background: #fff; }
/* Mismo alto para las dos imágenes, sin deformarlas; en celular, alto máximo para no alargar el formulario */
.ayuda-codigo__enlace img { display: block; width: 100%; height: 300px; object-fit: contain; }
.ayuda-codigo__nota { margin: 0; font-size: .85rem; color: var(--c-muted); }
.ayuda-codigo__nota strong { color: var(--c-text); }

/* Bloque de boleta */
.boleta {
  margin: 0 0 16px; padding: 16px; border: 1.5px dashed var(--c-border); border-radius: 14px;
  min-width: 0; background: rgba(6, 17, 27, .45);
}
.boleta__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.boleta__titulo { font-family: var(--font-display); font-size: 1.25rem; text-transform: uppercase; letter-spacing: .03em; }

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

/* ---------- Botones ---------- */
.actions { margin-top: 24px; display: flex; justify-content: flex-end; }
.actions--stack { flex-direction: column; gap: 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 12px 28px; border-radius: 999px; border: 0;
  font: inherit; font-weight: 700; font-size: .95rem; letter-spacing: .14em; text-transform: uppercase;
  text-decoration: none; cursor: pointer; color: #fff;
  transition: transform .05s, box-shadow .2s, opacity .15s, filter .15s;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: progress; }
.btn--primary {
  background: linear-gradient(90deg, var(--c-navy) 0%, var(--c-blue) 55%, var(--c-blue-2) 100%);
  box-shadow: var(--glow-blue);
}
.btn--primary:hover { filter: brightness(1.12); box-shadow: 0 0 34px rgba(0, 80, 255, .75), 0 0 2px #fff; }
.btn--ghost { background: transparent; border: 1.5px solid var(--c-border); }
.btn--ghost:hover { border-color: var(--c-blue-2); box-shadow: 0 0 14px rgba(0, 80, 255, .35); }
.btn--block { width: 100%; }
@media (max-width: 559px) { .actions .btn--primary { width: 100%; } }

.form-error { margin: 16px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--c-error-bg); border: 1px solid rgba(255, 59, 59, .4); color: var(--c-error); font-weight: 600; }
.form-error:empty { display: none; }

/* ---------- Resultado ---------- */
.exito__head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.exito__head h2 { margin: 0; }
.exito__icono { flex-shrink: 0; font-size: 2.1rem; line-height: 1; }
/* El título recibe el foco por accesibilidad; no necesita el recuadro de foco */
#titulo-resultado:focus { outline: none; }
.codigos { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 12px; }
.codigo {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 12px;
  padding: 16px 18px; border-radius: 14px;
  background: linear-gradient(90deg, rgba(0, 80, 255, .22), rgba(6, 17, 27, .6));
  border: 1px solid rgba(0, 194, 255, .45);
  box-shadow: 0 0 18px rgba(0, 80, 255, .2);
}
.codigo__boleta { grid-column: 1 / -1; font-size: .8rem; color: var(--c-muted); }
.codigo__valor { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 1.4rem; font-weight: 700; letter-spacing: .14em; word-break: break-all; text-shadow: 0 0 12px rgba(0, 194, 255, .7); }
.codigo__copiar { border: 1.5px solid var(--c-blue-2); background: transparent; color: #fff; border-radius: 999px; padding: 7px 16px; font: inherit; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.codigo__copiar.is-ok { border-color: var(--c-ok); color: var(--c-ok); }
.nota { margin: 16px 0 0; font-size: .84rem; color: var(--c-muted); }

/* ---------- Juego embebido ---------- */
#titulo-juego { margin-bottom: 18px; }
.juego__marco {border-radius: 14px; overflow: hidden; background: var(--c-input); }
.juego__marco iframe { display: block; width: 100%; border: 0; background: #fff; }
.juego__placeholder {
  display: grid; place-content: center; gap: 6px; text-align: center;
  min-height: 360px; padding: 24px; border: 2px dashed var(--c-border); border-radius: 14px; color: var(--c-muted);
}
.juego__placeholder strong { color: var(--c-text); font-size: 1.1rem; }
.juego__placeholder code { color: var(--c-blue-2); }
.juego__alterno[hidden] { display: none; }
.juego__alterno {margin: 12px 0 0; font-size: .85rem; color: var(--c-muted); text-align: center; }

/* ---------- Ranking ---------- */
.ranking__tabla { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
.ranking__tabla th {
  padding: 0 14px 4px; text-align: left; font-size: .75rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--c-muted);
}
.ranking__tabla th:last-child, .ranking__tabla td:last-child { text-align: right; }
.ranking__tabla td { padding: 12px 14px; background: rgba(6, 17, 27, .7); border-top: 1px solid var(--c-border); border-bottom: 1px solid var(--c-border); }
.ranking__tabla td:first-child { border-left: 1px solid var(--c-border); border-radius: 12px 0 0 12px; width: 56px; }
.ranking__tabla td:last-child { border-right: 1px solid var(--c-border); border-radius: 0 12px 12px 0; }
.ranking__pos {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  font-family: var(--font-display); font-size: 1.05rem; background: rgba(0, 194, 255, .12); border: 1px solid var(--c-border);
}
.ranking__fila--top .ranking__pos { background: var(--franja); border: 0; box-shadow: var(--glow-blue); }
.ranking__fila--top td { border-color: rgba(0, 194, 255, .45); }
.ranking__cedula { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; letter-spacing: .06em; }
.ranking__puntos { font-family: var(--font-display); font-size: 1.25rem; letter-spacing: .02em; }
.ranking__vacio { margin: 0; padding: 22px; text-align: center; color: var(--c-muted); border: 1.5px dashed var(--c-border); border-radius: 14px; }
.ranking__nota { margin: 10px 0 0; font-size: .8rem; color: var(--c-muted); text-align: right; }
.ranking__nota:empty { display: none; }

/* ---------- Preloader (mientras se genera el código) ---------- */
.preloader {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center; padding: 24px;
  background: radial-gradient(600px 400px at 50% 45%, rgba(0, 80, 255, .22), transparent 70%), rgba(5, 12, 20, .92);
  backdrop-filter: blur(6px);
}
.preloader[hidden] { display: none; }
.preloader__caja { display: grid; justify-items: center; gap: 22px; text-align: center; }
.preloader__logo {
  width: min(260px, 70vw); height: auto;
  filter: drop-shadow(0 0 18px rgba(0, 194, 255, .55));
  animation: preloader-pulso 1.6s ease-in-out infinite;
}
.preloader__barra { position: relative; width: min(220px, 60vw); height: 4px; border-radius: 999px; overflow: hidden; background: rgba(0, 194, 255, .18); }
.preloader__barra span {
  position: absolute; inset: 0 auto 0 0; width: 40%; border-radius: 999px;
  background: linear-gradient(90deg, var(--c-blue), var(--c-blue-2));
  box-shadow: var(--glow-blue);
  animation: preloader-barra 1.2s ease-in-out infinite;
}
.preloader__texto { margin: 0; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; font-size: .85rem; color: var(--c-muted); }
body:has(.preloader:not([hidden])) { overflow: hidden; }

@keyframes preloader-pulso {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 12px rgba(0, 194, 255, .4)); }
  50% { transform: scale(1.04); filter: drop-shadow(0 0 26px rgba(0, 194, 255, .85)); }
}
@keyframes preloader-barra { 0% { transform: translateX(-110%); } 100% { transform: translateX(260%); } }
@media (prefers-reduced-motion: reduce) {
  .preloader__logo, .preloader__barra span { animation: none; }
  .preloader__barra span { width: 100%; }
}

/* ---------- Footer ---------- */
.footer { text-align: center; padding: 8px 16px 36px; color: var(--c-muted); font-size: .85rem; }
.footer a { color: var(--c-text); }
.footer__small { font-size: .78rem; }
.footer__credito { margin-top: 18px; font-size: .75rem; letter-spacing: .04em; color: var(--c-muted); }
.footer__credito a { color: var(--c-blue-2); font-weight: 600; text-decoration: none; }
.footer__credito a:hover { text-decoration: underline; }
