a problem?

the last day of my last period was 16 days ago, and I got my period again yesterday. I didn't think much of it because my schedule is all over the place and in predictable. today I had gym and I was playing basketball (wearing a tampon) and I went to the bathroom and my liner was soaked with blood. I put the tampon in right I'm pretty sure, but when I removed it it didn't fully expand inside me and it was kind of painful. I left it in for about three hours, so why did it hurt? I don't know what to do right now and I'm kind of freaking out! :')