It’s tempting to play marketer and describe the new UPN show Veronica Mars as Buffy the Vampire Slayer meets Raymond Chandler. But in this smart, engaging series about a former popular girl turned crime-solving high school outcast, the hard-boiled dialogue comes from its teen protagonist’s mouth in a way that stabs any potential cutesiness in the heart with an ice pick.

“Want to know how I lost my virginity?” asks Veronica in the pilot episode. “So do I.”

The line is so cruelly witty yet crushingly sad that its sting is felt long after the flashback scene that follows, showing the party and the spiked drink and the waking up to panties on the floor and the horrible, tearful realization.

We don’t know yet who raped Veronica (Kristen Bell), but we also don’t know who murdered her best friend, Lilly Kane (Amanda Seyfried) — daughter of the local software billionaire Jake Kane (Kyle Secor) — and what other skeletons lie behind the arrogant, corrupting wealth in the fictional beachside town of Neptune, California. Veronica is keen to dig, though, because not only did the investigation destroy the career of her sheriff dad (Enrico Colantoni) after he single-mindedly pursued Lilly’s father, but the outcome — somebody else was arrested — humiliated Veronica’s status-conscious mother into fleeing. It’s almost a side note for Veronica that she was unceremoniously dumped as a girlfriend by Lilly’s brother Duncan (Teddy Dunn) and made into a school pariah, because in response Veronica simply reinvented herself. Dad now runs a private-detective agency and whip-smart, resourceful Veronica plays secretary, but it’s clear who the real Marlowe descendant is. By the end of the pilot, she’s outwitted a persecuting principal, casually tazed a threatening bully, exposed a dishonest sheriff and saved a kid from a biker gang’s relentless hazing. What she hasn’t done is figured out a way back into the in-crowd, a mystery that truly leaves Veronica — pardon the teen culture reference — clueless.

The Buffy comparisons are obvious: Creator/executive producer Rob Thomas has taken a timeworn genre and connected its trappings to adolescent angst. On Buffy, it was horror as high school: The spawning of creatures from hell was a rich metaphoric playground for the tempestuous realities of getting older. On Veronica, the resolute independence of its lead character is a given from episode one. What the gumshoe fiction template does, then, is showcase how much teenagers are desperate to make sense of, or find the solution to, the chaotic ups and downs of their world. And just like Buffy assembled her own Scooby gang of misfits to battle their literal and figurative demons, the Veronica writers are letting their heroine recruit outsiders to her cause — so far a picked-on but jovial African-American kid named Wallace (Percy Daggs III), the Watson to Veronica’s Sherlock.

But there’s a mild supernatural angle to Veronica, too, in that Lilly Kane, although dead, is a recurring character. This is mostly due to gauzily shot, kaleidoscopically colored flashbacks in which Veronica replays scenes from their idyllic friendship that act as both nostalgia and nagging uncertainty. Even Lilly’s brother encounters his dead sister, as a blood-drenched hallucination, in one episode. And after the Lynchian brilliance of Lilly’s portentous last words to Veronica before her death — “I’ve got a secret, a good one!” — delivered while the carefree gal pals are in short shorts bouncily scrubbing autos at a dance-team car-wash fund-raiser, it seems the doomed innocence of Laura Palmer is alive/dead and well in TV mythology land.

Buffy and Twin Peaks aren’t the only cult reference points upon which Veronica Mars is hoping to build fans. There’s also a vibey shout-out to Fox’s gleaming guilty pleasure The O.C., which smartly found room in the teen drama backpack to shove in a wish-fulfillment scenario regarding class divisions, and the brilliantly commercial notion that juxtaposing bad kid behavior with bad grownup behavior — and even bad grandpa behavior — is like getting two or three times the lather from one nighttime soap. There have been a couple of O.C. knockoffs so far, including the beach resort cheesefest North Shore and the WB’s alpine family potboiler The Mountain, but they have more of a lazy tawdriness to them. What The O.C. does is dish out the scabrously funny with the scandalously serious so you can laugh and gasp, even groan, at all the suicide attempts, inappropriate sexual couplings and dirty dealing without feeling like your TV jones had horribly regressed. The O.C. is the smart aleck’s soap.

Veronica Mars covers similar territory. It puts both teens and adults under its microscope, everyone talks in a kind of circular-logic, post–Dawson’s Creek sarcasm, and it revels in outlandish plot details, but it’s also refreshingly ambitious and thematically sound. In a recent episode, Veronica helped a squeaky-voiced kid who swore his dad was alive somewhere even though his mother claims he’d died. After some clever investigative work — sending out a fake scholarship letter to hundreds of namesakes in the hopes of appealing to a missing dad’s interest in his son — Veronica tracks the guy down in San Diego, only to find that John Smith is now Julia Smith. But she is also a re-energized parent eager to play a role again in a son’s life. On probably any other show — especially on a perpetual also-ran network like UPN — transsexuality so early in a series’ existence might have seemed like just another sensational ratings ploy, but here it was not only a truly surprising ending but a surprisingly touching ending, for it spoke straight to Veronica’s own conflicted feelings about a mother who fled, and also to the grand motif of a show about secrets and people who aren’t who they say they are. And in much the way all the real estate squabbling on The O.C. slyly mirrors the many emotional boundaries transgressed among the characters, on Veronica there’s a wonderful kickback effect to the idea that while Jake Kane’s technology money owns the town, it’s Veronica’s low-tech ingenuity that is likely to bring it crashing down.

So far Kristen Bell has been a standout addition to the new freshman class of teenage TV stars. She’s already wowed discerning viewers on HBO’s Deadwood as a murderously tough swindler, and believably played a 13-year-old at the Dorothy Chandler this summer in Stephen Sondheim’s A Little Night Music. What she does nicely on Veronica is reveal how the rich-clique superiority of a lucky girl has hardened into the icy rebel wisdom of a castoff who’s seen how deeply fucked the world is. Hers is not the typical 17-year-old girl velocity — walking fast but going nowhere — but almost an athletic awareness of the movement of those around her, the tough, darting, watchful grace of someone who doesn’t want to get sandbagged by life again. And she shows the swindler’s charm, too, when goading others into risky detective work and sweet-talking her father into thinking she’s staying away from the Lilly Kane murder case. Bell’s at-home scenes with Colantoni are genuinely appealing and ground the show in much the way Peter Gallagher’s scenes with Adam Brody do The O.C. In shows that thrive on crazy situations, Colantoni and Gallagher are the kind of banter-ready, swell-guy dads that can prevent a concept from turning into cheap melodrama.

Perhaps the real test will be how dark Veronica Mars is willing to get, which might be a struggle if the show helps further UPN’s ratings upswing of late. (The pre-debut buzz was that it could be a defining show for the network the way 21 Jump Street was for Fox and Buffy was for the WB.) Already, Veronica knows that solving a mystery doesn’t necessarily make problems go away. Sometimes she’s used the information she’s gleaned to try to bring a tense situation — disharmony between students, fear of retribution, a breach of the racial divide — back to normal. Other times, she has no qualms exposing the crime. In this respect she’s certainly closer to becoming a world-weary Lew Archer than a peppy Jessica Fletcher. If the creators stick to their guns, things should get especially weird for Veronica as she tries to reconcile an all-too-human desire to be accepted again in a closed society with a need to make the pieces of the Lilly murder puzzle into more than just fragments of information on her crowded corkboard. Are they compatible? This is a show with the potential to be a gripping, sad, funny and rollicking collision course into adulthood. Here’s one more comparison. Joan of Arcadia asks: What’s a smart girl to do when confronted with the Almighty? Veronica Mars asks: What’s a smart girl to do when confronted with the possibility that the Almighty doesn’t exist?

Veronica Mars | UPN | Tuesdays, 9 p.m.

Advertising disclosure: We may receive compensation for some of the links in our stories. Thank you for supporting LA Weekly and our advertisers.