I think your parents are being a little harsh because you are troubled, and punishing you is only going to make you go down hill even more. Isolating you is going to do more damage, rather than protect you. What they should have done was actually sit down with you and talk this out. You are young, so thoughts and feelings can get confusing. So you vented a little darkness...lots of kids do that but most don't mean it. It's a cry for comfort and support...your parents have missed the mark on that. What you do about this is up to you. You know you need to do it but are you going to? Are you going to risk it? Maybe have some time to think about the consequences, hash out the pros and cons.
I suggest you take up art or play an instrument to express yourself/ be creative during your time without devices. I think if you show them you can fill your time with positive things, and follow their instructions to breakup with him, you will probably get your phone back.