/* ===========================================================================
   NumFox — "Entra en cada mundo" worlds slider
   ---------------------------------------------------------------------------
   Self-contained and SCOPED under #numfox-worlds so none of these rules can
   leak into (or be overridden by) the host landing page. Generic class names
   like .spot / .car-tab / .wrap only apply inside the section.

   Fonts (Fredoka / Nunito / JetBrains Mono) are already loaded by the consola
   layout, so no extra <link> is needed here.

   Host page (consola) is already dark (#0C0A1E) with an ambient starfield, so
   the section paints NO solid background — the starfield shows through, like
   every sibling .sec. (The standalone package sets `background: var(--bg)`;
   that line is intentionally omitted here per the package's own guidance.)
   =========================================================================== */

#numfox-worlds {
  /* palette (scoped — does not touch global :root) */
  --bg: #0c0a1e;
  --panel: #1a1640;
  --panel-2: #221c52;
  --stroke: rgb(255 255 255 / 10%);
  --stroke-2: rgb(255 255 255 / 18%);
  --txt: #f3f0ff;
  --txt-dim: #b3acd9;
  --txt-faint: #7a7299;
  --math: #FF8A33;
  --num: #B06CFF;
  --word: #2BE07A;
  --read: #33CFFF;
  --gram: #FFC531;
  --chess: #FF5DA8;

  color: var(--txt);
  font-family: Nunito, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding: 80px 0;
}
#numfox-worlds *, #numfox-worlds *::before, #numfox-worlds *::after { box-sizing: border-box; }

/* height:auto so the width/height attributes (added for CLS) only set the aspect
   ratio; the phone screenshots and coach head are sized by width alone in CSS, so
   without this the height attribute leaks and stretches them vertically. */
#numfox-worlds img { max-width: 100%; height: auto; display: block; }

/* layout helpers */
#numfox-worlds .wrap { max-width: 1220px; margin: 0 auto; padding: 0 26px; position: relative; z-index: 1; }
#numfox-worlds .disp { font-family: Fredoka, sans-serif; font-weight: 700; letter-spacing: -0.01em; }
#numfox-worlds .chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; font-weight: 800; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }

/* section head */
#numfox-worlds .sec-head { text-align: center; max-width: 680px; margin: 0 auto 48px; }
#numfox-worlds .sec-head h2 { font-family: Fredoka, sans-serif; font-weight: 700; font-size: clamp(34px, 4.6vw, 60px); line-height: 1; letter-spacing: -0.015em; margin: 14px 0; }
#numfox-worlds .sec-head p { color: var(--txt-dim); font-size: 18px; margin: 0; }
#numfox-worlds .kick { display: inline-flex; align-items: center; gap: 8px; color: var(--gram); font-weight: 800; font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; }
#numfox-worlds .kick .blink { width: 9px; height: 9px; border-radius: 2px; background: var(--word); box-shadow: 0 0 12px var(--word); animation: numfox-blink 1.1s steps(2) infinite; }

@keyframes numfox-blink { 50% { opacity: 0.2; } }

/* ── WORLD DEEP-DIVE spotlight (one per world, inside the carousel) ── */
#numfox-worlds .spot { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: center; background: linear-gradient(135deg, color-mix(in srgb, var(--accent, var(--chess)) 13%, transparent), color-mix(in srgb, var(--read) 6%, transparent)); border: 1.5px solid var(--stroke-2); border-radius: 28px; padding: 44px; }
#numfox-worlds .spot .badge { color: var(--accent, var(--chess)); background: color-mix(in srgb, var(--accent, var(--chess)) 18%, transparent); }
#numfox-worlds .spot .badge .sq { width: 8px; height: 8px; border-radius: 2px; background: var(--accent, var(--chess)); box-shadow: 0 0 10px var(--accent, var(--chess)); }
#numfox-worlds .spot h3 { font-family: Fredoka, sans-serif; font-weight: 700; font-size: clamp(30px,3.6vw,46px); line-height: 1; margin: 14px 0; }
#numfox-worlds .spot p { color: var(--txt-dim); font-size: 17px; margin: 0 0 22px; }
#numfox-worlds .spot .newtag { font-size: 12px; color: var(--accent, var(--chess)); vertical-align: middle; background: color-mix(in srgb, var(--accent, var(--chess)) 18%, transparent); padding: 3px 9px; border-radius: 7px; font-family: Nunito, sans-serif; font-weight: 800; letter-spacing: 0.04em; }

/* phone screenshot(s) in the right column (images already include device bezel) */
#numfox-worlds .spot-shot { position: relative; display: flex; justify-content: center; align-items: center; min-height: 420px; }
#numfox-worlds .spot-shot .shot-stack { position: relative; width: 100%; display: flex; justify-content: center; }
#numfox-worlds .spot-shot .shot-front { position: relative; z-index: 2; width: min(214px, 58%); transform: translateX(-16%); filter: drop-shadow(0 30px 56px rgb(0 0 0 / 72%)) drop-shadow(0 0 44px color-mix(in srgb, var(--accent, var(--chess)) 26%, transparent)); }
#numfox-worlds .spot-shot .shot-back { position: absolute; z-index: 1; top: 50%; left: 50%; width: min(266px, 72%); transform: translate(6%, -50%); opacity: 0.92; filter: drop-shadow(0 26px 50px rgb(0 0 0 / 70%)); }

/* single-screenshot variant — one centered phone */
#numfox-worlds .spot-shot.single .shot-front { width: min(230px, 64%); transform: none; }

/* coach line (Math mascot) — shared across slides */
#numfox-worlds .coachbox { display: flex; align-items: center; gap: 12px; margin-top: 18px; background: rgb(0 0 0 / 30%); border: 1px solid var(--stroke); border-radius: 14px; padding: 12px 16px; font-weight: 700; font-size: 14px; }
#numfox-worlds .coachbox .cf { width: 30px; height: 30px; border-radius: 9px; background: var(--math); display: grid; place-items: center; flex: none; }

/* ── per-world demo visuals ── */
#numfox-worlds .demo { margin: 2px 0; }

/* Números — number tiles */
#numfox-worlds .numtiles { display: flex; flex-wrap: wrap; gap: 8px; }
#numfox-worlds .numtiles span { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-family: Fredoka, sans-serif; font-weight: 700; font-size: 20px; background: rgb(0 0 0 / 30%); border: 1.5px solid var(--stroke); color: var(--txt-faint); }
#numfox-worlds .numtiles span.on { color: #fff; border-color: var(--accent); background: color-mix(in srgb, var(--accent) 20%, transparent); box-shadow: 0 0 16px -3px var(--accent); }

/* Matemáticas — fact chips */
#numfox-worlds .facts { display: flex; flex-wrap: wrap; gap: 8px; }
#numfox-worlds .fact { font-family: "JetBrains Mono", monospace; font-weight: 700; font-size: 15px; padding: 8px 12px; border-radius: 10px; background: rgb(0 0 0 / 30%); border: 1.5px solid var(--stroke); color: var(--txt-faint); display: inline-flex; align-items: center; gap: 7px; }
#numfox-worlds .fact::after { content: "◦"; opacity: 0.5; }
#numfox-worlds .fact.on { color: var(--txt); border-color: var(--accent); }
#numfox-worlds .fact.on::after { content: "✓"; color: var(--accent); font-weight: 900; opacity: 1; }

/* Palabras — flashcards */
#numfox-worlds .wordpairs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#numfox-worlds .wp { background: rgb(0 0 0 / 30%); border: 1.5px solid var(--stroke); border-radius: 12px; padding: 11px 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
#numfox-worlds .wp b { font-family: Fredoka, sans-serif; font-weight: 600; font-size: 16px; }
#numfox-worlds .wp em { font-style: normal; font-size: 13px; color: var(--accent); font-weight: 700; }

/* Lectura — question pills */
#numfox-worlds .qtypes { display: flex; flex-wrap: wrap; gap: 8px; }
#numfox-worlds .qtypes span { padding: 9px 14px; border-radius: 999px; background: rgb(0 0 0 / 30%); border: 1.5px solid var(--stroke); font-weight: 700; font-size: 13.5px; color: var(--txt-dim); }
#numfox-worlds .qtypes span:first-child { border-color: var(--accent); color: var(--txt); }

/* Gramática — concept bars */
#numfox-worlds .cbars { display: grid; gap: 11px; }
#numfox-worlds .cbar { display: grid; grid-template-columns: 116px 1fr 46px; gap: 12px; align-items: center; font-size: 13px; font-weight: 700; }
#numfox-worlds .cbar .t { height: 9px; border-radius: 999px; background: rgb(0 0 0 / 35%); overflow: hidden; }
#numfox-worlds .cbar .f { height: 100%; border-radius: 999px; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
#numfox-worlds .cbar .pc { text-align: right; color: var(--txt-dim); font-weight: 800; }

/* Ajedrez — difficulty ladder */
#numfox-worlds .ladder { display: flex; align-items: flex-end; gap: 6px; height: 120px; }
#numfox-worlds .ladder .rung { flex: 1; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, var(--accent, var(--chess)), rgb(166 77 255 / 25%)); opacity: 0.4; }
#numfox-worlds .ladder .rung.on { opacity: 1; box-shadow: 0 0 18px -2px var(--accent, var(--chess)); }

/* ── CAROUSEL ── */
#numfox-worlds .carousel { position: relative; }
#numfox-worlds .car-tabs { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 26px; }
#numfox-worlds .car-tab { display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border-radius: 999px; border: 1.5px solid var(--stroke); background: rgb(255 255 255 / 3%); cursor: pointer; font-family: Fredoka, sans-serif; font-weight: 600; font-size: 14px; color: var(--txt-dim); transition: color .15s, border-color .15s, background .15s; }
#numfox-worlds .car-tab .sq { width: 10px; height: 10px; border-radius: 3px; background: var(--tc); box-shadow: 0 0 10px var(--tc); }
#numfox-worlds .car-tab .tnum { font-family: "JetBrains Mono", monospace; font-size: 11px; color: var(--txt-faint); }
#numfox-worlds .car-tab:hover { color: var(--txt); border-color: var(--tc); }
#numfox-worlds .car-tab.active { color: var(--txt); border-color: var(--tc); background: color-mix(in srgb, var(--tc) 14%, transparent); }
#numfox-worlds .car-tab.active .tnum { color: var(--tc); }

#numfox-worlds .car-stage { position: relative; }
#numfox-worlds .car-viewport { overflow: hidden; border-radius: 28px; }
#numfox-worlds .car-track { display: flex; transition: transform .5s cubic-bezier(.5,.05,.2,1); }
#numfox-worlds .car-track > .spot { flex: 0 0 100%; min-width: 100%; }

#numfox-worlds .car-controls { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 24px; }
#numfox-worlds .car-arrow { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; background: rgb(26 22 64 / 92%); border: 1.5px solid var(--stroke-2); color: var(--txt); cursor: pointer; transition: transform .15s ease, background .15s, border-color .15s; }
#numfox-worlds .car-arrow svg { width: 22px; height: 22px; }
#numfox-worlds .car-arrow:hover { background: var(--panel-2); border-color: var(--stroke-2); transform: scale(1.08); }
#numfox-worlds .car-arrow:active { transform: scale(0.95); }
#numfox-worlds .car-count { font-family: "JetBrains Mono", monospace; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--txt-faint); min-width: 168px; text-align: center; }
#numfox-worlds .car-count i { font-style: normal; color: var(--txt-dim); font-weight: 700; }

/* ── responsive ── */
@media (width <= 820px){
  #numfox-worlds .spot { grid-template-columns: 1fr; gap: 26px; padding: 28px; }
  #numfox-worlds .spot-shot { order: -1; min-height: 340px; }
}

@media (width <= 600px){
  #numfox-worlds { padding: 56px 0; }
  #numfox-worlds .wrap { padding: 0 18px; }
  #numfox-worlds .spot { padding: 22px 16px; gap: 14px; border-radius: 22px; }
  #numfox-worlds .spot h3 { font-size: clamp(25px,7.4vw,34px); margin: 11px 0; }
  #numfox-worlds .spot p { font-size: 15px; margin: 0 0 16px; }
  #numfox-worlds .coachbox { font-size: 13px; padding: 11px 13px; }

  /* show only ONE phone on mobile — hide the layered back phone, center the front */
  #numfox-worlds .spot-shot { min-height: 280px; width: 100%; overflow: hidden; }
  #numfox-worlds .spot-shot .shot-stack { max-width: 320px; }
  #numfox-worlds .spot-shot .shot-back { display: none; }
  #numfox-worlds .spot-shot .shot-front { width: 162px; transform: none; }
  #numfox-worlds .spot-shot.single .shot-front { width: 162px; transform: none; }
  #numfox-worlds .car-arrow { width: 44px; height: 44px; }
  #numfox-worlds .car-count { min-width: 0; }
}

@media (width <= 520px){ #numfox-worlds .wordpairs { grid-template-columns: 1fr; } }
