forked from mukesh2511/TreasureHunt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtreasure-of-code.html
More file actions
1190 lines (1085 loc) · 39 KB
/
treasure-of-code.html
File metadata and controls
1190 lines (1085 loc) · 39 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>Treasure of Code — 6th April 2026</title>
<link href="https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@700;900&family=Cinzel:wght@400;600;700&family=Share+Tech+Mono&family=Crimson+Pro:ital,wght@0,400;0,600;1,400&display=swap" rel="stylesheet"/>
<style>
:root {
--gold: #f5c842;
--gold-dark: #c9922a;
--gold-light: #ffe98a;
--teal: #00e5c8;
--teal-dark: #007a6e;
--bg: #060a0f;
--bg2: #0c1420;
--bg3: #111c2d;
--text: #e8dfc0;
--text-dim: #8a7a5a;
--red: #ff4a4a;
--green: #39ff14;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
font-family: 'Crimson Pro', serif;
background: var(--bg);
color: var(--text);
overflow-x: hidden;
cursor: default;
}
/* ─── BACKGROUND GRID ─── */
body::before {
content: '';
position: fixed; inset: 0; z-index: 0;
background-image:
linear-gradient(rgba(0,229,200,.04) 1px, transparent 1px),
linear-gradient(90deg, rgba(0,229,200,.04) 1px, transparent 1px);
background-size: 60px 60px;
pointer-events: none;
}
/* ─── STARS ─── */
.stars { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.star {
position: absolute; border-radius: 50%;
background: white; opacity: 0;
animation: twinkle var(--d, 4s) var(--delay, 0s) infinite;
}
@keyframes twinkle {
0%,100% { opacity: 0; transform: scale(1); }
50% { opacity: var(--op, .8); transform: scale(1.3); }
}
/* ─── SCREEN SYSTEM ─── */
.screen { display: none; min-height: 100vh; position: relative; z-index: 1; }
.screen.active { display: flex; flex-direction: column; align-items: center; }
/* ══════════════════════════════════════
SCREEN 1 — LANDING
══════════════════════════════════════ */
#screen-landing {
justify-content: center;
text-align: center;
padding: 2rem;
gap: 2rem;
background: radial-gradient(ellipse 80% 60% at 50% 40%, rgba(245,200,66,.07) 0%, transparent 70%);
}
.landing-badge {
font-family: 'Share Tech Mono', monospace;
font-size: .78rem;
color: var(--teal);
letter-spacing: .25em;
text-transform: uppercase;
border: 1px solid var(--teal-dark);
padding: .35rem 1.2rem;
border-radius: 2px;
animation: fadeUp .8s .2s both;
}
.landing-title {
font-family: 'Cinzel Decorative', serif;
font-size: clamp(2.8rem, 9vw, 6.5rem);
font-weight: 900;
line-height: .95;
letter-spacing: -.01em;
background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 40%, var(--gold-dark) 100%);
-webkit-background-clip: text; -webkit-text-fill-color: transparent;
filter: drop-shadow(0 0 40px rgba(245,200,66,.35));
animation: fadeUp .8s .4s both;
}
.landing-sub {
font-family: 'Cinzel', serif;
font-size: clamp(1rem, 3vw, 1.5rem);
color: var(--teal);
letter-spacing: .15em;
animation: fadeUp .8s .6s both;
}
.landing-desc {
max-width: 560px;
font-size: 1.15rem;
line-height: 1.75;
color: var(--text-dim);
animation: fadeUp .8s .8s both;
}
.landing-chest {
font-size: clamp(5rem, 12vw, 9rem);
animation: float 4s ease-in-out infinite, fadeUp .8s .5s both;
filter: drop-shadow(0 0 30px rgba(245,200,66,.5));
}
.btn-primary {
font-family: 'Cinzel', serif;
font-size: 1rem;
font-weight: 700;
letter-spacing: .15em;
text-transform: uppercase;
background: linear-gradient(135deg, var(--gold-dark), var(--gold));
color: #1a0e00;
border: none;
padding: .9rem 2.8rem;
border-radius: 3px;
cursor: pointer;
position: relative;
overflow: hidden;
transition: transform .15s, filter .15s;
animation: fadeUp .8s 1s both;
}
.btn-primary::before {
content: '';
position: absolute; inset: 0;
background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,.25) 50%, transparent 100%);
transform: translateX(-100%);
transition: transform .4s;
}
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.1); }
.btn-primary:hover::before { transform: translateX(100%); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
font-family: 'Cinzel', serif;
font-size: .9rem;
letter-spacing: .1em;
text-transform: uppercase;
background: transparent;
color: var(--text-dim);
border: 1px solid #2a3040;
padding: .75rem 2rem;
border-radius: 3px;
cursor: pointer;
transition: all .2s;
}
.btn-secondary:hover { border-color: var(--gold-dark); color: var(--gold); }
.landing-footer {
font-family: 'Share Tech Mono', monospace;
font-size: .75rem;
color: var(--text-dim);
opacity: .6;
letter-spacing: .1em;
animation: fadeUp .8s 1.2s both;
}
/* ══════════════════════════════════════
SCREEN 2 — KEY INPUT (Initial)
══════════════════════════════════════ */
#screen-start {
justify-content: center;
padding: 2rem;
gap: 1.8rem;
background: radial-gradient(ellipse 60% 50% at 50% 50%, rgba(0,229,200,.06) 0%, transparent 70%);
}
.panel {
background: var(--bg3);
border: 1px solid #1e2d42;
border-radius: 6px;
padding: 2.5rem;
max-width: 520px;
width: 100%;
position: relative;
overflow: hidden;
}
.panel::before {
content: '';
position: absolute; top: 0; left: 0; right: 0; height: 2px;
background: linear-gradient(90deg, transparent, var(--teal), transparent);
}
.panel-title {
font-family: 'Cinzel', serif;
font-size: 1.5rem;
font-weight: 700;
color: var(--gold);
margin-bottom: .5rem;
}
.panel-sub {
font-size: 1rem;
color: var(--text-dim);
margin-bottom: 1.5rem;
line-height: 1.6;
}
.input-group { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1.2rem; }
.input-label {
font-family: 'Share Tech Mono', monospace;
font-size: .75rem;
letter-spacing: .15em;
color: var(--teal);
text-transform: uppercase;
}
.key-input {
font-family: 'Share Tech Mono', monospace;
font-size: 1.1rem;
background: var(--bg2);
border: 1px solid #253040;
color: var(--gold-light);
padding: .85rem 1.2rem;
border-radius: 4px;
outline: none;
transition: border-color .2s;
letter-spacing: .1em;
width: 100%;
}
.key-input:focus { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(0,229,200,.1); }
.key-input.error { border-color: var(--red); animation: shake .3s; }
.key-input.success { border-color: var(--green); }
.input-hint {
font-family: 'Share Tech Mono', monospace;
font-size: .72rem;
color: var(--text-dim);
letter-spacing: .05em;
}
.error-msg {
font-family: 'Share Tech Mono', monospace;
font-size: .8rem;
color: var(--red);
min-height: 1.2rem;
letter-spacing: .05em;
}
/* ══════════════════════════════════════
SCREEN 3 — TREASURE MAP
══════════════════════════════════════ */
#screen-map {
padding: 1.5rem;
gap: 1.5rem;
align-items: stretch;
}
.map-header {
display: flex;
align-items: center;
justify-content: space-between;
max-width: 1100px;
width: 100%;
margin: 0 auto;
flex-wrap: wrap;
gap: 1rem;
}
.map-header-left { display: flex; flex-direction: column; gap: .25rem; }
.map-header-title {
font-family: 'Cinzel Decorative', serif;
font-size: 1.4rem;
color: var(--gold);
}
.map-header-sub {
font-family: 'Share Tech Mono', monospace;
font-size: .75rem;
color: var(--teal);
letter-spacing: .1em;
}
.progress-bar-wrap { display: flex; align-items: center; gap: .8rem; }
.progress-label {
font-family: 'Share Tech Mono', monospace;
font-size: .75rem;
color: var(--text-dim);
letter-spacing: .05em;
white-space: nowrap;
}
.progress-bar {
width: 180px; height: 6px;
background: #1e2d42;
border-radius: 3px;
overflow: hidden;
}
.progress-fill {
height: 100%;
background: linear-gradient(90deg, var(--teal-dark), var(--teal));
border-radius: 3px;
transition: width .6s cubic-bezier(.4,0,.2,1);
}
/* ─── MAP CANVAS ─── */
.map-canvas {
max-width: 1100px; width: 100%;
margin: 0 auto;
flex: 1;
position: relative;
background: var(--bg3);
border: 1px solid #1e2d42;
border-radius: 8px;
min-height: 520px;
overflow: hidden;
}
/* Map texture */
.map-canvas::before {
content: '';
position: absolute; inset: 0;
background-image:
radial-gradient(ellipse 120% 80% at 30% 60%, rgba(245,200,66,.03) 0%, transparent 60%),
radial-gradient(ellipse 80% 100% at 80% 30%, rgba(0,229,200,.03) 0%, transparent 60%);
}
/* SVG path connecting nodes */
.map-svg {
position: absolute; inset: 0;
width: 100%; height: 100%;
}
/* ─── NODE ─── */
.map-node {
position: absolute;
transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
align-items: center;
gap: .5rem;
cursor: default;
z-index: 2;
}
.node-circle {
width: 64px; height: 64px;
border-radius: 50%;
display: flex; align-items: center; justify-content: center;
font-size: 1.6rem;
position: relative;
transition: transform .2s;
}
.node-circle::before {
content: '';
position: absolute; inset: -3px;
border-radius: 50%;
border: 2px solid transparent;
transition: border-color .3s;
}
/* States */
.map-node.locked .node-circle {
background: #0d1825;
box-shadow: 0 0 0 1px #1e2d42;
opacity: .6;
}
.map-node.active .node-circle {
background: linear-gradient(135deg, #0d2233, #142840);
box-shadow: 0 0 20px rgba(0,229,200,.4), 0 0 0 1px var(--teal);
animation: pulse-teal 2s infinite;
cursor: pointer;
}
.map-node.active .node-circle::before { border-color: var(--teal); }
.map-node.active { cursor: pointer; }
.map-node.active:hover .node-circle { transform: scale(1.1); }
.map-node.solved .node-circle {
background: linear-gradient(135deg, #0d2e1a, #142d1d);
box-shadow: 0 0 20px rgba(57,255,20,.3), 0 0 0 1px #39ff14;
}
.map-node.solved .node-circle::before { border-color: #39ff14; }
.node-label {
font-family: 'Cinzel', serif;
font-size: .75rem;
font-weight: 600;
letter-spacing: .08em;
text-align: center;
white-space: nowrap;
color: var(--text-dim);
transition: color .3s;
}
.map-node.active .node-label { color: var(--teal); }
.map-node.solved .node-label { color: var(--green); }
.node-badge {
font-family: 'Share Tech Mono', monospace;
font-size: .65rem;
padding: .2rem .5rem;
border-radius: 2px;
letter-spacing: .05em;
}
.badge-easy { background: rgba(57,255,20,.15); color: #39ff14; }
.badge-medium { background: rgba(245,200,66,.15); color: var(--gold); }
.badge-hard { background: rgba(255,74,74,.15); color: var(--red); }
/* START node */
.map-node.start-node .node-circle {
background: linear-gradient(135deg, var(--gold-dark), var(--gold));
box-shadow: 0 0 25px rgba(245,200,66,.5);
cursor: default;
}
.map-node.start-node .node-label { color: var(--gold); }
/* ─── PATH ─── */
.path-line {
stroke: #1e2d42;
stroke-width: 2;
stroke-dasharray: 8 5;
fill: none;
transition: stroke .5s;
}
.path-line.lit {
stroke: rgba(0,229,200,.35);
stroke-dasharray: none;
filter: drop-shadow(0 0 4px var(--teal));
}
/* ══════════════════════════════════════
SCREEN 4 — RIDDLE REVEALED
══════════════════════════════════════ */
#screen-riddle {
justify-content: center;
padding: 2rem;
gap: 1.5rem;
}
.riddle-header {
text-align: center;
display: flex; flex-direction: column; gap: .5rem;
align-items: center;
}
.riddle-stage {
font-family: 'Share Tech Mono', monospace;
font-size: .8rem;
letter-spacing: .2em;
color: var(--teal);
text-transform: uppercase;
}
.riddle-title {
font-family: 'Cinzel Decorative', serif;
font-size: clamp(1.6rem, 4vw, 2.5rem);
color: var(--gold);
filter: drop-shadow(0 0 20px rgba(245,200,66,.3));
}
.riddle-scroll {
max-width: 620px; width: 100%;
background: var(--bg3);
border: 1px solid #1e2d42;
border-radius: 6px;
padding: 2rem;
position: relative;
overflow: hidden;
}
.riddle-scroll::before, .riddle-scroll::after {
content: '⚜';
position: absolute;
font-size: 1.5rem;
color: var(--gold-dark);
opacity: .3;
}
.riddle-scroll::before { top: 1rem; left: 1rem; }
.riddle-scroll::after { bottom: 1rem; right: 1rem; }
.riddle-icon { font-size: 3rem; text-align: center; margin-bottom: 1rem; }
.riddle-text {
font-family: 'Crimson Pro', serif;
font-style: italic;
font-size: 1.25rem;
line-height: 1.8;
color: var(--text);
text-align: center;
position: relative; z-index: 1;
}
.riddle-problem {
max-width: 620px; width: 100%;
background: var(--bg2);
border: 1px solid #1e2d42;
border-radius: 6px;
padding: 1.5rem;
border-left: 3px solid var(--teal);
}
.riddle-problem-label {
font-family: 'Share Tech Mono', monospace;
font-size: .7rem;
color: var(--teal);
letter-spacing: .15em;
margin-bottom: .5rem;
}
.riddle-problem-text {
font-size: 1.05rem;
line-height: 1.7;
color: var(--text);
}
.key-output-panel {
max-width: 620px; width: 100%;
display: flex; flex-direction: column; gap: .8rem;
}
.btn-group { display: flex; gap: .8rem; flex-wrap: wrap; }
/* ══════════════════════════════════════
SCREEN 5 — WINNER
══════════════════════════════════════ */
#screen-winner {
justify-content: center;
text-align: center;
padding: 2rem;
gap: 1.5rem;
background: radial-gradient(ellipse 70% 50% at 50% 40%, rgba(245,200,66,.1) 0%, transparent 70%);
}
.winner-trophy { font-size: 7rem; animation: float 3s ease-in-out infinite; }
.winner-title {
font-family: 'Cinzel Decorative', serif;
font-size: clamp(2rem, 6vw, 4rem);
background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--gold-dark));
-webkit-background-clip: text; -webkit-text-fill-color: transparent;
filter: drop-shadow(0 0 30px rgba(245,200,66,.4));
}
.winner-sub {
font-family: 'Cinzel', serif;
font-size: 1.3rem;
color: var(--teal);
letter-spacing: .1em;
}
.winner-stats {
display: flex; gap: 2rem; justify-content: center; flex-wrap: wrap;
}
.stat-box {
background: var(--bg3);
border: 1px solid #1e2d42;
border-radius: 6px;
padding: 1.2rem 2rem;
display: flex; flex-direction: column; align-items: center; gap: .3rem;
}
.stat-val {
font-family: 'Cinzel Decorative', serif;
font-size: 2rem;
color: var(--gold);
}
.stat-key {
font-family: 'Share Tech Mono', monospace;
font-size: .72rem;
color: var(--text-dim);
letter-spacing: .1em;
text-transform: uppercase;
}
/* confetti */
.confetti-piece {
position: fixed;
width: 10px; height: 10px;
top: -20px;
animation: confettiFall var(--d,3s) var(--delay,0s) ease-in infinite;
z-index: 999;
}
@keyframes confettiFall {
0% { transform: translateY(0) rotate(0); opacity: 1; }
100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}
/* ─── GLOBAL UTILITY ─── */
@keyframes fadeUp {
from { opacity: 0; transform: translateY(18px); }
to { opacity: 1; transform: translateY(0); }
}
@keyframes float {
0%,100% { transform: translateY(0); }
50% { transform: translateY(-14px); }
}
@keyframes pulse-teal {
0%,100% { box-shadow: 0 0 20px rgba(0,229,200,.4), 0 0 0 1px var(--teal); }
50% { box-shadow: 0 0 35px rgba(0,229,200,.7), 0 0 0 1px var(--teal); }
}
@keyframes shake {
0%,100% { transform: translateX(0); }
25% { transform: translateX(-6px); }
75% { transform: translateX(6px); }
}
@keyframes revealIn {
from { opacity: 0; transform: scale(.92) translateY(12px); }
to { opacity: 1; transform: scale(1) translateY(0); }
}
.anim-reveal { animation: revealIn .5s cubic-bezier(.4,0,.2,1) both; }
/* modal overlay for key entry mid-game */
.modal-overlay {
position: fixed; inset: 0; z-index: 50;
background: rgba(6,10,15,.85);
backdrop-filter: blur(6px);
display: none;
align-items: center; justify-content: center;
padding: 1.5rem;
}
.modal-overlay.open { display: flex; }
.modal-box {
max-width: 480px; width: 100%;
animation: revealIn .35s both;
}
/* Rules screen on landing */
.rules-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(220px,1fr));
gap: 1rem;
max-width: 800px;
width: 100%;
}
.rule-card {
background: var(--bg3);
border: 1px solid #1e2d42;
border-radius: 6px;
padding: 1.2rem;
display: flex; gap: .8rem; align-items: flex-start;
animation: fadeUp .8s both;
}
.rule-icon { font-size: 1.5rem; flex-shrink: 0; }
.rule-text { font-size: .95rem; color: var(--text-dim); line-height: 1.6; }
.rule-title { font-family:'Cinzel',serif; font-size:.85rem; color:var(--text); margin-bottom:.3rem; }
.divider {
width: 100%; max-width: 520px;
height: 1px;
background: linear-gradient(90deg, transparent, #1e2d42, transparent);
}
/* responsive */
@media (max-width: 600px) {
.map-canvas { min-height: 420px; }
.node-circle { width: 50px; height: 50px; font-size: 1.2rem; }
}
</style>
</head>
<body>
<!-- Stars BG -->
<div class="stars" id="stars"></div>
<!-- ══════════ SCREEN 1: LANDING ══════════ -->
<section class="screen active" id="screen-landing">
<div class="landing-badge">⚡ Cout << Masters; presents</div>
<div class="landing-chest">🏴☠️</div>
<h1 class="landing-title">Treasure<br>of Code</h1>
<div class="landing-sub">6th April 2026 · CBT Format · MCA</div>
<p class="landing-desc">
A coding treasure hunt where every correct output becomes your next key.
Solve puzzles, unlock riddles, and race to claim the ultimate prize.
</p>
<div class="rules-grid">
<div class="rule-card" style="--delay:.7s">
<div class="rule-icon">🗝️</div>
<div>
<div class="rule-title">Enter the Key</div>
<div class="rule-text">Use the output of each solved problem as the key to unlock the next riddle.</div>
</div>
</div>
<div class="rule-card" style="--delay:.8s">
<div class="rule-icon">🗺️</div>
<div>
<div class="rule-title">Follow the Map</div>
<div class="rule-text">5 stages on the treasure map — Easy → Medium → Hard. Each node unlocks a new puzzle.</div>
</div>
</div>
<div class="rule-card" style="--delay:.9s">
<div class="rule-icon">⚖️</div>
<div>
<div class="rule-title">ICPC Rules</div>
<div class="rule-text">Ranked by riddles solved. Ties broken by time and test cases passed.</div>
</div>
</div>
<div class="rule-card" style="--delay:1s">
<div class="rule-icon">🏆</div>
<div>
<div class="rule-title">Win the Hunt</div>
<div class="rule-text">Solve all 5 challenges before time runs out to claim the treasure!</div>
</div>
</div>
</div>
<div style="display:flex;gap:1rem;flex-wrap:wrap;justify-content:center">
<button class="btn-primary" onclick="goToStart()">⚔️ Begin Quest</button>
</div>
<div class="landing-footer">Powered by Cout << Masters; | Coded for MCA Coders</div>
</section>
<!-- ══════════ SCREEN 2: INITIAL KEY INPUT ══════════ -->
<section class="screen" id="screen-start">
<div class="panel anim-reveal">
<div class="panel-title">🗝️ Enter Your Starting Key</div>
<div class="panel-sub">
You will receive an <strong style="color:var(--gold)">Initial Input Key</strong> from the event team at the start.
Enter it below to unlock your first riddle and begin the treasure hunt.
</div>
<div class="input-group">
<div class="input-label">// Initial Input Key</div>
<input type="text" id="start-key-input" class="key-input" placeholder="Enter key here..."
autocomplete="off" spellcheck="false" oninput="clearError('start')" onkeydown="if(e.key==='Enter')submitStartKey()"/>
<div class="input-hint"># Key will be displayed on screen or handed physically by event staff</div>
</div>
<div class="error-msg" id="start-error"></div>
<div class="btn-group" style="margin-top:.5rem">
<button class="btn-primary" onclick="submitStartKey()">🔓 Unlock Map</button>
<button class="btn-secondary" onclick="goScreen('screen-landing')">← Back</button>
</div>
</div>
<div class="divider"></div>
<div style="font-family:'Share Tech Mono',monospace;font-size:.75rem;color:var(--text-dim);text-align:center;line-height:1.8;max-width:460px">
> <span style="color:var(--teal)">DEMO MODE</span>: Type any key to explore the map<br/>
> In the actual event, the key will be provided by the team<br/>
> Each subsequent key = output of your previous solution
</div>
</section>
<!-- ══════════ SCREEN 3: TREASURE MAP ══════════ -->
<section class="screen" id="screen-map">
<div class="map-header">
<div class="map-header-left">
<div class="map-header-title">🗺️ Treasure Map</div>
<div class="map-header-sub" id="map-status">// Riddle 1 unlocked — Begin your quest</div>
</div>
<div style="display:flex;align-items:center;gap:1.2rem;flex-wrap:wrap">
<div class="progress-bar-wrap">
<span class="progress-label">Progress</span>
<div class="progress-bar"><div class="progress-fill" id="progress-fill" style="width:0%"></div></div>
<span class="progress-label" id="progress-text">0/5</span>
</div>
<button class="btn-secondary" onclick="goScreen('screen-landing')" style="font-size:.75rem;padding:.5rem 1rem">⟵ Exit</button>
</div>
</div>
<div class="map-canvas" id="map-canvas">
<!-- SVG paths drawn by JS -->
<svg class="map-svg" id="map-svg" viewBox="0 0 1000 500" preserveAspectRatio="none"></svg>
<!-- Nodes rendered by JS -->
<div class="map-node start-node" id="node-start" style="left:8%;top:50%">
<div class="node-circle">🏁</div>
<div class="node-label">START</div>
</div>
<div class="map-node" id="node-1" style="left:24%;top:28%">
<div class="node-circle">📜</div>
<div class="node-label">Riddle I</div>
<div class="node-badge badge-easy">EASY</div>
</div>
<div class="map-node" id="node-2" style="left:42%;top:68%">
<div class="node-circle">🧩</div>
<div class="node-label">Riddle II</div>
<div class="node-badge badge-easy">EASY</div>
</div>
<div class="map-node" id="node-3" style="left:60%;top:25%">
<div class="node-circle">⚙️</div>
<div class="node-label">Riddle III</div>
<div class="node-badge badge-medium">MEDIUM</div>
</div>
<div class="map-node" id="node-4" style="left:77%;top:65%">
<div class="node-circle">🔮</div>
<div class="node-label">Riddle IV</div>
<div class="node-badge badge-medium">MEDIUM</div>
</div>
<div class="map-node" id="node-5" style="left:92%;top:38%">
<div class="node-circle">💎</div>
<div class="node-label">Riddle V</div>
<div class="node-badge badge-hard">HARD</div>
</div>
</div>
<!-- Hint bar -->
<div style="max-width:1100px;width:100%;margin:0 auto">
<div style="background:var(--bg3);border:1px solid #1e2d42;border-radius:6px;padding:1rem 1.5rem;display:flex;align-items:center;gap:1rem;flex-wrap:wrap">
<div style="font-family:'Share Tech Mono',monospace;font-size:.75rem;color:var(--teal);letter-spacing:.1em">ACTIVE NODE</div>
<div id="active-hint" style="font-family:'Crimson Pro',serif;font-size:1rem;color:var(--text);flex:1">Click on a glowing node to view its riddle and problem statement.</div>
</div>
</div>
</section>
<!-- ══════════ SCREEN 4: RIDDLE VIEW ══════════ -->
<section class="screen" id="screen-riddle">
<div class="riddle-header">
<div class="riddle-stage" id="riddle-stage">STAGE 1 OF 5</div>
<div class="riddle-title" id="riddle-title">Riddle I — The Opening Cipher</div>
</div>
<div class="riddle-scroll anim-reveal">
<div class="riddle-icon" id="riddle-icon">📜</div>
<div class="riddle-text" id="riddle-text">
"I speak without a mouth and hear without ears. I have no body, but I come alive with the wind. What am I?"
</div>
</div>
<div class="riddle-problem">
<div class="riddle-problem-label">// Problem Statement</div>
<div class="riddle-problem-text" id="riddle-problem">
Your problem will be revealed on the HackerRank editor once you enter the correct key.
Solve it, pass all test cases, and use your <strong style="color:var(--gold)">output as the next key</strong>.
</div>
</div>
<div class="key-output-panel">
<div class="input-group">
<div class="input-label">// Enter Output Key (from previous solution)</div>
<input type="text" id="riddle-key-input" class="key-input" placeholder="Paste your program's output..."
autocomplete="off" spellcheck="false" oninput="clearError('riddle')"
onkeydown="if(event.key==='Enter')submitRiddleKey()"/>
<div class="input-hint"># Output from Problem <span id="riddle-prev-num">0</span> → unlocks next riddle</div>
</div>
<div class="error-msg" id="riddle-error"></div>
<div class="btn-group">
<button class="btn-primary" onclick="submitRiddleKey()">🔓 Submit Key</button>
<button class="btn-secondary" onclick="goScreen('screen-map')">← Back to Map</button>
</div>
</div>
</section>
<!-- ══════════ SCREEN 5: WINNER ══════════ -->
<section class="screen" id="screen-winner">
<div class="winner-trophy">🏆</div>
<div class="winner-title">Treasure Found!</div>
<div class="winner-sub">You have conquered all 5 riddles!</div>
<p style="font-size:1.15rem;color:var(--text-dim);max-width:480px;line-height:1.7;text-align:center">
Exceptional work, Code Hunter! You've unlocked every chamber of the treasure vault.
Your result will be recorded under <strong style="color:var(--gold)">ICPC Rules</strong>.
</p>
<div class="winner-stats">
<div class="stat-box">
<div class="stat-val">5/5</div>
<div class="stat-key">Riddles Solved</div>
</div>
<div class="stat-box">
<div class="stat-val" id="win-time">--:--</div>
<div class="stat-key">Time Elapsed</div>
</div>
<div class="stat-box">
<div class="stat-val">✓</div>
<div class="stat-key">All Tests Passed</div>
</div>
</div>
<div class="btn-group" style="justify-content:center">
<button class="btn-primary" onclick="resetGame()">🔄 Play Again</button>
</div>
<div style="font-family:'Share Tech Mono',monospace;font-size:.75rem;color:var(--text-dim);letter-spacing:.1em">
Powered by Cout << Masters; · 6th April 2026
</div>
</section>
<!-- ══════════ JS ══════════ -->
<script>
// ─── Stars ───
const starsEl = document.getElementById('stars');
for (let i = 0; i < 120; i++) {
const s = document.createElement('div');
s.className = 'star';
const size = Math.random() * 2.5 + .5;
s.style.cssText = `
left:${Math.random()*100}%;top:${Math.random()*100}%;
width:${size}px;height:${size}px;
--d:${(Math.random()*4+2).toFixed(1)}s;
--delay:${(Math.random()*5).toFixed(1)}s;
--op:${(Math.random()*.7+.2).toFixed(1)};
`;
starsEl.appendChild(s);
}
// ─── State ───
let state = {
currentScreen: 'screen-landing',
solvedCount: 0, // how many riddles solved
activeRiddle: 0, // 1-5
startTime: null,
};
// Demo keys — in real event these would be actual outputs
const DEMO_KEYS = {
start: 'TREASURE2026', // initial key
1: 'ECHO42', // output of problem 1 unlocks riddle 2
2: 'LOOP99',
3: 'STACK777',
4: 'BINARY01',
};
const RIDDLES = [
{
num: 1, icon: '📜',
title: 'Riddle I — The Echo Chamber',
stage: 'STAGE 1 OF 5',
difficulty: 'EASY',
riddle: '"I repeat everything you say, yet I say nothing of my own. I live inside every terminal. What am I?"',
problem: 'Problem 1 is now unlocked on HackerRank. Write a program that echoes a given input string in uppercase. Your output is your key to the next riddle.',
prevNum: 0,
},
{
num: 2, icon: '🧩',
title: 'Riddle II — The Endless Loop',
stage: 'STAGE 2 OF 5',
difficulty: 'EASY',
riddle: '"I run and run but never move. I repeat until you tell me to stop. What am I?"',
problem: 'Problem 2 is unlocked! Find the sum of all numbers from 1 to N where N is provided as input. Submit your output as the next key.',
prevNum: 1,
},
{
num: 3, icon: '⚙️',
title: 'Riddle III — The Stack\'s Secret',
stage: 'STAGE 3 OF 5',
difficulty: 'MEDIUM',
riddle: '"Last in, first out — I remember in reverse. Parentheses fear me. What data structure am I?"',
problem: 'Problem 3 unlocked! Check if a given string of brackets is balanced. Return "VALID" or "INVALID". That word is your next key.',
prevNum: 2,
},
{
num: 4, icon: '🔮',
title: 'Riddle IV — The Binary Oracle',
stage: 'STAGE 4 OF 5',
difficulty: 'MEDIUM',
riddle: '"I see the world in only two states — zero and one. I can search a sorted list in O(log n). What algorithm am I?"',
problem: 'Problem 4 unlocked! Implement binary search on a sorted array. Return the index of the target, or -1 if not found. Output is your final key.',
prevNum: 3,
},
{
num: 5, icon: '💎',
title: 'Riddle V — The Final Cipher',
stage: 'STAGE 5 OF 5 · FINAL BOSS',
difficulty: 'HARD',
riddle: '"I can hold the whole world in my nodes and edges. I find the shortest path through chaos. I am the map itself. What am I?"',
problem: 'FINAL CHALLENGE! Implement Dijkstra\'s shortest path algorithm on a weighted graph. Find the minimum cost from source to all vertices. This is your ultimate test. There is no next key — only victory.',
prevNum: 4,
},
];
// ─── Screen navigation ───
function goScreen(id) {
document.querySelectorAll('.screen').forEach(s => s.classList.remove('active'));
document.getElementById(id).classList.add('active');
state.currentScreen = id;
window.scrollTo(0,0);
}
function goToStart() {
goScreen('screen-start');
setTimeout(() => document.getElementById('start-key-input').focus(), 300);
}
// ─── Key validation ───
function submitStartKey() {
const val = document.getElementById('start-key-input').value.trim().toUpperCase();
if (val.length < 2) {
showError('start', 'Please enter a valid key.');
return;
}
// In demo: accept any key. Real event: check against DEMO_KEYS.start
// Accept any non-empty key for demo purposes
state.startTime = Date.now();
state.solvedCount = 0;
state.activeRiddle = 1;
initMap();
goScreen('screen-map');
}
function submitRiddleKey() {
const val = document.getElementById('riddle-key-input').value.trim().toUpperCase();
const riddle = RIDDLES[state.activeRiddle - 1];
const expectedKey = DEMO_KEYS[state.activeRiddle];
if (val.length < 2) {
showError('riddle', 'Please enter your program\'s output key.');
return;
}
// Demo: accept correct key OR "SKIP" for demo purposes
if (val === expectedKey || val === 'SKIP' || val === 'DEMO') {
// Correct!
state.solvedCount++;
markNodeSolved(state.activeRiddle);
document.getElementById('riddle-key-input').value = '';
if (state.activeRiddle === 5) {
// Winner!