Tuning parameters for flame-retardant coatings on wood and polymer