File size: 25,105 Bytes
1bd01a6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1450ff9
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
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Would You Rather – Vampire Diaries Survival</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <script src="https://unpkg.com/feather-icons"></script>
    <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&family=Montserrat:wght@300;400;600&display=swap');
        
        body {
            font-family: 'Montserrat', sans-serif;
            background-color: #0f0f1a;
            color: #e0e0e0;
            background-image: radial-gradient(circle at 50% 50%, rgba(70, 0, 20, 0.1) 0%, rgba(0, 0, 0, 0.9) 100%);
            min-height: 100vh;
            overflow-x: hidden;
            position: relative;
        }
        
        .vampire-title {
            font-family: 'Cinzel', serif;
            text-shadow: 0 0 10px rgba(180, 0, 0, 0.7);
        }
        
        .choice-btn {
            transition: all 0.3s ease;
            transform-origin: center;
        }
        
        .choice-btn:hover {
            transform: scale(1.03);
            box-shadow: 0 0 15px rgba(180, 0, 0, 0.5);
        }
        
        .blood-drip {
            position: absolute;
            width: 100%;
            height: 100%;
            pointer-events: none;
            background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M50 0 L55 20 L60 15 L65 30 L70 25 L75 40 L80 35 L85 50 L90 45 L95 60 L100 55 L95 70 L90 65 L85 80 L80 75 L75 90 L70 85 L65 100 L60 95 L55 100 L50 95 L45 100 L40 95 L35 100 L30 95 L25 100 L20 95 L15 100 L10 95 L5 100 L0 95 L5 80 L10 85 L15 70 L20 75 L25 60 L30 65 L35 50 L40 55 L45 40 L50 45 L55 30 L60 35 L65 20 L70 25 L75 10 L80 15 L85 0 L80 5 L75 0 L70 5 L65 0 L60 5 L55 0 L50 5 L45 0 L40 5 L35 0 L30 5 L25 0 L20 5 L15 0 L10 5 L5 0 Z' fill='rgba(180, 0, 0, 0.05)' /%3E%3C/svg%3E");
            opacity: 0.3;
            z-index: -1;
        }
        
        .progress-bar {
            height: 5px;
            background: linear-gradient(90deg, rgba(180,0,0,1) 0%, rgba(80,0,0,1) 100%);
            transition: width 0.5s ease;
        }
        
        .question-card {
            background: rgba(15, 15, 30, 0.8);
            backdrop-filter: blur(5px);
            border: 1px solid rgba(180, 0, 0, 0.3);
            box-shadow: 0 0 20px rgba(180, 0, 0, 0.2);
        }
        
        .ending-win {
            background: linear-gradient(135deg, rgba(20,50,20,0.8) 0%, rgba(10,25,10,0.9) 100%);
            border: 1px solid rgba(0, 180, 0, 0.3);
            box-shadow: 0 0 20px rgba(0, 180, 0, 0.2);
        }
        
        .ending-lose {
            background: linear-gradient(135deg, rgba(50,20,20,0.8) 0%, rgba(25,10,10,0.9) 100%);
            border: 1px solid rgba(180, 0, 0, 0.3);
            box-shadow: 极 0 20px rgba(180, 0, 0, 0.2);
        }
        
        /* Animated Background Elements */
        .animated-background {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: -2;
            overflow: hidden;
        }
        
        .particle {
            position: absolute;
            border-radius: 50%;
            background: radial-gradient(circle, rgba(180, 0, 0, 0.3) 0%, transparent 70%);
            animation: float 15s infinite ease-in-out;
            opacity: 0.4;
        }
        
        .mist {
            position: absolute;
            width: 150%;
            height: 150%;
            background: radial-gradient(ellipse at center, rgba(100, 0, 50, 0.1) 0%, transparent 70%);
            animation: drift 30s infinite linear;
            opacity: 0.2;
        }
        
        .light-flare {
            position: absolute;
            width: 200px;
            height: 200px;
            border-radius: 50%;
            background: radial-gradient(circle, rgba(255, 0, 100, 0.15) 0%, transparent 70%);
            filter: blur(15px);
            animation: pulse 8s infinite alternate;
            opacity: 0.3;
        }
        
        .vampire-symbol {
            position: absolute;
            font-size: 40px;
            color: rgba(180, 0, 0, 0.1);
            animation: float-symbol 25s infinite ease-in-out;
            opacity: 0.2;
        }
        
        @keyframes float {
            0%, 100% {
                transform: translate(0, 0) rotate(0deg);
            }
            25% {
                transform: translate(20px, -15px) rotate(5deg);
            }
            50% {
                transform: translate(-15px, 10px) rotate(-5deg);
            }
            75% {
                transform: translate(10px, 15px) rotate(3deg);
            }
        }
        
        @keyframes drift {
            0% {
                transform: translate(-25%, -25%) rotate(0deg);
            }
            100% {
                transform: translate(-25%, -25%) rotate(360deg);
            }
        }
        
        @keyframes pulse {
            0% {
                transform: scale(1);
                opacity: 0.2;
            }
            100% {
                transform: scale(1.5);
                opacity: 0.4;
            }
        }
        
        @keyframes float-symbol {
            0%, 100% {
                transform: translate(0, 0) rotate(0deg);
                opacity: 0.2;
            }
            50% {
                transform: translate(50px, -30px) rotate(180deg);
                opacity: 0.3;
            }
        }
    </style>
</head>
<body class="flex flex-col items-center justify-start min-h-screen pt-10 pb-20 px-4">
    <div class="blood-drip"></div>
    
    <!-- Animated Background -->
    <div class="animated-background" id="animated-background">
        <!-- Elements will be generated by JavaScript -->
    </div>
    
    <div class="w-full max-w-2xl mx-auto">
        <!-- Game Header -->
        <header class="text-center mb-10">
            <h1 class="vampire-title text-4xl md:text-5xl font-bold mb-4 text-red-600">Would You Rather</h1>
            <h2 class="text-xl md:text-2xl font-semibold text-red-400 mb-2">Vampire Diaries Survival</h2>
            <p class="text-gray-300">Make your choices carefully. Your survival depends on it.</p>
        </header>
        
        <!-- Progress Bar -->
        <div class="mb-6">
            <div class="flex justify-between text-sm text-gray-400 mb-1">
                <span>Question <span id="current-question">1</span>/25</span>
                <span id="progress-percent">4%</span>
            </div>
            <div class="w-full bg-gray-800 rounded-full h-2">
                <div id="progress-bar" class="progress-bar rounded-full h-2" style="width: 4%"></div>
            </div>
        </div>
        
        <!-- Question Container -->
        <div id="question-container" class="question-card rounded-lg p-6 mb-8">
            <h3 id="question-text" class="text-xl font-semibold mb-6 text-center">Damon offers you his blood after you're badly hurt.</h3>
            
            <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
                <button 
                    onclick="selectChoice('A')" 
                    class="choice-btn bg-gray-800 hover:bg-red-900 text-white py-4 px-6 rounded-lg border border-red-900 flex items-center justify-center"
                >
                    <span class="font-bold mr-2 text-red-400">A)</span>
                    <span>Drink it immediately</span>
                </button>
                
                <button 
                    onclick="selectChoice('B')" 
                    class="choice-btn bg-gray-800 hover:bg-red-900 text-white py-4 px-6 rounded-lg border border-red-900 flex items-center justify-center"
                >
                    <span class="font-bold mr-2 text-red-400">B)</span>
                    <span>Refuse and risk dying</span>
                </button>
            </div>
        </div>
        
        <!-- Results Container (Hidden Initially) -->
        <div id="results-container" class="hidden">
            <div id="ending-card" class="rounded-lg p-8 mb-8 text-center">
                <h2 id="ending-title" class="text-3xl font-bold mb-4"></h2>
                <p id="ending-text" class="text-xl mb-6"></p>
                <div class="mb-6">
                    <p class="text-2xl font-semibold mb-2">Your Score:</p>
                    <p id="final-score" class="text-4xl font-bold"></p>
                </div>
            </div>
            
            <div class="question-card rounded-lg p-6">
                <h3 class="text-xl font-semibold mb-4 text-center">Your Answers:</h3>
                <div id="answers-list" class="space-y-4"></div>
            </div>
            
            <div class="mt-6 text-center">
                <button 
                    onclick="restartGame()" 
                    class="bg-red-800 hover:bg-red-700 text-white py-3 px-8 rounded-lg font-semibold transition-all"
                >
                    Play Again
                </button>
            </div>
        </div>
    </div>

    <!-- Welcome Modal -->
    <div id="welcome-modal" class="fixed inset-0 bg-black bg-opacity-80 flex items-center justify-center z-50" style="display: flex;">
        <div class="bg-gray-900 border-2 border-red-700 rounded-lg p-8 mx-4 max-w-md text-center">
            <h2 class="vampire-title text-2xl md:text-3xl font-bold mb-6 text-red-600">Welcome to the Game!</h2>
            <p class="text-lg mb-6 text-gray-300">
                If you lose, you are fat. If you win, you are not fat. Play through Erika's story and at the end you will discover your fate!
            </p>
            <button 
                onclick="closeWelcomeModal()" 
                class="bg-red-800 hover:bg-red-700 text-white py-3 px-8 rounded-lg font-semibold transition-all"
            >
                I Understand
            </button>
        </div>
    </div>

    <script>
        // Welcome Modal Function
        function closeWelcomeModal() {
            document.getElementById('welcome-modal').style.display = 'none';
            initGame();
        }

        // Animated Background Setup
        function createAnimatedBackground() {
            const container = document.getElementById('animated-background');
            
            // Create particles
            for (let i = 0; i < 15; i++) {
                const particle = document.createElement('div');
                particle.classList.add('particle');
                particle.style.width = Math.random() * 20 + 10 + 'px';
                particle.style.height = particle.style.width;
                particle.style.left = Math.random() * 100 + '%';
                particle.style.top = Math.random() * 100 + '%';
                particle.style.animationDelay = Math.random() * 15 + 's';
                particle.style.animationDuration = (Math.random() * 10 + 15) + 's';
                container.appendChild(particle);
            }
            
            // Create mist layers
            for (let i = 0; i < 2; i++) {
                const mist = document.createElement('div');
                mist.classList.add('mist');
                mist.style.animationDuration = (Math.random() * 10 + 25) + 's';
                container.appendChild(mist);
            }
            
            // Create light flares
            for (let i = 0; i < 3; i++) {
                const flare = document.createElement('div');
                flare.classList.add('light-flare');
                flare.style.left = Math.random() * 100 + '%';
                flare.style.top = Math.random() * 100 + '%';
                flare.style.animationDelay = Math.random() * 8 + 's';
                container.appendChild(flare);
            }
            
            // Create vampire symbols
            for (let i = 0; i < 5; i++) {
                const symbol = document.createElement('div');
                symbol.classList.add('vampire-symbol');
                symbol.innerHTML = '♰';
                symbol.style.left = Math.random() * 100 + '%';
                symbol.style.top = Math.random() * 100 + '%';
                symbol.style.animationDelay = Math.random() * 25 + 's';
                container.appendChild(symbol);
            }
        }
        
        // Game Data
        const questions = [
            {
                question: "Damon offers you his blood after you're badly hurt.",
                choices: {
                    A: { text: "Drink it immediately", correct: true },
                    B: { text: "Refuse and risk dying", correct: false }
                }
            },
            {
                question: "Stefan asks you to help him lock Damon in the cellar.",
                choices: {
                    A: { text: "Agree to help Stefan", correct: true },
                    B: { text: "Betray Stefan and free Damon", correct: false }
                }
            },
            {
                question: "Katherine lures you with a deal for power.",
                choices: {
                    A: { text: "Accept her deal", correct: false },
                    B: { text: "Refuse and stay cautious", correct: true }
                }
            },
            {
                question: "Klaus demands your loyalty.",
                choices: {
                    A: { text: "Swear allegiance to Klaus", correct: false },
                    B: { text: "Secretly plan against him", correct: true }
                }
            },
            {
                question: "Bonnie offers you a daylight ring.",
                choices: {
                    A: { text: "Take it gratefully", correct: true },
                    B: { text: "Decline, you don't trust magic", correct: false }
                }
            },
            {
                question: "You're ambushed by werewolves at night.",
                choices: {
                    A: { text: "Run into the forest", correct: false },
                    B: { text: "Stay and fight with vervain weapons", correct: true }
                }
            },
            {
                question: "Damon asks: 'Kill or spare this vampire?'",
                choices: {
                    A: { text: "Kill", correct: true },
                    B: { text: "Spare", correct: false }
                }
            },
            {
                question: "You find Elena crying.",
                choices: {
                    A: { text: "Comfort her", correct: true },
                    B: { text: "Leave her alone", correct: false }
                }
            },
            {
                question: "Stefan is starving and wants blood.",
                choices: {
                    A: { text: "Offer him your blood", correct: true },
                    B: { text: "Walk away", correct: false }
                }
            },
            {
                question: "You discover the Originals' secret.",
                choices: {
                    A: { text: "Keep it to yourself", correct: true },
                    B: { text: "Tell everyone in Mystic Falls", correct: false }
                }
            },
            {
                question: "Rebekah offers friendship.",
                choices: {
                    A: { text: "Accept it", correct: true },
                    B: { text: "Reject her coldly", correct: false }
                }
            },
            {
                question: "You're locked in a room with Damon.",
                choices: {
                    A: { text: "Trust him to protect you", correct: true },
                    B: { text: "Try to escape", correct: false }
                }
            },
            {
                question: "You find a white oak stake.",
                choices: {
                    A: { text: "Hide it safely", correct: true },
                    B: { text: "Wave it around carelessly", correct: false }
                }
            },
            {
                question: "Klaus tells you to betray your friends.",
                choices: {
                    A: { text: "Pretend to agree, then betray him instead", correct: true },
                    B: { text: "Actually betray your friends", correct: false }
                }
            },
            {
                question: "Jeremy asks you to help him hunt vampires.",
                choices: {
                    A: { text: "Train him carefully", correct: true },
                    B: { text: "Refuse to get involved", correct: false }
                }
            },
            {
                question: "Caroline asks for your advice on Tyler.",
                choices: {
                    A: { text: "Tell her the truth", correct: true },
                    B: { text: "Lie to protect her", correct: false }
                }
            },
            {
                question: "A stranger vampire offers you power.",
                choices: {
                    A: { text: "Refuse", correct: true },
                    B: { text: "Accept", correct: false }
                }
            },
            {
                question: "You're caught in fire with Damon.",
                choices: {
                    A: { text: "Save Damon first", correct: true },
                    B: { text: "Save yourself", correct: false }
                }
            },
            {
                question: "Alaric hands you his ring.",
                choices: {
                    A: { text: "Accept and use it", correct: true },
                    B: { text: "Refuse", correct: false }
                }
            },
            {
                question: "Bonnie collapses after a spell.",
                choices: {
                    A: { text: "Carry her to safety", correct: true },
                    B: { text: "Leave her", correct: false }
                }
            },
            {
                question: "Damon says: 'Choose me or Stefan.'",
                choices: {
                    A: { text: "Choose Damon", correct: true },
                    B: { text: "Choose Stefan", correct: false }
                }
            },
            {
                question: "You discover Elena is in danger.",
                choices: {
                    A: { text: "Warn her immediately", correct: true },
                    B: { text: "Do nothing", correct: false }
                }
            },
            {
                question: "You have a chance to kill Klaus.",
                choices: {
                    A: { text: "Try it smartly", correct: true },
                    B: { text: "Walk away", correct: false }
                }
            },
            {
                question: "Elijah asks for your trust.",
                choices: {
                    A: { text: "Give him a chance", correct: true },
                    B: { text: "Reject him", correct: false }
                }
            },
            {
                question: "Last choice: Would you rather...",
                choices: {
                    A: { text: "Stay human", correct: false },
                    B: { text: "Become a vampire", correct: true }
                }
            }
        ];

        // Game State
        let currentQuestionIndex = 0;
        const playerAnswers = [];
        let score = 0;

        // DOM Elements
        const questionText = document.getElementById('question-text');
        const choiceABtn = document.querySelector('button[onclick="selectChoice(\'A\')"]');
        const choiceBBtn = document.querySelector('button[onclick="selectChoice(\'B\')"]');
        const currentQuestionDisplay = document.getElementById('current-question');
        const progressBar = document.getElementById('progress-bar');
        const progressPercent = document.getElementById('progress-percent');
        const questionContainer = document.getElementById('question-container');
        const resultsContainer = document.getElementById('results-container');
        const endingTitle = document.getElementById('ending-title');
        const endingText = document.getElementById('ending-text');
        const finalScore = document.getElementById('final-score');
        const answersList = document.getElementById('answers-list');
        const endingCard = document.getElementById('ending-card');

        // Initialize the game
        function initGame() {
            currentQuestionIndex = 0;
            playerAnswers.length = 0;
            score = 0;
            updateQuestion();
            questionContainer.classList.remove('hidden');
            resultsContainer.classList.add('hidden');
        }

        // Update the current question display
        function updateQuestion() {
            const question = questions[currentQuestionIndex];
            questionText.textContent = question.question;
            
            const choiceA = question.choices.A;
            const choiceB = question.choices.B;
            
            choiceABtn.innerHTML = `<span class="font-bold mr-2 text-red-400">A)</span><span>${choiceA.text}</span>`;
            choiceBBtn.innerHTML = `<span class="font-bold mr-2 text-red-400">B)</span><span>${choiceB.text}</span>`;
            
            currentQuestionDisplay.textContent = currentQuestionIndex + 1;
            const progress = ((currentQuestionIndex + 1) / questions.length) * 100;
            progressBar.style.width = `${progress}%`;
            progressPercent.textContent = `${Math.round(progress)}%`;
        }

        // Handle choice selection
        function selectChoice(choice) {
            const question = questions[currentQuestionIndex];
            const selectedChoice = question.choices[choice];
            const isCorrect = selectedChoice.correct;
            
            playerAnswers.push({
                question: question.question,
                choice: choice,
                text: selectedChoice.text,
                correct: isCorrect
            });
            
            if (isCorrect) {
                score++;
            }
            
            // Move to next question or end game
            if (currentQuestionIndex < questions.length - 1) {
                currentQuestionIndex++;
                updateQuestion();
            } else {
                endGame();
            }
        }

        // End the game and show results
        function endGame() {
            questionContainer.classList.add('hidden');
            resultsContainer.classList.remove('hidden');
            
            // Set ending based on score
            if (score >= 15) {
                endingTitle.textContent = "You Survived Mystic Falls!";
                endingText.textContent = "You made the right choices. Erica becomes a powerful vampire and thrives in the supernatural world.";
                endingCard.classList.add('ending-win');
                endingCard.classList.remove('ending-lose');
            } else {
                endingTitle.textContent = "You Failed to Survive";
                endingText.textContent = "Your choices led to tragedy. Erica's story ends mysteriously in the shadows of Mystic Falls.";
                endingCard.classList.add('ending-lose');
                endingCard.classList.remove('ending-win');
            }
            
            finalScore.textContent = `${score}/25`;
            
            // Display all answers
            answersList.innerHTML = '';
            playerAnswers.forEach((answer, index) => {
                const answerItem = document.createElement('div');
                answerItem.className = 'p-4 border-b border-gray-700';
                answerItem.innerHTML = `
                    <div class="flex justify-between items-start mb-2">
                        <span class="font-semibold">Question ${index + 1}:</span>
                        <span class="ml-4 ${answer.correct ? 'text-green-400' : 'text-red-400'}">
                            ${answer.correct ? '✅ Correct' : '❌ Wrong'}
                        </span>
                    </div>
                    <p class="text-gray-300 mb-1">${answer.question}</p>
                    <p class="text-gray-400">Your choice: ${answer.choice}) ${answer.text}</p>
                `;
                answersList.appendChild(answerItem);
            });
        }

        // Restart the game
        function restartGame() {
            initGame();
        }

        // Don't auto-initialize the game - wait for modal to close
        document.addEventListener('DOMContentLoaded', function() {
            // Create animated background
            createAnimatedBackground();
        });
        feather.replace();
    </script>
</body>
</html>