File size: 50,090 Bytes
6c05018
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>RedForge - Advanced Forums</title>
  <script src="https://cdn.tailwindcss.com"></script>
  <script src="https://unpkg.com/lucide@latest"></script>
  <link href="https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;800;900&family=Rajdhani:wght@300;400;500;600;700&family=Share+Tech+Mono&display=swap" rel="stylesheet">
  <script>
    tailwind.config = {
      theme: {
        extend: {
          fontFamily: {
            orbitron: ['Orbitron', 'sans-serif'],
            rajdhani: ['Rajdhani', 'sans-serif'],
            mono: ['Share Tech Mono', 'monospace'],
          },
          colors: {
            redforge: {
              dark: '#0f0a0a',
              darker: '#080505',
              mid: '#1a0d0d',
              red: '#ef4444',
              lightred: '#f87171',
              crimson: '#dc2626',
              orange: '#f97316',
              card: '#160e0e',
              border: '#2d1515',
              ember: '#991b1b',
            }
          }
        }
      }
    }
  </script>
  <style>
    * { scrollbar-width: thin; scrollbar-color: #ef4444 #0f0a0a; }
    *::-webkit-scrollbar { width: 6px; }
    *::-webkit-scrollbar-track { background: #0f0a0a; }
    *::-webkit-scrollbar-thumb { background: #ef4444; border-radius: 3px; }

    body {
      background: #0f0a0a;
      font-family: 'Rajdhani', sans-serif;
      overflow-x: hidden;
    }

    .red-grid {
      background-image:
        linear-gradient(rgba(239, 68, 68, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(239, 68, 68, 0.03) 1px, transparent 1px);
      background-size: 50px 50px;
    }

    .glow-red {
      text-shadow: 0 0 10px rgba(239, 68, 68, 0.5), 0 0 40px rgba(239, 68, 68, 0.2);
    }

    .glow-red-strong {
      text-shadow: 0 0 10px rgba(239, 68, 68, 0.8), 0 0 30px rgba(239, 68, 68, 0.4), 0 0 60px rgba(239, 68, 68, 0.2);
    }

    .neon-border-red {
      border: 1px solid rgba(239, 68, 68, 0.3);
      box-shadow: 0 0 10px rgba(239, 68, 68, 0.1), inset 0 0 10px rgba(239, 68, 68, 0.05);
    }

    .neon-border-red:hover {
      border-color: rgba(239, 68, 68, 0.6);
      box-shadow: 0 0 20px rgba(239, 68, 68, 0.2), inset 0 0 15px rgba(239, 68, 68, 0.08);
    }

    .neon-btn-red {
      background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(153, 27, 27, 0.15));
      border: 1px solid rgba(239, 68, 68, 0.4);
      box-shadow: 0 0 15px rgba(239, 68, 68, 0.2), inset 0 0 15px rgba(239, 68, 68, 0.05);
      transition: all 0.3s ease;
    }

    .neon-btn-red:hover {
      background: linear-gradient(135deg, rgba(239, 68, 68, 0.25), rgba(153, 27, 27, 0.25));
      border-color: rgba(239, 68, 68, 0.8);
      box-shadow: 0 0 25px rgba(239, 68, 68, 0.4), inset 0 0 20px rgba(239, 68, 68, 0.1);
      transform: translateY(-1px);
    }

    .neon-btn-red:active {
      transform: translateY(0px);
    }

    .neon-btn-orange {
      background: linear-gradient(135deg, rgba(249, 115, 22, 0.15), rgba(154, 52, 18, 0.15));
      border: 1px solid rgba(249, 115, 22, 0.4);
      box-shadow: 0 0 15px rgba(249, 115, 22, 0.2), inset 0 0 15px rgba(249, 115, 22, 0.05);
      transition: all 0.3s ease;
    }

    .neon-btn-orange:hover {
      background: linear-gradient(135deg, rgba(249, 115, 22, 0.25), rgba(154, 52, 18, 0.25));
      border-color: rgba(249, 115, 22, 0.8);
      box-shadow: 0 0 25px rgba(249, 115, 22, 0.4), inset 0 0 20px rgba(249, 115, 22, 0.1);
      transform: translateY(-1px);
    }

    .red-card {
      background: linear-gradient(135deg, #160e0e, #1a0d0d);
      border: 1px solid rgba(239, 68, 68, 0.15);
      transition: all 0.4s ease;
    }

    .red-card:hover {
      border-color: rgba(239, 68, 68, 0.4);
      box-shadow: 0 0 30px rgba(239, 68, 68, 0.1), 0 4px 20px rgba(0, 0, 0, 0.3);
      transform: translateY(-2px);
    }

    .pulse-dot-red {
      animation: pulse-red 2s ease-in-out infinite;
    }

    @keyframes pulse-red {
      0%, 100% { opacity: 1; box-shadow: 0 0 5px rgba(239, 68, 68, 0.5); }
      50% { opacity: 0.5; box-shadow: 0 0 15px rgba(239, 68, 68, 0.8); }
    }

    .holo-line-red {
      background: linear-gradient(90deg, transparent, rgba(239, 68, 68, 0.3), rgba(249, 115, 22, 0.3), transparent);
      height: 1px;
    }

    .cyber-input:focus {
      border-color: rgba(239, 68, 68, 0.6);
      box-shadow: 0 0 15px rgba(239, 68, 68, 0.15), inset 0 0 10px rgba(239, 68, 68, 0.05);
      outline: none;
    }

    .scan-line-red::after {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 2px;
      background: linear-gradient(90deg, transparent, rgba(239, 68, 68, 0.4), transparent);
      animation: scan 4s linear infinite;
    }

    @keyframes scan {
      0% { top: 0; opacity: 0; }
      10% { opacity: 1; }
      90% { opacity: 1; }
      100% { top: 100%; opacity: 0; }
    }

    .particle-red {
      position: absolute;
      width: 2px;
      height: 2px;
      background: rgba(239, 68, 68, 0.6);
      border-radius: 50%;
      animation: float-particle linear infinite;
    }

    @keyframes float-particle {
      0% { transform: translateY(100vh) scale(0); opacity: 0; }
      10% { opacity: 1; }
      90% { opacity: 1; }
      100% { transform: translateY(-10vh) scale(1); opacity: 0; }
    }

    .fade-in {
      animation: fadeIn 0.5s ease-out;
    }

    @keyframes fadeIn {
      from { opacity: 0; transform: translateY(10px); }
      to { opacity: 1; transform: translateY(0); }
    }

    .hex-bg-red {
      background: radial-gradient(ellipse at center, rgba(239, 68, 68, 0.06) 0%, transparent 70%);
    }

    .toast-red {
      animation: slideInRight 0.4s ease-out, fadeOut 0.4s ease-in 2.6s forwards;
    }

    @keyframes slideInRight {
      from { transform: translateX(100%); opacity: 0; }
      to { transform: translateX(0); opacity: 1; }
    }

    @keyframes fadeOut {
      from { opacity: 1; }
      to { opacity: 0; }
    }

    .glitch-red {
      position: relative;
    }

    .glitch-red::before,
    .glitch-red::after {
      content: attr(data-text);
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
    }

    .glitch-red::before {
      animation: glitch-1 2s infinite linear alternate-reverse;
      clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
      color: #f97316;
    }

    .glitch-red::after {
      animation: glitch-2 3s infinite linear alternate-reverse;
      clip-path: polygon(0 60%, 100% 60%, 100% 100%, 0 100%);
      color: #ef4444;
    }

    @keyframes glitch-1 {
      0%, 95% { transform: translateX(0); }
      96% { transform: translateX(-3px); }
      97% { transform: translateX(3px); }
      98% { transform: translateX(-1px); }
      99% { transform: translateX(1px); }
      100% { transform: translateX(0); }
    }

    @keyframes glitch-2 {
      0%, 95% { transform: translateX(0); }
      96% { transform: translateX(2px); }
      97% { transform: translateX(-2px); }
      98% { transform: translateX(1px); }
      99% { transform: translateX(-1px); }
      100% { transform: translateX(0); }
    }

    .mobile-menu-red {
      transform: translateX(100%);
      transition: transform 0.3s ease;
    }

    .mobile-menu-red.open {
      transform: translateX(0);
    }

    /* Thread line for forum replies */
    .thread-line {
      border-left: 2px solid rgba(239, 68, 68, 0.2);
    }

    .thread-line:hover {
      border-left-color: rgba(239, 68, 68, 0.5);
    }

    /* Pin/badge glow */
    .pin-glow {
      filter: drop-shadow(0 0 4px rgba(249, 115, 22, 0.5));
    }
  </style>
</head>
<body class="red-grid min-h-screen text-white">

  <!-- Floating Particles -->
  <div id="particles-red" class="fixed inset-0 pointer-events-none z-0"></div>

  <!-- Toast Container -->
  <div id="toast-container-red" class="fixed top-4 right-4 z-50 flex flex-col gap-2"></div>

  <!-- Navigation -->
  <nav class="fixed top-0 left-0 right-0 z-40 bg-redforge-darker/80 backdrop-blur-xl border-b border-redforge-border">
    <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
      <div class="flex items-center justify-between h-16">
        <!-- Logo -->
        <div class="flex items-center gap-3">
          <div class="w-8 h-8 rounded-lg bg-gradient-to-br from-redforge-red to-redforge-orange flex items-center justify-center">
            <i data-lucide="flame" class="w-5 h-5 text-white"></i>
          </div>
          <span class="font-orbitron text-lg font-bold glow-red tracking-wider">REDFORGE</span>
          <span class="hidden sm:inline-flex items-center gap-1.5 px-2 py-0.5 rounded border border-redforge-orange/30 bg-redforge-orange/10">
            <i data-lucide="shield-alert" class="w-3 h-3 text-redforge-orange pin-glow"></i>
            <span class="font-mono text-[10px] text-redforge-orange">ADVANCED</span>
          </span>
        </div>

        <!-- Desktop Nav -->
        <div class="hidden md:flex items-center gap-6">
          <a href="index.html" class="text-gray-400 hover:text-redforge-red transition-colors font-rajdhani font-medium text-sm tracking-wide uppercase flex items-center gap-2">
            <i data-lucide="arrow-left" class="w-4 h-4"></i> CyberVoice
          </a>
          <a href="#forums" class="text-gray-400 hover:text-redforge-red transition-colors font-rajdhani font-medium text-sm tracking-wide uppercase">Forums</a>
          <a href="#threads" class="text-gray-400 hover:text-redforge-red transition-colors font-rajdhani font-medium text-sm tracking-wide uppercase">Threads</a>
          <button onclick="openRedModal('thread')" class="neon-btn-red px-4 py-2 rounded-lg font-rajdhani font-semibold text-redforge-red text-sm tracking-wide uppercase">
            <span class="flex items-center gap-2"><i data-lucide="plus" class="w-4 h-4"></i> New Thread</span>
          </button>
        </div>

        <!-- Mobile Menu Button -->
        <button id="mobile-menu-btn-red" class="md:hidden text-gray-400 hover:text-redforge-red transition-colors" onclick="toggleRedMobileMenu()">
          <i data-lucide="menu" class="w-6 h-6"></i>
        </button>
      </div>
    </div>
  </nav>

  <!-- Mobile Menu -->
  <div id="mobile-menu-red" class="mobile-menu-red fixed top-0 right-0 bottom-0 w-72 z-50 bg-redforge-darker/95 backdrop-blur-xl border-l border-redforge-border">
    <div class="p-6">
      <div class="flex justify-between items-center mb-8">
        <span class="font-orbitron text-sm glow-red tracking-wider">MENU</span>
        <button onclick="toggleRedMobileMenu()" class="text-gray-400 hover:text-redforge-red transition-colors">
          <i data-lucide="x" class="w-6 h-6"></i>
        </button>
      </div>
      <div class="flex flex-col gap-4">
        <a href="index.html" class="text-gray-300 hover:text-redforge-red transition-colors font-rajdhani font-semibold text-lg tracking-wide uppercase flex items-center gap-3">
          <i data-lucide="arrow-left" class="w-5 h-5"></i> Back to CyberVoice
        </a>
        <a href="#forums" onclick="toggleRedMobileMenu()" class="text-gray-300 hover:text-redforge-red transition-colors font-rajdhani font-semibold text-lg tracking-wide uppercase flex items-center gap-3">
          <i data-lucide="users" class="w-5 h-5"></i> Forums
        </a>
        <a href="#threads" onclick="toggleRedMobileMenu()" class="text-gray-300 hover:text-redforge-red transition-colors font-rajdhani font-semibold text-lg tracking-wide uppercase flex items-center gap-3">
          <i data-lucide="message-square" class="w-5 h-5"></i> Threads
        </a>
        <div class="holo-line-red my-4"></div>
        <button onclick="openRedModal('thread'); toggleRedMobileMenu();" class="neon-btn-red px-4 py-3 rounded-lg font-rajdhani font-semibold text-redforge-red text-sm tracking-wide uppercase text-left flex items-center gap-3">
          <i data-lucide="plus" class="w-5 h-5"></i> New Thread
        </button>
      </div>
    </div>
  </div>
  <div id="mobile-overlay-red" class="fixed inset-0 bg-black/50 z-40 hidden" onclick="toggleRedMobileMenu()"></div>

  <!-- Hero Section -->
  <section class="relative pt-24 pb-16 md:pt-32 md:pb-24 hex-bg-red overflow-hidden">
    <div class="absolute top-20 left-10 w-64 h-64 bg-redforge-red/5 rounded-full blur-3xl"></div>
    <div class="absolute bottom-10 right-10 w-96 h-96 bg-redforge-orange/5 rounded-full blur-3xl"></div>
    <div class="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[600px] h-[600px] border border-redforge-red/5 rounded-full"></div>
    <div class="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[400px] h-[400px] border border-redforge-orange/5 rounded-full"></div>

    <div class="relative max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 text-center">
      <!-- Status bar -->
      <div class="inline-flex items-center gap-2 px-4 py-1.5 rounded-full border border-redforge-border bg-redforge-card/50 mb-8">
        <span class="w-2 h-2 rounded-full bg-redforge-red pulse-dot-red"></span>
        <span class="font-mono text-xs text-redforge-red tracking-wider">FORGE ACTIVE</span>
        <span class="text-gray-600 font-mono text-xs">|</span>
        <span class="font-mono text-xs text-gray-500" id="forger-count">1,204 forgers online</span>
      </div>

      <h1 class="font-orbitron text-4xl sm:text-5xl md:text-7xl font-bold mb-6">
        <span class="glitch-red" data-text="RED">RED</span><span class="glow-red-strong text-redforge-red">FORGE</span>
      </h1>
      <p class="text-gray-400 text-lg md:text-xl max-w-2xl mx-auto mb-10 font-rajdhani leading-relaxed">
        Advanced forums for complex problems. <br class="hidden sm:block">
        <span class="text-redforge-red">Community-powered solutions</span> from the deepest corners of the network.
      </p>

      <!-- Stats -->
      <div class="flex flex-wrap justify-center gap-6 md:gap-12 mb-12">
        <div class="text-center">
          <div class="font-orbitron text-2xl md:text-3xl font-bold text-redforge-red glow-red" id="stat-threads">0</div>
          <div class="text-gray-500 text-sm font-rajdhani uppercase tracking-wider mt-1">Threads</div>
        </div>
        <div class="w-px h-12 bg-redforge-border hidden md:block"></div>
        <div class="text-center">
          <div class="font-orbitron text-2xl md:text-3xl font-bold text-redforge-orange glow-red" id="stat-replies">0</div>
          <div class="text-gray-500 text-sm font-rajdhani uppercase tracking-wider mt-1">Replies</div>
        </div>
        <div class="w-px h-12 bg-redforge-border hidden md:block"></div>
        <div class="text-center">
          <div class="font-orbitron text-2xl md:text-3xl font-bold text-redforge-lightred glow-red" id="stat-solved">0</div>
          <div class="text-gray-500 text-sm font-rajdhani uppercase tracking-wider mt-1">Solved</div>
        </div>
      </div>

      <!-- Quick Actions -->
      <div class="flex flex-col sm:flex-row gap-4 justify-center">
        <button onclick="openRedModal('thread')" class="neon-btn-red px-8 py-3 rounded-xl font-rajdhani font-bold text-redforge-red text-lg tracking-wide uppercase flex items-center justify-center gap-3">
          <i data-lucide="pen-tool" class="w-5 h-5"></i> Start a Thread
        </button>
        <a href="#threads" class="neon-btn-orange px-8 py-3 rounded-xl font-rajdhani font-bold text-redforge-orange text-lg tracking-wide uppercase flex items-center justify-center gap-3">
          <i data-lucide="search" class="w-5 h-5"></i> Browse Threads
        </a>
      </div>
    </div>
  </section>

  <!-- Forum Categories -->
  <section id="forums" class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
    <h2 class="font-orbitron text-xl font-bold glow-red tracking-wider mb-6 flex items-center gap-3">
      <i data-lucide="layers" class="w-5 h-5 text-redforge-red"></i> FORUM CATEGORIES
    </h2>
    <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4">
      <button onclick="filterByCategory('security')" class="red-card rounded-xl p-5 text-left group" data-cat="security">
        <div class="flex items-center gap-3 mb-3">
          <div class="w-10 h-10 rounded-lg bg-red-500/10 border border-red-500/20 flex items-center justify-center group-hover:border-red-500/50 transition-colors">
            <i data-lucide="shield" class="w-5 h-5 text-red-400"></i>
          </div>
          <div>
            <div class="font-rajdhani font-bold text-white">Security</div>
            <div class="font-mono text-[10px] text-gray-600" id="count-security">0 threads</div>
          </div>
        </div>
        <p class="text-gray-500 text-xs">Exploits, vulnerabilities & defense</p>
      </button>

      <button onclick="filterByCategory('reverse')" class="red-card rounded-xl p-5 text-left group" data-cat="reverse">
        <div class="flex items-center gap-3 mb-3">
          <div class="w-10 h-10 rounded-lg bg-orange-500/10 border border-orange-500/20 flex items-center justify-center group-hover:border-orange-500/50 transition-colors">
            <i data-lucide="code-2" class="w-5 h-5 text-orange-400"></i>
          </div>
          <div>
            <div class="font-rajdhani font-bold text-white">Reverse Eng</div>
            <div class="font-mono text-[10px] text-gray-600" id="count-reverse">0 threads</div>
          </div>
        </div>
        <p class="text-gray-500 text-xs">Disassembly & binary analysis</p>
      </button>

      <button onclick="filterByCategory('systems')" class="red-card rounded-xl p-5 text-left group" data-cat="systems">
        <div class="flex items-center gap-3 mb-3">
          <div class="w-10 h-10 rounded-lg bg-yellow-500/10 border border-yellow-500/20 flex items-center justify-center group-hover:border-yellow-500/50 transition-colors">
            <i data-lucide="cpu" class="w-5 h-5 text-yellow-400"></i>
          </div>
          <div>
            <div class="font-rajdhani font-bold text-white">Systems</div>
            <div class="font-mono text-[10px] text-gray-600" id="count-systems">0 threads</div>
          </div>
        </div>
        <p class="text-gray-500 text-xs">OS internals & architecture</p>
      </button>

      <button onclick="filterByCategory('crypto')" class="red-card rounded-xl p-5 text-left group" data-cat="crypto">
        <div class="flex items-center gap-3 mb-3">
          <div class="w-10 h-10 rounded-lg bg-emerald-500/10 border border-emerald-500/20 flex items-center justify-center group-hover:border-emerald-500/50 transition-colors">
            <i data-lucide="key-round" class="w-5 h-5 text-emerald-400"></i>
          </div>
          <div>
            <div class="font-rajdhani font-bold text-white">Crypto</div>
            <div class="font-mono text-[10px] text-gray-600" id="count-crypto">0 threads</div>
          </div>
        </div>
        <p class="text-gray-500 text-xs">Encryption & blockchain</p>
      </button>
    </div>
    <!-- Reset filter button (hidden by default) -->
    <button id="clear-cat-filter" onclick="filterByCategory(null)" class="hidden mt-4 text-sm font-rajdhani text-gray-500 hover:text-redforge-red transition-colors flex items-center gap-2">
      <i data-lucide="x" class="w-4 h-4"></i> Clear category filter
    </button>
  </section>

  <!-- Threads Section -->
  <section id="threads" class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12">

    <!-- Search & Filter -->
    <div class="flex flex-col sm:flex-row gap-4 mb-8">
      <div class="relative flex-1">
        <i data-lucide="search" class="absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-500"></i>
        <input type="text" id="red-search-input" onkeyup="filterRedContent()" placeholder="Search the forge..." class="cyber-input w-full bg-redforge-card border border-redforge-border rounded-xl pl-10 pr-4 py-3 text-white font-rajdhani placeholder-gray-600 transition-all">
      </div>
      <select id="red-sort-select" onchange="filterRedContent()" class="cyber-input bg-redforge-card border border-redforge-border rounded-xl px-4 py-3 text-gray-300 font-rajdhani cursor-pointer transition-all">
        <option value="newest">Newest First</option>
        <option value="oldest">Oldest First</option>
        <option value="top">Most Replies</option>
        <option value="unsolved">Unsolved</option>
      </select>
    </div>

    <h2 class="font-orbitron text-xl font-bold glow-red tracking-wider mb-6 flex items-center gap-3">
      <i data-lucide="message-square" class="w-5 h-5 text-redforge-red"></i> THREADS
    </h2>

    <div id="threads-list" class="flex flex-col gap-4">
      <!-- Threads rendered by JS -->
    </div>
    <div id="no-threads" class="hidden text-center py-20">
      <i data-lucide="flame" class="w-16 h-16 text-gray-700 mx-auto mb-4"></i>
      <p class="text-gray-500 font-rajdhani text-xl">No threads found in the forge</p>
      <button onclick="openRedModal('thread')" class="neon-btn-red mt-6 px-6 py-2 rounded-lg font-rajdhani font-semibold text-redforge-red text-sm">Start the first thread</button>
    </div>
  </section>

  <!-- Back to CyberVoice -->
  <section class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 mb-8">
    <div class="relative rounded-2xl overflow-hidden border border-cyan-500/20 bg-gradient-to-br from-cyan-950/20 via-redforge-dark to-blue-950/20 p-8 md:p-10 text-center">
      <div class="absolute top-0 left-0 right-0 h-1 bg-gradient-to-r from-transparent via-cyan-500 to-transparent"></div>
      <div class="relative">
        <h3 class="font-orbitron text-lg font-bold mb-3" style="text-shadow: 0 0 10px rgba(0,212,255,0.3);">
          <span class="text-cyan-400">CYBER</span><span class="text-gray-300">VOICE</span>
        </h3>
        <p class="text-gray-400 text-sm font-rajdhani mb-6 max-w-md mx-auto">Looking for reviews and basic Q&A? Head back to the main hub.</p>
        <a href="index.html" class="inline-flex items-center gap-3 px-6 py-3 rounded-xl font-rajdhani font-semibold text-cyan-400 text-sm tracking-wide uppercase transition-all duration-300" style="background: linear-gradient(135deg, rgba(0,212,255,0.1), rgba(123,47,255,0.1)); border: 1px solid rgba(0,212,255,0.3); box-shadow: 0 0 10px rgba(0,212,255,0.1);" onmouseover="this.style.borderColor='rgba(0,212,255,0.7)'; this.style.boxShadow='0 0 20px rgba(0,212,255,0.2)'; this.style.transform='translateY(-2px)';" onmouseout="this.style.borderColor='rgba(0,212,255,0.3)'; this.style.boxShadow='0 0 10px rgba(0,212,255,0.1)'; this.style.transform='translateY(0)';">
          <i data-lucide="arrow-left" class="w-4 h-4"></i>
          Back to CyberVoice
          <i data-lucide="zap" class="w-4 h-4"></i>
        </a>
      </div>
    </div>
  </section>

  <!-- Footer -->
  <footer class="border-t border-redforge-border mt-8">
    <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-10">
      <div class="flex flex-col md:flex-row justify-between items-center gap-6">
        <div class="flex items-center gap-3">
          <div class="w-6 h-6 rounded bg-gradient-to-br from-redforge-red to-redforge-orange flex items-center justify-center">
            <i data-lucide="flame" class="w-3 h-3 text-white"></i>
          </div>
          <span class="font-orbitron text-xs glow-red tracking-wider">REDFORGE</span>
          <span class="text-gray-600 font-mono text-xs">v1.0.33</span>
        </div>
        <div class="flex items-center gap-6">
          <span class="flex items-center gap-2 text-gray-500 text-xs font-mono">
            <span class="w-1.5 h-1.5 rounded-full bg-red-500 pulse-dot-red"></span> Forge operational
          </span>
          <span class="text-gray-600 text-xs font-mono">© 2025 RedForge</span>
        </div>
      </div>
    </div>
  </footer>

  <!-- New Thread Modal -->
  <div id="modal-thread" class="fixed inset-0 z-50 hidden">
    <div class="absolute inset-0 bg-black/60 backdrop-blur-sm" onclick="closeRedModal('thread')"></div>
    <div class="relative flex items-center justify-center min-h-screen p-4">
      <div class="relative bg-redforge-dark border border-redforge-border rounded-2xl w-full max-w-lg p-6 md:p-8 scan-line-red overflow-hidden">
        <div class="absolute top-0 left-0 right-0 h-1 bg-gradient-to-r from-redforge-red via-redforge-orange to-redforge-red"></div>

        <div class="flex justify-between items-center mb-6">
          <h2 class="font-orbitron text-xl font-bold glow-red tracking-wider">NEW THREAD</h2>
          <button onclick="closeRedModal('thread')" class="text-gray-500 hover:text-redforge-red transition-colors">
            <i data-lucide="x" class="w-5 h-5"></i>
          </button>
        </div>

        <form onsubmit="submitThread(event)" class="space-y-5">
          <div>
            <label class="text-gray-400 text-sm font-rajdhani uppercase tracking-wider mb-2 block">Your Handle</label>
            <input type="text" id="thread-author" required placeholder="Enter your handle..." class="cyber-input w-full bg-redforge-card border border-redforge-border rounded-lg px-4 py-3 text-white font-rajdhani placeholder-gray-600 transition-all">
          </div>

          <div>
            <label class="text-gray-400 text-sm font-rajdhani uppercase tracking-wider mb-2 block">Thread Title</label>
            <input type="text" id="thread-title" required placeholder="What's the advanced topic?" class="cyber-input w-full bg-redforge-card border border-redforge-border rounded-lg px-4 py-3 text-white font-rajdhani placeholder-gray-600 transition-all">
          </div>

          <div>
            <label class="text-gray-400 text-sm font-rajdhani uppercase tracking-wider mb-2 block">Details</label>
            <textarea id="thread-details" required rows="5" placeholder="Describe the problem in detail..." class="cyber-input w-full bg-redforge-card border border-redforge-border rounded-lg px-4 py-3 text-white font-rajdhani placeholder-gray-600 transition-all resize-none"></textarea>
          </div>

          <div>
            <label class="text-gray-400 text-sm font-rajdhani uppercase tracking-wider mb-2 block">Category</label>
            <select id="thread-category" class="cyber-input w-full bg-redforge-card border border-redforge-border rounded-lg px-4 py-3 text-gray-300 font-rajdhani cursor-pointer transition-all">
              <option value="security">Security</option>
              <option value="reverse">Reverse Engineering</option>
              <option value="systems">Systems</option>
              <option value="crypto">Crypto</option>
            </select>
          </div>

          <button type="submit" class="neon-btn-red w-full py-3 rounded-xl font-rajdhani font-bold text-redforge-red text-lg tracking-wide uppercase">
            Forge Thread
          </button>
        </form>
      </div>
    </div>
  </div>

  <!-- Reply Modal -->
  <div id="modal-reply" class="fixed inset-0 z-50 hidden">
    <div class="absolute inset-0 bg-black/60 backdrop-blur-sm" onclick="closeRedModal('reply')"></div>
    <div class="relative flex items-center justify-center min-h-screen p-4">
      <div class="relative bg-redforge-dark border border-redforge-border rounded-2xl w-full max-w-lg p-6 md:p-8 scan-line-red overflow-hidden">
        <div class="absolute top-0 left-0 right-0 h-1 bg-gradient-to-r from-redforge-orange via-redforge-red to-redforge-orange"></div>

        <div class="flex justify-between items-center mb-6">
          <h2 class="font-orbitron text-lg font-bold glow-red tracking-wider">POST REPLY</h2>
          <button onclick="closeRedModal('reply')" class="text-gray-500 hover:text-redforge-red transition-colors">
            <i data-lucide="x" class="w-5 h-5"></i>
          </button>
        </div>

        <form onsubmit="submitReply(event)" class="space-y-5">
          <input type="hidden" id="reply-thread-id">
          <div>
            <label class="text-gray-400 text-sm font-rajdhani uppercase tracking-wider mb-2 block">Your Handle</label>
            <input type="text" id="reply-author" required placeholder="Enter your handle..." class="cyber-input w-full bg-redforge-card border border-redforge-border rounded-lg px-4 py-3 text-white font-rajdhani placeholder-gray-600 transition-all">
          </div>
          <div>
            <label class="text-gray-400 text-sm font-rajdhani uppercase tracking-wider mb-2 block">Your Reply</label>
            <textarea id="reply-content" required rows="4" placeholder="Share your expertise..." class="cyber-input w-full bg-redforge-card border border-redforge-border rounded-lg px-4 py-3 text-white font-rajdhani placeholder-gray-600 transition-all resize-none"></textarea>
          </div>
          <button type="submit" class="neon-btn-red w-full py-3 rounded-xl font-rajdhani font-bold text-redforge-red text-lg tracking-wide uppercase">
            Submit Reply
          </button>
        </form>
      </div>
    </div>
  </div>

  <script>
    // ============ DATA ============
    let activeCategory = null;

    let threads = JSON.parse(localStorage.getItem('redforge-threads')) || [
      {
        id: 1,
        author: 'ZeroDay_X',
        title: 'Heap overflow mitigation in kernel 6.2 — new SLAB allocator bypass?',
        details: 'I\'ve been researching the new SLAB allocator changes in kernel 6.2 and found some interesting behavior with SLUB freelist corruption. Has anyone successfully demonstrated a reliable bypass for the new freelist randomization? Looking for theoretical discussion only.',
        category: 'security',
        date: new Date(Date.now() - 86400000).toISOString(),
        likes: 42,
        solved: false,
        pinned: true,
        replies: [
          { id: 1, author: 'KernelPanic', content: 'The SLUB hardening in 6.2 adds metadata hashing that makes traditional freelist poisoning much harder. Check the commit log for slub.c — the randomization seed is now per-CPU with refresh on schedule(). You\'d need to leak the per-CPU seed first.', date: new Date(Date.now() - 72000000).toISOString(), likes: 18, isSolution: true },
          { id: 2, author: 'ShadowStack', content: 'Building on KernelPanic\'s point — the CONFIG_SLAB_FREELIST_HARDENED option also adds XOR-based pointer obfuscation now. Even with a seed leak, you\'d still need to defeat the pointer validation.', date: new Date(Date.now() - 36000000).toISOString(), likes: 11, isSolution: false }
        ]
      },
      {
        id: 2,
        author: 'BinWalker',
        title: 'Firmware extraction from ARM TrustZone — JTAG locked device',
        details: 'Working on extracting firmware from a device with TrustZone enabled and JTAG permanently fused off. Side-channel approaches? Glitching? Any experience with voltage fault injection on Cortex-M33?',
        category: 'reverse',
        date: new Date(Date.now() - 172800000).toISOString(),
        likes: 28,
        solved: false,
        pinned: false,
        replies: [
          { id: 1, author: 'GlitchMaster', content: 'For Cortex-M33 with fused JTAG, voltage glitching during the boot ROM phase has shown promise. You need to glitch right before the debug lock check. Timing window is narrow — around 50-100ns. Check the ChipWhisperer docs for VCC glitching on ARM targets.', date: new Date(Date.now() - 86400000).toISOString(), likes: 15, isSolution: false }
        ]
      },
      {
        id: 3,
        author: 'SysCall_7',
        title: 'eBPF programs for runtime kernel integrity monitoring',
        details: 'Has anyone implemented a robust eBPF-based kernel integrity monitor? I\'m looking to detect inline hooking and syscall table modifications at runtime without kernel module loading. What are the performance implications on high-traffic servers?',
        category: 'systems',
        date: new Date(Date.now() - 259200000).toISOString(),
        likes: 19,
        solved: true,
        pinned: false,
        replies: [
          { id: 1, author: 'BPFNinja', content: 'We deployed kprobes-based eBPF monitors across 500+ nodes. For syscall table monitoring, use bpf_attach_kprobe on sys_call_table reads. Performance hit is ~2-3% at 100k req/s. For inline hooks, hash .text sections periodically with bpf_probe_read_kernel — but be careful with kprobes recursion.', date: new Date(Date.now() - 172800000).toISOString(), likes: 22, isSolution: true }
        ]
      },
      {
        id: 4,
        author: 'QuantumKey',
        title: 'Post-quantum key exchange — CRYSTALS-Kyber implementation pitfalls',
        details: 'Implementing Kyber-1024 in a embedded TLS stack. Running into issues with the NTT performance on ARM Cortex-A53. Any optimized implementations or common pitfalls to avoid? The reference implementation has terrible cache locality.',
        category: 'crypto',
        date: new Date(Date.now() - 345600000).toISOString(),
        likes: 35,
        solved: false,
        pinned: false,
        replies: [
          { id: 1, author: 'LatticeLord', content: 'The PQClean project has optimized Kyber implementations with better cache locality. For Cortex-A53 specifically, the NEON-vectorized NTT from pqcrypto/kyber-neon gives ~3x speedup. Watch out for coefficient overflow in the INTT — use Barrett reduction consistently.', date: new Date(Date.now() - 259200000).toISOString(), likes: 14, isSolution: false },
          { id: 2, author: 'SideChannel', content: 'Make sure you\'re implementing constant-time comparison in the CPA-PKE decapsulation. The reference impl uses memcmp in some paths — huge side-channel risk. Use ct_memcmp or similar.', date: new Date(Date.now() - 200000000).toISOString(), likes: 20, isSolution: false }
        ]
      },
      {
        id: 5,
        author: 'RootAccess',
        title: 'Container escape via cgroup v2 namespace confusion',
        details: 'Found a potential container escape vector involving cgroup v2 namespace delegation. When a container gets a delegated cgroup subtree, certain write operations to cgroup.procs can escape the namespace boundary. Anyone else researching this?',
        category: 'security',
        date: new Date(Date.now() - 432000000).toISOString(),
        likes: 51,
        solved: false,
        pinned: true,
        replies: []
      }
    ];

    // ============ SAVE ============
    function saveRedData() {
      localStorage.setItem('redforge-threads', JSON.stringify(threads));
    }

    // ============ RENDER ============
    function renderThreads(filteredThreads) {
      const list = document.getElementById('threads-list');
      const noMsg = document.getElementById('no-threads');
      const data = filteredThreads || threads;

      if (data.length === 0) {
        list.innerHTML = '';
        noMsg.classList.remove('hidden');
        return;
      }

      noMsg.classList.add('hidden');

      // Sort: pinned first
      const sorted = [...data].sort((a, b) => (b.pinned ? 1 : 0) - (a.pinned ? 1 : 0));

      list.innerHTML = sorted.map(t => {
        const categoryIcons = { security: 'shield', reverse: 'code-2', systems: 'cpu', crypto: 'key-round' };
        const categoryColors = {
          security: 'from-red-500/20 to-red-500/5 text-red-400 border-red-500/30',
          reverse: 'from-orange-500/20 to-orange-500/5 text-orange-400 border-orange-500/30',
          systems: 'from-yellow-500/20 to-yellow-500/5 text-yellow-400 border-yellow-500/30',
          crypto: 'from-emerald-500/20 to-emerald-500/5 text-emerald-400 border-emerald-500/30',
        };
        const catClass = categoryColors[t.category] || categoryColors.security;
        const catIcon = categoryIcons[t.category] || 'shield';

        const repliesHTML = t.replies.map(r => `
          <div class="ml-4 sm:ml-8 mt-3 pl-4 thread-line fade-in ${r.isSolution ? 'bg-emerald-500/5 rounded-lg p-3 border border-emerald-500/20' : ''}">
            <div class="flex items-center gap-2 mb-1 flex-wrap">
              <div class="w-6 h-6 rounded ${r.isSolution ? 'bg-emerald-500/20 border border-emerald-500/30' : 'bg-redforge-ember/20 border border-redforge-red/20'} flex items-center justify-center">
                <span class="font-orbitron text-[8px] ${r.isSolution ? 'text-emerald-400' : 'text-redforge-red'}">${r.author.charAt(0).toUpperCase()}</span>
              </div>
              <span class="font-rajdhani text-sm ${r.isSolution ? 'text-emerald-400' : 'text-redforge-lightred'} font-semibold">@${r.author}</span>
              ${r.isSolution ? '<span class="flex items-center gap-1 text-emerald-400 text-[10px] font-mono bg-emerald-500/10 px-1.5 py-0.5 rounded"><i data-lucide="check-circle" class="w-3 h-3"></i> SOLUTION</span>' : ''}
              <span class="font-mono text-[10px] text-gray-600">${timeAgoRed(r.date)}</span>
            </div>
            <p class="text-gray-400 text-sm">${r.content}</p>
            <button onclick="likeReply(${t.id}, ${r.id})" class="flex items-center gap-1 text-gray-600 hover:text-redforge-red transition-colors mt-1 group">
              <i data-lucide="thumbs-up" class="w-3 h-3 group-hover:drop-shadow-[0_0_5px_rgba(239,68,68,0.5)]"></i>
              <span class="font-mono text-[10px]">${r.likes}</span>
            </button>
          </div>
        `).join('');

        return `
          <div class="red-card rounded-xl p-5 md:p-6 fade-in">
            <div class="flex items-start justify-between mb-3 flex-wrap gap-2">
              <div class="flex items-center gap-3">
                <div class="w-9 h-9 rounded-lg bg-gradient-to-br from-redforge-red/30 to-redforge-orange/30 flex items-center justify-center border border-redforge-red/20">
                  <span class="font-orbitron text-xs text-redforge-red">${t.author.charAt(0).toUpperCase()}</span>
                </div>
                <div>
                  <div class="font-rajdhani font-semibold text-white text-sm flex items-center gap-2">
                    @${t.author}
                    ${t.pinned ? '<span class="flex items-center gap-1 text-redforge-orange text-[10px] font-mono"><i data-lucide="pin" class="w-3 h-3 pin-glow"></i> PINNED</span>' : ''}
                    ${t.solved ? '<span class="flex items-center gap-1 text-emerald-400 text-[10px] font-mono"><i data-lucide="check-circle" class="w-3 h-3"></i> SOLVED</span>' : ''}
                  </div>
                  <div class="font-mono text-xs text-gray-600">${timeAgoRed(t.date)}</div>
                </div>
              </div>
              <span class="bg-gradient-to-r ${catClass} border rounded-md px-2 py-0.5 text-xs font-rajdhani uppercase tracking-wider flex items-center gap-1">
                <i data-lucide="${catIcon}" class="w-3 h-3"></i> ${t.category}
              </span>
            </div>

            <h3 class="font-rajdhani font-bold text-lg text-white mb-2 leading-tight">${t.title}</h3>
            <p class="text-gray-400 text-sm leading-relaxed mb-4">${t.details}</p>

            <div class="flex items-center gap-4 mb-3 flex-wrap">
              <button onclick="likeThread(${t.id})" class="flex items-center gap-2 text-gray-500 hover:text-redforge-red transition-colors group">
                <i data-lucide="arrow-big-up" class="w-5 h-5 group-hover:drop-shadow-[0_0_5px_rgba(239,68,68,0.5)]"></i>
                <span class="font-mono text-xs">${t.likes}</span>
              </button>
              <div class="flex items-center gap-2 text-gray-500">
                <i data-lucide="message-circle" class="w-4 h-4"></i>
                <span class="font-mono text-xs">${t.replies.length} repl${t.replies.length !== 1 ? 'ies' : 'y'}</span>
              </div>
              ${!t.solved ? `<button onclick="openReplyModal(${t.id})" class="text-redforge-red hover:text-redforge-lightred transition-colors font-rajdhani font-semibold text-sm flex items-center gap-1">
                <i data-lucide="reply" class="w-4 h-4"></i> Reply
              </button>` : ''}
              ${!t.solved && t.replies.length > 0 ? `<button onclick="markSolved(${t.id})" class="text-emerald-500 hover:text-emerald-400 transition-colors font-rajdhani font-semibold text-sm flex items-center gap-1">
                <i data-lucide="check-circle" class="w-4 h-4"></i> Mark Solved
              </button>` : ''}
            </div>

            ${t.replies.length > 0 ? `<div class="holo-line-red mb-3"></div>` : ''}
            ${repliesHTML}
          </div>
        `;
      }).join('');

      lucide.createIcons();
      updateCategoryCounts();
    }

    // ============ UTILITIES ============
    function timeAgoRed(dateStr) {
      const now = new Date();
      const date = new Date(dateStr);
      const seconds = Math.floor((now - date) / 1000);

      if (seconds < 60) return 'just now';
      if (seconds < 3600) return `${Math.floor(seconds / 60)}m ago`;
      if (seconds < 86400) return `${Math.floor(seconds / 3600)}h ago`;
      if (seconds < 604800) return `${Math.floor(seconds / 86400)}d ago`;
      return date.toLocaleDateString('en-US', { month: 'short', day: 'numeric' });
    }

    function showToastRed(message, type = 'success') {
      const container = document.getElementById('toast-container-red');
      const colors = { success: 'border-emerald-500 bg-redforge-dark', error: 'border-red-500 bg-redforge-dark', info: 'border-redforge-orange bg-redforge-dark' };
      const icons = { success: 'check-circle', error: 'alert-circle', info: 'flame' };
      const textColors = { success: 'text-emerald-400', error: 'text-red-400', info: 'text-redforge-orange' };

      const toast = document.createElement('div');
      toast.className = `toast-red ${colors[type]} border rounded-lg px-4 py-3 flex items-center gap-3 shadow-lg shadow-black/30`;
      toast.innerHTML = `<i data-lucide="${icons[type]}" class="w-5 h-5 ${textColors[type]}"></i><span class="font-rajdhani text-sm text-gray-200">${message}</span>`;
      container.appendChild(toast);
      lucide.createIcons();
      setTimeout(() => toast.remove(), 3000);
    }

    // ============ MODALS ============
    function openRedModal(type) {
      document.getElementById(`modal-${type}`).classList.remove('hidden');
      document.body.style.overflow = 'hidden';
    }

    function closeRedModal(type) {
      document.getElementById(`modal-${type}`).classList.add('hidden');
      document.body.style.overflow = '';
    }

    function openReplyModal(threadId) {
      document.getElementById('reply-thread-id').value = threadId;
      openRedModal('reply');
    }

    // ============ SUBMISSIONS ============
    function submitThread(e) {
      e.preventDefault();
      const thread = {
        id: Date.now(),
        author: document.getElementById('thread-author').value.trim(),
        title: document.getElementById('thread-title').value.trim(),
        details: document.getElementById('thread-details').value.trim(),
        category: document.getElementById('thread-category').value,
        date: new Date().toISOString(),
        likes: 0,
        solved: false,
        pinned: false,
        replies: []
      };
      threads.unshift(thread);
      saveRedData();
      renderThreads();
      updateRedStats();
      closeRedModal('thread');
      showToastRed('Thread forged successfully!', 'success');
      e.target.reset();
    }

    function submitReply(e) {
      e.preventDefault();
      const threadId = parseInt(document.getElementById('reply-thread-id').value);
      const reply = {
        id: Date.now(),
        author: document.getElementById('reply-author').value.trim(),
        content: document.getElementById('reply-content').value.trim(),
        date: new Date().toISOString(),
        likes: 0,
        isSolution: false
      };
      const thread = threads.find(t => t.id === threadId);
      if (thread) {
        thread.replies.push(reply);
        saveRedData();
        renderThreads();
        updateRedStats();
        closeRedModal('reply');
        showToastRed('Reply posted to the forge!', 'info');
      }
      e.target.reset();
    }

    // ============ LIKES ============
    function likeThread(id) {
      const thread = threads.find(t => t.id === id);
      if (thread) { thread.likes++; saveRedData(); renderThreads(); }
    }

    function likeReply(threadId, replyId) {
      const thread = threads.find(t => t.id === threadId);
      if (thread) {
        const reply = thread.replies.find(r => r.id === replyId);
        if (reply) { reply.likes++; saveRedData(); renderThreads(); }
      }
    }

    // ============ MARK SOLVED ============
    function markSolved(threadId) {
      const thread = threads.find(t => t.id === threadId);
      if (thread) {
        thread.solved = true;
        // Mark last reply as solution
        if (thread.replies.length > 0) {
          thread.replies[thread.replies.length - 1].isSolution = true;
        }
        saveRedData();
        renderThreads();
        updateRedStats();
        showToastRed('Thread marked as solved!', 'success');
      }
    }

    // ============ CATEGORY FILTER ============
    function filterByCategory(cat) {
      activeCategory = cat;
      const clearBtn = document.getElementById('clear-cat-filter');
      if (cat) {
        clearBtn.classList.remove('hidden');
      } else {
        clearBtn.classList.add('hidden');
      }
      filterRedContent();
    }

    function updateCategoryCounts() {
      const categories = ['security', 'reverse', 'systems', 'crypto'];
      categories.forEach(cat => {
        const count = threads.filter(t => t.category === cat).length;
        const el = document.getElementById(`count-${cat}`);
        if (el) el.textContent = `${count} thread${count !== 1 ? 's' : ''}`;
      });
    }

    // ============ SEARCH & FILTER ============
    function filterRedContent() {
      const query = document.getElementById('red-search-input').value.toLowerCase().trim();
      const sort = document.getElementById('red-sort-select').value;

      let filtered = [...threads];

      if (activeCategory) {
        filtered = filtered.filter(t => t.category === activeCategory);
      }

      if (query) {
        filtered = filtered.filter(t =>
          t.title.toLowerCase().includes(query) ||
          t.details.toLowerCase().includes(query) ||
          t.author.toLowerCase().includes(query) ||
          t.category.toLowerCase().includes(query)
        );
      }

      if (sort === 'newest') {
        filtered.sort((a, b) => new Date(b.date) - new Date(a.date));
      } else if (sort === 'oldest') {
        filtered.sort((a, b) => new Date(a.date) - new Date(b.date));
      } else if (sort === 'top') {
        filtered.sort((a, b) => b.replies.length - a.replies.length);
      } else if (sort === 'unsolved') {
        filtered = filtered.filter(t => !t.solved);
        filtered.sort((a, b) => new Date(b.date) - new Date(a.date));
      }

      renderThreads(filtered);
    }

    // ============ MOBILE MENU ============
    function toggleRedMobileMenu() {
      const menu = document.getElementById('mobile-menu-red');
      const overlay = document.getElementById('mobile-overlay-red');
      menu.classList.toggle('open');
      overlay.classList.toggle('hidden');
    }

    // ============ STATS ============
    function updateRedStats() {
      const totalThreads = threads.length;
      const totalReplies = threads.reduce((sum, t) => sum + t.replies.length, 0);
      const solved = threads.filter(t => t.solved).length;

      animateRedCounter('stat-threads', totalThreads);
      animateRedCounter('stat-replies', totalReplies);
      animateRedCounter('stat-solved', solved);
    }

    function animateRedCounter(elementId, target) {
      const el = document.getElementById(elementId);
      const current = parseInt(el.textContent) || 0;
      const increment = target > current ? 1 : -1;
      const duration = 600;
      const steps = Math.abs(target - current);
      const stepTime = steps > 0 ? duration / steps : 0;

      let count = current;
      const timer = setInterval(() => {
        count += increment;
        el.textContent = count;
        if (count === target) clearInterval(timer);
      }, stepTime);
    }

    // ============ PARTICLES ============
    function createRedParticles() {
      const container = document.getElementById('particles-red');
      for (let i = 0; i < 25; i++) {
        const particle = document.createElement('div');
        particle.className = 'particle-red';
        particle.style.left = Math.random() * 100 + '%';
        particle.style.animationDuration = (Math.random() * 15 + 10) + 's';
        particle.style.animationDelay = (Math.random() * 15) + 's';
        particle.style.width = (Math.random() * 2 + 1) + 'px';
        particle.style.height = particle.style.width;
        if (Math.random() > 0.6) {
          particle.style.background = 'rgba(249, 115, 22, 0.5)';
        }
        container.appendChild(particle);
      }
    }

    // ============ USER COUNT ============
    function animateForgerCount() {
      const el = document.getElementById('forger-count');
      const base = 1204;
      setInterval(() => {
        const variation = Math.floor(Math.random() * 15) - 7;
        const count = base + variation;
        el.textContent = count.toLocaleString() + ' forgers online';
      }, 5000);
    }

    // ============ KEYBOARD ============
    document.addEventListener('keydown', (e) => {
      if (e.key === 'Escape') {
        closeRedModal('thread');
        closeRedModal('reply');
        const menu = document.getElementById('mobile-menu-red');
        if (menu.classList.contains('open')) toggleRedMobileMenu();
      }
    });

    // ============ INIT ============
    function initRed() {
      createRedParticles();
      renderThreads();
      updateRedStats();
      animateForgerCount();
      lucide.createIcons();
    }

    document.addEventListener('DOMContentLoaded', initRed);
  </script>
</body>
</html>