/* Mini game bốc thăm may mắn (user yêu cầu 2026-09-23) — dùng cho 3 màn:
   game.php (khách quét QR), quan-tro.php (quản trò) và lớp phủ trên màn chiếu (xem-slide.php).
   Tông màu lấy theo site.css; màn khách thiết kế cho điện thoại cầm tay, chữ to, nút to. */

.game-page {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(60% 40% at 50% 0%, rgba(253, 142, 134, .16), transparent 70%),
    var(--bg);
}
.game-shell {
  display: grid;
  gap: 14px;
  align-content: start;
  max-width: 520px;
  margin: 0 auto;
  padding: 20px 16px calc(28px + env(safe-area-inset-bottom));
}
.game-shell--host { max-width: 640px; }

.game-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.game-card--center { text-align: center; }
.game-kicker {
  margin: 0 0 6px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.game-h1 { margin: 0 0 10px; font-size: 24px; font-weight: 600; line-height: 1.25; }
.game-h2 { margin: 0 0 10px; font-size: 16px; font-weight: 600; }
.game-h2-note { color: var(--faint); font-weight: 400; }
.game-code {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 8px;
  background: var(--panel-strong);
  font-variant-numeric: tabular-nums;
  letter-spacing: .12em;
}
.game-label { display: block; margin: 14px 0 6px; font-size: 13px; font-weight: 500; }
.game-input { width: 100%; font-size: 17px; }       /* >= 16px: iOS không tự phóng to khi gõ */
.game-btn { width: 100%; margin-top: 12px; justify-content: center; font-size: 16px; }
.game-msg { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.game-msg:empty { display: none; }
.game-msg.is-error { color: var(--danger); }
.game-seat { margin: 0 0 4px; color: var(--muted); font-size: 14px; }
.game-seat strong { color: var(--text); font-size: 20px; font-variant-numeric: tabular-nums; }
.game-count { margin: 12px 0 0; color: var(--muted); font-size: 14px; }
.game-count strong { color: var(--text); font-size: 18px; font-variant-numeric: tabular-nums; }
.game-prize { margin: 0 0 8px; font-size: 18px; }
.game-prize strong { color: var(--brand-a); font-size: 26px; }
.game-win { border-color: rgba(253, 142, 134, .5); background: rgba(253, 142, 134, .1); }
.game-foot { margin: 6px 0 0; color: var(--faint); font-size: 12px; text-align: center; }
.game-foot a { color: inherit; }

/* Ba chấm nhấp nháy lúc chờ quay số */
.game-dots { display: flex; justify-content: center; gap: 6px; margin: 14px 0 4px; }
.game-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-a);
  opacity: .35;
  animation: game-dot 1.2s ease-in-out infinite;
}
.game-dots span:nth-child(2) { animation-delay: .2s; }
.game-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes game-dot {
  0%, 100% { opacity: .3; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-4px); }
}

.game-winners { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.game-winner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, .22);
  font-size: 14px;
}
.game-winner.is-me { background: rgba(253, 142, 134, .16); }
.game-winner-no {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--brand-a), var(--brand-b));
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

/* ── Màn quản trò ─────────────────────────────────────────────────────── */
.host-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 14px 0;
  color: var(--muted);
  font-size: 13px;
}
.host-stats strong { color: var(--text); font-size: 17px; font-variant-numeric: tabular-nums; }
.host-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.host-draw { flex: 1; min-width: 140px; justify-content: center; }
.host-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.host-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, .22);
}
.host-no {
  flex: none;
  min-width: 26px;
  color: var(--faint);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.host-name { flex: 1; min-width: 0; font-size: 14px; overflow-wrap: anywhere; }

/* Chọn trò chơi + công tắc ở màn quản trò */
.host-toggles { display: grid; gap: 8px; margin-top: 14px; }
.host-toggles .switch { font-size: 13.5px; }
.host-kinds { display: grid; gap: 8px; }
.host-kind {
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, .22);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.host-kind.is-on {
  border-color: rgba(253, 142, 134, .7);
  background: rgba(253, 142, 134, .12);
}
.host-kind-name { font-size: 14.5px; font-weight: 600; }
.host-kind-desc { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.host-draw.is-stop, .btn.is-stop { background: rgba(255, 255, 255, .14); }
.host-ask { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.host-ask .input { flex: 1; min-width: 180px; }
.host-vote-line { margin: 0; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Hướng dẫn chơi ở màn quản trò */
.host-howto {
  display: grid;
  gap: 4px;
  margin: 0 0 12px;
  padding: 10px 12px 10px 30px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .05);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

/* Danh sách câu hỏi soạn sẵn */
.host-bank { display: grid; gap: 12px; margin: 0 0 10px; padding: 0; list-style: none; }
.host-bank-empty { margin: 0 0 10px; color: var(--faint); font-size: 13px; }
.host-bank-empty[hidden] { display: none; }
.host-q {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0, 0, 0, .22);
}
.host-q.is-now { border-color: rgba(253, 142, 134, .7); background: rgba(253, 142, 134, .1); }
.host-q-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.host-q-no { flex: 1; font-size: 13px; font-weight: 600; }
.host-q-text { width: 100%; margin-bottom: 8px; }
.host-saved { color: var(--faint); font-size: 12.5px; }

/* Ô câu hỏi + các nút trả lời ở màn quản trò */
.host-prompt { width: 100%; margin-bottom: 10px; }
.host-options { display: grid; gap: 8px; margin: 0 0 10px; padding: 0; list-style: none; }
.host-option { display: flex; align-items: center; gap: 8px; }
.host-option .input { flex: 1; min-width: 0; }
.host-option-pick {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
  color: transparent;
  font-size: 15px;
  cursor: pointer;
}
.host-option-pick.is-on {
  border-color: var(--ok);
  background: rgba(159, 227, 191, .18);
  color: var(--ok);
}
.host-max { display: flex; align-items: center; gap: 10px; margin: 12px 0 0; font-size: 13.5px; }
.host-max .help { margin: 0; }
.game-cd { width: auto; min-width: 132px; }
/* Khung gõ danh sách ô (vòng quay / bingo): mỗi dòng một ô */
.host-items { margin: 4px 0 6px; font-size: 14px; line-height: 1.6; resize: vertical; }
/* Địa chỉ vào phòng in ở đầu trang quản trò: KHÔNG ngắt được thì cả trang bị đẩy ngang trên điện thoại */
.game-shell--host .help strong { overflow-wrap: anywhere; }

/* Hướng dẫn sử dụng ở cuối trang quản trò */
.host-guide-item {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .04);
}
.host-guide-item > summary {
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.host-guide-item > summary::-webkit-details-marker { display: none; }
.host-guide-item > summary::after {
  content: '+';
  float: right;
  color: var(--muted);
  font-size: 17px;
  line-height: 1;
}
.host-guide-item[open] > summary::after { content: '–'; }
.host-guide-item[open] > summary { border-bottom: 1px solid var(--line); }
.host-guide-item ul {
  margin: 0;
  padding: 10px 14px 12px 30px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.host-guide-item li + li { margin-top: 5px; }
.host-guide-item strong { color: var(--text); }
.host-guide-item .help { margin: 0 14px 12px; }

/* Bảng "ai đúng ai sai" của lượt vừa lật */
.host-round-line { margin: 12px 0 4px; font-size: 13.5px; font-weight: 600; }
#roundRight { color: var(--ok); }
#roundWrong { color: var(--muted); }
.host-pick {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
}
#rightList .host-pick { background: rgba(159, 227, 191, .18); color: var(--ok); }
.host-auto { margin: 10px 0 0; }

/* Các nút chọn của khách (đố vui: tùy số nút · oản tù tì: 3 tay) */
.guest-vote {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin: 12px 0 4px;
}
/* display: grid đè mất [hidden] của trình duyệt (đã dính ở ô QR màn chiếu) — phải khai riêng */
.guest-vote[hidden] { display: none; }
.guest-pick {
  flex: 1;
  padding: 18px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: rgba(255, 255, 255, .06);
  color: var(--text);
  font: 600 16px/1.2 var(--font-ui);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.guest-pick.is-on { border-color: #fd8e86; background: rgba(253, 142, 134, .2); }
.guest-pick.is-right { border-color: var(--ok); background: rgba(159, 227, 191, .18); }
.guest-pick.is-hand { font-size: 18px; }
/* Nhanh tay nhất: một nút thật to, xám lúc chờ và bật sáng đúng lúc màn chiếu hiện chữ */
.guest-pick.is-fast {
  padding: 46px 10px;
  font-size: 26px;
  letter-spacing: .04em;
}
.guest-pick.is-fast.is-ready {
  border-color: var(--ok);
  background: linear-gradient(180deg, rgba(159, 227, 191, .35), rgba(87, 201, 138, .3));
  animation: game-pop .5s cubic-bezier(.2, 1.4, .4, 1);
}
/* Thẻ bingo của khách: 3x3, ô nào được gọi thì tự sáng */
.bingo-card {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 10px 0 12px;
}
.bingo-cell {
  display: grid;
  place-items: center;
  min-height: 84px;
  padding: 6px 4px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(255, 255, 255, .05);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  transition: background .3s ease, color .3s ease, border-color .3s ease;
}
.bingo-cell.is-on {
  border-color: rgba(159, 227, 191, .75);
  background: rgba(159, 227, 191, .2);
  color: var(--text);
}
.bingo-cell.is-free { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; }
.bingo-card.is-line .bingo-cell.is-on { animation: game-pop .7s cubic-bezier(.2, 1.4, .4, 1); }
#bingoBtn:disabled { opacity: .5; }

/* Đoán số: ô gõ số + nút gửi */
.guest-num {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin: 12px 0 4px;
}
.guest-num[hidden] { display: none; }
.guest-num .game-btn { margin: 0; }
.guest-pick[disabled] { opacity: .55; cursor: default; }
.guest-pick:active { transform: translateY(1px); }
/* Lật kết quả: ô của mình sai thì tối đi, đúng thì sáng và nảy lên (user yêu cầu 2026-09-24).
   Phải đặt SAU .guest-pick[disabled] vì lật xong là các nút đều bị khoá (opacity .55). */
.guest-pick.is-wrong { opacity: .38; filter: grayscale(.6); }
.guest-pick.is-screen { border-color: rgba(255, 210, 140, .85); background: rgba(255, 210, 140, .2); }
.guest-pick.is-right {
  opacity: 1;
  box-shadow: 0 0 0 2px rgba(87, 201, 138, .45), 0 0 22px rgba(87, 201, 138, .35);
  animation: game-pop .7s cubic-bezier(.2, 1.4, .4, 1);
}
.game-score { margin: 10px 0 0; font-size: 14px; font-weight: 600; }
.game-score[hidden] { display: none; }

/* Logo + giới thiệu dịch vụ ở trang khách */
.game-top { display: flex; justify-content: center; padding: 16px 16px 0; }
.game-top .brand img { display: block; height: 32px; width: auto; }
.game-promo { max-width: 760px; margin: 0 auto; padding: 0 16px; }

/* ── Thẻ "Mini game" trong trang sửa slide (sua-slide.php) ────────── */
/* Chỉ còn công tắc + 2 nút: nút phải nổi hẳn lên cho dễ thấy (user yêu cầu 2026-09-23) */
.game-setup {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.game-setup[hidden] { display: none; }
.game-go, .game-reset-host {
  justify-content: center;
  width: 100%;
  padding: 13px 18px;
  font-size: 15px;
  font-weight: 600;
}
.game-go svg, .game-reset-host svg { width: 18px; height: 18px; }
.game-go {
  box-shadow: 0 10px 26px rgba(252, 37, 82, .28);
}
.game-reset-host {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, .06);
}
.game-reset-host[data-armed="1"] {
  border-color: var(--danger);
  color: var(--danger);
}

/* ── Màn chiếu tạm chuyển sang mini game (xem-slide.php) ──────────────── */
.game-stage {
  position: fixed;
  inset: 0;
  z-index: 6;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: clamp(10px, 1.6vh, 22px);
  padding: clamp(16px, 3vh, 40px);
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(253, 142, 134, .18), transparent 70%),
    rgba(6, 5, 10, .93);
  backdrop-filter: blur(8px);
  color: #fff;
  text-align: center;
  animation: game-qr-in .4s ease both;
}
.game-stage[hidden] { display: none; }
.game-stage-kicker {
  margin: 0;
  color: rgba(255, 255, 255, .72);
  font-size: clamp(13px, 1.8vw, 22px);
  font-weight: 600;
  letter-spacing: .3em;
  text-transform: uppercase;
}
.game-stage-prompt {
  max-width: 22ch;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(26px, 5vw, 64px);
  font-weight: 600;
  line-height: 1.15;
}
.game-stage-prompt[hidden] { display: none; }
.game-stage-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 4vw, 54px);
}
/* [hidden] phải khai riêng: display: grid ở dòng dưới sẽ đè mất display: none mặc định của [hidden] */
.game-stage-qr[hidden] { display: none; }
.game-stage-qr {
  display: grid;
  gap: 10px;
  justify-items: center;
  padding: clamp(12px, 1.6vw, 22px);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
  color: #16121a;
}
/* QR TO ở giữa màn: cạnh ~ 1/3 chiều cao màn chiếu để quét được từ 4–5 m */
.game-stage .game-qr-box {
  display: grid;
  place-items: center;
  width: clamp(180px, 34vh, 420px);
  height: clamp(180px, 34vh, 420px);
}
.game-stage .game-qr-box img,
.game-stage .game-qr-box canvas {
  max-width: 100%;
  max-height: 100%;
  width: auto !important;
  height: auto !important;
}
.game-stage-code {
  margin: 0;
  font-size: clamp(16px, 2vw, 26px);
  font-weight: 700;
  letter-spacing: .22em;
}
.game-stage-hint {
  margin: 0;
  color: #5a5360;
  font-size: clamp(11px, 1.1vw, 15px);
}
.game-stage-side .game-stage-hint { color: rgba(255, 255, 255, .66); }
.game-stage-side {
  display: grid;
  gap: 10px;
  justify-items: center;
  min-width: min(340px, 80vw);
  max-width: 46vw;
}
.game-stage-count {
  margin: 0;
  font-size: clamp(18px, 2.6vw, 34px);
  font-weight: 700;
}
.game-stage-names {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  max-height: 34vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  list-style: none;
}
.game-stage-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  font-size: clamp(13px, 1.5vw, 20px);
  animation: game-qr-in .35s ease both;
}
.game-stage-seat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.7em;
  height: 1.7em;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--brand-a), var(--brand-b));
  font-size: .78em;
  font-weight: 600;
}
/* Đang chơi (đố vui / oẳn tù tì): QR thu nhỏ, danh sách tên rút gọn để chừa chỗ cho khu chơi */
.game-stage.is-vote { gap: clamp(6px, 1vh, 14px); }
.game-stage.is-vote .game-stage-qr { transform: scale(.58); transform-origin: center; margin: -6vh 0; }
.game-stage.is-vote .game-stage-main { gap: clamp(6px, 1.5vw, 18px); }
.game-stage.is-vote .game-stage-names { max-height: 9vh; }
.game-stage.is-vote .game-vote-bar { height: clamp(48px, 12vh, 140px); }

.game-vote {
  display: flex;
  gap: clamp(14px, 4vw, 48px);
  align-items: flex-end;
  justify-content: center;
  width: min(900px, 86vw);
}
.game-vote[hidden] { display: none; }
.game-vote-col {
  display: grid;
  flex: 1;
  gap: 8px;
  justify-items: center;
}
.game-vote-name {
  margin: 0;
  font-size: clamp(16px, 2.4vw, 32px);
  font-weight: 600;
}
.game-vote-bar {
  display: flex;
  align-items: flex-end;
  width: min(220px, 26vw);
  height: clamp(60px, 16vh, 180px);
  border-radius: 14px;
  background: rgba(255, 255, 255, .1);
  overflow: hidden;
}
.game-vote-bar span {
  width: 100%;
  height: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffd7a1, #fd8e86);
  transition: height .5s ease;
}
.game-vote-col.is-b .game-vote-bar span { background: linear-gradient(180deg, #a9c7ff, #6f8dff); }
.game-vote-num {
  margin: 0;
  font-size: clamp(20px, 3vw, 44px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.game-vote-col.is-lead .game-vote-num { color: #ffd7a1; }

/* Hướng dẫn chơi ngắn gọn trên màn chiếu */
.game-stage-howto {
  display: grid;
  gap: 4px;
  margin: 6px 0 0;
  padding: 0 0 0 1.3em;
  color: rgba(255, 255, 255, .78);
  font-size: clamp(12px, 1.35vw, 18px);
  line-height: 1.5;
  text-align: left;
}
.game-stage-howto[hidden] { display: none; }
/* Địa chỉ gõ tay cho ai không quét được QR — nằm trong thẻ QR nền TRẮNG nên phải là chữ đậm màu */
.game-stage-link {
  margin: 2px 0 0;
  color: #16121a;
  font-size: clamp(13px, 1.5vw, 20px);
  font-weight: 600;
  letter-spacing: .02em;
  word-break: break-all;
}

/* Chưa chọn trò nào: giới thiệu ngắn dịch vụ */
.game-ad {
  display: grid;
  gap: 4px;
  justify-items: center;
  padding: clamp(10px, 1.6vw, 20px) clamp(16px, 3vw, 36px);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 20px;
  background: rgba(255, 255, 255, .06);
  text-align: center;
}
.game-ad[hidden] { display: none; }
.game-ad-eyebrow {
  margin: 0;
  color: rgba(255, 255, 255, .62);
  font-size: clamp(11px, 1.2vw, 15px);
  font-weight: 600;
  letter-spacing: .24em;
  text-transform: uppercase;
}
.game-ad-line { margin: 0; font-size: clamp(15px, 2vw, 28px); font-weight: 600; }
.game-ad-link {
  margin: 0;
  color: #ffd7a1;
  font-size: clamp(13px, 1.6vw, 22px);
  font-weight: 700;
  letter-spacing: .02em;
}

/* Luật chơi (viết cho người chơi) — hiện lúc chờ khách quét QR, đọc được từ xa */
.game-stage-rule {
  max-width: 44ch;
  margin: 6px 0 0;
  color: rgba(255, 255, 255, .82);
  font-size: clamp(13px, 1.5vw, 20px);
  line-height: 1.55;
  text-align: left;
}
.game-stage-rule[hidden] { display: none; }
/* Đóng cổng vào: bỏ ô QR thì khu chơi được rộng hơn */
.game-stage.is-noqr .game-stage-main { gap: 0; }
.game-stage.is-noqr .game-stage-side { max-width: min(900px, 92vw); }

/* Đáp án đúng sau khi lật */
.game-vote-col.is-right .game-vote-bar span { background: linear-gradient(180deg, #b6f0c8, #57c98a); }
.game-vote-col.is-right .game-vote-name { color: #9fe3bf; }
.game-vote-col.is-right .game-vote-num { color: #9fe3bf; }

/* Oản tù tì trên màn chiếu */
.game-hand {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(12px, 3vw, 40px);
  align-items: center;
  justify-content: center;
  width: min(1000px, 92vw);
}
.game-hand[hidden] { display: none; }
.game-hand-col {
  display: grid;
  gap: 2px;
  justify-items: center;
  padding: clamp(8px, 1.2vw, 16px) clamp(12px, 2vw, 26px);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 18px;
  background: rgba(255, 255, 255, .06);
}
.game-hand-col.is-right {
  border-color: rgba(159, 227, 191, .8);
  background: rgba(159, 227, 191, .16);
}
/* tay của màn hình: hổ phách, để khỏi nhầm với tay thắng (màu xanh) */
.game-hand-col.is-screen {
  border-color: rgba(255, 210, 140, .8);
  background: rgba(255, 210, 140, .16);
}
.game-hand-icon { margin: 0; font-size: clamp(28px, 4.5vw, 64px); line-height: 1; }
.game-hand-name { margin: 0; font-size: clamp(13px, 1.6vw, 20px); font-weight: 600; }
.game-hand-screen {
  display: grid;
  gap: 4px;
  justify-items: center;
  min-width: min(320px, 70vw);
}
.game-hand-kicker {
  margin: 0;
  color: rgba(255, 255, 255, .7);
  font-size: clamp(12px, 1.4vw, 18px);
  font-weight: 600;
  letter-spacing: .24em;
  text-transform: uppercase;
}
.game-hand-big {
  margin: 0;
  font-size: clamp(44px, 7.2vw, 112px);
  font-weight: 700;
  line-height: 1.1;
}
.game-hand-win { margin: 0; font-size: clamp(14px, 2vw, 26px); font-weight: 600; }

/* Máy đang chuẩn bị ra tay: ô của máy to hẳn, bàn tay chạy liên tục kèm đồng hồ đếm ngược;
   3 giây cuối đổi sang màu đỏ và đập mạnh để cả phòng biết sắp lật (user yêu cầu 2026-09-24). */
.game-hand-screen.is-waiting {
  padding: clamp(10px, 1.6vw, 22px) clamp(18px, 3vw, 40px);
  border: 2px dashed rgba(255, 210, 140, .5);
  border-radius: 26px;
  background: rgba(255, 210, 140, .08);
}
.game-hand-screen.is-waiting .game-hand-big {
  font-size: clamp(56px, 9.5vw, 136px);
  animation: game-roll .5s ease-in-out infinite;
}
.game-hand-count {
  margin: 0;
  color: #ffd7a1;
  font-size: clamp(30px, 5vw, 76px);
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.game-hand-screen.is-ready {
  border-color: rgba(253, 142, 134, .9);
  background: rgba(253, 142, 134, .14);
  animation: game-ready .5s ease-in-out infinite;
}
.game-hand-screen.is-ready .game-hand-count { color: #ffb3ad; }
.game-hand-screen.is-ready .game-hand-big { animation-duration: .24s; }
@keyframes game-roll { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }
@keyframes game-ready { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }

/* Lật xong: cột SAI tối đi, cột ĐÚNG nảy lên rồi sáng nhấp nháy */
.game-vote-col.is-wrong,
.game-cup.is-wrong,
.game-hand-col.is-wrong {
  opacity: .32;
  filter: grayscale(.7);
  transition: opacity .5s ease, filter .5s ease;
}
.game-vote-col.is-right { animation: game-pop .7s cubic-bezier(.2, 1.4, .4, 1); }
.game-cup.is-right .game-cup-in { animation: game-pop .7s cubic-bezier(.2, 1.4, .4, 1); }
.game-hand-col.is-right {
  animation: game-pop .7s cubic-bezier(.2, 1.4, .4, 1), game-right 1.8s ease-in-out .7s infinite;
}
@keyframes game-pop { 0% { transform: scale(1); } 35% { transform: scale(1.14); } 100% { transform: scale(1); } }
@keyframes game-right {
  0%, 100% { box-shadow: 0 0 0 2px rgba(159, 227, 191, .45), 0 0 22px rgba(87, 201, 138, .3); }
  50% { box-shadow: 0 0 0 3px rgba(159, 227, 191, .85), 0 0 46px rgba(87, 201, 138, .6); }
}

/* Lật xong: ai ra tay gì — người thắng đứng trước và sáng, người thua tối đi */
.game-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  justify-content: center;
  width: min(1000px, 92vw);
  max-height: 20vh;
  overflow: hidden;
}
.game-picks[hidden] { display: none; }
.game-pick {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  font-size: clamp(12px, 1.5vw, 19px);
}
.game-pick-hand { font-size: 1.3em; line-height: 1; }
.game-pick.is-win {
  border-color: rgba(159, 227, 191, .8);
  background: rgba(159, 227, 191, .18);
  color: #d8f7e6;
  animation: game-pop .7s cubic-bezier(.2, 1.4, .4, 1);
}
.game-pick.is-tie { opacity: .7; }
.game-pick.is-lose { opacity: .38; filter: grayscale(.6); }

/* Đoán bóng trong cốc trên màn chiếu: mỗi cốc rộng 1/n khung, đổi chỗ bằng biến --pos */
.game-cups {
  position: relative;
  /* Khung rộng theo SỐ CỐC: 3 cốc thì đứng sát nhau, 8 cốc mới trải hết bề ngang */
  --n: 3;
  --move: 460ms;
  width: min(calc(var(--n) * clamp(100px, 12vw, 172px)), 94vw);
  height: clamp(150px, 26vh, 260px);
}
.game-cups[hidden] { display: none; }
.game-cup {
  position: absolute;
  top: 0;
  left: 0;
  width: calc(100% / var(--n));
  height: 100%;
  transform: translateX(calc(var(--pos) * 100%));
  transition: transform var(--move) cubic-bezier(.4, .05, .3, 1);
}
.game-cup-in {
  display: grid;
  align-content: end;
  justify-items: center;
  gap: 4px;
  height: 100%;
}
.game-cup-in.is-hop { animation: game-cup-hop var(--move) ease-in-out; }
.game-cup-in.is-dip { animation: game-cup-dip var(--move) ease-in-out; }
@keyframes game-cup-hop { 50% { transform: translateY(-22%) scale(1.04); } }
@keyframes game-cup-dip { 50% { transform: translateY(10%) scale(.94); } }
/* Chỗ đặt cốc: cốc và quả bóng chồng lên nhau, cốc luôn nằm TRÊN (z-index) để bóng bị che tới lúc nhấc cốc */
.game-cup-seat {
  position: relative;
  width: min(82%, 132px);
  height: clamp(74px, 14vh, 136px);
}
/* Bóng đổ trên mặt bàn: nằm yên khi nhấc cốc lên */
.game-cup-seat::after {
  content: '';
  position: absolute;
  z-index: 0;
  left: 6%;
  right: 6%;
  bottom: -6px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, .5), transparent 70%);
}
/* Cái cốc: hình thang úp, số in trên thân */
.game-cup-body {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  clip-path: polygon(20% 0, 80% 0, 100% 100%, 0 100%);
  background: linear-gradient(160deg, #ffd7a1, #fd8e86 62%, #c9605c);
  box-shadow: inset 0 -10px 18px rgba(0, 0, 0, .22);
  transition: transform .5s cubic-bezier(.2, 1.2, .4, 1);
}
/* Miệng cốc (bị chính clip-path của thân cắt gọn hai bên nên vừa khít) */
.game-cup-body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 18%;
  right: 18%;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .5);
}
.game-cup-no {
  color: #3a1b19;
  font-size: clamp(20px, 3vw, 40px);
  font-weight: 800;
  transform: translateY(12%);
}
/* Đánh số sau khi trộn xong: số dập xuống từng cốc */
.game-cups.is-numbered .game-cup-no { animation: game-no-in .45s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes game-no-in {
  from { opacity: 0; transform: translateY(12%) scale(2.2); }
  to { opacity: 1; transform: translateY(12%) scale(1); }
}
/* Chưa đánh số thì chưa ai chọn được -> giấu luôn ô đếm cho đỡ rối mắt lúc trộn */
.game-cups:not(.is-numbered) .game-vote-num { visibility: hidden; }
/* Đang diễn lại đường trộn: cốc đổi chỗ bằng transition; mở trang giữa chừng thì nhảy thẳng tới nơi */
.game-cup.is-jump { transition: none; }
/* Hé cốc lúc đầu lượt cho cả phòng thấy quả bóng */
.game-cups.is-peek .game-cup.has-ball .game-cup-body { transform: translateY(-62%) rotate(-14deg); }
/* Quả bóng nằm dưới cốc: chỉ lộ ra khi nhấc cốc lên */
.game-cup-ball {
  position: absolute;
  bottom: 4px;
  left: 50%;
  width: clamp(26px, 4vw, 46px);
  height: clamp(26px, 4vw, 46px);
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #fff6d8, #ffd05a 42%, #e08a2a);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .4);
  z-index: 1;
  opacity: 0;
  transform: translateX(-50%) scale(.4);
  transition: opacity .35s ease .25s, transform .45s cubic-bezier(.2, 1.5, .4, 1) .25s;
}
.game-cup.has-ball .game-cup-ball { opacity: 1; transform: translateX(-50%) scale(1); }
/* Lật cốc: nhấc tất cả lên, cốc có bóng nhấc cao và nghiêng hẳn */
.game-cups.is-open .game-cup-body { transform: translateY(-34%) rotate(-8deg); }
.game-cups.is-open .game-cup.has-ball .game-cup-body { transform: translateY(-62%) rotate(-16deg); }
.game-cup.is-right .game-cup-body { box-shadow: inset 0 -10px 18px rgba(0, 0, 0, .2), 0 0 32px rgba(255, 208, 90, .75); }

/* Vòng quay may mắn trên màn chiếu */
.game-wheel {
  display: grid;
  gap: 8px;
  justify-items: center;
  width: min(1000px, 92vw);
}
.game-wheel[hidden] { display: none; }
.game-wheel-hold {
  position: relative;
  width: clamp(240px, 42vh, 460px);
  height: clamp(240px, 42vh, 460px);
}
.game-wheel-disc {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 6px solid rgba(255, 255, 255, .9);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
  overflow: hidden;
}
/* Mỗi nhãn là một lớp phủ kín vòng, xoay theo múi rồi ghim chữ lên sát vành */
.game-wheel-label {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  padding-top: 10px;
}
.game-wheel-label span {
  max-width: 38%;
  overflow: hidden;
  color: #2a1614;
  font-size: clamp(10px, 1.3vw, 17px);
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
  text-overflow: ellipsis;
}
/* Mũi tên chỉ ô trúng, ghim ở đỉnh vòng */
.game-wheel-pin {
  position: absolute;
  top: -14px;
  left: 50%;
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 26px solid #fff;
  transform: translateX(-50%);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .5));
}
.game-wheel-out {
  margin: 0;
  color: #ffd7a1;
  font-size: clamp(22px, 4vw, 54px);
  font-weight: 800;
  text-align: center;
}
.game-wheel-out[hidden] { display: none; }
.game-wheel.is-landed .game-wheel-out { animation: game-pop .7s cubic-bezier(.2, 1.4, .4, 1); }
.game-wheel.is-landed .game-wheel-disc { box-shadow: 0 20px 60px rgba(0, 0, 0, .5), 0 0 50px rgba(255, 215, 161, .5); }

/* Bingo cưới trên màn chiếu */
.game-bingo {
  display: grid;
  gap: 6px;
  justify-items: center;
  width: min(1000px, 92vw);
  text-align: center;
}
.game-bingo[hidden] { display: none; }
.game-bingo-kicker {
  margin: 0;
  color: rgba(255, 255, 255, .7);
  font-size: clamp(12px, 1.5vw, 20px);
  font-weight: 600;
  letter-spacing: .24em;
  text-transform: uppercase;
}
.game-bingo-now {
  margin: 0;
  font-size: clamp(30px, 6vw, 82px);
  font-weight: 800;
  line-height: 1.1;
  animation: game-pop .7s cubic-bezier(.2, 1.4, .4, 1);
}
.game-bingo-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  justify-content: center;
  max-height: 18vh;
  overflow: hidden;
}
.game-bingo-chip {
  padding: 3px 11px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  color: rgba(255, 255, 255, .7);
  font-size: clamp(11px, 1.4vw, 18px);
}
.game-bingo-note { margin: 2px 0 0; font-size: clamp(14px, 2vw, 26px); font-weight: 700; color: #9fe3bf; }

/* Nhanh tay nhất trên màn chiếu */
.game-fast {
  display: grid;
  gap: 2px;
  justify-items: center;
  width: min(1000px, 92vw);
  padding: clamp(10px, 1.8vw, 24px) clamp(16px, 3vw, 40px);
  border: 2px dashed rgba(255, 255, 255, .22);
  border-radius: 26px;
  text-align: center;
}
.game-fast[hidden] { display: none; }
.game-fast-kicker {
  margin: 0;
  color: rgba(255, 255, 255, .7);
  font-size: clamp(12px, 1.5vw, 20px);
  font-weight: 600;
  letter-spacing: .24em;
  text-transform: uppercase;
}
.game-fast-big {
  margin: 0;
  font-size: clamp(64px, 13vw, 190px);
  font-weight: 800;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.game-fast-note { margin: 2px 0 0; color: rgba(255, 255, 255, .78); font-size: clamp(13px, 1.8vw, 24px); font-weight: 600; }
/* Bật chữ: cả khu sáng xanh cho thấy từ cuối phòng */
.game-fast.is-go {
  border-color: rgba(159, 227, 191, .9);
  border-style: solid;
  background: rgba(87, 201, 138, .16);
  box-shadow: 0 0 60px rgba(87, 201, 138, .4);
  animation: game-go .35s cubic-bezier(.2, 1.5, .4, 1);
}
.game-fast.is-go .game-fast-kicker { color: #d8f7e6; }
.game-fast.is-go .game-fast-big { color: #b6f0c8; }
@keyframes game-go { from { transform: scale(.9); } to { transform: scale(1); } }
/* Bục 3 người nhanh nhất */
.game-fast-podium {
  display: grid;
  gap: 6px;
  width: min(620px, 86vw);
  margin: 6px 0 2px;
}
.game-fast-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 6px 14px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 14px;
  background: rgba(255, 255, 255, .06);
  font-size: clamp(15px, 2.2vw, 30px);
  text-align: left;
}
.game-fast-row.is-first {
  border-color: rgba(159, 227, 191, .8);
  background: rgba(159, 227, 191, .18);
  animation: game-pop .7s cubic-bezier(.2, 1.4, .4, 1);
}
.game-fast-rank { color: #ffd7a1; font-weight: 800; }
.game-fast-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.game-fast-ms { color: rgba(255, 255, 255, .72); font-variant-numeric: tabular-nums; }

/* Đoán số gần nhất trên màn chiếu */
.game-guess {
  display: grid;
  gap: 6px;
  justify-items: center;
  width: min(1000px, 92vw);
  text-align: center;
}
.game-guess[hidden] { display: none; }
.game-guess-kicker {
  margin: 0;
  color: rgba(255, 255, 255, .7);
  font-size: clamp(12px, 1.5vw, 20px);
  font-weight: 600;
  letter-spacing: .24em;
  text-transform: uppercase;
}
.game-guess-answer {
  margin: 0;
  color: #ffd7a1;
  font-size: clamp(52px, 10vw, 140px);
  font-weight: 800;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  animation: game-pop .7s cubic-bezier(.2, 1.4, .4, 1);
}
.game-guess-note { margin: 0; font-size: clamp(14px, 2vw, 26px); font-weight: 600; }
/* Trục số: mỗi người một chấm đúng chỗ, đáp án là cột hổ phách */
.game-line {
  position: relative;
  width: min(860px, 88vw);
  height: clamp(96px, 14vh, 150px);
  margin: 8px 0 2px;
}
.game-line-bar {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .18);
}
.game-line-pin {
  position: absolute;
  top: 50%;
  display: grid;
  justify-items: center;
  gap: 3px;
  transform: translate(-50%, calc(-50% + var(--dy, 0px)));
}
.game-line-dot {
  width: clamp(12px, 1.6vw, 20px);
  height: clamp(12px, 1.6vw, 20px);
  border-radius: 50%;
  background: rgba(255, 255, 255, .45);
}
.game-line-name {
  max-width: 30vw;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .9);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(11px, 1.4vw, 18px);
  font-weight: 600;
}
.game-line-pin.is-win .game-line-dot {
  background: #9fe3bf;
  box-shadow: 0 0 18px rgba(87, 201, 138, .8);
}
.game-line-pin.is-win .game-line-name { color: #d8f7e6; }
.game-line-pin.is-answer .game-line-dot {
  width: clamp(16px, 2vw, 26px);
  height: clamp(16px, 2vw, 26px);
  background: #ffd7a1;
  box-shadow: 0 0 22px rgba(255, 215, 161, .9);
}
.game-line-pin.is-answer .game-line-name { color: #ffd7a1; font-weight: 800; }

/* Bảng điểm trên màn chiếu */
.game-scores {
  display: grid;
  gap: 6px;
  justify-items: center;
  padding: 10px 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .08);
}
.game-scores[hidden] { display: none; }
.game-scores-title {
  margin: 0;
  color: rgba(255, 255, 255, .72);
  font-size: clamp(11px, 1.2vw, 15px);
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.game-scores-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  justify-content: center;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: clamp(13px, 1.5vw, 19px);
}
.game-scores-list li { display: inline-flex; align-items: center; gap: 6px; }

/* Quay số / công bố người trúng: phủ kín màn chiếu */
.game-draw {
  position: fixed;
  inset: 0;
  z-index: 7;
  display: grid;
  place-content: center;
  gap: 10px;
  padding: 24px;
  background: rgba(8, 6, 12, .82);
  backdrop-filter: blur(6px);
  color: #fff;
  text-align: center;
  animation: game-qr-in .35s ease both;
}
.game-draw[hidden] { display: none; }
.game-draw-kicker {
  margin: 0;
  color: rgba(255, 255, 255, .7);
  font-size: clamp(14px, 2.2vw, 20px);
  font-weight: 600;
  letter-spacing: .3em;
  text-transform: uppercase;
}
.game-draw-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(40px, 11vw, 140px);
  font-weight: 600;
  line-height: 1.05;
  overflow-wrap: anywhere;
}
.game-draw.is-rolling .game-draw-name { opacity: .75; }
.game-draw-seat { margin: 0; color: rgba(255, 255, 255, .75); font-size: clamp(14px, 2vw, 22px); }

@media (prefers-reduced-motion: reduce) {
  .game-dots span, .game-stage, .game-stage-name, .game-draw { animation: none; }
  .game-vote-bar span { transition: none; }
}

/* ── Trang CHƠI THỬ (/choi-thu): màn chiếu nằm trong khung, không phủ kín màn hình ── */
.demo-page { padding: 0 0 40px; }
.demo-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  padding: 14px clamp(14px, 3vw, 32px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
}
.demo-bar-main { flex: 1; min-width: 220px; }
.demo-kicker {
  margin: 0;
  color: var(--faint);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.demo-title { margin: 2px 0 0; font-size: clamp(18px, 2.4vw, 26px); }
.demo-clock {
  margin: 0;
  padding: 6px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.demo-page.is-soon .demo-clock { border-color: rgba(253, 142, 134, .8); color: #ffb3ad; }
.demo-buy { white-space: nowrap; }

.demo-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 16px;
  padding: 16px clamp(14px, 3vw, 32px) 0;
  align-items: start;
}
.demo-tag {
  margin: 0 0 6px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}
/* Khung màn chiếu: lớp phủ mini game được JS chuyển vào đây nên phải là gốc toạ độ + cắt gọn */
.demo-screen {
  position: relative;
  aspect-ratio: 16 / 9;
  min-height: 460px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: #06050a;
  overflow: hidden;
}
/* Lớp phủ được dựng cho MÀN CHIẾU THẬT (cỡ chữ, mã QR tính theo vh) nên trong khung nhỏ của trang thử phải
   thu nhỏ cả cụm: phóng khung lên 1/0,66 rồi scale ngược về — giữ đúng bố cục, không phải sửa CSS của trò chơi. */
.demo-page .demo-screen .game-stage,
.demo-page .demo-screen .game-draw {
  position: absolute;
  width: 152%;
  height: 152%;
  left: -26%;
  top: -26%;
  transform: scale(.66);
  transform-origin: center;
}
/* Slide thật chạy nền: chỉ để xem nên không nhận chuột, mọi thao tác thuộc về lớp phủ mini game bên trên */
.demo-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none;
}
.demo-rest {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 6px;
  padding: 24px;
  text-align: center;
}
.demo-rest {
  align-content: end;
  background: linear-gradient(0deg, rgba(6, 5, 10, .85), transparent 60%);
}
.demo-rest-kicker { margin: 0; color: rgba(255, 255, 255, .72); font-size: 13px; letter-spacing: .16em; text-transform: uppercase; }
.demo-rest-text { margin: 0; max-width: 40ch; color: rgba(255, 255, 255, .88); font-size: 14px; line-height: 1.6; }
/* Hết giờ: che khung màn chiếu và mời mở phòng mới */
.demo-over {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  padding: 24px;
  background: rgba(6, 5, 10, .92);
  text-align: center;
}
.demo-over-title { margin: 0; font-size: clamp(20px, 3vw, 30px); font-weight: 700; }
.demo-over-text { margin: 0; max-width: 40ch; color: var(--muted); line-height: 1.6; }

.demo-join { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 10px 0 0; }
.demo-join .help { flex: 1; min-width: 200px; margin: 0; }
.demo-side { display: grid; gap: 8px; }
.demo-host {
  width: 100%;
  height: min(78vh, 760px);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: #06050a;
}
.demo-host-open { justify-self: start; }

.demo-how {
  max-width: 880px;
  margin: 26px auto 0;
  padding: 0 clamp(14px, 3vw, 32px);
}
.demo-how h2 { margin: 0 0 10px; font-size: 19px; }
.demo-how ol { margin: 0; padding-left: 22px; color: var(--muted); font-size: 15px; line-height: 1.7; }
.demo-how li + li { margin-top: 6px; }
.demo-how .help { margin: 12px 0 0; }
.demo-cta { margin: 16px 0 0; }

@media (max-width: 980px) {
  .demo-wrap { grid-template-columns: minmax(0, 1fr); }
  /* Trên điện thoại KHÔNG giữ tỉ lệ 16/9: min-height + aspect-ratio làm ô rộng hơn màn (533px trên máy 400px)
     nên cả trang cuộn ngang. Để chiều cao dẫn dắt, bề ngang bám cột. */
  .demo-screen {
    aspect-ratio: auto;
    width: 100%;
    height: min(58vh, 420px);
    min-height: 260px;
  }
  .demo-host { height: 70vh; }
}
