-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
1487 lines (1357 loc) · 101 KB
/
Copy pathindex.html
File metadata and controls
1487 lines (1357 loc) · 101 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>Core 2 PBQ Lab Simulator</title>
<style>
:root {
/* Semantic Color System: Dark Theme (Default) */
--bg-primary: #0d1117;
--bg-panel: #161b22;
--bg-panel-secondary: #1c2330;
--bg-terminal: #000;
--bg-overlay: rgba(0,0,0,.85);
--border-primary: #30363d;
--border-accent: #58a6ff;
--text-primary: #c9d1d9;
--text-secondary: #8b949e;
--text-heading: #ffffff;
--text-inverted: #ffffff;
--text-link: #58a6ff;
--accent-primary: #58a6ff;
--accent-good: #3fb950;
--accent-bad: #f85149;
--accent-warn: #d29922;
/* Component-Specific */
--btn-reset-bg: #8b2635;
--btn-reset-hover-bg: #a53040;
--msg-them-bg: #3d2a2a;
--msg-them-border: #5a3535;
--msg-you-bg: #22304a;
--msg-you-border: #2e4368;
--badge-pass-bg: #1d3d24;
--badge-pass-text: var(--accent-good);
--badge-pass-border: var(--accent-good);
--badge-fail-bg: #3d1d1d;
--badge-fail-text: var(--accent-bad);
--badge-fail-border: var(--accent-bad);
--textbook-bg: #101820;
--textbook-text: #a8b8c8;
--textbook-accent: var(--accent-primary);
--sidebar-active-bg: #1a2536;
/* Graph Colors */
--graph-zone-good: rgba(63, 185, 80, 0.08);
--graph-zone-warn: rgba(210, 153, 34, 0.08);
--graph-zone-fail: rgba(248, 81, 73, 0.08);
--graph-node-fill: var(--bg-primary);
}
body.light-theme {
/* Semantic Color System: Light Theme Overrides */
--bg-primary: #FFF5EB;
--bg-panel: #F9EBDD;
--bg-panel-secondary: #F2DFCC;
--bg-terminal: #1C1414;
--bg-overlay: rgba(255, 245, 235, 0.85);
--border-primary: #E6D0B8;
--border-accent: #D35400;
--text-primary: #5C0909;
--text-secondary: #7D4B4B;
--text-heading: #5C0909;
--text-inverted: #ffffff;
--text-link: #D35400;
--accent-primary: #D35400;
--accent-good: #2D6A4F;
--accent-bad: #A93226;
--accent-warn: #B7950B;
/* Component-Specific */
--btn-reset-bg: #7B241C;
--btn-reset-hover-bg: #922B21;
--msg-them-bg: #4A3737;
--msg-them-border: #5C4545;
--msg-you-bg: #2C3E50;
--msg-you-border: #34495E;
--badge-pass-bg: #D4EFDF;
--badge-pass-text: var(--accent-good);
--badge-pass-border: #A9DFBF;
--badge-fail-bg: #FADBD8;
--badge-fail-text: var(--accent-bad);
--badge-fail-border: #E6B0AA;
--textbook-bg: #4A3737; /* Dark chocolate brown */
--textbook-text: #F9EBDD; /* Off-white/yellow text */
--textbook-accent: #FFD580;
--sidebar-active-bg: #4A3737;
/* Graph Colors */
--graph-zone-good: rgba(45, 106, 79, 0.1);
--graph-zone-warn: rgba(183, 149, 11, 0.1);
--graph-zone-fail: rgba(169, 50, 38, 0.1);
--graph-node-fill: var(--bg-primary);
}
/* Global Scrollbar Hide & Reset */
::-webkit-scrollbar { display: none; }
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', Arial, sans-serif; scrollbar-width: none; -ms-overflow-style: none; }
html, body { height: 100%; overflow: hidden; }
body { background: var(--bg-primary); color: var(--text-primary); font-size: clamp(13px, 1.2vw, 14.5px); transition: background .3s ease, color .3s ease; }
#shake-wrap { display: flex; flex-direction: column; height: 100vh; }
button, select { transition: all .15s ease; }
button:active:not(:disabled), select:active:not(:disabled) { transform: scale(.95) translateY(1px); }
header { background: var(--bg-panel); border-bottom: 2px solid var(--border-primary); padding: 14px 24px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-shrink: 0; z-index: 50; }
header h1 { font-size: clamp(15px, 1.5vw, 17px); color: var(--text-heading); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
header h1 span { color: var(--accent-primary); }
#timer { font-family: monospace; font-size: clamp(14px, 1.2vw, 15px); color: var(--accent-warn); }
.hbtn { background: #238636; color: #fff; border: none; padding: 8px 18px; border-radius: 6px; font-weight: 700; cursor: pointer; font-size: clamp(13px, 1.2vw, 14.5px); }
.hbtn:hover { background: #2ea043; }
#resetExam { display: none; background: var(--btn-reset-bg); }
#resetExam:hover { background: var(--btn-reset-hover-bg); }
#sideToggle { background: var(--bg-panel-secondary); border: 1px solid var(--border-primary); color: var(--text-primary); width: 38px; height: 38px; border-radius: 6px; cursor: pointer; font-size: 16px; flex-shrink: 0; }
#sideToggle:hover { border-color: var(--accent-primary); color: var(--accent-primary); }
#layout { display: flex; flex: 1; min-height: 0; }
/* Sidebar Navigation Rail */
aside { width: 230px; background: var(--bg-panel); border-right: 1px solid var(--border-primary); display: flex; flex-direction: column; transition: width .25s ease; flex-shrink: 0; overflow: hidden; }
aside.collapsed { width: 65px; }
aside nav { display: flex; flex-direction: column; flex: 1; padding: 0; gap: 0; overflow-y: auto; max-height: 650px; align-items: stretch; justify-content: flex-start; }
aside nav button { flex: 0 0 65px; background: transparent; border: none; border-bottom: 1px solid var(--border-primary); color: var(--text-primary); border-radius: 0; cursor: pointer; font-size: clamp(12px, 1vw, 14px); display: flex; align-items: center; padding: 0 14px; text-align: left; white-space: normal; overflow: hidden; transition: background .15s ease, color .15s ease; }
aside nav button:active:not(:disabled) { transform: none; }
aside nav button:hover { background: rgba(125,125,125,0.08); }
aside nav button.active { color: var(--accent-primary); background: var(--sidebar-active-bg); font-weight: 700; box-shadow: inset 4px 0 0 var(--accent-primary); }
body.light-theme aside nav button.active { color: var(--text-inverted); }
aside nav button .lnum { display: none; font-size: 17px; font-weight: 700; }
aside nav button .lname { line-height: 1.25; }
/* Collapsed Sidebar State */
aside.collapsed nav button { justify-content: center; padding: 0; }
aside.collapsed nav button .lnum { display: block; text-align: center; }
aside.collapsed nav button .lname { display: none; }
/* Main Layout Fluidity */
main { padding: clamp(12px, 1.5vh, 18px) clamp(16px, 2vw, 22px); flex: 1; overflow: hidden; min-width: 0; display: flex; flex-direction: column; }
.inner { max-width: 1050px; margin: 0 auto; width: 100%; flex: 1; display: flex; flex-direction: column; min-height: 0; }
.lab { display: none; }
.lab.active { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.vwrap { display: flex; flex-direction: column; flex: 1; min-height: 0; }
/* Uniform Variant Buttons */
.variant-toggle { display: flex; gap: 8px; margin-bottom: 10px; flex-shrink: 0; align-items: center; }
.v-btn { width: 135px; background: var(--bg-panel-secondary); border: 2px solid var(--border-primary); color: var(--text-primary); padding: 7px 15px; border-radius: 6px; cursor: pointer; font-size: clamp(12px, 1vw, 13px); font-weight: 600; text-align: center; transition: all .15s ease; }
.v-btn.on { border-color: var(--accent-primary); color: var(--accent-primary); font-weight: 700; }
.v-btn:disabled { opacity: .35; cursor: not-allowed; text-decoration: line-through; }
.v-btn.v-pass { border-color: var(--accent-good); color: var(--accent-good); background: rgba(63,185,80,0.12); }
.v-btn.v-pass.on { background: rgba(63,185,80,0.25); font-weight: 800; }
.v-btn.v-attempt { border-color: var(--accent-warn); color: var(--accent-warn); background: rgba(210,153,34,0.12); }
.v-btn.v-attempt.on { background: rgba(210,153,34,0.25); font-weight: 800; }
.vlock-note { font-size: clamp(11px, 0.9vw, 11.5px); color: var(--text-secondary); font-style: italic; }
/* Card Padding Reduction & Flex Optimization */
.card { background: var(--bg-panel); border: 1px solid var(--border-primary); border-radius: 8px; padding: clamp(12px, 1.5vh, 16px) clamp(14px, 1.5vw, 18px); margin-bottom: clamp(8px, 1vh, 12px); }
.card:last-child { margin-bottom: 0; }
.card.compact { padding: clamp(10px, 1.2vh, 14px) clamp(12px, 1.2vw, 16px); margin-bottom: clamp(6px, 1vh, 10px); }
.flex-card { display: flex; flex-direction: column; flex: 0 1 auto; min-height: 0; }
.card h2 { font-size: clamp(14px, 1.3vw, 16px); color: var(--text-heading); margin-bottom: 6px; text-align: left; }
.card h3 { font-size: clamp(13px, 1.2vw, 14.5px); color: var(--accent-primary); margin: 10px 0 4px; }
.scenario { font-size: clamp(13px, 1.2vw, 14.5px); line-height: 1.5; color: #adbac7; }
body.light-theme .scenario { color: var(--text-secondary); }
.card.compact .scenario { font-size: clamp(12px, 1vw, 13px); line-height: 1.4; }
.terminal { background: var(--bg-terminal); border: 1px solid var(--border-primary); border-radius: 6px; padding: 10px; font-family: 'Consolas', monospace; font-size: clamp(12px, 1vw, 13.5px); margin-bottom: 8px; white-space: pre-wrap; color: #ccc; overflow-y: auto; overflow-x: hidden; max-height: 350px; scrollbar-width: none; }
.terminal::-webkit-scrollbar { display: none; }
body.light-theme .terminal { color: #D5C4B0; }
.terminal .err { color: var(--accent-bad); }
.terminal .ok { color: var(--accent-good); }
.term-input { display: flex; gap: 6px; }
.term-input span { font-family: monospace; color: var(--accent-good); padding-top: 8px; }
.term-input input { flex: 1; background: var(--bg-terminal); border: 1px solid var(--border-primary); color: var(--text-inverted); font-family: monospace; padding: 8px; border-radius: 4px; font-size: clamp(12px, 1vw, 13.5px); }
select, input[type=text] { background: var(--bg-panel-secondary); border: 1px solid var(--border-primary); color: var(--text-primary); padding: 6px 8px; border-radius: 5px; font-size: clamp(12px, 1vw, 14px); }
input[type=text] { min-width: 220px; }
select { transition: width .2s ease, all .15s ease; }
#measure { position: absolute; visibility: hidden; white-space: nowrap; font-size: clamp(12px, 1vw, 14px); font-family: 'Segoe UI', Arial, sans-serif; top: -100px; }
label { display: block; font-size: clamp(12px, 1vw, 13.5px); margin: 6px 0 2px; color: var(--text-secondary); }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 16px; }
.field-grid label { margin: 4px 0 2px; }
.chat-card { display: flex; flex-direction: column; flex: 0 1 auto; min-height: 0; background: var(--bg-panel); border: 1px solid var(--border-primary); border-radius: 8px; padding: clamp(12px, 1.5vh, 16px) clamp(14px, 1.5vw, 18px); }
.chat-card h2 { font-size: clamp(14px, 1.3vw, 16px); color: var(--text-heading); margin-bottom: 6px; flex-shrink: 0; }
.chat-card .scenario { flex-shrink: 0; }
.chat-window { background: var(--bg-panel-secondary); border: 1px solid var(--border-primary); border-radius: 6px; padding: 12px; flex: 1; min-height: 0; max-height: 350px; overflow-y: auto; margin: 10px 0; display: flex; flex-direction: column; scrollbar-width: none; }
.chat-window::-webkit-scrollbar { display: none; }
.chat-window .spacer { flex: 1; }
.msg { padding: 8px 12px; border-radius: 8px; margin-bottom: 8px; font-size: clamp(12px, 1vw, 14px); max-width: 85%; line-height: 1.5; flex-shrink: 0; color: var(--text-inverted); }
.msg.them { background: var(--msg-them-bg); border: 1px solid var(--msg-them-border); align-self: flex-start; }
.msg.you { background: var(--msg-you-bg); border: 1px solid var(--msg-you-border); align-self: flex-end; text-align: right; }
.choices { flex-shrink: 0; }
.choices button { display: block; width: 100%; text-align: left; background: var(--bg-panel-secondary); border: 1px solid var(--border-primary); color: var(--text-primary); padding: 10px; border-radius: 6px; margin-bottom: 6px; cursor: pointer; font-size: clamp(12px, 1vw, 14px); }
.choices button:hover { border-color: var(--accent-primary); }
.choices button:disabled { opacity: .45; cursor: not-allowed; }
.choices button:last-child { margin-bottom: 0; }
.step-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.step-row .num { width: 26px; height: 26px; border-radius: 50%; background: var(--bg-panel-secondary); border: 1px solid var(--border-primary); display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 700; }
.badge.fail { background: var(--badge-fail-bg); color: var(--badge-fail-text); border: 1px solid var(--badge-fail-border); }
.badge.pass { background: var(--badge-pass-bg); color: var(--badge-pass-text); border: 1px solid var(--badge-pass-border); }
table { width: 100%; border-collapse: collapse; font-size: clamp(12px, 1vw, 14px); }
th, td { border: 1px solid var(--border-primary); padding: 6px 8px; text-align: left; }
th { background: var(--bg-panel-secondary); color: var(--accent-primary); }
.overlay { display: none; position: fixed; inset: 0; background: var(--bg-overlay); z-index: 1500; overflow-y: auto; padding: 30px; }
.overlay.open { display: block; }
@keyframes dropIn {
0% { opacity: 0; transform: translateY(-46px) scale(.96); }
60% { opacity: 1; transform: translateY(8px) scale(1.005); }
80% { transform: translateY(-3px) scale(1); }
100% { opacity: 1; transform: translateY(0) scale(1); }
}
.overlay.open .report, .overlay.open .confirm-box { animation: dropIn .45s cubic-bezier(.22,1.1,.36,1) both; }
.report { background: var(--bg-panel); border: 1px solid var(--border-primary); border-radius: 10px; max-width: 860px; margin: 0 auto; padding: 28px; position: relative; }
.report h2 { color: var(--text-heading); text-align: center; font-size: 20px; margin-bottom: 4px; }
.report .sub { text-align: center; color: var(--text-secondary); font-size: 12px; margin-bottom: 20px; }
#xClose { position: absolute; top: 14px; right: 14px; background: var(--bg-panel-secondary); border: 1px solid var(--border-primary); color: var(--text-primary); width: 34px; height: 34px; border-radius: 6px; cursor: pointer; font-size: 16px; font-weight: 700; line-height: 1; }
#xClose:hover { border-color: var(--accent-bad); color: var(--accent-bad); }
.score-big { text-align: center; font-size: 56px; font-weight: 800; margin: 10px 0; }
.score-big.pass { color: var(--accent-good); }
.score-big.fail { color: var(--accent-bad); }
.verdict { text-align: center; font-size: 16px; font-weight: 700; margin-bottom: 22px; letter-spacing: 2px; }
.lab-report { border: 1px solid var(--border-primary); border-radius: 8px; padding: 14px; margin-bottom: 12px; background: var(--bg-panel-secondary); }
.lab-report h4 { font-size: 13.5px; color: var(--text-heading); margin-bottom: 6px; display: flex; justify-content: space-between; align-items: center; }
.lab-report ul { margin: 8px 0 8px 4px; font-size: 12.5px; line-height: 1.7; list-style: none; }
.lab-report li { display: flex; align-items: flex-start; }
.lab-report li.ok { color: #9fd7a8; }
body.light-theme .lab-report li.ok { color: var(--accent-good); }
.lab-report li.no { color: #e8938e; }
body.light-theme .lab-report li.no { color: var(--accent-bad); }
.lab-report li .mark { flex: 0 0 24px; display: flex; justify-content: center; align-items: center; margin-top: 3px; }
.textbook { background: var(--textbook-bg); border-left: 3px solid var(--accent-primary); padding: 10px 12px; font-size: 12.5px; line-height: 1.65; color: var(--textbook-text); margin-top: 8px; border-radius: 0 6px 6px 0; }
.textbook b { color: var(--textbook-accent); }
#closeModal { display: block; margin: 18px auto 0; background: var(--bg-panel-secondary); border: 1px solid var(--border-primary); color: var(--text-primary); padding: 10px 24px; border-radius: 6px; cursor: pointer; }
#closeModal:hover { border-color: var(--accent-primary); }
.note { font-size: clamp(11px, 0.9vw, 12px); color: var(--text-secondary); margin-top: 6px; }
.drop-grid { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; align-items: center; max-width: 520px; }
.drop-grid .dev { background: var(--bg-panel-secondary); border: 1px solid var(--border-primary); padding: 6px 10px; border-radius: 6px; font-size: clamp(12px, 1vw, 13px); }
.drop-grid select { padding: 6px 8px; font-size: clamp(12px, 1vw, 13px); }
footer { background: var(--bg-panel); border-top: 1px solid var(--border-primary); padding: 12px 24px; text-align: center; font-size: 12px; color: var(--text-secondary); font-family: monospace; flex-shrink: 0; }
footer a { color: var(--text-link); }
.confirm-box { background: var(--bg-panel); border: 1px solid var(--border-primary); border-radius: 10px; max-width: 420px; margin: 18vh auto 0; padding: 26px; text-align: center; }
.confirm-box h3 { color: var(--text-heading); font-size: 16px; margin-bottom: 10px; }
.confirm-box p { font-size: 13px; color: #adbac7; line-height: 1.6; margin-bottom: 20px; }
body.light-theme .confirm-box p { color: var(--text-secondary); }
.confirm-actions { display: flex; gap: 10px; justify-content: center; }
.confirm-actions button { padding: 9px 22px; border-radius: 6px; font-weight: 700; font-size: 13px; cursor: pointer; border: 1px solid var(--border-primary); }
#confirmCancel { background: var(--bg-panel-secondary); color: var(--text-primary); }
#confirmCancel:hover { border-color: var(--accent-primary); }
#confirmReset { background: var(--btn-reset-bg); color: #fff; border-color: var(--btn-reset-bg); }
#confirmReset:hover { background: var(--btn-reset-hover-bg); }
@keyframes jiggle {
0% { transform: translateX(0); } 8% { transform: translateX(-8px) rotate(-.2deg); } 20% { transform: translateX(7px) rotate(.2deg); } 32% { transform: translateX(-6px) rotate(-.15deg); } 44% { transform: translateX(5px) rotate(.15deg); } 56% { transform: translateX(-4px) rotate(-.1deg); } 68% { transform: translateX(3px) rotate(.1deg); } 80% { transform: translateX(-2px); } 90% { transform: translateX(1px); } 100% { transform: translateX(0); }
}
.animate-jiggle { animation: jiggle .6s cubic-bezier(.36,.07,.19,.97) both; }
.blur-bg { filter: blur(6px) grayscale(80%); pointer-events: none; user-select: none; overflow: hidden; }
#legalOverlay { display: flex; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.92); z-index: 9999; align-items: center; justify-content: center; padding: 20px; }
.legal-box { background: var(--bg-panel); border: 2px solid var(--accent-bad); border-radius: 10px; max-width: 650px; padding: 32px; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,0.8); }
.legal-box h2 { color: var(--accent-bad); margin-bottom: 15px; font-size: 22px; }
.legal-box p { color: #adbac7; margin-bottom: 15px; line-height: 1.6; font-size: 14.5px; }
/* Dashboard SVG Wrapper */
.graph-wrap { background: var(--bg-panel-secondary); border: 1px solid var(--border-primary); border-radius: 8px; padding: 16px; margin-bottom: 20px; overflow: hidden; }
.graph-wrap h3 { color: var(--text-heading); }
/* FAB Styling */
#settingsFab { position: fixed; bottom: 80px; right: 20px; width: 50px; height: 50px; border-radius: 50%; background: var(--accent-primary); color: #fff; border: none; cursor: pointer; z-index: 1000; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(0,0,0,0.3); transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1); }
#settingsFab svg { width: 26px; height: 26px; transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1); }
#settingsFab.active svg { transform: rotate(360deg); }
#settingsFab:active { transform: scale(.95) translateY(1px); }
/* Settings Modal Styling */
.settings-card { background: var(--bg-panel); border: 1px solid var(--border-primary); border-radius: 12px; width: 320px; margin: 25vh auto; padding: 24px; box-shadow: 0 20px 40px rgba(0,0,0,0.4); transform: scale(0); transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }
.overlay.open .settings-card { transform: scale(1); }
.settings-card h3 { margin-bottom: 20px; color: var(--accent-primary); font-size: 18px; }
.setting-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--border-primary); }
.setting-info { display: flex; flex-direction: column; }
.setting-label { font-weight: 700; font-size: 14px; color: var(--text-primary); }
.setting-desc { font-size: 11px; color: var(--text-secondary); }
/* Toggle Switch UI */
.switch { position: relative; display: inline-block; width: 44px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; inset: 0; background-color: var(--bg-panel-secondary); border: 1px solid var(--border-primary); transition: .3s; border-radius: 22px; }
.slider:before { position: absolute; content: ""; height: 14px; width: 14px; left: 3px; bottom: 3px; background-color: var(--text-primary); transition: .3s; border-radius: 50%; }
input:checked + .slider { background-color: var(--accent-primary); border-color: var(--accent-primary); }
input:checked + .slider:before { transform: translateX(22px); background-color: #fff; }
@media (max-width: 768px) {
.vwrap {
overflow-y: auto !important;
}
}
@media (max-width: 576px) {
header {
padding: 8px 12px !important;
}
main {
padding: 8px 10px !important;
}
.card {
padding: 10px 12px !important;
margin-bottom: 8px !important;
}
.card h2 {
font-size: 14px !important;
}
.scenario {
font-size: 12px !important;
line-height: 1.35 !important;
}
#settingsFab {
width: 42px !important;
height: 42px !important;
bottom: 72px !important;
right: 12px !important;
}
.terminal {
max-height: 140px !important;
}
.term-input {
display: grid !important;
grid-template-columns: auto 1fr !important;
gap: 6px !important;
width: 100% !important;
}
.term-input span {
grid-column: 1 !important;
grid-row: 1 !important;
white-space: nowrap !important;
align-self: center !important;
font-size: 13px !important;
padding-top: 0 !important;
}
.term-input select {
width: 100% !important;
min-width: 0 !important;
margin: 0 !important;
}
.term-input select:nth-of-type(1) {
grid-column: 2 !important;
grid-row: 1 !important;
}
.term-input select:nth-of-type(2) {
grid-column: 1 / -1 !important;
grid-row: 2 !important;
}
.term-input select:nth-of-type(3) {
grid-column: 1 / -1 !important;
grid-row: 3 !important;
}
.term-input button {
grid-column: 1 / -1 !important;
grid-row: 4 !important;
width: 100% !important;
padding: 8px !important;
margin-top: 4px !important;
}
}
@media (max-width: 500px) {
/* 1. Hidden Content Restoration & Natural Scrolling Flow (Waiver modal closed) */
#shake-wrap:not(.blur-bg) {
height: auto !important;
min-height: 100vh !important;
overflow-y: auto !important;
}
#shake-wrap:not(.blur-bg) #layout {
flex-direction: column !important;
height: auto !important;
overflow: visible !important;
}
/* Transform Sidebar into Compact Lab Grid Nav */
#shake-wrap:not(.blur-bg) aside {
width: 100% !important;
height: auto !important;
border-right: none !important;
border-bottom: 1px solid var(--border-primary) !important;
}
#shake-wrap:not(.blur-bg) aside.collapsed {
width: 100% !important;
}
#shake-wrap:not(.blur-bg) aside nav {
flex-direction: row !important;
flex-wrap: wrap !important;
}
#shake-wrap:not(.blur-bg) aside nav button {
flex: 1 0 22% !important;
justify-content: center !important;
padding: 10px 4px !important;
border-bottom: 1px solid var(--border-primary) !important;
border-right: 1px solid var(--border-primary) !important;
font-size: 11px !important;
min-height: 44px !important;
}
#shake-wrap:not(.blur-bg) aside nav button .lnum {
display: block !important;
}
#shake-wrap:not(.blur-bg) aside nav button .lname {
display: none !important;
}
/* Expand Content Wrappers */
#shake-wrap:not(.blur-bg) main {
overflow: visible !important;
height: auto !important;
flex: none !important;
}
#shake-wrap:not(.blur-bg) .inner {
height: auto !important;
overflow: visible !important;
flex: none !important;
}
#shake-wrap:not(.blur-bg) .lab.active {
display: flex !important;
flex-direction: column !important;
height: auto !important;
overflow: visible !important;
flex: none !important;
}
#shake-wrap:not(.blur-bg) .vwrap {
height: auto !important;
overflow: visible !important;
flex: none !important;
}
#shake-wrap:not(.blur-bg) .flex-card,
#shake-wrap:not(.blur-bg) .steps-container {
height: auto !important;
max-height: none !important;
overflow: visible !important;
flex: none !important;
min-height: auto !important;
}
/* Retain Scrollability inside Interactive Chat Elements */
#shake-wrap:not(.blur-bg) .chat-card {
display: flex !important;
flex-direction: column !important;
height: 480px !important;
}
#shake-wrap:not(.blur-bg) .chat-window {
flex: 1 !important;
overflow-y: auto !important;
min-height: 250px !important;
}
/* 2. Header Layout Optimization & Clock Realignment */
#shake-wrap:not(.blur-bg) header {
display: flex !important;
flex-wrap: wrap !important;
gap: 8px !important;
}
#shake-wrap:not(.blur-bg) header h1 {
flex: 1 1 auto !important;
min-width: 0 !important;
}
#shake-wrap:not(.blur-bg) #timer {
order: 3 !important;
margin-left: auto !important;
}
#shake-wrap:not(.blur-bg) #resetExam {
order: 4 !important;
}
#shake-wrap:not(.blur-bg) #submitExam {
order: 5 !important;
}
/* 3. Floating Action Button Safe Margins */
#shake-wrap:not(.blur-bg) footer {
padding: 16px 80px !important;
}
}
</style>
</head>
<body>
<!-- LEGAL WARNING MODAL -->
<div id="legalOverlay">
<div class="legal-box">
<h2>CRITICAL COMPLIANCE MANDATE & LIABILITY WAIVER</h2>
<p>This software is an independent UI/UX framework. It is intended solely for personal educational testing, design evaluation, and front-end development practice.</p>
<p style="margin-bottom: 25px;">Loading proprietary, copyrighted, or commercial exam materials into this framework is explicitly prohibited. The developer disclaims all liability for unauthorized content deployment, intellectual property violations, or resulting damages.</p>
<button id="acceptLegalBtn" class="hbtn" style="font-size: 16px; padding: 12px 30px;">I Accept - Start Exam</button>
</div>
</div>
<span id="measure"></span>
<div id="shake-wrap" class="blur-bg">
<header>
<button id="sideToggle" onclick="toggleSidebar()" title="Toggle Lab Sidebar">☰</button>
<h1>Exam Lab Terminal — <span>Core 2 PBQ Lab Simulator</span></h1>
<div id="timer">90:00</div>
<button id="resetExam" class="hbtn" onclick="askReset()">Reset Test</button>
<button id="submitExam" class="hbtn" onclick="submitOrView()">Submit Entire Exam</button>
</header>
<div id="layout">
<aside id="sidebar"><nav id="tabs"></nav></aside>
<main><div class="inner" id="labs"></div></main>
</div>
<footer>
© 2026 jibbles. All Rights Reserved // Prepared for personal testing purposes only // Built with claude-fable-5, gemini-3.1-pro & gemini-3.1-pro-preview<br>
<a href="https://github.com/vosdyh/ITcore2sim/blob/main/LICENSE" target="_blank" style="text-decoration: none; margin-top: 6px; display: inline-block;">Licensed under MIT</a>
</footer>
<!-- Settings FAB -->
<button id="settingsFab" onclick="toggleSettingsModal()" title="Personalization Settings">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<circle cx="12" cy="12" r="3"></circle>
<path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path>
</svg>
</button>
<!-- Settings Modal -->
<div id="settingsOverlay" class="overlay" onclick="if(event.target===this)toggleSettingsModal()">
<div class="settings-card">
<h3>Interface Configuration</h3>
<div class="setting-row">
<div class="setting-info">
<span class="setting-label">Light Mode</span>
<span class="setting-desc">Eye-comfort sepia theme</span>
</div>
<label class="switch">
<input type="checkbox" id="themeToggle" onchange="updateTheme(this.checked)">
<span class="slider"></span>
</label>
</div>
<button class="hbtn" style="width:100%; margin-top:10px;" onclick="toggleSettingsModal()">Close Settings</button>
</div>
</div>
<div id="modal" class="overlay" onclick="if(event.target===this)closeReport()"><div class="report" id="reportBody"></div></div>
<div id="resetModal" class="overlay" onclick="if(event.target===this)closeResetModal()">
<div class="confirm-box">
<h3>Reset Entire Exam?</h3>
<p>All answers, terminal history, chat responses, and the score report will be permanently wiped and the timer restored to 90:00.</p>
<div class="confirm-actions">
<button id="confirmCancel" onclick="closeResetModal()">Cancel</button>
<button id="confirmReset" onclick="doReset()">Yes, Reset Test</button>
</div>
</div>
</div>
<script>
(function initSettings() {
// Immediate execution to prevent theme flash
const useLightTheme = localStorage.getItem('pbq_theme') === 'light';
if (useLightTheme) document.body.classList.add('light-theme');
// Sync toggles and sidebar once DOM is ready
window.addEventListener('DOMContentLoaded', () => {
document.getElementById('themeToggle').checked = useLightTheme;
const sidebar = document.getElementById('sidebar');
if (sidebar) {
if (window.innerWidth <= 768) {
sidebar.classList.add('collapsed');
} else {
const savedCollapsed = localStorage.getItem('pbq_sidebar_collapsed');
if (savedCollapsed === 'true') {
sidebar.classList.add('collapsed');
} else if (savedCollapsed === 'false') {
sidebar.classList.remove('collapsed');
}
}
}
});
})();
function toggleSettingsModal() {
const overlay = document.getElementById('settingsOverlay');
const fab = document.getElementById('settingsFab');
const isOpen = overlay.classList.contains('open');
if (!isOpen) {
overlay.classList.add('open');
fab.classList.add('active');
} else {
overlay.classList.remove('open');
// Reset rotation for next click
setTimeout(() => fab.classList.remove('active'), 500);
}
}
function updateTheme(isLight) {
if (isLight) {
document.body.classList.add('light-theme');
localStorage.setItem('pbq_theme', 'light');
} else {
document.body.classList.remove('light-theme');
localStorage.setItem('pbq_theme', 'dark');
}
}
// --- HISTORY & PERSISTENCE MANAGER ---
function loadHistory() {
try {
let hist = localStorage.getItem('pbq_sim_history');
if (hist) return JSON.parse(hist);
} catch(e) { console.warn("LocalStorage unavailable."); }
return { attempts: [], variants: {} };
}
function saveHistory(data) {
try { localStorage.setItem('pbq_sim_history', JSON.stringify(data)); }
catch(e) {}
}
function applyVariantHistory() {
let hist = loadHistory();
LABS.forEach(l => {
let labHist = hist.variants[l.id] || {};
['A', 'B'].forEach(v => {
let btn = document.getElementById('vt' + l.id + v);
if (!btn) return;
let score = labHist[v];
if (score === 100) {
btn.innerHTML = `Variant ${v} ✔`;
btn.classList.add('v-pass');
} else if (score !== undefined) {
btn.innerHTML = `Variant ${v} ➖`;
btn.classList.add('v-attempt');
}
});
});
}
// --- BACKEND DATA MODEL ---
const STATE = {
locked:false,
variant:{1:'A',2:'A',3:'A',4:'A',5:'A',6:'A',7:'A',8:'A',9:'A',10:'A'},
vlocked:{1:false,2:false,3:false,4:false,5:false,6:false,7:false,8:false,9:false,10:false},
term:{'1A':[],'1B':[],'1A_fail':false,'1B_fail':false,'10B':[],'10B_fail':false},
chatLog:{'4A':[],'4B':[]},
chatStep:{'4A':0,'4B':0},
apply9A:false,
apply9B:false,
dyn:{2:{},3:{},5:{},6:{},7:{},8:{},9:{macs:[],mode:'',targetMac:''},10:{phish:'',cli:'',phishOpts:[],remOpts:[],eduOpts:[]}}
};
// --- LAB RANDOMIZATION LOGIC ---
function genMac(){ return "XX:XX:XX:XX:XX:XX".replace(/X/g, function() { return "0123456789ABCDEF".charAt(Math.floor(Math.random() * 16)); }); }
function shuffle(array) {
let currentIndex = array.length, randomIndex;
while (currentIndex > 0) {
randomIndex = Math.floor(Math.random() * currentIndex);
currentIndex--;
[array[currentIndex], array[randomIndex]] = [array[randomIndex], array[currentIndex]];
}
return array;
}
const CHAT={'4A':{intro:[{who:'them',t:"THIS IS UNACCEPTABLE. I am the VP of Global Sales and I am LOCKED OUT before a board call in 10 minutes. Bypass this lock NOW or I'm calling your director."}],steps:[{them:"Well?? I don't have time for scripts. UNLOCK IT.",choices:[{t:'"Sir, you need to calm down before I can assist you."',ok:false},{t:'"I understand how critical this is for you."',ok:true},{t:'"Okay, given your position I\'ll bypass the lock immediately."',ok:false}]},{them:"Fine. So you're fixing it right now, yes?",choices:[{t:'"I can certainly help you get this resolved right away."',ok:true},{t:'"Policy is policy — there is nothing I can do quickly."',ok:false},{t:'"I\'ve already unlocked it, no verification needed for executives."',ok:false}]},{them:"Great. Just unlock it. What else do you possibly need?",choices:[{t:'"Nothing else — you\'re unlocked. Have a great board call!"',ok:false},{t:'"For security purposes, could you please verify your Employee ID or PIN?"',ok:true},{t:'"Can you email me from your personal Gmail to confirm identity?"',ok:false}]}]},'4B':{intro:[{who:'them',t:"Hi — I'm locked out of the finance database and I need an administrative override immediately. My chat name checks out, just push the reset through."}],steps:[{them:"Come on, you can see my profile name right there. Just reset it.",choices:[{t:'"Your chat profile is sufficient — resetting the password now."',ok:false},{t:'"I\'m unable to perform an immediate override, but I can absolutely help you through the secure process."',ok:true},{t:'"Overrides aren\'t my department. Goodbye."',ok:false}]},{them:"Ugh. Fine. Call me at 555-0199, that's my cell, and verify me there.",choices:[{t:'"Sure, calling the number you just gave me now."',ok:false},{t:'"I\'ll initiate a callback to your registered desk phone listed in the internal directory."',ok:true},{t:'"No calls needed — just tell me your mother\'s maiden name here in chat."',ok:false}]},{them:"Okay okay. What else do you need to grant the database access?",choices:[{t:'"Nothing — access granted after the callback."',ok:false},{t:'"Sensitive database access requires manager approval in the ticketing system plus MFA token verification."',ok:true},{t:'"I\'ll grant temporary admin rights to skip the paperwork."',ok:false}]}]}};
function initDynamic(){
// Extract and shuffle options for Lab 2
const gpoOptsA_raw = ['Open Local Security Policy (secpol.msc)','Execute gpresult /r','Execute gpupdate /force','Reboot machine immediately','Instruct user to Log Off and Log Back In','Edit registry HKLM policy keys manually'];
STATE.dyn[2].A = [{val:'0', t:'-- Select Action --'}].concat(shuffle(gpoOptsA_raw.map((t, i) => ({val: String(i+1), t}))));
const gpoOptsB_raw = ['Execute ipconfig /release','Execute ipconfig /flushdns','Execute ipconfig /registerdns','Execute gpupdate /force','Edit registry HKLM policy keys manually','Assume GPO is broken; rebuild GPO from scratch'];
STATE.dyn[2].B = [{val:'0', t:'-- Select Action --'}].concat(shuffle(gpoOptsB_raw.map((t, i) => ({val: String(i+1), t}))));
// Extract and shuffle options for Lab 3
const d3A1_raw = ['Notepad (.txt configuration)', 'Windows System Image Manager (WSIM)', 'Registry Editor (regedit)'];
STATE.dyn[3].A1 = [{val:'0', t:'-- Select --'}].concat(shuffle(d3A1_raw.map((t, i) => ({val: String(i+1), t}))));
const d3A2_raw = ['unattend.ini', 'deploy.txt', 'unattend.xml'];
STATE.dyn[3].A2 = [{val:'0', t:'-- Select --'}].concat(shuffle(d3A2_raw.map((t, i) => ({val: String(i+1), t}))));
const d3A3_raw = ['sysprep.exe /generalize /oobe /unattend:unattend.xml', 'sysprep.exe /audit /reboot', 'dism /online /cleanup-image /restorehealth'];
STATE.dyn[3].A3 = [{val:'0', t:'-- Select --'}].concat(shuffle(d3A3_raw.map((t, i) => ({val: String(i+1), t}))));
const d3B1_raw = ['msiexec /i package.msi /qn /norestart', 'msiexec /i package.msi /interactive /forcerestart', 'package.msi /silent /rebootnow'];
STATE.dyn[3].B1 = [{val:'0', t:'-- Select --'}].concat(shuffle(d3B1_raw.map((t, i) => ({val: String(i+1), t}))));
const d3B2_raw = ['setup.exe /verbose /promptall', 'setup.exe /S /v"/qn"', 'setup.exe /uninstall /f'];
STATE.dyn[3].B2 = [{val:'0', t:'-- Select --'}].concat(shuffle(d3B2_raw.map((t, i) => ({val: String(i+1), t}))));
const d3B3_raw = ['/forcerestart', '/qb', '/norestart'];
STATE.dyn[3].B3 = [{val:'0', t:'-- Select --'}].concat(shuffle(d3B3_raw.map((t, i) => ({val: String(i+1), t}))));
// Lab 4 Chat Randomization
CHAT['4A'].steps.forEach(step => {
shuffle(step.choices);
});
CHAT['4B'].steps.forEach(step => {
shuffle(step.choices);
});
// Lab 5
const t5Aopts_raw = ['Reboot the machine to clear the lock screen','IMMEDIATELY disconnect machine from network (Unplug Ethernet / Disable NIC)','Run a full Antivirus scan while connected to the network','Leave the machine powered ON to preserve RAM state','Escalate the ticket to the Security/IR department','Pay the ransom from petty cash'];
STATE.dyn[5].A = [{val:'0', t:'-- Select Action --'}].concat(shuffle(t5Aopts_raw.map((t, i) => ({val: String(i+1), t}))));
const t5Bopts_raw = ['Run malware scans in normal boot mode immediately','Disconnect from the network (Quarantine)','Disable System Restore','Reboot the machine into Safe Mode','Update anti-malware signatures (isolated) and run a full system scan','Re-enable System Restore and create a clean restore point'];
STATE.dyn[5].B = [{val:'0', t:'-- Select Action --'}].concat(shuffle(t5Bopts_raw.map((t, i) => ({val: String(i+1), t}))));
// Lab 6
const d6A1_raw = ['Change router global channel to 11', 'Forget the saturated 2.4GHz SSID', 'Toggle Airplane Mode repeatedly'];
STATE.dyn[6].A1 = [{val:'0', t:'-- Select --'}].concat(shuffle(d6A1_raw.map((t, i) => ({val: String(i+1), t}))));
const d6A2_raw = ['Corporate 5GHz SSID (802.11ac/ax)', 'Same 2.4GHz SSID with static IP', 'Open guest hotspot'];
STATE.dyn[6].A2 = [{val:'0', t:'-- Select --'}].concat(shuffle(d6A2_raw.map((t, i) => ({val: String(i+1), t}))));
const d6A3_raw = ['WEP', 'WPA2/WPA3-Enterprise', 'WPA2-Personal (pre-shared key)'];
STATE.dyn[6].A3 = [{val:'0', t:'-- Select --'}].concat(shuffle(d6A3_raw.map((t, i) => ({val: String(i+1), t}))));
const d6A4_raw = ['Pre-shared key taped to the breakroom wall', 'MAC address exemption only', 'Domain credentials via 802.1X / RADIUS server authentication'];
STATE.dyn[6].A4 = [{val:'0', t:'-- Select --'}].concat(shuffle(d6A4_raw.map((t, i) => ({val: String(i+1), t}))));
const d6B1_raw = ['143', '993', '80'];
STATE.dyn[6].B1 = [{val:'0', t:'-- Select --'}].concat(shuffle(d6B1_raw.map((t, i) => ({val: String(i+1), t}))));
const d6B2_raw = ['None', 'SSL/TLS', 'ROT13'];
STATE.dyn[6].B2 = [{val:'0', t:'-- Select --'}].concat(shuffle(d6B2_raw.map((t, i) => ({val: String(i+1), t}))));
const d6B3_raw = ['25', '110', '587', '465'];
STATE.dyn[6].B3 = [{val:'0', t:'-- Select --'}].concat(shuffle(d6B3_raw.map((t, i) => ({val: String(i+1), t}))));
const d6B4_raw = ['None', 'STARTTLS or SSL/TLS', 'WEP'];
STATE.dyn[6].B4 = [{val:'0', t:'-- Select --'}].concat(shuffle(d6B4_raw.map((t, i) => ({val: String(i+1), t}))));
const d6B5_raw = ['Unchecked', 'Checked'];
STATE.dyn[6].B5 = [{val:'0', t:'-- Select --'}].concat(shuffle(d6B5_raw.map((t, i) => ({val: String(i+1), t}))));
// Lab 7
const d7A1_raw = ['Initialize Disk', 'Convert to Basic Disk', 'Import Foreign Disks', 'Delete Volume'];
STATE.dyn[7].A1 = [{val:'0', t:'-- Select --'}].concat(shuffle(d7A1_raw.map((t, i) => ({val: String(i+1), t}))));
const d7A2_raw = ['Cancel and reformat', 'Verify layout and click OK to mount without wiping', 'Convert to GPT immediately'];
STATE.dyn[7].A2 = [{val:'0', t:'-- Select --'}].concat(shuffle(d7A2_raw.map((t, i) => ({val: String(i+1), t}))));
const d7B1_raw = ['MBR (Master Boot Record)', 'GPT (GUID Partition Table)'];
STATE.dyn[7].B1 = [{val:'0', t:'-- Select --'}].concat(shuffle(d7B1_raw.map((t, i) => ({val: String(i+1), t}))));
const d7B2_raw = ['New Simple Volume', 'Shrink Volume', 'Mark Partition as Active'];
STATE.dyn[7].B2 = [{val:'0', t:'-- Select --'}].concat(shuffle(d7B2_raw.map((t, i) => ({val: String(i+1), t}))));
const d7B3_raw = ['FAT32', 'exFAT', 'NTFS'];
STATE.dyn[7].B3 = [{val:'0', t:'-- Select --'}].concat(shuffle(d7B3_raw.map((t, i) => ({val: String(i+1), t}))));
// Lab 8
const devs8A_raw = [['Laser Printer','S'],['Core Switch','U'],['Space Heater','S'],['NAS Array','U'],['Paper Shredder','S'],['Router','U'],['Primary Workstation','U'],['Vacuum','S']];
STATE.dyn[8].devs8A = shuffle(devs8A_raw.map((d, i) => ({name: d[0], correct: d[1], origIndex: i})));
const d8B1_raw = ['1000W', '~800W (VA x 0.8 Power Factor)', '1250W'];
STATE.dyn[8].B1 = [{val:'0', t:'-- Select --'}].concat(shuffle(d8B1_raw.map((t, i) => ({val: String(i+1), t}))));
const d8B2_raw = ['100% of calculated Wattage', 'No more than 80% of calculated Wattage capacity', '120% — UPS units have headroom'];
STATE.dyn[8].B2 = [{val:'0', t:'-- Select --'}].concat(shuffle(d8B2_raw.map((t, i) => ({val: String(i+1), t}))));
const d8B3_raw = ['All three devices on UPS-1 (900W total)', 'Server A + Server B on UPS-1; provision secondary UPS for the Core Switch spillover', 'Daisy-chain UPS-1 into a surge protector for extra capacity'];
STATE.dyn[8].B3 = [{val:'0', t:'-- Select --'}].concat(shuffle(d8B3_raw.map((t, i) => ({val: String(i+1), t}))));
// Lab 9
const questions9A_raw = [
{id: 'd9A1', label: 'Internet Location:', opts: ['Outside (Internet) Zone', 'Screened Subnet / DMZ', 'Internal LAN']},
{id: 'd9A2', label: 'Firewall/Router Placement:', opts: ['Directly behind Internet', 'Inside DMZ only', 'Inside Internal LAN']},
{id: 'd9A3', label: 'Wireless Access Point (WAP) Placement:', opts: ['Outside Zone', 'Screened Subnet / DMZ', 'Inside Internal LAN']},
{id: 'd9A4', label: 'Xbox Console Placement:', opts: ['Connected to WAP in LAN', 'Directly behind Internet', 'DMZ']},
{id: 'd9A5', label: 'Windows PC Placement:', opts: ['Connected to Firewall Internal Zone', 'DMZ', 'Outside Zone']},
{id: 'd9A6', label: 'Port Forwarding Rule (RDP to PC):', opts: ['Forward TCP 443 to PC', 'Forward TCP 3389 to PC Static IP', 'Forward UDP 3389 to Xbox']},
{id: 'd9A7', label: 'Xbox NAT Configuration:', opts: ['Enable UPnP', 'Disable UPnP', 'Block Xbox MAC address']}
];
STATE.dyn[9].A = shuffle(questions9A_raw.map(q => {
return {
id: q.id,
label: q.label,
opts: [{val: '0', t: '-- Select --'}].concat(q.opts.map((opt, idx) => ({val: String(idx+1), t: opt})))
}
}));
const questions9B_raw = [
{type: 'select', id: 'd9B1', label: 'SSID Broadcast (Stealth Requirement):', opts: ['ON (Visible)', 'OFF (Hidden)']},
{type: 'select', id: 'd9B2', label: 'Security Mode:', opts: ['WEP', 'WPA2-Personal', 'WPA3-Personal']},
{type: 'select', id: 'd9B3', label: 'MAC Filtering Mode:', opts: ['Allow Only (Whitelist)', 'Deny Only (Blacklist)', 'Disabled']},
{type: 'input', id: 'd9B4', label: 'Target MAC Address(es) (Comma separated):', placeholder: 'Enter MAC addresses...'},
{type: 'input', id: 'd9B5', label: 'Content Filtering (Block keywords, e.g. Social Media, Streaming):', placeholder: 'Enter categories/keywords to block...'}
];
STATE.dyn[9].B = shuffle(questions9B_raw.map(q => {
if (q.type === 'select') {
return {
...q,
opts: [{val: '0', t: '-- Select --'}].concat(q.opts.map((opt, idx) => ({val: String(idx+1), t: opt})))
};
}
return q;
}));
let m1=genMac(), m2=genMac(), m3=genMac(), bad=genMac();
STATE.dyn[9].macs = [m1,m2,m3];
if(Math.random()>0.5){ STATE.dyn[9].mode='allow'; STATE.dyn[9].targetMac=`${m1},${m2},${m3}`; }
else { STATE.dyn[9].mode='deny'; STATE.dyn[9].targetMac=bad; }
const phishPool = ['micros0ft.com', 'paypaI.com', 'appIe.com', 'microsoft-support.net'];
STATE.dyn[10].phish = phishPool[Math.floor(Math.random()*phishPool.length)];
STATE.dyn[10].phishOpts = [
`From: hr@microsoft.com, Reply-To: hr@microsoft.com`,
`From: admin@${STATE.dyn[10].phish}, Reply-To: attacker@gmail.com`,
`From: support@company.com, Reply-To: support@company.com`
].sort(()=>0.5-Math.random());
STATE.dyn[10].cli = Math.random()>0.5 ? 'ipconfig' : 'netsh';
const rem10Bopts_raw = ['Identify the malware','Quarantine the infected systems','Disable System Restore','Remediate (Update signatures & scan)','Schedule scans & run updates','Enable System Restore & create point','Educate the end user'];
STATE.dyn[10].remOpts = [{val:'0', t:'-- Select Step --'}].concat(shuffle(rem10Bopts_raw.map((t, i) => ({val: String(i+1), t}))));
const eduOpts_raw = ['Configuring Port Forwarding','Identifying Hardware Failures','Recognizing Phishing Emails','Setting up RAID arrays'];
STATE.dyn[10].eduOpts = [{val:'0', t:'-- Select Training Topic --'}].concat(shuffle(eduOpts_raw.map((t, i) => ({val: String(i+1), t}))));
}
initDynamic();
const LABS = [
{id:1,title:"WinRE Boot Recovery"},
{id:2,title:"Group Policy Sync"},
{id:3,title:"Unattended Deployment"},
{id:4,title:"Live Helpdesk Chat"},
{id:5,title:"Triage & Containment"},
{id:6,title:"BYOD Wireless & Mail"},
{id:7,title:"Disk Management"},
{id:8,title:"Power Allocation"},
{id:9,title:"SOHO Router & Security"},
{id:10,title:"Enterprise Malware Response"}
];
// --- RENDER: SIDEBAR TABS + LAB SHELLS ---
const nav=document.getElementById('tabs'), labsBox=document.getElementById('labs');
LABS.forEach((l,i)=>{
const b=document.createElement('button');
b.innerHTML=`<span class="lnum">${l.id}</span><span class="lname">Lab ${l.id}: ${l.title}</span>`;
b.title=`Lab ${l.id}: ${l.title}`;
b.onclick=()=>showLab(l.id);
if(i===0)b.classList.add('active');
b.id='tab'+l.id; nav.appendChild(b);
});
function showLab(id){
document.querySelectorAll('#tabs button').forEach(b=>b.classList.remove('active'));
document.getElementById('tab'+id).classList.add('active');
document.querySelectorAll('.lab').forEach(l=>l.classList.remove('active'));
document.getElementById('lab'+id).classList.add('active');
if (!STATE.locked && !STATE.vlocked[id]) {
let hist = loadHistory();
let labHist = hist.variants[id] || {};
if (labHist['A'] === 100) {
setVariant(id, 'B');
} else {
setVariant(id, 'A');
}
}
if(id===4){scrollChat('4A');scrollChat('4B');}
}
function scrollChat(key){const w=document.getElementById('win'+key);if(w)w.scrollTop=w.scrollHeight;}
function toggleSidebar(){
const sidebar = document.getElementById('sidebar');
if (sidebar) {
sidebar.classList.toggle('collapsed');
localStorage.setItem('pbq_sidebar_collapsed', sidebar.classList.contains('collapsed') ? 'true' : 'false');
}
}
function setVariant(lab,v){
if(STATE.locked||STATE.vlocked[lab])return;
STATE.variant[lab]=v;
document.getElementById('lab'+lab+'A').style.display=(v==='A')?'flex':'none';
document.getElementById('lab'+lab+'B').style.display=(v==='B')?'flex':'none';
document.getElementById('vt'+lab+'A').classList.toggle('on',v==='A');
document.getElementById('vt'+lab+'B').classList.toggle('on',v==='B');
if(lab===4){scrollChat('4A');scrollChat('4B');}
}
function lockVariant(lab){
if(STATE.vlocked[lab])return;
STATE.vlocked[lab]=true;
const other=STATE.variant[lab]==='A'?'B':'A';
const btn=document.getElementById('vt'+lab+other);
btn.disabled=true;
btn.title='Locked — you committed to Variant '+STATE.variant[lab]+' by answering. Reset the test to switch.';
const note=document.getElementById('vnote'+lab);
if(note)note.textContent='Committed to Variant '+STATE.variant[lab];
}
function labShell(id,innerA,innerB){
const chatCls=id===4?' chat-lab':'';
return `<section class="lab${chatCls}${id===1?' active':''}" id="lab${id}">
<div class="variant-toggle">
<button id="vt${id}A" class="v-btn on" onclick="setVariant(${id},'A')">Variant A</button>
<button id="vt${id}B" class="v-btn" onclick="setVariant(${id},'B')">Variant B</button>
<span class="vlock-note" id="vnote${id}"></span>
</div>
<div id="lab${id}A" class="vwrap" style="display:flex">${innerA}</div>
<div id="lab${id}B" class="vwrap" style="display:none">${innerB}</div>
</section>`;
}
// --- LAB 1 — WinRE CLI TERMINALS ---
const lab1A=`<div class="card" style="flex-shrink: 0;"><h2>WinRE Command Line — Legacy MBR Recovery</h2>
<p class="scenario">A legacy BIOS workstation crashes on boot with the <b>BOOTMGR is missing</b> error. You have been dropped into the Windows Recovery Environment (WinRE) command prompt. Restore boot capability using the correct command sequence, then exit and restart.</p></div>
<div class="card flex-card">
<div class="terminal" id="term1A" style="flex: 1; min-height: 100px; max-height: none;">Microsoft Windows [Version 10.0.19045]
(c) Microsoft Corporation. All rights reserved.
ERROR CONTEXT: BOOTMGR is missing. Legacy BIOS / MBR disk detected.
</div>
<div class="term-input" style="align-items: center; flex-wrap: wrap; flex-shrink: 0;">
<span style="padding-top: 0;">X:\\Sources></span>
<input type="hidden" id="in1A">
<select id="cli1A_1" onchange="updateCli(1, '1A')"></select>
<select id="cli1A_2" onchange="updateCli(2, '1A')" disabled></select>
<select id="cli1A_3" disabled></select>
<button class="hbtn" style="padding: 6px 12px; font-size: clamp(12px, 1vw, 13.5px);" onclick="execCli('1A')">Execute</button>
</div>
<p class="note" style="flex-shrink: 0;">Select command components and click Execute. Command order matters. UEFI-only diskpart operations on this MBR system will fail the scenario.</p>
</div>`;
const lab1B=`<div class="card flex-card">
<div style="flex-shrink: 0;">
<h2>Archetype 1: WinRE Command Line Boot Recovery - Variant B (Modern UEFI/EFI)</h2>
<p class="scenario">A modern UEFI system fails to boot. When the student attempts standard recovery commands, the terminal throws an <b>Access is Denied</b> error explicitly during the <b>bootrec /fixboot</b> execution phase.</p>
<div class="terminal" id="term1B" style="height: 140px; min-height: 100px; max-height: none; flex-shrink: 0;">Microsoft Windows [Version 10.0.19045.2965]
(c) Microsoft Corporation. All rights reserved.
X:\\Sources>bootrec /fixboot
<span class="err">Access is Denied.</span>
</div>
<div class="term-input" style="align-items: center; flex-wrap: wrap; flex-shrink: 0;">
<span style="padding-top: 0;">X:\\Sources></span>
<input type="hidden" id="in1B">
<select id="cli1B_1" onchange="updateCli(1, '1B')"></select>
<select id="cli1B_2" onchange="updateCli(2, '1B')" disabled></select>
<select id="cli1B_3" disabled></select>
<button class="hbtn" style="padding: 6px 12px; font-size: clamp(12px, 1vw, 13.5px);" onclick="execCli('1B')">Execute</button>
</div>
<p class="note" style="flex-shrink: 0;"><b>Deceptive Traps:</b> Endless loops of running fixboot, or the student uses diskpart to format the primary C:\\Windows NTFS partition instead of the hidden FAT32 EFI System Partition (ESP), resulting in catastrophic data loss and immediate PBQ failure.</p>
</div>
<div class="steps-container" style="overflow-y: auto; flex: 0 1 auto; padding-right: 8px; margin-top: 10px;">
<h3 style="margin-top: 4px;">Multi-Step Resolution Sequence</h3>
<ol style="display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 4px 16px; margin-left: 22px; font-size: clamp(12px, 1vw, 13.5px); color: #adbac7; line-height: 1.4;">
<li>Execute <b>diskpart</b> to enter the disk partition utility.</li>
<li>Execute <b>sel disk 0</b> to select the primary physical drive.</li>
<li>Execute <b>list vol</b> to display all partitions. <br><span style="color:#8b949e; font-size:clamp(11px, 0.9vw, 12px);">(Target String readout to identify: <code style="font-family:monospace;">Volume 2 System FAT32 Partition 100 MB Hidden</code>)</span></li>
<li>Locate the 100 MB FAT32 Hidden partition (typically Volume 2) and execute <b>sel vol 2</b>.</li>
<li>Execute <b>assign letter=v:</b> to mount the EFI partition with a recognizable drive letter.</li>
<li>Execute <b>exit</b> to leave the diskpart utility.</li>
<li>Execute <b>format v: /FS:FAT32</b> to wipe the corrupted EFI boot store.</li>
<li>Execute <b>bcdboot C:\\Windows /s v: /f UEFI</b> to write a clean UEFI boot configuration data store from the Windows directory to the newly formatted V: partition.</li>
</ol>
<h3 style="margin-top: 12px;">Edge Cases</h3>
<ul style="margin-left: 22px; font-size: clamp(12px, 1vw, 13.5px); color: #adbac7; line-height: 1.4;">
<li><b>File System Corruption:</b> If the WinRE log explicitly reads "The file system is corrupt" or indicates bad sectors on the primary drive, the sequence must begin with <b>chkdsk c: /f /r</b> (fixes logical file system errors and recovers readable information from physical bad sectors).</li>
<li><b>System File Integrity Violation:</b> If the log reads "Resource Protection could not perform the requested operation" or mentions missing core .dll files, the student must bypass bootrec and run <b>sfc /scannow /offbootdir=C:\\ /offwindir=C:\\Windows</b> to repair offline Windows images.</li>
</ul>
</div>
</div>`;
function norm(s){return s.trim().toLowerCase().replace(/\s+/g,' ');}
function termExec(key){
if(STATE.locked)return;
const inp=document.getElementById('in'+key), term=document.getElementById('term'+key);
const raw=inp.value; if(!raw.trim())return;
const c=norm(raw);
STATE.term[key].push(c);
lockVariant(1);
let out='';
if(key==='1A'){
if(c==='bootrec /fixmbr')out='<span class="ok">The operation completed successfully.</span>';
else if(c==='bootrec /fixboot')out='<span class="ok">The operation completed successfully.</span>';
else if(c==='bootrec /rebuildbcd')out='Scanning all disks for Windows installations.\nTotal identified Windows installations: 1\n[1] C:\\Windows\nAdd installation to boot list? Yes(Y)/No(N)/All(A): Y\n<span class="ok">The operation completed successfully.</span>';
else if(c==='exit')out='<span class="ok">Exiting WinRE... Restarting workstation.</span>';
else if(c.startsWith('diskpart')||c.includes('/f uefi')||c.startsWith('bcdboot')){STATE.term['1A_fail']=true;out='<span class="err">FATAL: UEFI operations attempted on legacy MBR system. Scenario integrity compromised.</span>';}
else out=`'${raw.trim()}' is not recognized as a valid recovery command in this context.`;
} else if (key === '1B') {
if(c==='diskpart')out='Microsoft DiskPart version 10.0\nDISKPART>';
else if(c==='sel disk 0'||c==='select disk 0')out='Disk 0 is now the selected disk.';
else if(c==='list vol'||c==='list volume')out=' Volume ### Ltr Label Fs Type Size Status Info\n ---------- --- ---------- ------ ------------ ------- -------- ------\n Volume 0 C Windows NTFS Partition 475 GB Healthy\n Volume 1 Recovery NTFS Partition 500 MB Healthy Hidden\n Volume 2 System FAT32 Partition 100 MB Healthy Hidden';
else if(c==='sel vol 2'||c==='select vol 2'||c==='select volume 2')out='Volume 2 is the selected volume.';
else if(c==='assign letter=v:'||c==='assign letter=v')out='<span class="ok">DiskPart successfully assigned the drive letter or mount point.</span>';
else if(c==='exit')out='Leaving DiskPart...';
else if(c==='format v: /fs:fat32')out='<span class="ok">Format complete. 100 MB total disk space.</span>';
else if(c==='bcdboot c:\\windows /s v: /f uefi')out='<span class="ok">Boot files successfully created.</span>';
else if(c.startsWith('format c')||c.includes('format c:')){STATE.term['1B_fail']=true;out='<span class="err">CATASTROPHIC: Primary NTFS OS partition formatted. All client data destroyed. PBQ FAILURE.</span>';}
else if(c==='bootrec /fixboot')out='<span class="err">Access is Denied.</span>';
else out=`'${raw.trim()}' is not recognized in this context.`;
} else if (key === '10B') {
if (c === 'ipconfig /release') {
out = 'Windows IP Configuration\nEthernet adapter Ethernet:\n Connection-specific DNS Suffix . : \n IPv4 Address. . . . . . . . . . . : \n Subnet Mask . . . . . . . . . . . : \n Default Gateway . . . . . . . . . : \n<span class="ok">Network connection successfully dropped. Quarantine complete.</span>';
} else if (c === 'ipconfig /renew') {
STATE.term['10B_fail'] = true;
out = '<span class="err">WARNING: IP address renewed. Ransomware is spreading across the network.</span>';
} else if (c === 'netsh interface set interface "ethernet" disable') {
out = '<span class="ok">Interface "Ethernet" successfully disabled. Network disconnected.</span>';
} else if (c === 'ping 8.8.8.8') {
out = 'Pinging 8.8.8.8 with 32 bytes of data:\nReply from 8.8.8.8: bytes=32 time=14ms TTL=117';
} else {
out = `'${raw.trim()}' is not recognized as an internal or external command.`;
}
}
const prompt = key === '10B' ? 'C:\\>' : 'X:\\Sources>';
term.innerHTML+=`\n${prompt}${raw.trim()}\n${out}\n`;
term.scrollTop=term.scrollHeight;
inp.value='';
}