#pet-mount {position:relative;overflow:hidden;width:100%;height:300px;isolation:isolate;}
.panda-pet { position:absolute; z-index:1000; isolation:isolate; user-select:none; -webkit-user-select:none; --look-angle:0deg; --look-x:0px; --facing:1;pointer-events:auto; }
.panda-hitbox { position:absolute; inset:0; width:100%; height:100%; padding:0; border:0; border-radius:44% 44% 20% 20%; background:none; touch-action:none; cursor:grab; -webkit-tap-highlight-color:transparent; overflow:visible; }
.panda-hitbox:focus-visible {outline:2px dashed #858b70;outline-offset:10px;}
.panda-pet[data-state="drag"] .panda-hitbox {cursor:grabbing;}
.panda-sway,.panda-motion {display:block;position:absolute;inset:0;transform-origin:50% 100%;}
.panda-motion {transition:transform 420ms ease;}
.panda-pet[data-state="idle"] .panda-sway {animation:panda-sway var(--sway-duration,7s) ease-in-out infinite;}
.panda-pet[data-state="look"] .panda-motion {transform:translateX(var(--look-x)) rotate(var(--look-angle));}
.panda-images {position:absolute;left:var(--image-left);top:var(--image-top);width:var(--canvas-size);height:var(--canvas-size);pointer-events:none;transform:scaleX(var(--facing));}
.panda-images img,.panda-breath-canvas {position:absolute;inset:0;width:100%;height:100%;max-width:none;object-fit:contain;pointer-events:none;visibility:hidden;}
.panda-images img[data-kind="expression"] {
  /* Keep the master body, ears, tuft and head silhouette perfectly stationary.
     Only the AI-authored face is overlaid. Both masks are fully opaque over
     eyes/brows/mouth; feathering is confined to unchanged surrounding fur. */
  -webkit-mask-image:linear-gradient(to right,transparent 28%,#000 32%,#000 68%,transparent 72%),linear-gradient(to bottom,transparent 16%,#000 19%,#000 47%,transparent 51%);
  mask-image:linear-gradient(to right,transparent 28%,#000 32%,#000 68%,transparent 72%),linear-gradient(to bottom,transparent 16%,#000 19%,#000 47%,transparent 51%);
  -webkit-mask-composite:source-in;
  mask-composite:intersect;
}
.panda-shadow {position:absolute;bottom:-2px;left:8%;width:84%;height:9px;border-radius:50%;background:#544e3b17;filter:blur(4px);pointer-events:none;}
.panda-images img[data-frame="blink_half"],.panda-images img[data-frame="closed"] {
  mask-image:radial-gradient(ellipse 8% 6% at 39.6% 33.2%,#000 70%,transparent 100%),radial-gradient(ellipse 8% 6% at 62.1% 33.2%,#000 70%,transparent 100%);
  -webkit-mask-composite:source-over;mask-composite:add;
}
.panda-bubble {position:absolute;bottom:calc(100% + 16px);left:50%;transform:translateX(-50%);min-width:46px;padding:9px 13px;border:1px solid #e5e2d9;border-radius:17px 17px 17px 4px;background:#fffefa;color:#56564c;font:500 16px/1.3 system-ui,sans-serif;white-space:nowrap;box-shadow:0 4px 16px #38382d08;pointer-events:none;}
.panda-pet[data-state="nod_off"] .panda-bubble {font-style:italic;letter-spacing:2px;}
.panda-pet[data-state="happy"] .panda-bubble {color:#a97867;}
.panda-sparkles {position:absolute;inset:-10px -25px;pointer-events:none;visibility:hidden;color:#a98f5b;}
.panda-sparkles span {position:absolute;top:25%;left:0;font-size:22px;}
.panda-sparkles span:nth-child(2) {left:auto;right:-5px;top:8%;font-size:17px;color:#b7897c;}
.panda-sparkles span:nth-child(3) {left:auto;right:0;top:55%;font-size:14px;}
.panda-pet[data-state="happy"] .panda-sparkles {visibility:visible;animation:sparkle var(--happy-duration,2400ms) ease-out both;}
.panda-pet[data-paused="true"] * {animation-play-state:paused!important;}
.panda-pet[data-reduced="true"] .panda-sway,.panda-pet[data-reduced="true"] .panda-sparkles {animation:none!important;}
.panda-pet[data-reduced="true"] .panda-motion {transform:none!important;transition:none;}
@keyframes panda-sway {0%,100%{transform:rotate(-.35deg) translateX(-.5px)}50%{transform:rotate(.35deg) translateX(.5px)}}
@keyframes sparkle {0%{opacity:0;transform:translateY(4px)}25%,65%{opacity:1}100%{opacity:0;transform:translateY(-10px)}}
@media(prefers-reduced-motion:reduce){.panda-pet *{animation:none!important;transition:none!important;}}
.panda-butt-hitbox {position:absolute;left:-32%;width:63%;top:59%;bottom:-1%;background:none;border:0;border-radius:50%;cursor:pointer;touch-action:manipulation;}
.panda-pet[data-edge="left"] .panda-butt-hitbox {left:auto;right:-32%;}
.panda-butt-hitbox:focus-visible {outline:2px dashed #858b70;outline-offset:3px;}
.panda-pet[data-sleeping="true"] .panda-hitbox,.panda-pet[data-waking="true"] .panda-hitbox {pointer-events:none;}
.panda-pet[data-state="hidden_sleep"] .panda-motion {animation:butt-breath var(--sleep-duration,4.4s) ease-in-out infinite;}
.panda-pet[data-state="hidden_sleep"] .panda-bubble,.panda-pet[data-state="butt_pat_react"] .panda-bubble {bottom:58%;left:5%;font-size:12px;}
.panda-pet[data-edge="left"][data-state="hidden_sleep"] .panda-bubble {left:95%;}
.panda-pet[data-state="walk_away"] .panda-motion {animation:walk-bob var(--walk-duration,1.2s) linear infinite;}
@keyframes butt-breath {0%,100%{transform:scale(1)}45%{transform:scale(1.012,1.008)}}
@keyframes walk-bob {0%,50%,100%{transform:translateY(0)}17%,67%{transform:translateY(1px) rotate(.2deg)}34%,84%{transform:translateY(-1px) rotate(-.2deg)}}
.panda-pet[data-reduced="true"] .panda-motion {animation:none!important;}
