-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
1162 lines (1075 loc) · 95.7 KB
/
Copy pathindex.html
File metadata and controls
1162 lines (1075 loc) · 95.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Security-Policy"
content="default-src 'self';
script-src 'self' https://unpkg.com https://cdn.jsdelivr.net;
style-src 'self' https://fonts.googleapis.com 'unsafe-inline';
font-src https://fonts.gstatic.com;
img-src 'self' data: https:;
connect-src 'self' https://*.supabase.co https://*.supabase.in https://cdn.jsdelivr.net https://unpkg.com https://api.dictionaryapi.dev;">
<title>8eacher | Scientifically Proven Memories</title>
<!-- Add Supabase SDK via CDN -->
<script src="https://unpkg.com/@supabase/supabase-js@2"></script>
<!-- Add Confetti library via CDN -->
<script src="https://cdn.jsdelivr.net/npm/canvas-confetti@1.6.0/dist/confetti.browser.min.js"></script>
<!-- Preconnect to Google Fonts domains to eliminate connection negotiation overhead -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700;800&display=swap" rel="stylesheet">
<!-- Parallelized CSS Loading to Prevent Render-Blocking Stylesheet Waterfalls -->
<link rel="stylesheet" href="css/base.css?v=12">
<link rel="stylesheet" href="css/layout.css?v=12">
<link rel="stylesheet" href="css/components.css?v=12">
<link rel="stylesheet" href="css/practice.css?v=12">
<link rel="stylesheet" href="css/canvas.css?v=12">
<link rel="stylesheet" href="css/gamification.css?v=12">
<link rel="stylesheet" href="css/scramble.css?v=12">
<link rel="stylesheet" href="css/zettelkasten.css?v=12">
<script type="module" src="app.js?v=11" defer></script>
<link rel="icon" type="image/png" href="/favicon.png?v=9">
<link rel="icon" href="/favicon.ico?v=9" sizes="any">
</head>
<body>
<!-- Global Top Header (Duolingo Style) -->
<header class="top-header">
<div class="top-header-content">
<h1 class="logo" data-view="dashboard" style="cursor: pointer;">8<span>eacher</span></h1>
<div class="top-header-right">
<!-- Premium Dynamic Sync Indicator -->
<div id="sync-indicator" class="sync-indicator hidden" title="Syncing with database...">
<svg class="spin-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" width="12" height="12">
<path d="M21.5 2v6h-6M21.34 15.57a10 10 0 1 1-.57-8.38l5.67-5.67"></path>
</svg>
<span>Syncing...</span>
</div>
<!-- Monochromatic Theme Toggle Button -->
<button class="header-icon-btn" id="btn-theme-toggle" title="Toggle Theme">
<!-- Moon icon for light mode (meaning switch to dark) -->
<svg class="theme-icon-light" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path></svg>
<!-- Sun icon for dark mode (meaning switch to light) -->
<svg class="theme-icon-dark hidden" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="5"></circle><line x1="12" y1="1" x2="12" y2="3"></line><line x1="12" y1="21" x2="12" y2="23"></line><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line><line x1="1" y1="12" x2="3" y2="12"></line><line x1="21" y1="12" x2="23" y2="12"></line><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line></svg>
</button>
<!-- Monochromatic Sound Toggle Button -->
<button class="header-icon-btn" id="btn-sound-toggle" title="Toggle Sound">
<!-- Unmuted speaker icon -->
<svg class="sound-icon-on" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><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>
<!-- Muted speaker icon -->
<svg class="sound-icon-off hidden" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><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>
</button>
<!-- Monochromatic User Profile Avatar Circle with Dropdown -->
<div class="user-profile-container" style="position: relative; display: flex; align-items: center;">
<div class="user-avatar" id="user-avatar-badge" style="cursor: pointer;" title="User Profile">U</div>
<div class="user-dropdown glass hidden" id="user-dropdown-menu">
<div class="user-dropdown-header">
<span class="user-email-label">Signed in as</span>
<span class="user-email" id="user-dropdown-email">user@example.com</span>
</div>
<div class="user-dropdown-divider"></div>
<button class="user-dropdown-item" id="btn-open-settings" type="button">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="16" height="16" style="vertical-align: middle; margin-right: 8px;"><circle cx="12" cy="12" r="3"></circle><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"></path></svg>
<span>Profile & Settings</span>
</button>
<button class="user-dropdown-item" id="btn-logout" type="button">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="16" height="16" style="vertical-align: middle; margin-right: 8px;"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path><polyline points="16 17 21 12 16 7"></polyline><line x1="21" y1="12" x2="9" y2="12"></line></svg>
<span>Logout</span>
</button>
</div>
</div>
</div>
</div>
</header>
<!-- Main Layout Container -->
<div class="app-container">
<!-- Sidebar Navigation -->
<aside class="sidebar">
<nav id="nav-buttons" class="hidden">
<button class="nav-btn active" data-view="dashboard" title="Go to main dashboard & practice overview">
<span class="nav-icon">
<svg 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>
<span class="nav-text">Practice</span>
</button>
<button class="nav-btn" data-view="create" title="Create a new memory card or mind map">
<span class="nav-icon">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line></svg>
</span>
<span class="nav-text">Create Card</span>
</button>
<button class="nav-btn" data-view="manage" title="View and search all saved memory cards">
<span class="nav-icon">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="8" y1="6" x2="21" y2="6"></line><line x1="8" y1="12" x2="21" y2="12"></line><line x1="8" y1="18" x2="21" y2="18"></line><line x1="3" y1="6" x2="3.01" y2="6"></line><line x1="3" y1="12" x2="3.01" y2="12"></line><line x1="3" y1="18" x2="3.01" y2="18"></line></svg>
</span>
<span class="nav-text">Memory Bank</span>
</button>
<button class="nav-btn" data-view="games" title="Play review games and active recall practices">
<span class="nav-icon">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<rect x="2" y="6" width="20" height="12" rx="2"></rect>
<path d="M6 12h4m-2-2v4m10-2a1 1 0 1 1-2 0 1 1 0 0 1 2 0m-3-3a1 1 0 1 1-2 0 1 1 0 0 1 2 0"></path>
</svg>
</span>
<span class="nav-text">Games</span>
</button>
<button class="nav-btn" data-view="stats" title="Track memorization progress, streaks & history">
<span class="nav-icon">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><line x1="9" y1="3" x2="9" y2="21"></line><line x1="15" y1="3" x2="15" y2="21"></line><line x1="3" y1="9" x2="21" y2="9"></line><line x1="3" y1="15" x2="21" y2="15"></line></svg>
</span>
<span class="nav-text">Stats</span>
</button>
</nav>
</aside>
<!-- Main Content Area -->
<main class="content-wrapper">
<!-- Auth View -->
<section id="view-auth" class="view active">
<div class="hero-section">
<h2>Master Your Mind.</h2>
<p>Using spaced repetition based on the SuperMemo-2 algorithm, 8eacher locks information into your long-term memory. Sign in to sync your progress.</p>
</div>
<div class="auth-box glass slide-up form-container centered">
<h3>Get Started</h3>
<p class="auth-subtext">Access your personal memory bank securely.</p>
<button class="btn btn-google full-width" id="btn-google-login" title="Sign in with your Google account to sync memories">
<svg viewBox="0 0 48 48" width="24px" height="24px"><path fill="#EA4335" d="M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z"/><path fill="#4285F4" d="M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z"/><path fill="#FBBC05" d="M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z"/><path fill="#34A853" d="M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z"/></svg>
Sign in with Google
</button>
</div>
</section>
<!-- Dashboard View -->
<section id="view-dashboard" class="view hidden">
<!-- Hero Banner Card (Duolingo Style) -->
<div class="dashboard-hero glass slide-up">
<div class="hero-left">
<h2>Take a full retention mapping practice</h2>
<p>Lock information into long-term memory using scientific spaced repetition.</p>
<div class="practice-controls-inline">
<div class="input-group-select">
<select id="practice-type-select">
<option value="mixed">All Types (Mixed)</option>
</select>
</div>
<button class="btn primary" id="btn-practice" title="Review due memory cards using spaced repetition">Practice</button>
</div>
<p id="practice-status-msg" class="status-msg-dashboard"></p>
</div>
<div class="hero-right">
<!-- Pure CSS Grayscale Laptop Illustration -->
<div class="geometric-art">
<div class="art-backdrop"></div>
<div class="art-clock"></div>
<div class="art-laptop">
<div class="art-laptop-screen">
<div class="art-laptop-bar active"></div>
<div class="art-laptop-bar"></div>
<div class="art-laptop-graph">
<div class="art-graph-column"></div>
<div class="art-graph-column"></div>
<div class="art-graph-column"></div>
<div class="art-graph-column"></div>
</div>
</div>
</div>
<div class="art-laptop-base"></div>
<div class="art-desk-line"></div>
</div>
</div>
</div>
<div class="stats-row slide-up" style="--delay: 0.15s">
<div class="stat-pill">
<span class="pill-label">Total Memories:</span>
<span id="stat-total" class="pill-value">0</span>
</div>
<div class="stat-pill" data-tooltip="Total Memory Score
Sum of all cards' memory strength scores (max 100 per card).">
<span class="pill-label">Total Score:</span>
<span id="stat-score" class="pill-value" style="color: var(--accent);">0</span>
</div>
<div class="stat-pill">
<span class="pill-label">Due Today:</span>
<span id="stat-due" class="pill-value highlight">0</span>
</div>
</div>
<!-- Memory Categories / Practice Skills Section -->
<div class="skills-section slide-up" style="--delay: 0.2s">
<h3>Practice Skills</h3>
<!-- Dynamic tabs navigation replicating Duolingo tab bar -->
<div id="category-tabs" class="category-tabs">
<!-- Populated dynamically via JS -->
</div>
<div id="category-cards-grid" class="category-cards-grid">
<!-- Dynamically populated category cards -->
</div>
</div>
</section>
<!-- Create Card View -->
<section id="view-create" class="view hidden">
<div class="glass form-container slide-up">
<div class="form-header">
<h2>New Memory</h2>
<button class="btn-icon close-view" data-view="dashboard">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="20" height="20"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
</button>
</div>
<form id="create-card-form">
<div class="input-group">
<label for="card-type">Memory Type (Category)</label>
<select id="card-type" required>
<option value="mixed">All Types (Mixed)</option>
</select>
</div>
<!-- Vocabulary Form Fields -->
<div id="create-vocab-fields">
<!-- Standard Fields (shown for Mixed/Image Card/etc.) -->
<div id="create-standard-fields">
<div class="input-group">
<label for="card-front">Concept (Front)</label>
<textarea id="card-front" placeholder="What is the powerhouse of the cell?"></textarea>
<div class="file-input-container">
<input type="file" id="card-front-image" class="file-input-hidden" accept="image/*">
<label for="card-front-image" class="file-input-button">Add Image</label>
<span id="card-front-image-name" class="file-input-name">No file chosen</span>
</div>
</div>
<div class="input-group">
<label for="card-back">Recall (Back / Target Word)</label>
<textarea id="card-back" placeholder="Mitochondria"></textarea>
<div class="file-input-container">
<input type="file" id="card-back-image" class="file-input-hidden" accept="image/*">
<label for="card-back-image" class="file-input-button">Add Image</label>
<span id="card-back-image-name" class="file-input-name">No file chosen</span>
</div>
</div>
</div>
<!-- Vocabulary Specific Fields (shown for Vocabulary card types) -->
<div id="create-vocabulary-fields" class="hidden">
<div class="input-group">
<label>Word & Type</label>
<div class="input-row" style="display: flex; gap: 12px; align-items: center; width: 100%;">
<input type="text" id="vocab-word" class="input-field" placeholder="Type word here..." style="flex: 6; width: 60%; box-sizing: border-box; height: 48px;">
<div style="flex: 4; width: 40%; box-sizing: border-box;">
<select id="vocab-type" multiple style="width: 100%; min-height: 48px;">
<option value="">Select Type</option>
<option value="Noun">Noun</option>
<option value="Verb">Verb</option>
<option value="Adjective">Adjective</option>
<option value="Adverb">Adverb</option>
<option value="Pronoun">Pronoun</option>
<option value="Preposition">Preposition</option>
<option value="Conjunction">Conjunction</option>
<option value="Interjection">Interjection</option>
<option value="Phrase">Phrase</option>
</select>
</div>
</div>
</div>
<div class="input-group">
<label for="vocab-meaning">Description / Meaning</label>
<textarea id="vocab-meaning" placeholder="Meaning of the word..."></textarea>
<div style="display: flex; justify-content: flex-end; margin-top: 8px;">
<button type="button" id="btn-vocab-add-meaning" class="btn secondary" style="min-height: 48px; font-size: 0.9rem;" title="Fetch definition from dictionary">Lookup</button>
</div>
<div id="vocab-lookup-result" class="hidden" style="margin-top: 12px; padding: 12px; background: rgba(255, 255, 255, 0.02); border: 1px solid var(--border-color); border-radius: 12px; user-select: none; pointer-events: none;">
<div style="font-weight: 700; font-size: 0.75rem; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; letter-spacing: 0.5px;">Dictionary Lookup (Read Only)</div>
<div class="lookup-text" style="font-size: 0.9rem; color: var(--text-secondary); line-height: 1.4;"></div>
</div>
<div class="file-input-row">
<div class="file-input-container">
<input type="file" id="vocab-front-image" class="file-input-hidden" accept="image/*">
<label for="vocab-front-image" class="file-input-button">Add Front Image</label>
<span id="vocab-front-image-name" class="file-input-name">No file chosen</span>
</div>
<div class="file-input-container">
<input type="file" id="vocab-back-image" class="file-input-hidden" accept="image/*">
<label for="vocab-back-image" class="file-input-button">Add Back Image</label>
<span id="vocab-back-image-name" class="file-input-name">No file chosen</span>
</div>
</div>
</div>
</div>
<div id="create-vocab-sentences-group" class="input-group" style="border-top: 1px dashed var(--border-color); padding-top: 15px; margin-top: 15px;">
<label>Example Sentences (Vocabulary Memory Clues)</label>
<div id="create-sentences-list" style="margin-bottom: 12px; display: flex; flex-direction: column; gap: 8px;">
<!-- Drafted sentences will render here -->
</div>
<div class="input-row">
<input type="text" id="create-new-sentence" class="input-field" placeholder="e.g. The cells contain Mitochondria.">
<button type="button" id="btn-create-add-sentence" class="btn" style="height: 48px;">+ Add</button>
</div>
<span id="create-sentence-error" style="color: var(--danger); font-size: 0.8rem; margin-top: 6px; display: none;"></span>
</div>
</div>
<!-- Zettelkasten Fields -->
<div id="create-zettelkasten-fields" class="hidden">
<div class="input-group">
<label for="card-zettel-quote">Quote (Front)</label>
<textarea id="card-zettel-quote" placeholder="e.g. Science is what you know, philosophy is what you don't know."></textarea>
</div>
<div class="input-group">
<label for="card-zettel-reference">Exact Source / Reference (Back)</label>
<input type="text" id="card-zettel-reference" class="input-field" placeholder="e.g. Bertrand Russell, Outline of Philosophy (1927)">
</div>
<div class="input-group">
<label for="card-zettel-tags">Tags (Comma-separated)</label>
<input type="text" id="card-zettel-tags" class="input-field" placeholder="e.g. philosophy, science, knowledge">
</div>
<div class="input-group" style="border-top: 1px dashed var(--border-color); padding-top: 15px; margin-top: 15px;">
<label>Connected Thoughts / Ideas</label>
<div id="create-zettel-links-list" style="margin-bottom: 12px; display: flex; flex-direction: column; gap: 8px;">
<!-- Drafted links will render here -->
</div>
<div class="input-row" style="display: flex; gap: 8px; flex-wrap: wrap;">
<select id="create-zettel-link-target" style="flex: 2; min-width: 180px;">
<option value="">-- Select Quote to Connect --</option>
</select>
<input type="text" id="create-zettel-link-label" class="input-field" placeholder="e.g. supports, refutes" style="flex: 1; min-width: 120px; margin: 0;">
<button type="button" id="btn-create-add-zettel-link" class="btn" style="height: 42px;">Connect</button>
</div>
</div>
</div>
<!-- Memory Map Fields -->
<div id="create-map-fields" class="hidden">
<div class="input-group">
<label for="create-map-title">Memory Map Title / Prompt</label>
<input type="text" id="create-map-title" class="input-field" placeholder="e.g. Krebs Cycle Steps / Brain Anatomy">
</div>
<div class="input-group">
<label>Visual Concept Map Editor</label>
<div id="create-map-canvas-container" style="position: relative; width: 100%; background: var(--bg-secondary); border: 2px solid var(--border-color); border-radius: 12px; overflow: auto; box-shadow: inset 0 -2px 0 var(--border-color); user-select: none; margin-top: 8px;">
<button type="button" class="fullscreen-close-btn hidden" title="Exit Fullscreen">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" width="18" height="18"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
</button>
<div id="create-map-viewport" style="position: absolute; left: 0; top: 0; width: 2500px; height: 2000px; transform-origin: 0 0;">
<div style="position: absolute; inset: 0; background-size: 20px 20px; background-image: radial-gradient(var(--border-color) 1px, transparent 0); opacity: 0.4; pointer-events: none;"></div>
<svg style="position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1;" id="create-map-svg">
<defs>
<marker id="create-arrowhead" markerWidth="6" markerHeight="6" refX="5" refY="3" orient="auto">
<polygon points="0 1.5, 5 3.5, 0 5.5" fill="currentColor" />
</marker>
</defs>
</svg>
<div id="create-map-nodes-container" style="position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2;"></div>
</div>
<div class="canvas-zoom-controls">
<button type="button" class="zoom-ctrl-text-btn" id="btn-create-map-add-node-bar">+ <span class="mobile-hide">Add </span>Node</button>
<button type="button" class="zoom-ctrl-text-btn" id="btn-create-map-clear-bar" style="color: var(--danger);">Clear</button>
<span class="zoom-divider">|</span>
<button type="button" class="zoom-ctrl-btn" id="btn-create-grid" style="font-size: 0.8rem; margin-left: 2px;" title="Toggle Grid Snapping">▦</button>
<span class="zoom-divider">|</span>
<button type="button" class="zoom-ctrl-btn" id="btn-create-zoom-out">−</button>
<span class="zoom-percent" id="create-zoom-label">100%</span>
<button type="button" class="zoom-ctrl-btn" id="btn-create-zoom-in">+</button>
<button type="button" class="zoom-ctrl-btn" id="btn-create-zoom-reset" style="font-size: 0.65rem; margin-left: 2px;">R</button>
<button type="button" class="zoom-ctrl-btn" id="btn-create-fullscreen" style="font-size: 0.65rem; margin-left: 2px;" title="Toggle Fullscreen">⛶</button>
</div>
</div>
<small style="color: var(--text-secondary); display: block; margin-top: 8px; font-size: 0.8rem; line-height: 1.4;" class="guide-wrapper">
<svg viewBox="0 0 24 24" class="icon-svg inline-icon"><path d="M9 18h6"></path><path d="M10 22h4"></path><path d="M15 15.6c1.1-1 1.8-2.4 1.8-3.9 0-3.1-2.5-5.6-5.6-5.6S5.6 8.6 5.6 11.7c0 1.5.7 2.9 1.8 3.9h7.6z"></path></svg><strong>Mind Map Guide:</strong> Double-click the canvas to spawn a card. Drag cards by their backgrounds. Click on a card's 🎨 palette icon to customize its text color and size. Click <strong>+</strong> on any of the four sides of a card to drag a connection and connect to another card. Click on any curved connection line to style its label, thickness, line style, color, or to delete it.
</small>
</div>
</div>
<button type="submit" class="btn primary full-width" style="margin-top: 16px;" title="Lock this card into your memory bank">Lock Memory</button>
</form>
</div>
</section>
<!-- Edit Card View -->
<section id="view-edit" class="view hidden">
<div class="glass form-container slide-up">
<div class="form-header">
<h2>Edit Memory</h2>
<button class="btn-icon close-view" data-view="manage">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="20" height="20"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
</button>
</div>
<form id="edit-card-form">
<input type="hidden" id="edit-card-id">
<div class="input-group">
<label for="edit-card-type">Memory Type (Category)</label>
<select id="edit-card-type" required>
<option value="mixed">All Types (Mixed)</option>
</select>
</div>
<!-- Vocabulary Form Fields for Edit -->
<div id="edit-vocab-fields">
<!-- Standard Fields (shown for Mixed/Image Card/etc.) -->
<div id="edit-standard-fields">
<div class="input-group">
<label for="edit-card-front">Concept (Front)</label>
<textarea id="edit-card-front" placeholder="What is the powerhouse of the cell?"></textarea>
<div id="edit-front-img-preview" class="hidden" style="margin-top: 10px; margin-bottom: 10px; position: relative; display: inline-block;">
<img src="" style="max-height: 100px; border-radius: 4px; display: block;" alt="Current Front Image">
<button type="button" id="btn-delete-edit-front-img" style="position: absolute; top: -8px; right: -8px; width: 20px; height: 20px; border-radius: 50%; background: var(--danger); color: white; border: none; font-size: 12px; font-weight: bold; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 4px rgba(0,0,0,0.2); line-height: 1;" title="Delete Image">×</button>
</div>
<div class="file-input-container">
<input type="file" id="edit-card-front-image" class="file-input-hidden" accept="image/*">
<label for="edit-card-front-image" class="file-input-button">Choose File</label>
<span id="edit-card-front-image-name" class="file-input-name">No file chosen</span>
</div>
<small style="color: var(--text-secondary);">Select a new image to replace the current one.</small>
</div>
<div class="input-group">
<label for="edit-card-back">Recall (Back / Target Word)</label>
<textarea id="edit-card-back" placeholder="Mitochondria"></textarea>
<div id="edit-back-img-preview" class="hidden" style="margin-top: 10px; margin-bottom: 10px; position: relative; display: inline-block;">
<img src="" style="max-height: 100px; border-radius: 4px; display: block;" alt="Current Back Image">
<button type="button" id="btn-delete-edit-back-img" style="position: absolute; top: -8px; right: -8px; width: 20px; height: 20px; border-radius: 50%; background: var(--danger); color: white; border: none; font-size: 12px; font-weight: bold; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 4px rgba(0,0,0,0.2); line-height: 1;" title="Delete Image">×</button>
</div>
<div class="file-input-container">
<input type="file" id="edit-card-back-image" class="file-input-hidden" accept="image/*">
<label for="edit-card-back-image" class="file-input-button">Choose File</label>
<span id="edit-card-back-image-name" class="file-input-name">No file chosen</span>
</div>
<small style="color: var(--text-secondary);">Select a new image to replace the current one.</small>
</div>
</div>
<!-- Vocabulary Specific Fields for Edit (shown for Vocabulary card types) -->
<div id="edit-vocabulary-fields" class="hidden">
<div class="input-group">
<label>Word & Type</label>
<div class="input-row" style="display: flex; gap: 12px; align-items: center; width: 100%;">
<input type="text" id="edit-vocab-word" class="input-field" placeholder="Type word here..." style="flex: 6; width: 60%; box-sizing: border-box; height: 48px;">
<div style="flex: 4; width: 40%; box-sizing: border-box;">
<select id="edit-vocab-type" multiple style="width: 100%; min-height: 48px;">
<option value="">Select Type</option>
<option value="Noun">Noun</option>
<option value="Verb">Verb</option>
<option value="Adjective">Adjective</option>
<option value="Adverb">Adverb</option>
<option value="Pronoun">Pronoun</option>
<option value="Preposition">Preposition</option>
<option value="Conjunction">Conjunction</option>
<option value="Interjection">Interjection</option>
<option value="Phrase">Phrase</option>
</select>
</div>
</div>
</div>
<div class="input-group">
<label for="edit-vocab-meaning">Description / Meaning</label>
<textarea id="edit-vocab-meaning" placeholder="Meaning of the word..."></textarea>
<div style="display: flex; justify-content: flex-end; margin-top: 8px;">
<button type="button" id="btn-edit-vocab-add-meaning" class="btn secondary" style="min-height: 48px; font-size: 0.9rem;" title="Fetch definition from dictionary">Lookup</button>
</div>
<div id="edit-vocab-lookup-result" class="hidden" style="margin-top: 12px; padding: 12px; background: rgba(255, 255, 255, 0.02); border: 1px solid var(--border-color); border-radius: 12px; user-select: none; pointer-events: none;">
<div style="font-weight: 700; font-size: 0.75rem; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; letter-spacing: 0.5px;">Dictionary Lookup (Read Only)</div>
<div class="lookup-text" style="font-size: 0.9rem; color: var(--text-secondary); line-height: 1.4;"></div>
</div>
<!-- Edit Vocab Front Image Preview and Upload -->
<div id="edit-vocab-front-img-preview" class="hidden" style="margin-top: 10px; margin-bottom: 10px; position: relative; display: inline-block;">
<img src="" style="max-height: 100px; border-radius: 4px; display: block;" alt="Current Front Image">
<button type="button" id="btn-delete-edit-vocab-front-img" style="position: absolute; top: -8px; right: -8px; width: 20px; height: 20px; border-radius: 50%; background: var(--danger); color: white; border: none; font-size: 12px; font-weight: bold; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 4px rgba(0,0,0,0.2); line-height: 1;" title="Delete Image">×</button>
</div>
<!-- Edit Vocab Back Image Preview and Upload -->
<div id="edit-vocab-back-img-preview" class="hidden" style="margin-top: 10px; margin-bottom: 10px; position: relative; display: inline-block;">
<img src="" style="max-height: 100px; border-radius: 4px; display: block;" alt="Current Back Image">
<button type="button" id="btn-delete-edit-vocab-back-img" style="position: absolute; top: -8px; right: -8px; width: 20px; height: 20px; border-radius: 50%; background: var(--danger); color: white; border: none; font-size: 12px; font-weight: bold; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 4px rgba(0,0,0,0.2); line-height: 1;" title="Delete Image">×</button>
</div>
<div class="file-input-row">
<div class="file-input-container">
<input type="file" id="edit-vocab-front-image" class="file-input-hidden" accept="image/*">
<label for="edit-vocab-front-image" class="file-input-button">Choose Front File</label>
<span id="edit-vocab-front-image-name" class="file-input-name">No file chosen</span>
</div>
<div class="file-input-container">
<input type="file" id="edit-vocab-back-image" class="file-input-hidden" accept="image/*">
<label for="edit-vocab-back-image" class="file-input-button">Choose Back File</label>
<span id="edit-vocab-back-image-name" class="file-input-name">No file chosen</span>
</div>
</div>
</div>
</div>
<div id="edit-vocab-sentences-group" class="input-group" style="border-top: 1px dashed var(--border-color); padding-top: 15px; margin-top: 15px;">
<label>Example Sentences (Vocabulary Memory Clues)</label>
<div id="edit-sentences-list" style="margin-bottom: 12px; display: flex; flex-direction: column; gap: 8px;">
<!-- Saved sentences will render here -->
</div>
<div class="input-row">
<input type="text" id="edit-new-sentence" class="input-field" placeholder="e.g. The cells contain Mitochondria.">
<button type="button" id="btn-edit-add-sentence" class="btn" style="height: 48px;">+ Add</button>
</div>
<span id="edit-sentence-error" style="color: var(--danger); font-size: 0.8rem; margin-top: 6px; display: none;"></span>
</div>
</div>
<!-- Zettelkasten Fields for Edit -->
<div id="edit-zettelkasten-fields" class="hidden">
<div class="input-group">
<label for="edit-card-zettel-quote">Quote (Front)</label>
<textarea id="edit-card-zettel-quote" placeholder="e.g. Science is what you know, philosophy is what you don't know."></textarea>
</div>
<div class="input-group">
<label for="edit-card-zettel-reference">Exact Source / Reference (Back)</label>
<input type="text" id="edit-card-zettel-reference" class="input-field" placeholder="e.g. Bertrand Russell, Outline of Philosophy (1927)">
</div>
<div class="input-group">
<label for="edit-card-zettel-tags">Tags (Comma-separated)</label>
<input type="text" id="edit-card-zettel-tags" class="input-field" placeholder="e.g. philosophy, science, knowledge">
</div>
<div class="input-group" style="border-top: 1px dashed var(--border-color); padding-top: 15px; margin-top: 15px;">
<label>Connected Thoughts / Ideas</label>
<div id="edit-zettel-links-list" style="margin-bottom: 12px; display: flex; flex-direction: column; gap: 8px;">
<!-- Saved links will render here -->
</div>
<div class="input-row" style="display: flex; gap: 8px; flex-wrap: wrap;">
<select id="edit-zettel-link-target" style="flex: 2; min-width: 180px;">
<option value="">-- Select Quote to Connect --</option>
</select>
<input type="text" id="edit-zettel-link-label" class="input-field" placeholder="e.g. supports, refutes" style="flex: 1; min-width: 120px; margin: 0;">
<button type="button" id="btn-edit-add-zettel-link" class="btn" style="height: 42px;">Connect</button>
</div>
</div>
</div>
<!-- Memory Map Fields for Edit -->
<div id="edit-map-fields" class="hidden">
<div class="input-group">
<label for="edit-map-title">Memory Map Title / Prompt</label>
<input type="text" id="edit-map-title" class="input-field" placeholder="e.g. Krebs Cycle Steps / Brain Anatomy">
</div>
<div class="input-group">
<label>Visual Concept Map Editor</label>
<div id="edit-map-canvas-container" style="position: relative; width: 100%; background: var(--bg-secondary); border: 2px solid var(--border-color); border-radius: 12px; overflow: auto; box-shadow: inset 0 -2px 0 var(--border-color); user-select: none; margin-top: 8px;">
<button type="button" class="fullscreen-close-btn hidden" title="Exit Fullscreen">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" width="18" height="18"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
</button>
<div id="edit-map-viewport" style="position: absolute; left: 0; top: 0; width: 2500px; height: 2000px; transform-origin: 0 0;">
<div style="position: absolute; inset: 0; background-size: 20px 20px; background-image: radial-gradient(var(--border-color) 1px, transparent 0); opacity: 0.4; pointer-events: none;"></div>
<svg style="position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1;" id="edit-map-svg">
<defs>
<marker id="edit-arrowhead" markerWidth="6" markerHeight="6" refX="5" refY="3" orient="auto">
<polygon points="0 1.5, 5 3.5, 0 5.5" fill="currentColor" />
</marker>
</defs>
</svg>
<div id="edit-map-nodes-container" style="position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2;"></div>
</div>
<div class="canvas-zoom-controls">
<button type="button" class="zoom-ctrl-text-btn" id="btn-edit-map-add-node-bar">+ <span class="mobile-hide">Add </span>Node</button>
<button type="button" class="zoom-ctrl-text-btn" id="btn-edit-map-clear-bar" style="color: var(--danger);">Clear</button>
<span class="zoom-divider">|</span>
<button type="button" class="zoom-ctrl-btn" id="btn-edit-grid" style="font-size: 0.8rem; margin-left: 2px;" title="Toggle Grid Snapping">▦</button>
<span class="zoom-divider">|</span>
<button type="button" class="zoom-ctrl-btn" id="btn-edit-zoom-out">−</button>
<span class="zoom-percent" id="edit-zoom-label">100%</span>
<button type="button" class="zoom-ctrl-btn" id="btn-edit-zoom-in">+</button>
<button type="button" class="zoom-ctrl-btn" id="btn-edit-zoom-reset" style="font-size: 0.65rem; margin-left: 2px;">R</button>
<button type="button" class="zoom-ctrl-btn" id="btn-edit-fullscreen" style="font-size: 0.65rem; margin-left: 2px;" title="Toggle Fullscreen">⛶</button>
</div>
</div>
<small style="color: var(--text-secondary); display: block; margin-top: 8px; font-size: 0.8rem; line-height: 1.4;" class="guide-wrapper">
<svg viewBox="0 0 24 24" class="icon-svg inline-icon"><path d="M9 18h6"></path><path d="M10 22h4"></path><path d="M15 15.6c1.1-1 1.8-2.4 1.8-3.9 0-3.1-2.5-5.6-5.6-5.6S5.6 8.6 5.6 11.7c0 1.5.7 2.9 1.8 3.9h7.6z"></path></svg><strong>Mind Map Guide:</strong> Double-click the canvas to spawn a card. Drag cards by their backgrounds. Click on a card's 🎨 palette icon to customize its text color and size. Click <strong>+</strong> on any of the four sides of a card to drag a connection and connect to another card. Click on any curved connection line to style its label, thickness, line style, color, or to delete it.
</small>
</div>
</div>
<button type="submit" class="btn primary full-width" style="margin-top: 16px;" title="Save changes to this card in your memory bank">Save Changes</button>
</form>
</div>
</section>
<!-- Practice View -->
<section id="view-practice" class="view hidden">
<div class="glass form-container slide-up">
<div class="form-header" id="practice-form-header">
<h2 style="display: flex; align-items: center; gap: 12px;">
Practice Session
<span style="font-size: 0.85rem; font-weight: 700; color: var(--text-secondary); background: var(--bg-secondary); padding: 4px 10px; border-radius: 12px; border: 2px solid var(--border-color);"><span id="practice-progress">1</span> / <span id="practice-total">10</span></span>
<span id="practice-card-score-badge-container" style="display: inline-flex; align-items: center;"></span>
</h2>
<button class="btn-icon close-view" data-view="dashboard">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="20" height="20"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
</button>
</div>
<div class="practice-workspace">
<div class="flashcard-container perspective">
<div class="flashcard" id="active-card">
<div class="card-face card-front glass">
<h3 id="practice-exercise-title">Complete the sentence with the correct word</h3>
<!-- Inline letter boxes inside the front face if sentence prompt exists -->
<div class="card-content" id="practice-front"></div>
<img id="practice-front-img" class="card-img hidden" alt="Front Attachment" onerror="this.classList.add('hidden');">
</div>
<div class="card-face card-back glass hidden">
<h3>Answer</h3>
<div class="card-content" id="practice-back"></div>
<img id="practice-back-img" class="card-img hidden" alt="Back Attachment" onerror="this.classList.add('hidden');">
</div>
</div>
</div>
<div class="practice-controls">
<!-- Right Column Image for Vocabulary Cards -->
<div id="practice-right-image-container" class="hidden practice-right-image-container">
<div class="practice-right-image-frame">
<img id="practice-right-img" alt="Vocabulary clue image" onerror="document.getElementById('practice-right-image-container').classList.add('hidden');" />
</div>
</div>
<!-- Dynamic Letter Spelling boxes container (Duolingo visual hint) -->
<div id="spelling-indicator-area" class="hidden" style="width: 100%; text-align: center; margin-bottom: 12px;">
<div id="practice-letter-boxes" class="letter-boxes-container">
<!-- Letters filled dynamically -->
</div>
</div>
<div id="typing-area" class="input-group slide-up">
<div id="practice-sequence-container" class="hidden" style="width: 100%; display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px;"></div>
<textarea id="practice-input" placeholder="Type your answer here..." rows="2"></textarea>
<button class="btn primary full-width" id="btn-submit-answer" style="margin-top: 16px;">Submit Answer</button>
</div>
<div id="evaluation-area" class="glass hidden slide-up" style="width: 100%; text-align: left; padding: 24px;">
<h3 style="margin-bottom: 8px; color: var(--text-secondary); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px;">Match Analysis</h3>
<p style="font-size: 1.3rem; margin-bottom: 8px; font-weight: 700;">Accuracy: <span id="eval-score">0%</span> - <span id="eval-grade" style="color: var(--accent);">Good</span></p>
<p style="color: var(--text-secondary); margin-bottom: 16px; font-size: 0.9rem;">Your Grade has been locked in automatically.</p>
<!-- Incorrect example sentence collector container -->
<div id="incorrect-sentence-container" class="hidden" style="margin-top: 16px; border-top: 2px solid var(--border-color); padding-top: 16px;">
<label for="incorrect-sentence-input" style="font-weight: 700; font-size: 0.85rem; text-transform: uppercase; color: var(--text-secondary); display: block; margin-bottom: 8px;">Create an example sentence using this word:</label>
<div class="input-row">
<input type="text" id="incorrect-sentence-input" class="input-field" placeholder="e.g. We're running low on gas.">
<button type="button" class="btn" id="btn-save-sentence">Save Clue</button>
</div>
<small id="sentence-error-msg" style="color: #ea4335; font-size: 0.8rem; display: block; margin-top: 6px; font-weight: 600;" class="hidden"></small>
</div>
<button class="btn full-width" id="btn-next-card" style="margin-top: 20px;">
Next Memory <svg class="btn-arrow" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="16" height="16" style="margin-left: 6px; transition: transform 0.2s;"><line x1="5" y1="12" x2="19" y2="12"></line><polyline points="12 5 19 12 12 19"></polyline></svg>
</button>
</div>
</div>
</div>
<div id="practice-completed" class="hidden" style="flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; width: 100%;">
<h2>Session Complete</h2>
<p style="color: var(--text-secondary); margin-bottom: 24px;">Your brain is getting stronger.</p>
<button class="btn primary" id="btn-finish-practice">Back to Dashboard</button>
</div>
</div>
</section>
<!-- Manage View -->
<section id="view-manage" class="view hidden">
<div class="glass form-container slide-up">
<div class="form-header">
<h2>Memory Bank</h2>
<button class="btn-icon close-view" data-view="dashboard">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="20" height="20"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
</button>
</div>
<!-- Filter and Search cards container -->
<div class="manage-filter-container" style="margin-bottom: 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px; width: 100%;">
<div style="display: flex; align-items: center; gap: 10px; flex: 1; min-width: 200px;">
<label for="manage-type-select" style="font-weight: 700; font-size: 0.85rem; text-transform: uppercase; color: var(--text-secondary); letter-spacing: 0.5px; white-space: nowrap;">Filter By Type:</label>
<div class="input-group-select" style="flex: 1; max-width: 200px;">
<select id="manage-type-select" class="input-field">
<option value="mixed">All Types (Mixed)</option>
</select>
</div>
</div>
<div class="manage-search-box" style="position: relative; flex: 1.2; min-width: 250px; display: flex; align-items: center;">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" width="16" height="16" style="position: absolute; left: 14px; color: var(--text-secondary); pointer-events: none;"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>
<input type="text" id="manage-search-input" class="input-field" placeholder="Search concept, recall, or details..." style="padding-left: 38px;">
</div>
</div>
<div id="manage-toolbar" class="manage-toolbar hidden">
<label class="manage-select-all">
<input type="checkbox" id="select-all-checkbox">
<span class="custom-checkbox"></span>
<span>Select All</span>
</label>
<div class="manage-toolbar-right">
<span id="selected-count" class="selected-count">0 selected</span>
<button class="btn btn-delete-batch hidden" id="btn-delete-selected">Delete Selected</button>
</div>
</div>
<div id="manage-list" class="manage-grid">
<!-- Memories populated here -->
</div>
</div>
</section>
<!-- Games View -->
<section id="view-games" class="view hidden">
<div class="glass form-container slide-up">
<div class="form-header">
<h2>Practice Games</h2>
</div>
<div class="games-grid">
<!-- Game 1: Recall Decks -->
<div class="game-card glass" data-game-id="collection">
<div class="game-card-badge">Active Recall</div>
<div class="game-card-content">
<div class="game-card-icon">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" width="26" height="26"><rect x="8" y="4" width="12" height="16" rx="2"></rect><path d="M4 8v10a2 2 0 0 0 2 2h10"></path></svg>
</div>
<h3>Recall Decks</h3>
<p>Study vocabulary decks using spaced repetition. Reconstruct definitions and score yourself to build long-term memory.</p>
</div>
<button class="btn primary">Start Recall</button>
</div>
<!-- Game 2: Word Scramble -->
<div class="game-card glass" data-game-id="scramble">
<div class="game-card-badge">Speed Spelling</div>
<div class="game-card-content">
<div class="game-card-icon">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" width="26" height="26">
<path d="m3 16 4-4 4 4m-4-4v10M21 8l-4 4-4-4m4 4V2"></path>
</svg>
</div>
<h3>Word Scramble</h3>
<p>Test your spelling, speed, and recall. Drag or tap letter tiles to reassemble scrambled words before the time runs out.</p>
</div>
<button class="btn primary">Start Scramble</button>
</div>
</div>
</div>
</section>
<!-- Collection/Recall Decks View -->
<section id="view-collection" class="view hidden">
<div class="glass form-container slide-up collection-container">
<!-- View 1: Stack Selection Mode -->
<div id="deck-stacks-view">
<div class="deck-header" style="display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px;">
<div>
<h2 style="display: flex; align-items: center; gap: 8px; margin: 0;">
<svg class="deck-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" width="28" height="28" style="vertical-align: middle;"><rect x="8" y="4" width="12" height="16" rx="2"></rect><path d="M4 8v10a2 2 0 0 0 2 2h10"></path></svg>
<span>Recall Decks</span>
</h2>
<p style="margin: 6px 0 0 0; color: var(--text-secondary); font-size: 0.9rem;">Choose a difficulty deck categorized by struggle level to focus your practice and reinforce retention.</p>
</div>
<button class="btn-icon" data-view="games" title="Back to Games" style="background: none; border: none; cursor: pointer; color: var(--text-primary); display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border-color); background: var(--bg-secondary);">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" width="16" height="16"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
</button>
</div>
<!-- Stacks Grid -->
<div id="stacks-grid" class="stacks-grid">
<!-- Stacks generated dynamically here -->
</div>
</div>
<!-- View 2: Active Recall Study Mode -->
<div id="deck-study-view" class="hidden">
<div class="deck-header" style="display: flex; align-items: center; justify-content: space-between; border-bottom: 2px solid var(--border-color); padding-bottom: 16px; margin-bottom: 24px;">
<button id="btn-back-to-stacks" class="btn" style="padding: 6px 12px; font-size: 0.8rem;">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" width="14" height="14" style="vertical-align: middle; margin-right: 4px;"><polyline points="15 18 9 12 15 6"></polyline></svg>
Back to Decks
</button>
<h3 id="study-stack-title" style="margin: 0; font-size: 1.2rem; color: var(--text-primary);">Recall Deck</h3>
<span id="study-stack-progress" class="card-type-indicator">Card 1 of 5</span>
</div>
<!-- Recall Session HUD -->
<div id="recall-hud" class="recall-hud">
<div class="hud-item hud-streak-container">
<span class="hud-label">Combo</span>
<span id="hud-streak-val" class="hud-value">0x</span>
</div>
<div class="hud-item hud-shields-container">
<span class="hud-label">Shields</span>
<span id="hud-shields-val" class="hud-value" style="display: inline-flex; align-items: center; gap: 4px;">
<span class="hud-shield active"><svg viewBox="0 0 24 24" class="icon-svg"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"></path></svg></span>
<span class="hud-shield active"><svg viewBox="0 0 24 24" class="icon-svg"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"></path></svg></span>
<span class="hud-shield active"><svg viewBox="0 0 24 24" class="icon-svg"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"></path></svg></span>
</span>
</div>
</div>
<!-- Big Card Study Arena -->
<div class="study-arena">
<div class="study-card-container">
<!-- Big Tilt Card rendered dynamically here -->
</div>
</div>
</div>
</div>
</section>
<!-- Scramble View -->
<section id="view-scramble" class="view hidden">
<div class="glass form-container slide-up scramble-container">
<!-- View 1: Difficulty/Deck Selection -->
<div id="scramble-decks-view">
<div class="deck-header" style="display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px;">
<div>
<h2 style="display: flex; align-items: center; gap: 8px; margin: 0;">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" width="28" height="28" style="vertical-align: middle; stroke-linecap: round; stroke-linejoin: round;">
<path d="m3 16 4-4 4 4m-4-4v10M21 8l-4 4-4-4m4 4V2"></path>
</svg>
<span>Word Scramble</span>
</h2>
<p style="margin: 6px 0 0 0; color: var(--text-secondary); font-size: 0.9rem;">Test your spelling and reaction speed. Reassemble scrambled letters from your vocabulary cards before the time runs out!</p>
</div>
<button class="btn-icon" data-view="games" title="Back to Games" style="background: none; border: none; cursor: pointer; color: var(--text-primary); display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border-color); background: var(--bg-secondary);">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" width="16" height="16"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
</button>
</div>
<!-- Selection Area: Start Button & Dropdown Selector -->
<div class="scramble-selector-container">
<div class="scramble-dropdown-wrapper">
<label for="scramble-difficulty-select" class="hud-label">Select Difficulty</label>
<select id="scramble-difficulty-select" class="scramble-select">
<!-- Populated dynamically via JS -->
</select>
</div>
<button id="btn-scramble-start" class="btn primary">
<svg viewBox="0 0 24 24" class="icon-svg" style="width: 18px; height: 18px;"><polygon points="5 3 19 12 5 21 5 3"></polygon></svg>
Start Scramble
</button>
</div>
</div>
<!-- View 2: Active Gameplay Screen -->
<div id="scramble-play-view" class="hidden">
<!-- Gameplay Header -->
<div class="scramble-header">
<button id="btn-scramble-exit" class="btn" style="padding: 6px 12px; font-size: 0.8rem;">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" width="14" height="14" style="vertical-align: middle; margin-right: 4px;"><polyline points="15 18 9 12 15 6"></polyline></svg>
Exit Game
</button>
<h3 id="scramble-game-title" style="margin: 0; font-size: 1.2rem; color: var(--text-primary);">Word Scramble</h3>
<div class="scramble-lives" id="scramble-lives-hud" title="Remaining Lives">
<span class="game-life active"><svg viewBox="0 0 24 24" class="icon-svg"><path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"></path></svg></span>
<span class="game-life active"><svg viewBox="0 0 24 24" class="icon-svg"><path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"></path></svg></span>
<span class="game-life active"><svg viewBox="0 0 24 24" class="icon-svg"><path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"></path></svg></span>
</div>
</div>
<div class="scramble-hud">
<div class="scramble-hud-item">
<span class="scramble-hud-label">Streak</span>
<span id="scramble-streak-val" class="scramble-hud-value highlight">0x</span>
</div>
<div class="scramble-hud-item">
<span class="scramble-hud-label">Progress</span>
<span id="scramble-progress-val" class="scramble-hud-value">1 / 10</span>
</div>
</div>
<!-- Card Arena -->
<div class="glass scramble-play-card" id="scramble-card-arena">
<!-- Clue Header -->
<div class="scramble-clue-label">Clue / Definition</div>
<!-- Clue Text -->
<div id="scramble-clue-text" class="scramble-clue-content">
in an unhappy way
</div>
<!-- Target Assembled Slots -->
<div id="scramble-slots-container" class="scramble-slots-row">
<!-- Dashed letters slots dynamically filled -->
</div>
<!-- Source Scrambled Tiles -->
<div id="scramble-tiles-container" class="scramble-tiles-row">
<!-- Letter tiles dynamically filled -->
</div>
<!-- Dynamic Feedback Box -->
<div id="scramble-feedback-box" class="scramble-feedback hidden">
<!-- Correct/Incorrect answer info -->
</div>
<!-- Controls: Proceed / Submit -->
<div style="display: flex; justify-content: center; width: 100%; margin-top: 16px;">
<button id="btn-scramble-action" class="btn primary" style="width: 100%; max-width: 320px; font-weight: 800; padding: 12px 24px;">Check (Enter)</button>
</div>
<!-- Shrinking Countdown Timer Progress Bar -->
<div class="scramble-timer-container">
<div id="scramble-timer-bar" class="scramble-timer-bar" style="width: 100%;"></div>
</div>
</div>
</div>
<!-- View 3: Game Over & Win Results Screen -->
<div id="scramble-results-view" class="hidden">
<div class="glass scramble-results-card">
<div id="scramble-result-status-icon" class="scramble-results-icon" style="color: var(--warning);"><svg viewBox="0 0 24 24" class="icon-svg"><path d="M6 9H4.5a2.5 2.5 0 0 1 0-5H6"></path><path d="M18 9h1.5a2.5 2.5 0 0 0 0-5H18"></path><path d="M4 22h16"></path><path d="M10 14.66V17c0 .55-.45 1-1 1H4v2h16v-2h-5c-.55 0-1-.45-1-1v-2.34"></path><path d="M12 2a6 6 0 0 1 6 6v3.5a6 6 0 0 1-6 6 6 6 0 0 1-6-6V8a6 6 0 0 1 6-6z"></path></svg></div>
<h2 id="scramble-result-title" style="margin-top: 8px;">Victory!</h2>
<p id="scramble-result-desc" style="color: var(--text-secondary); margin-bottom: 8px;">You cleared the entire deck stack!</p>
<div class="scramble-stats-grid">
<div class="scramble-stat-box">
<span class="scramble-stat-lbl">Max Streak</span>
<span id="scramble-stat-streak" class="scramble-stat-val">8x</span>
</div>
<div class="scramble-stat-box">
<span class="scramble-stat-lbl">Words Solved</span>
<span id="scramble-stat-solved" class="scramble-stat-val">9 / 10</span>
</div>
<div class="scramble-stat-box">
<span class="scramble-stat-lbl">Time Average</span>
<span id="scramble-stat-time" class="scramble-stat-val">4.2s</span>
</div>
</div>
<div style="display: flex; gap: 12px; width: 100%; max-width: 360px; margin-top: 12px;">
<button id="btn-scramble-retry" class="btn primary" style="flex: 1;">Play Again</button>
<button id="btn-scramble-back-to-decks" class="btn" style="flex: 1;">Change Level</button>
</div>
</div>
</div>
</div>
</section>
<!-- Statistics View -->
<section id="view-stats" class="view hidden">
<div class="glass form-container slide-up">
<div class="form-header">
<h2>Stats</h2>
<button class="btn-icon close-view" data-view="dashboard">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="20" height="20"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
</button>
</div>
<!-- Stats Tabs selector -->
<div class="category-tabs" id="stats-view-tabs" style="margin-top: -8px; margin-bottom: 24px;">
<button class="category-tab active" data-stats-tab="overview">Overview</button>
<button class="category-tab" data-stats-tab="graph">Memory Graph</button>
</div>
<!-- Tab Content: Overview -->
<div id="stats-tab-content-overview" class="stats-tab-content">
<!-- Monochromatic grid and simple stats columns -->
<div style="display: flex; flex-direction: column; gap: 24px;">
<!-- 1. Unified Comprehensive Activity & Creation Map -->
<div class="stats-card">
<div style="display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; flex-wrap: wrap;">
<div>
<h3 id="stats-heatmap-title" style="margin-top: 0; margin-bottom: 6px; font-size: 1.15rem; font-weight: 800; color: var(--text-primary);">Activity & Creation Heatmap</h3>
<p id="stats-heatmap-sub" style="margin: 0; font-size: 0.85rem; color: var(--text-secondary);">Daily overview of new cards added (<span style="color: #d4a63b; font-weight: 700;">Yellow</span>) and practice retrievals completed (<span style="color: #4a805a; font-weight: 700;">Green</span>) over <span id="stats-heatmap-period">the last year</span>.</p>
</div>
<!-- Premium Capsule Year Navigator -->
<div style="display: flex; align-items: center; gap: 4px; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 20px; padding: 2px;">
<button id="stats-year-prev" class="btn-icon" style="width: 32px; height: 32px;" title="Previous Year">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"></polyline></svg>
</button>
<span id="stats-year-display" style="font-size: 0.85rem; font-weight: 700; color: var(--text-primary); padding: 0 8px; min-width: 44px; text-align: center;">2026</span>
<button id="stats-year-next" class="btn-icon" style="width: 32px; height: 32px;" title="Next Year">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"></polyline></svg>
</button>
</div>
</div>
<div style="overflow-x: auto; scrollbar-width: thin; width: 100%; padding-bottom: 8px;">
<div id="contribution-grid-container" style="display: inline-flex; gap: 3px; min-width: 720px; align-items: center; justify-content: center; padding: 4px 0;">
<!-- Dynamic blocks populated via JS -->
</div>