:root {
  font-family: ui-rounded, "Trebuchet MS", sans-serif;
  color: #385e4e;
  background: #f2f1e5;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100svh;
  background:
    radial-gradient(ellipse at 66% 20%, #fffbed 0, transparent 50%),
    linear-gradient(135deg, #e6eedc, #f8f1e2 65%, #e6e9d6);
  overflow-x: hidden;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible {
  outline: 3px solid #536f8c;
  outline-offset: 4px;
}
.greenhouse {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.window {
  position: absolute;
  inset: -60px 10% 13%;
  border: 16px solid #cfdbc7;
  border-radius: 45% 45% 0 0;
  opacity: 0.48;
  box-shadow:
    0 0 0 5px #faffef,
    inset 0 0 40px #dbe5c4;
  background:
    linear-gradient(
      90deg,
      transparent 49.5%,
      #cbd6c0 49.5%,
      #cbd6c0 50.5%,
      transparent 50.5%
    ),
    linear-gradient(
      0deg,
      transparent 49.6%,
      #cbd6c0 49.6%,
      #cbd6c0 50.4%,
      transparent 50.4%
    );
}
.sun {
  position: absolute;
  width: 40vw;
  height: 140vh;
  background: #fffef0;
  opacity: 0.28;
  transform: rotate(32deg);
  left: 57%;
  top: -30%;
  filter: blur(22px);
}
.plant {
  position: absolute;
  bottom: -100px;
  width: 340px;
  height: 500px;
  border-radius: 100% 0 100% 0;
  background:
    repeating-linear-gradient(
      42deg,
      transparent 0 30px,
      #87a98b55 32px 35px,
      transparent 36px 55px
    ),
    linear-gradient(40deg, #8ba78366, #c3d6a533);
  filter: blur(2px);
  transform: rotate(-25deg);
  left: -190px;
}
.plant.right {
  left: auto;
  right: -170px;
  transform: rotate(80deg);
}
main {
  position: relative;
  max-width: 660px;
  margin: auto;
  text-align: center;
  padding: 30px 24px max(22px, env(safe-area-inset-bottom));
}
header .eyebrow {
  font-size: 10px;
  letter-spacing: 0.24em;
  color: #788775;
}
h1 {
  font-family: Georgia, serif;
  font-size: 68px;
  line-height: 1;
  margin: 5px 0 10px;
  font-weight: 500;
  letter-spacing: -5px;
}
h1 span {
  font-family: serif;
  color: #d79c73;
  font-size: 30px;
  vertical-align: top;
  display: inline-block;
  transform: rotate(12deg);
  margin: 4px 0 0 8px;
  letter-spacing: 0;
}
header p {
  font-size: 14px;
  color: #768471;
  margin: 0;
}
.garden-wrap {
  position: relative;
  margin: 22px auto 20px;
  max-width: 454px;
  height: 111px;
}
.garden {
  height: 90px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 18px 12px;
  position: relative;
  isolation: isolate;
}
.garden:before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 4%;
  right: 4%;
  bottom: 5px;
  height: 36px;
  border: 5px solid #d0dacc;
  border-top: 7px solid #e7ebd9;
  border-radius: 12px 12px 35% 35%;
  background: linear-gradient(#bac7ae, #d8ddc6);
  box-shadow:
    0 7px 12px #6e805718,
    inset 0 -5px #b9c8b455;
}
.garden:after {
  content: "";
  position: absolute;
  z-index: -1;
  left: 8%;
  right: 8%;
  bottom: 28px;
  height: 12px;
  border-radius: 50%;
  background: #8d998169;
  box-shadow: inset 0 3px 5px #54664922;
}
.garden .flower {
  width: 11.1%;
  height: 73px;
  flex-shrink: 0;
  margin-bottom: 6px;
  filter: drop-shadow(0 4px 2px #3f63411a);
}
.garden .sprout {
  width: 30%;
  height: 44px;
  margin-bottom: 8px;
  opacity: 0.45;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sprout:before,
.sprout:after {
  content: "";
  width: 20px;
  height: 10px;
  background: #759777;
  border-radius: 0 90% 0 90%;
  transform: rotate(20deg);
}
.sprout:after {
  transform: scaleX(-1) rotate(20deg);
}
#garden-label {
  font-size: 9px;
  letter-spacing: 0.2em;
  color: #81917b;
}
.play-area {
  margin: auto;
  width: min(100%, 440px);
}
.bench {
  position: relative;
  background: linear-gradient(135deg, #e5f2e2, #b5d4c3);
  border-radius: 32px;
  padding: 17px 17px 27px;
  border: 1px solid #b0cdb7;
  box-shadow:
    0 3px 0 #f8fff4 inset,
    0 -6px 0 #aac6b5 inset,
    0 9px 0 #a0bba7,
    0 13px 0 #d2d5bd,
    0 26px 28px -12px #4d6a4d3b,
    0 40px 60px -25px #79825b55;
}
#board {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  background: #a6c3b42b;
  border-radius: 20px;
  padding: 5px;
}
.cell {
  position: relative;
  border: 1px solid #a9c9b54d;
  border-radius: 17px;
  background: linear-gradient(145deg, #b5cdbc66, #d2e3ce55);
  box-shadow:
    inset 0 2px 4px #5d836214,
    inset 0 -1px 0 #f5fff166;
  padding: 0;
  min-width: 0;
  aspect-ratio: 1;
}
.cell.legal {
  background: #f7f7cf99;
  box-shadow:
    inset 0 0 0 2px #faffcaaa,
    0 0 12px #f7ffd955;
}
.tile {
  position: absolute;
  inset: 2px;
  border-radius: 15px;
  background: linear-gradient(145deg, #f9fae8, #d5e0c7);
  box-shadow:
    0 3px 0 #afc5a9,
    0 5px 7px #52795e33,
    inset 0 2px #fffff7;
  transition:
    transform 0.2s cubic-bezier(0.2, 0.8, 0.3, 1.2),
    box-shadow 0.2s;
  touch-action: none;
  user-select: none;
}
.tile:after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid #aebf9f44;
  border-radius: 11px;
  pointer-events: none;
}
.tile .flower {
  width: 100%;
  height: 110%;
  position: relative;
  top: -9%;
  pointer-events: none;
  filter: drop-shadow(0 2px 1px #315b491a);
}
.cell.selected {
  z-index: 3;
}
.selected .tile {
  transform: translateY(-4px) scale(1.035);
  box-shadow:
    0 5px 0 #b1c6a8,
    0 10px 14px #3e684b35,
    inset 0 2px #fffde9;
}
.dragging {
  z-index: 5 !important;
}
.dragging .tile {
  transition: none;
  cursor: grabbing;
}
.bench-mark {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  font-size: 7px;
  color: #708d78;
  opacity: 0.7;
}
.petals {
  transform: scale(0.12);
  opacity: 0;
  transition:
    transform 0.65s cubic-bezier(0.18, 0.85, 0.3, 1.2),
    opacity 0.25s;
}
.bud {
  transition:
    transform 0.4s,
    opacity 0.3s;
  transform-origin: 0 10px;
}
.heart {
  opacity: 0;
  transition: opacity 0.4s;
}
.open .petals {
  transform: scale(1);
  opacity: 1;
}
.open .bud {
  transform: scale(0.2);
  opacity: 0;
}
.open .heart {
  opacity: 1;
}
.blooming .tile {
  background: linear-gradient(145deg, #fffbe0, #dfebc8);
  box-shadow:
    0 0 24px #ffefbb99,
    0 5px 8px #52795e33;
}
.blooming .leaves {
  animation: leafspring 0.6s ease-out;
}
.pollen {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #f7d875;
  left: 50%;
  top: 40%;
  pointer-events: none;
  animation: pollen 0.9s ease-out both;
  --dx: 0px;
  --dy: -60px;
}
.arriving {
  animation: arrive 0.6s cubic-bezier(0.2, 0.8, 0.3, 1.2);
}
@keyframes pollen {
  to {
    transform: translate(var(--dx), var(--dy)) scale(0.2);
    opacity: 0;
  }
}
@keyframes leafspring {
  50% {
    transform: translateY(-4px) scale(1.025);
  }
}
@keyframes arrive {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.5);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.instructions {
  margin: 25px 0 16px;
  min-height: 42px;
}
.instructions p {
  font-size: 15px;
  margin: 0 0 5px;
  font-weight: 600;
}
.instructions span {
  font-size: 12px;
  color: #82907c;
}
nav {
  display: flex;
  justify-content: center;
  gap: 9px;
}
nav button {
  min-height: 44px;
  background: #faf9ec9c;
  border: 1px solid #c9d3bf;
  border-radius: 100px;
  padding: 7px 15px;
  font-size: 12px;
  box-shadow: 0 2px 0 #d5dbc8;
}
nav button span {
  font-size: 20px;
  vertical-align: -2px;
  margin-right: 4px;
}
nav button:hover {
  background: #fffdf0;
}
nav button:active {
  transform: translateY(2px);
  box-shadow: none;
}
nav button:disabled {
  opacity: 0.4;
  cursor: default;
}
footer {
  font-size: 9px;
  letter-spacing: 0.13em;
  color: #87937e;
  margin: 22px 0 0;
}
footer span {
  margin: 0 9px;
}
.complete .bench {
  box-shadow:
    0 3px 0 #f8fff4 inset,
    0 -6px 0 #aac6b5 inset,
    0 9px 0 #a0bba7,
    0 13px 0 #d2d5bd,
    0 20px 40px #d6c48755;
}
@media (max-width: 520px) {
  main {
    padding: 22px 15px 22px;
  }
  h1 {
    font-size: 57px;
  }
  header p {
    font-size: 12px;
  }
  .garden-wrap {
    margin: 17px auto 15px;
    height: 100px;
  }
  .garden {
    height: 82px;
  }
  .garden .flower {
    height: 66px;
  }
  .bench {
    padding: 12px 12px 24px;
    border-radius: 26px;
  }
  #board {
    gap: 5px;
    padding: 4px;
  }
  .cell {
    border-radius: 13px;
  }
  .tile {
    border-radius: 11px;
  }
  .tile:after {
    border-radius: 8px;
  }
  .instructions {
    margin-top: 24px;
  }
  nav {
    gap: 7px;
  }
  nav button {
    padding: 7px 12px;
  }
  footer {
    margin-top: 20px;
  }
}
@media (min-width: 900px) and (min-height: 850px) {
  main {
    padding-top: 33px;
  }
  .garden-wrap {
    margin-top: 24px;
    margin-bottom: 24px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
  }
  .pollen {
    display: none;
  }
}
/* The conservatory: warm glass, soft ceramic, and a working bench. */
main {
  max-width: 680px;
  padding-top: 22px;
}
header h1 {
  font-size: 72px;
  margin-bottom: 8px;
}
.mode-nav {
  margin: 19px 0 8px;
  gap: 3px;
}
.mode-nav button {
  border: 0;
  box-shadow: none;
  background: transparent;
  min-width: 100px;
}
.mode-nav button[aria-pressed="true"] {
  background: #dde7d3;
  box-shadow:
    inset 0 1px #fafff1,
    0 1px 2px #65745415;
}
.garden-heading {
  max-width: 440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 33px;
  font-family: Georgia, serif;
  font-style: italic;
  color: #7b8770;
  font-size: 13px;
}
#new-garden {
  border: 0;
  background: transparent;
  min-height: 44px;
  font-family: inherit;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.garden-wrap {
  margin: 5px auto 15px;
  height: 108px;
}
.garden {
  height: 88px;
  padding-left: 22px;
  padding-right: 22px;
}
.garden:before {
  border-color: #ced6bf;
  background: linear-gradient(100deg, #dee3cd, #b9c5ac 80%, #ccd6bb);
  border-top-color: #eef0dc;
  box-shadow:
    0 9px 15px #52613d12,
    inset 0 -4px #b5c0a4;
}
.garden:after {
  background: linear-gradient(#655348, #8c7960);
  height: 13px;
  bottom: 28px;
}
.garden-flower {
  border: 0;
  background: none;
  padding: 0;
  flex: 1 1 0;
  min-width: 0;
  height: 78px;
  position: relative;
  border-radius: 30%;
  touch-action: manipulation;
}
.garden .garden-flower .flower {
  width: 125%;
  height: 92px;
  margin-left: -12.5%;
  margin-bottom: 0;
  position: absolute;
  bottom: 0;
  left: 0;
}
.garden-flower:nth-child(3n + 2) {
  transform: translateY(4px);
}
.garden-flower:nth-child(3n) {
  transform: translateY(-5px);
}
.bench {
  background: linear-gradient(
    120deg,
    #e6f0df,
    #c5dece 35%,
    #b5cfbb 85%,
    #d0e2c9
  );
  border-color: #a8bfa7;
  box-shadow:
    inset 0 3px #fbfff0,
    inset 0 -6px #b3c8ae,
    0 8px 0 #99b096,
    0 12px 0 #d5d6b9,
    0 23px 24px -11px #425e3c45,
    0 42px 70px -24px #86916860;
}
.cell {
  background: linear-gradient(135deg, #a5bea94d, #d5e3ca44);
}
.tile {
  background:
    radial-gradient(
      ellipse at 50% 49%,
      #9c886c 0 27%,
      #786451 28% 31%,
      transparent 32%
    ),
    linear-gradient(125deg, #fffbea, #e1e6cd 62%, #cbd9bd);
  border: 1px solid #f8fff05c;
  box-shadow:
    0 3px 0 #a8ba98,
    0 5px 7px #52795e33,
    inset 0 2px #fffff7;
}
.tile:after {
  inset: 5px;
  border-color: #a8b48d5c;
}
.tile:before {
  content: "";
  position: absolute;
  width: 36%;
  height: 4px;
  background: #fffef8a1;
  border-radius: 50%;
  left: 11%;
  top: 8%;
  transform: rotate(-12deg);
}
.tile .flower {
  filter: drop-shadow(0 3px 1px #314e382b);
}
.petals {
  transition-delay: var(--unfurl-delay, 0ms);
}
.rose .petals {
  stroke-width: 0.8px;
}
.poppy .heart {
  fill: #514351;
}
.hint-target {
  outline: 3px solid #e0b858;
  outline-offset: -4px;
  background: #fff6c3;
}
.travelling {
  position: fixed;
  z-index: 20;
  pointer-events: none;
  transform-origin: top left;
}
[hidden] {
  display: none !important;
}
#finished {
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  padding: 16% 2% 9%;
  background: radial-gradient(ellipse at 50% 60%, #b4c7a452, transparent 70%);
}
#finished .garden-flower {
  height: 110px;
  min-height: 44px;
}
#finished .flower {
  width: 145%;
  height: 145%;
  margin: -30% -22.5% 0;
  filter: drop-shadow(0 5px 3px #45614225);
}
.complete .garden-wrap {
  opacity: 0.65;
}
.complete #finished .garden-flower:nth-child(4n + 2) {
  transform: translateY(-15px);
}
.complete #finished .garden-flower:nth-child(4n + 3) {
  transform: translateY(14px);
}
.tools {
  gap: 8px;
}
.tools button {
  padding: 7px 13px;
  font-size: 20px;
}
.tools button span {
  font-size: 12px;
  margin: 0;
  vertical-align: 2px;
}
.tools #settings {
  width: 44px;
  padding: 6px;
}
footer {
  font-size: 8px;
  letter-spacing: 0.2em;
  margin-top: 19px;
}
#save-notice {
  font-size: 12px;
  color: #775c40;
}
dialog {
  width: min(540px, calc(100% - 28px));
  max-height: 85svh;
  border: 1px solid #c3ceb4;
  border-radius: 25px;
  padding: 24px;
  background: #f4f2e5;
  color: #385e4e;
  box-shadow: 0 25px 100px #284b3b44;
}
dialog::backdrop {
  background: #294b3d50;
  backdrop-filter: blur(6px);
}
.sheet-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
h2 {
  font:
    26px/1.2 Georgia,
    serif;
  margin: 4px 0 14px;
}
#close-sheet {
  min-width: 44px;
  min-height: 44px;
  font-size: 28px;
  border: 0;
  border-radius: 50%;
  background: #e2e8d7;
}
#sheet-body > button {
  display: block;
  width: 100%;
  min-height: 48px;
  border: 1px solid #c2ceb3;
  background: #e8eddb;
  padding: 12px;
  border-radius: 13px;
  margin-top: 12px;
}
#sheet-body > p {
  font-size: 14px;
  line-height: 1.65;
  color: #74806b;
}
#sheet-body > .primary {
  background: #4c7058;
  color: #fffbed;
}
.journal-entry {
  margin-top: 22px;
  border-top: 1px solid #d1dac3;
  padding-top: 14px;
}
.journal-entry h3 {
  font:
    20px Georgia,
    serif;
  margin: 0;
}
.journal-entry p {
  font-size: 12px;
  color: #7a866d;
}
.journal-flowers {
  display: flex;
  min-height: 90px;
  padding: 10px 4px 0;
  border-radius: 18px;
  background: #e5e8d6;
}
.journal-flowers .flower {
  width: 135%;
  height: 100%;
  margin-left: -17.5%;
}
.reduced-motion *,
.reduced-motion *:before,
.reduced-motion *:after {
  animation: none !important;
  transition: none !important;
}
.reduced-motion .pollen {
  display: none;
}
@media (max-width: 520px) {
  main {
    padding: max(16px, env(safe-area-inset-top)) 13px
      max(20px, env(safe-area-inset-bottom));
  }
  header h1 {
    font-size: 57px;
    margin: 3px 0 7px;
  }
  header .eyebrow {
    font-size: 8px;
  }
  .mode-nav {
    margin-top: 12px;
  }
  .mode-nav button {
    min-width: 0;
    padding: 7px 15px;
  }
  .garden-heading {
    min-height: 27px;
    font-size: 12px;
  }
  .garden-wrap {
    height: 95px;
    margin-top: 0;
    margin-bottom: 12px;
  }
  .garden {
    height: 77px;
    padding-left: 20px;
    padding-right: 20px;
  }
  .garden .garden-flower {
    height: 70px;
  }
  .garden .garden-flower .flower {
    height: 78px;
  }
  .bench {
    padding: 11px 10px 24px;
  }
  .instructions {
    margin: 21px 0 13px;
    min-height: 40px;
  }
  .instructions p {
    font-size: 14px;
  }
  .instructions span {
    font-size: 11px;
  }
  .tools {
    gap: 5px;
  }
  .tools button {
    padding: 7px 9px;
  }
  .tools button span {
    font-size: 11px;
  }
  footer {
    margin-top: 15px;
  }
  #finished .garden-flower {
    height: 82px;
  }
}
@media (max-width: 350px) {
  .tools button {
    padding: 7px;
  }
  .tools button span {
    font-size: 10px;
  }
  #finished .garden-flower {
    height: 66px;
  }
}
@media (min-width: 600px) and (max-height: 1000px) {
  main {
    padding-top: 12px;
  }
  header h1 {
    font-size: 58px;
    margin: 3px 0 6px;
  }
  .mode-nav {
    margin: 8px 0 2px;
  }
  .garden-heading {
    min-height: 25px;
  }
  .garden-wrap {
    height: 86px;
    margin: 0 auto 10px;
  }
  .garden {
    height: 68px;
  }
  .garden .garden-flower {
    height: 62px;
  }
  .garden .garden-flower .flower {
    height: 72px;
  }
  .instructions {
    margin: 19px 0 10px;
  }
  footer {
    margin-top: 12px;
  }
}
.journal-flowers {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 12px 18px;
}
.journal-flowers .garden-flower {
  min-width: 44px;
  min-height: 78px;
}

#sheet-body .choice {
  display: block;
  width: 100%;
  text-align: left;
  white-space: normal;
  min-height: 54px;
  line-height: 1.5;
}
#sheet-body .choice[aria-pressed="true"] {
  border-color: #52613d;
  background: #e4eacb;
}

/* Shared daily board, designed to sit beside the planting bench. */
button, .back-link { min-height:44px; }
.mode-nav { flex-wrap:wrap; }
.mode-nav .board-button { background:#355845;color:#fff8e9; border-color:#355845; font-weight:700; }
.secondary-nav { display:flex;justify-content:center;gap:12px;flex-wrap:wrap;margin:0 auto 8px; }
.secondary-nav button {font-size:13px;padding:6px 14px;}
.ranked-stats {text-align:center;font-variant-numeric:tabular-nums;font-weight:600;margin:8px 0;}
.result-score {font-size:clamp(24px,6vw,36px);font-weight:600;margin:16px 0;}
.result-rank {font-size:24px;color:#355845;}
.leaderboard {width:100%;border-collapse:collapse;font-variant-numeric:tabular-nums;margin:18px 0;}
.leaderboard th,.leaderboard td {text-align:left;padding:11px 5px;border-bottom:1px solid #cad1bc;overflow-wrap:anywhere;}
.leaderboard th {font-size:12px;text-transform:uppercase;letter-spacing:.04em;}
.leaderboard .you {background:#e1ebd4;font-weight:700;}
.board-days {display:flex;justify-content:space-between;gap:6px;flex-wrap:wrap;}
.board-days button {padding:8px;font-size:13px;}
.board-note {font-size:13px;}
#player-name {display:block;box-sizing:border-box;width:100%;font:inherit;padding:12px;border:1px solid #889a7b;border-radius:8px;margin:8px 0;}
.back-link {display:flex;align-items:center;justify-content:center;color:#355845;margin-top:12px;}
.tutorial-source {outline:3px solid #b67c38;outline-offset:-3px;}
#sheet {box-sizing:border-box;max-width:min(520px,calc(100vw - 24px));}

#sheet-body > .result-score {font-size:clamp(28px,7vw,34px);line-height:1.25;color:#355845;font-weight:700;}
#sheet-body > .result-rank {font-size:24px;line-height:1.3;color:#355845;}
.board-days button {border:1px solid #c2ceb3;background:#e8eddb;border-radius:100px;min-height:44px;padding:8px 14px;}
.board-days button:disabled {opacity:.45;cursor:default;}
.leaderboard td:last-child {white-space:nowrap;font-size:13px;}
@media (max-height: 1000px) {
  main {padding-top:max(8px,env(safe-area-inset-top));padding-bottom:max(10px,env(safe-area-inset-bottom));}
  header h1 {font-size:48px;margin:2px 0 3px;}
  header .eyebrow {font-size:8px;}
  header p {font-size:12px;}
  .mode-nav {margin:6px 0 0;}
  .secondary-nav {margin-bottom:0;gap:8px;}
  .garden-heading {min-height:24px;}
  .ranked-stats {margin:3px 0;font-size:13px;}
  .garden-wrap {height:66px;margin:0 auto 6px;}
  .garden {height:50px;}
  .garden .garden-flower {height:48px;}
  .garden .garden-flower .flower {height:58px;}
  .instructions {margin:16px 0 8px;min-height:36px;}
  .instructions p {margin-bottom:3px;}
  footer {margin-top:8px;}
}
