/* ================= Sudoku — MonBlock ================= */
: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; }
.small { padding: 12px 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); font-size: 14px; font-weight: 700; }

/* ---------- 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; }

/* ---------- HUD + công cụ ---------- */
.hud { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 10px; margin: 2px auto 8px; max-width: 520px; }
.hud small { display: block; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.hud-box b { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.hud-box.mid { text-align: center; }
.hud-box.mid b.bad { color: #e5374f; }
.hud-box.right { text-align: right; }

.tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; max-width: 520px; margin: 10px auto 0; }
.tools button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); font-size: 12px; font-weight: 700; }
.tools button i { font-style: normal; font-size: 20px; line-height: 1.1; }
.tools button u { position: absolute; top: -6px; right: 4px; padding: 0 6px; border-radius: 9px; background: #606368; color: #fff; font-size: 10px; font-weight: 800; text-decoration: none; line-height: 16px; }
.tools button.on { border-color: #335fff; color: #335fff; box-shadow: inset 0 0 0 1px #335fff; }
.tools button.on u { background: #335fff; }
.tools button:disabled { opacity: .4; cursor: default; }
.pad { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; max-width: 520px; margin: 8px auto 0; }
.pad button { display: flex; flex-direction: column; align-items: center; padding: 6px 0 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: #335fff; font-size: 26px; font-weight: 700; line-height: 1.1; }
.pad button small { color: var(--muted); font-size: 10px; font-weight: 700; }
.pad button:disabled { visibility: hidden; }
.pad.notes button { color: #606368; font-size: 20px; padding: 9px 0 6px; }
@media (hover: hover) { .pad button:hover, .tools button:hover { background: #eef2ff; } }

/* ---------- bàn: .sboard > .sbox ×9 > .cell ×9 — cỡ chữ theo cqw nên dùng chung cho bàn thật và ô xem thử ---------- */
.board-wrap { display: flex; justify-content: center; }
.sboard { --size: min(100%, 520px, calc(100dvh - 268px)); container-type: inline-size; width: var(--size); min-width: 260px; aspect-ratio: 1; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr);
  gap: 2px; padding: 2px; border-radius: 8px; background: var(--frame); box-shadow: var(--board-shadow, 0 4px 14px rgba(0, 0, 0, .12)); user-select: none; -webkit-user-select: none; }
@media (min-width: 860px) { .sboard { --size: min(100%, 520px, calc(100dvh - 250px)); } }
/* Phone held sideways: board on the left, HUD + tools + a 3×3 number pad on the right. */
@media (orientation: landscape) and (max-height: 520px) {
  #scPlay:not(.hidden) { display: grid; grid-template-columns: auto minmax(200px, 1fr); grid-template-areas: "board hud" "board tools" "board pad" "board keys"; column-gap: 16px; align-content: start; }
  #scPlay .hud { grid-area: hud; width: 100%; margin: 0 0 4px; }
  #scPlay .board-wrap { grid-area: board; }
  #scPlay .tools { grid-area: tools; width: 100%; margin: 4px 0 0; }
  #scPlay .pad { grid-area: pad; width: 100%; grid-template-columns: repeat(3, 1fr); }
  #scPlay #keysHint { grid-area: keys; }
  .sboard { --size: calc(100dvh - 100px); min-width: 220px; }
}
.sbox { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 1px; background: var(--thin); overflow: hidden; }
.sboard > .sbox:nth-child(1) { border-top-left-radius: 6px; } .sboard > .sbox:nth-child(3) { border-top-right-radius: 6px; }
.sboard > .sbox:nth-child(7) { border-bottom-left-radius: 6px; } .sboard > .sbox:nth-child(9) { border-bottom-right-radius: 6px; }
.cell { position: relative; display: grid; place-items: center; min-width: 0; min-height: 0; padding: 0; border: 0; background: var(--cell-img), var(--cell); color: var(--user); font-family: var(--dg-font); font-weight: var(--dg-user-w, 600); font-size: 6.6cqw; line-height: 1; }
.cell.given { color: var(--given); font-weight: var(--dg-given-w, 800); }
.cell.peer { background: var(--peer); }
.cell.same { background: var(--same); }
.cell.sel { background: var(--sel); box-shadow: inset 0 0 0 2px var(--user); }
.cell.bad { color: var(--err); }
.cell.clash { background: var(--errbg); }
.cell.sel.clash { background: var(--sel); }
.cell .v { display: block; }
.cell.hinted .v { text-decoration: underline 2px; text-underline-offset: 3px; text-decoration-color: var(--hintline, #00a862); }
.cell .nt { position: absolute; inset: 6%; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); color: var(--note); font-family: var(--dg-font); font-size: 2.9cqw; font-weight: 600; }
.cell .nt i { display: grid; place-items: center; font-style: normal; }
.cell .nt i.hl { border-radius: 30%; background: var(--user); color: var(--cell); }
.cell.pop .v { animation: pop .28s ease-out; }
@keyframes pop { from { transform: scale(.4); } 60% { transform: scale(1.18); } to { transform: none; } }
.cell.nope { animation: nope .3s; }
@keyframes nope { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.sboard.solved .cell { animation: wave .5s ease both; animation-delay: calc(var(--k) * 12ms); }
@keyframes wave { 50% { transform: scale(.82); filter: brightness(1.15); } }

/* ---------- mẫu bàn (SudokuCatalog.BOARDS): lớp .sb-<id> đặt biến màu ---------- */
.sb-classic { --frame: #2b3a55; --thin: #c9d2e0; --cell: #ffffff; --cell-img: none; --given: #191b1d; --user: #335fff; --note: #606368;
  --peer: #eef2f8; --same: #c9d8ff; --sel: #a9c2ff; --err: #e5374f; --errbg: #fde3e7; }
.sb-paper   { --frame: #3b5998; --thin: #b9cbe8; --cell: #fffdf4; --cell-img: linear-gradient(transparent 92%, rgba(80, 120, 200, .16) 92%); --given: #22304a; --user: #c03a2b; --note: #6b7a93;
  --peer: #f4f0dc; --same: #ffe7a8; --sel: #ffd66b; --err: #d81b60; --errbg: #fde0ea; }
.sb-wood    { --frame: #5a3618; --thin: #b98a5a; --cell: #e9c999; --cell-img: repeating-linear-gradient(100deg, rgba(120, 70, 20, .1) 0 3px, transparent 3px 9px); --given: #3a220c; --user: #1d5c8a; --note: #6a4a2a;
  --peer: #dcb889; --same: #f5d27a; --sel: #f2b84f; --err: #b3122a; --errbg: #f2b0a4; }
.sb-night   { --frame: #070b16; --thin: #2e3c5c; --cell: #182238; --cell-img: none; --given: #e8eef9; --user: #7fb2ff; --note: #8fa0c0;
  --peer: #1f2c48; --same: #2f4a80; --sel: #3a5ea8; --err: #ff6b7f; --errbg: #4a2234; --board-shadow: 0 6px 20px rgba(10, 20, 50, .45); }
.sb-candy   { --frame: #d4669a; --thin: #f6bcd6; --cell: #fff3f8; --cell-img: none; --given: #7a2350; --user: #8a3cd8; --note: #b06a90;
  --peer: #ffe4f0; --same: #e7cffd; --sel: #ffb3d4; --err: #e5374f; --errbg: #ffd0d8; }
.sb-lotus   { --frame: #2f6b4f; --thin: #a9d3bc; --cell: #f6fbf6; --cell-img: radial-gradient(circle at 85% 85%, rgba(240, 130, 170, .16) 0 18%, transparent 19%); --given: #1f3d2f; --user: #d2467e; --note: #5c7f6c;
  --peer: #e6f3ea; --same: #ffd6e5; --sel: #f7a8c8; --err: #c4202e; --errbg: #ffd6d6; }
.sb-galaxy  { --frame: #120a2e; --thin: #3b2a6e; --cell: #1b1240; --cell-img: radial-gradient(circle at 70% 30%, rgba(255, 255, 255, .55) 0 1px, transparent 1.6px), radial-gradient(circle at 25% 75%, rgba(180, 160, 255, .45) 0 1px, transparent 1.6px);
  --given: #f1ecff; --user: #ffd166; --note: #a99bd8; --peer: #251a55; --same: #4a2f8f; --sel: #6a45c2; --err: #ff6b8b; --errbg: #4c1838; --board-shadow: 0 6px 24px rgba(60, 30, 140, .45); }
.sb-gold    { --frame: #6e4c06; --thin: #d8b45a; --cell: #fff8de; --cell-img: linear-gradient(135deg, rgba(255, 255, 255, .7), transparent 55%); --given: #4a3204; --user: #b8720a; --note: #8a6a2a;
  --peer: #fbecc0; --same: #ffd977; --sel: #f5c344; --err: #c0182c; --errbg: #ffd2c2; --board-shadow: 0 6px 22px rgba(160, 110, 10, .35); }
/* Trời tuyết: frosty white-blue with snow dots */
.sb-tuyet   { --frame: #4f6f8f; --thin: #c4d6e6; --cell: #f4f9fd; --cell-img: radial-gradient(circle at 22% 28%, rgba(150, 190, 225, .45) 0 1.2px, transparent 2px), radial-gradient(circle at 72% 70%, rgba(150, 190, 225, .35) 0 1px, transparent 1.8px);
  --given: #1e3550; --user: #2f7fd0; --note: #6a84a0; --peer: #e3eef7; --same: #c7e2ff; --sel: #9fcaf5; --err: #d6334a; --errbg: #fde3e7; }
/* Lò sưởi ấm (event lapdong): brick frame, warm glow from the bottom */
.sb-losuoi  { --frame: #7a2c14; --thin: #e0a37a; --cell: #fff3e2; --cell-img: radial-gradient(ellipse at 50% 120%, rgba(255, 140, 40, .22), transparent 60%); --given: #4a1a08; --user: #d2560f; --note: #9a6a4a;
  --peer: #ffe6c8; --same: #ffcf8a; --sel: #ffb35c; --err: #c0182c; --errbg: #ffd2c2; --board-shadow: 0 6px 22px rgba(200, 90, 20, .35); }

/* ---------- kiểu số (SudokuCatalog.DIGITS): lớp .sd-<id> đổi phông / nét / hiệu ứng; màu lấy từ bàn ---------- */
.sd-classic { --dg-font: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
.sd-round   { --dg-font: "Arial Rounded MT Bold", "Nunito", "Varela Round", "Quicksand", ui-rounded, "SF Pro Rounded", sans-serif; --dg-user-w: 700; --dg-given-w: 900; }
.sd-ink     { --dg-font: "Songti SC", "Noto Serif", Georgia, "Times New Roman", serif; --dg-user-w: 500; --dg-given-w: 800; }
.sd-ink .cell .v { font-style: italic; }
.sd-ink .cell.given .v { font-style: normal; }
.sd-marker  { --dg-font: "Chalkboard SE", "Comic Sans MS", "Marker Felt", "Comic Neue", cursive; --dg-user-w: 700; --dg-given-w: 700; }
.sd-marker .cell .v { transform: rotate(-4deg); }
.sd-neon    { --dg-font: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif; --dg-user-w: 500; --dg-given-w: 700; }
.sd-neon .cell .v { text-shadow: 0 0 4px currentColor, 0 0 10px currentColor; }
.sd-neon .cell.given .v { text-shadow: 0 0 3px currentColor; }
.sd-golden  { --dg-font: Georgia, "Times New Roman", serif; --dg-user-w: 700; --dg-given-w: 900; }
.sd-golden .cell .v { background: linear-gradient(180deg, #fff2a8 0%, #f5b21a 45%, #a86a00 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 1px 0 rgba(90, 50, 0, .55)); }
.sd-golden .cell.given .v { background: linear-gradient(180deg, #c99a2e 0%, #7a4e00 100%); -webkit-background-clip: text; background-clip: text; }
.sd-bang    { --dg-font: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif; --dg-user-w: 700; --dg-given-w: 900; }
.sd-bang .cell .v { background: linear-gradient(180deg, #ffffff 0%, #9fe0ff 40%, #2f86c8 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 2px rgba(120, 200, 255, .8)); }
.sd-bang .cell.given .v { background: linear-gradient(180deg, #5fb4e6 0%, #164f80 100%); -webkit-background-clip: text; background-clip: text; filter: none; }
.sd-bang .cell.bad .v { background: none; color: var(--err); filter: none; }
.sd-golden .cell.bad .v { background: none; color: var(--err); filter: none; }

/* ---------- 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: 2px solid var(--line); border-radius: 16px; background: var(--panel); text-align: center; }
.item.locked { opacity: .55; }
.item b { font-size: 14px; }
.item .rar { font-size: 11px; 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; }
.item .sboard { --size: 100%; min-width: 0; max-width: 132px; pointer-events: none; }
.buyprev { display: flex; justify-content: center; margin: 4px 0 8px; }
.buyprev .sboard { --size: 100%; min-width: 0; max-width: 220px; pointer-events: none; }

/* ---------- 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; }

/* Limited event item tag (sdk/events.js) */
.evtag { display: inline-block; margin: 2px 0; padding: 1px 8px; border-radius: 999px; background: linear-gradient(90deg, #4fa8ff, #7a6bff); color: #fff; font-size: 11px; font-style: normal; font-weight: 800; }

/* ===== 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: #dbe9f7; 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 #4a2a14; 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; }
/* Guest avatar = the big "9" of the board */
.hm-av .me-avemo.hm-nine { color: #335fff; font-size: 30px; }
/* Nhiệm vụ sheet: today's puzzle reward + stats (same card as Cờ Vây) */
#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); }
}
/* Chấm báo Nhiệm vụ: một kiểu chấm trống cho mọi game (như Cờ Vây) */
#questDot { min-width: 16px; width: 16px; height: 16px; padding: 0; top: 6px; right: 10px; }
/* Home painting behind every screen (owner 19/11/2026, shared rule in sdk/game-light.css) */
body.mb-light { --mb-scene: url(/sudoku/img/home-bg.webp); --mb-scene-on: ''; --muted: #4c4f54; }
.tools button:disabled { opacity: .6; }
.item.locked { opacity: .6; }

/* 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; }
