// =============================================================================
// CARD ART · PRAGMA STUDIOS — 10 archetypes + 1 mythic
// =============================================================================

const PRAGMA_ART = {

  // ── CANDY RUSH — candy cluster heart + sparkles ──────────────────────
  sweet: (c) => <g>
    {/* Background sparkle dots */}
    <circle cx="14" cy="18" r="1" fill={c}/>
    <circle cx="86" cy="22" r="1" fill={c}/>
    <circle cx="20" cy="82" r="1" fill={c}/>
    <circle cx="84" cy="80" r="1" fill={c}/>
    <path d="M 12 30 L 16 30 M 14 28 L 14 32" />
    <path d="M 86 70 L 90 70 M 88 68 L 88 72" />
    {/* Heart-shaped candy cluster */}
    <circle cx="35" cy="42" r="10" fill={c} fillOpacity="0.15"/>
    <circle cx="65" cy="42" r="10" fill={c} fillOpacity="0.15"/>
    <circle cx="50" cy="56" r="11" fill={c} fillOpacity="0.15"/>
    <circle cx="25" cy="62" r="6" fill={c} fillOpacity="0.1"/>
    <circle cx="75" cy="62" r="6" fill={c} fillOpacity="0.1"/>
    {/* Inner pips */}
    <circle cx="35" cy="42" r="3" fill={c}/>
    <circle cx="65" cy="42" r="3" fill={c}/>
    <circle cx="50" cy="56" r="3" fill={c}/>
    <circle cx="25" cy="62" r="1.5" fill={c}/>
    <circle cx="75" cy="62" r="1.5" fill={c}/>
    {/* Ribbon */}
    <path d="M 12 78 Q 30 72 50 78 T 88 78" />
    <path d="M 12 84 Q 30 80 50 84 T 88 84" strokeOpacity="0.4"/>
  </g>,

  // ── GATES OF ZEUS — Zeus with crown of lightning + columns ───────────
  zeus: (c) => <g>
    {/* Mountain backdrop */}
    <path d="M 5 75 L 25 50 L 40 65 L 60 40 L 75 60 L 95 75 Z" fill={c} fillOpacity="0.08"/>
    {/* Columns */}
    <rect x="10" y="50" width="6" height="38" fill={c} fillOpacity="0.15"/>
    <rect x="84" y="50" width="6" height="38" fill={c} fillOpacity="0.15"/>
    <path d="M 7 48 L 19 48 M 81 48 L 93 48" strokeWidth="1.8"/>
    <path d="M 8 88 L 18 88 M 82 88 L 92 88"/>
    {/* Lightning bolt — central */}
    <path d="M 50 8 L 38 38 L 48 38 L 38 70 L 62 36 L 52 36 L 60 8 Z" fill={c} fillOpacity="0.35"/>
    {/* Aura ring */}
    <circle cx="50" cy="40" r="32" strokeDasharray="2 3" strokeOpacity="0.5"/>
    {/* Sparks */}
    <path d="M 26 22 L 30 22 M 28 20 L 28 24" />
    <path d="M 70 22 L 74 22 M 72 20 L 72 24" />
  </g>,

  // ── BIG BASS FRENZY — fisherman + bass ───────────────────────────────
  fisher: (c) => <g>
    {/* Water lines */}
    <path d="M 5 65 Q 20 60 35 65 T 65 65 T 95 65" />
    <path d="M 5 75 Q 20 70 35 75 T 65 75 T 95 75" strokeOpacity="0.5"/>
    <path d="M 5 85 Q 20 80 35 85 T 65 85 T 95 85" strokeOpacity="0.3"/>
    {/* Boat */}
    <path d="M 18 58 L 50 58 L 46 66 L 22 66 Z" fill={c} fillOpacity="0.2"/>
    {/* Fisherman silhouette */}
    <circle cx="34" cy="38" r="6" fill={c} fillOpacity="0.25"/>
    <path d="M 28 44 L 28 58 L 40 58 L 40 44 Z" fill={c} fillOpacity="0.2"/>
    {/* Hat brim */}
    <path d="M 26 35 L 42 35" strokeWidth="1.8"/>
    {/* Fishing rod */}
    <path d="M 36 44 L 78 12" strokeWidth="1.2"/>
    <path d="M 78 12 L 82 70" strokeDasharray="2 2" strokeOpacity="0.6"/>
    {/* Big bass jumping */}
    <path d="M 75 70 Q 86 56 96 70 Q 86 84 75 70 Z" fill={c} fillOpacity="0.2"/>
    <path d="M 70 64 L 75 70 L 70 76" />
    <circle cx="90" cy="68" r="1.5" fill={c}/>
    <path d="M 84 70 L 88 70"/>
  </g>,

  // ── SUGAR STORM — candy tornado spiral ───────────────────────────────
  sugar: (c) => <g>
    {/* Tornado spiral */}
    <path d="M 50 50 m 0 -28 a 28 28 0 1 0 0 56 a 22 22 0 1 1 0 -44 a 16 16 0 1 0 0 32 a 11 11 0 1 1 0 -22 a 6 6 0 1 0 0 12" fill="none"/>
    {/* Candies along spiral */}
    <circle cx="50" cy="22" r="3" fill={c}/>
    <circle cx="74" cy="50" r="3" fill={c} fillOpacity="0.7"/>
    <circle cx="50" cy="72" r="3" fill={c} fillOpacity="0.5"/>
    <circle cx="32" cy="44" r="2.5" fill={c}/>
    <circle cx="58" cy="62" r="2" fill={c} fillOpacity="0.6"/>
    {/* Stick */}
    <path d="M 50 56 L 50 92" strokeWidth="1.5"/>
    {/* X-marks (sparkle) */}
    <path d="M 14 28 L 20 28 M 17 25 L 17 31" strokeOpacity="0.6"/>
    <path d="M 80 80 L 86 80 M 83 77 L 83 83" strokeOpacity="0.6"/>
  </g>,

  // ── WOLF MOON — howling wolf + moon + mountains ──────────────────────
  wolf: (c) => <g>
    {/* Full moon */}
    <circle cx="72" cy="28" r="14" fill={c} fillOpacity="0.25"/>
    <circle cx="78" cy="24" r="2" fill={c} fillOpacity="0.5"/>
    <circle cx="68" cy="32" r="1.5" fill={c} fillOpacity="0.5"/>
    {/* Mountain silhouette */}
    <path d="M 0 80 L 14 60 L 24 70 L 38 50 L 50 65 L 62 55 L 78 72 L 100 80 Z" fill={c} fillOpacity="0.1"/>
    {/* Wolf head facing right, mouth up howling */}
    <path d="M 22 88 L 22 70 L 18 58 L 22 50 L 28 46 L 28 38 L 34 32 L 36 40 L 44 36 L 42 50 L 50 56 L 50 70 L 42 78 L 42 88 Z" fill={c} fillOpacity="0.3"/>
    {/* Wolf ear and detail */}
    <path d="M 28 46 L 30 38 L 36 44"/>
    <circle cx="36" cy="48" r="1.5" fill={c}/>
    {/* Howling line */}
    <path d="M 34 30 Q 50 16 70 18" strokeDasharray="2 2"/>
  </g>,

  // ── STARLIGHT QUEEN — crown with stars ────────────────────────────────
  star: (c) => <g>
    {/* Halo ring */}
    <circle cx="50" cy="50" r="38" strokeDasharray="1 3" strokeOpacity="0.6"/>
    {/* Main star */}
    <path d="M 50 16 L 56 38 L 80 38 L 60 52 L 68 76 L 50 62 L 32 76 L 40 52 L 20 38 L 44 38 Z" fill={c} fillOpacity="0.25"/>
    {/* Inner star */}
    <path d="M 50 32 L 53 44 L 65 44 L 55 51 L 59 63 L 50 56 L 41 63 L 45 51 L 35 44 L 47 44 Z" fill={c} fillOpacity="0.5"/>
    {/* Center jewel */}
    <circle cx="50" cy="50" r="4" fill={c}/>
    {/* Smaller surrounding stars */}
    <path d="M 18 20 L 20 24 L 24 24 L 21 27 L 22 31 L 18 28 L 14 31 L 15 27 L 12 24 L 16 24 Z" fill={c}/>
    <path d="M 82 80 L 84 84 L 88 84 L 85 87 L 86 91 L 82 88 L 78 91 L 79 87 L 76 84 L 80 84 Z" fill={c}/>
  </g>,

  // ── LUCKY TIGER — tiger head + bamboo/coins ──────────────────────────
  tiger: (c) => <g>
    {/* Mahjong-style frame */}
    <rect x="10" y="14" width="80" height="72" strokeOpacity="0.4"/>
    {/* Tiger face */}
    <path d="M 30 30 L 26 22 L 38 28 L 50 22 L 62 28 L 74 22 L 70 30 L 76 42 L 76 60 L 70 72 L 54 78 L 46 78 L 30 72 L 24 60 L 24 42 Z" fill={c} fillOpacity="0.15"/>
    {/* Stripes */}
    <path d="M 32 32 L 34 38 M 40 28 L 42 36 M 50 26 L 50 34 M 58 28 L 56 36 M 66 32 L 64 38" strokeWidth="1.8"/>
    <path d="M 26 56 L 32 56 M 68 56 L 74 56 M 28 64 L 34 64 M 66 64 L 72 64"/>
    {/* Eyes */}
    <circle cx="40" cy="46" r="3" fill={c}/>
    <circle cx="60" cy="46" r="3" fill={c}/>
    {/* Snout */}
    <path d="M 46 58 L 50 62 L 54 58 Z" fill={c}/>
    <path d="M 44 66 L 50 70 L 56 66"/>
    {/* Coin */}
    <circle cx="84" cy="84" r="5" fill={c} fillOpacity="0.4"/>
    <rect x="82" y="82" width="4" height="4" fill="none"/>
  </g>,

  // ── DOG HOUSE PARTY — bulldog + party hat + bone ─────────────────────
  dog: (c) => <g>
    {/* Dog house silhouette behind */}
    <path d="M 6 78 L 6 50 L 30 30 L 54 50 L 54 78 Z" fill={c} fillOpacity="0.1"/>
    <rect x="14" y="58" width="14" height="20"/>
    {/* Party hat (triangle) */}
    <path d="M 60 30 L 70 8 L 80 30 Z" fill={c} fillOpacity="0.25"/>
    <circle cx="70" cy="6" r="2" fill={c}/>
    <path d="M 58 28 L 82 28" strokeWidth="1.8"/>
    {/* Bulldog face */}
    <path d="M 50 78 L 50 60 Q 50 42 70 42 Q 90 42 90 60 L 90 78 Z" fill={c} fillOpacity="0.2"/>
    {/* Floppy ears */}
    <path d="M 50 50 L 44 64 L 52 66"/>
    <path d="M 90 50 L 96 64 L 88 66"/>
    {/* Eyes */}
    <circle cx="62" cy="56" r="2" fill={c}/>
    <circle cx="78" cy="56" r="2" fill={c}/>
    {/* Snout */}
    <ellipse cx="70" cy="68" rx="6" ry="3" fill={c} fillOpacity="0.4"/>
    <path d="M 64 72 L 70 76 L 76 72"/>
    {/* Bone */}
    <path d="M 14 86 L 38 86 M 12 84 Q 10 86 12 88 M 16 84 Q 14 86 16 88 M 36 84 Q 38 86 36 88 M 40 84 Q 42 86 40 88"/>
  </g>,

  // ── MADAME FORTUNE — fortune teller + crystal ball ───────────────────
  madame: (c) => <g>
    {/* Stars background */}
    <path d="M 14 14 L 16 18 L 20 18 L 17 21 L 18 25 L 14 22 L 10 25 L 11 21 L 8 18 L 12 18 Z" fill={c}/>
    <path d="M 84 18 L 86 22 L 90 22 L 87 25 L 88 29 L 84 26 L 80 29 L 81 25 L 78 22 L 82 22 Z" fill={c} fillOpacity="0.7"/>
    {/* Crystal ball */}
    <circle cx="50" cy="48" r="26" fill={c} fillOpacity="0.18"/>
    <circle cx="50" cy="48" r="26" strokeDasharray="2 2"/>
    {/* Inner swirl */}
    <path d="M 38 48 Q 50 36 62 48 Q 50 60 38 48" />
    <circle cx="44" cy="44" r="2" fill={c} fillOpacity="0.6"/>
    <circle cx="56" cy="52" r="1.5" fill={c}/>
    {/* Highlight */}
    <path d="M 40 38 Q 38 42 38 46" strokeOpacity="0.4"/>
    {/* Stand / hands */}
    <path d="M 28 76 L 72 76 L 76 90 L 24 90 Z" fill={c} fillOpacity="0.2"/>
    <path d="M 30 74 L 40 70 L 44 76" />
    <path d="M 70 74 L 60 70 L 56 76" />
    {/* Tarot cards corners */}
    <rect x="8" y="78" width="10" height="14" fill={c} fillOpacity="0.2"/>
    <rect x="82" y="78" width="10" height="14" fill={c} fillOpacity="0.2"/>
  </g>,

  // ── FRUIT FIESTA — geometric fruit composition ───────────────────────
  fruit: (c) => <g>
    {/* Bowl / table */}
    <path d="M 14 76 L 86 76 L 80 88 L 20 88 Z" fill={c} fillOpacity="0.15"/>
    <path d="M 14 76 L 86 76" strokeWidth="1.8"/>
    {/* Watermelon slice */}
    <path d="M 30 76 Q 30 50 50 50 Q 70 50 70 76 Z" fill={c} fillOpacity="0.2"/>
    <path d="M 30 76 Q 30 56 50 56 Q 70 56 70 76"/>
    <circle cx="42" cy="68" r="1" fill={c}/>
    <circle cx="50" cy="64" r="1" fill={c}/>
    <circle cx="58" cy="68" r="1" fill={c}/>
    {/* Cherries */}
    <circle cx="22" cy="64" r="6" fill={c} fillOpacity="0.25"/>
    <circle cx="32" cy="60" r="5" fill={c} fillOpacity="0.25"/>
    <path d="M 22 58 Q 28 40 36 30" />
    <path d="M 32 55 Q 30 42 36 30" />
    <path d="M 36 30 L 40 26 L 36 28 L 38 24"/>
    {/* Lemon */}
    <ellipse cx="76" cy="60" rx="10" ry="7" fill={c} fillOpacity="0.2"/>
    <path d="M 70 56 L 70 64 M 76 53 L 76 67 M 82 56 L 82 64"/>
    {/* Apple top */}
    <circle cx="50" cy="22" r="8" fill={c} fillOpacity="0.3"/>
    <path d="M 50 14 L 50 10 L 56 12" />
  </g>,

  // ── MYTHIC: THUNDER ETERNAL ──────────────────────────────────────────
  'zeus-mythic': (c) => <g>
    {/* Outer mythic rings */}
    <circle cx="50" cy="50" r="46" strokeDasharray="2 2"/>
    <circle cx="50" cy="50" r="40" strokeDasharray="1 4" strokeOpacity="0.6"/>
    <circle cx="50" cy="50" r="34"/>
    {/* Sun rays */}
    {[0, 30, 60, 90, 120, 150, 180, 210, 240, 270, 300, 330].map(a => {
      const r1 = 35, r2 = 44;
      const x1 = 50 + r1 * Math.cos(a * Math.PI/180);
      const y1 = 50 + r1 * Math.sin(a * Math.PI/180);
      const x2 = 50 + r2 * Math.cos(a * Math.PI/180);
      const y2 = 50 + r2 * Math.sin(a * Math.PI/180);
      return <path key={a} d={`M ${x1} ${y1} L ${x2} ${y2}`} strokeWidth="1.5"/>;
    })}
    {/* Triple lightning */}
    <path d="M 50 12 L 32 48 L 46 48 L 36 88 L 76 42 L 58 42 L 70 12 Z" fill={c} fillOpacity="0.5"/>
    {/* Center pulse */}
    <circle cx="50" cy="50" r="6" fill={c}/>
  </g>,
};

window.PRAGMA_ART = PRAGMA_ART;

// =============================================================================
// PRAGMA — RASTER ILLUSTRATIONS
// Curated artwork supplied for the PRAGMA STUDIOS collection. The CardArt
// router prefers these images over the SVG fallback above.
// =============================================================================

window.PRAGMA_ART_IMAGES = {
  sweet:   'assets/pragma/candy-rush.png',
  zeus:    'assets/pragma/gates-of-zeus.png',
  fisher:  'assets/pragma/big-bass-frenzy.png',
  sugar:   'assets/pragma/sugar-storm.png',
  wolf:    'assets/pragma/wolf-moon.png',
  star:    'assets/pragma/starlight-queen.png',
  tiger:   'assets/pragma/lucky-tiger.png',
  dog:     'assets/pragma/dog-house-party.png',
  madame:  'assets/pragma/madame-fortune.png',
  fruit:   'assets/pragma/fruit-fiesta.png',
};
