/* Matemáticas intro — premium full-bleed (carga DESPUÉS de lab-stage-premium) */

body.pl-kids[data-world="mates"] #lessonModal,
body[data-world="mates"] #lessonModal,
body.pl-kids[data-world="mates"] #lessonModal .lesson__body,
body[data-world="mates"] #lessonModal .lesson__body,
body.pl-kids[data-world="mates"] #lessonModal .modal__sheet,
body[data-world="mates"] #lessonModal .modal__sheet {
  background: transparent !important;
}
body.pl-kids[data-world="mates"] #lessonModal.lesson--story.is-open,
body[data-world="mates"] #lessonModal.lesson--story.is-open,
body.pl-kids[data-world="mates"] #lessonModal.lesson--story[aria-hidden="false"],
body[data-world="mates"] #lessonModal.lesson--story[aria-hidden="false"] {
  background:
    radial-gradient(900px 560px at 8% 0%, rgba(125, 211, 252, 0.55), transparent 55%),
    radial-gradient(820px 520px at 100% 8%, rgba(196, 181, 253, 0.5), transparent 52%),
    radial-gradient(700px 480px at 50% 100%, rgba(167, 243, 208, 0.35), transparent 50%),
    linear-gradient(160deg, #0f172a 0%, #1e1b4b 38%, #164e63 100%) !important;
}


body.pl-kids[data-world="mates"] #lessonModal.lesson--story,
body[data-world="mates"] #lessonModal.lesson--story,
body.pl-kids[data-world="mates"] #lessonModal.lesson--story .lesson,
body[data-world="mates"] #lessonModal.lesson--story .lesson,
body.pl-kids[data-world="mates"] #lessonModal.lesson--story .ltab-panel[data-panel="learn"],
body[data-world="mates"] #lessonModal.lesson--story .ltab-panel[data-panel="learn"],
body.pl-kids[data-world="mates"] #lessonModal.lesson--story .plux-story,
body[data-world="mates"] #lessonModal.lesson--story .plux-story,
body.pl-kids[data-world="mates"] #lessonModal .plux-story--mates,
body[data-world="mates"] #lessonModal .plux-story--mates {
  background:
    radial-gradient(900px 560px at 8% 0%, rgba(125, 211, 252, 0.55), transparent 55%),
    radial-gradient(820px 520px at 100% 8%, rgba(196, 181, 253, 0.5), transparent 52%),
    radial-gradient(700px 480px at 50% 100%, rgba(167, 243, 208, 0.35), transparent 50%),
    linear-gradient(160deg, #0f172a 0%, #1e1b4b 38%, #164e63 100%) !important;
}

body.pl-kids[data-world="mates"] #lessonModal.lesson--story .plux-story,
body[data-world="mates"] #lessonModal.lesson--story .plux-story,
body.pl-kids[data-world="mates"] #lessonModal .plux-story--mates {
  position: relative;
  overflow: hidden;
  min-height: 100vh !important;
  min-height: 100dvh !important;
  border-radius: 0 !important;
  padding: clamp(24px, 4vw, 48px) 20px 40px !important;
  gap: 22px !important;
}

body.pl-kids[data-world="mates"] #lessonModal.lesson--story .plux-story::before,
body[data-world="mates"] #lessonModal .plux-story--mates::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(226, 232, 240, 0.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(226, 232, 240, 0.5) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(ellipse at 50% 40%, #000 10%, transparent 70%);
}

body.pl-kids[data-world="mates"] #lessonModal.lesson--story .plux-story::after,
body[data-world="mates"] #lessonModal .plux-story--mates::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 35%;
  pointer-events: none;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.35), transparent);
}

.plux-story--mates .plux-story__row {
  position: relative;
  z-index: 1;
  width: min(980px, 100%) !important;
  gap: clamp(20px, 4vw, 40px) !important;
  align-items: center !important;
}

.plux-story--mates .plux-story__copy,
.plux-story--mates .plux-story__actions {
  position: relative;
  z-index: 1;
}

.plux-story--mates .plux-story__bubble {
  background: rgba(255, 255, 255, 0.94) !important;
  border: 1px solid rgba(255, 255, 255, 0.55) !important;
  color: #0f172a !important;
  border-radius: 24px !important;
  padding: 22px 24px !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.75) inset,
    0 24px 50px rgba(15, 23, 42, 0.28) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.plux-story--mates .plux-story__bubble:before,
.plux-story--mates .plux-story__bubble:after {
  background: rgba(255, 255, 255, 0.94) !important;
  border-color: rgba(255, 255, 255, 0.55) !important;
}

.plux-story--mates .plux-story__type {
  color: #0f172a !important;
  font-weight: 700 !important;
  letter-spacing: -0.01em;
  line-height: 1.45 !important;
}

.plux-story--mates .plux-story__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(420px, 100%);
}

.plux-story--mates .plux-story__cta {
  width: min(360px, 100%);
  background: linear-gradient(180deg, #a5b4fc 0%, #6366f1 55%, #4f46e5 100%) !important;
  color: #fff !important;
  border: 0 !important;
  border-radius: 999px !important;
  padding: 14px 28px !important;
  font-weight: 800 !important;
  letter-spacing: 0.01em;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.35) inset,
    0 14px 28px rgba(79, 70, 229, 0.45) !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.plux-story--mates .plux-story__cta.is-ready:hover {
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.4) inset,
    0 18px 32px rgba(79, 70, 229, 0.5) !important;
}

.plux-story--mates .plux-story__cta.is-ready:active {
  transform: translateY(1px);
}

.plux-story--mates .plux-story__skip {
  color: rgba(226, 232, 240, 0.82) !important;
  text-decoration: none !important;
  font-weight: 600 !important;
  opacity: 0.9;
}
.plux-story--mates .plux-story__skip:hover {
  color: #fff !important;
  text-decoration: underline !important;
}

/* —— Personaje premium —— */
.plux-matescoach {
  --s: clamp(8rem, 18vw, 11.5rem);
  position: relative;
  z-index: 1;
  width: var(--s);
  height: calc(var(--s) * 1.24);
  flex-shrink: 0;
}

.plux-matescoach__stage {
  position: absolute;
  inset: 0;
  animation: plMatesSoftBob 5.2s ease-in-out infinite;
}

@keyframes plMatesSoftBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.plux-matescoach__glow {
  position: absolute;
  left: 50%;
  top: 56%;
  width: 86%;
  height: 34%;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse, rgba(165, 180, 252, 0.55), transparent 70%);
  filter: blur(10px);
  animation: plMatesGlow 5.2s ease-in-out infinite;
}

@keyframes plMatesGlow {
  0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.95; transform: translate(-50%, -50%) scale(1.1); }
}

.plux-matescoach__spark {
  position: absolute;
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 12px rgba(165, 180, 252, 0.8);
  opacity: 0.7;
  animation: plMatesSpark 6s ease-in-out infinite;
}
.plux-matescoach__spark:nth-child(1) { top: 10%; left: 8%; animation-delay: 0s; }
.plux-matescoach__spark:nth-child(2) {
  top: 16%; right: 6%; animation-delay: 0.9s;
  border-radius: 0.1em;
  background: #c4b5fd;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  box-shadow: none;
}
.plux-matescoach__spark:nth-child(3) { bottom: 20%; left: 4%; animation-delay: 1.6s; background: #6ee7b7; }
.plux-matescoach__spark:nth-child(4) { bottom: 24%; right: 2%; animation-delay: 2.2s; background: #fde68a; }

@keyframes plMatesSpark {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.45; }
  50% { transform: translateY(-5px) scale(1.1); opacity: 0.95; }
}

.plux-matescoach__ear {
  position: absolute;
  top: 36%;
  width: 15%;
  height: 17%;
  background: linear-gradient(180deg, #eef2ff, #c7d2fe);
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  z-index: 0;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.18);
}
.plux-matescoach__ear--l { left: 10%; }
.plux-matescoach__ear--r { right: 10%; }

.plux-matescoach__head {
  position: absolute;
  left: 50%;
  top: 10%;
  width: 70%;
  height: 58%;
  transform: translateX(-50%);
  z-index: 1;
  background: linear-gradient(165deg, #ffffff 0%, #eef2ff 48%, #dde4ff 100%);
  border-radius: 48% 48% 44% 44% / 52% 52% 46% 46%;
  border: 2px solid rgba(255, 255, 255, 0.75);
  box-shadow:
    0 16px 36px rgba(15, 23, 42, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  animation: plMatesHeadIn 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes plMatesHeadIn {
  from { opacity: 0; transform: translateX(-50%) translateY(12px) scale(0.94); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

.plux-matescoach__brow {
  position: absolute;
  top: 33%;
  width: 13%;
  height: 3px;
  background: rgba(79, 70, 229, 0.28);
  border-radius: 999px;
}
.plux-matescoach__brow--l { left: 27%; transform: rotate(-6deg); }
.plux-matescoach__brow--r { right: 27%; transform: rotate(6deg); }

.plux-matescoach__eye {
  position: absolute;
  top: 39%;
  width: 15%;
  aspect-ratio: 1;
  background: #fff;
  border-radius: 50%;
  border: 2px solid rgba(15, 23, 42, 0.08);
  overflow: hidden;
  box-shadow: inset 0 -2px 5px rgba(99, 102, 241, 0.1);
  animation: plMatesBlink 5.4s ease-in-out infinite;
}
.plux-matescoach__eye--l { left: 27%; }
.plux-matescoach__eye--r { right: 27%; animation-delay: 0.1s; }

.plux-matescoach__pupil {
  display: block;
  position: absolute;
  left: 28%;
  top: 28%;
  width: 46%;
  height: 46%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #64748b, #0f172a 72%);
  animation: plMatesGlance 6.2s ease-in-out infinite;
}
.plux-matescoach__pupil::after {
  content: "";
  position: absolute;
  top: 12%;
  left: 16%;
  width: 38%;
  height: 38%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
}

@keyframes plMatesGlance {
  0%, 48%, 100% { transform: translate(0, 0); }
  58% { transform: translate(16%, 5%); }
  72% { transform: translate(-6%, 4%); }
}

@keyframes plMatesBlink {
  0%, 91%, 100% { transform: scaleY(1); }
  94% { transform: scaleY(0.1); }
}

.plux-matescoach__blush {
  position: absolute;
  top: 54%;
  width: 13%;
  height: 7%;
  border-radius: 50%;
  background: rgba(251, 146, 160, 0.42);
}
.plux-matescoach__blush--l { left: 17%; }
.plux-matescoach__blush--r { right: 17%; }

.plux-matescoach__smile {
  position: absolute;
  left: 50%;
  top: 63%;
  width: 26%;
  height: 13%;
  transform: translateX(-50%);
  border: 2.5px solid #6366f1;
  border-top: 0;
  border-radius: 0 0 999px 999px;
  background: transparent;
  box-sizing: border-box;
}

.plux-matescoach__body {
  position: absolute;
  left: 50%;
  bottom: 5%;
  width: 48%;
  height: 27%;
  transform: translateX(-50%);
  z-index: 1;
  background: linear-gradient(180deg, #a5b4fc 0%, #6366f1 55%, #4f46e5 100%);
  border-radius: 42% 42% 38% 38% / 58% 58% 42% 42%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 14px 28px rgba(79, 70, 229, 0.4);
  animation: plMatesBodyIn 0.95s 0.06s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes plMatesBodyIn {
  from { opacity: 0; transform: translateX(-50%) translateY(14px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.plux-matescoach__badge {
  position: absolute;
  left: 50%;
  bottom: 13%;
  transform: translateX(-50%);
  z-index: 2;
  width: 18%;
  height: 10%;
  background: linear-gradient(180deg, #fef3c7, #fbbf24);
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 3px 0 rgba(180, 83, 9, 0.22);
}
.plux-matescoach__badge::before {
  content: "π";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 800 0.58em/1 "Bricolage Grotesque", system-ui, sans-serif;
  color: #92400e;
}

.plux-matescoach__tag {
  position: absolute;
  left: 50%;
  bottom: -1.2rem;
  transform: translateX(-50%);
  z-index: 2;
  white-space: nowrap;
  font: 700 0.72rem/1 "Bricolage Grotesque", "Trebuchet MS", system-ui, sans-serif;
  letter-spacing: 0.02em;
  color: #eef2ff;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 0.36rem 0.82rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.25);
}

.plux-matescoach--mini { --s: 5.8rem; }

@media (max-width: 720px) {
  .plux-story--mates .plux-story__row {
    flex-direction: column;
    align-items: center;
  }
  .plux-matescoach {
    --s: clamp(6.4rem, 42vw, 8.4rem);
  }
}
