How many religions can a Civ VI game have?

After a little more research, I still don't have a definitive answer, but here's my semi-educated theory:

Like Civ V, the base number of religions per game is tied to the map size, according to the following distribution:

╔════════╦═════════════════╦═══════════╗
║  Size  ║ Major civ count ║ Religions ║
╠════════╬═════════════════╬═══════════╣
║ Duel   ║ 2 (default)     ║ 2         ║
║ Tiny   ║ 4 (default)     ║ 3         ║
║ Small  ║ 6 (default)     ║ 4         ║
║ Normal ║ 8 (default)     ║ 5         ║
║ Large  ║ 10 (default)    ║ 6         ║
║ Huge   ║ 12 (default)    ║ 7         ║
║ Huge   ║ 10              ║ still 7   ║
╚════════╩═════════════════╩═══════════╝

I got these numbers by actually starting a new game with each of the initial condition combos (playing as Catherine de Medici, starting in the Ancient Era). I beelined for starting a religion and checked the "All Religions (1/n)" button after doing so.

There are exceptions, though. In particular, game era makes a difference. Quoting page 133 of the game manual:

Great Prophets are no longer available when starting the game in the Industrial Era or later.

So there's no religion at all in games that start halfway through history. My guess is that this is because the game's Great Prophets all come from three eras: Classical, Medieval and Renaissance. So even if your game still has available religion slots left (like mine), you could miss out on getting to found a religion if you've progressed to a later era or all the Great Prophets from your era have already been generated. (This doesn't work the other way around, though; I was able to generate a Classical Era Great Prophet while still in the Ancient Era, and successfully founded a religion with that unit.)

There's still a hole in this theory: I loaded an earlier save file for my game, when I was still in the Renaissance Era, and the "All individuals of this type [Great Prophet] have already been earned" message was already there.