/* Giao diện game Văn Lang — tông đồng thau, nâu đất, giấy dó */
:root {
  --bronze: #c08a3e;
  --bronze-hi: #e8b765;
  --bronze-dk: #7a5422;
  --earth: #2a1d12;
  --earth-2: #3a2918;
  --earth-3: #4d3720;
  --paper: #f3e3c3;
  --paper-2: #e6cfa2;
  --ink: #2b1a0c;
  --red: #c4372b;
  --blue: #2f6fc4;
  --gold: #f2c14e;
  --green: #4f8a3a;
  --font: "Segoe UI", "Roboto", "Noto Sans", system-ui, -apple-system, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: #120c07; color: var(--paper);
  font-family: var(--font); font-size: 15px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
[hidden] { display: none !important; }
button { font-family: inherit; font-size: inherit; cursor: pointer; }
input { font-family: inherit; font-size: 16px; }
kbd {
  display: inline-block; min-width: 1.6em; padding: 1px 5px; text-align: center;
  border: 1px solid var(--bronze-dk); border-bottom-width: 2px; border-radius: 4px;
  background: var(--earth-3); color: var(--paper); font: 600 12px var(--font);
}

/* Hoa văn trống đồng dùng cho viền */
.panel {
  position: relative;
  background:
    radial-gradient(circle at 50% -40%, rgba(232,183,101,.18), transparent 60%),
    linear-gradient(180deg, var(--earth-2), var(--earth));
  border: 2px solid var(--bronze);
  border-radius: 14px;
  box-shadow: 0 0 0 4px rgba(0,0,0,.35), 0 0 0 5px var(--bronze-dk), 0 18px 50px rgba(0,0,0,.6);
  padding: 22px;
}
.panel::before {
  content: ""; position: absolute; left: 14px; right: 14px; top: 8px; height: 8px;
  background: repeating-linear-gradient(90deg, var(--bronze) 0 6px, transparent 6px 10px, var(--bronze-dk) 10px 12px, transparent 12px 16px);
  opacity: .55; border-radius: 4px; pointer-events: none;
}
h1, h2 { margin: 6px 0 12px; color: var(--bronze-hi); letter-spacing: .02em; }
h1 { font-size: 24px; }
h2 { font-size: 19px; }
.muted { color: #c9b28a; }
.hint { color: #a99070; font-size: 13px; margin: 4px 0; }
.error { color: #ff8a7a; min-height: 1.3em; margin: 8px 0; font-size: 14px; }
.error.ok { color: #9be38a; }

.btn {
  border: 1px solid var(--bronze); border-radius: 9px; padding: 9px 16px;
  background: linear-gradient(180deg, var(--earth-3), var(--earth-2)); color: var(--paper);
  font-weight: 600; transition: transform .06s, filter .15s;
}
.btn:hover:not(:disabled) { filter: brightness(1.15); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; }
.btn-primary {
  background: linear-gradient(180deg, var(--bronze-hi), var(--bronze) 55%, var(--bronze-dk));
  color: var(--ink); border-color: #f5d28f; width: 100%; padding: 12px; font-size: 16px;
  text-shadow: 0 1px 0 rgba(255,255,255,.35);
}

/* ---------- Màn hình ngoài game ---------- */
.screen { position: fixed; inset: 0; }
#screen-auth, #screen-create, #screen-loading {
  display: grid; place-items: center; padding: 16px; overflow: auto;
  background:
    radial-gradient(ellipse at 50% 120%, rgba(192,138,62,.35), transparent 60%),
    radial-gradient(circle at 50% 50%, #2b1d10, #0d0805 75%);
}
.auth-panel { width: min(400px, 100%); }
.auth-panel label { display: block; margin: 12px 0 0; color: #d9c29a; font-size: 14px; }
.auth-panel input {
  width: 100%; margin-top: 5px; padding: 11px 12px; border-radius: 8px;
  border: 1px solid var(--bronze-dk); background: #1a110a; color: var(--paper); outline: none;
}
.auth-panel input:focus { border-color: var(--bronze-hi); box-shadow: 0 0 0 3px rgba(232,183,101,.2); }
.logo { text-align: center; margin: 6px 0 16px; min-height: 90px; display: flex; flex-direction: column; justify-content: center; }
.logo img { max-width: 100%; max-height: 150px; object-fit: contain; }
.logo-text {
  font-size: 40px; font-weight: 800; letter-spacing: .12em; color: var(--bronze-hi);
  text-shadow: 0 2px 0 var(--bronze-dk), 0 0 24px rgba(232,183,101,.35);
}
.logo-sub { color: #c9b28a; font-size: 13px; letter-spacing: .08em; }
.tabs { display: flex; gap: 6px; margin-bottom: 4px; }
.tab {
  flex: 1; padding: 9px; border-radius: 8px; border: 1px solid var(--bronze-dk);
  background: transparent; color: #c9b28a; font-weight: 600;
}
.tab.active { background: var(--earth-3); color: var(--bronze-hi); border-color: var(--bronze); }
.auth-panel .btn-primary { margin-top: 6px; }

.loading { text-align: center; }
.drum {
  width: 96px; height: 96px; margin: 0 auto 16px; border-radius: 50%;
  background: repeating-radial-gradient(circle, var(--bronze) 0 5px, var(--bronze-dk) 5px 8px, var(--bronze-hi) 8px 10px);
  animation: spin 3s linear infinite; box-shadow: 0 0 30px rgba(232,183,101,.4);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Trong game ---------- */
#screen-game { background: #000; overflow: hidden; user-select: none; -webkit-user-select: none; }
#game-canvas { position: absolute; display: block; image-rendering: auto; }
#hud { position: absolute; inset: 0; pointer-events: none; }
#hud > * { pointer-events: auto; }


.toasts { position: absolute; left: 50%; top: 18%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.toast {
  padding: 7px 16px; border-radius: 18px; background: rgba(26,17,10,.88); border: 1px solid var(--bronze);
  font-weight: 600; text-shadow: 0 1px 2px #000; animation: toast 3.2s forwards; white-space: nowrap; max-width: 90vw; overflow: hidden; text-overflow: ellipsis;
}
.toast.big { font-size: 22px; color: var(--gold); border-color: var(--gold); padding: 10px 24px; }
@keyframes toast { 0% { opacity: 0; transform: translateY(8px); } 8%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-8px); } }
.net-status { position: absolute; right: 12px; bottom: 16px; font-size: 11px; color: #9c8768; pointer-events: none; text-shadow: 0 1px 2px #000; }

/* ---------- Cửa sổ ---------- */
.modal { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.35); z-index: 20; padding: 12px; }

.death { text-align: center; width: min(360px, 100%); }
.death h2 { color: #ff8a7a; }

.rotate { display: none; position: absolute; inset: 0; z-index: 50; background: #120c07; place-items: center; text-align: center; }
.rotate div { font-size: 64px; color: var(--bronze-hi); }
@media (orientation: portrait) and (pointer: coarse) { .rotate { display: grid; } }


/* ---------- Bình thuốc nhanh ---------- */
.quickslots { position: absolute; left: 12px; top: 112px; display: flex; gap: 8px; }
.quickslot {
  position: relative; width: 54px; height: 54px; border-radius: 10px;
  background: rgba(26,17,10,.8); border: 1px solid var(--bronze); cursor: pointer; overflow: hidden;
}
.quickslot .qs-icon { position: absolute; inset: 5px; background-size: contain; background-repeat: no-repeat; background-position: center; }
.quickslot .qs-count { position: absolute; right: 4px; bottom: 2px; font-size: 12px; font-weight: 800; text-shadow: 0 1px 2px #000; }
.quickslot kbd { position: absolute; left: 2px; top: 2px; font-size: 10px; padding: 0 3px; min-width: 0; }
.quickslot .cd { position: absolute; inset: 0; background: rgba(0,0,0,.6); transform-origin: bottom; transform: scaleY(0); }
.quickslot.empty { opacity: .45; }


/* ---------- Cụm nút hành động ---------- */
.touch { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.joy {
  position: absolute; left: 4%; bottom: 9%; width: 150px; height: 150px; border-radius: 50%;
  background: radial-gradient(circle, rgba(232,183,101,.10), rgba(232,183,101,.04) 60%, transparent 61%);
  border: 2px solid rgba(232,183,101,.35); pointer-events: auto; touch-action: none;
}
.joy-knob {
  position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, var(--bronze-hi), var(--bronze-dk)); opacity: .8;
}
.touch-buttons { position: absolute; right: 2.5%; bottom: 6%; width: 300px; height: 270px; pointer-events: none; }
.tbtn, .sbtn {
  position: absolute; border-radius: 50%; color: var(--paper); font-weight: 800; padding: 0;
  pointer-events: auto; touch-action: none; text-shadow: 0 1px 2px #000; user-select: none; -webkit-user-select: none;
}
.tbtn {
  border: 2px solid rgba(245,210,143,.7);
  background: radial-gradient(circle at 40% 35%, rgba(122,84,34,.88), rgba(42,29,18,.88));
}
.tbtn kbd, .sbtn kbd { position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); font-size: 9px; padding: 0 4px; opacity: .85; }
body.touch-mode .tbtn kbd, body.touch-mode .sbtn kbd { display: none; }
.tbtn.on, .sbtn.on { filter: brightness(1.5); transform: scale(.94); }
.t-atk { width: 104px; height: 104px; right: 0; bottom: 0; font-size: 18px; border-width: 3px; border-color: #f5d28f; }
.t-talk { width: 64px; height: 64px; right: 196px; bottom: 40px; font-size: 13px; border-color: #9be38a; background: radial-gradient(circle at 40% 35%, rgba(60,110,40,.92), rgba(30,50,20,.92)); }

.sbtn {
  width: 70px; height: 70px; border: 2px solid rgba(245,210,143,.8); overflow: hidden;
  background: radial-gradient(circle at 40% 35%, rgba(90,60,140,.9), rgba(30,20,50,.9));
}
.sbtn i { position: absolute; inset: 0; background-size: cover; background-position: center; border-radius: 50%; }
.sbtn em {
  position: absolute; inset: 0; border-radius: 50%; font-style: normal; display: grid; place-items: center;
  font-size: 18px; font-weight: 900; color: #fff; background: conic-gradient(rgba(0,0,0,.72) calc(var(--cd, 0) * 1turn), transparent 0);
}
.sbtn b { position: absolute; left: 0; right: 0; bottom: 6px; font-size: 10px; font-weight: 800; color: #9fd0ff; }
.sbtn.locked { filter: grayscale(1) brightness(.6); }
.sbtn.locked em { background: rgba(0,0,0,.5); font-size: 11px; }
.sbtn.nomp b { color: #ff8a7a; }
.s0 { right: 116px; bottom: 6px; }
.s1 { right: 96px; bottom: 96px; }
.s2 { right: 10px; bottom: 118px; }

@media (max-height: 520px) {
  .touch-buttons { transform: scale(.82); transform-origin: right bottom; }
  .joy { width: 130px; height: 130px; bottom: 7%; }
  .quickslots { top: 92px; }
}

/* ---------- Màn chọn nghề ---------- */
#screen-job { background: radial-gradient(ellipse at 50% 120%, rgba(192,138,62,.35), transparent 60%), radial-gradient(circle at 50% 40%, #2b1d10, #0d0805 75%); overflow: auto; }
.job-screen { max-width: 1200px; margin: 0 auto; padding: 14px 16px; height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.job-head { display: flex; align-items: center; gap: 16px; }
.job-head h1 { margin: 0; flex: 1; text-align: center; }
.job-body { flex: 1; display: grid; grid-template-columns: 210px 1fr 1.25fr; grid-template-rows: minmax(0, 1fr); gap: 16px; margin-top: 12px; min-height: 0; }
.job-tabs { display: flex; flex-direction: column; gap: 8px; }
.job-tab {
  display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; text-align: left;
  border: 1px solid var(--bronze-dk); background: rgba(42,29,18,.85); color: var(--paper);
}
.job-tab .dot { width: 38px; height: 38px; border-radius: 50%; flex: 0 0 38px; border: 2px solid var(--bronze); background-size: cover; background-position: center top; }
.job-tab b { display: block; font-size: 15px; }
.job-tab small { color: #c9b28a; font-size: 12px; }
.job-tab.active { border-color: var(--bronze-hi); background: linear-gradient(90deg, rgba(192,138,62,.35), rgba(42,29,18,.9)); box-shadow: 0 0 0 2px rgba(232,183,101,.25); }
.job-portrait {
  position: relative; border-radius: 16px; border: 2px solid var(--bronze-dk); overflow: hidden; min-height: 300px;
  background: radial-gradient(circle at 50% 70%, rgba(232,183,101,.25), transparent 60%), repeating-radial-gradient(circle at 50% 110%, rgba(192,138,62,.12) 0 6px, transparent 6px 22px);
}
.job-portrait canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.job-info { background: rgba(26,17,10,.7); border: 1px solid var(--bronze-dk); border-radius: 16px; padding: 14px 16px; overflow: auto; min-height: 0; display: flex; flex-direction: column; }
.job-info .btn-primary { position: sticky; bottom: 0; margin-top: auto; box-shadow: 0 -8px 16px rgba(26,17,10,.9); }
.job-info h2 { margin: 0; font-size: 24px; }
.job-info h3 { margin: 12px 0 6px; color: var(--bronze-hi); font-size: 15px; }
.job-role { margin: 2px 0 8px; color: #9be38a; font-weight: 700; }
.job-lore { margin: 0 0 8px; color: #e2d0ad; line-height: 1.5; }
.job-meta { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0 0 8px; }
.job-meta dt { color: #c9b28a; }
.job-meta dd { margin: 0; font-weight: 600; }
.job-bars { display: grid; grid-template-columns: auto 1fr; gap: 5px 10px; align-items: center; font-size: 13px; }
.job-bars .track { height: 9px; border-radius: 5px; background: #140d07; overflow: hidden; }
.job-bars .fill { height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--bronze-dk), var(--bronze-hi)); }
.job-skills { display: flex; gap: 10px; }
.job-skill {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: 10px;
  border: 1px solid var(--bronze-dk); background: rgba(42,29,18,.85); color: var(--paper); font-size: 12px;
}
.job-skill.active { border-color: var(--bronze-hi); }
.job-skill i { width: 46px; height: 46px; border-radius: 50%; background-size: cover; background-position: center; border: 2px solid var(--bronze); }
.job-skill small { color: #c9b28a; }
.job-skill-desc { min-height: 2.8em; color: #e2d0ad; margin: 8px 0 0; line-height: 1.45; font-size: 13px; }

@media (max-height: 560px), (max-width: 900px) {
  .job-screen { padding: 8px 12px; }
  .job-body { grid-template-columns: 150px 0.8fr 1.3fr; gap: 10px; margin-top: 8px; }
  .job-tab { padding: 6px; gap: 6px; }
  .job-tab .dot { width: 30px; height: 30px; flex-basis: 30px; }
  .job-tab small { display: none; }
  .job-portrait { min-height: 0; }
  .job-info { padding: 10px 12px; }
  .job-info h2 { font-size: 19px; }
  .job-lore { display: none; }
  .job-head h1 { font-size: 19px; }
  .job-head .btn { padding: 6px 10px; }
  .job-info h3 { margin: 6px 0 4px; }
  .job-role { margin: 0 0 4px; }
  .job-meta { font-size: 13px; margin-bottom: 4px; }
  .job-bars { grid-template-columns: auto 1fr auto 1fr; gap: 3px 8px; font-size: 12px; }
  .job-skill { flex-direction: row; padding: 5px 6px; gap: 6px; text-align: left; }
  .job-skill i { width: 32px; height: 32px; flex: 0 0 32px; }
  .job-skill small { display: none; }
  .job-skill-desc { min-height: 0; margin: 6px 0 6px; font-size: 12px; }
  .job-info .btn-primary { padding: 9px; }
}
@media (max-width: 640px) and (orientation: portrait) {
  .job-body { grid-template-columns: 1fr; }
  .job-tabs { flex-direction: row; overflow-x: auto; }
  .job-portrait { min-height: 220px; }
}

/* =================== Khung nhân vật (HUD) =================== */
.hud-plate {
  position: absolute; left: 10px; top: 8px; display: flex; align-items: center; gap: 0; padding: 0;
  background: none; border: 0; color: var(--paper); text-align: left; cursor: pointer; z-index: 3;
}
.hud-plate .avatar {
  position: relative; z-index: 2; width: 74px; height: 74px; border-radius: 50%; overflow: hidden; flex: 0 0 74px;
  background: radial-gradient(circle at 50% 35%, #4b3a2a, #1c120a);
  box-shadow: 0 0 0 3px #e2a94e, 0 0 0 5px #6b3f17, 0 4px 10px rgba(0,0,0,.6);
}
.hud-plate .avatar canvas { width: 100%; height: 100%; display: block; }
.hud-plate .lv-badge {
  position: absolute; z-index: 3; left: 23px; top: 62px; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; background: radial-gradient(circle at 40% 35%, #3b2a1c, #120b06);
  box-shadow: 0 0 0 2px #e2a94e, 0 2px 4px rgba(0,0,0,.6);
}
.hud-plate .lv-badge::before, .hud-plate .lv-badge::after {
  content: ""; position: absolute; top: 9px; width: 16px; height: 10px; background: #c99a5b; z-index: -1;
  clip-path: polygon(0 50%, 100% 0, 100% 100%);
}
.hud-plate .lv-badge::before { left: -13px; }
.hud-plate .lv-badge::after { right: -13px; transform: scaleX(-1); }
.hud-plate .lv-badge b { font-size: 13px; font-weight: 900; color: #fff; }
.plate-body {
  position: relative; margin-left: -14px; padding: 4px 18px 6px 22px; min-width: 240px;
  background: linear-gradient(180deg, rgba(43,27,15,.92), rgba(24,14,7,.92));
  clip-path: polygon(0 0, 100% 0, calc(100% - 14px) 100%, 0 100%);
  display: flex; flex-direction: column; gap: 3px;
}
.pname { font-weight: 800; font-size: 14px; color: #fff; text-shadow: 0 1px 2px #000; padding-left: 4px; }
.pbar { position: relative; display: block; height: 16px; background: #120a05; border: 1px solid #000; overflow: hidden; clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%); }
.pbar i { position: absolute; inset: 0 auto 0 0; width: 0; transition: width .25s; }
.pbar em { position: absolute; inset: 0; text-align: center; font-style: normal; font-size: 11px; font-weight: 800; line-height: 15px; color: #fff; text-shadow: 0 1px 2px #000, 0 0 2px #000; }
.pbar.hp i { background: linear-gradient(180deg, #8fe36a, #3fa62a 60%, #2c7f1d); }
.pbar.mp i { background: linear-gradient(180deg, #8fe0ff, #2fa7d8 60%, #1b77a8); }
.pbar.xp { height: 6px; }
.pbar.xp i { background: linear-gradient(180deg, #ffe58a, #e3a92b); }
.hud-plate:hover .plate-body { filter: brightness(1.12); }
.hud-plate:active .avatar { transform: scale(.97); }
/* Khung pet đang ra trận: bản thu nhỏ của khung nhân vật (dùng chung ảnh khung đã tải), thanh 2 = kinh nghiệm, thanh mảnh = Vui vẻ */
#pet-plate.pet-mini { transform: scale(.52); transform-origin: left top; z-index: 3; }
#pet-plate .pbar.pp-exp i { background: linear-gradient(180deg, #ffe58a, #e3a92b 60%, #b57a12) !important; }
#pet-plate .pbar.pp-joy i { background: linear-gradient(180deg, #a6ef7c, #4fa82c) !important; }
#pet-plate .pbar.pp-joy.low i { background: linear-gradient(180deg, #ff9a7a, #d0402a) !important; }
@media (max-height: 560px), (max-width: 900px) { #pet-plate.pet-mini { transform: scale(.62); } }
.buffs { position: absolute; left: 96px; top: 84px; display: flex; gap: 4px; pointer-events: none; }
.buff { position: relative; width: 30px; height: 30px; border-radius: 6px; border: 2px solid #e2a94e; background-size: cover; background-position: center; }
.buff span { position: absolute; right: -2px; bottom: -4px; font-size: 10px; font-weight: 900; text-shadow: 0 1px 2px #000; }

/* =================== Góc phải: bản đồ, tiền, menu =================== */
.top-right { position: absolute; right: 10px; top: 8px; display: flex; gap: 6px; align-items: center; z-index: 3; }
.map-pill, .gold-pill {
  height: 36px; display: flex; align-items: center; gap: 6px; padding: 0 16px; color: #fff3d6; font-weight: 800; font-size: 14px;
  background: linear-gradient(180deg, #a8743f, #7a4d22); border: 2px solid #4a2a10; border-radius: 6px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 2px 4px rgba(0,0,0,.4); text-shadow: 0 1px 2px #000; pointer-events: none;
}
.gold-pill { padding: 0 12px; }
.icon-gold { width: 20px; height: 20px; background-size: contain; background-repeat: no-repeat; background-position: center; display: inline-block; }
.menu-burger {
  width: 40px; height: 36px; border-radius: 6px; border: 2px solid #4a2a10; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 0 9px;
  background: linear-gradient(180deg, #a8743f, #7a4d22); box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 2px 4px rgba(0,0,0,.4);
}
.menu-burger span { height: 3px; border-radius: 2px; background: #fff3d6; }
.menu-burger.open { filter: brightness(1.2); }
.menu-grid {
  position: absolute; right: 10px; top: 50px; z-index: 12; display: grid; grid-template-columns: repeat(3, 76px); gap: 8px; padding: 10px;
  background: rgba(30,18,9,.88); border: 2px solid #a8743f; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
.menu-grid button {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 2px; border: 0; background: none;
  color: #fff3d6; font-weight: 800; font-size: 12px; text-shadow: 0 1px 2px #000; border-radius: 8px;
}
.menu-grid button:hover { background: rgba(255,255,255,.08); }
.mi {
  width: 44px; height: 44px; border-radius: 12px; display: block; background-color: #7a4d22; background-size: 30px; background-repeat: no-repeat; background-position: center;
  box-shadow: inset 0 0 0 2px #e2a94e, 0 2px 4px rgba(0,0,0,.5);
}
.mi-char { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff3d6'%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3Cpath d='M4 21c0-4.4 3.6-8 8-8s8 3.6 8 8z'/%3E%3C/svg%3E"); }
.mi-bag { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff3d6'%3E%3Cpath d='M9 6V5a3 3 0 0 1 6 0v1h3l1 15H5L6 6zm2 0h2V5a1 1 0 0 0-2 0z'/%3E%3C/svg%3E"); }
.mi-skill { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff3d6'%3E%3Cpath d='M13 2 4 14h6l-1 8 9-12h-6z'/%3E%3C/svg%3E"); }
.mi-auto { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff3d6' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M5 5l11 11M19 5 8 16M14 19l5-5M5 14l5 5'/%3E%3C/svg%3E"); }
.mi-help { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff3d6'%3E%3Cpath d='M4 4h7a3 3 0 0 1 3 3v13a2 2 0 0 0-2-2H4zm16 0h-4a2 2 0 0 0-2 2v14a2 2 0 0 1 2-2h4z'/%3E%3C/svg%3E"); }
.mi-set { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff3d6'%3E%3Cpath d='M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8zm9 5v-2l-2.2-.6-.6-1.5 1.1-2-1.4-1.4-2 1.1-1.5-.6L13 3h-2l-.6 2.2-1.5.6-2-1.1-1.4 1.4 1.1 2-.6 1.5L3 11v2l2.2.6.6 1.5-1.1 2 1.4 1.4 2-1.1 1.5.6L11 21h2l.6-2.2 1.5-.6 2 1.1 1.4-1.4-1.1-2 .6-1.5z'/%3E%3C/svg%3E"); }


/* =================== Nút tự động đánh =================== */
.auto-btn {
  position: absolute; right: 12px; bottom: 10px; width: 56px; height: 56px; border-radius: 50%; padding: 9px; pointer-events: auto; touch-action: none;
  background: radial-gradient(circle at 40% 35%, #7a8a6a, #3c4a33); border: 3px solid #b8c7a3; box-shadow: 0 3px 8px rgba(0,0,0,.5); z-index: 6;
}
.auto-btn svg { width: 100%; height: 100%; display: block; }
.auto-btn.on {
  background: radial-gradient(circle at 40% 35%, #8fe36a, #3a9a26 70%); border-color: #d9ffc7;
  box-shadow: 0 0 0 4px rgba(127,227,106,.35), 0 0 18px rgba(127,227,106,.8); animation: autoPulse 1.4s ease-in-out infinite;
}
@keyframes autoPulse { 50% { box-shadow: 0 0 0 7px rgba(127,227,106,.15), 0 0 26px rgba(127,227,106,.9); } }
.auto-label {
  position: absolute; left: 50%; bottom: 46px; transform: translateX(-50%); pointer-events: none;
  font-weight: 900; font-size: 18px; color: #ffe066; letter-spacing: .03em;
  text-shadow: 0 2px 0 #6b3f17, 0 0 6px #000; animation: autoBlink 1.6s ease-in-out infinite;
}
@keyframes autoBlink { 50% { opacity: .45; } }
.touch-buttons { bottom: calc(6% + 50px); }

/* =================== Bảng giấy da =================== */
.window { position: absolute; inset: 0; z-index: 15; display: grid; place-items: center; padding: 8px; background: rgba(0,0,0,.35); }
.parch {
  --zig: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='28'%3E%3Cpath d='M0 5 L12 17 L24 5 L36 17 L48 5' fill='none' stroke='%23dcb886' stroke-width='5'/%3E%3Ccircle cx='24' cy='24' r='3' fill='%23dcb886'/%3E%3C/svg%3E");
  position: relative; color: #5b3a1c; width: min(1060px, calc(100vw - 16px)); max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px);
  background:
    var(--zig) top 14px left 0 / 48px 28px repeat-x,
    var(--zig) bottom 10px left 24px / 48px 28px repeat-x,
    radial-gradient(ellipse at 50% 40%, #f6e6c3, #ecd3a5 80%);
  border: 7px solid #5a361b; border-radius: 16px;
  box-shadow: inset 0 0 0 3px #b98c5a, inset 0 0 40px rgba(150,100,50,.25), 0 22px 60px rgba(0,0,0,.65);
  padding: 46px 26px 44px 26px; display: flex; flex-direction: column; font-weight: 700;
}
.parch-win.small .parch { width: min(620px, calc(100vw - 16px)); }
.parch-close {
  position: absolute; right: -14px; top: -14px; width: 44px; height: 44px; border-radius: 8px; z-index: 2;
  background: linear-gradient(180deg, #7a4d22, #4a2a10); border: 2px solid #2b170a; color: #fff; font-size: 22px; font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 3px 6px rgba(0,0,0,.5);
}
.parch-title {
  position: absolute; left: 50%; top: -22px; transform: translateX(-50%); padding: 6px 34px; font-size: 22px; font-weight: 900; color: #7a3f12;
  background: linear-gradient(180deg, #f7e3b9, #e5c38c); border: 3px solid #8d5a2b; border-radius: 8px; box-shadow: 0 3px 6px rgba(0,0,0,.35); white-space: nowrap;
}
.parch-scroll { overflow: auto; min-height: 0; padding-right: 4px; }
.sec-title { text-align: center; color: #7a3f12; font-size: 18px; margin: 4px 0 12px; }
.parch-hint { color: #8a6440; font-size: 12px; font-weight: 600; margin: 8px 0 4px; }
.slot-box { background: #a77d55; border-radius: 10px; box-shadow: inset 0 0 0 2px #8a6240, inset 0 2px 8px rgba(0,0,0,.25); padding: 10px; }
.pbtn {
  padding: 8px 16px; border-radius: 7px; border: 2px solid #4a2a10; font-weight: 800; font-size: 14px; color: #fff3d6; text-shadow: 0 1px 2px #000;
  background: linear-gradient(180deg, #b07a43, #7a4d22); box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 2px 3px rgba(0,0,0,.3);
}
.pbtn:hover:not(:disabled) { filter: brightness(1.1); }
.pbtn:disabled { opacity: .5; }
.pbtn.green { background: linear-gradient(180deg, #5fc24a, #2f8a23); border-color: #1d5a14; }
.pbtn.red { background: linear-gradient(180deg, #d9573f, #a1301f); border-color: #5a1a10; }
.parch-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

/* Ô đánh dấu kiểu ảnh mẫu */
.check-grid { display: grid; gap: 12px 20px; }
.check-grid.two { grid-template-columns: repeat(2, 1fr); }
.check-grid.three { grid-template-columns: repeat(3, 1fr); }
.pcheck { display: flex; align-items: center; gap: 10px; cursor: pointer; color: #6b4320; font-size: 15px; }
.pcheck input { position: absolute; opacity: 0; pointer-events: none; }
.pcheck span {
  flex: 0 0 40px; height: 40px; border-radius: 6px; background: #8a6444; box-shadow: inset 0 0 0 2px #6e4b2f, inset 0 2px 5px rgba(0,0,0,.35); position: relative;
}
.pcheck input:checked + span::after {
  content: ""; position: absolute; inset: 7px; border-radius: 4px; background: linear-gradient(180deg, #e9a052, #b8682a);
  box-shadow: inset 0 0 0 2px #6b3a16, inset 0 2px 0 rgba(255,255,255,.35);
}
.pcheck input:focus-visible + span { outline: 2px solid #fff; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button { padding: 8px 14px; border-radius: 7px; border: 2px solid #6e4b2f; background: #c9a57a; color: #5b3a1c; font-weight: 800; }
.seg button.active { background: linear-gradient(180deg, #b07a43, #7a4d22); color: #fff3d6; border-color: #4a2a10; text-shadow: 0 1px 2px #000; }
.steppers { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.stepper { display: flex; flex-direction: column; gap: 6px; }
.stepper div { display: flex; align-items: center; gap: 8px; }
.stepper button { width: 44px; height: 40px; border-radius: 6px; border: 2px solid #4a2a10; background: linear-gradient(180deg, #8a5a2b, #5a361b); color: #fff; font-size: 24px; font-weight: 900; line-height: 1; }
.stepper b { width: 120px; height: 40px; display: grid; place-items: center; border-radius: 6px; background: #8a6444; color: #fff3d6; box-shadow: inset 0 2px 5px rgba(0,0,0,.35); }

/* Bảng nhân vật */
.parch-win .parch .side-tabs {
  position: absolute; left: -16px; top: 60px; transform: translateX(-100%); display: flex; flex-direction: column; gap: 8px;
}
.side-tabs button {
  padding: 10px 14px; border-radius: 22px 0 0 22px; border: 2px solid #8d5a2b; border-right: 0; font-weight: 900; font-size: 15px; color: #fff3d6;
  background: linear-gradient(180deg, #8a5a2b, #5a361b); white-space: nowrap; text-shadow: 0 1px 2px #000;
}
.side-tabs button.active { background: linear-gradient(180deg, #f7e3b9, #e5c38c); color: #7a3f12; text-shadow: none; }
.char-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; min-height: 0; flex: 1; }
.equip { display: grid; grid-template-columns: 84px 1fr 84px; gap: 10px; align-items: stretch; }
.eq-col { display: flex; flex-direction: column; gap: 8px; }
.eq {
  flex: 1; min-height: 52px; border-radius: 8px; border: 0; background: #8a6444; color: #f5e6c8; font-weight: 800; font-size: 13px;
  box-shadow: inset 0 0 0 2px #6e4b2f, inset 0 2px 6px rgba(0,0,0,.3); text-shadow: 0 1px 2px #000;
}
.eq:hover { filter: brightness(1.1); }
.eq-center { position: relative; display: flex; flex-direction: column; align-items: center; min-height: 0; }
.name-scroll {
  width: 100%; text-align: center; padding: 6px 10px 6px; border-radius: 8px; background: linear-gradient(180deg, #f7e3b9, #e5c38c);
  border: 2px solid #8d5a2b; box-shadow: 0 2px 4px rgba(0,0,0,.25);
}
.name-scroll b { display: block; font-size: 16px; color: #7a3f12; }
.name-scroll small { display: block; font-size: 10px; color: #8a6440; }
.xpline { display: block; height: 6px; border-radius: 3px; background: #3a2414; overflow: hidden; margin: 3px 0 1px; }
.xpline i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #e3a92b, #ffe58a); }
.cw-lv {
  margin-top: -6px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; z-index: 1;
  background: radial-gradient(circle at 40% 35%, #3b2a1c, #120b06); box-shadow: 0 0 0 2px #e2a94e;
}
.cw-lv b { color: #fff; font-size: 14px; }
.cw-stage { flex: 1; width: 100%; min-height: 180px; position: relative; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,240,210,.18) 0 38%, rgba(0,0,0,0) 39%), repeating-radial-gradient(circle, transparent 0 46px, rgba(110,75,47,.5) 46px 48px); }
.cw-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.cw-pane { min-height: 0; overflow: auto; }
.stat-list { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 7px 14px; padding: 4px 6px; }
.stat-list dt { color: #fff3d6; text-shadow: 0 1px 2px #5a361b; }
.stat-list dt::before { content: "- "; }
.stat-list dd { margin: 0; text-align: right; color: #fff3d6; text-shadow: 0 1px 2px #5a361b; }
.stat-list .sep { grid-column: 1 / -1; height: 1px; background: rgba(90,54,27,.4); }
.inv-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.inv-slot {
  position: relative; aspect-ratio: 1; border-radius: 7px; background: #8a6444; background-size: 72%; background-position: center; background-repeat: no-repeat;
  box-shadow: inset 0 0 0 2px #6e4b2f, inset 0 2px 6px rgba(0,0,0,.3); touch-action: none; cursor: pointer;
}
.inv-slot.sel { box-shadow: inset 0 0 0 3px #fff3d6, 0 0 0 2px #e2a94e; }
.inv-slot.drop-target { box-shadow: inset 0 0 0 3px #9be38a; }
.inv-slot .q { position: absolute; right: 4px; bottom: 2px; font-size: 13px; font-weight: 900; color: #fff; text-shadow: 0 1px 2px #000, 0 0 3px #000; }
.bag-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; color: #fff3d6; text-shadow: 0 1px 2px #5a361b; }
.cw-pane[data-pane="bag"] { position: relative; }
.item-pop {
  position: sticky; bottom: 0; margin-top: 10px; background: linear-gradient(180deg, #f7e3b9, #e5c38c); border: 2px solid #8d5a2b; border-radius: 10px; padding: 10px 12px;
  box-shadow: 0 -4px 12px rgba(0,0,0,.3);
}
.item-pop b { color: #7a3f12; font-size: 16px; }
.item-pop small { display: block; color: #8a6440; }
.item-pop p { margin: 6px 0 8px; color: #5b3a1c; font-weight: 600; }
.ip-actions { display: flex; gap: 8px; }
.skill-list { display: flex; flex-direction: column; gap: 10px; }
.skill-row { display: grid; grid-template-columns: 56px 1fr; gap: 10px; align-items: center; padding: 8px; border-radius: 8px; background: #8a6444; box-shadow: inset 0 0 0 2px #6e4b2f; color: #fff3d6; }
.skill-row i { width: 56px; height: 56px; border-radius: 10px; background-size: cover; background-position: center; box-shadow: 0 0 0 2px #e2a94e; }
.skill-row.locked i { filter: grayscale(1) brightness(.6); }
.skill-row b { font-size: 15px; }
.skill-row small { display: block; color: #ffe2a8; font-size: 12px; }
.skill-row p { margin: 3px 0 0; font-size: 12px; font-weight: 600; color: #f5e6c8; }
.currency { display: flex; justify-content: center; gap: 10px; margin-top: 14px; }
.cur {
  min-width: 220px; height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 14px; border-radius: 8px;
  background: linear-gradient(180deg, #a57b56, #8a6444); border: 3px solid #e5c38c; box-shadow: 0 0 0 2px #8d5a2b; color: #fff; font-size: 16px;
}
.cur .icon-gold { width: 26px; height: 26px; }
.cur-note { align-self: center; color: #8a6440; }
.keys { width: 100%; border-collapse: collapse; color: #5b3a1c; }
.keys td { padding: 6px 8px; border-bottom: 1px solid rgba(90,54,27,.25); }

@media (max-height: 560px), (max-width: 900px) {
  .parch { padding: 34px 14px 30px 14px; border-width: 5px; }
  .parch-win .parch .side-tabs { left: 4px; top: 8px; transform: none; flex-direction: row; }
  .side-tabs button { border-radius: 8px 8px 0 0; border: 2px solid #8d5a2b; border-bottom: 0; padding: 4px 10px; font-size: 12px; }
  .parch-win:not(.small) .parch { padding-top: 40px; }
  .char-wrap { grid-template-columns: 1.05fr 1fr; gap: 10px; }
  .equip { grid-template-columns: 64px 1fr 64px; gap: 6px; padding: 6px; }
  .eq { min-height: 40px; font-size: 11px; }
  .eq-col { gap: 5px; }
  .cw-stage { min-height: 120px; }
  .inv-grid { gap: 5px; }
  .stat-list { gap: 4px 10px; font-size: 13px; }
  .currency { margin-top: 6px; }
  .cur { height: 30px; min-width: 160px; font-size: 14px; }
  .check-grid.three { grid-template-columns: repeat(2, 1fr); }
  .pcheck span { flex-basis: 32px; height: 32px; }
  .pcheck { font-size: 13px; }
  .parch-title { font-size: 17px; top: -18px; }
  .hud-plate .avatar { width: 62px; height: 62px; flex-basis: 62px; }
  .hud-plate .lv-badge { left: 18px; top: 50px; }
  .plate-body { min-width: 200px; }
  .pbar { height: 14px; }
  .pbar em { line-height: 13px; font-size: 10px; }
  .buffs { top: 70px; left: 84px; }
  .quickslots { top: 92px; }
  .map-pill, .gold-pill, .menu-burger { height: 32px; font-size: 12px; }
  .auto-btn { width: 48px; height: 48px; }
}

/* Thanh EXP dưới cùng màn hình */
.bar.exp {
  position: absolute; left: 0; right: 0; bottom: 0; height: 12px; margin: 0; overflow: hidden;
  background: #140d07; border-top: 1px solid var(--bronze-dk); pointer-events: none;
}
.bar.exp > div { position: absolute; inset: 0 auto 0 0; width: 0; transition: width .2s; background: linear-gradient(180deg, #ffe58a, var(--gold)); }
.bar.exp span { position: absolute; inset: 0; text-align: center; font-size: 10px; font-weight: 700; line-height: 12px; text-shadow: 0 1px 2px #000; }
.net-status { right: 82px; bottom: 16px; }

/* =================== Bình thuốc: nút tròn cạnh cụm nút đánh =================== */
.quickslots.potion-row { position: absolute; top: auto; left: auto; right: calc(2.5% + 112px); bottom: 10px; display: flex; gap: 12px; pointer-events: auto; z-index: 6; }
.potion-row .quickslot {
  width: 58px; height: 58px; border-radius: 50%; border: 3px solid #e2a94e; touch-action: none;
  background: radial-gradient(circle at 40% 35%, rgba(90,60,30,.92), rgba(30,18,9,.92)); box-shadow: 0 3px 8px rgba(0,0,0,.5);
}
.potion-row .quickslot[data-kind="hp"] { border-color: #e2574a; }
.potion-row .quickslot[data-kind="mp"] { border-color: #3fa7e0; }
.potion-row .quickslot .qs-icon { inset: 9px; }
.potion-row .quickslot .qs-count {
  right: auto; left: 50%; bottom: -2px; transform: translateX(-50%); padding: 0 6px; border-radius: 8px;
  background: rgba(0,0,0,.75); font-size: 11px; line-height: 15px;
}
.potion-row .quickslot kbd { left: 50%; top: -9px; transform: translateX(-50%); }
body.touch-mode .potion-row .quickslot kbd { display: none; }
.potion-row .quickslot .cd { border-radius: 50%; }
.potion-row .quickslot:active { transform: scale(.94); }
@media (max-height: 560px), (max-width: 900px) {
  .quickslots.potion-row { right: calc(2.5% + 96px); bottom: 8px; gap: 8px; }
  .potion-row .quickslot { width: 50px; height: 50px; }
}

/* =================== Trang bị =================== */
.eq { position: relative; background-size: 72%, 100%; background-position: center; background-repeat: no-repeat; }
.eq.has { color: transparent; text-shadow: none; }
.eq .plus { position: absolute; right: 4px; top: 2px; font-size: 11px; color: #ffe066; text-shadow: 0 1px 2px #000; }
.inv-slot { background-size: 72%, 100%; }
.item-pop.floating {
  position: absolute; z-index: 5; left: 50%; bottom: 58px; transform: translateX(-50%); width: min(380px, 90%); margin: 0;
}
.ip-stats { list-style: none; margin: 6px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; }
.ip-stats li { color: #2f7a1f; font-weight: 800; font-size: 14px; }
.ip-req { display: block; margin-top: 4px; }
.ip-req.bad { color: #c0392b !important; }
.item-pop .rar { font-weight: 900; }

/* =================== Cường hóa: nhãn +N =================== */
.inv-slot .pl, .eq .pl, .fg-slot .pl, .shop-row i .pl {
  position: absolute; right: 4px; left: auto; top: 1px; font-size: 12px; font-weight: 900; color: #ffe066; text-shadow: 0 1px 2px #000, 0 0 3px #000; pointer-events: none;
}
.pl.hi { color: #ff9f43; }
.pl.top { color: #ff5ae0; }
.pbtn.gold { background: linear-gradient(180deg, #f0b84a, #b5741c); border-color: #5a3410; }
.pbtn.big { padding: 11px 20px; font-size: 16px; width: 100%; }

/* =================== Cửa hàng =================== */
.shop-tabs { justify-content: center; margin-bottom: 10px; }
.shop-body { display: grid; grid-template-columns: 1fr 260px; gap: 14px; min-height: 0; flex: 1; }
.shop-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; align-content: start; max-height: 52vh; }
.shop-row {
  display: grid; grid-template-columns: 52px 1fr; gap: 10px; align-items: center; padding: 7px 9px; border-radius: 9px; cursor: pointer; text-align: left;
  background: #8a6444; border: 0; box-shadow: inset 0 0 0 2px #6e4b2f, inset 0 2px 6px rgba(0,0,0,.25); color: #fff3d6; font: inherit;
}
.shop-row:hover { filter: brightness(1.08); }
.shop-row.sel { box-shadow: inset 0 0 0 3px #fff3d6, 0 0 0 2px #e2a94e; }
.shop-row.na { opacity: .55; }
.shop-row i { position: relative; width: 52px; height: 52px; border-radius: 8px; background-color: #6e4b2f; background-size: 78%, 100%; background-position: center; background-repeat: no-repeat; }
.shop-row b { display: block; font-size: 14px; text-shadow: 0 1px 2px #000; line-height: 1.2; }
.shop-row small { display: block; font-size: 11px; color: #ffe2a8; }
.shop-row .price { display: flex; align-items: center; gap: 4px; margin-top: 2px; color: #fff; font-size: 13px; }
.icon-gold.sm { width: 16px; height: 16px; vertical-align: -3px; }
.shop-empty { grid-column: 1 / -1; text-align: center; color: #fff3d6; padding: 30px 0; }
.shop-side { display: flex; flex-direction: column; gap: 6px; color: #fff3d6; text-shadow: 0 1px 2px #5a361b; min-height: 0; overflow: auto; }
.ss-icon { width: 76px; height: 76px; align-self: center; border-radius: 12px; background-color: #6e4b2f; background-size: 78%, 100%; background-position: center; background-repeat: no-repeat; box-shadow: 0 0 0 2px #e2a94e; }
#ss-name { text-align: center; font-size: 16px; }
#ss-type { text-align: center; color: #ffe2a8; font-size: 12px; }
#ss-desc { margin: 2px 0; font-size: 12px; font-weight: 600; color: #f5e6c8; }
.shop-side .ip-stats li { color: #b8f59c; text-shadow: 0 1px 2px #000; }
.ss-qty b { width: 64px; }
.ss-qty button { width: 40px; height: 36px; font-size: 18px; }
.ss-total { display: flex; align-items: center; gap: 6px; justify-content: center; font-size: 15px; }
.ss-total.bad b { color: #ff8a7a; }

/* =================== Lò rèn =================== */
.forge-body { display: grid; grid-template-columns: 1fr 1.15fr; gap: 14px; min-height: 0; flex: 1; }
.forge-pick { overflow: auto; min-height: 0; max-height: 60vh; }
.forge-pick .sec-title { color: #fff3d6; text-shadow: 0 1px 2px #5a361b; font-size: 14px; margin: 2px 0 6px; text-align: left; }
.forge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 6px; margin-bottom: 10px; }
.fg-slot {
  position: relative; aspect-ratio: 1; border-radius: 7px; border: 0; background-color: #8a6444; background-size: 72%, 100%; background-position: center; background-repeat: no-repeat;
  box-shadow: inset 0 0 0 2px #6e4b2f, inset 0 2px 6px rgba(0,0,0,.3); cursor: pointer;
}
.fg-slot.sel { box-shadow: inset 0 0 0 3px #fff3d6, 0 0 0 2px #e2a94e; }
.fg-slot .tagq { position: absolute; right: 3px; bottom: 1px; font-size: 10px; color: #fff; text-shadow: 0 1px 2px #000; }
.forge-none { grid-column: 1 / -1; color: #f5e6c8; font-size: 12px; font-weight: 600; }
.forge-main { display: flex; flex-direction: column; align-items: center; gap: 6px; color: #fff3d6; text-shadow: 0 1px 2px #5a361b; overflow: auto; min-height: 0; }
.forge-anvil { position: relative; width: 120px; height: 120px; flex: 0 0 auto; }
.fa-item {
  position: absolute; inset: 14px; border-radius: 14px; background-color: #6e4b2f; background-size: 78%, 100%; background-position: center; background-repeat: no-repeat;
  box-shadow: 0 0 0 3px #e2a94e, 0 0 24px rgba(255,180,60,.35);
}
.fa-fx { position: absolute; inset: -30px; width: 180px; height: 180px; pointer-events: none; }
.forge-anvil.shake .fa-item { animation: faShake .45s; }
@keyframes faShake { 20% { transform: translateX(-5px) rotate(-3deg); } 40% { transform: translateX(5px) rotate(3deg); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }
.fa-title { text-align: center; }
.fa-title b { font-size: 17px; }
.fa-title span { display: block; font-size: 22px; font-weight: 900; color: #ffe066; }
.fa-stats { border-collapse: collapse; font-size: 14px; min-width: 230px; }
.fa-stats td { padding: 2px 8px; }
.fa-stats td:nth-child(2) { text-align: right; }
.fa-stats td:nth-child(3) { color: #ffe066; }
.fa-stats td:nth-child(4) { color: #b8f59c; font-weight: 900; }
.fa-cost { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; font-size: 14px; }
.fa-cost span { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 7px; background: rgba(0,0,0,.18); }
.fa-cost span.bad { color: #ff8a7a; }
.fa-cost i { width: 20px; height: 20px; display: inline-block; background-size: contain; background-repeat: no-repeat; background-position: center; }
.fa-rate { font-size: 14px; text-align: center; }
.fa-rate .warn { display: block; color: #ffb199; font-size: 12px; }
.forge-main .pbtn.big { max-width: 260px; }
.fa-result { margin: 0; min-height: 20px; font-weight: 900; text-align: center; }
.fa-result.ok { color: #b8f59c; }
.fa-result.fail { color: #ffb199; }

@media (max-height: 560px), (max-width: 900px) {
  .shop-body { grid-template-columns: 1fr 210px; gap: 8px; }
  .shop-list { max-height: 56vh; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; }
  .shop-row { grid-template-columns: 40px 1fr; padding: 5px 7px; gap: 7px; }
  .shop-row i { width: 40px; height: 40px; }
  .ss-icon { width: 54px; height: 54px; }
  .shop-tabs { margin-bottom: 6px; }
  .shop-tabs button { padding: 4px 14px; }
  .pbtn.big { padding: 8px 14px; font-size: 14px; }
  .forge-pick { max-height: 62vh; }
  .forge-grid { grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 5px; }
  .forge-anvil { width: 84px; height: 84px; }
  .fa-item { inset: 8px; }
  .fa-fx { inset: -36px; width: 156px; height: 156px; }
  .fa-stats { font-size: 12px; min-width: 0; }
  .fa-title b { font-size: 14px; }
  .fa-title span { font-size: 17px; }
}
.shop-side > * { flex-shrink: 0; }
@media (max-height: 560px), (max-width: 900px) {
  .shop-side { gap: 3px; padding: 7px; }
  .shop-side #ss-desc, .shop-side #ss-type, .ss-qty > span { display: none; }
  .ss-icon { width: 44px; height: 44px; }
  #ss-name { font-size: 14px; }
  .shop-side .ip-stats li { font-size: 12px; }
  .ss-qty div { justify-content: center; gap: 5px; }
  .ss-qty button { width: 34px; height: 30px; font-size: 15px; }
  .ss-qty b { width: 46px; height: 30px; }
  .ss-total { font-size: 13px; }
  .forge-main { gap: 3px; padding: 7px; }
  .forge-anvil { width: 64px; height: 64px; }
  .fa-item { inset: 4px; }
  .fa-fx { inset: -46px; width: 156px; height: 156px; }
  .fa-title span { font-size: 15px; display: inline; margin-left: 8px; }
  .fa-cost { gap: 6px; font-size: 12px; }
  .fa-cost span { padding: 2px 7px; }
  .fa-rate { font-size: 12px; }
  .fa-rate .warn { display: inline; margin-left: 6px; font-size: 11px; }
  .fa-result { min-height: 16px; font-size: 12px; }
}

/* =================== Ẩn thanh cuộn (vẫn vuốt / lăn được) =================== */
.parch *, .chat-log, .qp-box { scrollbar-width: none; }
.parch *::-webkit-scrollbar, .chat-log::-webkit-scrollbar, .qp-box::-webkit-scrollbar { display: none; }
.parch-hint.center { text-align: center; }
.pbtn.sm { padding: 5px 10px; font-size: 12px; }

/* =================== Bảng Nhiệm vụ / Tổ đội (dưới khung máu) =================== */
.buffs { left: 330px; top: 14px; }
.qpanel { position: absolute; left: 10px; top: 100px; width: 270px; z-index: 3; pointer-events: auto; }
.qp-tabs { display: flex; gap: 4px; align-items: stretch; }
.qp-tabs button {
  padding: 5px 14px; font-weight: 800; font-size: 13px; color: #fff3d6; border-radius: 6px 6px 0 0; text-shadow: 0 1px 2px #000;
  background: linear-gradient(180deg, #5a361b, #3a2210); border: 2px solid #8d5a2b; border-bottom: 0;
}
.qp-tabs button.on { background: linear-gradient(180deg, #b07a43, #7a4d22); }
.qp-tabs .qp-toggle { padding: 5px 9px; border-radius: 6px; border-bottom: 2px solid #8d5a2b; margin-bottom: 2px; }
.qp-box {
  background: rgba(20,13,7,.62); border: 1px solid rgba(232,183,101,.35); border-radius: 0 8px 8px 8px; padding: 8px 10px;
  max-height: 168px; overflow: auto; text-shadow: 0 1px 2px #000; font-size: 13px; line-height: 1.38;
}
.qpanel.collapsed .qp-box, .qpanel.collapsed [data-qp] { display: none; }
.qp-title { display: block; color: #ffe066; font-size: 15px; font-weight: 900; }
.qp-goal { color: #fff; font-weight: 600; }
.qp-prog { color: #7fe36a; }
.qp-prog.done { color: #7fe36a; }
.qp-hint { margin-top: 4px; color: #f3e3c3; }
.qp-hint em { color: #7fe36a; font-style: normal; font-weight: 800; display: block; }
.qp-empty { margin: 0 0 6px; color: #f3e3c3; }
.qp-empty.dim { color: #b9a37f; }
.qp-near { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 3px 0; }
.qp-member { padding: 4px 0; border-bottom: 1px solid rgba(232,183,101,.15); }
.qm-head { display: flex; gap: 6px; align-items: baseline; }
.qm-head b { color: #fff; }
.qp-member.leader .qm-head b { color: #ffe066; }
.qm-head small { color: #c9b28a; flex: 1; }
.qm-kick { border: 0; background: none; color: #ff8a7a; font-weight: 900; padding: 0 4px; }
.qm-bars { display: grid; gap: 2px; margin-top: 2px; }
.qb { display: block; height: 5px; background: #120a05; border-radius: 3px; overflow: hidden; }
.qb i { display: block; height: 100%; }
.qb i.hp { background: linear-gradient(90deg, #3fa62a, #8fe36a); }
.qb i.mp { background: linear-gradient(90deg, #1b77a8, #8fe0ff); }
.qp-leave { margin-top: 6px; }
@media (max-height: 560px), (max-width: 900px) {
  .qpanel { top: 88px; width: 220px; }
  .qp-box { max-height: 112px; font-size: 12px; padding: 6px 8px; }
  .qp-title { font-size: 13px; }
  .qp-tabs button { padding: 3px 10px; font-size: 12px; }
  .buffs { left: 290px; }
}

/* =================== Khung máu quái giữa phía trên =================== */
.target {
  position: absolute; left: 50%; top: 10px; transform: translateX(-50%); width: min(460px, 44vw); pointer-events: none; z-index: 3; text-align: center;
}
.tg-name { font-weight: 900; font-size: 16px; color: #fff; text-shadow: 0 1px 2px #000, 0 0 4px #000; margin-bottom: 3px; }
.tg-name b { color: #ffe066; }
.tg-bar {
  position: relative; height: 16px; border-radius: 4px; background: #1a0a06; border: 2px solid #120604; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255,255,255,.12), 0 2px 6px rgba(0,0,0,.5);
}
.tg-bar i { position: absolute; left: 0; top: 0; bottom: 0; }
.tg-bar .lag { background: #f2c14e; opacity: .75; }
.tg-bar .fill { background: linear-gradient(180deg, #ff6a5a, #d8261a 55%, #9a1408); transition: width .12s; }
.tg-bar em { position: absolute; inset: 0; font-style: normal; font-size: 11px; font-weight: 800; color: #fff; line-height: 13px; text-shadow: 0 1px 2px #000; }
@media (max-height: 560px), (max-width: 900px) { .target { width: min(360px, 40vw); } .tg-name { font-size: 13px; } .tg-bar { height: 13px; } .tg-bar em { line-height: 10px; font-size: 10px; } }

/* =================== Trò chuyện (biểu tượng) =================== */
.chat-btn {
  position: absolute; left: 210px; bottom: 16px; width: 52px; height: 52px; border-radius: 50%; z-index: 6; pointer-events: auto;
  border: 2px solid rgba(255,255,255,.75); background: rgba(20,13,7,.45) center / 60% no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M4 4h16a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H10l-5 4v-4H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z'/%3E%3Ccircle cx='8' cy='10.5' r='1.4' fill='%23333'/%3E%3Ccircle cx='12' cy='10.5' r='1.4' fill='%23333'/%3E%3Ccircle cx='16' cy='10.5' r='1.4' fill='%23333'/%3E%3C/svg%3E");
  box-shadow: 0 2px 6px rgba(0,0,0,.5);
}
.chat-btn.on { border-color: #ffe066; }
.chat-btn .badge {
  position: absolute; right: -4px; top: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #d8261a; color: #fff;
  font-size: 11px; font-weight: 900; line-height: 20px; box-shadow: 0 0 0 2px #fff;
}
body:not(.touch-mode) .chat-btn { left: 16px; }
.chat-panel {
  position: absolute; left: 12px; bottom: 76px; width: min(440px, 46vw); height: min(300px, 52vh); z-index: 9; pointer-events: auto;
  display: flex; flex-direction: column; border-radius: 12px; background: rgba(24,15,8,.92); border: 2px solid #a8743f;
  box-shadow: 0 10px 30px rgba(0,0,0,.55);
}
.cp-head { display: flex; align-items: center; gap: 4px; padding: 6px 6px 0; }
.cp-tabs { display: flex; gap: 3px; flex: 1; overflow-x: auto; }
.cp-tabs button { padding: 4px 9px; font-size: 12px; font-weight: 800; border-radius: 12px; border: 1px solid #7a4d22; background: #3a2210; color: #e6cfa2; white-space: nowrap; }
.cp-tabs button.on { background: #b07a43; color: #fff; border-color: #e8b765; }
.cp-close { border: 0; background: none; color: #fff3d6; font-size: 18px; font-weight: 900; padding: 0 8px; }
.chat-log { flex: 1; overflow-y: auto; padding: 6px 10px; font-size: 13px; line-height: 1.4; display: flex; flex-direction: column; gap: 2px; text-shadow: 0 1px 2px #000; }
.cl .who { color: var(--bronze-hi); font-weight: 700; }
.cl .tag { font-weight: 800; }
.cl-sys { color: #f2c14e; }
.cl-party .tag, .cl-party .who { color: #7fd3ff; }
.cl-guild .tag, .cl-guild .who { color: #9be38a; }
.cl-sys .tag { color: #f2c14e; }
.cp-form { display: flex; gap: 6px; padding: 6px; border-top: 1px solid rgba(232,183,101,.25); }
.cp-form select { background: #1a110a; color: #f3e3c3; border: 1px solid #7a4d22; border-radius: 6px; font: inherit; font-size: 13px; padding: 0 4px; }
#chat-input { flex: 1; min-width: 0; padding: 7px 10px; border-radius: 7px; border: 1px solid var(--bronze-dk); background: #140d07; color: var(--paper); outline: none; font-size: 14px; }
#chat-input:focus { border-color: var(--bronze-hi); }
@media (max-height: 560px) { .chat-panel { height: 58vh; bottom: 70px; width: 52vw; } }

/* =================== Hội thoại NPC (dải dưới màn hình như ảnh mẫu) =================== */
.dialog { position: absolute; inset: 0; z-index: 20; pointer-events: auto; background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,.25)); }
.dlg-portrait {
  position: absolute; left: 2%; bottom: 0; width: min(300px, 26vw); height: min(400px, 62vh); z-index: 2;
  background-size: contain; background-repeat: no-repeat; background-position: left bottom; pointer-events: none;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.6));
}
.dialog.noportrait .dlg-portrait { display: none; }
.dlg-band {
  position: absolute; left: 0; right: 0; bottom: 0; min-height: min(240px, 36vh); display: flex; gap: 18px; align-items: flex-start;
  padding: 18px 3% 16px calc(2% + min(300px, 26vw) + 10px);
  background: linear-gradient(180deg, rgba(28,22,10,.82), rgba(18,14,6,.94)); border-top: 2px solid rgba(232,183,101,.45);
}
.dialog.noportrait .dlg-band { padding-left: 4%; }
.dlg-body { flex: 1; min-width: 0; }
#dlg-name { margin: 0 0 8px; font-size: 22px; color: #ffe066; text-shadow: 0 2px 2px #000; }
#dlg-text { white-space: pre-line; line-height: 1.6; color: #fff; margin: 0; font-size: 15px; text-shadow: 0 1px 2px #000; }
.dlg-options { display: flex; flex-direction: column; gap: 8px; align-self: flex-end; min-width: min(300px, 30vw); max-height: 30vh; overflow: auto; }
.dlg-btn {
  padding: 11px 18px; border-radius: 8px; font-weight: 800; font-size: 15px; color: #5b3a1c; text-align: center;
  background: linear-gradient(180deg, #f7e3b9, #dcb986); border: 3px solid #8d5a2b; box-shadow: inset 0 0 0 2px #fff3d6, 0 3px 6px rgba(0,0,0,.45);
}
.dlg-btn:hover, .dlg-btn:focus-visible { filter: brightness(1.08); outline: none; }
.dlg-btn.ghost { background: linear-gradient(180deg, #cdb08a, #a88a64); }
@media (max-height: 560px), (max-width: 900px) {
  .dlg-band { min-height: 40vh; padding-top: 12px; padding-bottom: 10px; gap: 12px; }
  #dlg-name { font-size: 17px; margin-bottom: 4px; }
  #dlg-text { font-size: 13px; line-height: 1.45; }
  .dlg-btn { padding: 7px 12px; font-size: 13px; }
  .dlg-options { gap: 5px; max-height: 36vh; }
}

/* =================== Hành trang: lọc, lật trang, vứt bỏ =================== */
.bag-tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.bag-tabs button {
  flex: 1; padding: 5px 4px; border-radius: 6px; border: 2px solid #6e4b2f; background: #8a6444; color: #fff3d6; font-weight: 800; font-size: 12px; text-shadow: 0 1px 2px #000;
}
.bag-tabs button.on { background: linear-gradient(180deg, #f7e3b9, #e5c38c); color: #7a3f12; text-shadow: none; }
.inv-slot.void { opacity: .45; cursor: default; }
.pager { display: inline-flex; align-items: center; gap: 6px; }
.pager button { width: 30px; height: 26px; border-radius: 6px; border: 2px solid #4a2a10; background: linear-gradient(180deg, #8a5a2b, #5a361b); color: #fff; font-size: 12px; }
.pager button:disabled { opacity: .35; }
.pager b { min-width: 34px; text-align: center; }
.cw-pane[data-pane="bag"] { overflow: hidden; }
.ip-confirm { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed #8d5a2b; color: #a1301f; font-weight: 800; }
.ip-confirm .qty { display: inline-flex; align-items: center; gap: 4px; }
.ip-confirm .qty button { min-width: 30px; height: 28px; border-radius: 6px; border: 2px solid #4a2a10; background: #8a5a2b; color: #fff; font-weight: 900; }
.ip-confirm .qty b { min-width: 30px; text-align: center; color: #5b3a1c; }

/* =================== Bảng Kỹ năng (Tiềm năng + Kỹ năng nghề) =================== */
.char-wrap.wide { grid-template-columns: 1fr; }
.char-wrap.wide > .equip { display: none; }
.skills-pane { display: grid; grid-template-columns: 1fr 1.1fr; gap: 14px; min-height: 0; }
.sk-left, .sk-right { min-height: 0; overflow: auto; }
.sk-h { margin: 2px 0 8px; text-align: center; color: #fff3d6; text-shadow: 0 1px 2px #5a361b; font-size: 16px; }
.sk-h small { font-size: 12px; color: #ffe2a8; margin-left: 6px; }
.sk-h small b { color: #fff; }
.sk-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
#pot-grid { grid-template-columns: repeat(3, 1fr); }
.sk-cell {
  position: relative; aspect-ratio: 1; border-radius: 10px; border: 0; padding: 0; cursor: pointer; overflow: hidden;
  background: radial-gradient(circle at 40% 35%, var(--c, #6e4b2f), #1d1208 85%); box-shadow: inset 0 0 0 2px #6e4b2f, 0 2px 4px rgba(0,0,0,.35);
}
.sk-cell i { position: absolute; inset: 0; background-size: cover; background-position: center; display: grid; place-items: center; font-style: normal; font-size: 30px; color: #fff; text-shadow: 0 2px 4px #000; }
.sk-cell .n { position: absolute; right: 5px; bottom: 2px; font-weight: 900; font-size: 13px; color: #fff; text-shadow: 0 1px 2px #000, 0 0 3px #000; }
.sk-cell.sel { box-shadow: inset 0 0 0 3px #fff3d6, 0 0 0 2px #e2a94e, 0 0 12px rgba(255,220,120,.6); }
.sk-cell.locked i { filter: grayscale(1) brightness(.5); }
.sk-right { color: #5b3a1c; background: linear-gradient(180deg, #f6e6c3, #ecd3a5); box-shadow: inset 0 0 0 2px #c9a57a; }
.sd-title { margin: 0 0 4px; color: #7a3f12; font-size: 18px; }
.sd-desc { margin: 0 0 6px; font-weight: 700; color: #5b3a1c; }
.sd-sep { border-top: 2px dashed #b98c5a; margin: 8px 0; }
.sd-line { font-weight: 700; }
.sd-line.next { color: #9a8468; }
.sd-next-h { color: #9a8468; font-weight: 800; }
.sd-need { display: flex; flex-direction: column; gap: 2px; margin: 8px 0; font-weight: 800; }
.sd-need .bad { color: #c0392b; }
.sd-need.ok { color: #2f7a1f; }
.sd-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.sd-key { font-weight: 800; color: #8a6440; }
.sd-stepper { display: flex; align-items: center; gap: 6px; margin: 6px 0; }
.sd-stepper button { min-width: 38px; height: 32px; border-radius: 6px; border: 2px solid #4a2a10; background: linear-gradient(180deg, #8a5a2b, #5a361b); color: #fff; font-weight: 900; }
.sd-stepper b { min-width: 44px; text-align: center; font-size: 16px; }
@media (max-height: 560px), (max-width: 900px) {
  .skills-pane { gap: 8px; }
  .sk-grid { gap: 5px; margin-bottom: 6px; }
  .sk-h { font-size: 13px; margin-bottom: 4px; }
  .sk-cell i { font-size: 20px; }
  .sd-title { font-size: 14px; }
  .sd-desc, .sd-line, .sd-need { font-size: 12px; }
  .sd-sep { margin: 4px 0; }
}

/* =================== Cẩm nang =================== */
.help-body { display: grid; grid-template-columns: 240px 1fr; gap: 14px; min-height: 0; flex: 1; height: min(420px, 62vh); }
.help-topics { display: flex; flex-direction: column; gap: 6px; overflow: auto; }
.help-topics button {
  padding: 10px 12px; text-align: left; border-radius: 8px; border: 0; font-weight: 800; color: #fff3d6; text-shadow: 0 1px 2px #000;
  background: #8a6444; box-shadow: inset 0 0 0 2px #6e4b2f;
}
.help-topics button.on { background: #5a3a1c; box-shadow: inset 0 0 0 2px #e2a94e; }
.help-content { overflow: auto; color: #fff3d6; text-shadow: 0 1px 2px #5a361b; }
.help-h { text-align: center; color: #ffe066; margin: 2px 0 10px; font-size: 19px; text-shadow: 0 2px 2px #3a2210; }
.help-line { margin: 0 0 8px; line-height: 1.5; font-weight: 600; }
.help-line b { color: #ffe066; }
@media (max-height: 560px), (max-width: 900px) {
  .help-body { grid-template-columns: 170px 1fr; gap: 8px; height: 66vh; }
  .help-topics button { padding: 6px 8px; font-size: 12px; }
  .help-line { font-size: 12px; margin-bottom: 4px; }
  .help-h { font-size: 15px; margin-bottom: 6px; }
}

/* =================== Rương đồ =================== */
.stor-body { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; min-height: 0; }
.stor-body > section { min-height: 0; overflow: auto; max-height: 60vh; }
.stor-h { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; color: #fff3d6; text-shadow: 0 1px 2px #5a361b; }
.stor-h b { font-size: 15px; }
.stor-h span { flex: 1; font-size: 12px; }
.stor-grid { grid-template-columns: repeat(7, 1fr); gap: 5px; }
@media (max-height: 560px), (max-width: 900px) { .stor-grid { grid-template-columns: repeat(7, 1fr); gap: 3px; } .stor-body { gap: 8px; } }

/* =================== Bộ lạc =================== */
#win-guild .parch, #win-arena .parch, #win-life .parch { min-height: min(520px, 90vh); }
.guild-body { flex: 1; min-height: 0; overflow: auto; color: #fff3d6; text-shadow: 0 1px 2px #3a2210; max-height: 56vh; }
.gl-h { text-align: center; color: #fff3d6; margin: 0 0 10px; font-size: 18px; }
.gl-h.small { font-size: 15px; margin-top: 12px; }
.gl-row {
  display: grid; grid-template-columns: 48px 1fr auto auto auto; gap: 12px; align-items: center; padding: 8px 12px; margin-bottom: 8px;
  border-radius: 8px; background: #8a6444; box-shadow: inset 0 0 0 2px #6e4b2f;
}
.gl-row.member { grid-template-columns: 14px 1fr auto auto; }
.gl-row.off { opacity: .7; }
.gl-icon { width: 46px; height: 46px; border-radius: 10px; display: grid; place-items: center; font-style: normal; font-weight: 900; font-size: 22px; background: radial-gradient(circle at 40% 35%, #e2a94e, #6b3f17); box-shadow: 0 0 0 2px #fff3d6; }
.gl-dot { width: 10px; height: 10px; border-radius: 50%; background: #7fe36a; box-shadow: 0 0 6px #7fe36a; }
.gl-row.off .gl-dot { background: #777; box-shadow: none; }
.gl-info b { display: block; font-size: 15px; }
.gl-info small { color: #ffe066; font-weight: 700; }
.gl-n, .gl-lv { font-weight: 800; white-space: nowrap; }
.gl-rank { font-weight: 800; padding: 2px 8px; border-radius: 10px; background: rgba(0,0,0,.25); font-size: 12px; }
.gl-rank.r2 { color: #ffe066; }
.gl-rank.r1 { color: #9fe0ff; }
.gl-acts { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.gl-empty, .gl-text { text-align: center; margin: 8px 0; font-weight: 600; }
.gl-text.dim { color: #e6cfa2; }
.gl-dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; max-width: 420px; margin: 0 auto; }
.gl-dl dt { color: #ffe2a8; }
.gl-dl dd { margin: 0; font-weight: 800; }
.guild-foot { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
.gl-search, .gl-name, .gl-notice {
  flex: 1; min-width: 0; padding: 9px 12px; border-radius: 8px; border: 2px solid #8d5a2b; background: #fff8e8; color: #5b3a1c; font: inherit; font-weight: 700; outline: none;
}
.gl-name { display: block; width: min(420px, 100%); margin: 8px auto; }
.gl-notice { display: block; width: 100%; min-height: 80px; resize: vertical; }
@media (max-height: 560px), (max-width: 900px) {
  .gl-row { grid-template-columns: 36px 1fr auto auto; gap: 6px; padding: 5px 8px; margin-bottom: 5px; }
  .gl-row .gl-lv { display: none; }
  .gl-icon { width: 34px; height: 34px; font-size: 16px; }
  .gl-info b { font-size: 13px; }
  .guild-body { max-height: 54vh; }
  .guild-foot { margin-top: 6px; }
}

/* =================== Bấm người chơi / lời mời tổ đội =================== */
.ppop, .pinvite {
  position: absolute; left: 50%; top: 30%; transform: translateX(-50%); z-index: 25; pointer-events: auto; min-width: 260px; max-width: 90vw;
  padding: 14px 18px; border-radius: 12px; text-align: center; color: #5b3a1c;
  background: linear-gradient(180deg, #f7e3b9, #e5c38c); border: 3px solid #8d5a2b; box-shadow: 0 10px 30px rgba(0,0,0,.55);
}
.ppop b { display: block; font-size: 17px; color: #7a3f12; }
.ppop small { display: block; font-weight: 700; color: #8a6440; margin: 2px 0 10px; }
.pinvite p { margin: 0 0 10px; font-weight: 800; }
.ppop-actions { display: flex; gap: 8px; justify-content: center; }

/* Biểu tượng menu mới */
.mi-party { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff3d6'%3E%3Ccircle cx='8' cy='8' r='3'/%3E%3Ccircle cx='16' cy='8' r='3'/%3E%3Cpath d='M2 20c0-3.3 2.7-6 6-6s6 2.7 6 6zm10.5 0c.3-2.5-.6-4.6-2-6 .8-.3 1.6-.4 2.5-.4 3.3 0 6 2.7 6 6.4z'/%3E%3C/svg%3E"); }
.mi-guild { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff3d6'%3E%3Cpath d='M5 2v20h2v-7h11l-2-4 2-4H7V2z'/%3E%3C/svg%3E"); }
.menu-grid { grid-template-columns: repeat(4, 76px); }

.sk-grid { grid-template-columns: repeat(4, minmax(0, 84px)); justify-content: center; }
#pot-grid { grid-template-columns: repeat(3, minmax(0, 84px)); }
.sk-left { display: flex; flex-direction: column; }
@media (max-height: 560px), (max-width: 900px) {
  .sk-grid { grid-template-columns: repeat(4, minmax(0, 56px)); }
  #pot-grid { grid-template-columns: repeat(3, minmax(0, 56px)); }
}
@media (max-height: 560px), (max-width: 900px) {
  .qpanel { width: 196px; }
  .qp-box { font-size: 11px; max-height: 104px; }
  .qp-title { font-size: 12px; }
  .chat-btn { width: 42px; height: 42px; left: 190px; bottom: 12px; }
}

/* Chân dung nửa trên trong hội thoại */
.dlg-portrait { background-position: left top; -webkit-mask-image: linear-gradient(180deg, #000 82%, transparent); mask-image: linear-gradient(180deg, #000 82%, transparent); }
.dialog:not(.noportrait) .dlg-band { padding-left: calc(2% + var(--pw, 260px) + 16px); }

/* Bán nhiều món */
.sell-bar { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; }
.shop-row.picked { box-shadow: inset 0 0 0 3px #ffe066, 0 0 0 2px #b5741c; }
.shop-row.picked::after { content: "✓"; position: absolute; right: 8px; top: 6px; width: 22px; height: 22px; border-radius: 50%; background: #2f8a23; color: #fff; font-weight: 900; display: grid; place-items: center; font-size: 14px; }
.shop-row { position: relative; }

/* ============================================================================
   TỐI ƯU ĐIỆN THOẠI (màn ngang) — gom một chỗ, đặt cuối để ghi đè các luật cũ
   ============================================================================ */
:root {
  --sl: env(safe-area-inset-left, 0px);
  --sr: env(safe-area-inset-right, 0px);
  --sb: env(safe-area-inset-bottom, 0px);
}

/* Trò chuyện: nút nhỏ trên thanh góc phải (không còn nằm cạnh cần điều khiển) */
.top-right .chat-btn {
  position: relative; left: auto !important; bottom: auto; width: 40px; height: 36px; border-radius: 6px; flex: 0 0 auto;
  border: 2px solid #4a2a10; background-color: #8a5a2b; background-size: 62%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff3d6' d='M4 4h16a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H10l-5 4v-4H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z'/%3E%3Ccircle cx='8' cy='10.5' r='1.4' fill='%235a361b'/%3E%3Ccircle cx='12' cy='10.5' r='1.4' fill='%235a361b'/%3E%3Ccircle cx='16' cy='10.5' r='1.4' fill='%235a361b'/%3E%3C/svg%3E"),
    linear-gradient(180deg, #a8743f, #7a4d22);
  background-repeat: no-repeat; background-position: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 2px 4px rgba(0,0,0,.4);
}
.top-right .chat-btn.on { border-color: #ffe066; filter: brightness(1.15); }
.top-right .chat-btn .badge { right: -7px; top: -7px; }
.chat-panel { left: calc(12px + var(--sl)); top: 52px; bottom: auto; }
.cp-form { order: -1; border-top: 0; border-bottom: 1px solid rgba(232,183,101,.25); }
.chat-panel { flex-direction: column; }
.chat-panel .cp-head { order: -2; }

/* Bảng nhiệm vụ & các nút HUD nằm trên lớp cần điều khiển */
.qpanel { z-index: 7; }
.hud-plate, .top-right { z-index: 7; }
.menu-grid { z-index: 13; }
.chat-panel { z-index: 12; }

/* Mất kết nối: hiện to giữa màn hình */
.net-status.bad {
  left: 50%; right: auto; top: 40%; bottom: auto; transform: translate(-50%, -50%); z-index: 30;
  padding: 10px 20px; border-radius: 20px; background: rgba(120,20,10,.9); border: 2px solid #ff8a7a;
  color: #fff; font-size: 15px; font-weight: 800;
}

/* Cần điều khiển "chạm đâu hiện đó" */
.joy-zone { position: absolute; left: 0; bottom: 0; width: 44%; height: 72%; pointer-events: auto; touch-action: none; }
.joy { pointer-events: auto; transition: opacity .15s; opacity: .75; }
.joy.active { opacity: 1; transition: none; }

/* Nút Nói: tách hẳn khỏi các nút kỹ năng */
.t-talk { right: 196px; bottom: 92px; width: 66px; height: 66px; font-size: 14px; }

/* Lề an toàn (tai thỏ / góc bo) */
.hud-plate { left: calc(10px + var(--sl)); }
.qpanel { left: calc(10px + var(--sl)); }
.top-right { right: calc(10px + var(--sr)); }
.menu-grid { right: calc(10px + var(--sr)); }
.joy { left: calc(4% + var(--sl)); }
.touch-buttons { right: calc(2.5% + var(--sr)); }
.auto-btn { right: calc(12px + var(--sr)); }
.quickslots.potion-row { right: calc(2.5% + 112px + var(--sr)); }
.window { padding-left: calc(8px + var(--sl)); padding-right: calc(8px + var(--sr)); }
.dlg-band { padding-right: calc(3% + var(--sr)); padding-bottom: calc(16px + var(--sb)); }

/* Bán nhiều: thanh chọn nhanh một hàng, vuốt ngang */
.sell-bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.sell-bar::-webkit-scrollbar { display: none; }
.sell-bar .pbtn { white-space: nowrap; flex: 0 0 auto; }

/* Chỉ số: nhãn dài không xuống dòng */
.stat-list dt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.stat-list { grid-template-columns: minmax(0, 1fr) auto; }
.bag-tabs button { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Điện thoại (màn thấp hoặc hẹp) ---------- */
@media (max-height: 560px), (max-width: 900px) {
  .top-right .chat-btn { width: 36px; height: 32px; }
  .t-talk { right: 192px; bottom: 88px; width: 60px; height: 60px; font-size: 13px; }

  /* HUD trên cùng */
  .target { top: 46px; width: min(300px, 40vw); }
  .toasts { top: 94px; }
  .buffs { left: auto; right: calc(10px + var(--sr)); top: 46px; flex-direction: row-reverse; }
  .net-status:not(.bad) { top: 80px; right: calc(12px + var(--sr)); bottom: auto; font-size: 10px; }
  .chat-panel { top: 46px; left: 50%; transform: translateX(-50%); width: min(560px, 74vw); height: min(300px, calc(100dvh - 110px)); }

  /* Cửa sổ giấy da: dùng tối đa chiều cao, các phần thân tự co */
  .window { padding: 6px calc(6px + var(--sr)) 6px calc(6px + var(--sl)); }
  .parch { max-height: calc(100vh - 12px); max-height: calc(100dvh - 12px); width: min(1060px, calc(100vw - 12px - var(--sl) - var(--sr))); }
  .parch-close { right: -6px; top: -6px; width: 38px; height: 38px; font-size: 19px; }
  .parch-title { padding: 4px 26px; font-size: 16px; top: -14px; }
  .shop-body, .forge-body, .stor-body, .help-body, .skills-pane { grid-template-rows: minmax(0, 1fr); flex: 1; min-height: 0; }
  .shop-list, .forge-pick, .stor-body > section, .guild-body { max-height: none; }
  .shop-list { overflow: auto; }
  .help-body { height: auto; }
  .cw-pane { min-height: 0; }
  #win-guild .parch, #win-arena .parch, #win-life .parch { min-height: 0; height: calc(100dvh - 12px); }

  /* Thanh tiền: gọn lên góc trên, không chiếm một hàng riêng */
  .parch > .currency { position: absolute; top: 6px; right: 46px; margin: 0; z-index: 2; gap: 6px; align-items: center; }
  #win-shop .parch > .currency { left: 12px; right: auto; }
  .cur { height: 28px; min-width: 0; padding: 0 10px; font-size: 13px; border-width: 2px; gap: 8px; }
  .cur .icon-gold { width: 20px; height: 20px; }
  #win-character .cur-note { display: none; }
  #shop-msg { max-width: 34vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
  .parch-win:not(.small) .parch { padding-top: 40px; }

  /* Bảng nhân vật */
  .stat-list { font-size: 12px; gap: 3px 8px; }
  .bag-tabs button { font-size: 11px; padding: 5px 2px; }
  .pager button { width: 36px; height: 30px; }
  .bag-foot { margin-top: 6px; }
  .sd-actions { position: sticky; bottom: -10px; margin: 6px -10px -10px; padding: 6px 10px 8px; background: linear-gradient(180deg, rgba(236,211,165,.6), #ecd3a5 40%); }

  /* Tự động đánh */
  #win-auto .sec-title { font-size: 14px; margin: 2px 0 6px; }
  #win-auto .check-grid { gap: 6px 14px; }
  #win-auto .steppers { flex-direction: row; flex-wrap: wrap; gap: 8px 18px; margin-top: 8px; }
  #win-auto .stepper span { font-size: 12px; }
  .stepper button { width: 40px; height: 34px; }
  .stepper b { width: 72px; height: 34px; }
  .parch-hint { margin: 4px 0 2px; }

  /* Cẩm nang */
  .help-body { grid-template-columns: 150px 1fr; }

  /* Hộp thoại NPC */
  .dlg-band { min-height: 36vh; }

  /* Bảng nhiệm vụ: chạm dễ hơn */
  .qp-tabs button { min-height: 28px; }
}

/* ---------- Điện thoại nhỏ (cao ≤ 430px: hầu hết điện thoại khi xoay ngang) ---------- */
@media (max-height: 430px) {
  /* Khung nhân vật nhỏ lại một chút */
  .hud-plate .avatar { width: 56px; height: 56px; flex-basis: 56px; }
  .hud-plate .lv-badge { left: 15px; top: 44px; width: 26px; height: 26px; }
  .plate-body { min-width: 184px; padding: 3px 16px 5px 20px; gap: 2px; }
  .pname { font-size: 13px; }
  .pbar { height: 13px; }
  .pbar em { line-height: 12px; font-size: 10px; }
  .map-pill, .gold-pill { padding: 0 10px; height: 30px; }
  .menu-burger, .top-right .chat-btn { height: 30px; }

  /* Bảng nhiệm vụ: gọn, không đè cần điều khiển */
  .qpanel { top: 76px; width: 188px; }
  .qp-tabs button { padding: 2px 9px; font-size: 11px; min-height: 26px; }
  .qp-box { max-height: max(54px, calc(100dvh - 76px - 28px - 168px)); padding: 5px 8px; font-size: 11px; line-height: 1.32; }
  .qp-title { font-size: 12px; }

  /* Cần điều khiển và cụm nút */
  .joy { width: 116px; height: 116px; bottom: calc(6% + var(--sb)); }
  .joy-knob { width: 52px; height: 52px; margin: -26px 0 0 -26px; }
  .touch-buttons { transform: scale(.76); bottom: calc(5% + 46px + var(--sb)); }
  .quickslots.potion-row { right: calc(2.5% + 84px + var(--sr)); bottom: calc(6px + var(--sb)); gap: 6px; }
  .potion-row .quickslot { width: 46px; height: 46px; }
  .auto-btn { width: 46px; height: 46px; bottom: calc(8px + var(--sb)); padding: 8px; }
  .auto-label { bottom: 40px; font-size: 15px; }

  /* Cửa sổ: bỏ hoa văn đáy để dành chỗ */
  .parch {
    padding: 34px 10px 10px 10px; border-width: 4px;
    background: var(--zig) top 8px left 0 / 40px 22px repeat-x, radial-gradient(ellipse at 50% 40%, #f6e6c3, #ecd3a5 80%);
  }
  .parch-win:not(.small) .parch { padding-top: 36px; }
  .parch-win .parch .side-tabs { top: 5px; left: 6px; }
  .side-tabs button { padding: 4px 10px; font-size: 12px; }
  .slot-box { padding: 7px; }
  .char-wrap { gap: 8px; }
  .equip { grid-template-columns: 56px 1fr 56px; gap: 5px; padding: 5px; }
  .eq { min-height: 34px; font-size: 10px; }
  .eq-col { gap: 4px; }
  .name-scroll { padding: 3px 8px; }
  .name-scroll b { font-size: 14px; }
  .cw-lv { width: 28px; height: 28px; }
  .cw-stage { min-height: 90px; }
  .inv-grid { gap: 4px; }
  .sk-grid { grid-template-columns: repeat(4, minmax(0, 46px)); }
  #pot-grid { grid-template-columns: repeat(3, minmax(0, 46px)); }
  .sk-cell i { font-size: 17px; }
  .sk-cell .n { font-size: 11px; right: 3px; }
  .sk-h { margin: 0 0 3px; }
  .sk-h small { font-size: 11px; }
  .shop-row b { font-size: 13px; }
  .shop-row small { font-size: 10px; }
  .help-topics button { padding: 5px 8px; }
  .gl-row { margin-bottom: 4px; }
  .menu-grid { grid-template-columns: repeat(4, 66px); gap: 4px; padding: 8px; top: 44px; }
  .menu-grid button { font-size: 11px; padding: 4px 2px; }
  .mi { width: 38px; height: 38px; background-size: 26px; }
  .dlg-band { padding-top: 10px; gap: 10px; }
  .ppop, .pinvite { top: 22%; padding: 10px 14px; }
}

/* ---------- Đăng nhập / tạo nhân vật trên màn ngang thấp ---------- */
#screen-auth, #screen-create, #screen-loading { display: flex; }
#screen-auth > .panel, #screen-create > .panel, #screen-loading > .loading { margin: auto; }
@media (max-height: 500px) and (orientation: landscape) {
  #screen-auth, #screen-create { padding: 10px calc(12px + var(--sr)) 10px calc(12px + var(--sl)); }
  .auth-panel { padding: 16px 20px; }
  #screen-auth .auth-panel { width: min(760px, 100%); display: grid; grid-template-columns: 1fr 1.15fr; column-gap: 24px; align-items: center; }
  #screen-auth .logo { grid-row: 1 / span 2; margin: 0; min-height: 0; }
  #screen-auth .logo-text { font-size: 34px; }
  #screen-auth .tabs { margin: 0 0 2px; }
  .auth-panel label { margin-top: 6px; font-size: 13px; }
  .auth-panel input { padding: 8px 10px; margin-top: 3px; }
  .auth-panel .error { margin: 4px 0; min-height: 1.1em; font-size: 13px; }
  .auth-panel .btn-primary { padding: 9px; }
  #screen-create .auth-panel { width: min(560px, 100%); }
  #screen-create h1 { margin: 0 0 4px; font-size: 20px; }
  #screen-create .muted { margin: 0 0 4px; font-size: 13px; }
}
@media (max-height: 430px) {
  #auto-skills { grid-template-columns: repeat(3, 1fr); }
  #win-auto .check-grid.three:not(#auto-skills) { grid-template-columns: repeat(4, 1fr); }
  #win-auto .pcheck { font-size: 12px; gap: 7px; }
  #win-auto .pcheck span { flex-basis: 30px; height: 30px; }
  #win-auto .seg button { padding: 5px 12px; }
}
/* Máy tính (không cảm ứng): khung chat ở góc dưới trái, ô nhập ở dưới như cũ */
body:not(.touch-mode) .chat-panel { top: auto; bottom: 24px; left: calc(12px + var(--sl)); transform: none; }
body:not(.touch-mode) .cp-form { order: 0; border-bottom: 0; border-top: 1px solid rgba(232,183,101,.25); }

/* Ảnh admin cho khung máu: viền ảnh mặt, huy hiệu cấp, thanh máu/phép */
.hud-plate .avatar-ring { display: none; position: absolute; z-index: 2; left: -7px; top: 50%; width: 88px; height: 88px; margin-top: -44px; pointer-events: none; }
.pbar, .bar.exp { container-type: inline-size; }
.pbar i { max-width: 100%; }
@media (max-height: 560px), (max-width: 900px) {
  .hud-plate .avatar-ring { width: 76px; height: 76px; margin-top: -38px; }
  .hud-plate { --pbh: 14px; }
}
@media (max-height: 430px) {
  .hud-plate .avatar-ring { width: 70px; height: 70px; margin-top: -35px; }
  .hud-plate { --pbh: 13px; }
}

/* Nút nhắm mục tiêu (thay nút Nói) */
.t-aim { display: grid; place-items: center; }
.t-aim svg { width: 62%; height: 62%; pointer-events: none; }
.t-aim.locked { border-color: #ff8a7a; box-shadow: 0 0 0 3px rgba(255,90,74,.35); }
.target.nobar .tg-bar { display: none; }
.t-aim { border-color: rgba(245,210,143,.75); background: radial-gradient(circle at 40% 35%, rgba(122,84,34,.9), rgba(42,29,18,.9)); }
/* Hai thẻ Nhiệm vụ / Tổ đội trải hết bề ngang, khớp với khung bên dưới */
.qp-tabs button[data-qp] { flex: 1 1 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qp-box { border-radius: 0 0 8px 8px; }
.qpanel.collapsed { width: auto; }

/* Bảng Nhân vật / Hành trang / Kỹ năng trên điện thoại: thu gọn, không che hết màn hình (như ảnh mẫu):
   bảng nằm giữa, chừa viền xung quanh; các thẻ dọc nằm ngoài mép trái. */
@media (max-height: 560px), (max-width: 900px) {
  #win-character, #win-guild, #win-social, #win-storage, #win-quest, #win-mail, #win-arena, #win-life { background: rgba(0,0,0,.28); }
  #win-character .parch, #win-guild .parch, #win-social .parch, #win-storage .parch, #win-quest .parch, #win-mail .parch, #win-arena .parch, #win-life .parch {
    width: min(680px, calc(100vw - 150px - var(--sl) - var(--sr)));
    max-height: calc(100dvh - 48px);
    margin-left: 92px;
    padding: 30px 10px 10px !important;
  }
  #win-character .parch .side-tabs, #win-guild .parch .side-tabs, #win-social .parch .side-tabs, #win-quest .parch .side-tabs, #win-mail .parch .side-tabs, #win-arena .parch .side-tabs, #win-life .parch .side-tabs { left: -4px; top: 24px; transform: translateX(-100%); flex-direction: column; gap: 6px; }
  #win-character .side-tabs button, #win-guild .side-tabs button, #win-social .side-tabs button, #win-quest .side-tabs button, #win-mail .side-tabs button, #win-arena .side-tabs button, #win-life .side-tabs button {
    border-radius: 16px 0 0 16px; border: 2px solid #8d5a2b; border-right: 0; padding: 7px 10px 7px 12px; font-size: 12px; text-align: left;
    box-shadow: -2px 2px 4px rgba(0,0,0,.35);
  }
  #win-character .parch-close, #win-guild .parch-close, #win-social .parch-close, #win-storage .parch-close, #win-quest .parch-close, #win-mail .parch-close, #win-arena .parch-close, #win-life .parch-close { right: -10px; top: -10px; }
  #win-character .char-wrap { gap: 7px; }
  #win-character .equip { grid-template-columns: 52px 1fr 52px; gap: 4px; padding: 5px; }
  #win-character .eq { min-height: 32px; font-size: 10px; }
  #win-character .cw-stage { min-height: 84px; }
  #win-character .stat-list { font-size: 11.5px; gap: 2px 8px; }
  #win-character .inv-grid { gap: 4px; }
}
@media (max-height: 560px), (max-width: 900px) {
  #win-character .char-wrap:not(.wide) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  #win-character .equip { grid-template-columns: 56px minmax(0, 1fr) 56px; }
  #win-character .stat-list { font-size: 11px; }
  /* Hành trang: lưới ô co theo chỗ trống, thanh lật trang luôn thấy */
  #win-character .cw-pane[data-pane="bag"] { display: flex; flex-direction: column; min-height: 0; }
  #win-character .cw-pane[data-pane="bag"] .inv-grid { flex: 1 1 auto; min-height: 0; overflow-y: auto; align-content: start; }
  #win-character .bag-foot { flex: 0 0 auto; margin-top: 5px; }
}
#win-character .bag-foot .pbtn { white-space: nowrap; padding: 5px 10px; font-size: 12px; }

/* =================== Khu vực (kênh) =================== */
.zone-pill {
  height: 36px; display: flex; align-items: center; gap: 5px; padding: 0 14px; color: #fff3d6; font-weight: 800; font-size: 14px; white-space: nowrap;
  background: linear-gradient(180deg, #a8743f, #7a4d22); border: 2px solid #4a2a10; border-radius: 6px; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 2px 4px rgba(0,0,0,.4); text-shadow: 0 1px 2px #000;
}
.zone-pill b { color: #ffe066; }
.zone-pill:active { transform: translateY(1px); }
.zone-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 0 4px 8px; color: #7a3f12; }
.zone-head span { color: #8a6440; }
.zone-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; max-height: min(330px, calc(100dvh - 150px)); }
.zone-card {
  display: flex; align-items: center; gap: 12px; padding: 7px 10px; border-radius: 8px; border: 0; text-align: left; cursor: pointer;
  background: #8a6444; box-shadow: inset 0 0 0 2px #6e4b2f, inset 0 2px 6px rgba(0,0,0,.25); color: #fff3d6; text-shadow: 0 1px 2px #000;
}
.zone-card .zc-num {
  flex: 0 0 52px; height: 52px; display: grid; place-items: center; border-radius: 8px; font-size: 24px; font-weight: 900; color: #7a3f12; text-shadow: none;
  background: linear-gradient(180deg, #f7e3b9, #e5c38c); box-shadow: inset 0 0 0 2px #c9a57a;
}
.zone-card.here .zc-num { background: linear-gradient(180deg, #6fb7b4, #3d8a87); color: #0e3533; box-shadow: inset 0 0 0 2px #2c6664; }
.zone-card.here { box-shadow: inset 0 0 0 2px #e2a94e, 0 0 0 2px #e2a94e; }
.zone-card .zc-info { display: flex; flex-direction: column; gap: 2px; font-weight: 800; }
.zone-card.full { opacity: .55; cursor: default; }
.zone-card:not(.full):not(.here):hover { filter: brightness(1.1); }

/* Bỏ thanh EXP dưới đáy màn hình (đã có thanh kinh nghiệm trong khung máu) */
.bar.exp { display: none !important; }
.net-status { bottom: 6px; }

/* Nút nhắm mục tiêu: nằm sát cụm kỹ năng (giữa Kỹ năng 1 và Kỹ năng 2) */
.t-talk, .t-aim { right: 172px !important; bottom: 84px !important; width: 62px !important; height: 62px !important; }

/* =================== Một kiểu chữ, một cỡ chữ cho toàn bộ giao diện =================== */
:root { --fs: 14px; }
@media (max-height: 560px), (max-width: 900px) { :root { --fs: 12px; } }
#screen-game, #screen-game button, #screen-game input, #screen-game select, #screen-game textarea { font-family: var(--font) !important; }
.parch *, .qpanel *, .chat-panel *, .dlg-band *, .menu-grid button, .map-pill, .zone-pill, .pname, .pbar em,
.target *, .toast, .ppop *, .pinvite *, .item-pop *, .zone-head * {
  font-size: var(--fs) !important;
  letter-spacing: normal;
}
/* Giữ cỡ riêng cho các ký hiệu / số nhỏ trong ô (không phải chữ) */
.parch .sk-cell i { font-size: 20px !important; }
.parch .parch-close { font-size: 19px !important; }
.parch .zone-card .zc-num { font-size: 22px !important; }
.parch .inv-slot .q, .parch .pl, .parch .sk-cell .n, .parch .tagq { font-size: 11px !important; }
.parch .cw-lv b { font-size: 13px !important; }

/* Chỉ số: nhãn hiện đủ chữ, giá trị dài (Nội tại) tự xuống dòng */
.stat-list { grid-template-columns: max-content minmax(0, 1fr) !important; }
.stat-list dt { overflow: visible !important; text-overflow: clip !important; }
.stat-list dd { overflow-wrap: anywhere; }
/* Thẻ Nhiệm vụ / Tổ đội không bị cắt chữ */
.qp-tabs button[data-qp] { padding-left: 4px !important; padding-right: 4px !important; text-overflow: clip !important; }
.qp-tabs .qp-toggle { flex: 0 0 auto; padding-left: 7px !important; padding-right: 7px !important; }
@media (max-height: 430px) { .qpanel { width: 200px; } }

/* Ping: nhỏ, sát góc dưới bên trái */
.net-status:not(.bad) {
  left: calc(6px + var(--sl)) !important; right: auto !important; top: auto !important; bottom: calc(3px + var(--sb)) !important;
  font-size: 10px !important; opacity: .7; z-index: 4;
}
/* Nút / thẻ đủ cao để khung ảnh không bị dẹt */
.bag-tabs button, .shop-tabs button, .cp-tabs button { min-height: 30px; }
.qp-tabs button { min-height: 30px !important; }
#win-character .side-tabs button, #win-guild .side-tabs button, #win-social .side-tabs button, #win-quest .side-tabs button, #win-mail .side-tabs button, #win-arena .side-tabs button, #win-life .side-tabs button { min-height: 32px; }
.map-pill, .zone-pill { height: 36px !important; }
@media (max-height: 430px) { .map-pill, .zone-pill, .menu-burger, .top-right .chat-btn { height: 32px !important; } }
@media (max-height: 560px), (max-width: 900px) {
  .parch .bag-tabs button { font-size: 10.5px !important; letter-spacing: -.2px; }
  .parch .eq { font-size: 10px !important; line-height: 1.1; padding: 0 2px; }
}
.bag-tabs button[data-bf="material"] { flex-grow: 1.45; }
.bag-tabs button[data-bf="all"] { flex-grow: .8; }

/* Bám sát mép màn hình, không chừa chỗ cho camera / tai thỏ của điện thoại */
:root { --sl: 0px !important; --sr: 0px !important; --sb: 0px !important; }

.touch-buttons { bottom: calc(6% + 46px) !important; }
@media (max-height: 430px) { .touch-buttons { bottom: calc(5% + 40px) !important; } }
.auto-switch { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0 0 10px; }
.auto-switch .pbtn.big { width: auto; min-width: 220px; }
.auto-state { color: #8a6440; font-weight: 800; }
.auto-state.on { color: #2f7a1f; }

/* Bảng Nhân vật / Hành trang / Kỹ năng: một cỡ cố định cho cả 3 thẻ, chuyển thẻ không co giãn */
#win-character .parch, #win-guild .parch, #win-social .parch, #win-storage .parch, #win-quest .parch, #win-mail .parch, #win-arena .parch, #win-life .parch { width: min(1060px, calc(100vw - 16px)); height: min(640px, calc(100dvh - 16px)); min-height: 0 !important; }
#win-character .char-wrap { flex: 1 1 auto; min-height: 0; }
#win-character .cw-pane, #win-character .skills-pane { min-height: 0; overflow: auto; }
#win-character .char-wrap > * { min-height: 0; }
@media (max-height: 560px), (max-width: 900px) {
  #win-character .parch, #win-guild .parch, #win-social .parch, #win-storage .parch, #win-quest .parch, #win-mail .parch, #win-arena .parch, #win-life .parch { width: min(680px, calc(100vw - 150px)); height: calc(100dvh - 40px); max-height: none; }
}

/* =====================================================================
   ĐIỆN THOẠI: thu nhỏ giao diện theo tỉ lệ màn hình (như ảnh mẫu), bảng nhiệm vụ gọn và rõ
   ===================================================================== */
@media (max-height: 560px), (max-width: 900px) {
  :root { --fs: 11px; }

  /* Khung máu nhỏ lại (~21% bề ngang màn hình) */
  .hud-plate .avatar { width: clamp(44px, 12vh, 58px); height: clamp(44px, 12vh, 58px); flex-basis: clamp(44px, 12vh, 58px); }
  .plate-body { min-width: 150px; }
  .pname { font-size: 11px !important; }

  /* Góc phải trên: nút thấp, gọn */
  .top-right { top: 6px; gap: 5px; }
  .map-pill, .zone-pill { height: clamp(24px, 7vh, 30px) !important; padding: 0 10px; }
  .menu-burger, .top-right .chat-btn { height: clamp(24px, 7vh, 30px) !important; width: clamp(28px, 8vh, 36px); padding: 0 7px; gap: 3px; }
  .menu-burger span { height: 2px; }

  /* Bảng Nhiệm vụ / Tổ đội: như ảnh mẫu — thẻ nhỏ, nền tối trong mờ, chữ rõ, cao vừa đủ, tự cuộn */
  .qpanel { left: 8px; width: clamp(160px, 22vw, 230px) !important; }
  .qp-tabs { gap: 3px; }
  .qp-tabs button { min-height: 22px !important; padding: 2px 6px !important; font-size: 11px !important; border-radius: 5px 5px 0 0; }
  .qp-tabs .qp-toggle { min-width: 24px; padding: 2px 6px !important; }
  .qp-box {
    max-height: min(150px, calc(100dvh * 0.36)) !important; min-height: 40px;
    padding: 6px 8px !important; background: rgba(15,22,14,.62) !important; border-radius: 0 6px 6px 6px;
    line-height: 1.3 !important;
  }
  .qp-title { font-size: 12px !important; line-height: 1.25; }
  .qp-goal, .qp-hint, .qp-hint em, .qp-prog { font-size: 10.5px !important; }
  .qp-hint em { margin-top: 3px; }

  /* Cụm nút hành động nhỏ lại ~20% */
  .touch-buttons { transform: scale(.64) !important; transform-origin: right bottom; right: 1.5% !important; bottom: calc(4% + 34px) !important; }
  .potion-row .quickslot { width: clamp(34px, 10vh, 42px) !important; height: clamp(34px, 10vh, 42px) !important; border-width: 2px; }
  .quickslots.potion-row { bottom: 4px !important; gap: 6px !important; right: calc(1.5% + 52px) !important; }
  .auto-btn { width: clamp(34px, 10vh, 42px) !important; height: clamp(34px, 10vh, 42px) !important; right: 8px !important; bottom: 4px !important; padding: 7px !important; border-width: 2px !important; }
  .potion-row .quickslot .qs-icon { inset: 6px; }
  .potion-row .quickslot .qs-count { font-size: 9px !important; line-height: 12px; }
  .joy { width: clamp(84px, 26vh, 110px) !important; height: clamp(84px, 26vh, 110px) !important; }
  .joy-knob { width: 42%; height: 42%; margin: -21% 0 0 -21%; }

  /* Khung máu quái, thông báo nhỏ lại */
  .target { top: 40px; width: min(260px, 34vw); }
  .toast { padding: 5px 12px; }
}
@media (max-height: 560px), (max-width: 900px) {
  .qpanel { width: clamp(178px, 25vw, 240px) !important; }
  .qp-tabs button[data-qp] { padding: 2px 1px !important; letter-spacing: -.2px; }
}
@media (max-height: 560px), (max-width: 900px) {
  .qp-tabs .qp-toggle { flex: 0 0 26px !important; min-width: 0 !important; padding: 0 !important; font-size: 10px !important; }
  .qp-tabs button[data-qp="quest"] { flex-grow: 1.15; }
}

/* =================== Thanh góc phải: 4 nút sát nhau, cùng chiều cao =================== */
:root { --tb: 36px; }
@media (max-height: 560px), (max-width: 900px) { :root { --tb: clamp(26px, 8vh, 32px); } }
.top-right { gap: 4px !important; }
.top-right > * { height: var(--tb) !important; margin: 0 !important; }
.top-right .map-pill, .top-right .zone-pill { padding: 0 12px !important; }
.top-right .chat-btn, .top-right .menu-burger { width: calc(var(--tb) * 1.15) !important; flex: 0 0 auto; }
.menu-burger { padding: 0 calc(var(--tb) * .24) !important; gap: calc(var(--tb) * .12) !important; }

/* =================== Menu ☰ xổ ra: kiểu ảnh mẫu — biểu tượng nổi, không nền, 4 cột,
   nằm gọn góc trên phải, không đè lên cụm nút đánh =================== */
.menu-grid {
  top: calc(var(--tb) + 14px) !important; right: 6px !important;
  background: none !important; border: 0 !important; box-shadow: none !important; padding: 0 !important;
  grid-template-columns: repeat(4, var(--mc, 78px)) !important; gap: 4px 2px !important;
}
.menu-grid button { padding: 2px 0 !important; gap: 2px !important; background: none !important; }
.menu-grid button:hover { background: none !important; filter: brightness(1.15); }
.menu-grid .mi {
  width: var(--mi, 50px); height: var(--mi, 50px); border-radius: 50%;
  background-color: rgba(60,36,16,.82); box-shadow: inset 0 0 0 2px #e2a94e, 0 3px 6px rgba(0,0,0,.55);
  background-size: 58%;
}
.menu-grid button { color: #fff; font-weight: 900; text-shadow: 0 1px 0 #3a1d08, 0 0 3px #000, 0 0 2px #000 !important; white-space: nowrap; }
.menu-grid button:active .mi { transform: scale(.92); }
@media (max-height: 560px), (max-width: 900px) {
  .menu-grid { --mc: clamp(50px, 8.6vw, 66px); --mi: clamp(30px, 10vh, 40px); }
  .menu-grid button { font-size: 10.5px !important; }
}
/* Tên bản đồ và Khu vực cùng bề ngang */
.top-right .map-pill, .top-right .zone-pill { width: clamp(108px, 17vw, 190px) !important; justify-content: center; overflow: hidden; }
.top-right .map-pill b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== Bảng nhiệm vụ: ô thông tin dính liền ngay dưới 2 thẻ, không viền, rộng đúng bằng hàng thẻ ===== */
.qpanel { display: flex; flex-direction: column; }
.qpanel .qp-tabs { display: flex; gap: 3px; align-items: flex-end; margin: 0; padding: 0; position: relative; z-index: 2; }
.qpanel .qp-tabs button { margin: 0 !important; }
#qp-box.qp-box {
  width: 100%; margin: 0 !important; position: relative; z-index: 1;
  border: 0 !important; border-image: none !important; box-shadow: none !important;
  background: rgba(12,20,12,.66) !important; border-radius: 0 0 8px 8px !important;
  padding: 7px 9px 8px !important;
}

/* ===== 3 nút góc phải (tên bản đồ, Khu vực, ☰) cùng cỡ ===== */
.top-right .menu-burger, .top-right .chat-btn { width: var(--tb) !important; min-width: var(--tb); }
/* Ô thông tin thẳng mép với phần hình của thẻ (ảnh thẻ có lề bóng ~2px) */
#qp-box.qp-box { width: auto; margin: 0 2px !important; }

/* Số máu / mana nhỏ lại */
.pbar em { font-size: 9px !important; }
@media (min-height: 561px) and (min-width: 901px) { .pbar em { font-size: 10px !important; } }

/* Menu xổ ra: các biểu tượng gần nhau, chữ đè nhẹ lên chân biểu tượng (như ảnh mẫu) */
.menu-grid { grid-template-columns: repeat(4, var(--mc, 64px)) !important; gap: 2px 0 !important; }
.menu-grid button { gap: 0 !important; padding: 0 !important; position: relative; }
.menu-grid button .mi { margin-bottom: -7px; position: relative; z-index: 0; }
.menu-grid button { line-height: 1.1; z-index: 1; }
@media (max-height: 560px), (max-width: 900px) {
  .menu-grid { --mc: clamp(46px, 7.4vw, 58px); }
  .menu-grid button .mi { margin-bottom: -6px; }
}
.menu-grid button .mi { margin-bottom: -3px !important; }

/* Ô nhiệm vụ: cách thẻ 3px, trong mờ hơn, mép trái/phải thẳng hàng với nút ◀ và thẻ Tổ đội */
#qp-box.qp-box { margin: 3px 0 0 !important; width: 100% !important; background: rgba(10,18,10,.42) !important; border-radius: 6px !important; }
#qp-box.qp-box { width: auto !important; margin: 3px 3px 0 2px !important; }

/* =================== Bộ lạc: cùng cỡ với Hành trang =================== */
#win-guild .parch, #win-arena .parch, #win-life .parch { display: flex; flex-direction: column; }
#win-guild .guild-body, #win-arena .guild-body, #win-life .guild-body { flex: 1 1 auto; max-height: none !important; min-height: 0; overflow: auto; }
#win-guild .parch-title, #win-arena .parch-title, #win-life .parch-title { display: none; }

/* =================== Tổ đội & Bạn bè =================== */
#win-social .parch { display: flex; flex-direction: column; }
.social-body { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 1fr 1.25fr; gap: 12px; }
.social-body.one { display: flex; flex-direction: column; gap: 8px; }
.social-body > section { min-height: 0; display: flex; flex-direction: column; color: #fff3d6; text-shadow: 0 1px 2px #3a2210; }
.so-full { flex: 1 1 auto; }
.so-h { margin: 0 0 8px; text-align: center; font-weight: 900; color: #fff3d6; }
.so-h.gold { color: #ffe066; }
.so-text { margin: 0; line-height: 1.5; font-weight: 700; }
.so-list { flex: 1 1 auto; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 6px; }
.so-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; background: #8a6444; box-shadow: inset 0 0 0 2px #6e4b2f; }
.so-av { flex: 0 0 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 900; font-size: 17px !important;
  background: radial-gradient(circle at 40% 35%, #e2a94e, #6b3f17); box-shadow: 0 0 0 2px #fff3d6; color: #fff; }
.so-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.so-info b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.so-info small { color: #ffe066; font-weight: 700; }
.so-st { font-weight: 800; color: #d9c7a5; white-space: nowrap; }
.so-st.on { color: #b8f59c; }
.so-bars { width: 90px; display: grid; gap: 3px; }
.so-acts { display: flex; gap: 5px; flex: 0 0 auto; }
.so-foot { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.so-foot .grow { flex: 1; }
.so-foot input { flex: 1; min-width: 0; padding: 7px 10px; border-radius: 7px; border: 2px solid #8d5a2b; background: #fff8e8; color: #5b3a1c; font-weight: 700; outline: none; }
.so-empty, .so-count { text-align: center; margin: 10px 0; font-weight: 700; color: #f5e6c8; }
.so-count { margin: 4px 0 0; font-size: 11px !important; color: #e6cfa2; }
.so-seg { justify-content: center; }
.dot-badge { display: inline-block; min-width: 16px; height: 16px; margin-left: 5px; padding: 0 4px; border-radius: 8px; background: #d8261a; color: #fff;
  font-size: 10px !important; line-height: 16px; text-align: center; vertical-align: 1px; text-shadow: none; }
@media (max-height: 560px), (max-width: 900px) {
  .social-body { gap: 7px; }
  .so-row { padding: 4px 7px; gap: 7px; }
  .so-av { flex-basis: 30px; height: 30px; font-size: 13px !important; }
  .so-bars { width: 64px; }
  .so-h { margin-bottom: 5px; }
  .so-foot { margin-top: 5px; }
}

/* Biểu tượng vật phẩm trong ô to, gần kín ô (như ảnh mẫu) */
.inv-slot, .fg-slot, .eq.has { background-size: 90%, 100% !important; }
.shop-row i, .ss-icon, .fa-item { background-size: 92%, 100% !important; }

/* Nút ☰ to hơn */
.top-right #btn-menu { width: calc(var(--tb) * 1.25) !important; height: calc(var(--tb) * 1.25) !important; margin: -3px 0 !important; }

/* =================== Khung máu người chơi đang chọn =================== */
.hud-plate.tplate { left: 38% !important; top: 8px; transform: translateX(-30%); z-index: 6; }
.hud-plate.tplate .plate-body { min-width: 0; }
@media (max-height: 560px), (max-width: 900px) { .hud-plate.tplate { left: 34% !important; top: 4px; } }

/* =================== Menu khi bấm người chơi (như ảnh mẫu) =================== */
.ppop.pmenu {
  top: 22%; min-width: 0; width: min(280px, 60vw); padding: 12px 12px 10px; text-align: left; display: flex; flex-direction: column; gap: 6px;
  background: linear-gradient(180deg, #f6e6c3, #ecd3a5); border: 4px solid #5a361b; border-radius: 10px;
  box-shadow: inset 0 0 0 2px #b98c5a, 0 12px 30px rgba(0,0,0,.55);
}
.pmenu > b { font-size: 15px; color: #7a3f12; padding: 0 4px; }
.pmenu > small { margin: -4px 0 4px; padding: 0 4px; color: #8a6440; font-weight: 700; }
.pm-item {
  text-align: left; padding: 9px 14px; border-radius: 6px; border: 0; font-weight: 800; color: #fff3d6; text-shadow: 0 1px 2px #3a2210;
  background: linear-gradient(180deg, #a77d55, #8a6444); box-shadow: inset 0 0 0 2px #6e4b2f, inset 0 2px 4px rgba(255,255,255,.15);
}
.pm-item:active { filter: brightness(1.12); transform: translateY(1px); }
.pm-close { position: absolute; right: -12px; top: -12px; width: 32px; height: 32px; border-radius: 7px; border: 2px solid #2b170a;
  background: linear-gradient(180deg, #7a4d22, #4a2a10); color: #fff; font-weight: 900; }
@media (max-height: 560px), (max-width: 900px) { .ppop.pmenu { top: 16%; gap: 4px; padding: 10px; } .pm-item { padding: 6px 12px; } }

/* =================== Thông tin người chơi khác =================== */
#win-pinfo .parch { width: min(720px, calc(100vw - 16px)); }
.pi-body { display: grid; grid-template-columns: 1fr 1.1fr; gap: 12px; min-height: 0; }
.pi-left { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.pi-left .name-scroll small { color: #8a6440; font-size: 11px !important; }
.pi-eq { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; width: 100%; }
.pi-slot { position: relative; aspect-ratio: 1; border-radius: 7px; background: #8a6444 center / 90% no-repeat; box-shadow: inset 0 0 0 2px #6e4b2f;
  display: grid; place-items: center; text-align: center; color: #e6cfa2; font-size: 9px !important; font-weight: 800; line-height: 1.05; padding: 2px; }
.pi-right .stat-list { height: 100%; align-content: space-evenly; }

.so-tips { margin: 10px 0 0; padding-left: 16px; display: flex; flex-direction: column; gap: 4px; font-weight: 700; color: #f5e6c8; }
.so-tips b { color: #ffe066; }
.so-auto { color: #fff3d6 !important; font-weight: 800; gap: 8px !important; }
.so-auto span { flex-basis: 26px !important; height: 26px !important; }

/* =================== Bảng Kỹ năng kiểu ảnh mẫu: [nhân vật + tên] [tiềm năng + kỹ năng] | [chi tiết] =================== */
#win-character .char-wrap.wide { grid-template-columns: minmax(0, .78fr) minmax(0, 1fr) minmax(0, 1.12fr) !important; gap: 0 !important; }
#win-character .char-wrap.wide > .equip { display: grid !important; grid-template-columns: 1fr !important; border-radius: 10px 0 0 10px; padding: 10px 6px 10px 10px; }
#win-character .char-wrap.wide > .equip .eq-col { display: none !important; }
#win-character .char-wrap.wide .skills-pane { display: contents !important; }
#win-character .char-wrap.wide .sk-left { border-radius: 0 10px 10px 0; box-shadow: inset 0 0 0 2px #8a6240, inset 0 2px 8px rgba(0,0,0,.25); clip-path: inset(0 0 0 2px); }
.sk-left { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.sk-left .sk-grid, .sk-left #pot-grid, .sk-left #skl-grid { grid-template-columns: repeat(3, minmax(0, 72px)) !important; gap: 8px !important; margin: 0 0 6px !important; justify-content: center; }
.sk-h { margin: 2px 0 4px !important; font-weight: 900; color: #fff3d6 !important; }
.sk-foot { margin: auto 0 0; padding-top: 6px; font-weight: 800; color: #fff3d6; text-shadow: 0 1px 2px #3a2210; }
.sk-foot b { color: #fff3d6; }

/* Chi tiết: nằm trên nền giấy, một màu chữ, nút ở góc dưới phải không đè viền */
#sk-detail.sk-right { background: none !important; box-shadow: none !important; border: 0 !important; border-image: none !important;
  padding: 4px 4px 2px 18px; display: flex; flex-direction: column; overflow: auto; color: #6b4320; }
#sk-detail * { color: #6b4320 !important; text-shadow: none !important; }
#sk-detail .sd-title { font-weight: 900; margin-bottom: 4px; }
#sk-detail .sd-desc, #sk-detail .sd-line, #sk-detail .sd-need, #sk-detail .sd-next-h { font-weight: 700; }
#sk-detail .sd-line.next, #sk-detail .sd-next-h { opacity: .62; }
#sk-detail .sd-sep { border-top: 2px dashed rgba(107,67,32,.45); margin: 7px 0; }
#sk-detail .grow { flex: 1 1 auto; min-height: 6px; }
#sk-detail .sd-actions { position: static !important; margin: 8px 0 0 !important; padding: 0 !important; background: none !important; justify-content: flex-end; }
#sk-detail .sd-actions .pbtn, #sk-detail .sd-actions .pbtn * { color: #fff3d6 !important; text-shadow: 0 1px 2px #000 !important; }
#sk-detail .sd-stepper button, #sk-detail .sd-stepper button * { color: #fff !important; }
#sk-detail .sd-key { margin-right: auto; opacity: .75; }

/* =================== Khung tên + thanh EXP (mặc định, chưa có ảnh): cuộn giấy + huy hiệu có cánh =================== */
.cw-scroll { position: relative; margin-bottom: 20px; padding: 6px 14% 14px !important; display: flex; flex-direction: column; align-items: center; }
.cw-scroll #cw-xptext { order: 1; font-size: 10px !important; color: #8a6440; }
.cw-scroll .xpline { order: 2; width: 100%; height: 7px; }
.cw-scroll .cw-lv { position: absolute; left: 50%; bottom: -18px; transform: translateX(-50%); margin: 0 !important; z-index: 2; }
.cw-scroll .cw-lv::before, .cw-scroll .cw-lv::after {
  content: ""; position: absolute; top: 9px; width: 22px; height: 12px; background: #c99a5b; z-index: -1; clip-path: polygon(0 50%, 100% 0, 100% 100%);
}
.cw-scroll .cw-lv::before { left: -18px; }
.cw-scroll .cw-lv::after { right: -18px; transform: scaleX(-1); }
.cw-scroll .cw-lv { box-shadow: 0 0 0 2px #e2a94e, 0 2px 4px rgba(0,0,0,.5); }

/* =================== Chỉ số nhân vật: giãn đều cả chiều cao ô =================== */
#win-character .cw-pane[data-pane="stats"] { display: flex; flex-direction: column; }
#win-character #char-stats { flex: 1 1 auto; align-content: space-evenly; grid-auto-rows: auto; gap: 0 14px !important; padding: 4px 10px; }
#win-character #char-stats dt, #win-character #char-stats dd { font-size: calc(var(--fs) + 1px) !important; line-height: 1.5; }
#win-character #char-stats .sep { margin: 2px 0; }
:root { --skc: 70px; }
@media (max-height: 560px), (max-width: 900px) { :root { --skc: clamp(30px, calc((100dvh - 150px) / 5.3), 56px); } }
.sk-left .sk-grid, .sk-left #pot-grid, .sk-left #skl-grid { grid-template-columns: repeat(3, var(--skc)) !important; grid-auto-rows: var(--skc); gap: 6px !important; }
.sk-left .sk-cell { width: var(--skc); height: var(--skc); aspect-ratio: auto; }
.sk-left { overflow: hidden !important; padding: 6px 8px !important; }
@media (max-height: 560px), (max-width: 900px) { .sk-left .sk-h { margin: 0 0 2px !important; } .sk-foot { padding-top: 2px; } }

/* Nút tên bản đồ trên cổng (như ảnh mẫu) */
.portal-btns { position: absolute; inset: 0; pointer-events: none !important; z-index: 4; }
.portal-btn {
  position: absolute; left: 0; top: 0; pointer-events: auto; display: flex; flex-direction: column; align-items: center; gap: 2px;
  border: 0; background: none; padding: 0; cursor: pointer;
}
.portal-btn i { font-style: normal; color: #fff; font-size: 16px !important; line-height: 1; text-shadow: 0 0 3px #000, 0 1px 2px #000; animation: pbBob 1.2s ease-in-out infinite; }
.portal-btn span {
  padding: 7px 16px; border-radius: 8px; background: rgba(30,40,40,.62); color: #fff; font-weight: 900; white-space: nowrap;
  text-shadow: 0 1px 2px #000; box-shadow: 0 2px 8px rgba(0,0,0,.35);
}
.portal-btn:active span { filter: brightness(1.2); transform: scale(.97); }
@keyframes pbBob { 50% { transform: translateY(4px); } }

/* Hành trang: không lật trang — lưới cuộn dọc, thấy khoảng 3 hàng */
#win-character .pager { display: none !important; }
#win-character .cw-pane[data-pane="bag"] .inv-grid { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; padding-right: 2px; }
#win-character .inv-slot[hidden] { display: none !important; }
#win-character .inv-slot { touch-action: pan-y; }

/* Rương đồ: cùng cỡ các bảng khác; hai lưới cuộn dọc */
#win-storage .parch { display: flex; flex-direction: column; }
#win-storage .stor-body { flex: 1 1 auto; min-height: 0; grid-template-rows: minmax(0, 1fr); }
#win-storage .stor-body > section { display: flex; flex-direction: column; min-height: 0; max-height: none !important; overflow: hidden !important; }
#win-storage .stor-grid { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; align-content: start;
  grid-template-columns: repeat(5, 1fr) !important; gap: 5px !important; padding-right: 2px; }
#win-storage .inv-slot { touch-action: pan-y; }
#win-storage .parch-hint { margin: 6px 0 0; font-size: 10.5px !important; }
@media (max-height: 560px), (max-width: 900px) { #win-storage .parch-hint { display: none; } #win-storage .parch-title { display: none; } }
@media (max-height: 560px), (max-width: 900px) { #win-storage .parch { margin-left: 0 !important; padding-top: 12px !important; } }

/* Hội thoại NPC: không viền, nền đen mờ dần lên phía trên */
.dialog { background: none !important; }
.dlg-band {
  border: 0 !important; box-shadow: none !important;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.45) 26%, rgba(0,0,0,.72) 100%) !important;
  padding-top: 34px !important;
}
.dlg-btn.ghost { filter: saturate(.75) brightness(.92); }
.portal-btn:not([hidden]) { animation: pbIn .25s ease-out; } @keyframes pbIn { from { opacity: 0; } }
.top-right .fs-btn {
  width: var(--tb) !important; flex: 0 0 auto; border-radius: 6px; border: 2px solid #4a2a10; color: #fff3d6; font-size: calc(var(--tb) * .6) !important; line-height: 1; padding: 0;
  background: linear-gradient(180deg, #a8743f, #7a4d22); box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 2px 4px rgba(0,0,0,.4); text-shadow: 0 1px 2px #000;
}

/* Nút hội thoại NPC: rộng vừa chữ, xếp sát mép phải; chữ nút "Tạm biệt" rõ, không mờ */
.dlg-options { min-width: 0 !important; align-items: flex-end; }
.dlg-btn { width: auto !important; min-width: 120px; max-width: min(340px, 42vw); padding-left: 22px !important; padding-right: 22px !important; white-space: nowrap; }
.dlg-btn.ghost { filter: none !important; opacity: .92; }

/* Bảng Kỹ năng: mọi nút cùng một kiểu, gọn một hàng, không xuống dòng / không tràn */
#sk-detail .sd-stepper { display: flex; flex-wrap: nowrap; gap: 4px; align-items: center; margin: 6px 0; }
#sk-detail .sd-stepper .pbtn { flex: 1 1 0; min-width: 0; height: 30px; padding: 0 4px !important; white-space: nowrap; font-size: 11px !important; }
#sk-detail .sd-stepper b { flex: 0 0 34px; text-align: center; font-size: 14px !important; }
#sk-detail .sd-actions { display: flex; flex-wrap: nowrap; gap: 6px; }
#sk-detail .sd-actions .pbtn { flex: 1 1 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 7px 8px !important; font-size: 11.5px !important; }
#sk-detail .sd-actions .sd-key { flex: 0 0 auto; }
#sk-detail .sd-actions .pbtn:only-child, #sk-detail .sd-actions .sd-key + .pbtn { flex: 0 0 auto; min-width: 110px; }
#sk-detail { overflow-x: hidden; }
/* Một màu cho mọi nút trong bảng chi tiết kỹ năng */

#sk-detail .pbtn:disabled { opacity: .5; }

/* =================== 6 nút kỹ năng quanh nút Đánh (2 vòng) =================== */
.touch-buttons .s0 { right: 116px; bottom: 4px; }
.touch-buttons .s1 { right: 100px; bottom: 92px; }
.touch-buttons .s2 { right: 14px; bottom: 116px; }
.touch-buttons .s3 { right: 200px; bottom: 0; }
.touch-buttons .s4 { right: 186px; bottom: 92px; }
.touch-buttons .s5 { right: 102px; bottom: 178px; }
.touch-buttons .t-aim, .touch-buttons .t-talk { right: 14px !important; bottom: 200px !important; width: 60px !important; height: 60px !important; }
/* Kỹ năng chưa học (chưa đủ cấp): mờ hẳn */
.sbtn.locked { opacity: .42; filter: grayscale(1) brightness(.75); }
.sbtn.locked em { background: none !important; font-size: 10px !important; text-shadow: 0 1px 2px #000; }
/* Kỹ năng: 7 ô (Đánh thường + 6) xếp 4 cột × 2 hàng */
.sk-left #skl-grid { grid-template-columns: repeat(4, var(--skc)) !important; }
@media (max-height: 560px), (max-width: 900px) { :root { --skc: clamp(28px, calc((100dvh - 160px) / 4.9), 50px); } }
/* Hai nút luôn nằm cố định dưới đáy phần chi tiết, nội dung dài thì cuộn bên trên */
#sk-detail { position: relative; }
#sk-detail .sd-actions { position: sticky !important; bottom: -2px !important; margin-top: 8px !important; padding: 6px 0 2px !important;
  background: none !important; z-index: 2; }
#sk-detail .sd-actions .pbtn { flex: 1 1 0 !important; min-width: 0 !important; }

/* 6 ô kỹ năng (Đánh thường + 5) xếp 3 × 2 */
.sk-left #skl-grid { grid-template-columns: repeat(3, var(--skc)) !important; }


/* =====================================================================
   MỘT CỠ CHO MỌI CỬA SỔ (không bao giờ phủ kín màn hình)
   ===================================================================== */
.parch-win .parch, .parch-win.small .parch {
  width: min(1060px, calc(100vw - 16px)) !important; height: min(640px, calc(100dvh - 16px)) !important;
  max-height: none !important; min-height: 0 !important; display: flex; flex-direction: column;
}
@media (max-height: 560px), (max-width: 900px) {
  .parch-win .parch, .parch-win.small .parch { width: min(680px, calc(100vw - 150px)) !important; height: calc(100dvh - 40px) !important; margin-left: 0; }
  .parch-win .parch:has(> .side-tabs) { margin-left: 92px !important; }
  .window { background: rgba(0,0,0,.28) !important; }
}
.parch-win .parch > .parch-scroll, .parch-win .parch > .help-body, .parch-win .parch > .shop-body, .parch-win .parch > .forge-body,
.parch-win .parch > .zone-grid, .parch-win .parch > .pi-body { flex: 1 1 auto; min-height: 0; overflow: auto; max-height: none !important; height: auto !important; }
#win-settings .parch { justify-content: flex-start; }
/* Bàn phím ảo mở: cửa sổ dồn lên trên để ô nhập không bị che */
.window.kb { align-items: start !important; place-items: start center !important; padding-top: 4px !important; }
.window.kb .parch { height: auto !important; max-height: calc(100dvh - 8px) !important; }

/* =====================================================================
   TRÒ CHUYỆN
   ===================================================================== */
.chat-panel {
  top: 48px !important; bottom: 10px !important; left: 10px !important; transform: none !important; height: auto !important;
  width: min(520px, 58vw) !important; display: flex; flex-direction: column; overflow: hidden;
  background: rgba(14,10,6,.86) !important; border: 1px solid rgba(232,183,101,.55) !important; border-radius: 12px !important;
  box-shadow: 0 10px 30px rgba(0,0,0,.55) !important;
}
.chat-panel .cp-head { order: 0 !important; display: flex; align-items: center; gap: 6px; padding: 7px 7px 7px 8px; border-bottom: 1px solid rgba(232,183,101,.2); }
.chat-panel .cp-tabs { flex: 1 1 auto; min-width: 0; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.chat-panel .cp-tabs::-webkit-scrollbar { display: none; }
.chat-panel .cp-tabs button { flex: 0 0 auto; height: 28px; padding: 0 12px !important; border-radius: 14px !important; font-weight: 800;
  background: rgba(255,255,255,.06) !important; border: 1px solid rgba(232,183,101,.35) !important; border-image: none !important; color: #e6cfa2 !important; filter: none !important; }
.chat-panel .cp-tabs button.on { background: #b07a43 !important; color: #fff !important; border-color: #e8b765 !important; }
.chat-panel .cp-close {
  flex: 0 0 30px !important; width: 30px !important; height: 30px !important; padding: 0 !important; border-radius: 50% !important;
  display: grid; place-items: center; font-size: 15px !important; line-height: 1; color: #fff !important;
  background: rgba(255,255,255,.1) !important; border: 1px solid rgba(255,255,255,.25) !important; border-image: none !important;
}
.chat-panel .chat-log { order: 1 !important; flex: 1 1 auto; min-height: 0; padding: 8px 12px; }
.chat-panel .cp-form { order: 2 !important; display: flex; gap: 6px; align-items: center; padding: 8px; border-top: 1px solid rgba(232,183,101,.2) !important; border-bottom: 0 !important; }
.chat-panel .cp-form select { flex: 0 0 auto; height: 34px; border-radius: 8px; padding: 0 6px; }
.chat-panel #chat-input { flex: 1 1 auto; height: 34px; border-radius: 8px; }
.chat-panel .cp-form .pbtn { flex: 0 0 auto; height: 34px; padding: 0 16px !important; }

/* Nút trò chuyện: chỉ biểu tượng, không khung nút */
.top-right .chat-btn {
  width: calc(var(--tb) * 1.25) !important; height: calc(var(--tb) * 1.25) !important; margin: -3px 0 !important;
  border: 0 !important; border-image: none !important; box-shadow: none !important; border-radius: 0 !important;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff8e6' stroke='%235a361b' stroke-width='1.4' d='M4 3.5h16a2.5 2.5 0 0 1 2.5 2.5v9a2.5 2.5 0 0 1-2.5 2.5H10.5L5 21.5v-4H4A2.5 2.5 0 0 1 1.5 15V6A2.5 2.5 0 0 1 4 3.5z'/%3E%3Ccircle cx='7.5' cy='10.5' r='1.5' fill='%235a361b'/%3E%3Ccircle cx='12' cy='10.5' r='1.5' fill='%235a361b'/%3E%3Ccircle cx='16.5' cy='10.5' r='1.5' fill='%235a361b'/%3E%3C/svg%3E") center / 88% no-repeat !important;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.55));
}
.top-right .chat-btn::before { display: none !important; }

/* Nút toàn màn hình: biểu tượng vẽ, căn giữa tuyệt đối */
.top-right .fs-btn { position: relative; font-size: 0 !important; }
.top-right .fs-btn::after {
  content: ""; position: absolute; inset: 22%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff3d6' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 9V3h6M21 9V3h-6M3 15v6h6M21 15v6h-6'/%3E%3C/svg%3E") center / contain no-repeat;
  filter: drop-shadow(0 1px 1px #000);
}

/* =====================================================================
   CỤM NÚT CHIẾN ĐẤU: 4 kỹ năng chính quanh nút Đánh, 2 nút phụ vòng ngoài,
   2 bình thuốc tách ra bên trái
   ===================================================================== */
:root { --tbs: 1; }
@media (max-height: 520px) { :root { --tbs: .82; } }
@media (max-height: 560px), (max-width: 900px) { :root { --tbs: .64; } }
.touch-buttons { transform: scale(var(--tbs)) !important; transform-origin: right bottom; right: 1.5% !important; bottom: calc(3% + 30px) !important; }
.touch-buttons .t-atk { right: 30px !important; bottom: 0 !important; }
.touch-buttons .sbtn { width: 64px !important; height: 64px !important; }
.touch-buttons .s0 { right: 162px !important; bottom: 20px !important; }
.touch-buttons .s1 { right: 138px !important; bottom: 89px !important; }
.touch-buttons .s2 { right: 77px !important; bottom: 129px !important; }
.touch-buttons .s3 { right: 4px !important; bottom: 122px !important; }
.touch-buttons .s4 { right: 228px !important; bottom: 85px !important; width: 56px !important; height: 56px !important; }
.touch-buttons .t-aim, .touch-buttons .t-talk { right: 145px !important; bottom: 186px !important; width: 54px !important; height: 54px !important; }
.quickslots.potion-row { right: calc(1.5% + 205px * var(--tbs) + 14px) !important; bottom: 6px !important; gap: 8px !important; }
.auto-btn { right: 8px !important; bottom: 4px !important; }

/* Bảng kỹ năng / tiềm năng: chữ hạ xuống tránh ô Vàng–Ngọc, cách nút cân đối */
#sk-detail { padding-top: 40px !important; padding-bottom: 6px !important; }
#sk-detail .sd-title { font-size: 15px !important; margin: 0 0 6px !important; }
#sk-detail .sd-desc { margin: 0 0 4px !important; line-height: 1.45; }
#sk-detail .sd-line { line-height: 1.5; }
#sk-detail .sd-line.dim { opacity: .7; font-size: 11.5px !important; }
#sk-detail .sd-gain { font-size: 18px !important; font-weight: 900 !important; color: #2f7a1f !important; margin: 2px 0 6px; }
#sk-detail .grow { min-height: 14px !important; }
#sk-detail .sd-actions { margin-top: 14px !important; padding-top: 10px !important; gap: 10px !important; }
@media (max-height: 560px), (max-width: 900px) {
  #sk-detail { padding-top: 34px !important; }
  #sk-detail .sd-title { font-size: 13.5px !important; }
  #sk-detail .sd-gain { font-size: 16px !important; }
}

/* Bấm tên / mục tiêu nhiệm vụ để tự đi tới */
#qp-title, #qp-goal { cursor: pointer; pointer-events: auto; }
#qp-goal { text-decoration: underline; text-decoration-color: rgba(255,255,255,.35); text-underline-offset: 3px; }
#qp-title:active, #qp-goal:active { filter: brightness(1.3); }
#sk-detail { display: flex !important; flex-direction: column !important; overflow: hidden !important; }
#sk-detail .sd-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; padding-right: 4px; scrollbar-width: thin; }
#sk-detail .sd-actions { position: static !important; flex: 0 0 auto; margin-top: 10px !important; padding: 10px 0 0 !important; border-top: 2px dashed rgba(107,67,32,.3); }
#sk-detail .sd-body .sd-key { margin-top: 6px; }
@media (max-height: 560px), (max-width: 900px) {
  #sk-detail .sd-desc, #sk-detail .sd-line, #sk-detail .sd-need, #sk-detail .sd-next-h { font-size: 11.5px !important; line-height: 1.4 !important; }
  #sk-detail .sd-sep { margin: 5px 0 !important; }
}

/* =====================================================================
   NHIỆM VỤ (Chính tuyến / Hàng ngày / Thành tựu) & HÒM THƯ
   ===================================================================== */
.mi-quest { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff3d6'%3E%3Cpath d='M6 2h9l5 5v13a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zm8 1.5V8h4.5zM7 11v2h10v-2zm0 4v2h7v-2z'/%3E%3C/svg%3E"); }
.mi-mail { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff3d6'%3E%3Cpath d='M3 5h18a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1zm1 2.2V17h16V7.2l-8 5.3z'/%3E%3C/svg%3E"); }
#menu-grid [data-menu] { position: relative; }
#menu-grid [data-menu] > .dot-badge { position: absolute; top: 0; right: 4px; margin: 0; }
.menu-burger { position: relative; }
.menu-burger .menu-dot { position: absolute; top: -4px; right: -4px; margin: 0; min-width: 12px; height: 12px; padding: 0; font-size: 0 !important; border: 2px solid #fff3d6; }

#win-quest .parch, #win-mail .parch { display: flex; flex-direction: column; }
.qw-body, .ml-body { flex: 1 1 auto; min-height: 0; }
.qw-body > section, .ml-body > section, .ml-body > form { min-height: 0; }

/* Dòng danh sách (nhiệm vụ / thư / thành tựu) */
.qw-row { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; padding: 9px 12px; border-radius: 8px; border: 0;
  background: #8a6444; box-shadow: inset 0 0 0 2px #6e4b2f; color: #fff3d6; text-shadow: 0 1px 2px #3a2210; cursor: pointer; font: inherit; }
.qw-row b { font-weight: 800; }
.qw-row small { font-weight: 800; }
.qw-row.sel, .qw-drow.sel, .ml-row.sel { background: #6e4b2f; box-shadow: inset 0 0 0 2px #4a2a10, 0 0 0 2px #e2a94e; }
.qw-row.locked { opacity: .75; }
.ok { color: #7dff6a !important; }
.prog { color: #ffe066 !important; }
.dim { color: #d9c7a5 !important; }

.qw-detail, .ml-detail { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; padding: 2px 6px 2px 4px; color: #6b4320; }
.qw-detail .grow, .ml-detail .grow, .qw-ach-detail .grow { flex: 1 1 auto; min-height: 10px; }
.qw-title { margin: 0 0 6px; font-size: 17px; font-weight: 900; color: #6b4320; }
.qw-desc { margin: 0 0 6px; line-height: 1.45; font-weight: 700; color: #7a5230; white-space: pre-line; }
.qw-desc.light { color: #fff3d6; text-shadow: 0 1px 2px #3a2210; }
.qw-goal { margin: 0 0 6px; font-weight: 900; color: #3f6f1c; }
.qw-sep { border-top: 2px dashed rgba(107,67,32,.45); margin: 8px 0; }
.qw-rw-h { text-align: center; font-weight: 900; color: #6b4320; margin: 6px 0; }
.qw-rw-h.light { color: #fff3d6; text-shadow: 0 1px 2px #3a2210; }
.qw-rw { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; }
.qw-rw.claimed { opacity: .5; }
.rw-cell { width: 58px; flex: 0 0 58px; cursor: default; }
.rw-exp { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-weight: 900; font-size: 15px !important; color: #9bf05a;
  text-shadow: 0 2px 0 #2d5a12, 0 0 3px #000; letter-spacing: .5px; }
.qw-actions { display: flex; justify-content: center; gap: 10px; margin-top: 10px; }
.qw-actions .pbtn { min-width: 130px; }
.qw-sub { text-align: center; font-weight: 800; font-size: 12px !important; color: #fff3d6; text-shadow: 0 1px 2px #3a2210; margin: 2px 0 6px; }
.qw-sub b { color: #ffe066; }

/* Chăm chỉ: thanh dọc 4 mốc */
.qw-daily { grid-template-columns: .82fr 1.25fr !important; }
.qw-dil { display: flex; flex-direction: column; }
.qw-ms { position: relative; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; justify-content: space-around; gap: 4px; --fill: 0%; }
.qw-ms::before { content: ''; position: absolute; left: calc(50% + 2px); top: 12%; bottom: 12%; width: 8px; border-radius: 4px; background: #5a3a1e; box-shadow: inset 0 1px 3px rgba(0,0,0,.5); }
.qw-ms::after { content: ''; position: absolute; left: calc(50% + 2px); top: 12%; width: 8px; height: calc(var(--fill) * .76); border-radius: 4px; background: linear-gradient(#ffe066, #e2a94e); }
.qw-msrow { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 58px 1fr; align-items: center; gap: 6px; }
.qw-msrow .qw-rw { justify-content: flex-end; flex-wrap: nowrap; }
.qw-msrow .rw-cell { width: 50px; flex-basis: 50px; }
.qw-dot { display: flex; align-items: center; gap: 4px; }
.qw-dot i { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #c9a57a, #6e4b2f); box-shadow: 0 0 0 2px #4a2a10; margin-left: 2px; }
.qw-msrow.reached .qw-dot i { background: radial-gradient(circle at 40% 35%, #fff3a0, #e2a94e); }
.qw-dot b { color: #fff3d6; text-shadow: 0 1px 2px #000; font-size: 12px !important; }
.qw-msrow .pbtn { justify-self: start; min-width: 72px; }
.pbtn.done { opacity: .6; }

.qw-drow { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: #8a6444; box-shadow: inset 0 0 0 2px #6e4b2f; color: #fff3d6; text-shadow: 0 1px 2px #3a2210; cursor: pointer; }
.qw-drow .so-info b { font-weight: 800; white-space: normal; }
.qw-drow .pbtn { flex: 0 0 auto; min-width: 84px; }
.qw-drow.claimed { opacity: .7; }
.qw-pool-h { text-align: center; font-weight: 800; font-size: 12px !important; color: #fff3d6; text-shadow: 0 1px 2px #3a2210; margin: 2px 0 4px; }
.qw-pool { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; padding-bottom: 2px; }
.qw-pool .rw-cell { width: 50px; flex-basis: 50px; }
.qw-ach-detail { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; }
.qw-achb { grid-template-columns: .85fr 1.25fr !important; }

/* Hòm thư */
.ml-body { grid-template-columns: 1.15fr 1fr !important; }
.ml-left { display: flex; flex-direction: column; min-height: 0; }
.ml-seg { margin-bottom: 8px; flex-wrap: nowrap; padding: 4px; border-radius: 10px; background: #a77d55; box-shadow: inset 0 0 0 2px #8a6240; justify-content: stretch; }
.ml-seg button { flex: 1 1 0; white-space: nowrap; }
.ml-list { gap: 5px; }
.ml-row { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 8px; background: #8a6444; box-shadow: inset 0 0 0 2px #6e4b2f; color: #fff3d6; text-shadow: 0 1px 2px #3a2210; cursor: pointer; }
.ml-row.unread { background: #9a7048; }
.ml-row.unread .so-info b::before { content: '● '; color: #ffcf3a; }
.ml-row input[type=checkbox], .ml-all input { width: 20px; height: 20px; flex: 0 0 20px; accent-color: #b07a43; margin: 0; }
.ml-ic { flex: 0 0 30px; height: 30px; border-radius: 6px; background: #6e4b2f center / 70% no-repeat;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff3d6'%3E%3Cpath d='M3 5h18a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1zm1 2.2V17h16V7.2l-8 5.3z'/%3E%3C/svg%3E"); }
.ml-ic.gift { background-color: #b0702a; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff3d6'%3E%3Cpath d='M20 7h-2.2A3 3 0 0 0 12 4.2 3 3 0 0 0 6.2 7H4a1 1 0 0 0-1 1v3h18V8a1 1 0 0 0-1-1zM9 7a1 1 0 1 1 1-1v1zm5 0V6a1 1 0 1 1 1 1zM4 13v7a1 1 0 0 0 1 1h6v-8zm9 0v8h6a1 1 0 0 0 1-1v-7z'/%3E%3C/svg%3E"); }
.ml-ic.sys { box-shadow: 0 0 0 2px #ffe066; }
.ml-tag { flex: 0 0 auto; font-size: 11px !important; font-weight: 900; color: #ffe066; }
.ml-tag.dim { color: #d9c7a5; }
.ml-note { margin: 6px 0 4px; font-size: 11.5px !important; font-weight: 800; color: #7a5230; }
.ml-foot { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.ml-foot .grow { flex: 1 1 auto; }
.ml-all { display: flex; align-items: center; gap: 7px; font-weight: 800; color: #7a5230; cursor: pointer; }
.ml-meta { font-weight: 800; font-size: 12px !important; color: #9a6a3a; }
.ml-text { flex: 0 0 auto; }
.ml-empty { margin: auto; color: #9a6a3a; font-weight: 800; }
.ml-detail { border-left: 2px dashed rgba(107,67,32,.35); padding-left: 12px; }
.ml-send { grid-template-columns: 1fr 1fr !important; }
.ml-form { display: flex; flex-direction: column; gap: 6px; min-height: 0; overflow-y: auto; padding-right: 2px; }
.ml-form label { display: flex; flex-direction: column; gap: 3px; font-weight: 800; font-size: 12.5px !important; color: #7a5230; }
.ml-form input, .ml-form textarea { width: 100%; box-sizing: border-box; padding: 7px 10px; border-radius: 6px; border: 0; background: #b08a63; box-shadow: inset 0 2px 4px rgba(0,0,0,.25);
  color: #fff8e8; font: inherit; font-weight: 700; outline: none; }
.ml-form input:focus, .ml-form textarea:focus { box-shadow: inset 0 2px 4px rgba(0,0,0,.25), 0 0 0 2px #e2a94e; }
.ml-form textarea { min-height: 64px; flex: 1 1 auto; resize: none; }
.ml-bodyl { flex: 1 1 auto; min-height: 0; }
.ml-att { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.ml-slot { cursor: pointer; }
.ml-fee { font-weight: 800; font-size: 12.5px !important; color: #7a5230; }
.ml-bag { display: flex; flex-direction: column; min-height: 0; }
.ml-bag .stor-grid { flex: 1 1 auto; min-height: 0; overflow-y: auto; grid-template-columns: repeat(5, 1fr) !important; align-content: start; overscroll-behavior: contain; touch-action: pan-y; }
.ml-bag .inv-slot.picked { box-shadow: inset 0 0 0 3px #9be38a, 0 0 0 2px #2f8a23; opacity: .55; }
.ml-bag .ml-foot span:first-child { font-weight: 800; color: #fff3d6; text-shadow: 0 1px 2px #3a2210; }

@media (max-height: 560px), (max-width: 900px) {
  .qw-row, .qw-drow, .ml-row { padding: 5px 8px; gap: 7px; }
  .qw-row b, .qw-drow b, .ml-row b { font-size: 12px !important; }
  .qw-row small, .qw-drow small, .ml-row small { font-size: 11px !important; }
  .qw-title { font-size: 14px; margin-bottom: 4px; }
  .qw-desc { font-size: 11.5px !important; margin-bottom: 4px; }
  .qw-goal { font-size: 12px !important; }
  .qw-sep { margin: 5px 0; }
  .rw-cell { width: 44px; flex-basis: 44px; }
  .qw-msrow .rw-cell, .qw-pool .rw-cell { width: 38px; flex-basis: 38px; }
  .qw-msrow { grid-template-columns: 1fr 46px 1fr; gap: 4px; }
  .qw-msrow .pbtn, .qw-drow .pbtn { min-width: 60px; padding: 4px 8px !important; font-size: 11px !important; }
  .qw-dot i { width: 16px; height: 16px; }
  .rw-exp { font-size: 11px !important; }
  .inv-slot.rw-cell .q { font-size: 10px !important; right: 2px; }
  .ml-ic { flex-basis: 24px; height: 24px; }
  .ml-row input[type=checkbox], .ml-all input { width: 17px; height: 17px; flex-basis: 17px; }
  .ml-form { gap: 4px; }
  .ml-form label { font-size: 11px !important; }
  .ml-form input, .ml-form textarea { padding: 5px 8px; font-size: 12px !important; }
  .ml-form textarea { min-height: 40px; }
  .ml-att { gap: 4px; }
  .ml-note { font-size: 10px !important; margin: 4px 0 2px; }
  .ml-foot { margin-top: 4px; gap: 6px; }
  .ml-foot .pbtn { padding: 5px 10px !important; font-size: 11.5px !important; }
  .ml-detail { padding-left: 8px; }
  .qw-actions .pbtn { min-width: 100px; }
}

/* Hội thoại NPC: các nút xếp MỘT hàng ngang ở dưới, sát mép phải */
.dlg-band { flex-direction: column !important; align-items: stretch !important; gap: 10px !important; }
.dlg-options { flex-direction: row !important; flex-wrap: nowrap !important; justify-content: flex-end !important; align-items: center !important; align-self: stretch !important;
  max-height: none !important; overflow-x: auto !important; overflow-y: hidden !important; gap: 10px !important; margin-top: auto; padding-bottom: 2px; scrollbar-width: none; }
.dlg-options::-webkit-scrollbar { display: none; }
.dlg-options .dlg-btn { flex: 0 0 auto; min-width: 110px; max-width: none; }
@media (max-height: 560px), (max-width: 900px) {
  .dlg-band { gap: 6px !important; }
  .dlg-options { gap: 6px !important; }
  .dlg-options .dlg-btn { min-width: 84px; padding-left: 14px !important; padding-right: 14px !important; }
}
/* Bảng chi tiết kỹ năng gọn như ảnh mẫu: vừa khung, không phải cuộn */
#sk-detail .sd-body { overflow-y: auto; }
#sk-detail .sd-actions { border-top: 0 !important; margin-top: 8px !important; padding-top: 0 !important; }
#sk-detail .sd-need { display: flex; flex-direction: column; gap: 1px; font-weight: 700; }
#sk-detail .sd-need .bad { color: #b3261e !important; }
#sk-detail .grow { min-height: 6px !important; }
#sk-detail .sd-desc, #sk-detail .sd-line, #sk-detail .sd-need, #sk-detail .sd-next-h { font-size: 13px !important; line-height: 1.38 !important; }
#sk-detail .sd-title { font-size: 15px !important; margin: 0 0 4px !important; }
#sk-detail .sd-sep { margin: 6px 0 !important; }
@media (max-height: 560px), (max-width: 900px) {
  #sk-detail { padding-top: 30px !important; }
  #sk-detail .sd-desc, #sk-detail .sd-line, #sk-detail .sd-need, #sk-detail .sd-next-h { font-size: 10.5px !important; line-height: 1.3 !important; }
  #sk-detail .sd-title { font-size: 12.5px !important; margin: 0 0 2px !important; }
  #sk-detail .sd-sep { margin: 3px 0 !important; border-top-width: 1.5px !important; }
  #sk-detail .sd-actions { margin-top: 5px !important; }
  #sk-detail .sd-actions .pbtn { padding: 5px 8px !important; font-size: 11px !important; }
}
/* Menu ☰: 6 mục xếp 3 cột × 2 hàng, chữ không chồng nhau */
.menu-grid { grid-template-columns: repeat(4, var(--mc, 70px)) !important; --mc: 70px; gap: 4px 2px !important; }
.menu-grid button { white-space: nowrap; }
@media (max-height: 560px), (max-width: 900px) { .menu-grid { --mc: clamp(54px, 8.4vw, 64px); } }

/* Cụm chiến đấu: Đánh thường + 3 kỹ năng tấn công (to, vòng trong) · 2 kỹ năng hỗ trợ (nhỏ, vòng ngoài) */
.touch-buttons .sbtn { width: 64px !important; height: 64px !important; }
.touch-buttons .s0 { right: 154px !important; bottom: 20px !important; }
.touch-buttons .s1 { right: 124px !important; bottom: 94px !important; }
.touch-buttons .s2 { right: 50px !important; bottom: 124px !important; }
.touch-buttons .s3 { right: 221px !important; bottom: 93px !important; width: 52px !important; height: 52px !important; }
.touch-buttons .s4 { right: 140px !important; bottom: 183px !important; width: 52px !important; height: 52px !important; }
.touch-buttons .s3 em, .touch-buttons .s4 em { font-size: 15px !important; }
.touch-buttons .s3 b, .touch-buttons .s4 b { font-size: 8px !important; bottom: 4px !important; }
.touch-buttons .t-aim, .touch-buttons .t-talk { right: 24px !important; bottom: 200px !important; width: 50px !important; height: 50px !important; }
.quickslots.potion-row { right: calc(1.5% + 240px * var(--tbs) + 8px) !important; }

/* Nút hội thoại NPC: chữ trắng viền tối, đọc rõ trên nền nút nâu */
.dlg-btn, .dlg-btn.ghost, .dlg-btn * { color: #fff8e6 !important; text-shadow: 0 1px 0 #3a2210, 0 0 3px rgba(0,0,0,.85), 0 2px 3px rgba(0,0,0,.6) !important; }

/* Điện thoại: cụm nút chiến đấu và thanh trên cùng to hơn */
@media (max-height: 560px), (max-width: 900px) { :root { --tbs: .76; } }
@media (max-height: 400px) { :root { --tbs: .72; } }
@media (max-height: 560px), (max-width: 900px) { :root { --tb: clamp(30px, 9.6vh, 38px); } }

/* 3 kỹ năng tấn công to hơn (dễ bấm trên điện thoại), vòng ngoài giãn ra theo */
.touch-buttons .s0, .touch-buttons .s1, .touch-buttons .s2 { width: 82px !important; height: 82px !important; }
.touch-buttons .s0 { right: 158px !important; bottom: 10px !important; }
.touch-buttons .s1 { right: 124px !important; bottom: 94px !important; }
.touch-buttons .s2 { right: 40px !important; bottom: 128px !important; }
.touch-buttons .s0 em, .touch-buttons .s1 em, .touch-buttons .s2 em { font-size: 22px !important; }
.touch-buttons .s0 b, .touch-buttons .s1 b, .touch-buttons .s2 b { font-size: 11px !important; bottom: 8px !important; }
.touch-buttons .s3 { right: 244px !important; bottom: 94px !important; width: 56px !important; height: 56px !important; }
.touch-buttons .s4 { right: 154px !important; bottom: 196px !important; width: 56px !important; height: 56px !important; }
.touch-buttons .t-aim, .touch-buttons .t-talk { right: 18px !important; bottom: 222px !important; }
.quickslots.potion-row { right: calc(1.5% + 248px * var(--tbs) + 8px) !important; }
/* Nút chọn mục tiêu (vòng xoáy) nằm giữa 2 kỹ năng hỗ trợ ở vòng ngoài */
.touch-buttons .s3 { right: 250px !important; bottom: 84px !important; }
.touch-buttons .s4 { right: 146px !important; bottom: 204px !important; }
.touch-buttons .t-aim, .touch-buttons .t-talk { right: 208px !important; bottom: 158px !important; width: 50px !important; height: 50px !important; }

/* Bàn phím thường đang mở: khung chat / khung đang gõ nằm gọn phía trên bàn phím */
body.kb-open .chat-panel { top: 4px !important; bottom: calc(var(--kbh, 0px) + 4px) !important; }
body.kb-open .window.kb .parch { max-height: calc(100dvh - var(--kbh, 0px) - 8px) !important; }
body.kb-open .touch-buttons, body.kb-open .joystick, body.kb-open .potion-row { visibility: hidden; }
/* Cỡ cụm nút chiến đấu do quản trị chỉnh (--tbk, mặc định 1) */
.touch-buttons { transform: scale(calc(var(--tbs) * var(--tbk, 1))) !important; }
.quickslots.potion-row { right: calc(1.5% + 248px * var(--tbs) * var(--tbk, 1) + 8px) !important; }

/* Thông báo giữa màn hình: dải nền đen mờ dần về hai bên (không viền, không bo tròn kiểu nút) */
.toast {
  border: 0 !important; border-radius: 0 !important; padding: 7px 70px !important; min-width: 300px; text-align: center; color: #fff4dc;
  background: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.78) 22%, rgba(0,0,0,.78) 78%, rgba(0,0,0,0) 100%) !important;
  box-shadow: none !important; text-shadow: 0 1px 2px #000 !important;
}
.toast.big { font-size: 24px !important; padding: 10px 110px !important; min-width: 420px; color: #ffe08a !important; letter-spacing: .5px; }
@media (max-height: 560px), (max-width: 900px) {
  .toast { padding: 5px 50px !important; min-width: 220px; }
  .toast.big { font-size: 18px !important; padding: 7px 80px !important; min-width: 300px; }
}

/* Mục tiêu nhiệm vụ: bấm được nhưng không gạch chân */
#qp-goal { text-decoration: none !important; }

/* Bản đồ nhỏ (góc trên phải, dưới thanh tên bản đồ) */
.minimap { position: absolute; z-index: 6; right: calc(10px + var(--sr, 0px)); top: calc(var(--tb, 36px) + 16px); width: 210px; height: 74px;
  border-radius: 8px; background: rgba(12,9,5,.55); box-shadow: inset 0 0 0 1.5px rgba(232,183,101,.55), 0 2px 6px rgba(0,0,0,.35); pointer-events: auto; cursor: pointer; overflow: hidden; }
.minimap canvas { width: 100%; height: 100%; display: block; }
.minimap.small { width: 108px; height: 40px; opacity: .85; }
.buffs { top: calc(var(--tb, 36px) + 98px) !important; }
@media (max-height: 560px), (max-width: 900px) {
  .minimap { width: 150px; height: 54px; top: calc(var(--tb, 30px) + 12px); }
  .minimap.small { width: 84px; height: 32px; }
  .buffs { top: calc(var(--tb, 30px) + 72px) !important; }
}
/* Ô kỹ năng đủ cấp nhưng chưa học: sáng nhẹ, nhấp nháy viền để người chơi biết bấm học */
.sk-cell.skill.learnable { filter: none !important; opacity: 1 !important; box-shadow: 0 0 0 2px #ffe066, 0 0 10px rgba(255,224,102,.7) !important; animation: learnPulse 1.4s ease-in-out infinite; }
.sk-cell.skill.learnable i { filter: grayscale(.6) brightness(.8); }
@keyframes learnPulse { 50% { box-shadow: 0 0 0 2px #ffe066, 0 0 18px rgba(255,224,102,.95) !important; } }

/* Nút chọn số lượng (−  +  +10): chữ luôn nằm giữa nút */
.stepper button { display: inline-flex !important; align-items: center !important; justify-content: center !important; padding: 0 !important; line-height: 1 !important; }
.ss-qty button[data-q="10"] { width: auto !important; min-width: 52px; padding: 0 10px !important; font-size: 15px !important; letter-spacing: -.3px; white-space: nowrap; }
@media (max-height: 560px), (max-width: 900px) { .ss-qty button[data-q="10"] { min-width: 42px; padding: 0 6px !important; font-size: 13px !important; } }
#shop-msg:empty { display: none; }

/* =================== Bảng thông tin vật phẩm (giống ảnh mẫu) =================== */
.item-pop.floating { width: min(420px, 94%) !important; bottom: 12px !important; padding: 14px 16px 12px !important; border-radius: 12px !important;
  background: linear-gradient(180deg, #f6e4bd, #ecd29f) !important; border: 2px solid #8d5a2b !important; box-shadow: 0 8px 24px rgba(0,0,0,.45), inset 0 0 0 2px rgba(255,248,226,.6) !important; }
.item-pop .ip-x { position: absolute; right: 10px; top: 10px; width: 34px; height: 34px; border-radius: 50%; border: 2px solid #4a2a10; padding: 0;
  background: radial-gradient(circle at 40% 35%, #c58a45, #7a4d22); color: #fff3d6; font-size: 16px; font-weight: 900; display: grid; place-items: center; box-shadow: 0 2px 4px rgba(0,0,0,.35); }
.item-pop .ip-head { display: flex; gap: 12px; align-items: center; padding-right: 40px; margin-bottom: 8px; }
.item-pop .ip-icon { flex: 0 0 74px; width: 74px; height: 74px; aspect-ratio: auto; cursor: default; }
.item-pop .ip-htext { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.item-pop .ip-htext b { font-size: 18px !important; font-weight: 900; color: #6b4320; line-height: 1.2; }
.item-pop .ip-htext small { color: #9a6a3a !important; font-weight: 700; font-size: 12px !important; }
.item-pop #ip-desc { margin: 0 0 6px !important; color: #6b4320 !important; font-weight: 700 !important; line-height: 1.4; font-size: 13.5px !important; }
.item-pop .ip-lines { color: #6b4320; font-weight: 800; font-size: 13.5px !important; line-height: 1.5; }
.item-pop .ip-lines .bad { color: #c0392b !important; }
.item-pop .ip-stats { margin: 2px 0 0 !important; grid-template-columns: 1fr !important; }
.item-pop .ip-stats li { color: #6b4320 !important; font-size: 13.5px !important; font-weight: 800 !important; }
.item-pop .ip-actions { justify-content: flex-end; gap: 8px !important; margin-top: 12px; }
.item-pop .ip-actions .pbtn { min-width: 96px; padding: 7px 14px !important; }
@media (max-height: 560px), (max-width: 900px) {
  .item-pop.floating { padding: 10px 12px 9px !important; bottom: 6px !important; }
  .item-pop .ip-icon { flex-basis: 56px; width: 56px; height: 56px; }
  .item-pop .ip-htext b { font-size: 15px !important; }
  .item-pop #ip-desc, .item-pop .ip-lines, .item-pop .ip-stats li { font-size: 11.5px !important; }
  .item-pop .ip-x { width: 28px; height: 28px; font-size: 13px; }
  .item-pop .ip-actions { margin-top: 8px; }
  .item-pop .ip-actions .pbtn { min-width: 76px; padding: 5px 10px !important; }
}

/* Hành trang trên máy tính: lưới đồ cuộn được bằng con lăn chuột / thanh cuộn (giống điện thoại) */
#win-character .cw-pane[data-pane="bag"]:not([hidden]) { display: flex; flex-direction: column; min-height: 0; }
#win-character .cw-pane[data-pane="bag"] .inv-grid { flex: 1 1 auto; min-height: 0; overflow-y: auto !important; align-content: start; scrollbar-width: thin; scrollbar-color: #8d5a2b transparent; }
#win-character .cw-pane[data-pane="bag"] .inv-grid::-webkit-scrollbar { width: 8px; }
#win-character .cw-pane[data-pane="bag"] .inv-grid::-webkit-scrollbar-thumb { background: #8d5a2b; border-radius: 4px; }
.death-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.death-btns small { display: block; font-size: 11px; opacity: .8; font-weight: 600; }
#btn-revive-here:disabled { opacity: .55; }

/* =================== Bản đồ thế giới / Bến đò =================== */
#win-worldmap .parch { width: min(1060px, calc(100vw - 16px)); height: min(640px, calc(100dvh - 16px)); min-height: 0; }
.wm-wrap { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 12px; }
.wm-stage { min-width: 0; min-height: 0; overflow: auto; border-radius: 14px; box-shadow: inset 0 0 0 2px #b98c5a, 0 2px 8px rgba(90,54,27,.25); background: #ecd5a8; }
.wm-svg { display: block; width: 100%; height: auto; }
.wm-node { cursor: pointer; transition: transform .15s; }
.wm-node:hover > rect:nth-of-type(2), .wm-node:focus > rect:nth-of-type(2) { filter: brightness(1.2); }
.wm-node.locked image { filter: grayscale(.8) brightness(.8); }
.wm-name { fill: #ffe9b0; font-weight: 900; font-size: 15px; }
.wm-lv { font-weight: 900; font-size: 11.5px; }
.wm-elite { fill: #6a3a00; font-weight: 900; font-size: 14px; }
.wm-lock { fill: #fff; font-weight: 900; font-size: 15px; paint-order: stroke; stroke: #000; stroke-width: 3px; }
.wm-chip { fill: #fff; font-weight: 800; font-size: 11.5px; }
.wm-hint { fill: #5a361b; font-weight: 900; font-size: 13px; }
.wm-n { fill: #8a5a2b; font-weight: 900; font-size: 12px; }
.wm-road.hot { animation: wmDash 1.2s linear infinite; }
.wm-flow { animation: wmDash 2.4s linear infinite; }
@keyframes wmDash { to { stroke-dashoffset: -32; } }
.wm-pin { animation: wmBob 1.2s ease-in-out infinite; }
@keyframes wmBob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -5px; } }
.wm-pulse { animation: wmPulse 1.6s ease-in-out infinite; }
@keyframes wmPulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.wm-info { min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 14px; background: rgba(255,248,230,.55); box-shadow: inset 0 0 0 2px #d4b07a; }
.wm-thumb { height: 116px; border-radius: 10px; background: #3a2410 center bottom / cover no-repeat; box-shadow: inset 0 0 0 3px #8a5a2b; flex: 0 0 auto; }
.wm-h { margin: 2px 0 0; font-size: 19px; color: #5a361b; }
.wm-meta { display: flex; flex-wrap: wrap; gap: 5px; }
.wm-meta span { font-size: 12px; padding: 3px 9px; border-radius: 10px; background: #5a361b; color: #ffe9b0; }
.wm-meta span.bad { background: #8a2a1a; }
.wm-meta span.ok { background: #2f6a1f; }
.wm-sub { font-size: 12px; color: #8a6440; text-transform: uppercase; letter-spacing: .04em; margin-top: 4px; }
.wm-mons { display: grid; gap: 4px; }
.wm-mon { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.wm-mon i { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 1.5px #5a361b; flex: 0 0 auto; }
.wm-mon small { color: #8a6440; }
.wm-mon.elite b { color: #b06a00; }
.wm-links { display: grid; gap: 3px; font-size: 13px; }
.wm-act { margin-top: auto; display: grid; gap: 6px; }
.wm-why { margin: 0; font-size: 12.5px; color: #8a4a2a; text-align: center; }
.map-pill { cursor: pointer; pointer-events: auto !important; }
.map-pill:hover { filter: brightness(1.12); }
@media (max-height: 560px), (max-width: 900px) {
  #win-worldmap { background: rgba(0,0,0,.28); }
  #win-worldmap .parch { width: min(780px, calc(100vw - 40px - var(--sl) - var(--sr))); height: calc(100dvh - 40px); padding: 30px 10px 10px !important; }
  .wm-wrap { grid-template-columns: minmax(0, 1fr) 210px; gap: 8px; }
  .wm-thumb { height: 74px; }
  .wm-h { font-size: 16px; }
  .wm-info { padding: 8px; gap: 5px; }
  .wm-mon { font-size: 12px; }
  .wm-links { font-size: 11.5px; }
}
.wm-stage { display: flex; }
.wm-svg { flex: 0 0 auto; align-self: flex-start; }
.wm-act { position: sticky; bottom: -10px; padding-top: 6px; background: linear-gradient(180deg, rgba(246,234,208,0), #f3e4c3 30%); }
@media (max-height: 560px), (max-width: 900px) { .wm-act { bottom: -8px; } .wm-act .pbtn.big { padding: 7px 10px; font-size: 13px; } }

/* Cường hóa: đồ bỏ thêm (đá tăng tỉ lệ, bùa bảo hộ) */
.fa-addons { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.fa-addons:empty { display: none; }
.fa-addon { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px 4px 4px; border-radius: 9px; border: 2px solid #b98c5a; background: rgba(255,248,230,.6); color: #5b3a1c; font: inherit; font-size: 12.5px; font-weight: 800; cursor: pointer; }
.fa-addon i { width: 26px; height: 26px; border-radius: 6px; background-size: contain; background-position: center; background-repeat: no-repeat; }
.fa-addon em { font-style: normal; color: #8a6440; font-size: 11px; }
.fa-addon.on { border-color: #2f8a23; background: #d8f0c4; box-shadow: 0 0 0 2px rgba(47,138,35,.25); }
.fa-addon:disabled { opacity: .45; cursor: default; }
.fa-rate .ok { color: #2f7a1f; }
@media (max-height: 560px), (max-width: 900px) { .fa-addon { font-size: 11px; padding: 2px 7px 2px 2px; } .fa-addon i { width: 20px; height: 20px; } }
.buff.x2 { border-color: #7fe36a; }
.buff.x2 span { font-size: 9px; white-space: nowrap; }
.rn-form { display: grid; gap: 8px; padding: 6px 4px; }
.rn-form label { font-size: 14px; }
.rn-form input { font: inherit; font-size: 18px; padding: 8px 12px; border-radius: 8px; border: 2px solid #b98c5a; background: #fff8e6; color: #3a2410; }
.rn-form .error { margin: 0; min-height: 18px; color: #b0301a; font-size: 13px; }
/* Thanh tích lũy may mắn cường hóa */
.fa-pity { position: relative; width: 320px; max-width: 100%; flex: 0 0 auto; align-self: center; display: block; height: 18px; margin: 4px auto 0; border-radius: 9px; background: rgba(0,0,0,.25); overflow: hidden; box-shadow: inset 0 0 0 1.5px rgba(90,54,27,.6); }
.fa-pity i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #ffe066, #f0a03a); }
.fa-pity b { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #7fd36a, #3f9a2f); }
.fa-pity em { position: absolute; inset: 0; font-style: normal; font-size: 10.5px; font-weight: 800; line-height: 18px; text-align: center; color: #fff; text-shadow: 0 1px 2px #000; white-space: nowrap; }
.fa-rate .dim { color: #8a6440; font-size: 12px; }
.fa-addon.charm { cursor: default; gap: 6px; }
.fa-addon.charm button { width: 24px; height: 24px; border-radius: 6px; border: 2px solid #8a5a2b; background: #f3e2bb; color: #5b3a1c; font: inherit; font-weight: 900; font-size: 15px; line-height: 1; cursor: pointer; padding: 0; }
.fa-addon.charm button:disabled { opacity: .4; cursor: default; }
/* Biểu tượng Cửa hàng (giỏ hàng) */
.mi-shop { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff3d6'%3E%3Cpath d='M3 3h2.2l.7 2H21l-2.2 8.2a1.5 1.5 0 0 1-1.45 1.1H8.6l.5 1.7H19v2H7.6L4.6 5H3zm6 17.5a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0zm7 0a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0z'/%3E%3C/svg%3E"); }
/* Cửa hàng: Mua/Bán + thẻ loại hàng cùng một hàng */
.shop-head { display: flex; justify-content: center; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.shop-head .shop-tabs { margin-bottom: 0; }
.shop-cats button { padding: 6px 12px; font-size: 13px; }
@media (max-height: 560px), (max-width: 900px) { .shop-head { gap: 8px; margin-bottom: 6px; } .shop-cats button { padding: 3px 9px; font-size: 11px; } }
.qw-chap { font-size: 12px; color: #8a6440; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
/* Bảng thông tin bản đồ (bản đồ thế giới) */
.wm-thumb { position: relative; }
.wm-here { position: absolute; left: 8px; top: 8px; padding: 2px 8px; border-radius: 9px; background: #e2483a; color: #fff; font-size: 11px; font-weight: 800; }
.wm-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wm-tag { flex: 0 0 auto; padding: 2px 10px; border-radius: 10px; background: #5a361b; color: #ffe9b0; font-size: 12px; font-weight: 900; }
.wm-tag.safe { background: #2f6a1f; }
.wm-desc { margin: 0; font-size: 13px; line-height: 1.45; color: #6b4a2b; font-weight: 600; }
.wm-stats { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin: 2px 0 0; padding: 8px 10px; border-radius: 10px; background: rgba(90,54,27,.08); font-size: 13px; }
.wm-stats dt { color: #8a6440; font-weight: 700; }
.wm-stats dd { margin: 0; color: #4a2c12; font-weight: 800; }
.wm-stats dd.bad { color: #b0301a; }
.wm-stats dd.gold { color: #a35f00; }
ul.wm-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
ul.wm-links li { display: grid; grid-template-columns: 18px 1fr; column-gap: 6px; align-items: center; padding: 5px 8px; border-radius: 8px; background: rgba(255,255,255,.35); }
ul.wm-links li i { grid-row: span 2; font-style: normal; font-size: 11px; color: #8a5a2b; text-align: center; }
ul.wm-links li span { font-weight: 800; font-size: 13px; color: #4a2c12; }
ul.wm-links li small { font-size: 11px; color: #8a6440; }
@media (max-height: 560px), (max-width: 900px) { .wm-desc { font-size: 11.5px; } .wm-stats { font-size: 11.5px; padding: 6px 8px; } ul.wm-links li { padding: 3px 6px; } }
/* Ô dùng nhanh 3 – 4 và trạng thái ô */
.potion-row .quickslot[data-kind="item"] { border-color: #e2a94e; }
.potion-row .quickslot[data-kind="none"] { border-color: rgba(226,169,78,.45); border-style: dashed; background: rgba(30,18,9,.45); }
.potion-row .quickslot.blank .qs-icon { background-image: none !important; }
.potion-row .quickslot.blank::after { content: '+'; position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255,233,176,.55); font-size: 20px; font-weight: 900; }
/* Bảng ghim trong khung vật phẩm */
.ip-pins { margin-top: 8px; padding: 8px; border-radius: 10px; background: rgba(0,0,0,.22); }
.ip-pins-h { font-size: 12px; font-weight: 800; color: #ffe9b0; margin-bottom: 6px; text-align: center; }
.ip-pins-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ip-pin { position: relative; display: grid; justify-items: center; gap: 2px; padding: 6px 2px 5px; border-radius: 10px; border: 2px solid #8a5a2b; background: rgba(30,18,9,.75); color: #fff3d6; font: inherit; cursor: pointer; }
.ip-pin:hover { border-color: #e2a94e; }
.ip-pin.on { border-color: #7fd36a; background: rgba(40,80,30,.75); }
.ip-pin i { width: 34px; height: 34px; border-radius: 50%; background: rgba(0,0,0,.35) center / 70% no-repeat; box-shadow: inset 0 0 0 2px rgba(226,169,78,.5); }
.ip-pin b { position: absolute; left: 6px; top: 3px; font-size: 11px; color: #ffe066; }
.ip-pin small { font-size: 10px; line-height: 1.2; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 3px; }
/* Bảng nhiệm vụ: chữ rõ như bảng Kỹ năng (một màu chữ nâu, không đổ bóng) */
#qw-main-detail { padding: 4px 6px 2px 18px; color: #6b4320; }
#qw-main-detail * { text-shadow: none !important; }
#qw-main-detail .qw-chap { color: #9a6a3a !important; font-weight: 800; }
#qw-main-detail .qw-title { margin: 2px 0 4px; color: #7a3f12; font-weight: 900; }
#qw-main-detail .qw-desc { color: #5b3a1c; font-weight: 700; line-height: 1.5; }
#qw-main-detail .qw-line { color: #6b4320; font-weight: 700; line-height: 1.6; }
#qw-main-detail .qw-line .k { color: #8a6440; }
#qw-main-detail .qw-line.goal .v { color: #2f6a1f; font-weight: 900; }
#qw-main-detail .qw-line.bad .v { color: #b0301a; }
#qw-main-detail .qw-hint { margin: 0; color: #7a5230; font-weight: 700; line-height: 1.5; opacity: .85; }
#qw-main-detail .qw-sep { border-top: 2px dashed rgba(107,67,32,.45); margin: 7px 0; }
#qw-main-detail .qw-rw-h { color: #6b4320; font-weight: 900; }
.qw-row { text-shadow: none; }
.qw-row b { color: #fff3d6; }
.shop-row.poor .price { color: #ff9a8a !important; }
/* =================== Ngoại trang =================== */
.outfit-pane { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.of-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.of-head .so-h { margin: 0; }
.of-note { font-size: 12px !important; color: #d9c7a5; font-weight: 700; }
.of-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; overflow: auto; min-height: 0; flex: 1 1 auto; align-content: start; }
.of-card { --rc: #9a9a9a; display: grid; justify-items: center; gap: 3px; padding: 10px 6px 8px; border-radius: 10px; border: 2px solid rgba(255,255,255,.08); background: #8a6444; box-shadow: inset 0 0 0 2px #6e4b2f; color: #fff3d6; font: inherit; cursor: pointer; text-shadow: none; }
.of-card i { width: 64px; height: 64px; border-radius: 12px; display: grid; place-items: center; font-style: normal; font-size: 26px; color: #d9c7a5;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--rc) 45%, #2a1a0c), #2a1a0c) center / cover; box-shadow: inset 0 0 0 2px var(--rc); background-size: contain; background-repeat: no-repeat; }
.of-card b { font-size: 13px !important; text-align: center; line-height: 1.25; }
.of-card small { font-size: 11px !important; color: #d9c7a5; }
.of-card.sel { background: #6e4b2f; box-shadow: inset 0 0 0 2px #4a2a10, 0 0 0 2px #e2a94e; }
.of-card.wearing small { color: #7dff6a; font-weight: 800; }
.of-card.locked { opacity: .55; }
.of-card.locked i { filter: grayscale(.8); }
.of-foot { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: rgba(0,0,0,.18); }
.of-info { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
.of-info b { color: #fff3d6; }
.of-info p { margin: 0; color: #e8d6b4; font-weight: 600; font-size: 12.5px !important; line-height: 1.4; }
.of-info small { color: #ffe066; font-size: 12px !important; }
.of-foot .pbtn { flex: 0 0 auto; min-width: 120px; }
@media (max-height: 560px), (max-width: 900px) { .of-grid { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; } .of-card i { width: 44px; height: 44px; } .of-foot { padding: 6px 8px; } }
/* =================== Danh hiệu =================== */
.qw-titleb { grid-template-columns: .9fr 1.2fr !important; }
.ti-row { justify-content: space-between; }
.ti-row.locked .ti-pill { filter: grayscale(.85) brightness(.85); }
.ti-pill { --tc: #ffe066; display: inline-block; padding: 1px 4px; font: italic 900 14px/1.25 "Segoe UI Black", "Arial Black", system-ui, sans-serif; letter-spacing: .2px; white-space: nowrap;
  background: linear-gradient(180deg, #fffbe6 0%, var(--tc) 48%, color-mix(in srgb, var(--tc) 62%, #000) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none !important;
  filter: drop-shadow(0 1px 0 #1e1006) drop-shadow(0 0 1px #1e1006) drop-shadow(0 0 1px #1e1006) drop-shadow(0 0 5px color-mix(in srgb, var(--tc) 55%, transparent)); }
.ti-pill.big { font-size: 22px !important; padding: 2px 8px; }
.ti-preview { display: grid; place-items: center; min-height: 64px; margin: 6px 0 8px; border-radius: 10px; background: radial-gradient(ellipse at center, rgba(90,54,27,.25), rgba(90,54,27,.05)); }
.ti-preview img { max-width: 80%; max-height: 64px; object-fit: contain; }
#qw-title-detail { padding: 4px 6px 2px 18px; color: #6b4320; }
#qw-title-detail * { text-shadow: none !important; }
#qw-title-detail .qw-chap { color: #9a6a3a !important; font-weight: 800; }
#qw-title-detail .qw-title { margin: 2px 0 2px; color: #7a3f12; font-weight: 900; }
#qw-title-detail .qw-desc { color: #5b3a1c; font-weight: 700; }
#qw-title-detail .qw-line { color: #6b4320; font-weight: 700; line-height: 1.6; }
#qw-title-detail .qw-line .k { color: #8a6440; }
#qw-title-detail .qw-line.goal .v { color: #2f6a1f; font-weight: 900; }
#qw-title-detail .qw-sep { border-top: 2px dashed rgba(107,67,32,.45); margin: 7px 0; }
/* Viền 4 ô dùng nhanh: mảnh, gọn */
.potion-row .quickslot { border-width: 1.5px !important; }
.potion-row .quickslot[data-kind="none"] { border-width: 1.5px !important; }
/* =================== Viền sáng trang bị cường hóa =================== */
@property --ga { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
[data-glow] { position: relative; }
[data-glow] > .eglow {
  --gc: #bfe6ff; --gw: 1.5px; --gs: 0px; --gt: 3.2s;
  position: absolute; inset: calc(var(--gw) * -1); border-radius: inherit; padding: var(--gw); pointer-events: none; z-index: 2;
  background: conic-gradient(from var(--ga), transparent 0deg, transparent 220deg, color-mix(in srgb, var(--gc) 35%, transparent) 270deg, var(--gc) 330deg, #fff 350deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: eglowSpin var(--gt) linear infinite;
  filter: drop-shadow(0 0 var(--gs) var(--gc));
}
/* +1 ~ +3: vệt sáng trắng xanh mảnh, quay chậm */
[data-glow="1"] > .eglow { --gc: #bfe6ff; --gw: 1.5px; --gs: 2px; --gt: 3.6s; }
/* +4 ~ +6: xanh ngọc, rõ hơn */
[data-glow="2"] > .eglow { --gc: #5cf2c8; --gw: 2px; --gs: 4px; --gt: 2.8s; }
/* +7 ~ +8: tím, hai vệt sáng */
[data-glow="3"] > .eglow { --gc: #c78bff; --gw: 2.5px; --gs: 6px; --gt: 2.2s;
  background: conic-gradient(from var(--ga), transparent 0deg 120deg, var(--gc) 165deg, #fff 178deg, transparent 180deg 300deg, var(--gc) 345deg, #fff 358deg, transparent 360deg); }
/* +9 ~ +10: vàng đỏ rực, hai vệt sáng + quầng sáng nhấp nháy */
[data-glow="4"] > .eglow { --gc: #ffcf3a; --gw: 3px; --gs: 9px; --gt: 1.6s;
  background: conic-gradient(from var(--ga), #ff6a2a 0deg, transparent 60deg 120deg, #ffcf3a 160deg, #fff 178deg, #ff6a2a 182deg, transparent 240deg 300deg, #ffcf3a 340deg, #fff 358deg, #ff6a2a 360deg);
  animation: eglowSpin var(--gt) linear infinite, eglowPulse 1.2s ease-in-out infinite; }
[data-glow="3"], [data-glow="4"] { box-shadow: 0 0 10px color-mix(in srgb, #c78bff 45%, transparent); }
[data-glow="4"] { box-shadow: 0 0 14px rgba(255,190,60,.55) !important; }
@keyframes eglowSpin { to { --ga: 360deg; } }
@keyframes eglowPulse { 0%, 100% { opacity: 1; } 50% { opacity: .65; } }
.eq[data-glow] { overflow: visible; }

/* ---------------- Chợ ---------------- */
.mi-market { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff3d6'%3E%3Cpath d='M4 3h16l2 5.5a2.6 2.6 0 0 1-4.6 1.7 2.7 2.7 0 0 1-4.4 0 2.7 2.7 0 0 1-4.4 0A2.6 2.6 0 0 1 2 8.5zM4 12.2a4 4 0 0 0 1 .3V21h5v-5h4v5h5v-8.5a4 4 0 0 0 1-.3V22a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1z'/%3E%3C/svg%3E"); }
.mk-head { flex-direction: column; gap: 8px; }
.mk-filter { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.mk-search, .mk-sel { height: 32px; border-radius: 7px; border: 2px solid #6e4b2f; background: #f3e2c2; color: #4a2a10; font-weight: 700; padding: 0 8px; font-size: 13px; }
.mk-search { width: 150px; }
.mk-search[hidden], .mk-sel[hidden] { display: none; }
#mk-mine-n { font-size: 11px; opacity: .85; margin-left: 2px; }
.mk-name { text-align: center; font-size: 16px; }
.mk-type { text-align: center; color: #ffe2a8; font-size: 12px; }
.mk-desc { margin: 2px 0; font-size: 12px; font-weight: 600; color: #f5e6c8; }
.mk-sellform { display: flex; flex-direction: column; gap: 6px; }
.mk-sellform[hidden] { display: none; }
.mk-curseg { justify-content: center; gap: 4px; flex-wrap: nowrap; }
.mk-curseg button { flex: 1; padding: 5px 4px; font-size: 12px; }
.mk-price { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: #ffe2a8; }
.mk-price input { height: 34px; border-radius: 7px; border: 2px solid #4a2a10; background: #fff4dc; color: #4a2a10; font-size: 16px; font-weight: 800; text-align: right; padding: 0 10px; }
.mk-fees, .mk-info { display: flex; flex-direction: column; gap: 3px; }
.mk-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; padding: 3px 6px; border-radius: 6px; background: rgba(40,20,6,.28); }
.mk-line b { display: flex; align-items: center; gap: 3px; color: #fff; }
.mk-line.em b { color: #b8f59c; }
.mk-line.bad b { color: #ff8a7a; }
#mk-act { margin-top: auto; }
@media (max-height: 560px), (max-width: 900px) {
  .mk-head { gap: 5px; }
  .mk-search, .mk-sel { height: 26px; font-size: 11px; padding: 0 5px; }
  .mk-search { width: 110px; }
  .mk-side .mk-desc, .mk-side .mk-type { display: none; }
  .mk-name { font-size: 14px; }
  .mk-line { font-size: 11px; padding: 2px 5px; }
  .mk-price input { height: 28px; font-size: 14px; }
  .mk-curseg button { font-size: 11px; padding: 3px; }
}
.mk-compact .mk-side .ss-icon { width: 54px; height: 54px; }
.mk-compact .mk-side .ip-stats { display: none; }
.mk-desc[hidden] { display: none; }
@media (max-height: 560px), (max-width: 900px) {
  .mk-compact .mk-side .ss-icon, .mk-compact .mk-side .mk-type { display: none; }
  .mk-sellform { gap: 4px; }
}

/* Cường hóa gọn: tên + mũi tên một dòng, chi phí chỉ biểu tượng, thanh tỉ lệ có chữ bên trong */
.fa-title { display: flex; align-items: baseline; justify-content: center; gap: 10px; flex-wrap: wrap; }
.fa-title span { display: inline; font-size: 16px; }
.fa-cost { gap: 8px; }
.fa-cost span { font-weight: 800; }
.fa-addon b { min-width: 14px; text-align: center; }
.fa-addon.charm em, .fa-addon em { font-size: 11px; }
.fa-pity { height: 22px; width: 300px; }
.fa-pity em { line-height: 22px; font-size: 12.5px; }
.fa-rate { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.fa-rate .warn { font-size: 11.5px; }
@media (max-height: 560px), (max-width: 900px) { .fa-pity { height: 18px; width: 240px; } .fa-pity em { line-height: 18px; font-size: 11px; } .fa-title span { font-size: 14px; margin-left: 0; } }
/* Logo chữ: LÂN HỒNG / TRUYỀN KỲ */
.logo-kicker { display: flex; align-items: center; justify-content: center; gap: 10px; margin: -2px 0 6px; font-size: 17px; font-weight: 800; letter-spacing: .5em; padding-left: .5em; color: #f6dca4; text-shadow: 0 1px 0 var(--bronze-dk); }
.logo-kicker::before, .logo-kicker::after { content: ""; width: 34px; height: 1.5px; background: linear-gradient(90deg, transparent, var(--bronze-hi)); }
.logo-kicker::after { transform: scaleX(-1); }
.mk-bidform { display: flex; flex-direction: column; gap: 5px; }
.mk-bidform[hidden] { display: none; }
.mk-quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.mk-quick .pbtn.sm { padding: 4px 2px; font-size: 11px; min-height: 0; }
.mk-line.lead b { color: #ffe066; }
.shop-row.lead { box-shadow: inset 0 0 0 2px #7fd36a; }
.mk-lead { font-style: normal; margin-left: 6px; padding: 0 6px; border-radius: 6px; background: #2f8a23; color: #fff; font-size: 10.5px; font-weight: 900; line-height: 16px; }
#mk-bids-n { font-size: 11px; opacity: .85; margin-left: 2px; }
@media (max-height: 560px), (max-width: 900px) { .mk-quick .pbtn.sm { font-size: 10px; padding: 3px 1px; } .shop-tabs#mk-tabs button { padding: 4px 9px; } }
@media (max-height: 560px), (max-width: 900px) {
  .mk-filter { flex-wrap: nowrap; gap: 4px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .mk-filter .shop-cats { flex-wrap: nowrap; gap: 3px; }
  .mk-filter .shop-cats button { padding: 3px 6px; white-space: nowrap; }
  .mk-search { width: 92px; flex: 0 0 auto; }
  .mk-sel { flex: 0 0 auto; max-width: 104px; }
}
/* Cài đặt: thẻ Chung / Nhập mã quà */
.set-tabs { justify-content: center; margin-bottom: 12px; }
.set-pane[hidden] { display: none; }
.code-form { display: flex; flex-direction: column; gap: 10px; padding: 4px 6px; }
.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; min-width: 0; height: 42px; border-radius: 8px; border: 2px solid #8a5a2b; background: #fff8e6; color: #3a2410; font: inherit; font-size: 18px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 0 12px; }
.code-row .pbtn { flex: 0 0 auto; }
.code-msg { margin: 0; min-height: 20px; text-align: center; font-weight: 800; }
.code-msg.ok { color: #2f7a1f; }
.code-msg.bad { color: #b0301a; }
@media (max-height: 560px), (max-width: 900px) { .set-tabs { margin-bottom: 6px; } .code-row input { height: 36px; font-size: 15px; } }

/* ---------------- Thông báo chạy chữ & sự kiện ---------------- */
.mi-welfare { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff3d6'%3E%3Cpath d='M20 7h-2.2A3 3 0 0 0 12 3.9 3 3 0 0 0 6.2 7H4a1 1 0 0 0-1 1v3a1 1 0 0 0 1 1h7V7h2v5h7a1 1 0 0 0 1-1V8a1 1 0 0 0-1-1zM9 7a1 1 0 1 1 1-1v1zm5 0V6a1 1 0 1 1 1 1zM4 13v7a1 1 0 0 0 1 1h6v-8zm9 8h6a1 1 0 0 0 1-1v-7h-7z'/%3E%3C/svg%3E"); }
.mi-rank { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff3d6'%3E%3Cpath d='M9 10h6v11H9zM2 14h6v7H2zm14 3h6v4h-6zM12 2l1.5 3 3.3.5-2.4 2.3.6 3.2L12 9.5 9 11l.6-3.2-2.4-2.3 3.3-.5z'/%3E%3C/svg%3E"); }
.ann-bar { position: absolute; top: 62px; left: 50%; transform: translateX(-50%); width: min(520px, 44vw); height: 30px; z-index: 6; display: flex; align-items: center; gap: 6px; padding: 0 10px; border-radius: 15px; background: linear-gradient(90deg, rgba(60,24,6,.92), rgba(110,48,12,.92), rgba(60,24,6,.92)); border: 1.5px solid #e8b765; box-shadow: 0 2px 10px rgba(0,0,0,.4), 0 0 12px rgba(255,190,90,.35); pointer-events: none; }
.ann-bar[hidden] { display: none; }
.ann-ico { flex: 0 0 auto; font-size: 15px; }
.ann-track { position: relative; flex: 1; height: 100%; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.ann-track span { position: absolute; top: 50%; left: 0; white-space: nowrap; transform: translate(var(--ann-from, 100%), -50%); color: #fff3c4; font-weight: 800; font-size: 14px; text-shadow: 0 1px 2px #000; }
@keyframes annRun { from { transform: translate(var(--ann-from), -50%); } to { transform: translate(var(--ann-to), -50%); } }
.ev-chip { position: absolute; top: 98px; left: 50%; transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 14px; background: linear-gradient(180deg, rgba(42,92,24,.92), rgba(24,58,12,.92)); border: 1.5px solid #9fe36a; color: #fff; font-size: 12.5px; box-shadow: 0 0 12px rgba(160,255,110,.35); pointer-events: none; animation: evGlow 2.4s ease-in-out infinite; }
.ev-chip[hidden] { display: none; }
.ev-chip b { color: #ffe066; }
.ev-chip em { font-style: normal; font-variant-numeric: tabular-nums; color: #d8ffc4; }
@keyframes evGlow { 50% { box-shadow: 0 0 20px rgba(160,255,110,.6); } }
@media (max-height: 560px), (max-width: 900px) {
  .ann-bar { top: 48px; height: 24px; width: min(400px, 42vw); }
  .ann-track span { font-size: 12px; }
  .ev-chip { top: 76px; font-size: 11px; padding: 2px 9px; gap: 5px; }
}

/* ---------------- Phúc lợi ---------------- */
#win-welfare .shop-tabs, #win-rank .shop-tabs { justify-content: center; margin-bottom: 10px; }
#wf-tabs button, #rk-tabs button { position: relative; }
.wf-pane[hidden] { display: none; }
.wf-pane { flex: 1; min-height: 0; overflow: auto; }
.wf-hint { text-align: center; margin: 0 0 10px; color: #6b4524; font-weight: 700; font-size: 13px; }
.wf-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.wf-day { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border-radius: 12px; background: linear-gradient(180deg, #b98654, #8a5a2b); border: 2px solid #5a361b; color: #fff3d6; text-shadow: 0 1px 2px #000; min-height: 150px; }
.wf-day.today { background: linear-gradient(180deg, #e7b25a, #b5741c); border-color: #fff0b8; box-shadow: 0 0 0 2px #ffe066, 0 0 16px rgba(255,220,100,.6); animation: evGlow 2s ease-in-out infinite; }
.wf-day.got { opacity: .6; filter: saturate(.6); }
.wf-day.big { background: linear-gradient(180deg, #9b5ad1, #5c2b8a); }
.wf-day.big.today { background: linear-gradient(180deg, #c48aff, #7a3fc0); }
.wf-dn { font-size: 14px; }
.wf-cells { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; flex: 1; align-content: flex-start; }
.wf-cells .rw-cell { width: 44px; height: 44px; }
.wf-st { font-size: 12px; font-weight: 800; color: #ffe2a8; }
.wf-st.ok { color: #b8f59c; }
.wf-levels { display: flex; flex-direction: column; gap: 8px; }
.wf-lv { display: grid; grid-template-columns: 80px 1fr auto; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: linear-gradient(180deg, #b98654, #8a5a2b); border: 2px solid #5a361b; color: #fff3d6; text-shadow: 0 1px 2px #000; }
.wf-lv.ready { border-color: #ffe066; box-shadow: 0 0 0 2px rgba(255,224,102,.5); }
.wf-lv.got { opacity: .6; }
.wf-lv .wf-cells { justify-content: flex-start; }
.wf-lvn { font-size: 16px; }
@media (max-height: 560px), (max-width: 900px) {
  .wf-days { gap: 4px; }
  .wf-day { min-height: 0; padding: 6px 3px; gap: 4px; }
  .wf-dn { font-size: 12px; }
  .wf-cells .rw-cell { width: 34px; height: 34px; }
  .wf-lv { grid-template-columns: 60px 1fr auto; padding: 5px 8px; }
  .wf-lvn { font-size: 13px; }
}

/* ---------------- Xếp hạng ---------------- */
.rk-row { display: grid; grid-template-columns: 44px 1.6fr 1fr 1fr 1.2fr; gap: 8px; align-items: center; padding: 7px 12px; border-radius: 9px; }
.rk-head { color: #6b4524; font-weight: 800; font-size: 12px; padding-bottom: 4px; }
.rk-list { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.rk-list .rk-row { background: linear-gradient(180deg, #b98654, #8a5a2b); color: #fff3d6; text-shadow: 0 1px 2px #000; border: 1.5px solid #5a361b; font-size: 13.5px; }
.rk-list .rk-row.top1 { background: linear-gradient(180deg, #f2c14e, #b5741c); }
.rk-list .rk-row.top2 { background: linear-gradient(180deg, #d6d6d6, #8c8c8c); }
.rk-list .rk-row.top3 { background: linear-gradient(180deg, #d9925a, #8a4f22); }
.rk-list .rk-row.me { box-shadow: 0 0 0 2px #7fe36a; }
.rk-n { font-weight: 900; text-align: center; font-size: 15px; }
.rk-v { font-weight: 900; color: #fff7c2; font-variant-numeric: tabular-nums; }
.rk-row span, .rk-row b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-me { margin-top: 8px; text-align: center; font-weight: 800; color: #5a361b; }
.rk-me small { font-weight: 600; color: #8a6440; }
#win-rank .parch, #win-welfare .parch { display: flex; flex-direction: column; }
@media (max-height: 560px), (max-width: 900px) { .rk-row { padding: 4px 8px; font-size: 12px !important; grid-template-columns: 34px 1.5fr 1fr 1fr 1fr; } }
/* Bộ lạc: phụ đề, thẻ, chức danh */
.gl-sub { text-align: center; margin: -4px 0 10px; color: #f3dfb7; font-size: 12.5px; font-weight: 600; }
.gl-row.mine { box-shadow: inset 0 0 0 2px #ffe066; }
.gl-tag { font-size: 11.5px; font-weight: 800; color: #ffe066; white-space: nowrap; }
.gl-tag.dim { color: transparent; }
.gl-sel { height: 28px; border-radius: 6px; border: 1.5px solid #4a2a10; background: #f3e2c2; color: #4a2a10; font-weight: 700; font-size: 12px; padding: 0 4px; }
.gl-ranks { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.gl-rk { padding: 3px 10px; border-radius: 10px; background: rgba(0,0,0,.28); font-weight: 800; font-size: 12.5px; }
.gl-icon { font-size: 18px; }

/* ---------------- Phúc lợi (bản mới: hàng ngang thống nhất) ---------------- */
.wf-hint { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 10px; padding: 8px 12px; border-radius: 10px; background: rgba(90,54,27,.1); border: 1px solid rgba(90,54,27,.25); color: #4a2a10; text-align: left; }
.wf-hint b { color: #5b2f12; font-size: 14px; }
.wf-hint span { font-size: 12.5px; font-weight: 600; color: #6b4524; flex: 1 1 200px; }
.wf-prog { flex: 1 1 100%; height: 6px; border-radius: 3px; background: rgba(90,54,27,.2); overflow: hidden; }
.wf-prog i { display: block; height: 100%; background: linear-gradient(90deg, #7fd36a, #3f9a2f); }
.wf-list { display: flex; flex-direction: column; gap: 6px; }
.wf-row { display: grid; grid-template-columns: 110px 1fr 130px; align-items: center; gap: 12px; padding: 7px 12px; border-radius: 10px; background: linear-gradient(180deg, #a87a4c, #845a32); border: 1.5px solid #5a361b; color: #fff3d6; text-shadow: 0 1px 2px #000; }
.wf-row.ready { background: linear-gradient(180deg, #c2914f, #99652a); border-color: #ffe066; box-shadow: 0 0 0 2px rgba(255,224,102,.45), 0 0 14px rgba(255,214,90,.35); }
.wf-row.got { opacity: .62; }
.wf-row.big:not(.got) { background: linear-gradient(180deg, #8d5cb8, #5c3488); }
.wf-lab { display: flex; flex-direction: column; gap: 1px; }
.wf-lab b { font-size: 15px; }
.wf-lab small { font-size: 11.5px; font-weight: 700; color: #ffe2a8; }
.wf-row.ready .wf-lab small { color: #b8f59c; }
.wf-row .wf-cells { justify-content: flex-start; flex-wrap: wrap; gap: 5px; }
.wf-row .wf-cells .rw-cell { width: 42px; height: 42px; }
.wf-act { display: flex; justify-content: flex-end; }
.wf-act .pbtn { min-width: 110px; }
.wf-st { font-size: 12.5px; font-weight: 800; color: #ffe2a8; }
.wf-st.got { color: #b8f59c; }
.wf-pane { padding-right: 4px; }
@media (max-height: 560px), (max-width: 900px) {
  .wf-row { grid-template-columns: 76px 1fr 96px; gap: 6px; padding: 4px 8px; }
  .wf-lab b { font-size: 13px; }
  .wf-row .wf-cells .rw-cell { width: 34px; height: 34px; }
  .wf-act .pbtn { min-width: 0; padding: 5px 8px; font-size: 12px; }
  .wf-hint { padding: 5px 8px; margin-bottom: 6px; gap: 6px; }
}
.rk-n.img { height: 30px; background-size: contain; background-repeat: no-repeat; background-position: center; }
/* Chợ: hướng dẫn từng thẻ + nhãn trạng thái */
.mk-guide { margin: 0; text-align: center; font-size: 12.5px; font-weight: 600; color: #5b3a1c; max-width: 760px; line-height: 1.35; }
.shop-list .shop-empty, .parch-scroll > .shop-empty { color: #6b4524; text-shadow: none; }
.mk-chip { position: absolute; right: 8px; top: 6px; font-style: normal; font-size: 10.5px; font-weight: 900; padding: 1px 7px; border-radius: 8px; background: rgba(0,0,0,.35); color: #ffe2a8; }
.mk-chip.lead { background: #2f8a23; color: #fff; }
.mk-chip.wait { background: #6b4a8a; color: #fff; }
.mk-chip.ok { background: rgba(0,0,0,.35); color: #b8f59c; }
@media (max-height: 560px), (max-width: 900px) { .mk-guide { font-size: 11px; } }
/* Độ tương phản: chữ trên nền nâu luôn sáng, có bóng chữ */
.pl.top { color: #ffa8f2; }
.of-note { color: #fff3d6 !important; text-shadow: 0 1px 2px #000; }
.of-side p, .cw-pane[data-pane="outfit"] p { color: #fff3d6; text-shadow: 0 1px 2px #000; }

/* =================== Kiểu chữ thống nhất (theo mẫu mô tả kỹ năng) ===================
   Nền sáng (giấy): chữ nâu đậm, không bóng.  Nền tối (ô gỗ): chữ kem sáng, bóng nhẹ.
   Tiêu đề 900 · nội dung 700 · dòng phụ 700 mờ · ngăn cách bằng nét đứt. */
.qw-detail, .ml-detail, .qw-ach-detail, .gl-about, .wf-hint, .mk-guide { color: #6b4320; }
.qw-detail *, .ml-detail *, .qw-ach-detail *, .gl-about *, .wf-hint *, .mk-guide { text-shadow: none; }
.qw-title { font-weight: 900 !important; color: #6b4320 !important; margin: 0 0 4px !important; }
.qw-desc { font-weight: 700 !important; color: #6b4320 !important; line-height: 1.5; }
.ml-meta { font-weight: 700 !important; color: #6b4320 !important; opacity: .62; }
.qw-sep { border-top: 2px dashed rgba(107,67,32,.45) !important; margin: 7px 0 !important; }
.qw-rw-h, .ml-note, .ml-all, .ml-fee, .ml-form label { color: #6b4320 !important; text-shadow: none !important; }
.ml-empty, .shop-empty { color: #6b4320 !important; opacity: .75; text-shadow: none !important; }
/* Trên nền tối luôn dùng chữ sáng */
.qw-row, .qw-drow, .ml-row { color: #fff3d6; }
.qw-row .so-info small, .ml-row .so-info small, .gl-row small { color: #ffe2a8; }
.qw-desc.light, .qw-rw-h.light { color: #fff3d6 !important; text-shadow: 0 1px 2px #3a2210 !important; }
/* Bảng xếp hạng: top 1–3 nền sáng → chữ tối; huy chương to rõ */
.rk-list .rk-row.top1, .rk-list .rk-row.top2 { color: #3a2210; text-shadow: none; }
.rk-list .rk-row.top1 .rk-v, .rk-list .rk-row.top2 .rk-v { color: #3a2210; }
.rk-list .rk-row.top1 { background: linear-gradient(180deg, #ffe08a, #e0a83a); border-color: #9a6a1c; }
.rk-list .rk-row.top2 { background: linear-gradient(180deg, #f0f0f0, #b8b8b8); border-color: #7a7a7a; }
.parch .rk-list .rk-n { font-size: 22px !important; line-height: 1; }
.parch .rk-list .rk-n.img { height: 32px; }
/* Xem người chơi khác: chỉ hình nhân vật + trang bị (cùng cỡ khung với các cửa sổ khác) */
#win-pinfo .parch { width: min(1060px, calc(100vw - 16px)); height: min(640px, calc(100dvh - 16px)); min-height: 0 !important; }
@media (max-height: 560px), (max-width: 900px) { #win-pinfo .parch { width: min(680px, calc(100vw - 150px)); height: calc(100dvh - 40px); max-height: none; } }
#win-pinfo .pi-wrap { grid-template-columns: minmax(0, 1fr) !important; justify-items: center; flex: 1 1 auto; min-height: 0; }
#win-pinfo .pi-wrap > .equip { width: min(560px, 100%); min-height: 0; }
#win-pinfo .eq { cursor: default; }
#win-pinfo .eq.has { cursor: pointer; }
#win-pinfo .name-scroll small { color: #7a5230; }
/* Hội thoại NPC nhiều lựa chọn: nút tự xuống thêm hàng (hàng trên), không bị che / phải cuộn ngang.
   Nút "Tạm biệt" luôn ở cuối, góc dưới bên phải. */
.dlg-options { flex-wrap: wrap !important; overflow: visible !important; align-content: flex-end; row-gap: 8px !important; }
.dlg-options .dlg-btn { max-width: min(360px, 44vw) !important; overflow: hidden; text-overflow: ellipsis; }
@media (max-height: 560px), (max-width: 900px) { .dlg-options { row-gap: 5px !important; } .dlg-options .dlg-btn { min-height: 32px; } }
/* Tin nổi bật của Hệ thống trên kênh chat */
.chat-log .cl-hi { color: #ffe27a; font-weight: 800; background: rgba(255, 200, 60, .12); border-radius: 4px; padding: 1px 4px; }
.ip-rar { font-weight: 800; }
/* Dải chat trên thanh trên cùng (khung đỏ): 2 dòng mới nhất, bấm để mở khung chat đầy đủ */
.top-right .chat-mini {
  flex: 0 1 auto; width: clamp(150px, 30vw, 460px); height: 40px; margin-right: -4px; padding: 3px 10px; border: 0; border-radius: 8px 0 0 8px;
  background: linear-gradient(90deg, rgba(12,8,4,.15), rgba(12,8,4,.55) 18%, rgba(12,8,4,.6)); box-shadow: inset 0 0 0 1px rgba(232,183,101,.28);
  display: flex; flex-direction: column; justify-content: center; gap: 1px; text-align: left; cursor: pointer; overflow: hidden; font: inherit;
}
.chat-mini .cm-line { color: #fff3d6; font-size: 12px !important; font-weight: 700; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px #000; }
.chat-mini .cm-line .who { color: #ffe08a; }
.chat-mini .cm-line .tag { color: #9fe0ff; }
.chat-mini .cm-line.cl-sys, .chat-mini .cm-line.cl-hi { color: #ffe27a; background: none; padding: 0; }
.chat-mini .cm-empty { color: rgba(255,243,214,.6); font-size: 12px !important; font-weight: 700; }
@media (max-height: 560px), (max-width: 900px) { .top-right .chat-mini { height: 32px; width: clamp(120px, 26vw, 300px); } .chat-mini .cm-line { font-size: 10.5px !important; } }
/* Hàng hiệu ứng (buff) dưới thanh máu */
.buffs { z-index: 7; }
.buffs .buff { width: var(--bz, 30px); height: var(--bz, 30px); }
.buffs { gap: 8px !important; }
.buffs .buff span, .buffs .buff.x2 span { left: 50%; right: auto; bottom: auto; top: calc(100% + 1px); transform: translateX(-50%); font-size: 10px !important; line-height: 1; white-space: nowrap; color: #fff3d6; }
/* Phím tắt trên máy tính: chữ cái nhỏ sát mép trên phải của từng nút (ẩn trên màn cảm ứng) */
body:not(.touch-mode) .tbtn kbd, body:not(.touch-mode) .sbtn kbd {
  position: absolute; left: auto; right: -3px; top: -3px; bottom: auto; transform: none; z-index: 3; opacity: 1;
  min-width: 18px; height: 18px; padding: 0 4px; box-sizing: border-box; display: grid; place-items: center;
  border-radius: 5px; border: 1.5px solid #e2a94e; background: linear-gradient(180deg, #3a2412, #1e1208);
  color: #ffe9a8; font: 900 11px/1 var(--font) !important; letter-spacing: 0; text-shadow: none; box-shadow: 0 1px 3px rgba(0,0,0,.6);
}
body:not(.touch-mode) .t-atk kbd { right: 6px; top: 4px; min-width: 22px; height: 22px; font-size: 13px !important; }
body:not(.touch-mode) .potion-row .quickslot kbd { left: auto; right: -3px; top: -3px; transform: none; }
/* ===== Trò chuyện (bản 1.1.2) ===== */
/* Dải chat trên cùng = nơi xem mọi tin liên tục, bấm vào để mở khung chat (không còn nút chat riêng) */
.top-right .chat-mini { flex-direction: column; justify-content: flex-start; height: 40px; padding: 4px 10px; overflow-y: auto; scrollbar-width: none;
  border-radius: 8px !important; margin-right: 6px; background: rgba(10,7,4,.55) !important; box-shadow: inset 0 0 0 1px rgba(232,183,101,.35) !important; }
.top-right .chat-mini::-webkit-scrollbar { display: none; }
.chat-mini .cm-line { flex: 0 0 auto; }
.top-right .chat-btn[hidden] { display: none !important; }
@media (max-height: 560px), (max-width: 900px) { .top-right .chat-mini { height: 32px; padding: 2px 8px; } }
/* Khung chat đầy đủ — máy tính: gọn ở góc dưới trái; cảm ứng: ở giữa phía trên, không che nhân vật & thanh máu */
body:not(.touch-mode) .chat-panel {
  top: auto !important; bottom: 16px !important; left: calc(12px + var(--sl, 0px)) !important; transform: none !important;
  width: min(440px, 36vw) !important; height: min(300px, 46vh) !important;
}
body.touch-mode .chat-panel {
  top: 48px !important; bottom: auto !important; left: 50% !important; transform: translateX(-50%) !important;
  width: min(480px, 50vw) !important; height: min(260px, 44vh) !important;
}
body.touch-mode.kb-open .chat-panel { top: 4px !important; height: calc(100dvh - var(--kbh, 0px) - 8px) !important; max-height: 60vh; }
/* Thông báo chạy chữ: dải nền đen mờ, viền mảnh, không biểu tượng */
.ann-bar { gap: 0 !important; padding: 0 14px !important; border-radius: 8px !important; width: min(620px, 50vw) !important; height: 30px;
  background: rgba(8,6,4,.62) !important; border: 1px solid rgba(232,183,101,.45) !important;
  box-shadow: 0 4px 14px rgba(0,0,0,.35) !important; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.ann-track span { color: #fff1c9 !important; font-weight: 700 !important; letter-spacing: .2px; }
@media (max-height: 560px), (max-width: 900px) { .ann-bar { height: 24px; width: min(460px, 52vw) !important; } }
/* Viền ô theo độ hiếm: Thường không viền; Hiếm xanh · Sử thi tím · Huyền thoại vàng (sáng nhẹ) */
.rar { outline: 2px solid var(--rc) !important; outline-offset: -2px; }
.rar[data-rar="2"], .rar[data-rar="3"] { outline-width: 2.5px !important; }
.rar[data-rar="3"] { animation: rarGlow 2.2s ease-in-out infinite; }
@keyframes rarGlow { 50% { outline-color: #fff2a8; } }
/* Bảng mất kết nối / bảo trì */
.net-pop { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(0,0,0,.55); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.net-pop[hidden] { display: none; }
.np-card { width: min(420px, calc(100vw - 32px)); padding: 22px 24px 18px; border-radius: 14px; text-align: center; color: #fff3d6;
  background: linear-gradient(180deg, rgba(40,26,14,.97), rgba(22,14,8,.97)); border: 1px solid rgba(232,183,101,.6); box-shadow: 0 18px 50px rgba(0,0,0,.6); }
.np-ico { width: 54px; height: 54px; margin: 0 auto 10px; display: grid; place-items: center; }
.np-spin { width: 40px; height: 40px; border-radius: 50%; border: 4px solid rgba(232,183,101,.25); border-top-color: #e8b765; animation: npSpin 1s linear infinite; }
.net-pop.down .np-spin { border-top-color: #ffb35a; }
@keyframes npSpin { to { transform: rotate(360deg); } }
.np-card h3 { margin: 0 0 6px; font-size: 19px; font-weight: 900; color: #ffe08a; }
.np-card p { margin: 0 0 8px; font-size: 14px; line-height: 1.5; font-weight: 600; color: #f3e3c3; }
.np-card small { display: block; margin-bottom: 14px; color: #c9b38c; font-size: 12.5px; font-weight: 700; }
.np-acts { display: flex; gap: 10px; justify-content: center; }
.np-acts .pbtn { min-width: 130px; }
/* =====================================================================
   MÁY TÍNH (chuột + bàn phím): thanh kỹ năng nằm ngang giữa đáy màn hình, mỗi ô có phím tắt
   [Tab] [Q] [E] [R] [F] [G] [X]   ·   bình thuốc 1–4 + Tự động ở góc phải dưới
   ===================================================================== */
body:not(.touch-mode) .touch-buttons {
  position: fixed !important; left: 50% !important; right: auto !important; top: auto !important; bottom: 12px !important;
  transform: translateX(-50%) !important; width: auto !important; height: auto !important;
  display: flex !important; align-items: flex-end; gap: 10px; padding: 8px 12px 8px; border-radius: 16px;
  background: rgba(10,7,4,.42); box-shadow: inset 0 0 0 1px rgba(232,183,101,.28); pointer-events: auto; z-index: 6;
}
body:not(.touch-mode) .touch-buttons > .tbtn, body:not(.touch-mode) .touch-buttons > .sbtn {
  position: relative !important; left: auto !important; right: auto !important; top: auto !important; bottom: auto !important;
  width: 54px !important; height: 54px !important; flex: 0 0 auto; overflow: visible !important; transform: none;
}
body:not(.touch-mode) .touch-buttons > .sbtn i { border-radius: 50%; overflow: hidden; }
body:not(.touch-mode) .touch-buttons > .sbtn em { border-radius: 50%; }
body:not(.touch-mode) .touch-buttons > .t-atk { width: 68px !important; height: 68px !important; order: 9; font-size: 15px; }
body:not(.touch-mode) .touch-buttons > .t-aim { order: -1; width: 46px !important; height: 46px !important; }
body:not(.touch-mode) .touch-buttons > .t-aim[hidden] { display: none !important; }
body:not(.touch-mode) .touch-buttons > .t-aim svg { width: 70%; height: 70%; margin: 15%; }
body:not(.touch-mode) .touch-buttons > .sbtn.locked { opacity: .5; }
body:not(.touch-mode) .touch-buttons > .t-atk kbd { right: -3px !important; top: -3px !important; }
body:not(.touch-mode) .quickslots.potion-row {
  position: fixed !important; right: calc(16px + 64px) !important; left: auto !important; bottom: 14px !important; top: auto !important; gap: 8px !important;
}
body:not(.touch-mode) .potion-row .quickslot { width: 48px !important; height: 48px !important; }
body:not(.touch-mode) .auto-btn { position: fixed !important; right: 16px !important; bottom: 14px !important; width: 50px !important; height: 50px !important; }
.top-right .chat-mini[hidden] { display: none !important; }

/* 1.1.2 — thẻ bên dính liền mép cửa sổ (không còn khe hở chữ/khung) */
.parch-win .parch .side-tabs, #win-character .parch .side-tabs, #win-guild .parch .side-tabs, #win-social .parch .side-tabs, #win-quest .parch .side-tabs, #win-mail .parch .side-tabs, #win-arena .parch .side-tabs, #win-life .parch .side-tabs {
  left: 10px !important; transform: translateX(-100%) !important; z-index: 4; flex-direction: column !important;
}
.parch-win .parch .side-tabs button { position: relative; box-shadow: -3px 2px 5px rgba(0,0,0,.4); }
.parch-win .parch .side-tabs button.active { padding-right: 18px; margin-right: -6px; }
/* 1.1.2 — cuộn giấy tên ở "Thông tin nhân vật" cùng cỡ với cửa sổ Nhân vật */
#win-pinfo .eq-center { display: flex; flex-direction: column; align-items: center; min-height: 0; }
#win-pinfo .cw-scroll { width: min(100%, 230px) !important; flex: 0 0 auto; }
#win-pinfo .cw-stage { flex: 1 1 auto; width: 100%; min-height: 120px; }
@media (max-height: 560px), (max-width: 900px) { #win-pinfo .cw-scroll { width: min(100%, 170px) !important; } }
/* 1.1.2 — iPad / màn hình vừa: chừa chỗ cho thẻ bên để không bị cắt khỏi mép trái */
@media (min-width: 901px) and (max-width: 1300px) and (min-height: 561px) {
  .parch-win .parch:has(> .side-tabs) { width: min(1060px, calc(100vw - 130px)) !important; margin-left: 110px !important; }
}

/* 1.1.3 — Bảng gục ngã */
.death-modal { background: radial-gradient(ellipse at center, rgba(60,0,0,.35), rgba(0,0,0,.72)) !important; z-index: 40; animation: dmIn .35s ease-out; }
@keyframes dmIn { from { opacity: 0; } to { opacity: 1; } }
.death-card { width: min(440px, calc(100vw - 32px)); padding: 22px 22px 18px; text-align: center; border-radius: 14px;
  background: linear-gradient(180deg, rgba(34,20,12,.97), rgba(20,12,7,.97)); border: 1.5px solid rgba(232,183,101,.55);
  box-shadow: 0 0 0 4px rgba(0,0,0,.35), 0 18px 48px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,230,180,.12); animation: dcIn .4s cubic-bezier(.2,1.3,.4,1); }
@keyframes dcIn { from { transform: scale(.88) translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.dc-skull { width: 52px; height: 52px; margin: -48px auto 6px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; color: #ffd9cc;
  background: radial-gradient(circle at 35% 30%, #c0392b, #5c1010); border: 2px solid #e8b765; box-shadow: 0 4px 12px rgba(0,0,0,.5); }
.death-card h2 { margin: 0 0 4px; font-size: 22px; letter-spacing: .5px; color: #ff9f8f; text-shadow: 0 2px 6px rgba(0,0,0,.6); }
.dc-text { margin: 0 0 16px; color: #e9d6b5; font-size: 14px; }
.death-btns { display: grid !important; grid-template-columns: 1fr 1fr; gap: 12px; }
.dbtn { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 11px; cursor: pointer; text-align: left; color: #fff;
  border: 1.5px solid rgba(255,255,255,.18); box-shadow: 0 4px 0 rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.25); transition: transform .08s, filter .15s; font: inherit; }
.dbtn:hover:not(:disabled) { filter: brightness(1.12); }
.dbtn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,.35); }
.dbtn-ico { flex: 0 0 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 19px; background: rgba(0,0,0,.25); }
.dbtn-txt { display: flex; flex-direction: column; min-width: 0; }
.dbtn-txt b { font-size: 15px; line-height: 1.2; }
.dbtn-txt small { font-size: 11px; opacity: .85; font-weight: 600; margin-top: 2px; line-height: 1.25; }
.dbtn-here { background: linear-gradient(180deg, #e0a93a, #a8661a); }
.dbtn-home { background: linear-gradient(180deg, #3f9a4c, #24692f); }
.dbtn:disabled { background: linear-gradient(180deg, #5b4a3a, #3d3026); color: #c9b8a0; cursor: not-allowed; box-shadow: none; }
.dbtn:disabled .dbtn-ico { opacity: .5; }
@media (max-height: 430px) { .death-card { padding: 16px 16px 14px; } .dc-skull { width: 42px; height: 42px; margin-top: -38px; font-size: 21px; } .dc-text { margin-bottom: 10px; } }

/* 1.1.3 — bản đồ nhỏ trên điện thoại to hơn, dễ nhìn */
@media (max-height: 560px), (max-width: 900px) {
  .minimap { width: clamp(180px, 25vw, 240px) !important; height: clamp(60px, 17vh, 78px) !important; }
  .minimap.small { width: 112px !important; height: 40px !important; }
  .buffs { top: calc(var(--tb, 30px) + 26px + clamp(60px, 17vh, 78px)) !important; }
}

/* 1.1.3 — ảnh đại diện nhân vật trong Tổ đội / Bạn bè / Đơn xin vào bộ lạc */
canvas.so-av-img { width: 40px; height: 40px; padding: 0; background: #2a1a0e; object-fit: cover; }
@media (max-height: 560px), (max-width: 900px) { canvas.so-av-img { width: 30px; height: 30px; } }

/* 1.1.3 — Bảng Tổ đội cạnh Nhiệm vụ */
.qpt-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 6px; padding-bottom: 4px; border-bottom: 1px solid rgba(232,183,101,.25); }
.qpt-head b { color: #ffe3a3; font-size: 12px; letter-spacing: .5px; text-transform: uppercase; }
.qpt-count { font-size: 11px; font-weight: 800; color: #1a1006; background: linear-gradient(180deg, #ffd27a, #d99a35); padding: 1px 8px; border-radius: 10px; }
.qpt-m { display: flex; gap: 8px; align-items: center; padding: 5px 6px; margin-bottom: 4px; border-radius: 8px;
  background: linear-gradient(90deg, rgba(255,255,255,.07), rgba(255,255,255,.02)); border: 1px solid rgba(232,183,101,.18); }
.qpt-m.me { border-color: rgba(120,200,255,.45); }
.qpt-m.leader { background: linear-gradient(90deg, rgba(255,210,110,.16), rgba(255,255,255,.02)); }
.qpt-m.away { opacity: .82; }
.qpt-m.dead { filter: grayscale(.8); }
.qpt-av { position: relative; flex: 0 0 38px; height: 38px; }
.qpt-av canvas { width: 38px; height: 38px; border-radius: 50%; display: block; background: #2a1a0e; box-shadow: 0 0 0 2px #e8b765, 0 2px 4px rgba(0,0,0,.5); }
.qpt-lv { position: absolute; right: -4px; bottom: -3px; min-width: 18px; height: 16px; padding: 0 3px; border-radius: 8px; font-size: 10px; font-weight: 900; line-height: 16px; text-align: center;
  color: #fff; background: #5a2f12; box-shadow: 0 0 0 1.5px #e8b765; }
.qpt-crown { position: absolute; left: -5px; top: -7px; font-size: 14px; color: #ffd84a; text-shadow: 0 1px 2px #000; }
.qpt-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.qpt-top { display: flex; align-items: center; gap: 4px; }
.qpt-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff; font-size: 12.5px; }
.qpt-m.leader .qpt-name { color: #ffe066; }
.qpt-kick { border: 0; background: rgba(255,90,70,.18); color: #ff9a8a; font-weight: 900; font-size: 10px; width: 18px; height: 18px; border-radius: 50%; padding: 0; cursor: pointer; }
.qpt-bar { display: block; height: 5px; border-radius: 3px; background: #120a05; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0,0,0,.4); }
.qpt-bar i { display: block; height: 100%; transition: width .4s; }
.qpt-bar.hp i { background: linear-gradient(90deg, #2f9a22, #8fe36a); }
.qpt-bar.mp i { background: linear-gradient(90deg, #1b6fa8, #8fe0ff); }
.qpt-where { font-size: 10px; color: #c9b28a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qpt-where.far { color: #ffb15a; font-weight: 700; }
@media (max-height: 560px), (max-width: 900px) {
  .qpt-head { margin-bottom: 3px; padding-bottom: 2px; }
  .qpt-m { padding: 3px 5px; margin-bottom: 3px; gap: 6px; }
  .qpt-av, .qpt-av canvas { flex-basis: 26px; width: 26px; height: 26px; }
  .qpt-lv { min-width: 14px; height: 12px; line-height: 12px; font-size: 8px; right: -5px; bottom: -3px; }
  .qpt-crown { font-size: 11px; top: -6px; left: -4px; }
  .qpt-name { font-size: 11px; }
  .qpt-bar { height: 4px; }
  .qpt-where { display: none; }
  .qpt-m.away .qpt-where, .qpt-m.dead .qpt-where { display: block; font-size: 9px; }
  #qp-party { max-height: calc(100dvh - 200px); overflow-y: auto; }
}

/* 1.1.5 — Tự động đánh đang bật: viền xanh có 2 vệt sáng xoáy quanh */
.auto-btn { overflow: visible !important; }
.auto-btn.on::before, .auto-btn.on::after {
  content: ''; position: absolute; inset: -7px; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from 0deg, transparent 0 22%, #2fd31a 34%, #9dff6e 45%, #ffffff 49.5%, transparent 50%,
    transparent 72%, #2fd31a 84%, #9dff6e 95%, #ffffff 99.5%, transparent 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4.5px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4.5px));
  animation: autoSpin 1.1s linear infinite; filter: drop-shadow(0 0 3px #5dff2e) drop-shadow(0 0 6px rgba(120,255,80,.8));
}
.auto-btn.on::after { inset: -3px; animation-duration: 1.8s; animation-direction: reverse; opacity: .7; }
@keyframes autoSpin { to { transform: rotate(360deg); } }
/* 1.1.5 — nút "Đang làm ➜" bấm được: tự đi tới nơi làm nhiệm vụ */
.qw-drow .pbtn.go { cursor: pointer; background: linear-gradient(180deg, #e9b65a, #b07a2c) !important; color: #fff; }
.qw-drow .pbtn.go:hover { filter: brightness(1.1); }

/* 1.1.6 — kênh Thế giới & khoe đồ */
.cl-world .tag, .cm-line.cl-world .tag { color: #ff9f5a !important; }
.cl-world .who { color: #ffd08a; }
.chat-item { display: inline; border: 0; background: rgba(0,0,0,.35); border-radius: 4px; padding: 0 4px; margin-left: 2px; font: inherit; font-weight: 800;
  color: #e9e4d8; cursor: pointer; text-decoration: underline dotted; pointer-events: auto; }
.chat-item:hover { background: rgba(255,255,255,.12); }
.ip-share-row { display: flex; flex-wrap: wrap; gap: 6px; }
#chat-tabs { overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
#chat-tabs::-webkit-scrollbar { display: none; }
#chat-tabs button { flex: 0 0 auto; padding: 4px 10px !important; font-size: 12px !important; }
#item-pop.chat-view { position: fixed !important; left: 50% !important; top: 50% !important; right: auto !important; bottom: auto !important; transform: translate(-50%, -50%);
  width: min(340px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); overflow: auto; z-index: 60; margin: 0 !important; }

/* 1.1.7 — Bảng xếp hạng dạng bảng: mỗi người một hàng, ngăn cách bằng 1 đường kẻ */
.rk-list { gap: 0 !important; background: rgba(255,248,230,.55); border: 1.5px solid #b8925e; border-radius: 10px; overflow: auto; }
.rk-list .rk-row, .rk-list .rk-row.top1, .rk-list .rk-row.top2, .rk-list .rk-row.top3 {
  background: transparent !important; border: 0 !important; border-bottom: 1px solid rgba(138,90,43,.28) !important; border-radius: 0 !important;
  color: #4a2c12 !important; text-shadow: none !important; box-shadow: none !important; padding: 8px 14px; font-size: 13.5px; }
.rk-list .rk-row:nth-child(even) { background: rgba(185,134,84,.08) !important; }
.rk-list .rk-row:last-child { border-bottom: 0 !important; }
.rk-list .rk-row .rk-v { color: #8a3f0e !important; }
.rk-list .rk-row.top1 b, .rk-list .rk-row.top1 .rk-v { color: #b0700a !important; }
.rk-list .rk-row.top2 b { color: #6f6f6f !important; }
.rk-list .rk-row.top3 b { color: #9a5320 !important; }
.rk-list .rk-row.me { background: rgba(127,227,106,.18) !important; box-shadow: inset 3px 0 0 #4caf3a !important; }
.rk-head { border-bottom: 2px solid #b8925e; margin-bottom: 0; padding: 6px 14px !important; }
@media (max-height: 560px), (max-width: 900px) { .rk-list .rk-row { padding: 5px 8px !important; font-size: 12px !important; } }

/* 1.1.7 — Cài đặt: 3 thẻ (Chung / Thiết lập tự động / Nhập mã quà), nội dung cuộn được, nút luôn nằm ở đáy khung */
#win-settings .set-parch { display: flex !important; flex-direction: column; }
#win-settings .set-tabs { flex: 0 0 auto; }
#win-settings .set-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 4px 6px 8px; }
#win-settings .set-foot { flex: 0 0 auto; margin-top: auto !important; padding-top: 10px; border-top: 1px dashed rgba(138,90,43,.35); display: flex; justify-content: center; gap: 12px; }
#win-settings .auto-pane .sec-title { margin: 8px 0 6px; }
#win-settings .auto-pane .steppers { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 8px; }
@media (max-height: 560px), (max-width: 900px) {
  #win-settings .auto-pane .sec-title { font-size: 13px; margin: 4px 0 4px; }
  #win-settings .auto-pane .check-grid { gap: 6px 12px; }
  #win-settings .auto-pane .check-grid.three:not(#auto-skills) { grid-template-columns: repeat(2, 1fr); }
  #win-settings .auto-pane .pcheck { font-size: 12px; gap: 7px; }
  #win-settings .auto-pane .pcheck span { flex-basis: 28px; height: 28px; }
  #win-settings .auto-pane .stepper span { font-size: 12px; }
  #win-settings .set-foot { padding-top: 6px; }
}

/* 1.1.7 — Bản đồ thế giới: kéo để xem, phóng to / thu nhỏ, chữ to rõ hơn */
.wm-stage { position: relative; cursor: grab; }
.wm-stage.dragging { cursor: grabbing; user-select: none; }
.wm-stage.dragging .wm-node { pointer-events: none; }
.wm-stage-box { position: relative; min-width: 0; min-height: 0; display: flex; }
.wm-stage-box > .wm-stage { flex: 1 1 auto; }
.wm-zoom { position: absolute; right: 10px; top: 10px; z-index: 3; display: flex; flex-direction: column; gap: 6px; }
.wm-zoom button { width: 36px; height: 36px; border-radius: 50%; border: 2px solid #8a5a2b; background: linear-gradient(180deg, #f7e3b9, #e0bb7f); color: #5a361b; font-weight: 900; font-size: 18px; cursor: pointer; box-shadow: 0 2px 4px rgba(0,0,0,.3); padding: 0; }
.wm-drag-hint { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); white-space: nowrap; pointer-events: none; z-index: 3;
  background: rgba(58,34,16,.78); color: #ffe9b0; font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 12px; }
.wm-name { font-size: 17px !important; paint-order: stroke; stroke: #3a2210; stroke-width: 3px; }
.wm-lv { font-size: 12.5px !important; }
@media (max-height: 560px), (max-width: 900px) { .wm-zoom button { width: 30px; height: 30px; font-size: 15px; } .wm-drag-hint { font-size: 10.5px; } }

/* 1.1.9 — Khung chat theo cỡ màn hình (không phụ thuộc máy có cảm ứng hay không):
   màn hình lớn (máy tính, iPad): gọn ở góc dưới trái như cũ;
   điện thoại: ở giữa màn hình, cao gần hết chiều cao để đọc / vuốt tin cũ dễ */
@media (min-width: 901px) and (min-height: 561px) {
  body .chat-panel, body.touch-mode .chat-panel {
    top: auto !important; bottom: 16px !important; left: calc(12px + var(--sl, 0px)) !important; right: auto !important; transform: none !important;
    width: min(440px, 36vw) !important; height: min(300px, 46vh) !important; max-height: none !important;
  }
}
@media (max-width: 900px), (max-height: 560px) {
  body .chat-panel, body.touch-mode .chat-panel {
    top: 46px !important; bottom: 8px !important; left: 50% !important; right: auto !important; transform: translateX(-50%) !important;
    width: min(520px, 60vw) !important; height: auto !important; max-height: none !important;
  }
}
body.kb-open .chat-panel, body.touch-mode.kb-open .chat-panel { top: 4px !important; bottom: calc(var(--kbh, 0px) + 4px) !important; height: auto !important; }
.chat-panel #chat-log { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
/* Khung thông tin người chơi đang chọn: nằm dưới dải chat trên cùng, không bị che */
.hud-plate.tplate { top: 54px !important; }
@media (max-height: 560px), (max-width: 900px) { .hud-plate.tplate { top: 42px !important; } }
/* 1.1.8 — Xem người chơi khác: bố cục giống bảng Nhân vật của mình (trang bị trái, thông tin phải) */
#win-pinfo .pi-wrap { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; justify-items: stretch !important; }
#win-pinfo .pi-wrap > .equip { width: auto !important; }
#win-pinfo .pi-side { display: flex; flex-direction: column; padding: 14px 18px; }
#win-pinfo .pi-side .stat-list { font-size: 15px; }
#win-pinfo .pi-note { margin-top: auto; font-size: 11.5px; color: #c9b28a; font-style: italic; text-align: center; }
@media (max-height: 560px), (max-width: 900px) { #win-pinfo .pi-side { padding: 8px 10px; } #win-pinfo .pi-side .stat-list { font-size: 12px; } }
/* Đồ khóa */
.ip-lines .bound { color: #9a4a12; font-weight: 800; }
.inv-slot.bnd::after { content: '🔒'; position: absolute; left: 2px; top: 1px; font-size: 10px; line-height: 1; filter: drop-shadow(0 1px 1px #000); pointer-events: none; }

/* 1.2.0 — Cẩm nang trong game: mục lục chia nhóm, nội dung dạng bảng 2 cột */
.help-topics .help-group { margin: 8px 2px 2px; font-size: 11px; font-weight: 900; letter-spacing: .6px; text-transform: uppercase; color: #e9c27a; opacity: .9; }
.help-topics .help-group:first-child { margin-top: 0; }
.help-topics button { text-align: left !important; }
.help-intro { margin: -4px 0 12px; text-align: center; color: #f3dfb6; font-style: italic; font-weight: 600; }
.help-dl { display: grid; grid-template-columns: minmax(110px, 30%) 1fr; margin: 0; border-top: 1px solid rgba(255,230,160,.18); }
.help-dl dt, .help-dl dd { margin: 0; padding: 8px 10px; border-bottom: 1px solid rgba(255,230,160,.18); line-height: 1.5; }
.help-dl dt { color: #ffe066; font-weight: 800; }
.help-dl dd { color: #fff3d6; font-weight: 600; }
@media (max-height: 560px), (max-width: 900px) {
  .help-dl { grid-template-columns: minmax(84px, 30%) 1fr; }
  .help-dl dt, .help-dl dd { padding: 5px 6px; font-size: 12px; }
  .help-topics .help-group { font-size: 9.5px; margin-top: 6px; }
}
/* Đăng ký: ghi chú email / số điện thoại */
#auth-reg-note { margin: 2px 0 4px; font-size: 12px; opacity: .85; }
/* Bảng xếp hạng: số hạng 4 trở đi nhỏ, gọn (không to hơn huy hiệu top 1–3) */
.parch .rk-list .rk-n:not(.img) { font-size: 14px !important; font-weight: 800; color: #6b4524; }
.rk-list .rk-n:not(.img) { font-size: 13px; }

/* Kênh Thông báo (boss, đồ hiếm, cường hóa cao…) tách khỏi Hệ thống (tin của riêng mình) */
.chat-log .cl-ann, .chat-log .cl-ann.cl-hi, .cl-ann .tag { color: #ff9d5c; }
.chat-mini .cm-line.cl-ann, .chat-mini .cm-line.cl-ann.cl-hi { color: #ffb27a; background: none; padding: 0; }

/* Ổ khóa nhỏ trên ảnh đồ khóa (bảng chi tiết, ô đang mặc) */
#ip-icon { position: relative; }
#ip-icon.bnd::after, .eq.bnd::after { content: "🔒"; color: #fff; position: absolute; z-index: 2; left: 3px; top: 2px; font-size: 12px; line-height: 1; filter: drop-shadow(0 1px 1px #000); pointer-events: none; }
/* Xem người chơi khác: ô trang bị là thẻ div → căn chữ giữa ô giống bảng Nhân vật của mình (máy tính & điện thoại) */
#win-pinfo .eq { display: flex; align-items: center; justify-content: center; text-align: center; padding: 0 2px; line-height: 1.15; }

/* =====================================================================
   1.3.0 — Pet: cửa sổ Pet (danh sách bên trái, chi tiết bên phải) + nút "Bắt"
   ===================================================================== */
.mi-pet { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff3d6'%3E%3Cellipse cx='6' cy='9' rx='2.2' ry='3'/%3E%3Cellipse cx='10' cy='5.5' rx='2.2' ry='3'/%3E%3Cellipse cx='14.5' cy='5.5' rx='2.2' ry='3'/%3E%3Cellipse cx='18.5' cy='9' rx='2.2' ry='3'/%3E%3Cpath d='M12 11c3 0 6 4 6 7 0 2-1.8 3-3.5 2.4-.9-.3-1.6-.6-2.5-.6s-1.6.3-2.5.6C7.8 21 6 20 6 18c0-3 3-7 6-7z'/%3E%3C/svg%3E"); }
.pet-books { display: flex; flex-wrap: wrap; gap: 6px; }
.pet-book { display: flex; flex-direction: column; align-items: flex-start; padding: 5px 9px; border-radius: 8px; border: 2px solid #c9a06a; background: #fbf0d6; cursor: pointer; font: inherit; color: #5a2a0c; }
.pet-book b { font-size: 12.5px; }
.pet-book small { font-size: 11px; color: #8a6440; }
.pet-book.adv { border-color: #ffd23a; box-shadow: 0 0 6px rgba(255,200,40,.6); }
.pet-book.on { background: #ffe9a8; border-color: #e0a020; box-shadow: 0 0 0 2px rgba(224,160,32,.4); }
.pet-learn-info { margin: 0; font-size: 12.5px; color: #5b3a1c; font-weight: 600; }
.pet-empty { text-align: center; font-size: 18px; color: #7a3f12; margin: 40px auto; }

/* ===== Thẻ Pet (bảng Nhân vật): 3 cột, hiện đủ trong khung không phải cuộn =====
   Cột 1: thông tin + danh sách · Cột 2: hình pet + 6 ô kỹ năng · Cột 3: ngộ tính, tư chất, chỉ số */
.pv { --pv-g: 10px; --pv-fs: 14px; --pv-row: 28px; --pv-sk: 66px;
  flex: 1 1 auto; min-height: 0; display: grid; gap: var(--pv-g);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.12fr); }
.pv.pv-none { display: flex; align-items: center; justify-content: center; }
.pv { position: relative; }
/* Bảng tác dụng kỹ năng (bấm vào ô kỹ năng) */
.pv-tip { position: absolute; z-index: 20; width: min(270px, 90%); padding: 9px 11px; border-radius: 10px; background: #fff6e0; border: 2px solid #b5741c;
  box-shadow: 0 6px 18px rgba(40,20,0,.45); color: #5b3a1c; font-size: 13px; pointer-events: auto; }
.pv-tip .tp-head { display: flex; gap: 9px; align-items: center; margin-bottom: 5px; }
.pv-tip .tp-ic { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 7px; background: center / cover no-repeat; box-shadow: inset 0 0 0 2px #3d7bc9; }
.pv-tip .tp-ic.act { box-shadow: inset 0 0 0 2px #d0703a; } .pv-tip .tp-ic.own, .pv-tip .tp-ic.adv { box-shadow: inset 0 0 0 3px #ffd23a, inset 0 0 0 4px #7a4a00, 0 0 8px 1px rgba(255,200,40,.75); }
.pv-tip .tp-t { display: flex; flex-direction: column; min-width: 0; }
.pv-tip .tp-t b { font-size: 14.5px; color: #5a2a0c; } .pv-tip .tp-t b.adv { color: #a86a00; }
.pv-tip .tp-t small { font-size: 11.5px; color: #8a6440; font-weight: 700; }
.pv-tip p { margin: 3px 0 0; line-height: 1.35; font-weight: 600; }
.pv-tip .tp-up { color: #8a6440; font-size: 12px; font-weight: 600; border-top: 1px dashed #d8b47e; padding-top: 4px; margin-top: 5px; }
.pv-tip .tp-empty { color: #7a3f12; }
.pv-col { min-height: 0; display: flex; flex-direction: column; gap: var(--pv-g); }
.pv-box, .pv-info, .pv-list, .pv-skbox, .pv-side { border-radius: 10px; background: #f3dfb6; box-shadow: inset 0 0 0 2px #d8b47e; padding: 8px 9px; }
.pv-h { font-size: var(--pv-fs); font-weight: 800; color: #7a3f12; line-height: 1.2; }
/* Hình pet */
.pv-show { position: relative; flex: 1 1 auto; min-height: 120px; border-radius: 10px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 75%, rgba(120,170,110,.5), rgba(120,170,110,0) 60%), #f3dfb6; box-shadow: inset 0 0 0 2px #d8b47e; }
.pv-cv { position: absolute; left: 0; top: 18px; width: 100%; height: calc(100% - 40px); object-fit: contain; }
.pv-corner { position: absolute; top: 7px; display: flex; flex-direction: column; gap: 1px; font-size: 12px; color: #8a6440; font-weight: 700; z-index: 1; }
.pv-corner.l { left: 10px; } .pv-corner.r { right: 10px; text-align: right; }
.pv-corner.l b { font-size: 15px; color: #5a2a0c; line-height: 1.1; }
.pv-tier { color: #7a5534; }
.pv-corner .pv-nat { font-size: 13px; }
.pv-step { display: inline-flex; align-items: center; gap: 6px; }
.pv-step .pbtn.sm { min-width: 26px; height: calc(var(--pv-row) - 4px); padding: 0 6px; }
.pv-step b { min-width: 14px; text-align: center; color: #5a2a0c; }
.pv-line { margin: 0; font-size: calc(var(--pv-fs) - .5px); color: #5b3a1c; line-height: 1.35; }
.pv-line .k { color: #7a3f12; font-weight: 800; } .pv-line b { font-weight: 700; }
.pv-chk { display: flex; align-items: center; gap: 6px; font-size: calc(var(--pv-fs) - 1px); color: #5b3a1c; font-weight: 700; }
.pv-chk input { width: 16px; height: 16px; accent-color: #b5741c; }
.pv-wit .k.bad, .pv-li small.bad { color: #b0301f; font-weight: 800; }
.pv-grow { font-weight: 800; }
.pv .pet-book { border-left: 5px solid var(--nc, #c9a06a); }
.pv .pet-book.same b::after { content: ' ✓'; color: #2f8f5a; }
.pv-lock { color: #7a3f12; }
.pv-sp { position: absolute; bottom: 6px; left: 0; right: 0; text-align: center; font-size: 14px; font-weight: 800; color: #5a2a0c; z-index: 1; }
.pv-act { align-self: flex-start; margin-top: 3px; font-style: normal; font-size: 10.5px; font-weight: 900; color: #1d3a0c; background: #9be36a; border-radius: 6px; padding: 1px 6px; }
.pv-act.sold { background: #f0c26a; color: #4a2a00; }
/* 6 ô kỹ năng: 3 cột × 2 hàng */
.pv-skbox { flex: 0 0 auto; display: flex; flex-direction: column; gap: 6px; }
.pv-skills { display: grid; grid-template-columns: repeat(3, var(--pv-sk)); justify-content: space-evenly; gap: 6px; }
.pv-sk { position: relative; width: var(--pv-sk); height: var(--pv-sk); border-radius: 8px; background: #e8d0a2 center / cover no-repeat; box-shadow: inset 0 0 0 2px #c9a06a; cursor: pointer; }
.pv-sk.empty { cursor: default; background: rgba(251,240,214,.9); box-shadow: inset 0 0 0 2px rgba(201,160,106,.7); }
.pv-sk.shut { cursor: default; background: #8a6a48; box-shadow: inset 0 0 0 2px #5a3a1c, inset 0 0 12px rgba(0,0,0,.45); }
.pv-sk.act { box-shadow: inset 0 0 0 2px #d0703a; } .pv-sk.own { box-shadow: inset 0 0 0 3px #e0a020; }
.pv-sk.adv, .pv-sk.own { box-shadow: inset 0 0 0 3px #ffd23a, inset 0 0 0 4px #7a4a00, 0 0 8px 1px rgba(255,200,40,.75); }
.pv-sk .star { position: absolute; right: 3px; top: 1px; font-style: normal; font-size: 12px; color: #ffe066; text-shadow: 0 1px 2px #000; }
.pv-sk .lock { position: absolute; left: 3px; bottom: 1px; font-style: normal; font-size: 13px; opacity: .6; }
.pv-sk .lock.on { opacity: 1; }
/* Thông tin */
.pv-info { flex: 0 0 auto; display: flex; flex-direction: column; gap: 5px; }
.pv-row { display: flex; align-items: center; gap: 6px; font-size: var(--pv-fs); height: var(--pv-row); }
.pv-row .k { flex: 0 0 auto; color: #7a3f12; font-weight: 700; }
.pv-row .v { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 1px 8px; border-radius: 6px; background: #a77d55; color: #fff3d6; text-shadow: 0 1px 2px #000; line-height: calc(var(--pv-row) - 4px); }
.pv-row .v.gold { color: #fff7c2; }
.pv-row .v.lv { flex: 0 0 auto; min-width: 30px; text-align: center; }
.pv-row .pbtn.sm { flex: 0 0 auto; padding: 0 9px; height: calc(var(--pv-row) - 1px); font-size: calc(var(--pv-fs) - 1px); }
.pv-bar { position: relative; flex: 1 1 auto; height: calc(var(--pv-row) - 4px); border-radius: 6px; background: #c9a77a; overflow: hidden; box-shadow: inset 0 1px 2px rgba(0,0,0,.3); }
.pv-bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(180deg, #ffe27a, #e0a020); }
.pv-bar.happy i { background: linear-gradient(180deg, #a6ef7c, #4fa82c); }
.pv-bar.low i { background: linear-gradient(180deg, #ff9a7a, #d0402a); }
.pv-bar span { position: relative; display: block; text-align: center; font-size: calc(var(--pv-fs) - 1.5px); line-height: calc(var(--pv-row) - 4px); color: #fff; font-weight: 800; text-shadow: 0 1px 2px #000; }
.pv-btns { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 6px; }
.pv-btns .pbtn { box-sizing: border-box; width: 100%; margin: 0; min-width: 0; height: calc(var(--pv-row) + 4px); padding: 0 8px; font-size: var(--pv-fs); white-space: nowrap; }
/* Danh sách */
.pv-list { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 5px; }
.pv-ul { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 3px; }
.pv-li { flex: 1 1 0; min-height: 0; max-height: 30px; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 8px; border-radius: 6px; border: 1px solid #c9a06a; background: #fbf0d6; font: inherit; font-size: var(--pv-fs); color: #5a2a0c; text-align: left; cursor: pointer; }
.pv-li .n { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-li small { flex: 0 0 auto; font-size: calc(var(--pv-fs) - 2px); color: #8a6440; }
.pv-li small.on { color: #2f7a12; font-weight: 800; }
.pv-li.on { background: #ffe9a8; border-color: #e0a020; box-shadow: 0 0 0 2px rgba(224,160,32,.35); }
.pv-li.sold { opacity: .75; }
.pv-li.none, .pv-li.hold { cursor: default; justify-content: center; color: #b08a5a; background: rgba(246,230,195,.5); border-style: dashed; font-size: calc(var(--pv-fs) - 1.5px); }
.pv-li.hold { color: #8a6440; }
/* Cột phải */
.pv-side { min-height: 0; display: flex; flex-direction: column; gap: 6px; }
.pv-stats, .pv-panel { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 5px; }
.pv-panel { overflow: hidden; }
.pv-sec { margin-top: 3px; font-size: var(--pv-fs); font-weight: 800; color: #7a3f12; border-bottom: 1px solid #d8b47e; padding-bottom: 2px; }
.pv-st { display: flex; align-items: center; gap: 6px; font-size: var(--pv-fs); }
.pv-st .k { flex: 1 1 auto; color: #5b3a1c; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-st .v { flex: 0 0 auto; min-width: 66px; text-align: right; padding: 2px 8px; border-radius: 6px; background: #a77d55; color: #fff3d6; text-shadow: 0 1px 2px #000; }
.pv-st .x { flex: 0 0 auto; width: 38px; text-align: right; font-size: calc(var(--pv-fs) - 1.5px); font-weight: 800; color: #8a6440; }
.pv-st.hi .x { color: #2f7a12; } .pv-st.lo .x { color: #a1301f; }
.pv-grid2, .pv-grid3 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.pv-grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pv-grid2.one { grid-template-columns: 1fr; }
.pv-c { display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 3px 8px; border-radius: 6px; background: #a77d55; font-size: calc(var(--pv-fs) - .5px); white-space: nowrap; }
.pv-c .k { color: #f3dfb6; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.pv-c .v { color: #fff7c2; text-shadow: 0 1px 2px #000; }
.pv-wit { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: var(--pv-fs); }
.pv-wit .k { color: #7a3f12; font-weight: 800; white-space: nowrap; }
.pv .ls { display: none; }
.pv-wit .pips { display: flex; gap: 3px; }
.pv-wit .pips i { width: 9px; height: 13px; border-radius: 3px; background: #c9a77a; box-shadow: inset 0 1px 2px rgba(0,0,0,.3); }
.pv-wit .pips i.on { background: linear-gradient(180deg, #ffe27a, #e0a020); }
.pv-wit.big .pips i { width: 12px; height: 16px; }
.pv-panel .pv-btns { margin-top: auto; }
.pv-note { margin: 2px 0; font-size: calc(var(--pv-fs) - 1px); color: #8a6440; font-weight: 600; }
.pv-tabs { display: flex; gap: 4px; flex: 0 0 auto; }
.pv-tabs button { flex: 1 1 0; min-width: 0; white-space: nowrap; overflow: hidden; height: calc(var(--pv-row) + 2px); padding: 0 2px; border-radius: 7px; border: 2px solid #c9a06a; background: #fbf0d6; font: inherit; font-size: calc(var(--pv-fs) - .5px); font-weight: 800; color: #7a5534; cursor: pointer; }
.pv-tabs button.on { background: linear-gradient(180deg, #f0b84a, #b5741c); border-color: #5a3410; color: #fff3d6; text-shadow: 0 1px 2px #000; }
.pv .pet-books { flex: 0 1 auto; min-height: 0; overflow-y: auto; gap: 4px; align-content: flex-start; }
.pv .pet-book { padding: 3px 7px; }
.pv .pet-learn-info { font-size: calc(var(--pv-fs) - 1px); }
/* Điện thoại nằm ngang: thu nhỏ đồng bộ để vừa khung */
@media (max-height: 560px), (max-width: 900px) {
  .pv { --pv-g: 5px; --pv-fs: 11px; --pv-row: 19px; --pv-sk: 40px; --pv-x: 0; grid-template-columns: minmax(0, 1fr) minmax(0, .92fr) minmax(0, 1.12fr); }
  .pv-info, .pv-list, .pv-skbox, .pv-side { padding: 5px 6px; border-radius: 8px; }
  .pv-info, .pv-list { gap: 3px; } .pv-skbox { gap: 3px; } .pv-side { gap: 4px; }
  .pv-stats { gap: 2px; }
  .pv-show { min-height: 90px; border-radius: 8px; }
  .pv-corner { font-size: 10px; top: 4px; } .pv-corner.l b { font-size: 12px; } .pv-corner .pv-nat { font-size: 11px; }
  .pv-tip { width: min(220px, 92%); padding: 6px 8px; font-size: 11px; } .pv-tip .tp-ic { width: 30px; height: 30px; } .pv-tip .tp-t b { font-size: 12px; } .pv-tip .tp-t small { font-size: 10px; } .pv-tip .tp-up { font-size: 10.5px; } .pv-corner.l { left: 7px; } .pv-corner.r { right: 7px; }
  .pv-sp { font-size: 11.5px; bottom: 3px; }
  .pv-act { font-size: 9px; padding: 0 4px; margin-top: 1px; }
  .pv-skills { gap: 4px; } .pv-sk { border-radius: 6px; }
  .pv-row { gap: 4px; } .pv-row .v { padding: 0 6px; }
  .pv-st .v { min-width: 48px; padding: 0 6px; } .pv-st .x { width: 30px; }
  .pv-c { padding: 0 5px; } .pv-st .v { padding: 0 6px; } .pv-stats, .pv-panel { gap: 2px; }
  .pv-ul { gap: 2px; } .pv-li { max-height: 22px; padding: 0 6px; border-radius: 5px; }
  .pv-sec { margin-top: 1px; padding-bottom: 1px; }
  .pv-wit .pips { gap: 2px; } .pv-wit .pips i, .pv-wit.big .pips i { width: 7px; height: 10px; }
  .pv-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; } .pv-tabs button { height: 19px; border-width: 1.5px; border-radius: 6px; }
  .pv .pet-book { padding: 1px 5px; flex-direction: row; gap: 4px; align-items: baseline; } .pv .pet-book b { font-size: 10.5px; } .pv .pet-book small { font-size: 9.5px; }
}
@media (max-width: 720px) {
  .pv { --pv-fs: 10.5px; --pv-sk: 36px; grid-template-columns: minmax(0, 1fr) minmax(0, .88fr) minmax(0, 1.1fr); }
  .pv-row .k { font-size: 10px; }
  .pv .lf { display: none; } .pv .ls { display: inline; }
  .pv-wit { gap: 4px; } .pv-wit .pips i, .pv-wit.big .pips i { width: 6px; }
}
/* Nút "Bắt" thú hoang (chỉ hiện ở bản đồ có thú hoang), nằm trên nút Tự động */
.catch-btn { position: absolute; right: calc(var(--auto-right, 18px)); bottom: 168px; width: 64px; height: 64px; border-radius: 50%; z-index: 6; pointer-events: auto; touch-action: manipulation;
  background: radial-gradient(circle at 35% 30%, #ffe08a, #c98a1c 70%); border: 3px solid #5a3410; color: #3a2000; font: 900 15px/1 inherit; font-family: inherit;
  box-shadow: 0 4px 10px rgba(0,0,0,.45), inset 0 2px 0 rgba(255,255,255,.4); cursor: pointer; }
.catch-btn:active { transform: scale(.94); }
.catch-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; padding: 0; }
.catch-btn svg { width: 56%; height: 56%; margin-top: -2px; }
.catch-btn span { font-size: 11px; font-weight: 900; color: #3a2000; line-height: 1; margin-top: -1px; }
@media (pointer: coarse), (max-height: 560px) { .catch-btn { right: calc(240px + var(--sr, 0px)) !important; bottom: 196px !important; width: 58px; height: 58px; } }

/* Chợ: hình pet nhỏ trong ô */
.mk-petcv { position: absolute; inset: 0; width: 100%; height: 100%; }
#mk-icon { position: relative; }

/* =================== Phó bản =================== */
#win-dungeon .parch { width: min(560px, calc(100vw - 16px)) !important; min-height: 0 !important; height: auto !important; }
.dg-body { display: flex; flex-direction: column; gap: 6px; max-height: min(70vh, 520px); }
.dg-title { margin: 0; text-align: center; color: #7a2a1a; font-size: 20px; }
.dg-desc { margin: 0 0 4px; font-size: 13.5px; color: #5b3a1c; line-height: 1.4; }
.dg-kv { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; padding: 3px 10px; border-radius: 7px; background: #f3dfb6; }
.dg-kv .k { color: #7a3f12; font-weight: 700; } .dg-kv .v { color: #5a2a0c; }
.dg-kv.bad .v { color: #b0301f; }
.dg-sec { margin-top: 4px; font-size: 13.5px; font-weight: 800; color: #7a3f12; border-bottom: 1px solid #d8b47e; }
.dg-list { display: flex; flex-direction: column; gap: 4px; }
.dg-mem { display: flex; justify-content: space-between; padding: 4px 10px; border-radius: 7px; background: rgba(176,48,31,.12); font-size: 13px; }
.dg-mem b, .dg-mem small { color: #6a1a0a !important; text-shadow: none !important; }
.dg-mem.ok { background: rgba(47,143,90,.18); }
.dg-mem.ok b { color: #1d4a22 !important; } .dg-mem.ok small { color: #2f7a12 !important; }
.dg-mem small { font-weight: 800; }
.dg-acts { display: flex; justify-content: center; margin-top: 6px; }
.dg-acts .pbtn.big { max-width: 280px; }
.dg-pill { position: absolute; left: 50%; top: 52px; transform: translateX(-50%); z-index: 4; display: flex; align-items: center; gap: 10px; padding: 5px 8px 5px 14px; border-radius: 10px;
  background: linear-gradient(180deg, rgba(60,24,10,.92), rgba(30,12,5,.92)); border: 2px solid #c98a3a; color: #fff3d6; font-size: 14px; box-shadow: 0 3px 10px rgba(0,0,0,.5); pointer-events: auto; }
.dg-pill b { color: #ffd36a; } .dg-pill span { font-weight: 800; } .dg-pill em { font-style: normal; font-weight: 900; min-width: 44px; text-align: center; }
.dg-pill em.low { color: #ff8a6a; }
.dg-pill.done { border-color: #7fe36a; } .dg-pill.done span { color: #9be36a; }
.dg-pill.fail { border-color: #ff6a4a; }
.dg-pill .pbtn.sm { padding: 3px 9px; font-size: 12px; }
.dg-tag { pointer-events: none; color: #ffd36a; }
@media (max-height: 560px), (max-width: 900px) {
  .dg-pill { top: 44px; gap: 6px; padding: 3px 5px 3px 9px; font-size: 11.5px; }
  .dg-pill .pbtn.sm { padding: 2px 6px; font-size: 10.5px; }
  .dg-desc, .dg-kv, .dg-mem { font-size: 12px; } .dg-title { font-size: 16px; }
}

/* ===== Bộ lạc: Quyên góp · Phúc lợi · Tộc khố ===== */
.pbtn.xs { padding: 3px 8px; font-size: 11px; min-height: 0; border-width: 1.5px; }
.gd-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; height: 100%; min-height: 0; }
.gd-col { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.gd-card { background: #8a6444; box-shadow: inset 0 0 0 2px #6e4b2f; border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 7px; }
.gd-rank, .gd-log, .gd-lvlist, .gd-shop { flex: 1 1 0; min-height: 0; }
.gd-h { margin: 0; font-size: 14px; color: #ffe066; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.gd-coin { font-style: normal; color: #fff3d6; font-size: 12.5px; }
.gd-lvtop { display: flex; align-items: baseline; gap: 10px; }
.gd-lv { font-size: 22px; color: #ffe066; }
.gd-lvsub { font-size: 12.5px; font-weight: 700; color: #f3dfb7; }
.gd-bar { position: relative; height: 18px; border-radius: 9px; background: rgba(0,0,0,.35); box-shadow: inset 0 0 0 1.5px #4a2a10; overflow: hidden; }
.gd-bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(180deg, #ffd45a, #c98a1c); border-radius: 9px; }
.gd-bar span { position: relative; display: block; text-align: center; font-size: 11.5px; font-weight: 800; line-height: 18px; }
.gd-perk { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; font-weight: 700; }
.gd-perk .next { color: #bff0a0; }
.gd-note { margin: 0; font-size: 11.5px; color: #f3dfb7; font-weight: 600; }
.gd-card > .pbtn { align-self: flex-start; }
.gd-row { display: grid; grid-template-columns: 24px minmax(70px, 1fr) auto; gap: 6px; align-items: center; }
.gd-cur { width: 22px; height: 22px; background: center / contain no-repeat; }
.gd-cur.big { width: 34px; height: 34px; }
.gd-inp { height: 28px; min-width: 0; border-radius: 6px; border: 1.5px solid #4a2a10; background: #f3e2c2; color: #4a2a10; font-weight: 800; padding: 0 8px; font-size: 13px; text-shadow: none; }
.gd-chips { display: flex; gap: 4px; }
.gd-prev { margin: 0; font-size: 12px; color: #bff0a0; font-weight: 700; }
.gd-dfoot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.gd-dfoot small { color: #f3dfb7; font-weight: 700; font-size: 11.5px; }
.gd-list { overflow: auto; min-height: 0; flex: 1 1 auto; display: flex; flex-direction: column; gap: 3px; }
.gd-li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto 64px; gap: 6px; align-items: center; padding: 3px 6px; border-radius: 6px; background: rgba(0,0,0,.18); font-size: 12.5px; }
.gd-li.me { box-shadow: inset 0 0 0 1.5px #ffe066; }
.gd-li b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gd-li span { color: #f3dfb7; font-size: 11.5px; }
.gd-li em { font-style: normal; text-align: right; font-weight: 800; color: #ffe066; }
.gd-no { font-style: normal; font-weight: 900; text-align: center; color: #f3dfb7; }
.gd-no.n1 { color: #ffd23a; } .gd-no.n2 { color: #e8e8e8; } .gd-no.n3 { color: #e0a060; }
.gd-lg { display: grid; grid-template-columns: 78px 1fr; gap: 6px; font-size: 12px; padding: 2px 4px; }
.gd-lg small { color: #f3dfb7; font-weight: 700; }
.gd-giftrow { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 13px; }
.gd-giftrow span { flex: 1; }
.gd-lvrow { display: grid; grid-template-columns: 48px 1fr auto; gap: 6px; font-size: 12px; padding: 3px 6px; border-radius: 6px; background: rgba(0,0,0,.14); opacity: .8; }
.gd-lvrow.done { opacity: .6; }
.gd-lvrow.cur { opacity: 1; background: rgba(255,224,102,.18); box-shadow: inset 0 0 0 1.5px #ffe066; }
.gd-lvrow b { color: #ffe066; }
.gd-lvrow small { color: #f3dfb7; font-weight: 700; }
.gd-items { display: grid; grid-template-columns: 1fr; gap: 5px; overflow: auto; min-height: 0; flex: 1 1 auto; }
.gd-item { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 4px 6px; border-radius: 7px; background: rgba(0,0,0,.18); }
.gd-item.lock { opacity: .55; }
.gd-ic { width: 40px; height: 40px; border-radius: 7px; background: #5a3d24 center / 86% no-repeat; box-shadow: inset 0 0 0 1.5px #3e2814; cursor: pointer; }
.gd-ic.rar { box-shadow: inset 0 0 0 2px var(--rc); }
.gd-iinfo { min-width: 0; display: flex; flex-direction: column; }
.gd-iinfo b { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gd-iinfo small { font-size: 11px; color: #ffe2a8; font-weight: 700; }
@media (max-height: 520px), (max-width: 900px) {
  .gd-grid, .gd-col { gap: 6px; }
  .gd-card { padding: 6px 8px; gap: 4px; }
  .gd-lv { font-size: 17px; }
  .gd-h { font-size: 12.5px; }
  .gd-perk, .gd-li, .gd-lg, .gd-lvrow { font-size: 11px; }
  .gd-li { grid-template-columns: 18px minmax(0, 1fr) auto 52px; padding: 2px 5px; }
  .gd-lg { grid-template-columns: 66px 1fr; }
  .gd-inp { height: 24px; font-size: 12px; }
  .gd-item { grid-template-columns: 32px minmax(0, 1fr) auto; padding: 3px 5px; gap: 6px; }
  .gd-ic { width: 32px; height: 32px; }
  .gd-iinfo b { font-size: 11.5px; } .gd-iinfo small { font-size: 10px; }
  .gd-bar { height: 15px; } .gd-bar span { line-height: 15px; font-size: 10.5px; }
  .pbtn.xs { padding: 2px 6px; font-size: 10.5px; }
  .gd-chips .pbtn.xs { padding: 2px 4px; }
}
.gd-dfoot .pbtn { white-space: nowrap; flex: 0 0 auto; }
.gd-lg { grid-template-columns: 92px 1fr; }
.gd-lg small { white-space: nowrap; }
.gd-lvrow span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gd-giftrow .pbtn { white-space: nowrap; }
@media (max-height: 520px), (max-width: 900px) { .gd-lg { grid-template-columns: 74px 1fr; } .gd-lvrow { grid-template-columns: 40px 1fr auto; } .gd-giftrow { font-size: 11.5px; gap: 6px; } }
.gd-chips .pbtn { white-space: nowrap; }
@media (max-height: 520px), (max-width: 900px) {
  .gd-row { grid-template-columns: 20px minmax(44px, 1fr) auto; gap: 4px; }
  .gd-cur { width: 18px; height: 18px; }
  .gd-chips { gap: 3px; }
  .gd-lvrow span { white-space: normal; }
}
@media (max-width: 700px) { .gd-chips .pbtn:nth-child(2) { display: none; } }

/* ===== Đấu trường 1v1 ===== */
.ar-queue { top: 52px; }
.ar-queue b { color: #ff9a7a; }
.ar-hud { position: absolute; left: 50%; top: 50px; transform: translateX(-50%); z-index: 4; display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center;
  width: min(620px, calc(100vw - 340px)); min-width: 360px; padding: 6px 10px; border-radius: 12px; pointer-events: none;
  background: linear-gradient(180deg, rgba(60,20,12,.92), rgba(30,10,6,.92)); border: 2px solid #c98a3a; color: #fff3d6; box-shadow: 0 3px 10px rgba(0,0,0,.5); }
.ar-side { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ar-side.foe { align-items: flex-end; text-align: right; }
.ar-side b { font-size: 14px; color: #ffe066; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ar-side.foe b { color: #ff9a7a; }
.ar-side small { font-size: 11px; color: #f3dfb7; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ar-hp { position: relative; width: 100%; height: 14px; border-radius: 7px; background: rgba(0,0,0,.45); box-shadow: inset 0 0 0 1.5px #3a1a0a; overflow: hidden; }
.ar-hp i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(180deg, #ff7a5a, #c0281a); transition: width .2s; }
.ar-side.me .ar-hp i { background: linear-gradient(180deg, #8fe36a, #2f8f2a); }
.ar-side.foe .ar-hp i { left: auto; right: 0; }
.ar-hp em { position: relative; display: block; text-align: center; font-style: normal; font-size: 10.5px; font-weight: 900; line-height: 14px; }
.ar-mid { display: flex; flex-direction: column; align-items: center; min-width: 64px; }
.ar-mid em { font-style: normal; font-size: 22px; font-weight: 900; color: #fff3d6; }
.ar-mid em.low { color: #ff7a5a; }
.ar-mid small { font-size: 10.5px; font-weight: 800; color: #f3dfb7; }
.ar-big { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%); z-index: 6; pointer-events: none; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.ar-big b { font-size: 92px; font-weight: 900; color: #ffe066; -webkit-text-stroke: 3px #5a2a00; text-shadow: 0 6px 18px rgba(0,0,0,.6); animation: arPop .35s ease-out; line-height: 1; }
.ar-big small { font-size: 18px; font-weight: 900; color: #fff3d6; text-shadow: 0 2px 6px #000; padding: 4px 14px; border-radius: 10px; background: rgba(0,0,0,.45); }
.ar-big.go b { color: #9be36a; -webkit-text-stroke-color: #12400a; }
.ar-big.win b { color: #ffd23a; }
.ar-big.lose b { color: #ff6a5a; -webkit-text-stroke-color: #400a0a; }
.ar-big.draw b { color: #c9d3dc; -webkit-text-stroke-color: #2a3440; }
@keyframes arPop { from { transform: scale(1.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.ar-tier { display: inline-flex; align-items: center; gap: 4px; font-weight: 900; color: var(--tc); font-size: 12.5px; text-shadow: 0 1px 2px #000; }
.ar-tier.big { font-size: 22px; }
.ar-tier-ic { width: 22px; height: 22px; background: center / contain no-repeat; }
.ar-tier.big .ar-tier-ic { width: 40px; height: 40px; }
.ar-mtop { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.ar-rating { font-size: 18px; color: #fff3d6; }
.ar-rank { font-weight: 800; color: #ffe066; font-size: 13px; }
.ar-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.ar-st { display: flex; flex-direction: column; align-items: center; padding: 4px; border-radius: 7px; background: rgba(0,0,0,.18); }
.ar-st small { font-size: 11px; color: #f3dfb7; font-weight: 700; }
.ar-st b { font-size: 14px; }
.ar-line { margin: 0; font-size: 12.5px; font-weight: 700; color: #f3dfb7; }
.ar-rules { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; font-weight: 600; }
.ar-find { flex: 1 1 auto; }
.ar-find .pbtn.big { align-self: stretch; margin-top: auto; font-size: 17px; padding: 10px; }
.ar-qrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.ar-wait { font-weight: 900; color: #9be36a; animation: arBlink 1.2s infinite; }
@keyframes arBlink { 50% { opacity: .45; } }
.ar-table { display: flex; flex-direction: column; gap: 3px; }
.ar-tr { display: grid; grid-template-columns: 36px minmax(0, 1.6fr) 1fr 70px 100px; gap: 8px; align-items: center; padding: 5px 10px; border-radius: 7px; background: #8a6444; box-shadow: inset 0 0 0 1.5px #6e4b2f; font-size: 13px; }
.ar-table.hist .ar-tr { grid-template-columns: 96px minmax(0, 1.3fr) 1.3fr 60px 64px; }
.ar-tr.head { background: none; box-shadow: none; font-size: 11.5px; color: #ffe2a8; font-weight: 800; padding-top: 0; padding-bottom: 0; }
.ar-tr.me { box-shadow: inset 0 0 0 2px #ffe066; }
.ar-tr .no { font-weight: 900; text-align: center; color: #f3dfb7; }
.ar-tr .no.n1 { color: #ffd23a; } .ar-tr .no.n2 { color: #e8e8e8; } .ar-tr .no.n3 { color: #e0a060; }
.ar-tr .nm { display: flex; flex-direction: column; min-width: 0; }
.ar-tr .nm b, .ar-tr span.nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; }
.ar-tr .nm small { font-size: 11px; color: #ffe2a8; font-weight: 700; }
.ar-tr .pt { font-weight: 900; text-align: right; }
.ar-tr .pt.up { color: #9be36a; } .ar-tr .pt.down { color: #ff8a6a; }
.ar-tr .wl, .ar-tr .tm { text-align: right; font-weight: 700; color: #f3dfb7; font-size: 12px; }
.ar-tr .tm { text-align: left; }
.ar-tr .res { font-weight: 800; font-size: 12.5px; }
.ar-tr .res.win { color: #9be36a; } .ar-tr .res.lose { color: #ff8a6a; } .ar-tr .res.draw { color: #c9d3dc; }
.ar-honor { color: #ffe066; font-size: 14px; }
.ar-items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ar-rewards { display: flex; flex-direction: column; gap: 5px; }
.ar-rw { display: grid; grid-template-columns: 150px 1fr; gap: 10px; align-items: center; padding: 6px 10px; border-radius: 8px; background: #8a6444; box-shadow: inset 0 0 0 1.5px #6e4b2f; }
.ar-rw.cur { box-shadow: inset 0 0 0 2px #ffe066; }
.ar-rwh { display: flex; flex-direction: column; }
.ar-rwh small { font-size: 11px; color: #f3dfb7; font-weight: 700; }
.ar-gifts { display: flex; flex-wrap: wrap; gap: 6px; }
.ar-gift { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px 2px 2px; border-radius: 8px; background: rgba(0,0,0,.2); font-size: 12px; }
.gd-ic.sm { width: 28px; height: 28px; }
@media (max-height: 520px), (max-width: 900px) {
  .ar-hud { top: 42px; padding: 3px 8px; gap: 6px; min-width: 300px; width: min(460px, calc(100vw - 300px)); }
  .ar-side b { font-size: 12px; } .ar-side small { font-size: 9.5px; }
  .ar-hp { height: 11px; } .ar-hp em { font-size: 9px; line-height: 11px; }
  .ar-mid em { font-size: 17px; } .ar-mid { min-width: 48px; }
  .ar-big b { font-size: 60px; } .ar-big small { font-size: 13px; }
  .ar-tier.big { font-size: 16px; } .ar-tier.big .ar-tier-ic { width: 28px; height: 28px; }
  .ar-rating { font-size: 14px; }
  .ar-st b { font-size: 12px; } .ar-st small { font-size: 9.5px; } .ar-st { padding: 2px; }
  .ar-line, .ar-rules { font-size: 11px; } .ar-rules { gap: 1px; padding-left: 14px; }
  .ar-find .pbtn.big { font-size: 14px; padding: 6px; }
  .ar-tr { grid-template-columns: 24px minmax(0, 1.6fr) 1fr 48px 64px; gap: 5px; padding: 3px 6px; font-size: 11.5px; }
  .ar-table.hist .ar-tr { grid-template-columns: 74px minmax(0, 1.2fr) 1.2fr 40px 44px; }
  .ar-tr .nm small { font-size: 9.5px; }
  .ar-items { grid-template-columns: 1fr; }
  .ar-rw { grid-template-columns: 96px 1fr; padding: 4px 6px; gap: 6px; }
  .ar-gift { font-size: 10.5px; } .gd-ic.sm { width: 22px; height: 22px; }
}
.in-arena #minimap { display: none !important; }
@media (max-height: 520px), (max-width: 900px) {
  .ar-hud { width: min(460px, calc(100vw - 380px)); min-width: 280px; }
}
.ar-tr.head span { white-space: nowrap; }

/* ===== Nghề phụ: Nông trại · Câu cá · Nấu ăn · Chế thuốc ===== */
.mi-life { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff3d6'%3E%3Cpath d='M11 21v-7C7 14 4 11 4 6c4 0 7 3 7 7 0-5 3-9 9-9 0 6-4 10-8 10v7z'/%3E%3C/svg%3E"); }
.fish-btn { bottom: 240px; }
.fish-btn.wait { filter: saturate(.6); }
.fish-btn.bite { animation: fishBite .35s infinite alternate; background: radial-gradient(circle at 35% 30%, #c8ff8a, #3a9a1c 70%); }
@keyframes fishBite { from { transform: scale(1); } to { transform: scale(1.14); } }
@media (pointer: coarse), (max-height: 560px) { .fish-btn { right: calc(240px + var(--sr, 0px)) !important; bottom: 196px !important; width: 58px; height: 58px; } }
.lf-farm { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.lf-plots { flex: 1 1 auto; }
.lf-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; flex: 1 1 auto; align-content: start; }
.lf-plot { position: relative; aspect-ratio: 1 / 1; max-height: 118px; border-radius: 10px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  background: radial-gradient(ellipse at 50% 65%, #7a5230 0 55%, #5a3a1e 56% 100%) center / cover no-repeat; box-shadow: inset 0 0 0 2px #3e2814, inset 0 -6px 10px rgba(0,0,0,.3); overflow: hidden; }
.lf-plot.sel { box-shadow: inset 0 0 0 3px #ffe066, 0 0 8px rgba(255,224,102,.6); }
.lf-plot.ripe { box-shadow: inset 0 0 0 2px #9be36a, 0 0 10px rgba(155,227,106,.6); }
.lf-plot.sel.ripe { box-shadow: inset 0 0 0 3px #ffe066, 0 0 10px rgba(155,227,106,.8); }
.lf-plot.locked { filter: grayscale(.7) brightness(.75); }
.lf-lock { position: absolute; inset: 0; display: grid; place-items: center; font-size: 28px; font-weight: 900; color: #fff3d6; }
.lf-empty { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: rgba(255,243,214,.6); }
.lf-crop { width: 78%; height: 72%; display: grid; place-items: end center; font-size: 34px; line-height: 1; background: center bottom / contain no-repeat; margin-bottom: 18px; }
.lf-crop.s0 { font-size: 22px; } .lf-crop.s1 { font-size: 30px; opacity: .85; } .lf-crop.s2 { font-size: 40px; filter: drop-shadow(0 0 6px rgba(255,230,120,.8)); }
.lf-ptime { position: absolute; left: 0; right: 0; bottom: 3px; text-align: center; font-size: 11px; font-weight: 900; color: #fff3d6; text-shadow: 0 1px 2px #000; }
.lf-plot.ripe .lf-ptime { color: #c8ff8a; }
.lf-ptop { display: flex; justify-content: space-between; align-items: baseline; }
.lf-ptop b { font-size: 15px; color: #ffe066; } .lf-lv { font-weight: 900; }
.lf-detail { flex: 1 1 auto; min-height: 0; overflow: auto; }
.lf-sel { display: flex; gap: 10px; align-items: center; }
.lf-sel .lf-crop { width: 56px; height: 56px; margin: 0; flex: 0 0 auto; border-radius: 8px; background-color: #5a3a1e; place-items: center; }
.lf-sel .gd-ic { width: 52px; height: 52px; flex: 0 0 auto; }
.lf-sel .gd-iinfo small { white-space: normal; }
.lf-acts { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.lf-acts .pbtn:not(.xs) { flex: 0 0 auto; }
.lf-step { display: flex; align-items: center; gap: 4px; }
.lf-step b { min-width: 28px; text-align: center; font-size: 15px; }
.lf-need { display: flex; flex-wrap: wrap; gap: 6px; }
.lf-ing { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px 2px 2px; border-radius: 8px; background: rgba(0,0,0,.2); }
.lf-ing small { font-weight: 800; font-size: 12px; } .lf-ing.bad small { color: #ff9a7a; }
.lf-rlist { flex: 1 1 auto; min-height: 0; }
.lf-rec { cursor: pointer; } .lf-rec.sel { box-shadow: inset 0 0 0 2px #ffe066; }
.lf-spots { flex: 1 1 auto; min-height: 0; overflow: auto; }
.lf-spot { padding: 6px 8px; border-radius: 8px; background: rgba(0,0,0,.18); display: flex; flex-direction: column; gap: 5px; }
.lf-spot.here { box-shadow: inset 0 0 0 2px #9be36a; }
.lf-sph { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.lf-sph small { color: #f3dfb7; font-weight: 700; font-size: 11.5px; }
.lf-fishes { display: flex; flex-wrap: wrap; gap: 6px; }
.lf-fish { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 2px; border-radius: 8px; background: rgba(0,0,0,.2); font-size: 11.5px; font-weight: 800; }
.lf-fish.lock { opacity: .5; }
@media (max-height: 520px), (max-width: 900px) {
  .lf-grid { gap: 5px; }
  .lf-plot { max-height: 74px; border-radius: 8px; }
  .lf-crop { font-size: 24px; margin-bottom: 13px; } .lf-crop.s0 { font-size: 16px; } .lf-crop.s2 { font-size: 28px; }
  .lf-ptime { font-size: 9.5px; bottom: 1px; }
  .lf-lock { font-size: 18px; }
  .lf-ptop b { font-size: 12.5px; }
  .lf-sel .lf-crop, .lf-sel .gd-ic { width: 40px; height: 40px; }
  .lf-ing small, .lf-fish { font-size: 10px; }
}
/* Trong ải / đấu trường: bảng trạng thái nằm giữa phía trên → khung máu mục tiêu đặt ngay dưới, không bị che */
.in-dungeon .hud-plate.tplate, .in-arena .hud-plate.tplate { top: 96px !important; }
@media (max-height: 560px), (max-width: 900px) { .in-dungeon .hud-plate.tplate, .in-arena .hud-plate.tplate { top: 74px !important; } }
/* Số cấp của pet trên khung nhỏ: khung bị thu nhỏ nên phóng to riêng huy hiệu cấp cho dễ đọc */
#pet-plate .lv-badge { transform: scale(1.6); transform-origin: center; z-index: 5 !important; }
#pet-plate .lv-badge b { color: #fff !important; text-shadow: 0 1px 2px #000; }
/* Số cấp pet: khung pet bị thu nhỏ còn ~½ nên đặt cỡ chữ cố định đủ to (thắng cỡ chữ theo khung đã tải) */
/* Cùng tỉ lệ chữ / vòng tròn như huy hiệu cấp của nhân vật: số nằm gọn giữa vòng */
#pet-plate.hud-plate .lv-badge b { font-size: 15px !important; line-height: 1 !important; font-weight: 900 !important; -webkit-text-stroke: 0; letter-spacing: -.5px; }
@media (max-height: 560px), (max-width: 900px) { #pet-plate.hud-plate .lv-badge b { font-size: 13px !important; } }
/* Rương đồ: 5 ngăn × 50 ô */
.stor-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin-bottom: 6px; }
.stor-tab { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 3px 2px; border-radius: 7px; border: 2px solid #4a2a10; cursor: pointer;
  background: linear-gradient(180deg, #b07a43, #7a4d22); color: #fff3d6; font-weight: 800; font-size: 12px; text-shadow: 0 1px 2px #000; line-height: 1.15; min-width: 0; }
.stor-tab small { font-size: 10px; font-weight: 700; color: #ffe2a8; }
.stor-tab.active { background: linear-gradient(180deg, #ffe08a, #c98a1c); color: #3a2000; text-shadow: none; }
.stor-tab.active small { color: #5a3410; }
.stor-tab.buy { background: linear-gradient(180deg, #8fd36a, #3f8a2a); }
.stor-tab.lock { opacity: .5; cursor: default; }
@media (max-height: 520px), (max-width: 900px) { .stor-tab { font-size: 10px; padding: 1px; } .stor-tab small { font-size: 8.5px; } .stor-tabs { gap: 3px; margin-bottom: 3px; } }
/* Bảng một ô đất ở Nông trại */
#win-plot .parch { width: min(460px, calc(100vw - 24px)) !important; min-height: 0 !important; height: auto !important; max-height: min(560px, calc(100dvh - 24px)); }
.plot-body { display: flex; flex-direction: column; gap: 8px; color: #fff3d6; text-shadow: 0 1px 2px #3a2210; background: #8a6444; box-shadow: inset 0 0 0 2px #6e4b2f; border-radius: 8px; padding: 10px; overflow: auto; max-height: min(460px, calc(100dvh - 110px)); }
.lf-pophead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lf-pophead b { font-size: 16px; color: #ffe066; }
.lf-pbadge { flex: 1; font-weight: 700; color: #f3dfb7; font-size: 11.5px; }
.lf-popbody { display: flex; flex-direction: column; gap: 6px; }
.lf-spot.lock { opacity: .6; }
@media (max-height: 520px), (max-width: 900px) { .plot-body { padding: 6px; gap: 5px; } .lf-pophead b { font-size: 13px; } }

/* =================== Thông tin vật phẩm chia phần (Mô tả · Tác dụng · Cách dùng / nguồn) =================== */
/* Bảng chi tiết luôn cùng một kích cỡ: phần thân cao cố định, nhiều chữ thì cuộn bên trong */
.item-pop .ip-body { height: 200px; overflow-y: auto; padding-right: 6px; margin-top: 2px; scrollbar-width: thin; scrollbar-color: #b07a3a transparent; }
.ii-about { margin: 0 0 8px; font-style: italic; font-size: 13px; font-weight: 600; line-height: 1.4; color: #7a5530; }
.ii-sec { margin-top: 8px; }
.ii-sec:first-child { margin-top: 0; }
.ii-h { font-size: 11.5px; font-weight: 900; letter-spacing: .6px; text-transform: uppercase; color: #9a5a1e; padding-bottom: 3px; margin-bottom: 4px; border-bottom: 1px dashed rgba(141,90,43,.5); }
.ii-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ii-list li { position: relative; padding-left: 14px; font-size: 13.5px; font-weight: 700; line-height: 1.45; color: #5b3a1c; }
.ii-list li::before { content: ''; position: absolute; left: 2px; top: .62em; width: 5px; height: 5px; transform: rotate(45deg); background: #b07a3a; }
.ii-list li.bad { color: #c0392b; }
.item-pop .ii-stats .ii-list li { color: #2f7a1f !important; font-weight: 800 !important; font-size: 13.5px !important; }
.item-pop .ii-stats .ii-list li::before { background: #2f7a1f; }
@media (max-height: 560px), (max-width: 900px) {
  .item-pop .ip-body { height: 128px; }
  .ii-about { font-size: 11.5px; margin-bottom: 5px; }
  .ii-h { font-size: 10px; margin-bottom: 2px; }
  .ii-list li, .item-pop .ii-stats .ii-list li { font-size: 11.5px !important; line-height: 1.35; }
  .ii-sec { margin-top: 5px; }
}
/* Trên nền tối (Cửa hàng, Chợ) */
.ii-box { margin: 4px 0; }
.ii-box .ii-about { color: #e8d4ad; font-size: 12px; }
.ii-box .ii-h { color: #e2a94e; border-bottom-color: rgba(226,169,78,.35); font-size: 10.5px; }
.ii-box .ii-list li { color: #f5e6c8; font-size: 12px; font-weight: 600; }
.ii-box .ii-list li::before { background: #e2a94e; }

/* =================== Xem người chơi khác: thẻ Nhân vật / Thú cưng =================== */
#win-pinfo .parch { position: relative; }
#win-pinfo .pi-wrap[hidden], #win-pinfo .pi-pets[hidden] { display: none !important; }
#win-pinfo .cw-stage canvas { inset: -6% -4% 0; width: 108%; height: 106%; }
.pi-pets-empty { grid-column: 1 / -1; display: grid; place-items: center; color: #fff3d6; font-weight: 800; background: rgba(90,54,27,.55); border-radius: 12px; }
.pi-plist { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 0; padding: 8px; border-radius: 12px; background: rgba(90,54,27,.55); box-shadow: inset 0 0 0 2px rgba(141,90,43,.6); }
.pi-pcard { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; border: 2px solid #8d5a2b; background: rgba(40,24,12,.55); text-align: left; cursor: pointer; font: inherit; }
.pi-pcard:hover { border-color: #e2a94e; }
.pi-pcard.on { border-color: #ffd36a; background: rgba(120,78,34,.75); box-shadow: 0 0 0 2px rgba(255,211,106,.25); }
.pi-pcv { flex: 0 0 56px; width: 56px; height: 47px; }
.pi-ptx { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pi-ptx b { font-size: 14px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 2px #000; }
.pi-ptx small { font-size: 12px; color: #e8d4ad; font-weight: 700; }
.pi-out { font-style: normal; font-size: 10.5px; font-weight: 800; color: #9dff8a; }
.pi-pmain { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 14px; min-height: 0; padding: 12px; border-radius: 12px; background: rgba(90,54,27,.55); box-shadow: inset 0 0 0 2px rgba(141,90,43,.6); }
.pi-pshow { position: relative; display: grid; place-items: center; border-radius: 50%/42%; background: radial-gradient(ellipse at 50% 60%, rgba(255,240,200,.25), rgba(0,0,0,0) 70%); min-height: 0; }
.pi-pbig { width: 100%; max-width: 320px; aspect-ratio: 4 / 3; height: auto; }
.pi-ptier, .pi-pnat { position: absolute; top: 4px; font-size: 13px; font-weight: 900; padding: 2px 10px; border-radius: 999px; background: rgba(0,0,0,.35); text-shadow: 0 1px 2px #000; }
.pi-ptier { left: 4px; }
.pi-pnat { right: 4px; color: #ffe9b0; }
.pi-pinfo { display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow-y: auto; }
.pi-phead b { display: block; font-size: 19px; font-weight: 900; text-shadow: 0 1px 2px #000; }
.pi-phead small { color: #e8d4ad; font-weight: 700; font-size: 12.5px; }
.pi-pdl { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; font-size: 14px; }
.pi-pdl dt { color: #e8d4ad; font-weight: 700; }
.pi-pdl dd { margin: 0; color: #fff3d6; font-weight: 800; text-align: right; }
.pi-pdl dd.gold { color: #ffd36a; }
.pi-psk-h { font-size: 12px; font-weight: 900; letter-spacing: .5px; text-transform: uppercase; color: #ffd36a; border-bottom: 1px dashed rgba(226,169,78,.45); padding-bottom: 3px; }
.pi-psk { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.pi-sk { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 8px; border: 2px solid transparent; background: rgba(0,0,0,.22); color: #fff3d6; font: inherit; font-size: 12px; font-weight: 700; text-align: left; cursor: pointer; min-width: 0; }
.pi-sk.on { border-color: #ffd36a; }
.pi-sk .pv-sk { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 8px; background-size: cover; cursor: pointer; }
.pi-sk span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pi-psk-tip { margin: 0; min-height: 2.8em; font-size: 12.5px; font-weight: 600; line-height: 1.4; color: #f5e6c8; background: rgba(0,0,0,.2); border-radius: 8px; padding: 6px 8px; }
@media (max-height: 560px), (max-width: 900px) {
  #win-pinfo { background: rgba(0,0,0,.28); }
  #win-pinfo .parch { margin-left: 92px; padding: 30px 10px 10px !important; }
  #win-pinfo .parch .side-tabs { left: -4px; top: 24px; transform: translateX(-100%); flex-direction: column; gap: 6px; }
  #win-pinfo .side-tabs button { border-radius: 16px 0 0 16px; border: 2px solid #8d5a2b; border-right: 0; padding: 7px 10px 7px 12px; font-size: 12px; text-align: left; box-shadow: -2px 2px 4px rgba(0,0,0,.35); }
  .pi-plist { padding: 5px; gap: 5px; }
  .pi-pcard { padding: 4px 5px; gap: 5px; }
  .pi-pcv { flex-basis: 40px; width: 40px; height: 34px; }
  .pi-ptx b { font-size: 12px; } .pi-ptx small { font-size: 10.5px; }
  .pi-pmain { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 8px; padding: 8px; }
  .pi-ptier, .pi-pnat { font-size: 10.5px; padding: 1px 6px; }
  .pi-phead b { font-size: 14px; } .pi-phead small { font-size: 10.5px; }
  .pi-pdl { font-size: 11.5px; gap: 2px 8px; }
  .pi-psk { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
  .pi-sk { font-size: 10.5px; padding: 3px 4px; }
  .pi-sk .pv-sk { flex-basis: 26px; width: 26px; height: 26px; }
  .pi-psk-tip { font-size: 10.5px; padding: 4px 6px; }
  .pi-pinfo { gap: 5px; }
}

/* Cẩm nang → Lịch boss & phần thưởng */
.hb-card { margin: 0 0 10px; padding: 10px 12px; border-radius: 10px; background: rgba(40,24,12,.45); box-shadow: inset 0 0 0 2px rgba(226,169,78,.35); }
.hb-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.hb-name { font-size: 16px; color: #ffe066; }
.hb-lv { font-size: 12px; font-weight: 900; color: #1a1006; background: #e2a94e; border-radius: 999px; padding: 1px 8px; text-shadow: none; }
.hb-map { margin-left: auto; font-size: 12.5px; color: #e8d4ad; font-weight: 700; }
.hb-times { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-bottom: 6px; }
.hb-t { font-size: 12px; font-weight: 800; padding: 1px 7px; border-radius: 6px; background: rgba(0,0,0,.3); color: #fff3d6; }
.hb-now { margin-left: 6px; font-size: 12px; font-weight: 800; color: #bfe3a4; }
.hb-now.on { color: #ff8a5c; }
.hb-dl { display: grid; grid-template-columns: minmax(96px, 26%) 1fr; gap: 3px 10px; margin: 0; font-size: 13px; }
.hb-dl dt { color: #ffd36a; font-weight: 800; }
.hb-dl dd { margin: 0; color: #f5e6c8; font-weight: 600; line-height: 1.4; }
@media (max-height: 560px), (max-width: 900px) {
  .hb-card { padding: 7px 9px; margin-bottom: 7px; }
  .hb-name { font-size: 13.5px; } .hb-map, .hb-t, .hb-now { font-size: 10.5px; }
  .hb-dl { font-size: 11px; grid-template-columns: minmax(80px, 28%) 1fr; }
}

/* =================== Chọn nhân vật (giống mục "Bốn người bạn" ở trang chủ) =================== */
#screen-job { --jc: #b9442f; background: #140a05; overflow: hidden; }
.js-wrap { --jc: #b9442f; height: 100vh; height: 100dvh; display: flex; flex-direction: column; padding: 14px clamp(14px, 3vw, 40px) 16px;
  background: radial-gradient(ellipse 45% 60% at 50% 60%, color-mix(in srgb, var(--jc) 26%, transparent), transparent 70%), linear-gradient(180deg, #140a05, #26100a 55%, #140a05);
  transition: background .4s; font-family: 'Be Vietnam Pro', 'Segoe UI', system-ui, sans-serif; color: #f6ead2; }
.js-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.js-back { justify-self: start; padding: 8px 14px; border-radius: 10px; border: 1px solid rgba(232,183,101,.45); background: rgba(20,10,5,.6); color: #ffdc8f; font-family: inherit; font-weight: 700; font-size: 14px; line-height: 1; cursor: pointer; }
.js-back[hidden] { visibility: hidden; display: block !important; }
.js-title { text-align: center; }
.js-kicker { display: inline-flex; align-items: center; gap: 10px; color: #e8b765; font-weight: 800; letter-spacing: 4px; text-transform: uppercase; font-size: 12px; }
.js-kicker::before, .js-kicker::after { content: ''; width: 28px; height: 1px; background: linear-gradient(90deg, transparent, #e8b765); }
.js-kicker::after { transform: scaleX(-1); }
.js-title h1 { margin: 4px 0 0; font: 800 clamp(22px, 3.2vw, 38px)/1.1 'Playfair Display', Georgia, serif; color: #fff3d6; }
.js-char { justify-self: end; color: #c9b48f; font-weight: 700; font-size: 14px; }
.js-body { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 110px minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(14px, 2.4vw, 30px); align-items: center; max-width: 1180px; width: 100%; margin: 6px auto 0; }
.js-tabs { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.js-tabs button { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 0; border: 0; background: none; color: #c9b48f; font-family: inherit; font-weight: 800; font-size: 14px; line-height: 1; cursor: pointer; }
.js-tabs .face { width: 76px; height: 76px; border-radius: 50%; box-shadow: 0 0 0 3px rgba(232,183,101,.3); transition: box-shadow .2s, transform .2s; }
.js-tabs button:hover .face { transform: scale(1.05); }
.js-tabs button.on { color: #ffdc8f; }
.js-tabs button.on .face { box-shadow: 0 0 0 3px #ffdc8f, 0 0 0 7px color-mix(in srgb, var(--jc) 55%, transparent), 0 0 22px color-mix(in srgb, var(--jc) 70%, transparent); }
.js-stage { position: relative; height: 100%; min-height: 0; display: flex; justify-content: center; align-items: flex-end; }
.js-ring { position: absolute; left: 50%; bottom: 3%; width: min(82%, 70vh); aspect-ratio: 1; transform: translateX(-50%); border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--jc) 42%, transparent), transparent 66%); box-shadow: inset 0 0 0 2px rgba(232,183,101,.22), 0 0 0 16px rgba(232,183,101,.05); }
#job-art { position: relative; height: 100%; max-height: 100%; width: auto; object-fit: contain; filter: drop-shadow(0 18px 24px rgba(0,0,0,.6)); }
#job-art.pop { animation: jsPop .45s cubic-bezier(.2,1.4,.4,1); }
@keyframes jsPop { from { opacity: 0; transform: translateY(24px) scale(.96); } }
#job-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#job-canvas[hidden] { display: none; }
.js-info { min-height: 0; max-height: 100%; overflow-y: auto; padding-right: 4px; display: flex; flex-direction: column; align-items: flex-start; scrollbar-width: thin; }
.js-role { font-size: 12.5px; font-weight: 800; letter-spacing: .5px; color: #fff3d6; padding: 5px 12px; border-radius: 999px; background: color-mix(in srgb, var(--jc) 75%, #000); }
.js-name { margin: 8px 0 0; font: 900 clamp(40px, 6vw, 72px)/1 'Playfair Display', Georgia, serif; color: #ffdc8f; text-shadow: 0 4px 0 #4a1d06, 0 10px 24px rgba(0,0,0,.5); }
.js-lore { margin: 12px 0 0; font-size: 15.5px; line-height: 1.55; color: #f6ead2; }
.js-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.js-passive, .js-weapon { font-weight: 700; font-size: 13.5px; padding: 5px 11px; border-radius: 8px; }
.js-passive { color: #bfeaa4; background: rgba(60,110,40,.25); box-shadow: inset 0 0 0 1px rgba(150,220,120,.35); }
.js-weapon { color: #ffdc8f; background: rgba(120,80,20,.25); box-shadow: inset 0 0 0 1px rgba(232,183,101,.35); }
.js-h { margin-top: 18px; font-size: 12px; font-weight: 800; letter-spacing: 3px; text-transform: uppercase; color: #e8b765; }
.js-skills { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.js-skills .sk { width: 62px; height: 62px; border-radius: 14px; border: 0; padding: 0; cursor: pointer; color: #fff; font-weight: 800; font-family: inherit;
  box-shadow: 0 0 0 2px rgba(232,183,101,.45), 0 6px 12px rgba(0,0,0,.45); transition: transform .15s, box-shadow .15s; }
.js-skills .sk:hover, .js-skills .sk.on { transform: translateY(-3px); box-shadow: 0 0 0 3px #ffdc8f, 0 0 18px rgba(255,210,120,.55); }
.js-skills .sk.ult { box-shadow: 0 0 0 3px #ffd23a, 0 0 0 5px #7a4a00, 0 0 16px rgba(255,200,40,.6); }
.js-skdesc { align-self: stretch; margin-top: 10px; min-height: 86px; padding: 10px 14px; border-radius: 12px; background: rgba(44,24,12,.78); box-shadow: 0 0 0 1px rgba(232,183,101,.28); }
.js-skdesc b { color: #ffdc8f; font-size: 15px; }
.js-skdesc small { margin-left: 8px; color: #c9b48f; font-weight: 600; }
.js-skdesc p { margin: 5px 0 0; font-size: 14px; line-height: 1.45; }
.js-skdesc .meta { display: block; margin-top: 4px; font-size: 12px; color: #c9b48f; }
#screen-job .error { margin: 8px 0 0; }
.js-go { margin-top: 16px; padding: 14px 40px; border-radius: 14px; border: 2px solid #7a4a12; cursor: pointer; font-family: inherit; font-weight: 800; font-size: 18px; line-height: 1; text-transform: uppercase; letter-spacing: .4px;
  color: #3a1a04; background: linear-gradient(180deg, #fff1bf 0%, #f2c46c 45%, #c98a2c 100%); box-shadow: 0 0 0 2px rgba(255,220,143,.35), 0 8px 26px rgba(232,160,60,.45), inset 0 2px 0 rgba(255,255,255,.7); }
.js-go:hover { filter: brightness(1.08); transform: translateY(-1px); }
/* Điện thoại xoay ngang / màn thấp */
@media (max-height: 560px), (max-width: 900px) {
  .js-wrap { padding: 8px 12px 10px; }
  .js-kicker { display: none; }
  .js-title h1 { font-size: 18px; margin: 0; }
  .js-back { padding: 6px 10px; font-size: 12px; }
  .js-char { font-size: 12px; }
  .js-body { grid-template-columns: 70px minmax(0, .85fr) minmax(0, 1.15fr); gap: 10px; margin-top: 4px; }
  .js-tabs { gap: 6px; }
  .js-tabs .face { width: 46px; height: 46px; }
  .js-tabs button { font-size: 11px; gap: 3px; }
  .js-name { font-size: 34px; margin-top: 5px; }
  .js-role { font-size: 10.5px; padding: 3px 9px; }
  .js-lore { font-size: 12px; margin-top: 6px; line-height: 1.4; }
  .js-tags { margin-top: 6px; gap: 5px; }
  .js-passive, .js-weapon { font-size: 11px; padding: 3px 8px; }
  .js-h { margin-top: 8px; font-size: 10px; }
  .js-skills { gap: 6px; margin-top: 5px; }
  .js-skills .sk { width: 40px; height: 40px; border-radius: 10px; }
  .js-skdesc { min-height: 0; margin-top: 6px; padding: 6px 10px; }
  .js-skdesc b { font-size: 12.5px; } .js-skdesc p { font-size: 11.5px; margin-top: 2px; } .js-skdesc .meta { font-size: 10.5px; margin-top: 2px; }
  .js-go { margin-top: 8px; padding: 9px 26px; font-size: 14px; }
}
/* Điện thoại dọc */
@media (max-width: 600px) and (orientation: portrait) {
  .js-body { grid-template-columns: 1fr; grid-template-rows: auto minmax(160px, 34vh) auto; align-items: stretch; overflow-y: auto; }
  .js-tabs { flex-direction: row; justify-content: center; }
  .js-info { align-items: center; text-align: center; overflow: visible; max-height: none; }
  .js-skdesc { text-align: left; }
}

/* Hàng nút trong bảng vật phẩm: các nút chia đều bề ngang, không bao giờ tràn ra ngoài khung (cả khi dùng ảnh nút đã tải) */
.item-pop .ip-actions { display: flex !important; flex-wrap: nowrap; justify-content: stretch !important; gap: 6px !important; width: 100%; }
.item-pop .ip-actions .pbtn { flex: 1 1 0; min-width: 0 !important; max-width: 140px; padding-left: 4px !important; padding-right: 4px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-pop .ip-actions .pbtn[hidden] { display: none !important; }
.item-pop { overflow: hidden; }
/* Ô kỹ năng đầu tiên không bị cắt viền sáng */
.js-info { padding: 6px 8px 6px 6px; }
.js-skills { padding: 4px 2px; }
.js-go.pbtn { min-width: 220px; min-height: 52px; }
/* =================== Đặt tên (bước 2) =================== */
#screen-create { display: block; padding: 0 !important; }
#screen-create[hidden] { display: none !important; }
.nm-body { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(16px, 3vw, 40px); align-items: center; max-width: 1100px; width: 100%; margin: 6px auto 0; }
.nm-stage { height: 100%; }
#nm-art { position: relative; height: 100%; max-height: 100%; width: auto; object-fit: contain; filter: drop-shadow(0 18px 24px rgba(0,0,0,.6)); animation: jsPop .45s cubic-bezier(.2,1.4,.4,1); }
.nm-card { display: flex; flex-direction: column; align-items: flex-start; padding: clamp(18px, 3vw, 30px); border-radius: 18px;
  background: linear-gradient(180deg, rgba(60,32,14,.85), rgba(30,16,8,.9)); box-shadow: 0 0 0 1px rgba(232,183,101,.35), 0 18px 40px rgba(0,0,0,.45); }
.nm-job { margin: 8px 0 0; font: 900 clamp(38px, 5vw, 60px)/1 'Playfair Display', Georgia, serif; color: #ffdc8f; text-shadow: 0 4px 0 #4a1d06, 0 10px 24px rgba(0,0,0,.5); }
.nm-lead { margin: 12px 0 0; font-size: 15px; color: #f6ead2; line-height: 1.5; }
.nm-field { position: relative; display: block; width: 100%; margin-top: 18px; }
.nm-field input { width: 100%; height: 58px; padding: 0 110px 0 18px; border-radius: 14px; border: 2px solid rgba(232,183,101,.55); background: #120a05; color: #fff3d6;
  font: 800 22px/1 'Be Vietnam Pro', system-ui, sans-serif; letter-spacing: .5px; outline: none; box-shadow: inset 0 3px 8px rgba(0,0,0,.5); }
.nm-field input:focus { border-color: #ffdc8f; box-shadow: inset 0 3px 8px rgba(0,0,0,.5), 0 0 0 4px rgba(255,220,143,.18); }
.nm-field input::placeholder { color: #6e5a3e; font-weight: 600; }
.nm-dice { position: absolute; right: 8px; top: 8px; bottom: 8px; padding: 0 14px; border-radius: 10px; border: 1px solid rgba(232,183,101,.5); background: rgba(232,183,101,.15);
  color: #ffdc8f; font-family: inherit; font-weight: 800; font-size: 14px; cursor: pointer; }
.nm-dice:hover { background: rgba(232,183,101,.28); }
.nm-hint { margin: 8px 0 0; font-size: 12.5px; color: #c9b48f; }
#screen-create .error { margin: 8px 0 0; }
.nm-card .js-go { margin-top: 16px; align-self: stretch; }
@media (max-height: 560px), (max-width: 900px) {
  .nm-body { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 12px; margin-top: 2px; }
  .nm-card { padding: 12px 16px; }
  .nm-job { font-size: 32px; margin-top: 4px; }
  .nm-lead { font-size: 12px; margin-top: 6px; }
  .nm-field { margin-top: 10px; }
  .nm-field input { height: 44px; font-size: 17px; padding-right: 90px; }
  .nm-dice { font-size: 12px; top: 6px; bottom: 6px; }
  .nm-hint { font-size: 11px; margin-top: 4px; }
  .nm-card .js-go { margin-top: 8px; }
  .js-go.pbtn { min-height: 40px; min-width: 160px; }
}
@media (max-width: 600px) and (orientation: portrait) {
  .nm-body { grid-template-columns: 1fr; grid-template-rows: minmax(160px, 36vh) auto; }
}

/* =================== Màn hình chờ (tải game, sang bản đồ) =================== */
#screen-loading { display: block !important; padding: 0 !important; background: #140a05; }
#screen-loading[hidden] { display: none !important; }
.ld-wrap { position: relative; width: 100%; height: 100vh; height: 100dvh; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(ellipse 60% 50% at 50% 45%, rgba(168,35,27,.35), transparent 70%), radial-gradient(circle at 50% 120%, rgba(232,183,101,.25), transparent 55%), linear-gradient(180deg, #1d0d06, #140a05); }
.ld-glow { position: absolute; width: min(70vmin, 620px); aspect-ratio: 1; border-radius: 50%; border: 2px solid rgba(232,183,101,.18);
  box-shadow: 0 0 0 26px rgba(232,183,101,.04), 0 0 0 60px rgba(232,183,101,.025), inset 0 0 80px rgba(232,183,101,.08); animation: ldSpin 30s linear infinite;
  background: repeating-conic-gradient(from 0deg, rgba(232,183,101,.07) 0 6deg, transparent 6deg 15deg); -webkit-mask: radial-gradient(circle, transparent 54%, #000 55%, #000 70%, transparent 71%); mask: radial-gradient(circle, transparent 54%, #000 55%, #000 70%, transparent 71%); }
@keyframes ldSpin { to { transform: rotate(360deg); } }
.ld-inner { position: relative; z-index: 1; width: min(520px, 86vw); text-align: center; }
.ld-drum { position: relative; width: 74px; height: 74px; margin: 0 auto 12px; }
.ld-drum i { position: absolute; inset: 0; border-radius: 50%; border: 3px solid transparent; border-top-color: #ffdc8f; animation: ldSpin 1.4s linear infinite; }
.ld-drum i:nth-child(2) { inset: 10px; border-top-color: #e8b765; animation-duration: 1.9s; animation-direction: reverse; }
.ld-drum i:nth-child(3) { inset: 22px; border: 0; background: radial-gradient(circle, #ffdc8f 0 22%, #c98a2c 23% 40%, transparent 41%); animation: ldPulse 1.2s ease-in-out infinite; }
@keyframes ldPulse { 50% { transform: scale(1.15); opacity: .8; } }
.ld-drum.sm { width: 40px; height: 40px; margin: 0 0 0 0; flex: 0 0 40px; }
.ld-drum.sm i:nth-child(2) { inset: 6px; } .ld-drum.sm i:nth-child(3) { inset: 12px; }
.ld-logo span, .ld-logo em { display: block; font-style: normal; padding: .2em .1em .14em; margin: -.2em 0 -.14em;
  background: linear-gradient(180deg, #fff8dc 10%, #ffd98a 45%, #d9952f 75%, #9a5a12); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 #5a2208) drop-shadow(0 8px 18px rgba(0,0,0,.55)); }
.ld-logo span { font: 900 clamp(40px, 8vw, 72px)/1 'Playfair Display', Georgia, serif; -webkit-text-stroke: 1.2px #4a1d06; }
.ld-logo em { font: 800 clamp(13px, 2.2vw, 20px)/1 'Be Vietnam Pro', system-ui, sans-serif; letter-spacing: .55em; margin-left: .55em; text-transform: uppercase; }
.ld-bar { position: relative; height: 14px; margin: 26px 0 0; border-radius: 999px; background: rgba(0,0,0,.55); box-shadow: inset 0 2px 4px rgba(0,0,0,.6), 0 0 0 2px rgba(232,183,101,.45); overflow: hidden; }
.ld-bar i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; transition: width .25s ease;
  background: linear-gradient(180deg, #fff1bf, #f2c46c 45%, #c98a2c); box-shadow: 0 0 12px rgba(255,200,90,.6); }
.ld-bar i::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); background-size: 60px 100%; animation: ldShine 1.1s linear infinite; }
@keyframes ldShine { from { background-position: -60px 0; } to { background-position: 200% 0; } }
.ld-row { display: flex; justify-content: space-between; margin-top: 8px; font: 700 13px/1.2 'Be Vietnam Pro', system-ui, sans-serif; color: #e8d4ad; }
.ld-row b { color: #ffdc8f; }
.ld-tip { margin: 22px auto 0; max-width: 460px; min-height: 2.8em; font: 600 14px/1.45 'Be Vietnam Pro', system-ui, sans-serif; color: #c9b48f; font-style: italic; }
@media (max-height: 500px) {
  .ld-drum { width: 50px; height: 50px; margin-bottom: 6px; }
  .ld-logo span { font-size: 40px; } .ld-bar { margin-top: 14px; } .ld-tip { margin-top: 12px; font-size: 12px; }
}
/* Sang bản đồ mới */
.map-loading { position: fixed; inset: 0; z-index: 9000; display: grid; place-items: center; background: rgba(20,10,5,.82); backdrop-filter: blur(3px); }
.map-loading[hidden] { display: none; }
.ml-box { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px 14px; width: min(420px, 84vw); padding: 16px 20px; border-radius: 16px;
  background: linear-gradient(180deg, rgba(60,32,14,.95), rgba(30,16,8,.95)); box-shadow: 0 0 0 1px rgba(232,183,101,.45), 0 18px 40px rgba(0,0,0,.5); color: #fff3d6; font-family: 'Be Vietnam Pro', system-ui, sans-serif; }
.ml-box b { grid-column: 2 / 4; font-size: 15px; }
.ml-box .ld-bar { grid-column: 1 / 3; margin: 0; height: 10px; }
.ml-box small { color: #ffdc8f; font-weight: 800; }

/* =================== Chợ (4 thẻ: Chợ · Bày bán · Sạp của tôi · Lịch sử) =================== */
#win-market .parch { width: min(1060px, calc(100vw - 16px)); height: min(640px, calc(100dvh - 16px)); min-height: 0 !important; display: flex; flex-direction: column; }
.mk2-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.mk2-bar[hidden] { display: none; }
.mk2-cats { flex-wrap: wrap; gap: 4px; }
.mk2-cats button { padding: 6px 12px; font-size: 13px; }
.mk2-tools { display: flex; gap: 6px; }
.mk2-tools[hidden] { display: none; }
.mk2-search, .mk2-sel { height: 34px; border-radius: 8px; border: 2px solid #6e4b2f; background: #f3e2c2; color: #4a2a10; font: inherit; font-size: 13px; font-weight: 700; padding: 0 8px; }
.mk2-search { width: 170px; }
.mk2-guide { margin: 8px 2px 6px; font-size: 12.5px; color: #6b4320; font-weight: 700; }
.mk2-grid { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; align-content: start; padding: 4px 4px 8px; }
.mk2-grid.hist { grid-template-columns: 1fr; gap: 4px; }
.mk2-card { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; border: 2px solid #b48a55; background: linear-gradient(180deg, #fbefd4, #efd8ad);
  text-align: left; font: inherit; cursor: pointer; min-width: 0; box-shadow: 0 2px 4px rgba(90,54,27,.2); transition: transform .12s, border-color .12s; }
.mk2-card:hover { transform: translateY(-2px); border-color: #8d5a2b; }
.mk2-card.on { border-color: #e2a94e; box-shadow: 0 0 0 3px rgba(226,169,78,.45); }
.mk2-card.mine { background: linear-gradient(180deg, #f1f7dd, #dfeab8); }
.mk2-ic { position: relative; flex: 0 0 60px; width: 60px; height: 60px; border-radius: 10px; background: #8a6444 center / 82% no-repeat; box-shadow: inset 0 0 0 2px rgba(74,42,16,.5); display: grid; place-items: center; overflow: hidden; }
.mk2-ic .mk-petcv { width: 60px; height: 52px; }
.mk2-ic .q { position: absolute; right: 3px; bottom: 1px; font-size: 12px; font-weight: 900; color: #fff; text-shadow: 0 1px 2px #000, 0 0 2px #000; }
.mk2-ic .pl { position: absolute; right: 3px; top: 1px; }
.mk2-tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mk2-tx b { font-size: 14px; color: #5a2f0e; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk2-tx small { font-size: 11.5px; color: #8a6440; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk2-tx .price { display: inline-flex; align-items: center; gap: 4px; font-weight: 900; color: #2f6e1f; font-size: 14px; }
.mk2-tx .mk-chip { align-self: flex-start; font-style: normal; font-size: 10.5px; font-weight: 800; padding: 1px 6px; border-radius: 6px; background: #2f8a23; color: #fff; }
.mk2-h { display: grid; grid-template-columns: 90px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 10px; background: rgba(255,244,220,.75); box-shadow: inset 0 0 0 1px rgba(141,90,43,.35); font-size: 13px; }
.mk2-hk { font-weight: 900; text-align: center; padding: 3px 0; border-radius: 6px; color: #fff; background: #8d5a2b; font-size: 12px; }
.mk2-h.k-buy .mk2-hk { background: #2f78b0; } .mk2-h.k-sold .mk2-hk { background: #2f8a23; } .mk2-h.k-list .mk2-hk { background: #b07a3a; } .mk2-h.k-cancel .mk2-hk { background: #8a3b32; }
.mk2-hd { color: #4a2a10; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.mk2-ht { color: #8a6440; font-weight: 700; font-size: 12px; white-space: nowrap; }
/* Bảng chi tiết (giữa màn hình) */
.mk2-modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(0,0,0,.45); padding: 10px; }
.mk2-modal[hidden] { display: none; }
.mk2-pop.item-pop { position: relative !important; width: min(440px, 96vw) !important; max-height: calc(100dvh - 20px); display: flex; flex-direction: column; margin: 0 !important; transform: none !important;
  padding: 14px 16px 12px !important; border-radius: 12px !important; background: linear-gradient(180deg, #f6e4bd, #ecd29f) !important; border: 2px solid #8d5a2b !important; box-shadow: 0 10px 30px rgba(0,0,0,.5) !important; overflow: hidden; }
.mk2-pop.pet { width: min(1040px, 98vw) !important; height: min(620px, calc(100dvh - 20px)); }
.mk2-pop .ip-body { flex: 0 0 auto; }
.mk2-pet { flex: 1 1 auto; min-height: 0; margin-top: 4px; }
.mk2-pet[hidden], .mk2-pop .ip-body[hidden] { display: none !important; }
.mk2-deal { margin-top: 8px; padding-top: 8px; border-top: 1px dashed rgba(141,90,43,.55); display: flex; flex-direction: column; gap: 6px; }
.mk2-pop.pet .mk2-deal { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
.mk2-pop .mk-sellform { display: flex; flex-direction: column; gap: 6px; }
.mk2-pop.pet .mk-sellform { flex-direction: row; flex-wrap: wrap; gap: 6px 14px; }
.mk2-pop .mk-sellform[hidden] { display: none; }
.mk2-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 800; color: #6b4320; }
.mk2-row[hidden] { display: none; }
.mk2-step { display: flex; align-items: center; gap: 4px; }
.mk2-step button { min-width: 32px; height: 30px; border-radius: 7px; border: 2px solid #4a2a10; background: #8a5a2b; color: #fff; font-weight: 900; font: inherit; cursor: pointer; }
.mk2-step b { min-width: 34px; text-align: center; color: #4a2a10; }
.mk2-pop .mk-curseg { display: flex; gap: 4px; }
.mk2-pop .mk-curseg button { padding: 5px 14px; font-size: 12.5px; }
.mk2-price input { width: 160px; height: 34px; border-radius: 8px; border: 2px solid #4a2a10; background: #fff8e6; color: #4a2a10; font: inherit; font-weight: 900; font-size: 16px; text-align: right; padding: 0 10px; }
.mk2-pop .mk-info { display: flex; flex-direction: column; gap: 3px; }
.mk2-pop .mk-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13.5px; font-weight: 700; color: #6b4320; padding: 3px 8px; border-radius: 6px; background: rgba(255,248,230,.6); }
.mk2-pop .mk-line b { display: flex; align-items: center; gap: 4px; color: #4a2a10 !important; }
.mk2-pop .mk-line.em b { color: #2f6e1f !important; font-size: 15px; }
.mk2-pop .mk-line.bad b { color: #c0392b !important; }
.mk2-acts { margin-top: 10px; }
/* Thẻ bên của Chợ trên màn nhỏ: giống bảng Nhân vật */
@media (max-height: 560px), (max-width: 900px) {
  #win-market { background: rgba(0,0,0,.28); }
  #win-market .parch { width: min(680px, calc(100vw - 150px)); height: calc(100dvh - 40px); margin-left: 92px; padding: 30px 10px 10px !important; }
  #win-market .parch .side-tabs { left: -4px; top: 24px; transform: translateX(-100%); flex-direction: column; gap: 6px; }
  #win-market .side-tabs button { border-radius: 16px 0 0 16px; border: 2px solid #8d5a2b; border-right: 0; padding: 7px 10px 7px 12px; font-size: 12px; text-align: left; box-shadow: -2px 2px 4px rgba(0,0,0,.35); }
  .mk2-cats { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
  .mk2-cats button { padding: 4px 8px; font-size: 11px; white-space: nowrap; }
  .mk2-search, .mk2-sel { height: 28px; font-size: 11px; padding: 0 5px; }
  .mk2-search { width: 110px; }
  .mk2-guide { display: none; }
  .mk2-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; }
  .mk2-card { padding: 5px 7px; gap: 7px; }
  .mk2-ic { flex-basis: 44px; width: 44px; height: 44px; }
  .mk2-ic .mk-petcv { width: 44px; height: 38px; }
  .mk2-tx b { font-size: 12px; } .mk2-tx small { font-size: 10.5px; } .mk2-tx .price { font-size: 12px; }
  .mk2-h { grid-template-columns: 70px minmax(0, 1fr); font-size: 11.5px; padding: 6px 8px; }
  .mk2-ht { grid-column: 2; }
  .mk2-pop.item-pop { padding: 10px 12px 9px !important; }
  .mk2-pop.pet { height: calc(100dvh - 20px); }
  .mk2-row { font-size: 11.5px; }
  .mk2-price input { height: 28px; font-size: 14px; width: 130px; }
  .mk2-pop .mk-line { font-size: 11.5px; padding: 2px 6px; }
}
.mk2-tx .mk-chip { position: static; }

/* Đồng hồ đếm ngược bảo trì */
#maint-badge { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 100px); left: 50%; transform: translateX(-50%); z-index: 60; pointer-events: none;
  padding: 5px 14px; border-radius: 999px; background: rgba(28, 18, 8, .86); border: 1px solid #c9a24a; color: #ffe6a8; font: 600 13px/1.2 system-ui, sans-serif; letter-spacing: .2px; box-shadow: 0 4px 14px rgba(0,0,0,.4); white-space: nowrap; }
#maint-badge.soon { border-color: #ff7a59; color: #ffd2c4; animation: mtPulse 1s ease-in-out infinite; }
@keyframes mtPulse { 50% { box-shadow: 0 0 0 4px rgba(255,122,89,.25), 0 4px 14px rgba(0,0,0,.4); } }

/* Chiến trường PK */
#pk-hud { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 134px); left: 50%; transform: translateX(-50%); z-index: 59; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 14px 6px; border-radius: 10px;
  background: linear-gradient(180deg, rgba(90, 16, 12, .9), rgba(46, 8, 6, .9)); border: 1px solid #e0603c; color: #ffd9c8; font: 600 12px/1.25 system-ui, sans-serif; box-shadow: 0 4px 14px rgba(0,0,0,.45); white-space: nowrap; }
#pk-hud .pk-zone { font-size: 13px; color: #ffb38f; letter-spacing: .3px; }
#pk-hud .pk-score { font-weight: 500; opacity: .9; }
#pk-hud.safe { background: linear-gradient(180deg, rgba(18, 60, 40, .88), rgba(8, 34, 22, .88)); border-color: #59c48a; color: #d6f5e2; }
#pk-hud.safe .pk-zone { color: #9fe8bd; }
@media (max-width: 760px), (max-height: 500px) { #maint-badge { top: calc(env(safe-area-inset-top, 0px) + 84px); } #pk-hud { top: calc(env(safe-area-inset-top, 0px) + 112px); font-size: 11px; padding: 4px 10px; } #pk-hud .pk-zone { font-size: 12px; } }

/* Số giây hồi bình máu / phép trên ô ghim */
.quickslot .cdn { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; font: italic 900 15px/1 "Segoe UI Black", "Arial Black", system-ui, sans-serif; color: #fff; text-shadow: 0 0 3px #000, 0 1px 0 #000, 0 0 6px #000; }
.quickslot .cdn:empty { display: none; }

/* Bảng thông tin món trong cửa hàng */
#sp-modal { z-index: 62; }
.sp-total b { display: inline-flex; align-items: center; gap: 4px; font-size: 15px; color: #7a3f12; font-weight: 900; }
.sp-total b.bad, .sp-total.bad b { color: #c0281a; }

/* Nút chế độ PK */
.pk-pill { padding: 0 11px !important; min-width: 40px; justify-content: center; font-size: 15px !important; }
.pk-pill.on { background: linear-gradient(180deg, #c8402a, #7a1a10) !important; border-color: #3a0a04 !important; color: #fff !important; font-size: 13px !important; box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 0 8px rgba(255,80,40,.6) !important; }
#pk-hud.jail { background: linear-gradient(180deg, rgba(40,36,44,.92), rgba(18,16,20,.92)); border-color: #9a8a9a; color: #e8dfe8; }
#pk-hud.jail .pk-zone { color: #ffcf8a; }
.top-right .pk-pill { flex: 0 0 auto !important; width: auto !important; max-width: none !important; min-width: 44px !important; padding: 0 10px !important; }
