File size: 11,935 Bytes
8b3b66c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
/* ============================================================
   HanziLearn – E-Learning Stylesheet
   ============================================================ */

/* ── Learn Header ────────────────────────────────────────────── */
.learn-header {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  padding: 2rem 0 0;
  position: relative;
}
/* Coloured top bar β€” colour injected by JS via --lc on #learnHeader */
.learn-header::before {
  content: '';
  position: absolute; top:0; left:0; right:0; height:3px;
  background: var(--lc, var(--accent));
}

.learn-badge {
  display:inline-flex; align-items:center;
  background: var(--lc, var(--accent));
  color:#fff; font-family:var(--mono-font); font-size:.85rem;
  font-weight:700; padding:.4rem .9rem; border-radius:999px;
}

.learn-title   { font-size:1.5rem; font-weight:700; }
.learn-subtitle { font-size:.85rem; color:var(--text-muted); }

.learn-user-chip {
  background:var(--bg-base); border:1px solid var(--border);
  border-radius:999px; padding:.35rem 1rem;
  font-size:.85rem; color:var(--text-muted);
}

/* ── Mode Tabs ───────────────────────────────────────────────── */
.mode-tabs {
  display:flex; gap:.25rem; overflow-x:auto; padding-bottom:0;
}
.mode-tabs::-webkit-scrollbar { height:0; }

.mode-tab {
  padding:.6rem 1.2rem; border-radius:10px 10px 0 0;
  font-size:.875rem; font-weight:500; color:var(--text-muted);
  text-decoration:none; white-space:nowrap;
  border:1px solid transparent; border-bottom:none;
  transition:all .2s;
}
.mode-tab:hover { color:var(--text-primary); background:rgba(255,255,255,.04); }
.mode-tab.active {
  color:var(--text-primary); background:var(--bg-base);
  border-color:var(--border);
}

/* ── Level Strip ─────────────────────────────────────────────── */
.level-strip {
  background:var(--bg-base); border-bottom:1px solid var(--border);
  padding:.75rem 0;
}
.level-pill {
  font-family:var(--mono-font); font-size:.8rem; font-weight:600;
  padding:.3rem .75rem; border-radius:999px;
  border:1.5px solid var(--border); color:var(--text-muted);
  text-decoration:none; transition:all .2s; white-space:nowrap;
}
.level-pill:hover { border-color:var(--accent); color:var(--accent); }
.level-pill.active { background:var(--accent); border-color:var(--accent); color:#fff; }

/* ── Loading Spinner ─────────────────────────────────────────── */
.learn-spinner {
  width:48px; height:48px;
  border:3px solid var(--border); border-top-color:var(--accent);
  border-radius:50%; animation:spin .8s linear infinite; margin:0 auto;
}
@keyframes spin { to { transform:rotate(360deg); } }

/* ════════════════════════════════════════════════════════════
   FLASHCARD – 3-D flip animation
   ════════════════════════════════════════════════════════════ */

.fc-progress-wrap { max-width:520px; margin:0 auto; }

/*
  .fc-scene   β€” sets up the 3-D perspective container
  .fc-card    β€” the card that actually rotates
  .fc-front / .fc-back  β€” the two faces (back is pre-rotated 180Β°)
  Adding .flipped to .fc-card triggers the flip.
*/
.fc-scene {
  width:100%; max-width:420px; height:300px;
  perspective: 1200px;          /* depth of 3-D space        */
  cursor:pointer; margin:0 auto;
  outline:none;                 /* handled by card border     */
}

.fc-card {
  position:relative; width:100%; height:100%;
  transform-style: preserve-3d;          /* children exist in 3-D  */
  transition: transform .65s cubic-bezier(.4, 0, .2, 1);
  border-radius:20px;
}

/* Click/keyboard β€” JS toggles this class */
.fc-card.flipped {
  transform: rotateY(180deg);
}

.fc-front,
.fc-back {
  position:absolute; inset:0;
  backface-visibility: hidden;          /* hide face when rotated away */
  -webkit-backface-visibility: hidden;
  border-radius:20px;
  display:flex; flex-direction:column;
  align-items:center; justify-content:center;
  padding:2rem; text-align:center;
}

/* Front face */
.fc-front {
  background: var(--bg-elevated);
  border:2px solid var(--border);
}

/* Back face β€” pre-rotated 180Β° so it faces backward initially */
.fc-back {
  background: linear-gradient(135deg, rgba(230,57,70,.08), var(--bg-elevated));
  border:2px solid rgba(230,57,70,.25);
  transform: rotateY(180deg);
}

/* Hover hint on front */
.fc-scene:hover .fc-front:not(.fc-card.flipped .fc-front) {
  border-color:rgba(230,57,70,.3);
}

.fc-hanzi {
  font-family:var(--hanzi-font); font-size:4rem;
  font-weight:700; color:var(--accent); line-height:1;
}
.fc-hanzi--sm { font-size:2.5rem; }

.fc-tap-hint { margin-top:1rem; color:var(--text-muted); font-size:.8rem; }

.fc-pinyin {
  font-family:var(--mono-font); font-size:1.1rem;
  color:var(--text-muted); margin:.5rem 0;
}

.fc-topic {
  font-size:.75rem; color:var(--text-muted);
  background:rgba(255,255,255,.06); border:1px solid var(--border);
  border-radius:999px; padding:.15rem .6rem; margin-bottom:.5rem;
}

.fc-divider { width:40px; height:2px; background:var(--border); margin:.75rem 0; }

.fc-meaning { font-size:.95rem; color:var(--text-primary); margin-bottom:.2rem; }
.fc-meaning--vi { color:var(--text-muted); font-size:.85rem; }

.btn-icon {
  width:48px; height:48px; border-radius:50%;
  display:flex; align-items:center; justify-content:center; padding:0;
}

/* ════════════════════════════════════════════════════════════
   QUIZ MODE
   ════════════════════════════════════════════════════════════ */
.quiz-timer {
  font-family:var(--mono-font); font-size:1.5rem; font-weight:700;
  color:var(--accent); min-width:48px; text-align:center; transition:color .3s;
}
.quiz-timer.urgent { color:#F44336; animation:pulse .5s ease-in-out infinite alternate; }
@keyframes pulse { from{opacity:1} to{opacity:.4} }

.quiz-question-card {
  background:var(--bg-elevated); border:1px solid var(--border);
  border-radius:var(--radius-lg); padding:2.5rem; text-align:center;
  max-width:480px; margin:0 auto;
}
.quiz-hanzi { font-family:var(--hanzi-font); font-size:3.5rem; font-weight:700; color:var(--accent); line-height:1; }
.quiz-pinyin { font-family:var(--mono-font); color:var(--text-muted); margin-top:.5rem; }

.quiz-options {
  display:grid; grid-template-columns:1fr 1fr; gap:.75rem;
  max-width:480px; margin:0 auto;
}
.quiz-option {
  background:var(--bg-elevated); border:2px solid var(--border);
  border-radius:var(--radius); padding:1rem; cursor:pointer;
  transition:all .2s; font-size:.95rem; text-align:center;
  color:var(--text-primary);
}
.quiz-option:hover:not(:disabled) { border-color:var(--accent); background:var(--accent-soft); }
.quiz-option.correct { border-color:#4CAF50; background:rgba(76,175,80,.12); color:#4CAF50; }
.quiz-option.wrong   { border-color:#F44336; background:rgba(244,67,54,.12); color:#F44336; }
.quiz-option:disabled { cursor:default; opacity:.7; }

.result-emoji    { font-size:4rem; }
.result-score-wrap {
  display:inline-block; background:var(--bg-elevated);
  border:1px solid var(--border); border-radius:var(--radius-lg); padding:1.5rem 3rem;
}
.result-score   { font-family:var(--mono-font); font-size:2.5rem; font-weight:700; color:var(--accent); }
.result-percent { font-size:1rem; color:var(--text-muted); }

/* ════════════════════════════════════════════════════════════
   FILL BLANK MODE
   ════════════════════════════════════════════════════════════ */
.fb-exercise-card {
  background:var(--bg-elevated); border:1px solid var(--border);
  border-radius:var(--radius-lg); padding:2rem;
  max-width:600px; margin:0 auto;
}
.fb-context { font-size:.85rem; text-transform:uppercase; letter-spacing:.06em; margin-bottom:1rem; }
.fb-sentence { font-family:var(--hanzi-font); font-size:1.8rem; color:var(--text-primary); line-height:1.6; margin-bottom:.75rem; }
.fb-blank { display:inline-block; min-width:80px; border-bottom:3px solid var(--accent); color:var(--accent); font-weight:700; text-align:center; padding:0 .5rem; }
.fb-hint  { font-family:var(--mono-font); font-size:.85rem; color:var(--text-muted); }

.fb-input {
  background:var(--bg-elevated); border:2px solid var(--border);
  border-radius:var(--radius); color:var(--text-primary);
  font-size:1.1rem; font-family:var(--hanzi-font);
}
.fb-input:focus {
  border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft);
  background:var(--bg-elevated); color:var(--text-primary);
}

.fb-feedback {
  max-width:480px; padding:.75rem 1rem; border-radius:var(--radius); font-weight:600;
}
.fb-feedback.correct { background:rgba(76,175,80,.12); border:1px solid rgba(76,175,80,.3); color:#4CAF50; }
.fb-feedback.wrong   { background:rgba(244,67,54,.12); border:1px solid rgba(244,67,54,.3); color:#F44336; }
.fb-translation { font-size:.85rem; color:var(--text-muted); font-style:italic; max-width:480px; margin-top:.5rem; }

/* ════════════════════════════════════════════════════════════
   LEADERBOARD MODE
   ════════════════════════════════════════════════════════════ */
.lb-card {
  background:var(--bg-elevated); border:1px solid var(--border);
  border-radius:var(--radius-lg); padding:1.5rem;
}
.lb-card-title {
  font-size:1rem; font-weight:700; margin-bottom:1.25rem;
  padding-bottom:.75rem; border-bottom:1px solid var(--border);
}
.lb-item {
  display:flex; align-items:center; gap:1rem;
  padding:.75rem 0; border-bottom:1px solid rgba(255,255,255,.04);
  transition:all .2s;
}
.lb-item:last-child { border-bottom:none; }
.lb-item:hover { padding-left:.25rem; }

.lb-rank { font-family:var(--mono-font); font-size:.85rem; color:var(--text-muted); width:24px; text-align:center; flex-shrink:0; }
.lb-rank.gold   { color:#FFD700; font-weight:700; font-size:1rem; }
.lb-rank.silver { color:#C0C0C0; font-weight:700; }
.lb-rank.bronze { color:#CD7F32; font-weight:700; }

.lb-avatar {
  width:36px; height:36px; border-radius:50%;
  background:var(--accent-soft); border:1.5px solid rgba(230,57,70,.2);
  display:flex; align-items:center; justify-content:center;
  font-family:var(--hanzi-font); font-size:.9rem; color:var(--accent); flex-shrink:0;
}
.lb-name  { flex:1; font-weight:500; font-size:.9rem; }
.lb-score { font-family:var(--mono-font); font-size:.85rem; color:var(--accent); font-weight:600; }

.lb-my-stats {
  background:var(--bg-elevated);
  border:1px solid rgba(230,57,70,.2); border-radius:var(--radius-lg); padding:1.5rem;
}
.my-stat-card { background:var(--bg-base); border-radius:var(--radius); padding:1.25rem; text-align:center; }
.my-stat-val  { font-family:var(--mono-font); font-size:1.75rem; font-weight:700; color:var(--accent); }
.my-stat-label { font-size:.8rem; color:var(--text-muted); margin-top:.25rem; }