// icons.jsx — Wasner Performance line-icon library.
// Single-weight, 24px grid, stroke = currentColor so color is set by parent.
// Exported to window: ICONS (name→nodes) and <Icon name size stroke color/>.

const ICONS = {
  dumbbell: (<><path d="M6.5 8.5v7" /><path d="M9.5 6.5v11" /><path d="M14.5 6.5v11" /><path d="M17.5 8.5v7" /><path d="M9.5 12h5" /><path d="M4 10.5v3" /><path d="M20 10.5v3" /></>),
  pulse: (<path d="M3 12h4l2-4.5 3 9 2-4.5h7" />),
  stopwatch: (<><circle cx="12" cy="13.5" r="6.5" /><path d="M12 7V4" /><path d="M9.5 4h5" /><path d="M12 13.5l2.6-2" /><path d="M17.4 8.1l1.2-1.2" /></>),
  target: (<><circle cx="12" cy="12" r="8" /><circle cx="12" cy="12" r="4" /><circle cx="12" cy="12" r="1" /></>),
  trophy: (<><path d="M7 4h10v3.5a5 5 0 0 1-10 0z" /><path d="M7 5H4.5v1A3.5 3.5 0 0 0 8 9.5" /><path d="M17 5h2.5v1A3.5 3.5 0 0 1 16 9.5" /><path d="M12 12.5v3" /><path d="M9.5 19h5" /><path d="M10 19l.4-3.5h3.2L14 19" /></>),
  flame: (<path d="M12 3c.5 3 3.6 4.2 3.6 8.2A3.6 3.6 0 0 1 8.4 11c0-1.6 1-2.8 1.9-3.6C11.2 6.5 12 5 12 3z" />),
  calendar: (<><rect x="4" y="5" width="16" height="15" rx="2" /><path d="M4 9.5h16" /><path d="M8 3v4" /><path d="M16 3v4" /></>),
  chart: (<><path d="M4 4v16h16" /><path d="M7.5 14.5l3-3 3 2 4.5-5.5" /></>),
  droplet: (<path d="M12 3.5c3 4 5 6.2 5 9a5 5 0 0 1-10 0c0-2.8 2-5 5-9z" />),
  clock: (<><circle cx="12" cy="12" r="8" /><path d="M12 8v4l3 2" /></>),
  check: (<><circle cx="12" cy="12" r="8" /><path d="M8.4 12l2.5 2.5L15.6 9" /></>),
  arrowRight: (<><path d="M4 12h15" /><path d="M13 6l6 6-6 6" /></>),
  arrowUpRight: (<><path d="M7 17L17 7" /><path d="M8 7h9v9" /></>),
  play: (<><circle cx="12" cy="12" r="8" /><path d="M10.2 9l5 3-5 3z" /></>),
  user: (<><circle cx="12" cy="8" r="3.5" /><path d="M5 19.5a7 7 0 0 1 14 0" /></>),
  users: (<><circle cx="9" cy="8" r="3" /><path d="M3.5 19a5.5 5.5 0 0 1 11 0" /><path d="M16 5.4a3 3 0 0 1 0 5.6" /><path d="M17.5 13.5a5.5 5.5 0 0 1 3 5" /></>),
  message: (<path d="M20 15a1 1 0 0 1-1 1H8l-4 4V6a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1z" />),
  phone: (<path d="M6 4h3l1.5 4-2 1.4a11 11 0 0 0 5 5l1.4-2 4 1.5v3a1 1 0 0 1-1 1A15 15 0 0 1 5 5a1 1 0 0 1 1-1z" />),
  mail: (<><rect x="3" y="5" width="18" height="14" rx="2" /><path d="M4 7.5l8 6 8-6" /></>),
  pin: (<><path d="M12 21c4-4 6-7 6-10a6 6 0 0 0-12 0c0 3 2 6 6 10z" /><circle cx="12" cy="11" r="2.3" /></>),
  instagram: (<><rect x="4" y="4" width="16" height="16" rx="4.5" /><circle cx="12" cy="12" r="3.6" /><circle cx="16.8" cy="7.2" r="0.9" /></>),
  whatsapp: (<><path d="M4 20l1.3-3.8A8 8 0 1 1 8.8 19.3z" /><path d="M9 9.2c0 3.6 2.2 5.8 5.8 5.8.8 0 1.2-.9.7-1.5l-.9-1.1-1.6.6c-.9-.5-1.6-1.2-2.1-2.1l.6-1.6-1.1-.9c-.6-.5-1.4-.1-1.4.6z" /></>),
  menu: (<><path d="M4 7h16" /><path d="M4 12h16" /><path d="M4 17h16" /></>),
  search: (<><circle cx="11" cy="11" r="6" /><path d="M20 20l-4-4" /></>),
  star: (<path d="M12 4l2.3 4.8 5.2.7-3.8 3.7.9 5.2L12 16.6 7.2 19.1l.9-5.2-3.8-3.7 5.2-.7z" />),
  heart: (<path d="M12 20s-7-4.3-7-9a4 4 0 0 1 7-2.6A4 4 0 0 1 19 11c0 4.7-7 9-7 9z" />),
  download: (<><path d="M12 4v10" /><path d="M8 11l4 4 4-4" /><path d="M5 19h14" /></>),
  settings: (<><circle cx="12" cy="12" r="3" /><path d="M12 3v3M12 18v3M3 12h3M18 12h3M5.6 5.6l2.1 2.1M16.3 16.3l2.1 2.1M18.4 5.6l-2.1 2.1M7.7 16.3l-2.1 2.1" /></>),
  chevron: (<path d="M9 6l6 6-6 6" />),
  close: (<path d="M6 6l12 12M18 6L6 18" />),
  plus: (<path d="M12 5v14M5 12h14" />),
  lock: (<><rect x="5" y="11" width="14" height="9" rx="2" /><path d="M8 11V8a4 4 0 0 1 8 0v3" /></>),
  medal: (<><circle cx="12" cy="14.5" r="4.5" /><path d="M9.5 10.2L7 3.5M14.5 10.2L17 3.5M12 12.6v3.8M10.6 14.5h2.8" /></>),
};

function Icon({ name, size = 24, stroke = 1.7, color = 'currentColor', style }) {
  return (
    <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke={color}
      strokeWidth={stroke} strokeLinecap="round" strokeLinejoin="round" style={style}>
      {ICONS[name]}
    </svg>
  );
}

Object.assign(window, { ICONS, Icon });
