/* Design tokens: copied verbatim from .ai/output/design-system/tokens.css (17/11/2026). Keep in sync until a shared tokens file ships. */
:root {
  /* ---- Màu nền + chữ (lớp áo phẳng: cổng, cửa hàng, danh sách) ---- */
  --ds-bg: #f2f4f5;
  --ds-surface: #ffffff;
  --ds-surface-2: #f7f8f9;
  --ds-line: #e3e5e8;
  --ds-line-strong: #c9ccd1;
  --ds-text: #191b1d;
  --ds-text-muted: #606368;

  /* ---- Màu hành động ---- */
  --ds-primary: #335fff;       /* Nút chính, đang chọn */
  --ds-primary-soft: #eef2ff;
  --ds-play: #00a862;          /* Nút Chơi, thành công */
  --ds-play-dark: #008f53;
  --ds-danger: #e5374f;
  --ds-warn: #ffb020;
  --ds-brand: #6c4dff;         /* Tím logo: chỉ làm điểm nhấn nhỏ */

  /* ---- Tiền tệ ---- */
  --ds-coin: #b87400;
  --ds-gem: #0a8fd0;
  --ds-medal-1: #f5b800; --ds-medal-2: #b4bcc6; --ds-medal-3: #d08a4e;  /* Rank podium (design system 17/11/2026) */

  /* ---- Độ hiếm ---- */
  --ds-r-common: #7d8590;
  --ds-r-rare: #335fff;
  --ds-r-epic: #8a5cff;
  --ds-r-legend: #f09a1c;
  --ds-r-mythic: #e5374f;

  /* ---- Loại chế độ chơi (vạch trái thẻ .big) ---- */
  --ds-m-online: #335fff;
  --ds-m-ai: #e5374f;
  --ds-m-local: #00a862;
  --ds-m-resume: #ffb020;
  --ds-m-practice: #8a5cff;
  --ds-m-ladder: #ff7a1a;

  /* ---- Lớp áo tranh vẽ (trang chủ game toàn màn hình, HUD trong trận) ---- */
  --ds-ink: #4a2a14;                       /* Viền nâu đậm của hình vẽ */
  --ds-glass: rgba(20, 60, 90, .78);       /* Chip xu / kim cương trên tranh */
  --ds-glass-line: rgba(255, 255, 255, .55);
  --ds-glass-soft: rgba(5, 38, 70, .22);   /* Thẻ thông tin trong trận: nhỏ, trong suốt */
  --ds-wood: #7a4a1c;
  --ds-gold: #d8a13a;
  --ds-playpill: linear-gradient(#8aea5a, #2fae2a 60%, #238a22);
  --ds-playpill-ink: #1d6a1d;
  --ds-plus: linear-gradient(#ffd36a, #f09a1c);
  --ds-stroke-dark: #1d3a5a;               /* Viền chữ trắng trên tranh */

  /* ---- Chữ ---- */
  --ds-font: "Builder Sans", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ds-font-display: "Arial Rounded MT Bold", system-ui, sans-serif;
  --ds-fs-xs: 12px;   /* Nhỏ nhất người chơi phải đọc */
  --ds-fs-sm: 13px;
  --ds-fs-md: 15px;
  --ds-fs-lg: 17px;
  --ds-fs-xl: 22px;
  --ds-fs-2xl: 30px;

  /* ---- Khoảng cách (bội số 4) ---- */
  --ds-s1: 4px; --ds-s2: 8px; --ds-s3: 12px; --ds-s4: 16px; --ds-s5: 24px; --ds-s6: 32px;

  /* ---- Bo góc: thang các game đang dùng thật (8 / 14 / 18 có ở gần như mọi game) ---- */
  --ds-r-xs: 6px;     /* Chip, nhãn */
  --ds-r-sm: 8px;     /* Ô nhỏ, hàng giá trong thẻ món */
  --ds-r-md: 10px;    /* Nút nhỏ */
  --ds-r-lg: 12px;    /* Thẻ, nút chế độ */
  --ds-r-xl: 14px;    /* Nút phụ kiểu cũ, thanh nổi */
  --ds-r-2xl: 16px;   /* Thẻ món */
  --ds-r-3xl: 18px;   /* Hộp thoại */
  --ds-r-pill: 999px;
  /* Cỡ lẻ (2, 3, 4, 5, 7, 9, 11, 13, 15…) làm tròn về bậc gần nhất khi sửa tới file đó */

  /* ---- Bóng ---- */
  --ds-sh-0: none;                                   /* Lớp áo phẳng: không bóng */
  --ds-sh-pop: 0 10px 30px rgba(0, 0, 0, .18);       /* Hộp thoại, bảng nổi */
  --ds-sh-art: 0 3px 6px rgba(0, 0, 0, .4);          /* Vật trên tranh */

  /* ---- Kích thước chạm ---- */
  --ds-tap: 44px;        /* Ô chạm tối thiểu trên điện thoại */
  --ds-tap-small: 32px;  /* Nút phụ vẽ nhỏ, vùng chạm vẫn nới ra 44px */

  /* ---- Lớp xếp chồng (đang dùng trong shell + game) ---- */
  --ds-z-home: 5;      /* Trang chủ tranh vẽ phủ màn */
  --ds-z-bar: 45;      /* Thanh cập nhật, thanh nổi */
  --ds-z-rotate: 70;   /* Nút quay lại khi trang bị xoay */
  --ds-z-modal: 80;
  --ds-z-toast: 90;

  /* ---- Vùng an toàn (sdk/land.js đặt lại khi trang bị xoay) ---- */
  --ds-safe-l: var(--sal, env(safe-area-inset-left));
  --ds-safe-t: var(--sat, env(safe-area-inset-top));
  --ds-safe-r: var(--sar, env(safe-area-inset-right));
  --ds-safe-b: var(--sab, env(safe-area-inset-bottom));

  /* ---- Trạng thái độ chín / đồng hồ (Quán Nhỏ Ven Đường là nguồn) ---- */
  --ds-st-wait: #ffb020;   /* Chưa xong */
  --ds-st-ok: #00a862;     /* Đúng lúc */
  --ds-st-bad: #e5374f;    /* Quá tay */

  /* ---- Chuyển động ---- */
  --ds-t-fast: .12s;
  --ds-t-mid: .25s;
  --ds-press: scale(.96);
}
/* ================= Chợ Quê — MonBlock (base copied from Xếp Cốc Màu) ================= */
:root {
  --bg: #0d1117;
  --panel: #151c26;
  --panel-2: #1b2431;
  --line: #2b3646;
  --txt: #e8eef6;
  --muted: #93a3b8;
  --accent: #ffcf5a;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--txt);
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.hidden { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--accent); }
.wrap { max-width: 640px; margin: 0 auto; padding: 8px 14px 28px; }
.screen { animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
h2 { font-size: 17px; margin: 18px 0 10px; }
.note { color: var(--muted); font-size: 13px; line-height: 1.5; }
body.touch .no-touch { display: none; }

/* ---------- trang chủ ---------- */
.xpbar { height: 6px; border-radius: 9px; background: var(--panel-2); overflow: hidden; }
.xpbar i { display: block; height: 100%; width: 0; background: #4f86ff; border-radius: 9px; }

.big { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; margin: 0 0 10px; padding: 15px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); font-size: 17px; font-weight: 800; text-align: left; }
.big small { color: var(--muted); font-size: 13px; font-weight: 600; }
.big-daily.done small { color: #00a862; }

/* ---------- chọn độ khó ---------- */
.variants { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin-top: 6px; }
.variant { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); text-align: left; }
.variant.on { border-color: #335fff; box-shadow: inset 0 0 0 1px #335fff; }
.variant > i { font-size: 30px; font-style: normal; line-height: 1; }
.variant span { display: flex; flex-direction: column; gap: 3px; }
.variant b { font-size: 16px; }
.variant small { color: var(--muted); font-size: 13px; line-height: 1.4; }
.variant em { color: #b87400; font-size: 12px; font-style: normal; font-weight: 800; }

/* ---------- cửa hàng ---------- */
.shop-top { display: flex; justify-content: flex-end; gap: 16px; margin: 4px 0; font-size: 17px; font-weight: 800; }
.gem-chip b { color: #7fd8ff; }
.shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 8px 12px; border: 1px solid var(--ds-line); border-radius: 16px; background: var(--panel); text-align: center; }
.item.locked { opacity: .55; }
.item b { font-size: 14px; }
.item .rar { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; }
.item .act { padding: 2px 8px; border-radius: 6px; font-size: 13px; font-weight: 800; color: var(--muted); }
.gem { color: #7fd8ff; }
.buyprev { display: flex; justify-content: center; margin: 4px 0 8px; }

/* ---------- xếp hạng ---------- */
.tabs { display: flex; gap: 6px; margin: 6px 0 10px; }
.tabs button { flex: 1; padding: 10px 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); font-weight: 800; font-size: 14px; }
.rank .row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.rank .no { width: 28px; color: var(--muted); font-weight: 800; text-align: center; }
.rank .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.rank .nm small { color: var(--muted); font-weight: 600; }
.rank .sc { font-weight: 900; color: #b87400; }

.help { line-height: 1.6; }
.help ul { padding-left: 20px; }

/* ---------- hộp thoại ---------- */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(5, 8, 12, .72); }
.dialog { width: min(420px, 100%); max-height: calc(100dvh - 32px); overflow: auto; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
.dialog h3 { margin: 0 0 8px; font-size: 20px; }
.dialog p { line-height: 1.5; }
.dialog .score { margin: 4px 0; font-size: 40px; font-weight: 900; text-align: center; font-variant-numeric: tabular-nums; }
.dialog .rw { padding-left: 18px; line-height: 1.8; font-weight: 700; }
.dlg-btns { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.dlg-btns button { padding: 10px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); font-weight: 800; }
.toast { position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 90; transform: translateX(-50%); padding: 10px 16px; border-radius: 12px; background: #222c3a; font-weight: 700; }
.updatebar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 45; display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-2); }
.updatebar button { padding: 8px 12px; border: 0; border-radius: 10px; font-weight: 800; }

h2 { font-size: 16px; margin: 16px 0 8px; }
.big-resume { --bar: #ffb020; }
.big-play { --bar: #00a862; }
.big-daily { --bar: #335fff; }
.big-daily.done small { color: #00a862; }
.item { position: relative; }
.item .pay { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%; }
.item .pr { font-size: 13px; font-weight: 800; color: #191b1d; }
.item .pr.on { color: #00a862; }
.item .pr.g { color: #1a8fd8; }
.item .pr.gh { color: var(--muted); font-weight: 600; font-size: 12px; }
.item.poor .pay { opacity: .5; }

/* ---------- chọn màn ---------- */
.mapcard { margin: 0 0 14px; border-radius: 16px; overflow: hidden; background: #fff; border: 1px solid var(--ds-line); scroll-margin-top: 70px; }
.mapcard.locked { opacity: 1; }
/* Map header = the market's own painting, darkened on the left so the name reads */
.mhead { display: flex; align-items: center; gap: 10px; min-height: 92px; padding: 12px 14px; background-color: #6b2a1c; background-size: cover; background-position: center 55%; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .7); }
.mhead .mini { position: relative; display: flex; flex: none; }
.mhead .mini .tile { position: relative; --ts: 40px; margin-left: -10px; }
.mhead .mini .tile:first-child { margin-left: 0; }
.mhead .mini .tile:nth-child(2) { transform: translateY(-5px); }
.mhead .ob { display: inline-block; margin-top: 3px; padding: 1px 8px; border-radius: 999px; background: #ffd54a; color: #4a2a14; font-size: 12px; font-weight: 900; text-shadow: none; }
.mhead span.mt { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.mhead b { font-size: 17px; }
.mhead small { font-size: 13px; font-weight: 700; opacity: .92; }
.mhead .mc { font-weight: 900; font-size: 15px; white-space: nowrap; }
.lvgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 12px; }
.lv { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 54px; justify-content: center; padding: 6px 2px; border: 1px solid var(--ds-line); border-radius: var(--ds-r-md, 12px); background: var(--ds-surface); font-weight: 900; color: var(--ds-text); }
.lv b { font-size: 17px; }
.lv small { font-size: 12px; font-weight: 800; letter-spacing: 1px; color: var(--ds-line-strong); }
.lv small i { font-style: normal; color: var(--ds-medal-1); }
.lv.done { background: var(--ds-primary-soft); border-color: var(--ds-primary-soft); }
.lv.clean { background: var(--ds-surface); border-color: var(--ds-medal-1); color: var(--ds-text); }
.lv.cur { border-color: var(--ds-primary); box-shadow: 0 0 0 2px var(--ds-primary); }
.lv:disabled { opacity: .6; background: #f0f1f2; border-color: #e3e5e8; color: #9aa0a6; }

/* ---------- hộp kết quả ---------- */
.dialog.win { text-align: center; }
.dialog.win .wm { display: block; width: 104px; height: 104px; margin: -4px auto 0; animation: cheer 1.4s ease-in-out infinite; }
@keyframes cheer { 50% { transform: translateY(-6px) rotate(3deg); } }
.dialog.win h3 { margin: 4px 0 2px; font-size: 26px; font-weight: 900; color: #2f8f1f; }
.dialog.win .ans { margin: 0 0 8px; font-size: 22px; font-weight: 900; color: var(--ds-text); }
.wstars { display: flex; justify-content: center; gap: 6px; margin: 4px 0 6px; }
.wstars .mbi { width: 44px; height: 44px; opacity: .25; filter: grayscale(1); }
.wstars .mbi.on { opacity: 1; filter: none; animation: starIn .5s ease backwards; }
.wstars .mbi.on:nth-child(2) { animation-delay: .15s; } .wstars .mbi.on:nth-child(3) { animation-delay: .3s; }
@keyframes starIn { from { transform: scale(0) rotate(-40deg); } }
.wchips { display: flex; justify-content: center; gap: 8px; margin: 2px 0 6px; flex-wrap: wrap; }
.wc { display: flex; align-items: center; gap: 4px; padding: 5px 11px 5px 7px; border-radius: 999px; background: var(--ds-surface); border: 1px solid var(--ds-line-strong); font-size: 17px; color: var(--ds-text); }
.wc i { font-style: normal; font-size: 20px; line-height: 1; }
.wc i .mb-coin { width: 22px; height: 22px; vertical-align: -4px; }
.wc .mbi { width: 22px; height: 22px; }
.wc b { font-weight: 900; }
.wc small { font-size: 12px; font-weight: 800; color: var(--ds-text-muted); }
.wtags { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.wtags span { padding: 3px 10px; border-radius: 999px; background: var(--ds-primary-soft); color: var(--ds-primary); font-size: 12px; font-weight: 800; }
.dialog .evtag, .item .evtag { font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--ds-primary-soft); color: var(--ds-primary); }
.dialog.win .more { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 16px; padding: 14px; border: 0; border-radius: 999px;
  background: linear-gradient(#7ed957, #2f9e2a); color: #fff; font-size: 20px; font-weight: 900; box-shadow: inset 0 3px 0 rgba(255, 255, 255, .45), 0 5px 0 #1d6b18; text-shadow: 0 2px 0 #1d6b18; }
.dialog.win .more:active { transform: translateY(3px); box-shadow: inset 0 3px 0 rgba(255, 255, 255, .45), 0 2px 0 #1d6b18; }
.dialog.win .more .mbi { width: 30px; height: 30px; flex: none; }
.wbtns { display: flex; gap: 8px; margin-top: 14px; }
.dialog.win .wbtns .more { flex: 1; margin-top: 0; }
.wshare { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; width: 76px; padding: 6px 4px; border: 0; border-radius: 18px;
  background: linear-gradient(#5aa8ff, #2f6fe0); color: #fff; font-size: 13px; font-weight: 900; box-shadow: inset 0 3px 0 rgba(255, 255, 255, .4), 0 5px 0 #1a4aa8; }
.wshare:active { transform: translateY(3px); box-shadow: inset 0 3px 0 rgba(255, 255, 255, .4), 0 2px 0 #1a4aa8; }
.wshare .mbi { width: 26px; height: 26px; }
.wshare .mbi * { stroke: #fff; }
.modal:has(.dialog.win) { place-items: safe center; overflow-y: auto; }
.dialog.win { background: #fffdf5; }
.dialog.win .wsub { margin: 0 0 6px; font-size: 14px; color: var(--ds-text-muted); font-weight: 700; }
.dialog .buyprev { display: flex; justify-content: center; margin: 6px 0 10px; }
.dialog .buyprev .boostpv { width: 100px; height: 100px; }
.dialog .stuck-tip { margin: 6px 0; color: var(--ds-text-muted); font-weight: 700; }
@media (max-width: 380px) { .ctl button { font-size: 11px; } }


/* ===== Trang chủ tranh vẽ (design system 17/11/2026 — bố cục chuẩn: ‹ trên trái, loa + sách trên phải, logo + CHƠI, 4 ô đáy) ===== */
#scHome { position: fixed; inset: 0; z-index: 5; overflow: hidden; padding: 0; max-width: none; background: #f3e4c4; animation: none; container-type: size; }
#scHome .hm-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center top; }
body:has(#scHome:not(.hidden)) .mb-nav { display: none !important; }
#scHome button { -webkit-appearance: none; appearance: none; font-family: inherit; }
.hm-back, .hm-gear { position: absolute; top: max(10px, env(safe-area-inset-top)); width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; padding: 0; box-shadow: 0 3px 6px rgba(0, 0, 0, .35); }
.hm-back { left: max(10px, env(safe-area-inset-left)); background: #fff; border: 3px solid #e3e5e8; color: #191b1d; font: 700 28px/1 system-ui; padding-bottom: 4px; }
.hm-gear { right: max(10px, env(safe-area-inset-right)); border-radius: 12px; background: linear-gradient(#5ab4ff, #2a6fd8); border: 3px solid #e8f7ff; color: #fff; }
.hm-gear svg { width: 26px; height: 26px; display: block; }
.hm-mute { display: none; position: absolute; left: 7px; right: 7px; top: 50%; height: 3px; background: #ff4d4d; border-radius: 2px; transform: rotate(-45deg); }
.hm-gear.off .hm-mute { display: block; }
.hm-book { top: calc(max(10px, env(safe-area-inset-top)) + 54px); border-radius: 50%; }
.hm-top { position: absolute; left: calc(max(10px, env(safe-area-inset-left)) + 52px); top: max(10px, env(safe-area-inset-top)); display: flex; align-items: center; gap: 8px; }
.hm-av { position: relative; flex: none; width: 52px; height: 52px; padding: 0; border-radius: 50%; border: 3px solid #d8a13a; background: #fff3d6; display: grid; place-items: center; box-shadow: 0 3px 6px rgba(0, 0, 0, .35); cursor: pointer; }
.hm-av .me-avemo { position: absolute; inset: 0; display: grid; place-items: center; font-size: 28px; line-height: 1; border-radius: 50%; overflow: hidden; color: var(--px, #e5484d); font-weight: 900; }
.hm-lv { position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); padding: 1px 8px; border-radius: 8px; background: #7a4a1c; border: 2px solid #d8a13a; color: #fff; font: 900 12px/1.2 system-ui, sans-serif; white-space: nowrap; }
.hm-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.hm-xp, .hm-pts { display: none; }
.hm-bar { display: flex; align-items: center; gap: 4px; min-width: 84px; height: 32px; padding: 0 10px 0 4px; border-radius: 16px; background: rgba(20, 60, 90, .78); border: 2px solid rgba(255, 255, 255, .55); }
.hm-bar img { width: 24px; height: auto; flex: none; }
.hm-bar b { flex: 1; color: #fff !important; font: 900 14px/1 system-ui, sans-serif; text-align: center; }
.hm-stack { position: absolute; left: 0; right: 0; top: calc(max(10px, env(safe-area-inset-top)) + 64px); bottom: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.6cqh; padding: 0 5cqw; }
.hm-logo { flex: 0 1 auto; min-height: 0; max-height: 16cqh; max-width: 84cqw; width: auto; height: auto; filter: drop-shadow(0 5px 6px rgba(0, 0, 0, .3)); pointer-events: none; }
.hm-hero { flex: 0 1 auto; min-height: 0; max-height: 28cqh; max-width: 72cqw; width: auto; height: auto; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .25)); pointer-events: none; }
.hm-play { flex: none; width: min(70cqw, 330px); padding: 1.2cqh 3cqw 1.4cqh; border-radius: 999px; text-align: center; color: #fff; background: linear-gradient(#8aea5a, #2fae2a 60%, #238a22); border: 4px solid #fff5cf; box-shadow: 0 5px 0 #1b6b1a, 0 9px 12px rgba(0, 0, 0, .35); }
.hm-play b { display: block; font: 900 clamp(26px, 5.2cqh, 44px)/1.05 "Arial Rounded MT Bold", system-ui, sans-serif; -webkit-text-stroke: .12em #1d6a1d; paint-order: stroke fill; letter-spacing: 2px; }
.hm-play small { display: block; font: 900 clamp(12px, 1.8cqh, 15px)/1.2 system-ui, sans-serif; -webkit-text-stroke: .2em #1d6a1d; paint-order: stroke fill; }
.hm-play:active, .hm-ic:active { transform: scale(.96); }
.hm-row { position: absolute; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: 2cqw; }
.hm-ic { position: relative; width: min(21cqw, 96px); padding: 0; background: none; border: 0; box-shadow: none; color: #fff; }
.hm-ic img { width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; display: block; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .4)); }
.hm-ic span { display: block; margin-top: -2px; text-align: center; font: 900 clamp(12px, 1.7cqh, 14px)/1.1 system-ui, sans-serif; -webkit-text-stroke: .22em var(--ds-stroke-dark); paint-order: stroke fill; white-space: nowrap; }
.hm-dot { position: absolute; top: 2px; right: 2px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; background: #e5374f; border: 2px solid #fff; color: #fff; font: 900 12px/18px system-ui; font-style: normal; }
.hm-dot.hidden { display: none; }
#scHome .hm-seo { position: absolute !important; width: 1px !important; height: 1px !important; margin: 0 !important; padding: 0 !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; }
#scBook a.bk-link { display: flex; align-items: center; min-height: 44px; padding: 8px 16px; border: 1px solid var(--skin-card-line, #e3e5e8); border-radius: 12px; background: var(--skin-card, #f7f8f9); color: var(--skin-ink, #191b1d); font-size: 15px; font-weight: 700; text-decoration: none; }
#scBook .bk-list, #scModes { display: flex; flex-direction: column; gap: 8px; }
#scModes .big { margin: 0; }
#scHelp .help ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; line-height: 1.4; }
.hm-dot-s { min-width: 16px; width: 16px; height: 16px; padding: 0; top: 6px; right: 10px; }
.hm-av .me-avemo .dropsvg { width: 78%; height: 78%; display: block; }
#scQuests { display: flex; flex-direction: column; gap: 10px; }
#scQuests .big { margin: 0; }
#scQuests .note { margin: 0; font-size: 14px; }
.qd-card { display: flex; flex-direction: column; gap: 4px; padding: 12px 16px; border: 1px solid #e3e5e8; border-radius: 12px; background: #f7f8f9; }
.qd-card b { font-size: 16px; }
.qd-card small { color: #606368; font-size: 14px; line-height: 1.4; }
.qd-done { margin: 4px 0 0; color: #00a862; font-size: 14px; font-weight: 800; }
/* Khung ngang thấp (điện thoại cầm ngang 844×390): logo + hình chính to hơn, gọn giữa thanh trên và 4 ô (như Người Que) */
@container (orientation: landscape) {
  .hm-stack { top: calc(max(10px, env(safe-area-inset-top)) + 58px); bottom: calc(max(10px, env(safe-area-inset-bottom)) + min(11cqw, 22cqh) + 22px); gap: 1.2cqh; }
  .hm-logo { max-height: 19cqh; max-width: 46cqw; }
  .hm-hero { max-height: 25cqh; max-width: 40cqw; }
  .hm-play { width: min(46cqw, 340px); padding: 0.8cqh 3cqw 1cqh; }
  .hm-play small { white-space: nowrap; font-size: clamp(12px, 3.2cqh, 15px); }
  .hm-play b { font-size: clamp(24px, 7cqh, 40px); }
  .hm-row { bottom: max(10px, env(safe-area-inset-bottom)); gap: 1.6cqw; }
  .hm-ic { width: min(11cqw, 22cqh, 96px); }
  .hm-ic span { font-size: clamp(12px, 3.2cqh, 14px); }
}

/* Painted market behind every screen (design system "Tranh nền sau mọi màn") */
:root { --ts: 64px; }
body.mb-light { --mb-scene: url(/choque/img/home-bg.webp); --mb-scene-on: ''; }
#btnSound .mbi { width: 22px; height: 22px; display: block; }
.big-daily .mbi { width: 22px; height: 22px; }

/* ---------- dải lối tắt dưới CHƠI (design system "Phần chung bổ sung" 1) ---------- */
.hm-go { flex: none; display: flex; align-items: stretch; margin-top: .4cqh; padding: 2px; border: 2px solid var(--ds-glass-line, rgba(255, 255, 255, .55)); border-radius: 999px; background: var(--ds-glass, rgba(20, 60, 90, .78)); }
.hm-go button { display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px 0 6px; border: 0; border-radius: 999px; background: none; color: #fff; font: 800 13px/1 system-ui, sans-serif; white-space: nowrap; box-shadow: none; }
.hm-go button + button { border-left: 1px solid rgba(255, 255, 255, .35); border-radius: 0 999px 999px 0; }
.hm-go img { width: 32px; height: 32px; flex: none; object-fit: contain; }
.hm-go button:active { transform: scale(.96); }
.hm-go button.done img { filter: grayscale(.2); }
.hm-go button.done::after { content: '✓'; margin-left: 2px; color: #7dff9a; font-weight: 900; }
#scHome .hm-logo { max-height: 20cqh; }

/* ================= Ô gỗ (dùng cho bàn chơi, khay, ô xem thử cửa hàng, đầu khu chọn màn) =================
   --ts = cạnh ô. Mặt ô (--face → --face2) + viền (--rim) + bề dày (--side) đổ xuống dưới. Kiểu ô = lớp .tl-<id> trên phần tử cha. */
.tl-go     { --face: #fbecc8; --face2: #e9cd94; --rim: #6b3f1a; --side: #b07a3e; --inner: rgba(255, 255, 255, .55); }
.tl-tre    { --face: #f4ecb0; --face2: #d9c86a; --rim: #5f5a12; --side: #9a9a2e; --inner: rgba(255, 255, 210, .6); }
.tl-su     { --face: #ffffff; --face2: #e6eef7; --rim: #1f4f9a; --side: #8fb0d8; --inner: rgba(80, 130, 210, .45); }
.tl-sonmai { --face: #fff2dc; --face2: #f3d9b0; --rim: #8c1d14; --side: #b3271c; --inner: rgba(226, 176, 64, .9); }
.tl-ngoc   { --face: #e6fbef; --face2: #b5e6c8; --rim: #1d6b4a; --side: #3f9a72; --inner: rgba(255, 255, 255, .6); }
.tl-vang   { --face: #fffaf0; --face2: #f6e2b0; --rim: #8a5a00; --side: #d9a520; --inner: rgba(255, 214, 90, .95); }
.tl-lixi   { --face: #fff0e0; --face2: #ffd7b8; --rim: #a01414; --side: #d62a1e; --inner: rgba(255, 196, 64, .95); }
.tile { position: absolute; width: var(--ts); height: calc(var(--ts) * 1.08); padding: 0; border: calc(var(--ts) * .035 + 1px) solid var(--rim); border-radius: calc(var(--ts) * .16);
  background: radial-gradient(120% 90% at 30% 20%, var(--face), var(--face2)); box-shadow: inset 0 0 0 calc(var(--ts) * .04) var(--inner), 0 calc(var(--ts) * .09) 0 var(--side), 0 calc(var(--ts) * .09 + 2px) 0 var(--rim), 0 calc(var(--ts) * .13 + 3px) calc(var(--ts) * .1) rgba(40, 14, 0, .38);
  transition: filter .18s, transform .18s; -webkit-tap-highlight-color: transparent; }
.tl-tre .tile { background: repeating-linear-gradient(90deg, transparent 0 31%, rgba(95, 90, 18, .16) 31% 33%), radial-gradient(120% 90% at 30% 20%, var(--face), var(--face2)); }
.tl-sonmai .tile, .tl-lixi .tile { background: radial-gradient(closest-side, var(--face) 70%, var(--face2) 100%); }
.tl-ngoc .tile { background: linear-gradient(135deg, rgba(255, 255, 255, .7) 0 18%, transparent 30%), radial-gradient(120% 90% at 30% 20%, var(--face), var(--face2)); }
.tile img { position: absolute; left: 9%; top: 8%; width: 82%; height: 82%; object-fit: contain; pointer-events: none; -webkit-user-drag: none; filter: drop-shadow(0 1px 1px rgba(60, 25, 0, .35)); }
/* Covered tiles go darker (mẫu A) and do not react */
.tile.cov { filter: brightness(.5) saturate(.75); }
.tile.hint { animation: hintPulse .9s ease-in-out infinite; }
@keyframes hintPulse { 50% { transform: translateY(-4px) scale(1.06); } }
.tile.bad { animation: tileShake .3s; }
@keyframes tileShake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* ---------- chướng ngại ---------- */
.tile .ob-rope { position: absolute; inset: -8%; background: url(../img/ob-day.webp) center / 100% 100% no-repeat; pointer-events: none; }
.tile .ob-ice { position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(140deg, rgba(255, 255, 255, .85) 0 12%, rgba(190, 232, 255, .55) 22%, rgba(140, 205, 245, .65) 60%, rgba(220, 245, 255, .8));
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .9); pointer-events: none; }
.tile .ob-ice::after { content: ''; position: absolute; left: 22%; top: 30%; width: 50%; height: 36%; border-top: 3px solid rgba(255, 255, 255, .95); border-left: 3px solid rgba(255, 255, 255, .7); transform: skew(-20deg); }
.tile.crack .ob-ice { animation: iceGone .35s forwards; }
@keyframes iceGone { to { opacity: 0; transform: scale(1.2); } }
/* Face-down: wooden back with a big question mark */
.tile.back { background: repeating-linear-gradient(45deg, #9a6230 0 8px, #8a5528 8px 16px); }
.tile.back img { display: none; }
.tile.back::after { content: '?'; position: absolute; inset: 0; display: grid; place-items: center; color: #ffe08a; font: 900 calc(var(--ts) * .58)/1 system-ui, sans-serif; -webkit-text-stroke: calc(var(--ts) * .05) #4a2a12; paint-order: stroke fill; }
.tile .ob-lock, .tile .ob-fuse { position: absolute; display: grid; place-items: center; pointer-events: none; font: 900 calc(var(--ts) * .26)/1 system-ui, sans-serif; color: #fff; -webkit-text-stroke: calc(var(--ts) * .04) #3a1a06; paint-order: stroke fill; }
.tile .ob-lock { inset: 14%; }
.tile .ob-lock svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.tile .ob-lock b { position: relative; top: 14%; }
.tile .ob-fuse { right: -14%; top: -16%; width: 52%; height: 52%; }
.tile .ob-fuse svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.tile .ob-fuse b { position: relative; top: 10%; }
.tile .ob-fuse.low { animation: fuseLow .5s ease-in-out infinite alternate; }
@keyframes fuseLow { to { transform: scale(1.18); } }
.tile.boom { animation: boom .5s forwards; }
@keyframes boom { 40% { transform: scale(1.3); filter: brightness(2); } to { transform: scale(.2); opacity: 0; } }

/* ================= Màn chơi (mẫu A: chợ Tết, ô gỗ, khay tre 7 ô, 3 nút tròn gỗ) ================= */
#scPlay { position: fixed; inset: 0; z-index: 5; padding: 0; max-width: none; animation: none; }
#scPlay .field { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; overflow: hidden; color: #fff; background: #5a2418; }
#scPlay .fbg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; pointer-events: none; }
#scPlay .top { position: relative; z-index: 3; display: grid; grid-template-columns: 52px 1fr 52px; align-items: center; gap: 8px; width: 100%; max-width: 560px;
  padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 0 max(10px, env(safe-area-inset-left)); }
.wbtn { width: 52px; height: 52px; padding: 0; display: grid; place-items: center; border-radius: 50%; border: 3px solid #5a3417;
  background: radial-gradient(circle at 35% 30%, #e7b878, #b67a3c 60%, #8a5526); box-shadow: inset 0 2px 0 rgba(255, 240, 200, .6), 0 4px 0 #5a3417, 0 6px 8px rgba(0, 0, 0, .35); }
.wbtn svg { width: 26px; height: 26px; fill: none; stroke: #fff8e8; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 1px 0 #5a3417); }
.wbtn:active { transform: translateY(2px); }
.plank { justify-self: center; display: flex; flex-direction: column; align-items: center; min-width: 140px; padding: 5px 22px 7px; border: 3px solid #f3c64a; border-radius: 18px;
  background: radial-gradient(circle at 50% 30%, #e2412f, #b51f17); box-shadow: inset 0 0 0 2px #7a120c, 0 4px 0 #7a120c, 0 7px 10px rgba(0, 0, 0, .35); text-align: center; }
.plank small { font: 800 12px/1.2 system-ui, sans-serif; color: #ffe7a8; }
.plank b { font: 900 24px/1.05 "Arial Rounded MT Bold", system-ui, sans-serif; color: #fff4d0; -webkit-text-stroke: 4px #6a0f08; paint-order: stroke fill; letter-spacing: 1px; }
#scPlay .nstat { position: relative; z-index: 3; min-height: 22px; margin: 6px 0 0; padding: 0 12px; font: 800 14px/1.3 system-ui, sans-serif; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .8); text-align: center; }
#scPlay .board { position: relative; z-index: 2; flex: 1 1 auto; width: 100%; min-height: 0; }
#scPlay .pile { position: absolute; left: 50%; top: 50%; }
.tile.fly { z-index: 50 !important; transition: transform .24s cubic-bezier(.3, .7, .3, 1); }
/* Khay tre */
.tr-tre   { --t1: #f0cf7a; --t2: #c8933a; --tk: #6b4318; --tin: #a77236; --tin2: #8e5d2a; }
.tr-may   { --t1: #c9935e; --t2: #8a5a2c; --tk: #4e2c10; --tin: #7a4e24; --tin2: #633d1a; }
.tr-go    { --t1: #a0582c; --t2: #6e3414; --tk: #3e1c08; --tin: #5e2e12; --tin2: #4a230c; }
.tr-dong  { --t1: #ffe08a; --t2: #c99a2a; --tk: #6a4a08; --tin: #a87a20; --tin2: #8a6214; }
.tr-sonmai { --t1: #4a2a2a; --t2: #1f1010; --tk: #e2b040; --tin: #2a1616; --tin2: #1a0c0c; }
#scPlay .tray { position: relative; z-index: 3; flex: none; width: min(96vw, 520px); margin-top: 6px; padding: 9px; border: 3px solid var(--tk); border-radius: 18px;
  background: repeating-linear-gradient(90deg, var(--t1) 0 22px, var(--t2) 22px 25px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .5), 0 5px 0 var(--tk), 0 8px 12px rgba(0, 0, 0, .35); }
.tray .slots { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; padding: 6px; border-radius: 10px; border: 2px solid var(--tk);
  background: repeating-linear-gradient(45deg, var(--tin) 0 6px, var(--tin2) 6px 12px); box-shadow: inset 0 3px 6px rgba(0, 0, 0, .35); }
.tray .slot { position: relative; aspect-ratio: 1 / 1.08; border-radius: 10px; background: rgba(0, 0, 0, .16); }
.tray .tile { position: absolute; inset: 0; width: 100%; height: 100%; }
.tray .tile.pop { animation: pop .3s forwards; }
@keyframes pop { 40% { transform: scale(1.18); filter: brightness(1.4); } to { transform: scale(0); opacity: 0; } }
.tray.full { animation: trayWarn .6s ease-in-out infinite alternate; }
@keyframes trayWarn { to { box-shadow: inset 0 2px 0 rgba(255, 255, 255, .5), 0 5px 0 var(--tk), 0 0 0 4px #ff5a3c, 0 8px 12px rgba(0, 0, 0, .35); } }
/* Ba nút tròn gỗ */
#scPlay .ctl { position: relative; z-index: 3; flex: none; display: flex; justify-content: center; gap: 22px; margin: 10px 0 0; padding-bottom: max(14px, env(safe-area-inset-bottom)); }
.rb { position: relative; width: 74px; height: 74px; padding: 0; display: grid; place-items: center; border-radius: 50%; border: 4px solid #5a3417;
  background: radial-gradient(circle at 35% 28%, #e9bd7f, #b77b3d 58%, #8a5526); box-shadow: inset 0 3px 0 rgba(255, 240, 200, .6), inset 0 -4px 0 rgba(90, 52, 23, .35), 0 5px 0 #5a3417, 0 8px 10px rgba(0, 0, 0, .35); }
.rb svg { width: 46px; height: 46px; }
.rb:active { transform: translateY(3px); }
.rb.dis { filter: grayscale(.6) brightness(.85); }
.rb u { position: absolute; top: -4px; right: -4px; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 13px; border: 2px solid #fff; background: var(--ds-play); color: #fff; font: 900 13px/22px system-ui, sans-serif; text-decoration: none; text-align: center; }
.rb u.buy { background: #e5374f; }
/* Hạt hiệu ứng khi ghép bộ ba */
.fxp { position: fixed; z-index: 60; pointer-events: none; width: 14px; height: 14px; margin: -7px 0 0 -7px; }
.fxp.star { clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); background: #ffd23a; }
.fxp.petal { border-radius: 70% 0 70% 0; background: #ff9fc0; }
.fxp.coin { border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff2a0, #f2b51c 60%, #b8820a); box-shadow: 0 0 0 1.5px #8a5a00; }
.fxp.fly { border-radius: 50%; background: radial-gradient(circle, #fffbd0, #c8ff6a 45%, rgba(160, 255, 80, 0) 70%); width: 18px; height: 18px; }
.fxp.fire { border-radius: 50%; background: radial-gradient(circle, #fff, #ffd23a 35%, #ff4a2a 70%, rgba(255, 60, 30, 0) 72%); }
/* Hộp tạm dừng / thua */
.dialog .pz { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.dialog .pz button { min-height: 48px; border: 1px solid #c9ccd1; border-radius: 12px; background: #fff; font-size: 16px; font-weight: 800; }
.dialog .pz button.pri { border-color: #00a862; background: #00a862; color: #fff; }
.dialog.lose { text-align: center; background: #fffdf5; }
.dialog.lose h3 { font-size: 24px; color: #b3271c; }
.dialog.lose .why { margin: 0 0 6px; font-weight: 700; color: var(--ds-text-muted); }
.dialog.win .wm { width: 120px; height: auto; }

/* Cửa hàng: ô xem thử dựng bằng chính lớp ô + khay */
.pv { position: relative; display: flex; justify-content: center; align-items: center; width: 100%; min-height: 96px; pointer-events: none; }
.pv .tile { position: relative; --ts: 44px; margin: 0 -4px; }
.pv .tile:nth-child(2) { transform: translateY(-6px); z-index: 1; }
.pv .tray { position: static; width: 140px; margin: 0; padding: 5px; border-width: 2px; }
.pv .tray .slots { grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 3px; }
.pv .tray .tile { margin: 0; transform: none; }
.pv-fx { gap: 6px; flex-wrap: wrap; }
.pv-fx i { position: relative; display: block; margin: 0; }
.buyprev .pv .tile { --ts: 64px; }
.buyprev .pv .tray { width: 210px; }
.boostpv { display: grid; place-items: center; }
.boostpv .rb { width: 64px; height: 64px; }
.boostpv .rb svg { width: 40px; height: 40px; }

/* Điện thoại cầm ngang (màn thấp): bàn bên trái, khay + nút bên phải */
@media (orientation: landscape) and (max-height: 560px) {
  #scPlay .field { display: grid; grid-template-columns: 1fr minmax(300px, 44vw); grid-template-rows: auto auto 1fr auto; grid-template-areas: "top top" "stat stat" "board tray" "board ctl"; justify-items: center; }
  #scPlay .top { grid-area: top; max-width: none; }
  #scPlay .nstat { grid-area: stat; margin: 2px 0 0; min-height: 18px; }
  #scPlay .board { grid-area: board; height: 100%; }
  #scPlay .tray { grid-area: tray; align-self: end; width: min(42vw, 420px); }
  #scPlay .ctl { grid-area: ctl; margin: 8px 0 0; gap: 16px; }
  .rb { width: 60px; height: 60px; }
  .rb svg { width: 38px; height: 38px; }
  .wbtn { width: 46px; height: 46px; }
  .plank { padding: 3px 18px 4px; }
  .plank b { font-size: 20px; }
  /* Short screen: the result box must show every button without scrolling */
  .dialog.win, .dialog.lose { padding: 10px 16px; }
  .dialog.win .wm { width: 64px; height: 64px; margin: 0 auto; }
  .dialog.win h3 { font-size: 21px; margin: 0; }
  .wstars { margin: 0 0 2px; }
  .dialog.win .more { padding: 9px; margin-top: 8px; }
  .dialog.win .links { margin-top: 4px; }
  .dialog.win .links button { padding: 4px; }
}

/* ===== Design system: sub-screen header + result buttons (22/11/2026) ===== */
body.mb-light.cq-sub { color: var(--ds-text); --mb-scene-veil: var(--ds-scene-veil, rgba(242, 244, 245, .66)); }
.sc-bar { position: fixed; left: 0; right: 0; top: 0; z-index: 50; display: flex; align-items: center; gap: var(--ds-s3); min-height: 56px; padding: var(--ds-s2) max(var(--ds-s3), var(--ds-safe-r)) var(--ds-s2) max(var(--ds-s3), var(--ds-safe-l)); padding-top: max(var(--ds-s2), var(--ds-safe-t)); background: var(--ds-surface); border-bottom: 1px solid var(--ds-line); color: var(--ds-text); }
.sc-bar.hidden { display: none !important; }
.sc-back { flex: none; width: var(--ds-tap); height: var(--ds-tap); display: grid; place-items: center; padding: 0 0 4px; border: 1px solid var(--ds-line); border-radius: 50%; background: var(--ds-surface); color: var(--ds-text); font: 700 28px/1 system-ui; }
.sc-back:active { transform: var(--ds-press); }
.sc-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--ds-fs-xl); font-weight: 800; }
.sc-chips { display: flex; gap: var(--ds-s2); }
.sc-chips.hidden { display: none; }
.sc-chip { display: flex; align-items: center; gap: var(--ds-s1); height: 34px; padding: 0 var(--ds-s3) 0 var(--ds-s2); border-radius: var(--ds-r-pill); background: var(--ds-surface-2); border: 1px solid var(--ds-line); font-size: var(--ds-fs-lg); }
.sc-chip img { width: 22px; height: auto; }
.sc-chip b { color: var(--ds-coin); font-weight: 800; }
.sc-chip.gem-chip b { color: var(--ds-gem); }
body.cq-sub .wrap { padding-top: calc(56px + max(var(--ds-s2), var(--ds-safe-t)) + var(--ds-s3)); padding-bottom: calc(var(--ds-s6) + var(--ds-safe-b)); padding-left: max(14px, var(--ds-safe-l)); padding-right: max(14px, var(--ds-safe-r)); }
.mapcard { scroll-margin-top: calc(84px + var(--ds-safe-t)); }

/* Result boxes: Về · Chơi lại · main button last on the right */
.dialog .wbtns { display: flex; gap: var(--ds-s2); margin-top: var(--ds-s3); }
.dialog .wbtns button { min-height: var(--ds-tap); border-radius: var(--ds-r-pill); font-size: var(--ds-fs-md); font-weight: 800; }
.dialog .wbtns .wsec { flex: none; padding: 0 var(--ds-s4); border: 1px solid var(--ds-line-strong); background: var(--ds-surface); color: var(--ds-text); }
.dialog .wbtns .more, .dialog.win .wbtns .more { flex: 1; display: flex; align-items: center; justify-content: center; margin: 0; padding: 0 var(--ds-s3); border: 0; background: var(--ds-play); color: #fff; box-shadow: none; text-shadow: none; font-size: var(--ds-fs-lg); }
.dialog .wbtns .more:disabled { opacity: .5; }
.dialog .wbtns .more:active, .dialog .wbtns .wsec:active { transform: var(--ds-press); box-shadow: none; }
.dialog .wshare { display: flex; flex-direction: row; align-items: center; justify-content: center; gap: var(--ds-s2); width: 100%; min-height: var(--ds-tap); margin-top: var(--ds-s2); padding: 0 var(--ds-s3); border: 1px solid var(--ds-primary); border-radius: var(--ds-r-pill); background: var(--ds-surface); color: var(--ds-primary); font-size: var(--ds-fs-md); font-weight: 800; box-shadow: none; }
.dialog .wshare:active { transform: var(--ds-press); box-shadow: none; }
.dialog .wshare:disabled { opacity: .5; }
.dialog .wshare .mbi { width: 22px; height: 22px; }
.dialog .wshare .mbi * { stroke: var(--ds-primary); }
.dialog .pz button { border-color: var(--ds-line-strong); border-radius: var(--ds-r-md, 12px); }
.dialog .pz button.pri { border-color: var(--ds-play); background: var(--ds-play); }
@media (orientation: landscape) and (max-height: 560px) {
  .dialog .wshare { margin-top: 4px; min-height: 40px; }
  .dialog .wbtns { margin-top: 6px; }
}

/* 2. Dialog radius + shadow from tokens (beats game-light.css) */
body.mb-light .dialog { border-radius: var(--ds-r-3xl, 18px); box-shadow: var(--ds-sh-pop, 0 10px 30px rgba(0, 0, 0, .18)); }
/* 3. Result box colours from tokens */
body.mb-light .dialog.win h3 { color: var(--ds-play); }
body.mb-light .dialog.lose h3 { color: var(--ds-danger); }
body.mb-light .dialog.win .wsub, body.mb-light .dialog.lose .why { color: var(--ds-text-muted); }
/* 6. Shop: lock reason is a corner label */
.item .lock { position: absolute; top: 6px; right: 6px; z-index: 2; padding: 2px 8px; border-radius: var(--ds-r-md); background: var(--ds-text); color: #fff; font-size: var(--ds-fs-xs); font-weight: 800; }
.item .lock .mbi, .item .lock img { width: 14px; height: 14px; vertical-align: -2px; }
/* Landscape: thin 44 px sub-screen bar */
@media (orientation: landscape) and (max-height: 560px) {
  .sc-bar { min-height: var(--ds-bar-thin, 44px); padding-top: max(2px, var(--ds-safe-t)); padding-bottom: 2px; }
  .sc-title { font-size: var(--ds-fs-lg); }
  body.cq-sub .wrap { padding-top: calc(var(--ds-bar-thin, 44px) + max(2px, var(--ds-safe-t)) + var(--ds-s3)); }
}

/* Sheet skin "lacquer": small sheets take the colours of the painted home (owner 30/11/2026). */
body.mb-light { --skin-frame: #7a2416; --skin-head: linear-gradient(#a83a22, #7a2416); --skin-head-ink: #fff1d0; --skin-line: #e0b04a;
  --skin-paper: #f6e8cc; --skin-card: #fffaf0; --skin-card-line: #dcb88a; --skin-ink: #2b1a10; --skin-muted: #74503a; --skin-hover: #fff1dc; }
