// Mock data for the Blackpool Wren Rovers FC prototype
const FIXTURES = [
  { id: 1, comp: "NWCFL Premier", date: "SAT 02 MAY", time: "15:00", home: "Blackpool Wren Rovers", away: "Charnock Richard", venue: "AFC Fylde Mill Farm", homeBadge: "BWR", awayBadge: "CHR", live: false, isHome: true },
  { id: 2, comp: "NWCFL Premier", date: "TUE 05 MAY", time: "19:45", home: "Bacup Borough", away: "Blackpool Wren Rovers", venue: "Brain Boyd Stadium", homeBadge: "BAC", awayBadge: "BWR", live: false, isHome: false },
  { id: 3, comp: "Macron Cup QF", date: "SAT 09 MAY", time: "15:00", home: "Blackpool Wren Rovers", away: "Garstang FC", venue: "AFC Fylde Mill Farm", homeBadge: "BWR", awayBadge: "GAR", live: false, isHome: true },
  { id: 4, comp: "NWCFL Premier", date: "SAT 16 MAY", time: "15:00", home: "Squires Gate", away: "Blackpool Wren Rovers", venue: "School Road", homeBadge: "SQG", awayBadge: "BWR", live: false, isHome: false },
];

const RESULTS = [
  { id: 11, comp: "NWCFL Premier", date: "25 APR", home: "Blackpool Wren Rovers", away: "Burscough", hs: 3, as: 1, scorers: ["H. Walsh 12'", "J. Doyle 44'", "L. Marsden 78'"], result: "W" },
  { id: 12, comp: "NWCFL Premier", date: "19 APR", home: "Longridge Town", away: "Blackpool Wren Rovers", hs: 2, as: 2, scorers: ["J. Doyle 31'", "K. Ravenscroft 65'"], result: "D" },
  { id: 13, comp: "Macron Cup R3", date: "12 APR", home: "Blackpool Wren Rovers", away: "Padiham", hs: 4, as: 0, scorers: ["L. Marsden 8', 22'", "H. Walsh 56'", "OG 71'"], result: "W" },
  { id: 14, comp: "NWCFL Premier", date: "05 APR", home: "Blackpool Wren Rovers", away: "Daisy Hill", hs: 2, as: 0, scorers: ["J. Doyle 35'", "L. Marsden 88'"], result: "W" },
];

const TABLE = [
  { p: 1, team: "Vauxhall Motors", pl: 38, gd: 42, pts: 84 },
  { p: 2, team: "AFC Liverpool", pl: 38, gd: 31, pts: 78 },
  { p: 3, team: "Blackpool Wren Rovers", pl: 38, gd: 27, pts: 71, us: true },
  { p: 4, team: "Charnock Richard", pl: 38, gd: 19, pts: 67 },
  { p: 5, team: "Burscough", pl: 38, gd: 12, pts: 62 },
  { p: 6, team: "Longridge Town", pl: 38, gd: 8, pts: 58 },
  { p: 7, team: "Squires Gate", pl: 38, gd: 4, pts: 54 },
];

// Banter stats: BNT (banter), BRW (brew making), PIE (pie eating), KIT (kit washing), CHT (chat), GRF (graft)
const MENS_SQUAD = [
  { no: 1, name: "Adam Pickering", pos: "GK", age: 28, apps: 32, goals: 0, ca: 0, joined: "2022", sponsor: "Lytham Joinery", height: "6'3\"", from: "Bamber Bridge", funFact: "Penalty saver — 4 stopped this season.", rating: 82, stats: { BNT: 61, BRW: 40, PIE: 73, KIT: 62, CHT: 89, GRF: 81 } },
  { no: 2, name: "Ben Cartwright", pos: "RB", age: 24, apps: 30, goals: 1, ca: 4, joined: "2023", sponsor: "Marsh & Sons Roofing", height: "5'10\"", from: "Cleveleys", funFact: "Once played non-league in Spain for a season.", rating: 78, stats: { BNT: 87, BRW: 57, PIE: 77, KIT: 69, CHT: 81, GRF: 72 } },
  { no: 4, name: "Tom Ainsworth", pos: "CB", age: 31, apps: 34, goals: 3, ca: 6, joined: "2020", sponsor: "Fylde Coast Plumbing", height: "6'2\"", from: "Poulton", funFact: "Club captain. Named after Tommy Burley.", rating: 81, stats: { BNT: 72, BRW: 51, PIE: 76, KIT: 61, CHT: 92, GRF: 82 } },
  { no: 5, name: "Marcus 'Big M' Reid", pos: "CB", age: 29, apps: 33, goals: 4, ca: 5, joined: "2021", sponsor: "Cleveleys MOT Centre", height: "6'4\"", from: "Blackpool", funFact: "Lifeguards on the prom on weekends.", rating: 80, stats: { BNT: 68, BRW: 54, PIE: 74, KIT: 58, CHT: 90, GRF: 85 } },
  { no: 3, name: "Joe Lancaster", pos: "LB", age: 22, apps: 29, goals: 0, ca: 3, joined: "2024", sponsor: "Promenade Print", height: "5'11\"", from: "Bispham", funFact: "Was a competitive sprinter as a teenager.", rating: 76, stats: { BNT: 90, BRW: 53, PIE: 72, KIT: 68, CHT: 78, GRF: 71 } },
  { no: 6, name: "Harry Walsh", pos: "CDM", age: 27, apps: 35, goals: 6, ca: 7, joined: "2019", sponsor: "Walsh Family Butchers", height: "5'9\"", from: "St Annes", funFact: "Family-run butcher in St Annes — yes, that one.", rating: 83, stats: { BNT: 74, BRW: 72, PIE: 84, KIT: 76, CHT: 84, GRF: 82 } },
  { no: 8, name: "Karl Ravenscroft", pos: "CM", age: 25, apps: 31, goals: 7, ca: 2, joined: "2022", sponsor: "North Pier Garage", height: "5'10\"", from: "Thornton", funFact: "Set-piece specialist — 4 direct free kicks.", rating: 81, stats: { BNT: 77, BRW: 78, PIE: 88, KIT: 78, CHT: 72, GRF: 74 } },
  { no: 10, name: "Jamie Doyle", pos: "CAM", age: 26, apps: 34, goals: 18, ca: 1, joined: "2021", sponsor: "Doyle's Fish Bar", height: "5'8\"", from: "Blackpool", funFact: "Top scorer two seasons running.", rating: 86, stats: { BNT: 86, BRW: 86, PIE: 86, KIT: 87, CHT: 52, GRF: 70 } },
  { no: 7, name: "Liam Marsden", pos: "RW", age: 23, apps: 30, goals: 14, ca: 0, joined: "2023", sponsor: "Tower View Estates", height: "5'9\"", from: "Marton", funFact: "Quickest in the squad over 40m.", rating: 84, stats: { BNT: 96, BRW: 76, PIE: 82, KIT: 82, CHT: 52, GRF: 66 } },
  { no: 11, name: "Sam Greenhalgh", pos: "LW", age: 21, apps: 28, goals: 9, ca: 1, joined: "2024", sponsor: "Sandgrown Coffee Co.", height: "5'10\"", from: "Cleveleys", funFact: "Studying sports science at UCLan.", rating: 80, stats: { BNT: 86, BRW: 76, PIE: 76, KIT: 82, CHT: 50, GRF: 70 } },
  { no: 9, name: "Connor Briggs", pos: "ST", age: 30, apps: 32, goals: 16, ca: 3, joined: "2018", sponsor: "Briggs Bros. Joinery", height: "6'1\"", from: "Lytham", funFact: "All-time top scorer in club history.", rating: 85, stats: { BNT: 79, BRW: 89, PIE: 75, KIT: 79, CHT: 46, GRF: 83 } },
  { no: 14, name: "Dale Worthington", pos: "ST", age: 19, apps: 18, goals: 5, ca: 0, joined: "2025", sponsor: "Academy Graduate", height: "5'11\"", from: "Layton", funFact: "Came through the U18s last season.", rating: 74, stats: { BNT: 84, BRW: 74, PIE: 70, KIT: 72, CHT: 44, GRF: 68 } },
];

const WOMENS_SQUAD = [
  { no: 1, name: "Erin Holt", pos: "GK", age: 26, apps: 22, goals: 0, ca: 0, joined: "2022", sponsor: "Holt Veterinary", from: "Poulton", funFact: "Kept 11 clean sheets this season.", rating: 81, stats: { BNT: 56, BRW: 40, PIE: 70, KIT: 64, CHT: 85, GRF: 82 } },
  { no: 2, name: "Mia Forrester", pos: "RB", age: 23, apps: 21, goals: 2, ca: 2, joined: "2023", sponsor: "Fylde Bookkeeping", from: "Lytham", funFact: "Plays five-a-side every Wednesday too.", rating: 78, stats: { BNT: 82, BRW: 60, PIE: 74, KIT: 72, CHT: 78, GRF: 74 } },
  { no: 5, name: "Charlotte 'Charlie' Whitfield", pos: "CB", age: 28, apps: 20, goals: 3, ca: 1, joined: "2020", sponsor: "Whitfield Plastering", from: "Blackpool", funFact: "Captain — never missed a training session.", rating: 82, stats: { BNT: 67, BRW: 57, PIE: 75, KIT: 65, CHT: 89, GRF: 83 } },
  { no: 4, name: "Sophie Kendrick", pos: "CB", age: 24, apps: 19, goals: 1, ca: 3, joined: "2022", sponsor: "Promenade Print", from: "Bispham", funFact: "PE teacher at a local primary.", rating: 79, stats: { BNT: 73, BRW: 52, PIE: 75, KIT: 62, CHT: 87, GRF: 79 } },
  { no: 3, name: "Olivia Crane", pos: "LB", age: 22, apps: 22, goals: 0, ca: 1, joined: "2023", sponsor: "Crane & Co. Solicitors", from: "Cleveleys", funFact: "Half-marathon runner in the off-season.", rating: 77, stats: { BNT: 88, BRW: 52, PIE: 74, KIT: 68, CHT: 78, GRF: 72 } },
  { no: 6, name: "Rebecca Salt", pos: "CDM", age: 27, apps: 21, goals: 4, ca: 4, joined: "2021", sponsor: "Salt's Bakery", from: "St Annes", funFact: "Bakes for the post-match teas.", rating: 80, stats: { BNT: 73, BRW: 69, PIE: 83, KIT: 73, CHT: 83, GRF: 77 } },
  { no: 8, name: "Imogen Berry", pos: "CM", age: 21, apps: 22, goals: 5, ca: 0, joined: "2024", sponsor: "Berry Tile Co.", from: "Marton", funFact: "Plays piano. Pre-match playlist DJ.", rating: 79, stats: { BNT: 76, BRW: 74, PIE: 86, KIT: 76, CHT: 70, GRF: 70 } },
  { no: 10, name: "Phoebe Hartley", pos: "CAM", age: 25, apps: 22, goals: 11, ca: 1, joined: "2022", sponsor: "Hartley Hair Studio", from: "Blackpool", funFact: "Two-time Player of the Season.", rating: 84, stats: { BNT: 84, BRW: 84, PIE: 86, KIT: 86, CHT: 52, GRF: 70 } },
  { no: 7, name: "Kayleigh Ashworth", pos: "RW", age: 20, apps: 20, goals: 9, ca: 0, joined: "2024", sponsor: "Sandgrown Coffee Co.", from: "Thornton", funFact: "Came up through the U16s.", rating: 80, stats: { BNT: 88, BRW: 76, PIE: 76, KIT: 82, CHT: 50, GRF: 68 } },
  { no: 11, name: "Niamh O'Connell", pos: "LW", age: 24, apps: 21, goals: 8, ca: 2, joined: "2023", sponsor: "O'Connell Plumbing", from: "Lytham", funFact: "Plays Gaelic football in summer.", rating: 81, stats: { BNT: 86, BRW: 78, PIE: 78, KIT: 84, CHT: 52, GRF: 72 } },
  { no: 9, name: "Grace Pemberton", pos: "ST", age: 26, apps: 22, goals: 17, ca: 1, joined: "2021", sponsor: "Pemberton Property", from: "Blackpool", funFact: "Top scorer in the league.", rating: 85, stats: { BNT: 80, BRW: 90, PIE: 74, KIT: 80, CHT: 46, GRF: 80 } },
];

const JUNIORS = [
  { age: "U7", coach: "K. Greaves", count: 14, day: "Sat 09:30" },
  { age: "U8", coach: "M. Tate", count: 16, day: "Sat 09:30" },
  { age: "U9", coach: "P. Doolan", count: 15, day: "Sat 10:30" },
  { age: "U10", coach: "S. McCarthy", count: 18, day: "Sat 10:30" },
  { age: "U11", coach: "B. Briggs", count: 16, day: "Sat 11:30" },
  { age: "U12", coach: "H. Walsh", count: 18, day: "Sun 10:00" },
  { age: "U13", coach: "P. Doolan", count: 17, day: "Sun 10:00" },
  { age: "U14", coach: "M. Tate", count: 16, day: "Sun 11:00" },
  { age: "U15", coach: "K. Greaves", count: 18, day: "Sun 11:00" },
  { age: "U16", coach: "S. McCarthy", count: 18, day: "Sun 12:00" },
  { age: "U18", coach: "B. Briggs", count: 20, day: "Tue/Thu 19:00" },
  { age: "Girls U10–U16", coach: "K. Greaves & E. Holt", count: 42, day: "Sat 12:00" },
];

const SPONSORS_TIER = {
  principal: [{ name: "Questa Construction", note: "Front of shirt — Men's & Women's First Teams" }],
  platinum: [{ name: "Argaud Angus" }, { name: "AFC Fylde Group" }],
  gold: [{ name: "Walsh Family Butchers" }, { name: "Doyle's Fish Bar" }, { name: "Sandgrown Coffee Co." }, { name: "Fylde Coast Plumbing" }, { name: "Promenade Print" }],
  silver: [{ name: "Cleveleys MOT" }, { name: "Tower View Estates" }, { name: "Lytham Joinery" }, { name: "Salt's Bakery" }, { name: "North Pier Garage" }, { name: "Hartley Hair Studio" }, { name: "Crane & Co." }, { name: "Briggs Bros." }, { name: "Marsh & Sons Roofing" }, { name: "Holt Veterinary" }, { name: "Berry Tile Co." }, { name: "Pemberton Property" }],
};

// Curated portrait pools — Unsplash sportsperson/athlete photos
// Using deterministic hash to assign each player a stable image
const MENS_PHOTOS = [
  "https://images.unsplash.com/photo-1633332755192-727a05c4013d?w=400&h=500&fit=crop&crop=faces",
  "https://images.unsplash.com/photo-1500648767791-00dcc994a43e?w=400&h=500&fit=crop&crop=faces",
  "https://images.unsplash.com/photo-1552058544-f2b08422138a?w=400&h=500&fit=crop&crop=faces",
  "https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=400&h=500&fit=crop&crop=faces",
  "https://images.unsplash.com/photo-1564564321837-a57b7070ac4f?w=400&h=500&fit=crop&crop=faces",
  "https://images.unsplash.com/photo-1492562080023-ab3db95bfbce?w=400&h=500&fit=crop&crop=faces",
  "https://images.unsplash.com/photo-1531123897727-8f129e1688ce?w=400&h=500&fit=crop&crop=faces",
  "https://images.unsplash.com/photo-1519085360753-af0119f7cbe7?w=400&h=500&fit=crop&crop=faces",
  "https://images.unsplash.com/photo-1542178243-bc20204b769f?w=400&h=500&fit=crop&crop=faces",
  "https://images.unsplash.com/photo-1463453091185-61582044d556?w=400&h=500&fit=crop&crop=faces",
  "https://images.unsplash.com/photo-1545167622-3a6ac756afa4?w=400&h=500&fit=crop&crop=faces",
  "https://images.unsplash.com/photo-1488161628813-04466f872be2?w=400&h=500&fit=crop&crop=faces",
  "https://images.unsplash.com/photo-1506277886164-e25aa3f4ef7f?w=400&h=500&fit=crop&crop=faces",
  "https://images.unsplash.com/photo-1564013434775-f71db0030976?w=400&h=500&fit=crop&crop=faces",
  "https://images.unsplash.com/photo-1554384645-13eab165c24b?w=400&h=500&fit=crop&crop=faces",
];

const WOMENS_PHOTOS = [
  "https://images.unsplash.com/photo-1488426862026-3ee34a7d66df?w=400&h=500&fit=crop&crop=faces",
  "https://images.unsplash.com/photo-1487412720507-e7ab37603c6f?w=400&h=500&fit=crop&crop=faces",
  "https://images.unsplash.com/photo-1544005313-94ddf0286df2?w=400&h=500&fit=crop&crop=faces",
  "https://images.unsplash.com/photo-1554151228-14d9def656e4?w=400&h=500&fit=crop&crop=faces",
  "https://images.unsplash.com/photo-1531746020798-e6953c6e8e04?w=400&h=500&fit=crop&crop=faces",
  "https://images.unsplash.com/photo-1517841905240-472988babdf9?w=400&h=500&fit=crop&crop=faces",
  "https://images.unsplash.com/photo-1438761681033-6461ffad8d80?w=400&h=500&fit=crop&crop=faces",
  "https://images.unsplash.com/photo-1496360166961-10a51d5f367a?w=400&h=500&fit=crop&crop=faces",
  "https://images.unsplash.com/photo-1573496359142-b8d87734a5a2?w=400&h=500&fit=crop&crop=faces",
  "https://images.unsplash.com/photo-1502823403499-6ccfcf4fb453?w=400&h=500&fit=crop&crop=faces",
  "https://images.unsplash.com/photo-1521252659862-eec69941b071?w=400&h=500&fit=crop&crop=faces",
  "https://images.unsplash.com/photo-1500917293891-ef795e70e1f6?w=400&h=500&fit=crop&crop=faces",
  "https://images.unsplash.com/photo-1546961342-1ca6a51e23c5?w=400&h=500&fit=crop&crop=faces",
  "https://images.unsplash.com/photo-1539571696357-5a69c17a67c6?w=400&h=500&fit=crop&crop=faces",
  "https://images.unsplash.com/photo-1485893086445-ed75865251e0?w=400&h=500&fit=crop&crop=faces",
];

// Player portrait — clean, no background box (sits directly on card)
const PlayerPortrait = ({ player, team = 'mens', size = 220 }) => {
  return (
    <div style={{
      width: size, height: size * 1.2, position: 'relative', overflow: 'visible',
      display: 'flex', alignItems: 'flex-end', justifyContent: 'center',
    }}>
      <img src="assets/player-placeholder.png" alt={player.name}
           style={{
             position: 'relative', width: '92%', height: 'auto',
             objectFit: 'contain', objectPosition: 'bottom center',
             filter: 'drop-shadow(0 6px 8px rgba(0,0,0,0.35))',
           }} />
    </div>
  );
};

const _OldPhotoPortrait = ({ player, team = 'mens', size = 220 }) => {
  const hash = player.name.split('').reduce((a, c) => a + c.charCodeAt(0), 0);
  const pool = team === 'womens' ? WOMENS_PHOTOS : MENS_PHOTOS;
  const photoUrl = pool[hash % pool.length];
  return null; // disabled
};

// Legacy SVG portrait — unused after photo update, but kept harmless. Remove later.
const _OldPlayerPortrait = ({ player, team = 'mens', size = 220 }) => {
  const hash = player.name.split('').reduce((a, c) => a + c.charCodeAt(0), 0);
  const female = team === 'womens';
  const skinTones = ['#E8B89B', '#D49A7E', '#C8855F', '#B17050', '#8C5638'];
  const hairColors = female
    ? ['#3C2417', '#6B3D1F', '#8B5A2B', '#1A1A1A', '#A8632A', '#D4A04A']
    : ['#2A1810', '#3C2417', '#5A3520', '#1A1A1A', '#6B4226', '#8B5A2B'];
  const skin = skinTones[hash % skinTones.length];
  const hair = hairColors[hash % hairColors.length];
  const facialHair = !female && hash % 3 === 0;
  const ponytail = female && hash % 2 === 0;
  const headTilt = (hash % 7) - 3;

  return (
    <svg viewBox="0 0 200 240" width={size} height={size * 1.2} style={{ display: 'block' }}>
      <defs>
        <radialGradient id={`bg-${player.no}-${team}`} cx="50%" cy="35%" r="65%">
          <stop offset="0%" stopColor="#7A0D1F" />
          <stop offset="100%" stopColor="#1A0608" />
        </radialGradient>
        <linearGradient id={`shirt-${player.no}-${team}`} x1="0" y1="0" x2="0" y2="1">
          <stop offset="0%" stopColor="#E1142E" />
          <stop offset="100%" stopColor="#9B0B22" />
        </linearGradient>
      </defs>

      <rect width="200" height="240" fill={`url(#bg-${player.no}-${team})`} />

      {/* Subtle geometric pattern */}
      <g opacity="0.08" stroke="#fff" strokeWidth="0.5" fill="none">
        <path d="M0 200 L200 100" />
        <path d="M0 220 L200 120" />
        <path d="M0 240 L200 140" />
      </g>

      <g transform={`translate(100, 130) rotate(${headTilt})`}>
        {/* Shoulders / shirt */}
        <path d="M -75 110 Q -75 60, -45 50 L -25 45 Q 0 55, 25 45 L 45 50 Q 75 60, 75 110 L 75 130 L -75 130 Z"
              fill={`url(#shirt-${player.no}-${team})`} />
        {/* Shirt collar V */}
        <path d="M -18 45 L 0 65 L 18 45 L 14 42 L 0 56 L -14 42 Z" fill="#0E0F12" />
        {/* Shirt detail stripe */}
        <path d="M -75 95 L 75 95" stroke="#0E0F12" strokeWidth="1.5" opacity="0.6" />
        {/* Number on shirt */}
        <text x="0" y="115" fontFamily="Bebas Neue, Impact" fontSize="22" fill="#fff" textAnchor="middle" opacity="0.85">
          {player.no}
        </text>

        {/* Neck */}
        <rect x="-12" y="14" width="24" height="32" fill={skin} />
        <path d="M -12 30 Q 0 36, 12 30 L 12 46 L -12 46 Z" fill="rgba(0,0,0,0.15)" />

        {/* Head */}
        <ellipse cx="0" cy="-12" rx="32" ry="38" fill={skin} />

        {/* Hair */}
        {female ? (
          <>
            <path d={`M -34 -28 Q -38 -52, -20 -56 Q 0 -64, 22 -56 Q 38 -50, 34 -22 Q 30 -32, 18 -34 L -18 -34 Q -30 -32, -34 -22 Z`} fill={hair} />
            {ponytail && (
              <path d={`M 22 -10 Q 50 -2, 48 28 Q 42 36, 36 32 Q 38 12, 28 0 Z`} fill={hair} />
            )}
            <path d="M -26 -28 Q -10 -34, 12 -32" stroke={hair} strokeWidth="1.5" fill="none" opacity="0.6" />
          </>
        ) : (
          <>
            {hash % 4 === 0 ? (
              <path d="M -30 -32 Q -28 -42, -10 -44 Q 8 -46, 24 -42 Q 32 -38, 30 -28 L 28 -22 Q 14 -32, -2 -32 Q -18 -32, -28 -22 Z" fill={hair} />
            ) : hash % 4 === 1 ? (
              <path d="M -32 -22 Q -36 -48, -10 -52 Q 16 -54, 30 -42 Q 36 -28, 32 -18 Q 22 -32, 0 -34 Q -22 -34, -32 -22 Z" fill={hair} />
            ) : (
              <path d="M -30 -28 Q -24 -46, 0 -48 Q 24 -46, 30 -28 L 30 -20 Q 22 -30, 12 -32 Q 0 -32, -12 -32 Q -22 -30, -30 -20 Z" fill={hair} />
            )}
          </>
        )}

        {/* Eyes */}
        <ellipse cx="-11" cy="-12" rx="2.4" ry="2.8" fill="#1a1a1a" />
        <ellipse cx="11" cy="-12" rx="2.4" ry="2.8" fill="#1a1a1a" />
        {/* Brows */}
        <path d="M -16 -20 Q -11 -22, -6 -20" stroke={hair} strokeWidth="1.6" fill="none" strokeLinecap="round" />
        <path d="M 6 -20 Q 11 -22, 16 -20" stroke={hair} strokeWidth="1.6" fill="none" strokeLinecap="round" />
        {/* Nose */}
        <path d="M 0 -8 Q -3 4, -1 6 L 2 6 Q 4 4, 0 -8" fill="rgba(0,0,0,0.12)" />
        {/* Mouth */}
        <path d="M -7 14 Q 0 18, 7 14" stroke="#5a2828" strokeWidth="1.4" fill="none" strokeLinecap="round" />
        {/* Cheek shading */}
        <ellipse cx="-22" cy="2" rx="6" ry="8" fill="rgba(200,16,46,0.12)" />
        <ellipse cx="22" cy="2" rx="6" ry="8" fill="rgba(200,16,46,0.12)" />
        {/* Beard / stubble */}
        {facialHair && (
          <path d={`M -22 8 Q -16 22, 0 24 Q 16 22, 22 8 Q 14 18, 0 18 Q -14 18, -22 8 Z`}
                fill={hair} opacity="0.7" />
        )}
        {/* Ears */}
        <ellipse cx="-31" cy="-8" rx="3" ry="6" fill={skin} />
        <ellipse cx="31" cy="-8" rx="3" ry="6" fill={skin} />
      </g>
    </svg>
  );
};

// Wren badge
const WrenBadge = ({ size = 28, mono = false, color }) => {
  const c = color || (mono ? 'currentColor' : '#FAF7F2');
  return (
    <svg width={size} height={size} viewBox="0 0 100 100" fill="none" aria-hidden="true">
      <circle cx="50" cy="50" r="48" stroke={c} strokeWidth="3" fill="none" />
      <circle cx="50" cy="50" r="36" stroke={c} strokeWidth="2" fill="none" />
      <path d="M30 58 Q38 42 54 44 Q66 45 72 38 L70 50 Q72 56 68 60 Q60 66 48 64 Q40 64 34 66 Z" fill={c} />
      <path d="M44 50 Q50 48 56 52" stroke="#C8102E" strokeWidth="1.5" fill="none" />
      <circle cx="36" cy="54" r="1.4" fill="#C8102E" />
      <path d="M30 58 L26 68 L34 64 Z" fill={c} />
    </svg>
  );
};

Object.assign(window, { FIXTURES, RESULTS, TABLE, MENS_SQUAD, WOMENS_SQUAD, JUNIORS, SPONSORS_TIER, WrenBadge, PlayerPortrait });
