A detective is an investigator, usually a member of a law enforcement agency. Some are private persons, and may be known as private investigators. Informally, and primarily in fiction, a detective is any licensed or unlicensed person who solves crimes, including historical crimes, by examining and evaluating clues and personal records in order to uncover the identity and/or whereabouts of the criminal.
A mystery is something that is unexplained, unknown or kept secret. In the Mystery genre, gameplay or story usually revolves around solving or shedding light on the "mystery".