Repository navigation
Expand file tree
/
Copy pathcodtec.css
More file actions
787 lines (737 loc) · 30 KB
/
Copy pathcodtec.css
File metadata and controls
787 lines (737 loc) · 30 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
:root {
--bg-color: #0d1117;
--panel-bg: rgba(22, 27, 34, 0.95);
--border: #30363d;
--text: #c9d1d9;
--muted: #8b949e;
--accent-blue: #58a6ff;
--accent-cyan: #00ffcc;
--correct-green: #39ff14;
--error-red: #ff4444;
--gold: #ffd700;
/* コースごとの色 */
--c-basics: #00ff00;
--c-stdlib: #f1e05a;
--c-features: #58c7ff;
--c-advanced: #d39bff;
--c-ecosystem: #ffb347;
}
[data-course="basics"] { --course: var(--c-basics); }
[data-course="stdlib"] { --course: var(--c-stdlib); }
[data-course="features"] { --course: var(--c-features); }
[data-course="advanced"] { --course: var(--c-advanced); }
[data-course="ecosystem"] { --course: var(--c-ecosystem); }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
background-color: var(--bg-color);
color: var(--text);
font-family: 'Fira Code', 'Consolas', 'Menlo', monospace;
display: flex;
align-items: center;
justify-content: center;
min-height: 100vh;
margin: 0;
padding: 16px;
}
#game-container {
position: relative;
text-align: center;
border: 1px solid var(--border);
padding: 22px 40px 14px;
background: var(--panel-bg);
box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
border-radius: 12px;
width: min(960px, 100%);
}
h1 { color: var(--accent-blue); letter-spacing: 8px; margin: 0 0 2px; font-size: 2rem; }
kbd {
display: inline-block;
padding: 1px 6px;
margin: 0 2px;
border: 1px solid #484f58;
border-bottom-width: 2px;
border-radius: 4px;
background: #161b22;
color: var(--text);
font-family: inherit;
font-size: 0.75em;
}
/* --- メニュー --- */
.portal-link { position: absolute; top: 14px; left: 14px; padding: 6px 12px; font-size: 0.75rem; }
.howto-link { position: absolute; top: 14px; right: 14px; padding: 6px 12px; font-size: 0.75rem; letter-spacing: 1px; }
.menu-message { min-height: 1.2em; margin: 0 0 6px; font-size: 0.8rem; color: var(--error-red); }
.selection-group { margin-bottom: 14px; }
.label { font-size: 0.75rem; color: var(--muted); margin: 0 0 6px; letter-spacing: 2px; }
.label span { color: #6e7681; letter-spacing: 0; }
.desc { min-height: 1.3em; margin: 5px 0 0; font-size: 0.75rem; color: var(--muted); }
.lang-group {
display: flex;
align-items: baseline;
gap: 6px;
margin-bottom: 4px;
text-align: left;
}
.group-label {
flex: 0 0 150px;
font-size: 0.68rem;
letter-spacing: 1px;
color: #6e7681;
text-align: right;
padding-right: 6px;
}
/* 注意書きがないときは、その行の高さも取らない */
#lang-note:empty { display: none; }
.lang-locked .chip:not(.active) { opacity: 0.35; }
.chip.picked { border-color: var(--accent-cyan); color: #fff; background: rgba(0, 255, 204, 0.12); }
.chip.picked::before { content: '\2713'; margin-right: 6px; color: var(--accent-cyan); }
.review-lang { color: var(--accent-blue); }
.group-chips, .chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
/* モードは 7 つを 1 行に並べるので、ボタンを少し詰める(幅が足りない画面では折り返す) */
#mode-selector { gap: 4px; }
#mode-selector .chip { padding: 4px 7px; font-size: 0.75rem; }
#mode-selector .chip[data-course]::before { margin-right: 5px; }
.chip-row { justify-content: center; }
.chip {
padding: 4px 10px;
border: 1px solid var(--border);
border-radius: 6px;
background: #161b22;
color: var(--text);
font-family: inherit;
font-size: 0.8rem;
font-weight: bold;
cursor: pointer;
transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.chip small { margin-left: 6px; color: #6e7681; font-weight: normal; font-size: 0.7rem; }
.chip:hover { border-color: var(--accent-blue); }
.chip:focus-visible, .btn-ghost:focus-visible, .btn-gradient:focus-visible, a:focus-visible {
outline: 2px solid var(--accent-blue);
outline-offset: 2px;
}
.chip.active {
border-color: var(--correct-green);
background: linear-gradient(to right, rgba(112, 218, 250, 0.25), rgba(147, 125, 247, 0.25));
color: #fff;
box-shadow: 0 0 12px rgba(57, 255, 20, 0.45);
}
.chip.active small { color: var(--text); }
.chip[data-course] { border-color: color-mix(in srgb, var(--course) 45%, var(--border)); }
.chip[data-course]:hover { border-color: var(--course); }
.chip[data-course].active {
border-color: var(--course);
background: color-mix(in srgb, var(--course) 16%, #161b22);
box-shadow: 0 0 12px color-mix(in srgb, var(--course) 55%, transparent);
}
.chip[data-course]::before {
content: '';
display: inline-block;
width: 8px;
height: 8px;
margin-right: 7px;
border-radius: 50%;
background: var(--course);
}
.custom-panel {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 8px 16px;
width: min(520px, 100%);
margin: 12px auto 0;
padding: 14px 16px;
border: 1px dashed var(--border);
border-radius: 8px;
text-align: left;
}
.custom-panel label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 0.8rem; color: var(--text); }
.custom-panel input {
width: 76px;
padding: 5px 8px;
border: 1px solid var(--border);
border-radius: 6px;
background: #0d1117;
color: #fff;
font-family: inherit;
font-size: 0.9rem;
text-align: right;
}
.custom-panel input:focus { outline: 2px solid var(--accent-blue); outline-offset: 1px; }
.custom-help, .custom-summary { grid-column: 1 / -1; margin: 2px 0 0; font-size: 0.75rem; color: var(--muted); }
.custom-summary { color: var(--accent-cyan); letter-spacing: 1px; }
.best-display { min-height: 1.3em; margin: 0; font-size: 0.85rem; color: var(--gold); letter-spacing: 1px; }
.key-hint { margin: 8px 0 0; font-size: 0.7rem; color: #6e7681; }
/* --- ボタン --- */
.btn-gradient {
display: inline-block;
padding: 12px 25px;
color: #fff;
border: 2px solid rgba(255, 255, 255, 0.4);
background-image: linear-gradient(to right, #70dafa 0%, #937df7 100%);
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
transition: 0.3s;
cursor: pointer;
font-family: inherit;
font-weight: bold;
text-transform: uppercase;
}
.btn-gradient:hover:not(:disabled) {
transform: translateY(-3px);
box-shadow: 0 8px 20px rgba(57, 255, 20, 0.3);
filter: brightness(1.1);
border-color: #fff;
}
#start-btn.btn-gradient {
background-image: linear-gradient(to right, #00f3ff 10%, #39ff14 90%);
color: #06210a;
width: min(480px, 100%);
padding: 8px 25px;
font-size: 1.25rem;
margin-top: 8px;
}
#start-btn:disabled { filter: grayscale(1); opacity: 0.2; cursor: not-allowed; }
.btn-ghost {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 8px 14px;
border: 1px solid var(--border);
border-radius: 6px;
background: transparent;
color: var(--muted);
font-family: inherit;
font-size: 0.85rem;
text-decoration: none;
cursor: pointer;
transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.btn-ghost:hover { color: #fff; border-color: var(--accent-blue); background: rgba(88, 166, 255, 0.1); }
/* --- ゲーム画面 --- */
#game-screen { position: relative; padding-bottom: 8px; }
/* 一時停止の間だけ、メニューが収まる高さを確保する */
#game-screen.paused { min-height: 300px; }
.game-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.course-tag {
display: inline-block;
min-height: 1.2em;
font-size: 0.7rem;
letter-spacing: 2px;
color: var(--course, var(--muted));
}
#course-tag { display: block; margin-bottom: 6px; font-size: 1rem; }
/* 区切りの知らせ。タイマーのすぐ下に出す。知らせのあるモードでは、そのぶんの場所を先に空けておくので、
出たり消えたりしてもほかの表示は動かない */
#game-screen.has-toast { padding-bottom: 60px; }
.toast {
--toast-x: -50%; /* 横の位置のずらし方。エディタでは左端にそろえるので 0 にする */
position: absolute;
bottom: 6px;
left: 50%;
transform: translateX(var(--toast-x));
padding: 8px 20px;
border: 2px solid var(--accent-cyan);
border-radius: 9999px;
background: #0d1117;
color: var(--accent-cyan);
font-size: 1.05rem;
font-weight: bold;
letter-spacing: 1px;
white-space: nowrap;
opacity: 0;
pointer-events: none;
z-index: 2;
}
.toast.show { animation: toast 2.6s ease-out forwards, toast-glow 0.5s ease-in-out 0.3s 3; }
.toast.warn { border-color: var(--error-red); color: #ff9a9a; }
.toast.warn.show { animation: toast 2.6s ease-out forwards, toast-glow-warn 0.5s ease-in-out 0.3s 3; }
/* 小さく現れて一度大きく弾み、しばらく光ってから、上へ消える */
@keyframes toast {
0% { opacity: 0; transform: translate(var(--toast-x), 14px) scale(0.6); }
10% { opacity: 1; transform: translate(var(--toast-x), 0) scale(1.14); }
18% { transform: translate(var(--toast-x), 0) scale(1); }
82% { opacity: 1; transform: translate(var(--toast-x), 0) scale(1); }
100% { opacity: 0; transform: translate(var(--toast-x), -12px) scale(0.96); }
}
@keyframes toast-glow {
0%, 100% { box-shadow: 0 0 0 rgba(0, 255, 204, 0); }
50% { box-shadow: 0 0 22px rgba(0, 255, 204, 0.75); }
}
@keyframes toast-glow-warn {
0%, 100% { box-shadow: 0 0 0 rgba(255, 68, 68, 0); }
50% { box-shadow: 0 0 22px rgba(255, 68, 68, 0.8); }
}
}
#game-info { font-size: 1rem; color: var(--accent-blue); text-align: left; }
.pause-icon {
width: 10px;
height: 12px;
border-left: 3px solid currentColor;
border-right: 3px solid currentColor;
}
#word-display {
font-size: 4rem;
line-height: 1.3;
min-height: 1.3em;
margin-bottom: 14px;
white-space: pre-wrap;
overflow-wrap: anywhere;
}
/* プレイ中の文字サイズは、問題文の長さと幅に合わせて script.js が決める */
#word-display.countdown { font-size: 4rem; color: #fff; }
#word-display span { color: #888; border-bottom: 3px solid transparent; }
#word-display span.current { color: #fff; border-bottom-color: var(--accent-cyan); }
#word-display span.cleared { color: var(--course, #00ff00); }
/* エディタモードで自動で入った閉じ側(まだ通り過ぎていないものは薄く、通り過ぎたら少し薄いまま) */
#word-display span.auto { color: var(--course, #00ff00); opacity: 0.45; }
#word-display span.cleared.auto { opacity: 0.7; }
#word-display span.miss {
display: inline-block;
background-color: #ff0000;
color: #fff;
animation: shake 0.12s;
}
#note-display { min-height: 1.5em; margin-bottom: 22px; font-size: 1rem; color: var(--muted); }
#note-display.warn { color: var(--error-red); }
#timer-display { font-size: 1.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
#timer-display.bonus { color: var(--correct-green); }
#timer-display.penalty { color: var(--error-red); }
/* 終了時の表示(FINISH! / TIME UP! / TERMINATED) */
#timer-display.ending {
font-size: 2.6rem;
font-weight: bold;
letter-spacing: 8px;
}
#timer-display.ending.finish { color: var(--correct-green); text-shadow: 0 0 18px rgba(57, 255, 20, 0.6); }
#timer-display.ending.timeup { color: var(--gold); text-shadow: 0 0 18px rgba(255, 215, 0, 0.6); }
#timer-display.ending.dead {
color: var(--error-red);
text-shadow: 0 0 18px rgba(255, 68, 68, 0.7);
animation: shake 0.12s 3;
}
#note-display.ending-note { color: var(--text); }
@keyframes shake {
0%, 100% { transform: translateX(0); }
25% { transform: translateX(4px); }
75% { transform: translateX(-4px); }
}
@keyframes blink { 50% { opacity: 0.25; } }
/* --- エディタ画面(EDITOR のとき。VS Code 風) --- */
/* NORMAL の表示を隠し、エディタの枠だけを出す */
#game-screen.editor-mode > .game-header,
#game-screen.editor-mode > #course-tag,
#game-screen.editor-mode > #word-display { display: none; }
#game-screen.editor-mode { padding-bottom: 0; }
.editor {
--ed-size: 19px; /* コードの文字の大きさ(固定) */
--ed-lh: 1.6; /* 行の高さ */
--ed-bg: #0d1117;
--ed-bar: #161b22;
display: flex;
flex-direction: column;
border: 1px solid var(--border);
border-radius: 8px;
background: var(--ed-bg);
text-align: left;
}
/* 上のタブ */
.ed-tabs {
display: flex;
align-items: stretch;
justify-content: space-between;
min-height: 40px;
border-bottom: 1px solid var(--border);
border-radius: 8px 8px 0 0;
background: var(--ed-bar);
}
.ed-tab {
display: flex;
align-items: center;
gap: 14px;
padding: 0 16px;
border-right: 1px solid var(--border);
border-top: 2px solid var(--course, var(--accent-blue));
border-radius: 8px 0 0 0;
background: var(--ed-bg);
margin-bottom: -1px; /* 選ばれているタブは、下の線を消してエディタとつなげる */
font-size: 0.9rem;
}
.ed-tab-name { color: var(--course, var(--muted)); }
.ed-tab-close { color: #6e7681; font-size: 1rem; }
.ed-tab-slot { display: flex; align-items: center; padding: 4px 8px; }
.ed-tab-slot .btn-ghost { padding: 4px 10px; font-size: 0.75rem; }
/* コードの欄。高さは script.js が、全問題の中でいちばん行数の多いものに合わせて固定する */
.ed-code {
position: relative;
padding: 10px 0;
font-size: var(--ed-size);
line-height: var(--ed-lh);
overflow: hidden;
}
.ed-row { display: grid; grid-template-columns: 4ch minmax(0, 1fr); column-gap: 18px; }
.ed-row.active { background: rgba(255, 255, 255, 0.04); }
.ed-ln { color: #6e7681; text-align: right; user-select: none; }
.ed-row.active .ed-ln { color: var(--text); }
.ed-line {
min-height: calc(var(--ed-size) * var(--ed-lh));
padding-right: 16px;
white-space: pre-wrap;
overflow-wrap: anywhere;
tab-size: 4;
}
.ed-comment { color: #6a9955; }
.ed-line span { color: #888; }
.ed-line span[data-break] { display: none; }
.ed-line span.cleared { color: var(--course, #00ff00); }
/* 次に打つ文字。左に縦線のカーソルを出す */
.ed-line span.current { color: #fff; box-shadow: inset 2px 0 0 var(--accent-cyan); background: rgba(0, 255, 204, 0.12); }
/* 自動で入った閉じ側(まだ通り過ぎていないものは薄く、通り過ぎたら少し薄いまま) */
.ed-line span.auto { color: var(--course, #00ff00); opacity: 0.45; }
.ed-line span.cleared.auto { opacity: 0.7; }
.ed-line span.miss {
display: inline-block;
background-color: #ff0000;
color: #fff;
animation: shake 0.12s;
}
/* 測るための見えない複製(script.js が一時的に作る) */
.ed-measure {
position: absolute;
top: 0;
left: 0;
height: auto !important;
padding: 0;
visibility: hidden;
pointer-events: none;
}
.ed-countdown {
position: absolute;
inset: 0;
display: flex;
align-items: center;
justify-content: center;
font-size: 4rem;
color: #fff;
}
/* 解説の欄の代わりに、IME の注意や終わりの表示を出す 1 行 */
.ed-panel { border-top: 1px solid var(--border); padding: 4px 16px; }
.ed-panel #note-display { min-height: 1.5em; margin: 0; font-size: 0.9rem; text-align: left; }
.ed-panel #note-display:not(:empty)::before { content: '> '; color: #6e7681; }
/* 下のステータスバー */
.ed-status {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px 16px;
flex-wrap: wrap;
padding: 4px 16px;
border-top: 1px solid var(--border);
border-radius: 0 0 8px 8px;
background: var(--ed-bar);
font-size: 0.85rem;
color: var(--muted);
}
.ed-status-left, .ed-status-right { display: flex; align-items: baseline; gap: 18px; }
.ed-timer-slot { position: relative; }
.ed-timer-slot #timer-display { font-size: 1.25rem; white-space: nowrap; }
.ed-timer-slot #timer-display.ending { font-size: 1.3rem; letter-spacing: 4px; }
.ed-progress { font-variant-numeric: tabular-nums; white-space: pre; }
.ed-course { color: var(--course, var(--muted)); font-weight: bold; letter-spacing: 1px; }
/* 知らせは、タイマーのすぐ上に左端をそろえて出す */
.ed-timer-slot .toast { --toast-x: 0; left: -6px; bottom: calc(100% + 12px); }
body.system-halt .ed-status { color: var(--error-red); }
/* --- 一時停止 --- */
#pause-overlay {
position: absolute;
inset: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 6px;
background: #0d1117; /* 問題文が透けて読めないよう、完全に隠す */
border: 1px dashed var(--border);
border-radius: 8px;
}
.pause-title { font-size: 2.2rem; letter-spacing: 6px; color: var(--gold); animation: blink 1.4s infinite; }
.pause-sub { margin: 0 0 18px; font-size: 0.85rem; color: var(--muted); }
.pause-actions { display: flex; flex-direction: column; gap: 10px; width: min(320px, 90%); }
.pause-actions .btn-ghost { justify-content: space-between; color: var(--text); padding: 11px 16px; }
/* --- 結果画面 --- */
.result-title { font-size: 1.1rem; color: #aaa; letter-spacing: 3px; }
.result-context { margin-top: 4px; font-size: 0.8rem; color: var(--muted); }
.result-score { margin-top: 6px; font-size: 3rem; font-weight: bold; color: var(--gold); }
.result-best { min-height: 1.4em; font-size: 0.95rem; font-weight: bold; color: #ff5cf4; }
.result-best.new { animation: blink 1s 3; }
.result-stats {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 10px;
width: min(520px, 100%);
margin: 18px auto;
}
.stat { padding: 12px 8px; border: 1px solid var(--border); border-radius: 8px; background: #0d1117; }
.stat-value { font-size: 1.5rem; color: #fff; font-variant-numeric: tabular-nums; }
.stat-label { margin-top: 2px; font-size: 0.7rem; color: var(--muted); letter-spacing: 2px; }
.result-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.result-actions .btn-gradient { min-width: 190px; }
.result-actions .btn-gradient kbd { background: rgba(0, 0, 0, 0.35); border-color: rgba(255, 255, 255, 0.4); color: #fff; }
.btn-secondary { background-image: none; background-color: #21262d; }
.result-links {
display: flex;
align-items: center;
justify-content: center;
gap: 10px;
flex-wrap: wrap;
margin-top: 22px;
padding-top: 18px;
border-top: 1px solid var(--border);
}
/* 振り返り */
.review { margin-top: 22px; text-align: left; }
.review-title { margin-bottom: 8px; font-size: 0.75rem; letter-spacing: 3px; color: var(--muted); text-align: center; }
.review-list {
max-height: 260px;
margin: 0;
padding: 0;
overflow-y: auto;
list-style: none;
border: 1px solid var(--border);
border-radius: 8px;
background: #0d1117;
}
.review-list li { padding: 9px 14px; border-left: 3px solid var(--course); }
.review-list li + li { border-top: 1px solid #21262d; }
.review-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.review-head .course-tag { flex: 0 0 76px; }
.review-head code { font-family: inherit; font-size: 0.9rem; color: var(--course); overflow-wrap: anywhere; }
.review-flag { font-size: 0.7rem; color: var(--muted); }
.review-flag.miss { color: var(--error-red); }
.review-note { margin: 3px 0 0 86px; font-size: 0.8rem; color: var(--text); }
/* X でシェアするボタン */
.share-x {
display: inline-flex;
align-items: center;
gap: 10px;
padding: 10px 22px 10px 18px;
border: 1px solid #536471;
border-radius: 9999px;
background: #000;
color: #fff;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', sans-serif;
font-size: 0.95rem;
font-weight: 700;
text-decoration: none;
transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.share-x svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
.share-x:hover {
background: #fff;
color: #000;
border-color: #fff;
transform: translateY(-2px);
box-shadow: 0 6px 18px rgba(255, 255, 255, 0.18);
}
.share-x:active { transform: translateY(0); }
/* --- HOW TO PLAY ページ --- */
.doc-page { align-items: flex-start; }
.howto { text-align: left; font-size: 0.9rem; line-height: 1.8; }
.howto section { margin-top: 28px; }
.howto h2 { margin: 0 0 10px; font-size: 0.85rem; font-weight: normal; letter-spacing: 2px; color: var(--accent-blue); }
.howto h3 { margin: 18px 0 6px; font-size: 0.85rem; font-weight: normal; color: var(--text); }
.howto p { margin: 8px 0; }
.howto ol, .howto ul { margin: 0; padding-left: 1.6em; }
.howto li { margin: 4px 0; }
.howto table { width: 100%; margin: 8px 0; border-collapse: collapse; }
.howto th, .howto td { padding: 7px 10px; border: 1px solid var(--border); vertical-align: top; }
.howto th { background: #0d1117; font-size: 0.75rem; font-weight: normal; letter-spacing: 1px; color: var(--muted); text-align: left; }
.howto code { padding: 1px 5px; border-radius: 4px; background: #0d1117; font-family: inherit; color: var(--accent-cyan); }
.howto .course-tag { font-size: 0.8rem; font-weight: bold; }
.howto-back { margin-top: 32px; text-align: center; }
.howto-back .btn-gradient { text-decoration: none; }
/* --- 背景(theme.js が body の data-bg を切り替える) --- */
/* 模様は .bg-layer に描く。MARATHON と SUDDEN DEATH では、theme.js が区切りごとに下の変数を変えて、
ワープしたように次の見た目へ移す。模様は画面の中央を基準に拡大・縮小する。
--scale : 模様の細かさ --hue : 色相の回転 --glow : 明るさ */
.bg-layer, .bg-canvas {
position: fixed;
inset: 0;
width: 100%;
height: 100%;
z-index: -1;
pointer-events: none;
}
.bg-layer {
--scale: 1;
--hue: 0deg;
--glow: 1;
filter: hue-rotate(var(--hue)) brightness(var(--glow));
}
/* GRID: サイバー調の方眼 */
body[data-bg="grid"] .bg-layer {
background-image:
radial-gradient(ellipse at 50% -10%, rgba(88, 166, 255, 0.22), transparent 60%),
radial-gradient(ellipse at 50% 110%, rgba(147, 125, 247, 0.18), transparent 55%),
linear-gradient(rgba(88, 166, 255, 0.11) 1px, transparent 1px),
linear-gradient(90deg, rgba(88, 166, 255, 0.11) 1px, transparent 1px);
background-size: 100% 100%, 100% 100%, calc(44px * var(--scale)) calc(44px * var(--scale)), calc(44px * var(--scale)) calc(44px * var(--scale));
background-position: 0 0, 0 0, center, center;
}
/* CIRCUIT: 基板調の配線とランド */
body[data-bg="circuit"] { background-color: #06120e; }
body[data-bg="circuit"] .bg-layer {
background-image:
radial-gradient(ellipse at 50% 50%, transparent 35%, rgba(3, 8, 6, 0.85) 100%),
url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cg fill='none' stroke='%2324a36b' stroke-opacity='.5' stroke-width='1.5'%3E%3Cpath d='M0 50h60l20 20h50l20-20h50'/%3E%3Cpath d='M50 0v30l20 20v60l-20 20v70'/%3E%3Cpath d='M0 150h40l20 20h60l20-20h60'/%3E%3Cpath d='M150 0v50M150 80v40l-20 20v60'/%3E%3Cpath d='M100 0v20l20 20M100 200v-20l-20-20v-40'/%3E%3Cpath d='M0 100h20M180 100h20'/%3E%3C/g%3E%3Cg fill='%2339ff14' fill-opacity='.55'%3E%3Ccircle cx='60' cy='50' r='3.5'/%3E%3Ccircle cx='150' cy='50' r='3.5'/%3E%3Ccircle cx='150' cy='80' r='3.5'/%3E%3Ccircle cx='50' cy='130' r='3.5'/%3E%3Ccircle cx='120' cy='40' r='3.5'/%3E%3Ccircle cx='80' cy='120' r='3.5'/%3E%3Ccircle cx='20' cy='100' r='3.5'/%3E%3Ccircle cx='180' cy='100' r='3.5'/%3E%3Ccircle cx='40' cy='150' r='3.5'/%3E%3C/g%3E%3Cg fill='none' stroke='%2324a36b' stroke-opacity='.45'%3E%3Crect x='92' y='84' width='36' height='24' rx='2'/%3E%3C/g%3E%3C/svg%3E");
background-size: 100% 100%, calc(200px * var(--scale)) calc(200px * var(--scale));
background-position: 0 0, center;
}
/* CRT: ブラウン管の走査線 */
body[data-bg="crt"] { background-color: #050a08; }
body[data-bg="crt"] .bg-layer {
background-image:
radial-gradient(ellipse at 50% 50%, rgba(0, 255, 204, 0.10), transparent 70%),
repeating-linear-gradient(0deg, rgba(0, 255, 204, 0.07) 0, rgba(0, 255, 204, 0.07) 1px, transparent 1px, transparent 4px);
background-size: 100% 100%, 100% calc(4px * var(--scale));
background-position: 0 0, center;
}
/* --- 警告と、システムが止まる演出(script.js が body のクラスを切り替える) --- */
/* 画面の縁を染める層。背景より手前、ゲームの枠より奥に置く */
body::after {
content: '';
position: fixed;
inset: 0;
z-index: -1;
pointer-events: none;
opacity: 0;
}
/* 持ち時間が残り少ない: 縁が橙に脈打ち、タイマーの色が変わり、背景がゆっくり鼓動する */
body.danger::after {
background: radial-gradient(ellipse at center, transparent 45%, rgba(255, 140, 0, 0.55) 100%);
animation: alert-pulse 1s ease-in-out infinite;
}
body.danger #game-container { border-color: #ff9f1a; animation: alert-border 1s ease-in-out infinite; }
body.danger #timer-display:not(.bonus):not(.penalty):not(.ending) { color: #ffb347; font-weight: bold; }
body.danger .bg-layer { animation: bg-throb 1s ease-in-out infinite; }
/* さらに少ない: 赤くなり、速く脈打ち、タイマーが点滅し、背景が小刻みに揺れる */
body.critical::after {
background: radial-gradient(ellipse at center, transparent 35%, rgba(255, 30, 30, 0.7) 100%);
animation-duration: 0.45s;
}
body.critical #game-container { border-color: var(--error-red); animation-duration: 0.45s; --alert-color: rgba(255, 68, 68, 0.75); }
body.critical #timer-display:not(.bonus):not(.penalty):not(.ending) {
color: var(--error-red);
text-shadow: 0 0 14px rgba(255, 68, 68, 0.8);
animation: blink 0.45s steps(2, start) infinite;
}
body.critical .bg-layer { animation: bg-quake 0.3s linear infinite; }
@keyframes alert-pulse { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
@keyframes alert-border {
0%, 100% { box-shadow: 0 0 40px rgba(0, 0, 0, 0.8); }
50% { box-shadow: 0 0 34px var(--alert-color, rgba(255, 159, 26, 0.7)); }
}
@keyframes bg-throb { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@keyframes bg-quake {
0% { transform: translate(0, 0) scale(1.03); }
25% { transform: translate(-5px, 3px) scale(1.05); }
50% { transform: translate(4px, -4px) scale(1.03); }
75% { transform: translate(-3px, -2px) scale(1.06); }
100% { transform: translate(0, 0) scale(1.03); }
}
/* 時間切れ・ミスの上限: 画面が赤く明滅して、システムが止まる */
body.system-halt::after {
background:
repeating-linear-gradient(0deg, rgba(255, 0, 0, 0.16) 0, rgba(255, 0, 0, 0.16) 2px, transparent 2px, transparent 5px),
radial-gradient(ellipse at center, rgba(120, 0, 0, 0.35) 0%, rgba(255, 0, 0, 0.75) 100%);
animation: halt-flash 1.2s steps(1, end) forwards;
}
body.system-halt .bg-layer,
body.system-down .bg-layer {
/* 模様の色を落として、暗い赤に沈める */
filter: grayscale(1) sepia(1) hue-rotate(-50deg) saturate(5) brightness(0.55);
}
body.system-halt .bg-canvas { opacity: 0; }
body.system-halt #game-container {
border-color: #ff2222;
box-shadow: 0 0 60px rgba(255, 0, 0, 0.75);
animation: halt-glitch 0.5s steps(1, end) 2;
}
body.system-halt #word-display,
body.system-halt #ed-code { animation: halt-fade 1s ease-out forwards; }
body.system-halt #game-info { color: var(--error-red); }
/* 結果画面: 止まったあとの、赤く沈んだ状態 */
body.system-down::after {
background: radial-gradient(ellipse at center, transparent 40%, rgba(160, 0, 0, 0.5) 100%);
opacity: 1;
}
body.system-down #game-container { border-color: #8b1a1a; box-shadow: 0 0 40px rgba(180, 0, 0, 0.45); }
@keyframes halt-flash {
0% { opacity: 1; }
8% { opacity: 0.15; }
16% { opacity: 0.95; }
26% { opacity: 0.3; }
38% { opacity: 1; }
50% { opacity: 0.45; }
62% { opacity: 0.9; }
100% { opacity: 0.7; }
}
@keyframes halt-glitch {
0% { transform: translate(0, 0) skewX(0); }
15% { transform: translate(-7px, 2px) skewX(-2deg); }
30% { transform: translate(6px, -2px) skewX(1.5deg); }
45% { transform: translate(-3px, 1px) skewX(0); }
60% { transform: translate(4px, 0) skewX(-1deg); }
80% { transform: translate(-1px, 0) skewX(0); }
100% { transform: translate(0, 0) skewX(0); }
}
@keyframes halt-fade {
0% { opacity: 1; filter: none; }
30% { opacity: 0.5; filter: blur(1px) saturate(0); }
100% { opacity: 0.25; filter: saturate(0); }
}
.bg-btn {
margin-right: auto;
padding: 2px 8px;
border: 1px solid var(--border);
border-radius: 4px;
background: transparent;
color: #6e7681;
font-family: inherit;
font-size: 0.7rem;
letter-spacing: 1px;
cursor: pointer;
}
.bg-btn:hover { color: var(--accent-blue); border-color: var(--accent-blue); }
/* --- フッター --- */
#app-footer {
display: flex;
align-items: center;
justify-content: flex-end;
gap: 14px;
margin-top: 14px;
font-size: 0.72rem;
color: #6e7681;
}
#app-footer a { color: #6e7681; }
#app-footer a:hover { color: var(--accent-blue); }
@media (max-width: 720px) {
#game-container { padding: 24px 16px 16px; }
h1 { font-size: 1.8rem; letter-spacing: 4px; }
.portal-link, .howto-link { position: static; margin: 0 2px 12px; }
.howto table { font-size: 0.8rem; }
.lang-group { flex-direction: column; gap: 4px; }
.group-label { flex: none; text-align: left; }
.key-hint { display: none; }
.custom-panel { grid-template-columns: 1fr; }
.review-note { margin-left: 0; }
.editor { --ed-size: 14px; }
.ed-row { grid-template-columns: 3ch minmax(0, 1fr); column-gap: 10px; }
.ed-tab { padding: 0 10px; }
.ed-status, .ed-panel { padding-left: 10px; padding-right: 10px; }
.ed-status-left, .ed-status-right { gap: 12px; }
.ed-timer-slot #timer-display { font-size: 1.05rem; }
.ed-timer-slot .toast { font-size: 0.85rem; padding: 6px 14px; }
}
@media (prefers-reduced-motion: reduce) {
* { animation: none !important; transition: none !important; }
.toast.show { opacity: 1; } /* 動きを出さない設定でも、知らせは見えるようにする */
}