As I was enjoying the sweet and simple and warmly funny pleasures of “Troop Zero,” I was thinking it had to be based on a popular Young Adult novel.

It just had that feel, from the period-piece setting (rural Georgia, 1977) to the girl-power message to the first-person narration from our heroine, a precocious and adorable and fiercely determined little girl with the unlikely name of Christmas Flint.

‘Troop Zero’: 3 out of 4 CST_ CST_ CST_ CST_ CST_ CST_ CST_ CST_ Amazon Studios presents a film directed by Bert & Bertie and written by Lucy Alibar. Rated PG (for thematic elements, language, and smoking throughout). Running time: 97 minutes. Debuts Friday on Amazon Prime Video.

Turns out “Troop Zero” is actually inspired by Lucy Alibar’s 2010 play “Christmas and Jubilee Behold the Meteor Shower.” With Alibar (who co-wrote the screenplay for “Beasts of the Southern Wild”) handling the adaptation and the female directing duo who call themselves Bert and Bertie providing sure-handed guidance behind the camera, “Troop Zero” is so sugary you’d get a cavity if you bit into it — but it’s also a cozy, satisfying and inspirational underdog tale, featuring a wonderful performance by Mckenna Grace as the aforementioned Christmas, and some lovely supporting work from a first-rate supporting cast of grown-ups, including Viola Davis and Jim Gaffigan.

Nine-year-old Christmas is smart and energetic and quirky — and a bit of misfit in the world. She’s picked on at school because of rumors she wets the bed, and she spends a lot of time gazing up at the stars and dreaming of making contact with outer space life forms.

“I’m Christmas Flint, human female,” she calls up to the night sky. “I think you’d like me. I think you’d want to be my friend.”

Jim Gaffigan putters around and growls in good-natured fashion as Christmas’ widower dad, Ramsey, aka the Boss, who is just about the worst defense lawyer anyone has ever seen. Viola Davis is Miss Rayleen, who works for Ramsey and is constantly telling him he needs to get tougher with his clients, most of whom never get around to paying him.

Through a quirk of luck (and plot device), a representative from NASA arrives in town and announces the winners of the annual Jamboree of Birdie Scouts talent competition will have their voices featured on the “Golden Record,” a collection of sounds and images to be launched aboard the Voyager spacecraft and played to, well, to infinity and beyond!

As you’d expect, Christmas is out of her mind with excitement over the prospect of having her voice transmitted through space. (She believes her mother also lives on, somewhere out there, and might even hear Christmas.)

Problem is, Christmas would never be accepted into the existing local Birdie Scout troop, which is headed by Allison Janney’s Miss Massey, an exacting perfectionist, and is populated by the obligatory collection of popular mean girls.

So Christmas starts a second troop, recruiting the likes of Joseph (Charlie Shotwell), a neighbor boy who is ostracized and ridiculed for openly expressing his feminine side; Ann-Claire (Bella Higginbotham), who has one eye and is a big-time Jesus freak, and even her primary tormenters, Hell-No and Smash (Milan Ray and Johanna Colon).

Miss Raylene reluctantly agrees to be troop leader.

“Little girls give me the creeps,” she says. “Plus you can’t hit ’em no more, they changed the law.”

Nevertheless.

“Troop Zero” fleshes out the pretty thin story with an extended middle sequence involving the outcast troopers trying to win badges in various competitions. From time to time we get some welcome, offbeat touches, e.g., the troopers walking in slow motion as we hear the George Baker Selection’s “Little Green Bag” — mirroring the famous opening credits scene from “Reservoir Dogs.”

And because this is the 1970s, with Christmas’ dreams of outer space, you might be able to guess which David Bowie tunes appear.

“Troop Zero” is bathed in tones of green and gold, yellow and brown — not quite sepia tone, but making for a nice memory-piece effect. The story stays grounded in one brief period in 1977, but if we were to learn what eventually became of Christmas and her friends, the feeling is they turned out just fine.

Better than fine.