How much Gold and Mana is actually at risk when you are attacked?

//ads -- adsterra.com -- native banner
?>
I've noticed that when I am attacked while offline and I lose 100%, I don't lose all of my gold and mana.
I have a tendency to get a little nervous if I have 8 hours left in a worker's job and I have high reserves of gold and mana laying around. This makes me want to spend some of my gems on either a shield or to just finish the job early so I can spend my currency on the next job.
What determines how much of my gold and mana is at risk to an attacking player?
Pictures about "How much Gold and Mana is actually at risk when you are attacked?"



Hack Your Body To Have Superpowers
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Karolina Grabowska, Karolina Grabowska, Karolina Grabowska, Karolina Grabowska