Conan and Kogoro spy on Ran, Sonoko and Masumi who are having some lunch at Café Rice Flower, all the while marvelling at the pictures of a travel guide. Suddenly, one of the waiters is found dead, bludgeoned in the staff room. Conan hardly tries to solve the case while at the same time thinking about cracking Ran's secret. Masumi investigates as well.

The culprit is Isuzu Naomura. The victim destroyed her family's café by critizing it on his blog and her parents committed suicide because of it. While the quality of the food did get worse, Isuzu was enraged that the victim had claimed to be a regular customer of the café, but didn't seem to know her when they first met, meaning that he never ate at the café and just based his review on gossip.
It turns out that the secret trip to Kyoto is a field trip with the school.

Conan tries to convince Haibara to give him some antidotes in order to go to the Kyoto trip with Ran in his adult form. Haibara keeps refusing, and suddenly she finds out she lost her Higo puppet phone strap this latter gave her in the bleacher during the football match. She freezes in fear and grief and cuts herself off from everyone. Conan makes a deal with Haibara : he'll go and backtrack with the Detective Boys to find her phone strap, in exchange for the antidotes. Conan and the Boys are helped by Bourbon and rush to the train stations' lost property, all the while being spied on by a strange man.

Conan and Bourbon deduce that a boy from the train mistook Haibara's puppet for his own after the train suddenly and abruptly braked, as everyone lost their balance and kids fell on the ground. They also believe that the boy and his dad were on their way to a certain beach to gather seashells, something they would usually do as they were very tan. Bourbon asks his colleague Yuya Kazami to board the train Conan and co took and to check the words the little kid left on the train compartment window after blowing mist over it. The boy actually wrote his name, Yuuto. At the beach, Conan and co asks for Yuuto and his father. These latter apologise and give Conan back Haibara's puppet, in exchange for Yuuto's one Conan found at the lost property. But the mysterious man spying on them grabs it and runs away.

Conan and the Boys eventually find the thief again, who had quickly bought new clothes to leave the beach incognito. Conan and Bourbon reveal he is a jewel trafficker as he had hidden a precious ring in a Higo puppet, and he lost it during the train's sudden braking, and he did accordingly everything to recover it, following the Boys to find the two other Higo puppets. Actually, the man says he's not a trafficker as the jewel was for his girlfriend and he didn't want to lose this engagement ring. He didn't think of explaining the situation to the detective boys, because he got frighten of Ayumi's statement, that they wouldn't give the charm to anyone. Conan and Bourbon realise there are actually three puppets, the man's one with the jewel, Yuuto's one and Haibara's one, which had fallen into Genta's hood in the train. Genta remembers he put his hood on at the diner's car park as it was raining and a few things fell from it, including his detective badge. They go back to the diner's park and find indeed the puppet under a car, but completely soaked and dirty. Conan has caught a cold by jumping into the sea to protect the man's puppet. When he gives Haibara the Detective-Boys-mended-and-cleaned but horrible-looking Higo puppet, Haibara gets in a fit of rage and says she'll never give any antidote to Conan ever.

Shinichi eventually manages to take part to the Kyoto trip with Ran and their friends, thanks to the series of antidotes Haibara gave Conan. Each time Conan takes an antidote, he has to wait 8 hours after the back shrinking before taking another one. Shinichi and Ran secretly hope that Ran will give an answer to Shinichi's love declaration back in London. On the Kiyomizu-Dera, Shinichi meets Keiko, an actress and old friend of his mother, who stays in the same hotel as Shinichi and his class, with some university friends with which she shot a blockbuster revolving around a tengu and other monsters. She asks Shinichi to help her to decipher a mysterious code written and sent by their late friend Michio Dekuri, who committed suicide some time ago. The code was received by Nishiki, the movie's screenwriter, along with red aralia leaves, typical from Kyoto. Shinichi tries to solve it, while enjoying Kyoto with his friends, in particular Masumi, who knows Conan is Shinichi but still keeps it a secret. The group of friends visit Kyoto's temples and their gruesome crimson ceilings, that were at first the temple's floors spilled with the blood of samurais who committed mass suicide/seppuku and left many footprints, it was so astounding that the floors were kept and turned into ceilings. A mysterious tan man with a big backpack looks at his watch all the while gazing at Shinichi. Back to the hotel, Shinichi still struggles with the code when Keiko calls him in emergency, he rushes to Nishiki's room and they find the screenwriter stabbed to death, with two bumps on his forehead, his notes spread everywhere and his room's ceiling covered with blood and footprints that lead to an opened window.

The mysterious man observing Shinichi is Heiji Hattori. Inspector Ayanokoji from the Kyoto Police is called for the investigation of Nishiki's murder. Another code and aralia leaf was found in his jacket, suggesting that there may be other victims. The blood on the ceiling was actually red painting. Shinichi rushes to his room as he suddenly feels the usual shrinking pain, he pretends a cold and hides under his blanket, starting to scream. As Nakamichi comes closer to check if everything's okay, Heiji Hattori, who was under the bed, switch places with Conan and shouts with a kansai-accent voice to leave him alone. Heiji has to stay under the blanket, pretending to be Shinichi, and Conan stays under the bed, until the morning. Conan then takes another antidote and as he receives another mail from Keiko, he runs with Heiji to Agata's room, Keiko's freind and art specialist, who has been yelling since a moment. As a groom opens his door, they see Agata on the floor, shaking in fear, being watched by a huge and freaky tengu. Agata throws an ashtray to it and the tengu vanishes in an explosion.

Shinichi is having breakfast with Masumi and they talk about the tengu and the two bumps Agata received on his forehead, along with the aralia and another code, which reminds Shinichi that Keiko also got a bump during a filming accident. The bumps remind them of the Kabutori tale. Ran turns up, very angry, having been told by Nakamichi and many others of the class that Shinichi had said he and Ran had snogged each other in London. Shinichi denies it, remembering Heiji's blunder yesterday. Meanwhile Masumi is kidding Shinichi with his "too short or too long tracksuit". They have a look at Keiko's upcoming movie's poster with the tengu and Shinichi tells the whole story, especially the suicide of Keiko's husband in the film, who became a tengu afterwards, and the kissing scene at the end on the Kiyomizu-Dera. Ran remembers seeing Keiko commemorating the death of her friend Dekuri, on the Kiyomizu, with great sadness. As Shinichi and co wonder where to go sightseeing today, Shinichi receives a call from Heiji telling him that Nishiki's four friends are going with the police in a Kyoto city centre restaurant to make it clear about who Dekuri was and why he had made these codes, as someone seems to try and avenge his death. Shinichi then proposes Ran and co to have lunch at the same restaurant. Once in front of it, they meet Momiji Ooka who was searching for a place where to have lunch too and who explains what an inuyarai is, the strange big curved wooden box on the walls of the old houses, built either to stop thieves or prevent dogs from urinating on the walls, or to mark the street out. Ran asks Momiji about Soshi Okita, the kendo practitioner, and she replies she knows him well, he's in her class. As they're entering the restaurant, people start screaming that tengus are everywhere in the street and harassing people. The police, Heiji, Shinichi and the others make teams and chase the tengus. Momiji and Sonoko are rescued by Iori. When the tengus are arrested, they are revealed to be people who agreed to win 100,000 yens in exchange for playing monsters in the street around the restaurant. Heiji and Shinichi understand that this was a trap to keep police and witnesses away from the restaurant, and they backtrack as quick as possible, only to find the dead body of Ihaya, Keiko's movie's main actor, whose throat was slit, and whose blood was probably used to make footprints, which seems impossible as there has only been a few minutes between the time when Shinichi and co left and when they returned.

While investigating the murder, Shinichi makes a blunder and imitates Conan's voice, making Ran upset and Masumi smirking. Another code with an aralia is found in Ihaya's pocket. Kazuha calls Heiji in anger and asks him why the media are filming him next to Shinichi in Kyoto, and Heiji replies he went to Kyoto to look for a talisman to cure his cold. Momiji suggests the characters on the codes look like the names of streets and districts of Kyoto. Momiji takes Heiji's phone and taunts Kazuha about Heiji being for her and not for Kazuha/Happa-chan. Keiko, Agata and Mayama, the film director, tell Ayanokoji about Dekuri, who was mad at his friends for adapting his manga as a movie without his permission, and decided to dump them and stand away from them. Some time after, he called them to ask if they could make sure his name appear somewhere in the movie, as he acknowledges it is good work after all. But when he went to see the preview, he found his name nowhere because of a mistake from the producers, and threw himself from the Kiyomizu. Just as Ran wanted to meet Okita, she comes across him near the restaurant. Okita had come with friends to catch the tengus. Sonoko realises Okita really is Shinichi's lookalike. Ran says she wanted to talk to Okita, the latter being very pleased with it. Ran takes him aside and tells him something very secretive and intimate. In Los Angeles, Yukiko and Yusaku answer to their son's call for information about Keiko and her friends. Yukiko says Keiko's stage name is Kyoko, she changed her name due to something that happened in university. She says Nishiki and Mayama also changed name for the movie. Yukiko says maybe what happened at college for Keiko was that she secretly loved another student, to the point she is still not married today, as she keeps thinking about him. Yusaku hints at the fact it may be Dekuri, and Yukiko asks him why. Sonoko sends Shinichi a picture of Ran and Okita very close and talking together in secret, which upsets Shinichi. Ran is surprised to see Heiji in Kyoto as well. The group then heads for the hotel, as there's something weird with the booking of the rooms of Keiko and her friends : Nishiki tried to book a smoking room but there was none vacant in the whole hotel, but afterwards someone called right after and checked out all the rooms. Shinichi keeps thinking about Okita and wonders if Ran really fell in love with him, tired to wait for Shinichi. Suddenly, Shinichi feels the shrinking pain again just as he finds out the truth on the serial murders, and he quickly asks for the help of Ayanokoji for a special plan.