#activity-root[data-adventure="cookie-shapes"] .gh-surface {
  width: min(100%, 1280px);
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.35fr);
  column-gap: clamp(16px, 3vw, 52px);
}

#activity-root[data-adventure="cookie-shapes"] .gh-hero {
  width: min(100%, 330px, 47svh);
}

#activity-root[data-adventure="cookie-shapes"] .gh-actor-header {
  align-items: center;
}

#activity-root[data-adventure="cookie-shapes"] .gh-task {
  max-width: 17ch;
  padding-block: .48em;
  text-wrap: balance;
}

#activity-root[data-adventure="cookie-shapes"] .gh-feedback {
  box-sizing: border-box;
  min-height: 34px;
}

.mold-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(92px, .34fr);
  align-items: center;
  gap: clamp(10px, 2vw, 30px);
}

.mold-stamping {
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 490px;
  justify-self: end;
  padding: clamp(5px, 1vw, 12px);
  box-sizing: border-box;
  border: 1px solid #ffe3a1;
  border-radius: 32% 27% 29% 24% / 29% 27% 31% 30%;
  background: #e8c894;
  box-shadow: 0 10px 24px #77452132, inset 0 0 21px #8b4c2250;
}

.mold-sand {
  display: grid;
  width: min(100%, 430px, 57svh);
  aspect-ratio: 1;
}

.mold-sand canvas {
  grid-area: 1 / 1;
  align-self: center;
  width: 100%;
  max-height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.mold-stamp { visibility: hidden; }
.mold-piece { transform: rotate(var(--mold-turn)); }
.mold-piece[data-placed="true"] { transition: transform 360ms cubic-bezier(.24,.76,.25,1), opacity 380ms ease-out; }
.mold-sand[data-feedback="stamped"] .mold-stamp { visibility: visible; }
.mold-sand[data-feedback="stamped"] .mold-outline { visibility: hidden; }
.mold-sand[data-feedback="stamped"] .mold-piece {
  transform: translateY(-18%) rotate(var(--mold-turn));
  opacity: 0;
}
.mold-sand[data-feedback="retry"] {
  outline: 3px dashed #8f5326;
  outline-offset: -6px;
  border-radius: inherit;
}

.mold-actions, .mold-choices {
  display: grid;
  align-items: center;
  justify-items: center;
  gap: clamp(8px, 1.5vh, 16px);
}

.mold-actions button {
  touch-action: manipulation;
}

.mold-choices button {
  width: min(100%, 126px, 19svh);
  aspect-ratio: 1;
  background: #fff1ce;
  border: 1px solid #b1793e;
  border-radius: 18px;
  box-shadow: inset 0 0 0 3px #fff9e8, 0 4px 7px #7745213b;
  padding: 0;
  display: grid;
  place-items: center;
}

.mold-choices button:hover { background: #fff9e8; }
.mold-choices button[aria-pressed="true"] { background: #fff0b8; }
.mold-choices canvas { width: 100%; max-height: 100%; object-fit: contain; pointer-events: none; }

.mold-actions .mold-turn {
  width: min(100%, 126px);
  min-height: 78px;
  display: grid;
  place-items: center;
  align-content: center;
  font-size: clamp(20px, 2vw, 27px);
  color: #fff9e7;
  line-height: 1;
  border: 2px solid #075964;
  border-radius: 18px;
  background: linear-gradient(#147f80, #0d616d);
  box-shadow: inset 0 0 0 2px #ffffff30, 0 4px 0 #084954, 0 7px 13px #63391d46;
  padding: 6px 10px 9px;
}

.mold-actions .mold-turn:not(:disabled):hover { background: #075964; }
.mold-actions .mold-turn:disabled {
  background: #e6d7b6;
  color: #655239;
  border-color: #a8966b;
  box-shadow: none;
  cursor: default;
}
.mold-arrow { font: 700 clamp(34px, 4vw, 54px)/.92 Arial, sans-serif; }

.mold-castle {
  width: min(100%, 325px);
  margin: 0 auto;
  pointer-events: none;
}
.mold-castle[hidden] { display: none; }
.mold-castle-art { display: block; width: 100%; height: auto; }

@media (max-width: 760px) and (orientation: portrait) {
  #activity-root[data-adventure="cookie-shapes"] .gh-surface {
    grid-template: "buno" auto "activity" auto "feedback" auto / minmax(0, 1fr);
    row-gap: 5px;
  }
  #activity-root[data-adventure="cookie-shapes"] .gh-actor-header {
    flex-flow: row wrap;
    justify-content: center;
    align-items: center;
    column-gap: 5px;
  }
  #activity-root[data-adventure="cookie-shapes"] .gh-hero { width: min(41vw, 168px, 21svh); }
  #activity-root[data-adventure="cookie-shapes"] .gh-task { max-width: 13ch; }
  #activity-root[data-adventure="cookie-shapes"] .gh-content { padding-block: 3px; }
  .mold-workbench {
    grid-template-columns: minmax(0, 1fr) minmax(65px, .31fr);
    gap: 7px;
  }
  .mold-sand { width: min(100%, 38svh); }
  .mold-stamping { padding: 3px; }
  .mold-choices button { width: min(100%, 86px, 11svh); min-width: 54px; }
  .mold-actions .mold-turn { min-height: 62px; max-width: 90px; padding-inline: 3px; }
  .mold-castle { flex-basis: 100%; display: grid; justify-items: center; }
  .mold-castle-art { width: min(100%, 190px, 25svh); }
}

@media (min-width: 761px) and (orientation: portrait) {
  #activity-root[data-adventure="cookie-shapes"] .gh-surface {
    grid-template-areas: "buno activity" "buno feedback";
  }
  #activity-root[data-adventure="cookie-shapes"] .gh-actor-header { flex-direction: column; }
}

@media (max-height: 600px) {
  .mold-actions .mold-turn { min-height: 49px; padding-block: 3px; }
  .mold-arrow { font-size: 33px; }
  .mold-choices button { width: min(100%, 65px, 14svh); min-height: 48px; min-width: 48px; }
  .mold-castle-art { max-height: 18svh; object-fit: contain; }
}

@media (orientation: landscape) and (max-height: 450px) {
  #activity-root[data-adventure="cookie-shapes"] .gh-surface {
    grid-template-columns: clamp(120px, 19vw, 200px) minmax(0, 1fr);
  }
  #activity-root[data-adventure="cookie-shapes"] .gh-hero { width: min(100%, 30svh); }
  .mold-sand { width: min(100%, 49svh); }
}

@media (prefers-reduced-motion: reduce) {
  .mold-piece[data-placed="true"] { transition: none; }
}
