/* ================= Shipper Giao Hàng — MonBlock (base copied from Xếp Trá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; }

/* ---------- 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; }
/* ---------- 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; }
.item .evtag { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: linear-gradient(90deg, #8fd0ff, #c9b8ff); color: #1d2a4a; }

/* ================= tông khung: phố đêm neon của mẫu B ================= */
.big-play { --bar: #ff8a3d; }
.big-endless { --bar: #7a5cff; }
.big-daily { --bar: #335fff; }
.me-tile { background: radial-gradient(circle at 40% 35%, #3a3170, #1b1838); box-shadow: inset 0 0 0 3px #7a5cff; }
img.me-num { width: 50px; height: 56px; object-fit: contain; object-position: bottom; }
.mhead { background-size: cover; background-position: center bottom; }
.mhead::before { background: linear-gradient(90deg, rgba(12, 10, 40, .8), rgba(12, 10, 40, .15)); }
.mhead > img:first-child { width: 58px; height: 58px; }
.mhead .mp { width: 46px; height: 56px; }
.lv { border-color: #d9d2f5; background: #f6f3ff; color: #3a2a7a; }
.lv.done { background: #ebe4ff; border-color: #8a6cff; }
.lv.cur { border-color: #ff8a3d; box-shadow: 0 0 0 3px rgba(255, 138, 61, .25); }

/* ================= màn chạy: canvas toàn màn hình + HUD neon ================= */
#scPlay { position: fixed; inset: 0; z-index: 5; padding: 0; animation: none; }
#scPlay.hidden { display: none !important; }
body.xm-play { overflow: hidden; background: #0b1030; }
.race { position: absolute; inset: 0; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; background: #0b1030; }
#road { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.rhud { position: absolute; left: 0; right: 0; top: 0; z-index: 3; display: flex; align-items: flex-start; gap: 8px; padding: calc(8px + env(safe-area-inset-top)) 10px 0; pointer-events: none; }
.rhud > * { pointer-events: auto; }
.rpause { flex: none; width: 44px; height: 44px; padding: 0; border: 2px solid rgba(160, 220, 255, .7); border-radius: 14px; background: rgba(20, 30, 70, .72); color: #fff; }
.rpause .xtic { width: 30px; height: 30px; margin: 0; }
.rdist { flex: 1; min-width: 0; padding: 4px 12px 6px; border: 2px solid rgba(160, 220, 255, .7); border-radius: 14px; background: rgba(20, 30, 70, .72); color: #fff; line-height: 1.15;
  box-shadow: 0 0 12px rgba(80, 200, 255, .35); }
.rdist small { display: block; font-size: 11px; font-weight: 800; color: #9fe6ff; text-transform: uppercase; letter-spacing: .3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rdist b { font-size: 19px; font-weight: 900; font-variant-numeric: tabular-nums; }
.rbar { display: block; height: 6px; margin-top: 3px; border-radius: 6px; background: rgba(255, 255, 255, .18); overflow: hidden; }
.rbar u { display: block; height: 100%; background: linear-gradient(90deg, #ffd23f, #ff8a3d); transform-origin: left; transform: scaleX(0); }
.rside { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.rside > span { display: flex; align-items: center; gap: 3px; padding: 2px 10px; border: 2px solid rgba(160, 220, 255, .7); border-radius: 999px; background: rgba(20, 30, 70, .72); color: #fff; font-size: 15px; font-weight: 900; }
.rside .rfood.ok { border-color: #7cff6b; box-shadow: 0 0 10px rgba(124, 255, 107, .5); }
.rhearts { border: 0 !important; background: none !important; padding: 0 !important; gap: 2px !important; }
.rhearts .xti { width: 24px; height: 24px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .5)); }
.rmsg { position: absolute; left: 50%; top: 34%; z-index: 4; transform: translate(-50%, -50%); color: #fff; font-size: 72px; font-weight: 900; pointer-events: none;
  text-shadow: 0 0 18px #ff4fb0, 0 4px 0 #3a1a6a; animation: cnt .5s ease; }
@keyframes cnt { from { transform: translate(-50%, -50%) scale(1.6); opacity: 0; } }
.rpop { position: absolute; left: 50%; bottom: 34%; z-index: 4; transform: translateX(-50%); padding: 2px 12px; border-radius: 999px; background: rgba(20, 30, 70, .8); color: #fff;
  font-size: 18px; font-weight: 900; pointer-events: none; animation: rpop .9s ease forwards; white-space: nowrap; }
.rpop.bad { background: rgba(200, 30, 50, .85); }
@keyframes rpop { from { transform: translate(-50%, 10px); opacity: 0; } 20% { opacity: 1; } to { transform: translate(-50%, -50px); opacity: 0; } }
.rctl { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; padding: 0 14px calc(14px + env(safe-area-inset-bottom)); pointer-events: none; }
.rctl button { pointer-events: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 84px; height: 84px; padding: 0; border: 3px solid rgba(190, 230, 255, .85);
  border-radius: 50%; background: radial-gradient(circle at 40% 30%, rgba(255, 255, 255, .5), rgba(120, 170, 230, .35) 60%, rgba(40, 60, 120, .45)); color: #fff;
  font-size: 13px; font-weight: 900; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); box-shadow: 0 0 14px rgba(120, 200, 255, .45); -webkit-tap-highlight-color: transparent; }
.rctl button i { display: block; width: 40px; height: 40px; }
.rctl button i .xti { width: 100%; height: 100%; }
.rctl button:active { transform: scale(.92); }
#btnJump { width: 92px; height: 92px; margin-bottom: 10px; }
@media (min-width: 700px) and (pointer: fine) { .rctl button { width: 70px; height: 70px; opacity: .8; } }

/* ================= hộp chuẩn bị / hết tim / kết quả ================= */
.dialog.pre { padding: 0 0 16px; overflow: hidden; }
.dialog.pre > :not(.prehead) { margin-left: 18px; margin-right: 18px; }
.prehead { position: relative; height: 130px; margin-bottom: 10px; background: #2b1f5c center bottom / cover no-repeat; }
.prehead img { position: absolute; left: 50%; bottom: -6px; height: 120px; transform: translateX(-50%); filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .4)); }
.helmet { display: flex; align-items: center; gap: 8px; width: calc(100% - 36px); padding: 10px 12px; border: 2px dashed #c9d2e0; border-radius: 14px; background: #fff; font-weight: 800; text-align: left; }
.helmet .xtic { width: 30px; height: 30px; }
.helmet.on { border: 2px solid #ffb020; background: #fff6dc; }
.dialog.down, .dialog.result { position: relative; margin-top: 54px; overflow: visible; padding: 66px 18px 18px; text-align: center; border: 3px solid #7a5cff; border-radius: 26px;
  background: linear-gradient(#fff, #f3efff); box-shadow: 0 0 0 6px rgba(122, 92, 255, .18), 0 18px 30px rgba(0, 0, 0, .45); animation: resIn .35s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes resIn { from { transform: scale(.7); opacity: 0; } }
.dialog.result.good { border-color: #ff8a3d; box-shadow: 0 0 0 6px rgba(255, 138, 61, .2), 0 18px 30px rgba(0, 0, 0, .45); }
.crashpic { position: absolute; left: 50%; top: -58px; width: 110px; height: 118px; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(circle at 45% 40%, #3a3170, #1b1838);
  border: 4px solid #fff; box-shadow: 0 6px 14px rgba(0, 0, 0, .35); overflow: hidden; }
.crashpic img { position: absolute; left: 50%; bottom: -4px; height: 104px; transform: translateX(-50%); }
.dialog.down .crashpic img { transform: translateX(-50%) rotate(-12deg); }
.dialog.down h3, .dialog.result h3 { margin: 0; font-size: 26px; font-weight: 900; color: #7a2ad8; }
.dialog.result.good h3 { color: #e0600c; }
.dialog .wsub { margin: 2px 0 6px; font-weight: 800; color: #5a4a8a; }
.dialog .more { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 10px; padding: 13px; border: 0; border-radius: 999px;
  background: linear-gradient(#ffb43a, #f07c12); color: #fff; font-size: 18px; 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 .more.share { background: linear-gradient(#5aa8ff, #2f6fe0); box-shadow: inset 0 3px 0 rgba(255, 255, 255, .4), 0 5px 0 #1a4aa8; text-shadow: 0 2px 0 #1a4aa8; }
.dialog .more:disabled { opacity: .45; }
.dialog .more:active { transform: translateY(3px); }
.dialog .more .xtic, .dialog .more .xti { width: 28px; height: 28px; flex: none; }
.wstars { display: flex; justify-content: center; align-items: flex-end; gap: 4px; margin: 2px 0 4px; }
.wstars u { width: 50px; height: 50px; background: #d9d2f0; 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: 62px; height: 62px; 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); } }
.why { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin: 0 0 8px; }
.why span { padding: 2px 9px; border-radius: 999px; background: #eee9fb; color: #8a80aa; font-size: 12px; font-weight: 800; text-decoration: line-through; }
.why span.ok { background: #e3f7da; color: #2f7a1a; text-decoration: none; }
.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 #d9d2f5; font-size: 17px; color: #2a1a5a; }
.wc .mb-coin { width: 22px; height: 22px; }
.wc .xtic { width: 22px; height: 22px; }
.wc small { font-size: 11px; font-weight: 800; color: #6a5a9a; }
.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; }
.newmap { display: flex; align-items: center; gap: 10px; margin: 8px 0 0; padding: 8px; border-radius: 12px; background: #f1ecff; text-align: left; }
.newmap img { width: 90px; height: 54px; object-fit: cover; border-radius: 8px; }
.wbtns { display: flex; gap: 8px; margin-top: 14px; }
.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; }
.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 .xti { width: 26px; height: 26px; }
.wshare .xti * { stroke: #fff; }
.links { display: flex; justify-content: center; gap: 22px; margin-top: 12px; }
.links button { display: flex; align-items: center; gap: 6px; padding: 6px 4px; border: 0; background: none; font-size: 16px; font-weight: 900; color: #3a2a7a; }
.links .xti { width: 24px; height: 24px; }
.modal:has(.dialog.result), .modal:has(.dialog.down) { place-items: safe center; overflow-y: auto; }

/* ================= cửa hàng: ô xem thử = đoạn đường + xe + vệt (js/road.js) ================= */
canvas.pv { display: block; width: 100%; aspect-ratio: 4 / 3; border-radius: 12px; background: #2b1f5c; pointer-events: none; }
canvas.pv.big { width: 260px; max-width: 100%; }
.boostpv { position: relative; 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; right: -6px; bottom: -4px; padding: 1px 7px; border-radius: 10px; background: #d8341e; color: #fff; font-size: 14px; }

/* ===== 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: #c5a580; 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; }
#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); }
}
/* Shipper: khách thấy chiếc xe đang dùng trong vòng avatar, đã đăng nhập thì avatar tài khoản */
.hm-av img.me-num { width: 40px; height: 44px; object-fit: contain; object-position: center bottom; border-radius: 0; }
.hm-av.has-av img.me-num { display: none; }
.hm-av .me-avemo.hidden { display: none; }

/* 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; }
