#robotPet{
  position:fixed;
  left:0;
  top:0;
  width:96px;
  height:116px;
  z-index:9990;
  cursor:grab;
  user-select:none;
  -webkit-user-select:none;
  touch-action:none;
  filter:drop-shadow(0 6px 16px rgba(0,162,255,.25));
  will-change:transform;
}
#robotPet.robot-dragging{ cursor:grabbing; }
#robotPet.robot-dragging .robot-body{ animation:none; }

/* Body: gentle up/down bob while walking (one bob per step) */
.robot-body{ width:100%; height:100%; transform-origin:center bottom; }
.robot-body.robot-walking{ animation:robotBob .44s ease-in-out infinite; }
@keyframes robotBob{
  0%,100%{ transform:translateY(0); }
  25%{ transform:translateY(-3px); }
  50%{ transform:translateY(0); }
  75%{ transform:translateY(-3px); }
}

/* Legs: clear alternating stride (pivot from the hip) */
.robot-leg{ transform-box:fill-box; transform-origin:top center; }
.robot-walking .robot-leg-l{ animation:legSwing .44s ease-in-out infinite; }
.robot-walking .robot-leg-r{ animation:legSwing .44s ease-in-out infinite -.22s; }
@keyframes legSwing{
  0%{ transform:rotate(24deg); }
  50%{ transform:rotate(-24deg); }
  100%{ transform:rotate(24deg); }
}

/* Arms swing opposite to legs for a natural gait */
.robot-arm{ transform-box:fill-box; transform-origin:top center; }
.robot-walking .robot-arm-l{ animation:legSwing .44s ease-in-out infinite -.22s; }
.robot-walking .robot-arm-r{ animation:legSwing .44s ease-in-out infinite; }

/* Landing impact: squash then spring back up (fell & gets up) */
.robot-fx.robot-impact{ animation:robotImpact .82s cubic-bezier(.3,1.4,.5,1); }
@keyframes robotImpact{
  0%{ transform:translateY(0) scale(1,1); }
  18%{ transform:translateY(4px) scale(1.25,.7); }   /* hard landing squash */
  45%{ transform:translateY(-12px) scale(.9,1.12); }  /* spring up */
  68%{ transform:translateY(0) scale(1.08,.94); }
  100%{ transform:translateY(0) scale(1,1); }
}

/* Click reactions (on isolated fx layer so JS positioning is untouched) */
.robot-fx{ width:100%; height:100%; transform-origin:center bottom; }
.robot-fx.robot-jump{ animation:robotJump .6s ease; }
@keyframes robotJump{ 0%,100%{ transform:translateY(0); } 35%{ transform:translateY(-26px); } }
.robot-fx.robot-spin{ animation:robotSpin .7s ease; }
@keyframes robotSpin{ from{ transform:rotateY(0); } to{ transform:rotateY(360deg); } }

/* Blink + antenna */
.robot-eye-group{ animation:robotBlink 4s ease-in-out infinite; transform-origin:center; }
@keyframes robotBlink{ 0%,92%,100%{ transform:scaleY(1); } 96%{ transform:scaleY(.1); } }
.robot-antenna-tip{ animation:robotGlow 2s ease-in-out infinite; }
@keyframes robotGlow{ 0%,100%{ opacity:.5; } 50%{ opacity:1; } }
.robot-arm-r{ transform-origin:top center; }

/* Speech bubble */
.robot-bubble{
  position:absolute;
  left:50%;
  bottom:100%;
  margin-bottom:10px;
  transform:translate(-50%, 6px);
  background:#0b1323;
  border:1px solid rgba(0,162,255,.35);
  color:#f7fbff;
  font-family:var(--ds-font-family);
  font-size:12px;
  font-weight:500;
  padding:8px 13px;
  border-radius:12px;
  width:max-content;
  max-width:200px;
  text-align:center;
  line-height:1.45;
  opacity:0;
  pointer-events:none;
  transition:opacity .25s ease, transform .25s ease;
  z-index:3;
}
.robot-bubble::after{
  content:"";
  position:absolute;
  left:50%;
  bottom:-5px;
  transform:translateX(-50%) rotate(45deg);
  width:9px;height:9px;
  background:#0b1323;
  border-right:1px solid rgba(0,162,255,.35);
  border-bottom:1px solid rgba(0,162,255,.35);
}
#robotPet.robot-talking .robot-bubble{ opacity:1; transform:translate(-50%, 0); }

/* Close button */
.robot-close{
  position:absolute;
  top:-4px;right:-4px;
  width:20px;height:20px;
  border-radius:50%;
  background:#0b1323;
  border:1px solid rgba(255,255,255,.2);
  color:rgba(255,255,255,.7);
  font-size:12px;line-height:1;
  display:none;
  align-items:center;justify-content:center;
  cursor:pointer;
  z-index:4;
}
#robotPet:hover .robot-close{ display:flex; }
.robot-close:hover{ color:#fff;border-color:rgba(0,162,255,.6); }
#robotPet.robot-docked .robot-close{ display:none !important; }

/* Perched pose: leaning on the chatbot with an arm resting on it */
#robotPet.robot-docked .robot-body{ animation:none; transform:rotate(-9deg); }
#robotPet.robot-docked .robot-arm-r{
  transform:rotate(48deg) translate(2px,-2px);
  transform-box:fill-box;
  transform-origin:top center;
}
#robotPet.robot-docked .robot-leg-l{ transform:rotate(16deg); transform-box:fill-box; transform-origin:top center; }
#robotPet.robot-docked .robot-leg-r{ transform:rotate(-10deg); transform-box:fill-box; transform-origin:top center; }
#robotPet.robot-docked{ cursor:pointer; }

/* Chatbot pulse hint */
.robot-point-pulse{ animation:robotPointPulse 1s ease-in-out 3; }
@keyframes robotPointPulse{
  0%,100%{ transform:scale(1); }
  50%{ transform:scale(1.15); box-shadow:0 0 0 8px rgba(0,162,255,.25); }
}

@media (max-width:768px){
  #robotPet{ width:66px;height:80px; }
}
