The answer is n=9. Interpret the cards as elements of F33, and note that the matching condition of three cards with corresponding elements a,b,c is equivalent to a+b+c=0. A construction for n=9 is (1,1,0),(−1,1,0),(1,−1,0),(−1,−1,0),(0,0,1),(0,1,−1),(1,0,−1),(0,−1,−1),(−1,0,−1). Now, we show that among any 10 elements of F33 there are three distinct ones summing to 0.
Suppose we had a subset A of F33 with |A|=10 and no three elements of A summing to 0. First, we claim that there exist w,x,y,z∈A with w+x=y+z. Otherwise, there cannot be any repeats if we take pairwise sums of the elements of A, a contradiction as \binom{10}2>3^3.
Now, take a linear transformation that sends w,x,y,z to (1,1,0),(-1,1,0),(-1,-1,0),(1,-1,0). The condition is clearly preserved under this transformation. Now, note that there cannot be any other points (p,q,0) in A and that for any (a,b,c) in A with c\ne 0, none of the points (\pm 1-a,\pm 1-b,-c) can be in A. In particular, this means that if we have at least two points with z-coordinate 1, then the set of available points with z-coordinate -1 either has size less than 3 or consists of three collinear points. This means that we cannot have at least two points in both the planes z=1 and z=-1. Thus, one of those planes must have 5 points. It is not hard to see that the answer to the 2-dimensional version of this question is 4 by some Pigeonhole, so we have a contradiction and are done.