diff --git a/apps/web/src/arcade-games/card-sorting/components/ResultsPhase.tsx b/apps/web/src/arcade-games/card-sorting/components/ResultsPhase.tsx index 194d6205..7649d2e9 100644 --- a/apps/web/src/arcade-games/card-sorting/components/ResultsPhase.tsx +++ b/apps/web/src/arcade-games/card-sorting/components/ResultsPhase.tsx @@ -39,10 +39,13 @@ interface CardPosition { } export function ResultsPhase() { - const { state, startGame, goToSetup, exitSession } = useCardSorting() + const { state, startGame, goToSetup, exitSession, players } = useCardSorting() const { scoreBreakdown } = state const [showCorrections, setShowCorrections] = useState(false) + // Determine if this is a collaborative game + const isCollaborative = state.gameMode === 'collaborative' + // Get user's sequence from placedCards const userSequence = state.placedCards.filter((c): c is SortingCard => c !== null) @@ -118,6 +121,12 @@ export function ResultsPhase() { const isExcellent = scoreBreakdown.finalScore >= 80 const getMessage = (score: number) => { + if (isCollaborative) { + if (score === 100) return 'Perfect teamwork! All cards in correct order!' + if (score >= 80) return 'Excellent collaboration! Very close to perfect!' + if (score >= 60) return 'Good team effort! You worked well together!' + return 'Keep working together! Communication is key.' + } if (score === 100) return 'Perfect! All cards in correct order!' if (score >= 80) return 'Excellent! Very close to perfect!' if (score >= 60) return 'Good job! You understand the pattern!' @@ -358,6 +367,25 @@ export function ResultsPhase() { + {/* Team/Solo Label */} + {isCollaborative && ( +
+ 👥 Team Score +
+ )} +
+ {/* Team Members (collaborative mode only) */} + {isCollaborative && players.size > 0 && ( +
+
+ Team Members ({players.size}) +
+
+ {Array.from(players.values()).map((player) => ( +
+ {player.emoji} + {player.name} +
+ ))} +
+
+ )} + {/* Score Details - Compact Cards */}