I think you're describing the "Diadem" series of books by John Peel
- Magical portals - Check
- Modern girls travelling to a magical realm - Check
- Magical Gemstones - Check (including one with healing properties)
- Baddies called "the Shadows" - Check.
The only thing I can't place is the flute but there are definitely unicorns present
Diadem chronicles the adventures of three teenagers from very different worlds. Score is a streetwise New Yorker, Renald lives in a Medieval world where she readies herself for battle, and Pixel is confined to a one-room world of Virtual Reality. But now they all exist in the Diadem, the circuit of all worlds where their awesome purpose unfolds
After her guise as Renald was ruined by Oracle, she planned to run away. As she was leaving, the Shadows inhabited a group of soldiers sent by the border lords to kidnap her and hold her for ransom but she was rescued and brought to Treen by Rahn, a leopard Bestial. After reaching Dondar, she bonded with Flame, her unicorn friend, and the two are very close. Flame is the daughter of Thunder and Nova, and she seems to be the only person Helaine will open up to. Helaine's main magic ability is the power to foresee trouble. Her powers with the gemstones are levitation, communication, earth, and shape-shifting.