Okay basis of a flame emits lots of IR
So using "line tracer" which are actually IRs, make a nice tube around the IR window to block out ambient light. Maybe want to tweak/mod it to disable the IR emitter.
Similar to the above post on putting a tube around light sensor but I think IR may be better suited
cheers