-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsoccer-fantasy.stx
More file actions
1413 lines (1310 loc) Β· 74.6 KB
/
Copy pathsoccer-fantasy.stx
File metadata and controls
1413 lines (1310 loc) Β· 74.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Fantasy Football - Soccer Fantasy League</title>
<script>
module.exports = {
// Team Data
teamName: "FC Thunder",
budget: 14.5,
totalBudget: 100,
budgetPercent: 85.5,
gameweek: 12,
totalPoints: 847,
rank: "12,453",
formation: "4-3-3",
freeTransfers: 2,
hasWildcard: true,
hasBenchBoost: true,
hasTripleCaptain: false,
hasFreeHit: true,
// Squad Data with Transfermarkt player images
goalkeepers: [
{ id: 1, name: "Alisson", team: "Liverpool", points: 72, price: 5.5, form: "6.2", isCaptain: false, isVice: false, img: "https://img.a.transfermarkt.technology/portrait/header/105470-1670254746.jpg" }
],
defenders: [
{ id: 2, name: "Alexander-Arnold", team: "Liverpool", points: 89, price: 7.8, form: "7.4", isCaptain: false, isVice: false, img: "https://img.a.transfermarkt.technology/portrait/header/314353-1682683695.jpg" },
{ id: 3, name: "Van Dijk", team: "Liverpool", points: 78, price: 6.5, form: "6.8", isCaptain: false, isVice: false, img: "https://img.a.transfermarkt.technology/portrait/header/139208-1695021451.jpg" },
{ id: 4, name: "Saliba", team: "Arsenal", points: 82, price: 5.8, form: "7.1", isCaptain: false, isVice: false, img: "https://img.a.transfermarkt.technology/portrait/header/495666-1694590721.jpg" },
{ id: 5, name: "Trippier", team: "Newcastle", points: 95, price: 6.2, form: "7.9", isCaptain: false, isVice: false, img: "https://img.a.transfermarkt.technology/portrait/header/95810-1695021596.jpg" }
],
midfielders: [
{ id: 6, name: "Salah", team: "Liverpool", points: 124, price: 12.8, form: "8.8", isCaptain: true, isVice: false, img: "https://img.a.transfermarkt.technology/portrait/header/148455-1682683690.jpg" },
{ id: 7, name: "Saka", team: "Arsenal", points: 98, price: 9.2, form: "7.9", isCaptain: false, isVice: true, img: "https://img.a.transfermarkt.technology/portrait/header/433177-1694590751.jpg" },
{ id: 8, name: "Odegaard", team: "Arsenal", points: 87, price: 8.4, form: "7.2", isCaptain: false, isVice: false, img: "https://img.a.transfermarkt.technology/portrait/header/316264-1694590743.jpg" }
],
forwards: [
{ id: 9, name: "Haaland", team: "Man City", points: 156, price: 14.2, form: "9.2", isCaptain: false, isVice: false, img: "https://img.a.transfermarkt.technology/portrait/header/418560-1695029616.jpg" },
{ id: 10, name: "Watkins", team: "Aston Villa", points: 92, price: 8.8, form: "7.6", isCaptain: false, isVice: false, img: "https://img.a.transfermarkt.technology/portrait/header/299420-1695021614.jpg" },
{ id: 11, name: "Isak", team: "Newcastle", points: 88, price: 8.5, form: "7.3", isCaptain: false, isVice: false, img: "https://img.a.transfermarkt.technology/portrait/header/435338-1695021570.jpg" }
],
bench: [
{ id: 12, name: "Raya", team: "Arsenal", points: 65, price: 5.0, position: "GK", img: "https://img.a.transfermarkt.technology/portrait/header/262605-1694590713.jpg" },
{ id: 13, name: "Gabriel", team: "Arsenal", points: 71, price: 5.2, position: "DEF", img: "https://img.a.transfermarkt.technology/portrait/header/544659-1694590729.jpg" },
{ id: 14, name: "Mac Allister", team: "Liverpool", points: 76, price: 6.8, position: "MID", img: "https://img.a.transfermarkt.technology/portrait/header/534027-1695021478.jpg" },
{ id: 15, name: "Solanke", team: "Tottenham", points: 54, price: 7.2, position: "FWD", img: "https://img.a.transfermarkt.technology/portrait/header/258878-1724934015.jpg" }
],
// Transfer Market Data
transferMarket: [
{ id: 101, name: "Palmer", team: "Chelsea", position: "MID", price: 10.5, form: "8.5", points: 118, selected: "45.2%" },
{ id: 102, name: "Gordon", team: "Newcastle", position: "MID", price: 7.4, form: "7.8", points: 89, selected: "28.1%" },
{ id: 103, name: "Solanke", team: "Tottenham", position: "FWD", price: 7.5, form: "6.9", points: 76, selected: "15.3%" },
{ id: 104, name: "Martinez", team: "Aston Villa", position: "GK", price: 5.0, form: "6.4", points: 68, selected: "22.8%" },
{ id: 105, name: "Gvardiol", team: "Man City", position: "DEF", price: 5.8, form: "6.1", points: 62, selected: "18.5%" },
{ id: 106, name: "Foden", team: "Man City", position: "MID", price: 9.0, form: "5.8", points: 72, selected: "12.4%" },
{ id: 107, name: "Rashford", team: "Man United", position: "MID", price: 6.8, form: "4.2", points: 45, selected: "5.2%" },
{ id: 108, name: "Darwin", team: "Liverpool", position: "FWD", price: 7.8, form: "5.5", points: 58, selected: "8.9%" }
],
// Fixtures Data
fixtures: [
{ home: "Liverpool", away: "Man City", time: "Sat 12:30", homeOdds: "2.10", drawOdds: "3.40", awayOdds: "3.20" },
{ home: "Arsenal", away: "Chelsea", time: "Sat 15:00", homeOdds: "1.75", drawOdds: "3.80", awayOdds: "4.50" },
{ home: "Man United", away: "Newcastle", time: "Sat 17:30", homeOdds: "2.40", drawOdds: "3.30", awayOdds: "2.90" },
{ home: "Tottenham", away: "Aston Villa", time: "Sun 14:00", homeOdds: "2.20", drawOdds: "3.50", awayOdds: "3.10" }
],
// Top Players
topPlayers: [
{ name: "Haaland", team: "Man City", points: 156, form: "9.2", isFirst: true },
{ name: "Salah", team: "Liverpool", points: 124, form: "8.8", isFirst: false },
{ name: "Palmer", team: "Chelsea", points: 118, form: "8.5", isFirst: false },
{ name: "Saka", team: "Arsenal", points: 98, form: "7.9", isFirst: false },
{ name: "Trippier", team: "Newcastle", points: 95, form: "7.6", isFirst: false }
],
// Leagues
leagues: [
{ id: 1, name: "Overall", rank: "12,453", members: "9,847,234", isTop3: false },
{ id: 2, name: "Friends League", rank: "3", members: "24", isTop3: true },
{ id: 3, name: "Work Rivals", rank: "1", members: "18", isTop3: true },
{ id: 4, name: "Reddit FPL", rank: "892", members: "45,000", isTop3: false }
],
// Notifications
notifications: [
{ id: 1, type: "transfer", title: "Transfer Complete", message: "You sold Rashford for Β£6.8m", time: "2h ago", unread: true },
{ id: 2, type: "points", title: "Points Updated", message: "GW11 points have been finalized: 67 pts", time: "1d ago", unread: true },
{ id: 3, type: "deadline", title: "Deadline Reminder", message: "GW12 deadline in 2 days", time: "1d ago", unread: true }
],
// Gameweek History
gameweekHistory: [
{ gw: 11, points: 67, rank: "15,234", avgPoints: 52 },
{ gw: 10, points: 82, rank: "8,456", avgPoints: 61 },
{ gw: 9, points: 45, rank: "45,678", avgPoints: 58 },
{ gw: 8, points: 91, rank: "3,245", avgPoints: 55 }
]
};
</script>
</head>
<body class="bg-slate-900 text-slate-100 min-h-screen font-sans antialiased">
<!-- Header -->
<header class="bg-slate-800 border-b border-slate-700 p-4 sticky top-0 z-50 backdrop-blur-sm">
<div class="max-w-7xl mx-auto flex justify-between items-center">
<div class="flex items-center gap-3">
<div class="w-10 h-10 bg-gradient-to-br from-indigo-500 to-purple-500 rounded-xl flex items-center justify-center text-xl">β½</div>
<span class="font-bold text-xl">Fantasy FC</span>
</div>
<div class="flex gap-6">
<div class="text-center">
<div class="font-bold text-lg text-indigo-400">{{ totalPoints }}</div>
<div class="text-xs text-slate-500 uppercase tracking-wide">Points</div>
</div>
<div class="text-center">
<div class="font-bold text-lg text-indigo-400">#{{ rank }}</div>
<div class="text-xs text-slate-500 uppercase tracking-wide">Rank</div>
</div>
</div>
<div class="flex items-center gap-4">
<!-- Notifications Dropdown -->
<div class="relative" id="notifications-container">
<button onclick="toggleNotifications()" class="w-10 h-10 rounded-xl bg-slate-700 hover:bg-indigo-500 transition-colors relative text-xl" title="Notifications">
π
<span class="absolute -top-1 -right-1 w-5 h-5 bg-red-500 rounded-full text-xs flex items-center justify-center font-bold">3</span>
</button>
<!-- Notifications Panel -->
<div id="notifications-panel" class="hidden absolute right-0 top-14 bg-slate-800 border border-slate-700 rounded-2xl shadow-2xl overflow-hidden z-50" style="width: 360px;">
<div class="p-4 border-b border-slate-700 flex justify-between items-center gap-4">
<h3 class="font-semibold whitespace-nowrap">Notifications</h3>
<button onclick="markAllRead()" class="text-xs text-indigo-400 hover:text-indigo-300 whitespace-nowrap">Mark all read</button>
</div>
<div class="max-h-80 overflow-y-auto">
@foreach(notifications as notif)
<div class="p-4 border-b border-slate-700/50 hover:bg-slate-700/50 cursor-pointer transition-colors">
<div class="flex items-start gap-3">
@if(notif.type === "transfer")
<div class="w-10 h-10 rounded-lg bg-emerald-500/20 flex items-center justify-center text-emerald-400 shrink-0">π</div>
@elseif(notif.type === "points")
<div class="w-10 h-10 rounded-lg bg-indigo-500/20 flex items-center justify-center text-indigo-400 shrink-0">β</div>
@else
<div class="w-10 h-10 rounded-lg bg-amber-500/20 flex items-center justify-center text-amber-400 shrink-0">β°</div>
@endif
<div class="flex-1 min-w-0">
<div class="font-semibold text-sm">{{ notif.title }}</div>
<div class="text-sm text-slate-400 mt-0.5">{{ notif.message }}</div>
<div class="text-xs text-slate-500 mt-1">{{ notif.time }}</div>
</div>
@if(notif.unread)
<div class="w-2 h-2 bg-indigo-500 rounded-full shrink-0 mt-2"></div>
@endif
</div>
</div>
@endforeach
</div>
<div class="p-3 border-t border-slate-700">
<button class="w-full py-2 text-sm text-indigo-400 hover:text-indigo-300 font-medium">View All Notifications</button>
</div>
</div>
</div>
<!-- User Menu Dropdown -->
<div class="relative" id="user-menu-container">
<button onclick="toggleUserMenu()" class="w-10 h-10 rounded-full bg-gradient-to-br from-emerald-500 to-teal-500 flex items-center justify-center font-bold cursor-pointer hover:scale-105 transition-transform" title="Account">FC</button>
<!-- User Menu Panel -->
<div id="user-menu-panel" class="hidden absolute right-0 top-14 bg-slate-800 border border-slate-700 rounded-2xl shadow-2xl overflow-hidden z-50" style="width: 240px;">
<div class="p-4 border-b border-slate-700">
<div class="font-semibold">{{ teamName }}</div>
<div class="text-xs text-slate-400">Manager since 2023</div>
</div>
<div class="py-2">
<button onclick="showTab('team')" class="w-full px-4 py-2.5 text-left text-sm hover:bg-slate-700/50 transition-colors flex items-center gap-3">
<span class="text-base">π₯</span> <span>My Team</span>
</button>
<button onclick="showTab('transfers')" class="w-full px-4 py-2.5 text-left text-sm hover:bg-slate-700/50 transition-colors flex items-center gap-3">
<span class="text-base">π</span> <span>Transfers</span>
</button>
<button onclick="showTab('points')" class="w-full px-4 py-2.5 text-left text-sm hover:bg-slate-700/50 transition-colors flex items-center gap-3">
<span class="text-base">β</span> <span>Points History</span>
</button>
<button onclick="showTab('leagues')" class="w-full px-4 py-2.5 text-left text-sm hover:bg-slate-700/50 transition-colors flex items-center gap-3">
<span class="text-base">π</span> <span>My Leagues</span>
</button>
</div>
<div class="p-2 border-t border-slate-700">
<button class="w-full px-4 py-2.5 text-left text-sm text-red-400 hover:bg-red-500/10 rounded-lg transition-colors flex items-center gap-3">
<span class="text-base">πͺ</span> <span>Sign Out</span>
</button>
</div>
</div>
</div>
</div>
</div>
</header>
<!-- Main Container -->
<div class="max-w-6xl mx-auto p-4 md:p-6 lg:p-8 pb-24 lg:pb-8">
<!-- Stats Cards - Always visible, responsive grid -->
<div class="bg-slate-800 rounded-2xl p-4 md:p-6 border border-slate-700 mb-6">
<h3 class="text-sm font-semibold text-slate-400 uppercase tracking-wide mb-4">Team Stats</h3>
<div class="grid grid-cols-2 md:grid-cols-4 gap-3 md:gap-4">
<div class="text-center p-3 md:p-4 bg-slate-700/50 rounded-xl">
<div class="text-xl md:text-2xl font-bold text-indigo-400">{{ totalPoints }}</div>
<div class="text-xs text-slate-500">Total Points</div>
</div>
<div class="text-center p-3 md:p-4 bg-slate-700/50 rounded-xl">
<div class="text-xl md:text-2xl font-bold">GW{{ gameweek }}</div>
<div class="text-xs text-slate-500">Gameweek</div>
</div>
<div class="text-center p-3 md:p-4 bg-slate-700/50 rounded-xl">
<div class="text-xl md:text-2xl font-bold">#{{ rank }}</div>
<div class="text-xs text-slate-500">Overall Rank</div>
</div>
<div class="text-center p-3 md:p-4 bg-slate-700/50 rounded-xl">
<div class="text-xl md:text-2xl font-bold">{{ freeTransfers }}</div>
<div class="text-xs text-slate-500">Free Transfers</div>
</div>
</div>
<div class="mt-4 md:mt-6">
<div class="flex justify-between text-sm mb-2">
<span class="text-slate-400">Budget</span>
<span class="font-semibold">Β£{{ budget }}m / Β£{{ totalBudget }}m</span>
</div>
<div class="h-2 bg-slate-700 rounded-full overflow-hidden">
<div class="h-full bg-gradient-to-r from-emerald-500 to-teal-500 rounded-full" style="width: {{ budgetPercent }}%"></div>
</div>
</div>
</div>
<!-- Chips and Leagues Row -->
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 md:gap-6 mb-6">
<!-- Chips Available -->
<div class="bg-slate-800 rounded-2xl p-4 md:p-6 border border-slate-700">
<h3 class="text-sm font-semibold text-slate-400 uppercase tracking-wide mb-4">Chips Available</h3>
<div class="grid grid-cols-4 gap-2 md:gap-3">
@if(hasWildcard)
<div class="p-2 md:p-3 bg-slate-700/50 rounded-xl text-center cursor-pointer hover:bg-slate-600/50 transition-colors border border-emerald-500/30">
@else
<div class="p-2 md:p-3 bg-slate-700/30 rounded-xl text-center opacity-50">
@endif
<div class="text-xl md:text-2xl mb-1">π</div>
<div class="text-[10px] md:text-xs font-medium">Wildcard</div>
</div>
@if(hasBenchBoost)
<div class="p-2 md:p-3 bg-slate-700/50 rounded-xl text-center cursor-pointer hover:bg-slate-600/50 transition-colors border border-emerald-500/30">
@else
<div class="p-2 md:p-3 bg-slate-700/30 rounded-xl text-center opacity-50">
@endif
<div class="text-xl md:text-2xl mb-1">π</div>
<div class="text-[10px] md:text-xs font-medium">Bench Boost</div>
</div>
@if(hasTripleCaptain)
<div class="p-2 md:p-3 bg-slate-700/50 rounded-xl text-center cursor-pointer hover:bg-slate-600/50 transition-colors border border-emerald-500/30">
@else
<div class="p-2 md:p-3 bg-slate-700/30 rounded-xl text-center opacity-50">
@endif
<div class="text-xl md:text-2xl mb-1">π</div>
<div class="text-[10px] md:text-xs font-medium">Triple Captain</div>
</div>
@if(hasFreeHit)
<div class="p-2 md:p-3 bg-slate-700/50 rounded-xl text-center cursor-pointer hover:bg-slate-600/50 transition-colors border border-emerald-500/30">
@else
<div class="p-2 md:p-3 bg-slate-700/30 rounded-xl text-center opacity-50">
@endif
<div class="text-xl md:text-2xl mb-1">β‘</div>
<div class="text-[10px] md:text-xs font-medium">Free Hit</div>
</div>
</div>
</div>
<!-- My Leagues -->
<div class="bg-slate-800 rounded-2xl p-4 md:p-6 border border-slate-700">
<h3 class="text-sm font-semibold text-slate-400 uppercase tracking-wide mb-4">My Leagues</h3>
<div class="space-y-2">
@foreach(leagues as league)
<div class="flex items-center justify-between p-2 md:p-3 bg-slate-700/50 rounded-xl hover:bg-slate-600/50 transition-colors cursor-pointer">
<div>
<div class="font-semibold text-sm">{{ league.name }}</div>
<div class="text-xs text-slate-500">{{ league.members }} members</div>
</div>
@if(league.isTop3)
<div class="text-base md:text-lg font-bold text-amber-400">#{{ league.rank }}</div>
@else
<div class="text-base md:text-lg font-bold text-indigo-400">#{{ league.rank }}</div>
@endif
</div>
@endforeach
</div>
</div>
</div>
<!-- Main Content -->
<main>
<!-- Gameweek Banner -->
<div class="bg-gradient-to-r from-indigo-500 to-purple-500 rounded-2xl p-5 mb-6 flex justify-between items-center">
<div>
<h2 class="text-lg font-bold">Gameweek {{ gameweek }}</h2>
<p class="text-sm opacity-90">{{ teamName }}</p>
</div>
<div class="text-right">
<div class="text-xs opacity-80">Deadline</div>
<div class="font-bold">Sat 11:00</div>
</div>
</div>
<!-- Navigation Tabs -->
<nav class="flex gap-2 mb-6 overflow-x-auto pb-2" id="main-tabs">
<button onclick="showTab('team')" class="tab-btn px-4 py-2 rounded-xl bg-indigo-500 text-white font-medium text-sm whitespace-nowrap transition-colors" data-tab="team">My Team</button>
<button onclick="showTab('transfers')" class="tab-btn px-4 py-2 rounded-xl bg-slate-700 hover:bg-slate-600 text-slate-300 font-medium text-sm whitespace-nowrap transition-colors" data-tab="transfers">Transfers</button>
<button onclick="showTab('points')" class="tab-btn px-4 py-2 rounded-xl bg-slate-700 hover:bg-slate-600 text-slate-300 font-medium text-sm whitespace-nowrap transition-colors" data-tab="points">Points</button>
<button onclick="showTab('fixtures')" class="tab-btn px-4 py-2 rounded-xl bg-slate-700 hover:bg-slate-600 text-slate-300 font-medium text-sm whitespace-nowrap transition-colors" data-tab="fixtures">Fixtures</button>
<button onclick="showTab('leagues')" class="tab-btn px-4 py-2 rounded-xl bg-slate-700 hover:bg-slate-600 text-slate-300 font-medium text-sm whitespace-nowrap transition-colors" data-tab="leagues">Leagues</button>
</nav>
<!-- Tab Content: Team -->
<div id="tab-team" class="tab-content">
<!-- Pitch Container -->
<div class="bg-slate-800 rounded-2xl p-4 sm:p-6 border border-slate-700">
<!-- Header with controls -->
<div class="flex flex-col sm:flex-row sm:items-center justify-between gap-4 mb-6">
<div>
<h2 class="text-lg font-bold">Squad Selection</h2>
<p class="text-sm text-slate-400 mt-1">Gameweek {{ gameweek }} Β· Deadline: Sat 11:00</p>
</div>
<div class="flex flex-wrap items-center gap-3">
<!-- Formation Selector -->
<div class="flex items-center gap-2 bg-slate-700/50 rounded-xl p-1">
<button onclick="setFormation('3-4-3')" class="formation-btn px-3 py-1.5 rounded-lg text-sm font-medium text-slate-400 hover:text-white hover:bg-slate-600 transition-colors" data-formation="3-4-3">3-4-3</button>
<button onclick="setFormation('3-5-2')" class="formation-btn px-3 py-1.5 rounded-lg text-sm font-medium text-slate-400 hover:text-white hover:bg-slate-600 transition-colors" data-formation="3-5-2">3-5-2</button>
<button onclick="setFormation('4-3-3')" class="formation-btn px-3 py-1.5 rounded-lg text-sm font-medium bg-indigo-500 text-white transition-colors" data-formation="4-3-3">4-3-3</button>
<button onclick="setFormation('4-4-2')" class="formation-btn px-3 py-1.5 rounded-lg text-sm font-medium text-slate-400 hover:text-white hover:bg-slate-600 transition-colors" data-formation="4-4-2">4-4-2</button>
<button onclick="setFormation('5-3-2')" class="formation-btn px-3 py-1.5 rounded-lg text-sm font-medium text-slate-400 hover:text-white hover:bg-slate-600 transition-colors" data-formation="5-3-2">5-3-2</button>
</div>
<!-- View Toggle -->
<div class="flex items-center gap-1 bg-slate-700/50 rounded-xl p-1">
<button onclick="setView('pitch')" class="view-btn px-3 py-1.5 rounded-lg text-sm bg-indigo-500 text-white transition-colors" data-view="pitch" title="Pitch View">β½</button>
<button onclick="setView('list')" class="view-btn px-3 py-1.5 rounded-lg text-sm text-slate-400 hover:text-white hover:bg-slate-600 transition-colors" data-view="list" title="List View">π</button>
</div>
</div>
</div>
<!-- Squad Summary Bar -->
<div class="flex flex-wrap items-center justify-between gap-3 p-3 bg-slate-700/30 rounded-xl mb-6">
<div class="flex items-center gap-4 text-sm">
<div class="flex items-center gap-2">
<span class="w-2 h-2 bg-emerald-400 rounded-full"></span>
<span class="text-slate-400">Playing:</span>
<span class="font-semibold">11</span>
</div>
<div class="flex items-center gap-2">
<span class="w-2 h-2 bg-slate-500 rounded-full"></span>
<span class="text-slate-400">Bench:</span>
<span class="font-semibold">4</span>
</div>
</div>
<div class="flex items-center gap-4 text-sm">
<div>
<span class="text-slate-400">Total Value:</span>
<span class="font-semibold text-emerald-400 ml-1">Β£{{ totalBudget - budget }}m</span>
</div>
<div>
<span class="text-slate-400">ITB:</span>
<span class="font-semibold text-indigo-400 ml-1">Β£{{ budget }}m</span>
</div>
</div>
</div>
<!-- Pitch View -->
<div id="pitch-view" class="rounded-2xl relative overflow-hidden" style="background: linear-gradient(to bottom, #2d8a4e 0%, #1e7a3e 50%, #2d8a4e 100%);">
<!-- Realistic Pitch Markings -->
<div class="absolute inset-0 pointer-events-none">
<!-- Pitch border -->
<div class="absolute inset-4 border-2 border-white/40 rounded-sm"></div>
<!-- Center line -->
<div class="absolute top-1/2 left-4 right-4 h-0.5 bg-white/40"></div>
<!-- Center circle -->
<div class="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-32 h-32 border-2 border-white/40 rounded-full"></div>
<!-- Center spot -->
<div class="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-2 h-2 bg-white/40 rounded-full"></div>
<!-- Top penalty area -->
<div class="absolute top-4 left-1/2 -translate-x-1/2 w-52 h-20 border-b-2 border-l-2 border-r-2 border-white/40"></div>
<!-- Top goal area -->
<div class="absolute top-4 left-1/2 -translate-x-1/2 w-28 h-8 border-b-2 border-l-2 border-r-2 border-white/40"></div>
<!-- Top penalty spot -->
<div class="absolute top-16 left-1/2 -translate-x-1/2 w-1.5 h-1.5 bg-white/40 rounded-full"></div>
<!-- Top penalty arc -->
<div class="absolute top-20 left-1/2 -translate-x-1/2 w-20 h-10 border-b-2 border-white/40 rounded-b-full"></div>
<!-- Bottom penalty area -->
<div class="absolute bottom-4 left-1/2 -translate-x-1/2 w-52 h-20 border-t-2 border-l-2 border-r-2 border-white/40"></div>
<!-- Bottom goal area -->
<div class="absolute bottom-4 left-1/2 -translate-x-1/2 w-28 h-8 border-t-2 border-l-2 border-r-2 border-white/40"></div>
<!-- Bottom penalty spot -->
<div class="absolute bottom-16 left-1/2 -translate-x-1/2 w-1.5 h-1.5 bg-white/40 rounded-full"></div>
<!-- Bottom penalty arc -->
<div class="absolute bottom-20 left-1/2 -translate-x-1/2 w-20 h-10 border-t-2 border-white/40 rounded-t-full"></div>
<!-- Corner arcs -->
<div class="absolute top-4 left-4 w-4 h-4 border-b-2 border-r-2 border-white/40 rounded-br-full"></div>
<div class="absolute top-4 right-4 w-4 h-4 border-b-2 border-l-2 border-white/40 rounded-bl-full"></div>
<div class="absolute bottom-4 left-4 w-4 h-4 border-t-2 border-r-2 border-white/40 rounded-tr-full"></div>
<div class="absolute bottom-4 right-4 w-4 h-4 border-t-2 border-l-2 border-white/40 rounded-tl-full"></div>
<!-- Grass stripes effect -->
<div class="absolute inset-0 opacity-10" style="background: repeating-linear-gradient(0deg, transparent, transparent 40px, rgba(255,255,255,0.1) 40px, rgba(255,255,255,0.1) 80px);"></div>
</div>
<div class="relative z-10 p-6 sm:p-10 space-y-6 sm:space-y-8">
<!-- Forwards (attacking end) -->
<div id="forwards-row" class="flex justify-center gap-3 sm:gap-6 transition-all duration-300 pt-4">
@foreach(forwards as player)
<div class="player-card relative cursor-grab active:cursor-grabbing" draggable="true" data-player-id="{{ player.id }}" data-position="FWD">
@if(player.isCaptain)
<div class="absolute -top-1 -right-1 w-5 h-5 bg-amber-400 rounded-full text-xs font-bold text-slate-900 flex items-center justify-center z-20 shadow-lg">C</div>
@endif
@if(player.isVice)
<div class="absolute -top-1 -right-1 w-5 h-5 bg-slate-300 rounded-full text-xs font-bold text-slate-900 flex items-center justify-center z-20 shadow-lg">V</div>
@endif
<div class="w-14 h-14 sm:w-16 sm:h-16 rounded-full overflow-hidden border-3 border-white shadow-xl mx-auto bg-slate-700 hover:scale-110 transition-transform duration-200">
<img src="{{ player.img }}" alt="{{ player.name }}" class="w-full h-full object-cover object-top" onerror="this.src='https://via.placeholder.com/64?text=β½'">
</div>
<div class="mt-2 bg-slate-900/90 backdrop-blur rounded-lg px-2 py-1.5 text-center shadow-lg min-w-[70px]">
<div class="text-xs font-bold text-white truncate">{{ player.name }}</div>
<div class="text-[10px] text-emerald-400 font-semibold">{{ player.points }} pts</div>
</div>
</div>
@endforeach
</div>
<!-- Midfielders -->
<div id="midfielders-row" class="flex justify-center gap-3 sm:gap-6 transition-all duration-300">
@foreach(midfielders as player)
<div class="player-card relative cursor-grab active:cursor-grabbing" draggable="true" data-player-id="{{ player.id }}" data-position="MID">
@if(player.isCaptain)
<div class="absolute -top-1 -right-1 w-5 h-5 bg-amber-400 rounded-full text-xs font-bold text-slate-900 flex items-center justify-center z-20 shadow-lg">C</div>
@endif
@if(player.isVice)
<div class="absolute -top-1 -right-1 w-5 h-5 bg-slate-300 rounded-full text-xs font-bold text-slate-900 flex items-center justify-center z-20 shadow-lg">V</div>
@endif
<div class="w-14 h-14 sm:w-16 sm:h-16 rounded-full overflow-hidden border-3 border-white shadow-xl mx-auto bg-slate-700 hover:scale-110 transition-transform duration-200">
<img src="{{ player.img }}" alt="{{ player.name }}" class="w-full h-full object-cover object-top" onerror="this.src='https://via.placeholder.com/64?text=β‘'">
</div>
<div class="mt-2 bg-slate-900/90 backdrop-blur rounded-lg px-2 py-1.5 text-center shadow-lg min-w-[70px]">
<div class="text-xs font-bold text-white truncate">{{ player.name }}</div>
<div class="text-[10px] text-emerald-400 font-semibold">{{ player.points }} pts</div>
</div>
</div>
@endforeach
</div>
<!-- Defenders -->
<div id="defenders-row" class="flex justify-center gap-3 sm:gap-6 transition-all duration-300">
@foreach(defenders as player)
<div class="player-card relative cursor-grab active:cursor-grabbing" draggable="true" data-player-id="{{ player.id }}" data-position="DEF">
@if(player.isCaptain)
<div class="absolute -top-1 -right-1 w-5 h-5 bg-amber-400 rounded-full text-xs font-bold text-slate-900 flex items-center justify-center z-20 shadow-lg">C</div>
@endif
@if(player.isVice)
<div class="absolute -top-1 -right-1 w-5 h-5 bg-slate-300 rounded-full text-xs font-bold text-slate-900 flex items-center justify-center z-20 shadow-lg">V</div>
@endif
<div class="w-14 h-14 sm:w-16 sm:h-16 rounded-full overflow-hidden border-3 border-white shadow-xl mx-auto bg-slate-700 hover:scale-110 transition-transform duration-200">
<img src="{{ player.img }}" alt="{{ player.name }}" class="w-full h-full object-cover object-top" onerror="this.src='https://via.placeholder.com/64?text=π‘οΈ'">
</div>
<div class="mt-2 bg-slate-900/90 backdrop-blur rounded-lg px-2 py-1.5 text-center shadow-lg min-w-[70px]">
<div class="text-xs font-bold text-white truncate">{{ player.name }}</div>
<div class="text-[10px] text-emerald-400 font-semibold">{{ player.points }} pts</div>
</div>
</div>
@endforeach
</div>
<!-- Goalkeeper -->
<div id="goalkeeper-row" class="flex justify-center gap-3 sm:gap-6 pb-4">
@foreach(goalkeepers as player)
<div class="player-card relative cursor-grab active:cursor-grabbing" draggable="true" data-player-id="{{ player.id }}" data-position="GK">
@if(player.isCaptain)
<div class="absolute -top-1 -right-1 w-5 h-5 bg-amber-400 rounded-full text-xs font-bold text-slate-900 flex items-center justify-center z-20 shadow-lg">C</div>
@endif
@if(player.isVice)
<div class="absolute -top-1 -right-1 w-5 h-5 bg-slate-300 rounded-full text-xs font-bold text-slate-900 flex items-center justify-center z-20 shadow-lg">V</div>
@endif
<div class="w-14 h-14 sm:w-16 sm:h-16 rounded-full overflow-hidden border-3 border-amber-400 shadow-xl mx-auto bg-slate-700 hover:scale-110 transition-transform duration-200">
<img src="{{ player.img }}" alt="{{ player.name }}" class="w-full h-full object-cover object-top" onerror="this.src='https://via.placeholder.com/64?text=π§€'">
</div>
<div class="mt-2 bg-slate-900/90 backdrop-blur rounded-lg px-2 py-1.5 text-center shadow-lg min-w-[70px]">
<div class="text-xs font-bold text-white truncate">{{ player.name }}</div>
<div class="text-[10px] text-emerald-400 font-semibold">{{ player.points }} pts</div>
</div>
</div>
@endforeach
</div>
</div>
</div>
<!-- List View (hidden by default) -->
<div id="list-view" class="hidden space-y-4">
<!-- Starting XI -->
<div class="bg-slate-700/30 rounded-xl overflow-hidden">
<div class="p-3 bg-slate-700/50 border-b border-slate-600">
<h4 class="font-semibold text-sm">Starting XI</h4>
</div>
<div class="divide-y divide-slate-700/50">
@foreach(goalkeepers as player)
<div class="flex items-center gap-4 p-3 hover:bg-slate-700/30 transition-colors cursor-pointer">
<div class="w-10 h-10 rounded-lg bg-amber-500/20 flex items-center justify-center text-lg shrink-0">π§€</div>
<div class="flex-1 min-w-0">
<div class="font-semibold text-sm flex items-center gap-2">
{{ player.name }}
@if(player.isCaptain)
<span class="px-1.5 py-0.5 bg-amber-400 text-slate-900 text-[10px] font-bold rounded">C</span>
@endif
@if(player.isVice)
<span class="px-1.5 py-0.5 bg-slate-400 text-slate-900 text-[10px] font-bold rounded">V</span>
@endif
</div>
<div class="text-xs text-slate-400">{{ player.team }} Β· GK</div>
</div>
<div class="text-right shrink-0">
<div class="font-bold text-emerald-400">{{ player.points }}</div>
<div class="text-xs text-slate-500">pts</div>
</div>
<div class="text-right shrink-0 w-16">
<div class="font-semibold">Β£{{ player.price }}m</div>
</div>
</div>
@endforeach
@foreach(defenders as player)
<div class="flex items-center gap-4 p-3 hover:bg-slate-700/30 transition-colors cursor-pointer">
<div class="w-10 h-10 rounded-lg bg-blue-500/20 flex items-center justify-center text-lg shrink-0">π‘οΈ</div>
<div class="flex-1 min-w-0">
<div class="font-semibold text-sm flex items-center gap-2">
{{ player.name }}
@if(player.isCaptain)
<span class="px-1.5 py-0.5 bg-amber-400 text-slate-900 text-[10px] font-bold rounded">C</span>
@endif
@if(player.isVice)
<span class="px-1.5 py-0.5 bg-slate-400 text-slate-900 text-[10px] font-bold rounded">V</span>
@endif
</div>
<div class="text-xs text-slate-400">{{ player.team }} Β· DEF</div>
</div>
<div class="text-right shrink-0">
<div class="font-bold text-emerald-400">{{ player.points }}</div>
<div class="text-xs text-slate-500">pts</div>
</div>
<div class="text-right shrink-0 w-16">
<div class="font-semibold">Β£{{ player.price }}m</div>
</div>
</div>
@endforeach
@foreach(midfielders as player)
<div class="flex items-center gap-4 p-3 hover:bg-slate-700/30 transition-colors cursor-pointer">
<div class="w-10 h-10 rounded-lg bg-purple-500/20 flex items-center justify-center text-lg shrink-0">β‘</div>
<div class="flex-1 min-w-0">
<div class="font-semibold text-sm flex items-center gap-2">
{{ player.name }}
@if(player.isCaptain)
<span class="px-1.5 py-0.5 bg-amber-400 text-slate-900 text-[10px] font-bold rounded">C</span>
@endif
@if(player.isVice)
<span class="px-1.5 py-0.5 bg-slate-400 text-slate-900 text-[10px] font-bold rounded">V</span>
@endif
</div>
<div class="text-xs text-slate-400">{{ player.team }} Β· MID</div>
</div>
<div class="text-right shrink-0">
<div class="font-bold text-emerald-400">{{ player.points }}</div>
<div class="text-xs text-slate-500">pts</div>
</div>
<div class="text-right shrink-0 w-16">
<div class="font-semibold">Β£{{ player.price }}m</div>
</div>
</div>
@endforeach
@foreach(forwards as player)
<div class="flex items-center gap-4 p-3 hover:bg-slate-700/30 transition-colors cursor-pointer">
<div class="w-10 h-10 rounded-lg bg-red-500/20 flex items-center justify-center text-lg shrink-0">β½</div>
<div class="flex-1 min-w-0">
<div class="font-semibold text-sm flex items-center gap-2">
{{ player.name }}
@if(player.isCaptain)
<span class="px-1.5 py-0.5 bg-amber-400 text-slate-900 text-[10px] font-bold rounded">C</span>
@endif
@if(player.isVice)
<span class="px-1.5 py-0.5 bg-slate-400 text-slate-900 text-[10px] font-bold rounded">V</span>
@endif
</div>
<div class="text-xs text-slate-400">{{ player.team }} Β· FWD</div>
</div>
<div class="text-right shrink-0">
<div class="font-bold text-emerald-400">{{ player.points }}</div>
<div class="text-xs text-slate-500">pts</div>
</div>
<div class="text-right shrink-0 w-16">
<div class="font-semibold">Β£{{ player.price }}m</div>
</div>
</div>
@endforeach
</div>
</div>
<!-- Bench in List View -->
<div class="bg-slate-700/30 rounded-xl overflow-hidden">
<div class="p-3 bg-slate-700/50 border-b border-slate-600">
<h4 class="font-semibold text-sm">Substitutes</h4>
</div>
<div class="divide-y divide-slate-700/50">
@foreach(bench as player)
<div class="flex items-center gap-4 p-3 hover:bg-slate-700/30 transition-colors cursor-pointer opacity-70">
<div class="w-10 h-10 rounded-lg bg-slate-600/50 flex items-center justify-center text-lg shrink-0">
@if(player.position === "GK")
π§€
@elseif(player.position === "DEF")
π‘οΈ
@elseif(player.position === "MID")
β‘
@else
β½
@endif
</div>
<div class="flex-1 min-w-0">
<div class="font-semibold text-sm">{{ player.name }}</div>
<div class="text-xs text-slate-400">{{ player.team }} Β· {{ player.position }}</div>
</div>
<div class="text-right shrink-0">
<div class="font-bold text-emerald-400">{{ player.points }}</div>
<div class="text-xs text-slate-500">pts</div>
</div>
<div class="text-right shrink-0 w-16">
<div class="font-semibold">Β£{{ player.price }}m</div>
</div>
</div>
@endforeach
</div>
</div>
</div>
<!-- Bench (Pitch View only) -->
<div id="bench-pitch-view" class="mt-6 pt-6 border-t border-slate-700">
<div class="flex items-center justify-between mb-4">
<h3 class="text-sm font-semibold text-slate-400 uppercase tracking-wide">Substitutes</h3>
<span class="text-xs text-slate-500">Drag players to swap positions</span>
</div>
<div id="bench-row" class="flex justify-center gap-4 sm:gap-6 flex-wrap">
@foreach(bench as player)
<div class="player-card bench-player relative cursor-grab active:cursor-grabbing opacity-80 hover:opacity-100 transition-all" draggable="true" data-player-id="{{ player.id }}" data-position="{{ player.position }}">
<div class="w-14 h-14 sm:w-16 sm:h-16 rounded-full overflow-hidden border-2 border-slate-500 shadow-lg mx-auto bg-slate-700 hover:scale-110 transition-transform duration-200 hover:border-indigo-400">
<img src="{{ player.img }}" alt="{{ player.name }}" class="w-full h-full object-cover object-top" onerror="this.src='https://via.placeholder.com/64?text=π€'">
</div>
<div class="mt-2 bg-slate-700/90 backdrop-blur rounded-lg px-2 py-1.5 text-center shadow-lg min-w-[70px]">
<div class="text-xs font-bold text-white truncate">{{ player.name }}</div>
<div class="text-[10px] text-slate-400">{{ player.position }}</div>
<div class="text-[10px] text-emerald-400 font-semibold">{{ player.points }} pts</div>
</div>
</div>
@endforeach
</div>
</div>
<!-- Action Buttons -->
<div class="flex gap-4 mt-6">
<button class="flex-1 py-3 px-6 rounded-xl bg-slate-700 hover:bg-slate-600 text-slate-300 font-semibold transition-colors border border-slate-600">Auto Pick</button>
<button class="flex-1 py-3 px-6 rounded-xl bg-gradient-to-r from-indigo-500 to-purple-500 hover:from-indigo-600 hover:to-purple-600 text-white font-semibold transition-all hover:-translate-y-0.5 hover:shadow-lg hover:shadow-indigo-500/30">Save Team</button>
</div>
</div>
<!-- Fixtures and Top Players Row -->
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 md:gap-6 mt-6">
<!-- Upcoming Fixtures -->
<div class="bg-slate-800 rounded-2xl p-4 md:p-6 border border-slate-700">
<h3 class="text-sm font-semibold text-slate-400 uppercase tracking-wide mb-4">Upcoming Fixtures</h3>
<div class="space-y-2">
@foreach(fixtures as fixture)
<div class="flex items-center justify-between p-2 md:p-3 bg-slate-700/50 rounded-xl hover:bg-slate-600/50 cursor-pointer transition-colors" onclick="showFixtureDetail(this)">
<div class="flex items-center gap-2">
<span class="font-semibold text-sm">{{ fixture.home }}</span>
<span class="text-xs text-slate-500">vs</span>
<span class="font-semibold text-sm">{{ fixture.away }}</span>
</div>
<div class="text-sm font-semibold text-indigo-400">{{ fixture.time }}</div>
</div>
@endforeach
</div>
</div>
<!-- Top Players -->
<div class="bg-slate-800 rounded-2xl p-4 md:p-6 border border-slate-700">
<h3 class="text-sm font-semibold text-slate-400 uppercase tracking-wide mb-4">Top Players</h3>
<div class="space-y-2">
@foreach(topPlayers as player)
<div class="flex items-center gap-3 p-2 md:p-3 bg-slate-700/50 rounded-xl hover:bg-slate-600/50 transition-colors cursor-pointer" onclick="showPlayerModal('{{ player.name }}', '{{ player.team }}', {{ player.points }}, '{{ player.form }}')">
@if(player.isFirst)
<div class="w-6 h-6 md:w-7 md:h-7 bg-gradient-to-br from-amber-400 to-yellow-500 rounded-lg flex items-center justify-center text-xs font-bold text-slate-900">1</div>
@else
<div class="w-6 h-6 md:w-7 md:h-7 bg-gradient-to-br from-indigo-500 to-purple-500 rounded-lg flex items-center justify-center text-xs font-bold">{{ loop.iteration }}</div>
@endif
<div class="flex-1 min-w-0">
<div class="font-semibold text-sm truncate">{{ player.name }}</div>
<div class="text-xs text-slate-500">{{ player.team }}</div>
</div>
<div class="text-right">
<div class="font-bold text-sm text-emerald-400">{{ player.points }}</div>
<div class="text-xs text-slate-500">{{ player.form }}</div>
</div>
</div>
@endforeach
</div>
</div>
</div>
</div><!-- End Tab: Team -->
<!-- Tab Content: Transfers -->
<div id="tab-transfers" class="tab-content hidden">
<div class="bg-slate-800 rounded-2xl p-4 md:p-6 border border-slate-700 mb-6">
<div class="flex flex-col md:flex-row md:items-center justify-between gap-4 mb-6">
<div>
<h2 class="text-lg font-bold">Transfer Market</h2>
<p class="text-sm text-slate-400">Find players to strengthen your squad</p>
</div>
<div class="flex items-center gap-3">
<div class="text-sm">
<span class="text-slate-400">Budget:</span>
<span class="font-bold text-emerald-400 ml-1">Β£{{ budget }}m</span>
</div>
<div class="text-sm">
<span class="text-slate-400">Free Transfers:</span>
<span class="font-bold text-indigo-400 ml-1">{{ freeTransfers }}</span>
</div>
</div>
</div>
<!-- Search and Filters -->
<div class="flex flex-col md:flex-row gap-3 mb-6">
<div class="flex-1 relative">
<input type="text" placeholder="Search players..." class="w-full bg-slate-700 border border-slate-600 rounded-xl px-4 py-3 pl-10 text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500" id="player-search">
<span class="absolute left-3 top-1/2 -translate-y-1/2 text-slate-400">π</span>
</div>
<select class="bg-slate-700 border border-slate-600 rounded-xl px-4 py-3 text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500" id="position-filter">
<option value="all">All Positions</option>
<option value="GK">Goalkeepers</option>
<option value="DEF">Defenders</option>
<option value="MID">Midfielders</option>
<option value="FWD">Forwards</option>
</select>
<select class="bg-slate-700 border border-slate-600 rounded-xl px-4 py-3 text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500" id="sort-by">
<option value="points">Sort by Points</option>
<option value="price">Sort by Price</option>
<option value="form">Sort by Form</option>
<option value="selected">Sort by Selected %</option>
</select>
</div>
<!-- Player List -->
<div class="space-y-3">
@foreach(transferMarket as player)
<div class="flex items-center gap-4 p-4 bg-slate-700/50 rounded-xl hover:bg-slate-600/50 transition-colors">
<div class="w-12 h-12 rounded-xl bg-gradient-to-br from-indigo-500 to-purple-500 flex items-center justify-center text-xl">
@if(player.position === "GK")
π§€
@elseif(player.position === "DEF")
π‘οΈ
@elseif(player.position === "MID")
β‘
@else
β½
@endif
</div>
<div class="flex-1 min-w-0">
<div class="font-semibold">{{ player.name }}</div>
<div class="text-sm text-slate-400">{{ player.team }} Β· {{ player.position }}</div>
</div>
<div class="hidden md:block text-center px-4">
<div class="font-bold text-emerald-400">{{ player.points }}</div>
<div class="text-xs text-slate-500">Points</div>
</div>
<div class="hidden md:block text-center px-4">
<div class="font-bold">{{ player.form }}</div>
<div class="text-xs text-slate-500">Form</div>
</div>
<div class="hidden md:block text-center px-4">
<div class="font-bold text-slate-300">{{ player.selected }}</div>
<div class="text-xs text-slate-500">Selected</div>
</div>
<div class="text-right">
<div class="font-bold text-lg">Β£{{ player.price }}m</div>
</div>
<button onclick="showBuyModal('{{ player.name }}', '{{ player.team }}', {{ player.price }})" class="px-4 py-2 bg-emerald-500 hover:bg-emerald-600 text-white font-semibold rounded-xl transition-colors text-sm">
Buy
</button>
</div>
@endforeach
</div>
</div>
</div><!-- End Tab: Transfers -->
<!-- Tab Content: Points -->
<div id="tab-points" class="tab-content hidden">
<div class="bg-slate-800 rounded-2xl p-4 md:p-6 border border-slate-700 mb-6">
<h2 class="text-lg font-bold mb-6">Points History</h2>
<!-- Current GW Summary -->
<div class="bg-gradient-to-r from-indigo-500/20 to-purple-500/20 rounded-xl p-6 mb-6 border border-indigo-500/30">
<div class="flex justify-between items-center">
<div>
<div class="text-sm text-slate-400">Gameweek {{ gameweek }}</div>
<div class="text-3xl font-bold">{{ totalPoints }} pts</div>
</div>
<div class="text-right">
<div class="text-sm text-slate-400">Overall Rank</div>
<div class="text-2xl font-bold text-indigo-400">#{{ rank }}</div>
</div>
</div>
</div>
<!-- History Table -->
<div class="overflow-x-auto">
<table class="w-full">
<thead>
<tr class="text-left text-sm text-slate-400 border-b border-slate-700">
<th class="pb-3 font-medium">Gameweek</th>
<th class="pb-3 font-medium">Points</th>
<th class="pb-3 font-medium">Avg</th>
<th class="pb-3 font-medium">Rank</th>
<th class="pb-3 font-medium">+/-</th>
</tr>
</thead>
<tbody class="divide-y divide-slate-700/50">
@foreach(gameweekHistory as gw)
<tr class="hover:bg-slate-700/30 transition-colors">
<td class="py-4 font-medium">GW{{ gw.gw }}</td>
<td class="py-4">
<span class="font-bold text-emerald-400">{{ gw.points }}</span>
</td>
<td class="py-4 text-slate-400">{{ gw.avgPoints }}</td>
<td class="py-4">#{{ gw.rank }}</td>
<td class="py-4">
@if(gw.points > gw.avgPoints)
<span class="text-emerald-400">+{{ gw.points - gw.avgPoints }}</span>
@else
<span class="text-red-400">{{ gw.points - gw.avgPoints }}</span>
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div><!-- End Tab: Points -->
<!-- Tab Content: Fixtures -->
<div id="tab-fixtures" class="tab-content hidden">
<div class="bg-slate-800 rounded-2xl p-4 md:p-6 border border-slate-700">
<h2 class="text-lg font-bold mb-6">Upcoming Fixtures</h2>
<div class="space-y-4">
@foreach(fixtures as fixture)
<div class="bg-slate-700/50 rounded-xl p-4 hover:bg-slate-600/50 transition-colors">
<div class="flex items-center justify-between mb-3">
<span class="text-sm text-slate-400">{{ fixture.time }}</span>
<span class="text-xs bg-indigo-500/20 text-indigo-400 px-2 py-1 rounded-full">Premier League</span>
</div>
<div class="flex items-center justify-between">
<div class="flex-1 text-right">
<div class="font-bold text-lg">{{ fixture.home }}</div>
</div>
<div class="px-6 text-center">
<div class="text-2xl font-bold text-slate-500">vs</div>
</div>
<div class="flex-1 text-left">
<div class="font-bold text-lg">{{ fixture.away }}</div>
</div>
</div>
</div>
@endforeach
</div>
</div>
</div><!-- End Tab: Fixtures -->
<!-- Tab Content: Leagues -->
<div id="tab-leagues" class="tab-content hidden">
<div class="bg-slate-800 rounded-2xl p-4 md:p-6 border border-slate-700 mb-6">
<div class="flex justify-between items-center mb-6">
<h2 class="text-lg font-bold">My Leagues</h2>
<button onclick="showCreateLeagueModal()" class="px-4 py-2 bg-indigo-500 hover:bg-indigo-600 text-white font-semibold rounded-xl transition-colors text-sm flex items-center gap-2">
<span>+</span> Create League
</button>
</div>
<div class="space-y-3">
@foreach(leagues as league)
<div class="flex items-center justify-between p-4 bg-slate-700/50 rounded-xl hover:bg-slate-600/50 transition-colors cursor-pointer" onclick="showLeagueDetail('{{ league.name }}')">
<div class="flex items-center gap-4">
<div class="w-12 h-12 rounded-xl bg-gradient-to-br from-indigo-500 to-purple-500 flex items-center justify-center text-xl">π</div>
<div>
<div class="font-semibold">{{ league.name }}</div>
<div class="text-sm text-slate-400">{{ league.members }} members</div>
</div>
</div>
<div class="text-right">
@if(league.isTop3)
<div class="text-2xl font-bold text-amber-400">#{{ league.rank }}</div>
@else
<div class="text-2xl font-bold text-indigo-400">#{{ league.rank }}</div>
@endif
</div>
</div>
@endforeach
</div>
</div>
<!-- Join League -->
<div class="bg-slate-800 rounded-2xl p-4 md:p-6 border border-slate-700">
<h3 class="font-bold mb-4">Join a League</h3>
<div class="flex gap-3">
<input type="text" placeholder="Enter league code..." class="flex-1 bg-slate-700 border border-slate-600 rounded-xl px-4 py-3 text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500">
<button class="px-6 py-3 bg-emerald-500 hover:bg-emerald-600 text-white font-semibold rounded-xl transition-colors">Join</button>
</div>
</div>
</div><!-- End Tab: Leagues -->
</main>
</div>
<!-- Mobile Bottom Navigation -->
<nav class="lg:hidden fixed bottom-0 left-0 right-0 bg-slate-800 border-t border-slate-700 flex justify-around py-2 px-4 z-50" id="mobile-nav">
<button onclick="showTab('team')" class="mobile-nav-btn flex flex-col items-center gap-1 p-2 text-indigo-400" data-tab="team">
<span class="text-xl">π₯</span>
<span class="text-xs font-medium">Team</span>
</button>
<button onclick="showTab('transfers')" class="mobile-nav-btn flex flex-col items-center gap-1 p-2 text-slate-500 hover:text-slate-300 transition-colors" data-tab="transfers">
<span class="text-xl">π</span>
<span class="text-xs font-medium">Transfers</span>
</button>
<button onclick="showTab('points')" class="mobile-nav-btn flex flex-col items-center gap-1 p-2 text-slate-500 hover:text-slate-300 transition-colors" data-tab="points">
<span class="text-xl">β</span>
<span class="text-xs font-medium">Points</span>
</button>
<button onclick="showTab('fixtures')" class="mobile-nav-btn flex flex-col items-center gap-1 p-2 text-slate-500 hover:text-slate-300 transition-colors" data-tab="fixtures">
<span class="text-xl">π
</span>
<span class="text-xs font-medium">Fixtures</span>
</button>
<button onclick="showTab('leagues')" class="mobile-nav-btn flex flex-col items-center gap-1 p-2 text-slate-500 hover:text-slate-300 transition-colors" data-tab="leagues">
<span class="text-xl">π</span>
<span class="text-xs font-medium">Leagues</span>
</button>
</nav>
<!-- Modal Overlay -->
<div id="modal-overlay" class="hidden fixed inset-0 bg-black/60 backdrop-blur-sm z-50 flex items-center justify-center p-4" onclick="closeModal(event)">
<!-- Player Modal -->
<div id="player-modal" class="hidden bg-slate-800 rounded-2xl border border-slate-700 w-full max-w-md overflow-hidden" onclick="event.stopPropagation()">
<div class="bg-gradient-to-r from-indigo-500 to-purple-500 p-6">
<div class="flex justify-between items-start">
<div>
<h3 class="text-xl font-bold" id="modal-player-name">Player Name</h3>
<p class="text-sm opacity-90" id="modal-player-team">Team</p>
</div>
<button onclick="closeModal()" class="w-8 h-8 rounded-lg bg-white/20 hover:bg-white/30 flex items-center justify-center transition-colors">β</button>
</div>
</div>
<div class="p-6">
<div class="grid grid-cols-3 gap-4 mb-6">
<div class="text-center p-3 bg-slate-700/50 rounded-xl">
<div class="text-2xl font-bold text-emerald-400" id="modal-player-points">0</div>
<div class="text-xs text-slate-400">Points</div>
</div>
<div class="text-center p-3 bg-slate-700/50 rounded-xl">
<div class="text-2xl font-bold" id="modal-player-form">0.0</div>
<div class="text-xs text-slate-400">Form</div>
</div>
<div class="text-center p-3 bg-slate-700/50 rounded-xl">
<div class="text-2xl font-bold text-indigo-400" id="modal-player-price">Β£0m</div>
<div class="text-xs text-slate-400">Price</div>
</div>
</div>
<div class="flex gap-3">
<button onclick="closeModal()" class="flex-1 py-3 px-4 rounded-xl bg-slate-700 hover:bg-slate-600 text-slate-300 font-semibold transition-colors">Close</button>
<button class="flex-1 py-3 px-4 rounded-xl bg-emerald-500 hover:bg-emerald-600 text-white font-semibold transition-colors">Add to Team</button>
</div>
</div>
</div>
<!-- Buy Player Modal -->
<div id="buy-modal" class="hidden bg-slate-800 rounded-2xl border border-slate-700 w-full max-w-md overflow-hidden" onclick="event.stopPropagation()">
<div class="p-6 border-b border-slate-700">
<div class="flex justify-between items-center">
<h3 class="text-lg font-bold">Confirm Transfer</h3>
<button onclick="closeModal()" class="w-8 h-8 rounded-lg bg-slate-700 hover:bg-slate-600 flex items-center justify-center transition-colors">β</button>
</div>
</div>
<div class="p-6">
<div class="bg-slate-700/50 rounded-xl p-4 mb-4">
<div class="flex items-center gap-4">
<div class="w-14 h-14 rounded-xl bg-gradient-to-br from-emerald-500 to-teal-500 flex items-center justify-center text-2xl">β½</div>
<div>
<div class="font-bold text-lg" id="buy-player-name">Player Name</div>