Repository navigation
Expand file tree
/
Copy pathmi.html
More file actions
2448 lines (2331 loc) · 231 KB
/
Copy pathmi.html
File metadata and controls
2448 lines (2331 loc) · 231 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">
<title>Black Desert Online · Central Market</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
<style>
:root {
--bg: #070b12; --bg-sidebar: #0a1018; --bg-card: #0f1620; --bg-card-hover: #141d2a;
--bg-elevated: #121a25; --border: #1c2836; --border-light: #2a3a4d;
--text: #e8eef6; --text-muted: #8b9cb3; --text-dim: #5a6b82;
--accent: #c9a227; --accent-soft: rgba(201,162,39,0.12);
--blue: #3b82f6; --blue-soft: rgba(59,130,246,0.15);
--green: #22c55e; --green-soft: rgba(34,197,94,0.12);
--red: #ef4444; --red-soft: rgba(239,68,68,0.12);
--sidebar-w: 220px; --radius: 12px; --radius-sm: 8px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.45; overflow-x: hidden; }
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar { background: var(--bg-sidebar); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar-brand { padding: 20px 18px 16px; border-bottom: 1px solid var(--border); }
.sidebar-brand .logo { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; color: var(--accent); text-transform: uppercase; }
.sidebar-brand .logo span { display: block; font-size: 1.05rem; letter-spacing: 0.04em; color: var(--text); margin-top: 2px; }
.nav { padding: 12px 10px; flex: 1; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--radius-sm); color: var(--text-muted); font-size: 0.82rem; font-weight: 500; cursor: pointer; transition: all 0.15s; border: 1px solid transparent; user-select: none; }
.nav-item:hover { background: var(--bg-card); color: var(--text); }
.nav-item.active { background: linear-gradient(135deg, rgba(201,162,39,0.18), rgba(201,162,39,0.06)); color: var(--accent); border-color: rgba(201,162,39,0.25); }
.nav-item .icon { width: 18px; text-align: center; font-size: 0.9rem; }
.nav-sep { height: 1px; background: var(--border); margin: 10px 8px; }
.sidebar-footer { padding: 16px; border-top: 1px solid var(--border); font-size: 0.72rem; color: var(--text-dim); line-height: 1.5; }
.sidebar-footer strong { color: var(--accent); }
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 12px 24px; background: var(--bg-sidebar); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.topbar-title { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.06em; color: var(--text-muted); text-transform: uppercase; white-space: nowrap; }
.topbar-title small { display: block; font-size: 0.7rem; font-weight: 400; letter-spacing: 0; color: var(--text-dim); text-transform: none; margin-top: 1px; }
.region-toggle { display: flex; background: var(--bg-card); border: 1px solid var(--border); border-radius: 999px; padding: 3px; gap: 2px; }
.region-btn { padding: 6px 14px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); background: transparent; border: none; cursor: pointer; font-family: inherit; }
.region-btn.active { background: var(--blue); color: white; }
.search-bar { flex: 1; max-width: 420px; position: relative; }
.search-bar input { width: 100%; padding: 9px 14px 9px 38px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 999px; color: var(--text); font-size: 0.85rem; font-family: inherit; outline: none; }
.search-bar input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.search-bar input::placeholder { color: var(--text-dim); }
.search-bar svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-dim); pointer-events: none; }
.topbar-status { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; }
.status-dot { display: inline-flex; align-items: center; gap: 6px; }
.status-dot::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse 2s ease-in-out infinite; }
.status-dot.loading::before { background: var(--accent); }
.status-dot.error::before { background: var(--red); animation: none; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.45} }
.icon-btn { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 0.95rem; }
.icon-btn:hover { background: var(--bg-card-hover); color: var(--text); }
.timer-badge { background: var(--accent); color: #111; font-size: 0.65rem; font-weight: 700; padding: 1px 6px; border-radius: 999px; margin-left: 6px; }
.content { padding: 20px 24px 40px; display: flex; flex-direction: column; gap: 18px; }
.view { display: none; }
.view.active { display: flex; flex-direction: column; gap: 18px; }
.hero { border-radius: var(--radius); overflow: hidden; min-height: 150px; background: linear-gradient(105deg, rgba(7,11,18,0.92) 0%, rgba(7,11,18,0.55) 45%, rgba(7,11,18,0.25) 100%), linear-gradient(160deg, #1a2a40 0%, #0d1520 100%); border: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 24px 28px; gap: 24px; }
.hero-text h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 4px; }
.hero-text h1 span { color: var(--accent); }
.hero-text p { color: var(--text-muted); font-size: 0.88rem; max-width: 320px; }
.hero-stats { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stat { background: rgba(15,22,32,0.85); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 18px; min-width: 140px; cursor: pointer; transition: border-color 0.15s, transform 0.12s; }
.hero-stat:hover { border-color: var(--border-light); transform: translateY(-2px); }
.hero-stat .label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.hero-stat .value { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.hero-stat .hint { font-size: 0.65rem; color: var(--text-dim); margin-top: 4px; }
.cat-row { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-btn { display: flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: var(--radius-sm); background: var(--bg-card); border: 1px solid var(--border); color: var(--text-muted); font-size: 0.78rem; font-weight: 500; font-family: inherit; cursor: pointer; transition: all 0.15s; }
.cat-btn:hover { border-color: var(--border-light); color: var(--text); background: var(--bg-card-hover); }
.cat-btn.active { background: var(--accent-soft); border-color: rgba(201,162,39,0.4); color: var(--accent); }
.grid-main { display: grid; grid-template-columns: 1fr 280px; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .grid-main { grid-template-columns: 1fr; } .shell { grid-template-columns: 1fr; } .sidebar { display: none; } }
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card-head h2 { font-size: 0.9rem; font-weight: 600; }
.card-head .meta { font-size: 0.75rem; color: var(--text-muted); }
.card-body { padding: 16px 18px; }
.left-col, .right-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.popular-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.pop-item { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 12px; text-align: center; transition: border-color 0.15s, transform 0.12s; cursor: pointer; }
.pop-item:hover { border-color: var(--border-light); transform: translateY(-2px); }
.pop-icon { width: 44px; height: 44px; margin: 0 auto 10px; border-radius: 10px; background: linear-gradient(145deg, #1a2535, #0d1520); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.pop-name { font-size: 0.72rem; font-weight: 500; color: var(--text-muted); margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pop-price { font-size: 0.82rem; font-weight: 700; font-variant-numeric: tabular-nums; margin-bottom: 4px; }
.pop-change { font-size: 0.7rem; font-weight: 600; }
.up { color: var(--green); } .down { color: var(--red); } .flat { color: var(--text-dim); }
.table-wrap { overflow-x: auto; max-height: 520px; overflow-y: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
th { text-align: left; padding: 10px 14px; font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); background: var(--bg-elevated); border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg-card-hover); }
.item-row { display: flex; align-items: center; gap: 10px; }
.item-row .ico { width: 28px; height: 28px; border-radius: 6px; background: linear-gradient(145deg, #1a2535, #0d1520); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 0.8rem; flex-shrink: 0; }
.price-cell { font-weight: 600; font-variant-numeric: tabular-nums; }
.stock-ok { color: var(--green); } .stock-low { color: var(--red); } .stock-none { color: var(--text-dim); }
.change-pill { display: inline-block; padding: 2px 7px; border-radius: 5px; font-size: 0.72rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.change-pill.up { background: var(--green-soft); color: var(--green); }
.change-pill.down { background: var(--red-soft); color: var(--red); }
.change-pill.flat { background: rgba(90,107,130,0.15); color: var(--text-dim); }
.hot-list { display: flex; flex-direction: column; gap: 2px; }
.hot-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm); cursor: pointer; }
.hot-row:hover { background: var(--bg-card-hover); }
.hot-row .ico { width: 28px; height: 28px; border-radius: 6px; background: linear-gradient(145deg, #1a2535, #0d1520); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 0.8rem; flex-shrink: 0; }
.hot-row .info { flex: 1; min-width: 0; }
.hot-row .name { font-size: 0.78rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hot-row .meta { font-size: 0.68rem; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.hot-row .chg { font-size: 0.72rem; font-weight: 600; white-space: nowrap; }
.qa-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.qa-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; transition: all 0.15s; text-align: left; font-family: inherit; color: var(--text); }
.qa-btn:hover { border-color: var(--accent); background: var(--bg-card-hover); }
.qa-btn .qa-icon { font-size: 1.1rem; margin-bottom: 2px; }
.qa-btn .qa-title { font-size: 0.78rem; font-weight: 600; }
.qa-btn .qa-desc { font-size: 0.68rem; color: var(--text-dim); }
.loading-msg, .error-msg { padding: 40px 20px; text-align: center; color: var(--text-muted); font-size: 0.9rem; }
.error-msg { color: var(--red); }
.flash { animation: flashBg 0.55s ease; }
@keyframes flashBg { 0% { background: rgba(59,130,246,0.12); } 100% { background: transparent; } }
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.65); z-index: 100; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.open { display: flex; }
.modal { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); max-width: 580px; width: 100%; max-height: 85vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg-card); z-index: 1; }
.modal-head h3 { font-size: 1rem; font-weight: 600; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 1.3rem; cursor: pointer; padding: 4px 8px; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px; }
.modal-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.modal-row:last-child { border-bottom: none; }
.modal-row input[type="number"] { width: 90px; padding: 6px 10px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-family: inherit; font-size: 0.85rem; }
.modal-total { margin-top: 16px; padding: 14px; background: var(--bg-elevated); border-radius: var(--radius-sm); border: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-total .label { color: var(--text-muted); font-size: 0.85rem; }
.modal-total .val { font-size: 1.2rem; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.modal-note { font-size: 0.75rem; color: var(--text-dim); margin-top: 12px; line-height: 1.5; }
.craft-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 900px) { .craft-layout { grid-template-columns: 1fr; } }
.recipe-list { display: flex; flex-direction: column; gap: 8px; max-height: 520px; overflow-y: auto; }
.recipe-card {
display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px;
background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm);
cursor: pointer; transition: all 0.15s; text-align: left; font-family: inherit; color: var(--text); width: 100%;
}
.recipe-card:hover { border-color: var(--border-light); }
.recipe-card.selected { border-color: var(--accent); background: var(--accent-soft); }
.recipe-card .rtype { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); margin-bottom: 2px; }
.recipe-card .rname { font-size: 0.85rem; font-weight: 600; }
.recipe-card .rmats { font-size: 0.72rem; color: var(--text-muted); margin-top: 4px; }
.recipe-card .rsell { font-size: 0.78rem; font-weight: 600; color: var(--accent); margin-left: auto; white-space: nowrap; }
.craft-detail h3 { font-size: 1rem; margin-bottom: 12px; }
.craft-detail .mat-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.craft-amount { display: flex; align-items: center; gap: 12px; margin: 16px 0; flex-wrap: wrap; }
.craft-amount label { font-size: 0.85rem; color: var(--text-muted); }
.craft-amount input { width: 100px; padding: 8px 12px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 1rem; font-family: inherit; font-weight: 600; }
.craft-summary { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; margin-top: 8px; }
.craft-summary .row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 0.88rem; }
.craft-summary .row.total { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 12px; font-weight: 700; font-size: 1rem; }
.craft-summary .profit { color: var(--green); }
.craft-summary .loss { color: var(--red); }
.badge-alc { background: rgba(139,92,246,0.15); color: #a78bfa; font-size: 0.65rem; padding: 2px 6px; border-radius: 4px; }
.badge-cook { background: rgba(251,146,60,0.15); color: #fb923c; font-size: 0.65rem; padding: 2px 6px; border-radius: 4px; }
.btn-primary {
display: inline-flex; align-items: center; justify-content: center; gap: 8px;
padding: 12px 20px; background: linear-gradient(135deg, #c9a227, #a8841a); color: #111;
border: none; border-radius: 8px; font-weight: 700; font-size: 0.9rem; font-family: inherit;
cursor: pointer; margin-top: 14px; width: 100%; transition: filter 0.15s, transform 0.1s;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; filter: none; }
.btn-danger {
padding: 6px 12px; background: var(--red-soft); color: var(--red); border: 1px solid rgba(239,68,68,0.3);
border-radius: 6px; font-size: 0.75rem; font-weight: 600; font-family: inherit; cursor: pointer;
}
.btn-danger:hover { background: rgba(239,68,68,0.25); }
.timer-card {
background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm);
padding: 14px 16px; margin-bottom: 10px;
}
.timer-card.running { border-color: rgba(201,162,39,0.45); box-shadow: 0 0 0 1px rgba(201,162,39,0.15); }
.timer-card.done { border-color: rgba(34,197,94,0.45); }
.timer-card .tname { font-weight: 600; font-size: 0.9rem; margin-bottom: 4px; }
.timer-card .tmeta { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 10px; }
.timer-bar { height: 8px; background: var(--border); border-radius: 999px; overflow: hidden; margin-bottom: 8px; }
.timer-bar > div { height: 100%; background: linear-gradient(90deg, var(--accent), #e8c84a); border-radius: 999px; transition: width 0.4s linear; }
.timer-card.done .timer-bar > div { background: var(--green); width: 100% !important; }
.timer-countdown { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
.timer-actions { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.toast-wrap { position: fixed; bottom: 24px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 10px; max-width: 340px; }
.toast {
background: var(--bg-card); border: 1px solid var(--border); border-left: 4px solid var(--accent);
border-radius: 10px; padding: 14px 16px; box-shadow: 0 12px 40px rgba(0,0,0,0.45);
animation: toastIn 0.3s ease; font-size: 0.88rem;
}
.toast.success { border-left-color: var(--green); }
.toast strong { display: block; margin-bottom: 4px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes toastPop {
0% { opacity: 0; transform: translateY(24px) scale(0.9); }
40% { opacity: 1; transform: translateY(-6px) scale(1.04); }
70% { transform: translateY(0) scale(1); }
100% { opacity: 1; transform: none; }
}
@keyframes pulseGlow {
0%, 100% { box-shadow: 0 12px 40px rgba(0,0,0,0.45), 0 0 0 0 rgba(34,197,94,0.4); }
50% { box-shadow: 0 12px 40px rgba(0,0,0,0.45), 0 0 0 10px rgba(34,197,94,0); }
}
.toast.done-pop {
border-left-color: var(--green);
animation: toastPop 0.55s ease, pulseGlow 1.2s ease 0.5s 3;
cursor: pointer;
max-width: 380px;
}
.toast.done-pop strong { color: var(--green); font-size: 1rem; }
.tool-size-row { display: flex; flex-wrap: wrap; gap: 10px 16px; margin: 10px 0 4px; font-size: 0.8rem; color: var(--text-muted); }
.tool-size-row label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.tool-size-row input { accent-color: var(--accent); }
.sec-hint { font-size: 0.72rem; color: var(--text-dim); margin-top: 6px; }
.dur-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0; }
.dur-field label { display: block; font-size: 0.72rem; color: var(--text-muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.04em; }
.dur-field input { width: 100%; padding: 8px 12px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 1rem; font-family: inherit; font-weight: 600; }
.dur-field input:focus { outline: none; border-color: var(--blue); }
.btn-secondary {
display: inline-flex; align-items: center; justify-content: center; gap: 8px;
padding: 10px 16px; background: var(--bg-elevated); color: var(--text);
border: 1px solid var(--border); border-radius: 8px; font-weight: 600; font-size: 0.85rem; font-family: inherit;
cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.btn-secondary:hover { border-color: var(--border-light); background: var(--bg-card-hover); }
.btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; }
.ocr-status { font-size: 0.78rem; color: var(--text-muted); margin-top: 8px; min-height: 1.2em; }
.ocr-status.ok { color: var(--green); }
.ocr-status.err { color: var(--red); }
.ocr-drop {
border: 1px dashed var(--border-light); border-radius: var(--radius-sm);
padding: 16px; text-align: center; color: var(--text-dim); font-size: 0.82rem;
margin: 10px 0; cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.ocr-drop:hover, .ocr-drop.drag { border-color: var(--accent); background: var(--accent-soft); color: var(--text-muted); }
.ocr-drop input { display: none; }
.recipe-card.dur-recipe { border-color: rgba(59,130,246,0.35); }
.recipe-card.dur-recipe.selected { border-color: var(--blue); background: var(--blue-soft); }
.bulk-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin: 12px 0; }
.bulk-row .dur-field { flex: 1; min-width: 120px; }
.progress-wrap { margin-top: 12px; }
.progress-bar-bg { height: 10px; background: var(--border); border-radius: 999px; overflow: hidden; }
.progress-bar-bg > div { height: 100%; background: linear-gradient(90deg, var(--blue), #60a5fa); border-radius: 999px; transition: width 0.3s; }
.progress-labels { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-muted); margin-top: 6px; }
.timer-card .dura-live { font-size: 1.8rem; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.bridge-pill { display: inline-block; font-size: 0.65rem; padding: 2px 8px; border-radius: 999px; margin-left: 8px; }
.bridge-pill.on { background: var(--green-soft); color: var(--green); }
.bridge-pill.off { background: rgba(90,107,130,0.2); color: var(--text-dim); }
.badge-dur { background: rgba(59,130,246,0.15); color: #60a5fa; font-size: 0.65rem; padding: 2px 6px; border-radius: 4px; }
.share-prep-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; justify-content: center; }
.share-prep-actions button { min-width: 140px; }
.countdown-overlay {
position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,0.75);
display: flex; flex-direction: column; align-items: center; justify-content: center;
color: var(--text); font-size: 1.1rem;
}
.countdown-overlay .count {
font-size: 5rem; font-weight: 700; color: var(--accent); line-height: 1;
font-variant-numeric: tabular-nums; margin: 12px 0;
}
.countdown-overlay .hint { color: var(--text-muted); font-size: 0.9rem; max-width: 320px; text-align: center; }
/* Research & community intelligence lab */
.intel-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;align-items:start}
.intel-full{grid-column:1/-1}
.intel-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.intel-kpi{background:var(--bg-card);border:1px solid var(--border);border-radius:10px;padding:14px}
.intel-kpi small{display:block;color:var(--text-muted);font-size:.68rem;text-transform:uppercase;letter-spacing:.05em}
.intel-kpi strong{display:block;font-size:1.22rem;margin-top:5px;font-variant-numeric:tabular-nums}
.intel-kpi span{display:block;color:var(--text-dim);font-size:.68rem;margin-top:4px}
.intel-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.intel-field{display:flex;flex-direction:column;gap:5px;min-width:0}
.intel-field.full{grid-column:1/-1}
.intel-field label{font-size:.72rem;color:var(--text-muted)}
.intel-field input,.intel-field select,.intel-field textarea{width:100%;padding:9px 10px;border-radius:7px;border:1px solid var(--border-light);background:#0a111a;color:var(--text);font:inherit;font-size:.8rem;min-width:0}
.intel-field textarea{min-height:70px;resize:vertical}
.intel-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}
.intel-btn{border:1px solid var(--border-light);background:#162232;color:var(--text);padding:8px 11px;border-radius:7px;font:600 .76rem Inter,system-ui,sans-serif;cursor:pointer}
.intel-btn.primary{background:var(--accent);border-color:var(--accent);color:#15120a}
.intel-btn.danger{border-color:#65323a;color:#ff9ca5;background:#26151a}
.intel-note{font-size:.72rem;line-height:1.55;color:var(--text-muted);padding:10px 12px;border:1px dashed var(--border-light);border-radius:8px;background:rgba(255,255,255,.015)}
.intel-table-wrap{overflow:auto;max-height:340px}
.intel-table{width:100%;border-collapse:collapse;white-space:nowrap}
.intel-table th,.intel-table td{padding:9px 10px;text-align:left;border-bottom:1px solid var(--border);font-size:.72rem}
.intel-table th{position:sticky;top:0;background:#101925;color:var(--text-muted);font-size:.64rem;text-transform:uppercase;z-index:1}
.intel-empty{color:var(--text-dim);font-size:.78rem;padding:18px;text-align:center}
.intel-pill{display:inline-block;padding:3px 7px;border-radius:99px;background:var(--blue-soft);color:#91bdff;font-size:.65rem}
.intel-pill.good{background:var(--green-soft);color:#7de7a1}.intel-pill.warn{background:var(--accent-soft);color:#e6ca65}
.intel-meter{height:7px;background:#1a2634;border-radius:99px;overflow:hidden;margin-top:8px}.intel-meter span{display:block;height:100%;background:linear-gradient(90deg,#2c83e8,#43d7a4)}
.intel-tabs{display:flex;gap:7px;flex-wrap:wrap}.intel-tabs button{padding:7px 10px;border-radius:7px;border:1px solid var(--border);background:var(--bg-card);color:var(--text-muted);cursor:pointer;font-size:.73rem}.intel-tabs button.active{color:var(--accent);border-color:rgba(201,162,39,.45);background:var(--accent-soft)}
@media(max-width:900px){.intel-grid{grid-template-columns:1fr}.intel-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:540px){.intel-form{grid-template-columns:1fr}.intel-field.full{grid-column:auto}.intel-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}}
/* Vision: a compact, accessible live session surface. */
#viewCraft .hero-text p{max-width:650px}
.vision-summary{background:linear-gradient(125deg,#171020,#0e111a);border-color:#342840}
.vision-summary .card-head{gap:16px;align-items:flex-start}
.vision-summary .card-head h2{flex:0 0 auto}
.vision-summary .card-head .meta{white-space:normal;text-align:right;max-width:65%;line-height:1.5}
.vision-summary-grid{display:grid;grid-template-columns:1.2fr 1fr;gap:24px;align-items:center;margin:0 0 12px}
.vision-eyebrow{font-size:.64rem;font-weight:700;letter-spacing:.12em;color:#b8a1cf}
#visionLootSilver{font-size:clamp(1.2rem,2.8vw,1.8rem);font-weight:750;color:#e3c8ff;line-height:1.35;margin-top:8px;font-variant-numeric:tabular-nums}
#visionLootCounts{color:#c4bdd2;font-size:.83rem;line-height:1.8}
#visionLootCoverage{font-size:.75rem;line-height:1.6;color:#bfafcf}
.vision-records{margin-top:12px;border-top:1px solid #302536;padding-top:10px}
.vision-records summary,.vision-formula summary{cursor:pointer;color:#cdaeff;font-size:.76rem;padding:7px 0;font-weight:600}
.vision-records-scroll{max-height:260px;overflow:auto;margin-top:10px}
.vision-records th{position:sticky;top:0;background:#17131f;z-index:1}
.vision-records .cat-btn{padding:6px 8px;text-align:left;white-space:normal}
.vision-footnote{font-size:.7rem;color:#a99ab8;line-height:1.6;margin-top:12px}
#activeTimersBody{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,450px),1fr));gap:16px}
#activeTimersBody .timer-card{margin:0;padding:20px;border-radius:14px;background:linear-gradient(140deg,#181222,#10121b);border:1px solid #3b2c4b;min-width:0}
#activeTimersBody .tname{color:#f0e5ff;font-size:1rem;line-height:1.4}
#activeTimersBody .tmeta{line-height:1.7;color:#b9acc6;font-size:.75rem}
#activeTimersBody .timer-bar>div{background:linear-gradient(90deg,#7044c5,#bd92ff)}
.vision-earnings{border-top:1px solid #392c47;padding-top:16px;margin-top:16px}
.vision-earnings.optional{color:#bcabc9;font-size:.78rem}.vision-earnings.optional p{font-size:.72rem;line-height:1.6;margin-top:7px}
.vision-earnings-head{display:flex;gap:10px;justify-content:space-between;align-items:flex-start;color:#a396b5;font-size:.66rem;line-height:1.5}
.vision-state{border-radius:6px;padding:4px 7px;max-width:80%;background:#2a2233;color:#dac4f0}
.vision-state.observing{background:#143428;color:#9de5bc}.vision-state.paused{background:#372c21;color:#eecb94}
.vision-metrics{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-top:15px}
.vision-metrics>div{min-width:0}.vision-metrics span{font-size:.6rem;letter-spacing:.08em;color:#b6a4c7;display:block}
.vision-metrics strong{font-size:clamp(1.1rem,2.2vw,1.6rem);line-height:1.4;display:block;color:#ecd9ff;margin:6px 0 2px;word-break:break-word;font-variant-numeric:tabular-nums}
.vision-metrics small{font-size:.65rem;color:#b5aac2;line-height:1.6;display:block}
.vision-coverage{height:4px;background:#302637;border-radius:4px;overflow:hidden;margin-top:15px}.vision-coverage span{display:block;height:100%;background:#aa83e6}
.vision-earnings-note{font-size:.68rem;line-height:1.7;color:#b6aac2;margin-top:8px}
.vision-formula{margin-top:8px}.vision-formula p{font-size:.7rem;line-height:1.7;color:#baafc8;margin-top:8px}
#viewCraft button:focus-visible,.vision-formula summary:focus-visible,.vision-records summary:focus-visible{outline:2px solid #c59aff;outline-offset:3px}
@media(max-width:600px){.vision-summary-grid{grid-template-columns:1fr;gap:12px}.vision-summary .card-head{display:block}.vision-summary .card-head .meta{display:block;text-align:left;max-width:none;margin-top:8px}.vision-metrics{grid-template-columns:1fr;gap:12px}#activeTimersBody .timer-card{padding:15px}.vision-summary .card-body{padding:16px}.vision-records table{min-width:640px}}
@media(prefers-reduced-motion:reduce){.status-dot::before{animation:none}*{scroll-behavior:auto!important}}
.vision-grind-hero{background:radial-gradient(ellipse at 90% 20%,#35204e 0%,transparent 60%),#100d18;border-color:#38284a;min-height:160px}
.vision-grind-hero .hero-text p{max-width:750px;margin-top:8px}.vision-grind-hero h1{margin-top:12px}
.vision-grind-hero h1 span{color:#d3b1ff}
.vision-grind-fields{display:grid;grid-template-columns:1.2fr 1.2fr 90px;gap:16px}
.vision-grind-fields label{font-size:.73rem;color:#c4b6d3;font-weight:600}
.vision-grind-fields input{display:block;width:100%;background:#17121f;border:1px solid #3e3050;padding:11px 12px;color:#f1e5ff;border-radius:8px;font:inherit;margin-top:7px;outline:none}
.vision-grind-fields input:focus{border-color:#be8dff;box-shadow:0 0 0 3px #a06ae020}
.vision-grind-actions{display:flex;gap:12px;flex-wrap:wrap;margin-top:18px}.vision-grind-actions .btn-primary{background:#8455cf;color:#fff;border:1px solid #a477e4;border-radius:8px;padding:10px 20px;font-family:inherit;font-weight:600;font-size:.8rem;cursor:pointer}
.vision-grind-actions button:disabled{opacity:.5;cursor:default}
.vision-grind-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.vision-grind-metrics .card{padding:20px;background:linear-gradient(135deg,#1a1325,#10121b);border-color:#3a2b49}
.vision-grind-metrics span{font-size:.62rem;letter-spacing:.08em;color:#baa7cc;display:block}.vision-grind-metrics strong{font-size:clamp(1.15rem,2.6vw,1.8rem);color:#e6caff;display:block;line-height:1.4;margin:10px 0 6px;font-variant-numeric:tabular-nums;word-break:break-word}.vision-grind-metrics small{font-size:.67rem;color:#b4a6c2;line-height:1.6;display:block}
.vision-pursuit{border-color:#4d365f;background:linear-gradient(100deg,#1d1428,#11131c)}.vision-goal-track{height:7px;border-radius:7px;overflow:hidden;background:#33253f;margin:16px 0}.vision-goal-track span{height:100%;display:block;background:linear-gradient(90deg,#8155c8,#d2a8ff);max-width:100%}
.vision-grind-columns{display:grid;grid-template-columns:1.1fr 1fr;gap:16px}.vision-pulse{height:110px;display:flex;gap:4px;align-items:flex-end;border-bottom:1px solid #473253;padding-top:20px}.vision-pulse span{flex:1;border-radius:3px 3px 0 0;background:linear-gradient(0deg,#6c3caf,#bd8eea);min-width:2px}
#visionGrindFeed{max-height:245px;overflow:auto}.vision-drop{display:grid;grid-template-columns:1fr auto;gap:6px 14px;padding:10px 0;border-bottom:1px solid var(--border);font-size:.78rem}.vision-drop strong{color:#dbc0ff}.vision-drop small{grid-column:1/-1;font-size:.65rem;color:#9f91b2}
.vision-history-scroll{overflow:auto;max-height:360px}.vision-history-scroll table{min-width:760px}.vision-grind-formula{padding:17px 22px;color:#b7a9c6}.vision-grind-formula summary{cursor:pointer;color:#d5b4ff;font-size:.8rem}.vision-grind-formula p{font-size:.75rem;line-height:1.8;margin-top:12px}
@media(max-width:1000px){.vision-grind-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.vision-grind-columns{grid-template-columns:1fr}}
@media(max-width:600px){.vision-grind-fields{grid-template-columns:1fr}.vision-grind-metrics{gap:10px}.vision-grind-metrics .card{padding:14px}.vision-grind-hero{padding:20px}}
.vision-recap-dialog{margin:auto;width:min(1000px,94vw);max-height:94vh;overflow:auto;background:#12101b;color:#ecdfff;border:1px solid #61447d;border-radius:16px;padding:20px}.vision-recap-dialog::backdrop{background:#04030adb;backdrop-filter:blur(5px)}.vision-recap-dialog h2{font-size:1rem;margin:0 0 14px}.vision-recap-dialog img{display:block;width:auto;height:auto;max-width:100%;max-height:65vh;margin:auto;object-fit:contain;border-radius:10px}
#visionCraftingLoot[hidden]{display:none!important}
</style>
<script src="https://cdn.jsdelivr.net/npm/tesseract.js@5/dist/tesseract.min.js"></script>
</head>
<body>
<div class="shell">
<aside class="sidebar">
<div class="sidebar-brand"><div class="logo">Black Desert<span>ONLINE</span></div></div>
<nav class="nav" id="sidebarNav">
<div class="nav-item active" data-view="market" data-cat="hot"><span class="icon">🔥</span> Volatile Price Items</div>
<div class="nav-item" data-view="market" data-cat="1"><span class="icon">⚔</span> Main Weapon</div>
<div class="nav-item" data-view="market" data-cat="5"><span class="icon">🗡</span> Sub-weapon</div>
<div class="nav-item" data-view="market" data-cat="10"><span class="icon">🌾</span> Awakening</div>
<div class="nav-item" data-view="market" data-cat="15"><span class="icon">🛡</span> Armor</div>
<div class="nav-item" data-view="market" data-cat="20"><span class="icon">💍</span> Accessories</div>
<div class="nav-item" data-view="market" data-cat="85"><span class="icon">✦</span> Artifact/Lightstone</div>
<div class="nav-item" data-view="market" data-cat="25"><span class="icon">📦</span> Material</div>
<div class="nav-item" data-view="market" data-cat="30"><span class="icon">⚒</span> Enhancement</div>
<div class="nav-item" data-view="market" data-cat="55"><span class="icon">👑</span> Pearl Item</div>
<div class="nav-item" data-view="market" data-cat="35"><span class="icon">🧪</span> Consumables</div>
<div class="nav-item" data-view="market" data-cat="40"><span class="icon">🪓</span> Life Tools</div>
<div class="nav-item" data-view="market" data-cat="45"><span class="icon">🔮</span> Alchemy Stone</div>
<div class="nav-item" data-view="market" data-cat="50"><span class="icon">💠</span> Magic Crystal</div>
<div class="nav-item" data-view="market" data-cat="60"><span class="icon">🎨</span> Dye</div>
<div class="nav-item" data-view="market" data-cat="65"><span class="icon">🐴</span> Mount</div>
<div class="nav-item" data-view="market" data-cat="70"><span class="icon">⚓</span> Ship</div>
<div class="nav-item" data-view="market" data-cat="75"><span class="icon">🛞</span> Wagon</div>
<div class="nav-item" data-view="market" data-cat="80"><span class="icon">🪑</span> Furniture</div>
<div class="nav-sep"></div>
<div class="nav-item" data-view="craft" id="navCraft">
<span class="icon">🍳</span> Crafting Planner
<span class="timer-badge" id="navTimerBadge" style="display:none">0</span>
</div>
<div class="nav-item" data-view="grind" id="navGrind"><span class="icon">◈</span> Vision Grind Tracker</div>
<div class="nav-item" data-view="intel" id="navIntel"><span class="icon">🧠</span> Market Intelligence Lab</div>
</nav>
<div class="sidebar-footer"><strong>Find the best deals,</strong><br>build your empire.</div>
</aside>
<div class="main">
<header class="topbar">
<div class="topbar-title">Central Market<small>Live prices · api.arsha.io</small></div>
<div class="region-toggle">
<button class="region-btn active" data-region="na">NA</button>
<button class="region-btn" data-region="eu">EU</button>
</div>
<div class="search-bar" id="searchWrap">
<svg width="15" height="15" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><circle cx="11" cy="11" r="8"/><path d="M21 21l-4.35-4.35"/></svg>
<input type="search" id="search" placeholder="Search item name..." autocomplete="off">
</div>
<div class="topbar-status">
<span class="status-dot" id="statusDot">Loading...</span>
<button class="icon-btn" title="Refresh" id="refreshBtn">↻</button>
</div>
</header>
<div class="content">
<div class="view active" id="viewMarket">
<section class="hero">
<div class="hero-text">
<h1>Black Desert Online<br><span>Central Market</span></h1>
<p>Track prices. Plan your progress. Maximize your profits.</p>
</div>
<div class="hero-stats">
<div class="hero-stat" id="statItemsCard" title="Refresh data">
<div class="label">👜 Total Items</div>
<div class="value" id="statItems">—</div>
<div class="hint">in current view</div>
</div>
<div class="hero-stat" id="statOrdersCard" title="Toggle sort by stock">
<div class="label">📋 Active Orders</div>
<div class="value" id="statOrders">—</div>
<div class="hint">units listed in stock</div>
</div>
<div class="hero-stat" id="statSilverCard" title="Market value breakdown">
<div class="label">🪙 Total Silver</div>
<div class="value" id="statSilver">—</div>
<div class="hint">price × stock</div>
</div>
</div>
</section>
<div class="cat-row" id="catRow">
<button class="cat-btn active" data-cat="hot">🔥 Volatile</button>
<button class="cat-btn" data-cat="30">⚒ Enhancement</button>
<button class="cat-btn" data-cat="1">⚔ Main Weapon</button>
<button class="cat-btn" data-cat="15">🛡 Armor</button>
<button class="cat-btn" data-cat="20">💍 Accessories</button>
<button class="cat-btn" data-cat="25">📦 Material</button>
<button class="cat-btn" data-cat="35">🧪 Consumables</button>
<button class="cat-btn" data-cat="40">🪓 Life Tools</button>
<button class="cat-btn" data-cat="50">💠 Magic Crystal</button>
</div>
<div class="grid-main">
<div class="left-col">
<section class="card">
<div class="card-head"><h2>★ Popular / Hot Items</h2><span class="meta" id="popularMeta">—</span></div>
<div class="card-body"><div class="popular-grid" id="popularGrid"><div class="loading-msg">Loading market data...</div></div></div>
</section>
<section class="card" id="listingsCard">
<div class="card-head"><h2 id="listingsTitle">☰ Market Listings</h2><span class="meta" id="listingsMeta">—</span></div>
<div class="table-wrap">
<table>
<thead><tr><th>Item</th><th>Base Price</th><th>In Stock</th><th>Total Trades</th><th>Change</th></tr></thead>
<tbody id="listingsBody"><tr><td colspan="5"><div class="loading-msg">Loading...</div></td></tr></tbody>
</table>
</div>
</section>
</div>
<div class="right-col">
<section class="card">
<div class="card-head"><h2>🔥 Hot Items</h2></div>
<div class="card-body" style="padding:8px 10px;"><div class="hot-list" id="hotList"><div class="loading-msg" style="padding:20px">Loading...</div></div></div>
</section>
<section class="card">
<div class="card-head"><h2>⚡ Quick Access</h2></div>
<div class="card-body">
<div class="qa-grid">
<button class="qa-btn" id="qaEnhance"><span class="qa-icon">⚒</span><span class="qa-title">Enhancement Calculator</span><span class="qa-desc">Plan your upgrades</span></button>
<button class="qa-btn" id="qaHistory"><span class="qa-icon">📊</span><span class="qa-title">Price History</span><span class="qa-desc">View historical trends</span></button>
<button class="qa-btn" id="qaGear"><span class="qa-icon">🛡</span><span class="qa-title">Gear Progression</span><span class="qa-desc">Best in slot guide</span></button>
<button class="qa-btn" id="qaLife"><span class="qa-icon">🌿</span><span class="qa-title">Life Skill Profits</span><span class="qa-desc">Calculate earnings</span></button>
</div>
</div>
</section>
</div>
</div>
</div>
<div class="view" id="viewCraft">
<section class="hero" style="min-height:auto;padding:20px 28px;">
<div class="hero-text">
<h1>Crafting <span>Planner</span></h1>
<p>Select a recipe or <strong>Durability Timer</strong>. Plan bulk crafts (1M batches), track costs & progress. <span class="bridge-pill off" id="bridgePill">App offline</span></p>
</div>
</section>
<section class="card">
<div class="card-head">
<h2>⏱ Active Timers</h2>
<span class="meta" id="activeTimerMeta">None running</span>
</div>
<div class="card-body" id="activeTimersBody">
<p style="color:var(--text-dim);font-size:0.85rem;">No active crafts. Start one from the plan panel.</p>
</div>
</section>
<section class="card vision-summary" id="visionCraftingLoot" hidden>
<div class="card-head"><h2>Saved loot from Vision</h2><span class="meta" id="visionLootState">Optional sharing</span></div>
<div class="card-body"><div class="vision-summary-grid"><div><span class="vision-eyebrow">ALL RECORDED ITEM VALUE</span><h3 id="visionLootSilver"></h3></div><p id="visionLootCounts"></p></div>
<p class="meta" id="visionLootCoverage"></p><details class="vision-records"><summary>Inspect recorded items & market matches</summary><div class="vision-records-scroll"><table><thead><tr><th>Recorded item</th><th>Quantity</th><th>Unit silver</th><th>Total silver</th><th>Group</th></tr></thead><tbody id="visionLootItems"></tbody></table></div></details>
<p class="vision-footnote">Your saved history stays here across days. Active timers measure only new drops after they attach. Nothing is inferred while capture is unavailable.</p></div>
</section>
<div class="craft-layout">
<section class="card">
<div class="card-head"><h2>Recipes</h2><span class="meta" id="recipeCountMeta">Full recipe book</span></div>
<div class="card-body"><div class="recipe-list" id="recipeList"></div></div>
</section>
<section class="card">
<div class="card-head"><h2>Plan & Timer</h2></div>
<div class="card-body">
<div class="craft-detail" id="craftDetail">
<p style="color:var(--text-muted);font-size:0.9rem;">Select a recipe on the left to start planning.</p>
</div>
</div>
</section>
</div>
<section class="card">
<div class="card-head"><h2>📜 Recent Completions</h2></div>
<div class="card-body" id="historyBody">
<p style="color:var(--text-dim);font-size:0.85rem;">Completed crafts will appear here.</p>
</div>
</section>
</div>
<div class="view" id="viewGrind">
<section class="hero vision-grind-hero"><div class="hero-text"><span class="vision-eyebrow">VISION · PERSONAL GRIND INTELLIGENCE</span><h1>Your run. <span>Your results.</span></h1><p>Automatic loot, measured observation time, and a pursuit worth coming back for.</p><p id="visionGrindConnection">Connect your local Vision tracker to begin.</p></div></section>
<section class="card vision-grind-controls"><div class="card-body"><div class="vision-grind-fields">
<label>Spot / route<input id="visionGrindSpot" list="visionGrindSpots" maxlength="100" placeholder="Name your grind spot"><datalist id="visionGrindSpots"></datalist></label>
<label>Treasure pursuit · optional<input id="visionGrindTarget" maxlength="100" placeholder="An exact item name"></label>
<label>Goal<input id="visionGrindGoal" type="number" min="1" max="1000000" value="1"></label></div>
<div class="vision-grind-actions"><button class="btn-primary" data-grind-command="start">Start grind</button><button class="cat-btn" data-grind-command="pause">Pause / resume</button><button class="cat-btn" data-grind-command="finish">Finish & save</button><button class="cat-btn" onclick="visionGrindSaveRecap()">Save recap PNG</button><button class="cat-btn" onclick="visionGrindExportCSV()">Export CSV</button></div><p id="visionGrindCommandState" class="vision-footnote">Session controls are shared with the native app. Starting a new run preserves the previous run.</p></div></section>
<p id="visionGrindState" class="vision-state paused">Waiting for your local tracker.</p>
<div class="vision-grind-metrics"><div class="card"><span>RECORDED VALUE</span><strong id="visionGrindValue">—</strong><small id="visionGrindPartial">Captured quantity × market price</small></div><div class="card"><span>SILVER / OBSERVED HOUR</span><strong id="visionGrindRate">—</strong><small>After 60 observed seconds</small></div><div class="card"><span>OBSERVED TIME</span><strong id="visionGrindTime">00:00:00</strong><small id="visionGrindGaps">Capture gaps are excluded</small></div><div class="card"><span>CAPTURED UNITS</span><strong id="visionGrindDrops">0</strong><small id="visionGrindRare">Rare-notice units appear here</small></div></div>
<section class="card vision-pursuit"><div class="card-head"><h2>Treasure pursuit</h2><span class="meta">Observed progress, without probability guesses</span></div><div class="card-body"><p id="visionGrindPursuit">Choose a target for your next run.</p><div class="vision-goal-track"><span id="visionGrindGoalBar"></span></div><p id="visionGrindBenchmark" class="vision-footnote">Your spot signature grows with your own completed sessions.</p></div></section>
<div class="vision-grind-columns"><section class="card"><div class="card-head"><h2>Loot pulse</h2><span class="meta">Captured units through the run</span></div><div class="card-body"><div id="visionGrindPulse" class="vision-pulse" role="img" aria-label="Captured loot across this session"></div><p class="vision-footnote">Gaps are left empty. No missing drops are filled in.</p></div></section><section class="card"><div class="card-head"><h2>Latest captured drops</h2></div><div class="card-body" id="visionGrindFeed">Your live drops appear here.</div></section></div>
<section class="card"><div class="card-head"><h2>Run history</h2><span class="meta">Select a run for its recap</span></div><div class="card-body vision-history-scroll"><table><thead><tr><th>Spot / session</th><th>Started</th><th>Observed</th><th>Value</th><th>Silver / h</th><th>Coverage</th><th>State</th></tr></thead><tbody id="visionGrindHistory"></tbody></table></div></section>
<details class="card vision-grind-formula"><summary>What counts—and how the numbers work</summary><p>Recorded value = Σ (captured quantity × market or verified NPC unit value). Silver/hour = recorded value ÷ observed seconds × 3,600.</p><p>Blocked, minimized, stale, unreadable and manually paused time is excluded. Readable periods with no drops still count. Unknown prices are excluded from a labeled partial total. Unlisted items use a published NPC sell value only when the item ID and name match; otherwise they stay unpriced. Material costs and fees are not deducted.</p></details>
</div>
<div class="view" id="viewIntel">
<section class="hero" style="min-height:auto;padding:20px 24px;">
<div class="hero-text"><h1>Market <span>Intelligence Lab</span></h1><p>Turn your market browsing and crafting sessions into reusable data, better plans, and community benchmarks.</p></div>
<div class="intel-actions" style="margin:0"><button class="intel-btn" id="intelExport">Export all data</button><button class="intel-btn" id="intelImportBtn">Import backup</button><input type="file" id="intelImportFile" accept="application/json,.json" hidden></div>
</section>
<div class="intel-kpis" id="intelKpis"></div>
<div class="intel-tabs" id="intelTabs"><button class="active" data-intel-tab="planner">Profit & Shopping</button><button data-intel-tab="sessions">Production Telemetry</button><button data-intel-tab="enhance">Enhancement Journal</button><button data-intel-tab="alerts">Price Alerts</button><button data-intel-tab="journal">Market Journal</button><button data-intel-tab="data">Community Data</button></div>
<section class="intel-panel" data-intel-panel="planner">
<div class="intel-grid">
<section class="card"><div class="card-head"><h2>Recipe Profit Simulator</h2><span class="meta">Uses current market data when available</span></div><div class="card-body">
<div class="intel-form"><div class="intel-field full"><label>Recipe</label><select id="intelRecipe"></select></div><div class="intel-field"><label>Craft batches</label><input id="intelBatches" type="number" min="1" max="100000000" value="1000"></div><div class="intel-field"><label>Sell-through estimate (%)</label><input id="intelSellThrough" type="number" min="0" max="100" value="100"></div><div class="intel-field"><label>Market tax / effective take (%)</label><input id="intelTax" type="number" min="0" max="100" value="15.5"></div><div class="intel-field"><label>Extra cost per batch (silver)</label><input id="intelExtraCost" type="number" min="0" value="0"></div><div class="intel-field"><label>Finished item market price / batch</label><input id="intelSalePrice" type="number" min="0" value="0"></div></div>
<div id="intelProfitResult" style="margin-top:14px"></div><div class="intel-actions"><button class="intel-btn primary" id="intelBuildShopping">Add recipe materials</button><button class="intel-btn" id="intelClearShopping">Clear shopping list</button><button class="intel-btn" id="intelSavePlan">Save plan snapshot</button></div>
</div></section>
<section class="card"><div class="card-head"><h2>Consolidated Shopping List</h2><span class="meta" id="intelShoppingMeta">Build from recipe plan</span></div><div class="card-body" id="intelShopping"><div class="intel-empty">Choose a recipe and batch size, then build a shopping list. Inventory amounts can be subtracted before export.</div></div></section>
<section class="card intel-full"><div class="card-head"><h2>Saved Plan Snapshots</h2><span class="meta">Historical estimates retain their own prices</span></div><div class="card-body" id="intelPlans"></div></section>
</div>
</section>
<section class="intel-panel" data-intel-panel="sessions" hidden>
<div class="intel-grid">
<section class="card"><div class="card-head"><h2>Record a Production Session</h2><span class="meta">Local-first; opt-in export</span></div><div class="card-body">
<form id="intelSessionForm"><div class="intel-form"><div class="intel-field full"><label>Recipe / activity</label><select id="sessionRecipe"></select></div><div class="intel-field"><label>Crafts / batches completed</label><input id="sessionCrafts" type="number" min="1" value="1000" required></div><div class="intel-field"><label>Elapsed minutes</label><input id="sessionMinutes" type="number" min="0.1" step="0.1" value="60" required></div><div class="intel-field"><label>Durability before</label><input id="sessionDurBefore" type="number" min="0" placeholder="e.g. 3000"></div><div class="intel-field"><label>Durability after</label><input id="sessionDurAfter" type="number" min="0" placeholder="e.g. 2475"></div><div class="intel-field full"><div class="intel-actions" style="margin-top:0"><button class="intel-btn" type="button" id="sessionDurBeforeNow">Use current OCR reading as BEFORE</button><button class="intel-btn" type="button" id="sessionDurAfterNow">Use current OCR reading as AFTER</button></div><span class="meta">Uses the current reading from the existing Durability Timer, including readings received from the side-app bridge.</span></div><div class="intel-field"><label>Mastery</label><input id="sessionMastery" type="number" min="0" placeholder="optional"></div><div class="intel-field"><label>Output quantity</label><input id="sessionOutput" type="number" min="0" placeholder="optional"></div><div class="intel-field full"><label>Notes / setup (buffs, tool, conditions)</label><textarea id="sessionNotes" placeholder="Tool, buffs, cooking/alchemy setup, anything that affects comparability..."></textarea></div></div><div class="intel-actions"><button class="intel-btn primary" type="submit">Save session</button><label style="font-size:.75rem;color:var(--text-muted);display:flex;align-items:center;gap:7px"><input id="sessionContribute" type="checkbox"> Mark for community export</label></div></form>
</div></section>
<section class="card"><div class="card-head"><h2>Observed Production Benchmarks</h2><span class="meta">Derived from your saved sessions</span></div><div class="card-body" id="intelBenchmarks"></div></section>
<section class="card intel-full"><div class="card-head"><h2>Production Session History</h2><span class="meta" id="intelSessionMeta"></span></div><div class="card-body" id="intelSessionHistory"></div></section>
</div>
</section>
<section class="intel-panel" data-intel-panel="enhance" hidden>
<div class="intel-grid">
<section class="card"><div class="card-head"><h2>Enhancement Outcome Log</h2><span class="meta">Record attempts, not just successes</span></div><div class="card-body"><form id="intelEnhanceForm"><div class="intel-form"><div class="intel-field full"><label>Item</label><input id="enhItem" required placeholder="e.g. Kharazad Necklace"></div><div class="intel-field"><label>From level</label><select id="enhFrom"><option>Base</option><option>PRI</option><option>DUO</option><option>TRI</option><option>TET</option><option>PEN</option><option>HEX</option><option>HEPT</option><option>OCT</option><option>NON</option><option>DEC</option><option>+1</option><option>+2</option><option>+3</option><option>+4</option><option>+5</option></select></div><div class="intel-field"><label>Target level</label><select id="enhTarget"><option>PRI</option><option>DUO</option><option>TRI</option><option>TET</option><option>PEN</option><option>HEX</option><option>HEPT</option><option>OCT</option><option>NON</option><option>DEC</option><option>Success / completed</option></select></div><div class="intel-field"><label>Attempts</label><input id="enhAttempts" type="number" min="1" value="1" required></div><div class="intel-field"><label>Successes</label><input id="enhSuccesses" type="number" min="0" value="0" required></div><div class="intel-field"><label>Crons used</label><input id="enhCrons" type="number" min="0" value="0"></div><div class="intel-field"><label>Total silver spent</label><input id="enhCost" type="number" min="0" value="0"></div><div class="intel-field full"><label>Failstack / notes</label><input id="enhNotes" placeholder="FS, event, protection method, etc."></div></div><div class="intel-actions"><button class="intel-btn primary" type="submit">Log enhancement</button><label style="font-size:.75rem;color:var(--text-muted);display:flex;align-items:center;gap:7px"><input id="enhContribute" type="checkbox"> Mark for community export</label></div></form></div></section>
<section class="card"><div class="card-head"><h2>Observed Outcomes</h2><span class="meta">Descriptive, not probability prediction</span></div><div class="card-body" id="intelEnhanceStats"></div></section>
<section class="card intel-full"><div class="card-head"><h2>Enhancement History</h2></div><div class="card-body" id="intelEnhanceHistory"></div></section>
</div>
</section>
<section class="intel-panel" data-intel-panel="alerts" hidden>
<div class="intel-grid"><section class="card"><div class="card-head"><h2>Create a Price Alert</h2><span class="meta">Checks items when market data refreshes</span></div><div class="card-body"><form id="intelAlertForm"><div class="intel-form"><div class="intel-field full"><label>Item name</label><input id="alertItem" list="alertItemOptions" required placeholder="Exact item name"><datalist id="alertItemOptions"></datalist></div><div class="intel-field"><label>Condition</label><select id="alertCondition"><option value="below">Price at or below</option><option value="above">Price at or above</option></select></div><div class="intel-field"><label>Target silver</label><input id="alertTarget" type="number" min="1" required placeholder="Target price"></div></div><div class="intel-actions"><button class="intel-btn primary" type="submit">Create alert</button><button class="intel-btn" type="button" id="intelCheckAlerts">Check against loaded data</button></div></form><p class="intel-note" style="margin-top:12px">Alerts are local to this browser and are evaluated when data is loaded or you manually check. This page cannot guarantee background notifications while closed.</p></div></section><section class="card"><div class="card-head"><h2>Alert Events</h2><span class="meta">Triggered alerts</span></div><div class="card-body" id="intelAlertEvents"></div></section><section class="card intel-full"><div class="card-head"><h2>Active Price Alerts</h2><span class="meta" id="intelAlertMeta"></span></div><div class="card-body" id="intelAlertsList"></div></section></div>
</section>
<section class="intel-panel" data-intel-panel="journal" hidden>
<div class="intel-grid"><section class="card"><div class="card-head"><h2>Market Event / Observation Journal</h2><span class="meta">Keep facts separate from theories</span></div><div class="card-body"><form id="intelJournalForm"><div class="intel-form"><div class="intel-field"><label>Entry type</label><select id="journalType"><option>Price observation</option><option>Patch / event</option><option>Recipe change</option><option>Market hypothesis</option><option>Personal note</option></select></div><div class="intel-field"><label>Related item (optional)</label><input id="journalItem" placeholder="Item / recipe"></div><div class="intel-field full"><label>Title</label><input id="journalTitle" required placeholder="What changed or what did you notice?"></div><div class="intel-field full"><label>Details</label><textarea id="journalBody" placeholder="Observed facts, source, hypothesis, links, follow-up..."></textarea></div><div class="intel-field full"><label>Source URL (optional)</label><input id="journalSource" type="url" placeholder="https://..."></div></div><div class="intel-actions"><button class="intel-btn primary" type="submit">Save journal entry</button></div></form></div></section><section class="card"><div class="card-head"><h2>Data Quality Checklist</h2></div><div class="card-body"><div class="intel-note">Every shared record should preserve region, observation time, source, method, and uncertainty. Market snapshots, OCR readings, and player-reported outcomes are different evidence types and should never be silently merged.</div><div class="intel-actions"><button class="intel-btn" id="intelExportCsv">Export sessions CSV</button><button class="intel-btn" id="intelExportContribution">Export contribution package</button></div></div></section><section class="card intel-full"><div class="card-head"><h2>Journal History</h2><span class="meta" id="intelJournalMeta"></span></div><div class="card-body" id="intelJournalHistory"></div></section></div>
</section>
<section class="intel-panel" data-intel-panel="data" hidden>
<div class="intel-grid"><section class="card"><div class="card-head"><h2>Your Local Data</h2><span class="meta">Stored in this browser</span></div><div class="card-body" id="intelDataSummary"></div></section><section class="card"><div class="card-head"><h2>Data portability</h2></div><div class="card-body"><p class="intel-note">This prototype has no community server or upload endpoint. Contribution export creates a reviewable JSON file containing only records you explicitly marked for sharing. It does not send data anywhere.</p><div class="intel-actions"><button class="intel-btn primary" id="intelExportContribution2">Export selected contributions</button><button class="intel-btn" id="intelExportAll2">Backup everything</button><button class="intel-btn danger" id="intelClearLocal">Clear this app's local research data</button></div></div></section><section class="card intel-full"><div class="card-head"><h2>Local Market Observation Archive</h2><span class="meta">Captured from successfully loaded market data</span></div><div class="card-body"><div class="intel-actions" style="margin-top:0;margin-bottom:12px"><button class="intel-btn primary" id="intelCaptureSnapshot">Capture loaded market snapshot now</button><button class="intel-btn" id="intelExportMarketHistory">Export observations CSV</button></div><div class="intel-form" style="margin-bottom:12px"><div class="intel-field"><label>Item history</label><select id="intelHistoryItem"><option value="">Select an archived item</option></select></div><div class="intel-field"><label>Observation window</label><select id="intelHistoryWindow"><option value="24">Last 24 hours</option><option value="168" selected>Last 7 days</option><option value="720">Last 30 days</option><option value="all">All saved</option></select></div></div><div id="intelMarketHistory"></div><p class="intel-note" style="margin-top:10px">This is a personal local archive, not a complete official historical market feed. It records only the items returned in loaded categories and the hot list while this app is open. More frequent refreshes improve local coverage; gaps are expected.</p></div></section><section class="card intel-full"><div class="card-head"><h2>Saved calculation assumptions</h2></div><div class="card-body" id="intelAssumptions"></div></section></div>
</section>
</div>
</div>
</div>
</div>
<div class="modal-overlay" id="modal">
<div class="modal">
<div class="modal-head"><h3 id="modalTitle">Tool</h3><button class="modal-close" id="modalClose">×</button></div>
<div class="modal-body" id="modalBody"></div>
</div>
</div>
<div class="toast-wrap" id="toastWrap"></div>
<script>
const STORAGE_KEY = "bdo_cm_v1";
const CATEGORIES = {
hot: { id: "hot", name: "Volatile Price Items" },
"1": { id: 1, name: "Main Weapon" }, "5": { id: 5, name: "Sub-weapon" },
"10": { id: 10, name: "Awakening" }, "15": { id: 15, name: "Armor" },
"20": { id: 20, name: "Accessories" }, "85": { id: 85, name: "Artifact/Lightstone" },
"25": { id: 25, name: "Material" }, "30": { id: 30, name: "Enhancement" },
"55": { id: 55, name: "Pearl Item" }, "35": { id: 35, name: "Consumables" },
"40": { id: 40, name: "Life Tools" }, "45": { id: 45, name: "Alchemy Stone" },
"50": { id: 50, name: "Magic Crystal" }, "60": { id: 60, name: "Dye" },
"65": { id: 65, name: "Mount" }, "70": { id: 70, name: "Ship" },
"75": { id: 75, name: "Wagon" }, "80": { id: 80, name: "Furniture" },
};
/* secPerBatch ≈ in-game processing time per craft (mass craft feel) */
const RECIPES = [{"id": "alc_antidote_elixir_0", "type": "alchemy", "name": "Antidote Elixir", "sell": 25000, "secPerBatch": 4, "mats": [{"name": "Pure Powder Reagent", "qty": 1, "fallback": 14000}, {"name": "Weeds", "qty": 1, "fallback": 500}, {"name": "Blood 2", "qty": 2, "fallback": 8000}, {"name": "Olive Oil", "qty": 3, "fallback": 8000}]}, {"id": "alc_clear_liquid_reagent_1", "type": "alchemy", "name": "Clear Liquid Reagent", "sell": 12000, "secPerBatch": 3, "mats": [{"name": "Salt", "qty": 1, "fallback": 400}, {"name": "Sunrise Herb", "qty": 1, "fallback": 1200}, {"name": "Weeds", "qty": 1, "fallback": 500}, {"name": "Purified Water", "qty": 1, "fallback": 200}]}, {"id": "alc_clown_s_blood_2", "type": "alchemy", "name": "Clown's Blood", "sell": 35000, "secPerBatch": 4, "mats": [{"name": "Spirit's Leaf", "qty": 1, "fallback": 8000}, {"name": "Powder of Darkness", "qty": 1, "fallback": 7000}, {"name": "Clear Liquid Reagent", "qty": 1, "fallback": 12000}, {"name": "Blood 1", "qty": 2, "fallback": 6000}]}, {"id": "alc_defense_elixir_3", "type": "alchemy", "name": "Defense Elixir", "sell": 42000, "secPerBatch": 5, "mats": [{"name": "Clear Liquid Reagent", "qty": 1, "fallback": 12000}, {"name": "Ash Sap", "qty": 6, "fallback": 2500}, {"name": "Blood 2", "qty": 5, "fallback": 8000}, {"name": "Purified Water", "qty": 3, "fallback": 200}]}, {"id": "alc_elixir_of_amity_4", "type": "alchemy", "name": "Elixir of Amity", "sell": 55000, "secPerBatch": 5, "mats": [{"name": "Legendary Beast's Blood", "qty": 1, "fallback": 95000}, {"name": "Fire Flake Flower", "qty": 5, "fallback": 2500}, {"name": "Ash Sap", "qty": 6, "fallback": 2500}, {"name": "Black Stone Powder", "qty": 3, "fallback": 2000}]}, {"id": "alc_elixir_of_armor_5", "type": "alchemy", "name": "Elixir of Armor", "sell": 88000, "secPerBatch": 5, "mats": [{"name": "Oil of Fortitude", "qty": 3, "fallback": 45000}, {"name": "Refined Delotia Reagent", "qty": 3, "fallback": 28000}, {"name": "Thornwood Sap", "qty": 5, "fallback": 3200}, {"name": "Thick Turo Blood", "qty": 1, "fallback": 120000}]}, {"id": "alc_elixir_of_assassination_6", "type": "alchemy", "name": "Elixir of Assassination", "sell": 192000, "secPerBatch": 5, "mats": [{"name": "Oil of Regeneration", "qty": 1, "fallback": 55000}, {"name": "Pure Powder Reagent", "qty": 5, "fallback": 14000}, {"name": "Bloody Tree Knot", "qty": 5, "fallback": 9000}, {"name": "Powder of Flame", "qty": 6, "fallback": 8000}]}, {"id": "alc_elixir_of_carnage_7", "type": "alchemy", "name": "Elixir of Carnage", "sell": 72000, "secPerBatch": 5, "mats": [{"name": "Oil of Corruption", "qty": 1, "fallback": 45000}, {"name": "Pure Powder Reagent", "qty": 5, "fallback": 14000}, {"name": "Trace of Violence", "qty": 3, "fallback": 22000}, {"name": "Powder of Flame", "qty": 4, "fallback": 8000}]}, {"id": "alc_elixir_of_death_8", "type": "alchemy", "name": "Elixir of Death", "sell": 95000, "secPerBatch": 5, "mats": [{"name": "Oil of Corruption", "qty": 2, "fallback": 45000}, {"name": "Pure Powder Reagent", "qty": 4, "fallback": 14000}, {"name": "Powder of Darkness", "qty": 5, "fallback": 7000}, {"name": "Bloody Tree Knot", "qty": 4, "fallback": 9000}]}, {"id": "alc_elixir_of_demihuman_hunt_9", "type": "alchemy", "name": "Elixir of Demihuman Hunt", "sell": 68000, "secPerBatch": 5, "mats": [{"name": "Oil of Storms", "qty": 1, "fallback": 48000}, {"name": "Clear Liquid Reagent", "qty": 4, "fallback": 12000}, {"name": "Powder of Time", "qty": 3, "fallback": 6000}, {"name": "Ash Sap", "qty": 5, "fallback": 2500}]}, {"id": "alc_elixir_of_detection_10", "type": "alchemy", "name": "Elixir of Detection", "sell": 61000, "secPerBatch": 5, "mats": [{"name": "Oil of Tranquility", "qty": 1, "fallback": 42000}, {"name": "Clear Liquid Reagent", "qty": 3, "fallback": 12000}, {"name": "Powder of Earth", "qty": 4, "fallback": 5500}, {"name": "Monk's Branch", "qty": 3, "fallback": 5000}]}, {"id": "alc_elixir_of_endurance_11", "type": "alchemy", "name": "Elixir of Endurance", "sell": 72000, "secPerBatch": 4, "mats": [{"name": "Trace of Nature", "qty": 2, "fallback": 18000}, {"name": "Powder of Earth", "qty": 3, "fallback": 5500}, {"name": "Pure Powder Reagent", "qty": 1, "fallback": 14000}]}, {"id": "alc_elixir_of_energy_12", "type": "alchemy", "name": "Elixir of Energy", "sell": 48000, "secPerBatch": 4, "mats": [{"name": "Clear Liquid Reagent", "qty": 2, "fallback": 12000}, {"name": "Powder of Time", "qty": 3, "fallback": 6000}, {"name": "Maple Sap", "qty": 5, "fallback": 2200}, {"name": "Blood 2", "qty": 2, "fallback": 8000}]}, {"id": "alc_elixir_of_frenzy_13", "type": "alchemy", "name": "Elixir of Frenzy", "sell": 89000, "secPerBatch": 5, "mats": [{"name": "Oil of Storms", "qty": 1, "fallback": 48000}, {"name": "Pure Powder Reagent", "qty": 4, "fallback": 14000}, {"name": "Powder of Flame", "qty": 5, "fallback": 8000}, {"name": "Trace of Ascension", "qty": 2, "fallback": 95000}]}, {"id": "alc_elixir_of_fury_14", "type": "alchemy", "name": "Elixir of Fury", "sell": 91000, "secPerBatch": 5, "mats": [{"name": "Oil of Regeneration", "qty": 1, "fallback": 55000}, {"name": "Pure Powder Reagent", "qty": 4, "fallback": 14000}, {"name": "Powder of Flame", "qty": 5, "fallback": 8000}, {"name": "Trace of Violence", "qty": 2, "fallback": 22000}]}, {"id": "alc_elixir_of_human_hunt_15", "type": "alchemy", "name": "Elixir of Human Hunt", "sell": 64000, "secPerBatch": 5, "mats": [{"name": "Oil of Fortitude", "qty": 1, "fallback": 45000}, {"name": "Clear Liquid Reagent", "qty": 4, "fallback": 12000}, {"name": "Powder of Darkness", "qty": 3, "fallback": 7000}, {"name": "Birch Sap", "qty": 5, "fallback": 2400}]}, {"id": "alc_elixir_of_labor_16", "type": "alchemy", "name": "Elixir of Labor", "sell": 38000, "secPerBatch": 4, "mats": [{"name": "Sinner's Blood", "qty": 2, "fallback": 45000}, {"name": "Refined Delotia Reagent", "qty": 2, "fallback": 28000}, {"name": "Powder of Time", "qty": 2, "fallback": 6000}, {"name": "Thornwood Sap", "qty": 4, "fallback": 3200}]}, {"id": "alc_elixir_of_life_17", "type": "alchemy", "name": "Elixir of Life", "sell": 85000, "secPerBatch": 5, "mats": [{"name": "Blood of the Sinner", "qty": 1, "fallback": 45000}, {"name": "Powder of Time", "qty": 2, "fallback": 6000}, {"name": "Clear Liquid Reagent", "qty": 1, "fallback": 12000}, {"name": "Monk's Branch", "qty": 2, "fallback": 5000}]}, {"id": "alc_elixir_of_ment_18", "type": "alchemy", "name": "Elixir of Ment", "sell": 52000, "secPerBatch": 4, "mats": [{"name": "Wise Man's Blood", "qty": 1, "fallback": 90000}, {"name": "Powder of Time", "qty": 2, "fallback": 6000}, {"name": "Clear Liquid Reagent", "qty": 2, "fallback": 12000}, {"name": "Fir Sap", "qty": 4, "fallback": 2300}]}, {"id": "alc_elixir_of_penetration_19", "type": "alchemy", "name": "Elixir of Penetration", "sell": 98000, "secPerBatch": 5, "mats": [{"name": "Oil of Corruption", "qty": 1, "fallback": 45000}, {"name": "Pure Powder Reagent", "qty": 5, "fallback": 14000}, {"name": "Powder of Darkness", "qty": 4, "fallback": 7000}, {"name": "Trace of Death", "qty": 2, "fallback": 25000}]}, {"id": "alc_elixir_of_persistence_20", "type": "alchemy", "name": "Elixir of Persistence", "sell": 44000, "secPerBatch": 5, "mats": [{"name": "Oil of Tranquility", "qty": 1, "fallback": 42000}, {"name": "Trace of Forest", "qty": 2, "fallback": 18000}, {"name": "Red-spotted Amanita", "qty": 3, "fallback": 12000}, {"name": "Clear Liquid Reagent", "qty": 5, "fallback": 12000}, {"name": "Powder of Time", "qty": 7, "fallback": 6000}]}, {"id": "alc_elixir_of_regeneration_21", "type": "alchemy", "name": "Elixir of Regeneration", "sell": 105000, "secPerBatch": 5, "mats": [{"name": "Oil of Regeneration", "qty": 2, "fallback": 55000}, {"name": "Pure Powder Reagent", "qty": 4, "fallback": 14000}, {"name": "Powder of Time", "qty": 3, "fallback": 6000}, {"name": "Trace of Life", "qty": 2, "fallback": 20000}]}, {"id": "alc_elixir_of_resistance_22", "type": "alchemy", "name": "Elixir of Resistance", "sell": 56000, "secPerBatch": 4, "mats": [{"name": "Clear Liquid Reagent", "qty": 2, "fallback": 12000}, {"name": "Powder of Earth", "qty": 4, "fallback": 5500}, {"name": "Ash Sap", "qty": 5, "fallback": 2500}, {"name": "Blood 3", "qty": 3, "fallback": 10000}]}, {"id": "alc_elixir_of_resurrection_23", "type": "alchemy", "name": "Elixir of Resurrection", "sell": 45000, "secPerBatch": 4, "mats": [{"name": "Blood of the Sinner", "qty": 1, "fallback": 45000}, {"name": "Powder of Time", "qty": 2, "fallback": 6000}, {"name": "Clear Liquid Reagent", "qty": 1, "fallback": 12000}, {"name": "Fire Flake Flower", "qty": 3, "fallback": 2500}]}, {"id": "alc_elixir_of_seal_24", "type": "alchemy", "name": "Elixir of Seal", "sell": 77000, "secPerBatch": 5, "mats": [{"name": "Oil of Tranquility", "qty": 1, "fallback": 42000}, {"name": "Pure Powder Reagent", "qty": 3, "fallback": 14000}, {"name": "Powder of Earth", "qty": 4, "fallback": 5500}, {"name": "Trace of Origin", "qty": 2, "fallback": 28000}]}, {"id": "alc_elixir_of_shock_25", "type": "alchemy", "name": "Elixir of Shock", "sell": 70000, "secPerBatch": 5, "mats": [{"name": "Clown's Blood", "qty": 1, "fallback": 35000}, {"name": "Tiger Mushroom", "qty": 5, "fallback": 9000}, {"name": "Cedar Sap", "qty": 7, "fallback": 2600}, {"name": "Powder of Time", "qty": 3, "fallback": 6000}]}, {"id": "alc_elixir_of_skill_26", "type": "alchemy", "name": "Elixir of Skill", "sell": 82000, "secPerBatch": 5, "mats": [{"name": "Wise Man's Blood", "qty": 2, "fallback": 90000}, {"name": "Delotia", "qty": 5, "fallback": 15000}, {"name": "Powder of Time", "qty": 2, "fallback": 6000}, {"name": "Thornwood Sap", "qty": 5, "fallback": 3200}, {"name": "Trace of Chaos", "qty": 2, "fallback": 30000}]}, {"id": "alc_elixir_of_sky_27", "type": "alchemy", "name": "Elixir of Sky", "sell": 93000, "secPerBatch": 5, "mats": [{"name": "Oil of Storms", "qty": 1, "fallback": 48000}, {"name": "Clear Liquid Reagent", "qty": 4, "fallback": 12000}, {"name": "Powder of Rifts", "qty": 3, "fallback": 7500}, {"name": "Fir Sap", "qty": 6, "fallback": 2300}]}, {"id": "alc_elixir_of_spells_28", "type": "alchemy", "name": "Elixir of Spells", "sell": 86000, "secPerBatch": 5, "mats": [{"name": "Wise Man's Blood", "qty": 1, "fallback": 90000}, {"name": "Powder of Darkness", "qty": 4, "fallback": 7000}, {"name": "Clear Liquid Reagent", "qty": 3, "fallback": 12000}, {"name": "Maple Sap", "qty": 5, "fallback": 2200}]}, {"id": "alc_elixir_of_swiftness_29", "type": "alchemy", "name": "Elixir of Swiftness", "sell": 58000, "secPerBatch": 4, "mats": [{"name": "Clear Liquid Reagent", "qty": 2, "fallback": 12000}, {"name": "Powder of Time", "qty": 4, "fallback": 6000}, {"name": "Birch Sap", "qty": 5, "fallback": 2400}, {"name": "Blood 2", "qty": 2, "fallback": 8000}]}, {"id": "alc_elixir_of_the_wise_30", "type": "alchemy", "name": "Elixir of the Wise", "sell": 110000, "secPerBatch": 5, "mats": [{"name": "Trace of Ascension", "qty": 1, "fallback": 95000}, {"name": "Powder of Darkness", "qty": 2, "fallback": 7000}, {"name": "Clear Liquid Reagent", "qty": 1, "fallback": 12000}]}, {"id": "alc_elixir_of_time_31", "type": "alchemy", "name": "Elixir of Time", "sell": 62000, "secPerBatch": 5, "mats": [{"name": "Wise Man's Blood", "qty": 1, "fallback": 90000}, {"name": "Fire Flake Flower", "qty": 6, "fallback": 2500}, {"name": "Maple Sap", "qty": 5, "fallback": 2200}, {"name": "Powder of Time", "qty": 2, "fallback": 6000}]}, {"id": "alc_elixir_of_will_32", "type": "alchemy", "name": "Elixir of Will", "sell": 74000, "secPerBatch": 5, "mats": [{"name": "Oil of Fortitude", "qty": 1, "fallback": 45000}, {"name": "Clear Liquid Reagent", "qty": 3, "fallback": 12000}, {"name": "Powder of Earth", "qty": 3, "fallback": 5500}, {"name": "Monk's Branch", "qty": 4, "fallback": 5000}]}, {"id": "alc_exp_elixir_33", "type": "alchemy", "name": "EXP Elixir", "sell": 69000, "secPerBatch": 5, "mats": [{"name": "Wise Man's Blood", "qty": 1, "fallback": 90000}, {"name": "Powder of Time", "qty": 3, "fallback": 6000}, {"name": "Clear Liquid Reagent", "qty": 2, "fallback": 12000}, {"name": "Delotia", "qty": 4, "fallback": 15000}]}, {"id": "alc_gem_polisher_34", "type": "alchemy", "name": "Gem Polisher", "sell": 32000, "secPerBatch": 4, "mats": [{"name": "Pure Powder Reagent", "qty": 1, "fallback": 14000}, {"name": "Processed Coal", "qty": 4, "fallback": 3000}, {"name": "Purified Water", "qty": 6, "fallback": 200}, {"name": "Trace of Origin", "qty": 2, "fallback": 28000}]}, {"id": "alc_golden_hand_elixir_35", "type": "alchemy", "name": "Golden Hand Elixir", "sell": 54000, "secPerBatch": 5, "mats": [{"name": "Clear Liquid Reagent", "qty": 2, "fallback": 12000}, {"name": "Powder of Time", "qty": 3, "fallback": 6000}, {"name": "Gold Ingot", "qty": 1, "fallback": 45000}, {"name": "Ash Sap", "qty": 4, "fallback": 2500}]}, {"id": "alc_grim_reaper_s_elixir_36", "type": "alchemy", "name": "Grim Reaper's Elixir", "sell": 99000, "secPerBatch": 5, "mats": [{"name": "Oil of Corruption", "qty": 2, "fallback": 45000}, {"name": "Pure Powder Reagent", "qty": 4, "fallback": 14000}, {"name": "Powder of Darkness", "qty": 5, "fallback": 7000}, {"name": "Trace of Death", "qty": 3, "fallback": 25000}]}, {"id": "alc_leather_glaze_37", "type": "alchemy", "name": "Leather Glaze", "sell": 28000, "secPerBatch": 4, "mats": [{"name": "Clear Liquid Reagent", "qty": 1, "fallback": 12000}, {"name": "Powder of Darkness", "qty": 2, "fallback": 7000}, {"name": "Maple Sap", "qty": 3, "fallback": 2200}, {"name": "Trace of Ascension", "qty": 3, "fallback": 95000}]}, {"id": "alc_legendary_beast_s_blood_38", "type": "alchemy", "name": "Legendary Beast's Blood", "sell": 95000, "secPerBatch": 4, "mats": [{"name": "Pure Powder Reagent", "qty": 1, "fallback": 14000}, {"name": "Blood 5", "qty": 2, "fallback": 12000}, {"name": "Trace of the Earth", "qty": 1, "fallback": 18000}, {"name": "Spirit's Leaf", "qty": 1, "fallback": 8000}]}, {"id": "alc_metal_solvent_39", "type": "alchemy", "name": "Metal Solvent", "sell": 26000, "secPerBatch": 4, "mats": [{"name": "Clear Liquid Reagent", "qty": 1, "fallback": 12000}, {"name": "Rough Stone", "qty": 4, "fallback": 800}, {"name": "Melted Iron Shard", "qty": 3, "fallback": 2500}, {"name": "Trace of Savagery", "qty": 2, "fallback": 22000}]}, {"id": "alc_oil_of_corruption_40", "type": "alchemy", "name": "Oil of Corruption", "sell": 45000, "secPerBatch": 5, "mats": [{"name": "Fruit of the Sun", "qty": 1, "fallback": 18000}, {"name": "Powder of Darkness", "qty": 1, "fallback": 7000}, {"name": "Spirit's Leaf", "qty": 1, "fallback": 8000}, {"name": "Sinner's Blood", "qty": 1, "fallback": 45000}]}, {"id": "alc_oil_of_fortitude_41", "type": "alchemy", "name": "Oil of Fortitude", "sell": 45000, "secPerBatch": 5, "mats": [{"name": "Fruit of Nature", "qty": 1, "fallback": 16000}, {"name": "Monk's Branch", "qty": 1, "fallback": 5000}, {"name": "Powder of Flame", "qty": 1, "fallback": 8000}, {"name": "Clown's Blood", "qty": 1, "fallback": 35000}]}, {"id": "alc_oil_of_regeneration_42", "type": "alchemy", "name": "Oil of Regeneration", "sell": 55000, "secPerBatch": 5, "mats": [{"name": "Fruit of Crimson Flame", "qty": 1, "fallback": 20000}, {"name": "Legendary Beast's Blood", "qty": 1, "fallback": 95000}, {"name": "Red Tree Lump", "qty": 1, "fallback": 11000}, {"name": "Powder of Crevice", "qty": 1, "fallback": 9000}]}, {"id": "alc_oil_of_storms_43", "type": "alchemy", "name": "Oil of Storms", "sell": 48000, "secPerBatch": 5, "mats": [{"name": "Fruit of Abundance", "qty": 1, "fallback": 17000}, {"name": "Powder of Time", "qty": 1, "fallback": 6000}, {"name": "Old Tree Bark", "qty": 1, "fallback": 7500}, {"name": "Tyrant's Blood", "qty": 1, "fallback": 88000}]}, {"id": "alc_oil_of_tranquility_44", "type": "alchemy", "name": "Oil of Tranquility", "sell": 42000, "secPerBatch": 5, "mats": [{"name": "Fruit of Magic Power", "qty": 1, "fallback": 19000}, {"name": "Powder of Earth", "qty": 1, "fallback": 5500}, {"name": "Bloody Tree Knot", "qty": 1, "fallback": 9000}, {"name": "Wise Man's Blood", "qty": 1, "fallback": 90000}]}, {"id": "alc_plywood_hardener_45", "type": "alchemy", "name": "Plywood Hardener", "sell": 30000, "secPerBatch": 4, "mats": [{"name": "Pure Powder Reagent", "qty": 1, "fallback": 14000}, {"name": "Fir Sap", "qty": 4, "fallback": 2300}, {"name": "Bloody Tree Knot", "qty": 3, "fallback": 9000}, {"name": "Trace of the Earth", "qty": 3, "fallback": 18000}]}, {"id": "alc_pure_powder_reagent_46", "type": "alchemy", "name": "Pure Powder Reagent", "sell": 14000, "secPerBatch": 3, "mats": [{"name": "Sugar", "qty": 1, "fallback": 500}, {"name": "Silver Azalea", "qty": 1, "fallback": 1500}, {"name": "Weeds", "qty": 1, "fallback": 500}, {"name": "Purified Water", "qty": 1, "fallback": 200}]}, {"id": "alc_sinner_s_blood_47", "type": "alchemy", "name": "Sinner's Blood", "sell": 45000, "secPerBatch": 4, "mats": [{"name": "Clear Liquid Reagent", "qty": 1, "fallback": 12000}, {"name": "Blood 2", "qty": 2, "fallback": 8000}, {"name": "Powder of Flame", "qty": 1, "fallback": 8000}, {"name": "Bloody Tree Knot", "qty": 1, "fallback": 9000}]}, {"id": "alc_spirit_perfume_elixir_48", "type": "alchemy", "name": "Spirit Perfume Elixir", "sell": 280000, "secPerBatch": 6, "mats": [{"name": "Blood of the Sinner", "qty": 3, "fallback": 45000}, {"name": "Powder of Flame", "qty": 4, "fallback": 8000}, {"name": "Oil of Corruption", "qty": 2, "fallback": 45000}, {"name": "Pure Powder Reagent", "qty": 1, "fallback": 14000}]}, {"id": "alc_tyrant_s_blood_49", "type": "alchemy", "name": "Tyrant's Blood", "sell": 88000, "secPerBatch": 4, "mats": [{"name": "Pure Powder Reagent", "qty": 1, "fallback": 14000}, {"name": "Blood 4", "qty": 2, "fallback": 15000}, {"name": "Trace of Savagery", "qty": 1, "fallback": 22000}, {"name": "Monk's Branch", "qty": 1, "fallback": 5000}]}, {"id": "alc_wise_man_s_blood_50", "type": "alchemy", "name": "Wise Man's Blood", "sell": 90000, "secPerBatch": 4, "mats": [{"name": "Clear Liquid Reagent", "qty": 1, "fallback": 12000}, {"name": "Blood 3", "qty": 2, "fallback": 10000}, {"name": "Powder of Time", "qty": 1, "fallback": 6000}, {"name": "Trace of Ascension", "qty": 1, "fallback": 95000}]}, {"id": "alc_worker_s_elixir_51", "type": "alchemy", "name": "Worker's Elixir", "sell": 41000, "secPerBatch": 4, "mats": [{"name": "Clear Liquid Reagent", "qty": 2, "fallback": 12000}, {"name": "Powder of Time", "qty": 3, "fallback": 6000}, {"name": "Fir Sap", "qty": 5, "fallback": 2300}, {"name": "Blood 2", "qty": 2, "fallback": 8000}]}, {"id": "coo_aloe_cookie_1000", "type": "cooking", "name": "Aloe Cookie", "sell": 12000, "secPerBatch": 3, "mats": [{"name": "Dough", "qty": 2, "fallback": 2000}, {"name": "Aloe", "qty": 3, "fallback": 1500}, {"name": "Sugar", "qty": 2, "fallback": 500}, {"name": "Egg", "qty": 2, "fallback": 2000}]}, {"id": "coo_aloe_yogurt_1001", "type": "cooking", "name": "Aloe Yogurt", "sell": 15000, "secPerBatch": 3, "mats": [{"name": "Milk", "qty": 2, "fallback": 3500}, {"name": "Aloe", "qty": 3, "fallback": 1500}, {"name": "Sugar", "qty": 1, "fallback": 500}, {"name": "Leavening Agent", "qty": 1, "fallback": 800}]}, {"id": "coo_assorted_side_dishes_1002", "type": "cooking", "name": "Assorted Side Dishes", "sell": 22000, "secPerBatch": 4, "mats": [{"name": "Fried Fish", "qty": 1, "fallback": 8000}, {"name": "Meat", "qty": 2, "fallback": 2200}, {"name": "Egg", "qty": 2, "fallback": 2000}, {"name": "Onion", "qty": 1, "fallback": 1200}]}, {"id": "coo_balenos_meal_1003", "type": "cooking", "name": "Balenos Meal", "sell": 85000, "secPerBatch": 5, "mats": [{"name": "Cheese Gratin", "qty": 1, "fallback": 35000}, {"name": "Meat Stew", "qty": 1, "fallback": 28000}, {"name": "Fried Fish", "qty": 1, "fallback": 8000}, {"name": "Beer", "qty": 1, "fallback": 5000}]}, {"id": "coo_beer_1004", "type": "cooking", "name": "Beer", "sell": 5000, "secPerBatch": 3, "mats": [{"name": "Flour", "qty": 2, "fallback": 1500}, {"name": "Mineral Water", "qty": 3, "fallback": 800}, {"name": "Sugar", "qty": 1, "fallback": 500}, {"name": "Leavening Agent", "qty": 2, "fallback": 800}]}, {"id": "coo_blood_altar_cupcake_1005", "type": "cooking", "name": "Blood Altar Cupcake", "sell": 45000, "secPerBatch": 4, "mats": [{"name": "Dough", "qty": 3, "fallback": 2000}, {"name": "Fruit", "qty": 2, "fallback": 3000}, {"name": "Sugar", "qty": 3, "fallback": 500}, {"name": "Milk", "qty": 2, "fallback": 3500}]}, {"id": "coo_boiled_bird_egg_1006", "type": "cooking", "name": "Boiled Bird Egg", "sell": 8000, "secPerBatch": 2, "mats": [{"name": "Egg", "qty": 3, "fallback": 2000}, {"name": "Mineral Water", "qty": 2, "fallback": 800}]}, {"id": "coo_calpheon_meal_1007", "type": "cooking", "name": "Calpheon Meal", "sell": 120000, "secPerBatch": 5, "mats": [{"name": "Soft Bread", "qty": 1, "fallback": 18000}, {"name": "Cheese Pie", "qty": 1, "fallback": 28000}, {"name": "Meat Sandwich", "qty": 1, "fallback": 32000}, {"name": "Wine", "qty": 1, "fallback": 15000}]}, {"id": "coo_cheese_gratin_1008", "type": "cooking", "name": "Cheese Gratin", "sell": 35000, "secPerBatch": 4, "mats": [{"name": "Cheese", "qty": 2, "fallback": 8000}, {"name": "Milk", "qty": 2, "fallback": 3500}, {"name": "Dough", "qty": 2, "fallback": 2000}, {"name": "Meat", "qty": 3, "fallback": 2200}]}, {"id": "coo_cheese_pie_1009", "type": "cooking", "name": "Cheese Pie", "sell": 28000, "secPerBatch": 4, "mats": [{"name": "Dough", "qty": 3, "fallback": 2000}, {"name": "Cheese", "qty": 2, "fallback": 8000}, {"name": "Egg", "qty": 2, "fallback": 2000}, {"name": "Butter", "qty": 1, "fallback": 4000}]}, {"id": "coo_chicken_breast_salad_1010", "type": "cooking", "name": "Chicken Breast Salad", "sell": 24000, "secPerBatch": 3, "mats": [{"name": "Chicken Meat", "qty": 3, "fallback": 2500}, {"name": "Olive Oil", "qty": 1, "fallback": 8000}, {"name": "Vinegar", "qty": 1, "fallback": 6000}, {"name": "Egg", "qty": 1, "fallback": 2000}]}, {"id": "coo_coconut_cocktail_1011", "type": "cooking", "name": "Coconut Cocktail", "sell": 18000, "secPerBatch": 3, "mats": [{"name": "Coconut", "qty": 2, "fallback": 4000}, {"name": "Mineral Water", "qty": 2, "fallback": 800}, {"name": "Sugar", "qty": 2, "fallback": 500}, {"name": "Fruit", "qty": 1, "fallback": 3000}]}, {"id": "coo_coconut_fried_fish_1012", "type": "cooking", "name": "Coconut Fried Fish", "sell": 26000, "secPerBatch": 4, "mats": [{"name": "Fish", "qty": 2, "fallback": 3500}, {"name": "Coconut", "qty": 1, "fallback": 4000}, {"name": "Flour", "qty": 2, "fallback": 1500}, {"name": "Egg", "qty": 1, "fallback": 2000}]}, {"id": "coo_dark_pudding_1013", "type": "cooking", "name": "Dark Pudding", "sell": 95000, "secPerBatch": 5, "mats": [{"name": "Ogre Blood", "qty": 1, "fallback": 25000}, {"name": "Dried Bird Meat", "qty": 2, "fallback": 5000}, {"name": "Deer Blood", "qty": 3, "fallback": 8000}, {"name": "Dough", "qty": 2, "fallback": 2000}]}, {"id": "coo_desert_dumpling_1014", "type": "cooking", "name": "Desert Dumpling", "sell": 20000, "secPerBatch": 4, "mats": [{"name": "Dough", "qty": 3, "fallback": 2000}, {"name": "Meat", "qty": 3, "fallback": 2200}, {"name": "Onion", "qty": 2, "fallback": 1200}, {"name": "Mineral Water", "qty": 1, "fallback": 800}]}, {"id": "coo_exotic_herbal_wine_1015", "type": "cooking", "name": "Exotic Herbal Wine", "sell": 16000, "secPerBatch": 4, "mats": [{"name": "Fruit", "qty": 3, "fallback": 3000}, {"name": "Mineral Water", "qty": 2, "fallback": 800}, {"name": "Sugar", "qty": 2, "fallback": 500}]}, {"id": "coo_fig_pie_1016", "type": "cooking", "name": "Fig Pie", "sell": 14000, "secPerBatch": 3, "mats": [{"name": "Dough", "qty": 2, "fallback": 2000}, {"name": "Fig", "qty": 3, "fallback": 2500}, {"name": "Sugar", "qty": 2, "fallback": 500}]}, {"id": "coo_fish_fillet_salad_1017", "type": "cooking", "name": "Fish Fillet Salad", "sell": 19000, "secPerBatch": 3, "mats": [{"name": "Fish", "qty": 3, "fallback": 3500}, {"name": "Olive Oil", "qty": 1, "fallback": 8000}, {"name": "Dressing", "qty": 1, "fallback": 5000}, {"name": "Onion", "qty": 1, "fallback": 1200}]}, {"id": "coo_freekeh_snake_stew_1018", "type": "cooking", "name": "Freekeh Snake Stew", "sell": 72000, "secPerBatch": 5, "mats": [{"name": "Snake Meat", "qty": 3, "fallback": 12000}, {"name": "Freekeh", "qty": 2, "fallback": 8000}, {"name": "Mineral Water", "qty": 3, "fallback": 800}, {"name": "Olive Oil", "qty": 1, "fallback": 8000}]}, {"id": "coo_fried_fish_1019", "type": "cooking", "name": "Fried Fish", "sell": 8000, "secPerBatch": 3, "mats": [{"name": "Fish", "qty": 2, "fallback": 3500}, {"name": "Flour", "qty": 1, "fallback": 1500}]}, {"id": "coo_fruit_juice_1020", "type": "cooking", "name": "Fruit Juice", "sell": 6000, "secPerBatch": 2, "mats": [{"name": "Fruit", "qty": 3, "fallback": 3000}, {"name": "Sugar", "qty": 1, "fallback": 500}, {"name": "Mineral Water", "qty": 2, "fallback": 800}]}, {"id": "coo_fruit_pudding_1021", "type": "cooking", "name": "Fruit Pudding", "sell": 11000, "secPerBatch": 3, "mats": [{"name": "Fruit", "qty": 3, "fallback": 3000}, {"name": "Milk", "qty": 1, "fallback": 3500}, {"name": "Sugar", "qty": 2, "fallback": 500}]}, {"id": "coo_fruit_wine_1022", "type": "cooking", "name": "Fruit Wine", "sell": 9000, "secPerBatch": 3, "mats": [{"name": "Fruit", "qty": 3, "fallback": 3000}, {"name": "Mineral Water", "qty": 2, "fallback": 800}, {"name": "Sugar", "qty": 2, "fallback": 500}]}, {"id": "coo_grape_juice_1023", "type": "cooking", "name": "Grape Juice", "sell": 7000, "secPerBatch": 2, "mats": [{"name": "Grape", "qty": 4, "fallback": 2200}, {"name": "Sugar", "qty": 1, "fallback": 500}, {"name": "Mineral Water", "qty": 1, "fallback": 800}]}, {"id": "coo_grilled_bird_meat_1024", "type": "cooking", "name": "Grilled Bird Meat", "sell": 10000, "secPerBatch": 3, "mats": [{"name": "Bird Meat", "qty": 3, "fallback": 2800}, {"name": "Salt", "qty": 1, "fallback": 400}, {"name": "Hot Pepper", "qty": 1, "fallback": 1500}]}, {"id": "coo_grilled_fish_1025", "type": "cooking", "name": "Grilled Fish", "sell": 9000, "secPerBatch": 3, "mats": [{"name": "Fish", "qty": 2, "fallback": 3500}, {"name": "Salt", "qty": 1, "fallback": 400}, {"name": "Hot Pepper", "qty": 1, "fallback": 1500}]}, {"id": "coo_honey_wine_1026", "type": "cooking", "name": "Honey Wine", "sell": 13000, "secPerBatch": 3, "mats": [{"name": "Honey", "qty": 2, "fallback": 4500}, {"name": "Mineral Water", "qty": 2, "fallback": 800}, {"name": "Sugar", "qty": 1, "fallback": 500}]}, {"id": "coo_honeycomb_cookie_1027", "type": "cooking", "name": "Honeycomb Cookie", "sell": 16000, "secPerBatch": 3, "mats": [{"name": "Honey", "qty": 2, "fallback": 4500}, {"name": "Dough", "qty": 2, "fallback": 2000}, {"name": "Egg", "qty": 1, "fallback": 2000}, {"name": "Sugar", "qty": 1, "fallback": 500}]}, {"id": "coo_hunter_s_salad_1028", "type": "cooking", "name": "Hunter's Salad", "sell": 17000, "secPerBatch": 3, "mats": [{"name": "Deer Meat", "qty": 2, "fallback": 2200}, {"name": "Dressing", "qty": 1, "fallback": 5000}, {"name": "Garlic", "qty": 2, "fallback": 2500}]}, {"id": "coo_kamasylvia_meal_1029", "type": "cooking", "name": "Kamasylvia Meal", "sell": 140000, "secPerBatch": 5, "mats": [{"name": "Rainbow Button Mushroom Cheese Melt", "qty": 1, "fallback": 55000}, {"name": "Fruit Wine", "qty": 1, "fallback": 9000}, {"name": "Special Arehaza Meal", "qty": 1, "fallback": 0}, {"name": "Meat Pie", "qty": 1, "fallback": 25000}]}, {"id": "coo_knight_combat_rations_1030", "type": "cooking", "name": "Knight Combat Rations", "sell": 110000, "secPerBatch": 5, "mats": [{"name": "Dark Pudding", "qty": 1, "fallback": 95000}, {"name": "Roast Meat", "qty": 1, "fallback": 12000}, {"name": "Soft Bread", "qty": 1, "fallback": 18000}, {"name": "Beer", "qty": 1, "fallback": 5000}]}, {"id": "coo_lean_meatball_1031", "type": "cooking", "name": "Lean Meatball", "sell": 21000, "secPerBatch": 4, "mats": [{"name": "Meat", "qty": 4, "fallback": 2200}, {"name": "Dough", "qty": 2, "fallback": 2000}, {"name": "Onion", "qty": 1, "fallback": 1200}, {"name": "Egg", "qty": 1, "fallback": 2000}]}, {"id": "coo_meat_croquette_1032", "type": "cooking", "name": "Meat Croquette", "sell": 23000, "secPerBatch": 4, "mats": [{"name": "Meat", "qty": 3, "fallback": 2200}, {"name": "Flour", "qty": 2, "fallback": 1500}, {"name": "Egg", "qty": 2, "fallback": 2000}, {"name": "Cheese", "qty": 1, "fallback": 8000}]}, {"id": "coo_meat_pasta_1033", "type": "cooking", "name": "Meat Pasta", "sell": 27000, "secPerBatch": 4, "mats": [{"name": "Dough", "qty": 3, "fallback": 2000}, {"name": "Meat", "qty": 3, "fallback": 2200}, {"name": "Garlic", "qty": 2, "fallback": 2500}, {"name": "Olive Oil", "qty": 1, "fallback": 8000}]}, {"id": "coo_meat_pie_1034", "type": "cooking", "name": "Meat Pie", "sell": 25000, "secPerBatch": 4, "mats": [{"name": "Dough", "qty": 3, "fallback": 2000}, {"name": "Meat", "qty": 3, "fallback": 2200}, {"name": "Egg", "qty": 1, "fallback": 2000}, {"name": "Salt", "qty": 1, "fallback": 400}]}, {"id": "coo_meat_sandwich_1035", "type": "cooking", "name": "Meat Sandwich", "sell": 32000, "secPerBatch": 4, "mats": [{"name": "Soft Bread", "qty": 1, "fallback": 18000}, {"name": "Meat", "qty": 3, "fallback": 2200}, {"name": "Cheese", "qty": 1, "fallback": 8000}, {"name": "Vegetables", "qty": 2, "fallback": 1800}]}, {"id": "coo_meat_soup_1036", "type": "cooking", "name": "Meat Soup", "sell": 15000, "secPerBatch": 3, "mats": [{"name": "Meat", "qty": 3, "fallback": 2200}, {"name": "Mineral Water", "qty": 3, "fallback": 800}, {"name": "Pepper", "qty": 1, "fallback": 1200}, {"name": "Onion", "qty": 1, "fallback": 1200}]}, {"id": "coo_meat_stew_1037", "type": "cooking", "name": "Meat Stew", "sell": 28000, "secPerBatch": 3, "mats": [{"name": "Deer Meat", "qty": 5, "fallback": 2200}, {"name": "Flour", "qty": 2, "fallback": 1500}, {"name": "Mineral Water", "qty": 3, "fallback": 800}, {"name": "Onion", "qty": 2, "fallback": 1200}]}, {"id": "coo_mediah_meal_1038", "type": "cooking", "name": "Mediah Meal", "sell": 130000, "secPerBatch": 5, "mats": [{"name": "Dark Pudding", "qty": 1, "fallback": 95000}, {"name": "Omelet", "qty": 1, "fallback": 18000}, {"name": "Pickled Vegetables", "qty": 1, "fallback": 12000}, {"name": "Exotic Herbal Wine", "qty": 1, "fallback": 16000}]}, {"id": "coo_milk_tea_1039", "type": "cooking", "name": "Milk Tea", "sell": 14000, "secPerBatch": 3, "mats": [{"name": "Milk", "qty": 2, "fallback": 3500}, {"name": "Tea", "qty": 1, "fallback": 3000}, {"name": "Sugar", "qty": 1, "fallback": 500}]}, {"id": "coo_oatmeal_1040", "type": "cooking", "name": "Oatmeal", "sell": 10000, "secPerBatch": 3, "mats": [{"name": "Flour", "qty": 2, "fallback": 1500}, {"name": "Milk", "qty": 1, "fallback": 3500}, {"name": "Onion", "qty": 1, "fallback": 1200}, {"name": "Butter", "qty": 1, "fallback": 4000}]}, {"id": "coo_omelet_1041", "type": "cooking", "name": "Omelet", "sell": 18000, "secPerBatch": 3, "mats": [{"name": "Egg", "qty": 3, "fallback": 2000}, {"name": "Olive Oil", "qty": 1, "fallback": 8000}, {"name": "Salt", "qty": 1, "fallback": 400}, {"name": "Hot Pepper", "qty": 1, "fallback": 1500}]}, {"id": "coo_pickled_vegetables_1042", "type": "cooking", "name": "Pickled Vegetables", "sell": 12000, "secPerBatch": 3, "mats": [{"name": "Vegetables", "qty": 3, "fallback": 1800}, {"name": "Vinegar", "qty": 2, "fallback": 6000}, {"name": "Mineral Water", "qty": 1, "fallback": 800}]}, {"id": "coo_prawn_salad_1043", "type": "cooking", "name": "Prawn Salad", "sell": 35700, "secPerBatch": 3, "mats": [{"name": "Shrimp", "qty": 4, "fallback": 4500}, {"name": "Olive Oil", "qty": 1, "fallback": 8000}, {"name": "Vinegar", "qty": 1, "fallback": 6000}, {"name": "Garlic", "qty": 2, "fallback": 2500}]}, {"id": "coo_rainbow_button_mushroom_cheese_melt_1044", "type": "cooking", "name": "Rainbow Button Mushroom Cheese Melt", "sell": 55000, "secPerBatch": 5, "mats": [{"name": "Rainbow Button Mushroom", "qty": 2, "fallback": 18000}, {"name": "Cheese", "qty": 2, "fallback": 8000}, {"name": "Butter", "qty": 1, "fallback": 4000}, {"name": "Dough", "qty": 2, "fallback": 2000}]}, {"id": "coo_red_sauce_1045", "type": "cooking", "name": "Red Sauce", "sell": 11000, "secPerBatch": 3, "mats": [{"name": "Base Sauce", "qty": 1, "fallback": 4000}, {"name": "Hot Pepper", "qty": 2, "fallback": 1500}, {"name": "Sugar", "qty": 1, "fallback": 500}, {"name": "Mineral Water", "qty": 1, "fallback": 800}]}, {"id": "coo_roast_meat_1046", "type": "cooking", "name": "Roast Meat", "sell": 12000, "secPerBatch": 3, "mats": [{"name": "Meat", "qty": 3, "fallback": 2200}, {"name": "Salt", "qty": 1, "fallback": 400}, {"name": "Hot Pepper", "qty": 1, "fallback": 1500}]}, {"id": "coo_seafood_gratin_1047", "type": "cooking", "name": "Seafood Gratin", "sell": 95000, "secPerBatch": 4, "mats": [{"name": "Octopus", "qty": 2, "fallback": 12000}, {"name": "Shrimp", "qty": 3, "fallback": 4500}, {"name": "Cheese", "qty": 2, "fallback": 8000}, {"name": "Milk", "qty": 3, "fallback": 3500}]}, {"id": "coo_seafood_pasta_1048", "type": "cooking", "name": "Seafood Pasta", "sell": 38000, "secPerBatch": 4, "mats": [{"name": "Dough", "qty": 3, "fallback": 2000}, {"name": "Seafood", "qty": 3, "fallback": 6000}, {"name": "Garlic", "qty": 2, "fallback": 2500}, {"name": "Olive Oil", "qty": 1, "fallback": 8000}]}, {"id": "coo_serendia_meal_1049", "type": "cooking", "name": "Serendia Meal", "sell": 100000, "secPerBatch": 5, "mats": [{"name": "Meat Stew", "qty": 1, "fallback": 28000}, {"name": "Cheese Gratin", "qty": 1, "fallback": 35000}, {"name": "Boiled Bird Egg", "qty": 1, "fallback": 8000}, {"name": "Beer", "qty": 1, "fallback": 5000}]}, {"id": "coo_soft_bread_1050", "type": "cooking", "name": "Soft Bread", "sell": 18000, "secPerBatch": 3, "mats": [{"name": "Dough", "qty": 3, "fallback": 2000}, {"name": "Egg", "qty": 1, "fallback": 2000}, {"name": "Milk", "qty": 1, "fallback": 3500}, {"name": "Leavening Agent", "qty": 2, "fallback": 800}]}, {"id": "coo_special_teff_sandwich_1051", "type": "cooking", "name": "Special Teff Sandwich", "sell": 165000, "secPerBatch": 4, "mats": [{"name": "Teff Bread", "qty": 2, "fallback": 25000}, {"name": "Free-range Chicken", "qty": 3, "fallback": 8000}, {"name": "Olive Oil", "qty": 1, "fallback": 8000}, {"name": "Egg", "qty": 4, "fallback": 2000}]}, {"id": "coo_steak_1052", "type": "cooking", "name": "Steak", "sell": 30000, "secPerBatch": 4, "mats": [{"name": "Meat", "qty": 4, "fallback": 2200}, {"name": "Salt", "qty": 1, "fallback": 400}, {"name": "Garlic", "qty": 2, "fallback": 2500}, {"name": "Red Sauce", "qty": 1, "fallback": 11000}]}, {"id": "coo_steamed_fish_1053", "type": "cooking", "name": "Steamed Fish", "sell": 11000, "secPerBatch": 3, "mats": [{"name": "Fish", "qty": 2, "fallback": 3500}, {"name": "Mineral Water", "qty": 2, "fallback": 800}, {"name": "Salt", "qty": 1, "fallback": 400}, {"name": "Garlic", "qty": 1, "fallback": 2500}]}, {"id": "coo_steamed_seafood_1054", "type": "cooking", "name": "Steamed Seafood", "sell": 29000, "secPerBatch": 4, "mats": [{"name": "Seafood", "qty": 3, "fallback": 6000}, {"name": "Mineral Water", "qty": 2, "fallback": 800}, {"name": "Salt", "qty": 1, "fallback": 400}, {"name": "Hot Pepper", "qty": 1, "fallback": 1500}]}, {"id": "coo_stir_fried_seafood_1055", "type": "cooking", "name": "Stir-Fried Seafood", "sell": 31000, "secPerBatch": 4, "mats": [{"name": "Seafood", "qty": 3, "fallback": 6000}, {"name": "Vegetables", "qty": 2, "fallback": 1800}, {"name": "Hot Pepper", "qty": 1, "fallback": 1500}, {"name": "Olive Oil", "qty": 1, "fallback": 8000}]}, {"id": "coo_tea_with_fine_scent_1056", "type": "cooking", "name": "Tea With Fine Scent", "sell": 20000, "secPerBatch": 3, "mats": [{"name": "Tea", "qty": 2, "fallback": 3000}, {"name": "Fruit", "qty": 2, "fallback": 3000}, {"name": "Honey", "qty": 1, "fallback": 4500}, {"name": "Mineral Water", "qty": 1, "fallback": 800}]}, {"id": "coo_teff_bread_1057", "type": "cooking", "name": "Teff Bread", "sell": 25000, "secPerBatch": 3, "mats": [{"name": "Teff Flour", "qty": 3, "fallback": 6000}, {"name": "Mineral Water", "qty": 2, "fallback": 800}, {"name": "Leavening Agent", "qty": 2, "fallback": 800}, {"name": "Salt", "qty": 1, "fallback": 400}]}, {"id": "coo_teff_sandwich_1058", "type": "cooking", "name": "Teff Sandwich", "sell": 48000, "secPerBatch": 4, "mats": [{"name": "Teff Bread", "qty": 1, "fallback": 25000}, {"name": "Meat", "qty": 2, "fallback": 2200}, {"name": "Cheese", "qty": 1, "fallback": 8000}, {"name": "Vegetables", "qty": 1, "fallback": 1800}]}, {"id": "coo_valencia_meal_1059", "type": "cooking", "name": "Valencia Meal", "sell": 150000, "secPerBatch": 5, "mats": [{"name": "King of the Jungle Hamburg", "qty": 1, "fallback": 80000}, {"name": "Date Palm Wine", "qty": 1, "fallback": 20000}, {"name": "Fruit Pudding", "qty": 1, "fallback": 11000}, {"name": "Teff Sandwich", "qty": 1, "fallback": 48000}]}, {"id": "coo_whale_meat_salad_1060", "type": "cooking", "name": "Whale Meat Salad", "sell": 340000, "secPerBatch": 4, "mats": [{"name": "Whale Meat", "qty": 1, "fallback": 180000}, {"name": "Olive Oil", "qty": 2, "fallback": 8000}, {"name": "Vinegar", "qty": 2, "fallback": 6000}, {"name": "Garlic", "qty": 3, "fallback": 2500}]}, {"id": "coo_wine_1061", "type": "cooking", "name": "Wine", "sell": 15000, "secPerBatch": 3, "mats": [{"name": "Grape", "qty": 5, "fallback": 2200}, {"name": "Mineral Water", "qty": 2, "fallback": 800}, {"name": "Sugar", "qty": 2, "fallback": 500}]}];
/* Virtual recipe for durability-based timer */
const DURABILITY_RECIPE = {
id: "durability_timer",
type: "durability",
name: "Time from Durability",
sell: 0,
secPerBatch: 5,
mats: []
};
let region = "na", activeCat = "hot", searchQ = "", currentView = "market";
let currentItems = [], hotItems = [], enhancePrices = {}, priceMap = {};
let sortByStock = false, selectedRecipe = null, lastCraftAmount = 1;
let durCurrent = 813, durMax = 3000, durPerBatch = 1, durSecPerBatch = 1;
let ocrWorker = null, ocrBusy = false;
let activeTimers = []; // { id, recipeId, name, amount, startAt, endAt, status: 'running'|'done' }
let craftHistory = [];
let tickHandle = null;
/* ── Persistence ── */
function loadState() {
try {
var raw = localStorage.getItem(STORAGE_KEY);
if (!raw) return;
var s = JSON.parse(raw);
if (s.region) region = s.region;
if (s.activeCat) activeCat = s.activeCat;
if (s.lastCraftAmount) lastCraftAmount = s.lastCraftAmount;
if (s.durCurrent != null) durCurrent = s.durCurrent;
if (s.durMax != null) durMax = s.durMax;
if (s.durPerBatch != null) durPerBatch = s.durPerBatch;
if (s.durSecPerBatch != null) durSecPerBatch = s.durSecPerBatch;
if (s.selectedRecipeId === "durability_timer") selectedRecipe = DURABILITY_RECIPE;
else if (s.selectedRecipeId) selectedRecipe = RECIPES.find(function(r){ return r.id === s.selectedRecipeId; }) || null;
if (Array.isArray(s.activeTimers)) activeTimers = s.activeTimers;
if (Array.isArray(s.craftHistory)) craftHistory = s.craftHistory.slice(0, 30);
} catch (e) { console.warn("loadState", e); }
}
function saveState() {
try {
localStorage.setItem(STORAGE_KEY, JSON.stringify({
region: region,
activeCat: activeCat,
lastCraftAmount: lastCraftAmount,
durCurrent: durCurrent,
durMax: durMax,
durPerBatch: durPerBatch,
durSecPerBatch: durSecPerBatch,
selectedRecipeId: selectedRecipe ? selectedRecipe.id : null,
activeTimers: activeTimers,
craftHistory: craftHistory.slice(0, 30),
savedAt: Date.now()
}));
} catch (e) { console.warn("saveState", e); }
}
function fmt(n) {
if (n == null) return "—";
n = Number(n);
if (n >= 1e12) return (n / 1e12).toFixed(2) + "T";
if (n >= 1e9) return (n / 1e9).toFixed(2) + "B";
if (n >= 1e6) return (n / 1e6).toFixed(2) + "M";
return n.toLocaleString("en-US");
}
function fmtTime(sec) {
sec = Math.max(0, Math.ceil(sec));
var h = Math.floor(sec / 3600), m = Math.floor((sec % 3600) / 60), s = sec % 60;
if (h > 0) return h + ":" + String(m).padStart(2,"0") + ":" + String(s).padStart(2,"0");
return String(m).padStart(2,"0") + ":" + String(s).padStart(2,"0");
}
function setStatus(state, text) {
const el = document.getElementById("statusDot");
el.className = "status-dot" + (state === "loading" ? " loading" : state === "error" ? " error" : "");
el.textContent = text;
}
function playDoneSound() {
try {
var ctx = playDoneSound._ctx || (playDoneSound._ctx = new (window.AudioContext || window.webkitAudioContext)());
if (ctx.state === "suspended") ctx.resume();
var now = ctx.currentTime;
// Pleasant two-tone chime
[523.25, 659.25, 783.99].forEach(function(freq, i) {
var o = ctx.createOscillator();
var g = ctx.createGain();
o.type = "sine";
o.frequency.value = freq;
g.gain.setValueAtTime(0.0001, now);
g.gain.exponentialRampToValueAtTime(0.15, now + 0.03 + i * 0.08);
g.gain.exponentialRampToValueAtTime(0.0001, now + 0.45 + i * 0.1);
o.connect(g);
g.connect(ctx.destination);
o.start(now + i * 0.08);
o.stop(now + 0.55 + i * 0.1);
});
} catch (e) { console.warn("sound", e); }
}
function tryFocusBdo() {
// Browser cannot reliably un-minimize another app; best-effort:
// 1) focus our window 2) open a custom protocol / known path hint
try { window.focus(); } catch (e) {}
// Optional: users can register a helper; attempt common protocol stubs
var hints = ["bdo://", "blackdesert://"];
hints.forEach(function(u) {
try {
var a = document.createElement("a");
a.href = u;
a.style.display = "none";
document.body.appendChild(a);
a.click();
a.remove();
} catch (e) {}
});
toast("Focus game", "Click Black Desert in the taskbar if it stayed minimized.", true);
}
function toast(title, body, success, opts) {
opts = opts || {};
var wrap = document.getElementById("toastWrap");
var el = document.createElement("div");
el.className = "toast" + (success ? " success" : "") + (opts.donePop ? " done-pop" : "");
el.innerHTML = "<strong>" + title + "</strong>" + (body || "");
if (opts.onClick) {
el.style.cursor = "pointer";
el.onclick = function() { opts.onClick(); el.remove(); };
}
wrap.appendChild(el);
setTimeout(function() { if (el.parentNode) el.remove(); }, opts.ttl || (opts.donePop ? 15000 : 6000));
}
function notifyCraftDone(timer) {
playDoneSound();
var body = (timer.amount ? timer.amount.toLocaleString() + "× " : "") +
(timer.name || "Craft") +
" finished. <span style='color:var(--text-dim)'>Click to focus game</span>";
toast("Craft complete!", body, true, {
donePop: true,
ttl: 20000,
onClick: tryFocusBdo
});
if ("Notification" in window && Notification.permission === "granted") {
try {
var n = new Notification("Craft complete!", {
body: (timer.amount ? timer.amount + "× " : "") + (timer.name || "Craft") + " — click to return",
tag: "bdo-craft-done-" + (timer.id || Date.now()),
requireInteraction: true
});
n.onclick = function() {
tryFocusBdo();
window.focus();
n.close();
};
} catch (e) {}
}
try { if (navigator.vibrate) navigator.vibrate([200, 80, 200, 80, 400]); } catch (e) {}
}
function requestNotifyPermission() {
if (!("Notification" in window)) return;
if (Notification.permission === "default") Notification.requestPermission();
}
function notifyDone(timer) { notifyCraftDone(timer); }
async function fetchJSON(url) {
const res = await fetch(url);
if (!res.ok) throw new Error("HTTP " + res.status);
const data = await res.json();
if (data && data.status === 500) throw new Error(data.message || "API error");
return data;
}
function mapItem(item) {
return {
name: item.name || ("Item #" + item.id), id: item.id,
price: item.basePrice || 0, stock: item.currentStock || 0,
trades: item.totalTrades || 0,
changeDir: item.priceChangeDirection != null ? item.priceChangeDirection : null,
changeVal: item.priceChangeValue || 0
};
}
var desktopMarketBatch=[];
var desktopMarketTimer=null;
async function shareMarketPricesWithDesktop() {
desktopMarketBatch=desktopMarketBatch.filter(function(item){return item.region===region;});
var pending=desktopMarketBatch.splice(0,1500);
var requestRegion=region;
try {
var base=location.protocol==='http:' && /^(127\.0\.0\.1|localhost)$/.test(location.hostname)?location.origin:bridgeSelectedOrigin;
if(!base){desktopMarketBatch=pending.concat(desktopMarketBatch);return;}
var response=await fetch(base+'/market-prices',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({region:requestRegion,items:pending.map(function(item){return {name:item.name,price:item.price,id:item.id};})}),cache:'no-store'});
if(!response.ok)throw Error('Desktop market cache unavailable');
}catch(error){desktopMarketBatch=pending.concat(desktopMarketBatch).slice(-1500);}
}
setInterval(shareMarketPricesWithDesktop,5000);
function rememberPrices(list) {
visionRememberMarketQuotes(list);
list.forEach(function(item){if(item.name && Number.isSafeInteger(Number(item.price)) && Number(item.price)>0)desktopMarketBatch.push({name:item.name,price:Number(item.price),id:Number(item.id)||undefined,region:item.marketRegion||region});});
desktopMarketBatch=desktopMarketBatch.slice(-1500);
clearTimeout(desktopMarketTimer);desktopMarketTimer=setTimeout(shareMarketPricesWithDesktop,500);
list.forEach(function(i) {
priceMap[i.name.toLowerCase()] = i.price;
if (/black stone|caphras|crystal shard|memory fragment|black gem/i.test(i.name)) {
enhancePrices[i.name] = i.price;
}
});
}
function lookupPrice(name, fallback) {
var k = name.toLowerCase();
if (priceMap[k]) return priceMap[k];
for (var key in priceMap) {
if (key.indexOf(k) !== -1 || k.indexOf(key) !== -1) return priceMap[key];
}
return fallback || 0;
}
async function loadHot() {
const requestRegion=region;
const data = await fetchJSON("https://api.arsha.io/v2/" + requestRegion + "/hot?lang=en");
if (!Array.isArray(data)) throw new Error("Invalid hot list");
return data.map(function(item){return Object.assign(mapItem(item),{marketRegion:requestRegion});});
}
async function loadCategory(mainCat) {
const requestRegion=region;
const data = await fetchJSON("https://api.arsha.io/v2/" + requestRegion + "/GetWorldMarketList?mainCategory=" + mainCat + "&lang=en");
if (!Array.isArray(data)) throw new Error("Invalid category");
return data.map(function(item){return Object.assign(mapItem(item),{marketRegion:requestRegion});});
}
function changeHtml(item) {
if (item.changeDir == null || !item.changeVal) return '<span class="change-pill flat">—</span>';
var isUp = item.changeDir === 2;
return '<span class="change-pill ' + (isUp ? "up" : "down") + '">' + (isUp ? "+" : "−") + fmt(item.changeVal) + '</span>';
}
function stockClass(s) {
if (s === 0) return "stock-none";
if (s < 20) return "stock-low";
return "stock-ok";
}
function getFiltered() {
var list = currentItems.slice();
if (searchQ.trim()) {
var q = searchQ.toLowerCase();
list = list.filter(function(i) { return i.name.toLowerCase().indexOf(q) !== -1; });
}
if (sortByStock) list.sort(function(a, b) { return b.stock - a.stock; });
else list.sort(function(a, b) { return b.price - a.price; });
return list;
}
function updateHeroStats(list) {
var totalStock = 0, marketVal = 0;
list.forEach(function(i) { totalStock += i.stock; marketVal += i.price * i.stock; });
document.getElementById("statItems").textContent = list.length.toLocaleString();
document.getElementById("statOrders").textContent = fmt(totalStock);
document.getElementById("statSilver").textContent = fmt(marketVal);
}
function renderPopular(items) {
var top = items.slice(0, 6);
document.getElementById("popularMeta").textContent = items.length + " items";
if (!top.length) {
document.getElementById("popularGrid").innerHTML = '<div class="loading-msg">No items</div>';
return;
}
document.getElementById("popularGrid").innerHTML = top.map(function(p) {
var chg = p.changeDir === 2 ? '<span class="pop-change up">+' + fmt(p.changeVal) + '</span>'
: p.changeDir === 1 ? '<span class="pop-change down">−' + fmt(p.changeVal) + '</span>'
: '<span class="pop-change flat">—</span>';
return '<div class="pop-item" data-name="' + p.name.replace(/"/g,'') + '"><div class="pop-icon">📦</div><div class="pop-name" title="' + p.name + '">' + p.name + '</div><div class="pop-price">🪙 ' + fmt(p.price) + '</div>' + chg + '</div>';
}).join("");
}
function renderListings() {
var list = getFiltered();
var catName = (CATEGORIES[activeCat] && CATEGORIES[activeCat].name) || "Market";
document.getElementById("listingsTitle").textContent = "☰ " + catName;
document.getElementById("listingsMeta").textContent = list.length + " items";
updateHeroStats(list);
var body = document.getElementById("listingsBody");
if (!list.length) {
body.innerHTML = '<tr><td colspan="5"><div class="loading-msg">No items match</div></td></tr>';
return;
}
body.innerHTML = list.map(function(i) {
return '<tr><td><div class="item-row"><div class="ico">📦</div><span title="' + i.name + '">' + i.name + '</span></div></td><td class="price-cell">' + fmt(i.price) + '</td><td class="' + stockClass(i.stock) + '">' + fmt(i.stock) + '</td><td style="color:var(--text-muted)">' + fmt(i.trades) + '</td><td>' + changeHtml(i) + '</td></tr>';
}).join("");
var card = document.getElementById("listingsCard");
card.classList.remove("flash"); void card.offsetWidth; card.classList.add("flash");
card.scrollIntoView({ behavior: "smooth", block: "nearest" });
}
function renderHotSidebar(items) {
var top = items.slice(0, 8);
if (!top.length) {
document.getElementById("hotList").innerHTML = '<div class="loading-msg" style="padding:20px">No data</div>';
return;
}
document.getElementById("hotList").innerHTML = top.map(function(h) {
var chgCls = h.changeDir === 2 ? "up" : h.changeDir === 1 ? "down" : "flat";
var chgTxt = h.changeDir === 2 ? "+" + fmt(h.changeVal) : h.changeDir === 1 ? "−" + fmt(h.changeVal) : "—";
return '<div class="hot-row" data-name="' + h.name.replace(/"/g,'') + '"><div class="ico">📦</div><div class="info"><div class="name" title="' + h.name + '">' + h.name + '</div><div class="meta">' + fmt(h.price) + '</div></div><div class="chg ' + chgCls + '">' + chgTxt + '</div></div>';
}).join("");
}
function showLoadingTable() {
document.getElementById("listingsBody").innerHTML =
'<tr><td colspan="5"><div class="loading-msg">Loading ' + ((CATEGORIES[activeCat] && CATEGORIES[activeCat].name) || "") + '...</div></td></tr>';
document.getElementById("listingsMeta").textContent = "...";
}
async function loadData() {
setStatus("loading", "Loading...");
showLoadingTable();
try {
hotItems = await loadHot();
rememberPrices(hotItems);
renderHotSidebar(hotItems);
renderPopular(hotItems);
if (activeCat === "hot") currentItems = hotItems;
else {
currentItems = await loadCategory(activeCat);
rememberPrices(currentItems);
}
if (activeCat === "30") {
enhancePrices = {};
currentItems.forEach(function(i) { enhancePrices[i.name] = i.price; });
} else if (!Object.keys(enhancePrices).length) {
try {
var enh = await loadCategory(30);
rememberPrices(enh);
enh.forEach(function(i) { enhancePrices[i.name] = i.price; });
} catch (e) {}
}
RECIPES.forEach(function(r) {
var live = lookupPrice(r.name, 0);
if (live) r.sell = live;
});
renderListings();
try { intelCaptureMarketObservations(false); intelCheckAlertsSilent(); } catch (e) {}
setStatus("ok", "Updated " + new Date().toLocaleTimeString());
} catch (err) {
console.error(err);
setStatus("error", "Failed");
document.getElementById("listingsBody").innerHTML =
'<tr><td colspan="5"><div class="error-msg">Error: ' + err.message + '<br>Try again or switch region</div></td></tr>';
}
}
function selectCategory(cat) {
showView("market");
activeCat = String(cat);
sortByStock = false;
document.querySelectorAll(".nav-item").forEach(function(n) {
n.classList.toggle("active", n.dataset.view === "market" && n.dataset.cat === activeCat);
});
document.querySelectorAll(".cat-btn").forEach(function(b) {
b.classList.toggle("active", b.dataset.cat === activeCat);
});
saveState();
loadData();
}
function showView(name) {
currentView = name;
if(['craft','grind','intel'].includes(name))window.history.replaceState(null,'','#'+name);
else if(name==='market' && location.hash)window.history.replaceState(null,'',location.pathname+location.search);
document.getElementById("viewGrind").classList.toggle("active",name==="grind");
document.getElementById("viewMarket").classList.toggle("active", name === "market");