/* ============================================================
   icons.jsx — SVG-иконки (Lucide-стиль, без зависимостей).
   ============================================================ */
const I = ({ d, size=24, sw=2, fill='none', children, ...p }) => (
  <svg width={size} height={size} viewBox="0 0 24 24" fill={fill}
    stroke="currentColor" strokeWidth={sw} strokeLinecap="round" strokeLinejoin="round" {...p}>
    {d ? <path d={d}/> : children}
  </svg>
);

// нав-иконки
const IconCases = (p) => (
  <I {...p}><path d="M3.5 8 12 3l8.5 5v8L12 21 3.5 16Z"/><path d="M3.5 8 12 13l8.5-5"/><path d="M12 13v8"/></I>
);
const IconInventory = (p) => (
  <I {...p}><rect x="3" y="3" width="7.5" height="7.5" rx="2"/><rect x="13.5" y="3" width="7.5" height="7.5" rx="2"/><rect x="3" y="13.5" width="7.5" height="7.5" rx="2"/><rect x="13.5" y="13.5" width="7.5" height="7.5" rx="2"/></I>
);
const IconUpgrade = (p) => (
  <I {...p}><path d="M6 13l6-6 6 6"/><path d="M6 19l6-6 6 6"/></I>
);
const IconTasks = (p) => (
  <I {...p}><path d="M9 11l3 3 8-8"/><path d="M20 12v6a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h9"/></I>
);

// служебные
const IconClose   = (p)=>(<I {...p}><path d="M6 6l12 12M18 6L6 18"/></I>);
const IconChevDown= (p)=>(<I {...p}><path d="M6 9l6 6 6-6"/></I>);
const IconChevRight=(p)=>(<I {...p} sw={2.4}><path d="M9 6l6 6-6 6"/></I>);
const IconBack    = (p)=>(<I {...p} sw={2.4}><path d="M15 6l-6 6 6 6"/></I>);
const IconDots    = (p)=>(<I {...p} sw={2.6}><circle cx="5" cy="12" r="1.4" fill="currentColor" stroke="none"/><circle cx="12" cy="12" r="1.4" fill="currentColor" stroke="none"/><circle cx="19" cy="12" r="1.4" fill="currentColor" stroke="none"/></I>);
const IconWallet  = (p)=>(<I {...p}><rect x="3" y="6" width="18" height="13" rx="3"/><path d="M3 10h18"/><circle cx="16.5" cy="13.5" r="1.2" fill="currentColor" stroke="none"/></I>);
const IconPlus    = (p)=>(<I {...p} sw={2.4}><path d="M12 5v14M5 12h14"/></I>);
const IconSearch  = (p)=>(<I {...p}><circle cx="11" cy="11" r="7"/><path d="m20 20-3.2-3.2"/></I>);
const IconArrowOut= (p)=>(<I {...p}><path d="M7 17 17 7M9 7h8v8"/></I>);
const IconSell    = (p)=>(<I {...p}><path d="M3 7h18M3 7l2 13h14l2-13M9 7V5a3 3 0 0 1 6 0v2"/></I>);
const IconFire    = (p)=>(<I {...p}><path d="M12 3c1 3-2 4-2 7a2 2 0 0 0 4 0c0-1 1-1 1 1a4 4 0 1 1-8 0c0-4 3-6 5-9Z"/></I>);
const IconUsers   = (p)=>(<I {...p}><circle cx="9" cy="8" r="3.2"/><path d="M3 20a6 6 0 0 1 12 0"/><path d="M16 5.5a3.2 3.2 0 0 1 0 5.6M17 14a6 6 0 0 1 4 6"/></I>);
const IconBot     = (p)=>(<I {...p}><rect x="4" y="8" width="16" height="11" rx="3"/><path d="M12 4v4"/><circle cx="9" cy="13.5" r="1.1" fill="currentColor" stroke="none"/><circle cx="15" cy="13.5" r="1.1" fill="currentColor" stroke="none"/><path d="M2 13v2M22 13v2"/></I>);
const IconCheck   = (p)=>(<I {...p} sw={2.6}><path d="M5 12.5l4.5 4.5L19 7"/></I>);
const IconGift    = (p)=>(<I {...p}><rect x="3.5" y="9" width="17" height="11" rx="2"/><path d="M3.5 13h17M12 9v11"/><path d="M12 9C12 6 10.5 4.5 8.8 5 7 5.5 8 9 12 9ZM12 9c0-3 1.5-4.5 3.2-4 1.8.5.8 4-3.2 4Z"/></I>);
const IconCode    = (p)=>(<I {...p}><path d="M8 8l-4 4 4 4M16 8l4 4-4 4"/></I>);

// бренд-глифы валют
const TonGlyph = ({ size=18 }) => (
  <svg width={size} height={size} viewBox="0 0 24 24" aria-label="TON">
    <circle cx="12" cy="12" r="11" fill="#36a8ee"/>
    <path d="M7 8.4h10c.5 0 .8.55.5 1L12.5 17a.6.6 0 0 1-1 0L6.5 9.4c-.3-.45 0-1 .5-1Z" fill="none" stroke="#fff" strokeWidth="1.4"/>
    <path d="M12 8.8v8" stroke="#fff" strokeWidth="1.4"/>
  </svg>
);
const StarGlyph = ({ size=18 }) => (
  <svg width={size} height={size} viewBox="0 0 24 24" className="star-ic" aria-label="Star">
    <defs><linearGradient id="stg" x1="0" y1="0" x2="0" y2="1">
      <stop offset="0" stopColor="#ffd35a"/><stop offset="1" stopColor="#f3a92b"/>
    </linearGradient></defs>
    <path d="M12 2.6l2.7 5.9 6.4.7-4.8 4.3 1.3 6.3L12 16.6 6.4 19.8l1.3-6.3L2.9 9.2l6.4-.7Z" fill="url(#stg)"/>
  </svg>
);

Object.assign(window, {
  IconCases, IconInventory, IconUpgrade, IconTasks,
  IconClose, IconChevDown, IconChevRight, IconBack, IconDots, IconWallet, IconPlus,
  IconSearch, IconArrowOut, IconSell, IconFire, IconUsers, IconBot, IconCheck, IconGift, IconCode,
  TonGlyph, StarGlyph,
});
