Here is something very simple: every star is a trophy. You 3 star a base? You get +3 trophies! You 2 star a base? You get +2 stars! You fail your attack and get no stars? You get 0 trophies (why on earth should I be losing trophies when I get no stars? I never understood this!)
You only lose trophies when one attacks you and defeats you, and again you lose as many trophies as the stars you concede to the opponent.

