/* ---------- Garden Grow (all classes prefixed gd-) ---------- */
.gd { --sp: clamp(90px, min(17vw, 32vh), 200px); --fh: clamp(100px, 26vh, 170px); overflow: hidden; touch-action: manipulation; }
.gd[data-n="5"] { --sp: clamp(84px, min(15vw, 32vh), 190px); }
.gd[data-n="6"] { --sp: clamp(78px, min(13vw, 32vh), 180px); }
.gd-scene { position: absolute; inset: 0; background-size: cover; background-position: center bottom; transition: opacity .5s; }
.gd-scene.gd-fade { opacity: 0; }
.gd-sunny { position: absolute; inset: 0; pointer-events: none; z-index: 2; opacity: 0; transition: opacity .5s; background: radial-gradient(circle at 20% 22%, rgba(255, 244, 140, .7), rgba(255, 230, 120, .25) 35%, transparent 65%); }
.gd-sunny.gd-on { opacity: 1; }

/* night */
.gd-night { position: absolute; inset: 0; background: #1b1740; opacity: 0; transition: opacity 1.4s ease; pointer-events: none; z-index: 3; }
.gd-dark .gd-night { opacity: .55; }
.gd-moon { position: absolute; right: 30%; top: 8%; width: clamp(60px, 12vh, 110px); aspect-ratio: 1; border-radius: 50%; background: #fff8c4; box-shadow: 0 0 40px 14px rgba(255, 248, 196, .5); opacity: 0; transition: opacity 1.4s; }
.gd-dark .gd-moon { opacity: 1; }
.gd-twinkle { position: absolute; width: 12px; height: 12px; border-radius: 50%; background: #fff; opacity: 0; }
.gd-dark .gd-twinkle { animation: gd-twinkle 1.7s ease-in-out infinite alternate; }
@keyframes gd-twinkle { from { opacity: .25; transform: scale(.6); } to { opacity: 1; transform: scale(1.1); } }
.gd-dark .gd-sun img { filter: brightness(.55) saturate(.6); }
.gd-fireflies { position: absolute; inset: 0; z-index: 16; pointer-events: none; }
.gd-firefly { position: absolute; width: 80px; height: 80px; display: grid; place-items: center; pointer-events: auto; animation: gd-drift 4s ease-in-out infinite alternate; }
.gd-firefly i { width: 24px; height: 24px; border-radius: 50%; background: #ffff8a; box-shadow: 0 0 18px 8px rgba(255, 255, 140, .8); animation: gd-glow 1s ease-in-out infinite alternate; }
.gd-firefly.gd-caught { animation: gd-catch .5s ease-out forwards; }
@keyframes gd-drift { from { transform: translate(0, 0); } 50% { transform: translate(30px, -26px); } to { transform: translate(-24px, 18px); } }
@keyframes gd-glow { from { opacity: .5; transform: scale(.8); } to { opacity: 1; transform: scale(1.15); } }
@keyframes gd-catch { to { transform: scale(2.4); opacity: 0; } }

/* rain */
.gd-rain { position: absolute; inset: 0; pointer-events: none; z-index: 12; overflow: hidden; display: none; }
.gd-rain.gd-on { display: block; }
.gd-rain.gd-on { background: rgba(110, 150, 220, .12); }
.gd-rain i { position: absolute; top: -40px; width: 9px; height: 36px; border-radius: 4px; background: rgba(110, 185, 255, .85); animation: gd-fall 1s linear infinite; }
@keyframes gd-fall { from { transform: translateY(-40px); } to { transform: translateY(110vh); } }

/* sky buttons */
.gd-sun { position: absolute; left: 12%; top: 10%; width: clamp(100px, 19vh, 165px); aspect-ratio: 1; z-index: 10; display: grid; place-items: center; }
.gd-sun img { width: 100%; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .15)); transition: filter .5s; animation: gd-breathe 3s ease-in-out infinite alternate; }
.gd-sun.gd-shining img { animation: gd-shine .5s ease-in-out infinite alternate; filter: drop-shadow(0 0 22px #ffe066) drop-shadow(0 0 40px #ffd43b); }
@keyframes gd-shine { from { transform: scale(1.05) rotate(-6deg); } to { transform: scale(1.18) rotate(6deg); } }
@keyframes gd-breathe { from { transform: scale(1); } to { transform: scale(1.06); } }
.gd-cloud { position: absolute; right: 13%; top: 6%; width: clamp(120px, 23vh, 205px); z-index: 10; display: grid; place-items: center; animation: gd-float 4s ease-in-out infinite alternate; }
.gd-cloud img { width: 100%; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .15)); transition: filter .4s; }
.gd-cloud.gd-raining img { filter: brightness(.8) saturate(1.2) drop-shadow(0 6px 6px rgba(0, 0, 0, .2)); animation: gd-shake .4s ease-in-out infinite; }
@keyframes gd-float { from { transform: translateY(0); } to { transform: translateY(-14px); } }
@keyframes gd-shake { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
.gd-sun:active, .gd-cloud:active, .gd-can:active, .gd-spot:active, .gd-deco:active, .gd-visitor:active { transform: scale(.94); }

/* watering can */
.gd-can { position: absolute; left: 1.5%; bottom: 5%; width: clamp(90px, 19vh, 165px); z-index: 11; transform-origin: 75% 85%; transition: transform .5s cubic-bezier(.3, 1.3, .5, 1); }
.gd-can img { width: 100%; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .18)); }
.gd-can.gd-tilt { transform: rotate(-38deg) translate(6%, -10%); }
.gd-pour { position: absolute; left: 6%; top: 34%; width: 20px; height: 0; display: none; }
.gd-can.gd-tilt .gd-pour { display: block; }
.gd-pour i { position: absolute; left: 0; top: 0; width: 8px; height: 22px; border-radius: 4px; background: rgba(110, 185, 255, .9); animation: gd-pour .7s linear infinite; }
.gd-pour i:nth-child(2) { left: 8px; animation-delay: .14s; } .gd-pour i:nth-child(3) { left: -6px; animation-delay: .28s; }
.gd-pour i:nth-child(4) { left: 14px; animation-delay: .42s; } .gd-pour i:nth-child(5) { left: 2px; animation-delay: .56s; }
@keyframes gd-pour { from { transform: translate(0, 0); opacity: 1; } to { transform: translate(-30px, 140px); opacity: 0; } }

/* score + next unlock ring */
.gd-score { display: flex; align-items: center; gap: 8px; padding: 6px 20px 6px 12px; border-radius: 40px; background: #fff; box-shadow: var(--shadow); font-size: 42px; line-height: 1; color: var(--ink); }
.gd-score .ico { width: 46px; height: 46px; }
.gd-next { width: 60px; height: 60px; border-radius: 50%; background: conic-gradient(var(--pink) calc(var(--p, 0) * 360deg), #eee4f2 0); display: grid; place-items: center; position: relative; box-shadow: var(--shadow); }
.gd-next::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: #fff; }
.gd-next img { position: relative; width: 66%; height: 66%; object-fit: cover; border-radius: 50%; filter: grayscale(.7); opacity: .85; }
.gd-seedbtn { padding: 10px; background: linear-gradient(180deg, #fff, #f3ffe9); }
.gd-seedbtn img.ico { width: 100%; height: 100%; object-fit: contain; }

/* garden bed */
.gd-bed { position: absolute; left: 0; right: 0; bottom: 3%; display: flex; justify-content: center; align-items: flex-end; flex-wrap: wrap; gap: 1.6vw; padding: 0 calc(var(--sp) * .35); z-index: 8; pointer-events: none; }
.gd-spot { position: relative; width: var(--sp); height: calc(var(--sp) * 1.7); pointer-events: auto; transition: transform .12s; }
.gd-spot.gd-pop { animation: gd-popin .5s cubic-bezier(.3, 1.6, .5, 1); }
.gd-spot.gd-empty::before { content: ""; position: absolute; left: 8%; right: 8%; bottom: 3%; height: 38%; border-radius: 50%; background: rgba(255, 255, 255, .35); animation: gd-glowring 1.6s ease-in-out infinite alternate; }
@keyframes gd-glowring { from { opacity: .4; transform: scale(.96); } to { opacity: 1; transform: scale(1.04); } }
.gd-soil { position: absolute; left: 0; bottom: 0; width: 100%; height: 40%; object-fit: contain; object-position: bottom; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .18)); }
.gd-plant { position: absolute; left: 2%; width: 96%; bottom: 19%; height: 88%; display: flex; align-items: flex-end; justify-content: center; transform-origin: 50% 100%; }
.gd-plant img { max-width: 100%; max-height: 100%; object-fit: contain; transform-origin: 50% 100%; transition: transform .45s cubic-bezier(.3, 1.4, .5, 1); filter: drop-shadow(0 5px 5px rgba(0, 0, 0, .18)); }
.gd-spot[data-stage="0"] .gd-plant img { transform: scale(.48); }
.gd-spot[data-stage="1"] .gd-plant img { transform: scale(.7); }
.gd-spot[data-stage="2"] .gd-plant img { transform: scale(.86); }
.gd-spot[data-stage="3"] .gd-plant img { transform: scale(1); }
.gd-spot.gd-empty .gd-plant { display: none; }
.gd-plant.gd-grow { animation: gd-grow .7s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes gd-grow { 0% { transform: scale(.6, 1.2); } 45% { transform: scale(1.18, .9); } 100% { transform: scale(1); } }
.gd-plant.gd-drink { animation: gd-drink .8s ease-in-out; }
@keyframes gd-drink { 0%, 100% { transform: scale(1); } 30% { transform: scale(1.06, .92); } 60% { transform: scale(.96, 1.08); } }
.gd-plant.gd-wiggle { animation: gd-wiggle .5s ease-in-out; }
.gd-bloomed .gd-plant { animation: gd-sway 3s ease-in-out infinite alternate; }
@keyframes gd-sway { from { transform: rotate(-3deg); } to { transform: rotate(3deg); } }
.gd-party .gd-bloomed .gd-plant { animation: gd-dance .45s ease-in-out infinite alternate; }
@keyframes gd-dance { from { transform: translateY(0) rotate(-8deg); } to { transform: translateY(-14%) rotate(8deg); } }
.gd-need { position: absolute; left: 50%; top: -6%; width: 46%; aspect-ratio: 1; transform: translateX(-50%); border-radius: 50%; background: #fff; box-shadow: 0 5px 0 rgba(0, 0, 0, .12); display: grid; place-items: center; animation: gd-bob 1.1s ease-in-out infinite alternate; pointer-events: none; }
.gd-need.gd-need-sun { background: #fff6c8; }
.gd-need img { width: 72%; height: 72%; object-fit: contain; }
@keyframes gd-bob { from { transform: translateX(-50%) translateY(0) scale(1); } to { transform: translateX(-50%) translateY(-10px) scale(1.08); } }
.gd-hint { position: absolute; left: 50%; bottom: 40%; width: 44%; transform: translateX(-50%); animation: gd-point 1s ease-in-out infinite alternate; pointer-events: none; }
.gd-hint .ico { width: 100%; }
@keyframes gd-point { from { transform: translateX(-50%) translateY(0); } to { transform: translateX(-50%) translateY(-16px); } }
.gd-weed { position: absolute; left: -10%; bottom: 3%; width: 62%; z-index: 2; pointer-events: none; }
.gd-weed img { width: 100%; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .2)); animation: gd-wiggle 1.4s ease-in-out infinite; }
.gd-weed.gd-pop { animation: gd-popin .5s cubic-bezier(.3, 1.6, .5, 1); }
.gd-pest { position: absolute; right: -14%; bottom: 18%; width: 56%; z-index: 3; pointer-events: none; }
.gd-pest.gd-pest-snail { right: -8%; bottom: 10%; width: 50%; }
.gd-pest img { width: 100%; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .2)); animation: gd-crawlbob 1s ease-in-out infinite alternate; }
.gd-pest.gd-crawl { animation: gd-crawl .9s ease-out; }
@keyframes gd-crawl { from { transform: translateX(90px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes gd-crawlbob { from { transform: translateY(0) scaleX(1); } to { transform: translateY(-4px) scaleX(1.05); } }
@keyframes gd-wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-7deg); } 75% { transform: rotate(7deg); } }
.gd-wiggle { animation: gd-wiggle .5s ease-in-out; }
.gd-shake { animation: gd-shake .4s ease-in-out; }
.gd-nudge { animation: gd-nudge .8s ease-in-out; }
@keyframes gd-nudge { 0%, 100% { transform: scale(1); } 30% { transform: scale(1.25); } 60% { transform: scale(1.1); } }
@keyframes gd-popin { 0% { transform: scale(0); } 100% { transform: scale(1); } }

/* decorations */
.gd-decos { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.gd-deco { position: absolute; pointer-events: auto; transition: transform .12s; }
.gd-deco img { width: 100%; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .18)); }
.gd-deco.gd-pop { animation: gd-popin .6s cubic-bezier(.3, 1.6, .5, 1); }
.gd-deco.gd-wiggle { animation: gd-wiggle .5s ease-in-out; }
/* the fence sticker sits in a square canvas (band at 31%–69%), so it is tiled as a strip behind the soil */
.gd-deco-fence { left: 50%; bottom: calc(3% + var(--sp) * .38 - var(--fh) * .31); width: min(86vw, calc(var(--sp) * 7.2)); height: var(--fh); transform: translateX(-50%); pointer-events: none; z-index: 4; background: url(../assets/img/gd_fence.png) center / auto 100% repeat-x; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .15)); }
.gd-deco-fence img { display: none; }
.gd-deco-gnome { left: 2.5%; bottom: 36%; width: clamp(60px, 13vh, 120px); }
.gd-deco-pond { right: 2%; bottom: 35%; width: clamp(100px, 20vh, 190px); }
.gd-deco-scarecrow { left: 24%; bottom: 40%; width: clamp(70px, 17vh, 140px); }
.gd-deco-birdhouse { right: 24%; bottom: 42%; width: clamp(60px, 14vh, 120px); }

/* effects */
.gd-fx { position: absolute; inset: 0; pointer-events: none; z-index: 14; overflow: hidden; }
.gd-visitor { position: absolute; left: 0; top: 0; width: clamp(70px, 13vh, 120px); pointer-events: auto; transition: transform 1.8s ease-out, opacity 1.2s; z-index: 14; }
.gd-visitor img { width: 100%; animation: gd-flutter 1.6s ease-in-out infinite alternate; filter: drop-shadow(0 5px 5px rgba(0, 0, 0, .18)); }
.gd-visitor.gd-bee img { animation: gd-buzz .5s ease-in-out infinite alternate; }
.gd-visitor.gd-leave { opacity: 0; pointer-events: none; }
@keyframes gd-flutter { from { transform: translateY(0) rotate(-6deg) scaleX(1); } to { transform: translateY(-14px) rotate(6deg) scaleX(.9); } }
@keyframes gd-buzz { from { transform: translate(0, 0); } to { transform: translate(6px, -8px); } }
.gd-fly { position: absolute; width: 40px; animation: gd-floatup 1.5s ease-out forwards; }
.gd-fly .ico { width: 100%; }
@keyframes gd-floatup { from { transform: translateY(0) scale(.6); opacity: 1; } to { transform: translateY(-180px) scale(1.2); opacity: 0; } }
.gd-starfly { position: absolute; width: 44px; animation: gd-tostar .9s ease-in forwards; }
.gd-starfly .ico { width: 100%; }
@keyframes gd-tostar { from { transform: translate(0, 0) scale(1.2); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) scale(.4); opacity: .3; } }
.gd-gone { position: absolute; animation: gd-gone 1s ease-in forwards; }
.gd-gone img { width: 100%; height: 100%; object-fit: contain; }
.gd-gone.gd-slide { animation: gd-slide 1s ease-in forwards; }
@keyframes gd-gone { to { transform: translateY(-140px) rotate(40deg); opacity: 0; } }
@keyframes gd-slide { to { transform: translateX(220px); opacity: 0; } }
.gd-picked { position: absolute; display: flex; align-items: flex-end; justify-content: center; animation: gd-pick 1.2s ease-in forwards; }
.gd-picked img { max-width: 100%; max-height: 100%; object-fit: contain; }
.gd-picked.gd-runoff { animation: gd-runoff 1.3s ease-in forwards; }
@keyframes gd-pick { to { transform: translateY(-45vh) scale(.5) rotate(20deg); opacity: 0; } }
@keyframes gd-runoff { 0% { transform: translate(0, 0); } 20% { transform: translate(12vw, -60px); } 40% { transform: translate(24vw, 0); } 60% { transform: translate(36vw, -60px); } 80% { transform: translate(48vw, 0); opacity: 1; } 100% { transform: translate(62vw, -50px); opacity: 0; } }

/* unlock announcement */
.gd-unlock { position: absolute; inset: 0; z-index: 40; display: grid; place-items: center; pointer-events: none; background: rgba(255, 255, 255, .22); }
.gd-unlock-card { width: clamp(200px, 44vh, 320px); aspect-ratio: 1; border-radius: 40px; background: #fff; border: 8px solid var(--yellow); box-shadow: var(--shadow); display: grid; place-items: center; animation: gd-card .6s cubic-bezier(.3, 1.6, .5, 1); }
.gd-unlock-card img { width: 80%; height: 80%; object-fit: contain; }
.gd-unlock.gd-unlock-scene .gd-unlock-card { width: min(60vw, 520px); aspect-ratio: 16 / 10; }
.gd-unlock.gd-unlock-scene .gd-unlock-card img { width: 92%; height: 88%; object-fit: cover; border-radius: 22px; }
@keyframes gd-card { 0% { transform: scale(0) rotate(-12deg); } 100% { transform: scale(1) rotate(0); } }

/* seed + garden picker */
.gd-panel .songs-panel { gap: 18px; }
.gd-seeds { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
.gd-seed-card { position: relative; aspect-ratio: 1; }
.gd-seed-card img { width: 82%; height: 82%; object-fit: contain; }
.gd-seed-card.active, .gd-scene-card.active { border-color: var(--yellow); box-shadow: 0 6px 0 #f4c20d; background: linear-gradient(180deg, #fff, #fff3b0); }
.gd-locked img { filter: grayscale(1); opacity: .35; }
.gd-price { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; padding: 2px 12px 2px 6px; border-radius: 20px; background: #fff; box-shadow: 0 3px 0 rgba(0, 0, 0, .12); font-size: 26px; line-height: 1.2; color: var(--ink); white-space: nowrap; }
.gd-price .ico { width: 30px; height: 30px; }
.gd-scenes { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }
.gd-scene-card { position: relative; width: clamp(150px, 26vw, 260px); aspect-ratio: 16 / 9; border-radius: 20px; overflow: hidden; border: 5px solid #ece4f6; background: #f6f0ff; box-shadow: 0 6px 0 rgba(120, 70, 140, .14); transition: transform .12s; }
.gd-scene-card:active, .gd-seed-card:active { transform: scale(.94); }
.gd-scene-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gd-scene-card.gd-locked::after, .gd-seed-card.gd-locked::after { content: ""; position: absolute; left: 50%; top: 42%; width: 34%; aspect-ratio: 1; transform: translate(-50%, -50%); background: url(../assets/img/ui_lock.png) center / contain no-repeat; opacity: .9; }
.gd-scene-card.gd-locked::after { width: 22%; }

/* portrait phones / tablets */
@media (orientation: portrait) {
  .gd, .gd[data-n="5"], .gd[data-n="6"] { --sp: clamp(76px, 27vw, 150px); }
  .gd-bed { bottom: 4%; gap: 3vw; padding: 0 2vw; }
  .gd-sun { left: 5%; top: 12%; width: clamp(80px, 22vw, 130px); }
  .gd-cloud { right: 4%; top: 11%; width: clamp(100px, 28vw, 170px); }
  .gd-can { left: 3%; bottom: auto; top: 34%; width: clamp(76px, 20vw, 120px); }
  .gd-deco-fence { bottom: calc(4% + var(--sp) * 2.1 - var(--fh) * .31); width: 96vw; --fh: clamp(80px, 12vh, 130px); }
  .gd-deco-gnome { left: auto; right: 4%; bottom: auto; top: 32%; }
  .gd-deco-pond { right: 4%; bottom: auto; top: 44%; width: clamp(90px, 26vw, 150px); }
  .gd-deco-scarecrow { left: 30%; bottom: auto; top: 30%; }
  .gd-deco-birdhouse { right: 32%; bottom: auto; top: 44%; }
  .gd-moon { right: 40%; }
}
