/* ======================================================================
   ESTILOS DE LA WEB
   ----------------------------------------------------------------------
   No hace falta tocar este archivo. Los colores generales están justo
   aquí debajo, por si algún día quieres retocarlos.
   ====================================================================== */

:root {
  --texto: #eef2f7;
  --texto-suave: #b8c4d3;
  --acento: #e8c68e;                     /* dorado galleta: fechas y enlaces */
  --borde: rgba(214, 228, 245, 0.2);
  --ventana-arriba: rgba(38, 54, 80, 0.8);
  --ventana-abajo: rgba(15, 22, 35, 0.86);
  --sombra: 0 16px 36px rgba(6, 10, 18, 0.32);
  --radio: 10px;
  --ancho: 1200px;
  --ancho-texto: 780px;
  --fuente-titulos: "Cinzel", "Trajan Pro", Georgia, serif;
  --fuente-texto: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}

/* ---------- Tipografías (incluidas en la propia web) ---------- */

@font-face { font-family: "Cinzel"; font-weight: 600; font-display: swap; src: url("fuentes/cinzel-600.woff2") format("woff2"); }
@font-face { font-family: "Cinzel"; font-weight: 700; font-display: swap; src: url("fuentes/cinzel-700.woff2") format("woff2"); }
@font-face { font-family: "Alegreya Sans"; font-weight: 400; font-display: swap; src: url("fuentes/alegreya-sans-400.woff2") format("woff2"); }
@font-face { font-family: "Alegreya Sans"; font-weight: 400; font-style: italic; font-display: swap; src: url("fuentes/alegreya-sans-400-cursiva.woff2") format("woff2"); }
@font-face { font-family: "Alegreya Sans"; font-weight: 700; font-display: swap; src: url("fuentes/alegreya-sans-700.woff2") format("woff2"); }

/* ---------- Base ---------- */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--fuente-texto);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--texto);
  background: #2a3442;
  -webkit-font-smoothing: antialiased;
}

.fondo {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(165deg, #1e2631 0%, #34404f 45%, #5a6a7e 100%);
}

img { max-width: 100%; }

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--acento);
  outline-offset: 3px;
}

.saltar {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 10;
  padding: 8px 14px;
  border-radius: 6px;
  background: #0f1622;
  color: var(--texto);
}
.saltar:focus { top: 12px; }

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

.cabecera {
  padding: 0 16px;
  text-align: center;
}

.cabecera__franja {
  max-width: var(--ancho);
  margin: 0 auto;
  padding: clamp(20px, 5vw, 44px) 16px clamp(8px, 2vw, 16px);
}

/* Iconos de redes sociales, arriba a la izquierda */
.redes {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  max-width: var(--ancho);
  margin: 0 auto;
  padding: 16px 0 0;
}
.redes:empty { display: none; }

.red {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: var(--texto-suave);
  background: rgba(14, 20, 30, 0.45);
  border: 1px solid var(--borde);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.red svg { width: 20px; height: 20px; display: block; }
.red:hover,
.red:focus-visible {
  color: var(--acento);
  background: rgba(232, 198, 142, 0.14);
  border-color: rgba(232, 198, 142, 0.65);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}
.red--vacia { opacity: 0.4; }

.cabecera__franja--con-fondo {
  margin-top: 16px;
  padding-bottom: clamp(32px, 6vw, 60px);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
}

.cabecera__titulo {
  margin: 0;
  font-family: var(--fuente-titulos);
  font-weight: 700;
  font-size: clamp(2.6rem, 8.5vw, 5.6rem);
  line-height: 1;
  letter-spacing: 0.035em;
}

.cabecera__titulo a {
  display: inline-block;
  color: inherit;
  text-decoration: none;
}

/* El nombre con acabado plateado, como los logos de Final Fantasy */
.cabecera__nombre {
  background: linear-gradient(180deg, #ffffff 0%, #e6edf7 40%, #a9bdd5 56%, #dfe8f4 78%, #ffffff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 rgba(8, 13, 22, 0.5)) drop-shadow(0 0 26px rgba(168, 204, 255, 0.3));
}

.cabecera__logo {
  display: block;
  max-height: clamp(72px, 15vw, 150px);
  width: auto;
  margin: 0 auto;
}

.cabecera__subtitulo {
  margin: 14px 0 0;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--texto-suave);
}

/* ---------- Botones del menú (proporción 5:1) ---------- */

.menu {
  --hueco: 12px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--hueco);
  max-width: var(--ancho);
  margin: clamp(22px, 4vw, 36px) auto 0;
}

.boton {
  flex: 0 0 calc((100% - 5 * var(--hueco)) / 6);
  aspect-ratio: 5 / 1;
  container-type: inline-size;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: linear-gradient(135deg, #4a5a6e, #2c3644);
  background-size: cover;
  background-position: center;
  color: #ffffff;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(6, 10, 18, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.boton__texto {
  position: relative;
  z-index: 2;
  padding: 0 6%;
  font-family: var(--fuente-titulos);
  font-weight: 600;
  font-size: clamp(11px, 8cqw, 18px);
  line-height: 1.1;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

/* Capa de cristal: un reflejo suave en la mitad superior */
.boton::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0.3) 0%,
    rgba(255, 255, 255, 0.1) 46%,
    rgba(255, 255, 255, 0) 50%,
    rgba(255, 255, 255, 0.06) 100%);
  opacity: 0.35;
  transition: opacity 0.3s ease;
}

/* Destello que cruza el botón al pasar el ratón */
.boton::after {
  content: "";
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: 0;
  z-index: 1;
  width: 40%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0));
  transform: translateX(-180%) skewX(-22deg);
  pointer-events: none;
}

.boton:hover,
.boton:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow:
    0 10px 24px rgba(6, 10, 18, 0.4),
    0 0 20px rgba(170, 205, 255, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.boton:hover::before,
.boton:focus-visible::before {
  opacity: 1;
  -webkit-backdrop-filter: blur(1.5px) saturate(1.35) brightness(1.08);
  backdrop-filter: blur(1.5px) saturate(1.35) brightness(1.08);
}

.boton:hover::after,
.boton:focus-visible::after {
  transform: translateX(350%) skewX(-22deg);
  transition: transform 0.75s ease;
}

/* El botón de la página en la que estás */
.boton--activo {
  border-color: var(--acento);
  box-shadow: 0 0 0 1px var(--acento), 0 2px 8px rgba(6, 10, 18, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

@media (max-width: 900px) {
  .boton { flex-basis: calc((100% - 2 * var(--hueco)) / 3); }
}

@media (max-width: 540px) {
  .menu { --hueco: 10px; }
  .boton { flex-basis: calc((100% - var(--hueco)) / 2); }
}

/* ---------- Contenido ---------- */

.principal {
  max-width: var(--ancho);
  margin: 0 auto;
  padding: 0 16px;
}
.principal:focus { outline: none; }

/* Ventanas: el estilo de los menús clásicos de Final Fantasy */
.ventana {
  background: linear-gradient(180deg, var(--ventana-arriba), var(--ventana-abajo));
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), var(--sombra);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

/* ---------- YouTube y Twitch ---------- */

.directos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: clamp(32px, 5vw, 52px);
}

@media (max-width: 860px) {
  .directos { grid-template-columns: 1fr; }
}

.media { padding: 14px; }
.media--youtube { --marca: #ff4e45; }
.media--twitch { --marca: #a970ff; }

.media__cabecera {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 4px 12px;
}

.media__titulo {
  margin: 0;
  font-family: var(--fuente-titulos);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}

.media__titulo::before {
  content: "";
  display: inline-block;
  width: 0.55em;
  height: 0.55em;
  margin-right: 0.55em;
  border-radius: 2px;
  background: var(--marca);
  vertical-align: 0.06em;
}

.media__enlace {
  flex-shrink: 0;
  font-size: 0.95rem;
  color: var(--acento);
  text-decoration: none;
}
.media__enlace:hover { text-decoration: underline; text-underline-offset: 3px; }

.marco {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 6px;
  background: #0b1018;
}

.marco iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.marco__aviso {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 4px;
  padding: 24px;
  text-align: center;
  color: var(--texto);
}
.marco__aviso p { margin: 0; max-width: 34ch; margin-inline: auto; }
.marco__aviso .marco__detalle { font-size: 0.9rem; color: var(--texto-suave); }

/* ---------- Publicaciones ---------- */

.publicaciones {
  max-width: var(--ancho-texto);
  margin: clamp(52px, 8vw, 84px) auto 0;
}

.seccion__titulo {
  margin: 0 0 22px;
  font-family: var(--fuente-titulos);
  font-weight: 600;
  font-size: clamp(1.5rem, 3.2vw, 2rem);
  text-align: center;
}

.publicacion {
  overflow: hidden;
  margin-bottom: 24px;
  scroll-margin-top: 20px;
}

.publicacion__imagen {
  display: block;
  width: 100%;
  height: auto;
  max-height: 440px;
  object-fit: cover;
  border-bottom: 1px solid var(--borde);
}

.publicacion__cuerpo { padding: 20px clamp(18px, 4vw, 32px) 26px; }

.publicacion__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  font-size: 0.95rem;
  color: var(--acento);
}

.etiqueta {
  padding: 0 10px;
  border: 1px solid rgba(232, 198, 142, 0.45);
  border-radius: 999px;
  font-size: 0.85rem;
  line-height: 1.6;
}

.publicacion__titulo {
  margin: 8px 0 14px;
  font-family: var(--fuente-titulos);
  font-weight: 600;
  font-size: clamp(1.3rem, 2.6vw, 1.65rem);
  line-height: 1.25;
}

.publicacion__titulo a { color: inherit; text-decoration: none; }
.publicacion__titulo a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }

.publicaciones__vacio { text-align: center; color: var(--texto-suave); }

.mas {
  display: block;
  margin: 4px auto 0;
  padding: 10px 24px;
  border: 1px solid var(--borde);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--texto);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease;
}
.mas:hover { background: rgba(255, 255, 255, 0.13); }

/* ---------- Páginas ---------- */

.pagina {
  max-width: var(--ancho-texto);
  margin: clamp(32px, 5vw, 52px) auto 0;
  padding: clamp(22px, 4vw, 40px);
  overflow: hidden;
}

.pagina__imagen {
  display: block;
  width: calc(100% + 2 * clamp(22px, 4vw, 40px));
  max-width: none;
  margin: calc(-1 * clamp(22px, 4vw, 40px)) calc(-1 * clamp(22px, 4vw, 40px)) 28px;
  max-height: 420px;
  object-fit: cover;
  border-bottom: 1px solid var(--borde);
}

.pagina__titulo {
  margin: 0 0 18px;
  font-family: var(--fuente-titulos);
  font-weight: 600;
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  line-height: 1.2;
}

/* ---------- Textos con formato ---------- */

.texto > * { margin: 0; }
.texto > * + * { margin-top: 0.9em; }

.texto a { color: var(--acento); text-underline-offset: 3px; }
.texto strong { font-weight: 700; }

.texto__subtitulo {
  font-family: var(--fuente-titulos);
  font-weight: 600;
  font-size: 1.2rem;
  line-height: 1.3;
}
.texto > * + .texto__subtitulo { margin-top: 1.6em; }

.texto ul { padding-left: 1.3em; }
.texto li + li { margin-top: 0.3em; }

.texto__imagen img { display: block; width: 100%; height: auto; border-radius: 6px; }
.texto__imagen figcaption { margin-top: 8px; font-size: 0.92rem; text-align: center; color: var(--texto-suave); }

.botonera { display: flex; flex-wrap: wrap; gap: 10px; }
.texto > * + .botonera { margin-top: 1.2em; }

.boton-texto {
  display: inline-block;
  padding: 9px 18px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  background: linear-gradient(180deg, #4b76a6, #2b4a6f);
  color: #ffffff !important;
  font-weight: 700;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transition: box-shadow 0.2s ease, filter 0.2s ease;
}
.boton-texto:hover {
  filter: brightness(1.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 0 16px rgba(170, 205, 255, 0.3);
}

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

.pie {
  padding: 56px 16px 40px;
  text-align: center;
  font-size: 0.95rem;
  color: var(--texto-suave);
}
.pie p { margin: 0; }
.pie a { color: inherit; }

/* ---------- Aviso de error en contenido.js ---------- */

.error-contenido {
  max-width: 720px;
  margin: 48px auto;
  padding: 24px 28px;
  border: 1px solid #d06a76;
  border-radius: 10px;
  background: #3b1e24;
  color: #fde9ec;
  font-family: system-ui, sans-serif;
}
.error-contenido h1 { margin: 0 0 12px; font-size: 1.4rem; }
.error-contenido p { margin: 0 0 10px; }
.error-contenido__tecnico { font-size: 0.85rem; opacity: 0.75; }

/* ---------- Zonas de la página (no afectan al diseño) ---------- */

.zona { display: contents; }

/* ---------- Vista previa dentro del editor ---------- */

.modo-editor [data-editar] {
  cursor: pointer;
  outline: 2px dashed transparent;
  outline-offset: 4px;
  transition: outline-color 0.15s ease;
}
.modo-editor [data-editar]:hover { outline-color: rgba(232, 198, 142, 0.75); }
.modo-editor .editor-seleccionado,
.modo-editor .editor-seleccionado:hover { outline: 2px solid var(--acento); }

.marco__tapa {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.editor-anadir {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed rgba(232, 198, 142, 0.55);
  border-radius: 8px;
  background: rgba(232, 198, 142, 0.06);
  color: var(--acento);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}
.editor-anadir:hover { background: rgba(232, 198, 142, 0.14); }

.editor-anadir--boton {
  flex: 0 0 calc((100% - 5 * var(--hueco)) / 6);
  aspect-ratio: 5 / 1;
  font-size: 0.9rem;
}
@media (max-width: 900px) { .editor-anadir--boton { flex-basis: calc((100% - 2 * var(--hueco)) / 3); } }
@media (max-width: 540px) { .editor-anadir--boton { flex-basis: calc((100% - var(--hueco)) / 2); } }

.editor-anadir--red {
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: 1.3rem;
  line-height: 1;
}

.editor-anadir--publicacion {
  width: 100%;
  margin-bottom: 24px;
  padding: 22px;
  font-size: 1.05rem;
}

/* ---------- Menos movimiento para quien lo prefiera ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .boton, .boton::before, .boton::after { transition: none !important; }
  .boton:hover, .boton:focus-visible { transform: none; }
  .red, .red:hover, .red:focus-visible { transition: none; transform: none; }
  .boton:hover::after, .boton:focus-visible::after { transform: translateX(-180%) skewX(-22deg); }
}

/* ---------- Minijuegos ---------- */

.minijuegos { max-width: var(--ancho); margin: 0 auto; }

.minijuegos__intro {
  max-width: var(--ancho-texto);
  margin: 0 auto 28px;
  padding: clamp(18px, 3vw, 30px);
  text-align: center;
}
.minijuegos__intro .pagina__imagen { margin-bottom: 18px; }
.minijuegos__intro--juego { max-width: none; margin-bottom: 18px; padding: 16px 22px; text-align: left; }
.minijuegos__intro--juego .pagina__titulo { margin: 6px 0 0; font-size: clamp(1.5rem, 3.4vw, 2.1rem); text-align: left; }
.minijuegos__volver { color: var(--acento); text-decoration: none; font-weight: 700; font-size: 0.95rem; }
.minijuegos__volver:hover { text-decoration: underline; }
.minijuegos__descripcion { margin: 6px 0 0; color: var(--texto-suave); }

.minijuegos__lista {
  --columnas: 3;
  display: grid;
  grid-template-columns: repeat(var(--columnas), minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}
@media (max-width: 900px) { .minijuegos__lista { grid-template-columns: repeat(min(var(--columnas), 2), minmax(0, 1fr)); } }
@media (max-width: 540px) { .minijuegos__lista { grid-template-columns: minmax(0, 1fr); } }

.mj-tarjeta {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.mj-tarjeta:hover, .mj-tarjeta:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(232, 198, 142, 0.6);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.4);
}
.mj-tarjeta__imagen { position: relative; display: block; width: 100%; overflow: hidden; background: #131a24; }
.mj-tarjeta__imagen img { display: block; width: 100%; height: 100%; object-fit: cover; transition: filter 0.3s ease; }
.mj-tarjeta__borrosa { transform: scale(1.2); }
.mj-tarjeta__vacia { position: absolute; inset: 0; display: grid; place-items: center; color: var(--texto-suave); }
.mj-tarjeta__hecho, .mj-tarjeta__oculto {
  position: absolute;
  top: 10px; left: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(14, 20, 30, 0.82);
  color: var(--acento);
  border: 1px solid rgba(232, 198, 142, 0.5);
}
.mj-tarjeta__oculto { left: auto; right: 10px; color: #f0b4b4; border-color: rgba(240, 180, 180, 0.5); }
.mj-tarjeta__cuerpo { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; }
.mj-tarjeta__titulo { font-family: var(--fuente-titulos); font-size: 1.15rem; font-weight: 700; letter-spacing: 0.02em; }
.mj-tarjeta__texto { color: var(--texto-suave); font-size: 0.95rem; }
.mj-tarjeta__datos { color: var(--texto-suave); font-size: 0.85rem; }
.mj-tarjeta__boton {
  align-self: flex-start;
  margin-top: 6px;
  padding: 6px 16px;
  border-radius: 8px;
  font-weight: 700;
  color: #1a2230;
  background: linear-gradient(180deg, #f3dcb0, #e8c68e);
}

/* El puzzle */
.pz { padding: clamp(12px, 2vw, 20px); scroll-margin-top: 10px; }
.pz__aviso { margin: 20px; text-align: center; color: var(--texto-suave); }
.pz__barra { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.pz__datos { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.pz__etiqueta { color: var(--texto-suave); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; }
.pz__dato { font-family: var(--fuente-titulos); font-weight: 700; font-size: 1.2rem; margin-right: 12px; font-variant-numeric: tabular-nums; }
.pz__acciones { display: flex; flex-wrap: wrap; gap: 8px; }
.pz__boton {
  font: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid var(--borde);
  background: rgba(255, 255, 255, 0.07);
  color: var(--texto);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.pz__boton:hover:not(:disabled), .pz__boton[aria-pressed="true"] { background: rgba(232, 198, 142, 0.18); border-color: rgba(232, 198, 142, 0.6); }
.pz__boton:disabled { opacity: 0.4; cursor: default; }
.pz__boton--icono { min-width: 38px; padding-left: 0; padding-right: 0; font-size: 1.1rem; line-height: 1.1; }

.pz__zona { position: relative; }
.pz__tablero {
  overflow: auto;
  max-height: 82vh;
  border-radius: 10px;
  border: 1px solid var(--borde);
  background: #0d121b;
}
.pz__mesa {
  --zoom: 1;
  --aspecto: 1.7;
  position: relative;
  width: calc(var(--zoom) * min(100%, 76vh * var(--aspecto)));
  aspect-ratio: var(--aspecto);
  margin: 0 auto;
  background: radial-gradient(ellipse at center, #2c3747 0%, #1a212c 100%);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}
.pz__marco {
  position: absolute;
  z-index: 1;
  border: 2px dashed rgba(232, 198, 142, 0.45);
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.13) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.13) 1px, transparent 1px);
  box-sizing: border-box;
  pointer-events: none;
}
.pz__modelo { display: block; width: 100%; height: 100%; opacity: 0; transition: opacity 0.4s ease; }
.pz--modelo .pz__modelo { opacity: 0.32; }
.pz--terminado .pz__marco { z-index: 100000; border-color: transparent; background-image: none; }
.pz--terminado .pz__modelo { opacity: 1; transition: opacity 0.8s ease; }

.pz__pieza {
  position: absolute;
  pointer-events: none;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.5));
}
.pz__pieza--agarrada { filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.6)); cursor: grabbing; }
.pz__pieza--colocada { filter: none; }
.pz__pieza--pista { animation: pz-pista 0.7s ease; }
@keyframes pz-pista { 0% { filter: drop-shadow(0 0 0 rgba(232, 198, 142, 0)); } 40% { filter: drop-shadow(0 0 14px rgba(232, 198, 142, 1)); } 100% { filter: none; } }

.pz__final {
  position: absolute;
  left: 50%; bottom: 18px;
  transform: translateX(-50%);
  z-index: 100001;
  width: min(92%, 460px);
  padding: 18px 22px;
  text-align: center;
  border-radius: 12px;
  border: 1px solid rgba(232, 198, 142, 0.6);
  background: rgba(14, 20, 30, 0.92);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.55);
}
.pz__final[hidden] { display: none; }
.pz__final-titulo { margin: 0 0 6px; font-family: var(--fuente-titulos); font-size: 1.4rem; color: var(--acento); }
.pz__final-datos { margin: 0 0 12px; color: var(--texto-suave); }
.pz__final-acciones { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.pz__ayuda { margin: 12px 0 0; font-size: 0.88rem; color: var(--texto-suave); }

.editor-anadir--puzzle { min-height: 120px; font-size: 1rem; }

@media (prefers-reduced-motion: reduce) {
  .mj-tarjeta, .mj-tarjeta:hover { transition: none; transform: none; }
  .pz__pieza--pista { animation: none; }
}

/* ---------- Laberinto 3D ---------- */

.mj-tarjeta__imagen--laberinto { background: radial-gradient(circle at 50% 40%, #3d4a63, #151b27); }
.mj-tarjeta__laberinto { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--fuente-titulos); font-size: 3rem; font-weight: 700; color: var(--acento); letter-spacing: 0.1em; }
.mj-tarjeta--cerrada { opacity: 0.72; }
.mj-tarjeta--cerrada .mj-tarjeta__boton { background: #6b7686; color: #e9eef5; }

.lb__escena {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 80vh;
  margin: 0 auto;
  border-radius: 10px;
  overflow: hidden;
  background: #05070b;
  border: 1px solid var(--borde);
  user-select: none;
  -webkit-user-select: none;
}
.lb__escena:fullscreen { max-height: none; border-radius: 0; border: 0; aspect-ratio: auto; }
.lb__canvas { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; outline: none; }
.lb__mapa {
  position: absolute;
  top: 10px; right: 10px;
  width: clamp(96px, 20%, 190px);
  aspect-ratio: 1;
  border: 2px solid rgba(232, 198, 142, 0.75);
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
  image-rendering: pixelated;
}
.lb__hud { position: absolute; top: 10px; left: 10px; padding: 4px 12px; border-radius: 8px; background: rgba(8, 12, 18, 0.7); border: 1px solid var(--borde); font-family: var(--fuente-titulos); font-weight: 700; font-variant-numeric: tabular-nums; }
.lb__botones { position: absolute; bottom: 10px; right: 10px; display: flex; gap: 8px; }
.lb__ico { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--borde); background: rgba(8, 12, 18, 0.7); color: var(--texto); font-size: 1.1rem; cursor: pointer; }
.lb__ico:hover { border-color: rgba(232, 198, 142, 0.7); color: var(--acento); }
.lb__ico--apagado { opacity: 0.5; text-decoration: line-through; }

.lb__pad { position: absolute; left: 10px; bottom: 10px; display: none; grid-template-columns: repeat(3, 52px); grid-template-rows: repeat(2, 52px); gap: 6px; touch-action: none; }
.lb__tecla { border-radius: 12px; border: 1px solid var(--borde); background: rgba(8, 12, 18, 0.62); color: var(--texto); font-size: 1.2rem; touch-action: none; }
.lb__tecla:active { background: rgba(232, 198, 142, 0.35); }
.lb__tecla--f { grid-column: 2; grid-row: 1; }
.lb__tecla--l { grid-column: 1; grid-row: 2; }
.lb__tecla--b { grid-column: 2; grid-row: 2; }
.lb__tecla--r { grid-column: 3; grid-row: 2; }
@media (pointer: coarse), (max-width: 700px) { .lb__pad { display: grid; } }

.lb__capa {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  padding: 14px;
  background: rgba(5, 8, 13, 0.78);
  overflow: auto;
  z-index: 5;
}
.lb__capa[hidden] { display: none; }
.lb__tarjeta { width: min(100%, 520px); padding: 20px 22px; text-align: center; border-radius: 12px; border: 1px solid rgba(232, 198, 142, 0.55); background: rgba(14, 20, 30, 0.94); box-shadow: 0 12px 34px rgba(0, 0, 0, 0.55); }
.lb__titulo { margin: 0 0 8px; font-family: var(--fuente-titulos); font-size: clamp(1.2rem, 3vw, 1.7rem); color: var(--acento); line-height: 1.25; }
.lb__texto { margin: 0 0 10px; color: var(--texto); }
.lb__acciones { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pz__boton--grande { font-size: 1.05rem; padding: 10px 24px; }
.lb__campos { display: grid; gap: 8px; margin: 6px 0 10px; }
.lb__campos input { font: inherit; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--borde); background: rgba(255, 255, 255, 0.08); color: var(--texto); }
.lb__campos input:focus { outline: 2px solid rgba(232, 198, 142, 0.7); outline-offset: 1px; }
.lb__trampa { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.lb__error { min-height: 1.2em; margin: 0 0 8px; color: #f0b4b4; font-size: 0.95rem; }
.lb__formulario { margin-top: 6px; }
@media (prefers-reduced-motion: reduce) { .lb__ico { transition: none; } }
