.story-garden-scene {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  margin: 22px 0;
  background: #dff1fa;
}
.story-garden-scene > svg {
  display: block;
  width: 100%;
  max-height: 380px;
}
.story-garden-scene.small > svg {
  max-height: 220px;
}
.story-cloud {
  position: absolute;
  top: 6%;
  left: 40%;
  font-size: 3.8rem;
  opacity: 0.75;
  animation: cloud-drift 11s ease-in-out infinite alternate;
}
.story-butterfly {
  position: absolute;
  top: 46%;
  left: 60%;
  font-size: 2rem;
  animation: butterfly-hover 5s ease-in-out infinite;
}
.story-tree {
  transform-origin: 75px 160px;
  animation: tree-sway 6s ease-in-out infinite;
}
.story-sun {
  transform-origin: 673px 60px;
  animation: sun-breathe 7s ease-in-out infinite;
}
.story-visitor {
  position: absolute;
  left: 77%;
  top: 57%;
  width: 15%;
  max-width: 105px;
  pointer-events: none;
}
.story-visitor svg {
  width: 100%;
}
.story-welcome {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, 1fr);
  gap: 28px;
  margin: 22px 0;
  background: linear-gradient(110deg, #fcf7ed, #f2edfc);
}
.story-choices fieldset,
.story-ending fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 22px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.story-choices legend,
.story-ending legend {
  font-weight: 700;
  margin-bottom: 12px;
}
.story-choices .btn,
.story-ending .btn {
  min-height: 44px;
}
.story-next {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0;
}
.story-trail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0;
}
.story-trail a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 70px;
  border: 2px solid #ded1ed;
  background: #fffaf0;
  color: #503273;
  border-radius: 16px;
  padding: 12px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}
.story-trail a > span:first-child {
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
}
.story-trail .recorded {
  background: #e3f6e9;
  border-color: #a6d9ba;
}
.story-trail .current {
  border-color: #7750ad;
  box-shadow: 0 0 0 2px #ded0f2;
}
.story-dialogue {
  background: linear-gradient(110deg, #f1eafa, #f5fbf5);
  margin: 24px 0;
}
.story-dialogue .play-buddy {
  background: #ffffff80;
}
.story-narration,
#story-character-response {
  line-height: 1.8;
}
.story-narration {
  font-size: 1.08rem;
}
.story-dialogue h2 {
  font-size: 1.2rem;
  line-height: 1.5;
}
.story-chapter-end {
  margin: 24px 0;
  background: #f7f0db;
}
.story-chapter-end .button-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}
.story-practical {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  line-height: 1.65;
  padding: 16px;
  border-radius: 14px;
  background: #fff9ed;
}
.story-practical input {
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
  margin-top: 3px;
  accent-color: #7750ad;
}
.story-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 26px 0;
}
.story-tools p {
  font-size: 0.85rem;
  flex: 1 1 250px;
  margin: 0;
}
.story-tools label {
  margin: 0;
}
.story-pages {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin: 26px 0;
}
.story-page {
  background: #fffdf7;
  min-width: 0;
}
.story-page p {
  line-height: 1.8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.story-page blockquote {
  border-left: 3px solid #ac8bc7;
  margin: 16px 0;
  padding-left: 16px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.story-ending textarea {
  font-size: 1rem;
  width: 100%;
  resize: vertical;
  margin: 12px 0 24px;
}
.story-ending details p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.story-language {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #6f5d7d;
}
.story-trail a:focus-visible {
  outline: 3px solid #7750ad;
  outline-offset: 3px;
}
.story-ending fieldset .btn {
  white-space: normal;
  text-align: left;
}
html[data-motion-paused="true"] .story-tree,
html[data-motion-paused="true"] .story-cloud,
html[data-motion-paused="true"] .story-butterfly,
html[data-motion-paused="true"] .story-sun {
  animation: none !important;
}
@media (max-width: 900px) {
  .story-welcome {
    grid-template-columns: minmax(0, 1fr);
  }
  .story-trail {
    gap: 8px;
  }
  .story-trail a {
    font-size: 0.8rem;
    padding: 10px;
    gap: 6px;
  }
}
@media (max-width: 600px) {
  .story-trail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .story-pages {
    grid-template-columns: minmax(0, 1fr);
  }
  .story-cloud {
    font-size: 2rem;
  }
  .story-butterfly {
    font-size: 1.2rem;
  }
  .story-dialogue h2 {
    font-size: 1.1rem;
  }
  .story-choices .btn {
    white-space: normal;
  }
  .story-trail a > span:first-child {
    flex-basis: 25px;
    font-size: 1.25rem;
  }
  .story-ending textarea {
    font-size: 16px;
  }
  .story-practical {
    font-size: 0.9rem;
  }
  .story-tools {
    align-items: stretch;
  }
  .story-tools .link-button {
    text-align: left;
  }
}
@media (prefers-reduced-motion: reduce) {
  .story-tree,
  .story-cloud,
  .story-butterfly,
  .story-sun {
    animation: none !important;
  }
}
.story-sharing {
  margin: 24px 0;
  background: #f1f8f3;
}
.story-sharing .button-wrap {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.story-sharing details article,
.story-adult-observations article {
  padding: 14px 0;
  border-bottom: 1px solid #ded5e9;
}
.story-sharing blockquote,
.shared-story-chapter blockquote {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border-left: 3px solid #9d82bd;
  padding-left: 14px;
  margin: 16px 0;
}
.shared-story-chapter,
.shared-story-empty {
  padding: 16px 0;
  border-bottom: 1px solid #e8e1ef;
}
.shared-story-chapter p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.8;
}
.shared-story-empty {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  color: #796b86;
}
.shared-story-chapter summary {
  cursor: pointer;
  font-weight: 600;
}
.shared-story-chapter .portal-status {
  margin-left: 10px;
}
.story-adult-observations {
  margin-top: 22px;
}
.story-adult-observations p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.portal-story {
  min-width: 0;
}
.portal-story .form-control {
  width: 100%;
  max-width: 100%;
}
/* Illustrated pretend play: useful even if the optional scenery is unavailable. */
.garden-play-stage {
  position: relative;
  aspect-ratio: 16/9;
  min-height: 210px;
  max-height: 430px;
  overflow: hidden;
  border-radius: 20px;
  background: #d7e9ca url("assets/garden-school.webp") center / cover;
  border-bottom: 12px solid #aa8057;
}
.garden-play-friend {
  position: absolute;
  left: 12%;
  bottom: 9%;
  width: 15%;
  max-width: 110px;
  min-width: 65px;
  transform-origin: bottom center;
  animation: garden-friend-sway 4s ease-in-out infinite;
}
.garden-play-friend svg {
  display: block;
  width: 100%;
}
.garden-play-bed {
  position: absolute;
  left: 46%;
  bottom: 12%;
  width: 27%;
  height: 17%;
  background: #946446;
  border-radius: 50%;
  box-shadow: inset 0 -8px #7d5239;
}
.garden-play-seed {
  display: none;
  color: #f5c86b;
  position: absolute;
  left: 47%;
  top: 15%;
}
.is-planted .garden-play-seed {
  display: block;
}
.garden-play-plant {
  position: absolute;
  width: 65%;
  left: 18%;
  bottom: 35%;
  transform: scale(0);
  transform-origin: center bottom;
}
.is-watered .garden-play-seed {
  display: none;
}
.is-watered .garden-play-plant {
  transform: scale(1);
  animation: garden-seed-rise 0.65s ease-out;
}
.garden-play-drops {
  display: none;
  position: absolute;
  left: 58%;
  top: 38%;
  font-size: 2rem;
}
.is-watered .garden-play-drops {
  display: block;
  animation: garden-drop 0.8s ease-out forwards;
}
.garden-play-visitor {
  display: none;
  position: absolute;
  left: 74%;
  top: 39%;
  font-size: 2.5rem;
}
.has-visitor .garden-play-visitor {
  display: block;
  animation: butterfly-hover 5s ease-in-out infinite;
}
.garden-play-tools {
  margin-top: 18px;
}
.garden-play-tools button {
  min-height: 48px;
}
.garden-play-status {
  font-weight: 650;
}
.garden-play-save {
  font-size: 0.85rem;
}
.story-friend-portrait {
  display: inline-block;
  width: 34px;
  height: 48px;
  vertical-align: middle;
  margin-right: 8px;
  overflow: hidden;
}
.story-friend-portrait svg {
  width: 34px;
  height: 61px;
}
@keyframes garden-seed-rise {
  from {
    transform: scale(0.1);
  }
  to {
    transform: scale(1);
  }
}
@keyframes garden-drop {
  from {
    transform: translateY(-20px);
    opacity: 1;
  }
  to {
    transform: translateY(45px);
    opacity: 0;
  }
}
@keyframes garden-friend-sway {
  0%,
  100% {
    transform: rotate(-2deg);
  }
  50% {
    transform: rotate(2deg);
  }
}
html[data-motion-paused="true"] .garden-play-stage * {
  animation: none !important;
}
html[data-motion-paused="true"] .garden-play-drops {
  display: none;
}
@media (prefers-reduced-motion: reduce) {
  .garden-play-stage * {
    animation: none !important;
  }
  .garden-play-drops {
    display: none;
  }
}
@media (max-width: 600px) {
  .garden-play-stage {
    min-height: 220px;
  }
  .garden-play-tools {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}
/* Rendered character ensemble replaces the geometric prototype figure. */
.garden-play {
  background: linear-gradient(145deg, #fffbeb, #f1f8e9);
  border: 2px solid #d7bf78;
  box-shadow: 0 8px 26px #49352512;
}
.garden-play #garden-play-title {
  color: #315735;
}
.garden-play-stage {
  border: 4px solid #fff5ce;
  border-bottom: 10px solid #ac7950;
  box-shadow:
    inset 0 0 0 1px #be915d,
    0 4px 12px #72523326;
}
.garden-play-friend {
  left: 2%;
  bottom: 4%;
  width: 48%;
  max-width: 360px;
  min-width: 140px;
  animation: none;
}
.garden-friends-art {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 5px 3px #38261d26);
}
.garden-play-bed {
  left: 61%;
  bottom: 11%;
  width: 29%;
}
.garden-play-drops {
  left: 74%;
}
.garden-play-visitor {
  left: 82%;
  top: 30%;
}
.garden-play-tools .btn {
  border: 2px solid #fcf4d3;
  box-shadow:
    0 3px 0 #41643e,
    0 5px 8px #263e2d26;
  border-radius: 18px;
  font-weight: 750;
  background: linear-gradient(#568d41, #2a632e);
  color: white;
  text-shadow: 0 1px 1px #203b21;
}
.garden-play-tools .btn:hover:not(:disabled) {
  background: linear-gradient(#69a74e, #347b38);
}
.garden-play-tools .btn:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #41643e;
}
.garden-play-tools .btn:focus-visible {
  outline: 3px solid #6940b2;
  outline-offset: 4px;
}
.garden-play-tools .btn:disabled {
  opacity: 0.6;
  box-shadow: none;
}
.garden-play-tools [data-garden-play="water"] {
  background: linear-gradient(#3189b6, #17648c);
}
.garden-play-tools [data-garden-play="reset"] {
  background: linear-gradient(#8963af, #68408c);
}
@media (max-width: 600px) {
  .garden-play-friend {
    width: 55%;
    left: 0;
    bottom: 5%;
  }
  .garden-play-bed {
    left: 63%;
    width: 30%;
  }
}
/* Full-width investigation stage and purposeful contrast rather than pale empty cards. */
.garden-investigation {
  padding: 0;
  overflow: hidden;
  background: #123d32;
  color: #fff;
  border: 2px solid #d5b660;
  border-radius: 24px;
  margin: 22px 0;
  box-shadow: 0 14px 35px #13392b26;
}
.garden-mission-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 22px 26px;
  background: linear-gradient(120deg, #123d32, #25604a);
}
.garden-investigation #garden-play-title {
  color: #fff6d5;
  margin: 6px 0;
}
.garden-investigation .eyebrow {
  color: #bde7c3;
}
.garden-mission-header p {
  margin: 0;
  color: #e2efe7;
}
.garden-day {
  flex-shrink: 0;
  padding: 10px 16px;
  background: #0c2d25;
  border: 1px solid #9fc49b;
  border-radius: 12px;
}
.garden-day strong {
  color: #ffe58a;
  font-size: 1.4rem;
}
.garden-mission-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
}
.garden-investigation .garden-play-stage {
  min-width: 0;
  max-height: none;
  min-height: 400px;
  aspect-ratio: auto;
  margin: 0;
  border: 0;
  border-radius: 0;
  background-size: cover;
  background-position: center;
}
.garden-investigation .garden-play-friend {
  width: 46%;
  max-width: 330px;
  bottom: 9%;
  left: 0;
}
.garden-mission-panel {
  padding: 22px;
  background: #15392f;
}
.garden-mission-panel h3 {
  color: #fff6d5;
  margin: 6px 0 16px;
}
.garden-mission-steps {
  padding-left: 22px;
  line-height: 1.8;
  color: #dce7df;
}
.garden-mission-steps .complete {
  color: #b7ec83;
}
.garden-predictions {
  border: 0;
  margin: 16px 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.garden-predictions legend {
  margin-bottom: 10px;
}
.garden-investigation .btn[aria-pressed="true"] {
  outline: 3px solid #f1cb60;
  outline-offset: 1px;
}
.garden-day-button {
  width: 100%;
  background: linear-gradient(#ffe58c, #efba42);
  color: #233b27;
  border: 2px solid #fff2bd;
  font-weight: 750;
}
.garden-day-button:disabled {
  opacity: 0.5;
}
.garden-investigation .garden-play-status {
  color: #fff6d5;
  font-size: 1rem;
  margin-top: 16px;
}
.garden-observation {
  font-size: 0.87rem;
  color: #e4f2e9;
  border-top: 1px solid #426353;
  padding-top: 10px;
}
.garden-prediction-note,
.garden-investigation .garden-play-save {
  color: #c6d8cd;
  font-size: 0.8rem;
}
.garden-mission-footer {
  padding: 18px 24px;
  background: #0d2e26;
}
.garden-mission-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.garden-outcome {
  padding: 14px;
  border-radius: 14px;
  background: #245641;
  border: 1px solid #86c987;
}
.garden-plot {
  position: absolute;
  bottom: 15%;
  width: 24%;
  height: 37%;
  border: 0;
  background: transparent;
  color: #203f29;
  cursor: pointer;
  padding: 0;
}
.garden-plot-a {
  left: 44%;
}
.garden-plot-b {
  left: 73%;
}
.garden-plot:disabled {
  cursor: default;
  opacity: 1;
}
.garden-plot-soil {
  position: absolute;
  bottom: 15%;
  left: 0;
  width: 100%;
  height: 27%;
  border-radius: 50%;
  background: #795039;
  box-shadow:
    inset 0 -8px #593928,
    0 5px 8px #35291a33;
}
.flooded .garden-plot-soil {
  background: #8daeb2;
  box-shadow: inset 0 -8px #5d868d;
}
.garden-plot-soil svg {
  position: absolute;
  width: 70%;
  height: auto;
  bottom: 20%;
  left: 15%;
  transform: scale(var(--growth));
  transform-origin: bottom center;
}
.garden-plot-seed {
  color: #e9c580;
}
.garden-plot-label,
.garden-plot-light {
  position: absolute;
  left: 0;
  right: 0;
  padding: 5px;
  border-radius: 8px;
  background: #fffae6;
  box-shadow: 0 2px 4px #193c2530;
  font-size: 0.8rem;
  font-weight: 750;
}
.garden-plot-label {
  bottom: 0;
}
.garden-plot-light {
  top: 0;
}
.garden-plot.inspected .garden-plot-label {
  background: #d0f2ad;
}
.garden-plot:focus-visible {
  outline: 4px solid #6740aa;
  outline-offset: 4px;
  border-radius: 14px;
}
.garden-scene-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #13392be8;
  color: #fff9db;
  font-size: 0.8rem;
  padding: 10px;
  text-align: center;
}
@media (min-width: 1200px) {
  .garden-mission-layout {
    grid-template-columns: minmax(0, 1fr) 310px;
  }
  .garden-investigation .garden-play-stage {
    min-height: 470px;
  }
}
@media (max-width: 850px) {
  .garden-mission-layout {
    grid-template-columns: 1fr;
  }
  .garden-investigation .garden-play-stage {
    aspect-ratio: 16/10;
    min-height: 270px;
  }
  .garden-mission-header {
    padding: 18px;
  }
  .garden-day {
    padding: 8px;
    font-size: 0.8rem;
  }
  .garden-plot-label,
  .garden-plot-light {
    font-size: 0.7rem;
    padding: 4px 2px;
  }
}
.story-map-settings {
  margin: 20px 0;
  border: 1px solid #b5ccb9;
  border-radius: 16px;
  background: #fff;
}
.story-map-settings > summary {
  padding: 16px 20px;
  font-weight: 700;
  color: #234f3a;
  cursor: pointer;
}
.story-map-settings .story-welcome {
  margin: 0;
  box-shadow: none;
  border: 0;
  border-top: 1px solid #d6e4d8;
  border-radius: 0 0 16px 16px;
  background: #f7faf5;
}
