// 每位玩家头像的统一来源：座位号 → 真人头像图 + 回退色相
// SeatView 与结算列表共用，保证同一玩家头像一致。

const AVATAR_HUES = [210, 145, 350, 275, 32, 185];
const AVATAR_IMG_IDS = [12, 47, 5, 9, 16, 25, 33];

export function seatIndex(seatId: string): number {
  return seatId === 'hero' ? 0 : parseInt(seatId.replace(/\D/g, ''), 10) || 0;
}

export function avatarHue(seatId: string): number {
  return AVATAR_HUES[seatIndex(seatId) % AVATAR_HUES.length];
}

export function avatarUrl(seatId: string): string {
  return `https://i.pravatar.cc/120?img=${AVATAR_IMG_IDS[seatIndex(seatId) % AVATAR_IMG_IDS.length]}`;
}
