File size: 38,204 Bytes
829121e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>SportsBet Pro Calculator | Advanced Player Prop Analysis</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#1e40af',
                        secondary: '#1e3a8a',
                        accent: '#3b82f6',
                        dark: '#0f172a',
                        light: '#f8fafc'
                    }
                }
            }
        }
    </script>
    <style>
        .gradient-bg {
            background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
        }
        .card-shadow {
            box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }
        .input-highlight {
            transition: all 0.3s ease;
        }
        .input-highlight:focus {
            border-color: #3b82f6;
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
        }
        .tab-active {
            border-bottom: 3px solid #3b82f6;
            color: #3b82f6;
            font-weight: 600;
        }
        .result-card {
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }
        .result-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }
    </style>
</head>
<body class="bg-gray-50 min-h-screen">
    <!-- Header -->
    <header class="gradient-bg text-white">
        <div class="container mx-auto px-4 py-6">
            <div class="flex justify-between items-center">
                <div class="flex items-center space-x-2">
                    <i class="fas fa-calculator text-3xl"></i>
                    <h1 class="text-2xl font-bold">SportsBet Pro</h1>
                </div>
                <nav>
                    <ul class="flex space-x-6">
                        <li><a href="#calculator" class="hover:text-blue-200 transition">Calculator</a></li>
                    </ul>
                </nav>
            </div>
        </div>
    </header>

    <!-- Hero Section -->
    <section class="gradient-bg text-white py-16">
        <div class="container mx-auto px-4 text-center">
            <h2 class="text-4xl font-bold mb-4">Advanced Player Prop Calculator</h2>
            <p class="text-xl max-w-2xl mx-auto mb-8">Analyze and compare no-vig probabilities and statistical predictions for player props with our professional tools</p>
            <a href="#calculator" class="bg-white text-primary px-6 py-3 rounded-lg font-semibold hover:bg-blue-50 transition inline-block">Get Started</a>
        </div>
    </section>

    <!-- Calculator Section -->
    <section id="calculator" class="py-12 bg-white">
        <div class="container mx-auto px-4">
            <h2 class="text-3xl font-bold text-center mb-12 text-dark">Player Prop Calculator</h2>
            
            <!-- Tabs -->
            <div class="flex justify-center mb-8 border-b border-gray-200">
                <button id="noVigTab" class="px-6 py-3 font-medium text-gray-600 hover:text-primary transition tab-active">No-Vig Calculator</button>
                <button id="statisticalTab" class="px-6 py-3 font-medium text-gray-600 hover:text-primary transition">Statistical Prediction</button>
                <button id="compareTab" class="px-6 py-3 font-medium text-gray-600 hover:text-primary transition">Compare Results</button>
            </div>
            
            <!-- No-Vig Calculator -->
            <div id="noVigContent" class="calculator-content">
                <div class="max-w-4xl mx-auto bg-gray-50 rounded-xl p-8 card-shadow">
                    <h3 class="text-2xl font-semibold mb-6 text-dark">No-Vig Probability Calculator</h3>
                    <div class="grid md:grid-cols-2 gap-6">
                        <div>
                            <label class="block text-gray-700 mb-2">Over Odds (American)</label>
                            <input type="number" id="overOdds" placeholder="-122" class="w-full px-4 py-2 border rounded-lg input-highlight">
                        </div>
                        <div>
                            <label class="block text-gray-700 mb-2">Under Odds (American)</label>
                            <input type="number" id="underOdds" placeholder="+162" class="w-full px-4 py-2 border rounded-lg input-highlight">
                        </div>
                    </div>
                    <div class="mt-6">
                        <label class="block text-gray-700 mb-2">Player Name (Optional)</label>
                        <input type="text" id="playerName" placeholder="Search player..." class="w-full px-4 py-2 border rounded-lg input-highlight">
                    </div>
                    <div class="mt-6">
                        <label class="block text-gray-700 mb-2">Stat Type</label>
                        <select id="statType" class="w-full px-4 py-2 border rounded-lg input-highlight">
                            <option value="points">Points</option>
                            <option value="rebounds">Rebounds</option>
                            <option value="assists">Assists</option>
                            <option value="other">Other</option>
                        </select>
                    </div>
                    <button id="calculateNoVig" class="mt-8 bg-primary text-white px-6 py-3 rounded-lg font-semibold hover:bg-secondary transition w-full">Calculate No-Vig Probabilities</button>
                </div>
                
                <!-- Results -->
                <div id="noVigResults" class="max-w-4xl mx-auto mt-8 hidden">
                    <div class="bg-white rounded-xl p-8 card-shadow">
                        <h4 class="text-xl font-semibold mb-4 text-dark">No-Vig Probability Results</h4>
                        <div class="grid md:grid-cols-2 gap-6">
                            <div class="result-card bg-gray-50 p-6 rounded-lg">
                                <h5 class="font-medium text-gray-700 mb-2">Over Probability</h5>
                                <p id="overProb" class="text-3xl font-bold text-primary">--%</p>
                            </div>
                            <div class="result-card bg-gray-50 p-6 rounded-lg">
                                <h5 class="font-medium text-gray-700 mb-2">Under Probability</h5>
                                <p id="underProb" class="text-3xl font-bold text-primary">--%</p>
                            </div>
                        </div>
                        <div class="mt-6">
                            <button id="saveNoVig" class="bg-accent text-white px-4 py-2 rounded-lg font-medium hover:bg-blue-500 transition">Save for Comparison</button>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- Statistical Prediction -->
            <div id="statisticalContent" class="calculator-content hidden">
                <div class="max-w-4xl mx-auto bg-gray-50 rounded-xl p-8 card-shadow">
                    <h3 class="text-2xl font-semibold mb-6 text-dark">Statistical Prediction Calculator</h3>
                    <div class="grid md:grid-cols-2 gap-6">
                        <div>
                            <label class="block text-gray-700 mb-2">Projected Mean (μ)</label>
                            <input type="number" step="0.1" id="meanValue" placeholder="e.g. 22.5" class="w-full px-4 py-2 border rounded-lg input-highlight">
                        </div>
                        <div>
                            <label class="block text-gray-700 mb-2">Standard Deviation (σ)</label>
                            <div class="flex">
                                <input type="number" step="0.1" id="stdDevValue" placeholder="e.g. 5.2" class="w-full px-4 py-2 border rounded-l-lg input-highlight">
                                <button id="calculateStdDev" class="bg-gray-200 px-4 py-2 border rounded-r-lg hover:bg-gray-300 transition">Calculate σ</button>
                            </div>
                        </div>
                    </div>
                    <div class="mt-6">
                        <label class="block text-gray-700 mb-2">Line Value (X)</label>
                        <input type="number" step="0.1" id="lineValue" placeholder="e.g. 24.5" class="w-full px-4 py-2 border rounded-lg input-highlight">
                    </div>
                    <div class="mt-6">
                        <label class="block text-gray-700 mb-2">Player Name (Optional)</label>
                        <input type="text" id="statPlayerName" placeholder="Search player..." class="w-full px-4 py-2 border rounded-lg input-highlight">
                    </div>
                    <div class="mt-6">
                        <label class="block text-gray-700 mb-2">Stat Type</label>
                        <select id="statStatType" class="w-full px-4 py-2 border rounded-lg input-highlight">
                            <option value="points">Points</option>
                            <option value="rebounds">Rebounds</option>
                            <option value="assists">Assists</option>
                            <option value="other">Other</option>
                        </select>
                    </div>
                    <button id="calculateStatistical" class="mt-8 bg-primary text-white px-6 py-3 rounded-lg font-semibold hover:bg-secondary transition w-full">Calculate Statistical Probabilities</button>
                </div>
                
                <!-- Std Dev Calculator Modal -->
                <div id="stdDevModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center hidden z-50">
                    <div class="bg-white rounded-xl p-8 max-w-md w-full mx-4">
                        <h4 class="text-xl font-semibold mb-4">Calculate Standard Deviation</h4>
                        <div class="mb-4">
                            <label class="block text-gray-700 mb-2">Enter historical data (comma separated)</label>
                            <textarea id="historicalData" class="w-full px-4 py-2 border rounded-lg input-highlight" rows="4" placeholder="e.g. 18, 22, 25, 19, 21"></textarea>
                        </div>
                        <div class="flex justify-end space-x-4">
                            <button id="cancelStdDev" class="px-4 py-2 border rounded-lg hover:bg-gray-100 transition">Cancel</button>
                            <button id="confirmStdDev" class="bg-primary text-white px-4 py-2 rounded-lg hover:bg-secondary transition">Calculate</button>
                        </div>
                    </div>
                </div>
                
                <!-- Results -->
                <div id="statisticalResults" class="max-w-4xl mx-auto mt-8 hidden">
                    <div class="bg-white rounded-xl p-8 card-shadow">
                        <h4 class="text-xl font-semibold mb-4 text-dark">Statistical Prediction Results</h4>
                        <div class="grid md:grid-cols-2 gap-6">
                            <div class="result-card bg-gray-50 p-6 rounded-lg">
                                <h5 class="font-medium text-gray-700 mb-2">Probability Over</h5>
                                <p id="statOverProb" class="text-3xl font-bold text-primary">--%</p>
                                <p class="text-sm text-gray-500 mt-1">(1−Φ((X−μ)/σ))×100%</p>
                            </div>
                            <div class="result-card bg-gray-50 p-6 rounded-lg">
                                <h5 class="font-medium text-gray-700 mb-2">Probability Under</h5>
                                <p id="statUnderProb" class="text-3xl font-bold text-primary">--%</p>
                                <p class="text-sm text-gray-500 mt-1">Φ((X−μ)/σ)×100%</p>
                            </div>
                        </div>
                        <div class="mt-6">
                            <button id="saveStatistical" class="bg-accent text-white px-4 py-2 rounded-lg font-medium hover:bg-blue-500 transition">Save for Comparison</button>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- Compare Results -->
            <div id="compareContent" class="calculator-content hidden">
                <div class="max-w-4xl mx-auto bg-gray-50 rounded-xl p-8 card-shadow">
                    <h3 class="text-2xl font-semibold mb-6 text-dark">Compare Calculation Methods</h3>
                    
                    <div id="noSavedResults" class="text-center py-8">
                        <i class="fas fa-exchange-alt text-4xl text-gray-300 mb-4"></i>
                        <p class="text-gray-500">No saved results to compare yet. Calculate and save results from the other tabs to compare them here.</p>
                    </div>
                    
                    <div id="comparisonResults" class="hidden">
                        <div class="grid md:grid-cols-2 gap-6 mb-8">
                            <div class="bg-white p-6 rounded-lg card-shadow">
                                <h4 class="text-lg font-semibold mb-4" id="compareMethod1">Method 1</h4>
                                <div class="space-y-4">
                                    <div>
                                        <p class="text-gray-600">Over Probability</p>
                                        <p class="text-xl font-bold" id="compareOver1">--%</p>
                                    </div>
                                    <div>
                                        <p class="text-gray-600">Under Probability</p>
                                        <p class="text-xl font-bold" id="compareUnder1">--%</p>
                                    </div>
                                </div>
                            </div>
                            <div class="bg-white p-6 rounded-lg card-shadow">
                                <h4 class="text-lg font-semibold mb-4" id="compareMethod2">Method 2</h4>
                                <div class="space-y-4">
                                    <div>
                                        <p class="text-gray-600">Over Probability</p>
                                        <p class="text-xl font-bold" id="compareOver2">--%</p>
                                    </div>
                                    <div>
                                        <p class="text-gray-600">Under Probability</p>
                                        <p class="text-xl font-bold" id="compareUnder2">--%</p>
                                    </div>
                                </div>
                            </div>
                        </div>
                        
                        <div class="bg-white p-6 rounded-lg card-shadow">
                            <h4 class="text-lg font-semibold mb-4">Comparison Analysis</h4>
                            <div class="space-y-4">
                                <div>
                                    <p class="text-gray-600">Over Probability Difference</p>
                                    <p class="text-xl font-bold" id="overDiff">--%</p>
                                </div>
                                <div>
                                    <p class="text-gray-600">Under Probability Difference</p>
                                    <p class="text-xl font-bold" id="underDiff">--%</p>
                                </div>
                                <div>
                                    <p class="text-gray-600">Recommendation</p>
                                    <p class="text-lg font-semibold" id="recommendation">--</p>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- How to Use Section -->
    <section id="how-to-use" class="py-12 bg-gray-50">
        <div class="container mx-auto px-4">
            <h2 class="text-3xl font-bold text-center mb-12 text-dark">How to Use the Calculator</h2>
            
            <div class="max-w-4xl mx-auto">
                <div class="bg-white rounded-xl p-8 card-shadow mb-8">
                    <h3 class="text-2xl font-semibold mb-4 text-dark flex items-center">
                        <i class="fas fa-percentage mr-3 text-primary"></i> No-Vig Calculator
                    </h3>
                    <div class="space-y-4">
                        <p>1. <strong>Find player prop odds</strong> from sportsbooks like FanDuel (search at <a href="https://sportsbook.fanduel.com/search" class="text-accent hover:underline" target="_blank">sportsbook.fanduel.com/search</a>)</p>
                        <p>2. <strong>Enter the American odds</strong> for both Over and Under (e.g., -122 for Over, +162 for Under)</p>
                        <p>3. Optionally enter the player name and stat type for reference</p>
                        <p>4. Click "Calculate No-Vig Probabilities" to see the true probabilities without the bookmaker's vig</p>
                        <p>5. Save results to compare with other methods</p>
                    </div>
                </div>
                
                <div class="bg-white rounded-xl p-8 card-shadow mb-8">
                    <h3 class="text-2xl font-semibold mb-4 text-dark flex items-center">
                        <i class="fas fa-chart-line mr-3 text-primary"></i> Statistical Prediction
                    </h3>
                    <div class="space-y-4">
                        <p>1. <strong>Determine the projected mean (μ)</strong> for the player's performance (based on historical data or projections)</p>
                        <p>2. <strong>Enter the standard deviation (σ)</strong> or calculate it using historical data</p>
                        <p>3. <strong>Input the line value (X)</strong> you want to evaluate against</p>
                        <p>4. Optionally enter the player name and stat type for reference</p>
                        <p>5. Click "Calculate Statistical Probabilities" to see the predicted probabilities</p>
                        <p>6. Save results to compare with other methods</p>
                    </div>
                </div>
                
                <div class="bg-white rounded-xl p-8 card-shadow">
                    <h3 class="text-2xl font-semibold mb-4 text-dark flex items-center">
                        <i class="fas fa-balance-scale mr-3 text-primary"></i> Compare Results
                    </h3>
                    <div class="space-y-4">
                        <p>1. <strong>Calculate and save results</strong> from both methods above</p>
                        <p>2. <strong>Navigate to the Compare tab</strong> to view side-by-side analysis</p>
                        <p>3. The calculator will show probability differences and provide a recommendation</p>
                        <p>4. Use this comparison to identify potential value bets where methods disagree</p>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- About Section -->
    <section id="about" class="py-12 bg-white">
        <div class="container mx-auto px-4">
            <div class="max-w-4xl mx-auto">
                <h2 class="text-3xl font-bold text-center mb-12 text-dark">About SportsBet Pro Calculator</h2>
                
                <div class="bg-gray-50 rounded-xl p-8 card-shadow">
                    <div class="space-y-6">
                        <div>
                            <h3 class="text-xl font-semibold mb-2 text-dark">No-Vig Probability</h3>
                            <p class="text-gray-700">The no-vig calculator removes the bookmaker's margin (vigorish) to show the true implied probabilities of each outcome. This helps you understand the market's actual assessment of probabilities without the book's built-in advantage.</p>
                        </div>
                        
                        <div>
                            <h3 class="text-xl font-semibold mb-2 text-dark">Statistical Prediction</h3>
                            <p class="text-gray-700">Using the normal distribution formula, this method calculates the probability of a player exceeding or falling short of a given line based on their projected performance (mean) and consistency (standard deviation). The formula used is:</p>
                            <div class="bg-gray-100 p-4 rounded-lg mt-2">
                                <p class="font-mono text-sm">
                                    Probability Over = (1−Φ((X−μ)/σ))×100%<br>
                                    Probability Under = Φ((X−μ)/σ)×100%
                                </p>
                            </div>
                            <p class="text-gray-700 mt-2">Where Φ is the cumulative distribution function of the standard normal distribution.</p>
                        </div>
                        
                        <div>
                            <h3 class="text-xl font-semibold mb-2 text-dark">Standard Deviation</h3>
                            <p class="text-gray-700">Standard deviation (σ) measures how spread out a player's performance is from their average. A higher σ means more variability in outcomes. You can calculate σ by entering historical performance data for the player.</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Footer -->
    <footer class="bg-dark text-white py-8">
        <div class="container mx-auto px-4">
            <div class="flex flex-col md:flex-row justify-between items-center">
                <div class="flex items-center space-x-2 mb-4 md:mb-0">
                    <i class="fas fa-calculator text-2xl"></i>
                    <span class="text-xl font-bold">SportsBet Pro</span>
                </div>
                <div class="text-center md:text-right">
                    <p class="text-gray-400">© 2023 SportsBet Pro Calculator. All rights reserved.</p>
                    <p class="text-gray-400 text-sm mt-1">For entertainment purposes only. Gamble responsibly.</p>
                </div>
            </div>
        </div>
    </footer>

    <script>
        // Tab functionality
        document.addEventListener('DOMContentLoaded', function() {
            const tabs = {
                noVig: {
                    tab: document.getElementById('noVigTab'),
                    content: document.getElementById('noVigContent')
                },
                statistical: {
                    tab: document.getElementById('statisticalTab'),
                    content: document.getElementById('statisticalContent')
                },
                compare: {
                    tab: document.getElementById('compareTab'),
                    content: document.getElementById('compareContent')
                }
            };
            
            // Initialize first tab as active
            activateTab('noVig');
            
            // Tab click events
            tabs.noVig.tab.addEventListener('click', () => activateTab('noVig'));
            tabs.statistical.tab.addEventListener('click', () => activateTab('statistical'));
            tabs.compare.tab.addEventListener('click', () => activateTab('compare'));
            
            function activateTab(activeTab) {
                // Reset all tabs and contents
                Object.keys(tabs).forEach(tab => {
                    tabs[tab].tab.classList.remove('tab-active');
                    tabs[tab].content.classList.add('hidden');
                });
                
                // Activate selected tab
                tabs[activeTab].tab.classList.add('tab-active');
                tabs[activeTab].content.classList.remove('hidden');
                
                // Update comparison view if needed
                if (activeTab === 'compare') {
                    updateComparisonView();
                }
            }
            
            // No-Vig Calculator
            document.getElementById('calculateNoVig').addEventListener('click', calculateNoVig);
            
            function calculateNoVig() {
                const overOdds = parseFloat(document.getElementById('overOdds').value);
                const underOdds = parseFloat(document.getElementById('underOdds').value);
                
                if (isNaN(overOdds) || isNaN(underOdds)) {
                    alert('Please enter valid odds for both Over and Under');
                    return;
                }
                
                // Convert American odds to implied probabilities
                const overProb = americanToImplied(overOdds);
                const underProb = americanToImplied(underOdds);
                
                // Calculate no-vig probabilities
                const totalProb = overProb + underProb;
                const noVigOver = (overProb / totalProb) * 100;
                const noVigUnder = (underProb / totalProb) * 100;
                
                // Display results
                document.getElementById('overProb').textContent = noVigOver.toFixed(2) + '%';
                document.getElementById('underProb').textContent = noVigUnder.toFixed(2) + '%';
                document.getElementById('noVigResults').classList.remove('hidden');
                
                // Save for comparison
                window.noVigResult = {
                    method: 'No-Vig Probability',
                    over: noVigOver,
                    under: noVigUnder,
                    player: document.getElementById('playerName').value || 'Unknown Player',
                    stat: document.getElementById('statType').value
                };
            }
            
            function americanToImplied(odds) {
                if (odds > 0) {
                    return 100 / (odds + 100);
                } else {
                    return -odds / (-odds + 100);
                }
            }
            
            // Statistical Calculator
            document.getElementById('calculateStatistical').addEventListener('click', calculateStatistical);
            document.getElementById('calculateStdDev').addEventListener('click', showStdDevModal);
            document.getElementById('cancelStdDev').addEventListener('click', hideStdDevModal);
            document.getElementById('confirmStdDev').addEventListener('click', calculateStdDevFromData);
            
            function calculateStatistical() {
                const mean = parseFloat(document.getElementById('meanValue').value);
                const stdDev = parseFloat(document.getElementById('stdDevValue').value);
                const line = parseFloat(document.getElementById('lineValue').value);
                
                if (isNaN(mean) || isNaN(stdDev) || isNaN(line)) {
                    alert('Please enter valid numbers for Mean, Standard Deviation, and Line Value');
                    return;
                }
                
                if (stdDev <= 0) {
                    alert('Standard Deviation must be greater than 0');
                    return;
                }
                
                // Calculate z-score
                const z = (line - mean) / stdDev;
                
                // Calculate probabilities using standard normal CDF approximation
                const underProb = standardNormalCDF(z) * 100;
                const overProb = (1 - standardNormalCDF(z)) * 100;
                
                // Display results
                document.getElementById('statOverProb').textContent = overProb.toFixed(2) + '%';
                document.getElementById('statUnderProb').textContent = underProb.toFixed(2) + '%';
                document.getElementById('statisticalResults').classList.remove('hidden');
                
                // Save for comparison
                window.statisticalResult = {
                    method: 'Statistical Prediction',
                    over: overProb,
                    under: underProb,
                    player: document.getElementById('statPlayerName').value || 'Unknown Player',
                    stat: document.getElementById('statStatType').value
                };
            }
            
            // Standard Normal CDF approximation
            function standardNormalCDF(z) {
                // Abramowitz and Stegun approximation
                const t = 1 / (1 + 0.2316419 * Math.abs(z));
                const d = 0.3989423 * Math.exp(-z * z / 2);
                let prob = d * t * (0.3193815 + t * (-0.3565638 + t * (1.781478 + t * (-1.821256 + t * 1.330274))));
                
                if (z > 0) {
                    prob = 1 - prob;
                }
                
                return prob;
            }
            
            function showStdDevModal() {
                document.getElementById('stdDevModal').classList.remove('hidden');
            }
            
            function hideStdDevModal() {
                document.getElementById('stdDevModal').classList.add('hidden');
            }
            
            function calculateStdDevFromData() {
                const dataInput = document.getElementById('historicalData').value;
                const dataPoints = dataInput.split(',').map(item => parseFloat(item.trim())).filter(item => !isNaN(item));
                
                if (dataPoints.length < 2) {
                    alert('Please enter at least 2 valid numbers');
                    return;
                }
                
                // Calculate mean
                const mean = dataPoints.reduce((sum, val) => sum + val, 0) / dataPoints.length;
                
                // Calculate variance
                const variance = dataPoints.reduce((sum, val) => sum + Math.pow(val - mean, 2), 0) / dataPoints.length;
                
                // Standard deviation is square root of variance
                const stdDev = Math.sqrt(variance);
                
                // Update the standard deviation field
                document.getElementById('stdDevValue').value = stdDev.toFixed(2);
                
                // Close modal
                hideStdDevModal();
            }
            
            // Save buttons
            document.getElementById('saveNoVig').addEventListener('click', () => {
                if (window.noVigResult) {
                    localStorage.setItem('savedNoVigResult', JSON.stringify(window.noVigResult));
                    alert('No-Vig results saved for comparison');
                } else {
                    alert('Please calculate results first');
                }
            });
            
            document.getElementById('saveStatistical').addEventListener('click', () => {
                if (window.statisticalResult) {
                    localStorage.setItem('savedStatisticalResult', JSON.stringify(window.statisticalResult));
                    alert('Statistical results saved for comparison');
                } else {
                    alert('Please calculate results first');
                }
            });
            
            // Comparison view
            function updateComparisonView() {
                const noVigResult = JSON.parse(localStorage.getItem('savedNoVigResult'));
                const statisticalResult = JSON.parse(localStorage.getItem('savedStatisticalResult'));
                
                if (!noVigResult && !statisticalResult) {
                    document.getElementById('noSavedResults').classList.remove('hidden');
                    document.getElementById('comparisonResults').classList.add('hidden');
                    return;
                }
                
                document.getElementById('noSavedResults').classList.add('hidden');
                document.getElementById('comparisonResults').classList.remove('hidden');
                
                if (noVigResult && statisticalResult) {
                    // Both results available
                    document.getElementById('compareMethod1').textContent = noVigResult.method;
                    document.getElementById('compareOver1').textContent = noVigResult.over.toFixed(2) + '%';
                    document.getElementById('compareUnder1').textContent = noVigResult.under.toFixed(2) + '%';
                    
                    document.getElementById('compareMethod2').textContent = statisticalResult.method;
                    document.getElementById('compareOver2').textContent = statisticalResult.over.toFixed(2) + '%';
                    document.getElementById('compareUnder2').textContent = statisticalResult.under.toFixed(2) + '%';
                    
                    // Calculate differences
                    const overDiff = (statisticalResult.over - noVigResult.over).toFixed(2);
                    const underDiff = (statisticalResult.under - noVigResult.under).toFixed(2);
                    
                    document.getElementById('overDiff').textContent = (overDiff > 0 ? '+' : '') + overDiff + '%';
                    document.getElementById('underDiff').textContent = (underDiff > 0 ? '+' : '') + underDiff + '%';
                    
                    // Recommendation
                    let recommendation = '';
                    const threshold = 5; // Percentage difference threshold for recommendation
                    
                    if (Math.abs(overDiff) > threshold || Math.abs(underDiff) > threshold) {
                        if (statisticalResult.over > noVigResult.over + threshold) {
                            recommendation = 'Statistical model suggests higher Over probability - consider Over bet';
                        } else if (statisticalResult.under > noVigResult.under + threshold) {
                            recommendation = 'Statistical model suggests higher Under probability - consider Under bet';
                        } else if (noVigResult.over > statisticalResult.over + threshold) {
                            recommendation = 'Market suggests higher Over probability than model - caution on Over bet';
                        } else if (noVigResult.under > statisticalResult.under + threshold) {
                            recommendation = 'Market suggests higher Under probability than model - caution on Under bet';
                        }
                    } else {
                        recommendation = 'Methods generally agree - no strong edge identified';
                    }
                    
                    document.getElementById('recommendation').textContent = recommendation;
                    
                } else if (noVigResult) {
                    // Only no-vig result available
                    document.getElementById('compareMethod1').textContent = noVigResult.method;
                    document.getElementById('compareOver1').textContent = noVigResult.over.toFixed(2) + '%';
                    document.getElementById('compareUnder1').textContent = noVigResult.under.toFixed(2) + '%';
                    
                    document.getElementById('compareMethod2').textContent = 'No saved statistical results';
                    document.getElementById('compareOver2').textContent = '--%';
                    document.getElementById('compareUnder2').textContent = '--%';
                    
                    document.getElementById('overDiff').textContent = '--%';
                    document.getElementById('underDiff').textContent = '--%';
                    document.getElementById('recommendation').textContent = 'Save statistical results to compare';
                    
                } else if (statisticalResult) {
                    // Only statistical result available
                    document.getElementById('compareMethod1').textContent = statisticalResult.method;
                    document.getElementById('compareOver1').textContent = statisticalResult.over.toFixed(2) + '%';
                    document.getElementById('compareUnder1').textContent = statisticalResult.under.toFixed(2) + '%';
                    
                    document.getElementById('compareMethod2').textContent = 'No saved no-vig results';
                    document.getElementById('compareOver2').textContent = '--%';
                    document.getElementById('compareUnder2').textContent = '--%';
                    
                    document.getElementById('overDiff').textContent = '--%';
                    document.getElementById('underDiff').textContent = '--%';
                    document.getElementById('recommendation').textContent = 'Save no-vig results to compare';
                }
            }
        });
    </script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=LMLK/advanced-player-prop-calculator" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>