Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
1645 lines (1503 loc) · 106 KB
/
Copy pathindex.html
File metadata and controls
1645 lines (1503 loc) · 106 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>Medieval Trading Game</title>
<!-- SEO & Social Media Meta Tags -->
<meta name="description" content="A browser-based medieval trading simulation by Unity AI Lab. Buy low, sell high, build your empire, and try not to starve. 42 locations, 200+ items, quests, combat, and existential dread.">
<meta name="author" content="Unity AI Lab - Hackall360, Sponge, GFourteen">
<meta name="keywords" content="medieval, trading, game, browser game, simulation, rpg, economy, merchant, unity ai lab">
<meta name="creator" content="Hackall360, Sponge, GFourteen">
<meta name="publisher" content="Unity AI Lab">
<!-- Open Graph (Facebook, Discord, LinkedIn, etc.) -->
<meta property="og:type" content="website">
<meta property="og:url" content="https://www.unityailab.com/Medieval-Trading-Game/">
<meta property="og:title" content="Medieval Trading Game | Unity AI Lab">
<meta property="og:description" content="A browser-based medieval trading simulation. Buy low, sell high, build your empire, and try not to starve. Created by Hackall360, Sponge, GFourteen.">
<meta property="og:image" content="https://www.unityailab.com/Medieval-Trading-Game/assets/images/SocialImage.jpg">
<meta property="og:image:alt" content="Medieval Trading Game - Unity AI Lab">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta property="og:site_name" content="Unity AI Lab">
<meta property="og:see_also" content="https://www.unityailab.com">
<!-- Twitter Card -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:url" content="https://www.unityailab.com/Medieval-Trading-Game/">
<meta name="twitter:title" content="Medieval Trading Game | Unity AI Lab">
<meta name="twitter:description" content="A browser-based medieval trading simulation. Buy low, sell high, build your empire. Created by Hackall360, Sponge, GFourteen.">
<meta name="twitter:image" content="https://www.unityailab.com/Medieval-Trading-Game/assets/images/SocialImage.jpg">
<meta name="twitter:image:alt" content="Medieval Trading Game - Unity AI Lab">
<meta name="twitter:creator" content="@UnityAILab">
<!-- Contact & Support -->
<meta name="contact" content="unityailabcontact@gmail.com">
<link rel="author" href="https://www.unityailab.com">
<link rel="canonical" href="https://www.unityailab.com/Medieval-Trading-Game/">
<!-- CSS Variables (must load first) -->
<link rel="stylesheet" href="src/css/base/variables.css?v=0.92.00">
<!-- Main stylesheets -->
<link rel="stylesheet" href="src/css/styles.css?v=0.92.00">
<link rel="stylesheet" href="src/css/ui-enhancements.css?v=0.92.00">
<link rel="stylesheet" href="src/css/npc-systems.css?v=0.92.00">
<!-- Z-Index System - MUST be last to override everything -->
<link rel="stylesheet" href="src/css/z-index-system.css?v=0.92.00">
<!-- 🎓 Tutorial System Styles -->
<link rel="stylesheet" href="src/css/tutorial.css?v=0.92.00">
<!-- CONFIG MUST LOAD FIRST - All other scripts depend on it -->
<script src="config.js?v=0.92.00"></script>
<!-- Z-INDEX CONSTANTS - JS mirror of z-index-system.css -->
<script src="src/js/config/z-index-constants.js?v=0.92.00"></script>
<script>
// Update document title from config immediately
if (typeof GameConfig !== 'undefined') {
document.title = GameConfig.game.name;
}
</script>
<!-- Debooger visibility controlled by config -->
<script>
// NUCLEAR OPTION - Remove debooger elements entirely when disabled
(function() {
var deboogerEnabled = (typeof GameConfig !== 'undefined' && GameConfig.debooger && GameConfig.debooger.enabled === true);
console.log('🔒 Debooger config check: enabled =', deboogerEnabled);
if (!deboogerEnabled) {
// Inject CSS to hide AND run script to DELETE elements after DOM loads
var style = document.createElement('style');
style.id = 'debooger-hide-style';
style.innerHTML = '#toggle-debooger-console, #debooger-console { display: none !important; visibility: hidden !important; }';
document.head.appendChild(style);
// DELETE the elements entirely once DOM is ready
document.addEventListener('DOMContentLoaded', function() {
var btn = document.getElementById('toggle-debooger-console');
var panel = document.getElementById('debooger-console');
if (btn) btn.remove();
if (panel) panel.remove();
console.log('🔒 Debooger elements REMOVED from DOM');
});
console.log('🔒 Debooger DISABLED - will remove elements');
} else {
console.log('🐛 Debooger ENABLED - visible for development');
}
})();
</script>
</head>
<body>
<!-- Overlay Container for all modals and overlays -->
<div id="overlay-container">
<!-- World Map Overlay -->
<div id="world-map-overlay" class="overlay">
<div class="overlay-content">
<button class="overlay-close" data-close-overlay="world-map-overlay">×</button>
<div class="map-container">
<!-- HTML-based map container - GameWorldRenderer renders here -->
<div id="world-map-overlay-html" class="html-map-container"></div>
<div class="map-controls">
<button id="overlay-zoom-in-btn" title="Zoom In (+)">+</button>
<button id="overlay-zoom-out-btn" title="Zoom Out (-)">-</button>
<button id="overlay-reset-view-btn" title="Reset View">⟲</button>
<button id="overlay-toggle-grid-btn" title="Toggle Grid">⊞</button>
<button id="overlay-center-player-btn" title="Center on Player">🎯</button>
</div>
</div>
<div id="overlay-location-details" class="location-details-panel hidden">
<!-- ✨ JS fills this with location info -->
</div>
</div>
</div>
<!-- ⚙️ Settings Panel is now dynamically created by settings-panel.js -->
<!-- The unified SettingsPanel handles all settings with proper z-index -->
<!-- 👤 Character Creation Overlay - define your tragic protagonist -->
<div id="character-creation-overlay" class="overlay">
<div class="overlay-content">
<button class="overlay-close" data-close-overlay="character-creation-overlay">×</button>
<h2>Create Your Character</h2>
<div id="character-creation-content">
<!-- Character creation will be populated here -->
</div>
</div>
</div>
<!-- Market Overlay -->
<div id="market-overlay" class="overlay">
<div class="overlay-content">
<button class="overlay-close" data-close-overlay="market-overlay">×</button>
<h2>Market</h2>
<div id="market-overlay-content">
<!-- Market content will be populated here -->
</div>
</div>
</div>
<!-- Exploration Overlay REMOVED - moved outside overlay-container for visibility -->
<!-- Inventory Overlay -->
<div id="inventory-overlay" class="overlay">
<div class="overlay-content">
<button class="overlay-close" data-close-overlay="inventory-overlay">×</button>
<h2>Inventory</h2>
<div id="inventory-overlay-content">
<!-- Inventory content will be populated here -->
</div>
</div>
</div>
<!-- 🚶 Travel Progress Overlay - the journey (and the suffering) -->
<div id="travel-progress-overlay" class="overlay">
<div class="overlay-content">
<h2>Travel Progress</h2>
<div class="travel-progress">
<h3 id="travel-destination">Traveling to...</h3>
<div class="progress-bar">
<div class="progress-fill" id="travel-progress-fill"></div>
</div>
<p>Distance: <span id="travel-distance">0</span> / <span id="travel-total-distance">0</span> miles</p>
<p>Time Remaining: <span id="travel-time-remaining">0</span> hours</p>
<p>Stats Drained:</p>
<div class="stat-drain">
<p>Hunger: <span id="hunger-drain">0</span></p>
<p>Thirst: <span id="thirst-drain">0</span></p>
<p>Fatigue: <span id="fatigue-drain">0</span></p>
</div>
</div>
</div>
</div>
<!-- 🎲 Random Encounter Overlay - plot twists incoming -->
<div id="random-encounter-overlay" class="overlay">
<div class="overlay-content">
<h2>Random Encounter</h2>
<div class="encounter-content">
<h3 id="encounter-title">Encounter Title</h3>
<p id="encounter-description">Encounter description</p>
<div class="encounter-choices" id="encounter-choices">
<!-- Encounter choices will be populated here -->
</div>
</div>
</div>
</div>
<!-- 🏆 Achievement Panel - flex your accomplishments -->
<div id="achievement-overlay" class="achievement-overlay" onclick="if(event.target === this) closeAchievementPanel()">
<div class="achievement-panel" onclick="event.stopPropagation()">
<button class="panel-close-x" onclick="closeAchievementPanel(); event.stopPropagation();">×</button>
<div class="achievement-panel-header">
<div>
<h2 class="achievement-panel-title">🏆 Achievements</h2>
<div class="achievement-progress">
<span id="achievement-progress-text">0 / 0 (0%)</span>
<div class="achievement-progress-bar">
<div id="achievement-progress-fill" class="achievement-progress-fill" style="width: 0%"></div>
</div>
</div>
</div>
</div>
<div class="achievement-categories">
<button class="achievement-category-btn active" data-category="all" onclick="filterAchievements(this, 'all')" title="Show all achievements">All</button>
<button class="achievement-category-btn" data-category="wealth" onclick="filterAchievements(this, 'wealth')" title="Show wealth-related achievements">💰 Wealth</button>
<button class="achievement-category-btn" data-category="trading" onclick="filterAchievements(this, 'trading')" title="Show trading-related achievements">🤝 Trading</button>
<button class="achievement-category-btn" data-category="travel" onclick="filterAchievements(this, 'travel')" title="Show travel-related achievements">🗺️ Travel</button>
<button class="achievement-category-btn" data-category="survival" onclick="filterAchievements(this, 'survival')" title="Show survival-related achievements">🛡️ Survival</button>
<button class="achievement-category-btn" data-category="collection" onclick="filterAchievements(this, 'collection')" title="Show collection-related achievements">🎒 Collection</button>
<button class="achievement-category-btn" data-category="time" onclick="filterAchievements(this, 'time')" title="Show time-based achievements">⏰ Time</button>
<button class="achievement-category-btn" data-category="special" onclick="filterAchievements(this, 'special')" title="Show special achievements">✨ Special</button>
<button class="achievement-category-btn leaderboard-btn" onclick="showLeaderboardPanel()" title="View global leaderboard">🏆 Hall of Champions</button>
</div>
<div id="achievement-grid" class="achievement-grid">
<!-- Achievements will be populated by JavaScript -->
</div>
<div class="panel-footer">
<button class="panel-close-btn-footer" onclick="closeAchievementPanel(); event.stopPropagation();" title="Close achievement panel">Close</button>
</div>
</div>
</div>
<!-- 💀 Game Over Screen - the final curtain -->
<div id="game-over-overlay" class="game-over-overlay hidden">
<div class="game-over-panel">
<div class="game-over-header">
<h1 id="game-over-title">💀 GAME OVER 💀</h1>
<p id="game-over-cause" class="game-over-cause">your journey ends here...</p>
</div>
<div class="game-over-stats">
<h3>📊 Final Reckoning</h3>
<div class="stats-grid" id="game-over-stats-grid">
<!-- Stats populated by JavaScript -->
</div>
</div>
<div class="game-over-ranking" id="game-over-ranking">
<!-- Ranking info populated by JavaScript -->
</div>
<div class="game-over-actions">
<button class="game-over-btn primary" onclick="closeGameOverAndRestart()" title="Start a new game">🔄 Try Again</button>
<button class="game-over-btn" onclick="closeGameOverToMenu()" title="Return to main menu">🏠 Main Menu</button>
<button class="game-over-btn" onclick="showLeaderboardFromGameOver()" title="View the Hall of Champions">🏆 View Leaderboard</button>
</div>
</div>
</div>
</div>
<!-- 🏚️ Exploration Panel - OUTSIDE overlay-container for guaranteed visibility -->
<div id="exploration-overlay" class="exploration-modal hidden">
<div class="exploration-modal-content">
<button class="exploration-close-btn" onclick="DungeonExplorationSystem.closeExploration()">×</button>
<div id="exploration-overlay-content">
<!-- Populated by DungeonExplorationSystem.renderExplorationUI() -->
</div>
</div>
</div>
<!-- ✨ Perk Selection Modal - OUTSIDE overlay-container so it works during game setup -->
<div id="perk-selection-modal" class="overlay">
<div class="overlay-content perk-modal-content">
<div class="perk-modal-header">
<h2>⚡ Choose Your Perks</h2>
<button class="overlay-close" onclick="closePerkModal()">×</button>
</div>
<div class="perk-modal-body">
<div class="perk-modal-info">
<p>Select up to 2 perks that will shape your character's journey. Each perk provides unique bonuses and penalties.</p>
<div class="perk-selection-counter">
<span class="counter-label">Selected:</span>
<span class="counter-value"><span id="modal-selected-count">0</span> / 2</span>
</div>
<p class="scroll-hint">Scroll down for more perks</p>
</div>
<div id="perks-container" class="perks-modal-grid">
<!-- Perks will be populated by JavaScript -->
</div>
</div>
<div class="perk-modal-footer">
<button type="button" class="btn-secondary" onclick="closePerkModal()" title="Cancel perk selection">Cancel</button>
<button type="button" id="confirm-perk-btn" class="btn-primary" onclick="confirmPerkSelection()" title="Confirm your perk choices">Confirm Selection</button>
</div>
</div>
</div>
<div id="game-container" class="hidden">
<!-- 🖤 TOP BAR - Time controls, title, and info widgets -->
<div id="top-bar">
<div class="time-controls-top">
<button id="pause-btn" class="time-btn">⏸️</button>
<select id="speed-selector" class="speed-dropdown" title="Select game speed multiplier">
<option value="NORMAL">1x Normal</option>
<option value="FAST">2x Fast</option>
<option value="VERY_FAST">4x Faster</option>
</select>
</div>
<div class="top-bar-title" id="top-bar-title">Medieval Trading Game</div>
<div class="top-bar-widgets" id="top-bar-widgets">
<!-- Date and weather indicators will be added here by JS -->
</div>
</div>
<!-- 🎮 MAIN GAME LAYOUT - side by side -->
<div id="game-layout">
<!-- 🗺️ GAME WORLD - now takes up most of the screen -->
<main id="game-main">
<section id="game-world">
<!-- World Map Container - EXPANDED -->
<div id="map-container" class="map-container">
<!-- 🖤 Using HTML-based GameWorldRenderer - canvas removed -->
<div id="map-controls" class="map-controls">
<button id="zoom-in-btn" onclick="if(GameWorldRenderer) GameWorldRenderer.zoomIn()" title="Zoom In (+)">+</button>
<button id="zoom-out-btn" onclick="if(GameWorldRenderer) GameWorldRenderer.zoomOut()" title="Zoom Out (-)">-</button>
<button id="reset-view-btn" onclick="if(GameWorldRenderer) GameWorldRenderer.resetView()" title="Reset View">⟲</button>
<button id="fullscreen-btn" onclick="if(GameWorldRenderer) GameWorldRenderer.toggleFullscreen()" title="Toggle Fullscreen">⛶</button>
<button id="center-on-player-btn" onclick="if(GameWorldRenderer) GameWorldRenderer.centerOnPlayer()" title="Center on Player">📍</button>
</div>
</div>
<!-- 📍 Location Details Panel -->
<div id="location-details" class="location-details-panel hidden"></div>
</section>
</main>
<!-- 📊 RIGHT SIDE PANEL - Player info, stats, gold, time -->
<aside id="side-panel">
<div class="side-panel-section player-section">
<div class="player-name-gold-row">
<span id="player-name">Player</span>
<div class="gold-display">
<span class="gold-icon">💰</span>
<span id="player-gold">100</span>
</div>
</div>
<!-- 🖤 Bug #11 Fix: Show player reputation -->
<div class="player-reputation-row" id="player-reputation-row">
<span class="reputation-icon" title="Your Reputation">🌱</span>
<span class="reputation-tier" id="player-rep-tier">Newcomer</span>
<span class="reputation-value" id="player-rep-value">(0)</span>
</div>
</div>
<div class="side-panel-section stats-section">
<div class="section-title">Stats</div>
<!-- 🖤 Two-row layout: icons on top, values below -->
<div class="stats-two-row">
<div class="stats-icons-row">
<span class="stat-icon" title="Strength">💪</span>
<span class="stat-icon" title="Intelligence">🧠</span>
<span class="stat-icon" title="Charisma">😊</span>
<span class="stat-icon" title="Endurance">🏃</span>
<span class="stat-icon" title="Luck">🍀</span>
</div>
<div class="stats-values-row">
<span class="stat-value" id="player-strength" title="Strength">5</span>
<span class="stat-value" id="player-intelligence" title="Intelligence">5</span>
<span class="stat-value" id="player-charisma" title="Charisma">5</span>
<span class="stat-value" id="player-endurance" title="Endurance">5</span>
<span class="stat-value" id="player-luck" title="Luck">5</span>
</div>
</div>
</div>
<div class="side-panel-section vitals-section">
<div class="section-title">Vitals</div>
<div class="vital-bar">
<span class="vital-icon">❤️</span>
<div class="vital-progress health-bar">
<div class="vital-fill" id="health-fill" style="width: 100%"></div>
</div>
<span class="vital-value" id="player-health-display">100</span>
</div>
<div class="vital-bar">
<span class="vital-icon">🍖</span>
<div class="vital-progress hunger-bar">
<div class="vital-fill" id="hunger-fill" style="width: 100%"></div>
</div>
<span class="vital-value" id="player-hunger-display">100</span>
</div>
<div class="vital-bar">
<span class="vital-icon">💧</span>
<div class="vital-progress thirst-bar">
<div class="vital-fill" id="thirst-fill" style="width: 100%"></div>
</div>
<span class="vital-value" id="player-thirst-display">100</span>
</div>
<div class="vital-bar">
<span class="vital-icon">😴</span>
<div class="vital-progress energy-bar">
<div class="vital-fill" id="energy-fill" style="width: 100%"></div>
</div>
<span class="vital-value" id="player-energy-display">100</span>
</div>
</div>
<!-- 🖤 Buttons removed - use bottom action bar or ESC for menu -->
</aside>
<!-- UI Panels Container - FLOATING over map -->
<div id="ui-panels">
<!-- Game Setup Panel -->
<section id="game-setup-panel" class="panel hidden">
<div class="setup-header">
<h2>New Game Setup</h2>
</div>
<form id="game-setup-form" onsubmit="event.preventDefault(); return false;">
<div class="form-group character-name-row">
<label for="character-name-input">Character Name:</label>
<div class="name-gold-inputs">
<input type="text" id="character-name-input" required placeholder="Enter your character name">
<div class="setup-gold-display">
<span class="gold-icon">💰</span>
<span id="setup-gold-amount" class="gold-value">100</span>
</div>
</div>
</div>
<!-- ⚔️ Difficulty Selection - how much do you want to suffer? -->
<div class="form-group">
<label>Select Difficulty:</label>
<div class="difficulty-selection">
<div class="difficulty-option" data-difficulty="easy">
<input type="radio" id="difficulty-easy" name="difficulty" value="easy">
<label for="difficulty-easy">
<h3>Easy</h3>
<p>+20% starting gold, better prices, easier progression</p>
</label>
</div>
<div class="difficulty-option" data-difficulty="normal">
<input type="radio" id="difficulty-normal" name="difficulty" value="normal" checked>
<label for="difficulty-normal">
<h3>Normal</h3>
<p>Standard gameplay experience (100 gold)</p>
</label>
</div>
<div class="difficulty-option" data-difficulty="hard">
<input type="radio" id="difficulty-hard" name="difficulty" value="hard">
<label for="difficulty-hard">
<h3>Hard</h3>
<p>-20% starting gold, worse prices, harder progression</p>
</label>
</div>
</div>
</div>
<!-- ✨ Perk Selection - your character's special traits -->
<div class="form-group">
<label>Character Perks:</label>
<div class="perk-selection-info">
<p>Choose unique advantages and disadvantages that shape your character.</p>
</div>
<button type="button" id="open-perk-modal-btn" class="perk-selection-button" onclick="openPerkModal()">
<span class="perk-button-icon">⚡</span>
<span class="perk-button-text">Select Perks</span>
<span class="perk-counter-badge">
<span id="selected-perks-count">0</span>/2
</span>
</button>
<div id="selected-perks-display" class="selected-perks-display">
<!-- Selected perks will be shown here -->
</div>
</div>
<!-- 📊 Character Attributes - emoji icons with tooltips 🦇 -->
<div class="attributes-display">
<div class="attributes-header">
<span class="attr-header-label">Attributes</span>
<div class="attribute-points-remaining" title="Distribute these points among your attributes">
<span class="points-value" id="attr-points-remaining">5</span>
<span class="points-label">pts</span>
<button type="button" id="random-stat-dice-btn" class="random-stat-dice" title="Randomly distribute available points" onclick="event.preventDefault(); if(typeof window.randomizeStatPoints === 'function') { window.randomizeStatPoints(); }">🎲</button>
</div>
</div>
<div class="attributes-grid">
<div class="attribute" title="Strength: Combat damage, carrying capacity, intimidation">
<span class="attribute-icon">💪</span>
<button type="button" class="attr-btn attr-down" data-attr="strength" title="Decrease Strength">−</button>
<span class="attribute-value" id="attr-strength">5</span>
<button type="button" class="attr-btn attr-up" data-attr="strength" title="Increase Strength">+</button>
</div>
<div class="attribute" title="Intelligence: Better prices, crafting quality, learning speed">
<span class="attribute-icon">🧠</span>
<button type="button" class="attr-btn attr-down" data-attr="intelligence" title="Decrease Intelligence">−</button>
<span class="attribute-value" id="attr-intelligence">5</span>
<button type="button" class="attr-btn attr-up" data-attr="intelligence" title="Increase Intelligence">+</button>
</div>
<div class="attribute" title="Charisma: Persuasion, NPC relationships, quest rewards">
<span class="attribute-icon">💬</span>
<button type="button" class="attr-btn attr-down" data-attr="charisma" title="Decrease Charisma">−</button>
<span class="attribute-value" id="attr-charisma">5</span>
<button type="button" class="attr-btn attr-up" data-attr="charisma" title="Increase Charisma">+</button>
</div>
<div class="attribute" title="Endurance: Max health, stamina, resistance to hardship">
<span class="attribute-icon">❤️</span>
<button type="button" class="attr-btn attr-down" data-attr="endurance" title="Decrease Endurance">−</button>
<span class="attribute-value" id="attr-endurance">5</span>
<button type="button" class="attr-btn attr-up" data-attr="endurance" title="Increase Endurance">+</button>
</div>
<div class="attribute" title="Luck: Critical hits, rare loot, random events favor you">
<span class="attribute-icon">🍀</span>
<button type="button" class="attr-btn attr-down" data-attr="luck" title="Decrease Luck">−</button>
<span class="attribute-value" id="attr-luck">5</span>
<button type="button" class="attr-btn attr-up" data-attr="luck" title="Increase Luck">+</button>
</div>
</div>
</div>
<div id="start-game-warning" class="start-game-warning">
<span class="warning-icon">!</span>
<span id="start-game-warning-text">Spend all attribute points and select 2 perks to start</span>
</div>
<div class="form-actions">
<button type="button" id="randomize-character-btn" class="secondary" title="Randomize all character options" onclick="event.preventDefault(); console.log('📍 Randomize clicked'); if(typeof window.randomizeCharacter === 'function') { window.randomizeCharacter(); } else { console.error('❌ randomizeCharacter not found'); }">🎲</button>
<button type="button" id="start-game-btn" class="primary" title="Begin your journey into darkness" onclick="event.preventDefault(); console.log('📍 Start Game clicked'); if(typeof window.createCharacter === 'function') { window.createCharacter(event); } else { console.error('❌ createCharacter not found'); }">▶ Start</button>
<button type="button" id="setup-settings-btn" class="secondary" title="Open settings menu" onclick="event.preventDefault(); if(typeof SettingsPanel !== 'undefined' && SettingsPanel.show) { SettingsPanel.show(); } else { console.error('SettingsPanel not available'); }">⚙️</button>
<button type="button" id="cancel-setup-btn" class="secondary" title="Return to main menu" onclick="event.preventDefault(); if(typeof cancelGameSetup === 'function') { cancelGameSetup(); } else { document.getElementById('game-setup-panel')?.classList.add('hidden'); document.getElementById('main-menu')?.classList.remove('hidden'); }">✖</button>
</div>
</form>
</section>
<!-- 🏪 Market Panel - medieval stock exchange but make it goth -->
<section id="market-panel" class="panel hidden">
<button class="panel-close-x" data-close-overlay="market-panel">×</button>
<div class="market-header">
<h2>Market</h2>
<div class="market-info">
<span id="market-location">Market</span>
<span id="market-reputation" class="reputation-display">Reputation: Neutral</span>
</div>
<div class="market-events" id="market-events">
<!-- Market events will be displayed here -->
</div>
</div>
<!-- Merchant Info -->
<div id="merchant-info-panel" class="merchant-info-panel">
<div class="merchant-greeting">
<span id="merchant-greeting-text">"Welcome to my shop!"</span>
</div>
<div class="merchant-details">
<div class="merchant-detail">
<span class="merchant-label">Merchant:</span>
<span id="merchant-name">Unknown</span>
</div>
<div class="merchant-detail">
<span class="merchant-label">Personality:</span>
<span id="merchant-personality">Friendly</span>
</div>
<div class="merchant-detail">
<span class="merchant-label">Relationship:</span>
<span id="merchant-relationship">⚪ Neutral</span>
</div>
<div class="merchant-detail">
<span class="merchant-label">Specialties:</span>
<span id="merchant-specialties">None</span>
</div>
<div class="merchant-detail merchant-finances">
<span class="merchant-label">💰 Gold:</span>
<span id="merchant-gold" class="merchant-gold">0 gold</span>
<span id="merchant-wealth-status" class="merchant-wealth-status">💵 comfortable</span>
</div>
<div class="merchant-gold-bar-container">
<div id="merchant-gold-bar" class="merchant-gold-bar" style="width: 100%"></div>
</div>
</div>
<!-- 🖤 Talk to Merchant button removed - NPC conversations auto-trigger -->
</div>
<!-- Trading Controls -->
<div class="trading-controls">
<div class="trade-mode-toggle">
<button id="single-trade-btn" class="trade-mode-btn active" title="Trade items one at a time">Single</button>
<button id="bulk-trade-btn" class="trade-mode-btn" title="Trade multiple items at once">Bulk</button>
</div>
<div class="trade-summary" id="trade-summary">
<span id="trade-total">Total: 0 gold</span>
<span id="trade-profit">Profit: 0 gold</span>
</div>
</div>
<div class="tabs">
<button class="tab-btn active" data-tab="buy" title="Buy items from the market">Buy</button>
<button class="tab-btn" data-tab="sell" title="Sell your items for gold">Sell</button>
<button class="tab-btn" data-tab="compare" title="Compare prices across locations">Compare</button>
<button class="tab-btn" data-tab="history" title="View your trade history">History</button>
<button class="tab-btn" data-tab="routes" title="Plan profitable trade routes">Routes</button>
<button class="tab-btn" data-tab="alerts" title="Set up price alerts">Alerts</button>
<button class="tab-btn" data-tab="news" title="Read market news and events">News</button>
</div>
<div id="market-content">
<div id="buy-tab" class="tab-content active">
<div class="market-controls">
<button id="refresh-market-btn" title="Refresh market prices and inventory">Refresh Market</button>
<select id="item-filter" title="Filter items by category">
<option value="all">All Items</option>
<option value="consumables">Consumables</option>
<option value="resources">Resources</option>
<option value="tools">Tools</option>
<option value="luxury">Luxury</option>
</select>
<div class="bulk-controls hidden" id="bulk-buy-controls">
<button id="select-all-buy-btn" title="Select all available items">Select All</button>
<button id="clear-selection-buy-btn" title="Clear your selection">Clear Selection</button>
<button id="buy-selected-btn" title="Purchase all selected items">Buy Selected</button>
</div>
</div>
<div id="buy-items" class="items-grid">
<!-- Items will be populated by JavaScript -->
</div>
<div id="trade-preview" class="trade-preview hidden">
<h4>Trade Preview</h4>
<div id="trade-preview-items"></div>
<div class="trade-total-info">
<span>Total Cost: <span id="preview-total-cost">0</span> gold</span>
<span>Total Weight: <span id="preview-total-weight">0</span> lbs</span>
</div>
<div class="trade-actions">
<button id="confirm-trade-btn" title="Complete this trade">Confirm Trade</button>
<button id="cancel-trade-btn" title="Cancel this trade">Cancel</button>
</div>
</div>
</div>
<div id="sell-tab" class="tab-content">
<div class="market-controls">
<span id="sell-info">Sell your items for gold</span>
<div class="bulk-controls hidden" id="bulk-sell-controls">
<button id="select-all-sell-btn" title="Select all your items to sell">Select All</button>
<button id="clear-selection-sell-btn" title="Clear your selection">Clear Selection</button>
<button id="sell-selected-btn" title="Sell all selected items">Sell Selected</button>
</div>
</div>
<div id="sell-items" class="items-grid">
<!-- Player items will be populated by JavaScript -->
</div>
</div>
<div id="compare-tab" class="tab-content">
<div class="market-controls">
<select id="compare-item-select" title="Choose an item to compare prices">
<option value="">Select an item to compare</option>
</select>
<button id="update-comparison-btn" title="Update price comparison data">Update Comparison</button>
<button id="add-route-btn" title="Add this item to your trade route plan">Add to Route Planner</button>
</div>
<div id="price-comparison" class="price-comparison">
<!-- Price comparison will be displayed here -->
</div>
</div>
<div id="history-tab" class="tab-content">
<div class="market-controls">
<button id="clear-history-btn" title="Clear all trade history">Clear History</button>
<button id="export-history-btn" title="Export trade history data">Export History</button>
</div>
<div id="trade-history" class="trade-history">
<!-- Trade history will be displayed here -->
</div>
</div>
<div id="routes-tab" class="tab-content">
<div class="market-controls">
<button id="plan-route-btn" title="Plan a new profitable trade route">Plan New Route</button>
<button id="clear-routes-btn" title="Clear all saved routes">Clear Routes</button>
</div>
<div id="route-planner" class="route-planner">
<!-- Route planning will be displayed here -->
</div>
</div>
<div id="alerts-tab" class="tab-content">
<div class="market-controls">
<button id="add-alert-btn" title="Create a new price alert">Add Price Alert</button>
<button id="clear-alerts-btn" title="Clear all price alerts">Clear Alerts</button>
</div>
<div id="price-alerts" class="price-alerts">
<!-- Price alerts will be displayed here -->
</div>
</div>
<div id="news-tab" class="tab-content">
<div class="market-controls">
<button id="refresh-news-btn" title="Refresh market news">Refresh News</button>
</div>
<div id="market-news" class="market-news">
<!-- Market news will be displayed here -->
</div>
</div>
</div>
<div class="panel-footer">
<button id="close-market-btn" class="panel-close-btn-footer" data-close-overlay="market-panel" title="Close the market panel">Close</button>
</div>
</section>
<!-- 🎒 Inventory Panel - all your worldly possessions -->
<section id="inventory-panel" class="panel hidden">
<button class="panel-close-x" data-close-overlay="inventory-panel">×</button>
<div class="inventory-header">
<h2>Inventory</h2>
<div class="inventory-controls">
<div class="inventory-info">
<span id="inventory-gold" class="inventory-gold-tracker">💰 0 gold</span>
<span id="inventory-weight">Weight: 0/50 lbs</span>
<span id="inventory-value">Value: 0 gold</span>
</div>
<div class="inventory-actions">
<button id="sort-inventory-btn" title="Sort inventory items">🔤</button>
<button id="filter-inventory-btn" title="Filter inventory items">🔍</button>
<button id="inventory-settings-btn" title="Open game settings" onclick="if(typeof SettingsPanel !== 'undefined' && SettingsPanel.show) SettingsPanel.show();">⚙️</button>
</div>
</div>
</div>
<!-- Quick Access Slots + Item Info Panel -->
<div class="quick-access-container">
<h3>Quick Access</h3>
<div class="quick-access-row">
<div id="quick-access-slots" class="quick-access-slots">
<!-- Quick access slots will be populated by JavaScript -->
</div>
<!-- Item Hover Info Panel - shows full item details on hover -->
<div id="item-hover-info" class="item-hover-info">
<div class="hover-info-header">
<span id="hover-item-icon" class="hover-icon">📦</span>
<span id="hover-item-name" class="hover-name">Hover over an item</span>
</div>
<div class="hover-info-body">
<p id="hover-item-desc" class="hover-desc">Item details will appear here</p>
<div class="hover-stats">
<div class="hover-stat"><span class="stat-label">Value:</span> <span id="hover-item-value">-</span></div>
<div class="hover-stat"><span class="stat-label">Weight:</span> <span id="hover-item-weight">-</span></div>
<div class="hover-stat"><span class="stat-label">Category:</span> <span id="hover-item-category">-</span></div>
<div class="hover-stat"><span class="stat-label">Rarity:</span> <span id="hover-item-rarity">-</span></div>
</div>
<div id="hover-item-bonuses" class="hover-bonuses hidden"></div>
</div>
</div>
</div>
</div>
<!-- Inventory Filter and Sort Options -->
<div id="inventory-options" class="inventory-options hidden">
<div class="filter-section">
<label for="inventory-category-filter">Category:</label>
<select id="inventory-category-filter">
<option value="all">All Items</option>
<option value="consumables">Consumables</option>
<option value="tools">Tools</option>
<option value="weapons">Weapons</option>
<option value="resources">Resources</option>
<option value="luxury">Luxury</option>
</select>
</div>
<div class="sort-section">
<label for="inventory-sort-method">Sort By:</label>
<select id="inventory-sort-method">
<option value="name">Name</option>
<option value="value">Value</option>
<option value="weight">Weight</option>
<option value="quantity">Quantity</option>
<option value="category">Category</option>
<option value="rarity">Rarity</option>
</select>
<button id="inventory-sort-order" title="Toggle sort order (ascending/descending)">⬇️</button>
</div>
</div>
<!-- Inventory Grid -->
<div class="inventory-grid-container">
<div id="inventory-items" class="inventory-grid">
<!-- Inventory items will be populated by JavaScript -->
</div>
</div>
<!-- Item Details Panel -->
<div id="item-details-panel" class="item-details-panel hidden">
<div class="item-details-header">
<h3 id="detail-item-name">Item Name</h3>
<button id="close-item-details" class="close-btn" data-close-overlay="item-details-panel">×</button>
</div>
<div class="item-details-content">
<div class="item-icon-large" id="detail-item-icon">📦</div>
<div class="item-info">
<p id="detail-item-description">Item description</p>
<div class="item-stats">
<div class="item-stat">
<span class="stat-label">Value:</span>
<span id="detail-item-value">0 gold</span>
</div>
<div class="item-stat">
<span class="stat-label">Weight:</span>
<span id="detail-item-weight">0 lbs</span>
</div>
<div class="item-stat">
<span class="stat-label">Quantity:</span>
<span id="detail-item-quantity">0</span>
</div>
<div class="item-stat">
<span class="stat-label">Category:</span>
<span id="detail-item-category">None</span>
</div>
<div class="item-stat">
<span class="stat-label">Rarity:</span>
<span id="detail-item-rarity">Common</span>
</div>
</div>
<div id="detail-item-effects" class="item-effects hidden">
<h4>Effects:</h4>
<div id="detail-effects-list"></div>
</div>
</div>
</div>
<div class="item-details-actions">
<button id="use-item-btn" class="action-btn" title="Use this item">Use</button>
<button id="equip-item-btn" class="action-btn" title="Equip this item">Equip</button>
<button id="drop-item-btn" class="action-btn" title="Drop this item from inventory">Drop</button>
<button id="examine-item-btn" class="action-btn" title="Examine this item closely">Examine</button>
<button id="gift-item-btn" class="action-btn" title="Gift this item to an NPC">Gift</button>
</div>
</div>
<div class="panel-footer">
<button id="close-inventory-btn" class="panel-close-btn-footer" data-close-overlay="inventory-panel" title="Close the inventory panel">Close</button>
</div>
</section>
<!-- Location Info Panel - MOVED outside ui-panels, positioned via CSS -->
<!-- 🗺️ Enhanced Travel Panel - journey into the unknown -->
<section id="travel-panel" class="panel hidden">
<button class="panel-close-x" data-close-overlay="travel-panel">×</button>
<div class="travel-header">
<h2>Travel & Exploration</h2>
<div class="travel-tabs">
<button class="travel-tab-btn" data-travel-tab="destination" title="View your current destination">🎯 Destination</button>
<button class="travel-tab-btn active" data-travel-tab="destinations" title="Browse all locations">📍 Locations</button>
<button class="travel-tab-btn" data-travel-tab="map" title="View the travel map">🗺️ Map</button>
<button class="travel-tab-btn" id="open-world-map-overlay-btn" title="Open fullscreen world map">⛶ Full Map</button>
<button class="travel-tab-btn" data-travel-tab="history" title="View your travel history">📜 History</button>
</div>
</div>
<div id="travel-content">
<!-- Destination Tab (Current Target) -->
<div id="destination-tab" class="travel-tab-content">
<div id="current-destination-display" class="destination-display">
<div class="no-destination">
<span class="no-dest-icon">🎯</span>
<h3>No Destination Set</h3>
<p>Click on a location in the Locations tab or Map to set a destination.</p>
</div>
</div>
<div id="destination-actions" class="destination-actions hidden">
<button id="clear-destination-btn" class="travel-btn-danger" title="Cancel your current destination">✕ Cancel Destination</button>
</div>
</div>
<!-- Destinations Tab -->
<div id="destinations-tab" class="travel-tab-content active">
<div class="travel-controls">
<div class="travel-filter">
<label for="destination-filter">Filter:</label>
<select id="destination-filter">
<option value="all">All Locations</option>
<option value="visited">🏆 Visited Only</option>
<option value="connected">Connected Only</option>
<option value="capital">👑 Capitals</option>
<option value="city">🏰 Cities</option>
<option value="town">🏘️ Towns</option>
<option value="village">🏠 Villages</option>
<option value="mine">⛏️ Mines</option>
<option value="forest">🌲 Forests</option>
<option value="port">⚓ Ports</option>
</select>
</div>
<div class="travel-sort">
<label for="destination-sort">Sort by:</label>
<select id="destination-sort">
<option value="distance">Distance</option>
<option value="name">Name</option>
<option value="type">Type</option>
</select>
</div>
<div class="travel-auto-time">
<label class="toggle-switch" title="Auto-start time when traveling, auto-stop on arrival">
<input type="checkbox" id="auto-travel-time-toggle" checked>
<span class="toggle-slider"></span>
<span class="toggle-label">⏱️ Auto Time</span>
</label>
</div>
</div>
<div id="destinations" class="destinations-list">
<!-- Destinations will be populated by JavaScript -->
</div>
</div>
<!-- Map Tab with Interactive Mini-Map -->
<div id="map-tab" class="travel-tab-content">
<!-- Interactive Mini-Map Container -->
<div id="travel-mini-map-container" class="travel-mini-map-container">
<div id="travel-mini-map" class="travel-mini-map"></div>
<div class="mini-map-controls">
<button onclick="TravelPanelMap.zoomIn()" title="Zoom in on the travel map">+</button>
<button onclick="TravelPanelMap.zoomOut()" title="Zoom out on the travel map">−</button>
<button onclick="TravelPanelMap.centerOnPlayer()" title="Center map on your location">📍</button>
<button onclick="TravelPanelMap.resetView()" title="Reset travel map view">⟲</button>
</div>
</div>
<!-- Map Legend (matches main world map) -->
<div class="travel-map-legend">
<h4>🗺️ Map Legend</h4>
<div class="legend-grid">
<div class="legend-item"><span class="legend-dot" style="background: #FFD700;"></span><span>👑 Capital</span></div>
<div class="legend-item"><span class="legend-dot" style="background: #FF6B6B;"></span><span>🏰 City</span></div>
<div class="legend-item"><span class="legend-dot" style="background: #4ECDC4;"></span><span>🏘️ Town</span></div>
<div class="legend-item"><span class="legend-dot" style="background: #95E77E;"></span><span>🏠 Village</span></div>
<div class="legend-item"><span class="legend-dot" style="background: #8B4513;"></span><span>⛏️ Mine</span></div>
<div class="legend-item"><span class="legend-dot" style="background: #228B22;"></span><span>🌲 Forest</span></div>
<div class="legend-item"><span class="legend-dot" style="background: #F4A460;"></span><span>🌾 Farm</span></div>
<div class="legend-item"><span class="legend-dot" style="background: #1E90FF;"></span><span>⚓ Port</span></div>
<div class="legend-item"><span class="legend-dot" style="background: #DAA520;"></span><span>🍺 Inn</span></div>
<div class="legend-item"><span class="legend-dot" style="background: #708090;"></span><span>🏛️ Ruins</span></div>
<div class="legend-item"><span class="legend-dot" style="background: #4B0082;"></span><span>💀 Dungeon</span></div>
<div class="legend-item"><span class="legend-dot" style="background: #CD853F;"></span><span>🛡️ Outpost</span></div>
</div>
<div class="legend-info">
<p>📍 <strong>You are here</strong> (pulsing marker)</p>
<p>🎯 <strong>Destination</strong> (if set)</p>
<p>Click a location to set as destination</p>
</div>
</div>
</div>
<!-- History Tab -->
<div id="history-tab" class="travel-tab-content">
<div class="history-controls">
<button id="clear-history-btn" title="Clear all travel history">🗑️ Clear History</button>
<button id="export-history-btn" title="Export travel history data">📤 Export</button>
</div>
<div id="travel-history" class="travel-history-list">
<!-- Travel history will be populated by JavaScript -->
</div>
</div>
</div>
<div class="panel-footer">
<button id="close-travel-btn" class="panel-close-btn-footer" data-close-overlay="travel-panel" title="Close the travel panel">Close</button>
</div>
</section>
<!-- 🐴 Transportation Panel - upgrade from walking sadly -->
<section id="transportation-panel" class="panel hidden">
<button class="panel-close-x" data-close-overlay="transportation-panel">×</button>
<h2>Transportation</h2>
<div class="transportation-info">
<p>Current Transport: <span id="current-transport">Backpack</span></p>
<p>Carry Capacity: <span id="carry-capacity">50 lbs</span></p>
<p>Current Load: <span id="current-load">0 lbs</span></p>
</div>
<h3>Available Transportation</h3>
<div id="transportation-options" class="items-grid">
<!-- Transportation options will be populated by JavaScript -->
</div>
<div class="panel-footer">
<button id="close-transportation-btn" class="panel-close-btn-footer" data-close-overlay="transportation-panel" title="Close the transportation panel">Close</button>
</div>
</section>
<!-- 🏰 Property & Employee Management - your medieval empire -->
<section id="property-employee-panel" class="panel hidden">
<button class="panel-close-x" data-close-overlay="property-employee-panel">×</button>
<div class="property-employee-header">
<h2>Property & Employee Management</h2>
<div class="financial-summary">
<span id="property-income">Property Income: 0 gold/day</span>
<span id="employee-costs">Employee Costs: 0 gold/week</span>
<span id="net-profit">Net Profit: 0 gold/day</span>
</div>
</div>
<div class="tabs">
<button class="tab-btn active" data-tab="properties" title="Manage your properties">Properties</button>
<button class="tab-btn" data-tab="employees" title="Manage your employees">Employees</button>
<button class="tab-btn" data-tab="trade-routes" title="View and manage trade routes">Trade Routes</button>
<button class="tab-btn" data-tab="financial" title="View financial information">Financial</button>
</div>
<div id="property-employee-content">
<!-- Properties Tab -->
<div id="properties-tab" class="tab-content active">
<div class="properties-controls">
<button id="buy-property-btn" title="Purchase a new property">Buy Property</button>
<button id="property-upgrades-btn" title="Manage property upgrades">Manage Upgrades</button>
<button id="repair-all-btn" title="Repair all damaged properties">Repair All</button>
</div>
<div id="owned-properties" class="properties-grid">
<!-- Owned properties will be populated by JavaScript -->
</div>