Across the board advice for writing characters in general: Start with goals. Always, always, always start with goals.
In real life, people WANT things, whether that's financial stability, to bring happiness to others, accumulating wealth, fame and notoriety, the list goes on. People WANT to acquire things, be they physical or philosophical. Self-actualization and motivation are core, intrinsic elements of the human experience, so start with those.
Your villain being a certain archetype is way less valuable and way less impactful on whether they're a memorable antagonist than if their goals and motivations are well-established and explored.
Always remember: Every man is necessarily the hero of his own story.
Even the most irredeemable pieces of shit in history convinced themselves they were in the right, somehow or another. Sometimes it was because they genuinely believed in what they were doing (Due to upbringing, philosophical pretzel-logic, or trauma/mental illness), sometimes it was because they had some greater goal and convinced themselves certain actions were necessary in the name of their percieved 'greater good', and sometimes it was because they were just self-centered assholes who lacked the wherewithal, empathy, or self-awareness to realize or care what they were doing was hurting others.
Give your villain a reason to think they are actually the protagonist. Look at it from their point of view. You don't have to agree with or endorse anything your villain does, of course, but you should be able to explain why they think it's acceptable or permissible for them to do what they're doing.
Is the mastermind planning to bring about a new world order by puppeteering politicians and war in order to install a benevolent (in their eyes) dictatorship that will cause less suffering in the long-term? Cool, give them a reason for it. Really think about the horrible, atrocious, disgusting injustice and suffering they would have to have seen in order to believe that the world as it stands is just too fucked to salvage. How bad does it have to get before someone would go to lengths that extreme in order to take over the world and cause that much suffering in order to fix it in the long term?
Of course mental illness and instability can factor into this quite heavily: Thanos comes to mind as a good recent example of a villain who has somewhat sympathetic reasons for doing what he does at the outset, but his own trauma and steadily ramping instability take it far, FAR beyond reason. He, of course, is way too far gone to see this for himself, but this gives a great origin point and goal for the villain to work for, as well as a solid reason for their goals to be incompatible with the hero's.
Is your mastermind seeking out something personal, like Kingpin trying to return to his family in Spiderverse? Is there a reason they can't simply brute force their way into what they want? One of the key characteristics of a smart character is speed. They think of solutions quickly and on the fly. Practically anyone can, eventually, come across a perfect solution to any problem if given enough time to work through it. Smart people simply get to those solutions more quickly.
As the writer, you have all the time in the world to think about your antagonist's plans and processes, and then the freedom to condense all that real-world thinking you did down into microseconds if you want (see: Jojo's Bizarre Adventure), so if your character is going to be a mastermind, figure out the goal they're seeking out, and really give yourself the time to go over what would genuinely be the best way for them to go about it. Think about your villain as the protagonist for a bit and think through what the most logical progression is for them to get what they want. If you were writing the story with them as the main character, what would you have them do in order to get to their goals? What is the reason they need to accomplish that goal? what are the obstacles in their way and how do they maneuver around them?
If you go with the OP powerhouse, then what is it they actually want? Is it just stronger opponents to fight? or is their goal to acquire more power in order to stop something they perceive as a greater threat in the long run? Maybe they're just insecure and can't stand the idea of being beaten, so they constantly seek out greater strength?
Tai Lung from Kung Fu Panda is an incredible and highly underrated example of an incredibly overpowered beatstick villain with a great motivation along these lines. He is simply too insecure and self-conscious to let anyone beat him. he has to be the best, and this isn't necessarily tied to some sort of traumatic backstory or history (though it totally could be if you wanted to go that route), it's just a personality flaw he has naturally, and it informs his goals and motivations throughout the story.
Lord Genome from Gurren Lagann is an incredible example of the other side of that coin: He convinces himself that the atrocities he commits are a necessary evil in order to prevent an even greater tragedy. Hell, even the anti-spirals follow this same logic. There's no true 'villain' in Gurren Lagann because everyone is trying to prevent something they view as simply a force of nature. They have very good reasons for believing that the 'greater evil' they are using their power to prevent is undefeatable and simply needs to be held back/staved off indefinitely, and are willing to do anything necessary in order to make that happen.
Even The Joker, who often gets brought up as an example of one of the greatest villains of all time, can be defined in this way: His lack of goal or motivation is precisely what makes him so scary. He's practically inhuman because it's straight up unnatural for a human to genuinely have no motivation or goal fueling their actions. In a way, the Joker's motivation is to have no motivation: His objective is to prove to the world that their priorities don't matter. Everything we think of as valuable actually means nothing, and the (I think) best iterations of the Joker are angry about that.
Those Jokers want to force the world to see what they see, to realize how meaningless it all is and that there's no point in trying. Fuck shit up, let it burn, revel in the destruction because nothing matters anyways so just have a little fun.
This, of course, goes for all types of character creation. Starting from motivations and goals will help you create far more believable and well-rounded characters overall. Villains are just what happens when those goals are misaligned with the well-being of others or the moral framework you as the writer present as correct.
Of course the morality you present as correct is, at the end of the day, just like, your opinion, man. There can be 100% valid arguments in favor of why your hero is actually the villain (Magneto was right, Gendo Ikari did nothing wrong, etc. etc.), and that can be a GREAT source of those believable and well-written motivations for your antagonists if you want.
Ultimately, what makes an antagonist memorable is a combination of believable goals, intelligence, and charisma. Charisma is a big Je Ne Sais Quois that's very hard to nail down and figure out, that one you just gotta learn to feel out for yourself in my experience.
That said, thinking about your villains as people and focusing on why they're doing what they're doing, as opposed to why the hero needs to stop them, is going to get you a lot farther than any amount of OP superpowers or galaxy-brained mastermind schemes.