/* ================= Xếp Trái Cây — MonBlock (base copied from Nối Ống Tưới Cây) ================= */
: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ủ ---------- */
.me-card { display: flex; align-items: center; gap: 14px; padding: 12px 16px 12px 12px; margin: 6px 0 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
.me-tile { position: relative; display: grid; place-items: center; width: 60px; height: 60px; flex: none; border-radius: 12px; border: 3px solid var(--frame, #2b3a55); background: var(--cell-img, none), var(--cell, #fff); }
.me-num { font-size: 24px; font-weight: 800; line-height: 1; color: var(--user, #335fff); }
.me-tile .me-avemo { position: absolute; inset: 0; display: grid; place-items: center; font-size: 34px; line-height: 1; }
.me-tile.has-av .me-num { display: none; }
.me-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.me-info b { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-info span { color: var(--muted); font-size: 13px; font-weight: 600; }
.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; }
.me-chips { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; font-size: 14px; font-weight: 700; white-space: nowrap; }

.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; }
.homegrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0 6px; }
.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; }

/* ---------- 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; }
.buyprev.intro svg { width: 88px; height: 88px; }

/* ---------- 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; }

/* ================= chọn mức, sảnh online ================= */
.big-sprint { --bar: #ffb020; }
.big-room { --bar: #8a5cff; }
.big-sprint.done small { color: #00a862; }
.today { display: flex; align-items: center; gap: 10px; margin: -4px 0 12px; padding: 10px 14px; border: 1px dashed #c9d2e0; border-radius: 14px; background: #fff; font-size: 14px; }
.today b { font-size: 17px; color: #335fff; }
.today small { color: var(--muted); }
h2 { font-size: 16px; margin: 16px 0 8px; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.seg button { flex: 1; min-width: 80px; padding: 10px 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); font-weight: 800; font-size: 14px; }
.joinrow { display: flex; gap: 8px; margin: 4px 0 8px; }
.joinrow input { flex: 1; min-width: 0; padding: 12px 14px; border: 1px solid #c9d2e0; border-radius: 12px; font: inherit; font-size: 16px; font-weight: 700; letter-spacing: 2px; }
.joinrow button { padding: 0 18px; border: 0; border-radius: 12px; background: #335fff; color: #fff; font-weight: 800; }
.roomcode { margin: 6px 0; font-size: 44px; font-weight: 900; letter-spacing: 8px; text-align: center; color: #335fff; }



/* ================= icons (js/icons.js) ================= */
.xtic { display: inline-flex; vertical-align: -0.22em; width: 1.25em; height: 1.25em; margin-right: .1em; }
.xtic .xti, .xti { width: 100%; height: 100%; display: block; }
.homegrid .xtic { width: 1.4em; height: 1.4em; }
.big { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; }
.big > .xtic { grid-row: 1 / span 2; width: 38px; height: 38px; margin: 0; }
.big > small { grid-column: 2; }
.big-resume { --bar: #ffb020; }
.big-play { --bar: #00a862; }
.big-daily { --bar: #335fff; }
.big-daily.done small { color: #00a862; }
#btnSound .xti { width: 22px; height: 22px; display: block; }
.me-tile { border: 0; background: radial-gradient(circle at 40% 35%, #cfeab0, #8cc56a); box-shadow: inset 0 0 0 3px #4a6a2a; overflow: hidden; }
img.me-num { width: 52px; height: 52px; object-fit: contain; }

/* ================= bản đồ: 6 khu ================= */
.mapcard { margin: 0 0 16px; border-radius: 18px; overflow: hidden; background: #fff; border: 1px solid #e3e5e8; scroll-margin-top: 70px; }
.mapcard.locked { opacity: .6; }
.mhead { position: relative; display: flex; align-items: center; gap: 10px; padding: 14px 12px; min-height: 86px; background: #7aa04a center / cover no-repeat; }
.mhead::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(30, 18, 6, .72), rgba(30, 18, 6, .15)); }
.mhead > * { position: relative; }
.mhead > img:first-child { width: 54px; height: 54px; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .4)); }
.mhead > span { flex: 1; display: flex; flex-direction: column; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
.mhead b { font-size: 17px; }
.mhead small { font-size: 13px; font-weight: 700; opacity: .95; }
.mhead .mp { width: 44px; height: 44px; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .4)); }
.lvgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 12px; }
.lv { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px 6px; border: 2px solid #d8e6c8; border-radius: 14px; background: #f6fbef; font-weight: 900; color: #3d5a1e; }
.lv b { font-size: 17px; }
.lv.done { background: #e4f6d4; border-color: #8cc56a; }
.lv.cur { border-color: #00a862; box-shadow: 0 0 0 3px rgba(0, 168, 98, .25); animation: curPulse 1.4s ease-in-out infinite; }
@keyframes curPulse { 50% { box-shadow: 0 0 0 6px rgba(0, 168, 98, .12); } }
.lv:disabled { opacity: .45; background: #f0f1f2; border-color: #e3e5e8; color: #9aa0a6; }
.st { display: flex; gap: 1px; font-style: normal; }
.st u, .hud-m u, .bigstars u { display: inline-block; width: 12px; height: 12px; background: #d6dbe0;
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.st u.on, .hud-m u.on, .bigstars u.on { background: #ffc21a; }

.me-tile { background: radial-gradient(circle at 40% 35%, #fff2c8, #f2c46a); box-shadow: inset 0 0 0 3px #a8701e; }
.mhead::before { background: linear-gradient(90deg, rgba(40, 18, 4, .74), rgba(40, 18, 4, .12)); }
.mhead .mp { width: 40px; height: 40px; }
.lv { border-color: #f0dcb0; background: #fff8e8; color: #6a4210; }
.lv.done { background: #ffefc4; border-color: #e0a83a; }
/* Hard levels: red marker so players know a tougher board is coming. */
.lv.hard { position: relative; border-color: #d8341e; background: #ffe3dc; color: #9a1c0a; }
.lv.hard.done { background: #ffd0c6; border-color: #d8341e; }
.lv .hd { position: absolute; top: -6px; right: -4px; font-style: normal; font-size: 9px; font-weight: 900; background: #d8341e; color: #fff;
  border-radius: 6px; padding: 0 4px; line-height: 1.4; }
#hudLv.hard { color: #c4200c; }

/* ================= màn chơi ================= */
#scPlay { position: fixed; left: 0; right: 0; z-index: 5; max-width: 620px; margin: 0 auto; padding: 0; animation: none;
  top: calc(var(--mb-top, 52px) + env(safe-area-inset-top)); bottom: 0; }
#scPlay.hidden { display: none !important; }
body.xt-play { background: #7a5a2a; }
.field { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 8px; padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); background: #d9a35a center / cover no-repeat; }

/* Wooden board on top: level + stars · moves · goals (owner-approved mock A). */
.hud { flex: none; display: grid; grid-template-columns: 1fr auto 1.25fr; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 16px;
  background: linear-gradient(#e9b56c, #c98a42); border: 3px solid #6b3f16; box-shadow: inset 0 2px 0 rgba(255, 255, 255, .35), 0 3px 0 #4a2a0c, 0 6px 12px rgba(40, 20, 0, .3); color: #3b1f06; }
.hud small { font-size: 11px; font-weight: 800; color: #6b3f16; text-transform: uppercase; letter-spacing: .3px; }
.hud-l { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.hud-l b { font-size: 17px; font-weight: 900; }
.hud-l small { text-transform: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hst { display: flex; gap: 2px; margin-top: 2px; }
.hst u, .st u, .bigstars u { display: inline-block; width: 13px; height: 13px; background: rgba(80, 40, 10, .35);
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.hst u.on, .st u.on, .bigstars u.on { background: #ffd21a; }
.hud-m { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 66px; height: 66px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #fff6dc, #f3d496); border: 3px solid #6b3f16; line-height: 1; }
.hud-m b { font-size: 26px; font-weight: 900; font-variant-numeric: tabular-nums; }
.hud-m.low b { color: #d8341e; animation: lowPulse .9s ease-in-out infinite; }
@keyframes lowPulse { 50% { transform: scale(1.12); } }
.hud-r { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; min-width: 0; }
.goals { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.goal { position: relative; display: flex; flex-direction: column; align-items: center; width: 44px; }
.goal img, .goal .xti { width: 34px; height: 34px; object-fit: contain; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .3)); }
.goal b { margin-top: -4px; padding: 0 5px; border-radius: 8px; background: #fff6dc; border: 2px solid #6b3f16; font-size: 12px; font-weight: 900; line-height: 1.2; font-variant-numeric: tabular-nums; }
.goal.done b { background: #3ec46d; color: #fff; border-color: #1f7a3e; }
.goal.bump img, .goal.bump .xti { animation: pop .35s ease; }

.boardwrap { flex: 1; min-height: 0; display: grid; place-items: center; }
/* The tray: frame + rounded inner area; cells are absolutely placed so pieces can slide with transforms. */
.tray { --cs: 48px; --frame: linear-gradient(145deg, #e6c27e, #b9864a); --edge: #6b4418; --slot: rgba(255, 246, 220, .82); --slot2: rgba(246, 230, 190, .82);
  padding: 10px; border-radius: 22px; background: var(--frame); border: 4px solid var(--edge);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, .35), inset 0 -4px 0 rgba(0, 0, 0, .18), 0 10px 22px rgba(40, 20, 0, .38); touch-action: none; user-select: none; -webkit-user-select: none; }
.tray .grid { position: relative; width: calc(var(--cols) * var(--cs)); height: calc(var(--rows) * var(--cs)); }
.slot { position: absolute; left: calc(var(--x) * var(--cs)); top: calc(var(--y) * var(--cs)); width: var(--cs); height: var(--cs); padding: 1.5px; }
.slot::before { content: ''; position: absolute; inset: 1.5px; border-radius: calc(var(--cs) * .2); background: var(--slot); box-shadow: inset 0 2px 3px rgba(80, 50, 10, .18); }
.slot.alt::before { background: var(--slot2); }
.ice { position: absolute; left: calc(var(--x) * var(--cs)); top: calc(var(--y) * var(--cs)); width: var(--cs); height: var(--cs); padding: 1.5px; z-index: 1; pointer-events: none; }
.ice svg { width: 100%; height: 100%; display: block; }
.ice.crack { animation: crack .35s ease forwards; }
@keyframes crack { to { opacity: 0; transform: scale(1.25); } }
.pc { position: absolute; left: 0; top: 0; z-index: 2; width: var(--cs); height: var(--cs); transition: transform var(--fall, .2s) cubic-bezier(.3, .1, .4, 1.15); will-change: transform; pointer-events: none; }
.pc .fr { position: absolute; left: 7%; top: 7%; width: 86%; height: 86%; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(60, 30, 0, .35)); }
.pc .sp { position: absolute; left: 4%; top: 4%; width: 92%; height: 92%; pointer-events: none; }
.pc .sp.glow { animation: glow 1.1s ease-in-out infinite; }
@keyframes glow { 50% { transform: scale(1.08); filter: drop-shadow(0 0 5px #fff6b0); } }
.pc.s-c .fr { animation: lotus 2.4s linear infinite; filter: drop-shadow(0 0 6px rgba(255, 255, 255, .9)); }
@keyframes lotus { 50% { transform: scale(1.06) rotate(6deg); } }
.pc.sel .fr { animation: sel .6s ease-in-out infinite; }
@keyframes sel { 50% { transform: scale(1.14); } }
.pc.pop { transition: transform .22s ease, opacity .22s ease !important; opacity: 0; }
.pc.hintme .fr { animation: hintme .8s ease-in-out 3; }
@keyframes hintme { 50% { transform: scale(1.18) rotate(-8deg); } }
.cr { position: absolute; left: calc(var(--x) * var(--cs)); top: calc(var(--y) * var(--cs)); width: var(--cs); height: var(--cs); z-index: 3; padding: 1px; pointer-events: none; filter: drop-shadow(0 3px 2px rgba(50, 25, 0, .4)); }
.cr svg { width: 100%; height: 100%; display: block; }
.cr.hit { animation: crHit .4s ease; }
@keyframes crHit { 20% { transform: translate(-3px, 1px) rotate(-5deg); } 45% { transform: translate(3px, -1px) rotate(5deg) scale(1.06); } 70% { transform: translate(-2px, 0) rotate(-2deg); } }
.cr.break { animation: crBreak .42s ease-in forwards; }
@keyframes crBreak { 30% { transform: scale(1.14) rotate(4deg); } 100% { opacity: 0; transform: scale(.4) rotate(-18deg) translateY(14px); } }
/* Maps 16+: mud fills a slot (no fruit), a bamboo cage sits on top of a fruit, the seed bobs a little. */
.md { position: absolute; left: calc(var(--x) * var(--cs)); top: calc(var(--y) * var(--cs)); width: var(--cs); height: var(--cs); z-index: 3; padding: 1px; pointer-events: none; filter: drop-shadow(0 2px 2px rgba(50, 25, 0, .35)); }
.md svg, .cg svg { width: 100%; height: 100%; display: block; }
.md.grow { animation: mdGrow .45s ease-out; }
@keyframes mdGrow { from { transform: scale(.2); opacity: .2; } 70% { transform: scale(1.12); } }
.md.break, .cg.break { animation: crBreak .42s ease-in forwards; }
/* Seed levels: the lowest slot of every column glows green (seeds are collected there). */
.sdx { position: absolute; left: calc(var(--x) * var(--cs) + 1.5px); top: calc(var(--y) * var(--cs) + 1.5px); width: calc(var(--cs) - 3px); height: calc(var(--cs) - 3px); z-index: 1; pointer-events: none;
  border-radius: calc(var(--cs) * .2); background: rgba(126, 217, 87, .45); box-shadow: inset 0 -5px 0 #3f9a35; animation: sdx 1.4s ease-in-out infinite; }
.sdx svg { position: absolute; left: 25%; bottom: 4%; width: 50%; height: 26%; }
@keyframes sdx { 50% { background: rgba(126, 217, 87, .7); } }
.cg { position: absolute; left: calc(var(--x) * var(--cs)); top: calc(var(--y) * var(--cs)); width: var(--cs); height: var(--cs); z-index: 3; pointer-events: none; filter: drop-shadow(0 2px 2px rgba(50, 25, 0, .35)); }
.cg.hit { animation: crHit .4s ease; }
.pc .seed { position: absolute; left: 0; top: -2%; width: 100%; height: 100%; animation: seedBob 1.6s ease-in-out infinite; }
@keyframes seedBob { 50% { transform: translateY(-4%) rotate(-4deg); } }
.vn { position: absolute; left: calc(var(--x) * var(--cs)); top: calc(var(--y) * var(--cs)); width: var(--cs); height: var(--cs); z-index: 3; pointer-events: none; }
.vn img { position: absolute; inset: -6%; width: 112%; height: 112%; object-fit: contain; }
.vn.cut { animation: crack .35s ease forwards; }
.selbox { position: absolute; z-index: 1; width: var(--cs); height: var(--cs); border-radius: calc(var(--cs) * .22); box-shadow: inset 0 0 0 3px #fff, 0 0 10px 2px #ffd23f; pointer-events: none; }
.combo { position: absolute; z-index: 6; left: 50%; top: 40%; transform: translate(-50%, -50%); padding: 4px 14px; border-radius: 14px; background: #fff6dc; border: 3px solid #6b3f16;
  color: #b4430c; font-size: 22px; font-weight: 900; pointer-events: none; animation: comboUp 1s ease forwards; white-space: nowrap; }
@keyframes comboUp { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.6); } 20% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -110%) scale(1); } }
.beam { position: absolute; z-index: 4; pointer-events: none; border-radius: 999px; background: linear-gradient(90deg, transparent, #fffbe0 30%, #fff 50%, #fffbe0 70%, transparent);
  box-shadow: 0 0 14px 4px rgba(255, 240, 170, .8); animation: beam .35s ease-out forwards; }
@keyframes beam { from { opacity: 1; } to { opacity: 0; } }

/* Tray styles (shop): frame, edge and the two slot colours. */
.tr-tre { --frame: repeating-linear-gradient(45deg, #e2bb72 0 6px, #cfa258 6px 12px); --edge: #6b4418; }
.tr-go { --frame: linear-gradient(160deg, #e8b36a, #b8732e 60%, #9a5c22); --edge: #5a300c; --slot: rgba(255, 238, 205, .85); --slot2: rgba(240, 214, 170, .85); }
.tr-la { --frame: radial-gradient(circle at 30% 20%, #8fd36a, #3f9a3a); --edge: #23602a; --slot: rgba(236, 250, 214, .85); --slot2: rgba(214, 238, 186, .85); }
.tr-dong { --frame: linear-gradient(145deg, #ffe08a, #d39a2a 45%, #f5cf6a 70%, #b07418); --edge: #7a4a08; --slot: rgba(255, 246, 214, .85); --slot2: rgba(250, 230, 178, .85); }
.tr-su { --frame: repeating-radial-gradient(circle at 50% 50%, #fff 0 8px, #e4efff 8px 10px); --edge: #2c5aa8; --slot: rgba(255, 255, 255, .92); --slot2: rgba(222, 236, 255, .92); }
.tr-sonmai { --frame: linear-gradient(145deg, #c8221a, #8a0e0a); --edge: #e8b43a; --slot: rgba(255, 240, 222, .88); --slot2: rgba(250, 220, 196, .88); }
.tr-ngoc { --frame: linear-gradient(145deg, #7ff0c8, #1fa68a 50%, #6ee0bc); --edge: #0c5c4a; --slot: rgba(230, 255, 246, .85); --slot2: rgba(200, 244, 228, .85); }
.tr-ngoc .grid::after { content: ''; position: absolute; inset: -10px; border-radius: 18px; pointer-events: none; background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, .45) 50%, transparent 60%) 0 0 / 300% 100%; animation: shine 4s linear infinite; }
@keyframes shine { to { background-position: -300% 0; } }
.tr-len { --frame: repeating-linear-gradient(60deg, rgba(0, 0, 0, .12) 0 2px, transparent 2px 5px), repeating-linear-gradient(90deg, #d8323a 0 10px, #fff4e6 10px 14px, #d8323a 14px 24px, #2e7d4f 24px 28px); --edge: #7a1418; --slot: rgba(255, 248, 236, .9); --slot2: rgba(250, 228, 214, .9); }
.tr-banggia { --frame: radial-gradient(circle at 20% 15%, #fff 0 6%, transparent 7%), radial-gradient(circle at 78% 82%, #fff 0 5%, transparent 6%), linear-gradient(150deg, #e9f8ff, #9fd6f5 45%, #d8f1ff 70%, #79bde6); --edge: #2f6f9f; --slot: rgba(240, 250, 255, .9); --slot2: rgba(214, 238, 252, .9); }
.tr-banggia .grid::after { content: ''; position: absolute; inset: -10px; border-radius: 18px; pointer-events: none; background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, .6) 50%, transparent 60%) 0 0 / 300% 100%; animation: shine 5s linear infinite; }

.field .nstat { flex: none; min-height: 22px; margin: 0 auto; max-width: 100%; padding: 3px 12px; border-radius: 999px; background: rgba(255, 246, 220, .94); color: #3b1f06; text-align: center; font-size: 14px; font-weight: 800; }
.field .nstat:empty { visibility: hidden; }
.ctl { flex: none; display: flex; gap: 8px; }
.ctl button { position: relative; flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 10px 6px; border: 3px solid #6b3f16; border-radius: 16px;
  background: linear-gradient(#f3c77e, #d9a050); color: #3b1f06; font-weight: 900; font-size: 14px; box-shadow: inset 0 2px 0 rgba(255, 255, 255, .4), 0 3px 0 #4a2a0c; }
.ctl button .xtic { width: 1.6em; height: 1.6em; }
.ctl button:active { transform: translateY(2px); box-shadow: 0 1px 0 #4a2a0c; }
.ctl button:disabled { opacity: .45; }
.ctl button.on { background: linear-gradient(#fff3b0, #ffd04a); box-shadow: 0 0 0 3px #fff, 0 0 14px #ffd23f; }
.ctl u { position: absolute; top: -8px; right: -4px; min-width: 22px; padding: 1px 5px; border-radius: 11px; background: #d8341e; color: #fff; border: 2px solid #fff; text-decoration: none; font-size: 12px; }
.ptc { position: fixed; left: 0; top: 0; z-index: 60; width: 22px; height: 22px; pointer-events: none; }
.ptc svg { width: 100%; height: 100%; overflow: visible; }
.dialog .score small { color: #9aa0a6; font-size: 20px; }
.bigstars { display: flex; justify-content: center; gap: 6px; margin: 4px 0; }
.bigstars u { width: 44px; height: 44px; background: #d6dbe0; }
.newmap { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; background: #fff3d8; }
.newmap img { width: 54px; height: 70px; object-fit: cover; border-radius: 8px; }
.goalrow { display: flex; justify-content: center; gap: 10px; margin: 6px 0; }
.goalrow .goal b { background: #fff; }

@media (max-width: 380px) {
  .hud { padding: 5px 8px; gap: 5px; }
  .hud-m { width: 56px; height: 56px; }
  .hud-m b { font-size: 22px; }
  .goal { width: 38px; }
  .goal img, .goal .xti { width: 28px; height: 28px; }
  .ctl button span { display: none; }
}

/* ================= cửa hàng: ô xem thử vẽ bằng đúng hàm của khay (js/art.js) ================= */
.pv { position: relative; display: flex; justify-content: center; width: 100%; pointer-events: none; }
.pv .tray { --cs: 30px; padding: 6px; border-width: 3px; border-radius: 14px; }
.pv .pvfx { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.buyprev .pv .tray { --cs: 52px; }
.boostpv { display: grid; place-items: center; width: 96px; height: 96px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #fff6dc, #f0c878); border: 3px solid #6b3f16; }
.boostpv .xti { width: 60px; height: 60px; }
.boostpv b { position: absolute; margin: 62px 0 0 62px; padding: 1px 7px; border-radius: 10px; background: #d8341e; color: #fff; font-size: 14px; }

/* ---------- thẻ món cửa hàng: giá dính đáy, hai hàng cố định (🪙 / 💎) để mọi thẻ thẳng hàng ---------- */
.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; }
@keyframes pop { 40% { transform: scale(1.18); } }
.tray .grid { overflow: hidden; border-radius: calc(var(--cs) * .25); }
.selbox { left: 0; top: 0; transition: transform .1s ease; }
.pv .tray, .pv .grid, .pv .slot, .pv .pc { display: block; }
.pv .grid { overflow: hidden; }
/* Shop grid previews stand still (owner 22/11/2026: a phone froze on lists of animated previews); the big preview in
   the buy box (.buyprev) keeps moving. */
:not(.buyprev) > .pv *, :not(.buyprev) > .pv *::before, :not(.buyprev) > .pv *::after { animation: none !important; }
/* Still sweep of the shiny trays: band across the middle (at 0 0 it sits outside the frame). */
:not(.buyprev) > .pv .tray .grid::after { background-position: 50% 0; }

/* Limited-event tag on a shop card (sdk/events.js). */
.item .evtag { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: linear-gradient(90deg, #8fd0ff, #c9b8ff); color: #1d2a4a; }

/* ================= hết lượt: mẹt tre tròn + trái cây mếu máo (mẫu B, chủ dự án chọn 07/11/2026) ================= */
body.mb-light .dialog.lose, .dialog.lose { position: relative; width: min(340px, 100%); margin-top: 60px; overflow: visible; padding: 78px 22px 22px; border: 6px solid #6b4418; color: #3b1f06; text-align: center;
  border-radius: 50% 50% 44px 44px / 120px 120px 44px 44px; background: repeating-linear-gradient(45deg, #e2bb72 0 7px, #cfa258 7px 14px);
  box-shadow: inset 0 0 0 8px rgba(255, 240, 200, .35), 0 18px 30px rgba(0, 0, 0, .45); animation: loseIn .35s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes loseIn { from { transform: scale(.7); opacity: 0; } }
.dialog.lose .mascot { position: absolute; left: 50%; top: -62px; width: 130px; height: 130px; transform: translateX(-50%); animation: sob 1.6s ease-in-out infinite; }
@keyframes sob { 50% { transform: translateX(-50%) rotate(-5deg) translateY(3px); } }
.dialog.lose .mascot img, .dialog.lose .mascot .face { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.dialog.lose .mascot img { filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .35)); }
.dialog.lose .inner { padding: 14px 12px 14px; border-radius: 22px; background: #fff8e8; border: 3px solid #b9864e; }
.dialog.lose h3 { margin: 0 0 4px; font-size: 26px; font-weight: 900; color: #c2410c; }
.dialog.lose p { margin: 0 0 12px; font-size: 16px; font-weight: 700; color: #6b4418; }
.lgoals { display: flex; justify-content: center; gap: 22px; margin: 6px 0 2px; }
.lg { position: relative; width: 52px; height: 52px; }
.lg img, .lg .xti { width: 52px; height: 52px; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .3)); }
.lg b { position: absolute; right: -12px; top: -8px; min-width: 28px; padding: 2px 6px; border-radius: 14px; background: #e8352e; color: #fff; border: 3px solid #fff; font-size: 15px; font-weight: 900; line-height: 1.2; }
.dialog.lose .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(#ffb43a, #f07c12); color: #fff; font-size: 20px; font-weight: 900; box-shadow: inset 0 3px 0 rgba(255, 255, 255, .45), 0 5px 0 #a24d06; text-shadow: 0 2px 0 #a24d06; }
.dialog.lose .more:active { transform: translateY(3px); box-shadow: inset 0 3px 0 rgba(255, 255, 255, .45), 0 2px 0 #a24d06; }
.dialog.lose .more .xti { width: 32px; height: 32px; flex: none; }
.dialog.lose .links { display: flex; justify-content: center; gap: 22px; margin-top: 12px; }
.dialog.lose .links button { display: flex; align-items: center; gap: 6px; padding: 6px 4px; border: 0; background: none; font-size: 16px; font-weight: 900; color: #6b4418; }
.dialog.lose .links .xti { width: 24px; height: 24px; }

/* ================= qua màn: cùng mẹt tre của bảng hết lượt, trái xoài cười + nút Chia sẻ (chủ dự án 07/11/2026) ================= */
.dialog.lose.win .mascot { animation: cheer 1.4s ease-in-out infinite; }
@keyframes cheer { 50% { transform: translateX(-50%) translateY(-6px) rotate(4deg); } }
.dialog.win .spk { position: absolute; width: 18px; height: 18px; background: #ffd21a; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  animation: twinkle 1.2s ease-in-out infinite; }
.dialog.win .s1 { left: -14px; top: 22px; } .dialog.win .s2 { right: -16px; top: 8px; width: 22px; height: 22px; animation-delay: .4s; } .dialog.win .s3 { right: -6px; top: 70px; width: 13px; height: 13px; animation-delay: .8s; }
@keyframes twinkle { 50% { transform: scale(.4) rotate(45deg); opacity: .5; } }
.dialog.win h3 { color: #2f8f1f; }
.dialog.win .wsub { margin: 0 0 6px; font-size: 14px; font-weight: 800; color: #8a5a22; }
.wstars { display: flex; justify-content: center; align-items: flex-end; gap: 4px; margin: 2px 0 4px; }
.wstars u { width: 52px; height: 52px; background: #d9c39a; clip-path: polygon(50% 2%, 62% 36%, 98% 37%, 69% 59%, 80% 95%, 50% 74%, 20% 95%, 31% 59%, 2% 37%, 38% 36%); }
.wstars u:nth-child(2) { width: 64px; height: 64px; margin-bottom: 8px; }
.wstars u.on { background: radial-gradient(circle at 40% 30%, #fff6b0, #ffd21a 45%, #f39a0b); animation: starPop .45s cubic-bezier(.3, 1.6, .5, 1) both; animation-delay: var(--d); }
@keyframes starPop { from { transform: scale(0) rotate(-40deg); } }
.dialog.win .wleft { margin: 0 0 8px; font-size: 15px; font-weight: 800; color: #6b4418; }
.dialog.win .wleft b { font-size: 24px; color: #c2410c; }
.dialog.win .wtip { margin: 0 0 8px; font-size: 13px; font-weight: 700; color: #8a5a22; }
.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 .xti { 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.win .newmap { margin: 8px 0 0; text-align: left; color: #3b1f06; }
.wbtns { display: flex; gap: 8px; margin-top: 14px; }
.dialog.win .wbtns .more { flex: 1; margin-top: 0; background: linear-gradient(#7ed957, #2f9e2a); box-shadow: inset 0 3px 0 rgba(255, 255, 255, .45), 0 5px 0 #1d6b18; text-shadow: 0 2px 0 #1d6b18; }
.dialog.win .wbtns .more:active { box-shadow: inset 0 3px 0 rgba(255, 255, 255, .45), 0 2px 0 #1d6b18; }
.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 .xti { width: 26px; height: 26px; }
.wshare .xti * { stroke: #fff; }
.modal:has(.dialog.win) { place-items: safe center; overflow-y: auto; }
/* "Share for +5 moves" on the out-of-moves tray: same blue as the win tray's share button, full width under the orange one. */
.dialog.lose .wshare.wide { flex-direction: row; gap: 8px; width: 100%; margin-top: 12px; padding: 10px; border-radius: 999px; font-size: 16px; }

/* Big icons (owner 15/11/2026): power-up buttons, goals and badges readable under a thumb */
.ctl button { padding: 12px 6px; font-size: 16px; min-height: 60px; }
.ctl button .xtic { width: 2.1em; height: 2.1em; }
.ctl u { min-width: 26px; font-size: 14px; line-height: 18px; }
.goal { width: 54px; }
.goal img, .goal .xti { width: 44px; height: 44px; }
.goal b { font-size: 14px; }
.hud-m { width: 76px; height: 76px; }
.hud-m b { font-size: 30px; }
.hud-l b { font-size: 20px; }
@media (max-height: 700px) {
  .goal { width: 46px; }
  .goal img, .goal .xti { width: 36px; height: 36px; }
  .hud-m { width: 62px; height: 62px; }
}

/* ================= trang chủ v5 (mẫu A "chợ quê", chủ dự án duyệt 16/11/2026 — y hệt ảnh mẫu, cùng khuôn Gộp Trái Cây) =================
   Trang chủ là tranh TOÀN MÀN HÌNH (khung app ẩn thanh trên / băng rôn / thanh dưới). Ảnh nền 714 x 1280 phủ kín màn (kiểu cover); mọi nút đặt theo toạ độ trong ảnh:
   --u = 1% bề ngang ảnh đã phóng, --ox / --oy = độ lệch của ảnh so với màn. Chừa 30px đáy cho dòng link hướng dẫn. */
#scHome { position: fixed; inset: 0; z-index: 5; margin: 0; padding: 0; overflow: hidden; background: linear-gradient(#85d1df calc(var(--oy) + var(--H) * .5), #3e6e32 calc(var(--oy) + var(--H) * .5)); container-type: size;
  --avail: calc(100cqh - 46px); --u: calc(min(100cqw, var(--avail) * .5578) / 100); --H: calc(var(--u) * 179.27);
  --ox: calc((100cqw - var(--u) * 100) / 2); --oy: calc(var(--avail) - var(--H)); }
body:has(#scHome:not(.hidden)) { background: #3e6e32; }
body:has(#scHome:not(.hidden)) .mb-nav { display: none !important; }
#scHome button { -webkit-appearance: none; appearance: none; font-family: inherit; }
#scHome button:focus, #scHome button:focus-visible { outline: none; }
#scHome .xh-hero { position: absolute; left: var(--ox); top: var(--oy); width: calc(var(--u) * 100); height: var(--H); margin: 0; pointer-events: none; }
#scHome .xh-hero img { display: block; width: 100%; height: 100%; -webkit-mask-image: linear-gradient(transparent 0, #000 6%, #000 96%, transparent 100%); mask-image: linear-gradient(transparent 0, #000 6%, #000 96%, transparent 100%); }
#scHome .today, #scHome .big-resume { display: none !important; }

/* nút ‹ (về cổng) và ⚙ (âm thanh) nổi ở góc phải, như Gộp Trái Cây */
.hm-back, .hm-gear { position: absolute; z-index: 6; 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 { right: max(10px, env(safe-area-inset-right)); background: #fff; border: 3px solid #e3e5e8; color: #191b1d; font: 700 28px/1 system-ui; padding-bottom: 4px; }
.hm-gear { top: calc(max(10px, env(safe-area-inset-top)) + 52px); right: max(10px, env(safe-area-inset-right)); border-radius: 13px; background: linear-gradient(#5ab4ff, #2a6fd8); border: 3px solid #e8f7ff; color: #fff; }
.hm-gear svg { width: 26px; height: 26px; display: block; }
.hm-gear .hm-mute { display: none; position: absolute; width: 30px; height: 4px; background: #fff; border-radius: 3px; transform: rotate(-45deg); box-shadow: 0 0 0 1px #2a6fd8; }
.hm-gear.off .hm-mute { display: block; }
#btnSound { display: none; }

/* thẻ người chơi + ô số */
#scHome .me-card { position: absolute; z-index: 3; left: max(8px, env(safe-area-inset-left)); right: 64px; top: max(8px, env(safe-area-inset-top)); margin: 0; padding: 0; border: 0; background: none; box-shadow: none;
  display: flex; align-items: flex-start; gap: calc(var(--u) * 1.2); }
#scHome .me-tile { position: relative; z-index: 2; flex: none; width: calc(var(--u) * 14); height: calc(var(--u) * 14); border-radius: 50%; border: calc(var(--u) * .9) solid #b98a52;
  box-shadow: 0 calc(var(--u) * .4) 0 rgba(120, 78, 30, .4); background: #fff4d6; }
#scHome img.me-num { width: 78%; height: 78%; }
#scHome .me-tile .me-avemo { font-size: calc(var(--u) * 6.4); }
#scHome .me-info { flex: 0 0 calc(var(--u) * 27); margin: calc(var(--u) * 2.4) 0 0 calc(var(--u) * -6); padding: calc(var(--u) * 1) calc(var(--u) * 1.6) calc(var(--u) * 1.2) calc(var(--u) * 8);
  gap: calc(var(--u) * .8); border: calc(var(--u) * .5) solid #c9a36a; border-radius: calc(var(--u) * 3); background: linear-gradient(#fff4d6, #f3dfae); box-shadow: 0 calc(var(--u) * .5) 0 rgba(120, 78, 30, .3); }
#scHome .me-info b { display: none; }
#scHome .me-info span { display: inline-block; align-self: flex-start; padding: 0 calc(var(--u) * 2.2); border-radius: calc(var(--u) * 1.8); background: rgba(200, 170, 120, .45);
  color: #7a5a38; font-size: calc(var(--u) * 3.2); font-weight: 800; line-height: 1.5; white-space: nowrap; }
#scHome .xpbar { position: relative; overflow: visible; height: calc(var(--u) * 2.6); margin-left: calc(var(--u) * 5.4); border: calc(var(--u) * .5) solid #5a4a36; border-radius: 9px; background: #6a5a46; }
#scHome .xpbar::before { content: 'XP'; position: absolute; left: calc(var(--u) * -5.6); top: 50%; transform: translateY(-50%); color: #5fb82a; font-size: calc(var(--u) * 2.8); font-weight: 900; text-shadow: 0 calc(var(--u) * .3) 0 #fff; }
#scHome .xpbar i { min-width: calc(var(--u) * 2); background: linear-gradient(#a3ea58, #3fa11e); }
#scHome .me-chips { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr 1fr; gap: calc(var(--u) * 2) calc(var(--u) * 1.4); margin-top: calc(var(--u) * 1.4); }
#scHome .me-chips > span { position: relative; display: flex; align-items: center; gap: calc(var(--u) * .8); min-height: calc(var(--u) * 6); padding: calc(var(--u) * .3) calc(var(--u) * 6.4) calc(var(--u) * .3) calc(var(--u) * 1.8);
  border: calc(var(--u) * .5) solid #c9a36a; border-radius: 999px; background: linear-gradient(#fff4d6, #f3dfae); color: #5a3a1c; font-size: calc(var(--u) * 3.3); font-weight: 900; white-space: nowrap;
  box-shadow: 0 calc(var(--u) * .5) 0 rgba(120, 78, 30, .3); }
#scHome .me-chips > span:nth-child(3) { grid-column: 2; }
#scHome .me-chips > span::after { content: '+'; position: absolute; right: calc(var(--u) * .7); top: 50%; transform: translateY(-50%); width: calc(var(--u) * 4.2); height: calc(var(--u) * 4.2); border-radius: 50%;
  background: #e8a23a; border: calc(var(--u) * .45) solid #b97a1c; color: #fff7dc; font-size: calc(var(--u) * 3.4); font-weight: 900; line-height: calc(var(--u) * 3.1); text-align: center; }

/* nút lớn — cùng chỗ, cùng cỡ với mẫu (toạ độ ảnh 714 x 1280) */
#scHome .big, #scHome .homegrid { position: absolute; }
#scHome .big { z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 0; padding: 0; text-align: center;
  white-space: nowrap; text-transform: uppercase; line-height: 1.05; font-weight: 900; font-family: "Arial Rounded MT Bold", "Nunito", "Trebuchet MS", "Segoe UI", Roboto, sans-serif;
  paint-order: stroke fill; letter-spacing: .02em; }
#scHome .big::before, #scHome .big::after { display: none; }
#scHome .big > .xtic { display: none; }
#scHome .big small { text-transform: none; letter-spacing: 0; font-weight: 800; margin-top: calc(var(--u) * .5); }
#scHome .big-play { left: calc(var(--ox) + var(--u) * 14.7); width: calc(var(--u) * 70.7); top: calc(var(--oy) + var(--H) * .6735); height: calc(var(--H) * .098);
  border: calc(var(--u) * .9) solid #f0c040; border-radius: calc(var(--u) * 6); background: linear-gradient(#9be857 0, #4cb82a 55%, #35a01c 100%); color: #fff2a8; font-size: calc(var(--u) * 6.2); padding-left: calc(var(--u) * 11);
  -webkit-text-stroke: calc(var(--u) * 1.1) #6a3a10; text-shadow: 0 calc(var(--u) * .6) 0 #6a3a10; box-shadow: 0 calc(var(--u) * 1) 0 #8a6a1c, 0 calc(var(--u) * 1.6) calc(var(--u) * 2.4) rgba(0, 0, 0, .22); }
#scHome .big-play small { color: #fff6c8; font-size: calc(var(--u) * 3.4); -webkit-text-stroke: calc(var(--u) * .45) #2f5a10; text-shadow: none; }
#scHome .big-play::before { display: block; content: ''; position: absolute; left: 3.6%; top: 50%; width: 11%; aspect-ratio: 1; transform: translateY(-50%);
  border-radius: 26%; background: linear-gradient(#b6f27a, #62c83a); box-shadow: inset 0 0 0 calc(var(--u) * .5) #2f6b12; }
#scHome .big-play::after { display: block; content: ''; position: absolute; left: 6.7%; top: 50%; width: 5.2%; aspect-ratio: 1; transform: translateY(-50%);
  background: #fffbe0; clip-path: polygon(15% 8%, 92% 50%, 15% 92%); }
#scHome .big-daily { left: calc(var(--ox) + var(--u) * 28.3); width: calc(var(--u) * 43.1); top: calc(var(--oy) + var(--H) * .7836); height: calc(var(--H) * .069);
  border: calc(var(--u) * .6) solid #b98a1c; border-radius: calc(var(--u) * 3.2); background: linear-gradient(#ffe36a, #f5b81c); color: #5a3a00; font-size: calc(var(--u) * 4.8);
  -webkit-text-stroke: calc(var(--u) * .7) #fff6d0; box-shadow: 0 calc(var(--u) * .9) 0 #9a6a10; }
#scHome .big-daily small { color: #6b4300; font-size: calc(var(--u) * 2.8); -webkit-text-stroke: 0; }
#scHome .big-daily.done small { color: #2f7a1c; }
#scHome .big:active { transform: translateY(calc(var(--u) * .6)); }

/* ba ô gỗ */
#scHome .homegrid { z-index: 2; left: calc(var(--ox) + var(--u) * 12.6); width: calc(var(--u) * 74.7); top: calc(var(--oy) + var(--H) * .8672); margin: 0; gap: 5.6%; display: grid; grid-template-columns: repeat(3, 1fr); }
#scHome .small { position: relative; display: flex; align-items: flex-end; justify-content: center; aspect-ratio: 150 / 148; padding: 0 0 6%; border: calc(var(--u) * .7) solid #4a2a14;
  border-radius: calc(var(--u) * 4); background: linear-gradient(#c98a52, #a8693a 60%, #9a5e30); box-shadow: 0 calc(var(--u) * .9) 0 #4a2a14, inset 0 calc(var(--u) * .5) 0 rgba(255, 255, 255, .25);
  color: #fff3d4; font-family: "Arial Rounded MT Bold", "Nunito", "Trebuchet MS", "Segoe UI", Roboto, sans-serif; font-size: calc(var(--u) * 3.1); font-weight: 900; text-transform: uppercase;
  white-space: nowrap; paint-order: stroke fill; -webkit-text-stroke: calc(var(--u) * .6) #4a2a14; }
#scHome .small .xtic { display: none; }
#scHome .small::before { content: ''; position: absolute; left: 8%; right: 8%; top: 7%; height: 58%; background: center / contain no-repeat; }
#scHome #btnShop::before { background-image: url(../img/ic-shop.webp); }
#scHome #btnRank::before { background-image: url(../img/ic-rank.webp); }
#scHome #btnHelp::before { background-image: url(../img/ic-help.webp); }
#scHome .small:active { transform: translateY(calc(var(--u) * .6)); }

/* dòng link hướng dẫn ở đáy (SEO) — ghi chú khác ẩn */
#scHome .note { position: absolute; z-index: 4; left: 8px; right: 8px; bottom: 5px; margin: 0; padding: 3px 8px; border-radius: 8px; background: rgba(40, 60, 20, .62); color: #fff;
  font-size: 10.5px; line-height: 1.3; text-align: center; text-shadow: none; }
#scHome .note a { color: #ffe9a0; }
#scHome #statsLine, #scHome #guestNote { display: none !important; }
#scHome .note.guide-link { display: block; line-height: 1.3; padding: 4px 8px; }
#scHome .note.guide-link a { display: inline; padding: 0; margin: 0 2px; min-height: 0; }
#scHome .note.guide-link a { display: inline !important; padding: 0 !important; margin: 0 2px !important; min-height: 0 !important; line-height: inherit !important; }

/* v6: nút + ô gỗ + chữ lớn đã vẽ sẵn trong ảnh nền (y hệt mẫu) — ở đây chỉ còn vùng bấm trong suốt và hai dòng chữ phụ đổi theo người chơi */
#scHome .big, #scHome .small { background: none !important; border: 0 !important; box-shadow: none !important; color: transparent !important; -webkit-text-stroke: 0 !important; text-shadow: none !important; }
#scHome .big-play::before, #scHome .big-play::after, #scHome .small::before { display: none !important; }
#scHome .big small { position: absolute; left: 0; right: 0; margin: 0; text-align: center; font-family: "Arial Rounded MT Bold", "Nunito", "Trebuchet MS", "Segoe UI", Roboto, sans-serif; }
#scHome .big-play small { top: calc(var(--u) * 11.6); padding-left: calc(var(--u) * 9.8); font-size: calc(var(--u) * 3.5); font-weight: 900; color: #fff6c8 !important;
  -webkit-text-stroke: calc(var(--u) * .9) #2f5a10 !important; paint-order: stroke fill; }
#scHome .big-daily small { top: calc(var(--u) * 7.9); font-size: calc(var(--u) * 3.2); font-weight: 900; color: #6b4300 !important; -webkit-text-stroke: 0 !important; }
#scHome .big-daily.done small { color: #2f7a1c !important; }
#scHome .small:active, #scHome .big:active { transform: none; opacity: .85; }

/* Power-up bar (owner mock 16/11/2026): three round wood-slice buttons with a drawn tool, a gold count badge, standing on a bamboo rail */
.ctl { position: relative; justify-content: center; align-items: center; gap: 6%; padding: 12px 0 14px; }
.ctl::before { content: ''; position: absolute; left: 2%; right: 2%; bottom: 4px; height: 16px; border-radius: 8px; border: 2px solid #4a6a1c;
  background: repeating-linear-gradient(90deg, #b9cf62 0 46px, #9fb84a 46px 50px); box-shadow: 0 3px 0 rgba(60, 80, 20, .45); z-index: 0; }
.ctl button, .ctl button.on { position: relative; z-index: 1; flex: none; width: 70px; height: 70px; min-height: 0; padding: 0; border: 3px solid #5a3416; border-radius: 50%;
  background: radial-gradient(circle at 38% 30%, #f6d9a0 0, #e6b877 55%, #d29a5a 100%), #e6b877;
  box-shadow: inset 0 0 0 4px #c98a4a, inset 0 0 0 5px rgba(120, 70, 30, .55), inset 0 0 0 11px #e9bf80, inset 0 0 0 12px rgba(150, 95, 45, .4), 0 4px 0 #4a2a0c; }
.ctl button img { width: 62%; height: 62%; object-fit: contain; display: block; margin: auto; pointer-events: none; }
.ctl button.on { box-shadow: 0 0 0 4px #fff, 0 0 16px 4px #ffd23f, inset 0 0 0 4px #c98a4a, 0 4px 0 #4a2a0c; }
.ctl button:active { transform: translateY(2px); }
.ctl u { top: -4px; right: -6px; min-width: 24px; padding: 0 5px; border: 2px solid #b97a1c; background: #f6b930; color: #5a2a00; font-size: 14px; font-weight: 900; line-height: 20px; text-align: center; }
.boostpv img { width: 66px; height: 66px; object-fit: contain; }

/* Book icon under the sound button: guide + data-page links in a dialog (design system 17/11/2026).
   The guide-link line stays in the page for search engines but is visually hidden. */
.hm-book { top: calc(max(10px, env(safe-area-inset-top)) + 104px); border-radius: 50%; }
#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; }

/* Book sheet list + painted-home guest rule (design system 17/11/2026) */
#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 { display: flex; flex-direction: column; gap: 8px; }
#scHome #guestNote { display: none !important; }
#scHome .me-tile { cursor: pointer; }

/* 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; }
