/* ================= Xếp Cốc Màu — MonBlock (base copied from Đuổi Hình Bắt Chữ) ================= */
: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: 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; }
.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: 11px; }
.item.poor .pay { opacity: .5; }
.item .lock { position: absolute; top: 6px; right: 6px; z-index: 2; padding: 1px 6px; border-radius: 8px; background: #191b1d; color: #fff; font-size: 11px; font-weight: 800; }
.item.active { border-color: #335fff; }
.item .own { font-size: 12px; font-weight: 800; color: #6b3f16; }


/* ================= Xếp Cốc Màu — riêng của game ================= */
.big-sprint { --bar: #ff8a1f; }
.big-sprint.done small { color: #00a862; }
#btnSound .mbi { width: 22px; height: 22px; display: block; }
.nstat { min-height: 20px; margin: 4px 0 0; text-align: center; font-size: 14px; font-weight: 800; }

/* ---------- bàn chơi: nền dịu mắt (BGS) ---------- */
.field { --fg: #fff; --fg2: rgba(255, 255, 255, .78); max-width: 560px; margin: 8px auto 0; padding: 12px 10px 14px; border-radius: 18px; color: var(--fg); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18), 0 2px 8px rgba(0, 0, 0, .12); }
/* Default = the sunny café of the home picture, a light cream veil so the cups stand out (owner 19/11/2026: brighter like the home) */
.bg-bien { --fg: #4a2a14; --fg2: rgba(74, 42, 20, .75); background: linear-gradient(rgba(255, 249, 238, .28), rgba(255, 249, 238, .28)), #f3e4c4 url(../img/home-bg.webp) center 32% / cover no-repeat; }
.bg-ngoc { background: linear-gradient(180deg, #3f8a6c, #2a6650); }
.bg-rung { background: linear-gradient(180deg, #55804a, #35592f); }
.bg-tim { background: linear-gradient(180deg, #55508a, #37335f); }
.bg-nau { background: linear-gradient(180deg, #7d5e40, #52392a); }
.bg-hong { background: linear-gradient(180deg, #8f4f68, #603048); }
.hud { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin: 0 4px 6px; }
.hud b { display: block; font-size: 18px; line-height: 1.1; }
.hud small { display: block; font-size: 12px; font-weight: 700; color: var(--fg2); }
.hud-m, .hud-r { text-align: center; }
.hud-r { text-align: right; }
.hud-l { min-width: 0; }
.hud-m b { font-size: 24px; font-variant-numeric: tabular-nums; }
.hud-m.low b { color: #ffb4a8; animation: lowPulse .6s ease-in-out infinite alternate; }
@keyframes lowPulse { to { transform: scale(1.12); } }

/* ---------- bảng màu nước (PALS): 12 màu, màu k = lớp .c<k> ---------- */
.pal-ruc     { --c0: #e53935; --c1: #2f6bff; --c2: #fdd835; --c3: #2e9e4f; --c4: #8e44ad; --c5: #fb8c00; --c6: #26c6da; --c7: #ec407a; --c8: #7b4a2d; --c9: #a4d12a; --c10: #00897b; --c11: #cfd8dc; }
.pal-diu     { --c0: #c0554f; --c1: #4f7fc4; --c2: #d9b648; --c3: #5b9a6a; --c4: #8a62a8; --c5: #d98a3f; --c6: #4fb0b8; --c7: #c9658a; --c8: #8a6548; --c9: #9ab552; --c10: #3f8f86; --c11: #b9c3c8; }
.pal-keo     { --c0: #ff6b81; --c1: #5aa9ff; --c2: #ffd84d; --c3: #5fd18a; --c4: #b57bff; --c5: #ff9f4a; --c6: #4fe0e0; --c7: #ff7ad9; --c8: #b07a55; --c9: #c8f05a; --c10: #3fc0a0; --c11: #f0f0ff; }
.pal-bien    { --c0: #ff6f61; --c1: #0b3d91; --c2: #ffe08a; --c3: #1fb6a0; --c4: #6a5acd; --c5: #ff9f5a; --c6: #3ec6ff; --c7: #e44fa0; --c8: #5b6b7a; --c9: #8bd450; --c10: #00796b; --c11: #dff4ff; }
.pal-thu     { --c0: #b3261e; --c1: #4a6741; --c2: #e8b030; --c3: #7a4a28; --c4: #d9531e; --c5: #8c1c3a; --c6: #6b8e9b; --c7: #e08a5a; --c8: #3c2a1e; --c9: #a3b04a; --c10: #8a5a8f; --c11: #ece0c8; }
.pal-cauvong { --c0: #ff3b30; --c1: #ff9500; --c2: #ffe600; --c3: #34c759; --c4: #00c7be; --c5: #0a84ff; --c6: #5e5ce6; --c7: #bf5af2; --c8: #ff2d92; --c9: #8e5a3c; --c10: #a0e060; --c11: #e6e6ee; }
.c0 { --c: var(--c0); } .c1 { --c: var(--c1); } .c2 { --c: var(--c2); } .c3 { --c: var(--c3); } .c4 { --c: var(--c4); } .c5 { --c: var(--c5); }
.c6 { --c: var(--c6); } .c7 { --c: var(--c7); } .c8 { --c: var(--c8); } .c9 { --c: var(--c9); } .c10 { --c: var(--c10); } .c11 { --c: var(--c11); }

/* ---------- cốc + bàn ---------- */
.board { --tw: 56px; --cols: 4; --ar: 2.9; position: relative; display: grid; grid-template-columns: repeat(var(--cols), var(--tw)); justify-content: center; gap: 22px 12px; margin: 14px 0 8px; padding: 0 0 4px; }
.tube { position: relative; display: flex; justify-content: center; width: var(--tw); padding: 0; border: 0; background: none; transition: transform .18s ease; -webkit-tap-highlight-color: transparent; }
.tube .glass { position: relative; display: flex; flex-direction: column-reverse; width: 100%; height: calc(var(--tw) * var(--ar)); padding: 3px; border: 3px solid rgba(228, 245, 255, .94); border-radius: 9px 9px calc(var(--tw) * .45) calc(var(--tw) * .45);
  background: linear-gradient(90deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, .05) 40%, rgba(255, 255, 255, .12)); box-shadow: 0 0 0 2px rgba(8, 22, 36, .6), 0 7px 8px rgba(0, 0, 0, .32); overflow: hidden; }
.tube .glass::after { content: ''; position: absolute; left: 20%; top: 7%; width: 13%; height: 62%; border-radius: 9px; background: rgba(255, 255, 255, .34); pointer-events: none; z-index: 2; }
.seg { position: relative; flex: 0 0 25%; background: linear-gradient(90deg, rgba(255, 255, 255, .3), rgba(255, 255, 255, 0) 38%, rgba(0, 0, 0, .16)), var(--c); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .3), inset 0 2px 0 rgba(255, 255, 255, .22); transform-origin: bottom; }
.seg.in { animation: segIn .3s ease backwards; }
@keyframes segIn { from { transform: scaleY(0); } }
.sym .seg::before { content: attr(data-s); position: absolute; inset: 0; display: grid; place-items: center; font-size: calc(var(--tw) * .34); font-weight: 900; line-height: 1; color: rgba(255, 255, 255, .95); text-shadow: 0 1px 2px rgba(0, 0, 0, .7); }
/* Mystery layer (maps 11+): smoky frosted liquid with a question mark; flips to its colour when it reaches the mouth (.rev). */
.seg.hid { --c: #3a4454; background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .1) 0 3px, rgba(255, 255, 255, 0) 3px 8px), linear-gradient(90deg, rgba(255, 255, 255, .32), rgba(255, 255, 255, 0) 38%, rgba(0, 0, 0, .22)), var(--c); }
.seg.hid::before, .sym .seg.hid::before { content: '?'; position: absolute; inset: 0; display: grid; place-items: center; font-size: calc(var(--tw) * .36); font-weight: 900; line-height: 1; color: #e8f1ff; text-shadow: 0 1px 2px rgba(0, 0, 0, .8); }
.mhead .mini .seg.hid::before { font-size: 9px; }
.seg.rev { animation: segRev .5s ease; }
@keyframes segRev { from { filter: brightness(2) saturate(.2); transform: scaleX(.75); } }
.mapcard.myst .mhead { min-height: 96px; background-color: #2c3550; background-size: cover; background-position: center 45%; text-shadow: 0 1px 3px rgba(0, 0, 0, .7); }
.tube.sel { transform: translateY(-16px); }
.tube.done .glass { box-shadow: 0 0 0 2px rgba(8, 22, 36, .6), 0 0 14px 2px rgba(255, 214, 90, .85), 0 7px 8px rgba(0, 0, 0, .3); }
.tube.hintA .glass { animation: hintA .7s ease-in-out infinite alternate; }
.tube.hintB .glass { animation: hintB .7s ease-in-out infinite alternate; }
@keyframes hintA { to { box-shadow: 0 0 0 3px #ffd54a, 0 0 16px 3px rgba(255, 213, 74, .9); } }
@keyframes hintB { to { box-shadow: 0 0 0 3px #7ee08a, 0 0 16px 3px rgba(126, 224, 138, .9); } }
.tube.pouring { z-index: 6; transition: transform .3s ease; }
/* Level liquid while tilting (levelLiquid in main.js): a wide strip under the surface, counter-rotated, clipped by the glass */
.tube .liq { position: absolute; left: 50%; display: flex; flex-direction: column; transform-origin: 50% 0; transition: transform .3s ease; }
.tube .liq .seg { flex: 1 1 0; }
.tube.bad { animation: shake .3s; }
@keyframes shake { 25%, 75% { transform: translateX(-4px); } 50% { transform: translateX(4px); } }
.stream { position: absolute; z-index: 5; width: 7px; margin-left: -3px; border-radius: 4px; background: var(--c); box-shadow: inset 2px 0 0 rgba(255, 255, 255, .4); pointer-events: none; animation: stream .32s ease; }
@keyframes stream { from { transform: scaleY(0); transform-origin: top; } }
.symbtn:not(.round) { display: block; margin: 0 auto; padding: 4px 12px; border: 1px solid rgba(255, 255, 255, .35); border-radius: 999px; background: rgba(255, 255, 255, .12); color: #fff; font-size: 12px; font-weight: 800; }
.symbtn:not(.round)[aria-pressed="true"] { background: rgba(255, 213, 74, .3); border-color: #ffd54a; }

/* Kiểu cốc (CUPS): lớp .cup-<id> trên .board, dùng chung cho bàn thật + ô xem thử */
.cup-kinh { --ar: 2.9; }
/* Cốc kính = the tumbler of the home picture (owner 19/11/2026): wide mouth tapering to a rounded foot, steel rim,
   dark brown outline drawn with drop-shadows because clip-path cuts borders and box-shadows. */
.cup-kinh .tube { --o: calc(var(--tw) * .045); --ol: drop-shadow(var(--o) 0 0 #4a2a14) drop-shadow(calc(var(--o) * -1) 0 0 #4a2a14) drop-shadow(0 var(--o) 0 #4a2a14) drop-shadow(0 calc(var(--o) * -1) 0 #4a2a14);
  filter: var(--ol) drop-shadow(0 6px 4px rgba(60, 35, 15, .3)); }
.cup-kinh .tube .glass { padding: calc(var(--tw) * .17) 4px 5px; border: 0; border-radius: 0; box-shadow: none;
  clip-path: polygon(0 0, 100% 0, 91% 93%, 89% 97.5%, 85.5% 100%, 14.5% 100%, 11% 97.5%, 9% 93%);
  background: linear-gradient(90deg, rgba(214, 238, 248, .92), rgba(255, 255, 255, .72) 38%, rgba(198, 228, 242, .9)); }
.cup-kinh .tube .glass::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: calc(var(--tw) * .13); background: linear-gradient(180deg, #fff, #c9d4dd 55%, #8d9aa8); border-bottom: 2px solid #5d6b78; z-index: 3; }
.cup-kinh .tube .glass::after { left: 16%; top: 20%; width: 11%; height: 58%; background: rgba(255, 255, 255, .55); }
.cup-kinh .seg { box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .14), inset 0 2px 0 rgba(255, 255, 255, .25); }
.cup-kinh .tube.done { filter: var(--ol) drop-shadow(0 0 calc(var(--tw) * .14) rgba(255, 196, 40, .95)); }
.cup-kinh .tube.hintA { animation: cupHintA .7s ease-in-out infinite alternate; }
.cup-kinh .tube.hintB { animation: cupHintB .7s ease-in-out infinite alternate; }
@keyframes cupHintA { from { filter: var(--ol) drop-shadow(0 6px 4px rgba(60, 35, 15, .3)); } to { filter: var(--ol) drop-shadow(0 0 calc(var(--tw) * .16) #ffd54a); } }
@keyframes cupHintB { from { filter: var(--ol) drop-shadow(0 6px 4px rgba(60, 35, 15, .3)); } to { filter: var(--ol) drop-shadow(0 0 calc(var(--tw) * .16) #5fd36c); } }
.cup-nghiem { --ar: 3.5; }
.cup-nghiem .tube .glass { width: 78%; border-width: 2px; padding: 2px; border-radius: 5px 5px 999px 999px; }
.cup-nghiem .tube { justify-content: center; }
.cup-hu { --ar: 2.2; }
.cup-hu .tube .glass { padding-top: 10px; border-radius: 12px 12px 20px 20px; border-color: rgba(210, 238, 225, .95); }
.cup-hu .tube .glass::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 8px; background: #a9794a; border-bottom: 2px solid #6b4423; z-index: 3; }
.cup-tra { --ar: 3.2; }
.cup-tra .tube .glass { width: 88%; border-color: #ecc866; border-top: 5px solid #f3d788; border-radius: 4px 4px 40% 40%; }
.cup-phale { --ar: 2.9; }
.cup-phale .tube .glass { border-color: #e9dcff; border-radius: 6px 6px 40% 40%;
  background: repeating-linear-gradient(115deg, rgba(255, 255, 255, .22) 0 6px, rgba(190, 160, 255, .12) 6px 12px);
  box-shadow: 0 0 0 2px rgba(40, 20, 80, .6), 0 0 14px rgba(190, 160, 255, .75), 0 7px 8px rgba(0, 0, 0, .3); }

/* ---------- nút điều khiển ---------- */
.ctl { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.ctl button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 58px; padding: 6px 2px; border: 1px solid rgba(255, 255, 255, .3); border-radius: 14px; background: rgba(255, 255, 255, .14); color: #fff; font-size: 12px; font-weight: 800; }
.ctl button:active { transform: scale(.97); }
.ctl button.dis { opacity: .45; }
.ctl .orb .mbi { width: 24px; height: 24px; display: block; }
.ctl u { position: absolute; top: -6px; right: -3px; min-width: 22px; padding: 1px 6px; border-radius: 10px; background: #ffd54a; color: #4a2a14; font-size: 12px; font-weight: 900; text-align: center; text-decoration: none; }
.ctl u:empty { display: none; }

/* ---------- chọn màn ---------- */
.mapcard { margin: 0 0 14px; border-radius: 16px; overflow: hidden; background: #fff; border: 1px solid #e3e5e8; scroll-margin-top: 70px; }
.mapcard.locked { opacity: .6; }
.mhead { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: linear-gradient(90deg, #1f5f7c, #2f7f9c); color: #fff; }
.mhead .mini { display: flex; gap: 4px; flex: none; }
.mhead .mini .board { --tw: 15px; display: flex; gap: 3px; margin: 0; padding: 0; }
.mhead .mini .tube .glass { border-width: 2px; padding: 1px; box-shadow: 0 0 0 1px rgba(8, 22, 36, .5); }
.mhead .mini .tube .glass::after { display: 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: 2px solid #cfe3ee; border-radius: 14px; background: #f1f8fc; font-weight: 900; color: #245a75; }
.lv b { font-size: 17px; }
.lv small { font-size: 11px; font-weight: 800; letter-spacing: 1px; color: #c9ced6; }
.lv small i { font-style: normal; color: #e0a020; }
.lv.done { background: #e0f0f8; border-color: #6fb0d2; }
.lv.clean { background: #fff3c9; border-color: #e0a83a; color: #7a4f08; }
.lv.cur { border-color: #335fff; box-shadow: 0 0 0 3px rgba(51, 95, 255, .22); }
.lv:disabled { opacity: .45; background: #f0f1f2; border-color: #e3e5e8; color: #9aa0a6; }

/* ---------- cửa hàng ---------- */
.shop .item { position: relative; }
.pv { position: relative; display: flex; justify-content: center; align-items: center; width: 100%; min-height: 96px; pointer-events: none; }
.pv .board { --tw: 26px; display: flex; gap: 7px; margin: 0; padding: 0; }
.pv .board .tube { width: var(--tw); }
.pv .board .tube .glass { border-width: 2px; padding: 2px; box-shadow: 0 0 0 1px rgba(8, 22, 36, .6), 0 4px 5px rgba(0, 0, 0, .25); }
.pv .board .tube .glass::after { width: 12%; }
.pv-bg .field { display: flex; justify-content: center; width: 124px; max-width: none; margin: 0; padding: 12px 8px 8px; border-radius: 12px; }
.pv-bg .board { --tw: 20px; }
.buyprev .pv .board { --tw: 40px; gap: 12px; }
.buyprev .pv-bg .field { width: 220px; padding: 18px 10px 12px; }
.buyprev .pv-bg .board { --tw: 32px; }
.boostpv { display: flex; align-items: center; gap: 6px; font-size: 20px; font-weight: 900; color: #6b3f16; }
.boostpv .mbi { width: 46px; height: 46px; }

/* ---------- 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: #3b1f06; }
.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: #fff; border: 2px solid #e2bb72; font-size: 17px; color: #3b1f06; }
.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: #8a5a22; }
.wtags { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.wtags span { padding: 3px 10px; border-radius: 999px; background: #e9f7d9; color: #2f6f1a; font-size: 12px; font-weight: 800; }
.dialog .evtag, .item .evtag { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: linear-gradient(90deg, #8fd0ff, #c9b8ff); color: #1d2a4a; }
.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; }
.dialog.win .links { display: flex; justify-content: center; gap: 22px; margin-top: 12px; flex-wrap: wrap; }
.dialog.win .links button { display: flex; align-items: center; gap: 6px; padding: 8px 4px; border: 0; background: none; font-size: 16px; font-weight: 900; color: #6b4418; }
.dialog.win .links .mbi { width: 24px; height: 24px; }
.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: #6b4418; 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: #6b4418; font-weight: 700; }
@media (max-width: 380px) { .ctl button { font-size: 11px; } }

/* ================= Màn chơi kiểu hoạt hình (mẫu của chủ dự án 14/11/2026) =================
   Tràn hết bề ngang: nền xanh đậm có bong bóng, logo cầu vồng viền dày, chip ⭐ / 🪙 hai bên bảng gỗ tên màn,
   cốc thuỷ tinh viền đậm đứng trên kệ gỗ, nút tròn bóng to trên ván gỗ. Chỉ áp cho #scPlay (ô xem thử cửa hàng + bản đồ giữ kiểu cũ). */
#scPlay .field { position: relative; display: flex; flex-direction: column; max-width: none; min-height: calc(100svh - 52px); margin: -8px -14px -28px; padding: 6px 12px 0; border-radius: 0; box-shadow: none; overflow: hidden; }
@media (min-width: 700px) { #scPlay .field { max-width: 560px; margin: 0 auto; border-radius: 22px 22px 0 0; } }
#scPlay .field::before, #scPlay .field::after { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 0; background-repeat: no-repeat; }
/* Bong bóng: vòng sáng + đốm bóng + vài chấm nhỏ */
#scPlay .field::before { background-image:
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, .7) 0 7%, transparent 8%), radial-gradient(circle, rgba(190, 235, 255, .07) 52%, rgba(190, 235, 255, .42) 60% 66%, transparent 69%),
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, .6) 0 7%, transparent 8%), radial-gradient(circle, rgba(190, 235, 255, .07) 52%, rgba(190, 235, 255, .4) 60% 66%, transparent 69%),
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, .6) 0 7%, transparent 8%), radial-gradient(circle, rgba(190, 235, 255, .07) 52%, rgba(190, 235, 255, .38) 60% 66%, transparent 69%),
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, .6) 0 7%, transparent 8%), radial-gradient(circle, rgba(190, 235, 255, .07) 52%, rgba(190, 235, 255, .38) 60% 66%, transparent 69%),
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, .6) 0 7%, transparent 8%), radial-gradient(circle, rgba(190, 235, 255, .07) 52%, rgba(190, 235, 255, .36) 60% 66%, transparent 69%);
  background-size: 62px 62px, 62px 62px, 50px 50px, 50px 50px, 40px 40px, 40px 40px, 56px 56px, 56px 56px, 34px 34px, 34px 34px;
  background-position: 12% 20%, 12% 20%, 90% 31%, 90% 31%, 3% 52%, 3% 52%, 96% 62%, 96% 62%, 74% 86%, 74% 86%; }
#scPlay .field::after { background-image:
    radial-gradient(circle, rgba(190, 235, 255, .35) 0 38%, transparent 42%), radial-gradient(circle, rgba(190, 235, 255, .3) 0 38%, transparent 42%), radial-gradient(circle, rgba(190, 235, 255, .3) 0 38%, transparent 42%),
    radial-gradient(circle, rgba(190, 235, 255, .28) 0 38%, transparent 42%), radial-gradient(circle, rgba(190, 235, 255, .26) 0 38%, transparent 42%),
    repeating-radial-gradient(circle at 50% 50%, transparent 0 4px, rgba(190, 235, 255, .22) 4px 6px), repeating-radial-gradient(circle at 50% 50%, transparent 0 4px, rgba(190, 235, 255, .2) 4px 6px);
  background-size: 10px 10px, 7px 7px, 12px 12px, 8px 8px, 9px 9px, 46px 46px, 40px 40px;
  background-position: 22% 33%, 18% 40%, 84% 20%, 80% 46%, 8% 78%, 4% 70%, 94% 84%;
  -webkit-mask-image: none; }
#scPlay .field > * { position: relative; z-index: 1; }

/* Logo: hình vẽ sẵn (chữ kẹo ngọt nhiều màu), không phụ thuộc font của máy */
.logo { margin: 0 0 2px; text-align: center; user-select: none; }
.logo img { display: block; width: min(84%, 420px); height: auto; margin: 0 auto; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .18)); }

/* Hàng trên: chip ⭐ · bảng gỗ tên màn · chip 🪙 (giờ khi chạy đua) */
#scPlay .hud { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 4px; margin: 4px 0 2px; }
#scPlay .chip { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; height: 40px; min-width: 0; padding: 0 14px 0 46px; border-radius: 999px; background: rgba(3, 20, 32, .58); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
#scPlay .chip .ci { position: absolute; left: -4px; top: 50%; width: 44px; height: 44px; margin-top: -22px; display: grid; place-items: center; font-style: normal; font-size: 40px; line-height: 1; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .45)); }
#scPlay .chip .ci > * { width: 40px !important; height: 40px !important; max-width: none; display: block; }
#scPlay .chip b { font-size: 20px; font-weight: 900; color: #fff; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
#scPlay .chip.low b { color: #ffb4a8; animation: lowPulse .6s ease-in-out infinite alternate; }
#scPlay .plank { position: relative; min-width: 150px; padding: 7px 22px 8px; text-align: center; border: 4px solid #4a2a12; border-radius: 12px;
  background: repeating-linear-gradient(92deg, rgba(90, 50, 20, .1) 0 2px, transparent 2px 13px), linear-gradient(180deg, #d9a05f, #b9773a); box-shadow: inset 0 3px 0 rgba(255, 232, 190, .6), inset 0 -3px 0 rgba(90, 50, 20, .25), 0 5px 0 #2f1a0a, 0 8px 10px rgba(0, 0, 0, .35); transform: rotate(-.6deg); }
#scPlay .plank::before, #scPlay .plank::after { content: ''; position: absolute; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #f3d9a5, #7a4a22); box-shadow: 0 1px 0 #4a2a12; }
#scPlay .plank::before { left: 8px; } #scPlay .plank::after { right: 8px; }
#scPlay .plank b { display: block; font-size: 28px; line-height: 1.05; font-weight: 900; letter-spacing: .5px; text-transform: uppercase; color: #fff4c4; -webkit-text-stroke: 4px #5a3112; paint-order: stroke fill; text-shadow: 0 3px 0 #5a3112; }
#scPlay .plank small { display: block; margin-top: 2px; font-size: 12px; font-weight: 800; color: #fff0c8; text-shadow: 0 1px 0 #5a3112; }
#scPlay .plank small b { display: inline; font-size: 12px; -webkit-text-stroke: 0; text-shadow: none; color: #fff; text-transform: none; }
#scPlay .nstat { min-height: 22px; margin: 4px 0 0; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }

/* Nút tròn nhỏ ở hai góc: ký hiệu màu (trái) · làm lại (phải) */
#scPlay .round { position: absolute; top: 8px; z-index: 3; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 3px solid #1c4a63; border-radius: 50%; color: #fff; font-size: 12px; font-weight: 900; letter-spacing: -1px;
  background: radial-gradient(circle at 40% 30%, #4aa6d4, #1f6f98); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .22), 0 3px 0 #0f2f40; }
#scPlay .r-left { left: 8px; } #scPlay .r-right { right: 8px; }
#scPlay .round[aria-pressed="true"] { background: radial-gradient(circle at 40% 30%, #ffe27a, #f5a912); border-color: #7a4a12; }
#scPlay .round:active { transform: translateY(2px); }
#scPlay .round .orb .mbi { width: 22px; height: 22px; display: block; filter: brightness(0) invert(1); }

/* Bàn: cốc đứng trên kệ gỗ (kệ vẽ bằng nền của bàn, lặp theo hàng — cốc nhấc / nghiêng không kéo kệ theo) */
#scPlay .board { --rg: 46px; --sh: 14px; flex: 0 0 auto; margin: auto -12px; padding: 0 0 calc(var(--sh) + 8px); align-content: start; gap: var(--rg) 14px;
  background: repeating-linear-gradient(180deg, transparent 0, transparent calc(var(--tw) * var(--ar) - 4px),
    #c98a4b calc(var(--tw) * var(--ar) - 4px), #b0733a calc(var(--tw) * var(--ar) + 3px), #7a4a25 calc(var(--tw) * var(--ar) + 3px), #6a3f1e calc(var(--tw) * var(--ar) + var(--sh)),
    #2a1608 calc(var(--tw) * var(--ar) + var(--sh)), #2a1608 calc(var(--tw) * var(--ar) + var(--sh) + 3px),
    transparent calc(var(--tw) * var(--ar) + var(--sh) + 3px), transparent calc(var(--tw) * var(--ar) + var(--rg))); }
/* Café background: no sea bubbles, dark status text */
#scPlay .bg-bien::before, #scPlay .bg-bien::after { display: none; }
#scPlay .bg-bien .nstat { justify-self: center; width: fit-content; max-width: 100%; margin: 4px auto 0; padding: 2px 12px; border-radius: 999px; background: rgba(255, 249, 238, .82); text-shadow: none; }
#scPlay .bg-bien .nstat:empty { visibility: hidden; }
#scPlay .tube.sel { transform: translateY(-14px); }

/* Nút điều khiển: tròn to bóng trên ván gỗ cong */
#scPlay .ctl { display: flex; justify-content: space-around; align-items: flex-start; gap: 8px; margin: 6px -12px 0; padding: 22px 14px calc(16px + env(safe-area-inset-bottom));
  border-radius: 50% 50% 0 0 / 26px 26px 0 0; border-top: 4px solid #3f240d;
  background: repeating-linear-gradient(90deg, rgba(60, 30, 10, .1) 0 2px, transparent 2px 12px), linear-gradient(180deg, #c58443, #94602c); box-shadow: inset 0 4px 0 rgba(255, 224, 170, .5), 0 -4px 8px rgba(0, 0, 0, .25); }
#scPlay .ctl button { position: relative; flex: 0 1 104px; display: flex; flex-direction: column; align-items: center; gap: 5px; min-height: 0; padding: 0; border: 0; border-radius: 0; background: none; color: #fff; box-shadow: none; }
#scPlay .ctl .orb { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%; border: 5px solid #6a3f17;
  box-shadow: inset 0 -7px 0 rgba(0, 0, 0, .2), inset 0 6px 0 rgba(255, 255, 255, .45), 0 5px 0 #3f240d, 0 9px 10px rgba(0, 0, 0, .4); }
#scPlay .ctl button:active .orb { transform: translateY(4px); box-shadow: inset 0 -7px 0 rgba(0, 0, 0, .2), inset 0 6px 0 rgba(255, 255, 255, .45), 0 1px 0 #3f240d; }
#scPlay .ctl #btnUndo .orb { background: radial-gradient(circle at 38% 28%, #ffe98a, #f4a410); }
#scPlay .ctl #btnAdd .orb { background: radial-gradient(circle at 38% 28%, #9af5a6, #22a53b); }
#scPlay .ctl #btnHint .orb { background: radial-gradient(circle at 38% 28%, #e2b0ff, #8a38d6); }
#scPlay .ctl .orb .mbi, #scPlay .ctl .orb svg, #scPlay .ctl .orb img { width: 60px; height: 60px; margin: -6px; display: block; filter: brightness(0) invert(1) drop-shadow(0 2px 0 rgba(0, 0, 0, .35)); }
#scPlay .ctl .lbl { font-size: 15px; font-weight: 900; color: #fff; -webkit-text-stroke: 3.5px #4a2a12; paint-order: stroke fill; text-shadow: 0 2px 0 #4a2a12; }
#scPlay .ctl u { top: -6px; right: 4px; min-width: 24px; font-size: 13px; border: 2px solid #7a4a12; }
@media (max-height: 700px) {
  .logo img { width: min(78%, 320px); }
  #scPlay .ctl { padding-top: 16px; }
  #scPlay .ctl .orb { width: 58px; height: 58px; }
  #scPlay .ctl .orb .mbi, #scPlay .ctl .orb svg, #scPlay .ctl .orb img { width: 36px; height: 36px; }
  #scPlay .ctl .lbl { font-size: 13px; }
  #scPlay .plank b { font-size: 22px; }
}
#scPlay .ctl .orb .xi { width: 60px; height: 60px; margin: 0; display: block; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .25)); }
#scPlay .ctl button.dis .orb .xi { filter: grayscale(.5) drop-shadow(0 3px 0 rgba(0, 0, 0, .2)); }
@media (max-height: 700px) { #scPlay .ctl .orb .xi { width: 40px; height: 40px; } }
@media (max-width: 460px) {
  #scPlay .chip { padding: 0 8px 0 38px; height: 38px; gap: 4px; }
  #scPlay .chip .ci { left: -6px; width: 38px; height: 38px; margin-top: -19px; }
  #scPlay .chip .ci > * { width: 36px !important; height: 36px !important; }
  #scPlay .chip b { font-size: 17px; }
  #scPlay .plank { min-width: 0; max-width: 100%; padding: 6px 12px 7px; }
  #scPlay .plank::before { left: 5px; } #scPlay .plank::after { right: 5px; }
  #scPlay .plank b { font-size: 18px; letter-spacing: 0; -webkit-text-stroke-width: 3px; white-space: nowrap; }
  #scPlay .plank small { font-size: 11px; }
  #scPlay .chip b { font-size: 16px; }
}

/* Phone held sideways (orient-check 19/11/2026): cups on the left (sized by the height left, js fitBoard), the wooden
   button board becomes a column on the right, the big logo is dropped — the portrait stack was 704 px tall on 390 px. */
@media (orientation: landscape) and (max-height: 500px) {
  #scPlay .field { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto minmax(0, 1fr);
    grid-template-areas: "hud ctl" "stat ctl" "board ctl"; max-width: none; min-height: calc(100dvh - 44px); margin: -8px -14px -4px; padding: 6px 0 0 12px; border-radius: 0; }
  .wrap:has(> #scPlay:not(.hidden)) { max-width: none; }
  #scPlay .logo { display: none; }
  #scPlay .round { top: 6px; }
  #scPlay .r-right { left: 54px; right: auto; }
  #scPlay .hud { grid-area: hud; margin: 0 0 0 100px; }
  #scPlay .plank { padding: 4px 18px 5px; }
  #scPlay .plank b { font-size: 22px; }
  #scPlay .nstat { grid-area: stat; }
  #scPlay .board { grid-area: board; align-self: center; margin: 4px 0; }
  #scPlay .ctl { grid-area: ctl; flex-direction: column; justify-content: center; align-items: center; gap: 10px; margin: 0; padding: 10px max(14px, env(safe-area-inset-right)) 10px 22px;
    border-top: 0; border-left: 4px solid #3f240d; border-radius: 26px 0 0 26px / 50% 0 0 50%; }
  #scPlay .ctl button { flex: none; gap: 2px; }
  #scPlay .ctl .orb { width: 56px; height: 56px; border-width: 4px; }
}

/* ===== 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 #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; }
.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); }
}

/* 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; }
