/* Los colores y la fuente del juego (core/ui/ui_theme.gd). */
@font-face {
  font-family: "Fredoka";
  src: url("/fredoka.ttf") format("truetype");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --noche: #2B3A67;
  --noche-oscura: #1E2A4D;
  --crema: #FFF6E0;
  --papel: #FDF1D6;
  --choco: #5B3A29;
  --texto: #3B2A20;
  --amarillo: #FFD166;
  --rojo: #EF476F;
  --menta: #06D6A0;
  --cielo: #4CC9F0;
  --ancho: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.5;
  color: var(--crema);
  background: var(--noche);
}

a { color: var(--amarillo); }
code { font-size: 0.85em; background: rgba(91, 58, 41, 0.12); padding: 0 4px; border-radius: 4px; word-break: break-all; }
.oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.boton {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  color: var(--texto);
  background: var(--amarillo);
  border: 4px solid var(--choco);
  border-radius: 18px;
  padding: 10px 24px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--choco);
  transition: transform 0.08s, box-shadow 0.08s;
}
.boton:hover { background: #FFDB85; }
.boton:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--choco); }
.boton:focus-visible { outline: 4px solid var(--rojo); outline-offset: 2px; }
.boton.grande { font-size: 1.3rem; padding: 14px 32px; }

/* ---------- ingreso ---------- */
body.entrar {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
  background: var(--noche) url("/fondo.webp") center / cover no-repeat;
}
.tarjeta-entrar {
  width: min(440px, 100%);
  text-align: center;
  color: var(--texto);
  background: var(--papel);
  border: 6px solid #B07A4F;
  border-radius: 24px;
  padding: 32px 28px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
.icono-entrar { border-radius: 22px; }
.tarjeta-entrar h1 { margin: 12px 0 4px; font-size: 1.9rem; color: var(--choco); }
.tarjeta-entrar form { display: grid; gap: 14px; margin-top: 18px; }
.tarjeta-entrar input {
  font: inherit;
  font-size: 1.2rem;
  text-align: center;
  padding: 12px;
  border: 3px solid var(--choco);
  border-radius: 14px;
  background: #fff;
  color: var(--texto);
}
.tarjeta-entrar input:focus { outline: 4px solid var(--amarillo); }
.error { color: #B3123A; font-weight: 600; margin-bottom: 0; }

/* ---------- barra ---------- */
.barra {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(30, 42, 77, 0.92);
  backdrop-filter: blur(6px);
}
.marca { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--crema); text-decoration: none; white-space: nowrap; }
.marca img { border-radius: 8px; }
.barra nav { display: flex; align-items: center; gap: 18px; }
.barra nav a { color: var(--crema); text-decoration: none; }
.barra nav a:hover { color: var(--amarillo); }
.barra form { margin: 0; }
.enlace { font: inherit; color: rgba(255, 246, 224, 0.7); background: none; border: 0; cursor: pointer; padding: 0; }
.enlace:hover { color: var(--amarillo); }

/* ---------- portada ---------- */
.portada { position: relative; max-width: 1600px; margin: 0 auto; }
.portada img { display: block; width: 100%; height: auto; }
.portada-texto {
  position: absolute;
  inset: auto 0 0 0;
  padding: 80px 16px 28px;
  text-align: center;
  background: linear-gradient(to bottom, transparent, rgba(30, 42, 77, 0.95));
}
.bajada { font-size: 1.4rem; font-weight: 600; margin: 0 0 14px; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6); }
.chico { font-size: 0.9rem; opacity: 0.8; margin: 10px 0 0; }

/* ---------- secciones ---------- */
main { max-width: var(--ancho); margin: 0 auto; padding: 0 16px; }
.seccion { padding: 48px 0 8px; }
.seccion h2 { font-size: 2rem; color: var(--amarillo); margin: 0 0 6px; }
.intro { font-size: 1.1rem; max-width: 760px; margin: 0 0 20px; }

.galeria { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.galeria figure {
  margin: 0;
  background: var(--papel);
  color: var(--texto);
  border: 4px solid #B07A4F;
  border-radius: 18px;
  overflow: hidden;
}
.galeria img { display: block; width: 100%; height: auto; aspect-ratio: 40 / 21; object-fit: cover; }
.galeria a { display: block; }
.galeria figcaption { padding: 10px 14px 14px; font-size: 0.95rem; }
.galeria figcaption strong { display: block; color: var(--choco); font-size: 1.05rem; }

/* ---------- descargas ---------- */
.descargas { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.descarga {
  background: var(--papel);
  color: var(--texto);
  border: 4px solid #B07A4F;
  border-radius: 18px;
  padding: 18px 20px;
}
.descarga.sugerida { border-color: var(--menta); box-shadow: 0 0 0 4px rgba(6, 214, 160, 0.35); }
.descarga.sugerida h3::after { content: " · la tuya"; color: #048A68; font-size: 0.9rem; }
.descarga h3 { margin: 0 0 12px; color: var(--choco); }
.descarga p { font-size: 0.92rem; }
.descarga details { font-size: 0.85rem; }
.hash code { font-size: 0.78rem; }
.etiqueta { background: var(--rojo); color: #fff; border-radius: 8px; padding: 0 8px; font-size: 0.85rem; }
.anteriores { margin-top: 20px; }
.anteriores summary, .descarga summary { cursor: pointer; }

/* ---------- novedades ---------- */
.nota {
  background: rgba(255, 246, 224, 0.06);
  border-left: 6px solid var(--amarillo);
  border-radius: 12px;
  padding: 6px 22px 10px;
  margin-bottom: 18px;
}
.nota h3 { color: var(--amarillo); margin: 12px 0 6px; }
.fecha { color: var(--crema); opacity: 0.6; font-size: 0.9rem; font-weight: 400; margin-left: 8px; }
.nota li { margin-bottom: 6px; }
.nota strong { color: var(--amarillo); }
.nota code { background: rgba(255, 246, 224, 0.12); }

footer { text-align: center; padding: 48px 16px 32px; opacity: 0.6; font-size: 0.9rem; }

/* ---------- visor ---------- */
dialog#visor { padding: 0; border: 0; background: transparent; max-width: 96vw; max-height: 96vh; }
dialog#visor::backdrop { background: rgba(10, 14, 30, 0.88); }
dialog#visor img { display: block; max-width: 96vw; max-height: 92vh; border-radius: 12px; }
dialog#visor .cerrar {
  position: absolute; top: 8px; right: 8px; width: 44px; height: 44px;
  font-size: 28px; line-height: 1; border-radius: 50%; border: 3px solid var(--choco);
  background: var(--amarillo); color: var(--texto); cursor: pointer;
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .barra nav a { display: none; }
  .portada-texto { position: static; padding: 18px 16px 8px; background: var(--noche-oscura); }
  .bajada { font-size: 1.15rem; }
  .galeria { grid-template-columns: 1fr; }
  .seccion h2 { font-size: 1.6rem; }
}
