/* ViciDaily – giao diện pixel. Đơn vị pixel giao diện = 4px. */
:root {
  --px: 4px;
  --font: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --pixel: 'Silkscreen', ui-monospace, 'Courier New', monospace;
  --ink: #2a2238; --line: #22192e;
  --panel: #fff4e2; --panel-l: #fffdf6; --panel-d: #e6cfa8; --panel-2: #f6e6c8;
  --text: #2a2238; --muted: #6d6184;
  --gold: #ffd54a; --gold-d: #d9932a; --gold-l: #fff0a0;
  --green: #5cc85a; --green-d: #2f8a45; --green-l: #a6ec8a;
  --red: #ec5a5f; --red-d: #a82c3c; --red-l: #ffa0a0;
  --blue: #4c95ea; --blue-d: #2c5cae; --blue-l: #a8d6ff;
  --violet: #8d62f0; --violet-d: #5a3ab0; --violet-l: #c9aaff;
  --hud: rgba(26, 18, 46, .72); --hud-l: rgba(255, 255, 255, .12);
  --veil: rgba(255, 244, 226, .0);
  --card: #fffaf0; --card-d: #ecdcbd;
  --slot: #e9d6b4; --slot-d: #cdb48c;
  --backdrop: rgba(24, 16, 44, .55);
  --page-veil: rgba(255, 246, 228, .78);
  --hud-h: 84px; --nav-h: 96px; --safe: 16px;
  color-scheme: light;
}
html[data-mode="night"] {
  --panel: #2f2b58; --panel-l: #47428a; --panel-d: #1f1c42; --panel-2: #39356a;
  --text: #f4efff; --muted: #b9b0de;
  --card: #3a3570; --card-d: #27245a;
  --slot: #262252; --slot-d: #1a1740;
  --page-veil: rgba(20, 16, 46, .78);
  --backdrop: rgba(6, 4, 20, .66);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #1c1838; overscroll-behavior: none; }
body { font-family: var(--font); font-size: 17px; line-height: 1.35; color: var(--text); -webkit-font-smoothing: antialiased; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
input, textarea { user-select: text; -webkit-user-select: text; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
img.pxi, canvas.px { image-rendering: pixelated; image-rendering: crisp-edges; display: block; flex: none; }
.num { font-family: var(--pixel); font-weight: 400; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 4px solid var(--gold); outline-offset: 4px; }

/* ---------- Khung pixel ---------- */
.pbox {
  background: var(--panel); position: relative;
  box-shadow:
    0 calc(var(--px) * -1) 0 0 var(--line), 0 var(--px) 0 0 var(--line),
    calc(var(--px) * -1) 0 0 0 var(--line), var(--px) 0 0 0 var(--line),
    inset 0 calc(var(--px) * -1) 0 0 var(--panel-d), inset 0 var(--px) 0 0 var(--panel-l);
}
.pbox.dark { --panel: var(--hud); --panel-l: var(--hud-l); --panel-d: rgba(0,0,0,.25); color: #fff; }

/* ---------- Nút ---------- */
.btn {
  --b: var(--panel-2); --bd: var(--panel-d); --bl: var(--panel-l);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; min-width: 52px; padding: 6px 18px; margin: var(--px);
  background: var(--b); color: var(--text); font-weight: 800; font-size: 17px; position: relative;
  box-shadow:
    0 calc(var(--px) * -1) 0 0 var(--line), 0 var(--px) 0 0 var(--line),
    calc(var(--px) * -1) 0 0 0 var(--line), var(--px) 0 0 0 var(--line),
    inset 0 -6px 0 0 var(--bd), inset 0 4px 0 0 var(--bl);
  transition: transform .05s steps(1);
}
.btn:active, .btn.is-down { transform: translateY(4px); box-shadow:
    0 calc(var(--px) * -1) 0 0 var(--line), 0 var(--px) 0 0 var(--line),
    calc(var(--px) * -1) 0 0 0 var(--line), var(--px) 0 0 0 var(--line),
    inset 0 -2px 0 0 var(--bd), inset 0 4px 0 0 var(--bd); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.gold { --b: var(--gold); --bd: var(--gold-d); --bl: var(--gold-l); color: #3a2410; }
.btn.green { --b: var(--green); --bd: var(--green-d); --bl: var(--green-l); color: #10301a; }
.btn.red { --b: var(--red); --bd: var(--red-d); --bl: var(--red-l); color: #fff; }
.btn.blue { --b: var(--blue); --bd: var(--blue-d); --bl: var(--blue-l); color: #fff; }
.btn.violet { --b: var(--violet); --bd: var(--violet-d); --bl: var(--violet-l); color: #fff; }
.btn.icon { padding: 2px; min-width: 56px; }
.btn.big { min-height: 64px; font-size: 19px; padding: 8px 24px; }
.btn.wide { width: calc(100% - 8px); }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.center { justify-content: center; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.h1 { font-size: 22px; font-weight: 800; margin: 0; }
.h2 { font-size: 19px; font-weight: 800; margin: 0; }

/* ---------- Thanh tiến độ pixel ---------- */
.bar { height: 16px; background: rgba(0,0,0,.28); position: relative; overflow: hidden;
  box-shadow: 0 -3px 0 0 var(--line), 0 3px 0 0 var(--line), -3px 0 0 0 var(--line), 3px 0 0 0 var(--line); margin: 3px; }
.bar > i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--bc, var(--green)); box-shadow: inset 0 4px 0 rgba(255,255,255,.35), inset 0 -4px 0 rgba(0,0,0,.18); transition: width .5s steps(10); }
.bar.thin { height: 10px; }
.bar.thick { height: 24px; }
.bar.xp { --bc: linear-gradient(90deg, #6ad0ff, #8d62f0); }
.bar.coins { --bc: var(--gold); }

/* ---------- Bố cục chính ---------- */
#scene { position: absolute; left: 0; top: 0; image-rendering: pixelated; z-index: 0; }
#app { position: fixed; inset: 0; z-index: 1; display: block; }
#veil { position: fixed; inset: 0; background: var(--page-veil); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 1; }
body.page-other #veil { opacity: 1; }

#hud { position: fixed; top: 0; left: 0; right: 0; height: var(--hud-h); z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: max(var(--safe), env(safe-area-inset-top)) max(var(--safe), env(safe-area-inset-right)) 8px max(var(--safe), env(safe-area-inset-left)); pointer-events: none; }
#hud > * { pointer-events: auto; }
.hud-chip { display: flex; align-items: center; gap: 6px; min-height: 52px; padding: 2px 12px 2px 4px; margin: 4px; color: #fff; }
.hud-chip .num { font-size: 22px; line-height: 1; text-shadow: 2px 2px 0 rgba(0,0,0,.45); }
.hud-level { flex: 1; max-width: 460px; padding-right: 14px; }
.hud-level .lvl { position: relative; width: 48px; height: 48px; }
.hud-level .lvl .num { position: absolute; inset: 0; display: grid; place-items: center; font-size: 20px; padding-bottom: 4px; }
.hud-level .bar { flex: 1; height: 16px; }
.hud-res { display: flex; align-items: center; gap: 10px; }
.hud-btns { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.hud-btn { width: 52px; height: 52px; min-width: 52px; min-height: 52px; margin: 4px; padding: 0; }
.bump { animation: bump .35s steps(4); }
@keyframes bump { 0% { transform: scale(1) } 40% { transform: scale(1.25) } 100% { transform: scale(1) } }

#pages { position: fixed; top: var(--hud-h); bottom: var(--nav-h); left: 0; right: 0; z-index: 5; overflow: hidden; touch-action: pan-y; }
.page { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; padding: 8px var(--safe) 28px; display: none; overscroll-behavior: contain; }
.page.active { display: block; }
.page.enter-r { animation: enterR .22s steps(5); }
.page.enter-l { animation: enterL .22s steps(5); }
@keyframes enterR { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes enterL { from { transform: translateX(-40px); opacity: 0; } to { transform: none; opacity: 1; } }
.page-inner { max-width: 1100px; margin: 0 auto; }

#nav { position: fixed; left: 0; right: 0; bottom: 0; height: var(--nav-h); z-index: 20; display: flex; justify-content: center; align-items: flex-end; padding: 0 var(--safe) max(12px, env(safe-area-inset-bottom)); pointer-events: none; }
#nav .navbar { pointer-events: auto; display: flex; gap: 6px; padding: 6px; width: 100%; max-width: 560px; justify-content: space-between; }
.nav-btn { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 68px; color: #fff; font-size: 14px; font-weight: 800; position: relative; margin: 0; padding: 4px 2px;
  --b: transparent; --bd: transparent; --bl: transparent; box-shadow: none; }
.nav-btn span { text-shadow: 1px 1px 0 rgba(0,0,0,.5); }
.nav-btn.active { --b: var(--gold); --bd: var(--gold-d); --bl: var(--gold-l); color: #3a2410; box-shadow:
    0 -3px 0 0 var(--line), 0 3px 0 0 var(--line), -3px 0 0 0 var(--line), 3px 0 0 0 var(--line),
    inset 0 -5px 0 0 var(--bd), inset 0 3px 0 0 var(--bl); background: var(--b); }
.nav-btn.active span { text-shadow: none; }
.nav-btn .dot { position: absolute; top: 2px; right: 12%; }

/* huy hiệu số đỏ */
.count { min-width: 30px; height: 30px; padding: 0 6px; display: inline-grid; place-items: center; background: var(--red); color: #fff; font-family: var(--pixel); font-size: 18px; line-height: 1;
  box-shadow: 0 -3px 0 var(--line), 0 3px 0 var(--line), -3px 0 0 var(--line), 3px 0 0 var(--line), inset 0 -3px 0 var(--red-d); }

/* ---------- Màn hình chính ---------- */
#page-hero { padding: 0; overflow: hidden; }
.hero { position: absolute; inset: 0; display: grid; grid-template-rows: 1fr auto; grid-template-columns: 1fr; padding: 0 var(--safe) 8px; }
.hero-stage { position: relative; min-height: 0; display: flex; align-items: flex-end; justify-content: center; }
.name-tag { position: absolute; left: 50%; transform: translateX(-50%); padding: 2px 10px; font-weight: 800; font-size: 18px; line-height: 24px; white-space: nowrap; color: #fff; background: rgba(28,22,44,.82); border: 3px solid var(--line); box-shadow: 0 3px 0 rgba(0,0,0,.25); pointer-events: none; }
.name-tag .num { color: var(--gold); font-size: 18px; margin-left: 4px; }
.hero-info { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; align-items: stretch; margin: 8px 4px 4px; }
.hero-radar { display: grid; place-items: center; padding: 2px; margin: 4px; }
.hero-list { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 6px 6px; margin: 4px; min-width: 0; }
.srow { --sc: #888; display: flex; align-items: center; gap: 8px; width: 100%; min-height: 36px; padding: 1px 2px; text-align: left; color: #fff; }
.srow .plate { width: 34px; height: 34px; display: grid; place-items: center; background: var(--sc); flex: none; box-shadow: 0 0 0 2px var(--line), inset 0 -3px 0 rgba(0,0,0,.25); }
.srow .sinfo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.srow .sline { display: flex; align-items: baseline; gap: 6px; }
.srow .nm { flex: 1; min-width: 0; font-weight: 800; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 1px 1px 0 rgba(0,0,0,.5); }
.srow .lv { font-size: 14px; color: var(--gold); text-shadow: 1px 1px 0 rgba(0,0,0,.6); white-space: nowrap; }
.srow .bar { height: 7px; margin: 3px 3px 2px; --bc: var(--sc); box-shadow: 0 -2px 0 0 var(--line), 0 2px 0 0 var(--line), -2px 0 0 0 var(--line), 2px 0 0 0 var(--line); }
.srow:active { transform: translateY(2px); }
.hero-cta { display: flex; justify-content: center; padding: 6px 0 2px; }
.quest-btn { min-height: 68px; font-size: 20px; padding: 6px 28px 6px 14px; gap: 12px; }
.quest-btn .count { position: absolute; top: -14px; right: -14px; }

/* ---------- Hướng dẫn ---------- */
.help { display: grid; grid-template-columns: 1fr; gap: 8px; }
.help-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; background: var(--slot); margin: 3px;
  box-shadow: 0 -3px 0 var(--line), 0 3px 0 var(--line), -3px 0 0 var(--line), 3px 0 0 var(--line), inset 0 -4px 0 var(--slot-d); }
.help-row b { font-size: 16px; }
.help-row .muted { font-weight: 700; font-size: 15px; }

/* ---------- Pop-up kiểu game ---------- */
#modal-root { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.modal-back { position: fixed; inset: 0; background: var(--backdrop); display: flex; align-items: center; justify-content: center; padding: 36px var(--safe) var(--safe); pointer-events: auto; animation: fade .15s steps(3); }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.dialog { width: 100%; max-width: 520px; max-height: calc(100% - 20px); display: flex; flex-direction: column; padding: 30px 14px 14px; margin: 8px; animation: pop .22s steps(4); }
.dialog.wide { max-width: 720px; }
@keyframes pop { 0% { transform: scale(.7); } 70% { transform: scale(1.04); } 100% { transform: scale(1); } }
.dialog .ribbon { position: absolute; top: -26px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 96px); padding: 8px 22px; background: var(--red); color: #fff; font-weight: 800; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 -4px 0 var(--line), 0 4px 0 var(--line), -4px 0 0 var(--line), 4px 0 0 var(--line), inset 0 -5px 0 var(--red-d), inset 0 4px 0 var(--red-l); }
.dialog .ribbon.gold { background: var(--gold); color: #3a2410; box-shadow: 0 -4px 0 var(--line), 0 4px 0 var(--line), -4px 0 0 var(--line), 4px 0 0 var(--line), inset 0 -5px 0 var(--gold-d), inset 0 4px 0 var(--gold-l); }
.dialog .ribbon.blue { background: var(--blue); box-shadow: 0 -4px 0 var(--line), 0 4px 0 var(--line), -4px 0 0 var(--line), 4px 0 0 var(--line), inset 0 -5px 0 var(--blue-d), inset 0 4px 0 var(--blue-l); }
.dialog .x { position: absolute; top: -22px; right: -18px; z-index: 2; }
.dialog .x.btn { min-width: 52px; min-height: 52px; padding: 0; --b: var(--red); --bd: var(--red-d); --bl: var(--red-l); }
.dialog .body { overflow-y: auto; overflow-x: hidden; padding: 4px 4px 8px; flex: 1; min-height: 0; }
.dialog .actions { display: flex; gap: 8px; padding-top: 8px; }
.dialog .actions .btn { flex: 1; }
.dialog .center { text-align: center; }
.dlg-hero { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 4px 0 8px; }
.dlg-hero .big-num { font-size: 40px; line-height: 1; }
.shine { position: relative; }
.shine::before { content: ''; position: absolute; inset: -30px; background: repeating-conic-gradient(from 0deg, rgba(255,214,74,.28) 0 15deg, transparent 15deg 30deg); animation: spin 6s linear infinite; z-index: -1; border-radius: 50%; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ô chọn hình */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; padding: 4px; }
.tiles.lg { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.tile { min-height: 64px; min-width: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px; background: var(--slot); position: relative; font-size: 14px; font-weight: 700; text-align: center;
  box-shadow: 0 -3px 0 var(--line), 0 3px 0 var(--line), -3px 0 0 var(--line), 3px 0 0 var(--line), inset 0 -4px 0 var(--slot-d); margin: 3px; }
.tile:active { transform: translateY(2px); }
.tile.on { background: var(--gold); color: #3a2410; box-shadow: 0 -4px 0 var(--line), 0 4px 0 var(--line), -4px 0 0 var(--line), 4px 0 0 var(--line), inset 0 -4px 0 var(--gold-d), inset 0 3px 0 var(--gold-l); }
.tile.on::after { content: ''; position: absolute; top: -10px; right: -10px; width: 28px; height: 28px; background: #fff var(--check) center/24px no-repeat; image-rendering: pixelated; box-shadow: 0 -3px 0 var(--line), 0 3px 0 var(--line), -3px 0 0 var(--line), 3px 0 0 var(--line); }
.tile .sw { width: 36px; height: 36px; box-shadow: 0 0 0 3px var(--line); }
.tile small { font-size: 14px; line-height: 1.15; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.field > label, .field > .lab { font-weight: 800; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.txt { width: 100%; min-height: 52px; padding: 10px 14px; font: inherit; font-size: 18px; font-weight: 700; color: var(--text); background: var(--card); border: 0; margin: 4px;
  box-shadow: 0 -3px 0 var(--line), 0 3px 0 var(--line), -3px 0 0 var(--line), 3px 0 0 var(--line), inset 0 4px 0 var(--card-d); width: calc(100% - 8px); }
.txt:focus { outline: none; box-shadow: 0 -3px 0 var(--line), 0 3px 0 var(--line), -3px 0 0 var(--line), 3px 0 0 var(--line), inset 0 4px 0 var(--card-d), 0 0 0 7px var(--gold); }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper .val { min-width: 90px; text-align: center; font-size: 28px; }
.more-toggle { width: calc(100% - 8px); justify-content: space-between; }
.sect { margin: 14px 0 6px; font-weight: 800; font-size: 17px; display: flex; align-items: center; gap: 8px; }

/* ---------- Toast + tooltip ---------- */
#toast-root { position: fixed; bottom: calc(var(--nav-h) + 8px); left: 0; right: 0; z-index: 70; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: min(520px, calc(100% - 24px)); padding: 6px 10px 6px 6px; color: #fff; font-weight: 700; animation: drop .25s steps(4); }
.toast .btn { min-height: 48px; margin: 4px; font-size: 16px; padding: 4px 12px; }
@keyframes drop { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
#tip { position: fixed; z-index: 90; pointer-events: none; padding: 6px 12px; background: #1d1735; color: #fff; font-weight: 800; font-size: 16px; opacity: 0; transition: opacity .1s; white-space: nowrap;
  box-shadow: 0 -3px 0 #fff, 0 3px 0 #fff, -3px 0 0 #fff, 3px 0 0 #fff; }
#tip.show { opacity: 1; }

/* ---------- Hiệu ứng ---------- */
#fx { position: fixed; inset: 0; z-index: 80; pointer-events: none; overflow: hidden; }
.fly { position: fixed; left: 0; top: 0; display: flex; align-items: center; gap: 2px; color: #fff; font-family: var(--pixel); font-size: 22px; text-shadow: 2px 2px 0 #22192e; will-change: transform; }
.pop-num { position: fixed; font-family: var(--pixel); font-size: 26px; color: #fff; text-shadow: 2px 2px 0 #22192e, -2px -2px 0 #22192e, 2px -2px 0 #22192e, -2px 2px 0 #22192e; }
.spark { position: fixed; width: 8px; height: 8px; }

/* ---------- Trang Nhiệm vụ ---------- */
.q-head { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px 10px; margin: 6px 4px 14px; }
.daypick { display: flex; gap: 6px; }
.daypick .btn { flex: 1; min-height: 46px; font-size: 16px; padding: 4px 6px; }
.daypick .btn.on { --b: var(--gold); --bd: var(--gold-d); --bl: var(--gold-l); color: #3a2410; }
.dayprog { display: flex; align-items: center; gap: 10px; }
.dayprog .bar { flex: 1; height: 22px; }
.dayprog .num { font-size: 22px; }
.chest-btn { width: 60px; height: 60px; display: grid; place-items: center; position: relative; margin: 0; }
.chest-btn.ready { animation: wiggle 1s steps(4) infinite; }
.chest-btn.ready::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle, rgba(255,230,120,.8), transparent 65%); z-index: -1; }
.chest-btn.opened { opacity: .7; }
@keyframes wiggle { 0%, 100% { transform: rotate(0) } 25% { transform: rotate(-6deg) } 75% { transform: rotate(6deg) } }
.q-tools { display: flex; gap: 8px; }
.q-tools .btn { flex: 1; min-height: 48px; white-space: nowrap; padding: 4px 10px; }

.qlist { padding: 2px 4px; }
.qgroup { --c: #888; margin: 0 0 16px; }
.qg-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 4px; margin: 4px 4px 6px; font-size: 16px;
  background: color-mix(in srgb, var(--c) 26%, var(--panel)); box-shadow: inset 6px 0 0 var(--c), 0 -3px 0 var(--line), 0 3px 0 var(--line), -3px 0 0 var(--line), 3px 0 0 var(--line); }
.qg-ic { width: 36px; height: 36px; display: grid; place-items: center; background: var(--c); margin-left: 8px; box-shadow: 0 0 0 2px var(--line), inset 0 -3px 0 rgba(0,0,0,.25); }
.qg-head .num { font-size: 18px; }
.qg-head .num.all { color: var(--green-d); }
html[data-mode="night"] .qg-head .num.all { color: var(--green-l); }
.qrow { position: relative; display: flex; align-items: center; gap: 8px; min-height: 60px; padding: 6px 4px 6px 12px; margin: 8px 4px; background: var(--card); color: var(--text); cursor: pointer;
  box-shadow: inset 6px 0 0 var(--c), 0 -3px 0 var(--line), 0 3px 0 var(--line), -3px 0 0 var(--line), 3px 0 0 var(--line), inset 0 -4px 0 var(--card-d);
  transition: transform .06s steps(1); }
.qrow:active { transform: translateY(2px); }
.qrow .qi { width: 44px; height: 44px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--c) 35%, var(--card)); box-shadow: 0 0 0 2px var(--line); }
.qrow .qm { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.qrow .nm { font-weight: 800; font-size: 16px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qrow .qs { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--muted); min-width: 0; }
.qrow .qs .bar { flex: 1; max-width: 160px; min-width: 40px; height: 8px; margin: 2px 3px; --bc: var(--c); box-shadow: 0 -2px 0 0 var(--line), 0 2px 0 0 var(--line), -2px 0 0 0 var(--line), 2px 0 0 0 var(--line); }
.qrow .qs .amt { font-size: 14px; color: var(--text); white-space: nowrap; }
.qrow .qs .u { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qrow .qrw { display: flex; align-items: center; font-size: 16px; flex: none; }
.qrow .qstreak { display: inline-flex; align-items: center; gap: 0; flex: none; color: var(--text); margin: -3px 2px -3px -6px; }
.qrow .qstreak .num { font-size: 14px; }
.qrow .qstreak.off { opacity: .5; }
.qrow .qact { display: flex; flex: none; }
.btn.sm { min-height: 44px; min-width: 44px; padding: 2px 8px; margin: 3px; font-size: 15px; }
.qrow .qcheck { width: 40px; height: 40px; flex: none; display: grid; place-items: center; background: var(--slot); box-shadow: 0 0 0 3px var(--line), inset 0 4px 0 var(--slot-d); margin: 0 4px; }
.qrow .qmenu { width: 44px; height: 44px; display: grid; place-items: center; flex: none; }
.qrow.done { background: color-mix(in srgb, var(--green) 16%, var(--card)); }
.qrow.done .nm { opacity: .75; }
.qrow.done .qcheck { background: var(--green); box-shadow: 0 0 0 3px var(--line), inset 0 -4px 0 var(--green-d), inset 0 3px 0 var(--green-l); }
.qrow.just .qcheck { animation: cpop .4s steps(4); }
@keyframes cpop { 0% { transform: scale(.4); } 60% { transform: scale(1.3); } 100% { transform: scale(1); } }
.qrow.undo { animation: shake .3s steps(4); }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.qrow.view { cursor: default; }

/* bảng chuỗi từng nhiệm vụ */
.qs-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 12px; }
.qs-row { --sc: #888; display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 4px 8px 4px 4px; background: var(--slot); text-align: left; margin: 3px;
  box-shadow: inset 5px 0 0 var(--sc), 0 -3px 0 var(--line), 0 3px 0 var(--line), -3px 0 0 var(--line), 3px 0 0 var(--line); }
.qs-row .plate { width: 40px; height: 40px; display: grid; place-items: center; margin-left: 6px; }
.qs-row .nm { flex: 1; min-width: 0; font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qs-row .fire, .qs-row .best { display: flex; align-items: center; font-size: 17px; }
.qs-row .fire.off { opacity: .5; }

/* ---------- Cài đặt tối giản ---------- */
.set-list { padding: 4px 12px; margin: 6px 4px 16px; max-width: 720px; margin-left: auto; margin-right: auto; }
.set-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; min-height: 62px; padding: 4px 0; border-bottom: 3px dotted color-mix(in srgb, var(--muted) 40%, transparent); }
.set-row:last-child { border-bottom: 0; }
.set-row .lab { font-weight: 800; font-size: 16px; }
.set-row .ctl { display: flex; align-items: center; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }
.set-row .ctl .num { font-size: 18px; }
.set-row .stepper .val { min-width: 48px; font-size: 22px; }
.set-row .stepper .btn { min-height: 44px; min-width: 44px; }
.set-sub { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 4px 0 10px; }
.set-sub > .row, .set-sub > .ctl { justify-content: space-between; }
.set-sub .cal { margin-top: 4px; }
.small { font-size: 14px; font-weight: 700; }
.ic-seg { gap: 2px; }
.ic-seg .btn { flex: none; min-width: 48px; min-height: 48px; padding: 2px; margin: 3px; }
.q-sub { margin: 22px 4px 6px; display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 17px; }
.mini-row { display: flex; flex-wrap: wrap; gap: 10px; padding: 6px 4px; }
.mini { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; min-height: 56px; background: var(--slot); font-weight: 700; margin: 3px;
  box-shadow: 0 -3px 0 var(--line), 0 3px 0 var(--line), -3px 0 0 var(--line), 3px 0 0 var(--line), inset 0 -4px 0 var(--slot-d); }
.mini.ghost { opacity: .7; }


/* ---------- Thẻ gợi ý ---------- */
.sugg { --c: #888; display: flex; align-items: center; gap: 10px; padding: 8px; background: var(--card); text-align: left; margin: 4px; min-height: 64px;
  box-shadow: 0 -4px 0 var(--c), 0 4px 0 var(--c), -4px 0 0 var(--c), 4px 0 0 var(--c), inset 0 -4px 0 var(--card-d); }
.sugg.on { background: color-mix(in srgb, var(--c) 30%, var(--card)); }
.sugg .grow b { display: block; font-size: 17px; }

/* ---------- Thanh tab con ---------- */
.subtabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 6px 4px 12px; }
.subtabs .btn { flex-direction: column; gap: 2px; min-height: 70px; font-size: 14px; padding: 4px; margin: 4px; }
.subtabs .btn.on { --b: var(--gold); --bd: var(--gold-d); --bl: var(--gold-l); color: #3a2410; }
.seg { display: flex; gap: 4px; }
.seg .btn { flex: 1; min-height: 52px; padding: 4px; font-size: 16px; }
.seg .btn.on { --b: var(--gold); --bd: var(--gold-d); --bl: var(--gold-l); color: #3a2410; }

/* ---------- Thống kê ---------- */
.panel { padding: 12px; margin: 8px 4px 16px; }
.panel .ttl { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; margin-bottom: 8px; }
.cols { display: grid; grid-template-columns: 1fr; gap: 0; }
.big-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.bstat { display: flex; align-items: center; gap: 8px; padding: 8px; background: var(--slot); min-height: 64px; margin: 3px; position: relative;
  box-shadow: 0 -3px 0 var(--line), 0 3px 0 var(--line), -3px 0 0 var(--line), 3px 0 0 var(--line), inset 0 -4px 0 var(--slot-d); }
.bstat .num { font-size: 26px; line-height: 1; }
.bstat small { display: block; font-size: 14px; color: var(--muted); font-weight: 700; }
.chart-wrap { position: relative; display: flex; justify-content: center; }
.chart-wrap canvas { outline: none; touch-action: pan-y; }
.chart-tip { position: absolute; pointer-events: none; padding: 4px 10px; background: #1d1735; color: #fff; font-weight: 800; font-size: 16px; white-space: nowrap; transform: translate(-50%, -110%); box-shadow: 0 0 0 3px #fff; z-index: 3; }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin-top: 8px; font-size: 15px; font-weight: 700; }
.legend i { display: inline-block; width: 18px; height: 18px; margin-right: 6px; vertical-align: -3px; box-shadow: 0 0 0 2px var(--line); }
.cal { display: grid; grid-template-columns: repeat(7, minmax(48px, 56px)); gap: 6px; justify-content: center; }
.cal .dh { text-align: center; font-weight: 800; font-size: 14px; color: var(--muted); }
.cal .c { aspect-ratio: 1; min-height: 48px; display: grid; place-items: center; font-family: var(--pixel); font-size: 15px; background: var(--slot); color: var(--text); box-shadow: 0 0 0 3px var(--line), inset 0 -4px 0 rgba(0,0,0,.18); }
.cal .c.full { background: #4cb350; color: #fff; }
.cal .c.partial { background: #f0c23a; color: #3a2410; }
.cal .c.miss { background: #c95a6a; color: #fff; opacity: .75; }
.cal .c.rest { background: #4c95ea; color: #fff; }
.cal .c.pending { background: var(--slot); outline: 3px dashed var(--gold); outline-offset: -6px; }
.cal .c.none { background: transparent; box-shadow: none; color: var(--muted); opacity: .4; }
.cal .c.sel { box-shadow: 0 0 0 4px var(--gold), inset 0 -4px 0 rgba(0,0,0,.18); }
.insight { display: flex; gap: 10px; align-items: center; padding: 10px 12px; font-weight: 700; margin: 8px 4px 16px; }
.empty-note { text-align: center; padding: 18px 8px; font-weight: 700; color: var(--muted); }

.list-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; padding: 4px; }
.ltile { --c: #888; display: flex; align-items: center; gap: 12px; padding: 10px; min-height: 84px; background: var(--card); text-align: left; margin: 4px; width: calc(100% - 8px);
  box-shadow: 0 -3px 0 var(--line), 0 3px 0 var(--line), -3px 0 0 var(--line), 3px 0 0 var(--line), inset 0 -5px 0 var(--card-d); }
.ltile .plate { width: 64px; height: 64px; display: grid; place-items: center; background: var(--c); flex: none; box-shadow: 0 0 0 3px var(--line), inset 0 -5px 0 rgba(0,0,0,.22), inset 0 4px 0 rgba(255,255,255,.3); }
.ltile .grow b { font-size: 18px; display: block; }
.ltile .bar { --bc: var(--c); margin-top: 6px; }
.ltile .lvl { font-size: 26px; text-align: center; min-width: 48px; }
.ltile .lvl small { display: block; font-family: var(--font); font-size: 13px; font-weight: 800; color: var(--muted); }

/* ---------- Màn hình chi tiết (chồng lên trang) ---------- */
.screen { position: fixed; top: var(--hud-h); bottom: var(--nav-h); left: 0; right: 0; z-index: 30; background: var(--page-veil); backdrop-filter: blur(2px); overflow-y: auto; padding: 8px var(--safe) 28px; animation: enterR .2s steps(5); }
.screen.full { top: 0; bottom: 0; z-index: 40; }
.scr-head { display: flex; align-items: center; gap: 10px; max-width: 1100px; margin: 0 auto 6px; }
.scr-head .h1 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-hero { display: flex; align-items: center; gap: 14px; padding: 12px; margin: 6px 4px 14px; }
.detail-hero .plate { width: 84px; height: 84px; display: grid; place-items: center; background: var(--c); flex: none; box-shadow: 0 0 0 4px var(--line), inset 0 -6px 0 rgba(0,0,0,.22), inset 0 4px 0 rgba(255,255,255,.3); }
.detail-hero .lv { font-size: 34px; }
.detail-hero .bar { --bc: var(--c); height: 20px; }

/* ---------- Cửa hàng ---------- */
.shop-head { display: flex; align-items: center; gap: 12px; padding: 10px 14px; margin: 6px 4px 12px; }
.shop-head .num { font-size: 34px; }
.shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; padding: 6px 4px; }
.slot { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px 10px; background: var(--slot); text-align: center; min-height: 220px; margin: 4px;
  box-shadow: 0 -4px 0 var(--line), 0 4px 0 var(--line), -4px 0 0 var(--line), 4px 0 0 var(--line), inset 0 -6px 0 var(--slot-d), inset 0 4px 0 rgba(255,255,255,.25); }
.slot .nm { font-weight: 800; font-size: 17px; min-height: 2.4em; display: flex; align-items: center; overflow-wrap: anywhere; }
.slot .price { display: flex; align-items: center; font-size: 22px; }
.slot .bar { width: calc(100% - 12px); --bc: var(--gold); }
.slot.ready { background: color-mix(in srgb, var(--gold) 45%, var(--slot)); animation: ready 1.4s steps(2) infinite; }
@keyframes ready { 50% { box-shadow: 0 -4px 0 var(--gold-d), 0 4px 0 var(--gold-d), -4px 0 0 var(--gold-d), 4px 0 0 var(--gold-d), inset 0 -6px 0 var(--slot-d), 0 0 22px 6px rgba(255,214,74,.7); } }
.slot .menu { position: absolute; top: 2px; right: 2px; width: 48px; height: 48px; display: grid; place-items: center; }
.slot .date { font-size: 14px; color: var(--muted); font-weight: 700; }
.slot.owned::after { content: ''; position: absolute; inset: 6px; outline: 3px solid rgba(255,255,255,.25); pointer-events: none; }
.slot .btn { width: calc(100% - 8px); }

/* ---------- Huy hiệu ---------- */
.shelf { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 6px; padding: 14px 8px 18px; margin: 8px 4px 16px; background: linear-gradient(var(--panel), var(--panel)) padding-box; position: relative; }
.shelf::after { content: ''; position: absolute; left: 0; right: 0; bottom: 50%; height: 8px; background: var(--panel-d); box-shadow: 0 4px 0 rgba(0,0,0,.18); pointer-events: none; }
.bdg { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 120px; justify-content: flex-end; z-index: 1; position: relative; padding-bottom: 14px; }
.bdg .lbl { font-size: 14px; font-weight: 800; text-align: center; line-height: 1.15; }
.bdg img.is-gray { opacity: .35; }
.bdg.got img { filter: drop-shadow(0 0 8px rgba(255,220,120,.7)); }

/* ---------- Mục tiêu ---------- */
.goal { --c: #888; padding: 12px; margin: 8px 4px 16px; }
.goal .top { display: flex; align-items: center; gap: 10px; }
.goal .nm { font-weight: 800; font-size: 18px; }
.goal .bar { height: 28px; --bc: var(--c); margin: 12px 3px 8px; }
.goal .meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-weight: 700; }
.goal .meta .num { font-size: 22px; }
.goal.done { background: color-mix(in srgb, var(--gold) 28%, var(--panel)); }

/* ---------- Bắt đầu / tạo nhân vật ---------- */
.onb { position: fixed; inset: 0; z-index: 50; overflow-y: auto; padding: var(--safe) var(--safe) 24px; background: linear-gradient(rgba(20,14,44,.78), rgba(20,14,44,.6)); }
.onb-in { max-width: 980px; margin: 0 auto; }
.steps { display: flex; justify-content: center; gap: 10px; margin: 4px 0 14px; }
.steps i { width: 44px; height: 14px; background: rgba(255,255,255,.35); box-shadow: 0 0 0 3px var(--line); }
.steps i.on { background: var(--gold); }
.creator { display: grid; grid-template-columns: 1fr; gap: 10px; }
.creator .preview { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-height: 240px; padding: 10px; position: relative; }
.creator .opts { padding: 12px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px; }
.swatch { width: 52px; height: 52px; margin: 3px; box-shadow: 0 0 0 3px var(--line), inset 0 -6px 0 rgba(0,0,0,.2), inset 0 4px 0 rgba(255,255,255,.3); position: relative; }
.swatch.on { box-shadow: 0 0 0 3px var(--line), 0 0 0 8px var(--gold), inset 0 -6px 0 rgba(0,0,0,.2); }
.look-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.look-tiles .tile img { image-rendering: pixelated; }
.onb-foot { display: flex; gap: 10px; justify-content: center; margin-top: 14px; position: sticky; bottom: -24px; padding: 10px 0 18px; background: linear-gradient(transparent, var(--backdrop) 40%); }
.onb-foot .btn { min-width: 160px; }

/* ---------- Banner lưu trữ ---------- */
#store-warn { position: fixed; left: var(--safe); right: var(--safe); bottom: calc(var(--nav-h) + 6px); z-index: 25; display: none; align-items: center; gap: 10px; padding: 6px 8px; color: #fff; font-weight: 700; font-size: 15px; }
#store-warn.show { display: flex; }

/* ---------- Khung: máy tính / điện thoại ---------- */
#frame { position: fixed; inset: 0; overflow: hidden; }
html.framed body { background: #151229 repeating-linear-gradient(45deg, rgba(255,255,255,.03) 0 8px, transparent 8px 16px); }
html.framed #frame { top: 16px; bottom: 16px; left: 50%; right: auto; width: 430px; margin-left: -215px; transform: translateZ(0);
  box-shadow: 0 0 0 6px var(--line), 0 0 0 10px #3a3266, 0 0 0 14px var(--line), 0 20px 60px rgba(0,0,0,.5); }
.scr-back { display: none; }

/* ---------- Máy tính ---------- */
html.desk { --hud-h: 92px; --nav-h: 124px; --safe: 24px; }
html.desk #nav { padding-bottom: max(28px, env(safe-area-inset-bottom)); }
html.desk .hud-level { max-width: 520px; }
html.desk .hud-res { gap: 14px; }
html.desk .hud-btns { gap: 18px; }
html.desk .hero { grid-template-columns: minmax(280px, 1fr) minmax(380px, 1.2fr) minmax(280px, 1fr); grid-template-rows: 1fr auto; padding: 0 32px 8px; column-gap: 24px; }
html.desk .hero-stage { grid-column: 2; grid-row: 1; min-width: 380px; }
html.desk .hero-cta { grid-column: 2; grid-row: 2; }
html.desk .hero-info { display: contents; }
html.desk .hero-list { grid-column: 1; grid-row: 1; align-self: center; justify-self: end; width: 100%; max-width: 340px; padding: 10px 14px; gap: 4px; }
html.desk .hero-radar { grid-column: 3; grid-row: 1; align-self: center; justify-self: start; padding: 8px; }
html.desk .srow { min-height: 46px; }
html.desk .srow .nm, html.desk .srow .lv { font-size: 16px; }
html.desk .srow .plate { width: 36px; height: 36px; }
html.desk .creator { grid-template-columns: 360px 1fr; }
html.desk .cols { grid-template-columns: 1fr 1fr; gap: 8px; }
html.desk .help { grid-template-columns: 1fr 1fr; }
html.desk #nav .navbar { max-width: 620px; }
html.desk .nav-btn { font-size: 15px; }
html.desk .qlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(460px, 1fr)); gap: 0 20px; align-items: start; }
/* màn hình chi tiết thành pop-up gọn ở giữa */
html.desk .scr-back { display: block; position: fixed; inset: 0; background: var(--backdrop); z-index: 44; animation: fade .15s steps(3); }
html.desk .screen, html.desk .screen.full { top: 8vh; bottom: 8vh; left: 0; right: 0; margin: 0 auto; width: min(880px, calc(100% - 64px)); z-index: 45; padding: 16px 22px 22px;
  background: var(--panel); backdrop-filter: none; animation: pop .22s steps(4);
  box-shadow: 0 -4px 0 0 var(--line), 0 4px 0 0 var(--line), -4px 0 0 0 var(--line), 4px 0 0 0 var(--line), inset 0 -4px 0 0 var(--panel-d), inset 0 4px 0 0 var(--panel-l), 0 20px 60px rgba(0,0,0,.45); }
html.desk .screen.settings { width: min(640px, calc(100% - 64px)); }

/* ---------- Điện thoại ---------- */
html.mob { --hud-h: 108px; }
html.mob .nav-btn .key, html.mob .nav-btn .lbl { display: none; }
html.mob { --nav-h: 84px; }
html.mob .nav-btn { min-height: 56px; }
html.mob .nav-btn img { width: 48px; height: 48px; }
html.mob .screen.full { background: var(--panel); }
html.mob .quest-btn { min-height: 58px; font-size: 19px; }
html.mob .srow { gap: 6px; }
html.mob .srow .lv { font-size: 14px; }
html.mob #hud { padding-bottom: 30px; gap: 4px; }
html.mob .hud-res { gap: 2px; }
html.mob .hud-chip { margin: 2px; }
html.mob .hud-chip { margin: 3px; padding: 2px 10px 2px 2px; gap: 4px; min-height: 50px; }
html.mob .hud-chip .num { font-size: 20px; }
html.mob .hud-level { flex: none; padding-right: 6px; position: static; }
html.mob .hud-level .bar { position: absolute; left: calc(var(--safe) + 4px); right: calc(var(--safe) + 4px); bottom: 10px; height: 12px; margin: 0; }
html.mob .hud-btns { gap: 4px; }
html.mob .hud-btn { width: 46px; height: 46px; min-width: 46px; min-height: 46px; margin: 2px; }
@media (max-width: 400px) { html.mob .hud-btns { gap: 2px; } html.mob .hud-btn { width: 42px; height: 42px; min-width: 42px; min-height: 42px; margin: 1px; } html.mob .hud-chip { padding-right: 6px; margin: 1px; } html.mob .hud-level { padding-right: 2px; } html.mob #hud { padding-left: 12px; padding-right: 12px; } }

html.mob .qrow { gap: 6px; padding-right: 2px; }
html.mob .qrow .qs .bar { min-width: 24px; }
html.mob .qrow .qs .u { display: none; }

/* (đã bỏ chặn animation theo Giảm chuyển động) */
@media (max-width: 420px) {
  .cal { grid-template-columns: repeat(7, 44px); gap: 4px; }
  .cal .c { min-height: 44px; }
}
.cols > * { min-width: 0; }
.chart-wrap { max-width: 100%; overflow: hidden; }

/* ---------- Tạo nhân vật từ ảnh ---------- */
.creator.photo, html.desk .creator.photo { display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 460px; margin: 0 auto; }
.cr-stage { display: flex; align-items: flex-end; justify-content: center; min-height: 160px; }
.cr-empty { width: 176px; height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; font-weight: 800; font-size: 15px; color: var(--muted);
  outline: 4px dashed color-mix(in srgb, var(--muted) 60%, transparent); outline-offset: -4px; }
.photo-drop { position: relative; width: calc(100% - 8px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 170px; margin: 4px; padding: 14px 12px; cursor: pointer; text-align: center;
  background: var(--slot); outline: 4px dashed var(--muted); outline-offset: -8px; }
.photo-drop.has { padding: 8px 8px 12px; outline: none; box-shadow: 0 0 0 3px var(--line); }
.photo-drop > img { max-width: 100%; max-height: 200px; display: block; image-rendering: auto; }
.photo-drop .btn { margin-top: 4px; }
.creator.photo .txt { max-width: 100%; }
.cr-note { text-align: center; }
.cr-foot { display: flex; justify-content: center; padding: 12px 0 4px; }
.ai-status { width: calc(100% - 8px); display: flex; align-items: center; gap: 8px; margin: 0 4px; padding: 8px 10px; font-weight: 800; background: color-mix(in srgb, var(--blue) 18%, var(--panel)); box-shadow: 0 0 0 3px var(--line); }
.ai-status.err { background: color-mix(in srgb, var(--red) 22%, var(--panel)); }
img.inl { display: inline-block; vertical-align: middle; margin-right: 4px; }
/* pop-up trên máy tính cao vừa nội dung */
html.desk .screen, html.desk .screen.full { top: 0; bottom: 0; margin: auto; height: fit-content; max-height: 84vh; }
html.desk .screen.creator-scr { width: min(560px, calc(100% - 64px)); }
/* khung ảnh gọn: thumbnail nhỏ ngang hàng nút */
.photo-drop.has { flex-direction: row; justify-content: center; gap: 14px; min-height: 0; padding: 8px 10px; }
.photo-drop.has > img { width: 64px; height: 64px; max-height: none; object-fit: cover; box-shadow: 0 0 0 3px var(--line); }
.photo-drop.has .btn { margin: 4px; white-space: nowrap; }

.cr-name { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 56px; }
.cr-name .nm { font-weight: 800; font-size: 20px; padding: 4px 14px; background: var(--hud); color: #fff; box-shadow: 0 0 0 3px var(--line); }
.cr-name .nm.empty { opacity: .6; }
.cr-name .txt { width: 200px; min-height: 48px; text-align: center; font-size: 17px; }
.cr-name .btn.icon { min-width: 48px; min-height: 48px; }

/* khung chọn ảnh nhỏ gọn, một hàng */
.photo-drop, .photo-drop.has { flex-direction: row; justify-content: center; gap: 12px; min-height: 0; width: auto; padding: 8px 14px; }
.photo-drop:not(.has) { outline-offset: -4px; }
.cr-stage { min-height: 200px; }
.cr-empty { height: 200px; }
.photo-drop .small, .photo-drop .btn { white-space: nowrap; }
.creator.photo .cr-name { margin-bottom: -8px; }

/* chỉnh sau khi tạo: màu da + kiểu tóc */
.cr-tune { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; }
.cr-tune .swatches { justify-content: center; gap: 6px; }
.swatch.sm { width: 44px; height: 44px; }
.hair-row { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; width: 100%; max-width: 440px; }
.hair-t { min-height: 48px; min-width: 0; padding: 2px; margin: 3px; }
.hair-t img { width: 100%; max-width: 44px; height: auto; image-rendering: pixelated; }
.hair-t.on::after { width: 18px; height: 18px; top: -8px; right: -8px; background-size: 16px; }
html.mob .hair-row { grid-template-columns: repeat(4, 1fr); }
html.desk .screen.creator-scr { max-height: 90vh; }
.cr-stage:has(canvas) { min-height: 0; }

/* Màn chính điện thoại: cuộn dọc, biểu đồ xếp dọc */
html.mob #page-hero { overflow-y: auto; overflow-x: hidden; }
html.mob .hero { position: relative; inset: auto; display: block; padding: 0 var(--safe) 24px; }
html.mob .hero-stage { height: max(340px, calc(100% - 0px)); height: 62vh; min-height: 340px; max-height: 520px; }
html.framed .hero-stage { height: 420px; }
html.mob .hero-info { grid-template-columns: 1fr; gap: 16px; margin-top: 12px; }
html.mob .hero-radar { padding: 6px; }
html.mob .hero-list { gap: 10px; padding: 12px 12px; }
html.mob .srow { min-height: 44px; }
html.mob .srow .nm, html.mob .srow .lv { font-size: 16px; }

/* Nhiệm vụ: tab theo lĩnh vực, badge xong, nút nổi */
.cat-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 6px 4px 10px; margin: 0 0 4px; scrollbar-width: none; }
.cat-tabs::-webkit-scrollbar { display: none; }
.ctab { --c: var(--gold); flex: none; display: flex; align-items: center; gap: 4px; min-height: 48px; padding: 4px 10px 4px 6px; margin: 3px; background: var(--slot); font-size: 15px;
  box-shadow: inset 0 -4px 0 color-mix(in srgb, var(--c) 70%, #000), 0 -3px 0 var(--line), 0 3px 0 var(--line), -3px 0 0 var(--line), 3px 0 0 var(--line); }
.ctab b { padding-left: 4px; }
.ctab .num { font-size: 14px; }
.ctab.on { background: var(--c); color: #fff; text-shadow: 1px 1px 0 rgba(0,0,0,.4); }
.ctab[data-cat="all"].on { background: var(--gold); color: #3a2410; text-shadow: none; }
.qrow .qi { position: relative; }
.qbadge { position: absolute; right: -12px; top: -12px; width: 28px; height: 28px; display: grid; place-items: center; background: var(--green); z-index: 2;
  box-shadow: 0 0 0 3px var(--line), inset 0 -3px 0 var(--green-d); }
.qbadge img { width: 24px; height: 24px; filter: brightness(0) invert(1); }
.qrow.just .qbadge { animation: badgeIn .5s steps(6); }
@keyframes badgeIn { 0% { transform: scale(0) rotate(-40deg); } 50% { transform: scale(1.5) rotate(10deg); } 75% { transform: scale(.9); } 100% { transform: scale(1) rotate(0); } }
.qrow.just { animation: rowDone .4s steps(4); }
@keyframes rowDone { 0% { background: var(--card); } 40% { background: color-mix(in srgb, var(--green) 45%, var(--card)); } 100% { } }
.qrow .qm { padding-left: 6px; }
.fab { display: none; position: fixed; right: calc(var(--safe) + 4px); bottom: calc(var(--nav-h) + 14px); z-index: 22; width: 64px; height: 64px; min-width: 64px; }
body[data-page="quests"] .fab { display: inline-flex; }
.page#page-quests { padding-bottom: 96px; }

.hair-row, html.mob .hair-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; width: 100%; max-width: 440px; }
.hair-t { flex: 0 0 auto; width: 60px; }

/* mobile: ẩn biểu đồ mạng nhện ở trang chủ */
html.mob .hero-radar { display: none; }
#hud-bg, #hud-mode { display: none; }
body[data-page=hero] #hud-bg, body[data-page=hero] #hud-mode { display: inline-flex; }
/* mobile: 2 nút cảnh (ngày/đêm, nền) nằm ngay dưới HUD, góc phải */
html.mob #hud-bg, html.mob #hud-mode { position: absolute; top: calc(100% + 6px); right: max(var(--safe), env(safe-area-inset-right)); margin: 0; }
html.mob #hud-mode { right: calc(max(var(--safe), env(safe-area-inset-right)) + 52px); }
/* chọn icon nhiệm vụ theo nhóm */
.ip-tabs { display: flex; gap: 2px; margin: 0 0 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.ip-tabs::-webkit-scrollbar { display: none; }
.ip-tabs .ctab.on { background: var(--gold); color: #3a2410; text-shadow: none; }
.ip-grid { min-height: 180px; align-content: start; }
.tune-lbl { width: 100%; font-weight: 800; font-size: 14px; opacity: .75; margin: 6px 0 -2px; text-align: center; }
.add-tile { display: grid; place-items: center; width: calc(100% - 8px); min-height: 60px; margin: 8px 4px 4px; background: transparent; border: 3px dashed var(--muted); color: var(--muted); cursor: pointer; opacity: .85; }
.add-tile:hover, .add-tile:focus-visible { opacity: 1; background: color-mix(in srgb, var(--gold) 18%, transparent); border-color: var(--gold-d); }
.add-tile:active { transform: translateY(2px); }
/* hover/focus dòng lĩnh vực ở trang chủ */
.srow { cursor: pointer; transition: background .08s steps(2); }
.srow:hover, .srow:focus-visible { background: rgba(255, 213, 74, .3); box-shadow: inset 4px 0 0 var(--gold), 0 0 0 2px var(--gold); }
.srow:hover .nm { color: var(--gold-l, #fff3b0); }
/* hàng nhiệm vụ tối giản: icon | tên | xu | dấu xong bên phải */
.qrow { margin: 12px 4px; min-height: 64px; padding-right: 10px; }
.qrow .qs { font-size: 13px; }
.qrow .qrw { gap: 2px; }
.qrow .qdone { width: 36px; height: 36px; flex: none; display: grid; place-items: center; position: relative; }
.qrow .qdone .qbadge { position: static; width: 36px; height: 36px; }
.qrow .qdone .qbadge img { width: 28px; height: 28px; }
/* pop-up nhân vật: trái = tên + nhân vật + ảnh, phải = tùy chỉnh */
.creator.photo .cr-left { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
html.desk .creator-scr .creator.photo.tuned { display: grid; grid-template-columns: 300px minmax(0, 1fr); align-items: center; column-gap: 28px; row-gap: 8px; max-width: none; }
html.desk .creator-scr .creator.photo.tuned .cr-left { grid-column: 1; grid-row: 1 / span 3; }
html.desk .creator-scr .creator.photo.tuned .cr-tune { grid-column: 2; grid-row: 1; }
html.desk .creator-scr .creator.photo.tuned .ai-status { grid-column: 2; }
html.desk .creator-scr .creator.photo.tuned .photo-drop { width: 100%; }
html.desk .screen.creator-scr:has(.creator.tuned) { width: min(720px, calc(100% - 64px)); }
html.desk .creator-scr .creator.photo.tuned .photo-drop > .muted { display: none; }
html.desk .creator-scr .creator.photo.tuned .photo-drop { justify-content: center; }
.cr-tune .tune-lbl { margin-top: 10px; }
/* thẻ phần thưởng: bấm cả thẻ để sửa */
.slot[data-edit] { cursor: pointer; }
.slot[data-edit]:hover, .slot[data-edit]:focus-visible { box-shadow: 0 0 0 3px var(--gold); }
.tune-lbl { display: flex; align-items: center; justify-content: center; gap: 6px; }
.tune-lbl img { width: 24px; height: 24px; }
.cr-intro { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; max-width: 320px; }
.cr-intro b { display: flex; align-items: center; gap: 6px; font-size: 16px; }
.cr-intro b img { width: 28px; height: 28px; }
/* tên trong pop-up nhân vật: không khung, sát trên đầu */
.cr-name .nm { background: none; box-shadow: none; color: var(--text); padding: 0 2px; font-size: 22px; }
.cr-pen { background: none; border: 0; padding: 4px; min-width: 44px; min-height: 44px; display: grid; place-items: center; cursor: pointer; opacity: .8; }
.cr-pen:hover, .cr-pen:focus-visible { opacity: 1; transform: translateY(-1px); }
.cr-pen img { width: 28px; height: 28px; }
.creator.photo.tuned .cr-name { margin-bottom: -44px; position: relative; z-index: 2; }
/* hover nhiệm vụ */
.qrow { transition: background .08s steps(2), transform .06s steps(1); }
.qrow:not(.view):hover, .qrow:focus-visible { background: color-mix(in srgb, var(--gold) 22%, var(--card)); outline: 3px solid var(--gold); outline-offset: 3px; }
.qrow.done:not(.view):hover { background: color-mix(in srgb, var(--green) 28%, var(--card)); }
/* HUD: chân dung tròn + tên + Lv + thanh XP */
.hud-level { gap: 10px; }
.hud-portrait { width: 52px; height: 52px; flex: none; border-radius: 50%; overflow: hidden; background: color-mix(in srgb, var(--sky, #7cc4f0) 70%, #fff); box-shadow: 0 0 0 3px var(--line), 0 0 0 5px var(--gold); display: grid; place-items: center; }
.hud-portrait img { width: 52px; height: 52px; image-rendering: pixelated; }
.hud-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.hud-name { display: flex; align-items: baseline; gap: 6px; color: #fff; line-height: 1; white-space: nowrap; overflow: hidden; }
.hud-name b { font-size: 16px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; text-shadow: 1px 1px 0 rgba(0,0,0,.5); }
.hud-name .num { font-size: 15px; color: var(--gold); }
.hud-who .bar { flex: none; width: 100%; height: 12px; }
html.mob .hud-portrait { width: 46px; height: 46px; }
html.mob .hud-portrait img { width: 46px; height: 46px; }
html.mob .hud-who { position: absolute; left: calc(var(--safe) + 4px); right: calc(var(--safe) + 4px); bottom: 6px; flex-direction: row; align-items: center; gap: 8px; }
html.mob .hud-who .hud-name { flex: none; max-width: 45%; }
html.mob .hud-who .hud-name b { font-size: 14px; }
html.mob .hud-who .bar { position: relative; left: auto; right: auto; bottom: auto; flex: 1; width: auto; height: 10px; margin: 0; }
html.mob #hud { padding-bottom: 34px; }
.daynav { display: flex; align-items: center; gap: 10px; }
.daynav .dlabel { flex: 1; display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
.daynav .dlabel b { font-size: 18px; }
.daynav .dlabel .num { font-size: 14px; color: var(--muted); }
.daynav .btn[disabled] { opacity: .35; pointer-events: none; }
html.mob .hud-who { background: var(--hud, #2a2540); padding: 3px 8px; box-shadow: 0 0 0 3px var(--line); pointer-events: auto; }
html.mob .hud-who .bar { order: 2; }

/* ---------- HUD v33: thẻ nhân vật & xu ---------- */
#hud .hud-chip.pbox.dark { --panel: #2a2347; --panel-l: rgba(255,255,255,.14); --panel-d: rgba(0,0,0,.35); }
.hud-level { flex: 0 1 380px; max-width: 380px; gap: 12px; padding: 6px 16px 6px 8px; }
html.desk .hud-level { max-width: 400px; }
.hud-ava { position: relative; flex: none; display: block; }
.hud-portrait { width: 56px; height: 56px; background: radial-gradient(circle at 50% 35%, #bfe6ff, #6fb6e8); box-shadow: 0 0 0 3px var(--line), 0 0 0 6px var(--gold), 0 0 0 9px var(--line); }
.hud-portrait img { width: 56px; height: 56px; }
.hud-lv { position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%); padding: 2px 6px 3px; font-size: 13px; line-height: 1; color: #3a2400; background: var(--gold); white-space: nowrap;
  box-shadow: 0 -2px 0 0 var(--line), 0 2px 0 0 var(--line), -2px 0 0 0 var(--line), 2px 0 0 0 var(--line), inset 0 2px 0 rgba(255,255,255,.5); }
.hud-who { gap: 6px; }
.hud-name { justify-content: space-between; align-items: center; }
.hud-name b { font-size: 18px; }
.hud-xp { font-size: 12px; color: #cfc6ff; opacity: .9; }
.hud-who .bar { height: 14px; background: #15102a;
  box-shadow: 0 -2px 0 0 var(--line), 0 2px 0 0 var(--line), -2px 0 0 0 var(--line), 2px 0 0 0 var(--line); }
.hud-who .bar::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 2px), rgba(0,0,0,.35) calc(10% - 2px) 10%); }
.hud-who .bar.xp { --bc: linear-gradient(90deg, #5fd3ff, #8d62f0 60%, #d36bff); }
#hud-coins { padding: 4px 16px 4px 8px; gap: 8px; min-width: 96px; }
#hud-coins .num { color: #ffe27a; }
html.mob .hud-level { flex: none; padding: 4px 6px; max-width: none; }
html.mob .hud-portrait, html.mob .hud-portrait img { width: 44px; height: 44px; }
html.mob .hud-lv { font-size: 11px; bottom: -8px; padding: 1px 4px 2px; }
html.mob .hud-xp { display: none; }
html.mob .hud-who { background: #2a2347; }
html.mob .hud-who .hud-name b { font-size: 14px; }
html.mob #hud { padding-bottom: 38px; }
.hud-nm { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hud-nm b { overflow: hidden; text-overflow: ellipsis; }
.hud-lv { position: static; transform: none; flex: none; }
html.mob .hud-lv { bottom: auto; }
.hud-level { padding-top: 8px; padding-bottom: 8px; }
/* HUD v35: bỏ nền thẻ nhân vật & xu */
#hud .hud-chip.pbox.dark { background: none; box-shadow: none; }
#hud .hud-chip.pbox.dark::before, #hud .hud-chip.pbox.dark::after { display: none; }
.hud-name b, .hud-chip .num, .hud-xp { text-shadow: -2px 0 0 var(--line), 2px 0 0 var(--line), 0 -2px 0 var(--line), 0 2px 0 var(--line), 2px 2px 0 var(--line); }
.hud-xp { color: #fff; opacity: 1; }
.hud-who .bar { background: rgba(21,16,42,.55); }
html.mob .hud-who { background: none; box-shadow: none; }
.name-tag { background: none; border: 0; box-shadow: none; text-shadow: -2px 0 0 var(--line), 2px 0 0 var(--line), 0 -2px 0 var(--line), 0 2px 0 var(--line), 2px 2px 0 var(--line); }
/* v37: bỏ nền tối bảng lĩnh vực & radar ở trang chủ */
.hero-radar.pbox.dark, .hero-list.pbox.dark { background: none; box-shadow: none; }
.hero-list .srow .nm, .hero-list .srow .lv { text-shadow: -2px 0 0 var(--line), 2px 0 0 var(--line), 0 -2px 0 var(--line), 0 2px 0 var(--line), 2px 2px 0 var(--line); }
.hero-list .srow .bar { background: rgba(21,16,42,.45); }
@media (max-width: 380px) { html.mob .hud-btn { width: 38px; height: 38px; min-width: 38px; min-height: 38px; margin: 1px; } html.mob .hud-btn svg, html.mob .hud-btn img { width: 26px; height: 26px; } html.mob .hud-btns { gap: 1px; } }
/* v39: bảng lĩnh vực & radar dùng nền kem sáng (cả ngày lẫn đêm) */
.hero-radar.pbox, .hero-list.pbox { --panel: rgba(255,244,226,.92); --panel-l: #fffdf6; --panel-d: #e6cfa8; background: var(--panel); color: var(--ink, #2a2238);
  box-shadow: 0 -3px 0 0 var(--line), 0 3px 0 0 var(--line), -3px 0 0 0 var(--line), 3px 0 0 0 var(--line), inset 0 -3px 0 0 var(--panel-d), inset 0 3px 0 0 var(--panel-l); }
.hero-list .srow { color: #2a2238; }
.hero-list .srow .nm { text-shadow: none; color: #2a2238; }
.hero-list .srow .lv { text-shadow: none; color: #b5651d; }
.hero-list .srow .bar { background: #e9d9bb; }
html.desk .hero-list { padding: 12px 16px; }
html.desk .hero-radar { padding: 10px; }
html.desk .pair2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: stretch; }
html.desk .pair2 > .panel { margin-left: 0; margin-right: 0; display: flex; flex-direction: column; }
html.desk .pair2 > .panel > .chart-wrap, html.desk .pair2 > .panel > .cal { flex: 1; }
/* v42: nền nhạt theo ngày/đêm cho bảng lĩnh vực & radar */
.hero-radar.pbox, .hero-list.pbox { --panel: rgba(255,255,255,.38); --panel-l: rgba(255,255,255,.35); --panel-d: rgba(0,0,0,.06); backdrop-filter: blur(1px);
  box-shadow: 0 -3px 0 0 rgba(34,25,46,.55), 0 3px 0 0 rgba(34,25,46,.55), -3px 0 0 0 rgba(34,25,46,.55), 3px 0 0 0 rgba(34,25,46,.55); }
.hero-list .srow .bar { background: rgba(255,255,255,.55); }
html[data-mode="night"] .hero-radar.pbox, html[data-mode="night"] .hero-list.pbox { --panel: rgba(20,16,48,.38); color: #fff;
  box-shadow: 0 -3px 0 0 rgba(10,8,24,.6), 0 3px 0 0 rgba(10,8,24,.6), -3px 0 0 0 rgba(10,8,24,.6), 3px 0 0 0 rgba(10,8,24,.6); }
html[data-mode="night"] .hero-list .srow, html[data-mode="night"] .hero-list .srow .nm { color: #fff; text-shadow: 1px 1px 0 rgba(0,0,0,.6); }
html[data-mode="night"] .hero-list .srow .lv { color: var(--gold); text-shadow: 1px 1px 0 rgba(0,0,0,.6); }
html[data-mode="night"] .hero-list .srow .bar { background: rgba(0,0,0,.35); }
/* v43: trang Tiến độ trên desktop vừa 1 màn hình, không cần cuộn */
html.desk #page-progress { padding: 6px var(--safe) 10px; }
html.desk #page-progress .page-inner { max-width: 1240px; height: 100%; }
html.desk #psub { height: 100%; display: grid; gap: 8px 12px; grid-template-columns: 1.25fr 1fr 1fr; grid-template-rows: auto auto minmax(0, 1fr);
  grid-template-areas: "seg stats stats" "ins ins ins" "xp radar cal"; }
html.desk #psub > .seg { grid-area: seg; align-self: center; margin: 0 3px; }
html.desk #psub > .seg .btn { min-height: 42px; font-size: 15px; }
html.desk #psub > .big-stats { grid-area: stats; grid-template-columns: repeat(4, 1fr); gap: 6px; }
html.desk #psub .bstat { min-height: 46px; padding: 4px 8px; }
html.desk #psub .bstat > :first-child { width: 32px; height: 32px; }
html.desk #psub .bstat .num { font-size: 20px; }
html.desk #psub .bstat small { font-size: 12px; }
html.desk #psub > .insight { grid-area: ins; margin: 3px; padding: 6px 12px; font-size: 14px; }
html.desk #psub > .insight > :first-child { width: 32px; height: 32px; }
html.desk #psub > .xp-top { grid-area: xp; }
html.desk #psub > .pair2 { display: contents; }
html.desk #psub > .pair2 > .panel:first-child { grid-area: radar; }
html.desk #psub > .pair2 > .panel:last-child { grid-area: cal; }
html.desk #psub .panel { margin: 3px; min-height: 0; display: flex; flex-direction: column; padding: 10px; overflow: hidden; }
html.desk #psub .panel .ttl { font-size: 16px; margin-bottom: 4px; }
html.desk #psub .panel .ttl > :first-child { width: 28px; height: 28px; }
html.desk #psub .panel > .chart-wrap { flex: 1; min-height: 0; display: grid; place-items: center; }
html.desk #psub .panel .legend { font-size: 12px; gap: 4px 8px; flex-wrap: wrap; justify-content: center; }
html.desk #psub .panel .legend i { width: 12px; height: 12px; }
html.desk #psub .cal { flex: 1; grid-template-columns: repeat(7, minmax(26px, 36px)); gap: 4px; align-content: center; }
html.desk #psub .cal .c { min-height: 0; font-size: 12px; box-shadow: 0 0 0 2px var(--line), inset 0 -3px 0 rgba(0,0,0,.18); }
html.desk #psub .cal .dh { font-size: 12px; }
html.desk #psub .panel .ttl small { font-size: 12px; font-weight: 700; opacity: .7; }

/* v48: trang Tiến độ ôm sát nội dung, canh giữa theo chiều dọc */
html.desk #page-progress.active { display: flex; flex-direction: column; }
html.desk #page-progress .page-inner { height: auto; width: 100%; margin: auto; }
html.desk #psub { height: auto; grid-template-rows: auto auto auto; }
html.desk #psub .panel > .chart-wrap { flex: none; }
html.desk #psub .panel .legend { margin-top: auto; padding-top: 6px; }
html.desk #psub .cal { flex: none; margin: auto 0; grid-template-columns: repeat(7, minmax(26px, 40px)); }
/* v49: thanh XP HUD rõ hơn (cả ngày & đêm) */
.hud-who .bar { background: rgba(255,255,255,.28); box-shadow: 0 0 0 2px var(--line), 0 0 0 4px rgba(255,255,255,.75); }
html[data-mode="night"] .hud-who .bar { background: rgba(255,255,255,.16); box-shadow: 0 0 0 2px #0b0818, 0 0 0 4px rgba(200,190,255,.6); }
.hud-who .bar::after { background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 2px), rgba(20,16,40,.45) calc(10% - 2px) 10%); }
.hud-who .bar { background: #d9eefb; }
html[data-mode="night"] .hud-who .bar { background: #4a4380; box-shadow: 0 0 0 2px #0b0818, 0 0 0 4px #c8beff; }
html.desk #psub .panel { padding-bottom: 20px; }
html.desk #hud-bg, html.desk #hud-mode { display: inline-flex; }
html.desk #psub { grid-template-areas: "stats stats stats" "ins ins ins" "xp radar cal"; }
/* v54: nút + nhiệm vụ nằm cùng hàng phân loại */
.cat-row { display: flex; align-items: flex-start; gap: 8px; }
.cat-row .cat-tabs { flex: 1; min-width: 0; }
.cat-row .q-add { flex: none; width: 48px; height: 48px; min-width: 48px; min-height: 48px; margin: 9px 7px 0 0; padding: 0; }
body[data-page="quests"]:has(.cat-row) .fab { display: none; }

/* v55: nút sửa hiện khi rê chuột vào nhiệm vụ */
.qrow .q-edit { flex: none; width: 36px; height: 36px; display: grid; place-items: center; padding: 0; background: none; border: 0; cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .08s steps(2); }
.qrow .q-edit img { width: 24px; height: 24px; }
.qrow:hover .q-edit, .qrow:focus-within .q-edit { opacity: .85; pointer-events: auto; }
.qrow .q-edit:hover { opacity: 1; transform: translateY(-1px); }

/* v55: pop-up tạo nhiệm vụ tối giản */
.lab2 { font-weight: 800; font-size: 14px; color: var(--muted); margin: 14px 2px 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { --c: var(--gold); display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 3px 10px 3px 6px; font: inherit; font-weight: 700; font-size: 14px; color: var(--text); background: var(--slot); border: 0; cursor: pointer;
  box-shadow: 0 0 0 2px var(--line), inset 3px 0 0 var(--c); }
.chip img { width: 24px; height: 24px; }
.chip:hover { background: color-mix(in srgb, var(--c) 22%, var(--slot)); }
.chip.on { background: color-mix(in srgb, var(--c) 55%, var(--slot)); box-shadow: 0 0 0 2px var(--line), 0 0 0 4px var(--gold); color: #fff; text-shadow: 1px 1px 0 rgba(0,0,0,.4); }
.chip.tier { --c: var(--gold); padding-left: 10px; }
.chip.tier.on { color: #3a2410; text-shadow: none; background: var(--gold); }
.chip.add { padding: 3px 6px; --c: var(--green, #4cb350); }
.more-link { display: inline-flex; align-items: center; gap: 4px; margin: 14px 0 2px; padding: 4px 2px; background: none; border: 0; font: inherit; font-weight: 700; font-size: 14px; color: var(--muted); cursor: pointer; }
.more-link:hover { color: var(--text); }
.more-link img { width: 20px; height: 20px; }
html.mob .qrow .q-edit { display: none; }

/* v55: quản lý lĩnh vực */
.cat-list { display: flex; flex-direction: column; gap: 8px; }
.cat-item { display: flex; align-items: center; gap: 6px; padding: 6px 8px; background: var(--slot); box-shadow: 0 0 0 2px var(--line), inset 4px 0 0 var(--c); }
.cat-item .cat-ic { width: 40px; height: 40px; display: grid; place-items: center; flex: none; box-shadow: 0 0 0 2px var(--line); }
.cat-item .grow { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-item small { white-space: nowrap; margin-right: 4px; }
.btn.icon.sm { width: 36px; height: 36px; min-width: 36px; min-height: 36px; padding: 0; margin: 2px; }
.btn.icon.sm img { width: 22px; height: 22px; }
.btn.icon.sm:disabled { opacity: .35; }
html.mob .cat-item small { display: none; }
html.mob #hud-cats { display: none; }
html.mob body[data-page=hero] #hud-cats { display: inline-flex; position: absolute; top: calc(100% + 6px); right: calc(max(var(--safe), env(safe-area-inset-right)) + 104px); margin: 0; }
/* v55: tiêu đề lĩnh vực khác hẳn thẻ nhiệm vụ: không khung, chữ hoa, gạch chân màu lĩnh vực */
.qg-head { background: none !important; box-shadow: none !important; border: 0 !important; padding: 0 2px 6px; margin: 6px 4px 4px; gap: 8px; border-bottom: 3px solid var(--c) !important; }
.qg-head::before, .qg-head::after { display: none !important; }
.qg-head .qg-ic { width: 28px; height: 28px; margin-left: 0; background: none; box-shadow: none; }
.qg-head .qg-ic img { width: 28px; height: 28px; }
.qg-head b { font-size: 15px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--text); }
.qg-head .num { font-size: 13px; padding: 2px 8px; background: var(--c); color: #fff; text-shadow: 1px 1px 0 rgba(0,0,0,.35); box-shadow: 0 0 0 2px var(--line); }
.qg-head .num.all { background: var(--green, #4cb350); color: #fff; }
html[data-mode="night"] .qg-head .num.all { color: #fff; }
/* mobile: nút + nổi góc dưới phải */
html.mob .cat-row .q-add { display: none; }
html.mob body[data-page="quests"] .fab { display: inline-flex !important; }
/* v56: badge check = dấu check to, không khung, đè lên viền phải */
.qrow .qdone { position: static; width: 24px; }
.qrow .qdone .qbadge { position: absolute; right: -22px; top: 50%; margin-top: -26px; width: 52px; height: 52px; background: none; box-shadow: none; z-index: 3; }
.qrow .qdone .qbadge img { width: 52px; height: 52px; filter: drop-shadow(2px 2px 0 rgba(0,0,0,.35)); }
.qrow.done { overflow: visible; }
html.mob .qrow .qdone .qbadge { right: -14px; width: 44px; height: 44px; margin-top: -22px; } html.mob .qrow .qdone .qbadge img { width: 44px; height: 44px; }
/* v56: nút HUD trên mobile nhỏ hơn, thưa hơn */
html.mob .hud-btn, html.mob #hud .hud-btn { width: 38px; height: 38px; min-width: 38px; min-height: 38px; margin: 2px; }
html.mob .hud-btn img, html.mob .hud-btn svg { width: 24px; height: 24px; }
html.mob .hud-btns { gap: 8px; }
html.mob #hud-mode { right: calc(max(var(--safe), env(safe-area-inset-right)) + 48px); }
html.mob body[data-page=hero] #hud-cats { right: calc(max(var(--safe), env(safe-area-inset-right)) + 96px); }
@media (max-width: 380px) { html.mob .hud-btns { gap: 5px; } }
@media (max-width: 380px) { html.mob #hud .hud-btn { width: 34px; height: 34px; min-width: 34px; min-height: 34px; } html.mob .hud-btns { gap: 6px; } html.mob #hud-coins { min-width: 0; padding-right: 6px; } }

/* v56: chú thích (tooltip) nhỏ hơn, tối đa 2 dòng */
#tip { white-space: normal; max-width: 220px; font-size: 13px; line-height: 1.3; padding: 4px 8px; text-align: center; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chart-tip { font-size: 13px; padding: 3px 8px; white-space: normal; max-width: 220px; width: max-content; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#tip, .chart-tip { max-height: calc(2.6em + 8px); }
#tip { display: block; overflow: visible; max-height: none; -webkit-line-clamp: unset; } #tip .tt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* v57: form nhiệm vụ gọn, hiện đủ tùy chọn */
.qf-top { gap: 10px; }
.qform { display: grid; grid-template-columns: 92px 1fr; gap: 10px 10px; align-items: center; margin-top: 14px; }
.qform .ql { font-weight: 800; font-size: 14px; color: var(--muted); }
.qform .qv { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.qform .chip { min-height: 34px; padding: 3px 10px; }
.qform .chip img { width: 20px; height: 20px; }
.qform .sel { flex: 1; min-width: 0; min-height: 36px; padding: 4px 8px; font: inherit; font-weight: 700; font-size: 15px; color: var(--text); background: var(--slot); border: 0; box-shadow: 0 0 0 2px var(--line); border-radius: 0; }
.qform .txt.sm { width: 110px; min-height: 36px; padding: 4px 8px; font-size: 15px; }
.qform .stepper { margin: 0; gap: 4px; }
.qform .stepper .btn.icon { width: 32px; height: 32px; min-width: 32px; min-height: 32px; padding: 0; }
.qform .stepper .btn.icon img { width: 20px; height: 20px; }
.qform .stepper .val { min-width: 40px; font-size: 16px; text-align: center; }
html.mob .qform { grid-template-columns: 1fr; gap: 4px; }
html.mob .qform .ql { margin-top: 8px; }
html.mob .qform .ql:empty { display: none; }

/* v57: mobile gom các nút HUD vào 1 menu */
.hud-menu { display: contents; }
#hud-more { display: none; }
html.desk .hud-menu.pbox { box-shadow: none; background: none; }
html.mob #hud-more { display: inline-flex; }
html.mob .hud-btns { position: relative; }
html.mob .hud-menu { display: none; position: absolute; top: calc(100% + 10px); right: 0; z-index: 30; padding: 10px; grid-template-columns: repeat(4, auto); gap: 10px; }
html.mob #hud.menu-open .hud-menu { display: grid; }
html.mob .hud-menu .hud-btn, html.mob body[data-page] .hud-menu .hud-btn { display: inline-flex !important; position: static !important; margin: 0 !important; width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
html.mob .hud-menu .hud-btn img { width: 28px; height: 28px; }
html.mob #hud.menu-open #hud-more { --b: var(--gold); --bd: var(--gold-d); --bl: var(--gold-l); }

.qform .chip.on { background: var(--gold); color: #3a2410; text-shadow: none; }
.qform .chip[data-dow] { min-width: 38px; padding: 3px 6px; justify-content: center; }
.qform input[type=time].txt.sm { width: 120px; }
html.mob .qform .chip[data-dow] { min-width: 0; padding: 3px 5px; }
html.mob .qform .qv { gap: 5px; }

/* v58: mobile top bar chỉ còn nút Cài đặt */
html.mob #hud-more { display: none !important; }
html.mob .hud-menu, html.mob #hud.menu-open .hud-menu { display: contents !important; }
html.mob .hud-menu .hud-btn:not(#hud-gear) { display: none !important; }
html.mob #hud .hud-menu #hud-gear { width: 38px; height: 38px; min-width: 38px; min-height: 38px; margin: 2px !important; }
html.mob #hud .hud-menu #hud-gear img { width: 24px; height: 24px; }
/* v58: tên thẳng mép trái với viền avatar (mobile) */
html.mob .hud-who { padding-left: 0; margin-left: -9px; }
/* v58: kéo thả sắp xếp lĩnh vực */
.cat-item { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; position: relative; }
.cat-item.dragging { cursor: grabbing; z-index: 5; opacity: .92; box-shadow: 0 0 0 2px var(--gold), inset 4px 0 0 var(--c), 0 6px 0 rgba(0,0,0,.35); }
.cat-item .btn { cursor: pointer; }
.cat-hint { margin: -2px 0 8px; font-weight: 700; }

/* v58: nút + nhỏ ở tiêu đề lĩnh vực (hiện khi hover) */
.qg-add { display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; cursor: pointer; background: var(--slot, #fff); box-shadow: 0 0 0 2px var(--line); opacity: 0; transition: opacity .12s; margin-right: 2px; }
.qg-add img { width: 18px; height: 18px; }
.qgroup:hover .qg-add, .qg-add:focus-visible { opacity: 1; }
.qg-add:hover { background: var(--green-l, #8be08f); }
html.mob .qg-add { opacity: .85; width: 26px; height: 26px; }

/* v58: dropdown pixel theo theme */
.dd-btn { display: inline-flex; align-items: center; gap: 8px; text-align: left; cursor: pointer; }
.qform .dd-btn { flex: 1; }
.dd-btn .dd-v { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-btn.ph .dd-v { color: var(--muted); }
.dd-car { flex: none; width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 7px solid currentColor; opacity: .8; }
.dd-btn.open .dd-car { transform: rotate(180deg); }
.dd-btn.open, .dd-btn:focus-visible { box-shadow: 0 0 0 2px var(--line), 0 0 0 5px var(--gold) !important; outline: none; }
.dd-pop { position: fixed; z-index: 9999; overflow-y: auto; padding: 6px; background: var(--card, #fff8ea); color: var(--text); max-width: calc(100vw - 16px); overscroll-behavior: contain; }
.dd-grp { padding: 8px 8px 4px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.dd-opt { display: block; width: 100%; padding: 8px 12px; border: 0; background: none; color: inherit; font: inherit; font-weight: 700; font-size: 15px; text-align: left; cursor: pointer; white-space: nowrap; }
.dd-opt.in { padding-left: 20px; }
.dd-opt:hover, .dd-opt:focus-visible { background: var(--slot); outline: none; box-shadow: inset 0 0 0 2px var(--line); }
.dd-opt.on { background: var(--gold); color: #2a1a00; }
.dd-opt[disabled] { opacity: .45; cursor: default; }
/* v58: phần thưởng theo chuỗi */
.slot.streak .price small { font-size: 14px; font-weight: 800; margin-left: 4px; }
.slot.streak .rq { display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 13px; font-weight: 700; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.slot.streak .rq img { width: 18px; height: 18px; flex: none; }
.slot.owned .price small { font-size: 13px; margin-left: 4px; }

/* v58h: form nhiệm vụ tối giản – nhãn là icon, dropdown có icon */
.qform { grid-template-columns: 32px 1fr; gap: 10px 12px; }
.qform .ql { display: grid; place-items: center; width: 32px; height: 32px; }
.qform .ql img { width: 24px; height: 24px; }
html.mob .qform { grid-template-columns: 28px 1fr; gap: 8px 8px; }
html.mob .qform .ql { margin-top: 0; width: 28px; }
html.mob .qform .ql:empty { display: block; }
.qform .chip { gap: 5px; }
.dd-ic { display: inline-grid; place-items: center; flex: none; }
.dd-ic img, .dd-opt img, .dd-grp img { width: 20px; height: 20px; flex: none; }
.dd-opt { display: flex; align-items: center; gap: 8px; }
.dd-grp { display: flex; align-items: center; gap: 6px; border-bottom: 2px solid var(--c, transparent); margin: 4px 4px 2px; padding: 8px 4px 4px; }
.dd-opt.in { padding-left: 14px; }
html.mob .qform .chip { padding: 3px 7px; gap: 4px; }
/* v58: liên kết lĩnh vực trong trang kỹ năng: không khung */
.mini.stat-link { background: none !important; box-shadow: none !important; border: 0 !important; padding: 4px 2px; min-height: 0; gap: 6px; color: var(--text); cursor: pointer; }
.mini.stat-link::before, .mini.stat-link::after { display: none !important; }
.mini.stat-link:hover span, .mini.stat-link:hover { text-decoration: underline; text-underline-offset: 3px; }
/* v58: lĩnh vực kỹ năng nằm cùng một dòng */
.big-stats.row1 { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.big-stats.row1 .bstat { min-height: 52px; padding: 6px 8px; gap: 6px; }
.big-stats.row1 .bstat > img:first-child, .big-stats.row1 .bstat > svg:first-child { width: 32px; height: 32px; flex: none; }
.big-stats.row1 .bstat .num { font-size: 20px; }
.big-stats.row1 .bstat small { font-size: 12px; line-height: 1.2; }
html.mob .big-stats.row1 .bstat { flex-direction: column; text-align: center; gap: 2px; padding: 6px 4px; }
html.mob .big-stats.row1 .bstat > img:first-child, html.mob .big-stats.row1 .bstat > svg:first-child { width: 28px; height: 28px; }

/* ===== v59: dọn UI tối giản ===== */
/* 1. top bar desktop chỉ còn Âm thanh + Cài đặt */
html.desk .hud-menu .hud-btn:not(#hud-gear):not(#hud-sound) { display: none !important; }
html.desk .hud-btns { gap: 12px; }
/* 12. nav bỏ số phím tắt */
.nav-btn .key { display: none !important; }
/* 2-4, 13. trang Nhiệm vụ */
.fab, #fab-add { display: none !important; }
.cat-row { display: none !important; }
.q-head { display: flex; flex-direction: column; gap: 10px; padding: 4px 4px 0; margin: 4px 4px 22px; background: none; box-shadow: none; }
.q-head .daynav { gap: 8px; }
.q-head .dlabel { flex: none !important; align-items: flex-start !important; padding: 0 4px; min-width: 96px; }
.q-head .dlabel b { font-size: 20px; }
.q-head .dlabel .sub { font-size: 13px; font-weight: 700; color: var(--muted); }
.dn-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; cursor: pointer; background: var(--slot); box-shadow: 0 0 0 2px var(--line); }
.dn-btn[disabled] { opacity: .3; cursor: default; }
.dn-btn img { width: 20px; height: 20px; }
.dp-n { font-weight: 700; color: var(--muted); font-size: 15px; white-space: nowrap; }
.dp-n b { color: var(--text); font-size: 18px; }
.q-head .q-add { display: inline-flex !important; min-height: 40px; padding: 4px 14px 4px 10px; gap: 6px; font-size: 15px; }
.q-head .q-add img { width: 20px; height: 20px; }
.dayprog .bar.slim { height: 8px; flex: 1; box-shadow: none; background: rgba(0,0,0,.12); }
.dayprog .bar.slim > i { box-shadow: none; }
html[data-mode="night"] .dayprog .bar.slim { background: rgba(255,255,255,.14); }
html.mob .q-head .q-add span { display: none; }
html.mob .q-head .q-add { padding: 4px 8px; min-width: 40px; }
html.mob .dp-n { font-size: 13px; }
html.mob .dp-n b { font-size: 16px; }
.qgroup { margin-bottom: 22px; }
.qg-head { margin-bottom: 8px !important; }
.qrow { margin: 10px 4px; }
/* 7. bỏ khung viền dày ở panel nội dung */
.panel.pbox, .insight.pbox, .shop-head.pbox, .bstat, .set-list.pbox { box-shadow: none !important; }
.panel.pbox, .insight.pbox, .shop-head.pbox, .bstat { background: var(--panel); }
html:not([data-mode="night"]) .panel.pbox, html:not([data-mode="night"]) .insight.pbox, html:not([data-mode="night"]) .shop-head.pbox, html:not([data-mode="night"]) .bstat { background: rgba(255,251,242,.94); }
.bstat { margin: 0; }
.big-stats { gap: 10px; }
/* 11. lịch dịu màu */
.cal .c.full, .cal .c.done { background: #3f9a56; color: #fff; }
.cal .c.partial { background: #a9d8a8; color: #1f3d24; }
.cal .c.miss { background: #cfc8d6; color: #5d5670; opacity: 1; }
.cal .c.rest { background: #9cc3ec; color: #1d3550; }
html[data-mode="night"] .cal .c.partial { background: #4f7f55; color: #fff; }
html[data-mode="night"] .cal .c.miss { background: #4a4560; color: #bdb6d0; }
html[data-mode="night"] .cal .c.rest { background: #3f6a9a; color: #fff; }
/* 6. 3 ô thống kê trên desktop */
html.desk #psub > .big-stats { grid-template-columns: repeat(3, 1fr) !important; gap: 10px; }
html.desk #psub { gap: 12px 16px; }
html.mob .big-stats:not(.row1) { grid-template-columns: repeat(3, 1fr); }
html.mob #psub .bstat { flex-direction: column; text-align: center; gap: 2px; padding: 8px 4px; min-height: 0; }
html.mob #psub .bstat > :first-child { width: 28px; height: 28px; }
html.mob #psub .bstat .num { font-size: 20px; }
html.mob #psub .bstat small { font-size: 12px; }
.panel { margin-bottom: 18px; }
.insight { margin-bottom: 18px; }
/* 15. mobile trang Nhân vật: hiện đủ lĩnh vực */
html.mob #page-hero .hero { display: flex; flex-direction: column; min-height: 100%; height: 100%; padding-bottom: 12px; }
html.mob #page-hero .hero-stage { flex: 1 1 auto; height: auto !important; min-height: 220px; max-height: none; }
html.mob #page-hero .hero-info { flex: none; margin-top: 8px; display: block; }
html.mob #page-hero .hero-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; padding: 12px; margin: 0; }
html.mob #page-hero .hero-list .srow { min-height: 38px; gap: 6px; }
html.mob #page-hero .hero-list .srow .plate { width: 30px; height: 30px; }
html.mob #page-hero .hero-list .srow .plate img { width: 22px; height: 22px; }
html.mob #page-hero .hero-list .srow .nm, html.mob #page-hero .hero-list .srow .lv { font-size: 13px; }
/* trang Nhân vật desktop: bảng lĩnh vực căn giữa bên trái khi không còn radar */
html.desk .hero-radar { display: none; }
/* giãn chỗ dính sát */
.slot { margin: 6px; }
.shop { gap: 6px; }
.shop-head { margin-bottom: 18px; }
.set-row { padding-top: 12px; padding-bottom: 12px; }
.cat-item { margin-bottom: 8px; }
.toast .btn { min-height: 40px; }
.chart-tip[hidden] { display: none !important; }

/* ===== v60: tối giản thao tác ===== */
/* dòng nhiệm vụ: nút ⋯ và +step */
.q-edit { display: none !important; }
.q-more { display: inline-flex; align-items: center; justify-content: center; gap: 3px; width: 36px; height: 36px; padding: 0; border: 0; background: none; cursor: pointer; flex: none; opacity: 0; transition: opacity .12s; }
.q-more i { width: 4px; height: 4px; background: var(--muted); display: block; }
.q-more:hover i { background: var(--text); }
.qrow:hover .q-more, .qrow:focus-within .q-more { opacity: 1; }
html.mob .q-more { opacity: .8; width: 30px; }
.q-plus { flex: none; min-width: 44px; height: 34px; padding: 0 8px; border: 0; cursor: pointer; font: inherit; font-weight: 800; font-size: 15px; color: #fff; background: var(--green-d, #2f8a3c); box-shadow: 0 0 0 2px var(--line), inset 0 -3px 0 rgba(0,0,0,.2); }
.q-plus:active { transform: translateY(1px); }
.q-amt { cursor: pointer; }
.q-amt b { color: var(--text); }
.q-amt[data-num]:hover { text-decoration: underline; text-underline-offset: 2px; }
.q-chest { display: inline-flex; gap: 6px; min-height: 40px; padding: 4px 12px 4px 8px; font-size: 15px; animation: pulse 1.2s steps(2) infinite; }
.q-chest img { width: 22px; height: 22px; }
html.mob .q-chest span { display: none; }
/* trang chi tiết nhiệm vụ: thao tác */
.qd-acts { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 4px 16px; }
.qd-acts .btn, .qd-danger .btn { min-height: 42px; gap: 6px; padding: 4px 14px; font-size: 15px; }
.qd-danger { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin: 22px 4px 10px; padding-top: 14px; border-top: 2px dashed rgba(0,0,0,.15); }
/* toast 2 nút */
.toast .btn { gap: 4px; padding: 4px 10px; }
.toast .btn img { width: 20px; height: 20px; }
/* phần thưởng: bút chì sửa */
.slot { position: relative; }
.r-edit { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; display: grid; place-items: center; border: 0; padding: 0; cursor: pointer; background: rgba(255,255,255,.7); box-shadow: 0 0 0 2px var(--line); opacity: 0; transition: opacity .12s; z-index: 2; }
.slot:hover .r-edit, .r-edit:focus-visible { opacity: 1; }
html.mob .r-edit { opacity: .85; }
.r-edit img { width: 18px; height: 18px; }
/* cài đặt: nhãn chữ dưới icon */
.ic-seg .btn { flex-direction: column; gap: 2px; min-width: 60px; padding: 4px 6px; }
.ic-seg .btn small { font-size: 11px; font-weight: 800; line-height: 1.1; }
.ic-seg .btn img { width: 24px; height: 24px; }
/* nút Trang phục */
.hero-stage { position: relative; }
.hero-outfit { position: absolute; top: 8px; right: 8px; z-index: 7; display: inline-flex; gap: 6px; min-height: 38px; padding: 4px 12px 4px 8px; font-size: 14px; }
html.desk .hero-outfit { top: auto; bottom: 24px; right: 0; }
@keyframes pulse { 50% { transform: translateY(-2px); } }
html.mob .qrow:has(.q-plus) .qrw { display: none; }
html.mob .q-plus { min-width: 40px; height: 32px; font-size: 14px; }
html.mob .ic-seg .btn { min-width: 50px; }
/* v61: mobile trang Nhân vật bớt bầu trời */
html.mob #page-hero .hero-stage { flex: 0 0 auto; height: 44vh !important; min-height: 280px; max-height: 420px; }
html.mob #page-hero .hero-info { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: flex-start; margin-top: 18px; }
.hud-ava { cursor: pointer; }
.hud-ava:hover .hud-portrait { filter: brightness(1.08); }

/* v61: popup phần thưởng */
.r-edit { display: none !important; }
.dialog .actions .btn.r-edit-btn { flex: 0 0 auto; min-width: 0; padding: 4px 16px; }
.dialog .actions .btn.r-locked { opacity: .55; cursor: not-allowed; }

/* v61: ảnh riêng cho phần thưởng + hoàn lại */
.r-img { display: block; object-fit: cover; image-rendering: auto; box-shadow: 0 0 0 3px var(--line); background: #fff; }
.slot .r-img { width: 64px; height: 64px; }
.dlg-hero .r-img { width: 96px; height: 96px; }
#ri .r-img { width: 64px; height: 64px; }
.r-pick { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.r-pick-acts { display: flex; gap: 4px; }
.r-pick-acts .chip { min-height: 30px; padding: 2px 8px; gap: 4px; font-size: 13px; }
.r-pick-acts .chip img { width: 18px; height: 18px; }
.slot.owned { cursor: pointer; }
.dlg-hero .muted > img { display: inline-block; vertical-align: -5px; margin-right: 4px; }

/* v62: form phần thưởng tối giản */
.rf { display: flex; flex-direction: column; gap: 16px; padding: 4px 2px 6px; }
.rf-top { display: flex; align-items: center; gap: 14px; }
.rf-prev { flex: none; width: 76px; height: 76px; display: grid; place-items: center; padding: 0; border: 0; cursor: pointer; background: var(--slot); box-shadow: 0 0 0 2px var(--line); }
.rf-prev img { width: 52px; height: 52px; }
.rf-prev .r-img { width: 76px; height: 76px; box-shadow: none; }
.rf-top .txt { flex: 1; min-width: 0; }
.rf-icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; }
.rf-ic { height: 40px; display: grid; place-items: center; padding: 0; border: 0; cursor: pointer; background: none; }
.rf-ic img { width: 24px; height: 24px; }
.rf-ic:hover { background: var(--slot); }
.rf-ic.on { background: var(--gold); box-shadow: 0 0 0 2px var(--line); }
.rf-ic.up { box-shadow: inset 0 0 0 2px var(--muted); }
.rf-seg { display: flex; gap: 8px; }
.rf-seg .chip { flex: 1; justify-content: center; min-height: 40px; gap: 6px; }
.rf-seg .chip img { width: 20px; height: 20px; }
.rf-seg .chip.on { background: var(--gold); color: #3a2410; }
.rf-row { display: flex; align-items: center; gap: 10px; }
.rf-row .sel { flex: 1; min-height: 40px; }
.rf-row .muted { font-weight: 700; }
.rf-row .stepper { margin: 0; }
.rf-hint { margin-top: -8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.dialog .actions .btn.r-del { flex: 0 0 auto; min-width: 0; padding: 4px 14px; }
.rf .stepper { gap: 6px; }
.rf .stepper .btn.icon { width: 38px; height: 38px; min-width: 38px; min-height: 38px; padding: 0; }
.rf .stepper .btn.icon img { width: 22px; height: 22px; }
.rf .stepper .val { min-width: 56px; font-size: 18px; text-align: center; }
.rf-row .muted { white-space: nowrap; }

/* v63: form nhiệm vụ tối giản */
.qf2 { gap: 18px; }
.qf-f { display: flex; flex-direction: column; gap: 8px; }
.qf-l { font-size: 13px; font-weight: 800; color: var(--muted); letter-spacing: .02em; }
.qf-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qf-2 .sel, .qf-2 .dd-btn { width: 100%; min-width: 0; min-height: 40px; }
.qf2 .rf-seg .chip { font-weight: 800; }
.qf-coin { display: inline-flex; align-items: center; gap: 2px; margin-left: 4px; opacity: .8; font-size: 14px; }
.qf-coin img { width: 16px !important; height: 16px !important; }
.qf-dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.qf-dow .chip { justify-content: center; padding: 3px 0; min-height: 36px; min-width: 0; }
.qf-dow .chip.on { background: var(--gold); color: #3a2410; }
.qf2 .rf-row .grow { flex: 1; }
.qf2 input[type=time].txt { width: 140px; flex: none; min-height: 40px; padding: 4px 8px; }
html.mob .qf-2 { grid-template-columns: 1fr; }
html.mob .qf2 .rf-seg { gap: 6px; }
html.mob .qf2 .rf-seg .chip { padding: 3px 6px; }

.rf-coin { display: inline-flex; align-items: center; }
.rf-coin img { width: 28px; height: 28px; }
/* v63: chú thích lịch 1 dòng */
.legend, html.desk #psub .panel .legend { flex-wrap: nowrap; gap: 10px; font-size: 12px; white-space: nowrap; }
.legend span { display: inline-flex; align-items: center; }
.legend i, html.desk #psub .panel .legend i { width: 11px; height: 11px; margin-right: 4px; vertical-align: 0; box-shadow: 0 0 0 1.5px var(--line); }
html.mob .legend { gap: 8px; font-size: 11px; }
.slot .date { display: inline-flex; align-items: center; justify-content: center; gap: 4px; white-space: nowrap; font-size: 13px; }
.slot .date img { width: 18px; height: 18px; flex: none; }
/* v63: hover phần thưởng */
.slot[data-r], .slot[data-own], #add-r2 { cursor: pointer; transition: transform .12s steps(2), box-shadow .12s; }
@media (hover: hover) {
  .slot[data-r]:hover, .slot[data-own]:hover, #add-r2:hover { transform: translateY(-3px); box-shadow: 0 -4px 0 var(--gold), 0 4px 0 var(--gold), -4px 0 0 var(--gold), 4px 0 0 var(--gold), 0 10px 0 rgba(0,0,0,.25), inset 0 -6px 0 var(--slot-d), inset 0 4px 0 rgba(255,255,255,.25); z-index: 1; }
}
.slot[data-r]:focus-visible, .slot[data-own]:focus-visible { box-shadow: 0 0 0 3px var(--gold); }
.qd-danger .btn.icon { width: 44px; min-width: 44px; padding: 0; justify-content: center; }
.qd-danger { border-top: 0; padding-top: 0; }
/* v63: nút lĩnh vực cạnh cài đặt */
html.desk #hud .hud-menu #hud-cats.hud-btn, html.mob #hud .hud-menu #hud-cats.hud-btn { display: inline-flex !important; }
html.mob #hud .hud-menu #hud-cats { width: 38px; height: 38px; min-width: 38px; min-height: 38px; margin: 2px !important; }
html.mob #hud .hud-menu #hud-cats img { width: 24px; height: 24px; }
html.mob body[data-page] #hud .hud-menu #hud-cats { position: static; top: auto; right: auto; }
/* v63: bộ chọn icon không phân loại */
.ip-flat { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; max-height: min(60vh, 460px); overflow-y: auto; padding: 4px; }
.ip-ic { height: 52px; display: grid; place-items: center; padding: 0; border: 0; cursor: pointer; background: none; }
.ip-ic img { width: 32px; height: 32px; }
.ip-ic:hover { background: var(--slot); }
.ip-ic.on { background: var(--gold); box-shadow: 0 0 0 2px var(--line); }
/* v63: icon lĩnh vực cho lĩnh vực */
.dom-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; margin-top: 14px; max-height: 46vh; overflow-y: auto; padding: 2px; }
.dom-ic { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px 6px; border: 0; cursor: pointer; background: none; color: var(--text); font: inherit; }
.dom-ic img { width: 32px; height: 32px; }
.dom-ic small { font-size: 12px; font-weight: 700; line-height: 1.1; text-align: center; }
.dom-ic:hover { background: var(--slot); }
.dom-ic.on { background: var(--gold); color: #3a2410; box-shadow: 0 0 0 2px var(--line); }
html.mob .dom-grid { grid-template-columns: repeat(4, 1fr); }
/* v63: segmented control phẳng, thoáng */
.rf .rf-seg, .rf .qf-dow { background: rgba(0,0,0,.14); padding: 4px; gap: 4px; }
.rf .rf-seg .chip, .rf .qf-dow .chip { box-shadow: none !important; background: transparent; text-shadow: none; min-height: 38px; color: var(--text); }
.rf .rf-seg .chip:hover, .rf .qf-dow .chip:hover { background: rgba(255,255,255,.08); }
.rf .rf-seg .chip.on, .rf .qf-dow .chip.on { background: var(--gold); color: #3a2410; box-shadow: 0 2px 0 rgba(0,0,0,.25) !important; }
.rf .qf-dow { margin-top: 6px; }
.rf .qf-dow .chip { min-height: 34px; font-size: 13px; }
.rf .qf-sub { margin-top: 6px; }
.rf .txt, .rf .dd-btn { box-shadow: 0 0 0 2px var(--line); }
.qf-f > .sel, .qf-f > .dd-btn { width: 100%; min-height: 42px; }
/* v63: tổng XP trên HUD */
#hud-xpt { padding: 4px 14px 4px 8px; gap: 8px; }
#hud-xpt .num { color: #b9e6ff; }
html.mob #hud-xpt { padding: 2px 6px 2px 2px; gap: 4px; }
html.mob #hud-xpt img { width: 24px; height: 24px; }
html.mob #hud-coins { min-width: 0; padding: 2px 6px 2px 2px; gap: 4px; }
html.mob #hud-coins img { width: 24px; height: 24px; }
html.mob .hud-res { gap: 4px; }
/* v63: tag chi tiết nhiệm vụ cùng hàng */
.qd-tags { flex-wrap: nowrap; gap: 8px; min-width: 0; }
.qd-tags .mini { min-height: 40px !important; padding: 4px 10px 4px 6px; gap: 6px; min-width: 0; white-space: nowrap; font-size: 15px; }
.qd-tags .mini img { width: 24px; height: 24px; flex: none; }
html.mob .qd-tags .mini { font-size: 13px; padding: 3px 8px 3px 4px; gap: 4px; }
html.mob .qd-tags .mini img { width: 20px; height: 20px; }
/* v63: dropdown theo theme + nút mũi tên ngày rõ hơn */
.rf .dd-btn, .qf-f > .dd-btn { padding: 8px 14px; gap: 10px; font: inherit; font-size: 17px; font-weight: 700; color: var(--text); background: var(--card); border: 0; }
.rf .dd-btn > img:first-child { width: 26px; height: 26px; flex: none; }
.dn-btn { background: var(--gold); box-shadow: 0 0 0 2px var(--line), inset 0 -3px 0 rgba(0,0,0,.2); }
.dn-btn:hover:not([disabled]) { filter: brightness(1.08); }
.dn-btn img { width: 22px; height: 22px; }
.dn-btn[disabled] { opacity: .35; filter: grayscale(1); }
.qf2 .rf-seg .chip img { width: 22px; height: 22px; }
/* v63: menu ⋯ của nhiệm vụ */
.qm-list { display: flex; flex-direction: column; gap: 10px; padding: 4px 2px; }
.qm-act { min-height: 52px; gap: 12px; padding: 6px 14px; font-size: 17px; }
.qrow .q-more { order: 99; margin-left: 4px; }
.rd-ax { cursor: help; }
/* v63: chi tiết nhiệm vụ dạng pop up */
.qd-dlg .body { max-height: min(70vh, 640px); overflow-y: auto; }
.qd-dlg .detail-hero { margin: 0 0 10px; padding: 10px; gap: 12px; }
.qd-dlg .detail-hero .plate { width: 64px; height: 64px; }
.qd-dlg .big-stats { margin: 0 0 10px; }
.qd-dlg .panel { margin: 0; }
.dialog .actions .btn { white-space: nowrap; }
.rf-icons-pop { grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.rf-icons-pop .rf-ic { height: 52px; }
.rf-icons-pop .rf-ic img { width: 32px; height: 32px; }
.qd-dlg .actions { justify-content: center; gap: 14px; }
.qd-dlg .actions .btn.r-del { flex: 0 0 auto; width: 64px; justify-content: center; }
html.mob .qd-dlg .body { max-height: 62vh; }
/* v63: lưới icon lĩnh vực 4x4 cuộn */
.dom-grid { grid-template-columns: repeat(4, 64px) !important; grid-auto-rows: 64px; justify-content: center; gap: 8px; max-height: calc(64px * 4 + 8px * 3 + 4px); overflow-y: auto; margin-top: 0; }
.dom-ic { padding: 0; justify-content: center; }
.dom-ic img { width: 36px; height: 36px; }
/* v64: lĩnh vực nhanh trên mobile: icon cạnh số, không xuống dòng */
html.mob #psub .bstat, html.mob .big-stats.row1 .bstat { flex-direction: row; text-align: left; justify-content: center; gap: 6px; padding: 8px 6px; }
html.mob #psub .bstat > :first-child, html.mob .big-stats.row1 .bstat > :first-child { width: 24px; height: 24px; flex: none; }
html.mob #psub .bstat > div, html.mob .big-stats.row1 .bstat > div { min-width: 0; }
html.mob #psub .bstat .num, html.mob .big-stats.row1 .bstat .num { font-size: 18px; white-space: nowrap; }
html.mob #psub .bstat small, html.mob .big-stats.row1 .bstat small { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.mob .dialog .big-stats.row1 .bstat { padding: 6px 3px; gap: 4px; } html.mob .dialog .big-stats.row1 .bstat > :first-child { width: 20px; height: 20px; } html.mob .dialog .big-stats.row1 .bstat small { font-size: 10.5px; }
/* v64: tab tùy chỉnh nhân vật */
.cr-tabs { display: flex; gap: 4px; padding: 4px; background: rgba(0,0,0,.14); margin-bottom: 12px; }
.cr-tab { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 4px 6px; border: 0; background: transparent; color: var(--text); font: inherit; font-weight: 800; font-size: 15px; cursor: pointer; white-space: nowrap; }
.cr-tab img { width: 22px; height: 22px; }
.cr-tab:hover { background: rgba(255,255,255,.08); }
.cr-tab.on { background: var(--gold); color: #3a2410; box-shadow: 0 2px 0 rgba(0,0,0,.25); }
.cr-tune .tune-lbl { margin-top: 10px; }
.cr-tabs { width: 100%; max-width: 440px; margin-left: auto; margin-right: auto; box-sizing: border-box; }
/* v64h: nút cài đặt chỉ icon */
.ic-seg .btn { min-width: 56px; min-height: 56px; padding: 4px; }
.ic-seg .btn img { width: 32px; height: 32px; }
html.mob .ic-seg .btn { min-width: 52px; min-height: 52px; }
/* v64h: icon xu thẳng cột */
.qrow .qrw .num { min-width: 2.4ch; text-align: left; }
/* v64i: lịch nhiệm vụ theo tháng */
.qd-calh { gap: 8px; }
.qd-calh .qd-mon { min-width: 84px; text-align: center; font-size: 16px; }
.cal .c.fut { opacity: .35; }
.qd-calh .grow { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.mob .qd-calh .qd-mon { min-width: 72px; font-size: 14px; }
/* v64k: khung thông tin biểu đồ hiện đủ, không bị cắt */
.chart-tip { -webkit-line-clamp: unset; display: block; max-height: none; max-width: 280px; overflow: visible; }

/* v64k: highlight khi hover radar + xu nhỏ trong lịch */
.rd-ax { transition: transform .12s; }
.rd-ax.on { transform: scale(1.3); filter: drop-shadow(0 3px 0 rgba(0,0,0,.35)); z-index: 2; }
.cal .c { flex-direction: column; gap: 0; line-height: 1; }
.cal .c .c-xu { display: flex; align-items: center; gap: 1px; margin-top: 3px; font-size: 10px; opacity: .85; font-family: var(--pixel); }
.cal .c .c-xu img { width: 10px; height: 10px; }
/* v64k: phần thưởng đủ điều kiện không tô nổi, chỉ hiện nút Đổi */
.shop .slot.ready { background: var(--slot); animation: none; }

/* v64l: thông tin cột xu hiện cố định bên dưới biểu đồ */
.ch-info { min-height: 3em; margin-top: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center; font-size: 14px; font-weight: 700; color: var(--muted); line-height: 1.3; }
.ch-info.on { color: var(--text); }
.ch-info b { display: inline-flex; align-items: center; gap: 4px; font-size: 15px; }
.ch-info b img { width: 16px; height: 16px; }
.ch-info span { color: var(--muted); font-size: 13px; }

/* v64m: logo trong game */
.hud-logo, .set-logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-family: var(--pixel); font-weight: 700; font-size: 18px; letter-spacing: 1px; color: #fff; text-shadow: 2px 2px 0 #22192e; }
.hud-logo img, .set-logo img { image-rendering: pixelated; filter: drop-shadow(2px 2px 0 rgba(34, 25, 46, .6)); }
.hud-logo b, .set-logo b { color: var(--gold); font-weight: 700; }
.hud-logo { margin-left: auto; flex: none; }
html.mob .hud-logo { display: none; }
@media (max-width: 1100px) { .hud-logo span { display: none; } }
.set-logo { display: flex; justify-content: center; margin: 22px auto 8px; color: var(--text); text-shadow: none; opacity: .9; }
.set-logo b { color: var(--gold-d); }
.hud-logo { font-size: 22px; gap: 10px; }
.hud-logo img { width: 40px; height: 40px; }
/* v64n: logo căn giữa màn hình */
.hud-logo { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); margin: 0; }
@media (max-width: 1100px) { .hud-logo span { display: none; } }
@media (max-width: 860px) { .hud-logo { display: none; } }
@media (max-width: 1360px) { .hud-logo span { display: none; } }
@media (max-width: 1120px) { .hud-logo { display: none; } }
/* v64o mobile: top bar chứa logo + thanh cấp ngắn lại */
html.mob { --hud-h: 148px; }
html.mob #hud { padding-top: calc(40px + max(var(--safe), env(safe-area-inset-top))); }
html.mob .hud-logo { display: flex; position: absolute; left: 0; right: 0; top: 0; transform: none; height: calc(40px + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); justify-content: center; align-items: center; gap: 8px; font-size: 16px; background: var(--hud, #2a2540); box-shadow: 0 3px 0 var(--line); pointer-events: auto; }
html.mob .hud-logo img { width: 24px; height: 24px; }
html.mob .hud-logo span { display: inline; }
html.mob .hud-who { right: auto; }
html.mob .hud-who .bar { flex: none; width: min(42vw, 180px); }

/* v64s: dòng 'Đã kiếm … xu' nhỏ gọn */
.ltile .sk-earn { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; }
.ltile .sk-earn img { width: 16px; height: 16px; }
.ltile .sk-earn .num { font-size: 13px; }

/* v65a: pháo giấy */
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
/* v65b: trạng thái trống */
.empty-card { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 22px 16px; margin: 6px 4px 12px; }
.empty-card > b { font-size: 19px; font-weight: 800; }
.empty-card > .muted { font-weight: 700; max-width: 440px; line-height: 1.45; }
.empty-card .row { gap: 8px; margin-top: 6px; }
html.desk #psub > .empty-card { grid-area: ins; flex-direction: row; flex-wrap: wrap; justify-content: center; margin: 3px; padding: 8px 14px; gap: 6px 14px; text-align: left; }
html.desk #psub > .empty-card > :first-child { width: 40px; height: 40px; }
html.desk #psub > .empty-card > b { font-size: 16px; }
html.desk #psub > .empty-card > .muted { font-size: 14px; max-width: 520px; }
html.desk #psub > .empty-card .row { margin: 0; }
/* v65c: tài khoản + Pro */
.ac-err { min-height: 1.2em; color: var(--red); font-weight: 800; font-size: 15px; margin: 4px; }
.ac-err:empty { min-height: 0; }
.ac-plan { display: inline-block; padding: 4px 12px; background: var(--slot); font-weight: 800; font-size: 15px; }
.ac-plan.pro { background: var(--gold); color: #3a2410; }
.ac-mail { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-why { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin: 0 4px 10px; background: var(--slot); font-weight: 700; }
.pro-perks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; margin: 4px 4px 12px; font-weight: 800; }
.pro-perks span { display: flex; align-items: center; gap: 8px; }
.pro-plans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 4px 4px 10px; }
.pro-plan { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 8px; font: inherit; color: var(--text); background: var(--card); border: 0; cursor: pointer;
  box-shadow: 0 0 0 4px var(--line); }
.pro-plan b { font-size: 17px; }
.pro-plan .num { font-size: 22px; color: var(--gold-d, #b07a12); }
.pro-plan small { font-weight: 700; color: var(--muted); }
.pro-plan.on { background: #fff4c7; box-shadow: 0 0 0 4px var(--line), inset 0 0 0 4px var(--gold); }
.pro-qr { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; justify-content: center; margin: 4px; }
.pro-qr .qr { width: 220px; height: 220px; padding: 10px; background: #fff; box-shadow: 0 0 0 4px var(--line); }
.pro-qr .qr svg { width: 100%; height: 100%; display: block; }
.pro-qr .qr-info { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 6px; font-weight: 700; }
.pro-qr .qr-info > div { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pro-qr .qr-info span { min-width: 100px; color: var(--muted); }
.pro-qr .qr-info .btn.sm { min-height: 32px; padding: 2px 10px; font-size: 13px; }
.pro-wait { display: flex; align-items: flex-start; gap: 10px; margin: 12px 4px 8px; padding: 10px 12px; background: var(--slot); font-weight: 700; }
html.mob .pro-perks { grid-template-columns: 1fr; }
/* v65e: 4 tab tạo nhân vật (thêm Phụ kiện) */
.cr-tabs { gap: 2px; }
.cr-tab { flex: 1 1 auto; min-width: 0; padding: 4px; gap: 4px; font-size: 14px; }
.cr-tab img { width: 18px; height: 18px; }

/* v65h: mưa xu cute + số nhảy */
.fly-coin { position: fixed; left: 0; top: 0; width: 32px; height: 32px; pointer-events: none; will-change: transform; filter: drop-shadow(0 2px 0 rgba(34,25,46,.5)); z-index: 2; }
.fly-coin > * { width: 32px; height: 32px; display: block; }
@keyframes numPop { 0% { transform: scale(1); } 30% { transform: scale(1.45) translateY(-3px); color: #ffe066; } 100% { transform: scale(1); } }
.num-pop { display: inline-block; animation: numPop .32s ease-out; }

/* v65i: phụ kiện khóa, rương bất ngờ, bong bóng thoại */
.hair-t.locked img { filter: grayscale(1) brightness(.75); opacity: .6; }
.hair-t .lock-b { position: absolute; right: -4px; bottom: -4px; min-width: 22px; padding: 0 3px; font: 800 12px/18px inherit; color: #fff; background: #3a2f55; border: 2px solid var(--line); }
.hair-t.locked .lock-b { background: #6b5a92; }
.acc-note { display: flex; align-items: center; gap: 6px; margin: 8px 4px 0; font-size: 14px; opacity: .85; }
.acc-note svg, .acc-note img { width: 20px; height: 20px; }
.chest-shake { animation: chestShake .9s steps(6) both; }
@keyframes chestShake { 0%,100% { transform: none; } 15% { transform: rotate(-8deg); } 30% { transform: rotate(8deg); } 45% { transform: rotate(-10deg) scale(1.05); } 60% { transform: rotate(10deg) scale(1.08); } 80% { transform: scale(1.15); } }
.chest-loot { animation: lootIn .35s ease-out both; }
@keyframes lootIn { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.chest-loot .jackpot .big-num { color: #f08c00; text-shadow: 0 3px 0 #7a3d00, 0 0 14px rgba(255,190,40,.7); }
.jp-tag { display: inline-block; margin: 2px auto 6px; padding: 2px 10px; font-weight: 900; color: #3a2400; background: var(--gold); border: 3px solid var(--line); animation: numPop .5s ease-out 2; }
.loot-item { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 8px auto; padding: 8px 14px; background: rgba(160,120,255,.18); border: 3px solid var(--line); }
.loot-item img { image-rendering: pixelated; background: rgba(255,255,255,.5); }
.loot-lbl { display: flex; align-items: center; gap: 4px; font-weight: 800; color: #7a4cff; }
.unl-lbl { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 10px; font-weight: 800; }
.unl-chip { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 10px; background: var(--slot); border: 3px solid var(--line); font-size: 14px; }
.unl-chip img { image-rendering: pixelated; }
.true-self { margin-top: 8px; font-size: 15px; font-style: italic; opacity: .85; }
.speech { position: absolute; z-index: 6; max-width: min(300px, 80%); padding: 8px 12px; font-weight: 700; font-size: 16px; line-height: 1.35; color: #2a2140; background: #fffdf4; border: 3px solid var(--line); box-shadow: 0 4px 0 rgba(0,0,0,.22); pointer-events: none; opacity: 0; transform: translateY(6px) scale(.96); transition: opacity .18s, transform .18s; }
.speech.show { opacity: 1; transform: none; }
.speech::after { content: ''; position: absolute; left: var(--tail, 50%); bottom: -11px; width: 12px; height: 12px; margin-left: -6px; background: #fffdf4; border-right: 3px solid var(--line); border-bottom: 3px solid var(--line); transform: rotate(45deg); }

/* v65o: thanh XP phát sáng khi tăng */
.bar.xp-glow { animation: xpGlow 1.6s ease-out; }
.bar.xp-glow > i { animation: xpBright 1.6s ease-out; }
.bar.xp-glow > i::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.75), transparent); background-size: 40% 100%; background-repeat: no-repeat; animation: xpShine 1s ease-out .1s both; }
@keyframes xpGlow { 0% { box-shadow: 0 -3px 0 0 var(--line), 0 3px 0 0 var(--line), -3px 0 0 0 var(--line), 3px 0 0 0 var(--line), 0 0 0 0 rgba(150,120,255,0); }
  25%, 60% { box-shadow: 0 -3px 0 0 var(--line), 0 3px 0 0 var(--line), -3px 0 0 0 var(--line), 3px 0 0 0 var(--line), 0 0 12px 4px rgba(150,120,255,.85); }
  42% { box-shadow: 0 -3px 0 0 var(--line), 0 3px 0 0 var(--line), -3px 0 0 0 var(--line), 3px 0 0 0 var(--line), 0 0 6px 2px rgba(150,120,255,.5); }
  100% { box-shadow: 0 -3px 0 0 var(--line), 0 3px 0 0 var(--line), -3px 0 0 0 var(--line), 3px 0 0 0 var(--line), 0 0 0 0 rgba(150,120,255,0); } }
@keyframes xpBright { 0%, 100% { filter: none; } 25%, 60% { filter: brightness(1.35) saturate(1.2); } 42% { filter: brightness(1.1); } }
@keyframes xpShine { from { background-position: -40% 0; } to { background-position: 140% 0; } }
#avatar:focus:not(:focus-visible) { outline: none; }

/* v65p: mini game né cám dỗ */
.g-layer { position: absolute; inset: 0; z-index: 7; pointer-events: none; overflow: hidden; }
.g-score { position: absolute; transform: translateX(-50%); padding: 3px 12px; font-size: 18px; color: #fff; background: rgba(28,22,44,.78); border: 3px solid var(--line); white-space: nowrap; }
.g-score b { color: var(--gold); }
.g-hint { position: absolute; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 14px; color: #2a2140; background: #fffdf4; border: 3px solid var(--line); box-shadow: 0 4px 0 rgba(0,0,0,.25); white-space: nowrap; animation: gHint 2.6s ease-out forwards; }
.g-hint b { font-size: 20px; color: #e0463c; }
@keyframes gHint { 0% { opacity: 0; transform: translateX(-50%) scale(.6); } 10%, 75% { opacity: 1; transform: translateX(-50%) scale(1); } 100% { opacity: 0; transform: translateX(-50%) translateY(-10px); } }
.g-ob { position: absolute; left: 0; top: 0; will-change: transform; font-weight: 800; font-size: 15px; line-height: 1.15; }
.g-rock { width: 42px; height: 36px; color: #fff; font-size: 13px;
  filter: drop-shadow(0 3px 0 var(--line)) drop-shadow(0 -3px 0 var(--line)) drop-shadow(3px 0 0 var(--line)) drop-shadow(-3px 0 0 var(--line)) drop-shadow(0 5px 0 rgba(0,0,0,.25)); }
.g-rock > i { position: absolute; inset: 0; background: linear-gradient(160deg, #a097b3, #776d8c 55%, #5a516e);
  clip-path: polygon(22% 0, 70% 0, 70% 6%, 86% 6%, 86% 16%, 100% 16%, 100% 70%, 92% 70%, 92% 88%, 74% 88%, 74% 100%, 18% 100%, 18% 92%, 4% 92%, 4% 74%, 0 74%, 0 26%, 8% 26%, 8% 10%, 22% 10%); }
.g-rock.r2 > i { clip-path: polygon(14% 0, 82% 0, 82% 10%, 96% 10%, 96% 34%, 100% 34%, 100% 80%, 88% 80%, 88% 100%, 26% 100%, 26% 90%, 6% 90%, 6% 64%, 0 64%, 0 18%, 14% 18%); }
.g-rock.r3 > i { clip-path: polygon(30% 0, 78% 0, 78% 8%, 92% 8%, 92% 24%, 100% 24%, 100% 62%, 96% 62%, 96% 86%, 80% 86%, 80% 100%, 12% 100%, 12% 86%, 0 86%, 0 36%, 6% 36%, 6% 14%, 30% 14%); }
.g-rock > i::after { content: ''; position: absolute; left: 58%; top: 56%; width: 6px; height: 3px; background: rgba(30,20,45,.4); box-shadow: -12px 5px 0 rgba(30,20,45,.3), -14px -12px 0 rgba(255,255,255,.4), -10px -12px 0 rgba(255,255,255,.4), -16px -9px 0 rgba(255,255,255,.3); }
.g-rock > span { position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); white-space: nowrap; font-weight: 800; color: #fff; text-shadow: -2px 0 0 #22192e, 2px 0 0 #22192e, 0 -2px 0 #22192e, 0 2px 0 #22192e, 2px 2px 0 #22192e; filter: none; }
.g-left { margin-top: 6px; font-weight: 700; }
.g-rock.crash { animation: gCrash .26s ease-out forwards; }
@keyframes gCrash { to { opacity: 0; filter: brightness(1.4); scale: 1.25 .5; } }
.g-arrow { width: 104px; height: 14px; margin-top: 8px; background: var(--ac, #d9473f); box-shadow: 0 -3px 0 0 var(--line), 0 3px 0 0 var(--line), inset 0 3px 0 rgba(255,255,255,.35); }
.g-arrow::before { content: ''; position: absolute; left: -30px; top: -14px; border: 21px solid transparent; border-right: 30px solid var(--line); border-left: 0; }
.g-arrow::after { content: ''; position: absolute; left: -22px; top: -9px; border: 16px solid transparent; border-right: 23px solid var(--ac, #d9473f); border-left: 0; }
.g-arrow > b { position: absolute; right: -6px; top: -12px; width: 22px; height: 38px; background: linear-gradient(90deg, #fff 0 33%, var(--ac) 33% 66%, #fff 66%); box-shadow: 0 0 0 3px var(--line); clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
.g-arrow > .g-lbl { position: absolute; left: -14px; bottom: calc(100% + 14px); display: flex; align-items: center; gap: 5px; padding: 3px 9px 3px 4px; font-size: 16px; color: #fff; white-space: nowrap; background: var(--ac); text-shadow: 0 2px 0 rgba(0,0,0,.4); box-shadow: 0 -3px 0 0 var(--line), 0 3px 0 0 var(--line), -3px 0 0 0 var(--line), 3px 0 0 0 var(--line); }
.g-arrow > .g-lbl > svg, .g-arrow > .g-lbl > img { width: 24px; height: 24px; flex: none; background: rgba(255,255,255,.9); padding: 1px; }
.g-ob.hit { animation: gHit .4s steps(4) 2; }
@keyframes gHit { 50% { filter: brightness(2); } }
.g-stars { position: absolute; width: 0; height: 0; }
.g-stars i { position: absolute; left: -14px; top: -14px; width: 28px; height: 28px; animation: gOrbit 1s linear infinite; animation-delay: calc(var(--i) * -.333s); }
.g-stars i > * { width: 28px; height: 28px; display: block; }
@keyframes gOrbit { 0% { transform: translate(-46px, 0) scale(.8); } 25% { transform: translate(0, -12px) scale(.6); } 50% { transform: translate(46px, 0) scale(.8); } 75% { transform: translate(0, 12px) scale(1.1); } 100% { transform: translate(-46px, 0) scale(.8); } }
.g-shake { animation: gShake .5s steps(6); }
@keyframes gShake { 0%, 100% { translate: 0 0; } 20% { translate: -8px 0; } 40% { translate: 8px 0; } 60% { translate: -6px 0; } 80% { translate: 5px 0; } }
.g-pop-ob { display: inline-block; margin: 6px auto 10px; padding: 10px 16px; font-weight: 800; color: #fff; background: #6c6280; border: 4px solid var(--line); transform: rotate(-4deg); }
body.game-on #page-hero { touch-action: none; overscroll-behavior: none; }
body.game-on #page-hero .hero-stage { user-select: none; -webkit-user-select: none; }
.g-score, .g-hint { z-index: 2; }
.g-ob { z-index: 1; }
.g-pop-ic { display: flex; justify-content: center; margin: 2px auto 0; }
.g-pop-ic > svg, .g-pop-ic > img { width: 96px; height: 96px; animation: gWobble 1.2s ease-in-out infinite; }
@keyframes gWobble { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg) scale(1.05); } }

/* v65u: rương đồ desktop */
.hero-inv { display: none; }
html.desk .hero-inv { display: block; grid-column: 3; grid-row: 1; align-self: center; justify-self: start; width: 100%; max-width: 330px; position: relative; z-index: 5; }
.inv-panel { padding: 10px 12px 12px; --panel: rgba(255,244,226,.94); --panel-l: #fffdf6; --panel-d: #e6cfa8; background: var(--panel); color: var(--ink, #2a2238); transform-origin: right center; animation: invIn .28s ease-out; }
@keyframes invIn { from { transform: scale(.6) translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.inv-head { display: flex; align-items: center; gap: 8px; font-size: 18px; margin-bottom: 4px; }
.inv-head > svg, .inv-head > img { width: 32px; height: 32px; }
.inv-head b { flex: 1; }
.inv-x { width: 34px; height: 34px; min-height: 0; padding: 0; }
.inv-sec { display: flex; align-items: center; gap: 6px; margin: 8px 2px 6px; font-weight: 800; font-size: 14px; }
.inv-sec span:not(.num) { flex: 1; }
.inv-sec .num { opacity: .7; }
.inv-sec svg, .inv-sec img { width: 22px; height: 22px; }
.inv-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.inv-slot { aspect-ratio: 1; min-width: 0; min-height: 0; padding: 3px; display: flex; align-items: center; justify-content: center; position: relative; cursor: pointer;
  background: #e9d6b4; box-shadow: inset 0 0 0 3px #c9ad82, inset 3px 3px 0 3px rgba(0,0,0,.08); border: 0; }
.inv-slot.empty { cursor: default; opacity: .55; }
.inv-slot img, .inv-slot svg { width: 100%; height: 100%; image-rendering: pixelated; }
.inv-slot.rw svg, .inv-slot.rw img { width: 70%; height: 70%; }
.inv-slot:not(.empty):hover { background: #fff3cf; box-shadow: inset 0 0 0 3px var(--gold); transform: translateY(-1px); }
.inv-slot.on { background: #fff3cf; box-shadow: inset 0 0 0 3px var(--gold-d, #d9a520), 0 0 0 2px var(--gold); }
.inv-slot.on::after { content: ''; position: absolute; right: -5px; top: -5px; width: 14px; height: 14px; background: var(--gold) var(--check) center / 12px no-repeat; box-shadow: 0 0 0 2px var(--line); }
.inv-slot.rare { background: #eadcff; box-shadow: inset 0 0 0 3px #a07be0; }
.inv-fab { display: none; width: 72px; height: 72px; padding: 0; border: 0; background: none; cursor: pointer; position: relative; filter: drop-shadow(0 4px 0 rgba(0,0,0,.3)); animation: fabBob 2.4s ease-in-out infinite; }
.inv-fab svg, .inv-fab img { width: 64px; height: 64px; }
.inv-fab .num { position: absolute; right: 0; top: 2px; min-width: 22px; padding: 0 4px; font-size: 14px; line-height: 20px; color: #fff; background: #e0463c; box-shadow: 0 0 0 2px var(--line); }
.inv-fab:hover { animation-play-state: paused; scale: 1.08; }
@keyframes fabBob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }
.hero-inv.closed .inv-panel, body.game-on .hero-inv .inv-panel { display: none; }
.hero-inv.closed .inv-fab, body.game-on .hero-inv .inv-fab { display: block; }
html.desk .hero-inv.closed, body.game-on .hero-inv { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); width: auto; max-width: none; }

/* v65v: desktop không có thanh điều hướng dưới */
html.desk { --nav-h: 0px; }
html.desk #nav { position: static; height: 0; padding: 0; }
html.desk #nav .navbar { display: none; }
html.desk #page-hero { display: block; }
.quest-fab { position: fixed; right: 24px; top: calc(var(--hud-h) + 10px); z-index: 25; display: flex; align-items: center; gap: 8px; padding: 8px 16px 8px 10px; min-height: 0; font-size: 18px; font-weight: 800; pointer-events: auto; animation: fabBob 2.6s ease-in-out infinite; }
.quest-fab > svg, .quest-fab > img { width: 40px; height: 40px; }
.quest-fab .count { position: absolute; right: -8px; top: -8px; }
.quest-fab.on { background: var(--gold); }
.page-close { position: fixed; z-index: 45; top: calc(var(--hud-h) + 4px); right: calc(50% - min(520px, 46vw) - 22px); pointer-events: auto; }
body.desk-modal #pages { z-index: 40; }
html.desk .page.active:not(#page-hero) { position: fixed; top: calc(var(--hud-h) + 24px); bottom: 24px; left: 50%; width: min(1040px, 92vw); margin-left: calc(min(1040px, 92vw) / -2); z-index: 41;
  background: var(--card, #fff6e6); box-shadow: 0 0 0 4px var(--line), 0 8px 0 4px rgba(0,0,0,.3), 0 0 0 100vmax rgba(18,12,30,.55); padding: 16px 20px 24px; animation: pop .22s steps(5); }
html.desk .page.active:not(#page-hero).enter-r, html.desk .page.active:not(#page-hero).enter-l { animation: pop .22s steps(5); }
body.desk-modal .quest-fab:not(.on) { visibility: hidden; }
body.desk-modal .quest-fab.on { z-index: 46; }
.hud-prog { display: flex; align-items: center; gap: 6px; width: auto !important; padding: 0 12px !important; font-weight: 800; font-size: 16px; margin-right: 8px; }
.hud-prog > svg, .hud-prog > img { width: 28px; height: 28px; }
.hud-prog.on { background: var(--gold); color: #3a2410; }
.inv-shop { width: 100%; margin-top: 10px; justify-content: center; position: relative; }
.inv-shop .count { position: absolute; right: -6px; top: -8px; }
.inv-fab .lbl { position: absolute; left: 50%; bottom: -16px; transform: translateX(-50%); font-size: 12px; font-weight: 800; white-space: nowrap; color: #fff; text-shadow: -2px 0 0 var(--line), 2px 0 0 var(--line), 0 -2px 0 var(--line), 0 2px 0 var(--line); }
html.desk #toast-root { bottom: 24px; }
/* rương nổi: góc phải dưới */
html.desk .hero-inv.closed, body.game-on .hero-inv { position: fixed !important; right: 28px; top: auto !important; bottom: 34px; transform: none !important; z-index: 24; }
.inv-slot img { padding: 4px; }
body.desk-modal #avatar, body.desk-modal #name-tag, body.desk-modal #speech { visibility: hidden !important; }
.quest-fab { padding-right: 22px; }

/* v65w: đồng hồ chờ lượt game */
.dodge-timer { position: absolute; left: 20px; bottom: calc(var(--nav-h) + 14px); z-index: 24; display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border: 0; cursor: pointer; color: #fff;
  background: rgba(28,22,44,.82); box-shadow: 0 -3px 0 0 var(--line), 0 3px 0 0 var(--line), -3px 0 0 0 var(--line), 3px 0 0 0 var(--line), 0 6px 0 rgba(0,0,0,.25); }
.dodge-timer[hidden] { display: none; }
.dodge-timer > svg, .dodge-timer > img { width: 30px; height: 30px; animation: gWobble 2s ease-in-out infinite; }
.dodge-timer .dt-txt { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; }
.dodge-timer small { font-size: 12px; font-weight: 700; opacity: .8; }
.dodge-timer b { font-size: 20px; color: var(--gold); }
.dodge-timer:hover { background: rgba(48,38,74,.9); }
html.desk .dodge-timer { left: 28px; bottom: 34px; }
body.desk-modal .dodge-timer { display: none; }

/* v66: rương gỗ */
.inv-panel.wood { position: relative; padding: 12px 14px 14px; color: #fff4dc; border: 0;
  background: repeating-linear-gradient(180deg, #9c6234 0 26px, #8b552c 26px 28px, #a86a39 28px 54px, #7d4b26 54px 56px);
  box-shadow: 0 0 0 4px #3b200e, inset 0 0 0 4px #c48a52, inset 0 0 0 7px #5a3315, 0 10px 0 4px rgba(0,0,0,.35); }
.inv-panel.wood::before, .inv-panel.wood::after { content: ''; position: absolute; top: 8px; width: 8px; height: 8px; background: #d8c08a; box-shadow: 0 0 0 2px #3b200e, 0 calc(100% + 0px) 0 0 transparent; }
.inv-panel.wood::before { left: 8px; } .inv-panel.wood::after { right: 8px; }
.wood .inv-head { gap: 8px; margin: 0 0 8px; }
.wood .inv-sign { flex: 1; display: flex; align-items: center; gap: 8px; padding: 4px 10px; font-size: 18px; color: #3b200e; background: #e8c48a; box-shadow: 0 0 0 3px #3b200e, inset 0 -4px 0 #c79a5e; }
.wood .inv-sign svg, .wood .inv-sign img { width: 28px; height: 28px; }
.wood .inv-cnt { font-size: 14px; color: #ffe8b0; text-shadow: 0 2px 0 #3b200e; }
.inv-x { width: 34px; height: 34px; padding: 4px; border: 0; cursor: pointer; background: #d9473f; box-shadow: 0 0 0 3px #3b200e, inset 0 -4px 0 #a52f29, inset 0 3px 0 #f07a72; }
.inv-x svg, .inv-x img { width: 100%; height: 100%; filter: brightness(0) invert(1); }
.inv-x:hover { background: #ef5a50; }
.inv-tabs { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; margin-bottom: 8px; }
.inv-tab { position: relative; height: 34px; padding: 4px; border: 0; cursor: pointer; background: #6b3f1e; box-shadow: 0 0 0 2px #3b200e, inset 0 -3px 0 #4f2d13; }
.inv-tab svg, .inv-tab img { width: 100%; height: 100%; }
.inv-tab.on { background: #f2cf7a; box-shadow: 0 0 0 2px #3b200e, inset 0 -3px 0 #c89b3c; transform: translateY(-2px); }
.inv-tab:hover:not(.on) { background: #84502a; }
.inv-tab .count { position: absolute; right: -6px; top: -8px; transform: scale(.8); }
.wood .inv-sec { margin: 2px 2px 6px; color: #ffe8b0; text-shadow: 0 2px 0 #3b200e; }
.wood .inv-sec span:first-child { flex: 1; }
.wood .inv-grid { gap: 7px; }
.wood .inv-slot { background: #4e2d14; box-shadow: inset 0 0 0 3px #36200d, inset 3px 3px 0 3px rgba(0,0,0,.35), 0 2px 0 #b07a46; }
.wood .inv-slot.empty { opacity: .75; }
.wood .inv-slot > img, .wood .inv-slot > svg { filter: drop-shadow(0 3px 0 rgba(0,0,0,.55)) drop-shadow(2px 0 0 rgba(0,0,0,.25)); }
.wood .inv-slot:not(.empty):hover { background: #6c4120; box-shadow: inset 0 0 0 3px #f2cf7a, 0 2px 0 #b07a46; transform: translateY(-2px); }
.wood .inv-slot.on { background: #7a5326; box-shadow: inset 0 0 0 3px #f2cf7a, 0 0 0 2px #ffd54a; }
.wood .inv-slot.rare { background: #4b2f6b; box-shadow: inset 0 0 0 3px #a07be0, 0 2px 0 #b07a46; }
.wood .inv-slot.ready { box-shadow: inset 0 0 0 3px #7ee07a, 0 0 8px 2px rgba(126,224,122,.6); }
.inv-slot .wbar { position: absolute; left: 6px; right: 6px; bottom: 5px; height: 5px; background: rgba(0,0,0,.5); }
.inv-slot .wbar > i { position: absolute; left: 0; top: 0; bottom: 0; background: #ffd54a; }
.inv-slot.ready .wbar > i { background: #7ee07a; }
.inv-empty { margin: -60px 0 30px; text-align: center; font-weight: 700; color: #ffe8b0; text-shadow: 0 2px 0 #3b200e; pointer-events: none; position: relative; }
.inv-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 8px; color: #ffe8b0; text-shadow: 0 2px 0 #3b200e; }
.inv-pg { width: 34px; height: 30px; padding: 3px; border: 0; cursor: pointer; background: #e8c48a; box-shadow: 0 0 0 3px #3b200e, inset 0 -4px 0 #c79a5e; }
.inv-pg svg, .inv-pg img { width: 100%; height: 100%; }
.inv-pg:disabled { opacity: .35; cursor: default; }
.wood .inv-shop { margin-top: 10px; }
html.desk .hero-inv { max-width: 360px; }
/* nút Nhiệm vụ nổi bật */
.quest-fab { background: linear-gradient(#ffe27a, #ffc93a); color: #3a2410; font-size: 20px; padding: 10px 24px 10px 12px; box-shadow: 0 0 0 4px var(--line), inset 0 -5px 0 #d99a1e, inset 0 4px 0 #fff3b8, 0 6px 0 4px rgba(0,0,0,.3); animation: fabBob 2.6s ease-in-out infinite, qGlow 1.8s ease-in-out infinite; }
.quest-fab > svg, .quest-fab > img { width: 48px; height: 48px; }
.quest-fab .count { transform: scale(1.15); }
@keyframes qGlow { 0%, 100% { filter: drop-shadow(0 0 0 rgba(255,213,74,0)); } 50% { filter: drop-shadow(0 0 12px rgba(255,213,74,.95)); } }
.quest-fab:hover { scale: 1.05; }

/* rương nổi */
html.desk .hero-inv.closed, body.game-on .hero-inv { right: 56px !important; bottom: 64px !important; }
.inv-fab { width: 88px; height: 88px; animation: invFloat 2.8s ease-in-out infinite !important; filter: drop-shadow(0 6px 0 rgba(0,0,0,.28)); }
.inv-fab svg, .inv-fab img { width: 80px; height: 80px; }
.inv-fab::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: -14px; height: 8px; background: rgba(0,0,0,.28); animation: invShadow 2.8s ease-in-out infinite; }
@keyframes invFloat { 0%, 100% { translate: 0 0; rotate: -2deg; } 50% { translate: 0 -12px; rotate: 2deg; } }
@keyframes invShadow { 0%, 100% { transform: scaleX(1); opacity: .9; } 50% { transform: scaleX(.7); opacity: .5; } }
/* nút nhiệm vụ: pulse */
.quest-fab { animation: qPulse 1.6s ease-in-out infinite, qGlow 1.6s ease-in-out infinite !important; }
@keyframes qPulse { 0%, 100% { scale: 1; } 50% { scale: 1.07; } }
.quest-fab .count.ok { background: var(--green); }
/* modal nhiệm vụ: trang giấy cổ */
html.desk #page-quests.page.active:not(#page-hero) { --card: #fbf0d4; --card-d: #e2cc9c; --slot: #ecd9ae; --slot-d: #cfb582; --text: #3b2614; --muted: #7a5a3a; --panel: #f6e6c0; --panel-l: #fff6de; --panel-d: #d9bf8a; color: #3b2614;
  background: radial-gradient(ellipse at 50% 40%, #f7e7bf 0 55%, #ecd39d 80%, #d9b878 100%), #f1dcae;
  box-shadow: inset 0 0 40px rgba(120,80,30,.35), inset 0 0 0 3px #b8925a, 0 0 0 4px #5a3a1a, 0 8px 0 4px rgba(0,0,0,.3), 0 0 0 100vmax rgba(18,12,30,.55); }
html.desk #page-quests.active::before { content: ''; position: sticky; display: block; top: -16px; height: 0; }
html.desk #page-quests.active .qrow { background: #fdf5df; color: #3b2614; }
html.desk #page-quests.active .qrow.done { background: #e9f2cf; }
html.desk #page-quests.active .qg-head, html.desk #page-quests.active .qg-head * { color: #4a2f16 !important; }
html.desk #page-quests.active .q-date, html.desk #page-quests.active .q-date * { color: #3b2614; }

/* v66b: Tiến độ gọn, nền pattern; nút Tiến độ chỉ icon */
.hud-prog { padding: 0 !important; width: 44px !important; justify-content: center; margin-right: 8px; }
html.desk #page-progress.page.active:not(#page-hero) { bottom: auto; max-height: calc(100vh - var(--hud-h) - 48px); overflow: auto; width: min(1040px, 92vw); margin-left: calc(min(1040px, 92vw) / -2); padding: 18px 20px 20px;
  background:
    radial-gradient(circle, rgba(255,226,140,.18) 0 1.5px, transparent 2px) 12px 12px / 48px 48px,
    radial-gradient(circle, rgba(255,255,255,.07) 0 1px, transparent 1.5px) 36px 36px / 48px 48px,
    repeating-conic-gradient(from 45deg, #3b3170 0 25%, #352b65 0 50%) 0 0 / 24px 24px,
    #383068;
  box-shadow: inset 0 0 0 3px #5a4fa0, inset 0 0 60px rgba(10,6,30,.45), 0 0 0 4px var(--line), 0 8px 0 4px rgba(0,0,0,.3), 0 0 0 100vmax rgba(18,12,30,.55); }
html.desk #page-progress.active .page-inner { margin: 0 auto; }
html.desk #page-progress #psub .pair2 > .panel:first-child { overflow: visible; }
html.desk #page-progress #psub .panel .legend { gap: 4px 6px; }
.inv-tabs { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 3px; padding: 0 2px; }
.inv-tab { min-width: 0; }
.inv-tab .count { right: -4px; top: -10px; transform: scale(.65); transform-origin: top right; }
.wood .inv-head { justify-content: space-between; }
/* v66c: rương phóng to khi mở, thu về nút khi đóng; nút nhiệm vụ hết pulse khi xong */
.hero-inv .inv-panel { animation: none; }
.hero-inv.inv-opening .inv-panel { transform-origin: var(--ox, 100%) var(--oy, 100%); animation: invOpen .46s cubic-bezier(.2, 1.25, .4, 1) both; }
.hero-inv.inv-closing .inv-panel { transform-origin: var(--ox, 100%) var(--oy, 100%); animation: invClose .3s cubic-bezier(.55, 0, .85, .35) forwards; pointer-events: none; }
@keyframes invOpen { 0% { transform: scale(.06) rotate(-6deg); opacity: 0; } 35% { opacity: 1; } 100% { transform: none; opacity: 1; } }
@keyframes invClose { 0% { transform: none; opacity: 1; } 100% { transform: scale(.06) rotate(6deg); opacity: 0; } }
.hero-inv.inv-fabin .inv-fab { animation: invFabIn .42s cubic-bezier(.2, 1.6, .4, 1) !important; }
@keyframes invFabIn { 0% { scale: .2; rotate: -20deg; } 100% { scale: 1; rotate: 0deg; } }
.quest-fab.done { animation: none !important; filter: none; }
/* v66d: nền Tiến độ dịu hơn: tím trơn + sao pixel thưa */
html.desk #page-progress.page.active:not(#page-hero) {
  background:
    linear-gradient(rgba(255,230,160,.22), rgba(255,230,160,.22)) 20px 26px / 2px 2px no-repeat,
    radial-gradient(circle, rgba(255,240,200,.16) 0 1px, transparent 1.5px) 0 0 / 72px 72px,
    radial-gradient(circle, rgba(255,255,255,.08) 0 1px, transparent 1.5px) 36px 36px / 72px 72px,
    linear-gradient(180deg, #3a3170, #312862);
}

/* v66e: Nhiệm vụ = trang giấy cổ nhỏ gọn, mép rách, texture giấy, bỏ nút X */
html.desk #page-quests.page.active:not(#page-hero) { top: calc(var(--hud-h) + 30px); bottom: auto; max-height: calc(100vh - var(--hud-h) - 60px); overflow: auto;
  width: min(960px, 88vw); margin-left: calc(min(960px, 88vw) / -2); padding: 24px 26px 28px;
  --card: #ead6a8; --qrow: #f3e6c4;
  background:
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .35 0 0 0 0 .22 0 0 0 0 .08 0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='.55'/></svg>"),
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='600' height='600'><filter id='m'><feTurbulence type='fractalNoise' baseFrequency='.012' numOctaves='2' seed='7'/><feColorMatrix values='0 0 0 0 .45 0 0 0 0 .28 0 0 0 0 .1 0 0 0 .9 -.32'/></filter><rect width='100%' height='100%' filter='url(%23m)'/></svg>"),
    radial-gradient(ellipse at 50% 45%, rgba(255,246,214,.55) 0 35%, transparent 75%),
    radial-gradient(ellipse at 50% 50%, transparent 55%, rgba(120,72,24,.45) 100%),
    #e2c994;
  box-shadow: none; clip-path: polygon(0.0% 4px, 3.8% 5px, 7.7% 6px, 11.5% 7px, 15.4% 5px, 19.2% 6px, 23.1% 0px, 26.9% 3px, 30.8% 7px, 34.6% 5px, 38.5% 6px, 42.3% 1px, 46.2% 3px, 50.0% 2px, 53.8% 4px, 57.7% 4px, 61.5% 0px, 65.4% 2px, 69.2% 2px, 73.1% 6px, 76.9% 5px, 80.8% 1px, 84.6% 6px, 88.5% 1px, 92.3% 4px, 96.2% 1px, 100.0% 0px, calc(100% - 6px) 0.0%, calc(100% - 1px) 5.6%, calc(100% - 2px) 11.1%, calc(100% - 7px) 16.7%, calc(100% - 6px) 22.2%, calc(100% - 2px) 27.8%, calc(100% - 7px) 33.3%, calc(100% - 4px) 38.9%, calc(100% - 5px) 44.4%, calc(100% - 1px) 50.0%, calc(100% - 7px) 55.6%, calc(100% - 5px) 61.1%, calc(100% - 7px) 66.7%, calc(100% - 6px) 72.2%, calc(100% - 2px) 77.8%, calc(100% - 3px) 83.3%, calc(100% - 1px) 88.9%, calc(100% - 1px) 94.4%, calc(100% - 0px) 100.0%, 100.0% calc(100% - 2px), 96.2% calc(100% - 5px), 92.3% calc(100% - 0px), 88.5% calc(100% - 5px), 84.6% calc(100% - 3px), 80.8% calc(100% - 2px), 76.9% calc(100% - 7px), 73.1% calc(100% - 4px), 69.2% calc(100% - 3px), 65.4% calc(100% - 4px), 61.5% calc(100% - 6px), 57.7% calc(100% - 0px), 53.8% calc(100% - 8px), 50.0% calc(100% - 0px), 46.2% calc(100% - 6px), 42.3% calc(100% - 7px), 38.5% calc(100% - 0px), 34.6% calc(100% - 6px), 30.8% calc(100% - 3px), 26.9% calc(100% - 5px), 23.1% calc(100% - 0px), 19.2% calc(100% - 0px), 15.4% calc(100% - 1px), 11.5% calc(100% - 8px), 7.7% calc(100% - 2px), 3.8% calc(100% - 6px), 0.0% calc(100% - 7px), 7px 100.0%, 2px 94.4%, 2px 88.9%, 4px 83.3%, 5px 77.8%, 1px 72.2%, 5px 66.7%, 6px 61.1%, 6px 55.6%, 0px 50.0%, 7px 44.4%, 1px 38.9%, 2px 33.3%, 4px 27.8%, 6px 22.2%, 2px 16.7%, 6px 11.1%, 4px 5.6%, 2px 0.0%); }
#pages:has(#page-quests.active)::before { content: ''; position: fixed; inset: 0; z-index: 40; background: rgba(18,12,30,.6); pointer-events: none; }
html.desk #page-quests.active .qrow { background: rgba(255,248,226,.72); }
html.desk #page-quests.active .qrow.done { background: rgba(226,236,196,.8); }
html.desk #page-quests .qlist { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }

/* v66f: Nhiệm vụ = cuộn giấy pixel có 2 trục gỗ, mở ra kiểu cuộn */
html.desk #page-quests.page.active:not(#page-hero) { clip-path: none; padding: 50px 50px 54px; width: min(1000px, 90vw); margin-left: calc(min(1000px, 90vw) / -2);
  max-height: calc(100vh - var(--hud-h) - 50px); box-shadow: none; filter: drop-shadow(0 8px 0 rgba(0,0,0,.35));
  background:
    linear-gradient(180deg, #2e1808 0 3px, #9a6a1a 3px 7px, #e8b84a 7px 13px, #ffe08a 13px 16px, #d6a03a 16px 25px, #9a6a1a 25px 31px, #2e1808 31px 34px) left 0 top 0 / 16px 34px no-repeat,
    linear-gradient(180deg, #2e1808 0 3px, #9a6a1a 3px 7px, #e8b84a 7px 13px, #ffe08a 13px 16px, #d6a03a 16px 25px, #9a6a1a 25px 31px, #2e1808 31px 34px) right 0 top 0 / 16px 34px no-repeat,
    linear-gradient(180deg, #2e1808 0 3px, #9a6a1a 3px 7px, #e8b84a 7px 13px, #ffe08a 13px 16px, #d6a03a 16px 25px, #9a6a1a 25px 31px, #2e1808 31px 34px) left 0 bottom 0 / 16px 34px no-repeat,
    linear-gradient(180deg, #2e1808 0 3px, #9a6a1a 3px 7px, #e8b84a 7px 13px, #ffe08a 13px 16px, #d6a03a 16px 25px, #9a6a1a 25px 31px, #2e1808 31px 34px) right 0 bottom 0 / 16px 34px no-repeat,
    linear-gradient(180deg, #2e1808 0 3px, #6b4020 3px 6px, #a8703c 6px 10px, #d89c5c 10px 13px, #f0c080 13px 15px, #b67a40 15px 20px, #7a4a22 20px 25px, #2e1808 25px 28px) 14px 3px / calc(100% - 28px) 28px no-repeat,
    linear-gradient(180deg, #2e1808 0 3px, #6b4020 3px 6px, #a8703c 6px 10px, #d89c5c 10px 13px, #f0c080 13px 15px, #b67a40 15px 20px, #7a4a22 20px 25px, #2e1808 25px 28px) 14px calc(100% - 3px) / calc(100% - 28px) 28px no-repeat,
    linear-gradient(180deg, rgba(70,40,10,.5), rgba(70,40,10,.18) 6px, transparent 16px) 22px 31px / calc(100% - 44px) 18px no-repeat,
    linear-gradient(0deg, rgba(70,40,10,.5), rgba(70,40,10,.18) 6px, transparent 16px) 22px calc(100% - 31px) / calc(100% - 44px) 18px no-repeat,
    linear-gradient(90deg, #7a5424 0 3px, rgba(110,70,25,.38) 3px 10px, transparent 34px calc(100% - 34px), rgba(110,70,25,.38) calc(100% - 10px) calc(100% - 3px), #7a5424 calc(100% - 3px)) 22px 16px / calc(100% - 44px) calc(100% - 32px) no-repeat,
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='1000' height='900'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .35 0 0 0 0 .22 0 0 0 0 .08 0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='.55'/></svg>") 22px 16px / calc(100% - 44px) calc(100% - 32px) no-repeat,
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='600' height='600'><filter id='m'><feTurbulence type='fractalNoise' baseFrequency='.012' numOctaves='2' seed='7'/><feColorMatrix values='0 0 0 0 .45 0 0 0 0 .28 0 0 0 0 .1 0 0 0 .9 -.32'/></filter><rect width='100%' height='100%' filter='url(%23m)'/></svg>") 22px 16px / calc(100% - 44px) calc(100% - 32px) no-repeat,
    radial-gradient(ellipse at 50% 50%, rgba(255,246,214,.5) 0 30%, transparent 75%) 22px 16px / calc(100% - 44px) calc(100% - 32px) no-repeat,
    linear-gradient(#dcc28b, #dcc28b) 22px 16px / calc(100% - 44px) calc(100% - 32px) no-repeat;
  animation: scrollOpen .5s steps(10) both; }
@keyframes scrollOpen { from { clip-path: inset(calc(50% - 34px) 0); } to { clip-path: inset(0 0); } }
#pages:has(#page-quests.active)::before { background: rgba(18,12,30,.6); }
/* v66g: nút X đè góc rương; hiệu ứng rương & cuộn giấy chạy cả khi máy bật Giảm chuyển động */
.inv-panel.wood .inv-x { position: absolute; top: -12px; right: -12px; z-index: 3; }
@media (prefers-reduced-motion: reduce) {
  .hero-inv.inv-opening .inv-panel { animation-duration: .46s !important; }
  .hero-inv.inv-closing .inv-panel { animation-duration: .3s !important; }
  .hero-inv.inv-fabin .inv-fab { animation-duration: .42s !important; }
  html.desk #page-quests.page.active:not(#page-hero) { animation-duration: .5s !important; }
}
/* v66j: thanh tiến độ ngày nổi bật: dày, viền pixel, chia vạch theo số nhiệm vụ, bóng sáng, cúp ở cuối */
.dayprog.dp-big { gap: 10px; margin-top: 6px; }
.dp-big .dp-track { position: relative; flex: 1; height: 24px; background: #4a3420; box-shadow: 0 0 0 3px #2a1a0c, inset 0 4px 0 rgba(0,0,0,.35); overflow: hidden; }
.dp-big .dp-track > i { position: absolute; left: 0; top: 0; bottom: 0; transition: width .5s steps(8);
  background: linear-gradient(180deg, #b8f07a 0 4px, #6cd04a 4px 13px, #44a83a 13px 18px, #2f7f2a 18px); box-shadow: inset -3px 0 0 #2f7f2a; }
.dp-big .dp-track::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 calc(100% / var(--n) - 3px), rgba(42,26,12,.75) calc(100% / var(--n) - 3px) calc(100% / var(--n))); }
.dp-big .dp-track > i::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.35) 50%, transparent) -60px 0 / 60px 100% no-repeat; animation: dpShine 2.4s linear infinite; }
@keyframes dpShine { to { background-position: calc(100% + 60px) 0; } }
.dp-big .dp-track > em { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-size: 14px; color: #fff; z-index: 1;
  text-shadow: -2px 0 0 #2a1a0c, 2px 0 0 #2a1a0c, 0 -2px 0 #2a1a0c, 0 2px 0 #2a1a0c; }
.dp-big .dp-end { width: 36px; height: 36px; flex: none; filter: grayscale(1) brightness(.75); opacity: .7; }
.dp-big .dp-end svg, .dp-big .dp-end img { width: 100%; height: 100%; }
.dp-big.full .dp-end { filter: drop-shadow(0 0 6px rgba(255,213,74,.9)); opacity: 1; animation: qPulse 1.4s ease-in-out infinite; }
.dp-big.full .dp-track > i { background: linear-gradient(180deg, #fff1a8 0 4px, #ffd54a 4px 13px, #e8a826 13px 18px, #b8780e 18px); box-shadow: none; }
/* v66k: danh sách đã xong hôm nay dưới nút Nhiệm vụ */
.done-list { display: none; }
html.desk .done-list { display: block; position: fixed; right: 24px; top: calc(var(--hud-h) + 96px); z-index: 24; width: 230px; padding: 8px 10px 10px; pointer-events: auto;
  background: rgba(30,22,48,.82); color: #fff; box-shadow: 0 0 0 3px #120c1e, inset 0 0 0 2px rgba(255,255,255,.12), 0 6px 0 3px rgba(0,0,0,.25); }
html[data-mode="day"].desk .done-list { background: rgba(255,248,230,.92); color: #3b2614; box-shadow: 0 0 0 3px #3b2614, inset 0 -3px 0 #e2cc9c, 0 6px 0 3px rgba(0,0,0,.18); }
.done-list .dl-h { display: flex; align-items: center; gap: 6px; font-size: 14px; margin-bottom: 6px; }
.done-list .dl-h b { flex: 1; }
.done-list .dl-h .num { font-size: 14px; color: #6cd04a; }
.done-list .dl-h svg, .done-list .dl-h img { width: 20px; height: 20px; }
.done-list ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.done-list li { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; padding: 3px 6px; background: rgba(108,208,74,.16); box-shadow: inset 3px 0 0 #6cd04a; }
.done-list li svg, .done-list li img { width: 20px; height: 20px; flex: none; }
.done-list li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: line-through; text-decoration-color: rgba(108,208,74,.8); text-decoration-thickness: 2px; }
.done-list .dl-more, .done-list .dl-empty { font-size: 12px; opacity: .75; font-weight: 700; }
.done-list .dl-empty { padding: 2px 0; }
body.game-on .done-list, body.desk-modal .done-list { display: none !important; }
html.desk .hero-inv:not(.closed) { position: fixed; right: 24px; bottom: 20px; width: 340px; max-width: 340px; z-index: 6; }
html.desk .done-list { width: 236px; right: 20px; }
/* v66l: nút Thêm chỉ icon; nhiệm vụ đã xong mờ đi; dấu check dày hơn */
.q-head .q-add span { display: none; }
.q-head .q-add { padding: 4px 8px !important; min-width: 44px; justify-content: center; }
.q-head .q-add img { width: 26px; height: 26px; }
.qrow.done > :not(.qdone) { opacity: .45; }
.qrow.done .qi img { filter: grayscale(.7); }
.qrow.done { box-shadow: none; }
.qrow .qdone .qbadge img { filter: drop-shadow(3px 0 0 #2f8a2a) drop-shadow(0 3px 0 #2f8a2a) drop-shadow(-2px 0 0 #1c5418) drop-shadow(0 -2px 0 #1c5418) drop-shadow(3px 3px 0 rgba(0,0,0,.35)) !important; }
html.mob .dodge-timer, html:not(.desk) .dodge-timer { display: none !important; }
/* v67: vườn cây — mỗi mảng 1 chậu */
#garden { position: fixed; left: 0; top: 0; width: 0; height: 0; z-index: 5; pointer-events: none; }
#garden .pot { position: absolute; pointer-events: auto; cursor: pointer; transform-origin: 50% 100%; }
#garden .pot canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
#garden .pot:hover canvas { filter: brightness(1.08) drop-shadow(0 0 6px rgba(255,255,255,.55)); }
#garden .pot-lbl { position: absolute; left: 50%; bottom: calc(var(--sp) * 4); transform: translateX(-50%); display: flex; align-items: center; gap: 4px; padding: 2px 6px; white-space: nowrap;
  font-size: 12px; color: #fff; background: rgba(27,20,36,.72); box-shadow: 0 0 0 2px #1b1424; opacity: 0; transition: opacity .15s; pointer-events: none; }
#garden .pot-lbl svg, #garden .pot-lbl img { width: 16px; height: 16px; }
#garden .pot:hover .pot-lbl { opacity: 1; }
#garden .pot-ripe { position: absolute; right: 18%; top: 4%; width: 24px; height: 24px; display: none; animation: qPulse 1s ease-in-out infinite; pointer-events: none; }
#garden .pot-ripe svg, #garden .pot-ripe img { width: 100%; height: 100%; }
#garden .pot.ripe .pot-ripe { display: block; }
#garden .pot.grow { animation: potGrow .7s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes potGrow { 0% { transform: scale(1, 1); } 30% { transform: scale(1.12, .9); } 60% { transform: scale(.95, 1.12); } 100% { transform: none; } }
body.game-on #garden .pot { opacity: .85; }
.pot-care { position: absolute; left: 50%; top: 22%; width: 0; height: 0; pointer-events: none; z-index: 2; }
.pot-care .pc-can { position: absolute; left: 6px; top: -70px; width: 64px; height: 64px; transform-origin: 20% 80%; animation: canPour 1.6s ease-in-out forwards; }
.pot-care .pc-can svg, .pot-care .pc-can img { width: 100%; height: 100%; transform: scaleX(-1); }
@keyframes canPour { 0% { opacity: 0; translate: 30px -20px; } 15% { opacity: 1; translate: 0 0; } 30%, 75% { rotate: -35deg; } 90% { rotate: 0deg; opacity: 1; } 100% { opacity: 0; } }
.pot-care i { position: absolute; width: 4px; height: 8px; background: #86d0f5; box-shadow: 0 0 0 1px #2f4a9c; opacity: 0; animation: drop .5s linear infinite; }
.pot-care i:nth-of-type(1) { left: -6px; animation-delay: .45s; } .pot-care i:nth-of-type(2) { left: 2px; animation-delay: .55s; } .pot-care i:nth-of-type(3) { left: -14px; animation-delay: .62s; }
.pot-care i:nth-of-type(4) { left: 8px; animation-delay: .7s; } .pot-care i:nth-of-type(5) { left: -2px; animation-delay: .8s; } .pot-care i:nth-of-type(6) { left: -10px; animation-delay: .9s; } .pot-care i:nth-of-type(7) { left: 4px; animation-delay: 1s; }
@keyframes drop { 0% { opacity: 1; transform: translateY(-14px); } 100% { opacity: 0; transform: translateY(40px); } }
.pot-card { position: fixed; z-index: 30; width: 290px; padding: 10px 12px 10px; color: #3b2614; pointer-events: auto;
  background: #fbf0d4; box-shadow: 0 0 0 3px #3b2614, inset 0 -4px 0 #e2cc9c, inset 4px 0 0 var(--sc), 0 8px 0 3px rgba(0,0,0,.25); }
.pot-card.in { animation: pop .22s steps(5); }
.pot-card::after { content: ''; position: absolute; left: 50%; bottom: -12px; margin-left: -8px; border: 8px solid transparent; border-top-color: #3b2614; border-bottom: 0; }
.pot-card .pc-x { position: absolute; right: -12px; top: -12px; width: 28px; height: 28px; padding: 4px; border: 0; cursor: pointer; background: #d9473f; box-shadow: 0 0 0 3px #3b200e, inset 0 -3px 0 #a52f29; }
.pot-card .pc-x svg, .pot-card .pc-x img { width: 100%; height: 100%; filter: brightness(0) invert(1); }
.pot-card .pc-h { display: flex; align-items: center; gap: 8px; }
.pot-card .pc-h > svg, .pot-card .pc-h > img { width: 32px; height: 32px; flex: none; }
.pot-card .pc-h b { display: block; font-size: 16px; }
.pot-card .pc-h small { display: block; font-size: 12px; font-weight: 700; color: #7a5a3a; line-height: 1.25; }
.pot-card .pc-lv { display: flex; align-items: center; gap: 8px; margin: 6px 0 8px; font-size: 12px; }
.pot-card .pc-lv .bar { flex: 1; height: 8px; background: #e2cc9c; box-shadow: 0 0 0 2px #3b2614; }
.pot-card .pc-lv .bar i { background: var(--sc); }
.pot-card .pc-harvest { width: 100%; justify-content: center; margin-bottom: 8px; animation: qPulse 1.4s ease-in-out infinite; }
.pot-card .pc-list { display: grid; gap: 5px; max-height: 220px; overflow: auto; padding: 2px; }
.pot-card .pc-q { display: flex; align-items: center; gap: 8px; width: 100%; padding: 5px 8px; border: 0; cursor: pointer; text-align: left; font: inherit; font-size: 14px; font-weight: 700; color: inherit;
  background: #fff8e6; box-shadow: 0 0 0 2px #3b2614, inset 0 -3px 0 #e2cc9c; }
.pot-card .pc-q:hover { background: #fff; }
.pot-card .pc-q > svg, .pot-card .pc-q > img { width: 24px; height: 24px; flex: none; }
.pot-card .pc-q .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pot-card .pc-box { width: 20px; height: 20px; flex: none; background: #fff; box-shadow: 0 0 0 2px #3b2614; display: grid; place-items: center; }
.pot-card .pc-box svg, .pot-card .pc-box img { width: 18px; height: 18px; }
.pot-card .pc-q.done { opacity: .55; } .pot-card .pc-q.done .nm { text-decoration: line-through; }
.pot-card .pc-q.done .pc-box { background: #6cd04a; }
.pot-card .pc-c { display: flex; align-items: center; gap: 2px; font-size: 12px; }
.pot-card .pc-c svg, .pot-card .pc-c img { width: 16px; height: 16px; }
.pot-card .pc-empty { width: 100%; padding: 8px; border: 0; cursor: pointer; font: inherit; font-size: 13px; font-weight: 700; color: #7a5a3a; background: #f3e6c4; box-shadow: 0 0 0 2px #3b2614; }
.pot-card .pc-foot { margin-top: 6px; font-size: 12px; color: #7a5a3a; text-align: right; }
body.game-on .pot-card, body.desk-modal .pot-card { display: none; }
/* bảng lĩnh vực: góc trái trên, gọn, không che vườn */
html.desk .hero-list { position: fixed; left: 20px; top: calc(var(--hud-h) + 12px); width: 250px; z-index: 7; grid-column: auto; grid-row: auto; margin: 0; }
html.desk .hero-list { padding: 6px 8px; transform: none; }
html.desk .hero-list .srow { min-height: 0; padding: 3px 4px; gap: 6px; }
html.desk .hero-list .srow .plate { width: 30px; height: 30px; }
html.desk .hero-list .srow .plate svg, html.desk .hero-list .srow .plate img { width: 22px; height: 22px; }
html.desk .hero-list .srow .nm { font-size: 13px; }
.harvest-item { flex-direction: column; gap: 6px; }
html[data-mode="night"] #garden .pot canvas { filter: brightness(.82) saturate(.9); }
/* v67: mini game đập côn trùng */
.g-bug { --sz: 48px; }
.g-bug > img { width: var(--sz); height: auto; display: block; margin-left: calc(var(--sz) / -2); margin-top: calc(var(--sz) * -0.4); image-rendering: pixelated; filter: drop-shadow(0 3px 0 rgba(0,0,0,.25)); }
.g-bug > .g-tag { position: absolute; left: 0; bottom: calc(var(--sz) * 0.45 + 4px); transform: translateX(-50%); display: flex; align-items: center; gap: 3px; padding: 1px 6px 1px 2px; white-space: nowrap;
  font-size: 12px; color: #fff; background: rgba(27,20,36,.78); box-shadow: 0 0 0 2px #1b1424; }
.g-bug > .g-tag svg, .g-bug > .g-tag img { width: 16px; height: 16px; background: rgba(255,255,255,.9); }
.g-bug.splat { animation: gSplat .38s steps(4) forwards; }
.g-bug.splat > .g-tag { display: none; }
@keyframes gSplat { 0% { filter: brightness(2); } 40% { opacity: 1; scale: 1.4 .5; } 100% { opacity: 0; scale: 1.8 .2; } }
.g-ring { position: absolute; width: 0; height: 0; }
.g-ring::before { content: ''; position: absolute; left: calc(var(--r) * -1); top: calc(var(--r) * -1); width: calc(var(--r) * 2); height: calc(var(--r) * 2); border-radius: 50%;
  border: 3px dashed rgba(255,255,255,.35); box-sizing: border-box; }
.g-ring.go::after { content: ''; position: absolute; left: calc(var(--r) * -1); top: calc(var(--r) * -1); width: calc(var(--r) * 2); height: calc(var(--r) * 2); border-radius: 50%; box-sizing: border-box;
  border: 8px solid rgba(255,255,255,.9); border-left-color: transparent; border-bottom-color: transparent; animation: gSlash .22s steps(4) forwards; }
@keyframes gSlash { 0% { rotate: -60deg; opacity: 1; } 100% { rotate: 300deg; opacity: 0; } }
.g-hint kbd { display: inline-block; padding: 0 6px; background: #2a2140; color: #fff; font: inherit; box-shadow: 0 2px 0 #000; }
.g-hint span + span { color: #e0463c; font-weight: 800; }
/* v67b: chậu = mảng; bảng tên cắm trước chậu, nhãn cấp trên ngọn cây */
#garden .pot-lbl { display: none; }
#garden .pot-sign { position: absolute; left: 50%; top: calc(100% - var(--sp) * 3); transform: translateX(-50%); display: flex; align-items: center; gap: 3px; max-width: calc(var(--sp) * 34);
  padding: 2px 6px 2px 3px; white-space: nowrap; font-size: 12px; color: #3b200e; background: #e8c48a; pointer-events: none;
  box-shadow: 0 0 0 2px #3b200e, inset 0 -3px 0 #c79a5e, inset 3px 0 0 var(--pc); }
#garden .pot-sign b { overflow: hidden; text-overflow: ellipsis; }
#garden .pot-sign svg, #garden .pot-sign img { width: 16px; height: 16px; flex: none; }
#garden .pot-sign::before { content: ''; position: absolute; left: 50%; top: -8px; width: 4px; height: 8px; margin-left: -2px; background: #8a5a32; box-shadow: 0 0 0 1px #3b200e; z-index: -1; }
#garden .pot-lv { position: absolute; left: 50%; top: calc(var(--top) * var(--sp) - 22px); transform: translateX(-50%); padding: 1px 5px; font-size: 12px; color: #3a2410; white-space: nowrap; pointer-events: none;
  background: #ffd54a; box-shadow: 0 0 0 2px #3b200e, inset 0 -2px 0 #d99a1e; }
#garden .pot-lv.dead { background: #9a8e88; color: #fff; box-shadow: 0 0 0 2px #3b200e; }
#garden .pot-ripe { top: calc(var(--top) * var(--sp) - 4px); right: 10%; }
#garden .pot.back { z-index: 0; filter: brightness(.92); }
#garden .pot:not(.back) { z-index: 1; }
html.mob #garden .pot-sign b { display: none; }
html.mob #garden .pot-sign { padding: 2px 3px; }
html.mob #garden .pot-lv { font-size: 10px; padding: 0 3px; top: calc(var(--top) * var(--sp) - 16px); }
/* v67c: chậu nhỏ hơn nhân vật, thưa hơn, vườn cuộn ngang; highlight chậu đang đứng; Lv không nền */
#garden { transition: none; }
#garden .pot-lv { background: none !important; box-shadow: none !important; padding: 0; font-size: 13px; color: #fff;
  text-shadow: -2px 0 0 #1b1424, 2px 0 0 #1b1424, 0 -2px 0 #1b1424, 0 2px 0 #1b1424, 2px 2px 0 #1b1424; top: calc(var(--top) * var(--sp) - 18px); }
#garden .pot-lv.dead { color: #c8c0bc; }
#garden .pot.near canvas { filter: drop-shadow(0 0 0 #fff) drop-shadow(2px 0 0 #fff) drop-shadow(-2px 0 0 #fff) drop-shadow(0 -2px 0 #fff) drop-shadow(0 0 10px rgba(255,230,120,.95)); }
#garden .pot.near { animation: potNear .5s steps(4); }
#garden .pot.near .pot-sign { background: #ffd54a; transform: translateX(-50%) translateY(-2px); }
#garden .pot.near .pot-lv { color: #ffd54a; }
@keyframes potNear { 0% { transform: none; } 40% { transform: translateY(calc(var(--sp) * -3)); } 100% { transform: none; } }
html.mob #garden .pot-sign b { display: inline; }
html.mob #garden .pot-sign { font-size: 10px; padding: 1px 4px 1px 2px; max-width: calc(var(--sp) * 36); }
html.mob #garden .pot-sign svg, html.mob #garden .pot-sign img { width: 12px; height: 12px; }
/* v67d: rương đồ nằm trên vườn */
#app > #garden { z-index: 4; }
/* v67e: nút minigame góc dưới trái + côn trùng đậu chậu */
.game-btn { position: absolute; left: 14px; bottom: calc(var(--nav-h) + 12px); z-index: 24; display: flex; align-items: center; gap: 4px; height: 44px; padding: 0 9px 0 7px; border: 0; cursor: pointer; color: #fff;
  background: #3a2a5c; box-shadow: 0 -3px 0 0 var(--line), 0 3px 0 0 var(--line), -3px 0 0 0 var(--line), 3px 0 0 0 var(--line), inset 0 -4px 0 rgba(0,0,0,.28), inset 0 3px 0 rgba(255,255,255,.18), 0 6px 0 rgba(0,0,0,.25); }
.game-btn[hidden], body.game-on .game-btn, body.desk-modal .game-btn { display: none; }
.game-btn .gb-ic { display: flex; } .game-btn .gb-ic > * { width: 28px; height: 28px; }
.game-btn .gb-txt { font-family: var(--font-num, inherit); font-size: 14px; font-weight: 800; color: var(--gold, #ffd54a); }
.game-btn:hover { background: #4a3874; transform: translateY(-1px); }
.game-btn:active { transform: translateY(2px); }
.game-btn[data-mode="play"] .gb-ic { animation: gWobble 2.4s ease-in-out infinite; }
html.desk .game-btn { left: 22px; bottom: 24px; height: 48px; }
#dodge-timer { display: none !important; }
.g-bug .g-land { position: absolute; left: 0; top: 0; width: 26px; height: 26px; margin: calc(var(--sz) * -0.4 - 30px) 0 0 -13px; display: none; border-radius: 50%;
  background: conic-gradient(#e5484d calc(var(--p, 0) * 360deg), rgba(0,0,0,.35) 0); box-shadow: 0 0 0 2px #1b1424; }
.g-bug .g-land::after { content: ''; position: absolute; inset: 6px; border-radius: 50%; background: #fff4dc; }
.g-bug.landed .g-land { display: block; }
.g-bug.landed > .g-tag { display: none; }
.g-bug.landed > img { animation: gHit .26s steps(2) infinite; }
#garden .pot.g-shake { animation: potShake .5s steps(5) 2; }
#garden .pot.g-saved > canvas { animation: potSaved .35s ease-out; }
@keyframes potShake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-4px) rotate(-3deg); } 75% { transform: translateX(4px) rotate(3deg); } }
@keyframes potSaved { 0% { filter: brightness(1.6); } 100% { filter: none; } }
/* v67e: pop up chậu tối giản */
.pot-card { width: 260px; padding: 8px 10px 9px; }
.pot-card .pc-h { gap: 6px; }
.pot-card .pc-h > svg, .pot-card .pc-h > img { width: 26px; height: 26px; }
.pot-card .pc-h b { flex: 1; min-width: 0; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pot-card .pc-lvn { font-size: 12px; color: #7a5a3a; flex: none; }
.pot-card .pc-lv { margin: 5px 0 7px; }
.pot-card .pc-lv .bar { height: 6px; }
.pot-card .pc-harvest { width: auto; flex: none; margin: 0 0 0 4px; min-height: 0; height: 30px; padding: 0 9px 0 6px; gap: 4px; font-size: 13px; }
.pot-card .pc-harvest svg, .pot-card .pc-harvest img { width: 18px; height: 18px; }
.pot-card .pc-q { padding: 4px 7px; font-size: 13px; }
.pot-card .pc-q > svg, .pot-card .pc-q > img { width: 20px; height: 20px; }
.pot-card .pc-box { width: 18px; height: 18px; }
.pot-card.mob { width: min(240px, calc(100% - 40px)); }
.pot-card.mob::after { display: none; }
.pot-card.mob .pc-list { max-height: 132px; }
html.mob #page-hero .hero-info { margin-top: 44px; }
.pot-card.mob { width: min(280px, calc(100% - 110px)); }
html:not(.desk) .game-btn { top: calc(var(--hud-h) + 10px); bottom: auto; left: 8px; height: 40px; padding: 0 6px 0 5px; }
html:not(.desk) .game-btn .gb-ic > * { width: 24px; height: 24px; }
html:not(.desk) .game-btn .gb-txt { font-size: 12px; }
.pot-card.mob { width: min(260px, calc(100% - 144px)); } .pot-card.mob .pc-h b { font-size: 14px; }
/* v67e: bảng tên giãn theo chiều dọc với tên dài; badge số nhiệm vụ còn lại */
#garden .pot-sign { white-space: normal; width: max-content; max-width: calc(var(--sp) * 30); align-items: flex-start; line-height: 1.15; text-align: left; padding-top: 3px; padding-bottom: 4px; }
#garden .pot-sign b { overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
#garden .pot-sign svg, #garden .pot-sign img { margin-top: 0; }
html.mob #garden .pot-sign { max-width: calc(var(--sp) * 34); }
#garden .pot-badge { position: absolute; left: calc(50% + var(--sp) * 9); top: calc(var(--top) * var(--sp) - 6px); min-width: 20px; height: 20px; padding: 0 4px; display: grid; place-items: center;
  font-size: 12px; color: #fff; background: #e5484d; box-shadow: 0 0 0 2px #1b1424, inset 0 -2px 0 #a52f29; pointer-events: none; z-index: 2; }
#garden .pot-badge[hidden] { display: none; }
html.mob #garden .pot-badge { min-width: 16px; height: 16px; font-size: 10px; left: calc(50% + var(--sp) * 8); }
html:not(.mob) #garden .pot-sign { max-width: calc(var(--sp) * 38); }
/* v67f: chạm chậu = glow, không nhảy */
#garden .pot.near { animation: none; }
#garden .pot.near .pot-sign { transform: translateX(-50%); }
#garden .pot.near canvas { animation: potGlow 1.2s ease-in-out infinite; }
@keyframes potGlow {
  0%, 100% { filter: drop-shadow(2px 0 0 #fff) drop-shadow(-2px 0 0 #fff) drop-shadow(0 -2px 0 #fff) drop-shadow(0 2px 0 #fff) drop-shadow(0 0 6px rgba(255,220,90,.8)); }
  50% { filter: drop-shadow(2px 0 0 #fff6c8) drop-shadow(-2px 0 0 #fff6c8) drop-shadow(0 -2px 0 #fff6c8) drop-shadow(0 2px 0 #fff6c8) drop-shadow(0 0 16px rgba(255,220,90,1)); }
}
/* v67g */
#garden .pot-sign.short { white-space: nowrap; max-width: none; }
html:not(.desk) .game-btn { top: auto; bottom: calc(var(--nav-h) + 10px); left: 8px; }
html.mob #page-hero .hero-info { padding-bottom: 64px; }
/* v67g: thẻ chậu thoáng hơn */
.pot-card { width: 290px; padding: 12px 14px 14px; }
.pot-card .pc-h { gap: 8px; padding-right: 14px; }
.pot-card .pc-lv { margin: 8px 0 10px; }
.pot-card .pc-harvest { display: flex; margin: 0 auto 10px; height: 32px; padding: 0 12px 0 8px; font-size: 13px; }
.pot-card .pc-list { gap: 7px; }
.pot-card .pc-q { padding: 6px 9px; }
.pot-card.mob { width: min(290px, calc(100% - 32px)); }
.pot-card .pc-h { padding-right: 0; }
html:not(.desk) .game-btn { height: 34px; bottom: calc(var(--nav-h) + 4px); }
/* v67h: rời chậu chỉ tắt glow, không hiệu ứng */
#garden .pot, #garden .pot canvas, #garden .pot-sign, #garden .pot-lv { transition: none !important; }
#garden .pot:not(.near):not(.grow):not(.g-shake) { animation: none !important; }
#garden .pot:not(.near) canvas { animation: none; }
/* v67i: Nhiệm vụ (desktop) = cuộn giấy gọn bên phải, không phủ kín màn hình */
html.desk #page-quests.page.active:not(#page-hero) { left: auto; right: 18px; margin-left: 0; width: min(470px, 38vw); top: calc(var(--hud-h) + 92px);
  max-height: calc(100vh - var(--hud-h) - 120px); padding: 46px 34px 50px; }
html.desk #page-quests .qlist { grid-template-columns: 1fr; }
#pages:has(#page-quests.active)::before { background: transparent !important; }
html.desk #page-quests .qg-head { flex-wrap: wrap; }
/* v67i: hộp thu hoạch nhỏ gọn, ảnh phụ kiện sắc nét */
.dialog:has(.harvest-dlg) { width: min(330px, calc(100vw - 32px)); max-width: 330px; }
.harvest-dlg { gap: 8px; }
.harvest-dlg .big-num { font-size: 28px; }
.harvest-dlg .harvest-item img { image-rendering: pixelated; image-rendering: crisp-edges; width: auto; height: 64px; max-width: 140px; object-fit: contain; }
.harvest-dlg p { margin: 0; font-size: 14px; }
.dialog:has(.harvest-dlg) .btn { min-height: 0; padding-top: 8px; padding-bottom: 8px; }
/* quests panel: hàng không tràn */
html.desk #page-quests .qgroup, html.desk #page-quests .qrow { max-width: 100%; box-sizing: border-box; }
html.desk #page-quests .qlist { grid-template-columns: minmax(0, 1fr); } html.desk #page-quests .qgroup { min-width: 0; }
body.desk-modal:has(#page-quests.active) #avatar, body.desk-modal:has(#page-quests.active) #name-tag { visibility: visible !important; }
body.desk-modal:has(#page-quests.active) .hero-inv { visibility: hidden; }
/* v67j: bục gỗ theo nhóm lĩnh vực */
#garden .pot-bed { position: absolute; z-index: 0; pointer-events: none;
  background:
    linear-gradient(180deg, var(--bc) 0 calc(var(--sp) * 1), color-mix(in srgb, var(--bc) 60%, #000) calc(var(--sp) * 1) calc(var(--sp) * 1.5), transparent calc(var(--sp) * 1.5)),
    repeating-linear-gradient(90deg, transparent 0 calc(var(--sp) * 11), #5a3418 calc(var(--sp) * 11) calc(var(--sp) * 11.5)),
    linear-gradient(180deg, #c08a52 0 calc(var(--sp) * 2.5), #8a5a32 calc(var(--sp) * 2.5) calc(var(--sp) * 3), #a8703c calc(var(--sp) * 3) calc(var(--sp) * 4.5), #6b4020 calc(var(--sp) * 4.5));
  box-shadow: 0 0 0 2px #2e1808, 0 4px 0 rgba(0,0,0,.25); }
#garden .bed-post { position: absolute; left: calc(var(--sp) * 1); bottom: 100%; margin-bottom: 2px; width: 24px; height: 24px; display: grid; place-items: center;
  background: var(--bc); box-shadow: 0 0 0 2px #2e1808, inset 0 -3px 0 rgba(0,0,0,.25), inset 0 2px 0 rgba(255,255,255,.3); }
#garden .bed-post::after { content: ''; position: absolute; left: 50%; top: 100%; width: 4px; height: 4px; margin-left: -2px; background: #5a3418; }
#garden .bed-post svg, #garden .bed-post img { width: 16px; height: 16px; filter: drop-shadow(1px 1px 0 rgba(0,0,0,.35)); }
html.mob #garden .bed-post { width: 20px; height: 20px; } html.mob #garden .bed-post svg, html.mob #garden .bed-post img { width: 13px; height: 13px; }
#garden .pot { z-index: 1; }
#garden .pot-bed {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--bc) 80%, #fff) 0 calc(var(--sp) * .7), var(--bc) calc(var(--sp) * .7) calc(var(--sp) * 2), color-mix(in srgb, var(--bc) 55%, #000) calc(var(--sp) * 2) calc(var(--sp) * 2.6), transparent calc(var(--sp) * 2.6)),
    repeating-linear-gradient(90deg, transparent 0 calc(var(--sp) * 12), rgba(46,24,8,.75) calc(var(--sp) * 12) calc(var(--sp) * 12.6)),
    repeating-linear-gradient(180deg, color-mix(in srgb, #b07a46 78%, var(--bc)) 0 calc(var(--sp) * 2.6), color-mix(in srgb, #8a5a32 80%, var(--bc)) calc(var(--sp) * 2.6) calc(var(--sp) * 3.2));
  box-shadow: 0 0 0 2px #2e1808, inset 0 calc(var(--sp) * -1) 0 rgba(0,0,0,.25), 0 4px 0 rgba(0,0,0,.25); }
#garden .bed-post { width: 28px; height: 28px; left: calc(var(--sp) * 2); margin-bottom: 10px; }
#garden .bed-post::after { height: 10px; width: 4px; }
#garden .bed-post svg, #garden .bed-post img { width: 20px; height: 20px; }
html.mob #garden .bed-post { width: 22px; height: 22px; margin-bottom: 8px; } html.mob #garden .bed-post svg, html.mob #garden .bed-post img { width: 15px; height: 15px; }
#garden .pot.hov:not(.near) canvas { filter: drop-shadow(2px 0 0 #fff) drop-shadow(-2px 0 0 #fff) drop-shadow(0 -2px 0 #fff) drop-shadow(0 2px 0 #fff) drop-shadow(0 0 8px rgba(255,230,120,.8)); }
#garden .pot.hov .pot-sign { background: #fff0c0; }
/* v67j: cuộn giấy Nhiệm vụ: nội dung cuộn bên trong, không tràn đè trục; ẩn nút Nhiệm vụ khi mở */
html.desk #page-quests.page.active:not(#page-hero) { overflow: hidden; top: calc(var(--hud-h) + 14px); max-height: calc(100vh - var(--hud-h) - 40px); display: flex; flex-direction: column; }
html.desk #page-quests.page.active > .page-inner { flex: 1 1 auto; min-height: 0; max-height: calc(100vh - var(--hud-h) - 40px - 96px); overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; padding-right: 4px; }
body.desk-modal .quest-fab.on { visibility: hidden !important; }
/* v67k: bục cao hơn, bảng tên lĩnh vực gắn mặt trước bục */
#garden .bed-plate { position: absolute; left: 50%; bottom: calc(var(--sp) * 1.4); transform: translateX(-50%); display: flex; align-items: center; gap: 4px; padding: 1px 8px 1px 4px; white-space: nowrap;
  font-size: 12px; font-weight: 800; color: #fff; letter-spacing: .02em; text-shadow: 1px 1px 0 rgba(0,0,0,.45);
  background: var(--bc); box-shadow: 0 0 0 2px #2e1808, inset 0 -2px 0 rgba(0,0,0,.28), inset 0 2px 0 rgba(255,255,255,.28); }
#garden .bed-plate::before, #garden .bed-plate::after { content: ''; position: absolute; top: 50%; width: 3px; height: 3px; margin-top: -1px; background: #e8d0a0; box-shadow: 0 0 0 1px #2e1808; }
#garden .bed-plate::before { left: -7px; } #garden .bed-plate::after { right: -7px; }
#garden .bed-plate svg, #garden .bed-plate img { width: 15px; height: 15px; flex: none; filter: drop-shadow(1px 1px 0 rgba(0,0,0,.35)); }
html.mob #garden .bed-plate { font-size: 10px; padding: 0 5px 0 3px; gap: 3px; }
html.mob #garden .bed-plate svg, html.mob #garden .bed-plate img { width: 12px; height: 12px; }
/* v67l: cuộn Nhiệm vụ nhỏ hơn, có tiêu đề, mở nhanh */
html.desk #page-quests.page.active:not(#page-hero) { width: min(390px, 32vw); padding: 40px 26px 44px; animation: scrollOpen .2s steps(5) both !important; animation-duration: .2s !important; }
html.desk #page-quests.page.active::before { content: 'Nhiệm vụ cần hoàn thành'; position: static; display: block; height: auto; flex: none; margin: -4px 0 8px; text-align: center;
  font-size: 15px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #4a2a10; text-shadow: 0 1px 0 rgba(255,240,200,.7); }
html.desk #page-quests.page.active > .page-inner { max-height: calc(100vh - var(--hud-h) - 40px - 110px); }
html.desk #page-quests .qrow { min-height: 0; padding-top: 4px; padding-bottom: 4px; font-size: 14px; }
html.desk #page-quests .qg-head { margin-top: 6px; margin-bottom: 4px; font-size: 13px; }
html.desk #page-quests .qgroup { margin-bottom: 10px; }
html.desk #page-quests.page.active:not(#page-hero) { width: min(420px, 34vw); padding: 40px 22px 44px; }
html.desk #page-quests .qrow { gap: 6px; padding-left: 8px; padding-right: 22px; margin: 6px 2px; }
html.desk #page-quests .qrow .qi { width: 34px; height: 34px; flex: none; }
html.desk #page-quests .qrow .qi > svg, html.desk #page-quests .qrow .qi > img { width: 24px; height: 24px; }
html.desk #page-quests .qrow .nm { font-size: 14px; }
html.desk #page-quests .qrow .qm { flex: 1 1 auto; min-width: 0; }
html.desk #page-quests .qrow .qrw { flex: none; }
html.desk #page-quests .qrow .qrw > svg, html.desk #page-quests .qrow .qrw > img { width: 22px; height: 22px; }
html.desk #page-quests .qrow .qdone .qbadge { right: -14px; width: 40px; height: 40px; margin-top: -20px; }
html.desk #page-quests .qrow .qdone .qbadge img { width: 40px; height: 40px; }
/* v67m: chữ trên bảng luôn căn giữa */
#garden .pot-sign { justify-content: center; align-items: center; text-align: center; }
#garden .pot-sign b { text-align: center; }
#garden .bed-plate { justify-content: center; text-align: center; }
/* v67n: nút game mobile thẳng mép menu; chậu mobile nhỏ hơn */
html:not(.desk) .game-btn { left: 16px; bottom: calc(var(--nav-h) + 10px); }
html.mob #garden .pot-sign { max-width: 66px; font-size: 9px; padding: 1px 3px; }
html.mob #garden .pot-sign svg, html.mob #garden .pot-sign img { width: 10px; height: 10px; }
html.mob #garden .pot-lv { font-size: 9px; }
html.mob #garden .bed-plate { font-size: 9px; }
/* v67o: cuộn Nhiệm vụ ngắn hơn, nội dung cách xa mép giấy */
html.desk #page-quests.page.active:not(#page-hero) { max-height: min(640px, calc(100vh - var(--hud-h) - 80px)); padding: 38px 40px 44px; }
html.desk #page-quests.page.active > .page-inner { max-height: min(530px, calc(100vh - var(--hud-h) - 190px)); padding-right: 6px; }
html.desk #page-quests .qrow { margin: 5px 10px 5px 2px; padding-right: 18px; min-height: 0; }
html.desk #page-quests .qrow .qi { width: 30px; height: 30px; }
html.desk #page-quests .qrow .qi > svg, html.desk #page-quests .qrow .qi > img { width: 20px; height: 20px; }
html.desk #page-quests .qrow .nm { font-size: 13px; }
html.desk #page-quests .qrow .qrw > svg, html.desk #page-quests .qrow .qrw > img { width: 18px; height: 18px; }
html.desk #page-quests .qrow .qdone .qbadge { right: -10px; width: 32px; height: 32px; margin-top: -16px; }
html.desk #page-quests .qrow .qdone .qbadge img { width: 32px; height: 32px; }
html.desk #page-quests .qg-head { font-size: 12px; margin-right: 10px; }
html.desk #page-quests .q-date, html.desk #page-quests .dp-big { margin-right: 10px; }
/* v67p: lời nhắc chậu bị bỏ bê */
#garden .pot-nag { position: absolute; left: 50%; top: calc(var(--top) * var(--sp) - 50px); transform: translateX(-50%); z-index: 3; pointer-events: none; white-space: nowrap;
  padding: 3px 7px; font-size: 11px; font-weight: 800; color: #fff; background: #d9473f; box-shadow: 0 0 0 2px #2e1808, inset 0 -2px 0 rgba(0,0,0,.25);
  animation: nagBob 1.6s ease-in-out infinite; }
#garden .pot-nag::after { content: ''; position: absolute; left: 50%; top: 100%; margin-left: -5px; border: 5px solid transparent; border-top-color: #2e1808; border-bottom: 0; }
#garden .pot-nag::before { content: ''; position: absolute; left: 50%; top: 100%; margin: -1px 0 0 -3px; border: 3px solid transparent; border-top-color: #d9473f; border-bottom: 0; z-index: 1; }
#garden .pot-nag[hidden] { display: none; }
html.mob #garden .pot-nag { font-size: 9px; padding: 2px 5px; top: calc(var(--top) * var(--sp) - 40px); }
@keyframes nagBob { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-4px); } }
body.game-on #garden .pot-nag { display: none; }
html.desk .hero-list { left: 28px; }
#garden .bed-plate { bottom: calc(var(--sp) * 3.5); } html.mob #garden .bed-plate { bottom: 6px; }
/* v67r: bảng tên luôn ôm trọn chữ + icon */
html #garden .pot-sign.short { max-width: none !important; width: max-content; }
html #garden .pot-sign { box-sizing: content-box; overflow: visible; }
html #garden .pot-sign b { flex: 0 1 auto; min-width: 0; }

/* v67t: rê chuột lên nhiệm vụ → chậu tương ứng sáng và phóng to nhẹ */
#garden .pot.qhov { animation: potFocus .18s cubic-bezier(.2, 1.4, .4, 1) both !important; z-index: 3; }
#garden .pot.qhov canvas { filter: drop-shadow(2px 0 0 #fff) drop-shadow(-2px 0 0 #fff) drop-shadow(0 -2px 0 #fff) drop-shadow(0 2px 0 #fff) drop-shadow(0 0 14px rgba(255,220,90,1)); }
#garden .pot.qhov .pot-sign { background: #ffd54a; }
@keyframes potFocus { 0% { transform: scale(1); } 100% { transform: scale(1.18); } }
html #garden .pot.qhov canvas { filter: drop-shadow(2px 0 0 #fff) drop-shadow(-2px 0 0 #fff) drop-shadow(0 -2px 0 #fff) drop-shadow(0 2px 0 #fff) drop-shadow(0 0 14px rgba(255,220,90,1)) !important; }
html #garden .pot.hov:not(.near) canvas { filter: drop-shadow(2px 0 0 #fff) drop-shadow(-2px 0 0 #fff) drop-shadow(0 -2px 0 #fff) drop-shadow(0 2px 0 #fff) drop-shadow(0 0 8px rgba(255,230,120,.8)) !important; }
html #garden .pot.near canvas { animation: potGlow 1.2s ease-in-out infinite !important; }
/* v67v: mở modal ban ngày → nền tối lại, cây + nhân vật nổi bật; cuộn Nhiệm vụ dài hơn */
#scene { transition: filter .2s steps(4); }
html:not([data-mode="night"]) body.desk-modal #scene, html:not([data-mode="night"]) body:has(.modal-root:not(:empty)) #scene, html:not([data-mode="night"]) body:has(#modal-root > *) #scene { filter: brightness(.5) saturate(.75); }
html.desk #page-quests.page.active:not(#page-hero) { max-height: min(780px, calc(100vh - var(--hud-h) - 40px)); padding-top: 52px; }
html.desk #page-quests.page.active > .page-inner { max-height: min(660px, calc(100vh - var(--hud-h) - 40px - 120px)); }
html.desk #page-quests.page.active::before { margin-top: 0; }

/* v67w: desktop bỏ bảng Đã xong, task đã xong rải rác dưới lòng đất */
html.desk .done-list { display: none !important; }
#garden .dirt-done { position: absolute; left: 0; top: 0; pointer-events: none; }
#garden .dd-item { position: absolute; display: flex; align-items: center; gap: 5px; padding: 3px 8px 3px 5px; white-space: nowrap; font-size: 13px; font-weight: 700;
  color: rgba(255,240,215,.78); background: rgba(40,22,10,.38); border-radius: 3px; box-shadow: 0 0 0 2px rgba(25,12,4,.35); transform: rotate(var(--r,0deg));
  text-decoration: line-through; text-decoration-color: rgba(140,220,110,.85); text-decoration-thickness: 2px; animation: dd-in .35s ease-out both; }
#garden .dd-item > :first-child { width: 18px; height: 18px; flex: none; opacity: .9; }
@keyframes dd-in { from { opacity: 0; transform: translateY(6px) rotate(var(--r,0deg)); } }
/* v67w: tên nhiệm vụ xuống dòng, không bị cắt */
html .qrow .nm, html.desk #page-quests .qrow .nm { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; line-height: 1.2; }
html.desk #page-quests .qrow .qm { flex: 1 1 0; }

/* v67w: task đã xong rải dưới đất (desktop, theo màn hình) */
#garden .dirt-done { display: none; }
#dirt-done { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 4; pointer-events: none; }
#dirt-done .dd-item { position: absolute; display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px; white-space: nowrap; font-size: 14px; font-weight: 800;
  color: #3b2614; background: rgba(255,240,212,.82); box-shadow: 0 0 0 2px rgba(59,38,20,.55), 0 3px 0 2px rgba(0,0,0,.18); transform: rotate(var(--r,0deg)); animation: dd-in .35s ease-out both; }
#dirt-done .dd-item span { overflow: hidden; text-overflow: ellipsis; text-decoration: line-through; text-decoration-color: rgba(70,170,50,.9); text-decoration-thickness: 2px; }
#dirt-done .dd-item > :first-child { width: 20px; height: 20px; flex: none; }
html[data-mode="night"] #dirt-done .dd-item { background: rgba(40,30,60,.78); color: #e9e2ff; box-shadow: 0 0 0 2px rgba(0,0,0,.5), 0 3px 0 2px rgba(0,0,0,.25); }
body.desk-modal #dirt-done, body.game-on #dirt-done { display: none !important; }
/* v67w: điện thoại có rương nổi góc phải dưới */
html:not(.desk) .hero-inv { display: block; position: fixed; right: 12px; bottom: calc(var(--nav-h) + 6px); z-index: 24; width: auto; max-width: none; }
html:not(.desk) .hero-inv .inv-fab { width: 58px; height: 58px; }
html:not(.desk) .hero-inv .inv-fab svg, html:not(.desk) .hero-inv .inv-fab img { width: 52px; height: 52px; }
html:not(.desk) .hero-inv:not(.closed) { left: 12px; right: 12px; }
html:not(.desk) .hero-inv:not(.closed) .inv-panel { max-width: 360px; margin-left: auto; }
html:not(.desk) .hero-inv .inv-fab { margin-left: auto; }
body.game-on .hero-inv { display: none !important; }
/* v67w: nút vung kiếm trên điện thoại */
.g-swing { position: absolute; right: 16px; bottom: calc(var(--nav-h) + 12px); width: 72px; height: 72px; display: grid; place-items: center; padding: 0; border: 0; cursor: pointer; pointer-events: auto; touch-action: manipulation;
  background: #ffcf3a; box-shadow: 0 0 0 3px var(--line), inset 0 -5px 0 #d99a12, 0 5px 0 3px rgba(0,0,0,.25); border-radius: 50%; z-index: 3; }
.g-swing svg, .g-swing img { width: 40px; height: 40px; }
.g-swing.hit { animation: gsw .18s ease-out; }
@keyframes gsw { 50% { transform: scale(.86) rotate(-20deg); } }
/* v67w: hướng dẫn game gọn */
.g-hint { padding: 5px 10px; gap: 1px; font-size: 12px; border-width: 2px; max-width: min(320px, 86vw); white-space: normal; text-align: center; }
.g-hint b { font-size: 14px; }
.g-hint kbd { padding: 0 4px; }
.dialog:has(.g-over) { width: min(340px, 90vw); }
.dlg-hero.g-over { gap: 6px; font-size: 14px; }
.dlg-hero.g-over .g-pop-ic > * { width: 56px; height: 56px; }
.dlg-hero.g-over > div[style] { font-size: 15px !important; }
.dlg-hero.g-over .muted { font-size: 12px; }
.dialog:has(.g-over) .actions .btn { min-height: 40px; font-size: 14px; }
html:not(.desk) .hero-inv { z-index: 60; }
html:not(.desk) body.inv-m #avatar, html:not(.desk) body.inv-m #name-tag { visibility: hidden; }
html.desk body.inv-m #avatar, html.desk body.inv-m #name-tag { visibility: visible; }
html:not(.desk) body.inv-m .game-btn { display: none; }

/* v67x: thẻ task nằm ngay dưới chậu tương ứng */
#garden #dirt-done { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none; }
#dirt-done .dd-item { translate: -50% 0; white-space: normal; font-size: 12px; line-height: 1.15; padding: 3px 8px 3px 5px; gap: 5px; width: max-content; }
#dirt-done .dd-item span { overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
#dirt-done .dd-item > :first-child { width: 18px; height: 18px; }
/* v67x: nút Thêm nhiệm vụ trong thẻ chậu */
.pot-card .pc-empty { display: block; width: 100%; padding: 8px 10px; text-align: center; font-size: 13px; font-weight: 700; color: var(--muted, #7a6a55); background: none; box-shadow: none; border: 2px dashed rgba(59,38,20,.3); }
.pot-card .pc-add { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 36px; margin-top: 8px; padding: 4px 10px; font-size: 14px; }
.pot-card .pc-add > :first-child { width: 20px; height: 20px; }
.pot-card .pc-list:has(.pc-q) + .pc-add { min-height: 30px; font-size: 13px; }
/* v67x: rương điện thoại gọn, nằm dưới chân nhân vật, nhân vật luôn hiện */
html:not(.desk) body.inv-m #avatar, html:not(.desk) body.inv-m #name-tag { visibility: visible; }
html:not(.desk) body.inv-m #pot-card, html:not(.desk) body.inv-m #speech { display: none !important; }
html:not(.desk) .hero-inv:not(.closed) { left: 8px; right: 8px; bottom: calc(var(--nav-h) + 4px); }
html:not(.desk) .hero-inv:not(.closed) .inv-panel { max-width: 420px; margin: 0 auto; padding: 6px 8px 8px; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "tabs x" "grid grid" "pg shop"; gap: 6px 8px; align-items: center; }
html:not(.desk) .hero-inv:not(.closed) .inv-head { display: contents; }
html:not(.desk) .hero-inv:not(.closed) .inv-head .inv-cnt, html:not(.desk) .hero-inv:not(.closed) .inv-sec, html:not(.desk) .hero-inv:not(.closed) .inv-empty { display: none; }
html:not(.desk) .hero-inv:not(.closed) .inv-x { grid-area: x; position: static; width: 30px; height: 30px; }
html:not(.desk) .hero-inv:not(.closed) .inv-tabs { grid-area: tabs; margin: 0; gap: 3px; }
html:not(.desk) .hero-inv:not(.closed) .inv-tab { height: 28px; padding: 3px; }
html:not(.desk) .hero-inv:not(.closed) .inv-grid { grid-area: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
html:not(.desk) .hero-inv:not(.closed) .inv-pager { grid-area: pg; margin: 0; gap: 8px; justify-content: flex-start; }
html:not(.desk) .hero-inv:not(.closed) .inv-pg { width: 30px; height: 30px; min-height: 0; padding: 0; }
html:not(.desk) .hero-inv:not(.closed) .inv-shop { grid-area: shop; width: auto; margin: 0; min-height: 34px; padding: 2px 12px; font-size: 13px; }
html:not(.desk) .hero-inv:not(.closed) .inv-shop > svg, html:not(.desk) .hero-inv:not(.closed) .inv-shop > img { width: 22px; height: 22px; }
html:not(.desk) .hero-inv:not(.closed) .inv-shop { padding-right: 22px; white-space: nowrap; } html:not(.desk) .hero-inv:not(.closed) .inv-shop .count { right: -8px; top: -10px; transform: scale(.8); }
/* v67z: thẻ task dưới đất nhỏ hơn */
#dirt-done .dd-item { font-size: 10px; padding: 2px 6px 2px 4px; gap: 4px; box-shadow: 0 0 0 2px rgba(59,38,20,.5), 0 2px 0 1px rgba(0,0,0,.18); }
#dirt-done .dd-item > :first-child { width: 14px; height: 14px; }
/* v67z2: rương điện thoại bố cục flex, hẹp hơn, cách mép dưới */
html:not(.desk) .hero-inv:not(.closed) { bottom: calc(var(--nav-h) + 14px); }
html:not(.desk) .hero-inv:not(.closed) .inv-panel { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; max-width: 330px; position: relative; padding: 8px 10px 10px; grid-template-areas: none; }
html:not(.desk) .hero-inv:not(.closed) .inv-head { display: block; position: absolute; top: 6px; right: 8px; margin: 0; }
html:not(.desk) .hero-inv:not(.closed) .inv-tabs { flex: 1 1 100%; margin: 0 36px 0 0; max-width: calc(100% - 36px); grid-template-columns: repeat(8, minmax(0, 1fr)); }
html:not(.desk) .hero-inv:not(.closed) .inv-tab { height: 26px; }
html:not(.desk) .hero-inv:not(.closed) .inv-grid { flex: 1 1 100%; grid-template-columns: repeat(6, minmax(0, 1fr)); }
html:not(.desk) .hero-inv:not(.closed) .inv-pager { flex: 1 1 auto; }
html:not(.desk) .hero-inv:not(.closed) .inv-shop { flex: none; min-height: 32px; }
/* v67z4: rương điện thoại cách menu xa hơn, nút X đè lên góc viền */
html:not(.desk) .hero-inv:not(.closed) { bottom: calc(var(--nav-h) + 30px); }
html:not(.desk) .hero-inv:not(.closed) .inv-head { top: -12px; right: -12px; z-index: 2; }
html:not(.desk) .hero-inv:not(.closed) .inv-x { width: 34px; height: 34px; }
html:not(.desk) .hero-inv:not(.closed) .inv-tabs { margin-right: 20px; max-width: calc(100% - 20px); }
/* v67z6: hướng dẫn game giữa màn hình (desktop) */
.g-hint.mid { animation-name: gHintMid; padding: 10px 18px; font-size: 14px; }
.g-hint.mid b { font-size: 18px; }
@keyframes gHintMid { 0% { opacity: 0; transform: translate(-50%,-50%) scale(.6); } 10%, 75% { opacity: 1; transform: translate(-50%,-50%) scale(1); } 100% { opacity: 0; transform: translate(-50%,-50%) translateY(-10px); } }
/* v67z7: thanh hướng dẫn phím cố định khi chơi (desktop) */
.g-keys { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 3; display: flex; gap: 18px; align-items: center; padding: 6px 14px; white-space: nowrap;
  font-size: 13px; font-weight: 800; color: #fff; background: rgba(30,22,48,.78); box-shadow: 0 0 0 2px rgba(0,0,0,.45); }
.g-keys span { display: flex; align-items: center; gap: 4px; }
.g-keys kbd { display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 5px; font: inherit; font-size: 12px; color: #2a2140; background: #fffdf4; box-shadow: 0 2px 0 #9a8fb0, 0 0 0 1px #2a2140; }
.g-keys kbd.wide { min-width: 56px; }
.g-hint.mid { max-width: 520px; white-space: nowrap; }
/* v68a: bảng điểm game dùng font thường cho chữ tiếng Việt, số dùng font pixel */
.g-score { font-family: inherit; font-weight: 800; font-size: 16px; display: flex; align-items: center; gap: 5px; }
.g-score b.num { color: #ffd54a; font-size: 18px; }

/* v68c: mở bảng Nhiệm vụ không làm tối nền nữa */
html.desk body:has(#page-quests.page.active):not(:has(#modal-root > *)) #scene { filter: none !important; }
/* v68c: camera phóng nhẹ vào chậu khi rê chuột lên nhiệm vụ */
#scene, #garden, #avatar, #name-tag { transition: scale .32s cubic-bezier(.25, .8, .3, 1); }
html #garden .pot.qhov { animation: none !important; }
/* v68c: thẻ task rơi xuống đất */
#dirt-done .dd-dust { position: absolute; width: 34px; height: 10px; translate: -50% -50%; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(120,80,40,.75) 0 35%, rgba(160,110,60,.35) 55%, transparent 70%); animation: ddDust .5s ease-out forwards; }
@keyframes ddDust { from { opacity: 1; scale: .4 .6; } to { opacity: 0; scale: 1.8 1.2; } }
html.desk body:has(#page-quests.page.active):not(:has(#modal-root > *)) #veil { opacity: 0 !important; }
html.desk body.desk-modal:has(#page-quests.page.active) #dirt-done { display: block !important; }

#scene, #garden, #avatar, #name-tag { transition: scale .32s cubic-bezier(.25, .8, .3, 1), translate .32s cubic-bezier(.25, .8, .3, 1); }
body.cam-zoom #avatar, body.cam-zoom #name-tag { pointer-events: none; }
#avatar, #name-tag { transition: scale .32s cubic-bezier(.25, .8, .3, 1), translate .32s cubic-bezier(.25, .8, .3, 1), opacity .15s; }
body.zoom-hide-av #avatar, body.zoom-hide-av #name-tag { opacity: 0; }
html #garden .pot-sign { min-width: 64px; } html #garden .pot-sign b { overflow-wrap: normal; word-break: keep-all; }
html body.desk-modal:has(#page-quests.page.active) #garden .pot-sign { font-size: 10px; min-width: 50px; max-width: 64px; padding: 1px 3px; } html body.desk-modal:has(#page-quests.page.active) #garden .pot-sign > :first-child:not(b) { width: 12px; height: 12px; }
/* v68e: rê chuột lên nhiệm vụ → mọi thứ tối lại, chỉ chậu đó sáng */
#garden .pot, #garden .pot-bed, #dirt-done { transition: filter .22s ease-out; }
html body.cam-zoom #scene { filter: brightness(.42) saturate(.7) !important; transition: filter .22s ease-out, scale .32s cubic-bezier(.25, .8, .3, 1), translate .32s cubic-bezier(.25, .8, .3, 1); }
html body.cam-zoom #garden .pot:not(.qhov), html body.cam-zoom #garden .pot-bed, html body.cam-zoom #dirt-done, html body.cam-zoom #avatar, html body.cam-zoom #name-tag { filter: brightness(.42) saturate(.7); }
html body.cam-zoom #garden .pot.qhov { z-index: 5; }
html.desk body.cam-zoom:has(#page-quests.page.active):not(:has(#modal-root > *)) #scene { filter: brightness(.42) saturate(.7) !important; }
/* v68g: chú thích màu lĩnh vực + hôm nay dưới biểu đồ xu */
.ch-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; margin-top: 6px; font-size: 12px; font-weight: 700; color: var(--muted, #6a6080); }
.ch-legend span { display: inline-flex; align-items: center; gap: 4px; }
.ch-legend i { width: 10px; height: 10px; box-shadow: 0 0 0 1px rgba(0,0,0,.35); }
.ch-legend .td i { width: 0; height: 0; box-shadow: none; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid #f0b400; }
.ch-legend .td { color: #c08a00; }
/* v68h: pop up trang (Tiến trình, Phần thưởng…) trên desktop: nền tối hết, căn giữa khung, bấm ra ngoài để đóng */
html.desk body.desk-modal:not(:has(#page-quests.page.active)) #pages::before { content: ''; position: fixed; inset: 0; z-index: 39; background: rgba(12, 8, 24, .66); pointer-events: auto; cursor: pointer; animation: fadeIn .18s ease-out; }
html.desk body.desk-modal:not(:has(#page-quests.page.active)) .page.active:not(#page-hero) { top: 50%; bottom: auto; translate: 0 -50%; max-height: calc(100vh - 48px); overflow: auto;
  box-shadow: 0 0 0 4px var(--line), 0 8px 0 4px rgba(0,0,0,.3); }
@keyframes fadeIn { from { opacity: 0; } }
html.desk body.desk-modal:not(:has(#page-quests.page.active)) :is(#hud, #avatar, #name-tag, #speech) { filter: brightness(.34) saturate(.6); transition: filter .18s; }
html.desk body.desk-modal:not(:has(#page-quests.page.active)) #page-hero :is(.hero-list, .hero-inv) { filter: brightness(.34) saturate(.6); }
html.desk body.desk-modal:not(:has(#page-quests.page.active)) #veil { background: rgba(12, 8, 24, .62); opacity: 1; }

/* v68i: dòng "đã hoàn thành hết" trong thẻ chậu */
.pc-alldone{display:flex;align-items:center;justify-content:center;gap:6px;margin:8px 0 2px;padding:6px 10px;border-radius:8px;background:#e3f6d8;color:#2f7a2a;font-weight:800;font-size:15px;border:2px solid #7cc464}

/* v68j: phụ kiện bay tới nhân vật khi trang bị */
.wear-fly{position:fixed;z-index:9999;pointer-events:none;image-rendering:pixelated;object-fit:contain;filter:drop-shadow(0 3px 0 rgba(20,12,40,.45))}
.wear-spark{position:fixed;z-index:9999;pointer-events:none;width:8px;height:8px;margin:-4px 0 0 -4px;background:#fff6c0;box-shadow:0 0 0 3px #ffd54a;animation:wearSpark .45s ease-out forwards}
@keyframes wearSpark{0%{transform:scale(.4);opacity:1}100%{transform:scale(4);opacity:0}}

/* v68k: pop up Phần thưởng: tiêu đề cố định + nút thêm luôn hiện, khung cao cố định để không nhảy khi đổi tab */
.rw-head { display: flex; align-items: stretch; gap: 10px; margin-bottom: 12px; }
.rw-head .seg { flex: 1; margin: 0; }
.rw-add { flex: none; white-space: nowrap; gap: 6px; padding: 0 16px; }
html.desk #page-rewards.page.active { min-height: min(430px, calc(100vh - 140px)); }
html.desk #page-rewards .page-inner { display: flex; flex-direction: column; min-height: 100%; }
html.desk #page-rewards .shop { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; align-items: stretch; }
html.desk #page-rewards .shop .slot { justify-content: flex-start; min-height: 230px; }
@media (max-width: 760px) { .rw-add span { display: none; } .rw-add { padding: 0 10px; } }

/* v68k: nút nổi Phần thưởng (hộp quà) riêng, tách khỏi rương */
.gift-fab { position: fixed; left: 22px; bottom: 96px; z-index: 25; width: 80px; height: 80px; padding: 0; border: 0; background: none; cursor: pointer; pointer-events: auto; filter: drop-shadow(0 5px 0 rgba(0,0,0,.28)); animation: invFloat 2.8s ease-in-out infinite; }
.gift-fab svg, .gift-fab img { width: 72px; height: 72px; }
.gift-fab .lbl { position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%); font-size: 13px; font-weight: 800; white-space: nowrap; color: #fff; text-shadow: -2px 0 0 var(--line), 2px 0 0 var(--line), 0 -2px 0 var(--line), 0 2px 0 var(--line); }
.gift-fab .num { position: absolute; right: 0; top: 0; min-width: 24px; padding: 0 5px; font-size: 15px; line-height: 22px; color: #fff; background: #e0463c; box-shadow: 0 0 0 2px var(--line); }
.gift-fab:hover { animation-play-state: paused; scale: 1.08; }
body.desk-modal .gift-fab, body.game-on .gift-fab { visibility: hidden; }

/* v68l: nút Thu hoạch gắn ngay trên cây (thay cho nút trong thẻ chậu) */
#garden .pot-ripe { position: absolute; left: 50%; right: auto; top: calc(var(--top) * var(--sp) - 46px); width: auto; height: auto; transform: translateX(-50%); display: none; align-items: center; gap: 4px; padding: 3px 9px 3px 5px; border: 0; cursor: pointer; pointer-events: auto; z-index: 5;
  font: 800 13px/1 var(--font, inherit); color: #3a2410; white-space: nowrap; background: linear-gradient(#ffe27a, #ffc93a); box-shadow: 0 0 0 2px #3b200e, inset 0 -3px 0 #d99a1e, inset 0 2px 0 #fff3b8, 0 3px 0 2px rgba(0,0,0,.25); animation: hvBob 1.4s ease-in-out infinite; }
#garden .pot-ripe svg, #garden .pot-ripe img { width: 22px; height: 22px; }
#garden .pot.ripe .pot-ripe { display: flex; }
#garden .pot-ripe:hover { animation-play-state: paused; filter: brightness(1.08); scale: 1.08; }
#garden .pot-ripe::after { content: ''; position: absolute; left: 50%; bottom: -7px; margin-left: -5px; border: 5px solid transparent; border-top-color: #3b200e; border-bottom: 0; }
@keyframes hvBob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -4px; } }
body.game-on #garden .pot-ripe { display: none !important; }

/* v68m: bướm, ong, chim (ngày) / đom đóm (đêm) bay trên vườn */
#critters { position: absolute; left: 0; top: 0; z-index: 6; pointer-events: none; image-rendering: pixelated; }
body.game-on #critters, body.cam-zoom #critters, body.desk-modal #critters { display: none; }
/* v68m: nút Phần thưởng nằm ngay dưới nút Nhiệm vụ */
.gift-fab { left: auto; bottom: auto; right: 84px; top: calc(var(--hud-h) + 104px); }
.gift-fab .lbl { bottom: -12px; }
/* v68n: thẻ phần thưởng thẳng hàng: thanh tiến độ + nút luôn ở đáy; pop up trang nằm ngay dưới nút đóng */
#page-rewards .shop .slot { justify-content: flex-start; }
#page-rewards .slot .nm { min-height: 2.5em; line-height: 1.2; justify-content: center; }
#page-rewards .slot .price { min-height: 34px; display: flex; align-items: center; justify-content: center; gap: 4px; }
#page-rewards .slot .rq { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; display: flex; align-items: center; justify-content: center; gap: 3px; }
#page-rewards .slot .rq svg, #page-rewards .slot .rq img { flex: none; }
#page-rewards .slot .bar { margin-top: auto; }
#page-rewards .slot > .btn, #page-rewards .slot .rw-need { width: calc(100% - 8px); min-height: 48px; margin-top: 6px; }
#page-rewards .slot .rw-need { display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 14px; font-weight: 800; color: var(--muted); background: rgba(0,0,0,.07); box-shadow: inset 0 0 0 2px rgba(0,0,0,.12); }
#page-rewards .slot#add-r2 { justify-content: center; }
html.desk #page-rewards.page.active { min-height: 0; }
#page-rewards .slot .rq .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body:has(#page-quests.page.active) #garden .pot-ripe { display: none !important; }

/* v68p: thú cưỡi (canvas ngay sau #avatar, đè lên chân nhân vật) */
#mount { position: absolute; pointer-events: none; image-rendering: pixelated; }
#mount { transition: scale .32s cubic-bezier(.25, .8, .3, 1), translate .32s cubic-bezier(.25, .8, .3, 1), opacity .15s; }
body.desk-modal #mount { visibility: hidden !important; }
body.desk-modal:has(#page-quests.active) #mount { visibility: visible !important; }
html:not(.desk) body.inv-m #mount { visibility: visible; }
body.zoom-hide-av #mount { opacity: 0; }
html body.cam-zoom #mount { filter: brightness(.42) saturate(.7); }
html.desk body.desk-modal:not(:has(#page-quests.page.active)) #mount { filter: brightness(.34) saturate(.6); }
/* v68q: rê chuột lên nút Hái quả → sáng nổi bật */
#garden .pot-ripe.hot { animation-play-state: paused; scale: 1.15; filter: brightness(1.12) drop-shadow(0 0 6px rgba(255,230,120,.95)); box-shadow: 0 0 0 2px #3b200e, inset 0 -3px 0 #d99a1e, inset 0 2px 0 #fff3b8, 0 0 0 5px #fff3b0, 0 3px 0 5px rgba(0,0,0,.2); z-index: 8; }
body.hv-hot, body.hv-hot #page-hero { cursor: pointer; }
/* v68q: ô chỉnh xu phần thưởng căn giữa, đồng xu ngay sau số */
.rf-row.rf-center { justify-content: center; }
.stepper .st-unit { display: flex; align-items: center; margin-left: -2px; margin-right: 4px; }
.stepper .st-unit svg, .stepper .st-unit img { width: 30px; height: 30px; }
/* v68r: nút Nhiệm vụ nhỏ lại, hộp quà cách xa hơn */
html.desk .quest-fab { font-size: 17px; padding: 6px 18px 6px 9px; gap: 6px; }
html.desk .quest-fab > svg, html.desk .quest-fab > img { width: 38px; height: 38px; }
html.desk .quest-fab .count { transform: scale(1); }
.gift-fab { top: calc(var(--hud-h) + 92px); right: 58px; }

/* v68s: rê chuột lên chậu khi cuộn Nhiệm vụ mở → chậu sáng + nhiệm vụ của chậu sáng */
#page-quests .qrow.pot-hl { position: relative; z-index: 1; background: #fff3b0 !important; box-shadow: 0 0 0 3px #ffc93a, 0 0 12px 2px rgba(255, 201, 58, .7) !important; transition: background .12s, box-shadow .12s; }
body.pot-hov-q #page-quests .qrow[data-q]:not(.pot-hl) { opacity: .55; transition: opacity .12s; }
/* v68t: nút trong pop up hết lượt game không tràn chữ */
.dialog:has(.g-over) { width: min(420px, 92vw); }
.dialog:has(.g-over) .actions { gap: 10px; }
.dialog:has(.g-over) .actions .btn { flex: 1 1 0; min-width: 0; padding: 0 10px; gap: 6px; white-space: nowrap; }
.dialog:has(.g-over) .actions .btn > svg, .dialog:has(.g-over) .actions .btn > img { width: 24px; height: 24px; flex: none; }

/* v68u: lĩnh vực tầm đánh / tốc độ trên ô rương */
.inv-slot { position: relative; }
.inv-slot .inv-stat { position: absolute; right: 2px; bottom: 1px; padding: 0 3px; font: 800 11px/14px var(--font-num, inherit); color: #fff; background: #c8323c; box-shadow: 0 0 0 1px #22192e; pointer-events: none; }
.inv-slot .inv-stat.spd { background: #2f8a4a; }

/* v68v: xong hết nhiệm vụ hôm nay */
.alldone-toast { position: fixed; left: 50%; top: 38%; z-index: 9998; transform: translate(-50%, -50%); padding: 12px 22px; font-size: 22px; font-weight: 800; color: #3a2410; white-space: nowrap; pointer-events: none;
  background: linear-gradient(#ffe27a, #ffc93a); box-shadow: 0 0 0 4px #22192e, inset 0 -5px 0 #d99a1e, inset 0 4px 0 #fff3b8, 0 8px 0 4px rgba(0,0,0,.3); animation: adPop 2.2s cubic-bezier(.2, 1.4, .4, 1) forwards; }
@keyframes adPop { 0% { scale: .3; opacity: 0; } 12% { scale: 1.1; opacity: 1; } 20% { scale: 1; } 85% { opacity: 1; } 100% { opacity: 0; translate: 0 -20px; } }
/* v68v: rương mở ra cách mép xa hơn */
html.desk .hero-inv:not(.closed) { right: 44px; bottom: 40px; }
html:not(.desk) .hero-inv:not(.closed) { left: 16px; right: 16px; bottom: calc(var(--nav-h) + 16px); }

/* v68w: chú thích lĩnh vực vật phẩm khi rê chuột */
#tip.rich { max-width: 280px; text-align: left; padding: 8px 12px; z-index: 300; }
#tip.rich .tt-h { font-size: 15px; font-weight: 800; color: #ffd54a; margin-bottom: 3px; }
#tip.rich .tt-l { font-size: 13px; font-weight: 700; line-height: 1.35; color: #fff; }
#tip.rich .tt-l:last-child { color: #b8b0d8; font-weight: 600; margin-top: 3px; }

/* v68w: nút tạo nhân vật ngẫu nhiên */
.creator .cr-rand { display: flex; margin: 10px auto 4px; min-height: 0; padding: 6px 14px; font-size: 15px; gap: 6px; justify-content: center; }
.creator .cr-rand svg, .creator .cr-rand img { width: 22px; height: 22px; }
.creator .cr-note { text-align: center; }

/* v68z: nhảy */
.g-swing.g-jump { right: 100px; width: 56px; height: 56px; bottom: calc(var(--nav-h) + 20px); background: #7fd3ff; box-shadow: 0 0 0 3px var(--line), inset 0 -5px 0 #3e9fd6, 0 5px 0 3px rgba(0,0,0,.25); }
.g-swing.g-jump svg, .g-swing.g-jump img { width: 30px; height: 30px; }

/* v68z: phụ kiện chia tab con + trang */
.cr-subtabs { display: flex; justify-content: center; gap: 6px; margin: 4px 0 6px; flex-wrap: wrap; }
.cr-sub { width: 48px; height: 40px; display: grid; place-items: center; padding: 0; border: 0; cursor: pointer; background: rgba(34,25,46,.08); box-shadow: inset 0 0 0 2px rgba(34,25,46,.18); }
.cr-sub.on { background: #ffd54a; box-shadow: inset 0 0 0 2px #22192e, inset 0 -3px 0 #d99a12; }
.cr-sub svg, .cr-sub img { width: 24px; height: 24px; }
.cr-tune .acc-grid { min-height: 112px; align-content: flex-start; }
.cr-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 6px 0; font-weight: 800; }
.cr-pager .btn.icon.sm { width: 36px; height: 36px; min-height: 0; padding: 0; }

/* v69b: thẻ điểm game over */
.g-stats .g-st { gap: 10px; padding: 6px 16px 6px 10px; min-width: 150px; }
.g-stats .g-st svg, .g-stats .g-st img { width: 32px; height: 32px; flex: none; }
.g-st-t { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; }
.g-st-t small { font-size: 13px; font-weight: 700; opacity: .8; }
.g-st-t b.num { font-size: 30px; line-height: 1; color: #ffd54a; text-shadow: 2px 2px 0 #1b1424; }

/* v69c: đồ chưa có trong rương */
.inv-slot.locked img { filter: grayscale(1) brightness(.55) contrast(.8); opacity: .55; }
.inv-slot.locked { background: rgba(0,0,0,.18); }
.inv-slot .inv-lock { position: absolute; right: 2px; bottom: 2px; min-width: 16px; padding: 0 3px; font: 800 11px/15px var(--font-num, inherit); text-align: center; color: #fff; background: #5a4a8a; box-shadow: 0 0 0 1px #22192e; pointer-events: none; }

/* v69d: phần thưởng liên kết nhiệm vụ: bấm để mở nhiệm vụ */
.slot .rq.rq-link { display: flex; align-items: center; gap: 4px; max-width: 100%; margin: 2px auto 0; padding: 2px 8px; border: 0; cursor: pointer; font: inherit; font-size: 13px; font-weight: 700; color: inherit; background: rgba(63,138,224,.22); box-shadow: inset 0 0 0 2px rgba(63,138,224,.35); }
.slot .rq.rq-link:hover { background: rgba(63,138,224,.28); }
.slot .rq.rq-link .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot .rq.rq-link svg, .slot .rq.rq-link img { flex: none; }
.dlg-hero .btn.rq-open { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 4px 12px; font-size: 15px; max-width: 100%; }
.dlg-hero .btn.rq-open span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* v69e: nút hoàn thành trong chi tiết nhiệm vụ + bấm ngày để làm bù */
.qd-done-row { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 6px 0 10px; }
.qd-done-row .qd-today { min-width: 260px; justify-content: center; }
.qd-dlg .qd-cal .c.miss, .qd-dlg .qd-cal .c.partial, .qd-dlg .qd-cal .c.done { cursor: pointer; }
.qd-dlg .qd-cal .c.miss:hover, .qd-dlg .qd-cal .c.partial:hover { box-shadow: inset 0 0 0 3px #ffd54a; }
.qd-dlg .qd-hint { text-align: center; font-size: 13px; font-weight: 700; opacity: .75; margin-top: 4px; }

/* v69h: ô phụ kiện trong tạo nhân vật chỉ hiện món đồ */
.cr-tune .acc-grid .tile .acc-none { display: grid; place-items: center; width: 44px; height: 44px; opacity: .45; }
.cr-tune .acc-grid .tile .acc-none svg, .cr-tune .acc-grid .tile .acc-none img { width: 24px; height: 24px; }

/* v69h: xem trước cưỡi thú */
.cr-stage .cr-ride { image-rendering: pixelated; display: block; margin: 0 auto; }

/* v69h: 5 tab tạo nhân vật không đè chữ */
.creator .cr-tabs { display: flex; flex-wrap: nowrap; gap: 1px; padding: 3px; }
.creator .cr-tab { gap: 3px; padding-left: 4px; padding-right: 4px; white-space: nowrap; font-size: 13px; flex: 0 1 auto; }
.creator .cr-tab svg, .creator .cr-tab img { width: 18px; height: 18px; }
/* v69l: popup tạo nhân vật cố định kích thước */
.creator.photo.tuned .cr-stage { height: 300px; min-height: 300px; overflow: hidden; }
.creator.photo.tuned .cr-tune { min-height: 380px; justify-content: flex-start; }
html.desk .creator-scr .creator.photo.tuned { align-items: start; }
html.desk .creator-scr .creator.photo.tuned .cr-tune { grid-row: 1 / span 3; align-self: start; }
/* v69l: ô chưa có chỉ làm mờ, không tô tím */
.inv-slot.locked { opacity: .5; }
.wood .inv-slot.locked { background: #4e2d14; }
.inv-slot.locked img { filter: grayscale(1) brightness(.75); opacity: 1; }
.inv-slot .inv-lock { background: rgba(34,25,46,.85); }
/* v69m: số điểm game tương phản cao */
.g-st-t b.num { color: var(--text); text-shadow: none; font-size: 34px; font-weight: 900; }
.g-st-t small { opacity: .85; color: var(--text); }
/* v69o: nút Hướng dẫn ra top bar */
html.desk #hud .hud-menu #hud-help.hud-btn, html.mob #hud .hud-menu #hud-help.hud-btn { display: inline-flex !important; }
html.mob #hud .hud-menu #hud-help { width: 38px; height: 38px; min-width: 38px; min-height: 38px; margin: 2px !important; position: static; }
html.mob #hud .hud-menu #hud-help img { width: 24px; height: 24px; }
/* v69q: vườn nhiều chậu – bảng tên và nút Hái quả không chồng nhau */
#garden .pot-sign { max-width: min(calc(var(--sp) * 30), calc(var(--gap, 999px) - 10px)); }
#garden.tight .pot-ripe b { display: none; }
#garden.tight .pot-ripe { padding: 3px 5px; }
.hair-t.locked .lock-b { background: rgba(34,25,46,.88); }
.hair-t.locked { opacity: .6; }
html.mob .rw-head .seg .btn { white-space: nowrap; gap: 4px; padding-left: 6px; padding-right: 8px; font-size: 14px; }
html.mob .rw-head .seg .btn img { width: 24px; height: 24px; }
/* v69t: chọn ngôn ngữ */
.lang-seg .btn { min-width: 52px; font-weight: 800; font-size: 15px; }
/* v69t: xu âm hiện đỏ */
#hud-coins.neg .num { color: #ff6b6b; }
#hud-coins.neg { box-shadow: 0 0 0 2px #e5484d; }
/* v69t: gợi ý dưới lòng đất */
#dirt-done .dd-hint { position: absolute; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; white-space: nowrap; font-weight: 800; font-size: 14px; color: rgba(255,240,210,.85); text-shadow: 0 2px 0 rgba(40,20,10,.6); pointer-events: none; }
#dirt-done .dd-hint img { width: 24px; height: 24px; opacity: .9; }
#dirt-done .dd-hint { color: #fff6e0; text-shadow: none; background: rgba(42,24,12,.78); padding: 5px 12px 5px 8px; box-shadow: 0 0 0 2px rgba(20,10,4,.9); font-size: 14px; }

#dirt-done .dd-hint { background: none; box-shadow: none; padding: 0; color: #fff6e0; font-size: 15px; text-shadow: -2px 0 0 #2a180c, 2px 0 0 #2a180c, 0 -2px 0 #2a180c, 0 2px 0 #2a180c, 2px 2px 0 #2a180c, -2px 2px 0 #2a180c, 2px -2px 0 #2a180c, -2px -2px 0 #2a180c; }
#dirt-done .dd-hint img { filter: drop-shadow(0 2px 0 #2a180c); }

/* đồ huyền thoại trong rương: viền vàng lấp lánh */
.inv-slot.leg:not(.locked) { box-shadow: inset 0 0 0 2px #ffd54a, 0 0 8px rgba(255,213,74,.55); animation: legGlow 2.4s ease-in-out infinite; }
.inv-slot.leg.locked .inv-lock { background: #8a5a00; color: #fff3b0; }
@keyframes legGlow { 50% { box-shadow: inset 0 0 0 2px #fff3b0, 0 0 14px rgba(255,213,74,.85); } }
@media (prefers-reduced-motion: reduce) { .inv-slot.leg:not(.locked) { animation: none; } }

/* nút "Chơi miễn phí ngay" khi xem demo */
.free-cta { position: fixed; left: 50%; top: 96px; transform: translateX(-50%); z-index: 60; font-size: 18px; padding: 10px 22px; animation: ctaPulse 1.8s ease-in-out infinite; }
@keyframes ctaPulse { 50% { transform: translateX(-50%) scale(1.06); } }
body.game-on .free-cta, body.desk-modal .free-cta { display: none; }
@media (max-width: 760px) { .free-cta { top: auto; bottom: 92px; font-size: 16px; } }
@media (prefers-reduced-motion: reduce) { .free-cta { animation: none; } }

/* đồ theo mùa: viền đỏ (đang trong mùa hoặc đã có) */
.inv-slot.season { box-shadow: inset 0 0 0 2px #e8402a, 0 0 6px rgba(232,64,42,.5); }
.inv-slot .inv-lock { white-space: nowrap; }
.inv-slot.season.locked .inv-lock { background: #b81c1c; color: #fff3b0; font-size: 11px; }

/* thử thách tuần */
.wk-bar { display: flex; align-items: center; gap: 8px; padding: 6px 8px; margin-top: 4px; background: rgba(255,213,74,.16); box-shadow: inset 0 0 0 2px rgba(160,110,20,.35); font-size: 13px; }
.wk-bar > img:first-child { width: 24px; height: 24px; flex: none; }
.wk-bar .wk-t { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; line-height: 1.2; }
.wk-bar .wk-t small { font-weight: 700; opacity: .75; font-size: 11px; }
.wk-bar .wk-t b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wk-bar .wk-track { flex: 0 0 70px; height: 10px; background: rgba(0,0,0,.18); position: relative; }
.wk-bar .wk-track i { position: absolute; left: 0; top: 0; bottom: 0; background: #ffc93a; }
.wk-bar .wk-n { font-weight: 800; min-width: 34px; text-align: right; }
.wk-bar .wk-ok { display: inline-flex; align-items: center; gap: 3px; font-weight: 800; color: #2f8a4a; white-space: nowrap; }
.wk-bar .wk-ok img { width: 18px; height: 18px; }
.wk-bar.ready { animation: legGlow 2s ease-in-out infinite; }
.wk-bar .wk-btn { white-space: nowrap; }
.wk-bar { flex-wrap: wrap; }
.wk-bar .wk-t { flex: 1 1 calc(100% - 40px); }
.wk-bar .wk-t b { white-space: normal; }
.wk-bar .wk-track { flex: 1 1 auto; margin-left: 32px; }
/* cây cổ thụ (chuỗi chăm 100 ngày) */
#garden .pot.ancient canvas { filter: drop-shadow(0 0 6px rgba(120,240,210,.55)); }
#garden .pot.ancient .pot-lv { background: #1e6a62; color: #c4f2e0; }

/* thẻ Hành trình hằng tháng */
.jr-wrap { display: flex; justify-content: center; }
.jr-img { width: min(420px, 76vw); height: auto; max-height: 62vh; object-fit: contain; image-rendering: auto; box-shadow: 0 0 0 4px #2a180c; }
.jr-btn { align-self: center; margin: 4px auto 10px; display: flex; }

/* chế độ game: chim & thú */
.g-walk > img { margin-top: calc(var(--h) * -1); }
.g-walk > .g-tag { bottom: calc(var(--h) + 4px); }
.g-walk .g-land { margin-top: calc(var(--h) * -1 - 30px); }
.g-walk .g-hp { position: absolute; left: 0; bottom: calc(var(--h) + 30px); transform: translateX(-50%); display: flex; gap: 3px; }
.g-walk .g-hp i { width: 10px; height: 10px; background: #e5484d; box-shadow: 0 0 0 2px #1b1424; }
.g-walk .g-hp i.off { background: #5a5060; }
.g-walk.landed > .g-tag { display: none; }
.g-walk.landed > img { animation: gHit .32s steps(2) infinite; }
.g-ob.hurt > img { animation: gHurt .3s steps(3); }
@keyframes gHurt { 33% { filter: brightness(2.2) drop-shadow(0 3px 0 rgba(0,0,0,.25)); } 66% { filter: none; } }
.g-ob.flee > .g-tag, .g-ob.flee .g-hp, .g-ob.flee .g-land { display: none; }
.g-ob.flee::after { content: '!!'; position: absolute; left: 6px; top: calc(var(--h, var(--sz)) * -1 - 6px); font-weight: 900; font-size: 20px; color: #ffd54a; text-shadow: 0 2px 0 #1b1424, 2px 0 0 #1b1424, -2px 0 0 #1b1424, 0 -2px 0 #1b1424; }
.g-bird.flee::after { top: calc(var(--sz) * -0.6); }
.g-mode-l { font-weight: 800; }
/* ảnh pixel luôn giữ nét khi phóng to */
img.px, .item-big { image-rendering: pixelated; image-rendering: crisp-edges; }
.harvest-dlg .harvest-item img.item-big { width: auto; height: auto; max-width: none; }

/* rương chuỗi */
.sc-dlg { gap: 10px; }
.sc-row { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 10px; background: rgba(0,0,0,.04); box-shadow: inset 0 0 0 3px var(--tc); }
.sc-q { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; }
.sc-q span { font-weight: 700; opacity: .75; font-size: 14px; }
.sc-item { display: flex; align-items: center; gap: 10px; font-size: 17px; }
.inv-slot.locked .inv-lock { font-size: 12px; }

/* ===== v70i: Onboarding dạng thẻ giữa màn hình, đồng bộ trang Nhân vật ===== */
.onb { display: flex; align-items: center; justify-content: center; padding: 16px; overflow: hidden; }
.onb-in { width: min(760px, 100%); max-height: calc(100% - 8px); margin: 0; display: flex; flex-direction: column; background: var(--panel); padding: 14px 20px 16px;
  box-shadow: 0 -4px 0 0 var(--line), 0 4px 0 0 var(--line), -4px 0 0 0 var(--line), 4px 0 0 0 var(--line), inset 0 -4px 0 0 var(--panel-d), inset 0 4px 0 0 var(--panel-l), 0 20px 60px rgba(0,0,0,.45); animation: pop .22s steps(4); }
.onb-top { text-align: center; flex: none; padding-bottom: 8px; border-bottom: 3px dashed var(--panel-d); }
.onb-top .steps { margin: 0 0 10px; }
.onb-top .steps i { width: 36px; height: 10px; }
.onb-top .h1 { font-size: 22px; }
.onb-top .muted { font-weight: 700; font-size: 14px; margin-top: 2px; }
.onb-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 12px 6px; overscroll-behavior: contain; }
.onb .onb-foot { flex: none; position: static; margin: 0; padding: 12px 0 0; background: none; border-top: 3px dashed var(--panel-d); flex-wrap: wrap; }
.onb .onb-foot .btn { min-width: 150px; }
.onb .onb-foot .btn.big { min-height: 52px; font-size: 17px; }
.onb .onb-foot .btn img, .onb .onb-foot .btn svg { width: 26px; height: 26px; }
/* Bước 1: bố cục giống trang Nhân vật (trái: nhân vật, phải: tab chỉnh) */
html.desk .onb .creator.photo.tuned { display: grid; grid-template-columns: 260px minmax(0, 1fr); align-items: start; column-gap: 24px; row-gap: 8px; max-width: none; }
html.desk .onb .creator.photo.tuned .cr-left { grid-column: 1; grid-row: 1 / span 3; }
html.desk .onb .creator.photo.tuned .cr-tune { grid-column: 2; grid-row: 1 / span 3; align-self: start; }
.onb .creator.photo.tuned .cr-stage { height: 280px; min-height: 280px; }
/* Bước 2 */
.onb-sec { --c: var(--gold); padding: 8px 10px 10px; margin-bottom: 10px; background: color-mix(in srgb, var(--c) 10%, var(--card)); box-shadow: 0 0 0 2px var(--line), inset 4px 0 0 var(--c); }
.onb-sec-h { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 16px; margin-bottom: 8px; }
.onb-sec-h img, .onb-sec-h svg { width: 26px; height: 26px; }
.onb-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; padding: 2px 4px 4px; }
.onb-tiles .tile { min-height: 76px; background: color-mix(in srgb, var(--c) 22%, var(--slot)); }
.onb-tiles .tile.on { background: var(--gold); }
.onb-tiles .tile small { font-size: 13px; line-height: 1.15; }
.onb-tiles .tile img, .onb-tiles .tile svg { width: 32px; height: 32px; }
.onb-tiles .tile.add { background: transparent; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--line) 50%, transparent); opacity: .8; }
.onb-tiles .tile.add:hover { opacity: 1; background: rgba(0,0,0,.05); }
.onb-addstat { display: flex; margin: 6px auto 2px; gap: 6px; }
.onb-addstat img, .onb-addstat svg { width: 24px; height: 24px; }
/* Bước 3 */
.onb-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; padding: 4px; }
.onb-list .sugg { margin: 0; min-height: 58px; }
.onb-list .sugg .grow b { font-size: 15px; }
.onb-list .sugg .grow .muted { font-size: 13px; }
.onb-list .sugg > img, .onb-list .sugg > svg { width: 32px; height: 32px; flex: none; }
.sugg-ck { width: 28px; height: 28px; flex: none; display: grid; place-items: center; background: var(--panel-l); box-shadow: 0 0 0 2px var(--line); }
.sugg-ck img, .sugg-ck svg { width: 22px; height: 22px; }
.sugg:not(.on) { opacity: .85; }
/* Pop-up thêm */
.onb-add { display: flex; flex-direction: column; gap: 8px; min-width: min(380px, 80vw); }
.onb-add-name { gap: 8px; }
.onb-add-name .txt { flex: 1; min-width: 0; }
.onb-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px; }
.onb-chips .chip.on { background: var(--gold); color: #3a2410; text-shadow: none; }
@keyframes shakeX { 0%,100% { transform: none; } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.txt.shake { animation: shakeX .3s steps(4); box-shadow: 0 0 0 3px #e5484d; }
/* Mobile */
html:not(.desk) .onb { padding: 10px 8px; }
html:not(.desk) .onb-in { padding: 10px 12px 12px; max-height: calc(100% - 4px); }
html:not(.desk) .onb-top .h1 { font-size: 19px; }
html:not(.desk) .onb .onb-foot .btn { min-width: 0; flex: 1 1 0; padding-left: 8px; padding-right: 8px; }
html:not(.desk) .onb .creator.photo.tuned .cr-stage { height: 220px; min-height: 220px; }
html:not(.desk) .onb .creator.photo.tuned .cr-stage canvas { width: 154px !important; height: 210px !important; }
html:not(.desk) .onb-tiles { grid-template-columns: repeat(3, 1fr); gap: 8px; }
html:not(.desk) .onb-list { grid-template-columns: 1fr; }
#dirt-done .dd-hint .dd-add { pointer-events: auto; color: #ffd54a; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
#dirt-done .dd-hint .dd-add:hover { color: #fff; }
/* v70i: thẻ onboarding không chạm mép */
html.desk .onb { padding: 48px 32px; }
html.desk .onb-in { max-height: min(860px, 100%); }
html:not(.desk) .onb { padding: 16px 12px; }
html:not(.desk) .onb-in { max-height: 100%; }
.onb .creator.photo.tuned .cr-name { margin-bottom: 0; }
html:not(.desk) .onb .creator.photo.tuned .cr-stage { height: auto; min-height: 0; max-height: 240px; }
html:not(.desk) .onb .creator.photo.tuned .cr-stage canvas { width: 132px !important; height: 180px !important; }
html:not(.desk) .onb .creator.photo.tuned .cr-stage .cr-ride { height: 190px !important; width: auto !important; }
html:not(.desk) .onb .onb-foot .btn { font-size: 15px; white-space: nowrap; }
html:not(.desk) .onb .onb-foot .btn img, html:not(.desk) .onb .onb-foot .btn svg { width: 22px; height: 22px; }
/* v70i: chậu trống "Thêm chậu" cuối vườn + pop-up chọn bục */
#garden .pot-add { position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; padding: 0 0 2px; border: 0; background: none; cursor: pointer; pointer-events: auto; font: inherit; color: #fff6e0; z-index: 2; }
#garden .pot-add[hidden] { display: none; }
#garden .pot-add .pa-ghost { width: 72%; height: 46%; display: grid; place-items: center; background: rgba(255,246,224,.14); box-shadow: inset 0 0 0 3px rgba(255,246,224,.75); clip-path: polygon(0 0, 100% 0, 88% 100%, 12% 100%); transition: background .12s, transform .12s; }
#garden .pot-add .pa-ghost img, #garden .pot-add .pa-ghost svg { width: 26px; height: 26px; filter: drop-shadow(0 2px 0 rgba(0,0,0,.35)); }
#garden .pot-add b { font-size: 12px; font-weight: 800; white-space: nowrap; text-shadow: -2px 0 0 #2a180c, 2px 0 0 #2a180c, 0 -2px 0 #2a180c, 0 2px 0 #2a180c; opacity: .9; }
#garden .pot-add:hover .pa-ghost, #garden .pot-add:focus-visible .pa-ghost { background: rgba(255,213,74,.4); transform: translateY(-3px); }
#garden .pot-add:hover b { opacity: 1; color: #ffd54a; }
.pa-intro { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; font-size: 15px; line-height: 1.4; margin-bottom: 12px; }
.pa-intro img, .pa-intro svg { flex: none; width: 32px; height: 32px; }
.pa-beds { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; padding: 4px; }
.pa-bed { --bc: #9a96b0; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px 8px; border: 0; cursor: pointer; font: inherit; color: var(--text); background: color-mix(in srgb, var(--bc) 22%, var(--card)); box-shadow: 0 0 0 3px var(--line), inset 0 -5px 0 var(--bc); }
.pa-bed b { font-size: 15px; }
.pa-bed small { font-size: 12px; color: var(--muted); font-weight: 700; }
.pa-bed:hover { transform: translateY(-2px); background: color-mix(in srgb, var(--bc) 38%, var(--card)); }
.pa-bed.new { background: transparent; box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--line) 45%, transparent); }
.pa-bed:disabled { opacity: .45; cursor: not-allowed; transform: none; }
#dirt-done .dd-hint.all { white-space: normal; max-width: 380px; width: max-content; text-align: center; justify-content: center; line-height: 1.35; transform: translate(-50%, -50%); }
#garden .pot-add .pa-ghost { clip-path: none; width: 64%; height: 40%; background: rgba(255,246,224,.28); box-shadow: none; border: 3px dashed rgba(255,246,224,.95); border-radius: 0 0 14px 14px; }
#garden .pot-add:hover .pa-ghost { background: rgba(255,213,74,.45); border-color: #ffd54a; }
#garden .pot-add.hot .pa-ghost { background: rgba(255,213,74,.45); border-color: #ffd54a; transform: translateY(-3px); }
#garden .pot-add.hot b { opacity: 1; color: #ffd54a; }
#dirt-done .dd-hint.all { white-space: nowrap; max-width: none; }
#dirt-done .dd-hint .dd-add.hot { color: #fff; }
#garden .pot-bed.hov { filter: brightness(1.15); }
#garden .pot-bed.hov .bed-plate { outline: 2px solid #ffd54a; outline-offset: 1px; }
/* nút + nhỏ ở góc bục khi rê chuột: thêm chậu vào bục */
#garden .bed-add { position: absolute; right: 4px; top: 4px; width: 24px; height: 24px; display: grid; place-items: center; background: #8cd860; box-shadow: 0 0 0 2px #2a180c, inset 0 -3px 0 #4f9a35; opacity: 0; transform: scale(.6); transition: opacity .12s, transform .12s; z-index: 2; }
#garden .bed-add img, #garden .bed-add svg { width: 16px; height: 16px; filter: brightness(0) invert(1); }
#garden .pot-bed.hov .bed-add { opacity: 1; transform: scale(1); }
/* bảng tên chậu: tối đa 2 dòng, rộng tới khoảng cách giữa 2 chậu để khỏi che bảng tên bục */
#garden .pot-sign:not(.short) { max-width: calc(var(--gap, 999px) - 8px) !important; }
#garden .pot-sign:not(.short) b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: normal; word-break: normal; }
#garden .bed-add { top: calc(50% - 12px); right: -10px; }
.dialog .actions .btn.sm-save { flex: 0 0 auto; min-width: 150px; min-height: 48px; font-size: 16px; padding: 4px 20px; }
.dialog .actions .btn.sm-save img, .dialog .actions .btn.sm-save svg { width: 26px; height: 26px; }
.dialog .actions:has(.sm-save) { justify-content: flex-end; }
.dialog .actions:has(.sm-save) .btn.red.sm-save { margin-right: auto; min-width: 0; }
.tiles.bed-pick { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
.tiles.bed-pick .tile { min-height: 64px; }
.tiles.bed-pick .tile small { font-size: 13px; }
.sk-intro { font-size: 14px; margin-bottom: 10px; color: var(--muted); } .sk-intro b { color: var(--text); }
#garden .bed-add { top: auto; bottom: calc(var(--sp) * 1.2); right: 6px; }
/* chậu / bục mới tạo */
@keyframes potIn { 0% { transform: translateY(-40px) scale(.3); opacity: 0; } 55% { transform: translateY(4px) scale(1.12, .9); opacity: 1; } 75% { transform: translateY(-4px) scale(.96, 1.05); } 100% { transform: none; } }
@keyframes bedIn { 0% { transform: scaleY(0); opacity: 0; } 70% { transform: scaleY(1.1); opacity: 1; } 100% { transform: none; } }
@keyframes newTag { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-4px); } }
#garden .pot.is-new { animation: potIn .6s steps(8) .25s both; }
#garden .pot-bed.is-new { animation: bedIn .4s steps(5) both; transform-origin: 50% 100%; }
#garden .new-tag { position: absolute; left: 50%; top: -18px; transform: translateX(-50%); z-index: 6; padding: 1px 6px; font: 800 11px/1.3 var(--pixel, inherit); letter-spacing: 1px; color: #3a2410; background: #ffd54a; box-shadow: 0 0 0 2px #2a180c, inset 0 -2px 0 #d99a12; animation: newTag .6s steps(3) infinite; pointer-events: none; white-space: nowrap; }
#garden .pot .new-tag { top: 8%; }
#garden .pot-bed .new-tag { top: -10px; left: 14px; transform: none; animation: none; }
#garden .new-tag.out { opacity: 0; transition: opacity .3s; }
#garden .pot.is-new canvas { filter: drop-shadow(0 0 6px rgba(255,220,120,.95)); }
#garden .pot .new-tag { top: auto; bottom: calc(var(--sp) * 30); font-size: 12px; }
#garden .pot-bed .new-tag { top: auto; bottom: calc(var(--sp) * 1.2); left: 6px; font-size: 11px; }
/* ô "Thêm bục": hình bục gỗ nét đứt */
#garden .pot-add { justify-content: stretch; align-items: stretch; padding: 0; }
#garden .pot-add .pa-ghost { width: 100%; height: 100%; flex-direction: row; display: flex; align-items: center; justify-content: center; gap: 4px; border-radius: 0; border: 3px dashed rgba(255,246,224,.95); background: repeating-linear-gradient(0deg, rgba(160,104,62,.38) 0 calc(var(--sp) * 5), rgba(120,72,40,.38) calc(var(--sp) * 5) calc(var(--sp) * 5 + 2px)); clip-path: none; box-shadow: inset 0 calc(var(--sp) * 2) 0 rgba(255,246,224,.25); }
#garden .pot-add .pa-ghost b { font-size: 12px; opacity: 1; }
#garden .pot-add .pa-ghost img, #garden .pot-add .pa-ghost svg { width: 20px; height: 20px; }
#garden .pot-add > b { display: none; }
#garden .pot-add:hover .pa-ghost, #garden .pot-add.hot .pa-ghost { transform: none; background: repeating-linear-gradient(0deg, rgba(255,213,74,.45) 0 calc(var(--sp) * 5), rgba(217,154,18,.45) calc(var(--sp) * 5) calc(var(--sp) * 5 + 2px)); border-color: #ffd54a; }
/* gợi ý thông minh */
.sg-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px; }
.sg-chip { --c: var(--gold); font-size: 13px; min-height: 34px; }
.sg-chip.on { background: var(--gold); color: #3a2410; text-shadow: none; }
.sg-chip img, .sg-chip svg { width: 20px; height: 20px; }
.sg-list { display: flex; flex-direction: column; gap: 8px; }
.sg-list .sugg { margin: 0; width: 100%; }
.sg-list .sugg[disabled] { opacity: 1; cursor: default; }
.sg-list .sugg .grow .muted { font-size: 13px; display: block; }
.dialog .actions .foot-note { flex: 1 1 auto; align-self: center; font-size: 13px; font-weight: 700; line-height: 1.35; color: var(--muted); text-align: left; padding-right: 6px; }
.dialog .actions .foot-note b { color: var(--text); }

/* chậu chín: nút Hái quả ưu tiên, ẩn bong bóng nhắc để không chồng nhau */
#garden .pot.ripe .pot-nag { display: none !important; }

/* Hái quả: không còn nút cố định, chỉ hiện tooltip khi rê chuột/bấm đúng vào quả chín */
#garden .pot.ripe .pot-ripe { display: flex; visibility: hidden; opacity: 0; pointer-events: none; animation: none; transform: translate(-50%, -100%); scale: 1; transition: opacity .12s; padding: 3px 8px 3px 4px; font-size: 12px; }
#garden .pot.ripe .pot-ripe svg, #garden .pot.ripe .pot-ripe img { width: 18px; height: 18px; }
#garden .pot.ripe .pot-ripe.hot { visibility: visible; opacity: 1; scale: 1; z-index: 9; }
#garden.tight .pot-ripe b { display: inline; }

/* nút + trên bục: tương phản cao, đè lên góc dưới phải của bục */
#garden .bed-add { top: auto !important; bottom: -10px !important; right: -10px !important; width: 26px; height: 26px; background: #2f9e44; box-shadow: 0 0 0 2px #1a0f06, 0 0 0 4px #fff, inset 0 -3px 0 #1d6e2e, 0 3px 0 4px rgba(0,0,0,.35); z-index: 6; }
#garden .bed-add img, #garden .bed-add svg { width: 18px; height: 18px; }
/* tooltip Hái quả: hiện phía trên ngọn cây khi rê chuột vào cây có quả */
#garden .pot.ripe .pot-ripe { left: 50% !important; top: calc(var(--top) * var(--sp) - 40px) !important; transform: translateX(-50%); }
#garden .bed-add .bed-tip { position: absolute; right: -4px; bottom: calc(100% + 10px); padding: 4px 8px; font: 800 12px/1 var(--font, inherit); font-style: normal; color: #fff; white-space: nowrap; background: #2a180c; box-shadow: 0 0 0 2px #fff; opacity: 0; pointer-events: none; transition: opacity .12s; }
#garden .bed-add .bed-tip::after { content: ''; position: absolute; right: 12px; top: 100%; border: 5px solid transparent; border-top-color: #2a180c; border-bottom: 0; }
#garden .bed-add.tip .bed-tip { opacity: 1; }
#garden .bed-add.tip { filter: brightness(1.12); }
/* tooltip "Thêm chậu" nổi trên cùng (không bị nhân vật che) */
#bed-tip-g { position: fixed; z-index: 9999; transform: translate(-100%, -100%); padding: 5px 9px; font: 800 13px/1 var(--font, inherit); color: #fff; white-space: nowrap; background: #2a180c; box-shadow: 0 0 0 2px #fff; opacity: 0; pointer-events: none; transition: opacity .12s; }
#bed-tip-g::after { content: ''; position: absolute; right: 10px; top: 100%; border: 5px solid transparent; border-top-color: #2a180c; border-bottom: 0; }
#bed-tip-g.on { opacity: 1; }

/* bong bóng thoại: chữ dài (VD "quốc gia/tỉnh thành") tự xuống dòng, không tràn mép; tạm ẩn khi đang chỉ vào cây có quả hoặc nút + để không che tooltip */
.speech { overflow-wrap: anywhere; word-break: break-word; }
body.hv-hot .speech, body.bed-tip-on .speech { opacity: 0 !important; transition: opacity .1s; }

/* bục chỉ có 1 chậu: bục rộng hơn, bảng tên chậu được rộng hơn để ít xuống dòng */
html:not(.mob) #garden .pot.one .pot-sign:not(.short) { max-width: calc(var(--gap) * 1.9) !important; }
html.mob #garden .pot.one .pot-sign:not(.short) { max-width: calc(var(--gap) * 1.8) !important; }

/* bảng cấp bục tự thu gọn khi có nhiều bục, để không che ngọn cây */
html.desk .hero-list.fit1 { width: 470px; display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; }
html.desk .hero-list.fit2 .srow { padding: 1px 3px; }
html.desk .hero-list.fit2 .srow .plate { width: 24px; height: 24px; }
html.desk .hero-list.fit2 .srow .plate svg, html.desk .hero-list.fit2 .srow .plate img { width: 18px; height: 18px; }
html.desk .hero-list.fit2 .srow .nm, html.desk .hero-list.fit2 .srow .lv { font-size: 12px; }
html.desk .hero-list.fit2 .srow .bar { height: 5px; margin-top: 2px; }
html.desk .hero-list.fit2 { width: 600px; grid-template-columns: 1fr 1fr 1fr; column-gap: 12px; }
html.desk .hero-list.fit1, html.desk .hero-list.fit2 { max-width: none; }

/* minigame chim: bổ nhào + lông văng */
.g-bird.dive img { filter: drop-shadow(-6px -4px 0 rgba(255,255,255,.35)); }
.g-feather { position: absolute; width: 6px; height: 15px; margin: -7px 0 0 -3px; background: var(--fc, #fff); box-shadow: 0 0 0 1px rgba(27,20,36,.55); border-radius: 2px 2px 50% 50%; pointer-events: none; z-index: 9;
  animation: gFeather 1.2s ease-out forwards; }
@keyframes gFeather {
  0% { transform: translate(0, 0) rotate(var(--r0)); opacity: 1; }
  25% { transform: translate(var(--dx), var(--dy)) rotate(calc(var(--r0) + 140deg)); opacity: 1; }
  50% { transform: translate(calc(var(--dx) + var(--sw)), calc(var(--dy) + var(--fall) * .4)) rotate(calc(var(--r0) + 200deg)); }
  75% { transform: translate(calc(var(--dx) - var(--sw)), calc(var(--dy) + var(--fall) * .75)) rotate(calc(var(--r0) + 150deg)); opacity: .9; }
  100% { transform: translate(var(--dx), calc(var(--dy) + var(--fall))) rotate(calc(var(--r0) + 230deg)); opacity: 0; }
}

/* bỏ vòng tròn tầm đánh quanh nhân vật */
.g-ring { display: none !important; }

/* minigame: hiệu ứng trúng đòn */
.g-impact { position: absolute; width: 0; height: 0; z-index: 12; pointer-events: none; }
.g-impact .ring { position: absolute; left: -26px; top: -26px; width: 52px; height: 52px; border-radius: 50%; background: radial-gradient(circle, #fff 0 30%, #ffe27a 31% 52%, rgba(255,180,40,0) 53%); animation: gImpRing .3s ease-out forwards; }
.g-impact b { position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; background: #fff; box-shadow: 0 0 0 2px #ff9a1e; transform: rotate(var(--a)) translateY(0); animation: gImpRay .36s ease-out forwards; }
@keyframes gImpRing { 0% { transform: scale(.3); opacity: 1; } 60% { opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }
@keyframes gImpRay { 0% { transform: rotate(var(--a)) translateY(-8px) scale(1.2); opacity: 1; } 100% { transform: rotate(var(--a)) translateY(-46px) scale(.4); opacity: 0; } }
.g-shake-scr { animation: gShakeScr .2s linear; }
@keyframes gShakeScr { 0% { translate: 0 0; } 20% { translate: -5px 3px; } 40% { translate: 4px -3px; } 60% { translate: -3px 2px; } 80% { translate: 2px -1px; } 100% { translate: 0 0; } }
.g-ob.g-flash img { animation: gFlash .16s steps(2) 1; }
@keyframes gFlash { 0%, 100% { filter: brightness(3) saturate(0); } }

/* việc đã xong dưới đất: rê chuột sáng lên, bấm để xem */
#dirt-done .dd-item.hot { background: #fff3c4 !important; color: #2a180c !important; box-shadow: 0 0 0 2px #2a180c, 0 0 0 4px #ffd54a, 0 3px 0 4px rgba(0,0,0,.25) !important; z-index: 5; scale: 1.06; }
#dirt-done .dd-item { transition: scale .1s; }
body.dq-hot #page-hero { cursor: pointer; }
/* dòng "Đã hoàn thành hết…" cách viền dưới hơn, giãn dòng thưa hơn */
#dirt-done .dd-hint.all { line-height: 1.8; margin-top: -34px; gap: 10px; }
/* tooltip hái quả: kiểu gợi ý (nền tối, chữ nhỏ), không giống nút bấm */
#garden .pot.ripe .pot-ripe { background: rgba(42,24,12,.88) !important; color: #fff6e0 !important; box-shadow: 0 0 0 2px rgba(255,255,255,.85) !important; font-size: 12px !important; font-weight: 700; padding: 4px 9px 4px 5px !important; filter: none !important; }
#garden .pot.ripe .pot-ripe::after { border-top-color: rgba(42,24,12,.88) !important; }
#garden .pot.ripe .pot-ripe svg, #garden .pot.ripe .pot-ripe img { width: 16px !important; height: 16px !important; }

/* ===== Popup giới thiệu (người mới) ===== */
.onb.intro .onb-in { position: relative; width: min(820px, 100%); }
.intro-x { position: absolute; top: 8px; right: 8px; z-index: 2; width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: var(--slot, rgba(0,0,0,.06)); box-shadow: 0 0 0 2px var(--line); cursor: pointer; }
.intro-slide { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 24px; align-items: center; padding: 16px 10px; }
.intro-img { display: flex; justify-content: center; }
.intro-img img { display: block; max-width: 100%; max-height: 340px; object-fit: contain; box-shadow: 0 0 0 3px var(--line), 6px 6px 0 rgba(0,0,0,.18); background: #fff; }
.intro-img.phone img { max-height: 380px; border-radius: 18px; }
.intro-kick { font-family: var(--pixel); font-size: 13px; letter-spacing: 1px; text-transform: uppercase; color: var(--gold-d, #b07a12); margin-bottom: 4px; }
.intro-txt .h1 { font-size: 26px; line-height: 1.2; margin-bottom: 8px; }
.intro-s { font-size: 17px; font-weight: 700; line-height: 1.5; margin: 0; }
.intro-pts { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.intro-pts li { display: flex; align-items: flex-start; gap: 10px; font-size: 16px; font-weight: 700; line-height: 1.4; }
.intro-pts li > img, .intro-pts li > svg { flex: none; width: 32px; height: 32px; }
.intro-pts.compact { gap: 6px; align-items: center; margin: 4px 0 14px; }
.intro-pts.compact li { font-size: 15px; }
.intro-pts.compact li > img, .intro-pts.compact li > svg { width: 22px; height: 22px; }
.intro-end { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 18px 10px; }
.intro-logo { image-rendering: pixelated; width: 84px; height: 84px; }
.intro-brand { font-family: var(--pixel); font-size: 26px; letter-spacing: 2px; margin: 4px 0 10px; }
.intro-brand b { color: var(--gold-d, #b07a12); }
.intro-end .h1 { font-size: 24px; margin-bottom: 6px; }
.intro-cta { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; width: 100%; }
.intro-cta .btn { min-width: 200px; }
.intro-login { margin-top: 12px; font-weight: 700; }
.intro-legal { margin-top: 10px; }
.intro-end a, .intro-login a { color: var(--gold-d, #b07a12); font-weight: 800; }
.intro-dots { flex: 1 0 100%; margin: 0 0 10px !important; }
.intro-dots i { cursor: pointer; }
html:not(.desk) .intro-slide { grid-template-columns: 1fr; gap: 14px; padding: 8px 4px; }
html:not(.desk) .intro-img img { max-height: 200px; }
html:not(.desk) .intro-img.phone img { max-height: 240px; border-radius: 14px; }
html:not(.desk) .intro-txt .h1 { font-size: 21px; }
html:not(.desk) .intro-s, html:not(.desk) .intro-pts li { font-size: 15px; }
html:not(.desk) .intro-cta .btn { min-width: 0; flex: 1 1 0; }

/* ===== Cài đặt lần đầu ===== */
.onb-name { display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 420px; margin: 0 auto; padding: 8px 0; text-align: center; }
.onb-name-av { padding: 10px 24px 4px; background: radial-gradient(circle at 50% 40%, #d6efff, #8cc8ee); box-shadow: 0 0 0 3px var(--line); }
.onb-name .tune-lbl { justify-content: center; }
.onb-name .txt { width: 100%; font-size: 20px; text-align: center; font-weight: 800; }
html:not(.desk) .onb-name-av canvas { width: 132px !important; height: 180px !important; }
.onb-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; padding: 2px 4px; }
.onb-stat { --c: var(--gold); display: flex; align-items: stretch; background: var(--card); box-shadow: 0 0 0 2px var(--line), inset 5px 0 0 var(--c); opacity: .62; transition: opacity .12s; }
.onb-stat.on { opacity: 1; background: color-mix(in srgb, var(--c) 16%, var(--card)); box-shadow: 0 0 0 3px var(--line), inset 5px 0 0 var(--c); }
.onb-stat-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 10px 8px 10px 14px; border: 0; background: none; font: inherit; color: var(--text); cursor: pointer; text-align: left; }
.onb-stat-main b { flex: 1; min-width: 0; font-size: 16px; line-height: 1.2; overflow-wrap: anywhere; }
.onb-stat-ic { width: 40px; height: 40px; flex: none; display: grid; place-items: center; background: var(--c); box-shadow: 0 0 0 2px var(--line); }
.onb-stat-ic img, .onb-stat-ic svg { width: 28px; height: 28px; }
.onb-ck { width: 26px; height: 26px; flex: none; display: grid; place-items: center; background: var(--slot, #eee); box-shadow: 0 0 0 2px var(--line); }
.onb-stat.on .onb-ck { background: var(--gold); }
.onb-stat-ed { width: 40px; flex: none; border: 0; border-left: 2px dashed color-mix(in srgb, var(--line) 30%, transparent); background: none; cursor: pointer; display: grid; place-items: center; opacity: .75; }
.onb-stat-ed:hover { opacity: 1; background: rgba(0,0,0,.05); }
.onb-more-lbl { margin: 14px 4px 6px; justify-content: center; }
.onb-stats ~ .onb-chips { justify-content: center; }
.onb-note { text-align: center; margin: 10px 4px 2px; font-weight: 700; }
html:not(.desk) .onb-stats { grid-template-columns: 1fr 1fr; gap: 8px; }
html:not(.desk) .onb-stat-main { padding: 8px 6px 8px 10px; gap: 6px; }
html:not(.desk) .onb-stat-main b { font-size: 14px; white-space: normal; }
html:not(.desk) .onb-stat-ic { width: 32px; height: 32px; }
html:not(.desk) .onb-stat-ed { width: 32px; }

/* ===== Vương miện Pro trên avatar + nút Nâng cấp (bản Free) ===== */
.hud-crown { position: absolute; left: -12px; top: -16px; z-index: 2; transform: rotate(-28deg); pointer-events: none; filter: drop-shadow(1px 2px 0 rgba(0,0,0,.45)); line-height: 0; }
.hud-crown img, .hud-crown svg { width: 34px; height: 34px; }
html.mob .hud-crown { left: -10px; top: -13px; }
html.mob .hud-crown img, html.mob .hud-crown svg { width: 28px; height: 28px; }
#hud .hud-upg { cursor: pointer; padding: 4px 14px 4px 8px; gap: 6px; background: linear-gradient(#ffd85a, #f0a92a) !important; box-shadow: 0 0 0 3px var(--line), inset 0 -4px 0 rgba(0,0,0,.18) !important; color: #3a2410; font-weight: 800; font-size: 15px; min-height: 44px; animation: upgPulse 2.4s ease-in-out infinite; }
#hud .hud-upg::before, #hud .hud-upg::after { display: none; }
.hud-upg img, .hud-upg svg { width: 26px; height: 26px; }
@keyframes upgPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
html.mob #hud .hud-upg { padding: 4px 6px; min-height: 40px; }
#hud .hud-upg .s { display: none; }
html.mob #hud .hud-upg .l { display: none; }
html.mob #hud .hud-upg .s { display: inline; font-size: 12px; }
@media (prefers-reduced-motion: reduce) { #hud .hud-upg { animation: none; } }

/* ===== Bảng giá: giá gốc gạch ngang ===== */
.pro-plan { position: relative; }
.pro-was { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.pro-was s { font-size: 15px; color: var(--muted); text-decoration-thickness: 2px; }
.pro-was em { font-style: normal; font-weight: 800; font-size: 12px; color: #fff; background: #e5484d; padding: 1px 6px; }
.pro-best { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-style: normal; font-size: 12px; font-weight: 800; color: #fff; background: #e5484d; padding: 2px 8px; box-shadow: 0 0 0 2px var(--line); }
.pro-plans { margin-top: 16px; }

/* lời mời tạo tài khoản khi chơi demo: ẩn nút nổi "Chơi miễn phí ngay" trong lúc hiện để khỏi chồng nhau */
body:has(.toast-nudge) .free-cta { display: none; }
.toast-nudge { flex-wrap: wrap; justify-content: center; background: #2a2347; box-shadow: 0 0 0 3px var(--line), 0 0 0 6px var(--gold); }
.toast-nudge .grow { flex: 1 1 200px; font-size: 15px; line-height: 1.35; }
.toast-nudge b { color: #ffe27a; }
html.mob .toast-nudge .btn { flex: 1 0 100%; }
.pro-plans { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.pro-plan { min-width: 0; }
.pro-was { flex-wrap: wrap; justify-content: center; }
html.mob .pro-was s { font-size: 13px; }
html.mob .pro-plan .num { font-size: 19px; }
html.mob .pro-best { font-size: 11px; }

/* ===== Điện thoại: nút game + rương lên trên, 2 nút mũi tên di chuyển ở dưới ===== */
html:not(.desk) .game-btn { top: calc(var(--hud-h) + 6px) !important; bottom: auto !important; left: 10px !important; height: 40px; }
html:not(.desk) .hero-inv.closed { top: calc(var(--hud-h) - 4px); bottom: auto; right: 8px; }
#walk-pad { position: absolute; left: 10px; right: 10px; bottom: calc(var(--nav-h) + 10px); z-index: 23; display: flex; justify-content: space-between; pointer-events: none; }
#walk-pad[hidden], html.desk #walk-pad, body.desk-modal #walk-pad { display: none; }
.wp-btn { pointer-events: auto; width: 64px; height: 64px; display: grid; place-items: center; padding: 0; border: 0; cursor: pointer; background: rgba(42, 35, 71, .72); box-shadow: 0 0 0 3px var(--line), inset 0 -5px 0 rgba(0,0,0,.3); touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.wp-btn img, .wp-btn svg { width: 36px; height: 36px; pointer-events: none; }
.wp-btn.on { background: var(--gold); transform: translateY(3px); box-shadow: 0 0 0 3px var(--line), inset 0 -2px 0 rgba(0,0,0,.3); }

/* ===== Bảng giá Pro (v2): tương phản rõ, badge xanh, 3 gói, so sánh Free ===== */
.pro-perks { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; }
.pro-perks .pp, .pro-why .pp { display: flex; align-items: flex-start; gap: 10px; }
.pro-perks .pp > img, .pro-perks .pp > svg, .pro-why .pp > img, .pro-why .pp > svg { flex: none; width: 32px; height: 32px; }
.pro-perks .pp b, .pro-why .pp b { display: block; font-size: 15px; }
.pro-perks .pp small, .pro-why .pp small { display: block; font-size: 13px; font-weight: 700; opacity: .8; line-height: 1.35; }
.pro-cmp { width: calc(100% - 8px); margin: 0 4px 14px; border-collapse: collapse; font-weight: 700; font-size: 14px; }
.pro-cmp th, .pro-cmp td { padding: 6px 10px; text-align: center; border-bottom: 2px dashed rgba(127,127,127,.3); }
.pro-cmp td:first-child, .pro-cmp th:first-child { text-align: left; }
.pro-cmp th { font-size: 15px; }
.pro-cmp .pro { background: rgba(255, 213, 74, .18); color: inherit; }
.pro-cmp th.pro { background: #ffd54a; color: #2a2347; }
.pro-cmp img, .pro-cmp svg { width: 20px; height: 20px; vertical-align: middle; }
.pro-plans { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 18px; }
.pro-plan, .pro-plan.on { background: #fff8e6; color: #2a2347; }
.pro-plan b { color: #2a2347; }
.pro-plan .num { color: #b0700a; }
.pro-plan small { color: #5d5670; }
.pro-plan.on { background: #fff1b8; box-shadow: 0 0 0 4px var(--line), inset 0 0 0 4px #2fa84f; }
.pro-was s { color: #8a8299; }
.pro-was em, .pro-best { background: #2fa84f; }
.pro-best { color: #fff; }
html.mob .pro-plans { grid-template-columns: 1fr; gap: 14px; }
html.mob .pro-plan { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "n p" "w s"; align-items: center; text-align: left; padding: 12px 12px 10px; gap: 2px 8px; }
html.mob .pro-plan b { grid-area: n; }
html.mob .pro-plan .pro-was { grid-area: w; justify-content: flex-start; }
html.mob .pro-plan > .num { grid-area: p; text-align: right; }
html.mob .pro-plan small { grid-area: s; text-align: right; }
html.mob .pro-best { left: auto; right: 12px; transform: none; }
html.mob .pro-cmp { font-size: 13px; }
html.mob .pro-cmp th, html.mob .pro-cmp td { padding: 5px 6px; }
/* Màn hình QR */
.pro-timer { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 4px 12px; padding: 8px 12px; background: #2fa84f; color: #fff; font-weight: 800; box-shadow: 0 0 0 3px var(--line); }
.pro-timer img, .pro-timer svg { width: 28px; height: 28px; }
.pro-timer .num { font-size: 22px; letter-spacing: 1px; }
.pro-timer.hot { background: #e5484d; }
.pro-qr .qr-info > div > img, .pro-qr .qr-info > div > svg { width: 22px; height: 22px; flex: none; }
.pro-qr .qr-info span { min-width: 96px; }
.pro-wait { align-items: center; }
.pro-why { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 14px; margin: 4px 4px 12px; }
html.mob .pro-why { grid-template-columns: 1fr; }
.pro-perks .pp > span, .pro-why .pp > span { display: block; min-width: 0; }
body:has(.modal-back) .free-cta { display: none; }
html.mob .pro-qr .qr-info { min-width: 0; flex: 1 1 100%; font-size: 14px; }
html.mob .pro-qr .qr-info > div { flex-wrap: nowrap; gap: 6px; }
html.mob .pro-qr .qr-info span { min-width: 82px; flex: none; }
html.mob .pro-qr .qr-info b { min-width: 0; overflow-wrap: anywhere; }
html.mob .pro-qr .qr-info .btn.sm { flex: none; min-height: 28px; padding: 2px 8px; font-size: 12px; margin-left: auto; }

/* ===== Popup giới thiệu v2: khung cố định, nút không nhảy chỗ, ảnh thật to rõ ===== */
.onb.intro .onb-in { width: min(900px, 100%); height: min(600px, 100%); max-height: none; display: flex; flex-direction: column; padding: 18px 22px 16px; }
.intro-main { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 26px; align-items: center; overflow: hidden; }
.intro-main .intro-img { height: 100%; max-height: 460px; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 8px; background: rgba(0,0,0,.06); box-shadow: 0 0 0 3px var(--line); }
.intro-main .intro-img img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 0; box-shadow: 0 0 0 2px var(--line); background: none; image-rendering: auto; }
.intro-main .intro-txt { min-height: 0; overflow-y: auto; }
.intro-main .intro-txt .h1 { font-size: 27px; line-height: 1.2; margin-bottom: 10px; }
.intro-main .intro-kick { font-size: 13px; color: #e5484d; margin-bottom: 6px; }
.intro-main .intro-s { font-size: 17px; line-height: 1.55; font-weight: 700; margin: 0; }
.intro-main.intro-end { display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 4px; padding: 0 10px; }
.intro-end .h1 { font-size: 28px; max-width: 560px; line-height: 1.25; }
.intro-end .intro-s { max-width: 520px; margin: 6px 0 18px; opacity: .85; }
.intro-end .intro-cta .btn { min-width: 230px; }
.intro-foot { flex: none; display: grid; grid-template-columns: 170px minmax(0, 1fr) 170px; align-items: center; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 3px dashed var(--panel-d); }
.intro-foot .btn { width: 100%; min-width: 0; min-height: 52px; }
.intro-foot .intro-ph { display: block; }
.intro-dots { display: flex; justify-content: center; gap: 8px; margin: 0 !important; flex: none; }
.intro-dots i { width: 30px; height: 10px; cursor: pointer; background: rgba(127,127,127,.3); box-shadow: 0 0 0 2px var(--line); }
.intro-dots i.on { background: var(--gold); }
html:not(.desk) .onb.intro .onb-in { height: 100%; padding: 12px 12px 12px; }
html:not(.desk) .intro-main { grid-template-columns: 1fr; grid-template-rows: minmax(0, 46%) minmax(0, 1fr); gap: 12px; align-items: stretch; }
html:not(.desk) .intro-main .intro-img { max-height: none; padding: 6px; }
html:not(.desk) .intro-main .intro-txt .h1 { font-size: 21px; margin-bottom: 6px; }
html:not(.desk) .intro-main .intro-s { font-size: 15px; line-height: 1.5; }
html:not(.desk) .intro-main.intro-end { display: flex; }
html:not(.desk) .intro-end .h1 { font-size: 22px; }
html:not(.desk) .intro-end .intro-cta { flex-direction: column; }
html:not(.desk) .intro-end .intro-cta .btn { width: 100%; min-width: 0; }
html:not(.desk) .intro-foot { grid-template-columns: 104px minmax(0, 1fr) 104px; gap: 6px; }
html:not(.desk) .intro-foot .btn { min-height: 46px; padding-left: 6px; padding-right: 6px; font-size: 15px; }
html:not(.desk) .intro-dots { gap: 5px; }
html:not(.desk) .intro-dots i { width: 16px; height: 8px; }
.intro-main .intro-img { padding: 0; background: none; box-shadow: none; }
.intro-main .intro-img img { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: contain; box-shadow: none; filter: drop-shadow(0 0 0 var(--line)) drop-shadow(3px 0 0 var(--line)) drop-shadow(-3px 0 0 var(--line)) drop-shadow(0 3px 0 var(--line)) drop-shadow(0 -3px 0 var(--line)); }
html:not(.desk) .intro-main { grid-template-rows: minmax(0, 58%) minmax(0, 1fr); }
html:not(.desk) .intro-main.intro-end { align-items: center; justify-content: center; }
html:not(.desk) .intro-end .intro-cta { flex-direction: column-reverse; }

/* ===== Popup giới thiệu v3: gọn, nút mũi tên chỉ icon ===== */
.onb.intro .onb-in { width: min(780px, 100%); height: min(500px, 100%); }
.intro-main { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.intro-main .intro-img { max-height: 380px; }
.intro-main .intro-txt .h1 { font-size: 28px; }
.intro-main .intro-s { font-size: 18px; }
.intro-foot { grid-template-columns: 56px minmax(0, 1fr) 56px; }
.intro-foot .btn.icon { width: 56px; height: 56px; min-height: 56px; padding: 0; display: grid; place-items: center; }
.intro-foot .btn.icon img, .intro-foot .btn.icon svg { width: 30px; height: 30px; }
.intro-skip { position: absolute; top: 10px; right: 12px; z-index: 2; border: 0; background: none; padding: 4px 6px; font: inherit; font-size: 14px; font-weight: 800; color: var(--muted); cursor: pointer; text-decoration: underline; }
.intro-dots i { width: 22px; }
html:not(.desk) .onb.intro { align-items: center; }
html:not(.desk) .onb.intro .onb-in { width: min(360px, 100%); height: min(470px, 100%); padding: 12px; }
html:not(.desk) .intro-main { grid-template-rows: 230px minmax(0, 1fr); gap: 10px; }
html:not(.desk) .intro-main .intro-txt { text-align: center; padding-top: 2px; }
html:not(.desk) .intro-main .intro-txt .h1 { font-size: 20px; margin-bottom: 4px; }
html:not(.desk) .intro-main .intro-s { font-size: 15px; line-height: 1.45; }
html:not(.desk) .intro-foot { grid-template-columns: 48px minmax(0, 1fr) 48px; margin-top: 8px; padding-top: 8px; }
html:not(.desk) .intro-foot .btn.icon { width: 48px; height: 48px; min-height: 48px; padding: 0; }
html:not(.desk) .intro-dots { gap: 4px; }
html:not(.desk) .intro-dots i { width: 12px; height: 8px; }
html:not(.desk) .intro-logo { width: 64px; height: 64px; }
html:not(.desk) .intro-brand { font-size: 20px; margin: 2px 0 6px; }
html:not(.desk) .intro-end .h1 { font-size: 20px; }
html:not(.desk) .intro-end .intro-s { margin: 4px 0 12px; font-size: 15px; }
html:not(.desk) .intro-end .intro-cta .btn { min-height: 48px; font-size: 16px; }
html:not(.desk) .intro-skip { top: 6px; right: 8px; }

/* ===== Bảng giá v3: 4 thẻ tối giản, so sánh ngay trên thẻ ===== */
.pro-plans { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 10px; margin: 14px 2px 12px; }
.pro-plan, html.mob .pro-plan { display: flex !important; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 16px 10px 12px; min-width: 0; }
.pro-plan .pc-ic { width: 44px; height: 44px; display: grid; place-items: center; margin-bottom: 4px; background: #fff; box-shadow: 0 0 0 2px var(--line); }
.pro-plan .pc-ic img, .pro-plan .pc-ic svg { width: 30px; height: 30px; }
.pro-plan b { font-size: 15px; }
.pro-plan .pro-was { min-height: 20px; justify-content: center !important; }
.pro-plan > .num, html.mob .pro-plan > .num { font-size: 20px; text-align: center; }
.pro-plan small, html.mob .pro-plan small { font-size: 12px; text-align: center; min-height: 16px; }
.pro-plan.free { background: #efe9dc; cursor: default; box-shadow: 0 0 0 3px var(--line); }
.pro-plan.free .num { color: #5d5670; }
.pc-feat { list-style: none; margin: 10px 0 0; padding: 8px 0 0; width: 100%; border-top: 2px dashed rgba(42,35,71,.18); display: flex; flex-direction: column; gap: 5px; text-align: left; }
.pc-feat li { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: #2a2347; line-height: 1.25; }
.pc-feat li img, .pc-feat li svg { width: 16px; height: 16px; flex: none; }
.pc-feat li.off { opacity: .45; }
.pc-feat li b { font-size: inherit; }
.pro-fine { text-align: center; font-size: 12.5px; font-weight: 700; opacity: .75; margin-top: 8px; }
.ac-why { font-size: 14px; padding: 8px 10px; }
html.mob .pro-plans { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 12px 8px; }
html.mob .pro-plan { padding: 14px 8px 10px; }
html.mob .pro-plan .pc-ic { width: 38px; height: 38px; }
html.mob .pro-plan .pc-ic img, html.mob .pro-plan .pc-ic svg { width: 26px; height: 26px; }
html.mob .pro-best { left: 50% !important; right: auto !important; transform: translateX(-50%) !important; }
html.mob .pc-feat li { font-size: 12px; }

/* ===== Màn hình QR v3: tối giản ===== */
.qr-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 4px 12px; }
.qr-head small { display: block; font-size: 13px; font-weight: 800; opacity: .7; }
.qr-head > div > b { font-size: 26px; }
.qr-head .pro-timer { margin: 0; padding: 6px 12px; gap: 6px; }
.qr-head .pro-timer .num { font-size: 18px; }
.qr-head .pro-timer.end { background: #8a8299; }
.pro-qr { align-items: stretch; gap: 18px; }
.pro-qr .qr { width: 200px; height: 200px; }
.pro-qr .qr-info { gap: 0; justify-content: center; min-width: 220px; }
.pro-qr .qr-info > div { display: grid !important; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 7px 0; border-bottom: 2px dashed rgba(127,127,127,.25); }
.pro-qr .qr-info > div:last-child { border-bottom: 0; }
.pro-qr .qr-info span, html.mob .pro-qr .qr-info span { grid-column: 1; grid-row: 1; min-width: 0 !important; font-size: 12px; font-weight: 800; opacity: .7; color: inherit; }
.pro-qr .qr-info b { grid-column: 1; grid-row: 2; font-size: 16px; overflow-wrap: anywhere; }
.pro-qr .qr-info .qr-cp, html.mob .pro-qr .qr-info .qr-cp { grid-column: 2; grid-row: 1 / span 2; width: 38px; height: 38px; min-height: 38px; padding: 0; margin: 0; display: grid; place-items: center; }
.qr-cp img, .qr-cp svg { width: 22px; height: 22px; }
.qr-note { display: flex; align-items: center; gap: 8px; margin: 12px 4px 10px; font-size: 13.5px; font-weight: 700; }
.qr-note img, .qr-note svg { width: 22px; height: 22px; flex: none; }
.qr-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 4px; }
.qr-foot .btn img, .qr-foot .btn svg { width: 22px; height: 22px; }
.qr-st { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; opacity: .75; text-align: right; }
.qr-st img, .qr-st svg { width: 18px; height: 18px; }
html.mob .pro-qr .qr { width: 180px; height: 180px; }
html.mob .pro-qr .qr-info { flex: 1 1 100%; min-width: 0; }
.pro-plan .pro-was { flex-wrap: nowrap !important; gap: 4px; }
.pro-plan .pro-was s, html.mob .pro-plan .pro-was s { font-size: 12.5px; }
.pro-plan .pro-was em { font-size: 11px; padding: 1px 4px; }
.pc-feat li b { font-size: 15px; line-height: 1; }

/* free-cta: canh giữa bằng translate riêng, để hiệu ứng bấm (.btn:active) không làm nút nhảy */
.free-cta { transform: none; translate: -50% 0; animation-name: ctaPulse2; }
.free-cta:active, .free-cta.is-down { transform: translateY(4px); animation: none; }
@keyframes ctaPulse2 { 50% { scale: 1.06; } }

/* gợi ý di chuyển nhân vật, phía trên dòng "Hoàn thành nhiệm vụ..." */
#dirt-done .dd-move { position: absolute; transform: translateX(-50%); white-space: nowrap; pointer-events: none; font-weight: 700; font-size: 13px; color: rgba(255,246,224,.78); display: flex; align-items: center; }
#dirt-done .dd-move kbd { display: inline-block; min-width: 22px; padding: 1px 5px; margin: 0 1px; font: inherit; font-weight: 800; text-align: center; color: #fff6e0; background: rgba(42,24,12,.85); box-shadow: 0 0 0 2px #2a180c, inset 0 -2px 0 rgba(0,0,0,.35); }
#dirt-done .dd-move .mv-mob { display: none; }
html:not(.desk) #dirt-done .dd-move .mv-desk { display: none; }
html:not(.desk) #dirt-done .dd-move .mv-mob { display: inline; }
/* mobile: nút "Tạo tài khoản thật" 1 dòng, nằm trên 2 nút di chuyển, không đè lên */
@media (max-width: 760px) { .free-cta { white-space: nowrap; bottom: calc(var(--nav-h) + 86px); font-size: 15px; padding: 8px 16px; } }
/* mobile: 2 nút di chuyển nằm giữa khung (ngang tầm nhân vật) */
#walk-pad { top: 50%; bottom: auto; transform: translateY(-50%); }

/* ===== Trang Tiến độ (thống kê) chuẩn mobile ===== */
html.mob #walk-pad .wp-btn { width: 56px; height: 56px; background: rgba(255, 246, 224, .82); }
html.mob #walk-pad .wp-btn.on { background: var(--gold); }
html.mob #page-progress #psub > * { margin: 0 0 12px; }
html.mob #page-progress #psub .pair2 { display: block; margin: 0; }
html.mob #page-progress #psub .pair2 > .panel { margin: 0 0 12px; }
html.mob #page-progress .panel.pbox { padding: 12px; }
html.mob #page-progress .ttl { font-size: 17px; }
html.mob #page-progress .insight { font-size: 15px; padding: 10px 12px; }
html.mob #page-progress .insight > :first-child { width: 36px; height: 36px; flex: none; }
html.mob #page-progress #jr-open { display: flex; width: 100%; justify-content: center; margin: 0 0 12px; font-size: 17px; }
html.mob #page-progress #psub > .big-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
html.mob #page-progress #psub .bstat { flex-direction: column; justify-content: center; text-align: center; gap: 4px; padding: 10px 4px; min-height: 0; }
html.mob #page-progress #psub .bstat > :first-child { width: 28px; height: 28px; }
html.mob #page-progress #psub .bstat > div { min-width: 0; width: 100%; }
html.mob #page-progress #psub .bstat .num { font-size: 20px; }
html.mob #page-progress #psub .bstat small { font-size: 12px; line-height: 1.25; white-space: normal; }
html.mob #page-progress .ch-legend { font-size: 13px; gap: 4px 10px; }
html.mob #page-progress .ch-info { font-size: 13px; }
html.mob #page-progress .cal { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; padding: 3px; }
html.mob #page-progress .cal .c { min-height: 0; font-size: 14px; box-shadow: 0 0 0 2px var(--line), inset 0 -3px 0 rgba(0,0,0,.18); }
html.mob #page-progress .cal .dh { font-size: 12px; }
/* nút tạo tài khoản khi xem demo: 2 dòng, dòng nhỏ báo "Đây là bản demo" */
.free-cta .cta-tx { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; text-align: left; }
.free-cta .cta-tx small { font-size: 12px; font-weight: 800; opacity: .75; letter-spacing: .2px; }
@media (max-width: 760px) { .free-cta .cta-tx small { font-size: 11px; } .free-cta { padding: 6px 16px; bottom: calc(var(--nav-h) + 86px); } }
@media (max-width: 760px) { .free-cta { top: 172px; bottom: auto; } }

/* ===== Slide cuối: nút chính nằm ở chân popup (đúng vị trí nút Tiếp) ===== */
.intro-foot.last { grid-template-columns: 56px minmax(0, 1fr); }
html:not(.desk) .intro-foot.last { grid-template-columns: 48px minmax(0, 1fr); }
.intro-foot .intro-main-cta { width: 100%; white-space: nowrap; }
.intro-foot .intro-main-cta span { overflow: hidden; text-overflow: ellipsis; }
html:not(.desk) .intro-foot .intro-main-cta { font-size: 15px; gap: 6px; }
.intro-end .intro-cta .btn { min-width: 200px; }
html:not(.desk) .intro-end .intro-cta { flex-direction: row; }
html:not(.desk) .intro-end .intro-cta .btn { min-height: 44px; font-size: 15px; width: auto; min-width: 0; padding-left: 16px; padding-right: 16px; }
html:not(.desk) .intro-main.intro-end { justify-content: center; gap: 2px; overflow: hidden; }
html:not(.desk) .intro-logo { width: 56px; height: 56px; }
html:not(.desk) .intro-end .intro-s { margin: 2px 0 10px; }
html:not(.desk) .intro-end .intro-login { margin-top: 8px; font-size: 14px; }

/* nút Đăng nhập / Đăng ký dưới popup giới thiệu */
.onb.intro { flex-direction: column; gap: 12px; }
.intro-auth { display: flex; gap: 10px; width: min(780px, 100%); justify-content: center; flex: none; }
.intro-auth .btn { min-width: 150px; min-height: 46px; }
html:not(.desk) .intro-auth { width: min(360px, 100%); }
html:not(.desk) .intro-auth .btn { flex: 1 1 0; min-width: 0; }
/* màn đóng popup khi chưa đăng nhập: 2 nút Đăng ký / Đăng nhập */
.intro-gate { gap: 8px; }
.intro-gate .intro-cta { flex-direction: column; width: min(300px, 100%); gap: 10px; margin-top: 12px; }
.intro-gate .intro-cta .btn { width: 100%; min-width: 0; }
.intro-gate .intro-again { margin-top: 14px; font-weight: 800; text-decoration: underline; cursor: pointer; }
.intro-auth { display: none; }
html:not(.desk) .intro-gate .intro-cta { flex-direction: column; }
html:not(.desk) .intro-gate .intro-cta .btn { width: 100%; min-height: 48px; }
/* dấu X đè lên viền góc phải trên của popup */
.onb.intro .onb-in { overflow: visible; }
.intro-x { top: -14px; right: -14px; z-index: 5; box-shadow: 0 0 0 3px var(--line), inset 0 -4px 0 rgba(0,0,0,.2); background: #e5484d; }
.intro-x img, .intro-x svg { filter: brightness(0) invert(1); }
html:not(.desk) .intro-x { top: -12px; right: -10px; }

/* ===== Bàn phím ảo trên điện thoại: khung luôn nằm trong vùng nhìn thấy ===== */
html.kb-open .modal-back, html.kb-open .onb { top: var(--vvt, 0px); bottom: auto; height: var(--vvh, 100%); inset-inline: 0; }
html.kb-open .modal-back { padding-top: 30px; padding-bottom: 8px; align-items: center; }
html.kb-open .dialog { max-height: calc(100% - 8px); }
html.kb-open .dialog .body { -webkit-overflow-scrolling: touch; overscroll-behavior: contain; scroll-padding: 12px 0 70px; }
html.kb-open .onb-body { scroll-padding: 12px 0 70px; }
html.kb-open .onb .onb-in { max-height: 100%; }
html.kb-open .screen { bottom: var(--kb, 0px); scroll-padding-bottom: 80px; }
html.kb-open .screen.full { top: var(--vvt, 0px); }
html.kb-open #nav, html.kb-open #walk-pad, html.kb-open .free-cta, html.kb-open .hud-upg { display: none !important; }
html.kb-open .screen { padding-bottom: 90px; }
.txt, input, textarea, select { scroll-margin: 90px 0; font-size: max(16px, 1em); }   /* 16px: iOS không tự zoom khi bấm vào ô nhập */

/* ===== Thiết lập nhân vật lần đầu: khung cố định, chân popup 3 ô cố định ===== */
.onb:not(.intro) .onb-in { width: min(780px, 100%); height: min(660px, 100%); max-height: none; }
html:not(.desk) .onb:not(.intro) .onb-in { width: min(420px, 100%); height: min(680px, 100%); }
.onb:not(.intro) .onb-body { flex: 1 1 0; min-height: 0; overflow-y: auto; }
.onb .onb-foot { display: grid; grid-template-columns: 56px minmax(0, 1fr) 56px; align-items: center; gap: 10px; flex-wrap: nowrap; }
.onb .onb-foot .btn.icon { width: 56px; min-width: 0; height: 56px; min-height: 56px; padding: 0; display: grid; place-items: center; }
.onb .onb-foot .btn.icon img, .onb .onb-foot .btn.icon svg { width: 30px; height: 30px; }
.onb .onb-foot .onb-ph { display: block; }
.onb .onb-foot .onb-cnt { text-align: center; font-weight: 800; font-size: 14px; opacity: .7; }
html:not(.desk) .onb .onb-foot { grid-template-columns: 48px minmax(0, 1fr) 48px; }
html:not(.desk) .onb .onb-foot .btn.icon { width: 48px; min-height: 48px; height: 48px; flex: none; }
.cr-sub.txt { width: auto; flex: 1 1 0; min-width: 0; padding: 0 12px; font: inherit; font-weight: 800; font-size: 15px; color: inherit; }
.cr-subtabs { margin-bottom: 8px; }
.wm-btns { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.wm-btns .btn { width: 100%; }
.txt::placeholder, input::placeholder, textarea::placeholder { font-size: 13px; font-weight: 600; opacity: .4; }
.onb .onb-foot.first { grid-template-columns: 1fr; }
.onb .onb-foot.first .btn { width: 100%; height: 56px; min-height: 56px; padding: 0 14px; display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 17px; }
html:not(.desk) .onb .onb-foot.first .btn { height: 48px; min-height: 48px; font-size: 16px; }
html:not(.desk) .onb .onb-foot.first { grid-template-columns: 1fr; }
html:not(.desk) .onb .onb-foot.first .btn { width: 100%; flex: none; white-space: nowrap; }
.cr-subtabs { width: 100%; max-width: 380px; margin: 6px auto 8px; flex-wrap: nowrap; }
.cr-sub.txt { height: 44px; white-space: nowrap; flex: 1 1 0; }
/* sub-tab nhỏ gọn có icon */
.cr-subtabs { max-width: 300px; gap: 6px; margin: 2px auto 8px; }
.cr-sub.txt { height: 34px; display: flex; align-items: center; justify-content: center; gap: 5px; padding: 0 8px; font-size: 14px; }
.cr-sub.txt svg, .cr-sub.txt img { width: 18px; height: 18px; flex: none; }

/* điện thoại: bỏ làm mờ nền (nặng GPU, gây giật khi vuốt) */
html.mob .screen, html.mob .hero-radar.pbox, html.mob .hero-list.pbox { backdrop-filter: none; -webkit-backdrop-filter: none; }
html.mob .page, html.mob .screen { will-change: scroll-position; }
html.mob .qrow { content-visibility: auto; contain-intrinsic-size: auto 64px; }

/* điện thoại: nút "Thêm chậu" phía trên bục đang đứng; bỏ nút + nhỏ ở góc bục */
html:not(.desk) #garden .bed-add { display: none !important; }
#bed-addpot { position: absolute; z-index: 6; transform: translateX(-50%); display: none; align-items: center; justify-content: center; gap: 5px; height: 34px; padding: 0 14px; white-space: nowrap; pointer-events: auto; cursor: pointer; border: 3px dashed rgba(255,246,224,.95); background: rgba(120,72,40,.55); color: #fff; box-shadow: inset 0 3px 0 rgba(255,246,224,.25); }
#bed-addpot b { font-size: 13px; font-weight: 800; text-shadow: -2px 0 0 #2a180c, 2px 0 0 #2a180c, 0 -2px 0 #2a180c, 0 2px 0 #2a180c; }
#bed-addpot img, #bed-addpot svg { width: 20px; height: 20px; }
html:not(.desk) #bed-addpot:not([hidden]) { display: flex; }
html.desk #bed-addpot { display: none !important; }
/* 2 nút mũi tên: thấp hơn và cách mép xa hơn */
html.mob #walk-pad { top: 60%; left: 22px; right: 22px; }

/* ===== điện thoại: tab Lĩnh vực, trang ngoài không cuộn, thẻ chậu nhỏ, nút mũi tên sát thanh menu ===== */
html:not(.desk) #page-hero .hero-info { display: none; }
html:not(.desk) #page-hero { overflow: hidden; }
.areas-pg { padding: 4px 4px 12px; }
.areas-h { display: flex; align-items: center; gap: 8px; margin: 6px 6px 10px; font-size: 20px; color: var(--text, #2a2238); }
html:not(.desk) .areas-pg .hero-list { gap: 12px; padding: 14px 12px; }
html:not(.desk) .pot-card { width: 214px; padding: 6px 8px 7px; }
html:not(.desk) .pot-card .pc-h b { font-size: 14px; }
html:not(.desk) .pot-card .pc-h > svg, html:not(.desk) .pot-card .pc-h > img { width: 22px; height: 22px; }
html:not(.desk) .pot-card .pc-lv { margin: 4px 0 5px; }
html:not(.desk) .pot-card .pc-list { max-height: 96px; gap: 3px; }
html:not(.desk) .pot-card .pc-q { padding: 3px 6px; font-size: 12px; gap: 6px; }
html:not(.desk) .pot-card .pc-q > svg, html:not(.desk) .pot-card .pc-q > img { width: 18px; height: 18px; }
html:not(.desk) .pot-card .pc-add { font-size: 12px; padding: 4px 8px; min-height: 0; }
html.mob #walk-pad { top: auto; bottom: calc(var(--nav-h) + 14px); transform: none; }

/* ===== hướng dẫn nhanh (tour) ===== */
.tour { position: fixed; inset: 0; z-index: 8000; }
.tour-hole { position: fixed; border: 3px solid #ffd54a; box-shadow: 0 0 0 9999px rgba(20,14,36,.72); pointer-events: none; }
.tour-card { position: fixed; padding: 12px 14px 12px; color: #3b2614; background: #fff8ea; box-shadow: 0 0 0 3px #22192e, inset 0 -4px 0 #e6cfa8; }
.tour-t { display: block; font-size: 18px; margin: 0 22px 4px 0; }
.tour-d { margin: 0 0 10px; font-size: 15px; line-height: 1.4; font-weight: 600; }
.tour-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tour-n { font-size: 13px; color: #7a5a3a; }
.tour-next { min-height: 40px; padding: 0 14px; font-size: 15px; }
.tour-x { position: absolute; right: -10px; top: -10px; width: 28px; height: 28px; padding: 0; border: 0; cursor: pointer; font: 800 20px/28px var(--font, inherit); color: #fff; background: #d9473f; box-shadow: 0 0 0 3px #22192e, inset 0 -3px 0 #a52f29; }
body.tour-on .pot-card, body.tour-on #bed-addpot { display: none !important; }

/* người mới: chưa mở khóa rương, game, phần thưởng */
body.newbie #game-btn { display: none !important; }

/* mũi tên chỉ đường cho người mới */
.coach { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.coach[hidden] { display: none; }
.coach-ring { position: fixed; border: 4px solid #ffd54a; box-shadow: 0 0 0 4px #22192e, 0 0 18px 4px rgba(255,213,74,.8); animation: coachPulse 1s steps(2) infinite; }
.coach-tip { position: fixed; width: 200px; padding: 8px 10px; text-align: center; color: #3b2614; background: #ffd54a; box-shadow: 0 0 0 3px #22192e, inset 0 -4px 0 #d9932a; animation: coachBob .8s ease-in-out infinite; }
.coach-tip b { display: block; font-size: 17px; }
.coach-tip span { display: block; font-size: 13px; font-weight: 700; }
.coach-tip i { position: absolute; left: 50%; bottom: -12px; margin-left: -9px; border: 9px solid transparent; border-top-color: #22192e; border-bottom: 0; }
.coach-tip.below i { bottom: auto; top: -12px; border-top-color: transparent; border-bottom: 9px solid #22192e; border-top-width: 0; }
@keyframes coachPulse { 50% { opacity: .45; } }
@keyframes coachBob { 50% { transform: translateY(5px); } }

/* điện thoại: dấu check xong nhiệm vụ không bị cắt ở mép phải */
html:not(.desk) .qrow .qdone .qbadge { right: 2px; width: 40px; height: 40px; margin-top: -20px; }
html:not(.desk) .qrow .qdone .qbadge img { width: 40px; height: 40px; }
html:not(.desk) .qrow.done { padding-right: 46px; }

/* điện thoại: bỏ hiệu ứng chuyển trang */
html:not(.desk) .page.enter-r, html:not(.desk) .page.enter-l { animation: none !important; }
/* điện thoại: trang Tiến độ gọn: số liệu lên đầu, biểu đồ thấp, nút Hành trình xuống cuối */
html:not(.desk) #page-progress #psub { display: flex; flex-direction: column; }
html:not(.desk) #page-progress #psub > .big-stats { order: 1; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0 4px 8px; }
html:not(.desk) #page-progress #psub .bstat { flex-direction: column; justify-content: center; text-align: center; gap: 2px; min-height: 0; padding: 8px 4px; margin: 0; }
html:not(.desk) #page-progress #psub .bstat > :first-child { width: 28px; height: 28px; }
html:not(.desk) #page-progress #psub .bstat .num { font-size: 20px; }
html:not(.desk) #page-progress #psub .bstat small { font-size: 12px; }
html:not(.desk) #page-progress #psub > .xp-top { order: 2; margin: 0 4px 8px; }
html:not(.desk) #page-progress #psub > .insight { order: 3; margin: 0 4px 8px; padding: 8px 10px; font-size: 14px; }
html:not(.desk) #page-progress #psub > .insight > :first-child { width: 28px; height: 28px; }
html:not(.desk) #page-progress #psub > .pair2 { order: 4; display: block; }
html:not(.desk) #page-progress #psub > .pair2 > .panel { margin: 0 4px 8px; }
html:not(.desk) #page-progress #psub > .jr-btn { order: 5; margin: 0 4px 8px; width: auto; }
html:not(.desk) #page-progress .ch-info { display: none; }
html:not(.desk) #page-progress .ch-legend { font-size: 12px; gap: 4px 8px; }

/* điện thoại: popup chi tiết nhiệm vụ nhỏ gọn */
html:not(.desk) .qd-dlg .body { max-height: 66vh; }
html:not(.desk) .qd-dlg .detail-hero { padding: 6px; gap: 8px; margin: 0 0 6px; box-shadow: 0 0 0 3px var(--line); }
html:not(.desk) .qd-dlg .detail-hero .plate { width: 44px; height: 44px; box-shadow: 0 0 0 3px var(--line); }
html:not(.desk) .qd-dlg .detail-hero .plate img, html:not(.desk) .qd-dlg .detail-hero .plate svg { width: 30px; height: 30px; }
html:not(.desk) .qd-dlg .qd-tags .mini { min-height: 32px !important; font-size: 12px; padding: 2px 6px 2px 3px; }
html:not(.desk) .qd-dlg .big-stats { margin: 0 0 6px; gap: 4px; }
html:not(.desk) .qd-dlg .big-stats.row1 .bstat { min-height: 0; padding: 4px 6px; margin: 0; gap: 4px; }
html:not(.desk) .qd-dlg .big-stats.row1 .bstat > img:first-child, html:not(.desk) .qd-dlg .big-stats.row1 .bstat > svg:first-child { width: 22px; height: 22px; }
html:not(.desk) .qd-dlg .big-stats.row1 .bstat .num { font-size: 16px; }
html:not(.desk) .qd-dlg .big-stats.row1 .bstat small { font-size: 11px; }
html:not(.desk) .qd-dlg .qd-today { min-height: 42px; font-size: 16px; }
html:not(.desk) .qd-dlg .qd-done-row { margin: 0 0 6px; }
html:not(.desk) .qd-dlg .panel { padding: 8px; }
html:not(.desk) .qd-dlg .ttl { font-size: 15px; margin-bottom: 4px; }
html:not(.desk) .qd-dlg .cal { grid-template-columns: repeat(7, 1fr); gap: 3px; }
html:not(.desk) .qd-dlg .cal .c { min-height: 0; font-size: 11px; box-shadow: 0 0 0 2px var(--line), inset 0 -3px 0 rgba(0,0,0,.18); }
html:not(.desk) .qd-dlg .cal .dh { font-size: 11px; }
html:not(.desk) .qd-dlg .actions { gap: 10px; }
html:not(.desk) .qd-dlg .actions .btn { min-height: 44px; }
html:not(.desk) .qd-dlg .actions .btn.icon, html:not(.desk) .qd-dlg .actions .btn.r-del { width: 52px; min-width: 52px; }

/* bộ màu 1 dòng, cuộn ngang */
.swatches.one-row { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding: 6px 4px; }
.swatches.one-row::-webkit-scrollbar { display: none; }
.swatches.one-row .swatch { flex: 0 0 auto; }

/* trang tạo nhân vật trên điện thoại: vừa 1 màn hình, không cuộn */
html:not(.desk) .screen.creator-scr { display: flex; flex-direction: column; overflow: hidden; padding: 6px 12px calc(8px + env(safe-area-inset-bottom)); top: 0; bottom: 0; }
html:not(.desk) .creator-scr .scr-head { margin: 0 0 4px; gap: 8px; flex: none; }
html:not(.desk) .creator-scr .scr-head .btn.icon { min-width: 40px; min-height: 40px; width: 40px; height: 40px; padding: 0; }
html:not(.desk) .creator-scr .scr-head .h1 { font-size: 20px; }
html:not(.desk) .creator-scr .scr-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; padding: 0; }
html:not(.desk) .creator-scr #cr { flex: 1; min-height: 0; display: flex; flex-direction: column; }
html:not(.desk) .creator-scr .creator.photo { flex: 1; min-height: 0; gap: 6px; max-width: 440px; width: 100%; justify-content: flex-start; }
html:not(.desk) .creator-scr .creator.photo .cr-left { gap: 6px; flex: none; }
html:not(.desk) .creator-scr .cr-name { min-height: 36px; margin: 0 !important; }
html:not(.desk) .creator-scr .cr-name .nm { font-size: 18px; }
html:not(.desk) .creator-scr .cr-pen { min-width: 36px; min-height: 36px; }
html:not(.desk) .creator-scr .creator.photo .cr-stage, html:not(.desk) .creator-scr .creator.photo.tuned .cr-stage { min-height: 0 !important; height: 128px !important; align-items: center; overflow: visible; }
body:has(.creator-scr) .free-cta { display: none !important; }
html:not(.desk) .creator-scr .cr-sub.txt { width: auto; flex: 1; height: 36px; min-height: 0; gap: 4px; font-size: 14px; }
html:not(.desk) .creator-scr .cr-subtabs { width: 100%; flex-wrap: nowrap; }
html:not(.desk) .creator-scr .cr-stage canvas { width: 94px !important; height: 128px !important; }
html:not(.desk) .creator-scr .cr-ride { width: auto !important; height: 128px !important; max-width: 160px; object-fit: contain; }
html:not(.desk) .creator-scr .creator .cr-rand { margin: 0 auto; padding: 4px 14px; min-height: 34px; font-size: 14px; }
html:not(.desk) .creator-scr .cr-tune { flex: 1; min-height: 0; gap: 6px; }
html:not(.desk) .creator-scr .cr-tabs { margin: 0; padding: 3px; flex: none; }
html:not(.desk) .creator-scr .cr-tab { min-height: 34px; font-size: 13px; padding: 2px 4px; }
html:not(.desk) .creator-scr .cr-subtabs { margin: 0; flex: none; gap: 8px; }
html:not(.desk) .creator-scr .cr-sub { height: 36px; }
html:not(.desk) .creator-scr .tune-lbl { margin-top: 0; }
html:not(.desk) .creator-scr .hair-row { gap: 6px; max-width: 100%; justify-content: center; }
html:not(.desk) .creator-scr .hair-row .tile { width: 58px; min-width: 0; min-height: 0; height: 58px; padding: 2px; }
html:not(.desk) .creator-scr .hair-row .tile img { width: 44px; height: 44px; }
html:not(.desk) .creator-scr .swatches { gap: 8px; padding: 4px; }
html:not(.desk) .creator-scr .cr-foot { flex: none; padding: 6px 0 0; }
html:not(.desk) .creator-scr .cr-foot .btn.big { min-height: 44px; width: 100%; max-width: 440px; }
html:not(.desk) .creator-scr .ai-status, html:not(.desk) .creator-scr .photo-drop { display: none; }

/* bảng giá tối giản */
.pro-plan .pc-ic { display: none; }
.pro-plan { padding: 12px 6px; }
.pro-one { text-align: center; font-weight: 800; font-size: 14px; margin: 2px 4px 8px; }

/* nút nâng cấp mobile: chỉ icon */
html:not(.desk) #hud .hud-upg .s, html:not(.desk) #hud .hud-upg .l { display: none !important; }
html:not(.desk) #hud .hud-upg { padding: 4px 8px; min-width: 40px; justify-content: center; }

/* mobile: nút minigame nằm giữa 2 nút mũi tên */
html:not(.desk) .game-btn { top: auto !important; bottom: calc(var(--nav-h) + 22px) !important; left: 50% !important; right: auto !important; transform: translateX(-50%); height: 40px; z-index: 24; }
html:not(.desk) .game-btn:hover, html:not(.desk) .game-btn:active { transform: translateX(-50%); }

/* Cài đặt trên điện thoại: nén để vừa 1 màn hình */
html:not(.desk) .set-list { padding: 0 10px; margin: 2px 4px 4px; }
html:not(.desk) .set-row { min-height: 40px; padding-top: 3px; padding-bottom: 3px; gap: 2px 8px; border-bottom-width: 2px; grid-template-columns: 24px minmax(0, 1fr) auto; }
html:not(.desk) .set-row > img, html:not(.desk) .set-row > svg { width: 24px; height: 24px; }
html:not(.desk) .set-row .lab { font-size: 14px; }
html:not(.desk) .set-row .btn, html:not(.desk) .seg .btn { min-height: 34px; padding-top: 2px; padding-bottom: 2px; font-size: 14px; }
html:not(.desk) .set-row .btn img, html:not(.desk) .set-row .btn svg { width: 22px; height: 22px; }
html:not(.desk) .set-row .stepper .btn { min-height: 34px; min-width: 38px; }
html:not(.desk) .set-row .stepper .val { font-size: 18px; min-width: 36px; }
html:not(.desk) .set-sub { padding: 0 0 4px; }
html:not(.desk) .set-sub .small { font-size: 12px; }
html:not(.desk) .set-logo { display: none; }
html:not(.desk) #page-settings p.muted.small, html:not(.desk) .screen p.muted.small { margin: 2px 0 6px !important; font-size: 11px; }

/* mobile: các trang ngoài (nhiệm vụ, lĩnh vực, tiến độ...) nền đặc, không lộ cảnh phía sau */
html:not(.desk) body.page-other #veil { background: #fff6e4; }
html[data-mode="night"]:not(.desk) body.page-other #veil { background: #14102e; }
html:not(.desk) body.page-other #scene, html:not(.desk) body.page-other #garden, html:not(.desk) body.page-other #avatar, html:not(.desk) body.page-other #name-tag { visibility: hidden; }
html:not(.desk) body.page-other .screen { background: #fff6e4; }
html[data-mode="night"]:not(.desk) body.page-other .screen { background: #14102e; }

/* ---- Nhiệm vụ trên điện thoại ---- */
html:not(.desk) body.page-other #critters, html:not(.desk) body.page-other canvas#critters { display: none !important; }
html:not(.desk) .q-tip { text-align: center; font-weight: 800; font-size: 13px; color: var(--muted); margin: 2px 0 0; }
html:not(.desk) .daynav { position: relative; justify-content: center; gap: 6px; }
html:not(.desk) .daynav .grow { display: none; }
html:not(.desk) .q-head .dlabel { align-items: center !important; min-width: 110px; text-align: center; }
html:not(.desk) .daynav .dp-n { position: absolute; right: 0; top: 50%; transform: translateY(-50%); }
/* nút + thêm nhiệm vụ: to, ngay trên thanh menu */
html:not(.desk) #q-add { position: fixed; right: calc(var(--safe) + 2px); bottom: calc(var(--nav-h) + 14px); z-index: 22; width: 64px; height: 64px; min-width: 64px; padding: 0; justify-content: center; }
html:not(.desk) #q-add span { display: none; }
html:not(.desk) #q-add img, html:not(.desk) #q-add svg { width: 40px; height: 40px; }
/* thử thách tuần: chỉ icon, chạm mới mở */
html:not(.desk) .wk-bar:not(.open) { display: inline-flex; width: 44px; height: 36px; padding: 0; justify-content: center; cursor: pointer; }
html:not(.desk) .wk-bar:not(.open) > :not(img:first-child):not(svg:first-child) { display: none; }
html:not(.desk) .wk-bar:not(.open).ready { animation: none; box-shadow: inset 0 0 0 3px #ffc93a; }
html:not(.desk) .wk-bar.open { cursor: pointer; }

/* huy hiệu gói Free / Pro trong Cài đặt */
.plan-chip { display: flex; align-items: center; gap: 8px; padding: 6px 10px; font-weight: 800; font-size: 14px; }
.plan-chip img, .plan-chip svg { width: 28px; height: 28px; flex: none; }
.plan-chip b { font-size: 16px; letter-spacing: .5px; }
.plan-chip span { font-size: 13px; font-weight: 700; opacity: .85; }
.plan-chip.pro { background: linear-gradient(#ffe27a, #f0a92a); color: #3a2410; box-shadow: inset 0 0 0 3px #b07a12; }
.plan-chip.free { background: rgba(127,127,127,.16); color: var(--text); box-shadow: inset 0 0 0 3px rgba(127,127,127,.35); }

/* bảng giá: Free + 2 gói Pro cạnh nhau để so sánh */
.pro-plans { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.pro-plan { padding: 12px 4px 8px; }
.pro-plan .pc-ic { display: none; }
.pro-plan b { font-size: 15px; }
.pro-plan .num { font-size: 18px; }
.pro-plan small { font-size: 12px; }
.pro-plan.free { cursor: default; background: rgba(127,127,127,.12); box-shadow: inset 0 0 0 3px rgba(127,127,127,.3); }
.pc-feat { list-style: none; margin: 6px 0 0; padding: 0; text-align: left; font-size: 12px; font-weight: 700; width: 100%; }
.pc-feat li { display: flex; align-items: center; gap: 4px; }
.pc-feat li img, .pc-feat li svg { width: 16px; height: 16px; flex: none; }
.pc-feat li.off { opacity: .45; }
html.mob .pro-plan b { font-size: 13px; }
html.mob .pro-plan .num { font-size: 15px; }
html.mob .pc-feat { font-size: 11px; }

/* mobile: bỏ icon thử thách tuần ở trang Nhiệm vụ */
html:not(.desk) .wk-bar { display: none !important; }

/* popup nhiệm vụ mới: nhỏ gọn, chữ không xuống dòng */
.qf2 { gap: 8px; }
.qf2 .qf-f { gap: 4px; }
.qf2 .rf-seg .chip { white-space: nowrap; font-size: 13px; padding: 2px 4px; min-height: 34px; gap: 3px; }
.qf2 .rf-seg .chip img { width: 16px; height: 16px; flex: none; }
.qf2 .qf-coin { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
.qf2 .qf-coin img { width: 14px; height: 14px; }
.qf2 .sg-chips { flex-wrap: nowrap; overflow-x: auto; gap: 4px; scrollbar-width: none; }
.qf2 .sg-chip { flex: 0 0 auto; font-size: 12px; min-height: 28px; padding: 1px 8px; gap: 4px; white-space: nowrap; }
.qf2 .sg-chip img, .qf2 .sg-chip svg { width: 14px; height: 14px; }
.qf2 .qf-f > label, .qf2 .qf-f .lab { font-size: 12px; }
.qf2 .rf-top { gap: 6px; }
.qf2 .rf-prev { width: 48px; height: 48px; }
.qf2 .rf-prev img { width: 36px; height: 36px; }
.qf2 .sel, .qf2 .txt { min-height: 38px; }
.qf2 .qf-dow .chip { min-height: 32px; padding: 0 2px; }

/* mobile: nút minigame luôn hiện ở trang chậu cây, kể cả người mới */
html:not(.desk) body.newbie[data-page="hero"] #game-btn { display: flex !important; }
html:not(.desk) body.newbie[data-page="hero"] #game-btn[hidden] { display: none !important; }
html:not(.desk) body[data-page="hero"] #game-btn:not([hidden]) { bottom: calc(var(--nav-h) + 22px) !important; left: 50% !important; transform: translateX(-50%); z-index: 25; }

/* "Đã hoàn thành hết hôm nay" nhỏ lại */
.pc-alldone { font-size: 11px !important; gap: 3px !important; padding-top: 1px !important; padding-bottom: 1px !important; }
.pc-alldone img, .pc-alldone svg { width: 12px !important; height: 12px !important; }

/* khi thẻ chậu cây đang mở thì ẩn bong bóng hội thoại (tránh bị che chồng) */
body:has(#pot-card) #speech { display: none !important; }

/* trang nhân vật mobile: tab Phụ kiện/Thú cưỡi và màn hình thấp */
html:not(.desk) .creator-scr .acc-note, html:not(.desk) .creator-scr .tune-lbl { display: none; }
html:not(.desk) .creator-scr .acc-grid { min-height: 0; gap: 6px; }
html:not(.desk) .creator-scr .acc-grid .tile { width: 52px; height: 52px; }
html:not(.desk) .creator-scr .cr-pager { margin: 0; gap: 10px; }
html:not(.desk) .creator-scr .cr-pager .btn.icon { min-height: 30px; min-width: 40px; height: 30px; }
html:not(.desk) .creator-scr .cr-sub:not(.txt) { height: 34px; width: 52px; }
html:not(.desk) .creator-scr .scr-body { gap: 8px; }
html:not(.desk) .creator-scr .creator.photo { gap: 8px; }
@media (max-height: 720px) {
  html:not(.desk) .creator-scr .creator.photo .cr-stage, html:not(.desk) .creator-scr .creator.photo.tuned .cr-stage { height: 104px !important; }
  html:not(.desk) .creator-scr .cr-stage canvas { width: 76px !important; height: 104px !important; }
  html:not(.desk) .creator-scr .cr-ride { height: 104px !important; }
  html:not(.desk) .creator-scr .hair-row .tile { width: 52px; height: 52px; }
  html:not(.desk) .creator-scr .hair-row .tile img { width: 40px; height: 40px; }
  html:not(.desk) .creator-scr .cr-name { min-height: 30px; }
}

/* ---- KHÔNG ĐỂ NÚT DÍNH THANH MENU (mobile) ----
   --nav-h gồm cả vùng an toàn của iPhone (thanh vuốt Home), mọi nút nổi tính từ đây + khoảng thở 20px */
html:not(.desk) { --nav-h: calc(72px + max(12px, env(safe-area-inset-bottom))); --nav-gap: 20px; }
html:not(.desk) #walk-pad, html.mob #walk-pad { bottom: calc(var(--nav-h) + var(--nav-gap)) !important; }
html:not(.desk) .game-btn, html:not(.desk) body[data-page="hero"] #game-btn:not([hidden]) { bottom: calc(var(--nav-h) + var(--nav-gap) + 8px) !important; }
html:not(.desk) #q-add { bottom: calc(var(--nav-h) + var(--nav-gap)) !important; }
html:not(.desk) .hero-inv { bottom: calc(var(--nav-h) + 12px); }
html:not(.desk) .hero-inv:not(.closed) { bottom: calc(var(--nav-h) + var(--nav-gap)); }
html:not(.desk) .g-swing { bottom: calc(var(--nav-h) + var(--nav-gap)); }
html:not(.desk) .g-swing.g-jump { bottom: calc(var(--nav-h) + var(--nav-gap) + 8px); }
html:not(.desk) .dodge-timer { bottom: calc(var(--nav-h) + var(--nav-gap)); }
html:not(.desk) #store-warn { bottom: calc(var(--nav-h) + 10px); }
html:not(.desk) #toast-root { bottom: calc(var(--nav-h) + 12px); }

/* Lĩnh vực (mobile): vuốt trái hiện sửa/xóa, nút + Lĩnh vực bên dưới */
.srow-w { position: relative; overflow: hidden; }
.srow-w .sw-acts { position: absolute; right: 0; top: 0; bottom: 0; width: 96px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.srow-w .sw-acts .btn.icon { min-width: 40px; min-height: 40px; width: 40px; height: 40px; padding: 0; }
.srow-w > .srow { position: relative; z-index: 1; width: 100%; background: var(--panel, #fff6e4); transition: transform .2s; touch-action: pan-y; }
.srow-w.drag > .srow { transition: none; }
.srow-w.open > .srow { transform: translateX(-96px); }
.areas-add { position: sticky; bottom: 8px; width: 100%; margin-top: 12px; justify-content: center; }

/* popup (mobile): ghi chú chân trang nằm 1 hàng riêng phía trên nút; nút không bị kéo cao */
html:not(.desk) .dialog .actions { flex-wrap: wrap; align-items: center; }
html:not(.desk) .dialog .actions .foot-note { order: -1; flex: 1 1 100%; padding: 0 0 6px; text-align: center; }
html:not(.desk) .dialog .actions .btn { align-self: center; }
html:not(.desk) .dialog .actions .btn.sm-save { flex: 1 1 auto; min-width: 0; }
html:not(.desk) .dialog .actions .btn.r-del { width: 52px; min-width: 52px; min-height: 48px; padding: 0; justify-content: center; }

/* mobile, đang chơi game: 2 nút mũi tên dồn sang trái, nút vung đòn / nhảy ở bên phải, không đè nhau */
html:not(.desk) body.game-on #walk-pad { right: auto; left: 12px; justify-content: flex-start; gap: 10px; }
html:not(.desk) body.game-on #walk-pad .wp-btn { width: 52px; height: 52px; }
html:not(.desk) body.game-on .g-swing { right: 14px; }
html:not(.desk) body.game-on .g-swing.g-jump { right: 96px; }
.coach { display: none !important; }
.g-hint .g-mode-ic { image-rendering: pixelated; margin-bottom: 2px; max-width: 96px; height: auto; }

/* mobile, trang Nhiệm vụ: ẩn các nút trên thanh trên cùng */
html:not(.desk) body[data-page="quests"] #hud .hud-upg { display: none !important; }
html:not(.desk) body[data-page="areas"] #hud .hud-btns, html:not(.desk) body[data-page="areas"] #hud .hud-menu, html:not(.desk) body[data-page="areas"] #hud .hud-upg { display: none !important; }

/* mobile, trang Nhiệm vụ / Lĩnh vực: Lv + thanh cấp nằm ngay dưới tổng xu (bên phải avatar) */
html:not(.desk) body #hud .hud-who, html:not(.desk) body #hud .hud-who { margin-left: 62px; width: 220px; max-width: calc(100vw - 100px); }
html:not(.desk) body #hud .hud-name b, html:not(.desk) body #hud .hud-name b { display: none; }
html:not(.desk) body #hud .hud-name, html:not(.desk) body #hud .hud-name { max-width: none; }

/* mobile, trang Nhiệm vụ: thanh chọn ngày (mũi tên + Hôm nay) đưa xuống dưới thanh tiến độ, nhỏ lại */
html:not(.desk) .q-head { display: flex; flex-direction: column; }
html:not(.desk) .q-head .dayprog { order: 1; }
html:not(.desk) .q-head .daynav { order: 2; margin-top: 6px; gap: 4px; }
html:not(.desk) .q-head .q-tip { order: 3; }
html:not(.desk) .q-head .wk-bar, html:not(.desk) .q-head .row { order: 4; }
html:not(.desk) .q-head .dn-btn { min-width: 34px; min-height: 34px; width: 34px; height: 34px; padding: 0; }
html:not(.desk) .q-head .dn-btn img, html:not(.desk) .q-head .dn-btn svg { width: 18px; height: 18px; }
html:not(.desk) .q-head .dlabel { min-width: 90px; }
html:not(.desk) .q-head .dlabel b { font-size: 16px; }
html:not(.desk) .q-head .dlabel .sub { font-size: 11px; }
html:not(.desk) .daynav .dp-n b { font-size: 14px; }
html:not(.desk) .daynav .dp-n { font-size: 12px; }

/* mobile, trang Nhiệm vụ: xu + Lv ngang tầm avatar; thanh chọn ngày ghim dưới; nút + nhiệm vụ ở góc trên phải */
html:not(.desk) body #hud .hud-res { transform: translateY(-16px); }
html:not(.desk) body #hud .hud-who { transform: translateY(-34px); }
html:not(.desk) body #hud .hud-lv { font-size: 10px; padding: 0 4px; line-height: 14px; }
html:not(.desk) body #hud .bar.xp { height: 14px; }
html:not(.desk) body[data-page="quests"] .q-head .daynav { position: fixed; left: 0; right: 0; margin: 0 auto; transform: none; bottom: calc(var(--nav-h) + 12px); width: min(300px, calc(100vw - 150px)); z-index: 21; background: rgba(34,25,46,.88); padding: 4px 8px; box-shadow: 0 0 0 3px var(--line); }
html:not(.desk) body[data-page="quests"] .daynav .dp-n { position: static; transform: none; margin-left: 6px; }
html:not(.desk) body[data-page="quests"] .page#page-quests { padding-bottom: 150px; }
html:not(.desk) #q-add { position: fixed; top: calc(var(--hud-h) - 92px); bottom: auto !important; right: 14px; width: 48px; height: 48px; min-width: 48px; z-index: 22; }
html:not(.desk) #q-add img, html:not(.desk) #q-add svg { width: 30px; height: 30px; }

/* mobile, Nhiệm vụ / Lĩnh vực: "Lv" giống số xu (cùng cỡ, màu, có icon sao cùng cỡ đồng xu), không nền vàng */
.hud-lvic { display: none; }
html:not(.desk) body #hud .hud-lv, html:not(.desk) body #hud .hud-lv { display: inline-flex; align-items: center; gap: 4px; background: none !important; box-shadow: none !important; padding: 0 !important; font-size: 20px; line-height: 1; color: #ffe27a; flex: none; }
html:not(.desk) body #hud .hud-lvic, html:not(.desk) body #hud .hud-lvic { display: inline-flex; }
html:not(.desk) #hud .hud-lvic img, html:not(.desk) #hud .hud-lvic svg { width: 24px; height: 24px; }
html:not(.desk) body #hud .hud-who, html:not(.desk) body #hud .hud-who { margin-left: 56px; }
html:not(.desk) body #hud .hud-who, html:not(.desk) body #hud .hud-who { width: 190px; max-width: calc(100vw - 150px); }

/* mobile, trang Nhiệm vụ: "Hôm nay" + mũi tên ở trên cùng; thanh tiến độ ngày ghim dưới màn hình */
html:not(.desk) body[data-page="quests"] .q-head .daynav { position: relative; left: auto; right: auto; width: auto; margin: 0; padding: 0; background: none; box-shadow: none; transform: none; bottom: auto; z-index: auto; order: 1; }
html:not(.desk) body[data-page="quests"] .daynav .dp-n { position: absolute; right: 0; top: 50%; transform: translateY(-50%); margin: 0; }
html:not(.desk) body[data-page="quests"] .q-head .dayprog { position: fixed; left: 14px; right: 14px; bottom: calc(var(--nav-h) + 12px); margin: 0; order: 2; z-index: 21; background: rgba(34,25,46,.9); padding: 4px 8px; box-shadow: 0 0 0 3px var(--line); }
html:not(.desk) body[data-page="quests"] .q-head .q-tip { order: 3; }
html:not(.desk) body #hud .hud-who, html:not(.desk) body #hud .hud-who { margin-left: 58px; width: 170px; }
html:not(.desk) body #hud .hud-lvic img, html:not(.desk) body #hud .hud-lvic img { width: 24px; height: 24px; }
html:not(.desk) body #hud .hud-who, html:not(.desk) body #hud .hud-who { margin-left: 60px; width: 220px; }
html:not(.desk) body #hud .hud-lvic img, html:not(.desk) body #hud .hud-lvic img { width: 26px; height: 26px; }
html:not(.desk) body #hud .hud-who .bar.xp, html:not(.desk) body #hud .hud-who .bar.xp { width: 100px !important; max-width: 100px; left: auto; }
html:not(.desk) body #hud .hud-who, html:not(.desk) body #hud .hud-who { margin-left: 56px; }

/* mobile, trang Nhiệm vụ (bản mới): nhãn trên cùng; dưới màn hình: [<] thanh tiến trình ngày [>] */
.q-toplabel { display: none; }
html:not(.desk) .q-toplabel { display: block; text-align: center; font-weight: 800; font-size: 14px; color: var(--muted); margin: 0 0 4px; }
html:not(.desk) .q-bot { position: fixed; left: 12px; right: 12px; bottom: calc(var(--nav-h) + 12px); z-index: 21; display: flex; align-items: center; gap: 8px; padding: 4px 6px; background: rgba(34,25,46,.92); box-shadow: 0 0 0 3px var(--line); }
html:not(.desk) body[data-page="quests"] .q-bot .dayprog { position: static; flex: 1; min-width: 0; margin: 0; padding: 0; background: none; box-shadow: none; order: 0; }
html:not(.desk) .q-bot .dn-btn { flex: none; min-width: 38px; min-height: 38px; width: 38px; height: 38px; padding: 0; }
html:not(.desk) .q-bot .dp-end { display: none; }
html:not(.desk) .qg-head b { font-size: 13px; }
html:not(.desk) .qg-head .qg-ic { width: 22px; height: 22px; }
html:not(.desk) .qg-head .qg-ic img, html:not(.desk) .qg-head .qg-ic svg { width: 22px; height: 22px; }
html:not(.desk) .qg-head { margin-top: 4px; padding-bottom: 4px; }
.q-bot .dayprog { cursor: pointer; }

/* nút đổi ngày (Nhiệm vụ) y hệt nút mũi tên trang chậu cây; không còn nền đen chung */
html:not(.desk) .q-bot { left: 22px; right: 22px; bottom: calc(var(--nav-h) + var(--nav-gap)) !important; padding: 0; background: none; box-shadow: none; gap: 10px; }
html:not(.desk) .q-bot .wp-btn { width: 56px; height: 56px; min-width: 56px; min-height: 56px; background: rgba(255, 246, 224, .82); }
html:not(.desk) .q-bot .wp-btn[disabled] { opacity: .45; pointer-events: none; }
html:not(.desk) .q-bot .q-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: stretch; gap: 3px; }
html:not(.desk) .q-bot .q-dlbl { text-align: center; font-weight: 800; font-size: 13px; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.6); line-height: 1; }
html:not(.desk) body[data-page="quests"] .q-bot .q-mid .dayprog { flex: none; width: 100%; }
html:not(.desk) body #hud .hud-who, html:not(.desk) body #hud .hud-who { margin-left: 60px; }
html:not(.desk) .q-bot .q-mid { gap: 6px; }
html:not(.desk) .q-bot .q-dlbl { align-self: center; padding: 3px 10px; background: #22192e; color: #fff6e0; font-size: 13px; line-height: 1.1; box-shadow: 0 0 0 2px var(--line), 0 0 0 4px rgba(255,255,255,.12); text-shadow: none; }
html:not(.desk) .q-bot .q-mid { gap: 11px; }
html:not(.desk) body #hud .hud-lvic img, html:not(.desk) body #hud .hud-lvic img { width: 24px; height: 24px; }

/* Nhãn thứ ngày: không nền, chữ trắng viền tối để vẫn dễ đọc */
html:not(.desk) .q-bot .q-dlbl { background: none; box-shadow: none; padding: 0 4px; color: #fff; text-shadow: 0 0 3px #000, 0 1px 0 #000, 0 2px 4px rgba(0,0,0,.8); font-weight: 800; }

/* Mobile Nhiệm vụ/Lĩnh vực: coin sang góc phải, tên dưới avatar, nút + góc phải dưới */
.hud-avn { display: none; }
html:not(.desk) body #hud .hud-avn, html:not(.desk) body #hud .hud-avn { display: block; position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 800; color: #fff; text-shadow: 0 0 3px #000, 0 1px 0 #000; pointer-events: none; }
html:not(.desk) body #hud .hud-level, html:not(.desk) body #hud .hud-level { flex: none; }
html:not(.desk) body #hud .hud-who, html:not(.desk) body #hud .hud-who { margin-left: 0 !important; transform: none; width: 150px; }
html:not(.desk) body #hud .hud-res, html:not(.desk) body #hud .hud-res { margin-left: auto; transform: none; }
html:not(.desk) #q-add { top: auto !important; bottom: calc(var(--nav-h) + var(--nav-gap) + 70px) !important; right: 22px !important; }

/* Thứ ngày: viền chữ (stroke) thay đổ bóng; nhãn nằm trên, thanh tiến trình căn giữa theo chiều cao nút mũi tên */
html:not(.desk) .q-bot .q-mid { position: relative; justify-content: center; align-self: center; }
html:not(.desk) .q-bot .q-dlbl { position: absolute; left: 0; right: 0; bottom: calc(50% + 14px); padding: 0; text-shadow: none; color: #fff; -webkit-text-stroke: 4px #22192e; paint-order: stroke fill; }

/* Dòng Lv nằm ngay bên phải avatar, ngang hàng với coin (bar XP thả xuống dưới) */
html:not(.desk) body #hud .hud-who, html:not(.desk) body #hud .hud-who { transform: translateY(10px); margin-left: 4px !important; }

/* Nâng nhãn thứ ngày cao hơn để không dính thanh tiến trình */
html:not(.desk) .q-bot .q-dlbl { bottom: calc(50% + 22px); }

/* Mobile Nhiệm vụ/Lĩnh vực: khối Lv nằm trong hàng HUD, bên phải avatar, ngang coin */
html:not(.desk) body #hud .hud-level, html:not(.desk) body #hud .hud-level { display: flex; flex-direction: row; align-items: center; gap: 10px; position: relative; }
html:not(.desk) body #hud .hud-who, html:not(.desk) body #hud .hud-who { position: relative; left: auto; right: auto; bottom: auto; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; width: auto; margin-left: 12px !important; transform: translateY(8px); }
html:not(.desk) body #hud .hud-who .bar.xp, html:not(.desk) body #hud .hud-who .bar.xp { position: relative; left: auto; right: auto; bottom: auto; width: 110px !important; max-width: 110px; }

/* Ẩn dòng gợi ý "Chạm vào nhiệm vụ để hoàn thành" */
.q-tip { display: none !important; }

/* Thanh XP nằm bên phải chữ Lv, cùng hàng; tên dưới avatar có stroke, cách avatar một chút */
html:not(.desk) body #hud .hud-who, html:not(.desk) body #hud .hud-who { flex-direction: row; align-items: center; gap: 10px; transform: none; }
html:not(.desk) body #hud .hud-who .bar.xp, html:not(.desk) body #hud .hud-who .bar.xp { width: 90px !important; max-width: 90px; flex: none; }
html:not(.desk) body #hud .hud-avn, html:not(.desk) body #hud .hud-avn { top: calc(100% + 12px); text-shadow: none; color: #fff; -webkit-text-stroke: 3px #22192e; paint-order: stroke fill; }

/* Nút Lĩnh vực: góc trái dưới, trên nút mũi tên trái, đối xứng với nút + */
.q-areas { display: none; }
html:not(.desk) #q-areas { display: inline-flex; position: fixed; left: 22px; bottom: calc(var(--nav-h) + var(--nav-gap) + 70px); z-index: 22; width: 48px; height: 48px; min-width: 48px; min-height: 48px; padding: 0; justify-content: center; align-items: center; }
html:not(.desk) #q-areas img, html:not(.desk) #q-areas svg { width: 30px; height: 30px; }

/* ===== Bảng giá mobile: tối giản, 1 cột, có khoảng thở ===== */
.pro-perk { display: none; }
html:not(.desk) .pro-perk { display: flex; justify-content: center; gap: 18px; margin: 6px 0 18px; font-weight: 800; font-size: 14px; }
html:not(.desk) .pro-perk span { display: inline-flex; align-items: center; gap: 6px; }
html:not(.desk) .pro-perk img, html:not(.desk) .pro-perk svg { width: 22px; height: 22px; }
html:not(.desk) .pro-perk b { color: #2fa84f; font-size: 18px; }
html:not(.desk) .pro-plans { grid-template-columns: 1fr !important; gap: 18px !important; margin: 0 6px 18px !important; }
html:not(.desk) .pro-plan, html:not(.desk) .pro-plan.on { display: grid !important; grid-template-columns: 40px 1fr auto; grid-template-areas: "i n p" "i s w"; align-items: center; column-gap: 12px; row-gap: 2px; padding: 12px 14px !important; text-align: left; }
html:not(.desk) .pro-plan .pc-ic { display: grid !important; grid-area: i; width: 40px; height: 40px; place-items: center; margin: 0; background: #fff; box-shadow: 0 0 0 2px var(--line); }
html:not(.desk) .pro-plan .pc-ic img, html:not(.desk) .pro-plan .pc-ic svg { width: 26px; height: 26px; }
html:not(.desk) .pro-plan b { grid-area: n; font-size: 15px !important; }
html:not(.desk) .pro-plan small { grid-area: s; text-align: left !important; font-size: 12px; min-height: 0; }
html:not(.desk) .pro-plan > .num { grid-area: p; text-align: right !important; font-size: 18px !important; }
html:not(.desk) .pro-plan .pro-was { grid-area: w; justify-content: flex-end !important; min-height: 0; margin: 0; }
html:not(.desk) .pro-plan .pro-was:empty { display: none; }
html:not(.desk) .pro-plan .pc-feat { display: none; }
html:not(.desk) .pro-best { top: -11px !important; left: auto !important; right: 12px !important; transform: none !important; }
html.desk .pc-lim { display: none; }
html:not(.desk) #pro-go { margin-top: 4px; }
html:not(.desk) .pro-fine { margin-top: 12px; text-align: center; }
html:not(.desk) .pro-plan.free { opacity: 1 !important; filter: none !important; background: #efe9dc !important; box-shadow: 0 0 0 3px var(--line) !important; color: #2a2347; }
html:not(.desk) .pro-plan.free b, html:not(.desk) .pro-plan.free small { color: #5d5670 !important; }
html:not(.desk) .pro-plan small { white-space: nowrap; }
html:not(.desk) .pro-plan.free .pc-st { display: none; }

/* Mobile vườn cây: rương nằm ngay trên nút mũi tên phải, đứng yên, không đổ bóng */
html:not(.desk) .hero-inv.closed { position: fixed !important; top: auto !important; bottom: calc(var(--nav-h) + var(--nav-gap) + 70px) !important; right: 22px !important; left: auto !important; transform: none !important; width: auto; z-index: 22; }
html:not(.desk) .hero-inv.closed .inv-fab { width: 56px; height: 56px; margin: 0; animation: none !important; filter: none !important; }
html:not(.desk) .hero-inv.closed .inv-fab::after { display: none; }
html:not(.desk) .hero-inv.closed .inv-fab svg, html:not(.desk) .hero-inv.closed .inv-fab img { width: 52px; height: 52px; }
html:not(.desk) .hero-inv.closed .inv-fab .lbl { display: none; }

/* Pop up Lĩnh vực */
.areas-pop { display: flex; flex-direction: column; gap: 16px; }
.areas-pop .hero-list { display: flex; flex-direction: column; gap: 10px; max-height: 55vh; overflow-y: auto; padding: 4px; }
.areas-pop .areas-add { align-self: center; position: static !important; }

/* Bảng giá mobile: không tràn, tiêu đề nổi bật, giá xanh lá, gói đang chọn nổi rõ */
html:not(.desk) .pro-plan, html:not(.desk) .pro-plan.on { grid-template-columns: 40px minmax(0, 1fr) auto !important; min-width: 0; max-width: 100%; box-sizing: border-box; }
html:not(.desk) .pro-plan small { white-space: normal; }
html:not(.desk) .pro-plan b { font-size: 17px !important; font-weight: 900; color: #2a2347 !important; line-height: 1.15; }
html:not(.desk) .pro-plan > .num { color: #1f8a3c !important; white-space: nowrap; }
html:not(.desk) .pro-plan .pro-was { flex-wrap: nowrap !important; white-space: nowrap; }
html:not(.desk) .pro-plan:focus, html:not(.desk) .pro-plan:focus-visible { outline: none; }
html:not(.desk) .pro-plan:not(.free):not(.on) { background: #fff8e6 !important; box-shadow: 0 0 0 3px var(--line) !important; }
html:not(.desk) .pro-plan.on { background: #e3f7d9 !important; box-shadow: 0 0 0 3px var(--line), 0 0 0 7px #2fa84f !important; transform: scale(1.02); }
html:not(.desk) .pro-plan.on .pc-ic { background: #2fa84f; }
html:not(.desk) .pro-plan.on .pc-ic img, html:not(.desk) .pro-plan.on .pc-ic svg { filter: brightness(1.1); }
html:not(.desk) .dialog .body:has(.pro-plans) { overflow-x: hidden; }
html:not(.desk) #pro-go { display: flex; width: auto !important; margin: 8px 6px 0; justify-content: center; box-sizing: border-box; }
html:not(.desk) #pro-go { width: calc(100% - 12px) !important; align-self: center; }
html:not(.desk) .pro-plan, html:not(.desk) .pro-plan.on { column-gap: 10px; padding: 12px 12px !important; }
@media (max-width: 400px) { html:not(.desk) .pro-plan b { font-size: 16px !important; } html:not(.desk) .pro-plan > .num { font-size: 16px !important; } html:not(.desk) .pro-plan .pro-was s { font-size: 11px !important; } html:not(.desk) .pro-plan .pc-ic { width: 34px; height: 34px; } html:not(.desk) .pro-plan, html:not(.desk) .pro-plan.on { grid-template-columns: 34px minmax(0, 1fr) auto !important; } }

/* Pop up xem phần thưởng: nút Xóa và Sửa chỉ có icon */
.dialog .actions .r-del, .dialog .actions .r-ic { flex: none !important; width: 52px; min-width: 52px; padding: 0; justify-content: center; }
.dialog .actions .r-del span:empty, .dialog .actions .r-ic span:empty { display: none; }

/* Mobile Nhiệm vụ/Lĩnh vực: tên nhân vật nằm phía trên dòng Lv (không còn dưới avatar) */
html:not(.desk) body #hud .hud-avn, html:not(.desk) body #hud .hud-avn { display: none !important; }
html:not(.desk) body #hud .hud-name b, html:not(.desk) body #hud .hud-name b { display: block !important; font-size: 13px; line-height: 1.1; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff; text-shadow: none; -webkit-text-stroke: 3px #22192e; paint-order: stroke fill; }
html:not(.desk) body #hud .hud-nm, html:not(.desk) body #hud .hud-nm { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
html:not(.desk) body #hud .hud-who, html:not(.desk) body #hud .hud-who { align-items: flex-end; }
html:not(.desk) body #hud .hud-who .bar.xp, html:not(.desk) body #hud .hud-who .bar.xp { margin-bottom: 4px; }

/* Thanh XP: 10 ô vuông (cao 12px, rộng 120px) */
html:not(.desk) body #hud .hud-who .bar.xp, html:not(.desk) body #hud .hud-who .bar.xp { width: 120px !important; max-width: 120px; height: 12px; }
html:not(.desk) body #hud .hud-who, html:not(.desk) body #hud .hud-who { gap: 8px; }

/* Nút + pop up quản lý chậu cây (mobile, trang vườn) */
#pots-btn { display: none; }
html:not(.desk) body[data-page="hero"]:not(.game-on) #pots-btn { display: inline-flex; position: fixed; left: 22px; bottom: calc(var(--nav-h) + var(--nav-gap) + 70px); z-index: 22; width: 56px; height: 56px; min-width: 56px; min-height: 56px; padding: 0; justify-content: center; align-items: center; }
#pots-btn img, #pots-btn svg { width: 36px; height: 36px; }
.pots-pop { display: flex; flex-direction: column; gap: 20px; max-height: 62vh; overflow-y: auto; padding: 4px 4px 8px; }
.pp-h { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 3px solid var(--sc); }
.pp-h b { flex: 1; font-size: 16px; }
.pp-h img, .pp-h svg { width: 24px; height: 24px; }
.pp-add { width: 36px !important; height: 36px !important; min-width: 36px !important; min-height: 36px !important; padding: 0 !important; }
.pp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.pp-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px 8px; min-width: 0; font: inherit; color: var(--text); background: var(--card, #fff8e6); border: 0; cursor: pointer; box-shadow: 0 0 0 3px var(--line), inset 0 -4px 0 var(--sc); }
.pp-tile img, .pp-tile svg { width: 36px; height: 36px; }
.pp-n { max-width: 100%; font-size: 12.5px; font-weight: 800; line-height: 1.2; text-align: center; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pp-lv { font-size: 12px; color: var(--muted); }
.pp-empty { grid-column: 1 / -1; font-size: 13px; font-weight: 700; color: var(--muted); padding: 4px 2px; }
.pp-h { padding-bottom: 10px; margin-bottom: 14px; }
.pp-cv { width: 51px; height: 84px; image-rendering: pixelated; }
.pp-n { display: inline-flex !important; align-items: center; gap: 3px; }
.pp-n img, .pp-n svg { width: 16px !important; height: 16px !important; flex: none; }
.pp-tile { padding: 8px 4px 8px; }
.pp-n { display: -webkit-box !important; }

/* Mobile Nhiệm vụ: tên dưới avatar, coin trên dòng Lv (JS đặt vị trí), nút cài đặt góc phải trên */
html:not(.desk) body #hud .hud-name b, html:not(.desk) body #hud .hud-name b { display: none !important; }
html:not(.desk) body #hud .hud-avn, html:not(.desk) body #hud .hud-avn { display: block !important; top: calc(100% + 10px); left: -6px; transform: none; max-width: 140px; text-align: left; font-size: 13px; overflow: visible; text-overflow: clip; }
html:not(.desk) body #hud .hud-who, html:not(.desk) body #hud .hud-who { transform: translateY(16px); }
html:not(.desk) body #hud .hud-res { margin: 0; z-index: 2; }
html:not(.desk) body[data-page="quests"] #hud .hud-btns { display: flex !important; margin-left: auto; }
html:not(.desk) body[data-page="quests"] #hud .hud-btn:not(#hud-gear), html:not(.desk) body[data-page="quests"] #hud .hud-prog { display: none !important; }
html:not(.desk) body #hud .hud-who, html:not(.desk) body #hud .hud-who { transform: translateY(6px); }
html:not(.desk) body[data-page="quests"] #hud .hud-btns { position: static; top: auto; transform: translateY(-14px); }

/* Pop up Chậu cây v2: chậu to hơn, slot + nét đứt */
.pp-grid { gap: 14px; }
.pp-cv { width: 68px !important; height: 112px !important; }
.pp-tile { padding: 8px 4px 10px; }
.pp-slot { display: grid; place-items: center; min-height: 160px; font: inherit; color: var(--muted); background: transparent; border: 3px dashed rgba(255,255,255,.35); cursor: pointer; }
.pp-slot img, .pp-slot svg { width: 32px; height: 32px; opacity: .8; }
.pp-slot:active { background: rgba(255,255,255,.06); }
/* Pop up 1 chậu */
.pot-pop { display: flex; flex-direction: column; gap: 14px; }
.pp1-h { display: flex; align-items: center; gap: 14px; }
.pp1-h > div { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pp1-h b { font-size: 17px; }
.pp1-h .num { color: #ffe27a; font-size: 16px; }
.pp1-cv { width: 51px; height: 84px; image-rendering: pixelated; flex: none; }
.pot-pop .pc-list { display: flex; flex-direction: column; gap: 8px; }
.pot-pop .pc-add { align-self: center; }
.dialog .actions .pp-close { flex: 1; }
.pot-pop .pc-q { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; font: inherit; font-weight: 800; color: #2a2347; text-align: left; background: #fff8e6; border: 0; cursor: pointer; box-shadow: 0 0 0 3px var(--line), inset 4px 0 0 var(--sc); }
.pot-pop .pc-q .nm { flex: 1; min-width: 0; }
.pot-pop .pc-q img, .pot-pop .pc-q svg { width: 24px; height: 24px; flex: none; }
.pot-pop .pc-box { width: 24px; height: 24px; flex: none; display: grid; place-items: center; background: #fff; box-shadow: 0 0 0 2px var(--line); }
.pot-pop .pc-box img, .pot-pop .pc-box svg { width: 18px; height: 18px; }
.pot-pop .pc-q.done { opacity: .6; }
.pot-pop .pc-q.done .nm { text-decoration: line-through; }
.pot-pop .pc-empty { text-align: center; font-weight: 700; color: var(--muted); }
.pp1-h b { display: none; }
html:not(.desk) body[data-page="quests"] #hud .hud-btns { transform: none !important; }
html:not(.desk) body #hud .hud-avn, html:not(.desk) body #hud .hud-avn { left: 50% !important; transform: translateX(-50%) !important; text-align: center; white-space: nowrap; }
html:not(.desk) body #hud .hud-who, html:not(.desk) body #hud .hud-who { transform: translateY(17px); }

/* Pop up Chậu cây v3: lưới 2 cột, mỗi ô chậu là hình vuông, chậu to; ô + viền nét đứt cùng kích thước */
.pp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 16px 14px !important; }
.pp-tile { padding: 0 !important; background: none !important; box-shadow: none !important; gap: 6px !important; color: #fff !important; }
.pp-box { width: 100%; aspect-ratio: 1 / 1; display: grid; place-items: end center; overflow: hidden; background: var(--card, #2a2347); box-shadow: 0 0 0 3px var(--line), inset 0 -5px 0 var(--sc); }
.pp-box .pp-cv { width: auto !important; height: 100% !important; aspect-ratio: 68 / 112; }
.pp-box.pp-slot { display: grid; place-items: center; min-height: 0; background: transparent; border: 3px dashed rgba(255,255,255,.45); box-shadow: none; box-sizing: border-box; }
.pp-box.pp-slot img, .pp-box.pp-slot svg { width: 36px; height: 36px; }
.pp-add-t .pp-n { color: var(--muted); }
.pp-tile .pp-n { font-size: 13px; }

/* Pop up 1 chậu: chậu lớn ở giữa, 2 nút Xóa/Sửa đều nhau */
.pp1-h { flex-direction: column; align-items: center; gap: 10px; }
.pp1-h > div { width: 70%; align-items: center; }
.pp1-h .bar { width: 100%; }
.pp1-cv { width: 102px !important; height: 168px !important; }
.dialog .actions .pp1-btn { flex: 1 1 0 !important; width: auto; min-width: 0; height: 52px; padding: 0; justify-content: center; }
.dialog .actions .pp1-btn span:empty { display: none; }

/* Quản lý chậu: chậu to (đã cắt sát), chữ & nét đứt đủ tương phản ở cả nền sáng/tối */
.pp-box { place-items: center !important; }
.pp-box .pp-cv { width: 86% !important; height: 86% !important; aspect-ratio: auto; object-fit: contain; image-rendering: pixelated; }
.pp1-cv { width: 160px !important; height: 160px !important; image-rendering: pixelated; }
.pp-tile .pp-n { color: var(--text) !important; font-size: 14px !important; font-weight: 900; }
.pp-lv { color: var(--text) !important; opacity: .75; font-size: 12px; }
.pp-box.pp-slot { border: 3px dashed var(--text) !important; opacity: .7; }
.pp-box.pp-slot img, .pp-box.pp-slot svg { opacity: 1; }
.pp-add-t .pp-n { color: var(--text) !important; opacity: .8; }
.pp-h b { color: var(--text); }

/* Quản lý chậu v4: tên + Lv cùng hàng; pop up chậu: Xóa/Sửa vuông nhỏ + Thêm nhiệm vụ cùng hàng */
.pp-row { display: flex; align-items: baseline; justify-content: center; gap: 6px; max-width: 100%; min-width: 0; }
.pp-row .pp-n { -webkit-line-clamp: 1 !important; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; display: block !important; min-width: 0; }
.pp-row .pp-lv { flex: none; }
.dialog .actions .pp1-btn { flex: none !important; width: 48px !important; height: 48px !important; min-width: 48px !important; min-height: 48px !important; }
.dialog .actions .pp1-add { flex: 1 1 auto !important; height: 48px; min-height: 48px; }
.dialog .actions:has(.pp1-add) { flex-wrap: nowrap !important; } .dialog .actions .pp1-add { min-width: 0 !important; width: auto !important; flex: 1 1 0 !important; order: 0 !important; }

/* Nhãn FREE trên góc trái avatar (tài khoản chưa Pro) */
.hud-free { position: absolute; left: -8px; top: -8px; z-index: 2; padding: 2px 5px; font-size: 10px; font-weight: 900; line-height: 1; letter-spacing: .5px; color: #fff; background: #2fa84f; box-shadow: 0 0 0 2px var(--line); transform: rotate(-12deg); pointer-events: none; }

/* Pop up nhiệm vụ mới: tiêu đề và nội dung cùng 1 hàng; gợi ý không khung, thoáng */
.qf2 { gap: 14px; }
.qf2 .qf-f { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.qf2 .qf-f > .qf-l { flex: 0 0 auto; width: 76px; margin: 0; font-size: 13px; font-weight: 800; color: var(--muted); }
.qf2 .qf-f > .rf-seg, .qf2 .qf-f > .sel, .qf2 .qf-f > .dd-btn, .qf2 .qf-f > .sg-chips { flex: 1 1 0; min-width: 0; width: auto; }
.qf2 .qf-f > .qf-dow { flex: 1 1 100%; margin-top: 2px; }
.qf2 .sg-chips { gap: 14px; padding: 2px 0; }
.qf2 .sg-chip, .qf2 .sg-chip.on { background: none !important; box-shadow: none !important; border: 0; padding: 2px 0; min-height: 28px; color: var(--text); text-shadow: none; font-weight: 800; }
.qf2 .sg-chip.on { color: var(--gold); }
.qf2 .qf-cust { flex: 0 0 auto; min-width: 44px; justify-content: center; }
.qf2 .qf-cust input { width: 44px; min-height: 0; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; font-size: 15px; font-weight: 900; text-align: center; -moz-appearance: textfield; }
.qf2 .qf-cust input::-webkit-outer-spin-button, .qf2 .qf-cust input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qf2 .qf-f > .qf-l { width: 64px; }
.qf2 .rf-seg { padding: 3px; gap: 2px; }
.qf2 .rf-seg .chip { padding: 2px 5px !important; font-size: 12.5px; min-width: 0; }
.qf2 .rf-seg .chip img, .qf2 .rf-seg .chip svg { display: none; }
.qf2 .rf-seg .chip .qf-coin img, .qf2 .rf-seg .chip .qf-coin svg, .qf2 .rf-seg .qf-cust img, .qf2 .rf-seg .qf-cust svg { display: inline-block; }
.qf2 .qf-f { flex-direction: row !important; }
.qf2 .qf-f > .dd, .qf2 .qf-f > div:not(.qf-l):not(.qf-dow) { flex: 1 1 0; min-width: 0; }
.qf2 .rf-seg { justify-content: space-between; }
/* Thanh XP: mỗi ô nhìn thấy là hình vuông (rộng = 10 × (cao + 2px vạch ngăn)) */
html:not(.desk) body #hud .hud-who .bar.xp, html:not(.desk) body #hud .hud-who .bar.xp { height: 12px; width: 140px !important; max-width: 140px; }

/* Custom nhân vật dạng pop up */
.dialog:has(.creator-pop) .body { padding-left: 8px; padding-right: 8px; }
html:not(.desk) .creator-pop { height: min(66vh, 560px); display: flex; flex-direction: column; overflow: hidden; }
html:not(.desk) .dialog:has(.creator-pop) { max-width: calc(100vw - 16px); }
html.desk .creator-pop { max-height: 70vh; overflow-y: auto; }
html:not(.desk) .creator-pop { overflow-y: auto; scrollbar-width: none; }
html:not(.desk) .creator-pop::-webkit-scrollbar { display: none; }
html:not(.desk) .creator-pop #cr { flex: 0 0 auto; min-height: 100%; }
html:not(.desk) .creator-pop .creator.photo, html:not(.desk) .creator-pop .cr-tune { min-height: min-content; flex: 0 0 auto; }
html:not(.desk) #hud .hud-btns { position: absolute !important; right: max(var(--safe), env(safe-area-inset-right)); top: calc(max(var(--safe), env(safe-area-inset-top)) + 2px); margin: 0 !important; transform: none !important; }
html:not(.desk) body:not([data-page="quests"]) #hud .hud-btns .hud-btn:not(#hud-gear):not(#hud-help) { display: none !important; }

/* Phần thưởng: tab gọn (Đang chờ | Đã đạt được) */
.rw-tabs { gap: 0 !important; padding: 4px; background: rgba(0,0,0,.18); }
.rw-tabs .btn, .rw-tabs .btn:hover { --b: transparent; --bd: transparent; --bl: transparent; background: transparent !important; box-shadow: none !important; color: var(--text); min-height: 44px !important; font-size: 15px; font-weight: 800; justify-content: center; gap: 6px; }
.rw-tabs .btn.on { background: var(--gold) !important; color: #3a2410; box-shadow: 0 2px 0 rgba(0,0,0,.28) !important; }
.rw-tabs .btn img, .rw-tabs .btn svg { width: 24px; height: 24px; }
.rw-tabs .btn .num { opacity: .85; font-size: 13px; }

/* Mobile: nút Hướng dẫn/Cài đặt ở mọi trang nằm thấp bằng trang Nhiệm vụ; ẩn nút Nâng cấp (đã chuyển vào pop up Nhân vật) */
html:not(.desk) body:not([data-page="quests"]) #hud .hud-btns { top: calc(max(var(--safe), env(safe-area-inset-top)) + 46px) !important; }
html:not(.desk) #hud .hud-upg { display: none !important; }
html:not(.desk) #hud .hud-who .bar.xp { height: 9px !important; width: 110px !important; max-width: 110px !important; }
html:not(.desk) #hud .hud-btns { gap: 0; }
html:not(.desk) #hud .hud-btns .hud-btn { width: 36px !important; height: 36px !important; min-width: 36px !important; min-height: 36px !important; margin: 2px !important; }

/* Mobile: các trang ngoài Vườn cây có thanh trên nền gỗ; nút Hướng dẫn chỉ ở Vườn cây */
html:not(.desk) body:not([data-page="hero"]) #hud { background: repeating-linear-gradient(180deg, #9c6234 0 26px, #8b552c 26px 28px, #a86a39 28px 54px, #7d4b26 54px 56px); box-shadow: 0 4px 0 #3b200e, 0 8px 0 rgba(0,0,0,.28), inset 0 -4px 0 #5a3315; }
html:not(.desk) body:not([data-page="hero"]) #hud-help { display: none !important; }
html:not(.desk) body:not([data-page="hero"]) #hud .hud-logo { background: rgba(0,0,0,.28); box-shadow: inset 0 -3px 0 #3b200e; }

/* Pop up Nhân vật v2: nhân vật to hơn, nút ngẫu nhiên icon bên phải, pop up thấp hơn, Nâng cấp Pro dưới nút Lưu */
html:not(.desk) .creator-pop { height: min(58vh, 500px); }
.creator-pop .cr-left { position: relative; }
.creator-pop .creator .cr-rand { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; min-width: 52px; min-height: 52px; margin: 0 !important; padding: 0 !important; justify-content: center; }
.creator-pop .creator .cr-rand img, .creator-pop .creator .cr-rand svg { width: 30px; height: 30px; }
html:not(.desk) .creator-pop .creator.photo .cr-stage, html:not(.desk) .creator-pop .creator.photo.tuned .cr-stage { height: 176px !important; }
html:not(.desk) .creator-pop .cr-stage canvas { width: 129px !important; height: 176px !important; }
html:not(.desk) .creator-pop .cr-ride { height: 176px !important; max-width: 220px; }
.dialog:has(.creator-pop) .actions { flex-direction: column; align-items: stretch; gap: 10px; }
.dialog:has(.creator-pop) .actions .btn { width: 100%; flex: none; }
.dialog:has(.creator-pop) .actions .cr-upg { min-height: 44px; }

/* Mobile Phần thưởng: thanh tab Đang chờ / Đã đạt được nằm dưới cùng, ngay trên menu */
html:not(.desk) body[data-page="rewards"] .rw-tabs { position: fixed; left: 22px; right: 22px; bottom: calc(var(--nav-h) + var(--nav-gap)); z-index: 21; background: #22192e; box-shadow: 0 0 0 3px var(--line); }
html:not(.desk) body[data-page="rewards"] .rw-head { justify-content: flex-end; min-height: 0; }
html:not(.desk) body[data-page="rewards"] .rw-head:not(:has(.rw-add)) { margin: 0; }
html:not(.desk) body[data-page="rewards"] .page-inner:has(.rw-tabs) { padding-bottom: 80px; }

/* Toast: chỉ 1 cái, nhỏ gọn, nằm cao hơn */
#toast-root .toast { max-width: min(400px, calc(100% - 32px)); gap: 8px; padding: 4px 10px 4px 6px; font-size: 14px; line-height: 1.3; }
#toast-root .toast > img, #toast-root .toast > svg { width: 22px; height: 22px; flex: none; }
#toast-root .toast .btn { min-height: 34px; font-size: 14px; padding: 2px 10px; margin: 2px; }
html:not(.desk) #toast-root { bottom: calc(var(--nav-h) + var(--nav-gap, 8px) + 78px); }
html.desk #toast-root { bottom: 64px; }
html:not(.desk) body[data-page="progress"] #psub { padding-top: 14px; }

/* Minigame mobile: mũi tên giữ nguyên 2 bên; nhảy trên mũi tên trái, vung đòn trên mũi tên phải */
html:not(.desk) body.game-on #walk-pad { left: 22px !important; right: 22px !important; justify-content: space-between !important; gap: 0 !important; }
html:not(.desk) body.game-on #walk-pad .wp-btn { width: 56px !important; height: 56px !important; }
html:not(.desk) body.game-on .g-swing { position: fixed; width: 56px; height: 56px; right: 22px; left: auto; bottom: calc(var(--nav-h) + var(--nav-gap) + 70px); z-index: 23; }
html:not(.desk) body.game-on .g-swing.g-jump { right: auto; left: 22px; bottom: calc(var(--nav-h) + var(--nav-gap) + 70px); }
html:not(.desk) body.game-on .g-swing svg, html:not(.desk) body.game-on .g-swing img { width: 34px; height: 34px; }

/* Mobile nhiệm vụ: tiêu đề ngay dưới top bar */
.q-title { display: none; }
html:not(.desk) body[data-page="quests"] .q-title { display: block; text-align: center; margin: 4px 0 8px; padding: 0 56px; font-weight: 800; font-size: 14px; line-height: 1.25; letter-spacing: .04em; text-transform: uppercase; color: #fff6e0; -webkit-text-stroke: 4px #22192e; paint-order: stroke fill; }
html:not(.desk) body[data-page="quests"] .q-title.done { color: #8dff9a; }
html:not(.desk) body[data-page="quests"] .q-title.rev { color: #7fd3ff; }
html:not(.desk) body[data-page="quests"] .q-title { padding: 0 12px; font-size: 13px; letter-spacing: .02em; white-space: nowrap; }
html:not(.desk) body[data-page="quests"] .q-title { -webkit-text-stroke: 0; text-shadow: none; color: #22192e; font-size: 16px; letter-spacing: .01em; padding: 0 8px; }
html:not(.desk) body[data-page="quests"] .q-title.done { color: #1d7a34; }
html:not(.desk) body[data-page="quests"] .q-title.rev { color: #1f5f9a; }
html:not(.desk) body[data-page="quests"] .q-title, html:not(.desk) body[data-page="quests"] .q-title.done, html:not(.desk) body[data-page="quests"] .q-title.rev { color: #000; }
html:not(.desk) body[data-page="rewards"] .rw-tabs { background: #fff6e0; box-shadow: 0 0 0 3px var(--line), 0 4px 0 3px rgba(0,0,0,.2); }
html:not(.desk) body[data-page="rewards"] .rw-tabs .btn { color: #3a2410; }
html:not(.desk) body[data-page="rewards"] .rw-tabs .btn.on { background: var(--gold) !important; }

/* Mobile nhiệm vụ: vuốt trái hiện nút check / sửa / xóa */
.qsw { position: relative; }
.qsw > .qrow { position: relative; z-index: 1; touch-action: pan-y; }
.qsw-acts { position: absolute; z-index: 0; right: 4px; top: 12px; bottom: 12px; display: flex; align-items: center; gap: 8px; padding-left: 8px; opacity: 0; pointer-events: none; transition: opacity .12s; }
.qsw.open .qsw-acts, .qsw.drag .qsw-acts { opacity: 1; }
.qsw.open .qsw-acts { pointer-events: auto; }
.qsw-b { width: 46px; height: 46px; display: grid; place-items: center; padding: 0; border: 0; cursor: pointer; color: #fff; box-shadow: 0 0 0 3px var(--line), inset 0 -4px 0 rgba(0,0,0,.22); }
.qsw-b img, .qsw-b svg { width: 26px; height: 26px; }
.qsw-b.green { background: var(--green); }
.qsw-b.gray { background: #9a96b0; }
.qsw-b.blue { background: #4aa3e0; }
.qsw-b.red { background: var(--red); }

/* Chi tiết nhiệm vụ: tối giản */
.qd-dlg .qd-hero { box-shadow: none !important; background: none; padding: 0; margin: 4px 4px 12px; gap: 12px; }
.qd-dlg .qd-hero .plate { width: 60px; height: 60px; }
.qd-dlg .qd-hero .plate img, .qd-dlg .qd-hero .plate svg { width: 36px; height: 36px; }
.qd-dlg .qd-tags { flex-wrap: wrap; }
.qd-dlg .big-stats.row1 { margin: 0 4px 12px; gap: 6px; }
.qd-dlg .big-stats.row1 .bstat { background: var(--slot); min-height: 0; padding: 6px 4px; }
.qd-dlg .big-stats.row1 .bstat small { font-size: 11px; }
.qd-dlg .qd-done-row { margin: 0 4px 12px; }
.qd-dlg .qd-today { width: 100%; min-height: 46px; font-size: 16px; }
.qd-dlg .panel.pbox { box-shadow: none !important; background: transparent; padding: 0; margin: 0 4px; }
.qd-dlg .qd-calh { justify-content: center; gap: 10px; margin-bottom: 4px; }
.qd-dlg .qd-calh > svg, .qd-dlg .qd-calh > img { display: none; }
.qd-dlg .qd-calh .grow { display: none; }
.qd-dlg .qd-hint { display: none; }
html:not(.desk) .qd-dlg .qd-hero { box-shadow: none !important; padding: 0; gap: 10px; margin: 2px 4px 10px; }
html:not(.desk) .qd-dlg .qd-hero .plate { width: 52px; height: 52px; }
html:not(.desk) .qd-dlg .qd-hero .plate img, html:not(.desk) .qd-dlg .qd-hero .plate svg { width: 32px; height: 32px; }

/* Popup custom nhân vật: gọn, mỗi nhóm 1 hàng cuộn ngang, xúc xắc dưới nhân vật */
html:not(.desk) .creator-pop { height: auto; max-height: min(64vh, 540px); }
html:not(.desk) .creator-pop #cr { min-height: 0; }
.creator-pop .hair-row, .creator-pop .swatches, .creator-pop .acc-grid { display: flex !important; flex-wrap: nowrap !important; justify-content: flex-start !important; gap: 8px; overflow-x: auto; overflow-y: hidden; padding: 6px 4px 8px; margin: 0; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
.creator-pop .hair-row::-webkit-scrollbar, .creator-pop .swatches::-webkit-scrollbar { display: none; }
.creator-pop .hair-row > *, .creator-pop .swatches > * { flex: none; scroll-snap-align: start; }
.creator-pop .cr-pager, .creator-pop .acc-note { display: none !important; }
html:not(.desk) .creator-pop .creator.photo .cr-stage, html:not(.desk) .creator-pop .creator.photo.tuned .cr-stage { height: 150px !important; }
html:not(.desk) .creator-pop .cr-stage canvas { width: 110px !important; height: 150px !important; }
html:not(.desk) .creator-pop .cr-ride { height: 150px !important; }
.creator-pop .creator .cr-rand { position: static !important; transform: none !important; display: flex; margin: 6px auto 8px !important; width: 48px; height: 48px; min-width: 48px; min-height: 48px; }
.creator-pop .cr-rolling .cr-rand, .cr-rolling .cr-rand { animation: diceRoll .3s linear infinite; pointer-events: none; }
@keyframes diceRoll { 0% { transform: rotate(0) scale(1); } 50% { transform: rotate(180deg) scale(1.12); } 100% { transform: rotate(360deg) scale(1); } }
.creator-pop .tile { position: relative; }
.pro-b { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; display: grid; place-items: center; background: #2a2347; border-radius: 50%; box-shadow: 0 0 0 2px var(--gold); z-index: 2; pointer-events: none; }
.pro-b img, .pro-b svg { width: 14px; height: 14px; }
.tile { position: relative; }
.tile .pro-b img, .tile .pro-b svg, .hair-t .pro-b img { width: 13px !important; height: 13px !important; position: static !important; margin: 0 !important; image-rendering: pixelated; }
.tile .pro-b { top: 3px; right: 3px; width: 18px; height: 18px; left: auto; bottom: auto; }
html:not(.desk) .dialog:has(.creator-pop) { height: auto !important; min-height: 0 !important; }
html:not(.desk) .dialog:has(.creator-pop) .body { flex: 0 1 auto !important; min-height: 0 !important; }
.creator-pop .creator.photo.tuned .cr-tune, html:not(.desk) .creator-pop .cr-tune { min-height: 0 !important; }
.creator-pop .cr-tune .acc-grid { min-height: 0 !important; }
.tile .pro-b { right: auto; left: 3px; }

/* Mobile: dòng Lv/XP gọn (căn mép trên avatar), coin gọn (căn mép dưới avatar) */
html:not(.desk) body #hud .hud-who { height: 20px; min-height: 0; align-items: center !important; }
html:not(.desk) body #hud .hud-who .hud-name, html:not(.desk) body #hud .hud-who .hud-nm { height: 20px; display: flex; align-items: center; }
html:not(.desk) body #hud .hud-res .hud-chip#hud-coins { min-height: 0 !important; height: 22px; padding: 0 !important; background: none; box-shadow: none; gap: 4px; align-items: center; }
html:not(.desk) body #hud .hud-res .hud-chip#hud-coins img, html:not(.desk) body #hud .hud-res .hud-chip#hud-coins svg { width: 22px; height: 22px; }
html:not(.desk) body #hud .hud-res { height: 22px; min-height: 0; padding: 0; margin: 0; }

.rw-note { display: flex; align-items: center; gap: 8px; margin: 0 4px 12px; font-size: 14px; font-weight: 700; line-height: 1.35; color: var(--muted); }
.rw-note img, .rw-note svg { width: 24px; height: 24px; flex: none; }
html:not(.desk) body[data-page="rewards"] .rw-note { justify-content: center; text-align: center; margin: 4px 14px 8px; color: #000; }
html:not(.desk) body.inv-m #pots-btn { display: none !important; }
html:not(.desk) body #hud .hud-who .hud-nm { position: relative; top: -4px; }
html:not(.desk) #name-tag.name-tag, html:not(.desk) .name-tag { font-size: 14px; line-height: 19px; padding: 1px 8px; }
html:not(.desk) .name-tag .num { font-size: 14px; }

html:not(.desk) body[data-page="hero"]:not(.game-on) #pots-btn { width: 48px; height: 48px; min-width: 48px; min-height: 48px; }
#pots-btn img, #pots-btn svg { width: 30px; height: 30px; }

/* Mobile: tab Cài đặt ở menu dưới, ẩn nút gear góc trên, icon menu nhỏ lại */
html:not(.desk) #hud #hud-gear, html:not(.desk) #hud .hud-menu #hud-gear { display: none !important; }
html:not(.desk) .nav-btn img, html:not(.desk) .nav-btn svg { width: 34px !important; height: 34px !important; }
html:not(.desk) body:not([data-page="hero"]) #hud .hud-menu #hud-help.hud-btn { display: none !important; }
html:not(.desk) body[data-page="settings"] #page-settings .page-inner { padding-top: 6px; }
.acct-plain { background: none; border: 0; box-shadow: none; padding: 4px 0; margin: 0; font: inherit; font-weight: 800; color: var(--text); cursor: pointer; text-align: right; max-width: 100%; overflow-wrap: anywhere; text-decoration: underline dotted; }
.acct-plain .ac-mail { max-width: none; }
.set-acct-actions { display: flex; flex-direction: column; gap: 10px; margin: 28px 4px 8px; padding-top: 18px; border-top: 2px dashed rgba(0,0,0,.18); }
.set-acct-actions .btn { width: 100%; min-height: 46px; font-size: 16px; justify-content: center; gap: 8px; }
.acct-plain, .acct-plain .ac-mail { font-size: 13px; }

/* HUD: thống kê quà đã đổi, nằm dưới coin (mobile) */
.hud-stat { display: none; }
html:not(.desk) body #hud .hud-stat { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0; margin: 0; background: none; border: 0; box-shadow: none; color: #ffe27a; font-weight: 800; font-size: 16px; line-height: 1; cursor: pointer; z-index: 2; -webkit-text-stroke: 0; text-shadow: 0 0 3px #000, 0 1px 0 #000; }
html:not(.desk) body #hud .hud-stat img, html:not(.desk) body #hud .hud-stat svg { width: 22px; height: 22px; }
html:not(.desk) body #hud .hud-stat .num { font-size: 16px; }
html:not(.desk) body #hud .hud-who, html:not(.desk) body #hud .hud-nm, html:not(.desk) body #hud .hud-lvic { overflow: visible; }
html:not(.desk) body #hud .hud-stat { gap: 4px; height: 22px; }
html:not(.desk) body #hud .hud-stat .num { font-size: 20px; font-weight: 800; }
#del-go, #del-go span { white-space: nowrap; }
#acct-pro { min-height: 48px; font-size: 18px; padding: 6px 18px; }
html:not(.desk) body[data-page="settings"] .set-row { min-height: 34px; padding-top: 1px; padding-bottom: 1px; }
html:not(.desk) body[data-page="settings"] .set-row .btn, html:not(.desk) body[data-page="settings"] .seg .btn { min-height: 30px; }
html:not(.desk) body[data-page="settings"] #acct-pro { min-height: 44px; font-size: 18px; padding-top: 2px; padding-bottom: 2px; }
html:not(.desk) body[data-page="settings"] .set-acct-actions { margin: 8px 4px 0; padding-top: 8px; gap: 6px; }
html:not(.desk) body[data-page="settings"] .set-acct-actions .btn { min-height: 38px; font-size: 15px; }
html:not(.desk) body[data-page="settings"] #page-settings p.muted.small { display: none; }
/* Hướng dẫn người mới (tour.js) */
.vguide { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.vguide[hidden] { display: none; }
.vguide-ring { position: fixed; border: 4px solid #ffd54a; border-radius: 6px; box-shadow: 0 0 0 4px #22192e, 0 0 18px 4px rgba(255,213,74,.8); animation: coachPulse 1s steps(2) infinite; }
.vguide-tip { position: fixed; width: 220px; max-width: calc(100vw - 16px); padding: 8px 10px; text-align: center; color: #3b2614; background: #ffd54a; box-shadow: 0 0 0 3px #22192e, inset 0 -4px 0 #d9932a; animation: coachBob .8s ease-in-out infinite; }
.vguide-tip b { display: block; font-size: 17px; }
.vguide-tip span { display: block; font-size: 13px; font-weight: 700; }
.vguide-tip i { position: absolute; bottom: -12px; margin-left: -9px; border: 9px solid transparent; border-top-color: #22192e; border-bottom: 0; }
.vguide-tip.below i { bottom: auto; top: -12px; border-top-color: transparent; border-bottom: 9px solid #22192e; border-top-width: 0; }
.onb-gender { justify-content: center; margin: 10px auto 6px; gap: 8px; }
.onb-gender .btn { min-width: 110px; min-height: 48px; font-size: 18px; }
.intro-txt .intro-cta { display: flex; justify-content: center; margin-top: 10px; }
html:not(.desk) .intro-txt .intro-cta .btn { min-height: 38px; font-size: 14px; padding: 2px 14px; }
html:not(.desk) .intro-txt .intro-cta .btn img, html:not(.desk) .intro-txt .intro-cta .btn svg { width: 24px; height: 24px; }
html:not(.desk) .intro-txt .intro-login { margin-top: 6px; }
html:not(.desk) .intro-main.has-cta { grid-template-rows: 190px minmax(0, 1fr); }
html:not(.desk) .intro-txt .intro-cta .btn { width: auto; }
/* Trang QR thanh toán */
.qr-head .pro-timer, .qr-head .pro-timer.hot { background: none; box-shadow: none; padding: 0; color: #e5484d; gap: 4px; font-family: var(--font); }
.qr-head .pro-timer b { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.qr-head .pro-timer img, .qr-head .pro-timer svg { width: 18px; height: 18px; }
.qr-head .pro-timer.end { background: none; color: #8a8299; }
.qr-col { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.qr-price { display: flex; align-items: baseline; justify-content: center; gap: 8px; margin-top: 6px; font-family: var(--font); }
.qr-price s { font-size: 15px; font-weight: 700; opacity: .55; }
.qr-price b { font-size: 26px; font-weight: 900; color: #1f9e4a; font-variant-numeric: tabular-nums; }
.qr-col .qr-st { justify-content: center; text-align: center; }
.qr-save { gap: 6px; }
.qr-save img, .qr-save svg { width: 20px; height: 20px; }
.pro-qr .qr-info b { font-family: var(--font); font-weight: 800; }
.tour.wait .tour-card, .tour.wait .tour-hole { visibility: hidden; }
body.tour-on .free-cta { display: none !important; }
@media (max-width: 760px) { body[data-page="hero"] .free-cta { top: auto; bottom: calc(var(--nav-h) + 190px); } }
/* badge demo: cùng một vị trí thấp ở mọi trang (giữa hàng nút trên mũi tên / thanh ngày) */
@media (max-width: 760px) { .free-cta, body[data-page] .free-cta { top: auto !important; bottom: calc(var(--nav-h) + 92px) !important; } }
/* popup đăng ký: phủ tối toàn bộ nền phía sau */
.modal-back:has(#ac-mail) { background: rgba(6, 4, 20, .86); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
@media (max-width: 760px) { .free-cta { padding: 5px 10px !important; font-size: 14px !important; gap: 6px; } .free-cta img, .free-cta svg { width: 24px; height: 24px; } }
#hud-redeemed, html:not(.desk) body #hud #hud-redeemed { display: none !important; }
.set-acct-actions:empty { display: none; }
html:not(.desk) body #hud .hud-who .hud-name { overflow: visible !important; }
/* ô trống nét đứt để thêm phần thưởng */
#page-rewards .slot.slot-empty { display: grid; place-items: center; min-height: 150px; background: transparent !important; box-shadow: none !important; border: 3px dashed var(--muted); color: var(--muted); opacity: .8; cursor: pointer; }
#page-rewards .slot.slot-empty:hover, #page-rewards .slot.slot-empty:focus-visible { opacity: 1; border-color: var(--gold-d); background: color-mix(in srgb, var(--gold) 16%, transparent) !important; transform: none; }
#page-rewards .slot.slot-empty:active { transform: translateY(2px); }
#page-rewards .slot.slot-empty img, #page-rewards .slot.slot-empty svg { width: 48px; height: 48px; opacity: .7; }
#page-rewards .slot.slot-empty img, #page-rewards .slot.slot-empty svg { filter: grayscale(1); }
#page-rewards .slot.slot-empty:hover img, #page-rewards .slot.slot-empty:hover svg { filter: none; opacity: 1; }
/* HUD mobile: thanh XP thành vòng tròn quanh avatar, Lv nhỏ ngay dưới tên */
.hud-avlv { display: none; }
html:not(.desk) body #hud .hud-who { display: none !important; }
html:not(.desk) body #hud .hud-portrait { box-sizing: border-box; padding: 4px; background: conic-gradient(#b68bff var(--xp, 0%), rgba(20, 14, 36, .6) 0) !important; box-shadow: 0 0 0 3px var(--line), 0 0 10px rgba(182, 139, 255, .35) !important; }
html:not(.desk) body #hud .hud-portrait img { width: 100% !important; height: 100% !important; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #bfe6ff, #6fb6e8); box-shadow: 0 0 0 2px var(--line); }
html:not(.desk) body #hud .hud-avlv { display: block; position: absolute; left: 50%; transform: translateX(-50%); top: calc(100% + 27px); font-size: 11px; font-weight: 800; line-height: 1; white-space: nowrap; color: #ffe27a; -webkit-text-stroke: 3px #22192e; paint-order: stroke fill; }
/* đưa dòng ngôi sao + Lv về chỗ cũ (cạnh avatar), vẫn bỏ thanh XP ngang */
html:not(.desk) body #hud .hud-who { display: flex !important; }
html:not(.desk) body #hud .hud-who .bar.xp { display: none !important; }
html:not(.desk) body #hud .hud-avlv { display: none !important; }
/* bản demo (mobile): badge nhỏ gắn bên phải thanh trên cùng */
@media (max-width: 760px) {
  .free-cta, body[data-page] .free-cta { top: calc(var(--hud-h) / 2 + 30px) !important; bottom: auto !important; left: auto !important; right: 12px; translate: 0 -50% !important; padding: 4px 8px !important; font-size: 12px !important; gap: 4px; animation: none; z-index: 25; }
  .free-cta img, .free-cta svg { width: 18px !important; height: 18px !important; }
  .free-cta .cta-tx small { font-size: 10px !important; }
}
@media (max-width: 760px) {
  html body .free-cta.free-cta { top: 6px !important; right: 8px !important; translate: none !important; min-height: 0 !important; height: 30px; padding: 2px 8px !important; font-size: 11px !important; line-height: 1.05; box-shadow: 0 0 0 2px #22192e, inset 0 -3px 0 #d9932a !important; }
  html body .free-cta.free-cta img, html body .free-cta.free-cta svg { width: 16px !important; height: 16px !important; }
  html body .free-cta.free-cta .cta-tx small { font-size: 9px !important; }
}
.free-cta .cta-sm { display: none; }
@media (max-width: 760px) {
  .free-cta .cta-lg { display: none; } .free-cta .cta-sm { display: inline; }
  html body .free-cta.free-cta > img, html body .free-cta.free-cta > svg { display: none; }
  html body .free-cta.free-cta .cta-tx, html body .free-cta.free-cta .cta-tx * { font-size: 11px !important; line-height: 1.1; }
  html body .free-cta.free-cta .cta-tx small, html body .free-cta.free-cta .cta-tx small * { font-size: 9px !important; }
}
@media (max-width: 760px) { html body .free-cta.free-cta { top: 5px !important; height: 27px; padding: 1px 7px !important; } }
/* trang cài đặt mobile: các dòng thưa nhau hơn (trước đó nén sát) */
html:not(.desk) body[data-page="settings"] .set-row { min-height: 44px; padding-top: 5px; padding-bottom: 5px; }
html:not(.desk) body[data-page="settings"] .set-row .btn, html:not(.desk) body[data-page="settings"] .seg .btn { min-height: 34px; }
html:not(.desk) body[data-page="settings"] .set-acct-actions { margin-top: 16px; padding-top: 14px; gap: 8px; }
/* trang phần thưởng mobile: lưới 3 cột, mỗi ô vuông gọn */
html:not(.desk) #page-rewards .shop { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 4px; }
html:not(.desk) #page-rewards .shop .slot { aspect-ratio: 1 / 1; min-height: 0; margin: 0; padding: 6px 4px 6px; gap: 2px; justify-content: center; overflow: hidden; }
html:not(.desk) #page-rewards .slot .r-img, html:not(.desk) #page-rewards .slot > img, html:not(.desk) #page-rewards .slot > svg { width: 36px; height: 36px; }
html:not(.desk) #page-rewards .slot .nm { font-size: 12px; line-height: 1.15; max-height: 28px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
html:not(.desk) #page-rewards .slot .price { font-size: 13px; gap: 3px; }
html:not(.desk) #page-rewards .slot .price img, html:not(.desk) #page-rewards .slot .price svg { width: 18px; height: 18px; }
html:not(.desk) #page-rewards .slot .price .num { font-size: 14px; }
html:not(.desk) #page-rewards .slot .price small { font-size: 10px; }
html:not(.desk) #page-rewards .slot .bar { height: 6px; margin: 2px 4px 0; }
html:not(.desk) #page-rewards .slot .rw-need, html:not(.desk) #page-rewards .slot .rq { display: none; }
html:not(.desk) #page-rewards .slot > .btn { min-height: 26px; width: calc(100% - 4px); margin-top: 2px; font-size: 12px; padding: 0 4px; gap: 3px; }
html:not(.desk) #page-rewards .slot > .btn img, html:not(.desk) #page-rewards .slot > .btn svg { width: 16px; height: 16px; }
html:not(.desk) #page-rewards .slot[data-ready="1"] .bar { display: none; }
html:not(.desk) #page-rewards .slot.owned .nm { max-height: 28px; }
html:not(.desk) #page-rewards .slot.slot-empty { min-height: 0; }
html:not(.desk) #page-rewards .slot.slot-empty img, html:not(.desk) #page-rewards .slot.slot-empty svg { width: 36px; height: 36px; }
html:not(.desk) #page-rewards .slot[data-ready="1"] .price { display: none; }
html:not(.desk) #page-rewards .slot > .btn .num { font-size: 12px; }
html:not(.desk) #page-rewards .slot[data-ready="1"] { padding-top: 4px; }
/* mũi tên đổi ngày: luôn đặc, không trong suốt (nút bị khóa chỉ xám đi) */
.daynav .btn[disabled], .q-bot .btn[disabled], .q-bot .wp-btn[disabled] { opacity: 1 !important; filter: grayscale(1) brightness(.92); }
/* đồng coin cố định một chỗ dù đã tick hay chưa */
html:not(.desk) .qrow, html:not(.desk) .qrow.done { padding-right: 46px; }
html:not(.desk) .qrow .qm { flex: 1 1 0; min-width: 0; }
html:not(.desk) .qrow .qrw { flex: none; }
/* nút + nhỏ ở mỗi lĩnh vực: không khung viền */
.qg-add, html.mob .qg-add, html:not(.desk) .qg-add { background: none !important; box-shadow: none !important; border: 0 !important; }
.qg-add:hover { background: none !important; }
.qg-add img, .qg-add svg { width: 24px; height: 24px; }
/* mũi tên đổi ngày: nền đặc hoàn toàn (không xuyên thấu) */
html:not(.desk) .q-bot .wp-btn { background: #fff6e0 !important; }
html:not(.desk) .q-bot .wp-btn[disabled] { background: #d9d3c6 !important; opacity: 1 !important; filter: none; }
.dp-big.full .dp-track::after { display: none; }
/* trang phần thưởng mobile: ô thưa nhau hơn, viền nhẹ (không đậm) */
html:not(.desk) #page-rewards .shop { gap: 16px 14px; padding: 8px 10px; }
html:not(.desk) #page-rewards .shop .slot { box-shadow: 0 0 0 2px rgba(34, 25, 46, .28), inset 0 -4px 0 rgba(0, 0, 0, .06) !important; }
html:not(.desk) #page-rewards .shop .slot.ready { box-shadow: 0 0 0 2px var(--gold-d), inset 0 -4px 0 rgba(0, 0, 0, .06) !important; }
/* mobile, trang Vườn cây: nút đổi cảnh nền nằm bên trái nút Hướng dẫn */
html:not(.desk) body[data-page="hero"] #hud .hud-btns { display: flex; align-items: center; gap: 6px; }
html:not(.desk) body[data-page="hero"] #hud#hud .hud-btns #hud-bg#hud-bg#hud-bg { display: inline-flex !important; position: static !important; width: 38px; height: 38px; min-width: 38px; min-height: 38px; margin: 2px !important; }
html:not(.desk) body[data-page="hero"] #hud .hud-btns #hud-bg img, html:not(.desk) body[data-page="hero"] #hud .hud-btns #hud-bg svg { width: 24px; height: 24px; }
/* tab Đã đạt được (mobile): nội dung vừa ô vuông, không bị cắt */
html:not(.desk) #page-rewards .shop .slot.owned { justify-content: flex-start; padding: 8px 4px 4px; gap: 1px; }
html:not(.desk) #page-rewards .slot.owned .r-img, html:not(.desk) #page-rewards .slot.owned > img, html:not(.desk) #page-rewards .slot.owned > svg { width: 30px; height: 30px; flex: none; }
html:not(.desk) #page-rewards .slot.owned .nm { font-size: 11px; min-height: 0; max-height: 26px; }
html:not(.desk) #page-rewards .slot.owned .price { font-size: 12px; }
html:not(.desk) #page-rewards .slot.owned .price .num { font-size: 12px; }
html:not(.desk) #page-rewards .slot.owned .price img, html:not(.desk) #page-rewards .slot.owned .price svg { width: 16px; height: 16px; }
html:not(.desk) #page-rewards .slot.owned .date { display: flex; align-items: center; justify-content: center; gap: 2px; font-size: 10px; line-height: 1; margin-top: auto; }
html:not(.desk) #page-rewards .slot.owned .date img, html:not(.desk) #page-rewards .slot.owned .date svg { width: 12px; height: 12px; }
html:not(.desk) #page-rewards .slot.owned::after { inset: 3px; outline-width: 2px; }
html:not(.desk) #page-rewards .slot.owned .nm { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.15; }
html:not(.desk) #page-rewards .slot.owned .nm { white-space: normal !important; overflow-wrap: anywhere; text-overflow: clip; width: 100%; justify-content: center; text-align: center; }
html:not(.desk) #page-rewards .slot .nm { max-width: 100%; min-width: 0; box-sizing: border-box; padding: 0 2px; }
html:not(.desk) #page-rewards .slot.owned .nm { display: block !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; -webkit-line-clamp: unset; max-width: 100%; }
/* dải 7 ngày gần nhất dưới tên nhiệm vụ */
.q-w7 { display: flex; gap: 3px; margin-top: 4px; }
.q-w7 i { width: 10px; height: 10px; flex: none; background: rgba(59, 38, 20, .08); box-shadow: inset 0 0 0 1.5px rgba(59, 38, 20, .14); }
.q-w7 i.w7-ok { background: #4cb350; box-shadow: inset 0 -2px 0 #2f8a2a; }
.q-w7 i.w7-miss { background: rgba(229, 72, 77, .10); box-shadow: inset 0 0 0 1.5px rgba(229, 72, 77, .45); }
.q-w7 i.w7-now { background: transparent; box-shadow: inset 0 0 0 1.5px rgba(59, 38, 20, .45); }
.q-w7 i.w7-off { background: transparent; box-shadow: inset 0 0 0 1px rgba(59, 38, 20, .1); }
.q-w7 i.cur { outline: 1.5px solid rgba(59, 38, 20, .55); outline-offset: 1.5px; }
.q-w7 i.cur.w7-ok { outline-color: #2f8a2a; }
html[data-mode="night"] .q-w7 i { background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.14); }
html[data-mode="night"] .q-w7 i.w7-ok { background: #4cb350; box-shadow: inset 0 -2px 0 #2f8a2a; }
.qrow.done .q-w7 { opacity: 1; }
/* thẻ nhiệm vụ mobile: tên rộng hơn; chỗ bên phải cố định cho nút ··· (chưa xong) hoặc dấu tick (đã xong) → coin không nhảy */
html:not(.desk) .qrow, html:not(.desk) .qrow.done { padding-right: 46px; gap: 8px; }
html:not(.desk) .qrow .qdone { width: 0; flex: none; }
html:not(.desk) .qrow .q-more { position: absolute; right: 8px; top: 50%; margin: -15px 0 0 !important; }
html:not(.desk) .qrow.done .q-more { display: none; }
html:not(.desk) .qrow .qm .nm { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.2; }
.q-w7 { gap: 4px; } .q-w7 i.cur { margin-left: 3px; outline-offset: 1px; }
/* HUD mobile: tên ở trên, dưới là LV rồi coin; icon + chữ nhỏ gọn */
html:not(.desk) body #hud .hud-avn { display: none !important; }
html:not(.desk) body #hud .hud-who, html:not(.desk) body #hud .hud-who .hud-name, html:not(.desk) body #hud .hud-who .hud-nm { height: auto !important; }
html:not(.desk) body #hud .hud-who .hud-nm { display: flex !important; flex-direction: column !important; align-items: flex-start !important; gap: 2px !important; top: 0 !important; }
html:not(.desk) body #hud .hud-who .hud-nm > b { display: block !important; max-width: 200px; font-size: 14px; line-height: 1.1; font-weight: 800; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; -webkit-text-stroke: 3px #22192e; paint-order: stroke fill; text-shadow: none; }
html:not(.desk) body #hud .hud-lv { font-size: 15px !important; gap: 3px !important; line-height: 1 !important; }
html:not(.desk) body #hud .hud-lvic img, html:not(.desk) body #hud .hud-lvic svg { width: 18px !important; height: 18px !important; }
html:not(.desk) body #hud .hud-xp { display: none !important; }
html:not(.desk) body #hud .hud-res .hud-chip#hud-coins { height: 18px !important; gap: 3px !important; }
html:not(.desk) body #hud .hud-res .hud-chip#hud-coins img, html:not(.desk) body #hud .hud-res .hud-chip#hud-coins svg { width: 18px !important; height: 18px !important; }
html:not(.desk) body #hud #hud-coin-n { font-size: 15px !important; }
html:not(.desk) body #hud .hud-res { height: 18px !important; }

/* HUD mobile: avatar cao bằng khối 3 dòng (tên / LV / xu) + vòng XP chạy mượt và phát sáng khi tăng XP */
@property --xp { syntax: '<percentage>'; inherits: false; initial-value: 0%; }
html:not(.desk) body #hud .hud-portrait { width: 58px !important; height: 58px !important; transition: --xp .8s cubic-bezier(.2, .8, .2, 1); }

/* vòng XP: chỉ đoạn vừa tăng phát sáng */
html:not(.desk) body #hud .hud-portrait { position: relative; overflow: visible !important; }
html:not(.desk) body #hud .hud-portrait .xp-gain { position: absolute; inset: 0; border-radius: 50%; pointer-events: none; opacity: 0; }
html:not(.desk) body #hud .hud-portrait .xp-gain b { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(transparent var(--a, 0%), #f6ecff var(--a, 0%) var(--b, 0%), transparent 0); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4.5px)); mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4.5px)); }
html:not(.desk) body #hud .hud-portrait .xp-gain.on { animation: xpGain 1.5s ease-out; }
@keyframes xpGain {
  0% { opacity: 0; filter: drop-shadow(0 0 0 rgba(200, 160, 255, 0)); }
  20% { opacity: 1; filter: drop-shadow(0 0 5px #e6d0ff) drop-shadow(0 0 11px rgba(182, 139, 255, 1)); }
  60% { opacity: .85; filter: drop-shadow(0 0 3px #d9b8ff) drop-shadow(0 0 6px rgba(182, 139, 255, .6)); }
  100% { opacity: 0; filter: drop-shadow(0 0 0 rgba(200, 160, 255, 0)); }
}
/* ô 7 ngày: ô đang chọn di chuyển theo ngày nên bỏ khoảng tách riêng */
.q-w7 i.cur { margin-left: 0 !important; }

/* điện thoại: thẻ chậu cây neo phía dưới (đè nút game), to & thưa hơn, có nút đóng */
html:not(.desk) .pot-card.mob { padding: 12px 14px 14px !important; box-sizing: border-box; }
html:not(.desk) .pot-card.mob .pc-h { gap: 8px; padding-right: 0; }
html:not(.desk) .pot-card.mob .pc-h b { font-size: 16px !important; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html:not(.desk) .pot-card.mob .pc-h > svg, html:not(.desk) .pot-card.mob .pc-h > img { width: 26px !important; height: 26px !important; }
html:not(.desk) .pot-card.mob .pc-lvn { flex: none; font-size: 13px; }
html:not(.desk) .pot-card.mob .pc-x { position: static; flex: none; width: 28px; height: 28px; margin-left: 4px; padding: 5px; }
html:not(.desk) .pot-card.mob .pc-lv { margin: 10px 0 12px !important; }
html:not(.desk) .pot-card.mob .pc-list { max-height: 170px !important; gap: 8px !important; padding: 3px; overflow-x: hidden; overflow-y: auto; }
html:not(.desk) .pot-card.mob .pc-q { padding: 8px 10px !important; font-size: 14px !important; gap: 10px !important; min-width: 0; }
html:not(.desk) .pot-card.mob .pc-q > svg, html:not(.desk) .pot-card.mob .pc-q > img { width: 22px !important; height: 22px !important; }
html:not(.desk) .pot-card.mob .pc-c { flex: none; }
html:not(.desk) .pot-card.mob .pc-alldone { margin-top: 10px; }
html:not(.desk) .pot-card.mob .pc-add { width: 100%; justify-content: center; margin-top: 12px; font-size: 14px !important; padding: 8px 10px !important; }
html:not(.desk) .pot-card.mob .pc-empty { padding: 10px; }
html:not(.desk) .pot-card.mob { overflow-y: auto; }
html:not(.desk) .pot-card.mob .pc-q .nm { white-space: normal !important; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 1.25; text-overflow: clip; }
html:not(.desk) .pot-card.mob { overflow-x: hidden; }
html:not(.desk) .pot-card.mob .pc-add, html:not(.desk) .pot-card.mob .pc-q { box-sizing: border-box; }

/* thẻ chậu nằm giữa 2 nút mũi tên: bề rộng đặt bằng JS, nội dung gọn lại cho vừa */
html:not(.desk) .pot-card.mob { width: auto; max-width: none; padding: 10px 10px 10px !important; }
html:not(.desk) .pot-card.mob .pc-h b { font-size: 15px !important; }
html:not(.desk) .pot-card.mob .pc-lvn { font-size: 12px; }
html:not(.desk) .pot-card.mob .pc-x { width: 26px; height: 26px; }
html:not(.desk) .pot-card.mob .pc-lv { margin: 8px 0 10px !important; }
html:not(.desk) .pot-card.mob .pc-q { padding: 7px 8px !important; font-size: 13px !important; gap: 7px !important; }
html:not(.desk) .pot-card.mob .pc-q > svg, html:not(.desk) .pot-card.mob .pc-q > img { width: 20px !important; height: 20px !important; }
html:not(.desk) .pot-card.mob .pc-box { width: 18px; height: 18px; }
html:not(.desk) .pot-card.mob .pc-add { margin-top: 10px; font-size: 13px !important; }
/* điện thoại: nút game thành tab nhỏ lấp ló ở mép phải; chạm lần 1 trượt ra to hơn, chạm lần 2 vào chơi */
html:not(.desk) body #game-btn.game-btn:not([hidden]) { top: calc(var(--hud-h) + 18px) !important; bottom: auto !important; left: auto !important; right: 0 !important; transform: translateX(calc(100% - 34px)) !important; height: 34px; padding: 0 10px 0 6px !important; gap: 5px; z-index: 24; transition: transform .2s ease-out, height .2s ease-out; animation: gbPeek 3.2s ease-in-out infinite; }
html:not(.desk) body #game-btn.game-btn:not([hidden]) .gb-ic > * { width: 22px !important; height: 22px !important; transition: width .2s, height .2s; }
html:not(.desk) body #game-btn.game-btn:not([hidden]) .gb-txt { font-size: 13px !important; }
html:not(.desk) body #game-btn.game-btn.open:not([hidden]) { transform: translateX(0) !important; height: 44px; padding: 0 14px 0 10px !important; animation: none; }
html:not(.desk) body #game-btn.game-btn.open:not([hidden]) .gb-ic > * { width: 28px !important; height: 28px !important; }
html:not(.desk) body #game-btn.game-btn.open:not([hidden]) .gb-txt { font-size: 15px !important; }
@keyframes gbPeek { 0%, 80%, 100% { translate: 0 0; } 88% { translate: -4px 0; } 94% { translate: 0 0; } }
/* thẻ chậu mobile: hiện ngay không animation; nút Thêm nhiệm vụ nhỏ gọn */
html:not(.desk) .pot-card.mob, html:not(.desk) .pot-card.mob.in { animation: none !important; }
html:not(.desk) .pot-card.mob .pc-add { width: auto !important; margin: 10px auto 0 !important; display: flex; font-size: 12px !important; padding: 5px 12px !important; min-height: 0 !important; gap: 5px; }
html:not(.desk) .pot-card.mob .pc-add svg, html:not(.desk) .pot-card.mob .pc-add img { width: 16px !important; height: 16px !important; }

/* ===== Rà soát UI 05/12 ===== */
/* A1: cụm nút dưới trang Nhiệm vụ có nền mờ dần, danh sách không lộ chữ phía sau */
html:not(.desk) body[data-page="quests"]:not(.desk-modal) #page-quests .q-head::before { content: ''; position: fixed; left: 0; right: 0; bottom: var(--nav-h); height: calc(var(--nav-gap) + 150px); z-index: 20; pointer-events: none; background: linear-gradient(to top, #fff6e4 0, #fff6e4 76%, rgba(255, 246, 228, 0) 100%); }
html:not(.desk) body[data-page="quests"] .page#page-quests { padding-bottom: 190px !important; }
/* A3: huy hiệu số trên menu nhỏ gọn, không che icon */
html:not(.desk) #nav .nav-btn .count.dot { min-width: 18px !important; height: 18px !important; padding: 0 4px !important; font-size: 11px !important; top: 6px !important; right: calc(50% - 26px) !important; transform: none !important; box-shadow: 0 0 0 2px #22192e !important; z-index: 2; }
/* A4: nút Đăng xuất thẳng mép với khối cài đặt */
.set-acct-actions .btn { margin-left: 0 !important; margin-right: 0 !important; width: 100% !important; box-sizing: border-box; }
html body .set-acct-actions { margin-left: 14px !important; margin-right: 14px !important; }
/* C10: nút Ngày nghỉ ghi rõ */
#rest-tg .rest-lbl { font-size: 13px; font-weight: 800; white-space: nowrap; }
#rest-tg { gap: 6px; padding-left: 8px; padding-right: 10px; }
/* A2: nhãn chậu bị thẻ tên/đầu nhân vật đè thì mờ đi */
#garden .pot-lv, #garden .pot-badge, #garden .pot-nag { transition: opacity .15s; }
html:not(.desk) #garden .dodge { opacity: .12 !important; }
/* B5: nhiệm vụ đã xong vẫn đọc rõ tên (chỉ làm mờ icon, xu) */
.qrow.done > .qm { opacity: 1 !important; }
.qrow.done > .qm .nm { color: #4d5c40; }
.qrow.done > .qm .qs, .qrow.done > .qm .q-amt { color: #5f6b52; }
/* B6: ô 7 ngày: bỏ lỡ tô đặc đỏ nhạt, hôm nay viền vàng, ngày đang xem gạch chân */
.q-w7 i { position: relative; }
.q-w7 i.w7-miss { background: #f4b9b4 !important; box-shadow: inset 0 0 0 1.5px #d9534f !important; }
.q-w7 i.tdy:not(.w7-ok) { box-shadow: inset 0 0 0 2px #e0a526 !important; background: #fff3cf !important; }
.q-w7 i.tdy.w7-ok { box-shadow: inset 0 -2px 0 #2f8a2a, 0 0 0 1.5px #e0a526 !important; }
.q-w7 i.cur { outline: none !important; }
.q-w7 i.cur::after { content: ''; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px; background: #3b2614; }
/* C8: trang Phần thưởng: lời nhắn căn trái gọn với icon, tab chuyển lên đầu (hết khoảng trống), viền nhạt đồng bộ với lưới */
html:not(.desk) body[data-page="rewards"] .rw-note { justify-content: flex-start !important; align-items: center; text-align: left !important; gap: 10px; margin: 6px 14px 12px !important; padding: 10px 12px; background: rgba(224, 165, 38, .12); box-shadow: 0 0 0 2px rgba(224, 165, 38, .35); font-size: 14px; line-height: 1.35; color: #3b2614 !important; }
html:not(.desk) body[data-page="rewards"] .rw-note > svg, html:not(.desk) body[data-page="rewards"] .rw-note > img { flex: none; width: 22px; height: 22px; }
html:not(.desk) body[data-page="rewards"] .rw-head { margin: 0 14px 14px !important; }
html:not(.desk) body[data-page="rewards"] .rw-tabs { position: static !important; width: 100%; box-shadow: 0 0 0 2px rgba(34, 25, 46, .28) !important; background: #fff6e0 !important; }
html:not(.desk) body[data-page="rewards"] .rw-tabs .btn { min-height: 40px; font-size: 14px; }
html:not(.desk) body[data-page="rewards"] .page-inner:has(.rw-tabs) { padding-bottom: 24px !important; }
/* C9: quà đủ điều kiện đổi phát sáng vàng nhẹ cho nổi bật */
html:not(.desk) #page-rewards .shop .slot.ready { box-shadow: 0 0 0 2px #e0a526, inset 0 -4px 0 rgba(0, 0, 0, .06) !important; animation: rwReady 1.8s ease-in-out infinite !important; position: relative; z-index: 1; }
@keyframes rwReady { 0%, 100% { filter: drop-shadow(0 0 0 rgba(255, 196, 40, 0)); } 50% { filter: drop-shadow(0 0 7px rgba(255, 196, 40, .95)); } }
/* C11: nhãn ngày dưới biểu đồ 7 ngày */
.ch-xl { position: relative; height: 16px; margin: 4px auto 2px; }
.ch-xl span { position: absolute; top: 0; transform: translateX(-50%); font-size: 11px; font-weight: 800; color: #6d6280; white-space: nowrap; }
.ch-xl span.on { color: #22192e; background: #ffd54a; padding: 0 4px; box-shadow: 0 0 0 1.5px #22192e; }
.ch-box { display: flex; flex-direction: column; align-items: center; }
html body .qrow.done .qm .nm { opacity: 1 !important; color: #4d5c40 !important; }

/* ===== Tối giản & sức hút 05/12 ===== */
/* 3: nút Tạo tài khoản trong demo rõ hơn */
@media (max-width: 760px) {
  html body .free-cta.free-cta { height: 30px !important; padding: 0 10px !important; gap: 5px !important; animation: ctaGlow 2.4s ease-in-out infinite !important; }
  html body .free-cta.free-cta .cta-tx small { display: none !important; }
  html body .free-cta.free-cta .cta-tx, html body .free-cta.free-cta .cta-tx * { font-size: 13px !important; font-weight: 800; }
  html body .free-cta.free-cta > img, html body .free-cta.free-cta > svg { display: block !important; width: 14px !important; height: 14px !important; }
}
@keyframes ctaGlow { 0%, 100% { filter: drop-shadow(0 0 0 rgba(255, 213, 74, 0)); } 50% { filter: drop-shadow(0 0 6px rgba(255, 213, 74, .9)); } }
/* 13: tên lĩnh vực dưới icon của biểu đồ mạng nhện */
.rd-ax { display: block; width: 32px; height: 32px; pointer-events: none; }
.rd-ax .rd-nm { position: absolute; }
.rd-ax .rd-nm.up { bottom: calc(100% + 3px); left: 50%; transform: translateX(-50%); }
.rd-ax .rd-nm.dn { top: calc(100% + 3px); left: 50%; transform: translateX(-50%); }
.rd-ax .rd-nm.lf { right: calc(100% + 4px); top: 50%; transform: translateY(-50%); }
.rd-ax .rd-nm.rt { left: calc(100% + 4px); top: 50%; transform: translateY(-50%); }
.rd-ax .rd-nm { font-size: 10px; font-weight: 800; line-height: 1.1; color: #3b2614; white-space: nowrap; background: rgba(255, 246, 228, .85); padding: 0 3px; }
/* 11: chữ "Chuỗi" trên ô quà theo chuỗi */
#page-rewards .slot .price .stk-l { margin-right: 2px; }
/* 16: Đặt lại dữ liệu: dời xuống cuối, dạng chữ nhỏ để tránh bấm nhầm */
.set-wipe { display: flex; align-items: center; justify-content: center; gap: 5px; margin: 14px auto 4px; padding: 6px 10px; border: 0; background: none; cursor: pointer; font: inherit; font-size: 13px; font-weight: 700; color: #b0423f; text-decoration: underline; text-underline-offset: 3px; }
.set-wipe img, .set-wipe svg { width: 16px; height: 16px; }
/* 17: chuyển trang trên điện thoại mờ dần nhẹ 120ms */
html:not(.desk) #pages > .page.active { animation: pgFade .12s ease-out !important; }
@keyframes pgFade { from { opacity: 0; } to { opacity: 1; } }
/* 18: lên cấp: chữ LV trên HUD nảy lên, số cấp trong màn ăn mừng nảy vào */
#hud .hud-lv.lv-pop { animation: lvPop .6s cubic-bezier(.3, 1.6, .5, 1); transform-origin: 0 50%; }
@keyframes lvPop { 0% { transform: scale(1); } 40% { transform: scale(1.6); filter: drop-shadow(0 0 6px #ffd54a); } 100% { transform: scale(1); } }
.dialog .dlg-hero .big-num { display: inline-block; animation: lvNum .7s cubic-bezier(.3, 1.7, .5, 1) .15s both; }
@keyframes lvNum { from { transform: scale(.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
/* 19: tab game nhú ra thưa hơn (8 giây/lần) */
html:not(.desk) body #game-btn.game-btn:not([hidden]):not(.open) { animation: gbPeek 8s ease-in-out infinite !important; }
@keyframes gbPeek { 0%, 92%, 100% { translate: 0 0; } 95% { translate: -5px 0; } 98% { translate: 0 0; } }
/* 22: ô 7 ngày to hơn */
.q-w7 i { width: 12px !important; height: 12px !important; }
/* chống dính: nút Đổi trong ô quà cách mép ô */
html:not(.desk) #page-rewards .shop .slot .btn { width: calc(100% - 20px) !important; max-width: calc(100% - 20px) !important; margin: 6px auto 2px !important; box-sizing: border-box; }
#page-rewards .slot .price:has(.stk-l) { flex-wrap: wrap; justify-content: center; row-gap: 0; }
#page-rewards .slot .price .stk-l { flex-basis: 100%; text-align: center; margin: 0 !important; font-size: 11px; }
html:not(.desk) #page-rewards .shop .slot { padding-top: 8px !important; padding-bottom: 10px !important; }
/* chống dính: bảng tên chậu ngắn không chạm nhau, huy hiệu đỏ tách khỏi chữ LV, nhãn ngày tách khỏi thanh tiến độ */
#garden .pot-sign.short { max-width: calc(var(--gap, 999px) - 10px) !important; overflow: hidden; }
#garden .pot-sign.short b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
html.mob #garden .pot-badge, html:not(.desk) #garden .pot-badge { left: calc(50% + var(--sp) * 8 + 8px) !important; }
html:not(.desk) .q-bot .q-dlbl { bottom: calc(50% + 27px) !important; }
div:has(> .rd-ax) { margin-top: 20px !important; margin-bottom: 22px !important; }
html:not(.desk) #nav .navbar { padding-left: 6px !important; padding-right: 6px !important; box-sizing: border-box; }
/* 2: chọn nhanh nhiệm vụ mẫu cho người mới */
.starter-list { display: grid; gap: 8px; }
.starter-it { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; cursor: pointer; font: inherit; font-size: 14px; font-weight: 700; text-align: left; color: #3b2614; background: #fff8e8; box-shadow: 0 0 0 2px rgba(34, 25, 46, .25); }
.starter-it.on { background: #e4f5d8; box-shadow: 0 0 0 2px #2f8a2a; }
.starter-it .st-box { width: 20px; height: 20px; flex: none; display: grid; place-items: center; background: #fff; box-shadow: 0 0 0 2px #3b2614; }
.starter-it.on .st-box { background: #6cd04a; }
.starter-it img, .starter-it svg { width: 24px; height: 24px; flex: none; }
.starter-it .st-box img, .starter-it .st-box svg { width: 16px; height: 16px; }
.starter #st-go, .starter #st-skip { width: calc(100% - 8px) !important; margin-left: 4px !important; margin-right: 4px !important; box-sizing: border-box; }
.starter-list { padding: 3px; }
.starter-it:focus { outline: none; }
/* trang Nhiệm vụ (điện thoại): bỏ thanh gỗ + HUD, danh sách lên sát đỉnh màn hình */
html:not(.desk) body[data-page="quests"] { --hud-h: max(12px, env(safe-area-inset-top, 0px)); }
html:not(.desk) body[data-page="quests"] #hud { display: none !important; }
/* demo: logo dạt sang trái để nút "Tạo tài khoản thật" bên phải không che logo */
html:not(.desk) body:has(#free-cta) #hud .hud-logo { justify-content: flex-start !important; padding-left: 12px !important; }
@media (max-width: 760px) { html body .free-cta.free-cta { right: 10px !important; top: max(6px, env(safe-area-inset-top)) !important; } html body .free-cta.free-cta .cta-tx { white-space: nowrap; } }
html:not(.desk) body[data-page="quests"]:has(#free-cta) { --hud-h: calc(max(12px, env(safe-area-inset-top, 0px)) + 40px); }
/* điểm danh 7 ngày */
.daily-chest .dc-dots { display: flex; gap: 10px; justify-content: center; margin: 4px 0 10px; }
.daily-chest .dc-dots i { width: 26px; height: 26px; display: grid; place-items: center; background: #efe3c8; box-shadow: 0 0 0 2px rgba(34, 25, 46, .3); }
.daily-chest .dc-dots i.on { background: #6cd04a; box-shadow: 0 0 0 2px #2f8a2a; }
.daily-chest .dc-dots i.gift { background: #ffe9a8; box-shadow: 0 0 0 2px #e0a526; }
.daily-chest .dc-dots i.gift.on { background: #ffd54a; }
.daily-chest .dc-dots img, .daily-chest .dc-dots svg { width: 18px; height: 18px; }

/* v267: bỏ HUD + thanh gỗ ở Tiến độ / Phần thưởng / Cài đặt; Nhiệm vụ: thanh tiêu đề gỗ; Tiến độ: HUD avatar căn giữa */
html:not(.desk) body[data-page="rewards"], html:not(.desk) body[data-page="settings"] { --hud-h: max(12px, env(safe-area-inset-top, 0px)); }
html:not(.desk) body[data-page="rewards"] #hud, html:not(.desk) body[data-page="settings"] #hud { display: none !important; }
html:not(.desk) body[data-page="rewards"]:has(#free-cta), html:not(.desk) body[data-page="settings"]:has(#free-cta) { --hud-h: calc(max(12px, env(safe-area-inset-top, 0px)) + 40px); }

html:not(.desk) body[data-page="quests"] { --hud-h: calc(max(0px, env(safe-area-inset-top, 0px)) + 66px); }
html:not(.desk) body[data-page="quests"]:has(#free-cta) { --hud-h: calc(max(0px, env(safe-area-inset-top, 0px)) + 66px); }
html:not(.desk) body[data-page="quests"] .q-title, html:not(.desk) body[data-page="quests"] .q-title.done, html:not(.desk) body[data-page="quests"] .q-title.rev { position: fixed; top: 0; left: 0; right: 0; z-index: 19; margin: 0; height: calc(max(0px, env(safe-area-inset-top, 0px)) + 56px); padding: max(0px, env(safe-area-inset-top, 0px)) 12px 0; display: flex; align-items: center; justify-content: center; box-sizing: border-box; font-size: 17px; letter-spacing: .03em; color: #fff6e0; -webkit-text-stroke: 4px #3b200e; paint-order: stroke fill; background: repeating-linear-gradient(180deg, #9c6234 0 26px, #8b552c 26px 28px, #a86a39 28px 54px, #7d4b26 54px 56px); box-shadow: 0 4px 0 #3b200e, 0 8px 0 rgba(0,0,0,.28), inset 0 -4px 0 #5a3315; }
html:not(.desk) body[data-page="quests"] .q-title.done { color: #8dff9a; }
html:not(.desk) body[data-page="quests"] .q-title.rev { color: #7fd3ff; }
html:not(.desk) body[data-page="quests"]:has(#free-cta) .q-title { justify-content: flex-start; padding-left: 14px; font-size: 14px; }
html:not(.desk) body[data-page="quests"]:has(#free-cta) .free-cta.free-cta { top: calc(max(0px, env(safe-area-inset-top, 0px)) + 13px) !important; z-index: 22; }

html:not(.desk) body[data-page="progress"] { --hud-h: calc(max(12px, env(safe-area-inset-top, 0px)) + 132px); }
html:not(.desk) body[data-page="progress"] #hud { background: #fff6e4 !important; box-shadow: none !important; flex-direction: column !important; align-items: center !important; justify-content: flex-end !important; gap: 6px !important; padding: max(12px, env(safe-area-inset-top, 0px)) 12px 8px !important; height: var(--hud-h) !important; }
html:not(.desk) body[data-page="progress"] #hud .hud-logo, html:not(.desk) body[data-page="progress"] #hud .hud-btns, html:not(.desk) body[data-page="progress"] #hud #hud-more, html:not(.desk) body[data-page="progress"] #hud .hud-stat { display: none !important; }
html:not(.desk) body[data-page="progress"] #hud .hud-level { position: static !important; transform: none !important; margin: 0 !important; display: flex !important; flex-direction: column !important; align-items: center !important; gap: 6px !important; background: none !important; box-shadow: none !important; padding: 0 !important; }
html:not(.desk) body[data-page="progress"] #hud .hud-portrait { width: 72px !important; height: 72px !important; }
html:not(.desk) body[data-page="progress"] #hud .hud-who { transform: none !important; position: static !important; }
html:not(.desk) body[data-page="progress"] #hud .hud-who .hud-nm { flex-direction: row !important; align-items: center !important; gap: 8px !important; }
html:not(.desk) body[data-page="progress"] #hud .hud-res { position: static !important; transform: none !important; margin: 0 !important; }
html:not(.desk) body[data-page="progress"] #hud .hud-ava { order: 1 !important; margin: 0 !important; }
html:not(.desk) body[data-page="progress"] #hud .hud-who { order: 2 !important; margin: 0 !important; height: auto !important; }
html:not(.desk) body[data-page="progress"] #hud .hud-who .hud-nm { top: 0 !important; }
html:not(.desk) body[data-page="progress"] #hud .hud-level, html:not(.desk) body[data-page="progress"] #hud .hud-ava, html:not(.desk) body[data-page="progress"] #hud .hud-who, html:not(.desk) body[data-page="progress"] #hud .hud-nm, html:not(.desk) body[data-page="progress"] #hud .hud-res { translate: none !important; }

/* v268: mỗi trang (điện thoại) có thanh gỗ: logo căn giữa + tiêu đề trang */
#pbar { display: none; }
html:not(.desk) body:not([data-page="hero"]) #pbar { display: block; position: fixed; top: 0; left: 0; right: 0; z-index: 21; pointer-events: none; background: repeating-linear-gradient(180deg, #9c6234 0 26px, #8b552c 26px 28px, #a86a39 28px 54px, #7d4b26 54px 56px); box-shadow: 0 4px 0 #3b200e, 0 8px 0 rgba(0,0,0,.28), inset 0 -4px 0 #5a3315; }
#pbar .pb-logo { display: flex; align-items: center; justify-content: center; gap: 8px; height: calc(max(0px, env(safe-area-inset-top, 0px)) + 36px); padding-top: max(0px, env(safe-area-inset-top, 0px)); box-sizing: border-box; background: rgba(0,0,0,.28); box-shadow: inset 0 -3px 0 #3b200e; font-family: var(--pixel); font-weight: 700; font-size: 16px; letter-spacing: 1px; color: #fff; text-shadow: 2px 2px 0 #22192e; }
#pbar .pb-logo img { width: 22px; height: 22px; image-rendering: pixelated; }
#pbar .pb-logo b { color: var(--gold); font-weight: 700; }
#pbar .pb-t { height: 46px; padding: 0 12px 4px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 17px; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; color: #fff6e0; -webkit-text-stroke: 4px #3b200e; paint-order: stroke fill; }
#pbar .pb-t[data-k="done"] { color: #8dff9a; }
#pbar .pb-t[data-k="rev"] { color: #7fd3ff; }
html:not(.desk) body[data-page="quests"] .q-title { display: none !important; }
html:not(.desk) body[data-page="rewards"], html:not(.desk) body[data-page="settings"], html:not(.desk) body[data-page="quests"], html:not(.desk) body[data-page="rewards"]:has(#free-cta), html:not(.desk) body[data-page="settings"]:has(#free-cta), html:not(.desk) body[data-page="quests"]:has(#free-cta) { --hud-h: calc(max(0px, env(safe-area-inset-top, 0px)) + 94px); }
html:not(.desk) body[data-page="progress"] { --hud-h: calc(max(0px, env(safe-area-inset-top, 0px)) + 226px); }
html:not(.desk) body[data-page="progress"] #hud { padding: calc(max(0px, env(safe-area-inset-top, 0px)) + 96px) 12px 8px !important; }
/* demo: nút "Tạo tài khoản thật" nằm riêng 1 hàng, căn giữa, ngay dưới thanh gỗ / HUD */
html:not(.desk) body:has(#free-cta) .free-cta.free-cta { left: 0 !important; right: 0 !important; margin: 0 auto !important; width: max-content; translate: none !important; z-index: 23; }
html:not(.desk) body:not([data-page="hero"]):has(#free-cta) .free-cta.free-cta { top: calc(max(0px, env(safe-area-inset-top, 0px)) + 94px) !important; }
html:not(.desk) body[data-page="hero"]:has(#free-cta) .free-cta.free-cta { top: calc(max(0px, env(safe-area-inset-top, 0px)) + 108px) !important; left: auto !important; right: 10px !important; margin: 0 !important; }
html:not(.desk) body[data-page="rewards"]:has(#free-cta), html:not(.desk) body[data-page="settings"]:has(#free-cta), html:not(.desk) body[data-page="quests"]:has(#free-cta) { --hud-h: calc(max(0px, env(safe-area-inset-top, 0px)) + 136px); }
html:not(.desk) body[data-page="progress"]:has(#free-cta) { --hud-h: calc(max(0px, env(safe-area-inset-top, 0px)) + 268px); }
html:not(.desk) body[data-page="progress"]:has(#free-cta) #hud { padding-top: calc(max(0px, env(safe-area-inset-top, 0px)) + 138px) !important; }
html:not(.desk) body:has(#free-cta) #hud .hud-logo { justify-content: center !important; padding-left: 0 !important; }
.snd-tg { min-width: 48px; min-height: 48px; padding: 2px; }
.snd-tg.on { --b: var(--gold); --bd: var(--gold-d); --bl: var(--gold-l); }
/* v270: nút ngôn ngữ 1 chạm; nút ❓ trang Phần thưởng */
.lang-tg { gap: 6px; min-width: 76px; font-weight: 800; }
.lang-tg b { font-size: 15px; }
.lang-tg .lang-nx { font-size: 12px; opacity: .6; }
.rw-help { flex: none; width: 44px; min-width: 44px; min-height: 44px; padding: 0; align-self: center; }
.rw-help img, .rw-help svg { width: 24px; height: 24px; }
.rw-help.on { --b: var(--gold); --bd: var(--gold-d); --bl: var(--gold-l); }
html:not(.desk) body[data-page="rewards"] .rw-head { display: flex !important; align-items: center !important; gap: 10px !important; }
html:not(.desk) body[data-page="rewards"] .rw-head .rw-tabs { flex: 1 !important; width: auto !important; min-width: 0; }
/* v271: thanh logo gỗ giống hệt nhau mọi trang (cả Vườn cây); tiêu đề 2 dòng */
html:not(.desk) body #pbar { display: block !important; position: fixed; top: 0; left: 0; right: 0; z-index: 21; pointer-events: none; }
html:not(.desk) body #pbar .pb-logo { height: calc(max(0px, env(safe-area-inset-top, 0px)) + 40px); }
html:not(.desk) body[data-page="hero"] #pbar { box-shadow: 0 4px 0 #3b200e, 0 8px 0 rgba(0,0,0,.28); }
html:not(.desk) body[data-page="hero"] #pbar .pb-t { display: none; }
html:not(.desk) body #hud .hud-logo { display: none !important; }
#pbar .pb-t { height: 52px; flex-direction: column; gap: 1px; line-height: 1.05; }
#pbar .pb-t b { font-weight: 800; }
#pbar .pb-s { font-size: 11px; font-weight: 800; letter-spacing: .04em; color: #ffe8b0; -webkit-text-stroke: 3px #3b200e; }
#pbar .pb-s:empty { display: none; }
#pbar .pb-s[data-k="done"] { color: #8dff9a; }
#pbar .pb-s[data-k="rev"] { color: #7fd3ff; }
#pbar .pb-t[data-k] { color: #fff6e0; }
html:not(.desk) body[data-page="rewards"], html:not(.desk) body[data-page="settings"], html:not(.desk) body[data-page="quests"] { --hud-h: calc(max(0px, env(safe-area-inset-top, 0px)) + 104px) !important; }
html:not(.desk) body[data-page="progress"] { --hud-h: calc(max(0px, env(safe-area-inset-top, 0px)) + 240px) !important; }
html:not(.desk) body[data-page="progress"] #hud { padding-top: calc(max(0px, env(safe-area-inset-top, 0px)) + 108px) !important; }
html:not(.desk) body[data-page="hero"] #pbar { background: repeating-linear-gradient(180deg, #9c6234 0 26px, #8b552c 26px 28px, #a86a39 28px 54px, #7d4b26 54px 56px); }
#pbar .pb-t { gap: 4px; padding-bottom: 6px; }
/* v271: nút Vườn cây ở giữa thanh menu, nổi bật */
html:not(.desk) #nav, html:not(.desk) #nav .navbar { overflow: visible !important; }
html:not(.desk) #nav .nav-btn.nav-main { position: relative; z-index: 2; flex: none !important; width: 68px !important; min-width: 68px !important; height: 68px !important; min-height: 68px !important; margin: -26px 4px 0 !important; padding: 0 !important; align-self: flex-start; --b: #3f9a56; --bd: #2a6b3b; --bl: #6cc37f; background: #3f9a56 !important; border-radius: 50% !important; box-shadow: 0 0 0 4px #22192e, 0 0 0 7px #f2cf7a, 0 6px 0 7px rgba(0,0,0,.3), inset 0 -5px 0 #2a6b3b !important; }
html:not(.desk) #nav .nav-btn.nav-main > img, html:not(.desk) #nav .nav-btn.nav-main > svg { width: 44px !important; height: 44px !important; filter: drop-shadow(0 3px 0 rgba(0,0,0,.35)); }
html:not(.desk) #nav .nav-btn.nav-main.active { background: var(--gold) !important; box-shadow: 0 0 0 4px #22192e, 0 0 0 7px #fff6e0, 0 6px 0 7px rgba(0,0,0,.3), inset 0 -5px 0 var(--gold-d) !important; }
/* v272: việc đã hoàn thành mờ hơn nữa (dấu tích vẫn rõ) */
html body .qrow.done > :not(.qdone) { opacity: .3 !important; }
html body .qrow.done > .qm { opacity: .5 !important; }
html body .qrow.done .qm .nm { opacity: 1 !important; color: #6b7660 !important; }
/* v273: dòng "Cần hoàn thành hôm nay" nằm dưới thanh gỗ; tab menu đang chọn dạng hình tròn */
html:not(.desk) body[data-page="quests"] .q-title, html:not(.desk) body[data-page="quests"] .q-title.done, html:not(.desk) body[data-page="quests"] .q-title.rev { display: block !important; position: static !important; height: auto !important; margin: 4px 0 10px !important; padding: 0 12px !important; background: none !important; box-shadow: none !important; font-size: 14px !important; letter-spacing: .03em; text-align: center; -webkit-text-stroke: 0 !important; text-shadow: none !important; color: #22192e !important; }
html:not(.desk) body[data-page="quests"] .q-title.done { color: #1d7a34 !important; }
html:not(.desk) body[data-page="quests"] .q-title.rev { color: #1f5f9a !important; }
html:not(.desk) body[data-page="quests"] { --hud-h: calc(max(0px, env(safe-area-inset-top, 0px)) + 78px) !important; }
html:not(.desk) body[data-page="quests"] #pbar .pb-t { height: 38px; padding-bottom: 4px; }
html:not(.desk) #nav .nav-btn.active:not(.nav-main) { border-radius: 50% !important; width: 60px !important; min-width: 60px !important; height: 60px !important; min-height: 60px !important; flex: none !important; align-self: center; margin: 0 2px !important; padding: 0 !important; box-shadow: 0 0 0 3px #22192e, inset 0 -4px 0 var(--gold-d) !important; }
/* v274: pop-up nhắc demo gọn hơn */
html body #toast-root .toast.toast-nudge { max-width: min(290px, calc(100% - 72px)); padding: 8px 10px 8px 8px; justify-content: center; }
html body .toast-nudge .grow { flex: 1 1 100%; font-size: 14px; text-align: center; }
html body .toast-nudge .btn { white-space: nowrap; font-size: 14px; padding: 4px 8px; }
/* v275: HUD trang Tiến độ — LV xuống dòng, ẩn xu, thanh XP các lĩnh vực; nút chia sẻ góc phải */
.hud-areas, .hud-share { display: none; }
html:not(.desk) body[data-page="progress"] #hud .hud-res { display: none !important; }
html:not(.desk) body[data-page="progress"] #hud .hud-who .hud-nm { flex-direction: column !important; align-items: center !important; gap: 2px !important; height: auto !important; }
html:not(.desk) body[data-page="progress"] #hud .hud-areas { display: flex; gap: 8px; justify-content: center; align-items: flex-end; margin: 4px 0 0; }
html:not(.desk) body[data-page="progress"] #hud .hud-areas .ha { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 34px; }
html:not(.desk) body[data-page="progress"] #hud .hud-areas .ha img, html:not(.desk) body[data-page="progress"] #hud .hud-areas .ha svg { width: 22px; height: 22px; }
html:not(.desk) body[data-page="progress"] #hud .hud-areas .ha i { display: block; width: 100%; height: 6px; background: rgba(34, 25, 46, .22); box-shadow: 0 0 0 2px #22192e; }
html:not(.desk) body[data-page="progress"] #hud .hud-areas .ha b { display: block; height: 100%; background: var(--sc); }
html:not(.desk) body[data-page="progress"] #hud .hud-share { display: inline-flex; position: fixed; top: calc(max(0px, env(safe-area-inset-top, 0px)) + 100px); right: 10px; z-index: 22; align-items: center; gap: 4px; min-height: 30px; padding: 2px 8px; font-size: 12px; font-weight: 800; color: #3a2410; background: var(--gold); box-shadow: 0 0 0 2px #22192e, inset 0 -3px 0 var(--gold-d); border: 0; border-radius: 0; }
html:not(.desk) body[data-page="progress"] #hud .hud-share img, html:not(.desk) body[data-page="progress"] #hud .hud-share svg { width: 16px; height: 16px; }
html:not(.desk) body[data-page="progress"] #page-progress .jr-btn { display: none !important; }
html:not(.desk) body[data-page="progress"] { --hud-h: calc(max(0px, env(safe-area-inset-top, 0px)) + 282px) !important; }
/* v276: topbar trang Nhiệm vụ cùng kích thước các trang khác */
html:not(.desk) body[data-page="quests"] #pbar .pb-t { height: 52px; padding-bottom: 6px; }
html:not(.desk) body[data-page="quests"] { --hud-h: calc(max(0px, env(safe-area-inset-top, 0px)) + 104px) !important; }
html:not(.desk) body[data-page="quests"] .q-title { margin: 0 0 10px !important; }
/* v277: menu dưới cố định kích thước ở mọi tab */
html:not(.desk) #nav .navbar { display: flex !important; align-items: center !important; justify-content: space-between !important; height: 72px !important; min-height: 72px !important; box-sizing: border-box !important; padding: 0 14px !important; gap: 0 !important; }
html:not(.desk) #nav .nav-btn:not(.nav-main), html:not(.desk) #nav .nav-btn.active:not(.nav-main) { flex: none !important; width: 60px !important; min-width: 60px !important; max-width: 60px !important; height: 60px !important; min-height: 60px !important; max-height: 60px !important; margin: 0 !important; padding: 0 !important; border-radius: 50% !important; align-self: center !important; }
html:not(.desk) #nav .nav-btn.nav-main, html:not(.desk) #nav .nav-btn.nav-main.active { flex: none !important; width: 68px !important; min-width: 68px !important; max-width: 68px !important; height: 68px !important; min-height: 68px !important; margin: -26px 0 0 !important; align-self: flex-start !important; }
html:not(.desk) #nav .nav-btn:not(.active):not(.nav-main) { box-shadow: none !important; background: transparent !important; }
/* v278: nút X cho pop-up nhắc demo; pop-up mở rương nâng cao hơn */
.toast-nudge { position: relative; }
.toast-nudge .toast-x { position: absolute; top: -10px; right: -10px; z-index: 2; width: 28px; height: 28px; min-width: 0; min-height: 0; padding: 0; display: inline-flex; align-items: center; justify-content: center; margin: 0; background: #fff6e0; color: #22192e; border: 0; box-shadow: 0 0 0 2px #22192e, 0 2px 0 2px rgba(0,0,0,.3); cursor: pointer; }
.toast-nudge .toast-x img, .toast-nudge .toast-x svg { width: 16px; height: 16px; }
html:not(.desk) .modal-back:has(.chest-dlg) { padding-bottom: calc(var(--safe, 12px) + 110px); }
/* v279: nút menu dưới không nhúng/dịch khi bấm */
html:not(.desk) #nav .nav-btn:active, html:not(.desk) #nav .nav-btn.is-down { transform: none !important; }
/* v280: trang Tiến độ — avatar + thanh lĩnh vực nằm trong trang (cuộn theo), nút chia sẻ icon */
html:not(.desk) body[data-page="progress"] #hud { display: none !important; }
html:not(.desk) body[data-page="progress"], html:not(.desk) body[data-page="progress"]:has(#free-cta) { --hud-h: calc(max(0px, env(safe-area-inset-top, 0px)) + 104px) !important; }
.pg-hero { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 10px 14px; margin: 0 0 12px; }
.pg-share { position: absolute; top: 0; right: 4px; width: 40px; height: 40px; min-width: 40px; min-height: 40px; padding: 0; display: inline-flex; align-items: center; justify-content: center; background: var(--gold); border: 0; box-shadow: 0 0 0 2px #22192e, inset 0 -3px 0 var(--gold-d); cursor: pointer; }
.pg-share img, .pg-share svg { width: 24px; height: 24px; }
.pg-ava { display: block; box-sizing: border-box; width: 72px; height: 72px; padding: 4px; border-radius: 50%; background: conic-gradient(#b68bff var(--xp, 0%), rgba(20, 14, 36, .6) 0); box-shadow: 0 0 0 3px #22192e, 0 0 10px rgba(182, 139, 255, .35); }
.pg-ava img { width: 100%; height: 100%; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #bfe6ff, #6fb6e8); box-shadow: 0 0 0 2px #22192e; }
.pg-name { margin-top: 4px; font-size: 17px; font-weight: 800; color: #22192e; }
.pg-lv { font-size: 14px; font-weight: 800; color: #6a5a9a; margin-bottom: 8px; }
.pg-areas { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.pg-ar { display: grid; grid-template-columns: 28px 1fr 64px; column-gap: 8px; row-gap: 4px; align-items: center; padding: 8px 10px; background: rgba(255, 255, 255, .55); box-shadow: 0 0 0 2px rgba(34, 25, 46, .25); }
.pg-ai img, .pg-ai svg { width: 28px; height: 28px; display: block; }
.pg-an { font-size: 14px; font-weight: 800; color: #22192e; }
.pg-al { font-size: 13px; font-weight: 800; color: #22192e; }
.pg-ab { grid-column: 1 / 3; height: 10px; background: rgba(34, 25, 46, .2); box-shadow: 0 0 0 2px #22192e; position: relative; overflow: hidden; }
.pg-ab i { display: block; height: 100%; background: var(--sc); }
.pg-ax { font-size: 12px; font-weight: 800; color: #6a5a9a; text-align: right; }
.pg-al { text-align: right; }
/* v281: animation êm khi chuyển tab menu dưới */
html:not(.desk) #nav .nav-btn { transition: background-color .28s ease, box-shadow .28s ease, color .2s ease; }
html:not(.desk) #nav .nav-btn > img, html:not(.desk) #nav .nav-btn > svg { transition: transform .3s cubic-bezier(.3, 1.4, .5, 1), filter .3s ease; }
html:not(.desk) #nav .nav-btn.active:not(.nav-main) > img, html:not(.desk) #nav .nav-btn.active:not(.nav-main) > svg { transform: scale(1.08); }
html:not(.desk) #nav .nav-btn.pop > img, html:not(.desk) #nav .nav-btn.pop > svg { animation: navPop .5s cubic-bezier(.3, 1.5, .5, 1); }
html:not(.desk) #nav .nav-btn.pop.nav-main { animation: navMainPop .5s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes navPop { 0% { transform: scale(.75) translateY(4px); } 55% { transform: scale(1.22) translateY(-3px); } 100% { transform: scale(1.08) translateY(0); } }
@keyframes navMainPop { 0% { transform: scale(.9); } 55% { transform: scale(1.1); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { html:not(.desk) #nav .nav-btn, html:not(.desk) #nav .nav-btn > img, html:not(.desk) #nav .nav-btn > svg { transition: none; animation: none !important; } }
/* v282: Tiến độ — lịch theo tháng (mũi tên) đặt trên radar; thanh lĩnh vực xuống cuối */
.cal-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 10px; }
.cal-nav .btn { min-width: 40px; min-height: 40px; width: 40px; padding: 0; }
.cal-nav .btn:disabled { opacity: .35; }
.cal-nav .cal-mon { flex: 1; text-align: center; font-size: 16px; font-weight: 800; }
html:not(.desk) #psub > .pair2 { display: flex; flex-direction: column; gap: 12px; }
html:not(.desk) #psub > .pair2 > .pn-cal { order: -1; }
.pg-hero.pg-bottom { margin: 12px 0 0; padding: 0 0 12px; }
html:not(.desk) #page-progress #psub > .pg-hero.pg-bottom { order: 6; }
html:not(.desk) #page-progress #psub > .pair2 { display: flex; flex-direction: column; gap: 12px; }
html:not(.desk) #page-progress #psub > .pair2 > .pn-cal { order: -1; }
html:not(.desk) #page-progress #psub > .pair2 > .panel { margin-left: 4px; margin-right: 4px; }
html:not(.desk) #page-progress #psub > .pg-hero.pg-bottom { margin: 12px 4px 0; padding: 0 0 12px; }
/* v283: nút Vườn cây hạ thấp hơn */
html:not(.desk) #nav .nav-btn.nav-main, html:not(.desk) #nav .nav-btn.nav-main.active { margin-top: -12px !important; }
html:not(.desk) #page-progress #psub > .pg-hero.pg-bottom { padding: 0 0 12px; }
.pg-bottom .hero-list { width: 100%; }
html:not(.desk) #page-progress #psub > .pg-hero.pg-bottom { padding: 6px 4px 8px; margin: 12px 4px 0; }
.pg-bottom .srow .nm { color: #22192e; text-shadow: none; }
.pg-bottom .srow .lv { color: #b06a10; text-shadow: none; }
/* v285: chạm chậu → nhãn tên + Lv thay nút Thêm chậu; thẻ nhiệm vụ chỉ có tiêu đề "Nhiệm vụ:" */
#bed-addpot.is-label { border-style: solid; border-color: #22192e; background: #fff6e0; color: #22192e; box-shadow: 0 0 0 2px rgba(255,246,224,.9), inset 0 -3px 0 rgba(0,0,0,.12); pointer-events: none; gap: 8px; }
#bed-addpot.is-label b { text-shadow: none; font-size: 14px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
#bed-addpot.is-label .num { font-size: 13px; font-weight: 800; color: #b06a10; }
#bed-addpot.grow { animation: bedLbl .38s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes bedLbl { 0% { transform: translateX(-50%) scale(.3); opacity: 0; } 60% { transform: translateX(-50%) scale(1.12); opacity: 1; } 100% { transform: translateX(-50%) scale(1); } }
.pot-card .pc-t { font-size: 14px; font-weight: 800; letter-spacing: .02em; margin: 0 0 6px; color: #22192e; }
@media (prefers-reduced-motion: reduce) { #bed-addpot.grow { animation: none; } }
.pot-card .pc-t { text-align: center; }
#bed-addpot.is-label { padding: 0 12px; }
/* v287: slide giới thiệu — bullet có icon, kích thước pop-up cố định mọi slide */
.intro-pts { margin: 4px 0 0; gap: 12px; }
.intro-pts li { align-items: center; }
html:not(.desk) .onb.intro .onb-in { height: min(540px, 100%); max-height: none; }
html:not(.desk) .intro-pts { gap: 10px; }
html:not(.desk) .intro-pts li > img, html:not(.desk) .intro-pts li > svg { width: 28px; height: 28px; }
html:not(.desk) .intro-txt { min-height: 150px; }

/* v288: nút game lấp ló mép phải cả desktop; có lượt chơi thì màu vàng */
html.desk body #game-btn.game-btn:not([hidden]) { top: calc(var(--hud-h, 70px) + 150px) !important; bottom: auto !important; left: auto !important; right: 0 !important; transform: translateX(calc(100% - 38px)) !important; height: 40px; padding: 0 12px 0 8px !important; gap: 6px; z-index: 24; transition: transform .2s ease-out, height .2s ease-out; }
html.desk body #game-btn.game-btn:not([hidden]):hover, html.desk body #game-btn.game-btn.open:not([hidden]) { transform: translateX(0) !important; height: 48px; }
html.desk body #game-btn.game-btn:not([hidden]):not(.open) { animation: gbPeek 8s ease-in-out infinite; }
html.desk body #game-btn.game-btn:not([hidden]) .gb-ic > * { width: 26px; height: 26px; }
body #game-btn.game-btn[data-mode="play"] { background: #ffc928; }
body #game-btn.game-btn[data-mode="play"]:hover { background: #ffd54a; }
body #game-btn.game-btn[data-mode="play"] .gb-txt { color: #4a2c00; }
/* v288: desktop: nút phần thưởng nổi xuống góc trái dưới */
html.desk .gift-fab { left: 24px !important; right: auto !important; top: auto !important; bottom: 40px !important; }
/* v289: trang Tiến độ desktop giống mobile: avatar + tên + LV trên cùng, nút chia sẻ icon, lĩnh vực ở dưới cùng */
html.desk .pg-hero:not(.pg-bottom) { display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 14px; padding: 4px 56px 4px 10px; margin: 0; }
html.desk #psub > .pg-hero:not(.pg-bottom) { grid-area: hero; }
html.desk .pg-hero:not(.pg-bottom) .pg-name { margin: 0; color: #fff6e0; font-size: 20px; }
html.desk .pg-hero:not(.pg-bottom) .pg-lv { margin: 0; color: #ffe27a; font-size: 16px; }
html.desk .pg-hero:not(.pg-bottom) .pg-share { top: 50%; right: 8px; margin-top: -20px; }
html.desk #psub > .pg-bottom { grid-area: areas; margin: 3px; padding: 10px; display: block; }
html.desk .pg-bottom .hero-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 14px; }
html.desk #psub { grid-template-rows: auto auto auto auto auto !important; grid-template-areas: "hero hero hero" "stats stats stats" "ins ins ins" "xp radar cal" "areas areas areas" !important; }
html.desk #page-progress .jr-btn, html.desk #page-progress #jr-open { display: none !important; }
html.desk .pg-hero.pg-bottom { margin: 3px; }
html.desk .pg-bottom .hero-list { grid-column: auto; grid-row: auto; justify-self: stretch; align-self: auto; max-width: none; width: 100%; padding: 4px 6px; margin: 0; }
html.desk .pg-bottom .hero-list { position: static !important; left: auto !important; top: auto !important; width: 100% !important; z-index: auto; filter: none !important; }
html.desk .pg-bottom .hero-list .srow { padding: 3px 4px; }
/* v292: desktop: nút đổi cảnh nền hiện lại trên HUD (trang vườn) */
html.desk body[data-page="hero"] #hud .hud-menu #hud-bg.hud-btn { display: inline-flex !important; }
/* v293: số kết quả minigame: font pixel không in đậm giả (bị dính thành khối) */
.g-st-t b.num { font-weight: 400 !important; font-size: 30px; letter-spacing: 1px; -webkit-text-stroke: 0; }
/* v294: desktop: mở bảng Nhiệm vụ thì nền xung quanh tối đi (vẫn chạm xuyên được vào vườn) */
html.desk body.desk-modal:has(#page-quests.page.active) #pages::before { content: ''; position: fixed; inset: 0; z-index: 39; background: rgba(12, 8, 24, .55); pointer-events: none; animation: fadeIn .18s ease-out; }
html.desk body.desk-modal #pages:has(#page-quests.page.active)::before { background: rgba(12, 8, 24, .55) !important; z-index: 39; }
/* v295: nút Phần thưởng nổi (desktop) bỏ chữ */
.gift-fab .lbl { display: none !important; }
/* v296: desktop: Phần thưởng là lưới ô vuông như mobile; nút X đóng popup */
html.desk #page-rewards .shop { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
html.desk #page-rewards .shop .slot { aspect-ratio: 1 / 1; min-height: 0; justify-content: center; overflow: hidden; padding: 8px 8px 10px; gap: 4px; }
#pg-x { position: fixed; z-index: 60; width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
#pg-x[hidden] { display: none; }
#pg-x img, #pg-x svg { width: 28px; height: 28px; }
html:not(.desk) #pg-x { display: none !important; }
html.desk #page-rewards .slot .rq { display: none; }
html.desk #page-rewards .slot[data-ready="1"] .bar { display: none; }
html.desk #page-rewards .slot > * { flex: none; }
html.desk #page-rewards .slot .nm { max-height: 40px; overflow: hidden; }
html.desk #page-rewards .slot > :first-child:not(.btn) { width: 48px; height: 48px; flex: none; }
html.desk #page-rewards .slot > :first-child:not(.btn) img, html.desk #page-rewards .slot > :first-child:not(.btn) svg { width: 100%; height: 100%; }
html.desk #page-rewards .slot { padding: 14px 10px 12px; }
html.desk #page-rewards .slot > :first-child:not(.btn) { width: 40px; height: 40px; }
html.desk #page-rewards .slot { gap: 2px; padding: 10px 10px 10px; }
html.desk #page-rewards .slot .rw-need { padding-top: 6px; padding-bottom: 6px; min-height: 0; }
/* v297: Phần thưởng + Hướng dẫn cùng style tím như popup Tiến độ */
html.desk #page-rewards.page.active:not(#page-hero), .dialog.dlg-purple {
  background:
    linear-gradient(rgba(255,230,160,.22), rgba(255,230,160,.22)) 20px 26px / 2px 2px no-repeat,
    radial-gradient(circle, rgba(255,240,200,.16) 0 1px, transparent 1.5px) 0 0 / 72px 72px,
    radial-gradient(circle, rgba(255,255,255,.08) 0 1px, transparent 1.5px) 36px 36px / 72px 72px,
    linear-gradient(180deg, #3a3170, #312862) !important; }
html.desk #page-rewards.page.active:not(#page-hero) { box-shadow: inset 0 0 0 3px #5a4fa0, inset 0 0 60px rgba(10,6,30,.45), 0 0 0 4px var(--line), 0 8px 0 4px rgba(0,0,0,.3), 0 0 0 100vmax rgba(18,12,30,.55); padding: 18px 20px 20px; }
.dialog.dlg-purple { box-shadow: inset 0 0 0 3px #5a4fa0, inset 0 0 60px rgba(10,6,30,.45), 0 0 0 4px var(--line), 0 8px 0 4px rgba(0,0,0,.3) !important; padding: 34px 18px 16px; }
.dialog.dlg-purple .help-row { background: #f3efe8; color: #22192e; box-shadow: none; margin: 0; }
.dialog.dlg-purple .help-row .muted { color: #6a5a9a; }
.dialog.dlg-purple .help-row b { color: #22192e; }
html.desk #page-rewards .seg { background: #d1cdc4; }
html.desk #page-rewards .seg .btn:not(.on):not(.active) { color: #3a2f5a; }
html.desk #page-rewards .slot.slot-empty { border-color: #8f86c8 !important; background: rgba(255,255,255,.06) !important; }
/* v298: mỗi nhiệm vụ ghi rõ nó nuôi cây nào (icon cây + tên, không ghi chữ "chậu") */
.qrow .q-pot { display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 800; color: #6a5a9a; line-height: 1.2; margin-top: 1px; min-width: 0; }
.qrow .q-pot > svg, .qrow .q-pot > img { width: 14px; height: 14px; flex: none; }
.qrow .q-pot > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html.desk #page-quests.active .qrow .q-pot { color: #7a5a30; }
/* v299: bỏ nút Quản lý chậu: tạo cây qua form nhiệm vụ, sửa cây bằng cách bấm bảng tên cây ngoài vườn */
#pots-btn { display: none !important; }
