:root {
  --paper: #eaf0d8;
  --wash: #fff8d9;
  --surface: #fffbee;
  --ink: #263e33;
  --label: #47614c;
  --edge: #abc49c;
  --primary: #266348;
}
.scene {
  background: #58844d url(./meadow.webp) center/cover;
  display: grid;
  place-items: center;
}
.garden {
  height: 91%;
  aspect-ratio: 1;
  position: relative;
  filter: drop-shadow(0 6px 3px #22371666);
}
.tiles {
  touch-action: none;
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 0;
}
.tile {
  position: relative;
  padding: 0;
  margin: 3%;
  border: 1px solid #c1bd7d;
  border-radius: 27% 31% 27% 30%;
  background: linear-gradient(145deg, #ebe1ae, #d0c789);
  box-shadow:
    inset 1px 2px 0 #fff8cf,
    0 2px 0 #90995e;
}
.tile:nth-child(3n + 1) {
  border-radius: 32% 23% 32% 28%;
  background: linear-gradient(150deg, #e1e1af, #b7c28b);
}
.tile img {
  width: 96%;
  height: 94%;
  object-fit: contain;
  pointer-events: none;
  position: relative;
  z-index: 2;
}
.tile.flower img {
  width: 65%;
}
.tile.available::after,
.tile.route-end::after {
  content: "";
  position: absolute;
  inset: 6%;
  border: 3px dashed #fffbd5;
  border-radius: inherit;
}
.tile.route-end::after {
  border: 3px solid #397c54;
}
.tile.flower.picked img {
  opacity: 0.28;
  transform: scale(0.73);
}
.route-line {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.route-line polyline {
  stroke: #4d754f;
  stroke-width: 1.7;
  stroke-dasharray: 0.3 3.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.beetle {
  width: 19%;
  height: 19%;
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition:
    left 0.25s ease-in-out,
    top 0.25s ease-in-out;
}
.beetle img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: rotate(var(--turn));
  transition: transform 0.2s;
  filter: drop-shadow(1px 3px 1px #3e3b2e66);
}
.picnic .beetle img {
  animation: wiggle 0.5s ease-in-out 3 alternate;
}
@keyframes wiggle {
  to {
    transform: rotate(calc(var(--turn) + 15deg)) scale(1.1);
  }
}
.recipe {
  position: relative;
  margin-top: 12px;
  min-height: 42px;
  padding: 4px 8px;
  border: 1px dashed #8aa57b;
  border-radius: 12px;
  display: flex;
  gap: 4px;
  align-items: center;
  overflow-x: auto;
  background: #f7f6e5;
}
.recipe > span {
  font-size: 14px;
  color: #576b54;
}
.recipe button {
  border: 1px solid #b8caa4;
  border-radius: 8px;
  min-width: 44px;
  height: 44px;
  background: #e4ecd7;
  color: #284e34;
  font-size: 22px;
  line-height: 1;
}
.recipe button.current {
  background: #e8bd67;
  opacity: 1;
}
.recipe button.bump {
  background: #f0ae89;
}
@media (max-width: 600px) {
  .garden {
    height: auto;
    width: 91%;
  }
  .controls .command {
    padding: 7px 9px;
  }
}

.heading {
  position: absolute;
  color: #fff9d9;
  width: 8%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #426849;
  border: 1px solid #f4efc8;
  transform: translate(-50%, -50%) rotate(var(--dir));
  font-weight: bold;
  font-size: clamp(14px, 2vw, 21px);
  pointer-events: none;
}
.heading[hidden] {
  display: none;
}

.tile.available::after {
  border: 3px dashed #407b55;
  box-shadow: 0 0 0 2px #fff8ce;
}
.tile.available:hover::after {
  background: #faf7c766;
}

.bouquet {
  position: absolute;
  top: 2%;
  right: 2%;
  display: flex;
  gap: 3px;
  padding: 3px 6px;
  border-radius: 20px;
  background: #354c35d9;
  box-shadow: 0 2px 4px #16382744;
  pointer-events: none;
}
.bouquet span {
  width: clamp(17px, 2.5vw, 29px);
  aspect-ratio: 1;
  background: url(./token-3.webp) center/contain no-repeat;
  opacity: 0.36;
  filter: grayscale(1);
}
.bouquet .gathered {
  opacity: 1;
  filter: none;
}

.trail-album {
  position: absolute;
  inset: 3%;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: clamp(12px, 3%, 24px);
  border: 2px solid #87946a;
  border-radius: 16px;
  background: #fff8dc;
  box-shadow: 0 5px 12px #29402288;
}
.trail-album[hidden] {
  display: none;
}
.trail-album h3 {
  margin: 0;
}
.trail-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(125px, 1fr));
  gap: 8px;
  overflow: auto;
}
.trail-card {
  display: grid;
  justify-items: center;
  padding: 8px;
  color: #354e38;
  background: #f1edcc;
  border: 1px solid #a8b48a;
  border-radius: 9px;
}
.card-blooms img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}
.card-blooms .missing-bloom {
  opacity: 0.26;
  filter: grayscale(1);
}
.trail-album > button {
  align-self: flex-start;
  margin-top: auto;
}

.garden[hidden],
.bouquet[hidden],
.picnic-spread[hidden],
.picnic-spread img[hidden] {
  display: none;
}
.picnic-spread {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(82%, 520px);
  max-height: 89%;
  aspect-ratio: 3 / 2;
}
.picnic-spread img {
  position: absolute;
  pointer-events: none;
}
.picnic-spread .blanket {
  inset: 0;
  width: 100%;
  height: 100%;
}
.picnic-beetle {
  width: 16%;
  left: 5%;
  top: 51%;
  transform: rotate(18deg);
}
.picnic-berry {
  width: 14%;
  left: 40%;
  top: 49%;
  transform: rotate(-12deg);
}
.picnic-daisy {
  width: 13%;
}
.picnic-daisy.first {
  left: 67%;
  top: 20%;
  transform: rotate(-18deg);
}
.picnic-daisy.second {
  left: 72%;
  top: 12%;
  transform: rotate(18deg);
}
@media (min-width: 601px) {
  .picnic-spread {
    width: min(65%, 460px);
  }
}

.bump-marker {
  position: absolute;
  width: 8%;
  aspect-ratio: 1;
  z-index: 2;
  border: 2px solid #fff1c4;
  border-radius: 50%;
  color: #fff9c5;
  background: #ad542c;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  font-weight: 900;
  pointer-events: none;
}
.bump-marker[hidden] {
  display: none;
}

.trail-album > button {
  min-height: 44px;
  padding: 6px 14px;
  flex-shrink: 0;
  border-radius: 9px;
  border: 1px solid var(--edge);
  background: var(--surface);
  color: var(--ink);
  font-weight: 750;
}

.postcard-map {
  width: 70px;
  height: 70px;
  position: relative;
  border-radius: 6px;
  border: 1px solid #ad945f;
  background-color: #e5e4af;
  background-image:
    linear-gradient(90deg, #a9b18355 1px, transparent 1px),
    linear-gradient(#a9b18355 1px, transparent 1px);
  background-size: 20% 20%;
  transform: rotate(-2deg);
  margin-bottom: 4px;
}
.postcard-map svg {
  width: 100%;
  height: 100%;
}
.postcard-map polyline {
  stroke: #47754d;
  stroke-width: 3.8;
  stroke-dasharray: 1.5 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}
.postcard-map img {
  width: 19%;
  height: 19%;
  position: absolute;
  object-fit: contain;
  transform: translate(-50%, -50%);
}

.recipe[hidden] {
  display: none;
}
.first-step .tile.flower.available::after {
  content: "☞";
  position: absolute;
  inset: auto auto 1% 1%;
  width: 40%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff7cd;
  background: #315e48;
  font-size: clamp(14px, 3vw, 24px);
  font-weight: bold;
  pointer-events: none;
}
