.garden-stage[data-template=christmas] {
    background: radial-gradient(ellipse at 20% 12%, #e5fff1a8, transparent 48%),
        linear-gradient(180deg, #80b9c9, #c5e5eb 65%, #edf8f1);
    border-color: #a1cdd4;
}
.garden-stage[data-template=apricot] {
    background: radial-gradient(ellipse at 20% 12%, #fff4b5b3, transparent 48%),
        linear-gradient(180deg, #f7d4aa, #fff0cd 58%, #e7edb9);
    border-color: #ead09f;
}
.garden-stage[data-template=sakura] {
    background: radial-gradient(ellipse at 75% 16%, #fff3d7a6, transparent 48%),
        linear-gradient(180deg, #f5cfdf, #fbe6e8 55%, #eee8bf);
    border-color: #e6bfcf;
}
html[data-garden-mode=night] .garden-stage[data-template=christmas] {
    background: radial-gradient(ellipse at 30% 30%, #5ee5cf19, transparent 50%),
        linear-gradient(180deg, #152e4d, #305775 62%, #8cb8c1);
}
html[data-garden-mode=night] .garden-stage[data-template=apricot] {
    background: radial-gradient(ellipse at 15% 60%, #eab25933, transparent 55%),
        linear-gradient(180deg, #433657, #7d596e 60%, #b18c85);
}
html[data-garden-mode=night] .garden-stage[data-template=sakura] {
    background: radial-gradient(ellipse at 78% 20%, #ffc5da22, transparent 45%),
        linear-gradient(180deg, #413658, #77557e 58%, #b8889c);
}
.garden-stage[data-template=christmas] .stage-hills {
    background: linear-gradient(180deg, #eaf6f0a8, #fffefa);
    box-shadow: 0 -20px 0 #f2ffff70;
}
html[data-garden-mode=night] .garden-stage[data-template=christmas] .stage-hills {
    background: linear-gradient(180deg, #b7dce1a6, #d4eef1);
    box-shadow: 0 -18px 0 #c5e9f157;
}
.garden-stage[data-template=apricot] .stage-hills,
.garden-stage[data-template=sakura] .stage-hills {
    background: linear-gradient(180deg, #d7dca57a, #d3dca1);
    box-shadow: 0 -17px 0 #e9e4b34d;
}
html[data-garden-mode=night] .garden-stage:is([data-template=apricot],[data-template=sakura]) .stage-hills {
    background: linear-gradient(180deg, #9eac8a70, #8ba38f);
}
.season-weather {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 2;
}
.season-weather i {
    position: absolute;
    top: -30px;
    left: var(--x);
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 5px #ffffff70;
    opacity: .85;
    animation: garden-snowfall var(--fall) linear var(--delay) infinite;
}
.season-weather i:nth-child(3n) { opacity: .5; filter: blur(.5px); }
.season-weather i:nth-child(4n) { width: 3px; height: 3px; }
.weather-apricot i, .weather-sakura i {
    width: calc(var(--size) + 2px);
    height: calc(var(--size) + 4px);
    border-radius: 70% 20% 65% 35%;
    background: #ffe16a;
    box-shadow: 0 0 4px #ffe6aa35;
    animation-name: garden-petalfall;
    opacity: .8;
}
.weather-sakura i { background: #ffd3e4; box-shadow: 0 0 4px #fff2f570; }
.weather-apricot i:nth-child(2n) { background: #ffedaa; }
.weather-sakura i:nth-child(2n) { background: #fff0f6; }
.weather-apricot i:nth-child(n+25), .weather-sakura i:nth-child(n+25) { display: none; }
.festive-lanterns { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.festive-lanterns span {
    position: absolute;
    top: 13%;
    left: 7%;
    width: 36px;
    height: 44px;
    border: 2px solid #f3ce7f;
    border-radius: 43%;
    background: repeating-linear-gradient(90deg, transparent 0 8px, #ffc77233 9px 10px),
        radial-gradient(ellipse at 35% 30%, #ffb27e, #ed716b 60%, #d55b63);
    box-shadow: 0 0 20px #ffd79938;
    rotate: -7deg;
    animation: garden-lantern-sway 7s ease-in-out infinite alternate;
}
.festive-lanterns span:nth-child(2) { left: auto; right: 5%; top: 31%; scale: .75; animation-delay: -3s; }
.festive-lanterns span::before { content: ''; position: absolute; left: 50%; bottom: 100%; width: 1px; height: 110px; background: #d5b58280; }
.festive-lanterns span::after { content: ''; position: absolute; left: 44%; top: 100%; height: 22px; width: 4px; background: linear-gradient(#eab35d, #ffc982); border-radius: 0 0 3px 3px; }
.garden-template-card[data-template=christmas] { border-color: #b5d5d7; background: #f2fbf9; }
.garden-template-card[data-template=apricot] { border-color: #edd89e; background: #fff9e9; }
.garden-template-card[data-template=sakura] { border-color: #efc7d8; background: #fff3f8; }
.dialog-open .season-weather i, .dialog-open .festive-lanterns span { animation-play-state: paused; }
@keyframes garden-snowfall {
    from { transform: translate(0, 0); }
    to { transform: translate(var(--drift), calc(100vh + 50px)); }
}
@keyframes garden-petalfall {
    0% { transform: translate(0, 0) rotate(0); }
    45% { transform: translate(calc(var(--drift) + 35px), 45vh) rotate(160deg); }
    100% { transform: translate(var(--drift), calc(100vh + 50px)) rotate(370deg); }
}
@keyframes garden-lantern-sway { to { rotate: 7deg; } }
@media(max-width:800px) {
    .season-weather i:nth-child(n+25) { display: none; }
    .weather-apricot i:nth-child(n+17), .weather-sakura i:nth-child(n+17) { display: none; }
    .festive-lanterns span { scale: .7; left: 5%; }
    .festive-lanterns span:nth-child(2) { scale: .55; right: 4%; }
}
@media(prefers-reduced-motion:reduce) {
    .season-weather { display: none; }
    .festive-lanterns span { animation: none; }
}

/* Painted scenery behind the transparent, rotatable 3D tree. */
.garden-stage { position: relative; isolation: isolate; }
.garden-stage::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: var(--garden-scenery) center var(--scenery-y, 100%) / cover no-repeat; transition: filter .6s; }
.garden-stage[data-template] { background: #a3c8c6; --garden-scenery: url('../images/garden/scenery/spring.webp'); }
.garden-stage:is([data-template=dream], [data-template=sakura]) { --garden-scenery: url('../images/garden/scenery/twilight.webp'); }
.garden-stage[data-template=christmas] { --garden-scenery: url('../images/garden/scenery/winter.webp'); }
html[data-garden-mode=night] .garden-stage[data-template] { background: #313c64; }
html[data-garden-mode=night] .garden-stage::before { filter: brightness(.68) saturate(1.12) hue-rotate(8deg); }
html[data-garden-mode=night] .garden-stage:is([data-template=christmas], [data-template=dream], [data-template=sakura])::before { filter: brightness(.88) saturate(1.1); }
.garden-stage .stage-hills, .garden-stage .scene-cloud { display: none; }
.garden-stage:is([data-template=christmas], [data-template=dream], [data-template=sakura]) .scene-sun,
.garden-stage:is([data-template=dream], [data-template=sakura]) .scene-moon { display: none; }
.garden-stage .sky-glow { mix-blend-mode: screen; }

/* Celestial bodies are anchored to the sky, independent of tree/camera controls. */
.garden-stage .scene-sun, .garden-stage .scene-moon {
    position: absolute; z-index: 0; top: clamp(18px, 8%, 70px);
    right: clamp(20px, 8%, 120px); bottom: auto; left: auto;
    margin: 0; transform: none; translate: none; rotate: none;
    pointer-events: none;
}
/* The twilight painting already contains its moon; never add a duplicate. */
html[data-garden-mode] .garden-stage:is([data-template=dream], [data-template=sakura]) .scene-moon { display: none; }
.canopy-shimmer { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.canopy-shimmer i { position: absolute; left: var(--glint-x); top: var(--glint-y); width: 4px; height: 4px; border-radius: 50%; opacity: 0; background: #fffce2; box-shadow: 0 0 5px 2px #fff2be88, 0 0 13px 4px #ffeaa333; animation: canopy-glint var(--glint-duration) ease-in-out var(--glint-delay) infinite; }
.canopy-shimmer i:nth-child(3n)::before, .canopy-shimmer i:nth-child(3n)::after { content: ''; position: absolute; top: 50%; left: 50%; width: 12px; height: 1px; transform: translate(-50%, -50%); background: linear-gradient(90deg, transparent, #fff9d7, transparent); }
.canopy-shimmer i:nth-child(3n)::after { transform: translate(-50%, -50%) rotate(90deg); }
.canopy-shimmer i:nth-child(2n) { width: 2px; height: 2px; background: #fff8e6; }
.dialog-open .canopy-shimmer i, .scene-paused .canopy-shimmer i { animation-play-state: paused; }
@keyframes canopy-glint { 0%, 35%, 100% { opacity: 0; transform: translateY(5px) scale(.45); } 52% { opacity: .85; transform: translateY(0) scale(1); } 72% { opacity: 0; transform: translateY(-6px) scale(.5); } }
@media(prefers-reduced-motion:reduce) { .canopy-shimmer { display: none; } }
@media(max-width:800px) { .canopy-shimmer i:nth-child(n+15) { display: none; } }

@media(orientation:landscape) and (max-height:600px) {
    .garden-stage .scene-sun, .garden-stage .scene-moon { width: 28px; height: 28px; top: 6%; }
}
