:root {
  --ink: #14213d;
  --paper: #fffdf6;
  --blue: #1d4ed8;
  --sky: #7dd3fc;
  --mint: #86efac;
  --lime: #bef264;
  --yellow: #fde047;
  --coral: #fb7185;
  --violet: #8b5cf6;
  --white: #ffffff;
  --shadow: 8px 9px 0 var(--ink);
  --small-shadow: 4px 5px 0 var(--ink);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(20, 33, 61, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(20, 33, 61, 0.06) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
  font-family: "Nunito", system-ui, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 16px clamp(18px, 5vw, 56px);
  border-bottom: 4px solid var(--ink);
  background: rgba(255, 253, 246, 0.92);
  backdrop-filter: blur(14px);
}

.brand,
.nav-links,
.hero-actions,
.stats-band,
.window-dots {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 1000;
  font-size: 1.1rem;
}

.brand-logo {
  width: clamp(110px, 16.1vw, 173px);
  height: auto;
  display: block;
}

.nav-links {
  gap: 18px;
  font-weight: 900;
  margin-right: clamp(24px, 5vw, 88px);
}

.nav-links a,
.nav-dropdown summary {
  border-bottom: 3px solid transparent;
}

.nav-links a:hover,
.nav-dropdown summary:hover {
  border-color: var(--coral);
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown:not([open]) > .dropdown-menu,
.dropdown-submenu:not([open]) > .studio-topic-groups,
.dropdown-submenu:not([open]) > .submenu-links,
.lesson-cluster:not([open]) > .cluster-links {
  display: none;
}

.nav-dropdown summary {
  cursor: pointer;
  list-style: none;
}

.nav-dropdown summary::-webkit-details-marker {
  display: none;
}

.nav-dropdown summary::after {
  content: " ▾";
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 14px);
  left: 0;
  z-index: 30;
  width: min(340px, calc(100vw - 32px));
  display: grid;
  gap: 7px;
  border: 5px solid var(--ink);
  border-radius: 18px;
  background: var(--white);
  box-shadow: var(--shadow);
  padding: 10px;
  font-size: clamp(0.86rem, 1.35vw, 1rem);
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.oop-nav .dropdown-menu {
  right: 0;
  left: auto;
}

.foundations-nav .dropdown-menu {
  width: min(420px, calc(100vw - 32px));
}

.code-nav .dropdown-menu {
  width: min(420px, calc(100vw - 32px));
}

.dropdown-menu a,
.dropdown-submenu summary,
.lesson-cluster summary {
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: #fef3c7;
  padding: 7px 10px;
  line-height: 1.15;
}

.dropdown-menu a.is-current {
  background: var(--mint);
}

.studio-menu-label {
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: var(--sky);
  padding: 7px 10px;
  font-weight: 1000;
  line-height: 1.15;
}

.dropdown-submenu {
  display: grid;
  gap: 6px;
}

.dropdown-submenu summary,
.lesson-cluster summary {
  cursor: pointer;
  font-weight: 1000;
  list-style: none;
}

.nav-age {
  display: block;
  margin-top: 3px;
  font-size: 0.76rem;
  font-weight: 900;
  color: rgba(20, 33, 61, 0.72);
}

.nav-age-inline {
  display: block;
  margin-top: 3px;
  font-size: 0.68rem;
  font-weight: 900;
  color: rgba(20, 33, 61, 0.62);
}

.dropdown-submenu summary::-webkit-details-marker,
.lesson-cluster summary::-webkit-details-marker {
  display: none;
}

.dropdown-submenu > summary::after,
.lesson-cluster > summary::after {
  content: " ▾";
}

.studio-topic-groups {
  display: grid;
  gap: 6px;
  padding-left: 8px;
}

.lesson-cluster {
  display: grid;
  gap: 5px;
}

.lesson-cluster summary {
  background: #eef2ff;
  color: rgba(20, 33, 61, 0.88);
  border-width: 2px;
  padding: 5px 9px;
}

.submenu-links {
  display: grid;
  gap: 6px;
  padding-left: 10px;
  padding-right: 4px;
}

.cluster-links {
  gap: 5px;
  padding-left: 8px;
  padding-right: 0;
}

.cluster-links a {
  border-width: 2px;
  padding: 6px 9px;
}

.submenu-links a {
  background: #fff7cc;
}

.foundation-preview-row {
  display: grid;
  gap: 8px;
}

.foundation-preview-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.code-nav .studio-links,
.oop-nav .studio-links {
  padding-right: 0;
}

.submenu-links a.studio-heading {
  background: var(--sky);
  font-weight: 1000;
}

.submenu-links a.studio-heading.is-muted {
  background: #eef2ff;
  color: rgba(20, 33, 61, 0.72);
}

.studio-divider {
  display: block;
  height: 4px;
  border-radius: 999px;
  background: rgba(20, 33, 61, 0.14);
  margin: 4px 0;
}

.dropdown-menu .dropdown-heading {
  background: var(--sky);
}

.dropdown-menu .dropdown-heading.is-muted {
  background: #eef2ff;
  color: rgba(20, 33, 61, 0.72);
}

.hero-section {
  min-height: calc(100vh - 78px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.9fr);
  align-items: center;
  gap: clamp(22px, 4vw, 56px);
  padding: clamp(22px, 4vw, 48px) clamp(18px, 6vw, 72px);
}

.hero-copy h1,
.section-heading h2,
.playground-copy h2,
.start-section h2 {
  font-family: "Fredoka", system-ui, sans-serif;
  letter-spacing: 0;
}

.hero-copy h1 {
  max-width: 720px;
  margin: 14px 0;
  font-size: clamp(3rem, 6.15vw, 6rem);
  line-height: 0.92;
  text-shadow: 4px 4px 0 var(--yellow);
}

.hero-copy p,
.playground-copy p,
.start-section p {
  max-width: 680px;
  font-size: 1.25rem;
  line-height: 1.55;
  font-weight: 800;
}

.eyebrow {
  display: inline-flex;
  width: fit-content;
  border: 4px solid var(--ink);
  border-radius: 999px;
  background: var(--mint);
  box-shadow: var(--small-shadow);
  padding: 8px 14px;
  font-weight: 1000;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 20px;
}

.primary-button,
.secondary-button,
.next-lesson-button,
.ai-grade-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 54px;
  border: 4px solid var(--ink);
  border-radius: 16px;
  box-shadow: var(--small-shadow);
  padding: 13px 18px;
  font-weight: 1000;
  cursor: pointer;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease;
}

.primary-button {
  background: var(--yellow);
}

.secondary-button {
  background: var(--white);
}

.next-lesson-button {
  width: 100%;
  margin-top: 14px;
  background: #fb923c;
  color: var(--ink);
  font-size: 1.2rem;
}

.ai-grade-button {
  background: #fb923c;
}

.next-lesson-button[hidden] {
  display: none;
}

.primary-button:hover,
.secondary-button:hover,
.next-lesson-button:hover,
.ai-grade-button:hover {
  transform: translateY(-2px);
}

.primary-button:active,
.secondary-button:active,
.next-lesson-button:active,
.ai-grade-button:active {
  transform: translateY(3px);
  box-shadow: 2px 2px 0 var(--ink);
}

.hero-stage {
  position: relative;
  min-height: 390px;
}

.code-window {
  min-height: 310px;
  border: 5px solid var(--ink);
  border-radius: 22px;
  background: #101827;
  color: #bbf7d0;
  box-shadow: var(--shadow);
  overflow: hidden;
  transform: rotate(1.5deg);
}

.window-dots {
  gap: 8px;
  padding: 14px;
  border-bottom: 4px solid var(--ink);
  background: var(--sky);
}

.window-dots span {
  width: 16px;
  height: 16px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--yellow);
}

.window-dots span:nth-child(2) {
  background: var(--coral);
}

.window-dots span:nth-child(3) {
  background: var(--mint);
}

pre {
  margin: 0;
  white-space: pre-wrap;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1rem;
  line-height: 1.6;
}

.code-window pre {
  padding: 20px 22px;
}

.launch-card {
  position: absolute;
  right: 0;
  bottom: 0;
  width: min(76%, 320px);
  border: 5px solid var(--ink);
  border-radius: 20px;
  background: var(--lime);
  box-shadow: var(--shadow);
  padding: 17px;
  transform: rotate(-4deg);
}

.launch-card strong,
.launch-card span {
  display: block;
}

.launch-card strong {
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 1.45rem;
  margin-bottom: 8px;
}

.launch-card span {
  font-weight: 900;
  line-height: 1.35;
}

.stats-band {
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px;
  padding: 0 clamp(18px, 6vw, 72px) 48px;
}

.stats-band article {
  width: min(100%, 300px);
  border: 5px solid var(--ink);
  border-radius: 18px;
  background: var(--white);
  box-shadow: var(--small-shadow);
  padding: 18px;
}

.stats-band strong {
  display: block;
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 2.6rem;
  line-height: 1;
}

.stats-band span {
  font-weight: 900;
}

.section,
.playground-section,
.start-section {
  padding: clamp(46px, 7vw, 82px) clamp(18px, 6vw, 72px);
}

.section-heading {
  max-width: 720px;
  margin-bottom: 24px;
}

.section-heading h2,
.playground-copy h2,
.start-section h2 {
  margin: 14px 0;
  font-size: clamp(2.25rem, 5vw, 4.6rem);
  line-height: 0.95;
}

.pathway-grid,
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.pathway-card,
.project-card,
.quest-builder,
.quest-output,
.lesson-meta,
.lesson-notice,
.scaffold-grid article,
.activity-card {
  border: 5px solid var(--ink);
  border-radius: 18px;
  box-shadow: var(--small-shadow);
}

.pathway-card,
.project-card {
  min-height: 220px;
  background: var(--white);
  padding: 18px;
}

.pathway-card {
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease;
}

.pathway-card:hover,
.pathway-card.is-active {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.pathway-card:nth-child(1),
.project-card:nth-child(3) {
  background: #dbeafe;
}

.pathway-card:nth-child(2),
.project-card:nth-child(1) {
  background: #fef3c7;
}

.pathway-card:nth-child(3),
.project-card:nth-child(4) {
  background: #dcfce7;
}

.pathway-card:nth-child(4) {
  background: #fce7f3;
}

.pathway-card:nth-child(5),
.project-card:nth-child(2) {
  background: #ede9fe;
}

.pathway-card span,
.project-card span {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 4px solid var(--ink);
  border-radius: 14px;
  background: var(--white);
  box-shadow: 3px 4px 0 var(--ink);
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 1.5rem;
  font-weight: 1000;
}

.pathway-card h3,
.project-card h3,
.quest-output h3 {
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 1.65rem;
  line-height: 1;
  margin: 18px 0 10px;
}

.pathway-card p,
.project-card p,
.quest-output p {
  font-weight: 850;
  line-height: 1.45;
}

.pathway-card small {
  display: inline-flex;
  margin-top: 12px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--white);
  padding: 5px 9px;
  font-weight: 1000;
}

.foundations-nav .pathway-picker-menu {
  width: min(310px, calc(100vw - 32px));
  gap: 8px;
}

.pathway-picker-menu a {
  padding: 8px 11px;
  font-size: 0.95rem;
}

.pathway-overview {
  min-height: calc(100vh - 78px);
  padding: clamp(18px, 3vw, 34px) clamp(18px, 6vw, 72px);
  background:
    radial-gradient(circle at 11% 15%, rgba(253, 224, 71, 0.42) 0 86px, transparent 87px),
    radial-gradient(circle at 88% 10%, rgba(125, 211, 252, 0.34) 0 96px, transparent 97px),
    radial-gradient(circle at 94% 78%, rgba(134, 239, 172, 0.34) 0 74px, transparent 75px),
    linear-gradient(135deg, #fff7cc 0%, #fef3c7 62%, #eef6ff 100%);
  border-block: 5px solid var(--ink);
}

.pathway-overview-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin-bottom: 18px;
}

.pathway-overview-hero h1 {
  max-width: 840px;
  margin: 10px 0;
  font-size: clamp(2.5rem, 5.2vw, 5.55rem);
  line-height: 0.92;
}

.pathway-overview-hero p,
.pathway-metaphor-card p,
.pathway-unit p {
  font-weight: 900;
  line-height: 1.45;
}

.pathway-overview-hero p {
  max-width: 820px;
  font-size: clamp(1.02rem, 1.65vw, 1.3rem);
}

.pathway-metaphor-card,
.pathway-unit {
  border: 5px solid var(--ink);
  border-radius: 18px;
  background: var(--white);
  box-shadow: var(--small-shadow);
}

.pathway-metaphor-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.34fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 14px;
  padding: clamp(14px, 2vw, 18px);
}

.pathway-metaphor-card h2 {
  margin: 8px 0;
  font-size: clamp(1.55rem, 2.75vw, 2.35rem);
  line-height: 0.98;
}

.pathway-map-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.pathway-unit {
  padding: clamp(18px, 3vw, 26px);
}

.pathway-unit > span {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 4px solid var(--ink);
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 6px 0 var(--ink);
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 1.55rem;
  font-weight: 1000;
}

.studio-mascot-card {
  position: relative;
  min-height: 175px;
  overflow: hidden;
  border: 5px solid var(--ink);
  border-radius: 18px;
  background: linear-gradient(135deg, #dbeafe 0%, #dcfce7 55%, #fef3c7 100%);
  box-shadow: var(--small-shadow);
}

.studio-mascot-card::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 3px dashed rgba(20, 33, 61, 0.22);
  border-radius: 16px;
}

.mascot-robot {
  position: absolute;
  left: 14%;
  bottom: 15%;
  width: 38%;
  max-width: 125px;
  height: auto;
  filter: drop-shadow(4px 6px 0 rgba(20, 33, 61, 0.24));
}

.mascot-star {
  position: absolute;
  right: 17%;
  top: 16%;
  width: 20%;
  max-width: 68px;
  height: auto;
  filter: drop-shadow(3px 4px 0 rgba(20, 33, 61, 0.18));
}

.mascot-bubble {
  display: none;
  position: absolute;
  right: 14px;
  bottom: 14px;
  max-width: 55%;
  border: 4px solid var(--ink);
  border-radius: 16px;
  background: var(--white);
  box-shadow: 3px 4px 0 var(--ink);
  padding: 8px 9px;
  font-size: 0.86rem;
  font-weight: 1000;
  line-height: 1.1;
}

.code-mascot {
  background: linear-gradient(135deg, #17213a 0%, #1d4ed8 58%, #7dd3fc 100%);
}

.mini-code-window {
  position: absolute;
  inset: 22px 18px auto;
  display: grid;
  gap: 7px;
  border: 4px solid var(--ink);
  border-radius: 16px;
  background: #101827;
  box-shadow: 4px 5px 0 rgba(20, 33, 61, 0.45);
  padding: 36px 14px 14px;
  color: #bbf7d0;
}

.mini-code-window span {
  position: absolute;
  top: 12px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #fb7185;
}

.mini-code-window span:nth-child(1) {
  left: 14px;
}

.mini-code-window span:nth-child(2) {
  left: 31px;
  background: #fde047;
}

.mini-code-window span:nth-child(3) {
  left: 48px;
  background: #86efac;
}

.mini-code-window code {
  font: 800 0.77rem/1.3 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.oop-mascot {
  background: linear-gradient(135deg, #ede9fe 0%, #fce7f3 55%, #fef3c7 100%);
}

.object-factory {
  position: absolute;
  inset: 22px 18px 62px;
  display: grid;
  align-content: center;
  gap: 18px;
}

.blueprint-card {
  justify-self: center;
  border: 4px solid var(--ink);
  border-radius: 15px;
  background: var(--sky);
  box-shadow: 4px 5px 0 var(--ink);
  padding: 18px 26px;
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 1.55rem;
  font-weight: 1000;
}

.cookie-row {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.cookie-row span {
  width: 44px;
  height: 44px;
  border: 4px solid var(--ink);
  border-radius: 999px;
  background: #facc15;
  box-shadow: 3px 4px 0 rgba(20, 33, 61, 0.35);
}

.cookie-row span:nth-child(2) {
  background: #86efac;
}

.cookie-row span:nth-child(3) {
  background: #f9a8d4;
}

.unit-icon-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
  min-height: 38px;
}

.mini-icon,
.mini-box,
.mini-arrow {
  display: inline-grid;
  place-items: center;
  min-width: 36px;
  min-height: 34px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: var(--mint);
  box-shadow: 2px 3px 0 var(--ink);
  padding: 4px 8px;
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 1000;
  line-height: 1;
}

.mini-box {
  background: #fef3c7;
}

.mini-arrow {
  min-width: auto;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  padding-inline: 0;
}

.pathway-unit h2 {
  margin: 16px 0 10px;
  font-size: clamp(1.85rem, 3.5vw, 3rem);
  line-height: 0.95;
}

.lesson-link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.lesson-link-grid a {
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: #fff7cc;
  color: var(--ink);
  padding: 10px 12px;
  font-weight: 1000;
  line-height: 1.12;
}

.lesson-link-grid a:hover {
  background: var(--mint);
}

.lesson-section {
  padding: clamp(46px, 7vw, 82px) clamp(18px, 6vw, 72px);
  background:
    radial-gradient(circle at 9% 18%, rgba(253, 224, 71, 0.42) 0 72px, transparent 73px),
    radial-gradient(circle at 88% 15%, rgba(125, 211, 252, 0.34) 0 86px, transparent 87px),
    radial-gradient(circle at 94% 82%, rgba(134, 239, 172, 0.34) 0 70px, transparent 71px),
    linear-gradient(135deg, #fff7cc 0%, #fef3c7 62%, #eef6ff 100%);
  border-block: 5px solid var(--ink);
}

.lesson-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin-bottom: 22px;
}

.lesson-page {
  min-height: calc(100vh - 78px);
}

.back-link {
  display: inline-flex;
  margin-bottom: 22px;
  border: 4px solid var(--ink);
  border-radius: 999px;
  background: var(--white);
  box-shadow: var(--small-shadow);
  padding: 8px 14px;
  font-weight: 1000;
}

.lesson-hero h1,
.lesson-hero h2 {
  max-width: 900px;
  margin: 14px 0;
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: clamp(2.4rem, 5.5vw, 5rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.lesson-hero p {
  max-width: 780px;
  font-size: 1.18rem;
  line-height: 1.5;
  font-weight: 850;
}

.lesson-meta {
  display: grid;
  align-content: center;
  gap: 8px;
  background: var(--white);
  padding: 16px;
}

.lesson-hero .lesson-meta {
  display: flex;
  flex-wrap: wrap;
  align-content: start;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.track-card {
  position: relative;
  overflow: hidden;
  gap: 14px;
  background:
    radial-gradient(circle at 14% 18%, rgba(253, 224, 71, 0.45) 0 46px, transparent 47px),
    radial-gradient(circle at 90% 8%, rgba(125, 211, 252, 0.4) 0 58px, transparent 59px),
    linear-gradient(145deg, #ffffff 0%, #fef3c7 100%);
}

.pathway-overview-hero .track-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  overflow: visible;
}

.track-card::after {
  content: "";
  position: absolute;
  right: 16px;
  bottom: 14px;
  width: 58px;
  height: 58px;
  border: 4px solid rgba(20, 33, 61, 0.16);
  border-radius: 18px;
  transform: rotate(-9deg);
}

.pathway-overview-hero .track-card::after {
  content: none;
}

.track-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  border: 4px solid var(--ink);
  border-radius: 18px;
  background: var(--sky);
  box-shadow: 3px 4px 0 var(--ink);
  padding: 8px;
}

.pathway-overview-hero .track-badge {
  display: none;
}

.track-badge span {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: var(--yellow);
  padding: 0 6px;
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 0.9rem;
  line-height: 1;
}

.pathway-overview-hero .track-badge span {
  min-width: 30px;
  height: 30px;
  border-radius: 11px;
}

.code-track-card .track-badge {
  background: #bfdbfe;
}

.oop-track-card .track-badge {
  background: #ddd6fe;
}

.track-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.track-chip-row span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--mint);
  box-shadow: 2px 3px 0 var(--ink);
  padding: 5px 10px;
  font-size: 0.86rem;
  font-weight: 1000;
}

.track-chip-row span:nth-child(2) {
  background: var(--sky);
}

.track-chip-row span:nth-child(3) {
  background: #e0e7ff;
}

.track-chip-row span:nth-child(4) {
  background: #fed7aa;
}

.pathway-overview-hero .track-card strong {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border: 4px solid var(--ink);
  border-radius: 999px;
  background: var(--white);
  box-shadow: 3px 4px 0 var(--ink);
  padding: 6px 12px;
  font-size: 1rem;
}

.lesson-meta strong {
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 1.75rem;
  line-height: 1;
}

.lesson-hero .lesson-meta strong {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border: 4px solid var(--ink);
  border-radius: 999px;
  background: var(--mint);
  box-shadow: 3px 4px 0 var(--ink);
  padding: 6px 12px;
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1;
}

.lesson-meta span {
  font-weight: 1000;
}

.lesson-hero .lesson-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border: 4px solid var(--ink);
  border-radius: 999px;
  background: var(--sky);
  box-shadow: 3px 4px 0 var(--ink);
  padding: 6px 12px;
  line-height: 1;
  font-weight: 1000;
}

.lesson-hero .lesson-meta span:nth-child(3) {
  background: #e0e7ff;
}

.lesson-hero .lesson-meta span:nth-child(4) {
  background: #fed7aa;
}

.space-rescue-scene {
  position: relative;
  min-height: 310px;
  overflow: hidden;
  margin-bottom: 24px;
  border: 5px solid var(--ink);
  border-radius: 22px;
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.85) 0 2px, transparent 3px),
    radial-gradient(circle at 72% 25%, rgba(255, 255, 255, 0.7) 0 2px, transparent 3px),
    linear-gradient(135deg, #17213a 0%, #1e3a8a 56%, #2563eb 100%);
  box-shadow: var(--small-shadow);
}

.image-rescue-scene {
  display: grid;
  gap: 0;
  min-height: 0;
  background: var(--ink);
}

.image-rescue-scene img {
  display: block;
  width: 100%;
  height: auto;
}

.image-rescue-scene .scene-caption {
  position: static;
  margin: 0;
  border-width: 4px 0 0;
  border-radius: 0;
  background: var(--yellow);
  box-shadow: none;
}

.space-stars span {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #fde047;
  box-shadow: 0 0 0 4px rgba(253, 224, 71, 0.18);
}

.space-stars span:nth-child(1) {
  left: 11%;
  top: 18%;
}

.space-stars span:nth-child(2) {
  left: 30%;
  top: 70%;
}

.space-stars span:nth-child(3) {
  right: 23%;
  top: 16%;
}

.space-stars span:nth-child(4) {
  right: 14%;
  bottom: 24%;
}

.space-stars span:nth-child(5) {
  left: 52%;
  top: 38%;
}

.planet {
  position: absolute;
  border: 5px solid var(--ink);
  border-radius: 999px;
  box-shadow: 5px 7px 0 rgba(20, 33, 61, 0.45);
}

.planet-home {
  left: 7%;
  bottom: 18%;
  width: 118px;
  height: 118px;
  background:
    radial-gradient(circle at 35% 30%, #fef3c7 0 16px, transparent 17px),
    #86efac;
}

.planet-rescue {
  right: 9%;
  top: 18%;
  width: 136px;
  height: 136px;
  background:
    radial-gradient(circle at 62% 38%, #dbeafe 0 18px, transparent 19px),
    #f9a8d4;
}

.rocket-path {
  position: absolute;
  left: 17%;
  right: 18%;
  top: 48%;
  display: flex;
  justify-content: space-between;
  border-top: 5px dashed rgba(255, 255, 255, 0.74);
}

.rocket-path span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-top: -24px;
  border: 4px solid var(--ink);
  border-radius: 14px;
  background: #fef3c7;
  box-shadow: 3px 4px 0 rgba(20, 33, 61, 0.45);
  font-family: "Fredoka", system-ui, sans-serif;
  font-weight: 1000;
}

.rescue-rocket {
  position: absolute;
  left: 24%;
  top: 30%;
  width: 74px;
  height: 118px;
  transform: rotate(38deg);
}

.rocket-body {
  position: absolute;
  inset: 8px 18px 18px;
  border: 5px solid var(--ink);
  border-radius: 42px 42px 18px 18px;
  background: #f8fafc;
  box-shadow: 3px 5px 0 rgba(20, 33, 61, 0.35);
}

.rocket-window {
  position: absolute;
  z-index: 2;
  left: 25px;
  top: 29px;
  width: 24px;
  height: 24px;
  border: 4px solid var(--ink);
  border-radius: 999px;
  background: var(--sky);
}

.rocket-flame {
  position: absolute;
  left: 25px;
  bottom: 0;
  width: 26px;
  height: 36px;
  border: 4px solid var(--ink);
  border-radius: 4px 4px 18px 18px;
  background: #fb923c;
}

.rescue-beacon {
  position: absolute;
  right: 15%;
  top: 26%;
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  border: 5px solid var(--ink);
  border-radius: 18px;
  background: var(--yellow);
  box-shadow: 4px 5px 0 rgba(20, 33, 61, 0.45);
}

.rescue-beacon span {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #fb7185;
  box-shadow: 0 0 0 10px rgba(251, 113, 133, 0.28);
}

.astronaut-card {
  position: absolute;
  right: 8%;
  bottom: 15%;
  display: grid;
  justify-items: center;
  gap: 6px;
  border: 4px solid var(--ink);
  border-radius: 16px;
  background: var(--white);
  box-shadow: 4px 5px 0 rgba(20, 33, 61, 0.45);
  padding: 10px 12px;
  font-weight: 1000;
}

.astronaut-helmet {
  width: 50px;
  height: 42px;
  border: 4px solid var(--ink);
  border-radius: 20px;
  background:
    linear-gradient(#101827 0 0) center / 30px 14px no-repeat,
    #f8fafc;
}

.scene-caption {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 18px;
  margin: 0;
  border: 4px solid var(--ink);
  border-radius: 16px;
  background: rgba(255, 253, 246, 0.94);
  box-shadow: 3px 4px 0 rgba(20, 33, 61, 0.42);
  padding: 10px 14px;
  font-weight: 1000;
}

.lesson-notice {
  background: var(--white);
  margin-bottom: 24px;
  padding: 20px;
}

.lesson-notice[hidden] {
  display: none;
}

.lesson-notice h3 {
  margin: 14px 0 8px;
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 1.8rem;
  line-height: 1;
}

.lesson-notice p {
  max-width: 760px;
  font-weight: 850;
  line-height: 1.45;
}

.scaffold-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.scaffold-grid article,
.activity-card {
  background: var(--white);
  padding: 18px;
}

.scaffold-grid article span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 4px solid var(--ink);
  border-radius: 12px;
  background: var(--mint);
  box-shadow: 3px 4px 0 var(--ink);
  font-family: "Fredoka", system-ui, sans-serif;
  font-weight: 1000;
}

.step-graphic,
.mission-token-row,
.sequence-output-graphic {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
  margin-top: 14px;
}

.step-graphic i,
.mission-token-row span,
.sequence-output-graphic span {
  display: grid;
  place-items: center;
  min-width: 48px;
  min-height: 40px;
  border: 3px solid var(--ink);
  border-radius: 13px;
  background: #dbeafe;
  box-shadow: 2px 3px 0 var(--ink);
  font-style: normal;
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 1000;
  line-height: 1.05;
  padding: 5px 9px;
  text-align: center;
}

.step-graphic i:nth-child(1)::before {
  content: "step";
}

.step-graphic i:nth-child(2)::before {
  content: "turn";
}

.step-graphic i:nth-child(3)::before {
  content: "go";
}

.map-graphic i:nth-child(1)::before {
  content: "read";
}

.map-graphic i:nth-child(2)::before {
  content: "map";
}

.map-graphic i:nth-child(3)::before {
  content: "next";
}

.beacon-graphic i:nth-child(1)::before {
  content: "fix";
}

.beacon-graphic i:nth-child(2)::before {
  content: "order";
}

.beacon-graphic i:nth-child(3)::before {
  content: "beacon";
}

.build-graphic i:nth-child(1)::before {
  content: "idea";
}

.build-graphic i:nth-child(2)::before {
  content: "steps";
}

.build-graphic i:nth-child(3)::before {
  content: "build";
}

.reflect-graphic i:nth-child(1)::before {
  content: "first";
}

.reflect-graphic i:nth-child(2)::before {
  content: "why";
}

.reflect-graphic i:nth-child(3)::before {
  content: "fix";
}

.mission-token-row span,
.sequence-output-graphic span {
  background: #fef3c7;
}

.sequence-output-graphic span {
  background: var(--mint);
}

.scaffold-grid h3,
.activity-card h3 {
  margin: 14px 0 8px;
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 1.45rem;
  line-height: 1;
}

.scaffold-grid p,
.activity-card p {
  font-weight: 850;
  line-height: 1.42;
}

.lesson-image {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  border: 4px solid var(--ink);
  border-radius: 16px;
  box-shadow: 3px 4px 0 var(--ink);
  margin: 14px 0;
}

.goal-callout {
  border: 5px solid var(--ink);
  border-radius: 18px;
  background: var(--yellow);
  box-shadow: var(--small-shadow);
  padding: 16px;
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1;
}

.lesson-workshop {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.85fr);
  gap: 20px;
}

.lesson-workshop.button-builder-workshop {
  grid-template-columns: minmax(320px, 1fr) minmax(360px, 0.82fr);
  align-items: start;
}

.button-builder-workshop .output-card {
  padding: 10px 12px 14px;
}

.lesson-workshop > .activity-card {
  min-width: 0;
}

.sequence-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.sequence-list button {
  display: grid;
  gap: 12px;
  align-items: center;
  justify-items: center;
  width: 100%;
  border: 4px solid var(--ink);
  border-radius: 14px;
  background: #dbeafe;
  box-shadow: 3px 4px 0 var(--ink);
  padding: 12px;
  cursor: pointer;
  font-weight: 1000;
  text-align: center;
}

.sequence-list button img {
  width: min(100%, 210px);
  aspect-ratio: 1;
  object-fit: cover;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: #17213a;
}

.sequence-list button span {
  display: grid;
  align-items: center;
  min-height: 2em;
  line-height: 1.15;
}

.sequence-list button.is-picked {
  background: var(--mint);
  transform: translateY(3px);
  box-shadow: 1px 2px 0 var(--ink);
}

.output-card pre {
  margin: 14px 0;
  border: 4px solid var(--ink);
  border-radius: 14px;
  background: #101827;
  color: #bbf7d0;
  padding: 16px;
  overflow-x: auto;
}

.student-work-label {
  display: block;
  margin-top: 14px;
  font-weight: 1000;
}

.objectives-box {
  margin: 14px 0;
  border: 4px solid var(--ink);
  border-radius: 16px;
  background: #dcfce7;
  box-shadow: 3px 4px 0 var(--ink);
  padding: 14px;
}

.objectives-box strong {
  display: block;
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 1.2rem;
}

.objectives-box ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.objectives-box li {
  font-weight: 850;
  line-height: 1.35;
}

.event-learning-box {
  background: #e0f2fe;
}

.event-flow-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 14px 0;
}

.event-flow-strip span {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: #fef3c7;
  box-shadow: 2px 3px 0 var(--ink);
  padding: 6px 10px;
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 1000;
  line-height: 1;
}

.event-flow-strip span:first-child {
  background: var(--mint);
}

.event-flow-strip span:last-child {
  background: #fed7aa;
}

.magic-button-workshop {
  align-items: start;
  grid-template-columns: minmax(0, 0.92fr) minmax(320px, 0.78fr);
}

.magic-response-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.magic-response-grid .practice-card {
  min-height: 190px;
}

.launch-actions {
  margin-top: 8px;
}

.launch-feedback {
  margin: 8px 0 10px;
  min-height: auto;
  padding: 9px 12px;
}

.magic-button-workshop .story-order-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0 12px;
}

.magic-button-workshop .story-order-list li {
  display: flex;
  align-items: center;
  min-height: 46px;
  border-width: 3px;
  border-radius: 12px;
  padding: 7px 9px;
  font-size: 0.9rem;
  line-height: 1.1;
}

.magic-button-workshop .story-order-list .empty-story-step {
  grid-column: 1 / -1;
}

.magic-button-workshop .story-order-list span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 26px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--mint);
  box-shadow: 2px 2px 0 var(--ink);
  margin-right: 8px;
}

.message-challenge-workshop .output-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.message-challenge-workshop .storyboard-card-bank > .eyebrow {
  align-items: center;
  gap: 8px;
  place-self: start;
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #7fe8a1 0%, #a7f3d0 100%);
  padding: 9px 18px 9px 14px;
}

.message-challenge-workshop .storyboard-card-bank > .eyebrow::before {
  content: "★";
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: #ffe156;
  box-shadow: 2px 2px 0 var(--ink);
  font-size: 0.9rem;
  line-height: 1;
}

.message-challenge-workshop .story-order-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 8px;
}

.message-challenge-workshop .story-order-list li {
  display: flex;
  align-items: center;
  min-height: 54px;
  border-width: 3px;
  border-radius: 14px;
  padding: 9px 11px;
  font-size: 0.95rem;
  line-height: 1.12;
}

.message-challenge-workshop .story-order-list .empty-story-step {
  grid-column: 1 / -1;
}

.message-challenge-workshop .story-order-list span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 36px;
  height: 28px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--mint);
  box-shadow: 2px 2px 0 var(--ink);
  margin-right: 9px;
}

.message-challenge-workshop .workspace-actions {
  margin-top: 0;
}

.magic-button-stage {
  position: relative;
  display: grid;
  place-items: center;
  gap: 12px;
  min-height: 330px;
  overflow: hidden;
  margin: 12px 0 18px;
  border: 5px solid var(--ink);
  border-radius: 18px;
  background:
    radial-gradient(circle at 18% 18%, rgba(253, 224, 71, 0.5) 0 46px, transparent 47px),
    linear-gradient(135deg, #eef6ff 0%, #dcfce7 100%);
  box-shadow: var(--small-shadow);
  transition:
    background 240ms ease,
    transform 180ms ease;
}

.launch-scene-stage {
  display: block;
  min-height: auto;
  aspect-ratio: 1 / 1;
  background: #dbeafe;
}

.launchpad-scene {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rocket-scene {
  position: absolute;
  left: 50%;
  bottom: 10%;
  width: min(36%, 220px);
  height: auto;
  transform: translateX(-50%);
  filter: drop-shadow(5px 8px 0 rgba(20, 33, 61, 0.22));
  transition:
    transform 320ms ease,
    filter 240ms ease;
}

.launch-scene-stage.is-launched .rocket-scene {
  filter: drop-shadow(3px 5px 0 rgba(20, 33, 61, 0.18));
  animation: rocket-takeoff 1.25s cubic-bezier(0.45, 0, 0.78, 0.18) forwards;
}

.magic-button-stage.is-running {
  transform: translateY(-2px);
}

.magic-button-trigger {
  width: min(190px, 52vw);
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  cursor: pointer;
}

.magic-button-trigger:disabled {
  cursor: wait;
}

.magic-button-trigger img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(6px 8px 0 rgba(20, 33, 61, 0.22));
  transition:
    transform 140ms ease,
    filter 140ms ease;
}

.magic-button-trigger:active img,
.magic-button-stage.is-pressed .magic-button-trigger img,
.magic-button-stage.is-running .magic-button-trigger img {
  transform: translateY(8px) scale(0.96);
  filter: drop-shadow(2px 3px 0 rgba(20, 33, 61, 0.22));
}

.magic-button-stage p {
  position: relative;
  z-index: 3;
  width: min(86%, 460px);
  margin: 0;
  border: 4px solid var(--ink);
  border-radius: 16px;
  background: var(--white);
  box-shadow: 3px 4px 0 var(--ink);
  padding: 10px 12px;
  text-align: center;
  font-weight: 1000;
}

.launch-scene-stage .scene-message {
  position: absolute;
  left: auto;
  right: 7%;
  top: 33%;
  bottom: auto;
  transform: rotate(-4deg);
  width: min(42%, 420px);
}

.magic-reveal {
  position: absolute;
  right: 18%;
  top: 18%;
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border: 4px solid var(--ink);
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: var(--small-shadow);
  color: var(--ink);
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 2rem;
  font-weight: 1000;
  opacity: 0;
  transform: scale(0.4) rotate(-12deg);
  transition:
    opacity 180ms ease,
    transform 220ms ease;
}

.launch-badge {
  left: 50%;
  right: auto;
  top: auto;
  bottom: 4%;
  translate: -50% 0;
  width: auto;
  min-width: 190px;
  height: auto;
  min-height: 56px;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 1rem;
  text-align: center;
}

.magic-reveal.is-visible {
  opacity: 1;
  transform: scale(1) rotate(-4deg);
}

.magic-sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease;
}

.magic-sparkles.is-visible {
  opacity: 1;
}

.magic-sparkles .firework {
  position: absolute;
  display: grid;
  place-items: center;
  width: clamp(42px, 7vw, 82px);
  height: clamp(42px, 7vw, 82px);
  color: #ffe156;
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: clamp(2.4rem, 6vw, 5rem);
  font-weight: 1000;
  line-height: 1;
  opacity: 0;
  text-shadow:
    0 5px 0 var(--ink),
    0 0 18px rgba(255, 225, 86, 0.95);
  filter: drop-shadow(0 8px 0 rgba(16, 29, 57, 0.2));
  animation: firework-pop 2.7s ease-in-out infinite;
}

.magic-sparkles.is-visible .firework {
  opacity: 1;
}

.magic-sparkles .firework-one {
  right: 11%;
  top: 9%;
  color: #ffe156;
}

.magic-sparkles .firework-two {
  left: 14%;
  top: 20%;
  color: #ff6b8a;
  font-size: clamp(1.8rem, 4vw, 3.3rem);
  animation-delay: 420ms;
}

.magic-sparkles .firework-three {
  right: 30%;
  top: 31%;
  color: #6ee7ff;
  font-size: clamp(2rem, 4.4vw, 3.6rem);
  animation-delay: 920ms;
}

.magic-sparkles .firework-four {
  left: 60%;
  top: 16%;
  color: #9af5a8;
  font-size: clamp(1.5rem, 3.4vw, 2.8rem);
  animation-delay: 1.35s;
}

.magic-sparkles .firework-five {
  left: 27%;
  top: 38%;
  color: #ffb86c;
  font-size: clamp(1.7rem, 3.6vw, 3.1rem);
  animation-delay: 1.75s;
}

.magic-sparkles .firework-six {
  right: 17%;
  top: 48%;
  color: #caa8ff;
  font-size: clamp(1.9rem, 4.2vw, 3.5rem);
  animation-delay: 2.05s;
}

.magic-sparkles .firework-seven {
  left: 58%;
  top: 22%;
  color: #fff176;
  font-size: clamp(1.4rem, 3.2vw, 2.7rem);
  animation-delay: 2.35s;
}

.magic-sparkles .firework-eight {
  left: 8%;
  top: 43%;
  color: #7cf6d4;
  font-size: clamp(1.1rem, 2.8vw, 2.2rem);
  animation-delay: 610ms;
}

.magic-sparkles .firework-nine {
  right: 8%;
  top: 36%;
  color: #ff7ac8;
  font-size: clamp(1rem, 2.6vw, 2rem);
  animation-delay: 1.15s;
}

.magic-sparkles .firework-ten {
  left: 35%;
  top: 9%;
  color: #7aa8ff;
  font-size: clamp(1.05rem, 2.7vw, 2.1rem);
  animation-delay: 1.9s;
}

.magic-sparkles .firework-eleven {
  right: 40%;
  top: 43%;
  color: #ffde59;
  font-size: clamp(1.1rem, 2.8vw, 2.2rem);
  animation-delay: 2.55s;
}

.workspace-subtitle {
  margin: 10px 0;
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 1.25rem;
}

@keyframes magic-pop {
  from {
    transform: translateY(0) scale(1) rotate(8deg);
  }
  to {
    transform: translateY(-8px) scale(1.08) rotate(-5deg);
  }
}

@keyframes sparkle-bounce {
  from {
    transform: translateY(0) scale(0.9);
  }
  to {
    transform: translateY(-14px) scale(1.15);
  }
}

@keyframes firework-pop {
  0%,
  20% {
    opacity: 0;
    transform: translateY(10px) scale(0.35) rotate(-12deg);
  }

  36%,
  72% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(8deg);
  }

  100% {
    opacity: 0;
    transform: translateY(-12px) scale(1.18) rotate(-10deg);
  }
}

@keyframes rocket-takeoff {
  0% {
    transform: translate(-50%, 0) scale(1);
  }
  35% {
    transform: translate(-50%, -32%) scale(1.04);
  }
  100% {
    transform: translate(-50%, -125vh) scale(1.08);
  }
}

.robot-test-stage {
  position: relative;
  overflow: hidden;
  border: 5px solid var(--ink);
  border-radius: 18px;
  background: #0f1a33;
  box-shadow: var(--small-shadow);
}

.classroom-map {
  display: block;
  width: 100%;
  height: auto;
}

.robot-actor {
  position: absolute;
  left: 21%;
  top: 48.5%;
  width: clamp(66px, 10.5%, 118px);
  height: auto;
  object-fit: contain;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 7px 0 rgba(15, 26, 51, 0.35));
  transition: left 650ms ease, top 650ms ease, transform 180ms ease, filter 180ms ease;
  z-index: 2;
}

.star-actor {
  position: absolute;
  left: 80.9%;
  top: 70.8%;
  width: clamp(30px, 4.8%, 56px);
  height: auto;
  object-fit: contain;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 5px 0 rgba(15, 26, 51, 0.35));
  transition: left 650ms ease, top 650ms ease, transform 220ms ease, filter 220ms ease;
  z-index: 3;
}

.star-actor.is-carried {
  animation: star-victory-dance 760ms ease-in-out infinite;
  filter: drop-shadow(0 0 8px rgba(255, 224, 82, 0.95)) drop-shadow(0 5px 0 rgba(15, 26, 51, 0.35));
  z-index: 4;
}

@keyframes star-victory-dance {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1.08) rotate(-8deg);
  }

  25% {
    transform: translate(-50%, -58%) scale(1.2) rotate(8deg);
  }

  50% {
    transform: translate(-50%, -50%) scale(1.12) rotate(14deg);
  }

  75% {
    transform: translate(-50%, -42%) scale(1.18) rotate(-14deg);
  }
}

.robot-actor.is-bumped {
  transform: translate(-50%, -50%) rotate(-8deg) scale(1.04);
  filter: drop-shadow(0 0 8px rgba(255, 91, 91, 0.85)) drop-shadow(0 7px 0 rgba(15, 26, 51, 0.35));
}

.robot-actor.is-celebrating {
  transform: translate(-50%, -50%) scale(1.14);
  filter: drop-shadow(0 0 10px rgba(255, 224, 82, 0.95)) drop-shadow(0 7px 0 rgba(15, 26, 51, 0.35));
}

.robot-test-status {
  margin: 12px 0 0;
  border: 4px dashed var(--ink);
  border-radius: 14px;
  background: #ecfeff;
  padding: 10px 12px;
  font-weight: 1000;
}

.step-input-list {
  display: grid;
  gap: 10px;
  margin: 8px 0 14px;
}

.step-input-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.step-input-row span {
  min-width: 38px;
  border: 4px solid var(--ink);
  border-radius: 12px;
  background: var(--yellow);
  box-shadow: 2px 3px 0 var(--ink);
  padding: 8px 6px;
  text-align: center;
  font-weight: 1000;
}

.robot-step-input {
  width: 100%;
  border: 4px solid var(--ink);
  border-radius: 16px;
  background: #fffdf6;
  color: var(--ink);
  padding: 12px 14px;
  font: 1rem/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  outline: none;
}

.workspace-actions {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin: 12px 0 14px;
}

.workspace-actions .secondary-button {
  flex: 0 1 auto;
}

.run-robot-button {
  background: #a7f3d0;
}

.reset-robot-button {
  background: #e0e7ff;
}

.workspace-actions button:disabled {
  cursor: wait;
  opacity: 0.68;
  transform: none;
}

.activity-feedback {
  min-height: 34px;
  border: 4px dashed var(--ink);
  border-radius: 14px;
  background: #ecfeff;
  padding: 12px;
}

.ai-grader-report {
  margin-top: 14px;
  border: 5px solid var(--ink);
  border-radius: 18px;
  background: #fff7cc;
  box-shadow: var(--small-shadow);
  padding: 16px;
}

.ai-grader-report[hidden] {
  display: none;
}

.ai-grader-report strong {
  display: block;
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 1.35rem;
}

.ai-grader-report p {
  margin: 10px 0;
  font-size: 1.15rem;
}

.ai-grader-report ul {
  margin: 0;
  padding-left: 20px;
}

.storyboard-card-bank {
  display: grid;
  gap: 16px;
  min-width: 0;
  overflow: hidden;
}

.syntax-sandwich-card-bank p {
  max-width: 760px;
}

.syntax-role-strip,
.sandwich-mission-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.syntax-role-strip div {
  display: grid;
  grid-template-columns: 54px 1fr;
  grid-template-areas:
    "icon title"
    "icon hint";
  align-items: center;
  min-height: 84px;
  padding: 10px 12px;
  border: 5px solid var(--ink);
  border-radius: 22px;
  background: #fff8cf;
  box-shadow: 5px 5px 0 var(--ink);
}

.syntax-role-strip img,
.syntax-role-strip .ingredient-filling-stack {
  grid-area: icon;
  width: 50px;
  height: 48px;
}

.syntax-role-strip strong {
  grid-area: title;
  font-size: clamp(1rem, 1.4vw, 1.25rem);
  line-height: 1.05;
}

.syntax-role-strip span:not(.ingredient-filling-stack) {
  grid-area: hint;
  color: #4b5563;
  font-weight: 900;
  font-size: 0.95rem;
}

.sandwich-mission-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sandwich-mission-button {
  min-height: 66px;
  padding: 10px 14px;
  border: 5px solid var(--ink);
  border-radius: 24px;
  background: #dbeafe;
  box-shadow: 6px 6px 0 var(--ink);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: clamp(1rem, 1.6vw, 1.35rem);
  font-weight: 900;
}

.sandwich-mission-button.is-selected {
  background: #a7f3d0;
}

.syntax-ingredient-scene {
  margin: 18px 0 8px;
}

.syntax-fridge-wrap {
  position: relative;
  width: min(100%, 680px);
  margin: 0 auto;
}

.syntax-fridge {
  width: 100%;
  max-height: 560px;
  object-fit: contain;
  filter: drop-shadow(8px 8px 0 var(--ink));
}

.ingredient-filling-stack {
  display: grid;
  place-items: center;
}

.ingredient-filling-stack img {
  grid-area: 1 / 1;
  width: 50px;
  max-height: 48px;
  object-fit: contain;
}

.ingredient-filling-stack img:nth-child(2) {
  transform: translateY(10px);
}

.ingredient-filling-stack img:nth-child(3) {
  transform: translateY(20px);
}

.ingredient-bottom-bread {
  transform: rotate(180deg);
}

.fridge-hotspot {
  position: absolute;
  display: grid;
  place-items: center;
  min-width: 78px;
  min-height: 42px;
  padding: 6px 10px;
  border: 4px solid var(--ink);
  border-radius: 999px;
  background: rgba(167, 243, 208, 0.92);
  box-shadow: 4px 4px 0 var(--ink);
  color: var(--ink);
  cursor: grab;
  font: inherit;
  font-size: clamp(0.8rem, 1vw, 1rem);
  font-weight: 900;
}

.fridge-hotspot:hover,
.fridge-hotspot:focus-visible {
  background: #fde68a;
  transform: translateY(-2px);
}

.fridge-hotspot:active,
.fridge-hotspot.is-dragging {
  cursor: grabbing;
  background: #ffdf45;
  transform: translateY(-4px) scale(1.04);
  z-index: 5;
}

.fridge-hotspot.is-picked {
  background: #dbeafe;
}

.fridge-hotspot:disabled {
  cursor: default;
  opacity: 0.55;
  transform: none;
}

.fridge-hotspot-bread {
  left: 26%;
  top: 24%;
}

.fridge-hotspot-ham {
  left: 22%;
  top: 42%;
}

.fridge-hotspot-cheese {
  left: 46%;
  top: 42%;
}

.fridge-hotspot-lettuce {
  left: 24%;
  top: 56%;
}

.fridge-hotspot-tomato {
  left: 48%;
  top: 56%;
}

.fridge-hotspot-pickle {
  left: 23%;
  top: 70%;
}

.fridge-hotspot-bacon {
  left: 48%;
  top: 70%;
}

.fridge-hotspot-ketchup {
  left: 75%;
  top: 29%;
}

.syntax-card-grid {
  grid-template-columns: repeat(3, minmax(170px, 1fr));
}

.syntax-card {
  min-height: 230px;
}

.syntax-sandwich-preview {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) minmax(220px, 1.1fr);
  gap: 18px;
  align-items: stretch;
  margin: 18px 0;
}

.syntax-output-card .syntax-sandwich-preview {
  grid-template-columns: 1fr;
  margin-top: 22px;
}

.syntax-output-card .workspace-actions {
  margin-top: 16px;
}

.syntax-sandwich-stack,
.syntax-code-preview {
  min-height: 260px;
  border: 6px solid var(--ink);
  border-radius: 24px;
  background: #fff8cf;
  box-shadow: 8px 8px 0 var(--ink);
}

.syntax-sandwich-stack {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0;
  padding: 18px;
  overflow: hidden;
  transition: background 180ms ease, box-shadow 180ms ease, outline-color 180ms ease;
}

.syntax-output-card .syntax-sandwich-stack {
  min-height: clamp(340px, 36vw, 500px);
  background: #fff;
}

.syntax-sandwich-stack.is-drop-ready {
  outline: 6px dashed #7ee8a3;
  outline-offset: -16px;
  background: #ecfff3;
  box-shadow: 8px 8px 0 var(--ink), inset 0 0 0 10px rgba(126, 232, 163, 0.32);
}

.syntax-sandwich-stack.is-drop-ready::before {
  content: "Drop it on the plate";
  position: absolute;
  z-index: 4;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 16px;
  border: 4px solid var(--ink);
  border-radius: 999px;
  background: #ffdf45;
  box-shadow: 4px 4px 0 var(--ink);
  color: var(--ink);
  font-weight: 900;
  pointer-events: none;
}

.syntax-sandwich-stack.is-drop-ready .sandwich-build {
  transform: scale(1.02);
}

.syntax-output-card .syntax-code-preview {
  min-height: 130px;
  font-size: clamp(0.92rem, 1.45vw, 1.1rem);
}

.syntax-sandwich-stack .empty-story-step {
  margin: 0;
  text-align: center;
}

.sandwich-build {
  position: relative;
  width: min(100%, 470px);
  min-height: 420px;
  display: grid;
  place-items: center;
}

.sandwich-build.is-empty {
  display: block;
}

.sandwich-build.is-empty .empty-story-step {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 200px;
  transform: translateX(-50%);
  max-width: none;
  white-space: nowrap;
}

.sandwich-layers {
  position: absolute;
  left: 50%;
  bottom: 92px;
  z-index: 2;
  width: min(64%, 290px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
}

.sandwich-piece,
.sandwich-fillings {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  margin-bottom: -10px;
}

/* In column-reverse the first child is the physically lowest piece; its
   negative margin only overflows the box and skews vertical centering. */
.sandwich-layers > :first-child {
  margin-bottom: 0;
}

.sandwich-plate {
  position: absolute;
  left: 50%;
  bottom: 26px;
  z-index: 1;
  width: min(94%, 440px);
  height: auto;
  transform: translateX(-50%);
  object-fit: contain;
  filter: drop-shadow(0 8px 0 rgba(20, 33, 61, 0.12));
}

.sandwich-piece img {
  width: 100%;
  max-height: 228px;
  object-fit: contain;
}

.sandwich-piece svg {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(2px 3px 0 rgba(20, 33, 61, 0.25));
}

.sandwich-filling svg {
  width: 88%;
}

.sandwich-filling img {
  width: 126%;
  max-height: 164px;
}

.sandwich-filling:has(img[src*="ketchup"]) img {
  max-height: 168px;
}

.sandwich-bottom img {
  transform: rotate(0deg);
}

.sandwich-fillings {
  grid-template-columns: repeat(3, 1fr);
  width: min(100%, 250px);
  padding: 4px 0;
}

.sandwich-fillings img {
  width: 86px;
  height: 62px;
  object-fit: contain;
}

.sandwich-piece span,
.sandwich-fillings span {
  display: none;
}

.sandwich-fillings span {
  bottom: -6px;
  background: #dbeafe;
}

.syntax-code-preview {
  margin: 0;
  padding: 24px;
  background: #101d39;
  color: #bdf8d0;
  font-family: "Courier New", monospace;
  font-size: clamp(1rem, 1.8vw, 1.55rem);
  line-height: 1.55;
  white-space: pre-wrap;
}

.story-challenge-intro {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(260px, 1fr);
  gap: 16px;
  align-items: stretch;
  min-width: 0;
}

.story-challenge-copy {
  display: grid;
  align-content: center;
  gap: 12px;
  border: 5px solid var(--ink);
  border-radius: 18px;
  background: #fff7cc;
  box-shadow: var(--small-shadow);
  padding: 18px;
}

.story-challenge-copy .eyebrow {
  max-width: max-content;
}

.story-challenge-copy h3,
.story-challenge-copy p {
  margin: 0;
}

.storyboard-workshop[hidden],
.activity-card[hidden] {
  display: none;
}

.practice-story {
  border: 5px solid var(--ink);
  border-radius: 18px;
  background: #eef2ff;
  box-shadow: var(--small-shadow);
  padding: 16px;
}

.practice-story h4 {
  margin: 0;
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 1.35rem;
}

.practice-story p {
  margin: 6px 0 12px;
}

.practice-story-grid {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.practice-card {
  min-height: 238px;
  background: #dcfce7;
}

.story-card-image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  margin-bottom: 12px;
  border: 4px solid var(--ink);
  border-radius: 16px;
  background: #fff;
  box-shadow: 3px 4px 0 var(--ink);
}

.practice-order-list {
  margin-top: 12px;
}

.storyboard-preview {
  min-height: 190px;
  border: 5px solid var(--ink);
  border-radius: 18px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.68)),
    repeating-linear-gradient(90deg, rgba(16, 24, 39, 0.08) 0 1px, transparent 1px 52px),
    repeating-linear-gradient(0deg, rgba(16, 24, 39, 0.08) 0 1px, transparent 1px 52px),
    #dbeafe;
  box-shadow: var(--small-shadow);
  padding: 18px;
  display: grid;
  place-items: center;
}

.storyboard-preview .story-sentence-box {
  width: 100%;
  min-height: 160px;
}

.story-display-pill {
  font-size: 1.05rem;
}

.story-scene {
  width: min(100%, 420px);
  border: 5px solid var(--ink);
  border-radius: 18px;
  background: #fffdf6;
  box-shadow: 5px 7px 0 var(--ink);
  padding: 18px;
  text-align: center;
}

.scene-icon {
  min-height: 66px;
  display: grid;
  place-items: center;
  width: fit-content;
  min-width: 112px;
  margin: 0 auto 12px;
  border: 4px solid var(--ink);
  border-radius: 999px;
  background: var(--yellow);
  box-shadow: 3px 4px 0 var(--ink);
  padding: 8px 16px;
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 1.15rem;
  font-weight: 1000;
}

.story-scene strong {
  display: block;
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 1.5rem;
}

.story-scene p {
  margin: 8px 0 0;
}

.story-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.adventure-card-grid {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  justify-items: center;
}

.story-card {
  min-height: 148px;
  border: 5px solid var(--ink);
  border-radius: 18px;
  background: #fff7cc;
  color: var(--ink);
  box-shadow: var(--small-shadow);
  padding: 14px;
  text-align: left;
  cursor: pointer;
}

.image-story-card {
  min-height: 0;
  width: min(85%, 165px);
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  overflow: hidden;
}

.adventure-card-image {
  aspect-ratio: 2 / 3;
  margin: 0;
  border: 0;
  border-radius: 14px;
  box-shadow: none;
  background: transparent;
  object-fit: cover;
}

.image-story-card span,
.image-story-card strong,
.image-story-card small {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.story-card span,
.story-order-list span {
  display: inline-grid;
  place-items: center;
  min-width: 54px;
  min-height: 34px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: #a7f3d0;
  margin-bottom: 8px;
  padding: 4px 9px;
  font-family: "Fredoka", system-ui, sans-serif;
  font-weight: 1000;
}

.story-card strong {
  display: block;
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 1.12rem;
}

.story-card small {
  display: block;
  margin-top: 6px;
  font-weight: 850;
  line-height: 1.25;
}

.story-card.is-picked,
.story-card:disabled {
  background: #e0e7ff;
  cursor: default;
  opacity: 0.72;
  transform: translate(3px, 3px);
  box-shadow: none;
}

.story-order-list {
  display: grid;
  gap: 10px;
  margin: 14px 0;
  padding: 0;
  list-style-position: inside;
}

.story-order-list li {
  border: 4px solid var(--ink);
  border-radius: 16px;
  background: #fffdf6;
  box-shadow: 2px 3px 0 var(--ink);
  padding: 12px;
  font-weight: 1000;
}

.story-order-list span {
  margin: 0 8px 0 0;
}

.story-test-panel {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  border: 5px solid var(--ink);
  border-radius: 20px;
  background: #f8fafc;
  box-shadow: var(--small-shadow);
  padding: 16px;
}

.story-test-panel .workspace-actions {
  margin: 0;
}

.story-test-panel .activity-feedback {
  margin: 0;
}

.story-sentence-box {
  margin-top: 0;
  border: 4px solid var(--ink);
  border-radius: 18px;
  background: #fffdf6;
  box-shadow: 3px 4px 0 var(--ink);
  padding: 16px;
}

.story-sentence-box strong {
  display: block;
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.story-sentence-list {
  display: block;
  margin: 0;
  padding: 0;
  font-weight: 900;
  line-height: 1.45;
}

.story-sentence {
  border-radius: 10px;
  padding: 2px 4px;
  transition:
    background 180ms ease,
    color 180ms ease;
}

.story-sentence + .story-sentence {
  margin-left: 4px;
}

.story-sentence.is-active {
  background: var(--yellow);
  color: var(--ink);
}

.story-sentence.is-read {
  color: #2563eb;
}

.story-sentence-box.is-complete {
  border-color: #047857;
  background: #dcfce7;
  color: #064e3b;
}

.empty-story-step {
  list-style: none;
  color: rgba(16, 24, 39, 0.7);
}

.builder-label {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  font-weight: 1000;
}

.builder-label input,
.builder-label select {
  width: 100%;
  min-height: 52px;
  border: 4px solid var(--ink);
  border-radius: 14px;
  background: #fffdf6;
  color: var(--ink);
  padding: 10px 12px;
  font: inherit;
  font-weight: 900;
  outline: none;
}

.button-preview {
  display: grid;
  gap: 16px;
  place-items: center;
  min-height: 260px;
  border: 5px solid var(--ink);
  border-radius: 18px;
  background: #eef2ff;
  box-shadow: var(--small-shadow);
  padding: 20px;
  text-align: center;
}

.chalkboard-preview {
  position: relative;
  width: min(92%, 520px);
  min-height: auto;
  aspect-ratio: 1;
  overflow: visible;
  margin: 0 auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.chalkboard-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  transform: none;
  transform-origin: center center;
}

.chalkboard-preview p,
.chalkboard-preview strong {
  position: absolute;
  left: 50%;
  z-index: 2;
  width: min(72%, 620px);
  color: var(--chalk-color, #f8fafc);
  font-family: "Schoolbell", "Comic Sans MS", "Marker Felt", cursive;
  font-weight: 700;
  line-height: 1.05;
  text-shadow:
    0 2px 0 rgba(16, 29, 57, 0.8),
    0 0 10px rgba(255, 255, 255, 0.34);
}

.chalkboard-preview p {
  top: 35%;
  transform: translate(-50%, -50%);
  font-size: clamp(1.5rem, 2.8vw, 2.35rem);
}

.chalkboard-preview strong {
  top: 58%;
  transform: translateX(-50%);
  font-size: clamp(1rem, 2.1vw, 1.75rem);
}

.challenge-chalkboard-preview {
  width: min(100%, 620px);
  aspect-ratio: 1;
  overflow: hidden;
  margin: 0 auto 12px;
}

.message-challenge-workshop .challenge-chalkboard-preview img {
  width: 108%;
  height: 108%;
  object-fit: contain;
  transform: translate(-4%, -4%);
}

.challenge-chalkboard-preview p {
  top: 36%;
  width: min(64%, 390px);
  font-family: "DK Crayon Crumble", "Schoolbell", "Comic Sans MS", "Marker Felt", cursive;
  font-size: clamp(1.25rem, 2.45vw, 2rem);
  text-align: center;
}

.challenge-chalkboard-preview strong {
  top: 58%;
  width: min(58%, 340px);
  font-family: "DK Crayon Crumble", "Schoolbell", "Comic Sans MS", "Marker Felt", cursive;
  font-size: clamp(1rem, 1.9vw, 1.45rem);
  text-align: center;
}

.challenge-chalkboard-preview.has-greeting-bubble p {
  left: 37%;
  top: 29%;
  z-index: 3;
  width: auto;
  max-width: min(42%, 280px);
  padding: 0.55em 0.85em 0.6em;
  border: 4px solid var(--chalk-color, #f8fafc);
  border-radius: 999px;
  background: rgba(24, 49, 43, 0.82);
  transform: translate(-50%, -50%) rotate(-2deg);
  line-height: 1;
  filter: drop-shadow(0 3px 0 rgba(16, 29, 57, 0.65));
}

.challenge-chalkboard-preview.has-greeting-bubble p::after {
  content: "";
  position: absolute;
  right: 11%;
  bottom: -0.62em;
  width: 1em;
  height: 1em;
  border-right: 4px solid var(--chalk-color, #f8fafc);
  border-bottom: 4px solid var(--chalk-color, #f8fafc);
  background: rgba(24, 49, 43, 0.82);
  transform: rotate(38deg);
}

.challenge-chalkboard-preview.has-greeting-bubble strong {
  top: 58%;
}

.challenge-chalkboard-preview.has-chalk-border::before {
  content: "";
  position: absolute;
  left: 24%;
  top: 29%;
  z-index: 2;
  width: 52%;
  height: 42%;
  border: 4px dashed var(--chalk-color, #f8fafc);
  border-radius: 18px;
  opacity: 0.92;
  pointer-events: none;
  filter: drop-shadow(0 2px 0 rgba(16, 29, 57, 0.55));
}

.challenge-chalkboard-preview.has-smiley-face::after {
  content: "";
  position: absolute;
  right: 24%;
  bottom: 25%;
  z-index: 2;
  width: clamp(50px, 9vw, 86px);
  aspect-ratio: 1;
  background: url("assets/images/chalk_face.png") center / contain no-repeat;
  transform: rotate(-4deg);
  filter: drop-shadow(0 2px 0 rgba(16, 29, 57, 0.7));
  pointer-events: none;
}

.chalkboard-stars {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease;
}

.chalkboard-stars.is-visible {
  opacity: 1;
}

.chalkboard-stars .chalk-star,
.chalkboard-stars .chalk-confetti {
  position: absolute;
  display: none;
  opacity: 0;
}

.chalkboard-stars .chalk-star {
  color: #ffe156;
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: clamp(1.8rem, 5vw, 4.2rem);
  font-weight: 1000;
  line-height: 1;
  text-shadow:
    0 5px 0 var(--ink),
    0 0 18px rgba(255, 225, 86, 0.95);
  animation: firework-pop 2.7s ease-in-out infinite;
}

.chalkboard-stars .chalk-confetti {
  width: clamp(10px, 1.6vw, 18px);
  height: clamp(18px, 2.4vw, 28px);
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: #ff6b8a;
  box-shadow: var(--small-shadow);
  top: -12%;
  animation: confetti-fall 2.7s ease-in infinite;
  animation-fill-mode: both;
}

.chalkboard-stars.is-visible.show-stars .chalk-star,
.chalkboard-stars.is-visible.show-confetti .chalk-confetti {
  display: block;
  opacity: 1;
}

.chalkboard-stars .chalk-star-one {
  left: 12%;
  top: 12%;
  color: #ff6b8a;
}

.chalkboard-stars .chalk-star-two {
  right: 15%;
  top: 16%;
  color: #6ee7ff;
  animation-delay: 420ms;
}

.chalkboard-stars .chalk-star-three {
  left: 20%;
  bottom: 16%;
  color: #9af5a8;
  animation-delay: 860ms;
}

.chalkboard-stars .chalk-star-four {
  right: 22%;
  bottom: 18%;
  color: #ffb86c;
  animation-delay: 1.2s;
}

.chalkboard-stars .chalk-star-five {
  left: 50%;
  top: 10%;
  color: #caa8ff;
  font-size: clamp(1.25rem, 3.4vw, 2.8rem);
  animation-delay: 1.7s;
}

.chalkboard-stars .chalk-star-six {
  right: 8%;
  top: 47%;
  color: #ffde59;
  font-size: clamp(1.35rem, 3.6vw, 3rem);
  animation-delay: 2.2s;
}

.chalkboard-stars .chalk-confetti-one {
  left: 9%;
  background: #6ee7ff;
  --drift: 34px;
  --spin: 180deg;
}

.chalkboard-stars .chalk-confetti-two {
  left: 24%;
  background: #f9a8d4;
  --drift: -28px;
  --spin: -220deg;
  animation-delay: 220ms;
}

.chalkboard-stars .chalk-confetti-three {
  left: 40%;
  background: #a7f3d0;
  --drift: 24px;
  --spin: 260deg;
  animation-delay: 480ms;
}

.chalkboard-stars .chalk-confetti-four {
  left: 57%;
  background: #ffb86c;
  --drift: -34px;
  --spin: -180deg;
  animation-delay: 720ms;
}

.chalkboard-stars .chalk-confetti-five {
  left: 72%;
  background: #caa8ff;
  --drift: 22px;
  --spin: 300deg;
  animation-delay: 980ms;
}

.chalkboard-stars .chalk-confetti-six {
  left: 86%;
  background: #ffe252;
  --drift: -26px;
  --spin: -280deg;
  animation-delay: 1.22s;
}

@keyframes confetti-fall {
  0% {
    opacity: 0;
    transform: translate(0, 0) rotate(0deg) scale(0.9);
  }

  12% {
    opacity: 1;
  }

  78% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate(var(--drift, 20px), var(--fall-distance, 1180%)) rotate(var(--spin, 220deg)) scale(1);
  }
}

.built-button {
  min-width: 220px;
  border: 5px solid var(--ink);
  border-radius: 18px;
  background: #a7f3d0;
  box-shadow: var(--small-shadow);
  color: var(--ink);
  padding: 18px 22px;
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 1.25rem;
  font-weight: 1000;
}

.button-preview p,
.button-preview strong {
  margin: 0;
}

.button-preview:not(.chalkboard-preview) strong {
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 1.5rem;
}

.level-preview {
  display: grid;
  gap: 16px;
  min-height: 260px;
  border: 5px solid var(--ink);
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(20, 33, 61, 0.07) 1px, transparent 1px),
    linear-gradient(rgba(20, 33, 61, 0.07) 1px, transparent 1px),
    #eef2ff;
  background-size: 34px 34px;
  box-shadow: var(--small-shadow);
  padding: 20px;
}

.level-track {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.level-tile {
  min-height: 116px;
  display: grid;
  place-items: center;
  border: 5px solid var(--ink);
  border-radius: 18px;
  box-shadow: 3px 4px 0 var(--ink);
  padding: 12px;
  text-align: center;
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: clamp(1rem, 2vw, 1.35rem);
  font-weight: 1000;
  line-height: 1.05;
}

.level-player {
  background: #a7f3d0;
}

.level-obstacle {
  background: #fed7aa;
}

.level-goal {
  background: #fde047;
}

.level-message {
  margin: 0;
  border: 4px solid var(--ink);
  border-radius: 16px;
  background: #fffdf6;
  box-shadow: 2px 3px 0 var(--ink);
  padding: 14px;
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 1.35rem;
  font-weight: 1000;
  text-align: center;
}

.repeat-preview {
  display: grid;
  gap: 16px;
  min-height: 260px;
  border: 5px solid var(--ink);
  border-radius: 18px;
  background: #eef2ff;
  box-shadow: var(--small-shadow);
  padding: 20px;
}

.repeat-track {
  display: flex;
  align-content: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  min-height: 130px;
  border: 4px solid var(--ink);
  border-radius: 16px;
  background:
    linear-gradient(90deg, rgba(20, 33, 61, 0.07) 1px, transparent 1px),
    linear-gradient(rgba(20, 33, 61, 0.07) 1px, transparent 1px),
    #fffdf6;
  background-size: 30px 30px;
  padding: 14px;
}

.repeat-token {
  display: inline-grid;
  place-items: center;
  min-height: 52px;
  border: 4px solid var(--ink);
  border-radius: 999px;
  background: #a7f3d0;
  box-shadow: 2px 3px 0 var(--ink);
  padding: 10px 14px;
  font-family: "Fredoka", system-ui, sans-serif;
  font-weight: 1000;
}

.capstone-preview {
  display: grid;
  gap: 14px;
  min-height: 300px;
  border: 5px solid var(--ink);
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(20, 33, 61, 0.07) 1px, transparent 1px),
    linear-gradient(rgba(20, 33, 61, 0.07) 1px, transparent 1px),
    #eef2ff;
  background-size: 32px 32px;
  box-shadow: var(--small-shadow);
  padding: 20px;
}

.capstone-preview h3 {
  margin: 0;
}

.capstone-preview ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 22px;
}

.capstone-preview li {
  border: 4px solid var(--ink);
  border-radius: 14px;
  background: #fffdf6;
  box-shadow: 2px 3px 0 var(--ink);
  padding: 10px 12px;
  font-weight: 1000;
}

.capstone-program-workshop {
  grid-template-columns: minmax(330px, 0.82fr) minmax(430px, 1fr);
  align-items: start;
}

.mini-program-bank {
  display: grid;
  gap: 14px;
}

.mini-program-objectives {
  margin: 0;
}

.program-block-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.program-block {
  min-height: 136px;
  background: #eef2ff;
  touch-action: none;
}

.program-block:nth-child(2n) {
  background: #fff7cc;
}

.program-block:nth-child(3n) {
  background: #dcfce7;
}

.program-block.is-dragging {
  opacity: 0.55;
  transform: rotate(-1deg) translateY(4px);
}

.program-block:disabled {
  pointer-events: none;
}

.mini-program-output h4 {
  margin: 14px 0 0;
  font-size: 1.15rem;
}

.mini-program-stage {
  position: relative;
  min-height: clamp(260px, 32vw, 390px);
  overflow: hidden;
  border: 5px solid var(--ink);
  border-radius: 18px;
  background: #0f172a;
  box-shadow: var(--small-shadow);
}

.mini-program-room {
  display: block;
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
}

.mini-program-robot,
.mini-program-star {
  position: absolute;
  display: block;
  filter: drop-shadow(3px 5px 0 rgba(15, 23, 42, 0.24));
  transition: transform 700ms ease, opacity 300ms ease;
  pointer-events: none;
}

.mini-program-robot {
  left: 20%;
  top: 48%;
  width: clamp(54px, 9vw, 96px);
  transform: translate(-50%, -50%);
  z-index: 3;
}

.mini-program-star {
  right: 14%;
  bottom: 17%;
  width: clamp(42px, 7vw, 74px);
  z-index: 2;
}

.mini-program-message {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 16px;
  margin: 0;
  border: 4px solid var(--ink);
  border-radius: 999px;
  background: #fff7cc;
  box-shadow: 2px 3px 0 var(--ink);
  padding: 10px 14px;
  text-align: center;
  font-family: "Fredoka", system-ui, sans-serif;
  font-weight: 1000;
  z-index: 4;
}

.capstone-drop-zone {
  min-height: 180px;
  border: 4px dashed var(--ink);
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(20, 33, 61, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(20, 33, 61, 0.06) 1px, transparent 1px),
    #f8fafc;
  background-size: 28px 28px;
  padding: 12px;
}

.capstone-drop-zone.is-drop-ready {
  background:
    linear-gradient(90deg, rgba(20, 33, 61, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(20, 33, 61, 0.06) 1px, transparent 1px),
    #dcfce7;
}

.mini-program-stage.has-program-bug .mini-program-robot {
  animation: robotBugShake 420ms ease;
}

.mini-program-stage.is-program-ready .mini-program-robot {
  transform: translate(430%, 170%) scale(1.05);
}

.mini-program-stage.is-program-ready .mini-program-star {
  opacity: 0;
  transform: translate(-34px, -42px) scale(0.85);
}

.mini-program-stage.is-program-ready::after {
  content: "Program works!";
  position: absolute;
  top: 18px;
  right: 18px;
  border: 4px solid var(--ink);
  border-radius: 999px;
  background: #ffb347;
  box-shadow: 2px 3px 0 var(--ink);
  padding: 10px 14px;
  font-family: "Fredoka", system-ui, sans-serif;
  font-weight: 1000;
  z-index: 5;
}

@keyframes robotBugShake {
  0%,
  100% {
    transform: translate(-50%, -50%);
  }
  30% {
    transform: translate(calc(-50% - 10px), -50%) rotate(-4deg);
  }
  60% {
    transform: translate(calc(-50% + 10px), -50%) rotate(4deg);
  }
}

.variable-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-height: 260px;
  border: 5px solid var(--ink);
  border-radius: 18px;
  background: #eef2ff;
  box-shadow: var(--small-shadow);
  padding: 20px;
}

.variable-card {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 150px;
  border: 5px solid var(--ink);
  border-radius: 18px;
  background: #fff7cc;
  box-shadow: 3px 4px 0 var(--ink);
  padding: 16px;
  text-align: center;
}

.variable-card span {
  display: inline-grid;
  place-items: center;
  min-height: 34px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: #a7f3d0;
  padding: 4px 10px;
  font-family: "Fredoka", system-ui, sans-serif;
  font-weight: 1000;
}

.variable-card strong {
  overflow-wrap: anywhere;
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: clamp(1.25rem, 3vw, 2rem);
  line-height: 1;
}

.variable-preview .level-message {
  grid-column: 1 / -1;
}

.profile-preview {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.game-state-preview {
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
}

.color-swatch-card {
  transition: background 180ms ease, transform 180ms ease;
}

.color-swatch-card strong {
  color: var(--ink);
  text-transform: capitalize;
}

.switch-room {
  display: grid;
  place-items: center;
  min-height: 150px;
  border: 5px solid var(--ink);
  border-radius: 18px;
  box-shadow: 3px 4px 0 var(--ink);
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: clamp(1.4rem, 3vw, 2.3rem);
  font-weight: 1000;
  text-align: center;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.switch-room.is-on {
  background: #fff176;
  color: var(--ink);
}

.switch-room.is-off {
  background: #17213a;
  color: #f8fafc;
}

.playground-section {
  display: grid;
  grid-template-columns: minmax(280px, 0.75fr) minmax(300px, 0.55fr) minmax(320px, 0.75fr);
  gap: 20px;
  align-items: stretch;
  background: #dbeafe;
  border-block: 5px solid var(--ink);
}

.quest-builder,
.quest-output {
  background: var(--white);
  padding: 20px;
}

.quest-builder {
  display: grid;
  gap: 14px;
}

.quest-builder label {
  display: grid;
  gap: 7px;
  font-weight: 1000;
}

.quest-builder input,
.quest-builder select {
  width: 100%;
  min-height: 50px;
  border: 4px solid var(--ink);
  border-radius: 14px;
  background: #fffdf6;
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
}

.quest-output pre {
  border: 4px solid var(--ink);
  border-radius: 14px;
  background: #101827;
  color: #bbf7d0;
  padding: 16px;
  overflow-x: auto;
}

.code-studio-editor {
  display: grid;
  gap: 14px;
}

.code-console-workshop {
  grid-template-columns: minmax(320px, 0.78fr) minmax(420px, 1.22fr);
  align-items: start;
}

.command-library-card,
.console-interface-card {
  display: grid;
  align-content: start;
  gap: 14px;
}

.string-example {
  display: grid;
  gap: 10px;
  border: 5px solid var(--ink);
  border-radius: 18px;
  background: var(--yellow);
  box-shadow: var(--small-shadow);
  padding: 16px;
}

.string-example span {
  width: fit-content;
  border: 4px solid var(--ink);
  border-radius: 999px;
  background: var(--mint);
  box-shadow: 3px 4px 0 var(--ink);
  padding: 6px 14px;
  font-family: "Fredoka", system-ui, sans-serif;
  font-weight: 1000;
}

.string-example code,
.code-command-card code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-weight: 900;
}

.string-example code {
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.code-command-list {
  display: grid;
  gap: 14px;
}

.code-command-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 14px;
  align-items: center;
  width: 100%;
  border: 5px solid var(--ink);
  border-radius: 18px;
  background: #fff8c9;
  box-shadow: var(--small-shadow);
  color: var(--ink);
  padding: 14px;
  text-align: left;
  cursor: pointer;
}

.code-command-card:hover,
.code-command-card:focus-visible {
  transform: translateY(-2px);
  background: var(--mint);
}

.code-command-card span {
  display: grid;
  grid-row: span 2;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 4px solid var(--ink);
  border-radius: 14px;
  background: var(--yellow);
  box-shadow: 3px 4px 0 var(--ink);
  font-family: "Fredoka", system-ui, sans-serif;
  font-weight: 1000;
}

.code-command-card strong {
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 1.08rem;
  line-height: 1.05;
}

.code-command-card code {
  color: #14532d;
  font-size: 0.96rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.console-result-panel {
  display: grid;
  gap: 10px;
}

.code-studio-editor textarea {
  width: 100%;
  min-height: 260px;
  resize: vertical;
  border: 5px solid var(--ink);
  border-radius: 14px;
  background: #101827;
  color: #bbf7d0;
  box-shadow: var(--small-shadow);
  padding: 18px;
  font: 800 1.05rem/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  outline: none;
}

.code-studio-editor textarea:focus {
  border-color: var(--coral);
}

.code-output-list li span {
  background: var(--sky);
}

.start-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  background: var(--mint);
}

@media (max-width: 1080px) {
  .hero-section,
  .playground-section,
  .lesson-hero,
  .pathway-overview-hero,
  .pathway-metaphor-card,
  .lesson-workshop,
  .capstone-program-workshop {
    grid-template-columns: 1fr;
  }

  .pathway-grid,
  .pathway-map-grid,
  .project-grid,
  .scaffold-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-section {
    gap: 18px;
    padding-top: 24px;
    padding-bottom: 26px;
  }

  .hero-copy h1 {
    max-width: 680px;
    font-size: clamp(2.85rem, 9vw, 4.85rem);
    line-height: 0.9;
  }

  .hero-copy p {
    max-width: 650px;
    margin: 0;
  }

  .hero-stage {
    min-height: 330px;
  }

  .code-window {
    min-height: 285px;
  }

  .launch-card {
    width: min(68%, 310px);
  }

}

@media (max-width: 720px) {
  .site-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    width: 100%;
    margin-right: 0;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .dropdown-menu,
  .foundations-nav .dropdown-menu,
  .code-nav .dropdown-menu {
    width: min(340px, calc(100vw - 32px));
  }

  .hero-section {
    min-height: auto;
  }

  .hero-stage {
    min-height: 390px;
  }

  .pathway-grid,
  .pathway-map-grid,
  .lesson-link-grid,
  .sequence-list,
  .project-grid,
  .scaffold-grid {
    grid-template-columns: 1fr;
  }

  .space-rescue-scene {
    min-height: 430px;
  }

  .rocket-path {
    left: 14%;
    right: 14%;
    top: 43%;
  }

  .rescue-rocket {
    left: 28%;
    top: 25%;
  }

  .planet-home {
    left: 7%;
    bottom: 27%;
  }

  .planet-rescue {
    right: 7%;
    top: 11%;
  }

  .astronaut-card {
    right: 8%;
    bottom: 23%;
  }

  .start-section {
    align-items: stretch;
    flex-direction: column;
  }

  .story-challenge-intro {
    grid-template-columns: 1fr;
  }

  .syntax-card-grid,
  .syntax-role-strip,
  .syntax-sandwich-preview {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1101px) {
  .lesson-workshop.storyboard-workshop {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr);
  }
}

@media (min-width: 721px) {
  .pathway-metaphor-card {
    grid-template-columns: minmax(0, 1fr) minmax(180px, 0.3fr);
  }
}

/* === Step-by-step instruction guide (reusable) === */
.step-guide {
  margin-top: 34px;
  border: 4px solid var(--ink);
  border-radius: 20px;
  background: var(--white);
  box-shadow: var(--small-shadow);
  padding: clamp(18px, 3vw, 30px);
}

.step-guide h2 {
  margin: 0 0 14px;
  font-family: "Fredoka", sans-serif;
  font-size: clamp(1.3rem, 2.6vw, 1.7rem);
}

.step-guide-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step-guide-list li {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: #eff6ff;
  padding: 12px 14px;
}

.step-guide-list li:nth-child(2n) {
  background: #f0fdf4;
}

.step-number {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 2px 3px 0 var(--ink);
  font-family: "Fredoka", sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
}

.step-guide-list h3 {
  margin: 2px 0 6px;
  font-family: "Fredoka", sans-serif;
  font-size: 1.05rem;
}

.step-guide-list p {
  margin: 0;
  line-height: 1.5;
}

.reflect-guide .step-number {
  background: var(--coral);
  color: var(--white);
}

/* === Drag-and-drop program builder (reusable) === */
.drag-drop-workshop {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 34px;
}

.drag-drop-workshop .launch-card-wide {
  grid-column: 1 / -1;
}

.drag-bank {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
  min-height: 120px;
}

.drag-block {
  display: grid;
  gap: 8px;
  justify-items: center;
  width: 100%;
  border: 4px solid var(--ink);
  border-radius: 14px;
  background: #dbeafe;
  box-shadow: 3px 4px 0 var(--ink);
  padding: 10px;
  cursor: grab;
  font-weight: 900;
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.drag-block:hover {
  transform: translateY(-3px);
  box-shadow: 4px 6px 0 var(--ink);
}

.drag-block img {
  width: min(100%, 150px);
  aspect-ratio: 1;
  object-fit: cover;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: #17213a;
  pointer-events: none;
}

.drag-block span {
  pointer-events: none;
  line-height: 1.15;
}

.drag-block.is-dragging {
  opacity: 0.4;
  cursor: grabbing;
}

.drag-block.in-slot {
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  text-align: left;
  background: var(--mint);
  padding: 8px 10px;
}

.drag-block.in-slot img {
  width: 56px;
}

.program-tray {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: slot;
}

.drop-slot {
  position: relative;
  display: grid;
  align-items: center;
  min-height: 78px;
  border: 3px dashed rgba(20, 33, 61, 0.5);
  border-radius: 14px;
  background: rgba(125, 211, 252, 0.18);
  padding: 8px 8px 8px 52px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.drop-slot::before {
  counter-increment: slot;
  content: counter(slot);
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--white);
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
}

.drop-slot .slot-hint {
  font-weight: 800;
  color: rgba(20, 33, 61, 0.55);
}

.drop-slot.is-over {
  border-color: var(--blue);
  background: rgba(190, 242, 100, 0.45);
}

.drop-slot.is-filled {
  border-style: solid;
  border-color: var(--ink);
  background: var(--white);
}

.drop-slot.is-running {
  animation: slotPulse 0.5s ease;
  background: var(--yellow);
}

.drop-slot.is-wrong {
  border-color: var(--coral);
  background: #ffe4e6;
  animation: trayShake 0.45s ease;
}

@keyframes slotPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

@keyframes trayShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-7px); }
  50% { transform: translateX(7px); }
  75% { transform: translateX(-4px); }
}

/* === Mission Control launch scene === */
.launch-scene {
  position: relative;
  overflow: hidden;
  margin-top: 14px;
  height: clamp(260px, 38vw, 360px);
  border: 4px solid var(--ink);
  border-radius: 16px;
  background: linear-gradient(180deg, #0b1026 0%, #1e1b4b 55%, #312e81 100%);
}

.scene-star {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 0 8px 2px rgba(255, 255, 255, 0.8);
  animation: twinkle 2.2s ease-in-out infinite;
}

.scene-star:nth-child(2n) { animation-delay: 0.7s; }
.scene-star:nth-child(3n) { animation-delay: 1.3s; }

@keyframes twinkle {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.25; transform: scale(0.6); }
}

.scene-moon {
  position: absolute;
  top: 10px;
  right: 18px;
  font-size: 2.4rem;
  animation: moonBob 5s ease-in-out infinite;
}

.scene-zoe {
  position: absolute;
  top: 26px;
  right: 34px;
  font-size: 1.6rem;
  animation: moonBob 5s ease-in-out infinite reverse;
}

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

.scene-ground {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 52px;
  background: linear-gradient(180deg, #4b5563 0%, #374151 40%, #1f2937 100%);
  border-top: 4px solid var(--ink);
  border-radius: 100% 100% 0 0 / 36px 36px 0 0;
}

.scene-pad-base {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: min(40%, 190px);
  height: 14px;
  background: #6b7280;
  border: 3px solid var(--ink);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
}

.scene-rocket {
  position: absolute;
  bottom: 62px;
  left: 50%;
  transform: translateX(-50%);
  width: min(30%, 150px);
  z-index: 2;
  transition: transform 0.3s ease;
}

.launch-scene.is-launching .scene-rocket {
  animation: rocketRumble 0.9s ease-in-out;
}

.launch-scene.is-launched .scene-rocket {
  animation: rocketLaunch 2.4s ease-in forwards;
}

.launch-scene.is-launched::after {
  content: "🎉 Zoe is safe! 🎉";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: "Fredoka", sans-serif;
  font-size: clamp(1.3rem, 3vw, 2rem);
  color: var(--white);
  text-shadow: 2px 3px 0 var(--ink);
  animation: fadeInUp 0.8s ease 1.8s both;
}

.launch-scene .scene-flame {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2.5rem;
  opacity: 0;
  z-index: 1;
}

.launch-scene.is-launching .scene-flame,
.launch-scene.is-launched .scene-flame {
  opacity: 1;
  animation: flameFlicker 0.18s linear infinite;
}

.launch-scene.is-launched .scene-flame {
  animation: flameRise 2.4s ease-in forwards;
}

@keyframes rocketRumble {
  0%, 100% { transform: translateX(-50%); }
  20% { transform: translateX(calc(-50% - 4px)); }
  40% { transform: translateX(calc(-50% + 4px)); }
  60% { transform: translateX(calc(-50% - 3px)); }
  80% { transform: translateX(calc(-50% + 3px)); }
}

@keyframes rocketLaunch {
  0% { transform: translateX(-50%) translateY(0); }
  15% { transform: translateX(calc(-50% + 3px)) translateY(-6px); }
  100% { transform: translateX(-50%) translateY(-420px) scale(0.7); }
}

@keyframes flameFlicker {
  0% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.25); }
  100% { transform: translateX(-50%) scale(1); }
}

@keyframes flameRise {
  0% { transform: translateX(-50%) translateY(0) scale(1.2); opacity: 1; }
  100% { transform: translateX(-50%) translateY(-420px) scale(0.6); opacity: 0; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 720px) {
  .drag-drop-workshop {
    grid-template-columns: minmax(0, 1fr);
  }

  .drag-bank {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .step-guide-list li {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .step-number {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
}

/* === Mini Program Builder animated stage === */
.builder-stage {
  position: relative;
  overflow: hidden;
  height: clamp(170px, 22vw, 220px);
  margin-bottom: 16px;
  border: 4px solid var(--ink);
  border-radius: 16px;
  background: linear-gradient(180deg, #bae6fd 0%, #e0f2fe 70%);
}

.stage-floor {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 32px;
  border-top: 4px solid var(--ink);
  background: repeating-linear-gradient(90deg, #86efac 0 42px, #6ee7b7 42px 84px);
}

.stage-robot {
  position: absolute;
  bottom: 28px;
  left: 6%;
  height: clamp(86px, 12vw, 116px);
  z-index: 2;
  transition: left 0.5s ease;
}

.stage-robot.is-hopping {
  animation: robotHop 0.5s ease;
}

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

.stage-star {
  position: absolute;
  bottom: 42px;
  right: 6%;
  height: clamp(48px, 7vw, 66px);
  animation: twinkle 2s ease-in-out infinite;
}

.stage-caption {
  position: absolute;
  z-index: 3;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 92%;
  padding: 6px 14px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--white);
  box-shadow: 3px 3px 0 var(--ink);
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.builder-stage.is-celebrating .stage-star {
  animation: starParty 0.6s ease infinite;
}

@keyframes starParty {
  0%, 100% { transform: scale(1) rotate(-8deg); }
  50% { transform: scale(1.35) rotate(8deg); }
}

.builder-stage.is-celebrating::after {
  content: "🎉";
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.6rem;
  animation: fadeInUp 0.5s ease both;
}

.capstone-preview li.is-running {
  background: var(--yellow);
  border-radius: 8px;
  transition: background 0.2s ease;
}

/* === Loop builder stage: collectible stars === */
.stage-loop-star {
  position: absolute;
  bottom: 44px;
  height: 42px;
  z-index: 1;
  animation: twinkle 2s ease-in-out infinite;
}

.stage-loop-star.is-collected {
  animation: starCollect 0.45s ease forwards;
}

@keyframes starCollect {
  0% { transform: scale(1); opacity: 1; }
  60% { transform: scale(1.6); opacity: 1; }
  100% { transform: scale(0.2) translateY(-40px); opacity: 0; }
}

.story-order-list li.is-running {
  background: var(--yellow);
  border-radius: 8px;
  transition: background 0.2s ease;
}

/* Celebration dance for characters without a hands-up pose */
.builder-stage.is-celebrating .stage-robot {
  animation: heroDance 0.7s ease-in-out infinite;
}

@keyframes heroDance {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50% { transform: translateY(-16px) rotate(5deg); }
}

/* === Goal targets on the builder stage === */
.stage-goal {
  position: absolute;
  bottom: 42px;
  right: 6%;
  z-index: 1;
  height: 58px;
  display: grid;
  place-items: end center;
  font-size: 2.7rem;
  line-height: 1;
}

.stage-goal img {
  display: block;
  height: inherit;
  width: auto;
}

.stage-goal.goal-star img {
  animation: goalPulse 1.6s ease-in-out infinite;
}

@keyframes goalPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.75; transform: scale(1.1); }
}

.stage-goal.goal-stone {
  bottom: 30px;
  height: 52px;
}

.stage-goal.goal-puppy {
  height: 78px;
  bottom: 30px;
}

.stage-goal.is-collected {
  animation: starCollect 0.5s ease forwards;
}

.stage-goal.is-kicked {
  animation: ballKick 0.8s ease-in forwards;
}

@keyframes ballKick {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  100% { transform: translate(190px, -120px) rotate(540deg); opacity: 0; }
}

.stage-robot.is-leaping {
  animation: robotLeap 0.7s ease;
}

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

/* Movement styles for each repeated action */
.stage-robot.is-bounding {
  animation: robotBound 0.55s ease;
}

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

.stage-robot.is-scooping {
  animation: robotScoop 0.55s ease;
}

@keyframes robotScoop {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(10px) rotate(10deg); }
}

.stage-robot.is-kicking {
  animation: robotKick 0.55s ease;
}

@keyframes robotKick {
  0%, 100% { transform: rotate(0deg) translateX(0); }
  40% { transform: rotate(-10deg) translateX(-4px); }
  70% { transform: rotate(14deg) translateX(8px); }
}

/* Picked-up object: held proudly above the character during celebration */
.stage-goal.is-held {
  bottom: 128px;
  height: 46px;
  z-index: 3;
  opacity: 1;
  animation: heldPop 0.45s ease both, heroDance 0.7s ease-in-out 0.45s infinite;
}

@keyframes heldPop {
  0% { transform: scale(0); opacity: 0; }
  70% { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* "Move forward" = smooth slide with a slight lean, not a jump */
.stage-robot.is-sliding {
  animation: robotSlide 0.5s ease;
}

@keyframes robotSlide {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(5deg) translateY(-2px); }
}

/* === First JavaScript Command: talking robot === */
.say-stage {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: end;
  gap: 12px;
  min-height: 150px;
  margin: 16px 0;
  padding: 14px;
  border: 4px solid var(--ink);
  border-radius: 16px;
  background: linear-gradient(180deg, #e0f2fe 0%, #f0f9ff 100%);
}

.say-robot {
  order: -1;
  height: 110px;
  width: auto;
  align-self: end;
}

.say-robot.is-talking {
  animation: sayTalk 0.5s ease-in-out infinite;
}

.say-robot.is-confused {
  animation: sayConfused 1s ease-in-out infinite;
}

@keyframes sayTalk {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-4deg) translateY(-4px); }
}

@keyframes sayConfused {
  0%, 100% { transform: rotate(-6deg); }
  50% { transform: rotate(6deg); }
}

.say-bubble {
  position: relative;
  align-self: start;
  max-width: 100%;
  min-height: 2.4em;
  padding: 12px 18px;
  border: 4px solid var(--ink);
  border-radius: 18px;
  background: var(--white);
  box-shadow: 4px 4px 0 var(--ink);
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  animation: bubblePop 0.3s ease both;
}

.say-bubble::after {
  content: "";
  position: absolute;
  left: -16px;
  bottom: 14px;
  border: 10px solid transparent;
  border-right-color: var(--ink);
}

@keyframes bubblePop {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.say-bubble .say-cursor {
  display: inline-block;
  width: 0.5em;
  animation: cursorBlink 0.8s steps(1) infinite;
}

@keyframes cursorBlink {
  50% { opacity: 0; }
}

.code-echo-panel pre {
  margin: 10px 0 0;
  border: 4px solid var(--ink);
  border-radius: 14px;
  background: #101827;
  color: #bbf7d0;
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 1rem;
  line-height: 1.5;
}

/* Console output list is read by the talking robot but not shown */
.code-output-list[hidden] {
  display: none;
}

/* Example code panel above the editor */
.code-example-panel {
  margin-bottom: 14px;
}

.code-example-panel .secondary-button {
  margin-top: 12px;
}

.code-studio-editor textarea::placeholder {
  color: #64748b;
  font-style: italic;
}

/* Variable explainer layout */
.explainer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 20px;
  align-items: center;
  margin-bottom: 16px;
}

.explainer-row p {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.6;
}

.variable-box-art {
  width: 100%;
  height: auto;
}

.step-guide code {
  padding: 1px 6px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: #101827;
  color: #bbf7d0;
  font-size: 0.9em;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .explainer-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .variable-box-art {
    max-width: 200px;
    margin: 0 auto;
  }
}

/* Concatenation diagram in the variable builder explainer */
.explainer-intro {
  margin: 0 0 16px;
  font-size: 1.05rem;
  line-height: 1.6;
}

.concat-art {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 12px 14px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: var(--white);
}

.concat-art > span {
  font-weight: 900;
  font-size: 1.1rem;
}

.concat-art .concat-arrow {
  color: var(--blue);
  font-size: 1.4rem;
}

.concat-art strong {
  padding: 2px 8px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--mint);
  white-space: nowrap;
}

/* === Obstacle Course === */
.oc-pickers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 26px 0 18px;
}

.oc-stage {
  position: relative;
  overflow: hidden;
  width: min(100%, calc(68vh * 1.3333));
  margin: 0 auto;
  height: auto;
  aspect-ratio: 1448 / 1086;
  border: 5px solid var(--ink);
  border-radius: 20px;
  box-shadow: var(--small-shadow);
  background: #bae6fd;
}

.oc-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.oc-caption {
  max-width: 94%;
}

.oc-char {
  position: absolute;
  bottom: 5%;
  left: 6%;
  height: clamp(90px, 13vw, 150px);
  z-index: 4;
  transition: left 0.45s ease, bottom 0.45s ease;
  filter: drop-shadow(3px 4px 0 rgba(20, 33, 61, 0.3));
}

.oc-char.is-jumping {
  animation: ocJump 0.55s ease;
}

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

.oc-char.is-bumping {
  animation: trayShake 0.5s ease;
}

.oc-char.is-scooping {
  animation: robotScoop 0.5s ease;
}

.oc-char.is-winning {
  animation: heroDance 0.7s ease-in-out infinite;
}

.oc-obstacle,
.oc-item,
.oc-goal {
  position: absolute;
  bottom: 6%;
  z-index: 2;
  transform: translateX(-50%);
  filter: drop-shadow(2px 3px 0 rgba(20, 33, 61, 0.25));
}

.oc-obstacle { height: clamp(70px, 10vw, 120px); }
.oc-item { height: clamp(52px, 7vw, 84px); z-index: 3; }
.oc-goal { height: clamp(42px, 6vw, 68px); animation: goalPulse 1.6s ease-in-out infinite; }

.oc-item.is-collected {
  animation: starCollect 0.5s ease forwards;
}

.oc-stage.is-winning::after {
  content: "🎉";
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3rem;
  z-index: 5;
  animation: fadeInUp 0.5s ease both;
}

.oc-workshop {
  grid-template-columns: minmax(0, 1fr);
  margin-top: 18px;
}

.oc-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}

.oc-cmd {
  padding: 10px 16px;
  border: 4px solid var(--ink);
  border-radius: 12px;
  background: var(--sky);
  box-shadow: 3px 3px 0 var(--ink);
  font-weight: 900;
  font-family: "Courier New", monospace;
  cursor: pointer;
  transition: transform 0.12s ease;
}

.oc-cmd:hover { transform: translateY(-2px); }

.oc-program {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  row-gap: 10px;
  margin: 0 0 14px;
  padding: 12px 14px;
  list-style: none;
  border: 3px dashed rgba(20, 33, 61, 0.4);
  border-radius: 14px;
  min-height: 56px;
}

.oc-program li:not(.empty-story-step) {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  margin-right: 15px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: var(--sky);
  font-family: "Courier New", monospace;
  font-weight: 900;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
}

/* puzzle tab plugging into the next piece */
.oc-program li:not(.empty-story-step)::after {
  content: "";
  position: absolute;
  right: -13px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: inherit;
  border: 3px solid var(--ink);
}

.oc-program li:not(.empty-story-step):last-child::after {
  display: none;
}

.oc-chip-num {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--yellow);
  font-family: "Fredoka", sans-serif;
  font-size: 0.7rem;
}

.oc-chip-x {
  margin-left: 2px;
  color: var(--coral);
  font-weight: 900;
}

.oc-program li.is-running-step {
  background: var(--yellow);
}

.oc-program li.is-bug-step {
  background: #ffe4e6;
  border-color: var(--coral);
}

.oc-hint-panel { margin: 12px 0; }

@media (max-width: 720px) {
  .oc-pickers { grid-template-columns: minmax(0, 1fr); }
}

.oc-palette[hidden],
.oc-program[hidden],
.oc-cmd[hidden] {
  display: none;
}

/* Desks read taller; basketball sits smaller on the floor */
.oc-obstacle[src*="desk"] {
  height: clamp(88px, 13vw, 150px);
}

.oc-obstacle[src*="basketball"] {
  height: clamp(46px, 6.5vw, 76px);
}

/* Spill puddle that comes with each desk */
.oc-spill-companion {
  height: clamp(36px, 5.5vw, 60px) !important;
  z-index: 1;
}

/* Pond stepping stones and lily pads */
.oc-stone {
  position: absolute;
  z-index: 1;
  transform: translateX(-50%);
  height: auto;
  filter: drop-shadow(2px 3px 0 rgba(20, 33, 61, 0.25));
}

/* More Playground sub-heading spacing */
.playground-more {
  grid-column: 1 / -1;
  margin-top: 34px;
}

.playground-section .project-grid {
  grid-column: 1 / -1;
}

/* === Robot Recipe === */
.rr-order-card {
  grid-column: span 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border: 4px solid var(--ink);
  border-radius: 16px;
  background: var(--white);
  box-shadow: var(--small-shadow);
}

.rr-order-layers {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.rr-order-layers .rr-mini {
  display: grid;
  justify-items: center;
  gap: 2px;
  font-size: 0.7rem;
  font-weight: 900;
}

.rr-order-layers .rr-mini svg {
  width: 56px;
  height: auto;
}

.rr-order-layers .rr-arrow {
  font-weight: 900;
  color: var(--ink);
}

.rr-stage {
  position: relative;
  overflow: hidden;
  height: clamp(300px, 36vw, 420px);
  border: 5px solid var(--ink);
  border-radius: 20px;
  box-shadow: var(--small-shadow);
  background: linear-gradient(180deg, #fde68a 0%, #fef3c7 60%);
}

.rr-counter {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 14%;
  border-top: 4px solid var(--ink);
  background: repeating-linear-gradient(90deg, #d6a35c 0 60px, #c8924b 60px 120px);
}

.rr-fridge {
  position: absolute;
  bottom: 12%;
  left: 4%;
  height: 72%;
  z-index: 1;
  filter: drop-shadow(3px 4px 0 rgba(20, 33, 61, 0.25));
}

.rr-plate-zone {
  position: absolute;
  bottom: 12%;
  right: 4%;
  width: min(34%, 300px);
  z-index: 1;
}

.rr-plate {
  width: 100%;
  height: auto;
  display: block;
}

.rr-stack {
  position: absolute;
  left: 50%;
  bottom: 38%;
  transform: translateX(-50%);
  width: 62%;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  z-index: 2;
}

.rr-stack .rr-layer {
  width: 100%;
  margin-bottom: -8px;
  animation: heldPop 0.35s ease both;
}

.rr-stack .rr-layer:first-child {
  margin-bottom: 0;
}

.rr-stack .rr-layer svg {
  display: block;
  width: 100%;
  height: auto;
}

.rr-robot-wrap {
  position: absolute;
  bottom: 9%;
  left: 42%;
  z-index: 3;
  transition: left 0.6s ease;
  display: grid;
  justify-items: center;
}

.rr-robot {
  height: clamp(96px, 13vw, 150px);
  filter: drop-shadow(3px 4px 0 rgba(20, 33, 61, 0.3));
}

.rr-robot-wrap.is-walking .rr-robot {
  animation: robotSlide 0.55s ease infinite;
}

.rr-robot-wrap.is-winning .rr-robot {
  animation: heroDance 0.7s ease-in-out infinite;
}

.rr-carry {
  width: clamp(60px, 7vw, 92px);
  margin-bottom: -6px;
  animation: moonBob 1s ease-in-out infinite;
}

.rr-carry svg {
  display: block;
  width: 100%;
  height: auto;
}

.rr-stage.is-winning::after {
  content: "🎉";
  position: absolute;
  top: 26%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 3rem;
  z-index: 5;
  animation: fadeInUp 0.5s ease both;
}

@media (max-width: 720px) {
  .rr-order-card { grid-column: auto; }
}

/* === Mood Machine === */
.mm-workshop {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
}

.mm-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mm-controls .builder-label {
  font-family: "Courier New", monospace;
  font-weight: 900;
}

.mm-target-card p {
  margin: 0;
  font-weight: 800;
}

.mm-site {
  border: 5px solid var(--ink);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--small-shadow);
}

.mm-site-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  background: #e2e8f0;
  border-bottom: 4px solid var(--ink);
}

.mm-site-bar span {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid var(--ink);
}

.mm-site-bar span:nth-child(1) { background: var(--coral); }
.mm-site-bar span:nth-child(2) { background: var(--yellow); }
.mm-site-bar span:nth-child(3) { background: var(--mint); }

.mm-site-bar em {
  margin-left: 10px;
  font-style: normal;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 3px 14px;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 999px;
}

.mm-site-body {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  min-height: clamp(260px, 30vw, 360px);
  padding: 24px;
  text-align: center;
  transition: background 0.5s ease;
}

.mm-site-body .mm-message {
  margin: 0;
  font-family: "Fredoka", sans-serif;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  color: var(--white);
  text-shadow: 2px 3px 0 var(--ink);
  word-break: break-word;
}

.mm-emoji {
  display: inline-block;
  font-size: clamp(3.4rem, 7vw, 5.2rem);
  line-height: 1;
}

.bg-sunset { background: linear-gradient(180deg, #f97316 0%, #fb7185 60%, #fbbf24 100%); }
.bg-ocean { background: linear-gradient(180deg, #0ea5e9 0%, #2563eb 70%, #0f766e 100%); }
.bg-forest { background: linear-gradient(180deg, #4ade80 0%, #16a34a 60%, #166534 100%); }
.bg-night { background: linear-gradient(180deg, #0b1026 0%, #312e81 100%); }
.bg-candy { background: linear-gradient(180deg, #f9a8d4 0%, #c084fc 60%, #818cf8 100%); }

.anim-bounce { animation: mmBounce 0.9s ease-in-out infinite; }
.anim-spin { animation: mmSpin 1.6s linear infinite; }
.anim-float { animation: moonBob 2.2s ease-in-out infinite; }
.anim-shake { animation: trayShake 0.6s ease infinite; }
.anim-none { animation: none; }

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

@keyframes mmSpin {
  to { transform: rotate(360deg); }
}

@media (max-width: 860px) {
  .mm-workshop { grid-template-columns: minmax(0, 1fr); }
  .mm-controls { grid-template-columns: 1fr; }
}

/* === Code Studio Quest === */
.quest-strip {
  margin-top: 18px;
  border: 4px solid var(--ink);
  border-radius: 16px;
  background: linear-gradient(90deg, #ede9fe 0%, #e0f2fe 100%);
  box-shadow: var(--small-shadow);
  padding: 12px 16px;
}

.quest-strip-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.quest-robot {
  height: 52px;
  animation: moonBob 2.4s ease-in-out infinite;
}

.quest-info {
  flex: 1;
  min-width: 0;
}

.quest-info strong {
  font-family: "Fredoka", sans-serif;
}

.quest-bar {
  height: 14px;
  margin: 6px 0 4px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--white);
  overflow: hidden;
}

.quest-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--yellow), #f59e0b);
  transition: width 0.6s ease;
}

.quest-lesson-stars {
  display: flex;
  gap: 4px;
}

.quest-lesson-stars img,
.quest-map-stars img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.quest-lesson-stars img.is-dim,
.quest-map-stars img.is-dim {
  filter: grayscale(1) opacity(0.35);
}

.quest-burst-star {
  position: absolute;
  bottom: 10%;
  width: 34px;
  z-index: 9;
  pointer-events: none;
  animation: questBurst 1.4s ease-out forwards;
}

@keyframes questBurst {
  0% { transform: translateY(0) scale(0.4) rotate(0deg); opacity: 1; }
  100% { transform: translateY(-160px) scale(1.2) rotate(220deg); opacity: 0; }
}

.quest-toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border: 4px solid var(--ink);
  border-radius: 999px;
  background: var(--yellow);
  box-shadow: var(--small-shadow);
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  animation: toastIn 0.4s ease both;
}

.quest-toast img {
  width: 26px;
}

.quest-toast.is-out {
  animation: toastOut 0.5s ease both;
}

@keyframes toastIn {
  from { transform: translate(-50%, 80px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

@keyframes toastOut {
  to { transform: translate(-50%, 80px); opacity: 0; }
}

.quest-map-stars {
  display: inline-flex;
  gap: 2px;
  margin-left: 8px;
  vertical-align: middle;
}

.quest-map-stars img {
  width: 18px;
  height: 18px;
}

a.is-quest-complete {
  background: #fef9c3;
}

.quest-map-total {
  font-size: 1.05rem;
}

/* === Bug Detective === */
.bd-casebar {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.bd-case-tab {
  padding: 8px 18px;
  border: 4px solid var(--ink);
  border-radius: 999px;
  background: var(--white);
  box-shadow: 3px 3px 0 var(--ink);
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  cursor: pointer;
}

.bd-case-tab[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.bd-case-tab.is-active {
  background: var(--yellow);
}

.bd-case-tab.is-solved {
  background: var(--mint);
}

.bd-stage {
  height: clamp(220px, 26vw, 300px);
  margin-bottom: 16px;
}

.bd-robot {
  position: absolute;
  bottom: 14%;
  left: 8%;
  transition: left 0.55s ease;
}

.bd-robot.is-bumping { animation: trayShake 0.5s ease; }
.bd-robot.is-jumping { animation: ocJump 0.55s ease; }
.bd-robot.is-winning { animation: heroDance 0.7s ease-in-out infinite; }

.bd-prop {
  position: absolute;
  bottom: 14%;
  z-index: 1;
  transform: translateX(-50%);
  height: clamp(44px, 6.5vw, 70px);
  filter: drop-shadow(2px 3px 0 rgba(20, 33, 61, 0.25));
}

.bd-prop.is-collected { animation: starCollect 0.5s ease forwards; }

.bd-program-title small {
  font-weight: 700;
  color: #64748b;
}

.bd-program li {
  cursor: pointer;
}

.bd-program li:hover {
  background: #fef9c3;
}

.bd-program li.is-bug-found {
  background: #ffe4e6;
  border-color: var(--coral) !important;
}

.bd-program li.is-fixed {
  background: #dcfce7;
}

.bd-fixes {
  margin: 14px 0;
  padding: 14px;
  border: 4px solid var(--ink);
  border-radius: 14px;
  background: #fef9c3;
}

.bd-stamp {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-12deg);
  z-index: 6;
  padding: 10px 26px;
  border: 6px solid var(--coral);
  border-radius: 12px;
  color: var(--coral);
  font-family: "Fredoka", sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 2px;
  background: rgba(255, 255, 255, 0.85);
  animation: stampIn 0.4s ease both;
}

@keyframes stampIn {
  0% { transform: translate(-50%, -50%) rotate(-12deg) scale(2.4); opacity: 0; }
  100% { transform: translate(-50%, -50%) rotate(-12deg) scale(1); opacity: 1; }
}

/* === Mini Game Engine: live game screen === */
.gs-screen {
  margin-bottom: 16px;
  border: 5px solid var(--ink);
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(180deg, #1e1b4b 0%, #312e81 70%, #4338ca 100%);
}

.gs-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  border-bottom: 4px solid var(--ink);
  background: #0b1026;
  color: #fde047;
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  letter-spacing: 1px;
}

.gs-score b {
  display: inline-block;
  min-width: 2ch;
  color: var(--white);
}

.gs-score b.is-ticking {
  animation: heldPop 0.4s ease;
}

.gs-world {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 130px;
  padding: 12px;
}

.gs-hero {
  height: 90px;
  filter: drop-shadow(3px 4px 0 rgba(0, 0, 0, 0.4));
}

.gs-hero.is-hopping {
  animation: mmBounce 0.5s ease;
}

.gs-hero.is-winning {
  animation: heroDance 0.7s ease-in-out infinite;
}

.gs-inv {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  border-top: 4px solid var(--ink);
  background: #0b1026;
  min-height: 54px;
  align-items: center;
}

.gs-inv .gs-slot {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 3px solid #fde047;
  border-radius: 10px;
  background: #1e1b4b;
  font-size: 1.5rem;
  animation: heldPop 0.4s ease both;
}

.gs-inv .gs-slot img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.gs-inv .gs-empty {
  color: #64748b;
  font-size: 0.85rem;
  font-weight: 800;
}

/* === Sound toggle button === */
.sound-toggle {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 999;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid #14213d;
  background: #fde047;
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(20, 33, 61, 0.25);
  transition: transform 0.15s ease;
}
.sound-toggle:hover { transform: scale(1.08); }
.sound-toggle.is-muted { background: #e5e7eb; opacity: 0.85; }
.music-toggle { bottom: 80px; font-size: 1.3rem; }

/* === Instructor guide === */
.ig-page { max-width: 1240px; }
.ig-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 18px 0 8px;
  padding: 14px 16px;
  background: #fff7e0;
  border: 3px solid #14213d;
  border-radius: 16px;
}
.ig-toc a {
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  color: #14213d;
  text-decoration: none;
  background: #fde047;
  border: 2px solid #14213d;
  border-radius: 999px;
  padding: 6px 14px;
}
.ig-toc a:hover { background: #fbbf24; }
.ig-toc .ig-print { margin-left: auto; }
.ig-section { margin-top: 34px; }
.ig-section h2 { font-family: "Fredoka", sans-serif; color: #14213d; margin-bottom: 4px; }
.ig-section h2 small { font-size: 0.6em; font-weight: 600; color: #5a6585; }
.ig-intro { color: #3c466b; max-width: 70ch; margin: 6px 0 16px; }
.ig-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.ig-grid-wide { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }
.ig-card {
  background: #ffffff;
  border: 3px solid #14213d;
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 5px 0 rgba(20, 33, 61, 0.15);
}
.ig-card h4 { font-family: "Fredoka", sans-serif; color: #14213d; margin: 0 0 8px; font-size: 1.05rem; }
.ig-card p { margin: 0 0 8px; font-size: 0.92rem; line-height: 1.5; color: #2c3554; }
.ig-card code { background: #eef1f8; border-radius: 6px; padding: 1px 5px; font-size: 0.86em; }
.ig-key { margin-top: 10px; border: 2px dashed #14213d; border-radius: 12px; background: #f5fbf7; }
.ig-key summary {
  cursor: pointer;
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  color: #14213d;
  padding: 10px 14px;
  list-style-position: inside;
}
.ig-key[open] summary { border-bottom: 2px dashed #14213d; }
.ig-key pre {
  margin: 10px 14px;
  padding: 12px 14px;
  background: #14213d;
  color: #d9e2ff;
  border-radius: 10px;
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.5;
}
.ig-key p, .ig-key ul { margin: 10px 14px; font-size: 0.9rem; color: #2c3554; }
.ig-list { padding-left: 20px; }
.ig-list li { margin-bottom: 6px; }
@media print {
  .site-header, .sound-toggle, .music-toggle, .ig-print { display: none !important; }
  .ig-key { page-break-inside: avoid; }
  .ig-key summary::after { content: " (answers below)"; }
  .ig-key:not([open]) > *:not(summary) { display: block; }
}
.ig-key pre code { background: transparent; color: inherit; padding: 0; border-radius: 0; font-size: inherit; }
