if a year ago, I would say your boss was an SOB
Now, I have to say you did not get the rule of game. Honestly, I am still struggling with this but started at least to recognize my problem. Sometimes, being smart is a burden. Learn to be a mediore person or better, make boss look smart. They actually can recognize your hard work and skills, but they do not want to appreciate it or reward you for it if you make them look or feel stupid.Many times, it is their insecurity but it does not matter by the end.