If your goal is US or UK universities, doing a Master's isn't the most efficient path, because it's not required nor is it necessarily helpful provided your undergraduate studies have been appropriately successful.
Sounds like your undergrad didn't go that well, so you are trying to compensate with MS. That's fair, it works for a lot of people, but keep in mind that just the MS by itself will not improve your application much. Instead, think of the MS as a way of turning yourself around. Did you not publish in undergrad? MS is your chance to show you can publish good papers. Did you not have strong recommendations? Work on that in your MS. Was your GPA not high? Make sure to take relevant classes in MS and ace them. Even better if you can turn the coursework into papers (even review papers) somehow.
How high should my grades be in order to have a fair chance of being accepted at top 10 universities?
Well, if your MS GPA is not 4.00 or almost that I would say your odds are not great. It's easier to have high grades from graduate classes and admission committees know this, but if your MS GPA is very high it's still something. Whereas if your MS GPA is low (say <3.50) that's even worse than having a low undergrad GPA, it's a huge red flag and will basically sink your app.
However, I think you are being too concerned with prestige of university. Things that really help get a good postdoc are:
- Good publications
- Connections (of your supervisor, collaborators, you, etc.)
So you are better off finding a research group that is a great fit in an okay university, than a group that's an okay fit in a great university. Graduating from a fancy school won't save you if your publication record is terrible. Having great papers might even if your school is not so well regarded. Likewise, within universities there can be a broad range of faculty. The best ones may be working in areas unrelated to you, and so they will push the prestige of the program but won't do much good to you. You also want to look at who you would actually work with and how good they are. Not just in terms of their reputation, but for supporting and preparing you for your future career.
And if you are doing an MS anyway, you should look at European universities that require an MS. This way the time you spent getting an MS is used more efficiently.