The previous owner of our home had a shoddy job down on some stairs leading to a rec room carved out of some of the attic space. There are four stairs leading up to the room, and under each one is a gap about half an inch wide and deep. There are vertical gaps alongside the stairs, too, but nowhere near as bad. Here's a photo of all the stairs, with a closer look at a couple of the gaps further below:
I'd like to fill in these gaps between the drywall under the stairs and the stairs themselves so that I can then paint over them to make it look much nicer, but I'm not sure what the best material would be to do that. I'm considering wood filler, joint compound, or a foam sealant such as Great Stuff. Would one of these be ideal for this job, or is there something else I should consider? Not having done a DIY project like this before, I don't know what material would be ideal for filling gaps between drywall and the wood planks that make up the stairs without too much worry of future cracking.
Here's a close-up of a couple of the stairs to give you a better idea of what the gaps are like: