For about four hours in the summer of 2012, Simon Kinberg came perilously close to revealing the secrets of the universe — or, to be more precise, the secrets of several fictional, widely deliberated universes.

The busy writer-producer — whose latest blockbuster “X-Men: Days of Future Past,” storms into theaters Friday — had checked into a San Diego hotel ahead of an appearance at Comic-Con International. But before the afternoon’s close, he’d misplaced an iPad containing sensitive information at the annual pop culture expo, the epicenter of geek movie fandom.

“I had ‘Star Wars’ stuff on there, ‘X-Men,’ Neill Blomkamp, ‘Elysium’ stuff,” recalled Kinberg, a trace of anxiety still detectable in his measured voice. “It would have been jackpot for hackers. Thank God the housekeeper just picked it up and was holding onto it.”

With the possible exceptions of J.J. Abrams’ laptop, or maybe Joss Whedon’s diary, it is difficult to imagine a better score for devious bloggers. Kinberg has become a go-to source of ideas for marquee comic book and science fiction franchises, including Fox’s “X-Men” movies and its upcoming reworking of “The Fantastic Four.”

The youthful 4o-year-old father of two boys also is writing and producing one of the three planned stand-alone “Star Wars” films that Disney will release, in addition to overseeing the new animated series “Star Wars Rebels” and producing Kenneth Branagh’s live-action retelling of “Cinderella,” due next spring.

“The part that’s probably the most exhausting is just physically having to be in different places at the same time,” said Kinberg, seated in his tidy office on Fox’s Westside lot. “The actual keeping them straight is fun. Most of those things that are sort of established brands or franchises that I’m working on, I grew up with, so it was like they’ve been in my blood the whole time — a little bit like a family member, you know?”

Producer Lauren Shuler Donner, who has been with the “X-Men” franchise since its beginning, praised Kinberg’s “facile mind that can juggle the conflicts of multiple characters…. Simon is funny and winning as a person and I believe he imbues his heroes and villains with those qualities.”

In the summer of 2000, Kinberg — a recent film school graduate — and a friend went to a Marina del Rey multiplex to see director Bryan Singer’s “X-Men.” It was a game-changer.

With its respectful approach to costumed hero lore and an indie director who had rocketed to acclaim five years earlier with the crackerjack crime film “The Usual Suspects,” the production ushered in the modern age of comic book cinema (though its $54-million opening weekend seems somewhat modest 14 years on).

“I was so shocked that someone was allowed to make that kind of movie, to start a comic book pop movie in the Holocaust,” Kinberg said. “That alone changed the whole way people I think started to experience comic book movies.”

Simon Kinberg in a photo from 2005. (Glenn Koenig/Los Angeles Times)

On the heels of his career-making screenplay for 2005’s “Mr. & Mrs. Smith,” featuring Brad Pitt and Angelina Jolie as an unhappily married couple who happen to be rival assassins, Kinberg joined the “X-Men” brotherhood, penning “X-Men: The Last Stand.”

The movie adapted a classic comic book arc known as the Dark Phoenix saga for director Brett Ratner to mixed results. Fans groused about its execution; Kinberg too was disappointed.

“I worked on it — I’m not proud of it,” he said.

“Days of Future Past” offered him a chance to atone for his own moviemaking past. In adapting and expanding the acclaimed “X-Men” comics by Chris Claremont and John Byrne from the early ’80s, Kinberg had to navigate the intricacies of a narrative that jumps between a dystopian future ruled by robots called Sentinels and 1973, in which the free world is ruled by Richard Nixon, who appears as a character in the mutant sequel.

In the film, Singer’s first “X-Men” film as director since 2003’s “X2,” the mutants hit upon a plan to prevent the bleak future that involves projecting Wolverine’s consciousness back in time into the body of his younger self. They hope to unite friends-turned-adversaries Charles Xavier and Magneto to avoid the events that will trigger the dystopia.

The movie unites the casts of both the original “X” trilogy — including Hugh Jackman as Wolverine, Patrick Stewart as Charles Xavier and Ian McKellen as Erik Lehnsherr/Magneto — and the younger actors who played earlier incarnations of the characters in Matthew Vaughn’s 2011 prequel “X-Men First Class,” a roster that includes James McAvoy as Xavier, Michael Fassbender as Magneto and Jennifer Lawrence as the alluring blue shape-shifter Raven/Mystique.

“Game of Thrones'” Peter Dinklage joins the “Future Past” ensemble as Bolivar Trask, the scientist who creates the Sentinels.

From a strictly creative standpoint, Kinberg said penning the “Days of Future Past” script represented an unprecedented level of difficulty — “like the hardest dive you can do in the Olympics. You can fall and miss and break your neck and it would be a disaster. It was very, very daunting.”

The prospects for the film were further complicated this spring after a teen sex abuse lawsuit was filed against Singer, prompting the filmmaker to drop out of publicity efforts. Kinberg did not address the allegations against Singer but simply said he was happy to be drafted as a “Future Past” spokesman.

“I feel a certain affinity and authorship with this film, and I love the movie, so I love talking about it,” Kinberg said.

(Singer on Wednesday filed a motion to dismiss the charges against him.)

The off-screen controversy appears to have had little effect on moviegoers’ interest in Singer’s $200-million-plus “Future.” Riding a wave of largely positive reviews, “X-Men: Days of Future Past” is poised to deliver Singer a much-needed hit, with the film on track to collect a four-day total of roughly $120 million in its Memorial Day weekend debut.

“People do seem excited about the film and sort of more importantly to me, the people I have talked to who have seen it seem to like it,” said Kinberg, who is already looking ahead to the next film in the series, “X-Men: Apocalypse,” which is set to open in 2016. “Obviously I want the movie to be successful but more importantly I want the people who go to see it to actually love it.”