/* 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 .nav-btn .key { position: absolute; top: 4px; left: 8px; font-family: var(--pixel); font-size: 15px; opacity: .7; }
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 chỉ số, 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 chỉ số ở 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 chỉ số & 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 chỉ số & 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 chỉ số & 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ý chỉ số */
.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 đề chỉ số khác hẳn thẻ nhiệm vụ: không khung, chữ hoa, gạch chân màu chỉ số */
.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 chỉ số */
.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 đề chỉ số (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 chỉ số 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: chỉ số 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 đủ chỉ số */
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 chỉ số 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 chỉ số 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 chỉ số */
.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 chỉ số 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: chỉ số 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 chỉ số: 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 chỉ số */
#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 chỉ số 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 chỉ số + 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: chỉ số 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 chỉ số 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; }
