/* Articulated motion: the floor and torso remain grounded. */
.scene:not(.editing) .pet-object>svg,.simple-pet>svg,.companion-wave svg,.pet-object.is-delighted>svg{animation:none!important}
[data-expression] .pet-body{animation:none!important;transform:none;rotate:none;translate:none;scale:none}
.pet-head{transform-box:view-box;transform-origin:151px 179px;transition:rotate .65s cubic-bezier(.2,.7,.2,1)}
[data-expression=curious] .pet-head{rotate:-5deg}[data-expression=listen] .pet-head{rotate:4deg}
[data-expression=wave] .pet-head{animation:head-nod 1.8s ease-in-out 2}
[data-expression=hug] .pet-head,[data-expression=love] .pet-head{rotate:3deg}
.pet-svg .bear-arm,.pet-svg .cat-arm{transform-box:view-box;transform:none;rotate:0deg;transition:rotate .55s cubic-bezier(.2,.8,.2,1)}
.pet-svg .bear-arm-left,.pet-svg .cat-arm-left{transform-origin:93px 183px}
.pet-svg .bear-arm-right,.pet-svg .cat-arm-right{transform-origin:209px 183px}
.scene:not(.editing) .pet-svg .bear-arm-right{animation:none}
[data-expression=wave] .pet-svg .bear-arm-right,[data-expression=wave] .pet-svg .cat-arm-right,[data-expression=proud] .pet-svg .bear-arm-right{animation:hand-wave 1.6s ease-in-out 2}
[data-expression=play] .pet-svg .cat-arm-right,.care-stage[data-care-action=play] .cat-arm-right{animation:hand-reach 1.5s ease-in-out infinite}
[data-expression=catch] .pet-svg .bear-arm-left,[data-expression=catch] .pet-svg .cat-arm-left{rotate:-60deg}
[data-expression=catch] .pet-svg .bear-arm-right,[data-expression=catch] .pet-svg .cat-arm-right{rotate:60deg}
[data-expression=hug] .pet-svg .bear-arm-left,[data-expression=hug] .pet-svg .cat-arm-left{rotate:-35deg;animation:none}
[data-expression=hug] .pet-svg .bear-arm-right,[data-expression=hug] .pet-svg .cat-arm-right{rotate:35deg;animation:none}
[data-expression=catch] .wolf-paw-right,[data-expression=catch] .robot-arm-right{rotate:-25deg;transition:rotate .35s}
[data-expression=catch] .dragon-wing{animation:habitat-wing .8s ease-in-out 1}
[data-expression=catch] .plant-leaf{animation:plant-sway 1s ease-in-out 1}
.expression-mouth>*{display:none}.pet-eyes{transition:transform .45s ease,scale .45s ease;transform-box:fill-box;transform-origin:center}
:is([data-expression=happy],[data-expression=proud],[data-expression=play],[data-expression=catch],[data-expression=listen],[data-expression=calm],[data-expression=hug],[data-expression=love]) .pet-mouth{display:none}
:is([data-expression=happy],[data-expression=proud],[data-expression=play]) .mouth-joy{display:block}
[data-expression=catch] .mouth-surprise{display:block}[data-expression=catch] .pet-eyes{scale:1.12;animation:none}
:is([data-expression=listen],[data-expression=calm],[data-expression=hug],[data-expression=love]) .mouth-soft{display:block}
:is([data-expression=hug],[data-expression=happy],[data-expression=love]) .pet-cheeks{opacity:.9;transition:opacity .6s}
@keyframes hand-wave{0%,100%{rotate:0deg}25%,65%{rotate:-110deg}45%,80%{rotate:-85deg}}
@keyframes hand-reach{0%,100%{rotate:0deg}45%{rotate:-58deg}65%{rotate:-45deg}}
@keyframes head-nod{0%,100%{rotate:0deg}40%{rotate:-4deg}70%{rotate:3deg}}
.encounter-stage{position:relative;height:300px;max-width:420px;margin:auto;border-radius:28px;background:radial-gradient(ellipse at 50% 40%,#fff6dc,#dfeedd);overflow:hidden;touch-action:none;user-select:none}
.encounter-pet{position:absolute;left:50%;top:7%;width:240px;height:240px;translate:-50% 0}.encounter-pet svg{width:100%;height:100%}
.encounter-ground{position:absolute;bottom:-35px;left:-10%;width:120%;height:105px;border-radius:50%;background:#b6d1a2}
.encounter-ball{position:absolute;left:calc(50% - 25px);bottom:13px;width:50px;height:50px;min-height:50px;border:3px solid #b56e39;border-radius:50%;background:#f7c479;box-shadow:0 5px 0 #6c7c4730;color:#a55e3e;font-size:36px;line-height:1;cursor:pointer;z-index:2}
.encounter-ball:disabled{opacity:1}
.encounter-trail{position:absolute;top:25%;right:18%;font-size:36px;color:#d99d40;opacity:0}
@keyframes catch-spark{40%,65%{opacity:1;scale:1.3}0%,100%{opacity:0;scale:.5}}
.encounter-hearts{position:absolute;bottom:12px;inset-inline:0;text-align:center;font-size:32px;color:#b55769;letter-spacing:12px;transition:color .4s}
.encounter-count{text-align:center;font-weight:650;min-height:30px;margin:14px 0;color:#405e4c}.encounter-instruction{font-size:15px!important;line-height:1.6}
.encounter-stage~.button{margin-bottom:10px}.encounter-stage~[hidden]{display:none!important}
.try-now{background:linear-gradient(120deg,#f4e8c9,#e6f0df);border:1px solid #d8dfc6;border-radius:24px;padding:22px;margin:18px 0}.try-now h2{margin:0}.try-now p{margin:8px 0 16px}.try-now .choice-row{gap:10px;align-items:stretch}.try-now .button{white-space:normal;text-align:start;line-height:1.5}
.guided-companion{width:150px;height:150px;margin:0 auto}.guided-companion svg{width:100%;height:100%}.concrete-instruction{padding:20px;background:#edf3e4;border-radius:20px;font-size:21px!important;line-height:1.55!important}.concrete-help{padding:18px;border-left:4px solid #7f9c71;background:#edf3e4;border-radius:12px;font-size:15px;line-height:1.65}
.firefly-friend{position:absolute;width:145px;height:145px;left:calc(50% - 72px);top:24%;pointer-events:none}.firefly-friend svg{width:100%;height:100%}.firefly.awake{box-shadow:0 0 24px #f9d67488;background:#ffefb4;color:#765a1e}
@media(max-width:600px){.try-now{padding:16px}.try-now .choice-row{display:grid}.encounter-stage{height:280px}.encounter-pet{width:225px;height:225px}.concrete-instruction{font-size:18px!important;padding:16px}}
.reduced-motion .encounter-stage *,.reduced-motion .pet-svg *{animation:none!important;transition:none!important}
@media(prefers-reduced-motion:reduce){.encounter-stage *,.pet-svg *{animation:none!important;transition:none!important}}

.encounter-stage { isolation: isolate; touch-action: pan-y; }
.encounter-stage[data-mode="hug"] .encounter-pet,.encounter-ball { touch-action: none; }
.encounter-stage[data-mode="hug"] .encounter-pet { cursor: grab; }
.encounter-stage[data-touching] .encounter-pet,.encounter-stage[data-aiming] .encounter-ball { cursor: grabbing; }
.encounter-floor { position: absolute; inset: auto 14% -14px; height: 78px; border-radius: 50%; background: #ecd9a3a6; border: 2px solid #fffae0ae; pointer-events: none; }
.encounter-ball {
  border: 1px solid #94572d;
  background: radial-gradient(circle at 32% 25%, #fff3ca 0, #ffe19d 16%, #f2b56d 48%, #bd6b42 95%);
  box-shadow: inset -6px -6px 12px #9140153d,0 5px 12px #344e3a33;
  cursor: grab;
  overflow: hidden;
}
.encounter-ball > span { display:block; position:absolute; width:110%; height:62%; left:-13%; top:-17%; border:2px solid #98582e9c; border-radius:50%; rotate:-37deg; pointer-events:none; }
.encounter-stage[data-aiming] .encounter-ball { transform: translate(var(--aim-x,0px),var(--aim-y,0px)); }
.encounter-stage :is(.encounter-pet,.encounter-ball) { -webkit-user-select: none; }
.encounter-pet.encounter-pet-grounded { top:auto; bottom:22px; }
.encounter-pet-grounded.has-refuge-pet .refuge-pet-model { width:min(100%,calc(var(--refuge-size) * 1.65)); }
.encounter-stage:is([data-aiming],[data-touching]) .encounter-pet .pet-head { rotate: var(--touch-tilt,0deg); transition: rotate .15s ease-out; }
.encounter-stage[data-phase="outbound"] .pet-head { rotate:var(--touch-tilt,0deg); }
.encounter-stage[data-phase="return"] .pet-head { rotate:calc(var(--touch-tilt,0deg) * -.55); }
.encounter-stage:is([data-touching],[data-aiming],[data-phase="outbound"]) .pet-eyes { translate:var(--gaze-x,0px) 0; }
.encounter-touch { position:absolute; display:none; left:var(--touch-x); top:var(--touch-y); width:64px; height:64px; transform:translate(-50%,-50%); border-radius:50%; background:radial-gradient(circle,#fff5cebf, #efc3b34d 52%, transparent 70%); box-shadow:0 0 18px #ffefaf77; pointer-events:none; z-index:3; }
.encounter-stage[data-touching] .encounter-touch { display:block; }
.encounter-stage.is-throwing .encounter-ball { animation: encounter-pass 1.45s linear both; }
.encounter-stage .encounter-trail { left:50%; right:auto; top:44%; z-index:3; pointer-events:none; }
.encounter-stage.is-throwing .encounter-trail { animation: catch-spark 1.45s ease both; }
.encounter-dialogue { max-width:420px; width:fit-content; margin:10px auto 0; padding:8px 14px; background:#f4f0e2; border:1px solid #e0d7bb; border-radius:14px; color:#385846; text-align:center; line-height:1.4; font-size:14px; }
.encounter-count { margin:7px 0 10px; }
@keyframes encounter-pass {
  0% { transform:translate(var(--aim-x),var(--aim-y)) scale(1) rotate(0); }
  28% { transform:translate(var(--flight-side),var(--flight-lift)) scale(.73) rotate(-105deg); }
  46%,54% { transform:translate(0,var(--catch-y)) scale(.62) rotate(-178deg); }
  77% { transform:translate(calc(var(--flight-side) * -.75),calc(var(--flight-lift) * .73)) scale(.79) rotate(92deg); }
  93% { transform:translate(3px,3px) scale(1.02,.9) rotate(20deg); }
  100% { transform:translate(0,0) scale(1) rotate(0); }
}
