Detect winning condition.