An assessment of the world's coral reef ecosystems has found that almost all face a high risk of collapse in the next 50 years mostly due to warming oceans and heat waves.