-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
2861 lines (2694 loc) · 150 KB
/
Copy pathindex.html
File metadata and controls
2861 lines (2694 loc) · 150 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
<meta name="theme-color" content="#f6f3ec">
<title>OMERTÀ — Family Business</title>
<meta name="description" content="Build a criminal empire in this loving homage to the browser mob games of 2009. Jobs, fights, bosses, collections, properties — free, no signup, saves in your browser.">
<meta property="og:title" content="OMERTÀ — Family Business">
<meta property="og:description" content="Run jobs, fight rivals, take down bosses and build the most profitable crime family in the city. Free browser game, no signup.">
<meta property="og:type" content="website">
<meta property="og:image" content="https://solid-apps.github.io/mafia/og-image.png">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta name="twitter:card" content="summary_large_image">
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🕴️</text></svg>">
<style>
:root{
--bg:#f6f3ec;
--card:#fffdf8;
--ink:#33302a;
--muted:#8d8577;
--line:#e8e1d2;
--gold:#b08a1f;
--gold-soft:#f3e9cd;
--green:#2e7d4f;
--green-soft:#e2f0e7;
--red:#b8433a;
--red-soft:#f7e4e2;
--blue:#3c6e9f;
--blue-soft:#e3edf6;
--orange:#c07a2c;
--orange-soft:#f7ecdd;
--shadow:0 1px 3px rgba(60,50,30,.08), 0 8px 24px rgba(60,50,30,.06);
}
*{box-sizing:border-box;margin:0;padding:0}
body{
background:var(--bg) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="140" height="140"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency=".85" numOctaves="2" stitchTiles="stitch"/></filter><rect width="140" height="140" filter="url(%23n)" opacity=".05"/></svg>');
color:var(--ink);
font:15px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
min-height:100vh;
}
.wrap{
max-width:860px;margin:0 auto;
padding:16px max(16px, env(safe-area-inset-right)) calc(80px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
button{touch-action:manipulation}
/* sticky mini-hud (appears when the full HUD scrolls away) */
#stickyhud{
position:fixed;top:0;left:0;right:0;z-index:55;
display:none;justify-content:center;gap:14px;flex-wrap:wrap;
padding:7px max(12px, env(safe-area-inset-right)) 7px max(12px, env(safe-area-inset-left));
background:rgba(255,253,248,.92);backdrop-filter:blur(6px);
border-bottom:1px solid var(--line);font-size:13px;font-weight:600;
font-variant-numeric:tabular-nums;
}
#stickyhud.show{display:flex}
#stickyhud .g{color:var(--green)}
/* ---------- header ---------- */
header.masthead{
position:relative;border:1px solid var(--line);border-radius:14px;overflow:hidden;
background:linear-gradient(180deg,#fdfbf4 0%,#f6efdd 100%);
box-shadow:var(--shadow);margin-bottom:14px;
}
.mtxt{padding:20px 22px 0;position:relative;z-index:2}
h1{
font-family:Georgia,"Times New Roman",serif;
font-size:30px;letter-spacing:4px;font-weight:700;
}
h1 .tt{color:var(--gold)}
.tagline{color:var(--muted);font-size:13px;font-style:italic}
svg.sky{display:block;width:100%;height:80px;margin-top:-26px;position:relative;z-index:1}
/* ---------- svg art ---------- */
.pfp{width:54px;height:54px;flex:0 0 auto}
.pfp svg{width:100%;height:100%;display:block}
.pfp.boss{width:76px;height:76px}
.prop-art{width:106px;flex:0 0 auto;border-radius:9px;overflow:hidden;border:1px solid var(--line)}
.prop-art svg{display:block;width:100%;height:auto}
.gear{width:50px;height:50px;flex:0 0 auto}
.gear svg{width:100%;height:100%;display:block}
/* collections */
.coll-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(108px,1fr));gap:8px}
.citem{
border:1.5px dashed var(--line);border-radius:8px;padding:8px 6px;font-size:12px;
text-align:center;color:var(--muted);background:#fbf8f1;
}
.citem.got{border-style:solid;border-color:#e0cf9a;background:var(--gold-soft);color:var(--ink)}
.rare-tag{font-size:10px;color:var(--gold);font-weight:700;letter-spacing:1px;text-transform:uppercase}
a.act{display:inline-block;text-decoration:none;text-align:center}
/* juice */
.confetti{
position:fixed;top:-14px;width:8px;height:13px;z-index:90;pointer-events:none;
border-radius:2px;animation:confall linear forwards;
}
@keyframes confall{to{transform:translateY(108vh) rotate(740deg);opacity:.65}}
body.shake .wrap{animation:shakewrap .45s}
@keyframes shakewrap{
10%{transform:translate(-6px,2px)}25%{transform:translate(5px,-3px)}
40%{transform:translate(-4px,-2px)}55%{transform:translate(4px,2px)}
70%{transform:translate(-3px,1px)}85%{transform:translate(2px,-1px)}
}
/* city switcher */
#citybar{display:flex;gap:6px;margin-bottom:10px}
#citybar button{
flex:1;border:1px solid var(--line);background:var(--card);color:var(--muted);
padding:9px 14px;border-radius:11px;font-size:14px;font-weight:700;cursor:pointer;
transition:all .15s;
}
#citybar button:hover{border-color:var(--gold)}
#citybar button.active{background:var(--gold-soft);color:var(--ink);border-color:#e0cf9a}
#citybar button.locked{opacity:.55;cursor:not-allowed}
.hud{
background:var(--card);border:1px solid var(--line);border-radius:14px;
box-shadow:var(--shadow);padding:14px 16px;margin-bottom:14px;
}
.hud-top{display:flex;flex-wrap:wrap;gap:8px 20px;align-items:center;margin-bottom:10px}
.money{font-size:20px;font-weight:700;color:var(--green);font-variant-numeric:tabular-nums}
.money.pulse{animation:pulse .5s}
@keyframes pulse{30%{transform:scale(1.12)}}
.hud-chip{font-size:13px;color:var(--muted)}
.hud-chip b{color:var(--ink);font-variant-numeric:tabular-nums}
.lvl-badge{
background:var(--gold-soft);color:var(--gold);border:1px solid #e5d5a3;
font-weight:700;font-size:13px;border-radius:999px;padding:2px 12px;
}
.bars{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:10px 16px}
.bar-block{font-size:12px}
.bar-label{display:flex;justify-content:space-between;color:var(--muted);margin-bottom:3px}
.bar-label b{color:var(--ink);font-variant-numeric:tabular-nums}
.bar{height:10px;background:#eee7d8;border-radius:6px;overflow:hidden}
.bar i{display:block;height:100%;border-radius:6px;transition:width .4s ease}
.bar .energy{background:linear-gradient(90deg,#4d9b6d,#2e7d4f)}
.bar .stamina{background:linear-gradient(90deg,#d99a4e,#c07a2c)}
.bar .health{background:linear-gradient(90deg,#d4685f,#b8433a)}
.bar .xp{background:linear-gradient(90deg,#d3b256,#b08a1f)}
.bar-sub{color:var(--muted);font-size:11px;margin-top:2px;min-height:14px}
/* ---------- tabs ---------- */
nav{
display:flex;gap:6px;overflow-x:auto;padding:2px;margin-bottom:14px;
scrollbar-width:none;
}
nav::-webkit-scrollbar{display:none}
nav button{
border:1px solid var(--line);background:var(--card);color:var(--muted);
padding:8px 16px;border-radius:999px;font-size:14px;font-weight:600;
cursor:pointer;white-space:nowrap;transition:all .15s;
}
nav button:hover{border-color:var(--gold);color:var(--ink)}
nav button.active{background:var(--ink);color:#fffdf8;border-color:var(--ink)}
nav button .dot{
display:inline-block;width:7px;height:7px;border-radius:50%;
background:var(--red);margin-left:6px;vertical-align:1px;
}
/* ---------- cards ---------- */
.card{
background:var(--card);border:1px solid var(--line);border-radius:14px;
box-shadow:var(--shadow);padding:16px;margin-bottom:12px;position:relative;
}
.card h2{
font-family:Georgia,serif;font-size:19px;margin-bottom:2px;
}
.card .sub{color:var(--muted);font-size:13px;margin-bottom:12px}
.row{
display:flex;align-items:center;gap:12px;padding:12px 4px;
border-top:1px solid var(--line);flex-wrap:wrap;position:relative;
}
.row:first-of-type{border-top:none}
.row .info{flex:1;min-width:200px}
.row .name{font-weight:600}
.row .desc{color:var(--muted);font-size:13px}
.row .meta{font-size:12px;color:var(--muted);margin-top:2px}
.row .meta b{color:var(--ink)}
.stars{color:var(--gold);font-size:13px;letter-spacing:1px}
.stars .off{color:#ddd3bd}
.mini-bar{height:5px;background:#eee7d8;border-radius:3px;overflow:hidden;margin-top:5px;max-width:220px}
.mini-bar i{display:block;height:100%;background:var(--gold);border-radius:3px;transition:width .3s}
button.act, a.act{
background:var(--ink);color:#fffdf8;border:none;border-radius:9px;
padding:9px 18px;font-size:14px;font-weight:600;cursor:pointer;
transition:transform .08s, opacity .15s;min-width:96px;
}
button.act:hover:not(:disabled){transform:translateY(-1px)}
button.act:active:not(:disabled){transform:translateY(1px)}
button.act:disabled{opacity:.35;cursor:not-allowed}
button.act.gold, a.act.gold{background:var(--gold)}
button.act.red{background:var(--red)}
button.act.green{background:var(--green)}
button.ghost{
background:transparent;border:1px solid var(--line);color:var(--ink);
border-radius:9px;padding:8px 14px;font-size:13px;cursor:pointer;font-weight:600;
}
button.ghost:hover{border-color:var(--gold)}
.cost{font-size:12px;color:var(--muted);text-align:center;margin-top:4px}
.locked{opacity:.5}
.locked .name::after{content:" 🔒"}
.pill{
display:inline-block;font-size:11px;font-weight:700;border-radius:999px;
padding:1px 9px;margin-left:6px;vertical-align:1px;
}
.pill.gold{background:var(--gold-soft);color:var(--gold)}
.pill.green{background:var(--green-soft);color:var(--green)}
.pill.red{background:var(--red-soft);color:var(--red)}
.pill.blue{background:var(--blue-soft);color:var(--blue)}
.pill.orange{background:var(--orange-soft);color:var(--orange)}
/* boss */
.boss-hp{height:14px;background:#eee7d8;border-radius:7px;overflow:hidden;margin:8px 0 4px}
.boss-hp i{display:block;height:100%;background:linear-gradient(90deg,#d4685f,#b8433a);transition:width .3s}
.boss-dead{color:var(--green);font-weight:700}
/* profile grid */
.stat-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px;margin-bottom:6px}
.stat-tile{
border:1px solid var(--line);border-radius:10px;padding:10px 12px;background:#fbf8f1;
}
.stat-tile .k{font-size:12px;color:var(--muted)}
.stat-tile .v{font-size:19px;font-weight:700;font-variant-numeric:tabular-nums}
.sp-row{display:flex;align-items:center;gap:10px;padding:8px 4px;border-top:1px solid var(--line);flex-wrap:wrap}
.sp-row:first-child{border-top:none}
.ach{display:flex;gap:10px;align-items:center;padding:9px 4px;border-top:1px solid var(--line)}
.ach:first-of-type{border-top:none}
.ach .ico{font-size:20px;width:30px;text-align:center}
.ach.todo{opacity:.45;filter:grayscale(1)}
.ach .t{font-weight:600;font-size:14px}
.ach .d{color:var(--muted);font-size:12px}
/* toasts */
#toasts{position:fixed;top:14px;right:14px;z-index:60;display:flex;flex-direction:column;gap:8px;max-width:320px}
.toast{
background:var(--card);border:1px solid var(--line);border-left:4px solid var(--gold);
border-radius:10px;box-shadow:var(--shadow);padding:10px 14px;font-size:13px;
animation:slidein .25s ease;
}
.toast.green{border-left-color:var(--green)}
.toast.red{border-left-color:var(--red)}
.toast b{display:block;font-size:14px}
.toast.out{opacity:0;transform:translateX(20px);transition:all .4s}
@keyframes slidein{from{opacity:0;transform:translateX(30px)}to{opacity:1;transform:none}}
/* floating gains */
.float{
position:absolute;font-weight:700;font-size:14px;pointer-events:none;z-index:50;
animation:floatup 1.1s ease-out forwards;white-space:nowrap;
}
.float.green{color:var(--green)} .float.gold{color:var(--gold)} .float.red{color:var(--red)}
@keyframes floatup{from{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-38px)}}
/* modal */
#overlay{
position:fixed;inset:0;background:rgba(50,42,28,.45);z-index:70;
display:none;align-items:center;justify-content:center;padding:20px;
}
#overlay.show{display:flex}
.modal{
background:var(--card);border-radius:16px;box-shadow:0 20px 60px rgba(40,30,10,.35);
max-width:420px;width:100%;padding:26px;text-align:center;
animation:pop .25s ease;
}
@keyframes pop{from{transform:scale(.85);opacity:0}to{transform:scale(1);opacity:1}}
.modal .big{font-size:44px;margin-bottom:6px}
.modal h3{font-family:Georgia,serif;font-size:22px;margin-bottom:8px}
.modal p{color:var(--muted);font-size:14px;margin-bottom:6px}
.modal .reward{font-size:17px;font-weight:700;color:var(--green);margin:10px 0}
.modal button{margin-top:14px}
footer{color:var(--muted);font-size:12px;text-align:center;margin-top:30px}
footer a{color:var(--gold)}
@media (max-width:520px){
h1{font-size:24px}
.row .info{min-width:140px}
button.act, a.act{min-height:44px;padding:10px 18px}
button.ghost{min-height:40px}
nav button, #citybar button{min-height:40px}
.row > div:last-child{width:100%;text-align:right}
}
</style>
</head>
<body>
<div class="wrap">
<header class="masthead">
<div class="mtxt">
<h1>OMER<span class="tt">TÀ</span></h1>
<span class="tagline">the family business — silence is golden</span>
</div>
<svg class="sky" viewBox="0 0 860 110" preserveAspectRatio="xMidYMax slice" aria-hidden="true">
<circle cx="705" cy="30" r="24" fill="#ecd28e" opacity=".85"/>
<g fill="#ece3cd">
<rect x="0" y="55" width="40" height="55"/><rect x="55" y="42" width="34" height="68"/>
<rect x="120" y="60" width="50" height="50"/><rect x="200" y="38" width="30" height="72"/>
<rect x="260" y="52" width="44" height="58"/><rect x="330" y="30" width="26" height="80"/>
<rect x="390" y="48" width="40" height="62"/><rect x="460" y="36" width="30" height="74"/>
<rect x="520" y="55" width="46" height="55"/><rect x="600" y="42" width="30" height="68"/>
<rect x="660" y="52" width="44" height="58"/><rect x="740" y="40" width="30" height="70"/>
<rect x="800" y="56" width="60" height="54"/>
</g>
<g fill="#ddd1b2">
<rect x="105" y="66" width="46" height="44"/><rect x="118" y="56" width="20" height="10"/>
<rect x="180" y="50" width="34" height="60"/><rect x="190" y="40" width="14" height="10"/>
<rect x="250" y="62" width="54" height="48"/><rect x="266" y="50" width="22" height="12"/>
<rect x="340" y="44" width="30" height="66"/><rect x="349" y="34" width="12" height="10"/>
<rect x="420" y="58" width="44" height="52"/><rect x="432" y="46" width="20" height="12"/>
<rect x="500" y="40" width="26" height="70"/>
<rect x="560" y="60" width="50" height="50"/><rect x="575" y="48" width="20" height="12"/>
<rect x="650" y="46" width="32" height="64"/><rect x="659" y="36" width="14" height="10"/>
<rect x="720" y="58" width="46" height="52"/><rect x="800" y="46" width="28" height="64"/>
</g>
<g fill="#c9b992">
<rect x="60" y="70" width="54" height="40"/><rect x="150" y="78" width="70" height="32"/>
<rect x="280" y="66" width="60" height="44"/>
<path d="M400 110 V52 h10 v-14 h8 v-10 h6 v10 h8 v14 h10 v58 Z"/>
<rect x="420" y="12" width="3" height="16"/>
<rect x="500" y="72" width="64" height="38"/><rect x="640" y="68" width="58" height="42"/>
<rect x="760" y="74" width="70" height="36"/>
</g>
<g fill="#e8c876">
<rect x="408" y="60" width="4" height="8"/><rect x="419" y="60" width="4" height="8"/><rect x="430" y="60" width="4" height="8"/>
<rect x="408" y="76" width="4" height="8"/><rect x="419" y="76" width="4" height="8"/><rect x="430" y="76" width="4" height="8"/>
<rect x="72" y="78" width="5" height="6"/><rect x="86" y="78" width="5" height="6"/><rect x="100" y="78" width="5" height="6"/>
<rect x="296" y="76" width="5" height="6"/><rect x="312" y="76" width="5" height="6"/><rect x="328" y="76" width="5" height="6"/>
<rect x="516" y="82" width="5" height="6"/><rect x="532" y="82" width="5" height="6"/><rect x="548" y="82" width="5" height="6"/>
<rect x="656" y="78" width="5" height="6"/><rect x="672" y="78" width="5" height="6"/>
</g>
</svg>
</header>
<div class="hud">
<div class="hud-top">
<span class="money" id="hud-cash">$0</span>
<span class="hud-chip">🏦 bank <b id="hud-bank">$0</b></span>
<span class="hud-chip">📈 <b id="hud-income">$0</b>/hr</span>
<span class="hud-chip" id="hud-pesochip" style="display:none">🌴 <b id="hud-pesos">P$0</b> · <b id="hud-pincome">P$0</b>/hr</span>
<span class="hud-chip" id="hud-rublechip" style="display:none">❄️ <b id="hud-rubles">₽0</b> · <b id="hud-rincome">₽0</b>/hr</span>
<span class="lvl-badge" id="hud-level">Level 1</span>
<span class="hud-chip">🎖️ <b id="hud-fp">0</b> favors</span>
<span class="hud-chip" id="hud-sp" style="display:none">✨ <b></b> skill points to spend</span>
</div>
<div class="bars">
<div class="bar-block">
<div class="bar-label"><span>⚡ Energy</span><b id="hud-energy-n">0/0</b></div>
<div class="bar"><i class="energy" id="hud-energy-bar"></i></div>
<div class="bar-sub" id="hud-energy-t"></div>
</div>
<div class="bar-block">
<div class="bar-label"><span>🔥 Stamina</span><b id="hud-stamina-n">0/0</b></div>
<div class="bar"><i class="stamina" id="hud-stamina-bar"></i></div>
<div class="bar-sub" id="hud-stamina-t"></div>
</div>
<div class="bar-block">
<div class="bar-label"><span>❤️ Health</span><b id="hud-health-n">0/0</b></div>
<div class="bar"><i class="health" id="hud-health-bar"></i></div>
<div class="bar-sub" id="hud-health-t"></div>
</div>
<div class="bar-block">
<div class="bar-label"><span>⭐ Experience</span><b id="hud-xp-n">0/0</b></div>
<div class="bar"><i class="xp" id="hud-xp-bar"></i></div>
<div class="bar-sub" id="hud-xp-t"></div>
</div>
</div>
</div>
<div id="citybar"></div>
<nav id="nav"></nav>
<main id="main"></main>
<footer>a loving homage to the browser mob games of 2009 · your empire is saved in this browser</footer>
</div>
<div id="stickyhud">
<span class="g" id="sh-cash">$0</span>
<span>⚡ <span id="sh-energy">0/0</span></span>
<span>🔥 <span id="sh-stamina">0/0</span></span>
<span>❤️ <span id="sh-health">0/0</span></span>
</div>
<div id="toasts"></div>
<div id="overlay"><div class="modal" id="modal"></div></div>
<script>
'use strict';
/* =====================================================================
OMERTÀ — a single-file Mafia-Wars-style idle/RPG. No dependencies.
===================================================================== */
/* ---------------- game data ---------------- */
const REGEN = { energy: 8000, stamina: 20000, health: 12000 }; // ms per point
const OFFLINE_CAP_MS = 8 * 3600 * 1000;
const MASTERY_PER_STAR = 10;
const STAR_BONUS = 0.10; // +10% cash per mastery star
const BANK_FEE = 0.10;
const FIGHT_LOSS_CASH = 0.10; // % of cash-on-hand lost when you lose a fight
const TIERS = [
{ id:'thug', name:'Street Thug', lvl:1, icon:'🧢', bonus:5000, jobs:[
{ id:'pickpocket', name:'Pickpocket a Tourist', desc:'Easy marks gawking at the skyline.', energy:1, cash:[40,75], xp:2 },
{ id:'lookout', name:'Stand Lookout for the Crew', desc:'Whistle twice if you see a badge.', energy:1, cash:[50,85], xp:2 },
{ id:'fence', name:'Move Stolen Goods', desc:'Watches, radios, no questions.', energy:2, cash:[110,170], xp:4 },
{ id:'cornerstore',name:'Rob a Corner Store', desc:'In and out in ninety seconds.', energy:3, cash:[180,260], xp:6 },
{ id:'protection', name:'Collect Protection Money', desc:'"Nice bakery. Shame if anything happened."',energy:4, cash:[260,380], xp:9 },
]},
{ id:'associate', name:'Associate', lvl:5, icon:'🚬', bonus:20000, jobs:[
{ id:'truck', name:'Hijack a Delivery Truck', desc:'The manifest says televisions. Perfect.', energy:5, cash:[420,620], xp:12 },
{ id:'poker', name:'Run an Underground Poker Night', desc:'The house always wins. You are the house.', energy:5, cash:[480,700], xp:12 },
{ id:'smuggle', name:'Smuggle Contraband Upriver', desc:'Keep the engine quiet and the lights off.', energy:6, cash:[620,880], xp:15 },
{ id:'bribe', name:'Bribe a Beat Cop', desc:'Everyone has a price. His is reasonable.', energy:7, cash:[750,1050], xp:18 },
{ id:'torch', name:'Torch a Rival Warehouse', desc:'Insurance job. Allegedly.', energy:8, cash:[950,1350], xp:22 },
]},
{ id:'soldier', name:'Soldier', lvl:10, icon:'🔫', bonus:75000, jobs:[
{ id:'nightclub', name:'Shake Down a Nightclub', desc:'The velvet rope now belongs to the family.',energy:9, cash:[1400,2000], xp:26 },
{ id:'docks', name:'Steal a Shipment at the Docks', desc:'Crate 47. Do not open crate 47.', energy:10, cash:[1700,2400], xp:30 },
{ id:'jailbreak', name:'Break a Friend Out of Jail', desc:'He knows too much to stay in there.', energy:11, cash:[2000,2900], xp:35 },
{ id:'chopshop', name:'Take Over a Chop Shop', desc:'Parts is parts. Profits is profits.', energy:12, cash:[2400,3400], xp:40 },
{ id:'ambush', name:'Ambush a Rival Crew', desc:'They picked the wrong neighborhood.', energy:13, cash:[2900,4100], xp:46 },
]},
{ id:'capo', name:'Capo', lvl:18, icon:'🎩', bonus:300000, jobs:[
{ id:'fixfight', name:'Fix a Championship Fight', desc:'He goes down in the fourth. He knows why.', energy:14, cash:[4200,6000], xp:60 },
{ id:'gunrun', name:'Run Guns Across the Border', desc:'Heavy cargo, light paperwork.', energy:15, cash:[5000,7200], xp:70 },
{ id:'councilman', name:'Buy Off a City Councilman', desc:'Zoning is a beautiful thing.', energy:16, cash:[6000,8600], xp:80 },
{ id:'jewelry', name:'Heist the Jewelry Exchange', desc:'Six minutes before the vault re-locks.', energy:18, cash:[7500,10800], xp:95 },
{ id:'informant', name:'Silence a Police Informant', desc:'Canaries shouldn’t sing.', energy:20, cash:[9000,13000], xp:110 },
]},
{ id:'underboss', name:'Underboss', lvl:28, icon:'💼', bonus:1200000, jobs:[
{ id:'routes', name:'Corner the Smuggling Routes',desc:'Every crate in the harbor pays tribute.', energy:22, cash:[14000,20000], xp:135 },
{ id:'launder', name:'Launder Money Through the Casino', desc:'The chips never lie. The books do.', energy:24, cash:[17000,24000], xp:155 },
{ id:'wiretap', name:'Sabotage a Federal Wiretap', desc:'Funny, the tapes are all static.', energy:26, cash:[20000,29000], xp:175 },
{ id:'vault', name:'Pull Off the Bank Vault Job',desc:'Drill team, getaway team, alibi team.', energy:28, cash:[25000,36000], xp:200 },
{ id:'truce', name:'Broker a Truce Between Families', desc:'Peace is profitable. For now.', energy:30, cash:[30000,44000], xp:230 },
]},
{ id:'boss', name:'Boss of the City', lvl:40, icon:'👑', bonus:5000000, jobs:[
{ id:'commission', name:'Sit at the Commission Table',desc:'Five families. One empty chair. Yours.', energy:32, cash:[48000,68000], xp:275 },
{ id:'election', name:'Swing the Mayoral Election', desc:'Democracy, with a little help.', energy:35, cash:[58000,84000], xp:320 },
{ id:'freeport', name:'Seize the Freeport Terminal',desc:'Whoever owns the port owns the city.', energy:38, cash:[70000,102000], xp:370 },
{ id:'rivaldon', name:'Topple a Rival Don', desc:'It’s not personal. It’s strictly business.', energy:42, cash:[86000,125000], xp:435 },
{ id:'legend', name:'Become a Legend', desc:'They’ll whisper your name for fifty years.', energy:50, cash:[110000,160000], xp:525 },
]},
];
const RIVALS = [
{ id:'weasel', name:'Sal "The Weasel" Moretti', lvl:1, power:20, cash:[60,120], xp:3, desc:'Small-time snitch with a glass jaw.' },
{ id:'knuckles', name:'"Knuckles" Lombardi', lvl:3, power:42, cash:[150,280], xp:6, desc:'Hits hard, thinks slow.' },
{ id:'twins', name:'The Bertolli Twins', lvl:6, power:75, cash:[350,600], xp:11, desc:'Two of them, unfortunately.' },
{ id:'ricci', name:'Enzo Ricci, Loan Shark', lvl:9, power:120, cash:[700,1200], xp:17, desc:'Collects debts. Time to collect from him.' },
{ id:'butcher', name:'"The Butcher" of Little Italy', lvl:13, power:185, cash:[1400,2300], xp:25, desc:'His cleaver has a reputation.' },
{ id:'silk', name:'Silk-Suit Santoro', lvl:17, power:270, cash:[2600,4200], xp:35, desc:'Never wrinkles the suit. Change that.' },
{ id:'iron', name:'Iron Mike Barzini', lvl:22, power:400, cash:[4800,7800], xp:48, desc:'Capo of the east side crew.' },
{ id:'contessa', name:'The Contessa’s Bodyguard', lvl:27, power:580, cash:[8500,13500], xp:64, desc:'Seven feet of bad news.' },
{ id:'shadow', name:'"The Shadow" Falcone', lvl:33, power:830, cash:[15000,24000], xp:85, desc:'Nobody’s seen his face. You will.' },
{ id:'don', name:'Don Vittorio’s Enforcer', lvl:40, power:1200, cash:[26000,42000], xp:115, desc:'The right hand of the old regime.' },
];
const BOSSES = [
{ id:'vinnie', name:'Vinnie "Two-Fingers"', lvl:8, hp:160, hit:[6,12], cash:6000, xp:60, loot:'w4', desc:'Runs the pawnshop rackets. Lost three fingers, kept the attitude.' },
{ id:'dockmaster',name:'The Dockmaster', lvl:15, hp:450, hit:[9,16], cash:30000, xp:180, loot:'a3', desc:'Controls every crane and container on the waterfront.' },
{ id:'contessa', name:'Contessa Moretti', lvl:25, hp:1200, hit:[13,22], cash:150000, xp:500, loot:'v4', desc:'Runs the casinos with a velvet glove over an iron fist.' },
{ id:'vittorio', name:'Don Vittorio', lvl:40, hp:3200, hit:[18,30], cash:1200000, xp:1500, loot:'w6', desc:'The old lion of the city. One family must fall.' },
{ id:'general', name:'El General', lvl:45, hp:6000, hit:[22,36], cash:150000, peso:true, xp:2600, loot:'c2', desc:'Medals on his chest, half of Havana in his pocket.' },
{ id:'pakhanboss',name:'The Old Pakhan', lvl:65, hp:12000, hit:[28,44], cash:500000, ruble:true, xp:5200, loot:'m2', desc:'Thirty winters at the top. He does not intend to see a thirty-first rival.' },
];
const PROPERTIES = [
{ id:'newsstand', name:'Newsstand Front', icon:'🗞️', cost:750, inc:16, desc:'Sells papers up front, numbers out back.' },
{ id:'laundromat',name:'Lucky Star Laundromat', icon:'🧺', cost:2800, inc:52, desc:'Cleans shirts and certain kinds of money.' },
{ id:'trattoria', name:'Trattoria Bella Notte', icon:'🍝', cost:13000, inc:210, desc:'Best carbonara in town. Back room by invitation.' },
{ id:'nightclub', name:'The Velvet Room', icon:'🍸', cost:65000, inc:900, desc:'Jazz till 4am, business till dawn.' },
{ id:'casino', name:'Golden Ace Casino', icon:'🎰', cost:380000, inc:4600, desc:'The odds favor the family.' },
{ id:'hotel', name:'Waterfront Grand Hotel',icon:'🏨', cost:2200000, inc:24000, desc:'Twelve floors of respectability. Mostly.' },
{ id:'tower', name:'Meridian Tower', icon:'🏙️', cost:12000000, inc:115000,desc:'Your name in brass letters above the skyline.' },
];
const ITEMS = {
// weapons
w1:{ cat:'weapon', name:'Brass Knuckles', icon:'👊', cost:220, atk:2, def:0, lvl:1 },
w2:{ cat:'weapon', name:'Switchblade', icon:'🔪', cost:700, atk:4, def:1, lvl:2 },
w3:{ cat:'weapon', name:'.38 Revolver', icon:'🔫', cost:2400, atk:8, def:2, lvl:5 },
w4:{ cat:'weapon', name:'Sawed-Off Shotgun',icon:'💥', cost:9500, atk:14, def:3, lvl:9 },
w5:{ cat:'weapon', name:'Chicago Typewriter',icon:'🎻', cost:42000, atk:24, def:5, lvl:15, flavor:'Comes in a violin case.' },
w6:{ cat:'weapon', name:'Golden Tommy Gun', icon:'✨', cost:350000, atk:45, def:8, lvl:26 },
// armor
a1:{ cat:'armor', name:'Leather Jacket', icon:'🧥', cost:380, atk:0, def:3, lvl:1 },
a2:{ cat:'armor', name:'Tailored Suit', icon:'🤵', cost:3200, atk:1, def:8, lvl:4 },
a3:{ cat:'armor', name:'Bulletproof Vest', icon:'🦺', cost:14000, atk:2, def:16, lvl:9 },
a4:{ cat:'armor', name:'Armored Overcoat', icon:'🧛', cost:80000, atk:4, def:28, lvl:16 },
a5:{ cat:'armor', name:'Family Signet Ring',icon:'💍',cost:500000, atk:10, def:45, lvl:28, flavor:'They hesitate when they see it.' },
// vehicles
v1:{ cat:'vehicle',name:'Stolen Sedan', icon:'🚗', cost:1600, atk:3, def:3, lvl:2 },
v2:{ cat:'vehicle',name:'Delivery Van', icon:'🚐', cost:7000, atk:5, def:9, lvl:6 },
v3:{ cat:'vehicle',name:'Getaway Coupe', icon:'🏎️', cost:30000, atk:14, def:8, lvl:12 },
v4:{ cat:'vehicle',name:'Armored Limousine',icon:'🚘', cost:160000, atk:12, def:30, lvl:20 },
v5:{ cat:'vehicle',name:'Private Speedboat',icon:'🚤', cost:900000, atk:32, def:24, lvl:30, flavor:'For when the roads are watched.' },
// favor-point exclusives
f1:{ cat:'weapon', name:'Diamond-Tip Stiletto', icon:'🗡️', cost:0, fp:8, atk:35, def:10, lvl:1, flavor:'A favor, made steel.' },
f2:{ cat:'vehicle',name:'Bulletproof Duesenberg',icon:'🚙', cost:0, fp:12, atk:28, def:42, lvl:1, flavor:'The Don’s own ride.' },
// havana black market (pesos)
c1:{ cat:'weapon', name:'Cane-Field Machete', icon:'🔪', cost:2500, peso:true, atk:16, def:2, lvl:35 },
c2:{ cat:'weapon', name:'Gold-Plated Pistols', icon:'✨', cost:45000, peso:true, atk:40, def:8, lvl:42, flavor:'A matched pair. El General’s pride.' },
c3:{ cat:'armor', name:'Guerrilla Fatigues', icon:'🎽', cost:15000, peso:true, atk:4, def:26, lvl:35 },
c4:{ cat:'vehicle',name:'’57 Bel Air Convertible',icon:'🚗', cost:60000, peso:true, atk:22, def:20, lvl:38, flavor:'Cherry red. Subtlety is for the mainland.' },
c5:{ cat:'vehicle',name:'Cigarette Boat', icon:'🚤', cost:380000, peso:true, atk:48, def:34, lvl:46 },
// moscow black market (rubles)
m1:{ cat:'weapon', name:'Bratva Blade', icon:'🗡️', cost:6000, ruble:true, atk:26, def:4, lvl:55 },
m2:{ cat:'weapon', name:'AK-103', icon:'🔫', cost:120000, ruble:true, atk:55, def:10, lvl:60, flavor:'Never jams. Never asks questions.' },
m3:{ cat:'armor', name:'Ushanka & Greatcoat', icon:'🧤', cost:45000, ruble:true, atk:6, def:38, lvl:55 },
m4:{ cat:'vehicle',name:'Black SUV Convoy', icon:'🚙', cost:200000, ruble:true, atk:30, def:40, lvl:58 },
m5:{ cat:'vehicle',name:'Armored Train Car', icon:'🚂', cost:1000000, ruble:true, atk:60, def:55, lvl:68, flavor:'The Trans-Siberian makes unscheduled stops for you.' },
};
const JOB_LOOT = { thug:['w1','a1'], associate:['w2','v1'], soldier:['w3','a2','v2'], capo:['w4','a3','v3'], underboss:['w5','a4','v4'], boss:['w6','a5','v5'],
contrabandista:['c1','c3'], tropicana:['c2','c4'], padrino:['c5','c2'],
avtoritet:['m1','m3'], vor:['m2','m4'], pakhan:['m5','m2'] };
const CLASSES = [
{ id:'maniac', name:'Maniac', icon:'⚡', desc:'Wired different. Energy regenerates 30% faster — grind more jobs.' },
{ id:'fearless', name:'Fearless', icon:'🥊', desc:'Never backs down. Stamina regenerates 35% faster — fight more often.' },
{ id:'mogul', name:'Mogul', icon:'💰', desc:'Born for business. Your properties earn 25% more.' },
];
const COLLECTIONS = [
{ id:'speakeasy', name:'Speakeasy Set', icon:'🥃', perk:'Energy regenerates 10% faster', tiers:['thug','associate'], rare:5,
items:['Bathtub Gin','Jazz Record','Password Card','Hidden Door Key','Bartender’s Rag','Moonshine Jug','Brass Spittoon'] },
{ id:'heist', name:'Heist Set', icon:'🧨', perk:'+10% XP from jobs', tiers:['soldier','capo'], rare:1,
items:['Lockpick Set','Bank Blueprint','Getaway Map','Doctor’s Stethoscope','Glass Cutter','Ski Mask','Canvas Duffel'] },
{ id:'casino', name:'High Roller Set', icon:'🎲', perk:'+10% cash from jobs', tiers:['underboss','boss'], rare:2,
items:['Loaded Dice','Ace of Spades','Thousand-Dollar Chip','Roulette Ball','Silver Cigarette Case','Velvet Rope','Dealer’s Visor'] },
{ id:'omerta', name:'Omertà Set', icon:'🤫', perk:'+2 Attack & +2 Defense', source:'bosses & the hitlist', rare:3,
items:['Coded Ledger','Dead-Drop Key','Unsigned Confession','Forged Passport','Piano Wire','Unmarked Bills','Faded Family Photo'] },
{ id:'havana', name:'Havana Set', icon:'🌴', perk:'+10% peso income', tiers:['contrabandista','tropicana','padrino'], rare:3,
items:['Hand-Rolled Maduro','Bottle of Añejo 15','Tropicana Show Bill','Brass Ship’s Compass','Linen Guayabera','Ivory Domino Set','Santería Beads'] },
{ id:'moscow', name:'Trans-Siberian Set', icon:'❄️', perk:'+10% ruble income', tiers:['avtoritet','vor','pakhan'], rare:3,
items:['Matryoshka with a Secret','Bottle of Stolichnaya','Trans-Siberian Ticket','KGB File Folder','Amber Necklace','Bone Chess Set','Icon in Gold Leaf'] },
];
const TIER_SET = { thug:'speakeasy', associate:'speakeasy', soldier:'heist', capo:'heist', underboss:'casino', boss:'casino',
contrabandista:'havana', tropicana:'havana', padrino:'havana',
avtoritet:'moscow', vor:'moscow', pakhan:'moscow' };
const CONSUMABLES = {
crowbar: { name:'Crowbar', icon:'🪓', from:'Move Stolen Goods' },
disguise: { name:'Disguise Kit', icon:'🎭', from:'Run an Underground Poker Night' },
badge: { name:'Police Badge', icon:'🚨', from:'Bribe a Beat Cop' },
dynamite: { name:'Dynamite', icon:'🧨', from:'Steal a Shipment at the Docks' },
kompromat:{ name:'Kompromat File', icon:'🗂️', from:'Crack a State Warehouse' },
};
const JOB_DROPS = { fence:'crowbar', poker:'disguise', bribe:'badge', docks:'dynamite', warehouse:'kompromat' };
const JOB_NEEDS = {
jailbreak:{ id:'crowbar', n:1 }, chopshop:{ id:'disguise', n:1 },
councilman:{ id:'badge', n:1 }, jewelry:{ id:'dynamite', n:1 },
vault:{ id:'dynamite', n:2 }, election:{ id:'badge', n:2 },
freeport:{ id:'crowbar', n:2 }, rivaldon:{ id:'disguise', n:2 },
counter:{ id:'disguise', n:1 }, armrevolt:{ id:'dynamite', n:2 },
blackmail:{ id:'kompromat', n:1 },ministry:{ id:'kompromat', n:2 },
oilterm:{ id:'dynamite', n:2 },
};
const HIT_MARKS = [
{ id:'mark1', mult:0.9, tag:'Open Contract' },
{ id:'mark2', mult:1.35, tag:'Priority Contract' },
{ id:'mark3', mult:1.9, tag:'Commission Contract' },
];
const HIT_NAMES = ['Johnny "The Ghost" Marchetti','Carmine "Six Deuce" Rizzo','"Mad Dog" Falco',
'Tony "The Undertaker" Greco','"Half-Smile" DeLuca','Willie "The Banker" Costa',
'"The Sicilian" Ferro','Rocco "Nine Lives" Bruno','"Quiet Paulie" Romano'];
const HIT_CD = 3 * 3600 * 1000;
const HIT_UNLOCK = 5;
const ROB_TARGETS = [
{ id:'bodega', name:'Corner Bodega', icon:'🏪', lvl:1, chance:0.80, base:60, desc:'Cigarettes and register cash.' },
{ id:'pawn', name:'Pawn Shop', icon:'💍', lvl:4, chance:0.68, base:160, desc:'Everything here was stolen once already.' },
{ id:'bookie', name:'Bookie’s Office', icon:'📒', lvl:9, chance:0.55, base:420, desc:'Thursday. Collection day.' },
{ id:'jeweler', name:'Diamond District Jeweler', icon:'💎', lvl:16, chance:0.45, base:1100, desc:'The back safe, not the display case.' },
{ id:'fedtruck', name:'Armored Bank Truck', icon:'🚚', lvl:26, chance:0.34, base:3000, desc:'Twelve minutes between stops.' },
{ id:'cantinatill', name:'Cantina Till', icon:'🍹', lvl:35, chance:0.62, base:950, city:'cuba', desc:'Rum-soaked and unguarded after midnight.' },
{ id:'casinocage', name:'Tropicana Casino Cage', icon:'🎰', lvl:43, chance:0.38, base:3200, city:'cuba', desc:'The cage boss naps at 4am. You have four minutes.' },
{ id:'kioskbox', name:'Kiosk Strongbox', icon:'🏪', lvl:55, chance:0.60, base:2600, city:'moscow', desc:'Under the lottery tickets, always.' },
{ id:'banyasafe', name:'Banya Back-Room Safe', icon:'🧖', lvl:63, chance:0.38, base:8000, city:'moscow', desc:'Nobody carries a gun in the steam.' },
];
/* ---------------- havana ---------------- */
const CUBA_UNLOCK = 35;
const CUBA_TIERS = [
{ id:'contrabandista', name:'El Contrabandista', lvl:35, icon:'🛥️', cuba:true, bonus:60000, jobs:[
{ id:'rumrun', name:'Run Rum to the Mainland', desc:'Forty cases, no moon, no lights.', energy:8, cash:[420,700], xp:85 },
{ id:'harbor', name:'Bribe the Harbor Patrol', desc:'The captain’s salary is negotiable.', energy:10, cash:[560,900], xp:110 },
{ id:'cigars', name:'Slip Cigars Past the Blockade',desc:'Hand-rolled gold, by the crate.', energy:12, cash:[720,1150], xp:135 },
{ id:'cockfight', name:'Fix the Cockfights', desc:'The rooster knows nothing. The handler does.',energy:14, cash:[900,1400], xp:160 },
]},
{ id:'tropicana', name:'El Rey del Casino', lvl:42, icon:'🎰', cuba:true, bonus:250000, jobs:[
{ id:'countroom', name:'Skim the Count Room', desc:'Two percent. Nobody counts the counters.', energy:16, cash:[1400,2200], xp:190 },
{ id:'senator', name:'Comp the Senator’s Suite', desc:'What happens in Havana stays on film.', energy:18, cash:[1800,2800], xp:220 },
{ id:'roulette', name:'Rig the Roulette Wheels', desc:'Red seventeen, whenever we need it.', energy:20, cash:[2300,3500], xp:250 },
{ id:'counter', name:'Vanish a Card Counter', desc:'He counted one deck too many.', energy:22, cash:[2900,4400], xp:285 },
]},
{ id:'padrino', name:'El Padrino', lvl:50, icon:'🌴', cuba:true, bonus:1000000, jobs:[
{ id:'armrevolt', name:'Arm Both Sides of the Revolution', desc:'Whoever wins, you already did.', energy:26, cash:[4200,6400], xp:340 },
{ id:'sugar', name:'Own the Sugar Ministry', desc:'Every spoonful pays tribute.', energy:30, cash:[5400,8200], xp:400 },
{ id:'trucebrk', name:'Broker the Island Truce', desc:'Peace, guaranteed by your guns.', energy:34, cash:[7000,10500],xp:460 },
{ id:'crown', name:'Crown the New Casino King', desc:'Long live the king. You picked him.', energy:38, cash:[9000,13500],xp:530 },
]},
];
const CUBA_PROPERTIES = [
{ id:'cigarstand', name:'Cigar Rolling Stand', icon:'🚬', cost:1200, inc:40, cuba:true, desc:'Abuela rolls them tighter than the factories.' },
{ id:'distillery', name:'Rum Distillery', icon:'🥃', cost:6500, inc:180, cuba:true, desc:'Añejo out the front, aguardiente out the back.' },
{ id:'cantina', name:'Beachfront Cantina', icon:'🏖️', cost:30000, inc:800, cuba:true, desc:'Cold drinks, warm sand, hot merchandise.' },
{ id:'tropfloor', name:'The Tropicana Floor', icon:'💃', cost:160000, inc:4000, cuba:true, desc:'The most famous nightclub in the hemisphere.' },
{ id:'prescasino', name:'Presidential Casino', icon:'🏛️', cost:900000, inc:21000, cuba:true, desc:'The house wins. You are the house. And the state.' },
];
const CUBA_RIVALS = [
{ id:'machete', name:'"El Machete" Morales', lvl:35, power:950, cash:[700,1200], xp:130, cuba:true, desc:'Runs the cane fields like a warlord.' },
{ id:'delgado', name:'Capitán Delgado', lvl:40, power:1400, cash:[1500,2600], xp:170, cuba:true, desc:'Half the navy answers to him. The wrong half.' },
{ id:'expat', name:'The Yankee Expat', lvl:45, power:2000, cash:[3200,5200], xp:220, cuba:true, desc:'Fled the States two steps ahead of a subpoena.' },
{ id:'viuda', name:'La Viuda', lvl:50, power:2900, cash:[6500,10500], xp:290, cuba:true, desc:'Three husbands. Three empires. All hers now.' },
];
/* ---------------- moscow ---------------- */
const MOSCOW_UNLOCK = 55;
const MOSCOW_TIERS = [
{ id:'avtoritet', name:'Avtoritet', lvl:55, icon:'❄️', moscow:true, bonus:400000, jobs:[
{ id:'vodkarun', name:'Run Vodka Through Customs', desc:'The stamps are real. The paperwork isn’t.', energy:20, cash:[900,1500], xp:300 },
{ id:'kioskrow', name:'Shake Down the Kiosk Row', desc:'Every kiosk pays the roof. You are the roof.', energy:24, cash:[1200,1900], xp:375 },
{ id:'convoy', name:'Escort a Convoy Through the Snow', desc:'Three trucks, no headlights, minus thirty.',energy:28, cash:[1500,2400], xp:450 },
{ id:'hockeyfix', name:'Fix the Hockey Match', desc:'The goalie’s glove hand goes soft in the third.',energy:32, cash:[1900,3000],xp:530 },
]},
{ id:'vor', name:'Vor v Zakone', lvl:62, icon:'⭐', moscow:true, bonus:1500000, jobs:[
{ id:'warehouse', name:'Crack a State Warehouse', desc:'Property of the people. You’re people.', energy:36, cash:[2600,4100], xp:620 },
{ id:'blackmail', name:'Blackmail a Deputy Minister', desc:'The photographs are unflattering.', energy:40, cash:[3300,5200], xp:700 },
{ id:'caviar', name:'Hijack a Caviar Shipment', desc:'Black gold, thirty kilos of it.', energy:44, cash:[4100,6500], xp:790 },
{ id:'borderguns',name:'Run Guns to the Border', desc:'Both directions. Business is business.', energy:48, cash:[5100,8000], xp:880 },
]},
{ id:'pakhan', name:'Pakhan', lvl:70, icon:'🐺', moscow:true, bonus:6000000, jobs:[
{ id:'oilterm', name:'Corner the Oil Terminals', desc:'Whoever holds the pipeline holds the winter.', energy:52, cash:[7000,11000], xp:990 },
{ id:'ministry', name:'Own the Ministry of Interior', desc:'The stamps stamp themselves now.', energy:56, cash:[8800,13800], xp:1090 },
{ id:'brigades', name:'Broker Peace Between Brigades',desc:'Peace, enforced by your artillery.', energy:60, cash:[11000,17000], xp:1200 },
{ id:'pakhan2', name:'Become Pakhan of Pakhans', desc:'Even the wolves bow their heads.', energy:65, cash:[14000,21500], xp:1350 },
]},
];
const MOSCOW_PROPERTIES = [
{ id:'kioskstrip', name:'Kiosk Row', icon:'🏪', cost:1500, inc:50, moscow:true, desc:'Cigarettes, lottery tickets, protection.' },
{ id:'banya', name:'Banya Club', icon:'🧖', cost:8000, inc:230, moscow:true, desc:'Deals sweat out faster in the steam.' },
{ id:'vodkaplant', name:'Vodka Distillery', icon:'🍾', cost:40000, inc:1050, moscow:true, desc:'State recipe, private profits.' },
{ id:'krasny', name:'Krasny Casino', icon:'🎴', cost:210000, inc:5200, moscow:true, desc:'Red velvet, redder ledgers.' },
{ id:'oilfield', name:'Oil Terminal', icon:'🛢️', cost:1200000, inc:28000, moscow:true, desc:'The winter belongs to whoever owns the heat.' },
];
const MOSCOW_RIVALS = [
{ id:'dmitri', name:'"Iron" Dmitri Volkov', lvl:55, power:4200, cash:[1800,3000], xp:340, moscow:true, desc:'Bent a rebar around a man’s excuses once.' },
{ id:'chechen', name:'The Chechen', lvl:60, power:5800, cash:[3800,6200], xp:430, moscow:true, desc:'Nobody knows his name. Everybody knows his work.' },
{ id:'katya', name:'Katya "Two Knives"', lvl:65, power:7800, cash:[7500,12000], xp:540, moscow:true, desc:'The second knife is for whoever laughs at the first.' },
{ id:'shadow2', name:'The Pakhan’s Shadow', lvl:70, power:10500, cash:[15000,24000], xp:680, moscow:true, desc:'He stands behind the throne. And everyone else.' },
];
const SKILLS = [
{ id:'attack', name:'Attack', icon:'⚔️', gain:1, desc:'+1 attack — hit harder in fights' },
{ id:'defense', name:'Defense', icon:'🛡️', gain:1, desc:'+1 defense — take less damage' },
{ id:'energy', name:'Max Energy', icon:'⚡', gain:3, desc:'+3 max energy — do more jobs' },
{ id:'stamina', name:'Max Stamina', icon:'🔥', gain:1, desc:'+1 max stamina — fight more often' },
{ id:'health', name:'Max Health', icon:'❤️', gain:20, desc:'+20 max health — survive longer' },
];
const ACHIEVEMENTS = [
{ id:'first-job', icon:'🧢', name:'Earning Your Stripes', desc:'Complete your first job', check:s=>s.counters.jobs>=1 },
{ id:'jobs-50', icon:'💪', name:'Working Stiff', desc:'Complete 50 jobs', check:s=>s.counters.jobs>=50 },
{ id:'jobs-500', icon:'🏭', name:'Career Criminal', desc:'Complete 500 jobs', check:s=>s.counters.jobs>=500 },
{ id:'first-win', icon:'🥊', name:'First Blood', desc:'Win your first fight', check:s=>s.counters.wins>=1 },
{ id:'wins-25', icon:'🥇', name:'Brawler', desc:'Win 25 fights', check:s=>s.counters.wins>=25 },
{ id:'wins-150', icon:'⚔️', name:'Enforcer', desc:'Win 150 fights', check:s=>s.counters.wins>=150 },
{ id:'lvl-5', icon:'🚬', name:'Made Associate', desc:'Reach level 5', check:s=>s.level>=5 },
{ id:'lvl-10', icon:'🔫', name:'Made Man', desc:'Reach level 10', check:s=>s.level>=10 },
{ id:'lvl-20', icon:'🎩', name:'Capo Regime', desc:'Reach level 20', check:s=>s.level>=20 },
{ id:'lvl-40', icon:'👑', name:'Boss of the City', desc:'Reach level 40', check:s=>s.level>=40 },
{ id:'prop-1', icon:'🗞️', name:'Front Business', desc:'Buy your first property', check:s=>totalProps(s)>=1 },
{ id:'prop-10', icon:'🏘️', name:'Landlord', desc:'Own 10 properties', check:s=>totalProps(s)>=10 },
{ id:'prop-50', icon:'🏙️', name:'Real Estate Mogul', desc:'Own 50 properties', check:s=>totalProps(s)>=50 },
{ id:'bank-50k', icon:'🏦', name:'Nest Egg', desc:'Hold $50,000 in the bank', check:s=>s.bank>=50000 },
{ id:'bank-1m', icon:'💰', name:'Fort Knox', desc:'Hold $1,000,000 in the bank', check:s=>s.bank>=1000000 },
{ id:'crew-5', icon:'🤝', name:'Goodfellas', desc:'Grow your crew to 5', check:s=>s.crew>=5 },
{ id:'crew-15', icon:'👥', name:'A Small Army', desc:'Grow your crew to 15', check:s=>s.crew>=15 },
{ id:'mastery-1', icon:'⭐', name:'Neighborhood Legend', desc:'Master every Street Thug job', check:s=>tierMastered(s,'thug') },
{ id:'boss-vinnie',icon:'✌️', name:'Three Fingers Now', desc:'Defeat Vinnie "Two-Fingers"', check:s=>(s.bosses.vinnie?.kills||0)>=1 },
{ id:'boss-dock', icon:'⚓', name:'Harbor Master', desc:'Defeat The Dockmaster', check:s=>(s.bosses.dockmaster?.kills||0)>=1 },
{ id:'boss-contessa',icon:'🃏',name:'House Always Loses', desc:'Defeat Contessa Moretti', check:s=>(s.bosses.contessa?.kills||0)>=1 },
{ id:'boss-vittorio',icon:'🦁',name:'The New Don', desc:'Defeat Don Vittorio', check:s=>(s.bosses.vittorio?.kills||0)>=1 },
{ id:'streak-7', icon:'📅', name:'Creature of Habit', desc:'Claim the Daily Take 7 days in a row',check:s=>s.daily.streak>=7 },
{ id:'gear-10', icon:'🧰', name:'Well Equipped', desc:'Own 10 distinct pieces of gear', check:s=>Object.keys(s.items).filter(k=>s.items[k]>0).length>=10 },
{ id:'vault-1', icon:'🧳', name:'Curator of Crime', desc:'Vault your first collection', check:s=>Object.keys(s.collections||{}).length>=1 },
{ id:'vault-all', icon:'🏛️', name:'The Full Museum', desc:'Vault every collection', check:s=>Object.keys(s.collections||{}).length>=COLLECTIONS.length },
{ id:'hits-5', icon:'🎯', name:'Cleaner', desc:'Take down 5 hitlist marks', check:s=>(s.counters.hits||0)>=5 },
{ id:'robs-25', icon:'🔓', name:'Smooth Operator', desc:'Pull off 25 robberies', check:s=>(s.counters.robs||0)>=25 },
{ id:'fp-1', icon:'🎖️', name:'Friends in Low Places',desc:'Call in your first favor', check:s=>(s.counters.fpSpent||0)>=1 },
{ id:'cuba-arrive',icon:'🌴', name:'Our Man in Havana', desc:'Travel to Cuba', check:s=>!!s.seenCuba },
{ id:'peso-250k', icon:'🪙', name:'Peso Baron', desc:'Hold P$250,000 at once', check:s=>s.pesos>=250000 },
{ id:'boss-general',icon:'🥇',name:'Viva la Familia', desc:'Defeat El General', check:s=>(s.bosses.general?.kills||0)>=1 },
{ id:'vendetta', icon:'🥊', name:'Personal Vendetta', desc:'Beat a friend’s challenge', check:s=>!!(s.challenge && s.challenge.beaten) },
{ id:'moscow-arrive',icon:'❄️',name:'From Russia with Love',desc:'Travel to Moscow', check:s=>!!s.seenMoscow },
{ id:'ruble-1m', icon:'🪆', name:'Ruble Oligarch', desc:'Hold ₽1,000,000 at once', check:s=>(s.rubles||0)>=1000000 },
{ id:'boss-pakhan',icon:'🐺', name:'Wolf of the Winter', desc:'Defeat The Old Pakhan', check:s=>(s.bosses.pakhanboss?.kills||0)>=1 },
{ id:'lvl-70', icon:'🌍', name:'Three Cities, One Family', desc:'Reach level 70', check:s=>s.level>=70 },
];
/* ---------------- state ---------------- */
const SAVE_KEY = 'omerta-save-v1';
function freshState(){
const now = Date.now();
return {
v:1,
cash:250, bank:0,
level:1, xp:0, skillPoints:0,
attack:5, defense:5,
maxEnergy:30, maxStamina:10, maxHealth:100,
energy:30, stamina:10, health:100,
regenTs:{ energy:now, stamina:now, health:now },
incomeCarry:0,
crew:1,
city:'ny', // ny | cuba | moscow
pesos:0,
incomeCarryP:0,
seenCuba:false,
rubles:0,
incomeCarryR:0,
seenMoscow:false,
challenge:null, // {n, l, w, beaten} — a friend's shared stats to beat
class:null, // maniac | fearless | mogul
name:'The Boss',
sound:true,
music:false,
fp:0, // favor points
consum:{}, // consumableId -> qty
collItems:{}, // "setId:idx" -> qty
collections:{}, // setId -> true when vaulted
hits:{}, // markId -> {kills, cd}
jobs:{}, // jobId -> times done
tierBonus:{}, // tierId -> true when 3-star bonus claimed
props:{}, // propId -> count
items:{}, // itemId -> qty
bosses:{}, // bossId -> {hp, kills}
rivalWins:{}, // rivalId -> wins
counters:{ jobs:0, wins:0, losses:0, bossKills:0, hits:0, robs:0, fpSpent:0 },
ach:{}, // achId -> true
daily:{ last:'', streak:0 },
lastSeen:now,
};
}
let S = load();
let activeTab = 'jobs';
function load(){
try{
const raw = localStorage.getItem(SAVE_KEY);
if(raw){ return Object.assign(freshState(), JSON.parse(raw)); }
}catch(e){ console.warn('bad save', e); }
return freshState();
}
function save(){
S.lastSeen = Date.now();
try{ localStorage.setItem(SAVE_KEY, JSON.stringify(S)); }catch(e){}
try{ if(typeof POD !== 'undefined' && POD.meta && POD.token) podPush(); }catch(e){}
}
/* ---------------- helpers ---------------- */
const $ = id => document.getElementById(id);
function fmt(n){
n = Math.floor(n);
if(Math.abs(n) >= 1e9) return (n/1e9).toFixed(2)+'b';
if(Math.abs(n) >= 1e7) return (n/1e6).toFixed(2)+'m';
return n.toLocaleString('en-US');
}
const money = n => '$'+fmt(n);
const moneyP = n => 'P$'+fmt(n);
const moneyR = n => '₽'+fmt(n);
// wallet layer: any payer/payee object may carry cuba/peso or moscow/ruble flags
function walletOf(o){ return (o.moscow||o.ruble) ? 'ruble' : (o.cuba||o.peso) ? 'peso' : 'usd'; }
function addMoney(w, amt){ if(w==='peso') S.pesos += amt; else if(w==='ruble') S.rubles += amt; else S.cash += amt; }
function getMoney(w){ return w==='peso' ? S.pesos : w==='ruble' ? S.rubles : S.cash; }
function takeMoney(w, amt){ addMoney(w, -amt); }
function fmtW(w){ return w==='peso' ? moneyP : w==='ruble' ? moneyR : money; }
const CITY_WALLET = { ny:'usd', cuba:'peso', moscow:'ruble' };
const rand = (a,b) => Math.floor(a + Math.random()*(b-a+1));
const clamp = (n,a,b) => Math.max(a, Math.min(b,n));
function xpNeeded(level){ return Math.floor(30 * Math.pow(level, 1.35)); }
function propCost(p){ return Math.floor(p.cost * Math.pow(1.15, S.props[p.id]||0)); }
function crewCost(){ return Math.floor(1800 * Math.pow(1.5, S.crew-1)); }
function healCost(){ return Math.ceil((S.maxHealth - S.health) * (2 + S.level*0.6)); }
function incomePerHour(s){
const st = s||S;
const base = PROPERTIES.reduce((sum,p)=> sum + p.inc*(st.props[p.id]||0), 0);
return Math.round(base * (st.class==='mogul' ? 1.25 : 1));
}
function regenMs(k){
let ms = REGEN[k];
if(k==='energy'){
if(S.class==='maniac') ms *= 0.70;
if(S.collections.speakeasy) ms *= 0.90;
}
if(k==='stamina' && S.class==='fearless') ms *= 0.65;
return ms;
}
function pesoIncomePerHour(s){
const st = s||S;
let base = CUBA_PROPERTIES.reduce((sum,p)=> sum + p.inc*(st.props[p.id]||0), 0);
base *= (st.class==='mogul' ? 1.25 : 1);
if(st.collections.havana) base *= 1.10;
return Math.round(base);
}
function rubleIncomePerHour(s){
const st = s||S;
let base = MOSCOW_PROPERTIES.reduce((sum,p)=> sum + p.inc*(st.props[p.id]||0), 0);
base *= (st.class==='mogul' ? 1.25 : 1);
if(st.collections.moscow) base *= 1.10;
return Math.round(base);
}
const ALL_TIERS = () => TIERS.concat(CUBA_TIERS, MOSCOW_TIERS);
function titleFor(level){
let t = TIERS[0].name;
for(const x of ALL_TIERS().sort((a,b)=>a.lvl-b.lvl)) if(level >= x.lvl) t = x.name;
return t;
}
function netWorth(){ return Math.floor(S.cash + S.bank + PROPERTIES.reduce((a,p)=> a + p.cost*(S.props[p.id]||0), 0)); }
function esc(str){ return String(str).replace(/[&<>"']/g, c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c])); }
function totalProps(s){ return Object.values((s||S).props).reduce((a,b)=>a+b,0); }
function jobStars(id){ return Math.min(3, Math.floor((S.jobs[id]||0)/MASTERY_PER_STAR)); }
function tierMastered(s, tierId){
const t = ALL_TIERS().find(t=>t.id===tierId);
return t.jobs.every(j => Math.floor(((s||S).jobs[j.id]||0)/MASTERY_PER_STAR) >= 3);
}
// best `count` items of a category by stat, counting quantities
function gearSum(cat, stat){
const owned = [];
for(const [id,qty] of Object.entries(S.items)){
const it = ITEMS[id];
if(it && it.cat===cat && qty>0) for(let i=0;i<qty;i++) owned.push(it[stat]);
}
owned.sort((a,b)=>b-a);
return owned.slice(0, S.crew).reduce((a,b)=>a+b,0);
}
function fightAttack(){ return S.attack*3 + gearSum('weapon','atk') + gearSum('vehicle','atk') + S.crew*2 + S.level; }
function fightDefense(){ return S.defense*3 + gearSum('armor','def') + gearSum('vehicle','def') + S.crew*2 + S.level; }
/* ---------------- svg art ---------------- */
let svgUid = 0;
const ART_PAPER = '#efe6d0';
function avatarFigure(o, ink, acc){
const P = ART_PAPER;
const w = o.wide ? 7 : 0;
const hr = o.headR || 16;
let s = '';
// torso
s += `<path d="M${17-w} 104 C ${20-w} 76 ${34-w/2} 65 50 65 C ${66+w/2} 65 ${80+w} 76 ${83+w} 104 Z" fill="${ink}"/>`;
// shirt + tie
if(!o.noShirt){
s += `<path d="M50 66 L41.5 78 L50 96 L58.5 78 Z" fill="#fffdf8"/>`;
s += `<path d="M50 71 l-4.5 7 4.5 15 4.5 -15 Z" fill="${acc}"/>`;
}
// neck + head
s += `<rect x="${50-7-w/2}" y="50" width="${14+w}" height="12" fill="${ink}"/>`;
s += `<circle cx="50" cy="41" r="${hr}" fill="${ink}"/>`;
// hats
const band = o.band || acc;
if(o.hat==='fedora'){
s += `<path d="M34 31 C34 15 66 15 66 31 Z" fill="${ink}"/>
<rect x="35.5" y="25.5" width="29" height="5" fill="${band}"/>
<ellipse cx="50" cy="31" rx="23" ry="4.5" fill="${ink}"/>`;
}else if(o.hat==='lowfedora'){
s += `<path d="M33 40 C33 22 67 22 67 40 Z" fill="${ink}"/>
<rect x="35" y="33.5" width="30" height="5" fill="${band}"/>
<ellipse cx="50" cy="40" rx="25" ry="5" fill="${ink}"/>`;
}else if(o.hat==='bowler'){
s += `<path d="M37 32 C37 19 63 19 63 32 Z" fill="${ink}"/>
<rect x="38" y="27" width="24" height="4.5" fill="${band}"/>
<ellipse cx="50" cy="32" rx="19" ry="4" fill="${ink}"/>`;
}else if(o.hat==='homburg'){
s += `<path d="M37 31 L39.5 14 Q50 10.5 60.5 14 L63 31 Z" fill="${ink}"/>
<rect x="37.5" y="25.5" width="25" height="5" fill="${band}"/>
<ellipse cx="50" cy="31" rx="21" ry="4.5" fill="${ink}"/>`;
}else if(o.hat==='flatcap'){
s += `<path d="M32 34 Q33 19 52 19 Q69 19 69 31 L69 34 Q50 27 32 34 Z" fill="${ink}"/>
<path d="M60 31 q9 0 10 4 l-12 0 Z" fill="${ink}"/>`;
}else if(o.hat==='captain'){
s += `<path d="M34 29 Q34 17 50 17 Q66 17 66 29 Z" fill="${ink}"/>
<rect x="33" y="27" width="34" height="6" rx="2" fill="${ink}"/>
<ellipse cx="50" cy="34.5" rx="13" ry="3.5" fill="#241f18"/>
<circle cx="50" cy="24" r="3" fill="${acc}"/>`;
}else if(o.hat==='wide'){
s += `<ellipse cx="50" cy="29" rx="27" ry="5.5" fill="${ink}"/>
<path d="M37 29 C37 16 63 16 63 29 Z" fill="${ink}"/>
<rect x="38.5" y="23.5" width="23" height="4.5" fill="${band}"/>
<path d="M62 20 q10 -8 14 -2 q-7 1 -10 6 Z" fill="${band}"/>`;
}else if(o.hat==='ushanka'){
s += `<path d="M35 32 Q35 15 50 15 Q65 15 65 32 Z" fill="${ink}"/>
<rect x="32.5" y="26" width="35" height="7.5" rx="3.75" fill="#59503c"/>
<path d="M33.5 33 q-3.5 8 .5 13.5 l5.5 -2.5 q-2 -6 -1 -11 Z" fill="#59503c"/>
<path d="M66.5 33 q3.5 8 -.5 13.5 l-5.5 -2.5 q2 -6 1 -11 Z" fill="#59503c"/>`;
}
if(o.hair==='updo'){
s += `<path d="M34 40 q-5 9 2 14 q4 -8 -2 -14 Z" fill="${ink}"/>
<path d="M66 40 q5 9 -2 14 q-4 -8 2 -14 Z" fill="${ink}"/>`;
}
for(const ex of (o.extras||[])){
if(ex==='cigar') s += `<g transform="rotate(12 57 47)"><rect x="56" y="45.5" width="13" height="3.6" rx="1.8" fill="#8a5a33"/><circle cx="70" cy="47.3" r="2.4" fill="#d98f4e"/></g>`;
else if(ex==='scar') s += `<path d="M58 34 l4.5 10 M57.5 37.5 l4 -1.5 M59.5 42 l4 -1.5" stroke="${P}" stroke-width="1.4" fill="none" stroke-linecap="round"/>`;
else if(ex==='monocle') s += `<circle cx="56.5" cy="41" r="5" fill="none" stroke="${P}" stroke-width="1.5"/><path d="M60 45 q5 5 3 12" fill="none" stroke="${P}" stroke-width="1"/>`;
else if(ex==='shades') s += `<rect x="37" y="37" width="11" height="6.5" rx="2.5" fill="#191510" stroke="${P}" stroke-width="1.2"/><rect x="52" y="37" width="11" height="6.5" rx="2.5" fill="#191510" stroke="${P}" stroke-width="1.2"/><path d="M48 40 h4" stroke="${P}" stroke-width="1.2"/>`;
else if(ex==='mustache') s += `<path d="M43.5 48.5 q6.5 -4.5 13 0 q-6.5 3.6 -13 0 Z" fill="${P}"/>`;
else if(ex==='beard') s += `<path d="M37 42 q1 16 13 16 q12 0 13 -16 q-6 11 -13 11 q-7 0 -13 -11 Z" fill="#59503c"/>`;
else if(ex==='necklace') s += `<path d="M43 63 q7 6 14 0" fill="none" stroke="${acc}" stroke-width="1.6"/><circle cx="50" cy="67" r="2.2" fill="${acc}"/>`;
else if(ex==='rose') s += `<circle cx="63.5" cy="75" r="3.2" fill="#b8433a"/><circle cx="63.5" cy="75" r="1.3" fill="#e0837b"/>`;
else if(ex==='pocket') s += `<path d="M60.5 73 l7.5 3.5 -2.5 5.5 Z" fill="${P}"/>`;
else if(ex==='collar') s += `<path d="M32 62 L46 51 l4 13 Z M68 62 L54 51 l-4 13 Z" fill="${ink}"/>`;
else if(ex==='apron') s += `<path d="M40 70 h20 v34 h-20 Z" fill="${P}"/><path d="M40 71 q10 -7 20 0" fill="none" stroke="${P}" stroke-width="3"/>`;
else if(ex==='cleaver') s += `<g transform="rotate(-25 68 80)"><rect x="61" y="70" width="15" height="11" rx="1.5" fill="#b9bfc6" stroke="#8a9097" stroke-width="1"/><rect x="66" y="81" width="5" height="12" rx="2" fill="#7a5a3a"/></g>`;
}
return s;
}
function avatar(o){
o = o || {};
const ink = o.ink || '#3a352c';
const acc = o.acc || '#b08a1f';
const bg = o.bg || '#efe7d3';
const id = 'av' + (++svgUid);
let fig;
if(o.mystery){
fig = `<text x="50" y="64" font-size="44" text-anchor="middle" fill="#c9bda1" font-family="Georgia,serif">?</text>`;
}else if(o.twins){
const f = avatarFigure(o, ink, acc);
fig = `<g transform="translate(-14,6) scale(.88)">${f}</g><g transform="translate(16,8) scale(.88)">${f}</g>`;
}else{
fig = avatarFigure(o, ink, acc);
}
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" role="img" aria-hidden="true">
<defs><clipPath id="${id}"><circle cx="50" cy="50" r="47"/></clipPath></defs>
<circle cx="50" cy="50" r="48" fill="${bg}"/>
<g clip-path="url(#${id})">${fig}</g>
<circle cx="50" cy="50" r="47.5" fill="none" stroke="rgba(120,100,60,.28)" stroke-width="1.5"/>
</svg>`;
}
const RIVAL_ART = {
weasel: { hat:'flatcap', acc:'#8d8577', bg:'#e9e2cf', extras:['mustache'] },
knuckles: { hat:'bowler', acc:'#b8433a', bg:'#f0e0d8', wide:true, extras:['scar'] },
twins: { hat:'bowler', acc:'#3c6e9f', bg:'#e3edf6', twins:true },
ricci: { hat:'homburg', acc:'#2e7d4f', bg:'#e2f0e7', extras:['monocle'] },
butcher: { hat:null, acc:'#b8433a', bg:'#f7e4e2', wide:true, extras:['apron','cleaver','scar'] },
silk: { hat:'fedora', acc:'#3c6e9f', bg:'#e6ebf3', extras:['pocket'] },
iron: { hat:null, acc:'#6b7076', bg:'#e8e6e0', wide:true, extras:['scar','cigar'] },
contessa: { hat:null, acc:'#33302a', bg:'#efe7d3', wide:true, headR:13.5, extras:['shades'] },
shadow: { hat:'lowfedora', acc:'#4a4438', bg:'#e5e0d4', ink:'#2c2822', extras:['collar'] },
don: { hat:'homburg', acc:'#8c1f16', bg:'#f3e9cd', extras:['cigar'] },
// havana
machete: { hat:null, acc:'#2e7d4f', bg:'#e2f0e7', wide:true, extras:['scar','cleaver'] },
delgado: { hat:'captain', acc:'#b08a1f', bg:'#e3edf6', extras:['mustache'] },
expat: { hat:'fedora', acc:'#b8433a', bg:'#f3e9cd', extras:['shades'] },
viuda: { hat:'wide', hair:'updo', noShirt:true, acc:'#33302a', bg:'#efe6ef', ink:'#2c2822', extras:['necklace'] },
// moscow
dmitri: { hat:null, acc:'#6b7076', bg:'#e8eaee', wide:true, extras:['scar'] },
chechen: { hat:'flatcap', acc:'#4a5568', bg:'#e3e8ec', extras:['beard'] },
katya: { hat:'ushanka', hair:'updo', noShirt:true, acc:'#b8433a', bg:'#f0e6ea', ink:'#2c2822', extras:['necklace','scar'] },
shadow2: { hat:'lowfedora', acc:'#3d4655', bg:'#e2e4e9', ink:'#23201b', extras:['collar'] },
};
const BOSS_ART = {
vinnie: { hat:'fedora', acc:'#b08a1f', bg:'#f3e9cd', extras:['cigar','scar'] },
dockmaster: { hat:'captain', acc:'#b08a1f', bg:'#e3edf6', wide:true, extras:['beard'] },
contessa: { hat:'wide', hair:'updo', noShirt:true, acc:'#b8433a', bg:'#f7e4e2', extras:['necklace'] },
vittorio: { hat:'homburg', acc:'#7c1d15', bg:'#efe7d3', ink:'#413a2f', extras:['mustache','rose'] },
general: { hat:'captain', acc:'#8c1f16', bg:'#e6ead9', wide:true, extras:['mustache','rose'] },
pakhanboss: { hat:'ushanka', acc:'#7c1d15', bg:'#e8ecf1', wide:true, ink:'#3a3833', extras:['beard','rose'] },
};
const PLAYER_ART = { hat:'fedora', acc:'#b08a1f', bg:'#f3e9cd', extras:['rose'] };
const MYSTERY_ART = { mystery:true, bg:'#ece5d4' };
const HIT_ART = [
{ hat:'flatcap', acc:'#8d8577', bg:'#e9e2cf', extras:['scar'] },
{ hat:'bowler', acc:'#b8433a', bg:'#f0e5d8', extras:['cigar'] },
{ hat:'lowfedora', acc:'#8c1f16', bg:'#efe0e0', ink:'#2c2822', extras:['collar'] },
];
function propArt(id){