As a child, Marissa Meyer would often see her mother dressed up for Halloween as the Queen of Hearts, clad in red and yelling: "Off with their heads."
When the 32-year-old American author was searching for a character to base her first stand-alone novel on, she immediately lit on the terrifying monarch of Lewis Carroll's Victorian fantasy, Alice's Adventures In Wonderland.
Her new young adult novel, Heartless, is told through the eyes of the girl who will become Wonderland's decapitation-loving tyrant.
"I love writing villain stories," says Meyer, who is married with two daughters, over the telephone from Washington, where she lives.
"For the Queen of Hearts, we know she is angry and has a huge personality - but what happened to her to make her so vengeful?"
Adaptations of the Alice book have been a dime a dozen in recent years. But most cast the Queen as a villain, from the murderous Redd of Frank Beddor's The Looking Glass Wars books to Helena Bonham Carter's Iracebeth in Tim Burton's 2010 film, Alice In Wonderland.
In Heartless, which has spent 10 weeks on the New York Times Young Adult Hardcover bestsellers' list, Meyer takes a more sympathetic approach.
The future Queen begins life as Catherine Pinkerton, the down-toearth daughter of a marquess, who wants to set up a bakery.
She must contend, however, with the affections of the fatuous King of Hearts and her unexpected attraction to the King's mysterious jester.
Meyer, who researched Victorian customs and chess moves and even baked lemon tarts to get Cath's recipe right, struggled with denying her likable heroine a happy ending.
She says: "I want readers to sympathise with her, to believe it's possible she could fall in love, even though at the back of our minds, we all know she's going to become the Queen of Hearts.
"Did I want to write her a different ending? Absolutely. But it never felt authentic."
Happy endings were Meyer's calling card with The Lunar Chronicles, her debut fantasy series, which puts a cyberpunk twist on fairy tales.
In her intergalactic retelling, Cinderella is a mechanic who is also a cyborg. Instead of her glass slipper being lost as she flees the prince's ball, her metal foot falls off.
Red Riding Hood is a shotguntoting spaceship pilot, Rapunzel a hacker trapped in a satellite and Snow White the princess of a civilisation on the moon.
Meyer's heroines are no damsels in distress. Rather, each proves highly competent in her own way, whether sharpshooting or accounting.
Her stories also challenge the Eurocentrism which fairy tales are known for. The first book, Cinder, is set in a futuristic Beijing, a nod to Ye Xian, a ninth-century Chinese folk tale thought to be a precursor to the European versions.
Winter, her Snow White character, is black. She had intended to make her "white as snow", as in the original tale, but changed her mind after seeing a photo on a health blog of a black model with curly hair biting into an apple.
Meyer, who is now working on a novel about five teenage superheroes, says that growing up white meant she never had trouble finding books full of people who looked like her, but this has not been the case for many of her readers.
"It's important for children of colour to be able to form connections with fictional characters, to not always be relegated to the role of best friend or sidekick," she says.
"They can be princesses or superheroes too."
•Heartless ($17.90) is available at Books Kinokuniya.