/* 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);
}
/* ================= Bé Tô Màu — MonBlock (base copied from Chợ Quê) ================= */
: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; }


/* ---------- 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: var(--ds-gem); }
.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: var(--ds-gem); }
.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; min-height: var(--ds-tap); 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 { min-height: var(--ds-tap); 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.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: var(--ds-gem); }
.item .pr.gh { color: var(--muted); font-weight: 600; font-size: 12px; }
.item.poor .pay { opacity: .5; }

/* ---------- 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: var(--ds-surface); }
.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; }


/* ===== 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 art corner behind every screen (design system "Tranh nền sau mọi màn") */
:root { --ts: 64px; }
body.mb-light { --mb-scene: url(/betomau/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: 17cqh; }

#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)); }
.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; }

/* ===== Design system: sub-screen header + result buttons (22/11/2026) ===== */
body.mb-light.bt-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.bt-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)); }

/* 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; }
  .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.bt-sub .wrap { padding-top: calc(var(--ds-bar-thin, 44px) + max(2px, var(--ds-safe-t)) + var(--ds-s3)); }
}

/* ================= Bé Tô Màu — màn tô (tờ giấy vuông, hàng dụng cụ, hộp màu) ================= */
#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; background: #f7ead2 url(../img/home-bg.webp) center / cover; }
#scPlay .field::before { content: ''; position: absolute; inset: 0; background: rgba(255, 248, 236, .72); pointer-events: none; }
#scPlay .top { grid-template-columns: 48px 1fr 48px; }
.pbtn { width: var(--ds-tap); height: var(--ds-tap); padding: 0; display: grid; place-items: center; border-radius: 50%; border: 3px solid var(--ds-line); background: #fff; box-shadow: 0 3px 6px rgba(0, 0, 0, .3); }
.pbtn svg { width: 22px; height: 22px; fill: none; stroke: var(--ds-text); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.pbtn:active { transform: scale(.94); }
.hudcard { justify-self: center; min-width: 0; max-width: 100%; display: flex; flex-direction: column; align-items: center; padding: 4px 16px 5px; border-radius: var(--ds-r-lg, 14px); background: rgba(255, 255, 255, .9); color: var(--ds-text); text-align: center; box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.hudcard small { font-size: 12px; font-weight: 700; color: var(--ds-text-muted); }
.hudcard b { max-width: 100%; font-size: 17px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.done-btn { margin-left: auto; min-width: 112px; height: 54px; padding: 0 16px; border-radius: 999px; border: 3px solid #fff5cf; background: linear-gradient(#c9ced6, #9aa1ab); color: #fff; font: 900 19px/1 "Arial Rounded MT Bold", system-ui, sans-serif;
  -webkit-text-stroke: 3px #5c636e; paint-order: stroke fill; box-shadow: 0 4px 0 #6f7680, 0 6px 8px rgba(0, 0, 0, .25); }
.done-btn.ready { background: var(--ds-playpill); -webkit-text-stroke-color: var(--ds-playpill-ink); box-shadow: 0 4px 0 #1b6b1a, 0 6px 8px rgba(0, 0, 0, .3); animation: readyGlow 1.1s ease-in-out infinite alternate; }
@keyframes readyGlow { to { box-shadow: 0 4px 0 #1b6b1a, 0 0 0 6px rgba(255, 230, 90, .75), 0 6px 14px rgba(0, 0, 0, .3); transform: scale(1.04); } }
.done-btn:active { transform: translateY(2px); }
#scPlay .nstat { position: relative; z-index: 3; justify-self: center; align-self: center; max-width: calc(100% - 24px); color: #5a3a1a !important; text-shadow: none; min-height: 20px; margin: 4px 0 2px; padding: 2px 12px; border-radius: 999px; background: rgba(255, 250, 240, .94); box-shadow: 0 1px 3px rgba(0, 0, 0, .15); font-size: 13px; font-weight: 700; }
#scPlay .nstat:empty { visibility: hidden; }
.paper-box { position: relative; z-index: 2; flex: 1 1 auto; min-height: 0; width: 100%; display: grid; place-items: center; }
.paper { position: relative; width: var(--pw, 340px); height: var(--pw, 340px); border-radius: 14px; background: #fff; overflow: hidden; touch-action: none;
  box-shadow: 0 0 0 4px #fff, 0 0 0 6px #e7c79a, 0 8px 18px rgba(80, 50, 20, .28); }
.paper .zoom { position: absolute; inset: 0; transform-origin: 0 0; }
.paper canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.paper .cv-lines { pointer-events: none; }
.paper.free .cv-paint { background: #fff; }
.zoomout { position: absolute; right: 8px; bottom: 8px; z-index: 3; min-height: 44px; padding: 0 12px; border: 0; border-radius: 999px; background: rgba(25, 27, 29, .72); color: #fff; font-size: 13px; font-weight: 800; }
/* Hàng dụng cụ: mỗi cây bút là ảnh vẽ, cây đang cầm nhô lên */
.tools { position: relative; z-index: 3; flex: none; display: flex; align-items: flex-end; justify-content: center; gap: 4px; width: 100%; max-width: 560px; padding: 6px 8px 0; }
.tool { position: relative; flex: 1 1 0; max-width: 54px; min-width: 40px; height: 56px; padding: 0; border: 0; background: none; transition: transform .12s; }
.tool img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .3)); }
.tool.on { transform: translateY(-8px) scale(1.12); }
.tool.on::after { content: ''; position: absolute; left: 50%; bottom: -10px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: #335fff; }
.tool.lock img { filter: grayscale(1) opacity(.45); }
.tool .lk { position: absolute; right: 0; top: 0; width: 20px; height: 20px; }
.tool-sep { width: 1px; align-self: stretch; margin: 6px 2px; background: rgba(90, 58, 26, .25); }
.mini-btn { position: relative; flex: none; width: 44px; height: 44px; padding: 0; display: grid; place-items: center; border-radius: 14px; border: 2px solid #e7c79a; background: #fffaf0; color: #5a3a1a; box-shadow: 0 3px 0 #d8b47e; }
.mini-btn svg { width: 28px; height: 28px; }
.mini-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #d8b47e; }
.mini-btn.off { opacity: .55; }
.mini-btn .sz { display: block; border-radius: 50%; background: currentColor; }
/* Hộp màu: đầu sáp tròn, màu đang cầm có vòng xanh */
.colors { position: relative; z-index: 3; flex: none; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; width: 100%; max-width: 440px; padding: 8px 12px 4px; }
@media (max-width: 379px) { .colors { grid-template-columns: repeat(5, minmax(0, 1fr)); max-width: 300px; } }
.actrow { position: relative; z-index: 3; flex: none; display: flex; align-items: center; gap: 8px; width: 100%; max-width: 440px; padding: 4px 12px max(12px, env(safe-area-inset-bottom)); }
.sw::after, .pal-pick::after { content: ''; position: absolute; inset: -4px; }
.sw { position: relative; aspect-ratio: 1; min-height: 38px; max-height: 50px; padding: 0; border-radius: 50%; border: 3px solid #fff; background: var(--c); box-shadow: 0 2px 4px rgba(0, 0, 0, .3), inset 0 -4px 0 rgba(0, 0, 0, .15), inset 0 4px 0 rgba(255, 255, 255, .35); }
.sw.on { transform: scale(1.12); box-shadow: 0 0 0 3px #335fff, 0 3px 6px rgba(0, 0, 0, .35), inset 0 -4px 0 rgba(0, 0, 0, .15); }
.sw.white { border-color: #d8dce2; }
.pal-pick { position: relative; aspect-ratio: 1; min-height: 40px; max-height: 50px; padding: 0; display: grid; place-items: center; border-radius: 50%; border: 3px solid #e7c79a; background: #fffaf0; box-shadow: 0 2px 4px rgba(0, 0, 0, .2); }
.pal-pick img { width: 80%; height: 80%; object-fit: contain; }
.pal-list { display: flex; flex-direction: column; gap: 8px; }
.pal-row { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 10px; border: 1px solid var(--ds-line); border-radius: 12px; background: #fff; text-align: left; }
.pal-row.on { border-color: var(--ds-primary); box-shadow: inset 0 0 0 1px var(--ds-primary); }
.pal-row b { flex: 1; font-size: 15px; }
.dots { display: flex; gap: 2px; }
.dots i { width: 14px; height: 14px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }

/* Điện thoại cầm ngang: tờ giấy bên trái, dụng cụ + hộp màu cột phải */
@media (orientation: landscape) and (max-height: 560px) {
  #scPlay .field { display: grid; grid-template-columns: 1fr minmax(290px, 40vw); grid-template-rows: auto auto 1fr auto; grid-template-rows: auto auto 1fr auto auto; grid-template-areas: "top top" "stat stat" "paper tools" "paper colors" "paper act"; }
  #scPlay .top { grid-area: top; max-width: none; }
  #scPlay .nstat { grid-area: stat; min-height: 16px; margin: 0 0 6px; }
  .paper-box { grid-area: paper; height: 100%; min-height: 0; place-items: start center; }
  .tools { grid-area: tools; align-self: end; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); justify-items: center; row-gap: 6px; padding: 6px 12px 0; }
  .tool { width: 100%; height: 48px; }
  .tool-sep { display: none; }
  .colors { grid-area: colors; grid-template-columns: repeat(5, 44px); justify-content: center; gap: 6px 10px; padding: 4px 12px 0; }
  .sw, .pal-pick { min-height: 0; width: 44px; height: 44px; }
  .actrow { grid-area: act; justify-content: center; padding-top: 6px; }
  .done-btn { height: 48px; }
}

/* ================= Chủ đề + tranh ================= */
.theme { margin: 0 0 14px; border-radius: 16px; overflow: hidden; background: #fff; border: 1px solid var(--ds-line); scroll-margin-top: calc(84px + var(--ds-safe-t)); }
.thead { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--tb, #ffe6a8); }
.thead b { flex: 1; font-size: 17px; color: #3a2a12; }
.thead small { font-size: 13px; font-weight: 800; color: #6a4a22; }
.thead .buy { min-height: 44px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--ds-primary); color: #fff; font-size: 13px; font-weight: 800; }
.pages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 10px; }
.pg { position: relative; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 4px 4px 6px; border: 1px solid var(--ds-line); border-radius: 12px; background: #fff; text-align: center; }
.pg img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 8px; background: #fff; }
.pg span { font-size: 12px; font-weight: 800; color: var(--ds-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg small { font-size: 12px; letter-spacing: 1px; color: var(--ds-line-strong); }
.pg small i { font-style: normal; color: var(--ds-medal-1, #f2b51c); }
.pg.wip::after { content: 'Đang tô'; position: absolute; top: 6px; left: 6px; padding: 1px 6px; border-radius: 6px; background: #ffb020; color: #fff; font-size: 12px; font-weight: 800; }
.pg.daily { border-color: #335fff; box-shadow: 0 0 0 2px #335fff; }
.theme.locked .pg img { filter: grayscale(.4) opacity(.55); }
.theme.locked .pg { pointer-events: none; }

/* ================= Tủ lạnh: bộ sưu tập ================= */
.fridge { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 12px; padding: 14px 10px 20px; border-radius: 18px; background: var(--ds-surface); border: 1px solid var(--ds-line); }
.fridge .empty { grid-column: 1 / -1; text-align: center; color: var(--ds-text-muted); font-weight: 700; padding: 30px 10px; }
.pin { position: relative; padding: 0; border: 0; background: none; transform: rotate(var(--rot, -2deg)); }
.pin:nth-child(even) { --rot: 2deg; }
/* Khung tranh — cùng lớp cho tủ lạnh, ô xem thử cửa hàng, hộp khoe tranh */
.frame { position: relative; display: block; padding: 6px; border-radius: 6px; background: #fff; box-shadow: 0 4px 8px rgba(0, 0, 0, .22); }
.frame img { display: block; width: 100%; aspect-ratio: 1; border-radius: 3px; }
.fr-namcham::before, .fr-namcham::after { content: ''; position: absolute; top: -8px; width: 20px; height: 20px; border-radius: 50%; box-shadow: inset -3px -3px 0 rgba(0, 0, 0, .18), 0 2px 3px rgba(0, 0, 0, .3); }
.fr-namcham::before { left: 14%; background: #ff5a5a; }
.fr-namcham::after { right: 14%; background: #3aa8ff; }
.fr-go { padding: 10px; background: linear-gradient(135deg, #d8a46a, #a8682e 50%, #c98a4a); box-shadow: inset 0 0 0 2px #7a4a1c, 0 4px 8px rgba(0, 0, 0, .25); }
.fr-hoa { padding: 11px; background: radial-gradient(circle, #ff7ab0 3px, transparent 3.5px) 0 0 / 16px 16px, radial-gradient(circle, #ffd23a 3px, transparent 3.5px) 8px 8px / 16px 16px, #e9fbe0; box-shadow: inset 0 0 0 2px #8ccf3a, 0 4px 8px rgba(0, 0, 0, .2); }
.fr-caukvong { padding: 10px; background: conic-gradient(#ff4a4a, #ff9a2a, #ffe02a, #5ad04a, #2aa8ff, #7a5aff, #ff4ab0, #ff4a4a); }
.fr-vang { padding: 11px; background: linear-gradient(135deg, #fff1a0, #d9a520 30%, #fff1a0 55%, #b8820a 80%, #f2c84a); box-shadow: inset 0 0 0 3px #8a5a00, inset 0 0 0 6px #ffe7a0, 0 5px 10px rgba(0, 0, 0, .3); }
.fr-tuyet { padding: 11px; background: radial-gradient(circle, #fff 2.5px, transparent 3px) 0 0 / 14px 14px, linear-gradient(#bfe6ff, #7cc4f2); box-shadow: inset 0 0 0 2px #fff, 0 4px 8px rgba(0, 0, 0, .2); }

/* ================= Cửa hàng: ô xem thử ================= */
.pv { position: relative; display: flex; justify-content: center; align-items: center; width: 100%; min-height: 96px; pointer-events: none; }
.pv .dots { flex-wrap: wrap; justify-content: center; max-width: 120px; gap: 4px; }
.pv .dots i { width: 22px; height: 22px; }
.pv .sample { width: 120px; height: 88px; border-radius: 8px; background: #fff; box-shadow: inset 0 0 0 1px var(--ds-line); }
.pv .frame { width: 96px; }
.pv .packs { display: flex; }
.pv .packs img { width: 52px; height: 52px; margin: 0 -6px; border-radius: 8px; background: #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, .25); }
.pv .packs img:nth-child(2) { transform: translateY(-6px); z-index: 1; }
.buyprev .pv .sample { width: 200px; height: 140px; }
.buyprev .pv .frame { width: 160px; }
.buyprev .pv .dots i { width: 28px; height: 28px; }

/* ================= Tô xong: tranh nhảy múa + pháo giấy ================= */
.dialog.win .art { position: relative; width: min(230px, 62vw); margin: 0 auto 4px; animation: dance 1.2s ease-in-out infinite; }
.dialog.win .art .frame { padding-top: 6px; }
@keyframes dance { 0%, 100% { transform: rotate(-4deg) translateY(0); } 25% { transform: rotate(3deg) translateY(-8px) scale(1.03); } 50% { transform: rotate(-2deg) translateY(0); } 75% { transform: rotate(4deg) translateY(-6px) scale(1.02); } }
.confetti { position: fixed; top: -20px; z-index: 95; width: 10px; height: 14px; pointer-events: none; animation: fall var(--d, 2.4s) linear forwards; }
@keyframes fall { to { transform: translate(var(--dx, 0), 110vh) rotate(var(--r, 540deg)); } }
/* Phone held sideways: picture on the left, title / rewards / buttons on the right, all in one screen. */
@media (orientation: landscape) and (max-height: 560px) {
  .dialog.win { width: min(640px, 100%); display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 18px; align-items: center; }
  .dialog.win > * { grid-column: 2; }
  .dialog.win > .art { grid-column: 1; grid-row: 1 / span 7; width: min(220px, 56vh); margin: 0; }
  .dialog.win .wshare { margin-top: 6px; }
}
/* Crayon tiles sit straight on the scene: drop the white card that game-light.css gives every .tools button. */
body.mb-light .tools button.tool, body.mb-light .tools button.tool:hover { background: none; border: 0; box-shadow: none; }
body.mb-light .item { border-radius: var(--ds-r-2xl, 16px); }
.toast { background: var(--ds-text); color: #fff; }

/* Sheet skin "wood": small sheets take the colours of the painted home (owner 30/11/2026). */
body.mb-light { --skin-frame: #6b3d17; --skin-head: linear-gradient(#93592a, #6b3d17); --skin-head-ink: #fff3d6; --skin-line: #d8a13a;
  --skin-paper: #f4e6c6; --skin-card: #fffaf0; --skin-card-line: #d6b886; --skin-ink: #3a1d0c; --skin-muted: #765536; --skin-hover: #fff3dc; }
