export type ArtifactSlot = "flower" | "plume" | "sands" | "goblet" | "circlet";

export type ArtifactVerdict =
  | "keep"
  | "maybe_level"
  | "character_specific"
  | "trash_candidate"
  | "needs_review";

export type ScanSource = "mock" | "screen" | "overlay" | "good_import" | "manual";

export interface ArtifactSubstat {
  key: string;
  value: number;
  unit: "%" | "flat";
}

export interface Artifact {
  id: string;
  setKey: string;
  setName: string;
  slot: ArtifactSlot;
  rarity: 4 | 5;
  level: number;
  mainStat: string;
  substats: ArtifactSubstat[];
  equipped?: string;
  locked: boolean;
  source: ScanSource;
  confidence: number;
  lastSeenAt: string;
}

export interface Character {
  id: string;
  name: string;
  owned: boolean;
  level: number;
  constellation: number;
  rolePreference: CharacterRole;
  confidence: number;
}

export type CharacterRole =
  | "main_dps"
  | "sub_dps"
  | "support"
  | "healer"
  | "reaction";

export interface CharacterPreset {
  characterId: string;
  role: CharacterRole;
  recommendedSets: string[];
  alternativeSets: string[];
  mainStats: Partial<Record<ArtifactSlot, string[]>>;
  substatWeights: Record<string, number>;
  erTarget?: number;
  explanation: string;
}

export interface Recommendation {
  artifactId: string;
  verdict: ArtifactVerdict;
  score: number;
  bestCharacters: string[];
  reason: string;
}

export interface BuildSuggestion {
  id: string;
  characterId: string;
  label: string;
  quality: "recommended_set" | "alternative_set" | "rainbow";
  artifactIds: string[];
  score: number;
  warnings: string[];
  explanation: string;
}

export interface ScanEvent {
  id: string;
  type: "environment" | "character" | "artifact" | "review" | "complete";
  label: string;
  detail: string;
  confidence?: number;
}

export interface AppSnapshot {
  artifacts: Artifact[];
  characters: Character[];
  recommendations: Recommendation[];
  builds: BuildSuggestion[];
  scanEvents: ScanEvent[];
}
