export interface Player {
  id: string;
  name: string;
}

export interface Card {
  id: string;
  suit: 'Schellen' | 'Schilten' | 'Eicheln' | 'Rosen';
  value: number;
  x: number;
  y: number;
  width: number;
  height: number;
  confidence: number;
}

export interface Round {
  id: string;
  cards: Card[];
  piles: Record<string, string[]>; // player id -> card ids
}

export interface Game {
  id: string;
  date: string;
  players: Player[];
  rounds: Round[];
  finalScores: Record<string, number>;
}

export interface GameState {
  currentScreen: 'setup' | 'camera' | 'results' | 'history';
  players: Player[];
  cardValues: Record<'Schellen' | 'Schilten' | 'Eicheln' | 'Rosen', number>;
  currentRound: number;
  detectedCards: Card[];
  gameHistory: Game[];
  cameraStream: MediaStream | null;
}

export interface DetectionResult {
  cards: Card[];
  error?: string;
}