/* wibblo.kaeliapps.com — identidad de Wibblo: azul de la marca, pasteles de las
   categorías de la app (Juegos rosa, Actividades verde, Matemáticas azul),
   Fredoka para títulos y Nunito para el texto (SIL OFL, ver fonts/). */

@font-face { font-family: "Fredoka"; font-weight: 600; font-display: swap; src: url("fonts/Fredoka-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Fredoka"; font-weight: 700; font-display: swap; src: url("fonts/Fredoka-Bold.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-weight: 600; font-display: swap; src: url("fonts/Nunito-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-weight: 700; font-display: swap; src: url("fonts/Nunito-Bold.woff2") format("woff2"); }

:root {
  --brand: #2563EB;
  --brand-deep: #1E40AF;
  --brand-soft: #DBEAFE;
  --ink: #1F1F24;
  --muted: #5F6368;
  --bg: #FFFFFF;
  --bg-alt: #F5F8FF;
  --card: #FFFFFF;
  --line: #E1E2E6;
  --games: #FFE3DF; --games-vivid: #FF4D6D;
  --acts: #DDF4E7; --acts-vivid: #13B894;
  --math: #DBEBFB; --math-vivid: #1E9BE0;
  --sun: #FFD84D;
  --shadow: 0 10px 30px rgba(37, 99, 235, .10);
  --radius: 22px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #6B9BFF;
    --brand-deep: #A8C3FF;
    --brand-soft: #1C2A4D;
    --ink: #F1F1F4;
    --muted: #C7C7CC;
    --bg: #121214;
    --bg-alt: #17191F;
    --card: #1E1F24;
    --line: #34353B;
    --games: #3A2328; --games-vivid: #FF7A92;
    --acts: #1D3329; --acts-vivid: #3FE0BE;
    --math: #1C2B3D; --math-vivid: #5BC0FF;
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 600 17px/1.6 "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
}
h1, h2, h3, h4 { font-family: "Fredoka", "Nunito", system-ui, sans-serif; font-weight: 700; line-height: 1.15; margin: 0; }
img { max-width: 100%; height: auto; }
a { color: var(--brand); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; z-index: 50; background: var(--card); padding: 8px 12px; border-radius: 10px; }

/* Barra de arriba */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px;
  padding: 10px max(16px, calc((100% - 1120px) / 2));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand img { border-radius: 11px; }
.brand span { font: 700 1.5rem "Fredoka", sans-serif; color: var(--brand); }
.menu { display: flex; gap: 4px; }
.menu a { color: var(--ink); text-decoration: none; padding: 8px 12px; border-radius: 999px; font-weight: 700; font-size: .95rem; }
.menu a:hover { background: var(--brand-soft); }
.get { background: var(--brand); color: #fff; text-decoration: none; padding: 9px 18px; border-radius: 999px; font-weight: 700; }
@media (prefers-color-scheme: dark) { .get { color: #0B1430; } }
.langs { position: relative; }
.langs summary { list-style: none; cursor: pointer; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); font-weight: 700; font-size: .9rem; }
.langs summary::-webkit-details-marker { display: none; }
.langs div { position: absolute; right: 0; top: calc(100% + 6px); background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; min-width: 150px; }
.langs a { display: block; padding: 8px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.langs a:hover, .langs a[aria-current] { background: var(--brand-soft); }
@media (max-width: 860px) { .menu { display: none; } }
@media (max-width: 420px) { .get { display: none; } }

/* Secciones */
.band { padding: 72px max(16px, calc((100% - 1120px) / 2)); }
.band.alt { background: var(--bg-alt); }
.band > h2, .cta h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); text-align: center; }
.intro { text-align: center; color: var(--muted); max-width: 640px; margin: 12px auto 36px; }
.note { text-align: center; color: var(--muted); font-size: .9rem; margin: -24px auto 28px; }

/* Inicio */
.hero {
  display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 32px;
  padding: 56px max(16px, calc((100% - 1120px) / 2)) 64px;
  background:
    radial-gradient(60% 80% at 90% 10%, var(--brand-soft), transparent 70%),
    radial-gradient(40% 60% at 0% 100%, var(--acts), transparent 70%);
}
.hero h1 { font-size: clamp(2.2rem, 5.5vw, 3.8rem); color: var(--brand-deep); }
.lead { font-size: 1.15rem; color: var(--muted); margin: 18px 0 28px; max-width: 34em; }
.hero-art { position: relative; aspect-ratio: 1; max-width: 440px; justify-self: center; width: 100%; }
.blob {
  position: absolute; inset: 8%; background: var(--sun); opacity: .85;
  border-radius: 42% 58% 55% 45% / 48% 42% 58% 52%; animation: morph 12s ease-in-out infinite;
}
.mascot { position: relative; width: 82%; margin: 9%; filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .15)); }
.float { position: absolute; border-radius: 18px; background: var(--card); padding: 8px; box-shadow: var(--shadow); animation: bob 5s ease-in-out infinite; }
.f1 { top: 2%; left: 0; }
.f2 { top: 12%; right: 0; animation-delay: -1.2s; }
.f3 { bottom: 10%; left: 2%; animation-delay: -2.4s; }
.f4 { bottom: 0; right: 8%; animation-delay: -3.6s; }
@keyframes bob { 50% { transform: translateY(-10px) rotate(-3deg); } }
@keyframes morph { 50% { border-radius: 55% 45% 40% 60% / 40% 58% 42% 60%; } }
@media (prefers-reduced-motion: reduce) { .blob, .float { animation: none; } html { scroll-behavior: auto; } }
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; text-align: center; padding-top: 32px; }
  .hero { gap: 12px; }
  .hero-art { max-width: 210px; grid-row: 1; }
  .hero h1 { font-size: clamp(1.9rem, 8vw, 2.6rem); }
  .lead { font-size: 1.02rem; margin: 12px auto 20px; }
  .lead { margin-left: auto; margin-right: auto; }
  .float { width: 52px; height: 52px; padding: 6px; }
}

/* Insignias oficiales: misma altura. En el teléfono, la tienda que corresponde va primero y resaltada. */
.stores { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.hero .stores, .cta .stores { justify-content: flex-start; }
@media (max-width: 760px) { .hero .stores, .cta .stores { justify-content: center; } }
.store { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; line-height: 0; text-decoration: none; transition: opacity .2s; }
.store img {
  height: clamp(44px, 12.5vw, 56px); width: auto; aspect-ratio: 3.2;
  object-fit: cover; background: #000; border-radius: 8px;
  outline: 1px solid #a6a6a6; outline-offset: -1px;
}
.yours { display: none; line-height: 1; font: 700 .8rem "Nunito", sans-serif; color: var(--brand); background: var(--brand-soft); padding: 5px 10px; border-radius: 999px; }
.ios .appstore, .android .play { order: -1; }
.ios .appstore .yours, .android .play .yours { display: block; }

/* Mientras Google no apruebe producción (ajustes.js → ANDROID_DISPONIBLE = false): en lugar de la
   insignia de Google Play, una etiqueta de la página sin enlace. */
.play-soon { display: none; }
.android-soon .play { display: none; }
.android-soon .play-soon {
  display: inline-flex; align-items: center; justify-content: center; height: 56px; padding: 0 22px;
  border-radius: 14px; border: 2px dashed var(--brand); background: var(--brand-soft); color: var(--brand-deep);
  font: 700 1rem "Fredoka", "Nunito", sans-serif; line-height: 1.2; text-align: center;
}
.cta .android-soon .play-soon, .android-soon .cta .play-soon { background: rgba(255, 255, 255, .16); border-color: #fff; color: #fff; }
/* En Android, sin Google Play todavía: el App Store se ve normal y nada se marca como «Tu tienda». */
.android-soon.android .appstore { opacity: 1; }
.android-soon.android .appstore img { height: 56px; }
.android-soon.android .play-soon { order: -1; }

/* Actividades */
.cats { display: grid; gap: 20px; }
.cat { border-radius: var(--radius); padding: 22px; }
.cat-games { background: var(--games); }
.cat-activities { background: var(--acts); }
.cat-math { background: var(--math); }
.cat h3 { font-size: 1.4rem; margin: 0 4px 14px; }
.cat-games h3 { color: var(--games-vivid); }
.cat-activities h3 { color: var(--acts-vivid); }
.cat-math h3 { color: var(--math-vivid); }
.gens { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.gen { background: var(--card); border-radius: 18px; padding: 16px; display: grid; grid-template-columns: 64px 1fr; column-gap: 14px; align-items: start; box-shadow: 0 2px 0 rgba(0, 0, 0, .04); }
.gen img { grid-row: span 2; width: 64px; height: 64px; object-fit: contain; }
.gen h4 { font-size: 1.15rem; margin-top: 2px; }
.gen p { margin: 4px 0 0; color: var(--muted); font-size: .93rem; line-height: 1.45; }

@media (max-width: 560px) {
  .cat { padding: 16px 12px; }
  .gens { grid-template-columns: 1fr 1fr; gap: 10px; }
  .gen { grid-template-columns: 1fr; text-align: center; padding: 14px 10px; }
  .gen img { grid-row: auto; margin: 0 auto 8px; width: 56px; height: 56px; }
  .gen h4 { font-size: 1.02rem; }
  .gen p { font-size: .84rem; }
  .gallery { grid-template-columns: 1fr 1fr; gap: 12px; }
}

/* Galería */
.gallery { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
.sample { display: block; text-decoration: none; color: var(--ink); }
.sample img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: top; border-radius: 14px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .2s; }
.sample:hover img { transform: translateY(-4px) rotate(-1deg); }
.sample span { display: block; text-align: center; font-weight: 700; margin-top: 10px; }
.lightbox { border: 0; padding: 0; background: transparent; max-width: min(92vw, 900px); max-height: 92vh; }
.lightbox::backdrop { background: rgba(10, 14, 30, .78); }
.lightbox img { display: block; max-height: 84vh; width: auto; margin: 0 auto; border-radius: 12px; background: #fff; }
.lightbox .caption { color: #fff; text-align: center; font-weight: 700; margin: 10px 0 0; }
.lightbox .close { position: absolute; top: 6px; right: 6px; width: 44px; height: 44px; border-radius: 50%; border: 0; font-size: 1.6rem; background: rgba(255, 255, 255, .92); color: #1F1F24; cursor: pointer; }

/* Cómo funciona */
.how { list-style: none; margin: 36px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: s; }
.how li { background: var(--card); border: 2px solid var(--brand-soft); border-radius: var(--radius); padding: 26px 22px; text-align: center; }
.num { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--brand); color: #fff; font: 700 1.5rem "Fredoka", sans-serif; margin-bottom: 12px; }
.how h3 { font-size: 1.25rem; }
.how p { color: var(--muted); margin: 8px 0 0; }
@media (max-width: 760px) { .how { grid-template-columns: 1fr; } }

/* Tutoriales */
.tabs { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 28px; }
.tabs button { display: inline-flex; align-items: center; gap: 8px; border: 2px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 6px 16px 6px 8px; font: 700 .95rem "Nunito", sans-serif; cursor: pointer; }
.tabs button[aria-selected="true"] { border-color: var(--brand); background: var(--brand-soft); }
.tut { margin-top: 8px; }
.tut + .tut { margin-top: 48px; }
.js .tut[hidden] { display: none; }
.tut h3 { font-size: 1.5rem; text-align: center; margin-bottom: 18px; }
.guide summary { cursor: pointer; text-align: center; font-weight: 700; color: var(--brand); margin-bottom: 14px; }
.guide[open] summary { display: none; }
.video-slot:not([hidden]) + .guide[open] summary { display: block; }
.steps { list-style: none; margin: 0; padding: 0 4px 12px; display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; }
.step { flex: 0 0 min(250px, 72vw); scroll-snap-align: start; }
.step img { display: block; width: 100%; border-radius: 26px; border: 6px solid #1F1F24; background: #fff; box-shadow: var(--shadow); }
.step p { margin: 12px 2px 0; font-size: .95rem; }
.video-slot { max-width: 420px; margin: 0 auto 22px; }
.video-slot video { width: 100%; border-radius: 18px; background: #000; }
.video-slot p { text-align: center; font-weight: 700; margin: 8px 0 0; }

/* Gratis y Pro */
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; max-width: 860px; margin: 0 auto; }
.plan { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 26px; }
.plan.pro { border-color: var(--brand); background: linear-gradient(160deg, var(--brand-soft), var(--card) 60%); }
.plan h3 { font-size: 1.5rem; display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.plan ul { margin: 0; padding: 0; list-style: none; }
.plan li { padding: 8px 0 8px 32px; position: relative; border-top: 1px dashed var(--line); }
.plan li:first-child { border-top: 0; }
.plan li::before { content: "✓"; position: absolute; left: 4px; top: 7px; width: 20px; height: 20px; border-radius: 50%; background: var(--acts); color: var(--acts-vivid); font-size: .8rem; display: grid; place-items: center; }
.plan.pro li::before { background: var(--brand); color: #fff; }
@media (max-width: 700px) { .plans { grid-template-columns: 1fr; } }

/* Preguntas */
.faq { max-width: 820px; margin: 36px auto 0; display: grid; gap: 12px; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 4px 20px; }
.faq summary { cursor: pointer; font: 700 1.1rem "Fredoka", sans-serif; padding: 14px 28px 14px 0; position: relative; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 10px; font-size: 1.5rem; color: var(--brand); }
.faq details[open] summary::after { content: "–"; }
.faq p { margin: 0 0 16px; color: var(--muted); }

/* Llamada final y pie */
.cta {
  display: flex; align-items: center; justify-content: center; gap: 28px; flex-wrap: wrap;
  margin: 0 max(16px, calc((100% - 1120px) / 2)) 64px; padding: 36px 28px; border-radius: 30px;
  background: linear-gradient(135deg, var(--brand), #4F8BFF); color: #fff;
}
.cta h2 { text-align: left; color: #fff; }
.cta p { margin: 8px 0 18px; opacity: .92; }
.cta .yours { background: #fff; }
@media (max-width: 760px) { .cta { text-align: center; } .cta h2 { text-align: center; } .cta img { width: 140px; } .cta .store img { width: auto; } }
.foot { border-top: 1px solid var(--line); padding: 28px 16px 40px; text-align: center; color: var(--muted); font-size: .92rem; }
.foot nav { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 22px; }
.foot a { color: var(--ink); font-weight: 700; text-decoration: none; }
.foot a:hover { color: var(--brand); }
.foot p { margin: 14px 0 0; }
/* Enlace a Kaeli: «Una app de» + logo, como en las demás webs de Kaeli */
.foot .kaeli-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px 12px 4px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--muted); font-weight: 600; transition: border-color .2s; }
.foot .kaeli-link:hover { border-color: var(--brand); color: var(--ink); }
.kaeli-link img { display: block; height: 26px; width: auto; }
/* El logo tiene letras azul marino: en tema oscuro va sobre una pastilla clara para que se lea */
@media (prefers-color-scheme: dark) { .kaeli-link img { background: #fff; border-radius: 8px; padding: 3px 6px; box-sizing: content-box; height: 22px; } }
