Heidi Chhabria spent months painstakingly planning her son Zachary's first birthday party, inviting about 90 of her close friends and family to take part in a traveling petting zoo with pony rides in her Cherry Hill backyard.

And then it poured.

"We had a very big yard but a very small house,"  Chhabria said of that fateful party 12 years ago.

The animals didn't like the rain. The few brave guests who did venture outside brought the rain and mud back in, and the kids inside wreaked havoc "with food everywhere," Chhabria said.

"Our hardwood floors and carpet needed to be cleaned, and our son's nursery had white carpet. We never, ever did a home party again."

Whether they want the very best for their children, are keeping up with kids' classmates, or are looking to create an Instagram-worthy event,  parents planning kids' birthday parties often are left frantically looking for the right costumed character, making a creative cake, and conjuring up painstakingly homemade games, all photographed and filtered before the kids destroy them. Pinterest literally has thousands of birthday party pins divided into more than 100 categories, from scavenger hunts to cookie cutters.

But parents will attest that even the best planning can go awry, whether the fault of Mother Nature, an ill-fated character, an unruly guest, or many other unknowns.

In January, Sally Spivak invited classmates from her old school, Meredith, and her new one, the Philadelphia School, to celebrate her ninth birthday. Because it was to take place at the RiverRink, nobody was worried about the weather  — ice-skating is supposed to be cold.

But about an hour before the party, the family was informed that a storm the previous night blew so much debris onto the rink that it froze into a jagged wasteland. The rink was unusable.

With little time to spare, Sally's mom, Lara Rhame, 46, created a Plan B: a party at their Bella Vista house. Without phone numbers for many of her daughter's new friends, "It was like an old-fashioned phone tree, asking people to call other people to get the word out," she said.

All 12 families "went into mom mode," Rhame said, each showing up with something to contribute: a karaoke machine, plug-in disco ball, nail polish, washable hair spray, snacks — and wine. Her daughter, who had been very upset by the cancellation, "ended up having a blast."

That was the best made of bad luck, but sometimes birthday party misfortunes are self-inflicted.

Rachel Seligman recalled how at 10 a.m., the only person at her daughter Hazel Kenis' third birthday party was the pizza delivery guy.

"10:10. No guests. 10:20. No guests. 10:25. No guests," said Seligman, 42, of Queen Village. "And then I looked at the invitation again and saw that I had asked our guests to come at 10:30."

Anne Dougherty had heard plenty of horror stories about costumed character mishaps, but for her son Breck's fourth birthday, she wanted to surprise him with Batman, his favorite superhero. In the hope of avoiding the potential pitfalls — cheap unrecognizable costumes, hungover actors, characters who don't show — she checked out about 10 companies through friend referrals and a Google search.

"If you look online, it looks very sketchy," said Dougherty, 38, of Queen Village. "Even though they have different names, they look like the exact same website."

She ultimately hired Let's Party Events, who provided Batman for 45 minutes for $199. He was big on character,  Doughterty said, low on activities.

You can prevent such disappointments by discussing the details beforehand and putting them in writing, said Derek Lee Porter, owner of DJ Costumes & Entertainment in Northeast Philadelphia, including the party address, exact time for the character's arrival, and details about the birthday child. He has seen small details derail the fun, like the time one husband called for Elmo but his wife had wanted — and expected — Cookie Monster.

"It's silly things that fall through the cracks," he said.

Referrals are a must, he added. "Anyone can get a picture of Snow White or Batman and plaster it online."

Before characters arrive, give the parents a heads-up, added Renee Patrone, CEO of Party Host Helpers and Events by Renee in Wayne, "so if their kid isn't into it and they know he will freak out, maybe they'll leave or go in the other room."

Other tips: Beware of companies with 1-800 phone numbers that subcontract jobs out to local companies and take a fee off the top; don't pay in full up front, and be sure the company has insurance and the talent has background and child-abuse clearances.

Though the venue, favors, and entertainment can seem paramount, safety is key.

That means getting day-of insurance for a pool party and asking parents about food allergies ahead of time. If there are allergies, provide another treat or ask the parents to bring something for their children.

When it comes to opening presents at the party, remember kids don't always have a filter. And goody bags are not a must, insisted Patrone.

While driving home from a party about two years ago, Kiersten Tomson noticed in the rearview mirror that her daughter Madison, then 3, had taken slime from the goody bag and dumped it on her head. "I could see it dripping down her face. [She] looked like a creature from the pink lagoon," said Tomson, 36, who moved from Center City to Westmont, Ill., three years ago.

Despite a thorough shampooing, Tomson had to cut out a small chunk of her daughter's tangled hair.