Wow sounds like you failed to play the office politics game effectively. Good performance is never enough. You don't play the game and you lose, 100% of the time if you are in management.
Ok now you have to salvage what is left. First, and I know you are going to hate this one, you have to make friends with your new boss. You have to get him to mentor you. You have to help him and not show your resentment. Yeah I know you resent him, you wouldn't be human if you didn't. But this is the time to take the high road. This guy clearly has the office politics down pat, you need to learn from him.
You need to make sure that if team performance drops it can't be blamed on your attitude. So you have to be seen as cooperating with this guy. You also have to let your team know that they will have to cooperate with him too. Whether they like him or not.
They didn't take your management title away, but it may be a matter of time if this guy takes a dislike to you. Consider if now might not be the best time to find another job. You still have the title, so it might look better on resume and in interviews if you move while you still are officially a manager.