:root {
    --sky: #c9f3ff;
    --leaf: #168f49;
    --leaf-dark: #0c6137;
    --grass: #0f8f4d;
    --trunk: #8a4b26;
    --line: #304238;
    --purple: #7d3aac;
    --gold: #b79a43;
    --green: #74c042;
    --mint: #22c982;
    --orange: #f0782b;
    --yellow: #f6df30;
    --red: #df4740;
    --blue: #25a9d9;
    --speed: 1;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    overflow: hidden;
    color: #17342a;
    font-family: Arial, Helvetica, sans-serif;
    background: linear-gradient(#b9efff 0%, #e7fff1 64%, #4baa51 64%);
    transition: background 0.45s ease;
}

body.scene-moon {
    background:
        radial-gradient(circle at 70% 18%, rgba(162, 219, 255, 0.3), transparent 18%),
        linear-gradient(#101a42 0%, #18255a 56%, #5c6279 56%, #343848 100%);
}

body.scene-factory {
    background:
        linear-gradient(#bdf4ff 0%, #e8fff5 50%, #76b95a 50%, #377b3c 100%);
}

.stage {
    position: relative;
    min-height: 100vh;
    isolation: isolate;
}

.sky {
    position: absolute;
    inset: 0 0 auto;
    height: 42vh;
}

.sun {
    position: absolute;
    top: 7vh;
    right: clamp(22px, 8vw, 120px);
    width: clamp(96px, 15vw, 160px);
    aspect-ratio: 1;
    border: 10px solid #f5da28;
    border-radius: 50%;
    background: repeating-radial-gradient(circle, transparent 0 13px, #f5da28 14px 22px);
    box-shadow: 0 0 0 18px rgba(245, 218, 40, 0.13);
    animation: spin calc(14s / var(--speed)) linear infinite;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.sun::before {
    content: "";
    position: absolute;
    inset: -34px;
    background: repeating-conic-gradient(from 4deg, #f5da28 0 5deg, transparent 5deg 23deg);
    border-radius: 50%;
    z-index: -1;
}

.cloud-title {
    position: absolute;
    top: clamp(16px, 5vh, 46px);
    left: clamp(18px, 7vw, 110px);
    width: min(560px, 64vw);
    min-height: 128px;
    padding: 28px 42px;
    border: 8px solid var(--purple);
    border-radius: 60px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 18px 18px 0 -10px rgba(125, 58, 172, 0.22);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.cloud-title::before,
.cloud-title::after {
    content: "";
    position: absolute;
    background: rgba(255, 255, 255, 0.72);
    border: 8px solid var(--purple);
    border-top: 0;
    border-left: 0;
    border-radius: 0 0 44px 44px;
}

.cloud-title::before {
    left: 52px;
    bottom: -38px;
    width: 80px;
    height: 48px;
}

.cloud-title::after {
    right: 92px;
    bottom: -30px;
    width: 112px;
    height: 42px;
}

h1,
h2,
p {
    margin: 0;
}

.cloud-title h1 {
    color: #008a57;
    font-size: clamp(2.4rem, 6vw, 5rem);
    line-height: 0.9;
    letter-spacing: 0;
}

.cloud-title p {
    margin-top: 8px;
    color: #328c9d;
    font-size: clamp(1.1rem, 2.3vw, 1.8rem);
    font-weight: 700;
}

.forest-scene {
    position: absolute;
    inset: 25vh 0 0;
    overflow: hidden;
}

.moon-scene {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.factory-scene {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.eco-factory {
    position: absolute;
    left: clamp(20px, 8vw, 120px);
    bottom: clamp(170px, 25vh, 260px);
    width: clamp(250px, 32vw, 390px);
    height: 240px;
}

.factory-roof {
    position: absolute;
    left: -7%;
    top: 0;
    display: grid;
    place-items: center;
    width: 114%;
    height: 104px;
    padding-top: 18px;
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
    color: #fff;
    font-weight: 900;
    font-size: clamp(1.9rem, 3.4vw, 3rem);
    letter-spacing: 0;
    background: #008a57;
    overflow: visible;
    z-index: 2;
}

.factory-roof span {
    transform: translateY(18px);
    text-shadow: 0 3px 0 rgba(0, 0, 0, 0.12);
}

.roof-solar {
    position: absolute;
    right: 28px;
    bottom: 14px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    width: 78px;
    height: 24px;
    padding: 3px;
    border: 3px solid #173d63;
    border-radius: 5px;
    background: #173d63;
    transform: rotate(-8deg);
}

.roof-solar i {
    display: block;
    background: #63c8ff;
}

.factory-building {
    position: absolute;
    left: 8%;
    bottom: 0;
    width: 84%;
    height: 150px;
    border: 4px solid #416144;
    border-radius: 8px 8px 2px 2px;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.2) 0 8px, transparent 8px 24px),
        linear-gradient(#e7d9a2, #c5a962);
}

.factory-window {
    position: absolute;
    top: 28px;
    width: 42px;
    height: 34px;
    border: 3px solid #416144;
    border-radius: 6px;
    background: #93e4ff;
}

.factory-window:nth-child(1) {
    left: 32px;
}

.factory-window:nth-child(2) {
    right: 32px;
}

.factory-door {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 48px;
    height: 68px;
    border-radius: 8px 8px 0 0;
    background: #73512b;
    transform: translateX(-50%);
}

.factory-chimney {
    position: absolute;
    right: 7%;
    top: 102px;
    width: 36px;
    height: 74px;
    border-radius: 8px 8px 0 0;
    background: #5f8f47;
}

.factory-chimney span {
    position: absolute;
    left: 50%;
    bottom: 100%;
    width: 18px;
    height: 24px;
    border-radius: 50% 50% 50% 0;
    background: #3aaa5f;
    transform: rotate(-45deg);
    animation: leafSpin 2.4s ease-in-out infinite;
}

.factory-chimney span:nth-child(2) {
    animation-delay: 0.45s;
}

.factory-chimney span:nth-child(3) {
    animation-delay: 0.9s;
}

.factory-solar {
    position: absolute;
    left: 18%;
    top: 92px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3px;
    width: 82px;
    height: 36px;
    padding: 4px;
    border: 3px solid #263f5d;
    border-radius: 5px;
    background: #1a3152;
    transform: rotate(-8deg);
}

.factory-solar span {
    background: #51b9ff;
}

.tomato-field {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 3vh;
    display: flex;
    justify-content: space-around;
    align-items: end;
    height: 230px;
    padding: 0 5vw;
    z-index: 4;
}

.tomato-field span {
    position: relative;
    width: 20px;
    height: 135px;
    border-radius: 12px 12px 0 0;
    background: #137842;
}

.tomato-field span::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 22px;
    width: 122px;
    height: 98px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 24% 45%, #de3431 0 14px, transparent 15px),
        radial-gradient(circle at 55% 30%, #f04a35 0 15px, transparent 16px),
        radial-gradient(circle at 72% 58%, #d92e2e 0 13px, transparent 14px),
        radial-gradient(circle at 44% 64%, #f04a35 0 14px, transparent 15px),
        radial-gradient(circle at 35% 22%, #d92e2e 0 10px, transparent 11px),
        #2fa75f;
    transform: translateX(-50%);
}

.tomato-horizon {
    position: absolute;
    left: -2vw;
    right: -2vw;
    bottom: clamp(190px, 28vh, 280px);
    display: flex;
    justify-content: space-around;
    align-items: end;
    height: 96px;
    opacity: 0.88;
}

.tomato-horizon span {
    position: relative;
    width: 10px;
    height: 58px;
    border-radius: 10px 10px 0 0;
    background: #217b43;
}

.tomato-horizon span::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 10px;
    width: 58px;
    height: 42px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 45%, #d9362f 0 7px, transparent 8px),
        radial-gradient(circle at 62% 35%, #f04a35 0 7px, transparent 8px),
        radial-gradient(circle at 52% 66%, #d9362f 0 6px, transparent 7px),
        #39a461;
    transform: translateX(-50%);
}

.tractor {
    position: absolute;
    left: clamp(210px, 31vw, 470px);
    bottom: clamp(130px, 18vh, 190px);
    width: 150px;
    height: 84px;
    z-index: 3;
}

.tractor-body {
    position: absolute;
    left: 24px;
    bottom: 22px;
    width: 90px;
    height: 38px;
    border: 4px solid #23422e;
    border-radius: 8px;
    background: #2e9c45;
}

.tractor-cabin {
    position: absolute;
    left: 66px;
    bottom: 58px;
    width: 48px;
    height: 38px;
    border: 4px solid #23422e;
    border-radius: 7px 7px 0 0;
    background: #94e6ff;
}

.tractor-wheel {
    position: absolute;
    bottom: 0;
    border: 6px solid #202820;
    border-radius: 50%;
    background: #5c5c5c;
    box-shadow: inset 0 0 0 6px #c6c27a;
}

.wheel-big {
    left: 24px;
    width: 52px;
    height: 52px;
}

.wheel-small {
    right: 8px;
    width: 38px;
    height: 38px;
}

.refill-station {
    position: absolute;
    right: clamp(28px, 12vw, 170px);
    bottom: clamp(205px, 30vh, 290px);
    width: 190px;
    height: 130px;
    color: #275137;
    font-weight: 900;
}

.refill-station strong {
    position: absolute;
    left: 0;
    top: 0;
    padding: 8px 10px;
    border: 3px solid #275137;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.76);
}

.refill-hose {
    position: absolute;
    width: 140px;
    height: 80px;
    border: 8px solid transparent;
    border-bottom-color: #6a4c28;
    border-radius: 0 0 80px 80px;
}

.hose-a {
    left: 10px;
    top: 36px;
    transform: rotate(18deg);
}

.hose-b {
    left: 30px;
    top: 58px;
    border-bottom-color: #198f4f;
    transform: rotate(8deg);
}

.refill-particle {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #704619;
    animation: refillFlow 1.2s ease-in-out infinite;
}

.particle-a {
    right: 48px;
    bottom: 16px;
}

.particle-b {
    right: 76px;
    bottom: 30px;
    background: #e04332;
    animation-delay: 0.25s;
}

.particle-c {
    right: 104px;
    bottom: 44px;
    animation-delay: 0.5s;
}

.lunar-surface {
    position: absolute;
    left: -12vw;
    right: -12vw;
    bottom: -14vh;
    height: 36vh;
    border-radius: 50% 50% 0 0;
    background:
        radial-gradient(ellipse at 24% 34%, rgba(67, 72, 91, 0.46) 0 5%, transparent 5.4%),
        radial-gradient(ellipse at 62% 26%, rgba(67, 72, 91, 0.42) 0 4%, transparent 4.4%),
        radial-gradient(ellipse at 78% 48%, rgba(67, 72, 91, 0.38) 0 6%, transparent 6.5%),
        linear-gradient(#b6bccb, #777d91 72%, #5d6375);
    box-shadow: inset 0 24px 42px rgba(255, 255, 255, 0.28);
}

.crater {
    position: absolute;
    border-radius: 50%;
    background: rgba(71, 78, 96, 0.36);
    box-shadow: inset 7px 9px 9px rgba(37, 42, 58, 0.34), 5px 4px 0 rgba(255, 255, 255, 0.16);
}

.crater-a {
    left: 18%;
    top: 38%;
    width: 90px;
    height: 28px;
}

.crater-b {
    left: 48%;
    top: 24%;
    width: 130px;
    height: 40px;
}

.crater-c {
    right: 18%;
    top: 45%;
    width: 74px;
    height: 24px;
}

.apollo-module {
    position: absolute;
    left: clamp(38px, 12vw, 170px);
    bottom: clamp(118px, 18vh, 185px);
    width: 130px;
    height: 126px;
    filter: drop-shadow(0 12px 8px rgba(0, 0, 0, 0.28));
}

.module-body {
    position: absolute;
    left: 32px;
    top: 22px;
    width: 66px;
    height: 62px;
    clip-path: polygon(22% 0, 78% 0, 100% 100%, 0 100%);
    background: linear-gradient(135deg, #e9d38a, #b88c33 56%, #6d5427);
    border: 3px solid #f7ecba;
}

.module-window {
    position: absolute;
    left: 21px;
    top: 16px;
    width: 24px;
    height: 18px;
    border-radius: 50%;
    background: #162753;
    box-shadow: inset 0 0 0 3px #82d9ff;
}

.module-leg,
.module-antenna {
    position: absolute;
    background: #d7c690;
    transform-origin: top center;
}

.module-leg {
    width: 5px;
    height: 60px;
    top: 70px;
}

.leg-a {
    left: 35px;
    transform: rotate(28deg);
}

.leg-b {
    left: 92px;
    transform: rotate(-28deg);
}

.leg-c {
    left: 48px;
    height: 48px;
    transform: rotate(-14deg);
}

.leg-d {
    left: 80px;
    height: 48px;
    transform: rotate(14deg);
}

.module-leg::after {
    content: "";
    position: absolute;
    left: -13px;
    bottom: -4px;
    width: 32px;
    height: 8px;
    border-radius: 50%;
    background: #d7c690;
}

.module-antenna {
    left: 64px;
    top: 2px;
    width: 4px;
    height: 28px;
}

.module-antenna::before {
    content: "";
    position: absolute;
    left: -14px;
    top: -10px;
    width: 32px;
    height: 18px;
    border: 3px solid #d7c690;
    border-radius: 50%;
    transform: rotate(-15deg);
}

.star {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f4fbff;
    box-shadow: 0 0 14px #f4fbff;
    animation: twinkle 1.8s ease-in-out infinite;
}

.star-a {
    top: 10%;
    left: 14%;
}

.star-b {
    top: 22%;
    left: 38%;
    animation-delay: 0.4s;
}

.star-c {
    top: 8%;
    right: 18%;
    animation-delay: 0.7s;
}

.star-d {
    top: 36%;
    right: 34%;
    animation-delay: 1s;
}

.moon {
    position: absolute;
    right: clamp(28px, 10vw, 150px);
    bottom: clamp(160px, 24vh, 250px);
    width: clamp(140px, 20vw, 220px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff 0 12%, #d9deeb 13% 100%);
    box-shadow: 0 0 42px rgba(235, 246, 255, 0.72);
}

.moon span {
    position: absolute;
    border-radius: 50%;
    background: rgba(110, 117, 139, 0.28);
}

.moon span:nth-child(1) {
    width: 24%;
    height: 24%;
    left: 24%;
    top: 36%;
}

.moon span:nth-child(2) {
    width: 17%;
    height: 17%;
    right: 24%;
    top: 24%;
}

.moon span:nth-child(3) {
    width: 12%;
    height: 12%;
    right: 34%;
    bottom: 26%;
}

.lunar-water {
    position: absolute;
    right: clamp(58px, 13vw, 190px);
    bottom: clamp(125px, 18vh, 190px);
    display: grid;
    justify-items: center;
    gap: 4px;
    color: #dff7ff;
    font-size: 0.9rem;
    font-weight: 800;
    text-shadow: 0 2px 8px #0a1235;
    z-index: 2;
}

.lunar-water span {
    width: 18px;
    height: 28px;
    border-radius: 50% 50% 50% 0;
    background: #4fd6ff;
    box-shadow: 0 0 18px #4fd6ff;
    transform: rotate(-45deg);
    animation: lunarDrop 1.4s ease-in-out infinite;
}

.lunar-water span:nth-child(3) {
    animation-delay: 0.25s;
}

.lunar-water span:nth-child(4) {
    animation-delay: 0.5s;
}

.flight-path {
    position: absolute;
    left: 33%;
    bottom: 34%;
    width: 36vw;
    max-width: 480px;
    height: 120px;
    border-top: 5px dashed rgba(102, 220, 255, 0.6);
    border-radius: 50%;
    transform: rotate(-12deg);
}

body.scene-moon .moon-scene {
    opacity: 1;
}

body.scene-factory .factory-scene {
    opacity: 1;
}

body.scene-moon .sun,
body.scene-moon .forest,
body.scene-moon .grass,
body.scene-factory .forest {
    opacity: 0;
}

body.scene-moon .cloud-title {
    border-color: #66dcff;
    background: rgba(14, 24, 64, 0.74);
}

body.scene-moon .cloud-title h1 {
    color: #8ff4ff;
}

body.scene-moon .cloud-title p {
    color: #dff7ff;
}

body.scene-factory .cloud-title {
    border-color: #008a57;
    background: rgba(255, 255, 255, 0.82);
}

body.scene-factory .watering-can,
body.scene-factory .watering-spout,
body.scene-factory .watering-head,
body.scene-factory .drops,
body.scene-factory .collect-drops {
    opacity: 0;
}

body.scene-factory .right-arm {
    animation: refillArm 1.8s ease-in-out infinite;
}

.forest {
    position: absolute;
    left: -10vw;
    right: -10vw;
    bottom: 12vh;
    display: flex;
    justify-content: space-around;
    align-items: end;
    pointer-events: none;
}

.forest-back {
    opacity: 0.65;
    transform: scale(0.82);
    transform-origin: bottom center;
    animation: driftBack calc(18s / var(--speed)) linear infinite;
}

.forest-front {
    bottom: 5vh;
    animation: driftFront calc(10s / var(--speed)) linear infinite;
}

.forest span {
    position: relative;
    width: 46px;
    height: 180px;
    background: var(--trunk);
    border-radius: 18px 18px 2px 2px;
}

.forest span::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 86px;
    width: 150px;
    height: 154px;
    transform: translateX(-50%);
    background:
        radial-gradient(circle at 35% 34%, var(--leaf) 0 9px, transparent 10px),
        radial-gradient(circle at 60% 40%, var(--leaf) 0 9px, transparent 10px),
        radial-gradient(circle at 50% 58%, var(--leaf) 0 9px, transparent 10px),
        linear-gradient(145deg, transparent 0 18%, var(--leaf-dark) 18% 24%, transparent 24% 35%, var(--leaf-dark) 35% 41%, transparent 41%),
        conic-gradient(from 135deg at 50% 10%, transparent 0 25%, var(--leaf) 0 75%, transparent 0);
    clip-path: polygon(50% 0, 96% 36%, 76% 36%, 100% 63%, 75% 63%, 96% 100%, 4% 100%, 25% 63%, 0 63%, 24% 36%, 4% 36%);
}

.forest span:nth-child(even)::before {
    width: 122px;
    height: 138px;
    border-radius: 46% 54% 48% 52%;
    clip-path: none;
}

.grass {
    position: absolute;
    left: -5vw;
    right: -5vw;
    bottom: 0;
    height: 18vh;
    background:
        repeating-linear-gradient(74deg, transparent 0 17px, rgba(3, 111, 53, 0.85) 18px 24px, transparent 25px 38px),
        linear-gradient(#23a750, #0e7f3a);
    clip-path: polygon(0 32%, 2% 0, 4% 38%, 6% 8%, 8% 45%, 11% 0, 13% 42%, 15% 8%, 17% 48%, 20% 4%, 22% 44%, 25% 0, 28% 44%, 31% 8%, 34% 46%, 38% 0, 41% 42%, 44% 8%, 47% 48%, 51% 0, 54% 45%, 57% 8%, 60% 44%, 64% 0, 67% 40%, 70% 10%, 73% 48%, 77% 0, 80% 42%, 84% 8%, 87% 44%, 91% 0, 94% 40%, 97% 8%, 100% 44%, 100% 100%, 0 100%);
    z-index: 5;
}

.speech-bubble {
    position: absolute;
    left: calc(50% - 230px);
    bottom: 56vh;
    z-index: 6;
    max-width: min(300px, 72vw);
    padding: 12px 16px;
    border: 4px solid var(--purple);
    border-radius: 8px;
    color: #17342a;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.9);
    opacity: 0;
    transform: translateY(12px) scale(0.96);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.speech-bubble::after {
    content: "";
    position: absolute;
    right: 34px;
    bottom: -18px;
    width: 28px;
    height: 28px;
    border-right: 4px solid var(--purple);
    border-bottom: 4px solid var(--purple);
    background: rgba(255, 255, 255, 0.9);
    transform: rotate(45deg);
}

.speech-bubble.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.robot {
    position: absolute;
    left: 50%;
    bottom: 10vh;
    width: min(37vw, 340px);
    min-width: 230px;
    overflow: visible;
    transform-origin: bottom center;
    animation: robotWalk calc(2.8s / var(--speed)) ease-in-out infinite;
    z-index: 4;
}

body.scene-moon .robot {
    animation: moonFlight calc(4s / var(--speed)) ease-in-out infinite;
}

.robot * {
    vector-effect: non-scaling-stroke;
}

.antenna line,
.antenna circle,
.signal-waves path,
.space-helmet circle,
.space-helmet path,
.head path,
.head rect,
.head circle,
.arm path,
.body path,
.pocket-refill path,
.pocket-refill circle,
.solar-panel rect,
.solar-panel path,
.oxygen-tank rect,
.oxygen-tank path,
.tank rect,
.tank circle,
.leg ellipse,
.watering-can,
.watering-spout,
.watering-head,
.drops path,
.collect-drops path {
    stroke: var(--line);
    stroke-width: 5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.antenna line {
    stroke: #565656;
}

.signal-waves path {
    fill: none;
    stroke: #328c9d;
    opacity: 0;
    animation: transmitSignal 1.8s ease-out infinite;
}

.signal-waves path:nth-child(2) {
    animation-delay: 0.2s;
}

.signal-waves path:nth-child(3) {
    animation-delay: 0.45s;
}

.signal-waves path:nth-child(4) {
    animation-delay: 0.65s;
}

.antenna circle,
.ear,
.watering-can {
    fill: var(--red);
}

.head-left {
    fill: var(--yellow);
}

.space-helmet,
.oxygen-tank {
    opacity: 0;
    transition: opacity 0.25s ease;
}

.space-helmet circle {
    fill: rgba(220, 248, 255, 0.3);
    stroke: rgba(172, 235, 255, 0.95);
    stroke-width: 7;
}

.space-helmet path {
    fill: none;
    stroke: rgba(255, 255, 255, 0.8);
    stroke-width: 4;
}

.oxygen-tank rect {
    fill: #d8eef5;
    stroke: #6aa4b3;
}

.oxygen-tank path {
    fill: none;
    stroke: #6aa4b3;
    stroke-width: 4;
}

body.scene-moon .space-helmet,
body.scene-moon .oxygen-tank {
    opacity: 1;
}

.head-right {
    fill: var(--orange);
}

.eye {
    fill: #ff9d2e;
}

.pupil {
    fill: #2c2319;
}

.nose,
.tooth,
.happy-mouth,
.happy-mouth-front {
    fill: none;
}

.mouth,
.tooth,
.happy-mouth,
.happy-mouth-front {
    stroke: #08794e;
    stroke-width: 8;
}

.happy-mouth {
    display: none;
}

.happy-mouth-front {
    opacity: 0;
    pointer-events: none;
}

body.action-smile .mouth,
body.action-smile .tooth {
    opacity: 0;
}

body.action-smile .happy-mouth-front {
    opacity: 1;
    animation: bigSmile 1.6s ease-in-out;
}

.arm path {
    fill: none;
    stroke: #858585;
    stroke-width: 12;
}

.left-arm {
    transform-origin: 102px 210px;
    animation: leftArm calc(2.8s / var(--speed)) ease-in-out infinite;
}

.right-arm {
    transform-origin: 256px 210px;
    animation: rightArm calc(2.8s / var(--speed)) ease-in-out infinite;
}

.torso-base {
    fill: var(--mint);
}

.purple-a,
.purple-b {
    fill: #7b27a8;
}

.gold {
    fill: var(--gold);
}

.green-a {
    fill: var(--green);
}

.green-b {
    fill: #21bd72;
}

.solar-panel rect {
    fill: #173d63;
    stroke: #dff7ff;
    stroke-width: 4;
}

.solar-panel path {
    fill: none;
    stroke: #7ed9ff;
    stroke-width: 2;
}

.tank rect {
    fill: rgba(105, 63, 32, 0.74);
}

.tank circle {
    fill: #72421d;
    stroke: none;
}

.pocket-refill {
    opacity: 0;
    pointer-events: none;
}

.refill-line {
    fill: none;
    stroke-width: 6;
    stroke-dasharray: 10 10;
}

.fertilizer-line {
    stroke: #704619;
}

.vitamin-line {
    stroke: #e04332;
}

.refill-dot {
    stroke: none;
    opacity: 0;
}

.fertilizer-dot {
    fill: #704619;
}

.vitamin-dot {
    fill: #e04332;
}

body.scene-factory .pocket-refill {
    opacity: 1;
}

body.scene-factory .fertilizer-line,
body.scene-factory .vitamin-line {
    animation: refillDash 0.75s linear infinite;
}

body.scene-factory .refill-dot {
    animation: pocketRefill 1.2s ease-in-out infinite;
}

body.scene-factory .vitamin-line,
body.scene-factory .vitamin-dot {
    opacity: 0;
    animation: none;
}

body.scene-factory .dot-b {
    animation-delay: 0.22s;
}

body.scene-factory .dot-c {
    animation-delay: 0.44s;
}

.watering-spout {
    fill: none;
}

.watering-head {
    fill: #19a457;
}

.drops path,
.collect-drops path {
    fill: var(--blue);
    stroke: none;
}

.drops path {
    animation: dropFall calc(1.4s / var(--speed)) ease-in infinite;
}

.collect-drops path {
    opacity: 0;
}

.fertilizer-cloud circle {
    fill: #7a4a18;
    opacity: 0;
    stroke: none;
}

body.action-water .right-arm {
    animation: waterWave 1.5s ease-in-out;
}

body.action-water .drops path {
    animation: activeDrop 0.55s ease-in infinite;
}

body.scene-moon .drops path {
    opacity: 0;
    animation: none;
}

body.scene-moon .watering-can {
    fill: #4f87aa;
}

body.scene-moon .right-arm {
    animation: collectArm 1.8s ease-in-out infinite;
}

body.scene-moon .collect-drops path {
    animation: collectDrop 1.1s ease-in infinite;
}

body.scene-moon .collect-drops path:nth-child(2) {
    animation-delay: 0.18s;
}

body.scene-moon .collect-drops path:nth-child(3) {
    animation-delay: 0.36s;
}

body.action-fertilize .fertilizer {
    animation: tankPulse 1.5s ease-in-out;
}

body.scene-factory .fertilizer {
    animation: tankPulse 1.5s ease-in-out infinite;
}

body.scene-factory .fertilizer-cloud circle {
    opacity: 0;
    animation: none;
}

body.scene-factory .solar-panel {
    animation: solarGlow 1.8s ease-in-out infinite;
}

body.action-fertilize .fertilizer-cloud circle {
    animation: fertilizerSpread 1.4s ease-out;
}

body.action-greet .left-arm {
    animation: greetingWave 1.4s ease-in-out;
}

.drops path:nth-child(2) {
    animation-delay: 0.2s;
}

.drops path:nth-child(3) {
    animation-delay: 0.4s;
}

.leg {
    transform-box: fill-box;
    transform-origin: top center;
}

.leg ellipse {
    fill: var(--blue);
}

.right-leg ellipse:nth-child(even) {
    fill: var(--red);
}

.left-leg {
    animation: stepLeft calc(1.4s / var(--speed)) ease-in-out infinite;
}

.right-leg {
    animation: stepRight calc(1.4s / var(--speed)) ease-in-out infinite;
}

.panel {
    position: absolute;
    right: clamp(12px, 3vw, 36px);
    bottom: clamp(12px, 4vh, 40px);
    z-index: 7;
    display: grid;
    grid-template-columns: minmax(250px, 340px);
    gap: 14px;
    width: min(360px, calc(100vw - 24px));
    padding: 16px;
    border: 3px solid rgba(23, 52, 42, 0.16);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(8px);
}

.panel h2 {
    margin-bottom: 10px;
    color: #008a57;
    font-size: 1.2rem;
}

.panel ul {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.panel li {
    display: grid;
    gap: 2px;
    padding-left: 12px;
    border-left: 5px solid #f5da28;
}

.panel li.is-active {
    border-left-color: #23a750;
}

.panel strong {
    font-size: 0.92rem;
}

.panel span {
    font-size: 0.83rem;
}

.controls {
    display: flex;
    align-items: center;
    gap: 14px;
}

.geo-consent {
    display: grid;
    gap: 10px;
    padding: 10px;
    border: 2px solid rgba(0, 138, 87, 0.26);
    border-radius: 8px;
    background: rgba(232, 255, 245, 0.92);
}

.geo-consent[hidden] {
    display: none;
}

.geo-consent p {
    color: #21453a;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.25;
}

.geo-consent div {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.geo-consent button:last-child {
    background: #244469;
}

.action-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.scene-panel {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.credits {
    padding-top: 6px;
    border-top: 1px solid rgba(23, 52, 42, 0.16);
    color: #3b5e52;
    font-size: 0.78rem;
    font-weight: 700;
}

button {
    min-width: 0;
    min-height: 38px;
    padding: 0 10px;
    border: 0;
    border-radius: 6px;
    color: white;
    font-size: 0.82rem;
    font-weight: 700;
    background: #008a57;
    cursor: pointer;
}

.action-panel button:nth-child(3) {
    background: #8b6524;
}

.action-panel button:nth-child(4) {
    background: #1685ad;
}

.action-panel button:nth-child(n + 5) {
    background: #7d3aac;
}

.voice-toggle {
    background: #244469;
}

.scene-panel button {
    background: #244469;
}

.scene-panel button.is-selected {
    background: #008a57;
    box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.34);
}

label {
    display: grid;
    gap: 4px;
    width: 100%;
    font-size: 0.82rem;
    font-weight: 700;
}

input {
    width: 100%;
    accent-color: #008a57;
}

body.is-paused *,
body.is-paused *::before,
body.is-paused *::after {
    animation-play-state: paused !important;
}

@keyframes robotWalk {
    0%,
    100% {
        transform: translateX(-50%) translateY(0) rotate(-1deg);
    }
    50% {
        transform: translateX(-50%) translateY(-12px) rotate(1deg);
    }
}

@keyframes moonFlight {
    0%,
    100% {
        transform: translateX(-72%) translateY(18px) rotate(-8deg) scale(0.88);
    }
    50% {
        transform: translateX(-12%) translateY(-58px) rotate(8deg) scale(0.82);
    }
}

@keyframes leafSpin {
    0% {
        transform: translate(-50%, 0) rotate(-45deg) scale(0.8);
        opacity: 0.35;
    }
    50% {
        transform: translate(-50%, -16px) rotate(25deg) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, 0) rotate(-45deg) scale(0.8);
        opacity: 0.35;
    }
}

@keyframes refillArm {
    0%,
    100% {
        transform: rotate(4deg);
    }
    50% {
        transform: rotate(16deg);
    }
}

@keyframes refillFlow {
    0%,
    100% {
        transform: translate(0, 0) scale(0.75);
        opacity: 0;
    }
    35% {
        opacity: 1;
    }
    70% {
        transform: translate(-62px, 44px) scale(1.1);
        opacity: 1;
    }
}

@keyframes refillDash {
    to {
        stroke-dashoffset: -20;
    }
}

@keyframes pocketRefill {
    0%,
    100% {
        opacity: 0;
        transform: scale(0.7);
    }
    35%,
    75% {
        opacity: 1;
        transform: scale(1.08);
    }
}

@keyframes solarGlow {
    0%,
    100% {
        filter: drop-shadow(0 0 0 rgba(126, 217, 255, 0));
    }
    50% {
        filter: drop-shadow(0 0 10px rgba(126, 217, 255, 0.95));
    }
}

@keyframes stepLeft {
    0%,
    100% {
        transform: rotate(7deg) translateY(0);
    }
    50% {
        transform: rotate(-9deg) translateY(-8px);
    }
}

@keyframes stepRight {
    0%,
    100% {
        transform: rotate(-9deg) translateY(-8px);
    }
    50% {
        transform: rotate(7deg) translateY(0);
    }
}

@keyframes leftArm {
    0%,
    100% {
        transform: rotate(12deg);
    }
    50% {
        transform: rotate(-8deg);
    }
}

@keyframes rightArm {
    0%,
    100% {
        transform: rotate(-7deg);
    }
    50% {
        transform: rotate(9deg);
    }
}

@keyframes dropFall {
    0% {
        transform: translateY(-10px);
        opacity: 0;
    }
    30%,
    70% {
        opacity: 1;
    }
    100% {
        transform: translateY(18px);
        opacity: 0;
    }
}

@keyframes activeDrop {
    0% {
        transform: translateY(-14px) scale(0.9);
        opacity: 0;
    }
    20%,
    80% {
        opacity: 1;
    }
    100% {
        transform: translateY(42px) scale(1.15);
        opacity: 0;
    }
}

@keyframes collectDrop {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0;
    }
    25%,
    70% {
        opacity: 1;
    }
    100% {
        transform: translateY(-58px) scale(0.72);
        opacity: 0;
    }
}

@keyframes collectArm {
    0%,
    100% {
        transform: rotate(18deg);
    }
    50% {
        transform: rotate(30deg);
    }
}

@keyframes bigSmile {
    0%,
    100% {
        transform: scaleY(1);
    }
    45% {
        transform: scaleY(1.25);
    }
}

@keyframes tankPulse {
    0%,
    100% {
        transform: scale(1);
    }
    45% {
        transform: scale(1.08);
    }
}

@keyframes fertilizerSpread {
    0% {
        transform: translate(0, 0) scale(0.5);
        opacity: 0;
    }
    25% {
        opacity: 1;
    }
    100% {
        transform: translate(32px, 46px) scale(1.4);
        opacity: 0;
    }
}

@keyframes waterWave {
    0%,
    100% {
        transform: rotate(-7deg);
    }
    35% {
        transform: rotate(18deg);
    }
    70% {
        transform: rotate(4deg);
    }
}

@keyframes greetingWave {
    0%,
    100% {
        transform: rotate(12deg);
    }
    25% {
        transform: rotate(-42deg);
    }
    50% {
        transform: rotate(-8deg);
    }
    75% {
        transform: rotate(-38deg);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes twinkle {
    0%,
    100% {
        transform: scale(0.7);
        opacity: 0.45;
    }
    50% {
        transform: scale(1.3);
        opacity: 1;
    }
}

@keyframes lunarDrop {
    0%,
    100% {
        transform: rotate(-45deg) translateY(0) scale(0.82);
    }
    50% {
        transform: rotate(-45deg) translateY(-12px) scale(1);
    }
}

@keyframes transmitSignal {
    0% {
        opacity: 0;
        stroke-width: 2;
        transform: scale(0.94);
    }
    35% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        stroke-width: 5;
        transform: scale(1.14);
    }
}

@keyframes driftBack {
    to {
        transform: translateX(-120px) scale(0.82);
    }
}

@keyframes driftFront {
    to {
        transform: translateX(-180px);
    }
}

@media (max-width: 760px) {
    body {
        overflow: auto;
    }

    .stage {
        min-height: 920px;
    }

    .cloud-title {
        width: calc(100vw - 32px);
        padding: 20px 28px;
    }

    .sun {
        top: 180px;
        right: 24px;
        width: 86px;
        border-width: 7px;
    }

    .forest-scene {
        inset: 31vh 0 0;
    }

    .robot {
        width: 270px;
        bottom: 210px;
    }

    .panel {
        left: 12px;
        right: 12px;
        bottom: 14px;
        width: auto;
    }

    .speech-bubble {
        left: 18px;
        bottom: 560px;
    }

    .forest-front {
        bottom: 170px;
    }

    .forest-back {
        bottom: 235px;
    }

    .grass {
        height: 210px;
    }
}

@media (min-width: 761px) and (max-width: 1100px) {
    .cloud-title {
        width: min(520px, 58vw);
    }

    .robot {
        width: min(42vw, 320px);
        bottom: 14vh;
    }

    .panel {
        width: min(330px, 36vw);
    }
}

@media (max-width: 430px) {
    .stage {
        min-height: 980px;
    }

    .cloud-title h1 {
        font-size: 2.25rem;
    }

    .cloud-title p {
        font-size: 1rem;
    }

    .robot {
        width: 238px;
        min-width: 238px;
        bottom: 260px;
    }

    .panel {
        padding: 12px;
    }

    .action-panel {
        grid-template-columns: 1fr;
    }

    .scene-panel {
        grid-template-columns: 1fr;
    }

    .speech-bubble {
        bottom: 610px;
    }

    .moon {
        right: 18px;
        bottom: 535px;
        width: 118px;
    }

    .apollo-module {
        left: 18px;
        bottom: 496px;
        transform: scale(0.72);
        transform-origin: bottom left;
    }

    .lunar-surface {
        bottom: 430px;
        height: 130px;
    }

    .lunar-water {
        right: 42px;
        bottom: 500px;
    }

    .flight-path {
        left: 10%;
        bottom: 62%;
        width: 68vw;
    }

    .eco-factory {
        left: 12px;
        bottom: 506px;
        width: 198px;
        transform: scale(0.84);
        transform-origin: bottom left;
    }

    .tomato-field {
        bottom: 420px;
        height: 132px;
    }

    .tomato-field span {
        width: 14px;
        height: 82px;
    }

    .tomato-field span::before {
        width: 72px;
        height: 56px;
    }

    .tomato-horizon {
        bottom: 555px;
    }

    .tractor {
        left: 122px;
        bottom: 486px;
        transform: scale(0.68);
        transform-origin: bottom left;
    }

    .refill-station {
        right: 12px;
        bottom: 540px;
        transform: scale(0.76);
        transform-origin: bottom right;
    }
}

@media (max-width: 760px) {
    body {
        overflow-x: hidden;
        overflow-y: auto;
    }

    .stage {
        display: flex;
        flex-direction: column;
        min-height: auto;
        padding-bottom: 16px;
    }

    .sky {
        position: relative;
        height: 145px;
        flex: 0 0 auto;
    }

    .cloud-title {
        top: 14px;
        left: 12px;
        width: calc(100vw - 24px);
        min-height: 106px;
        padding: 20px 28px;
        border-width: 6px;
        border-radius: 44px;
    }

    .cloud-title::before {
        left: 80px;
        bottom: -30px;
        width: 64px;
        height: 36px;
        border-width: 6px;
    }

    .cloud-title::after {
        right: 110px;
        bottom: -26px;
        width: 82px;
        height: 34px;
        border-width: 6px;
    }

    .cloud-title h1 {
        font-size: clamp(2.35rem, 12vw, 3.45rem);
    }

    .cloud-title p {
        font-size: 1rem;
    }

    .sun {
        top: 86px;
        right: -8px;
        width: 92px;
        border-width: 7px;
    }

    .forest-scene {
        position: relative;
        inset: auto;
        height: min(58svh, 460px);
        min-height: 390px;
        flex: 0 0 auto;
    }

    .robot {
        width: min(62vw, 260px);
        min-width: 220px;
        bottom: 72px;
    }

    .forest-front {
        bottom: 34px;
    }

    .forest-back {
        bottom: 110px;
    }

    .grass {
        height: 86px;
    }

    .speech-bubble {
        left: 12px;
        bottom: 14px;
        max-width: calc(100vw - 24px);
        padding: 10px 12px;
        font-size: 0.86rem;
    }

    .panel {
        position: relative;
        left: auto;
        right: auto;
        bottom: auto;
        width: calc(100vw - 20px);
        margin: 8px 10px 0;
        padding: 12px;
        gap: 10px;
        grid-template-columns: 1fr;
        flex: 0 0 auto;
        max-height: none;
    }

    .panel h2 {
        margin-bottom: 8px;
        font-size: 1.05rem;
    }

    .panel ul {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px 10px;
    }

    .panel li {
        min-height: 54px;
        padding-left: 8px;
        border-left-width: 4px;
    }

    .panel strong {
        font-size: 0.78rem;
        line-height: 1.12;
    }

    .panel span {
        font-size: 0.7rem;
        line-height: 1.18;
    }

    .controls {
        display: grid;
        grid-template-columns: 86px minmax(0, 1fr);
        gap: 10px;
    }

    .action-panel,
    .scene-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    button {
        min-height: 42px;
        padding: 0 8px;
        font-size: 0.78rem;
    }

    .credits {
        font-size: 0.72rem;
        line-height: 1.25;
    }

    .moon {
        right: 18px;
        bottom: 148px;
        width: 112px;
    }

    .apollo-module {
        left: 18px;
        bottom: 122px;
        transform: scale(0.62);
        transform-origin: bottom left;
    }

    .lunar-surface {
        bottom: -22px;
        height: 132px;
    }

    .lunar-water {
        right: 36px;
        bottom: 114px;
        font-size: 0.72rem;
    }

    .flight-path {
        left: 18%;
        bottom: 42%;
        width: 58vw;
    }

    .eco-factory {
        left: 8px;
        bottom: 132px;
        width: 198px;
        transform: scale(0.74);
        transform-origin: bottom left;
    }

    .tomato-field {
        bottom: 30px;
        height: 128px;
        padding: 0 22px;
    }

    .tomato-field span {
        width: 14px;
        height: 82px;
    }

    .tomato-field span::before {
        width: 72px;
        height: 56px;
    }

    .tomato-horizon {
        bottom: 180px;
    }

    .tractor {
        left: 142px;
        bottom: 112px;
        transform: scale(0.56);
        transform-origin: bottom left;
    }

    .refill-station {
        right: 2px;
        bottom: 170px;
        transform: scale(0.62);
        transform-origin: bottom right;
    }
}

@media (max-width: 380px) {
    .forest-scene {
        height: 372px;
        min-height: 372px;
    }

    .robot {
        width: 218px;
        min-width: 218px;
        bottom: 62px;
    }

    .panel ul {
        grid-template-columns: 1fr;
    }

    .action-panel,
    .scene-panel {
        grid-template-columns: 1fr;
    }
}

.auth-bar {
    position: fixed;
    top: 10px;
    right: 12px;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: calc(100vw - 24px);
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(8px);
    font-size: 0.78rem;
    font-weight: 800;
}

.auth-bar a {
    color: #008a57;
    text-decoration: none;
}

.panel-toggle {
    display: none;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    min-height: 40px;
    background: #244469;
}

.panel-arrow {
    font-size: 1.2rem;
    line-height: 1;
}

.vitamin-sign {
    position: absolute;
    left: calc(100% + 18px);
    top: 88px;
    display: grid;
    place-items: center;
    width: 190px;
    min-height: 58px;
    padding: 8px 10px;
    border: 3px solid #e04332;
    border-radius: 8px;
    color: #8a1d16;
    font-size: 0.86rem;
    font-weight: 900;
    line-height: 1.12;
    text-align: center;
    background: rgba(255, 255, 255, 0.86);
}

.vitamin-sign::before,
.vitamin-sign::after {
    content: "";
    position: absolute;
    bottom: -42px;
    width: 8px;
    height: 42px;
    border-radius: 4px;
    background: #704619;
}

.vitamin-sign::before {
    left: 24px;
}

.vitamin-sign::after {
    right: 24px;
}

.soil-source {
    position: absolute;
    right: 0;
    bottom: -10px;
    padding: 6px 8px;
    border-radius: 8px;
    color: #fff;
    font-size: 0.72rem;
    background: #704619;
}

body.scene-factory .fertilizer-line {
    stroke-width: 9;
    filter: drop-shadow(0 0 6px rgba(112, 70, 25, 0.52));
}

body.scene-factory .fertilizer-dot {
    filter: drop-shadow(0 0 5px rgba(112, 70, 25, 0.68));
}

@media (max-width: 760px) {
    .auth-bar {
        position: relative;
        top: auto;
        right: auto;
        order: -2;
        margin: 8px 10px 0;
        justify-content: center;
    }

    .sky {
        order: -1;
    }

    .forest-scene {
        order: 0;
    }

    .panel {
        order: 1;
        margin-top: 10px;
    }

    .panel-toggle {
        display: flex;
    }

    body.panel-collapsed .panel-content {
        display: none;
    }

    body.panel-collapsed .panel-arrow {
        transform: rotate(180deg);
    }

    body.panel-collapsed .panel {
        position: sticky;
        bottom: 8px;
        z-index: 15;
    }

    .factory-roof {
        left: -9%;
        width: 118%;
        height: 82px;
        font-size: 1.45rem;
        text-align: center;
        padding: 0 8px;
    }

    .factory-roof span {
        transform: translateY(13px);
    }

    .roof-solar {
        right: 18px;
        bottom: 8px;
        width: 58px;
        height: 20px;
    }

    .vitamin-sign {
        left: 106px;
        top: 138px;
        width: 150px;
        min-height: 46px;
        font-size: 0.62rem;
    }
}
