:root {
  --ink: #201633;
  --muted: #625976;
  --purple: #4b1d8a;
  --purple-dark: #3c1a78;
  --purple-2: #6b39d8;
  --teal: #16b8af;
  --yellow: #ffe681;
  --cream: #fffdf8;
  --line: rgba(45, 32, 70, 0.16);
  --shadow: 0 22px 50px rgba(36, 24, 56, 0.16);
  --rc-car-photo: url("rc-car-workshop.webp");
  --mono: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --body: Inter, "Noto Sans Thai", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: Fredoka, Inter, "Noto Sans Thai", ui-sans-serif, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 230, 129, 0.82), transparent 22rem),
    radial-gradient(circle at 86% 18%, rgba(22, 184, 175, 0.24), transparent 24rem),
    linear-gradient(180deg, #fff7cf 0%, #ecfffb 38%, #fffdf8 100%);
  font-family: var(--body);
  overflow-x: hidden;
}

button,
textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  touch-action: manipulation;
}

.share-cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.share-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 15px;
  border: 2px solid rgba(107, 57, 216, 0.2);
  border-radius: 999px;
  color: var(--purple);
  background: rgba(255, 253, 248, 0.84);
  font-weight: 900;
  cursor: pointer;
}

.share-button:hover,
.share-button:focus-visible {
  border-color: rgba(22, 184, 175, 0.46);
  background: rgba(22, 184, 175, 0.1);
}

.share-status {
  min-height: 1.4em;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.skip-link {
  position: fixed;
  z-index: 80;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  color: white;
  background: var(--purple);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: fixed;
  z-index: 20;
  top: 16px;
  left: 50%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  width: min(1120px, calc(100% - 32px));
  min-height: 70px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 24px;
  background: rgba(255, 253, 248, 0.82);
  box-shadow: 0 18px 40px rgba(34, 24, 51, 0.12);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand img {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: white;
  box-shadow: 0 10px 22px rgba(108, 59, 210, 0.22);
}

.brand strong,
h1,
h2,
h3,
h4 {
  font-family: var(--display);
  line-height: 1;
}

.brand strong {
  display: block;
  font-size: 1.15rem;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.nav-links,
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links {
  justify-content: center;
}

.header-actions {
  justify-content: flex-end;
}

.nav-links a,
.nav-cta,
.mobile-nav summary,
.language-switcher summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 999px;
  font-weight: 900;
  white-space: nowrap;
}

.nav-links a,
.nav-cta {
  padding: 0 15px;
}

.nav-links a {
  color: var(--muted);
}

.nav-links a[aria-current="page"],
.nav-links a:hover,
.mobile-nav-menu a[aria-current="page"],
.mobile-nav-menu a:hover {
  color: var(--purple);
  background: rgba(107, 57, 216, 0.1);
}

.nav-cta,
.mobile-nav-cta {
  color: #170b24;
  background: var(--yellow);
  box-shadow: 0 10px 22px rgba(255, 206, 52, 0.3);
}

.nav-cta {
  gap: 8px;
}

.nav-cta .css-icon {
  font-size: 1.05em;
}

.mobile-nav,
.language-switcher {
  position: relative;
  display: none;
}

.language-switcher {
  display: block;
}

.mobile-nav summary,
.language-switcher summary {
  width: 44px;
  padding: 0;
  color: var(--purple);
  background: rgba(107, 57, 216, 0.1);
  cursor: pointer;
  list-style: none;
}

.mobile-nav summary::-webkit-details-marker,
.language-switcher summary::-webkit-details-marker {
  display: none;
}

.menu-icon,
.caret-icon {
  position: relative;
  display: inline-block;
  width: 1.2rem;
  height: 1.2rem;
}

.menu-icon::before,
.menu-icon::after,
.menu-icon span {
  position: absolute;
  left: 0.12rem;
  width: 0.96rem;
  height: 0.13rem;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.menu-icon::before {
  top: 0.28rem;
}

.menu-icon span {
  top: 0.53rem;
}

.menu-icon::after {
  top: 0.78rem;
}

.caret-icon::before {
  position: absolute;
  top: 0.35rem;
  left: 0.34rem;
  width: 0.48rem;
  height: 0.48rem;
  border-right: 0.15rem solid currentColor;
  border-bottom: 0.15rem solid currentColor;
  content: "";
  transform: rotate(45deg);
}

.flag-badge {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
  width: 26px;
  height: 18px;
  overflow: hidden;
  border-radius: 4px;
  background: #f4f0ff;
  box-shadow: inset 0 0 0 1px rgba(34, 24, 51, 0.14);
}

.flag-en {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 30'%3E%3Cpath fill='%23012169' d='M0 0h60v30H0z'/%3E%3Cpath stroke='%23fff' stroke-width='6' d='M0 0l60 30M60 0L0 30'/%3E%3Cpath stroke='%23C8102E' stroke-width='3.5' d='M0 0l60 30M60 0L0 30'/%3E%3Cpath stroke='%23fff' stroke-width='10' d='M30 0v30M0 15h60'/%3E%3Cpath stroke='%23C8102E' stroke-width='6' d='M30 0v30M0 15h60'/%3E%3C/svg%3E")
    center / cover no-repeat;
}

.flag-th {
  background:
    linear-gradient(180deg, #a51931 0 16%, #f4f5f8 16% 30%, #2d2a86 30% 70%, #f4f5f8 70% 84%, #a51931 84%),
    #2d2a86;
}

.flag-zh {
  background: #de2910;
}

.flag-zh::before {
  position: absolute;
  top: 2px;
  left: 3px;
  color: #ffde00;
  content: "★";
  font-size: 7px;
  line-height: 1;
}

.flag-id {
  background: linear-gradient(180deg, #ce1126 0 50%, #fff 50% 100%);
}

.language-switcher-code {
  width: 24px;
  height: 16px;
}

.language-switcher summary {
  gap: 5px;
  width: auto;
  min-width: 62px;
  padding: 0 10px;
}

.language-switcher-menu,
.mobile-nav-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  display: grid;
  gap: 6px;
  min-width: 220px;
  padding: 10px;
  border: 1px solid rgba(108, 59, 210, 0.16);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.98);
  box-shadow: 0 18px 40px rgba(34, 24, 51, 0.16);
}

.language-switcher:not([open]) .language-switcher-menu,
.mobile-nav:not([open]) .mobile-nav-menu {
  display: none;
}

.language-switcher-menu a,
.mobile-nav-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 900;
}

.game-page {
  display: grid;
  gap: 18px;
  width: min(1180px, calc(100% - 28px));
  min-width: 0;
  margin: 120px auto 68px;
}

.games-hub-page {
  gap: 24px;
}

.game-selector,
.playground-panel,
.workshop-promo-card,
.cta-panel,
.reserve-callout,
.game-connect-section {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.92);
  box-shadow: var(--shadow);
}

.section-copy,
.workshop-promo-card p,
.workshop-promo-card li,
.cta-panel p,
.reserve-callout p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.55;
}

.game-selector,
.playground-panel,
.cta-panel {
  padding: clamp(18px, 3vw, 28px);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  align-items: end;
  margin-bottom: 18px;
}

.section-heading h1,
.section-heading h2,
.workshop-promo-card h2,
.cta-panel h2 {
  margin: 0;
  color: var(--purple);
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.game-category {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.game-category + .game-category {
  margin-top: 30px;
}

.game-category-heading {
  display: grid;
  gap: 6px;
  max-width: 760px;
}

.game-category-heading h3 {
  margin: 0;
  color: var(--purple);
  font-family: var(--display);
  font-size: clamp(1.7rem, 3vw, 2.4rem);
}

.game-category-heading p {
  margin: 0;
  color: var(--muted);
  font-weight: 850;
  line-height: 1.45;
}

.game-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.game-card {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 16px;
  min-width: 0;
  min-height: 310px;
  padding: 18px;
  border: 1px solid rgba(107, 57, 216, 0.16);
  border-radius: 8px;
  color: var(--ink);
  background: #fffefb;
  box-shadow: 0 12px 30px rgba(36, 24, 56, 0.1);
  cursor: pointer;
  text-align: left;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.game-card:hover,
.game-card:focus-visible {
  border-color: rgba(107, 57, 216, 0.38);
  box-shadow: 0 20px 42px rgba(36, 24, 56, 0.15);
  transform: translateY(-3px);
}

.game-card.is-active {
  border-color: rgba(107, 57, 216, 0.38);
  box-shadow: 0 16px 34px rgba(36, 24, 56, 0.12);
  background:
    linear-gradient(135deg, rgba(255, 230, 129, 0.3), rgba(22, 184, 175, 0.1)),
    #fffefb;
}

.game-card:disabled,
.game-card[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.58;
  filter: saturate(0.78);
}

.game-card:disabled:hover,
.game-card:disabled:focus-visible,
.game-card[aria-disabled="true"]:hover,
.game-card[aria-disabled="true"]:focus-visible {
  border-color: rgba(107, 57, 216, 0.16);
  box-shadow: 0 12px 30px rgba(36, 24, 56, 0.1);
  transform: none;
}

.game-card:disabled .game-card-action,
.game-card[aria-disabled="true"] .game-card-action {
  color: var(--muted) !important;
  background: rgba(36, 24, 56, 0.1);
}

.game-card-art {
  position: relative;
  display: block;
  height: 138px;
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.22) 0 2px, transparent 2px 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0 2px, transparent 2px 100%),
    #82dce0;
  background-size: 22px 22px;
}

.game-card-copy {
  display: grid;
  gap: 10px;
  align-content: start;
}

.game-card-copy strong {
  color: var(--purple);
  font-family: var(--display);
  font-size: 1.6rem;
  line-height: 1;
}

.game-card-copy span {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.45;
}

.game-card-action {
  justify-self: start;
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 999px;
  color: #160c24 !important;
  background: var(--yellow);
  font-weight: 1000 !important;
}

.preview-pad {
  position: absolute;
  left: 22px;
  bottom: 24px;
  width: 78px;
  height: 44px;
  border-radius: 50%;
  background: #6ed560;
  box-shadow: 94px 0 0 #6ed560;
}

.preview-frog {
  position: absolute;
  left: 42px;
  bottom: 42px;
  width: 44px;
  height: 34px;
  border-radius: 12px;
  background: #75e665;
  box-shadow: inset 0 -6px 0 rgba(31, 112, 45, 0.22);
}

.preview-frog::before,
.preview-frog::after {
  position: absolute;
  top: -9px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #eaffd8;
  content: "";
}

.preview-frog::before {
  left: 5px;
}

.preview-frog::after {
  right: 5px;
}

.preview-fly {
  position: absolute;
  right: 42px;
  top: 42px;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: #201633;
}

.preview-fly::before,
.preview-fly::after {
  position: absolute;
  top: -8px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  content: "";
}

.preview-fly::before {
  left: -6px;
}

.preview-fly::after {
  right: -6px;
}

.garden-preview {
  background:
    radial-gradient(circle at 78% 22%, rgba(255, 230, 129, 0.88) 0 22px, transparent 23px),
    linear-gradient(180deg, #dffdf4, #bdeee5);
}

.preview-sun,
.preview-plant,
.preview-drop,
.preview-meter {
  position: absolute;
}

.preview-sun {
  top: 18px;
  right: 24px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: var(--yellow);
}

.preview-plant {
  left: 48px;
  bottom: 26px;
  width: 26px;
  height: 58px;
  border-radius: 999px 999px 6px 6px;
  background: #45b956;
}

.preview-plant::before,
.preview-plant::after {
  position: absolute;
  top: 12px;
  width: 34px;
  height: 22px;
  border-radius: 999px 8px 999px 8px;
  background: #6bd866;
  content: "";
}

.preview-plant::before {
  right: 12px;
  transform: rotate(-25deg);
}

.preview-plant::after {
  left: 12px;
  transform: rotate(25deg);
}

.preview-drop {
  left: 108px;
  top: 28px;
  width: 18px;
  height: 26px;
  border-radius: 999px 999px 999px 4px;
  background: #4bbde8;
  transform: rotate(45deg);
}

.preview-meter {
  right: 20px;
  bottom: 24px;
  width: 72px;
  height: 12px;
  border-radius: 999px;
  background: rgba(32, 22, 51, 0.16);
}

.preview-meter::before {
  position: absolute;
  inset: 0 34px 0 0;
  border-radius: inherit;
  background: var(--teal);
  content: "";
}

.morse-preview {
  isolation: isolate;
  background:
    linear-gradient(90deg, rgba(120, 181, 229, 0.16) 0 2px, transparent 2px 100%),
    linear-gradient(180deg, #f6fcff, #e9f8fb);
  background-size: 34px 34px, auto;
}

.morse-preview::before {
  position: absolute;
  left: 34px;
  top: 16px;
  z-index: 1;
  width: 112px;
  height: 112px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 230, 129, 0.28), rgba(255, 230, 129, 0.12) 48%, transparent 70%);
  content: "";
  opacity: 0;
}

.morse-preview::after {
  position: absolute;
  left: 104px;
  right: 18px;
  top: 78px;
  z-index: 1;
  height: 3px;
  border-radius: 999px;
  background: rgba(32, 22, 51, 0.16);
  content: "";
}

.preview-led,
.preview-pulse-dot,
.preview-pulse-dash,
.preview-board,
.preview-morse-battery,
.preview-morse-wire,
.preview-morse-resistor,
.preview-morse-antenna,
.preview-circuit-led,
.preview-circuit-switch,
.preview-circuit-wire,
.preview-node,
.preview-packet,
.preview-belt,
.preview-package,
.preview-bin {
  position: absolute;
}

.morse-preview .preview-board {
  display: none;
}

.preview-morse-battery {
  display: none;
}

.preview-morse-battery::before {
  position: absolute;
  top: -9px;
  left: 10px;
  width: 18px;
  height: 12px;
  border-radius: 5px 5px 3px 3px;
  background: #6b5aa0;
  content: "";
}

.preview-morse-battery::after {
  position: absolute;
  top: 16px;
  left: 8px;
  width: 22px;
  height: 54px;
  background:
    linear-gradient(#fff, #fff) center 7px / 22px 5px no-repeat,
    linear-gradient(#fff, #fff) center 7px / 5px 22px no-repeat,
    linear-gradient(#fff, #fff) center 48px / 22px 5px no-repeat;
  content: "";
}

.preview-morse-wire {
  display: none;
}

.preview-morse-wire.wire-power {
  left: 70px;
}

.preview-morse-wire.wire-signal {
  left: 91px;
}

.preview-morse-wire::after {
  content: "";
}

.preview-morse-wire.wire-power::after {
  content: "";
}

.preview-morse-wire.wire-signal::after {
  content: "";
}

.morse-preview .preview-led {
  left: 48px;
  top: 29px;
  z-index: 6;
  width: 56px;
  height: 54px;
  border-radius: 999px 999px 14px 14px;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.92) 0 10%, transparent 11%),
    linear-gradient(180deg, #fff278, #ffcf3d);
  box-shadow:
    inset 0 -8px 0 rgba(143, 91, 12, 0.2),
    0 0 0 4px rgba(68, 55, 102, 0.08);
}

.morse-preview .preview-led::before {
  position: absolute;
  left: 15px;
  bottom: -39px;
  width: 6px;
  height: 42px;
  border-radius: 999px;
  background: #6e628e;
  content: "";
}

.morse-preview .preview-led::after {
  position: absolute;
  left: 36px;
  bottom: -29px;
  width: 6px;
  height: 32px;
  border-radius: 999px;
  background: #6e628e;
  content: "";
}

.preview-morse-resistor {
  display: none;
}

.preview-morse-resistor::before,
.preview-morse-resistor::after {
  position: absolute;
  top: 5px;
  width: 22px;
  height: 4px;
  border-radius: 999px;
  background: #c9c5d6;
  content: "";
}

.preview-morse-resistor::before {
  right: 100%;
}

.preview-morse-resistor::after {
  left: 100%;
}

.preview-morse-antenna {
  display: none;
}

.preview-morse-antenna::before {
  position: absolute;
  top: -17px;
  left: 50%;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--teal);
  content: "";
  transform: translateX(-50%);
}

.preview-morse-antenna::after {
  position: absolute;
  top: -35px;
  left: 50%;
  width: 84px;
  height: 72px;
  border-right: 6px solid rgba(107, 57, 216, 0.72);
  border-left: 6px solid rgba(107, 57, 216, 0.72);
  border-radius: 999px;
  content: "";
  transform: translateX(-50%);
  animation: morse-radio-wave 1.8s ease-in-out infinite;
}

.preview-pulse-dot {
  left: 150px;
  top: 75px;
  z-index: 5;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--purple);
  box-shadow:
    32px 0 0 var(--purple),
    118px 0 0 var(--purple),
    132px 0 0 var(--purple),
    154px 0 0 var(--purple);
  filter: drop-shadow(0 0 6px rgba(107, 57, 216, 0.28));
}

.preview-pulse-dot::before {
  content: "";
}

.preview-pulse-dash {
  left: 116px;
  top: 74px;
  z-index: 5;
  width: 16px;
  height: 8px;
  border-radius: 999px;
  background: var(--purple);
  box-shadow:
    38px 0 0 var(--purple),
    78px 0 0 var(--purple),
    110px 0 0 var(--purple),
    142px 0 0 var(--purple),
    176px 0 0 var(--purple);
  filter: drop-shadow(0 0 6px rgba(107, 57, 216, 0.28));
}

.preview-morse-code-line {
  position: absolute;
  left: 110px;
  top: 71px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 4px;
}

.pms {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--purple);
  opacity: 0;
}

.pms-dot {
  width: 6px;
  height: 6px;
}

.pms-dash {
  width: 14px;
  height: 7px;
}

.pms-lg {
  margin-right: 6px;
}

@media (min-width: 761px) and (max-width: 980px) {
  .morse-preview::after {
    left: 142px;
    right: 24px;
  }

  .preview-pulse-dot {
    left: 260px;
    box-shadow:
      48px 0 0 var(--purple),
      150px 0 0 var(--purple),
      170px 0 0 var(--purple),
      198px 0 0 var(--purple);
  }

  .preview-pulse-dash {
    left: 230px;
    width: 22px;
    box-shadow:
      52px 0 0 var(--purple),
      124px 0 0 var(--purple),
      164px 0 0 var(--purple),
      204px 0 0 var(--purple),
      248px 0 0 var(--purple);
  }

  .preview-morse-code-line {
    left: 200px;
  }
}

@media (max-width: 760px) {
  .morse-preview::before {
    left: 24px;
    top: 14px;
    width: 96px;
    height: 96px;
  }

  .morse-preview::after {
    left: 98px;
    right: 14px;
    top: 76px;
  }

  .morse-preview .preview-led {
    left: 42px;
    top: 32px;
    width: 48px;
    height: 48px;
  }

  .morse-preview .preview-led::before {
    left: 12px;
    bottom: -36px;
    height: 38px;
  }

  .morse-preview .preview-led::after {
    left: 30px;
    bottom: -27px;
    height: 29px;
  }

  .preview-morse-wire {
    top: 84px;
    height: 32px;
  }

  .preview-morse-wire.wire-power {
    left: 58px;
  }

  .preview-morse-wire.wire-signal {
    left: 76px;
  }

  .preview-morse-wire::after {
    content: "";
  }

  .preview-morse-wire.wire-power::after {
    left: -20px;
  }

  .preview-morse-wire.wire-signal::after {
    left: 9px;
  }

  .preview-pulse-dot {
    left: 138px;
    top: 74px;
    width: 5px;
    height: 5px;
    box-shadow:
      28px 0 0 var(--purple),
      96px 0 0 var(--purple),
      108px 0 0 var(--purple),
      126px 0 0 var(--purple);
  }

  .preview-pulse-dash {
    left: 108px;
    top: 73px;
    width: 14px;
    height: 7px;
    box-shadow:
      32px 0 0 var(--purple),
      64px 0 0 var(--purple),
      92px 0 0 var(--purple),
      120px 0 0 var(--purple),
      148px 0 0 var(--purple);
  }
}

.circuit-preview {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.34) 0 2px, transparent 2px 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.34) 0 2px, transparent 2px 100%),
    #2f356d;
  background-size: 24px 24px;
}

.preview-circuit-wire {
  left: 34px;
  right: 30px;
  top: 72px;
  height: 6px;
  border-radius: 999px;
  background: var(--yellow);
  box-shadow:
    0 -28px 0 -1px var(--teal),
    0 28px 0 -1px #ff7a68;
}

.preview-circuit-led {
  right: 36px;
  top: 34px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: #7df2a0;
  box-shadow: 0 0 18px rgba(125, 242, 160, 0.8);
}

.preview-circuit-switch {
  left: 34px;
  bottom: 30px;
  width: 54px;
  height: 28px;
  border-radius: 999px;
  background: #fffdf8;
  box-shadow: inset 28px 0 0 var(--purple-2);
}

.packet-preview {
  background:
    linear-gradient(90deg, rgba(75, 29, 138, 0.1) 0 2px, transparent 2px 100%),
    linear-gradient(180deg, rgba(75, 29, 138, 0.1) 0 2px, transparent 2px 100%),
    #e8f7ff;
  background-size: 34px 34px;
}

.preview-node {
  width: 36px;
  height: 36px;
  border: 4px solid var(--purple);
  border-radius: 999px;
  background: #fffdf8;
  box-shadow: 0 8px 0 rgba(32, 22, 51, 0.12);
}

.preview-node.node-a {
  left: 28px;
  top: 38px;
}

.preview-node.node-b {
  right: 34px;
  top: 30px;
}

.preview-node.node-c {
  left: 92px;
  bottom: 24px;
  border-color: var(--teal);
}

.preview-packet {
  left: 77px;
  top: 56px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--yellow);
  box-shadow: 0 0 0 5px rgba(255, 230, 129, 0.25);
}

.sorter-preview {
  background:
    linear-gradient(180deg, #e9fbff 0 58%, #d8f3ed 58%),
    #e9fbff;
}

.preview-belt {
  left: 18px;
  right: 18px;
  top: 64px;
  height: 34px;
  border-radius: 8px;
  background:
    repeating-linear-gradient(90deg, rgba(32, 22, 51, 0.16) 0 14px, transparent 14px 28px),
    #a7b4c2;
}

.preview-package {
  top: 46px;
  width: 32px;
  height: 28px;
  border: 3px solid rgba(32, 22, 51, 0.2);
  border-radius: 7px;
  background: var(--yellow);
}

.preview-package.red {
  left: 46px;
  background: #ff7a68;
}

.preview-package.heavy {
  left: 96px;
  background: #6b39d8;
}

.preview-bin {
  right: 22px;
  bottom: 18px;
  width: 44px;
  height: 38px;
  border: 4px solid var(--teal);
  border-radius: 8px 8px 12px 12px;
  background: rgba(255, 255, 255, 0.68);
}

.drone-preview {
  background:
    linear-gradient(90deg, rgba(75, 29, 138, 0.1) 0 2px, transparent 2px 100%),
    linear-gradient(180deg, rgba(75, 29, 138, 0.1) 0 2px, transparent 2px 100%),
    #e8f7ff;
  background-size: 34px 34px;
}

.preview-drone,
.preview-robot,
.preview-battery {
  position: absolute;
}

.preview-drone {
  top: 34px;
  left: 34px;
  width: 48px;
  height: 34px;
  border-radius: 16px;
  background: #6b39d8;
  box-shadow:
    -18px -10px 0 -7px #201633,
    18px -10px 0 -7px #201633,
    -18px 10px 0 -7px #201633,
    18px 10px 0 -7px #201633;
}

.preview-drone::before {
  position: absolute;
  inset: 10px 14px;
  border-radius: 999px;
  background: #fff;
  content: "";
}

.preview-robot {
  right: 32px;
  bottom: 28px;
  width: 42px;
  height: 42px;
  border: 4px solid #201633;
  border-radius: 10px;
  background: var(--yellow);
}

.preview-robot::before,
.preview-robot::after {
  position: absolute;
  top: 11px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #201633;
  content: "";
}

.preview-robot::before {
  left: 9px;
}

.preview-robot::after {
  right: 9px;
}

.preview-battery {
  left: 108px;
  top: 78px;
  width: 24px;
  height: 14px;
  border-radius: 4px;
  background: #45b956;
  box-shadow: 5px 0 0 -2px #45b956;
}

@media (hover: hover) {
  .game-card:hover .preview-frog,
  .game-card:focus-visible .preview-frog {
    animation: card-frog-hop 900ms ease-in-out infinite;
  }

  .game-card:hover .preview-fly,
  .game-card:focus-visible .preview-fly {
    animation: buzz 520ms steps(2, end) infinite;
  }

  .game-card:hover .preview-plant,
  .game-card:focus-visible .preview-plant {
    animation: plant-perk 1100ms ease-in-out infinite;
  }

  .game-card:hover .preview-drop,
  .game-card:focus-visible .preview-drop {
    animation: water-drop 900ms ease-in-out infinite;
  }

  .game-card:hover .preview-meter::before,
  .game-card:focus-visible .preview-meter::before {
    animation: meter-fill 1200ms ease-in-out infinite;
  }

  .game-card:hover .preview-circuit-led,
  .game-card:focus-visible .preview-circuit-led {
    animation: led-pulse 900ms ease-in-out infinite;
  }

  .game-card:hover .morse-preview::before,
  .game-card:focus-visible .morse-preview::before {
    animation: morse-led-aura 9.4s steps(1, end) infinite;
  }

  .game-card:hover .morse-preview .preview-led,
  .game-card:focus-visible .morse-preview .preview-led {
    animation: morse-led-code 9.4s steps(1, end) infinite;
  }

  .game-card:hover .pms-c1,
  .game-card:focus-visible .pms-c1 { animation: morse-sym-c1 9.4s steps(1, end) infinite; }
  .game-card:hover .pms-c2,
  .game-card:focus-visible .pms-c2 { animation: morse-sym-c2 9.4s steps(1, end) infinite; }
  .game-card:hover .pms-c3,
  .game-card:focus-visible .pms-c3 { animation: morse-sym-c3 9.4s steps(1, end) infinite; }
  .game-card:hover .pms-c4,
  .game-card:focus-visible .pms-c4 { animation: morse-sym-c4 9.4s steps(1, end) infinite; }
  .game-card:hover .pms-o1,
  .game-card:focus-visible .pms-o1 { animation: morse-sym-o1 9.4s steps(1, end) infinite; }
  .game-card:hover .pms-o2,
  .game-card:focus-visible .pms-o2 { animation: morse-sym-o2 9.4s steps(1, end) infinite; }
  .game-card:hover .pms-o3,
  .game-card:focus-visible .pms-o3 { animation: morse-sym-o3 9.4s steps(1, end) infinite; }
  .game-card:hover .pms-d1,
  .game-card:focus-visible .pms-d1 { animation: morse-sym-d1 9.4s steps(1, end) infinite; }
  .game-card:hover .pms-d2,
  .game-card:focus-visible .pms-d2 { animation: morse-sym-d2 9.4s steps(1, end) infinite; }
  .game-card:hover .pms-d3,
  .game-card:focus-visible .pms-d3 { animation: morse-sym-d3 9.4s steps(1, end) infinite; }
  .game-card:hover .pms-e1,
  .game-card:focus-visible .pms-e1 { animation: morse-sym-e1 9.4s steps(1, end) infinite; }

  .game-card:hover .preview-packet,
  .game-card:focus-visible .preview-packet {
    animation: packet-hop 1100ms ease-in-out infinite;
  }

  .game-card:hover .preview-package.red,
  .game-card:focus-visible .preview-package.red {
    animation: package-slide 1100ms ease-in-out infinite;
  }

  .game-card:hover .preview-drone,
  .game-card:focus-visible .preview-drone {
    animation: car-drive 1200ms ease-in-out infinite;
  }

  .game-card:hover .preview-battery,
  .game-card:focus-visible .preview-battery {
    animation: battery-drop 1200ms ease-in-out infinite;
  }
}

@keyframes card-frog-hop {
  50% {
    translate: 94px -16px;
  }
}

@keyframes plant-perk {
  50% {
    transform: scaleY(1.08);
  }
}

@keyframes water-drop {
  0%,
  100% {
    translate: 0 0;
    opacity: 1;
  }
  70% {
    translate: -26px 56px;
    opacity: 0.2;
  }
}

@keyframes meter-fill {
  50% {
    right: 8px;
  }
}

@keyframes led-pulse {
  50% {
    scale: 1.12;
    filter: brightness(1.1);
  }
}

@keyframes morse-poster-light {
  50% {
    background-position: 0 0, 6px 0, 0 6px, 0 0, 0 0;
  }
}

@keyframes morse-led-code {
  /* CODE: C=-.-. O=--- D=-.. E=. (200ms/unit, 47 units = 9.4s) */
  /* ON: dash(C) dot(C) dash(C) dot(C) dash(O) dash(O) dash(O) dash(D) dot(D) dot(D) dot(E) */
  0%,
  8.5%,
  12.8%,
  21.3%,
  29.8%,
  38.3%,
  46.8%,
  59.6%,
  68.1%,
  72.3%,
  80.9% {
    filter: brightness(1.24) saturate(1.12);
    transform: translateY(-1px) scale(1.04);
    box-shadow:
      inset 0 -7px 0 rgba(143, 91, 12, 0.08),
      0 0 0 11px rgba(255, 230, 129, 0.28),
      0 0 38px rgba(255, 210, 70, 0.92);
  }

  /* OFF: symbol gaps, letter gaps, end pause */
  6.4%,
  10.6%,
  19.1%,
  23.4%,
  36.2%,
  44.7%,
  53.2%,
  66%,
  70.2%,
  74.5%,
  83%,
  100% {
    filter: brightness(1);
    transform: translateY(0) scale(1);
  }
}

@keyframes morse-led-aura {
  0%,
  8.5%,
  12.8%,
  21.3%,
  29.8%,
  38.3%,
  46.8%,
  59.6%,
  68.1%,
  72.3%,
  80.9% {
    opacity: 1;
    scale: 1.08;
  }

  6.4%,
  10.6%,
  19.1%,
  23.4%,
  36.2%,
  44.7%,
  53.2%,
  66%,
  70.2%,
  74.5%,
  83%,
  100% {
    opacity: 0.46;
    scale: 0.96;
  }
}

/* CODE: C=-.-. O=--- D=-.. E=.
   Each symbol reveals as the LED blinks it, then stays visible until loop resets.
   Blink periods (% of 9.4s): C1 0-6.4, C2 8.5-10.6, C3 12.8-19.1, C4 21.3-23.4,
   O1 29.8-36.2, O2 38.3-44.7, O3 46.8-53.2,
   D1 59.6-66, D2 68.1-70.2, D3 72.3-74.5, E1 80.9-83 */

@keyframes morse-sym-c1 {
  0%          { opacity: 1; }
  6.4%, 100%  { opacity: 0.7; }
}
@keyframes morse-sym-c2 {
  0%           { opacity: 0; }
  8.5%         { opacity: 1; }
  10.6%, 100%  { opacity: 0.7; }
}
@keyframes morse-sym-c3 {
  0%           { opacity: 0; }
  12.8%        { opacity: 1; }
  19.1%, 100%  { opacity: 0.7; }
}
@keyframes morse-sym-c4 {
  0%           { opacity: 0; }
  21.3%        { opacity: 1; }
  23.4%, 100%  { opacity: 0.7; }
}
@keyframes morse-sym-o1 {
  0%           { opacity: 0; }
  29.8%        { opacity: 1; }
  36.2%, 100%  { opacity: 0.7; }
}
@keyframes morse-sym-o2 {
  0%           { opacity: 0; }
  38.3%        { opacity: 1; }
  44.7%, 100%  { opacity: 0.7; }
}
@keyframes morse-sym-o3 {
  0%           { opacity: 0; }
  46.8%        { opacity: 1; }
  53.2%, 100%  { opacity: 0.7; }
}
@keyframes morse-sym-d1 {
  0%           { opacity: 0; }
  59.6%        { opacity: 1; }
  66%, 100%    { opacity: 0.7; }
}
@keyframes morse-sym-d2 {
  0%           { opacity: 0; }
  68.1%        { opacity: 1; }
  70.2%, 100%  { opacity: 0.7; }
}
@keyframes morse-sym-d3 {
  0%           { opacity: 0; }
  72.3%        { opacity: 1; }
  74.5%, 100%  { opacity: 0.7; }
}
@keyframes morse-sym-e1 {
  0%           { opacity: 0; }
  80.9%        { opacity: 1; }
  83%, 100%    { opacity: 0.7; }
}

@keyframes morse-radio-wave {
  0%,
  100% {
    opacity: 0.42;
    scale: 0.9;
  }

  50% {
    opacity: 0.9;
    scale: 1.04;
  }
}

@keyframes morse-signal-line {
  0% {
    background-position: 0 0;
    transform: translateX(-4px);
  }

  100% {
    background-position: 44px 0;
    transform: translateX(5px);
  }
}

@keyframes packet-hop {
  45% {
    translate: 64px -14px;
  }
  70% {
    translate: 42px 42px;
  }
}

@keyframes package-slide {
  50% {
    translate: 58px 0;
  }
}

@keyframes car-drive {
  45% {
    translate: 70px 0;
  }
  60% {
    translate: 70px 2px;
  }
}

@keyframes battery-drop {
  50% {
    translate: 44px 32px;
  }
}

.playground-panel {
  display: grid;
  gap: 18px;
}

.choose-games-button {
  flex: 0 0 auto;
}

.playable-game[hidden] {
  display: none;
}

.playable-game {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.game-instructions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.78fr);
  gap: 18px;
}

.hero-copy h2,
.hero-copy h3 {
  margin: 0;
  color: var(--purple);
  font-size: clamp(2.2rem, 5vw, 4.2rem);
}

.garden-wrap,
.morse-wrap,
.circuit-wrap,
.packet-wrap,
.sorter-wrap,
.drone-wrap {
  display: grid;
  place-items: center;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.garden-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 14px;
  width: min(560px, 100%);
}

.plant-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 14px;
  border: 2px solid rgba(22, 184, 175, 0.28);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.86);
  box-shadow: 0 12px 26px rgba(10, 100, 120, 0.12);
}

.plant-card.is-targeted {
  border-color: rgba(107, 57, 216, 0.62);
  box-shadow:
    0 0 0 4px rgba(107, 57, 216, 0.14),
    0 12px 26px rgba(10, 100, 120, 0.12);
}

.plant-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.target-badge {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(107, 57, 216, 0.12);
  color: var(--purple);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.plant-card h3,
.plant-card p,
.plant-card small {
  margin: 0;
}

.plant-card h3 {
  color: var(--purple);
  font-size: 1.35rem;
}

.plant-card p,
.plant-card small {
  color: var(--muted);
  font-weight: 900;
}

.plant-scene {
  position: relative;
  height: 112px;
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(180deg, #dffdf4 0 72%, #8bd479 72%),
    #dffdf4;
}

.garden-sun {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--yellow);
}

.plant-sprout {
  position: absolute;
  left: 50%;
  bottom: 20px;
  width: 24px;
  height: 48px;
  border-radius: 999px 999px 6px 6px;
  background: #45b956;
  transform: translateX(-50%);
}

.plant-sprout::before,
.plant-sprout::after {
  position: absolute;
  top: 10px;
  width: 32px;
  height: 20px;
  border-radius: 999px 8px 999px 8px;
  background: #6bd866;
  content: "";
}

.plant-sprout::before {
  right: 12px;
  transform: rotate(-25deg);
}

.plant-sprout::after {
  left: 12px;
  transform: rotate(25deg);
}

.water-drop {
  position: absolute;
  left: 28%;
  top: 20px;
  width: 16px;
  height: 24px;
  border-radius: 999px 999px 999px 4px;
  background: #4bbde8;
  opacity: 0;
  transform: rotate(45deg);
}

.shade-leaf {
  position: absolute;
  top: 14px;
  left: 18px;
  width: 64px;
  height: 34px;
  border-radius: 999px 12px 999px 12px;
  background: rgba(69, 185, 86, 0.82);
  opacity: 0;
  transform: rotate(-16deg);
}

.plant-card.was-watered .water-drop {
  animation: plant-watered 520ms ease-out 1;
}

.plant-card.has-shade .shade-leaf {
  opacity: 1;
}

.plant-card.is-happy .plant-sprout {
  transform: translateX(-50%) scaleY(1.08);
}

.plant-card.is-dried .plant-scene {
  background:
    radial-gradient(circle at 82% 22%, rgba(255, 210, 90, 0.58), transparent 22%),
    linear-gradient(180deg, #fff1cf 0 72%, #d8b66b 72%),
    #fff1cf;
}

.plant-card.is-dried .garden-sun {
  animation: sun-scorch 900ms ease-in-out infinite;
}

.plant-card.is-dried .plant-sprout,
.plant-card.is-dried .plant-sprout::before,
.plant-card.is-dried .plant-sprout::after {
  background: #a7833d;
}

.plant-card.is-dried .plant-sprout {
  transform-origin: bottom center;
  animation: plant-dry 760ms ease-in-out infinite;
}

.plant-card.is-wilted .plant-sprout {
  transform-origin: bottom center;
  animation: plant-wilt 820ms ease-in-out infinite;
}

.plant-card.is-overwatered .plant-scene {
  background:
    radial-gradient(circle at 50% 90%, rgba(75, 189, 232, 0.3), transparent 28%),
    linear-gradient(180deg, #ddf8ff 0 72%, #69b67b 72%),
    #ddf8ff;
}

.plant-card.is-overwatered .plant-sprout,
.plant-card.is-overwatered .plant-sprout::before,
.plant-card.is-overwatered .plant-sprout::after {
  background: #4d9b64;
}

.plant-card.is-overshaded .plant-scene {
  background:
    linear-gradient(180deg, rgba(31, 35, 63, 0.22), rgba(31, 35, 63, 0.12)),
    linear-gradient(180deg, #dffdf4 0 72%, #6aa76c 72%),
    #dffdf4;
}

.plant-card.is-overshaded .garden-sun {
  opacity: 0.32;
}

.sensor-meter {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(32, 22, 51, 0.12);
}

.sensor-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), #7be06c);
}

.morse-lab,
.circuit-lab,
.sorter-lab {
  display: grid;
  gap: 14px;
  width: min(560px, 100%);
  padding: 16px;
  border: 4px solid rgba(107, 57, 216, 0.24);
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: 0 22px 42px rgba(53, 35, 96, 0.14);
}

.morse-board,
.circuit-board {
  position: relative;
  min-height: 190px;
  overflow: hidden;
  border-radius: 8px;
  background:
    radial-gradient(circle, rgba(75, 29, 138, 0.2) 0 2px, transparent 3px) 13px 13px / 24px 20px,
    linear-gradient(180deg, #e9fbff, #d8f3ed);
}

.morse-led {
  position: absolute;
  left: 46px;
  top: 38px;
  width: 66px;
  height: 66px;
  border: 8px solid rgba(32, 22, 51, 0.12);
  border-radius: 999px;
  background: #ffe681;
  box-shadow:
    0 0 0 10px rgba(255, 230, 129, 0.14),
    0 0 28px rgba(255, 210, 70, 0.58);
}

.morse-led.is-lit {
  filter: brightness(1.14);
  box-shadow:
    0 0 0 12px rgba(255, 230, 129, 0.18),
    0 0 42px rgba(255, 210, 70, 0.78);
}

.morse-chip {
  position: absolute;
  right: 46px;
  bottom: 40px;
  width: 110px;
  height: 54px;
  border-radius: 8px;
  background: #201633;
  box-shadow:
    -10px 8px 0 rgba(32, 22, 51, 0.12),
    inset 0 0 0 8px rgba(255, 255, 255, 0.08);
}

.morse-wire {
  position: absolute;
  height: 7px;
  border-radius: 999px;
  background: var(--teal);
  transform-origin: left center;
}

.morse-wire-a {
  left: 102px;
  top: 88px;
  width: 250px;
  transform: rotate(11deg);
}

.morse-wire-b {
  left: 100px;
  top: 106px;
  width: 250px;
  background: #ff7a68;
  transform: rotate(-8deg);
}

.morse-readout,
.circuit-status {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.morse-readout p,
.circuit-status p,
.sorter-status {
  min-width: 0;
  margin: 0;
  padding: 10px;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(107, 57, 216, 0.08);
  font-weight: 850;
}

.morse-readout strong,
.circuit-status strong {
  display: block;
  color: var(--purple);
}

.morse-timeline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(32, 22, 51, 0.08);
}

.pulse {
  display: inline-block;
  height: 12px;
  border-radius: 999px;
  background: var(--purple);
}

.pulse-dot {
  width: 12px;
}

.pulse-dash {
  width: 42px;
}

.pulse-gap {
  width: 18px;
  background: rgba(32, 22, 51, 0.24);
}

.morse-code-game .morse-game-panel {
  grid-template-columns: minmax(280px, 1fr) minmax(250px, 0.58fr);
  min-height: min(42vh, 470px);
  background:
    linear-gradient(135deg, rgba(22, 184, 175, 0.2), rgba(255, 230, 129, 0.2)),
    #f5fffb;
}

.morse-led-stage {
  position: relative;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  width: min(520px, 100%);
  min-width: 0;
  margin-inline: auto;
  padding: clamp(54px, 5vw, 64px) clamp(10px, 1.5vw, 16px) clamp(10px, 1.5vw, 16px);
  border: 0;
  background: transparent;
  box-shadow: none;
}

.morse-led-wrap {
  position: relative;
  display: grid;
  place-items: center;
  gap: 0;
  min-width: 0;
  padding: 8px 8px 52px;
}

.morse-led-bulb {
  position: relative;
  width: clamp(104px, 15vw, 150px);
  height: clamp(104px, 15vw, 150px);
  border: 8px solid rgba(145, 111, 24, 0.22);
  border-radius: 999px 999px 46% 46%;
  background:
    radial-gradient(circle at 34% 27%, rgba(255, 255, 255, 0.95) 0 10%, transparent 11%),
    radial-gradient(circle at 50% 55%, rgba(255, 235, 132, 0.82), rgba(255, 205, 68, 0.94) 62%, #f5bc35 100%);
  box-shadow:
    inset 0 -12px 0 rgba(151, 97, 17, 0.13),
    0 0 0 12px rgba(255, 230, 129, 0.12),
    0 16px 28px rgba(151, 97, 17, 0.12);
  transition: filter 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.morse-led-leg {
  position: absolute;
  width: 7px;
  border-radius: 999px;
  background: #6e628e;
}

.morse-led-anode {
  bottom: -56px;
  left: 34%;
  height: 56px;
}

.morse-led-cathode {
  bottom: -44px;
  right: 34%;
  height: 44px;
}

.morse-led-bulb.is-on {
  filter: brightness(1.22) saturate(1.08);
  box-shadow:
    inset 0 -10px 0 rgba(151, 97, 17, 0.08),
    0 0 0 16px rgba(255, 230, 129, 0.18),
    0 0 44px rgba(255, 203, 64, 0.76),
    0 16px 28px rgba(151, 97, 17, 0.14);
}

.morse-led-bulb.is-dash {
  box-shadow:
    inset 0 -10px 0 rgba(151, 97, 17, 0.08),
    0 0 0 16px rgba(255, 230, 129, 0.18),
    0 0 60px rgba(255, 203, 64, 0.88),
    0 16px 28px rgba(151, 97, 17, 0.14);
}

.morse-led-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.morse-trace-panel,
.morse-prompt-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  width: min(360px, 100%);
  padding: 12px 14px;
  border: 1px solid rgba(107, 57, 216, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.morse-trace-head,
.morse-level-header,
.morse-key-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.morse-trace-head span {
  color: var(--purple);
  font-weight: 1000;
}

.morse-replay-button,
.morse-key-button {
  min-height: 38px;
}

.morse-trace-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 68px;
  max-height: 150px;
  padding: 12px;
  overflow: auto;
  border: 1px dashed rgba(107, 57, 216, 0.26);
  border-radius: 8px;
  background: rgba(32, 22, 51, 0.06);
  scrollbar-width: thin;
}

.morse-trace-bar[hidden] {
  display: none;
}

.morse-trace-token {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  min-height: 28px;
  padding: 0 9px;
  border: 2px solid rgba(32, 22, 51, 0.18);
  border-radius: 8px;
  color: #201633;
  background: #ffe681;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 1000;
  line-height: 1;
  white-space: nowrap;
}

.morse-trace-token.is-dot {
  background: #ffe681;
}

.morse-trace-token.is-dash {
  min-width: 96px;
  background: #ffc940;
}

.morse-trace-token.is-on {
  background: #ffd9a3;
}

.morse-trace-token.is-off,
.morse-trace-token.is-symbol-gap {
  border-color: rgba(32, 22, 51, 0.14);
  color: #4f5e70;
  background: rgba(32, 22, 51, 0.08);
}

.morse-trace-token.is-letter-gap {
  border-color: rgba(107, 57, 216, 0.22);
  background: rgba(107, 57, 216, 0.24);
}

.morse-trace-token.is-word-gap {
  border-color: rgba(255, 122, 104, 0.42);
  color: #7b2540;
  background: rgba(255, 122, 104, 0.2);
}

.morse-trace-token.is-active {
  outline: 4px solid rgba(22, 184, 175, 0.24);
  outline-offset: 2px;
  transform: translateY(-1px);
}

.morse-trace-summary,
.morse-completion-status {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.86rem;
  font-weight: 900;
  line-height: 1.45;
}

.morse-completion-status {
  padding: 10px;
  border: 1px solid rgba(255, 230, 129, 0.28);
  border-radius: 8px;
  color: #fff6be;
  background: rgba(255, 230, 129, 0.08);
}

.celebration-button[hidden],
.ide-button[hidden],
button[hidden] {
  display: none !important;
}

.morse-input-help strong {
  color: var(--purple);
  font-family: var(--mono);
}

.morse-interpreted-line {
  color: var(--ink);
  text-align: center;
}

.morse-prompt-value {
  margin: 0;
  color: var(--purple);
  font-size: clamp(1.45rem, 3vw, 2.35rem);
  font-weight: 1000;
  line-height: 1.1;
}

.morse-answer-label {
  color: var(--ink);
  font-weight: 1000;
}

.morse-answer-input {
  width: 100%;
  min-height: 54px;
  padding: 0 14px;
  border: 2px solid rgba(107, 57, 216, 0.24);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-family: var(--mono);
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 900;
}

.morse-answer-input:focus {
  outline: 4px solid rgba(22, 184, 175, 0.24);
  border-color: var(--teal);
}

.morse-input-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.4;
}

.morse-control-body {
  display: grid;
  min-width: 0;
  min-height: 300px;
}

.morse-control-body .editor-wrap {
  min-height: 300px;
}

.morse-output-panel {
  min-height: 220px;
}

.morse-reveal-overlay[hidden] {
  display: none;
}

.morse-reveal-overlay {
  position: fixed;
  z-index: 95;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(20, 12, 36, 0.62);
}

.morse-reveal-modal {
  display: grid;
  gap: 0;
  width: min(520px, calc(100vw - 32px));
  max-height: min(88vh, 720px);
  padding: clamp(20px, 3.5vw, 28px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 20px;
  background: #fffdf8;
  box-shadow: 0 32px 72px rgba(12, 8, 28, 0.34);
}

.morse-reveal-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.morse-reveal-modal-head h2,
.morse-reveal-modal-head h3,
.morse-reveal-modal-head h4 {
  margin: 0;
  color: var(--purple-dark);
  font-family: Fredoka, ui-sans-serif, sans-serif;
  font-size: clamp(1.4rem, 4vw, 1.9rem);
  font-weight: 700;
  line-height: 1.2;
}

.morse-reveal-close-btn {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1.5px solid rgba(60, 26, 120, 0.22);
  border-radius: 8px;
  background: transparent;
  color: var(--purple-dark);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 140ms;
}

.morse-reveal-close-btn:hover,
.morse-reveal-close-btn:focus-visible {
  background: rgba(60, 26, 120, 0.08);
}

.morse-reveal-divider {
  margin: 16px 0;
  border: none;
  border-top: 1px solid rgba(60, 26, 120, 0.12);
}

.morse-reveal-preview {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.morse-reveal-gif-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: min(300px, 100%);
  aspect-ratio: 3 / 2;
  border-radius: 14px;
  background: linear-gradient(145deg, #ede4ff 0%, #e2f6f9 100%);
  border: 1.5px solid rgba(60, 26, 120, 0.1);
}

.morse-reveal-gif-bulb {
  width: 60px;
  height: 56px;
  border-radius: 999px 999px 14px 14px;
  background: linear-gradient(180deg, #fff278, #ffcf3d);
  box-shadow:
    inset 0 -5px 0 rgba(143, 91, 12, 0.18),
    0 0 0 4px rgba(60, 26, 120, 0.08),
    0 0 28px rgba(255, 210, 70, 0.52);
  animation: led-pulse 1.4s ease-in-out infinite;
}

.morse-reveal-gif-text {
  margin: 0;
  color: var(--purple);
  font-family: var(--mono);
  font-size: 1rem;
  letter-spacing: 0.12em;
}

.morse-share-status {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
  text-align: center;
}

.morse-reveal-actions {
  display: flex;
  justify-content: center;
  gap: clamp(10px, 3vw, 22px);
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.morse-share-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}

.morse-share-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 62px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: var(--purple-dark);
  color: #fff;
  cursor: pointer;
  transition: background 130ms, transform 130ms;
}

.morse-share-icon-btn:hover,
.morse-share-icon-btn:focus-visible {
  background: var(--purple);
  transform: scale(1.07);
}

.morse-share-label {
  color: var(--muted);
  font-size: 0.77rem;
  font-weight: 500;
  text-align: center;
}

.morse-reveal-detail {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.morse-reveal-detail strong {
  color: var(--purple-dark);
  font-family: var(--mono);
}

.morse-key-overlay {
  position: fixed;
  z-index: 90;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(20, 12, 36, 0.62);
}

.morse-key-overlay[hidden] {
  display: none;
}

.morse-key-modal {
  display: grid;
  gap: 16px;
  width: min(760px, calc(100vw - 32px));
  max-height: min(82vh, 720px);
  padding: clamp(16px, 3vw, 24px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: 0 30px 70px rgba(12, 8, 28, 0.32);
}

.morse-key-modal h2,
.morse-key-modal h3,
.morse-key-modal h4 {
  margin: 0;
  color: var(--purple);
  font-size: clamp(1.8rem, 5vw, 2.6rem);
}

.morse-key-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 8px;
}

.morse-key-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(107, 57, 216, 0.16);
  border-radius: 8px;
  background: rgba(107, 57, 216, 0.07);
}

.morse-key-item strong {
  color: var(--purple);
  font-size: 1.15rem;
  font-weight: 1000;
}

.morse-key-item span {
  color: var(--ink);
  font-family: var(--mono);
  font-weight: 1000;
}

.circuit-board {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.16) 0 2px, transparent 2px 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0 2px, transparent 2px 100%),
    #31366f;
  background-size: 28px 28px;
}

.circuit-led,
.circuit-relay,
.circuit-switch,
.circuit-sensor {
  position: absolute;
}

.circuit-led {
  right: 54px;
  top: 34px;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: #64708b;
  box-shadow: inset 0 -8px 0 rgba(32, 22, 51, 0.2);
}

.circuit-led.is-on {
  background: #7df2a0;
  box-shadow:
    0 0 24px rgba(125, 242, 160, 0.8),
    inset 0 -8px 0 rgba(32, 22, 51, 0.1);
}

.circuit-relay {
  left: 52px;
  bottom: 36px;
  width: 86px;
  height: 48px;
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: inset 0 0 0 6px rgba(107, 57, 216, 0.18);
}

.circuit-relay.is-on {
  box-shadow:
    inset 0 0 0 6px rgba(22, 184, 175, 0.48),
    0 0 0 5px rgba(22, 184, 175, 0.14);
}

.circuit-switch {
  left: 46px;
  top: 42px;
  width: 78px;
  height: 38px;
  border-radius: 999px;
  background: #fffdf8;
  box-shadow: inset 38px 0 0 #a7b4c2;
}

.circuit-switch.is-on {
  box-shadow: inset -38px 0 0 var(--yellow);
}

.circuit-sensor {
  right: 52px;
  bottom: 38px;
  width: 62px;
  height: 44px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 50%, #ffe681 0 10px, transparent 11px),
    #e9fbff;
}

.circuit-sensor.is-dark {
  background:
    radial-gradient(circle at 50% 50%, #6b39d8 0 10px, transparent 11px),
    #222947;
}

.packet-grid {
  --cols: 3;
  --rows: 3;
  --size: min(74px, 14vw);
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, var(--size)));
  grid-template-rows: repeat(var(--rows), minmax(0, var(--size)));
  gap: 8px;
  padding: 14px;
  border: 4px solid rgba(107, 57, 216, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(75, 29, 138, 0.1) 0 2px, transparent 2px 100%),
    linear-gradient(180deg, rgba(75, 29, 138, 0.1) 0 2px, transparent 2px 100%),
    #e8f7ff;
  background-size: 26px 26px;
  box-shadow: 0 22px 42px rgba(53, 35, 96, 0.14);
}

.packet-cell {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  aspect-ratio: 1;
  border: 2px solid rgba(75, 29, 138, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
}

.packet-cell::before {
  width: 34%;
  height: 34%;
  border: 4px solid rgba(107, 57, 216, 0.68);
  border-radius: 999px;
  background: #fffdf8;
  content: "";
}

.packet-cell.is-router::before {
  border-color: var(--teal);
  box-shadow: 0 0 0 5px rgba(22, 184, 175, 0.14);
}

.packet-cell.is-server::before,
.packet-cell.is-server-delivered::before {
  width: 52%;
  height: 44%;
  border-radius: 8px;
  border-color: var(--purple);
  background: var(--yellow);
}

.packet-cell.is-server-delivered::before {
  background: #7df2a0;
}

.packet-cell.is-firewall {
  background:
    repeating-linear-gradient(45deg, rgba(255, 122, 104, 0.2) 0 9px, rgba(255, 255, 255, 0.18) 9px 18px),
    rgba(255, 122, 104, 0.2);
}

.packet-cell.is-firewall::before {
  border-color: #ff7a68;
  background: transparent;
}

.packet-dot {
  position: absolute;
  z-index: 2;
  width: 28%;
  height: 28%;
  border-radius: 999px;
  background: var(--yellow);
  box-shadow:
    0 0 0 6px rgba(255, 230, 129, 0.24),
    0 8px 12px rgba(32, 22, 51, 0.16);
}

.conveyor-belt {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 112px;
  overflow-x: auto;
  padding: 18px;
  border-radius: 8px;
  background:
    repeating-linear-gradient(90deg, rgba(32, 22, 51, 0.12) 0 18px, transparent 18px 36px),
    #a7b4c2;
}

.package {
  display: grid;
  place-items: center;
  flex: 0 0 62px;
  min-height: 48px;
  border: 3px solid rgba(32, 22, 51, 0.16);
  border-radius: 8px;
  color: #fff;
  background: var(--yellow);
  font-size: 0.78rem;
  font-weight: 1000;
  box-shadow: 0 8px 0 rgba(32, 22, 51, 0.12);
}

.package.is-red {
  background: #ff7a68;
}

.package.is-heavy {
  background: #6b39d8;
}

.package.is-sorted {
  opacity: 0.42;
}

.package.is-scanned {
  outline: 4px solid rgba(255, 230, 129, 0.7);
}

.sorter-scanner {
  justify-self: center;
  width: 92px;
  height: 54px;
  border-radius: 8px 8px 18px 18px;
  background:
    linear-gradient(90deg, transparent 42%, rgba(255, 122, 104, 0.74) 42% 58%, transparent 58%),
    #201633;
  box-shadow: 0 10px 0 rgba(32, 22, 51, 0.14);
}

.sorter-bins {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.sorter-bin {
  display: grid;
  place-items: center;
  min-height: 68px;
  border: 4px solid rgba(22, 184, 175, 0.55);
  border-radius: 8px;
  color: var(--purple);
  background: rgba(255, 255, 255, 0.7);
  font-weight: 1000;
}

@keyframes plant-watered {
  0% {
    opacity: 0;
    translate: 0 -8px;
  }
  30% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    translate: 32px 54px;
  }
}

@keyframes sun-scorch {
  0%,
  100% {
    scale: 1;
    box-shadow: 0 0 0 0 rgba(255, 208, 89, 0.18);
  }
  50% {
    scale: 1.08;
    box-shadow: 0 0 0 12px rgba(255, 208, 89, 0);
  }
}

@keyframes plant-dry {
  0%,
  100% {
    transform: translateX(-50%) scaleY(0.82) rotate(-5deg);
  }
  50% {
    transform: translateX(-50%) scaleY(0.76) rotate(5deg);
  }
}

@keyframes plant-wilt {
  0%,
  100% {
    transform: translateX(-50%) scaleY(0.92) rotate(10deg);
  }
  50% {
    transform: translateX(-50%) scaleY(0.84) rotate(18deg);
  }
}

.drone-grid {
  --cols: 3;
  --rows: 3;
  --size: min(72px, 14vw);
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, var(--size)));
  grid-template-rows: repeat(var(--rows), minmax(0, var(--size)));
  gap: 8px;
  padding: 14px;
  border: 4px solid rgba(107, 57, 216, 0.32);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(75, 29, 138, 0.1) 0 2px, transparent 2px 100%),
    linear-gradient(180deg, rgba(75, 29, 138, 0.1) 0 2px, transparent 2px 100%),
    #e8f7ff;
  background-size: 24px 24px;
  box-shadow: 0 22px 42px rgba(53, 35, 96, 0.16);
}

.drone-cell {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  aspect-ratio: 1;
  border: 2px solid rgba(75, 29, 138, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  overflow: hidden;
}

.depot-station,
.charger-pad {
  position: absolute;
  z-index: 1;
}

.depot-station {
  left: 10px;
  bottom: 10px;
  width: 28px;
  height: 24px;
  border: 3px solid #201633;
  border-radius: 8px;
  background: #ffd95f;
}

.depot-station::before {
  position: absolute;
  inset: -13px 4px auto;
  height: 12px;
  border-radius: 6px 6px 0 0;
  background: #201633;
  content: "";
}

.depot-station span {
  position: absolute;
  inset: 5px 7px;
  border-radius: 4px;
  background: #45b956;
}

.depot-station.is-empty span {
  opacity: 0.24;
}

.charger-pad {
  right: 10px;
  bottom: 10px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background:
    linear-gradient(135deg, transparent 35%, #fff 35% 48%, transparent 48% 62%, #fff 62% 75%, transparent 75%),
    #16b8af;
  box-shadow: 0 0 0 4px rgba(22, 184, 175, 0.16);
}

.drone-sprite {
  position: relative;
  z-index: 2;
  width: 58%;
  height: 42%;
  border-radius: 16px;
  background: var(--purple-2);
  box-shadow:
    -14px -10px 0 -7px #201633,
    14px -10px 0 -7px #201633,
    -14px 10px 0 -7px #201633,
    14px 10px 0 -7px #201633;
}

.drone-sprite::before {
  position: absolute;
  inset: 9px 13px;
  border-radius: 999px;
  background: white;
  content: "";
}

.drone-sprite::after {
  position: absolute;
  top: 50%;
  right: -8px;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid var(--yellow);
  content: "";
  transform: translateY(-50%);
}

.drone-sprite.has-cargo span {
  position: absolute;
  top: -10px;
  left: 50%;
  width: 18px;
  height: 10px;
  border-radius: 4px;
  background: #45b956;
  transform: translateX(-50%);
}

.car-status {
  margin: 12px 0 0;
  color: var(--muted);
  font-weight: 900;
}

.drone-sprite.faces-south {
  transform: rotate(90deg);
}

.drone-sprite.faces-west {
  transform: rotate(180deg);
}

.drone-sprite.faces-north {
  transform: rotate(-90deg);
}

.robot-target {
  position: relative;
  width: 52%;
  height: 52%;
  border: 4px solid #201633;
  border-radius: 10px;
  background: var(--yellow);
}

.robot-target::before,
.robot-target::after {
  position: absolute;
  top: 30%;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #201633;
  content: "";
}

.robot-target::before {
  left: 24%;
}

.robot-target::after {
  right: 24%;
}

.battery-slot {
  position: absolute;
  left: 50%;
  bottom: -13px;
  width: 24px;
  height: 13px;
  border-radius: 4px;
  background: #c9c4d6;
  transform: translateX(-50%);
}

.robot-target.is-delivered .battery-slot {
  background: #45b956;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  font-weight: 1000;
  text-align: center;
}

.button.primary {
  color: #170b24;
  background: var(--yellow);
  box-shadow: 0 12px 24px rgba(255, 206, 52, 0.28);
}

.button.secondary {
  color: var(--purple);
  background: rgba(107, 57, 216, 0.1);
}

.button.outline {
  color: var(--purple);
  border: 1px solid rgba(107, 57, 216, 0.24);
  background: rgba(255, 255, 255, 0.76);
}

.css-icon {
  --icon-stroke: 0.13em;
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 1em;
  height: 1em;
  color: currentColor;
  line-height: 1;
  overflow: visible;
  vertical-align: -0.125em;
}

.css-icon::before,
.css-icon::after {
  position: absolute;
  display: block;
  box-sizing: border-box;
  content: "";
}

.css-icon-arrow-right::before {
  top: 50%;
  left: 0.16em;
  width: 0.72em;
  border-top: var(--icon-stroke) solid currentColor;
  border-radius: 999px;
  transform: translateY(-50%);
}

.css-icon-arrow-right::after {
  top: 50%;
  right: 0.12em;
  width: 0.42em;
  height: 0.42em;
  border-top: var(--icon-stroke) solid currentColor;
  border-right: var(--icon-stroke) solid currentColor;
  transform: translateY(-50%) rotate(45deg);
}

.css-icon-external::before {
  top: 0.72em;
  left: 0.2em;
  width: 0.75em;
  border-top: var(--icon-stroke) solid currentColor;
  border-radius: 999px;
  transform: rotate(-45deg);
  transform-origin: left center;
}

.css-icon-external::after {
  top: 0.16em;
  right: 0.13em;
  width: 0.45em;
  height: 0.45em;
  border-top: var(--icon-stroke) solid currentColor;
  border-right: var(--icon-stroke) solid currentColor;
  border-radius: 0 0.06em 0 0;
}

.css-icon-caret-down {
  width: 0.9em;
  height: 0.9em;
}

.css-icon-caret-down::before {
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-right: 0.28em solid transparent;
  border-left: 0.28em solid transparent;
  border-top: 0.34em solid currentColor;
  transform: translate(-50%, -25%);
}

.workshop-promo-card {
  position: relative;
  display: flex;
  min-height: min(560px, calc(100vh - 130px));
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
  padding: clamp(22px, 3.2vw, 34px);
  color: white;
  background: linear-gradient(180deg, #4e259d, #2f1767);
}

.workshop-promo-card::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(90deg, rgba(47, 23, 103, 0.98) 0%, rgba(78, 37, 157, 0.9) 34%, rgba(78, 37, 157, 0.5) 56%, rgba(47, 23, 103, 0.05) 100%),
    var(--rc-car-photo) center center / cover;
  content: "";
}

.workshop-promo-card > * {
  position: relative;
  z-index: 1;
}

.rc-course-animated {
  isolation: isolate;
}

.rc-course-animated::before {
  animation: rc-course-image-drift 18s ease-in-out 300ms infinite alternate;
  transform-origin: 58% 50%;
  will-change: transform;
}

.rc-course-animated::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 80% 32%, rgba(22, 184, 175, 0.24), transparent 12rem),
    radial-gradient(circle at 88% 72%, rgba(255, 230, 129, 0.14), transparent 11rem),
    linear-gradient(90deg, transparent 0 66%, rgba(255, 230, 129, 0.18) 66.1%, transparent 66.3%),
    linear-gradient(0deg, transparent 0 54%, rgba(22, 184, 175, 0.14) 54.1%, transparent 54.3%);
  mix-blend-mode: screen;
  opacity: 0.42;
  animation: rc-course-signal-pulse 5.4s ease-in-out infinite;
}

.rc-course-animated .card-topline,
.rc-course-animated .workshop-date,
.rc-course-animated h2,
.rc-course-animated .workshop-location,
.rc-course-animated > p:not(.workshop-date):not(.workshop-location),
.rc-course-animated .workshop-actions {
  opacity: 0;
  transform: translateY(14px);
  animation: rc-course-enter 700ms cubic-bezier(0.22, 1, 0.36, 1) both;
  will-change: opacity, transform;
}

.rc-course-animated .card-topline {
  animation-delay: 80ms;
}

.rc-course-animated .workshop-date {
  animation-delay: 220ms;
}

.rc-course-animated h2 {
  overflow: hidden;
  clip-path: inset(0 0 100% 0);
  animation-name: rc-course-headline-reveal;
  animation-delay: 360ms;
}

.rc-course-animated .workshop-location {
  animation-delay: 520ms;
}

.rc-course-animated > p:not(.workshop-date):not(.workshop-location):not(.pricing-note) {
  animation-delay: 640ms;
}

.rc-course-animated .pricing-note {
  animation-delay: 760ms;
}

.rc-course-animated li {
  opacity: 0;
  transform: translateY(10px);
  animation: rc-course-enter 560ms cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease, background 180ms ease;
}

.rc-course-animated li:nth-child(1) {
  animation-delay: 900ms;
}

.rc-course-animated li:nth-child(2) {
  animation-delay: 980ms;
}

.rc-course-animated li:nth-child(3) {
  animation-delay: 1060ms;
}

.rc-course-animated li:nth-child(4) {
  animation-delay: 1140ms;
}

.rc-course-animated .workshop-actions {
  animation-delay: 1240ms;
}

.rc-course-animated .workshop-actions .button,
.rc-course-animated .workshop-actions .css-icon {
  transition: filter 180ms ease, box-shadow 180ms ease, transform 180ms ease, background 180ms ease;
}

.workshop-promo-card h2,
.workshop-promo-card p,
.workshop-promo-card li,
.workshop-promo-card .kicker {
  color: white;
}

.workshop-promo-card h2 {
  max-width: 600px;
  margin: 0 0 14px;
  color: white;
  font-size: clamp(2.2rem, 4.5vw, 3.85rem);
  line-height: 1.14;
}

.card-topline,
.workshop-actions,
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.card-topline {
  justify-content: space-between;
  margin-bottom: 30px;
}

.tag,
.age {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-weight: 1000;
}

.tag {
  color: #170b24;
  background: var(--yellow);
}

.age {
  color: white;
  background: rgba(255, 255, 255, 0.16);
}

.workshop-promo-card .tag,
.workshop-promo-card .age {
  min-height: 30px;
  padding: 0 10px;
  color: white;
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.16);
}

.workshop-date {
  margin: 0 0 10px;
  color: var(--yellow) !important;
  font-size: 0.9rem;
  font-weight: 1000 !important;
  text-transform: uppercase;
}

.workshop-location {
  max-width: 620px;
  margin: 0 0 12px;
  color: rgba(255, 255, 255, 0.8) !important;
  font-size: 0.9rem;
  font-weight: 900;
}

.workshop-location a,
.workshop-location a:visited {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.workshop-promo-card > p:not(.workshop-date):not(.workshop-location):not(.pricing-note) {
  max-width: 620px;
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: clamp(0.94rem, 1.15vw, 1.02rem);
  line-height: 1.5;
}

.pricing-note {
  max-width: 610px;
  margin: 14px 0 0;
  padding: 12px 14px;
  border: 1px solid rgba(255, 230, 129, 0.34);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.8) !important;
  background: rgba(255, 230, 129, 0.12);
  font-size: 0.92rem;
  line-height: 1.45;
}

.workshop-promo-card ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 620px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  font-size: clamp(0.86rem, 1vw, 0.95rem);
}

.workshop-promo-card li {
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.12);
}

.workshop-promo-card .workshop-actions {
  align-self: flex-start;
  margin-top: 16px;
}

.workshop-promo-card .workshop-actions .button {
  gap: 8px;
}

.workshop-join {
  color: #170b24;
  background: var(--yellow);
  box-shadow: 0 14px 28px rgba(255, 206, 52, 0.28);
}

.workshop-learn-more {
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.54);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: none;
  backdrop-filter: blur(12px);
}

@media (hover: hover) and (pointer: fine) {
  .rc-course-animated .workshop-join:hover {
    filter: brightness(1.08) saturate(1.04);
    box-shadow: 0 18px 34px rgba(255, 206, 52, 0.36);
  }

  .rc-course-animated .workshop-actions .button:hover .css-icon {
    transform: translate(3px, -1px);
  }

  .rc-course-animated li:hover {
    border-color: rgba(255, 230, 129, 0.5);
    background: rgba(255, 255, 255, 0.18);
    box-shadow: 0 12px 26px rgba(12, 8, 30, 0.16);
    transform: translateY(-2px);
  }
}

@keyframes rc-course-image-drift {
  0% {
    transform: translate3d(0, 0, 0) scale(1.012);
  }

  100% {
    transform: translate3d(-1.2%, 0.6%, 0) scale(1.045);
  }
}

@keyframes rc-course-signal-pulse {
  0%,
  100% {
    opacity: 0.28;
    filter: brightness(1);
  }

  50% {
    opacity: 0.5;
    filter: brightness(1.12);
  }
}

@keyframes rc-course-enter {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rc-course-headline-reveal {
  from {
    opacity: 0;
    clip-path: inset(0 0 100% 0);
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    clip-path: inset(0 0 0 0);
    transform: translateY(0);
  }
}

.reserve-callout {
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: clamp(88px, 7.2vw, 126px) clamp(18px, 5vw, 64px);
  text-align: center;
  background: rgba(255, 253, 248, 0.9);
}

.reserve-callout h2 {
  max-width: 1280px;
  margin: 0;
  color: var(--purple-dark);
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1.08;
}

.reserve-callout p {
  font-weight: 800;
}

.reserve-callout .hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
}

.reserve-callout .button {
  width: auto;
  min-width: 0;
  min-height: 60px;
  padding: 0 30px;
  font-size: clamp(1rem, 1.35vw, 1.3rem);
}

.reserve-contact-logo {
  display: block;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 8px 14px rgba(36, 24, 56, 0.12));
}

.reserve-callout .button.outline {
  background: rgba(255, 255, 255, 0.76);
  box-shadow: none;
}

.connect-section {
  display: grid;
  gap: 18px;
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto 54px;
  padding: clamp(18px, 3vw, 28px);
}

.connect-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.connect-card {
  display: grid;
  gap: 6px;
  min-height: 118px;
  padding: 18px;
  border: 1px solid rgba(107, 57, 216, 0.16);
  border-radius: 8px;
  background: #fffefb;
  box-shadow: 0 12px 30px rgba(36, 24, 56, 0.1);
}

.connect-card-icon {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 8px;
}

.connect-logo {
  display: block;
  width: 48px;
  height: 48px;
  filter: drop-shadow(0 8px 14px rgba(36, 24, 56, 0.12));
}

.connect-card span {
  color: var(--muted);
  font-weight: 900;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.75fr);
  gap: 18px;
  align-items: stretch;
  min-width: 0;
}

.hero-copy,
.concept-card,
.world-panel,
.ide-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.9);
  box-shadow: var(--shadow);
}

.hero-copy *,
.concept-card *,
.world-panel *,
.ide-panel * {
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: normal;
}

.hero-copy {
  padding: clamp(22px, 3vw, 34px);
  background:
    linear-gradient(135deg, rgba(107, 57, 216, 0.12), rgba(22, 184, 175, 0.1)),
    rgba(255, 253, 248, 0.92);
}

.hero-copy-topline {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.hero-copy-topline .kicker {
  margin: 0;
}

.hero-copy-topline .choose-games-button {
  min-height: 42px;
  padding-inline: 16px;
}

.kicker {
  margin: 0 0 10px;
  color: #008a88;
  font-size: 0.78rem;
  font-weight: 1000;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

h1 {
  max-width: 13ch;
  margin: 0;
  color: var(--purple);
  font-size: clamp(3rem, 8vw, 6rem);
}

.hero-copy p:not(.kicker) {
  max-width: 62ch;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.2vw, 1.12rem);
  font-weight: 800;
  line-height: 1.55;
}

.concept-card {
  display: grid;
  gap: 12px;
  padding: 20px;
}

.concept-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.concept-command-button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(107, 57, 216, 0.18);
  border-radius: 999px;
  color: var(--purple);
  background: rgba(107, 57, 216, 0.08);
  cursor: pointer;
  font-weight: 1000;
}

.concept-card h2,
.concept-card h3,
.concept-card h4 {
  margin: 0;
  color: var(--purple);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.concept-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.45;
}

.command-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 130px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  list-style: none;
}

.command-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid rgba(107, 57, 216, 0.18);
  border-radius: 8px;
  color: var(--purple);
  background: rgba(107, 57, 216, 0.08);
  cursor: default;
  font-family: var(--mono);
  font-size: 0.83rem;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
  text-align: left;
}

.command-chip.is-overflow {
  min-width: 42px;
}

.world-panel {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(240px, 0.65fr);
  gap: clamp(16px, 2.5vw, 28px);
  align-items: center;
  min-height: min(52vh, 590px);
  padding: clamp(16px, 2.5vw, 28px);
  background:
    radial-gradient(circle at 16% 12%, rgba(255, 230, 129, 0.48), transparent 16rem),
    linear-gradient(135deg, rgba(113, 225, 215, 0.56), rgba(242, 252, 238, 0.92)),
    #effffc;
}

.pond-wrap {
  position: relative;
  display: grid;
  place-items: center;
  align-self: stretch;
  min-width: 0;
  max-width: 100%;
  padding-top: 46px;
  overflow: hidden;
}

.game-hud-actions {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 12;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.pond-grid {
  --cols: 3;
  --rows: 3;
  --size: min(64px, 12vw);
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, var(--size)));
  grid-template-rows: repeat(var(--rows), minmax(0, var(--size)));
  gap: 8px;
  padding: 14px;
  border: 4px solid #5ccac3;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.18) 0 2px, transparent 2px 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.18) 0 2px, transparent 2px 100%),
    #7bd9e0;
  background-size: 18px 18px;
  box-shadow:
    inset 0 0 0 4px rgba(255, 255, 255, 0.28),
    0 22px 42px rgba(10, 100, 120, 0.2);
  image-rendering: pixelated;
}

.pond-grid.is-challenge {
  --size: clamp(26px, 3.2vw, 34px);
  gap: 4px;
  padding: 8px;
  border-width: 3px;
  border-radius: 7px;
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 255, 0.24),
    0 18px 34px rgba(10, 100, 120, 0.18);
}

.pond-grid.is-challenge .tile {
  border-radius: 6px;
  border-width: 1px;
  overflow: visible;
}

.pond-grid.is-challenge .rock {
  width: 68%;
  height: 54%;
}

.pond-grid.is-challenge .frog {
  width: 76%;
  height: 68%;
  border-radius: 42% 42% 36% 36%;
  box-shadow:
    inset 0 -4px 0 rgba(24, 110, 46, 0.22),
    0 5px 0 rgba(23, 112, 126, 0.14);
}

.pond-grid.is-challenge .frog::before,
.pond-grid.is-challenge .frog::after {
  top: -16%;
  width: 29%;
  height: 31%;
  border-width: 2px;
}

.pond-grid.is-challenge .frog-mouth {
  left: 29%;
  bottom: 17%;
  width: 42%;
  border-bottom-width: 2px;
}

.tile {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  aspect-ratio: 1;
  border: 2px solid rgba(23, 112, 126, 0.2);
  border-radius: 8px;
  background: rgba(126, 226, 220, 0.58);
  overflow: hidden;
}

.tile::before {
  position: absolute;
  width: 72%;
  height: 54%;
  border-radius: 48% 52% 45% 55%;
  background:
    linear-gradient(135deg, #78d765 0 72%, #50b94f 72%),
    #78d765;
  box-shadow:
    inset 0 -5px 0 rgba(43, 130, 57, 0.22),
    0 7px 0 rgba(32, 110, 112, 0.16);
  content: "";
  transform: rotate(-11deg);
}

.tile::after {
  position: absolute;
  top: 37%;
  right: 24%;
  width: 16%;
  height: 8%;
  border-radius: 999px;
  background: rgba(35, 128, 56, 0.5);
  content: "";
  transform: rotate(-32deg);
}

.tile.is-water {
  background: rgba(126, 226, 220, 0.58);
}

.tile.is-water::before,
.tile.is-water::after {
  display: none;
}

.tile.is-edge-water {
  background: rgba(126, 226, 220, 0.58);
}

.tile.is-puddle {
  border-color: rgba(23, 112, 126, 0.12);
  background: rgba(126, 226, 220, 0.58);
  box-shadow: none;
}

.lily-pad.is-rotting::before,
.lily-pad.is-rotting::after {
  filter: sepia(0.6) hue-rotate(-15deg) brightness(0.85) saturate(0.85);
}

.tile.is-heron-nest::before,
.tile.is-heron-nest::after {
  display: none;
}

.tile.has-moving-pad::before {
  z-index: 2;
}

.tile.has-moving-pad::after {
  z-index: 3;
}

.tile.has-moving-pad-track {
  overflow: visible;
}

.tile.is-mystery-pad::before {
  z-index: 1;
}

.tile.is-mystery-pad-hiding::before {
  box-shadow:
    inset 0 -5px 0 rgba(43, 130, 57, 0.26),
    0 7px 0 rgba(32, 110, 112, 0.18),
    0 0 0 5px rgba(255, 230, 129, 0.2);
  animation:
    mystery-pad-shake 360ms steps(2, end) infinite,
    mystery-pad-pulse 920ms ease-in-out infinite;
}

.tile.is-mystery-pad-hiding::after {
  z-index: 2;
  animation: mystery-pad-spot-shake 360ms steps(2, end) infinite;
}

.mystery-pad-buzz {
  position: absolute;
  z-index: 3;
  inset: 14%;
  border-radius: 50%;
  pointer-events: none;
}

.moving-pad-track-line {
  position: absolute;
  top: -10px;
  bottom: -10px;
  left: 50%;
  z-index: 1;
  width: 5px;
  border-radius: 999px;
  background: rgba(229, 55, 69, 0.34);
  box-shadow: 0 0 0 5px rgba(229, 55, 69, 0.08);
  content: "";
  pointer-events: none;
  transform: translateX(-50%);
}

.pond-grid.is-challenge .moving-pad-track-line {
  top: -6px;
  bottom: -6px;
  width: 4px;
  box-shadow: 0 0 0 4px rgba(229, 55, 69, 0.08);
}

.heron-nest {
  position: relative;
  z-index: 2;
  width: 78%;
  height: 62%;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 48%, rgba(57, 43, 45, 0.24) 0 34%, transparent 35%),
    repeating-conic-gradient(from 18deg, #8b6640 0 12deg, #b98a55 12deg 22deg, #6f5235 22deg 34deg);
  box-shadow:
    inset 0 0 0 5px rgba(75, 52, 34, 0.34),
    0 6px 0 rgba(23, 112, 126, 0.16);
  transform: rotate(-8deg);
}

.heron-nest::before {
  position: absolute;
  inset: 24% 24% 20%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 44%, #eef5f3 0 12%, transparent 13%),
    radial-gradient(circle at 62% 58%, #dbe8e4 0 13%, transparent 14%),
    #5f4530;
  content: "";
}

.heron-nest::after {
  position: absolute;
  right: 2%;
  bottom: 8%;
  width: 38%;
  height: 12%;
  border-radius: 999px;
  background: #7b5a38;
  box-shadow:
    -28px -9px 0 -2px #9b7447,
    -12px -18px 0 -3px #6f5235,
    -34px 8px 0 -3px #b98a55;
  content: "";
  transform: rotate(-24deg);
}

.tile.is-splashing {
  overflow: visible;
}

.tile.is-rock::before,
.tile.is-rock::after {
  display: none;
}

.rock {
  position: relative;
  z-index: 1;
  width: 74%;
  height: 62%;
  border-radius: 5px;
  background:
    linear-gradient(137deg, #d2cbd7 0 22%, transparent 22%),
    linear-gradient(135deg, #b8b0c2 0 36%, #8a8298 36% 64%, #5d5668 64%);
  box-shadow:
    inset -6px -8px 0 rgba(41, 36, 52, 0.3),
    inset 4px 4px 0 rgba(255, 255, 255, 0.18),
    0 7px 0 rgba(32, 110, 112, 0.16);
  clip-path: polygon(8% 28%, 23% 8%, 43% 13%, 58% 0, 77% 16%, 92% 12%, 100% 35%, 88% 53%, 96% 78%, 73% 96%, 55% 88%, 37% 100%, 17% 84%, 0 88%, 8% 58%, 0 43%);
  transform: rotate(-4deg);
}

.rock::before,
.rock::after {
  position: absolute;
  pointer-events: none;
  content: "";
}

.rock::before {
  inset: 17% 18% 20% 20%;
  background:
    linear-gradient(135deg, transparent 0 45%, rgba(245, 240, 250, 0.55) 45% 52%, transparent 52%),
    linear-gradient(35deg, transparent 0 52%, rgba(48, 43, 58, 0.25) 52% 58%, transparent 58%);
  clip-path: polygon(8% 10%, 46% 10%, 38% 45%, 74% 44%, 52% 86%, 16% 86%, 30% 54%, 0 54%);
}

.rock::after {
  right: 12%;
  bottom: 10%;
  width: 48%;
  height: 34%;
  background: rgba(43, 38, 55, 0.23);
  clip-path: polygon(22% 0, 100% 8%, 78% 100%, 0 82%);
}

.tile.has-moving-boulder {
  overflow: visible;
}

.tile.has-moving-boulder::before,
.tile.has-moving-boulder::after {
  display: none;
}

.tile.is-boulder-up {
  box-shadow: inset 0 0 0 4px rgba(255, 230, 129, 0.22);
}

.moving-boulder-base {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 12%;
  width: 76%;
  height: 22%;
  border-radius: 14px 16px 12px 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.26) 0 22%, transparent 30%),
    linear-gradient(135deg, #d4ccd9 0 30%, #a9a0b5 30% 60%, #7a728a 60%);
  box-shadow:
    inset -5px -7px 0 rgba(41, 36, 52, 0.28),
    inset 5px 4px 0 rgba(255, 255, 255, 0.24),
    0 7px 0 rgba(32, 110, 112, 0.16);
  transform: translateX(-50%);
}

.moving-boulder-base::before {
  content: "";
  position: absolute;
  inset: 26% 16% 22% 18%;
  border-radius: 50%;
  background:
    linear-gradient(135deg, transparent 0 42%, rgba(245, 240, 250, 0.32) 42% 56%, transparent 58%);
  pointer-events: none;
}

.moving-boulder {
  position: absolute;
  z-index: 7;
  left: 50%;
  width: 76%;
  height: 46%;
  border-radius: 12px 14px 11px 13px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0 18%, transparent 20%),
    linear-gradient(135deg, #cbc4d0 0 30%, #8f879b 30% 60%, #5d5668 60%);
  box-shadow:
    inset -7px -9px 0 rgba(41, 36, 52, 0.34),
    inset 5px 4px 0 rgba(255, 255, 255, 0.2),
    0 7px 0 rgba(32, 110, 112, 0.16);
}

.moving-boulder.is-down {
  bottom: 30%;
  transform: translateX(-50%);
}

.moving-boulder.is-up {
  bottom: 108%;
  transform: translateX(-50%);
  box-shadow:
    inset -7px -9px 0 rgba(41, 36, 52, 0.32),
    inset 5px 4px 0 rgba(255, 255, 255, 0.18),
    0 14px 12px -8px rgba(32, 22, 51, 0.32);
}

.moving-boulder.is-just-raised {
  animation: rock-gate-rise 560ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.moving-boulder.is-just-smashed {
  animation: rock-gate-smash 360ms cubic-bezier(0.55, 0, 0.78, 0.08) both;
}

@keyframes rock-gate-rise {
  0% {
    bottom: 30%;
  }

  72% {
    bottom: 116%;
  }

  100% {
    bottom: 108%;
  }
}

@keyframes rock-gate-smash {
  0% {
    bottom: 108%;
    transform: translateX(-50%) scaleX(1) scaleY(1);
  }

  62% {
    bottom: 26%;
    transform: translateX(-50%) scaleX(1.08) scaleY(0.88);
  }

  82% {
    bottom: 34%;
    transform: translateX(-50%) scaleX(0.97) scaleY(1.04);
  }

  100% {
    bottom: 30%;
    transform: translateX(-50%) scaleX(1) scaleY(1);
  }
}

.tile.has-moving-boulder .frog.is-eaten {
  z-index: 4;
  transform: rotate(var(--frog-rotate, 0deg)) scaleY(0.56) translateY(18%);
}

.tile.has-stick-pile::before {
  z-index: 1;
}

.stick-pile {
  position: relative;
  z-index: 4;
  width: 82%;
  height: 64%;
  filter: drop-shadow(0 7px 0 rgba(32, 110, 112, 0.16));
  transform-origin: 50% 88%;
}

.stick-pile::before {
  content: "";
  position: absolute;
  left: 15%;
  right: 12%;
  bottom: 9%;
  height: 16%;
  border-radius: 50%;
  background: rgba(32, 22, 51, 0.1);
}

.stick-piece {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 76%;
  height: 17%;
  border-radius: 999px;
  background:
    linear-gradient(160deg, rgba(255, 218, 130, 0.32) 0 25%, transparent 42%),
    linear-gradient(90deg, #8d4d2e, #c27540 44%, #7a4428);
  box-shadow:
    inset -8px -6px 0 rgba(76, 38, 20, 0.28),
    inset 7px 5px 0 rgba(255, 218, 140, 0.22);
}


.stick-1 {
  width: 86%;
  transform: translate(-50%, -8%) rotate(-2deg);
}

.stick-2 {
  width: 78%;
  transform: translate(-46%, -62%) rotate(11deg);
}

.stick-3 {
  width: 72%;
  transform: translate(-54%, -96%) rotate(-17deg);
}

.stick-4 {
  width: 82%;
  transform: translate(-50%, 33%) rotate(22deg);
}

.stick-5 {
  width: 64%;
  transform: translate(-42%, -22%) rotate(-38deg);
}

.twig-1,
.twig-2 {
  width: 46%;
  height: 9%;
  background: linear-gradient(90deg, #8b4b2b, #b86932 58%, #7a452a);
  box-shadow: none;
}

.twig-1::before,
.twig-2::before {
  content: "";
  position: absolute;
  right: 13%;
  top: -82%;
  width: 20%;
  height: 110%;
  border-radius: 90% 10% 90% 10%;
  background: linear-gradient(135deg, #8de372, #4bb84a);
  box-shadow: inset -2px -3px 0 rgba(34, 100, 30, 0.28);
  transform: rotate(34deg);
}

.twig-1 {
  transform: translate(-54%, -128%) rotate(42deg);
}

.twig-2 {
  transform: translate(-36%, -120%) rotate(-58deg);
}

.stick-pile.is-wobbling {
  animation: stick-pile-wobble 520ms ease-in-out infinite;
}

.stick-pile.is-fallen {
  opacity: 0;
  animation: stick-pile-fall 520ms ease-out both;
}

.stick-splash {
  position: absolute;
  z-index: 5;
  bottom: 18%;
  width: 64%;
  height: 28%;
  border: 4px solid rgba(235, 255, 255, 0.86);
  border-top: 0;
  border-radius: 50%;
  animation: pond-splash 720ms ease-out forwards;
}

.fly {
  position: relative;
  z-index: 4;
  width: 38%;
  height: 38%;
  border-radius: 6px;
  background: #1f1730;
  animation: buzz 520ms steps(2, end) infinite;
}

.fly.is-accessible {
  box-shadow:
    0 0 0 5px rgba(255, 230, 129, 0.22),
    0 8px 10px rgba(31, 23, 48, 0.14);
  animation:
    buzz 520ms steps(2, end) infinite,
    fly-land 480ms ease-out;
}

.pond-grid.is-challenge .fly.is-left {
  --fly-water-x: 0%;
  --fly-water-return-x: -42%;
  --fly-water-y: 0%;
}

.pond-grid.is-challenge .fly.is-right {
  --fly-water-x: 0%;
  --fly-water-return-x: 42%;
  --fly-water-y: 0%;
}

.pond-grid.is-challenge .fly.is-accessible {
  animation:
    buzz 520ms steps(2, end) infinite,
    fly-return-from-water 620ms ease-out;
}

.fly.is-airborne {
  opacity: 0.45;
  filter: saturate(0.7);
  animation: fly-rise 520ms ease-out both;
}

.pond-grid.is-challenge .fly.is-airborne {
  z-index: 9;
  animation: fly-over-water 720ms ease-in-out both;
}

.pond-grid.is-challenge .fly.is-patrol,
.pond-grid.is-challenge .fly.is-firefly {
  z-index: 10;
  background: #f2b51f;
  box-shadow:
    0 0 0 5px rgba(255, 230, 129, 0.28),
    0 0 18px rgba(255, 198, 41, 0.7),
    0 8px 10px rgba(31, 23, 48, 0.14);
  animation: patrol-fly-look 620ms ease-in-out infinite;
}

.fly::before,
.fly::after {
  position: absolute;
  top: -26%;
  width: 48%;
  height: 48%;
  border-radius: 50% 50% 40% 40%;
  background: rgba(255, 255, 255, 0.72);
  content: "";
}

.fly::before {
  left: -28%;
  transform: rotate(-28deg);
}

.fly::after {
  right: -28%;
  transform: rotate(28deg);
}

.frog {
  position: relative;
  z-index: 5;
  width: 62%;
  height: 56%;
  border-radius: 8px;
  background:
    linear-gradient(180deg, #8df06c 0 64%, #55bf54 64%);
  box-shadow:
    inset 0 -6px 0 rgba(24, 110, 46, 0.24),
    0 8px 0 rgba(23, 112, 126, 0.18);
  transform: rotate(var(--frog-rotate, 0deg));
  transition:
    transform 220ms ease,
    translate 220ms ease;
}

.frog::before,
.frog::after {
  position: absolute;
  top: -18%;
  width: 28%;
  height: 30%;
  border: 3px solid #2f8238;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 52%, #211633 0 22%, transparent 24%),
    #eaffd8;
  content: "";
}

.frog.is-eaten::before,
.frog.is-eaten::after {
  display: grid;
  place-items: center;
  background: #eaffd8;
  color: #211633;
  font-size: 0.72rem;
  font-weight: 1000;
  line-height: 1;
}

.frog.is-eaten::before {
  content: "X";
}

.frog.is-eaten::after {
  content: "X";
}

.frog::before {
  left: 10%;
}

.frog::after {
  right: 10%;
}

.frog-mouth {
  position: absolute;
  left: 30%;
  bottom: 18%;
  width: 40%;
  height: 16%;
  border-bottom: 4px solid rgba(31, 22, 48, 0.5);
  border-radius: 50%;
}

.frog.is-hopping {
  translate: 0 -10px;
}

.frog.is-falling {
  animation: frog-fall 520ms ease-in forwards;
}

.frog.is-bumped {
  --bump-x: 12px;
  --bump-y: 0px;
  --bump-back-x: -4px;
  --bump-back-y: 0px;
  animation: frog-bump 680ms ease-in-out;
}

.headache {
  position: absolute;
  z-index: 7;
  top: -42%;
  right: -20%;
  color: #ffcf6b;
  font-size: 1.15rem;
  text-shadow: 0 2px 0 rgba(31, 22, 48, 0.26);
  animation: headache-sparkles 680ms ease-out infinite;
}

.heron {
  position: relative;
  z-index: 4;
  width: 54%;
  height: 92%;
  border-radius: 52% 48% 40% 42% / 42% 46% 56% 58%;
  background:
    linear-gradient(105deg, transparent 0 54%, rgba(75, 88, 110, 0.4) 55% 80%, transparent 81%),
    radial-gradient(ellipse at 40% 44%, #fbfffb 0 24%, transparent 25%),
    linear-gradient(180deg, #e7eeee 0 60%, #aebbc6 61% 100%);
  box-shadow:
    inset -4px -9px 0 rgba(58, 73, 96, 0.2),
    inset 5px 0 0 rgba(255, 255, 255, 0.34),
    0 6px 0 rgba(23, 112, 126, 0.14);
  animation: heron-step 720ms ease-in-out;
}

.heron::before {
  position: absolute;
  top: -12%;
  right: -70%;
  width: 112%;
  height: 54%;
  clip-path: polygon(2% 96%, 13% 48%, 30% 18%, 48% 12%, 70% 22%, 100% 30%, 70% 42%, 48% 34%, 35% 50%, 27% 96%);
  background:
    radial-gradient(circle at 47% 22%, #211633 0 4%, transparent 5%),
    linear-gradient(90deg, transparent 0 68%, #e58d33 69% 100%),
    linear-gradient(118deg, transparent 0 14%, #f7fbf6 15% 36%, #cbd7dc 37% 58%, transparent 59%);
  content: "";
}

.heron::after {
  position: absolute;
  left: 28%;
  bottom: -16%;
  width: 10%;
  height: 40%;
  border-radius: 999px;
  background:
    linear-gradient(#7a5e6c 0 16%, #6a5164 17% 100%);
  box-shadow:
    9px 0 0 #6a5164,
    -4px 22px 0 -1px #6a5164,
    13px 22px 0 -1px #6a5164;
  content: "";
}

.heron.is-attacking {
  z-index: 8;
  animation: heron-attack 620ms ease-in forwards;
}

.splash {
  position: absolute;
  z-index: 6;
  width: 58%;
  height: 24%;
  border: 4px solid rgba(235, 255, 255, 0.94);
  border-top: 0;
  border-radius: 50%;
  opacity: 0;
  animation: pond-splash 720ms ease-out forwards;
}

.splash::before,
.splash::after {
  position: absolute;
  bottom: 4px;
  width: 8px;
  height: 18px;
  border-radius: 999px;
  background: rgba(235, 255, 255, 0.94);
  content: "";
}

.splash::before {
  left: 22%;
  transform: rotate(-24deg);
}

.splash::after {
  right: 22%;
  transform: rotate(24deg);
}

@keyframes frog-fall {
  0% {
    opacity: 1;
    translate: 0 -10px;
    scale: 1;
  }

  72% {
    opacity: 1;
    translate: 0 6px;
    scale: 0.9;
  }

  100% {
    opacity: 0;
    translate: 0 18px;
    scale: 0.72;
  }
}

@keyframes pond-splash {
  0% {
    opacity: 0;
    scale: 0.2;
  }

  18% {
    opacity: 1;
    scale: 0.86;
  }

  100% {
    opacity: 0.38;
    scale: 1.35;
  }
}

@keyframes stick-pile-wobble {
  0%,
  100% {
    transform: rotate(-2deg);
  }

  42% {
    transform: rotate(8deg) translateY(-2px);
  }

  68% {
    transform: rotate(-7deg);
  }
}

@keyframes stick-pile-fall {
  0% {
    opacity: 1;
    transform: translateY(0) rotate(-4deg) scale(1);
  }

  62% {
    opacity: 0.82;
    transform: translateY(22px) rotate(24deg) scale(0.82);
  }

  100% {
    opacity: 0;
    transform: translateY(38px) rotate(34deg) scale(0.55);
  }
}

@keyframes water-ripple {
  0%,
  100% {
    opacity: 0.42;
  }

  50% {
    opacity: 0.82;
  }
}

@keyframes frog-bump {
  0%,
  100% {
    translate: 0 0;
    scale: 1;
  }

  25% {
    translate: var(--bump-x) var(--bump-y);
    scale: 0.94;
  }

  45% {
    translate: var(--bump-back-x) var(--bump-back-y);
    scale: 1.04;
  }

  65% {
    translate: 0 -3px;
    scale: 0.98;
  }
}

@keyframes headache-sparkles {
  0% {
    opacity: 0;
    transform: translate(0, 0) rotate(0deg);
  }

  30% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate(10px, -16px) rotate(100deg);
  }
}

@keyframes fly-rise {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  100% {
    opacity: 0.45;
    transform: translateY(-26px) scale(0.82);
  }
}

@keyframes fly-drop-away {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  100% {
    opacity: 0.45;
    transform: translateY(26px) scale(0.82);
  }
}

@keyframes fly-over-water {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }

  45% {
    opacity: 0.88;
    transform: translate(var(--fly-water-x), var(--fly-water-y)) scale(0.86);
  }

  72% {
    opacity: 0.62;
    transform: translate(var(--fly-water-x), calc(var(--fly-water-y) + 7px)) scale(0.82);
  }

  100% {
    opacity: 0.62;
    transform: translate(var(--fly-water-x), calc(var(--fly-water-y) + 7px)) scale(0.82);
  }
}

@keyframes fly-return-from-water {
  0% {
    opacity: 0.48;
    transform: translate(var(--fly-water-x), calc(var(--fly-water-y) + 7px)) scale(0.82);
  }

  62% {
    opacity: 0.92;
    transform: translate(var(--fly-water-return-x), var(--fly-water-y)) scale(0.94);
  }

  100% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
}

@keyframes patrol-fly-look {
  0%,
  100% {
    transform: translateX(-1px) rotate(-8deg);
  }

  50% {
    transform: translateX(1px) rotate(8deg);
  }
}

@keyframes fly-land {
  0% {
    transform: translateY(-18px) scale(0.86);
  }

  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes heron-step {
  0% {
    transform: translateY(-5px);
  }

  100% {
    transform: translateY(0);
  }
}

@keyframes heron-attack {
  0% {
    transform: translate(0, 0) scale(1);
  }

  100% {
    transform: translate(-12px, 7px) scale(1.16);
  }
}

@keyframes buzz {
  50% {
    transform: translate(2px, -2px);
  }
}

@keyframes mystery-pad-shake {
  0%,
  100% {
    transform: translate(0, 0) rotate(-11deg);
  }

  50% {
    transform: translate(3px, -2px) rotate(-7deg);
  }
}

@keyframes mystery-pad-spot-shake {
  50% {
    transform: translate(-2px, 1px) rotate(-24deg);
  }
}

@keyframes mystery-pad-pulse {
  50% {
    filter: brightness(1.07);
  }
}


.level-panel {
  display: grid;
  gap: 12px;
  align-self: stretch;
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(107, 57, 216, 0.16);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.level-share-cluster {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.level-share-cluster .share-status {
  min-height: 0;
  font-size: 0.8rem;
}

.share-button--level {
  width: 36px;
  min-height: 36px;
  padding: 0;
  flex-shrink: 0;
}

.level-kicker-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.round-counter {
  display: inline-flex;
  align-items: center;
  margin: 0;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid rgba(22, 184, 175, 0.24);
  border-radius: 8px;
  color: #143a52;
  background: rgba(22, 184, 175, 0.1);
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 1000;
}

.challenge-mode-button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(107, 57, 216, 0.24);
  border-radius: 999px;
  color: var(--purple);
  background: rgba(255, 230, 129, 0.82);
  cursor: pointer;
  font-weight: 1000;
  box-shadow: 0 8px 18px rgba(107, 57, 216, 0.12);
}

.challenge-mode-button[aria-pressed="true"] {
  color: #f8fbff;
  background: var(--purple);
}

.level-panel h2,
.level-panel h3,
.level-panel h4 {
  margin: 0;
  color: var(--purple);
  font-size: clamp(1.5rem, 3vw, 2.35rem);
}

.level-panel p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.45;
}

.level-buttons {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.level-buttons.has-next-page {
  padding-right: 48px;
}

.level-buttons.has-previous-page {
  padding-left: 48px;
}

.level-button {
  position: relative;
  min-height: 42px;
  border: 1px solid rgba(107, 57, 216, 0.22);
  border-radius: 8px;
  color: var(--purple);
  background: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  font-weight: 1000;
  overflow: hidden;
}

.level-button[aria-current="true"] {
  color: #170b24;
  background: var(--yellow);
  box-shadow: 0 10px 22px rgba(255, 206, 52, 0.24);
}

.level-button.is-completed:not([aria-current="true"]) {
  border-color: rgba(22, 184, 175, 0.4);
  box-shadow: inset 0 -4px 0 rgba(22, 184, 175, 0.42);
}

.level-button.is-freeplay {
  grid-column: span 2;
  padding-inline: 10px;
}

.level-page-button {
  position: absolute;
  top: 0;
  bottom: 0;
  display: grid;
  place-items: center;
  width: 42px;
  min-height: 0;
  color: #fff;
  background: var(--purple);
}

.level-page-button.is-previous-page {
  left: 0;
}

.level-page-button.is-next-page {
  right: 0;
}

.level-button:disabled {
  color: rgba(98, 89, 118, 0.52);
  background: rgba(255, 255, 255, 0.45);
  cursor: not-allowed;
}

.goal-box {
  padding: 12px;
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  background: rgba(22, 184, 175, 0.1);
  color: var(--ink);
  font-weight: 900;
  line-height: 1.45;
}

.ide-panel {
  display: grid;
  gap: 0;
  overflow: hidden;
  background: #162033;
}

.ide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #e9f5ff;
  background: #1f2a3f;
}

.ide-title {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  gap: 14px;
  min-width: 0;
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  font-weight: 1000;
  line-height: 1.15;
}

#ide-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ide-dot {
  display: inline-block;
  flex: 0 0 49px;
  width: 49px;
  height: 13px;
  background:
    radial-gradient(circle at 6.5px 50%, var(--teal) 0 6.5px, transparent 7px),
    radial-gradient(circle at 24.5px 50%, var(--yellow) 0 6.5px, transparent 7px),
    radial-gradient(circle at 42.5px 50%, #ff8fb2 0 6.5px, transparent 7px);
}

.ide-buttons {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.ide-button,
.celebration-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  color: #150d24;
  background: var(--yellow);
  cursor: pointer;
  font-weight: 1000;
}

.ide-button[hidden] {
  display: none;
}

.ide-button.secondary,
.celebration-button.secondary {
  color: #eef9ff;
  background: #34445f;
}

.ide-button:disabled {
  color: rgba(238, 249, 255, 0.55);
  background: #2a3448;
  cursor: not-allowed;
}

.ide-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 0.42fr);
  gap: 0;
  min-width: 0;
  min-height: 390px;
}

.editor-wrap {
  position: relative;
  min-width: 0;
  min-height: 390px;
  overflow: hidden;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  background: #101827;
}

.highlight-layer,
.code-input {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 16px 16px 16px 54px;
  border: 0;
  font-family: var(--mono);
  font-size: clamp(0.88rem, 1.4vw, 1rem);
  font-weight: 700;
  line-height: 1.65;
  tab-size: 2;
  white-space: pre;
  overflow: auto;
}

.code-input,
.trace-list {
  scrollbar-color: #66738a #101827;
  scrollbar-width: thin;
}

.code-input::-webkit-scrollbar,
.trace-list::-webkit-scrollbar {
  width: 14px;
  height: 14px;
}

.code-input::-webkit-scrollbar-track,
.trace-list::-webkit-scrollbar-track {
  background: #101827;
}

.code-input::-webkit-scrollbar-thumb,
.trace-list::-webkit-scrollbar-thumb {
  min-height: 42px;
  border: 3px solid #101827;
  border-radius: 999px;
  background: #66738a;
}

.code-input::-webkit-scrollbar-thumb:hover,
.trace-list::-webkit-scrollbar-thumb:hover {
  background: #8491a8;
}

.code-input::-webkit-scrollbar-corner,
.trace-list::-webkit-scrollbar-corner {
  background: #101827;
}

.code-input::-webkit-scrollbar-button,
.trace-list::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

.highlight-layer {
  pointer-events: none;
  color: #d8e9ff;
  scrollbar-width: none;
}

.highlight-layer::-webkit-scrollbar {
  display: none;
}

.highlight-layer::before {
  position: absolute;
  top: 16px;
  left: 14px;
  color: rgba(216, 233, 255, 0.36);
  content: attr(data-lines);
  text-align: right;
  white-space: pre;
}

.code-line {
  display: block;
  min-height: 1.65em;
  padding: 0;
  border-radius: 6px;
}

.code-line.is-running {
  background: rgba(255, 230, 129, 0.18);
  box-shadow: inset 4px 0 0 var(--yellow);
}

.code-line.is-error {
  background: rgba(255, 143, 178, 0.2);
  box-shadow: inset 4px 0 0 #ff8fb2;
}

.code-input {
  z-index: 2;
  width: 100%;
  height: 100%;
  resize: none;
  color: transparent;
  caret-color: #ffffff;
  background: transparent;
  outline: none;
}

.code-input::selection {
  color: transparent;
  background: rgba(255, 230, 129, 0.26);
}

.tok-keyword { color: #ffcf6b; }
.tok-type { color: #78ddff; }
.tok-fn { color: #94f29b; }
.tok-num { color: #ff9fc7; }
.tok-comment { color: #7f8da8; }
.tok-punc { color: #c9d7ee; }

.output-panel {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  color: #e9f5ff;
  background:
    linear-gradient(180deg, rgba(22, 32, 51, 0.95), rgba(24, 40, 58, 0.98)),
    #162033;
}

.output-panel h2,
.output-panel h3,
.output-panel h4 {
  margin: 0;
  font-size: 1.35rem;
}

.output-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.message-box {
  min-height: 96px;
  padding: 14px;
  border: 1px solid rgba(120, 221, 255, 0.24);
  border-radius: 8px;
  color: #dff8ff;
  background: rgba(16, 24, 39, 0.82);
  font-weight: 800;
  line-height: 1.45;
}

.message-box.success {
  border-color: rgba(148, 242, 155, 0.6);
  color: #ecffec;
  background: rgba(38, 114, 60, 0.32);
}

.message-box.error {
  border-color: rgba(255, 159, 199, 0.64);
  color: #ffeef5;
  background: rgba(92, 34, 62, 0.34);
}

.message-box.warning {
  border-color: rgba(255, 230, 129, 0.68);
  color: #fff7c2;
  background: rgba(105, 83, 20, 0.32);
}

.trace-list {
  display: grid;
  gap: 6px;
  max-height: 180px;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: auto;
  font-family: var(--mono);
  font-size: 0.82rem;
}

.trace-list li {
  padding: 7px 8px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
}

.hint-card {
  padding: 12px;
  border: 1px solid rgba(255, 230, 129, 0.26);
  border-radius: 8px;
  color: #fff9d5;
  background: rgba(255, 230, 129, 0.08);
  font-weight: 800;
  line-height: 1.4;
}

.celebration-overlay {
  position: fixed;
  z-index: 70;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(16, 24, 39, 0.56);
}

.celebration-overlay[hidden] {
  display: none;
}

.celebration-card {
  display: grid;
  gap: 12px;
  width: min(440px, 100%);
  padding: clamp(22px, 4vw, 30px);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background:
    radial-gradient(circle at 90% 8%, rgba(255, 230, 129, 0.42), transparent 9rem),
    linear-gradient(135deg, #fffdf8, #eafffb);
  box-shadow: 0 28px 70px rgba(21, 12, 38, 0.32);
}

.celebration-card h2 {
  margin: 0;
  color: var(--purple);
  font-size: clamp(2rem, 7vw, 3rem);
}

.celebration-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.45;
}

.celebration-level {
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 1000;
}

.celebration-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 12px;
  margin-top: 12px;
}

.celebration-actions .celebration-button {
  width: 100%;
  min-width: 0;
}

.celebration-actions .share-button,
.celebration-actions .celebration-share-button,
.command-reference-card .celebration-actions .celebration-button {
  grid-column: 1 / -1;
}

.command-reference-card {
  width: min(620px, 100%);
}

.command-reference-list {
  display: grid;
  gap: 10px;
  max-height: min(52vh, 420px);
  margin: 4px 0 0;
  overflow: auto;
}

.command-reference-list div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(107, 57, 216, 0.14);
  border-radius: 10px;
  background: rgba(107, 57, 216, 0.05);
}

.command-reference-list dt {
  color: var(--purple);
  font-family: var(--mono);
  font-weight: 1000;
}

.command-reference-list dd {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.45;
}

footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: clamp(14px, 2vw, 20px);
  width: 100%;
  margin: 0;
  padding: 28px max(24px, calc((100vw - 1120px) / 2));
  color: white;
  background: var(--purple-dark);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

footer strong {
  display: block;
}

footer span {
  color: rgba(255, 255, 255, 0.72);
}

.footer-copy {
  display: grid;
  gap: 6px;
  flex: 1 1 260px;
  min-width: 0;
}

.footer-nav {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: clamp(10px, 1.8vw, 18px);
  align-items: center;
  white-space: nowrap;
}

.footer-nav a {
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(0.92rem, 1.8vw, 1rem);
  font-weight: 800;
  line-height: 1.1;
}

@media (max-width: 980px) {
  footer {
    justify-content: flex-start;
    padding-right: max(320px, calc((100vw - 1120px) / 2));
  }

  .footer-copy {
    display: none;
  }

  .footer-nav {
    gap: 10px;
  }

  .footer-nav a {
    font-size: clamp(0.82rem, 1.6vw, 0.9rem);
  }
}

button:focus-visible,
a:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--purple);
  outline-offset: 3px;
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .nav-links,
  .nav-cta {
    display: none;
  }

  .header-actions {
    gap: 8px;
  }

  .mobile-nav {
    display: block;
  }
}

@media (max-width: 980px) {
  .hero,
  .game-instructions,
  .world-panel,
  .ide-body {
    grid-template-columns: 1fr;
  }

  .morse-code-game .morse-game-panel {
    grid-template-columns: 1fr;
  }

  .game-card-grid,
  .connect-grid {
    grid-template-columns: 1fr;
  }

  .game-card {
    min-height: auto;
  }

  .hero-copy-topline,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .world-panel {
    min-height: auto;
  }

  .editor-wrap {
    min-height: 340px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .workshop-promo-card {
    min-height: auto;
  }

  .workshop-promo-card::before {
    background:
      linear-gradient(180deg, rgba(47, 23, 103, 0.98) 0%, rgba(78, 37, 157, 0.86) 58%, rgba(47, 23, 103, 0.68) 100%),
      var(--rc-car-photo) center center / cover;
  }

  .workshop-promo-card h2,
  .workshop-promo-card > p:not(.workshop-date):not(.workshop-location):not(.pricing-note),
  .workshop-promo-card .pricing-note,
  .workshop-promo-card ul {
    max-width: none;
  }

  .workshop-promo-card .card-topline {
    margin-bottom: 24px;
  }
}

@media (max-width: 640px) {
  .brand small,
  .nav-cta {
    display: none;
  }

  .game-page {
    width: min(100% - 20px, 1180px);
    margin-top: 112px;
  }

  .game-selector,
  .playground-panel,
  .cta-panel,
  .reserve-callout,
  .connect-section,
  .workshop-promo-card {
    padding: 16px;
  }

  .reserve-callout .hero-actions,
  .reserve-callout .button {
    width: 100%;
  }

  .footer-nav {
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  footer {
    display: grid;
    padding-right: max(24px, calc((100vw - 1120px) / 2));
  }

  .site-header {
    width: calc(100% - 20px);
    min-height: 64px;
    border-radius: 18px;
  }

  .brand img {
    width: 44px;
    height: 44px;
  }

  .brand strong {
    font-size: 1rem;
  }

  .header-actions {
    gap: 6px;
  }

  .language-switcher summary {
    min-width: 52px;
    padding: 0 8px;
  }

  .language-switcher-menu,
  .mobile-nav-menu {
    right: -4px;
    min-width: min(280px, calc(100vw - 30px));
  }

  h1 {
    font-size: clamp(2.5rem, 14vw, 4rem);
  }

  .world-panel,
  .hero-copy,
  .concept-card {
    padding: 16px;
  }

  .pond-grid {
    --size: min(54px, 15vw);
    gap: 6px;
    padding: 10px;
  }

  .level-buttons {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .ide-header {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .ide-title {
    width: 100%;
  }

  .ide-buttons,
  .ide-button {
    width: 100%;
  }

  .editor-wrap {
    min-height: 280px;
  }

  .highlight-layer,
  .code-input {
    padding: 14px 12px 14px 42px;
    font-size: 0.82rem;
  }

  .highlight-layer::before {
    left: 8px;
  }

  .trace-list {
    max-height: 130px;
  }

  .garden-grid,
  .morse-readout,
  .circuit-status,
  .sorter-bins,
  .workshop-promo-card ul {
    grid-template-columns: 1fr;
  }

  .morse-led-stage {
    padding: 62px 14px 14px;
  }

  .morse-led-bulb {
    width: min(58vw, 180px);
    border-width: 10px;
  }

  .morse-trace-head,
  .morse-level-header,
  .morse-key-modal-head {
    align-items: stretch;
    flex-direction: column;
  }

  .morse-trace-bar {
    max-height: 180px;
  }

  .morse-key-modal {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 28px);
    padding: 16px;
  }

  .morse-key-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .morse-lab,
  .circuit-lab,
  .sorter-lab {
    padding: 12px;
  }

  .packet-grid {
    --size: min(56px, 18vw);
    gap: 6px;
    padding: 10px;
  }

  .drone-grid {
    --size: min(56px, 18vw);
    gap: 6px;
    padding: 10px;
  }

  .game-card-art {
    height: 120px;
  }
}

/* Mobile polish pass for the games experience. */
@media (max-width: 760px) {
  :root {
    --mobile-page-pad: clamp(22px, 6vw, 28px);
    --mobile-shadow: 0 12px 30px rgba(36, 24, 56, 0.08);
  }

  body {
    background:
      radial-gradient(circle at 12% 8%, rgba(255, 230, 129, 0.36), transparent 18rem),
      linear-gradient(180deg, #fff9df 0%, #ecfffb 38%, #fffdf8 100%);
    line-height: 1.64;
  }

  p,
  li,
  button,
  textarea {
    line-height: 1.6;
  }

  .site-header {
    top: max(10px, env(safe-area-inset-top));
    width: calc(100% - 20px);
    min-height: 64px;
    margin-top: 0;
    padding: 10px 12px;
    border-radius: 20px;
    box-shadow: 0 12px 28px rgba(34, 24, 51, 0.1);
    gap: 12px;
  }

  .brand {
    gap: 8px;
  }

  .brand img {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    box-shadow: 0 8px 18px rgba(108, 59, 210, 0.18);
  }

  .brand strong {
    font-size: 1rem;
  }

  .mobile-nav summary,
  .language-switcher summary {
    min-height: 48px;
  }

  .mobile-nav-menu,
  .language-switcher-menu {
    top: calc(100% + 10px);
    right: 0;
    width: min(280px, calc(100vw - 24px));
    padding: 10px;
    border-radius: 16px;
    box-shadow: var(--mobile-shadow);
  }

  .mobile-nav-menu a,
  .language-switcher-menu a {
    min-height: 48px;
    padding: 0 14px;
  }

  .mobile-nav-menu .mobile-nav-cta {
    min-height: 52px;
    justify-content: center;
    margin-top: 6px;
  }

  .game-page,
  .connect-section {
    width: min(100% - 24px, 1180px);
  }

  .game-page {
    gap: 24px;
    margin-top: 112px;
    margin-bottom: 64px;
  }

  .game-selector,
  .playground-panel,
  .workshop-promo-card,
  .cta-panel,
  .reserve-callout,
  .game-connect-section,
  .connect-section,
  .hero-copy,
  .concept-card,
  .world-panel,
  .ide-panel,
  .game-card,
  .connect-card {
    box-shadow: var(--mobile-shadow);
  }

  .game-selector,
  .playground-panel,
  .cta-panel,
  .connect-section,
  .hero-copy,
  .concept-card {
    padding: 22px;
  }

  h1 {
    font-size: clamp(2.75rem, 12vw, 4rem);
    line-height: 1.02;
  }

  .section-copy,
  .workshop-promo-card p,
  .workshop-promo-card li,
  .cta-panel p,
  .reserve-callout p,
  .hero-copy p:not(.kicker),
  .game-card-copy span,
  .concept-card p {
    max-width: 36ch;
    line-height: 1.66;
  }

  .section-heading,
  .hero-copy-topline {
    gap: 12px;
    margin-bottom: 22px;
  }

  .section-heading h2,
  .workshop-promo-card h2,
  .cta-panel h2,
  .reserve-callout h2,
  .hero-copy h2,
  .hero-copy h3 {
    font-size: clamp(2rem, 9.5vw, 3rem);
    line-height: 1.06;
  }

  .game-card-grid,
  .connect-grid,
  .playable-game,
  .playground-panel,
  .game-instructions {
    gap: 18px;
  }

  .game-card {
    gap: 14px;
    padding: 20px;
    transform: none;
  }

  .game-card:hover,
  .game-card:focus-visible,
  .game-card.is-active {
    box-shadow: var(--mobile-shadow);
    transform: none;
  }

  .game-card-art {
    height: 128px;
  }

  .game-card-copy strong {
    font-size: 1.45rem;
  }

  .game-card-action {
    min-height: 40px;
  }

  .button,
  .ide-button,
  .celebration-button {
    min-height: 52px;
  }

  .ide-buttons,
  .ide-button {
    width: 100%;
  }

  .world-panel,
  .ide-panel {
    overflow: hidden;
  }

  .editor-wrap {
    min-height: 300px;
  }

  .level-buttons {
    gap: 8px;
  }

  .level-button {
    min-height: 44px;
  }

  .workshop-promo-card {
    min-height: auto;
    padding: 24px;
  }

  .workshop-promo-card::before {
    background:
      linear-gradient(180deg, rgba(47, 23, 103, 0.9) 0%, rgba(78, 37, 157, 0.76) 58%, rgba(47, 23, 103, 0.66) 100%),
      var(--rc-car-photo) center center / cover;
  }

  .rc-course-animated::after {
    opacity: 0.18;
    animation: none;
  }

  .workshop-promo-card .workshop-learn-more {
    display: none;
  }

  .workshop-promo-card .workshop-actions,
  .workshop-promo-card .workshop-actions .button,
  .reserve-callout .hero-actions,
  .reserve-callout .button,
  .cta-panel .button {
    width: 100%;
  }

  .workshop-promo-card ul {
    gap: 8px;
  }

  .reserve-callout {
    padding: 60px 22px;
  }

  .connect-section {
    margin-bottom: 64px;
  }

  .connect-card {
    min-height: auto;
    padding: 22px;
  }

  footer {
    padding-bottom: 92px;
  }
}

@media (max-width: 420px) {
  .game-page,
  .connect-section {
    width: min(100% - 20px, 1180px);
  }

  .site-header {
    width: calc(100% - 20px);
  }

  .brand strong {
    font-size: 0.96rem;
  }

  .language-switcher summary {
    justify-content: center;
    width: 48px;
    min-width: 48px;
    padding: 0;
  }

  .caret-icon,
  .language-switcher-caret {
    display: none;
  }

  .game-selector,
  .playground-panel,
  .cta-panel,
  .connect-section,
  .hero-copy,
  .concept-card,
  .game-card,
  .connect-card,
  .workshop-promo-card {
    padding: 20px;
  }

  h1 {
    font-size: clamp(2.45rem, 11.5vw, 3.25rem);
  }

  .morse-key-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .morse-led-bulb,
  .morse-trace-token {
    transition: none !important;
  }

  .frog.is-falling,
  .frog.is-bumped,
  .fly.is-accessible,
  .fly.is-airborne,
  .fly.is-patrol,
  .stick-pile.is-wobbling,
  .stick-pile.is-fallen,
  .stick-splash,
  .headache,
  .heron,
  .splash,
  .plant-card.is-dried .garden-sun,
  .plant-card.is-dried .plant-sprout,
  .plant-card.is-wilted .plant-sprout {
    animation-duration: 1ms !important;
  }

  .rc-course-animated::before,
  .rc-course-animated::after,
  .rc-course-animated .card-topline,
  .rc-course-animated .workshop-date,
  .rc-course-animated h2,
  .rc-course-animated .workshop-location,
  .rc-course-animated > p:not(.workshop-date):not(.workshop-location),
  .rc-course-animated li,
  .rc-course-animated .workshop-actions {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    will-change: auto !important;
  }

  .rc-course-animated h2 {
    clip-path: none !important;
  }

  .rc-course-animated::after {
    opacity: 0.18 !important;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Mobile refinement pass v2: extra breathing room + iOS zoom safety
   for the coding game UI. Layers on top of the earlier mobile pass. */
@media (max-width: 760px) {
  /* Prevent iOS Safari from zooming into the code editor or inputs */
  .code-input,
  .highlight-layer,
  input,
  textarea,
  select {
    font-size: 16px;
  }

  /* Slightly more breathing inside the game cards on the picker */
  .game-card-grid {
    gap: 16px;
  }

  .game-card {
    padding: 22px;
    gap: 16px;
  }

  .game-card-copy {
    gap: 8px;
  }

  .game-card-copy strong {
    line-height: 1.15;
  }

  .game-card-copy span:not(.game-card-action) {
    line-height: 1.55;
  }

  /* Hero copy + concept card stack with more comfortable gap */
  .game-instructions {
    gap: 18px;
  }

  .hero-copy,
  .concept-card {
    padding: 24px;
    gap: 12px;
  }

  .hero-copy-topline {
    gap: 14px;
    margin-bottom: 18px;
  }

  /* IDE button row breathing */
  .ide-buttons {
    gap: 10px;
  }

  /* Level button row */
  .level-buttons {
    gap: 10px;
  }

  .level-button {
    min-height: 46px;
    padding: 0 14px;
  }

  /* World panel headline rhythm */
  .world-panel {
    padding: 22px;
    gap: 16px;
  }

  /* Message / hint cards */
  .message-box,
  .hint-card,
  .goal-box {
    padding: 14px 16px;
    line-height: 1.55;
  }
}

@media (max-width: 420px) {
  .game-card {
    padding: 18px;
    gap: 14px;
  }

  .game-card-art {
    height: 112px;
  }

  .hero-copy,
  .concept-card {
    padding: 20px;
  }
}
