/* landscape.css — Quán Trà Huyền Học, bố cục NGANG 1920×1080 (Q7, lead-decisions.md). Chỉ có hiệu lực dưới #stage.is-landscape
   (Kit.layout gắn khi theme.json khai "stage.landscape" và cửa sổ / ?orient ngang); DỌC 1080×1920 không đụng một pixel.
   Nạp SAU mọi CSS khác (index.html) → cùng độ ưu tiên thì thắng; luật dọc có !important (stage-board.css, hud.js inline) → ghi đè !important.
   Chỉ dùng token (--qt-*, --sb-*, --cards-*), không hex mới; chữ giữ nguyên cỡ dọc (khối chính ≥ 40, thân thẻ 32–36, miễn trừ 30).

   LƯỚI NGANG của quán (áp linh hoạt lưới chuẩn 90 · 360 · 1200×900 · 360 · 90):
     ┌ x 10–300  CỘT TRÁI: Thầy Đồ Nhàn TO 340 px (sb-host) — ghế tắt: chân y 705 (mép trước bàn trà); ghế bật: chân y 396 (mặt bàn dãy đầu)
     ├ x 300–1120 Ô GIỮA: bảng gỗ treo trần y 20–~255 (lịch + dòng mời + miễn trừ) ⇄ HUD lớp đố (trần y 16–~190, đáy y 210–~286);
     │            cảnh quán phía dưới (bàn trà, người đứng y 740–1040) — ghế bật: 4 dãy bàn x 90–1050, mặt bàn đầu y ≈ 397 → đáy 1045
     ├ x 1140–1900 Ô PHẢI (760): thẻ huyền học / đố vui / bài học / bảng sự kiện / "Cảm ơn" mọc từ đáy y 1060; biển đố lớp y 44→ (thẻ mở giữa câu: biển thu gọn sang ô giữa, thẻ giữ trọn ô phải);
     │            làn thông báo y 20 (toast · băng rôn · thẻ cảm ơn quà, rộng 1140–1704) + ô "+N đang chờ" góc phải y 20; "Tim cho quán" y 150
     └ lề 20 px bốn phía (YouTube / FB / web không che góc như TikTok). Nền dọc phủ kín (cover) neo 0.65 → lộ mặt bàn + sàn (scene.json "landscape"). */

#stage.is-landscape {
  --qt-ceiling-top: 20px;
  --qt-lane-top: 20px;
  --cards-toast-top: 20px;
  --kit-guide-top: 20px;
  --qt-corner-bottom: 20px;
  --cards-slot-bottom: 20px;
  --class-top: 16px;
  --seats-boards-top: 20px;
  --st-wait-right: 20px;
  --st-wait-top: 20px;
  --qtl-left: 1140px;      /* mép trái ô phải (760 px: lưới 3 ô "Cung nhà · Sao năm nay · Hạn năm nay" 1 dòng) */
  --qtl-right: 20px;       /* mép phải ô phải */
  --qtl-mid-left: 300px;   /* ô giữa (bảng gỗ / HUD lớp): x 300–1120 = 820 px (HUD trần: khối trái ≥ 446 + Bảng vàng 360) */
  --qtl-mid-right: 800px;  /* = 1920 − 1120 */
}

/* ---------- ô giữa: bảng gỗ treo trần (lịch · dòng mời · miễn trừ), bảng tiết / buổi / tổ 6 s ---------- */
#stage.is-landscape .qt-ceiling { left: var(--qtl-mid-left); right: var(--qtl-mid-right); }
#stage.is-landscape .kit-boards { left: var(--qtl-mid-left); right: var(--qtl-mid-right); }
/* sân ngang: cột thẻ ở ô phải, không bao giờ cao tới bảng gỗ → theme.js không gắn qt-tall-*; lưới an toàn nếu lớp còn sót */
#stage.is-landscape.qt-tall-2 .qt-ceiling { visibility: visible; }
#stage.is-landscape.qt-tall-1 .cards-toasts, #stage.is-landscape.qt-tall-1 .kit-toast, #stage.is-landscape.qt-tall-1 .kit-card, #stage.is-landscape.qt-tall-1 .kit-periodic { visibility: visible; }

/* ---------- ô phải: thẻ + đố vui + bài học + bảng sự kiện + "Cảm ơn" (đáy y 1060), bảng "Gõ gì được gì?" (đỉnh y 20) ---------- */
#stage.is-landscape .cards-slot { left: var(--qtl-left); right: var(--qtl-right); bottom: var(--cards-slot-bottom); }
#stage.is-landscape .qt-corner { left: var(--qtl-left); right: var(--qtl-right); bottom: var(--qt-corner-bottom); }
#stage.is-landscape .cards-board { left: var(--qtl-left); right: var(--qtl-right); bottom: var(--qt-corner-bottom); top: auto; width: auto; }
#stage.is-landscape .kit-ticker { left: var(--qtl-left) !important; right: var(--qtl-right) !important; bottom: var(--qt-corner-bottom); top: auto !important; }
#stage.is-landscape .kit-guide { left: var(--qtl-left); right: var(--qtl-right); top: var(--kit-guide-top); }
/* bảng help mở (y 20–~640): toast người xem xuống dưới bảng help, vẫn trong ô phải */
#stage.is-landscape.qt-help-on .cards-toasts { top: 660px; }
/* làn thông báo (1 thứ / lúc): toast người xem · băng rôn kit · thẻ cảm ơn quà · câu nhắc — chừa 196 px cho ô "+N đang chờ" ở góc phải */
#stage.is-landscape .cards-toasts { left: var(--qtl-left); right: 216px; top: var(--cards-toast-top); }
#stage.is-landscape .kit-card, #stage.is-landscape .kit-periodic, #stage.is-landscape .kit-toast { left: var(--qtl-left) !important; right: 216px !important; }
#stage.is-landscape .kit-toast { top: calc(var(--qt-lane-top) + 10px) !important; }
#stage.is-landscape .cards-toast { max-width: 100%; white-space: normal; text-align: left; } /* "Lan Anh · đang xếp hàng thứ 2" rộng 524 px → 2 dòng, không cắt */
/* câu mời TO nằm trên bảng gỗ (ô giữa) → làn thông báo ở ô phải không phải dời xuống như dọc */
#stage.is-landscape.inv-on { --qt-lane-top: 20px; --cards-toast-top: 20px; }
/* "Tim cho quán" (kit-goal, chỉ 6 s khi có tim): dưới làn thông báo, trên vùng thẻ */
#stage.is-landscape .kit-goal { left: var(--qtl-left) !important; right: var(--qtl-right) !important; top: 150px !important; bottom: auto !important; }
#stage.is-landscape.seats-on .kit-goal { top: 150px !important; bottom: auto !important; }
/* nhắc "Bấm để bật âm thanh": góc trái-dưới, không che bảng / thẻ */
#stage.is-landscape .kit-unmute { left: 20px; right: auto; bottom: 16px !important; transform: none; }

/* ---------- Thầy Đồ Nhàn TO (stage-board.js .sb-host) ở cột trái; biển đố (class-root) + HUD lớp (sb-ceiling / sb-bottom) ---------- */
#stage.is-landscape.sb-qt {
  --sb-side: var(--qtl-right);
  --sb-ceil-top: 16px;
  --sb-board-top: 44px;           /* thanh treo sơn mài của biển (::after, −28 px) nằm trọn từ y 16 */
  --sb-board-left: var(--qtl-left);
  --sb-bottom-top: 210px;         /* HUD đáy ngay dưới khối trần (trần cao ≤ ~190 khi Bảng vàng đủ 3 tên) */
  --sb-host-left: 10px;
  --qtl-host-h: 340px;            /* thầy cao 340 (31 % khung — dọc 420/1920 = 22 %); ảnh point 399×475 → rộng 286 < 300 (không chạm ô giữa) */
  --sb-host-top: 365px;           /* ghế tắt: chân y 705 = mép trước bàn trà (nền neo 0.65); bảng tên y 317→ dưới HUD đáy (≤ 290) */
  --sb-host-h: var(--qtl-host-h);
}
#stage.is-landscape.sb-qt.seats-on { --qtl-host-h: 340px; --sb-host-top: 56px; } /* ghế bật: thầy ngồi (chân y 396) trên mặt bàn dãy đầu (y ≈ 397); bảng tên trên đầu y 12→ */
/* dọc: thẻ phòng (x 340→) mở thì thầy co lại + lùi; ngang thẻ ở ô phải → thầy giữ nguyên cỡ / chỗ, không mờ */
#stage.is-landscape.sb-qt.qt-busy .sb-host { --sb-host-h: var(--qtl-host-h); --sb-host-left: 10px; top: var(--sb-host-top); }
#stage.is-landscape.sb-idle.qt-busy .sb-host, #stage.is-landscape.sb-idle.qt-corner-on .sb-host, #stage.is-landscape.sb-idle.qt-help-on .sb-host { opacity: 1; }
/* HUD lớp: trần (lớp · lượt · sĩ số · quà · tiếp + Khách quen giỏi) y 16, đáy (ván · câu · hướng dẫn) y 160 — đều ở ô giữa, Bảng vàng hẹp hơn */
#stage.is-landscape .sb-ceiling { left: var(--qtl-mid-left); right: var(--qtl-mid-right); }
#stage.is-landscape .sb-gold { width: 360px; max-width: 360px; }
/* dọc: thẻ phòng mở → biển dồn lên chỗ trần (--sb-ceil-top); ngang biển ở ô phải, giữ chỗ */
#stage.is-landscape.sb-qt.qt-busy .class-root { top: var(--sb-board-top); }
#stage.is-landscape .sb-bottom { left: var(--qtl-mid-left); right: var(--qtl-mid-right); top: var(--sb-bottom-top); }
/* thẻ phòng lúc lớp chạy: ô phải trọn chiều cao (thẻ tuổi ~770 px + biển thu gọn ~300 không đủ 1040) → biển đố THU GỌN dời sang ô giữa
   thế chỗ HUD lớp (trần + đáy tạm ẩn, như dọc "bảng thu gọn lên chỗ trần"): y 44–~350, trên mặt bàn dãy đầu (397), không chồng thẻ */
#stage.is-landscape.sb-qt.class-on .cards-slot { left: var(--qtl-left); right: var(--qtl-right); bottom: var(--cards-slot-bottom); }
#stage.is-landscape.sb-qt.qt-busy.class-on .cards-slot { top: auto; bottom: var(--cards-slot-bottom); justify-content: flex-end; }
#stage.is-landscape.sb-qt.qt-busy.class-on .class-root { left: var(--qtl-mid-left); right: var(--qtl-mid-right); top: var(--sb-board-top); }
#stage.is-landscape.sb-qt.qt-busy.class-on .sb-ceiling, #stage.is-landscape.sb-qt.qt-busy.class-on .sb-bottom { display: none; }
/* bảng sự kiện / "Cảm ơn" lúc ghế bật hoặc thầy ngồi chờ: ô phải (dọc: cột 340–860 chừa tay thầy) */
#stage.is-landscape.sb-qt.seats-on .cards-board, #stage.is-landscape.sb-qt.seats-on .kit-ticker, #stage.is-landscape.sb-qt.sb-idle .kit-ticker { left: var(--qtl-left) !important; right: var(--qtl-right) !important; }
#stage.is-landscape.sb-qt.seats-on .kit-ticker { bottom: var(--qt-corner-bottom) !important; }
#stage.is-landscape.seats-on .kit-unmute { bottom: 16px !important; }

/* ---------- lớp sinh động (.qt-amb): nền ngang chỉ lộ vùng bàn trà + sàn → tia nắng dời sang phải-trên, vầng đèn lồng không còn trong khung, đom đóm thấp hơn ---------- */
#stage.is-landscape .qt-amb .sun { left: 820px; top: -200px; height: 1300px; }
#stage.is-landscape[data-mode="ao-ca"] .qt-amb .sun, #stage.is-landscape[data-mode="pho"] .qt-amb .sun, #stage.is-landscape[data-mode="tra-da"] .qt-amb .sun { left: 1100px; }
#stage.is-landscape .qt-amb .lamp { display: none; }
#stage.is-landscape .qt-amb .fly { top: -560px; }

/* ======================================================================================================================
   [Q7 bước 2] LỜI THẦY (câu nhắc `prompt` → Kit.hud.toast → .kit-toast) + BẢNG TRÒ LỚN (show / bộ trò Quán Trà / hợp tác-lô tô / arena)
   ====================================================================================================================== */

/* ---------- lời thầy: dọc = chữ trần sáng trên làn thông báo (y 350, rộng 1000); ngang làn ở ô phải chỉ rộng 564 → 4 dòng không nền.
   → ngang: BÓNG THOẠI giấy dó ngay dưới bảng gỗ, ô giữa (x 300–1120), đuôi chỉ sang thầy ở cột trái; câu mời TO đang mở (inv-on) → ẩn (lặp ý). Chữ mực 36 px đậm, ≤ 2 dòng với câu nhắc dài nhất của theme (73 ký tự), không "…". ---------- */
#stage.is-landscape {
  --qtl-say-top: 272px;            /* đáy bảng gỗ nghỉ ≤ 256 + 16; 2 dòng 36 px → đáy ≤ 396 = mặt bàn dãy đầu khi ghế bật (397) */
  --qtl-say-size: 36px;            /* đo thật: 38–42 px → câu dài nhất 3 dòng trong 820 px; 36 = cỡ thân thẻ, vẫn ≥ 30 */
}
/* câu mời TO đang mở (inv-on) → lời thầy ẨN (cùng ý "gõ năm sinh…" → lặp nhãn; luật ở cards-hh.css cho cả 2 hướng); hết mời mới hiện lại ở y 272 */
#stage.is-landscape .kit-toast {
  left: var(--qtl-mid-left) !important; right: var(--qtl-mid-right) !important; top: var(--qtl-say-top) !important; z-index: 28; /* trên lớp ghế / dãy bàn (12) */
  box-sizing: border-box; padding: 14px 26px 16px; border-radius: 20px; text-align: left; text-wrap: pretty;
  font-size: var(--qtl-say-size); font-weight: 700; line-height: 1.22; letter-spacing: -.01em; color: var(--qt-ink); text-shadow: none;
  background: linear-gradient(180deg, var(--qt-paper), var(--qt-paper-3)); border: 3px solid var(--qt-wood-edge);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .38), inset 0 2px 0 rgba(255, 255, 255, .5);
}
#stage.is-landscape .kit-toast::before { /* đuôi bóng thoại chỉ về thầy (cột trái) */
  content: ''; position: absolute; left: -14px; top: 34px; width: 24px; height: 24px; transform: rotate(45deg); border-radius: 4px;
  background: var(--qt-paper); border-left: 3px solid var(--qt-wood-edge); border-bottom: 3px solid var(--qt-wood-edge);
}
#stage.is-landscape .kit-toast::after { /* ❀ góc phải như thẻ giấy dó */
  content: '❀'; position: absolute; right: 14px; top: 6px; font-size: 30px; line-height: 1; color: var(--qt-amber-ink); opacity: .55;
}

/* ---------- bảng trò lớn (z 29) = Ô GIỮA + Ô PHẢI GỘP x 300–1900, đỉnh y 20, đáy ≤ 1060 (dọc: cột 100–980 giữa màn, thầy mờ đi vì bị che).
   Ngang thầy ở cột trái KHÔNG bị che → giữ nguyên, không mờ; HUD lớp đáy (.sb-bottom, ô giữa y 210) nhường vì bảng chiếm ô giữa. ---------- */
#stage.is-landscape {
  --qtl-board-top: 20px;
  --qtl-board-bottom: 1060px;      /* y đáy tối đa của bảng trò lớn */
}
#stage.is-landscape.show-on .sb-host, #stage.is-landscape.recess-on .sb-host, #stage.is-landscape.qtg-on .sb-host, #stage.is-landscape.cl-on .sb-host,
#stage.is-landscape.kit-arena-on .sb-host { opacity: 1; }
#stage.is-landscape.show-on .sb-bottom, #stage.is-landscape.recess-on .sb-bottom, #stage.is-landscape.qtg-on .sb-bottom, #stage.is-landscape.cl-on .sb-bottom,
#stage.is-landscape.kit-arena-on .sb-bottom { display: none; }
/* ô "+N đang chờ / Còn ghế" (góc phải y 20) và góc bài học / sự thật (ô phải, đáy) nằm dưới bảng trò → nhường tới khi bảng đóng (dọc: không chồng vì bảng ≤ 980) */
#stage.is-landscape.show-on .sb-wait, #stage.is-landscape.recess-on .sb-wait, #stage.is-landscape.qtg-on .sb-wait, #stage.is-landscape.cl-on .sb-wait,
#stage.is-landscape.kit-arena-on .sb-wait { visibility: hidden; }
#stage.is-landscape.show-on .qt-corner, #stage.is-landscape.recess-on .qt-corner, #stage.is-landscape.kit-arena-on .qt-corner { display: none; }
/* arena: sân trò chiếm ô giữa trọn chiều cao → bảng gỗ treo trần (y 20–~260, ô giữa) nhường; dọc bảng gỗ (y 100–255) nằm trên dải luật (y 250) nên giữ */
#stage.is-landscape.kit-arena-on .qt-ceiling { visibility: hidden; }

/* show.js: ra chơi (6 trò) + Rung chuông vàng · Oẳn tù tì · Ô chữ — bảng sân khấu sơn mài */
#stage.is-landscape .show-root { --show-top: var(--qtl-board-top); --show-bottom: var(--qtl-board-bottom); left: var(--qtl-mid-left); right: var(--qtl-right); }

/* qt-games.js: Nối từ (bảng gỗ treo dây) · Xin xăm · Đôi bạn · Rương trà · Tiệc — dây treo 20 px từ trần */
#stage.is-landscape .qtg-root { --qtg-top: var(--qtl-board-top); --qtg-side: 0px; left: var(--qtl-mid-left); right: var(--qtl-right); }
/* lớp đố đang chạy: dải 1 hàng ở ĐÁY Ô GIỮA (biển đố ở ô phải, HUD lớp ở ô giữa y 16–286 → đáy ô giữa trống) */
#stage.is-landscape.class-on .qtg-root { left: var(--qtl-mid-left); right: var(--qtl-mid-right); top: auto; bottom: var(--qt-corner-bottom); }

/* coop-loto.js: hợp tác 3 vai + Dò số Tết — bảng gỗ treo dây 20 px (--cl-top khai ở :root nên phải đặt lại trên .cl-root) */
#stage.is-landscape .cl-root { --cl-top: var(--qtl-board-top); --cl-max-bottom: var(--qtl-board-bottom); left: var(--qtl-mid-left); right: var(--qtl-right); }
#stage.is-landscape.class-on .cl-root, #stage.is-landscape.show-on .cl-root { left: var(--qtl-mid-left); right: var(--qtl-mid-right); top: auto; bottom: var(--qt-corner-bottom); }

/* ---------- arena.js (khung trò kiểu Hypely): HUD vào Ô PHẢI — dải luật 3 động từ xếp DỌC + đồng hồ ở đỉnh (y 20–~330), toast giữa cột (y 540),
   bảng tổng sắp 5 ô ở đáy (y ~800–1060); SÂN TRÒ (.ka-game) = Ô GIỮA trọn chiều cao x 300–1120 × y 20–1060 (820×1040) ---------- */
#stage.is-landscape .kit-arena { --arena-side: 0px; --arena-top: var(--qtl-board-top); --arena-bottom: 20px; --arena-toast-top: 540px; }
#stage.is-landscape .kit-arena .ka-top { left: var(--qtl-left); right: var(--qtl-right); gap: 10px; }
#stage.is-landscape .kit-arena .ka-rules { grid-template-columns: 1fr; gap: 8px; }
#stage.is-landscape .kit-arena .ka-chip .tx { font-size: 30px; -webkit-line-clamp: 3; } /* 1 ô rộng 760 → câu luật dài nhất 2 dòng, không cắt */
#stage.is-landscape .kit-arena .ka-clock { align-self: stretch; justify-content: space-between; }
#stage.is-landscape .kit-arena .ka-toasts { left: var(--qtl-left); right: var(--qtl-right); }
#stage.is-landscape .kit-arena .ka-board { left: var(--qtl-left); right: var(--qtl-right); }
#stage.is-landscape .kit-arena .ka-game { left: var(--qtl-mid-left); right: var(--qtl-mid-right); top: var(--qtl-board-top); bottom: 20px;
  /* sân có NỀN ĐẶC giấy dó viền gỗ (soát fe 12/11: lưới Tìm chữ trong suốt lẫn vào ghế) — dọc sân phủ cả màn trên cảnh nên không nền */
  background: var(--arena-panel); border: 3px solid var(--qt-wood-2); border-radius: var(--arena-radius); overflow: hidden;
  isolation: isolate; /* lớp cảnh của trò có z-index −1 (kf-root / kd-root) phải vẽ TRÊN nền sân này, không chui xuống dưới */
  box-shadow: 0 0 0 2px var(--qt-wood-edge), 0 16px 34px rgba(0, 0, 0, .4); }
/* dãy bàn ghế + thẻ tên (seats.js / seat-tags.js, z 12 / 29) nằm dưới sân trò → ẩn như các bảng trò khác che cảnh; thầy cột trái vẫn còn */
#stage.is-landscape.kit-arena-on .kit-seats, #stage.is-landscape.kit-arena-on .sb-layer { visibility: hidden; }
/* dòng pha · ván · đếm ngược: nền giấy dó viền gỗ, chữ mực (dọc: chữ hổ phách trên lớp mờ tối, ngang trên nền quán sáng đọc kém) */
#stage.is-landscape .kit-arena .ka-clock { background: var(--arena-panel); border: 3px solid var(--qt-wood-2); box-shadow: 0 0 0 2px var(--qt-wood-edge), 0 10px 26px rgba(0, 0, 0, .35); }
#stage.is-landscape .kit-arena .ka-round { color: var(--qt-ink-2); }
#stage.is-landscape .kit-arena .ka-cd { color: var(--qt-ink); text-shadow: none; }
#stage.is-landscape .kit-arena.low .ka-cd { color: var(--qt-red); }
/* Tìm chữ (DOM 1080×1054, lưới 12 ô 60 px = 814 ngang): vừa ô giữa 820 khi bỏ đệm 40 và ô 59 px — chữ ô 36 px, nhãn 26 (như dọc) */
#stage.is-landscape .kw-root { padding: 0; justify-content: center; --kw-tile: min(60px, calc((800px - var(--kw-label) - 16px - (var(--kw-n) - 1) * var(--kw-gap)) / var(--kw-n))); }
#stage.is-landscape .kw-veil { min-width: 0; max-width: 780px; }
/* Hồ câu (canvas 1080×1920 toạ độ dọc cứng) + Đua vịt: CO THEO TỈ LỆ vừa chiều cao sân 1040 (×0.54) — chỉ khung chứa, không viết lại trò;
   cần bố cục ngang riêng sau (chữ nhỏ). Bàn bắn cá / Đấu phe / Leo đỉnh (1080×1054): co ×0.76 vừa chiều ngang 820. */
#stage.is-landscape .kf-root, #stage.is-landscape .kd-root { top: 0; left: 50%; transform: translateX(-50%) scale(calc(1040 / 1920)); transform-origin: 50% 0; }
#stage.is-landscape .ks-root, #stage.is-landscape .kfa-root, #stage.is-landscape .kt-root { inset: auto; left: 50%; top: 50%; width: 1080px; height: 1054px; transform: translate(-50%, -50%) scale(calc(820 / 1080)); }
