Nicholas Pileggi's office is at the back of a film lot in a suburb north of Hollywood. To reach it you walk along a low-rise strip out of 1960s Las Vegas where exuberantly finned Cadillacs are parked up at the roadside, then past the blackjack and roulette tables of a cavernous casino, with all the chandeliered luxury of 50 years ago.
The cast of the TV series Pileggi has conceived and co-written, Vegas, are on location when I visit, so he is pretty much alone here among the lovingly recreated props and vintage neon-lit backdrops of his own make-believe.
Pileggi's name often has the word "legendary" attached to it. Now a courteous and energetic 79, he was a legendary crime reporter in New York for more than 30 years, mostly writing inside stories about the Mob before one of them, the book-length Wiseguy, was picked up by Martin Scorsese and, with Pileggi's help, turned into the film Goodfellas.
Pileggi then became a notable screenwriter with credit for another Scorsese movie, Casino, among others. And while he was writing those films, he was also one half of a legendarily joyous Hollywood marriage to Nora Ephron, fellow journalist and writer of Sleepless in Seattle and When Harry Met Sally.
Ephron died in June last year, having kept her leukaemia secret from all but her closest family for six years.
Sitting behind his desk on the lot of Vegas, Pileggi is a deeply charming man who is full of stories, and the kind of animated listener who could clearly get gangsters to open up to him - and stay on good enough terms to come back for more. He has a rich Italian-American New York voice, with some of the twang of the wise-guys he documented - his parents were first-generation immigrants from Calabria, just across the water from Sicily. And he carries about him too just a hint of the distracted wildness of his grief. He is careful, when we talk, not to reveal too much of that. Though whenever I mention Ephron's name in the conversation that follows, his eyes fill up a little and his voice struggles briefly to hold its easy composure.
Writing Vegas has been his lifeline in the past six months, he says. "To say the only antidote to grief is work is one of the oldest cliches," he suggests. "But cliches are right sometimes. Work takes your mind in a direction you might not otherwise go. Loss is loss, it doesn't change that fact. But being involved in creating 22 episodes of a television show, with six people in a writers' room - you have to say it's a help." It's given him some structure? "Well, I'd have some structure too, I suppose, if I was doing journalism or working on a book," he says. "But I'd be doing it alone. And I've already got far too much alone." Ephron, he says, was very excited about Vegas. In the weeks before she died they had gone to a promotional event thrown by CBS at Carnegie Hall in New York, announcing forthcoming highlights. "There was Vegas as big as life," Pileggi recalls, "and Nora leaned across to me in the theatre and said, 'This one is for real ... you can't just phone it in.' She was very hopeful for it."
The pair of them were each other's best critics and sounding boards. Pileggi once noted they were both "thick-skinned enough to swap some very blunt criticism without fomenting marital strife".
It must be terribly strange not to have her reading things, I say. He pauses for a long moment. "It really is," he says eventually.
If Pileggi finds solace anywhere it is in stories, and he has a compelling one in Vegas, which he came across first when he was researching Casino for Scorsese. "I had done a book on the Casino story alongside the movie," he says. "That was mostly set in the 70s and 80s, but as a result of that research, as you do, I found out that the 60s was probably the more fascinating era. I kept wanting to go back to it."
Having held that thought in the back of his mind for 25 years, Pileggi has eventually found a way to write it. He describes the process with the excitement of a eureka moment.
"In 1959 and 1960, Las Vegas was still really a Western town," he explains. "It was cowboys, and it was also about the time when the Mob decided they could come in." There were political reasons for that - a clampdown on illegal gambling in every state except Nevada - and there were engineering reasons; the rise of air travel, and the air-conditioning technology that allowed a casino to be kept cool in the desert. "And here it was - the fedoras were starting to come in against the cowboy hats." Pileggi knew exactly the point at which those two venerable movie genres met. "This guy, Ralph Lamb, was the sheriff in Vegas during the 60s. He was a cowboy on a horse, and suddenly faced with the arrival of all these mafioso. It was John Wayne versus Edward G. Robinson!"
Lamb wouldn't speak to Pileggi about this history but the writer has learned persistence from dealing with gangsters, and eventually the sheriff was persuaded to be involved. "He had great stories. Part of the reason he was so good is that he wasn't narcissistic. He could take it or leave it. And now I think he has gotten to like it ... He bonded very well with Dennis Quaid, who plays him in the show. But then, which old man wouldn't like his younger self to be played by Dennis?"
Pileggi had always thought of the story as a movie, but could not get it to work in three acts. A TV series gives him more scope. "It allows it to become what it is: a saga."
To attempt storytelling on such a grand scale, Pileggi had to excavate hard into the facts of the genesis of Las Vegas. "I am a journalist at heart. I have no imagination. When you are free from a story that happened it has the freedom to go anywhere, and I am no good out there in Nabokov-land."
What he has always been good at is making connections. He had to start early, and old habits die hard. "When I began writing about the Mob in New York," he says, "the story was still pretty much unknown. Now we know more about those families than we do the boy scouts, back then it wasn't the case. But if you grew up in one of those neighbourhoods as I did, you knew who all these guys were."
There must have been times when he had to tread a fine line? "It was okay as long as I thought of myself like Margaret Mead on Samoa. I wasn't looking to put anyone in jail, I was interested in them as characters. Why did they do this stuff? And then, of course, The Godfather came out and changed it all. The gangsters had always wanted to be in an opera, and suddenly they were. A more real world was the Goodfellas or Sopranos vision, kind of small town, but they loved the idea they were these Marlon Brando figures, of course they did."
It was an effort to depict that more brutally mundane version of Mafia life that led Scorsese to first call Pileggi, out of the blue. To begin with, he didn't call back. "I didn't believe it when Marty left a message. I thought it was my friend David Denby, the film critic, winding me up. So I just ignored him. Eventually Martin called Nora and said, you know, maybe I could find time to give him a call, as he might have some work for me."
His success with Goodfellas followed his wife's with Heartburn (a dramatisation of her disastrous marriage to Watergate journalist Carl Bernstein) and When Harry Met Sally. They married in 1987.
I can't bring myself to ask directly if he thinks his grief has proved a creative force, so instead we talk a little about the extraordinary tributes given to his wife by everyone from Meryl Streep to Frank Rich. "They were amazing," he says, "but they seemed very natural to me, knowing her."
Ephron once shared what she believed was the simple secret of happy endings in life: "Marry an Italian." Pileggi is not going to disagree.
Who: Nicholas Pileggi, screenwriter of Goodfellas, Casino and now Vegas
Where and when: Prime, Thursday, February 28, 8.30pm
- TimeOut / Observer