/* 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;
  height: 100%;
  overflow: hidden;
  background: var(--ink);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  color: var(--text);
  font-family: 'Noto Serif', 'Times New Roman', serif;
}
#game {
  display: block;
  width: 100vw;
  height: 100vh;
}
#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;
  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);
}

/* ---------- toasts ---------- */
#toasts {
  position: fixed;
  top: 120px;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  z-index: 40;
}
.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;
}
#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;
}
.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);
}


/* ==========================================================================
 * 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;
  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);
}
.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.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: #ffe298 !important;
  font-weight: 700;
}
.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;
}
