@font-face {
  font-family: "Baloo 2";
  src: url("../fonts/Baloo2.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: "Fredoka";
  src: url("../fonts/Fredoka.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --bosque: #1e4d3b;
  --bosque-claro: #2e7d5b;
  --crema: #fdf6e9;
  --tinta: #2b2b26;
  --amarillo: #f6b93b;
  --radio: 22px;
}

* { box-sizing: border-box; }
/* .btn { display } would otherwise paint controls that the page set to hidden. */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Fredoka", system-ui, sans-serif;
  background: var(--crema);
  color: var(--tinta);
  font-size: 1.125rem;
  line-height: 1.55;
}
h1, h2, h3, .oso-nombre {
  font-family: "Baloo 2", "Fredoka", sans-serif;
  font-weight: 800;
  line-height: 1.1;
  margin: 0 0 .4em;
}
img { max-width: 100%; }
a { color: var(--bosque-claro); }

/* ---------- header / nav ---------- */
header {
  background: var(--bosque);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 3px 14px rgba(0,0,0,.18);
}
.nav {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .6rem 1rem;
  flex-wrap: wrap;
}
.logo {
  font-family: "Baloo 2", sans-serif;
  font-weight: 800;
  font-size: 1.7rem;
  color: #fff;
  text-decoration: none;
  letter-spacing: .5px;
}
.logo span { color: var(--amarillo); }
.nav nav { display: flex; gap: .4rem; flex-wrap: wrap; margin-left: auto; }
.nav nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: .55rem 1rem;
  border-radius: 999px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.nav nav a:hover, .nav nav a.activo { background: var(--bosque-claro); }

/* ---------- layout ---------- */
main { max-width: 1120px; margin: 0 auto; padding: 1.2rem 1rem 3rem; }
.hero {
  border-radius: var(--radio);
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 30px rgba(30,77,59,.15);
  margin-bottom: 2rem;
}
.hero img { display: block; width: 100%; }
.hero-texto { padding: 1.4rem 1.6rem 1.8rem; text-align: center; }
.hero-texto h1 { font-size: clamp(2rem, 6vw, 3.4rem); color: var(--bosque); }
.hero-texto p { font-size: 1.25rem; max-width: 42ch; margin: .4rem auto 1.2rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px;
  padding: .7rem 1.6rem;
  border-radius: 999px;
  border: none;
  background: var(--amarillo);
  color: #4a2f00;
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 0 #d99a1f;
  transition: transform .08s ease;
  margin: .25rem;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #d99a1f; }
.btn.verde { background: var(--bosque-claro); color: #fff; box-shadow: 0 4px 0 #1e5c40; }
.btn.verde:active { box-shadow: 0 1px 0 #1e5c40; }
.btn.grande { font-size: 1.35rem; padding: 1rem 2.2rem; }

/* ---------- tarjetas de osos ---------- */
.rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.2rem; }
.tarjeta {
  background: #fff;
  border-radius: var(--radio);
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(30,77,59,.12);
  border-top: 10px solid var(--color, var(--bosque-claro));
  display: flex; flex-direction: column;
}
.tarjeta img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.tarjeta .cuerpo { padding: 1rem 1.1rem 1.3rem; }
.oso-nombre { font-size: 1.6rem; color: var(--color, var(--bosque)); margin-bottom: .1em; }
.especie { font-weight: 600; text-transform: uppercase; font-size: .82rem; letter-spacing: .06em; opacity: .75; margin: 0 0 .5rem; }
.dato { background: var(--crema); border-radius: 12px; padding: .55rem .8rem; font-weight: 600; }

/* ---------- juegos ---------- */
.juego-tarjeta {
  background: #fff; border-radius: var(--radio); padding: 1.6rem;
  box-shadow: 0 6px 20px rgba(30,77,59,.12);
  text-align: center;
}
.juego-tarjeta h3 { font-size: 1.7rem; color: var(--bosque); }

.tablero {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: .7rem; max-width: 560px; margin: 1.2rem auto;
}
.carta { aspect-ratio: 1; perspective: 600px; cursor: pointer; border: none; background: none; padding: 0; }
.carta .dentro {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d; transition: transform .45s;
}
.carta.volteada .dentro, .carta.encontrada .dentro { transform: rotateY(180deg); }
.cara {
  position: absolute; inset: 0; backface-visibility: hidden;
  border-radius: 16px; display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.cara.reverso {
  background: var(--bosque);
  flex-direction: column;
  color: var(--amarillo);
  font-family: "Baloo 2", sans-serif; font-weight: 800;
  font-size: clamp(.68rem, 3vw, 1.1rem);
  line-height: 1.05;
  text-align: center;
  padding: 4px;
  border: 4px solid var(--bosque-claro);
}
.cara.frente { background: #fff; transform: rotateY(180deg); border: 4px solid var(--amarillo); }
.cara.frente img { width: 100%; height: 100%; object-fit: cover; }
.carta.encontrada { cursor: default; }
.carta.encontrada .cara.frente { border-color: var(--bosque-claro); }

input[type="text"], select {
  font-family: "Fredoka", sans-serif; font-size: 1.15rem;
  padding: .7rem 1rem; border-radius: 14px;
  border: 3px solid var(--bosque-claro);
  min-height: 52px; width: 100%;
  background: #fff;
}
label { font-weight: 600; display: block; margin: .8rem 0 .3rem; text-align: left; }
.formulario { max-width: 520px; margin: 0 auto; text-align: left; }
.tarjeta-oso-nuevo {
  margin: 1.6rem auto 0; max-width: 520px;
  background: #fff; border: 4px dashed var(--amarillo);
  border-radius: var(--radio); padding: 1.6rem; text-align: center;
}
.tarjeta-oso-nuevo .nombre-inventado {
  font-family: "Baloo 2", sans-serif; font-weight: 800;
  font-size: clamp(1.8rem, 6vw, 2.6rem); color: var(--bosque);
  word-break: break-word;
}

.opciones-quiz { display: grid; gap: .7rem; max-width: 560px; margin: 1rem auto; }
.misterio {
  background: var(--bosque);
  color: var(--amarillo);
  font-family: "Baloo 2", sans-serif; font-weight: 800;
  font-size: 6rem;
  border-radius: 18px;
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  border: 5px dashed var(--amarillo);
}
.opcion {
  min-height: 56px; border-radius: 16px; border: 3px solid var(--bosque-claro);
  background: #fff; font-family: "Fredoka", sans-serif; font-weight: 600;
  font-size: 1.2rem; cursor: pointer; padding: .6rem 1rem;
}
.opcion:hover { background: var(--crema); }
.opcion.bien { background: #d9f2e2; border-color: var(--bosque-claro); }
.opcion.mal { background: #fde3e3; border-color: #c0392b; }
.progreso { font-weight: 700; color: var(--bosque); }

/* ---------- secciones ---------- */
section { margin: 2.4rem 0; }
.seccion-titulo { font-size: clamp(1.7rem, 4.5vw, 2.4rem); color: var(--bosque); text-align: center; }
.seccion-sub { text-align: center; max-width: 60ch; margin: 0 auto 1.4rem; }
.dos-columnas { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem; align-items: center; }
@media (max-width: 720px) { .dos-columnas { grid-template-columns: 1fr; } }
.caja {
  background: #fff; border-radius: var(--radio); padding: 1.5rem 1.7rem;
  box-shadow: 0 6px 20px rgba(30,77,59,.1);
}
.libro-imgs { display: flex; gap: 1rem; justify-content: center; }
.libro-imgs img { width: 46%; border-radius: 14px; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.aviso {
  background: #fff3d6; border: 2px solid var(--amarillo);
  border-radius: 14px; padding: .9rem 1.2rem; font-weight: 600;
}

footer {
  background: var(--bosque); color: #eaf4ee; margin-top: 3rem;
}
footer .pie {
  max-width: 1120px; margin: 0 auto; padding: 1.6rem 1rem;
  display: flex; gap: 1rem; flex-wrap: wrap; justify-content: space-between;
  font-size: .95rem;
}
footer a { color: var(--amarillo); }

@media print {
  header, footer, .no-imprimir { display: none !important; }
  body { background: #fff; }
}
