Closedness of $C$ is irrelevant. Here's an argument:
Lemma.
- Let $f: X \to Y$ be a (not necessarily continuous) function between topological spaces which is closed, i.e., maps closed sets to closed sets. If $A \subset Y$ is arbitrary and $U \subset X$ is open such that $f^{-1}(A) \subset U$ then there is $V \supset A$ open such that $f^{-1}(V) \subset U$.
- If $X$ is compact and $Y$ is Hausdorff then the projection $\pi: X \times Y \to Y$ is closed.
Since $\pi^{-1}(C) = X \times C \subset U$, combining 1. and 2. with $A = C$ yields $V \supset C$ open such that $\pi^{-1}(V) = X \times V \subset U$.
Proof of 1: Since $f$ is closed, the set $V = Y \smallsetminus f(X \smallsetminus U)$ is open. Since $f^{-1}(A) \subset U$ we have $A \subset V$. Moreover, $X \smallsetminus U \subset f^{-1}(f(X \smallsetminus U))$ yields $f^{-1}(V) = X \smallsetminus f^{-1}(f(X \smallsetminus U)) \subset X \smallsetminus (X \smallsetminus U) = U$.
Proof of 2: Let $F \subset X \times Y$ be closed and let $y \in Y \smallsetminus \pi(F)$ be arbitrary. Observe that $F \cap (X \times \{y\}) = \emptyset$. Since $(X \times Y) \smallsetminus F$ is open and contains $X \times \{y\}$, the definition of the product topology yields for each $x \in X$ open sets $U_{x} \subset X$ and $V_{x} \subset Y$ such that $(x,y) \in U_{x} \times V_{x} \subset (X \times Y) \smallsetminus F$. Since $X \times \{y\}$ is compact, there are $x_{1},\ldots,x_{n}$ such that $X \times \{y\} \subset (U_{x_{1}} \times V_{1}) \cup \cdots \cup (U_{x_{n}} \times V_{x_{n}}) =: W$. By construction $W \subset (X \times Y) \smallsetminus F$ and the open set $V := V_{x_{1}} \cap \cdots \cap V_{x_{n}}$ contains $y$ and satisfies $\pi^{-1}(V) \subset W$, hence $V \cap \pi(F) = \emptyset$, hence $Y \smallsetminus \pi(F)$ is open.