/* ĐẤU TRƯỜNG v4 (lane B3 → G, docs/BO_CUC_50.md mục 6, docs/TRAN_THAT.md mục 9, 12) — lớp DOM #dauTruong do battle.js dựng:
   nằm trên canvas rối (#rigHost z 10), dưới HUD (z 20); left/top/width/height = dải TM.LAYOUT.arena (mặc định 0, 260, 1080×660),
   overflow:hidden + contain:strict → không gì vẽ ra ngoài dải. Toạ độ bên dưới tính trong dải. Mảnh ảnh: art/ui/dau_truong/
   (tools/ui/cat_dau_truong.mjs). Nạp bằng <link> trong game.html (đề nghị lane U) — chưa có thì battle.js tự chèn.
   Lane G (v4, chủ: "khó nhìn"): chữ tối thiểu 22 px trên sân khấu 1080 (điện thoại = 1/3), mỗi khối 1–2 dòng — bỏ chữ cổ vũ (giữ vạch),
   số trận chờ, dòng thưởng của thẻ kết quả, dòng phụ của bong bóng quà. */
#dauTruong {
  position: absolute; left: 0; top: 260px; width: 1080px; height: 660px; overflow: hidden; z-index: 12; pointer-events: none;
  contain: strict; font-family: "Baloo 2", "Segoe UI", sans-serif; color: #fff;
  --dk: #170a03;
  --dol: 0 2px 0 var(--dk), 2px 0 0 var(--dk), -2px 0 0 var(--dk), 0 -2px 0 var(--dk), 2px 2px 0 var(--dk), -2px 2px 0 var(--dk), 2px -2px 0 var(--dk), -2px -2px 0 var(--dk);
  --dol3: 0 3px 0 var(--dk), 3px 0 0 var(--dk), -3px 0 0 var(--dk), 0 -3px 0 var(--dk), 2px 2px 0 var(--dk), -2px 2px 0 var(--dk), 2px -2px 0 var(--dk), -2px -2px 0 var(--dk), 0 5px 0 rgba(23, 10, 3, .5);
}
#dauTruong * { box-sizing: border-box; }

/* ---------- đầu dải: hai khối đấu thủ + đồng hồ + VS + nhãn (chỉ khi có trận) ---------- */
.dt-head { position: absolute; left: 0; top: 0; width: 1080px; height: 170px; transform-origin: 0 0; opacity: 0; transition: opacity .3s; }
.dt.fight .dt-head { opacity: 1; }
/* lane F: nền đầu dải mờ (đỉnh 56 %, không còn là dải đặc) — chữ có viền */
.dt-head::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 176px;
  background: linear-gradient(180deg, rgba(8, 8, 22, .56) 0%, rgba(8, 8, 22, .32) 62%, rgba(8, 8, 22, 0) 100%); }
.dt-side { position: absolute; top: 0; width: 440px; height: 170px; }
.dt-side.a { left: 0; }
.dt-side.b { right: 0; }
.dt-av { position: absolute; top: 10px; width: 86px; height: 86px; border-radius: 50%; padding: 4px;
  background: linear-gradient(160deg, #fff0b8, #d99a34 55%, #8a4e10); box-shadow: 0 3px 8px rgba(0, 0, 0, .65); }
.dt-side.a .dt-av { left: 14px; }
.dt-side.b .dt-av { right: 14px; }
.dt-av .av { width: 78px !important; height: 78px !important; border: 2px solid #3a1d06; }
.dt-av .av-l { font-size: 40px !important; }
.dt-nm { position: absolute; top: 6px; width: 326px; font-weight: 800; font-size: 32px; line-height: 40px; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; text-shadow: var(--dol); }
.dt-side.a .dt-nm { left: 110px; color: #d9efff; }
.dt-side.b .dt-nm { right: 110px; text-align: right; color: #ffe1d8; }
.dt-sub { position: absolute; top: 46px; width: 326px; font-weight: 700; font-size: 22px; line-height: 28px; color: #ffe9b0; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; text-shadow: var(--dol); }
.dt-side.a .dt-sub { left: 110px; }
.dt-side.b .dt-sub { right: 110px; text-align: right; }
/* thanh máu lớn kiểu tham khảo: vàng, vệt kem trễ, đỏ khi dưới 30 % */
.dt-hp { position: absolute; top: 102px; width: 420px; height: 30px; border-radius: 9px; overflow: hidden; background: #1c0e06;
  border: 2px solid #e6b85a; box-shadow: 0 2px 6px rgba(0, 0, 0, .6), inset 0 0 0 2px #3a1d06; }
.dt-side.a .dt-hp { left: 14px; }
.dt-side.b .dt-hp { right: 14px; }
.dt-hp i { position: absolute; inset: 2px; border-radius: 6px; transform-origin: 0 50%; will-change: transform; }
.dt-side.b .dt-hp i { transform-origin: 100% 50%; }
.dt-hp i.hp-tr { background: #fff1c4; opacity: .9; }
.dt-hp i.hp-fl { background: linear-gradient(180deg, #fff69a 0%, #ffcf3a 40%, #e29512 75%, #b86a08 100%); }
.dt-hp.low i.hp-fl { background: linear-gradient(180deg, #ffb0a0 0%, #ff4a3a 45%, #c41620 100%); }
.dt-hp b { position: absolute; left: 0; right: 0; top: 0; line-height: 26px; text-align: center; font-weight: 800; font-size: 22px; color: #fff;
  text-shadow: var(--dol); font-variant-numeric: tabular-nums; }
/* cổ vũ (tim của khán giả, 0–10 %): vạch xanh mảnh dưới thanh máu + chữ */
.dt-ch { position: absolute; top: 136px; width: 420px; height: 9px; border-radius: 5px; background: rgba(8, 18, 40, .75);
  box-shadow: inset 0 0 0 1px rgba(120, 190, 255, .45); }
.dt-side.a .dt-ch { left: 14px; }
.dt-side.b .dt-ch { right: 14px; }
.dt-ch i { position: absolute; inset: 1px; border-radius: 4px; background: linear-gradient(90deg, #4fb4ff, #9fe2ff); transform: scaleX(0); transform-origin: 0 50%; }
.dt-side.b .dt-ch i { transform-origin: 100% 50%; background: linear-gradient(270deg, #4fb4ff, #9fe2ff); }
.dt-ch span { display: none; }   /* lane G: chữ "Cổ vũ +x %" bỏ (vạch xanh đủ thấy) */
.dt-side.a .dt-ch span { left: 4px; }
.dt-side.b .dt-ch span { right: 4px; }
/* giữa: đồng hồ (giây còn lại của trận + hiệp), VS vàng, nhãn loại trận */
.dt-mid { position: absolute; left: 440px; top: 0; width: 200px; height: 170px; }
.dt-clock { position: absolute; left: 46px; top: 2px; width: 108px; height: 76px; border-radius: 14px; text-align: center;
  background: linear-gradient(180deg, rgba(40, 24, 10, .95), rgba(16, 9, 4, .95)); border: 2px solid #e6b85a; box-shadow: 0 3px 8px rgba(0, 0, 0, .6); }
.dt-clock b { display: block; font-family: "TN Game", "Alegreya SC", Georgia, serif; font-weight: 400; font-size: 44px; line-height: 46px; color: #fff8e0;
  text-shadow: var(--dol); font-variant-numeric: tabular-nums; }
.dt-clock span { display: block; font-weight: 700; font-size: 22px; line-height: 24px; color: #ffd98a; white-space: nowrap; }
.dt-vs { position: absolute; left: 61px; top: 78px; width: 78px; height: 61px; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .7)); }
.dt-kind { position: absolute; left: -20px; top: 132px; width: 240px; height: 36px; text-align: center; white-space: nowrap;
  font-family: "TN Game", "Alegreya SC", Georgia, serif; font-size: 25px; line-height: 36px; color: #ffe9a0; text-shadow: var(--dol);
  background: url(../art/ui/dau_truong/vang.png) center / 100% 100% no-repeat; }
.dt.won-a .dt-side.b, .dt.won-b .dt-side.a { filter: grayscale(.7) brightness(.8); transition: filter .5s; }

/* ---------- bảng Trận tiếp theo (góc trái, dưới đầu dải; v4 không còn bệ Tam Tôn → 340 px cho chữ 22 px) ---------- */
.dt-next { position: absolute; left: 8px; top: 174px; width: 340px; padding: 6px 8px 7px; border-radius: 12px; display: none;
  background: rgba(14, 12, 32, .68); border: 1.5px solid rgba(230, 184, 90, .75); box-shadow: 0 3px 10px rgba(0, 0, 0, .45); }
.dt-next.on { display: block; animation: dtIn .3s ease-out; }
/* lane M (gộp v5): trang Chiêu Hiền / Linh Thú, lúc không có trận, bảng này chỉ còn lời thách đang chờ (đã có ở dòng HUD "… gõ ĐỒNG Ý (11s)")
   và nằm sau bảng bên trái tâm cảnh của trang (VỪA CHIÊU MỘ / THẲNG TIẾN HOÁ) → bị che nửa: ẩn; có trận thì hiện như cũ.
   Thẻ kết quả + bong bóng quà (góc phải, còn 90 s sau Lôi Đài) nằm sau bảng PHA NÀY / GIỚI HẠN MÙA (Chiêu Hiền), CHĂM THÚ GIỎI (Linh Thú): ẩn tương tự */
body[data-trang="chieu_tuong"] .dt:not(.fight) .dt-next.on, body[data-trang="linh_thu"] .dt:not(.fight) .dt-next.on,
body[data-trang="chieu_tuong"] .dt:not(.fight) .dt-res, body[data-trang="chieu_tuong"] .dt:not(.fight) .dt-gifts,
body[data-trang="linh_thu"] .dt:not(.fight) .dt-res, body[data-trang="linh_thu"] .dt:not(.fight) .dt-gifts { display: none; }
.dt-nh { display: flex; align-items: baseline; justify-content: space-between; padding: 0 4px 3px; }
.dt-nh b { font-family: "TN Game", "Alegreya SC", Georgia, serif; font-weight: 400; font-size: 22px; line-height: 26px; color: #ffd77a; text-shadow: var(--dol); }
.dt-nh span { display: none; }   /* lane G: "n trận chờ" bỏ */
.dt-nr { display: flex; align-items: center; gap: 4px; height: 34px; margin-top: 3px; padding: 0 9px; border-radius: 17px; white-space: nowrap;
  background: url(../art/ui/dau_truong/hang.png) center / 100% 100% no-repeat; font-weight: 700; font-size: 22px; line-height: 34px; }
.dt-nr span { max-width: 112px; overflow: hidden; text-overflow: ellipsis; color: #ffe3a3; text-shadow: var(--dol); }
.dt-nr i { font-style: normal; color: #ff9a8a; font-weight: 800; }
.dt-nr em { margin-left: auto; font-style: normal; font-weight: 800; font-size: 22px; color: #9fe6ff; text-shadow: var(--dol); font-variant-numeric: tabular-nums; }
.dt-nr.k-duel span { color: #bfefff; }
.dt-nr.k-open { opacity: .82; }
.dt-nr.k-open span { color: #e0d8ff; }
.dt-nr.k-open em, .dt-nr.nhanh em { color: #ffcf8a; }

/* ---------- thẻ kết quả 2 trận gần nhất (góc phải) ---------- */
.dt-res { position: absolute; right: 8px; top: 174px; width: 340px; }
.dt-card { position: relative; display: flex; align-items: center; gap: 8px; height: 52px; margin-bottom: 6px; padding: 4px 8px; border-radius: 12px;
  background: linear-gradient(90deg, rgba(140, 34, 20, .9), rgba(46, 14, 10, .82)); border: 1.5px solid #e6b85a; box-shadow: 0 3px 8px rgba(0, 0, 0, .45);
  animation: dtCardIn .4s cubic-bezier(.2, 1.3, .4, 1); }
.dt-card.k-duel { background: linear-gradient(90deg, rgba(28, 70, 140, .9), rgba(10, 18, 40, .82)); }
.dt-card::after { content: ""; position: absolute; right: -4px; top: -6px; width: 26px; height: 28px; background: url(../art/ui/dau_truong/thang.png) center / 100% 100% no-repeat; }
.dt-cav .av { width: 44px !important; height: 44px !important; }
.dt-cav .av-l { font-size: 24px !important; }
.dt-ct { min-width: 0; flex: 1; }
.dt-c1 { font-weight: 700; font-size: 22px; line-height: 26px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: var(--dol); }
.dt-c1 b { color: #ffe08a; }
.dt-c1 b.l { color: #c9d4ff; }
.dt-c1 span { color: #fff; font-weight: 600; }
.dt-c2 { display: none; }   /* lane G: dòng vòng / thưởng bỏ — một dòng "A thắng B" */

/* ---------- bong bóng quà lớn (góc phải, dưới thẻ kết quả) ---------- */
.dt-gifts { position: absolute; right: 8px; top: 174px; width: 340px; }
.dt-gift { display: flex; align-items: center; gap: 8px; min-height: 62px; margin-bottom: 6px; padding: 5px 12px 5px 5px; border-radius: 36px 14px 14px 36px;
  background: linear-gradient(90deg, rgba(255, 214, 110, .96), rgba(255, 140, 60, .94)); border: 2px solid #fff3c4; box-shadow: 0 4px 12px rgba(0, 0, 0, .5);
  animation: dtGiftIn .4s cubic-bezier(.2, 1.4, .4, 1); }
.dt-gift.t5, .dt-gift.t6 { background: linear-gradient(90deg, rgba(255, 150, 220, .96), rgba(150, 70, 255, .94)); }
.dt-gift .av { width: 56px !important; height: 56px !important; border-color: #fff3c4; }
.dt-gift .av-l { font-size: 28px !important; }
.dt-gt { min-width: 0; display: flex; flex-direction: column; line-height: 1.12; }
.dt-gt b { font-weight: 800; font-size: 22px; color: #3a1204; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dt-gt span { font-weight: 800; font-size: 22px; color: #6a1c00; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dt-gift.t5 .dt-gt b, .dt-gift.t6 .dt-gt b, .dt-gift.t5 .dt-gt span, .dt-gift.t6 .dt-gt span { color: #fff; text-shadow: var(--dol); }
.dt-gt em { display: none; }   /* lane G: dòng "n lượt quay" bỏ */
.dt-gift.out { animation: dtOut .35s ease-in forwards; }

/* ---------- Lôi Đài mở sau mm:ss (không trận, ngoài pha Lôi Đài) ---------- */
.dt-open { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); display: none; white-space: nowrap; padding: 4px 28px 6px;
  border-radius: 30px; background: rgba(12, 10, 28, .72); border: 2px solid #e6b85a; box-shadow: 0 3px 10px rgba(0, 0, 0, .5);
  font-family: "TN Game", "Alegreya SC", Georgia, serif; font-size: 30px; line-height: 40px; color: #ffe9b0; text-shadow: var(--dol); }
.dt-open.on { display: block; }
.dt-open b { font-weight: 400; color: #fff; font-variant-numeric: tabular-nums; }

/* ---------- bong bóng thoại / Né! / chữ lớn ---------- */
.dt-fx { position: absolute; inset: 0; }
.dt-bub { position: absolute; isolation: isolate; min-width: 170px; max-width: 360px; padding: 12px 24px 40px; text-align: center; white-space: nowrap;
  font-weight: 800; font-size: 24px; line-height: 30px; color: #4a2408; animation: dtBubIn .28s cubic-bezier(.2, 1.5, .4, 1) both; transform-origin: 85% 100%; }
.dt-bub::before { content: ""; position: absolute; inset: 0; z-index: -1; border-style: solid; border-width: 26px 86px 36px 42px;
  border-image: url(../art/ui/dau_truong/bong_thoai.png) 26 86 36 42 fill stretch; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .45)); }
.dt-bub.l { transform-origin: 15% 100%; }
.dt-bub.l::before { transform: scaleX(-1); }
.dt-bub span { display: block; }
.dt-bub.nho { min-width: 0; width: 110px; height: 74px; padding: 8px 0 0; font-family: "TN Game", "Alegreya SC", Georgia, serif; font-weight: 400;
  font-size: 32px; line-height: 40px; color: #0f4c8c; transform-origin: 50% 100%; }
.dt-bub.nho::before { border: 0; border-image: none; background: url(../art/ui/dau_truong/bong_nho.png) center / 100% 100% no-repeat; }
.dt-bub.out { animation: dtOut .3s ease-in forwards; }
.dt-big { position: absolute; left: 0; right: 0; top: 200px; text-align: center; white-space: nowrap; animation: dtBigIn .5s cubic-bezier(.2, 1.6, .4, 1) both; }
.dt-bm { font-family: "TN Game", "Alegreya SC", Georgia, serif; font-weight: 400; font-size: 128px; line-height: 130px; color: #ffe98a; letter-spacing: 2px;
  text-shadow: 0 4px 0 #6a1006, 4px 0 0 #6a1006, -4px 0 0 #6a1006, 0 -4px 0 #6a1006, 3px 3px 0 #6a1006, -3px 3px 0 #6a1006, 3px -3px 0 #6a1006, -3px -3px 0 #6a1006,
    0 9px 0 rgba(40, 6, 2, .65), 0 0 28px rgba(255, 190, 70, .85), 0 0 60px rgba(255, 120, 30, .55); }
.dt-big.batdau .dt-bm { color: #fff3b0; }
.dt-big.thang { top: 176px; }
.dt-big.thang .dt-bm { font-size: 136px; line-height: 138px; }
.dt-bn { font-weight: 800; font-size: 56px; line-height: 64px; color: #fff; text-shadow: var(--dol3), 0 0 18px rgba(255, 220, 120, .8); }
.dt-bs { font-weight: 800; font-size: 32px; line-height: 40px; color: #ffe08a; text-shadow: var(--dol3); }
.dt-big.thuong { top: 380px; animation-delay: .25s; }
.dt-big.out { animation: dtOut .32s ease-in forwards; }

/* dải cũ (đài giữa 640–1060, khi stages.js chưa chuyển v3): chỉ đầu dải thu nhỏ + bong bóng + chữ lớn */
.dt.cu .dt-next, .dt.cu .dt-res, .dt.cu .dt-gifts, .dt.cu .dt-open { display: none !important; }
.dt.cu .dt-big { top: 120px; transform-origin: 50% 0; }
.dt.cu .dt-bm { font-size: 96px; line-height: 100px; }
.dt.cu .dt-big.thuong { top: 330px; }

@keyframes dtIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes dtCardIn { from { opacity: 0; transform: translateX(40px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes dtGiftIn { from { opacity: 0; transform: translateX(60px) scale(.8); } to { opacity: 1; transform: none; } }
@keyframes dtBubIn { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }
@keyframes dtBigIn { 0% { opacity: 0; transform: scale(2.3); } 60% { opacity: 1; transform: scale(.94); } 100% { opacity: 1; transform: scale(1); } }
@keyframes dtOut { to { opacity: 0; transform: translateY(-14px) scale(.96); } }

/* v6 (lane S6, TRANG_RIENG 7.1): dải 380–900; bảng Trận tiếp theo (trái) / thẻ kết quả + quà (phải) ở 640 (= 260 trong dải), rộng 320 —
   THAY CHỖ hai hộp CÁCH CHƠI / QUÀ khi có trận (hộp .tran ẩn), không có trận thì ẩn để hộp hiện */
body.bc-v6 .dt-next { left: 10px; top: 260px; width: 320px; box-sizing: border-box; }
body.bc-v6 .dt-res, body.bc-v6 .dt-gifts { right: 10px; top: 260px; width: 320px; }
body.bc-v6 .dt:not(.fight) .dt-next.on, body.bc-v6 .dt:not(.fight) .dt-res, body.bc-v6 .dt:not(.fight) .dt-gifts { display: none; }

/* lane D1 (docs/GIU_CHAN.md): trận tân thủ / Sư Huynh — nhãn "TỶ THÍ TÂN THỦ" (stages.js bọc kindText) + chữ nhỏ "trận tập luyện" dưới nhãn */
.dt-tap { position: absolute; left: -10px; top: 172px; width: 220px; height: 30px; border-radius: 15px; text-align: center; white-space: nowrap;
  font-size: 22px; line-height: 30px; font-weight: 800; color: #9dffd0; text-shadow: var(--dol); background: rgba(6, 40, 30, .74); box-shadow: 0 0 0 1.5px rgba(141, 255, 184, .6); }
.dt.tt-on .dt-kind { font-size: 22px; color: #b4ffd8; }
