:root {
  color-scheme: dark;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  --ink: #effaff;
  --muted: #93acba;
  --panel: rgba(8, 25, 40, .86);
  --panel-solid: #0a2134;
  --line: rgba(141, 223, 245, .18);
  --cyan: #70e6ff;
  --green: #75f0ba;
  --red: #ff7f98;
  --amber: #ffd67c;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #05121e;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 12%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 27rem),
    radial-gradient(circle at 18% 80%, rgba(38, 123, 186, .18), transparent 32rem),
    #05121e;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(112, 230, 255, .68);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.academy-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto minmax(190px, 1fr);
  gap: 20px;
  align-items: center;
  min-height: 72px;
  padding: 10px 26px;
  border-bottom: 1px solid var(--line);
  background: rgba(4, 15, 25, .9);
  box-shadow: 0 12px 35px rgba(0, 0, 0, .25);
  backdrop-filter: blur(20px);
}

.academy-back {
  color: #b9d5df;
  font-size: .8rem;
  font-weight: 800;
  text-decoration: none;
}

.academy-back:hover {
  color: #fff;
}

.academy-brand {
  display: grid;
  gap: 2px;
  text-align: center;
}

.academy-brand span,
.academy-account > span {
  color: #718d9b;
  font-size: .64rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.academy-brand strong {
  max-width: 430px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.academy-account {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
}

.academy-account button,
.lab-hud button {
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #d9f3fa;
  background: rgba(255, 255, 255, .05);
  cursor: pointer;
}

.academy-account button:hover,
.lab-hud button:hover {
  border-color: var(--cyan);
  color: #fff;
}

.academy-shell {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  width: min(1780px, 100%);
  min-height: calc(100vh - 72px);
  margin: 0 auto;
}

.campaign-rail {
  position: sticky;
  top: 72px;
  align-self: start;
  height: calc(100vh - 72px);
  overflow: auto;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(12, 35, 54, .96), rgba(5, 19, 31, .98)),
    #071725;
}

.campaign-course {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .035);
}

.campaign-course img {
  width: 50px;
  height: 50px;
  object-fit: cover;
}

.campaign-course div,
.campaign-course div span,
.campaign-course div strong {
  min-width: 0;
}

.campaign-course div {
  display: grid;
  gap: 4px;
}

.campaign-course span,
.campaign-rewards > span {
  color: #7692a1;
  font-size: .62rem;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.campaign-course strong {
  overflow: hidden;
  font-size: .83rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.campaign-map {
  position: relative;
  display: grid;
  gap: 9px;
  margin: 26px 0;
}

.campaign-line {
  position: absolute;
  top: 24px;
  bottom: 24px;
  left: 25px;
  width: 2px;
  background: linear-gradient(var(--cyan), rgba(112, 230, 255, .08));
}

.campaign-node {
  position: relative;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 76px;
  padding: 8px 9px 8px 0;
  color: #c7dae2;
  text-decoration: none;
}

.campaign-node > span {
  z-index: 1;
  display: grid;
  width: 50px;
  height: 50px;
  border: 2px solid #36566a;
  border-radius: 50%;
  place-items: center;
  color: #6f94a6;
  background: #092033;
  box-shadow: 0 0 0 5px #092033;
  font-size: .68rem;
  font-weight: 900;
}

.campaign-node div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.campaign-node small {
  color: #668594;
  font-size: .59rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.campaign-node strong {
  overflow: hidden;
  font-size: .77rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.campaign-node i {
  color: #708d9b;
  font-size: .65rem;
  font-style: normal;
}

.campaign-node:hover,
.campaign-node.is-current {
  background: linear-gradient(90deg, rgba(112, 230, 255, .09), transparent);
}

.campaign-node:hover > span,
.campaign-node.is-current > span {
  border-color: var(--cyan);
  color: #03131e;
  background: var(--cyan);
  box-shadow: 0 0 0 5px #092033, 0 0 26px rgba(112, 230, 255, .44);
}

.campaign-node.is-complete > span {
  border-color: var(--green);
  color: #06241a;
  background: var(--green);
}

.campaign-node.is-complete i {
  color: var(--green);
}

.campaign-rewards {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 90% 15%, color-mix(in srgb, var(--accent) 35%, transparent), transparent 45%),
    rgba(255, 255, 255, .035);
}

.campaign-rewards div {
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.campaign-rewards strong {
  color: var(--cyan);
  font-size: 1.65rem;
}

.campaign-rewards small {
  color: #7893a1;
}

.campaign-rewards .stars {
  display: block;
  overflow: hidden;
  color: var(--amber);
  font-size: 1rem;
  line-height: 1.5;
}

.academy-main {
  min-width: 0;
}

.phase-track {
  position: sticky;
  top: 72px;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 0 clamp(14px, 3vw, 42px);
  border-bottom: 1px solid var(--line);
  background: rgba(5, 18, 30, .9);
  backdrop-filter: blur(16px);
}

.phase-track button {
  position: relative;
  display: flex;
  gap: 9px;
  align-items: center;
  justify-content: center;
  min-height: 66px;
  border: 0;
  border-bottom: 3px solid transparent;
  color: #657f8e;
  background: transparent;
}

.phase-track button::after {
  position: absolute;
  right: -4px;
  width: 8px;
  height: 8px;
  border: 1px solid #345467;
  border-radius: 50%;
  background: #092033;
  content: "";
}

.phase-track button:last-child::after {
  display: none;
}

.phase-track span {
  display: grid;
  width: 26px;
  height: 26px;
  border: 1px solid #355469;
  border-radius: 50%;
  place-items: center;
  font-size: .65rem;
}

.phase-track strong {
  font-size: .72rem;
  text-transform: uppercase;
}

.phase-track button.is-active {
  border-bottom-color: var(--cyan);
  color: #fff;
}

.phase-track button.is-active span {
  border-color: var(--cyan);
  color: #06131e;
  background: var(--cyan);
  box-shadow: 0 0 18px rgba(112, 230, 255, .35);
}

.phase-track button.is-complete {
  color: var(--green);
}

.phase-track button.is-complete span {
  border-color: var(--green);
}

.academy-phase {
  min-height: calc(100vh - 138px);
  animation: phase-in .42s ease both;
}

.mission-brief {
  display: grid;
  grid-template-columns: minmax(390px, .92fr) minmax(480px, 1.08fr);
  min-height: calc(100vh - 138px);
}

.brief-scene,
.tutorial-visual {
  position: relative;
  overflow: hidden;
  min-height: 600px;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--accent) 48%, transparent), transparent 34%),
    #061522;
  perspective: 1000px;
}

.starscape,
.tutorial-grid {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, .85) 1px, transparent 1px),
    radial-gradient(circle, rgba(112, 230, 255, .6) 1px, transparent 1px);
  background-position: 0 0, 37px 53px;
  background-size: 83px 83px, 131px 131px;
  opacity: .28;
}

.perspective-grid {
  position: absolute;
  right: -35%;
  bottom: -20%;
  left: -35%;
  height: 64%;
  background-image:
    linear-gradient(rgba(112, 230, 255, .2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(112, 230, 255, .2) 1px, transparent 1px);
  background-size: 56px 56px;
  transform: rotateX(66deg);
  transform-origin: bottom;
  animation: grid-flow 5s linear infinite;
}

.mission-core,
.tutorial-object {
  position: absolute;
  top: 42%;
  left: 50%;
  width: clamp(160px, 18vw, 245px);
  aspect-ratio: 1;
  border: 2px solid rgba(124, 236, 255, .7);
  transform: translate(-50%, -50%) rotate(45deg);
  animation: core-turn 12s linear infinite;
  transform-style: preserve-3d;
}

.mission-core::before,
.mission-core::after,
.tutorial-object::before,
.tutorial-object::after {
  position: absolute;
  content: "";
}

.mission-core::before,
.tutorial-object::before {
  inset: 22%;
  border: 2px solid rgba(255, 255, 255, .36);
}

.mission-core::after,
.tutorial-object::after {
  inset: -26%;
  border: 1px solid rgba(124, 236, 255, .32);
  border-radius: 50%;
}

.mission-core i,
.mission-core b,
.mission-core em,
.tutorial-object i,
.tutorial-object b,
.tutorial-object em {
  position: absolute;
  display: block;
  border-radius: 50%;
}

.mission-core i,
.tutorial-object i {
  inset: 30%;
  background: radial-gradient(circle at 30% 25%, #fff, var(--cyan) 13%, var(--accent) 60%, #321e7d 84%);
  box-shadow: 0 0 35px var(--cyan), 0 0 110px color-mix(in srgb, var(--accent) 75%, transparent);
}

.mission-core b,
.tutorial-object b {
  top: -12px;
  left: 50%;
  width: 14px;
  height: 14px;
  background: var(--amber);
  box-shadow: 0 0 18px var(--amber);
}

.mission-core em,
.tutorial-object em {
  right: -31%;
  bottom: 10%;
  width: 10px;
  height: 10px;
  background: var(--green);
  box-shadow: 0 0 17px var(--green);
}

.floating-formula,
.tutorial-formula {
  position: absolute;
  right: 8%;
  bottom: 12%;
  left: 8%;
  padding: 17px 20px;
  border: 1px solid rgba(124, 236, 255, .22);
  color: #dffaff;
  background: rgba(5, 18, 31, .68);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .25);
  backdrop-filter: blur(14px);
  text-align: center;
  font-family: Consolas, monospace;
  font-size: clamp(1rem, 2vw, 1.35rem);
}

.mission-number {
  position: absolute;
  top: 7%;
  left: 7%;
  color: rgba(255, 255, 255, .08);
  font-size: clamp(7rem, 14vw, 13rem);
  font-weight: 950;
  line-height: 1;
}

.brief-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(38px, 6vw, 88px);
}

.phase-eyebrow {
  color: var(--cyan);
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.brief-copy h1,
.phase-heading h1,
.activity-summary h1,
.exam-sidebar h1,
.result-stage h1 {
  margin: 12px 0 15px;
  letter-spacing: -.035em;
}

.brief-copy h1 {
  max-width: 780px;
  font-size: clamp(2.6rem, 5vw, 5.8rem);
  line-height: .96;
}

.brief-copy > p,
.phase-heading p,
.activity-summary > p,
.exam-sidebar > p,
.result-stage > p {
  color: var(--muted);
  line-height: 1.7;
}

.brief-copy > p {
  max-width: 720px;
  margin: 0 0 22px;
  font-size: 1.02rem;
}

.brief-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
}

.brief-facts article {
  padding: 15px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, .025);
}

.brief-facts article:last-child {
  border-right: 0;
}

.brief-facts span,
.activity-result span,
.result-scores span {
  color: #728d9b;
  font-size: .62rem;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.brief-facts p {
  margin: 7px 0 0;
  color: #c4d8e1;
  font-size: .77rem;
  line-height: 1.5;
}

.player-start {
  display: grid;
  gap: 9px;
  margin-top: 24px;
}

.player-start label,
.activity-form > label:first-child {
  color: #bed6df;
  font-size: .73rem;
  font-weight: 900;
}

.player-start > div {
  display: flex;
}

.player-start input,
.activity-form textarea {
  width: 100%;
  border: 1px solid #315469;
  border-radius: 0;
  color: #fff;
  background: rgba(255, 255, 255, .055);
}

.player-start input {
  min-width: 0;
  padding: 14px 15px;
}

.player-start button,
.activity-form > button,
.phase-next button,
.exam-card > button,
.workspace-actions button,
.trajectory-controls > button,
.force-controls > button,
.particle-console > button,
.builder-controls > button {
  border: 0;
  color: #04131d;
  background: var(--cyan);
  box-shadow: 0 10px 30px rgba(112, 230, 255, .18);
  font-weight: 900;
  cursor: pointer;
}

.player-start button {
  flex: 0 0 auto;
  padding: 14px 19px;
}

.player-start button:hover,
.activity-form > button:hover,
.phase-next button:hover:not(:disabled),
.exam-card > button:hover,
.workspace-actions button:hover,
.trajectory-controls > button:hover,
.force-controls > button:hover,
.particle-console > button:hover,
.builder-controls > button:hover {
  color: #06131e;
  background: #fff;
}

.player-start small {
  color: #698694;
  font-size: .68rem;
}

#start-status,
#activity-status {
  min-height: 1.2em;
  margin: 0;
  color: var(--red);
  font-size: .75rem;
}

.phase-heading {
  display: flex;
  gap: 25px;
  align-items: flex-end;
  justify-content: space-between;
  padding: 40px clamp(20px, 4vw, 58px) 22px;
}

.phase-heading.compact {
  padding-bottom: 16px;
}

.phase-heading h1 {
  font-size: clamp(2rem, 4vw, 4rem);
}

.phase-heading p {
  max-width: 720px;
  margin: 0;
}

.phase-score {
  display: grid;
  flex: 0 0 auto;
  gap: 5px;
  padding: 13px 17px;
  border: 1px solid var(--line);
  text-align: right;
}

.phase-score span {
  color: #6d8b9a;
  font-size: .62rem;
  font-weight: 900;
  text-transform: uppercase;
}

.phase-score strong {
  color: var(--cyan);
  font-size: 1.3rem;
}

.tutorial-stage {
  display: grid;
  grid-template-columns: minmax(380px, 1.1fr) minmax(350px, .9fr);
  min-height: 560px;
  margin: 0 clamp(20px, 4vw, 58px) 50px;
  border: 1px solid var(--line);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .25);
}

.tutorial-visual {
  min-height: 560px;
}

.tutorial-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(30px, 5vw, 70px);
  background: rgba(8, 27, 43, .84);
}

.tutorial-card > span {
  color: rgba(112, 230, 255, .25);
  font-size: 5rem;
  font-weight: 950;
  line-height: 1;
}

.tutorial-card h2 {
  margin: 12px 0;
  font-size: clamp(1.7rem, 3vw, 3rem);
}

.tutorial-card p {
  color: #a8bec9;
  font-size: 1rem;
  line-height: 1.75;
}

.tutorial-controls {
  display: flex;
  gap: 9px;
  margin-top: 22px;
}

.tutorial-controls button {
  padding: 12px 15px;
  border: 1px solid var(--line);
  color: #c8e0e8;
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.tutorial-controls button:last-child {
  border-color: var(--cyan);
  color: #06131e;
  background: var(--cyan);
}

.tutorial-controls button:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.lab-hud {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr)) auto;
  gap: 1px;
  margin: 28px clamp(20px, 4vw, 58px) 0;
  border: 1px solid var(--line);
  background: var(--line);
}

.lab-hud > div {
  display: grid;
  gap: 5px;
  padding: 13px 16px;
  background: #081c2d;
}

.lab-hud span {
  color: #6d8998;
  font-size: .59rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.lab-hud strong {
  font-family: Consolas, monospace;
}

.lab-hud button {
  margin: 10px;
  border-radius: 0;
}

.lab-root {
  margin: 0 clamp(20px, 4vw, 58px);
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 85% 12%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 33%),
    rgba(6, 21, 34, .78);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .27);
}

.lab-feedback {
  min-height: 0;
  margin: 16px clamp(20px, 4vw, 58px) 0;
  padding: 0;
  border-left: 4px solid transparent;
  color: var(--muted);
  transition: padding .2s ease;
}

.lab-feedback.is-error,
.lab-feedback.is-success {
  padding: 14px 18px;
  background: rgba(255, 255, 255, .035);
}

.lab-feedback.is-error {
  border-left-color: var(--red);
}

.lab-feedback.is-success {
  border-left-color: var(--green);
}

.lab-feedback strong {
  color: #fff;
}

.lab-feedback p {
  margin: 5px 0 0;
  line-height: 1.5;
}

.phase-next {
  display: flex;
  justify-content: flex-end;
  padding: 18px clamp(20px, 4vw, 58px) 48px;
}

.phase-next button,
.activity-form > button,
.exam-card > button {
  padding: 14px 19px;
}

.phase-next button:disabled {
  color: #6a818c;
  background: #233846;
  box-shadow: none;
  cursor: not-allowed;
}

/* Programación por bloques */
.block-lab {
  display: grid;
  grid-template-columns: 250px minmax(320px, 1fr) minmax(260px, .72fr);
  min-height: 610px;
}

.block-palette,
.block-workspace,
.program-device {
  min-width: 0;
  padding: 20px;
}

.block-palette {
  border-right: 1px solid var(--line);
  background: rgba(4, 17, 28, .65);
}

.block-palette header,
.block-workspace header {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  margin-bottom: 16px;
}

.block-palette header span,
.block-workspace header span {
  color: #e7f8fc;
  font-size: .8rem;
  font-weight: 900;
}

.block-palette header small {
  color: #6f8997;
  font-size: .62rem;
}

.block-palette > div {
  display: grid;
  gap: 9px;
}

.logic-block,
.workspace-block {
  position: relative;
  border: 0;
  color: #fff;
  background: #246eac;
  box-shadow: inset -10px 0 rgba(0, 0, 0, .12);
}

.logic-block {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 0 9px;
  width: 100%;
  padding: 12px 13px;
  text-align: left;
  cursor: grab;
  clip-path: polygon(0 0, 17px 0, 23px 6px, 42px 6px, 48px 0, 100% 0, 100% calc(100% - 6px), 48px calc(100% - 6px), 42px 100%, 23px 100%, 17px calc(100% - 6px), 0 calc(100% - 6px));
}

.logic-block i {
  grid-row: 1 / 3;
  width: 8px;
  height: 8px;
  margin-top: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .78);
}

.logic-block span {
  font-size: .73rem;
  font-weight: 800;
  line-height: 1.35;
}

.logic-block small {
  margin-top: 4px;
  color: rgba(255, 255, 255, .68);
  font-size: .55rem;
  text-transform: uppercase;
}

.category-control {
  background: #bb6750;
}

.category-data,
.category-variables {
  background: #8b62c5;
}

.category-event,
.category-math {
  background: #c1932e;
}

.category-logic,
.category-loops {
  background: #3d8d62;
}

.category-output {
  background: #2e7ba8;
}

.category-function,
.category-functions {
  background: #7155bf;
}

.category-list {
  background: #2f8c87;
}

.block-workspace {
  display: flex;
  flex-direction: column;
}

.block-workspace header > div {
  display: grid;
  gap: 2px;
}

.block-workspace header strong {
  color: #6f8997;
  font-size: .62rem;
  font-weight: 700;
}

.block-workspace header button {
  border: 0;
  color: var(--red);
  background: transparent;
  font-size: .68rem;
  font-weight: 900;
  cursor: pointer;
}

.workspace-dropzone {
  position: relative;
  flex: 1;
  min-height: 420px;
  padding: 22px;
  border: 1px dashed #365c71;
  background-image:
    linear-gradient(rgba(112, 230, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(112, 230, 255, .035) 1px, transparent 1px);
  background-size: 24px 24px;
  transition: border-color .15s ease, background .15s ease;
}

.workspace-dropzone.is-dragover {
  border-color: var(--cyan);
  background-color: rgba(112, 230, 255, .06);
}

.workspace-empty {
  position: absolute;
  inset: 0;
  display: grid;
  margin: 0;
  place-items: center;
  color: #587785;
  font-size: .77rem;
}

.workspace-block {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 6px;
  padding: 12px 13px;
  cursor: grab;
  animation: block-drop .22s ease both;
}

.workspace-block > span {
  color: rgba(255, 255, 255, .64);
  font-family: Consolas, monospace;
  font-size: .65rem;
}

.workspace-block strong {
  font-size: .73rem;
}

.workspace-block div {
  display: flex;
  gap: 3px;
}

.workspace-block button {
  width: 25px;
  height: 25px;
  border: 1px solid rgba(255, 255, 255, .25);
  color: #fff;
  background: rgba(0, 0, 0, .14);
  cursor: pointer;
}

.workspace-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.workspace-actions button {
  padding: 12px 17px;
}

.program-device {
  border-left: 1px solid var(--line);
  background: rgba(3, 14, 24, .65);
}

.device-screen {
  padding: 16px;
  border: 7px solid #152e3d;
  border-radius: 18px;
  background: #020a10;
  box-shadow: 0 20px 40px rgba(0, 0, 0, .25);
}

.device-screen > span,
.trace-panel > strong {
  color: #688492;
  font-size: .6rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

#program-code {
  min-height: 235px;
  padding: 14px 0;
  overflow: auto;
  font-family: Consolas, monospace;
}

#program-code p {
  color: #526e7b;
  font-size: .72rem;
}

.code-line {
  display: block;
  margin: 4px 0;
  padding: 7px 9px;
  border-left: 3px solid currentColor;
  color: #a8dff1;
  background: rgba(255, 255, 255, .04);
  font-size: .69rem;
  white-space: pre-wrap;
}

#program-output {
  display: block;
  min-height: 42px;
  padding: 11px;
  color: var(--amber);
  background: #07131b;
  font-family: Consolas, monospace;
  font-size: .72rem;
}

#program-output.is-running {
  color: var(--green);
}

#program-output.has-error {
  color: var(--red);
}

.trace-panel {
  margin-top: 16px;
  padding: 15px;
  border: 1px solid var(--line);
}

.trace-panel ol {
  margin: 12px 0 0;
  padding-left: 18px;
  color: #9db4bf;
  font-size: .7rem;
  line-height: 1.7;
}

.trace-panel li {
  animation: trace-in .32s ease both;
}

/* Experiencias de Fundamentos de Programación */
body[data-course-id="fundamentos-programacion"] {
  --accent: #5568ef;
  background:
    radial-gradient(circle at 86% 11%, rgba(111, 94, 236, .28), transparent 28rem),
    radial-gradient(circle at 12% 88%, rgba(53, 195, 202, .17), transparent 30rem),
    #071522;
}

body[data-course-id="fundamentos-programacion"] .brief-copy h1 {
  max-width: 850px;
}

.mission-character {
  position: absolute;
  top: 42%;
  left: 50%;
  z-index: 3;
  display: grid;
  gap: 10px;
  place-items: center;
  transform: translate(-50%, -50%);
}

.mission-character span {
  display: grid;
  width: clamp(112px, 13vw, 170px);
  aspect-ratio: 1;
  border: 8px solid rgba(255, 255, 255, .2);
  border-radius: 34%;
  place-items: center;
  background: linear-gradient(145deg, #fff, #bdefff);
  box-shadow: 0 25px 75px rgba(0, 0, 0, .28), 0 0 55px color-mix(in srgb, var(--accent) 45%, transparent);
  color: #18304f;
  font-family: Consolas, monospace;
  font-size: clamp(3.1rem, 7vw, 6.4rem);
  transform: rotate(-5deg);
  animation: mascot-bob 3.2s ease-in-out infinite;
}

.mission-character strong {
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px;
  color: #fff;
  background: rgba(4, 18, 30, .62);
  backdrop-filter: blur(10px);
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

body[data-course-id="fundamentos-programacion"] .mission-core {
  width: clamp(220px, 23vw, 320px);
  border-style: dashed;
  opacity: .45;
}

body[data-challenge="sequence"] .brief-scene {
  background:
    radial-gradient(circle at 50% 35%, rgba(117, 217, 255, .35), transparent 34%),
    linear-gradient(145deg, #11365c, #10213d);
}

body[data-challenge="robot"] .brief-scene {
  background:
    radial-gradient(circle at 50% 35%, rgba(105, 235, 190, .32), transparent 34%),
    linear-gradient(145deg, #0d4a4c, #0a2437);
}

body[data-challenge="decision"] .brief-scene {
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 196, 93, .32), transparent 34%),
    linear-gradient(145deg, #543e1e, #171e36);
}

body[data-challenge="loop"] .brief-scene {
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 132, 112, .3), transparent 34%),
    linear-gradient(145deg, #542a3b, #171d36);
}

body[data-challenge="debug"] .brief-scene {
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 115, 148, .32), transparent 34%),
    linear-gradient(145deg, #511f39, #191b36);
}

body[data-challenge="function"] .brief-scene {
  background:
    radial-gradient(circle at 50% 35%, rgba(172, 137, 255, .34), transparent 34%),
    linear-gradient(145deg, #382866, #171b36);
}

body[data-challenge="list"] .brief-scene {
  background:
    radial-gradient(circle at 50% 35%, rgba(71, 207, 215, .34), transparent 34%),
    linear-gradient(145deg, #155261, #151e39);
}

.code-bridge {
  margin-top: 16px;
  padding: 15px;
  border: 1px solid var(--line);
  background: rgba(83, 105, 239, .08);
}

.code-bridge header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.code-bridge header > div {
  display: grid;
  gap: 3px;
}

.code-bridge header span {
  color: #7fe4ff;
  font-size: .59rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.code-bridge header strong {
  color: #d9edf4;
  font-size: .72rem;
}

.code-bridge nav {
  display: flex;
  gap: 3px;
}

.code-bridge nav button {
  padding: 6px 8px;
  border: 1px solid #34576b;
  color: #8fa9b4;
  background: transparent;
  font-size: .58rem;
  font-weight: 900;
  cursor: pointer;
}

.code-bridge nav button.is-active {
  border-color: #7fe4ff;
  color: #071522;
  background: #7fe4ff;
}

#translated-code {
  min-height: 118px;
  margin: 12px 0 8px;
  padding: 13px;
  overflow: auto;
  color: #b8f1d8;
  background: #020b12;
  font-family: Consolas, monospace;
  font-size: .68rem;
  line-height: 1.65;
  white-space: pre-wrap;
}

.code-bridge > p {
  margin: 0;
  color: #7893a1;
  font-size: .64rem;
  line-height: 1.5;
}

.mini-code {
  max-height: 150px;
  margin: 13px 0;
  padding: 12px;
  overflow: auto;
  border-left: 4px solid #5568ef;
  border-radius: 0 10px 10px 0;
  color: #276a57;
  background: #eef7f5;
  font-family: Consolas, monospace;
  font-size: .66rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

.lab-coach {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin: 16px clamp(20px, 4vw, 58px) 0;
  padding: 16px 18px;
  border: 1px solid rgba(255, 214, 124, .32);
  border-left: 4px solid var(--amber);
  background: linear-gradient(90deg, rgba(255, 214, 124, .08), rgba(255, 255, 255, .025));
}

.coach-avatar {
  display: grid;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  place-items: center;
  background: rgba(255, 214, 124, .14);
  font-size: 1.4rem;
}

.lab-coach > div:last-child {
  display: grid;
  gap: 4px;
}

.lab-coach span {
  color: var(--amber);
  font-size: .6rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.lab-coach strong {
  color: #fff;
}

.lab-coach p {
  margin: 2px 0 0;
  color: #a9bec8;
  font-size: .76rem;
  line-height: 1.6;
}

.console-kicker {
  color: #66ddeb;
  font-size: .62rem;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.robot-lab,
.decision-lab,
.loop-lab,
.debug-lab,
.function-lab,
.list-lab {
  display: grid;
  grid-template-columns: minmax(460px, 1.25fr) minmax(330px, .75fr);
  min-height: 610px;
  color: #18364a;
  background: #f5fafc;
}

.robot-board-wrap,
.decision-scene,
.loop-factory,
.debug-editor,
.function-machine,
.list-playground {
  position: relative;
  min-width: 0;
  padding: clamp(24px, 4vw, 44px);
  overflow: hidden;
  border-right: 1px solid #d9e7ec;
}

.robot-console,
.decision-console,
.loop-console,
.debug-console,
.function-console,
.list-console {
  padding: clamp(25px, 4vw, 44px);
  color: #24495d;
  background: #fff;
}

.robot-console h2,
.decision-console h2,
.loop-console h2,
.debug-console h2,
.function-console h2,
.list-console h2 {
  margin: 8px 0 10px;
  color: #15384d;
  font-size: clamp(1.55rem, 2.5vw, 2.45rem);
  line-height: 1.06;
}

.robot-console > p,
.decision-console > p,
.loop-console > p,
.debug-console > p,
.function-console > p,
.list-console > p {
  color: #6b8390;
  font-size: .78rem;
  line-height: 1.6;
}

.friendly-callout {
  display: flex;
  gap: 13px;
  align-items: center;
  margin-bottom: 22px;
  padding: 13px 15px;
  border: 1px solid #cde8e5;
  border-radius: 15px;
  background: #eafaf7;
}

.friendly-callout span {
  flex: 0 0 auto;
  color: #167a72;
  font-size: .76rem;
  font-weight: 900;
}

.friendly-callout p {
  margin: 0;
  color: #52756f;
  font-size: .7rem;
}

.robot-board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  width: min(520px, 100%);
  aspect-ratio: 1;
  margin: 0 auto;
  overflow: hidden;
  border: 8px solid #fff;
  border-radius: 24px;
  background: #dceef3;
  box-shadow: 0 20px 55px rgba(32, 82, 101, .14);
}

.robot-cell {
  display: grid;
  aspect-ratio: 1;
  border-right: 1px solid rgba(57, 117, 137, .12);
  border-bottom: 1px solid rgba(57, 117, 137, .12);
  place-items: center;
  background: rgba(255, 255, 255, .58);
  font-size: clamp(1.2rem, 3vw, 2rem);
}

.robot-cell:nth-child(2n) {
  background: rgba(235, 249, 249, .8);
}

.robot-cell.is-goal {
  background: #fff5d8;
  box-shadow: inset 0 0 0 3px #ffd676;
}

.robot-player {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  width: 20%;
  height: 20%;
  place-items: center;
  transform: translate(var(--robot-x), var(--robot-y));
  transition: transform .24s ease;
  pointer-events: none;
}

.robot-player span {
  display: grid;
  width: 70%;
  aspect-ratio: 1;
  border: 3px solid #fff;
  border-radius: 35%;
  place-items: center;
  background: #63d8cc;
  box-shadow: 0 8px 18px rgba(21, 86, 84, .24);
  font-size: clamp(1rem, 3vw, 2.1rem);
}

.command-palette {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 22px 0 15px;
}

.command-palette button {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 8px;
  align-items: center;
  min-height: 54px;
  padding: 8px 11px;
  border: 1px solid #cae0e6;
  border-radius: 12px;
  color: #31566a;
  background: #f6fafb;
  text-align: left;
  cursor: pointer;
}

.command-palette button:hover {
  border-color: #4ecbbd;
  background: #eafaf7;
}

.command-palette button span {
  display: grid;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  place-items: center;
  color: #fff;
  background: #4abeb3;
  font-size: 1.2rem;
}

.command-palette button small {
  font-weight: 800;
}

.robot-program {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 74px;
  padding: 11px;
  border: 1px dashed #b8cfd8;
  border-radius: 12px;
  background: #f8fbfc;
}

.robot-program p {
  margin: auto;
  color: #8ba0aa;
  font-size: .7rem;
}

.robot-program span {
  display: grid;
  grid-template-columns: 17px 1fr;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  place-items: center;
  color: #fff;
  background: #5568ef;
  font-size: 1.1rem;
  font-weight: 900;
}

.robot-program i {
  color: rgba(255, 255, 255, .65);
  font-size: .55rem;
  font-style: normal;
}

.console-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 15px;
}

.console-actions button,
.decision-console > button,
.loop-console > button,
.function-console > button {
  padding: 11px 13px;
  border: 1px solid #c9dce3;
  border-radius: 10px;
  color: #456474;
  background: #f7fafb;
  font-size: .7rem;
  font-weight: 900;
  cursor: pointer;
}

.console-actions button.primary,
.decision-console > button,
.loop-console > button,
.function-console > button {
  border-color: #5268eb;
  color: #fff;
  background: #5268eb;
}

.decision-scene {
  display: grid;
  grid-template-rows: auto auto 1fr;
  align-content: center;
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 210, 102, .24), transparent 32%),
    #f8f3e8;
}

.student-pass {
  display: grid;
  width: min(260px, 80%);
  margin: 0 auto;
  padding: 19px;
  border: 1px solid #ecd6aa;
  border-radius: 20px;
  place-items: center;
  background: #fff;
  box-shadow: 0 18px 45px rgba(104, 76, 29, .1);
}

.student-pass > span {
  color: #a47b29;
  font-size: .58rem;
  font-weight: 900;
  letter-spacing: .08em;
}

.student-avatar {
  display: grid;
  width: 70px;
  height: 70px;
  margin: 11px;
  border-radius: 50%;
  place-items: center;
  background: #fff1be;
  font-size: 2.4rem;
}

.student-pass strong {
  color: #634b1c;
}

.student-pass small {
  margin-top: 5px;
  color: #8e7a55;
  font-size: .65rem;
}

.decision-path {
  display: grid;
  gap: 5px;
  margin: 17px 0;
  place-items: center;
  color: #8b764b;
  font-size: .7rem;
  font-weight: 800;
}

.decision-path i {
  width: 2px;
  height: 25px;
  background: #d8bb7d;
}

.decision-gates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.decision-gates article {
  display: grid;
  gap: 7px;
  min-height: 130px;
  padding: 18px;
  border: 2px solid transparent;
  border-radius: 20px;
  place-content: center;
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 12px 30px rgba(84, 62, 22, .07);
  text-align: center;
  transition: transform .2s ease, border-color .2s ease;
}

.decision-gates article span {
  font-size: 2rem;
}

.decision-gates article strong {
  font-size: .75rem;
}

.decision-gates article.is-active {
  border-color: #f0b936;
  box-shadow: 0 16px 35px rgba(220, 160, 23, .18);
  transform: translateY(-6px);
}

.rule-builder {
  display: grid;
  gap: 9px;
  margin: 22px 0;
}

.rule-builder label {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 11px;
  border: 1px solid #d6e4e9;
  border-radius: 12px;
  background: #f7fafb;
}

.rule-builder label > span {
  color: #6c8491;
  font-size: .62rem;
  font-weight: 900;
}

.rule-builder select {
  min-width: 0;
  padding: 8px;
  border: 1px solid #c5d9e1;
  color: #284e62;
  background: #fff;
}

.friendly-tip {
  margin-bottom: 17px;
  padding: 13px;
  border-left: 4px solid #f2b634;
  background: #fff8e7;
}

.friendly-tip strong {
  color: #885f09;
  font-size: .66rem;
}

.friendly-tip p {
  margin: 4px 0 0;
  color: #826e42;
  font-size: .68rem;
  line-height: 1.55;
}

.loop-factory {
  background:
    linear-gradient(rgba(104, 83, 149, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(104, 83, 149, .055) 1px, transparent 1px),
    #f5f1fb;
  background-size: 34px 34px;
}

.factory-sign {
  display: grid;
  gap: 5px;
  width: min(260px, 80%);
  margin: 0 auto 22px;
  padding: 13px;
  border-radius: 14px;
  color: #fff;
  background: #6d5ac8;
  box-shadow: 0 15px 35px rgba(80, 57, 159, .2);
  text-align: center;
}

.factory-sign span {
  font-size: .6rem;
  font-weight: 900;
  text-transform: uppercase;
}

.factory-sign strong {
  font-size: 1.55rem;
}

.factory-machine {
  position: relative;
  width: min(500px, 100%);
  min-height: 320px;
  margin: 0 auto;
  border: 10px solid #fff;
  border-radius: 35px;
  background: linear-gradient(145deg, #d8d1f5, #aca0e2);
  box-shadow: 0 24px 55px rgba(66, 44, 145, .14);
}

.machine-window {
  position: absolute;
  top: 48px;
  left: calc(50% - 65px);
  display: grid;
  width: 130px;
  height: 90px;
  border: 8px solid #7868bf;
  border-radius: 17px;
  place-items: center;
  color: #aef4db;
  background: #18253b;
  font-family: Consolas, monospace;
  font-size: 1.5rem;
}

.machine-wheel {
  position: absolute;
  top: 48px;
  right: 10%;
  display: grid;
  width: 75px;
  height: 75px;
  border: 8px dotted #7463bd;
  border-radius: 50%;
  place-items: center;
  color: #5c4ca9;
  font-size: 2rem;
  animation: simple-turn 6s linear infinite;
}

.conveyor {
  position: absolute;
  right: 8%;
  bottom: 43px;
  left: 8%;
  display: flex;
  gap: 8px;
  align-items: flex-end;
  min-height: 70px;
  padding: 13px;
  overflow: hidden;
  border-bottom: 12px solid #7463bd;
}

.conveyor i {
  display: grid;
  flex: 0 0 38px;
  height: 38px;
  border-radius: 10px;
  place-items: center;
  color: #fff;
  background: #ef7a82;
  font-size: .68rem;
  font-style: normal;
  animation: conveyor-in .25s ease both;
}

.factory-counter {
  display: flex;
  gap: 8px;
  align-items: baseline;
  justify-content: center;
  margin-top: 20px;
}

.factory-counter span,
.factory-counter small {
  color: #796f91;
  font-size: .65rem;
}

.factory-counter strong {
  color: #5c48b1;
  font-size: 2rem;
}

.loop-console label,
.function-console label {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin: 22px 0;
  color: #4a6575;
  font-size: .75rem;
  font-weight: 800;
}

.loop-console label input,
.function-console label input {
  grid-column: 1 / -1;
  width: 100%;
  accent-color: #5e6eea;
}

.loop-console output,
.function-console output {
  color: #5668e8;
  font-family: Consolas, monospace;
}

.loop-preview,
.function-live {
  display: grid;
  gap: 6px;
  margin: 24px 0;
  padding: 16px;
  border: 1px solid #d6e2e7;
  border-radius: 14px;
  background: #f6f9fa;
}

.loop-preview span {
  color: #718995;
  font-size: .63rem;
}

.loop-preview strong {
  color: #5c4dbc;
  font-size: 1.5rem;
}

.loop-preview code,
.function-live code {
  color: #758995;
  font-size: .7rem;
}

.debug-editor {
  color: #cfdae2;
  background: #111a27;
}

.debug-editor > header {
  display: flex;
  gap: 15px;
  align-items: center;
  justify-content: space-between;
  margin: -44px -44px 22px;
  padding: 14px 22px;
  background: #202b3a;
}

.debug-editor header span {
  font-family: Consolas, monospace;
  font-size: .72rem;
}

.debug-editor header small {
  color: #ff899d;
  font-size: .62rem;
}

.debug-objective {
  margin-bottom: 18px;
  padding: 14px;
  border-left: 4px solid #72ddeb;
  background: rgba(114, 221, 235, .06);
}

.debug-objective strong {
  color: #72ddeb;
  font-size: .65rem;
}

.debug-objective p {
  margin: 5px 0 0;
  font-size: .72rem;
  line-height: 1.55;
}

#debug-lines {
  margin: 0;
  padding: 0;
  list-style: none;
}

#debug-lines li {
  margin-bottom: 5px;
}

#debug-lines button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 12px;
  border: 1px solid transparent;
  color: #bad0db;
  background: #172332;
  text-align: left;
  cursor: pointer;
}

#debug-lines button:hover,
#debug-lines li.is-selected button {
  border-color: #e8899c;
  background: #263143;
}

#debug-lines li.is-fixed button {
  border-color: #66dba6;
  background: rgba(44, 130, 91, .22);
}

#debug-lines span {
  color: #61788a;
  font-family: Consolas, monospace;
  font-size: .65rem;
}

#debug-lines code {
  overflow: hidden;
  font-size: .72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#debug-lines i {
  color: #8398a5;
  font-size: .59rem;
  font-style: normal;
}

.bug-mascot {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 20px;
  color: #8fa5b0;
  font-size: .67rem;
}

.bug-mascot span {
  font-size: 2rem;
}

.bug-mascot p {
  margin: 0;
}

.patch-options {
  display: grid;
  gap: 9px;
  margin-top: 22px;
}

.patch-options button {
  display: grid;
  gap: 5px;
  padding: 13px;
  border: 1px solid #d6e3e8;
  border-radius: 12px;
  color: #35586b;
  background: #f7fafb;
  text-align: left;
  cursor: pointer;
}

.patch-options button:hover {
  border-color: #e06f88;
  background: #fff5f7;
}

.patch-options span {
  font-size: .72rem;
  font-weight: 900;
}

.patch-options code {
  color: #7c929d;
  font-size: .65rem;
}

.function-machine {
  display: grid;
  grid-template-columns: 110px minmax(250px, 1fr) 110px;
  gap: 22px;
  align-items: center;
  background:
    radial-gradient(circle at 50% 50%, rgba(114, 100, 225, .2), transparent 40%),
    #f1effb;
}

.function-input,
.function-output {
  display: grid;
  gap: 7px;
  aspect-ratio: 1;
  border-radius: 50%;
  place-content: center;
  background: #fff;
  box-shadow: 0 15px 38px rgba(60, 47, 130, .13);
  text-align: center;
}

.function-input span,
.function-output span {
  color: #7d759c;
  font-size: .6rem;
  font-weight: 900;
  text-transform: uppercase;
}

.function-input strong,
.function-output strong {
  color: #5d4eb4;
  font-size: 2rem;
}

.function-body {
  position: relative;
  display: grid;
  min-height: 270px;
  padding: 28px;
  border: 8px solid #fff;
  border-radius: 36px;
  place-content: center;
  background: linear-gradient(145deg, #7465d5, #4e65c9);
  box-shadow: 0 24px 55px rgba(67, 50, 152, .22);
  text-align: center;
}

.function-name {
  color: #d6d1ff;
  font-family: Consolas, monospace;
  font-size: .7rem;
}

.function-body > div {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin: 20px 0;
  color: #fff;
}

.function-body i,
.function-body strong {
  display: grid;
  width: 49px;
  height: 49px;
  border-radius: 13px;
  place-items: center;
  background: rgba(255, 255, 255, .18);
  font-size: 1.2rem;
  font-style: normal;
}

.function-body b {
  font-size: 1.4rem;
}

.function-body small {
  color: #d2cff1;
  font-size: .63rem;
  line-height: 1.45;
}

.data-pulse {
  position: absolute;
  top: 50%;
  left: 12%;
  display: grid;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  place-items: center;
  color: #fff;
  background: #ef7da0;
  box-shadow: 0 0 20px rgba(239, 125, 160, .5);
  opacity: 0;
  font-size: .7rem;
  font-weight: 900;
  pointer-events: none;
}

.data-pulse.is-running {
  animation: data-travel .8s ease both;
}

.function-live strong {
  color: #5e50b8;
  font-size: 1.4rem;
}

.list-playground {
  display: grid;
  align-content: center;
  background:
    radial-gradient(circle at 50% 40%, rgba(72, 196, 202, .18), transparent 38%),
    #ecf8f8;
}

.backpack-character {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
}

.backpack-character span {
  font-size: 3.2rem;
}

.backpack-character p {
  max-width: 270px;
  margin: 0;
  color: #577a7c;
  font-size: .72rem;
  line-height: 1.5;
}

.data-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  justify-content: center;
}

.data-list button {
  display: grid;
  width: 92px;
  height: 92px;
  border: 3px solid #fff;
  border-radius: 22px;
  place-content: center;
  color: #236a70;
  background: #c8efed;
  box-shadow: 0 10px 25px rgba(40, 109, 113, .12);
  cursor: pointer;
  transition: opacity .2s ease, transform .2s ease;
}

.data-list button:hover {
  transform: translateY(-5px);
}

.data-list button.is-collected {
  opacity: .24;
  transform: scale(.9);
}

.data-list button span {
  font-size: 1.7rem;
  font-weight: 900;
}

.data-list button small {
  color: #679296;
  font-size: .57rem;
}

.list-arrow {
  margin: 23px 0;
  color: #6d9597;
  font-size: .65rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.accumulator-bag {
  display: grid;
  gap: 5px;
  width: min(330px, 100%);
  margin: 0 auto;
  padding: 18px;
  border: 2px dashed #55b9bc;
  border-radius: 22px;
  background: #fff;
  text-align: center;
}

.accumulator-bag span {
  color: #668c8e;
  font-size: .6rem;
  font-weight: 900;
  text-transform: uppercase;
}

.accumulator-bag strong {
  color: #208087;
  font-size: 2.1rem;
}

.accumulator-bag div {
  min-height: 1.2em;
  color: #739496;
  font-family: Consolas, monospace;
  font-size: .68rem;
}

.list-code {
  display: grid;
  gap: 4px;
  margin: 22px 0;
  padding: 15px;
  border-left: 4px solid #41adb0;
  border-radius: 0 12px 12px 0;
  color: #28686c;
  background: #edf9f9;
  font-family: Consolas, monospace;
  font-size: .7rem;
}

@keyframes mascot-bob {
  50% { transform: translateY(-10px) rotate(4deg); }
}

@keyframes conveyor-in {
  from { opacity: 0; transform: translateX(-20px) scale(.7); }
}

@keyframes data-travel {
  0% { left: 12%; opacity: 1; }
  50% { left: 50%; opacity: 1; transform: scale(1.25); }
  100% { left: 86%; opacity: 0; }
}

/* Laboratorio de trayectoria */
.trajectory-lab,
.force-lab,
.chemistry-lab,
.builder-lab,
.equation-lab {
  display: grid;
  grid-template-columns: minmax(450px, 1.5fr) minmax(300px, .5fr);
  min-height: 560px;
}

.trajectory-world,
.force-world,
.atom-stage,
.builder-world,
.balance-scene {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border-right: 1px solid var(--line);
}

.trajectory-world canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 560px;
  object-fit: cover;
}

.trajectory-overlay {
  position: absolute;
  top: 22px;
  left: 22px;
  display: grid;
  gap: 5px;
  padding: 12px 15px;
  border: 1px solid var(--line);
  background: rgba(3, 15, 26, .72);
  backdrop-filter: blur(10px);
}

.trajectory-overlay span,
.live-formula span,
.force-result span,
.builder-result span,
.builder-target span,
.acceleration-target span {
  color: #7792a0;
  font-size: .59rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.trajectory-overlay strong {
  color: var(--cyan);
  font-size: 1.3rem;
}

.trajectory-controls,
.force-controls,
.particle-console,
.builder-controls,
.equation-console {
  padding: clamp(24px, 4vw, 42px);
  background: rgba(4, 17, 28, .72);
}

.live-formula {
  display: grid;
  gap: 7px;
  margin-bottom: 28px;
  padding: 16px;
  border: 1px solid var(--line);
  background: rgba(112, 230, 255, .035);
}

.live-formula strong,
.live-formula output {
  color: var(--cyan);
  font-family: Consolas, monospace;
  font-size: 1rem;
}

.trajectory-controls label,
.force-controls label,
.builder-controls label {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin: 19px 0;
  color: #cce0e7;
  font-size: .78rem;
  font-weight: 800;
}

.trajectory-controls output,
.force-controls output,
.builder-controls output {
  color: var(--cyan);
  font-family: Consolas, monospace;
}

.trajectory-controls input,
.force-controls input,
.builder-controls input {
  grid-column: 1 / -1;
  width: 100%;
  accent-color: var(--cyan);
}

.trajectory-controls dl {
  display: grid;
  gap: 1px;
  margin: 24px 0;
  background: var(--line);
}

.trajectory-controls dl div {
  display: flex;
  gap: 12px;
  align-items: baseline;
  justify-content: space-between;
  padding: 10px 12px;
  background: #091e30;
}

.trajectory-controls dt {
  color: #75909e;
  font-size: .67rem;
}

.trajectory-controls dd {
  margin: 0;
  font-family: Consolas, monospace;
  font-size: .74rem;
}

.trajectory-controls > button,
.force-controls > button,
.particle-console > button,
.builder-controls > button {
  width: 100%;
  padding: 14px;
}

/* Ecuaciones */
.balance-scene {
  min-height: 560px;
  background:
    radial-gradient(circle at 50% 28%, rgba(112, 230, 255, .14), transparent 34%),
    linear-gradient(180deg, #081d2f, #0d2b3c);
}

.balance-beam {
  position: absolute;
  top: 44%;
  left: 15%;
  width: 70%;
  height: 14px;
  background: linear-gradient(#d8f7ff, #5aa2bb);
  box-shadow: 0 0 25px rgba(112, 230, 255, .3);
}

.balance-beam i {
  position: absolute;
  top: -8px;
  left: calc(50% - 15px);
  width: 30px;
  height: 30px;
  border: 6px solid #69b9d1;
  border-radius: 50%;
  background: #092033;
}

.balance-pan {
  position: absolute;
  top: 30%;
  display: grid;
  width: 28%;
  min-height: 112px;
  border: 2px solid rgba(112, 230, 255, .35);
  place-items: center;
  background: rgba(5, 20, 33, .72);
  box-shadow: 0 18px 30px rgba(0, 0, 0, .24);
}

.balance-pan::before {
  position: absolute;
  top: 100%;
  left: 50%;
  width: 2px;
  height: 78px;
  background: #5b93a7;
  content: "";
}

.balance-pan.left {
  left: 12%;
}

.balance-pan.right {
  right: 12%;
}

.balance-pan span {
  color: var(--cyan);
  font-family: Consolas, monospace;
  font-size: clamp(1.3rem, 3vw, 2.3rem);
  font-weight: 800;
}

.balance-base {
  position: absolute;
  bottom: 8%;
  left: calc(50% - 75px);
  width: 150px;
  height: 175px;
  background: linear-gradient(90deg, transparent 40%, #477b8e 40% 60%, transparent 60%);
  clip-path: polygon(40% 0, 60% 0, 100% 100%, 0 100%);
}

.equation-console > span {
  color: #7792a0;
  font-size: .67rem;
  font-weight: 900;
  text-transform: uppercase;
}

#equation-steps {
  display: grid;
  gap: 8px;
  margin: 17px 0 26px;
}

#equation-steps strong {
  padding: 13px;
  border-left: 3px solid var(--cyan);
  background: rgba(255, 255, 255, .04);
  font-family: Consolas, monospace;
  font-size: 1.1rem;
}

.operation-tiles {
  display: grid;
  gap: 8px;
}

.operation-tiles button {
  padding: 13px;
  border: 1px solid var(--line);
  color: #cce3ea;
  background: rgba(255, 255, 255, .035);
  text-align: left;
  cursor: pointer;
}

.operation-tiles button:hover,
.operation-tiles button.is-correct {
  border-color: var(--green);
  color: #fff;
  background: rgba(117, 240, 186, .11);
}

.operation-tiles button.is-wrong {
  border-color: var(--red);
  background: rgba(255, 127, 152, .1);
}

.equation-console > p {
  color: #6f8997;
  font-size: .7rem;
  line-height: 1.6;
}

/* Física */
.force-world {
  min-height: 560px;
  background:
    linear-gradient(rgba(112, 230, 255, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(112, 230, 255, .07) 1px, transparent 1px),
    linear-gradient(180deg, #071b2c, #0d3040);
  background-size: 50px 50px, 50px 50px, auto;
}

.force-track {
  position: absolute;
  right: 7%;
  bottom: 23%;
  left: 7%;
  height: 13px;
  background: repeating-linear-gradient(90deg, #548598 0 45px, #274c5d 45px 55px);
  box-shadow: 0 18px 0 #07131c, 0 21px 0 #447284;
}

.target-zone {
  position: absolute;
  right: 10%;
  bottom: 0;
  width: 90px;
  height: 180px;
  border: 2px dashed rgba(117, 240, 186, .6);
  border-bottom: 0;
  background: linear-gradient(transparent, rgba(117, 240, 186, .12));
}

.force-cart {
  position: absolute;
  bottom: 14px;
  left: 0;
  width: 104px;
  height: 66px;
  border: 2px solid #9eeeff;
  background: linear-gradient(145deg, #318baa, #163f59);
  box-shadow: 0 0 25px rgba(112, 230, 255, .3);
}

.force-cart i,
.force-cart b {
  position: absolute;
  bottom: -16px;
  width: 25px;
  height: 25px;
  border: 6px solid #2a5265;
  border-radius: 50%;
  background: #07131d;
}

.force-cart i {
  left: 12px;
}

.force-cart b {
  right: 12px;
}

.force-cart.is-moving {
  animation: cart-drive .85s cubic-bezier(.2, .8, .3, 1) both;
}

.force-vector {
  position: absolute;
  top: 28%;
  left: 7%;
  width: 40%;
  height: 7px;
  background: linear-gradient(90deg, var(--amber), #ff905f);
  box-shadow: 0 0 18px rgba(255, 214, 124, .5);
  transition: width .2s ease;
}

.force-vector::after {
  position: absolute;
  top: -10px;
  right: -2px;
  border-width: 13px 0 13px 20px;
  border-style: solid;
  border-color: transparent transparent transparent #ff905f;
  content: "";
}

.force-vector span {
  position: absolute;
  bottom: 12px;
  color: var(--amber);
  font-family: Consolas, monospace;
  font-weight: 900;
}

.acceleration-target {
  position: absolute;
  top: 10%;
  right: 7%;
  display: grid;
  gap: 5px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  background: rgba(5, 19, 31, .72);
}

.acceleration-target strong {
  color: var(--green);
}

.force-result,
.builder-result {
  display: grid;
  gap: 5px;
  margin: 23px 0;
  padding: 15px;
  border: 1px solid var(--line);
}

.force-result strong,
.builder-result strong {
  color: var(--green);
  font-family: Consolas, monospace;
  font-size: 1.35rem;
}

/* Química */
.atom-stage {
  min-height: 560px;
  background:
    radial-gradient(circle at 50% 48%, color-mix(in srgb, var(--accent) 33%, transparent), transparent 36%),
    #071b2c;
}

.atom-nucleus {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  align-content: center;
  justify-content: center;
  width: 105px;
  height: 105px;
  padding: 17px;
  border-radius: 50%;
  background: rgba(3, 13, 22, .82);
  box-shadow: 0 0 50px rgba(112, 230, 255, .3);
  transform: translate(-50%, -50%);
}

.atom-nucleus i {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  box-shadow: 0 0 7px currentColor;
}

.atom-nucleus .proton {
  color: #ff748e;
  background: currentColor;
}

.atom-nucleus .neutron {
  color: #77d9ff;
  background: currentColor;
}

.electron-orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  border: 1px solid rgba(112, 230, 255, .35);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: orbit-spin 12s linear infinite;
}

.electron-orbit.orbit-one {
  width: 220px;
  height: 120px;
}

.electron-orbit.orbit-two {
  width: 390px;
  height: 230px;
  animation-direction: reverse;
  animation-duration: 18s;
}

.electron-orbit.orbit-three {
  width: 510px;
  height: 340px;
  animation-duration: 24s;
}

.electron-orbit i {
  position: absolute;
  top: calc(50% - 6px);
  left: calc(50% - 6px);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 15px var(--amber);
}

.electron-orbit i:nth-child(1) { transform: translateX(105px); }
.electron-orbit i:nth-child(2) { transform: translateX(-105px); }
.orbit-two i:nth-child(1) { transform: translateX(190px); }
.orbit-two i:nth-child(2) { transform: translateX(-190px); }
.orbit-two i:nth-child(3) { transform: translateY(112px); }
.orbit-two i:nth-child(4) { transform: translateY(-112px); }
.orbit-two i:nth-child(5) { transform: translate(130px, 78px); }
.orbit-two i:nth-child(6) { transform: translate(-130px, -78px); }
.orbit-two i:nth-child(7) { transform: translate(130px, -78px); }
.orbit-two i:nth-child(8) { transform: translate(-130px, 78px); }
.orbit-three i:nth-child(1) { transform: translateX(250px); }
.orbit-three i:nth-child(2) { transform: translateX(-250px); }
.orbit-three i:nth-child(3) { transform: translateY(165px); }
.orbit-three i:nth-child(4) { transform: translateY(-165px); }
.orbit-three i:nth-child(5) { transform: translate(200px, 98px); }
.orbit-three i:nth-child(6) { transform: translate(-200px, -98px); }
.orbit-three i:nth-child(7) { transform: translate(200px, -98px); }
.orbit-three i:nth-child(8) { transform: translate(-200px, 98px); }
.orbit-three i:nth-child(9) { transform: translate(85px, 155px); }
.orbit-three i:nth-child(10) { transform: translate(-85px, -155px); }

.atom-symbol {
  position: absolute;
  top: 7%;
  left: 6%;
  display: grid;
  width: 88px;
  height: 100px;
  border: 1px solid var(--cyan);
  place-content: center;
  text-align: center;
}

.atom-symbol strong {
  color: var(--cyan);
  font-size: 2.5rem;
}

.atom-symbol span {
  color: #718c99;
  font-size: .65rem;
}

.atom-readout {
  position: absolute;
  right: 6%;
  bottom: 7%;
  display: grid;
  gap: 5px;
  min-width: 180px;
  padding: 13px;
  border: 1px solid var(--line);
  background: rgba(5, 19, 31, .72);
}

.atom-readout span {
  color: #d8edf3;
  font-weight: 800;
}

.atom-readout strong {
  color: var(--amber);
  font-family: Consolas, monospace;
}

.particle-stepper {
  display: flex;
  gap: 15px;
  align-items: center;
  justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.particle-stepper > span {
  color: #bed3db;
  font-size: .75rem;
  font-weight: 800;
}

.particle-stepper div {
  display: grid;
  grid-template-columns: 34px 45px 34px;
  align-items: center;
}

.particle-stepper button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  color: #fff;
  background: rgba(255, 255, 255, .05);
  cursor: pointer;
}

.particle-stepper strong {
  text-align: center;
  font-family: Consolas, monospace;
}

.particle-console > button {
  margin-top: 25px;
}

/* Taller de área y volumen */
.builder-world {
  min-height: 560px;
  perspective: 850px;
  background:
    radial-gradient(circle at 50% 35%, rgba(112, 230, 255, .16), transparent 34%),
    #071a2b;
}

.city-grid {
  position: absolute;
  right: -30%;
  bottom: -36%;
  left: -30%;
  height: 72%;
  background-image:
    linear-gradient(rgba(112, 230, 255, .18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(112, 230, 255, .18) 1px, transparent 1px);
  background-size: 44px 44px;
  transform: rotateX(67deg);
}

.dimension-box {
  --box-w: 150px;
  --box-d: 60px;
  --box-h: 90px;
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--box-w);
  height: var(--box-h);
  transform: translate(-50%, -30%) rotateX(-12deg) rotateY(-27deg);
  transform-style: preserve-3d;
  transition: width .2s ease, height .2s ease;
}

.dimension-box.is-built {
  animation: module-build .6s ease;
}

.dimension-box .face {
  position: absolute;
  border: 1px solid rgba(180, 246, 255, .7);
  background: linear-gradient(145deg, rgba(112, 230, 255, .7), color-mix(in srgb, var(--accent) 80%, #1d3157));
  box-shadow: inset 0 0 25px rgba(255, 255, 255, .12), 0 0 25px rgba(112, 230, 255, .14);
}

.dimension-box .front {
  inset: 0;
  transform: translateZ(calc(var(--box-d) / 2));
}

.dimension-box .side {
  top: 0;
  right: calc(var(--box-d) / -2);
  width: var(--box-d);
  height: 100%;
  transform: rotateY(90deg);
}

.dimension-box .top {
  top: calc(var(--box-d) / -2);
  left: 0;
  width: 100%;
  height: var(--box-d);
  transform: rotateX(90deg);
}

.dimension-labels span,
.builder-target {
  position: absolute;
  padding: 8px 10px;
  border: 1px solid var(--line);
  color: var(--cyan);
  background: rgba(4, 16, 27, .76);
  font-family: Consolas, monospace;
  font-size: .67rem;
}

.dimension-labels span:nth-child(1) { top: 22%; left: 24%; }
.dimension-labels span:nth-child(2) { top: 31%; right: 18%; }
.dimension-labels span:nth-child(3) { right: 22%; bottom: 21%; }

.builder-target {
  top: 7%;
  left: 6%;
  display: grid;
  gap: 5px;
}

.builder-target strong {
  color: var(--green);
  font-size: 1.25rem;
}

.builder-controls label.is-disabled {
  opacity: .4;
}

/* Actividad */
.activity-layout {
  display: grid;
  grid-template-columns: minmax(340px, .8fr) minmax(450px, 1.2fr);
  width: min(1240px, calc(100% - 40px));
  min-height: 610px;
  margin: 42px auto;
  border: 1px solid var(--line);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .26);
}

.activity-summary {
  padding: clamp(32px, 5vw, 70px);
  background:
    radial-gradient(circle at 20% 15%, color-mix(in srgb, var(--accent) 43%, transparent), transparent 35%),
    #0a263a;
}

.activity-summary h1,
.exam-sidebar h1 {
  font-size: clamp(2.2rem, 4vw, 4rem);
  line-height: 1;
}

.activity-result {
  display: grid;
  gap: 9px;
  margin-top: 30px;
  padding: 20px;
  border: 1px solid var(--line);
  background: rgba(3, 15, 26, .45);
}

.activity-result strong {
  color: var(--green);
  font-size: 3.2rem;
}

.activity-result p {
  margin: 0;
  color: #99b1bc;
  font-size: .76rem;
  line-height: 1.55;
}

.activity-form {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(32px, 5vw, 70px);
  background: rgba(5, 20, 33, .75);
}

.activity-form textarea {
  min-height: 250px;
  margin: 11px 0 6px;
  padding: 16px;
  line-height: 1.65;
  resize: vertical;
}

.writing-meter {
  color: #6d8897;
  font-size: .66rem;
  text-align: right;
}

.writing-meter.is-ready {
  color: var(--green);
}

.honesty-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 22px 0;
  color: #9eb5c0;
  font-size: .74rem;
  line-height: 1.5;
}

.honesty-check input {
  margin-top: 3px;
  accent-color: var(--cyan);
}

/* Examen */
.exam-layout {
  display: grid;
  grid-template-columns: minmax(280px, .7fr) minmax(520px, 1.3fr);
  width: min(1300px, calc(100% - 40px));
  min-height: 610px;
  margin: 42px auto;
  border: 1px solid var(--line);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .25);
}

.exam-sidebar {
  padding: clamp(30px, 5vw, 65px);
  background:
    radial-gradient(circle at 20% 10%, color-mix(in srgb, var(--accent) 45%, transparent), transparent 36%),
    #09253a;
}

.exam-progress {
  display: grid;
  gap: 8px;
  margin-top: 34px;
}

.exam-progress span {
  color: #91aab6;
  font-size: .68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.exam-progress > div {
  height: 7px;
  overflow: hidden;
  background: rgba(255, 255, 255, .1);
}

.exam-progress i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--green));
  box-shadow: 0 0 14px var(--cyan);
  transition: width .25s ease;
}

.exam-sidebar dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin-top: 18px;
  background: var(--line);
}

.exam-sidebar dl div {
  display: grid;
  gap: 4px;
  padding: 14px;
  background: #071d2e;
}

.exam-sidebar dt {
  color: #718b99;
  font-size: .6rem;
  font-weight: 900;
  text-transform: uppercase;
}

.exam-sidebar dd {
  margin: 0;
  color: var(--cyan);
  font-size: 1.45rem;
  font-weight: 900;
}

.exam-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(32px, 6vw, 78px);
  background: rgba(5, 19, 31, .78);
}

#exam-formula {
  align-self: flex-start;
  padding: 8px 11px;
  border: 1px solid var(--line);
  color: var(--cyan);
  background: rgba(112, 230, 255, .045);
  font-family: Consolas, monospace;
  font-size: .72rem;
}

#exam-code {
  max-height: 180px;
  margin: 13px 0 0;
  padding: 15px;
  overflow: auto;
  border-left: 3px solid var(--cyan);
  color: #b8e8f5;
  background: #020b12;
  font-family: Consolas, monospace;
  font-size: .78rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.exam-card h2 {
  margin: 22px 0;
  font-size: clamp(1.35rem, 2.6vw, 2.35rem);
  line-height: 1.35;
}

.exam-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.exam-options button {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 72px;
  padding: 13px;
  border: 1px solid var(--line);
  color: #c9dee6;
  background: rgba(255, 255, 255, .03);
  text-align: left;
  cursor: pointer;
}

.exam-options button:hover:not(:disabled) {
  border-color: var(--cyan);
  color: #fff;
  transform: translateY(-2px);
}

.exam-options button span {
  display: grid;
  width: 32px;
  height: 32px;
  border: 1px solid #3e6375;
  place-items: center;
  color: #7795a3;
  font-size: .67rem;
  font-weight: 900;
}

.exam-options button.is-correct {
  border-color: var(--green);
  background: rgba(117, 240, 186, .1);
}

.exam-options button.is-wrong {
  border-color: var(--red);
  background: rgba(255, 127, 152, .1);
}

.exam-options button:disabled {
  cursor: default;
}

.exam-feedback {
  min-height: 1.5em;
  margin: 18px 0;
  color: #93abb6;
  line-height: 1.55;
}

.exam-feedback.is-correct {
  color: var(--green);
}

.exam-feedback.is-wrong {
  color: #ffb3c0;
}

.lab-feedback.is-error,
.exam-feedback.is-correct,
.exam-feedback.is-wrong {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
}

.feedback-panther {
  width: 76px;
  height: 76px;
  object-fit: cover;
  object-position: 50% 30%;
  border: 2px solid rgba(102, 222, 255, .42);
  border-radius: 50%;
  box-shadow: 0 0 24px rgba(62, 202, 242, .18);
}

.feedback-panther-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.feedback-panther-copy small {
  color: #68dcf8;
  font-size: .64rem;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.feedback-panther-copy strong {
  color: #f1fbff;
  font-size: .92rem;
  line-height: 1.35;
}

.feedback-panther-copy p,
.feedback-panther-copy > span {
  margin: 0;
  color: #b7ced9;
  font-size: .78rem;
  line-height: 1.48;
}

.feedback-panther-copy .feedback-formula {
  width: fit-content;
  padding: 6px 9px;
  border: 1px solid rgba(106, 222, 251, .25);
  border-radius: 8px;
  color: #7ce4fb;
  background: rgba(62, 201, 239, .08);
  font-family: "Cascadia Code", Consolas, monospace;
  font-weight: 800;
}

@media (max-width: 560px) {
  .lab-feedback.is-error,
  .exam-feedback.is-correct,
  .exam-feedback.is-wrong {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .feedback-panther {
    width: 52px;
    height: 52px;
    align-self: start;
  }
}

.exam-card > button {
  align-self: flex-end;
}

/* Resultados */
.result-stage {
  display: grid;
  min-height: calc(100vh - 138px);
  padding: 55px 24px;
  place-content: center;
  text-align: center;
}

.result-orb {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 0 auto 30px;
  border: 2px solid var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 45px rgba(112, 230, 255, .35);
  animation: simple-turn 10s linear infinite;
}

.result-orb::before,
.result-orb::after {
  position: absolute;
  border: 1px solid rgba(112, 230, 255, .35);
  border-radius: 50%;
  content: "";
}

.result-orb::before {
  inset: 19px;
}

.result-orb::after {
  inset: -25px;
}

.result-orb span {
  position: absolute;
  inset: 35px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #fff, var(--cyan) 12%, var(--accent) 62%);
  box-shadow: 0 0 45px var(--accent);
}

.result-orb i,
.result-orb b {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 14px var(--amber);
}

.result-orb i {
  top: -6px;
  left: 50%;
}

.result-orb b {
  right: -5px;
  bottom: 35%;
  background: var(--green);
}

.result-stage h1 {
  font-size: clamp(2.5rem, 5vw, 5.2rem);
}

.result-stage > p {
  max-width: 680px;
  margin: 0 auto 25px;
}

.result-scores {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  gap: 1px;
  width: min(650px, 100%);
  margin: 0 auto;
  background: var(--line);
}

.result-scores article {
  display: grid;
  gap: 7px;
  padding: 17px;
  background: #091f31;
}

.result-scores strong {
  font-size: 1.7rem;
}

.result-scores .total strong {
  color: var(--green);
}

.result-stars {
  margin: 24px 0;
  color: var(--amber);
  font-size: 2.2rem;
  letter-spacing: .12em;
}

.result-delivery {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(320px, 1.1fr);
  gap: 26px;
  width: min(880px, 100%);
  margin: 0 auto 22px;
  padding: 24px;
  border: 1px solid rgba(112, 230, 255, .22);
  background: linear-gradient(135deg, rgba(10, 38, 57, .96), rgba(7, 27, 42, .96));
  text-align: left;
}

.result-delivery > div > span {
  color: var(--cyan);
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.result-delivery h2 {
  margin: 8px 0 10px;
  font-size: 1.35rem;
}

.result-delivery p {
  color: #a9c4d0;
  line-height: 1.6;
}

.result-delivery form {
  display: grid;
  gap: 12px;
}

.result-delivery fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.result-delivery legend,
.result-delivery label {
  color: #d9edf4;
  font-size: .76rem;
  font-weight: 800;
}

.result-delivery-types {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}

.result-delivery-types label {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 9px 11px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .035);
}

.result-delivery-text,
.result-delivery-file {
  display: grid;
  gap: 7px;
}

.result-delivery textarea,
.result-delivery input[type="file"] {
  width: 100%;
  padding: 11px;
  border: 1px solid rgba(255, 255, 255, .18);
  color: #eafaff;
  background: #061927;
}

.result-delivery small {
  color: #8da9b5;
  font-weight: 500;
}

.result-delivery button {
  min-height: 46px;
  border: 0;
  color: #04131d;
  background: var(--green);
  font-weight: 950;
  cursor: pointer;
}

.result-delivery button:disabled {
  cursor: not-allowed;
  opacity: .62;
}

#game-delivery-status {
  margin: 0;
  font-size: .75rem;
}

#game-delivery-status.is-success {
  color: var(--green);
}

#game-delivery-status.is-error {
  color: #ff9bad;
}

.result-actions {
  display: flex;
  gap: 9px;
  justify-content: center;
}

.result-actions a {
  padding: 13px 17px;
  border: 1px solid var(--cyan);
  color: #d8f3f9;
  font-weight: 900;
  text-decoration: none;
}

.result-actions a.primary {
  color: #04131d;
  background: var(--cyan);
}

.academy-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 100;
  max-width: 390px;
  padding: 14px 17px;
  border-left: 4px solid var(--green);
  color: #e9faff;
  background: #0b293a;
  box-shadow: 0 18px 55px rgba(0, 0, 0, .34);
  font-size: .78rem;
}

.academy-toast.is-error {
  border-left-color: var(--red);
}

@keyframes phase-in {
  from { opacity: 0; transform: translateY(10px); }
}

@keyframes grid-flow {
  to { background-position: 0 112px, 112px 0; }
}

@keyframes core-turn {
  to { transform: translate(-50%, -50%) rotate(405deg); }
}

@keyframes simple-turn {
  to { transform: rotate(360deg); }
}

@keyframes block-drop {
  from { opacity: 0; transform: translateY(-8px); }
}

@keyframes trace-in {
  from { opacity: 0; transform: translateX(-8px); }
}

@keyframes cart-drive {
  to { left: var(--travel); }
}

@keyframes orbit-spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes module-build {
  45% { filter: brightness(1.8); transform: translate(-50%, -34%) rotateX(-12deg) rotateY(-27deg) scale(1.05); }
}

@media (max-width: 1180px) {
  .academy-shell {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .campaign-rail {
    padding: 18px 12px;
  }

  .campaign-course {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .campaign-course img {
    width: 40px;
    height: 40px;
  }

  .mission-brief {
    grid-template-columns: .85fr 1.15fr;
  }

  .brief-facts {
    grid-template-columns: 1fr;
  }

  .brief-facts article {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brief-facts article:last-child {
    border-bottom: 0;
  }

  .block-lab {
    grid-template-columns: 220px minmax(300px, 1fr);
  }

  .program-device {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .trajectory-lab,
  .force-lab,
  .chemistry-lab,
  .builder-lab,
  .equation-lab {
    grid-template-columns: minmax(390px, 1.2fr) minmax(280px, .8fr);
  }

  .robot-lab,
  .decision-lab,
  .loop-lab,
  .debug-lab,
  .function-lab,
  .list-lab {
    grid-template-columns: minmax(390px, 1.1fr) minmax(290px, .9fr);
  }

  .function-machine {
    grid-template-columns: 82px minmax(220px, 1fr) 82px;
    gap: 12px;
  }
}

@media (max-width: 900px) {
  .academy-topbar {
    grid-template-columns: 1fr auto;
    padding: 10px 16px;
  }

  .academy-brand {
    display: none;
  }

  .academy-shell {
    display: block;
  }

  .campaign-rail {
    position: static;
    display: grid;
    grid-template-columns: 190px minmax(390px, 1fr) 170px;
    gap: 14px;
    height: auto;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .campaign-map {
    display: flex;
    margin: 0;
  }

  .campaign-line {
    top: 25px;
    right: 40px;
    bottom: auto;
    left: 25px;
    width: auto;
    height: 2px;
  }

  .campaign-node {
    flex: 1 0 170px;
  }

  .campaign-rewards {
    align-content: center;
  }

  .phase-track {
    top: 72px;
  }

  .mission-brief,
  .tutorial-stage,
  .activity-layout,
  .exam-layout {
    grid-template-columns: 1fr;
  }

  .brief-scene,
  .tutorial-visual {
    min-height: 430px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .block-lab {
    grid-template-columns: 210px minmax(300px, 1fr);
    overflow-x: auto;
  }

  .trajectory-lab,
  .force-lab,
  .chemistry-lab,
  .builder-lab,
  .equation-lab {
    grid-template-columns: 1fr;
  }

  .robot-lab,
  .decision-lab,
  .loop-lab,
  .debug-lab,
  .function-lab,
  .list-lab {
    grid-template-columns: 1fr;
  }

  .trajectory-world,
  .force-world,
  .atom-stage,
  .builder-world,
  .balance-scene {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .robot-board-wrap,
  .decision-scene,
  .loop-factory,
  .debug-editor,
  .function-machine,
  .list-playground {
    border-right: 0;
    border-bottom: 1px solid #d9e7ec;
  }

  .exam-sidebar {
    padding-bottom: 30px;
  }
}

@media (max-width: 650px) {
  .academy-account > span {
    display: none;
  }

  .academy-topbar {
    min-height: 62px;
  }

  .campaign-rail {
    grid-template-columns: 155px minmax(380px, 1fr);
  }

  .campaign-rewards {
    display: none;
  }

  .phase-track {
    top: 62px;
    overflow-x: auto;
    padding: 0;
  }

  .phase-track button {
    min-width: 64px;
    min-height: 56px;
  }

  .phase-track strong {
    display: none;
  }

  .phase-track button::after {
    display: none;
  }

  .brief-copy,
  .tutorial-card {
    padding: 28px 20px;
  }

  .player-start > div,
  .result-actions,
  .tutorial-controls {
    flex-direction: column;
  }

  .result-delivery {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .player-start button {
    width: 100%;
  }

  .phase-heading {
    align-items: flex-start;
    flex-direction: column;
    padding: 28px 18px 16px;
  }

  .tutorial-stage,
  .activity-layout,
  .exam-layout {
    width: calc(100% - 24px);
    margin: 12px;
  }

  .lab-hud {
    grid-template-columns: repeat(3, 1fr);
    margin: 16px 12px 0;
  }

  .lab-hud > div {
    padding: 10px;
  }

  .lab-hud button {
    grid-column: 1 / -1;
  }

  .lab-root {
    margin: 0 12px;
  }

  .lab-feedback {
    margin-right: 12px;
    margin-left: 12px;
  }

  .lab-coach {
    margin-right: 12px;
    margin-left: 12px;
  }

  .block-lab {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .block-palette {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .block-palette > div {
    display: flex;
    gap: 8px;
    padding-bottom: 8px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }

  .logic-block {
    flex: 0 0 180px;
    scroll-snap-align: start;
  }

  .program-device {
    grid-template-columns: 1fr;
  }

  .code-bridge header {
    align-items: stretch;
    flex-direction: column;
  }

  .robot-board-wrap,
  .decision-scene,
  .loop-factory,
  .debug-editor,
  .function-machine,
  .list-playground,
  .robot-console,
  .decision-console,
  .loop-console,
  .debug-console,
  .function-console,
  .list-console {
    padding: 22px 16px;
  }

  .debug-editor > header {
    margin: -22px -16px 18px;
  }

  .command-palette {
    grid-template-columns: repeat(4, 1fr);
  }

  .command-palette button {
    grid-template-columns: 1fr;
    place-items: center;
    padding: 7px;
    text-align: center;
  }

  .command-palette button small {
    display: none;
  }

  .decision-gates {
    gap: 8px;
  }

  .rule-builder label {
    grid-template-columns: 1fr;
  }

  .function-machine {
    grid-template-columns: 70px minmax(170px, 1fr) 70px;
    gap: 7px;
    min-height: 430px;
  }

  .function-body {
    min-height: 240px;
    padding: 17px 8px;
  }

  .function-body i,
  .function-body strong {
    width: 38px;
    height: 38px;
  }

  .data-list button {
    width: 78px;
    height: 78px;
  }

  .trajectory-world canvas {
    min-height: 390px;
  }

  .force-world,
  .atom-stage,
  .builder-world,
  .balance-scene {
    min-height: 420px;
  }

  .electron-orbit.orbit-two {
    width: 300px;
    height: 190px;
  }

  .electron-orbit.orbit-three {
    width: 380px;
    height: 280px;
  }

  .orbit-two i:nth-child(1) { transform: translateX(145px); }
  .orbit-two i:nth-child(2) { transform: translateX(-145px); }
  .orbit-two i:nth-child(3) { transform: translateY(92px); }
  .orbit-two i:nth-child(4) { transform: translateY(-92px); }
  .orbit-two i:nth-child(5) { transform: translate(102px, 62px); }
  .orbit-two i:nth-child(6) { transform: translate(-102px, -62px); }
  .orbit-two i:nth-child(7) { transform: translate(102px, -62px); }
  .orbit-two i:nth-child(8) { transform: translate(-102px, 62px); }
  .orbit-three i:nth-child(1) { transform: translateX(185px); }
  .orbit-three i:nth-child(2) { transform: translateX(-185px); }
  .orbit-three i:nth-child(3) { transform: translateY(135px); }
  .orbit-three i:nth-child(4) { transform: translateY(-135px); }
  .orbit-three i:nth-child(5) { transform: translate(145px, 82px); }
  .orbit-three i:nth-child(6) { transform: translate(-145px, -82px); }
  .orbit-three i:nth-child(7) { transform: translate(145px, -82px); }
  .orbit-three i:nth-child(8) { transform: translate(-145px, 82px); }
  .orbit-three i:nth-child(9) { transform: translate(60px, 126px); }
  .orbit-three i:nth-child(10) { transform: translate(-60px, -126px); }

  .activity-summary,
  .activity-form,
  .exam-sidebar,
  .exam-card {
    padding: 28px 20px;
  }

  .exam-options,
  .result-scores {
    grid-template-columns: 1fr;
  }

  .academy-toast {
    right: 12px;
    bottom: 12px;
    left: 12px;
  }
}

@media (max-width: 420px) {
  .mission-character span {
    width: 110px;
    font-size: 3.2rem;
  }

  .brief-scene {
    min-height: 360px;
  }

  .lab-coach {
    grid-template-columns: 1fr;
  }

  .coach-avatar {
    width: 42px;
    height: 42px;
  }

  .robot-board {
    border-width: 5px;
    border-radius: 16px;
  }

  .robot-program span {
    width: 42px;
    height: 42px;
  }

  .decision-gates article {
    min-height: 110px;
    padding: 10px;
  }

  .function-machine {
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: 560px;
  }

  .function-input,
  .function-output {
    width: 86px;
    aspect-ratio: 1;
  }

  .function-body {
    width: min(250px, 100%);
    min-height: 230px;
  }

  .data-pulse {
    display: none;
  }

  .data-list button {
    width: 70px;
    height: 70px;
  }

  #debug-lines button {
    grid-template-columns: 27px minmax(0, 1fr);
  }

  #debug-lines i {
    display: none;
  }
}

/* Applied models keep the measurements, controls and interpretation together. */
.applied-lab { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(290px, .8fr); gap: 22px; align-items: start; }
.applied-stage, .applied-console { min-width: 0; border: 1px solid var(--line); border-radius: 22px; overflow: hidden; background: #0b2434; }
.applied-purpose { padding: 22px 24px 8px; }
.applied-purpose > span, .applied-telemetry > span { color: var(--cyan); font-size: .72rem; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.applied-purpose p { margin: 9px 0; line-height: 1.6; color: #d7eaf2; }
.applied-blueprint { margin: 12px; border: 1px solid #456773; border-radius: 16px; background: linear-gradient(90deg, #82c7de0e 1px, transparent 1px), linear-gradient(#82c7de0e 1px, transparent 1px), #071b29; background-size: 25px 25px; }
.applied-blueprint svg { display: block; width: 100%; height: auto; overflow: hidden; }
.applied-blueprint text { fill: #eaf7ff; font: 600 16px "Segoe UI", sans-serif; paint-order: stroke; stroke: #071b29; stroke-width: 3px; stroke-linejoin: round; }
.applied-blueprint text.diagram-large { font-size: 42px; font-weight: 800; }
.diagram-grid { fill: #67c9ff09; stroke: #93adc0; stroke-width: 2.5; stroke-dasharray: 6 5; }
.diagram-proposal { fill: none; stroke: #6fe5ff; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.diagram-axis, .diagram-right-angle { fill: none; stroke: #b7cbd6; stroke-width: 2; }
.diagram-point, .diagram-fill { fill: #75e4ca; stroke: #c8fff0; stroke-width: 2; }
.diagram-liquid { fill: #55c6f46b; stroke: #70dfff; stroke-width: 1.5; }
.diagram-hydrogen { fill: #8adeff; stroke: #e1f9ff; stroke-width: 2; }
.diagram-oxygen { fill: #ff8a91; stroke: #ffe2e4; stroke-width: 2; }
.applied-telemetry { padding: 12px 24px 18px; }
.applied-telemetry strong { display: block; margin-top: 8px; font-size: clamp(1.2rem, 2.5vw, 1.75rem); overflow-wrap: anywhere; color: #fff; }
.applied-telemetry p { color: #bbd2de; font-size: .9rem; line-height: 1.7; margin-bottom: 0; }
.applied-stage-status { padding: 16px 24px; color: #d4e5ed; background: #16364a; font-size: .82rem; line-height: 1.5; }
.applied-stage.is-solved { border-color: var(--green); }
.applied-stage.is-solved .diagram-proposal { stroke: var(--green); }
.applied-stage.is-solved .applied-stage-status { color: #c8ffe5; background: #173d33; }
.applied-console { padding: 22px; background: #0b2030; }
.applied-console fieldset { min-width: 0; padding: 0; margin: 0 0 25px; border: 0; }
.applied-console legend { display: block; width: 100%; margin-bottom: 15px; line-height: 1.6; font-size: .9rem; font-weight: 800; color: #f1fbff; }
.applied-console legend > span { color: var(--cyan); margin-right: 7px; }
.applied-formulas label { display: flex; gap: 11px; align-items: flex-start; margin: 9px 0; padding: 13px; border: 1px solid #365265; border-radius: 11px; font-size: .88rem; line-height: 1.55; cursor: pointer; color: #d2e8f3; }
.applied-formulas label:has(input:checked) { border-color: var(--cyan); background: #1b4659; color: #fff; }
.applied-formulas input[type=radio] { flex: 0 0 17px; width: 17px; height: 17px; margin: 3px 0 0; accent-color: #6fe5ff; }
.applied-control { margin-top: 19px; }
.applied-control > label { display: block; font-size: .85rem; font-weight: 750; margin-bottom: 10px; color: #e6f4fa; }
.applied-control-pair { display: grid; grid-template-columns: minmax(0, 1fr) 90px; gap: 12px; align-items: center; }
.applied-control input[type=range] { width: 100%; accent-color: #6fe5ff; min-width: 0; }
.applied-control input[type=number] { box-sizing: border-box; width: 90px; padding: 11px 8px; color: #fff; border: 1px solid #527385; background: #071825; border-radius: 8px; font-size: 1rem; }
.applied-control > small { display: block; margin-top: 7px; font-size: .72rem; line-height: 1.6; color: #adc4d1; }
.applied-submit { width: 100%; min-height: 48px; padding: 12px 18px; color: #062534; background: var(--cyan); border: 0; border-radius: 12px; font-weight: 850; cursor: pointer; }
.applied-model-note { font-size: .75rem; line-height: 1.65; color: #a5c0cf; margin: 16px 0 0; }
.atom-stage .electron-orbit { animation: none; }
.atom-stage .electron-orbit.orbit-one { width: 38%; height: 26%; }
.atom-stage .electron-orbit.orbit-two { width: 55%; height: 40%; }
.atom-stage .electron-orbit.orbit-three { width: 73%; height: 55%; }
.atom-stage .electron-orbit.orbit-four { width: 89%; height: 70%; }
.applied-console button:disabled, .applied-console input:disabled { cursor: default; opacity: .65; }
select:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
#exam-question { white-space: pre-line; }
@media (max-width: 1100px) { .applied-lab { grid-template-columns: 1fr; } .applied-console { max-width: none; } }
@media (max-width: 560px) {
  .applied-purpose, .applied-telemetry, .applied-console { padding: 16px; }
  .applied-blueprint { margin: 6px; }
  .applied-blueprint text { font-size: 18px; }
  .applied-stage-status { padding: 14px 16px; }
  .applied-control-pair { grid-template-columns: minmax(0, 1fr) 82px; }
  .applied-control input[type=number] { width: 82px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
