People saying "this is all illegal in court", but you all need to know that the Judicial system of Japan is beyond fucked up, with 99% conviction rate of every person that's arrested.
The Police can stop and detain a person up to 20+ days without any kind of proof, as they mostly try to make the detained sign a paper with the admission of the crime, even with no certain and inescapable proof.