An effective theory of quarkonia in QCD matter