In Russian, animate and inanimate nouns inflect differently. Let's compare "кабан" and "стакан":
Я вижу кабанов. Я стреляю в кабана.
Я вижу стаканы. Я стреляю в стакан.
It is all easy-peasy unless it comes to situations where animate nouns are used to figuratively call inanimate objects and vice versa. That is, situations where the grammatical animacy is in conflict with the physical animacy. I am totally confused as to what is the rule for such situations, and am very much overwhelmed by apparently inconsistent examples I found in the Internet.
Let's consider the word "козел." Usually this noun means an animal, namely a goat, but can also be used to figuratively call a man, namely a kind of stubborn badass, and is also a figurative name for a gymnastic tool. I see in the Internet that when people talk about this gymnastic tool, they inflect it as an animate noun: "Перепрыгнуть через козла," not "перепрыгнуть через козел."
But now let's consider the word "зебра." Normally this noun means an animal, namely a zebra, but is also used to figuratively call a pedestrian crossing. And when people talk about pedestrian crossings, they inflect the noun as an inanimate one: "Они наносят зебры," not "они наносят зебр."
I am totally confused by this. There are two nouns, each primarily meaning an animal, and when these animals are used to figuratively call inanimate objects, one of themthese animals remains grammatically animate and the other one does not. I am at a loss as to where the logic is and what I am missing. There might be some deep principle I have failed to surmise.
Okay, I can simply look in a dictionary and blindly memorize such things, simply ignoring the apparent logical inconsistency, but I am puzzled as to what I should do when the figurative use of the noun is not very common or when I am the first to figuratively use the nounit. For instance, I am puzzled what I should do in the following three cases:
Case 1: The word "тараканы," usually meaning cockroaches, is sometimes used to speak about psychological issues. For the latter meaning, I do not know how I should write: "Я вижу всех твоих тараканов" or "я вижу все твои тараканы."
Case 2: The word "валенок," usually meaning a special kind of shoe, is sometimes used to speak about an uneducated villager. I do not know what is correct: "Не хочу учить валенки" or "не хочу учить валенков."
Case 3: Let me now give you an example of situation in which I am the first to use a noun figuratively. I often play gomokunarabe, a Japanese game characterized by a virtually infinite number of opening variants, which can be divided into a number of classes. For openings of one class I myself use the word for a ray, a maritime fish known in Russian as "скат." I am puzzled how I should say in Russian, meaning an opening of that class: "Я изучаю скат" or "я изучаю ската." Or this dilemma: "Я решила поставить на доску скат" or "я решила поставить на доску ската."
My question is this: What rules, logic, or general principles are there for inflection of animate nouns when they are used to figuratively call inanimate objects, and vice versa? I would be also grateful for responses to cases (1)-(3).