Mark Gatiss is recalling an early memory, rocking back and forth on the sofa as he talks. It is an “extraordinarily vivid” moment from when he lived opposite a psychiatric hospital in County Durham. The institution was central to his childhood, a “colony” in which his mother and father worked, where he went to swim, to trampoline, to see films. Except, on this occasion, he was left on one of the wards with his brother to wait for his parents. “I must have been around five. There was a boy rocking on a bed. As I remember it, he had an empty eye socket. He had his thumb in it and he was just rocking – like this.”

Gatiss takes his thumb to his eye and rocks some more. It is a baroque vision, creepy enough to make you squeal, and befitting for one of the creators of the stage show and TV series The League of Gentlemen. As Gatiss says: “You can’t get more northern gothic, can you?”

It is clear he enjoys playing up the northern gothic. His Twitter tagline reads: “Actor. Writer. Strangler.” In person, there is no hint of gloom. He is sweet and sunny, an optimist by his own admission. Still, an unprosperous northern childhood and those years of observing mental illness – and the world’s responses to it – continue to serve him at the age of 52. He is currently in Nottingham, in rehearsals to play the titular lead in Alan Bennett’s 1991 play, The Madness of George III, at the Nottingham Playhouse. The play – which was adapted for a 1994 film, The Madness of King George, starring Helen Mirren and Nigel Hawthorne – dramatises the monarch’s mental illness.

“It was very interesting [to grow up opposite the hospital]. I have a lot experience to draw on for this play. And it’s interesting to think about mental health in the 18th century … It’s a challenge to chart the king in his ‘normal’ state, as it were, and then what happens to him. You have to make sure there’s a journey into his condition, so you have somewhere to go.”

Brexit is like slitting your own throat and going to bed saying: ‘I’ll see how I am in the morning’

Since the TV version of the League – which followed the tormented outcasts and oddballs of the fictional town of Royston Vasey – landed in 1999 and earned Gatiss and his co-stars a legion of fans, he has helped to create some of the most popular shows on TV. These include the revived Doctor Who (as a writer and an actor) and Sherlock, a reimagining of Sherlock Holmes as a 21st-century detective, which he co-created with Steven Moffat and in which he stars as Holmes’s brother, Mycroft. In between, he has worked on films and written books and plays. His stint in Nottingham follows a nationwide tour of the League, an Oscar-tipped film (The Favourite) and The Dead Room, a yet-to-be-aired Christmas ghost story starring Simon Callow, which he wrote and directed. After The Madness of George III, he will team up with Moffat again for a BBC/Netflix adaptation of the vampire classic Dracula. “I do work hard and I think that’s a good thing,” he says. “Work hard, be kind, that’s my motto.”

Filming for Dracula will start next year, but Gatiss does not plan to act in it. He will not be drawn on who will be cast as the vampire, but says he and Moffat thought carefully before deciding to set the series in its original period, the 19th century: “We said when we started Sherlock that we briefly got custodianship of the keys to Baker Street and we felt: ‘It’s our go.’ So, we wanted to have ‘our go’ at Dracula and with that we wanted to do all the treats – a big, spooky castle and the rest of it.”

Sherlock was set in the modern day for the opposite reason: “We felt it had become so swamped with Victoriana that people had lost sight of what it was – which is essentially a flat-share story of two unlikely friends, one of whom solves crimes. That was the really exciting thing, to just go back to basics.” While the series has been a runaway success, there have been criticisms: one Guardian article lamented that his Sherlock was morphing into James Bond; it vexed Gatiss so much that he sent the Guardian a rejoinder in rhyme, outlining the differences between his hero and Ian Fleming’s.

Facebook Twitter Pinterest ‘You have to make sure there’s a journey into his condition’ ... Nigel Hawthorne and Helen Mirren in The Madness of King George, adapted from Alan Bennett’s 1991 play. Photograph: Allstar/Channel 4

There have been other charges of “unfaithfulness” in Gatiss’s adaptations, but he is adamant about his right to play with an original story. “I feel very strongly about not just drearily reproducing the book. You are duty-bound to think: ‘Here’s an idea, why don’t we flip this round,’ especially if people know it well. It doesn’t spoil the original. No one burns the manuscript … the Tardis would never have left the junkyard in the 1960s if it wasn’t about change.”

And what greater change than a female doctor? The new series is the first with which Gatiss has not been involved since Doctor Who relaunched in 2005. How does he feel about Jodie Whittaker’s Doctor? “First, it’s lovely that I’m enjoying watching it on a Sunday night and not knowing anything about it. I have even tried to avoid the trailer for the next time. And I have said for a very long time that there should be female Doctors. As soon as you watch it, you say: ‘Of course, why not?’ All you need, ever, is for the right person to be playing the part. Jodie is instantly likable, funny, delightfully odd.”

If that is the case, can we – should we – stop at Doctor Who or extend a gender-blind, colour-blind policy to all period dramas? It depends how literal we want to be, Gatiss says, but he balks at the prospect of a female Bond. “Doctor Who is an alien with two hearts who lives in a dimensionally transcendental phone box and can periodically change his or her appearance. James Bond is a man. There’s no way out of that. It becomes a very reductive argument. If you want to create a really kickass new heroine or hero, then do something else.”

If you were to create a female Bond, he adds, would you then follow Fleming’s blueprint of making her a sexist lothario? “What is it about James Bond you want to change? Is it just the sex or is it everything else? In which case, you’ve got a different character anyway.”

Gatiss was not long out of studying theatre arts at Bretton Hall College in West Yorkshire when he co-wrote the League with Jeremy Dyson, Steve Pemberton and Reece Shearsmith, whom he met there. It has been a long, loyal partnership, even though they went their separate ways – and thrived – before returning after 13 years to take the show back on the road. “We never fell out, we just stopped doing it,” Gatiss says. “We had been doing it virtually day in, day out for 11 years. So, we decided to do other stuff. The extraordinary thing about the tour was that it felt like no time had passed, which is what great friendships are about.”

The League began as a stage sketch show in 1994, when standup was more dominant in comedy. Gatiss and the others were enlisted to fill a slot at a fringe festival. “We did it for five nights and it went down really well. I remember a friend of mine saying: ‘You should do something with this.’” They did – and won the Perrier award at the Edinburgh fringe in 1997. “We did what made us laugh. All the things we loved ranged from proper horror to the horror of embarrassment; Alan Bennett, Victoria Wood, Mike Leigh. It was very much about our northern upbringings, too – we were identifying our own experiences of the world of the north. It was real anger and despair and oddness.”

Facebook Twitter Pinterest ‘We did what made us laugh’ ... Mickey (Mark Gatiss), Pauline (Steve Pemberton) and Ross (Reece Shearsmith) in The League of Gentlemen. Photograph: James Stack/BBC

Bennett turned out to be a huge fan of the League. “It’s how I came to meet Alan and it was just astonishing to think that he liked The League of Gentlemen. We have always said what a major influence he was for us. I remember so well the first thing I saw of his was a play called Our Winnie [from 1982]. I only watched it because Winnie was my mother’s name. It’s a half-hour drama where Elizabeth Spriggs takes her mentally disabled daughter to the crematorium on a Sunday. I just remember looking at it and thinking: ‘How does he know all this?’ It was just like my life! The way people spoke, the colloquialisms and the amazing sense of oppressive Sunday tedium.”

Two decades on, Royston Vasey’s turned-in world seems to resemble Britain more than it did when it was conceived, I suggest – the local shop for local people, the suspicion of the outsider taken to its freakish, inbred, comic extremity. “Yes, I look at it and think: ‘It’s a bit like a premonition,’” he says. “The idea that: ‘There’s nothing for you here, go away.’ That’s why we pushed it a bit in the specials last year. We were never satirical, but we found it irresistible and deliberately got [the character] Edward to say: ‘It’s time we took back control.’”

The tour took Gatiss to 47 venues around Britain. Did he sense a change, post-Brexit? “Yes. Some places are rust-belt Britain. They’ve been abandoned. I thought constantly of Disraeli and ‘two nations’ [“Two nations between whom there is no intercourse and no sympathy”]. It made me think that some people must look at the events in Westminster as if they’re taking place on the moon. That’s why, when they were finally given the chance, they kicked back. And that’s why we’re in this fucking mess.”

It is not just the rising intolerance of the “immigrant” outsider that he fears, but also the erosion of other liberal, humanist values. As a gay man – he is married to the actor Ian Hallard – he has never felt personally threatened in London, where he lives, “but you go out of London and it’s very different. You go to certain parts of the country and you think: ‘I would modify my behaviour here.’”

The regions around his birthplace were the heartland for leave voters, but Gatiss is proud to have grown up in the north and in a working-class household: his father was the chief engineer at the psychiatric hospital and his mother was a carer and secretary. “I think my background did me an awful lot of good. There’s a very good line from Doctor Who: ‘Never lose sight of your horizons.’ There’s nothing wrong with coming from one place and moving to another place, but it’s good to know that and honour it. And also to acknowledge its flaws – it doesn’t have to be perfect.”

Brexit upsets him immensely. He speaks of it in irate exclamations and bloody analogies: “Brexit, to me, is like slitting your own throat and going to bed saying: ‘I’ll see how I am in the morning.’ I’m a sickeningly optimistic person and that’s what worries me about how depressed I am about it all. The temptation is to totally disengage because it’s so frightening and debilitating, but if you do that they’ve won.”

The Madness of George III is at Nottingham Playhouse until 24 November. There is an NT Live broadcast on 20 November.