-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
857 lines (771 loc) · 38.1 KB
/
index.html
File metadata and controls
857 lines (771 loc) · 38.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Memory Matrix - ChessArcade</title>
<!-- Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-N3EKXHPD5Y"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-N3EKXHPD5Y');
</script>
<!-- Google AdSense -->
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-2472413468382197"
crossorigin="anonymous"></script>
<!-- Google Fonts: Orbitron para títulos estilo futurista -->
<link href="https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&display=swap" rel="stylesheet">
<!-- Font Awesome Icons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<!-- Estilos del juego -->
<link rel="stylesheet" href="styles.css?v=2">
<!-- Hamburger Menu (mobile) -->
<link rel="stylesheet" href="../../css/hamburger-menu.css?v=1">
<!-- Standard Desktop Menu Styles -->
<style>
/* ========== STANDARD DESKTOP MENU ========== */
.desktop-nav {
display: none;
}
@media (min-width: 768px) {
.desktop-nav {
display: flex;
position: fixed;
top: 20px;
right: 20px;
gap: 12px;
z-index: 1001;
}
}
.nav-btn {
display: flex;
align-items: center;
gap: 8px;
padding: 10px 16px;
min-height: 44px;
background: rgba(0, 0, 0, 0.7);
border: 2px solid;
border-radius: 8px;
font-family: 'Orbitron', sans-serif;
font-size: 12px;
font-weight: 700;
text-transform: uppercase;
cursor: pointer;
transition: all 0.3s ease;
text-decoration: none;
backdrop-filter: blur(10px);
}
.nav-btn:hover {
transform: translateY(-2px);
}
.nav-btn.btn-home {
border-color: #00ffff;
color: #00ffff;
box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}
.nav-btn.btn-home:hover {
background: rgba(0, 255, 255, 0.1);
box-shadow: 0 0 20px rgba(0, 255, 255, 0.6);
}
.nav-btn.btn-leaderboard {
border-color: #a855f7;
color: #a855f7;
box-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
}
.nav-btn.btn-leaderboard:hover {
background: rgba(168, 85, 247, 0.1);
box-shadow: 0 0 20px rgba(168, 85, 247, 0.6);
}
.nav-btn.btn-sound {
border-color: #ff8000;
color: #ff8000;
box-shadow: 0 0 10px rgba(255, 128, 0, 0.3);
min-width: 130px;
}
.nav-btn.btn-sound:hover {
background: rgba(255, 128, 0, 0.1);
box-shadow: 0 0 20px rgba(255, 128, 0, 0.6);
}
.nav-btn.btn-sound i {
font-size: 1.2rem;
}
.nav-btn.btn-sound.muted {
border-color: #ff4444;
color: #ff4444;
box-shadow: 0 0 10px rgba(255, 68, 68, 0.3);
}
.nav-btn.btn-sound.muted:hover {
background: rgba(255, 68, 68, 0.1);
box-shadow: 0 0 20px rgba(255, 68, 68, 0.6);
}
.nav-btn.btn-games {
border-color: #ffd700;
color: #ffd700;
box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}
.nav-btn.btn-games:hover {
background: rgba(255, 215, 0, 0.1);
box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}
.games-menu-container {
position: relative;
}
.games-dropdown {
position: absolute;
top: 100%;
right: 0;
margin-top: 8px;
background: rgba(10, 10, 26, 0.98);
border: 2px solid #ffd700;
border-radius: 10px;
min-width: 220px;
opacity: 0;
visibility: hidden;
transform: translateY(-10px);
transition: all 0.3s ease;
box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
backdrop-filter: blur(10px);
z-index: 1002;
}
.games-menu-container:hover .games-dropdown {
opacity: 1;
visibility: visible;
transform: translateY(0);
}
.games-dropdown .game-menu-item {
display: flex;
align-items: center;
gap: 12px;
padding: 12px 16px;
color: rgba(255, 255, 255, 0.7);
text-decoration: none;
border-bottom: 1px solid rgba(255, 215, 0, 0.2);
transition: all 0.2s ease;
font-family: 'Orbitron', sans-serif;
font-size: 11px;
}
.games-dropdown .game-menu-item:last-child {
border-bottom: none;
}
.games-dropdown .game-menu-item:hover {
background: rgba(255, 215, 0, 0.1);
color: #ffd700;
padding-left: 20px;
}
.games-dropdown .game-menu-item.current {
background: rgba(255, 215, 0, 0.15);
color: #ffd700;
}
.games-dropdown .game-icon {
font-size: 1.3rem;
filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.5));
}
/* ChessArcade Logo - desktop left */
.desktop-logo {
display: none;
}
@media (min-width: 768px) {
.desktop-logo {
display: flex;
position: fixed;
top: 15px;
left: 20px;
z-index: 1001;
}
}
.logo-link {
display: flex;
align-items: center;
gap: 0.8rem;
text-decoration: none;
transition: all 0.3s ease;
}
.logo-link:hover {
transform: scale(1.03);
}
.logo-text {
font-family: 'Orbitron', sans-serif;
font-size: 1.4rem;
font-weight: 700;
color: #fff;
text-shadow: 0 0 10px #00ffff, 0 0 20px #00ffff, 0 0 40px #ff0080;
}
@keyframes float {
0%, 100% { transform: translateY(0px); }
50% { transform: translateY(-5px); }
}
.joystick-icon {
width: 40px;
height: 40px;
}
/* Hide old menu on desktop */
@media (min-width: 768px) {
.header .btn-home,
.header .btn-sound,
.header .btn-leaderboard,
.header .neon-coin-counter,
.header .floating-games-menu {
display: none !important;
}
}
/* ========== END STANDARD DESKTOP MENU ========== */
</style>
</head>
<body>
<!-- Desktop Logo (top left) -->
<div class="desktop-logo">
<a href="../../index.html" class="logo-link">
<svg class="joystick-icon" viewBox="0 0 120 140" xmlns="http://www.w3.org/2000/svg" style="animation: float 3s ease-in-out infinite; filter: drop-shadow(0 0 15px #00d9ff);">
<defs>
<filter id="glow-cyan" x="-150%" y="-150%" width="400%" height="400%">
<feGaussianBlur stdDeviation="5" result="coloredBlur"/>
<feMerge><feMergeNode in="coloredBlur"/><feMergeNode in="SourceGraphic"/></feMerge>
</filter>
<filter id="glow-red" x="-150%" y="-150%" width="400%" height="400%">
<feGaussianBlur stdDeviation="5" result="coloredBlur"/>
<feMerge><feMergeNode in="coloredBlur"/><feMergeNode in="SourceGraphic"/></feMerge>
</filter>
</defs>
<g filter="url(#glow-cyan)">
<path d="M 60 100 L 85 87 L 60 74 L 35 87 Z" fill="#1a1a2e" stroke="#00d9ff" stroke-width="2.5"/>
<path d="M 60 74 L 85 87 L 85 95 L 60 108 Z" fill="#0f0f1a" stroke="#00d9ff" stroke-width="2"/>
<path d="M 60 74 L 35 87 L 35 95 L 60 108 Z" fill="#16161f" stroke="#00d9ff" stroke-width="2"/>
</g>
<g>
<rect x="55" y="65" width="10" height="17" fill="#2a2a3e" stroke="#666" stroke-width="1.2"/>
<ellipse cx="60" cy="82" rx="5" ry="2.5" fill="#1f1f2e" stroke="#555" stroke-width="1"/>
</g>
<g filter="url(#glow-red)">
<ellipse cx="60" cy="55" rx="15" ry="12" fill="#ff0040" stroke="#ff3366" stroke-width="1"/>
<ellipse cx="56" cy="50" rx="5" ry="4" fill="#ff6690" opacity="0.9"/>
</g>
</svg>
<span class="logo-text">ChessArcade</span>
<svg class="joystick-icon" viewBox="0 0 120 140" xmlns="http://www.w3.org/2000/svg" style="animation: float 3s ease-in-out infinite 1.5s; filter: drop-shadow(0 0 15px #ff0080);">
<defs>
<filter id="glow-magenta" x="-150%" y="-150%" width="400%" height="400%">
<feGaussianBlur stdDeviation="5" result="coloredBlur"/>
<feMerge><feMergeNode in="coloredBlur"/><feMergeNode in="SourceGraphic"/></feMerge>
</filter>
<filter id="glow-yellow" x="-150%" y="-150%" width="400%" height="400%">
<feGaussianBlur stdDeviation="5" result="coloredBlur"/>
<feMerge><feMergeNode in="coloredBlur"/><feMergeNode in="SourceGraphic"/></feMerge>
</filter>
</defs>
<g filter="url(#glow-magenta)">
<path d="M 60 100 L 85 87 L 60 74 L 35 87 Z" fill="#1a1a2e" stroke="#ff0080" stroke-width="2.5"/>
<path d="M 60 74 L 85 87 L 85 95 L 60 108 Z" fill="#0f0f1a" stroke="#ff0080" stroke-width="2"/>
<path d="M 60 74 L 35 87 L 35 95 L 60 108 Z" fill="#16161f" stroke="#ff0080" stroke-width="2"/>
</g>
<g>
<rect x="55" y="65" width="10" height="17" fill="#2a2a3e" stroke="#666" stroke-width="1.2"/>
<ellipse cx="60" cy="82" rx="5" ry="2.5" fill="#1f1f2e" stroke="#555" stroke-width="1"/>
</g>
<g filter="url(#glow-yellow)">
<ellipse cx="60" cy="55" rx="15" ry="12" fill="#ffd700" stroke="#ffee00" stroke-width="1"/>
<ellipse cx="56" cy="50" rx="5" ry="4" fill="#ffff80" opacity="0.9"/>
</g>
</svg>
</a>
</div>
<!-- Desktop Navigation (top right) -->
<nav class="desktop-nav">
<a href="../../index.html" class="nav-btn btn-home">
<i class="fa-solid fa-home"></i>
<span>HOME</span>
</a>
<button class="nav-btn btn-leaderboard" onclick="showLeaderboardModal && showLeaderboardModal('memory-matrix')" id="btnLeaderboardNav">
<i class="fa-solid fa-trophy"></i>
<span>RANKING</span>
</button>
<button class="nav-btn btn-sound" onclick="toggleSoundNav()" id="soundBtnNav">
<i class="fa-solid fa-volume-high" id="soundIconNav"></i>
<span>SONIDO</span>
</button>
<div class="games-menu-container">
<button class="nav-btn btn-games">
<i class="fa-solid fa-gamepad"></i>
<span>JUEGOS</span>
</button>
<div class="games-dropdown">
<a href="../knight-quest/index.html" class="game-menu-item">
<span class="game-icon">🐴</span>
<span>Knight Quest</span>
</a>
<a href="index.html" class="game-menu-item current">
<span class="game-icon">🧠</span>
<span>Memory Matrix</span>
</a>
<a href="../square-rush/index.html" class="game-menu-item">
<span class="game-icon">⚡</span>
<span>Square Rush</span>
</a>
<a href="../master-sequence/index.html" class="game-menu-item">
<span class="game-icon">🟦</span>
<span>Master Sequence</span>
</a>
<a href="../chessinfive/index.html" class="game-menu-item">
<span class="game-icon">⚔️</span>
<span>ChessInFive</span>
</a>
<a href="../criptocaballo/index.html" class="game-menu-item">
<span class="game-icon">🔐</span>
<span>CriptoCaballo</span>
</a>
<a href="../criptosopa/index.html" class="game-menu-item">
<span class="game-icon">🔍</span>
<span>CriptoSopa</span>
</a>
</div>
</div>
</nav>
<!-- ==================================================
CONTAINER PRINCIPAL
Todo el contenido del juego está aquí dentro
================================================== -->
<div class="game-container">
<!-- ==================================================
HEADER: Botones de navegación y control
================================================== -->
<header class="header">
<!-- Botón HOME: Volver a página principal de ChessArcade (desktop only) -->
<button class="btn-icon btn-home desktop-only" id="btnHome" aria-label="Volver al inicio">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path>
<polyline points="9 22 9 12 15 12 15 22"></polyline>
</svg>
<span class="btn-label">HOME</span>
</button>
<!-- BOTÓN COMENZAR / PAUSA (dinámico) -->
<button class="btn-primary btn-start-header" id="btnStart">
▶ Comenzar
</button>
<!-- Botón SONIDO: Mute/Unmute audio (desktop only) -->
<button class="btn-icon btn-sound desktop-only" id="btnSound" aria-label="Activar/desactivar sonido">
<svg class="icon-sound-on" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"></polygon>
<path d="M19.07 4.93a10 10 0 0 1 0 14.14M15.54 8.46a5 5 0 0 1 0 7.07"></path>
</svg>
<svg class="icon-sound-off" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="display: none;">
<polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"></polygon>
<line x1="23" y1="9" x2="17" y2="15"></line>
<line x1="17" y1="9" x2="23" y2="15"></line>
</svg>
<span class="btn-label">SONIDO</span>
</button>
<!-- Botón LEADERBOARD: Ver ranking global (desktop only) -->
<button class="btn-icon btn-leaderboard desktop-only" id="btnLeaderboard" aria-label="Ver tabla de líderes">
<span class="icon-leaderboard">🏆</span>
<span class="btn-label">LEADER</span>
</button>
<!-- Coin Counter (Now opens Games Menu) - desktop only -->
<div class="neon-coin-counter desktop-only" id="gamesMenuBtn" style="cursor: pointer;">
<div class="neon-coin-icon">¢</div>
<span>JUEGOS</span>
</div>
<!-- Floating Games Menu Dropdown (desktop only) -->
<div class="floating-games-menu desktop-only">
<div class="games-menu-dropdown" id="gamesMenuDropdown">
<a href="../knight-quest/index.html" class="game-menu-item">
<span class="game-icon">🐴</span>
<span class="game-name">Knight Quest</span>
</a>
<a href="../square-rush/index.html" class="game-menu-item">
<span class="game-icon">🎯</span>
<span class="game-name">Square Rush</span>
</a>
<a href="../memory-matrix-v2/index.html" class="game-menu-item">
<span class="game-icon">🧠</span>
<span class="game-name">Memory Matrix</span>
</a>
<a href="../master-sequence/index.html" class="game-menu-item">
<span class="game-icon">🟦</span>
<span class="game-name">Master Sequence</span>
</a>
<a href="../chessinfive/index.html" class="game-menu-item">
<span class="game-icon">⚔️</span>
<span class="game-name">ChessInFive</span>
</a>
<a href="../criptocaballo/index.html" class="game-menu-item">
<span class="game-icon">🔐</span>
<span class="game-name">CriptoCaballo</span>
</a>
</div>
</div>
<!-- Separador invisible para forzar nueva fila en desktop -->
<div class="header-break"></div>
<!-- Botón HINT: Muestra una pieza brevemente -->
<button class="btn-icon btn-hint" id="btnHint" aria-label="Pedir pista" disabled>
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="10"></circle>
<path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"></path>
<line x1="12" y1="17" x2="12.01" y2="17"></line>
</svg>
<span class="btn-label" id="hintLabel">HINT (6)</span>
</button>
<!-- Botón DESHACER: Quita última pieza colocada (solo desktop) -->
<button class="btn-icon btn-undo btn-undo-desktop" id="btnUndo" aria-label="Deshacer" disabled>
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M3 7v6h6"></path>
<path d="M21 17a9 9 0 00-9-9 9 9 0 00-6 2.3L3 13"></path>
</svg>
<span class="btn-label">ATRAS</span>
</button>
<!-- NOTA: Botón LIMPIAR implementado pero NO se usa en Memory Matrix
Razon: El objetivo del juego es MEMORIZAR, no experimentar.
Estos botones rompen la mecanica core del juego.
El codigo esta disponible para otros juegos (ej: puzzles, tacticas)
pero aqui permanecen ocultos.
<button class="btn-icon btn-undo" id="btnUndo" aria-label="Deshacer" disabled>
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M3 7v6h6"></path>
<path d="M21 17a9 9 0 00-9-9 9 9 0 00-6 2.3L3 13"></path>
</svg>
<span class="btn-label">DESHACER</span>
</button>
<button class="btn-icon btn-clear" id="btnClear" aria-label="Limpiar tablero" disabled>
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<polyline points="3 6 5 6 21 6"></polyline>
<path d="M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"></path>
</svg>
<span class="btn-label">LIMPIAR</span>
</button>
-->
</header>
<!-- ==================================================
TÍTULO PRINCIPAL
Logo del cerebro + nombre del juego estilo neón
================================================== -->
<div class="title-section">
<h1 class="game-title">
<span class="brain-icon">🧠</span>
<span class="title-text">Memory Matrix</span>
</h1>
<p class="game-subtitle">Memorize chess positions and recreate them perfectly!</p>
</div>
<!-- ==================================================
ÁREA DE JUEGO
Tablero + banco de piezas (responsive)
================================================== -->
<div class="game-area">
<!-- ============================================
BOTONES LATERALES (solo desktop)
HINT y ATRAS a la izquierda del tablero
============================================ -->
<div class="side-buttons-container">
<!-- Puntaje / Score -->
<div class="score-container" id="scoreContainer">
<span class="score-label">SCORE</span>
<span class="score-value" id="scoreDisplay">0</span>
</div>
<!-- Indicador de Nivel y Progreso -->
<div class="level-progress-container" id="levelProgressContainer">
<span class="level-number" id="levelNumber">NIVEL 1</span>
<div class="progress-bar-wrapper">
<div class="progress-bar" id="progressBar">
<div class="progress-fill" id="progressFill"></div>
</div>
<span class="progress-text" id="progressText">0/10</span>
</div>
</div>
<!-- Contador de Vidas -->
<div class="lives-container" id="livesContainer">
<span class="lives-label">VIDAS</span>
<span class="lives-hearts" id="livesDisplay">❤️❤️❤️❤️❤️</span>
</div>
<!-- Botón HINT -->
<button class="btn-side btn-hint-side" id="btnHintSide" aria-label="Pedir pista" disabled>
<svg width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="10"></circle>
<path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"></path>
<line x1="12" y1="17" x2="12.01" y2="17"></line>
</svg>
<span class="btn-side-label" id="hintLabelSide">HINT (6)</span>
</button>
<!-- Botón ATRAS -->
<button class="btn-side btn-undo-side" id="btnUndoSide" aria-label="Deshacer" disabled>
<svg width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M3 7v6h6"></path>
<path d="M21 17a9 9 0 00-9-9 9 9 0 00-6 2.3L3 13"></path>
</svg>
<span class="btn-side-label">ATRAS</span>
</button>
</div>
<!-- ============================================
SECCIÓN DEL TABLERO
Contenedor del tablero con coordenadas
============================================ -->
<div class="board-container">
<div class="board-wrapper"> <!-- NEW WRAPPER -->
<div class="chessboard" id="chessboard">
<!-- Las 64 casillas se generarán con JavaScript -->
</div>
<!-- Mensaje para iniciar juego -->
<div class="click-to-start-indicator" id="clickToStart">
<span class="icon">🖱️</span>
<span>Click para Empezar</span>
</div>
<!-- Contador de corrección (cuando fallas) -->
<div class="correction-counter hidden" id="correctionCounter">
<span class="correction-label">REVISA</span>
<span class="correction-number" id="correctionNumber">3</span>
</div>
</div>
</div>
<!-- PASO 5: Banco de piezas -->
<div class="piece-bank-container">
<h3 class="bank-title">Piezas Disponibles</h3>
<div class="piece-bank" id="pieceBank">
<!-- Las piezas se generarán con JavaScript -->
</div>
<!-- ================================================
CONTADOR DE TIEMPO (sobre el banco)
Muestra cuenta regresiva durante memorización
================================================ -->
<div class="timer-container hidden" id="timerContainer">
<div class="timer-circle">
<svg class="timer-svg" viewBox="0 0 100 100">
<circle class="timer-bg" cx="50" cy="50" r="45"></circle>
<circle class="timer-progress" id="timerProgress" cx="50" cy="50" r="45"></circle>
</svg>
<div class="timer-text" id="timerText">5</div>
</div>
</div>
<!-- ================================================
TIMER GLOBAL + CONTROLES (mobile)
En mobile: undo | timer | hint
En desktop: solo timer (undo y hint en header)
================================================ -->
<div class="timer-hint-container">
<!-- Botón UNDO mobile (izquierda del timer) -->
<button class="btn-icon btn-undo btn-undo-mobile" id="btnUndoMobile" aria-label="Deshacer" disabled>
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M3 7v6h6"></path>
<path d="M21 17a9 9 0 00-9-9 9 9 0 00-6 2.3L3 13"></path>
</svg>
</button>
<div class="global-timer" id="globalTimer">
<span class="timer-icon">⏱️</span>
<span class="timer-display" id="globalTimerDisplay">00:00</span>
</div>
<!-- Botón HINT mobile (derecha del timer) -->
<button class="btn-icon btn-hint btn-hint-mobile" id="btnHintMobile" aria-label="Pedir pista" disabled>
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="10"></circle>
<path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"></path>
<line x1="12" y1="17" x2="12.01" y2="17"></line>
</svg>
<span class="hint-count" id="hintCountMobile">6</span>
</button>
</div>
</div>
</div>
<!-- ==================================================
MENSAJE DE ESTADO
Muestra instrucciones y feedback al jugador
================================================== -->
<div class="status-section">
<p class="status-message" id="statusMessage">
Bienvenido a Memory Matrix
</p>
</div>
<!-- ==================================================
SELECTOR DE PIEZAS (movido desde header)
Mejor accesibilidad sin scroll en mobile
================================================== -->
<div class="piece-style-selector-bottom">
<label for="pieceStyleSelect" class="selector-label">
<svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor">
<!-- Icono de pieza de ajedrez (rey) -->
<path d="M19 22H5v-2h14v2M17.16 8.26A8.962 8.962 0 0 0 11 6c-2.38 0-4.5.93-6.08 2.45A1.49 1.49 0 0 0 4 9.5V10c0 3.31 2.69 6 6 6h4c3.31 0 6-2.69 6-6v-.5c0-.39-.15-.77-.42-1.06-.09-.09-.17-.17-.26-.24M11 2l-2 5h6l-2-5h-2z"/>
</svg>
<span class="btn-label">ESTILO DE PIEZAS</span>
</label>
<select id="pieceStyleSelect" class="style-select" aria-label="Seleccionar estilo de piezas">
<option value="cburnett">Lichess</option>
<option value="merida">Chess.com</option>
<option value="cardinal">Cardinal</option>
</select>
</div>
<!-- ==================================================
HOW TO PLAY - Instructions
================================================== -->
<section class="how-to-play-section">
<div class="instructions">
<h2>🎯 How to Play</h2>
<p><strong>Memory Matrix</strong> tests your visual memory with chess positions.</p>
<p>📝 <strong>Objective:</strong> Memorize piece positions, then recreate them from memory.</p>
<p>🧠 <strong>Gameplay:</strong> Watch the board carefully during memorization phase, then place pieces back exactly where they were.</p>
<p>💡 <strong>Hints:</strong> Use hints (6 per level) to reveal all missing pieces temporarily. <em>Warning: First hint costs 100 points, and the cost doubles each time (100→200→400...).</em></p>
<p>↩️ <strong>Undo:</strong> Made a mistake? Use the BACK button to undo placements one by one.</p>
<p>🎮 <strong>Progression:</strong> 8 levels with increasing difficulty - more pieces, less time!</p>
</div>
</section>
</div>
<!-- ==================================================
OVERLAY DE ERROR
Mensaje grande semitransparente cuando hay error
================================================== -->
<div class="error-overlay" id="errorOverlay">
<div class="error-content">
<div class="error-icon" id="errorCloseBtn" title="Cerrar">❌</div>
<h2 class="error-title" id="errorTitle">¡Posición incorrecta!</h2>
<p class="error-message" id="errorMessage">Revisa las piezas y vuelve a intentar</p>
</div>
</div>
<!-- ==================================================
CONFETI - Celebración de victoria
================================================== -->
<div class="confetti-container" id="confettiContainer"></div>
<!-- ==================================================
LEVEL TRANSITION - Transición entre niveles
================================================== -->
<div class="level-transition-overlay hidden" id="levelTransition">
<div class="level-transition-content">
<div class="level-icon">🎉</div>
<h2 class="level-title" id="levelTitle">¡Nivel Completado!</h2>
<div class="level-number" id="levelNumber">NIVEL 2</div>
<p class="level-name" id="levelName">Explorador</p>
<div class="level-progress-bar">
<div class="level-progress-fill" id="levelProgressFill"></div>
</div>
</div>
</div>
<!-- ==================================================
VICTORY MODAL - Juego completado (nivel 15)
================================================== -->
<div class="victory-overlay hidden" id="victoryOverlay">
<div class="victory-content">
<div class="victory-trophy">🏆</div>
<h1 class="victory-title">¡VICTORIA!</h1>
<p class="victory-subtitle">Has completado todos los niveles</p>
<div class="victory-stats">
<div class="victory-stat">
<span class="stat-icon">⏱️</span>
<span class="stat-label">Tiempo Total</span>
<span class="stat-value" id="victoryTime">00:00:00</span>
</div>
<div class="victory-stat">
<span class="stat-icon">⭐</span>
<span class="stat-label">Puntuación Final</span>
<span class="stat-value" id="victoryScore">0</span>
</div>
</div>
<p class="victory-rank-text">¡Eres un verdadero Dios del Ajedrez!</p>
<button class="victory-btn" id="victoryBtn">Ver Ranking</button>
</div>
</div>
<!-- ==================================================
JAVASCRIPT
================================================== -->
<!-- ChessGameLibrary - Módulos reutilizables -->
<script src="ChessGameLibrary/Utils.js"></script>
<script src="ChessGameLibrary/PieceAnimations.js"></script>
<script src="ChessGameLibrary/DragDrop.js"></script>
<script src="ChessGameLibrary/LevelTransition.js"></script>
<!-- Sistema de audio (Web Audio API) -->
<script src="audio.js"></script>
<!-- Sistema de niveles -->
<script src="levels.js"></script>
<!-- Lógica del juego -->
<script src="game.js"></script>
<!-- Leaderboard Integration -->
<link rel="stylesheet" href="../../css/leaderboard.css">
<script src="../../js/leaderboard-api.js"></script>
<script src="../../js/leaderboard-ui.js"></script>
<script src="ranking-animation.js"></script>
<script src="leaderboard-integration.js"></script>
<!-- Footer -->
<footer style="background: rgba(26, 0, 51, 0.9); padding: 2rem 1rem; margin-top: 4rem; border-top: 2px solid var(--neon-cyan); text-align: center;">
<div style="max-width: 1200px; margin: 0 auto;">
<div style="display: flex; flex-wrap: wrap; justify-content: center; gap: 2rem; margin-bottom: 1.5rem;">
<a href="../../articles.html" style="color: var(--neon-cyan); text-decoration: none; font-weight: bold; transition: all 0.3s ease;">Artículos</a>
<a href="../../chess_rules.html" style="color: var(--neon-cyan); text-decoration: none; font-weight: bold; transition: all 0.3s ease;">Reglas del Ajedrez</a>
<a href="../../about.html" style="color: var(--neon-cyan); text-decoration: none; font-weight: bold; transition: all 0.3s ease;">Acerca de</a>
<a href="../../contact.html" style="color: var(--neon-cyan); text-decoration: none; font-weight: bold; transition: all 0.3s ease;">Contacto</a>
<a href="../../privacy-policy.html" style="color: var(--neon-cyan); text-decoration: none; font-weight: bold; transition: all 0.3s ease;">Política de Privacidad</a>
</div>
<p style="color: var(--text-secondary); font-size: 0.9rem; margin: 0;">
© 2025 ChessArcade. Todos los derechos reservados.
</p>
<p style="color: var(--neon-magenta); font-size: 0.85rem; margin-top: 0.5rem;">
Hecho con 💜 para la comunidad de ajedrez
</p>
</div>
</footer>
<!-- Games Menu Toggle Script (desktop) -->
<script>
// Toggle games menu from coin counter
const gamesMenuBtn = document.getElementById('gamesMenuBtn');
const gamesMenuDropdown = document.getElementById('gamesMenuDropdown');
if (gamesMenuBtn && gamesMenuDropdown) {
gamesMenuBtn.addEventListener('click', function(e) {
e.stopPropagation();
gamesMenuDropdown.classList.toggle('active');
});
// Close menu when clicking outside
document.addEventListener('click', function(e) {
if (!gamesMenuBtn.contains(e.target) && !gamesMenuDropdown.contains(e.target)) {
gamesMenuDropdown.classList.remove('active');
}
});
// Close menu when pressing Escape
document.addEventListener('keydown', function(e) {
if (e.key === 'Escape') {
gamesMenuDropdown.classList.remove('active');
}
});
}
</script>
<!-- Hamburger Menu Library (mobile) -->
<script src="../../js/hamburger-menu.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
HamburgerMenu.init({
currentGame: 'memory-matrix',
gameId: 'memory-matrix'
});
// Auto-open leaderboard if URL has #leaderboard
if (window.location.hash === '#leaderboard') {
setTimeout(() => {
if (window.showLeaderboardModal) {
showLeaderboardModal('memory-matrix');
}
}, 500);
}
});
// Toggle sound for new nav menu
function toggleSoundNav() {
// Call existing toggleSound
if (typeof toggleSound === 'function') {
toggleSound();
}
// Update new nav icon
updateSoundNavIcon();
}
function updateSoundNavIcon() {
const iconNav = document.getElementById('soundIconNav');
const btnNav = document.getElementById('soundBtnNav');
const isMuted = window.MemoryMatrixAudio ? window.MemoryMatrixAudio.isMuted() : !soundEnabled;
if (iconNav) {
iconNav.className = isMuted ? 'fa-solid fa-volume-xmark' : 'fa-solid fa-volume-high';
}
if (btnNav) {
if (isMuted) {
btnNav.classList.add('muted');
} else {
btnNav.classList.remove('muted');
}
}
}
// Extend original updateSoundIcon to also update nav
const originalUpdateSoundIcon = window.updateSoundIcon;
window.updateSoundIcon = function() {
if (originalUpdateSoundIcon) originalUpdateSoundIcon();
updateSoundNavIcon();
};
</script>
</body>
</html>