This study examines the effects of competitive versus cooperative gamification mechanics on the learning achievement of female first-year middle school students in flipped classrooms, highlighting its implications for designing sustainable learning environments. Employing a quasi-experimental design, 60 students were randomly assigned to two experimental groups, each engaged in a flipped classroom environment with either competitive or cooperative gamified elements. While both groups showed significant improvement in post-test scores, no significant differences were observed in cognitive achievement or skills acquisition between the groups. These findings emphasize that competitive and cooperative gamification mechanics can be equally effective in enhancing learning, suggesting that the choice of mechanic does not critically impact learning outcomes. The study provides practical guidance for educators and instructional designers in developing balanced gamified learning environments that optimize competitive and cooperative strategies, thus fostering a more versatile and adaptable approach to student motivation and engagement in sustainable technology-enhanced education.