captivity
The state of being kept somewhere and not allowed freedom.
Captivity means the state of being captured and held somewhere against your will, unable to leave freely. When an animal lives in captivity, it means the animal is kept in a zoo, aquarium, or wildlife preserve rather than roaming wild in its natural habitat. A bird in a cage lives in captivity. A tiger at the zoo is in captivity, even if its enclosure is large and comfortable.
The word applies to people too. Prisoners of war are held in captivity by enemy forces. In historical accounts, you might read about someone escaping captivity after being captured by an opposing army. The essential meaning is always the same: someone or something is being kept confined and prevented from being free.
Captivity is different from simply being indoors or in an enclosed space. You're not in captivity when you're at school or in your house, because you can leave when appropriate. But a dolphin at a marine park, no matter how well cared for, lives its entire life in captivity because it cannot swim away to the open ocean.