I spent a year in child custody court and went all the way to a trial where I was finally awarded full custody and legal gaurdianship of my youngest daughter.
First thing I did was get the best female lawyer I could find...she was $350 an hour and almost every little contact (email, phone call, text) was billed at the very least a half-hour...so just be ready to spend some money.
As long as there is no proof of wrong doing or aas use you will be fine, if she ever snapped off a photo on her phone of your vials or needles and syringes then you will have some explaining to do. Dont make any accusations without proof of your own either because they wont matter and the judge will completely disregard them. Both parties usually will be required to do an assesment, usually for alcohol/drug/criminal stuff where a "counselor" just asks you tons of questions all day long and compiles an assesment on what type of person you are...I thought it was completely idiotic but the courts seem to hold that report in high regard.
Lastly do your own detective work...if she's a wack job then there should be a paper trail to prove it and its all online somewhere you just have to find it. I compiled a ton of arrest reports including drugs, violence, and an all together unfit lifestyle to raise a child in so thats why I won...your situation may be different. Good luck!