/* Jammed Trigger: hoja de estilos única. Sin dependencias externas.
   Paleta y botones según docs/biblia-de-arte.md (sección Interfaz). */

@font-face {
  font-family: "Fredoka";
  src: url("/fonts/fredoka-medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fredoka";
  src: url("/fonts/fredoka-semibold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fredoka";
  src: url("/fonts/fredoka-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --navy-oscuro: #111C30;
  --navy: #1F2B40;
  --navy-claro: #2A3A57;
  --contorno: #1E160E;
  --contorno-azul: #14213D;
  --crema: #FFF6E6;
  --crema-borde: #E7D3B0;
  --amarillo: #FFC23A;
  --naranja: #FF9F1A;
  --labio-amarillo: #C76A00;
  --oro: #FFD54A;
  --verde: #5BD15B;
  --verde-oscuro: #36B23C;
  --labio-verde: #1F7A25;
  --azul: #4A9BFF;
  --labio-azul: #1E5BB0;
  --gris: #A3A8B3;
  --texto: #2B2118;
  --texto-suave: #5C4A38;
  --texto-claro: #F3EBDD;
  --radio: 22px;
  --sombra-labio: 0 6px 0 var(--contorno);
  --ancho: 1120px;
  --fuente: "Fredoka", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 1rem;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--fuente);
  font-weight: 500;
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--texto-claro);
  background-color: var(--navy-oscuro);
  background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, .05) 1.5px, transparent 0);
  background-size: 22px 22px;
}

main { flex: 1; }

img { max-width: 100%; height: auto; display: block; }

a { color: var(--oro); text-underline-offset: .18em; text-decoration-thickness: 2px; }
a:hover { color: #fff; }

:focus-visible {
  outline: 4px solid var(--azul);
  outline-offset: 3px;
  border-radius: 8px;
}

h1, h2, h3 { font-weight: 700; line-height: 1.12; margin: 0 0 .5em; letter-spacing: .005em; }
h1 { font-size: clamp(2.1rem, 7.5vw, 3.9rem); }
h2 { font-size: clamp(1.7rem, 5vw, 2.5rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }

.envoltura { width: 100%; max-width: var(--ancho); margin: 0 auto; padding: 0 1rem; }

.saltar {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 10;
  padding: .6rem 1rem;
  background: var(--oro);
  color: var(--texto);
  font-weight: 700;
  border-radius: 12px;
}
.saltar:focus { top: 1rem; }

/* ---------- Cabecera ---------- */

.cabecera {
  background: var(--navy);
  border-bottom: 4px solid var(--contorno-azul);
  box-shadow: 0 4px 0 rgba(0, 0, 0, .25);
  position: relative;
  z-index: 2;
}
.cabecera .envoltura {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem 1rem;
  padding-top: .7rem;
  padding-bottom: .7rem;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  color: var(--oro);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.3rem;
  line-height: 1;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-right: auto;
}
.logo img { width: 44px; height: 44px; }
.logo:hover { color: #fff; }

.nav { display: flex; flex-wrap: wrap; gap: .25rem; margin: 0; padding: 0; list-style: none; }
.nav a {
  display: inline-block;
  padding: .55rem .8rem;
  min-height: 44px;
  color: var(--texto-claro);
  text-decoration: none;
  font-weight: 600;
  border-radius: 12px;
}
.nav a:hover, .nav a[aria-current="page"] { background: var(--navy-claro); color: var(--oro); }

.idioma {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  min-height: 44px;
  padding: .3rem .8rem;
  font-weight: 700;
  color: var(--texto);
  text-decoration: none;
  background: var(--crema);
  border: 3px solid var(--contorno);
  border-radius: 999px;
  box-shadow: 0 4px 0 var(--contorno);
}
.idioma:hover { color: var(--texto); background: #fff; }
.idioma:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--contorno); }

@media (max-width: 640px) {
  .cabecera .nav { order: 3; width: 100%; justify-content: space-between; }
  .nav a { padding: .5rem .55rem; }
}

/* ---------- Héroe con rayos ---------- */

.heroe {
  position: relative;
  overflow: hidden;
  color: #fff;
  background-color: var(--naranja);
  background-image:
    radial-gradient(circle at 50% 110%, rgba(255, 230, 140, .9) 0, rgba(255, 194, 58, .2) 45%, transparent 70%),
    repeating-conic-gradient(from 0deg at 50% 110%, #FFB52E 0deg 8deg, #FF9A1A 8deg 16deg);
  border-bottom: 5px solid var(--contorno);
}
.heroe::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 18px;
  background: linear-gradient(rgba(0, 0, 0, 0), rgba(120, 50, 0, .25));
  pointer-events: none;
}
.heroe .envoltura {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 1.5rem;
  align-items: center;
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
}
@media (min-width: 820px) {
  .heroe .envoltura { grid-template-columns: 1.35fr 1fr; padding-top: 4rem; padding-bottom: 4rem; }
}

.contorneado {
  color: #fff;
  -webkit-text-stroke: 8px var(--contorno);
  paint-order: stroke fill;
  text-shadow: 0 5px 0 var(--contorno);
}
.heroe .entradilla {
  font-size: clamp(1.1rem, 3.6vw, 1.35rem);
  font-weight: 600;
  color: var(--texto);
  max-width: 34ch;
}
.antetitulo {
  display: inline-block;
  margin: 0 0 .9rem;
  padding: .3rem .9rem;
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--oro);
  background: var(--contorno-azul);
  border-radius: 999px;
  transform: rotate(-2deg);
}

.heroe-figura { justify-self: center; position: relative; }
.heroe-figura img {
  width: min(46vw, 300px);
  filter: drop-shadow(0 10px 0 rgba(30, 22, 14, .35));
}
.heroe-figura .bocadillo {
  position: absolute;
  top: 6%;
  right: -6%;
  padding: .45rem .8rem;
  font-weight: 700;
  color: var(--texto);
  background: var(--crema);
  border: 3px solid var(--contorno);
  border-radius: 16px;
  box-shadow: 0 4px 0 var(--contorno);
  transform: rotate(6deg);
}

/* ---------- Botones de juguete ---------- */

.botones { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: 1.4rem; }

.boton {
  --b1: var(--amarillo);
  --b2: var(--naranja);
  --labio: var(--labio-amarillo);
  --tinta: var(--texto);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  min-height: 56px;
  padding: .7rem 1.5rem .8rem;
  font-family: inherit;
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.1;
  letter-spacing: .02em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--tinta);
  background: linear-gradient(var(--b1), var(--b2));
  border: 3px solid var(--contorno);
  border-radius: 18px;
  box-shadow:
    inset 0 -6px 0 var(--labio),
    inset 0 3px 0 rgba(255, 255, 255, .55),
    0 5px 0 var(--contorno);
  transition: transform 120ms ease-out, box-shadow 120ms ease-out, filter 120ms ease-out;
  cursor: pointer;
}
.boton::before {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  top: 6px;
  height: 30%;
  border-radius: 12px 12px 30px 30px;
  background: rgba(255, 255, 255, .28);
  pointer-events: none;
}
.boton:hover { color: var(--tinta); filter: brightness(1.06); transform: translateY(-2px); }
.boton:active {
  transform: translateY(4px);
  box-shadow: inset 0 -3px 0 var(--labio), inset 0 3px 0 rgba(255, 255, 255, .45), 0 1px 0 var(--contorno);
}
.boton--verde { --b1: var(--verde); --b2: var(--verde-oscuro); --labio: var(--labio-verde); --tinta: #fff; }
.boton--azul { --b1: #6CB0FF; --b2: var(--azul); --labio: var(--labio-azul); --tinta: #fff; }
.boton--verde, .boton--azul { text-shadow: 0 2px 0 rgba(20, 33, 61, .55); }

@media (max-width: 420px) {
  .boton { padding: .65rem 1.1rem .75rem; font-size: 1.05rem; }
  .botones { gap: .7rem; }
}

@media (prefers-reduced-motion: reduce) {
  .boton, .idioma { transition: none; }
  .boton:hover { transform: none; }
}

/* Insignias propias de tienda (sin logos oficiales). */
.tiendas { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.4rem 0 0; padding: 0; list-style: none; }
.insignia {
  display: flex;
  align-items: center;
  gap: .7rem;
  min-width: 210px;
  min-height: 60px;
  padding: .5rem 1.1rem .55rem .8rem;
  color: #fff;
  background: var(--contorno-azul);
  border: 3px solid var(--contorno);
  border-radius: 16px;
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .35), 0 5px 0 var(--contorno);
}
.insignia svg { flex: none; width: 30px; height: 30px; }
.insignia small {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--oro);
}
.insignia strong { display: block; font-size: 1.25rem; line-height: 1.1; }

/* ---------- Secciones y tarjetas ---------- */

.seccion { padding: 3rem 0; }
.seccion--crema { background: var(--crema); color: var(--texto); border-top: 5px solid var(--contorno); border-bottom: 5px solid var(--contorno); }
.seccion--crema a { color: #A0480A; }
.seccion--crema a:hover { color: var(--texto); }
.seccion-titulo { display: flex; align-items: center; gap: .6rem; }
.seccion-titulo::before {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: var(--amarillo);
  border: 3px solid var(--contorno);
  transform: rotate(45deg);
}

.tarjeta {
  background: var(--crema);
  color: var(--texto);
  border: 3px solid var(--contorno);
  border-radius: var(--radio);
  box-shadow: var(--sombra-labio);
  padding: 1.3rem;
}
.tarjeta a:not(.boton) { color: #A0480A; }
.tarjeta a:not(.boton):hover { color: var(--texto); }

.rejilla { display: grid; gap: 1.4rem; }
@media (min-width: 720px) {
  .rejilla--2 { grid-template-columns: repeat(2, 1fr); }
  .rejilla--3 { grid-template-columns: repeat(3, 1fr); }
}

/* Tarjeta de juego */
.juego {
  display: grid;
  gap: 1rem;
  padding: 0;
  overflow: hidden;
}
.juego-portada { border-bottom: 3px solid var(--contorno); aspect-ratio: 1024 / 500; object-fit: cover; width: 100%; }
.juego-cuerpo { padding: 0 1.3rem 1.4rem; display: grid; gap: .3rem; }
.juego-cuerpo .boton { justify-self: start; margin-top: .6rem; }
.juego-cabeza { display: flex; align-items: center; gap: .9rem; }
.icono-app {
  width: 72px;
  height: 72px;
  border-radius: 22%;
  border: 3px solid var(--contorno);
  box-shadow: 0 4px 0 var(--contorno);
}
.juego h3 { margin: 0; font-size: 1.45rem; }
.etiqueta {
  display: inline-block;
  padding: .15rem .65rem;
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--texto);
  background: var(--oro);
  border: 2px solid var(--contorno);
  border-radius: 999px;
}
.etiqueta--verde { background: #A8E8A0; }

.juego--secreto {
  display: grid;
  place-content: center;
  text-align: center;
  min-height: 260px;
  padding: 1.5rem;
  color: var(--texto-claro);
  background: repeating-linear-gradient(-45deg, var(--navy) 0 18px, var(--navy-claro) 18px 36px);
  border-style: dashed;
}
.juego--secreto img { width: 84px; margin: 0 auto .8rem; opacity: .9; }
.juego--secreto h3 { color: var(--oro); }

/* Contacto */
.correo {
  display: inline-block;
  font-weight: 700;
  font-size: 1.15rem;
  overflow-wrap: anywhere;
}

/* ---------- Página del juego ---------- */

.ficha-cabeza { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.ficha-cabeza .icono-app { width: 88px; height: 88px; }
.titular {
  font-size: clamp(1.25rem, 4vw, 1.6rem);
  font-weight: 700;
  color: var(--texto);
  margin-bottom: .6rem;
}
.portada {
  border: 4px solid var(--contorno);
  border-radius: var(--radio);
  box-shadow: 0 8px 0 var(--contorno);
  transform: rotate(1.5deg);
  width: 100%;
}

.capturas {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(68vw, 250px);
  gap: 1rem;
  margin: 0;
  padding: .4rem 1rem 1.6rem;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 1rem;
  overscroll-behavior-x: contain;
}
.capturas li { scroll-snap-align: start; }
.capturas figure { margin: 0; }
.capturas img {
  width: 100%;
  aspect-ratio: 540 / 735;
  border: 3px solid var(--contorno);
  border-radius: 20px;
  box-shadow: 0 6px 0 var(--contorno);
  background: var(--navy);
}
.capturas figcaption {
  margin-top: .8rem;
  font-weight: 700;
  font-size: 1.1rem;
  text-align: center;
  color: var(--oro);
}
@media (min-width: 1000px) {
  .capturas {
    grid-auto-flow: row;
    grid-template-columns: repeat(5, 1fr);
    overflow: visible;
    max-width: var(--ancho);
    margin: 0 auto;
  }
  .capturas li:nth-child(odd) { transform: rotate(-1.5deg); }
  .capturas li:nth-child(even) { transform: rotate(1.5deg) translateY(10px); }
}

.lista-puntos { margin: 0 0 1em; padding-left: 0; list-style: none; }
.lista-puntos li { position: relative; padding-left: 1.7rem; margin-bottom: .45rem; }
.lista-puntos li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .45em;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--amarillo);
  border: 2px solid var(--contorno);
  transform: rotate(45deg);
}

.datos { display: grid; gap: .2rem 1rem; margin: 0; }
.datos dt { font-weight: 700; }
.datos dd { margin: 0 0 .6rem; color: var(--texto-suave); }
@media (min-width: 560px) {
  .datos { grid-template-columns: max-content 1fr; }
  .datos dd { margin: 0; }
}

/* ---------- Textos largos (privacidad, legal) ---------- */

.documento {
  max-width: 820px;
  margin: 2rem auto 3rem;
  padding: 1.6rem 1.3rem 2rem;
}
@media (min-width: 720px) { .documento { padding: 2.4rem 3rem 3rem; } }
.documento h1 { font-size: clamp(1.9rem, 6vw, 2.8rem); color: var(--texto); }
.documento h2 {
  font-size: 1.35rem;
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 3px dashed var(--crema-borde);
}
.documento h3 { font-size: 1.1rem; margin-top: 1.3rem; }
.documento ul { padding-left: 1.3rem; }
.documento li { margin-bottom: .4rem; }
.documento .vigencia { color: var(--texto-suave); font-weight: 600; }
.documento .resumen {
  padding: 1rem 1.2rem;
  background: #FFE9B8;
  border: 3px solid var(--contorno);
  border-radius: 16px;
}
.documento .resumen ul { margin: 0; }
.documento a { overflow-wrap: anywhere; }

/* ---------- Preguntas frecuentes ---------- */

.faq { display: grid; gap: 1rem; }
.faq details {
  background: var(--crema);
  color: var(--texto);
  border: 3px solid var(--contorno);
  border-radius: 18px;
  box-shadow: 0 5px 0 var(--contorno);
  overflow: hidden;
}
.faq summary {
  display: flex;
  align-items: center;
  gap: .8rem;
  min-height: 64px;
  padding: .8rem 1rem;
  font-weight: 700;
  font-size: 1.15rem;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  flex: none;
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--texto);
  background: linear-gradient(var(--amarillo), var(--naranja));
  border: 3px solid var(--contorno);
  border-radius: 12px;
  box-shadow: inset 0 -3px 0 var(--labio-amarillo);
  transition: transform 160ms ease-out;
}
.faq details[open] summary::after { content: "–"; }
.faq details[open] summary { border-bottom: 3px dashed var(--crema-borde); }
.faq .respuesta { padding: 1rem 1.1rem .4rem; }
.faq .respuesta ul, .faq .respuesta ol { padding-left: 1.3rem; }
.faq .respuesta li { margin-bottom: .4rem; }
.faq a { color: #A0480A; overflow-wrap: anywhere; }
.faq-juego { font-size: .85rem; }

/* ---------- 404 ---------- */

.error {
  text-align: center;
  padding: 3rem 0 4rem;
}
.error img { width: 150px; margin: 0 auto 1rem; transform: rotate(-12deg); }
.error .grande { font-size: clamp(4.5rem, 22vw, 8rem); line-height: 1; margin-bottom: .2em; }
.error .botones { justify-content: center; }
.error p { color: var(--texto-claro); }

/* ---------- Pie ---------- */

.pie {
  margin-top: auto;
  background: var(--navy);
  border-top: 4px solid var(--contorno-azul);
  color: #C8CFDC;
  font-size: .95rem;
}
.pie .envoltura { display: grid; gap: 1.2rem; padding-top: 2rem; padding-bottom: 2rem; }
@media (min-width: 760px) { .pie .envoltura { grid-template-columns: 1.2fr 1fr 1fr; } }
.pie img { width: 170px; }
.pie h2 {
  font-size: .95rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--oro);
  margin-bottom: .6rem;
}
.pie ul { list-style: none; margin: 0; padding: 0; }
.pie li a { display: inline-block; padding: .3rem 0; color: #E6EAF2; text-decoration: none; }
.pie li a:hover { color: var(--oro); text-decoration: underline; }
.sello {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-top: .8rem;
  padding: .3rem .8rem;
  font-weight: 600;
  font-size: .85rem;
  color: var(--texto);
  background: #A8E8A0;
  border: 2px solid var(--contorno);
  border-radius: 999px;
}
.pie .copy { grid-column: 1 / -1; margin: 0; padding-top: 1rem; border-top: 2px solid var(--navy-claro); color: #9AA4B6; }

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