Spaces:
Running

File size: 68,841 Bytes
f5a2f21
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
<!DOCTYPE html>
<html lang="es-AR">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Decisión Íntegra - Juego Educativo</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: '#881781',
                        secondary: '#e4c7df',
                        accent1: '#c48cc4',
                        accent2: '#bd7eb6',
                        accent3: '#cc8cbc',
                    }
                }
            }
        }
    </script>
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');
        
        body {
            font-family: 'Roboto', sans-serif;
            background-color: #f9f9f9;
        }
        
        .fade-in {
            animation: fadeIn 0.5s ease-in-out;
        }
        
        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }
        
        .progress-step.active {
            background-color: #881781;
            color: white;
        }
        
        .progress-step.completed {
            background-color: #bd7eb6;
            color: white;
        }
        
        .narration-audio {
            background-color: #e4c7df;
            border-left: 4px solid #881781;
        }
        
        .reflection-question {
            background-color: #f3e9f2;
            border-left: 4px solid #c48cc4;
        }
        
        .option-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
        }
    </style>
</head>
<body class="min-h-screen bg-gray-50">
    <!-- Pantalla de Bienvenida -->
    <div id="welcome-screen" class="fixed inset-0 bg-white z-50 flex flex-col items-center justify-center p-6 fade-in">
        <div class="max-w-4xl mx-auto text-center">
            <h1 class="text-4xl md:text-5xl font-bold text-primary mb-6">Decisión Íntegra</h1>
            <p class="text-xl text-gray-700 mb-8">Un juego interactivo para desarrollar tu ética profesional basado en el Modelo de Rest</p>
            
            <div class="bg-secondary rounded-lg p-6 mb-8">
                <h2 class="text-2xl font-semibold text-primary mb-4">💡 Sobre el Modelo de Rest</h2>
                <p class="text-gray-700 mb-4">Este juego se basa en el Modelo de Desarrollo Moral de Rest, que plantea que para actuar éticamente necesitamos:</p>
                
                <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6">
                    <div class="bg-white p-4 rounded-lg shadow-sm flex items-start">
                        <div class="bg-primary text-white rounded-full w-8 h-8 flex items-center justify-center mr-3 mt-1">
                            <i class="fas fa-heart"></i>
                        </div>
                        <div>
                            <h3 class="font-semibold text-primary">Sensibilidad Moral</h3>
                            <p class="text-gray-600 text-sm">Percibir que hay un dilema</p>
                        </div>
                    </div>
                    
                    <div class="bg-white p-4 rounded-lg shadow-sm flex items-start">
                        <div class="bg-primary text-white rounded-full w-8 h-8 flex items-center justify-center mr-3 mt-1">
                            <i class="fas fa-balance-scale"></i>
                        </div>
                        <div>
                            <h3 class="font-semibold text-primary">Juicio Moral</h3>
                            <p class="text-gray-600 text-sm">Saber qué es lo correcto</p>
                        </div>
                    </div>
                    
                    <div class="bg-white p-4 rounded-lg shadow-sm flex items-start">
                        <div class="bg-primary text-white rounded-full w-8 h-8 flex items-center justify-center mr-3 mt-1">
                            <i class="fas fa-bolt"></i>
                        </div>
                        <div>
                            <h3 class="font-semibold text-primary">Motivación Moral</h3>
                            <p class="text-gray-600 text-sm">Querer hacer lo correcto</p>
                        </div>
                    </div>
                    
                    <div class="bg-white p-4 rounded-lg shadow-sm flex items-start">
                        <div class="bg-primary text-white rounded-full w-8 h-8 flex items-center justify-center mr-3 mt-1">
                            <i class="fas fa-shield-alt"></i>
                        </div>
                        <div>
                            <h3 class="font-semibold text-primary">Carácter Moral</h3>
                            <p class="text-gray-600 text-sm">Poder hacerlo en la práctica</p>
                        </div>
                    </div>
                </div>
            </div>
            
            <div class="mb-8">
                <h3 class="text-xl font-semibold text-primary mb-4">Elegí un dilema para comenzar:</h3>
                <div class="grid grid-cols-1 md:grid-cols-3 gap-4">
                    <button onclick="startDilemma('error-acta')" class="bg-accent1 hover:bg-accent3 text-white font-medium py-3 px-4 rounded-lg transition-all">
                        <i class="fas fa-file-alt mr-2"></i> El error en el acta
                    </button>
                    <button onclick="startDilemma('cemento')" class="bg-accent1 hover:bg-accent3 text-white font-medium py-3 px-4 rounded-lg transition-all">
                        <i class="fas fa-hard-hat mr-2"></i> El cemento que no alcanza
                    </button>
                    <button onclick="startDilemma('paciente')" class="bg-accent1 hover:bg-accent3 text-white font-medium py-3 px-4 rounded-lg transition-all">
                        <i class="fas fa-heartbeat mr-2"></i> El paciente sin cobertura
                    </button>
                </div>
            </div>
            
            <button onclick="showTutorial()" class="text-primary hover:text-accent2 font-medium">
                <i class="fas fa-question-circle mr-1"></i> ¿Cómo jugar?
            </button>
        </div>
    </div>
    
    <!-- Tutorial Modal -->
    <div id="tutorial-modal" class="hidden fixed inset-0 bg-black bg-opacity-50 z-50 flex items-center justify-center p-4">
        <div class="bg-white rounded-lg max-w-2xl w-full p-6 max-h-[90vh] overflow-y-auto">
            <div class="flex justify-between items-center mb-4">
                <h3 class="text-2xl font-bold text-primary">¿Cómo jugar?</h3>
                <button onclick="hideTutorial()" class="text-gray-500 hover:text-primary">
                    <i class="fas fa-times"></i>
                </button>
            </div>
            
            <div class="space-y-4">
                <div class="flex items-start">
                    <div class="bg-primary text-white rounded-full w-6 h-6 flex items-center justify-center mr-3 mt-1 flex-shrink-0">
                        1
                    </div>
                    <div>
                        <h4 class="font-semibold text-primary">Elegí un dilema</h4>
                        <p class="text-gray-600">Seleccioná uno de los tres dilemas éticos basados en situaciones reales de diferentes sectores profesionales.</p>
                    </div>
                </div>
                
                <div class="flex items-start">
                    <div class="bg-primary text-white rounded-full w-6 h-6 flex items-center justify-center mr-3 mt-1 flex-shrink-0">
                        2
                    </div>
                    <div>
                        <h4 class="font-semibold text-primary">Recorré las 4 fases</h4>
                        <p class="text-gray-600">Cada dilema tiene 4 fases basadas en el Modelo de Rest: Sensibilidad, Juicio, Motivación y Carácter Moral.</p>
                    </div>
                </div>
                
                <div class="flex items-start">
                    <div class="bg-primary text-white rounded-full w-6 h-6 flex items-center justify-center mr-3 mt-1 flex-shrink-0">
                        3
                    </div>
                    <div>
                        <h4 class="font-semibold text-primary">Interactuá y reflexioná</h4>
                        <p class="text-gray-600">En cada fase habrá preguntas, opciones y actividades para que pienses en el dilema desde diferentes perspectivas.</p>
                    </div>
                </div>
                
                <div class="flex items-start">
                    <div class="bg-primary text-white rounded-full w-6 h-6 flex items-center justify-center mr-3 mt-1 flex-shrink-0">
                        4
                    </div>
                    <div>
                        <h4 class="font-semibold text-primary">Recibí retroalimentación</h4>
                        <p class="text-gray-600">Al finalizar, obtendrás un análisis de tu desempeño en cada componente del modelo y sugerencias para mejorar.</p>
                    </div>
                </div>
            </div>
            
            <div class="mt-6 pt-4 border-t border-gray-200">
                <button onclick="hideTutorial()" class="bg-primary hover:bg-accent2 text-white font-medium py-2 px-6 rounded-lg transition-all w-full">
                    Entendido, ¡a jugar!
                </button>
            </div>
        </div>
    </div>
    
    <!-- Contenedor principal del juego -->
    <div id="game-container" class="hidden max-w-6xl mx-auto p-4 md:p-6">
        <!-- Barra de progreso -->
        <div class="bg-white rounded-lg shadow-sm p-4 mb-6">
            <div class="flex justify-between items-center">
                <div class="flex items-center space-x-2 overflow-x-auto pb-2">
                    <div id="step-1" class="progress-step flex flex-col items-center px-4 py-2 rounded-lg cursor-pointer transition-all">
                        <div class="flex items-center">
                            <span class="bg-white text-primary rounded-full w-6 h-6 flex items-center justify-center mr-2 text-sm font-semibold">1</span>
                            <span class="font-medium">Sensibilidad</span>
                        </div>
                    </div>
                    
                    <div class="flex-1 border-t-2 border-dashed border-gray-300 mt-3 mx-2"></div>
                    
                    <div id="step-2" class="progress-step flex flex-col items-center px-4 py-2 rounded-lg cursor-pointer transition-all">
                        <div class="flex items-center">
                            <span class="bg-white text-primary rounded-full w-6 h-6 flex items-center justify-center mr-2 text-sm font-semibold">2</span>
                            <span class="font-medium">Juicio</span>
                        </div>
                    </div>
                    
                    <div class="flex-1 border-t-2 border-dashed border-gray-300 mt-3 mx-2"></div>
                    
                    <div id="step-3" class="progress-step flex flex-col items-center px-4 py-2 rounded-lg cursor-pointer transition-all">
                        <div class="flex items-center">
                            <span class="bg-white text-primary rounded-full w-6 h-6 flex items-center justify-center mr-2 text-sm font-semibold">3</span>
                            <span class="font-medium">Motivación</span>
                        </div>
                    </div>
                    
                    <div class="flex-1 border-t-2 border-dashed border-gray-300 mt-3 mx-2"></div>
                    
                    <div id="step-4" class="progress-step flex flex-col items-center px-4 py-2 rounded-lg cursor-pointer transition-all">
                        <div class="flex items-center">
                            <span class="bg-white text-primary rounded-full w-6 h-6 flex items-center justify-center mr-2 text-sm font-semibold">4</span>
                            <span class="font-medium">Carácter</span>
                        </div>
                    </div>
                    
                    <div class="flex-1 border-t-2 border-dashed border-gray-300 mt-3 mx-2"></div>
                    
                    <div id="step-5" class="progress-step flex flex-col items-center px-4 py-2 rounded-lg cursor-pointer transition-all">
                        <div class="flex items-center">
                            <span class="bg-white text-primary rounded-full w-6 h-6 flex items-center justify-center mr-2 text-sm font-semibold">5</span>
                            <span class="font-medium">Retroalimentación</span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- Contenido del juego -->
        <div id="game-content" class="bg-white rounded-lg shadow-sm p-6">
            <!-- El contenido se cargará dinámicamente aquí -->
        </div>
        
        <!-- Navegación -->
        <div id="game-navigation" class="flex justify-between mt-6">
            <button id="prev-btn" onclick="prevStep()" class="bg-gray-200 hover:bg-gray-300 text-gray-700 font-medium py-2 px-6 rounded-lg transition-all hidden">
                <i class="fas fa-arrow-left mr-2"></i> Anterior
            </button>
            <button id="next-btn" onclick="nextStep()" class="bg-primary hover:bg-accent2 text-white font-medium py-2 px-6 rounded-lg transition-all ml-auto">
                Siguiente <i class="fas fa-arrow-right ml-2"></i>
            </button>
        </div>
    </div>
    
    <script>
        // Variables del juego
        let currentDilemma = null;
        let currentStep = 1;
        const totalSteps = 5;
        let userResponses = {};
        
        // Iniciar un dilema
        function startDilemma(dilemma) {
            currentDilemma = dilemma;
            currentStep = 1;
            userResponses = {};
            
            document.getElementById('welcome-screen').classList.add('hidden');
            document.getElementById('game-container').classList.remove('hidden');
            
            updateProgressBar();
            loadStepContent();
        }
        
        // Mostrar/ocultar tutorial
        function showTutorial() {
            document.getElementById('tutorial-modal').classList.remove('hidden');
        }
        
        function hideTutorial() {
            document.getElementById('tutorial-modal').classList.add('hidden');
        }
        
        // Navegación entre pasos
        function nextStep() {
            if (currentStep < totalSteps) {
                currentStep++;
                updateProgressBar();
                loadStepContent();
            }
        }
        
        function prevStep() {
            if (currentStep > 1) {
                currentStep--;
                updateProgressBar();
                loadStepContent();
            }
        }
        
        // Actualizar barra de progreso
        function updateProgressBar() {
            // Reset all steps
            for (let i = 1; i <= totalSteps; i++) {
                const stepElement = document.getElementById(`step-${i}`);
                stepElement.classList.remove('active', 'completed');
                
                const numberElement = stepElement.querySelector('span:first-child');
                numberElement.classList.remove('bg-primary', 'text-white');
                numberElement.classList.add('bg-white', 'text-primary');
            }
            
            // Mark completed steps
            for (let i = 1; i < currentStep; i++) {
                document.getElementById(`step-${i}`).classList.add('completed');
                
                const numberElement = document.querySelector(`#step-${i} span:first-child`);
                numberElement.classList.remove('bg-white', 'text-primary');
                numberElement.classList.add('bg-accent2', 'text-white');
            }
            
            // Mark current step
            document.getElementById(`step-${currentStep}`).classList.add('active');
            
            const currentNumberElement = document.querySelector(`#step-${currentStep} span:first-child`);
            currentNumberElement.classList.remove('bg-white', 'text-primary');
            currentNumberElement.classList.add('bg-primary', 'text-white');
            
            // Update navigation buttons
            document.getElementById('prev-btn').classList.toggle('hidden', currentStep === 1);
            
            const nextBtn = document.getElementById('next-btn');
            if (currentStep === totalSteps) {
                nextBtn.innerHTML = 'Finalizar <i class="fas fa-check ml-2"></i>';
            } else {
                nextBtn.innerHTML = 'Siguiente <i class="fas fa-arrow-right ml-2"></i>';
            }
        }
        
        // Cargar contenido del paso actual
        function loadStepContent() {
            const gameContent = document.getElementById('game-content');
            gameContent.innerHTML = '';
            
            switch(currentStep) {
                case 1:
                    loadScenario();
                    break;
                case 2:
                    loadSensitivity();
                    break;
                case 3:
                    loadJudgment();
                    break;
                case 4:
                    loadMotivation();
                    break;
                case 5:
                    loadFeedback();
                    break;
            }
        }
        
        // Cargar escenario del dilema
        function loadScenario() {
            const gameContent = document.getElementById('game-content');
            
            let title = '';
            let scenario = '';
            let image = '';
            let audio = '';
            
            // Configurar según el dilema seleccionado
            switch(currentDilemma) {
                case 'error-acta':
                    title = 'El error en el acta (Sector educativo)';
                    scenario = `
                        <p class="mb-4">Sos docente en una escuela secundaria y estás a cargo de tomar las actas de un examen final importante. Al revisar las notas, te das cuenta que cometiste un error al cargar la calificación de un alumno: le pusiste 4 cuando en realidad sacó 7.</p>
                        <p class="mb-4">El acta ya fue firmada por el director y enviada a la secretaría académica. Si informás del error, podría haber demoras en la certificación de todos los alumnos y problemas administrativos. Si no decís nada, solo ese alumno se verá afectado con una nota más baja.</p>
                        <p>¿Qué harías en esta situación?</p>
                    `;
                    image = 'https://images.unsplash.com/photo-1588072432836-e10032774350?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1472&q=80';
                    break;
                    
                case 'cemento':
                    title = 'El cemento que no alcanza (Sector construcción)';
                    scenario = `
                        <p class="mb-4">Sos capataz en una obra de construcción de viviendas sociales. Al recibir el último envío de materiales, te das cuenta que hay un 15% menos de cemento del solicitado. La empresa proveedora dice que fue un error en el despacho y que regularizarán en el próximo pedido, pero eso será en 3 semanas.</p>
                        <p class="mb-4">Si seguís el protocolo y paralizás la obra hasta tener todo el material, no cumplirás con los plazos pactados y la empresa perderá la bonificación por término anticipado. Si ajustás las mezclas para estirar el cemento (reduciendo un poco la resistencia), probablemente nadie se dé cuenta y podrías terminar a tiempo.</p>
                        <p>¿Cómo actuarías en este caso?</p>
                    `;
                    image = 'https://images.unsplash.com/photo-1600585154340-be6161a56a0c?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1470&q=80';
                    break;
                    
                case 'paciente':
                    title = 'El paciente sin cobertura (Sector salud)';
                    scenario = `
                        <p class="mb-4">Sos médico en un hospital público y atendés a un paciente que necesita con urgencia una medicación especial que cuesta $150.000 por mes. El paciente no tiene cobertura médica y no puede pagarla. Sabés que si modificás un poco el diagnóstico podrías justificar una medicación similar que está en el vademécum del hospital y sería gratuita para él.</p>
                        <p class="mb-4">Si seguís el protocolo al pie de la letra, el paciente no recibirá tratamiento. Si modificás el diagnóstico, estarías falseando información pero el paciente recibiría ayuda. Además, existe la posibilidad (aunque remota) de que alguien audite el caso y descubra la irregularidad.</p>
                        <p>¿Qué decisión tomarías?</p>
                    `;
                    image = 'https://images.unsplash.com/photo-1576091160550-2173dba999ef?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1470&q=80';
                    break;
            }
            
            gameContent.innerHTML = `
                <div class="mb-6">
                    <h2 class="text-2xl md:text-3xl font-bold text-primary mb-2">${title}</h2>
                    <div class="w-full h-1 bg-gradient-to-r from-primary to-accent3 rounded-full mb-4"></div>
                </div>
                
                <div class="grid grid-cols-1 lg:grid-cols-2 gap-6 mb-6">
                    <div class="bg-gray-100 rounded-lg overflow-hidden">
                        <img src="${image}" alt="Imagen del escenario" class="w-full h-64 object-cover">
                    </div>
                    
                    <div class="narration-audio p-4 rounded-lg flex items-center">
                        <button class="bg-primary hover:bg-accent2 text-white rounded-full w-12 h-12 flex items-center justify-center mr-4">
                            <i class="fas fa-play"></i>
                        </button>
                        <div>
                            <h4 class="font-semibold text-primary">Escuchar narración</h4>
                            <p class="text-sm text-gray-600">Audio explicativo del dilema</p>
                        </div>
                    </div>
                </div>
                
                <div class="bg-secondary p-4 rounded-lg mb-6">
                    <h3 class="text-lg font-semibold text-primary mb-2">Escenario:</h3>
                    <div class="text-gray-700">
                        ${scenario}
                    </div>
                </div>
                
                <div class="reflection-question p-4 rounded-lg">
                    <h3 class="text-lg font-semibold text-primary mb-2">Reflexión inicial:</h3>
                    <p class="text-gray-700 mb-2">Antes de avanzar, tomate un momento para pensar en la situación. ¿Qué emociones te genera este caso?</p>
                    <textarea id="initial-reflection" class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent" rows="3" placeholder="Escribí tus reflexiones aquí..."></textarea>
                </div>
            `;
            
            // Cargar reflexión previa si existe
            if (userResponses['initial-reflection']) {
                document.getElementById('initial-reflection').value = userResponses['initial-reflection'];
            }
        }
        
        // Cargar fase de sensibilidad moral
        function loadSensitivity() {
            const gameContent = document.getElementById('game-content');
            
            let sensitivityQuestion = '';
            let stakeholders = '';
            
            switch(currentDilemma) {
                case 'error-acta':
                    sensitivityQuestion = '¿Identificás que hay un dilema ético en esta situación? ¿Qué elementos te hacen pensar que es un dilema?';
                    stakeholders = 'El alumno afectado, otros alumnos, el director, la secretaría académica, vos como docente';
                    break;
                    
                case 'cemento':
                    sensitivityQuestion = '¿Qué aspectos de esta situación te indican que hay un dilema ético? ¿Por qué creés que es un problema moral?';
                    stakeholders = 'Los futuros habitantes de las viviendas, los obreros, la empresa constructora, los proveedores, el gobierno que financia la obra';
                    break;
                    
                case 'paciente':
                    sensitivityQuestion = '¿Qué elementos de este caso te hacen pensar que es un dilema ético? ¿Por qué no es simplemente una decisión técnica?';
                    stakeholders = 'El paciente, su familia, otros pacientes, el hospital, el sistema de salud, vos como profesional';
                    break;
            }
            
            gameContent.innerHTML = `
                <div class="mb-6">
                    <h2 class="text-2xl md:text-3xl font-bold text-primary mb-2">Fase 1: Sensibilidad Moral</h2>
                    <p class="text-lg text-accent2 font-medium">¿Podés identificar que hay un dilema ético?</p>
                    <div class="w-full h-1 bg-gradient-to-r from-primary to-accent3 rounded-full mb-4"></div>
                </div>
                
                <div class="bg-secondary p-4 rounded-lg mb-6">
                    <h3 class="text-lg font-semibold text-primary mb-2">Pregunta clave:</h3>
                    <p class="text-gray-700 mb-4">${sensitivityQuestion}</p>
                    
                    <div class="bg-white p-4 rounded-lg mb-4">
                        <textarea id="sensitivity-response" class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent" rows="4" placeholder="Escribí tu respuesta aquí..."></textarea>
                    </div>
                </div>
                
                <div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-6">
                    <div class="reflection-question p-4 rounded-lg">
                        <h3 class="text-lg font-semibold text-primary mb-2">¿Quiénes están involucrados?</h3>
                        <p class="text-gray-700">Identificá a todas las partes afectadas por esta situación:</p>
                        <p class="mt-2 font-medium text-accent2">${stakeholders}</p>
                    </div>
                    
                    <div class="bg-accent3 bg-opacity-20 p-4 rounded-lg">
                        <h3 class="text-lg font-semibold text-primary mb-2">💡 ¿Sabías que?</h3>
                        <p class="text-gray-700">Muchos errores éticos ocurren no porque la gente sea mala, sino porque no logran percibir que están frente a un dilema moral. Desarrollar sensibilidad ética es el primer paso para tomar mejores decisiones.</p>
                    </div>
                </div>
                
                <div class="reflection-question p-4 rounded-lg">
                    <h3 class="text-lg font-semibold text-primary mb-2">Reflexión adicional:</h3>
                    <p class="text-gray-700 mb-2">¿Qué información adicional necesitarías para comprender mejor este dilema? ¿Hay algún aspecto cultural o contextual que deberías considerar?</p>
                    <textarea id="sensitivity-reflection" class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent" rows="3" placeholder="Escribí tus reflexiones aquí..."></textarea>
                </div>
            `;
            
            // Cargar respuestas previas si existen
            if (userResponses['sensitivity']) {
                document.getElementById('sensitivity-response').value = userResponses['sensitivity'];
            }
            if (userResponses['sensitivity-reflection']) {
                document.getElementById('sensitivity-reflection').value = userResponses['sensitivity-reflection'];
            }
        }
        
        // Cargar fase de juicio moral
        function loadJudgment() {
            const gameContent = document.getElementById('game-content');
            
            let options = [];
            let dilemmaSpecific = '';
            
            switch(currentDilemma) {
                case 'error-acta':
                    dilemmaSpecific = 'Error en el acta';
                    options = [
                        {
                            text: 'Informar inmediatamente del error al director y a secretaría académica, asumiendo las consecuencias administrativas.',
                            pros: 'Transparencia, justicia para el alumno, integridad profesional',
                            cons: 'Demoras en certificaciones, posible sanción administrativa'
                        },
                        {
                            text: 'No decir nada y dejar la nota como está, evitando problemas mayores.',
                            pros: 'Evita complicaciones administrativas, no afecta a otros alumnos',
                            cons: 'Injusticia para el alumno, falta de honestidad profesional'
                        },
                        {
                            text: 'Hablar con el alumno en privado, explicarle el error y ofrecerle compensación en futuras evaluaciones.',
                            pros: 'Soluciona el problema del alumno sin involucrar a la institución',
                            cons: 'Sigue siendo deshonesto con la institución, posible favoritismo'
                        },
                        {
                            text: 'Modificar discretamente el acta antes de que sea procesada, sin informar a nadie.',
                            pros: 'Soluciona el error sin consecuencias visibles',
                            cons: 'Falsificación de documento oficial, falta de transparencia'
                        }
                    ];
                    break;
                    
                case 'cemento':
                    dilemmaSpecific = 'Cemento que no alcanza';
                    options = [
                        {
                            text: 'Paralizar la obra hasta recibir el material completo, informando formalmente a los superiores.',
                            pros: 'Cumplimiento de normas técnicas, seguridad de la construcción',
                            cons: 'Demoras, pérdida económica, posible despido de personal'
                        },
                        {
                            text: 'Ajustar las mezclas para estirar el cemento, manteniendo la obra en marcha.',
                            pros: 'Cumplimiento de plazos, continuidad laboral para los obreros',
                            cons: 'Posible reducción en calidad, riesgo para futuros habitantes'
                        },
                        {
                            text: 'Comprar cemento adicional con dinero propio para completar, sin informar a la empresa.',
                            pros: 'Mantiene calidad y plazos sin involucrar a la empresa',
                            cons: 'Gasto personal, no resuelve el problema de fondo'
                        },
                        {
                            text: 'Informar a los futuros habitantes y pedirles que acepten las modificaciones por escrito.',
                            pros: 'Transparencia con los afectados, responsabilidad compartida',
                            cons: 'Posible rechazo, conflicto con la empresa, mala imagen'
                        }
                    ];
                    break;
                    
                case 'paciente':
                    dilemmaSpecific = 'Paciente sin cobertura';
                    options = [
                        {
                            text: 'Seguir estrictamente el protocolo y no recetar la medicación que no puede pagar.',
                            pros: 'Integridad profesional, cumplimiento normativo',
                            cons: 'Paciente sin tratamiento, posible empeoramiento de salud'
                        },
                        {
                            text: 'Modificar el diagnóstico para acceder a la medicación cubierta.',
                            pros: 'El paciente recibe tratamiento, solución inmediata',
                            cons: 'Falsificación de documentos, riesgo legal y ético'
                        },
                        {
                            text: 'Recetar la medicación correcta y ayudar al paciente a buscar financiamiento alternativo.',
                            pros: 'Solución ética y sostenible, ayuda real al paciente',
                            cons: 'Requiere tiempo y esfuerzo extra, posible fracaso'
                        },
                        {
                            text: 'Hablar con colegas para conseguir muestras médicas gratis de laboratorios.',
                            pros: 'El paciente recibe tratamiento sin violar normas',
                            cons: 'Solución temporal, no escalable a otros casos'
                        }
                    ];
                    break;
            }
            
            // Generar HTML de las opciones
            let optionsHTML = '';
            options.forEach((option, index) => {
                optionsHTML += `
                    <div id="option-${index}" onclick="selectOption(${index})" class="option-card bg-white p-4 rounded-lg shadow-sm mb-4 cursor-pointer transition-all hover:border-primary border border-transparent">
                        <div class="flex items-start">
                            <div class="bg-primary text-white rounded-full w-6 h-6 flex items-center justify-center mr-3 mt-1 flex-shrink-0">${index + 1}</div>
                            <div>
                                <h4 class="font-medium text-primary">${option.text}</h4>
                                <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mt-3">
                                    <div class="bg-green-50 p-2 rounded">
                                        <p class="text-xs font-semibold text-green-600">Puntos positivos:</p>
                                        <p class="text-sm text-green-700">${option.pros}</p>
                                    </div>
                                    <div class="bg-red-50 p-2 rounded">
                                        <p class="text-xs font-semibold text-red-600">Puntos negativos:</p>
                                        <p class="text-sm text-red-700">${option.cons}</p>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                `;
            });
            
            gameContent.innerHTML = `
                <div class="mb-6">
                    <h2 class="text-2xl md:text-3xl font-bold text-primary mb-2">Fase 2: Juicio Moral</h2>
                    <p class="text-lg text-accent2 font-medium">¿Cuál es la mejor decisión ética?</p>
                    <div class="w-full h-1 bg-gradient-to-r from-primary to-accent3 rounded-full mb-4"></div>
                </div>
                
                <div class="bg-secondary p-4 rounded-lg mb-6">
                    <h3 class="text-lg font-semibold text-primary mb-2">Evaluá las opciones:</h3>
                    <p class="text-gray-700 mb-4">Analizá cada una de las siguientes alternativas de acción. Considerá los puntos positivos y negativos de cada una.</p>
                    
                    ${optionsHTML}
                    
                    <div id="selected-option" class="hidden bg-accent1 bg-opacity-10 p-4 rounded-lg mt-4 border border-accent1">
                        <h4 class="font-semibold text-primary mb-2">Tu elección:</h4>
                        <p id="selected-option-text" class="text-gray-700"></p>
                        
                        <div class="mt-4">
                            <label for="justification" class="block text-sm font-medium text-primary mb-1">Justificá tu elección:</label>
                            <textarea id="justification" class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent" rows="3" placeholder="¿Por qué creés que esta es la mejor opción desde un punto de vista ético?"></textarea>
                        </div>
                    </div>
                </div>
                
                <div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-6">
                    <div class="reflection-question p-4 rounded-lg">
                        <h3 class="text-lg font-semibold text-primary mb-2">Para reflexionar:</h3>
                        <p class="text-gray-700">¿Qué valores éticos están en juego en este dilema? (ej. honestidad, justicia, responsabilidad, etc.)</p>
                    </div>
                    
                    <div class="bg-accent3 bg-opacity-20 p-4 rounded-lg">
                        <h3 class="text-lg font-semibold text-primary mb-2">💡 Marco teórico:</h3>
                        <p class="text-gray-700">El juicio moral implica evaluar qué curso de acción es más coherente con principios éticos universales como la justicia, el bienestar común y el respeto por las personas.</p>
                    </div>
                </div>
                
                <div class="reflection-question p-4 rounded-lg">
                    <h3 class="text-lg font-semibold text-primary mb-2">Reflexión final:</h3>
                    <p class="text-gray-700 mb-2">¿Cómo creés que tu elección impactará en las diferentes partes involucradas? ¿Qué consecuencias a corto y largo plazo podrías anticipar?</p>
                    <textarea id="judgment-reflection" class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent" rows="3" placeholder="Escribí tus reflexiones aquí..."></textarea>
                </div>
            `;
            
            // Cargar selección previa si existe
            if (userResponses['selectedOption'] !== undefined) {
                selectOption(userResponses['selectedOption']);
                document.getElementById('justification').value = userResponses['justification'] || '';
            }
            if (userResponses['judgment-reflection']) {
                document.getElementById('judgment-reflection').value = userResponses['judgment-reflection'];
            }
        }
        
        // Cargar fase de motivación moral
        function loadMotivation() {
            const gameContent = document.getElementById('game-content');
            
            let dilemmaSpecific = '';
            let motivationQuestions = [];
            
            switch(currentDilemma) {
                case 'error-acta':
                    dilemmaSpecific = 'Error en el acta';
                    motivationQuestions = [
                        '¿Qué te motivaría a reportar el error a pesar de las consecuencias negativas?',
                        '¿Qué factores podrían disuadirte de hacer lo correcto en este caso?',
                        '¿Cómo afectaría tu decisión el saber que otros docentes han pasado por situaciones similares?'
                    ];
                    break;
                    
                case 'cemento':
                    dilemmaSpecific = 'Cemento que no alcanza';
                    motivationQuestions = [
                        '¿Qué te impulsaría a paralizar la obra aunque signifique problemas económicos?',
                        '¿Qué presiones externas podrían llevarte a comprometer la calidad de la construcción?',
                        '¿Cómo influiría en tu decisión el pensar en las familias que habitarán esas viviendas?'
                    ];
                    break;
                    
                case 'paciente':
                    dilemmaSpecific = 'Paciente sin cobertura';
                    motivationQuestions = [
                        '¿Qué te motivaría a buscar alternativas éticas para ayudar al paciente?',
                        '¿Qué temores podrían frenarte de actuar según tu conciencia?',
                        '¿Cómo afectaría tu decisión el saber que otros colegas han actuado de manera similar?'
                    ];
                    break;
            }
            
            gameContent.innerHTML = `
                <div class="mb-6">
                    <h2 class="text-2xl md:text-3xl font-bold text-primary mb-2">Fase 3: Motivación Moral</h2>
                    <p class="text-lg text-accent2 font-medium">¿Qué te impulsa (o frena) a actuar éticamente?</p>
                    <div class="w-full h-1 bg-gradient-to-r from-primary to-accent3 rounded-full mb-4"></div>
                </div>
                
                <div class="bg-secondary p-4 rounded-lg mb-6">
                    <h3 class="text-lg font-semibold text-primary mb-2">Preguntas clave:</h3>
                    
                    <div class="space-y-4">
                        ${motivationQuestions.map((question, index) => `
                            <div class="bg-white p-4 rounded-lg">
                                <p class="font-medium text-primary mb-2">${question}</p>
                                <textarea id="motivation-${index}" class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent" rows="2" placeholder="Escribí tu respuesta aquí..."></textarea>
                            </div>
                        `).join('')}
                    </div>
                </div>
                
                <div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-6">
                    <div class="reflection-question p-4 rounded-lg">
                        <h3 class="text-lg font-semibold text-primary mb-2">Factores internos:</h3>
                        <p class="text-gray-700 mb-2">Identificá qué aspectos personales influirían en tu decisión:</p>
                        <ul class="list-disc list-inside text-gray-700 pl-2">
                            <li>Tus valores personales</li>
                            <li>Tus principios éticos</li>
                            <li>Tus emociones en esta situación</li>
                        </ul>
                    </div>
                    
                    <div class="bg-accent3 bg-opacity-20 p-4 rounded-lg">
                        <h3 class="text-lg font-semibold text-primary mb-2">Factores externos:</h3>
                        <p class="text-gray-700 mb-2">Considerá qué aspectos del contexto podrían influir:</p>
                        <ul class="list-disc list-inside text-gray-700 pl-2">
                            <li>Presión de superiores o colegas</li>
                            <li>Consecuencias profesionales</li>
                            <li>Cultura organizacional</li>
                        </ul>
                    </div>
                </div>
                
                <div class="reflection-question p-4 rounded-lg">
                    <h3 class="text-lg font-semibold text-primary mb-2">Reflexión final:</h3>
                    <p class="text-gray-700 mb-2">¿Qué tan fuerte es tu impulso ético en comparación con las presiones externas en este caso? ¿Qué podrías hacer para fortalecer tu motivación por actuar éticamente?</p>
                    <textarea id="motivation-reflection" class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent" rows="3" placeholder="Escribí tus reflexiones aquí..."></textarea>
                </div>
            `;
            
            // Cargar respuestas previas si existen
            if (userResponses['motivation']) {
                motivationQuestions.forEach((_, index) => {
                    if (userResponses['motivation'][index]) {
                        document.getElementById(`motivation-${index}`).value = userResponses['motivation'][index];
                    }
                });
                
                if (userResponses['motivation-reflection']) {
                    document.getElementById('motivation-reflection').value = userResponses['motivation-reflection'];
                }
            }
        }
        
        // Cargar fase de carácter moral
        function loadCharacter() {
            const gameContent = document.getElementById('game-content');
            
            let dilemmaSpecific = '';
            let characterQuestions = [];
            
            switch(currentDilemma) {
                case 'error-acta':
                    dilemmaSpecific = 'Error en el acta';
                    characterQuestions = [
                        '¿Qué obstáculos concretos enfrentarías para reportar el error?',
                        '¿Qué estrategias podrías usar para superar estos obstáculos?',
                        '¿Cómo podrías prepararte para las posibles consecuencias de tu decisión?'
                    ];
                    break;
                    
                case 'cemento':
                    dilemmaSpecific = 'Cemento que no alcanza';
                    characterQuestions = [
                        '¿Qué dificultades prácticas enfrentarías para paralizar la obra?',
                        '¿Cómo podrías comunicar tu decisión a los diferentes actores involucrados?',
                        '¿Qué recursos o apoyos necesitarías para mantener tu postura ética?'
                    ];
                    break;
                    
                case 'paciente':
                    dilemmaSpecific = 'Paciente sin cobertura';
                    characterQuestions = [
                        '¿Qué barreras institucionales dificultarían tu decisión ética?',
                        '¿Cómo podrías navegar estas barreras sin comprometer tus principios?',
                        '¿Qué redes de apoyo podrías activar para sostener tu decisión?'
                    ];
                    break;
            }
            
            gameContent.innerHTML = `
                <div class="mb-6">
                    <h2 class="text-2xl md:text-3xl font-bold text-primary mb-2">Fase 4: Carácter Moral</h2>
                    <p class="text-lg text-accent2 font-medium">¿Podés sostener tu decisión frente a los obstáculos?</p>
                    <div class="w-full h-1 bg-gradient-to-r from-primary to-accent3 rounded-full mb-4"></div>
                </div>
                
                <div class="bg-secondary p-4 rounded-lg mb-6">
                    <h3 class="text-lg font-semibold text-primary mb-2">Desafíos prácticos:</h3>
                    
                    <div class="space-y-4">
                        ${characterQuestions.map((question, index) => `
                            <div class="bg-white p-4 rounded-lg">
                                <p class="font-medium text-primary mb-2">${question}</p>
                                <textarea id="character-${index}" class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent" rows="2" placeholder="Escribí tu respuesta aquí..."></textarea>
                            </div>
                        `).join('')}
                    </div>
                </div>
                
                <div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-6">
                    <div class="reflection-question p-4 rounded-lg">
                        <h3 class="text-lg font-semibold text-primary mb-2">Plan de acción:</h3>
                        <p class="text-gray-700 mb-2">Desarrollá un plan concreto para implementar tu decisión ética:</p>
                        <textarea id="action-plan" class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent" rows="4" placeholder="1. Primer paso...&#10;2. Segundo paso...&#10;3. Tercer paso..."></textarea>
                    </div>
                    
                    <div class="bg-accent3 bg-opacity-20 p-4 rounded-lg">
                        <h3 class="text-lg font-semibold text-primary mb-2">💡 Desarrollo del carácter:</h3>
                        <p class="text-gray-700">El carácter moral se fortalece con la práctica constante de virtudes como la valentía, la perseverancia y la integridad, especialmente frente a la adversidad.</p>
                    </div>
                </div>
                
                <div class="reflection-question p-4 rounded-lg">
                    <h3 class="text-lg font-semibold text-primary mb-2">Reflexión final:</h3>
                    <p class="text-gray-700 mb-2">¿Qué habilidades o recursos necesitarías desarrollar para actuar con mayor integridad en situaciones similares en el futuro?</p>
                    <textarea id="character-reflection" class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent" rows="3" placeholder="Escribí tus reflexiones aquí..."></textarea>
                </div>
            `;
            
            // Cargar respuestas previas si existen
            if (userResponses['character']) {
                characterQuestions.forEach((_, index) => {
                    if (userResponses['character'][index]) {
                        document.getElementById(`character-${index}`).value = userResponses['character'][index];
                    }
                });
                
                if (userResponses['action-plan']) {
                    document.getElementById('action-plan').value = userResponses['action-plan'];
                }
                
                if (userResponses['character-reflection']) {
                    document.getElementById('character-reflection').value = userResponses['character-reflection'];
                }
            }
        }
        
        // Cargar retroalimentación final
        function loadFeedback() {
            const gameContent = document.getElementById('game-content');
            
            let dilemmaTitle = '';
            switch(currentDilemma) {
                case 'error-acta':
                    dilemmaTitle = 'El error en el acta (Sector educativo)';
                    break;
                case 'cemento':
                    dilemmaTitle = 'El cemento que no alcanza (Sector construcción)';
                    break;
                case 'paciente':
                    dilemmaTitle = 'El paciente sin cobertura (Sector salud)';
                    break;
            }
            
            gameContent.innerHTML = `
                <div class="mb-6">
                    <h2 class="text-2xl md:text-3xl font-bold text-primary mb-2">Retroalimentación Ética</h2>
                    <p class="text-lg text-accent2 font-medium">Análisis de tu desempeño según el Modelo de Rest</p>
                    <div class="w-full h-1 bg-gradient-to-r from-primary to-accent3 rounded-full mb-4"></div>
                </div>
                
                <div class="bg-secondary p-6 rounded-lg mb-6">
                    <h3 class="text-xl font-semibold text-primary mb-4">Resumen del dilema: ${dilemmaTitle}</h3>
                    
                    <div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-8">
                        <div>
                            <h4 class="font-semibold text-primary mb-2">Tu recorrido:</h4>
                            <div class="bg-white p-4 rounded-lg">
                                <div class="flex items-center mb-3">
                                    <div class="bg-primary text-white rounded-full w-8 h-8 flex items-center justify-center mr-3">1</div>
                                    <div>
                                        <p class="font-medium">Sensibilidad Moral</p>
                                        <p class="text-sm text-gray-500">${userResponses['sensitivity'] ? 'Completado' : 'No completado'}</p>
                                    </div>
                                </div>
                                
                                <div class="flex items-center mb-3">
                                    <div class="bg-primary text-white rounded-full w-8 h-8 flex items-center justify-center mr-3">2</div>
                                    <div>
                                        <p class="font-medium">Juicio Moral</p>
                                        <p class="text-sm text-gray-500">${userResponses['selectedOption'] !== undefined ? 'Opción ' + (userResponses['selectedOption'] + 1) + ' seleccionada' : 'No completado'}</p>
                                    </div>
                                </div>
                                
                                <div class="flex items-center mb-3">
                                    <div class="bg-primary text-white rounded-full w-8 h-8 flex items-center justify-center mr-3">3</div>
                                    <div>
                                        <p class="font-medium">Motivación Moral</p>
                                        <p class="text-sm text-gray-500">${userResponses['motivation'] ? 'Completado' : 'No completado'}</p>
                                    </div>
                                </div>
                                
                                <div class="flex items-center">
                                    <div class="bg-primary text-white rounded-full w-8 h-8 flex items-center justify-center mr-3">4</div>
                                    <div>
                                        <p class="font-medium">Carácter Moral</p>
                                        <p class="text-sm text-gray-500">${userResponses['character'] ? 'Completado' : 'No completado'}</p>
                                    </div>
                                </div>
                            </div>
                        </div>
                        
                        <div>
                            <h4 class="font-semibold text-primary mb-2">Tu desempeño:</h4>
                            <div class="bg-white p-4 rounded-lg h-full">
                                <canvas id="radarChart" height="200"></canvas>
                            </div>
                        </div>
                    </div>
                    
                    <div class="space-y-6">
                        <div class="bg-white p-4 rounded-lg">
                            <h4 class="font-semibold text-primary mb-2 flex items-center">
                                <span class="bg-green-100 text-green-800 rounded-full w-6 h-6 flex items-center justify-center mr-2 text-sm">✓</span>
                                Sensibilidad Moral: ¿Detectaste el dilema correctamente?
                            </h4>
                            <p class="text-gray-700 mt-2">${userResponses['sensitivity'] || 'No completaste esta sección'}</p>
                            ${userResponses['sensitivity-reflection'] ? `<p class="text-gray-700 mt-2"><strong>Reflexión:</strong> ${userResponses['sensitivity-reflection']}</p>` : ''}
                        </div>
                        
                        <div class="bg-white p-4 rounded-lg">
                            <h4 class="font-semibold text-primary mb-2 flex items-center">
                                <span class="bg-green-100 text-green-800 rounded-full w-6 h-6 flex items-center justify-center mr-2 text-sm">✓</span>
                                Juicio Moral: ¿La decisión que tomaste se alinea con valores éticos?
                            </h4>
                            <p class="text-gray-700 mt-2">${userResponses['justification'] || 'No completaste esta sección'}</p>
                            ${userResponses['judgment-reflection'] ? `<p class="text-gray-700 mt-2"><strong>Reflexión:</strong> ${userResponses['judgment-reflection']}</p>` : ''}
                        </div>
                        
                        <div class="bg-white p-4 rounded-lg">
                            <h4 class="font-semibold text-primary mb-2 flex items-center">
                                <span class="bg-green-100 text-green-800 rounded-full w-6 h-6 flex items-center justify-center mr-2 text-sm">✓</span>
                                Motivación Moral: ¿Reconociste los factores que podrían influir en tu acción?
                            </h4>
                            <p class="text-gray-700 mt-2">${userResponses['motivation-reflection'] || 'No completaste esta sección'}</p>
                        </div>
                        
                        <div class="bg-white p-4 rounded-lg">
                            <h4 class="font-semibold text-primary mb-2 flex items-center">
                                <span class="bg-green-100 text-green-800 rounded-full w-6 h-6 flex items-center justify-center mr-2 text-sm">✓</span>
                                Carácter Moral: ¿Identificaste barreras y estrategias reales para actuar?
                            </h4>
                            <p class="text-gray-700 mt-2">${userResponses['action-plan'] || 'No completaste esta sección'}</p>
                            ${userResponses['character-reflection'] ? `<p class="text-gray-700 mt-2"><strong>Reflexión:</strong> ${userResponses['character-reflection']}</p>` : ''}
                        </div>
                    </div>
                </div>
                
                <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                    <div class="reflection-question p-4 rounded-lg">
                        <h3 class="text-lg font-semibold text-primary mb-2">Para seguir reflexionando:</h3>
                        <p class="text-gray-700">¿Qué aprendiste sobre ti mismo/a a través de este ejercicio? ¿Cómo podrías aplicar estas reflexiones en tu vida profesional?</p>
                    </div>
                    
                    <div class="bg-accent3 bg-opacity-20 p-4 rounded-lg">
                        <h3 class="text-lg font-semibold text-primary mb-2">Próximos pasos:</h3>
                        <p class="text-gray-700">Te recomendamos revisar el código de ética de tu profesión y buscar casos similares para seguir desarrollando tu competencia ética.</p>
                    </div>
                </div>
                
                <div class="mt-6 flex flex-col sm:flex-row justify-between gap-4">
                    <button onclick="restartDilemma()" class="bg-primary hover:bg-accent2 text-white font-medium py-2 px-6 rounded-lg transition-all flex-1">
                        <i class="fas fa-redo mr-2"></i> Repetir este dilema
                    </button>
                    <button onclick="chooseNewDilemma()" class="bg-accent1 hover:bg-accent3 text-white font-medium py-2 px-6 rounded-lg transition-all flex-1">
                        <i class="fas fa-list mr-2"></i> Elegir otro dilema
                    </button>
                    <button onclick="endGame()" class="bg-white hover:bg-gray-100 text-primary font-medium py-2 px-6 rounded-lg border border-primary transition-all flex-1">
                        <i class="fas fa-home mr-2"></i> Volver al inicio
                    </button>
                </div>
            `;
            
            // Inicializar gráfico radar (simulado)
            setTimeout(() => {
                const radarCtx = document.getElementById('radarChart').getContext('2d');
                
                // Datos simulados basados en las respuestas del usuario
                const sensitivityScore = userResponses['sensitivity'] ? Math.min(100, userResponses['sensitivity'].length * 2) : 0;
                const judgmentScore = userResponses['justification'] ? Math.min(100, userResponses['justification'].length) : 0;
                const motivationScore = userResponses['motivation-reflection'] ? Math.min(100, userResponses['motivation-reflection'].length) : 0;
                const characterScore = userResponses['action-plan'] ? Math.min(100, userResponses['action-plan'].length) : 0;
                
                const radarData = {
                    labels: ['Sensibilidad', 'Juicio', 'Motivación', 'Carácter'],
                    datasets: [{
                        label: 'Tu desempeño',
                        data: [sensitivityScore, judgmentScore, motivationScore, characterScore],
                        backgroundColor: 'rgba(136, 23, 129, 0.2)',
                        borderColor: 'rgba(136, 23, 129, 1)',
                        pointBackgroundColor: 'rgba(136, 23, 129, 1)',
                        pointBorderColor: '#fff',
                        pointHoverBackgroundColor: '#fff',
                        pointHoverBorderColor: 'rgba(136, 23, 129, 1)'
                    }]
                };
                
                const radarConfig = {
                    type: 'radar',
                    data: radarData,
                    options: {
                        scales: {
                            r: {
                                angleLines: {
                                    display: true
                                },
                                suggestedMin: 0,
                                suggestedMax: 100,
                                ticks: {
                                    stepSize: 20
                                }
                            }
                        },
                        elements: {
                            line: {
                                tension: 0,
                                borderWidth: 3
                            }
                        }
                    }
                };
                
                new Chart(radarCtx, radarConfig);
            }, 500);
        }
        
        // Funciones de interacción
        function selectOption(index) {
            // Guardar la selección del usuario
            userResponses['selectedOption'] = index;
            
            // Resaltar la opción seleccionada
            document.querySelectorAll('.option-card').forEach((card, i) => {
                if (i === index) {
                    card.classList.add('border-primary', 'bg-accent1', 'bg-opacity-10');
                } else {
                    card.classList.remove('border-primary', 'bg-accent1', 'bg-opacity-10');
                }
            });
            
            // Mostrar área de justificación
            document.getElementById('selected-option').classList.remove('hidden');
            document.getElementById('selected-option-text').textContent = 
                document.querySelector(`#option-${index} h4`).textContent;
        }
        
        // Guardar respuestas al avanzar
        function nextStep() {
            // Guardar las respuestas del paso actual
            switch(currentStep) {
                case 1:
                    userResponses['initial-reflection'] = document.getElementById('initial-reflection').value;
                    break;
                case 2:
                    userResponses['sensitivity'] = document.getElementById('sensitivity-response').value;
                    userResponses['sensitivity-reflection'] = document.getElementById('sensitivity-reflection').value;
                    break;
                case 3:
                    userResponses['justification'] = document.getElementById('justification').value;
                    userResponses['judgment-reflection'] = document.getElementById('judgment-reflection').value;
                    break;
                case 4:
                    userResponses['motivation'] = [
                        document.getElementById('motivation-0').value,
                        document.getElementById('motivation-1').value,
                        document.getElementById('motivation-2').value
                    ];
                    userResponses['motivation-reflection'] = document.getElementById('motivation-reflection').value;
                    break;
                case 5:
                    userResponses['character'] = [
                        document.getElementById('character-0').value,
                        document.getElementById('character-1').value,
                        document.getElementById('character-2').value
                    ];
                    userResponses['action-plan'] = document.getElementById('action-plan').value;
                    userResponses['character-reflection'] = document.getElementById('character-reflection').value;
                    break;
            }
            
            // Avanzar al siguiente paso
            if (currentStep < totalSteps) {
                currentStep++;
                updateProgressBar();
                loadStepContent();
                document.getElementById('game-content').scrollIntoView({ behavior: 'smooth' });
            } else {
                // Finalizar el dilema
                document.getElementById('game-content').scrollIntoView({ behavior: 'smooth' });
            }
        }
        
        // Funciones de navegación final
        function restartDilemma() {
            currentStep = 1;
            updateProgressBar();
            loadStepContent();
            document.getElementById('game-content').scrollIntoView({ behavior: 'smooth' });
        }
        
        function chooseNewDilemma() {
            document.getElementById('game-container').classList.add('hidden');
            document.getElementById('welcome-screen').classList.remove('hidden');
            document.getElementById('welcome-screen').scrollIntoView({ behavior: 'smooth' });
        }
        
        function endGame() {
            document.getElementById('game-container').classList.add('hidden');
            document.getElementById('welcome-screen').classList.remove('hidden');
            document.getElementById('welcome-screen').scrollIntoView({ behavior: 'smooth' });
        }
        
        // Permitir navegar haciendo clic en la barra de progreso
        document.querySelectorAll('.progress-step').forEach(step => {
            step.addEventListener('click', function() {
                const stepNumber = parseInt(this.id.split('-')[1]);
                if (stepNumber < currentStep) { // Solo permitir ir a pasos anteriores
                    currentStep = stepNumber;
                    updateProgressBar();
                    loadStepContent();
                }
            });
        });
    </script>
    
    <!-- Chart.js para el gráfico radar -->
    <script src="https://cdn.jsdelivr.net/npm/chart.js"></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=Josimgy18/equitasproject1" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>