/* Estilos de gato-perdido.cl: la página del juego (body.inicio) y la
   política de privacidad (body.privacidad). Los colores, de noche en la
   ciudad: azul noche, crema y el naranjo del título del juego. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fuentes/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("fuentes/source-sans-3.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("fuentes/source-sans-3-italica.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #f6f4ef;
  --fg: #1f2433;
  --suave: #5b6275;
  --linea: #dcd8cd;
  --caja: #ffffff;
  --noche: #16224e;
  --noche-fg: #f3ead8;
  --luna: #f3d38a;
  --ambar: #b8650b;
  --naranjo-1: #ffc44a;
  --naranjo-2: #f08a1c;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --texto: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --lado: max(16px, env(safe-area-inset-left, 0px));
  --lado-der: max(16px, env(safe-area-inset-right, 0px));
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11152a; --fg: #e9e6dd; --suave: #a3a8ba; --linea: #2b3150;
    --caja: #181d36; --noche: #0b1028; --ambar: #f2a33a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #11152a; --fg: #e9e6dd; --suave: #a3a8ba; --linea: #2b3150;
  --caja: #181d36; --noche: #0b1028; --ambar: #f2a33a;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--texto);
  font-size: 1.08rem;
  line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ambar); }
a:focus-visible, .boton:focus-visible { outline: 3px solid var(--naranjo-1); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); text-wrap: balance; line-height: 1.12; }
h2 { font-weight: 800; font-size: clamp(1.7rem, 4.5vw, 2.3rem); margin: 0 0 0.5rem; }
h3 { font-weight: 600; font-size: 1.2rem; margin: 2rem 0 0.4rem; }
p, ul { max-width: 65ch; }
strong { font-weight: 600; }
code { font-size: 0.92em; background: var(--caja); border: 1px solid var(--linea); padding: 0 0.3em; border-radius: 4px; }

/* ---------- barra de arriba e idiomas (las dos páginas) ---------- */
.barra {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
  width: 100%;
  max-width: 68rem;
  margin: 0 auto;
}
.barra-marca, .barra-marca a {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--luna);
  text-decoration: none;
}
.idiomas { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.idiomas a {
  color: var(--noche-fg);
  border: 1px solid rgba(243, 234, 216, 0.4);
  border-radius: 999px;
  padding: 0.15rem 0.85rem;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
}
.idiomas a:hover { background: rgba(243, 234, 216, 0.12); }
.idiomas a[aria-current="page"] { background: var(--noche-fg); color: var(--noche); border-color: var(--noche-fg); }

/* ---------- portada ---------- */
.portada {
  position: relative;
  isolation: isolate;
  color: var(--noche-fg);
  background: var(--noche);
  padding: 1rem var(--lado-der) 3.5rem var(--lado);
  min-height: min(92vh, 52rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.portada-fondo, .portada-fondo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
  z-index: -2;
}
/* En el celular la foto se corta a lo alto: que se vea el gato en la azotea
   (a la izquierda de la ilustración). */
@media (max-width: 767px) { .portada-fondo img { object-position: 14% 40%; } }
.portada::after {
  /* Oscurece abajo para que se lea el título. */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to bottom, rgba(8, 10, 28, 0.55) 0%, rgba(8, 10, 28, 0) 22%),
    linear-gradient(to top, rgba(8, 10, 28, 0.92) 0%, rgba(8, 10, 28, 0.55) 38%, rgba(8, 10, 28, 0) 70%);
}
.portada-dentro {
  margin: auto auto 0;
  width: 100%;
  max-width: 68rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.icono {
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 1.3rem;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
  margin-bottom: 1rem;
}
.logo {
  margin: 0;
  font-weight: 800;
  font-size: clamp(2.9rem, 12vw, 6.2rem);
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--naranjo-2);
  background: linear-gradient(to bottom, var(--naranjo-1) 25%, var(--naranjo-2) 85%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px 0 #23160c) drop-shadow(0 6px 14px rgba(0, 0, 0, 0.55));
}
.lema {
  margin: 0.6rem auto 0;
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  text-wrap: balance;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}
.botones { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; margin-top: 1.8rem; }
.boton {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.05rem;
  text-decoration: none;
}
.boton-principal { background: linear-gradient(to bottom, var(--naranjo-1), var(--naranjo-2)); color: #23160c; }
.boton-principal:hover { filter: brightness(1.07); }
.boton-pronto { background: rgba(243, 234, 216, 0.14); color: var(--noche-fg); border: 1px dashed rgba(243, 234, 216, 0.55); }
.boton-secundario { color: var(--noche-fg); border: 1px solid rgba(243, 234, 216, 0.55); }
.boton-secundario:hover { background: rgba(243, 234, 216, 0.12); }

/* ---------- secciones de la página del juego ---------- */
.inicio main > section {
  max-width: 68rem;
  margin: 0 auto;
  padding: 3.5rem var(--lado-der) 0 var(--lado);
}
.inicio main > section:last-child { padding-bottom: 4rem; }
.destacado { font-size: 1.25rem; font-style: italic; }
.cifras {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  max-width: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.8rem;
}
.cifras li {
  background: var(--caja);
  border: 1px solid var(--linea);
  border-radius: 0.8rem;
  padding: 0.8rem 1rem;
  color: var(--suave);
  font-weight: 600;
}
.cifra {
  display: block;
  font-family: var(--display);
  font-weight: 800;
  font-size: 2.3rem;
  line-height: 1.1;
  color: var(--ambar);
}
.galeria {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.2rem;
  margin-top: 1.5rem;
}
@media (min-width: 760px) { .galeria { grid-template-columns: 1fr 1fr; } }
.galeria figure { margin: 0; }
.galeria a { display: block; border-radius: 0.7rem; overflow: hidden; background: var(--noche); }
.galeria img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform 0.25s ease; }
@media (prefers-reduced-motion: no-preference) { .galeria a:hover img { transform: scale(1.03); } }
.galeria figcaption { margin-top: 0.45rem; color: var(--suave); font-weight: 600; font-size: 0.98rem; }
.lista { padding-left: 1.2rem; }
.lista li + li { margin-top: 0.5rem; }
.lista li::marker { color: var(--ambar); }

/* ---------- ranking ---------- */
.tabla { overflow-x: auto; margin-top: 1rem; background: var(--caja); border: 1px solid var(--linea); border-radius: 0.8rem; }
table { border-collapse: collapse; width: 100%; font-size: 1rem; }
th, td { text-align: left; vertical-align: top; padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--linea); }
tbody tr:last-child td { border-bottom: 0; }
th { font-family: var(--display); font-weight: 600; font-size: 0.85rem; letter-spacing: 0.04em; color: var(--suave); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.puesto { color: var(--suave); font-variant-numeric: tabular-nums; width: 2.5rem; }
.ranking tbody tr:nth-child(-n+3) .puesto { color: var(--ambar); font-weight: 800; }
.etiqueta { color: var(--suave); font-size: 0.9em; }
.plus {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0 0.4rem;
  border-radius: 0.3rem;
  background: var(--ambar);
  color: var(--bg);
  font-size: 0.75em;
  font-weight: 600;
  vertical-align: 0.1em;
}
.aviso { color: var(--suave); text-align: center; padding: 1.4rem 1rem; }
.jugador { overflow-wrap: anywhere; }

/* ---------- pie ---------- */
.pie {
  background: var(--noche);
  color: var(--noche-fg);
  padding: 2rem var(--lado-der) calc(2rem + env(safe-area-inset-bottom, 0px)) var(--lado);
  text-align: center;
  font-size: 0.97rem;
}
.pie p { margin: 0.35rem auto; }
.pie a { color: var(--luna); }

/* ---------- política de privacidad ---------- */
.franja {
  background: var(--noche);
  color: var(--noche-fg);
  padding: 1rem var(--lado-der) 2.2rem var(--lado);
  position: relative;
  overflow: hidden;
}
.franja::after {
  /* La luna, arriba a la derecha (al lado de la marca, lejos del título). */
  content: "";
  position: absolute;
  top: 0.8rem;
  right: max(28px, 8vw);
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  box-shadow: -0.7rem 0.35rem 0 0 var(--luna);
  opacity: 0.9;
}
.franja .dentro, .privacidad main { max-width: 44rem; margin: 0 auto; }
.franja h1 { font-weight: 800; font-size: clamp(2rem, 6vw, 2.9rem); margin: 2rem 0 0.6rem; }
.franja p { margin: 0; opacity: 0.85; }
.privacidad .franja .idiomas { margin-top: 1.2rem; }
.privacidad main { padding: 2rem var(--lado-der) 4rem var(--lado); }
.privacidad section + section { margin-top: 3.5rem; padding-top: 2.5rem; border-top: 2px solid var(--linea); }
.privacidad h2 { font-size: 1.7rem; margin-bottom: 0.3rem; }
.privacidad p, .privacidad ul { margin: 0.5rem 0; }
.privacidad ul { padding-left: 1.2rem; }
.privacidad li + li { margin-top: 0.3rem; }
.fecha { color: var(--suave); margin: 0 0 1.5rem; }
.resumen {
  background: var(--caja);
  border: 1px solid var(--linea);
  border-left: 4px solid var(--ambar);
  padding: 1rem 1.2rem;
  margin: 1rem 0 0.5rem;
}
.resumen ul { margin: 0.3rem 0 0; }
.privacidad .tabla { border-radius: 0; background: none; border: 0; }
.privacidad table { min-width: 34rem; font-size: 0.97rem; }
.privacidad th, .privacidad td { padding: 0.55rem 0.7rem; }
.correo { font-weight: 600; }
