Daily Puzzle

I am not understanding this quite well. Let's assume, just for the sake of it, Ricky is thinking of 7D in the first place. The dialogue would go still the same way between rest of the two except for the last line from Dan. My confusion is here: Despite response from Dave being the same in both cases (picked card being 6S or 7D), how can Dan come to a conclusion !? I understood the part that we are deriving the answer as 6S by taking into account the last line from Dan - but that very line seems odd or illogical to me.

Whole premise of the answer is around Dans last line, but there is no logic for Dan to comment anything (either he knows or he doesn't).

Am I missing something here ?

/r/puzzles Thread Parent Link - i.redd.it