Indeed, one of the most limiting factors about writing a CYOA mystery IS the mystery. Authors often want to make it difficult for the reader to quickly and easily solve the mystery -- but at the same time, the author also has to have a link right there in front of the reader that has the correct answer.
Of course, if you want to put more detail and work into it, it is possible to create situations using variables and code that will actually hide the correct answer from the reader until they actually discover the correct item to make that conclusion. While that might be more interesting, it can be hollow because while the reader may have clicked on the correct item, they might not have actually made the connection in their own mind until they actually see the new option to click on to solve the mystery.
So yes, read that one that mizal linked, but also give this a lot of consideration. Writing a CYOA can be difficult by itself to create a complete story that also gives the user control. To do so while introducing a mystery can be even more difficult. I'm not saying it can't be done, just that when you do plan it out, be sure that you have logical paths through the story that make sense no matter what choices the reader makes. If you're going to have an "end scene" where everthing is revealed, be sure that makes sense based on the choices that the reader picked. And if you're going to make it possible for the reader to pick the correct answers, you've got to make sure it is possible that they can pick the incorrect answers and potentially never solve the mystery at all!
I've toyed with the idea of a completition of sorts where the reader is trying to solve the mystery at the same time as other teams and if enough wrong choices are made, the mystery gets solved, just by someone else. That would allow the reader to see the correct solution eventually and still at least somewhat make some logical sense.
Good luck and feel free to share more thoughts and ideas behind the planning if you want more feedback from others.