Dynamic difficulty calculation