:root {
  /* ===== 10.7.3 BẢNG MÀU KIẾM HIỆP CỔ PHONG ===== */
  --font: "Palatino Linotype", "Book Antiqua", Palatino, "Noto Serif", "Times New Roman", Georgia, serif;
  /* chữ có chân, cổ điển */
  --font-title: "Palatino Linotype", "Book Antiqua", Palatino, "Noto Serif", Georgia, serif;
  /* nền: gỗ trầm · giấy cũ (ngà) · sương mù */
  --wood: #21170f;
  --wood2: #2d2016;
  --wood3: #3b2a1d;
  --wood4: #4c3727;
  --parch: #e9dcbd;
  --parch2: #d8c69c;
  --parch3: #bfa87a;
  --mist: #8f897b;
  /* viền: vàng đồng · nâu cháy */
  --bronze: #b38f55;
  --bronze2: #8a6b3c;
  --bronze3: #5e4626;
  --burnt: #6e3f22;
  /* nhấn: đỏ mận (bùa chú / lệnh bài) · ngọc bích */
  --plum: #7c2226;
  --plum2: #5a161a;
  --jade: #3f8a70;
  --jade2: #2b6450;
  /* chữ: mực tàu · nâu sẫm · vàng nhạt (trên nền tối) */
  --ink: #1c140c;
  --umber: #4a3320;
  --text: #ecdfc2;
  --dim: #a8977a;
  /* tên cũ dùng khắp game -> trỏ sang bảng màu mới */
  --bg: var(--wood);
  --panel: var(--wood2);
  --panel2: var(--wood3);
  --line: #4e3b27;
  --line2: var(--bronze3);
  --gold: #d6b46e;
  --gold2: var(--bronze2);
  --red: #9a2e24;
  --hp: #a23028;
  --mp: #3f5f86;
  --xp: #b8924a;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent
}

html,
body {
  height: 100%;
  background: #0a0704;
  color: var(--text);
  font: 14px/1.4 var(--font);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer
}

button[disabled] {
  opacity: .4;
  cursor: default
}

.hidden {
  display: none !important
}

.dim {
  color: var(--dim)
}

.small {
  font-size: 12px
}

#app {
  position: relative;
  height: 100dvh;
  width: min(100vw, calc(100dvh*9/16));
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 40px #000
}

#top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(6px + var(--safe-t)) 10px 6px;
  background: linear-gradient(#2d2015, #1b130c);
  border-bottom: 1px solid var(--gold2);
  z-index: 3
}

.lvbox {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  border: 2px solid var(--gold2);
  background: var(--pl, none) center 12%/auto 135% no-repeat, radial-gradient(#473425, #160f0a);
  image-rendering: pixelated;
  flex: none;
  overflow: visible
}

.lvbox #lv {
  position: absolute;
  right: -6px;
  bottom: -6px;
  min-width: 22px;
  height: 22px;
  padding: 0 4px;
  border-radius: 11px;
  border: 2px solid var(--gold2);
  background: #160f0a;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--gold);
  font-size: 12px
}

.topmid {
  flex: 1;
  min-width: 0
}

.topmid .row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 3px
}

.topmid b {
  color: var(--gold);
  font-family: var(--font)
}

#stageLbl {
  color: var(--dim)
}

.gold {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  color: var(--gold);
  font-size: 13px
}

.coin {
  width: 14px;
  height: 10px;
  border-radius: 50% 50% 45% 45%;
  background: radial-gradient(circle at 40% 35%, #dbc680, #a7792b);
  box-shadow: 0 0 1px 2px #0009
}

.bar {
  position: relative;
  height: 12px;
  background: #0b0805;
  border: 1px solid var(--line2);
  border-radius: 3px;
  overflow: hidden
}

.bar i {
  position: absolute;
  inset: 0;
  width: 0;
  transition: width .15s linear
}

.bar span {
  position: absolute;
  inset: 0;
  font-size: 9.5px;
  line-height: 11px;
  text-align: center;
  color: #f5eddb;
  text-shadow: 0 0 2px #000, 0 0 2px #000
}

.bar.xp i {
  background: linear-gradient(#e0bd55, #8f6a1c)
}

.bar.hp i {
  background: linear-gradient(#e0503f, #7d1a12)
}

.bar.mp i {
  background: linear-gradient(#688ab1, #354d68)
}

#battle {
  position: relative;
  flex: 0 0 46%;
  overflow: hidden;
  background: #281e16
}

#bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: saturate(.85) brightness(.8);
  transition: background-image .6s
}

#battle::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: radial-gradient(ellipse at 50% 55%, transparent 60%, #0007 100%)
}

#arena {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%
}

.enh {
  color: #688ab1;
  font-size: .85em;
  text-shadow: 0 1px 2px #0009
}

/* phan thuong (rewards.js) */
#giftBtn {
  position: relative;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--gold2);
  background: radial-gradient(#3a2f1c, #120d06);
  font-size: 16px;
  line-height: 30px
}

#giftBtn.on::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #e0402a;
  box-shadow: 0 0 1px 2px #0009;
  animation: gpulse 1.2s infinite
}

@keyframes gpulse {
  50% {
    transform: scale(1.3)
  }
}

.days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin: 8px 0
}

.day {
  padding: 6px 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel2);
  text-align: center;
  font-size: 11px
}

.day b {
  display: block;
  color: var(--gold);
  font-size: 11px
}

.day small {
  display: block;
  color: var(--dim);
  font-size: 9.5px;
  line-height: 1.2
}

.day.cur {
  border-color: var(--gold);
  box-shadow: 0 1px 2px #0009
}

.day.got {
  opacity: .5
}

.day.got b::after {
  content: " ✓"
}

.qrow {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  margin: 4px 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel2)
}

.qrow small {
  color: var(--dim);
  font-size: 11px
}

.qrow span small {
  display: block
}

.qrow.lock {
  opacity: .5
}

#hud {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 6px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 8px;
  pointer-events: none
}

#mainSk {
  grid-column: 1/3;
  font-size: 11px;
  color: var(--gold);
  text-shadow: 0 0 3px #000
}

#panel {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: var(--panel);
  border-top: 1px solid var(--gold2)
}

.tab {
  height: 100%;
  overflow-y: auto;
  padding: 10px 10px 16px
}

h3 {
  font: 400 14px var(--font);
  color: var(--gold);
  margin: 12px 0 6px;
  display: flex;
  justify-content: space-between;
  align-items: baseline
}

h3 small {
  font: 12px var(--font);
  color: var(--dim)
}

.card {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 8px
}

.row {
  display: flex;
  gap: 6px;
  align-items: center
}

.btn {
  background: linear-gradient(#573f2b, #352619);
  border: 1px solid var(--line2);
  border-radius: 5px;
  padding: 7px 12px;
  color: var(--text)
}

.btn:active {
  transform: translateY(1px)
}

.btn.sm {
  padding: 4px 10px;
  font-size: 12px
}

.btn.on {
  border-color: var(--gold);
  color: var(--gold)
}

.btn.red {
  background: linear-gradient(#5a2a22, #34160f)
}

.btnrow {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
  justify-content: center
}

.btnrow .btn {
  flex: 1;
  max-width: 200px
}

.sp {
  flex: 1
}

.boss {
  color: #e0a179
}

.up {
  color: #7ebea0
}

.bad {
  color: #e08b7b
}

.stagectl {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px
}

.log {
  max-height: 150px;
  overflow: auto;
  font-size: 12px;
  background: #130e09;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px
}

.log div {
  padding: 1px 0;
  border-bottom: 1px solid #271b12
}

.zlist {
  display: grid;
  gap: 4px
}

.zrow {
  display: flex;
  justify-content: space-between;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel2);
  text-align: left
}

.zrow span {
  color: var(--dim);
  font-size: 12px
}

.zrow.cur {
  border-color: var(--gold);
  box-shadow: inset 3px 0 0 var(--gold)
}

.zrow.lock b {
  color: var(--dim)
}

.eqgrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 8px
}

.slot {
  aspect-ratio: 1;
  border: 1px dashed var(--line2);
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 11px;
  color: var(--dim);
  text-align: center
}

.attr {
  display: grid;
  grid-template-columns: 1fr auto 64px;
  align-items: center;
  gap: 8px;
  padding: 3px 0
}

.attr b {
  color: var(--gold)
}

.plus {
  width: 28px;
  height: 26px;
  border-radius: 5px;
  border: 1px solid var(--gold2);
  color: var(--gold);
  font-weight: 700;
  background: #3e2d1f
}

.stats {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 10px;
  font-size: 13px
}

.stats span:nth-child(even) {
  color: var(--gold);
  text-align: right
}

.invbar {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px
}

select,
textarea {
  background: #130e09;
  color: var(--text);
  border: 1px solid var(--line2);
  border-radius: 5px;
  padding: 4px;
  font: 12px var(--font);
  width: 100%
}

.invbar select {
  width: auto
}

.invgrid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px
}

.it {
  position: relative;
  aspect-ratio: 1;
  width: 100%;
  border: 1px solid var(--line2);
  border-radius: 5px;
  background: #160f0a;
  display: grid;
  place-items: center;
  overflow: hidden
}

.it img {
  max-width: 88%;
  max-height: 88%;
  image-rendering: auto
}

.it i {
  position: absolute;
  right: 2px;
  bottom: 0;
  font: 10px var(--font);
  color: var(--dim)
}

.it em {
  position: absolute;
  left: 2px;
  top: 0;
  font: 400 11px var(--font);
  color: #7ebea0
}

.it.r1 {
  border-color: #688ab1;
  box-shadow: inset 0 0 8px #0008
}

.it.r2 {
  border-color: #ddc16c;
  box-shadow: inset 0 0 8px #0008
}

.it.r3 {
  border-color: #b57be0;
  box-shadow: inset 0 0 10px #0008
}

.it.bad {
  filter: grayscale(.8)
}

.it.bad i {
  color: #e07b7b
}

.skl {
  display: grid;
  grid-template-columns: 40px 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel2);
  margin-bottom: 5px
}

.skl.lock {
  opacity: .5
}

.skl.main {
  border-color: var(--gold);
  box-shadow: inset 3px 0 0 var(--gold)
}

.skl .sic {
  width: 40px;
  height: 40px;
  border-radius: 5px;
  border: 1px solid var(--line2)
}

.skl .info small {
  display: block;
  color: var(--dim);
  font-size: 11px
}

.skl .lvl {
  color: var(--gold);
  font-size: 12px
}

.tag {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  background: #463323;
  color: var(--dim)
}

.tag.attack {
  background: #4a2a1f;
  color: #e09e7b
}

#tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: #130e09;
  border-top: 1px solid var(--gold2);
  padding-bottom: var(--safe-b)
}

#tabs button {
  position: relative;
  padding: 10px 2px;
  font-size: 12px;
  color: var(--dim)
}

#tabs button.on {
  color: var(--gold);
  box-shadow: inset 0 2px 0 var(--gold)
}

.dot {
  position: absolute;
  top: 6px;
  right: 12%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #df7575;
  display: none
}

.dot.on {
  display: block
}

#modal {
  position: absolute;
  inset: 0;
  background: #000b;
  display: grid;
  place-items: center;
  z-index: 10;
  padding: 12px
}

.mbox {
  position: relative;
  width: 100%;
  max-height: 92%;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--gold2);
  border-radius: 8px;
  padding: 14px
}

.mx {
  position: absolute;
  right: 8px;
  top: 6px;
  color: var(--dim);
  font-size: 16px
}

.desc {
  color: var(--dim);
  font-size: 13px;
  margin: 4px 0 8px
}

.idet {
  display: flex;
  gap: 10px;
  align-items: center
}

.idet .pic {
  width: 56px;
  height: 56px;
  border: 1px solid var(--line2);
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: #160f0a
}

.idet .pic img {
  max-width: 90%;
  max-height: 90%
}

.idet h4 {
  font: 400 15px var(--font)
}

.sl {
  margin: 8px 0;
  font-size: 13px
}

.sl .b {
  color: var(--text)
}

.sl .m {
  color: #688ab1
}

.sl .h {
  color: #6d756f
}

.sl .h.on {
  color: #7ebea0
}

.sl .r {
  color: var(--dim);
  font-size: 12px
}

.it b.s5 {
  position: absolute;
  left: 3px;
  bottom: 3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #000
}

.cmp {
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding-top: 8px;
  opacity: .85
}

.slotlist {
  display: grid;
  gap: 8px
}

.slotrow {
  display: grid;
  grid-template-columns: 44px 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line2);
  border-radius: 6px;
  background: var(--panel2)
}

.slotrow.empty,
.slotrow.del {
  grid-template-columns: 1fr auto auto
}

.slotrow img {
  width: 44px;
  height: 54px;
  object-fit: contain
}

.slotrow small {
  display: block;
  color: var(--dim);
  font-size: 11px
}

.slotrow.del {
  border-color: #c44
}

.facpick {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px
}

.facpick button {
  display: grid;
  grid-template-columns: 48px 1fr;
  grid-template-rows: auto auto;
  column-gap: 8px;
  align-items: center;
  text-align: left;
  padding: 6px;
  border: 1px solid var(--line2);
  border-radius: 6px;
  background: var(--panel2);
  box-shadow: inset 3px 0 0 var(--c)
}

.facpick img {
  grid-row: 1/3;
  width: 48px;
  height: 60px;
  object-fit: contain
}

.facpick b {
  font-family: var(--font);
  color: var(--gold)
}

.facpick small {
  color: var(--c)
}

#toast {
  position: absolute;
  left: 50%;
  bottom: 70px;
  transform: translateX(-50%);
  background: #000d;
  border: 1px solid var(--gold2);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
  z-index: 11
}

#toast.on {
  opacity: 1
}

.lootf {
  display: grid;
  gap: 6px;
  font-size: 13px
}

.lootf select {
  width: auto;
  display: inline-block
}

.dtabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin: 6px 0
}

.dtabs button {
  padding: 4px 10px;
  border: 1px solid var(--line2);
  border-radius: 14px;
  font-size: 12px
}

.dtabs button.on {
  border-color: var(--gold);
  color: var(--gold)
}

.shoplist {
  display: grid;
  gap: 4px;
  max-height: 55vh;
  overflow: auto
}

.shoprow {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 8px;
  align-items: center;
  text-align: left;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel2)
}

.shoprow img {
  width: 36px;
  height: 36px;
  object-fit: contain
}

.shoprow small {
  display: block;
  color: var(--dim);
  font-size: 11px
}

.shoprow em {
  font-style: normal;
  color: var(--gold);
  font-size: 12px
}

.shoprow.bad {
  opacity: .55
}

.shoprow.own {
  border-color: var(--gold2)
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px
}

.chip2 {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border: 1px solid var(--line2);
  border-radius: 12px;
  font-size: 12px;
  background: #130e09
}

/* dieu khien: nut che do, o ky nang, thuoc, the do dia phu */
.chip {
  position: absolute;
  right: 8px;
  top: 34px;
  z-index: 4;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 12px;
  border: 1px solid var(--gold2);
  background: #000a;
  color: var(--gold)
}

.chip.on {
  background: #3a2a10;
  box-shadow: 0 1px 2px #0009
}

#pad {
  position: absolute;
  right: 8px;
  left: auto;
  bottom: 8px;
  width: 152px;
  height: auto;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  pointer-events: none
}

.pbtn {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--gold2);
  background: #160f0a center/cover no-repeat;
  overflow: hidden;
  pointer-events: auto;
  touch-action: none;
  box-shadow: 0 2px 6px #000b
}

.pbtn i {
  position: absolute;
  inset: 0;
  background: center/cover no-repeat
}

.pbtn b {
  position: absolute;
  right: 3px;
  bottom: 0;
  font-size: 9px;
  color: #f5eddb;
  text-shadow: 0 0 2px #000
}

.pbtn.empty {
  border-style: dashed;
  opacity: .5
}

.pbtn.cur {
  border-color: #e0c87b;
  box-shadow: 0 1px 2px #0009
}

.pbtn:active {
  transform: scale(.92)
}

.pbtn.pot {
  width: 38px;
  height: 38px;
  margin-top: 6px
}

.pbtn.pot span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 400 10px/1.05 var(--font);
  color: #f5eddb;
  text-shadow: 0 0 3px #000;
  text-align: center
}

.pbtn.hp {
  background: radial-gradient(#b3342a, #3a0c08)
}

.pbtn.mp {
  background: radial-gradient(#5e82ac, #1a2532)
}

.pbtn.tp {
  background: radial-gradient(#c9a23a, #3a2a08)
}

.pbtn .cd {
  position: absolute;
  inset: 0;
  background: conic-gradient(#000b var(--p, 0%), transparent 0);
  z-index: 1
}

#townBar {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 64px;
  z-index: 5;
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 6px 8px;
  background: #000c;
  border: 1px solid var(--gold2);
  border-radius: 6px
}

#townBar b {
  flex: 1;
  color: var(--gold);
  font-family: var(--font)
}

.skl .slots {
  display: flex;
  gap: 3px;
  grid-column: 2/5
}

.skl .slots button {
  font-size: 10px;
  padding: 1px 6px;
  border: 1px solid var(--line2);
  border-radius: 4px
}

.skl .slots button.on {
  border-color: var(--gold);
  color: var(--gold)
}

/* ======== Giao dien goc JX (tools/extract_ui.py -> game/ui/*.png). Thieu anh thi giu kieu cu ben tren. ======== */
.mbox {
  border: 14px solid transparent;
  border-image: url(ui/panel.png) 16 / 14px stretch;
  background-clip: padding-box
}

.btn {
  background-image: url(ui/btn.png);
  background-size: 400% 100%;
  background-position: 0 0;
  border-color: #6d5a33;
  text-shadow: 0 1px 2px #000
}

.btn:hover {
  background-position: 33.333% 0
}

.btn:active {
  background-position: 66.666% 0
}

.btn[disabled] {
  background-position: 100% 0
}

.bar.hp i {
  background: url(ui/bar_hp.png) 0 0 / 100% 100%, linear-gradient(#e0503f, #7d1a12)
}

.bar.mp i {
  background: url(ui/bar_mp.png) 0 0 / 100% 100%, linear-gradient(#688ab1, #354d68)
}

.bar.xp i {
  background: url(ui/bar_xp.png) 0 0 / 100% 100%, linear-gradient(#e0bd55, #8f6a1c)
}

#hud .bar {
  border-image: url(ui/bar_panel.png) 3 / 3px stretch
}

#tabs {
  background: url(ui/tabbar.png) center / 100% 100%, linear-gradient(#2d2015, #1b130c)
}

#tabs button {
  position: relative;
  padding: 25px 2px 5px;
  font-size: 11px;
  line-height: 1.1
}

#tabs button::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 2px;
  width: 20px;
  height: 20px;
  margin-left: -10px;
  background-size: 300% 100%;
  background-position: 0 0
}

#tabs button.on::before {
  background-position: 50% 0
}

#tabs button[data-t=log]::before {
  background-image: url(ui/ic_log.png)
}

#tabs button[data-t=char]::before {
  background-image: url(ui/ic_char.png)
}

#tabs button[data-t=skill]::before {
  background-image: url(ui/ic_skill.png)
}

#tabs button[data-t=inv]::before {
  background-image: url(ui/ic_item.png)
}

#tabs button[data-t=more]::before {
  background-image: url(ui/ic_more.png)
}

#pad .pbtn.sk {
  background: url(ui/slot.png) center / 100% 100%, radial-gradient(#3b2c20, #130e09)
}

.facpick button {
  position: relative
}

.s5b {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 2px #0008, 0 0 6px var(--c)
}

/* cham mau he ngu hanh */
.facpick button:hover .s5b {
  box-shadow: 0 0 0 2px #0008, 0 0 12px var(--c)
}

/* ======== Chieu cao that cua man hinh (Safari / thanh cong cu dien thoai) + che do thu gon ======== */
html,
body {
  overscroll-behavior: none
}

#app {
  height: 100vh;
  height: var(--app-h, 100dvh)
}

#tabs {
  position: relative;
  z-index: 6;
  touch-action: manipulation
}

#tabs button {
  touch-action: manipulation
}

#compactBtn {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--gold2);
  background: radial-gradient(#3b2c20, #130e09);
  color: var(--gold);
  font-size: 15px;
  line-height: 30px
}

body.compact #panel,
body.compact #tabs {
  display: none !important
}

body.compact #battle {
  flex: 1 1 auto
}

body.compact #compactBtn {
  background: radial-gradient(#4a3a18, #1a1206);
  box-shadow: 0 1px 2px #0009
}

/* ==== Man hinh ngang (landscape): san dau toan man hinh, bang thong tin ben phai ==== */
@media (orientation:landscape) {
  #app {
    width: 100vw;
    display: grid;
    grid-template-columns: 1fr min(38vw, 340px);
    grid-template-rows: auto 1fr auto;
    grid-template-areas: "top top" "battle panel" "tabs panel"
  }

  #top {
    grid-area: top
  }

  #battle {
    grid-area: battle
  }

  #panel {
    grid-area: panel;
    border-top: 0;
    border-left: 1px solid var(--gold2)
  }

  #tabs {
    grid-area: tabs
  }

  #pad {
    bottom: 52px
  }

  body.compact #app {
    grid-template-columns: 1fr;
    grid-template-areas: "top" "battle" "tabs"
  }
}

/* 10.7.3: chữ có chân cổ điển cho toàn bộ giao diện (--font) */
html,
body,
button,
input,
select,
textarea {
  font-family: var(--font)
}

b,
strong,
h1,
h2,
h3,
h4,
th {
  font-weight: 400
}

/* nut doi chuot / joystick: chi hien tren may tinh man hinh ngang */
#inBtn {
  display: none;
  position: absolute;
  right: 8px;
  top: 70px;
  z-index: 4
}

body.deskland #inBtn {
  display: block
}

.cmp2 {
  margin: 6px 0;
  padding: 6px 8px;
  border: 1px solid var(--line2);
  border-radius: 6px;
  background: #130e09
}

.cmpv {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 12px
}

.cp {
  color: #7ebea0
}

.cn {
  color: #e0867b
}

.reqbad {
  margin-top: 6px;
  color: #e0897b;
  font-size: 12px
}

.reqnote {
  margin-top: 6px;
  color: #e8c66a;
  font-size: 12px
}

#rotBtn {
  right: auto;
  left: 8px;
  top: auto;
  bottom: 132px
}

#inBtn {
  right: auto !important;
  left: 8px;
  top: auto !important;
  bottom: 188px
}

/* giao dien di dong nho di 20%: ung dung rong / cao 1,25 lan roi thu nho 0,8 (uiScale trong render.js) */
body.mob #app {
  transform: scale(.8);
  transform-origin: 0 0;
  width: 125vw !important;
  height: calc(var(--app-h, 100dvh)*1.25) !important;
  margin: 0 !important;
  max-width: none
}

/* cong / rut diem / thong tin */
.pm {
  display: inline-flex;
  gap: 4px
}

.pm button {
  width: 28px
}

.minus {
  width: 28px;
  height: 26px;
  border-radius: 5px;
  border: 1px solid #a55;
  color: #e07b7b;
  background: #2e2222;
  font-weight: 700
}

.minus:disabled {
  opacity: .35
}

.skinfo {
  width: 28px;
  height: 26px;
  border-radius: 5px;
  border: 1px solid var(--line2);
  color: var(--dim);
  background: #2c2016;
  font-style: italic
}

.skl .slots {
  grid-column: 2/5
}

/* co chu chinh duoc (the Khac > Tro nang): ap dung cho bang thong tin, the, hop thoai */
#panel,
#modal .mbox,
#tabs,
#toast {
  zoom: var(--fs, 1)
}

.todo {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
  padding: 6px 8px;
  border: 1px solid var(--gold2);
  border-radius: 6px;
  background: #261b12
}

.todo b {
  color: var(--gold);
  font-size: 12px;
  margin-right: 2px
}

.todochip {
  cursor: pointer;
  border: 1px solid var(--gold2);
  background: #3a2819;
  color: var(--text)
}

.codex .card.lock {
  opacity: .55
}

.mbox:focus {
  outline: none
}

button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 1px
}

/* ======== Bo cuc kieu ban moi: thanh tren co HP / MP / EXP, cong tac Auto, cum chieu vong cung, luoi nut tinh nang, thanh tab nut vang ======== */
#top {
  gap: 8px;
  padding: calc(6px + var(--safe-t)) 8px 6px;
  background: linear-gradient(#231911, #130d08)
}

.lvbox {
  width: 50px;
  height: 50px;
  border-radius: 4px
}

.lvbox #lv {
  left: -5px;
  right: auto;
  bottom: -7px;
  min-width: 26px;
  height: 26px;
  border-radius: 13px;
  font-size: 12px;
  background: radial-gradient(#3a2f1c, #160f0a)
}

.topmid .row {
  align-items: center;
  gap: 10px;
  margin-bottom: 5px;
  font-size: 13px
}

.topmid .row .gold {
  font-size: 14px;
  flex: none
}

#stageLbl {
  color: var(--text);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0
}

.coin {
  width: 18px;
  height: 11px;
  border-radius: 3px 3px 50% 50%;
  background: radial-gradient(circle at 50% 20%, #e0cd7b, #e0b040 45%, #8a5a12)
}

.bars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px
}

.bars .bar {
  height: 16px;
  border: 1px solid #6d5a33;
  border-radius: 2px;
  background: #100c08
}

.bars .bar em {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 1;
  padding: 0 5px;
  font: 400 9px/14px var(--font);
  font-style: normal;
  color: #f5eddb;
  background: #000a;
  border-right: 1px solid #6d5a33
}

.bars .bar span {
  padding-left: 22px;
  font-size: 10px;
  line-height: 14px
}

.bars .bar.xp span {
  padding-left: 26px
}

#giftBtn,
#compactBtn {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  border: 1px solid var(--gold2);
  background: radial-gradient(#3a2f1c, #120d06);
  font-size: 18px;
  line-height: 38px;
  color: var(--gold)
}

#giftBtn.on::after {
  top: -3px;
  right: -3px
}

@media (orientation:portrait) {
  .bars {
    grid-template-columns: 1fr 1fr
  }

  .bars .bar.xp {
    grid-column: 1/3;
    height: 12px
  }

  .bars .bar.xp em,
  .bars .bar.xp span {
    line-height: 10px
  }
}

/* san dau: cai dat + cong tac Auto goc phai tren (ban do nho ngay ben duoi) */
#autoWrap {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
  display: flex;
  gap: 6px;
  align-items: center
}

#setBtn {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 15px;
  border: 1px solid var(--gold2);
  background: linear-gradient(#2c2117, #110c08);
  box-shadow: inset 0 1px 0 #f5eddb14, 0 2px 6px #0008;
  color: var(--gold);
  transition: border-color .15s, box-shadow .15s
}

#setBtn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linejoin: round;
  transition: transform .4s
}

#setBtn:hover {
  border-color: var(--gold);
  box-shadow: inset 0 1px 0 #f5eddb14, 0 1px 2px #0009
}

#setBtn:hover svg {
  transform: rotate(60deg)
}

#setBtn:active svg {
  transform: rotate(90deg) scale(.92)
}

#ctrlBtn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 5px 0 12px;
  border-radius: 15px;
  border: 1px solid var(--gold2);
  background: #000b;
  color: var(--gold);
  font-size: 12px
}

#ctrlBtn i {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: #3a3f3c;
  box-shadow: inset 0 1px 3px #000;
  transition: background .15s
}

#ctrlBtn i::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #bbb;
  box-shadow: 0 1px 2px #000;
  transition: transform .15s
}

#ctrlBtn.on i {
  background: linear-gradient(#d4c086, #a8864a)
}

#ctrlBtn.on i::after {
  transform: translateX(16px);
  background: #f5eddb
}

.chip {
  font-size: 12px;
  padding: 4px 11px;
  border-radius: 14px;
  background: #000b
}

/* cum chieu: 1 2 3 / 4 HP MP / . . Ve thanh */
#pad {
  right: 10px;
  bottom: 12px;
  width: auto;
  display: grid;
  grid-template-columns: repeat(3, 50px);
  gap: 9px;
  justify-items: center;
  align-items: center
}

.pbtn {
  overflow: visible
}

.pbtn i,
.pbtn .cd {
  border-radius: 50%
}

#pad .pbtn.sk {
  width: 50px;
  height: 50px;
  border: 2px solid #c8a45a;
  box-shadow: 0 0 0 2px #0008, 0 3px 8px #000
}

#pad .pbtn.sk b {
  right: -5px;
  top: -8px;
  bottom: auto;
  font-size: 11px
}

#pad .pbtn.cur {
  border-color: #e0c87b;
  box-shadow: 0 1px 2px #0009
}

#pad .pbtn.pot {
  width: 44px;
  height: 44px;
  margin: 0;
  border: 2px solid #c8a45a
}

#pad .pbtn.hp {
  background: url(img/i/pot0.png) center 35%/auto 62% no-repeat, radial-gradient(#b3342a, #3a0c08)
}

#pad .pbtn.mp {
  background: url(img/i/pot5.png) center 35%/auto 62% no-repeat, radial-gradient(#5e82ac, #1a2532)
}

#pad .pbtn.hp span,
#pad .pbtn.mp span {
  place-items: end center;
  padding-bottom: 1px;
  font-size: 9px
}

.pbtn .cnt {
  position: absolute;
  right: -7px;
  top: -7px;
  z-index: 2;
  min-width: 18px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #b02a1e;
  color: #f5eddb;
  font: 400 10px/16px var(--font);
  text-align: center;
  box-shadow: 0 0 0 1px #000a
}

.pbtn.mp .cnt {
  background: #436082
}

.pbtn .cnt:empty {
  display: none
}

#pad #bTp {
  grid-column: 3;
  width: 46px;
  height: 46px
}

@media (orientation:landscape) {
  #pad {
    bottom: 12px
  }
}

/* the Giang ho: luoi nut tinh nang */
.feats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-bottom: 10px
}

.feat {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 58px;
  padding: 5px 1px 4px;
  border: 1px solid #5a4533;
  border-radius: 6px;
  background: linear-gradient(#32251a, #1d150e);
  box-shadow: inset 0 1px 0 #f5eddb12
}

.feat:hover {
  border-color: var(--gold2)
}

.feat:active {
  transform: translateY(1px)
}

.feat i {
  font-style: normal;
  font-size: 22px;
  line-height: 1;
  filter: drop-shadow(0 1px 2px #000)
}

.feat span {
  font-size: 10px;
  line-height: 1.15;
  color: var(--text);
  text-align: center
}

.feat em {
  position: absolute;
  top: -6px;
  right: -4px;
  min-width: 18px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #c8321f;
  color: #f5eddb;
  font: 400 10px/16px var(--font);
  font-style: normal;
  box-shadow: 0 0 0 1px #000a
}

.stagectl {
  padding: 10px
}

.stagectl .stn {
  display: block;
  font-size: 15px;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 3px
}

.stagectl small {
  font-size: 12px;
  line-height: 1.5
}

.stagectl .row {
  flex: none;
  gap: 6px
}

.btn.arr {
  padding: 6px 9px
}

.btn.push {
  min-width: 54px;
  padding: 6px 10px;
  font-size: 13px;
  line-height: 1.15;
  border-color: var(--gold)
}

.btn.push.on {
  color: var(--gold);
  box-shadow: 0 1px 2px #0009
}

.log {
  max-height: 150px;
  border-color: #5a4533;
  background: #110c08
}

.zrow {
  padding: 10px 12px;
  background: linear-gradient(#281d14, #1e160f)
}

.zrow b {
  color: var(--text)
}

.zrow.lock b {
  color: var(--dim)
}

/* thanh tab: the dang mo la nut vang */
#tabs {
  gap: 6px;
  padding: 6px 6px calc(6px + var(--safe-b));
  background: linear-gradient(#231911, #130d08)
}

#tabs button {
  padding: 28px 2px 5px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 12px;
  color: var(--dim)
}

#tabs button::before {
  top: 4px;
  width: 24px;
  height: 24px;
  margin-left: -12px
}

#tabs button.on {
  color: #e0c67b;
  box-shadow: inset 0 1px 0 #f5eddb66, 0 1px 2px #0009;
  background: linear-gradient(#c9a24f, #6e4f1c);
  border-color: #d4c086;
  text-shadow: 0 1px 2px #000
}

/* the Khac: hang nhan + o nhap, nut nau vien vang theo do dai chu (khong gian het hang), o nhap toi bo goc */
#t-more h3 {
  font-size: 15px;
  margin: 14px 0 8px
}

#t-more h3:first-child {
  margin-top: 4px
}

#t-more .card {
  padding: 12px;
  border-color: #483627;
  background: #211811
}

#t-more .card p.small {
  margin: 4px 0 8px;
  line-height: 1.5
}

.frow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 14px
}

.frow label {
  flex: none
}

.frow small {
  font-size: 12px
}

#t-more input[type=text],
#t-more select,
#t-more textarea {
  background: #130e09;
  color: var(--text);
  border: 1px solid #5a4533;
  border-radius: 6px;
  font: 14px var(--font)
}

#t-more input[type=text] {
  flex: 1;
  min-width: 0;
  padding: 7px 10px
}

#t-more select {
  width: auto;
  padding: 6px 8px
}

#t-more select:disabled {
  opacity: .6
}

#t-more textarea {
  margin-top: 10px;
  padding: 8px 10px;
  resize: vertical
}

#t-more input[type=text]:focus,
#t-more textarea:focus,
#t-more select:focus {
  outline: none;
  border-color: var(--gold2)
}

#t-more .btnrow {
  justify-content: flex-start;
  margin-top: 4px
}

#t-more .btnrow .btn {
  flex: none;
  max-width: none
}

#t-more .btn {
  padding: 7px 16px;
  border: 1px solid #c8a45a;
  border-radius: 7px;
  background: linear-gradient(#7a5528, #4a3015 55%, #3a2410);
  color: #f6ead0;
  font-size: 14px;
  box-shadow: inset 0 1px 0 #f5eddb30, 0 2px 4px #0008
}

#t-more .btn:hover {
  background: linear-gradient(#8a6230, #55381a 55%, #422a12)
}

#t-more .btn.red {
  border-color: #c8644a;
  background: linear-gradient(#7a3022, #4a1a10 55%, #3a140c)
}

/* Thiet lap Auto (autocfg.js): khung vien vang, cong tac gat, nut chon pham vi, nut chinh % */
h3.aut {
  justify-content: center;
  font-size: 17px;
  margin: 0 0 10px
}

.ausec {
  border: 1px solid #8a6d35;
  border-radius: 8px;
  padding: 8px 12px 10px;
  margin-bottom: 10px;
  background: #19120c
}

.ausec h4 {
  font: 400 14px var(--font);
  color: var(--gold);
  padding-bottom: 4px;
  margin-bottom: 6px;
  border-bottom: 1px solid #4a3d22
}

.aurow {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 31px;
  font-size: 14px
}

.aurow>span {
  flex: 1;
  min-width: 0
}

.aunote {
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--dim);
  line-height: 1.45
}

.sw {
  position: relative;
  flex: none;
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: #413327;
  border: 1px solid #47504c;
  box-shadow: inset 0 1px 3px #000
}

.sw i {
  position: absolute;
  left: 2px;
  top: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #c9cbc9;
  box-shadow: 0 1px 2px #000;
  transition: transform .15s
}

.sw.on {
  background: linear-gradient(#c9a24f, #7a5a22);
  border-color: #e6c67a
}

.sw.on i {
  transform: translateX(20px);
  background: #e0c77b
}

.sw.sm {
  width: 36px;
  height: 20px
}

.sw.sm i {
  width: 14px;
  height: 14px
}

.sw.sm.on i {
  transform: translateX(16px)
}

.auseg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  flex: 0 1 66%
}

.auseg button {
  padding: 6px 4px;
  border: 1px solid #6d5a33;
  border-radius: 6px;
  background: linear-gradient(#2c2118, #1e1610);
  font-size: 13px
}

.auseg button.on {
  border-color: #d4c086;
  color: #e0c67b;
  background: linear-gradient(#5a4520, #2e220e);
  box-shadow: 0 1px 2px #0009
}

.aust {
  display: flex;
  align-items: center;
  flex: 0 0 46%;
  max-width: 220px;
  height: 28px;
  border: 1px solid #6d5a33;
  border-radius: 6px;
  background: #110c08;
  overflow: hidden
}

.aust b {
  flex: 1;
  text-align: center;
  font-size: 13px
}

.aust button {
  width: 28px;
  height: 100%;
  background: linear-gradient(#2a2416, #16120a);
  color: var(--gold);
  font-size: 16px
}

.auskills {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 6px 0 2px
}

.ausk {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center
}

.ausk .ic {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #c8a45a;
  background: #160f0a center/cover no-repeat;
  box-shadow: 0 2px 6px #000
}

.ausk.empty .ic {
  border-style: dashed;
  opacity: .5
}

.ausk small {
  font-size: 10.5px;
  line-height: 1.2;
  color: var(--dim);
  min-height: 2.4em
}

.aufoot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px
}

.aufoot small {
  color: var(--dim);
  font-size: 12px
}

/* Cua so Nhan vat (charModal): tieu de giua co gach hai ben, hinh nhan vat ben trai, tiem nang / chi so ben phai; hep thi xep doc */
.mbox:has(.cwin) {
  width: min(100%, 660px);
  container-type: inline-size
}

.mbox:has(.cwin) .mx {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid #d8d0bc;
  color: #f5eddb;
  font-size: 13px;
  line-height: 22px;
  top: 4px;
  right: 6px;
  background: #3a3f3c
}

.cwt {
  justify-content: center;
  align-items: center;
  gap: 14px;
  font-size: 16px;
  color: var(--text);
  margin: 0 34px 10px
}

.cwt::before,
.cwt::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, #a8864a)
}

.cwt::after {
  background: linear-gradient(90deg, #a8864a, transparent)
}

.cbody {
  display: grid;
  grid-template-columns: 262px 1fr;
  gap: 12px;
  align-items: start
}

@container (max-width:560px) {
  .cbody {
    grid-template-columns: 1fr
  }

  .cleft {
    justify-self: center
  }
}

.cleft {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px
}

.cname {
  color: var(--gold);
  font-size: 14px
}

.doll {
  display: grid;
  grid-template-columns: 56px 74px 56px;
  grid-template-rows: repeat(12, 21px);
  gap: 4px 16px;
  padding: 14px 16px;
  border: 1px solid #544131;
  border-radius: 3px;
  background: radial-gradient(ellipse at 50% 40%, #271c14, #120d09);
  grid-template-areas: ". helm amulet" "cuff helm amulet" "cuff helm weapon" "cuff armor weapon" "ring1 armor weapon" "ring1 armor weapon" "ring2 armor weapon" "ring2 belt boot" "pendant belt boot" "pendant horse boot" "pendant horse ." "pendant horse ."
}

.dslot {
  position: relative;
  display: grid;
  place-items: center;
  border: 1px solid #534030;
  border-radius: 3px;
  background: #16100b;
  box-shadow: inset 0 0 8px #000;
  font-size: 11px;
  color: #5d6862;
  text-align: center;
  overflow: hidden
}

.ds-cuff {
  grid-area: cuff
}

.ds-ring1 {
  grid-area: ring1
}

.ds-ring2 {
  grid-area: ring2
}

.ds-pendant {
  grid-area: pendant
}

.ds-helm {
  grid-area: helm
}

.ds-armor {
  grid-area: armor
}

.ds-belt {
  grid-area: belt
}

.ds-horse {
  grid-area: horse
}

.ds-amulet {
  grid-area: amulet
}

.ds-weapon {
  grid-area: weapon
}

.ds-boot {
  grid-area: boot
}

.dslot.r1 {
  border-color: #5276a0
}

.dslot.r2 {
  border-color: #b8962a
}

.dslot.r3 {
  border-color: #8a4ac0
}

.dslot.r4 {
  border-color: #e0a83a;
  box-shadow: inset 0 0 10px #0008
}

.dslot.r5 {
  border-color: #688ab1
}

.dslot .it {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none
}

.dslot .it img {
  max-width: 86%;
  max-height: 86%
}

.dslot .it i {
  right: 3px;
  bottom: 1px;
  font-size: 10px;
  color: #ddd;
  text-shadow: 0 0 2px #000
}

.dslot .it b.s5 {
  left: 3px;
  bottom: 3px
}

.cbtns {
  display: flex;
  gap: 6px;
  justify-content: center
}

.cbtns .btn {
  padding: 5px 8px;
  font-size: 12px;
  white-space: nowrap
}

.cright {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0
}

.cbox {
  padding: 8px 10px;
  border: 1px solid #483627;
  border-radius: 3px;
  background: #1d150f
}

.chead {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px
}

.chead small {
  color: var(--text);
  font-size: 12px;
  margin-top: 2px
}

.cg {
  color: var(--gold)
}

.cpow {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px
}

.cpow>div {
  display: flex;
  flex-direction: column
}

.cpow b {
  font-size: 14px
}

.cpow .btn {
  padding: 5px 12px;
  font-size: 13px
}

.cbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid #544131;
  border-radius: 3px;
  background: linear-gradient(#32251a, #211811);
  color: var(--gold);
  font-size: 14px
}

.cbar>span {
  flex: 1
}

.cbar b {
  color: var(--gold)
}

.cbar .btn {
  padding: 4px 12px;
  font-size: 12px
}

.cattr {
  display: grid;
  grid-template-columns: 1fr auto 58px 26px 26px auto;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  font-size: 14px
}

.camt {
  width: 58px;
  padding: 2px 5px;
  font: 13px var(--font);
  text-align: right;
  color: var(--text);
  background: #130e09;
  border: 1px solid #68513f;
  border-radius: 3px
}

.camt:focus {
  outline: none;
  border-color: var(--gold2)
}

.camt::placeholder {
  color: #5d6862
}

.cmax {
  padding: 2px 6px;
  font-size: 11px;
  border: 1px solid #6d5a33;
  border-radius: 3px;
  color: #cbb88a;
  background: linear-gradient(#3a3020, #1d170c)
}

.cmax:disabled {
  opacity: .35
}

.cattr b {
  color: var(--gold);
  text-align: right;
  min-width: 40px
}

.cpm {
  width: 24px;
  height: 20px;
  border-radius: 3px;
  border: 1px solid #c8a45a;
  background: linear-gradient(#a8833e, #5a4018);
  color: #e0c67b;
  font-size: 13px;
  line-height: 18px
}

.cpm[data-m] {
  border-color: #6d5a33;
  background: linear-gradient(#3a3020, #1d170c);
  color: #cbb88a
}

.cpm:disabled {
  opacity: .35
}

.cstats {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  gap: 5px 10px;
  font-size: 12px;
  white-space: nowrap
}

.cstats span {
  color: var(--dim)
}

.cstats b {
  color: var(--text)
}

/* Cua so Ky nang (skillWin): the phai, luoi chieu theo cap, o chieu xam khi chua hoc, + do de cong diem */
.sktabs {
  display: flex;
  gap: 4px;
  margin-bottom: -1px;
  position: relative;
  z-index: 1
}

.sktabs button {
  padding: 5px 14px;
  border: 1px solid #8a6d35;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(#5a4520, #2e220e);
  color: #e0c67b;
  font-size: 13px
}

/* 15/11: bảng Võ công có thêm cột Lv120 · Lv150 -> cửa sổ rộng hơn để ô chiêu giữ cỡ cũ */
.mbox:has(.skwin.skwide) {
  width: min(100%, 820px)
}

.skgrid {
  display: grid;
  gap: 4px;
  padding: 6px;
  border: 1px solid #534030;
  background: #120d09
}

.skh {
  text-align: center;
  font-size: 11px;
  line-height: 1.2;
  padding: 4px 0;
  border: 1px solid #5a4533;
  border-radius: 2px;
  background: linear-gradient(#3e2d1f, #271c14);
  color: #d6e6e0;
  white-space: nowrap;
  overflow: hidden
}

.skc {
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid #4c3a2b;
  border-radius: 2px;
  background: #17110c;
  box-shadow: inset 0 0 8px #000
}

.skc i {
  position: absolute;
  inset: 4px;
  background: center/contain no-repeat;
  filter: grayscale(1) brightness(.6)
}

.skc.on i {
  filter: none
}

.skc.lock i {
  filter: grayscale(1) brightness(.3)
}

.skc[data-id]:hover,
#skBasic:hover {
  border-color: var(--gold2)
}

.skc.main {
  border-color: #d4c086;
  box-shadow: 0 1px 2px #0009, inset 0 0 10px #0008
}

.skc b {
  position: absolute;
  left: 3px;
  bottom: 1px;
  font-size: 11px;
  color: #f5eddb;
  text-shadow: 0 0 2px #000, 0 0 2px #000
}

.skc u {
  position: absolute;
  left: 3px;
  top: 1px;
  text-decoration: none;
  font-size: 10px;
  color: #e0c57b;
  text-shadow: 0 0 2px #000, 0 0 2px #000
}

.skc em,
.skhint em {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 1px solid #f5eddb88;
  border-radius: 2px;
  background: #d42a1e;
  color: #f5eddb;
  font: 400 12px/13px var(--font);
  font-style: normal;
  text-align: center
}

.skc em {
  position: absolute;
  right: 2px;
  bottom: 2px;
  cursor: pointer
}

.skc em:hover {
  background: #cc5e54
}

.skfoot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px
}

.skfoot p {
  flex: 1;
  font-size: 12px;
  color: var(--dim);
  line-height: 1.45
}

.skfoot p a {
  color: var(--gold);
  cursor: pointer;
  text-decoration: underline
}

.skfoot .btn {
  padding: 4px 12px;
  font-size: 12px;
  line-height: 1.25
}

.skpts {
  display: flex;
  flex-direction: column;
  font-size: 14px;
  color: var(--gold);
  white-space: nowrap
}

.skpts b {
  color: #dd766c
}

.skhint {
  margin-top: 6px;
  font-size: 11px;
  color: var(--dim)
}

.skslot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0;
  font-size: 13px
}

.skslot button {
  width: 28px;
  height: 26px;
  border: 1px solid var(--line2);
  border-radius: 4px;
  background: #1d150f
}

.skslot button.on {
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: 0 1px 2px #0009
}

@container (max-width:560px) {
  .skgrid {
    gap: 2px;
    padding: 4px
  }

  .skh {
    font-size: 8.5px
  }

  .skc b {
    font-size: 9px
  }

  .skc em {
    width: 12px;
    height: 12px;
    font-size: 10px;
    line-height: 10px
  }

  .skfoot {
    flex-wrap: wrap
  }

  .skfoot p {
    flex-basis: 100%
  }
}

/* Cua so Vat pham (invWin): hep nhu tui do JX, luoi 6 x 10 o toi, dong ngan luong, nut 2 cot */
.mbox:has(.invwin) {
  width: min(100%, 500px);
  padding: 10px
}

.invwin .cwt {
  margin: 0 28px 8px
}

.ivtop {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 13px
}

.ivtop select {
  flex: 1;
  width: auto;
  padding: 4px 6px;
  font-size: 13px;
  border-radius: 3px;
  background: #130e09;
  border: 1px solid #68513f
}

.ivgrid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 2px;
  padding: 3px;
  border: 1px solid #544131;
  background: #080604
}

.ivc {
  position: relative;
  aspect-ratio: 1;
  background: #100c08;
  border: 1px solid #2c2117
}

.ivc .it {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 0
}

.ivc .it i {
  font-size: 9px;
  right: 2px
}

.ivmoney {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 8px;
  align-items: center;
  margin: 6px 0;
  font-size: 12.5px
}

.ivmoney b {
  padding: 2px 8px;
  border: 1px solid #544131;
  background: #100c08;
  color: #ddc16c;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.ivmoney b.w {
  color: var(--text)
}

.ivbtns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  justify-items: center
}

.ivbtns .btn {
  width: 100%;
  max-width: 124px;
  padding: 4px 6px;
  font-size: 12px;
  white-space: nowrap
}

.ivbtns .btn:last-child {
  grid-column: 1/3
}

/* Bo loc nhat (lootModal) + Kho Ren (fboxModal) */
.mbox:has(.lootwin) {
  width: min(100%, 780px)
}

.mbox:has(.fboxwin) {
  width: min(100%, 460px)
}

.lootwin .cwt,
.fboxwin .cwt {
  margin: 0 30px 8px
}

.lfsec {
  padding: 8px 10px;
  border: 1px solid #483627;
  background: #1d150f;
  margin-bottom: 8px
}

.lfsec h4 {
  font: 400 14px var(--font);
  color: var(--text);
  margin-bottom: 2px
}

.lfnote {
  font-size: 11.5px;
  color: var(--dim);
  line-height: 1.45;
  margin: 2px 0 6px
}

.lfck {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 7px 0;
  font-size: 13px;
  line-height: 1.45;
  cursor: pointer
}

.lfck input {
  margin-top: 3px;
  flex: none;
  accent-color: #6185ae
}

.lfck select,
.lfrow select {
  width: auto;
  display: inline-block;
  padding: 2px 6px;
  margin: 0 3px;
  font-size: 13px
}

.lfrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
  font-size: 13px
}

.lfbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 10px;
  border: 1px solid #544131;
  border-bottom: 0;
  background: linear-gradient(#3b2c20, #271c14)
}

.lfbar b {
  color: var(--gold);
  font-size: 14px
}

.lfbar small {
  color: var(--dim);
  font-size: 12px
}

.lftabs {
  display: flex;
  gap: 4px;
  padding: 4px 4px 0;
  border: 1px solid #544131;
  border-bottom: 0;
  background: #120d09
}

.lftabs button {
  padding: 5px 14px;
  border: 1px solid #544131;
  border-bottom: 0;
  border-radius: 3px 3px 0 0;
  background: #211811;
  color: var(--dim);
  font-size: 13px
}

.lftabs button.on {
  background: linear-gradient(#6b5226, #3a2a10);
  color: #e0c47b;
  border-color: #a8864a
}

.lfmain {
  border-top-color: #a8864a
}

.lfdesc {
  font-size: 12.5px;
  line-height: 1.55;
  margin: 4px 0 8px
}

.lfdesc .up {
  color: #7ebea0
}

.lfuse {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  padding: 5px 8px;
  border: 1px dashed var(--gold2);
  font-size: 12px;
  color: var(--gold)
}

.lfsetrow {
  align-items: center;
  flex-wrap: wrap
}

.lfsetrow label {
  display: flex;
  gap: 7px;
  align-items: flex-start;
  flex: 1 1 300px
}

.lfsetrow .btn {
  padding: 3px 10px;
  font-size: 12px
}

.lfsets {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 4px 0
}

.lfset {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border: 1px solid #544131;
  border-radius: 14px;
  background: #16100b;
  font-size: 12px;
  cursor: pointer
}

.lfset b {
  color: var(--text)
}

.lfset small {
  color: var(--dim);
  font-size: 10.5px
}

.lfset i {
  font-style: normal;
  color: var(--dim)
}

.lfset.off {
  opacity: .55;
  cursor: default
}

.lfset:has(input:checked) {
  border-color: var(--gold2);
  background: #1e1a10
}

.ivup {
  position: absolute;
  right: 1px;
  top: -1px;
  z-index: 2;
  text-decoration: none;
  font-size: 10px;
  color: #7ebea0;
  text-shadow: 0 0 3px #000;
  pointer-events: none
}

.fbgrid {
  grid-template-columns: repeat(10, 1fr)
}

.fbbtns .btn:last-child {
  grid-column: auto
}

.btnrow.left {
  justify-content: flex-start
}

.btnrow.left .btn {
  flex: none;
  max-width: none;
  padding: 6px 16px;
  white-space: nowrap
}

/* the Khac: hang cong tac gat (Tro nang, Dieu khien & Hien thi) */
.orow {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 36px;
  padding: 3px 0;
  font-size: 14px;
  line-height: 1.35
}

.orow>span {
  flex: 1;
  min-width: 0
}

/* nhat ky: gio ghi san trong moi dong, chi hien khi bat (body.logtime) */
.log time {
  display: none;
  margin-right: 6px;
  color: #7d8a83;
  font-size: 11px
}

body.logtime .log time {
  display: inline
}

/* vien sang do Hoang Kim / Bach Kim trong hanh trang, kho (body.goldglow) */
@keyframes goldglow {

  0%,
  100% {
    box-shadow: inset 0 0 6px #0008, 0 1px 2px #0009
  }

  50% {
    box-shadow: inset 0 0 12px #0008, 0 1px 2px #0009
  }
}

@keyframes platglow {

  0%,
  100% {
    box-shadow: inset 0 0 6px #0008, 0 1px 2px #0009
  }

  50% {
    box-shadow: inset 0 0 12px #0008, 0 1px 2px #0009
  }
}

.it.r4 {
  border-color: #d7a956
}

.it.r5 {
  border-color: #688ab1
}

body.goldglow .it.r4 {
  animation: goldglow 1.6s ease-in-out infinite
}

body.goldglow .it.r5 {
  animation: platglow 1.6s ease-in-out infinite
}

body.saver .it.r4,
body.saver .it.r5 {
  animation: none
}

.it s.lk {
  position: absolute;
  right: 1px;
  top: 0;
  z-index: 2;
  text-decoration: none;
  font-size: 9px;
  line-height: 1;
  filter: drop-shadow(0 0 1px #000)
}

.ivc .it s.lk~.ivup,
.ivc:has(s.lk) .ivup {
  display: none
}

/* Chi tiet mon do (itemModal): dau muc icon + ten, khung so sanh toi co vien, hang nut to chia deu */
.mbox:has(.iwin) {
  width: min(100%, 1000px)
}

.iwin .idet {
  gap: 12px;
  padding-right: 30px
}

.iwin .idet .pic {
  width: 54px;
  height: 54px;
  border: 1px solid #68513f;
  border-radius: 3px;
  background: #100c08
}

.iwin .idet .pic.r1 {
  border-color: #5276a0
}

.iwin .idet .pic.r2 {
  border-color: #b8962a
}

.iwin .idet .pic.r3 {
  border-color: #8a4ac0
}

.iwin .idet .pic.r4 {
  border-color: #e0a83a
}

.iwin .idet .pic.r5 {
  border-color: #688ab1
}

.iwin .idet h4 {
  font-size: 15px;
  margin-bottom: 2px
}

.iwin .sl {
  margin: 10px 0;
  font-size: 13.5px;
  line-height: 1.6
}

.iwin .sl .b {
  font-weight: 700;
  color: var(--text)
}

.iwin .sl .m {
  color: #688ab1
}

.iwin .cmp2 {
  margin: 8px 0 10px;
  padding: 9px 12px;
  border: 1px solid #544131;
  border-radius: 3px;
  background: #110c08;
  line-height: 1.6
}

.iwin .cmp2 .cmpv {
  font-size: 12.5px;
  margin: 2px 0 6px
}

.iwin .reqbad,
.iwin .reqnote {
  margin-top: 8px;
  font-size: 12.5px;
  line-height: 1.55
}

.iwin .reqnote b {
  color: #ddc16c
}

.iwin .cmp {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid #544131;
  opacity: 1
}

.iwin .cmp>small {
  display: block;
  margin-bottom: 6px
}

.iwin .cmp .idet .pic {
  width: 44px;
  height: 44px
}

.iwin .cmp .sl {
  font-size: 12.5px;
  line-height: 1.55
}

.ibtns {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 8px;
  margin-top: 14px
}

.ibtns .btn {
  max-width: none !important;
  width: 100%;
  min-height: 52px;
  padding: 8px 6px;
  font-size: 14px;
  border-radius: 4px;
  line-height: 1.25
}

.ibtns .btn[disabled] {
  opacity: .45
}

.gdrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0;
  font-size: 13px
}

.gdrow span {
  min-width: 110px;
  text-align: right
}

.gdrow .btn {
  padding: 7px 18px;
  font-size: 14px
}

/* Cua so Nhiem vu · Pho ban (dungeon.js) */
.mbox:has(.questwin) {
  width: min(100%, 720px)
}

.questwin .cwt {
  margin: 0 30px 8px
}

.dglist {
  display: grid;
  gap: 6px
}

.dgrow {
  display: grid;
  grid-template-columns: 40px 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #544131;
  border-radius: 4px;
  background: linear-gradient(#281d14, #1d150e)
}

.dgrow i {
  font-style: normal;
  font-size: 24px;
  text-align: center
}

.dgrow b {
  color: var(--gold)
}

.dgrow small {
  display: block;
  color: var(--dim);
  font-size: 11.5px
}

.dgrow em {
  font-style: normal;
  font-size: 12px;
  color: var(--text);
  white-space: nowrap
}

.dgrow.lock {
  opacity: .5
}

.dgrow .btn {
  padding: 6px 16px
}

.dgnow {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  margin: 6px 0 10px;
  padding: 8px 10px;
  border: 1px dashed var(--gold2);
  color: var(--gold);
  font-size: 13px
}

.qcbox {
  padding: 12px;
  border: 1px solid #544131;
  border-radius: 4px;
  background: #19120c
}

.qcstep {
  color: var(--dim);
  font-size: 12.5px
}

.qcstep b {
  color: var(--gold);
  font-size: 15px
}

.qctask {
  font-size: 16px;
  color: var(--text);
  margin: 6px 0 8px
}

.qcbar {
  height: 16px;
  margin-bottom: 8px
}

.qcrew {
  font-size: 12.5px;
  color: #7ebea0
}

/* ======== Bo cuc PC kieu JX (pc.js, body.pc: may tinh man hinh ngang) ======== */
#pcTop,
#pcChat,
#pcMenu,
#pcRot,
#pcMain,
#pcDrawHead {
  display: none
}

body.pc #app {
  display: block !important;
  width: 100vw;
  max-width: none
}

body.pc #battle {
  position: absolute;
  inset: 0
}

body.pc #tabs,
body.pc #compactBtn,
body.pc #rotBtn {
  display: none !important
}

/* thanh nhan vat giua tren */
body.pc #top {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(560px, 46vw);
  z-index: 6;
  border: 1px solid var(--gold2);
  border-top: 0;
  border-radius: 0 0 10px 10px;
  padding: 5px 10px 7px;
  background: linear-gradient(#231911cc, #130d08e6);
  box-shadow: 0 3px 10px #0008
}

body.pc #top .lvbox {
  width: 42px;
  height: 42px
}

body.pc #giftBtn {
  width: 34px;
  height: 34px;
  line-height: 32px;
  font-size: 16px
}

/* goc phai: nut tron + chon ban do + ai (duoi ban do nho) */
body.pc #pcTop {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  position: absolute;
  top: 158px;
  right: 8px;
  z-index: 5
}

.pcround {
  display: flex;
  gap: 6px
}

.pcround button {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid #a8864a;
  background: radial-gradient(#3a2f1c, #120d06);
  color: #f3e6c4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 8.5px;
  line-height: 1.05;
  box-shadow: 0 2px 6px #000a
}

.pcround button i {
  font-style: normal;
  font-size: 15px;
  line-height: 1.1
}

.pcround button:hover {
  border-color: #d4c086;
  box-shadow: 0 1px 2px #0009
}

.pcmap select {
  width: 210px;
  padding: 4px 6px;
  font-size: 12px;
  background: #130e09e6;
  border: 1px solid #6d5a33;
  border-radius: 3px;
  color: var(--text)
}

.pcstage {
  display: flex;
  gap: 4px
}

.pcstage button {
  padding: 3px 8px;
  font-size: 12px;
  border: 1px solid #6d5a33;
  border-radius: 3px;
  background: #130e09e6;
  color: var(--text)
}

.pcstage #pcPush {
  min-width: 150px
}

.pcstage #pcPush.on {
  color: var(--gold);
  border-color: var(--gold)
}

/* khung thong bao goc trai duoi */
body.pc #pcChat {
  display: flex;
  flex-direction: column;
  position: absolute;
  left: 8px;
  bottom: 8px;
  width: min(400px, 34vw);
  height: 190px;
  z-index: 5;
  border: 1px solid #544131;
  background: #0a0704cc;
  border-radius: 4px
}

#pcChat.min {
  height: auto
}

#pcChat.min #pcLog {
  display: none
}

.pctabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-bottom: 1px solid #544131;
  background: #130e09e6
}

.pctabs button {
  padding: 2px 7px;
  font-size: 11px;
  border: 1px solid #423225;
  border-radius: 2px;
  color: var(--dim);
  background: #1d150f
}

.pctabs button.on {
  color: #e0c67b;
  background: linear-gradient(#6b5226, #3a2a10);
  border-color: #a8864a
}

#pcChatHide {
  margin-left: auto
}

#pcLog {
  flex: 1;
  overflow-y: auto;
  padding: 4px 7px;
  font-size: 12px;
  line-height: 1.45
}

#pcLog div {
  padding: 1px 0
}

#pcLog .c-loot {
  color: #688ab1
}

#pcLog .c-combat {
  color: #e09b7b
}

#pcLog .c-quest {
  color: #e6d39a
}

#pcLog time {
  display: none;
  margin-right: 5px;
  color: #7d8a83;
  font-size: 10.5px
}

body.logtime #pcLog time {
  display: inline
}

body.pc #inBtn {
  bottom: 206px !important
}

/* thanh phim tat giua duoi: 1 2 3 thuoc | chieu chinh | F1-F4 */
body.pc #pad {
  display: flex !important;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 5px;
  left: 50%;
  right: auto;
  bottom: 8px;
  transform: translateX(-50%);
  width: auto;
  padding: 7px 9px;
  background: #120d09e6;
  border: 1px solid #6d5a33;
  border-radius: 6px;
  box-shadow: 0 3px 10px #000a
}

body.pc #pad .pbtn {
  width: 46px;
  height: 46px;
  border-radius: 5px;
  margin: 0;
  border: 1px solid #6d5a33;
  box-shadow: inset 0 0 8px #000
}

body.pc #pad .pbtn i,
body.pc #pad .pbtn .cd {
  border-radius: 4px
}

body.pc #pad .pbtn::after {
  content: attr(data-key);
  position: absolute;
  right: 2px;
  top: 0;
  z-index: 3;
  font-size: 9.5px;
  color: #f5eddb;
  text-shadow: 0 0 2px #000, 0 0 2px #000
}

body.pc #pad .pbtn.sk b {
  display: none
}

body.pc #bHp {
  order: 1
}

body.pc #bMp {
  order: 2
}

body.pc #bTp {
  order: 3;
  width: 46px;
  height: 46px
}

body.pc #pcMain {
  display: block;
  order: 4;
  width: 58px !important;
  height: 58px !important;
  margin: 0 6px !important;
  border: 2px solid #c8a45a !important;
  background: #160f0a
}

body.pc #pcMain i {
  position: absolute;
  inset: 3px;
  background: center/cover no-repeat
}

body.pc #pad .sk {
  order: 5
}

body.pc #pad .pbtn.cur {
  border-color: #e0c87b;
  box-shadow: 0 1px 2px #0009
}

body.pc #pcRot {
  display: flex;
  align-items: center;
  gap: 5px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 76px;
  z-index: 5;
  padding: 2px 8px;
  font-size: 11.5px;
  border: 1px solid #6d5a33;
  border-radius: 3px;
  background: #120d09e6;
  color: var(--gold)
}

/* hang icon menu goc phai duoi */
body.pc #pcMenu {
  display: flex;
  gap: 4px;
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 5;
  padding: 5px;
  border: 1px solid #6d5a33;
  border-radius: 6px;
  background: #120d09e6
}

#pcMenu button {
  width: 40px;
  height: 40px;
  border: 1px solid #68513f;
  border-radius: 5px;
  background: linear-gradient(#3b2c20, #1d150f);
  display: grid;
  place-items: center
}

#pcMenu button:hover {
  border-color: var(--gold)
}

#pcMenu button.on {
  border-color: #d4c086;
  box-shadow: 0 1px 2px #0009
}

#pcMenu button.off {
  opacity: .45
}

#pcMenu i {
  font-style: normal;
  font-size: 19px;
  line-height: 1
}

#pcMenu .ic {
  width: 26px;
  height: 26px;
  background-size: 300% 100%;
  background-position: 0 0
}

.ic-char {
  background-image: url(ui/ic_char.png)
}

.ic-item {
  background-image: url(ui/ic_item.png)
}

.ic-skill {
  background-image: url(ui/ic_skill.png)
}

/* ngan keo ben phai: Giang ho / He thong */
body.pc #panel {
  display: flex !important;
  flex-direction: column;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 62px;
  width: min(400px, 40vw);
  z-index: 9;
  border-left: 1px solid var(--gold2);
  box-shadow: -6px 0 18px #000a;
  transform: translateX(104%);
  transition: transform .2s
}

body.pc.pcdraw #panel {
  transform: none
}

body.pc #panel .tab {
  flex: 1;
  height: auto;
  min-height: 0
}

body.pc #pcDrawHead {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 6px;
  border-bottom: 1px solid #544131;
  background: #130e09
}

#pcDrawHead button {
  padding: 4px 12px;
  font-size: 12px;
  border: 1px solid #544131;
  border-radius: 3px;
  color: var(--dim)
}

#pcDrawHead button.on {
  color: #e0c67b;
  border-color: #a8864a;
  background: linear-gradient(#6b5226, #3a2a10)
}

/* Luyen Cong: an cac khung PC */
.rbnow {
  font-size: 14px;
  margin: 6px 0
}

/* nut len / xuong ngua (bo cuc doc): canh nut Ve thanh, anh = ngua dang mac */
#pad #bRide {
  grid-column: 2;
  width: 44px;
  height: 44px;
  margin: 0;
  border: 2px solid #8a7340;
  background: radial-gradient(#463324, #160f0a)
}

#pad #bRide i {
  inset: 5px;
  background: center/contain no-repeat;
  border-radius: 0
}

#pad #bRide.on {
  border-color: #e0c87b;
  box-shadow: 0 1px 2px #0009
}

#pad #bRide.off i {
  filter: grayscale(1) brightness(.55)
}

#pad #bRide.off {
  opacity: .75
}

body.pc #pad #bRide {
  display: none
}

/* man hinh mo game + dau ban quyen (brand.js) */
#splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 16px;
  background: radial-gradient(ellipse at 50% 40%, #332317 0%, #0c0906 75%)
}

#splash.hidden {
  display: none
}

.spbox {
  width: min(560px, 100%);
  text-align: center;
  padding: 26px 22px 18px;
  border: 1px solid #8a6d35;
  border-radius: 10px;
  background: linear-gradient(#221810f0, #120d08f0);
  box-shadow: 0 0 40px #000, inset 0 0 30px #0008
}

.sptitle {
  font-size: 34px;
  letter-spacing: 2px;
  color: #d4c086;
  text-shadow: 0 2px 0 #5a4018, 0 1px 2px #0009
}

.spby {
  margin-top: 4px;
  font-size: 14px;
  color: var(--dim)
}

.spby b {
  color: #7ebea0;
  letter-spacing: 2px
}

.spask {
  margin: 20px 0 10px;
  font-size: 15px;
  color: var(--text)
}

.spopts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px
}

.spopts button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 10px;
  border: 1px solid #68513f;
  border-radius: 8px;
  background: linear-gradient(#33251a, #1d150e);
  color: var(--text);
  transition: border-color .15s, box-shadow .15s, transform .15s
}

.spopts button:hover {
  border-color: var(--gold);
  box-shadow: 0 1px 2px #0009;
  transform: translateY(-2px)
}

.spopts button.on {
  border-color: #d4c086;
  box-shadow: inset 0 0 12px #0008
}

.spopts i {
  font-style: normal;
  font-size: 30px
}

.spopts b {
  font-size: 17px;
  color: var(--gold)
}

.spopts small {
  font-size: 12px;
  color: var(--dim);
  line-height: 1.4
}

.spnote {
  margin-top: 12px;
  font-size: 12px;
  color: var(--dim)
}

.spcopy {
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px solid #483627;
  font-size: 12px;
  color: #c8b98a;
  letter-spacing: .5px
}

@media (max-width:480px) {
  .spopts {
    grid-template-columns: 1fr
  }

  .sptitle {
    font-size: 28px
  }
}

#brandMark {
  position: absolute;
  left: 50%;
  top: 4px;
  transform: translateX(-50%);
  z-index: 4;
  font-size: 10.5px;
  letter-spacing: .5px;
  color: #f3e6c4;
  opacity: .55;
  text-shadow: 0 0 3px #000, 0 0 3px #000;
  pointer-events: none;
  white-space: nowrap
}

body.pc #brandMark {
  top: 62px
}

#onlineTag {
  position: absolute;
  left: 50%;
  top: 19px;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 1px 8px;
  font-size: 11px;
  color: #7ebea0;
  background: #0008;
  border-radius: 9px;
  text-shadow: 0 0 3px #000;
  pointer-events: none;
  white-space: nowrap
}

#onlineTag[hidden] {
  display: none
}

#onlineTag i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #67b28f;
  box-shadow: 0 1px 2px #0009;
  animation: onl 2s ease-in-out infinite
}

@keyframes onl {
  50% {
    opacity: .35
  }
}

body.pc #onlineTag {
  top: 77px
}

.brandcard {
  font-size: 13px;
  line-height: 1.6
}

.brandcard b {
  color: var(--gold)
}

/* tai khoan · luu dam may (cloud.js) */
.mbox:has(.cloudwin) {
  width: min(100%, 520px)
}

.cloudwin .cwt {
  margin: 0 30px 10px
}

.cloudwin .frow label {
  min-width: 110px
}

.cloudwin input {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  background: #130e09;
  color: var(--text);
  border: 1px solid #5a4533;
  border-radius: 6px;
  font: 14px var(--font)
}

.cloudbtn {
  width: 100%;
  max-width: none !important;
  padding: 9px 12px
}

#t-more .btnrow .cloudbtn {
  flex: 1
}

.crb {
  color: #d37be0
}

/* Phong thu chieu (?thuchieu) */
.stpanel {
  position: fixed;
  left: 8px;
  top: 64px;
  z-index: 9;
  width: 250px;
  max-height: calc(100vh - 140px);
  display: flex;
  flex-direction: column;
  background: rgba(14, 18, 16, .94);
  border: 1px solid #6d5a33;
  border-radius: 6px;
  box-shadow: 0 4px 18px #000a;
  font-size: 12px;
  color: var(--text)
}

.stpanel .sthead {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-bottom: 1px solid #3a3326;
  color: var(--gold2, #e6c67a)
}

.stpanel .sthead small {
  color: #d37be0;
  flex: 1
}

.stpanel .sthead button {
  width: 24px;
  height: 22px;
  padding: 0;
  border: 1px solid #6d5a33;
  border-radius: 3px;
  background: #1d170c;
  color: #cbb88a
}

.stpanel.min .stbody {
  display: none
}

.stpanel .stbody {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  overflow: hidden;
  min-height: 0
}

.stpanel .strow {
  display: flex;
  align-items: center;
  gap: 6px
}

.stpanel .strow label {
  width: 44px;
  color: #9aa49e
}

.stpanel select {
  flex: 1;
  padding: 3px;
  background: #130e09;
  color: var(--text);
  border: 1px solid #68513f;
  border-radius: 3px;
  font: inherit
}

.stpanel .stspd {
  display: flex;
  gap: 4px
}

.stpanel .stspd button {
  padding: 2px 8px;
  border: 1px solid #68513f;
  border-radius: 3px;
  background: #130e09;
  color: #cbd
}

.stpanel .stspd button.on {
  border-color: #e6c67a;
  color: #e6c67a
}

.stpanel .stlist {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: auto;
  min-height: 0;
  flex: 1
}

.stpanel .stsk {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 5px;
  text-align: left;
  border: 1px solid #413225;
  border-radius: 4px;
  background: #1d150f;
  color: var(--text);
  cursor: pointer
}

.stpanel .stsk:hover {
  border-color: #6d5a33
}

.stpanel .stsk.on {
  border-color: #e6c67a;
  background: #2a2412
}

.stpanel .stsk img {
  width: 26px;
  height: 26px;
  flex: none
}

.stpanel .stsk span {
  display: flex;
  flex-direction: column;
  min-width: 0
}

.stpanel .stsk b {
  font-weight: normal;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.stpanel .stsk small {
  color: #8a948e;
  font-size: 10px
}

.stpanel .sthint {
  margin: 0;
  color: #8a948e;
  font-size: 11px
}

.stpanel .stout {
  color: #e0897b;
  font-size: 11px
}

@media (max-width:700px) {
  .stpanel {
    width: 200px;
    top: 56px
  }
}

/* Luc chien (thanh tren cung) */
.lcbadge {
  margin-left: 6px;
  padding: 0 6px;
  font-size: 11px;
  line-height: 16px;
  white-space: nowrap;
  color: #d8c9a0;
  background: linear-gradient(#2a2412, #15110a);
  border: 1px solid #6d5a33;
  border-radius: 3px
}

.lcbadge b {
  color: #ddc16c;
  font-weight: bold
}

/* Bang xep hang */
.rankwin .rklist {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 6px 0 10px
}

.rkrow {
  display: grid;
  grid-template-columns: 30px 34px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  background: #201711;
  border: 1px solid #413225;
  border-radius: 5px
}

.rkrow.top1 {
  border-color: #e6c67a;
  background: linear-gradient(90deg, #3a2f12, #201711)
}

.rkrow.top2 {
  border-color: #cfc5b5
}

.rkrow.top3 {
  border-color: #c98a52
}

.rkpos {
  font-size: 18px;
  text-align: center;
  color: #cbb88a
}

.rkrow img {
  width: 34px;
  height: 34px;
  object-fit: contain
}

.rkname {
  display: flex;
  flex-direction: column;
  min-width: 0
}

.rkname b {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #f3e6c4
}

.rkname small,
.rklv small {
  color: #8a948e;
  font-size: 11px
}

.rklv {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  white-space: nowrap
}

.rklv em {
  font-style: normal;
  color: #d37be0;
  font-size: 11px
}

.nmlock {
  color: #7ebea0;
  margin: 6px 0 0
}

/* Bao loi / gop y */
.fbwin textarea {
  width: 100%;
  box-sizing: border-box;
  margin-top: 8px;
  padding: 8px;
  font: 13px var(--font);
  color: var(--text);
  background: #130e09;
  border: 1px solid #68513f;
  border-radius: 4px;
  resize: vertical
}

.fbwin .fbkind {
  display: flex;
  gap: 16px
}

.fbwin .fbkind label {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer
}

.fbwin .fbcount {
  text-align: right;
  font-size: 11px;
  color: #8a948e
}

.fbwin .frow input[type=text] {
  flex: 1;
  min-width: 0;
  padding: 5px 8px;
  font: 13px var(--font);
  color: var(--text);
  background: #130e09;
  border: 1px solid #68513f;
  border-radius: 4px
}

.fbwin .frow input[type=text]:focus,
.fbwin textarea:focus {
  outline: none;
  border-color: var(--gold2, #e6c67a)
}

.skc b small.skplus {
  margin-left: 1px;
  font-size: .8em;
  color: #7ebea0
}

/* + cap ky nang tu trang bi */

/* Thong bao cap nhat */
.newswin h4 {
  margin: 10px 0 6px;
  color: #e6c67a;
  font-size: 14px
}

.newswin h4 small {
  color: #8a948e;
  font-weight: normal;
  font-size: 11px;
  margin-left: 6px
}

.newslist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px
}

.newslist li {
  display: flex;
  gap: 8px;
  padding: 6px 8px;
  background: #201711;
  border: 1px solid #413225;
  border-radius: 5px
}

.newslist li i {
  font-style: normal;
  font-size: 18px;
  line-height: 22px
}

.newslist li div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12.5px
}

.newslist li b {
  color: #f3e6c4
}

.newslist li span {
  color: #c9c2b0
}

.newslist li span b {
  color: #7ebea0
}

.newsfoot {
  margin: 10px 0 4px;
  padding: 8px 10px;
  border: 1px dashed #6d5a33;
  border-radius: 5px;
  color: #e6c67a;
  font-size: 12.5px
}

/* Top 20: dong gon hon */
.rankwin .rklist {
  gap: 3px
}

.rkrow {
  padding: 3px 8px;
  grid-template-columns: 28px 28px 1fr auto
}

.rkrow img {
  width: 28px;
  height: 28px
}

.rkpos {
  font-size: 15px
}

.rklv {
  flex-direction: row;
  align-items: center;
  gap: 8px
}

.newswin .newsprev {
  margin: 14px 0 4px;
  color: #9aa49e;
  font-size: 12.5px;
  border-top: 1px solid #413225;
  padding-top: 8px
}

.newsold {
  margin: 4px 0;
  border: 1px solid #413225;
  border-radius: 5px;
  background: #1a130d
}

.newsold summary {
  cursor: pointer;
  padding: 6px 10px;
  color: #d8c9a0;
  font-size: 12.5px
}

.newsold summary small {
  color: #8a948e;
  margin-left: 6px
}

.newsold[open] summary {
  border-bottom: 1px solid #413225
}

.newsold .newsblk {
  padding: 0 8px 8px
}

.newsold .newsblk h4 {
  display: none
}

/* BXH: the Cap do / Leo thap */
.rktabs {
  display: flex;
  gap: 6px;
  margin: 4px 0 8px
}

.rktabs button {
  flex: 1;
  padding: 6px;
  border: 1px solid #68513f;
  border-radius: 4px;
  background: #1d150f;
  color: #cbd;
  cursor: pointer;
  font: inherit
}

.rktabs button.on {
  border-color: #e6c67a;
  color: #e6c67a;
  background: linear-gradient(#2a2412, #15110a)
}

.rklv em.tw {
  color: #688ab1;
  font-style: normal;
  font-weight: bold
}

/* nut xuc xac ten ngau nhien */
.dice {
  flex: none;
  width: 32px;
  height: 28px;
  margin-left: 6px;
  padding: 0;
  font-size: 17px;
  line-height: 26px;
  border: 1px solid #6d5a33;
  border-radius: 4px;
  background: linear-gradient(#2a2412, #15110a);
  cursor: pointer
}

.dice:hover {
  border-color: #e6c67a
}

.dice.roll {
  animation: diceroll .35s ease-out
}

@keyframes diceroll {
  0% {
    transform: rotate(0) scale(1)
  }

  50% {
    transform: rotate(200deg) scale(1.15)
  }

  100% {
    transform: rotate(360deg) scale(1)
  }
}

/* Hop thu */
#mailTag {
  position: absolute;
  left: 50%;
  top: 60px;
  transform: translateX(-50%);
  z-index: 5;
  padding: 3px 10px;
  font: 12px var(--font);
  color: #1a1205;
  background: linear-gradient(#e0c57b, #c8ac68);
  border: 1px solid #7a5a1a;
  border-radius: 12px;
  box-shadow: 0 1px 2px #0009;
  cursor: pointer;
  animation: mailpulse 1.4s ease-in-out infinite
}

#mailTag[hidden] {
  display: none
}

body.pc #mailTag {
  top: 118px
}

@keyframes mailpulse {
  50% {
    box-shadow: 0 1px 2px #0009
  }
}

.mailwin .mthread {
  margin: 8px 0;
  padding: 8px;
  border: 1px solid #413225;
  border-radius: 6px;
  background: #1d150f
}

.mailwin .mthread.new {
  border-color: #e6c67a
}

.mailwin .mhead {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px
}

.mailwin .mhead small {
  color: #8a948e
}

.mailwin .mnew {
  color: #1a1205;
  background: #e6c67a;
  border-radius: 3px;
  padding: 0 5px;
  font-size: 11px
}

.mailwin .mtag {
  font-size: 12px
}

.mailwin .mmsg {
  margin: 4px 0;
  padding: 6px 9px;
  border-radius: 6px;
  font-size: 12.5px;
  line-height: 1.45;
  max-width: 88%;
  word-break: break-word
}

.mailwin .mmsg small {
  display: block;
  color: #8a948e;
  font-size: 10.5px;
  margin-bottom: 2px
}

.mailwin .mmsg.me {
  background: #2d231a;
  border: 1px solid #4f3d2f
}

.mailwin .mmsg.adm {
  margin-left: auto;
  background: #422d1b;
  border: 1px solid #724d2f
}

.mailwin .mreply {
  display: flex;
  gap: 6px;
  margin-top: 6px
}

.mailwin .mreply textarea {
  flex: 1;
  padding: 6px;
  font: 12.5px var(--font);
  color: var(--text);
  background: #130e09;
  border: 1px solid #68513f;
  border-radius: 4px;
  resize: vertical
}

/* Chien truong */
.warwin .warcities {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 6px 0
}

.warwin .warcity {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: #201711;
  border: 1px solid #413225;
  border-radius: 5px
}

.warwin .warcity i {
  font-style: normal;
  font-size: 20px;
  text-align: center
}

.warwin .warcity span {
  display: flex;
  flex-direction: column
}

.warwin .warcity small {
  color: #8a948e;
  font-size: 11px
}

.warwin .warnow {
  border-color: #e6c67a
}

/* Hom nay + Tu cay */
.todaywin .grindbtn {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px;
  margin: 4px 0 8px;
  font-size: 15px
}

.todaywin .grindbtn small {
  font-size: 11px;
  color: #9aa49e
}

.todaywin .grindbtn.on {
  border-color: #7ebea0;
  box-shadow: 0 1px 2px #0009
}

.todaywin .grindbtn.on b {
  color: #7ebea0
}

.todaywin .todaylist {
  display: flex;
  flex-direction: column;
  gap: 5px
}

.todaywin .todayrow {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: #201711;
  border: 1px solid #413225;
  border-radius: 5px
}

.todaywin .todayrow.hot {
  border-color: #7ebea0
}

.todaywin .todayrow i {
  font-style: normal;
  font-size: 20px;
  text-align: center
}

.todaywin .todayrow span {
  display: flex;
  flex-direction: column;
  min-width: 0
}

.todaywin .todayrow small {
  color: #9aa49e;
  font-size: 11px
}

.todaywin .grindbtn {
  background: linear-gradient(#2a2412, #15110a) !important;
  border: 1px solid #6d5a33 !important;
  border-image: none !important;
  border-radius: 6px;
  color: #e6c67a;
  min-height: 0;
  height: auto
}

.todaywin .grindbtn small {
  color: #b8b0a0
}

/* Bo vo hoc */
.buildwin .buildcard {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 6px 0;
  padding: 8px 10px;
  background: #201711;
  border: 1px solid #413225;
  border-radius: 6px
}

.buildwin .buildcard.empty {
  opacity: .75
}

.buildwin .buildcard small {
  color: #9aa49e;
  font-size: 11.5px
}

.buildwin .bname {
  width: 200px;
  padding: 3px 6px;
  font: bold 13px var(--font);
  color: #e6c67a;
  background: #130e09;
  border: 1px solid #68513f;
  border-radius: 4px
}

/* mau bo loc nhat + nhat ky 7 ngay */
.lftpl {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin: 4px 0 6px
}

.lftpl .btn.sm {
  min-height: 0;
  padding: 3px 8px;
  font-size: 12px
}

.jrwin .jrtable {
  overflow-x: auto;
  margin: 6px 0 10px
}

.jrwin table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  white-space: nowrap
}

.jrwin th,
.jrwin td {
  padding: 5px 6px;
  border-bottom: 1px solid #413225;
  text-align: right
}

.jrwin th:first-child,
.jrwin td:first-child {
  text-align: left
}

.jrwin th {
  color: #e6c67a;
  font-weight: normal;
  background: #201711
}

.jrwin tr.today td {
  background: #291e15
}

.jrwin tr.total td {
  border-top: 1px solid #6d5a33;
  color: #e6c67a
}

.jrwin td small {
  color: #8a948e;
  margin-left: 3px
}

.jrwin .jr2 {
  color: #ddc16c
}

.jrwin .jr3 {
  color: #b57be0
}

.jrwin .jrs {
  color: #d7a956
}

.jrwin .jrdeaths {
  list-style: none;
  padding: 0;
  margin: 4px 0;
  font-size: 12px;
  max-height: 200px;
  overflow-y: auto
}

.jrwin .jrdeaths li {
  padding: 4px 6px;
  border-bottom: 1px solid #33271d
}

.jrwin .jrdeaths i {
  color: #e0877b;
  font-style: normal
}

/* dot bien ngay / luat tuan / tam phap */
#modTag {
  position: absolute;
  left: 50%;
  top: 38px;
  transform: translateX(-50%);
  z-index: 4;
  padding: 1px 9px;
  font: 11px var(--font);
  color: #e0c47b;
  background: #0009;
  border: 1px solid #6d5a3388;
  border-radius: 9px;
  text-shadow: 0 0 3px #000;
  cursor: pointer;
  white-space: nowrap;
  max-width: 92vw;
  overflow: hidden;
  text-overflow: ellipsis
}

#modTag[hidden] {
  display: none
}

body.pc #modTag {
  top: 96px
}

.modswin .modcard {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 6px 0;
  padding: 8px 10px
}

.modswin .modcard b {
  color: #e6c67a
}

.modswin .modcard small {
  color: #8a948e;
  font-size: 11px
}

.modswin .chips {
  margin: 4px 0 8px
}

.weekmods {
  font-size: 12px;
  margin: 6px 0;
  padding: 5px 8px;
  background: #201711;
  border: 1px solid #413225;
  border-radius: 5px;
  line-height: 1.5
}

.tpbox {
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid #6d5a33;
  border-radius: 6px;
  background: #15130d
}

.tpbox h4 {
  margin: 0 0 4px;
  color: #e6c67a
}

.tpbox h4 small {
  font-weight: normal;
  margin-left: 6px
}

.tprow {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid #2a2618
}

.tprow i {
  font-style: normal;
  font-size: 20px;
  text-align: center
}

.tprow span {
  display: flex;
  flex-direction: column;
  min-width: 0
}

.tprow small {
  color: #9aa49e;
  font-size: 11px
}

/* treo may (afk.js) */
#afk {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: #060402;
  display: grid;
  place-items: center;
  padding: 16px;
  cursor: pointer;
  user-select: none
}

#afk.hidden {
  display: none
}

#afk .afkbox {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  color: #9aa49e;
  font-size: 13px;
  line-height: 1.6
}

#afk .afkbox>b {
  color: #7ebea0;
  letter-spacing: 2px;
  font-size: 15px
}

#afk .afkclock {
  font-size: 44px;
  color: #6d4d34;
  font-weight: 300
}

#afk .afkst {
  color: #c8c2b0
}

#afk .afkst b {
  color: #e6c67a
}

#afk small {
  color: #59635d;
  font-size: 11px
}

/* thanh tuu (achieve.js) */
.achsum {
  padding: 8px 10px;
  margin: 4px 0 8px;
  background: #201711;
  border: 1px solid #413225;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.6
}

.achsum b {
  color: #e6c67a
}

.achsum small {
  display: block;
  color: #9aa49e;
  font-size: 11px
}

.achchips {
  margin-bottom: 6px
}

.achchips .chip2 {
  cursor: pointer;
  border: 1px solid #413225;
  background: #1d150f;
  color: #d1c6b6;
  font: inherit;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 12px
}

.achchips .chip2.on {
  border-color: #e6c67a;
  color: #e6c67a
}

.achlist {
  display: flex;
  flex-direction: column;
  gap: 5px
}

.achrow {
  display: grid;
  grid-template-columns: 62px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 7px 8px;
  background: #1d150f;
  border: 1px solid #3e2f23;
  border-left: 3px solid var(--tc);
  border-radius: 5px;
  opacity: .82
}

.achrow.got {
  opacity: 1;
  background: linear-gradient(90deg, #1d2018, #1d150f)
}

.achrow .achtier {
  font-style: normal;
  font-size: 10px;
  text-align: center;
  color: var(--tc);
  border: 1px solid var(--tc);
  border-radius: 10px;
  padding: 2px 0
}

.achrow span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0
}

.achrow b {
  color: #e8dcc0
}

.achrow.got b {
  color: var(--tc)
}

.achrow small {
  color: #8f9993;
  font-size: 11px
}

.achbar {
  position: relative;
  display: block;
  height: 14px;
  background: #120d09;
  border: 1px solid #413225;
  border-radius: 7px;
  overflow: hidden;
  font-style: normal
}

.achbar s {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, #644329, #6a9a3c);
  text-decoration: none
}

.achrow.got .achbar s {
  background: linear-gradient(90deg, #6d5a33, #c9a24a)
}

.achbar u {
  position: relative;
  display: block;
  text-align: center;
  font-size: 10px;
  line-height: 13px;
  color: #e8e0d0;
  text-decoration: none
}

/* che Bach Kim: mon du cap */
#pkPool .btn.pkpair {
  border-color: #c9a24a
}

#pkPool .pkn {
  font-style: normal;
  margin-left: 5px;
  padding: 0 5px;
  border-radius: 8px;
  background: #c9a24a;
  color: #1a1205;
  font-size: 11px
}

/* ung ho + bang vinh danh (donate.js) */
.dnwin .dnhead {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px
}

.dnwin .dnhead i {
  font-style: normal;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #e07b9a;
  border: 1px solid #e07b9a;
  background: #3a1420;
  box-shadow: 0 1px 2px #0009
}

.dnwin .dnhead span {
  display: flex;
  flex-direction: column
}

.dnwin .dnhead small {
  font-size: 10px;
  letter-spacing: 2px;
  color: #e07b9a
}

.dnwin .dnhead b {
  font-size: 17px;
  color: #f3e6c4
}

.dngive p {
  font-size: 13px;
  line-height: 1.65;
  margin: 6px 0;
  color: #d8d0bc
}

.dngive p b {
  color: #ddc16c
}

.dnqr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 12px auto;
  padding: 14px;
  max-width: 300px;
  background: #f5eddb;
  border-radius: 12px;
  box-shadow: 0 1px 2px #0009
}

.dnqr img {
  width: 100%;
  max-width: 260px;
  display: block;
  border-radius: 6px
}

.dnqrnone {
  width: 220px;
  height: 220px;
  display: grid;
  place-items: center;
  color: #777;
  border: 2px dashed #ccc;
  border-radius: 8px;
  font-size: 13px
}

.dnbank {
  color: #222;
  font-size: 13px;
  text-align: center;
  line-height: 1.5;
  font-weight: 600
}

.dngive .dnnote {
  background: #2a1620;
  border: 1px solid #6a2a40;
  border-radius: 6px;
  padding: 8px 10px;
  color: #e07b99
}

.dnwall .dnbanner {
  text-align: center;
  padding: 12px 8px;
  margin: 4px 0 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, #3a2408, #1d1305 45%, #3a1424);
  border: 1px solid #8a6a2a;
  position: relative;
  overflow: hidden
}

.dnwall .dnbanner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, #f5eddb33 50%, transparent 70%);
  transform: translateX(-100%);
  animation: dnshine 4s ease-in-out infinite
}

.dnwall .dnbanner b {
  display: block;
  font-size: 20px;
  color: #ddc16c;
  text-shadow: 0 1px 2px #0009;
  letter-spacing: 1px
}

.dnwall .dnbanner small {
  color: #e8c9a0;
  font-size: 12px
}

@keyframes dnshine {

  60%,
  100% {
    transform: translateX(100%)
  }
}

.dnpodium {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin: 22px 0 10px
}

/* xep doc nhu dien thoai ca tren PC (gon, dep hon) */
#modal .mbox:has(.dnwin) {
  max-width: 520px
}

.dnpod {
  --c: #e07b9a;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 26px 8px 12px;
  border-radius: 10px;
  text-align: center;
  background: linear-gradient(180deg, #1d1a14, #18120d);
  border: 1px solid var(--c);
  box-shadow: 0 0 14px color-mix(in srgb, var(--c) 45%, transparent);
  min-width: 0
}

.dnpod.p1 {
  order: -1;
  padding-top: 34px;
  background: linear-gradient(180deg, #2e2410, #151209)
}

.dnpod.empty {
  display: none
}

.dnpod .dncrown {
  position: absolute;
  top: -16px;
  font-style: normal;
  font-size: 28px;
  filter: drop-shadow(0 1px 2px #0009)
}

.dnpod.p1 .dncrown {
  font-size: 34px;
  top: -20px;
  animation: dnbob 2.4s ease-in-out infinite
}

@keyframes dnbob {
  50% {
    transform: translateY(-4px)
  }
}

.dnpod .dnname {
  font-size: 15px;
  color: var(--c);
  word-break: break-word
}

.dnpod.p1 .dnname {
  font-size: 18px
}

.dntier {
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 10px;
  border: 1px solid var(--c);
  color: var(--c);
  white-space: nowrap
}

.dnamt {
  font-size: 12px;
  color: #e6c67a
}

.dnpod q,
.dnrow q {
  font-size: 11px;
  color: #b9b2a2;
  font-style: italic;
  quotes: "“" "”";
  word-break: break-word
}

.dnlist {
  display: flex;
  flex-direction: column;
  gap: 5px
}

.dnrow {
  --c: #e07b9a;
  display: grid;
  grid-template-columns: 30px 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 7px 10px;
  border-radius: 7px;
  background: #1d1611;
  border: 1px solid #3c2f24;
  border-left: 3px solid var(--c)
}

.dnrow em {
  font-style: normal;
  color: #8a948e;
  text-align: center
}

.dnrow span {
  display: flex;
  flex-direction: column;
  min-width: 0
}

.dnrow b {
  color: var(--c)
}

.t1 {
  --c: #e07b9a
}

.t2 {
  --c: #d39a62
}

.t3 {
  --c: #d8e2ea
}

.t4 {
  --c: #ddc16c
}

.t5 {
  --c: #688ab1
}

.dnpod.t5,
.dnrow.t5 {
  background: linear-gradient(135deg, #2b1d12, #1b1030 60%, #2b1d12);
  background-size: 200% 200%;
  animation: dngem 6s ease infinite
}

@keyframes dngem {
  50% {
    background-position: 100% 100%
  }
}

.dnempty {
  text-align: center;
  color: #c9b8a8;
  padding: 20px;
  line-height: 1.8
}

@media (max-width:520px) {
  .dnrow {
    grid-template-columns: 24px 1fr auto
  }

  .dnrow .dntier {
    display: none
  }
}

/* than ma cac (thanma.js) */
.tmwin .tmcard {
  background: linear-gradient(180deg, #1d1a12, #18120d);
  border: 1px solid #5c4a26;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 5px
}

.tmwin .tmcard.got {
  border-color: #c9a24a;
  box-shadow: 0 1px 2px #0009
}

.tmwin .tmcard>b {
  color: #e6c67a
}

.tmwin .tmcard small {
  font-size: 11px;
  color: #a9a290;
  line-height: 1.5
}

.tmwin .tmtop {
  flex-direction: row;
  align-items: center;
  gap: 12px
}

.tmwin .tmtop i {
  font-style: normal;
  font-size: 30px;
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid #c9a24a;
  background: #2a2010
}

.tmwin .tmtop span {
  display: flex;
  flex-direction: column;
  gap: 3px
}

.tmwin .tmtop b {
  font-size: 16px;
  color: #e6c67a
}

.tmwin .tmgrp {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 14px 0 4px;
  color: #e6c67a;
  border-bottom: 1px solid #3a3326;
  padding-bottom: 4px
}

.tmwin .tmgrp small {
  color: #8a948e;
  font-weight: normal;
  font-size: 11px
}

.tmwin .tmgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 8px
}

.tmwin .tmgrid .tmcard {
  margin: 0
}

.tmwin .tmhead {
  display: flex;
  gap: 10px;
  align-items: center
}

.tmwin .tmhead img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  background: #120d09;
  border: 1px solid #3a3326;
  border-radius: 6px
}

.tmwin .tmhead span {
  display: flex;
  flex-direction: column;
  min-width: 0
}

.tmwin .tmhead b {
  color: #f3e6c4;
  font-size: 14px
}

.tmwin .tmhead small {
  font-size: 10px
}

.tmwin .tmlv {
  font-style: normal;
  font-size: 11px;
  color: #1a1205;
  background: #c9a24a;
  border-radius: 8px;
  padding: 0 5px
}

.tmwin .tmstats {
  list-style: none;
  margin: 2px 0;
  padding: 6px 8px;
  background: #16100c;
  border-radius: 5px;
  font-size: 11px;
  color: #c8c2b0;
  display: flex;
  flex-direction: column;
  gap: 2px
}

.tmwin .tmstats .tmpw {
  color: #e0be7b
}

.tmwin .tmfoot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: auto
}

.tmwin .tmfoot .btn.sm {
  min-height: 0;
  padding: 4px 12px
}

.sl.sksup {
  border-top: 1px dashed #5a4330;
  padding-top: 6px
}

.sl.sksup .up {
  color: #7ebea0
}

.sl.sksup small {
  display: block;
  margin-top: 2px
}

.jxo {
  display: none !important
}

/* khung cua so: goc nut that, hai suon xanh; nen hoa van toi; thanh tieu de da voi 2 dong tien */
/* dien thoai: cua so truot tu duoi len, rong het man hinh */
@keyframes jxup {
  from {
    transform: translateY(36px);
    opacity: .3
  }
}

/* nut van da chu dam (nhu nut Dong / Tro lai cua JX) */
/* the (tab) */
/* thanh nhan vat: khung da, o cap, thanh mau / noi luc / kinh nghiem dung anh goc */
/* thanh the duoi (dien thoai): icon goc cua thanh cong cu JX */
/* o phim tat vuong (dien thoai) */
/* ---- PC: thanh phim tat goc 800x94 giua duoi, phong theo --hk ---- */
/* 10 nut menu ben phai thanh (anh goc 3 khung: thuong / nhan / sang) */
/* ---- giai doan 4: the, o do, o nhap, o tich, thong bao, tieu de muc theo JX ---- */
/* tieu de muc ben trong cua so / bang */
/* o do / o trang bi / o chieu: o vuong toi vien den nhu tui do JX */
/* o nhap, chon */
/* o tich (anh goc 3 khung: trong / tich / sang) */
/* cong tac bat / tat */
/* nut + / - cong diem */
/* the chip, nut Auto, thong bao nhanh */
/* chon mon phai, the thong tin */
/* chi tiet mon do: nen den trong nhu bang mo ta vat pham JX */
/* cum chon ai (the Giang ho): nut xanh dam chu sang nhu nut "Loi rao / Dinh gia" cua JX, de doc hon nen da */
/* nut kieu "Khoa / Loi rao / Dinh gia" cua JX (mau do tu anh goc): vien den, duong vien trong xam xanh, nen xanh den sang dan xuong duoi, chu sang */
/* cua so Ung ho (donate.js): giu kieu cu, khong dung khung / nut JX */
/* server 2 · Do Xanh (server2.js) */
body.s2 .s2hide {
  display: none !important
}

body.s2 #heroName::after {
  content: "S2 · Đồ Xanh";
  margin-left: 6px;
  padding: 0 5px;
  border: 1px solid #5276a0;
  border-radius: 2px;
  font: 600 9.5px/14px var(--font);
  color: #688ab1;
  background: #141c26;
  vertical-align: 1px;
  white-space: nowrap
}

.srvtabs {
  margin: 2px 0 8px
}

.srvtabs button {
  flex: 1
}

.srvdesc {
  color: #688ab1
}

.spsrv button em {
  font-style: normal;
  font-size: 11.5px;
  color: #7ebea0;
  margin-top: 2px
}

.spsrv button[data-srv="2"] b {
  color: #688ab1
}

/* server 2: khong tu mac do -> dau ▲ (mon manh hon do dang mac) to va nhap nhay de de thay */
body.s2 .it em {
  left: 1px;
  top: -1px;
  z-index: 2;
  font: 700 13px/1 var(--font);
  color: #7ebea0;
  text-shadow: 0 0 4px #000, 0 1px 2px #0009;
  animation: s2up 1.2s ease-in-out infinite
}

body.s2 .it:has(em) {
  box-shadow: inset 0 0 1px 2px #0009, inset 0 0 10px #0008
}

@keyframes s2up {
  50% {
    transform: translateY(-2px);
    opacity: .75
  }
}

/* ===== Bang xep hang (social.js rankModal): cua so gon, the nho, danh sach kieu bang JX (ca giao dien cu lan JX) ===== */
.mbox:has(.rankwin) {
  width: min(100%, 560px)
}

.rankwin .srvtabs button+button {
  border-left: 1px solid #443325
}

.rankwin .rklist {
  gap: 0;
  margin: 0 0 8px;
  border: 1px solid #000;
  box-shadow: inset 0 0 1px 2px #0009;
  background: #0c0906
}

.rankwin .rkrow {
  grid-template-columns: 30px 30px 1fr auto;
  gap: 8px;
  padding: 4px 10px 4px 8px;
  border: 0;
  border-bottom: 1px solid #271c14;
  border-left: 3px solid transparent;
  border-radius: 0;
  background: transparent
}

.rankwin .rkrow:nth-child(even) {
  background: #150f0a
}

.rankwin .rkrow:hover {
  background: #261a10
}

.rankwin .rkrow:last-child {
  border-bottom: 0
}

.rankwin .rkrow.top1 {
  border-left-color: #ddc16c;
  background: linear-gradient(90deg, #3a2c0c, #16130a 45%, transparent)
}

.rankwin .rkrow.top2 {
  border-left-color: #cfd8de;
  background: linear-gradient(90deg, #423021, #1d150f 45%, transparent)
}

.rankwin .rkrow.top3 {
  border-left-color: #d08a52;
  background: linear-gradient(90deg, #33200f, #15100a 45%, transparent)
}

.rankwin .rkpos {
  font: 700 14px var(--font);
  color: #998a73;
  text-align: center
}

.rankwin .rkrow.top1 .rkpos,
.rankwin .rkrow.top2 .rkpos,
.rankwin .rkrow.top3 .rkpos {
  font-size: 19px
}

.rankwin .rkrow img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px #000)
}

.rankwin .rkname b {
  font-size: 13.5px;
  color: #efe6cc
}

.rankwin .rkrow.top1 .rkname b {
  color: #e0c67b
}

.rankwin .rkrow.top2 .rkname b {
  color: #688ab0
}

.rankwin .rkrow.top3 .rkname b {
  color: #d6aa85
}

.rankwin .rkname small {
  font-size: 11px;
  color: #998a73
}

.rankwin .rklv {
  flex-direction: row;
  align-items: center;
  gap: 8px
}

.rankwin .rklv b {
  min-width: 62px;
  text-align: right;
  font: 700 13px var(--font);
  color: #e8e0c8
}

.rankwin .rklv b.tw {
  color: #688ab1
}

.rankwin .rklv small {
  font-size: 11px;
  color: #998a73
}

.rankwin .rklv em.cs {
  padding: 1px 6px;
  border: 1px solid #6a3a7a;
  border-radius: 2px;
  background: #22102a;
  color: #cf7be0;
  font: 600 10.5px/1.4 var(--font);
  font-style: normal
}

@media (max-width:420px) {
  .rankwin .rkrow {
    grid-template-columns: 24px 26px 1fr auto;
    gap: 6px;
    padding: 4px 6px
  }

  .rankwin .rkrow img {
    width: 26px;
    height: 26px
  }

  .rankwin .rklv {
    flex-direction: column;
    align-items: flex-end;
    gap: 2px
  }

  .rankwin .rklv b {
    min-width: 0
  }

  .rankwin .rktabs button {
    padding: 5px 10px
  }
}

/* PC: cua so chua dat do rong rieng thi toi da 640px (khong gian het man hinh); cua so co :has(...) rieng van theo rieng */
body.pc :where(#modal .mbox) {
  width: min(100%, 640px)
}

/* ===== Dien thoai: the Nhan vat / Hanh trang gon vua khung (it phai keo) ===== */
body:not(.pc) #t-char>.card:first-child {
  padding: 6px 10px;
  margin-bottom: 6px;
  font-size: 13px
}

body:not(.pc) #t-char>.card:first-child br {
  display: none
}

body:not(.pc) #t-char>.card:first-child small {
  margin-left: 6px
}

body:not(.pc) .eqgrid {
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  margin-bottom: 4px
}

body:not(.pc) .eqgrid .slot {
  border-radius: 3px;
  font-size: 9.5px;
  line-height: 1.1
}

body:not(.pc) .eqgrid .slot .it i {
  font-size: 9px
}

body:not(.pc) #t-char>p.small {
  margin: 2px 0 4px;
  font-size: 10.5px;
  line-height: 1.35
}

body:not(.pc) #t-char h3 {
  margin: 6px 0 4px;
  font-size: 13.5px
}

body:not(.pc) #t-char h3 .btn.sm {
  padding: 2px 8px;
  font-size: 11.5px
}

body:not(.pc) #t-char .card {
  padding: 6px 8px;
  margin-bottom: 6px
}

body:not(.pc) #t-char .card:has(.attr) {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 10px
}

body:not(.pc) #t-char .attr {
  grid-template-columns: 1fr auto auto;
  gap: 5px;
  padding: 1px 0;
  font-size: 12.5px
}

body:not(.pc) #t-char .attr .pm {
  gap: 3px
}

body:not(.pc) #t-char .attr .plus,
body:not(.pc) #t-char .attr .minus {
  width: 24px;
  height: 22px;
  font-size: 13px;
  line-height: 18px;
  padding: 0
}

body:not(.pc) #t-char .stats {
  grid-template-columns: auto 1fr auto 1fr;
  gap: 2px 8px;
  font-size: 11.5px
}

body:not(.pc) #t-char .stats span:nth-child(even) {
  text-align: left
}

body:not(.pc) .invbar {
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 5px
}

body:not(.pc) .invbar .btn.sm {
  padding: 3px 8px;
  font-size: 11.5px
}

body:not(.pc) .invgrid {
  grid-template-columns: repeat(8, 1fr);
  gap: 3px
}

body:not(.pc) .invgrid .it i {
  font-size: 9px
}

body:not(.pc) #modal .invwin .ivgrid {
  grid-template-columns: repeat(10, 1fr)
}

body:not(.pc) .eqhint .eqx {
  display: none
}

body:not(.pc) .eqgrid .slot {
  aspect-ratio: auto;
  height: 46px
}

body:not(.pc) .eqgrid .slot .it {
  aspect-ratio: auto;
  height: 100%
}

/* ===== Kenh chat (chat.js) ===== */
#chatBtn {
  right: auto;
  left: 8px;
  top: auto;
  bottom: 174px
}

#chatBtn em,
#pcChat .cbad {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 17px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #c8321f;
  color: #f5eddb;
  font: 700 10px/16px var(--font);
  font-style: normal;
  text-align: center
}

#chatBtn em:empty,
#pcChat .cbad:empty {
  display: none
}

#pcChat .pctabs button {
  position: relative
}

body.pc #chatBtn {
  display: none
}

.mbox:has(.chatwin) {
  width: min(100%, 560px)
}

.chatlist {
  height: min(52vh, 420px);
  overflow-y: auto;
  padding: 6px 8px;
  border: 1px solid #000;
  box-shadow: inset 0 0 1px 2px #0009;
  background: #0a0704;
  font-size: 13px;
  line-height: 1.5
}

.cm {
  padding: 2px 0;
  word-break: break-word
}

.cm time,
#pcLog .cm time {
  display: inline;
  margin-right: 5px;
  color: #6d7a72;
  font-size: 10.5px
}

.cm b {
  font-weight: 700
}

.cm small {
  margin-left: 3px;
  color: #998a73;
  font-size: 10px
}

.cm.sys {
  color: #e0c57b
}

.cm.sys b {
  color: #d7a956
}

.chatin {
  display: flex;
  gap: 6px;
  margin-top: 6px
}

.chatin input {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  font: 13px var(--font);
  color: var(--text);
  background: #060402;
  border: 1px solid #6e614e
}

.chatin.off {
  display: block;
  padding: 6px 8px;
  font-size: 12px;
  color: #9aa49e;
  border: 1px dashed #5a4432
}

#pcChatIn .chatin {
  margin: 0;
  padding: 3px;
  border-top: 1px solid #544131;
  background: #130e09e6
}

#pcChatIn .chatin input {
  padding: 3px 6px;
  font-size: 12px
}

#pcChatIn .chatin.off {
  margin: 0;
  border: 0;
  border-top: 1px solid #544131;
  font-size: 11px;
  padding: 4px 7px
}

#pcChat .pctabs {
  flex-wrap: nowrap
}

#pcChat .pctabs button {
  white-space: nowrap;
  padding: 2px 5px
}

body.pc #pcChat {
  width: min(440px, 36vw)
}

/* nut "Den ai..." (nhay toi ai bat ky) */
.stagectl:has(.stjump) {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 8px
}

.stagectl .stjump {
  grid-column: 1;
  justify-self: start;
  margin-top: 4px;
  padding: 3px 10px;
  font-size: 12px
}

.jumpwin .frow input {
  width: 120px;
  padding: 6px 8px;
  font: 15px var(--font)
}

.mbox:has(.jumpwin) {
  width: min(100%, 420px)
}

.pcstage #pcJump {
  white-space: nowrap
}

.warlock {
  margin: 0 0 8px;
  padding: 8px 10px;
  border-color: #a8864a !important;
  background: #2a200c !important;
  color: #e0c97b;
  font-size: 13px
}

/* bang ten nha tai tro bay ngang (donate.js dnFly) */
#dnFly {
  position: absolute;
  top: 62px;
  left: 0;
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 18px;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid #e0c67b;
  border-radius: 22px;
  background: linear-gradient(90deg, #5a0f3acc, #7a3a08e6 40%, #3a0f5ae6);
  box-shadow: 0 1px 2px #0009, inset 0 0 10px #0008;
  font: 600 13px/1.3 var(--font);
  color: #e0c67b;
  text-shadow: 0 1px 2px #000;
  animation: dnfly 22s linear 1 forwards
}

@keyframes dnfly {
  from {
    left: 0;
    transform: translateX(-100%)
  }

  to {
    left: 100%;
    transform: translateX(0)
  }
}

#dnFly .dnft {
  color: #e0c57b;
  font-size: 13.5px
}

#dnFly .dnfi i {
  font-style: normal;
  color: #e0c67b
}

#dnFly .dnfi b {
  color: #f5eddb
}

#dnFly .dnfi small {
  color: #e07b99;
  font-size: 11px
}

#dnFly .dnfi.t5 b {
  color: #688ab1
}

#dnFly .dnfi.t4 b {
  color: #e0c67b
}

#dnFly .thx {
  color: #e07b9d
}

body.pc #dnFly {
  top: 96px;
  font-size: 15px;
  padding: 8px 22px
}

.chatpin {
  position: sticky;
  top: -6px;
  z-index: 2;
  margin: -6px -8px 6px;
  padding: 6px 8px;
  border-bottom: 1px solid #a8864a;
  background: linear-gradient(#3a2c0cf2, #21190af2);
  color: #e0c97b;
  font-size: 12.5px;
  line-height: 1.45;
  word-break: break-word
}

#pcLog .chatpin {
  margin: -4px -7px 4px;
  top: -4px
}

.chatpin b {
  color: #d7a956
}

/* ghim chat: mac dinh 1 dong (bam de xem du); khung chat PC cao theo man hinh */
.chatpin {
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.chatpin.open {
  white-space: normal;
  overflow: visible
}

body.pc #pcChat {
  height: clamp(190px, 30vh, 320px)
}

body.pc #pcChat.min {
  height: auto
}

/* 10.6.6 Kim Nguyên Bảo (KNB) */
.gold.knb {
  margin-left: 6px
}

.knbi {
  width: 16px;
  height: 16px;
  object-fit: contain;
  vertical-align: middle
}

/* KNB khóa */
.gold.bknb {
  margin-left: 6px
}

.locki {
  font-size: 12px;
  vertical-align: middle;
  margin-right: 2px
}

.rktabs.rksub {
  margin-top: -4px
}

.rktabs.rksub button {
  padding: 4px;
  font-size: 12px
}

/* 10.7.1 Kỳ Trân Các: nhóm bên trái, lưới món bên phải; điện thoại: nhóm thành hàng ngang phía trên */
.ktcwin {
  position: relative;
  width: min(620px, 88vw)
}

/* kích thước cố định: đổi thẻ không làm khung co giãn */
.ktcpurse {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 2px 0 8px;
  font-size: 13px
}

.ktcpurse span {
  display: inline-flex;
  align-items: center;
  gap: 4px
}

.ktcpurse b {
  color: #e0c479
}

.ktcbody {
  display: flex;
  gap: 8px;
  height: min(440px, 60vh)
}

.ktctabs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: none;
  width: 112px
}

.ktctabs button {
  padding: 8px 6px;
  border: 1px solid #68513f;
  border-radius: 4px;
  background: #1d150f;
  color: #cbd;
  cursor: pointer;
  font: inherit;
  text-align: left
}

.ktctabs button.on {
  border-color: #e6c67a;
  color: #e6c67a;
  background: linear-gradient(#2a2412, #15110a)
}

.ktcgrid {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  grid-auto-rows: max-content;
  gap: 8px;
  align-content: start;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain
}

.ktcit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 6px;
  border: 1px solid #68513f;
  border-radius: 6px;
  background: #1d150f;
  color: #e9e2cf;
  cursor: pointer;
  font: inherit;
  text-align: center;
  height: auto;
  min-height: 118px;
  flex-shrink: 0;
  overflow: hidden
}

.ktcit:hover {
  border-color: #e6c67a
}

.ktcit i,
.ktchead i {
  font-style: normal;
  font-size: 28px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center
}

.ktcit i img,
.ktchead i img {
  width: 42px;
  height: 42px;
  object-fit: contain
}

.ktcit b {
  font-size: 12px;
  line-height: 1.25
}

.ktcit em,
.ktchead em {
  font-style: normal;
  font-size: 11px
}

.ktcps {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  justify-content: center
}

.ktcp {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  color: #e0c479
}

.ktcit.poor .ktcp b {
  color: #e06c5f
}

.ktcbuy {
  position: absolute;
  inset: 0;
  background: #000b;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  border-radius: 8px
}

.ktcbox {
  background: #231911;
  border: 1px solid #e6c67a;
  border-radius: 8px;
  padding: 12px;
  width: min(340px, 94%)
}

.ktchead {
  display: flex;
  gap: 10px;
  align-items: center
}

.ktchead span {
  display: flex;
  flex-direction: column
}

.ktcps.big {
  justify-content: flex-start;
  margin: 6px 0
}

.ktcps.big .ktcp {
  font-size: 15px
}

@media (max-width:560px) {
  .ktcwin {
    width: 100%
  }

  .ktcbody {
    flex-direction: column
  }

  .ktctabs {
    flex-direction: row;
    width: auto;
    overflow-x: auto
  }

  .ktctabs button {
    flex: 1;
    white-space: nowrap;
    text-align: center
  }

  .ktcgrid {
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    height: auto;
    flex: 1;
    min-height: 0
  }

  .ktcbody {
    height: min(520px, 62vh)
  }
}

#ktcMob {
  position: absolute;
  right: 10px;
  top: 180px;
  z-index: 5;
  width: 46px;
  min-height: 0;
  height: auto;
  padding: 4px 0 3px;
  border: 1px solid #b9954a;
  border-radius: 10px;
  background: rgba(14, 10, 6, .78);
  color: #f3e6c4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  cursor: pointer;
  line-height: 1
}

#ktcMob i {
  font-style: normal;
  font-size: 20px
}

#ktcMob small {
  font-size: 9px;
  white-space: nowrap
}

/* 10.7.2 Hộp thư */
.mlwin {
  width: min(560px, 88vw)
}

.mllist {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: min(420px, 58vh);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain
}

.mlit {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid #68513f;
  border-radius: 6px;
  background: #1d150f;
  flex-shrink: 0
}

.mlhd {
  grid-column: 1/-1;
  display: flex;
  flex-direction: column
}

.mlhd small {
  color: #b0a492
}

.mlatt {
  display: flex;
  flex-wrap: wrap;
  gap: 4px
}

.mlatt span {
  padding: 1px 6px;
  border-radius: 4px;
  background: #2a2412;
  color: #e0c479;
  font-size: 12px
}

@media (max-width:560px) {
  .mlwin {
    width: 100%
  }
}

/* 10.7.2 Chợ chung: kích thước cố định, danh sách cuộn, phân trang */
.mkwin {
  position: relative;
  width: min(620px, 88vw)
}

.mktabs button {
  flex: 1
}

.mkright {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%
}

.mkfull {
  height: min(440px, 60vh)
}

.mklist {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 6px
}

.mkit {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  border: 1px solid #68513f;
  border-radius: 6px;
  background: #1d150f;
  color: #e9e2cf;
  cursor: pointer;
  font: inherit;
  text-align: left;
  flex-shrink: 0;
  height: auto;
  min-height: 0
}

.mkit:hover {
  border-color: #e6c67a
}

.mkit i {
  font-style: normal;
  font-size: 24px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center
}

.mkit i img {
  width: 44px;
  height: 44px;
  object-fit: contain
}

.mkit span {
  display: flex;
  flex-direction: column;
  min-width: 0
}

.mkit b {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.mkit small {
  font-size: 11px;
  color: #b0a492
}

.mkit em {
  font-style: normal
}

.mkpg {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 12px;
  flex: none
}

.mkmats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px
}

.mkmat {
  display: flex;
  flex-direction: column;
  padding: 5px 6px;
  font-size: 12px !important;
  line-height: 1.3;
  min-height: 0;
  flex-shrink: 0;
  border: 1px solid #68513f;
  border-radius: 6px;
  background: #1d150f;
  color: #e9e2cf;
  cursor: pointer;
  font: inherit;
  text-align: left;
  height: auto
}

.mkmat small {
  color: #b0a492;
  font-size: 11px
}

.mkbox {
  width: min(380px, 94%);
  max-height: 90%;
  overflow-y: auto
}

.mkmode {
  display: flex;
  gap: 12px;
  margin: 6px 0;
  flex-wrap: wrap
}

.mkwin .ivgrid {
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr))
}

@media (max-width:560px) {
  .mkwin {
    width: 100%
  }

  .mkwin .ktcbody {
    height: min(520px, 62vh)
  }

  .mkfull {
    height: min(520px, 62vh)
  }
}

/* 01/11: thanh nhóm Zalo cố định đầu cửa sổ chat */
.chatzalo {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 6px;
  padding: 5px 9px;
  border: 1px solid #2f7a52;
  border-radius: 4px;
  background: linear-gradient(#123a26, #0c2619);
  color: #9be3bb;
  font-size: 12.5px;
  line-height: 1.35;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: none
}

.chatzalo b {
  margin-left: auto;
  color: #d7f5e3;
  font-weight: 700
}

.chatzalo:hover {
  border-color: #5fc48d;
  color: #d7f5e3
}

#pcChat .chatzalo {
  margin: 0;
  border-radius: 0;
  border-width: 0 0 1px;
  padding: 3px 8px;
  font-size: 12px
}

#pcChat.min .chatzalo {
  display: none
}

.chatzalo+.chatlist {
  height: min(calc(52vh - 36px), 384px)
}
/* 22/11 rương sự kiện (túi đồ + cửa sổ mở rương) */
.boxbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0
}

.boxit {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  border: 1px solid #6b5230;
  border-radius: 8px;
  background: #241a10;
  color: #e6c67a;
  cursor: pointer
}

.boxit img {
  width: 34px;
  height: 34px;
  object-fit: contain
}

.boxit b {
  position: absolute;
  left: 26px;
  bottom: 1px;
  font-size: 11px;
  color: #fff;
  text-shadow: 0 0 2px #000
}

.boxit small {
  font-size: 12px
}

.boxwin h3 img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  vertical-align: middle
}

.boxwin .boxlist {
  max-height: 46vh;
  overflow-y: auto;
  border: 1px solid #413225;
  border-radius: 6px;
  background: #1b140f;
  padding: 4px 8px;
  margin: 8px 0
}

.boxrow {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 0;
  border-bottom: 1px dashed #3a2c1e;
  font-size: 13px
}

.boxrow:last-child {
  border-bottom: 0
}

.boxrow i {
  font-style: normal;
  color: #7ebea0;
  white-space: nowrap
}
