// Cookie illustrations modeled on Nadya's actual work: shaped sugar cookies
// with piped-icing outlines, soft pastel fills, and hand-painted detail.
//
// Each cookie is a self-contained SVG with a viewBox of 0 0 200 200.
// Aspect ratio varies per shape (square, hexagon, vertical, etc.) but they
// all render at the same nominal canvas size for consistent presentation.

const { useState } = React;

// ---- Shared icing pattern -------------------------------------------------
// A subtle dot-grid that suggests the slight texture of royal icing
function IcingTexture({ id, color = "oklch(0.4 0.02 50 / 0.05)" }) {
  return (
    <defs>
      <pattern id={id} x="0" y="0" width="3" height="3" patternUnits="userSpaceOnUse">
        <circle cx="1" cy="1" r="0.3" fill={color} />
      </pattern>
    </defs>
  );
}

// "Cookie edge" — a soft tan rim visible just outside the iced shape, to make
// each piece read as a real cookie rather than a sticker.
function CookieEdge({ d, offset = 3, color = "oklch(0.78 0.07 70)" }) {
  return <path d={d} fill={color} transform={`translate(${offset/2} ${offset/2})`} style={{ filter: "blur(1.2px)" }} />;
}

// Hand-piped cursive script (we use a font, but draw with double-stroke effect)
function Script({ x, y, text, size = 22, color = "oklch(0.4 0.13 250)", anchor = "middle" }) {
  return (
    <text x={x} y={y} fontFamily="Caveat, cursive" fontSize={size} fontWeight="600" fill={color} textAnchor={anchor} style={{ paintOrder: "stroke", stroke: color, strokeWidth: 0.5 }}>
      {text}
    </text>
  );
}

// Bubble letters (like the DALIA cookies — chunky outlined caps)
function Bubble({ x, y, text, size = 26, fill = "oklch(0.78 0.13 145)", stroke = "oklch(0.45 0.13 145)", anchor = "middle" }) {
  return (
    <text x={x} y={y} fontFamily="Fraunces, Bree Serif, Georgia, serif" fontSize={size} fontWeight="800" fill={fill} stroke={stroke} strokeWidth={1.4} textAnchor={anchor} style={{ letterSpacing: 2 }}>
      {text}
    </text>
  );
}

// ===========================================================================
// 1. ONESIE — light blue with rainbow sprinkles and "oh boy" cursive
// ===========================================================================
function Onesie({ size = 200, color = "oklch(0.85 0.05 240)", outline = "oklch(0.55 0.08 240)", text = "oh boy", rotate = 0 }) {
  // Clean onesie silhouette with a real U-shaped neckline scoop between
  // the shoulders, and a smooth U between the legs (not a sharp V).
  const body = "M 45 28 L 78 22 Q 110 58 142 22 L 175 28 Q 188 38 172 54 L 172 58 Q 158 62 158 54 L 158 154 Q 158 178 132 174 L 118 162 Q 110 172 102 162 L 88 174 Q 62 178 62 154 L 62 54 Q 62 62 48 58 L 48 54 Q 32 38 45 28 Z";
  // The collar — a lens that shares the same endpoints as the body's
  // neckline curve, so there are no protruding triangle corners.
  const collar = "M 78 22 Q 110 58 142 22 Q 110 80 78 22 Z";
  // Lighter blue derived from the icing color
  const lightBlue = "oklch(0.92 0.035 240)";

  // sprinkles — short rotated tick marks (deterministic so they don't reshuffle)
  const sprinkleColors = ["oklch(0.95 0.02 80)", "oklch(0.78 0.13 80)", "oklch(0.68 0.13 145)", "oklch(0.55 0.13 240)"];
  const seeds = [
    [72,84,30],[96,78,-22],[140,80,46],[166,90,12],
    [78,108,-44],[112,104,18],[150,112,-12],[88,134,38],
    [124,140,-30],[156,138,24],[70,154,-8],[100,156,42],
    [136,158,-18],[112,80,8],[148,86,-36],[80,124,52],
    [120,124,-50],[154,124,14],[66,108,-22],[148,150,-44],
    [104,132,28],[80,142,-12],[156,108,-2],[92,94,-36],
  ];
  const sprinkles = seeds.map(([cx, cy, rot], i) => (
    <rect key={i} x={cx - 4} y={cy - 1} width="8" height="2" rx="1"
      fill={sprinkleColors[i % sprinkleColors.length]}
      transform={`rotate(${rot} ${cx} ${cy})`} opacity="0.9" />
  ));

  return (
    <svg viewBox="0 0 220 200" width={size} height={size * 200 / 220} style={{ transform: `rotate(${rotate}deg)`, overflow: "visible" }}>
      {/* Cookie shadow */}
      <path d={body} fill="oklch(0.3 0.04 60 / 0.18)" transform="translate(3 4)" style={{ filter: "blur(2px)" }} />
      {/* Bare cookie rim (dough peek) */}
      <path d={body} fill="oklch(0.82 0.07 70)" transform="scale(1.025) translate(-2.7 -2.5)" />
      {/* Icing fill */}
      <path d={body} fill={color} />
      {/* Lighter blue neckband filling the scoop */}
      <path d={collar} fill={lightBlue} />
      {/* Piped outline along the scoop neckline (curved part only) */}
      <path d="M 78 22 Q 110 58 142 22" fill="none" stroke={outline} strokeWidth="2" strokeLinejoin="round" />
      {/* Ribbed collar tick marks */}
      <g stroke={outline} strokeWidth="1.2" strokeLinecap="round" opacity="0.6">
        <line x1="92"  y1="34" x2="92"  y2="44" />
        <line x1="102" y1="40" x2="102" y2="50" />
        <line x1="110" y1="42" x2="110" y2="52" />
        <line x1="118" y1="40" x2="118" y2="50" />
        <line x1="128" y1="34" x2="128" y2="44" />
      </g>
      {/* Body outline */}
      <path d={body} fill="none" stroke={outline} strokeWidth="2.5" strokeLinejoin="round" />
      {/* Sprinkles */}
      <g>{sprinkles}</g>
      {/* Snap dots at the crotch */}
      <circle cx="102" cy="166" r="1.8" fill={outline} />
      <circle cx="118" cy="166" r="1.8" fill={outline} />
      {/* Cursive "oh boy" — on the chest, below the collar */}
      <Script x="110" y="118" text={text} size={26} color={outline} />
    </svg>
  );
}

// ===========================================================================
// 2. DAISY — white petals around a soft yellow center
// ===========================================================================
function Daisy({ size = 200, petal = "oklch(0.98 0.005 90)", petalEdge = "oklch(0.78 0.04 80)", center = "oklch(0.78 0.13 85)", centerEdge = "oklch(0.55 0.13 60)", name = "DALIA", rotate = 0 }) {
  const cx = 100, cy = 100;
  const petals = [];
  for (let i = 0; i < 6; i++) {
    const a = (i / 6) * Math.PI * 2 - Math.PI / 2;
    const px = cx + Math.cos(a) * 50;
    const py = cy + Math.sin(a) * 50;
    const rot = (a * 180) / Math.PI + 90;
    petals.push(
      <g key={i} transform={`translate(${px} ${py}) rotate(${rot})`}>
        <ellipse cx="0" cy="0" rx="22" ry="44" fill="oklch(0.3 0.04 60 / 0.15)" transform="translate(1 2)" style={{ filter: "blur(1.5px)" }} />
        <ellipse cx="0" cy="0" rx="22" ry="44" fill={petal} stroke={petalEdge} strokeWidth="2" />
      </g>
    );
  }
  return (
    <svg viewBox="0 0 200 200" width={size} height={size} style={{ transform: `rotate(${rotate}deg)`, overflow: "visible" }}>
      {petals}
      <circle cx={cx} cy={cy} r="30" fill={center} stroke={centerEdge} strokeWidth="2" />
      {name && <Bubble x={cx} y={cy + 7} text={name} size={16} fill={centerEdge} stroke={centerEdge} />}
    </svg>
  );
}

// ===========================================================================
// 3. CAMEL HEXAGON — desert scene with palms + camel silhouette
// ===========================================================================
function CamelHex({ size = 200, rotate = 0 }) {
  const hex = "M 100 12 L 178 56 L 178 144 L 100 188 L 22 144 L 22 56 Z";
  // Color zones for desert
  return (
    <svg viewBox="0 0 200 200" width={size} height={size} style={{ transform: `rotate(${rotate}deg)`, overflow: "visible" }}>
      <path d={hex} fill="oklch(0.3 0.04 60 / 0.18)" transform="translate(3 4)" style={{ filter: "blur(2px)" }} />
      <path d={hex} fill="oklch(0.82 0.07 70)" transform="scale(1.02) translate(-2 -2)" />
      <clipPath id="hex-clip"><path d={hex} /></clipPath>
      <g clipPath="url(#hex-clip)">
        {/* Sky / sun */}
        <rect x="0" y="0" width="200" height="200" fill="oklch(0.88 0.08 80)" />
        {/* Sandy hill mid */}
        <path d="M 0 110 Q 60 90, 100 105 T 200 110 L 200 130 L 0 130 Z" fill="oklch(0.76 0.11 60)" />
        {/* Darker hill front */}
        <path d="M 0 130 Q 60 120, 100 132 T 200 130 L 200 200 L 0 200 Z" fill="oklch(0.55 0.13 45)" />
        {/* Camel silhouette */}
        <g transform="translate(60 95)">
          {/* body */}
          <path d="M 10 25 Q 14 15 24 16 L 32 8 L 38 16 L 50 16 L 56 6 L 62 16 Q 72 14 76 24 L 78 36 L 70 38 L 66 60 L 58 60 L 58 42 L 30 42 L 30 60 L 22 60 L 18 38 L 10 36 Z"
            fill="oklch(0.72 0.13 65)" stroke="oklch(0.4 0.1 45)" strokeWidth="1.4" strokeLinejoin="round" />
          {/* saddle pattern */}
          <path d="M 30 24 L 42 16 L 54 24 L 50 32 L 34 32 Z" fill="oklch(0.55 0.13 30)" />
          <line x1="42" y1="16" x2="42" y2="32" stroke="oklch(0.95 0.02 80)" strokeWidth="1.2" />
          <line x1="30" y1="24" x2="54" y2="24" stroke="oklch(0.95 0.02 80)" strokeWidth="1.2" />
          {/* eye */}
          <circle cx="64" cy="11" r="1" fill="oklch(0.25 0.03 50)" />
        </g>
      </g>
      <path d={hex} fill="none" stroke="oklch(0.6 0.13 45)" strokeWidth="2.5" strokeLinejoin="round" />
    </svg>
  );
}

// ===========================================================================
// 4. BUTTERFLY — monarch (black + cream)
// ===========================================================================
function Butterfly({ size = 200, body = "oklch(0.95 0.04 90)", outline = "oklch(0.22 0.02 60)", rotate = 0 }) {
  // Wing path (mirrored)
  const wingTop = "M 0 0 Q -40 -38, -68 -30 Q -90 -22, -78 8 Q -64 26, -32 22 Q -8 18, 0 8 Z";
  const wingBot = "M 0 8 Q -10 18, -34 30 Q -54 42, -42 56 Q -28 64, -10 50 Q -2 36, 0 22 Z";
  // Wing dots
  const dots = [
    { x: -55, y: -16, r: 2.5 },
    { x: -65, y: -8, r: 2.5 },
    { x: -72, y: 2, r: 2.5 },
    { x: -42, y: 50, r: 2 },
    { x: -32, y: 58, r: 2 },
    { x: -18, y: 56, r: 2 },
  ];
  return (
    <svg viewBox="0 0 200 200" width={size} height={size} style={{ transform: `rotate(${rotate}deg)`, overflow: "visible" }}>
      <g transform="translate(100 100)">
        {/* shadow */}
        <g transform="translate(2 3)" style={{ filter: "blur(2.5px)" }} opacity="0.2">
          <path d={wingTop} fill="oklch(0.2 0.02 60)" />
          <path d={wingBot} fill="oklch(0.2 0.02 60)" />
          <g transform="scale(-1 1)"><path d={wingTop} fill="oklch(0.2 0.02 60)" /></g>
          <g transform="scale(-1 1)"><path d={wingBot} fill="oklch(0.2 0.02 60)" /></g>
        </g>
        {/* cookie rim */}
        <g style={{ transform: "scale(1.04)" }} opacity="0.85">
          <path d={wingTop} fill="oklch(0.82 0.07 70)" />
          <path d={wingBot} fill="oklch(0.82 0.07 70)" />
          <g transform="scale(-1 1)"><path d={wingTop} fill="oklch(0.82 0.07 70)" /></g>
          <g transform="scale(-1 1)"><path d={wingBot} fill="oklch(0.82 0.07 70)" /></g>
        </g>
        {/* left wings */}
        <path d={wingTop} fill={body} stroke={outline} strokeWidth="3" strokeLinejoin="round" />
        <path d={wingBot} fill={body} stroke={outline} strokeWidth="3" strokeLinejoin="round" />
        {/* Veining */}
        <path d="M -8 -2 L -34 -14 M -8 -2 L -48 -12 M -8 -2 L -60 -4 M -8 -2 L -54 12 M 0 12 L -20 30 M 0 12 L -32 42 M 0 12 L -40 50" stroke={outline} strokeWidth="2" fill="none" strokeLinecap="round" />
        {/* dots */}
        {dots.map((d, i) => <circle key={i} cx={d.x} cy={d.y} r={d.r} fill="oklch(0.98 0 0)" stroke={outline} strokeWidth="0.6" />)}
        {/* right wings (mirror) */}
        <g transform="scale(-1 1)">
          <path d={wingTop} fill={body} stroke={outline} strokeWidth="3" strokeLinejoin="round" />
          <path d={wingBot} fill={body} stroke={outline} strokeWidth="3" strokeLinejoin="round" />
          <path d="M -8 -2 L -34 -14 M -8 -2 L -48 -12 M -8 -2 L -60 -4 M -8 -2 L -54 12 M 0 12 L -20 30 M 0 12 L -32 42 M 0 12 L -40 50" stroke={outline} strokeWidth="2" fill="none" strokeLinecap="round" />
          {dots.map((d, i) => <circle key={i} cx={d.x} cy={d.y} r={d.r} fill="oklch(0.98 0 0)" stroke={outline} strokeWidth="0.6" />)}
        </g>
        {/* Body */}
        <ellipse cx="0" cy="0" rx="6" ry="32" fill={outline} />
        <circle cx="0" cy="-32" r="6" fill={outline} />
        {/* Antennae */}
        <path d="M -2 -36 Q -8 -50, -14 -54 M 2 -36 Q 8 -50, 14 -54" stroke={outline} strokeWidth="2" fill="none" strokeLinecap="round" />
        <circle cx="-14" cy="-54" r="2" fill={outline} />
        <circle cx="14" cy="-54" r="2" fill={outline} />
      </g>
    </svg>
  );
}

// ===========================================================================
// 5. MUSHROOM — red cap, cream stem, white dots
// ===========================================================================
function Mushroom({ size = 200, cap = "oklch(0.5 0.16 25)", capEdge = "oklch(0.35 0.13 25)", stem = "oklch(0.94 0.02 80)", rotate = 0 }) {
  // Cap: dome path
  const capPath = "M 30 100 Q 30 30, 100 30 Q 170 30, 170 100 L 130 100 Q 100 105, 70 100 Z";
  // Stem: trapezoidal
  const stemPath = "M 70 100 Q 75 130, 70 165 Q 80 175, 100 175 Q 120 175, 130 165 Q 125 130, 130 100 Q 100 105, 70 100 Z";

  return (
    <svg viewBox="0 0 200 200" width={size} height={size} style={{ transform: `rotate(${rotate}deg)`, overflow: "visible" }}>
      <g transform="translate(2 4)" style={{ filter: "blur(2.5px)" }} opacity="0.2">
        <path d={capPath} fill="oklch(0.2 0.02 60)" />
        <path d={stemPath} fill="oklch(0.2 0.02 60)" />
      </g>
      {/* rim */}
      <path d={capPath} fill="oklch(0.82 0.07 70)" transform="scale(1.03) translate(-3 -1.5)" />
      <path d={stemPath} fill="oklch(0.82 0.07 70)" transform="scale(1.03) translate(-3 -1.5)" />
      {/* cap */}
      <path d={capPath} fill={cap} stroke={capEdge} strokeWidth="2.5" strokeLinejoin="round" />
      {/* stem */}
      <path d={stemPath} fill={stem} stroke="oklch(0.7 0.04 70)" strokeWidth="2.5" strokeLinejoin="round" />
      {/* gill line under cap */}
      <path d="M 70 100 Q 100 108, 130 100" fill="none" stroke="oklch(0.7 0.04 70)" strokeWidth="1.5" />
      {/* white dots on cap */}
      <circle cx="60" cy="62" r="5" fill="oklch(0.98 0 0)" />
      <circle cx="100" cy="48" r="6.5" fill="oklch(0.98 0 0)" />
      <circle cx="135" cy="68" r="4.5" fill="oklch(0.98 0 0)" />
      <circle cx="80" cy="82" r="3" fill="oklch(0.98 0 0)" />
      <circle cx="150" cy="88" r="3.5" fill="oklch(0.98 0 0)" />
    </svg>
  );
}

// ===========================================================================
// 6. MILK BOTTLE — cream body + mustard top, cursive name
// ===========================================================================
function MilkBottle({ size = 200, body = "oklch(0.97 0.01 80)", top = "oklch(0.78 0.13 75)", name = "Novel", rotate = 0 }) {
  // Bottle path: square base with rounded shoulders + tapered nipple
  const d = "M 60 195 Q 50 195, 50 185 L 50 100 Q 50 88, 56 84 L 56 70 Q 56 60, 64 56 L 80 50 L 80 38 Q 80 30, 90 28 L 110 28 Q 120 30, 120 38 L 120 50 L 136 56 Q 144 60, 144 70 L 144 84 Q 150 88, 150 100 L 150 185 Q 150 195, 140 195 Z";
  const topD = "M 56 84 L 56 70 Q 56 60, 64 56 L 80 50 L 80 38 Q 80 30, 90 28 L 110 28 Q 120 30, 120 38 L 120 50 L 136 56 Q 144 60, 144 70 L 144 84 Z";
  return (
    <svg viewBox="0 0 200 200" width={size} height={size} style={{ transform: `rotate(${rotate}deg)`, overflow: "visible" }}>
      <path d={d} fill="oklch(0.3 0.04 60 / 0.18)" transform="translate(2 3)" style={{ filter: "blur(2px)" }} />
      <path d={d} fill="oklch(0.82 0.07 70)" transform="scale(1.03) translate(-3 -3)" />
      <path d={d} fill={body} />
      <path d={topD} fill={top} />
      <path d={d} fill="none" stroke="oklch(0.55 0.08 240)" strokeWidth="2.5" strokeLinejoin="round" />
      {/* Measuring ticks */}
      {[110, 130, 150, 170].map((y, i) => (
        <line key={i} x1="60" y1={y} x2="80" y2={y} stroke="oklch(0.55 0.08 240)" strokeWidth="1.5" />
      ))}
      {/* Cursive name */}
      <Script x="100" y="160" text={name} size={28} color="oklch(0.4 0.13 250)" />
    </svg>
  );
}

// ===========================================================================
// 7. SQUARE WITH SPRINKLE CORNER + BUBBLE TEXT
// ===========================================================================
function SprinkleSquare({ size = 200, bg = "oklch(0.82 0.07 295)", text = "DALIA", rotate = 0 }) {
  const sq = "M 20 28 Q 20 18, 30 18 L 170 18 Q 180 18, 180 28 L 180 172 Q 180 182, 170 182 L 30 182 Q 20 182, 20 172 Z";
  // Corner clusters of organic dot-flowers
  const clusterColors = ["oklch(0.7 0.16 30)", "oklch(0.75 0.14 70)", "oklch(0.65 0.14 145)", "oklch(0.6 0.14 235)", "oklch(0.8 0.13 95)"];
  function Cluster({ cx, cy, n = 18, r = 30 }) {
    const dots = [];
    for (let i = 0; i < n; i++) {
      const a = Math.random() * Math.PI * 2;
      const d = Math.random() * r;
      const px = cx + Math.cos(a) * d;
      const py = cy + Math.sin(a) * d;
      const c = clusterColors[i % clusterColors.length];
      dots.push(<circle key={i} cx={px} cy={py} r={2 + Math.random() * 1.8} fill={c} opacity="0.95" />);
    }
    return <g>{dots}</g>;
  }
  return (
    <svg viewBox="0 0 200 200" width={size} height={size} style={{ transform: `rotate(${rotate}deg)`, overflow: "visible" }}>
      <path d={sq} fill="oklch(0.3 0.04 60 / 0.18)" transform="translate(2 3)" style={{ filter: "blur(2px)" }} />
      <path d={sq} fill="oklch(0.82 0.07 70)" transform="scale(1.025) translate(-2.5 -2.5)" />
      <path d={sq} fill={bg} stroke="oklch(0.5 0.13 295)" strokeWidth="2.5" strokeLinejoin="round" />
      {/* Bubble text */}
      <Bubble x="100" y="112" text={text} size={32} fill="oklch(0.78 0.13 145)" stroke="oklch(0.4 0.13 145)" />
      {/* Corner sprinkle clusters */}
      <Cluster cx="35" cy="40" n="16" r="28" />
      <Cluster cx="170" cy="170" n="14" r="22" />
    </svg>
  );
}

// ===========================================================================
// 8. PALM TREE SQUARE — cream square, mustard sun, brown palms
// ===========================================================================
function PalmSquare({ size = 200, rotate = 0 }) {
  const sq = "M 20 28 Q 20 18, 30 18 L 170 18 Q 180 18, 180 28 L 180 172 Q 180 182, 170 182 L 30 182 Q 20 182, 20 172 Z";
  // Palm leaves — long pointed ellipses radiating from a center
  function Palm({ x, y, scale = 1 }) {
    const leaves = [];
    for (let i = 0; i < 7; i++) {
      const a = -90 + (i - 3) * 22; // spread upward
      leaves.push(
        <g key={i} transform={`translate(${x} ${y}) rotate(${a})`}>
          <ellipse cx="0" cy="-26" rx="6" ry="22" fill="oklch(0.4 0.06 50)" />
        </g>
      );
    }
    return (
      <g transform={`translate(${x} ${y}) scale(${scale})`}>
        {/* trunk */}
        <path d="M -3 0 Q -2 30, -1 60 L 1 60 Q 2 30, 3 0 Z" transform={`translate(${-x} ${-y})`} fill="oklch(0.4 0.06 50)" />
      </g>
    );
  }
  return (
    <svg viewBox="0 0 200 200" width={size} height={size} style={{ transform: `rotate(${rotate}deg)`, overflow: "visible" }}>
      <path d={sq} fill="oklch(0.3 0.04 60 / 0.18)" transform="translate(2 3)" style={{ filter: "blur(2px)" }} />
      <path d={sq} fill="oklch(0.82 0.07 70)" transform="scale(1.025) translate(-2.5 -2.5)" />
      <path d={sq} fill="oklch(0.97 0.01 90)" />
      <clipPath id="palm-clip"><path d={sq} /></clipPath>
      <g clipPath="url(#palm-clip)">
        {/* sun */}
        <circle cx="100" cy="78" r="44" fill="oklch(0.8 0.13 80)" />
        {/* sand hills */}
        <path d="M 0 120 Q 60 100, 100 115 T 200 122 L 200 200 L 0 200 Z" fill="oklch(0.55 0.13 45)" />
        {/* Palm trees */}
        <g transform="translate(60 105)">
          <path d="M -3 0 L -1 50 L 1 50 L 3 0 Z" fill="oklch(0.38 0.06 50)" />
          {[-70, -45, -20, 5, 30, 55].map((a, i) => (
            <g key={i} transform={`rotate(${a})`}>
              <ellipse cx="0" cy="-22" rx="5" ry="22" fill="oklch(0.38 0.06 50)" />
            </g>
          ))}
        </g>
        <g transform="translate(140 110)">
          <path d="M -3 0 L -1 50 L 1 50 L 3 0 Z" fill="oklch(0.38 0.06 50)" />
          {[-70, -45, -20, 5, 30, 55].map((a, i) => (
            <g key={i} transform={`rotate(${a})`}>
              <ellipse cx="0" cy="-22" rx="5" ry="22" fill="oklch(0.38 0.06 50)" />
            </g>
          ))}
        </g>
      </g>
      <path d={sq} fill="none" stroke="oklch(0.5 0.1 60)" strokeWidth="2.5" strokeLinejoin="round" />
      <Script x="100" y="178" text="welcome" size={20} color="oklch(0.4 0.13 250)" />
    </svg>
  );
}

// ===========================================================================
// 9. DRAGONFLY — light blue + lavender wings
// ===========================================================================
function Dragonfly({ size = 200, rotate = 0 }) {
  // Wings: long elongated ellipses; 4 of them (2 per side)
  return (
    <svg viewBox="0 0 200 200" width={size} height={size} style={{ transform: `rotate(${rotate}deg)`, overflow: "visible" }}>
      <g transform="translate(100 100)">
        {/* Shadow */}
        <g transform="translate(2 3)" style={{ filter: "blur(2.5px)" }} opacity="0.18">
          <ellipse cx="-44" cy="-18" rx="44" ry="14" />
          <ellipse cx="44" cy="-18" rx="44" ry="14" />
          <ellipse cx="-38" cy="18" rx="38" ry="11" />
          <ellipse cx="38" cy="18" rx="38" ry="11" />
        </g>
        {/* Cookie rim under wings */}
        <g style={{ transform: "scale(1.04)" }} opacity="0.8" fill="oklch(0.82 0.07 70)">
          <ellipse cx="-44" cy="-18" rx="44" ry="14" />
          <ellipse cx="44" cy="-18" rx="44" ry="14" />
          <ellipse cx="-38" cy="18" rx="38" ry="11" />
          <ellipse cx="38" cy="18" rx="38" ry="11" />
        </g>
        {/* Top wings */}
        <ellipse cx="-44" cy="-18" rx="44" ry="14" fill="oklch(0.88 0.05 230)" stroke="oklch(0.55 0.08 240)" strokeWidth="2" />
        <ellipse cx="44" cy="-18" rx="44" ry="14" fill="oklch(0.88 0.05 230)" stroke="oklch(0.55 0.08 240)" strokeWidth="2" />
        {/* Bottom wings */}
        <ellipse cx="-38" cy="18" rx="38" ry="11" fill="oklch(0.84 0.08 290)" stroke="oklch(0.5 0.13 295)" strokeWidth="2" />
        <ellipse cx="38" cy="18" rx="38" ry="11" fill="oklch(0.84 0.08 290)" stroke="oklch(0.5 0.13 295)" strokeWidth="2" />
        {/* Wing veins */}
        {[-44, 44].map((cx, i) => (
          <g key={i}>
            <path d={`M ${cx - 40} -18 L ${cx + 40} -18 M ${cx} -28 L ${cx} -8`} stroke="oklch(0.55 0.08 240 / 0.5)" strokeWidth="1" fill="none" />
          </g>
        ))}
        {/* Body — segmented beads */}
        <ellipse cx="0" cy="-30" rx="6" ry="7" fill="oklch(0.84 0.08 290)" stroke="oklch(0.4 0.13 295)" strokeWidth="1.5" />
        {[0, 8, 16, 24, 32, 40, 48].map((y, i) => (
          <circle key={i} cx="0" cy={-22 + y} r={5.5 - i * 0.3} fill="oklch(0.78 0.05 230)" stroke="oklch(0.4 0.13 295)" strokeWidth="1.5" />
        ))}
        {/* eyes */}
        <circle cx="-4" cy="-32" r="2.2" fill="oklch(0.25 0.03 50)" />
        <circle cx="4" cy="-32" r="2.2" fill="oklch(0.25 0.03 50)" />
      </g>
    </svg>
  );
}

// ===========================================================================
// 10. MOSQUE / DOME — brown with mustard door
// ===========================================================================
function Mosque({ size = 200, rotate = 0 }) {
  const d = "M 100 18 Q 96 22, 96 30 L 96 38 Q 60 42, 50 80 L 38 80 L 38 90 L 30 90 Q 26 92, 26 100 L 26 180 Q 26 188, 36 188 L 164 188 Q 174 188, 174 180 L 174 100 Q 174 92, 170 90 L 162 90 L 162 80 L 150 80 Q 140 42, 104 38 L 104 30 Q 104 22, 100 18 Z";
  // Mosque dome top: arches along base
  return (
    <svg viewBox="0 0 200 200" width={size} height={size} style={{ transform: `rotate(${rotate}deg)`, overflow: "visible" }}>
      <path d={d} fill="oklch(0.3 0.04 60 / 0.18)" transform="translate(2 3)" style={{ filter: "blur(2px)" }} />
      <path d={d} fill="oklch(0.82 0.07 70)" transform="scale(1.025) translate(-2.5 -2.5)" />
      <path d={d} fill="oklch(0.4 0.06 50)" stroke="oklch(0.25 0.04 50)" strokeWidth="2.5" strokeLinejoin="round" />
      {/* Crenellation pattern */}
      <g>
        {[40, 56, 72, 88, 104, 120, 136, 152].map((x, i) => (
          <rect key={i} x={x} y="100" width="10" height="14" rx="3" fill="oklch(0.78 0.13 75)" />
        ))}
      </g>
      {/* Door arch */}
      <path d="M 84 188 L 84 150 Q 84 132, 100 132 Q 116 132, 116 150 L 116 188 Z" fill="oklch(0.78 0.13 75)" stroke="oklch(0.5 0.13 60)" strokeWidth="1.8" />
      {/* Door divider */}
      <line x1="100" y1="132" x2="100" y2="188" stroke="oklch(0.5 0.13 60)" strokeWidth="1.4" />
    </svg>
  );
}

Object.assign(window, { Onesie, Daisy, CamelHex, Butterfly, Mushroom, MilkBottle, SprinkleSquare, PalmSquare, Dragonfly, Mosque });
