@guilhermebkel/scenec 0.0.0-stage → 0.1.2

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.
Files changed (78) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +242 -2
  3. package/dist/catalog.d.ts +21 -0
  4. package/dist/catalog.js +35 -0
  5. package/dist/cli.d.ts +2 -0
  6. package/dist/cli.js +118 -0
  7. package/dist/data/europe.json +1 -0
  8. package/dist/drawing/assets.d.ts +8 -0
  9. package/dist/drawing/assets.js +612 -0
  10. package/dist/drawing/kits.d.ts +7 -0
  11. package/dist/drawing/kits.js +92 -0
  12. package/dist/drawing/person.d.ts +18 -0
  13. package/dist/drawing/person.js +287 -0
  14. package/dist/drawing/themes.d.ts +4 -0
  15. package/dist/drawing/themes.js +45 -0
  16. package/dist/index.d.ts +6 -0
  17. package/dist/index.js +2 -0
  18. package/dist/modes/map.d.ts +5 -0
  19. package/dist/modes/map.js +365 -0
  20. package/dist/modes/plane.d.ts +5 -0
  21. package/dist/modes/plane.js +716 -0
  22. package/dist/pipeline/compile.d.ts +2 -0
  23. package/dist/pipeline/compile.js +581 -0
  24. package/dist/pipeline/custom.d.ts +2 -0
  25. package/dist/pipeline/custom.js +120 -0
  26. package/dist/pipeline/groups.d.ts +2 -0
  27. package/dist/pipeline/groups.js +189 -0
  28. package/dist/pipeline/index.d.ts +16 -0
  29. package/dist/pipeline/index.js +7 -0
  30. package/dist/pipeline/parse.d.ts +10 -0
  31. package/dist/pipeline/parse.js +80 -0
  32. package/dist/protocols/options.d.ts +14 -0
  33. package/dist/protocols/options.js +1 -0
  34. package/dist/protocols/scene.d.ts +299 -0
  35. package/dist/protocols/scene.js +118 -0
  36. package/dist/protocols/theme.d.ts +25 -0
  37. package/dist/protocols/theme.js +1 -0
  38. package/dist/render/check.d.ts +6 -0
  39. package/dist/render/check.js +10 -0
  40. package/dist/render/critic.d.ts +1 -0
  41. package/dist/render/critic.js +235 -0
  42. package/dist/render/files.d.ts +2 -0
  43. package/dist/render/files.js +16 -0
  44. package/dist/render/fonts.d.ts +2 -0
  45. package/dist/render/fonts.js +4 -0
  46. package/dist/render/png.d.ts +9 -0
  47. package/dist/render/png.js +13 -0
  48. package/dist/render.d.ts +5 -0
  49. package/dist/render.js +3 -0
  50. package/dist/schema.d.ts +3 -0
  51. package/dist/schema.js +6 -0
  52. package/dist/utils/color.d.ts +5 -0
  53. package/dist/utils/color.js +35 -0
  54. package/dist/utils/recolor.d.ts +1 -0
  55. package/dist/utils/recolor.js +56 -0
  56. package/dist/utils/sanitize.d.ts +5 -0
  57. package/dist/utils/sanitize.js +169 -0
  58. package/dist/utils/suggest.d.ts +1 -0
  59. package/dist/utils/suggest.js +22 -0
  60. package/dist/utils/svg.d.ts +2 -0
  61. package/dist/utils/svg.js +11 -0
  62. package/fonts/OFL.txt +50 -0
  63. package/fonts/Poppins-Bold.ttf +0 -0
  64. package/fonts/Poppins-Medium.ttf +0 -0
  65. package/fonts/Poppins-Regular.ttf +0 -0
  66. package/package.json +96 -4
  67. package/skills/scenec/SKILL.md +46 -0
  68. package/skills/scenec/recipes/anuncios-variacoes.yaml +58 -0
  69. package/skills/scenec/recipes/carrossel.yaml +58 -0
  70. package/skills/scenec/recipes/elearning.yaml +64 -0
  71. package/skills/scenec/recipes/historia-ilustrada.yaml +48 -0
  72. package/skills/scenec/recipes/ilustracoes-produto.yaml +44 -0
  73. package/skills/scenec/recipes/mapas-jornadas.yaml +27 -0
  74. package/skills/scenec/recipes/reels-explicativo.yaml +41 -0
  75. package/skills/scenec/recipes/wrapped-personalizado.yaml +64 -0
  76. package/skills/scenec/references/catalog.md +125 -0
  77. package/skills/scenec/references/dsl.md +111 -0
  78. package/skills/scenec/references/fontes.md +8 -0
@@ -0,0 +1,612 @@
1
+ // Biblioteca de assets (estilo próprio, flat com segunda tonalidade de luz/sombra).
2
+ // Cada asset desenha em unidades (pessoa em pé = 100), com origem no centro da base
3
+ // (y negativo = para cima). Metadados: kind (onde pode ficar), w/h (caixa),
4
+ // top (altura da superfície de apoio), seat (altura do assento), tags (sinônimos).
5
+ import { sh } from "../utils/color.js";
6
+ import { person } from "./person.js";
7
+ const r = (n) => Math.round(n * 100) / 100;
8
+ const rad = (d) => (d * Math.PI) / 180;
9
+ const circle = (cx, cy, rr, fill, extra = "") => `<circle cx="${r(cx)}" cy="${r(cy)}" r="${r(rr)}" fill="${fill}" ${extra}/>`;
10
+ const rect = (x, y, w, h, fill, rx = 0, extra = "") => `<rect x="${r(x)}" y="${r(y)}" width="${r(w)}" height="${r(h)}" rx="${rx}" fill="${fill}" ${extra}/>`;
11
+ const ell = (cx, cy, rx, ry, fill, extra = "") => `<ellipse cx="${r(cx)}" cy="${r(cy)}" rx="${r(rx)}" ry="${r(ry)}" fill="${fill}" ${extra}/>`;
12
+ const shadow = (t, rx, ry = 3.5) => ell(0, 0, rx, ry, t.shadow);
13
+ const col = (t, v, def) => t[v] || v || def;
14
+ export const ASSETS = {
15
+ person: { kind: "ground", w: 40, h: 108, tags: ["pessoa", "human", "character", "man", "woman", "personagem"], draw: person },
16
+ // ---------------- exterior ----------------
17
+ house: { kind: "ground", w: 160, h: 175, tags: ["casa", "home"],
18
+ draw: (p, t) => {
19
+ const body = col(t, p.color, t.primary), roof = t.secondary;
20
+ return shadow(t, 88, 5) +
21
+ rect(40, -150, 16, 32, t.woodDark) + rect(48, -150, 8, 32, sh(t.woodDark, -0.2)) + rect(38, -154, 20, 6, sh(t.woodDark, -0.1), 1) +
22
+ rect(-65, -100, 130, 100, body) + rect(25, -100, 40, 100, sh(body, -0.12)) +
23
+ `<path d="M-65 -100 L65 -100 L65 -92 L-65 -92 Z" fill="${sh(body, -0.28)}" opacity="0.6"/>` +
24
+ `<path d="M-80 -95 L0 -170 L80 -95 Z" fill="${roof}"/><path d="M0 -170 L80 -95 L40 -95 Z" fill="${sh(roof, -0.18)}"/>` +
25
+ `<path d="M-84 -92 L0 -172 L84 -92" stroke="${sh(roof, -0.3)}" stroke-width="5" fill="none" stroke-linejoin="round" stroke-linecap="round"/>` +
26
+ rect(-15, -56, 30, 56, t.woodDark, 3) + rect(2, -56, 13, 56, sh(t.woodDark, -0.15), 0) + circle(9, -28, 2, t.accent) + rect(-19, -2, 38, 3, sh(body, -0.35)) +
27
+ [[-52, -80], [26, -80]].map(([x, y]) => rect(x, y, 26, 24, t.glass, 2, `stroke="${t.paper}" stroke-width="3"`) +
28
+ `<path d="M${x + 4} ${y + 18} L${x + 14} ${y + 4}" stroke="${t.paper}" stroke-width="2.5" opacity="0.6"/>` + rect(x - 3, y + 24, 32, 3, t.paper, 1)).join("") +
29
+ circle(0, -122, 9, t.glass, `stroke="${t.paper}" stroke-width="3"`);
30
+ } },
31
+ tree: { kind: "ground", w: 115, h: 205, tags: ["árvore", "arvore", "tree_round", "oak"],
32
+ draw: (p, t) => {
33
+ const [a, b, c] = t.foliage;
34
+ return shadow(t, 46, 4.5) +
35
+ `<path d="M-8 0 L-5 -95 L5 -95 L8 0 Z" fill="${t.trunk}"/><path d="M1 0 L1.5 -95 L5 -95 L8 0 Z" fill="${sh(t.trunk, -0.2)}"/>` +
36
+ `<path d="M0 -80 L-22 -110 M0 -95 L20 -120" stroke="${t.trunk}" stroke-width="5" stroke-linecap="round"/>` +
37
+ circle(-28, -125, 32, c) + circle(28, -122, 30, sh(c, -0.1)) + circle(0, -155, 42, a) +
38
+ `<path d="M0 -113 A42 42 0 0 0 42 -155 A42 42 0 0 1 10 -114 Z" fill="${sh(a, -0.12)}"/>` +
39
+ circle(-25, -138, 26, b, "opacity=\"0.9\"") + circle(-16, -172, 12, sh(b, 0.18), "opacity=\"0.7\"") + circle(22, -165, 18, b, "opacity=\"0.8\"");
40
+ } },
41
+ pine: { kind: "ground", w: 80, h: 200, tags: ["pinheiro", "pine_tree", "conifer"],
42
+ draw: (p, t) => {
43
+ let [a, , c] = t.foliage;
44
+ if (p.color) {
45
+ a = col(t, p.color, a);
46
+ c = sh(a, -0.12);
47
+ }
48
+ const tri = (y0, y1, hw, colr) => `<path d="M${-hw} ${y0} L0 ${y1} L${hw} ${y0} Z" fill="${colr}"/><path d="M0 ${y1} L${hw} ${y0} L0 ${y0} Z" fill="${sh(colr, -0.15)}"/>`;
49
+ return shadow(t, 32, 3.5) + rect(-6, -30, 12, 30, t.trunk) + rect(0, -30, 6, 30, sh(t.trunk, -0.2)) +
50
+ tri(-30, -95, 40, c) + tri(-80, -145, 33, a) + tri(-128, -195, 25, c);
51
+ } },
52
+ palm: { kind: "ground", w: 200, h: 262, tags: ["palmeira", "coqueiro", "palm_tree"],
53
+ draw: (p, t) => {
54
+ const [a, b] = t.foliage;
55
+ const leaf = (ang, len, colr) => {
56
+ const x = Math.cos(rad(ang)) * len, y = -Math.sin(rad(ang)) * len;
57
+ return `<path d="M30 -200 Q${r(30 + x * 0.5)} ${r(-200 + y * 0.5 - 25)} ${r(30 + x)} ${r(-200 + y)} Q${r(30 + x * 0.45)} ${r(-200 + y * 0.45 - 4)} 30 -200 Z" fill="${colr}"/>` +
58
+ `<path d="M30 -200 Q${r(30 + x * 0.5)} ${r(-200 + y * 0.5 - 18)} ${r(30 + x)} ${r(-200 + y)}" stroke="${sh(colr, -0.2)}" stroke-width="1.5" fill="none"/>`;
59
+ };
60
+ let trunk = `<path d="M-8 0 Q-6 -110 26 -200 L34 -198 Q6 -110 8 0 Z" fill="${t.trunk}"/>`;
61
+ for (let i = 1; i < 9; i++) {
62
+ const y = -i * 22, x = -7 + (i / 9) ** 2 * 33;
63
+ trunk += `<path d="M${r(x - 1)} ${y} l9 -3" stroke="${sh(t.trunk, -0.22)}" stroke-width="2" stroke-linecap="round"/>`;
64
+ }
65
+ return shadow(t, 40, 4.5) + trunk + [15, 40, 140, 165, 195, -15].map((g, i) => leaf(g, 70, i % 2 ? a : b)).join("") +
66
+ leaf(90, 55, a) + circle(26, -194, 6, t.woodDark) + circle(35, -192, 6, sh(t.woodDark, -0.15));
67
+ } },
68
+ bush: { kind: "ground", w: 74, h: 44, tags: ["arbusto", "shrub"],
69
+ draw: (p, t) => {
70
+ const [a, b, c] = t.foliage;
71
+ return shadow(t, 36, 3) + circle(-20, -14, 15, c) + circle(20, -14, 15, sh(c, -0.1)) + circle(0, -24, 21, a) +
72
+ `<path d="M0 -3 A21 21 0 0 0 21 -24 A21 21 0 0 1 6 -5 Z" fill="${sh(a, -0.12)}"/>` + circle(-9, -12, 12, b) + circle(10, -11, 12, sh(b, -0.08)) + circle(-6, -34, 6, sh(a, 0.2), "opacity=\"0.6\"");
73
+ } },
74
+ flowers: { kind: "ground", w: 50, h: 30, tags: ["flores", "canteiro", "flower_bed"],
75
+ draw: (p, t) => {
76
+ const [a, b] = t.foliage;
77
+ let s = shadow(t, 24, 2.5);
78
+ [[-16, -16, t.primary], [-4, -24, t.accent], [9, -18, t.paper], [19, -12, t.primary], [-20, -8, t.accent]].forEach(([x, y, c]) => {
79
+ s += `<path d="M${x} 0 Q${x + 1} ${y / 2} ${x} ${y}" stroke="${b}" stroke-width="2" fill="none"/>` + [0, 72, 144, 216, 288].map((g) => circle(x + Math.cos(rad(g)) * 3, y + Math.sin(rad(g)) * 3, 2.6, c)).join("") + circle(x, y, 1.8, t.accent === c ? t.paper : t.accent);
80
+ });
81
+ return s + ell(0, -2, 24, 4, a);
82
+ } },
83
+ fence: { kind: "ground", w: 160, h: 40, tags: ["cerca"],
84
+ draw: (p, t) => {
85
+ let s = rect(-80, -30, 160, 5, t.paper) + rect(-80, -15, 160, 5, t.paper) + rect(-80, -25, 160, 2, sh(t.paper, -0.15)) + rect(-80, -10, 160, 2, sh(t.paper, -0.15));
86
+ for (let x = -76; x <= 70; x += 18)
87
+ s += `<path d="M${x} 0 L${x} -34 L${x + 5} -40 L${x + 10} -34 L${x + 10} 0 Z" fill="${t.paper}"/><path d="M${x + 6} 0 L${x + 6} -38 L${x + 10} -34 L${x + 10} 0 Z" fill="${sh(t.paper, -0.12)}"/>`;
88
+ return s;
89
+ } },
90
+ building: { kind: "ground", w: 90, h: 300, tags: ["prédio", "predio", "tower", "skyscraper"],
91
+ size: (p) => ({ w: p.width || 90, h: p.floors ? p.floors * 30 + 26 : 306 }),
92
+ draw: (p, t) => {
93
+ const h = p.floors ? p.floors * 30 + 20 : 300, w = p.width || 90, c = col(t, p.color, t.secondary);
94
+ let s = rect(-w / 2, -h, w, h, c) + rect(w / 2 - w * 0.28, -h, w * 0.28, h, sh(c, -0.18)) + rect(-w / 2 - 4, -h - 6, w + 8, 8, sh(c, -0.35));
95
+ let i = 0;
96
+ for (let y = -h + 20; y < -25; y += 30)
97
+ for (let x = -w / 2 + 12; x < w / 2 - 14; x += 22) {
98
+ const lit = ((i++ * 7 + Math.floor(w) + (p.seed || 0)) % 5) < 2;
99
+ s += rect(x, y, 12, 16, lit ? t.glass : sh(c, -0.35), 1) + (lit ? rect(x, y + 12, 12, 4, sh(t.glass, -0.12)) : "");
100
+ }
101
+ return s + rect(-10, -24, 20, 24, sh(c, -0.4), 2);
102
+ } },
103
+ mountain: { kind: "ground", w: 320, h: 200, tags: ["montanha", "hill", "serra"],
104
+ draw: (p, t) => `<path d="M-160 0 L-40 -200 L40 -80 L80 -130 L160 0 Z" fill="${t.secondary}" opacity="0.6"/>` +
105
+ `<path d="M-40 -200 L40 -80 L10 0 L-20 0 Z" fill="${sh(t.secondary, -0.2)}" opacity="0.45"/><path d="M80 -130 L160 0 L110 0 Z" fill="${sh(t.secondary, -0.2)}" opacity="0.45"/>` +
106
+ `<path d="M-40 -200 L-62 -163 L-48 -170 L-36 -158 L-22 -170 Z" fill="${t.paper}" opacity="0.9"/>` },
107
+ sun: { kind: "sky", w: 90, h: 90, tags: ["sol"],
108
+ draw: (p, t) => {
109
+ let s = "";
110
+ for (let a = 0; a < 360; a += 30)
111
+ s += `<path d="M${r(Math.cos(rad(a)) * 34)} ${r(-45 + Math.sin(rad(a)) * 34)} L${r(Math.cos(rad(a)) * 44)} ${r(-45 + Math.sin(rad(a)) * 44)}" stroke="${t.accent}" stroke-width="5" stroke-linecap="round"/>`;
112
+ return circle(0, -45, 31, t.accent, "opacity=\"0.25\"") + s + circle(0, -45, 26, t.accent) + `<path d="M-16 -55 A20 20 0 0 1 4 -66" stroke="${sh(t.accent, 0.45)}" stroke-width="4" fill="none" stroke-linecap="round"/>`;
113
+ } },
114
+ moon: { kind: "sky", w: 60, h: 60, tags: ["lua"],
115
+ draw: (p, t) => circle(4, -32, 34, t.primary, "opacity=\"0.12\"") + `<path d="M10 -58 A28 28 0 1 0 22 -10 A22 22 0 1 1 10 -58 Z" fill="${t.primary}"/>` +
116
+ circle(-6, -28, 3, t.ink, "opacity=\"0.12\"") + circle(4, -16, 2, t.ink, "opacity=\"0.12\"") },
117
+ cloud: { kind: "sky", w: 110, h: 50, tags: ["nuvem"],
118
+ draw: (p, t) => `<g fill="${t.paper}" opacity="0.94"><circle cx="-28" cy="-15" r="15"/><circle cx="0" cy="-26" r="22"/><circle cx="28" cy="-15" r="15"/><rect x="-43" y="-15" width="86" height="15" rx="7"/></g>` +
119
+ `<path d="M-43 -8 Q-43 0 -36 0 L36 0 Q43 0 43 -8 Z" fill="${sh(t.paper, -0.08)}" opacity="0.9"/>` },
120
+ bird: { kind: "sky", w: 20, h: 10, tags: ["pássaro", "passaro", "gaivota", "birds"],
121
+ draw: (p, t) => `<path d="M-10 -6 Q-5 -11 0 -5 Q5 -11 10 -6" stroke="${t.ink}" stroke-width="1.8" fill="none" stroke-linecap="round" opacity="0.75"/>` },
122
+ star: { kind: "sky", w: 14, h: 14, tags: ["estrela"],
123
+ draw: (p, t) => `<path d="M0 -14 Q1 -8 7 -7 Q1 -6 0 0 Q-1 -6 -7 -7 Q-1 -8 0 -14 Z" fill="${t.paper}" opacity="0.9"/>` },
124
+ stars: { kind: "sky", backdrop: true, w: 600, h: 200, tags: ["céu estrelado", "starfield"],
125
+ draw: (p, t) => {
126
+ let s = "";
127
+ const pts = [[-280, -170], [-210, -60], [-150, -140], [-90, -30], [-30, -180], [40, -90], [110, -160], [170, -40], [230, -130], [290, -190], [-250, -110], [70, -20], [-120, -190], [200, -100]];
128
+ pts.forEach(([x, y], i) => { s += circle(x, y, i % 3 === 0 ? 2.2 : 1.3, t.paper, `opacity="${0.5 + (i % 4) * 0.12}"`); });
129
+ return s;
130
+ } },
131
+ car: { kind: "ground", w: 140, h: 62, tags: ["carro", "automóvel", "automovel", "auto"],
132
+ draw: (p, t) => {
133
+ const c = col(t, p.color, t.primary), f = p.facing === "left" ? -1 : 1;
134
+ const wheel = (x) => circle(x, -13, 13, t.ink) + circle(x, -13, 6, t.metal) + circle(x, -13, 2.5, sh(t.metal, -0.3));
135
+ return `<g transform="scale(${f} 1)">` + shadow(t, 70, 4.5) +
136
+ `<path d="M-68 -16 L-68 -34 Q-66 -40 -56 -42 L-36 -44 L-18 -60 Q-12 -64 0 -64 L28 -64 Q38 -64 44 -56 L56 -44 Q68 -42 70 -34 L70 -16 Z" fill="${c}"/>` +
137
+ `<path d="M-68 -26 L70 -26 L70 -16 L-68 -16 Z" fill="${sh(c, -0.15)}"/>` +
138
+ `<path d="M-30 -44 L-15 -57 Q-11 -60 -4 -60 L6 -60 L6 -44 Z" fill="${t.glass}"/><path d="M11 -60 L27 -60 Q34 -60 38 -55 L49 -44 L11 -44 Z" fill="${t.glass}"/>` +
139
+ `<path d="M-24 -46 L-14 -56" stroke="${t.paper}" stroke-width="2.5" opacity="0.6"/>` +
140
+ rect(64, -36, 6, 6, t.accent, 2) + rect(-68, -36, 5, 6, sh(t.primary, -0.3), 2) + rect(-6, -36, 10, 2.5, sh(c, -0.35), 1) + rect(26, -36, 10, 2.5, sh(c, -0.35), 1) +
141
+ wheel(-40) + wheel(42) + `</g>`;
142
+ } },
143
+ bicycle: { kind: "ground", w: 80, h: 48, tags: ["bicicleta", "bike"],
144
+ draw: (p, t) => {
145
+ const c = col(t, p.color, t.secondary), f = p.facing === "left" ? -1 : 1;
146
+ const wh = (x) => `<circle cx="${x}" cy="-17" r="16" fill="none" stroke="${t.ink}" stroke-width="3.5"/>` + circle(x, -17, 2.5, t.metal);
147
+ return `<g transform="scale(${f} 1)">` + shadow(t, 40, 3) + wh(-24) + wh(24) +
148
+ `<path d="M-24 -17 L-6 -17 L10 -38 L-12 -38 Z M-6 -17 L-14 -42 M24 -17 L14 -46" stroke="${c}" stroke-width="3.5" fill="none" stroke-linejoin="round" stroke-linecap="round"/>` +
149
+ `<path d="M-20 -43 L-8 -43" stroke="${t.ink}" stroke-width="4" stroke-linecap="round"/><path d="M10 -47 L19 -48" stroke="${t.ink}" stroke-width="3" stroke-linecap="round"/>` + circle(-6, -17, 4, t.metal) + `</g>`;
150
+ } },
151
+ dog: { kind: "ground", w: 50, h: 36, tags: ["cachorro", "cão", "cao", "puppy"],
152
+ draw: (p, t) => {
153
+ const c = col(t, p.color, t.wood), f = p.facing === "left" ? -1 : 1, d = sh(c, -0.2);
154
+ return `<g transform="scale(${f} 1)">` + shadow(t, 24, 3) +
155
+ rect(-15, -14, 5, 14, d, 2) + rect(9, -14, 5, 14, d, 2) +
156
+ ell(-1, -18, 18, 9, c) + `<path d="M-17 -20 Q-26 -30 -22 -34" stroke="${c}" stroke-width="4" fill="none" stroke-linecap="round"/>` +
157
+ rect(-11, -14, 5, 14, c, 2) + rect(13, -14, 5, 14, c, 2) +
158
+ circle(17, -29, 9, c) + ell(24, -26, 6, 4.5, sh(c, 0.25)) + circle(29, -27, 2, t.ink) + circle(19, -31, 1.4, t.ink) +
159
+ `<path d="M11 -36 Q8 -26 14 -25 Q15 -32 11 -36 Z" fill="${d}"/>` + rect(11, -22, 10, 3, t.primary, 1.5) + `</g>`;
160
+ } },
161
+ cat: { kind: "ground", w: 36, h: 32, tags: ["gato", "gatinho", "kitten"],
162
+ draw: (p, t) => {
163
+ const c = col(t, p.color, t.metal), f = p.facing === "left" ? -1 : 1;
164
+ return `<g transform="scale(${f} 1)">` + shadow(t, 16, 2.5) +
165
+ `<path d="M-12 -4 Q-24 -8 -20 -22" stroke="${c}" stroke-width="4" fill="none" stroke-linecap="round"/>` +
166
+ `<path d="M-12 0 Q-14 -20 0 -22 Q10 -22 10 0 Z" fill="${c}"/><path d="M2 0 Q4 -16 0 -22 Q10 -22 10 0 Z" fill="${sh(c, -0.15)}"/>` +
167
+ circle(4, -26, 8, c) + `<path d="M-2 -30 L-3 -38 L3 -32 Z M6 -32 L11 -38 L11 -30 Z" fill="${c}"/>` +
168
+ circle(2, -27, 1.3, t.ink) + circle(8, -27, 1.3, t.ink) + `<path d="M5 -24 L4 -23 M5 -24 L6 -23" stroke="${t.ink}" stroke-width="0.8"/>` + `</g>`;
169
+ } },
170
+ streetlight: { kind: "ground", w: 40, h: 170, tags: ["poste", "lamppost", "street_lamp"],
171
+ draw: (p, t) => shadow(t, 10, 2) + `<path d="M0 0 L0 -160 Q0 -170 14 -170" stroke="${t.metal}" stroke-width="5" fill="none"/>` + rect(8, -174, 20, 8, t.metal, 3) +
172
+ `<path d="M10 -166 L-30 0 L70 0 L26 -166 Z" fill="#FFE39A" opacity="0.12"/>` + circle(18, -165, 4, "#FFE9A8") },
173
+ bench: { kind: "ground", w: 110, h: 60, seat: 36, tags: ["banco", "park_bench"],
174
+ draw: (p, t) => shadow(t, 55, 3) + rect(-55, -40, 110, 6, t.wood, 2) + rect(-55, -36, 110, 2, sh(t.wood, -0.2)) + rect(-55, -58, 110, 6, t.wood, 2) + rect(-55, -54, 110, 2, sh(t.wood, -0.2)) +
175
+ rect(-48, -34, 5, 34, t.metal) + rect(43, -34, 5, 34, t.metal) + rect(-48, -58, 4, 20, t.metal) + rect(44, -58, 4, 20, t.metal) },
176
+ // ---------------- parede ----------------
177
+ window: { kind: "wall", w: 90, h: 100, elevation: 75, tags: ["janela"],
178
+ draw: (p, t) => {
179
+ const night = p.view === "night", sky = night ? "#26305E" : t.glass;
180
+ const fr = col(t, p.frame, t.paper);
181
+ return rect(-45, -100, 90, 100, fr, 4) + rect(-39, -94, 78, 88, sky, 2) + rect(-39, -94, 78, 10, sh(sky, -0.1)) +
182
+ (night
183
+ ? circle(18, -72, 8, "#F5E6A8")
184
+ : circle(-15, -40, 10, t.paper, "opacity=\"0.7\"") + circle(-4, -46, 13, t.paper, "opacity=\"0.7\"") +
185
+ `<path d="M-30 -20 L-8 -88 M-18 -14 L4 -82" stroke="${t.paper}" stroke-width="4" opacity="0.35"/>`) +
186
+ rect(-2, -94, 4, 88, fr) + rect(-39, -52, 78, 4, fr) + rect(-50, -4, 100, 6, fr, 2) + rect(-50, 0, 100, 2, sh(fr, -0.18));
187
+ } },
188
+ frame: { kind: "wall", w: 60, h: 46, elevation: 95, tags: ["quadro", "picture", "painting"],
189
+ draw: (p, t) => rect(-29, -44, 60, 46, "rgba(0,0,0,0.08)", 2) + rect(-30, -46, 60, 46, t.woodDark, 2) + rect(-25, -41, 50, 36, t.paper) +
190
+ `<path d="M-25 -5 L-8 -26 L2 -15 L10 -24 L25 -5 Z" fill="${t.secondary}"/><path d="M-8 -26 L2 -15 L-4 -5 L-14 -5 Z" fill="${sh(t.secondary, -0.15)}"/>` + circle(12, -32, 4, t.accent) },
191
+ clock: { kind: "wall", w: 34, h: 34, elevation: 120, tags: ["relógio", "relogio"],
192
+ draw: (p, t) => circle(1, -16, 17, "rgba(0,0,0,0.08)") + circle(0, -17, 17, t.paper, `stroke="${t.ink}" stroke-width="3"`) +
193
+ [0, 90, 180, 270].map((a) => circle(Math.cos(rad(a)) * 11.5, -17 + Math.sin(rad(a)) * 11.5, 1.2, t.ink)).join("") +
194
+ `<path d="M0 -17 L0 -28 M0 -17 L8 -13" stroke="${t.ink}" stroke-width="2.5" stroke-linecap="round"/>` },
195
+ board: { kind: "wall", w: 170, h: 100, elevation: 60, tags: ["quadro negro", "lousa", "whiteboard", "chalkboard", "chart"],
196
+ draw: (p, t) => {
197
+ const bg = p.style === "white" ? t.paper : "#2F5446", ln = p.style === "white" ? t.ink : "#EAF2E6";
198
+ const bars = [30, 52, 40, 70].map((v, i) => { const c = [t.primary, t.accent, t.secondary, t.primary][i]; return rect(-60 + i * 26, -18 - v, 16, v, c, 2) + rect(-52 + i * 26, -18 - v, 8, v, sh(c, -0.15), 0); }).join("");
199
+ return rect(-83, -98, 170, 100, "rgba(0,0,0,0.1)", 4) + rect(-85, -100, 170, 100, t.woodDark, 4) + rect(-79, -94, 158, 88, bg, 2) +
200
+ `<path d="M-79 -94 L-40 -94 L-79 -50 Z" fill="${t.paper}" opacity="0.05"/>` + bars +
201
+ `<path d="M-68 -18 L54 -18" stroke="${ln}" stroke-width="2"/><path d="M-62 -55 Q-30 -60 -10 -75 T50 -92" stroke="${ln}" stroke-width="2.5" fill="none" stroke-dasharray="5 4"/>` +
202
+ rect(-40, -2, 80, 5, t.woodDark, 2) + rect(-30, -5, 8, 3, t.paper, 1);
203
+ } },
204
+ shelf_wall: { kind: "wall", w: 90, h: 34, elevation: 100, tags: ["prateleira", "wall_shelf"],
205
+ draw: (p, t) => rect(-45, -6, 90, 6, t.wood, 1) + rect(-45, 0, 90, 2, sh(t.wood, -0.25)) + rect(-38, -26, 7, 20, t.primary, 1) + rect(-30, -24, 6, 18, t.secondary, 1) +
206
+ rect(-23, -27, 7, 21, t.accent, 1) + `<path d="M8 -6 L12 -18 L22 -18 L26 -6 Z" fill="${t.primary}"/>` + `<path d="M17 -18 Q10 -30 14 -36 Q18 -28 17 -18 Z M17 -18 Q24 -28 22 -34 Q16 -28 17 -18 Z" fill="${t.foliage[0]}"/>` },
207
+ // ---------------- móveis ----------------
208
+ bookshelf: { kind: "ground", w: 80, h: 170, tags: ["estante", "shelf", "books"],
209
+ draw: (p, t) => {
210
+ let s = shadow(t, 44, 3) + rect(-40, -170, 80, 170, t.woodDark, 2) + rect(-35, -165, 70, 160, sh(t.wood, -0.1));
211
+ const cols = [t.primary, t.secondary, t.accent, t.paper, t.primary, t.secondary];
212
+ for (let row = 0; row < 4; row++) {
213
+ const base = -10 - row * 40;
214
+ let x = -33, k = row;
215
+ s += rect(-35, base - 36, 70, 6, "rgba(0,0,0,0.12)");
216
+ while (x < 26) {
217
+ const w = 6 + ((k * 5) % 5), h = 22 + ((k * 7) % 9), c = cols[k % cols.length];
218
+ s += rect(x, base - h, w, h, c, 1) + rect(x + w * 0.6, base - h, w * 0.4, h, sh(c, -0.15)) + rect(x, base - h + 4, w, 1.5, sh(c, -0.3));
219
+ x += w + 1;
220
+ k++;
221
+ }
222
+ s += rect(-35, base, 70, 5, t.woodDark);
223
+ }
224
+ return s + rect(26, -170, 14, 170, sh(t.woodDark, -0.15));
225
+ } },
226
+ desk: { kind: "ground", w: 130, h: 46, top: 46, tags: ["mesa de trabalho", "escrivaninha", "table_desk"],
227
+ draw: (p, t) => shadow(t, 68, 3.5) + rect(-58, -40, 6, 40, t.woodDark) + rect(52, -40, 6, 40, t.woodDark) +
228
+ rect(18, -40, 32, 22, t.woodDark, 2) + rect(18, -40, 32, 4, sh(t.woodDark, -0.2)) + rect(30, -32, 8, 2.5, t.accent, 1) +
229
+ rect(-65, -46, 130, 7, t.wood, 2) + rect(-65, -41, 130, 2, sh(t.wood, -0.22)) + rect(-63, -46, 126, 1.5, sh(t.wood, 0.2)) },
230
+ table: { kind: "ground", w: 80, h: 46, top: 46, tags: ["mesa", "mesa redonda", "cafe_table", "dining_table"],
231
+ draw: (p, t) => {
232
+ const w = p.width || 80;
233
+ return shadow(t, w / 2, 3.5) + rect(-3.5, -40, 7, 37, t.metal) + rect(0, -40, 3.5, 37, sh(t.metal, -0.2)) +
234
+ `<path d="M-20 0 Q0 -8 20 0 Z" fill="${t.metal}"/>` + rect(-w / 2, -46, w, 6, t.wood, 3) + rect(-w / 2, -42, w, 2, sh(t.wood, -0.22));
235
+ },
236
+ size: (p) => ({ w: p.width || 80, h: 46 }) },
237
+ counter: { kind: "ground", w: 220, h: 62, top: 62, tags: ["balcão", "balcao", "bar", "kitchen_counter"],
238
+ draw: (p, t) => shadow(t, 112, 4) + rect(-104, -54, 208, 54, t.wood) + rect(-104, -54, 208, 6, sh(t.wood, -0.22)) +
239
+ [-70, 0, 70].map((x) => rect(x - 28, -44, 56, 38, sh(t.wood, -0.12), 3) + rect(x - 8, -40, 16, 2.5, t.metal, 1)).join("") +
240
+ rect(-110, -62, 220, 8, t.woodDark, 2) + rect(-108, -62, 216, 1.5, sh(t.woodDark, 0.25)) },
241
+ chair: { kind: "ground", w: 44, h: 88, seat: 45, tags: ["cadeira", "seat"],
242
+ draw: (p, t) => {
243
+ const f = p.facing === "left" ? -1 : 1, c = col(t, p.color, t.secondary);
244
+ return shadow(t, 24, 3) + rect(-16, -40, 4, 40, t.metal) + rect(12, -40, 4, 40, sh(t.metal, -0.2)) +
245
+ rect(-f * 18 - (f > 0 ? 0 : 6), -88, 6, 49, c, 3) + rect(-18, -45, 36, 6, c, 2) + rect(-18, -41, 36, 2, sh(c, -0.25));
246
+ } },
247
+ sofa: { kind: "ground", w: 170, h: 72, seat: 36, tags: ["sofá", "sofa", "couch"],
248
+ draw: (p, t) => {
249
+ const c = col(t, p.color, t.secondary), d = sh(c, -0.15);
250
+ return shadow(t, 86, 4.5) + rect(-70, -8, 6, 8, t.woodDark) + rect(64, -8, 6, 8, t.woodDark) +
251
+ rect(-75, -72, 150, 42, d, 14) + rect(-68, -68, 66, 34, c, 10) + rect(2, -68, 66, 34, c, 10) +
252
+ rect(-80, -40, 160, 32, c, 8) + rect(-80, -18, 160, 10, d, 6) +
253
+ rect(-86, -56, 20, 50, d, 9) + rect(66, -56, 20, 50, d, 9) + rect(-86, -56, 20, 8, sh(c, 0.1), 6) + rect(66, -56, 20, 8, sh(c, 0.1), 6) +
254
+ rect(-60, -62, 28, 24, t.accent, 6, "transform=\"rotate(-8 -46 -50)\"") + rect(-50, -40, 100, 2, sh(c, -0.3));
255
+ } },
256
+ bed: { kind: "ground", w: 180, h: 70, top: 38, seat: 38, tags: ["cama", "bed"],
257
+ draw: (p, t) => {
258
+ const c = col(t, p.color, t.primary);
259
+ return shadow(t, 90, 4) + rect(-90, -70, 10, 70, t.woodDark, 3) + rect(80, -46, 10, 46, t.woodDark, 3) +
260
+ rect(-82, -34, 166, 22, t.paper, 4) + rect(-82, -16, 166, 6, sh(t.paper, -0.12)) + rect(-76, -46, 40, 14, t.paper, 7) + rect(-76, -38, 40, 6, sh(t.paper, -0.1), 3) +
261
+ `<path d="M-30 -40 Q20 -44 84 -38 L84 -14 L-34 -14 Z" fill="${c}"/><path d="M-30 -22 L84 -22 L84 -14 L-34 -14 Z" fill="${sh(c, -0.15)}"/>` + rect(-84, -10, 168, 4, t.woodDark, 1);
262
+ } },
263
+ tv: { kind: "any", w: 90, h: 58, tags: ["tv", "televisão", "televisao", "television"],
264
+ draw: (p, t) => rect(-10, -6, 20, 6, t.ink, 2) + rect(-3, -10, 6, 5, t.ink) + rect(-45, -58, 90, 50, t.ink, 4) + rect(-41, -54, 82, 42, sh(t.glass, -0.35), 2) +
265
+ `<path d="M-41 -54 L-10 -54 L-41 -20 Z" fill="${t.paper}" opacity="0.12"/>` + circle(14, -36, 9, t.accent, "opacity=\"0.8\"") + `<path d="M-41 -12 L-20 -30 L-5 -18 L10 -28 L41 -12 Z" fill="${t.secondary}" opacity="0.8"/>` },
266
+ tv_stand: { kind: "ground", w: 120, h: 40, top: 40, tags: ["rack", "móvel de tv", "tv_cabinet"],
267
+ draw: (p, t) => shadow(t, 60, 3) + rect(-60, -40, 120, 36, t.wood, 3) + rect(-60, -40, 120, 4, sh(t.wood, 0.15), 2) + rect(-54, -32, 52, 24, sh(t.wood, -0.12), 2) + rect(2, -32, 52, 24, sh(t.wood, -0.12), 2) +
268
+ rect(-30, -22, 10, 2.5, t.metal, 1) + rect(22, -22, 10, 2.5, t.metal, 1) + rect(-56, -4, 6, 4, t.woodDark) + rect(50, -4, 6, 4, t.woodDark) },
269
+ floor_lamp: { kind: "ground", w: 40, h: 150, tags: ["abajur de chão", "luminária de chão", "luminaria de chao", "floor lamp"],
270
+ draw: (p, t) => shadow(t, 14, 2.5) + ell(0, -2, 13, 3, t.ink) + rect(-1.5, -125, 3, 123, t.ink) +
271
+ `<path d="M-16 -122 L-11 -150 L11 -150 L16 -122 Z" fill="${t.accent}"/><path d="M2 -150 L11 -150 L16 -122 L4 -122 Z" fill="${sh(t.accent, -0.15)}"/>` +
272
+ `<path d="M-16 -122 L-40 -20 L40 -20 L16 -122 Z" fill="#FFE9A8" opacity="0.12"/>` },
273
+ rug: { kind: "floor", w: 180, h: 14, tags: ["tapete", "carpet"],
274
+ draw: (p, t) => { const c = col(t, p.color, t.secondary); return ell(0, -2, 90, 10, c, "opacity=\"0.22\"") + ell(0, -2, 76, 7, "none", `stroke="${c}" stroke-width="2" opacity="0.35" stroke-dasharray="6 5"`); } },
275
+ pendant_lamp: { kind: "ceiling", w: 40, h: 30, tags: ["luminária pendente", "hanging_lamp"],
276
+ draw: (p, t) => `<path d="M-20 -2 Q-20 -26 0 -26 Q20 -26 20 -2 Z" fill="${t.accent}"/><path d="M4 -26 Q20 -26 20 -2 L8 -2 Z" fill="${sh(t.accent, -0.15)}"/>` + circle(0, -1, 5, "#FFF3C4") +
277
+ `<path d="M-18 0 L-50 70 L50 70 L18 0 Z" fill="#FFE9A8" opacity="0.13"/>` },
278
+ // ---------------- objetos de superfície ----------------
279
+ laptop: { kind: "surface", w: 34, h: 24, tags: ["notebook", "computador", "computer"],
280
+ draw: (p, t) => {
281
+ const f = p.facing === "left" ? -1 : 1;
282
+ return rect(-17, -3, 34, 3, t.metal, 1.5) + rect(-17, -1.5, 34, 1.5, sh(t.metal, -0.25)) +
283
+ `<path d="M${-f * 15} -3 L${-f * 19} -25" stroke="${t.ink}" stroke-width="3.5" stroke-linecap="round"/><path d="M${-f * 13} -5 L${-f * 16.5} -23" stroke="${t.glass}" stroke-width="1.6" stroke-linecap="round" opacity="0.9"/>`;
284
+ } },
285
+ monitor: { kind: "surface", w: 50, h: 46, tags: ["tela", "screen", "display"],
286
+ draw: (p, t) => p.off
287
+ ? rect(-3, -14, 6, 14, t.ink) + rect(-12, -2.5, 24, 2.5, t.ink, 1) + rect(-25, -46, 50, 33, t.ink, 2) + rect(-24, -45, 48, 30, sh(t.ink, 0.12), 1) + `<path d="M-24 -45 L-6 -45 L-24 -25 Z" fill="#FFFFFF" opacity="0.06"/>` :
288
+ rect(-4, -14, 8, 14, t.metal) + rect(-14, -3, 28, 3, t.metal, 1.5) + rect(-25, -46, 50, 33, t.ink, 3) + rect(-21, -42, 42, 25, t.glass, 1) +
289
+ rect(-17, -38, 18, 3, t.primary, 1) + rect(-17, -32, 28, 2.5, t.paper, 1, "opacity=\"0.8\"") + rect(-17, -27, 22, 2.5, t.paper, 1, "opacity=\"0.8\"") },
290
+ lamp: { kind: "surface", w: 30, h: 42, tags: ["luminária", "luminaria", "desk_lamp"],
291
+ draw: (p, t) => rect(-10, -3, 20, 3, t.ink, 1.5) + `<path d="M-2 -3 L-8 -26 L8 -36" stroke="${t.ink}" stroke-width="2.5" fill="none" stroke-linejoin="round"/>` +
292
+ `<path d="M2 -42 L18 -30 L10 -24 Z" fill="${t.accent}"/><path d="M10 -36 L18 -30 L10 -24 Z" fill="${sh(t.accent, -0.15)}"/>` + `<path d="M14 -27 L26 -2 L-2 -2 Z" fill="${t.accent}" opacity="0.13"/>` },
293
+ plant: { kind: "any", w: 36, h: 46, tags: ["planta", "vaso", "plant_pot"],
294
+ draw: (p, t) => {
295
+ const [a, b] = t.foliage;
296
+ return `<path d="M0 -16 Q-18 -30 -14 -46 Q-4 -32 0 -16 Z" fill="${a}"/><path d="M0 -16 Q16 -28 15 -42 Q3 -32 0 -16 Z" fill="${b}"/><path d="M0 -16 Q-2 -36 3 -48 Q6 -34 0 -16 Z" fill="${sh(a, -0.12)}"/>` +
297
+ `<path d="M-11 -16 L11 -16 L8 0 L-8 0 Z" fill="${t.primary}"/><path d="M2 -16 L11 -16 L8 0 L2 0 Z" fill="${sh(t.primary, -0.15)}"/>` + rect(-12, -18, 24, 4, sh(t.primary, -0.08), 1);
298
+ } },
299
+ big_plant: { kind: "ground", w: 60, h: 110, tags: ["planta grande", "costela de adão", "monstera"],
300
+ draw: (p, t) => {
301
+ const [a, b, c] = t.foliage;
302
+ const pot = col(t, p.pot, "#C9724E");
303
+ const lf = (x, y, rot, colr) => `<ellipse cx="${x}" cy="${y}" rx="11" ry="22" fill="${colr}" transform="rotate(${rot} ${x} ${y})"/><path d="M${x} ${y + 20} L${x} ${y - 18}" stroke="${sh(colr, -0.2)}" stroke-width="1.4" transform="rotate(${rot} ${x} ${y})"/>`;
304
+ return shadow(t, 22, 3) + lf(-16, -64, -35, c) + lf(16, -66, 35, b) + lf(0, -86, 0, a) + lf(-24, -88, -50, a) + lf(24, -90, 48, c) + lf(-6, -58, -12, b) +
305
+ `<path d="M-16 -34 L16 -34 L12 0 L-12 0 Z" fill="${pot}"/><path d="M4 -34 L16 -34 L12 0 L4 0 Z" fill="${sh(pot, -0.12)}"/>` + rect(-17, -36, 34, 5, sh(pot, -0.2), 2);
306
+ } },
307
+ cup: { kind: "surface", w: 16, h: 22, tags: ["xícara", "xicara", "caneca", "mug", "coffee"],
308
+ draw: (p, t) => {
309
+ const c = col(t, p.color, t.paper);
310
+ return ell(0, 0, 9, 1.6, sh(c, -0.2)) + `<path d="M-6 -12 L6 -12 L5 0 L-5 0 Z" fill="${c}"/><path d="M1 -12 L6 -12 L5 0 L1 0 Z" fill="${sh(c, -0.12)}"/>` + ell(0, -12, 6, 1.4, t.woodDark) +
311
+ `<path d="M6 -10 Q11 -9 10 -5 Q9 -3 5.5 -3" stroke="${c}" stroke-width="2" fill="none"/>` +
312
+ (p.steam === false ? "" : `<path d="M-2 -15 Q-5 -19 -2 -22 Q1 -25 -2 -28 M3 -15 Q0 -19 3 -22" stroke="${t.metal}" stroke-width="1.3" fill="none" opacity="0.6" stroke-linecap="round"/>`);
313
+ } },
314
+ cake: { kind: "surface", w: 30, h: 26, tags: ["bolo", "dessert"],
315
+ draw: (p, t) => rect(-16, -2, 32, 2, t.paper, 1) + rect(-13, -18, 26, 16, t.paper, 2) + rect(4, -18, 9, 16, sh(t.paper, -0.1)) + rect(-13, -12, 26, 3, t.primary) +
316
+ `<path d="M-13 -18 Q-9 -14 -5 -18 Q-1 -14 3 -18 Q7 -14 13 -18 L13 -20 L-13 -20 Z" fill="${t.primary}"/>` + circle(0, -23, 3, t.primary) + circle(-1, -24, 1, sh(t.primary, 0.4)) },
317
+ pizza: { kind: "surface", w: 40, h: 8, tags: ["pizza"],
318
+ draw: (p, t) => ell(0, -2, 20, 4.5, t.paper) + ell(0, -3, 17, 3.5, "#E9B44C") + ell(0, -3.4, 15, 2.8, t.primary) +
319
+ [[-8, -3.6], [2, -4.2], [9, -3], [-2, -2.6], [5, -2.2]].map(([x, y], i) => ell(x, y, 2, 0.9, i % 2 ? "#F6E6B4" : sh(t.primary, -0.35))).join("") + ell(-5, -4.6, 2.5, 0.7, "#5E8C3A") },
320
+ fruit_bowl: { kind: "surface", w: 34, h: 22, tags: ["frutas", "fruteira", "fruit"],
321
+ draw: (p, t) => circle(-7, -14, 6, t.primary) + circle(6, -14, 6, t.accent) + circle(0, -19, 6, "#8DBA4A") + circle(-2, -21, 1.5, "#FFFFFF", "opacity=\"0.4\"") +
322
+ `<path d="M-6 -24 L-5 -27" stroke="${t.trunk}" stroke-width="1.5"/>` + `<path d="M-17 -12 L17 -12 Q15 0 0 0 Q-15 0 -17 -12 Z" fill="${t.secondary}"/><path d="M4 -12 L17 -12 Q15 0 3 0 Z" fill="${sh(t.secondary, -0.15)}"/>` },
323
+ burger: { kind: "surface", w: 22, h: 18, tags: ["hambúrguer", "hamburguer", "sanduíche", "lanche"],
324
+ draw: (p, t) => rect(-10, -4, 20, 4, "#D99A4E", 2) + rect(-11, -8, 22, 4, "#5A3322", 2) + `<path d="M-12 -9 L12 -9 L9 -7 L5 -9 L1 -7 L-3 -9 L-7 -7 Z" fill="#8DBA4A"/>` + rect(-11, -10, 22, 2, "#F2C14E") +
325
+ `<path d="M-10 -10 Q-10 -18 0 -18 Q10 -18 10 -10 Z" fill="#D99A4E"/>` + `<path d="M3 -18 Q10 -18 10 -10 L5 -10 Z" fill="${sh("#D99A4E", -0.12)}"/>` + circle(-3, -14, 0.8, "#FFF3D6") + circle(2, -15.5, 0.8, "#FFF3D6") },
326
+ plate: { kind: "surface", w: 26, h: 4, tags: ["prato", "dish"],
327
+ draw: (p, t) => { const c = col(t, p.color, t.paper); return ell(0, -1.5, 13, 3, c) + ell(0, -2, 9, 1.8, sh(c, -0.08)); } },
328
+ vase_flowers: { kind: "surface", w: 22, h: 34, tags: ["vaso de flores", "buquê", "flower vase"],
329
+ draw: (p, t) => `<path d="M0 -14 Q-6 -24 -8 -30 M0 -14 Q2 -26 1 -32 M0 -14 Q6 -24 9 -28" stroke="${t.foliage[1]}" stroke-width="1.5" fill="none"/>` +
330
+ circle(-8, -31, 3.5, t.primary) + circle(1, -33, 3.5, t.accent) + circle(9, -29, 3.5, t.primary) +
331
+ `<path d="M-5 -14 L5 -14 Q8 -7 4 0 L-4 0 Q-8 -7 -5 -14 Z" fill="${t.glass}" opacity="0.85"/><path d="M1 -14 L5 -14 Q8 -7 4 0 L1 0 Z" fill="${sh(t.glass, -0.15)}"/>` },
332
+ books: { kind: "surface", w: 26, h: 16, tags: ["livros", "pilha de livros", "book_stack"],
333
+ draw: (p, t) => [[-13, -5, 26, t.primary], [-11, -10, 23, t.secondary], [-12, -15, 21, t.accent]].map(([x, y, w, c]) => rect(x, y, w, 5, c, 1) + rect(x + w - 4, y, 4, 5, sh(c, -0.18), 1) + rect(x + 2, y + 2, w - 7, 1, sh(c, 0.35))).join("") },
334
+ coffee_machine: { kind: "surface", w: 34, h: 40, tags: ["máquina de café", "espresso"],
335
+ draw: (p, t) => rect(-17, -40, 34, 40, t.metal, 4) + rect(6, -40, 11, 40, sh(t.metal, -0.18), 4) + rect(-12, -34, 24, 9, t.ink, 2) + circle(-6, -30, 1.8, t.accent) + rect(-6, -20, 12, 4, t.ink) + rect(-5, -10, 10, 10, t.paper, 1) },
336
+ // ---------------- praia / viagem ----------------
337
+ umbrella: { kind: "ground", w: 140, h: 150, tags: ["guarda-sol", "parasol", "beach_umbrella"],
338
+ draw: (p, t) => {
339
+ const c = col(t, p.color, t.primary);
340
+ return shadow(t, 55, 5) + `<path d="M0 0 L8 -135" stroke="${t.ink}" stroke-width="4" stroke-linecap="round"/>` +
341
+ `<path d="M-58 -112 Q8 -175 74 -128 Z" fill="${c}"/>` + `<path d="M-14 -126 Q8 -172 30 -122 Z" fill="${t.paper}"/>` +
342
+ `<path d="M-58 -112 Q-30 -118 -14 -126 Q8 -120 30 -122 Q52 -124 74 -128" fill="none" stroke="${sh(c, -0.25)}" stroke-width="3"/>` +
343
+ `<path d="M-58 -112 Q-36 -132 -14 -126 L-58 -112 Z" fill="${sh(c, 0.15)}" opacity="0.5"/>`;
344
+ } },
345
+ boat: { kind: "water", w: 70, h: 70, tags: ["barco", "veleiro", "sailboat"],
346
+ draw: (p, t) => `<path d="M-35 -14 L35 -14 L25 0 L-25 0 Z" fill="${t.primary}"/><path d="M-35 -14 L35 -14 L33 -10 L-33 -10 Z" fill="${sh(t.primary, 0.2)}"/>` +
347
+ `<path d="M0 -14 L0 -70" stroke="${t.ink}" stroke-width="2.5"/><path d="M3 -68 L30 -18 L3 -18 Z" fill="${t.paper}"/><path d="M3 -68 L16 -43 L3 -43 Z" fill="${sh(t.paper, -0.08)}"/><path d="M-3 -60 L-24 -18 L-3 -18 Z" fill="${sh(t.paper, -0.12)}"/>` +
348
+ `<path d="M-40 1 Q-30 -2 -20 1 T0 1 T20 1 T40 1" stroke="${t.paper}" stroke-width="2" fill="none" opacity="0.6"/>` },
349
+ suitcase: { kind: "any", w: 30, h: 46, tags: ["mala", "luggage", "bagagem"],
350
+ draw: (p, t) => {
351
+ const c = col(t, p.color, t.accent);
352
+ return `<path d="M-6 -36 L-6 -44 L6 -44 L6 -36" stroke="${t.ink}" stroke-width="2.5" fill="none"/>` + rect(-15, -38, 30, 36, c, 4) + rect(5, -38, 10, 36, sh(c, -0.15), 4) +
353
+ rect(-8, -38, 2, 36, sh(c, -0.25)) + rect(6, -38, 2, 36, sh(c, -0.3)) + circle(-9, -1, 2.5, t.ink) + circle(9, -1, 2.5, t.ink) + circle(-2, -30, 3, t.primary) + rect(-12, -18, 8, 6, t.paper, 1, "transform=\"rotate(-10 -8 -15)\"");
354
+ } },
355
+ backpack: { kind: "any", w: 26, h: 34, tags: ["mochila"],
356
+ draw: (p, t) => {
357
+ const c = col(t, p.color, t.secondary);
358
+ return `<path d="M-6 -30 Q0 -38 6 -30" stroke="${sh(c, -0.3)}" stroke-width="2.5" fill="none"/>` + rect(-12, -30, 24, 30, c, 8) + rect(2, -30, 10, 30, sh(c, -0.15), 6) + rect(-8, -14, 16, 11, sh(c, -0.1), 4) + rect(-3, -12, 6, 2, t.accent, 1);
359
+ } },
360
+ beach_towel: { kind: "floor", w: 90, h: 10, tags: ["toalha", "towel"],
361
+ draw: (p, t) => `<path d="M-45 0 L-35 -9 L45 -9 L35 0 Z" fill="${t.secondary}"/><path d="M-25 0 L-15 -9 L-5 -9 L-15 0 Z M5 0 L15 -9 L25 -9 L15 0 Z" fill="${t.paper}"/>` },
362
+ ball: { kind: "ground", w: 24, h: 24, tags: ["bola", "beach_ball"],
363
+ draw: (p, t) => shadow(t, 10, 2) + circle(0, -12, 12, t.paper) + `<path d="M0 -24 A12 12 0 0 1 12 -12 L0 -12 Z" fill="${t.primary}"/><path d="M0 0 A12 12 0 0 1 -12 -12 L0 -12 Z" fill="${t.accent}"/>` +
364
+ `<path d="M0 0 A12 12 0 0 0 12 -12 A12 12 0 0 1 2 -1 Z" fill="${t.ink}" opacity="0.12"/>` + circle(-5, -18, 2.5, t.paper, "opacity=\"0.7\"") },
365
+ sandcastle: { kind: "ground", w: 46, h: 40, tags: ["castelo de areia", "sand castle"],
366
+ draw: (p, t) => {
367
+ const s = t.groundDark || t.ground;
368
+ return shadow(t, 24, 3) + rect(-20, -18, 40, 18, s) + rect(-22, -32, 12, 14, s) + rect(10, -32, 12, 14, s) + rect(-6, -40, 12, 22, sh(s, -0.08)) +
369
+ [-22, -16, 10, 16].map((x) => rect(x, -36, 4, 4, s)).join("") + rect(-3, -12, 6, 12, sh(s, -0.25), 3) + `<path d="M0 -40 L0 -50 L7 -47 L0 -44" stroke="${t.ink}" stroke-width="1.2" fill="${t.primary}"/>` + rect(8, -18, 12, 18, sh(s, -0.12));
370
+ } },
371
+ // ---------------- educação / carreira ----------------
372
+ school: { kind: "ground", w: 170, h: 150, tags: ["escola", "colégio", "colegio"],
373
+ draw: (p, t) => {
374
+ const c = col(t, p.color, t.primary), roof = t.secondary;
375
+ return shadow(t, 92, 5) +
376
+ rect(-80, -86, 160, 86, c) + rect(30, -86, 50, 86, sh(c, -0.12)) + rect(-80, -90, 160, 6, sh(c, -0.3)) +
377
+ rect(-28, -122, 56, 40, c) + rect(10, -122, 18, 40, sh(c, -0.12)) +
378
+ `<path d="M-36 -120 L0 -146 L36 -120 Z" fill="${roof}"/><path d="M0 -146 L36 -120 L14 -120 Z" fill="${sh(roof, -0.18)}"/>` +
379
+ circle(0, -106, 9, t.paper, `stroke="${sh(c, -0.35)}" stroke-width="2"`) + `<path d="M0 -106 L0 -112 M0 -106 L4 -104" stroke="${t.ink}" stroke-width="1.6" stroke-linecap="round"/>` +
380
+ rect(-14, -46, 28, 46, t.woodDark, 2) + rect(0, -46, 14, 46, sh(t.woodDark, -0.15)) +
381
+ [-66, -44, 24, 46].map((x) => rect(x, -70, 18, 18, t.glass, 2, `stroke="${t.paper}" stroke-width="2.5"`)).join("") +
382
+ [-66, -44, 24, 46].map((x) => rect(x, -40, 18, 18, t.glass, 2, `stroke="${t.paper}" stroke-width="2.5"`)).join("") +
383
+ `<path d="M60 -86 L60 -150" stroke="${t.metal}" stroke-width="2.5"/><path d="M60 -150 L82 -144 L60 -137 Z" fill="${t.accent}"/>`;
384
+ } },
385
+ university: { kind: "ground", w: 190, h: 150, tags: ["universidade", "faculdade", "campus", "museu"],
386
+ draw: (p, t) => {
387
+ const c = col(t, p.color, t.paper), d = sh(c, -0.14);
388
+ let s = shadow(t, 100, 5) + rect(-95, -12, 190, 12, sh(c, -0.2)) + rect(-90, -20, 180, 8, d) + rect(-85, -108, 170, 90, sh(c, -0.06));
389
+ for (let i = 0; i < 6; i++) {
390
+ const x = -75 + i * 30;
391
+ s += rect(x, -100, 12, 80, c) + rect(x + 7, -100, 5, 80, d) + rect(x - 3, -104, 18, 5, d) + rect(x - 3, -22, 18, 4, d);
392
+ }
393
+ return s + rect(-92, -114, 184, 10, c) + rect(-92, -106, 184, 3, d) +
394
+ `<path d="M-96 -114 L0 -150 L96 -114 Z" fill="${c}"/><path d="M0 -150 L96 -114 L40 -114 Z" fill="${d}"/><path d="M-70 -118 L0 -143 L70 -118 Z" fill="${sh(c, -0.08)}"/>` +
395
+ circle(0, -127, 7, t.accent) + rect(-12, -60, 24, 40, t.woodDark, 2);
396
+ } },
397
+ lab: { kind: "ground", w: 160, h: 140, tags: ["laboratório", "laboratorio", "centro de pesquisa", "research"],
398
+ draw: (p, t) => {
399
+ const c = col(t, p.color, t.secondary);
400
+ let s = shadow(t, 86, 5) + rect(-80, -100, 160, 100, c) + rect(30, -100, 50, 100, sh(c, -0.14)) + rect(-84, -106, 168, 8, sh(c, -0.3));
401
+ for (let y = -88; y < -20; y += 22)
402
+ for (let x = -70; x < 70; x += 24)
403
+ s += rect(x, y, 18, 14, t.glass, 1) + rect(x, y + 10, 18, 4, sh(t.glass, -0.12));
404
+ s += rect(-16, -30, 32, 30, sh(c, -0.35), 2) + rect(-14, -28, 13, 28, t.glass, 1, "opacity=\"0.8\"") + rect(1, -28, 13, 28, t.glass, 1, "opacity=\"0.8\"");
405
+ // dome do observatório + frasco no letreiro
406
+ s += `<path d="M30 -106 A26 26 0 0 1 82 -106 Z" fill="${t.metal}"/><path d="M56 -132 A26 26 0 0 1 82 -106 L56 -106 Z" fill="${sh(t.metal, -0.15)}"/><path d="M52 -128 L70 -140" stroke="${t.ink}" stroke-width="4" stroke-linecap="round"/>`;
407
+ s += rect(-60, -128, 54, 20, t.paper, 4) + `<path d="M-46 -125 L-46 -119 L-51 -111 L-37 -111 L-42 -119 L-42 -125 Z" fill="${t.accent}"/>` + rect(-33, -121, 22, 3, t.ink, 1) + rect(-33, -115, 16, 3, t.ink, 1);
408
+ return s;
409
+ } },
410
+ stage: { kind: "ground", w: 180, h: 130, tags: ["palco", "cerimônia", "cerimonia", "formatura", "ceremony"],
411
+ draw: (p, t) => {
412
+ const c = col(t, p.color, t.primary), d = sh(c, -0.18);
413
+ return shadow(t, 96, 5) + rect(-86, -126, 8, 106, t.woodDark) + rect(78, -126, 8, 106, t.woodDark) + rect(-90, -132, 180, 10, t.woodDark, 2) +
414
+ `<path d="M-78 -122 Q-70 -60 -78 -20 L-50 -20 Q-56 -80 -40 -122 Z" fill="${c}"/><path d="M78 -122 Q70 -60 78 -20 L50 -20 Q56 -80 40 -122 Z" fill="${d}"/>` +
415
+ `<path d="M-40 -122 Q0 -108 40 -122 L40 -116 Q0 -100 -40 -116 Z" fill="${d}"/>` +
416
+ rect(-36, -112, 72, 18, t.paper, 3) + rect(-26, -106, 52, 3, t.ink, 1) +
417
+ rect(-94, -22, 188, 22, sh(t.wood, -0.05), 2) + rect(-94, -22, 188, 5, sh(t.wood, 0.15), 2) + rect(-94, -6, 188, 6, sh(t.wood, -0.25)) +
418
+ rect(-14, -56, 28, 34, t.woodDark, 2) + rect(-18, -60, 36, 6, sh(t.woodDark, -0.15), 2) + circle(0, -42, 5, t.accent);
419
+ } },
420
+ finish_flag: { kind: "ground", w: 50, h: 90, tags: ["bandeira de chegada", "chegada", "finish", "bandeira quadriculada"],
421
+ draw: (p, t) => {
422
+ let s = shadow(t, 10, 2) + `<path d="M0 0 L0 -90" stroke="${t.ink}" stroke-width="3.5" stroke-linecap="round"/>`;
423
+ for (let i = 0; i < 4; i++)
424
+ for (let j = 0; j < 3; j++)
425
+ s += rect(2 + i * 10, -88 + j * 10 + (i % 2 ? 1 : 0), 10, 10, (i + j) % 2 ? t.ink : t.paper);
426
+ return s + rect(2, -88, 40, 30, "none", 0, `stroke="${t.ink}" stroke-width="1.2"`);
427
+ } },
428
+ pennant: { kind: "ground", w: 30, h: 70, tags: ["bandeirinha", "flag"],
429
+ draw: (p, t) => shadow(t, 7, 1.6) + `<path d="M0 0 L0 -70" stroke="${t.metal}" stroke-width="2.5"/><path d="M1 -70 L28 -62 L1 -54 Z" fill="${col(t, p.color, t.accent)}"/>` },
430
+ balloons: { kind: "ground", w: 40, h: 100, tags: ["balões", "baloes", "festa", "party"],
431
+ draw: (p, t) => {
432
+ const cs = [t.primary, t.accent, t.secondary];
433
+ return `<path d="M0 0 Q-6 -40 -12 -70 M0 0 Q2 -45 4 -82 M0 0 Q8 -36 16 -66" stroke="${t.metal}" stroke-width="1" fill="none"/>` +
434
+ [[-12, -78, cs[0]], [4, -91, cs[1]], [16, -74, cs[2]]].map(([x, y, c]) => ell(x, y, 9, 11, c) + ell(x - 3, y - 4, 2.5, 3.5, t.paper, "opacity=\"0.45\"")).join("");
435
+ } },
436
+ diploma: { kind: "any", w: 26, h: 12, tags: ["diploma", "canudo", "certificado"],
437
+ draw: (p, t) => rect(-13, -10, 26, 10, t.paper, 5) + rect(-13, -10, 26, 4, sh(t.paper, 0.0), 5) + rect(-13, -4, 26, 4, sh(t.paper, -0.12), 2) + rect(-2, -11, 4, 12, t.primary) + `<path d="M0 0 L-3 6 M0 0 L3 6" stroke="${t.primary}" stroke-width="1.6"/>` },
438
+ trophy: { kind: "surface", w: 24, h: 30, tags: ["troféu", "trofeu", "prêmio"],
439
+ draw: (p, t) => rect(-9, -4, 18, 4, t.woodDark, 1) + rect(-3, -12, 6, 8, t.accent) + `<path d="M-10 -30 L10 -30 Q10 -14 0 -12 Q-10 -14 -10 -30 Z" fill="${t.accent}"/><path d="M2 -30 L10 -30 Q10 -14 0 -12 Z" fill="${sh(t.accent, -0.15)}"/>` +
440
+ `<path d="M-10 -27 Q-16 -27 -14 -21 Q-12 -17 -8 -18 M10 -27 Q16 -27 14 -21 Q12 -17 8 -18" stroke="${t.accent}" stroke-width="2" fill="none"/>` },
441
+ // ---------------- escritório (móveis modulares) ----------------
442
+ desk_slab: { kind: "ground", hollow: true, w: 120, h: 46, top: 46, tags: ["tampo", "bancada", "desk top", "mesa planejada"],
443
+ size: (p) => ({ w: p.width || 120, h: p.height || 46 }), topOf: (p) => p.height || 46,
444
+ draw: (p, t) => {
445
+ const w = p.width || 120, h = p.height || 46, th = p.thickness || 4, c = col(t, p.color, t.wood);
446
+ let s = rect(-w / 2, -h, w, th, c) + rect(-w / 2, -h + th - 1.2, w, 1.2, sh(c, -0.18)) + rect(-w / 2, -h, w, 0.8, sh(c, 0.25));
447
+ const ends = p.ends || "none";
448
+ if (ends === "left" || ends === "both")
449
+ s = rect(-w / 2, -h, 3, h, sh(c, -0.06)) + rect(-w / 2 + 2, -h, 1, h, sh(c, -0.2)) + s;
450
+ if (ends === "right" || ends === "both")
451
+ s = rect(w / 2 - 3, -h, 3, h, sh(c, -0.12)) + s;
452
+ return s;
453
+ } },
454
+ drawer_unit: { kind: "ground", w: 26, h: 42, tags: ["gaveteiro", "gavetas", "drawers"],
455
+ size: (p) => ({ w: p.width || 26, h: p.height || 42 }),
456
+ draw: (p, t) => {
457
+ const w = p.width || 26, h = p.height || 42, n = p.drawers || 4, c = col(t, p.color, t.wood), plinth = 2.5;
458
+ let s = shadow(t, w * 0.55, 1.8) + rect(-w / 2, -h, w, h, sh(c, -0.08)) + rect(-w / 2, -plinth, w, plinth, sh(c, -0.25));
459
+ const dh = (h - plinth - 1) / n;
460
+ for (let i = 0; i < n; i++) {
461
+ const y = -h + 0.6 + i * dh;
462
+ s += rect(-w / 2 + 0.8, y, w - 1.6, dh - 0.7, c, 0.6) + rect(-w / 2 + 0.8, y + dh - 1.4, w - 1.6, 0.7, sh(c, -0.15)) +
463
+ rect(-w * 0.28, y + dh * 0.42, w * 0.56, 0.8, t.metal, 0.4) + rect(-w * 0.28, y + dh * 0.42 + 0.6, w * 0.56, 0.35, sh(t.metal, -0.3));
464
+ }
465
+ return s;
466
+ } },
467
+ cabinet: { kind: "ground", w: 40, h: 36, tags: ["armário", "armario", "gabinete", "cabinet"],
468
+ size: (p) => ({ w: p.width || 40, h: p.height || 36 }),
469
+ draw: (p, t) => {
470
+ const w = p.width || 40, h = p.height || 36, n = p.doors || 2, c = col(t, p.color, t.wood), plinth = 2;
471
+ let s = shadow(t, w * 0.52, 1.8) + rect(-w / 2, -h, w, h, sh(c, -0.1)) + rect(-w / 2 + 1, -plinth, w - 2, plinth, sh(c, -0.3));
472
+ const dw = (w - 1) / n;
473
+ for (let i = 0; i < n; i++) {
474
+ const x = -w / 2 + 0.5 + i * dw;
475
+ s += rect(x + 0.3, -h + 0.5, dw - 0.6, h - plinth - 0.8, c, 0.4) + rect(x + dw - 1.2, -h + 0.5, 0.9, h - plinth - 0.8, sh(c, -0.12));
476
+ const hx = i < n / 2 ? x + dw - 2.6 : x + 1.8;
477
+ if (n > 1 || p.handle !== false)
478
+ s += rect(hx, -h * 0.72, 0.8, h * 0.3, t.metal, 0.4);
479
+ }
480
+ return s;
481
+ } },
482
+ rolling_cart: { kind: "ground", w: 26, h: 36, top: 36, tags: ["gaveteiro com rodinhas", "carrinho", "rolling cabinet"],
483
+ draw: (p, t) => {
484
+ const c = col(t, p.color, t.wood), d = sh(c, -0.35);
485
+ let s = shadow(t, 14, 1.5) + rect(-13, -36, 26, 33, sh(c, -0.08)) +
486
+ rect(-11.5, -34.5, 23, 9, d) + rect(-11.5, -24, 23, 9, d) + rect(-13, -25.5, 26, 1.5, c) +
487
+ rect(-9, -30, 10, 4.5, t.paper, 0.5) + rect(-8, -31, 6, 1.5, t.primary) + rect(3, -29, 5, 3.5, t.paper) +
488
+ rect(-9, -21.5, 17, 6, t.ink, 1) + rect(-9, -21.5, 17, 1, sh(t.ink, 0.2));
489
+ [-14.5, -8.5].forEach((y) => { s += rect(-12, y, 24, 5.6, c, 0.5) + rect(-7, y + 2.6, 14, 0.8, t.metal, 0.4); });
490
+ return s + [-10, 10].map((x) => circle(x, -1.5, 1.6, t.ink)).join("");
491
+ } },
492
+ trash_can: { kind: "ground", w: 9, h: 15, tags: ["lixeira", "cesto de lixo", "bin"],
493
+ draw: (p, t) => {
494
+ const c = col(t, p.color, "#C9CCD0");
495
+ return shadow(t, 5.5, 1) + rect(-4.5, -13.5, 9, 13, c, 1.2) + rect(-4.5, -13.5, 2.2, 13, sh(c, 0.35), 1) + rect(1.8, -13.5, 2.7, 13, sh(c, -0.22), 1) +
496
+ ell(0, -13.6, 4.6, 1.2, sh(c, -0.1)) + rect(-4.7, -15, 9.4, 1.8, sh(c, -0.05), 0.8) + rect(-1.5, -1.5, 3, 1.5, t.ink, 0.5);
497
+ } },
498
+ office_chair: { kind: "ground", w: 42, h: 60, tags: ["cadeira de escritório", "cadeira presidente", "office chair", "gamer chair"],
499
+ draw: (p, t) => {
500
+ const c = col(t, p.color, "#1F1F24"), chrome = "#B9BEC4", d = sh(c, 0.12);
501
+ let s = shadow(t, 22, 2.2);
502
+ // base em estrela
503
+ [[-19, -2], [19, -2], [-11, 0.5], [11, 0.5], [0, -3.5]].forEach(([x, y]) => { s += `<path d="M0 -5 L${x} ${y}" stroke="${chrome}" stroke-width="2.2" stroke-linecap="round"/>` + circle(x, y + 0.6, 1.6, t.ink); });
504
+ s += rect(-1.3, -16, 2.6, 11, chrome) + rect(-0.3, -16, 0.9, 11, "#FFFFFF", 0, "opacity=\"0.5\"");
505
+ // assento e braços
506
+ s += rect(-18, -21, 36, 6, sh(c, 0.05), 3) + rect(-21, -29, 5, 13, c, 2) + rect(16, -29, 5, 13, c, 2) + rect(-21, -30, 6, 2.5, d, 1) + rect(15, -30, 6, 2.5, d, 1);
507
+ if (p.draped)
508
+ s += `<path d="M-22 -31 Q-25 -22 -23 -12 L-17 -14 Q-18 -22 -16 -30 Z" fill="${col(t, p.draped === true ? "metal" : p.draped, t.metal)}"/>`;
509
+ // encosto alto acolchoado
510
+ s += `<path d="M-15 -22 L-16 -52 Q-16 -60 -8 -60 L8 -60 Q16 -60 16 -52 L15 -22 Z" fill="${c}"/>` +
511
+ `<path d="M-13 -55 Q0 -58 13 -55" stroke="${d}" stroke-width="1" fill="none"/><path d="M-13 -44 Q0 -46 13 -44" stroke="${d}" stroke-width="0.8" fill="none"/>` +
512
+ `<path d="M-6 -57 L-6.5 -24 M6 -57 L6.5 -24" stroke="${d}" stroke-width="0.8"/>` + `<path d="M-14 -50 Q-15 -36 -13.5 -24" stroke="${sh(c, 0.22)}" stroke-width="1.6" fill="none" opacity="0.7"/>`;
513
+ return s;
514
+ } },
515
+ laptop_open: { kind: "surface", w: 17, h: 18, tags: ["notebook aberto", "laptop de frente", "laptop stand"],
516
+ draw: (p, t) => {
517
+ const lift = p.stand === false ? 0 : 5;
518
+ let s = "";
519
+ if (lift)
520
+ s += `<path d="M-6 0 L4 -${lift} M6 0 L-4 -${lift}" stroke="${t.metal}" stroke-width="1" />` + rect(-7, -0.8, 14, 0.8, t.metal);
521
+ s += `<path d="M-8.5 ${-lift} L8.5 ${-lift} L7 ${-lift - 2.2} L-7 ${-lift - 2.2} Z" fill="${sh(t.ink, 0.25)}"/>` +
522
+ rect(-7.2, -lift - 13, 14.4, 11, t.ink, 0.8) + rect(-6.4, -lift - 12.2, 12.8, 9, p.on ? t.glass : sh(t.ink, 0.12), 0.4) +
523
+ `<path d="M-6.4 ${-lift - 12.2} L-1 ${-lift - 12.2} L-6.4 ${-lift - 6} Z" fill="#FFFFFF" opacity="0.08"/>`;
524
+ return s;
525
+ } },
526
+ headphones: { kind: "surface", w: 10, h: 9, tags: ["fone", "headset", "fone de ouvido"],
527
+ draw: (p, t) => {
528
+ const c = col(t, p.color, t.ink);
529
+ return `<path d="M-4.5 -2.5 Q-4.5 -9 0 -9 Q4.5 -9 4.5 -2.5" stroke="${c}" stroke-width="1.3" fill="none"/>` + ell(-4.2, -2.3, 2.3, 2.6, c) + ell(4.2, -2.3, 2.3, 2.6, sh(c, 0.15)) +
530
+ (p.mic !== false ? `<path d="M-5.5 -3 Q-9 -6 -7.5 -11" stroke="${c}" stroke-width="0.7" fill="none"/>` + circle(-7.5, -11.2, 0.8, c) : "");
531
+ } },
532
+ cap: { kind: "surface", w: 10, h: 6, tags: ["boné", "bone", "baseball cap"],
533
+ draw: (p, t) => {
534
+ const c = col(t, p.color, t.ink);
535
+ return `<path d="M-5 -1 Q-5 -6.5 0 -6.5 Q5 -6.5 5 -1 Z" fill="${c}"/><path d="M-1 -1 L6.5 -0.2 Q6.5 0.6 5 0.6 L-1 0.2 Z" fill="${sh(c, 0.12)}"/>` +
536
+ rect(-2.5, -4.8, 5, 2.2, col(t, p.logo, t.accent), 0.4) + rect(-1.8, -4.2, 3.6, 0.5, t.paper);
537
+ } },
538
+ photo_frame: { kind: "surface", w: 10, h: 13, tags: ["porta-retrato", "quadrinho", "moldura", "photo frame", "pôster de mesa"],
539
+ size: (p) => ({ w: p.width || 10, h: p.height || 13 }),
540
+ draw: (p, t) => {
541
+ const w = p.width || 10, h = p.height || 13, fc = col(t, p.frame, t.ink), m = Math.min(w, h) * 0.08, iw = w - m * 2, ih = h - m * 2, x0 = -w / 2 + m, y0 = -h + m;
542
+ const bg = col(t, p.bg, t.paper);
543
+ let art = rect(x0, y0, iw, ih, bg);
544
+ const a = p.art || "portrait";
545
+ if (a === "portrait")
546
+ art += rect(x0, y0, iw, ih, sh(col(t, p.bg, t.secondary), 0.15)) + circle(0, y0 + ih * 0.4, iw * 0.16, "#D9A27A") + `<path d="M${x0 + iw * 0.18} ${y0 + ih} Q0 ${y0 + ih * 0.5} ${x0 + iw * 0.82} ${y0 + ih} Z" fill="${t.ink}"/>` + circle(0, y0 + ih * 0.34, iw * 0.17, sh(t.ink, 0.1), "opacity=\"0.0\"");
547
+ else if (a === "landscape")
548
+ art += `<path d="M${x0} ${y0 + ih} L${x0 + iw * 0.35} ${y0 + ih * 0.45} L${x0 + iw * 0.6} ${y0 + ih * 0.75} L${x0 + iw * 0.75} ${y0 + ih * 0.6} L${x0 + iw} ${y0 + ih} Z" fill="${t.secondary}"/>` + circle(x0 + iw * 0.72, y0 + ih * 0.28, iw * 0.1, t.accent);
549
+ else if (a === "poster")
550
+ art += rect(x0, y0, iw, ih, col(t, p.bg, t.primary)) + `<path d="M0 ${y0 + ih * 0.45} L${x0} ${y0} L${x0 + iw * 0.4} ${y0} Z M0 ${y0 + ih * 0.45} L${x0 + iw} ${y0 + ih * 0.1} L${x0 + iw} ${y0 + ih * 0.45} Z M0 ${y0 + ih * 0.45} L${x0 + iw * 0.7} ${y0 + ih} L${x0 + iw * 0.3} ${y0 + ih} Z" fill="${t.accent}" opacity="0.75"/>` + circle(0, y0 + ih * 0.45, iw * 0.22, sh(t.accent, 0.4));
551
+ else if (a === "text")
552
+ art += rect(x0, y0, iw, ih, col(t, p.bg, "#2B2B30")) + [0.3, 0.45, 0.6].map((k, i) => rect(x0 + iw * 0.2, y0 + ih * k, iw * (0.6 - i * 0.12), ih * 0.06, t.paper, 0.3, "opacity=\"0.85\"")).join("");
553
+ else if (a === "abstract")
554
+ art += circle(x0 + iw * 0.35, y0 + ih * 0.4, iw * 0.25, t.primary, "opacity=\"0.8\"") + circle(x0 + iw * 0.62, y0 + ih * 0.62, iw * 0.22, t.accent, "opacity=\"0.8\"");
555
+ return rect(-w / 2 + 0.5, -h + 0.6, w, h, "#000000", 0.4, "opacity=\"0.12\"") + rect(-w / 2, -h, w, h, fc, 0.4) + art + rect(-w / 2, -h, w * 0.18, h, "#FFFFFF", 0, "opacity=\"0.06\"");
556
+ } },
557
+ figurine: { kind: "surface", w: 4, h: 6, tags: ["boneco", "miniatura", "action figure", "toy"],
558
+ draw: (p, t) => {
559
+ const c = col(t, p.color, t.primary);
560
+ return ell(0, -0.4, 2, 0.6, sh(c, -0.3)) + rect(-1.4, -3.6, 2.8, 3.2, c, 1) + circle(0, -4.9, 1.7, "#F0C8A0") + `<path d="M-1.8 -5.2 Q0 -7.4 1.8 -5.2 Z" fill="${col(t, p.hair, t.ink)}"/>` + rect(-1.9, -3.4, 0.7, 2, sh(c, -0.2), 0.3);
561
+ } },
562
+ tumbler: { kind: "surface", w: 5, h: 11, tags: ["copo com canudo", "copo térmico", "tumbler"],
563
+ draw: (p, t) => {
564
+ const c = col(t, p.color, t.paper);
565
+ return `<path d="M-2.3 -8 L2.3 -8 L1.8 0 L-1.8 0 Z" fill="${c}"/><path d="M0.6 -8 L2.3 -8 L1.8 0 L0.6 0 Z" fill="${sh(c, -0.1)}"/>` + rect(-2.6, -8.8, 5.2, 1, sh(c, -0.05), 0.4) +
566
+ `<path d="M0.5 -8.8 L1.2 -12" stroke="${sh(c, -0.12)}" stroke-width="0.6"/>` + rect(-1.4, -5, 2.8, 1.2, t.ink, 0.2, "opacity=\"0.55\"");
567
+ } },
568
+ paper_cup: { kind: "surface", w: 4.5, h: 6, tags: ["copo de café", "café para viagem", "coffee to go"],
569
+ draw: (p, t) => `<path d="M-2 -5 L2 -5 L1.6 0 L-1.6 0 Z" fill="${t.paper}"/><path d="M0.6 -5 L2 -5 L1.6 0 L0.6 0 Z" fill="${sh(t.paper, -0.1)}"/>` + rect(-2.3, -5.9, 4.6, 1, t.ink, 0.4) + rect(-1.9, -3.4, 3.7, 1.6, col(t, p.sleeve, t.woodDark), 0.2) },
570
+ plastic_bag: { kind: "surface", w: 11, h: 9, tags: ["sacola", "sacola plástica", "bag"],
571
+ draw: (p, t) => `<path d="M-5.5 0 Q-6 -5 -3.5 -7.5 Q-2 -9.5 0 -8 Q2.5 -9.8 4 -7.2 Q6.3 -4.5 5.5 0 Z" fill="${col(t, p.color, "#F2F2F0")}"/>` +
572
+ `<path d="M-3 -6 Q-1 -3 -2 -1 M1.5 -7 Q3 -4 2 -0.5 M-0.5 -4 L0.5 -2" stroke="#C9C9C6" stroke-width="0.4" fill="none"/>` + rect(-2, -3.5, 3, 2, "#9A9A98", 0.3, "opacity=\"0.35\"") },
573
+ cables: { kind: "surface", w: 14, h: 4, tags: ["cabos", "fios", "carregador"],
574
+ draw: (p, t) => {
575
+ const drop = p.drop ?? 30, c = col(t, p.color, t.ink);
576
+ return `<path d="M-7 -1 Q-3 -5 0 -1.5 Q3 1 6 -3 M-5 -0.5 Q-1 -3 3 -0.3" stroke="${c}" stroke-width="0.55" fill="none"/>` + rect(-2, -1.6, 3.5, 1.4, c, 0.3) +
577
+ `<path d="M-4 0 Q-6 ${drop * 0.5} -3 ${drop} M5 0 Q8 ${drop * 0.4} 4 ${drop * 0.75}" stroke="${c}" stroke-width="0.45" fill="none"/>`;
578
+ } },
579
+ light_switch: { kind: "wall", w: 5, h: 7, elevation: 110, tags: ["interruptor", "tomada", "switch"],
580
+ draw: (p, t) => rect(-2.4, -7, 5, 7, "rgba(0,0,0,0.08)", 0.6) + rect(-2.5, -7.2, 5, 7, t.paper, 0.6) + rect(-1, -5.2, 2, 3, sh(t.paper, -0.08), 0.4) },
581
+ glass_shelf: { kind: "ground", hollow: true, w: 14, h: 46, top: 46, tags: ["prateleira de vidro", "vidro", "glass shelf"],
582
+ size: (p) => ({ w: p.width || 14, h: p.height || 46 }), topOf: (p) => p.height || 46,
583
+ draw: (p, t) => {
584
+ const w = p.width || 14, h = p.height || 46;
585
+ return `<path d="M${-w / 2} ${-h + 1.6} L${w / 2} ${-h + 1.6} L${w / 2} ${-h} L${-w / 2 + 2} ${-h} Z" fill="${t.glass}" opacity="0.55"/>` +
586
+ `<path d="M${-w / 2} ${-h + 1.6} L${w / 2} ${-h + 1.6}" stroke="${sh(t.glass, -0.35)}" stroke-width="0.5"/>` + rect(-w / 2, -h + 1.6, w, 1.2, t.ink, 0, "opacity=\"0.08\"");
587
+ } },
588
+ };
589
+ // Busca por nome ou sinônimo; devolve id ou sugestões
590
+ export function resolveAsset(name, LIB = ASSETS) {
591
+ if (LIB[name])
592
+ return { id: name };
593
+ const n = name.toLowerCase();
594
+ for (const [id, a] of Object.entries(LIB))
595
+ if ((a.tags || []).includes(n))
596
+ return { id };
597
+ const lev = (a, b) => {
598
+ const d = Array.from({ length: a.length + 1 }, (_, i) => [i]);
599
+ for (let j = 1; j <= b.length; j++)
600
+ d[0][j] = j;
601
+ for (let i = 1; i <= a.length; i++)
602
+ for (let j = 1; j <= b.length; j++)
603
+ d[i][j] = Math.min(d[i - 1][j] + 1, d[i][j - 1] + 1, d[i - 1][j - 1] + (a[i - 1] === b[j - 1] ? 0 : 1));
604
+ return d[a.length][b.length];
605
+ };
606
+ const cands = [];
607
+ for (const [id, a] of Object.entries(LIB))
608
+ for (const k of [id, ...(a.tags || [])])
609
+ cands.push([lev(n, k), id]);
610
+ cands.sort((x, y) => x[0] - y[0]);
611
+ return { id: null, suggest: [...new Set(cands.slice(0, 6).map((c) => c[1]))].slice(0, 3) };
612
+ }