If, by any chance, the "friend" whose Apple Account you logged into ("to get some free paid games") was actually a scammer, who immediately locked your phone and demanded ransom, your phone is lost to you.
The scammer would no doubt have placed your phone into Lost Mode. Even if you have otherwise acceptable proof of original purchase, Apple will not remove Activation Lock from a phone that is in Lost Mode.
Paying the scammer would be a bad idea because they might just keep extorting more and more payments from you without ever releasing your phone. Then you would lose both your money and your phone.
I'm afraid that if you have fallen for a scam of this type, your phone is now a useless "brick", fit only for recycling and for teaching a very painful lesson: NEVER, EVER log into someone else's Apple Account on your next phone!!!