/* Portada «teclado de juguete»: fondo amarillo, tinta añil y teclas gruesas con sombra dura. */

@font-face {
  font-family: "Baloo 2";
  font-weight: 800;
  font-display: swap;
  src: url("/fonts/baloo-2-latin-800-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Nunito";
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/nunito-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Nunito";
  font-weight: 800;
  font-display: swap;
  src: url("/fonts/nunito-latin-800-normal.woff2") format("woff2");
}

:root {
  --sun: #ffd23f;
  --sun-soft: #ffe58a;
  --ink: #1e1b3a;
  --tomato: #ff6b4a;
  --white: #ffffff;
  --display: "Baloo 2", "Trebuchet MS", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--sun);
  color: var(--ink);
  font-family: "Nunito", "Trebuchet MS", system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.125rem;
  line-height: 1.4;
}

a { color: inherit; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1; }
h2 { font-size: clamp(2rem, 5vw, 3.25rem); }
h3 { font-size: 1.6rem; line-height: 1.05; }

:focus-visible { outline: 4px solid var(--tomato); outline-offset: 3px; }

.wrap { max-width: 1120px; margin: 0 auto; padding-inline: 24px; }

/* Cabecera */

.top {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 24px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 1;
  text-decoration: none;
}

.brand-key {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--tomato);
  border: 3px solid var(--ink);
  border-radius: 12px;
  box-shadow: 0 4px 0 var(--ink);
  font-size: 1.6rem;
}

.top nav { display: flex; flex-wrap: wrap; gap: 12px; }

.pill {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 20px;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 999px;
  font-weight: 800;
  font-size: 1.05rem;
  text-decoration: none;
}
.pill:hover { background: var(--ink); color: var(--white); }

/* Inicio */

.hero {
  max-width: 1120px;
  margin: 0 auto;
  padding: 72px 24px 88px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  text-align: center;
}

.hero h1 { font-size: clamp(2.6rem, 8vw, 5.5rem); line-height: 0.98; letter-spacing: -0.01em; }
.lead { max-width: 620px; font-size: clamp(1.15rem, 2.4vw, 1.45rem); }
.hint { font-size: 1.05rem; }

.home-row {
  width: 100%;
  max-width: 760px;
  margin-top: 12px;
  display: flex;
  justify-content: center;
  gap: clamp(6px, 1.6vw, 14px);
}

.key {
  position: relative;
  flex: 1 1 0;
  max-width: 76px;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: 0 6px 0 var(--ink);
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.1rem, 4.4vw, 2.2rem);
  line-height: 1;
}

.key.bump { background: var(--tomato); }
.key.bump::after {
  content: "";
  position: absolute;
  left: 32%;
  right: 32%;
  bottom: 12%;
  height: 4px;
  border-radius: 2px;
  background: var(--ink);
}

.home-row .gap { flex: 0.6 1 0; max-width: 40px; }

.cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 60px;
  margin-top: 8px;
  padding: 0 32px;
  background: var(--ink);
  color: var(--white);
  border-radius: 18px;
  box-shadow: 0 6px 0 var(--tomato);
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.5rem;
  text-decoration: none;
  transition: transform 0.1s, box-shadow 0.1s;
}
.cta:hover { transform: translateY(3px); box-shadow: 0 3px 0 var(--tomato); }

/* Secciones */

.section { padding-block: 80px 8px; display: flex; flex-direction: column; gap: 32px; }
.section:last-child { padding-bottom: 72px; }

.heading { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.heading p { max-width: 640px; font-size: 1.2rem; }
.heading-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }

.soon {
  padding: 6px 16px;
  background: var(--ink);
  color: var(--white);
  border-radius: 999px;
  font-weight: 800;
  font-size: 1rem;
}

/* Juegos */

.games-band { background: var(--ink); color: var(--white); padding: 80px 0 96px; }
.games-band .wrap { display: flex; flex-direction: column; gap: 40px; }
.games-band .heading p { color: var(--sun); }

.games { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 32px; }
.games li { flex: 1 1 340px; min-width: 0; display: flex; }

.game {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--white);
  color: var(--ink);
  border: 4px solid var(--sun);
  border-radius: 24px;
  box-shadow: 0 10px 0 var(--tomato);
  text-decoration: none;
  transition: transform 0.12s, box-shadow 0.12s;
}
.game:hover { transform: translateY(-4px); box-shadow: 0 14px 0 var(--tomato); }

.game img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }

.game-body { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 24px 28px 28px; }
.game-body h3 { font-size: 2.4rem; line-height: 1; }
.game-body p { font-size: 1.15rem; }

.tag { padding: 4px 14px; background: var(--sun); border-radius: 999px; font-weight: 800; font-size: 0.95rem; }

.play {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  margin-top: 8px;
  padding: 0 26px;
  background: var(--tomato);
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow: 0 5px 0 var(--ink);
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.35rem;
}

/* Tarjetas de lecciones y consejos */

.cards { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 24px; }

.card {
  flex: 1 1 260px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 20px;
  box-shadow: 0 6px 0 var(--ink);
}
.card p { font-size: 1.1rem; }

.card.upcoming { background: var(--sun-soft); border-style: dashed; box-shadow: none; }

.step,
.mini-keys span {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--ink);
  box-shadow: 0 4px 0 var(--ink);
  font-family: var(--display);
  font-weight: 800;
  line-height: 1;
}

.step { width: 52px; height: 52px; background: var(--sun); border-radius: 12px; font-size: 1.8rem; }

.mini-keys { display: flex; gap: 8px; margin-bottom: 4px; }
.mini-keys span { width: 44px; height: 44px; background: var(--white); border-radius: 10px; font-size: 1.4rem; }

/* Página de un juego: el juego va en un marco, con la cabecera de la web y huecos de publicidad */

.play-area {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  align-items: start;
  gap: 24px;
  margin-top: 24px;
  padding: 20px 24px 32px;
  background: var(--ink);
  color: var(--white);
}

.play-column { width: 100%; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 16px; }

/* El marco es 16:9 y nunca más alto que la ventana, para que el juego se vea entero sin desplazar. */
.play-bar,
.stage { width: min(100%, max(560px, calc((100vh - 230px) * 16 / 9))); }

.play-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.play-bar h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); }

.bar-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  background: var(--white);
  color: var(--ink);
  border: 3px solid var(--sun);
  border-radius: 999px;
  font: inherit;
  font-weight: 800;
  font-size: 1.05rem;
  text-decoration: none;
  cursor: pointer;
}
.bar-button:hover { background: var(--sun); }
.bar-button[hidden] { display: none; }

.stage {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
  border: 4px solid var(--sun);
  border-radius: 20px;
}
.stage:fullscreen { width: 100%; height: 100%; aspect-ratio: auto; border: 0; border-radius: 0; }
.stage iframe { display: block; width: 100%; height: 100%; border: 0; }

.more .games li { max-width: 540px; }
.more .game { border-color: var(--ink); }

/* Publicidad: los huecos no existen hasta que slots.js pone la clase slots-on */

.slot { display: none; }
.slots-on .slot { display: flex; flex-direction: column; align-items: center; gap: 6px; max-width: 100%; }
.slots-on .slot.band { margin: 0 auto; padding: 8px 24px 0; }
.slots-on main > .slot.band { padding-top: 56px; }
.slots-on .slot.rail { display: none; }

.slot-label { font-size: 0.8rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.75; }
.slot-box { max-width: 100%; overflow: hidden; }
.slots-demo .slot-box {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border: 3px dashed currentColor;
  border-radius: 12px;
  font-size: 0.95rem;
  text-align: center;
}

@media (min-width: 1360px) {
  .slots-on .play-area { grid-template-columns: 160px minmax(0, 1fr) 160px; }
  .slots-on .slot.rail { display: flex; position: sticky; top: 16px; }
}

/* Pie */

footer { border-top: 3px solid var(--ink); padding: 28px 0 36px; font-size: 1rem; }
footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cta, .game { transition: none; }
}
