Thanks for the query.
During the last days of the periods some amount of spotting can be seen.Masturbation
might have stimulated uterine movement.
That might have led to coming out of collected blood from the uterus
Usually collected blood will appear dark in color.
So no need to worry.
You observe for one to two days.
If there is no further bleeding, the possibility of hymenal breakage or local injury
If the spotting persists, better to consult gynecologist once and get examined.
For more details you can ask me directly through the premium forum.