So this is my Wikia.css so far. The infobox CSS was made a while ago and I simply copy-pasted it, so I'm not sure how to go about changing it. I have tried adding themes, but everything I try results in either no changes at all, or the infoboxes trying to use a theme I've defined even when they're not supposed to. I've tried looking at other wikis' Wikia.css but they don't even have their themes defined directly on there.
Basically, I turned this template into an XML infobox. The problem was that the template used to have different colours depending on the context, so I've been trying to at least be able to put different colours on individual infoboxes again using themes. As you can see on the Wikia.css, I started with making a theme that would just specify the background colour of the body portions of an infobox. However, when I try to instance the template with the theme source parameter set to the theme, it does nothing. I tried moving the existing background parameter in the CSS to a separate .pi-theme-wikia theme, but that caused every template to use the test theme's background colour.
Most of the examples have a space but if you look at the example specific to changing the infobox background, you will see that there isn't one. The reason for this is explained in this section of the help page.
If you want to learn more about the different types of CSS selectors, I suggest you start by reading this.