File size: 24,635 Bytes
78738de
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
/* PoolCoach FE — 23/07/2026, polish mobile-first 23/07 tối.
   Không framework, không build step. */

:root {
  --bg: #14181d;
  --card: #1e242b;
  --card-b: #2d3640;
  --text: #e9edf1;
  --muted: #93a0ac;
  --green: #0da357;
  --green-d: #0b8a4b;
  --gold: #ffd700;
  --zone: #38c8f5;   /* vùng đích cue_zone của drill (F3) — KHÁC gold lỗ đích */
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: system-ui, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(1200px 600px at 20% -10%, #1d242c 0%, var(--bg) 55%);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

header { padding: 16px 18px 6px; }
header h1 { margin: 0; font-size: 22px; letter-spacing: .3px; }
header p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

main {
  display: flex;
  gap: 20px;
  padding: 12px 18px 26px;
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: center;
}

/* ------------------------------------------------------------- bàn */
#table-wrap { position: relative; flex: 0 0 auto; }

#table {
  display: block;
  border-radius: 16px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, .5);
  cursor: grab;
  touch-action: none;      /* kéo bi không cuộn trang trên mobile */
  user-select: none;
}
#table.dragging { cursor: grabbing; }

#tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(0, 0, 0, .85);
  color: #fff;
  font: 12px/1.4 ui-monospace, Consolas, monospace;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 5;
}

/* ----------------------------------------------------------- panel */
#panel { flex: 1 1 320px; min-width: 300px; max-width: 440px; }

.banner {
  background: #453d10;
  border: 1px solid #8a7418;
  color: #ffe58f;
  padding: 10px 13px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 12px;
}
.banner.error { background: #4a1d1d; border-color: #a33; color: #ffb3b3; }
.banner.warn  { background: #4a3a10; border-color: #b8901f; color: #ffdf9e; }
.banner.win {
  background: #12321f;
  border-color: var(--green);
  color: #9df2c0;
  font-size: 15px;
  font-weight: 650;
  text-align: center;
}

.controls, #describe, .alt {
  background: var(--card);
  border: 1px solid var(--card-b);
  border-radius: 14px;
}

.controls { padding: 14px 15px; }
.controls .row { margin-bottom: 12px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.controls .lbl { color: var(--muted); font-size: 12px; min-width: 48px; }

/* engine: 2 pill bấm được */
.radio { font-size: 14px; cursor: pointer; }
.radio input { accent-color: var(--green); }
.radio small { color: var(--muted); }

.pill {
  position: relative;
  padding: 8px 13px;
  border: 1px solid var(--card-b);
  border-radius: 999px;
  background: #171c22;
  transition: border-color .15s, background .15s;
}
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill:has(input:checked) {
  border-color: var(--green);
  background: #12281c;
}
.pill:has(input:disabled) { opacity: .45; cursor: not-allowed; }

/* .an-cta = nút CTA không-recommend: TRÔNG như .btn-go nhưng là class
   riêng — app.js bind recommend cho mọi .btn-go và syncButtons ép label/
   disabled của chúng; nút nào mượn class đó là dính cả hai (bug Danh
   bắt được ở smoke BG25 — đúng bài học .btn-play 04/08). Dùng cho 2 nút
   Analyzer (BG25) + #scan-go của overlay Quét thế bi (BG26). */
.btn-go, .an-cta {
  width: 100%;
  padding: 13px;
  font-size: 15px;
  font-weight: 650;
  color: #fff;
  background: linear-gradient(180deg, var(--green), var(--green-d));
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(13, 163, 87, .25);
  transition: filter .15s, transform .05s;
}
.btn-go:hover:not(:disabled), .an-cta:hover:not(:disabled) { filter: brightness(1.08); }
.btn-go:active:not(:disabled), .an-cta:active:not(:disabled) { transform: translateY(1px); }
.btn-go:disabled, .an-cta:disabled {
  background: #333c45;
  color: #8a949d;
  cursor: not-allowed;
  box-shadow: none;
}

/* ------------------------------------------- chip bi 1-9 + badge mục tiêu */
#ball-chips { gap: 6px; }

.chip {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, .55);
  background: #2a323b;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  transition: transform .08s, opacity .15s;
}
.chip:hover:not(:disabled) { transform: translateY(-1px); }
.chip.off {
  background: #2a323b !important;
  color: #6d7883 !important;
  border-color: #3a434d;
  text-decoration: line-through;
}
.chip:disabled { opacity: .5; cursor: not-allowed; }

/* badge phiên bàn (QR — bàn giao 12). Class riêng, không mượn class có
   event binding toàn cục (bug .btn-play 04/08). Nằm trong header h1 nên
   cần font-size/vertical-align riêng để không phóng theo cỡ chữ tiêu đề. */
.session-badge {
  display: inline-block;
  background: #12281c;
  border: 1px solid var(--green);
  color: #9df2c0;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12.5px;
  font-weight: 650;
  vertical-align: 3px;
  white-space: nowrap;
}

.target-badge {
  background: #3a3410;
  border: 1px solid var(--gold);
  color: var(--gold);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
}

/* ---------------------------------------- nút phụ: Bàn mẫu / Undo / Auto */
.btn-row { display: flex; gap: 8px; margin-bottom: 12px; }

.btn-mini {
  flex: 1;
  padding: 9px 12px;
  font-size: 13px;
  color: var(--text);
  background: #232a32;
  border: 1px solid var(--card-b);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.btn-mini:hover:not(:disabled) { border-color: #55636f; background: #283039; }
.btn-mini:disabled { opacity: .45; cursor: not-allowed; }

/* form Ghép TV (bàn giao 15) — class riêng, không mượn class có binding */
.tv-pair { display: flex; gap: 8px; margin-bottom: 10px; }
.tv-pair input {
  flex: 2;
  min-width: 0;
  padding: 9px 12px;
  font-size: 15px;
  letter-spacing: 3px;
  color: var(--text);
  background: #171c22;
  border: 1px solid var(--card-b);
  border-radius: 10px;
}
.tv-pair button {
  flex: 1;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 650;
  color: #fff;
  background: linear-gradient(180deg, var(--green), var(--green-d));
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}

/* .btn-pass = nút "Đạt" của drill: TRÔNG như .btn-play nhưng là class riêng —
   app.js bind playShot cho mọi .btn-play, drill không được dính binding đó. */
.btn-play, .btn-pass {
  flex: 2;
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 650;
  color: #fff;
  background: linear-gradient(180deg, #1cb35f, #14904c);
  border: 0;
  border-radius: 11px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(28, 179, 95, .22);
  transition: filter .15s, transform .05s;
}
.btn-play:hover:not(:disabled), .btn-pass:hover:not(:disabled) { filter: brightness(1.08); }
.btn-play:active:not(:disabled), .btn-pass:active:not(:disabled) { transform: translateY(1px); }
.btn-play:disabled, .btn-pass:disabled {
  background: #333c45;
  color: #8a949d;
  cursor: not-allowed;
  box-shadow: none;
}
.btn-pass { flex: 1; }
.play-row { margin-bottom: 10px; }
.btn-auto { width: 100%; margin-top: 8px; }

/* ---------------------------------------------------------- kết quả */
#result { margin-top: 14px; }

/* viz: bi cái + thanh lực */
.viz {
  display: flex;
  gap: 18px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--card-b);
  border-radius: 14px;
  padding: 13px 15px;
  margin-bottom: 10px;
}
.viz-spin { flex: 0 0 auto; text-align: center; }
#spin-ball { width: 88px; height: 88px; display: block; margin: 0 auto; }
.spin-dot { transition: cx .25s ease, cy .25s ease; }
.viz-cap { color: var(--muted); font-size: 11.5px; margin-top: 5px; max-width: 120px; }
.viz-power { flex: 1; min-width: 0; }
.viz-lbl { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.viz-lbl b { color: var(--text); font-size: 14px; margin-left: 4px; }
.power-bar { display: flex; gap: 4px; }
.power-bar .seg {
  flex: 1;
  height: 17px;
  border-radius: 4px;
  background: #2a323b;
  transition: background .2s;
}
.viz-scale {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10.5px;
  margin-top: 5px;
}
/* Widget "Đánh lại cú" trang chi tiết (A2b phần 4): nhìn Y HỆT #shotviz
   nhưng class tương tác RIÊNG — .power-bar/.spin-dot bị initPowerBar +
   updateShotViz của tab gợi ý quét toàn cục (bài học .btn-play). */
#and-spin-ball { width: 88px; height: 88px; display: block; margin: 0 auto; }
.and-spin-dot { transition: cx .25s ease, cy .25s ease; }
.and-power-bar { display: flex; gap: 4px; }
.and-power-bar .seg {
  flex: 1;
  height: 17px;
  border-radius: 4px;
  background: #2a323b;
  transition: background .2s;
}
#and-shotviz { margin-top: 10px; }
.and-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 2px;
  font-size: 13px;
  cursor: pointer;
}

#describe {
  background: #12241b;
  border-color: #1f4d34;
  padding: 13px 15px;
  font: 13px/1.6 ui-monospace, Consolas, monospace;
  white-space: pre-wrap;
  margin: 0 0 10px;
}

.alt {
  padding: 11px 13px;
  font-size: 13px;
  margin-bottom: 7px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.alt:hover { border-color: #55636f; }
.alt.active { border-color: var(--gold); background: #2a2a20; }
/* render lười: cú thay thế đang chờ /api/trajectory. Mờ nhẹ thôi — nút vẫn
   bấm được, chờ ở đây KHÔNG chặn UI (xem ensureTrajectories trong app.js). */
.alt.pending { opacity: .62; }

#searchinfo { color: var(--muted); font-size: 12px; margin-top: 7px; }

/* ----------------------------------------------------------- legend */
.legend { margin-top: 14px; color: var(--muted); font-size: 12px; }
.legend span { margin-right: 13px; white-space: nowrap; line-height: 2; }
.dot {
  display: inline-block; width: 11px; height: 11px;
  border-radius: 50%; border: 1px solid #000; vertical-align: -1px;
}
.ring {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid var(--gold); vertical-align: -1px;
}
.ring.target { box-shadow: 0 0 5px var(--gold); }
/* viền "bi scan chưa chắc" (F2, bàn giao 18) — đứt + cam để KHÔNG lẫn với
   nhẫn vàng liền của bi mục tiêu/lỗ đích */
.ring.lowconf { border-style: dashed; border-color: #ffb020; }

/* ----------------------------------------- tab Bài tập (F3, 04/08/2026) */
.tabs { display: flex; gap: 8px; margin-bottom: 12px; }

.tab {
  flex: 1;
  padding: 10px;
  font-size: 14px;
  font-weight: 650;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--card-b);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.tab:hover { border-color: #55636f; }
.tab.active { color: var(--text); border-color: var(--green); background: #12281c; }

/* khu "Tiến bộ" phiên bàn (bàn giao 12) — class riêng, không mượn class
   có event binding toàn cục (bug .btn-play 04/08). */
.drill-progress {
  background: var(--card);
  border: 1px solid var(--card-b);
  border-radius: 14px;
  padding: 11px 14px;
  font-size: 13px;
  margin-bottom: 10px;
}
.drill-progress > b { font-size: 13.5px; }
.drill-progress .progress-row {
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.45;
}

.drill-item b { font-size: 13.5px; }
.drill-item .tag {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #16303a;
  border: 1px solid #29556a;
  color: var(--zone);
  font-size: 11px;
}
.drill-item .drill-reps { float: right; color: var(--muted); font-size: 12px; }

#drill-title { margin: 12px 0 8px; font-size: 16px; }

#drill-goal {
  background: #10242c;
  border: 1px solid #1f4250;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.55;
  margin-bottom: 10px;
}

.drill-round { margin: 4px 0 10px; display: flex; align-items: center; gap: 8px; }
.drill-round b { font-size: 14px; }

.btn-fail {
  flex: 1;
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 650;
  color: #fff;
  background: linear-gradient(180deg, #c04545, #a03434);
  border: 0;
  border-radius: 11px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(192, 69, 69, .22);
  transition: filter .15s, transform .05s;
}
.btn-fail:hover:not(:disabled) { filter: brightness(1.08); }
.btn-fail:active:not(:disabled) { transform: translateY(1px); }
.btn-fail:disabled {
  background: #333c45;
  color: #8a949d;
  cursor: not-allowed;
  box-shadow: none;
}

#drill-summary {
  background: #12321f;
  border: 1px solid var(--green);
  color: #9df2c0;
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 14px;
  font-weight: 650;
  text-align: center;
  margin-bottom: 8px;
}

#drill-retry { width: 100%; margin-bottom: 8px; }

.drill-note {
  color: #ffdf9e;
  font-size: 12px;
  margin: 2px 0 10px;
}

#drill-suggest { margin-top: 4px; }

/* ------------------------------------ Scan ảnh (F2 MVP, bàn giao 18) */
/* Mọi class .scan-* là class MỚI — không mượn class có event binding
   (bài học .btn-play 04/08). Overlay nổi trên tất cả (kể cả sheet mobile
   z-index 20 và backdrop 15) — chấm góc là việc toàn màn hình. */
.scan-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(0, 0, 0, .72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}
.scan-box {
  background: var(--card);
  border: 1px solid var(--card-b);
  border-radius: 16px;
  padding: 13px 15px;
  max-width: min(94vw, 760px);
  max-height: 94vh;
  overflow-y: auto;
  box-shadow: 0 12px 44px rgba(0, 0, 0, .6);
}
.scan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 15px;
}
.scan-x {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #232a32;
  border: 1px solid var(--card-b);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
}
.scan-hint {
  color: #ffdf9e;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 10px;
  min-height: 2.9em;   /* 2 dòng — hint đổi độ dài không làm ảnh nhảy */
}
#scan-canvas {
  display: block;
  max-width: 100%;
  max-height: 62vh;    /* ảnh dọc mobile không đẩy nút ra khỏi màn hình */
  margin: 0 auto;
  border-radius: 10px;
  border: 1px solid var(--card-b);
  cursor: crosshair;
  touch-action: none;  /* chấm góc không cuộn trang trên mobile */
}
.scan-actions { margin-top: 12px; margin-bottom: 0; }
.scan-go { flex: 2; width: auto; padding: 11px; }

/* ---------------------------------- tab Analyzer (bàn giao 24) */
/* Mọi class .an-* là class MỚI (bài học .btn-play); overlay chấm pocket
   mượn các class STYLE-ONLY .scan-overlay/.scan-box — không class nào
   trong đó có event binding. */
.an-intro {
  font-size: 13px;
  color: var(--muted, #9fb0c0);
  line-height: 1.5;
  margin-bottom: 10px;
}
/* BG31: note chuẩn click mép nose vải (tĩnh, trên canvas chấm góc) */
.an-note {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--muted, #9fb0c0);
  line-height: 1.45;
  margin-bottom: 10px;
}
.an-note svg {
  width: 168px;
  flex-shrink: 0;
}
#an-canvas {
  display: block;
  max-width: 100%;
  max-height: 62vh;
  margin: 0 auto;
  border-radius: 10px;
  border: 1px solid var(--card-b);
  cursor: crosshair;
  touch-action: none;
}
.an-metrics {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 8px;
}
.an-metrics td {
  padding: 5px 6px;
  border-bottom: 1px solid var(--card-b);
}
.an-metrics td:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.an-warn {
  background: #4a3a10;
  border: 1px solid #b8901f;
  color: #ffdf9e;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12.5px;
  line-height: 1.45;
  margin-bottom: 6px;
}
.an-note {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted, #9fb0c0);
  line-height: 1.5;
}
/* BG28 — bảng 2 cột model↔analytic: header + ô giá trị giữa (cột model)
   cùng kiểu số với cột cuối; caveat model + dòng bất đồng (thông tin,
   giọng khác .an-warn cảnh báo) */
.an-metrics th {
  padding: 5px 6px;
  border-bottom: 1px solid var(--card-b);
  text-align: left;
  font-size: 12px;
  color: var(--muted, #9fb0c0);
}
.an-metrics th:not(:first-child) { text-align: right; }
.an-metrics td:not(:first-child) {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.an-caveat {
  margin-top: 8px;
  background: #16324a;
  border: 1px solid #2f6da8;
  color: #bcdcf5;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12.5px;
  line-height: 1.45;
}
.an-diff {
  background: #14323e;
  border: 1px solid #2e7f9e;
  color: #a9e0f2;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12.5px;
  line-height: 1.45;
  margin-bottom: 6px;
}

/* --------------------- Analyzer đa cú (lát A1) — bảng danh sách cú §3.1.
   Mọi class .anv-* là class MỚI (bài học .btn-play — không mượn class có
   event binding). Hàng .anv-err = cú không phân tích được: xám + lý do. */
#anv-result { margin-top: 12px; }
.anv-progressline {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}
.anv-tablewrap { overflow-x: auto; }
.anv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  white-space: nowrap;
}
.anv-table th {
  padding: 5px 6px;
  border-bottom: 1px solid var(--card-b);
  text-align: left;
  font-size: 12px;
  color: var(--muted, #9fb0c0);
}
.anv-table td {
  padding: 5px 6px;
  border-bottom: 1px solid var(--card-b);
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}
.anv-thumb {
  display: block;
  width: 72px;
  border-radius: 4px;
  border: 1px solid var(--card-b);
}
.anv-ts {
  font-size: 11.5px;
  color: var(--muted, #9fb0c0);
  text-align: center;
}
.anv-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
}
.anv-badge-high { background: #143f28; border: 1px solid #2e9e56; color: #8fe0ae; }
.anv-badge-medium { background: #4a3a10; border: 1px solid #b8901f; color: #ffdf9e; }
.anv-badge-low { background: #4a1d15; border: 1px solid #b8502f; color: #ffb59e; }
.anv-err td { color: var(--muted, #9fb0c0); background: rgba(255, 255, 255, .025); }
/* van A2 phần 1: cú "nghi không phải cú đánh" — xám như .anv-err nhưng là
   class RIÊNG (hàng vẫn done + click được; .anv-err là cú KHÔNG phân tích
   được). Không mượn class có ngữ nghĩa khác — bài học .btn-play. */
.anv-suspect td { color: var(--muted, #9fb0c0); background: rgba(255, 255, 255, .025); }
.anv-reason {
  font-size: 11.5px;
  color: var(--muted, #9fb0c0);
  white-space: normal;
  max-width: 260px;
}
.anv-clickable { cursor: pointer; }
.anv-clickable:hover td { background: rgba(255, 255, 255, .05); }
/* overlay per cú (A2 phần 3): link phát/tải trong ô trạng thái */
.anv-overlay-links a {
  display: inline-block;
  margin: 2px 10px 0 0;
  font-size: 11.5px;
  color: #7fc4ff;
  text-decoration: none;
}
.anv-overlay-links a:hover { text-decoration: underline; }

/* -------------------- trang chi tiết cú (lát A2 phần 4, class .and-*) */
#and-detail h3 { margin: 8px 0 4px; }
.and-video {
  width: 100%;
  max-height: 320px;
  border-radius: 8px;
  background: #000;
  margin: 6px 0;
}
.and-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
#and-replay { margin: 6px 0; }

/* ------------------------------------------------------------ toast */
#toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: #4a1d1d;
  border: 1px solid #a33;
  color: #ffd6d6;
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 14px;
  max-width: 92vw;
  z-index: 10;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .45);
}

.hidden { display: none !important; }

/* quickbar + bottom sheet: chỉ dùng trên mobile */
#quickbar, #backdrop, .sheet-close { display: none; }

/* ----------------------------------------------------------- mobile */
@media (max-width: 760px) {
  header { padding: 10px 14px 0; text-align: center; }
  header h1 { font-size: 18px; }
  header p { display: none; } /* gọn — hướng dẫn đã tự hiểu qua UI */

  main {
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 8px 12px calc(150px + env(safe-area-inset-bottom)); /* chừa quickbar */
  }

  /* panel mặc định ẨN — mở bằng nút "Chi tiết" (bottom sheet) */
  #panel { display: none; }

  body.sheet-open #backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    z-index: 15;
  }
  body.sheet-open #panel {
    display: block;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 20;
    max-width: none;
    max-height: 78vh;
    overflow-y: auto;
    background: var(--bg);
    border-radius: 18px 18px 0 0;
    padding: 12px 14px calc(18px + env(safe-area-inset-bottom));
    box-shadow: 0 -12px 44px rgba(0, 0, 0, .6);
    animation: slideup .22s ease;
  }
  body.sheet-open .sheet-close {
    display: flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    top: 0;
    margin-left: auto;
    width: 36px; height: 36px;
    background: var(--card);
    border: 1px solid var(--card-b);
    border-radius: 50%;
    color: var(--text);
    font-size: 15px;
    cursor: pointer;
    z-index: 2;
  }

  /* quick bar cố định đáy màn hình */
  #quickbar {
    display: flex;
    flex-direction: column;
    gap: 7px;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 9;
    background: var(--card);
    border-top: 1px solid var(--card-b);
    padding: 9px 12px calc(9px + env(safe-area-inset-bottom));
    box-shadow: 0 -6px 24px rgba(0, 0, 0, .4);
  }
  .qb-row { display: flex; align-items: center; gap: 9px; }
  /* 3 engine (thêm zone 30/07) không còn vừa một hàng ở 375px — xuống dòng
     thay vì tràn ngang. Chỉ hàng settings, hàng chính vẫn một dòng. */
  .qb-row.qb-settings { flex-wrap: wrap; }
  .pill.mini { padding: 6px 12px; font-size: 12.5px; }
  .radio.mini { font-size: 13px; }
  #qb-detail, #qb-drills {
    background: none;
    border: 1px solid var(--card-b);
    color: var(--text);
    border-radius: 999px;
    padding: 6px 13px;
    font-size: 12.5px;
    cursor: pointer;
  }
  /* đẩy cặp nút (Bài tập + Chi tiết) sang phải, badge mục tiêu ở trái */
  #qb-drills { margin-left: auto; }
  #qb-spin { width: 50px; height: 50px; flex: 0 0 auto; }
  .qb-mid { flex: 1; min-width: 0; }
  .qb-power { gap: 3px; }
  .qb-power .seg { height: 12px; border-radius: 3px; }
  #qb-info {
    color: var(--muted);
    font-size: 11.5px;
    margin-top: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #qb-go { width: auto; flex: 0 0 auto; padding: 12px 17px; font-size: 14px; border-radius: 11px; }
  #qb-play { flex: 0 0 auto; padding: 12px 15px; font-size: 14px; border-radius: 11px; }

  /* hàng Analyzer: cùng kích thước với hàng gợi ý ở trên để đáy màn hình
     không nhảy khi đổi tab (main đã chừa sẵn 150px cho quickbar) */
  #qban-spin { width: 50px; height: 50px; flex: 0 0 auto; }
  .qban-bar .seg { height: 12px; border-radius: 3px; }
  #qban-info {
    color: var(--muted);
    font-size: 11.5px;
    margin-top: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .qban-replay {
    flex: 0 0 auto;
    width: auto;
    padding: 12px 15px;
    font-size: 14px;
    border-radius: 11px;
  }

  #toast { bottom: calc(150px + env(safe-area-inset-bottom)); }

  /* trong sheet: tap target lớn */
  .alt { padding: 13px 14px; font-size: 14px; }
  .pill { padding: 10px 15px; }
  /* chips: 9 nút wrap 2 hàng trong sheet, tap target to hơn */
  #ball-chips { gap: 8px; }
  .chip { width: 40px; height: 40px; font-size: 15px; }
}

@keyframes slideup {
  from { transform: translateY(28%); opacity: .4; }
  to   { transform: none; opacity: 1; }
}