/* "Pizzy": the little pizza that runs your order home on the tracker (replaces the scooter).
   Idle: breathes, blinks, waves.  On the way: legs run, arms swing, body bobs, dust puffs.
   Arrived: jumps for joy with a heart.  Everything is transform/opacity only (cheap on phones). */

.rider.pizzy { width: 62px; transform-origin: 50% 94%; }
.pizzy svg { display: block; width: 100%; overflow: visible; }
.pizzy * { transform-box: fill-box; }

.pz-shadow { fill: rgba(0, 0, 0, .35); transform-origin: center; }
.pz-leg path { stroke: #f6e3c4; stroke-width: 3.2; stroke-linecap: round; fill: none; }
.pz-leg ellipse { fill: #e23b2a; }
.pz-leg { transform-origin: 50% 0; }
.pz-arm path { stroke: #f6e3c4; stroke-width: 3; stroke-linecap: round; fill: none; }
.pz-arm circle { fill: #fff; stroke: #e9d5b5; stroke-width: 1; }
.pz-arm-l { transform-origin: 100% 0; }
.pz-arm-r { transform-origin: 0 100%; }
.pz-crust { fill: #e2a256; stroke: #b9762f; stroke-width: 1.4; }
.pz-cheese { fill: #ffd45c; }
.pz-drip { fill: none; stroke: #ffd45c; stroke-width: 3; stroke-linecap: round; }
.pz-pep { fill: #d4442c; stroke: #a52d1a; stroke-width: .8; }
.pz-basil { fill: #3f9a44; }
.pz-eye { fill: #fff; stroke: #3a2010; stroke-width: 1; }
.pz-pupil { fill: #2a1608; }
.pz-glint { fill: #fff; }
.pz-blush { fill: #ff7a6b; opacity: .65; }
.pz-mouth { fill: #7a1d10; stroke: #3a1208; stroke-width: .8; stroke-linejoin: round; }
.pz-tongue { fill: #ff8a7a; }
.pz-hat path, .pz-hat rect { fill: #fff; stroke: #e2d8cc; stroke-width: .8; }
.pz-hat rect { fill: #e23b2a; stroke: none; }
.pz-heart { opacity: 0; transform-origin: 50% 100%; }
.pz-heart path { fill: #ff4d6d; }

/* always: breathe + blink */
.pz-body { transform-origin: 50% 100%; animation: pz-breathe 2.4s ease-in-out infinite; }
@keyframes pz-breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.03, .97); } }
.pz-eyes { transform-origin: 50% 50%; animation: pz-blink 4.2s infinite; }
@keyframes pz-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
.pz-pupil, .pz-glint { animation: pz-look 6s ease-in-out infinite; }
@keyframes pz-look { 0%, 40%, 100% { transform: translate(0, 0); } 50%, 70% { transform: translate(1.2px, -.4px); } 80% { transform: translate(-1px, 0); } }

/* waiting at the bhatti: waves hello */
.pizzy:not(.moving) .pz-arm-r { animation: pz-wave 1.1s ease-in-out infinite; }
@keyframes pz-wave { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(-28deg); } }

/* on the way: run! */
.pizzy.moving svg { animation: pz-hop .36s ease-in-out infinite alternate; }
@keyframes pz-hop { from { transform: translateY(0); } to { transform: translateY(-3px); } }
.pizzy.moving .pz-leg-l { animation: pz-run .36s ease-in-out infinite alternate; }
.pizzy.moving .pz-leg-r { animation: pz-run .36s ease-in-out infinite alternate-reverse; }
@keyframes pz-run { from { transform: rotate(-32deg); } to { transform: rotate(32deg); } }
.pizzy.moving .pz-arm-l { animation: pz-swing .36s ease-in-out infinite alternate; }
.pizzy.moving .pz-arm-r { animation: pz-swing .36s ease-in-out infinite alternate-reverse; }
@keyframes pz-swing { from { transform: rotate(-22deg); } to { transform: rotate(22deg); } }
.pizzy.moving .pz-shadow { animation: pz-shadow .36s ease-in-out infinite alternate; }
@keyframes pz-shadow { from { transform: scaleX(1); opacity: 1; } to { transform: scaleX(.8); opacity: .7; } }
.pizzy .puff { bottom: 2px; left: -4px; }

/* delivered: jump for joy with a heart */
.pizzy.arrived svg { animation: pz-jump 1s cubic-bezier(.3, 1.5, .5, 1) infinite; }
@keyframes pz-jump { 0%, 60%, 100% { transform: translateY(0) scale(1, 1); } 15% { transform: translateY(1px) scale(1.08, .9); } 35% { transform: translateY(-10px) scale(.96, 1.05); } }
.pizzy.arrived .pz-arm-l, .pizzy.arrived .pz-arm-r { animation: pz-wave 0.5s ease-in-out infinite; }
.pizzy.arrived .pz-heart { animation: pz-heart 1.6s ease-out infinite; }
@keyframes pz-heart { 0% { opacity: 0; transform: translateY(6px) scale(.4); } 25% { opacity: 1; transform: translateY(0) scale(1.1); } 100% { opacity: 0; transform: translateY(-10px) scale(.9); } }

/* map labels: Bhatti label moved under the road so Pizzy never covers it */
.spot.shop { top: 84%; transform: translate(-50%, 0); flex-direction: row; gap: 3px; }
.spot.shop svg { width: 18px; height: 18px; }

@media (prefers-reduced-motion: reduce) {
  .pizzy *, .pizzy svg { animation: none !important; }
}
