Osaka used to be a child prodigy like Chiyo-chan.
When she was ten, she went to high school back in Osaka, but the stress of being a child prodigy and having so much expected of her (especially in Japan's workaholic society), caused her to have a total mental breakdown. She institutionalized for a few years after that, and subconsciously feigns stupidity due to fear that if people realized how smart she was, she'd feel all the pressure all over again. When she was released, her family moved out of Osaka to take a new start, but Osaka is still fully medicated (see the theory on her being on drunks above), which has an occasional side-effect of hallucinations. She's good at puzzles and tricks and such because she figures it's a stress-free way for her to be smart.