As you can see, both codes are read which causes your error. Restrict it by using min-width and max-width.
Remember that the codes at the bottom have the highest priority. You can try to reverse the order of @media, but I strongly recommend limiting by min and max.