I think Under the Never Sky would work for mature twelve year olds, but it's really better for teens. It used to be one of my favorites.
https://www.goodreads.com/book/show...?from_new_nav=true&ac=1&from_search=true

https://www.commonsensemedia.org/book-reviews/under-the-never-sky


Happiness can be found even in the darkest of times, if only one remembers to turn on the light.