/* style.css: Huyền Ảo Điện Ảnh theme (Dark Obsidian Glass · Antique Gold · Luminous Jade) */
:root {
  --ink: #070b11;
  --panel: rgba(11, 17, 26, 0.9);
  --panel2: rgba(16, 25, 37, 0.88);
  --border: rgba(214, 178, 102, 0.42);
  --gold: #cfa95a;
  --gold2: #f6df9e;
  --text: #e9eff7;
  --muted: #93a3b8;
  --jade: #5ee6c6;
  --jade-dark: #1d5750;
  --red: #e04646;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: var(--ink);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  color: var(--text);
  font-family: 'Noto Serif', 'Times New Roman', serif;
}
#game {
  display: block;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
}
#debug {
  position: fixed;
  left: 8px;
  bottom: 6px;
  font: 11px/1.3 monospace;
  color: #b7c8dd;
  text-shadow: 0 1px 3px #000;
  pointer-events: none;
  white-space: pre;
}
#loading {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--gold2);
  background: radial-gradient(circle at 50% 45%, #12202e, #06090f);
  letter-spacing: 2px;
  z-index: 50;
}
.hidden {
  display: none !important;
}

/* ---------- HUD ---------- */
#hud {
  position: fixed;
  inset: 0 0 auto 0;
  pointer-events: none;
  z-index: 5;
}
#xpbar {
  position: relative;
  height: 20px;
  background: linear-gradient(180deg, rgba(6, 11, 18, 0.88), rgba(10, 18, 28, 0.82));
  border-bottom: 1px solid rgba(214, 178, 102, 0.55);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}
#xpfill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #1b6b63, #3ec4ad, #8fffe5);
  box-shadow: 0 0 14px rgba(94, 230, 198, 0.65);
  transition: width 0.15s;
}
#xplabel {
  position: absolute;
  inset: 0;
  text-align: center;
  font-size: 13px;
  line-height: 20px;
  padding: 0 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #f4f8ff;
  letter-spacing: 0.4px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
}
#hudrow {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 8px 12px;
}
#timer {
  font-size: 28px;
  font-weight: bold;
  color: var(--gold2);
  letter-spacing: 1.5px;
  text-shadow: 0 0 14px rgba(246, 223, 158, 0.35), 0 2px 5px #000;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 24px;
}
#stats {
  display: flex;
  gap: 14px;
  font-size: 16px;
  color: #eef5ff;
  background: rgba(8, 14, 22, 0.65);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 12px;
  text-shadow: 0 1px 3px #000;
  margin-right: 44px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}
#stats img {
  width: 20px;
  height: 20px;
  vertical-align: -4px;
  margin-right: 4px;
}
.slots {
  display: flex;
  gap: 5px;
  margin-bottom: 5px;
}
.slot {
  position: relative;
  width: 40px;
  height: 40px;
  background: rgba(8, 14, 22, 0.78);
  border: 1px solid rgba(214, 178, 102, 0.6);
  border-radius: 6px;
  box-shadow: inset 0 0 8px rgba(94, 230, 198, 0.14), 0 3px 10px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
.slots.small .slot {
  width: 28px;
  height: 28px;
  border-color: rgba(94, 230, 198, 0.45);
}
.slot img {
  width: 100%;
  height: 100%;
}
.slot b {
  position: absolute;
  right: 2px;
  bottom: 0;
  font-size: 10px;
  color: var(--gold2);
  text-shadow: 0 0 3px #000, 0 0 4px #000;
}
#bossbar {
  position: absolute;
  top: 90px;
  left: 50%;
  transform: translateX(-50%);
  width: min(580px, 72vw);
  height: 16px;
  background: rgba(8, 10, 16, 0.82);
  border: 1px solid rgba(240, 118, 86, 0.8);
  border-radius: 999px;
  box-shadow: 0 0 22px rgba(224, 62, 42, 0.45), inset 0 1px 4px #000;
}
#bossfill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #751118, #d93829, #ff8547);
  box-shadow: 0 0 12px rgba(255, 102, 56, 0.7);
  transition: width 0.12s;
}
#bossname {
  position: absolute;
  top: -24px;
  width: 100%;
  text-align: center;
  font-size: 16px;
  font-weight: bold;
  letter-spacing: 1px;
  color: #ffd0b0;
  text-shadow: 0 0 10px rgba(255, 80, 40, 0.7), 0 2px 4px #000;
}
#pausebtn {
  position: fixed;
  right: 10px;
  top: 26px;
  z-index: 6;
  width: 34px;
  height: 32px;
  background: rgba(8, 14, 22, 0.72);
  color: var(--gold2);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
}
#pausebtn:hover {
  border-color: var(--gold2);
  background: rgba(20, 34, 48, 0.88);
}

/* ---------- minor news feed (right corner, G.UI.feed) ---------- */
#feed {
  position: fixed;
  right: 10px;
  top: 38%;
  width: min(260px, 46vw);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  pointer-events: none;
  z-index: 39;
}
.feed-row {
  max-width: 100%;
  padding: 3px 9px;
  background: rgba(10, 16, 26, 0.62);
  border-left: 2px solid rgba(255, 210, 120, 0.7);
  border-radius: 4px;
  font-size: 12px;
  color: var(--text, #eee);
  text-align: right;
  animation: feed 4.5s forwards;
}
@keyframes feed {
  0% { opacity: 0; transform: translateX(16px); }
  6% { opacity: 1; transform: none; }
  85% { opacity: 1; }
  100% { opacity: 0; }
}

/* ---------- toasts ---------- */
#toasts {
  position: fixed;
  top: auto;
  bottom: 96px;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  z-index: 9;
}
.toast {
  padding: 7px 18px;
  background: rgba(10, 16, 26, 0.86);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 15px;
  color: var(--text);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.55);
  animation: toast 3.2s forwards;
}
.toast.big {
  font-size: 22px;
  font-weight: bold;
  letter-spacing: 1px;
  color: #ffd1b5;
  border-color: rgba(255, 100, 68, 0.85);
  box-shadow: 0 0 24px rgba(255, 72, 40, 0.45), 0 8px 28px rgba(0, 0, 0, 0.7);
}
@keyframes toast {
  0% {
    opacity: 0;
    transform: translateY(-8px);
  }
  10%,
  80% {
    opacity: 1;
    transform: none;
  }
  100% {
    opacity: 0;
  }
}

/* ---------- overlay ---------- */
#overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 8, 14, 0.68);
  backdrop-filter: blur(5px);
  z-index: 10;
  padding: 16px;
}
#panel {
  background: linear-gradient(180deg, rgba(14, 22, 34, 0.95), rgba(8, 13, 21, 0.96));
  border: 1px solid var(--gold);
  box-shadow: 0 0 0 1px rgba(94, 230, 198, 0.16), 0 0 40px rgba(0, 0, 0, 0.82);
  border-radius: 10px;
  padding: 24px 28px;
  max-width: 650px;
  width: 100%;
  max-height: 92vh;
  overflow: auto;
  text-align: center;
}
#panel h1 {
  margin: 0 0 4px;
  font-size: 38px;
  color: var(--gold2);
  letter-spacing: 2px;
  text-shadow: 0 0 18px rgba(246, 223, 158, 0.3), 0 2px 8px #000;
}
#panel h2 {
  margin: 0 0 4px;
  font-size: 30px;
  color: var(--gold2);
  text-shadow: 0 0 14px rgba(246, 223, 158, 0.25);
}
.sub {
  margin: 0 0 14px;
  color: var(--muted);
}
.hint,
.credit {
  font-size: 13px;
  color: var(--muted);
  margin: 10px 0 0;
  line-height: 1.5;
}
.credit {
  font-size: 11px;
  opacity: 0.7;
}
#panel button {
  font: inherit;
  color: var(--text);
  background: rgba(22, 33, 48, 0.92);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 16px;
  margin: 4px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}
#panel button:hover {
  background: rgba(34, 52, 72, 0.95);
  border-color: var(--gold2);
}
#panel button.big {
  font-size: 20px;
  padding: 10px 28px;
  background: linear-gradient(180deg, #2b7b70, #174945);
  border-color: var(--jade);
  color: #f4fffd;
  box-shadow: 0 0 18px rgba(94, 230, 198, 0.25);
}
#panel button.big:hover {
  filter: brightness(1.16);
}
.row {
  margin: 8px 0;
}
.theme.on {
  background: #233c48 !important;
  color: var(--gold2) !important;
  border-color: var(--jade) !important;
}
#heroprev {
  display: block;
  margin: 0 auto;
}
.menu {
  max-width: 560px !important;
}

/* level-up cards (Ngộ đạo) */
.cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#panel .card {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  padding: 12px 16px;
  margin: 0;
  background: linear-gradient(90deg, rgba(18, 28, 42, 0.94), rgba(14, 23, 34, 0.86));
  border: 1px solid rgba(207, 169, 90, 0.45);
  border-radius: 8px;
  position: relative;
}
#panel .card:hover {
  background: linear-gradient(90deg, rgba(24, 46, 62, 0.98), rgba(18, 34, 48, 0.94));
  border-color: var(--jade);
  box-shadow: 0 0 18px rgba(94, 230, 198, 0.2);
  transform: translateY(-1px);
}
.card img {
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: 6px;
  background: rgba(6, 10, 16, 0.7);
  border: 1px solid rgba(207, 169, 90, 0.35);
}
.card h3 {
  margin: 0 0 4px;
  font-size: 18px;
  color: var(--gold2);
}
.card h3 i {
  font-size: 12px;
  color: var(--muted);
  font-style: normal;
  margin-left: 6px;
}
.card h3 i.new {
  color: var(--jade);
  text-shadow: 0 0 8px rgba(94, 230, 198, 0.5);
}
.card p {
  margin: 0;
  font-size: 14px;
  color: #dce6f2;
}
.card kbd {
  position: absolute;
  right: 10px;
  top: 8px;
  font-size: 11px;
  color: var(--gold);
  opacity: 0.75;
}
.chest {
  width: 72px;
}
.loots {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 16px;
  align-items: center;
}
.loot {
  display: flex;
  align-items: center;
  gap: 10px;
}
.loot img {
  width: 40px;
}
.loot i {
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
}
table.sum {
  margin: 6px auto 16px;
  border-collapse: collapse;
}
table.sum td {
  padding: 5px 14px;
  border-bottom: 1px solid rgba(207, 169, 90, 0.22);
  text-align: left;
}
table.sum td + td {
  text-align: right;
  color: var(--gold2);
}
.over.win h1 {
  color: var(--jade) !important;
}

@media (max-width: 600px) {
  #panel h1 {
    font-size: 28px;
  }
  #timer {
    font-size: 20px;
  }
  .card img {
    width: 42px;
    height: 42px;
  }
}

/* ---------- run bag, skill bar ---------- */
#runbag {
  position: fixed;
  left: 12px;
  bottom: 12px;
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  max-width: 50vw;
}
#runbag .slot {
  width: 34px;
  height: 34px;
}
#skillbar {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  gap: 12px;
  z-index: 6;
}
#skillbar .sk {
  position: relative;
  width: 58px;
  height: 58px;
  padding: 0;
  background: rgba(8, 14, 22, 0.84);
  border: 1px solid var(--gold);
  border-radius: 8px;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 0 14px rgba(94, 230, 198, 0.22), 0 4px 14px rgba(0, 0, 0, 0.65);
}
#skillbar .sk img {
  width: 100%;
  height: 100%;
}
#skillbar .cd {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0;
  background: rgba(4, 8, 14, 0.76);
  color: #fff;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#skillbar kbd {
  position: absolute;
  right: 3px;
  top: 1px;
  font-size: 10px;
  color: var(--gold2);
  text-shadow: 0 0 3px #000;
}
#panel button.danger,
#hub button.danger {
  border-color: rgba(224, 78, 72, 0.75);
  color: #ffb8b0;
  background: rgba(66, 18, 22, 0.75);
}
#panel button.danger:hover,
#hub button.danger:hover {
  background: rgba(98, 24, 28, 0.9);
}
s {
  opacity: 0.55;
  margin-left: 4px;
}

/* ---------- hub (sơn môn — dark cinematic obsidian & jade) ---------- */
#hub {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  gap: 18px;
  padding: 18px;
  box-sizing: border-box;
  background-size: cover;
  background-position: center;
  color: var(--text);
  overflow: auto;
}
#hub::before,
#create::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 45%, rgba(8, 14, 22, 0.28), rgba(4, 7, 13, 0.72) 78%);
  pointer-events: none;
  z-index: -1;
}
#hub .side {
  flex: none;
  width: 248px;
  background: linear-gradient(180deg, rgba(13, 21, 32, 0.9), rgba(8, 13, 22, 0.94));
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
  align-self: flex-start;
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.6);
}
#hub .side h2 {
  margin: 4px 0 8px;
  font-size: 21px;
  color: var(--gold2);
  text-shadow: 0 0 10px rgba(246, 223, 158, 0.25);
}
#hub .dname {
  margin: 2px 0 0;
  font-size: 18px;
  color: var(--jade);
  letter-spacing: 0.6px;
}
#hub .money img,
#hub .need img {
  width: 22px;
  vertical-align: -5px;
}
#hub .mini,
#hub .note,
#hub .stats {
  font-size: 13px;
  color: var(--muted);
}
#hub .bar {
  position: relative;
  height: 18px;
  background: rgba(5, 9, 15, 0.82);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}
#hub .bar.big {
  height: 26px;
  margin: 12px auto;
  max-width: 460px;
}
#hub .bar div {
  height: 100%;
  background: linear-gradient(90deg, #1b6b63, #3ec4ad, #8fffe5);
  box-shadow: 0 0 12px rgba(94, 230, 198, 0.55);
}
#hub .bar span {
  position: absolute;
  inset: 0;
  font-size: 12px;
  line-height: 18px;
  color: #f4f9ff;
  text-shadow: 0 1px 2px #000;
}
#hub .bar.big span {
  line-height: 26px;
  font-size: 14px;
}
#hub main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
#hub nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
#hub button {
  font: inherit;
  color: var(--text);
  background: rgba(18, 28, 42, 0.88);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 14px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
#hub button:hover:not(:disabled) {
  background: rgba(28, 46, 66, 0.95);
  border-color: var(--gold2);
}
#hub button:disabled {
  opacity: 0.42;
  cursor: default;
}
#hub nav button {
  font-size: 17px;
  padding: 8px 18px;
}
#hub nav button.on {
  background: linear-gradient(180deg, rgba(32, 74, 72, 0.95), rgba(16, 42, 46, 0.96));
  border-color: var(--jade);
  color: var(--gold2);
  box-shadow: 0 0 14px rgba(94, 230, 198, 0.25);
}
#hub button.big,
#hub button.go {
  background: linear-gradient(180deg, #2b7b70, #164844);
  border-color: var(--jade);
  color: #f6fffe;
  font-size: 17px;
  padding: 8px 22px;
  box-shadow: 0 0 16px rgba(94, 230, 198, 0.22);
}
#hub button.big:hover:not(:disabled),
#hub button.go:hover:not(:disabled) {
  filter: brightness(1.16);
}
#hubbody {
  background: linear-gradient(180deg, rgba(11, 18, 28, 0.88), rgba(7, 12, 20, 0.92));
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  flex: 1;
  overflow: auto;
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.55);
}
#hub h3 {
  margin: 0 0 4px;
  color: var(--gold2);
}
#hub h4 {
  margin: 6px 0;
  color: #c8d6e8;
}
#hub .empty {
  color: #6d7f96;
}

/* Map cards with 4 biome accent strips */
.maps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(275px, 1fr));
  gap: 14px;
}
.mapcard {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-top: 3px solid var(--gold);
  border-radius: 8px;
  padding: 14px;
  background: linear-gradient(180deg, rgba(18, 28, 42, 0.9), rgba(11, 18, 28, 0.92));
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  transition: transform 0.14s, border-color 0.14s;
}
.mapcard:not(.locked):hover {
  transform: translateY(-2px);
  border-color: var(--gold2);
}
.mapcard.theme-grass {
  border-top-color: #f0b85c;
}
.mapcard.theme-jade {
  border-top-color: #5ee6c6;
}
.mapcard.theme-earth {
  border-top-color: #ff6e3a;
}
.mapcard.theme-snow {
  border-top-color: #9e9eff;
}
.mapcard .maphead {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  margin-bottom: 6px;
}
.mapcard .drops {
  margin-top: auto;
  margin-bottom: 10px;
}
.mapcard button {
  align-self: flex-start;
}
.mapcard .mood {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(94, 230, 198, 0.12);
  border: 1px solid rgba(214, 178, 102, 0.35);
  color: var(--gold2);
  white-space: nowrap;
}
.mapcard.locked {
  opacity: 0.48;
}
.mapcard .req {
  font-size: 13px;
  color: var(--jade);
  margin: 0 0 6px;
}
.mapcard .boss {
  color: #ffb9a6;
}
.mapcard .drops img {
  width: 34px;
  margin-right: 4px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.35);
}

.tu {
  text-align: center;
  position: relative;
}
.tu .mountain {
  width: 260px;
  opacity: 0.85;
  filter: drop-shadow(0 6px 24px rgba(94, 230, 198, 0.25));
  border-radius: 8px;
}
.tu h1 {
  margin: 8px 0 4px;
  font-size: 32px;
  color: var(--gold2);
  text-shadow: 0 0 18px rgba(246, 223, 158, 0.3);
}
.tu .need {
  margin: 8px;
}
.recipe {
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid rgba(207, 169, 90, 0.2);
  padding: 10px 0;
}
.recipe .out {
  width: 64px;
}
.recipe > div {
  flex: 1;
}
.recipe p {
  margin: 0 0 4px;
  font-size: 14px;
  color: #c8d6e8;
}
.ins span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-right: 12px;
  font-size: 14px;
}
.ins img {
  width: 26px;
}
.ins .miss {
  color: #ff7c70;
}
.bag {
  display: flex;
  gap: 16px;
}
.bag .grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 64px);
  gap: 8px;
  flex: 1;
  align-content: start;
}
.bag .cell {
  position: relative;
  width: 64px;
  height: 64px;
  padding: 3px !important;
  background: rgba(10, 16, 25, 0.88) !important;
}
.bag .cell.on {
  outline: 2px solid var(--jade);
  box-shadow: 0 0 12px rgba(94, 230, 198, 0.35);
}
.bag .cell img {
  width: 100%;
  height: 100%;
}
.bag .cell b {
  position: absolute;
  right: 4px;
  bottom: 2px;
  font-size: 12px;
  color: var(--gold2);
  text-shadow: 0 0 3px #000, 0 0 3px #000;
}
.bag .detail {
  width: 260px;
  text-align: center;
  background: rgba(15, 24, 36, 0.72);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  align-self: flex-start;
}
.bag .detail img {
  width: 72px;
}
.cp {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.cp .slots {
  flex: 1;
  min-width: 260px;
}
.cp .learned {
  flex: 1.3;
  min-width: 300px;
}
.slotrow {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.slotrow h4 {
  width: 80px;
  margin: 0;
}
.eq {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  background: rgba(17, 28, 42, 0.85);
  font-size: 14px;
}
.eq img {
  width: 32px;
}
.eq.empty {
  color: #6b7d94;
  padding: 10px 12px;
  border-style: dashed;
  background: rgba(10, 16, 24, 0.45);
}
.eq button {
  padding: 2px 8px !important;
  font-size: 12px !important;
}
.skill {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(207, 169, 90, 0.18);
  padding: 8px 0;
}
.skill img {
  width: 48px;
  border-radius: 6px;
  background: rgba(6, 10, 16, 0.7);
}
.skill > div {
  flex: 1;
}
.skill p {
  margin: 0;
  font-size: 13px;
  color: #c5d4e6;
}
.skill .kind {
  color: var(--gold);
}
.skill i {
  font-style: normal;
  font-size: 12px;
  margin-left: 6px;
}
.skill .tag {
  font-size: 12px;
  color: var(--jade);
}
.market {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.market > div {
  flex: 1;
  min-width: 280px;
}
.trade {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(207, 169, 90, 0.18);
}
.trade img {
  width: 34px;
}
.trade span {
  flex: 1;
}
.trade b {
  color: var(--gold2);
  width: 44px;
  text-align: right;
}
.trade.locked {
  opacity: 0.5;
}
.trade em {
  font-style: normal;
  font-size: 12px;
  color: var(--muted);
}
.hubmodal {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 14, 0.72);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
}
.hubmodal .box {
  background: linear-gradient(180deg, rgba(16, 26, 40, 0.96), rgba(9, 15, 24, 0.98));
  border: 1px solid var(--gold);
  border-radius: 10px;
  padding: 22px 28px;
  max-width: 520px;
  text-align: center;
  color: var(--text);
  box-shadow: 0 12px 44px rgba(0, 0, 0, 0.75);
}
@media (max-width: 700px) {
  #hub {
    flex-direction: column;
  }
  #hub .side {
    width: auto;
    align-self: stretch;
  }
  .bag {
    flex-direction: column;
  }
}

/* ---------- character creation (6 Hero Presets + Linh Khí) ---------- */
#create {
  position: fixed;
  inset: 0;
  z-index: 25;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  padding: 16px;
  box-sizing: border-box;
  overflow: auto;
}
#create .cbox {
  display: flex;
  gap: 28px;
  align-items: center;
  background: linear-gradient(180deg, rgba(13, 21, 33, 0.92), rgba(7, 12, 20, 0.95));
  border: 1px solid var(--gold);
  border-radius: 12px;
  padding: 24px 30px;
  max-width: 960px;
  width: 100%;
  flex-wrap: wrap;
  justify-content: center;
  backdrop-filter: blur(10px);
  box-shadow: 0 14px 48px rgba(0, 0, 0, 0.75);
}
#create .cprev {
  text-align: center;
  width: 300px;
}
#create #cprev {
  width: 300px;
  height: 360px;
  background: radial-gradient(ellipse at 50% 82%, rgba(26, 62, 68, 0.35), rgba(6, 10, 18, 0.4) 68%);
  border: 1px solid rgba(207, 169, 90, 0.28);
  border-radius: 10px;
}
#create .cpdesc {
  margin: 8px 0 6px;
  font-size: 13px;
  color: var(--muted);
  min-height: 34px;
}
#hubhero {
  width: 200px;
  height: 220px;
}
#create .cform {
  flex: 1;
  min-width: 320px;
}
#create h1 {
  margin: 0 0 4px;
  font-size: 32px;
  color: var(--gold2);
  letter-spacing: 2px;
  text-shadow: 0 0 16px rgba(246, 223, 158, 0.28);
}
#create .csub {
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--muted);
}
#create .presets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
#create .pcard {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: 9px 12px;
  background: rgba(16, 26, 40, 0.85);
  border: 1px solid rgba(207, 169, 90, 0.34);
  border-radius: 8px;
  color: var(--text);
}
#create .pcard b {
  font-size: 15px;
  color: var(--gold2);
}
#create .pcard span {
  font-size: 12px;
  color: var(--muted);
}
#create .pcard.on {
  background: linear-gradient(135deg, rgba(28, 72, 70, 0.92), rgba(16, 36, 52, 0.95));
  border-color: var(--jade);
  box-shadow: 0 0 14px rgba(94, 230, 198, 0.28);
}
#create .pcard.on span {
  color: var(--jade);
}
#create .qpresets {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
#create .qpresets button {
  padding: 3px 9px;
  font-size: 13px;
}
#create .cidx {
  min-width: 68px;
  text-align: center;
  color: var(--gold2);
  font-size: 14px;
}
#create .randbtn {
  margin-left: auto;
  font-size: 13px;
}
#create .crow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
}
#create .crow > span {
  width: 78px;
  flex: none;
  color: var(--gold);
  font-size: 14px;
}
#create .auras {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
#create .abtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 13px;
}
#create .abtn i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
#create button {
  font: inherit;
  color: var(--text);
  background: rgba(18, 28, 42, 0.92);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 12px;
  cursor: pointer;
}
#create button:hover {
  background: rgba(28, 46, 66, 0.96);
  border-color: var(--gold2);
}
#create button.on {
  background: rgba(24, 62, 66, 0.95);
  border-color: var(--jade);
  color: var(--gold2);
}
#create .cactions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}
/* Đổi đạo thân: 2 tabs (Đạo Thân · Ngoại trang & Bồi luyện) */
#create .ctabs {
  display: flex;
  gap: 8px;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(207, 169, 90, 0.34);
}
#create .ctabs .ctab {
  flex: 1;
  font-weight: 700;
}
#create button.big {
  background: linear-gradient(180deg, #2b7b70, #164844);
  border-color: var(--jade);
  color: #f6fffe;
  font-size: 19px;
  padding: 10px 26px;
  box-shadow: 0 0 18px rgba(94, 230, 198, 0.25);
}
#create input {
  font: inherit;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(8, 14, 22, 0.9);
  color: var(--text);
  width: 185px;
}
#create .cmode {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
  margin-top: 6px;
}
#create .cmode button {
  padding: 4px 8px;
  font-size: 12.5px;
  white-space: nowrap;
}

/* cong phap tab: aligned slot cells, filters, glowing grades */
.cp .cpslots {
  flex: 1;
  min-width: 340px;
}
.cptitle {
  margin-top: 0 !important;
}
.cpslots .slotrow {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(207, 169, 90, 0.18);
}
.cpslots .slotrow h4 {
  width: 90px;
  flex: none;
  margin: 0;
  padding-top: 12px;
}
.cpslots .eq {
  min-width: 150px;
  min-height: 44px;
  box-sizing: border-box;
}
.cpslots .eq span {
  flex: 1;
  white-space: nowrap;
}
.cpslots .eq.empty {
  justify-content: center;
}
.cpslots .cells {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}
.cpslots .cells .eq {
  min-width: 0;
}
/* Equipped skill name gets its own full-width line: the icon + Gỡ button were squeezing
   it to ~47px (“Ngự …”, “Kiếm …”) on every desktop size. */
.cpslots .cells .eq {
  flex-wrap: wrap;
  row-gap: 3px;
}
.cpslots .cells .eq img {
  flex: 0 0 auto;
}
.cpslots .cells .eq button {
  order: 2;
  margin-left: auto;
}
.cpslots .cells .eq span {
  order: 3;
  flex: 1 0 100%;
  min-width: 0;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cpslots .cells .eq span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.cpf {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}
#hub .cpf button {
  padding: 4px 11px;
  font-size: 14px;
}
#hub .cpf button.on {
  background: rgba(24, 62, 66, 0.95);
  border-color: var(--jade);
  color: var(--gold2);
}
.skill i.grade {
  font-style: normal;
  font-size: 12px;
  font-weight: bold;
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 4px;
  border: 1px solid currentColor;
  text-shadow: none;
  vertical-align: 2px;
}
.skill i.g0 {
  color: #b7c4d6;
  background: rgba(183, 196, 214, 0.12);
}
.skill i.g1 {
  color: #6bc8ff;
  background: rgba(107, 200, 255, 0.14);
}
.skill i.g2 {
  color: #e49cff;
  background: rgba(228, 156, 255, 0.16);
}
.skill i.g3 {
  color: #ffd466;
  background: rgba(255, 212, 102, 0.18);
  box-shadow: 0 0 8px rgba(255, 212, 102, 0.35);
}

/* Skill grade comprehension progress bar (Công Pháp & Túi Càn Khôn) */
.grade-prog {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 300px;
}
.bag .detail .grade-prog {
  max-width: 100%;
  margin: 10px 0 8px;
}
.grade-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: rgba(232, 224, 200, 0.85);
}
.grade-head b {
  font-weight: 700;
  color: #f6df9e;
}
.grade-bar {
  height: 7px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(207, 169, 90, 0.28);
  overflow: hidden;
}
.grade-bar > i {
  display: block;
  height: 100%;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 99px;
  background: linear-gradient(90deg, #8fa3bc, #c9d6e6);
  transition: width 0.25s ease;
}
.grade-prog.g1 .grade-bar > i {
  background: linear-gradient(90deg, #3da4e8, #7fc8ff);
}
.grade-prog.g2 .grade-bar > i {
  background: linear-gradient(90deg, #b565e8, #e7b0ff);
}
.grade-prog.g3 .grade-bar > i,
.grade-prog.max .grade-bar > i {
  background: linear-gradient(90deg, #e5a524, #ffe184);
}
.grade-prog.max .grade-head b {
  color: #ffd466;
}
.bag-acts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}


/* ==========================================================================
 * QCBH XIANXIA LOBBY & CARVED SCROLL UI OVERHAUL
 * Authentic Tale of Immortal (Quỷ Cốc Bát Hoang) visual language:
 * - Live animated Canvas backdrop (#lobby-bg)
 * - Vertical calligraphy + Crimson Vermilion Seal (Ấn đỏ)
 * - Carved metallic-jade scroll plaques with double vertical endcaps
 * - Tapered black-ink brush-stroke side pills
 * - Carved bronze-gold corner-filigree scroll frames for all menus
 * ========================================================================== */

:root {
  --crimson: #a82020;
  --crimson2: #d6362c;
  --bronze: rgba(207, 169, 90, 0.55);
  --plaque-light: linear-gradient(180deg, rgba(226, 232, 238, 0.92) 0%, rgba(186, 198, 208, 0.88) 48%, rgba(145, 160, 174, 0.9) 100%);
  --plaque-dark: linear-gradient(180deg, rgba(22, 33, 46, 0.92) 0%, rgba(13, 21, 31, 0.95) 100%);
  --plaque-jade: linear-gradient(180deg, rgba(34, 96, 88, 0.96) 0%, rgba(17, 56, 54, 0.98) 100%);
  --plaque-gold: linear-gradient(180deg, rgba(168, 130, 62, 0.94) 0%, rgba(102, 74, 30, 0.96) 100%);
}

/* ---------- Persistent Animated Lobby Canvas ---------- */
#lobby-bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 15;
  pointer-events: none;
  display: block;
}

/* ---------- Full-Screen QCBH Title / Lobby Screen ---------- */
#lobby {
  position: fixed;
  inset: 0;
  z-index: 18;
  pointer-events: none;
  overflow: hidden;
}
#lobby button,
#lobby .hubmodal {
  pointer-events: auto;
}

/* Top-left: Black Ink Brush Splash + Vertical Calligraphy + Vermilion Seal */
.lb-title-wrap {
  position: absolute;
  top: 28px;
  left: 34px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  pointer-events: none;
}
.lb-ink-splash {
  position: absolute;
  left: 16px;
  top: -16px;
  width: 112px;
  height: 335px;
  background: radial-gradient(ellipse 56% 48% at 50% 42%, rgba(5, 7, 11, 0.88) 0%, rgba(5, 7, 11, 0.62) 55%, rgba(5, 7, 11, 0) 100%);
  transform: rotate(-4deg);
  filter: blur(2px);
  z-index: 0;
}
.lb-ink-splash::after {
  content: '';
  position: absolute;
  left: 44px;
  top: 26px;
  width: 26px;
  height: 315px;
  background: linear-gradient(180deg, rgba(4, 6, 10, 0.92) 0%, rgba(4, 6, 10, 0.85) 68%, rgba(4, 6, 10, 0) 100%);
  transform: skewX(-7deg);
  clip-path: polygon(25% 0%, 95% 4%, 72% 100%, 42% 96%, 10% 35%);
}
.lb-seal-col {
  position: relative;
  z-index: 2;
  padding-top: 8px;
}
.lb-seal {
  display: inline-block;
  padding: 7px 5px;
  background: linear-gradient(180deg, #b52424, #841515);
  border: 1px solid rgba(255, 224, 180, 0.78);
  box-shadow:
    inset 0 0 0 1px rgba(60, 8, 8, 0.6),
    0 4px 16px rgba(0, 0, 0, 0.68);
  color: #fff3df;
  font-size: 11px;
  font-weight: bold;
  line-height: 1.28;
  letter-spacing: 0.6px;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}
.lb-calligraphy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.02;
}
.lb-calligraphy span {
  display: block;
  font-family: 'Palatino Linotype', 'Noto Serif', 'Georgia', serif;
  font-size: 52px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 2px;
  color: #f7f3e8;
  -webkit-text-stroke: 2px #0b0e14;
  paint-order: stroke fill;
  text-shadow:
    0 3px 0 #090c11,
    0 6px 18px rgba(0, 0, 0, 0.95),
    0 0 26px rgba(246, 223, 158, 0.28);
}
.lb-calligraphy span:nth-child(2) {
  transform: translateX(10px);
}
.lb-calligraphy span:nth-child(3) {
  transform: translateX(-6px);
}
.lb-calligraphy span:nth-child(4) {
  transform: translateX(8px);
  color: #f6df9e;
}

/* Bottom-left: QCBH Carved Metallic-Jade Scroll Plaque Menu */
.lb-menu {
  position: absolute;
  left: 34px;
  bottom: 54px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  width: 274px;
}

.qcbh-plaque {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 11px 20px;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: #161e26;
  background: var(--plaque-light);
  border: 1px solid #2b3540;
  border-top: 2px solid rgba(255, 252, 240, 0.8);
  border-bottom: 2px solid rgba(40, 52, 66, 0.92);
  border-radius: 1px;
  cursor: pointer;
  box-shadow:
    inset 0 0 0 2px rgba(28, 38, 48, 0.25),
    inset 0 1px 10px rgba(255, 255, 255, 0.45),
    0 6px 20px rgba(0, 0, 0, 0.62);
  transition: transform 0.16s ease, filter 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  text-align: left;
  overflow: visible;
}
/* Carved double vertical scroll endcap spindles on both left & right edges */
.qcbh-plaque::before,
.qcbh-plaque::after {
  content: '';
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 8px;
  background: linear-gradient(90deg, #1b242d 0%, #7d8e9d 32%, #dfe7ee 52%, #556474 75%, #161d24 100%);
  border: 1px solid #141b22;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.75);
  pointer-events: none;
}
.qcbh-plaque::before {
  left: -4px;
}
.qcbh-plaque::after {
  right: -4px;
}
.qcbh-plaque .qp-ico {
  font-size: 17px;
  color: #243844;
  width: 22px;
  text-align: center;
  flex: none;
}
.qcbh-plaque .qp-txt {
  flex: 1;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}
.qcbh-plaque:hover {
  transform: translateX(5px);
  filter: brightness(1.07);
  border-color: var(--gold2);
  box-shadow:
    inset 0 0 0 2px rgba(207, 169, 90, 0.55),
    0 0 22px rgba(246, 223, 158, 0.42),
    0 8px 24px rgba(0, 0, 0, 0.72);
}
.qcbh-plaque:hover::before,
.qcbh-plaque:hover::after {
  background: linear-gradient(90deg, #3a2a12 0%, #c89f50 38%, #fff1c2 55%, #8b6729 78%, #2a1d0b 100%);
}
.qcbh-plaque.primary {
  background: linear-gradient(180deg, #f3ebd6 0%, #d8c7a0 52%, #b59d6c 100%);
  border-top-color: #fff8e2;
  border-bottom-color: #4f3a18;
  color: #1c1306;
  font-size: 17.5px;
  box-shadow:
    inset 0 0 0 2px rgba(122, 84, 24, 0.35),
    0 0 24px rgba(246, 223, 158, 0.32),
    0 8px 24px rgba(0, 0, 0, 0.7);
}
.qcbh-plaque.primary::before,
.qcbh-plaque.primary::after {
  background: linear-gradient(90deg, #2d1e09 0%, #c89f50 36%, #fff1c2 54%, #8a6424 78%, #261807 100%);
}
.qcbh-plaque.primary .qp-ico {
  color: #8f1d1d;
}
.qcbh-plaque.danger-plaque {
  background: linear-gradient(180deg, rgba(96, 26, 28, 0.94), rgba(58, 14, 18, 0.96));
  color: #ffded8;
  border-color: rgba(224, 86, 76, 0.65);
}
.qcbh-plaque.danger-plaque .qp-ico,
.qcbh-plaque.danger-plaque .qp-txt {
  color: #ffe2dc;
  text-shadow: 0 1px 3px #000;
}

/* Top-right: QCBH Ornate Status Plaques with Crimson Corner Ribbons */
.lb-top-right {
  position: absolute;
  top: 26px;
  right: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 248px;
}
.qcbh-badge-plaque {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  box-sizing: border-box;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  background: linear-gradient(180deg, rgba(235, 232, 220, 0.92), rgba(196, 192, 178, 0.88));
  border: 2px solid #8a7753;
  box-shadow:
    inset 0 0 0 2px rgba(255, 252, 240, 0.65),
    inset 0 0 0 3px rgba(96, 78, 48, 0.45),
    0 6px 20px rgba(0, 0, 0, 0.62);
  color: #1f1b15;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.qcbh-badge-plaque:hover {
  transform: translateX(-4px);
  filter: brightness(1.06);
  box-shadow:
    inset 0 0 0 2px rgba(255, 250, 228, 0.8),
    0 0 22px rgba(246, 223, 158, 0.38),
    0 8px 24px rgba(0, 0, 0, 0.72);
}
.qcbh-badge-plaque .bp-tag {
  flex: none;
  padding: 4px 6px;
  background: #fdf9ee;
  border: 1.5px solid var(--crimson);
  color: var(--crimson);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.3px;
  line-height: 1.1;
  text-transform: uppercase;
}
.qcbh-badge-plaque .bp-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.qcbh-badge-plaque .bp-main b {
  font-size: 15px;
  color: #181410;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qcbh-badge-plaque .bp-main em {
  font-style: normal;
  font-size: 12px;
  color: #4b4032;
}

/* Crimson Vermilion Corner Ribbon (echoing QCBH "Đã Nhận") */
.qcbh-ribbon {
  position: absolute;
  top: -8px;
  right: -6px;
  padding: 2px 10px 2px 12px;
  background: linear-gradient(90deg, #8b1414, #c62828 55%, #8f1414);
  border: 1px solid rgba(255, 220, 165, 0.75);
  color: #fff6e6;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.55);
  clip-path: polygon(6px 0%, 100% 0%, 100% 100%, 0% 100%);
  pointer-events: none;
}

/* Mid-right: Tapered Black-Ink Brush-Stroke Side Pills */
.lb-pills {
  position: absolute;
  right: 28px;
  top: 205px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.qcbh-ink-pill {
  position: relative;
  min-width: 174px;
  padding: 7px 22px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #edf1f7;
  background: linear-gradient(90deg, rgba(6, 9, 14, 0.72), rgba(10, 14, 21, 0.9) 50%, rgba(6, 9, 14, 0.72));
  border: none;
  clip-path: polygon(13px 0%, calc(100% - 13px) 0%, 100% 50%, calc(100% - 13px) 100%, 13px 100%, 0% 50%);
  cursor: pointer;
  text-align: center;
  text-shadow: 0 1px 3px #000;
  transition: transform 0.14s ease, color 0.14s ease, background 0.14s ease;
}
.qcbh-ink-pill::before {
  content: '';
  position: absolute;
  inset: 1px 10px;
  border-top: 1px solid rgba(214, 178, 102, 0.25);
  border-bottom: 1px solid rgba(214, 178, 102, 0.25);
  pointer-events: none;
}
.qcbh-ink-pill:hover {
  transform: translateX(-4px);
  color: var(--gold2);
  background: linear-gradient(90deg, rgba(18, 28, 38, 0.86), rgba(32, 48, 62, 0.95) 50%, rgba(18, 28, 38, 0.86));
}
.qcbh-ink-pill:hover::before {
  border-color: rgba(246, 223, 158, 0.65);
}
.qcbh-ink-pill.mini-pill {
  min-width: 112px;
  padding: 7px 16px;
  font-size: 13.5px;
}

/* Bottom Footer Strip */
.lb-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 30px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(4, 7, 12, 0.55), rgba(4, 7, 12, 0.92));
  border-top: 1px solid rgba(214, 178, 102, 0.22);
  font-size: 12px;
  color: rgba(226, 232, 240, 0.78);
  letter-spacing: 0.4px;
}
.lb-ver {
  color: var(--gold2);
  font-weight: 600;
}
.lb-motto {
  opacity: 0.85;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Lobby Modals (Wallpaper Gallery, Settings, Guide) */
.bg-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 8px;
}
.bg-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  overflow: hidden;
  background: #0a1018 !important;
  border: 1px solid rgba(207, 169, 90, 0.45) !important;
  text-align: left;
  cursor: pointer;
}
.bg-card img {
  width: 100%;
  height: 92px;
  object-fit: cover;
  display: block;
}
.bg-card .bg-meta {
  padding: 7px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bg-card .bg-meta b {
  font-size: 14px;
  color: var(--gold2);
}
.bg-card .bg-meta span {
  font-size: 11.5px;
  color: var(--muted);
}
.bg-card.on {
  border-color: var(--jade) !important;
  box-shadow: 0 0 16px rgba(94, 230, 198, 0.35);
}
.bg-card.on::after {
  content: 'Đang dùng';
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 2px 7px;
  background: var(--crimson);
  border: 1px solid rgba(255, 224, 172, 0.75);
  color: #fff6e6;
  font-size: 10.5px;
  font-weight: 700;
}
.set-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px auto 8px;
  max-width: 340px;
}
.lb-guide {
  text-align: left;
  font-size: 14.5px;
  line-height: 1.6;
  color: #dce6f2;
  margin: 10px 0;
}
.lb-guide b {
  color: var(--gold2);
}
.modal-acts {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

/* ==========================================================================
 * UNIFIED QCBH XIANXIA SCROLL FRAMES & PLAQUE BUTTONS FOR HUB, CREATE, PANELS
 * Replaces generic rounded HTML boxes/buttons with authentic carved frames!
 * ========================================================================== */

/* Carved Xianxia Scroll Frames (sharp corners + double bronze inner frame + corner L-brackets) */
#hub .side,
#hubbody,
#create .cbox,
#panel,
.hubmodal .box,
.bag .detail {
  border-radius: 2px;
  border: 1px solid rgba(207, 169, 90, 0.62);
  background-color: rgba(9, 14, 22, 0.82);
  background-image:
    linear-gradient(var(--gold2), var(--gold2)),
    linear-gradient(var(--gold2), var(--gold2)),
    linear-gradient(var(--gold2), var(--gold2)),
    linear-gradient(var(--gold2), var(--gold2)),
    linear-gradient(var(--gold2), var(--gold2)),
    linear-gradient(var(--gold2), var(--gold2)),
    linear-gradient(var(--gold2), var(--gold2)),
    linear-gradient(var(--gold2), var(--gold2)),
    linear-gradient(180deg, rgba(13, 21, 32, 0.84), rgba(7, 11, 18, 0.9));
  background-repeat: no-repeat;
  background-size:
    14px 2px, 2px 14px,
    14px 2px, 2px 14px,
    14px 2px, 2px 14px,
    14px 2px, 2px 14px,
    100% 100%;
  background-position:
    top 4px left 4px, top 4px left 4px,
    top 4px right 4px, top 4px right 4px,
    bottom 4px left 4px, bottom 4px left 4px,
    bottom 4px right 4px, bottom 4px right 4px,
    0 0;
  box-shadow:
    inset 0 0 0 1px rgba(214, 178, 102, 0.16),
    0 14px 44px rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(7px);
}

/* Map Cards: Carved Stele / Jade Tablet feel with biome strip & crimson cleared seal */
.mapcard {
  position: relative;
  border-radius: 2px;
  border: 1px solid rgba(207, 169, 90, 0.45);
  border-top: 3px solid var(--gold);
  background: linear-gradient(180deg, rgba(16, 25, 38, 0.86), rgba(9, 14, 22, 0.9));
  box-shadow:
    inset 0 0 0 1px rgba(214, 178, 102, 0.12),
    0 8px 24px rgba(0, 0, 0, 0.52);
}
.mapcard .qcbh-ribbon {
  top: 8px;
  right: -4px;
}
.mapcard .mood {
  border-radius: 1px;
  border-left: 2px solid var(--gold);
  border-right: 2px solid var(--gold);
  background: rgba(10, 20, 28, 0.75);
}

/* Hub Navigation Bar: Carved Wooden/Jade Tablets + Right Utility Ink Pills */
#hub nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
#hub .nav-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
#hub .nav-util {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* Replace generic rounded buttons across Hub, Create, Panel, Modals with Carved Scroll Plaques */
#hub button:not(.qcbh-ink-pill):not(.cell),
#create button,
#panel button:not(.card),
.hubmodal button:not(.qcbh-plaque):not(.bg-card) {
  border-radius: 1px;
  background: var(--plaque-dark);
  border: 1px solid rgba(207, 169, 90, 0.48);
  border-left: 3px double var(--gold);
  border-right: 3px double var(--gold);
  box-shadow:
    inset 0 1px 0 rgba(255, 245, 215, 0.14),
    inset 0 -1px 0 rgba(0, 0, 0, 0.55),
    0 3px 10px rgba(0, 0, 0, 0.42);
  letter-spacing: 0.4px;
}
#hub button:not(.qcbh-ink-pill):not(.cell):hover:not(:disabled),
#create button:hover:not(:disabled),
#panel button:not(.card):hover:not(:disabled),
.hubmodal button:not(.qcbh-plaque):not(.bg-card):hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(34, 52, 70, 0.96), rgba(18, 30, 44, 0.98));
  border-color: var(--gold2);
  color: var(--gold2);
  box-shadow:
    inset 0 1px 0 rgba(255, 248, 224, 0.25),
    0 0 14px rgba(246, 223, 158, 0.24),
    0 4px 14px rgba(0, 0, 0, 0.55);
}

/* Hub Tab Tablets: Crimson-Gold Seal Active State */
#hub .nav-tabs button {
  position: relative;
  font-size: 16.5px;
  padding: 8px 18px;
  background: linear-gradient(180deg, rgba(16, 24, 36, 0.9), rgba(10, 15, 24, 0.94));
}
#hub .nav-tabs button.on {
  background: linear-gradient(180deg, rgba(44, 32, 18, 0.94), rgba(22, 16, 10, 0.96));
  border-color: var(--gold2);
  border-left: 3px double var(--gold2);
  border-right: 3px double var(--gold2);
  color: #fff2cc;
  box-shadow:
    inset 0 -3px 0 var(--crimson2),
    0 0 16px rgba(246, 223, 158, 0.24);
}

/* Primary Action Plaques (.big, .go) — Imperial Jade-Gold Carved Plaque */
#hub button.big:not(.qcbh-ink-pill):not(.cell),
#hub button.go:not(.qcbh-ink-pill):not(.cell),
#create button.big,
#panel button.big:not(.card),
.hubmodal button.big:not(.qcbh-plaque):not(.bg-card) {
  background: var(--plaque-jade);
  border-color: var(--gold2);
  border-left: 4px double var(--gold2);
  border-right: 4px double var(--gold2);
  color: #fff8e4;
  font-weight: 700;
  letter-spacing: 0.7px;
  box-shadow:
    inset 0 1px 0 rgba(255, 252, 232, 0.3),
    0 0 18px rgba(94, 230, 198, 0.24),
    0 5px 16px rgba(0, 0, 0, 0.6);
}
#hub button.big:not(.qcbh-ink-pill):not(.cell):hover:not(:disabled),
#hub button.go:not(.qcbh-ink-pill):not(.cell):hover:not(:disabled),
#create button.big:hover:not(:disabled),
#panel button.big:not(.card):hover:not(:disabled),
.hubmodal button.big:not(.qcbh-plaque):not(.bg-card):hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(46, 122, 112, 0.98), rgba(24, 74, 70, 0.98));
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 252, 232, 0.45),
    0 0 22px rgba(94, 230, 198, 0.38),
    0 6px 20px rgba(0, 0, 0, 0.65);
}

/* Danger Plaques — Vermilion Seal */
#panel button.danger:not(.card),
#hub button.danger:not(.qcbh-ink-pill):not(.cell),
.hubmodal button.danger:not(.qcbh-plaque):not(.bg-card) {
  background: linear-gradient(180deg, rgba(116, 26, 28, 0.92), rgba(68, 14, 18, 0.96));
  border-color: rgba(235, 108, 92, 0.75);
  border-left: 3px double #f09080;
  border-right: 3px double #f09080;
  color: #ffe0da;
}

/* Active toggle states in Create & Cong Phap */
#create button.on,
#hub .cpf button.on {
  background: linear-gradient(180deg, rgba(32, 76, 72, 0.96), rgba(16, 44, 46, 0.98));
  border-color: var(--jade);
  border-left-color: var(--jade);
  border-right-color: var(--jade);
  color: var(--gold2);
}

/* Crisp architectural inputs & bars */
#create input {
  border-radius: 1px;
  border: 1px solid rgba(207, 169, 90, 0.55);
  background: rgba(6, 10, 16, 0.88);
}
#create #cprev {
  border-radius: 2px;
  border: 1px solid rgba(207, 169, 90, 0.42);
}
#hub .bar {
  border-radius: 1px;
  border: 1px solid rgba(207, 169, 90, 0.52);
}
#panel .card {
  border-radius: 2px;
  border-left: 3px double var(--gold);
  border-right: 3px double var(--gold);
}
.toast {
  border-radius: 1px;
  border-left: 3px double var(--gold2);
  border-right: 3px double var(--gold2);
}
.eq,
.slot,
#stats,
#pausebtn,
#skillbar .sk {
  border-radius: 2px;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 780px) {
  .lb-title-wrap {
    top: 14px;
    left: 16px;
  }
  .lb-calligraphy span {
    font-size: 36px;
  }
  .lb-menu {
    left: 16px;
    bottom: 42px;
    width: 205px;
    gap: 8px;
  }
  .qcbh-plaque {
    padding: 8px 14px;
    font-size: 14.5px;
  }
  .lb-top-right {
    top: 14px;
    right: 14px;
    width: 204px;
    gap: 10px;
  }
  .lb-pills {
    right: 14px;
    top: 175px;
  }
  .bg-grid {
    grid-template-columns: 1fr;
  }
}


/* ==========================================================================
 * UNIFIED SẢNH-FIRST ARCHITECTURE (NO MULTI-TAB HUB WALL)
 * Every menu button on the living Sảnh opens a focused QCBH Scroll Pavilion
 * floating cleanly over the animated backdrop, sized tightly to its content.
 * ========================================================================== */

/* Sảnh Top-Right Live Hero Plaque & Notification Dots */
.qcbh-badge-plaque.hero-card {
  padding: 7px 12px 7px 8px;
  gap: 9px;
}
#lbhero {
  width: 56px;
  height: 62px;
  flex: none;
  background: radial-gradient(ellipse at 50% 82%, rgba(28, 56, 62, 0.52), rgba(10, 15, 24, 0.92) 74%);
  border: 1px solid rgba(138, 119, 83, 0.85);
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.7);
}
.mini-bar {
  display: block;
  width: 100%;
  height: 5px;
  margin-top: 5px;
  background: rgba(24, 20, 16, 0.35);
  border: 1px solid rgba(110, 92, 62, 0.65);
  overflow: hidden;
}
.mini-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #1b786d, #48e0c4);
}
.qp-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
  margin-left: 4px;
  animation: qpPulse 1.6s infinite;
}
.qp-dot.red {
  background: #e03228;
  box-shadow: 0 0 8px rgba(224, 50, 40, 0.9);
}
.qp-dot.jade {
  background: #22c4a6;
  box-shadow: 0 0 8px rgba(34, 196, 166, 0.9);
}
@keyframes qpPulse {
  0%,
  100% {
    transform: scale(0.95);
    opacity: 0.85;
  }
  50% {
    transform: scale(1.22);
    opacity: 1;
  }
}

/* Reposition mid-right ink pills cleanly below the 2 top-right plaques */
.lb-pills {
  top: 214px;
}

/* Floating QCBH Scroll Pavilion Overlay (#hub) */
#hub {
  position: fixed;
  inset: 0;
  z-index: 22;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  background: rgba(4, 7, 13, 0.58);
  backdrop-filter: blur(4px);
  overflow: auto;
}
#hub::before {
  display: none;
}

.hub-win {
  width: 100%;
  max-width: 960px;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  border-radius: 2px;
  border: 1px solid rgba(207, 169, 90, 0.68);
  background-color: rgba(9, 14, 22, 0.88);
  background-image:
    linear-gradient(var(--gold2), var(--gold2)),
    linear-gradient(var(--gold2), var(--gold2)),
    linear-gradient(var(--gold2), var(--gold2)),
    linear-gradient(var(--gold2), var(--gold2)),
    linear-gradient(var(--gold2), var(--gold2)),
    linear-gradient(var(--gold2), var(--gold2)),
    linear-gradient(var(--gold2), var(--gold2)),
    linear-gradient(var(--gold2), var(--gold2)),
    linear-gradient(180deg, rgba(14, 22, 34, 0.92), rgba(7, 11, 18, 0.95));
  background-repeat: no-repeat;
  background-size:
    16px 2px, 2px 16px,
    16px 2px, 2px 16px,
    16px 2px, 2px 16px,
    16px 2px, 2px 16px,
    100% 100%;
  background-position:
    top 5px left 5px, top 5px left 5px,
    top 5px right 5px, top 5px right 5px,
    bottom 5px left 5px, bottom 5px left 5px,
    bottom 5px right 5px, bottom 5px right 5px,
    0 0;
  box-shadow:
    inset 0 0 0 1px rgba(214, 178, 102, 0.18),
    0 18px 56px rgba(0, 0, 0, 0.82);
  overflow: hidden;
}
.hub-win.win-map {
  max-width: 1120px;
}
.hub-win.win-tu {
  max-width: 900px;
}
.hub-win.win-dan {
  max-width: 900px;
}
.hub-win.win-bag {
  max-width: 900px;
}
.hub-win.win-cp {
  max-width: 1040px;
}
.hub-win.win-cho {
  max-width: 980px;
}

.hub-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: nowrap;
  padding: 13px 20px 11px;
  border-bottom: 1px solid rgba(207, 169, 90, 0.34);
  background: linear-gradient(180deg, rgba(22, 32, 46, 0.72), rgba(11, 17, 26, 0.35));
}
.hub-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.hub-seal {
  display: inline-block;
  flex: none;
  padding: 3px 8px;
  background: linear-gradient(180deg, #b52424, #841515);
  border: 1px solid rgba(255, 224, 175, 0.78);
  color: #fff4df;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
}
.hub-head h2 {
  margin: 0;
  font-size: 20px;
  color: var(--gold2);
  letter-spacing: 0.8px;
  white-space: nowrap;
  text-shadow: 0 0 12px rgba(246, 223, 158, 0.25);
}
.hub-res {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  margin-left: auto;
}
.res-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  font-size: 12.5px;
  white-space: nowrap;
  background: rgba(7, 12, 20, 0.72);
  border: 1px solid rgba(207, 169, 90, 0.32);
  color: #dce6f2;
}
.hub-close {
  flex: none;
  white-space: nowrap;
}
.res-chip.realm {
  color: var(--jade);
  font-weight: 600;
}
.res-chip.coin {
  color: var(--gold2);
  font-weight: 600;
}
.res-chip img {
  width: 16px;
  height: 16px;
}

/* Override old #hubbody frame since .hub-win now carries the outer carved scroll frame */
.hub-win #hubbody {
  background: none;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  padding: 18px 22px 20px;
  overflow: auto;
  flex: 1;
}

/* Map grid fits 4 cards cleanly on desktop without leaving a blank black void */
.win-map .maps {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

/* Each map card shows its own biome floor (same texture + base colour as in-game), graded dark for legible text */
.win-map .mapcard {
  isolation: isolate;
  overflow: hidden;
  background: var(--map-base, #101a26);
}
.win-map .mapcard::before,
.win-map .mapcard::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.win-map .mapcard::before {
  inset: -6%;
  background: var(--map-floor, none) center / 170% auto no-repeat var(--map-base, #101a26);
  transition: transform 0.5s ease;
}
.win-map .mapcard::after {
  background:
    radial-gradient(ellipse 120% 70% at 50% 0%, var(--map-glow, transparent), transparent 70%),
    linear-gradient(180deg, rgba(6, 12, 18, 0.5) 0%, rgba(6, 12, 18, 0.66) 40%, rgba(5, 9, 14, 0.9) 100%),
    radial-gradient(ellipse at 50% 45%, transparent 45%, rgba(3, 6, 10, 0.55) 100%);
}
.win-map .mapcard:not(.locked):hover::before {
  transform: scale(1.06);
}
.win-map .mapcard.locked::before {
  filter: grayscale(0.6);
}
.win-map .mapcard h3,
.win-map .mapcard p {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
}
.win-map .mapcard.theme-grass {
  --map-base: #647b58;
  --map-floor: url('../assets/floor/grass_1.webp');
  --map-glow: rgba(255, 196, 110, 0.2);
}
.win-map .mapcard.theme-jade {
  --map-base: #526967;
  --map-floor: url('../assets/floor/jade_1.webp');
  --map-glow: rgba(94, 230, 198, 0.18);
}
.win-map .mapcard.theme-earth {
  --map-base: #685d50;
  --map-floor: url('../assets/floor/earth_1.webp');
  --map-glow: rgba(255, 110, 58, 0.2);
}
.win-map .mapcard.theme-snow {
  --map-base: #798ea7;
  --map-floor: url('../assets/floor/snow_1.webp');
  --map-glow: rgba(170, 170, 255, 0.2);
}

.map-foot {
  margin: 14px 0 0;
  text-align: center;
}

/* Động Phủ Tu Luyện (2-column compact showcase) */
.tu-wrap {
  display: flex;
  gap: 24px;
  align-items: center;
}
.tu-hero {
  flex: none;
  width: 230px;
  text-align: center;
  padding: 12px 10px 14px;
  background: radial-gradient(ellipse at 50% 72%, rgba(24, 58, 64, 0.34), rgba(6, 10, 18, 0.65) 74%);
  border: 1px solid rgba(207, 169, 90, 0.32);
}
.tu-hero #hubhero {
  width: 210px;
  height: 240px;
  display: block;
  margin: 0 auto;
}
.tu-hero .dname {
  margin: 4px 0 2px;
  font-size: 18px;
  color: var(--jade);
}
.tu-hero .mini {
  margin: 4px 0 10px;
}
.tu-hero .mini b {
  color: var(--gold2);
}
.tu-main {
  flex: 1;
  min-width: 0;
  text-align: center;
}
.tu-main h1 {
  margin: 0 0 8px;
  font-size: 32px;
  color: var(--gold2);
  text-shadow: 0 0 18px rgba(246, 223, 158, 0.3);
}
.tu-act {
  margin: 14px 0;
}
.tu-act .need {
  margin-bottom: 10px;
  font-size: 15px;
}
.tu-links {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

@media (max-width: 980px) {
  .win-map .maps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 680px) {
  .win-map .maps {
    grid-template-columns: 1fr;
  }
  .tu-wrap {
    flex-direction: column;
  }
  .tu-hero {
    width: 100%;
    box-sizing: border-box;
  }
  .hub-res {
    margin-left: 0;
  }
}


/* ==========================================================================
 * AUTHENTIC QCBH UI SPRITE SKINNING (REAL EXTRACTED GAME TEXTURES)
 * Uses actual hand-painted QCBH sprites from assets/ui/:
 * - scroll_btn.webp / scroll_btn_hover.webp (LoginButton_normal + LoginButton_Shank + hl)
 * - plaque_dlc.webp / plaque_dlc_gold.webp (LoginButton_normal_DLC / DLC1)
 * - ink_pill.webp (LoginButton_black_1)
 * - ribbon_red.webp (qiyundi)
 * - btn_stone.webp / btn_stone_hover.webp (tupocailiaoshuominganniu_1 / dengxiananniu)
 * - btn_gold.webp / btn_gold_hover.webp (kaishichuangguan_2 / kaishichuangguan)
 * - btn_close.webp (tuichu)
 * ========================================================================== */

/* Bottom-left Main Sảnh Menu — REAL QCBH Hand-Painted Ink-Wash Scroll Buttons */
.lb-menu {
  left: 28px;
  bottom: 48px;
  gap: 8px;
  width: 284px;
}
.qcbh-plaque,
.qcbh-plaque.primary {
  width: 100%;
  height: 58px;
  padding: 0 26px 0 22px;
  gap: 8px;
  background: url('../assets/ui/scroll_btn.webp') center / 100% 100% no-repeat;
  border: none;
  border-radius: 0;
  box-shadow: none;
  color: #10141a;
  font-family: 'Segoe UI', 'Tahoma', 'Noto Sans', sans-serif;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.55));
  transition: transform 0.14s ease, filter 0.14s ease, background-image 0.14s ease;
}
.qcbh-plaque::before,
.qcbh-plaque::after {
  display: none !important;
}
.qcbh-plaque:hover,
.qcbh-plaque.primary:hover {
  transform: translateX(4px);
  background-image: url('../assets/ui/scroll_btn_hover.webp');
  box-shadow: none;
  filter: drop-shadow(0 0 12px rgba(246, 223, 158, 0.45)) drop-shadow(0 5px 12px rgba(0, 0, 0, 0.65));
}
.qcbh-plaque.primary .qp-txt {
  color: #0b0e14;
  font-weight: 700;
}
.qcbh-plaque .qp-img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  flex: none;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.45));
}
.qcbh-plaque .qp-img.cauldron {
  width: 30px;
  height: 28px;
  margin-left: -2px;
}
.qcbh-plaque .qp-txt {
  flex: 1;
  text-align: center;
  padding-right: 4px;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}
.qcbh-plaque.danger-plaque {
  background: url('../assets/ui/scroll_btn.webp') center / 100% 100% no-repeat;
  color: #6c1212;
}
.qcbh-plaque.danger-plaque .qp-txt {
  color: #7c1414;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* Top-Right Ornate Plaques — REAL QCBH Mountain & Golden Cloud Parchment Art */
.lb-top-right {
  top: 22px;
  right: 24px;
  width: 274px;
  gap: 10px;
}
.qcbh-badge-plaque {
  height: 76px;
  padding: 8px 18px 8px 14px;
  background: url('../assets/ui/plaque_dlc.webp') center / 100% 100% no-repeat;
  border: none;
  box-shadow: none;
  filter: drop-shadow(0 5px 14px rgba(0, 0, 0, 0.65));
}
.qcbh-badge-plaque.gold-card {
  background-image: url('../assets/ui/plaque_dlc_gold.webp');
}
.qcbh-badge-plaque:hover {
  transform: translateX(-4px);
  box-shadow: none;
  filter: brightness(1.06) drop-shadow(0 0 12px rgba(246, 223, 158, 0.4)) drop-shadow(0 6px 14px rgba(0, 0, 0, 0.72));
}
.qcbh-badge-plaque.hero-card {
  padding: 8px 16px 8px 12px;
}
#lbhero {
  width: 50px;
  height: 54px;
  border-color: rgba(112, 92, 62, 0.9);
}
.qcbh-badge-plaque .bp-tag {
  background: rgba(255, 250, 238, 0.85);
  border: 1.5px solid #9e1b1b;
  color: #9e1b1b;
}

/* Real QCBH Crimson Ink-Brush Ribbon */
.qcbh-ribbon {
  top: -7px;
  right: 4px;
  padding: 4px 14px 5px;
  background: url('../assets/ui/ribbon_red.webp') center / 100% 100% no-repeat;
  border: none;
  clip-path: none;
  box-shadow: none;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.6));
  font-size: 11px;
  letter-spacing: 0.4px;
}

/* Right-Side Tapered Black-Ink Brush Pills — REAL QCBH LoginButton_black_1 */
.lb-pills {
  right: 26px;
  top: 196px;
  gap: 5px;
}
.qcbh-ink-pill {
  min-width: 184px;
  height: 36px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: url('../assets/ui/ink_pill.webp') center / 100% 100% no-repeat;
  clip-path: none;
  border: none;
  color: #f0f2f6;
  font-size: 14px;
  font-weight: 600;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
}
.qcbh-ink-pill::before {
  display: none !important;
}
.qcbh-ink-pill:hover {
  transform: translateX(-4px);
  color: var(--gold2);
  background: url('../assets/ui/ink_pill.webp') center / 100% 100% no-repeat;
  filter: brightness(1.3) drop-shadow(0 0 10px rgba(246, 223, 158, 0.42));
}

/* Real QCBH Circular Carved Bronze Close Button inside Pavilions */
.hub-close-x {
  width: 38px;
  height: 38px;
  padding: 0 !important;
  flex: none;
  background: url('../assets/ui/btn_close.webp') center / contain no-repeat !important;
  border: none !important;
  box-shadow: none !important;
  cursor: pointer;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.65));
  transition: transform 0.14s ease, filter 0.14s ease;
}
.hub-close-x:hover {
  transform: scale(1.1) rotate(90deg);
  filter: brightness(1.22) drop-shadow(0 0 10px rgba(246, 223, 158, 0.55));
}

/* Real QCBH Carved Stone & Imperial Gold Buttons inside ALL Pavilions, Create & Modals */
#hub button:not(.qcbh-ink-pill):not(.cell):not(.hub-close-x),
#create button,
#panel button:not(.card),
.hubmodal button:not(.qcbh-plaque):not(.bg-card) {
  background: url('../assets/ui/btn_stone.webp') center / 100% 100% no-repeat;
  border: none;
  box-shadow: none;
  color: #ece6d8;
  padding: 7px 18px;
  min-height: 34px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.45));
}
#hub button:not(.qcbh-ink-pill):not(.cell):not(.hub-close-x):hover:not(:disabled),
#create button:hover:not(:disabled),
#panel button:not(.card):hover:not(:disabled),
.hubmodal button:not(.qcbh-plaque):not(.bg-card):hover:not(:disabled) {
  background: url('../assets/ui/btn_stone_hover.webp') center / 100% 100% no-repeat;
  color: #fff2cc;
  box-shadow: none;
  filter: brightness(1.12) drop-shadow(0 0 10px rgba(246, 223, 158, 0.35));
}

/* Primary Action Buttons (Xuất phát, Bước vào tiên đồ, Tu luyện, Đột phá, Luyện đan) — REAL QCBH Gold Button */
#hub button.big:not(.qcbh-ink-pill):not(.cell):not(.hub-close-x),
#hub button.go:not(.qcbh-ink-pill):not(.cell):not(.hub-close-x),
#create button.big,
#panel button.big:not(.card),
.hubmodal button.big:not(.qcbh-plaque):not(.bg-card) {
  background: url('../assets/ui/btn_gold.webp') center / 100% 100% no-repeat;
  border: none;
  box-shadow: none;
  color: #fff8de;
  font-weight: 800;
  padding: 9px 26px;
  min-height: 40px;
  text-shadow: 0 1px 3px rgba(24, 14, 2, 0.95), 0 0 6px rgba(0, 0, 0, 0.7);
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.6));
}
#hub button.big:not(.qcbh-ink-pill):not(.cell):not(.hub-close-x):hover:not(:disabled),
#hub button.go:not(.qcbh-ink-pill):not(.cell):not(.hub-close-x):hover:not(:disabled),
#create button.big:hover:not(:disabled),
#panel button.big:not(.card):hover:not(:disabled),
.hubmodal button.big:not(.qcbh-plaque):not(.bg-card):hover:not(:disabled) {
  background: url('../assets/ui/btn_gold_hover.webp') center / 100% 100% no-repeat;
  color: #1f1404;
  text-shadow: 0 1px 0 rgba(255, 250, 220, 0.6);
  box-shadow: none;
  filter: drop-shadow(0 0 14px rgba(255, 224, 130, 0.55));
}

/* Active toggle states in Create & Cong Phap — Luminous Gold-Stone Highlight */
#create button.on,
#hub .cpf button.on {
  background: url('../assets/ui/btn_stone_hover.webp') center / 100% 100% no-repeat;
  color: #ffe8a3;
  filter: drop-shadow(0 0 8px rgba(94, 230, 198, 0.55));
}
#create .qpresets button,
#create .cmode button,
#create .abtn,
#hub .cpf button,
.eq button {
  padding: 5px 12px;
  min-height: 28px;
}

/* Pavilion Header with subtle QCBH golden light-flare divider */
.hub-head {
  position: relative;
}
.hub-head::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -14px;
  height: 28px;
  background: url('../assets/ui/header_glow.webp') center / 100% 100% no-repeat;
  pointer-events: none;
  opacity: 0.72;
}


/* ==========================================================================
 * RIGHT-COLUMN QCBH COMPOSITION POLISH
 * Mirrors QCBH's exact right stack:
 * - 2 full-width Misty Mountain / Golden Cloud plaques with solid red ink seal
 * - 1 slightly narrower Bowuzhi silver-gold plaque (Bát Hoang Cẩm Nang)
 * - 3 cleanly separated clusters of organic dry-brush black-ink pills
 * ========================================================================== */
.lb-right-col {
  position: absolute;
  top: 22px;
  right: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 16px;
  pointer-events: none;
}
.lb-right-col button {
  pointer-events: auto;
}
.lb-right-col .lb-top-right {
  position: static;
  width: 286px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
}
.lb-right-col .lb-pills {
  position: static;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 13px;
}
.pill-group {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

/* Solid Crimson Vermilion Ink Stamp Seal inside Plaque #2 (matching QCBH's red DLC seal) */
.bp-seal-stamp {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: linear-gradient(160deg, #b82121, #841212);
  border: 1.5px solid rgba(255, 224, 178, 0.72);
  box-shadow:
    inset 0 0 0 1px rgba(64, 6, 6, 0.55),
    0 2px 6px rgba(0, 0, 0, 0.38);
  color: #fff5e2;
  font-family: 'Segoe UI', 'Tahoma', sans-serif;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

/* Keep plaque stats cleanly on 1 line with sharp Vietnamese legibility */
.qcbh-badge-plaque .bp-main {
  font-family: 'Segoe UI', 'Tahoma', 'Noto Sans', sans-serif;
}
.qcbh-badge-plaque .bp-main b {
  font-size: 15.5px;
  font-weight: 700;
  color: #16130f;
}
.qcbh-badge-plaque .bp-main em {
  font-size: 12px;
  color: #3a3126;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Plaque #3: QCBH Bowuzhi Antique Silver-Gold Plaque (Bát Hoang Cẩm Nang) */
.qcbh-bowuzhi-plaque {
  position: relative;
  width: 238px;
  height: 54px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: url('../assets/ui/plaque_bowuzhi.webp') center / 100% 100% no-repeat;
  border: none;
  cursor: pointer;
  color: #14120e;
  font-family: 'Segoe UI', 'Tahoma', 'Noto Sans', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.2px;
  filter: drop-shadow(0 5px 12px rgba(0, 0, 0, 0.65));
  transition: transform 0.14s ease, filter 0.14s ease;
}
.qcbh-bowuzhi-plaque .bw-txt {
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
  white-space: nowrap;
}
.qcbh-bowuzhi-plaque:hover {
  transform: translateX(-4px);
  filter: brightness(1.08) drop-shadow(0 0 12px rgba(246, 223, 158, 0.42)) drop-shadow(0 6px 14px rgba(0, 0, 0, 0.7));
}

/* Crimson Brush Ribbon tuned to QCBH's calligraphic corner stamp */
.lb-right-col .qcbh-ribbon {
  top: -10px;
  right: -6px;
  padding: 5px 16px 6px;
  font-family: 'Segoe UI', 'Tahoma', sans-serif;
  font-size: 11.5px;
  font-weight: 800;
  font-style: italic;
  letter-spacing: 0.3px;
}

/* Right-side organic dry-brush black ink pills with crisp sans-serif text like QCBH */
.lb-right-col .qcbh-ink-pill {
  min-width: 196px;
  height: 38px;
  padding: 0 24px;
  font-family: 'Segoe UI', 'Tahoma', 'Noto Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: #f4f6f9;
}

@media (max-width: 780px) {
  .lb-right-col {
    top: 12px;
    right: 12px;
    gap: 10px;
  }
  .lb-right-col .lb-top-right {
    width: 236px;
    gap: 10px;
  }
  .qcbh-bowuzhi-plaque {
    width: 204px;
    height: 46px;
    font-size: 13.5px;
  }
  .lb-right-col .qcbh-ink-pill {
    min-width: 168px;
    height: 34px;
    font-size: 13px;
  }
}


/* ---------- 10-Realm Ornament Selector in Đổi Đạo Thân & Động Phủ Canvas ---------- */
.tu-hero {
  width: 280px;
}
.tu-hero #hubhero {
  width: 260px;
  height: 260px;
}
#create .cprev {
  width: 320px;
}
#create #cprev {
  width: 320px;
  height: 360px;
}
#create .cfxdesc {
  margin: 6px 0 8px;
  font-size: 12.5px;
  line-height: 1.35;
  color: #b8c9dc;
  min-height: 32px;
}
#create .cfxdesc b {
  color: var(--gold2);
}
#create .rfx-ctrl {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
#create .rfx-ctrl button {
  padding: 4px 11px;
  min-height: 28px;
  font-size: 13px;
}
#create .rfx-name {
  min-width: 120px;
  text-align: center;
  font-size: 13.5px;
  color: var(--gold2);
}
#create .rfx-lock {
  font-style: normal;
  font-size: 12.5px;
  color: var(--muted);
  margin-left: 4px;
}

/* Phuong Thi: buy / sell tabs, category chips, two-column list */
.cho-mode {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(207, 169, 90, 0.3);
  padding-bottom: 8px;
}
#hub .cho-mode button {
  min-width: 110px;
  font-size: 16px;
  opacity: 0.7;
}
#hub .cho-mode button.on {
  opacity: 1;
  color: var(--gold2);
  border-color: var(--gold2);
  box-shadow: 0 0 12px rgba(246, 223, 158, 0.25);
}
.cho-mode button em,
#hub .cpf button em {
  font-style: normal;
  font-size: 11px;
  opacity: 0.75;
  margin-left: 2px;
}
.cho-opt {
  margin-left: auto;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.cho-opt b {
  color: var(--gold2);
}
.cho .cpf {
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.cho-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 22px;
  max-height: 56vh;
  overflow-y: auto;
  padding-right: 4px;
}
.cho-list .empty {
  grid-column: 1 / -1;
}
.cho-list .trade span {
  min-width: 0;
}
.trade em.ok {
  color: var(--jade);
}
@media (max-width: 760px) {
  .cho-list {
    grid-template-columns: 1fr;
  }
}

/* Every hub window opens at the same fixed size; long content scrolls inside (#hubbody) */
.hub-win,
.hub-win.win-map,
.hub-win.win-tu,
.hub-win.win-dan,
.hub-win.win-bag,
.hub-win.win-cp,
.hub-win.win-cho {
  width: min(1120px, 94vw);
  max-width: none;
  height: min(760px, 88vh);
  max-height: none;
}
.cho-list {
  max-height: none;
  overflow: visible;
}
.cp-opt {
  margin: 0 0 8px;
}
/* Dan Lo: realm tag, owned count, craftable highlight */
.recipe h3 em {
  font-style: normal;
  font-size: 12px;
  margin-left: 6px;
  font-weight: normal;
}
.recipe .dan-tag {
  color: #ffb9a6;
}
.recipe .dan-have {
  color: var(--jade);
}
.recipe.ready {
  box-shadow: inset 3px 0 0 var(--jade);
}
.recipe button em {
  font-style: normal;
  font-size: 12px;
  opacity: 0.85;
}


/* ---------- Động Phủ Tu Luyện: Dual Current vs Next Major Realm Preview ---------- */
.hub-win.win-tu {
  max-width: 1080px;
}
.tu-wrap {
  display: flex;
  gap: 18px;
  align-items: stretch;
}
.tu-hero {
  flex: none;
  width: 256px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 12px 10px 14px;
  box-sizing: border-box;
  background: radial-gradient(ellipse at 50% 66%, rgba(24, 58, 64, 0.3), rgba(6, 10, 18, 0.72) 76%);
  border: 1px solid rgba(207, 169, 90, 0.36);
}
.tu-hero.next {
  background: radial-gradient(ellipse at 50% 60%, rgba(207, 169, 90, 0.14), rgba(6, 10, 18, 0.76) 76%);
  border-color: rgba(246, 223, 158, 0.56);
  box-shadow: inset 0 0 22px rgba(246, 223, 158, 0.08);
}
.tu-hero #hubhero,
.tu-hero #hubhero-next {
  width: 240px;
  height: 230px;
  display: block;
  margin: 4px auto 0;
}
.tu-tag {
  display: inline-block;
  padding: 2px 10px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #dce6f2;
  background: rgba(14, 24, 36, 0.88);
  border: 1px solid rgba(207, 169, 90, 0.45);
}
.tu-tag.next-tag {
  background: linear-gradient(90deg, #8b1818, #b82626 55%, #8b1818);
  border-color: rgba(255, 224, 172, 0.78);
  color: #fff5e0;
  box-shadow: 0 2px 10px rgba(180, 32, 32, 0.45);
}
#hub .tu-hero .next-name {
  color: var(--rcol, var(--gold2));
  text-shadow: 0 0 10px rgba(246, 223, 158, 0.28);
}
.tu-fxdesc {
  margin: 4px 0 4px;
  font-size: 12px;
  line-height: 1.35;
  color: #b7c8db;
  min-height: 32px;
  padding: 0 6px;
}
.tu-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.tu-main .bar.big {
  width: 100%;
  max-width: 420px;
}
@media (max-width: 920px) {
  .tu-wrap {
    flex-direction: column;
    align-items: center;
  }
  .tu-hero {
    width: 100%;
    max-width: 340px;
  }
}


/* ---------- High-Visibility Realm Rank Badge on Sảnh Hero Card ---------- */
.lb-right-col .lb-top-right {
  width: 300px;
}
.qcbh-badge-plaque.hero-card {
  height: 84px;
  padding: 7px 14px 7px 11px;
}
.qcbh-badge-plaque.hero-card .bp-main {
  flex: 1;
  gap: 3px;
}
.bp-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.stage-pips {
  display: inline-flex;
  gap: 3px;
  align-items: center;
  flex: none;
}
.stage-pips i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(24, 20, 16, 0.25);
  border: 1px solid rgba(72, 56, 36, 0.72);
}
.stage-pips i.on {
  background: #1ea88f;
  border-color: #0e4a40;
  box-shadow: 0 0 5px rgba(30, 168, 143, 0.7);
}
/* Nửa bước: a gold half-moon pip after Đỉnh phong */
.stage-pips i.half {
  width: 4px;
  border-radius: 0 7px 7px 0;
  background: #e8b84a;
  border-color: #7a5a18;
  box-shadow: 0 0 5px rgba(232, 184, 74, 0.8);
}
.bp-realm-pill {
  display: inline-block;
  align-self: flex-start;
  padding: 1px 8px 2px;
  background: rgba(11, 17, 26, 0.9);
  border: 1px solid rgba(207, 169, 90, 0.65);
  border-left: 3px solid var(--rc, #5ee6c6);
  color: var(--rc, #5ee6c6);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  line-height: 1.25;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}
.qcbh-badge-plaque.hero-card .mini-bar {
  position: relative;
  height: 13px;
  margin-top: 2px;
  background: rgba(14, 18, 26, 0.78);
  border: 1px solid rgba(110, 92, 62, 0.85);
}
.qcbh-badge-plaque.hero-card .mini-bar span {
  position: absolute;
  inset: 0;
  font-size: 9.5px;
  font-weight: 700;
  line-height: 12px;
  text-align: center;
  color: #f7fafc;
  text-shadow: 0 1px 2px #000, 0 0 3px #000;
  white-space: nowrap;
}

/* In-run buff pill bar (keys 1-5), right of the Space / Q buttons */
#pillbar {
  position: fixed;
  bottom: 14px;
  left: calc(50% + 84px);
  display: flex;
  align-items: flex-end;
  gap: 6px;
  z-index: 6;
}
#skillbar #pillbar {
  position: static;
  align-self: flex-end;
  margin-left: 6px;
}
#pillbar .pl-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
}
#pillbar .ptimer {
  min-height: 15px;
  padding: 0 5px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 800;
  line-height: 15px;
  letter-spacing: 0.2px;
  color: #88ffea;
  background: rgba(6, 20, 24, 0.88);
  border: 1px solid rgba(94, 230, 198, 0.72);
  box-shadow: 0 0 8px rgba(94, 230, 198, 0.32);
  text-shadow: 0 1px 2px #000;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s;
}
#pillbar .ptimer.show {
  opacity: 1;
}
#pillbar .ptimer.cd-wait {
  color: #ffc896;
  background: rgba(34, 14, 12, 0.9);
  border-color: rgba(255, 138, 88, 0.75);
  box-shadow: 0 0 8px rgba(255, 120, 72, 0.28);
}
#pillbar .pl {
  position: relative;
  width: 46px;
  height: 46px;
  padding: 2px;
  background: rgba(8, 14, 22, 0.84);
  border: 1px solid rgba(207, 169, 90, 0.6);
  border-radius: 6px;
  cursor: pointer;
  overflow: hidden;
}
#pillbar .pl img {
  width: 100%;
  height: 100%;
}
#pillbar .pl.empty {
  opacity: 0.35;
  filter: grayscale(0.8);
}
#pillbar .pl.on {
  border-color: var(--jade);
  box-shadow: 0 0 12px rgba(94, 230, 198, 0.55);
}
#skillbar #pillbar .cd,
#pillbar .cd {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0;
  background: rgba(4, 8, 14, 0.62);
  pointer-events: none;
}
#skillbar #pillbar .pl.on .cd,
#pillbar .pl.on .cd {
  background: rgba(20, 60, 56, 0.42);
}
#pillbar b {
  position: absolute;
  right: 3px;
  bottom: 1px;
  font-size: 11px;
  color: var(--gold2);
  text-shadow: 0 0 3px #000, 0 0 3px #000;
  z-index: 2;
}
#skillbar #pillbar kbd,
#pillbar kbd {
  position: absolute;
  left: 4px;
  right: auto;
  top: 2px;
  font-size: 10px;
  color: var(--gold2);
  text-shadow: 0 0 3px #000;
  z-index: 2;
}
.recipe .dan-buff {
  color: var(--jade);
}
.recipe p.dan-odds {
  margin-top: 2px;
  font-size: 0.85em;
  color: #e8d49a;
}
.recipe p.dan-odds b {
  color: #ffe08a;
}
.recipe.locked {
  opacity: 0.5;
}


/* ---------- Bottom-Right Corner Stack (Bát Hoang Cẩm Nang + Thiết Lập) ---------- */
.lb-bottom-right {
  position: absolute;
  right: 26px;
  bottom: 48px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}
.lb-bottom-right button {
  pointer-events: auto;
}
.lb-bottom-right .qcbh-ribbon {
  top: -10px;
  right: -6px;
  padding: 5px 16px 6px;
  font-family: 'Segoe UI', 'Tahoma', sans-serif;
  font-size: 11.5px;
  font-weight: 800;
  font-style: italic;
  letter-spacing: 0.3px;
}
.lb-bottom-right .qcbh-ink-pill {
  min-width: 196px;
  height: 38px;
  padding: 0 24px;
  font-family: 'Segoe UI', 'Tahoma', 'Noto Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: #f4f6f9;
}
@media (max-width: 780px) {
  .lb-bottom-right {
    right: 12px;
    bottom: 40px;
    gap: 8px;
  }
}

/* Truong phai: mastery panel in Dong Phu, school chips */
.mastery {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid rgba(207, 169, 90, 0.3);
}
.mastery h3 {
  margin: 0 0 4px;
  color: var(--gold2);
}
.mst-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.mst {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  background: rgba(10, 16, 25, 0.7);
  border: 1px solid rgba(207, 169, 90, 0.25);
  border-left: 3px solid var(--sc);
}
.mst img {
  width: 46px;
  height: 46px;
}
.mst-body {
  flex: 1;
  min-width: 0;
}
.mst h4 {
  margin: 0 0 4px;
  color: var(--sc);
}
.mst h4 em {
  font-style: normal;
  font-size: 12px;
  color: var(--gold2);
  margin-left: 6px;
}
.mst .bar {
  height: 14px;
}
.mst .bar > div {
  background: var(--sc) !important;
  opacity: 0.85;
}
.mst .bar span {
  font-size: 11px;
}
.mst p {
  margin: 4px 0 0;
  font-size: 12px;
}
.mst p i {
  color: var(--muted);
}
.school-chip {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  font-size: 11px;
  line-height: 16px;
  color: var(--sc);
  border: 1px solid var(--sc);
  border-radius: 2px;
  font-style: normal;
}
#hub .cps button[style] {
  border-color: var(--sc);
}
#hub .cps button.on[style] {
  color: var(--sc);
}
@media (max-width: 760px) {
  .mst-grid {
    grid-template-columns: 1fr;
  }
}


/* ==========================================================================
 * CẦU ĐẠO ĐÀI · GACHA PAVILION & COSMETIC WARDROBE STYLES
 * ========================================================================== */
#gacha {
  position: fixed;
  inset: 0;
  z-index: 23;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  background: rgba(4, 7, 13, 0.62);
  backdrop-filter: blur(4px);
  overflow: auto;
}
.hub-win.win-gacha {
  max-width: 1080px;
}
#gachabody {
  padding: 18px 22px 22px;
  overflow: auto;
  flex: 1;
}
.gc-tabs {
  display: flex;
  gap: 8px;
}
#gacha .gc-tabs button {
  background: url('../assets/ui/btn_stone.webp') center / 100% 100% no-repeat;
  border: none;
  color: #dce4ee;
  padding: 6px 16px;
  min-height: 34px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
#gacha .gc-tabs button.on {
  background: url('../assets/ui/btn_gold.webp') center / 100% 100% no-repeat;
  color: #fff8de;
  text-shadow: 0 1px 3px rgba(20, 12, 2, 0.95);
}
#gacha button:not(.hub-close-x):not(.gc-tabs button) {
  background: url('../assets/ui/btn_stone.webp') center / 100% 100% no-repeat;
  border: none;
  color: #ece6d8;
  padding: 7px 16px;
  min-height: 34px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.45));
}
#gacha button:not(.hub-close-x):not(.gc-tabs button):hover:not(:disabled) {
  background: url('../assets/ui/btn_stone_hover.webp') center / 100% 100% no-repeat;
  color: #fff2cc;
}
#gacha button.big {
  background: url('../assets/ui/btn_gold.webp') center / 100% 100% no-repeat !important;
  color: #fff9e0 !important;
  font-weight: 800;
  font-size: 15.5px;
  padding: 9px 22px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-shadow: 0 1px 3px rgba(24, 14, 2, 0.95);
}
#gacha button.big:hover:not(:disabled) {
  background: url('../assets/ui/btn_gold_hover.webp') center / 100% 100% no-repeat !important;
  color: #1f1404 !important;
  text-shadow: 0 1px 0 rgba(255, 250, 220, 0.6);
}
#gacha button:disabled {
  opacity: 0.42;
  cursor: default;
}
#gacha button.big img {
  width: 18px;
  height: 18px;
  vertical-align: middle;
}
.gc-wardrobe-btn {
  padding: 4px 12px !important;
  min-height: 28px !important;
  font-size: 12.5px !important;
}

.gc-stage,
.gc-res-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100%;
  gap: 18px;
}
.gc-info {
  text-align: center;
  padding: 14px 18px;
  background: radial-gradient(ellipse at 50% 0%, rgba(207, 169, 90, 0.16), rgba(8, 13, 22, 0.65) 75%);
  border: 1px solid rgba(207, 169, 90, 0.34);
}
.gc-bseal {
  display: inline-block;
  padding: 2px 10px;
  background: linear-gradient(90deg, #8b1818, #bd2626 55%, #8b1818);
  border: 1px solid rgba(255, 224, 175, 0.78);
  color: #fff5e0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.gc-info h3 {
  margin: 6px 0 4px;
  font-size: 24px;
  color: var(--gold2);
  text-shadow: 0 0 14px rgba(246, 223, 158, 0.3);
}
.gc-sub {
  margin: 0 auto 10px;
  max-width: 720px;
  font-size: 13.5px;
  color: #c6d4e4;
}
.gc-pity {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}
.gc-pity b {
  color: var(--gold2);
}

.gc-feats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}
.gc-feat {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 12px 8px 10px;
  background: linear-gradient(180deg, rgba(16, 25, 38, 0.88), rgba(8, 13, 21, 0.94));
  border: 1px solid rgba(207, 169, 90, 0.4);
  gap: 4px;
}
.gc-feat.r-SSR,
.gc-res.r-SSR,
.gc-pcard.r-SSR {
  border-color: rgba(255, 212, 102, 0.85);
  box-shadow: inset 0 0 18px rgba(255, 212, 102, 0.16), 0 0 12px rgba(255, 200, 72, 0.18);
}
.gc-feat.r-SR,
.gc-res.r-SR,
.gc-pcard.r-SR {
  border-color: rgba(215, 139, 255, 0.72);
  box-shadow: inset 0 0 16px rgba(200, 110, 255, 0.14);
}
.gc-feat.r-R,
.gc-res.r-R,
.gc-pcard.r-R {
  border-color: rgba(107, 200, 255, 0.55);
}
.gc-fimg,
.gc-rimg,
.gc-pimg {
  width: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(255, 240, 200, 0.12), rgba(5, 9, 15, 0.65) 72%);
  border: 1px solid rgba(207, 169, 90, 0.24);
  margin-bottom: 4px;
}
.gc-art {
  max-width: 58px;
  max-height: 58px;
  object-fit: contain;
}
.gc-art.is-sword {
  transform: rotate(32deg);
}
.gc-orb {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-block;
}
.gc-outfit-ico {
  font-size: 32px;
  color: var(--gold2);
  text-shadow: 0 0 12px rgba(246, 223, 158, 0.55);
}
.gc-feat b,
.gc-res b {
  font-size: 13px;
  color: #f4f7fb;
  line-height: 1.25;
}
.gc-feat em,
.gc-res em {
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
}
.gc-own {
  font-size: 10.5px;
  padding: 1px 6px;
  background: rgba(34, 150, 126, 0.35);
  border: 1px solid var(--jade);
  color: var(--jade);
}
.gc-rar {
  font-size: 10.5px;
  padding: 1px 6px;
  background: rgba(168, 120, 28, 0.3);
  border: 1px solid rgba(255, 212, 102, 0.65);
  color: var(--gold2);
}

.gc-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 4px;
}
.gc-pulls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Gacha Reveal Grid */
.gc-res-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.gc-res-grid.one {
  grid-template-columns: 220px;
  justify-content: center;
}
.gc-res {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 8px 10px;
  gap: 4px;
  background: linear-gradient(180deg, rgba(16, 25, 38, 0.92), rgba(7, 11, 19, 0.96));
  border: 1px solid rgba(207, 169, 90, 0.45);
  animation: gcPop 0.32s ease both;
  animation-delay: var(--d, 0ms);
}
@keyframes gcPop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.gc-rtag {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 10px;
  font-weight: 700;
  color: var(--gold2);
}
.gc-res.r-SR .gc-rtag {
  color: #e4a8ff;
}
.gc-res.r-R .gc-rtag {
  color: #84d2ff;
}
.gc-badge {
  font-size: 11px;
  color: #b7c8dd;
}
.gc-badge.new {
  color: var(--jade);
  font-weight: 700;
}
.gc-eqbtn {
  margin-top: 3px;
  padding: 3px 10px !important;
  min-height: 24px !important;
  font-size: 11.5px !important;
}
.gc-res-acts {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Wardrobe / Pool Viewer */
.gc-pool-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.gc-pool-head h3 {
  margin: 0;
  color: var(--gold2);
}
.gc-pool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.gc-pcard {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(12, 19, 30, 0.86);
  border: 1px solid rgba(207, 169, 90, 0.35);
}
.gc-pcard.locked {
  opacity: 0.62;
}
.gc-pcard .gc-pimg {
  width: 54px;
  height: 54px;
  flex: none;
  margin: 0;
}
.gc-pinfo {
  flex: 1;
  min-width: 0;
}
.gc-pinfo b {
  display: block;
  font-size: 14px;
  color: var(--gold2);
}
.gc-pinfo em {
  display: block;
  font-style: normal;
  font-size: 11.5px;
  color: var(--muted);
}
.gc-pinfo p {
  margin: 2px 0 0;
  font-size: 12px;
  color: #c8d6e6;
}
.gc-eqtag {
  font-size: 12px;
  color: var(--jade);
  font-weight: 700;
  white-space: nowrap;
}
.gc-locktag {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.gc-rates-box {
  background: rgba(10, 16, 26, 0.72);
  border: 1px solid rgba(207, 169, 90, 0.3);
  padding: 14px 18px;
  line-height: 1.65;
  font-size: 14px;
}

/* Outfit lock / owned tags inside Đổi Đạo Thân */
.clock-tag {
  font-size: 12px;
  color: #ffb878;
  margin-left: 6px;
}
.cown-tag {
  font-size: 12px;
  color: var(--gold2);
  margin-left: 6px;
}

/* Highlight Gacha plaque slightly golden on Sảnh bottom-right */
.qcbh-bowuzhi-plaque.gacha-plaque {
  filter: sepia(0.28) saturate(1.45) brightness(1.04) drop-shadow(0 5px 14px rgba(0, 0, 0, 0.68));
}
.qcbh-bowuzhi-plaque.gacha-plaque:hover {
  filter: sepia(0.25) saturate(1.6) brightness(1.12) drop-shadow(0 0 14px rgba(255, 220, 120, 0.55)) drop-shadow(0 6px 14px rgba(0, 0, 0, 0.72));
}

@media (max-width: 900px) {
  .gc-feats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .gc-res-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .gc-pool-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
 * Trấn Ma Đài · Thượng Cổ Săn Boss (#boss-ui) & Boss Arena HUD
 * ============================================================================ */
#boss-ui {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  background: rgba(4, 7, 13, 0.64);
  backdrop-filter: blur(4px);
  overflow: auto;
}
#boss-ui.hidden {
  display: none;
}
.hub-win.win-boss {
  max-width: 1120px;
}
#bossbody {
  padding: 16px 20px 18px;
  overflow: auto;
  flex: 1;
}
.bs-tabs {
  display: flex;
  gap: 8px;
}
#boss-ui .bs-tab {
  position: relative;
  background: url('../assets/ui/btn_stone.webp') center / 100% 100% no-repeat;
  border: none;
  color: #dce4ee;
  padding: 6px 16px;
  min-height: 34px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}
#boss-ui .bs-tab.on {
  background: url('../assets/ui/btn_gold.webp') center / 100% 100% no-repeat;
  color: #fff8de;
  text-shadow: 0 1px 3px rgba(20, 12, 2, 0.95);
}
.bs-dot {
  position: absolute;
  top: 4px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff4a4a;
  box-shadow: 0 0 8px #ff4a4a;
}

/* Solo 2-column layout */
.bs-solo-grid,
.bs-world-grid {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 16px;
  height: 100%;
  min-height: 540px;
}
.bs-world-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.95fr);
}
.bs-sec-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--gold2);
  margin: 0 0 8px;
}
.bs-left-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bs-boss-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.bs-pick {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 10px 12px;
  background: linear-gradient(90deg, rgba(16, 24, 38, 0.88), rgba(10, 15, 24, 0.9));
  border: 1px solid rgba(207, 169, 90, 0.34);
  border-left: 4px solid var(--bc, var(--gold));
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition: transform 0.14s, border-color 0.14s, box-shadow 0.14s;
}
.bs-pick:hover {
  border-color: rgba(246, 223, 158, 0.72);
  transform: translateX(3px);
}
.bs-pick.on {
  border-color: var(--bc, var(--gold2));
  background: linear-gradient(90deg, rgba(44, 32, 22, 0.92), rgba(16, 22, 34, 0.95));
  box-shadow: inset 0 0 18px rgba(246, 223, 158, 0.14), 0 0 12px rgba(0, 0, 0, 0.45);
}
.bs-el {
  flex: none;
  padding: 3px 7px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--bc, var(--gold2));
  border: 1px solid var(--bc, var(--gold));
  background: rgba(8, 12, 20, 0.8);
}
.bs-pick-txt {
  flex: 1;
  min-width: 0;
}
.bs-pick-txt b {
  display: block;
  font-size: 14.5px;
  color: #f8efd8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bs-pick-txt em {
  display: block;
  font-style: normal;
  font-size: 11.5px;
  color: #a9b8cc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bs-clr {
  color: var(--jade);
  font-weight: 800;
  font-size: 15px;
}
.bs-new {
  font-size: 10px;
  padding: 2px 6px;
  background: rgba(176, 36, 36, 0.88);
  color: #fff2da;
  border: 1px solid rgba(255, 220, 160, 0.55);
  font-weight: 700;
}
.bs-tip {
  font-size: 12px;
  line-height: 1.45;
  color: #9eb0c6;
  padding: 8px 10px;
  background: rgba(10, 16, 26, 0.72);
  border: 1px solid rgba(207, 169, 90, 0.22);
}

/* Right Detail / Stage Preview */
.bs-right-detail,
.bs-world-left,
.bs-world-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.bs-stage-wrap {
  position: relative;
  height: 298px;
  background: radial-gradient(ellipse at 50% 65%, rgba(30, 38, 52, 0.88), rgba(6, 10, 18, 0.96) 76%);
  border: 1px solid rgba(207, 169, 90, 0.42);
  overflow: hidden;
}
.bs-stage-wrap.world {
  height: 278px;
}
.bs-canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.bs-stage-head {
  position: absolute;
  top: 12px;
  left: 14px;
  pointer-events: none;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.95);
}
.bs-tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  color: #fff6e0;
  background: rgba(14, 20, 32, 0.84);
  border: 1px solid var(--bc, var(--gold));
  margin-bottom: 4px;
}
.bs-stage-head h2 {
  margin: 0;
  font-size: 23px;
  color: var(--gold2);
}
.bs-stage-head p {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: #c8d6e6;
}
.bs-best,
.bs-mode-pill {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 700;
  background: rgba(10, 16, 26, 0.84);
  border: 1px solid rgba(207, 169, 90, 0.45);
  color: var(--jade);
}
.bs-best.first {
  color: #ffd470;
  border-color: rgba(255, 205, 95, 0.65);
}
.bs-mode-pill {
  color: #b8dcff;
  border-color: rgba(120, 190, 255, 0.45);
}
.bs-lore {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #d4deea;
}
.bs-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.bs-skills span {
  font-size: 11.5px;
  padding: 3px 9px;
  background: rgba(14, 22, 34, 0.85);
  border: 1px solid rgba(207, 169, 90, 0.3);
  color: #f0dfb4;
}

/* Difficulty Tier Selector */
.bs-tier-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}
.bs-tier {
  padding: 7px 6px;
  text-align: center;
  background: rgba(12, 18, 28, 0.88);
  border: 1px solid rgba(207, 169, 90, 0.32);
  color: #cfdbe8;
  font: inherit;
  cursor: pointer;
}
.bs-tier b {
  display: block;
  font-size: 12.5px;
  color: var(--gold2);
}
.bs-tier span {
  display: block;
  font-size: 10.5px;
  color: #9ab0c8;
  margin-top: 2px;
}
.bs-tier.on {
  border-color: #f6df9e;
  background: linear-gradient(180deg, rgba(72, 50, 18, 0.88), rgba(34, 24, 10, 0.94));
  box-shadow: inset 0 0 12px rgba(246, 223, 158, 0.22);
}
.bs-tier.on span {
  color: #ffeab0;
}

/* Foot Reward Bar & Action Button */
.bs-foot-bar,
.bs-world-act {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(10, 16, 26, 0.84);
  border: 1px solid rgba(207, 169, 90, 0.38);
}
.bs-rewards {
  flex: 1;
  min-width: 0;
}
.bs-stat-line {
  font-size: 12.5px;
  color: #b8c8da;
  margin-bottom: 6px;
}
.bs-stat-line b {
  color: #fff2d0;
}
.bs-rew-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.bs-rew {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 12px;
  background: rgba(18, 28, 42, 0.9);
  border: 1px solid rgba(207, 169, 90, 0.32);
  color: #e4edf8;
}
.bs-rew img {
  width: 16px;
  height: 16px;
}
.bs-rew.gold {
  border-color: rgba(246, 212, 110, 0.65);
  color: #ffe590;
}
.bs-rew.purple {
  border-color: rgba(196, 130, 255, 0.6);
  color: #e0b4ff;
}
#boss-ui .bs-fight-btn,
#boss-ui .bs-claim-rk {
  flex: none;
  background: url('../assets/ui/btn_gold.webp') center / 100% 100% no-repeat;
  border: none;
  color: #fff9e0;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  padding: 10px 22px;
  min-height: 44px;
  cursor: pointer;
  text-shadow: 0 1px 3px rgba(24, 14, 2, 0.95);
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5));
}
#boss-ui .bs-fight-btn:hover,
#boss-ui .bs-claim-rk:hover {
  background: url('../assets/ui/btn_gold_hover.webp') center / 100% 100% no-repeat;
  color: #1f1404;
  text-shadow: 0 1px 0 rgba(255, 250, 220, 0.6);
}
#boss-ui .bs-buy-btn {
  background: url('../assets/ui/btn_stone.webp') center / 100% 100% no-repeat;
  border: none;
  color: #ffe8a8;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 9px 18px;
  min-height: 42px;
  cursor: pointer;
}
#boss-ui .bs-buy-btn:hover {
  background: url('../assets/ui/btn_stone_hover.webp') center / 100% 100% no-repeat;
}

/* World Boss Shared HP + Milestones */
.bs-hp-box {
  padding: 12px 14px;
  background: rgba(10, 16, 26, 0.85);
  border: 1px solid rgba(207, 169, 90, 0.4);
}
.bs-hp-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #dce6f2;
  margin-bottom: 6px;
}
.bs-hp-head b {
  color: #ffd98a;
}
.bs-hp-bar {
  height: 16px;
  background: rgba(20, 12, 16, 0.92);
  border: 1px solid rgba(255, 160, 120, 0.48);
  overflow: hidden;
  margin-bottom: 10px;
}
.bs-hp-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #b82020, #e64a28 60%, #ff8c42);
  transition: width 0.35s ease;
}
.bs-ms-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.bs-ms {
  padding: 7px 6px;
  text-align: center;
  background: rgba(14, 22, 34, 0.9);
  border: 1px solid rgba(207, 169, 90, 0.28);
  color: #b0c0d4;
  font: inherit;
  cursor: default;
}
.bs-ms b {
  display: block;
  font-size: 13.5px;
  color: var(--gold2);
}
.bs-ms span {
  display: block;
  font-size: 11.5px;
  color: #ffe090;
}
.bs-ms em {
  display: block;
  font-style: normal;
  font-size: 10.5px;
  margin-top: 2px;
}
.bs-ms.ready {
  cursor: pointer;
  border-color: #ffd868;
  background: linear-gradient(180deg, rgba(96, 66, 18, 0.92), rgba(44, 28, 8, 0.95));
  color: #fff8de;
  box-shadow: 0 0 12px rgba(255, 208, 72, 0.36);
}
.bs-ms.claimed {
  opacity: 0.65;
  border-color: rgba(94, 230, 198, 0.45);
}
.bs-ms.claimed em {
  color: var(--jade);
}
.bs-att-info span {
  display: block;
  font-size: 14px;
  color: #f0e6d2;
}
.bs-att-info b {
  color: var(--gold2);
}
.bs-att-info em {
  display: block;
  font-style: normal;
  font-size: 11.5px;
  color: #9cb0c6;
  margin-top: 2px;
}

/* World Boss Leaderboard & Rank Rewards */
.bs-board-wrap {
  flex: 1;
  min-height: 220px;
  max-height: 290px;
  overflow: auto;
  background: rgba(10, 16, 26, 0.82);
  border: 1px solid rgba(207, 169, 90, 0.35);
}
.bs-board {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.bs-board th {
  text-align: left;
  padding: 8px 10px;
  font-size: 11.5px;
  color: var(--gold2);
  border-bottom: 1px solid rgba(207, 169, 90, 0.3);
  background: rgba(16, 24, 38, 0.9);
}
.bs-board td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(207, 169, 90, 0.14);
  color: #dce6f2;
}
.bs-board tr.me td {
  background: rgba(207, 169, 90, 0.12);
}
.bs-board .rk {
  font-weight: 800;
  color: var(--gold2);
  width: 44px;
}
.bs-board .num,
.bs-board .pct {
  text-align: right;
  white-space: nowrap;
}
.bs-board .rk-sub {
  font-size: 11px;
  color: #9ab0c8;
}
.bs-board .rk-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  margin-top: 4px;
  width: 72px;
  margin-left: auto;
}
.bs-board .rk-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #f0b848, #ff6c3a);
}
.bs-empty {
  text-align: center;
  padding: 40px 16px !important;
  color: #9ab0c8 !important;
  line-height: 1.6;
}
.bs-rk-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bs-rk-tier {
  padding: 7px 10px;
  background: rgba(12, 19, 30, 0.85);
  border: 1px solid rgba(207, 169, 90, 0.28);
  font-size: 12px;
}
.bs-rk-tier.mine {
  border-color: rgba(255, 214, 108, 0.78);
  background: rgba(58, 42, 16, 0.72);
}
.bs-rk-tier b {
  display: block;
  color: var(--gold2);
  margin-bottom: 2px;
}
.bs-rk-tier span {
  color: #c8d6e6;
}
.bs-rk-foot {
  margin-top: auto;
  text-align: center;
}
.bs-rk-done {
  font-size: 13px;
  font-weight: 700;
  color: var(--jade);
}
.bs-rk-wait {
  display: block;
  font-size: 11.5px;
  color: #9eb0c6;
  line-height: 1.45;
}

/* In-run Boss Arena HUD & Result Buttons */
#timer.urgent {
  color: #ff6b57 !important;
  text-shadow: 0 0 12px rgba(255, 80, 50, 0.85);
}
.boss-dmg-stat {
  color: #7a2f08 !important;
  font-weight: 800;
  text-shadow: none;
}
.boss-res-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}
#panel .boss-res-actions button.secondary {
  background: rgba(18, 28, 42, 0.9);
  border: 1px solid rgba(207, 169, 90, 0.5);
  color: #dce6f2;
  padding: 10px 20px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
#panel .boss-res-actions button.secondary:hover {
  border-color: #f6df9e;
  color: #fff6dc;
}
.qcbh-plaque.boss-plaque .qp-img {
  filter: hue-rotate(-25deg) saturate(1.5) brightness(1.08);
}

@media (max-width: 900px) {
  .bs-solo-grid,
  .bs-world-grid {
    grid-template-columns: 1fr;
  }
  .bs-tier-bar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Cau Dao: Linh Thu banner (mount / pet sprite-sheet frames, stars, sections) */
.gc-sheet {
  display: inline-block;
  background-repeat: no-repeat;
  background-position: 0 0;
  vertical-align: middle;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6));
}
.gc-stars {
  color: #ffd466;
  font-style: normal;
  font-size: 12px;
  letter-spacing: -1px;
}
.gc-sec {
  margin: 14px 0 6px;
  color: var(--gold2);
}
#gacha button[data-beq].on {
  border-color: var(--jade);
  color: var(--jade);
}

/* Dong Phu: carried mount / pet */
.beast-slots {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 8px;
}
#hub .beast-slot {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 4px 8px;
  text-align: left;
  font-size: 12px;
}
.beast-slot em {
  font-style: normal;
  color: var(--muted);
  font-size: 11px;
}
.beast-slot b {
  color: var(--gold2);
}
.beast-slot i {
  font-style: normal;
  font-size: 11px;
  color: var(--jade);
}

/* ---------- online: login screen (js/net/cloud.js) ---------- */
#auth {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 45%, #12202e, #06090f);
}
#auth .box {
  width: min(360px, 90vw);
  padding: 24px 28px;
  border: 1px solid var(--gold);
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(16, 26, 40, 0.96), rgba(9, 15, 24, 0.98));
  box-shadow: 0 12px 44px rgba(0, 0, 0, 0.75);
  text-align: center;
  color: var(--text);
}
#auth h2 {
  margin: 0 0 14px;
  color: var(--gold2);
  letter-spacing: 2px;
}
#auth .auth-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}
#auth .auth-tabs button {
  flex: 1;
  opacity: 0.6;
}
#auth .auth-tabs button.on {
  opacity: 1;
  border-color: var(--gold2);
  color: var(--gold2);
}
#auth label {
  display: block;
  text-align: left;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}
#auth input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 4px;
  padding: 9px 10px;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: rgba(4, 8, 14, 0.8);
  border: 1px solid var(--border);
  border-radius: 2px;
  user-select: text;
  -webkit-user-select: text;
  touch-action: auto;
}
#auth input:focus {
  outline: none;
  border-color: var(--gold2);
}
#auth .auth-msg {
  min-height: 1.2em;
  margin: 4px 0 10px;
  color: #ff9a8a;
  font-size: 13px;
}
#auth .auth-note {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--muted);
}
#auth button[type='submit'] {
  width: 100%;
}
#auth button {
  font: inherit;
  color: var(--text);
  background: rgba(22, 33, 48, 0.92);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 8px 14px;
  cursor: pointer;
}
#auth button.big {
  font-size: 18px;
  padding: 10px 24px;
  background: linear-gradient(180deg, #2b7b70, #174945);
  border-color: var(--jade);
  color: #f4fffd;
}
#auth button:disabled {
  opacity: 0.5;
  cursor: wait;
}
#auth .modal-acts {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 14px;
}

/* ---------------------------------------------------------------- Co-op (Tổ Đội · Hợp Lực Bí Cảnh) */
#coop {
  position: fixed;
  inset: 0;
  z-index: 23;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  background: rgba(4, 7, 13, 0.62);
  backdrop-filter: blur(4px);
  overflow: auto;
  color: var(--text);
}
#coop.hidden {
  display: none;
}
.win-coop {
  max-width: 1020px;
}
#coopbody {
  padding: 18px 22px 22px;
  overflow: auto;
  max-height: calc(90vh - 82px);
}
#coop button {
  font: inherit;
  color: var(--text);
  background: rgba(22, 33, 48, 0.92);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 8px 14px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
#coop button:hover:not(:disabled) {
  border-color: var(--gold2);
  background: rgba(34, 48, 68, 0.96);
}
#coop button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
#coop button.big {
  font-size: 15px;
  font-weight: 700;
  padding: 10px 20px;
  background: linear-gradient(180deg, #2b7b70, #174945);
  border-color: var(--jade);
  color: #f4fffd;
}
#coop button.big:hover:not(:disabled) {
  background: linear-gradient(180deg, #359588, #1c5a55);
  border-color: #88ffea;
}
#coop button.big.secondary {
  background: linear-gradient(180deg, #4b3d24, #2b2214);
  border-color: var(--gold);
  color: var(--gold2);
}
#coop button.danger {
  background: rgba(98, 24, 24, 0.72);
  border-color: rgba(235, 95, 85, 0.55);
  color: #ffd0cc;
}
#coop button.danger:hover:not(:disabled) {
  background: rgba(135, 32, 32, 0.88);
  border-color: #ff7a70;
}
#coop button.mini-btn {
  padding: 4px 9px;
  font-size: 12px;
}

.qcbh-plaque.coop-plaque {
  border-color: rgba(94, 230, 198, 0.52);
}
.qcbh-plaque.coop-plaque .qp-img {
  filter: hue-rotate(115deg) saturate(1.3) brightness(1.08);
}

.hub-coop-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 12px 16px;
  background: linear-gradient(90deg, rgba(22, 64, 60, 0.55), rgba(14, 24, 38, 0.78));
  border: 1px solid rgba(94, 230, 198, 0.45);
  border-radius: 4px;
}
.hub-coop-bar b {
  display: block;
  color: #8cf5dd;
  font-size: 15px;
  margin-bottom: 2px;
}
.hub-coop-bar span {
  font-size: 12.5px;
  color: var(--muted);
}

.coop-browse-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}
.coop-panel {
  background: rgba(10, 17, 28, 0.78);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.coop-panel h3,
.coop-open-wrap h3,
.coop-maps-section h3 {
  margin: 0;
  font-size: 16px;
  color: var(--gold2);
}
.coop-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  color: var(--muted);
}
.coop-field select,
.coop-join-row input {
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: rgba(4, 9, 16, 0.88);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 8px 10px;
  user-select: text;
  -webkit-user-select: text;
  touch-action: auto;
}
.coop-join-row input {
  flex: 1;
  text-transform: uppercase;
  letter-spacing: 3px;
  font-weight: 700;
  text-align: center;
}
.coop-join-row {
  display: flex;
  gap: 8px;
  margin-top: auto;
}
.coop-check {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}
.coop-check.inline {
  margin: 0;
}

.coop-open-wrap {
  background: rgba(8, 14, 24, 0.72);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 14px 16px;
}
.coop-room-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  max-height: 220px;
  overflow: auto;
}
.coop-room-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(18, 28, 42, 0.75);
  border: 1px solid rgba(206, 174, 108, 0.25);
  border-radius: 3px;
}
.coop-room-row.full {
  opacity: 0.6;
}
.cr-code {
  font-family: monospace;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--gold2);
  background: rgba(4, 8, 14, 0.85);
  border: 1px solid var(--gold);
  padding: 6px 10px;
  border-radius: 3px;
}
.cr-info {
  flex: 1;
  min-width: 0;
}
.cr-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.cr-cnt {
  font-size: 12px;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(58, 168, 145, 0.25);
  border: 1px solid rgba(94, 230, 198, 0.45);
  color: #8cf5dd;
}
.cr-sub {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 3px;
}
.cr-warn {
  color: #ffae88;
  font-style: normal;
}

/* Party Room */
.coop-room-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  margin-bottom: 14px;
  background: rgba(10, 17, 28, 0.82);
  border: 1px solid var(--gold);
  border-radius: 4px;
}
.crh-code {
  display: flex;
  align-items: center;
  gap: 10px;
}
.crh-code span {
  font-size: 13px;
  color: var(--muted);
}
.crh-code strong {
  font-family: monospace;
  font-size: 20px;
  letter-spacing: 3px;
  color: var(--gold2);
}
.crh-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.crh-vis {
  font-size: 12.5px;
  color: var(--muted);
}

.coop-slots {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.coop-slot {
  background: rgba(12, 20, 32, 0.82);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 11px 12px;
  min-height: 106px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}
.coop-slot.filled {
  border-color: color-mix(in srgb, var(--rc, #6ef5d0) 50%, rgba(255, 255, 255, 0.15));
}
.coop-slot.self {
  box-shadow: inset 0 0 0 1px rgba(240, 205, 125, 0.45);
}
.coop-slot.empty {
  align-items: center;
  justify-content: center;
  text-align: center;
  border-style: dashed;
  opacity: 0.65;
  gap: 4px;
}
.coop-slot.empty p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
.coop-slot.empty span {
  font-size: 11.5px;
  color: var(--muted);
}
.cs-empty-ico {
  font-size: 22px;
  color: var(--gold);
  line-height: 1;
}
.cs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.cs-name {
  font-weight: 700;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cs-name em {
  font-style: normal;
  font-weight: 400;
  font-size: 11.5px;
  color: var(--gold2);
}
.cs-role {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
}
.cs-role.host {
  background: rgba(212, 168, 72, 0.22);
  color: var(--gold2);
  border: 1px solid rgba(212, 168, 72, 0.5);
}
.cs-role.ready {
  background: rgba(58, 196, 152, 0.22);
  color: #7ef7d4;
  border: 1px solid rgba(94, 230, 198, 0.45);
}
.cs-role.wait {
  background: rgba(140, 150, 170, 0.15);
  color: var(--muted);
  border: 1px solid rgba(140, 150, 170, 0.3);
}
.cs-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
}
.cs-realm {
  font-weight: 700;
}
.cs-unlock {
  color: var(--muted);
  font-size: 11.5px;
}
.cs-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11.5px;
}
.cs-link.local {
  color: var(--muted);
}
.cs-link.connected {
  color: #6ef5c0;
}
.cs-link.connecting {
  color: #ffd47a;
}
.cs-link.failed {
  color: #ff857a;
}
.cs-btns {
  display: flex;
  gap: 4px;
}

.coop-maps-section {
  margin-bottom: 14px;
}
.cms-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.cms-head em {
  font-style: normal;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--muted);
}
.cms-rule {
  font-size: 12px;
  color: #8cf5dd;
}
.coop-maps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.coop-map-card {
  text-align: left;
  padding: 11px 12px !important;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(14, 22, 34, 0.85) !important;
  border: 1px solid var(--border) !important;
}
.coop-map-card.selected {
  border-color: var(--gold2) !important;
  background: linear-gradient(180deg, rgba(44, 72, 68, 0.72), rgba(16, 28, 38, 0.92)) !important;
  box-shadow: 0 0 14px rgba(108, 240, 206, 0.22);
}
.coop-map-card.locked {
  opacity: 0.58;
  filter: grayscale(0.45);
}
.cmc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.cmc-head b {
  font-size: 14px;
  color: var(--text);
}
.cmc-head span {
  font-size: 11px;
  color: var(--gold2);
}
.cmc-status {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.35;
}
.cmc-status.ok {
  color: #7ef7d4;
}
.cmc-status.bad {
  color: #ff9a8a;
}

.coop-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  background: rgba(8, 14, 24, 0.82);
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-bottom: 10px;
}
.ca-status {
  font-size: 13.5px;
  color: #ffd58a;
}
.ca-status.ok {
  color: #7ef7d4;
}
.ca-btns {
  display: flex;
  gap: 8px;
  align-items: center;
}
.coop-rules {
  margin: 10px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
}
.coop-offline {
  padding: 28px;
  text-align: center;
  font-size: 15px;
}

/* In-Run Party HUD */
#coop-hud {
  position: fixed;
  top: 106px;
  left: 12px;
  z-index: 12;
  width: 196px;
  padding: 8px 10px;
  background: rgba(6, 11, 18, 0.72);
  border: 1px solid rgba(110, 230, 198, 0.35);
  border-radius: 4px;
  pointer-events: none;
  color: var(--text);
  font-size: 12px;
  backdrop-filter: blur(2px);
}
#coop-hud.hidden {
  display: none;
}
#coop-hud .ch-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gold2);
  margin-bottom: 6px;
}
#coop-hud .ch-row {
  margin-bottom: 6px;
}
#coop-hud .ch-row:last-child {
  margin-bottom: 0;
}
#coop-hud .ch-row.dim {
  opacity: 0.55;
}
#coop-hud .ch-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}
#coop-hud .ch-name {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#coop-hud .ch-r {
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
}
#coop-hud em {
  font-style: normal;
  font-size: 10.5px;
  white-space: nowrap;
}
#coop-hud .st-ok {
  color: #7ef7d4;
}
#coop-hud .st-dead {
  color: #ff857a;
}
#coop-hud .st-left {
  color: #b0b8c8;
}
#coop-hud .ch-bar {
  height: 5px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  overflow: hidden;
}
#coop-hud .ch-bar i {
  display: block;
  height: 100%;
  transition: width 0.15s;
}

/* Host Waiting / Spectator Banner */
#coop-wait {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 16;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(8, 16, 26, 0.92);
  border: 1px solid var(--gold2);
  border-radius: 4px;
  color: var(--text);
  font-size: 13.5px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65);
}
#coop-wait.hidden {
  display: none;
}
#coop-wait button {
  font: inherit;
  font-weight: 700;
  padding: 7px 14px;
  background: linear-gradient(180deg, #2b7b70, #174945);
  border: 1px solid var(--jade);
  color: #f4fffd;
  border-radius: 3px;
  cursor: pointer;
}

@media (max-width: 860px) {
  .coop-browse-grid,
  .coop-slots,
  .coop-maps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hub-coop-bar {
    flex-direction: column;
    align-items: flex-start;
  }
  #coop-hud {
    width: 158px;
    top: 96px;
    font-size: 11px;
  }
}
@media (max-width: 560px) {
  .coop-browse-grid,
  .coop-slots,
  .coop-maps {
    grid-template-columns: 1fr;
  }
}

/* ---------- Luận Đạo Đài (PvP): js/ui/pvp.js ---------- */
#pvp-ui {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  background: rgba(4, 7, 13, 0.64);
  backdrop-filter: blur(4px);
  overflow: auto;
}
#pvp-ui.hidden {
  display: none;
}
.hub-win.win-pvp {
  max-width: 1080px;
  width: 100%;
}
#pvp-ui .bs-tab {
  position: relative;
  background: url('../assets/ui/btn_stone.webp') center / 100% 100% no-repeat;
  border: none;
  color: #dce4ee;
  padding: 6px 16px;
  min-height: 34px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}
#pvp-ui .bs-tab.on {
  background: url('../assets/ui/btn_gold.webp') center / 100% 100% no-repeat;
  color: #fff8de;
}
.pv-body {
  padding: 16px 20px 18px;
  overflow: auto;
  flex: 1;
}
.pv-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 2fr;
  gap: 16px;
}
.pv-card {
  background: rgba(9, 15, 24, 0.82);
  border: 1px solid rgba(207, 169, 90, 0.45);
  border-radius: 3px;
  padding: 14px 16px;
}
.pv-card h3 {
  margin: 0 0 10px;
  color: var(--gold2);
  font-size: 16px;
}
.pv-card h3:not(:first-child) {
  margin-top: 16px;
}
.pv-card label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}
.pv-card input,
.pv-card select,
.pv-row input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 3px;
  padding: 7px 9px;
  font: inherit;
  color: var(--text);
  background: rgba(4, 8, 14, 0.85);
  border: 1px solid var(--border);
  border-radius: 2px;
  user-select: text;
  -webkit-user-select: text;
  touch-action: auto;
}
.pv-row {
  display: flex;
  gap: 8px;
}
.pv-row input {
  margin: 0;
  text-transform: uppercase;
}
.pv-note {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}
.pv-btn {
  font: inherit;
  font-weight: 700;
  color: var(--text);
  background: rgba(22, 33, 48, 0.92);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 7px 14px;
  cursor: pointer;
}
.pv-btn:hover:not(:disabled) {
  border-color: var(--gold2);
}
.pv-btn.go {
  background: linear-gradient(180deg, #2b7b70, #174945);
  border-color: var(--jade);
  color: #f4fffd;
  padding: 9px 20px;
}
.pv-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.pv-mini {
  font: inherit;
  font-size: 12px;
  margin-left: 4px;
  padding: 1px 7px;
  color: var(--text);
  background: rgba(22, 33, 48, 0.9);
  border: 1px solid var(--border);
  cursor: pointer;
}
.pv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.pv-table th,
.pv-table td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(207, 169, 90, 0.18);
  text-align: left;
}
.pv-table th {
  color: var(--gold);
  font-weight: 600;
}
.pv-table .num {
  text-align: right;
}
.pv-table tr.me td {
  background: rgba(94, 230, 198, 0.12);
}
.pv-empty {
  text-align: center !important;
  color: var(--muted);
  padding: 18px !important;
}
/* Leo Rank = Khiêu chiến (30/11/2026) */
.pv-sub {
  font-size: 12px;
  font-style: normal;
  opacity: 0.75;
}
.pv-up {
  color: #2fa36a;
  font-weight: 700;
}
.pv-down {
  color: #d4483f;
  font-weight: 700;
}
.pv-ms,
.pv-log {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  font-size: 13px;
}
.pv-ms li,
.pv-log li {
  padding: 4px 6px;
  border-bottom: 1px solid rgba(207, 169, 90, 0.18);
}
.pv-ms li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-left: 3px solid var(--tc, rgba(207, 169, 90, 0.5));
}
.pv-ms li.on {
  background: rgba(47, 163, 106, 0.14);
}
.pv-ms li b {
  color: var(--tc, inherit);
}
.pv-card h3 .pv-mini {
  float: right;
}
.pv-msg {
  margin: 0 20px 14px;
  padding: 8px 12px;
  color: #ffb4a8;
  background: rgba(120, 20, 10, 0.3);
  border: 1px solid rgba(255, 120, 100, 0.4);
}
.pv-room-head {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  margin-bottom: 14px;
  font-size: 14px;
}
.pv-code {
  font-size: 20px;
  letter-spacing: 3px;
  color: var(--gold2);
}
.pv-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: start;
}
.pv-vs {
  align-self: center;
  font-size: 30px;
  font-weight: 700;
  color: var(--gold2);
  text-shadow: 0 0 14px rgba(246, 223, 158, 0.6);
}
.pv-team {
  background: rgba(9, 15, 24, 0.82);
  border: 1px solid rgba(207, 169, 90, 0.4);
  padding: 10px 12px;
}
.pv-team.team-A {
  border-color: rgba(94, 230, 198, 0.5);
}
.pv-team.team-B {
  border-color: rgba(255, 120, 100, 0.5);
}
.pv-team h4 {
  margin: 0 0 8px;
  color: var(--gold2);
}
.pv-mem {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  margin-bottom: 6px;
  background: rgba(22, 33, 48, 0.7);
}
.pv-mem.me {
  outline: 1px solid var(--jade);
}
.pv-mem.empty {
  color: var(--muted);
  font-style: italic;
}
.pv-mem em {
  font-size: 12px;
  color: var(--muted);
}
.pv-ready {
  margin-left: auto;
  font-size: 12px;
  color: #ff9a8a;
}
.pv-ready.on {
  color: var(--jade);
}
.pv-acts {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
}
.pv-tier {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 14px;
  margin-bottom: 8px;
  border: 1px solid var(--tc);
  box-shadow: inset 0 0 18px color-mix(in srgb, var(--tc) 30%, transparent);
}
.pv-tier b {
  font-size: 22px;
  color: var(--tc);
}
.pv-tier em {
  font-size: 12px;
  color: var(--muted);
}
.pv-search {
  margin: 8px 0;
  color: var(--gold2);
}
#pvp-giveup {
  position: fixed;
  top: 62px;
  right: 14px;
  z-index: 25;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: #ffd2c8;
  background: rgba(80, 16, 10, 0.75);
  border: 1px solid rgba(255, 120, 100, 0.6);
  padding: 6px 12px;
  cursor: pointer;
}
#pvp-giveup.hidden {
  display: none;
}
.pvp-result h2.win {
  color: #ffd466;
}
.pvp-result h2.loss {
  color: #ff8a7a;
}
@media (max-width: 760px) {
  .pv-grid,
  .pv-teams {
    grid-template-columns: 1fr;
  }
}


/* ============================================================================
 * MOBILE FULLSCREEN, MANDATORY LANDSCAPE ROTATE LOCK & RESPONSIVE OVERHAUL
 * - Smooth touch scrolling inside all scrollable pavilions & modals
 * - QCBH-styled portrait "Xoay Ngang Màn Hình" lock overlay (#rotate-lock)
 * - Floating top-center "⛶ Toàn màn hình" pill on mobile landscape (#fs-fab)
 * - Non-overlapping CSS Grid Lobby + compact Pavilions + crisp HUD on mobile
 *   landscape screens (from 640x300 with browser bar up to 960x540 fullscreen)
 * ============================================================================ */

/* Touch scrolling inside overlays (overrides html/body touch-action: none) */
#hubbody,
#gachabody,
#bossbody,
#coopbody,
#panel,
#create,
#auth,
.hubmodal .box,
.cho-list,
.bs-board-wrap,
.coop-room-list {
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.hubmodal {
  padding: 12px;
  box-sizing: border-box;
}
.hubmodal .box {
  max-width: min(520px, 94vw);
  max-height: 92dvh;
  overflow-y: auto;
  box-sizing: border-box;
}

/* Portrait Rotate-to-Landscape Lock Overlay (phones held vertically) */
#rotate-lock {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  background: radial-gradient(circle at 50% 42%, rgba(16, 28, 42, 0.96), rgba(5, 8, 14, 0.99));
  backdrop-filter: blur(8px);
}
#rotate-lock .rl-box {
  width: min(360px, 92vw);
  padding: 26px 22px 22px;
  box-sizing: border-box;
  text-align: center;
  border-radius: 2px;
  border: 1px solid rgba(207, 169, 90, 0.72);
  background-color: rgba(9, 14, 22, 0.94);
  background-image:
    linear-gradient(var(--gold2), var(--gold2)),
    linear-gradient(var(--gold2), var(--gold2)),
    linear-gradient(var(--gold2), var(--gold2)),
    linear-gradient(var(--gold2), var(--gold2)),
    linear-gradient(var(--gold2), var(--gold2)),
    linear-gradient(var(--gold2), var(--gold2)),
    linear-gradient(var(--gold2), var(--gold2)),
    linear-gradient(var(--gold2), var(--gold2)),
    linear-gradient(180deg, rgba(16, 26, 40, 0.94), rgba(7, 11, 18, 0.98));
  background-repeat: no-repeat;
  background-size:
    16px 2px, 2px 16px,
    16px 2px, 2px 16px,
    16px 2px, 2px 16px,
    16px 2px, 2px 16px,
    100% 100%;
  background-position:
    top 5px left 5px, top 5px left 5px,
    top 5px right 5px, top 5px right 5px,
    bottom 5px left 5px, bottom 5px left 5px,
    bottom 5px right 5px, bottom 5px right 5px,
    0 0;
  box-shadow: 0 18px 56px rgba(0, 0, 0, 0.88), inset 0 0 0 1px rgba(214, 178, 102, 0.18);
}
#rotate-lock .rl-seal {
  display: inline-block;
  padding: 3px 12px;
  margin-bottom: 14px;
  background: linear-gradient(90deg, #8b1818, #bd2626 55%, #8b1818);
  border: 1px solid rgba(255, 224, 175, 0.78);
  color: #fff5e0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}
#rotate-lock .rl-phone-wrap {
  position: relative;
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px 0 12px;
}
#rotate-lock .rl-phone {
  width: 38px;
  height: 66px;
  border: 2.5px solid var(--gold2);
  border-radius: 7px;
  background: rgba(16, 28, 42, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 5px 4px;
  box-sizing: border-box;
  box-shadow: 0 0 18px rgba(246, 223, 158, 0.25);
  animation: rlRotate 2.4s ease-in-out infinite;
}
#rotate-lock .rl-screen {
  width: 100%;
  flex: 1;
  border-radius: 2px;
  background: linear-gradient(135deg, rgba(94, 230, 198, 0.3), rgba(207, 169, 90, 0.2));
  border: 1px solid rgba(94, 230, 198, 0.45);
}
#rotate-lock .rl-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold2);
  margin-top: 4px;
}
#rotate-lock .rl-arrow {
  position: absolute;
  right: calc(50% - 54px);
  top: 2px;
  font-size: 24px;
  color: var(--jade);
  text-shadow: 0 0 10px rgba(94, 230, 198, 0.65);
}
@keyframes rlRotate {
  0%,
  20% {
    transform: rotate(0deg);
  }
  50%,
  75% {
    transform: rotate(-90deg);
  }
  100% {
    transform: rotate(0deg);
  }
}
#rotate-lock h2 {
  margin: 0 0 8px;
  font-size: 21px;
  color: var(--gold2);
  letter-spacing: 0.5px;
  text-shadow: 0 0 14px rgba(246, 223, 158, 0.28);
}
#rotate-lock .rl-sub {
  margin: 0 0 16px;
  font-size: 13.5px;
  line-height: 1.5;
  color: #cbd7e6;
}
#rotate-lock .rl-sub b {
  color: var(--jade);
}
#rotate-lock .rl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 44px;
  padding: 10px 18px;
  box-sizing: border-box;
  background: url('../assets/ui/btn_gold.webp') center / 100% 100% no-repeat;
  border: none;
  color: #fff8de;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  text-shadow: 0 1px 3px rgba(24, 14, 2, 0.95);
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.6));
}
#rotate-lock .rl-hint {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}
#rotate-lock .rl-hint.warn {
  color: #ffd480;
}

/* Floating Fullscreen Pill (top-center on mobile landscape when not fullscreen) */
#fs-fab {
  position: fixed;
  top: max(6px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 21;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(8, 14, 22, 0.84);
  border: 1px solid rgba(214, 178, 102, 0.72);
  color: var(--gold2);
  font-family: 'Segoe UI', 'Tahoma', 'Noto Sans', sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6), 0 0 12px rgba(246, 223, 158, 0.2);
  backdrop-filter: blur(4px);
}
#fs-fab .fs-ico {
  font-size: 13px;
  line-height: 1;
}
#fs-fab:active {
  transform: translateX(-50%) scale(0.96);
}
body:has(.hubmodal) #fs-fab {
  display: none;
}

/* Hide keyboard shortcut badges on pure touch screens */
@media (hover: none) and (pointer: coarse) {
  #skillbar kbd,
  #pillbar kbd,
  .card kbd {
    display: none;
  }
}

/* Gentle height polish for medium laptop viewports (e.g. 1366x650) */
@media (min-width: 921px) and (max-height: 760px) {
  .lb-title-wrap {
    top: 16px;
  }
  .lb-calligraphy span {
    font-size: 44px;
  }
  .lb-menu {
    bottom: 40px;
    gap: 6px;
  }
  .qcbh-plaque,
  .qcbh-plaque.primary {
    height: 48px;
    font-size: 14.5px;
  }
}

/* ============================================================================
 * MOBILE LANDSCAPE & COMPACT VIEWPORT RESPONSIVE LAYOUT
 * Triggers whenever height <= 580px (all phones in landscape, with or without
 * Chrome address bar) OR width <= 920px.
 * ============================================================================ */
@media (max-height: 580px), (max-width: 920px) {
  /* ---------- Lobby (#lobby): Non-overlapping 2-side CSS Grid ---------- */
  #lobby {
    display: grid;
    grid-template-columns: minmax(0, auto) minmax(32px, 1fr) minmax(0, auto);
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
      'title mid right'
      'menu  mid right-bot'
      'foot  foot foot';
    column-gap: 8px;
    row-gap: 4px;
    padding:
      max(6px, env(safe-area-inset-top))
      max(10px, env(safe-area-inset-right))
      0
      max(10px, env(safe-area-inset-left));
    box-sizing: border-box;
  }

  /* Top-left compact horizontal QCBH Calligraphy + Mini Vermilion Seal */
  .lb-title-wrap {
    grid-area: title;
    position: relative;
    top: auto;
    left: auto;
    align-items: center;
    gap: 7px;
    padding: 2px 0;
  }
  .lb-ink-splash {
    left: -6px;
    top: -6px;
    width: 240px;
    height: 50px;
    transform: rotate(-1deg);
  }
  .lb-ink-splash::after {
    display: none;
  }
  .lb-seal-col {
    padding-top: 0;
  }
  .lb-seal {
    padding: 3px 4px;
    font-size: 7.5px;
    line-height: 1.06;
    letter-spacing: 0.3px;
  }
  .lb-calligraphy {
    flex-direction: row;
    align-items: baseline;
    gap: 5px;
    line-height: 1;
  }
  .lb-calligraphy span {
    font-size: clamp(20px, 6.2dvh, 29px);
    letter-spacing: 0.5px;
    -webkit-text-stroke: 1.5px #0b0e14;
  }
  .lb-calligraphy span:nth-child(2),
  .lb-calligraphy span:nth-child(3),
  .lb-calligraphy span:nth-child(4) {
    transform: none;
  }

  /* Bottom-left: 2-column compact scroll menu (zero clipping on 300px+ height) */
  .lb-menu {
    grid-area: menu;
    position: relative;
    left: auto;
    bottom: auto;
    align-self: end;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px 6px;
    width: clamp(280px, 46vw, 376px);
    padding-bottom: 4px;
  }
  .lb-menu .qcbh-plaque {
    height: clamp(32px, 9.6dvh, 42px);
    padding: 0 11px 0 10px;
    gap: 5px;
    font-size: clamp(10.5px, 3dvh, 12.5px);
    min-width: 0;
  }
  .lb-menu .qcbh-plaque.primary {
    grid-column: 1 / -1;
    height: clamp(38px, 11.4dvh, 46px);
    padding: 0 18px;
    font-size: clamp(12.5px, 3.6dvh, 14.5px);
  }
  /* Keep last button balanced full-width when total button count is even (e.g. offline without Co-op) */
  .lb-menu .qcbh-plaque:last-child:nth-child(even) {
    grid-column: 1 / -1;
  }
  .lb-menu .qcbh-plaque .qp-img {
    width: 18px;
    height: 18px;
  }
  .lb-menu .qcbh-plaque.primary .qp-img {
    width: 22px;
    height: 22px;
  }
  .lb-menu .qcbh-plaque .qp-img.cauldron {
    width: 20px;
    height: 19px;
    margin-left: 0;
  }
  .lb-menu .qcbh-plaque .qp-txt {
    padding-right: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .lb-menu .qcbh-plaque:hover,
  .lb-menu .qcbh-plaque.primary:hover {
    transform: none;
  }
  .qp-dot {
    width: 7px;
    height: 7px;
    margin-left: 2px;
  }

  /* Top-right status plaques */
  .lb-right-col {
    grid-area: right;
    position: relative;
    top: auto;
    right: auto;
    align-self: start;
    justify-self: end;
    gap: 6px;
  }
  .lb-right-col .lb-top-right {
    width: clamp(220px, 35vw, 276px);
    gap: 6px;
  }
  .qcbh-badge-plaque {
    height: clamp(44px, 13dvh, 56px);
    padding: 4px 10px 4px 8px;
    gap: 7px;
  }
  .qcbh-badge-plaque.hero-card {
    height: clamp(56px, 16.5dvh, 70px);
    padding: 4px 10px 4px 8px;
    gap: 7px;
  }
  .qcbh-badge-plaque:hover {
    transform: none;
  }
  #lbhero {
    width: 38px;
    height: 42px;
  }
  .bp-seal-stamp {
    width: 32px;
    height: 32px;
    font-size: 8.5px;
    line-height: 1.08;
  }
  .qcbh-badge-plaque .bp-main b {
    font-size: 12.5px;
  }
  .qcbh-badge-plaque .bp-main em {
    font-size: 10px;
  }
  .bp-realm-pill {
    font-size: 10.5px;
    padding: 1px 6px;
  }
  .stage-pips i {
    width: 6px;
    height: 6px;
  }
  .qcbh-badge-plaque.hero-card .bp-top-row {
    padding-right: 50px;
  }
  .qcbh-badge-plaque.hero-card .mini-bar {
    height: 11px;
    margin-top: 1px;
  }
  .qcbh-badge-plaque.hero-card .mini-bar span {
    font-size: 8.5px;
    line-height: 10px;
  }
  .lb-right-col .qcbh-ribbon,
  .lb-bottom-right .qcbh-ribbon {
    top: -6px;
    right: -2px;
    padding: 2px 10px 3px;
    font-size: 9.5px;
  }

  /* Bottom-right: Bát Hoang Cẩm Nang + Thiết Lập side-by-side (never collides with top-right!) */
  .lb-bottom-right {
    grid-area: right-bot;
    position: relative;
    right: auto;
    bottom: auto;
    align-self: end;
    justify-self: end;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    padding-bottom: 4px;
  }
  .qcbh-bowuzhi-plaque {
    width: auto;
    min-width: 126px;
    height: clamp(32px, 9.6dvh, 40px);
    padding: 0 12px;
    font-size: 11.5px;
  }
  .qcbh-bowuzhi-plaque:hover {
    transform: none;
  }
  .lb-bottom-right .qcbh-ink-pill {
    min-width: 88px;
    height: clamp(30px, 9dvh, 36px);
    padding: 0 14px;
    font-size: 11.5px;
  }
  .qcbh-ink-pill:hover {
    transform: none;
  }

  /* Slim footer strip */
  .lb-footer {
    grid-area: foot;
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    height: 22px;
    padding: 0 12px;
    margin: 0 calc(-1 * max(10px, env(safe-area-inset-right))) 0 calc(-1 * max(10px, env(safe-area-inset-left)));
    font-size: 10px;
    gap: 10px;
  }

  /* ---------- Pavilions (#hub, #gacha, #boss-ui, #coop) ---------- */
  #hub,
  #gacha,
  #boss-ui,
  #coop {
    padding:
      max(5px, env(safe-area-inset-top))
      max(8px, env(safe-area-inset-right))
      max(5px, env(safe-area-inset-bottom))
      max(8px, env(safe-area-inset-left));
  }
  .hub-win,
  .hub-win.win-map,
  .hub-win.win-tu,
  .hub-win.win-dan,
  .hub-win.win-bag,
  .hub-win.win-cp,
  .hub-win.win-cho,
  .hub-win.win-gacha,
  .hub-win.win-boss,
  .hub-win.win-coop {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
  }
  .hub-head {
    padding: 6px 12px;
    gap: 8px;
  }
  .hub-head::after {
    bottom: -10px;
    height: 20px;
  }
  .hub-seal {
    font-size: 10px;
    padding: 2px 6px;
  }
  .hub-head h2 {
    font-size: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .hub-res {
    gap: 4px;
    min-width: 0;
  }
  .res-chip {
    padding: 2px 6px;
    font-size: 11px;
    gap: 3px;
  }
  .res-chip img {
    width: 13px;
    height: 13px;
  }
  .hub-close-x {
    width: 30px;
    height: 30px;
  }
  .hub-win #hubbody,
  #gachabody,
  #bossbody,
  #coopbody {
    padding: 10px 12px 14px;
    max-height: none;
    flex: 1;
  }

  /* Hub: Bí Cảnh (Map) */
  .hub-coop-bar {
    flex-direction: row;
    align-items: center;
    padding: 8px 10px;
    margin-bottom: 8px;
    gap: 10px;
  }
  .hub-coop-bar b {
    font-size: 13px;
  }
  .hub-coop-bar span {
    font-size: 11px;
  }
  .win-map .maps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .mapcard {
    padding: 10px;
  }
  .mapcard h3 {
    font-size: 15px;
  }
  .mapcard .req {
    font-size: 11.5px;
  }
  .mapcard .drops img {
    width: 26px;
  }
  .map-foot {
    margin-top: 8px;
    font-size: 11.5px;
  }

  /* Hub: Động Phủ Tu Luyện */
  .tu-wrap {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: center;
    gap: 10px;
  }
  .tu-hero {
    width: 174px;
    max-width: none;
    padding: 8px;
  }
  .tu-hero #hubhero,
  .tu-hero #hubhero-next {
    width: 146px;
    height: 146px;
  }
  .tu-main {
    min-width: 220px;
  }
  .tu-main h1 {
    font-size: 22px;
    margin-bottom: 4px;
  }
  .tu-act {
    margin: 8px 0;
  }
  .tu-links {
    gap: 6px;
    margin-top: 8px;
  }
  .mst-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  .mst {
    padding: 6px 8px;
    gap: 8px;
  }
  .mst img {
    width: 34px;
    height: 34px;
  }

  /* Hub: Công Pháp */
  .cp {
    gap: 10px;
  }
  .cp .cpslots {
    min-width: 0;
    flex: 1 1 260px;
  }
  .cp .learned {
    min-width: 0;
    flex: 1.2 1 280px;
  }
  .cpslots .slotrow h4 {
    width: 72px;
    font-size: 13px;
    padding-top: 8px;
  }
  .cpslots .cells {
    grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
    gap: 6px;
  }
  .cpslots .eq {
    min-width: 120px;
    min-height: 36px;
    font-size: 12.5px;
    padding: 3px 6px;
  }
  .eq img {
    width: 24px;
  }
  .skill {
    padding: 6px 0;
    gap: 8px;
  }
  .skill img {
    width: 38px;
  }

  /* Hub: Đan Lô */
  .recipe {
    padding: 7px 0;
    gap: 10px;
  }
  .recipe .out {
    width: 46px;
  }
  .ins img {
    width: 20px;
  }

  /* Hub: Túi Càn Khôn */
  .bag {
    flex-direction: row;
    gap: 10px;
  }
  .bag .grid {
    grid-template-columns: repeat(auto-fill, 50px);
    gap: 6px;
  }
  .bag .cell {
    width: 50px;
    height: 50px;
  }
  .bag .detail {
    width: 210px;
    flex: none;
    padding: 10px;
  }
  .bag .detail img {
    width: 52px;
  }

  /* Hub: Phường Thị */
  .cho-mode {
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
    padding-bottom: 6px;
  }
  #hub .cho-mode button {
    min-width: 84px;
    font-size: 13.5px;
  }
  .cho-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 12px;
  }
  .trade {
    gap: 6px;
    font-size: 13px;
  }
  .trade img {
    width: 28px;
  }

  /* Cầu Đạo · Gacha (#gacha) */
  #gacha .gc-tabs {
    gap: 4px;
    flex-wrap: nowrap;
  }
  #gacha .gc-tabs button {
    padding: 3px 8px;
    min-height: 26px;
    font-size: 11px;
    white-space: nowrap;
  }
  .gc-wardrobe-btn {
    white-space: nowrap;
    padding: 3px 8px !important;
    min-height: 26px !important;
    font-size: 11px !important;
  }
  .gc-stage,
  .gc-res-wrap {
    justify-content: flex-start;
    gap: 10px;
  }
  .gc-info {
    padding: 8px 12px;
  }
  .gc-info h3 {
    font-size: 17px;
    margin: 4px 0 2px;
  }
  .gc-sub {
    font-size: 11.5px;
    margin-bottom: 6px;
  }
  .gc-pity {
    gap: 10px;
    font-size: 11.5px;
  }
  .gc-feats {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
  }
  .gc-feat {
    padding: 6px 4px;
    gap: 2px;
  }
  .gc-fimg,
  .gc-rimg {
    width: 44px;
    height: 44px;
    margin-bottom: 2px;
  }
  .gc-art {
    max-width: 38px;
    max-height: 38px;
  }
  .gc-feat b,
  .gc-res b {
    font-size: 11px;
  }
  .gc-feat em,
  .gc-res em {
    font-size: 9.5px;
  }
  .gc-res-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 10px;
  }
  .gc-res {
    padding: 16px 5px 7px;
  }
  #gacha button.big {
    font-size: 13px;
    padding: 6px 14px;
    min-height: 34px;
  }

  /* Trấn Ma Đài · Boss (#boss-ui) */
  #boss-ui .bs-tab {
    padding: 4px 10px;
    min-height: 28px;
    font-size: 12px;
  }
  .bs-solo-grid {
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 10px;
    min-height: 0;
    height: auto;
  }
  .bs-world-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.95fr);
    gap: 10px;
    min-height: 0;
    height: auto;
  }
  .bs-pick {
    padding: 7px 8px;
    gap: 7px;
  }
  .bs-pick-txt b {
    font-size: 12.5px;
  }
  .bs-pick-txt em {
    font-size: 10.5px;
  }
  .bs-stage-wrap {
    height: 168px;
  }
  .bs-stage-wrap.world {
    height: 152px;
  }
  .bs-stage-head h2 {
    font-size: 17px;
  }
  .bs-stage-head p {
    font-size: 11px;
  }
  .bs-tier-bar {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
  }
  .bs-tier {
    padding: 4px 3px;
  }
  .bs-tier b {
    font-size: 11px;
  }
  .bs-tier span {
    font-size: 9.5px;
  }
  .bs-foot-bar,
  .bs-world-act {
    padding: 8px 10px;
    gap: 8px;
    flex-wrap: wrap;
  }
  #boss-ui .bs-fight-btn,
  #boss-ui .bs-claim-rk {
    padding: 7px 14px;
    min-height: 36px;
    font-size: 13px;
  }
  .bs-board-wrap {
    min-height: 120px;
    max-height: 180px;
  }

  /* Tổ Đội · Co-op (#coop) */
  .coop-browse-grid {
    grid-template-columns: 1.15fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
  }
  .coop-panel,
  .coop-open-wrap {
    padding: 10px 12px;
  }
  .coop-slots,
  .coop-maps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 10px;
  }
  .coop-slot {
    min-height: 82px;
    padding: 7px 8px;
  }
  .coop-room-head,
  .coop-actions {
    padding: 8px 10px;
    margin-bottom: 8px;
  }

  /* Tạo / Đổi Đạo Thân (#create) */
  #create {
    align-items: flex-start;
    padding:
      max(6px, env(safe-area-inset-top))
      max(10px, env(safe-area-inset-right))
      max(6px, env(safe-area-inset-bottom))
      max(10px, env(safe-area-inset-left));
  }
  #create .cbox {
    gap: 14px;
    padding: 12px 14px;
    flex-wrap: nowrap;
    align-items: flex-start;
    box-sizing: border-box;
  }
  #create .cprev {
    width: 210px;
    flex: none;
  }
  #create #cprev {
    width: 200px;
    height: 210px;
  }
  #create .cform {
    min-width: 0;
    flex: 1;
  }
  #create h1 {
    font-size: 20px;
  }
  #create .csub {
    font-size: 12px;
    margin-bottom: 8px;
  }
  #create .crow {
    margin: 5px 0;
    gap: 6px;
    flex-wrap: wrap;
  }
  #create .crow > span {
    width: 64px;
    font-size: 12.5px;
  }
  #create .cactions {
    margin-top: 8px;
  }
  #create button.big {
    font-size: 15px;
    padding: 7px 18px;
    min-height: 36px;
  }

  /* Lobby Modals & Login (#auth) */
  .hubmodal .box {
    padding: 12px 16px;
  }
  .hubmodal h2 {
    margin: 0 0 6px;
    font-size: 19px;
  }
  .hubmodal .set-list {
    gap: 6px;
    margin: 8px auto 4px;
  }
  .hubmodal .qcbh-plaque {
    height: 40px;
    font-size: 13.5px;
    padding: 0 16px;
  }
  .hubmodal .qcbh-plaque .qp-img {
    width: 20px;
    height: 20px;
  }
  .bg-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin: 8px 0 4px;
  }
  .bg-card img {
    height: 62px;
  }
  .bg-card .bg-meta {
    padding: 4px 7px;
  }
  .bg-card .bg-meta b {
    font-size: 12px;
  }
  .bg-card .bg-meta span {
    font-size: 10px;
  }
  .modal-acts {
    margin-top: 10px;
  }
  #auth {
    overflow-y: auto;
    align-items: safe center;
    padding: 10px;
    box-sizing: border-box;
  }
  #auth .box {
    padding: 14px 18px;
    width: min(350px, 92vw);
  }
  #auth h2 {
    margin-bottom: 8px;
    font-size: 20px;
  }
  #auth .auth-tabs {
    margin-bottom: 8px;
  }
  #auth label {
    margin-bottom: 7px;
    font-size: 12px;
  }
  #auth input {
    padding: 6px 8px;
    font-size: 14px;
  }
  #auth button.big {
    font-size: 15px;
    padding: 8px 18px;
  }

  /* ---------- In-Game HUD & Touch Skill Bar ---------- */
  #xpbar {
    height: 16px;
  }
  #xplabel {
    font-size: 11px;
    line-height: 16px;
  }
  #hudrow {
    padding: 4px max(10px, env(safe-area-inset-right)) 4px max(10px, env(safe-area-inset-left));
  }
  .slots {
    gap: 3px;
    margin-bottom: 3px;
  }
  .slot {
    width: 30px;
    height: 30px;
  }
  .slots.small .slot {
    width: 22px;
    height: 22px;
  }
  .slot b {
    font-size: 9px;
  }
  #timer {
    font-size: 20px;
    top: 18px;
    letter-spacing: 1px;
  }
  #stats {
    font-size: 12.5px;
    gap: 8px;
    padding: 3px 8px;
    margin-right: 40px;
  }
  #stats img {
    width: 15px;
    height: 15px;
    vertical-align: -3px;
  }
  #pausebtn {
    top: 20px;
    right: max(8px, env(safe-area-inset-right));
    width: 32px;
    height: 28px;
    font-size: 12px;
  }
  #bossbar {
    top: 56px;
    width: min(440px, 58vw);
    height: 12px;
  }
  #bossname {
    top: -18px;
    font-size: 13px;
  }
  #toasts {
    top: auto;
    bottom: max(78px, calc(env(safe-area-inset-bottom) + 74px));
  }
  .toast {
    font-size: 12.5px;
    padding: 4px 12px;
  }
  .toast.big {
    font-size: 16px;
  }
  #coop-hud {
    top: 76px;
    left: max(8px, env(safe-area-inset-left));
    width: 154px;
    padding: 5px 7px;
    font-size: 10.5px;
  }
  #coop-wait {
    top: 52px;
    padding: 6px 12px;
    font-size: 12px;
  }
  #runbag {
    left: max(10px, env(safe-area-inset-left));
    bottom: max(8px, env(safe-area-inset-bottom));
    max-width: 24vw;
    gap: 3px;
  }
  #runbag .slot {
    width: 26px;
    height: 26px;
  }
  #skillbar {
    bottom: max(8px, env(safe-area-inset-bottom));
    gap: 7px;
  }
  #skillbar .sk {
    width: 46px;
    height: 46px;
  }
  #skillbar .cd {
    font-size: 14px;
  }
  #skillbar #pillbar {
    margin-left: 3px;
  }
  #pillbar {
    gap: 4px;
  }
  #pillbar .pl {
    width: 36px;
    height: 36px;
  }
  #pillbar .ptimer {
    min-height: 13px;
    line-height: 13px;
    font-size: 9.5px;
    padding: 0 4px;
  }

  /* In-Game Overlays (#panel: Ngộ Đạo, Pause, Chest, Results) */
  #overlay {
    padding: 8px;
  }
  #panel {
    padding: 12px 16px;
    max-height: 94dvh;
    max-width: min(620px, 94vw);
  }
  #panel h1 {
    font-size: 24px;
  }
  #panel h2 {
    font-size: 20px;
  }
  .sub {
    font-size: 12.5px;
    margin-bottom: 8px;
  }
  .cards {
    gap: 6px;
  }
  #panel .card {
    padding: 7px 10px;
    gap: 10px;
  }
  .card img {
    width: 40px;
    height: 40px;
  }
  .card h3 {
    font-size: 14.5px;
    margin-bottom: 2px;
  }
  .card p {
    font-size: 12px;
  }
  table.sum td {
    padding: 3px 10px;
    font-size: 13px;
  }
}

/* Extra-tight adjustments for very short/narrow landscape phones (e.g. 640x300 with browser bar) */
@media (max-height: 360px), (max-width: 700px) {
  .lb-calligraphy span {
    font-size: 19px;
  }
  .lb-menu {
    width: clamp(290px, 51vw, 350px);
    gap: 4px 5px;
  }
  .lb-menu .qcbh-plaque {
    padding: 0 9px 0 8px;
    gap: 4px;
    font-size: 10px;
  }
  .lb-menu .qcbh-plaque .qp-img {
    width: 16px;
    height: 16px;
  }
  .lb-right-col .lb-top-right {
    width: clamp(198px, 36vw, 240px);
    gap: 4px;
  }
  .qcbh-badge-plaque.hero-card {
    height: 52px;
  }
  .qcbh-badge-plaque {
    height: 40px;
  }
  #lbhero {
    width: 34px;
    height: 38px;
  }
  .bp-seal-stamp {
    width: 28px;
    height: 28px;
    font-size: 8px;
  }
  .qcbh-bowuzhi-plaque {
    min-width: 112px;
    height: 30px;
    padding: 0 9px;
    font-size: 10.5px;
  }
  .lb-bottom-right .qcbh-ink-pill {
    min-width: 76px;
    height: 28px;
    padding: 0 10px;
    font-size: 10.5px;
  }
  .res-chip.tuvi {
    display: none;
  }
  .gc-feats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .bs-solo-grid,
  .bs-world-grid {
    grid-template-columns: 1fr;
  }
  .coop-slots,
  .coop-maps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #create .cbox {
    flex-wrap: wrap;
  }
  .bg-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ================================================================
 * Stage 1: Bright Pixel Art Combat HUD (Warm Wood · Gold · Jade)
 * ================================================================ */
#game {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
#xpbar {
  height: 22px;
  background: linear-gradient(180deg, #4b2f1c, #351f12);
  border-bottom: 2px solid #e4ba5c;
  box-shadow: 0 2px 0 rgba(36, 20, 12, 0.55);
}
#xpfill {
  background: linear-gradient(90deg, #28a678, #4fd99c, #88f2be);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35);
}
#xplabel {
  line-height: 22px;
  font-weight: 700;
  color: #fff9e6;
  text-shadow: 1px 1px 0 #26150c, -1px -1px 0 #26150c, 1px -1px 0 #26150c, -1px 1px 0 #26150c;
}
#timer {
  top: 28px;
  font-size: 24px;
  color: #fff8dc;
  background: linear-gradient(180deg, #694126, #492b18);
  border: 2px solid #e6be60;
  border-radius: 8px;
  padding: 2px 14px;
  box-shadow: 0 3px 0 #2b180e;
  text-shadow: 1px 1px 0 #24130a;
}
#stats {
  background: linear-gradient(180deg, #fbf1d6, #ecdab0);
  color: #3a2213;
  border: 2px solid #6b4325;
  box-shadow: inset 0 0 0 1px #fff8e6, 0 3px 0 rgba(42, 24, 14, 0.55);
  border-radius: 8px;
  font-weight: 700;
  text-shadow: none;
  height: 32px;
  box-sizing: border-box;
  align-items: center;
  margin-right: 42px;
}
#pausebtn {
  top: 28px;
  right: 12px;
  background: linear-gradient(180deg, #f9ecc8, #e0c386);
  color: #462a16;
  border: 2px solid #6b4325;
  box-shadow: inset 0 1px 0 #fff9e6, 0 3px 0 rgba(42, 24, 14, 0.55);
  font-weight: 900;
}
.slot {
  background: linear-gradient(180deg, #5e3a22, #3e2515);
  border: 2px solid #e4ba5c;
  box-shadow: inset 0 0 0 1px #2a170c, 0 3px 0 rgba(36, 20, 12, 0.55);
}
.slots.small .slot {
  border-color: #65d6a6;
}
#bossbar {
  margin-top: 28px;
  background: #3b1d18;
  border: 2px solid #f0c25a;
  box-shadow: 0 3px 0 rgba(36, 16, 12, 0.65);
}
#bossfill {
  background: linear-gradient(90deg, #c92626, #f04838, #ff7a48);
}
#bossname {
  color: #fff6dc;
  text-shadow: 1px 1px 0 #28100c, -1px -1px 0 #28100c;
}
#active-bar .abtn,
#pills-bar .pbtn {
  background: linear-gradient(180deg, #6b4226, #442816);
  border: 2px solid #e8bf5e;
  box-shadow: inset 0 1px 0 rgba(255, 242, 200, 0.35), 0 3px 0 #29160c;
}

/* --- Style B: Grouped Đạo Thân Sub-Banners & UR Thần Phẩm Rarity --- */
.gc-subtabs {
  display: flex;
  gap: 8px;
  padding: 8px 18px;
  background: rgba(18, 26, 36, 0.45);
  border-bottom: 1px solid rgba(255, 224, 148, 0.22);
  flex-wrap: wrap;
}
.gc-subtabs button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 224, 148, 0.3);
  background: rgba(255, 255, 255, 0.06);
  color: #e6ddc8;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}
.gc-subtabs button:hover {
  background: rgba(255, 224, 148, 0.16);
  border-color: rgba(255, 224, 148, 0.65);
}
.gc-subtabs button.on {
  background: linear-gradient(135deg, rgba(235, 176, 62, 0.34), rgba(196, 68, 52, 0.34));
  border-color: #ffd875;
  color: #fff6d6;
  box-shadow: 0 0 12px rgba(255, 200, 96, 0.32);
}
.gc-subseal {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.32);
  color: #ffd875;
}
.gc-pity-ur b {
  color: #ff7e7e;
}
.gc-feat.r-UR,
.gc-pcard.r-UR,
.gc-res.r-UR {
  border-color: #ff6e6e !important;
  box-shadow: 0 0 16px rgba(255, 102, 92, 0.42), inset 0 0 12px rgba(255, 198, 92, 0.22);
}
.r-UR .gc-rar,
.r-UR .gc-rtag {
  background: linear-gradient(135deg, #c92a2a, #e8891e) !important;
  color: #fff8dc !important;
}

/* Đan Lô: the living furnace (js/ui/danlo.js) */
.danlo-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 0 0 10px;
  padding: 6px 0 4px;
  border-bottom: 1px solid rgba(207, 169, 90, 0.2);
  background: radial-gradient(ellipse at 50% 75%, rgba(255, 140, 60, 0.16), transparent 60%);
}
.danlo-stage canvas {
  width: 144px;
  height: 198px;
  image-rendering: pixelated;
  cursor: pointer;
}
.danlo-cap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.danlo-cap b {
  color: var(--gold2);
  font-size: 18px;
}
.danlo-cap em {
  font-style: normal;
  font-size: 12px;
  color: #9fb0c4;
}
.danlo-pill {
  position: absolute;
  width: 40px;
  height: 40px;
  image-rendering: pixelated;
  pointer-events: none;
  filter: drop-shadow(0 0 8px rgba(255, 220, 140, 0.95));
  animation: danlo-pop 1.35s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}
.danlo-pill.fail {
  filter: grayscale(0.8) drop-shadow(0 0 6px rgba(255, 90, 40, 0.8));
  animation-name: danlo-pop-fail;
}
@keyframes danlo-pop-fail {
  0% { transform: translate(0, 10px) scale(0.4) rotate(0); opacity: 0; }
  20% { transform: translate(34px, -40px) scale(1.15) rotate(160deg); opacity: 1; }
  100% { transform: translate(70px, 40px) scale(0.8) rotate(420deg); opacity: 0; }
}
.danlo-fx {
  position: absolute;
  pointer-events: none;
  image-rendering: pixelated;
  z-index: 2;
}
.danlo-stage.danlo-shake {
  animation: danlo-shake 0.5s linear;
}
@keyframes danlo-shake {
  0%, 100% { transform: translate(0, 0); }
  15% { transform: translate(-6px, 3px); }
  30% { transform: translate(5px, -4px); }
  45% { transform: translate(-4px, -2px); }
  60% { transform: translate(4px, 3px); }
  80% { transform: translate(-2px, 1px); }
}
.danlo-pham {
  font-size: 14px;
  color: #c8c0b0;
}
.danlo-up {
  align-self: flex-start;
  font-size: 12px;
  padding: 4px 10px;
}
.danlo-max {
  color: #ff8a8a !important;
}
.danlo-thuat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #c8d4e0;
}
.danlo-thuat i {
  display: inline-block;
  width: 110px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.danlo-thuat u {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #ff9a3a, #ffd060);
  text-decoration: none;
}
.danlo-thuat small {
  color: #8a98a8;
}
.dan-odds .dan-tam {
  color: #ffb070;
  font-style: normal;
}
.dan-odds .dan-why {
  display: block;
  font-size: 11px;
  color: #8a98a8;
}
@keyframes danlo-pop {
  0% { transform: translate(0, 20px) scale(0.3); opacity: 0; }
  20% { transform: translate(0, -46px) scale(1.25); opacity: 1; }
  60% { transform: translate(0, -60px) scale(1.1); opacity: 1; }
  100% { transform: translate(0, -96px) scale(0.9); opacity: 0; }
}
@media (max-width: 760px) {
  .danlo-stage canvas {
    width: 96px;
    height: 132px;
  }
}

/* Pháp Tượng unlocked on breakthrough (G.PhapTuong): first frame of each strip as a thumbnail */
.pt-new {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pt-new img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  object-position: 0 0;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 6px rgba(255, 220, 140, 0.8));
}

/* Ngọc khảm on the Đạo Thân (G.Ngoc, js/ui/create.js) */
.ngoc-holes {
  display: flex;
  gap: 6px;
}
.crow .ngoc-hole {
  width: 46px;
  height: 46px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
}
.ngoc-hole.on {
  box-shadow: 0 0 0 2px #d39a2a;
}
.ngoc-hole img {
  width: 42px;
  height: 42px;
  image-rendering: pixelated;
}
.ngoc-hole i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px dashed #b79a6a;
}
.ngoc-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -2px 0 8px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(60, 40, 20, 0.08);
}
.ngoc-pick button {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 3px 8px;
}
.ngoc-pick img {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
}
.ngoc-pick span {
  display: flex;
  flex-direction: column;
  text-align: left;
}
.ngoc-pick em {
  font-style: normal;
  color: #2f6b3a;
}
.ngoc-pick .ngoc-off {
  color: #a33;
}

/* ---------------------------------------------------------------- Bảo Các Đấu Giá (#auction-ui) */
#auction-ui,
#mail-ui {
  position: fixed;
  inset: 0;
  z-index: 62;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 6, 4, 0.72);
  backdrop-filter: blur(4px);
  padding: 12px;
}
#auction-ui.hidden,
#mail-ui.hidden {
  display: none;
}
#auction-ui .win-auc,
#mail-ui .win-auc {
  width: min(1040px, 96vw);
  height: min(740px, 92vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#auction-ui .hub-head,
#mail-ui .hub-head {
  background: linear-gradient(180deg, #5e3820, #3a2010) !important;
  border-bottom: 2px solid #d4a650 !important;
  border-radius: 10px 10px 0 0 !important;
  color: #fff8e4 !important;
}
#auction-ui .hub-head::after,
#mail-ui .hub-head::after {
  display: none !important;
}
#auction-ui .hub-head h2,
#mail-ui .hub-head h2 {
  color: #fff9e8 !important;
  text-shadow: 0 1px 2px #261409 !important;
}
#auction-ui .hub-seal,
#mail-ui .hub-seal {
  background: linear-gradient(180deg, #df9246, #b56526) !important;
  color: #fffdf5 !important;
  border: 1.5px solid #ffe48a !important;
}
.auc-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(24, 16, 10, 0.85);
  border-bottom: 1px solid rgba(218, 178, 96, 0.25);
  font-size: 12.5px;
  color: #e8dcc4;
}
.auc-status-l {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.auc-phase {
  padding: 2px 9px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 11.5px;
}
.auc-phase.open {
  background: rgba(48, 160, 96, 0.28);
  color: #7df7b0;
  border: 1px solid rgba(125, 247, 176, 0.45);
}
.auc-phase.bid {
  background: rgba(230, 140, 36, 0.3);
  color: #ffd06a;
  border: 1px solid rgba(255, 208, 106, 0.5);
}
.auc-phase.closed {
  background: rgba(160, 72, 64, 0.3);
  color: #ff9c94;
  border: 1px solid rgba(255, 156, 148, 0.4);
}
.auc-clock {
  color: #ffe299;
  font-weight: 600;
}
.auc-sched {
  color: #bfb095;
  font-size: 11.5px;
}
.auc-testbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(42, 24, 58, 0.88);
  border-bottom: 1px solid rgba(190, 130, 255, 0.35);
}
.auc-test-tag {
  font-size: 11px;
  font-weight: 700;
  color: #e2b8ff;
  margin-right: 4px;
}
.auc-tbtn {
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid rgba(190, 130, 255, 0.45);
  background: rgba(90, 48, 132, 0.55);
  color: #f6eaff;
  font-size: 11.5px;
  cursor: pointer;
}
.auc-tbtn:hover {
  background: rgba(120, 68, 172, 0.8);
}
.auc-tbtn.warn {
  border-color: rgba(255, 150, 90, 0.6);
  background: rgba(160, 68, 28, 0.65);
}
.auc-tabs {
  display: flex;
  gap: 6px;
  padding: 8px 16px 0;
  background: rgba(18, 12, 8, 0.72);
  border-bottom: 1px solid rgba(218, 178, 96, 0.28);
  overflow-x: auto;
}
.auc-tab {
  padding: 8px 14px;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  background: rgba(44, 30, 18, 0.55);
  color: #cbbba0;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.auc-tab.on {
  background: rgba(92, 60, 24, 0.92);
  border-color: rgba(235, 194, 102, 0.55);
  color: #fff3d1;
}
.auc-badge {
  display: inline-block;
  min-width: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: #e04638;
  color: #fff;
  font-style: normal;
  font-size: 11px;
  text-align: center;
  margin-left: 4px;
}
.auc-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px 16px;
  color: #f3e8d2;
}
.auc-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.auc-flt {
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid rgba(218, 178, 96, 0.35);
  background: rgba(34, 24, 16, 0.7);
  color: #d6c5a7;
  font-size: 12px;
  cursor: pointer;
}
.auc-flt.on {
  background: #a86c22;
  border-color: #ffd875;
  color: #fff8e4;
  font-weight: 700;
}
.auc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}
.auc-card {
  background: rgba(30, 21, 14, 0.9);
  border: 1px solid rgba(218, 178, 96, 0.32);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.auc-card.lead {
  border-color: #6df0a8;
  box-shadow: 0 0 0 1px rgba(109, 240, 168, 0.35);
}
.auc-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.auc-ico {
  width: 40px;
  height: 40px;
  border-radius: 7px;
  background: rgba(12, 8, 6, 0.65);
  border: 1px solid rgba(218, 178, 96, 0.35);
  image-rendering: pixelated;
  flex-shrink: 0;
}
.auc-card-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #fff2ce;
}
.auc-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 3px;
}
.auc-tag {
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
}
.auc-tag.merchant {
  background: rgba(216, 152, 36, 0.28);
  color: #ffd670;
}
.auc-tag.player {
  background: rgba(84, 168, 232, 0.25);
  color: #8fd4ff;
}
.auc-tag.rare {
  background: rgba(212, 64, 88, 0.32);
  color: #ff9eb0;
}
.auc-tag.outbid {
  background: rgba(230, 150, 40, 0.28);
  color: #ffd070;
}
.auc-tag.win {
  background: rgba(54, 180, 108, 0.28);
  color: #7df7b0;
}
.auc-tag.sold {
  background: rgba(94, 178, 255, 0.26);
  color: #9be0ff;
}
.auc-tag.unsold {
  background: rgba(160, 140, 120, 0.28);
  color: #dcd0c0;
}
.auc-card-desc {
  margin: 0;
  font-size: 11.5px;
  color: #c2b298;
  line-height: 1.35;
  min-height: 30px;
}
.auc-price-box {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 9px;
  border-radius: 7px;
  background: rgba(14, 10, 7, 0.65);
  font-size: 11.5px;
}
.auc-price-box span {
  display: block;
  color: #a8987e;
  font-size: 10.5px;
}
.auc-price-box b {
  color: #ffd86b;
  font-size: 13px;
}
.auc-bidder {
  text-align: right;
}
.auc-bidder b {
  color: #e8eef6;
  font-size: 12px;
}
.auc-bid-row {
  display: flex;
  gap: 6px;
}
.auc-bid-in {
  flex: 1;
  min-width: 0;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid rgba(218, 178, 96, 0.45);
  background: rgba(12, 8, 6, 0.85);
  color: #fff3d1;
  font-size: 13px;
  font-weight: 600;
}
.auc-bid-hint {
  margin-top: 3px;
  font-size: 11px;
  color: #b7a68a;
}
.auc-btn {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid rgba(218, 178, 96, 0.55);
  background: rgba(74, 48, 22, 0.85);
  color: #fff4d6;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.auc-btn.primary {
  background: linear-gradient(180deg, #c98628, #8e5414);
  border-color: #ffd87a;
}
.auc-btn.primary:hover:not(:disabled) {
  filter: brightness(1.12);
}
.auc-btn.ghost {
  background: rgba(60, 42, 28, 0.6);
  width: 100%;
}
.auc-btn.big {
  width: 100%;
  padding: 9px 14px;
  font-size: 13.5px;
}
.auc-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
/* Mua ngay (28/11/2026) */
.auc-buynow-line {
  margin: 2px 0 0;
  padding: 4px 9px;
  border-radius: 7px;
  background: rgba(44, 148, 86, 0.16);
  border: 1px dashed rgba(125, 247, 176, 0.35);
  font-size: 11.5px;
  color: #b9e8cb;
}
.auc-buynow-line b {
  color: #7df7b0;
  font-size: 12.5px;
}
.auc-btn.buynow {
  width: 100%;
  margin-top: 6px;
  background: linear-gradient(180deg, #2f9a5e, #1c6a3d);
  border-color: #7df7b0;
  color: #effff5;
}
.auc-btn.buynow:hover:not(:disabled) {
  filter: brightness(1.12);
}
.auc-btn.buynow.confirm {
  background: linear-gradient(180deg, #e0a32c, #a8650f);
  border-color: #ffe08a;
  animation: auc-pulse 0.9s ease-in-out infinite;
}
@keyframes auc-pulse {
  50% { filter: brightness(1.22); }
}
.auc-bn-field .auc-bn-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: #b9e8cb;
  cursor: pointer;
}
.auc-bn-field input[type='number']:disabled {
  opacity: 0.45;
}
.auc-lead-note {
  text-align: center;
  padding: 6px;
  border-radius: 6px;
  background: rgba(44, 148, 86, 0.22);
  color: #7df7b0;
  font-size: 12px;
  font-weight: 700;
}
.auc-mine-note,
.auc-closed-note {
  text-align: center;
  padding: 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: #d6c5a7;
  font-size: 12px;
}
.auc-empty {
  text-align: center;
  padding: 36px 16px;
  color: #b8a68a;
  font-size: 13.5px;
}
.auc-sell-wrap {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 14px;
}
@media (max-width: 720px) {
  .auc-sell-wrap {
    grid-template-columns: 1fr;
  }
}
.auc-sell-list h4,
.auc-sell-form h4,
.auc-my-lots h4 {
  margin: 0 0 8px;
  font-size: 13px;
  color: #ffe094;
}
.auc-inv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 6px;
  max-height: 310px;
  overflow-y: auto;
  padding-right: 4px;
}
.auc-inv-it {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 7px;
  border: 1px solid rgba(218, 178, 96, 0.25);
  background: rgba(26, 18, 12, 0.85);
  color: #f3e8d2;
  cursor: pointer;
  text-align: left;
}
.auc-inv-it.on {
  border-color: #ffd875;
  background: rgba(96, 62, 22, 0.72);
}
.auc-inv-it img {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
  flex-shrink: 0;
}
.auc-inv-it span {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.auc-inv-it b {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.auc-inv-it em {
  font-style: normal;
  font-size: 11px;
  color: #c8b698;
}
.auc-sell-form {
  background: rgba(24, 16, 10, 0.85);
  border: 1px solid rgba(218, 178, 96, 0.3);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.auc-sel-head {
  display: flex;
  gap: 10px;
  align-items: center;
}
.auc-sel-head img {
  width: 40px;
  height: 40px;
  image-rendering: pixelated;
}
.auc-sel-head p {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: #bfb095;
}
.auc-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #d8c8aa;
}
.auc-field input {
  padding: 6px 9px;
  border-radius: 6px;
  border: 1px solid rgba(218, 178, 96, 0.45);
  background: rgba(12, 8, 6, 0.88);
  color: #fff4d6;
  font-size: 13.5px;
  font-weight: 700;
}
.auc-fee-box {
  padding: 8px 10px;
  border-radius: 7px;
  background: rgba(14, 10, 7, 0.65);
  font-size: 12px;
  color: #cbbba0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.auc-fee-box b {
  color: #ffd86b;
}
.auc-my-lots {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(218, 178, 96, 0.25);
}
.auc-inb-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 13px;
}
.auc-inb-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.auc-inb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  background: rgba(30, 21, 14, 0.9);
  border: 1px solid rgba(218, 178, 96, 0.3);
}
.auc-inb-row img {
  width: 36px;
  height: 36px;
  image-rendering: pixelated;
  flex-shrink: 0;
}
.auc-inb-info {
  flex: 1;
  min-width: 0;
}
.auc-inb-info b {
  margin-left: 6px;
  color: #ffe082;
  font-size: 13px;
}
.auc-inb-info p {
  margin: 3px 0 0;
  font-size: 12px;
  color: #c2b298;
}
.auc-msg {
  padding: 7px 16px;
  font-size: 12.5px;
  font-weight: 600;
  border-top: 1px solid rgba(218, 178, 96, 0.25);
}
.auc-msg.ok {
  background: rgba(36, 112, 68, 0.45);
  color: #a6ffd0;
}
.auc-msg.err {
  background: rgba(140, 38, 32, 0.5);
  color: #ffb8b0;
}

.sect-mail-btn {
  position: relative;
}
.sect-mail-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: #e03c32;
  color: #fff;
  font-style: normal;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 17px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}

/* hệ (G.Elem): badges and the Linh Căn picker */
.el-badge { display: inline-block; padding: 0 6px; border-radius: 4px; font-size: 12px; font-weight: bold; line-height: 18px; color: #10131a; background: var(--el, #c8d0dc); white-space: nowrap; }
.el-badge.el-none { background: #5a6270; color: #e8edf4; }
#create .cel { flex-wrap: wrap; align-items: center; gap: 6px; }
#create .cel-pick { display: flex; flex-wrap: wrap; gap: 4px; }
#create .elbtn { padding: 2px 8px; font-size: 12px; border-left: 3px solid var(--el); }
#create .elbtn.on { background: var(--el); color: #10131a; font-weight: bold; }
#create .cel-info { flex-basis: 100%; font-style: normal; font-size: 12px; opacity: 0.85; }


/* ============================================================================
 * Global Server Broadcast Banner (World Boss Event — visible in Lobby & Map)
 * ============================================================================ */
#global-broadcast {
  position: fixed;
  top: 8px;
  left: 50%;
  transform: translate(-50%, -140%);
  z-index: 9999;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(94vw, 860px);
  padding: 7px 16px 7px 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(28, 14, 8, 0.94), rgba(56, 20, 12, 0.95), rgba(28, 14, 8, 0.94));
  border: 1.5px solid rgba(246, 212, 110, 0.85);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.65), 0 0 18px rgba(255, 130, 48, 0.35);
  color: #fff6d6;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  opacity: 0;
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
}
#global-broadcast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}
body.in-run #global-broadcast {
  top: 46px;
}
#global-broadcast.gb-open,
#global-broadcast.gb-kill {
  background: linear-gradient(90deg, rgba(64, 14, 10, 0.96), rgba(118, 28, 14, 0.96), rgba(64, 14, 10, 0.96));
  border-color: #ffd670;
  box-shadow: 0 6px 26px rgba(0, 0, 0, 0.72), 0 0 24px rgba(255, 92, 48, 0.55);
}
#global-broadcast.gb-rank {
  background: linear-gradient(90deg, rgba(42, 26, 8, 0.95), rgba(84, 54, 14, 0.96), rgba(42, 26, 8, 0.95));
  border-color: #ffe285;
}
#global-broadcast.gb-end {
  background: linear-gradient(90deg, rgba(16, 30, 48, 0.95), rgba(34, 58, 92, 0.96), rgba(16, 30, 48, 0.95));
  border-color: #8ee8ff;
}
#global-broadcast .gb-tag {
  flex: none;
  padding: 2px 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffd870, #c88620);
  color: #241204;
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.6px;
  text-shadow: none;
}
#global-broadcast .gb-track {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
#global-broadcast .gb-text {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

/* World Boss Event Schedule Pill & Pending Rewards */
.bs-event-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  margin-bottom: 8px;
  border-radius: 8px;
  background: rgba(14, 22, 34, 0.88);
  border: 1px solid rgba(207, 169, 90, 0.42);
  font-size: 12.5px;
  color: #dce8f8;
}
.bs-event-bar.is-open {
  background: linear-gradient(90deg, rgba(78, 22, 14, 0.9), rgba(44, 16, 12, 0.92));
  border-color: rgba(255, 166, 74, 0.8);
  color: #ffefd0;
}
.bs-event-bar b {
  color: #ffe28a;
}
.bs-pending-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}
.bs-pending-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(54, 38, 12, 0.72);
  border: 1px solid rgba(246, 212, 110, 0.65);
  font-size: 12px;
  color: #fff2cc;
}
.bs-pending-row button {
  padding: 5px 12px !important;
  min-height: 30px !important;
  font-size: 12px !important;
}
.bs-rk-list {
  max-height: 156px;
  overflow-y: auto;
}
.bs-boss-list {
  max-height: 410px;
  overflow-y: auto;
}

/* Túi đồ: khoá bí kíp + Tham ngộ toàn bộ (góp ý 28/11/2026) */
.bag .cell .cell-lock {
  position: absolute;
  left: 3px;
  top: 2px;
  font-size: 12px;
  font-style: normal;
  text-shadow: 0 0 3px #000;
}
.bag-learnall {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0;
}
.bag-learnall em {
  font-style: normal;
  opacity: 0.8;
}
.learnall-list {
  max-height: 50vh;
  overflow: auto;
  text-align: left;
  margin: 8px 0;
  padding-left: 20px;
  line-height: 1.6;
}

/* Gacha → Kho: tooltip chi tiết khi hover (góp ý 28/11/2026) */
.gtip {
  position: fixed;
  z-index: 9999;
  max-width: 320px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 212, 102, 0.45);
  border-radius: 8px;
  background: rgba(12, 16, 26, 0.96);
  color: #e8e4d8;
  font-size: 13px;
  line-height: 1.45;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.1s;
}
.gtip.on {
  opacity: 1;
  visibility: visible;
}
.gtip-h {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}
.gtip-sub {
  margin: 2px 0 6px;
  opacity: 0.8;
  font-size: 12px;
}
.gtip-sec {
  margin-top: 6px;
}
.gtip-sec > i {
  display: block;
  font-style: normal;
  font-size: 11px;
  color: #ffd466;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.gtip-sec p {
  margin: 2px 0 0;
}
.gtip .trait-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.gtip-own {
  margin-top: 8px;
  font-size: 12px;
  opacity: 0.75;
}
.gtip-own.ok {
  color: #5ee6c6;
  opacity: 1;
}

/* Tẩy Luyện (js/data/tayluyen.js, Đạo Thân editor) */
#create .crow.tl { align-items: flex-start; }
.tl-box { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.tl-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; min-height: 24px; }
.tl-line > i { width: 26px; text-align: center; font-style: normal; }
.tl-line.off { opacity: 0.55; }
.tl-line em { font-style: normal; opacity: 0.7; }
.tl-lock { width: 26px; height: 24px; padding: 0; font-size: 13px; }
.tl-lock.on { background: rgba(255, 200, 90, 0.35); }
.tl-arrow { opacity: 0.6; }
.tl-acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.tl-acts button { font-size: 12px; padding: 4px 10px; }

/* ---------------------------------------------------------------- Hòm Thư (#mail-ui, ui/mail.js) */
#mail-ui .win-mail {
  width: min(760px, 96vw);
  height: min(620px, 92vh);
}
#auction-ui .auc-mail-link {
  cursor: pointer;
  font: inherit;
  color: #ffe9b0;
  border: 1px solid rgba(255, 210, 120, 0.45);
  background: rgba(40, 24, 10, 0.7);
}
#auction-ui .auc-mail-link:hover {
  border-color: #ffd27a;
}
.auc-tag.gift {
  background: rgba(220, 90, 160, 0.18);
  color: #ffb3dc;
  border-color: rgba(255, 140, 200, 0.5);
}
.gift-wrap {
  display: grid;
  gap: 14px;
  padding: 6px 4px;
}
.gift-box,
.gift-note {
  background: rgba(30, 20, 12, 0.75);
  border: 1px solid rgba(218, 178, 96, 0.3);
  border-radius: 10px;
  padding: 14px 16px;
  color: #eadbc0;
}
.gift-box h4,
.gift-note h4 {
  margin: 0 0 6px;
  color: #ffd98a;
}
.gift-sub,
.gift-note p,
.gift-note li {
  font-size: 13px;
  line-height: 1.5;
  margin: 4px 0;
}
.gift-note ul {
  margin: 4px 0 4px 18px;
  padding: 0;
}
.gift-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.gift-row input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid rgba(218, 178, 96, 0.5);
  background: #120c07;
  color: #fff3d6;
  font-size: 16px;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.gift-ex {
  color: #b9f0b0;
}
