/* ===== Kids Robotics Lab + Instruction stage ===== */

/* ===== MAP FULL BLEED — mundoroboticoyelectronica repeat-y ===== */
@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@600;700;800&display=swap");

body.pl-kids[data-world="robot"] #app,
body.theme-robot #app,
html.theme-robot body #app,
body[data-world="robot"] #app,
#app.theme-robot-map {
  font-family: Outfit, Fredoka, Nunito, system-ui, sans-serif;
  background-color: #ffffff !important;
  background-image: none !important;
  min-height: 100vh;
  max-width: none !important;
}

body.pl-kids[data-world="robot"] #starfield,
body.theme-robot #starfield,
html.theme-robot #starfield,
body[data-world="robot"] #starfield {
  display: none !important;
}

body.pl-kids[data-world="robot"] .hud,
body.theme-robot .hud,
body[data-world="robot"] .hud,
#app.theme-robot-map .hud {
  background: rgba(255, 255, 255, 0.94) !important;
  border-bottom: 2px solid #ddd6fe !important;
  box-shadow: 0 6px 18px rgba(42, 31, 69, 0.1);
  color: #2a1f45 !important;
  backdrop-filter: blur(10px);
  position: relative;
  z-index: 30;
}

body.pl-kids[data-world="robot"] .hud__name,
body.theme-robot .hud__name,
#app.theme-robot-map .hud__name {
  color: #2a1f45 !important;
  font-weight: 800;
}

body.pl-kids[data-world="robot"] .stat,
body.pl-kids[data-world="robot"] .lang,
body.pl-kids[data-world="robot"] .hud__back,
body.theme-robot .stat,
body.theme-robot .lang,
body.theme-robot .hud__back,
#app.theme-robot-map .stat,
#app.theme-robot-map .lang,
#app.theme-robot-map .hud__back {
  background: #f5f3ff !important;
  border: 2px solid #c4b5fd !important;
  color: #2a1f45 !important;
  font-weight: 800;
}

body[data-world="robot"] #mapwrap.mapwrap,
body[data-world="robot"] .mapwrap.mapwrap--robot,
body.pl-kids[data-world="robot"] .mapwrap--lingo,
body.pl-kids[data-world="robot"] .mapwrap--robot,
.mapwrap--robot {
  position: relative !important;
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 8px 0 120px !important;
  min-height: calc(100vh - 64px) !important;
  background-color: #ffffff !important;
  background-image: url("../assets/robotlab/map-bg-ui.png") !important;
  background-size: 100% auto !important;
  background-position: center top !important;
  background-repeat: repeat-y !important;
}

body[data-world="robot"] .mapwrap--lingo::before,
body.pl-kids[data-world="robot"] .mapwrap--lingo::before,
.mapwrap--robot::before {
  display: none !important;
}

.mapwrap--robot .mappath {
  position: absolute !important;
  inset: 0 !important;
  z-index: 1 !important;
  pointer-events: none !important;
  opacity: 0.72;
}

.mapwrap--robot .mappath .lingo-path-bg {
  stroke: rgba(255, 255, 255, 0.95);
  stroke-width: 16;
  stroke-linecap: round;
  fill: none;
}

.mapwrap--robot .mappath .lingo-path-fg {
  stroke: #a855f7;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 10 12;
  fill: none;
  filter: drop-shadow(0 1px 2px rgba(168, 85, 247, 0.25));
}

.mapwrap--robot .map {
  position: relative !important;
  z-index: 4 !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, 300px);
  margin: 0 auto;
  padding: 6px 8px 40px;
  box-sizing: border-box;
}

.mapwrap--robot .node,
.mapwrap--robot .unit-banner--lingo,
.mapwrap--robot .map-lingo-hero {
  position: relative;
  z-index: 5;
  transform: none !important;
}

.mapwrap--robot .map-lingo-hero--robot,
.mapwrap--robot .map-lingo-hero {
  display: flex !important;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 4px 0 12px !important;
  padding: 8px 10px !important;
  background: rgba(255, 255, 255, 0.94) !important;
  border: 2px solid #c4b5fd !important;
  border-radius: 16px !important;
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.12) !important;
  backdrop-filter: blur(6px);
}

.mapwrap--robot .map-lingo-hero__mascot {
  width: 52px !important;
  height: 52px !important;
  object-fit: contain !important;
  flex: 0 0 auto;
}

.mapwrap--robot .map-lingo-hero__bubble {
  margin: 0;
  color: #2a1f45 !important;
  font-family: Outfit, Fredoka, Nunito, sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
  line-height: 1.2;
}

.mapwrap--robot .map-lingo-hero__bubble small {
  display: block;
  margin-top: 2px;
  color: #7c3aed !important;
  font-weight: 600;
  font-size: 0.68rem;
}

.mapwrap--robot .unit-banner--lingo {
  display: flex !important;
  align-items: center;
  gap: 10px;
  width: auto !important;
  max-width: 100%;
  margin: 0 0 14px !important;
  padding: 8px 14px !important;
  border-radius: 18px !important;
  border: 3px solid #fff !important;
  color: #fff !important;
  font-family: Fredoka, Nunito, sans-serif;
  box-shadow: 0 6px 0 rgba(42, 31, 69, 0.14), 0 10px 22px rgba(124, 58, 237, 0.18) !important;
  background: linear-gradient(135deg, #c084fc, #7c3aed) !important;
}

.mapwrap--robot .unit-banner--lingo::after { display: none !important; }

.mapwrap--robot .unit-banner.u2 { background: linear-gradient(135deg, #60a5fa, #2563eb) !important; }
.mapwrap--robot .unit-banner.u3 { background: linear-gradient(135deg, #fbbf24, #d97706) !important; }
.mapwrap--robot .unit-banner.u4 { background: linear-gradient(135deg, #34d399, #059669) !important; }
.mapwrap--robot .unit-banner.u5 { background: linear-gradient(135deg, #22d3ee, #0891b2) !important; }
.mapwrap--robot .unit-banner.u6 { background: linear-gradient(135deg, #fb923c, #ea580c) !important; }
.mapwrap--robot .unit-banner.u7 { background: linear-gradient(135deg, #f472b6, #db2777) !important; }
.mapwrap--robot .unit-banner.u8 { background: linear-gradient(135deg, #4ade80, #16a34a) !important; }
.mapwrap--robot .unit-banner.u9 { background: linear-gradient(135deg, #818cf8, #4f46e5) !important; }
.mapwrap--robot .unit-banner.u10 { background: linear-gradient(135deg, #38bdf8, #0284c7) !important; }
.mapwrap--robot .unit-banner.u11 { background: linear-gradient(135deg, #f87171, #dc2626) !important; }

.mapwrap--robot .unit-banner__emoji { font-size: 1rem; }

.mapwrap--robot .unit-banner__kicker {
  display: inline;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.92;
  margin-right: 6px;
}

.mapwrap--robot .unit-banner__title {
  display: inline;
  font-size: 0.82rem;
  font-weight: 800;
}

.mapwrap--robot .unit-banner__text {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0;
}

.mapwrap--robot .node {
  margin: 22px auto !important;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mapwrap--robot .node__btn,
.mapwrap--robot .node--lingo .node__btn {
  width: 78px !important;
  height: 78px !important;
  border-radius: 50% !important;
  font-size: 34px !important;
  border: 4px solid #fff !important;
  background: linear-gradient(180deg, #c4b5fd, #7c3aed) !important;
  box-shadow: 0 8px 0 #5b21b6, 0 12px 24px rgba(124, 58, 237, 0.28), inset 0 2px 0 rgba(255, 255, 255, 0.35) !important;
  color: #fff !important;
}

.mapwrap--robot .node--eng-robot .node__btn {
  background: linear-gradient(180deg, #fbbf24, #d97706) !important;
  box-shadow: 0 8px 0 #b45309, 0 12px 24px rgba(217, 119, 6, 0.28), inset 0 2px 0 rgba(255, 255, 255, 0.35) !important;
}
.mapwrap--robot .node--eng-circuit .node__btn {
  background: linear-gradient(180deg, #34d399, #059669) !important;
  box-shadow: 0 8px 0 #047857, 0 12px 24px rgba(5, 150, 105, 0.28), inset 0 2px 0 rgba(255, 255, 255, 0.35) !important;
}
.mapwrap--robot .node--eng-rover .node__btn,
.mapwrap--robot .node--eng-arm .node__btn,
.mapwrap--robot .node--eng-sumo .node__btn {
  background: linear-gradient(180deg, #60a5fa, #2563eb) !important;
  box-shadow: 0 8px 0 #1d4ed8, 0 12px 24px rgba(37, 99, 235, 0.28), inset 0 2px 0 rgba(255, 255, 255, 0.35) !important;
}
.mapwrap--robot .node--eng-kit .node__btn,
.mapwrap--robot .node--eng-tinker .node__btn {
  background: linear-gradient(180deg, #f472b6, #db2777) !important;
  box-shadow: 0 8px 0 #be185d, 0 12px 24px rgba(219, 39, 119, 0.28), inset 0 2px 0 rgba(255, 255, 255, 0.35) !important;
}

.mapwrap--robot .node--done .node__btn {
  background: linear-gradient(180deg, #86efac, #22c55e) !important;
  box-shadow: 0 8px 0 #15803d, 0 12px 24px rgba(34, 197, 94, 0.28), inset 0 2px 0 rgba(255, 255, 255, 0.4) !important;
}

.mapwrap--robot .node--active .node__btn {
  background: linear-gradient(180deg, #fde68a, #f59e0b) !important;
  box-shadow: 0 8px 0 #b45309, 0 12px 28px rgba(245, 158, 11, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.5) !important;
  animation: robotMapPulse 1.4s ease-in-out infinite;
}

@keyframes robotMapPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.mapwrap--robot .node--active::before {
  content: "¡JUEGA!" !important;
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.58rem;
  font-weight: 800;
  background: #7c3aed;
  color: #fff;
  border: 2px solid #fff;
  z-index: 6;
}

.mapwrap--robot .node--boss .node__btn {
  width: 92px !important;
  height: 92px !important;
  font-size: 40px !important;
  background: linear-gradient(180deg, #a78bfa, #5b21b6) !important;
  box-shadow: 0 10px 0 #4c1d95, 0 14px 30px rgba(91, 33, 182, 0.35), inset 0 2px 0 rgba(255, 255, 255, 0.35) !important;
}

.mapwrap--robot .node--locked .node__btn {
  background: linear-gradient(180deg, #e2e8f0, #94a3b8) !important;
  box-shadow: 0 8px 0 #64748b, inset 0 2px 0 rgba(255, 255, 255, 0.4) !important;
}

.mapwrap--robot .node__label { margin-top: 8px; }

.mapwrap--robot .node__labelpill {
  display: inline-block !important;
  padding: 6px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96) !important;
  border: 2px solid #ddd6fe !important;
  color: #2a1f45 !important;
  font-weight: 800;
  font-size: 0.78rem;
  box-shadow: 0 4px 0 rgba(124, 58, 237, 0.12);
}

.mapwrap--robot .node--done .node__labelpill {
  color: #14532d !important;
  background: #ecfdf5 !important;
  border-color: #86efac !important;
}

.mapwrap--robot .node--active .node__labelpill {
  color: #92400e !important;
  background: #fffbeb !important;
  border-color: #fde68a !important;
}

.mapwrap--robot .stars { font-size: 0.7rem; margin-top: 4px; }

@media (min-width: 900px) {
  .mapwrap--robot {
    background-size: 100% auto !important;
    background-repeat: repeat-y !important;
  }
  .mapwrap--robot .map { width: min(100%, 320px); }
}

@media (max-width: 560px) {
  .mapwrap--robot { padding: 4px 0 100px !important; }
  .mapwrap--robot .map { width: min(100%, 280px); }
  .mapwrap--robot .node__btn,
  .mapwrap--robot .node--lingo .node__btn {
    width: 72px !important;
    height: 72px !important;
  }
}

/* —— Instructions: robot + copy side by side (balanced) —— */
body.pl-kids[data-world="robot"] #lessonModal.lesson--story .plux-story {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  gap: 0 !important;
  min-height: 100vh !important;
  padding: 0 !important;
  background:
    radial-gradient(ellipse 70% 45% at 18% 28%, rgba(192, 132, 252, 0.38), transparent 55%),
    radial-gradient(ellipse 55% 40% at 88% 75%, rgba(56, 189, 248, 0.16), transparent 50%),
    linear-gradient(165deg, #1e0b33 0%, #2d1450 42%, #150822 100%);
}
body.pl-kids[data-world="robot"] #lessonModal.lesson--story .plux-story__row {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: stretch !important;
  justify-content: center !important;
  gap: 16px !important;
  width: 100% !important;
  max-width: 1100px !important;
  margin: 0 auto !important;
  padding: 18px 16px 8px !important;
  box-sizing: border-box;
  min-height: 0 !important;
}
body.pl-kids[data-world="robot"] #lessonModal.lesson--story .pl-css-robot-stage {
  flex: 0 0 auto;
}
body.pl-kids[data-world="robot"] #lessonModal.lesson--story .pl-robot-coach {
  display: none !important;
}
body.pl-kids[data-world="robot"] #lessonModal.lesson--story .plux-story__copy {
  flex: 1 1 280px;
  min-width: min(100%, 280px);
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
}
body.pl-kids[data-world="robot"] #lessonModal.lesson--story .plux-story__bubble {
  margin: 0 !important;
  max-width: none !important;
  width: 100% !important;
  min-height: 160px;
  background: #fffafc !important;
  border: 2px solid rgba(192, 132, 252, 0.55) !important;
  color: #2a1240 !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}
body.pl-kids[data-world="robot"] #lessonModal.lesson--story .plux-story__type {
  color: #2a1240 !important;
  font-size: 16px !important;
  font-weight: 750 !important;
  line-height: 1.45 !important;
  min-height: 4.5em;
}
body.pl-kids[data-world="robot"] #lessonModal.lesson--story .plux-story__bubble:before,
body.pl-kids[data-world="robot"] #lessonModal.lesson--story .plux-story__bubble:after {
  display: none !important;
}
body.pl-kids[data-world="robot"] #lessonModal.lesson--story .plux-story__cta,
body.pl-kids[data-world="robot"] #lessonModal.lesson--story .plux-story__skip {
  margin: 0 !important;
  align-self: stretch;
}
body.pl-kids[data-world="robot"] #lessonModal.lesson--story .plux-story__cta {
  background: linear-gradient(135deg, #c084fc, #a855f7 40%, #7c3aed) !important;
  color: #fff !important;
}
body.pl-kids[data-world="robot"] #lessonModal.lesson--story .plux-story__skip {
  color: rgba(237, 220, 255, 0.85) !important;
  margin-bottom: 20px !important;
}

@media (min-width: 860px) {
  body.pl-kids[data-world="robot"] #lessonModal.lesson--story .plux-story__row {
    flex-wrap: nowrap !important;
    padding: 28px 24px 16px !important;
    min-height: min(78vh, 720px);
  }
}

/* —— Lab: undo anim full-bleed damage on classic / tinker robot studios —— */
body.pl-kids[data-world="robot"] #lessonModal.lesson--lab .ltab-panel[data-panel="build"],
body.pl-kids[data-world="robot"] #lessonModal:has([data-panel="build"].is-active) .ltab-panel[data-panel="build"] {
  overflow: auto !important;
  padding: 10px 12px 110px !important;
  background: #12081f;
}

body.pl-kids[data-world="robot"] #lessonModal.lesson--lab .studio,
body.pl-kids[data-world="robot"] #lessonModal:has([data-panel="build"].is-active) .studio {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px) !important;
  gap: 12px !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  padding: 0 !important;
  overflow: visible !important;
  align-items: start;
}
body.pl-kids[data-world="robot"] #lessonModal.lesson--lab .studio.studio--tinker,
body.pl-kids[data-world="robot"] #lessonModal.lesson--lab .studio.studio--gamedev,
body.pl-kids[data-world="robot"] #lessonModal.lesson--lab .studio.studio--pro {
  grid-template-columns: 1fr !important;
}

body.pl-kids[data-world="robot"] #lessonModal.lesson--lab .studio__blocks {
  display: block !important;
  height: min(520px, 62vh) !important;
  max-height: 62vh !important;
  border-radius: 14px !important;
  overflow: hidden !important;
  border: 1px solid rgba(192, 132, 252, 0.28) !important;
  background: #1a1030 !important;
}

body.pl-kids[data-world="robot"] #lessonModal.lesson--lab .studio__stage {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  min-height: 0 !important;
  height: auto !important;
  overflow: visible !important;
}

body.pl-kids[data-world="robot"] #lessonModal.lesson--lab .studio__objective {
  display: block !important;
  background: rgba(168, 85, 247, 0.16) !important;
  border: 1px solid rgba(192, 132, 252, 0.35) !important;
  color: #f3e8ff !important;
  border-radius: 12px !important;
  padding: 10px 12px !important;
  font-weight: 800 !important;
  font-size: 13px !important;
  line-height: 1.35 !important;
}

/* Stop the giant empty gameHolder */
body.pl-kids[data-world="robot"] #lessonModal.lesson--lab .studio #gameHolder.studio__canvas,
body.pl-kids[data-world="robot"] #lessonModal:has([data-panel="build"].is-active) .studio #gameHolder.studio__canvas,
body.pl-kids[data-world="robot"] #lessonModal.lesson--lab .studio.studio--tinker #gameHolder.studio__canvas,
body.pl-kids[data-world="robot"] #lessonModal.lesson--lab .studio.studio--gamedev #gameHolder.studio__canvas {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  overflow: visible !important;
  background: #0c1526 !important;
  border-radius: 14px !important;
  border: 1px solid rgba(192, 132, 252, 0.22) !important;
  display: block !important;
}

body.pl-kids[data-world="robot"] #lessonModal.lesson--lab .studio:not(.studio--tinker):not(.studio--gamedev) #gameHolder.studio__canvas {
  aspect-ratio: 1 / 1 !important;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}

/* Tinker / kit: show checklist below sim */
body.pl-kids[data-world="robot"] #lessonModal.lesson--lab .tinkerview,
body.pl-kids[data-world="robot"] #lessonModal.lesson--lab .kitview {
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
}
body.pl-kids[data-world="robot"] #lessonModal.lesson--lab .tinkerview__missions,
body.pl-kids[data-world="robot"] #lessonModal.lesson--lab .kitview__missions {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  margin-top: 12px !important;
  padding: 12px !important;
  border-radius: 14px !important;
  background: rgba(30, 11, 51, 0.92) !important;
  border: 1px solid rgba(192, 132, 252, 0.35) !important;
  color: #f3e8ff !important;
}

/* Actions + code peek usable */
body.pl-kids[data-world="robot"] #lessonModal.lesson--lab .studio__actions,
body.pl-kids[data-world="robot"] #lessonModal:has([data-panel="build"].is-active) .studio:not(.studio--gamedev):not(.studio--unitylab):not(.studio--tinker):not(.studio--pro) .studio__actions {
  position: sticky !important;
  bottom: 56px;
  left: auto !important;
  right: auto !important;
  z-index: 40;
  display: flex !important;
  flex-wrap: wrap;
  gap: 8px !important;
  padding: 10px !important;
  margin: 4px 0 0 !important;
  border-radius: 14px;
  background: rgba(24, 12, 40, 0.96) !important;
  border: 1px solid rgba(192, 132, 252, 0.28);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
body.pl-kids[data-world="robot"] #lessonModal.lesson--lab .studio__msg {
  position: static !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  color: #e9d5ff !important;
}
body.pl-kids[data-world="robot"] #lessonModal.lesson--lab .codepeek {
  position: relative !important;
  z-index: 41;
  margin-top: 8px;
  border-radius: 14px;
  border: 1px solid rgba(192, 132, 252, 0.35);
  background: #0f172a;
  max-height: 42vh;
  overflow: auto;
}
body.pl-kids[data-world="robot"] #lessonModal.lesson--lab .codepeek.hidden {
  display: none !important;
}
body.pl-kids[data-world="robot"] #lessonModal.lesson--lab #codePeekToggle {
  display: inline-flex !important;
}

/* Collapsible howto + progress in robot lab */
body.pl-kids[data-world="robot"] #lessonModal.lesson--lab .plux-howto-wrap,
body.pl-kids[data-world="robot"] #plRobotLabChrome .plux-howto-wrap {
  border-color: rgba(192, 132, 252, 0.35) !important;
  background: linear-gradient(135deg, #2a1450, #1e293b) !important;
  color: #f8fafc;
}
body.pl-kids[data-world="robot"] #lessonModal.lesson--lab .plux-howto-wrap > summary,
body.pl-kids[data-world="robot"] .plux-howto-title {
  color: #e9d5ff !important;
}
body.pl-kids[data-world="robot"] #lessonModal.lesson--lab .plux-howto li {
  color: #e2e8f0 !important;
}
body.pl-kids[data-world="robot"] #plRobotLabChrome {
  margin: 0 0 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
body.pl-kids[data-world="robot"] .pl-robot-progress {
  border: 1px solid rgba(192, 132, 252, 0.35);
  border-radius: 14px;
  background: rgba(30, 11, 51, 0.88);
  padding: 10px 12px;
  color: #f3e8ff;
}
body.pl-kids[data-world="robot"] .pl-robot-progress h4 {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #c4b5fd;
}
body.pl-kids[data-world="robot"] .pl-robot-progress label {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.35;
  margin: 0 0 6px;
  cursor: pointer;
}
body.pl-kids[data-world="robot"] .pl-robot-progress input {
  margin-top: 2px;
  accent-color: #a855f7;
}

@media (max-width: 860px) {
  body.pl-kids[data-world="robot"] #lessonModal.lesson--lab .studio {
    grid-template-columns: 1fr !important;
  }
  body.pl-kids[data-world="robot"] #lessonModal.lesson--lab .studio__blocks {
    height: min(360px, 48vh) !important;
  }
}
