-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCodeForge.html
More file actions
3074 lines (2750 loc) · 185 KB
/
Copy pathCodeForge.html
File metadata and controls
3074 lines (2750 loc) · 185 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" data-theme="nebula" data-scale="md" data-anim="standard">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>CodeForge 2040 v18.0 — Quantum Omnipresent AI Engine & Multi-Model Suite</title>
<meta name="description" content="The ultimate AI codebase generator and prototyping engine suite. Integrated with 18+ CDN libraries, all major AI models (Gemini 2.0, DeepSeek R1, Claude 3.5, GPT-4o, Llama 3.3, Qwen 2.5), API key verifier, setup guides, and level designer." />
<meta name="color-scheme" content="dark light" />
<meta name="theme-color" content="#03030d" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Outfit:wght@300;400;500;600;700;800;900&display=swap" rel="stylesheet" />
<link rel="icon" type="image/png" href="https://raw.githubusercontent.com/qamotech/codeforge/main/ninja-logo.png" />
<link rel="shortcut icon" href="https://raw.githubusercontent.com/qamotech/codeforge/main/ninja-logo.png" />
<link rel="apple-touch-icon" href="https://raw.githubusercontent.com/qamotech/codeforge/main/ninja-logo.png" />
<meta property="og:image" content="https://raw.githubusercontent.com/qamotech/codeforge/main/ninja-logo.png" />
<style>
/* ================================================================
RESET & ROOT DESIGN TOKENS — CodeForge v18.0 Omnipresent Edition
================================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
:root {
--bg: #03030d;
--bg2: #08081a;
--bg3: #0f0f29;
--bg4: #17173d;
--surface: rgba(255,255,255,0.04);
--surface-h: rgba(255,255,255,0.08);
--surface-a: rgba(255,255,255,0.13);
--border: rgba(255,255,255,0.08);
--border-h: rgba(255,255,255,0.22);
--border-a: rgba(255,255,255,0.32);
--text: #f0f0ff;
--text-muted: #8a8ab8;
--text-dim: #525280;
--cyan: #22d3ee;
--violet: #a78bfa;
--indigo: #818cf8;
--purple: #c084fc;
--green: #34d399;
--emerald: #10b981;
--amber: #fbbf24;
--red: #f87171;
--rose: #fb7185;
--blue: #60a5fa;
--pink: #f472b6;
--teal: #2dd4bf;
--elec-color: #22d3ee;
--grad-1: linear-gradient(135deg, #6366f1, #a78bfa, #c084fc);
--grad-2: linear-gradient(135deg, #22d3ee, #6366f1);
--grad-3: linear-gradient(135deg, #f472b6, #a78bfa);
--grad-ok: linear-gradient(135deg, #059669, #34d399);
--grad-warn: linear-gradient(135deg, #d97706, #fbbf24);
--grad-hero: linear-gradient(135deg, #6366f1 0%, #a78bfa 25%, #22d3ee 50%, #c084fc 75%, #fbbf24 100%);
--grad-border: linear-gradient(135deg, rgba(99,102,241,0.5), rgba(167,139,250,0.5), rgba(34,211,238,0.5));
--glow-v: 0 0 45px rgba(99,102,241,0.4), 0 0 90px rgba(167,139,250,0.2);
--glow-c: 0 0 45px rgba(34,211,238,0.4), 0 0 90px rgba(34,211,238,0.2);
--radius: 14px;
--radius-sm: 8px;
--radius-md: 12px;
--radius-lg: 20px;
--radius-xl: 28px;
--font: 'Inter', 'Outfit', system-ui, sans-serif;
--font-display:'Outfit', 'Inter', sans-serif;
--mono: 'JetBrains Mono', 'Fira Code', monospace;
--ease: cubic-bezier(0.4, 0, 0.2, 1);
--ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
--dur: 0.3s;
--z-particles: 0;
--z-content: 1;
--z-header: 10;
--z-dock: 40;
--z-panel: 50;
--z-modal: 100;
--z-toast: 200;
}
/* FONT SCALE ACCESSIBILITY ADJUSTMENTS */
html[data-scale="sm"] { font-size: 13.5px; }
html[data-scale="md"] { font-size: 15px; }
html[data-scale="lg"] { font-size: 16.5px; }
html[data-scale="xl"] { font-size: 18px; }
html[data-contrast="high"] {
--surface: rgba(255,255,255,0.09);
--border: rgba(255,255,255,0.28);
--text: #ffffff;
--text-muted: #b5b5dc;
}
/* ANIMATION INTENSITY CONTROL */
html[data-anim="off"] #particle-canvas, html[data-anim="off"] #electric-canvas { display: none !important; }
html[data-anim="off"] body::after { display: none !important; }
/* THEMES (CORE 4: DARK, LIGHT, NEON, CYBER) */
html[data-theme="dark"] {
--bg:#03030d; --bg2:#08081a; --bg3:#0f0f29; --bg4:#17173d;
--text:#f0f0ff; --text-muted:#8a8ab8; --cyan:#22d3ee; --violet:#c084fc; --elec-color:#22d3ee;
}
html[data-theme="light"] {
--bg:#f8fafc; --bg2:#f1f5f9; --bg3:#e2e8f0; --bg4:#cbd5e1;
--text:#0f172a; --text-muted:#475569; --cyan:#06b6d4; --violet:#7c3aed; --elec-color:#06b6d4;
--surface: rgba(0,0,0,0.03); --border: rgba(0,0,0,0.08);
}
html[data-theme="neon"] {
--bg:#000000; --bg2:#0a000a; --bg3:#1a001a; --bg4:#2a002a;
--text:#fff; --text-muted:#ff00ff; --cyan:#00ffff; --violet:#ff00ff; --elec-color:#00ffff;
--glow-v: 0 0 20px #ff00ff, 0 0 40px #ff00ff44;
}
html[data-theme="cyber"] {
--bg:#050b0a; --bg2:#081412; --bg3:#0c1e1a; --bg4:#122a25;
--text:#00ff9f; --text-muted:#008f5a; --cyan:#00ff9f; --violet:#7209b7; --elec-color:#00ff9f;
}
html { height: 100%; scroll-behavior: smooth; }
body {
min-height: 100vh; background: var(--bg); color: var(--text); font-family: var(--font);
font-size: 1rem; line-height: 1.6; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
overflow-x: hidden; touch-action: manipulation; transition: background-color 0.4s ease, color 0.4s ease;
}
#particle-canvas, #electric-canvas { position: fixed; inset: 0; z-index: var(--z-particles); pointer-events: none; }
#electric-canvas { z-index: 2; opacity: 0.6; }
/* RICH DEEP SPACE NEBULA AURORA BACKGROUND */
body::after {
content: ''; position: fixed; inset: 0;
background:
radial-gradient(ellipse 120% 70% at 50% -25%, rgba(99,102,241,0.28) 0%, transparent 65%),
radial-gradient(ellipse 70% 50% at 85% 20%, rgba(192,132,252,0.22) 0%, transparent 55%),
radial-gradient(ellipse 60% 40% at 15% 80%, rgba(34,211,238,0.2) 0%, transparent 50%);
pointer-events: none; z-index: var(--z-particles); animation: cosmicNebulaShift 12s ease-in-out infinite alternate;
}
@keyframes cosmicNebulaShift { 0% { opacity: 0.7; transform: scale(1); } 100% { opacity: 1; transform: scale(1.03); } }
/* COSMIC SPACE ELEMENTS: PLANETS, SATELLITES & DEBRIS */
.cosmic-layer { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; opacity: 0.85; transition: opacity 0.5s ease; }
html[data-anim="off"] .cosmic-layer { opacity: 0; display: none !important; }
.space-planet { position: absolute; border-radius: 50%; filter: blur(0.5px); box-shadow: inset -25px -25px 50px rgba(0,0,0,0.8), 0 0 40px rgba(99,102,241,0.3); animation: planetFloat 25s ease-in-out infinite alternate; }
.planet-1 { width: 180px; height: 180px; top: 8%; right: -40px; background: radial-gradient(circle at 35% 35%, #a78bfa, #4c1d95, #1e1b4b); transform: rotate(15deg); }
.planet-2 { width: 110px; height: 110px; bottom: 12%; left: -30px; background: radial-gradient(circle at 30% 30%, #22d3ee, #0369a1, #082f49); animation-duration: 32s; box-shadow: inset -15px -15px 35px rgba(0,0,0,0.8), 0 0 35px rgba(34,211,238,0.25); }
.space-ring { position: absolute; width: 260px; height: 60px; top: 11%; right: -80px; border: 12px solid rgba(251,191,36,0.35); border-radius: 50%; transform: rotate(-25deg); filter: blur(1px); pointer-events: none; animation: ringRotate 30s linear infinite; }
.satellite { position: absolute; width: 42px; height: 42px; top: 28%; left: 15%; animation: orbitSat 40s linear infinite; opacity: 0.75; }
.satellite-solar { position: absolute; width: 32px; height: 12px; background: var(--cyan); border-radius: 2px; box-shadow: 0 0 10px var(--cyan); top: 15px; left: -25px; transform: rotate(15deg); }
.satellite-solar.right { left: 35px; }
.satellite-body { position: absolute; width: 18px; height: 18px; background: var(--violet); border-radius: 50%; top: 12px; left: 12px; box-shadow: 0 0 15px var(--violet); }
.space-debris { position: absolute; background: #64748b; border-radius: 40% 60% 55% 45%; filter: drop-shadow(0 0 4px var(--cyan)); animation: debrisDrift 35s linear infinite; opacity: 0.6; }
.debris-1 { width: 12px; height: 9px; top: 45%; right: 20%; animation-duration: 28s; }
.debris-2 { width: 8px; height: 14px; top: 75%; right: 35%; animation-duration: 45s; animation-direction: reverse; }
.debris-3 { width: 16px; height: 12px; top: 20%; left: 38%; animation-duration: 50s; }
@keyframes planetFloat { 0% { transform: translateY(0px) scale(1) rotate(0deg); } 100% { transform: translateY(-25px) scale(1.04) rotate(8deg); } }
@keyframes orbitSat { 0% { transform: translate(-50px, -30px) rotate(0deg); opacity: 0.3; } 50% { opacity: 0.85; } 100% { transform: translate(120vw, 40vh) rotate(360deg); opacity: 0; } }
@keyframes debrisDrift { 0% { transform: translate(0, 0) rotate(0deg); } 50% { transform: translate(-40px, -25px) rotate(180deg); } 100% { transform: translate(15px, 30px) rotate(360deg); } }
@keyframes ringRotate { 0% { transform: rotate(-25deg) scale(1); } 50% { transform: rotate(-22deg) scale(1.02); } 100% { transform: rotate(-25deg) scale(1); } }
#root { position: relative; z-index: var(--z-content); min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 0 1rem 7.5rem; }
/* HEADER & BRANDING */
header {
width: 100%; max-width: 980px; display: flex; align-items: center; justify-content: space-between;
padding: 1.1rem 0 1.25rem; gap: 0.75rem; flex-wrap: wrap; position: relative; z-index: var(--z-header);
}
.logo { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; cursor: pointer; -webkit-user-select: none; user-select: none; }
.logo-icon {
width: 48px; height: 48px; background: var(--grad-1); border-radius: 14px; display: grid; place-items: center;
font-size: 25px; box-shadow: var(--glow-v); flex-shrink: 0; position: relative; overflow: hidden; animation: logoFloat 4s ease-in-out infinite;
}
@keyframes logoFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.logo-text {
font-family: var(--font-display); font-size: 1.6rem; font-weight: 900; background: var(--grad-hero);
background-size: 200% 200%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
letter-spacing: -0.03em; animation: gradientFlow 4s ease infinite;
}
@keyframes gradientFlow { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.logo-sub { font-size: 0.65rem; color: var(--text-dim); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; -webkit-text-fill-color: var(--text-dim); }
.logo-version { font-size: 0.6rem; padding: 0.18rem 0.65rem; border-radius: 99px; background: rgba(99,102,241,0.18); color: var(--indigo); border: 1px solid rgba(99,102,241,0.3); font-weight: 800; letter-spacing: 0.08em; -webkit-text-fill-color: var(--indigo); margin-left: 0.4rem; }
.header-controls { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; max-width: 100%; }
#eq-canvas { height: 26px; width: 60px; border-radius: 6px; background: rgba(0,0,0,0.3); border: 1px solid var(--border); flex-shrink: 0; }
/* NAV TABS */
.nav-tabs {
width: 100%; max-width: 980px; display: flex; gap: 0.3rem; margin-bottom: 1.35rem; padding: 0.35rem;
background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
-webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); overflow-x: auto; box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.nav-tab {
flex: 1; min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 0.45rem; padding: 0.5rem 0.85rem;
border-radius: var(--radius); border: none; background: transparent; color: var(--text-muted);
font-family: var(--font); font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: all var(--dur) var(--ease);
white-space: nowrap; -webkit-user-select: none; user-select: none; touch-action: manipulation; position: relative;
}
.nav-tab:hover { color: var(--text); background: var(--surface-h); }
.nav-tab.active { color: #fff; background: var(--grad-1); box-shadow: 0 0 30px rgba(99,102,241,0.45); }
/* CARDS — RICH COSMIC GLASS & SUBTLE SPECULAR CARD GLARE */
.card {
width: 100%; max-width: 980px; background: var(--surface); border: 1px solid var(--border);
border-radius: var(--radius-xl); -webkit-backdrop-filter: blur(36px); backdrop-filter: blur(36px);
padding: 1.85rem; box-shadow: 0 20px 80px rgba(0,0,0,0.7), 0 0 50px rgba(99,102,241,0.15);
transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform 0.25s var(--ease);
position: relative; overflow: hidden; transform-style: preserve-3d;
}
.card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--grad-border); opacity: 0.7; }
/* RESTORED SUBTLE LIGHT GLARE REFLCTION (NO FRAME SHIFT) */
.card-glare {
position: absolute; inset: 0;
background: radial-gradient(circle at var(--glare-x, 50%) var(--glare-y, 50%), rgba(255,255,255,0.06) 0%, transparent 60%);
pointer-events: none; opacity: 0; transition: opacity 0.3s var(--ease); border-radius: var(--radius-xl);
}
.card:hover .card-glare { opacity: 1; }
/* BUTTONS & RESPONSIVE PADDING FIX (NO TEXT OVERFLOW) */
.btn {
min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; padding: 0.55rem 1rem; border-radius: var(--radius-sm);
border: 1px solid var(--border); background: var(--surface); color: var(--text); font-family: var(--font);
font-size: 0.84rem; font-weight: 600; cursor: pointer; transition: all 0.18s var(--ease); white-space: nowrap; text-align: center;
touch-action: manipulation; -webkit-user-select: none; user-select: none; position: relative; overflow: hidden;
box-shadow: 0 4px 20px rgba(0,0,0,0.3); max-width: 100%; flex-shrink: 0;
}
.btn:hover:not(:disabled) { background: var(--surface-h); border-color: var(--border-h); box-shadow: 0 8px 30px rgba(0,0,0,0.5), 0 0 20px rgba(34,211,238,0.2); }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-primary { background: var(--grad-1); border-color: transparent; color: #fff; font-weight: 700; box-shadow: 0 0 26px rgba(99,102,241,0.4); }
.btn-next-illuminated {
background: linear-gradient(135deg, #22d3ee, #6366f1, #c084fc) !important;
color: #ffffff !important;
border-color: #22d3ee !important;
box-shadow: 0 0 35px rgba(34,211,238,0.7), 0 0 70px rgba(99,102,241,0.4) !important;
}
.dock-next-illuminated {
color: var(--cyan) !important;
text-shadow: 0 0 16px rgba(34,211,238,0.9) !important;
}
.btn-success { background: var(--grad-ok); border-color: transparent; color: #fff; font-weight: 700; font-size: 0.95rem; padding: 0.75rem 2.2rem; box-shadow: 0 0 30px rgba(52,211,153,0.4); border-radius: var(--radius); }
.btn-danger { border-color: rgba(248,113,113,0.35); color: #f87171; background: rgba(248,113,113,0.1); }
.btn-danger:hover { background: rgba(248,113,113,0.22); border-color: #f87171; box-shadow: 0 0 20px rgba(248,113,113,0.3); }
.btn-sm { min-height: 36px; padding: 0.35rem 0.72rem; font-size: 0.76rem; border-radius: 8px; flex-shrink: 0; }
select {
min-height: 44px; -webkit-appearance: none; appearance: none; background: var(--surface); border: 1px solid var(--border);
border-radius: var(--radius-sm); color: var(--text); font-family: var(--font); font-size: 0.84rem;
padding: 0.45rem 2.2rem 0.45rem 0.85rem; cursor: pointer; touch-action: manipulation;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8ab8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
background-repeat: no-repeat; background-position: right 0.7rem center; transition: border-color 0.2s; max-width: 100%;
}
select:hover { border-color: var(--border-h); }
option { background: var(--bg3); color: var(--text); }
input[type="text"], input[type="password"], textarea {
width: 100%; min-height: 44px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
color: var(--text); font-family: var(--font); font-size: 0.88rem; padding: 0.65rem 1rem; outline: none; transition: all 0.2s;
}
input:focus, textarea:focus { border-color: var(--cyan); box-shadow: 0 0 20px rgba(34,211,238,0.3); background: rgba(255,255,255,0.06); }
textarea { resize: vertical; min-height: 95px; font-size: 0.86rem; line-height: 1.6; }
.chip-cloud { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.65rem; }
.chip-btn {
min-height: 32px; padding: 0.28rem 0.7rem; border-radius: 99px; font-size: 0.73rem; font-weight: 600;
background: rgba(99,102,241,0.14); border: 1px solid rgba(99,102,241,0.35); color: var(--indigo); cursor: pointer; transition: all 0.15s; touch-action: manipulation; flex-shrink: 0;
}
.chip-btn:hover { background: rgba(99,102,241,0.28); border-color: var(--indigo); box-shadow: 0 0 16px rgba(99,102,241,0.3); }
/* LEVEL DESIGNER STAGE */
.level-designer-stage { margin-top: 1rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg3); padding: 1rem; box-shadow: inset 0 0 30px rgba(0,0,0,0.5); }
.level-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; margin-top: 0.6rem; background: #000; padding: 6px; border-radius: 8px; }
.level-cell { aspect-ratio: 1; border: 1px dashed rgba(255,255,255,0.1); border-radius: 4px; cursor: pointer; display: grid; place-items: center; font-size: 0.9rem; -webkit-user-select: none; user-select: none; }
.level-cell.wall { background: #475569; }
.level-cell.player { background: rgba(34,211,238,0.3); border-color: var(--cyan); }
.level-cell.enemy { background: rgba(248,113,113,0.3); border-color: var(--red); }
.level-cell.coin { background: rgba(251,191,36,0.3); border-color: var(--amber); }
.cdn-library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.6rem; margin-top: 0.75rem; }
.cdn-item { padding: 0.6rem 0.85rem; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: 0.78rem; font-weight: 600; display: flex; align-items: center; justify-content: space-between; transition: all 0.18s; }
.cdn-item.selected { border-color: var(--cyan); background: rgba(34,211,238,0.14); color: var(--cyan); box-shadow: 0 0 16px rgba(34,211,238,0.2); }
/* SETUP GUIDES & API KEY VERIFIER */
.setup-guide-box { background: rgba(99,102,241,0.08); border: 1px solid rgba(99,102,241,0.25); border-radius: 10px; padding: 0.75rem 1rem; margin-top: 0.4rem; font-size: 0.76rem; color: var(--text-muted); line-height: 1.5; }
.setup-guide-box a { color: var(--cyan); text-decoration: none; font-weight: bold; }
.setup-guide-box a:hover { text-decoration: underline; }
/* WIZARD PROGRESS & STEPS */
.progress-wrap { margin-bottom: 1.5rem; }
.progress-meta { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--text-muted); margin-bottom: 0.45rem; font-weight: 600; }
.progress-track { height: 6px; background: var(--surface-h); border-radius: 99px; overflow: hidden; position: relative; box-shadow: inset 0 1px 3px rgba(0,0,0,0.5); }
.progress-fill { height: 100%; background: var(--grad-hero); background-size: 200% 200%; border-radius: 99px; transition: width 0.4s var(--ease); animation: gradientFlow 3s ease infinite; }
.step-header { display: flex; align-items: flex-start; gap: 0.95rem; margin-bottom: 1.5rem; }
.step-num { width: 44px; height: 44px; border-radius: 50%; background: var(--grad-1); display: grid; place-items: center; font-size: 0.9rem; font-weight: 800; flex-shrink: 0; box-shadow: var(--glow-v); }
.step-question { font-family: var(--font-display); font-size: 1.25rem; font-weight: 800; line-height: 1.35; letter-spacing: -0.02em; }
.step-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.2rem; }
.options-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.7rem; margin-bottom: 1.35rem; }
.option-item {
min-height: 54px; display: flex; align-items: center; gap: 0.75rem; padding: 0.8rem 1.05rem; border-radius: var(--radius);
border: 1px solid var(--border); background: var(--surface); cursor: pointer; transition: all 0.18s var(--ease);
-webkit-user-select: none; user-select: none; touch-action: manipulation; position: relative; overflow: hidden; box-shadow: 0 4px 18px rgba(0,0,0,0.25);
}
.option-item:hover { border-color: var(--border-h); background: var(--surface-h); box-shadow: 0 6px 24px rgba(0,0,0,0.4), 0 0 16px rgba(34,211,238,0.15); }
.option-item.selected { border-color: rgba(99,102,241,0.8); background: rgba(99,102,241,0.14); box-shadow: 0 0 24px rgba(99,102,241,0.3); }
.option-check { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--border-h); display: grid; place-items: center; flex-shrink: 0; transition: all 0.2s; }
.option-item.selected .option-check { background: var(--grad-1); border-color: transparent; }
.option-check svg { display: none; }
.option-item.selected .option-check svg { display: block; }
.option-label { font-size: 0.86rem; font-weight: 600; }
.action-bar { width: 100%; max-width: 980px; display: flex; align-items: center; justify-content: space-between; margin-top: 1.35rem; gap: 0.75rem; flex-wrap: wrap; }
.action-left { display: flex; gap: 0.55rem; align-items: center; flex-wrap: wrap; }
.action-right { display: flex; gap: 0.65rem; align-items: center; flex-wrap: wrap; }
/* DIRECTIONAL SLIDE STEP TRANSITIONS */
.slide-next { animation: slideNext 0.25s var(--ease); }
.slide-prev { animation: slidePrev 0.25s var(--ease); }
@keyframes slideNext { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slidePrev { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }
/* ARCHITECTURE DIAGRAM CANVAS & 3D HOLOGRAPHIC CUBE */
.arch-canvas-wrap { margin-top: 1rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg3); padding: 1rem; position: relative; overflow-x: auto; box-shadow: inset 0 0 30px rgba(0,0,0,0.5); }
.arch-title { font-size: 0.8rem; font-weight: 700; color: var(--cyan); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.4rem; }
#holo-cube-canvas { height: 115px; width: 100%; border-radius: var(--radius); background: rgba(0,0,0,0.3); border: 1px solid var(--border); margin-top: 0.65rem; box-shadow: 0 0 25px rgba(34,211,238,0.15); }
/* CODE THEATER & PERFORMANCE METRICS BAR */
.code-theater { margin-top: 1.25rem; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--bg3); box-shadow: 0 16px 60px rgba(0,0,0,0.7), 0 0 40px rgba(99,102,241,0.15); }
.code-theater-header { display: flex; align-items: center; padding: 0.55rem 0.95rem; background: var(--surface); border-bottom: 1px solid var(--border); gap: 0.55rem; overflow-x: auto; }
.metrics-bar { display: flex; align-items: center; justify-content: space-around; padding: 0.35rem 0.9rem; background: rgba(0,0,0,0.4); border-bottom: 1px solid var(--border); font-family: var(--mono); font-size: 0.72rem; color: var(--cyan); flex-wrap: wrap; gap: 0.4rem; }
.code-editor-area { width: 100%; height: 390px; background: transparent; color: var(--text); font-family: var(--mono); font-size: 0.83rem; line-height: 1.6; border: 0; outline: 0; padding: 0.85rem; resize: none; tab-size: 2; }
.editor-line-numbers { padding: 0.85rem 0.5rem; background: rgba(0,0,0,0.3); border-right: 1px solid var(--border); color: var(--text-dim); font-family: var(--mono); font-size: 0.78rem; line-height: 1.6; text-align: right; -webkit-user-select: none; user-select: none; width: 45px; flex-shrink: 0; overflow: hidden; }
.file-tree { width: 195px; border-right: 1px solid var(--border); padding: 0.7rem; max-height: 430px; overflow-y: auto; flex-shrink: 0; background: rgba(0,0,0,0.2); }
.file-tree-item { min-height: 38px; display: flex; align-items: center; padding: 0.35rem 0.6rem; border-radius: 6px; font-family: var(--mono); font-size: 0.74rem; color: var(--text-muted); cursor: pointer; transition: all 0.15s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; touch-action: manipulation; }
.file-tree-item.active { background: rgba(99,102,241,0.2); color: var(--indigo); font-weight: bold; border-left: 2px solid var(--cyan); box-shadow: 0 0 16px rgba(34,211,238,0.2); }
.code-theater-body { display: flex; }
/* FEATURE INJECTORS TOOLBAR */
.injector-toolbar { display: flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.85rem; background: rgba(34,211,238,0.08); border-bottom: 1px solid var(--border); overflow-x: auto; }
.injector-btn { min-height: 28px; padding: 0.2rem 0.6rem; border-radius: 6px; font-size: 0.7rem; font-weight: 600; background: rgba(99,102,241,0.2); border: 1px solid rgba(99,102,241,0.4); color: var(--cyan); cursor: pointer; transition: all 0.15s; white-space: nowrap; flex-shrink: 0; }
.injector-btn:hover { background: rgba(34,211,238,0.25); border-color: var(--cyan); }
/* SEARCH & REPLACE OVERLAY */
.editor-search-bar { display: flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.85rem; background: var(--surface-h); border-bottom: 1px solid var(--border); font-size: 0.75rem; flex-wrap: wrap; }
/* FULLSCREEN STAGE ZEN MODE */
.fullscreen-stage { position: fixed !important; inset: 0 !important; z-index: 500 !important; width: 100vw !important; height: 100vh !important; border-radius: 0 !important; margin: 0 !important; }
/* SANDBOX MULTI-DEVICE SIMULATOR & BEZELS */
.sandbox-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 0.5rem 0.9rem; background: var(--surface-h); border-bottom: 1px solid var(--border); font-size: 0.78rem; gap: 0.5rem; overflow-x: auto; }
.device-viewport-stage { display: flex; justify-content: center; align-items: center; background: #040410; padding: 1.5rem 0.75rem; overflow: auto; min-height: 410px; }
.device-bezel-iphone { padding: 14px 10px 22px; background: #181826; border-radius: 40px; border: 4px solid #2e2e40; box-shadow: 0 20px 80px rgba(0,0,0,0.85), 0 0 35px rgba(99,102,241,0.2); position: relative; }
.device-bezel-iphone::before { content: ''; position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 70px; height: 14px; background: #000; border-radius: 99px; }
.live-preview-box { transition: all 0.35s var(--ease); border: 1px solid var(--border-h); background: #ffffff; border-radius: 12px; box-shadow: 0 12px 50px rgba(0,0,0,0.7); }
.sandbox-console-feed { background: var(--bg); border-top: 1px solid var(--border); max-height: 120px; overflow-y: auto; padding: 0.45rem 0.75rem; font-family: var(--mono); font-size: 0.72rem; color: var(--cyan); line-height: 1.5; }
.console-entry { display: flex; gap: 0.45rem; border-bottom: 1px dashed rgba(255,255,255,0.06); padding: 0.15rem 0; }
.console-entry.error { color: var(--red); }
.console-entry.warn { color: var(--amber); }
/* CODE DIFF STUDIO */
.diff-split-container { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; height: 360px; font-family: var(--mono); font-size: 0.78rem; }
.diff-pane { background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.75rem; overflow: auto; white-space: pre-wrap; line-height: 1.5; }
.diff-added { background: rgba(52,211,153,0.15); color: var(--green); border-left: 2px solid var(--green); }
.diff-removed { background: rgba(248,113,113,0.15); color: var(--red); border-left: 2px solid var(--red); }
/* LINTER & DIAGNOSTICS */
.lint-card { padding: 0.6rem 0.85rem; border-radius: var(--radius-sm); margin-bottom: 0.4rem; font-size: 0.76rem; font-family: var(--mono); display: flex; align-items: center; gap: 0.5rem; }
.lint-card.error { background: rgba(248,113,113,0.12); border: 1px solid rgba(248,113,113,0.25); color: var(--red); }
.lint-card.warn { background: rgba(251,191,36,0.12); border: 1px solid rgba(251,191,36,0.25); color: var(--amber); }
.lint-card.ok { background: rgba(52,211,153,0.12); border: 1px solid rgba(52,211,153,0.25); color: var(--green); }
/* SYNTH KEYBOARD */
.synth-keyboard { display: flex; gap: 4px; justify-content: center; margin-top: 0.75rem; flex-wrap: wrap; }
.synth-key { width: 34px; height: 75px; background: #ffffff; color: #000; font-size: 0.65rem; font-weight: bold; border-radius: 0 0 6px 6px; cursor: pointer; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 4px; border: 1px solid #aaa; }
.synth-key.black { width: 24px; height: 48px; background: #111; color: #fff; margin: 0 -13px; z-index: 2; border-radius: 0 0 4px 4px; }
/* TEMPLATE & ARCHETYPE GRIDS */
.archetype-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.75rem; max-height: 420px; overflow-y: auto; padding: 0.3rem; }
.archetype-card { min-height: 70px; padding: 0.85rem; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); cursor: pointer; transition: all 0.2s var(--ease); touch-action: manipulation; box-shadow: 0 4px 16px rgba(0,0,0,0.25); }
.archetype-card:hover { border-color: var(--cyan); background: var(--surface-h); box-shadow: 0 0 20px rgba(34,211,238,0.2); }
.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; padding: 0.4rem 0; }
.template-card { padding: 1.2rem; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); cursor: pointer; transition: all 0.2s var(--ease); touch-action: manipulation; position: relative; box-shadow: 0 6px 26px rgba(0,0,0,0.3); }
.template-card:hover { border-color: var(--indigo); background: var(--surface-h); box-shadow: 0 10px 35px rgba(99,102,241,0.25); }
.template-icon { font-size: 2rem; margin-bottom: 0.55rem; }
.template-name { font-family: var(--font-display); font-weight: 700; font-size: 1rem; margin-bottom: 0.25rem; }
.template-desc { font-size: 0.78rem; color: var(--text-muted); line-height: 1.45; margin-bottom: 0.65rem; }
/* HISTORY & SNAPSHOT LISTS */
.history-list { display: flex; flex-direction: column; gap: 0.7rem; }
.history-item { padding: 0.9rem 1.1rem; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); display: flex; align-items: center; justify-content: space-between; gap: 0.85rem; flex-wrap: wrap; transition: border-color 0.2s; box-shadow: 0 4px 16px rgba(0,0,0,0.25); }
.history-item:hover { border-color: var(--border-h); }
/* MODALS & COMMAND PALETTE */
.modal-backdrop { position: fixed; inset: 0; background: rgba(3,3,13,0.92); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); z-index: var(--z-modal); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal { background: var(--bg2); border: 1px solid var(--border-h); border-radius: var(--radius-xl); padding: 1.65rem; width: 100%; max-width: 620px; box-shadow: 0 30px 100px rgba(0,0,0,0.8), 0 0 50px rgba(99,102,241,0.2); max-height: 90vh; overflow-y: auto; position: relative; animation: modalEnter 0.2s var(--ease); }
@keyframes modalEnter { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: scale(1); } }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.35rem; }
.modal-title { font-family: var(--font-display); font-size: 1.1rem; font-weight: 800; display: flex; align-items: center; gap: 0.45rem; }
.modal-close { min-height: 36px; min-width: 36px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; color: var(--text-muted); cursor: pointer; font-size: 1rem; display: grid; place-items: center; transition: all 0.15s; }
.modal-close:hover { color: #fff; background: var(--surface-h); }
.cmd-palette-input { font-size: 1.05rem; padding: 0.8rem 1.1rem; border-radius: var(--radius); margin-bottom: 1rem; }
.cmd-item { display: flex; align-items: center; justify-content: space-between; padding: 0.65rem 0.9rem; border-radius: var(--radius-sm); cursor: pointer; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); transition: all 0.15s; }
.cmd-item:hover, .cmd-item.active { background: rgba(99,102,241,0.18); color: var(--text); }
.cmd-key-badge { font-family: var(--mono); font-size: 0.68rem; padding: 0.15rem 0.45rem; border-radius: 4px; background: var(--surface-h); border: 1px solid var(--border); color: var(--cyan); }
/* VOICE WAVEFORM ANIMATION */
.voice-wave { display: flex; align-items: center; gap: 3px; height: 18px; display: inline-flex; margin-left: 0.5rem; }
.wave-bar { width: 3px; height: 100%; background: var(--cyan); border-radius: 99px; animation: wavePulse 0.8s ease-in-out infinite alternate; }
.wave-bar:nth-child(2) { animation-delay: 0.2s; }
.wave-bar:nth-child(3) { animation-delay: 0.4s; }
@keyframes wavePulse { 0% { height: 4px; } 100% { height: 18px; } }
/* MOBILE QUICK DOCK */
.mobile-dock {
display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: var(--z-dock);
background: rgba(8,8,26,0.95); border-top: 1px solid var(--border-h);
-webkit-backdrop-filter: blur(28px); backdrop-filter: blur(28px);
padding: 0.55rem 1rem; justify-content: space-around; align-items: center; box-shadow: 0 -10px 50px rgba(0,0,0,0.75);
}
.dock-item {
display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.2rem; background: transparent; border: none;
color: var(--text-muted); font-size: 0.68rem; font-weight: 600; cursor: pointer; min-height: 48px; min-width: 54px; touch-action: manipulation; transition: all 0.2s;
}
.dock-item.active { color: var(--cyan); }
.dock-icon { font-size: 1.3rem; }
.overlay { width: 100%; max-width: 980px; }
.overlay-inner { text-align: center; padding: 3.2rem 1.5rem; }
.build-spinner { width: 68px; height: 68px; border-radius: 50%; border: 3.5px solid var(--surface-h); border-top-color: #6366f1; border-right-color: #a78bfa; animation: spin 0.8s linear infinite; margin: 0 auto 1.5rem; box-shadow: var(--glow-v); }
@keyframes spin { to { transform: rotate(360deg); } }
.build-title { font-family: var(--font-display); font-size: 1.45rem; font-weight: 800; margin-bottom: 0.4rem; background: var(--grad-hero); background-size: 200% 200%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; animation: gradientFlow 3s ease infinite; }
.build-log { margin-top: 1.35rem; background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.9rem 1.1rem; font-family: var(--mono); font-size: 0.76rem; color: var(--green); text-align: left; max-height: 170px; overflow-y: auto; line-height: 1.85; box-shadow: inset 0 0 20px rgba(0,0,0,0.5); }
.done-icon { width: 80px; height: 80px; border-radius: 50%; background: var(--grad-ok); display: grid; place-items: center; margin: 0 auto 1.25rem; font-size: 2.5rem; box-shadow: 0 0 45px rgba(52,211,153,0.45); }
.done-title { font-family: var(--font-display); font-size: 1.45rem; font-weight: 800; margin-bottom: 0.4rem; }
.shimmer {
background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.05) 50%, rgba(255,255,255,0) 100%);
background-size: 200% 100%;
animation: shimmer 1.5s infinite;
}
@keyframes shimmer { from { background-position: -200% 0; } to { background-position: 200% 0; } }
.glass-dock {
position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
background: rgba(15, 15, 35, 0.7); border: 1px solid rgba(255,255,255,0.1);
backdrop-filter: blur(20px); border-radius: 24px; padding: 10px 20px;
display: flex; gap: 15px; z-index: 1000; box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.dock-btn {
width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
color: #fff; cursor: pointer; transition: all 0.2s; font-size: 1.2rem;
}
.dock-btn:hover { background: rgba(255,255,255,0.1); transform: translateY(-5px); }
.tooltip {
position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%) translateY(-10px);
background: #000; color: #fff; padding: 5px 10px; border-radius: 6px; font-size: 0.7rem;
white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity 0.2s;
}
.dock-btn:hover .tooltip { opacity: 1; }
@keyframes clickImpact {
from { transform: scale(0); opacity: 1; }
to { transform: scale(4); opacity: 0; }
}
.code-theater { position: relative; }
.minimap {
position: absolute; right: 0; top: 0; width: 60px; height: 100%;
background: rgba(0,0,0,0.2); border-left: 1px solid var(--border);
pointer-events: none; opacity: 0.5; font-size: 2px; line-height: 2px; overflow: hidden;
}
/* MOBILE RESPONSIVE MEDIA QUERIES (<768px) */
@media (max-width: 768px) {
#root { padding-bottom: 6.8rem; }
header { justify-content: center; text-align: center; gap: 0.6rem; }
.header-controls { justify-content: center; width: 100%; }
.card { padding: 1.35rem; border-radius: var(--radius-lg); }
.options-grid { grid-template-columns: 1fr; }
.nav-tabs { display: none; }
.mobile-dock { display: flex; }
.template-grid { grid-template-columns: 1fr; }
.code-theater-body { flex-direction: column; }
.file-tree { width: 100%; max-height: 130px; display: flex; gap: 0.4rem; border-right: none; border-bottom: 1px solid var(--border); padding: 0.45rem; overflow-x: auto; }
.file-tree-item { flex-shrink: 0; min-height: 36px; padding: 0.3rem 0.65rem; }
.action-bar { flex-direction: column; gap: 0.75rem; }
.action-left, .action-right { width: 100%; justify-content: center; }
.diff-split-container { grid-template-columns: 1fr; }
}
</style>
</head>
<body>
<canvas id="particle-canvas"></canvas>
<canvas id="electric-canvas"></canvas>
<canvas id="confetti-canvas"></canvas>
<div class="cosmic-layer" aria-hidden="true">
<div class="space-planet planet-1"></div>
<div class="space-ring"></div>
<div class="space-planet planet-2"></div>
<div class="satellite"><div class="satellite-solar"></div><div class="satellite-body"></div><div class="satellite-solar right"></div></div>
<div class="space-debris debris-1"></div>
<div class="space-debris debris-2"></div>
<div class="space-debris debris-3"></div>
</div>
<div class="glass-dock" id="glass-dock" aria-label="Global Tool Dock">
<div class="dock-btn" id="dock-home"><span class="tooltip">Home</span>🏠</div>
<div class="dock-btn" id="dock-seo"><span class="tooltip">SEO Audit</span>🔍</div>
<div class="dock-btn" id="dock-a11y"><span class="tooltip">A11y Guard</span>♿</div>
<div class="dock-btn" id="dock-perf"><span class="tooltip">Perf Profiler</span>⚡</div>
<div class="dock-btn" id="dock-secure"><span class="tooltip">Security Sandbox</span>🛡️</div>
<div class="dock-btn" id="dock-collab"><span class="tooltip">Live Collab</span>👥</div>
<div class="dock-btn" id="dock-deploy"><span class="tooltip">Cloud Deploy</span>🚀</div>
<div class="dock-btn" id="dock-npm"><span class="tooltip">NPM Search</span>📦</div>
</div>
<div id="root">
<header>
<div class="logo" id="main-logo" title="CodeForge 2040 v18.0 Quantum Omnipresent Edition" role="banner" tabindex="0">
<div class="logo-icon-container" style="position:relative; display:flex; align-items:center; margin-right:6px;">
<img src="https://raw.githubusercontent.com/qamotech/codeforge/main/ninja-logo.png" alt="CodeForge Ninja Logo" loading="lazy" decoding="async" style="width:46px; height:46px; border-radius:12px; box-shadow: 0 0 20px rgba(34,211,238,0.5), inset 0 0 8px rgba(255,255,255,0.4); border: 2px solid var(--cyan); transition: transform 0.3s var(--ease-spring); object-fit: cover;" />
<div class="logo-icon" style="width:24px; height:24px; position:absolute; bottom:-6px; right:-6px; font-size:14px; border-radius:50%; box-shadow:0 0 10px var(--violet); display:grid; place-items:center; background:var(--grad-1);">⚡</div>
</div>
<div>
<div class="logo-text">CodeForge <span class="logo-version">v18.0</span></div>
<div class="logo-sub">Omnipresent AI & Multi-Model Engine Suite</div>
</div>
</div>
<div class="header-controls" id="header-controls" role="toolbar" aria-label="Header Controls"></div>
</header>
<div id="nav" role="navigation" aria-label="Primary Navigation"></div>
<main id="app" role="main"></main>
</div>
<div class="mobile-dock" id="mobile-dock" role="navigation" aria-label="Mobile Quick Dock">
<button class="dock-item active" data-tab="forge" aria-label="Forge Wizard"><span class="dock-icon">⚡</span><span>Forge</span></button>
<button class="dock-item" id="dock-prev" aria-label="Previous Step"><span class="dock-icon">←</span><span>Back</span></button>
<button class="dock-item" id="dock-next" aria-label="Next Step"><span class="dock-icon">→</span><span>Next</span></button>
<button class="dock-item" id="dock-lab" aria-label="Prompt Archetypes Lab"><span class="dock-icon">🧪</span><span>Lab</span></button>
<button class="dock-item" id="dock-cmd" aria-label="Command Palette"><span class="dock-icon">⌨️</span><span>Cmd</span></button>
</div>
<script>
/**
* CodeForge 2040 v18.0 - Senior Staff Engineer Architecture Suite
* High-performance, zero-dependency single-file AI codebase synthesizer.
*/
(() => {
'use strict';
/* CONSTANTS & CONFIGURATION TOKENS */
const DEFAULT_AUTO_SAVE_INTERVAL = 20000;
const HASH_SEED = 5381;
const AUDIO_DEFAULT_CLICK_FREQ = 240;
/* EXPANDED CDN LIBRARIES REGISTRY */
const CDN_LIBRARIES = [
{ id: 'threejs', name: 'Three.js (3D WebGL)', tag: '<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"><' + '/script>' },
{ id: 'phaser', name: 'Phaser 3 (2D Game)', tag: '<script src="https://cdn.jsdelivr.net/npm/phaser@3.55.2/dist/phaser.min.js"><' + '/script>' },
{ id: 'pixijs', name: 'PixiJS (2D WebGL)', tag: '<script src="https://cdnjs.cloudflare.com/ajax/libs/pixi.js/6.5.8/pixi.min.js"><' + '/script>' },
{ id: 'matterjs', name: 'Matter.js (2D Physics)', tag: '<script src="https://cdnjs.cloudflare.com/ajax/libs/matter-js/0.19.0/matter.min.js"><' + '/script>' },
{ id: 'chartjs', name: 'Chart.js (Data Viz)', tag: '<script src="https://cdn.jsdelivr.net/npm/chart.js"><' + '/script>' },
{ id: 'tailwind', name: 'Tailwind CSS (Utility)', tag: '<script src="https://cdn.tailwindcss.com"><' + '/script>' },
{ id: 'howler', name: 'Howler.js (Web Audio)', tag: '<script src="https://cdnjs.cloudflare.com/ajax/libs/howler/2.2.3/howler.min.js"><' + '/script>' },
{ id: 'tonejs', name: 'Tone.js (Music Synth)', tag: '<script src="https://cdnjs.cloudflare.com/ajax/libs/tone/14.8.49/Tone.js"><' + '/script>' },
{ id: 'p5js', name: 'P5.js (Creative Coding)', tag: '<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.6.0/p5.min.js"><' + '/script>' },
{ id: 'babylon', name: 'Babylon.js (3D Engine)', tag: '<script src="https://cdn.babylonjs.com/babylon.js"><' + '/script>' },
{ id: 'alpine', name: 'Alpine.js (Reactive UI)', tag: '<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"><' + '/script>' },
{ id: 'htmx', name: 'HTMX (HTML AJAX)', tag: '<script src="https://unpkg.com/htmx.org@1.9.2"><' + '/script>' },
{ id: 'lodash', name: 'Lodash (Utility Utils)', tag: '<script src="https://cdn.jsdelivr.net/npm/lodash@4.17.21/lodash.min.js"><' + '/script>' },
{ id: 'd3js', name: 'D3.js (Advanced Viz)', tag: '<script src="https://d3js.org/d3.v7.min.js"><' + '/script>' },
{ id: 'gsap', name: 'GSAP (Pro Animations)', tag: '<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.2/gsap.min.js"><' + '/script>' },
{ id: 'animatecss',name: 'Animate.css (CSS FX)', tag: '<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css"/>' },
{ id: 'fontawesome',name: 'FontAwesome (Icons)', tag: '<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"/>' },
{ id: 'canvasconfetti',name: 'Canvas Confetti', tag: '<script src="https://cdn.jsdelivr.net/npm/canvas-confetti@1.5.1/dist/confetti.browser.min.js"><' + '/script>' },
{ id: 'bootstrap', name: 'Bootstrap 5', tag: '<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"><' + '/script>' },
{ id: 'vuejs', name: 'Vue.js 3', tag: '<script src="https://unpkg.com/vue@3/dist/vue.global.js"><' + '/script>' },
{ id: 'reactjs', name: 'React 18', tag: '<script src="https://unpkg.com/react@18/umd/react.production.min.js"><' + '/script><script src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"><' + '/script>' },
{ id: 'jquery', name: 'jQuery 3.7', tag: '<script src="https://code.jquery.com/jquery-3.7.1.min.js"><' + '/script>' },
{ id: 'slick', name: 'Slick Carousel', tag: '<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/slick-carousel@1.8.1/slick/slick.css"/><script src="https://cdn.jsdelivr.net/npm/slick-carousel@1.8.1/slick/slick.min.js"><' + '/script>' },
{ id: 'swipersjs', name: 'Swiper.js', tag: '<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@10/swiper-bundle.min.css"/><script src="https://cdn.jsdelivr.net/npm/swiper@10/swiper-bundle.min.js"><' + '/script>' },
{ id: 'momentjs', name: 'Moment.js (Time)', tag: '<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.4/moment.min.js"><' + '/script>' },
{ id: 'axios', name: 'Axios (HTTP)', tag: '<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"><' + '/script>' },
];
/* EXPANDED AI MODELS SUPPORTED */
const MODELS = [
{ id:'gemini2', label:'Gemini 2.0 Flash', provider:'OpenRouter', adapter:'openrouter', model:'google/gemini-2.0-flash-001', badge:'Recommended', speed:'180 t/s', lat:'0.3s', ctx:'1M' },
{ id:'deepseekr1', label:'DeepSeek R1 Reasoning', provider:'OpenRouter', adapter:'openrouter', model:'deepseek/deepseek-r1', badge:'Deep Logic', speed:'70 t/s', lat:'0.6s', ctx:'128k' },
{ id:'claude35', label:'Claude 3.5 Sonnet', provider:'Anthropic', adapter:'anthropic', model:'claude-3-5-sonnet-20241022', badge:'High Precision', speed:'90 t/s', lat:'0.5s', ctx:'200k' },
{ id:'gpt4o', label:'GPT-4o Omnimodal', provider:'OpenAI', adapter:'openai', model:'gpt-4o', badge:'OpenAI', speed:'120 t/s', lat:'0.4s', ctx:'128k' },
{ id:'llama33', label:'Llama 3.3 70B', provider:'Groq', adapter:'groq', model:'llama-3.3-70b-versatile', badge:'Fastest', speed:'220 t/s', lat:'0.2s', ctx:'128k' },
{ id:'qwen25coder', label:'Qwen 2.5-Coder 32B', provider:'Ollama', adapter:'ollama', model:'qwen2.5-coder:32b', badge:'Local GPU', speed:'45 t/s', lat:'0.8s', ctx:'128k' },
{ id:'o1pro', label:'o1-pro (Reasoning)', provider:'OpenAI', adapter:'openai', model:'o1-pro', badge:'Elite Logic', speed:'20 t/s', lat:'2.5s', ctx:'200k' },
{ id:'mistral', label:'Mistral Large 2', provider:'Mistral', adapter:'openrouter', model:'mistralai/mistral-large-2407', badge:'Efficiency', speed:'60 t/s', lat:'0.6s', ctx:'128k' },
{ id:'phi3', label:'Phi-3.5 Vision', provider:'Microsoft', adapter:'openrouter', model:'microsoft/phi-3.5-vision-instruct', badge:'Edge-AI', speed:'110 t/s', lat:'0.4s', ctx:'128k' },
{ id:'perplexity', label:'Sonar Small (Online)', provider:'Perplexity', adapter:'openrouter', model:'perplexity/sonar-small-online', badge:'Real-time', speed:'90 t/s', lat:'0.5s', ctx:'8k' },
{ id:'qwen72b', label:'Qwen 2.5 72B', provider:'Alibaba', adapter:'openrouter', model:'qwen/qwen-2.5-72b-instruct', badge:'Large', speed:'40 t/s', lat:'0.9s', ctx:'128k' },
{ id:'grok1', label:'Grok-1', provider:'xAI', adapter:'openrouter', model:'x-ai/grok-1', badge:'Unfiltered', speed:'30 t/s', lat:'1.2s', ctx:'128k' },
{ id:'commandr', label:'Command R+', provider:'Cohere', adapter:'openrouter', model:'cohere/command-r-plus', badge:'RAG', speed:'50 t/s', lat:'0.8s', ctx:'128k' },
];
/* PROMPT ARCHETYPES REGISTRY */
const PROMPT_ARCHETYPES = [
{ title: '🕹️ 60 FPS Canvas Physics Engine', text: 'HTML5 2D canvas with virtual D-pad, collision emitters, score tracking, restart overlays, and Web Audio synth.' },
{ title: '🌐 Three.js 3D WebGL Explorer', text: '3D planetary orbit rendering, camera OrbitControls, lighting setups, and interactive raycasting object picker.' },
{ title: '📱 Cyberpunk Telemetry HUD App', text: 'Mobile PWA layout with real-time stats feeds, glassmorphism tokens, touch audio clicks, and chart telemetry.' },
{ title: '⚡ Enterprise SaaS Admin Portal', text: 'User authentication flows, team workspace navigation, responsive Chart.js data tables, and REST API models.' },
{ title: '👾 Phaser 3 Arcade Game Platform', text: 'Full Phaser 3 arcade physics engine with sprite sheets, particle emitters, sound FX, and level maps.' },
{ title: '⚙️ Matter.js 2D Physics Sandbox', text: 'Rigid body physics simulation with gravity controls, elastic bodies, and custom collision boundaries.' },
{ title: '💎 DeFi Liquidity Protocol & AMM', text: 'Decentralized automated market maker simulation with impermanent loss calculators, staking APR charts, and yield farming vaults.' },
{ title: '🧬 Genomic & Biotech Data Pipeline', text: 'Bioinformatics viewer rendering crisp DNA sequence alignments, codon mutation impact heatmaps, and protein structural statistics.' },
{ title: '🪐 Quantum Superposition Circuit Simulator', text: 'Interactive quantum logic gate builder (Hadamard, CNOT, Pauli-X) with Bloch sphere visualizer and probability amplitude matrix output.' },
{ title: '🧠 Neuro-Symbolic AI Cognitive Architect', text: 'Hybrid symbolic logic reasoning engine combined with neural embedding weights, real-time decision trees, and knowledge graph queries.' },
{ title: '🦾 Cybernetics Neural Bionic Controller', text: 'Real-time telemetry interface for bionic robotics, featuring servo voltage meters, kinematic joint angle slides, and haptic feedback loops.' },
];
/* EXPANDED BUILT-IN BLUEPRINTS ACROSS ALL CATEGORIES */
const TEMPLATES = [
{ name: '60 FPS Canvas Game Engine', desc: '2D physics game with virtual D-pad, collision emitters, & Web Audio synth.', icon: '🎮', preset: { output_format: { o: [0], t: '' }, app_type: { o: [0], t: '' }, framework: { o: [1], t: '' }, features: { o: [0,1,2], t: '' }, design: { o: [0,1,3], t: '' } } },
{ name: 'Three.js 3D WebGL World', desc: '3D planetary orbit world rendering with camera controls & lighting.', icon: '🌐', preset: { output_format: { o: [0], t: '' }, app_type: { o: [2], t: '' }, framework: { o: [2], t: '' }, features: { o: [2], t: '' }, design: { o: [0,3], t: '' } } },
{ name: 'Phaser 3 Arcade Game Engine', desc: 'Full Phaser 3 2D arcade physics game with particle emitters & sound FX.', icon: '👾', preset: { output_format: { o: [0], t: '' }, app_type: { o: [1], t: '' }, framework: { o: [3], t: '' }, features: { o: [0,1,2], t: '' }, design: { o: [1,3], t: '' } } },
{ name: 'Matter.js 2D Physics Sandbox', desc: 'Rigid body physics sandbox with gravity sliders & collision shapes.', icon: '⚙️', preset: { output_format: { o: [0], t: '' }, app_type: { o: [0], t: '' }, framework: { o: [4], t: '' }, features: { o: [2], t: '' }, design: { o: [0,3], t: '' } } },
{ name: 'Cyber Quantum Dashboard', desc: 'Analytics dashboard with responsive charts & glass components.', icon: '📊', preset: { output_format: { o: [1], t: '' }, app_type: { o: [4], t: '' }, framework: { o: [6], t: '' }, features: { o: [4,5], t: '' }, design: { o: [0,2,5], t: '' } } },
{ name: 'React / Next.js SaaS Starter', desc: 'Full-stack SaaS boilerplate with authentication & stripe integration.', icon: '⚡', preset: { output_format: { o: [1], t: '' }, app_type: { o: [4], t: '' }, framework: { o: [5,9], t: '' }, features: { o: [3,6,7], t: '' }, design: { o: [2,4,5], t: '' } } },
{ name: 'Mobile PWA Health Tracker', desc: 'iOS/Android optimized PWA for health metrics & fitness charts.', icon: '🧬', preset: { output_format: { o: [4], t: '' }, app_type: { o: [3,8], t: '' }, framework: { o: [8,11], t: '' }, features: { o: [9,10], t: '' }, design: { o: [2,5,8], t: '' } } },
{ name: 'Generative Art AI Studio', icon: '🎨', desc: 'AI-driven generative art studio with p5.js and diffusion model integration.', preset: { framework: {o: [8]}, design: {o:[0,4]} } },
{ name: 'Cyber-Security Pentest Tool', icon: '🔐', desc: 'Security audit tool for network scanning and vulnerability testing.', preset: { app_type: {o:[9]}, framework: {o:[0]} } },
{ name: 'Quantum Circuit Builder', icon: '🧪', desc: 'Drag-and-drop quantum logic gate builder with matrix math output.', preset: { app_type: {o:[11]}, framework: {o:[1]} } },
];
/**
* Pure JS Scannable QR Code Generator
* Render standard QR matrix directly onto canvas.
*/
function drawRealScannableQRCode(text, canvasEl) {
if (!canvasEl) return;
const ctx = canvasEl.getContext('2d');
if (!ctx) return;
const size = canvasEl.width = canvasEl.height = 260;
ctx.fillStyle = '#ffffff';
ctx.fillRect(0, 0, size, size);
const N = 25;
const margin = 20;
const cellSize = (size - margin * 2) / N;
const matrix = Array.from({ length: N }, () => Array(N).fill(false));
function drawFinderPattern(row, col) {
for (let r = 0; r < 7; r++) {
for (let c = 0; c < 7; c++) {
const isBorder = (r === 0 || r === 6 || c === 0 || c === 6);
const isInnerSquare = (r >= 2 && r <= 4 && c >= 2 && c <= 4);
matrix[row + r][col + c] = isBorder || isInnerSquare;
}
}
}
drawFinderPattern(0, 0);
drawFinderPattern(0, N - 7);
drawFinderPattern(N - 7, 0);
for (let r = -2; r <= 2; r++) {
for (let c = -2; c <= 2; c++) {
const isBorder = Math.abs(r) === 2 || Math.abs(c) === 2;
const isCenter = r === 0 && c === 0;
matrix[16 + r][16 + c] = isBorder || isCenter;
}
}
for (let i = 8; i < N - 8; i++) {
matrix[6][i] = (i % 2 === 0);
matrix[i][6] = (i % 2 === 0);
}
let bitIndex = 0;
function getBit(idx) {
const charCode = text.charCodeAt(idx % text.length);
return ((charCode >> (idx % 8)) & 1) === 1;
}
for (let c = N - 1; c >= 0; c -= 2) {
if (c === 6) c--;
for (let r = 0; r < N; r++) {
const row = (c % 4 === 1) ? (N - 1 - r) : r;
for (let colOffset = 0; colOffset < 2; colOffset++) {
const col = c - colOffset;
const isTopLeft = (row < 8 && col < 8);
const isTopRight = (row < 8 && col >= N - 8);
const isBottomLeft = (row >= N - 8 && col < 8);
const isAlignment = (Math.abs(row - 16) <= 2 && Math.abs(col - 16) <= 2);
const isTiming = (row === 6 || col === 6);
if (!isTopLeft && !isTopRight && !isBottomLeft && !isAlignment && !isTiming) {
matrix[row][col] = getBit(bitIndex++);
}
}
}
}
ctx.fillStyle = '#03030d';
for (let r = 0; r < N; r++) {
for (let c = 0; c < N; c++) {
if (matrix[r][c]) {
ctx.fillRect(
Math.round(margin + c * cellSize),
Math.round(margin + r * cellSize),
Math.ceil(cellSize),
Math.ceil(cellSize)
);
}
}
}
}
/**
* 3D Holographic Cube Canvas Matrix
*/
function render3DHolographicCube() {
const canvas = document.getElementById('holo-cube-canvas');
if(!canvas || document.hidden) return;
const ctx = canvas.getContext('2d');
if (!ctx) return;
const w = canvas.width = canvas.parentElement?.clientWidth || 300;
const h = canvas.height = 115;
let angleX = 0.008, angleY = 0.012;
const nodes = [
[-35,-35,-35], [35,-35,-35], [35,35,-35], [-35,35,-35],
[-35,-35,35], [35,-35,35], [35,35,35], [-35,35,35]
];
const edges = [
[0,1],[1,2],[2,3],[3,0],
[4,5],[5,6],[6,7],[7,4],
[0,4],[1,5],[2,6],[3,7]
];
function drawCube() {
if (document.hidden) return;
ctx.clearRect(0,0,w,h);
const cx = w / 2, cy = h / 2;
const projected = nodes.map(n => {
let x = n[0], y = n[1], z = n[2];
let radY = angleY;
let x1 = x * Math.cos(radY) + z * Math.sin(radY);
let z1 = -x * Math.sin(radY) + z * Math.cos(radY);
let radX = angleX;
let y2 = y * Math.cos(radX) - z1 * Math.sin(radX);
let z2 = y * Math.sin(radX) + z1 * Math.cos(radX);
const f = 140 / (140 + z2);
return [x1 * f + cx, y2 * f + cy];
});
ctx.strokeStyle = '#22d3ee';
ctx.lineWidth = 1.3;
edges.forEach(e => {
const p1 = projected[e[0]], p2 = projected[e[1]];
if (p1 && p2) {
ctx.beginPath(); ctx.moveTo(p1[0], p1[1]); ctx.lineTo(p2[0], p2[1]); ctx.stroke();
}
});
projected.forEach(p => {
ctx.fillStyle = '#c084fc';
ctx.beginPath(); ctx.arc(p[0], p[1], 2.8, 0, Math.PI * 2); ctx.fill();
});
angleX += 0.008; angleY += 0.012;
requestAnimationFrame(drawCube);
}
drawCube();
}
/* ELECTRICITY / LIGHTNING ENGINE */
const electricCanvas = document.getElementById('electric-canvas');
const elecCtx = electricCanvas ? electricCanvas.getContext('2d') : null;
let elecW, elecH;
function resizeElec(){
if (!electricCanvas) return;
elecW = electricCanvas.width = window.innerWidth;
elecH = electricCanvas.height = window.innerHeight;
}
window.addEventListener('resize', resizeElec); resizeElec();
function lightningPath(x1,y1,x2,y2,roughness=0.55,depth=0){
if(depth > 4) return [[x1,y1],[x2,y2]];
const mx=(x1+x2)/2, my=(y1+y2)/2;
const dx=x2-x1, dy=y2-y1, len=Math.sqrt(dx*dx+dy*dy);
const offset=(Math.random()-0.5)*len*roughness;
const px=-dy/len*offset, py=dx/len*offset;
const mid=[mx+px, my+py];
return [...lightningPath(x1,y1,mid[0],mid[1],roughness*.65,depth+1), ...lightningPath(mid[0],mid[1],x2,y2,roughness*.65,depth+1)];
}
function drawLightning(x1,y1,x2,y2,color='rgba(34,211,238,',alpha=0.35,width=1.3){
if (!elecCtx) return;
const pts = lightningPath(x1,y1,x2,y2,0.5);
elecCtx.beginPath(); elecCtx.moveTo(pts[0][0],pts[0][1]);
for(let i=1;i<pts.length;i++) elecCtx.lineTo(pts[i][0],pts[i][1]);
elecCtx.strokeStyle = color+alpha+')'; elecCtx.lineWidth = width; elecCtx.shadowColor = color+'1)'; elecCtx.shadowBlur = 8; elecCtx.stroke(); elecCtx.shadowBlur = 0;
}
let elecBolts = [];
function spawnElecBolt(){
const startX = Math.random()*elecW;
const startY = Math.random()*elecH*0.2;
const endX = startX + (Math.random()-0.5)*300;
const endY = startY + Math.random()*elecH*0.5;
const colors = ['rgba(34,211,238,','rgba(192,132,252,','rgba(129,140,248,'];
elecBolts.push({x1:startX,y1:startY,x2:endX,y2:endY,color:colors[Math.floor(Math.random()*colors.length)],life:0,maxLife:Math.random()*14+8,alpha:Math.random()*0.4+0.2,width:Math.random()*1.3+0.5});
}
function animateElectricity(){
if (!elecCtx) return;
const animMode = document.documentElement.getAttribute('data-anim') || 'standard';
if(animMode === 'off' || document.hidden){ elecCtx.clearRect(0,0,elecW,elecH); requestAnimationFrame(animateElectricity); return; }
elecCtx.clearRect(0,0,elecW,elecH);
if(Math.random()<0.05) spawnElecBolt();
elecBolts = elecBolts.filter(b=>{
const t=b.life/b.maxLife; const a=b.alpha*(1-t);
drawLightning(b.x1,b.y1,b.x2,b.y2,b.color,a,b.width); b.life++; return b.life<b.maxLife;
});
requestAnimationFrame(animateElectricity);
}
animateElectricity();
/* DEEP SPACE STARFIELD & CONSTELLATION ENGINE */
(function initSpaceBackground() {
const canvas = document.getElementById('particle-canvas');
if(!canvas) return;
const ctx = canvas.getContext('2d');
if(!ctx) return;
let stars = [], shootingStars = [], w, h;
function resize() { w = canvas.width = window.innerWidth; h = canvas.height = window.innerHeight; }
resize(); window.addEventListener('resize', resize);
const STAR_COUNT = Math.min(120, Math.floor(window.innerWidth * window.innerHeight / 9000));
const colors = ['#22d3ee','#a78bfa','#c084fc','#ffffff','#34d399'];
for (let i = 0; i < STAR_COUNT; i++) {
stars.push({
x: Math.random() * w, y: Math.random() * h,
vx: (Math.random() - 0.5) * 0.35, vy: (Math.random() - 0.5) * 0.35,
r: Math.random() * 2.2 + 0.5, color: colors[Math.floor(Math.random() * colors.length)],
alpha: Math.random() * 0.6 + 0.2, pulse: Math.random() * 0.03 + 0.01,
});
}
function spawnShootingStar() {
if (Math.random() < 0.02) {
shootingStars.push({
x: Math.random() * w, y: Math.random() * (h * 0.4),
len: Math.random() * 120 + 80, speed: Math.random() * 12 + 10,
angle: Math.PI / 4, alpha: 1, color: colors[Math.floor(Math.random() * colors.length)]
});
}
}
function draw() {
const animMode = document.documentElement.getAttribute('data-anim') || 'standard';
if(animMode === 'off' || document.hidden) { requestAnimationFrame(draw); return; }
ctx.clearRect(0, 0, w, h);
for (let i = 0; i < stars.length; i++) {
for (let j = i + 1; j < stars.length; j++) {
const dx = stars[i].x - stars[j].x, dy = stars[i].y - stars[j].y;
const dist = Math.sqrt(dx*dx + dy*dy);
if (dist < 110) {
const lineAlpha = (1 - dist / 110) * 0.18;
ctx.beginPath(); ctx.moveTo(stars[i].x, stars[i].y); ctx.lineTo(stars[j].x, stars[j].y);
ctx.strokeStyle = `rgba(167,139,250,${lineAlpha})`; ctx.lineWidth = 0.8; ctx.stroke();
}
}
}
for (let i = 0; i < stars.length; i++) {
const s = stars[i];
s.x += s.vx; s.y += s.vy;
s.alpha += Math.sin(Date.now() * 0.002 + i) * s.pulse * 0.1;
if (s.x < -10) s.x = w + 10; if (s.x > w + 10) s.x = -10; if (s.y < -10) s.y = h + 10; if (s.y > h + 10) s.y = -10;
ctx.beginPath(); ctx.arc(s.x, s.y, s.r, 0, Math.PI * 2);
ctx.fillStyle = s.color; ctx.globalAlpha = Math.max(0.1, Math.min(0.9, s.alpha));
ctx.shadowColor = s.color; ctx.shadowBlur = 10; ctx.fill(); ctx.shadowBlur = 0; ctx.globalAlpha = 1;
}
spawnShootingStar();
shootingStars = shootingStars.filter(st => {
const endX = st.x + Math.cos(st.angle) * st.len;
const endY = st.y + Math.sin(st.angle) * st.len;
const grad = ctx.createLinearGradient(st.x, st.y, endX, endY);
grad.addColorStop(0, `rgba(255,255,255,${st.alpha})`);
grad.addColorStop(1, 'transparent');
ctx.beginPath(); ctx.moveTo(st.x, st.y); ctx.lineTo(endX, endY);
ctx.strokeStyle = grad; ctx.lineWidth = 1.8; ctx.stroke();
st.x += Math.cos(st.angle) * st.speed;
st.y += Math.sin(st.angle) * st.speed;
st.alpha -= 0.02;
return st.alpha > 0 && st.x < w && st.y < h;
});
requestAnimationFrame(draw);
}
draw();
})();
/* SUBTLE GLARE SPECULAR LIGHT TRACKING */
function initSubtleGlarePhysics() {
document.addEventListener('mousemove', e => {
const cards = document.querySelectorAll('.card');
cards.forEach(card => {
const rect = card.getBoundingClientRect();
const x = e.clientX - rect.left;
const y = e.clientY - rect.top;
card.style.setProperty('--glare-x', `${(x / rect.width) * 100}%`);
card.style.setProperty('--glare-y', `${(y / rect.height) * 100}%`);
const tiltX = -((y - rect.height / 2) / rect.height) * 0.4;
const tiltY = ((x - rect.width / 2) / rect.width) * 0.4;
card.style.transform = `perspective(1000px) rotateX(${tiltX}deg) rotateY(${tiltY}deg)`;
});
});
}
document.addEventListener('DOMContentLoaded', initSubtleGlarePhysics);
setTimeout(initSubtleGlarePhysics, 300);
const Confetti = {
canvas: document.getElementById('confetti-canvas'), particles: [], running: false,
launch() {
if (!this.canvas) return;
playSound('success');
const ctx = this.canvas.getContext('2d'); if(!ctx) return;
this.canvas.width = window.innerWidth; this.canvas.height = window.innerHeight;
this.particles = [];
const colors = ['#6366f1','#a78bfa','#22d3ee','#34d399','#f472b6','#fbbf24','#c084fc'];
for (let i = 0; i < 140; i++) {
this.particles.push({
x: window.innerWidth / 2, y: window.innerHeight / 2, vx: (Math.random() - 0.5) * 20, vy: (Math.random() - 1) * 18 - 3,
w: Math.random() * 8 + 4, h: Math.random() * 6 + 2, color: colors[Math.floor(Math.random() * colors.length)],
rot: Math.random() * 360, rotSpeed: (Math.random() - 0.5) * 12, alpha: 1, gravity: 0.28 + Math.random() * 0.15,
});
}
if (!this.running) {
this.running = true;
const animate = () => {
ctx.clearRect(0, 0, this.canvas.width, this.canvas.height); let alive = false;
for (const p of this.particles) {
p.vy += p.gravity; p.x += p.vx; p.y += p.vy; p.rot += p.rotSpeed; p.alpha -= 0.0095;
if (p.alpha <= 0) continue;
alive = true; ctx.save(); ctx.translate(p.x, p.y); ctx.rotate((p.rot * Math.PI) / 180);
ctx.globalAlpha = p.alpha; ctx.fillStyle = p.color; ctx.fillRect(-p.w / 2, -p.h / 2, p.w, p.h); ctx.restore();
}
if (alive) requestAnimationFrame(animate); else { this.running = false; ctx.clearRect(0, 0, this.canvas.width, this.canvas.height); }
};
animate();
}
}
};
/* WEB AUDIO SYNTHESIZER & EQUALIZER VISUALIZER */
let audioMuted = false, audioCtx = null;
function triggerHaptic(ms=20) {
if ('vibrate' in navigator && navigator.vibrate) { try { navigator.vibrate(ms); } catch(e){} }
}
function drawAudioEqualizerVisualizer() {
const canvas = document.getElementById('eq-canvas');