/* coop-loto.css — Trò hợp tác 3 vai (Nồi bánh chưng · Xưởng quà Noel · Pha trà đãi khách · Rung chuông mở phiên) + Dò số Tết (Game Pack G6-T5).
   Đi với /sdk/coop-loto.js. Khung 1080×1920: khối ở VÙNG TRẦN — Quán Trà y 100 → đáy ≤ 980 (bảng gỗ treo dây), Phòng Giao Dịch y 184 → ≤ 1040
   (bảng LED). Chữ chính ≥ 40 px, nhãn phụ ≥ 30 px, số = mono tabular. Màu CHỈ qua token (:root + ghi đè [data-room="pgd"] bằng token cards/px).
   Thẻ phòng đang mở (.qt-busy / .pgd-busy) → thu gọn (slim); lớp đố / show (.class-on / .show-on) → dải 1 hàng ở đáy cột (strip); cả hai → ẩn.
   Không "…" cắt chữ (JS co chữ tiêu đề); chữ server vào DOM bằng textContent; giảm chuyển động → không hoạt cảnh. */
:root {
  --cl-top: var(--qt-ceiling-top, 100px);
  --cl-max-bottom: 980px;
  --cl-side: var(--cards-side, 100px);
  --cl-bg1: var(--qt-wood-2, #7A5233);
  --cl-bg2: var(--qt-wood, #5A3A22);
  --cl-edge: var(--qt-wood-edge, #C9955A);
  --cl-t1: var(--qt-cream, #FFF6E2);
  --cl-t2: rgba(255, 246, 226, .82);
  --cl-t3: rgba(255, 246, 226, .62);
  --cl-line: rgba(255, 246, 226, .28);
  --cl-well: rgba(0, 0, 0, .28);          /* ô lõm trên gỗ */
  --cl-well-2: rgba(0, 0, 0, .16);
  --cl-accent: var(--qt-amber, #E3B23C);
  --cl-on-accent: var(--qt-ink, #2B2118);
  --cl-glow: rgba(227, 178, 60, .42);
  --cl-good: #8FE3A3;                     /* thành công / người kinh (không phải màu giá) */
  --cl-good-soft: rgba(143, 227, 163, .2);
  --cl-bad: #FF6B6B;                      /* ngưỡng nguy / thiếu vai / ≤ 5 s */
  --cl-bad-soft: rgba(255, 107, 107, .22);
  --cl-font: var(--cards-font, 'Be Vietnam Pro', system-ui, sans-serif);
  --cl-font-num: var(--cards-font-num, 'JetBrains Mono', ui-monospace, monospace);
  --cl-font-title: var(--qt-font-serif, 'Lora', Georgia, serif);
  --cl-radius: 22px;
  --cl-shadow: 0 18px 44px rgba(0, 0, 0, .5);
}
.cl-root[data-room="pgd"] {
  --cl-top: 184px;
  --cl-max-bottom: 1040px;
  --cl-bg1: var(--cards-s2); --cl-bg2: var(--cards-s1); --cl-edge: var(--cards-accent);
  --cl-t1: var(--cards-t1); --cl-t2: var(--cards-t2); --cl-t3: var(--cards-t3); --cl-line: var(--cards-line);
  --cl-well: rgba(0, 0, 0, .34); --cl-well-2: rgba(255, 255, 255, .06);
  --cl-accent: var(--cards-accent); --cl-on-accent: var(--cards-on-accent); --cl-glow: var(--cards-glow);
  --cl-good: var(--px-up, var(--cards-px-up)); --cl-good-soft: var(--px-up-soft, var(--cl-well-2));
  --cl-bad: var(--px-down, var(--cards-px-down)); --cl-bad-soft: var(--px-down-soft, var(--cl-well));
  --cl-font-title: var(--cl-font);
  --cl-shadow: var(--cards-shadow, 0 18px 44px rgba(0, 0, 0, .5));
}

/* ---------- gốc: cột giữa vùng an toàn ---------- */
.cl-root { position: absolute; left: var(--cl-side); right: var(--cl-side); top: var(--cl-top); z-index: 29; display: none; flex-direction: column; gap: 14px;
  font-family: var(--cl-font); color: var(--cl-t1); pointer-events: none; }
.cl-root.show { display: flex; }
.cl-root .num { font-family: var(--cl-font-num); font-variant-numeric: tabular-nums; }
/* dây treo lên trần (Quán Trà) như bảng gỗ của theme */
.cl-root[data-room="qt"]::before, .cl-root[data-room="qt"]::after { content: ''; position: absolute; top: calc(-1 * var(--cl-top) - 3px); width: 6px; height: var(--cl-top);
  background: var(--cl-edge); box-shadow: 0 0 6px rgba(0, 0, 0, .4); }
.cl-root[data-room="qt"]::before { left: 110px; }
.cl-root[data-room="qt"]::after { right: 110px; }

/* ---------- bảng chung ---------- */
.cl-board { position: relative; box-sizing: border-box; display: none; flex-direction: column; gap: 12px; padding: 14px 26px 18px; border-radius: var(--cl-radius); overflow: hidden;
  max-height: calc(var(--cl-max-bottom) - var(--cl-top)); text-shadow: 0 2px 4px rgba(0, 0, 0, .45);
  background: linear-gradient(180deg, var(--cl-bg1), var(--cl-bg2)); border: 3px solid var(--cl-edge);
  box-shadow: var(--cl-shadow), inset 0 2px 0 rgba(255, 255, 255, .12), inset 0 -3px 0 rgba(0, 0, 0, .25); animation: clIn .5s cubic-bezier(.2, 1.1, .4, 1) both; }
.cl-board.show { display: flex; }
.cl-board > * { flex: none; position: relative; z-index: 1; }
/* nền skin mờ phía trên (ảnh bg của skin hợp tác) — mờ dần xuống để chữ luôn rõ */
.cl-board::before { content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: .18; background: var(--cl-skin-bg, none) center 18% / cover no-repeat;
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 1) 20%, rgba(0, 0, 0, 0) 80%); mask-image: linear-gradient(180deg, rgba(0, 0, 0, 1) 20%, rgba(0, 0, 0, 0) 80%); }
.cl-root[data-room="pgd"] .cl-board::after { content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: .06;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(255, 255, 255, .5) 3px 4px); }
@keyframes clIn { from { opacity: 0; transform: translateY(-26px); } to { opacity: 1; transform: none; } }
.cl-board.out { animation: clOut .3s ease-in both; }
@keyframes clOut { to { opacity: 0; transform: translateY(-14px); } }

.cl-head { display: flex; align-items: center; gap: 14px; min-height: 60px; }
.cl-head .ic { flex: none; width: 64px; height: 64px; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .5)); }
.cl-head .ic.emo { font-size: 54px; line-height: 64px; text-align: center; }
.cl-title { flex: 1; min-width: 0; font: 700 44px/1.1 var(--cl-font-title); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; } /* tên trò: 2 dòng nếu chật, không cắt */
.cl-title.wrap { white-space: normal; } /* JS: co 44 → 40 → 36 vẫn dài → cho xuống 2 dòng, không bao giờ "…" */
.cl-title .short { display: none; }
.cl-subrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-height: 44px; }
.cl-sub { flex: 1; min-width: 0; font: 600 30px/1.25 var(--cl-font); color: var(--cl-t2); white-space: nowrap; }
.cl-sub .cl-cheer { white-space: normal; line-height: 1.2; } /* tên dài → viên cổ vũ xuống hàng riêng / 2 dòng, không cắt */
.cl-cheer { display: inline-block; font: 700 30px/1.25 var(--cl-font); color: var(--cl-on-accent); background: var(--cl-accent); border-radius: 999px; padding: 1px 14px; text-shadow: none;
  max-width: 100%; overflow: hidden; animation: clCheer .45s cubic-bezier(.2, 1.3, .4, 1) both; }
.cl-cheer b { font-weight: 800; }
@keyframes clCheer { 0% { opacity: 0; transform: translateY(10px) scale(.8); } 100% { opacity: 1; transform: none; } }
.cl-pill { flex: none; display: inline-flex; align-items: baseline; gap: 8px; font: 800 32px/1 var(--cl-font-num); font-variant-numeric: tabular-nums; padding: 6px 16px; border-radius: 999px;
  background: var(--cl-well); border: 2px solid var(--cl-line); white-space: nowrap; }
.cl-pill small { font: 600 30px/1 var(--cl-font); color: var(--cl-t2); }
.cl-pill.amber { color: var(--cl-on-accent); background: var(--cl-accent); border-color: var(--cl-accent); text-shadow: none; }
.cl-pill.amber small { color: var(--cl-on-accent); opacity: .8; }
.cl-pill:empty { display: none; }
.cl-clock { flex: none; min-width: 108px; text-align: center; font: 800 48px/1 var(--cl-font-num); font-variant-numeric: tabular-nums; padding: 6px 12px; border-radius: 16px;
  background: var(--cl-well); border: 2px solid var(--cl-line); }
.cl-clock.low { color: var(--cl-bad); border-color: var(--cl-bad); animation: clPulse .6s ease-in-out infinite; }
.cl-clock:empty { display: none; }
@keyframes clPulse { 50% { transform: scale(1.06); } }
.cl-mini { display: none; } /* chỉ hiện ở dạng dải (strip) */

/* kịch bản bất ngờ / người kinh: dải banner trượt vào */
.cl-banner { display: none; align-items: center; gap: 14px; padding: 7px 18px; border-radius: 14px; background: var(--cl-accent); color: var(--cl-on-accent); text-shadow: none;
  font: 800 34px/1.2 var(--cl-font); min-width: 0; animation: clBanner .6s cubic-bezier(.2, 1.3, .4, 1) both; }
.cl-banner.show { display: flex; }
.cl-banner.good { background: var(--cl-good); }
.cl-banner .ic { flex: none; font-size: 40px; line-height: 1; animation: clWobble 1.4s ease-in-out infinite; }
.cl-banner .tx { flex: 1; min-width: 0; white-space: normal; line-height: 1.2; overflow-wrap: anywhere; } /* dài → 2 dòng, không cắt giữa chữ */
.cl-banner small { flex: none; font: 600 30px/1 var(--cl-font); opacity: .8; white-space: nowrap; }
@keyframes clBanner { 0% { opacity: 0; transform: translateX(-30px) scale(.96); } 100% { opacity: 1; transform: none; } }
@keyframes clWobble { 0%, 100% { transform: rotate(-10deg); } 50% { transform: rotate(10deg); } }

.cl-foot { margin: 0; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 28px; font: 600 32px/1.3 var(--cl-font); text-align: center; color: var(--cl-t2); }
.cl-foot > span { white-space: nowrap; }
.cl-foot b { color: var(--cl-on-accent); background: var(--cl-accent); border-radius: 10px; padding: 1px 12px; text-shadow: none; font-weight: 800; white-space: nowrap; }
.cl-foot:empty { display: none; }
.cl-disc { margin: 0; font: 500 30px/1.25 var(--cl-font); text-align: center; color: var(--cl-t3); border-top: 1px dashed var(--cl-line); padding-top: 8px; }
.cl-disc:empty { display: none; }
.cl-timer { position: absolute; left: 24px; right: 24px; bottom: 6px; height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .12); overflow: hidden; z-index: 1; }
.cl-timer i { display: block; height: 100%; width: 100%; background: var(--cl-accent); transition: width linear; }
.cl-msg { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); max-width: 94%; box-sizing: border-box; padding: 6px 22px; border-radius: 999px; z-index: 3;
  font: 700 32px/1.25 var(--cl-font); color: var(--cl-t1); background: var(--cl-bg2); border: 2px solid var(--cl-accent); white-space: nowrap; overflow: hidden; animation: clMsg 3.2s ease-out both; }
.cl-msg b { color: var(--cl-accent); }
.cl-msg { white-space: normal; text-align: center; line-height: 1.2; border-radius: 22px; } /* nhắc dài → 2 dòng */
@keyframes clMsg { 0% { opacity: 0; transform: translate(-50%, 12px); } 12%, 80% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }
.cl-av { flex: none; width: 56px; height: 56px; border-radius: 50%; overflow: hidden; border: 2px solid var(--cl-accent); background: var(--cl-well); display: grid; place-items: center; font: 800 30px/1 var(--cl-font); }
.cl-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cl-av.art { border-color: transparent; background: transparent; }

/* ---------- HỢP TÁC: 3 vai ---------- */
.cl-roles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding-top: 10px; }
.cl-role { position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; padding: 10px 10px 12px; border-radius: 18px; text-align: center;
  background: var(--cl-well); border: 2px solid var(--cl-line); }
.cl-role .ic { width: 84px; height: 84px; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .5)); animation: clFloat 3.2s ease-in-out infinite; }
.cl-role:nth-child(2) .ic { animation-delay: -1.1s; }
.cl-role:nth-child(3) .ic { animation-delay: -2.2s; }
@keyframes clFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.cl-role .lb { max-width: 100%; font: 700 34px/1.15 var(--cl-font); text-align: center; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; } /* nhãn vai ≤ 16 ký tự, chật thì 2 dòng (ab 11/11) */
.cl-role .cmd { display: inline-flex; align-items: baseline; gap: 8px; max-width: 100%; font: 800 30px/1 var(--cl-font); color: var(--cl-on-accent); background: var(--cl-accent); border-radius: 10px; padding: 6px 12px;
  white-space: nowrap; overflow: hidden; text-shadow: none; }
.cl-role .cmd small { font-weight: 600; opacity: .78; }
.cl-role .n { font: 600 30px/1.2 var(--cl-font); color: var(--cl-t2); white-space: nowrap; text-align: center; }
.cl-role .n .pk { display: block; font: 600 30px/1.2 var(--cl-font); color: var(--cl-accent); }
.cl-role .n .pk:empty { display: none; }
.cl-role .n b { font: 800 34px/1 var(--cl-font-num); font-variant-numeric: tabular-nums; color: var(--cl-t1); }
.cl-role .n b.bump { display: inline-block; animation: clBump .45s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes clBump { 0% { transform: scale(1); } 40% { transform: scale(1.35); color: var(--cl-accent); } 100% { transform: scale(1); } }
.cl-role .tag { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); font: 800 30px/1 var(--cl-font); padding: 5px 12px; border-radius: 999px; white-space: nowrap; display: none; text-shadow: none;
  background: var(--cl-accent); color: var(--cl-on-accent); }
.cl-role.need { border-color: var(--cl-accent); box-shadow: 0 0 18px var(--cl-glow); }
.cl-role.need .tag { display: block; }
.cl-role.empty { border-color: var(--cl-bad); box-shadow: 0 0 18px var(--cl-bad-soft); animation: clNeed 1.4s ease-in-out infinite; }
.cl-role.empty .tag { display: block; background: var(--cl-bad); color: var(--cl-t1); }
@keyframes clNeed { 50% { box-shadow: 0 0 4px var(--cl-bad-soft); } }

/* 2 thanh đo: tiến độ (tới đích) · "nóng" (có vùng nguy) */
.cl-meters { display: flex; flex-direction: column; gap: 8px; }
.cl-meter { display: grid; grid-template-columns: 56px 210px 1fr 166px; align-items: center; gap: 12px; min-height: 54px; }
.cl-meter .ic { width: 56px; height: 56px; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .5)); }
.cl-meter .lb { font: 700 30px/1.1 var(--cl-font); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; } /* nhãn ngắn: 2 dòng nếu chật, không cắt */
.cl-meter .bar { position: relative; height: 32px; border-radius: 99px; background: var(--cl-well); border: 2px solid var(--cl-line); overflow: hidden; }
.cl-meter .bar .fill { position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--p, 0) * 1%); border-radius: 99px; background: linear-gradient(90deg, var(--cl-accent), var(--cl-good));
  transition: width .6s cubic-bezier(.2, .8, .3, 1); box-shadow: 0 0 14px var(--cl-glow); }
.cl-meter .bar .fill::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 26px, rgba(255, 255, 255, .14) 26px 28px); }
.cl-meter.heat .bar .fill { background: linear-gradient(90deg, var(--cl-accent), var(--cl-bad)); box-shadow: none; }
.cl-meter .bar .zone { position: absolute; top: 0; bottom: 0; left: calc(var(--z, 70) * 1%); right: 0; border-left: 3px dashed var(--cl-bad);
  background: repeating-linear-gradient(135deg, var(--cl-bad-soft) 0 8px, transparent 8px 16px); }
.cl-meter .val { font: 800 34px/1 var(--cl-font-num); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.cl-meter .val small { font: 600 30px/1 var(--cl-font-num); color: var(--cl-t2); }
.cl-meter.full .val, .cl-meter.full .lb { color: var(--cl-good); }
.cl-meter.hot .lb, .cl-meter.hot .val { color: var(--cl-bad); animation: clPulse .8s ease-in-out infinite; }
.cl-meter.hot .bar { border-color: var(--cl-bad); box-shadow: 0 0 16px var(--cl-bad-soft); }
.cl-meter .warn { display: none; }
.cl-meter.hot .warn { display: inline; font: 800 30px/1 var(--cl-font); color: var(--cl-bad); }

/* hiệu quả lượt trước */
.cl-last { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font: 600 30px/1.25 var(--cl-font); color: var(--cl-t2); }
.cl-last:empty { display: none; }
.cl-last .k { font-weight: 800; color: var(--cl-t1); white-space: nowrap; }
.cl-last .chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 999px; background: var(--cl-well); border: 2px solid var(--cl-line); white-space: nowrap; color: var(--cl-t1); }
.cl-last .chip b { font-family: var(--cl-font-num); font-variant-numeric: tabular-nums; }
.cl-last .chip.good { border-color: var(--cl-good); color: var(--cl-good); }
.cl-last .chip.bad { border-color: var(--cl-bad); color: var(--cl-bad); }

/* trợ lực (chủ phòng bật) + quà chỉ cổ vũ (D-6) */
.cl-boost { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 18px; font: 600 30px/1.25 var(--cl-font); color: var(--cl-t2); text-align: center; }
.cl-boost .b { display: inline-flex; align-items: center; gap: 8px; padding: 3px 14px; border-radius: 999px; border: 2px dashed var(--cl-line); white-space: nowrap; color: var(--cl-t1); }
.cl-boost .b.used { border-style: solid; border-color: var(--cl-accent); background: var(--cl-accent); color: var(--cl-on-accent); text-shadow: none; animation: clBanner .6s both; }
.cl-boost .gift { white-space: nowrap; }

/* vinh danh */
.cl-honor { display: none; grid-template-columns: 300px 1fr; gap: 24px; align-items: center; padding-top: 6px; }
.cl-honor.show { display: grid; }
.cl-honor .art { width: 300px; height: 300px; object-fit: contain; border-radius: 26px; filter: drop-shadow(0 12px 22px rgba(0, 0, 0, .55)); animation: clArt .8s cubic-bezier(.2, 1.3, .4, 1) both; }
.cl-honor .art.emo { display: grid; place-items: center; font-size: 160px; line-height: 1; background: var(--cl-well); }
@keyframes clArt { 0% { opacity: 0; transform: scale(.5) rotate(-8deg); } 100% { opacity: 1; transform: none; } }
.cl-honor .body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cl-honor h3 { margin: 0; font: 800 52px/1.1 var(--cl-font-title); color: var(--cl-accent); }
.cl-honor.lose h3 { color: var(--cl-t1); font-size: 46px; }
.cl-honor .say { margin: 0; font: 500 34px/1.3 var(--cl-font); color: var(--cl-t1); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.cl-honor .mvp { display: flex; align-items: center; gap: 12px; min-width: 0; font: 600 32px/1.2 var(--cl-font); color: var(--cl-t2); padding: 6px 12px; border-radius: 16px; background: var(--cl-well); border: 2px solid var(--cl-accent); }
.cl-honor .mvp .cards-av { width: 56px; height: 56px; border-width: 2px; }
.cl-honor .mvp .who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cl-honor .mvp b { font: 800 36px/1.15 var(--cl-font); color: var(--cl-t1); white-space: normal; overflow-wrap: anywhere; }
.cl-honor .mvp span { white-space: normal; line-height: 1.2; }
.cl-honor .mvp .pts { flex: none; font: 800 38px/1 var(--cl-font-num); font-variant-numeric: tabular-nums; color: var(--cl-good); white-space: nowrap; }
.cl-honor .mvp:empty { display: none; }
.cl-honor .stats { display: flex; flex-wrap: wrap; gap: 8px 16px; font: 600 30px/1.25 var(--cl-font); color: var(--cl-t2); }
.cl-honor .stats b { color: var(--cl-t1); font-family: var(--cl-font-num); font-variant-numeric: tabular-nums; }
.cl-honor .stats .good { color: var(--cl-good); }
.cl-coop[data-phase="honor"] .cl-roles, .cl-coop[data-phase="honor"] .cl-meters, .cl-coop[data-phase="honor"] .cl-last, .cl-coop[data-phase="honor"] .cl-boost, .cl-coop[data-phase="honor"] .cl-banner,
.cl-coop[data-phase="done"] .cl-roles, .cl-coop[data-phase="done"] .cl-meters, .cl-coop[data-phase="done"] .cl-last, .cl-coop[data-phase="done"] .cl-boost, .cl-coop[data-phase="done"] .cl-banner { display: none; }
.cl-coop[data-phase="honor"] .cl-timer, .cl-coop[data-phase="done"] .cl-timer { display: none; }

/* ---------- DÒ SỐ TẾT ---------- */
.cl-call { display: grid; grid-template-columns: 240px 1fr; gap: 20px; align-items: center; min-height: 140px; }
.cl-draw { position: relative; width: 240px; height: 140px; }
.cl-tube { position: absolute; left: 6px; bottom: 4px; width: 90px; height: 120px; border-radius: 14px 14px 26px 26px; transform-origin: 50% 92%;
  background: linear-gradient(90deg, var(--cl-edge), var(--cl-accent) 45%, var(--cl-edge)); border: 3px solid var(--cl-on-accent); box-shadow: 0 10px 18px rgba(0, 0, 0, .45), inset 0 0 0 6px rgba(255, 255, 255, .18); }
.cl-tube::before { content: ''; position: absolute; left: -8px; right: -8px; top: 22px; height: 16px; border-radius: 8px; background: var(--cl-on-accent); opacity: .85; }
.cl-tube::after { content: '福'; position: absolute; left: 0; right: 0; bottom: 18px; text-align: center; font: 700 44px/1 var(--cl-font-title); color: var(--cl-on-accent); opacity: .75; }
.cl-loto.rolling .cl-tube { animation: clShake .9s ease-in-out; }
@keyframes clShake { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(-14deg) translateY(-6px); } 30% { transform: rotate(12deg); } 45% { transform: rotate(-10deg) translateY(-4px); } 60% { transform: rotate(8deg); } 75% { transform: rotate(-4deg); } }
.cl-ball { position: absolute; right: 6px; bottom: 8px; width: 124px; height: 124px; border-radius: 50%; display: grid; place-items: center; text-shadow: none;
  font: 800 70px/1 var(--cl-font-num); font-variant-numeric: tabular-nums; color: var(--cl-on-accent);
  background: radial-gradient(circle at 34% 28%, var(--cl-t1), var(--cl-accent) 52%, var(--cl-edge)); box-shadow: 0 12px 24px rgba(0, 0, 0, .5), 0 0 28px var(--cl-glow), inset 0 -8px 14px rgba(0, 0, 0, .25); }
.cl-ball.q { font-size: 72px; color: var(--cl-t2); background: var(--cl-well); border: 3px dashed var(--cl-line); box-shadow: none; }
.cl-loto.rolling .cl-ball { animation: clPop .7s cubic-bezier(.2, 1.5, .4, 1) both; }
@keyframes clPop { 0% { transform: translate(-70px, 30px) scale(.3); opacity: 0; } 55% { transform: translate(6px, -10px) scale(1.14); opacity: 1; } 100% { transform: none; } }
.cl-verse { margin: 0; min-width: 0; font: 500 italic 34px/1.28 var(--cl-font-title); color: var(--cl-t1); white-space: pre-line; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; }
.cl-verse.big { font: 800 40px/1.25 var(--cl-font); white-space: normal; }
.cl-verse.big small { display: block; font: 600 32px/1.3 var(--cl-font); color: var(--cl-t2); margin-top: 6px; }
.cl-verse b { color: var(--cl-on-accent); background: var(--cl-accent); border-radius: 10px; padding: 1px 12px; text-shadow: none; font-style: normal; white-space: nowrap; }
.cl-under { display: flex; align-items: flex-start; gap: 14px; min-width: 0; }
.cl-side { display: none; flex: none; width: 290px; box-sizing: border-box; padding: 8px 12px 10px; border-radius: 16px; background: var(--cl-well-2); border: 2px solid var(--cl-line); }
.cl-side.has-ticket { display: block; }
.cl-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.cl-info .sum { display: flex; flex-wrap: wrap; gap: 8px 10px; font: 600 30px/1.2 var(--cl-font); color: var(--cl-t2); }
.cl-info .sum .c { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 14px; border-radius: 999px; background: var(--cl-well); border: 2px solid var(--cl-line); white-space: nowrap; color: var(--cl-t1); }
.cl-info .sum .c b { font: 800 32px/1 var(--cl-font-num); font-variant-numeric: tabular-nums; }
.cl-info .sum .c.hot { border-color: var(--cl-accent); color: var(--cl-accent); animation: clPulse 1.2s ease-in-out infinite; }
.cl-ticket { display: none; flex-direction: column; gap: 6px; min-width: 0; animation: clBanner .5s both; }
.cl-ticket.show { display: flex; }
.cl-ticket .nm { display: flex; align-items: center; gap: 8px; font: 700 30px/1.15 var(--cl-font); white-space: nowrap; overflow: hidden; }
.cl-ticket .nm .cl-av, .cl-ticket .nm .cards-av { width: 40px; height: 40px; font-size: 30px; border-width: 2px; }
.cl-ticket .nm span { min-width: 0; white-space: normal; overflow-wrap: anywhere; line-height: 1.15; max-height: 70px; overflow: hidden; } /* tên dài → 2 dòng */
.cl-ticket .nm small { font-weight: 600; color: var(--cl-t2); }
.cl-ticket .g { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.cl-ticket .g i { box-sizing: border-box; height: 34px; display: grid; place-items: center; border-radius: 8px; font: 700 30px/1 var(--cl-font-num); font-variant-numeric: tabular-nums; font-style: normal; background: var(--cl-well); color: var(--cl-t2); }
.cl-ticket .g i.on { background: var(--cl-accent); color: var(--cl-on-accent); text-shadow: none; }
.cl-grid { display: grid; grid-template-columns: repeat(15, 1fr); gap: 4px; }
.cl-cell { box-sizing: border-box; height: 34px; display: grid; place-items: center; border-radius: 8px; font: 700 30px/1 var(--cl-font-num); font-variant-numeric: tabular-nums; color: var(--cl-t3); background: var(--cl-well-2); border: 1px solid transparent; }
.cl-cell.on { color: var(--cl-on-accent); background: var(--cl-accent); text-shadow: none; }
.cl-cell.new { color: var(--cl-on-accent); background: var(--cl-t1); box-shadow: 0 0 0 3px var(--cl-accent), 0 0 18px var(--cl-glow); font-weight: 800; animation: clBump .5s cubic-bezier(.2, 1.4, .4, 1); }
.cl-recent { display: none; }
.cl-winners { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; font: 700 32px/1.2 var(--cl-font); min-height: 48px; }
.cl-winners:empty { display: none; }
.cl-winners .w { display: inline-flex; align-items: center; gap: 8px; padding: 3px 14px 3px 4px; border-radius: 999px; background: var(--cl-well); border: 2px solid var(--cl-good); color: var(--cl-t1); white-space: nowrap; max-width: 100%; }
.cl-winners .w > span { min-width: 0; white-space: normal; overflow-wrap: anywhere; line-height: 1.15; } /* tên dài → chip rộng hết hàng rồi mới xuống dòng, không cắt */
.cl-winners .w .cl-av, .cl-winners .w .cards-av { width: 40px; height: 40px; font-size: 30px; border-width: 2px; border-color: var(--cl-good); }
.cl-winners .w small { font: 600 30px/1 var(--cl-font); color: var(--cl-t2); }
.cl-winners .w.new { animation: clBanner .5s both; }
.cl-loto[data-phase="deal"] .cl-grid, .cl-loto[data-phase="deal"] .cl-winners { display: none; }
.cl-loto.has-banner .cl-side, .cl-loto.has-banner .cl-disc { display: none; } /* banner "kinh rồi" hiện 4,5 s → thẻ vé vừa phát + dòng miễn trừ tạm nhường (đáy khối ≤ y 980) */
.cl-loto[data-phase="end"] .cl-timer { display: none; }

/* ---------- trang trí mùa (ev season, Kit.coopLoto.season): tuyết / đèn / pháo hoa / hoa mai / hoa đào rơi nhẹ — dưới mọi bảng, không che chữ ---------- */
.cl-decor { position: absolute; inset: 0; z-index: 12; pointer-events: none; overflow: hidden; display: none; }
.cl-decor.show { display: block; }
.cl-decor i { position: absolute; left: calc(var(--x, 50) * 1%); top: -60px; font-style: normal; font-size: var(--sz, 36px); line-height: 1; opacity: .85; color: var(--cl-t1);
  text-shadow: 0 2px 6px rgba(0, 0, 0, .35); animation: clFall var(--du, 12s) linear var(--dl, 0s) infinite; }
.cl-decor i.d-tuyet { color: var(--cl-t1); }
.cl-decor i.d-den-noel { color: var(--cl-accent); animation-name: clTwinkle; animation-duration: 2.2s; top: calc(60px + (var(--x, 50) * 1.6px)); }
.cl-decor i.d-phao-hoa { animation-name: clSpark; animation-duration: 3.4s; top: calc(120px + (var(--x, 50) * 3px)); }
@keyframes clFall { 0% { transform: translateY(0) rotate(0); } 100% { transform: translateY(1700px) rotate(240deg); } }
@keyframes clTwinkle { 0%, 100% { opacity: .35; transform: scale(.9); } 50% { opacity: 1; transform: scale(1.15); } }
@keyframes clSpark { 0% { opacity: 0; transform: scale(.4); } 30% { opacity: 1; transform: scale(1.2); } 100% { opacity: 0; transform: scale(1.8) translateY(-30px); } }

/* ---------- thu gọn (slim): thẻ / đố của phòng đang mở (.qt-busy / .pgd-busy) → chỉ đầu bảng + vai (gọn) + thanh tiến độ · Dò số: đầu bảng + số vừa gọi + 8 số gần nhất ---------- */
.qt-busy .cl-board, .pgd-busy .cl-board { gap: 8px; padding: 10px 22px 14px; }
.qt-busy .cl-board::before, .pgd-busy .cl-board::before { opacity: .1; }
.qt-busy .cl-sub, .pgd-busy .cl-sub, .qt-busy .cl-banner small, .pgd-busy .cl-banner small, .qt-busy .cl-last, .pgd-busy .cl-last, .qt-busy .cl-boost, .pgd-busy .cl-boost,
.qt-busy .cl-foot, .pgd-busy .cl-foot, .qt-busy .cl-disc, .pgd-busy .cl-disc, .qt-busy .cl-meter.heat, .pgd-busy .cl-meter.heat, .qt-busy .cl-role .n .pk, .pgd-busy .cl-role .n .pk,
.qt-busy .cl-honor .say, .pgd-busy .cl-honor .say, .qt-busy .cl-honor .stats, .pgd-busy .cl-honor .stats,
.qt-busy .cl-grid, .pgd-busy .cl-grid, .qt-busy .cl-under, .pgd-busy .cl-under, .qt-busy .cl-verse, .pgd-busy .cl-verse { display: none; }
.qt-busy .cl-subrow, .pgd-busy .cl-subrow { min-height: 0; }
.qt-busy .cl-subrow:empty, .pgd-busy .cl-subrow:empty { display: none; }
.qt-busy .cl-roles, .pgd-busy .cl-roles { gap: 10px; padding-top: 8px; }
.qt-busy .cl-role, .pgd-busy .cl-role { gap: 4px; padding: 8px 8px 8px; }
.qt-busy .cl-role .ic, .pgd-busy .cl-role .ic { width: 52px; height: 52px; animation: none; }
.qt-busy .cl-role .lb, .pgd-busy .cl-role .lb { display: none; }
.qt-busy .cl-role .cmd, .pgd-busy .cl-role .cmd { padding: 5px 10px; }
.qt-busy .cl-role .n, .pgd-busy .cl-role .n { font-size: 30px; }
.qt-busy .cl-role .tag, .pgd-busy .cl-role .tag { top: -14px; }
.qt-busy .cl-meter, .pgd-busy .cl-meter { grid-template-columns: 44px 1fr 130px; min-height: 44px; }
.qt-busy .cl-meter .ic, .pgd-busy .cl-meter .ic { width: 44px; height: 44px; }
.qt-busy .cl-meter .lb, .pgd-busy .cl-meter .lb { display: none; }
.qt-busy .cl-honor, .pgd-busy .cl-honor { grid-template-columns: 150px 1fr; gap: 16px; }
.qt-busy .cl-honor .art, .pgd-busy .cl-honor .art { width: 150px; height: 150px; }
.qt-busy .cl-honor h3, .pgd-busy .cl-honor h3 { font-size: 44px; }
.qt-busy .cl-call, .pgd-busy .cl-call { grid-template-columns: 150px 1fr; min-height: 110px; gap: 14px; }
.qt-busy .cl-loto .cl-call, .pgd-busy .cl-loto .cl-call { grid-template-columns: 150px 1fr; }
.qt-busy .cl-loto .cl-recent, .pgd-busy .cl-loto .cl-recent { grid-column: 2; }
.qt-busy .cl-draw, .pgd-busy .cl-draw { width: 150px; height: 110px; }
.qt-busy .cl-tube, .pgd-busy .cl-tube { width: 56px; height: 84px; }
.qt-busy .cl-tube::after, .pgd-busy .cl-tube::after { font-size: 30px; bottom: 10px; }
.qt-busy .cl-ball, .pgd-busy .cl-ball { width: 100px; height: 100px; font-size: 56px; bottom: 4px; right: 0; }
.qt-busy .cl-recent, .pgd-busy .cl-recent { display: flex; flex-wrap: wrap; gap: 6px; align-content: center; min-width: 0; }
.cl-recent i { display: grid; place-items: center; min-width: 54px; height: 40px; padding: 0 8px; border-radius: 10px; font: 700 30px/1 var(--cl-font-num); font-variant-numeric: tabular-nums; font-style: normal; color: var(--cl-on-accent); background: var(--cl-accent); text-shadow: none; }
.cl-recent i:first-child { background: var(--cl-t1); box-shadow: 0 0 0 3px var(--cl-accent); }
.cl-recent .more { color: var(--cl-t2); background: var(--cl-well); font: 600 30px/1 var(--cl-font); }

/* ---------- dải (strip): lớp đố / show đang chiếm trần (.class-on / .show-on) → 1 hàng ở đáy cột; thẻ cũng mở → nhường hẳn.
   PGD có thẻ phòng (.pgd-busy): cũng dải 1 hàng nhưng GIỮ trên đỉnh (thẻ PGD cao tới ~y 500) ---------- */
.class-on .cl-root, .show-on .cl-root { top: auto; bottom: calc(1920px - var(--cl-max-bottom)); }
.pgd-busy .cl-board { gap: 0; padding: 8px 22px; border-radius: 999px; }
.pgd-busy .cl-board::before { display: none; }
.pgd-busy .cl-board > :not(.cl-head) { display: none; }
.pgd-busy .cl-head .ic { width: 52px; height: 52px; }
.pgd-busy .cl-title { flex: none; font-size: 36px; }
.pgd-busy .cl-title .t { display: none; }
.pgd-busy .cl-title .short { display: inline; }
.pgd-busy .cl-mini { display: flex; flex: 1; min-width: 0; align-items: center; gap: 10px; }
.pgd-busy .cl-clock { font-size: 40px; min-width: 90px; padding: 5px 10px; }
.class-on .cl-root::before, .class-on .cl-root::after, .show-on .cl-root::before, .show-on .cl-root::after { display: none; }
.class-on .cl-board, .show-on .cl-board { gap: 0; padding: 8px 22px; border-radius: 999px; }
.class-on .cl-board::before, .show-on .cl-board::before { display: none; }
.class-on .cl-board > :not(.cl-head), .show-on .cl-board > :not(.cl-head) { display: none; }
.class-on .cl-head, .show-on .cl-head { min-height: 60px; }
.class-on .cl-head .ic, .show-on .cl-head .ic { width: 52px; height: 52px; }
.class-on .cl-title, .show-on .cl-title { flex: none; font-size: 36px; }
.class-on .cl-title .t, .show-on .cl-title .t { display: none; }
.class-on .cl-title .short, .show-on .cl-title .short { display: inline; }
.class-on .cl-mini, .show-on .cl-mini { display: flex; flex: 1; min-width: 0; align-items: center; gap: 10px; }
.cl-mini .bar { flex: 1; min-width: 60px; height: 22px; border-radius: 99px; background: var(--cl-well); overflow: hidden; }
.cl-mini .bar i { display: block; height: 100%; width: calc(var(--p, 0) * 1%); background: var(--cl-accent); transition: width .5s; }
.cl-mini .v { flex: none; font: 800 32px/1 var(--cl-font-num); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cl-mini .cl-recent { display: flex; flex-wrap: nowrap; gap: 6px; overflow: hidden; }
.cl-mini .cl-recent i { min-width: 48px; height: 38px; }
.class-on .cl-clock, .show-on .cl-clock { font-size: 40px; min-width: 90px; padding: 5px 10px; }
.class-on .cl-mini .v, .show-on .cl-mini .v { font-size: 32px; }
.class-on.qt-busy .cl-root, .class-on.pgd-busy .cl-root, .show-on.qt-busy .cl-root, .show-on.pgd-busy .cl-root { display: none; }

@media (prefers-reduced-motion: reduce) {
  .cl-board, .cl-board.out, .cl-cheer, .cl-clock.low, .cl-banner, .cl-banner .ic, .cl-role .ic, .cl-role .n b.bump, .cl-role.empty, .cl-meter.hot .lb, .cl-meter.hot .val, .cl-boost .b.used,
  .cl-honor .art, .cl-loto.rolling .cl-tube, .cl-loto.rolling .cl-ball, .cl-cell.new, .cl-ticket, .cl-winners .w.new, .cl-msg, .cl-info .sum .c.hot, .cl-decor i { animation: none !important; }
  .cl-decor i { top: calc(40px + (var(--x, 50) * 2px)); opacity: .5; }
  .cl-meter .bar .fill, .cl-mini .bar i, .cl-timer i { transition: none; }
}
