As a parent, you naturally retain parental rights by law. You have the right and responsibility to raise your child. You also have the responsibility to support and care for your child.
In Maine, family law judges are responsible for making decisions that they determine to be in a child's best interests. While state laws are written where it shouldn't matter whether the child's gender is aligned with that of the parent requesting custody, there are other factors that shape custody decisions.
As a custodial parent, it's partially your job to foster a good relationship between your child and your ex-spouse -- even if you can't stand your ex.