reqct-gamehub-module 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,534 @@
1
+ /* SnakeGame.css - Исправленный дизайн с центрированием */
2
+
3
+ .snake-game {
4
+ width: 100%;
5
+ height: 100%;
6
+ display: flex;
7
+ flex-direction: column;
8
+ background: white;
9
+ color: #333;
10
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
11
+ overflow: hidden;
12
+ }
13
+
14
+ .game-header {
15
+ display: flex;
16
+ justify-content: space-between;
17
+ align-items: center;
18
+ padding: 12px 16px;
19
+ border-bottom: 1px solid #e1e5e9;
20
+ flex-shrink: 0;
21
+ }
22
+
23
+ .game-header h2 {
24
+ margin: 0;
25
+ font-size: 18px;
26
+ color: #333;
27
+ font-weight: 600;
28
+ }
29
+
30
+ .game-controls {
31
+ display: flex;
32
+ gap: 8px;
33
+ }
34
+
35
+ .control-btn {
36
+ padding: 6px 12px;
37
+ border: none;
38
+ border-radius: 6px;
39
+ font-size: 11px;
40
+ font-weight: 600;
41
+ cursor: pointer;
42
+ transition: all 0.2s;
43
+ display: flex;
44
+ align-items: center;
45
+ gap: 4px;
46
+ text-transform: uppercase;
47
+ letter-spacing: 0.5px;
48
+ }
49
+
50
+ .start-btn {
51
+ background: linear-gradient(45deg, #00b09b, #96c93d);
52
+ color: white;
53
+ }
54
+
55
+ .pause-btn {
56
+ background: linear-gradient(45deg, #ff9966, #ff5e62);
57
+ color: white;
58
+ }
59
+
60
+ .game-stats {
61
+ display: grid;
62
+ grid-template-columns: repeat(4, 1fr);
63
+ gap: 8px;
64
+ padding: 12px 16px;
65
+ border-bottom: 1px solid #e1e5e9;
66
+ flex-shrink: 0;
67
+ }
68
+
69
+ .stat-box {
70
+ background: #f8f9fa;
71
+ border-radius: 8px;
72
+ padding: 8px;
73
+ text-align: center;
74
+ border: 1px solid #e1e5e9;
75
+ }
76
+
77
+ .stat-label {
78
+ font-size: 10px;
79
+ color: #666;
80
+ margin-bottom: 4px;
81
+ text-transform: uppercase;
82
+ letter-spacing: 0.5px;
83
+ }
84
+
85
+ .stat-value {
86
+ font-size: 16px;
87
+ font-weight: 700;
88
+ color: #667eea;
89
+ }
90
+
91
+ /* ИСПРАВЛЕННЫЙ КОНТЕЙНЕР - теперь всё по центру */
92
+ .game-board-container {
93
+ flex: 1;
94
+ display: flex;
95
+ align-items: center;
96
+ justify-content: center;
97
+ padding: 10px;
98
+ min-height: 0;
99
+ position: relative;
100
+ overflow: hidden;
101
+ }
102
+
103
+ .start-screen {
104
+ width: 100%;
105
+ max-width: 320px;
106
+ background: white;
107
+ border-radius: 12px;
108
+ padding: 20px;
109
+ text-align: center;
110
+ }
111
+
112
+ .instructions h3 {
113
+ color: #667eea;
114
+ margin-bottom: 12px;
115
+ font-size: 16px;
116
+ font-weight: 600;
117
+ }
118
+
119
+ .instructions ul {
120
+ list-style: none;
121
+ padding: 0;
122
+ margin-bottom: 20px;
123
+ text-align: left;
124
+ }
125
+
126
+ .instructions li {
127
+ padding: 6px 0;
128
+ font-size: 12px;
129
+ color: #666;
130
+ display: flex;
131
+ align-items: center;
132
+ gap: 8px;
133
+ }
134
+
135
+ .start-instruction-btn {
136
+ width: 100%;
137
+ padding: 10px;
138
+ background: linear-gradient(45deg, #667eea, #764ba2);
139
+ color: white;
140
+ border: none;
141
+ border-radius: 8px;
142
+ font-size: 13px;
143
+ font-weight: 600;
144
+ cursor: pointer;
145
+ transition: all 0.2s;
146
+ text-transform: uppercase;
147
+ letter-spacing: 1px;
148
+ }
149
+
150
+ .start-instruction-btn:hover {
151
+ transform: translateY(-1px);
152
+ box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
153
+ }
154
+
155
+ .paused-screen {
156
+ position: absolute;
157
+ top: 0;
158
+ left: 0;
159
+ right: 0;
160
+ bottom: 0;
161
+ background: rgba(255, 255, 255, 0.95);
162
+ display: flex;
163
+ flex-direction: column;
164
+ align-items: center;
165
+ justify-content: center;
166
+ z-index: 10;
167
+ }
168
+
169
+ .paused-screen h3 {
170
+ font-size: 18px;
171
+ color: #667eea;
172
+ margin-bottom: 8px;
173
+ font-weight: 600;
174
+ }
175
+
176
+ .paused-screen p {
177
+ color: #666;
178
+ font-size: 12px;
179
+ }
180
+
181
+ /* ИСПРАВЛЕННОЕ ИГРОВОЕ ПОЛЕ - теперь точно по центру */
182
+ .game-board {
183
+ display: block;
184
+ border: 2px solid #e1e5e9;
185
+ border-radius: 6px;
186
+ background: white;
187
+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
188
+ position: relative;
189
+ margin: 0 auto; /* Центрирование */
190
+ }
191
+
192
+ .grid-row {
193
+ display: flex;
194
+ }
195
+
196
+ .grid-cell {
197
+ width: 20px;
198
+ height: 20px;
199
+ border: 1px solid #f0f0f0;
200
+ position: relative;
201
+ }
202
+
203
+ .grid-cell.snake-head {
204
+ background: linear-gradient(45deg, #00b09b, #96c93d);
205
+ border-radius: 50%;
206
+ }
207
+
208
+ .grid-cell.snake-body {
209
+ background: linear-gradient(45deg, #4cc9f0, #4361ee);
210
+ border-radius: 3px;
211
+ }
212
+
213
+ .grid-cell.food {
214
+ background: linear-gradient(45deg, #ff5e62, #ff9966);
215
+ border-radius: 50%;
216
+ animation: pulse 1s infinite;
217
+ }
218
+
219
+ @keyframes pulse {
220
+ 0%, 100% { transform: scale(1); opacity: 1; }
221
+ 50% { transform: scale(1.1); opacity: 0.9; }
222
+ }
223
+
224
+ .game-over-overlay {
225
+ position: absolute;
226
+ top: 0;
227
+ left: 0;
228
+ right: 0;
229
+ bottom: 0;
230
+ background: rgba(255, 255, 255, 0.98);
231
+ display: flex;
232
+ align-items: center;
233
+ justify-content: center;
234
+ z-index: 10;
235
+ }
236
+
237
+ .game-over-content {
238
+ background: white;
239
+ padding: 20px;
240
+ border-radius: 12px;
241
+ text-align: center;
242
+ border: 2px solid #e1e5e9;
243
+ box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
244
+ max-width: 280px;
245
+ width: 90%;
246
+ }
247
+
248
+ .game-over-content h3 {
249
+ font-size: 16px;
250
+ color: #ff5e62;
251
+ margin-bottom: 12px;
252
+ font-weight: 600;
253
+ }
254
+
255
+ .final-stats {
256
+ background: #f8f9fa;
257
+ padding: 12px;
258
+ border-radius: 8px;
259
+ margin: 12px 0;
260
+ border: 1px solid #e1e5e9;
261
+ }
262
+
263
+ .final-stats p {
264
+ margin: 6px 0;
265
+ font-size: 12px;
266
+ color: #666;
267
+ display: flex;
268
+ justify-content: space-between;
269
+ }
270
+
271
+ .final-stats strong {
272
+ color: #667eea;
273
+ font-size: 14px;
274
+ }
275
+
276
+ .play-again-btn {
277
+ background: linear-gradient(45deg, #667eea, #764ba2);
278
+ color: white;
279
+ border: none;
280
+ padding: 10px 20px;
281
+ border-radius: 8px;
282
+ font-size: 12px;
283
+ font-weight: 600;
284
+ cursor: pointer;
285
+ transition: all 0.2s;
286
+ display: flex;
287
+ align-items: center;
288
+ gap: 6px;
289
+ margin: 0 auto;
290
+ text-transform: uppercase;
291
+ letter-spacing: 0.5px;
292
+ }
293
+
294
+ .play-again-btn:hover {
295
+ transform: translateY(-1px);
296
+ box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
297
+ }
298
+
299
+ .mobile-controls {
300
+ display: none;
301
+ flex-direction: column;
302
+ align-items: center;
303
+ padding: 10px;
304
+ gap: 4px;
305
+ flex-shrink: 0;
306
+ border-top: 1px solid #e1e5e9;
307
+ }
308
+
309
+ .horizontal-controls {
310
+ display: flex;
311
+ gap: 30px;
312
+ align-items: center;
313
+ }
314
+
315
+ .mobile-btn {
316
+ width: 40px;
317
+ height: 40px;
318
+ border: none;
319
+ border-radius: 8px;
320
+ background: #667eea;
321
+ color: white;
322
+ font-size: 16px;
323
+ font-weight: bold;
324
+ cursor: pointer;
325
+ transition: all 0.2s;
326
+ display: flex;
327
+ align-items: center;
328
+ justify-content: center;
329
+ }
330
+
331
+ .mobile-btn:active {
332
+ transform: scale(0.95);
333
+ background: #764ba2;
334
+ }
335
+
336
+ .center-space {
337
+ width: 40px;
338
+ }
339
+
340
+ .game-instructions {
341
+ padding: 12px 16px;
342
+ border-top: 1px solid #e1e5e9;
343
+ display: flex;
344
+ flex-wrap: wrap;
345
+ gap: 12px;
346
+ flex-shrink: 0;
347
+ font-size: 11px;
348
+ color: #666;
349
+ }
350
+
351
+ .game-instructions p {
352
+ margin: 2px 0;
353
+ }
354
+
355
+ .game-instructions strong {
356
+ color: #333;
357
+ }
358
+
359
+ .legend {
360
+ display: flex;
361
+ gap: 12px;
362
+ align-items: center;
363
+ }
364
+
365
+ .legend-item {
366
+ display: flex;
367
+ align-items: center;
368
+ gap: 6px;
369
+ }
370
+
371
+ .legend-color {
372
+ width: 12px;
373
+ height: 12px;
374
+ border-radius: 2px;
375
+ }
376
+
377
+ .legend-color.snake-head {
378
+ background: linear-gradient(45deg, #00b09b, #96c93d);
379
+ }
380
+
381
+ .legend-color.snake-body {
382
+ background: linear-gradient(45deg, #4cc9f0, #4361ee);
383
+ }
384
+
385
+ .legend-color.food {
386
+ background: linear-gradient(45deg, #ff5e62, #ff9966);
387
+ }
388
+
389
+ @media (max-width: 768px) {
390
+ .game-stats {
391
+ grid-template-columns: repeat(2, 1fr);
392
+ }
393
+
394
+ .mobile-controls {
395
+ display: flex;
396
+ }
397
+
398
+ .game-instructions {
399
+ flex-direction: column;
400
+ gap: 8px;
401
+ }
402
+
403
+ .legend {
404
+ justify-content: center;
405
+ }
406
+
407
+ .grid-cell {
408
+ width: 18px;
409
+ height: 18px;
410
+ }
411
+ }
412
+
413
+ @media (max-width: 480px) {
414
+ .grid-cell {
415
+ width: 16px;
416
+ height: 16px;
417
+ }
418
+ }
419
+ /* Стили для выбора сложности */
420
+ .difficulty-selector {
421
+ padding: 8px 16px;
422
+ border-bottom: 1px solid #e1e5e9;
423
+ display: flex;
424
+ align-items: center;
425
+ gap: 12px;
426
+ flex-shrink: 0;
427
+ background: #f8f9fa;
428
+ }
429
+
430
+ .difficulty-label {
431
+ font-size: 11px;
432
+ color: #666;
433
+ font-weight: 600;
434
+ }
435
+
436
+ .difficulty-btn {
437
+ padding: 6px 12px;
438
+ background: #f8f9fa;
439
+ border: 1px solid #e1e5e9;
440
+ border-radius: 6px;
441
+ font-size: 10px;
442
+ color: #666;
443
+ cursor: pointer;
444
+ transition: all 0.2s;
445
+ text-transform: uppercase;
446
+ letter-spacing: 0.5px;
447
+ }
448
+
449
+ .difficulty-btn.active {
450
+ color: white;
451
+ border-color: transparent;
452
+ }
453
+
454
+ .difficulty-btn:hover:not(.active) {
455
+ background: #e1e5e9;
456
+ }
457
+
458
+ .difficulty-info {
459
+ display: grid;
460
+ grid-template-columns: repeat(3, 1fr);
461
+ gap: 8px;
462
+ padding: 8px 16px;
463
+ border-bottom: 1px solid #e1e5e9;
464
+ background: white;
465
+ flex-shrink: 0;
466
+ }
467
+
468
+ .info-item {
469
+ text-align: center;
470
+ font-size: 11px;
471
+ }
472
+
473
+ .info-item span {
474
+ display: block;
475
+ color: #666;
476
+ margin-bottom: 2px;
477
+ }
478
+
479
+ .info-item strong {
480
+ color: #667eea;
481
+ font-weight: 600;
482
+ }
483
+
484
+ /* Исправленное игровое поле с CSS Grid */
485
+ .game-board {
486
+ display: grid;
487
+ border: 2px solid #e1e5e9;
488
+ border-radius: 6px;
489
+ background: white;
490
+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
491
+ position: relative;
492
+ margin: 0 auto;
493
+ max-width: 400px;
494
+ max-height: 400px;
495
+ }
496
+
497
+ .grid-cell {
498
+ border: 1px solid #f0f0f0;
499
+ position: relative;
500
+ box-sizing: border-box;
501
+ }
502
+
503
+ /* Адаптивность */
504
+ @media (max-width: 768px) {
505
+ .difficulty-selector {
506
+ flex-wrap: wrap;
507
+ justify-content: center;
508
+ }
509
+
510
+ .difficulty-info {
511
+ grid-template-columns: repeat(3, 1fr);
512
+ }
513
+
514
+ .game-board {
515
+ max-width: 350px;
516
+ max-height: 350px;
517
+ }
518
+ }
519
+
520
+ @media (max-width: 480px) {
521
+ .game-board {
522
+ max-width: 300px;
523
+ max-height: 300px;
524
+ }
525
+
526
+ .difficulty-btn {
527
+ padding: 4px 8px;
528
+ font-size: 9px;
529
+ }
530
+
531
+ .info-item {
532
+ font-size: 10px;
533
+ }
534
+ }