If any elements of the game are protected by copyright, then you cannot reproduce those elements (17 U.S.C. §106) unless your reproduction falls under a fair use exception (17 U.S.C. §107).
Elements that may be protected by copyright include:
- specific language on each card
- the aggregate effects of the cards (i.e. copying a single card's effects might not infringe copyright, but if you copy the effect of a bunch of the cards, such that you are taking expression of the original author's creativity, that might infringe, even if you change the words used)
Whether an element of the game is protected by copyright is a fact-intensive question that would depend on the specifics of the game. Whether your copy infringes is likewise a fact-intensive question that would depend on what you copy.
Fair use is also a fact-intensive, case-by-case analysis, but in my opinion, it is likely that creating a computer program derivative work (17 U.S.C. §101) of the game for your own personal education would be considered fair use. From a practical standpoint, even if it were not fair use, it would be near impossible for the copyright owner to discover.
Posting the code on GitHub tips the scales away from fair use because of (17 U.S.C. §107(4)): "the effect of the use upon the potential market for or value of the copyrighted work." But, none of the factors are determinative on their own.
I likely cannot simply change all the names of the various cards to something else, right?
I agree. In my opinion, the selection and arrangement of the effects attributed to each card is an expression of the author's creativity, and no matter what you call the cards, copyright in the game would be implicated if you retained the effects associated with each card.
If I start changing the rules of the game, does that make it legal for me to share my source code, for instance?
At some point, it will be an entirely different game, so certainly, in the limit, your work would not be infringing. We can't answer where that line is, but in general, the less of the original author's creativity that you re-use, the less likely a ruling of infringement. Also, in general, the more transformative your work is, the more likely a fair use exception would apply.