You also have to be very careful not to judge the living situation at the mother's. You want your living situation to be accepting, which includes accepting what she has to go through at her mom's. If you can do this without creating any animosity between the mother's situation and yours, the daughter will start to make good choices on her own. As Windy city put it, you can be a fantastic role model and hopefully, she'll gravitate towards that.
Don't feel you have to 'whip that kid into shape'. that will also create animosity. Acceptance, love and boundaries will get you far.