:root {
  font-family: 'DM Sans', 'Noto Sans Thai', sans-serif;
  color: #564560;
  background: #fbf7ef;
  font-synthesis: none;
  --plum: #564560;
  --muted: #95899b;
  --peach: #ffc7af;
  --mint: #c4e4d3;
  --lavender: #dcd3ee;
  --line: #eae1d9;
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-width: 280px;
  background: radial-gradient(ellipse at 88% 32%, #f4ecf6 0, transparent 43%), #fbf7ef;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
}
button:disabled {
  opacity: 0.4;
  cursor: default;
  transform: none !important;
}
button:focus-visible,
a:focus-visible,
canvas:focus-visible {
  outline: 3px solid #9782b4;
  outline-offset: 5px;
}
button {
  transition:
    filter 0.15s ease,
    box-shadow 0.15s ease;
}
@media (hover: hover) and (pointer: fine) {
  button:hover:not(:disabled) {
    filter: brightness(1.035);
  }
}
button:active {
  transform: translateY(1px);
}
svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}
.icon-library {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
[hidden] {
  display: none !important;
}
.app-shell {
  max-width: 1480px;
  padding: 0 70px;
  margin: auto;
}
.topbar {
  height: 112px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--plum);
  font-family: 'Fredoka', 'Noto Sans Thai', sans-serif;
  font-size: 25px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.6px;
}
.brand-mark {
  width: 40px;
  height: 45px;
  display: grid;
  place-items: center;
  background: #e4eddf;
  border-radius: 16px 16px 13px 13px;
  transform: rotate(-9deg);
}
.brand-mark svg {
  width: 27px;
  height: 27px;
  color: #d89671;
}
.brand-light {
  color: #a18eae;
}
.brand small {
  display: block;
  margin-top: 8px;
  font:
    8px 'DM Sans',
    sans-serif;
  letter-spacing: 2px;
  color: #a1939d;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 26px;
}
.made-for-joy {
  font-size: 12px;
  color: #a194a4;
  letter-spacing: 0.3px;
}
.made-for-joy span {
  margin-left: 8px;
  color: #b5a1c5;
  font-size: 22px;
  vertical-align: -2px;
}
.icon-button {
  border: 1px solid #e6ded6;
  border-radius: 50%;
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  background: #fffaf4;
}
.icon-button svg {
  width: 19px;
  height: 19px;
}
.landing {
  display: grid;
  grid-template-columns: 44% 56%;
  position: relative;
  padding-top: 42px;
}
.hero-copy {
  padding-top: 35px;
  position: relative;
  z-index: 2;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2.6px;
  font-weight: 700;
  color: #a18c9f;
  display: flex;
  align-items: center;
  gap: 9px;
}
.tiny-flower {
  color: #c5b7d5;
  font-size: 23px;
  line-height: 1;
}
h1 {
  margin: 21px 0 21px -5px;
  font:
    500 clamp(76px, 8.8vw, 128px)/0.88 'Fredoka',
    sans-serif;
  letter-spacing: -4px;
  color: #665177;
}
h1 > span {
  display: inline-block;
  position: relative;
  color: #e6a58d;
  padding-top: 7px;
}
.title-flower {
  position: absolute;
  width: 47px;
  height: 47px;
  right: -52px;
  top: 12px;
  color: #ddd0e8;
  transform: rotate(12deg);
}
.hero-tagline {
  font-family: 'Fredoka', sans-serif;
  font-size: 26px;
  line-height: 1.3;
  font-weight: 400;
  letter-spacing: -0.2px;
  margin: 23px 0 14px;
}
.hero-description {
  font-size: 13px;
  line-height: 1.95;
  color: #918394;
  margin: 0 0 26px;
}
.hero-actions {
  display: flex;
  gap: 11px;
  align-items: stretch;
  flex-wrap: wrap;
}
.button {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 11px;
  border-radius: 17px;
  padding: 14px 24px;
  font-size: 13px;
  font-weight: 700;
  min-height: 52px;
  border: 1px solid #dfcfc1;
  box-shadow: 0 4px 0 #e5d7cb;
}
.button svg {
  width: 19px;
  height: 19px;
}
.button.primary {
  background: linear-gradient(#ffd6bf, #ffc2a6);
  border-color: #edaf94;
  box-shadow:
    0 4px 0 #dfac95,
    0 7px 15px #cba48c15;
}

.button.secondary {
  background: #fffbf4;
}

.button.large {
  min-height: 56px;
}
.button-arrow {
  font-size: 22px;
  margin-left: 10px;
}
.hero-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 25px;
  color: #a0939e;
  font-size: 10px;
}
.hero-meta > span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.hero-meta svg {
  width: 14px;
  height: 14px;
}
.hero-meta i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #c5b6c0;
}
.best-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f5eddd;
  border-radius: 30px;
  margin-top: 18px;
  font-size: 10px;
  color: #9d8465;
}
.best-pill svg {
  width: 14px;
  height: 14px;
  color: #d9b970;
}
.hero-art {
  position: relative;
  min-width: 0;
  min-height: 580px;
  margin-top: 8px;
}
.hero-art::before {
  content: '';
  position: absolute;
  inset: 40px -8px 50px -32px;
  border-radius: 48% 52% 47% 53%;
  background: radial-gradient(
    ellipse at 43% 40%,
    #e8f2ee 5%,
    #e3eee9 40%,
    #ece9f1 72%,
    #f5f0f3 100%
  );
}
.hero-art canvas {
  display: block;
  width: 118%;
  height: 580px;
  margin-left: -11%;
  position: relative;
  z-index: 1;
}
.art-sun {
  width: 118px;
  height: 118px;
  background: radial-gradient(circle, #fff4d8, #fff3df80 65%, transparent 72%);
  border-radius: 50%;
  position: absolute;
  top: 13px;
  right: 65px;
}
.cloud {
  background: #ffffffa6;
  border-radius: 100%;
  position: absolute;
  width: 107px;
  height: 26px;
  filter: blur(1px);
}
.cloud::before,
.cloud::after {
  content: '';
  position: absolute;
  background: inherit;
  border-radius: 50%;
  width: 55px;
  height: 42px;
  bottom: 5px;
  left: 16px;
}
.cloud::after {
  width: 41px;
  height: 33px;
  left: 55px;
  bottom: 2px;
}
.cloud-one {
  top: 100px;
  left: 2%;
  animation: cloud-drift 12s ease-in-out infinite alternate;
}
.cloud-two {
  top: 65px;
  right: -10px;
  transform: scale(0.75);
  animation: cloud-drift 16s ease-in-out infinite alternate-reverse;
}
.floating-spark {
  position: absolute;
  color: #c4af91;
  z-index: 2;
  animation: sparkle 4s ease-in-out infinite;
}
.spark-one {
  left: 30px;
  top: 227px;
  font-size: 29px;
}
.spark-two {
  right: 20px;
  top: 190px;
  font-size: 19px;
  animation-delay: 1s;
}
.spark-three {
  right: 78px;
  bottom: 98px;
  font-size: 33px;
  animation-delay: 2s;
}
.art-note {
  position: absolute;
  bottom: 75px;
  left: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fffdf6eb;
  border: 1px solid #fff;
  padding: 12px 20px;
  border-radius: 15px;
  box-shadow: 0 8px 30px #71647b10;
  transform: rotate(-5deg);
  z-index: 2;
  font:
    12px/1.65 'Fredoka',
    sans-serif;
  color: #9c8c9e;
}
.art-note strong {
  color: #76617f;
  font-weight: 400;
}
.note-icon {
  font-size: 27px;
  color: #cfbb84;
}
.garden-label {
  position: absolute;
  right: 46px;
  bottom: 32px;
  font-size: 8px;
  letter-spacing: 2.3px;
  color: #a39aab;
  display: flex;
  align-items: center;
  gap: 9px;
}
.garden-label span {
  width: 5px;
  height: 5px;
  background: #a7c5b5;
  border-radius: 50%;
}
.feature-strip {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
  margin: 40px 0 38px;
  border: 1px solid #e8dfd6;
  background: #fffdf770;
  border-radius: 22px;
  padding: 25px 29px;
}
.feature-strip > div {
  display: flex;
  align-items: center;
  gap: 15px;
}
.feature-strip > div + div {
  border-left: 1px solid #eae1d9;
  padding-left: 28px;
}
.feature-icon {
  display: grid;
  place-items: center;
  width: 45px;
  height: 45px;
  border-radius: 15px;
  flex-shrink: 0;
}
.feature-icon svg {
  width: 23px;
  height: 23px;
}
.mint {
  background: #e2eee4;
  color: #89ab92;
}
.lavender {
  background: #eee7f4;
  color: #b5a2ca;
}
.peach {
  background: #fbe6da;
  color: #d6a18c;
}
.feature-strip p {
  margin: 0;
}
.feature-strip strong {
  display: block;
  font:
    400 16px 'Fredoka',
    sans-serif;
  margin-bottom: 6px;
}
.feature-strip p span {
  color: #a0939e;
  font-size: 10px;
}
.footer {
  border-top: 1px solid var(--line);
  min-height: 73px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #afa1ac;
  font-size: 9px;
}
.footer > span {
  display: flex;
  align-items: center;
  gap: 7px;
}
.footer svg {
  width: 13px;
  height: 13px;
  color: #c4b6cb;
}
.footer > span:nth-child(2) {
  font-size: 8px;
  letter-spacing: 2px;
}
.footer i {
  font-style: normal;
}

/* The garden */
.game {
  max-width: 1100px;
  margin: 27px auto 24px;
}
.game-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.game-topline .eyebrow {
  font-size: 8px;
  letter-spacing: 2px;
}
.game-topline h2 {
  font-size: 20px;
  font-weight: 600;
  margin: 6px 0 0;
}
.game-topline h2 span {
  color: #c4b3d0;
  margin-left: 5px;
}
.text-button {
  border: none;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px;
  background: none;
  font-size: 11px;
  color: #99869f;
}
.text-button svg {
  width: 17px;
  height: 17px;
}
.play-area {
  position: relative;
  height: min(680px, 74vw);
  min-height: 540px;
  overflow: hidden;
  border-radius: 32px;
  border: 6px solid #fffaf2;
  outline: 1px solid #e7ded6;
  background: radial-gradient(ellipse at 50% 35%, #eaf4ed 0%, #e1efeb 42%, #e7e5ee 80%, #ece6ee);
  box-shadow: 0 12px 35px #8d799512;
}
.game-hud {
  position: absolute;
  top: 22px;
  left: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 3;
  pointer-events: none;
}
.hud-card {
  display: flex;
  align-items: center;
  background: #fffcf2ed;
  border: 1px solid #fffcf7;
  border-radius: 19px;
  padding: 10px 18px 10px 12px;
  box-shadow:
    0 4px 0 #d3d3c567,
    0 5px 12px #8d849110;
  gap: 11px;
}
.hud-icon {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  background: #f1eafa;
  border-radius: 13px;
  color: #9d85b8;
}
.hud-icon svg {
  width: 24px;
  height: 24px;
}
.score-card .hud-icon {
  background: #fff0d8;
  color: #e9aa75;
}
.hud-label {
  display: block;
  font-size: 7px;
  letter-spacing: 1.5px;
  font-weight: 700;
  color: #a693a3;
  margin-bottom: 1px;
}
.hud-card strong {
  font:
    500 30px/1.1 'Fredoka',
    sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}
.timer-card {
  min-width: 154px;
}
.score-card {
  min-width: 205px;
}
.harvest-pill {
  background: #e8eee1;
  border-radius: 20px;
  color: #8a9c7b;
  font-size: 10px;
  padding: 5px 8px;
  margin-left: 12px;
  align-self: center;
  white-space: nowrap;
}
.pause-button {
  pointer-events: auto;
  margin-left: auto;
  width: 57px;
  height: 57px;
  display: grid;
  place-items: center;
  background: linear-gradient(#e5dcf5, #c8b9e1);
  border: 2px solid #f7f2ff;
  border-radius: 50%;
  box-shadow:
    0 4px 0 #b7accd6e,
    0 4px 12px #8a789f20;
  color: #fffaf8;
}
.pause-button svg {
  width: 24px;
  height: 24px;
}
#game-canvas {
  position: absolute;
  width: 100%;
  height: 100%;
  inset: 0;
  outline-offset: -5px;
  touch-action: none;
}
.game-sky {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.game-cloud-one {
  top: 175px;
  left: 4%;
  opacity: 0.7;
  transform: scale(1.35);
}
.game-cloud-two {
  right: 2%;
  top: 180px;
  opacity: 0.7;
  transform: scale(0.9);
}
.scene-star {
  position: absolute;
  color: #af9aba;
  opacity: 0.6;
  font-size: 30px;
}
.s1 {
  top: 44%;
  left: 8%;
}
.s2 {
  top: 30%;
  right: 10%;
  font-size: 19px;
}
.s3 {
  bottom: 24%;
  right: 9%;
  font-size: 16px;
  color: #c6b38e;
}
.round-badge {
  position: absolute;
  top: 111px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid #fffff375;
  border-radius: 22px;
  background: #fffdf368;
  padding: 7px 13px;
  font-size: 9px;
  color: #899786;
  white-space: nowrap;
  z-index: 1;
}
.live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #a0bf93;
  margin-right: 3px;
}
.round-dot {
  margin: 0 3px;
}
.board-message {
  position: absolute;
  bottom: 133px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 15px;
  border-radius: 30px;
  font-size: 11px;
  color: #8c8097;
  background: #fffaf09c;
  text-align: center;
  max-width: calc(100% - 30px);
  white-space: nowrap;
  pointer-events: none;
  transition: background 0.2s;
}
.board-message.warning {
  color: #af7e65;
  background: #fff2dce8;
}
.game-bottom {
  position: absolute;
  bottom: 20px;
  left: 24px;
  right: 24px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  pointer-events: none;
}
.utility-buttons {
  display: flex;
  gap: 8px;
  pointer-events: auto;
}
.small-button {
  border: 1px solid #e1d9cf;
  background: #fffcf2ed;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 13px;
  font-size: 10px;
  box-shadow: 0 3px 0 #cfc6c24d;
}
.small-button svg {
  width: 16px;
  height: 16px;
  color: #a18bad;
}
kbd {
  font-family: inherit;
  font-size: 9px;
  min-width: 17px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  padding: 0 4px;
  background: #f3eee8;
  border: 1px solid #e7ded6;
  border-bottom-width: 2px;
  border-radius: 4px;
  color: #aa9aaf;
}

.game-footnote {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 8px 0;
  font-size: 10px;
  color: #a294a3;
  gap: 10px;
}
.game-footnote > span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.key-group {
  display: flex;
  gap: 2px;
}
.footnote-dot {
  margin: 0 6px;
}
.best-inline {
  font:
    10px 'DM Sans',
    sans-serif;
  letter-spacing: 1px;
}
.best-inline svg {
  width: 13px;
  height: 13px;
  color: #d6bb80;
}
.best-inline b {
  margin-left: 4px;
}
.harvest-pop {
  position: absolute;
  left: 50%;
  top: 33%;
  transform: translate(-50%, 0);
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  color: #b68e4b;
  text-shadow: 0 2px 0 #fff7e7;
  z-index: 4;
}
.harvest-pop svg {
  width: 41px;
  height: 41px;
  color: #e9a35c;
}
.harvest-pop strong {
  font:
    500 44px 'Fredoka',
    sans-serif;
}
.harvest-pop span {
  font-size: 13px;
  color: #9c7eaa;
}
.harvest-pop.show {
  animation: score-pop 0.95s ease-out both;
}
.timer-card.urgent {
  background: #fff1e4;
  animation: timer-pulse 1s ease-in-out infinite;
}
.timer-card.urgent strong {
  color: #c48377;
}

/* Soft, paper-like dialogs */
.modal {
  border: 1px solid #e6d8d1;
  border-radius: 29px;
  background: #fffbf2;
  color: var(--plum);
  padding: 40px;
  box-shadow:
    0 0 0 7px #f5e8ecb3,
    0 25px 100px #6b587540;
  max-width: calc(100vw - 34px);
  animation: modal-in 0.25s ease-out;
  text-align: center;
}
.modal::backdrop {
  background: #6e617547;
  backdrop-filter: blur(7px);
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 15px;
  width: 32px;
  height: 32px;
  border-color: #eee5da;
  background: #faf4ea;
}
.modal-close svg {
  width: 15px;
  height: 15px;
}
.modal-kicker {
  font:
    600 8px 'DM Sans',
    sans-serif;
  letter-spacing: 2.2px;
  color: #b09aac;
  margin-bottom: 12px;
}
.modal h2 {
  font-size: 25px;
  margin: 0 0 8px;
  font-weight: 600;
  letter-spacing: -0.7px;
}
.modal h2 span {
  color: #c6b2d3;
}
.modal-description {
  font-size: 11px;
  color: #a08f9e;
  line-height: 1.9;
  margin: 6px 0 22px;
}
.how-modal {
  width: 810px;
}
.how-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 26px 0 22px;
  gap: 18px;
}
.how-steps article {
  position: relative;
  min-width: 0;
}
.how-steps article + article {
  border-left: 1px solid #eee4da;
  padding-left: 18px;
}
.step-number {
  position: absolute;
  left: 7px;
  top: 0;
  color: #b6a1c9;
  background: #eee6f4;
  border-radius: 50%;
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  font:
    500 10px 'Fredoka',
    sans-serif;
}
.how-steps canvas {
  width: 100%;
  height: auto;
  max-width: 220px;
}
.how-steps h3 {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 8px;
}
.how-steps p {
  color: #a08f9c;
  font-size: 10px;
  line-height: 1.9;
  margin: 0;
}
.how-tip {
  text-align: left;
  background: #f6efe5;
  border: 1px solid #eee4d6;
  padding: 13px 17px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 10px;
  line-height: 1.9;
  color: #93828c;
  margin-bottom: 24px;
}
.how-tip > svg {
  width: 19px;
  height: 19px;
  color: #bfa77b;
}
.how-tip small {
  font-size: 9px;
  color: #ad9c9e;
}
.how-modal > .button {
  margin: auto;
  min-width: 270px;
}
.compact-modal {
  width: 400px;
  padding: 31px 34px 26px;
}
.compact-modal h2 {
  font-size: 23px;
}
.compact-modal .button {
  width: 100%;
  margin-top: 12px;
}
.compact-modal .modal-kicker {
  font-size: 7px;
  letter-spacing: 1.7px;
}
.modal-subnote {
  display: block;
  font-size: 9px;
  color: #b0a1ac;
  margin-top: 23px;
}
.modal-illustration {
  height: 150px;
  margin: -18px 0 4px;
}
.modal-illustration canvas {
  width: 220px;
  height: 157px;
}
.big-flower {
  color: #cdb9da;
  font-size: 70px;
  margin-bottom: 14px;
}
.result-flowers {
  font-size: 39px;
  color: #d3bfe0;
  margin-bottom: 20px;
}
.result-flowers span {
  font-size: 52px;
  color: #e2c47b;
  margin: 0 10px;
}
.result-score {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #f8efd9;
  padding: 15px;
  border-radius: 20px;
  margin: 22px 0 17px;
}
.result-score svg {
  width: 34px;
  height: 34px;
  color: #dfa06f;
}
.result-score strong {
  font:
    500 52px 'Fredoka',
    sans-serif;
}
.result-score > span {
  align-self: end;
  margin-bottom: 10px;
  font-size: 10px;
  color: #b19a87;
}
.result-detail {
  display: flex;
  gap: 20px;
  justify-content: center;
  font-size: 10px;
  color: #a18c9b;
  margin-bottom: 20px;
}
.result-detail strong {
  display: block;
  margin-top: 4px;
  font-size: 15px;
  color: #7e6b8b;
}
.new-best {
  font-size: 11px;
  color: #bc9861;
  margin-bottom: 18px;
}

@keyframes cloud-drift {
  from {
    translate: -7px 0;
  }
  to {
    translate: 10px 0;
  }
}
@keyframes sparkle {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.85);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.1);
  }
}
@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(13px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes score-pop {
  0% {
    opacity: 0;
    translate: 0 20px;
    scale: 0.7;
  }
  20% {
    opacity: 1;
    scale: 1.07;
  }
  65% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    translate: 0 -55px;
    scale: 1;
  }
}
@keyframes hint-pulse {
  to {
    background: #e3d4f4;
    box-shadow: 0 0 0 6px #c9b6dd55;
  }
}
@keyframes timer-pulse {
  50% {
    box-shadow: 0 0 0 4px #e6b59a55;
  }
}

@media (min-width: 1500px) {
  .landing {
    padding-top: 58px;
  }
  .hero-copy {
    padding-top: 45px;
  }
  .hero-art,
  .hero-art canvas {
    min-height: 640px;
    height: 640px;
  }
  .feature-strip {
    margin-top: 35px;
    margin-bottom: 42px;
  }
}
@media (max-width: 1100px) {
  .app-shell {
    padding: 0 38px;
  }
  .topbar {
    height: 92px;
  }
  .landing {
    padding-top: 27px;
  }
  .hero-copy {
    padding-top: 32px;
  }
  h1 {
    font-size: 101px;
  }
  .hero-tagline {
    font-size: 23px;
  }
  .hero-description {
    font-size: 11px;
  }
  .button.large {
    font-size: 11px;
    padding: 13px 17px;
  }
  .hero-art,
  .hero-art canvas {
    min-height: 545px;
    height: 545px;
  }
  .hero-art::before {
    inset: 50px -10px 55px -25px;
  }
  .art-note {
    bottom: 60px;
    left: -6px;
    padding: 10px 14px;
    font-size: 10px;
  }
  .feature-strip {
    margin-top: 25px;
    padding: 22px;
    gap: 16px;
  }
  .feature-strip > div {
    gap: 10px;
  }
  .feature-strip > div + div {
    padding-left: 18px;
  }
  .feature-strip strong {
    font-size: 14px;
  }
  .feature-strip p span {
    font-size: 8px;
  }
  .feature-icon {
    width: 37px;
    height: 37px;
    border-radius: 13px;
  }
  .feature-icon svg {
    width: 19px;
    height: 19px;
  }
  .hero-meta {
    font-size: 8px;
    gap: 8px;
  }
  .play-area {
    min-height: 590px;
  }
  .game-footnote {
    font-size: 8px;
  }
}
@media (max-width: 760px) {
  .app-shell {
    padding: 0 23px;
  }
  .topbar {
    height: 80px;
  }
  .brand {
    font-size: 22px;
  }
  .brand-mark {
    width: 35px;
    height: 39px;
  }
  .brand small {
    font-size: 6px;
    letter-spacing: 1.7px;
  }
  .made-for-joy {
    display: none;
  }
  .sound-button {
    width: 37px;
    height: 37px;
  }
  .landing {
    grid-template-columns: 1fr;
    padding-top: 25px;
  }
  .hero-copy {
    text-align: center;
    padding-top: 8px;
  }
  .hero-copy .eyebrow {
    justify-content: center;
    font-size: 8px;
    letter-spacing: 2px;
  }
  h1 {
    font-size: clamp(76px, 25vw, 100px);
    line-height: 0.9;
    margin: 20px 0 15px;
  }
  .title-flower {
    width: 35px;
    height: 35px;
    right: -40px;
  }
  .hero-tagline {
    font-size: 22px;
    margin: 15px 0 12px;
  }
  .hero-tagline br {
    display: none;
  }
  .hero-description {
    font-size: 11px;
    margin-bottom: 22px;
  }
  .hero-actions {
    justify-content: center;
    gap: 10px;
  }
  .button.large {
    min-height: 54px;
    font-size: 12px;
  }
  .hero-meta {
    justify-content: center;
    font-size: 9px;
  }
  .hero-art {
    grid-row: 2;
    margin-top: -2px;
    min-height: 415px;
    height: 415px;
  }
  .hero-art canvas {
    height: 430px;
    min-height: 430px;
    width: 110%;
    margin-left: -5%;
  }
  .hero-art::before {
    inset: 27px 8px 17px;
  }
  .cloud-one {
    left: 2%;
    top: 83px;
    scale: 0.7;
  }
  .cloud-two {
    top: 65px;
    right: -6px;
    scale: 0.65;
  }
  .art-sun {
    right: 25px;
    top: 5px;
    width: 90px;
    height: 90px;
  }
  .art-note {
    bottom: 29px;
    left: 8px;
    font-size: 9px;
  }
  .garden-label {
    right: 14px;
    bottom: 11px;
    font-size: 6px;
    letter-spacing: 1.3px;
  }
  .spark-one {
    left: 4px;
    top: 165px;
    font-size: 25px;
  }
  .spark-two {
    top: 130px;
    right: 5px;
  }
  .spark-three {
    bottom: 65px;
    right: 13px;
    font-size: 25px;
  }
  .feature-strip {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 22px 24px;
    margin: 20px 0 28px;
  }
  .feature-strip > div + div {
    border-left: 0;
    border-top: 1px solid #ece3da;
    padding: 18px 0 0;
  }
  .feature-strip > div {
    gap: 17px;
  }
  .feature-strip strong {
    font-size: 16px;
    margin-bottom: 4px;
  }
  .feature-strip p span {
    font-size: 10px;
  }
  .feature-icon {
    width: 42px;
    height: 42px;
  }
  .footer {
    gap: 10px;
    flex-wrap: wrap;
    min-height: 74px;
    padding: 17px 0;
    font-size: 8px;
  }
  .footer > span:last-child {
    display: none;
  }
  .footer > span:nth-child(2) {
    font-size: 6px;
    letter-spacing: 1.5px;
  }
  .game {
    margin-top: 22px;
  }
  .game-topline {
    margin-bottom: 15px;
  }
  .game-topline .eyebrow {
    font-size: 6px;
    letter-spacing: 1.5px;
  }
  .game-topline h2 {
    font-size: 17px;
  }
  .text-button {
    font-size: 9px;
  }
  .play-area {
    margin: 0 -12px;
    height: calc(100svh - 235px);
    min-height: 570px;
    max-height: 750px;
    border-width: 4px;
    border-radius: 26px;
  }
  .game-hud {
    top: 15px;
    left: 12px;
    right: 12px;
    gap: 8px;
  }
  .hud-card {
    border-radius: 15px;
    padding: 9px 10px 9px 8px;
    gap: 7px;
  }
  .hud-icon {
    width: 29px;
    height: 32px;
    border-radius: 10px;
  }
  .hud-icon svg {
    width: 20px;
    height: 20px;
  }
  .hud-label {
    font-size: 6px;
    letter-spacing: 0.7px;
  }
  .hud-card strong {
    font-size: 26px;
  }
  .timer-card {
    min-width: 113px;
  }
  .score-card {
    min-width: 120px;
  }
  .harvest-pill {
    display: none;
  }
  .pause-button {
    width: 43px;
    height: 43px;
  }
  .pause-button svg {
    width: 20px;
    height: 20px;
  }
  .round-badge {
    top: 92px;
    font-size: 8px;
    padding: 6px 11px;
  }
  .game-bottom {
    left: 14px;
    right: 14px;
    bottom: 22px;
  }
  .utility-buttons {
    flex-direction: column;
    gap: 9px;
  }
  .small-button {
    padding: 9px 11px;
    font-size: 9px;
  }
  .small-button kbd {
    display: none;
  }

  .board-message {
    bottom: 150px;
    font-size: 9px;
    white-space: normal;
    width: max-content;
    max-width: calc(100% - 24px);
  }
  .game-footnote {
    padding: 13px 0 0;
    font-size: 8px;
    justify-content: center;
  }
  .game-footnote > span:first-child {
    display: none;
  }
  .game-cloud-one {
    left: -60px;
  }
  .game-cloud-two {
    right: -55px;
  }
  .scene-star.s1 {
    left: 2%;
  }
  .scene-star.s2 {
    right: 3%;
  }
  .harvest-pop {
    top: 36%;
  }
  .how-modal {
    padding: 35px 20px 25px;
    width: 410px;
  }
  .modal h2 {
    font-size: 22px;
  }
  .modal-kicker {
    font-size: 6px;
    letter-spacing: 1.4px;
  }
  .modal-description {
    font-size: 10px;
  }
  .how-steps {
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 19px 0;
  }
  .how-steps article {
    display: grid;
    grid-template-columns: 97px 1fr;
    text-align: left;
    align-items: center;
    column-gap: 12px;
  }
  .how-steps article + article {
    border-left: none;
    border-top: 1px solid #eee4da;
    padding: 12px 0 0;
  }
  .how-steps canvas {
    width: 97px;
    grid-area: 1 / 1 / 3 / 2;
  }
  .step-number {
    display: none;
  }
  .how-steps h3 {
    font-size: 12px;
    align-self: end;
    margin-bottom: 5px;
  }
  .how-steps p {
    font-size: 9px;
    align-self: start;
    line-height: 1.8;
  }
  .how-tip {
    padding: 10px 12px;
    font-size: 9px;
    gap: 8px;
  }
  .how-tip small {
    font-size: 8px;
  }
  .how-modal > .button {
    min-width: 0;
    width: 100%;
    font-size: 11px;
  }
  .compact-modal {
    padding: 27px 25px;
  }
  .result-detail {
    font-size: 9px;
  }
}
@media (max-width: 370px) {
  .app-shell {
    padding: 0 17px;
  }
  .hero-actions .button {
    padding: 13px 15px;
    font-size: 11px;
  }
  .hero-meta {
    font-size: 8px;
  }
  .hud-icon {
    display: none;
  }
  .timer-card {
    min-width: 87px;
  }
  .score-card {
    min-width: 103px;
  }
  .play-area {
    margin: 0 -8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .cloud {
    animation: none;
  }
}

/* AI clay art is shared by the world and interface. Text stays native and sharp. */
.ai-icon {
  display: inline-block;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  vertical-align: middle;
}
.ai-carrot {
  background-image: url('/assets/optimized/ui-carrot-badge.webp');
}
.ai-flower {
  background-image: url('/assets/optimized/ui-flower.webp');
}
.brand-mark .ai-icon {
  width: 39px;
  height: 39px;
}
.title-flower.ai-icon {
  width: 50px;
  height: 50px;
}
.hud-icon .ai-icon {
  width: 42px;
  height: 42px;
}
.harvest-pop .ai-icon {
  width: 57px;
  height: 57px;
}
.result-score .ai-icon {
  width: 60px;
  height: 60px;
}
.footer .ai-icon {
  width: 17px;
  height: 17px;
}
.loading-spinner {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 2px solid #d3ad9a;
  border-top-color: transparent;
  animation: loading-spin 0.7s linear infinite;
}
.art-loading::after {
  content: 'กำลังเตรียมสวนแสนอบอุ่น…';
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  color: #a08cac;
  font-size: 12px;
  white-space: nowrap;
}
@keyframes loading-spin {
  to {
    rotate: 360deg;
  }
}

.board-message {
  bottom: 20px;
  max-width: calc(100% - 30px);
}
.game-hud {
  z-index: 4;
}
#game-canvas {
  touch-action: none;
  user-select: none;
}
.play-area {
  isolation: isolate;
}
.hero-art::before {
  background: radial-gradient(ellipse at 43% 40%, #edf4e9 5%, #e4efe7 40%, #ece8f2 78%);
}
@media (max-width: 760px) {
  body.is-playing {
    overscroll-behavior: none;
  }
  .is-playing .app-shell {
    padding: 0 13px;
  }
  .is-playing .topbar {
    height: 66px;
    padding: 0 5px;
  }
  .is-playing .game {
    margin: 10px 0 8px;
  }
  .is-playing .game-topline,
  .is-playing .game-footnote,
  .is-playing .footer {
    display: none;
  }
  .is-playing .play-area {
    height: calc(100svh - 86px);
    min-height: 500px;
    max-height: none;
    margin: 0;
    border-radius: 25px;
  }

  .game-bottom {
    bottom: max(18px, env(safe-area-inset-bottom));
    left: 13px;
    right: 13px;
    align-items: end;
  }
  .utility-buttons {
    gap: 13px;
    padding-bottom: 7px;
  }
  .small-button {
    min-height: 48px;
    min-width: 83px;
    justify-content: center;
    border-radius: 16px;
    font-size: 10px;
    padding: 11px;
  }
  .small-button svg {
    width: 19px;
    height: 19px;
  }
  .board-message {
    bottom: 218px;
    font-size: 10px;
    padding: 8px 12px;
    width: max-content;
  }
  .game-cloud-one {
    opacity: 0.4;
  }
  .game-cloud-two {
    opacity: 0.45;
  }
  .hud-icon .ai-icon {
    width: 37px;
    height: 37px;
  }
  .how-steps canvas {
    width: 103px;
  }
  .round-badge {
    top: 94px;
    font-size: 9px;
  }
}
@media (max-width: 760px) and (max-height: 740px) {
  .board-message {
    bottom: 185px;
    font-size: 9px;
  }
  .game-bottom {
    bottom: 15px;
  }
}
@media (max-width: 340px) {
  .small-button {
    min-width: 72px;
    padding: 9px;
    font-size: 9px;
  }
}

/* Reference edition: full-screen illustrated garden, marshmallow UI and diamond tiles. */
body {
  background: #fff8ed;
}
.app-shell {
  max-width: 600px;
  padding: 10px;
  position: relative;
}
.topbar {
  position: absolute;
  right: 26px;
  top: 27px;
  width: 42px;
  height: 42px;
  border: 0;
  z-index: 8;
}
.brand,
.made-for-joy,
.feature-strip,
.footer {
  display: none;
}
.topbar-right {
  gap: 0;
}
.sound-button {
  width: 36px;
  height: 36px;
  background: #fff9eec9;
  border: 2px solid #fffdf3;
  color: #8f7aab;
}
.landing {
  display: block;
  padding: 0;
  height: calc(100svh - 20px);
  min-height: 620px;
  max-height: 1040px;
  border: 6px solid #ebd5df;
  border-radius: 29px;
  overflow: hidden;
  background: #bce1f8 url('/assets/optimized/landing-scene.webp') center center / cover;
  box-shadow:
    inset 0 0 0 2px #fff6f0,
    0 5px 0 #d9bfcf55;
}
.hero-copy {
  padding: 0;
  height: 100%;
  text-align: center;
}
.hero-copy .eyebrow,
.hero-tagline,
.hero-description,
.hero-meta,
.best-pill,
.hero-art {
  display: none !important;
}
.hero-copy h1 {
  position: absolute;
  top: 51px;
  left: 0;
  right: 0;
  margin: 0;
  font:
    700 clamp(68px, 19vw, 104px)/0.96 'Fredoka',
    sans-serif;
  text-transform: uppercase;
  letter-spacing: -1.5px;
  color: #5b4272;
  -webkit-text-stroke: 13px #fff9e8;
  paint-order: stroke fill;
  text-shadow:
    0 6px 0 #e7d9d1,
    0 10px 16px #81609020;
  transform: rotate(-3deg);
}
.hero-copy h1 > span {
  color: #ffb79f;
  padding-top: 9px;
}
.hero-copy .title-flower {
  display: none;
}
.hero-actions {
  position: absolute;
  bottom: 34px;
  left: 27px;
  right: 27px;
  flex-direction: column;
  gap: 17px;
}
.button,
.button.large {
  min-height: 62px;
  border-radius: 23px;
  font-family: 'Fredoka', 'Noto Sans Thai', sans-serif;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.5px;
  border: 2px solid #e9cdb8;
  background: linear-gradient(#fffaf0, #fff3df);
  box-shadow:
    inset 0 2px 2px #fffefa,
    0 5px 0 #c8a895,
    0 8px 14px #8c665724;
  padding: 12px 22px;
}
.button svg {
  width: 26px;
  height: 26px;
}
.button.primary {
  background: linear-gradient(#ffd2b6, #ffb99e);
  border-color: #eaa68d;
  box-shadow:
    inset 0 2px 2px #ffe4cc,
    0 5px 0 #cc9585,
    0 8px 15px #94716033;
}
.button.secondary {
  background: linear-gradient(#fffbee, #fff2dd);
}
.hero-actions .primary {
  min-height: 72px;
}
.hero-actions .secondary {
  font-size: 21px;
}
.game,
.is-playing .game {
  margin: 0;
}
.is-playing .topbar,
.game-topline,
.game-footnote {
  display: none;
}
.play-area,
.is-playing .play-area {
  height: calc(100svh - 20px);
  min-height: 620px;
  max-height: 1040px;
  margin: 0;
  border: 6px solid #e7d0de;
  outline: 0;
  border-radius: 29px;
  background: #bee2fa url('/assets/optimized/game-scene.webp') center / cover;
  box-shadow:
    inset 0 0 0 2px #fff4f0,
    0 5px 0 #cdb8d055;
}
.game-sky {
  display: none;
}
.game-hud {
  top: 16px;
  left: 13px;
  right: 13px;
  gap: 9px;
}
.hud-card {
  padding: 11px 11px;
  border-radius: 23px;
  min-width: 0;
  border: 1px solid #fff0d5;
  background: linear-gradient(#fffbea, #fff1d8);
  box-shadow:
    inset 0 2px 1px #ffffffb3,
    0 4px 0 #c9ac984d,
    0 6px 12px #9b879729;
  gap: 7px;
}
.timer-card {
  flex: 0 0 34%;
}
.score-card {
  flex: 1;
}
.hud-icon {
  background: none;
  width: 25px;
  height: 32px;
  color: #57416d;
  border-radius: 0;
}
.hud-icon svg {
  width: 27px;
  height: 27px;
}
.hud-icon .ai-icon {
  width: 29px;
  height: 29px;
}
.hud-card strong {
  font-family: 'Fredoka', sans-serif;
  font-size: clamp(23px, 6.4vw, 34px);
  font-weight: 600;
  color: #412454;
  letter-spacing: 0.3px;
}
.timer-card .hud-label {
  display: none;
}
.hud-label {
  font:
    600 8px 'Fredoka',
    sans-serif;
  letter-spacing: 1px;
  color: #775480;
}
.harvest-pill {
  display: none;
}
.pause-button {
  width: 47px;
  height: 47px;
  flex: 0 0 47px;
  background: linear-gradient(#e0d4f5, #b5a0d8);
  border: 2px solid #f4eaff;
  box-shadow:
    inset 0 2px 1px #eee5ff,
    0 4px 0 #ad96bf77;
}
.round-badge {
  top: 98px;
  color: #68567e;
  background: #fff8e4ab;
  border-color: #fff4d3;
  padding: 6px 12px;
  font-size: 9px;
  max-width: calc(100% - 20px);
}
.game-bottom {
  display: block;
  bottom: 19px;
  left: 16px;
  right: 16px;
}

.utility-buttons {
  position: absolute;
  inset: 0;
  display: block;
  pointer-events: none;
}
.utility-buttons button {
  position: absolute;
  bottom: 14px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  pointer-events: auto;
  border-radius: 50%;
  justify-content: center;
  background: #fff5e2e8;
  border: 1px solid #e4cdb6;
  box-shadow: 0 3px 0 #c8aeb17a;
}
#undo {
  left: 0;
}
#hint {
  right: 0;
}
.utility-buttons button span,
.utility-buttons button kbd {
  display: none;
}
.small-button svg {
  width: 20px;
  height: 20px;
  color: #795d91;
}
.board-message {
  bottom: 202px;
  background: #fff5e1d4;
  color: #6f567d;
  font-size: 10px;
  white-space: normal;
  max-width: calc(100% - 26px);
  padding: 7px 12px;
}
.board-message.warning {
  background: #fff0d9eb;
}
.harvest-pop {
  top: 39%;
  color: #a96a30;
}
.ai-carrot {
  background-image: url('/assets/optimized/ui-star.webp');
}
.modal {
  border: 5px solid #ead6de;
  border-radius: 27px;
  box-shadow:
    inset 0 0 0 2px #fff9e8,
    0 0 0 2px #f7e6df,
    0 25px 60px #66527f42;
  background: #fff8e8;
}
.modal::backdrop {
  background: #72719b4a;
  backdrop-filter: blur(5px);
}
.modal-kicker {
  display: none;
}
.modal h2 {
  font:
    600 31px 'Fredoka',
    'Noto Sans Thai',
    sans-serif;
  color: #4e315f;
  letter-spacing: 0.2px;
}
.modal-description {
  font-size: 11px;
  color: #8d7398;
}
.how-modal {
  padding-top: 40px;
}
.how-steps h3 {
  color: #583763;
  font-size: 13px;
}
.how-steps p {
  color: #8b7192;
}
.compact-modal {
  padding: 38px 27px 32px;
  background: #fdf3df url('/assets/optimized/game-scene.webp') center bottom / cover;
}
#pause-dialog .modal-illustration {
  display: none;
}
#pause-dialog h2 {
  font-size: 42px;
  margin: 2px 0 10px;
}
#pause-dialog .modal-description {
  padding-bottom: 18px;
  color: #725482;
}
.compact-modal .button {
  font-size: 22px;
  min-height: 59px;
  margin-top: 17px;
}
.modal-subnote {
  color: #846891;
  background: #fff8e3a6;
  border-radius: 15px;
  padding: 6px;
  margin-top: 20px;
}
#home-dialog h2,
#result-dialog h2 {
  font-size: 25px;
}
#home-dialog .button,
#result-dialog .button {
  font-size: 17px;
  letter-spacing: 0;
}
@media (max-width: 760px) {
  .app-shell,
  .is-playing .app-shell {
    padding: 8px;
  }
  .landing,
  .play-area,
  .is-playing .play-area {
    height: calc(100svh - 16px);
    min-height: 570px;
    border-width: 5px;
  }
  .topbar {
    right: 23px;
    top: 24px;
  }
  .hero-copy h1 {
    top: 52px;
    font-size: clamp(66px, 19.5vw, 92px);
    -webkit-text-stroke-width: 11px;
  }
  .hero-actions {
    left: 24px;
    right: 24px;
    bottom: 31px;
  }
  .game-hud {
    left: 10px;
    right: 10px;
    top: 15px;
    gap: 7px;
  }
  .hud-card {
    padding: 10px 8px;
    gap: 5px;
  }
  .timer-card {
    flex-basis: 34%;
  }
  .hud-icon {
    display: flex;
    align-items: center;
    width: 22px;
  }
  .hud-icon svg {
    width: 23px;
    height: 23px;
  }
  .hud-icon .ai-icon {
    width: 27px;
    height: 27px;
  }
  .hud-card strong {
    font-size: 25px;
  }
  .pause-button {
    flex-basis: 43px;
    width: 43px;
    height: 43px;
  }

  .game-bottom {
    bottom: 18px;
    left: 14px;
    right: 14px;
  }
  .board-message {
    bottom: 199px;
    font-size: 9px;
  }
  .round-badge {
    top: 94px;
    font-size: 8px;
  }
  .modal h2 {
    font-size: 29px;
  }
  .how-modal {
    padding: 35px 20px 25px;
  }
  .how-modal > .button {
    font-size: 17px;
  }
}
@media (max-width: 350px) {
  .hero-copy h1 {
    font-size: 65px;
    top: 52px;
  }
  .hero-actions {
    left: 18px;
    right: 18px;
  }
  .hero-actions .secondary {
    font-size: 19px;
  }
  .hud-icon {
    display: none;
  }
  .hud-card strong {
    font-size: 26px;
  }
  .timer-card {
    flex-basis: 32%;
  }

  .board-message {
    bottom: 187px;
  }
}
.score-card > div {
  display: flex;
  align-items: center;
  gap: 5px;
}
.score-card .hud-label {
  font:
    600 10px 'Fredoka',
    sans-serif;
  letter-spacing: 0;
  margin: 0;
}
.ai-carrot {
  background-size: 185%;
}
.hero-copy h1 {
  left: 10px;
  right: 10px;
  top: 40px;
  height: 220px;
  font-size: 0;
  -webkit-text-stroke: 0;
  text-shadow: none;
  background: url('/assets/optimized/logo.webp') center / contain no-repeat;
  transform: rotate(-3deg);
}
.hero-copy h1 > span {
  font-size: 0;
  color: transparent;
  padding: 0;
}

@media (max-width: 350px) {
  .hero-copy h1 {
    top: 34px;
    height: 200px;
    font-size: 0;
  }
}

/* Swipe-only touch controls; hover preserves the same opaque button material. */
.game-bottom {
  height: 62px;
  bottom: 16px;
}
.utility-buttons button {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  bottom: 4px;
}
.swipe-guide {
  display: flex;
  width: max-content;
  max-width: calc(100% - 112px);
  margin: 0 auto;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 8px 13px;
  color: #68527e;
  border-radius: 20px;
  background: #fff7e5d9;
  border: 1px solid #fff7eccc;
  font-size: 11px;
  line-height: 1.4;
  pointer-events: none;
}
.swipe-guide small {
  font-size: 9px;
  color: #9b83a8;
}
.swipe-finger {
  font-size: 28px;
  color: #b59ac9;
}
.board-message {
  bottom: 92px;
}
.button {
  user-select: none;
  -webkit-user-select: none;
}
.button.secondary:hover {
  background: linear-gradient(#fffbee, #fff2dd);
}
.button.primary:hover {
  background: linear-gradient(#ffd2b6, #ffb99e);
}
@media (max-width: 350px) {
  .swipe-guide {
    font-size: 10px;
    padding: 8px;
    gap: 5px;
  }
  .swipe-finger {
    font-size: 23px;
  }
  .board-message {
    bottom: 88px;
  }
}
@media (min-width: 761px) {
  .app-shell {
    max-width: min(600px, calc((100svh - 20px) * 0.6));
  }
}

/* A soft breeze obscures the board before the next garden is generated. */
.wind-transition {
  position: absolute;
  inset: 0;
  z-index: 12;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
  opacity: var(--wind-opacity, 0);
}
.wind-transition[hidden] {
  display: none;
}
.wind-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #f8f4df80, #e4ecd9a6 50%, #f7ecde91);
  backdrop-filter: blur(13px) saturate(0.78);
  -webkit-backdrop-filter: blur(13px) saturate(0.78);
}
.wind-leaf {
  position: absolute;
  width: 37px;
  height: 23px;
  filter: drop-shadow(2px 5px 4px #4c674c20);
  will-change: transform;
}
.wind-leaf i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 4% 90% 8% 90%;
  background: linear-gradient(145deg, #d8e7b0, #8bb183);
  border: 1px solid #a3bc8b66;
}
.wind-leaf i::after {
  content: '';
  position: absolute;
  width: 90%;
  height: 1px;
  background: #f6f7d699;
  top: 50%;
  left: 6%;
  transform: rotate(25deg);
}
.wind-leaf:nth-of-type(3n) i {
  background: linear-gradient(145deg, #f2dfaf, #d9b986);
}
.wind-leaf:nth-of-type(4n) i {
  background: linear-gradient(145deg, #c9ded2, #87b4a2);
}
.wind-ribbon {
  position: absolute;
  width: 150%;
  height: 22%;
  left: -30%;
  border-top: 2px solid #fffcef80;
  border-radius: 50%;
  transform: rotate(-23deg);
  filter: blur(1px);
}
.wind-ribbon-one {
  top: 30%;
}
.wind-ribbon-two {
  top: 60%;
  left: -10%;
  width: 120%;
  opacity: 0.6;
}
.wind-caption {
  position: absolute;
  inset: 44% 20px auto;
  text-align: center;
  color: #526b55;
  text-shadow: 0 2px 12px #ffffffe6;
}
.wind-caption span {
  display: block;
  font-size: 19px;
  font-weight: 600;
}
.wind-caption strong {
  display: block;
  font-size: 12px;
  font-weight: 500;
  margin-top: 12px;
  letter-spacing: 0.08em;
}
.wind-transition.reduced-motion .wind-leaf,
.wind-transition.reduced-motion .wind-ribbon {
  display: none;
}

/* One consistent card layout across mobile and desktop. */
#how-dialog {
  box-sizing: border-box;
  width: 460px;
  max-width: calc(100vw - 28px);
  max-height: calc(100dvh - 32px);
  padding: 30px 22px 20px;
  border: 1px solid #f2e5d2;
  border-radius: 28px;
  background: radial-gradient(ellipse at top left, #f4f1e2, transparent 60%), #fffaf0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #cbb8d0 transparent;
}
#how-dialog .modal-close {
  width: 40px;
  height: 40px;
  top: 10px;
  right: 10px;
}
#how-dialog .modal-kicker {
  font-size: 8px;
  letter-spacing: 0.15em;
  margin: 5px 24px 10px;
  color: #9b879e;
}
#how-dialog h2 {
  font-size: 26px;
  line-height: 1.4;
  margin: 0 0 5px;
  color: #604867;
}
#how-dialog .modal-description {
  font-size: 12px;
  line-height: 1.7;
  margin: 0 0 15px;
}
.how-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
}
.how-badges span {
  background: #edeedb;
  color: #6f795c;
  padding: 6px 10px;
  border-radius: 20px;
  font-size: 10px;
}
#how-dialog .how-steps {
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 18px 0 14px;
}
#how-dialog .how-steps article {
  display: grid;
  grid-template-columns: 108px 1fr;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 8px 5px;
  border: 1px solid #efe4d6;
  border-radius: 19px;
  background: #fffdf8;
  text-align: left;
}
.how-picture {
  position: relative;
  display: grid;
  place-items: center;
  height: 92px;
  border-radius: 14px;
  background: #edf0e2;
}
#how-dialog article:nth-child(2) .how-picture {
  background: #f7e9dc;
}
#how-dialog article:nth-child(3) .how-picture {
  background: #f2e9f2;
}
#how-dialog .step-number {
  display: grid;
  position: absolute;
  z-index: 1;
  left: 5px;
  top: 5px;
  width: 20px;
  height: 20px;
  background: #fffdf4;
  color: #8c7995;
  font-size: 11px;
}
#how-dialog .how-steps canvas {
  display: block;
  grid-area: auto;
  width: 108px;
  height: auto;
  max-width: 100%;
}
#how-dialog .how-steps h3 {
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 5px;
}
#how-dialog .how-steps p {
  font-size: 11px;
  line-height: 1.8;
  margin: 0;
  color: #8a798e;
}
#how-dialog .how-tip {
  padding: 11px 12px;
  margin: 0;
  gap: 9px;
  border: none;
  background: #f0ebf3;
  color: #88718f;
  font-size: 10px;
  line-height: 1.8;
}
#how-dialog .how-tip svg {
  width: 22px;
  min-width: 22px;
  height: 22px;
  color: #a28bab;
}
#how-dialog .how-tip strong {
  color: #735c7e;
  font-weight: 600;
}
.how-footer-note {
  font-size: 9px;
  line-height: 1.7;
  color: #9e8c9a;
  margin: 12px 0;
}
#how-dialog #how-done {
  min-width: 0;
  width: 100%;
  min-height: 52px;
  font-size: 15px;
  margin: 0;
}
#how-dialog #how-done svg {
  width: 18px;
  height: 18px;
}
@media (max-width: 360px) {
  #how-dialog {
    padding: 25px 14px 16px;
  }
  #how-dialog h2 {
    font-size: 23px;
  }
  #how-dialog .how-steps article {
    grid-template-columns: 86px 1fr;
    gap: 10px;
  }
  #how-dialog .how-picture {
    height: 82px;
  }
  #how-dialog .how-steps canvas {
    width: 86px;
  }
  #how-dialog .how-steps h3 {
    font-size: 13px;
  }
  #how-dialog .how-steps p {
    font-size: 10px;
  }
}

@media (max-height: 720px) and (max-width: 600px) {
  #how-dialog {
    padding-top: 21px;
    padding-bottom: 14px;
  }
  #how-dialog .how-steps {
    gap: 7px;
    margin: 12px 0 10px;
  }
  #how-dialog .how-steps article {
    padding-top: 5px;
    padding-bottom: 5px;
  }
  #how-dialog .how-picture {
    height: 76px;
  }
  #how-dialog .modal-description {
    margin-bottom: 10px;
  }
  #how-dialog .how-footer-note {
    margin: 8px 0;
  }
}

.terrain-guide {
  display: grid;
  gap: 5px;
  margin-top: 12px;
  text-align: left;
  font-size: 10px;
  line-height: 1.7;
  color: #88718f;
  background: #eff2e6;
  border-radius: 12px;
  padding: 10px 12px;
}
.terrain-guide b {
  color: #617459;
  margin-right: 5px;
}

/* Keep all controls and the board inside the notch/home-indicator safe area. */
:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --usable-height: calc(100svh - var(--safe-top) - var(--safe-bottom));
}
body {
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
}
.landing,
.play-area,
.is-playing .play-area {
  height: calc(var(--usable-height) - 20px);
  min-height: 0;
}
.modal,
#how-dialog {
  max-width: calc(100vw - var(--safe-left) - var(--safe-right) - 28px);
  max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 32px);
}
#how-dialog .modal-close {
  width: 44px;
  height: 44px;
}
@media (max-width: 760px) {
  .landing,
  .play-area,
  .is-playing .play-area {
    height: calc(var(--usable-height) - 16px);
  }
}
@media (min-width: 761px) {
  .app-shell {
    max-width: min(600px, calc((var(--usable-height) - 20px) * 0.6));
  }
}

:root[data-safe-area-preview] {
  --safe-top: 44px;
  --safe-bottom: 34px;
  --safe-left: 0px;
  --safe-right: 0px;
}
#performance-diagnostics {
  position: fixed;
  left: 10px;
  top: 4px;
  z-index: 100;
  padding: 3px 7px;
  border-radius: 5px;
  font: 10px monospace;
  background: #fffdf0e6;
  color: #544363;
  pointer-events: none;
}
