Listen to manufacturers and keep your phone out of humid spaces.
Most current smartphones feature an IP67 or IP68 rating, with the second numerical digit representing water-resistance levels. Neither IP number should ever be confused with "waterproof," and hot steam is a different animal altogether. Phones are generally described as water-resistant, though the term "waterproof" is inaccurately tossed around a bit.
Enough that some assume their phones can tolerate water in any scenario.
In a hot shower, that steam can turn back into a liquid, both on and around your phone. Combined with heat, it will gradually wear down the built-in protections that keep liquid out.
Apple's Support page states that iPhone owners should avoid saunas and steam rooms, and reminds them that liquid damage is not covered under warranty. Google says the same.
Water resistance ratings are specific to liquid water under certain conditions, not the heat and humid air from a shower. Worse, rapid cooling in a moist environment creates condensation, both inside and outside the device.
Though it's a separate danger, overly hot bathrooms, saunas and steam rooms can raise temperatures above a smartphone's operating specs. Most phones have a maximum operating temperature of 95 degrees and not much higher when sitting unused.
Besides, placing your phone on a shower shelf or soap dish, especially if it's close to the spray, is just asking for it. Trying to handle a phone with wet hands is a recipe for drops. Keep it outside the bathroom if possible and use a portable Bluetooth speaker.