/* La whitelist. Los colores y las fuentes son los mismos que en el resto de
 * cosas del juego, para que se reconozca sin decir su nombre. */

@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/fuentes/archivo-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/fuentes/archivo-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/fuentes/inter-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/fuentes/inter-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --fondo: #060b10;
  --texto: #eaf2f7;
  --tenue: #b3c4cf;
  --apagado: #7d93a1;
  --arena: #f0b968;
  --arena-viva: #ffd08a;
  --arena-honda: #2a1a05;
  --agua: #4fc3d9;
  --alarma: #ff9d88;
  --r: 12px;
  --titulos: 'Archivo', 'Inter', system-ui, sans-serif;

  /* Lo que oscurece las fotos donde va el texto, que es en el centro: mas en
   * el medio y casi nada en los bordes, para que el texto se lea encima de la
   * arena y del agua, que son lo mas claro de las tres, y las fotos se sigan
   * viendo alrededor. */
  --velo: radial-gradient(ellipse 100% 72% at 50% 50%,
    rgb(6 11 16 / .82) 0%, rgb(6 11 16 / .68) 50%, rgb(6 11 16 / .28) 100%);

  color-scheme: dark;
}

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

/* Una clase que pone display gana al atributo hidden, que es del navegador. */
[hidden] { display: none !important; }

html {
  background: var(--fondo);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Sin fondo propio en body: se pintaria ENCIMA de .fondo, que va por debajo
 * de todo (z-index -1) y solo deja pasar el de html. */
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  color: var(--texto);
  font: 400 1rem/1.5 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-underline-offset: 3px; }
a:hover { color: var(--arena-viva); }
a:focus-visible { outline: 2px solid var(--agua); outline-offset: 3px; border-radius: 3px; }

.solo-lector {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}


/* ---------- El fondo: las tres imagenes ---------- */

.fondo {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--fondo);
}

.fondo::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 4;
  background:
    var(--velo),
    linear-gradient(to bottom, rgb(6 11 16 / .5) 0%, rgb(6 11 16 / 0) 16%);
}

.fondo__foto {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
}
.fondo__foto:first-child { opacity: 1; }

/* En vertical se ven de una en una, 8 s cada una. La primera no se mueve
 * nunca: las otras dos entran encima y la de debajo no se apaga hasta que la
 * tapan del todo. Fundiendo dos a la vez, a mitad de cambio se transparentan
 * y la pantalla parpadea a negro. */
@media (prefers-reduced-motion: no-preference) {
  .fondo__foto:nth-child(2) { animation: segunda 24s linear infinite; }
  .fondo__foto:nth-child(3) { animation: tercera 24s linear infinite; }
}

@keyframes segunda {
  0%, 29.17%      { opacity: 0; }   /* hasta el segundo 7 */
  33.33%, 66.67%  { opacity: 1; }   /* entra en 1 s y se queda */
  66.71%, 100%    { opacity: 0; }   /* ya tapada por la tercera */
}

@keyframes tercera {
  0%, 62.5%       { opacity: 0; }   /* hasta el segundo 15 */
  66.67%, 95.83%  { opacity: 1; }
  100%            { opacity: 0; }   /* se va y deja ver la primera */
}

/* En horizontal caben las tres a la vez, una al lado de otra: tres imagenes
 * verticales juntas miden casi lo mismo que una pantalla 16:9. */
@media (min-aspect-ratio: 5/4) {
  :root {
    --velo: radial-gradient(ellipse 45% 62% at 50% 52%,
      rgb(6 11 16 / .85) 0%, rgb(6 11 16 / .62) 55%, rgb(6 11 16 / .15) 100%);
  }
  .fondo {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: 100%;
    gap: 3px;
  }
  /* Con .fondo delante, para ganarle a los :nth-child del fundido. */
  .fondo .fondo__foto {
    position: relative;
    opacity: 1;
    animation: none;
  }
}


/* ---------- La portada ---------- */

/* En el centro de la pantalla: margin auto por los cuatro lados dentro del
 * body en columna. Si no cabe, empieza arriba y se desplaza. */
.portada {
  position: relative;
  width: min(100%, 48rem);
  margin: auto;
  padding: 32px 20px calc(32px + env(safe-area-inset-bottom));
  text-align: center;
}

.antetitulo {
  margin: 0 0 14px;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--arena);
  text-shadow: 0 1px 12px rgb(0 0 0 / .6);
}

.titulo {
  margin: 0;
  font-family: var(--titulos);
  font-weight: 900;
  font-size: clamp(3rem, 12.5vw, 6.5rem);
  line-height: .92;
  letter-spacing: -.025em;
  text-shadow: 0 4px 40px rgb(0 0 0 / .5);
}

/* La frase que hace de titulo: se lee entera, asi que es grande pero no
 * tanto como una sola palabra. */
.titular {
  margin: 0 auto;
  max-width: 44rem;
  font-family: var(--titulos);
  font-weight: 800;
  font-size: clamp(2rem, 4.6vw + .9rem, 3.4rem);
  line-height: 1.06;
  letter-spacing: -.015em;
  text-wrap: balance;
  text-shadow: 0 3px 30px rgb(0 0 0 / .5);
}

.entrada {
  margin: 18px auto 0;
  max-width: 31rem;
  font-size: clamp(1.08rem, .5vw + .98rem, 1.28rem);
  line-height: 1.45;
  text-wrap: balance;
}

.detalle {
  margin: 16px auto 0;
  max-width: 34rem;
  color: var(--tenue);
  font-size: clamp(1rem, .3vw + .95rem, 1.12rem);
  text-wrap: balance;
  text-shadow: 0 1px 14px rgb(0 0 0 / .75);
}

.lista {
  max-width: 30rem;
  margin: 28px auto 0;
}

.lista__form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (min-width: 30rem) {
  .lista__form { flex-direction: row; }
  /* Solo en fila: en columna, flex:1 le pone la altura a cero y la aplasta. */
  .lista__correo { flex: 1; }
}

.lista__correo {
  min-width: 0;
  height: 54px;
  padding: 0 18px;
  border: 1px solid rgb(255 255 255 / .22);
  border-radius: var(--r);
  background: rgb(6 11 16 / .6);
  color: var(--texto);
  font: inherit;
  font-size: 1rem; /* menos de 16px y el iPhone hace zoom al tocar */
}
.lista__correo::placeholder { color: rgb(234 242 247 / .45); }
.lista__correo:focus-visible {
  outline: 2px solid var(--agua);
  outline-offset: 2px;
  border-color: transparent;
}

/* El boton principal, el mismo en todas las paginas. */
.boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 54px;
  padding: 0 28px;
  border: 0;
  border-radius: var(--r);
  background: var(--arena);
  color: var(--arena-honda);
  font: 800 1.05rem/1 var(--titulos);
  letter-spacing: .01em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s, transform .15s;
}
.boton:hover { background: var(--arena-viva); color: var(--arena-honda); }
.boton:active { transform: translateY(1px); }
.boton:focus-visible { outline: 2px solid var(--arena-viva); outline-offset: 3px; }
.boton:disabled { opacity: .75; cursor: progress; }
.boton--ancho { width: 100%; }
.portada > .boton { margin-top: 28px; }

/* El campo trampa: fuera de la vista, pero no display:none, que es lo primero
 * que un robot aprende a saltarse. */
.trampa {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.aviso {
  display: none;
  margin: 12px 0 0;
  color: var(--alarma);
  font-weight: 600;
  font-size: .95rem;
}
.aviso:target,
.aviso.visible { display: block; }

.lista__letra {
  margin: 12px 0 0;
  font-size: .8125rem;
  color: var(--apagado);
}


/* ---------- Las paginas de texto: gracias, privacidad, 404 ---------- */

.hoja {
  position: relative;
  width: min(100%, 40rem);
  margin: auto;
  padding: 48px 20px 24px;
}

.hoja__marca {
  display: inline-block;
  margin-bottom: 28px;
  font-family: var(--titulos);
  font-weight: 900;
  font-size: 1.1rem;
  letter-spacing: -.01em;
  text-decoration: none;
}

.hoja h1 {
  margin: 0;
  font-family: var(--titulos);
  font-weight: 900;
  font-size: clamp(2.4rem, 9vw, 4.2rem);
  line-height: .95;
  letter-spacing: -.02em;
}

.hoja h2 {
  margin: 34px 0 8px;
  font-family: var(--titulos);
  font-weight: 800;
  font-size: 1.15rem;
}

.hoja p,
.hoja li { color: var(--tenue); }
.hoja p { margin: 14px 0 0; }
.hoja ul { margin: 10px 0 0; padding-left: 20px; }
.hoja li + li { margin-top: 6px; }
.hoja strong { color: var(--texto); font-weight: 600; }

.hoja__entrada {
  font-size: 1.15rem;
  color: var(--texto) !important;
}

.hoja__pie {
  margin-top: 40px !important;
  font-size: .8125rem;
  color: var(--apagado) !important;
}

/* Las paginas de texto llevan el fondo mas apagado: se vienen a leer. */
.fondo--apagado::after {
  background: rgb(6 11 16 / .86);
}


/* ---------- La pagina de gracias: tres fases ---------- */

/* Cada fase entra con un fundido corto al quitarle el hidden. */
.fase { animation: aparece .4s ease both; }
@keyframes aparece {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.fase:focus { outline: none; }

.invitacion,
.encuesta {
  max-width: 34rem;
  margin: 28px auto 0;
  padding: 20px 18px;
  border: 1px solid rgb(255 255 255 / .1);
  border-radius: 18px;
  background: rgb(6 11 16 / .74);
}

.invitacion__titulo {
  margin: 0;
  font-family: var(--titulos);
  font-weight: 800;
  font-size: 1.3rem;
  line-height: 1.2;
}
.invitacion__texto {
  margin: 8px 0 18px;
  color: var(--tenue);
  text-wrap: balance;
}
.invitacion__texto strong { color: var(--texto); font-weight: 700; }
.invitacion__letra {
  margin: 12px 0 0;
  font-size: .8125rem;
  color: var(--apagado);
}

.encuesta { padding: 14px 14px 18px; }

/* La flecha de volver a la izquierda y el paso en el centro; la columna de la
 * derecha esta vacia para que el texto quede centrado de verdad. */
.encuesta__cabeza {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  min-height: 40px;
}
.encuesta__atras {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--tenue);
  cursor: pointer;
}
.encuesta__atras:hover { background: rgb(255 255 255 / .08); color: var(--texto); }
.encuesta__atras:focus-visible { outline: 2px solid var(--agua); outline-offset: 2px; }

.encuesta__paso {
  grid-column: 2;
  margin: 0;
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--apagado);
}

.encuesta__progreso {
  height: 4px;
  margin: 8px 0 18px;
  border-radius: 999px;
  background: rgb(255 255 255 / .12);
  overflow: hidden;
}
.encuesta__barra {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--arena);
  transition: width .35s ease;
}

/* Recorta lo que entra deslizandose, para que no asome una barra de
 * desplazamiento a mitad de movimiento. */
.encuesta__preguntas { overflow: hidden; }

.pregunta {
  min-width: 0;
  margin: 0;
  padding: 3px;
  border: 0;
}
.pregunta.entra-der { animation: entra-der .32s ease both; }
.pregunta.entra-izq { animation: entra-izq .32s ease both; }

@keyframes entra-der {
  from { opacity: 0; transform: translateX(28px); }
  to   { opacity: 1; transform: none; }
}
@keyframes entra-izq {
  from { opacity: 0; transform: translateX(-28px); }
  to   { opacity: 1; transform: none; }
}

/* float: sin el, legend se pinta sobre el borde del fieldset y no se deja
 * colocar como un titulo normal. */
.pregunta legend {
  float: left;
  width: 100%;
  margin: 0 0 16px;
  padding: 0;
  font-family: var(--titulos);
  font-weight: 800;
  font-size: 1.3rem;
  line-height: 1.2;
  text-wrap: balance;
}
.pregunta legend small {
  display: block;
  margin-top: 4px;
  font: 400 .8125rem/1.4 'Inter', system-ui, sans-serif;
  color: var(--apagado);
}

/* En dos columnas: sueltas, en el movil caia una por fila y la pregunta de
 * ocho opciones sacaba los botones de la pantalla. */
.opciones {
  clear: both;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.opcion:last-child:nth-child(odd) { grid-column: 1 / -1; }

.opcion { position: relative; }
/* La casilla de verdad se queda (teclado, lector de pantalla); se ve la etiqueta. */
.opcion input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
}
.opcion span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  padding: 8px 6px;
  border: 1px solid rgb(255 255 255 / .22);
  border-radius: 14px;
  background: rgb(6 11 16 / .55);
  font-size: .9rem;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.opcion span:hover { border-color: rgb(255 255 255 / .5); }
.opcion input:checked + span {
  border-color: var(--arena);
  background: var(--arena);
  color: var(--arena-honda);
  font-weight: 700;
}
.opcion input:focus-visible + span { outline: 2px solid var(--agua); outline-offset: 2px; }
.opcion input:disabled + span { opacity: .4; cursor: not-allowed; }

/* Las cajas de escribir: la del juego y el buscador de paises. */
.idea { clear: both; margin-top: 14px; text-align: left; }
.idea__pregunta {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  text-align: center;
  text-wrap: balance;
}
.idea__caja,
.buscador__entrada {
  display: block;
  width: 100%;
  border: 1px solid rgb(255 255 255 / .22);
  border-radius: var(--r);
  background: rgb(6 11 16 / .8);
  color: var(--texto);
  font: inherit;
  font-size: 1rem; /* menos de 16px y el iPhone hace zoom al tocar */
}
.idea__caja { min-height: 88px; padding: 12px 14px; resize: vertical; }
.buscador__entrada { height: 52px; padding: 0 16px; }
.idea__caja::placeholder,
.buscador__entrada::placeholder { color: rgb(234 242 247 / .45); }
.idea__caja:focus-visible,
.buscador__entrada:focus-visible { outline: 2px solid var(--agua); outline-offset: 2px; border-color: transparent; }

.buscador { clear: both; text-align: left; }
.buscador__lista {
  margin: 6px 0 0;
  padding: 4px;
  list-style: none;
  border: 1px solid rgb(255 255 255 / .14);
  border-radius: var(--r);
  background: rgb(6 11 16 / .92);
}
.buscador__opcion,
.buscador__nada { padding: 11px 12px; border-radius: 9px; }
.buscador__opcion { cursor: pointer; }
.buscador__opcion:hover,
.buscador__opcion[aria-selected="true"] { background: rgb(240 185 104 / .16); color: var(--arena-viva); }
.buscador__nada { color: var(--apagado); }

.encuesta__seguir { margin-top: 18px; }
.encuesta__seguir:disabled { opacity: .35; cursor: not-allowed; }

.fin__marca {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--arena);
  color: var(--arena-honda);
  box-shadow: 0 8px 40px rgb(240 185 104 / .35);
}

@media (prefers-reduced-motion: reduce) {
  .fase,
  .pregunta.entra-der,
  .pregunta.entra-izq { animation: none; }
  .encuesta__barra { transition: none; }
}
