Adaptation and competition in deteriorating environments