Two very simple options for text against variable background would be to add a contrasting stroke, or a drop shadow [spread evenly as a fade, not as a true 'drop'].
Use white with backblack text & black with white text - but don't mix the two.
Examples - rough as heck because the original is tiny…