// VibraMatch — shared mock data grounded in the real app
// Padel-only. Group-scoped ELO. Provisional flag at <10 games. Match feed = winners beat losers.

const ME = { id: 'me', username: 'Aitor V.', avatar: 'Aitor V', elo: 1284 };

const GROUPS = [
  { id: 'tuesday', name: 'Tuesday crew', memberCount: 8,  myElo: 1284, myRank: 3, myDelta: +12, isProvisional: false, streak: 'W3', topPlayer: 'Marta R' },
  { id: 'office',  name: 'Office Smashers', memberCount: 11, myElo: 1196, myRank: 6, myDelta: -8,  isProvisional: false, streak: 'L1', topPlayer: 'Pep S' },
  { id: 'sunday',  name: 'Sunday Doubles', memberCount: 4,  myElo: 1342, myRank: 1, myDelta: +18, isProvisional: false, streak: 'W5', topPlayer: 'You' },
  { id: 'cala',    name: 'Cala Padel',    memberCount: 6,  myElo: 1098, myRank: 4, myDelta: null, isProvisional: true,  streak: '—',  topPlayer: 'Jon A' },
  { id: 'liga',    name: 'Vallhonrat liga', memberCount: 24, myElo: 1221, myRank: 11, myDelta: +4, isProvisional: false, streak: 'W1', topPlayer: 'Sergi V' },
];

// Sample leaderboard for Tuesday crew (8 members, ELO desc)
const LEADERBOARD = [
  { userId: 'u1', username: 'Marta R.',   elo: 1402, delta: +14, isProvisional: false },
  { userId: 'u2', username: 'Diego P.',   elo: 1358, delta: -6,  isProvisional: false },
  { userId: 'me', username: 'Aitor V.',   elo: 1284, delta: +12, isProvisional: false, isMe: true },
  { userId: 'u4', username: 'Sofia M.',   elo: 1241, delta: null, isProvisional: false },
  { userId: 'u5', username: 'Jon A.',     elo: 1198, delta: -4,  isProvisional: false },
  { userId: 'u6', username: 'Eli C.',     elo: 1156, delta: +8,  isProvisional: false },
  { userId: 'u7', username: 'Rubén S.',   elo: 1124, delta: null, isProvisional: true },
  { userId: 'u8', username: 'Naia R.',    elo: 1089, delta: null, isProvisional: true },
];

// Cross-group recent matches feed (last few confirmed matches)
const FEED = [
  { id: 'm1', group: 'Tuesday crew', when: '2h ago', winners: 'You & Marta', losers: 'Jon & Eli',   sets: [[6,3],[4,6],[7,5]], iWon: true,  myDelta: +12 },
  { id: 'm2', group: 'Sunday Doubles', when: 'yesterday', winners: 'You & Hugo', losers: 'Marc & Naia', sets: [[6,2],[6,4]], iWon: true,  myDelta: +18 },
  { id: 'm3', group: 'Office Smashers', when: '2d ago', winners: 'Pep & Sara', losers: 'You & Tom',  sets: [[6,4],[7,5]], iWon: false, myDelta: -8 },
  { id: 'm4', group: 'Tuesday crew', when: '4d ago', winners: 'Marta & Diego', losers: 'Sofia & Rubén', sets: [[6,3],[6,2]], iWon: null, myDelta: null },
  { id: 'm5', group: 'Vallhonrat liga', when: '5d ago', winners: 'You & Sergi', losers: 'Olga & Joan', sets: [[7,6],[5,7],[6,3]], iWon: true, myDelta: +4 },
];

// Pending matches awaiting confirmation
const PENDING = [
  { id: 'p1', group: 'Tuesday crew', when: '20m ago', summary: 'You & Marta vs Jon & Eli',   score: '6-3, 4-6, 7-5', mine: true },
  { id: 'p2', group: 'Office Smashers', when: '3h ago', summary: 'Pep & Sara vs You & Tom',  score: '6-4, 7-5', mine: false },
];

// Player stats (cross-group)
const STATS = {
  totalMatches: 47,
  winRate: 0.66,
  streakType: 'W',
  streakCount: 3,
  form: ['W','W','L','W','W'],  // last 5 matches
  eloHistory: [1100, 1112, 1098, 1140, 1155, 1148, 1180, 1205, 1230, 1218, 1255, 1284],
};

window.ME = ME;
window.GROUPS = GROUPS;
window.LEADERBOARD = LEADERBOARD;
window.FEED = FEED;
window.PENDING = PENDING;
window.STATS = STATS;
