/* Página de presentación para familias (estática, indexable). Se muestra en la raíz cuando el
   dispositivo todavía no tiene ningún peque guardado, y siempre en /familias. */
html.landing #root { display: none; }
#landing { display: none; }
html.landing #landing { display: block; }
html.landing body { background: #0b1534; }
html.landing { scroll-behavior: smooth; }

#landing { font-family: 'Nunito', system-ui, sans-serif; color: #2b3a33; line-height: 1.5; -webkit-font-smoothing: antialiased; overflow-x: clip; }
#landing * { box-sizing: border-box; }
/* Reset de márgenes con especificidad cero, para que las reglas de cada bloque manden. */
:where(#landing) :where(h1, h2, h3, p) { margin: 0; }
#landing img, #landing video { max-width: 100%; height: auto; display: block; }
.ld-wrap { max-width: 1120px; margin: 0 auto; padding: 0 22px; }
.ld-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 60px; padding: 0 30px; border-radius: 30px; font-size: 20px; font-weight: 900; text-decoration: none; border: 4px solid #fff; box-shadow: 0 6px 0 #c97c12, 0 16px 34px #0005; background: linear-gradient(180deg, #ffdb6e, #f6a623); color: #5a3500; transition: transform .15s, box-shadow .15s; }
.ld-btn:hover { transform: translateY(-3px); box-shadow: 0 9px 0 #c97c12, 0 22px 40px #0005; }
.ld-btn.secondary { background: #fffdf6; color: #2c493b; box-shadow: 0 6px 0 #d8d5c4, 0 16px 34px #0003; }
.ld-btn.secondary:hover { box-shadow: 0 9px 0 #d8d5c4, 0 22px 40px #0003; }

.only-player { display: none !important; }
html.has-player .only-player { display: inline-flex !important; }
html.has-player .only-new { display: none !important; }

/* ───────── Cabecera flotante ───────── */
.ld-header { position: fixed; z-index: 20; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 22px; background: linear-gradient(180deg, #0a2a1a66, transparent); transition: background .3s; }
.ld-header.scrolled { background: #fffdf6e6; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 6px 24px #10183022; }
.ld-logo { height: 56px; width: auto; filter: drop-shadow(0 3px 3px #0004); }
.ld-nav { display: flex; gap: 6px; align-items: center; padding: 6px; border-radius: 999px; background: #fffdf6cc; backdrop-filter: blur(10px); box-shadow: 0 8px 24px #0003; }
.ld-header.scrolled .ld-nav { background: transparent; box-shadow: none; backdrop-filter: none; }
.ld-nav a { font-weight: 800; color: #2c493b; text-decoration: none; padding: 10px 14px; border-radius: 999px; }
.ld-nav a:hover { background: #ffffff; }
.ld-nav .ld-btn { min-height: 44px; padding: 0 18px; font-size: 16px; border-width: 3px; box-shadow: 0 4px 0 #c97c12; }

/* ───────── Portada inmersiva en capas ───────── */
.ld-hero { position: relative; min-height: 100svh; overflow: hidden; background: linear-gradient(180deg, #4fa9f0 0%, #8fd0ff 42%, #cdeeff 70%, #d9f1c0 100%); display: grid; place-items: center; padding: 110px 0 40px; }
.ld-layer { position: absolute; inset: -6%; pointer-events: none; will-change: transform; }
.ld-layer img { position: absolute; width: 100%; height: 100%; object-fit: cover; object-position: center bottom; }
.ld-layer.sun { inset: 0; }
.ld-sun { position: absolute; top: 9%; right: 10%; width: 150px; height: 150px; border-radius: 50%; background: radial-gradient(circle, #fff6c2 0 44%, #ffd85a 46% 70%, #ffd85a00 71%); box-shadow: 0 0 90px 40px #fff1a866; animation: ldBreathe 6s ease-in-out infinite; }
.ld-layer.clouds img { object-fit: contain; object-position: center top; opacity: .95; animation: ldDrift 60s linear infinite alternate; }
.ld-layer.animals { inset: 12% -8% auto -8%; height: 44%; }
.ld-layer.animals img { object-fit: contain; object-position: center top; animation: ldSway 7s ease-in-out infinite; opacity: .95; }
.ld-layer.front { z-index: 3; }
.ld-layer.front img { animation: ldSway 9s ease-in-out infinite reverse; }
@keyframes ldDrift { from { transform: translateX(-2%); } to { transform: translateX(2%); } }
@keyframes ldSway { 0%, 100% { transform: translate(0, 0) rotate(0); } 50% { transform: translate(0.6%, -0.8%) rotate(.3deg); } }
@keyframes ldBreathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes ldBob { 0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); } 50% { transform: translateY(-16px) rotate(var(--r, 0deg)); } }

.ld-hero-inner { position: relative; z-index: 8; display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: center; width: min(1120px, 100%); padding: 0 22px; }
.ld-hero-copy { color: #fff; text-shadow: 0 2px 0 #0005, 0 10px 30px #0008; padding: 22px 26px; border-radius: 30px; background: linear-gradient(180deg, #0a2a1a55, #0a2a1a33); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border: 1px solid #ffffff33; }
.ld-hero-copy .ld-logo-big { width: min(460px, 90%); height: auto; filter: drop-shadow(0 12px 18px #0005); animation: ldBob 4s ease-in-out infinite; }
.ld-hero-copy h1 { margin-top: 0; font-size: clamp(34px, 4.2vw, 54px); font-weight: 900; letter-spacing: -1px; line-height: 1.08; }
.ld-hero-copy h1 em { font-style: normal; color: #ffd95c; }
.ld-hero-copy p.lead { margin: 14px 0 22px; font-size: clamp(17px, 1.6vw, 20px); font-weight: 700; max-width: 520px; }
.ld-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.ld-hero-copy small { display: block; margin-top: 14px; font-size: 14px; font-weight: 800; opacity: .95; }

/* Tableta con el vídeo del juego */
.ld-device { position: relative; border-radius: 30px; padding: 12px; background: #fffdf6; box-shadow: 0 40px 90px #10183066, inset 0 0 0 2px #e6e4d5; transform: rotate(-2deg); animation: ldBob 6s ease-in-out infinite; --r: -2deg; }
.ld-device .ld-video, .ld-device > img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 18px; background: #cdeeff; }
.ld-badge { position: absolute; left: -16px; bottom: 28px; padding: 10px 16px; border-radius: 18px; background: #fff; font-weight: 900; color: #7a4a00; box-shadow: 0 10px 24px #0004; transform: rotate(-5deg); }
.ld-piece { position: absolute; z-index: 4; width: 110px; filter: drop-shadow(0 14px 14px #0006); animation: ldBob 5s ease-in-out infinite; pointer-events: none; }
.ld-piece.king { left: 1%; bottom: 6%; width: 140px; --r: -8deg; }
.ld-piece.pawn { right: 3%; bottom: 8%; --r: 9deg; animation-delay: -2s; }
.ld-piece.queen { right: 4%; top: 16%; width: 110px; --r: 6deg; animation-delay: -3.5s; }
.ld-scroll-hint { position: absolute; z-index: 8; left: 50%; bottom: 14px; transform: translateX(-50%); color: #fff; font-weight: 900; font-size: 13px; letter-spacing: 2px; text-shadow: 0 2px 8px #0006; animation: ldBob 2s ease-in-out infinite; }

/* ───────── Secciones ───────── */
.ld-section { position: relative; padding: 80px 0 72px; background: linear-gradient(180deg, #d9f1c0, #eefaff); }
.ld-section h2 { font-size: clamp(28px, 3.6vw, 40px); font-weight: 900; letter-spacing: -.9px; color: #1f5a43; text-align: center; margin: 0 auto 12px; max-width: 820px; }
.ld-section > .ld-wrap > p.sub { display: block; text-align: center; font-size: 18px; font-weight: 700; color: #4f6447; max-width: 640px; margin: 0 auto 40px; line-height: 1.55; }
.ld-reveal { opacity: 0; transform: translateY(34px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .2, 1); }
.ld-reveal.in { opacity: 1; transform: none; }
.ld-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.ld-card { padding: 24px 22px; border-radius: 28px; background: #fffdf6; border: 2px solid #ffffffb0; box-shadow: 0 12px 34px #10183020; transition: transform .25s; }
.ld-card:hover { transform: translateY(-6px) rotate(-.4deg); }
.ld-card .ico { width: 64px; height: 64px; display: block; margin-bottom: 10px; }
.ld-card .ico.emoji { font-size: 44px; line-height: 64px; }
.ld-card h3 { font-size: 20px; font-weight: 900; color: #2c493b; margin-bottom: 6px; }
.ld-card p { font-size: 15px; color: #4f5f52; font-weight: 600; }
.ld-grid .ld-card:nth-child(2) { transition-delay: .1s; } .ld-grid .ld-card:nth-child(3) { transition-delay: .2s; } .ld-grid .ld-card:nth-child(5) { transition-delay: .1s; } .ld-grid .ld-card:nth-child(6) { transition-delay: .2s; }

/* Cifras: marcadores de madera con retrato, número dorado y lazo */
.ld-numbers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; margin-top: 44px; }
.ld-sign { position: relative; display: flex; flex-direction: column; align-items: center; padding: 44px 14px 22px; border-radius: 26px; text-align: center;
  background: linear-gradient(180deg, #c98f52 0%, #b87a3f 100%); box-shadow: 0 10px 0 #7a4a1f, 0 22px 40px #10183040, inset 0 0 0 4px #e8b974, inset 0 0 0 7px #a86a33; transition: transform .25s; }
.ld-sign::before { content: ''; position: absolute; inset: 11px; border-radius: 18px; background: repeating-linear-gradient(90deg, #0000 0 18px, #ffffff10 18px 20px), linear-gradient(180deg, #d9a066, #c4874a); box-shadow: inset 0 2px 0 #ffffff55; }
.ld-sign::after { content: ''; position: absolute; top: 20px; left: 22px; right: 22px; height: 4px; border-radius: 2px; background: #7a4a1f55; }
.ld-sign > * { position: relative; }
.ld-sign:hover { transform: translateY(-6px) rotate(-.6deg); }
.ld-sign-ring { position: absolute; top: -34px; left: 50%; transform: translateX(-50%); width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 38% 32%, #fff, color-mix(in srgb, var(--sign) 55%, #fff)); border: 5px solid #fff3c2; box-shadow: 0 8px 18px #0005, 0 0 0 3px #b87a3f; }
.ld-sign-ring img { width: 86%; height: 86%; object-fit: contain; }
.ld-sign strong { display: block; margin-top: 8px; font-size: clamp(42px, 4.6vw, 58px); font-weight: 900; line-height: 1; letter-spacing: -1.5px;
  color: #ffe27a; -webkit-text-stroke: 2px #7a4a00; text-shadow: 0 3px 0 #7a4a00, 0 8px 16px #0005; }
.ld-sign em { display: inline-block; margin-top: 12px; padding: 7px 16px; border-radius: 999px; font-style: normal; font-size: 14px; font-weight: 900; letter-spacing: .3px;
  color: #5a3500; background: linear-gradient(180deg, #ffdb6e, #f6a623); box-shadow: 0 4px 0 #c97c12, 0 6px 14px #0004; border: 2px solid #fff3c2; }

/* ───────── Viaje por los mundos (paneles pegajosos que se apilan) ───────── */
.ld-journey { position: relative; }
.ld-journey-title { position: relative; z-index: 2; text-align: center; padding: 54px 22px 10px; background: #eefaff; }
.ld-journey-title h2 { font-size: clamp(28px, 3.6vw, 40px); font-weight: 900; color: #1f5a43; letter-spacing: -.9px; }
.ld-journey-title p { font-size: 18px; font-weight: 700; color: #4f6447; margin-top: 6px; }
.ld-world { position: sticky; top: 0; height: 100svh; display: grid; place-items: center; overflow: hidden; background-size: cover; background-position: center; box-shadow: 0 -20px 60px #0004; }
.ld-world::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, #0a1a1299 0%, #0a1a1240 45%, transparent 70%); }
.ld-world-card { position: relative; z-index: 2; display: grid; grid-template-columns: 170px 1fr; gap: 22px; align-items: center; width: min(760px, calc(100% - 44px)); padding: 24px 28px; border-radius: 32px; background: #fffdf6ee; backdrop-filter: blur(8px); box-shadow: 0 30px 70px #0006; opacity: 0; transform: translateY(40px) scale(.96); transition: opacity .7s ease .1s, transform .7s cubic-bezier(.2, .8, .2, 1) .1s; }
.ld-world.in .ld-world-card { opacity: 1; transform: none; }
.ld-host { width: 170px; height: 170px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 38% 32%, #fff, var(--host, #ffe08a)); border: 6px solid #fff; box-shadow: 0 16px 36px #0005; transform: translateX(-60px) rotate(-12deg); opacity: 0; transition: transform .8s cubic-bezier(.3, 1.4, .5, 1) .25s, opacity .4s .25s; }
.ld-world.in .ld-host { transform: none; opacity: 1; }
.ld-host img { width: 88%; height: 88%; object-fit: contain; }
.ld-world-card .eyebrow { font-size: 12px; letter-spacing: 2.5px; font-weight: 900; color: #b8860b; }
.ld-world-card h3 { font-size: clamp(24px, 3vw, 34px); font-weight: 900; color: #1f5a43; letter-spacing: -.6px; margin: 2px 0 6px; }
.ld-world-card p { font-size: 17px; font-weight: 700; color: #35504a; }
.ld-world-card .pill { display: inline-block; margin-top: 12px; padding: 7px 14px; border-radius: 999px; background: #fff; font-weight: 900; font-size: 14px; color: #2c493b; box-shadow: 0 4px 0 #e3e2d5; }

/* ───────── Capturas ───────── */
.ld-shots { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.ld-shot { border-radius: 24px; overflow: hidden; background: #fff; box-shadow: 0 16px 40px #10183030; border: 4px solid #fff; transition: transform .3s; }
.ld-shot:hover { transform: scale(1.02) rotate(-.3deg); }
.ld-shot figcaption { padding: 10px 14px 12px; font-weight: 800; color: #2c493b; font-size: 15px; }
.ld-shots .ld-shot:nth-child(2) { transition-delay: .1s; } .ld-shots .ld-shot:nth-child(4) { transition-delay: .1s; }

/* ───────── Familias ───────── */
.ld-family { background: #fffdf6; border-radius: 36px; padding: 36px; box-shadow: 0 24px 60px #10183028; }
.ld-family h2 { margin-bottom: 4px; }
.ld-family ul { list-style: none; padding: 0; margin: 18px 0 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 26px; }
.ld-family li { display: flex; gap: 12px; align-items: flex-start; font-weight: 700; color: #35504a; }
.ld-family li span { font-size: 26px; line-height: 1; }

/* ───────── Preguntas ───────── */
.ld-faq details { background: #fffdf6; border-radius: 18px; padding: 14px 18px; margin-bottom: 10px; border: 2px solid #ffffffb0; box-shadow: 0 6px 18px #10183014; }
.ld-faq summary { cursor: pointer; font-weight: 900; font-size: 17px; color: #2c493b; }
.ld-faq details p { margin-top: 8px; color: #4f5f52; font-weight: 600; }

/* ───────── Cierre y pie ───────── */
.ld-cta { position: relative; overflow: hidden; text-align: center; padding: 80px 22px; background: radial-gradient(900px 500px at 50% 0%, #2b3f86, #0b1534 70%); color: #fff; }
.ld-cta h2 { font-size: clamp(30px, 4vw, 46px); font-weight: 900; margin-bottom: 20px; text-shadow: 0 4px 20px #0008; }
.ld-cta .stars i { position: absolute; color: #fff7d1; font-style: normal; animation: ldTwinkle 3s ease-in-out infinite; }
@keyframes ldTwinkle { 0%, 100% { opacity: .3; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.2); } }
.ld-footer { padding: 26px 22px 40px; text-align: center; font-size: 14px; font-weight: 700; color: #cfd8ff; background: #0b1534; }
.ld-footer a { color: #ffd95c; }
.ld-footer p + p { margin-top: 6px; }

@media (max-width: 900px) {
  .ld-hero { padding-top: 96px; min-height: auto; }
  .ld-hero-inner { grid-template-columns: 1fr; text-align: center; gap: 22px; }
  .ld-hero-copy p.lead { margin-left: auto; margin-right: auto; }
  .ld-actions { justify-content: center; }
  .ld-device { transform: none; --r: 0deg; margin: 0 6px; }
  .ld-badge { left: 6px; }
  .ld-piece { display: none !important; }
  .ld-layer.animals { height: 30%; }
  .ld-hero-copy { padding: 16px 14px; }
  .ld-nav a:not(.ld-btn) { display: none; }
  .ld-logo { height: 42px; }
  .ld-grid { grid-template-columns: 1fr; }
  .ld-numbers { grid-template-columns: repeat(2, 1fr); gap: 40px 14px; margin-top: 52px; }
  .ld-sign { padding: 40px 10px 18px; } .ld-sign strong { font-size: 40px; } .ld-sign em { font-size: 12px; padding: 6px 12px; }
  .ld-shots { grid-template-columns: 1fr; }
  .ld-family { padding: 24px 18px; } .ld-family ul { grid-template-columns: 1fr; }
  .ld-world { height: 86svh; }
  .ld-world-card { grid-template-columns: 1fr; text-align: center; padding: 20px; }
  .ld-host { margin: 0 auto; width: 130px; height: 130px; }
  .ld-world::before { background: linear-gradient(180deg, transparent 30%, #0a1a1299); }
}
@media (prefers-reduced-motion: reduce) {
  #landing * { animation: none !important; transition: none !important; }
  .ld-reveal, .ld-world-card, .ld-host { opacity: 1 !important; transform: none !important; }
}
