/* A small forest stage for the reusable movement controller. */
.qp-motion-page {
  position: absolute;
  inset: var(--qp-top-height, 60px) 0 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: min(1100px, 100%);
  margin-inline: auto;
  padding: 16px 22px 17px;
  color: #3d5738;
  overflow: auto;
}
.qp-motion-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
  gap: 14px;
  min-width: 0;
  padding: 0 3px;
}
.qp-motion-heading :is(h1, h2, h3) {
  margin: 0 0 3px;
  color: #416b39;
  font-family: var(--candy-font, "Jua", sans-serif);
  font-size: 29px;
  font-weight: 400;
  line-height: 1.12;
  text-shadow: 0 2px 0 #ffffffb3;
}
.qp-motion-heading p {
  margin: 0;
  color: #587a50;
  font-size: 12px;
  line-height: 1.3;
}
body .qp-motion-page .qp-motion-heading button {
  flex: none;
  min-height: 34px;
  padding: 6px 12px;
  font-size: 13px;
  white-space: nowrap;
}
.qp-motion-world {
  position: relative;
  flex: 1 1 340px;
  min-width: 0;
  min-height: 260px;
  border: 5px solid #679151;
  border-radius: 23px;
  background: #748c47 url('./assets/woodland-forest.svg') center 70% / cover no-repeat;
  box-shadow: inset 0 0 0 2px #d6e4a57a, inset 0 -45px 25px #29482325, 0 4px 0 #3f6737, 0 8px 15px #365b2924;
  isolation: isolate;
  overflow: hidden;
  outline-offset: 3px;
  touch-action: manipulation;
}
.qp-motion-world:focus-visible { outline: 3px solid #ffc847; }
.qp-motion-world::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 51% 37%, #fff7be16, transparent 56%);
  pointer-events: none;
  z-index: 0;
}
.qp-motion-world::after {
  /* A deep moss band accommodates the artwork's feet and smaller companions. */
  content: '';
  position: absolute;
  left: -2%;
  right: -2%;
  bottom: -5px;
  height: 56px;
  border-top: 3px solid #a2ba62;
  border-radius: 45% 45% 0 0 / 12px 12px 0 0;
  background:
    radial-gradient(ellipse at 22% 20%, #d7df9938 0 9%, transparent 10%),
    radial-gradient(ellipse at 74% 45%, #7a4a292b 0 8%, transparent 9%),
    repeating-linear-gradient(174deg, transparent 0 7px, #f2d3950b 8px 9px, transparent 10px 15px),
    linear-gradient(#81964f 0%, #6b7942 47%, #7b6340 51%, #675334 100%);
  box-shadow: inset 0 3px 0 #c6d5896b, 0 -6px 17px #a6b66524;
  pointer-events: none;
  z-index: 1;
}
.qp-motion-actor {
  position: absolute;
  left: 0;
  bottom: 32px;
  width: 160px;
  height: 224px;
  line-height: 0;
  transform-origin: center bottom;
  will-change: transform;
  z-index: 2;
}
.qp-motion-actor > svg {
  display: block;
  width: 160px;
  height: 224px;
  max-width: none;
  max-height: none;
  border: 0;
  border-radius: 0;
  overflow: visible;
}
.qp-motion-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  flex: none;
  gap: 10px;
  width: min(620px, 100%);
  margin: 1px auto 3px;
}
body .qp-motion-page .qp-motion-controls button[data-motion] {
  --candy-top: #a9e58c;
  --candy-mid: #7ac662;
  --candy-bottom: #58a348;
  --candy-edge: #3d8537;
  --candy-base: #367331;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  min-height: 60px;
  padding: 7px 10px 8px;
  color: #fffde5;
  border: 3px solid #fffbea;
  background: linear-gradient(var(--candy-top), var(--candy-mid) 45%, var(--candy-mid) 55%, var(--candy-bottom));
  box-shadow: inset 0 0 0 1px var(--candy-edge), inset 0 3px 0 #ffffff57, inset 0 -4px 0 #0000000d, 0 4px 0 var(--candy-base), 0 6px 0 #ffffffe0;
  font-family: var(--candy-font, "Jua", sans-serif);
  font-size: 19px;
  font-weight: 400;
  line-height: 1.15;
  border-radius: 15px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
body .qp-motion-page .qp-motion-controls button[data-motion='jump'] {
  --candy-top: #fff19a;
  --candy-mid: #ffd55b;
  --candy-bottom: #f0b837;
  --candy-edge: #c4942a;
  --candy-base: #a97822;
  color: #754714;
  text-shadow: 0 1px 0 #fff5b887;
}
body .qp-motion-page .qp-motion-controls button[data-motion='sit'] {
  --candy-top: #99e7ed;
  --candy-mid: #59c7d7;
  --candy-bottom: #3ca9c1;
  --candy-edge: #23879e;
  --candy-base: #226b81;
}
.qp-motion-controls button :is(small, kbd) {
  font-family: "NanumSquareRound", sans-serif;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  opacity: .94;
  text-shadow: none;
}
.qp-motion-controls button .candy-icon { width: 23px; height: 23px; }
.qp-motion-status {
  flex: none;
  align-self: center;
  min-height: 23px;
  margin: 0;
  padding: 3px 15px;
  color: #58753f;
  background: #fffcecc4;
  border: 1px solid #bfd39b;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
}
.qp-motion-help {
  flex: none;
  margin: 0;
  color: #5a754f;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}
.qp-motion-help kbd {
  display: inline-block;
  min-width: 18px;
  padding: 0 3px;
  color: #4b6940;
  background: #fffbed;
  border: 1px solid #bccc9c;
  border-bottom-width: 2px;
  border-radius: 4px;
  font: inherit;
  font-weight: 800;
}
/* The fixed demo launcher otherwise covers these bottom-row controls. */
body:has(.qp-motion-page) .qp-demo-toolbar { display: none; }
body .homewrap .wood-caption .wood-motion-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  min-height: 22px;
  margin-left: 3px;
  padding: 2px 7px 3px;
  color: #fff9d8;
  background: linear-gradient(#8db85c, #658f40);
  border: 1px solid #426a2e;
  border-radius: 6px;
  box-shadow: inset 0 1px 0 #c7e79b80, 0 2px 0 #31562e;
  font-family: var(--candy-font, "Jua", sans-serif);
  font-size: 11px;
  font-weight: 400;
  line-height: 1;
  text-shadow: 0 1px 0 #426329;
  vertical-align: middle;
}
body .homewrap .wood-caption:has(.wood-motion-trigger) { margin-bottom: 3px; line-height: 22px; }
body .homewrap .wood-caption .wood-motion-trigger:is(:active, .qp-pressed) {
  transform: translateY(1px);
  box-shadow: inset 0 1px 0 #c7e79b80, 0 1px 0 #31562e;
}
@media (min-width: 661px) and (max-height: 690px) {
  .qp-motion-page { padding-block: 11px 12px; gap: 8px; }
  .qp-motion-heading :is(h1, h2, h3) { font-size: 26px; }
  body .qp-motion-page .qp-motion-controls button[data-motion] { min-height: 56px; padding-block: 6px; font-size: 18px; }
}
@media (max-width: 660px) {
  .qp-motion-page { inset-block-start: var(--qp-top-height, 100px); gap: 10px; padding: 16px 13px 18px; }
  .qp-motion-heading { gap: 10px; padding-inline: 2px; }
  .qp-motion-heading :is(h1, h2, h3) { font-size: 26px; }
  .qp-motion-heading p { max-width: 245px; font-size: 11px; }
  body .qp-motion-page .qp-motion-heading button { padding-inline: 8px; font-size: 12px; }
  .qp-motion-world { flex-basis: 380px; border-width: 4px; border-radius: 18px; background-position: 50% 65%; }
  .qp-motion-controls { gap: 7px; margin-bottom: 4px; }
  body .qp-motion-page .qp-motion-controls button[data-motion] { min-height: 65px; padding: 8px 3px; border-radius: 13px; font-size: 17px; }
  .qp-motion-controls button :is(small, kbd) { font-size: 10px; }
  .qp-motion-help { max-width: 340px; margin-inline: auto; font-size: 11px; }
  .qp-motion-status { max-width: 100%; padding-inline: 12px; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .qp-motion-controls button, .wood-motion-trigger { transition: none; }
}
