@idosgames/game-kit 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 iDos Games
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,32 @@
1
- # Temporary Holding Version
1
+ # @idosgames/game-kit
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Games as data for the iDos Games platform. A game is a **GameSpec** (JSON): which genre presets it runs as
4
+ modes, how they are linked through resources, its setting, palette, texts and reward multipliers. The
5
+ prebuilt runtime of its engine reads the spec and runs the game, so a new game needs no build of its own.
6
+
7
+ - **Registry** — one place for blocks, genre presets and rule effects. A new genre or effect is a new
8
+ entry; a project extends the platform's registry with `registry.extend()`.
9
+ - **GameSpec** — versioned, migrated forward, unknown fields kept. `validateSpec(spec, registry)` never
10
+ throws: it repairs what it can (clamps numbers, drops unknown parameters) and reports the rest as issues
11
+ with stable codes.
12
+ - **Economy check** — every persistent resource needs a source and a sink (a mode of the spec or a
13
+ platform system such as `system:store`).
14
+ - **World** — entities, components, systems and events. Deterministic: same seed, same run.
15
+ - **Rules** — `{ on, when, do }`: trigger → condition → effects. Effects are registry entries.
16
+ - **Formulas** — a small safe language (`"base * 1.15 ^ vars.level"`), never `eval`.
17
+
18
+ ```ts
19
+ import { BLOCKS, PRESETS, createKitRegistry, startMode, validateSpec } from "@idosgames/game-kit";
20
+
21
+ const registry = createKitRegistry();
22
+ registry.define(BLOCKS, { id: "coin-field", version: 1, setup: ({ world }) => { /* systems */ } });
23
+ registry.define(PRESETS, { id: "runner", version: 1, engine: "phaser", genre: "runner", blocks: ["coin-field"] });
24
+
25
+ const result = validateSpec(spec, registry);
26
+ if (result.ok) {
27
+ const game = startMode(result.resolved!, "run", registry);
28
+ game.world.step(1 / 60);
29
+ }
30
+ ```
31
+
32
+ The core is engine-free; renderers come as adapters.
@@ -0,0 +1,2 @@
1
+ function St(r){let t=1779033703^r.length;for(let e=0;e<r.length;e++)t=Math.imul(t^r.charCodeAt(e),3432918353),t=t<<13|t>>>19;return ()=>(t=Math.imul(t^t>>>16,2246822507),t=Math.imul(t^t>>>13,3266489909),t^=t>>>16,t>>>0)}function Ht(r,t,e,o){return ()=>{r>>>=0,t>>>=0,e>>>=0,o>>>=0;let i=r+t|0;return r=t^t>>>9,t=e+(e<<3)|0,e=e<<21|e>>>11,o=o+1|0,i=i+o|0,e=e+i|0,(i>>>0)/4294967296}}function st(r){let t=String(r),e=St(t),o=Ht(e(),e(),e(),e());for(let s=0;s<12;s++)o();return {seed:t,next:o,int(s,l){if(!Number.isFinite(s)||!Number.isFinite(l))throw new RangeError("int: bounds must be finite");let n=Math.ceil(Math.min(s,l)),a=Math.floor(Math.max(s,l));return n+Math.floor(o()*(a-n+1))},range(s,l){return s+o()*(l-s)},chance(s){return o()<s},pick(s){if(s.length===0)throw new RangeError("pick: empty list");return s[Math.floor(o()*s.length)]},weighted(s,l){let n=0;for(let $ of s)n+=Math.max(0,l($));if(n<=0)throw new RangeError("weighted: no positive weight");let a=o()*n;for(let $ of s){let y=Math.max(0,l($));if(!(y<=0)){if(a<y)return $;a-=y;}}for(let $=s.length-1;$>=0;$--){let y=s[$];if(l(y)>0)return y}throw new RangeError("weighted: no positive weight")},shuffle(s){let l=s.slice();for(let n=l.length-1;n>0;n--){let a=Math.floor(o()*(n+1)),$=l[n];l[n]=l[a],l[a]=$;}return l},stream(s){return st(`${t}/${s}`)}}}var Nt=/^[a-z][a-z0-9-]*(?:\.[a-z0-9-]+)*$/;function lt(r){if(!Nt.test(r))throw new Error(`world: bad component name "${r}"`);return Object.freeze({name:r})}var kt=class{rng;vars;tick=0;time=0;nextId=1;alive=new Set;stores=new Map;doomed=new Set;systems=[];systemSeq=0;handlers=new Map;queue=[];maxEventRounds;stepping=false;constructor(t={}){this.rng=st(t.seed??"world"),this.vars={...t.vars??{}},this.maxEventRounds=t.maxEventRounds??16;}create(){let t=this.nextId++;return this.alive.add(t),t}destroy(t){this.alive.has(t)&&(this.stepping?this.doomed.add(t):this.purge(t));}isAlive(t){return this.alive.has(t)&&!this.doomed.has(t)}get entityCount(){return this.alive.size-this.doomed.size}set(t,e,o){if(!this.alive.has(t))throw new Error(`world: entity ${t} does not exist`);let i=this.stores.get(e.name);return i||(i=new Map,this.stores.set(e.name,i)),i.set(t,o),t}get(t,e){return this.stores.get(e.name)?.get(t)}need(t,e){let o=this.get(t,e);if(o===void 0)throw new Error(`world: entity ${t} has no ${e.name}`);return o}has(t,e){return this.stores.get(e.name)?.has(t)??false}remove(t,e){this.stores.get(e.name)?.delete(t);}query(...t){if(t.length===0)return [...this.alive].filter(l=>!this.doomed.has(l)).sort((l,n)=>l-n);let e=t.map(l=>this.stores.get(l.name));if(e.some(l=>!l||l.size===0))return [];let o=e,i=o.reduce((l,n)=>n.size<l.size?n:l),s=[];for(let l of i.keys())this.doomed.has(l)||o.every(n=>n.has(l))&&s.push(l);return s.sort((l,n)=>l-n)}addSystem(t){if(this.systems.some(e=>e.system.id===t.id))throw new Error(`world: system "${t.id}" is already added`);this.systems.push({system:t,seq:this.systemSeq++}),this.systems.sort((e,o)=>(e.system.order??0)-(o.system.order??0)||e.seq-o.seq);}removeSystem(t){this.systems=this.systems.filter(e=>e.system.id!==t);}get systemIds(){return this.systems.map(t=>t.system.id)}on(t,e){let o=this.handlers.get(t)??[];return o.push(e),this.handlers.set(t,o),()=>{let i=this.handlers.get(t);if(!i)return;let s=i.indexOf(e);s>=0&&i.splice(s,1);}}emit(t,e={}){this.queue.push({topic:t,payload:e});}flushEvents(){for(let t=0;t<this.maxEventRounds&&this.queue.length>0;t++){let e=this.queue;this.queue=[];for(let{topic:o,payload:i}of e){let s=this.handlers.get(o);if(!s)continue;for(let n of s.slice())n(i,this);let l=this.handlers.get("*");if(l)for(let n of l.slice())n({...i,topic:o},this);}}this.queue.length>0&&(this.queue=[],this.overflowed++);}overflowed=0;step(t){if(!(t>=0)||!Number.isFinite(t))throw new RangeError("world: dt must be a finite number \u2265 0");this.stepping=true;try{this.tick++,this.time+=t;for(let{system:e}of this.systems.slice())e.run(this,t);this.flushEvents();}finally{this.stepping=false;for(let e of this.doomed)this.purge(e);this.doomed.clear();}}purge(t){this.alive.delete(t);for(let e of this.stores.values())e.delete(t);}};function ro(r,t={}){let e=t.step??.016666666666666666,o=t.maxSteps??5,i=0;return {step:e,advance(s){if(!(s>0)||!Number.isFinite(s))return 0;i+=s;let l=0;for(;i>=e&&l<o;)r.step(e),i-=e,l++;return l===o&&(i=0),l},get alpha(){return i/e}}}var io=lt("transform"),so=lt("visual"),yt=Object.freeze({background:"#1b2133",ground:"#273047",lane:"#313b56",primary:"#4fc3f7",secondary:"#ba68c8",danger:"#ef5350",coin:"#ffd54f",accent:"#66bb6a",text:"#ffffff",muted:"#9aa3b8",piece1:"#ef5350",piece2:"#42a5f5",piece3:"#66bb6a",piece4:"#ffd54f",piece5:"#ab47bc",piece6:"#ff8a3d",panel:"#2b3550"}),nt=/^#[0-9a-fA-F]{6}(?:[0-9a-fA-F]{2})?$/;function wt(r,t){let e=nt.test(r)?r:t[r]??yt[r]??t.text??"#ffffff";return nt.test(e)?e.slice(0,7):"#ffffff"}function lo(r){let t={...yt};for(let[e,o]of Object.entries(r??{}))typeof o=="string"&&nt.test(o)&&(t[e]=o);return t}var no="input",co="view-resized",qt=Object.freeze({hero:{preset:"knight",races:["human"]},foe:{preset:"berserker",parts:{Hat:null,Offhand:null,Weapon:"weapon/battle_axe"},races:["orc"]},foe2:{preset:"crossbowman",parts:{Weapon:"weapon/broadsword"},races:["undead"]},boss:{preset:"dark_knight",races:["orc"]},helper:{preset:"camper",parts:{Weapon:null,Back:null,Glasses:null},races:["human","elf","dwarf"]},foe3:{preset:"crossbowman",races:["undead"]},foe4:{preset:"viking",parts:{Weapon:"weapon/warhammer"},races:["orc"]},foe5:{preset:"hunter",parts:{Hat:null,Back:null,Weapon:"weapon/dagger"},races:["undead"]},hero2:{preset:"crusader",races:["human"]},hero3:{preset:"archmage",races:["elf"]}}),ao=Object.freeze({style:"default",cast:qt}),fo="fx";var Ft=(r,t=0,e=255)=>Math.min(e,Math.max(t,r)),ct=r=>{let t=/^#[0-9a-fA-F]{6}/.test(r)?r.slice(1,7):"ffffff";return [Number.parseInt(t.slice(0,2),16),Number.parseInt(t.slice(2,4),16),Number.parseInt(t.slice(4,6),16)]},Bt=(r,t,e)=>`#${[r,t,e].map(o=>Math.round(Ft(o)).toString(16).padStart(2,"0")).join("")}`;function q(r,t,e){let o=ct(r),i=ct(t);return Bt(o[0]+(i[0]-o[0])*e,o[1]+(i[1]-o[1])*e,o[2]+(i[2]-o[2])*e)}var c=(r,t)=>q(r,"#000000",t),d=(r,t)=>q(r,"#ffffff",t),J=r=>{let[t,e,o]=ct(r);return (t*.299+e*.587+o*.114)/255},p=(r,t,e=false)=>`<linearGradient id="${r}" x1="0" y1="0" x2="${e?1:0}" y2="${e?0:1}">${t.map(([o,i,s])=>`<stop offset="${o}" stop-color="${i}"${s===void 0?"":` stop-opacity="${s}"`}/>`).join("")}</linearGradient>`,u=(r,t,e=.5,o=.5,i=.5)=>`<radialGradient id="${r}" cx="${e}" cy="${o}" r="${i}">${t.map(([s,l,n])=>`<stop offset="${s}" stop-color="${l}"${n===void 0?"":` stop-opacity="${n}"`}/>`).join("")}</radialGradient>`,h=(...r)=>`<defs>${r.join("")}</defs>`,H=r=>(Math.round(r*10)/10).toString(),m=(r,t,e,o,i=5,s=-Math.PI/2)=>{let l=[];for(let n=0;n<i*2;n++){let a=n%2===0?e:o,$=s+n*Math.PI/i;l.push(`${H(r+Math.cos($)*a)},${H(t+Math.sin($)*a)}`);}return l.join(" ")},j=(r,t,e,o,i=-Math.PI/2)=>{let s=[];for(let l=0;l<o;l++){let n=i+l*2*Math.PI/o;s.push(`${H(r+Math.cos(n)*e)},${H(t+Math.sin(n)*e)}`);}return s.join(" ")},W=(r,t,e,o,i)=>{let s=[],l=o*4;for(let n=0;n<l;n++){let a=n/l*Math.PI*2,$=n%4<2?e:e-i;s.push(`${H(r+Math.cos(a)*$)},${H(t+Math.sin(a)*$)}`);}return `M${s.join("L")}Z`};function D(r){let t=r>>>0||1;return ()=>(t=t*1664525+1013904223>>>0,t/4294967296)}var ut=r=>r==="cozy"?"#5b3b33":r==="sci-fi"?"#05070f":r==="post-apocalypse"?"#1a120c":"#1c1622",f=H;var A=(r,t,e,o,i=.28)=>`<ellipse cx="${r}" cy="${t}" rx="${e}" ry="${o}" fill="#000" opacity="${i}"/>`,z=(r,t=4,e=.55)=>`<path d="${r}" fill="none" stroke="#fff" stroke-width="${t}" stroke-linecap="round" opacity="${e}"/>`,Wt={w:64,h:64,main:"coin",draw({main:r,ink:t,style:e}){let o=c(r,.25),i;return e==="sci-fi"?i=`<polygon points="${j(32,31,11,6)}" fill="none" stroke="${c(r,.45)}" stroke-width="3.5"/><circle cx="32" cy="31" r="3.5" fill="${c(r,.45)}"/>`:e==="cozy"?i=`<path d="M32 41 C22 34 19 29 22 25 C25 21 30 22 32 26 C34 22 39 21 42 25 C45 29 42 34 32 41Z" fill="${c(r,.35)}"/>`:e==="post-apocalypse"?i=`<path d="${W(32,31,13,10,3)}" fill="${c(r,.4)}"/><circle cx="32" cy="31" r="5" fill="${r}"/>`:i=`<polygon points="${m(32,31,12,5.5)}" fill="${c(r,.35)}"/>`,h(p("g",[[0,d(r,.45)],[.55,r],[1,c(r,.2)]]))+`<circle cx="32" cy="35" r="26" fill="${c(r,.5)}" stroke="${t}" stroke-width="3"/><circle cx="32" cy="31" r="26" fill="url(#g)" stroke="${t}" stroke-width="3"/><circle cx="32" cy="31" r="19" fill="none" stroke="${o}" stroke-width="2.5"/>`+i+z("M15 24 A19 19 0 0 1 28 12")}},Gt={w:64,h:64,main:"accent",draw({main:r,ink:t}){return A(32,59,14,3.5)+`<polygon points="32,4 52,22 44,57 20,57 12,22" fill="${r}" stroke="${t}" stroke-width="3" stroke-linejoin="round"/><polygon points="32,4 12,22 26,24" fill="${d(r,.5)}"/><polygon points="32,4 26,24 38,24" fill="${d(r,.3)}"/><polygon points="32,4 38,24 52,22" fill="${c(r,.1)}"/><polygon points="12,22 26,24 20,57" fill="${d(r,.15)}"/><polygon points="52,22 38,24 44,57" fill="${c(r,.3)}"/><polygon points="26,24 38,24 44,57 20,57" fill="${r}"/>`+z("M22 18 L28 10",3,.8)}},Vt={w:64,h:64,main:"danger",draw({main:r,ink:t}){return h(p("g",[[0,d(r,.3)],[1,c(r,.25)]]))+`<path d="M32 56 C12 42 5 32 8 21 C11 10 25 8 32 19 C39 8 53 10 56 21 C59 32 52 42 32 56Z" fill="url(#g)" stroke="${t}" stroke-width="3.5" stroke-linejoin="round"/>`+z("M16 22 C17 16 22 14 26 17",4,.7)}},Ut={w:100,h:100,draw({style:r,ink:t,c:e}){if(r==="sci-fi"){let i=e("primary");return h(p("m",[[0,"#5d6f96"],[1,"#2a3452"]]),u("o",[[0,d(i,.6)],[.5,i,.9],[1,i,0]]))+A(50,95,40,5)+`<rect x="12" y="18" width="76" height="74" rx="10" fill="url(#m)" stroke="${t}" stroke-width="4"/><rect x="20" y="26" width="60" height="10" rx="3" fill="#1a2238"/><rect x="22" y="28" width="56" height="6" rx="2" fill="${i}" opacity="0.85"/><circle cx="50" cy="62" r="20" fill="url(#o)"/><circle cx="50" cy="62" r="11" fill="${d(i,.3)}" stroke="${t}" stroke-width="3"/><circle cx="22" cy="84" r="3" fill="#9fb2d8"/><circle cx="78" cy="84" r="3" fill="#9fb2d8"/>`}if(r==="cozy"){let i="#f2c862";return h(p("h",[[0,d(i,.25)],[1,c(i,.2)]]))+A(50,94,42,5)+`<rect x="8" y="26" width="84" height="66" rx="22" fill="url(#h)" stroke="${t}" stroke-width="4"/>`+[36,50,64,78].map(s=>`<path d="M18 ${s} Q50 ${s-5} 82 ${s}" stroke="${c(i,.25)}" stroke-width="2.5" fill="none"/>`).join("")+`<rect x="30" y="24" width="7" height="70" fill="#c0563d" stroke="${t}" stroke-width="2"/><rect x="63" y="24" width="7" height="70" fill="#c0563d" stroke="${t}" stroke-width="2"/>`+z("M20 38 Q30 32 44 33",4,.5)}if(r==="post-apocalypse"){let i="#9a4a26";return h(p("r",[[0,"#6a2e18"],[.35,d(i,.15)],[.7,i],[1,"#4a2010"]],true))+A(50,95,34,5)+`<rect x="18" y="10" width="64" height="84" rx="8" fill="url(#r)" stroke="${t}" stroke-width="4"/><rect x="16" y="28" width="68" height="6" fill="#5a2814" stroke="${t}" stroke-width="2"/><rect x="16" y="68" width="68" height="6" fill="#5a2814" stroke="${t}" stroke-width="2"/><polygon points="50,40 62,60 38,60" fill="#e8c23a" stroke="${t}" stroke-width="2.5" stroke-linejoin="round"/><rect x="48.5" y="45" width="3" height="8" fill="${t}"/><circle cx="50" cy="56.5" r="1.8" fill="${t}"/><path d="M24 82 q6 -6 10 2 q4 6 9 0" stroke="#3a1608" stroke-width="3" fill="none" opacity="0.6"/>`}if(r==="fantasy"){let i="#9a6234";return h(p("w",[[0,"#5a3418"],[.3,d(i,.15)],[.7,i],[1,"#4a2a12"]],true))+A(50,95,36,5)+`<path d="M24 10 Q14 52 24 94 L76 94 Q86 52 76 10Z" fill="url(#w)" stroke="${t}" stroke-width="4" stroke-linejoin="round"/>`+[38,50,62].map(s=>`<path d="M${s} 12 Q${s+(s-50)*.25} 52 ${s} 92" stroke="${c(i,.35)}" stroke-width="2" fill="none"/>`).join("")+[24,76].map(s=>`<path d="M19 ${s} Q50 ${s+4} 81 ${s}" stroke="#4d525c" stroke-width="7" fill="none"/><path d="M19 ${s-2} Q50 ${s+2} 81 ${s-2}" stroke="#8d939e" stroke-width="2" fill="none"/>`).join("")+z("M28 30 Q26 50 28 66",4,.35)}let o="#b07a44";return A(50,95,42,5)+`<rect x="10" y="14" width="80" height="80" rx="6" fill="${o}" stroke="${t}" stroke-width="4"/><rect x="18" y="22" width="64" height="64" fill="${c(o,.12)}" stroke="${c(o,.4)}" stroke-width="3"/><path d="M20 24 L80 84 M80 24 L20 84" stroke="${d(o,.15)}" stroke-width="9"/><path d="M20 24 L80 84 M80 24 L20 84" stroke="${c(o,.4)}" stroke-width="2" fill="none" opacity="0.5"/>`+[18,82].flatMap(i=>[22,86].map(s=>`<circle cx="${i}" cy="${s}" r="3" fill="#6b6f78"/>`)).join("")}},Xt={w:100,h:60,draw({style:r,ink:t,c:e}){let o=[18,50,82];if(r==="sci-fi"){let s=e("danger");return h(p("l",[[0,d(s,.6),.95],[1,s,.2]]))+o.map(l=>`<polygon points="${l-9},52 ${l},6 ${l+9},52" fill="url(#l)"/>`).join("")+o.map(l=>`<line x1="${l}" y1="10" x2="${l}" y2="50" stroke="#fff" stroke-width="2" opacity="0.8"/>`).join("")+`<rect x="2" y="48" width="96" height="11" rx="3" fill="#2a3452" stroke="${t}" stroke-width="3"/>`+o.map(l=>`<circle cx="${l}" cy="53" r="3" fill="${s}"/>`).join("")}if(r==="cozy")return `<path d="M6 58 C2 40 14 26 26 30 C30 14 48 10 54 24 C64 12 86 18 84 34 C98 36 100 52 94 58Z" fill="#6cbf5c" stroke="${t}" stroke-width="3.5" stroke-linejoin="round"/>`+[[18,36],[36,24],[56,22],[74,30],[88,44],[28,48],[62,44]].map(([l,n])=>`<polygon points="${l-3},${n+2} ${l},${n-7} ${l+3},${n+2}" fill="#fff4e6" stroke="${t}" stroke-width="1.5"/>`).join("")+'<circle cx="44" cy="40" r="4" fill="#ff8fab"/><circle cx="72" cy="46" r="3.5" fill="#ff8fab"/>';let i=r==="post-apocalypse"?"#8a6a52":"#b9c1cd";return h(p("s",[[0,d(i,.4)],[.5,i],[1,c(i,.45)]],true))+o.map(s=>`<polygon points="${s-14},50 ${s},4 ${s+14},50" fill="url(#s)" stroke="${t}" stroke-width="3" stroke-linejoin="round"/>`).join("")+(r==="post-apocalypse"?'<path d="M2 40 q8 -10 16 0 q8 10 16 0 q8 -10 16 0 q8 10 16 0 q8 -10 16 0 q8 10 16 0" stroke="#5a4a3a" stroke-width="3" fill="none"/>':"")+`<rect x="2" y="47" width="96" height="12" rx="3" fill="${r==="post-apocalypse"?"#4a3a2a":"#5a4636"}" stroke="${t}" stroke-width="3"/>`}},Yt={w:60,h:180,main:"accent",draw({style:r,ink:t,main:e,c:o}){if(r==="sci-fi"){let l=o("primary");return h(u("b",[[0,"#fff"],[.4,l],[1,l,0]]))+`<rect x="24" y="30" width="10" height="146" rx="3" fill="#4a5a80" stroke="${t}" stroke-width="3"/><circle cx="29" cy="24" r="22" fill="url(#b)"/><circle cx="29" cy="24" r="8" fill="#fff" stroke="${t}" stroke-width="2"/><rect x="34" y="50" width="24" height="34" rx="3" fill="${e}" opacity="0.75" stroke="${d(e,.5)}" stroke-width="2"/><rect x="14" y="166" width="30" height="12" rx="3" fill="#2a3452" stroke="${t}" stroke-width="3"/>`}let i=r==="post-apocalypse"?"#7a6a5a":r==="cozy"?"#e8d8c8":"#c8a060",s=r==="post-apocalypse"?`<path d="M30 22 L58 28 L52 40 L58 52 L40 50 L44 60 L30 58Z" fill="${e}" stroke="${t}" stroke-width="3" stroke-linejoin="round"/>`:r==="cozy"?`<path d="M30 22 Q46 16 58 26 Q50 40 58 54 Q44 46 30 56Z" fill="${e}" stroke="${t}" stroke-width="3" stroke-linejoin="round"/><path d="M44 44 C38 40 37 37 39 35 C41 33 43 34 44 36 C45 34 47 33 49 35 C51 37 50 40 44 44Z" fill="#fff"/>`:`<path d="M30 22 L58 22 L58 62 L44 54 L30 62Z" fill="${e}" stroke="${t}" stroke-width="3" stroke-linejoin="round"/><polygon points="${m(44,38,8,3.5)}" fill="${o("coin")}"/>`;return A(30,176,18,3.5)+`<rect x="25" y="14" width="8" height="162" rx="3" fill="${i}" stroke="${t}" stroke-width="3"/>`+s+`<circle cx="29" cy="12" r="7" fill="${o("coin")}" stroke="${t}" stroke-width="3"/>`}},xt={w:64,h:32,main:"primary",draw({style:r,main:t,c:e}){return r==="sci-fi"?h(p("t",[[0,t,0],[1,t,.9]],true))+`<rect x="2" y="11" width="44" height="10" rx="5" fill="url(#t)"/><rect x="22" y="9" width="40" height="14" rx="7" fill="${t}"/><rect x="28" y="13" width="30" height="6" rx="3" fill="#fff"/>`:r==="post-apocalypse"?h(p("t",[[0,e("coin"),0],[1,e("coin"),.8]],true))+'<rect x="0" y="13" width="44" height="6" rx="3" fill="url(#t)"/><path d="M40 10 L54 10 Q62 16 54 22 L40 22Z" fill="#c9a24a" stroke="#3a2a12" stroke-width="2"/>':r==="cozy"?h(p("t",[[0,t,0],[1,t,.7]],true))+`<rect x="0" y="12" width="40" height="8" rx="4" fill="url(#t)"/><polygon points="${m(46,16,14,6)}" fill="${e("coin")}" stroke="#5b3b33" stroke-width="2" stroke-linejoin="round"/>`:h(p("t",[[0,t,0],[1,t,.85]],true),u("o",[[0,"#fff"],[.45,d(t,.4)],[1,t,0]]))+'<path d="M2 16 Q20 8 40 10 L40 22 Q20 24 2 16Z" fill="url(#t)"/><circle cx="46" cy="16" r="15" fill="url(#o)"/><circle cx="46" cy="16" r="6" fill="#fff"/>'}},Jt=r=>({w:100,h:100,main:`piece${r}`,draw({main:t,ink:e}){let o=d(t,.55),i=d(t,.2),s=c(t,.32),l=h(p("g",[[0,d(t,.35)],[1,c(t,.25)]])),n=`stroke="${e}" stroke-width="4" stroke-linejoin="round"`,a;switch(r){case 1:a=`<circle cx="50" cy="52" r="40" fill="url(#g)" ${n}/><polygon points="${j(50,52,22,8,-Math.PI/8)}" fill="${i}"/><polygon points="${j(50,52,22,8,-Math.PI/8).split(" ").slice(5,8).join(" ")} 50,52" fill="${o}"/><polygon points="${j(50,52,22,8,-Math.PI/8).split(" ").slice(1,4).join(" ")} 50,52" fill="${s}"/>`;break;case 2:a=`<path d="M50 8 C66 30 84 46 84 64 C84 82 68 92 50 92 C32 92 16 82 16 64 C16 46 34 30 50 8Z" fill="url(#g)" ${n}/><path d="M50 24 C60 40 70 50 70 64 C70 76 60 82 50 82Z" fill="${s}" opacity="0.6"/><path d="M50 24 C40 40 30 50 30 64 C30 76 40 82 50 82Z" fill="${i}" opacity="0.7"/>`;break;case 3:a=`<polygon points="28,10 72,10 90,28 90,72 72,90 28,90 10,72 10,28" fill="url(#g)" ${n}/><polygon points="32,24 68,24 76,32 76,68 68,76 32,76 24,68 24,32" fill="${i}"/><polygon points="28,10 72,10 68,24 32,24" fill="${o}"/><polygon points="90,28 90,72 76,68 76,32" fill="${s}"/><polygon points="36,34 64,34 64,66 36,66" fill="${t}"/>`;break;case 4:a=`<polygon points="${m(50,54,44,20)}" fill="url(#g)" ${n}/><polygon points="${m(50,54,22,10)}" fill="${i}"/><polygon points="50,10 50,54 30,44" fill="${o}" opacity="0.7"/>`;break;case 5:a=`<polygon points="50,6 90,50 50,94 10,50" fill="url(#g)" ${n}/><polygon points="50,6 10,50 50,50" fill="${o}"/><polygon points="50,6 90,50 50,50" fill="${i}"/><polygon points="10,50 50,94 50,50" fill="${t}"/><polygon points="90,50 50,94 50,50" fill="${s}"/><polygon points="50,30 64,50 50,70 36,50" fill="${d(t,.35)}"/>`;break;default:a=`<polygon points="${j(50,50,42,6)}" fill="url(#g)" ${n}/><polygon points="${j(50,50,24,6)}" fill="${i}"/><polygon points="${j(50,50,42,6).split(" ").slice(4,6).join(" ")} ${j(50,50,42,6).split(" ")[0]} 50,50" fill="${o}" opacity="0.6"/><polygon points="${j(50,50,42,6).split(" ").slice(1,4).join(" ")} 50,50" fill="${s}" opacity="0.55"/>`;}return l+A(50,94,30,4,.22)+a+z("M28 30 Q32 22 40 20",5,.75)}}),K=r=>`<path d="M24 86 Q50 72 76 86 Q76 94 50 94 Q24 94 24 86Z" fill="#7a5032" stroke="${r}" stroke-width="3"/>`,F=(r,t,e,o,i,s)=>`<path transform="translate(${r} ${t}) rotate(${e}) scale(${o})" d="M0 0 C6 -10 18 -10 22 0 C18 8 6 8 0 0Z" fill="${i}" stroke="${s}" stroke-width="${f(2.4/o)}"/>`,G=(r,t,e,o,i)=>`<circle cx="${r-e*.55}" cy="${t+e*.2}" r="${e*.7}" fill="${c(o,.1)}" stroke="${i}" stroke-width="3"/><circle cx="${r+e*.55}" cy="${t+e*.2}" r="${e*.7}" fill="${c(o,.1)}" stroke="${i}" stroke-width="3"/><circle cx="${r}" cy="${t-e*.15}" r="${e*.85}" fill="${o}" stroke="${i}" stroke-width="3"/><circle cx="${r-e*.3}" cy="${t-e*.4}" r="${e*.3}" fill="${d(o,.3)}"/>`,at=(r,t=50)=>`<path d="M45 92 L47 ${t} L53 ${t} L55 92Z" fill="#8a5a32" stroke="${r}" stroke-width="3" stroke-linejoin="round"/>`;function Kt(r,t){let{ink:e}=t,o=t.style==="cozy"?"#7fd36e":"#58b04a",i=t.c("primary");switch(r){case 1:return A(50,84,18,4)+`<ellipse cx="50" cy="64" rx="15" ry="20" fill="#b07a44" stroke="${e}" stroke-width="3.5"/>`+z("M44 54 Q46 48 50 47",3.5,.6);case 2:return K(e)+`<path d="M50 84 Q48 66 50 56" stroke="${c(o,.2)}" stroke-width="5" fill="none" stroke-linecap="round"/>`+F(50,60,-150,1,o,e)+F(50,60,-30,1,o,e);case 3:return K(e)+`<path d="M50 84 Q47 60 50 38" stroke="${c(o,.2)}" stroke-width="5" fill="none" stroke-linecap="round"/>`+F(50,66,-160,1.1,o,e)+F(50,62,-20,1.1,o,e)+F(50,44,-130,.9,d(o,.15),e)+F(50,42,-50,.9,d(o,.15),e);case 4:return K(e)+G(50,62,26,o,e);case 5:return K(e)+G(50,62,28,o,e)+[[34,56],[56,44],[66,64],[46,70]].map(([s,l])=>`<polygon points="${m(s,l,7,3.5,5)}" fill="${i}" stroke="${e}" stroke-width="1.5"/><circle cx="${s}" cy="${l}" r="2" fill="#fff6c0"/>`).join("");case 6:return A(50,93,26,4)+at(e,52)+G(50,40,32,o,e);case 7:return A(50,93,28,4)+at(e,54)+G(50,40,34,c(o,.05),e)+[[34,36],[58,26],[66,46],[44,52],[52,38]].map(([s,l])=>`<circle cx="${s}" cy="${l}" r="5.5" fill="${t.c("danger")}" stroke="${e}" stroke-width="2"/><circle cx="${s-1.5}" cy="${l-1.5}" r="1.6" fill="#fff" opacity="0.8"/>`).join("");default:{let s=t.c("coin");return A(50,93,30,4)+at(e,54)+G(50,38,36,s,e)+[[22,18],[80,22],[74,64],[24,60],[50,6]].map(([l,n])=>`<polygon points="${m(l,n,6,2,4)}" fill="#fff"/>`).join("")}}}function tr(r,t){let{ink:e}=t,o=t.style==="post-apocalypse"?"#9a8a72":"#a9b8d6",i=t.style==="post-apocalypse"?t.c("coin"):t.c("primary"),s=h(p("m",[[0,d(o,.35)],[1,c(o,.35)]]));switch(r){case 1:return s+A(50,88,16,4)+`<rect x="44" y="34" width="12" height="50" rx="2" fill="url(#m)" stroke="${e}" stroke-width="3"/>`+[44,54,64,74].map(l=>`<line x1="44" y1="${l}" x2="56" y2="${l-4}" stroke="${c(o,.45)}" stroke-width="2"/>`).join("")+`<rect x="32" y="22" width="36" height="14" rx="5" fill="url(#m)" stroke="${e}" stroke-width="3"/><line x1="42" y1="29" x2="58" y2="29" stroke="${e}" stroke-width="3"/>`;case 2:return s+A(50,86,26,4)+`<polygon points="${j(50,54,30,6)}" fill="url(#m)" stroke="${e}" stroke-width="3.5"/><circle cx="50" cy="54" r="12" fill="${c(o,.5)}" stroke="${e}" stroke-width="3"/>`+z("M30 42 L42 34",3.5,.6);case 3:return s+A(50,90,30,4)+`<path d="${W(50,52,36,10,8)}" fill="url(#m)" stroke="${e}" stroke-width="3"/><circle cx="50" cy="52" r="12" fill="${c(o,.5)}" stroke="${e}" stroke-width="3"/>`;case 4:return s+A(50,90,34,4)+`<path d="${W(36,60,26,9,6)}" fill="url(#m)" stroke="${e}" stroke-width="3"/><path d="${W(66,38,22,8,6)}" fill="${d(o,.1)}" stroke="${e}" stroke-width="3"/><circle cx="36" cy="60" r="8" fill="${i}" stroke="${e}" stroke-width="2.5"/><circle cx="66" cy="38" r="7" fill="${c(o,.5)}" stroke="${e}" stroke-width="2.5"/>`;case 5:return s+A(50,90,34,4)+[26,38,50,62,74].map(l=>`<rect x="${l-2}" y="12" width="4" height="12" fill="#c9a24a"/><rect x="${l-2}" y="76" width="4" height="12" fill="#c9a24a"/>`).join("")+`<rect x="18" y="22" width="64" height="56" rx="6" fill="#2a3040" stroke="${e}" stroke-width="3.5"/><rect x="32" y="36" width="36" height="28" rx="3" fill="${i}" opacity="0.85"/><path d="M36 50 H46 V42 H54 V58 H64" stroke="#fff" stroke-width="2.5" fill="none"/>`;case 6:return s+A(50,92,22,4)+`<rect x="28" y="20" width="44" height="70" rx="8" fill="url(#m)" stroke="${e}" stroke-width="3.5"/><rect x="40" y="10" width="20" height="12" rx="3" fill="${c(o,.3)}" stroke="${e}" stroke-width="3"/><rect x="34" y="30" width="32" height="52" rx="4" fill="#1d2230"/>`+[0,1,2].map(l=>`<rect x="38" y="${66-l*15}" width="24" height="11" rx="2" fill="${i}" opacity="${.95-l*.25}"/>`).join("");case 7:return s+A(50,94,32,4)+`<line x1="50" y1="6" x2="50" y2="20" stroke="${e}" stroke-width="3"/><circle cx="50" cy="6" r="5" fill="${t.c("danger")}" stroke="${e}" stroke-width="2"/><rect x="16" y="20" width="68" height="60" rx="16" fill="url(#m)" stroke="${e}" stroke-width="3.5"/><rect x="26" y="34" width="48" height="24" rx="10" fill="#1d2230"/><circle cx="40" cy="46" r="7" fill="${i}"/><circle cx="60" cy="46" r="7" fill="${i}"/><rect x="38" y="64" width="24" height="6" rx="3" fill="${c(o,.5)}"/><rect x="6" y="38" width="10" height="22" rx="4" fill="${c(o,.2)}" stroke="${e}" stroke-width="3"/><rect x="84" y="38" width="10" height="22" rx="4" fill="${c(o,.2)}" stroke="${e}" stroke-width="3"/>`;default:return s+h(u("f",[[0,"#fff"],[.4,t.c("coin")],[1,t.c("danger"),0]]))+`<ellipse cx="50" cy="88" rx="16" ry="12" fill="url(#f)"/><path d="M50 4 C66 18 70 40 66 70 L34 70 C30 40 34 18 50 4Z" fill="url(#m)" stroke="${e}" stroke-width="3.5"/><circle cx="50" cy="34" r="9" fill="${i}" stroke="${e}" stroke-width="3"/><path d="M34 54 L20 76 L34 72Z M66 54 L80 76 L66 72Z" fill="${t.c("danger")}" stroke="${e}" stroke-width="3" stroke-linejoin="round"/>`}}var rr=r=>({w:100,h:100,draw(t){return t.style==="sci-fi"||t.style==="post-apocalypse"?tr(r,t):Kt(r,t)}}),er={w:100,h:100,main:"accent",draw({style:r,ink:t,c:e}){let o=r==="sci-fi"?"#4a5a80":r==="post-apocalypse"?"#5e6a3a":r==="cozy"?"#e09a5a":"#9a5a2c",i=r==="sci-fi"?e("primary"):r==="post-apocalypse"?"#8a8a7a":e("coin");return h(p("b",[[0,d(o,.2)],[1,c(o,.3)]]),p("l",[[0,d(o,.35)],[1,o]]))+A(50,92,40,5)+`<rect x="10" y="44" width="80" height="46" rx="6" fill="url(#b)" stroke="${t}" stroke-width="4"/><path d="M10 46 L10 34 Q50 4 90 34 L90 46Z" fill="url(#l)" stroke="${t}" stroke-width="4" stroke-linejoin="round"/><rect x="10" y="42" width="80" height="8" fill="${i}" stroke="${t}" stroke-width="3"/><rect x="20" y="18" width="8" height="72" fill="${i}" opacity="0.9"/><rect x="72" y="18" width="8" height="72" fill="${i}" opacity="0.9"/><rect x="40" y="44" width="20" height="22" rx="4" fill="${i}" stroke="${t}" stroke-width="3"/><circle cx="50" cy="54" r="3.5" fill="${t}"/>`+z("M18 32 Q34 18 48 16",4,.45)}},gt={coin:Wt,crystal:Gt,heart:Vt,obstacle:Ut,spike:Xt,flag:Yt,shot:xt,bolt:xt,chest:er,...Object.fromEntries([1,2,3,4,5,6].map(r=>[`gem${r}`,Jt(r)])),...Object.fromEntries([1,2,3,4,5,6,7,8].map(r=>[`item${r}`,rr(r)]))};var S=(r,t,e)=>f(Math.min(r,t)*e),or={w:0,h:0,exact:true,main:"panel",draw({w:r,h:t,main:e,ink:o}){let i=Math.max(2,Math.min(Math.min(r,t)*.035,7)),s=f(Math.min(Math.min(r,t)*.14,24)),l=J(e)>.6;return h(p("p",[[0,d(e,l?.3:.12)],[1,c(e,l?.06:.25)]]))+`<rect x="${f(i/2)}" y="${f(i*1.5)}" width="${f(r-i)}" height="${f(t-i*2)}" rx="${s}" fill="#000" opacity="0.25"/><rect x="${f(i/2)}" y="${f(i/2)}" width="${f(r-i)}" height="${f(t-i*2)}" rx="${s}" fill="url(#p)" stroke="${l?c(e,.3):o}" stroke-width="${f(i)}"/><rect x="${f(i*2)}" y="${f(i*2)}" width="${f(r-i*4)}" height="${f(Math.max(1,t*.12))}" rx="${S(r,t,.06)}" fill="#fff" opacity="0.1"/>`}},ir={w:0,h:0,exact:true,main:"panel",draw({w:r,h:t,main:e,ink:o,c:i}){let s=Math.max(3,r*.03),l=i("coin");return h(p("p",[[0,d(e,.18)],[1,c(e,.3)]]),p("g",[[0,d(l,.35)],[1,c(l,.25)]]))+`<rect x="${f(s)}" y="${f(s*2)}" width="${f(r-s*2)}" height="${f(t-s*2.5)}" rx="${S(r,t,.1)}" fill="#000" opacity="0.35"/><rect x="${f(s)}" y="${f(s)}" width="${f(r-s*2)}" height="${f(t-s*2.5)}" rx="${S(r,t,.1)}" fill="url(#g)" stroke="${o}" stroke-width="${f(s*.8)}"/><rect x="${f(s*2.4)}" y="${f(s*2.4)}" width="${f(r-s*4.8)}" height="${f(t-s*5.3)}" rx="${S(r,t,.07)}" fill="url(#p)"/><circle cx="${f(r/2)}" cy="${f(t*.3)}" r="${f(r*.2)}" fill="${l}" opacity="0.18"/>`}},sr={w:0,h:0,exact:true,main:"accent",draw({w:r,h:t,main:e,ink:o}){let i=Math.max(2,Math.min(r,t)*.06),s=t*.12;return h(p("b",[[0,d(e,.3)],[1,c(e,.1)]]))+`<rect x="${f(i/2)}" y="${f(s)}" width="${f(r-i)}" height="${f(t-s-i/2)}" rx="${S(r,t,.3)}" fill="${c(e,.45)}" stroke="${o}" stroke-width="${f(i)}"/><rect x="${f(i/2)}" y="${f(i/2)}" width="${f(r-i)}" height="${f(t-s-i/2)}" rx="${S(r,t,.3)}" fill="url(#b)" stroke="${o}" stroke-width="${f(i)}"/><rect x="${f(r*.12)}" y="${f(t*.12)}" width="${f(r*.76)}" height="${f(t*.16)}" rx="${f(t*.08)}" fill="#fff" opacity="0.35"/>`}},lr={w:0,h:0,exact:true,main:"ground",draw({w:r,h:t,main:e}){let o=J(e)>.55;return h(p("c",[[0,c(e,o?.12:.3)],[1,d(e,o?.1:.06)]]))+`<rect x="1.5" y="1.5" width="${f(r-3)}" height="${f(t-3)}" rx="${S(r,t,.16)}" fill="url(#c)"/><rect x="1.5" y="1.5" width="${f(r-3)}" height="${f(t-3)}" rx="${S(r,t,.16)}" fill="none" stroke="#000" stroke-opacity="0.18" stroke-width="2"/>`}},nr={w:0,h:0,exact:true,main:"panel",draw({w:r,h:t,main:e,ink:o}){let i=t*.16,s=Math.max(2,Math.min(r,t)*.05),n=J(e)>.6?d(e,.4):d(e,.85);return `<path d="M${f(s)} ${f(s)} H${f(r-s)} V${f(t-i-s)} H${f(r*.58)} L${f(r*.5)} ${f(t-s)} L${f(r*.42)} ${f(t-i-s)} H${f(s)}Z" fill="${n}" stroke="${o}" stroke-width="${f(s)}" stroke-linejoin="round"/>`}},cr={w:100,h:100,draw(){let r="#1c1622",t="#ffffff",e="#d9dde8";return `<ellipse cx="60" cy="96" rx="26" ry="4" fill="#000" opacity="0.18"/><path d="M30 52 L30 14 Q30 5 39 5 Q48 5 48 14 L48 44 Q50 38 57 38 Q64 38 65 45 Q67 40 73 40 Q80 41 80 49 Q82 45 86 46 Q92 48 91 56 L89 76 Q86 92 70 94 L48 94 Q36 93 31 82 L17 64 Q13 58 18 54 Q23 50 28 55 Z" fill="${t}" stroke="${r}" stroke-width="4" stroke-linejoin="round"/><path d="M48 44 L48 58 M65 45 L65 58 M80 49 L80 60" stroke="${r}" stroke-width="3" stroke-linecap="round"/><path d="M34 86 Q44 92 58 91" stroke="${e}" stroke-width="5" fill="none" stroke-linecap="round"/><path d="M35 14 Q36 9 40 9" stroke="${e}" stroke-width="3" fill="none" stroke-linecap="round"/>`}},ar={w:100,h:100,main:"accent",draw({main:r,ink:t}){return h(p("p",[[0,d(r,.35)],[1,c(r,.15)]]))+`<circle cx="50" cy="54" r="44" fill="${c(r,.45)}"/><circle cx="50" cy="50" r="44" fill="url(#p)" stroke="${t}" stroke-width="4"/><circle cx="50" cy="50" r="36" fill="none" stroke="#fff" stroke-opacity="0.35" stroke-width="3"/><path d="M41 30 L72 50 L41 70 Z" fill="#fff" stroke="${t}" stroke-width="3.5" stroke-linejoin="round"/><path d="M22 38 Q28 22 44 16" stroke="#fff" stroke-width="5" fill="none" stroke-linecap="round" opacity="0.55"/>`}},mt={panel:or,card:ir,button:sr,cell:lr,ticket:nr,hand:cr,play:ar};var E=(r,t=4,e=.55)=>`<path d="${r}" fill="none" stroke="#fff" stroke-width="${t}" stroke-linecap="round" opacity="${e}"/>`,_=(r,t)=>({w:64,h:64,main:r,draw:({main:e,ink:o})=>t(e,o)}),fr=_("primary",(r,t)=>h(p("b",[[0,d(r,.55)],[1,c(r,.15)]]))+`<path d="M32 4 C50 10 58 28 52 46 C48 34 40 26 30 24 C28 16 29 9 32 4Z" fill="url(#b)" stroke="${t}" stroke-width="3" stroke-linejoin="round"/><path d="M32 60 C14 54 6 36 12 18 C16 30 24 38 34 40 C36 48 35 55 32 60Z" fill="url(#b)" stroke="${t}" stroke-width="3" stroke-linejoin="round"/><circle cx="32" cy="32" r="8" fill="${c(r,.35)}" stroke="${t}" stroke-width="3"/><circle cx="32" cy="32" r="3" fill="${d(r,.6)}"/>`+E("M36 9 C44 13 49 20 51 28",3,.7)),dr=_("secondary",(r,t)=>h(u("a",[[0,d(r,.7),.95],[.55,r,.55],[1,r,0]]))+`<circle cx="32" cy="32" r="29" fill="url(#a)"/><circle cx="32" cy="32" r="20" fill="none" stroke="${d(r,.4)}" stroke-width="3" stroke-dasharray="7 5"/><circle cx="32" cy="32" r="10" fill="${d(r,.5)}" stroke="${t}" stroke-width="2.5"/>`),hr={w:100,h:100,main:"secondary",draw:({main:r})=>h(u("a",[[0,r,.05],[.7,r,.18],[.94,d(r,.3),.5],[1,d(r,.4),0]]))+`<circle cx="50" cy="50" r="50" fill="url(#a)"/><circle cx="50" cy="50" r="46" fill="none" stroke="${d(r,.5)}" stroke-width="1.5" stroke-dasharray="6 6" opacity="0.7"/>`},$r=_("accent",(r,t)=>h(p("g",[[0,d(r,.4)],[1,c(r,.25)]]))+`<path d="M8 14 C22 10 34 18 38 30 C46 32 54 42 56 54 C48 50 40 46 32 44 C28 32 20 24 8 14Z" fill="url(#g)" stroke="${t}" stroke-width="3.5" stroke-linejoin="round"/><path d="M14 16 C24 16 31 22 34 32" fill="none" stroke="${c(r,.35)}" stroke-width="2.5"/>`+E("M14 15 C22 14 28 18 31 24",3,.7)),pr=_("primary",(r,t)=>h(p("l",[[0,d(r,.7)],[1,r]]))+`<polygon points="36,3 12,36 28,36 22,61 52,24 35,24 44,3" fill="url(#l)" stroke="${t}" stroke-width="3.5" stroke-linejoin="round"/>`+E("M33 9 L20 30",3,.75)),kr={w:100,h:20,main:"primary",draw:({main:r})=>`<polyline points="0,10 14,4 26,15 40,5 54,14 66,4 80,15 92,6 100,10" fill="none" stroke="${d(r,.4)}" stroke-width="7" stroke-linejoin="round" opacity="0.55"/><polyline points="0,10 14,4 26,15 40,5 54,14 66,4 80,15 92,6 100,10" fill="none" stroke="#fff" stroke-width="2.5" stroke-linejoin="round"/>`},yr=_("piece6",(r,t)=>h(p("d",[[0,d(r,.45)],[1,c(r,.2)]]))+`<rect x="4" y="18" width="20" height="5" rx="2.5" fill="${c(r,.4)}" stroke="${t}" stroke-width="2"/><rect x="40" y="18" width="20" height="5" rx="2.5" fill="${c(r,.4)}" stroke="${t}" stroke-width="2"/><path d="M14 23 L22 32 M50 23 L42 32" stroke="${t}" stroke-width="3"/><ellipse cx="32" cy="38" rx="17" ry="13" fill="url(#d)" stroke="${t}" stroke-width="3"/><circle cx="32" cy="38" r="6" fill="#16223a" stroke="${t}" stroke-width="2"/><circle cx="33.5" cy="36.5" r="2" fill="#7fe7ff"/>`+E("M21 32 C24 28 28 27 31 27",3,.6)),wr=_("danger",(r,t)=>h(p("f",[[0,d(r,.35)],[1,c(r,.2)]]))+`<path d="M14 26 C14 18 20 14 26 15 L46 15 C52 15 54 20 54 25 L54 40 C54 50 46 58 36 58 L28 58 C20 58 14 52 14 44Z" fill="url(#f)" stroke="${t}" stroke-width="3.5" stroke-linejoin="round"/>`+[24,34,44].map(e=>`<path d="M${e} 16 L${e} 30" stroke="${c(r,.4)}" stroke-width="2.5"/>`).join("")+`<path d="M14 34 C22 30 30 32 32 38" fill="none" stroke="${t}" stroke-width="3"/>`+E("M20 20 C22 18 26 18 30 18",3,.6)),ur=_("primary",(r,t)=>`<rect x="12" y="5" width="40" height="7" rx="3" fill="${c(r,.3)}" stroke="${t}" stroke-width="3"/><rect x="12" y="52" width="40" height="7" rx="3" fill="${c(r,.3)}" stroke="${t}" stroke-width="3"/><path d="M17 12 C17 26 30 28 30 32 C30 36 17 38 17 52 L47 52 C47 38 34 36 34 32 C34 28 47 26 47 12Z" fill="${d(r,.75)}" stroke="${t}" stroke-width="3" stroke-linejoin="round"/><path d="M22 49 C24 42 30 40 32 40 C34 40 40 42 42 49Z" fill="${r}"/><path d="M24 16 L40 16 C38 22 34 24 32 26 C30 24 26 22 24 16Z" fill="${r}"/>`),xr=_("accent",(r,t)=>h(p("b",[[0,d(r,.35)],[1,c(r,.25)]]))+`<path d="M18 6 L38 6 L38 34 L54 40 C58 42 58 50 54 52 L14 52 C12 52 11 50 12 48 L18 34Z" fill="url(#b)" stroke="${t}" stroke-width="3.5" stroke-linejoin="round"/><rect x="12" y="52" width="46" height="6" rx="3" fill="${c(r,.45)}" stroke="${t}" stroke-width="3"/><path d="M6 22 L14 22 M3 30 L13 30 M7 38 L13 38" stroke="${d(r,.5)}" stroke-width="3" stroke-linecap="round"/>`+E("M23 11 L23 30",3,.6)),gr=_("muted",(r,t)=>h(p("s",[[0,d(r,.45)],[1,c(r,.3)]]))+`<path d="M32 4 L54 12 C54 34 46 50 32 60 C18 50 10 34 10 12Z" fill="url(#s)" stroke="${t}" stroke-width="3.5" stroke-linejoin="round"/><path d="M32 12 L46 17 C46 32 41 43 32 51Z" fill="${d(r,.25)}" opacity="0.6"/>`+E("M17 16 C17 26 19 34 23 40",3,.55)),mr=_("danger",(r,t)=>`<path d="M10 8 L24 8 L24 34 C24 40 28 44 32 44 C36 44 40 40 40 34 L40 8 L54 8 L54 34 C54 48 44 58 32 58 C20 58 10 48 10 34Z" fill="${r}" stroke="${t}" stroke-width="3.5" stroke-linejoin="round"/><rect x="10" y="8" width="14" height="10" fill="#e8edf5" stroke="${t}" stroke-width="3"/><rect x="40" y="8" width="14" height="10" fill="#e8edf5" stroke="${t}" stroke-width="3"/>`+E("M15 26 C15 38 20 46 26 50",3,.55)),Lr=_("accent",(r,t)=>[[32,18],[46,32],[32,46],[18,32]].map(([e,o])=>`<circle cx="${e}" cy="${o}" r="12" fill="${r}" stroke="${t}" stroke-width="3"/>`).join("")+`<circle cx="32" cy="32" r="7" fill="${d(r,.3)}"/><path d="M36 40 C40 50 44 56 50 60" fill="none" stroke="${t}" stroke-width="3.5" stroke-linecap="round"/>`+E("M26 12 C28 9 32 8 35 9",3,.6)),br=_("accent",(r,t)=>h(p("p",[[0,d(r,.4)],[1,c(r,.2)]]))+`<rect x="25" y="4" width="14" height="8" rx="2" fill="#b07a44" stroke="${t}" stroke-width="3"/><path d="M26 12 L38 12 L38 22 C48 26 54 34 54 42 C54 52 44 60 32 60 C20 60 10 52 10 42 C10 34 16 26 26 22Z" fill="#e8f2ff" stroke="${t}" stroke-width="3.5" stroke-linejoin="round"/><path d="M13 40 C20 36 44 36 51 40 C51 50 43 57 32 57 C21 57 13 50 13 40Z" fill="url(#p)"/>`+E("M18 32 C20 28 24 26 27 25",3,.7)),Mr=_("muted",(r,t)=>h(u("b",[[0,"#6a7080"],[1,"#1c1f28"]],.35,.35,.7))+`<circle cx="30" cy="38" r="22" fill="url(#b)" stroke="${t}" stroke-width="3.5"/><rect x="34" y="12" width="12" height="10" rx="2" transform="rotate(35 40 17)" fill="#4a4f5c" stroke="${t}" stroke-width="3"/><path d="M44 12 C48 6 54 6 56 10" fill="none" stroke="#b07a44" stroke-width="3"/><polygon points="${m(57,9,7,3,6)}" fill="#ffd54f" stroke="${t}" stroke-width="1.5"/>`+E("M18 30 C20 25 24 22 28 21",4,.5)+`<circle cx="30" cy="38" r="22" fill="${r}" opacity="0.08"/>`),jr={w:40,h:40,main:"danger",draw:({main:r,ink:t})=>h(u("o",[[0,"#fff"],[.45,d(r,.3)],[1,r]]))+`<circle cx="20" cy="20" r="17" fill="${r}" opacity="0.35"/><circle cx="20" cy="20" r="11" fill="url(#o)" stroke="${t}" stroke-width="2.5"/>`},Ar=_("text",(r,t)=>`<path d="M32 6 C18 6 9 16 9 28 C9 36 13 41 18 44 L18 54 C18 57 20 58 22 58 L42 58 C44 58 46 57 46 54 L46 44 C51 41 55 36 55 28 C55 16 46 6 32 6Z" fill="${d(r,.1)}" stroke="${t}" stroke-width="3.5" stroke-linejoin="round"/><circle cx="22" cy="30" r="7" fill="${t}"/><circle cx="42" cy="30" r="7" fill="${t}"/><path d="M32 38 L28 45 L36 45Z" fill="${t}"/>`+[26,32,38].map(e=>`<path d="M${e} 50 L${e} 58" stroke="${t}" stroke-width="2.5"/>`).join("")),Cr={w:64,h:64,main:"coin",draw:({main:r,ink:t})=>`<polygon points="${m(32,32,29,17,10)}" fill="${d(r,.25)}" stroke="${t}" stroke-width="3" stroke-linejoin="round"/><polygon points="${j(32,32,12,6)}" fill="${r}"/>`},Lt={blade:fr,aura:dr,aura_field:hr,boomerang:$r,lightning:pr,zap:kr,drone:yr,fist:wr,hourglass:ur,boot:xr,shield:gr,magnet:mr,clover:Lr,potion:br,bomb:Mr,orb:jr,skull:Ar,burst:Cr};var ft=(r,t=4,e=.5)=>`<path d="${r}" fill="none" stroke="#fff" stroke-width="${t}" stroke-linecap="round" opacity="${e}"/>`,tt=(r,t)=>r==="sci-fi"?{body:"#4f5f86",trim:t("primary"),dark:"#232c47"}:r==="cozy"?{body:"#d9935a",trim:"#f6d38a",dark:"#7a4a2e"}:r==="post-apocalypse"?{body:"#8a6a52",trim:"#c9a14a",dark:"#3d2f24"}:{body:"#9a6b43",trim:t("accent"),dark:"#4a3322"},Qr={w:100,h:60,draw({style:r,ink:t,c:e}){let o=tt(r,e),i=e("danger");return h(p("b",[[0,d(o.trim,.4)],[1,c(o.trim,.15)]]))+`<ellipse cx="50" cy="57" rx="44" ry="3" fill="#000" opacity="0.25"/><rect x="10" y="14" width="9" height="44" rx="3" fill="${o.body}" stroke="${t}" stroke-width="3"/><rect x="81" y="14" width="9" height="44" rx="3" fill="${o.body}" stroke="${t}" stroke-width="3"/><rect x="4" y="10" width="92" height="17" rx="5" fill="url(#b)" stroke="${t}" stroke-width="3.5"/>`+[16,38,60,82].map(s=>`<path d="M${s} 11 L${s+10} 11 L${s+2} 26 L${s-8} 26Z" fill="${i}" opacity="0.9"/>`).join("")+`<rect x="4" y="10" width="92" height="17" rx="5" fill="none" stroke="${t}" stroke-width="3.5"/><rect x="14" y="32" width="72" height="8" rx="3" fill="${c(o.trim,.1)}" stroke="${t}" stroke-width="2.5"/>`+ft("M12 15 L88 15",2.5,.55)}},Zr={w:120,h:40,draw({style:r,ink:t,c:e}){let o=tt(r,e);return h(u("p",[[0,"#000000",1],[.7,"#0b0d14",.95],[1,c(o.dark,.2),.9]]))+`<path d="M8 20 C10 6 32 3 60 4 C90 3 112 7 112 20 C112 33 90 37 60 36 C30 37 8 34 8 20Z" fill="${o.dark}" stroke="${t}" stroke-width="3"/><path d="M16 21 C18 11 36 9 60 9 C86 9 104 12 104 21 C104 30 86 32 60 32 C34 32 16 30 16 21Z" fill="url(#p)"/><path d="M20 12 L28 16 L34 10 L44 15 L52 9 L62 14 L72 9 L82 14 L92 10 L100 15" fill="none" stroke="${d(o.dark,.25)}" stroke-width="2.5" stroke-linejoin="round"/>`}},_r={w:300,h:100,draw({style:r,ink:t,c:e}){let o=tt(r,e),i=e("secondary");return h(p("w",[[0,d(i,.35)],[1,c(i,.3)]]))+`<rect x="4" y="8" width="292" height="72" rx="10" fill="url(#w)" stroke="${t}" stroke-width="4"/><rect x="4" y="8" width="292" height="12" rx="6" fill="${d(i,.45)}" stroke="${t}" stroke-width="3"/>`+[30,100,170,240].map(s=>`<rect x="${s}" y="30" width="40" height="24" rx="4" fill="${d(o.trim,.55)}" stroke="${t}" stroke-width="3"/>`).join("")+`<rect x="4" y="64" width="292" height="10" fill="${c(i,.4)}"/>`+[40,90,210,260].map(s=>`<circle cx="${s}" cy="84" r="12" fill="${o.dark}" stroke="${t}" stroke-width="3.5"/><circle cx="${s}" cy="84" r="4" fill="${o.trim}"/>`).join("")+ft("M14 26 L120 26",3,.4)}},Rr={w:140,h:100,draw({style:r,ink:t,c:e}){let o=tt(r,e);return h(p("r",[[0,d(o.trim,.3)],[1,c(o.trim,.25)]]))+`<path d="M4 96 L136 8 L136 96Z" fill="${o.body}" stroke="${t}" stroke-width="4" stroke-linejoin="round"/><path d="M4 96 L136 8 L136 20 L22 96Z" fill="url(#r)" stroke="${t}" stroke-width="3" stroke-linejoin="round"/>`+[0,1,2].map(i=>{let s=60+i*22,l=70-i*15;return `<path d="M${s-8} ${l+6} L${s} ${l-4} L${s+8} ${l+6}" fill="none" stroke="#fff" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" opacity="0.8"/>`}).join("")}},Dr={w:100,h:100,draw({style:r,ink:t,c:e}){let o=r==="sci-fi"?"#7c86a8":r==="cozy"?"#b8a99a":"#8f8a82",i=r==="cozy"?"#7ccf6a":r==="sci-fi"?e("primary"):"#6b8f4a";return h(p("s",[[0,d(o,.35)],[1,c(o,.35)]]))+`<ellipse cx="50" cy="95" rx="42" ry="5" fill="#000" opacity="0.28"/><path d="M10 92 C4 70 14 44 30 32 C40 14 66 10 80 26 C96 40 98 70 90 92Z" fill="url(#s)" stroke="${t}" stroke-width="4" stroke-linejoin="round"/><path d="M34 50 L46 62 M62 40 L70 54 M28 74 L40 70" stroke="${c(o,.45)}" stroke-width="3" stroke-linecap="round"/><path d="M30 34 C40 26 52 24 62 28" fill="none" stroke="${i}" stroke-width="6" stroke-linecap="round" opacity="0.85"/>`+ft("M24 48 C28 38 36 32 44 30",4,.45)}},Tr={w:100,h:30,draw:()=>h(u("d",[[0,"#000000",.8],[.7,"#000000",.5],[1,"#000000",0]]))+'<ellipse cx="50" cy="15" rx="50" ry="15" fill="url(#d)"/>'},Er={w:60,h:300,draw({ink:r,c:t}){let e="#ffffff",o="#1b1d24",i=[];for(let s=0;s<14;s++)for(let l=0;l<2;l++)i.push(`<rect x="${16+l*14}" y="${18+s*18}" width="14" height="18" fill="${(s+l)%2===0?e:o}"/>`);return `<rect x="10" y="10" width="40" height="270" rx="4" fill="${o}" stroke="${r}" stroke-width="4"/>`+i.join("")+`<rect x="10" y="10" width="40" height="270" rx="4" fill="none" stroke="${r}" stroke-width="4"/><rect x="4" y="276" width="52" height="20" rx="5" fill="${t("accent")}" stroke="${r}" stroke-width="3.5"/><circle cx="30" cy="8" r="7" fill="${t("coin")}" stroke="${r}" stroke-width="3"/>`}},vr={w:64,h:64,main:"coin",draw:({main:r,ink:t})=>h(u("c",[[0,d(r,.5)],[.7,r],[1,c(r,.2)]]))+`<circle cx="24" cy="36" r="18" fill="url(#c)" stroke="${t}" stroke-width="3.5"/><circle cx="40" cy="26" r="18" fill="url(#c)" stroke="${t}" stroke-width="3.5"/><circle cx="40" cy="26" r="11" fill="none" stroke="${c(r,.25)}" stroke-width="2.5"/><rect x="30" y="40" width="30" height="20" rx="7" fill="${c(r,.55)}" stroke="${t}" stroke-width="3"/><path d="M36 45 L43 55 M43 45 L36 55" stroke="#fff" stroke-width="3.2" stroke-linecap="round"/><path d="M47 47 C48 43 55 43 55 47 C55 50 47 53 47 55 L55 55" fill="none" stroke="#fff" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>`},zr={w:64,h:64,main:"secondary",draw:({main:r,ink:t})=>h(p("g",[[0,d(r,.6)],[1,c(r,.15)]]))+`<path d="M32 40 C22 22 10 14 4 14 C6 26 10 40 20 48 C10 48 8 52 6 56 C18 58 28 54 32 48Z" fill="url(#g)" stroke="${t}" stroke-width="3" stroke-linejoin="round"/><path d="M32 40 C42 22 54 14 60 14 C58 26 54 40 44 48 C54 48 56 52 58 56 C46 58 36 54 32 48Z" fill="url(#g)" stroke="${t}" stroke-width="3" stroke-linejoin="round"/><path d="M12 22 C16 30 20 36 26 40 M52 22 C48 30 44 36 38 40" fill="none" stroke="${d(r,.7)}" stroke-width="2.5" stroke-linecap="round"/><circle cx="32" cy="44" r="5" fill="${d(r,.4)}" stroke="${t}" stroke-width="2.5"/>`},bt={hurdle:Qr,pit:Zr,wagon:_r,ramp:Rr,rock:Dr,shadow:Tr,finish:Er,coin2x:vr,wing:zr};var dt=(r,t=4,e=.55)=>`<path d="${r}" fill="none" stroke="#fff" stroke-width="${t}" stroke-linecap="round" opacity="${e}"/>`,Pr={w:100,h:100,main:"coin",draw:({main:r,ink:t})=>h(u("g",[[0,d(r,.6),.75],[.6,r,.25],[1,r,0]]),p("s",[[0,d(r,.55)],[1,c(r,.25)]]))+`<circle cx="50" cy="52" r="48" fill="url(#g)"/><polygon points="${m(50,54,40,18)}" fill="url(#s)" stroke="${t}" stroke-width="4.5" stroke-linejoin="round"/><polygon points="${m(50,54,22,10)}" fill="${d(r,.45)}" opacity="0.7"/>`+dt("M38 32 L46 22",4,.75)},Or={w:64,h:64,main:"coin",draw:({main:r,ink:t})=>h(p("k",[[0,d(r,.45)],[1,c(r,.25)]]))+`<circle cx="20" cy="22" r="14" fill="url(#k)" stroke="${t}" stroke-width="3.5"/><circle cx="20" cy="22" r="5.5" fill="${c(r,.5)}"/><path d="M29 31 L54 56 M44 46 L50 40 M50 52 L56 46" stroke="${t}" stroke-width="9" stroke-linecap="round"/><path d="M29 31 L54 56 M44 46 L50 40 M50 52 L56 46" stroke="url(#k)" stroke-width="4.5" stroke-linecap="round"/>`+dt("M12 18 C13 13 16 11 20 10",3,.7)},Ir={w:80,h:60,main:"accent",draw:({main:r,ink:t})=>h(p("p",[[0,d(r,.4)],[1,c(r,.2)]]))+`<rect x="14" y="50" width="52" height="8" rx="3" fill="#5a6070" stroke="${t}" stroke-width="3"/><path d="M24 50 L56 44 L24 38 L56 32 L24 26 L56 20" fill="none" stroke="${t}" stroke-width="7" stroke-linejoin="round"/><path d="M24 50 L56 44 L24 38 L56 32 L24 26 L56 20" fill="none" stroke="#c9d1dc" stroke-width="3.5" stroke-linejoin="round"/><rect x="6" y="6" width="68" height="14" rx="6" fill="url(#p)" stroke="${t}" stroke-width="3.5"/>`+dt("M14 10 L60 10",2.5,.6)},Mt={bigstar:Pr,key:Or,spring:Ir};var rt=(r,t=4,e=.5)=>`<path d="${r}" fill="none" stroke="#fff" stroke-width="${t}" stroke-linecap="round" opacity="${e}"/>`,P=r=>r==="sci-fi"?{stone:"#5d6f96",wood:"#2f3a5c",metal:"#8fa3c8"}:r==="cozy"?{stone:"#f1e2cf",wood:"#c98b5a",metal:"#9aa3b0"}:r==="post-apocalypse"?{stone:"#8a7a62",wood:"#5e4a36",metal:"#7d7466"}:{stone:"#aeb0b8",wood:"#8a5a34",metal:"#6a7080"},ht=r=>78-r*12,et='<ellipse cx="50" cy="123" rx="38" ry="7" fill="#000" opacity="0.28"/>';function jt(r,t,e,o,i){let s="";for(let l=e+10;l<116;l+=11){s+=`<line x1="${r+2}" y1="${l}" x2="${r+t-2}" y2="${l}" stroke="${c(o,.25)}" stroke-width="2"/>`;for(let n=1;n<3;n++){let a=r+t*n/3+((l-e)/11%2?6:0);s+=`<line x1="${a}" y1="${l}" x2="${a}" y2="${l+11}" stroke="${c(o,.25)}" stroke-width="2"/>`;}}return h(p("s",[[0,d(o,.25)],[1,c(o,.22)]],true))+`<rect x="${r}" y="${e}" width="${t}" height="${118-e}" fill="url(#s)" stroke="${i}" stroke-width="3.5"/>`+s+`<path d="M43 118 L43 105 A7 7 0 0 1 57 105 L57 118Z" fill="#3a2a1e" stroke="${i}" stroke-width="2.5"/>`}function Sr(r,t,e){let{style:o,ink:i,c:s}=r,l=P(o),n=ht(t)-(e?8:0),a=s(e==="sniper"?"danger":e==="ranger"?"coin":"accent"),$=jt(28,44,n+18,l.stone,i),y=`<rect x="20" y="${n+8}" width="60" height="12" rx="2" fill="${l.wood}" stroke="${i}" stroke-width="3"/>`+[26,38,50,62,74].map(L=>`<rect x="${L-2}" y="${n-6}" width="4" height="15" fill="${d(l.wood,.15)}" stroke="${i}" stroke-width="1.5"/>`).join("")+`<rect x="20" y="${n-8}" width="60" height="5" rx="2" fill="${d(l.wood,.2)}" stroke="${i}" stroke-width="2.5"/>`,w=t>=2?`<polygon points="14,${n-8} 50,${n-36} 86,${n-8}" fill="${a}" stroke="${i}" stroke-width="3.5" stroke-linejoin="round"/><polygon points="14,${n-8} 50,${n-36} 38,${n-8}" fill="${d(a,.25)}"/>`:"",x=t>=3?`<line x1="50" y1="${n-36}" x2="50" y2="${n-54}" stroke="${i}" stroke-width="3"/><path d="M50 ${n-54} L70 ${n-48} L50 ${n-42}Z" fill="${s("coin")}" stroke="${i}" stroke-width="2"/>`:"",k=(L,b,T=1)=>`<path d="M${L} ${b-12*T} Q${L+9*T} ${b} ${L} ${b+12*T}" fill="none" stroke="${l.wood}" stroke-width="${3.5*T}" stroke-linecap="round"/><line x1="${L}" y1="${b-12*T}" x2="${L}" y2="${b+12*T}" stroke="#eee" stroke-width="1.5"/>`,g=k(66,n-2);return e==="ranger"&&(g=k(30,n-2)+k(68,n-2)),e==="sniper"&&(g=`<rect x="44" y="${n-6}" width="44" height="6" rx="2" fill="${l.metal}" stroke="${i}" stroke-width="2.5"/><rect x="56" y="${n-13}" width="14" height="6" rx="2" fill="${c(l.metal,.3)}" stroke="${i}" stroke-width="2"/>`),et+$+y+g+w+x+rt(`M24 ${n+11} L44 ${n+11}`,2.5,.45)}function Hr(r,t,e){let{style:o,ink:i,c:s}=r,l=P(o),n=ht(t)+14-(e?6:0),a=h(p("b",[[0,d(l.stone,.3)],[1,c(l.stone,.25)]],true),p("m",[[0,d(l.metal,.35)],[1,c(l.metal,.35)]]))+`<path d="M20 118 L24 ${n} L76 ${n} L80 118Z" fill="url(#b)" stroke="${i}" stroke-width="3.5" stroke-linejoin="round"/>`+[0,1,2].map(b=>`<rect x="${22+b*20}" y="${n-9}" width="14" height="11" fill="${l.stone}" stroke="${i}" stroke-width="2.5"/>`).join("")+(t>=2?`<rect x="22" y="${n+14}" width="56" height="7" fill="${c(l.stone,.2)}" stroke="${i}" stroke-width="2"/>`:"")+(t>=3?`<rect x="22" y="${n+30}" width="56" height="7" fill="${s("coin")}" stroke="${i}" stroke-width="2"/>`:""),$=e==="bombard"?1.45:1+t*.08,y=34*$,w=13*$,x=`<g transform="rotate(-28 50 ${n-4})"><rect x="46" y="${n-4-w/2}" width="${y}" height="${w}" rx="${w/3}" fill="url(#m)" stroke="${i}" stroke-width="3"/><rect x="${46+y-7}" y="${n-4-w/2-2}" width="8" height="${w+4}" rx="2" fill="${c(l.metal,.3)}" stroke="${i}" stroke-width="2.5"/></g><circle cx="50" cy="${n-4}" r="${9*$}" fill="${c(l.metal,.2)}" stroke="${i}" stroke-width="3"/>`,k=44+y,g=e==="flamer"?`<g transform="rotate(-28 50 ${n-4})"><path d="M${k} ${n-16} C${k+14} ${n-22} ${k+30} ${n-10} ${k+22} ${n-4} C${k+30} ${n+2} ${k+14} ${n+14} ${k} ${n+8}Z" fill="#ff7a1a" stroke="${i}" stroke-width="2.5" stroke-linejoin="round"/><path d="M${k+2} ${n-9} C${k+12} ${n-12} ${k+18} ${n-6} ${k+13} ${n-3} C${k+18} ${n} ${k+10} ${n+6} ${k+2} ${n+2}Z" fill="#ffd34a"/></g>`:"",L=e==="bombard"?`<polygon points="${m(50,n+24,8,3.5)}" fill="${s("danger")}" stroke="${i}" stroke-width="2"/>`:"";return et+a+x+g+L+rt(`M28 ${n+4} L28 ${n+40}`,3,.4)}function Nr(r,t,e){let{style:o,ink:i,c:s}=r,l=P(o),n=64-t*6-(e?4:0),a=e==="storm"?s("coin"):e==="arcane"?d(s("secondary"),.2):s("secondary"),$=jt(32,36,n,l.stone,i)+`<rect x="44" y="${n+16}" width="12" height="16" rx="6" fill="${a}" stroke="${i}" stroke-width="2.5" opacity="0.9"/>`,y=n-28,w=`<polygon points="26,${n+2} 50,${y} 74,${n+2}" fill="${s("secondary")}" stroke="${i}" stroke-width="3.5" stroke-linejoin="round"/><polygon points="26,${n+2} 50,${y} 42,${n+2}" fill="${d(s("secondary"),.25)}"/>`,x=7+t*1.3+(e==="arcane"?3:0),k=Math.max(x+6+(e==="arcane"?8:0),y-x*.5),g=h(u("o",[[0,"#ffffff",1],[.45,a,.95],[1,a,.3]]))+`<circle cx="50" cy="${k}" r="${x+7}" fill="${a}" opacity="0.25"/><circle cx="50" cy="${k}" r="${x}" fill="url(#o)" stroke="${i}" stroke-width="2.5"/>`,L=e==="storm"?[-1,1].map(b=>`<path d="M${50+b*(x+3)} ${k-6} L${50+b*(x+10)} ${k} L${50+b*(x+5)} ${k+2} L${50+b*(x+13)} ${k+10}" fill="none" stroke="${s("coin")}" stroke-width="3" stroke-linejoin="round"/>`).join(""):e==="arcane"?`<circle cx="50" cy="${k}" r="${x+11}" fill="none" stroke="${a}" stroke-width="2.5" stroke-dasharray="5 4"/>`:"";return et+$+w+g+L}function qr(r,t,e){let{style:o,ink:i,c:s}=r,l=P(o),n=ht(t)+10-(e?6:0),a=e==="glacier"?c(s("primary"),.15):d(s("primary"),.35),$=h(p("p",[[0,d(l.stone,.25)],[1,c(l.stone,.25)]],true),p("i",[[0,"#ffffff"],[.5,a],[1,c(a,.25)]]))+`<path d="M24 118 L28 ${n+18} L72 ${n+18} L76 118Z" fill="url(#p)" stroke="${i}" stroke-width="3.5" stroke-linejoin="round"/>`,y=(k,g,L,b)=>`<g transform="rotate(${b} ${k} ${n+20})"><polygon points="${k-L},${n+20} ${k-L*.8},${n+20-g*.75} ${k},${n+20-g} ${k+L*.8},${n+20-g*.75} ${k+L},${n+20}" fill="url(#i)" stroke="${i}" stroke-width="2.5" stroke-linejoin="round"/><line x1="${k}" y1="${n+20-g}" x2="${k}" y2="${n+18}" stroke="#fff" stroke-width="1.5" opacity="0.6"/></g>`,w=y(50,38+t*6,10,0);t>=2&&(w=y(36,26+t*3,7,-14)+y(64,26+t*3,7,14)+w),t>=3&&(w=y(28,20,5,-26)+y(72,20,5,26)+w),e==="glacier"&&(w+=y(50,70,15,0));let x=e==="blizzard"?[0,1,2,3,4].map(k=>`<polygon points="${m(22+k*14,n-30+k%2*12,5,2,6)}" fill="#fff" stroke="${i}" stroke-width="1.2"/>`).join(""):"";return et+$+w+x}var Fr={archer:Sr,cannon:Hr,mage:Nr,frost:qr},C=(r,t,e="")=>({w:100,h:130,draw:o=>Fr[r](o,t,e)}),Br={w:100,h:64,draw({style:r,ink:t,c:e}){let o=P(r),i=Array.from({length:10},(s,l)=>{let n=l/10*Math.PI*2;return `<ellipse cx="${(50+Math.cos(n)*38).toFixed(1)}" cy="${(34+Math.sin(n)*20).toFixed(1)}" rx="9" ry="6" fill="${l%2?o.stone:d(o.stone,.15)}" stroke="${t}" stroke-width="2.5"/>`}).join("");return `<ellipse cx="50" cy="34" rx="40" ry="22" fill="${c(o.stone,.45)}" opacity="0.55"/>`+i+`<line x1="78" y1="30" x2="78" y2="6" stroke="${t}" stroke-width="2.5"/><path d="M78 6 L92 10 L78 15Z" fill="${e("coin")}" stroke="${t}" stroke-width="1.5"/>`}},Wr={w:100,h:100,draw({style:r,ink:t,c:e}){let o=P(r),i=l=>`<rect x="${l}" y="22" width="22" height="72" fill="${o.stone}" stroke="${t}" stroke-width="3"/>`+[0,1].map(n=>`<rect x="${l+n*13}" y="13" width="9" height="11" fill="${o.stone}" stroke="${t}" stroke-width="2.5"/>`).join("")+`<polygon points="${l-3},22 ${l+11},2 ${l+25},22" fill="${e("danger")}" stroke="${t}" stroke-width="3" stroke-linejoin="round"/>`,s="";for(let l=38;l<=62;l+=6)s+=`<line x1="${l}" y1="52" x2="${l}" y2="94" stroke="${c(o.metal,.3)}" stroke-width="3"/>`;return `<ellipse cx="50" cy="95" rx="46" ry="5" fill="#000" opacity="0.28"/><rect x="22" y="36" width="56" height="58" fill="${d(o.stone,.1)}" stroke="${t}" stroke-width="3.5"/><path d="M34 94 L34 60 A16 16 0 0 1 66 60 L66 94Z" fill="#241a14" stroke="${t}" stroke-width="3"/>`+s+i(8)+i(70)+`<rect x="44" y="40" width="12" height="9" fill="${e("coin")}" stroke="${t}" stroke-width="2"/>`}},Gr={w:100,h:90,draw({style:r,ink:t}){let e=P(r);return `<path d="M6 86 C6 40 26 10 50 10 C74 10 94 40 94 86Z" fill="${c(e.stone,.15)}" stroke="${t}" stroke-width="4" stroke-linejoin="round"/><path d="M24 86 C24 52 36 30 50 30 C64 30 76 52 76 86Z" fill="#120c10" stroke="${t}" stroke-width="3"/><circle cx="42" cy="58" r="3" fill="#ff5a3a"/><circle cx="56" cy="58" r="3" fill="#ff5a3a"/>`}},Vr={w:100,h:130,draw({style:r,ink:t,c:e}){let o=P(r),i=r==="post-apocalypse"?"#6b6a3a":r==="sci-fi"?e("secondary"):r==="cozy"?"#6fcf6a":"#3f8f3a";return r==="post-apocalypse"?`<ellipse cx="50" cy="124" rx="26" ry="5" fill="#000" opacity="0.28"/><path d="M46 124 L48 60 L30 40 M48 70 L68 46 M48 84 L32 74" fill="none" stroke="${o.wood}" stroke-width="8" stroke-linecap="round"/><path d="M46 124 L48 60" stroke="${t}" stroke-width="2" opacity="0.4"/>`:h(u("l",[[0,d(i,.35),1],[1,c(i,.2),1]],.4,.35,.65))+`<ellipse cx="50" cy="124" rx="30" ry="6" fill="#000" opacity="0.28"/><rect x="42" y="78" width="16" height="46" rx="4" fill="${o.wood}" stroke="${t}" stroke-width="3"/>`+(r==="sci-fi"?`<polygon points="${j(50,50,36,6)}" fill="url(#l)" stroke="${t}" stroke-width="3.5"/>`:`<circle cx="34" cy="62" r="24" fill="url(#l)" stroke="${t}" stroke-width="3.5"/><circle cx="66" cy="62" r="24" fill="url(#l)" stroke="${t}" stroke-width="3.5"/><circle cx="50" cy="38" r="28" fill="url(#l)" stroke="${t}" stroke-width="3.5"/>`)+rt("M36 26 C42 20 50 18 56 20",4,.4)}},Ur={w:100,h:70,draw({style:r,ink:t,c:e}){let o=r==="post-apocalypse"?"#7a6a3a":r==="sci-fi"?e("secondary"):r==="cozy"?"#7fd87a":"#4a9a3e";return `<ellipse cx="50" cy="64" rx="40" ry="5" fill="#000" opacity="0.25"/><circle cx="30" cy="44" r="20" fill="${o}" stroke="${t}" stroke-width="3"/><circle cx="70" cy="44" r="20" fill="${o}" stroke="${t}" stroke-width="3"/><circle cx="50" cy="32" r="24" fill="${d(o,.12)}" stroke="${t}" stroke-width="3"/>`+[30,54,70].map((i,s)=>`<circle cx="${i}" cy="${36+s%2*10}" r="4" fill="${e(s===1?"coin":"danger")}"/>`).join("")}},Xr={w:100,h:30,draw:({ink:r})=>`<line x1="10" y1="15" x2="80" y2="15" stroke="#8a5a34" stroke-width="5" stroke-linecap="round"/><polygon points="78,6 98,15 78,24" fill="#d8dde6" stroke="${r}" stroke-width="2.5" stroke-linejoin="round"/><path d="M4 7 L20 15 L4 23 M12 7 L26 15 L12 23" fill="none" stroke="#e8e0d0" stroke-width="3"/>`},Yr={w:100,h:100,main:"danger",draw:({main:r,ink:t})=>h(u("f",[[0,"#fff6c0",1],[.4,"#ffb23a",1],[1,r,.9]]))+`<path d="M62 10 C82 18 96 30 98 40 L70 62 Z" fill="#ff8a2a" opacity="0.75"/><path d="M50 16 C70 26 84 40 86 52 L60 66 Z" fill="#ffd34a" opacity="0.6"/><circle cx="40" cy="62" r="26" fill="url(#f)" stroke="${t}" stroke-width="3.5"/><circle cx="32" cy="56" r="5" fill="${c(r,.35)}"/><circle cx="48" cy="70" r="4" fill="${c(r,.35)}"/>`},Jr={w:100,h:80,main:"coin",draw:({main:r,ink:t})=>{let e=(o,i)=>`<polygon points="${o},${i+18} ${o+6},${i} ${o+34},${i} ${o+40},${i+18}" fill="url(#g)" stroke="${t}" stroke-width="3" stroke-linejoin="round"/>`+rt(`M${o+10} ${i+5} L${o+24} ${i+5}`,2.5,.7);return h(p("g",[[0,d(r,.5)],[1,c(r,.25)]]))+'<ellipse cx="50" cy="74" rx="44" ry="5" fill="#000" opacity="0.25"/>'+e(8,52)+e(52,52)+e(30,32)+e(30,12)}},Kr={w:100,h:100,draw:({ink:r})=>`<path d="M14 86 L86 14 M14 14 L86 86" stroke="#d8dde6" stroke-width="9" stroke-linecap="round"/><path d="M14 86 L86 14 M14 14 L86 86" stroke="${r}" stroke-width="2.5" stroke-linecap="round" opacity="0.6"/><path d="M26 46 C26 24 38 14 50 14 C62 14 74 24 74 46 C74 58 68 62 64 64 L64 76 L36 76 L36 64 C32 62 26 58 26 46Z" fill="#f4efe4" stroke="${r}" stroke-width="4" stroke-linejoin="round"/><circle cx="40" cy="46" r="8" fill="#2a1e1e"/><circle cx="60" cy="46" r="8" fill="#2a1e1e"/><path d="M50 54 L46 62 L54 62Z" fill="#2a1e1e"/><path d="M42 76 L42 68 M50 76 L50 68 M58 76 L58 68" stroke="${r}" stroke-width="2.5"/>`},te={w:100,h:100,draw({style:r,ink:t,c:e}){let o=P(r),i=e("danger");return `<rect x="30" y="30" width="34" height="56" fill="${o.stone}" stroke="${t}" stroke-width="3.5"/>`+[30,41,52].map(s=>`<rect x="${s+1}" y="20" width="8" height="11" fill="${o.stone}" stroke="${t}" stroke-width="2.5"/>`).join("")+`<path d="M41 86 L41 74 A6 6 0 0 1 53 74 L53 86Z" fill="#3a2a1e" stroke="${t}" stroke-width="2.5"/><circle cx="47" cy="52" r="38" fill="none" stroke="${t}" stroke-width="13"/><circle cx="47" cy="52" r="38" fill="none" stroke="${i}" stroke-width="8"/><line x1="20" y1="79" x2="74" y2="25" stroke="${t}" stroke-width="13" stroke-linecap="round"/><line x1="20" y1="79" x2="74" y2="25" stroke="${i}" stroke-width="8" stroke-linecap="round"/>`+h(p("g",[[0,d(e("coin"),.45)],[1,c(e("coin"),.2)]]))+`<circle cx="78" cy="80" r="17" fill="url(#g)" stroke="${t}" stroke-width="3.5"/><path d="M78 71 L78 89 M69 80 L87 80" stroke="${c(e("coin"),.45)}" stroke-width="4" stroke-linecap="round"/>`}},At={td_sell:te,td_archer1:C("archer",1),td_archer2:C("archer",2),td_archer3:C("archer",3),td_archer_ranger:C("archer",3,"ranger"),td_archer_sniper:C("archer",3,"sniper"),td_cannon1:C("cannon",1),td_cannon2:C("cannon",2),td_cannon3:C("cannon",3),td_cannon_bombard:C("cannon",3,"bombard"),td_cannon_flamer:C("cannon",3,"flamer"),td_mage1:C("mage",1),td_mage2:C("mage",2),td_mage3:C("mage",3),td_mage_arcane:C("mage",3,"arcane"),td_mage_storm:C("mage",3,"storm"),td_frost1:C("frost",1),td_frost2:C("frost",2),td_frost3:C("frost",3),td_frost_glacier:C("frost",3,"glacier"),td_frost_blizzard:C("frost",3,"blizzard"),td_spot:Br,td_gate:Wr,td_portal:Gr,td_tree:Vr,td_bush:Ur,td_arrow:Xr,td_meteor:Yr,td_gold:Jr,td_call:Kr};var V=(r,t=4,e=.5)=>`<path d="${r}" fill="none" stroke="#fff" stroke-width="${t}" stroke-linecap="round" opacity="${e}"/>`,re={w:100,h:100,draw:({ink:r})=>{let e=["#ff5a5a","#ffb03a","#ffe14a","#5ad35a","#4aa8ff","#a26bff"].map((o,i)=>{let s=i/6*Math.PI*2,l=(i+1)/6*Math.PI*2,n=a=>`${(50+Math.cos(a)*38).toFixed(1)} ${(50+Math.sin(a)*38).toFixed(1)}`;return `<path d="M50 50 L${n(s)} A38 38 0 0 1 ${n(l)}Z" fill="${o}"/>`});return h(u("g",[[0,"#ffffff",.95],[.5,"#ffffff",.2],[1,"#ffffff",0]],.38,.35,.5))+'<circle cx="50" cy="50" r="46" fill="#ffffff" opacity="0.25"/>'+e.join("")+`<circle cx="50" cy="50" r="38" fill="url(#g)" stroke="${r}" stroke-width="4"/><polygon points="${m(50,50,13,6)}" fill="#fff" opacity="0.9"/>`}},Ct=r=>({w:100,h:100,draw:({ink:t})=>{let e=`<path d="M8 50 L24 38 L24 45 L76 45 L76 38 L92 50 L76 62 L76 55 L24 55 L24 62Z" fill="#fff" stroke="${t}" stroke-width="3" stroke-linejoin="round"/>`;return `<g ${r?'transform="rotate(90 50 50)"':""} opacity="0.95">${e}</g>`}}),ee={w:100,h:100,draw:({ink:r})=>`<circle cx="50" cy="50" r="40" fill="none" stroke="#fff" stroke-width="7" opacity="0.9"/><circle cx="50" cy="50" r="40" fill="none" stroke="${r}" stroke-width="2" opacity="0.6"/><polygon points="${m(78,20,13,5,8)}" fill="#ffd34a" stroke="${r}" stroke-width="2"/>`},Qt=r=>({w:100,h:100,draw:({ink:t})=>h(p("i",[[0,"#e6f6ff",.75],[1,"#7cc4ff",r>1?.85:.6]]))+`<rect x="3" y="3" width="94" height="94" rx="12" fill="url(#i)" stroke="${t}" stroke-width="3" opacity="0.95"/>`+(r>1?'<rect x="12" y="12" width="76" height="76" rx="8" fill="none" stroke="#fff" stroke-width="4" opacity="0.8"/>':"")+V("M14 30 L30 14",5,.8)+V("M70 88 L86 72",4,.5)}),oe={w:100,h:100,draw:({ink:r})=>`<path d="M4 20 C4 8 14 4 24 6 C36 0 56 10 64 4 C78 0 96 8 96 22 L96 80 C96 94 84 98 72 94 C60 100 44 90 30 96 C16 100 4 92 4 80Z" fill="#8edc4a" opacity="0.6" stroke="${r}" stroke-width="3"/><circle cx="28" cy="70" r="6" fill="#c6f58a" opacity="0.9"/><circle cx="72" cy="30" r="5" fill="#c6f58a" opacity="0.9"/>`},ie={w:100,h:100,draw:({ink:r})=>{let t=(e,o,i)=>`<rect x="${e-14}" y="${o-8}" width="28" height="16" rx="8" fill="none" stroke="#9aa3b0" stroke-width="7" transform="rotate(${i} ${e} ${o})"/><rect x="${e-14}" y="${o-8}" width="28" height="16" rx="8" fill="none" stroke="${r}" stroke-width="1.5" transform="rotate(${i} ${e} ${o})"/>`;return [t(18,18,45),t(36,36,45),t(64,64,45),t(82,82,45),t(82,18,-45),t(64,36,-45),t(36,64,-45),t(18,82,-45)].join("")+`<circle cx="50" cy="50" r="12" fill="#c9a14a" stroke="${r}" stroke-width="3"/><rect x="46" y="48" width="8" height="10" fill="${r}"/>`}},Zt=r=>({w:100,h:100,draw:({style:t,ink:e})=>{let o=t==="sci-fi"?"#7c86a8":t==="cozy"?"#b8a99a":"#8f8a82";return h(p("s",[[0,d(o,.35)],[1,c(o,.35)]]))+`<path d="M10 30 L28 8 L72 6 L92 26 L94 72 L74 94 L26 94 L6 72Z" fill="url(#s)" stroke="${e}" stroke-width="4" stroke-linejoin="round"/>`+(r?"":`<path d="M30 30 L44 50 L36 70 M60 24 L66 44 L80 54" fill="none" stroke="${c(o,.5)}" stroke-width="3.5" stroke-linecap="round"/>`)+(r?`<path d="M30 40 L70 40 M30 60 L70 60" stroke="${c(o,.4)}" stroke-width="4"/>`:"")+V("M20 30 L34 14",4,.45)}}),se={w:100,h:100,draw:({ink:r,c:t})=>{let e="";for(let o=18;o<=82;o+=16)e+=`<line x1="${o}" y1="18" x2="${o}" y2="88" stroke="#b07a3a" stroke-width="5"/>`;return `<circle cx="50" cy="58" r="22" fill="${t("coin")}" stroke="${r}" stroke-width="3"/><circle cx="42" cy="54" r="4" fill="${r}"/><circle cx="58" cy="54" r="4" fill="${r}"/><path d="M44 66 Q50 71 56 66" fill="none" stroke="${r}" stroke-width="3" stroke-linecap="round"/><path d="M34 40 L30 28 L42 36Z M66 40 L70 28 L58 36Z" fill="${t("coin")}" stroke="${r}" stroke-width="2.5"/>`+e+`<rect x="10" y="10" width="80" height="10" rx="4" fill="#8a5a2a" stroke="${r}" stroke-width="3"/><rect x="10" y="86" width="80" height="10" rx="4" fill="#8a5a2a" stroke="${r}" stroke-width="3"/>`}},le={w:100,h:100,draw:({ink:r})=>h(p("w",[[0,"#d9a066"],[1,"#9a6236"]]))+`<rect x="8" y="8" width="84" height="84" rx="6" fill="url(#w)" stroke="${r}" stroke-width="4"/><rect x="16" y="16" width="68" height="68" fill="none" stroke="#7a4a26" stroke-width="4"/><path d="M18 18 L82 82 M82 18 L18 82" stroke="#7a4a26" stroke-width="6"/><path d="M50 30 L50 64 M38 54 L50 66 L62 54" fill="none" stroke="#fff4d0" stroke-width="7" stroke-linecap="round" stroke-linejoin="round"/>`},ne={w:100,h:100,main:"danger",draw:({main:r,ink:t})=>h(p("h",[[0,d(r,.45)],[1,c(r,.2)]]))+`<path d="M50 88 C20 66 8 50 8 32 C8 18 20 8 32 8 C40 8 46 12 50 20 C54 12 60 8 68 8 C80 8 92 18 92 32 C92 50 80 66 50 88Z" fill="url(#h)" stroke="${t}" stroke-width="4.5" stroke-linejoin="round"/>`+V("M22 30 C22 22 28 18 34 18",5,.7)},ce={w:100,h:100,main:"primary",draw:({main:r,ink:t})=>h(p("s",[[0,d(r,.45)],[1,c(r,.25)]]))+`<path d="M50 6 L88 18 L86 52 C84 74 68 88 50 96 C32 88 16 74 14 52 L12 18Z" fill="url(#s)" stroke="${t}" stroke-width="4.5" stroke-linejoin="round"/><path d="M50 20 L74 28 L72 52 C70 66 60 76 50 82Z" fill="${d(r,.3)}" opacity="0.7"/>`+V("M24 26 L36 22",4,.7)},ae={w:100,h:100,draw:({ink:r})=>h(u("f",[[0,"#fff6c0",1],[.45,"#ffb23a",1],[1,"#e0442e",1]]))+`<polygon points="${m(50,50,46,22,10)}" fill="url(#f)" stroke="${r}" stroke-width="4" stroke-linejoin="round"/><circle cx="50" cy="50" r="12" fill="#fff6c0"/>`},fe={w:100,h:100,draw:({ink:r,c:t})=>`<path d="M40 6 L60 6 L60 40 L94 40 L94 60 L60 60 L60 94 L40 94 L40 60 L6 60 L6 40 L40 40Z" fill="${t("coin")}" stroke="${r}" stroke-width="4" stroke-linejoin="round"/><circle cx="50" cy="50" r="13" fill="#fffbe0" stroke="${r}" stroke-width="3"/>`},de={w:100,h:100,draw:({ink:r,c:t})=>`<path d="M20 44 C10 44 6 34 12 26 C16 18 26 18 30 22 C34 10 52 8 60 18 C70 12 86 18 86 30 C96 32 96 46 84 48Z" fill="#d8e2f0" stroke="${r}" stroke-width="4" stroke-linejoin="round"/><path d="M48 48 L36 72 L50 72 L42 96 L68 62 L54 62 L62 48Z" fill="${t("coin")}" stroke="${r}" stroke-width="3.5" stroke-linejoin="round"/>`},_t={m3_rainbow:re,m3_row:Ct(false),m3_col:Ct(true),m3_bomb:ee,m3_ice:Qt(1),m3_ice2:Qt(2),m3_slime:oe,m3_chain:ie,m3_stone:Zt(false),m3_stone2:Zt(true),m3_cage:se,m3_crate:le,m3_heart:ne,m3_shield:ce,m3_skill_blast:ae,m3_skill_cross:fe,m3_skill_storm:de};var M=(r,t,e,o,i=.28)=>`<ellipse cx="${r}" cy="${t}" rx="${e}" ry="${o}" fill="#000" opacity="${i}"/>`,R=(r,t=4,e=.55)=>`<path d="${r}" fill="none" stroke="#fff" stroke-width="${t}" stroke-linecap="round" opacity="${e}"/>`,Q=r=>({w:100,h:100,draw:({ink:t})=>r(t)}),U="#e8b84a",N="#c9803a",he=r=>Q(t=>{switch(r){case 1:{let e=[0,1,2,3].map(o=>`<ellipse cx="${44-o%2*0}" cy="${30+o*11}" rx="7" ry="5" fill="${U}" stroke="${t}" stroke-width="2.5" transform="rotate(-30 44 ${30+o*11})"/><ellipse cx="57" cy="${30+o*11}" rx="7" ry="5" fill="${d(U,.1)}" stroke="${t}" stroke-width="2.5" transform="rotate(30 57 ${30+o*11})"/>`);return M(50,90,14,3)+`<path d="M50 90 L50 22" stroke="${c(U,.3)}" stroke-width="4" stroke-linecap="round"/>`+e.join("")+`<ellipse cx="50" cy="20" rx="5" ry="8" fill="${U}" stroke="${t}" stroke-width="2.5"/>`}case 2:return h(p("s",[[0,"#f6ecd6"],[1,"#d6c29a"]]))+M(50,90,28,5)+`<path d="M24 40 Q22 86 30 88 L70 88 Q78 86 76 40 Q50 30 24 40Z" fill="url(#s)" stroke="${t}" stroke-width="3.5"/><path d="M28 40 Q38 22 50 30 Q62 22 72 40" fill="#f6ecd6" stroke="${t}" stroke-width="3"/><path d="M36 38 L64 38" stroke="${N}" stroke-width="5"/><path d="M50 52 L56 62 L50 72 L44 62Z" fill="${U}" stroke="${t}" stroke-width="2"/><circle cx="50" cy="20" r="6" fill="#fff" opacity="0.9"/><circle cx="58" cy="16" r="4" fill="#fff" opacity="0.8"/>`;case 3:return h(u("d",[[0,"#fff6e6"],[1,"#e8cfa2"]],.4,.35))+M(50,86,30,5)+`<path d="M18 70 Q14 44 36 38 Q50 30 64 38 Q86 44 82 70 Q78 84 50 84 Q22 84 18 70Z" fill="url(#d)" stroke="${t}" stroke-width="3.5"/>`+R("M30 52 Q36 44 46 42",4,.7);case 4:return h(p("b",[[0,"#f0b25a"],[1,N]]))+M(50,86,32,5)+`<path d="M16 72 Q14 40 50 34 Q86 40 84 72 Q80 84 50 84 Q20 84 16 72Z" fill="url(#b)" stroke="${t}" stroke-width="3.5"/>`+[[36,50],[50,46],[64,50],[44,60],[58,60]].map(([e,o])=>`<ellipse cx="${e}" cy="${o}" rx="3" ry="1.8" fill="#fff6d6" stroke="${t}" stroke-width="1"/>`).join("")+R("M26 56 Q30 46 40 42",4,.5);case 5:return h(p("l",[[0,"#f2bb66"],[1,c(N,.1)]]))+M(50,84,40,5)+`<path d="M8 66 Q8 36 50 32 Q92 36 92 66 Q92 80 50 80 Q8 80 8 66Z" fill="url(#l)" stroke="${t}" stroke-width="3.5"/>`+[26,42,58,74].map(e=>`<path d="M${e-6} 52 Q${e} 42 ${e+6} 40" stroke="${c(N,.35)}" stroke-width="4" fill="none" stroke-linecap="round"/>`).join("")+R("M16 60 Q18 46 30 40",4,.45);case 6:return h(p("p",[[0,"#f4c070"],[1,N]]))+M(50,86,42,5)+`<path d="M8 60 L14 80 L86 80 L92 60Z" fill="#b8b8c8" stroke="${t}" stroke-width="3.5"/><ellipse cx="50" cy="58" rx="42" ry="16" fill="url(#p)" stroke="${t}" stroke-width="3.5"/><ellipse cx="50" cy="56" rx="32" ry="10" fill="#c43a5a"/>`+[-20,-7,6,19].map(e=>`<line x1="${50+e}" y1="46" x2="${50+e+6}" y2="67" stroke="${d(N,.2)}" stroke-width="4"/>`).join("")+[-20,0,20].map(e=>`<line x1="20" y1="${56+e*.3}" x2="80" y2="${56+e*.3}" stroke="${d(N,.2)}" stroke-width="4" opacity="0.9"/>`).join("")+`<ellipse cx="50" cy="58" rx="42" ry="16" fill="none" stroke="${t}" stroke-width="3.5"/>`;default:return h(p("c",[[0,"#fff4f6"],[1,"#f2c6d2"]]),p("t",[[0,"#ffd6e0"],[1,"#e89ab0"]]))+M(50,94,40,4)+`<rect x="12" y="62" width="76" height="28" rx="6" fill="url(#c)" stroke="${t}" stroke-width="3.5"/><rect x="24" y="38" width="52" height="26" rx="6" fill="url(#t)" stroke="${t}" stroke-width="3.5"/><path d="M12 70 Q20 78 28 70 Q36 78 44 70 Q52 78 60 70 Q68 78 76 70 Q84 78 88 70" fill="none" stroke="#fff" stroke-width="4"/><path d="M24 46 Q32 52 40 46 Q48 52 56 46 Q64 52 76 46" fill="none" stroke="#fff" stroke-width="4"/>`+[36,50,64].map(e=>`<rect x="${e-2.5}" y="22" width="5" height="16" rx="2" fill="#7cc4ff" stroke="${t}" stroke-width="1.5"/><path d="M${e} 12 Q${e+4} 18 ${e} 21 Q${e-4} 18 ${e} 12Z" fill="#ffc83a"/>`).join("")+`<circle cx="50" cy="40" r="5" fill="#d62a3a" stroke="${t}" stroke-width="2"/>`}}),v="#4ac8ff",X="#ffc83a",B=(r,t,e,o,i,s)=>`<path d="M${r} ${t-e} L${r+o} ${t-e*.6} L${r+o*.8} ${t} L${r-o*.8} ${t} L${r-o} ${t-e*.6}Z" fill="${i}" stroke="${s}" stroke-width="3" stroke-linejoin="round"/><path d="M${r} ${t-e} L${r} ${t}" stroke="#fff" stroke-width="2" opacity="0.6"/>`,$e=r=>Q(t=>{switch(r){case 1:return h(u("r",[[0,"#c8ccd6"],[1,"#7a8090"]],.4,.35))+M(50,84,28,5)+`<path d="M20 70 Q16 48 34 40 Q52 30 70 42 Q86 54 78 72 Q66 84 44 82 Q24 80 20 70Z" fill="url(#r)" stroke="${t}" stroke-width="3.5"/><path d="M58 52 L66 58 L60 64Z" fill="${v}" stroke="${t}" stroke-width="1.5"/>`+R("M30 52 Q36 44 46 42",4,.5);case 2:return M(50,88,22,4)+B(50,86,66,18,v,t)+R("M44 40 L46 30",3,.7);case 3:return M(50,90,34,5)+B(30,88,44,13,c(v,.15),t)+B(70,88,48,13,"#a88aff",t)+B(50,88,70,16,v,t);case 4:return h(p("g",[[0,d(v,.4)],[1,c(v,.3)]]))+M(50,90,30,5)+`<path d="M20 38 L34 20 L66 20 L80 38 L50 86Z" fill="url(#g)" stroke="${t}" stroke-width="3.5" stroke-linejoin="round"/><path d="M20 38 L80 38 M34 20 L42 38 L50 86 L58 38 L66 20 M42 38 L50 20 L58 38" fill="none" stroke="${t}" stroke-width="2" opacity="0.7"/><path d="M28 34 L36 24" stroke="#fff" stroke-width="4" stroke-linecap="round" opacity="0.8"/>`;case 5:return M(50,90,26,4)+`<circle cx="50" cy="62" r="24" fill="none" stroke="${t}" stroke-width="13"/><circle cx="50" cy="62" r="24" fill="none" stroke="${X}" stroke-width="8"/><path d="M50 62 m-16 -20" stroke="#fff" stroke-width="3" opacity="0.5"/><path d="M36 32 L42 22 L58 22 L64 32 L50 48Z" fill="#ff4a8a" stroke="${t}" stroke-width="3" stroke-linejoin="round"/>`+R("M30 70 Q30 54 40 46",3,.6);case 6:return M(50,92,24,4)+`<path d="M18 16 Q20 58 50 66 Q80 58 82 16" fill="none" stroke="${t}" stroke-width="7"/><path d="M18 16 Q20 58 50 66 Q80 58 82 16" fill="none" stroke="${X}" stroke-width="4" stroke-dasharray="5 3"/><path d="M50 62 L64 74 L50 92 L36 74Z" fill="${v}" stroke="${t}" stroke-width="3" stroke-linejoin="round"/><circle cx="34" cy="52" r="4" fill="#ff4a8a" stroke="${t}" stroke-width="1.5"/><circle cx="66" cy="52" r="4" fill="#ff4a8a" stroke="${t}" stroke-width="1.5"/>`+R("M44 72 L50 66",3,.7);default:return h(p("k",[[0,d(X,.3)],[1,c(X,.25)]]))+M(50,90,38,5)+`<path d="M12 80 L8 30 L30 50 L50 18 L70 50 L92 30 L88 80Z" fill="url(#k)" stroke="${t}" stroke-width="3.5" stroke-linejoin="round"/><rect x="12" y="72" width="76" height="12" rx="3" fill="${c(X,.15)}" stroke="${t}" stroke-width="3"/><circle cx="50" cy="60" r="7" fill="#ff4a8a" stroke="${t}" stroke-width="2.5"/><circle cx="30" cy="64" r="5" fill="${v}" stroke="${t}" stroke-width="2"/><circle cx="70" cy="64" r="5" fill="${v}" stroke="${t}" stroke-width="2"/>`+[[8,30],[50,18],[92,30]].map(([e,o])=>`<circle cx="${e}" cy="${o}" r="5" fill="#fff6c0" stroke="${t}" stroke-width="2"/>`).join("")}}),O="#a26bff",Rt="#dff2ff",pe=r=>Q(t=>{switch(r){case 1:return M(50,90,18,4)+'<path d="M50 90 Q46 60 52 30" stroke="#3f8a3a" stroke-width="4" fill="none" stroke-linecap="round"/>'+[[52,34,-40],[49,50,210],[51,64,-30],[48,76,200]].map(([e,o,i])=>`<ellipse cx="${e+12*Math.cos(i*Math.PI/180)}" cy="${o+12*Math.sin(i*Math.PI/180)}" rx="13" ry="6" fill="#5ad35a" stroke="${t}" stroke-width="2.5" transform="rotate(${i} ${e+12*Math.cos(i*Math.PI/180)} ${o+12*Math.sin(i*Math.PI/180)})"/>`).join("");case 2:return h(u("d",[[0,d(O,.5)],[1,c(O,.2)]],.4,.55))+M(50,90,18,4)+`<path d="M50 12 Q74 46 74 62 A24 24 0 0 1 26 62 Q26 46 50 12Z" fill="url(#d)" stroke="${t}" stroke-width="3.5"/>`+R("M38 58 Q38 48 44 40",4,.7);case 3:return M(50,92,14,3)+`<rect x="38" y="12" width="24" height="8" rx="2" fill="#a8774a" stroke="${t}" stroke-width="2.5"/><path d="M40 20 L40 78 A10 10 0 0 0 60 78 L60 20Z" fill="${Rt}" stroke="${t}" stroke-width="3" opacity="0.95"/><path d="M41 52 L41 78 A9 9 0 0 0 59 78 L59 52Z" fill="#4ad3a0"/>`+R("M45 26 L45 72",3,.7);case 4:return M(50,92,26,4)+`<rect x="42" y="10" width="16" height="10" rx="2" fill="#a8774a" stroke="${t}" stroke-width="2.5"/><path d="M44 20 L44 40 A26 26 0 1 0 56 40 L56 20Z" fill="${Rt}" stroke="${t}" stroke-width="3"/><path d="M27 62 A23 23 0 0 0 73 62Z" fill="#ff6a5a"/><circle cx="44" cy="70" r="3" fill="#fff" opacity="0.7"/><circle cx="56" cy="74" r="2" fill="#fff" opacity="0.7"/>`+R("M34 52 Q32 62 36 70",3.5,.7);case 5:return h(p("b",[[0,d(O,.3)],[1,c(O,.3)]]))+M(50,94,26,4)+`<rect x="40" y="6" width="20" height="12" rx="3" fill="#a8774a" stroke="${t}" stroke-width="2.5"/><path d="M42 18 L42 30 Q22 38 22 60 L22 82 Q22 90 30 90 L70 90 Q78 90 78 82 L78 60 Q78 38 58 30 L58 18Z" fill="url(#b)" stroke="${t}" stroke-width="3.5"/><rect x="30" y="56" width="40" height="22" rx="4" fill="#fff6e6" stroke="${t}" stroke-width="2"/><path d="M50 74 L40 64 A5 5 0 0 1 50 60 A5 5 0 0 1 60 64Z" fill="#e8384a"/>`+R("M30 44 Q28 52 28 60",4,.6);case 6:return h(p("k",[[0,"#5a5a6a"],[1,"#22222c"]]))+M(50,94,36,4)+[[30,30,6],[46,20,8],[62,28,5]].map(([e,o,i])=>`<circle cx="${e}" cy="${o}" r="${i}" fill="${d("#4ad3a0",.2)}" stroke="${t}" stroke-width="2"/>`).join("")+`<ellipse cx="50" cy="44" rx="38" ry="10" fill="#4ad3a0" stroke="${t}" stroke-width="3"/><path d="M12 44 Q12 86 50 86 Q88 86 88 44Z" fill="url(#k)" stroke="${t}" stroke-width="3.5"/><path d="M26 86 L22 94 M74 86 L78 94" stroke="${t}" stroke-width="5" stroke-linecap="round"/>`+R("M20 54 Q22 68 30 76",4,.35);default:return h(u("o",[[0,"#ffffff"],[.35,d(O,.4)],[1,c(O,.35)]],.4,.35))+M(50,94,26,4)+`<path d="M28 94 L34 76 L66 76 L72 94Z" fill="#a8774a" stroke="${t}" stroke-width="3"/><circle cx="50" cy="44" r="34" fill="${O}" opacity="0.25"/><circle cx="50" cy="46" r="28" fill="url(#o)" stroke="${t}" stroke-width="3.5"/><polygon points="${m(50,46,12,5,4)}" fill="#fff" opacity="0.85"/>`+[[18,20],[84,26],[80,70],[16,66]].map(([e,o])=>`<polygon points="${m(e,o,5,2,4)}" fill="#fff6c0"/>`).join("")}}),ot=(r,t)=>h(p("pad",[[0,d(r,.25)],[1,c(r,.25)]]))+`<rect x="6" y="6" width="88" height="88" rx="20" fill="url(#pad)" stroke="${t}" stroke-width="4"/><rect x="12" y="12" width="76" height="40" rx="14" fill="#fff" opacity="0.18"/>`,ke=Q(r=>ot("#5ab04a",r)+`<path d="M26 44 Q24 84 32 84 L68 84 Q76 84 74 44 Q50 36 26 44Z" fill="#d8b884" stroke="${r}" stroke-width="3.5"/><path d="M30 46 Q40 32 50 40 Q60 32 70 46" fill="#e8cc9a" stroke="${r}" stroke-width="3"/><path d="M50 40 Q48 26 50 18" stroke="#3f8a3a" stroke-width="4" fill="none" stroke-linecap="round"/><ellipse cx="41" cy="22" rx="9" ry="5" fill="#7fd36e" stroke="${r}" stroke-width="2.5" transform="rotate(-25 41 22)"/><ellipse cx="59" cy="20" rx="9" ry="5" fill="#7fd36e" stroke="${r}" stroke-width="2.5" transform="rotate(25 59 20)"/>`+[[42,64],[52,70],[58,60]].map(([t,e])=>`<ellipse cx="${t}" cy="${e}" rx="3" ry="4" fill="#8a5a32"/>`).join("")),ye=Q(r=>ot("#e09a3a",r)+`<path d="M16 84 L16 50 Q16 20 50 20 Q84 20 84 50 L84 84Z" fill="#c8634a" stroke="${r}" stroke-width="3.5"/>`+[30,44,58].map(t=>`<path d="M18 ${t} L82 ${t}" stroke="${c("#c8634a",.3)}" stroke-width="2"/>`).join("")+`<path d="M30 84 L30 60 Q30 46 50 46 Q70 46 70 84Z" fill="#2a1a14" stroke="${r}" stroke-width="3"/><path d="M38 84 Q36 70 44 64 Q44 72 50 70 Q50 60 58 58 Q66 70 62 84Z" fill="#ffb03a"/><path d="M44 84 Q44 76 50 74 Q56 76 56 84Z" fill="#ffe66a"/>`),we=Q(r=>ot("#4a7ad3",r)+`<path d="M14 84 L22 46 L42 28 L66 32 L84 54 L86 84Z" fill="#8a8a9a" stroke="${r}" stroke-width="3.5" stroke-linejoin="round"/><path d="M22 46 L40 56 L42 28 M40 56 L66 32 M40 56 L60 84 M66 32 L68 60 L84 54 M68 60 L60 84" fill="none" stroke="${c("#8a8a9a",.3)}" stroke-width="2"/>`+B(36,76,18,6,v,r)+B(70,78,14,5,"#ff4a8a",r)+`<path d="M58 14 L84 26" stroke="#8a5a32" stroke-width="5" stroke-linecap="round"/><path d="M76 12 Q86 20 90 34 L82 30 Q80 22 72 18Z" fill="#c8ccd6" stroke="${r}" stroke-width="2.5"/>`),ue=Q(r=>ot("#8a4ad3",r)+`<rect x="16" y="20" width="68" height="66" rx="6" fill="#8a5a32" stroke="${r}" stroke-width="3.5"/><path d="M16 52 L84 52" stroke="${r}" stroke-width="3"/>`+[[30,44,"#4ad3a0"],[50,44,"#ff6a5a"],[70,44,O],[30,78,O],[50,78,"#ffc83a"],[70,78,"#4ad3a0"]].map(([t,e,o])=>`<rect x="${Number(t)-4}" y="${Number(e)-20}" width="8" height="6" fill="#d8b884"/><path d="M${Number(t)-6} ${Number(e)-14} L${Number(t)+6} ${Number(e)-14} L${Number(t)+7} ${e} L${Number(t)-7} ${e}Z" fill="${o}" stroke="${r}" stroke-width="2"/>`).join("")),Dt=r=>Q(t=>{let e="#c08a4a";return h(p("w",[[0,d(e,.15)],[1,c(e,.2)]]))+`<rect x="6" y="6" width="88" height="88" rx="8" fill="url(#w)" stroke="${t}" stroke-width="4"/>`+[30,50,70].map(o=>`<line x1="8" y1="${o}" x2="92" y2="${o}" stroke="${c(e,.35)}" stroke-width="2"/>`).join("")+`<path d="M14 14 L86 86 M86 14 L14 86" stroke="${c(e,.3)}" stroke-width="7"/><rect x="6" y="6" width="88" height="88" rx="8" fill="none" stroke="${t}" stroke-width="4"/>`+(r?`<rect x="6" y="22" width="88" height="10" fill="#8a96aa" stroke="${t}" stroke-width="2.5"/><rect x="6" y="68" width="88" height="10" fill="#8a96aa" stroke="${t}" stroke-width="2.5"/>`+[16,50,84].map(o=>`<circle cx="${o}" cy="27" r="2.5" fill="${t}"/><circle cx="${o}" cy="73" r="2.5" fill="${t}"/>`).join(""):"")}),xe={w:100,h:100,draw:()=>h(u("f",[[0,"#ffffff"],[1,"#c8d2e0"]],.45,.4,.6))+'<rect x="2" y="2" width="96" height="96" rx="14" fill="url(#f)" opacity="0.97"/>'+[[28,34,18],[62,30,20],[44,58,22],[76,64,16],[22,70,14]].map(([r,t,e])=>`<circle cx="${r}" cy="${t}" r="${e}" fill="#ffffff" opacity="0.75"/>`).join("")+'<text x="50" y="62" font-size="30" font-family="sans-serif" font-weight="900" text-anchor="middle" fill="#8a96aa" opacity="0.8">?</text>'},ge=Q(r=>'<g stroke="#ffffff" stroke-width="2.5" fill="none" opacity="0.9">'+[0,45,90,135].map(t=>`<line x1="${50-46*Math.cos(t*Math.PI/180)}" y1="${50-46*Math.sin(t*Math.PI/180)}" x2="${50+46*Math.cos(t*Math.PI/180)}" y2="${50+46*Math.sin(t*Math.PI/180)}"/>`).join("")+[14,28,42].map(t=>`<polygon points="${j(50,50,t,8,0)}"/>`).join("")+`</g><g stroke="${r}" stroke-width="1" fill="none" opacity="0.35">`+[14,28,42].map(t=>`<polygon points="${j(50,50,t,8,0)}"/>`).join("")+"</g>"),me={w:100,h:100,draw:()=>h(u("u",[[0,"#ffffff",0],[.75,"#9ad8ff",.25],[1,"#4ab0ff",.7]]))+'<circle cx="50" cy="50" r="46" fill="url(#u)" stroke="#ffffff" stroke-width="3" opacity="0.95"/>'+R("M24 38 Q28 24 42 18",6,.85)+'<circle cx="72" cy="72" r="4" fill="#fff" opacity="0.7"/>'},Le=Q(r=>h(p("j",[[0,"#ff6a8a"],[.35,"#ffc83a"],[.7,"#5ad35a"],[1,"#4aa8ff"]]))+M(50,90,26,4)+`<circle cx="50" cy="50" r="40" fill="#fff" opacity="0.25"/><polygon points="${m(50,50,40,18,5)}" fill="url(#j)" stroke="${r}" stroke-width="3.5" stroke-linejoin="round"/><circle cx="42" cy="46" r="4" fill="${r}"/><circle cx="58" cy="46" r="4" fill="${r}"/><path d="M42 58 Q50 64 58 58" stroke="${r}" stroke-width="3" fill="none" stroke-linecap="round"/>`),be=Q(r=>M(50,92,22,4)+`<path d="M50 54 L26 12 L34 10 L54 48Z" fill="#d8dee8" stroke="${r}" stroke-width="3" stroke-linejoin="round"/><path d="M50 54 L74 12 L66 10 L46 48Z" fill="#eef2f8" stroke="${r}" stroke-width="3" stroke-linejoin="round"/><circle cx="34" cy="74" r="14" fill="none" stroke="${r}" stroke-width="10"/><circle cx="34" cy="74" r="14" fill="none" stroke="#e8384a" stroke-width="6"/><circle cx="66" cy="74" r="14" fill="none" stroke="${r}" stroke-width="10"/><circle cx="66" cy="74" r="14" fill="none" stroke="#e8384a" stroke-width="6"/><circle cx="50" cy="54" r="5" fill="#ffc83a" stroke="${r}" stroke-width="2"/>`),Me=Q(r=>h(u("e",[[0,"#fff6a0"],[1,"#ffb000"]],.4,.35))+`<circle cx="50" cy="50" r="44" fill="url(#e)" stroke="${r}" stroke-width="4"/><path d="M56 12 L26 56 L46 56 L40 88 L74 40 L54 40Z" fill="#fff" stroke="${r}" stroke-width="3.5" stroke-linejoin="round"/>`),je=Q(r=>h(p("t",[[0,"#9aa6ba"],[1,"#5a6478"]],true))+`<rect x="36" y="8" width="28" height="10" rx="4" fill="#5a6478" stroke="${r}" stroke-width="3"/><rect x="14" y="16" width="72" height="12" rx="4" fill="#7a869a" stroke="${r}" stroke-width="3.5"/><path d="M20 30 L26 90 L74 90 L80 30Z" fill="url(#t)" stroke="${r}" stroke-width="3.5" stroke-linejoin="round"/>`+[36,50,64].map(t=>`<line x1="${t}" y1="40" x2="${t}" y2="80" stroke="${r}" stroke-width="3" stroke-linecap="round" opacity="0.6"/>`).join("")),Ae=Q(r=>`<path d="M50 10 L80 44 L62 44 L62 84 L38 84 L38 44 L20 44Z" fill="#7cf0a0" stroke="${r}" stroke-width="4" stroke-linejoin="round"/>`+[[18,20],[84,66],[16,74]].map(([t,e])=>`<polygon points="${m(t,e,9,3.5,4)}" fill="#fff6a0" stroke="${r}" stroke-width="1.5"/>`).join("")),Ce=Q(r=>`<path d="M40 8 L16 50 L32 50 L26 90 L56 40 L40 40Z" fill="#ffd34a" stroke="${r}" stroke-width="3.5" stroke-linejoin="round"/><path d="M70 18 L52 50 L64 50 L60 82 L84 44 L72 44Z" fill="#fff6a0" stroke="${r}" stroke-width="3" stroke-linejoin="round"/>`),Qe=Q(r=>`<path d="M22 84 L64 42" stroke="${r}" stroke-width="12" stroke-linecap="round"/><path d="M22 84 L64 42" stroke="#8a5a32" stroke-width="7" stroke-linecap="round"/><polygon points="${m(70,34,24,10,5)}" fill="#ffc83a" stroke="${r}" stroke-width="3.5" stroke-linejoin="round"/>`+[[30,22],[88,70],[52,82]].map(([t,e])=>`<polygon points="${m(t,e,7,2.5,4)}" fill="#fff"/>`).join("")),Tt={...Object.fromEntries([1,2,3,4,5,6,7].map(r=>[`mg_bake${r}`,he(r)])),...Object.fromEntries([1,2,3,4,5,6,7].map(r=>[`mg_jewel${r}`,$e(r)])),...Object.fromEntries([1,2,3,4,5,6,7].map(r=>[`mg_potion${r}`,pe(r)])),mg_gen_garden:ke,mg_gen_bake:ye,mg_gen_jewel:we,mg_gen_potion:ue,mg_box:Dt(false),mg_box2:Dt(true),mg_fog:xe,mg_web:ge,mg_bubble:me,mg_joker:Le,mg_scissors:be,mg_energy:Me,mg_bin:je,mg_sk_merge:Ae,mg_sk_free:Ce,mg_sk_joker:Qe};var Et={fantasy:{skyTop:"#3f6aa8",skyBottom:"#f4c98e",far1:"#7b8fb8",far2:"#566f94",near:"#2c5638",crust:"#6dbb45",soil:"#7a5232",deep:"#4e331e",floor:"#5f9a3e",detail:"#7ab552",road:"#a57d4f",edge:"#7a5a36",wall:"#e8d9b8",roof:"#b8483a"},"sci-fi":{skyTop:"#050816",skyBottom:"#3b1f63",far1:"#232b5c",far2:"#161c40",near:"#0e1430",crust:"#36e3ff",soil:"#2a3452",deep:"#151b30",floor:"#1b2340",detail:"#2a3762",road:"#2b3868",edge:"#36e3ff",wall:"#3a4a72",roof:"#232c4a"},cozy:{skyTop:"#8fd3ff",skyBottom:"#fff3d6",far1:"#b6e2a2",far2:"#8fcc7e",near:"#5fae5a",crust:"#8ed46f",soil:"#c98b5a",deep:"#9e6a42",floor:"#a8dc8a",detail:"#c6ecab",road:"#efc89a",edge:"#d9a676",wall:"#fff1e0",roof:"#ff8f8f"},"post-apocalypse":{skyTop:"#3b2a26",skyBottom:"#d0803e",far1:"#7a5442",far2:"#4e3a2e",near:"#2a201a",crust:"#5a5248",soil:"#6b6358",deep:"#3e3832",floor:"#5e5648",detail:"#4a4438",road:"#46423c",edge:"#2e2a26",wall:"#8a7a62",roof:"#5a3a2a"},default:{skyTop:"#25365e",skyBottom:"#7d9fd6",far1:"#4f6494",far2:"#3a4b72",near:"#283958",crust:"#5fae5a",soil:"#6b4a2e",deep:"#45301c",floor:"#3e5a46",detail:"#4b6a52",road:"#5a5f78",edge:"#454a60",wall:"#e6dccb",roof:"#5a6fae"}},Z=r=>Et[r]??Et.default,Ze={w:100,h:200,draw({style:r}){let t=Z(r),e="";if(r==="sci-fi"){let o=D(7);e=Array.from({length:60},()=>`<circle cx="${f(o()*100)}" cy="${f(o()*150)}" r="${f(.3+o()*.6)}" fill="#fff" opacity="${f(.3+o()*.7)}"/>`).join("");}return h(p("s",[[0,t.skyTop],[.75,q(t.skyTop,t.skyBottom,.7)],[1,t.skyBottom]]))+'<rect width="100" height="200" fill="url(#s)"/>'+e}},_e={w:100,h:100,draw({style:r}){if(r==="sci-fi")return h(p("p",[[0,"#ff9ad5"],[1,"#6a3cc8"]]),u("h",[[0,"#ff9ad5",.5],[1,"#ff9ad5",0]]))+'<circle cx="50" cy="50" r="48" fill="url(#h)"/><circle cx="50" cy="50" r="26" fill="url(#p)"/><ellipse cx="50" cy="52" rx="44" ry="9" fill="none" stroke="#ffd0f0" stroke-width="3" opacity="0.8" transform="rotate(-14 50 52)"/>';let t=r==="post-apocalypse"?"#ff7a3a":r==="cozy"?"#fff2a8":"#fff0c0",e=r==="post-apocalypse"?"#ff5a2a":"#fff6d0";return h(u("h",[[0,e,.85],[.45,e,.35],[1,e,0]]))+`<circle cx="50" cy="50" r="50" fill="url(#h)"/><circle cx="50" cy="50" r="20" fill="${t}"/>`}},it=(r,t,e,o,i,s)=>{let l=D(r),n=Array.from({length:s},()=>o-l()*i);n.push(n[0]);let a=n.map(($,y)=>`${f(y/s*t)},${f($)}`);return `M0 ${e} L${a.join(" L")} L${t} ${e}Z`},Re={w:512,h:200,band:true,draw({style:r}){let t=Z(r),e=q(t.far1,t.skyBottom,.35);if(r==="sci-fi"){let a=D(11),$=0,y="",w="";for(;$<500;){let x=26+Math.floor(a()*40),k=50+Math.floor(a()*130),g=Math.min(x,512-$);y+=`<rect x="${$}" y="${200-k}" width="${g}" height="${k}" fill="${a()<.5?t.far1:t.far2}"/>`,a()<.3&&(y+=`<rect x="${$+g/2-1}" y="${200-k-18}" width="2" height="18" fill="${t.far1}"/><circle cx="${$+g/2}" cy="${200-k-18}" r="2" fill="#ff3d6e"/>`);for(let L=200-k+8;L<196;L+=10)for(let b=$+4;b<$+g-4;b+=7)a()<.35&&(w+=`<rect x="${b}" y="${L}" width="3" height="4" fill="${a()<.5?"#36e3ff":"#ffd36e"}" opacity="0.8"/>`);$+=g+2;}return y+w}if(r==="post-apocalypse"){let a=D(13),$=6,y=`<path d="${it(3,512,200,170,22,8)}" fill="${e}"/>`;for(;$<490;){let w=30+Math.floor(a()*36),k=200-(60+Math.floor(a()*110)),g=a()*20;y+=`<path d="M${$} 200 L${$} ${k+g} L${$+w*.3} ${k} L${$+w*.55} ${k+14+g} L${$+w} ${k+6} L${$+w} 200Z" fill="${a()<.5?t.far1:t.far2}"/>`;for(let L=k+20;L<190;L+=14)for(let b=$+5;b<$+w-6;b+=10)a()<.5&&(y+=`<rect x="${b}" y="${L}" width="4" height="6" fill="${t.near}" opacity="0.7"/>`);$+=w+8+Math.floor(a()*20);}return y+'<ellipse cx="380" cy="60" rx="60" ry="14" fill="#2a1a14" opacity="0.25"/>'}if(r==="cozy"){let a=[80,230,400].map(($,y)=>`<rect x="${$}" y="${132-y*6}" width="22" height="18" fill="#fff4e8"/><polygon points="${$-3},${133-y*6} ${$+11},${120-y*6} ${$+25},${133-y*6}" fill="${["#ff8f8f","#8fb8ff","#ffb86b"][y]}"/><rect x="${$+8}" y="${140-y*6}" width="6" height="10" fill="#c98b5a"/>`).join("");return `<path d="${it(5,512,200,140,30,6)}" fill="${t.far1}"/>`+a+`<path d="${it(9,512,200,168,22,5)}" fill="${t.far2}"/>`+[40,170,300,460].map($=>`<circle cx="${$}" cy="158" r="12" fill="${c(t.far2,.12)}"/>`).join("")}let o=D(17),i=[],s=[],l=(a,$)=>{i.push(`M${f(a-110)} 200 L${f(a)} ${f($)} L${f(a+110)} 200Z`),s.push(`M${f(a-24)} ${f($+26)} L${f(a)} ${f($)} L${f(a+24)} ${f($+26)} L${f(a+10)} ${f($+20)} L${f(a)} ${f($+28)} L${f(a-10)} ${f($+20)}Z`);};for(let a=0;a<4;a++){let $=64+a*128+(o()-.5)*30,y=30+o()*40;l($,y),$-110<0&&l($+512,y),$+110>512&&l($-512,y);}let n=r==="fantasy"?`<g fill="${c(t.far2,.15)}"><rect x="300" y="120" width="40" height="80"/><rect x="292" y="104" width="14" height="96"/><rect x="334" y="100" width="14" height="100"/><polygon points="290,104 299,84 308,104"/><polygon points="332,100 341,78 350,100"/>${[300,310,320,330].map(a=>`<rect x="${a}" y="114" width="6" height="8"/>`).join("")}</g><rect x="340" y="82" width="10" height="6" fill="#d0483b"/>`:"";return `<path d="${i.join(" ")}" fill="${e}"/><path d="${s.join(" ")}" fill="#f4f6ff" opacity="0.85"/><path d="${it(21,512,200,160,40,9)}" fill="${t.far2}"/>`+n}},De={w:512,h:160,band:true,draw({style:r}){let t=Z(r),e=D(29),o=`<rect x="0" y="146" width="512" height="14" fill="${t.near}"/>`;if(r==="sci-fi"){let s=o;for(let l=30;l<500;l+=90+Math.floor(e()*40)){let n=60+e()*70;s+=`<rect x="${l}" y="${150-n}" width="8" height="${n}" fill="${t.near}"/><rect x="${l-14}" y="${150-n}" width="36" height="5" fill="${t.near}"/><circle cx="${l+4}" cy="${146-n}" r="3" fill="#36e3ff"/>`;}return s+=`<path d="M180 150 A40 40 0 0 1 260 150Z" fill="${t.near}"/><path d="M200 140 A22 22 0 0 1 240 140" stroke="#36e3ff" stroke-width="2" fill="none" opacity="0.7"/>`,s}if(r==="post-apocalypse"){let s=o,l=(n,a)=>`<path d="M${n} 150 L${n+3} ${150-a} M${n+2} ${150-a*.6} L${n-14} ${150-a*.85} M${n+2} ${150-a*.45} L${n+18} ${150-a*.7} M${n+3} ${150-a*.8} L${n+12} ${150-a}" stroke="${t.near}" stroke-width="5" stroke-linecap="round" fill="none"/>`;return s+=l(40,90)+l(300,110)+l(460,70),s+=`<rect x="150" y="18" width="5" height="132" fill="${t.near}"/><rect x="138" y="28" width="30" height="4" fill="${t.near}"/><path d="M0 34 Q75 54 152 30 Q260 58 360 34 Q440 50 512 34" stroke="${t.near}" stroke-width="1.5" fill="none"/>`,s+=`<path d="M180 150 L188 128 L232 124 L246 136 L262 138 L262 150Z" fill="${t.near}"/><circle cx="198" cy="150" r="8" fill="#1a120c"/><circle cx="246" cy="150" r="8" fill="#1a120c"/>`,s}if(r==="cozy"){let s=o;for(let l=20;l<500;l+=100+Math.floor(e()*30)){let n=50+e()*30;s+=`<rect x="${l+16}" y="${150-n*.5}" width="8" height="${n*.5}" fill="#9e6a42"/><circle cx="${l+20}" cy="${150-n*.6}" r="${n*.36}" fill="${t.near}"/><circle cx="${l+12}" cy="${150-n*.7}" r="${n*.12}" fill="${d(t.near,.25)}"/>`;}for(let l=4;l<512;l+=16)s+=`<rect x="${l}" y="128" width="8" height="22" rx="3" fill="#fff8f0"/>`;return s+='<rect x="0" y="134" width="512" height="4" fill="#fff8f0"/>',s}let i=o;for(let s=14;s<500;s+=44+Math.floor(e()*50)){let l=70+e()*60,n=l*.36;i+=`<rect x="${s-3}" y="${150-l*.18}" width="6" height="${l*.18}" fill="${c(t.near,.3)}"/>`;for(let a=0;a<3;a++){let $=150-l*.15-a*l*.26,y=n*(1-a*.25);i+=`<polygon points="${f(s-y)},${f($)} ${f(s)},${f($-l*.42)} ${f(s+y)},${f($)}" fill="${a===2?d(t.near,.08):t.near}"/>`;}}return i}};function vt(r,t){let e=Z(r.style);if(r.style==="sci-fi")return `<rect x="0" y="0" width="${t}" height="16" fill="#3a4a72"/><rect x="0" y="0" width="${t}" height="4" fill="${r.c("primary")}"/><rect x="0" y="14" width="${t}" height="3" fill="#11172a"/>`+[16,48,80,112].filter(i=>i<t).map(i=>`<rect x="${i}" y="6" width="14" height="4" rx="2" fill="${r.c("primary")}" opacity="0.5"/>`).join("");if(r.style==="post-apocalypse")return `<path d="M0 0 L${t} 0 L${t} 14 L${t*.8} 18 L${t*.62} 12 L${t*.4} 20 L${t*.2} 13 L0 16Z" fill="#3a3530"/><path d="M${t*.15} 4 L${t*.3} 8 M${t*.6} 3 L${t*.75} 9" stroke="#24201c" stroke-width="2"/>`;if(r.style==="cozy"){let i="";for(let s=0;s<t;s+=32)i+=`<circle cx="${s+16}" cy="14" r="16" fill="${e.crust}"/>`;return `<rect x="0" y="0" width="${t}" height="14" fill="${e.crust}"/>${i}<circle cx="${t*.3}" cy="8" r="3" fill="#fff"/><circle cx="${t*.75}" cy="10" r="3" fill="#ff8fab"/>`}let o="";for(let i=2;i<t;i+=8)o+=`<polygon points="${i},12 ${i+3},${2+i*7%5} ${i+6},12" fill="${d(e.crust,.15)}"/>`;return `<rect x="0" y="6" width="${t}" height="16" fill="${e.crust}"/>${o}<rect x="0" y="20" width="${t}" height="4" fill="${c(e.crust,.3)}"/>`}var Te={w:128,h:512,draw(r){let t=Z(r.style),e=D(41),o="";for(let i=0;i<14;i++)o+=`<ellipse cx="${f(8+e()*112)}" cy="${f(40+e()*460)}" rx="${f(4+e()*7)}" ry="${f(3+e()*4)}" fill="${c(t.soil,.2+e()*.15)}"/>`;return r.style==="sci-fi"&&(o=[80,180,280,380].map(i=>`<rect x="0" y="${i}" width="128" height="2" fill="#11172a"/>`).join("")+'<rect x="62" y="20" width="2" height="492" fill="#11172a"/>'+[100,300].map(i=>`<circle cx="20" cy="${i}" r="3" fill="#4a5a88"/><circle cx="108" cy="${i}" r="3" fill="#4a5a88"/>`).join("")),h(p("d",[[0,t.soil],[1,t.deep]]))+'<rect width="128" height="512" fill="url(#d)"/>'+o+vt(r,128)}},Ee={w:128,h:40,draw(r){let t=Z(r.style);return h(p("d",[[0,t.soil],[1,t.deep]]))+'<path d="M0 10 L128 10 L128 26 Q96 40 64 36 Q32 40 0 26Z" fill="url(#d)"/>'+vt(r,128)+`<path d="M0 26 Q32 40 64 36 Q96 40 128 26" stroke="${r.ink}" stroke-width="2.5" fill="none" opacity="0.5"/>`}},ve={w:128,h:100,draw(r){let t=Z(r.style);if(r.style==="sci-fi")return `<rect width="128" height="100" fill="${t.road}"/><rect y="0" width="128" height="5" fill="${r.c("primary")}" opacity="0.8"/><rect y="95" width="128" height="5" fill="${r.c("primary")}" opacity="0.8"/><path d="M40 38 L58 50 L40 62 M74 38 L92 50 L74 62" stroke="${r.c("primary")}" stroke-width="5" fill="none" opacity="0.35"/>`;if(r.style==="cozy"){let s="";for(let l=0;l<5;l++)for(let n=l%2*-16;n<128;n+=32)s+=`<rect x="${n+1}" y="${l*20+1}" width="30" height="18" rx="4" fill="${l%2?t.road:d(t.road,.08)}" stroke="${t.edge}" stroke-width="2"/>`;return `<rect width="128" height="100" fill="${t.edge}"/>${s}`}let e=D(53),o="";for(let s=0;s<12;s++)o+=`<ellipse cx="${f(e()*128)}" cy="${f(10+e()*80)}" rx="${f(2+e()*3)}" ry="${f(1.5+e()*2)}" fill="${c(t.road,.25)}"/>`;let i=r.style==="post-apocalypse"?'<rect x="20" y="47" width="40" height="6" fill="#c9a43a" opacity="0.75"/><path d="M80 20 L96 36 L90 52" stroke="#2a2622" stroke-width="2" fill="none"/>':"";return `<rect width="128" height="100" fill="${t.road}"/><rect width="128" height="6" fill="${t.edge}"/><rect y="94" width="128" height="6" fill="${t.edge}"/>${o}${i}`}},ze={w:128,h:128,draw({style:r}){let t=Z(r),e=D(61),o="";if(r==="sci-fi")o=`<rect x="2" y="2" width="60" height="60" rx="4" fill="${t.detail}"/><rect x="66" y="66" width="60" height="60" rx="4" fill="${t.detail}"/><rect x="66" y="2" width="60" height="60" rx="4" fill="${d(t.floor,.05)}"/><rect x="2" y="66" width="60" height="60" rx="4" fill="${d(t.floor,.05)}"/><rect x="62" y="0" width="4" height="128" fill="#36e3ff" opacity="0.18"/><rect x="0" y="62" width="128" height="4" fill="#36e3ff" opacity="0.18"/>`;else if(r==="post-apocalypse")o=`<path d="M10 20 L40 44 L36 70 L60 96 M80 10 L92 40 L120 52 M70 80 L100 110" stroke="${t.detail}" stroke-width="2.5" fill="none"/>`;else for(let i=0;i<18;i++){let s=6+e()*116,l=6+e()*116;o+=`<path d="M${f(s)} ${f(l)} l-3 -6 M${f(s)} ${f(l)} l0 -7 M${f(s)} ${f(l)} l3 -6" stroke="${t.detail}" stroke-width="2" stroke-linecap="round"/>`,r==="cozy"&&i%5===0&&(o+=`<circle cx="${f(s+6)}" cy="${f(l)}" r="2.5" fill="${["#fff","#ff8fab","#ffd166"][i%3]}"/>`);}return `<rect width="128" height="128" fill="${t.floor}"/>${o}`}},Pe=r=>({w:64,h:64,draw({style:t,ink:e}){let o=Z(t),i='<ellipse cx="32" cy="50" rx="20" ry="6" fill="#000" opacity="0.22"/>';if(t==="sci-fi"){let n=[`<rect x="14" y="16" width="36" height="32" rx="4" fill="#4a5a80" stroke="${e}" stroke-width="3"/><rect x="20" y="24" width="24" height="5" fill="#36e3ff"/>`,`<circle cx="32" cy="32" r="16" fill="#2a3452" stroke="${e}" stroke-width="3"/>${[0,1,2,3].map(a=>`<rect x="22" y="${23+a*5}" width="20" height="2" fill="#11172a"/>`).join("")}`,`<rect x="6" y="28" width="52" height="10" rx="5" fill="#5d6f96" stroke="${e}" stroke-width="3"/><circle cx="18" cy="33" r="3" fill="#ff3d6e"/>`,'<circle cx="32" cy="32" r="8" fill="#b45cff"/><circle cx="32" cy="32" r="14" fill="none" stroke="#b45cff" stroke-width="2" opacity="0.5"/>'];return i+n[(r-1)%4]}if(t==="post-apocalypse"){let n=[`<circle cx="32" cy="32" r="18" fill="#1e1a16" stroke="${e}" stroke-width="3"/><circle cx="32" cy="32" r="8" fill="${o.floor}"/>`,`<circle cx="32" cy="32" r="16" fill="#8a3d24" stroke="${e}" stroke-width="3"/><circle cx="32" cy="32" r="10" fill="none" stroke="#5a2814" stroke-width="2"/>`,`<polygon points="10,40 22,22 38,30 52,18 54,44 30,48" fill="#6b6358" stroke="${e}" stroke-width="3" stroke-linejoin="round"/>`,'<path d="M20 44 L24 20 M32 46 L32 16 M42 44 L38 22" stroke="#7a6a3a" stroke-width="3" stroke-linecap="round"/>'];return i+n[(r-1)%4]}let s=t==="cozy"?"#6fc46a":"#3f7f3a",l=[`<circle cx="22" cy="34" r="12" fill="${s}" stroke="${e}" stroke-width="3"/><circle cx="42" cy="34" r="12" fill="${s}" stroke="${e}" stroke-width="3"/><circle cx="32" cy="24" r="13" fill="${d(s,.1)}" stroke="${e}" stroke-width="3"/>`,`<path d="M12 44 Q14 22 32 20 Q50 22 52 44Z" fill="#9aa0a8" stroke="${e}" stroke-width="3"/><path d="M22 28 Q30 24 36 26" stroke="#fff" stroke-width="3" opacity="0.5" fill="none"/>`,[[22,28],[40,24],[32,40],[46,40]].map(([n,a],$)=>`<polygon points="${m(n,a,7,3,5)}" fill="${["#ff8fab","#ffd166","#fff","#c39bff"][$]}" stroke="${e}" stroke-width="1.5"/>`).join(""),t==="cozy"?`<rect x="28" y="30" width="8" height="16" fill="#fff4e6" stroke="${e}" stroke-width="2.5"/><path d="M14 32 Q32 8 50 32Z" fill="#ff6b6b" stroke="${e}" stroke-width="3"/><circle cx="26" cy="24" r="3" fill="#fff"/><circle cx="38" cy="26" r="2.5" fill="#fff"/>`:`<ellipse cx="32" cy="38" rx="16" ry="9" fill="#8a5a32" stroke="${e}" stroke-width="3"/><ellipse cx="32" cy="34" rx="16" ry="9" fill="#c49a6a" stroke="${e}" stroke-width="3"/><ellipse cx="32" cy="34" rx="8" ry="4" fill="none" stroke="#8a5a32" stroke-width="2"/>`];return i+l[(r-1)%4]}}),Oe={w:0,h:0,exact:true,main:"ground",draw({style:r,w:t,h:e}){let o=Z(r),i=D(Math.round(t*13+e)),s="";for(let l=0;l<4;l++){let n=t*(.15+i()*.7),a=e*(.2+i()*.65);s+=r==="sci-fi"?`<circle cx="${f(n)}" cy="${f(a)}" r="${f(t*.02)}" fill="#4a5a88"/>`:`<path d="M${f(n)} ${f(a)} l${f(-t*.04)} ${f(-e*.08)} M${f(n)} ${f(a)} l0 ${f(-e*.1)} M${f(n)} ${f(a)} l${f(t*.04)} ${f(-e*.08)}" stroke="${o.detail}" stroke-width="${f(t*.025)}" stroke-linecap="round"/>`;}return `<rect width="${t}" height="${e}" fill="${o.floor}"/><rect x="0.5" y="0.5" width="${t-1}" height="${e-1}" fill="none" stroke="${c(o.floor,.25)}" stroke-opacity="0.35" stroke-width="1"/>${s}`}},Ie={w:0,h:0,exact:true,main:"lane",draw({style:r,w:t,h:e,c:o}){let i=Z(r),s=D(Math.round(t*7+e*3)),l="";for(let a=0;a<5;a++)l+=`<ellipse cx="${f(t*(.15+s()*.7))}" cy="${f(e*(.15+s()*.7))}" rx="${f(t*(.04+s()*.05))}" ry="${f(e*.035)}" fill="${c(i.road,.18)}"/>`;let n=r==="sci-fi"?`<rect x="${f(t*.42)}" y="${f(e*.42)}" width="${f(t*.16)}" height="${f(e*.16)}" rx="2" fill="${o("primary")}" opacity="0.45"/>`:"";return `<rect width="${t}" height="${e}" fill="${i.road}"/>${l}${n}`}},Se=r=>({w:100,h:130,main:"primary",draw({style:t,ink:e,main:o,c:i}){let s='<ellipse cx="50" cy="122" rx="38" ry="8" fill="#000" opacity="0.28"/>';if(t==="sci-fi"||t==="post-apocalypse"){let k=t==="sci-fi"?"#5d6f96":"#7a6a52",g=t==="sci-fi"?o:i("coin"),L=Array.from({length:r},(T,It)=>`<rect x="50" y="${52-(r-1)*5+It*10}" width="${36+r*2}" height="8" rx="3" fill="${c(k,.25)}" stroke="${e}" stroke-width="2.5"/>`).join(""),b=t==="post-apocalypse"?[0,1,2].map(T=>`<ellipse cx="${26+T*24}" cy="106" rx="14" ry="9" fill="#a89070" stroke="${e}" stroke-width="2.5"/>`).join("")+[0,1].map(T=>`<ellipse cx="${38+T*24}" cy="94" rx="14" ry="9" fill="#b8a080" stroke="${e}" stroke-width="2.5"/>`).join(""):`<polygon points="${j(50,100,34,6,0)}" fill="#2a3452" stroke="${e}" stroke-width="3.5"/><polygon points="${j(50,100,22,6,0)}" fill="${g}" opacity="0.4"/>`;return s+b+`<rect x="38" y="64" width="24" height="30" fill="${k}" stroke="${e}" stroke-width="3"/>`+L+`<path d="M24 68 A26 26 0 0 1 76 68Z" fill="${d(k,.15)}" stroke="${e}" stroke-width="3.5"/><circle cx="50" cy="56" r="${5+r}" fill="${g}" stroke="${e}" stroke-width="2.5"/>`}let l=t==="cozy"?"#f4e6d4":"#a7a9b2",n=t==="cozy"?i("primary"):o,a=70-r*14,$="";for(let k=a+10;k<112;k+=12)$+=`<line x1="26" y1="${k}" x2="74" y2="${k}" stroke="${c(l,.25)}" stroke-width="2"/>`+[0,1].map(g=>`<line x1="${36+g*16+k/12%2*8}" y1="${k}" x2="${36+g*16+k/12%2*8}" y2="${k+12}" stroke="${c(l,.25)}" stroke-width="2"/>`).join("");let y=[26,40,54,68].map(k=>`<rect x="${k}" y="${a-10}" width="8" height="12" fill="${l}" stroke="${e}" stroke-width="2.5"/>`).join(""),w=r>=2?`<polygon points="20,${a-2} 50,${a-44} 80,${a-2}" fill="${n}" stroke="${e}" stroke-width="3.5" stroke-linejoin="round"/><polygon points="20,${a-2} 50,${a-44} 40,${a-2}" fill="${d(n,.2)}"/>`:y,x=r>=3?`<line x1="50" y1="${a-44}" x2="50" y2="${a-64}" stroke="${e}" stroke-width="3"/><path d="M50 ${a-64} L70 ${a-58} L50 ${a-52}Z" fill="${i("coin")}" stroke="${e}" stroke-width="2"/>`:"";return s+h(p("s",[[0,d(l,.2)],[1,c(l,.2)]],true))+`<rect x="24" y="${a}" width="52" height="${116-a}" fill="url(#s)" stroke="${e}" stroke-width="3.5"/>`+$+`<rect x="44" y="${a+16}" width="12" height="18" rx="6" fill="#2a2030" stroke="${e}" stroke-width="2.5"/><path d="M42 116 L42 100 A8 8 0 0 1 58 100 L58 116Z" fill="#6a4628" stroke="${e}" stroke-width="2.5"/>`+w+x}}),He=r=>({w:120,h:120,main:`piece${r}`,draw({style:t,ink:e,main:o,c:i}){let s=Z(t),l=t==="cozy"?d(o,.6):s.wall,n=t==="sci-fi"?i("primary"):t==="post-apocalypse"?"#3a3530":"#9fd2f0",a=(w,x,k=12,g=14)=>`<rect x="${w}" y="${x}" width="${k}" height="${g}" rx="2" fill="${n}" stroke="${e}" stroke-width="2"/>`+(t==="post-apocalypse"?`<path d="M${w} ${x+3} L${w+k} ${x+g-3}" stroke="#8a6a3a" stroke-width="3"/>`:`<rect x="${w+2}" y="${x+2}" width="${k*.3}" height="${g*.4}" fill="#fff" opacity="0.5"/>`),$='<ellipse cx="60" cy="114" rx="50" ry="6" fill="#000" opacity="0.25"/>',y=(w,x,k)=>{let g="";for(let L=0;L<k;L+=12)g+=`<path d="M${w+L} ${x} h12 v10 q-6 6 -12 0Z" fill="${L/12%2?"#fff":o}" stroke="${e}" stroke-width="2"/>`;return g};switch(r){case 1:return $+`<rect x="22" y="64" width="76" height="46" fill="${l}" stroke="${e}" stroke-width="3"/><rect x="16" y="60" width="88" height="8" fill="${c(l,.2)}" stroke="${e}" stroke-width="3"/><rect x="28" y="30" width="4" height="34" fill="${e}"/><rect x="88" y="30" width="4" height="34" fill="${e}"/>`+y(22,24,76)+`<circle cx="44" cy="56" r="6" fill="${i("coin")}" stroke="${e}" stroke-width="2"/><circle cx="60" cy="54" r="7" fill="${o}" stroke="${e}" stroke-width="2"/><circle cx="76" cy="56" r="6" fill="${i("accent")}" stroke="${e}" stroke-width="2"/>`;case 2:return $+`<rect x="18" y="40" width="84" height="70" fill="${l}" stroke="${e}" stroke-width="3"/><polygon points="12,42 60,14 108,42" fill="${s.roof}" stroke="${e}" stroke-width="3" stroke-linejoin="round"/>`+y(22,54,76)+a(28,72,28,24)+`<rect x="68" y="72" width="22" height="38" fill="${c(o,.2)}" stroke="${e}" stroke-width="3"/>`;case 3:return $+`<rect x="20" y="26" width="80" height="84" fill="${l}" stroke="${e}" stroke-width="3"/><rect x="14" y="18" width="92" height="10" fill="${s.roof}" stroke="${e}" stroke-width="3"/>`+a(30,36)+a(54,36)+a(78,36)+y(20,62,80)+a(30,78,26,22)+`<rect x="66" y="78" width="22" height="32" fill="${c(o,.25)}" stroke="${e}" stroke-width="3"/><rect x="42" y="4" width="36" height="16" rx="4" fill="${o}" stroke="${e}" stroke-width="2.5"/><path d="M54 8 h10 v6 a4 4 0 0 1 -10 0Z" fill="#fff"/>`;case 4:return $+`<rect x="80" y="14" width="12" height="40" fill="${c(s.wall,.35)}" stroke="${e}" stroke-width="3"/><circle cx="90" cy="8" r="7" fill="#cfcfd8" opacity="0.75"/><circle cx="100" cy="2" r="5" fill="#cfcfd8" opacity="0.5"/><path d="M12 110 L12 50 L36 36 L36 50 L60 36 L60 50 L84 36 L84 50 L108 50 L108 110Z" fill="${c(l,.08)}" stroke="${e}" stroke-width="3" stroke-linejoin="round"/>`+a(22,62)+a(46,62)+a(70,62)+`<rect x="40" y="84" width="40" height="26" fill="${o}" stroke="${e}" stroke-width="3"/>`+[0,1,2].map(w=>`<line x1="40" y1="${90+w*7}" x2="80" y2="${90+w*7}" stroke="${c(o,.35)}" stroke-width="2"/>`).join("");case 5:return $+`<polygon points="8,42 60,12 112,42" fill="${d(s.wall,.15)}" stroke="${e}" stroke-width="3" stroke-linejoin="round"/><circle cx="60" cy="32" r="8" fill="${i("coin")}" stroke="${e}" stroke-width="2.5"/><rect x="14" y="42" width="92" height="8" fill="${c(s.wall,.1)}" stroke="${e}" stroke-width="3"/>`+[20,40,72,92].map(w=>`<rect x="${w}" y="50" width="8" height="52" fill="${d(s.wall,.2)}" stroke="${e}" stroke-width="2.5"/>`).join("")+`<rect x="50" y="62" width="20" height="40" fill="${o}" stroke="${e}" stroke-width="3"/><rect x="10" y="102" width="100" height="8" fill="${c(s.wall,.15)}" stroke="${e}" stroke-width="3"/>`;default:{let w="";for(let x=22;x<92;x+=18)w+=a(40,x,12,12)+a(62,x,12,12);return $+`<rect x="58" y="2" width="3" height="14" fill="${e}"/><circle cx="59.5" cy="2" r="3" fill="${i("danger")}"/><rect x="32" y="14" width="56" height="96" fill="${t==="cozy"?l:q(s.wall,o,.25)}" stroke="${e}" stroke-width="3"/>`+w+`<rect x="50" y="94" width="20" height="16" fill="${c(o,.25)}" stroke="${e}" stroke-width="2.5"/>`}}}}),zt={sky:Ze,sun:_e,far:Re,near:De,ground:Te,platform:Ee,road:ve,floor:ze,tile_grass:Oe,tile_road:Ie,...Object.fromEntries([1,2,3,4].map(r=>[`decor${r}`,Pe(r)])),...Object.fromEntries([1,2,3].map(r=>[`tower${r}`,Se(r)])),...Object.fromEntries([1,2,3,4,5,6].map(r=>[`biz${r}`,He(r)]))};var Y=(r,t,e,o,i=.28)=>`<ellipse cx="${r}" cy="${t}" rx="${e}" ry="${o}" fill="#000" opacity="${i}"/>`,$t=(r,t=4,e=.55)=>`<path d="${r}" fill="none" stroke="#fff" stroke-width="${t}" stroke-linecap="round" opacity="${e}"/>`,I=r=>({w:100,h:100,draw:({ink:t})=>r(t)}),Ne={w:120,h:120,main:"danger",draw({style:r,ink:t,main:e,c:o}){let i=Z(r),s=Array.from({length:9},(l,n)=>`<circle cx="${24+n*9}" cy="30" r="2.6" fill="${o("coin")}" stroke="${t}" stroke-width="1"/>`).join("");return Y(60,114,50,6,.25)+`<rect x="14" y="40" width="92" height="70" fill="${i.wall}" stroke="${t}" stroke-width="3"/><rect x="10" y="18" width="100" height="24" rx="4" fill="${e}" stroke="${t}" stroke-width="3"/>`+s+`<rect x="34" y="46" width="52" height="22" rx="3" fill="${c(i.wall,.6)}" stroke="${t}" stroke-width="2.5"/><polygon points="54,51 54,63 66,57" fill="${o("coin")}"/><rect x="24" y="76" width="30" height="34" fill="${c(e,.25)}" stroke="${t}" stroke-width="3"/><rect x="66" y="76" width="30" height="34" fill="${c(e,.25)}" stroke="${t}" stroke-width="3"/><line x1="39" y1="76" x2="39" y2="110" stroke="${t}" stroke-width="2"/><line x1="81" y1="76" x2="81" y2="110" stroke="${t}" stroke-width="2"/><polygon points="${m(60,9,8,3.5)}" fill="${o("coin")}" stroke="${t}" stroke-width="2"/>`}},qe={w:120,h:120,main:"primary",draw({style:r,ink:t,main:e,c:o}){let i=Z(r);return Y(60,114,52,6,.25)+`<path d="M8 110 L8 84 Q60 62 112 84 L112 110Z" fill="${i.wall}" stroke="${t}" stroke-width="3" stroke-linejoin="round"/><rect x="16" y="90" width="14" height="10" rx="2" fill="#9fd2f0" stroke="${t}" stroke-width="2"/><rect x="90" y="90" width="14" height="10" rx="2" fill="#9fd2f0" stroke="${t}" stroke-width="2"/><rect x="78" y="22" width="6" height="66" fill="${c(i.wall,.35)}" stroke="${t}" stroke-width="2.5"/>`+[34,50,66].map(s=>`<line x1="84" y1="${s}" x2="70" y2="${s}" stroke="${t}" stroke-width="2.5"/>`).join("")+`<path d="M60 6 Q72 22 70 64 L50 64 Q48 22 60 6Z" fill="${d(e,.75)}" stroke="${t}" stroke-width="3" stroke-linejoin="round"/><circle cx="60" cy="34" r="6" fill="#9fd2f0" stroke="${t}" stroke-width="2.5"/><path d="M50 52 L40 70 L50 66Z M70 52 L80 70 L70 66Z" fill="${e}" stroke="${t}" stroke-width="2.5" stroke-linejoin="round"/><path d="M54 64 L60 82 L66 64Z" fill="${o("coin")}" stroke="${t}" stroke-width="2"/><path d="M57 64 L60 74 L63 64Z" fill="#fff"/>`}},Pt=(r,t)=>I(e=>`<circle cx="50" cy="50" r="44" fill="${d(r,.7)}" stroke="${e}" stroke-width="4"/><path d="M50 12 L76 40 L60 40 L60 62 L40 62 L40 40 L24 40Z" fill="${r}" stroke="${e}" stroke-width="3.5" stroke-linejoin="round"/><text x="50" y="88" text-anchor="middle" font-family="Arial, sans-serif" font-weight="900" font-size="24" fill="${e}">${t}</text>`),Fe=I(r=>`<circle cx="50" cy="50" r="44" fill="#ffe8a8" stroke="${r}" stroke-width="4"/>`+[30,50,70].map((t,e)=>`<path d="M${t} ${16+(e===1?0:8)} L${t+13} ${32+(e===1?0:8)} L${t+6} ${32+(e===1?0:8)} L${t+6} 56 L${t-6} 56 L${t-6} ${32+(e===1?0:8)} L${t-13} ${32+(e===1?0:8)}Z" fill="#ffb21a" stroke="${r}" stroke-width="2.5" stroke-linejoin="round"/>`).join("")+`<text x="50" y="88" text-anchor="middle" font-family="Arial, sans-serif" font-weight="900" font-size="24" fill="${r}">\xD72</text>`),Be=I(r=>h(u("r",[[0,"#fff6a0"],[1,"#ff7a1a"]],.5,.6))+`<path d="M50 8 Q70 30 66 46 Q78 40 76 26 Q92 46 86 66 Q80 90 50 92 Q20 90 14 66 Q10 46 26 30 Q28 46 38 48 Q30 26 50 8Z" fill="url(#r)" stroke="${r}" stroke-width="3.5" stroke-linejoin="round"/><text x="50" y="76" text-anchor="middle" font-family="Arial, sans-serif" font-weight="900" font-size="30" fill="#fff" stroke="${r}" stroke-width="2">\xD73</text>`),We=I(r=>Y(50,92,24,4)+`<path d="M30 80 L62 46" stroke="${r}" stroke-width="16" stroke-linecap="round"/><path d="M30 80 L62 46" stroke="#a8b2c2" stroke-width="10" stroke-linecap="round"/><path d="M58 24 A20 20 0 1 0 80 50 L70 50 L62 42 L62 30Z" fill="#c8d0dc" stroke="${r}" stroke-width="3.5" stroke-linejoin="round"/>`+$t("M66 22 Q76 24 80 32",3,.7)+`<circle cx="26" cy="22" r="10" fill="#e8384a" stroke="${r}" stroke-width="3"/><path d="M26 15 L26 23 M26 27 L26 28" stroke="#fff" stroke-width="3.5" stroke-linecap="round"/>`),Ge=I(r=>h(p("c",[[0,"#8a5a32"],[1,"#5a381c"]]))+Y(50,90,34,5)+`<path d="M38 26 L38 18 Q38 14 42 14 L58 14 Q62 14 62 18 L62 26" fill="none" stroke="${r}" stroke-width="5"/><rect x="12" y="26" width="76" height="56" rx="8" fill="url(#c)" stroke="${r}" stroke-width="4"/><line x1="12" y1="46" x2="88" y2="46" stroke="${r}" stroke-width="3"/><rect x="44" y="40" width="12" height="12" rx="2" fill="#ffc83a" stroke="${r}" stroke-width="2.5"/><text x="50" y="74" text-anchor="middle" font-family="Arial, sans-serif" font-weight="900" font-size="20" fill="#ffd34a">$</text>`+$t("M20 32 L40 32",3,.5)),Ve=I(r=>`<circle cx="50" cy="50" r="44" fill="#d8ecff" stroke="${r}" stroke-width="4"/><circle cx="50" cy="36" r="14" fill="#f4c9a0" stroke="${r}" stroke-width="3"/><path d="M36 30 Q50 14 64 30 Q60 22 50 22 Q40 22 36 30Z" fill="#5a381c" stroke="${r}" stroke-width="2"/><path d="M22 86 Q22 56 50 54 Q78 56 78 86Z" fill="#3a4a72" stroke="${r}" stroke-width="3" stroke-linejoin="round"/><path d="M46 56 L54 56 L56 76 L50 82 L44 76Z" fill="#e8384a" stroke="${r}" stroke-width="2" stroke-linejoin="round"/>`),Ue=I(r=>`<circle cx="48" cy="54" r="34" fill="#fff" stroke="${r}" stroke-width="4"/><path d="M48 54 L48 32 M48 54 L64 62" stroke="${r}" stroke-width="5" stroke-linecap="round"/><path d="M74 10 Q86 22 82 34 Q92 30 90 20 Q100 34 92 46 Q84 56 72 50 Q62 42 68 30 Q72 36 76 34 Q70 22 74 10Z" fill="#ff7a1a" stroke="${r}" stroke-width="2.5" stroke-linejoin="round"/><rect x="40" y="12" width="16" height="8" rx="3" fill="#8a96aa" stroke="${r}" stroke-width="2.5"/>`),Xe=I(r=>h(u("i",[[0,"#fff6a0"],[1,"#ffb000"]],.45,.4))+`<circle cx="50" cy="50" r="42" fill="url(#i)" stroke="${r}" stroke-width="4"/><path d="M58 10 L28 54 L48 54 L40 90 L74 42 L54 42Z" fill="#fff" stroke="${r}" stroke-width="3.5" stroke-linejoin="round"/>`+[[18,24],[82,74],[20,78]].map(([t,e])=>`<polygon points="${m(t,e,7,2.5,4)}" fill="#fff" stroke="${r}" stroke-width="1.5"/>`).join("")),Ye=I(r=>Y(50,92,24,4)+`<path d="M14 46 L46 12 L86 12 L86 52 L52 86Z" fill="#ff5a7a" stroke="${r}" stroke-width="4" stroke-linejoin="round"/><circle cx="72" cy="26" r="7" fill="#fff" stroke="${r}" stroke-width="3"/><text x="54" y="62" text-anchor="middle" font-family="Arial, sans-serif" font-weight="900" font-size="24" fill="#fff" stroke="${r}" stroke-width="1.5" transform="rotate(-45 54 54)">%</text>`+$t("M48 18 L24 44",3,.6)),Ot={ty_cinema:Ne,ty_port:qe,ty_up:Pt("#5ad35a","\xD72"),ty_up3:Pt("#4aa8ff","\xD73"),ty_upall:Fe,ty_rush:Be,ty_wrench:We,ty_investor:Ge,ty_manager:Ve,ty_sk_rush:Ue,ty_sk_instant:Xe,ty_sk_sale:Ye};var pt=Object.freeze({...gt,...Lt,...bt,...Mt,...At,..._t,...Tt,...Ot,...zt,...mt}),Go=r=>Object.prototype.hasOwnProperty.call(pt,r);function Vo(r,t){let e=pt[r];return e?e.exact?t.w/Math.max(1,t.h):e.w/e.h:1}function Uo(r,t){let e=pt[r];if(!e)return null;let{palette:o,style:i,box:s,px:l}=t,n=g=>wt(g,o),a=e.exact?s.w:e.w,$=e.exact?s.h:e.h,y=e.draw({style:i,c:n,main:n(t.color??e.main??"primary"),ink:ut(i),w:a,h:$}),w=Math.max(1,Math.round(l.h)),x=Math.max(0,Math.round(t.padBottom??0)),k=x>0?$*(w+x)/w:$;return `<svg xmlns="http://www.w3.org/2000/svg" width="${Math.max(1,Math.round(l.w))}" height="${w+x}" viewBox="0 0 ${a} ${k}" preserveAspectRatio="none">${y}</svg>`}
2
+ export{st as a,lt as b,kt as c,ro as d,io as e,so as f,yt as g,wt as h,lo as i,no as j,co as k,qt as l,ao as m,fo as n,pt as o,Go as p,Vo as q,Uo as r};