/* ===========================================================
   生菜田园 · 移动端种菜游戏
   全部视觉为原生 CSS / SVG，无外链资源
   =========================================================== */

:root {
  --orange: #FF8A3D;
  --orange-deep: #EF6A20;
  --orange-light: #FFB36E;
  --cream: #FFF8E9;
  --ink: #48301D;
  --muted: #977A58;
  --leaf: #4E9E3F;
  --leaf-light: #7CCB60;
  --grass: #6FB84F;
  --safe-top: max(10px, env(safe-area-inset-top));
  --safe-bottom: max(10px, env(safe-area-inset-bottom));
  --dock-space: calc(88px + var(--safe-bottom));
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 0%, #3B6B31 0%, #1B2E17 72%);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; }

.game {
  position: relative;
  width: 100%;
  max-width: 500px;
  height: 100vh;
  height: 100dvh;
  max-height: 960px;
  overflow: hidden;
  background: #8FD3E8;
  isolation: isolate;
  user-select: none;
  -webkit-user-select: none;
}

@media (min-width: 540px) {
  .game {
    height: min(960px, 96vh);
    height: min(960px, 96dvh);
    border-radius: 30px;
    box-shadow: 0 34px 90px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .12);
  }
}

/* ===========================================================
   场景
   =========================================================== */

.world { position: absolute; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }

.sky {
  position: absolute;
  left: 0; right: 0; top: 0; height: 56%;
  background:
    radial-gradient(ellipse at 76% 16%, rgba(255, 247, 194, .85) 0%, rgba(255, 247, 194, 0) 38%),
    linear-gradient(180deg, #66C3E6 0%, #8ED6E9 38%, #C6EEDF 68%, #F3F0C7 100%);
}

.sun { position: absolute; top: 9.5%; right: 24px; width: 60px; height: 60px; }
.sun-halo {
  position: absolute; inset: -36px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 246, 190, .95) 0%, rgba(255, 231, 139, .5) 38%, rgba(255, 225, 130, 0) 70%);
  animation: haloPulse 5s ease-in-out infinite;
}
.sun-rays {
  position: absolute; inset: -30px;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 247, 190, .7) 0deg 1.8deg, transparent 1.8deg 30deg);
  -webkit-mask: radial-gradient(circle, transparent 0 30%, #000 32% 44%, transparent 47%);
  mask: radial-gradient(circle, transparent 0 30%, #000 32% 44%, transparent 47%);
  animation: sunSpin 46s linear infinite;
  opacity: .75;
}
.sun-disc {
  position: absolute; inset: 6px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, #FFF8C9 0%, #FFDE7A 40%, #FFC94F 100%);
  box-shadow: 0 0 22px rgba(255, 217, 110, .85), inset -4px -6px 10px rgba(235, 164, 33, .35);
  animation: sunBreathe 5s ease-in-out infinite;
}

.cloud {
  position: absolute;
  width: 92px; height: 28px;
  border-radius: 999px;
  background: rgba(255, 253, 244, .92);
  box-shadow: 0 6px 12px rgba(79, 152, 178, .16);
  animation: cloudDrift 38s ease-in-out infinite alternate;
}
.cloud span { position: absolute; background: inherit; border-radius: 50%; }
.cloud span:nth-child(1) { width: 38px; height: 38px; left: 12px; top: -17px; }
.cloud span:nth-child(2) { width: 26px; height: 26px; left: 44px; top: -11px; }
.cloud span:nth-child(3) { width: 20px; height: 20px; left: 66px; top: -5px; }
.cloud--1 { top: 13%; left: -10%; opacity: .9; animation-duration: 44s; }
.cloud--2 { top: 21%; right: -14%; width: 72px; height: 23px; opacity: .76; animation-duration: 55s; animation-delay: -14s; }
.cloud--3 { top: 6.5%; left: 43%; width: 56px; height: 18px; opacity: .6; animation-duration: 36s; animation-delay: -5s; }

.birds { position: absolute; top: 17%; left: 17%; width: 80px; opacity: .72; animation: birdDrift 17s ease-in-out infinite alternate; }

.hill { position: absolute; border-radius: 50% 50% 0 0 / 100% 100% 0 0; }
.hill--back { left: -28%; top: 21%; width: 92%; height: 15%; background: #B5E096; opacity: .9; }
.hill--mid { right: -24%; top: 23.5%; width: 86%; height: 13%; background: #9AD479; }

.meadow-edge {
  position: absolute; left: 0; right: 0; top: calc(28.4% - 30px);
  width: 100%; height: 62px; z-index: 1;
}
.meadow {
  position: absolute; left: 0; right: 0; top: 28.4%; bottom: 0;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(255, 244, 175, .2) 0%, rgba(255, 244, 175, 0) 62%),
    linear-gradient(180deg, #8CCB66 0%, #78BE54 34%, #63AF47 100%);
  z-index: 1;
}
.meadow::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, .55) 1px, transparent 1.5px),
    radial-gradient(circle, rgba(255, 242, 156, .6) 1.2px, transparent 1.7px),
    repeating-linear-gradient(108deg, rgba(255, 255, 255, .045) 0 2px, transparent 2px 11px);
  background-size: 53px 61px, 79px 71px, 100% 100%;
  background-position: 12px 24px, 40px 8px, 0 0;
  opacity: .55;
  pointer-events: none;
}

.house { position: absolute; left: -2%; top: 11.8%; width: 34%; z-index: 3; filter: drop-shadow(0 10px 12px rgba(52, 96, 37, .18)); }
.house svg { display: block; width: 100%; height: auto; }
.smoke {
  position: absolute; left: 74%; top: 9%;
  width: 13px; height: 13px; border-radius: 50%;
  background: rgba(255, 255, 255, .7);
  filter: blur(1px);
  animation: smokeRise 4.6s ease-out infinite;
}
.smoke--2 { animation-delay: 1.5s; }
.smoke--3 { animation-delay: 3s; }

.tree { position: absolute; right: -4%; top: 12.2%; width: 34%; z-index: 3; filter: drop-shadow(0 10px 12px rgba(52, 96, 37, .18)); }
.tree svg { display: block; width: 100%; height: auto; }

.fence { position: absolute; left: 0; right: 0; top: 26.7%; width: 100%; height: 46px; z-index: 2; opacity: .96; }

.butterfly { position: absolute; right: 26%; top: 26%; width: 30px; z-index: 4; animation: flutter 13s ease-in-out infinite; }
.butterfly-wings { transform-origin: 22px 17px; animation: wingFlap .6s ease-in-out infinite alternate; }

.daisy { position: absolute; width: 17px; z-index: 4; filter: drop-shadow(0 1px 1px rgba(44, 92, 32, .2)); }
.daisy--1 { left: 37%; top: 26.2%; transform: rotate(-12deg) scale(.9); }
.daisy--2 { right: 8%; top: 27%; transform: rotate(10deg); }
.daisy--3 { left: 7%; top: 25.6%; transform: rotate(20deg) scale(.78); }

.pollen {
  position: absolute; width: 5px; height: 5px; border-radius: 50%;
  background: rgba(255, 248, 186, .85);
  box-shadow: 0 0 6px rgba(255, 240, 150, .8);
  animation: pollenFloat 9s ease-in-out infinite;
  z-index: 3;
}
.pollen--1 { left: 18%; top: 62%; animation-delay: -1s; }
.pollen--2 { left: 80%; top: 48%; animation-delay: -4s; }
.pollen--3 { left: 34%; top: 78%; animation-delay: -6s; }
.pollen--4 { left: 68%; top: 70%; animation-delay: -2.5s; }

.vignette {
  position: absolute; inset: 0; z-index: 5;
  background: radial-gradient(ellipse at 50% 42%, rgba(0, 0, 0, 0) 52%, rgba(53, 38, 16, .16) 100%);
  pointer-events: none;
}

/* ===========================================================
   顶部资源胶囊
   =========================================================== */

.hud {
  position: absolute;
  top: calc(var(--safe-top) + 4px);
  left: 14px; right: 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  z-index: 40;
  pointer-events: none;
}

.pill {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 45px;
  padding: 5px 13px 5px 5px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 253, 244, .97), rgba(255, 243, 218, .94));
  border: 1.5px solid rgba(255, 255, 255, .9);
  box-shadow:
    inset 0 1px 0 #fff,
    0 3px 0 rgba(158, 102, 49, .18),
    0 9px 20px rgba(55, 62, 24, .18);
  backdrop-filter: blur(4px);
}
.pill-badge {
  flex: 0 0 auto;
  width: 35px; height: 35px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.badge-coin { background: radial-gradient(circle at 40% 30%, #FFF4C7, #FFD25E); box-shadow: inset 0 -2px 3px rgba(178, 110, 12, .22); }
.badge-seed { background: radial-gradient(circle at 40% 30%, #FFEDCF, #F3CE9E); box-shadow: inset 0 -2px 3px rgba(160, 96, 44, .2); }
.pill-badge svg { width: 29px; height: 29px; display: block; }
.pill-copy { display: flex; flex-direction: column; line-height: 1; padding-right: 2px; }
.pill-copy b {
  font-size: 18px; font-weight: 900; letter-spacing: -.02em;
  color: #5A3A1C; font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .8);
}
.pill-copy small { margin-top: 3px; font-size: 9.5px; font-weight: 700; letter-spacing: .06em; color: #A6875F; }
.pill-copy b.bump { animation: numberBump .36s cubic-bezier(.34, 1.56, .64, 1); }

/* ===========================================================
   菜地
   =========================================================== */

.field {
  position: absolute;
  left: 14px; right: 14px;
  top: max(176px, 26%);
  bottom: var(--dock-space);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  z-index: 10;
}

.farm-sign {
  position: relative;
  align-self: center;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 9px;
  padding: 6px 15px 7px;
  border-radius: 11px;
  background: linear-gradient(180deg, #FFE9B9 0%, #F8CE90 100%);
  border: 2px solid #C98A4D;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, .7),
    inset 0 -3px 0 rgba(173, 103, 47, .18),
    0 4px 0 rgba(126, 76, 34, .32),
    0 8px 15px rgba(45, 82, 32, .22);
  color: #7B4723;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .14em;
  transform: rotate(-1.2deg);
}
.farm-sign::before, .farm-sign::after {
  content: "";
  position: absolute; top: 50%;
  width: 5px; height: 5px; margin-top: -2px;
  border-radius: 50%;
  background: #B77A45;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .5);
}
.farm-sign::before { left: 5px; }
.farm-sign::after { right: 5px; }
.farm-sign b { font-size: inherit; }
.sign-leaf { font-size: 15px; width: 15px; height: 15px; color: #6F9D3A; }
.sign-leaf--right { transform: scaleX(-1); }

.plots {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 2.4vw, 14px);
  position: relative;
}

.plot {
  position: relative;
  min-width: 0; min-height: 0;
  padding: 0; border: 0; background: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform .12s ease;
  outline: none;
}
.plot:active { transform: scale(.965); }
.plot:focus-visible .soil { outline: 3px solid rgba(255, 255, 255, .95); outline-offset: 3px; }

.plot-shadow {
  position: absolute;
  left: 7%; right: 7%; bottom: -1%;
  height: 13%;
  border-radius: 50%;
  background: rgba(44, 87, 32, .3);
  filter: blur(5px);
}

.soil {
  position: absolute;
  inset: 0 0 4% 0;
  border-radius: 19px;
  overflow: hidden;
  border: 4px solid #DCA364;
  background:
    radial-gradient(ellipse at 28% 16%, rgba(255, 226, 178, .26) 0%, rgba(255, 226, 178, 0) 42%),
    linear-gradient(180deg, #A96C44 0%, #8B5736 52%, #76452B 100%);
  box-shadow:
    inset 0 4px 0 rgba(255, 231, 191, .28),
    inset 0 -12px 18px rgba(57, 29, 12, .36),
    0 3px 0 #B4773F,
    0 8px 14px rgba(44, 87, 32, .24);
  transition: box-shadow .25s ease;
}
.soil::before {
  content: "";
  position: absolute; inset: 2px;
  border-radius: 13px;
  border: 1.5px solid rgba(255, 227, 181, .22);
  pointer-events: none;
}
.soil-grain {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255, 220, 170, .24) 0 1.4px, transparent 1.8px),
    radial-gradient(circle at 70% 66%, rgba(59, 31, 14, .32) 0 1.6px, transparent 2px),
    radial-gradient(circle at 46% 18%, rgba(255, 216, 160, .18) 0 1.2px, transparent 1.7px),
    repeating-linear-gradient(101deg, rgba(61, 31, 13, .11) 0 3px, transparent 3px 15px);
  background-size: 37px 41px, 43px 47px, 29px 33px, 100% 100%;
  opacity: .9;
}

.plant-host {
  position: absolute;
  left: 6%; right: 6%; top: 4%; bottom: 9%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 3;
  transition: filter .3s ease;
  pointer-events: none;
}
.plant-host > svg {
  display: block;
  width: 100%; height: 100%;
  overflow: visible;
  filter: drop-shadow(0 4px 5px rgba(51, 27, 10, .28));
}
.plant-host > svg {
  transform-origin: 50% 92%;
  animation-name: plantSway;
  animation-duration: 4.2s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-delay: var(--sway-delay, 0s);
}

.plot.dry .plant-host > svg { animation-name: plantWilt; animation-duration: 2.6s; }
.plot.watering .plant-host > svg { animation-name: waterHappy; animation-duration: .66s; animation-iteration-count: 1; animation-delay: 0s; }
.plot.dry .plant-host > svg { filter: drop-shadow(0 4px 5px rgba(51, 27, 10, .22)) saturate(.82) brightness(.97); }

.plot.ready .soil {
  box-shadow:
    inset 0 4px 0 rgba(255, 231, 191, .28),
    inset 0 -12px 18px rgba(57, 29, 12, .36),
    0 0 0 2px rgba(255, 214, 118, .85),
    0 0 20px rgba(255, 205, 90, .5),
    0 8px 14px rgba(44, 87, 32, .24);
  animation: readyPulse 2.4s ease-in-out infinite;
}
.plot.ready .plant-host { filter: drop-shadow(0 0 10px rgba(255, 241, 166, .85)); }
.plot.ready .plant-host > svg { animation-duration: 2.8s; }
.sparkles { animation: twinkle 1.9s ease-in-out infinite; transform-origin: 60px 55px; }

.plot.planting .plant-host { animation: plantPop .55s cubic-bezier(.34, 1.56, .64, 1); }
.plot.harvesting .plant-host { animation: harvestOut .36s cubic-bezier(.5, 0, .75, 0) forwards; }

/* 空地提示 */
.empty-hint {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px;
  z-index: 2;
  color: rgba(255, 232, 190, .9);
  opacity: 0; transform: scale(.9);
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
}
.plot.is-empty .empty-hint { opacity: 1; transform: scale(1); }
.empty-plus {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border: 2px dashed rgba(255, 226, 178, .66);
  border-radius: 50%;
  font-size: 21px; font-weight: 300; line-height: 1;
  color: rgba(255, 240, 210, .95);
  text-shadow: 0 1px 2px rgba(58, 30, 12, .4);
}
.empty-text {
  font-size: 10.5px; font-weight: 800; letter-spacing: .16em;
  text-shadow: 0 1px 3px rgba(48, 23, 8, .5);
}

/* 生长进度 */
.grow-bar {
  position: absolute; left: 11px; right: 11px; bottom: 7px;
  height: 4px; border-radius: 999px;
  background: rgba(42, 22, 10, .38);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .3);
  overflow: hidden;
  z-index: 4;
  opacity: 1;
  transition: opacity .25s ease;
}
.grow-bar i {
  display: block; width: 0%; height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #A9DE5E, #6CC146);
  box-shadow: 0 0 6px rgba(174, 226, 105, .55);
  transition: width .55s linear;
}
.plot.is-empty .grow-bar, .plot.ready .grow-bar { opacity: 0; }
.plot.ready .grow-bar i { background: linear-gradient(90deg, #FFD96E, #FFAE34); }

/* 浇水提示 */
.drop-badge {
  position: absolute; top: 7px; right: 7px;
  width: 31px; height: 31px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: linear-gradient(180deg, #7ED5FF, #3AA7E8);
  border: 2px solid rgba(255, 255, 255, .95);
  color: #fff;
  box-shadow: 0 3px 0 rgba(23, 106, 159, .42), 0 0 0 0 rgba(102, 201, 255, .55);
  opacity: 0; transform: scale(.4);
  transition: opacity .2s ease, transform .2s ease;
  z-index: 6;
  pointer-events: none;
}
.drop-badge .mp-icon { width: 17px; height: 17px; }
.plot.dry .drop-badge {
  opacity: 1; transform: scale(1);
  animation: dropPulse 1.7s ease-in-out infinite;
}

/* 成熟标识 */
.ready-badge {
  position: absolute; top: 6px; left: 50%;
  transform: translate(-50%, -8px) scale(.7);
  display: flex; align-items: center; gap: 3px;
  padding: 3px 9px 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, #FFAE5C, #FF7F30);
  border: 1.5px solid rgba(255, 255, 255, .9);
  box-shadow: 0 3px 0 rgba(186, 79, 13, .35), 0 4px 10px rgba(120, 60, 12, .25);
  color: #fff;
  font-size: 10.5px; font-weight: 900; letter-spacing: .08em;
  opacity: 0;
  transition: opacity .22s ease, transform .22s ease;
  z-index: 6;
  pointer-events: none;
  white-space: nowrap;
}
.ready-badge .mp-icon { width: 13px; height: 13px; }
.plot.ready .ready-badge {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
  animation: badgeBob 1.8s ease-in-out infinite;
}

/* ===========================================================
   底部操作栏
   =========================================================== */

.dock {
  position: absolute;
  left: 12px; right: 12px;
  bottom: calc(var(--safe-bottom) + 2px);
  z-index: 45;
}

.dock-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 9px 9px 12px;
  border-radius: 23px;
  background: linear-gradient(180deg, #FFFDF5 0%, #FFF1D3 100%);
  border: 1.5px solid #EBC794;
  box-shadow:
    inset 0 2px 0 #fff,
    inset 0 -3px 0 rgba(195, 134, 74, .12),
    0 5px 0 rgba(146, 91, 40, .22),
    0 16px 30px rgba(43, 62, 27, .3);
}

.crop-stat { display: flex; align-items: center; gap: 9px; min-width: 0; }
.crop-icon {
  flex: 0 0 auto;
  width: 43px; height: 43px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 15px;
  background: linear-gradient(160deg, #FFF0C8, #FFDCA0);
  box-shadow: inset 0 1px 0 #fff, inset 0 -2px 4px rgba(191, 123, 47, .22);
}
.crop-icon svg { width: 37px; height: 37px; display: block; }
.crop-copy { display: flex; flex-direction: column; min-width: 0; line-height: 1.1; }
.crop-label { font-size: 9px; font-weight: 800; letter-spacing: .18em; color: #B18F62; }
.crop-value { display: flex; align-items: baseline; gap: 4px; margin-top: 1px; }
.crop-value b { font-size: 22px; font-weight: 900; color: #5B3B1B; font-variant-numeric: tabular-nums; }
.crop-value b.bump { animation: numberBump .36s cubic-bezier(.34, 1.56, .64, 1); }
.crop-value em { font-style: normal; font-size: 10.5px; font-weight: 700; color: #9C7A52; }
.crop-hint {
  margin-top: 2px;
  max-width: 150px;
  font-size: 9.5px; color: #AC8B62; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.main-btn {
  position: relative;
  flex: 0 0 auto;
  min-width: 106px;
  height: 54px;
  padding: 0 15px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, #FFB36C 0%, #FF8A3D 46%, #F3711F 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, .5),
    inset 0 -2px 0 rgba(178, 70, 8, .22),
    0 4px 0 #C95312,
    0 9px 16px rgba(201, 82, 18, .36);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .04em;
  cursor: pointer;
  overflow: hidden;
  transition: transform .1s ease, box-shadow .1s ease, filter .2s ease;
  touch-action: manipulation;
}
.main-btn .mp-icon { width: 21px; height: 21px; color: #fff; filter: drop-shadow(0 1px 1px rgba(141, 58, 5, .35)); }
.main-btn .btn-gloss {
  position: absolute; left: 10%; right: 10%; top: 3px; height: 38%;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .32), rgba(255, 255, 255, 0));
  pointer-events: none;
}
.main-btn:active {
  transform: translateY(3px);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .4), 0 1px 0 #C95312, 0 4px 8px rgba(201, 82, 18, .3);
}
.main-btn:disabled {
  cursor: default;
  background: linear-gradient(180deg, #EAD9BE, #D9C4A2);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .55), 0 3px 0 #B79E79;
  color: #836746;
  transform: none;
}
.main-btn:disabled .mp-icon { color: #947854; filter: none; }
.main-btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

/* ===========================================================
   提示与特效
   =========================================================== */

.toast {
  position: absolute;
  left: 50%;
  top: calc(var(--safe-top) + 62px);
  width: max-content;
  max-width: 86%;
  transform: translate(-50%, -8px) scale(.94);
  padding: 9px 16px;
  border-radius: 17px;
  background: rgba(58, 37, 20, .9);
  border: 1px solid rgba(255, 244, 209, .2);
  box-shadow: 0 8px 20px rgba(30, 20, 8, .3);
  color: #FFF6E2;
  font-size: 12px; font-weight: 700; letter-spacing: .02em;
  text-align: center;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  z-index: 70;
  transition: opacity .2s ease, transform .25s cubic-bezier(.34, 1.56, .64, 1);
}
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }

.fx-layer { position: absolute; inset: 0; z-index: 65; pointer-events: none; overflow: hidden; }

.float-text {
  position: absolute;
  display: flex; align-items: center; gap: 3px;
  font-size: 19px; font-weight: 900;
  color: #FFE28A;
  text-shadow: 0 2px 0 #B86513, 0 4px 10px rgba(52, 28, 8, .4);
  white-space: nowrap;
  animation: floatUp 1s cubic-bezier(.2, .8, .3, 1) forwards;
}
.float-text .coin-dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: radial-gradient(circle at 36% 32%, #FFF3B8, #FFC33C 60%, #E39A12);
  border: 1.5px solid #B87B0E;
  box-shadow: 0 1px 2px rgba(90, 50, 6, .35);
}

.droplet {
  position: absolute; top: -8px;
  width: 7px; height: 10px;
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background: linear-gradient(180deg, #DFF7FF, #63C4F5);
  box-shadow: 0 0 4px rgba(140, 225, 255, .8);
  animation: dropletFall .62s ease-in forwards;
  z-index: 7;
}
.leaf-bit {
  position: absolute;
  width: 9px; height: 13px;
  border-radius: 100% 0 100% 0;
  background: linear-gradient(135deg, #B8E97D, #5FAF43);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35);
  animation: leafBurst .9s cubic-bezier(.2, .7, .4, 1) forwards;
  z-index: 66;
}
.fly-plant {
  position: absolute;
  pointer-events: none;
  z-index: 67;
  transition: transform .5s cubic-bezier(.35, .1, .65, .9), opacity .32s ease;
  filter: drop-shadow(0 4px 8px rgba(40, 24, 8, .25));
}
.fly-plant svg { width: 100%; height: 100%; display: block; }

.seed-bit {
  position: absolute;
  width: 6px; height: 8px;
  border-radius: 50%;
  background: #D9B270;
  box-shadow: inset 0 -1px 0 #A67C3E;
  animation: seedBurst .55s ease-out forwards;
  z-index: 66;
}

/* ===========================================================
   动画
   =========================================================== */

@keyframes haloPulse { 0%, 100% { transform: scale(1); opacity: .92; } 50% { transform: scale(1.09); opacity: .75; } }
@keyframes sunBreathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035); } }
@keyframes sunSpin { to { transform: rotate(360deg); } }
@keyframes cloudDrift { from { transform: translateX(-10px); } to { transform: translateX(26px); } }
@keyframes birdDrift { from { transform: translate(0, 0); } to { transform: translate(38px, 10px); } }
@keyframes smokeRise {
  0% { transform: translate(0, 0) scale(.5); opacity: 0; }
  18% { opacity: .7; }
  100% { transform: translate(-26px, -58px) scale(1.7); opacity: 0; }
}
@keyframes flutter {
  0%, 100% { transform: translate(0, 0) rotate(-8deg); }
  25% { transform: translate(-26px, -16px) rotate(8deg); }
  50% { transform: translate(-60px, 4px) rotate(-6deg); }
  75% { transform: translate(-24px, 14px) rotate(9deg); }
}
@keyframes wingFlap { from { transform: scaleX(1); } to { transform: scaleX(.62); } }
@keyframes pollenFloat {
  0%, 100% { transform: translate(0, 0); opacity: .25; }
  30% { opacity: .9; }
  50% { transform: translate(14px, -26px); opacity: .65; }
  75% { transform: translate(-8px, -40px); opacity: .2; }
}
@keyframes plantSway { 0%, 100% { transform: rotate(-1.6deg); } 50% { transform: rotate(1.8deg); } }
@keyframes plantWilt {
  0%, 100% { transform: rotate(-5deg) translateY(1px); }
  50% { transform: rotate(-2deg) translateY(2px); }
}
@keyframes waterHappy {
  0%, 100% { transform: rotate(0) scale(1); }
  35% { transform: rotate(2.2deg) scale(1.035); }
  70% { transform: rotate(-1.2deg) scale(1.015); }
}
@keyframes readyPulse {
  0%, 100% { box-shadow: inset 0 4px 0 rgba(255, 231, 191, .28), inset 0 -12px 18px rgba(57, 29, 12, .36), 0 0 0 1.5px rgba(255, 214, 118, .7), 0 0 12px rgba(255, 205, 90, .32), 0 8px 14px rgba(44, 87, 32, .24); }
  50% { box-shadow: inset 0 4px 0 rgba(255, 231, 191, .28), inset 0 -12px 18px rgba(57, 29, 12, .36), 0 0 0 2.5px rgba(255, 226, 142, .95), 0 0 26px rgba(255, 205, 90, .65), 0 8px 14px rgba(44, 87, 32, .24); }
}
@keyframes twinkle { 0%, 100% { opacity: .2; transform: scale(.9); } 50% { opacity: 1; transform: scale(1.06); } }
@keyframes plantPop {
  0% { transform: scale(.2) translateY(18px); opacity: 0; }
  60% { transform: scale(1.08) translateY(-3px); opacity: 1; }
  100% { transform: scale(1) translateY(0); }
}
@keyframes harvestOut {
  0% { transform: scale(1) translateY(0); opacity: 1; }
  45% { transform: scale(1.14) translateY(-12px) rotate(4deg); opacity: 1; }
  100% { transform: scale(.45) translateY(-30px) rotate(12deg); opacity: 0; }
}
@keyframes dropPulse {
  0%, 100% { box-shadow: 0 3px 0 rgba(23, 106, 159, .42), 0 0 0 0 rgba(102, 201, 255, .55); transform: scale(1); }
  50% { box-shadow: 0 3px 0 rgba(23, 106, 159, .42), 0 0 0 7px rgba(102, 201, 255, 0); transform: scale(1.06); }
}
@keyframes badgeBob { 0%, 100% { transform: translate(-50%, 0) scale(1); } 50% { transform: translate(-50%, -3px) scale(1.04); } }
@keyframes numberBump { 0% { transform: scale(1); } 45% { transform: scale(1.22); } 100% { transform: scale(1); } }
@keyframes floatUp {
  0% { transform: translate(-50%, 6px) scale(.7); opacity: 0; }
  18% { transform: translate(-50%, -6px) scale(1.12); opacity: 1; }
  55% { transform: translate(-50%, -34px) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -64px) scale(.92); opacity: 0; }
}
@keyframes dropletFall {
  0% { transform: translateY(0) scale(.6); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translateY(58px) scale(1); opacity: 0; }
}
@keyframes leafBurst {
  0% { transform: translate(0, 0) rotate(0deg) scale(.5); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(1); opacity: 0; }
}
@keyframes seedBurst {
  0% { transform: translate(0, 0) scale(.5); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; }
}

/* ===========================================================
   小屏适配
   =========================================================== */

@media (max-height: 730px) {
  .field { top: max(156px, 25.5%); bottom: calc(80px + var(--safe-bottom)); }
  .farm-sign { font-size: 13px; padding: 5px 13px 6px; margin-bottom: 6px; }
  .dock-card { padding: 7px 8px 7px 10px; border-radius: 20px; }
  .crop-icon { width: 38px; height: 38px; border-radius: 13px; }
  .crop-icon svg { width: 32px; height: 32px; }
  .crop-value b { font-size: 19px; }
  .main-btn { height: 49px; min-width: 98px; font-size: 14px; border-radius: 14px; }
  .ready-badge { font-size: 9.5px; padding: 2px 7px 3px; }
  .empty-plus { width: 28px; height: 28px; font-size: 18px; }
  .empty-text { font-size: 9.5px; }
}

@media (max-height: 640px) {
  .crop-hint { display: none; }
  .field { top: max(142px, 25%); }
  .dock-card { padding: 6px 7px 6px 9px; }
  .main-btn { height: 46px; }
  .crop-value b { font-size: 18px; }
  .pill { min-height: 40px; }
  .pill-badge { width: 31px; height: 31px; }
  .pill-badge svg { width: 26px; height: 26px; }
  .pill-copy b { font-size: 16px; }
}

@media (max-width: 350px) {
  .hud { left: 10px; right: 10px; }
  .field { left: 10px; right: 10px; }
  .pill { padding-right: 9px; gap: 6px; }
  .pill-copy small { font-size: 8.5px; }
  .main-btn { min-width: 90px; padding: 0 10px; font-size: 13px; }
  .crop-hint { max-width: 112px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
