Is Treasure Hunting Legal

Is it legal to give away cash prizes for a contest of skill, where there is a small fee to enter?
I am thinking of opening a page competition website consisting of puzzles, figures, trivia questions, etc., together as a scavenger hunt online. Is it legal to charge a small fee to enter, then give away cash prizes to the winners?
I do not see why not. In a circus when you win the huge stuffed animals, which would to pay a dollar or two to play or a similar provision in vending machines.
Buddy and Dharma’s Treasure Hunt