/* pixel-bright.css: Stage 2 — Bright Warm Xianxia Pixel UI Theme (Walnut Wood · Cream Parchment · Antique Gold · Jade)
 * Inspired by vankieptutien.online: clean, sunny, high-contrast readability across Lobby, Hub, Gacha, Boss, Create, Combat & Modals.
 */
:root {
  --ink: #70b8e8;
  --panel: #fbf3de;
  --panel2: #f3e5c4;
  --border: #b88a4a;
  --gold: #c98f28;
  --gold2: #7a4b10;
  --text: #382112;
  --muted: #6f523a;
  --jade: #1d8a64;
  --jade-dark: #156649;
  --red: #d43832;
  --wood-top: #74492b;
  --wood-bot: #4f2f1a;
  --wood-dark: #2c180c;
  --cream: #fcf5e3;
  --cream2: #efe0bd;
  --gold-rim: #e8be5e;
}

html,
body {
  background: #70b8e8;
  color: var(--text);
  font-family: 'Segoe UI', 'Noto Sans', system-ui, -apple-system, sans-serif;
}

#lobby-bg {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* ---------- Loading & Cloud Login (Bright Sky + Parchment) ---------- */
#loading {
  background: linear-gradient(180deg, #6cbced, #b6e6fc 60%, #e4f8ff);
  color: #4b2d18;
  font-weight: 800;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.7);
}
#cloud-login,
.cloud-login,
#auth {
  background:
    linear-gradient(180deg, rgba(108, 188, 237, 0.35), rgba(252, 245, 227, 0.22) 60%, rgba(79, 47, 26, 0.32)),
    url('../assets/pixel/bg/sect_mountain.png') center / cover no-repeat,
    linear-gradient(180deg, #6cbced, #b6e6fc 60%, #e4f8ff) !important;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
#cloud-login .cl-box,
.cloud-login .cl-box,
#auth .box {
  width: min(390px, 92vw);
  padding: 24px 28px 22px;
  background: linear-gradient(180deg, var(--cream), var(--cream2)) !important;
  border: 3px solid var(--wood-bot) !important;
  box-shadow:
    inset 0 0 0 2px var(--gold-rim),
    0 6px 0 var(--wood-dark),
    0 18px 42px rgba(40, 24, 12, 0.45) !important;
  color: var(--text) !important;
  border-radius: 14px !important;
  image-rendering: auto;
}
#auth .auth-crest {
  display: inline-block;
  margin-bottom: 8px;
  padding: 3px 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--wood-top), var(--wood-bot));
  border: 1.5px solid var(--gold-rim);
  color: #fff4d2;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  box-shadow: 0 2px 0 var(--wood-dark);
}
#cloud-login h1,
#cloud-login h2,
.cloud-login h1,
.cloud-login h2,
#auth h2 {
  margin: 0 0 14px;
  color: #5c3214 !important;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 1px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.85);
}
#auth .auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  padding: 4px;
  background: rgba(116, 73, 43, 0.14);
  border: 1.5px solid #c9a265;
  border-radius: 10px;
}
#auth .auth-tabs button {
  flex: 1;
  opacity: 1 !important;
  padding: 8px 10px;
  border-radius: 7px;
  border: 1.5px solid transparent;
  background: transparent;
  color: #5c3a1e !important;
  font-weight: 700;
  font-size: 14px;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}
#auth .auth-tabs button:hover:not(.on) {
  background: rgba(255, 252, 240, 0.65);
  color: #382112 !important;
}
#auth .auth-tabs button.on {
  background: linear-gradient(180deg, var(--wood-top), var(--wood-bot)) !important;
  border-color: var(--gold-rim) !important;
  color: #fff4d2 !important;
  box-shadow: inset 0 1px 0 rgba(255, 244, 210, 0.35), 0 2px 0 var(--wood-dark);
}
#auth label {
  display: block;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
  color: #4f2f1a !important;
  margin-bottom: 11px;
}
#cloud-login input,
.cloud-login input,
#auth input {
  background: #fffdf6 !important;
  color: var(--text) !important;
  border: 2px solid #b58d54 !important;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 15px;
  box-shadow: inset 0 2px 4px rgba(79, 47, 26, 0.1);
}
#auth input:focus {
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 3px rgba(201, 143, 40, 0.25), inset 0 2px 4px rgba(79, 47, 26, 0.08);
}
#auth .auth-msg {
  min-height: 1.3em;
  margin: 4px 0 10px;
  color: #c62828 !important;
  font-weight: 700;
  font-size: 13px;
}
#auth .auth-note {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: #6f523a !important;
}
#auth button {
  background: linear-gradient(180deg, #f5e6c5, #e3cb9a);
  border: 2px solid #9a7038;
  border-radius: 8px;
  color: #382112;
  font-weight: 700;
}
#auth button.big {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 11px 24px;
  background: linear-gradient(180deg, #2ca378, #1d8a64 60%, #156649) !important;
  border: 2px solid var(--gold-rim) !important;
  border-radius: 10px;
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(10, 45, 32, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 3px 0 #0e4733;
}
#auth button.big:hover:not(:disabled) {
  filter: brightness(1.06);
}
#auth button.big:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 0 #0e4733;
}

/* ================================================================
 * SẢNH TÔNG MÔN (#lobby) — Interactive Pixel Mountain Layout
 * ================================================================ */
#lobby {
  position: fixed;
  inset: 0;
  z-index: 18;
  pointer-events: none;
  overflow: hidden;
}
#lobby > * {
  pointer-events: auto;
}

/* Top Wooden Profile & Resource Header */
.sect-topbar {
  position: fixed;
  top: 10px;
  left: 12px;
  right: 12px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px;
  background: linear-gradient(180deg, var(--wood-top), var(--wood-bot));
  border: 2px solid var(--gold-rim);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 244, 210, 0.35), 0 4px 0 var(--wood-dark), 0 8px 18px rgba(24, 16, 10, 0.35);
}

.sect-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 0;
  padding: 0;
  color: #fff8e4;
  text-align: left;
  cursor: pointer;
  min-width: 0;
}
.sect-ava-box {
  width: 48px;
  height: 52px;
  flex: 0 0 auto;
  border-radius: 9px;
  background: linear-gradient(180deg, #b8e4fa, #7bc4e8 58%, #70c264 59%, #59a850);
  border: 2px solid var(--gold-rim);
  box-shadow: inset 0 0 0 1px #3b2214;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.sect-ava-box canvas {
  width: 48px;
  height: 52px;
  image-rendering: pixelated;
}
.sect-prof-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.sect-prof-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.sect-prof-row b {
  font-size: 16px;
  font-weight: 800;
  color: #fffaf0;
  text-shadow: 0 1px 2px #261409;
  white-space: nowrap;
}
.sect-prof-realm {
  font-size: 12px;
  font-weight: 700;
  color: #ffe299;
}
.sect-tuvi-bar {
  position: relative;
  width: 170px;
  max-width: 38vw;
  height: 14px;
  background: #2f1a0e;
  border: 1px solid #c99c4e;
  border-radius: 99px;
  overflow: hidden;
}
.sect-tuvi-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #32b886, #6ef2b8);
}
.sect-tuvi-bar em {
  position: absolute;
  inset: 0;
  font-style: normal;
  font-size: 9.5px;
  line-height: 13px;
  text-align: center;
  color: #fffdf5;
  font-weight: 700;
  text-shadow: 0 1px 1px #1d1008;
}

.sect-top-right {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}
.sect-res-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: #2e190d;
  border: 2px solid #d9ab50;
  border-radius: 9px;
  color: #fff8df;
  font-size: 15px;
  cursor: pointer;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.35);
}
.sect-res-pill:hover {
  filter: brightness(1.1);
}
.sect-res-pill img {
  width: 20px;
  height: 20px;
  image-rendering: pixelated;
}
.sect-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: linear-gradient(180deg, #8b5936, #5f3a20);
  border: 2px solid var(--gold-rim);
  color: #fff8df;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 2px 0 var(--wood-dark);
}
.sect-icon-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* Left Quick-Action Wooden Buttons (clear gap below topbar!) */
.sect-quick {
  position: fixed;
  top: 94px;
  left: 14px;
  z-index: 18;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sect-wood-pill {
  padding: 7px 14px;
  min-width: 102px;
  background: linear-gradient(180deg, #b87a46, #8d562c);
  border: 2px solid #4a2a16;
  border-radius: 8px;
  color: #fff9e8;
  font-size: 13px;
  font-weight: 800;
  text-shadow: 0 1px 1px #3b2010;
  box-shadow: inset 0 1px 0 rgba(255, 240, 200, 0.45), 0 3px 0 #3d2110;
  cursor: pointer;
  transition: transform 0.12s;
}
.sect-wood-pill:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

/* Interactive Building Plaques locked over the 640x360 mountain canvas */
.sect-map-overlay {
  position: fixed;
  z-index: 14;
  pointer-events: none;
}
.sect-plaque {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px 6px 9px;
  background: linear-gradient(180deg, rgba(84, 74, 68, 0.94), rgba(56, 48, 44, 0.96));
  border: 2px solid #e5c686;
  border-radius: 9px;
  box-shadow: 0 3px 0 #261e1a, 0 6px 14px rgba(20, 26, 22, 0.35);
  color: #fffaf0;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.14s ease, filter 0.14s ease;
}
.sect-plaque:hover {
  transform: translate(-50%, calc(-50% - 3px)) scale(1.04);
  filter: brightness(1.1);
  z-index: 5;
}
.sect-plaque .sp-ico {
  font-size: 17px;
  line-height: 1;
}
.sect-plaque .sp-txt {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.15;
}
.sect-plaque .sp-txt b {
  font-size: 13px;
  font-weight: 800;
  color: #fffbf0;
  text-shadow: 0 1px 2px #1c1410;
}
.sect-plaque .sp-txt em {
  font-style: normal;
  font-size: 10.5px;
  color: #e8dbb8;
}
/* Primary Sơn Môn plaque (warm glowing amber-gold like Image 1's "Sơn Môn · Thiên Kiếp") */
.sect-plaque.primary {
  padding: 8px 16px 8px 12px;
  background: linear-gradient(180deg, #df9246, #b56526);
  border: 2px solid #ffe48a;
  box-shadow: inset 0 1px 0 rgba(255, 250, 215, 0.5), 0 4px 0 #592d10, 0 8px 18px rgba(45, 22, 8, 0.42);
}
.sect-plaque.primary .sp-txt b {
  font-size: 14.5px;
  color: #ffffff;
}
.sect-plaque.primary .sp-txt em {
  color: #fff1c2;
  font-weight: 700;
}
.sp-dot {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid #fff8e4;
  animation: pulseDot 1.4s infinite;
}
.sp-dot.red {
  background: #f03e3e;
}
.sp-dot.jade {
  background: #38d98b;
}
@keyframes pulseDot {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.22); }
}

/* Goal/Quest Parchment Banner above Bottom Dock (clean breathing gap!) */
.sect-quest-banner {
  position: fixed;
  left: 50%;
  bottom: 88px;
  transform: translateX(-50%);
  z-index: 19;
  width: min(640px, calc(100vw - 28px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 16px;
  background: linear-gradient(180deg, #fffaf0, #f4e6c6);
  border: 2px solid #6b4325;
  border-radius: 12px;
  box-shadow: inset 0 0 0 2px #e8c474, 0 4px 0 #3f2412, 0 8px 18px rgba(24, 18, 12, 0.28);
}
.sq-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.sq-tag {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.8px;
  color: #c2681a;
}
.sq-info b {
  font-size: 14px;
  font-weight: 800;
  color: #361f10;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sq-info em {
  font-style: normal;
  font-size: 11.5px;
  color: #6b4e36;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sq-btn {
  flex: 0 0 auto;
  padding: 9px 20px;
  background: linear-gradient(180deg, #64cf96, #3ca872);
  border: 2px solid #236846;
  border-radius: 9px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  text-shadow: 0 1px 1px #1a5436;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 3px 0 #1f5c3e;
  cursor: pointer;
}
.sq-btn:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
}

/* Bottom Wood Navigation Dock */
.sect-bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  z-index: 20;
  width: min(640px, calc(100vw - 24px));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  padding: 6px;
  background: linear-gradient(180deg, var(--wood-top), var(--wood-bot));
  border: 2px solid var(--gold-rim);
  border-radius: 12px;
  box-shadow: 0 4px 0 var(--wood-dark), 0 8px 18px rgba(24, 16, 10, 0.36);
}
.snav-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 5px 4px;
  background: transparent;
  border: 2px solid transparent;
  border-radius: 8px;
  color: #f3e0be;
  cursor: pointer;
  transition: background 0.12s;
}
.snav-btn:hover {
  background: rgba(255, 232, 180, 0.14);
}
.snav-btn.active {
  background: linear-gradient(180deg, #b87e4c, #8c5930);
  border-color: #f5d178;
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 245, 210, 0.35);
}
.snav-btn span {
  font-size: 18px;
  line-height: 1.1;
}
.snav-btn b {
  font-size: 11.5px;
  font-weight: 800;
}
.snav-dot {
  position: absolute;
  top: 4px;
  right: 12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff4747;
  border: 1.5px solid #fff8e4;
}

/* ================================================================
 * FULL BRIGHT PARCHMENT RE-SKIN FOR ALL HUBS, MODALS & OVERLAYS
 * (#hub, #gacha, #boss-ui, #create, #coop, #pvp-ui, #overlay, .hubmodal)
 * ================================================================ */
#hub,
#gacha,
#boss-ui,
#create,
#coop,
#pvp-ui,
#overlay,
.hubmodal {
  background: rgba(28, 42, 46, 0.45) !important;
  backdrop-filter: blur(4px);
}

/* Main floating window frames */
#hub .hub-win,
#gacha .hub-win,
#boss-ui .hub-win,
#coop .hub-win,
#pvp-ui .hub-win,
#create .cbox,
#overlay #panel,
.hubmodal .box {
  background: linear-gradient(180deg, var(--cream), var(--cream2)) !important;
  color: var(--text) !important;
  border: 3px solid var(--wood-bot) !important;
  border-radius: 14px !important;
  box-shadow: inset 0 0 0 2px var(--gold-rim), 0 8px 0 rgba(48, 28, 14, 0.55), 0 16px 40px rgba(20, 28, 26, 0.35) !important;
}

/* Warm wooden window headers */
#hub .hub-head,
#gacha .hub-head,
#boss-ui .hub-head,
#coop .hub-head,
#pvp-ui .hub-head {
  background: linear-gradient(180deg, var(--wood-top), var(--wood-bot)) !important;
  border-bottom: 2px solid var(--gold-rim) !important;
  color: #fff8e4 !important;
  border-radius: 10px 10px 0 0 !important;
}
#hub .hub-head h2,
#gacha .hub-head h2,
#boss-ui .hub-head h2,
#coop .hub-head h2,
#pvp-ui .hub-head h2 {
  color: #fff9e8 !important;
  text-shadow: 0 1px 2px #261409 !important;
}
#hub .hub-seal,
#gacha .hub-seal,
#boss-ui .hub-seal,
#coop .hub-seal,
#pvp-ui .hub-seal {
  background: linear-gradient(180deg, #df9246, #b56526) !important;
  color: #fffdf5 !important;
  border: 1.5px solid #ffe48a !important;
  text-shadow: 0 1px 1px #4c240c !important;
}
#hub .res-chip,
#gacha .res-chip,
#boss-ui .res-chip,
#coop .res-chip,
#pvp-ui .res-chip {
  background: #331c0f !important;
  border: 1.5px solid #d9ab50 !important;
  color: #fff6dc !important;
}

/* Crisp readable dark-brown text & cards inside parchment windows */
#hubbody,
#gacha .hub-win,
#boss-ui .hub-win,
#coop .hub-win,
#pvp-ui .hub-win,
#create .cbox,
#overlay #panel,
.hubmodal .box {
  color: var(--text) !important;
}
#hubbody h1, #hubbody h2, #hubbody h3, #hubbody h4,
#gacha h3, #boss-ui h3, #coop h3, #pvp-ui h3,
#create h2, #create h3,
#overlay #panel h1, #overlay #panel h2, #overlay #panel h3,
.hubmodal .box h2 {
  color: #4f2a10 !important;
  text-shadow: none !important;
}
#hubbody p, #hubbody span, #hubbody em, #hubbody td, #hubbody th,
#overlay #panel p, #overlay #panel td,
.hubmodal .box p, .hubmodal .box td {
  color: #4a311e;
}
#hubbody .sub,
#overlay #panel .sub {
  color: #705238 !important;
}

/* Cards, map entries, recipe rows, shop items, inventory cells, mastery cards, skill rows (NO wildcard > *!) */
#hubbody .mapcard,
#hubbody .mcard,
#hubbody .tucard,
#hubbody .rcard,
#hubbody .icard,
#hubbody .scard,
#hubbody .chocard,
#hubbody .cp-card,
#hubbody .bag-detail,
#hubbody .detail,
#hubbody .cell,
#hubbody .eq,
#hubbody .skill,
#hubbody .trade,
#hubbody .mst,
#hubbody .tu-hero,
#hubbody .tu-main,
#hubbody .beast-slot,
#hubbody .tu-box,
#hubbody .hub-coop-bar,
#hubbody .eq-slot,
#hubbody .slot-card,
#hubbody .dan-row,
#hubbody .recipe,
#overlay #panel .card,
#overlay #panel .loot,
#overlay #panel table.sum,
.hubmodal .box table.sum,
.hubmodal .lb-guide {
  background: linear-gradient(180deg, #fffdf6, #f4e8cd) !important;
  border: 2px solid #c9a366 !important;
  border-radius: 10px !important;
  color: var(--text) !important;
  box-shadow: 0 2px 0 rgba(107, 67, 37, 0.22) !important;
}

/* ================================================================
 * CLEAN BREATHING SPACE & PADDING ACROSS ALL HUB TABS & MODALS
 * (No sections touching, no borders hugging text/icons!)
 * ================================================================ */
#hubbody {
  padding: 18px 22px 24px !important;
}
#hub .hub-head,
#gacha .hub-head,
#boss-ui .hub-head,
#coop .hub-head,
#pvp-ui .hub-head {
  padding: 12px 18px !important;
  gap: 12px !important;
}
#hubbody .cpf,
#hubbody .cho-mode {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px !important;
  margin: 0 0 12px !important;
}
#hubbody .cpf button,
#hubbody .cho-mode button {
  padding: 7px 13px !important;
}
#hubbody .cho-opt,
#hubbody .cp-opt {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 4px 0 12px !important;
  padding: 2px 4px;
}

/* Công Pháp (Skills & Equipment slots) */
#hubbody .cp {
  gap: 20px !important;
}
#hubbody .cpslots {
  display: flex;
  flex-direction: column;
  gap: 14px !important;
  padding: 16px 18px !important;
  background: rgba(255, 250, 236, 0.55);
  border: 2px solid #d6b67c;
  border-radius: 12px;
}
#hubbody .cpslots .cptitle,
#hubbody .learned > h4 {
  margin: 0 0 8px !important;
  padding: 0 2px !important;
}
#hubbody .cpslots .slotrow h4 {
  margin: 0 0 6px !important;
}
#hubbody .cpslots .cells {
  gap: 8px !important;
}
#hubbody .eq {
  padding: 9px 12px !important;
  gap: 10px !important;
}
#hubbody .eq button {
  padding: 4px 10px !important;
}
#hubbody .learned {
  display: flex;
  flex-direction: column;
  gap: 10px !important;
}
#hubbody .skill {
  padding: 13px 16px !important;
  gap: 14px !important;
  margin: 0 !important;
  align-items: center !important;
}
#hubbody .skill > img {
  border-radius: 8px;
  flex-shrink: 0;
}
#hubbody .skill > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
#hubbody .skill h3,
#hubbody .skill p {
  margin: 0 !important;
}
#hubbody .skill .tag {
  padding: 5px 11px !important;
  border-radius: 7px;
  background: rgba(56, 163, 109, 0.14) !important;
  border: 1.5px solid #48a678 !important;
  color: #1f6b46 !important;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
}
#hubbody .skill button {
  padding: 7px 14px !important;
  white-space: nowrap;
  flex-shrink: 0;
}
#hubbody .skill i.g0 {
  color: #5b6978;
  background: rgba(91, 105, 120, 0.12);
}
#hubbody .skill i.g1 {
  color: #1673b8;
  background: rgba(22, 115, 184, 0.12);
}
#hubbody .skill i.g2 {
  color: #8c34b8;
  background: rgba(140, 52, 184, 0.12);
}
#hubbody .skill i.g3 {
  color: #a86b00;
  background: linear-gradient(180deg, rgba(255, 224, 120, 0.42), rgba(245, 185, 50, 0.24));
  border-color: #d4961a;
  box-shadow: 0 0 8px rgba(235, 175, 45, 0.35);
}
#hubbody .grade-head {
  color: #5c4b37;
}
#hubbody .grade-head b {
  color: #7c4d12;
}
#hubbody .grade-bar {
  background: rgba(120, 96, 66, 0.16);
  border-color: rgba(160, 124, 72, 0.38);
}
#hubbody .grade-prog.max .grade-head b {
  color: #b27300;
}

/* Tu Luyện (Động Phủ) + Thuần Thục Trường Phái */
#hubbody .tu-tabs {
  margin: 0 0 14px !important;
  padding-bottom: 10px;
  border-bottom: 1.5px solid rgba(201, 163, 102, 0.45);
}
#hubbody .tu-tabs button {
  font-size: 13.5px !important;
  font-weight: 800 !important;
  padding: 8px 16px !important;
}
#hubbody .tu-tabs .tu-badge {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 7px;
  border-radius: 999px;
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
  background: #c0392b;
  color: #fff8ee;
  line-height: 1.35;
}
#hubbody .tu-wrap {
  gap: 16px !important;
  margin-bottom: 0 !important;
}
#hubbody .tu-hero,
#hubbody .tu-main {
  padding: 14px 16px !important;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#hubbody .tu-hero #hubhero,
#hubbody .tu-hero #hubhero-next {
  width: 200px !important;
  height: 185px !important;
  margin: 0 auto !important;
}
#hubbody .tu-hero h3,
#hubbody .tu-hero p,
#hubbody .tu-main h1,
#hubbody .tu-main p {
  margin: 0 !important;
}
#hubbody .tu-act {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 6px 0 !important;
}
#hubbody .tu-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px !important;
  margin-top: 6px !important;
}
#hubbody .tu-links button,
#hubbody .tu-hero > button,
#hubbody .tu-act button {
  padding: 8px 16px !important;
}
#hubbody .beast-slots {
  gap: 8px !important;
  margin-top: 4px !important;
}
#hubbody .beast-slot {
  padding: 8px 10px !important;
  gap: 2px !important;
}
#hubbody .mastery {
  margin-top: 0 !important;
  padding: 18px 20px !important;
  background: rgba(255, 250, 236, 0.6) !important;
  border: 2px solid #d6b67c !important;
  border-radius: 12px !important;
}
#hubbody .mastery > h3 {
  margin: 0 0 8px !important;
  padding: 0 !important;
  border: none !important;
  background: none !important;
  box-shadow: none !important;
}
#hubbody .mastery > p {
  margin: 0 0 16px !important;
  padding: 0 !important;
  line-height: 1.5;
  border: none !important;
  background: none !important;
  box-shadow: none !important;
}
#hubbody .mst-grid {
  gap: 12px !important;
}
#hubbody .mst {
  padding: 12px 15px !important;
  gap: 12px !important;
  align-items: center !important;
}
#hubbody .mst .mst-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
#hubbody .mst h4,
#hubbody .mst p {
  margin: 0 !important;
}

/* Đan Lô (Alchemy Recipes) */
#hubbody .recipes {
  display: flex;
  flex-direction: column;
  gap: 12px !important;
  margin-top: 8px !important;
}
#hubbody .recipe {
  padding: 14px 16px !important;
  gap: 14px !important;
  align-items: center !important;
}
#hubbody .recipe h3,
#hubbody .recipe p {
  margin: 0 0 5px !important;
}
#hubbody .recipe .ins {
  display: flex;
  flex-wrap: wrap;
  gap: 8px !important;
  margin-top: 6px !important;
}
#hubbody .recipe > button {
  padding: 8px 14px !important;
  flex-shrink: 0;
}

/* Túi Đồ (Inventory Bag) */
#hubbody .bag {
  gap: 18px !important;
  margin-top: 10px !important;
}
#hubbody .bag .grid {
  gap: 10px !important;
  padding: 14px !important;
  background: rgba(255, 250, 236, 0.55);
  border: 2px solid #d6b67c;
  border-radius: 12px;
}
#hubbody .bag .cell {
  padding: 6px !important;
}
/* Item count: same gold + black outline as the in-run pill bar (field.css #pillbar b) */
#hubbody .bag .cell b {
  color: #ffe97a !important;
  font-weight: 800 !important;
  font-size: 13px !important;
  text-shadow:
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000,
    1px 1px 0 #000,
    0 1px 3px #000 !important;
  -webkit-text-stroke: 0 !important;
  background: none !important;
  z-index: 2;
}
#hubbody .bag .detail {
  padding: 18px 20px !important;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#hubbody .bag .detail h3,
#hubbody .bag .detail p {
  margin: 0 !important;
}
#hubbody .bag .detail button {
  padding: 9px 16px !important;
}

/* Phường Thị (Market) */
#hubbody .cho-list {
  display: flex;
  flex-direction: column;
  gap: 10px !important;
  margin-top: 8px !important;
}
#hubbody .trade {
  padding: 11px 16px !important;
  gap: 12px !important;
  align-items: center !important;
}
#hubbody .trade button {
  padding: 6px 12px !important;
  flex-shrink: 0;
}
/* Phường Thị sell tab: quantity box next to "Bán" (js/ui/hub.js tabCho) */
#hubbody .trade .trade-qty {
  width: 64px;
  flex-shrink: 0;
  padding: 5px 6px;
  font: inherit;
  font-weight: 700;
  text-align: center;
  color: #4a2e14;
  background: #fffaf0;
  border: 2px solid #b58a4c;
  border-radius: 8px;
}
#hubbody .trade b {
  width: auto;
  min-width: 44px;
}
/* Second line under the item name: what it does (js/ui/hub.js tabCho) */
#hubbody .trade .trade-name {
  min-width: 0;
  line-height: 1.3;
}
#hubbody .trade .trade-desc {
  display: block;
  margin-top: 3px;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.35;
  color: #7a5a3c;
  white-space: normal;
}

/* Bí Cảnh (Map Selection Cards) */
#hubbody .maps {
  gap: 16px !important;
  margin-bottom: 14px !important;
}
#hubbody .mapcard {
  padding: 16px 18px !important;
  gap: 8px !important;
}
#hubbody .hub-coop-bar {
  padding: 12px 16px !important;
  margin-bottom: 16px !important;
  gap: 12px !important;
}

/* Gacha, Boss, Create & Dialog Modals */
#create .cbox {
  padding: 22px 26px !important;
  gap: 24px !important;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  align-items: flex-start;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}
#create .crow {
  gap: 10px !important;
  margin-bottom: 10px !important;
}
#create button {
  padding: 6px 12px !important;
}
#create button.ngoc-hole {
  padding: 0 !important;
  width: 46px;
  height: 46px;
  border-radius: 10px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
#create button.ngoc-hole img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  display: block;
}
#create .cactions {
  margin-top: 14px !important;
  gap: 12px !important;
}
#create .ctabs {
  border-bottom-color: rgba(120, 78, 36, 0.35);
}
#create .cactions button {
  padding: 10px 22px !important;
}
.hubmodal .box {
  padding: 22px 24px !important;
}
.hubmodal .box p {
  margin: 10px 0 !important;
  line-height: 1.5;
}
/* Disable legacy dark ::before/::after floor overlays on .win-map .mapcard so bright biome parchment shines! */
.win-map .mapcard::before,
.win-map .mapcard::after {
  display: none !important;
}
.win-map .mapcard h3,
.win-map .mapcard p {
  text-shadow: none !important;
}
.win-map .mapcard .drops img {
  background: rgba(94, 58, 30, 0.14) !important;
  border: 1.5px solid #c9a366;
  border-radius: 6px;
}

/* ================================================================
 * UPGRADED IN-RUN LEVEL-UP ("Tăng cấp") — Clean Cream Cards + Stat Chips + Reroll
 * ================================================================ */
#overlay #panel.lu-panel {
  width: min(500px, calc(100vw - 24px)) !important;
  max-width: 500px !important;
  padding: 18px 16px 14px !important;
  background: linear-gradient(180deg, #fffdf4, #f7edd6) !important;
  border: 3px solid #e2bc66 !important;
  border-radius: 16px !important;
  box-shadow: inset 0 0 0 2px #fff8e2, 0 10px 30px rgba(34, 22, 12, 0.4) !important;
}
#overlay #panel.lu-panel .lu-title {
  margin: 0 0 2px;
  font-size: 23px !important;
  font-weight: 900;
  color: #8c3d16 !important;
  text-align: center;
}
#overlay #panel.lu-panel .lu-sub {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: #7c5c3c !important;
  text-align: center;
}
.lu-cards {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
}
#overlay #panel.lu-panel .card.lu-card {
  position: relative;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  width: 100%;
  padding: 12px 14px 12px 12px !important;
  background: #ffffff !important;
  border: 2px solid #dfbe78 !important;
  border-radius: 12px !important;
  box-shadow: 0 3px 0 #d4b064 !important;
  text-align: left !important;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
#overlay #panel.lu-panel .card.lu-card:hover {
  background: #fffdf5 !important;
  border-color: #36a874 !important;
  transform: translateY(-2px);
}
.lu-kbd {
  position: absolute !important;
  top: 8px;
  left: 8px;
  right: auto !important;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5ebd4 !important;
  border: 1.5px solid #b89154 !important;
  border-radius: 6px !important;
  color: #5c3c1e !important;
  font-size: 11px !important;
  font-weight: 800;
  font-family: inherit;
}
.lu-ico {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  margin-left: 18px;
  border-radius: 10px;
  background: linear-gradient(180deg, #fff6df, #ecd6a2);
  border: 2px solid #d4a64a;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}
.lu-ico img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
  border-radius: 6px;
}
.lu-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.lu-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.lu-head h3 {
  margin: 0 !important;
  font-size: 16.5px !important;
  font-weight: 900;
  color: #3a1f0e !important;
}
.lu-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 800;
  color: #ffffff !important;
}
.lu-badge.new {
  background: linear-gradient(180deg, #f25c84, #d93864);
}
.lu-badge.up {
  background: linear-gradient(180deg, #e8a438, #c47d1c);
}
.lu-meta {
  font-size: 12px;
  color: #7c5c3e !important;
  display: flex;
  align-items: center;
  gap: 6px;
}
.lu-meta b {
  color: #a85c16 !important;
}
.lu-pips {
  letter-spacing: 1px;
  font-size: 11px;
}
.lu-pip {
  color: #d8c49e !important;
}
.lu-pip.on {
  color: #e89b24 !important;
}
.lu-desc {
  margin: 2px 0 3px !important;
  font-size: 12.5px !important;
  line-height: 1.35;
  color: #4a311e !important;
}
.lu-desc b {
  color: #2c190c !important;
}
.lu-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.lu-chip {
  padding: 2px 8px;
  background: #f7efe0;
  border: 1px solid #dfd0b4;
  border-radius: 6px;
  font-size: 11px;
  color: #5e442c !important;
}
.lu-chip b {
  color: #341d0c !important;
  font-weight: 800;
}
.lu-bonus {
  margin-top: 2px;
  padding: 3px 9px;
  background: linear-gradient(180deg, #fff3c4, #fae08c);
  border: 1px solid #dfb44a;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 800;
  color: #7a4a0c !important;
  align-self: flex-start;
}
.lu-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
}
#overlay #panel.lu-panel button.lu-reroll {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px !important;
  background: linear-gradient(180deg, #e4faf0, #bcebd6) !important;
  border: 2px solid #309a70 !important;
  border-radius: 10px !important;
  color: #18573d !important;
  font-size: 13.5px !important;
  font-weight: 800 !important;
  box-shadow: 0 3px 0 #247856 !important;
}
#overlay #panel.lu-panel button.lu-reroll kbd {
  position: static !important;
  padding: 2px 6px;
  background: #ffffff !important;
  border: 1.5px solid #309a70 !important;
  border-radius: 5px;
  font-size: 11px;
  color: #18573d !important;
}
#overlay #panel.lu-panel button.lu-reroll:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Soft sunlit biome tints on the 4 Map Cards */
#hubbody .mapcard.theme-grass {
  background: linear-gradient(180deg, #effce8, #d8f0cc 55%, #f5ebd1) !important;
  border-color: #6ab55a !important;
}
#hubbody .mapcard.theme-jade {
  background: linear-gradient(180deg, #e8fbf5, #cceee2 55%, #f5ebd1) !important;
  border-color: #46a88c !important;
}
#hubbody .mapcard.theme-earth {
  background: linear-gradient(180deg, #fff3e2, #f5dec0 55%, #f5ebd1) !important;
  border-color: #d48948 !important;
}
#hubbody .mapcard.theme-snow {
  background: linear-gradient(180deg, #eef7ff, #d4e8fa 55%, #f5ebd1) !important;
  border-color: #6ea2d8 !important;
}
#hubbody .mapcard .mood,
#hubbody .mapcard .tag,
#hubbody .dan-tag,
#hubbody .tu-tag {
  background: #5a3820 !important;
  color: #fff5d6 !important;
  border: 1.5px solid #e4ba5c !important;
  border-radius: 6px !important;
  padding: 2px 9px !important;
  font-weight: 800 !important;
  display: inline-block;
}
#hubbody .dan-tag {
  margin-left: 6px;
}
#hubbody button.on em,
#hubbody button.active em {
  color: #ffe8a8 !important;
}
#hubbody .mapcard .boss {
  color: #8c3c18 !important;
  font-weight: 700;
}
#hubbody .bar {
  background: #dec99f !important;
  border: 1.5px solid #9e7440 !important;
}
#hubbody .bar > div,
#hubbody .bar > i {
  background: linear-gradient(90deg, #2da878, #60e0a8) !important;
}
#hubbody .bar span {
  color: #2e180c !important;
  font-weight: 800;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) !important;
}
#hubbody .cell.on {
  border-color: #2da672 !important;
  box-shadow: 0 0 0 2px rgba(45, 166, 114, 0.35) !important;
}
#hubbody .mapcard:hover,
#hubbody .mcard:hover,
#overlay #panel .card:hover {
  border-color: #36a674 !important;
  filter: brightness(1.03);
  transform: translateY(-2px);
}
#hubbody .mapcard b,
#hubbody .mapcard h3,
#hubbody .mcard b,
#hubbody .mcard h3,
#overlay #panel .card h3,
#hubbody .chocard b,
#hubbody .rcard b {
  color: #3a1f0e !important;
}

/* Filter chips & secondary buttons on bright parchment */
#hubbody button,
#gacha button:not(.hub-close-x),
#boss-ui button:not(.hub-close-x),
#coop button:not(.hub-close-x),
#pvp-ui button:not(.hub-close-x),
#create button,
#overlay #panel button,
.hubmodal .box button:not(.hub-close-x) {
  background: linear-gradient(180deg, #f7e9c6, #e5cd99) !important;
  color: #452814 !important;
  border: 2px solid #966a38 !important;
  border-radius: 8px !important;
  font-weight: 700 !important;
  text-shadow: none !important;
  box-shadow: 0 2px 0 rgba(78, 46, 22, 0.35) !important;
}
#hubbody button:hover,
#gacha button:not(.hub-close-x):hover,
#boss-ui button:not(.hub-close-x):hover,
#coop button:not(.hub-close-x):hover,
#pvp-ui button:not(.hub-close-x):hover,
#create button:hover,
#overlay #panel button:hover,
.hubmodal .box button:not(.hub-close-x):hover {
  filter: brightness(1.05);
}
#hubbody button.on,
#hubbody button.active,
#gacha button:not(.hub-close-x).on,
#boss-ui button:not(.hub-close-x).on,
#coop button:not(.hub-close-x).on,
#pvp-ui button:not(.hub-close-x).on,
#create button.on {
  background: linear-gradient(180deg, #74492b, #52311b) !important;
  color: #fff8e2 !important;
  border-color: #e6bc5a !important;
}

/* Primary Jade-Emerald action buttons (matching Image 1's "Nhận" button!) */
#hubbody button.big,
#hubbody button.primary,
#hubbody button.go,
#gacha button:not(.hub-close-x).big,
#boss-ui button:not(.hub-close-x).big,
#coop button:not(.hub-close-x).big,
#pvp-ui button:not(.hub-close-x).big,
#create button.big,
#overlay #panel button.big,
.hubmodal .box button.big,
#cloud-login button.cl-go {
  background: linear-gradient(180deg, #64cf96, #38a36d) !important;
  color: #ffffff !important;
  border: 2px solid #226644 !important;
  text-shadow: 0 1px 1px #195234 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 3px 0 #1d573a !important;
}

/* Danger buttons */
#hubbody button.danger,
#overlay #panel button.danger,
.hubmodal .box button.danger,
.hubmodal .qcbh-plaque.danger-plaque {
  background: linear-gradient(180deg, #e86258, #c4362e) !important;
  color: #ffffff !important;
  border-color: #7d1d18 !important;
}

/* Keep close X buttons clean */
.hub-close-x {
  background: linear-gradient(180deg, #d95a4c, #ad3429) !important;
  border: 2px solid #ffe08a !important;
  border-radius: 8px !important;
  color: #fff !important;
  width: 32px !important;
  height: 32px !important;
  position: relative;
}
.hub-close-x::before {
  content: '✕';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 900;
  color: #fff9e6;
}

/* Settings modal buttons inside .hubmodal */
.hubmodal .set-list .qcbh-plaque {
  background: linear-gradient(180deg, #f7e8c6, #e5cc96) !important;
  border: 2px solid #8a5e32 !important;
  color: #3d2210 !important;
}
.hubmodal .set-list .qp-txt {
  color: #3d2210 !important;
  text-shadow: none !important;
}
.hubmodal .set-list .danger-plaque .qp-txt {
  color: #fff !important;
}

/* Toasts on bright background */
#toasts .toast {
  background: linear-gradient(180deg, #5e3a22, #402615) !important;
  color: #fff8e2 !important;
  border: 2px solid var(--gold-rim) !important;
  box-shadow: 0 4px 12px rgba(24, 16, 10, 0.35) !important;
}

/* Responsive mobile portrait tuning for Sảnh Tông Môn */
@media (max-width: 720px) {
  .sect-topbar {
    top: 6px;
    left: 6px;
    right: 6px;
    padding: 5px 8px;
  }
  .sect-tuvi-bar {
    width: 118px;
  }
  .sect-plaque {
    padding: 4px 8px 4px 6px;
    gap: 5px;
  }
  .sect-plaque .sp-txt b {
    font-size: 11px;
  }
  .sect-plaque .sp-txt em {
    font-size: 9px;
  }
  .sect-plaque.primary {
    padding: 6px 11px;
  }
  .sect-quest-banner {
    bottom: 78px;
    padding: 8px 12px;
  }
  .sq-info b {
    font-size: 12.5px;
  }
  .sq-btn {
    padding: 7px 13px;
    font-size: 12.5px;
  }
  .sect-quick {
    top: 84px;
    left: 8px;
    gap: 8px;
  }
  .sect-wood-pill {
    padding: 5px 10px;
    font-size: 11.5px;
    min-width: 82px;
  }
}

/* Tạo Đạo Thân: rich dusk-jade pixel pedestal so Linh Khí aura, wings & Dị Tượng pop crisply */
#create #cprev {
  background: radial-gradient(circle at 50% 44%, #314d4c 0%, #1f343a 58%, #142228 100%) !important;
  border: 2.5px solid var(--wood-mid) !important;
  border-radius: 12px !important;
  box-shadow: inset 0 0 0 2px rgba(246, 214, 138, 0.35), 0 4px 12px rgba(24, 18, 12, 0.28) !important;
  image-rendering: pixelated;
}
#create #cname {
  background: #fffcf2 !important;
  color: var(--text) !important;
  border: 2px solid var(--wood-mid) !important;
  border-radius: 8px !important;
  font-weight: 700 !important;
  padding: 6px 10px !important;
  box-shadow: inset 0 1px 3px rgba(60, 38, 16, 0.14) !important;
}
#create #cname:focus {
  outline: none !important;
  border-color: #2f966a !important;
  box-shadow: 0 0 0 2px rgba(47, 150, 106, 0.25) !important;
}

/* ================================================================
 * MOBILE FULLSCREEN + MANDATORY LANDSCAPE LOCK & PHONE LANDSCAPE UI
 * ================================================================ */
html,
body {
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}
#game {
  touch-action: none;
}
#lobby,
#ui,
#hub,
#overlay,
#rotate-lock {
  -webkit-user-select: none;
  user-select: none;
}

/* Bright Xianxia Pixel Parchment Portrait Lock Overlay (#rotate-lock) */
#rotate-lock {
  z-index: 99999 !important;
  background: radial-gradient(circle at 50% 35%, rgba(124, 200, 244, 0.96), rgba(52, 102, 134, 0.98)) !important;
  backdrop-filter: blur(8px);
}
#rotate-lock .rl-box {
  background: linear-gradient(180deg, var(--cream), var(--cream2)) !important;
  border: 3px solid var(--wood-bot) !important;
  border-radius: 16px !important;
  box-shadow: inset 0 0 0 2px var(--gold-rim), 0 8px 0 rgba(56, 32, 16, 0.55), 0 18px 40px rgba(18, 28, 36, 0.45) !important;
  padding: 24px 22px 22px !important;
  color: var(--text) !important;
}
#rotate-lock .rl-seal {
  background: linear-gradient(180deg, #df9246, #b56526) !important;
  color: #fffdf5 !important;
  border: 1.5px solid #ffe48a !important;
  padding: 4px 14px !important;
  border-radius: 99px !important;
  font-weight: 800 !important;
  letter-spacing: 0.8px !important;
  text-shadow: 0 1px 1px #4c240c !important;
}
#rotate-lock .rl-phone {
  border-color: var(--wood-bot) !important;
  background: #fff9ea !important;
  box-shadow: 0 3px 0 rgba(62, 36, 18, 0.25) !important;
}
#rotate-lock .rl-screen {
  background: linear-gradient(180deg, #86cef2, #70c464) !important;
}
#rotate-lock .rl-dot {
  background: var(--wood-mid) !important;
}
#rotate-lock .rl-arrow {
  color: #c2681a !important;
  text-shadow: none !important;
}
#rotate-lock h2 {
  color: #4f2a10 !important;
  text-shadow: none !important;
  margin-top: 8px !important;
}
#rotate-lock .rl-sub {
  color: #5b3e26 !important;
  line-height: 1.5 !important;
}
#rotate-lock .rl-sub b {
  color: #8c3d16 !important;
}
#rotate-lock .rl-btn {
  background: linear-gradient(180deg, #64cf96, #38a36d) !important;
  color: #ffffff !important;
  border: 2px solid #226644 !important;
  border-radius: 10px !important;
  padding: 11px 20px !important;
  font-size: 14.5px !important;
  font-weight: 800 !important;
  text-shadow: 0 1px 1px #195234 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 3px 0 #1d573a !important;
}
#rotate-lock .rl-hint {
  color: #7a5c42 !important;
  font-size: 12px !important;
  line-height: 1.45 !important;
}
#rotate-lock .rl-hint.warn {
  color: #b53428 !important;
  font-weight: 700 !important;
}

/* Floating Fullscreen Pill (#fs-fab) on Mobile Landscape */
#fs-fab {
  position: fixed !important;
  top: 56px !important;
  right: max(10px, env(safe-area-inset-right)) !important;
  left: auto !important;
  transform: none !important;
  z-index: 9000 !important;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px !important;
  background: linear-gradient(180deg, #b87a46, #8d562c) !important;
  border: 2px solid #ffe48a !important;
  border-radius: 99px !important;
  color: #fffaf0 !important;
  font-size: 11.5px !important;
  font-weight: 800 !important;
  box-shadow: 0 3px 0 #4a2a16, 0 6px 14px rgba(24, 16, 10, 0.35) !important;
  cursor: pointer;
}
#fs-fab.in-run {
  top: 22px !important;
  right: max(46px, calc(env(safe-area-inset-right) + 40px)) !important;
  padding: 4px 8px !important;
  font-size: 11px !important;
}
#fs-fab.in-run span:last-child {
  display: none;
}
body:has(#overlay:not(.hidden)) #fs-fab,
body:has(#hub:not(.hidden)) #fs-fab,
body:has(#create:not(.hidden)) #fs-fab {
  display: none !important;
}

/* ================================================================
 * DEDICATED PHONE LANDSCAPE LAYOUT (e.g. 844x390, 800x360, 667x375)
 * ================================================================ */
@media (max-height: 520px) and (orientation: landscape) {
  /* Sảnh Tông Môn — ultra-slim single-row topbar (38px) & bottom dock (34px) leaving ~80% vertical space! */
  .sect-topbar {
    top: 4px !important;
    left: max(8px, env(safe-area-inset-left)) !important;
    right: max(8px, env(safe-area-inset-right)) !important;
    padding: 3px 10px !important;
    border-radius: 9px !important;
    gap: 8px !important;
  }
  .sect-ava-box {
    width: 28px !important;
    height: 28px !important;
    border-radius: 6px !important;
  }
  .sect-ava-box canvas {
    width: 26px !important;
    height: 26px !important;
  }
  .sect-prof-info {
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
  }
  .sect-prof-row b {
    font-size: 12px !important;
  }
  .sect-prof-realm {
    font-size: 10px !important;
  }
  .sect-tuvi-bar {
    width: 98px !important;
    height: 12px !important;
  }
  .sect-tuvi-bar em {
    font-size: 8.5px !important;
  }
  .sect-res-pill {
    padding: 2px 8px !important;
    font-size: 11.5px !important;
  }
  .sect-icon-btn {
    width: 26px !important;
    height: 26px !important;
    font-size: 12px !important;
  }
  .sect-quick {
    top: 48px !important;
    left: max(8px, env(safe-area-inset-left)) !important;
    gap: 6px !important;
  }
  #fs-fab:not(.in-run) {
    top: 48px !important;
    padding: 4px 10px !important;
    font-size: 11px !important;
  }
  .sect-wood-pill {
    padding: 4px 10px !important;
    min-width: 72px !important;
    font-size: 11px !important;
    border-radius: 7px !important;
  }
  .sect-plaque {
    padding: 2px 6px 2px 5px !important;
    gap: 4px !important;
    border-radius: 6px !important;
    border-width: 1.5px !important;
  }
  .sect-plaque .sp-ico {
    font-size: 12px !important;
  }
  .sect-plaque .sp-txt b {
    font-size: 10px !important;
  }
  .sect-plaque .sp-txt em {
    font-size: 8px !important;
  }
  .sect-plaque.primary {
    padding: 3px 9px 3px 7px !important;
  }
  .sect-plaque.primary .sp-txt b {
    font-size: 11px !important;
  }
  /* Hide redundant quest banner on ultra-short phone landscape so all 7 sect buildings stay 100% visible! */
  .sect-quest-banner {
    display: none !important;
  }
  .sect-bottom-nav {
    bottom: 4px !important;
    width: min(520px, calc(100vw - 24px)) !important;
    padding: 3px !important;
    gap: 4px !important;
    border-radius: 9px !important;
  }
  .snav-btn {
    flex-direction: row !important;
    gap: 5px !important;
    padding: 4px 6px !important;
    border-radius: 6px !important;
    white-space: nowrap !important;
  }
  .snav-btn span {
    font-size: 13px !important;
  }
  .snav-btn b {
    font-size: 10.5px !important;
  }

  /* Combat HUD + Touch Controls on Phone Landscape */
  #xpbar {
    height: 15px !important;
  }
  #xplabel {
    font-size: 10px !important;
    line-height: 15px !important;
  }
  #hudrow {
    padding: 3px max(44px, calc(env(safe-area-inset-right) + 38px)) 0 max(8px, env(safe-area-inset-left)) !important;
  }
  #timer {
    font-size: 13px !important;
    padding: 2px 10px !important;
  }
  #stats {
    font-size: 11px !important;
    padding: 2px 8px !important;
    height: 28px !important;
    margin-right: 0 !important;
  }
  #pausebtn {
    top: 19px !important;
    right: max(8px, env(safe-area-inset-right)) !important;
    width: 28px !important;
    height: 28px !important;
    font-size: 11px !important;
  }
  #skillbar {
    bottom: max(6px, env(safe-area-inset-bottom)) !important;
    gap: 6px !important;
  }
  #skillbar .sk,
  #pillbar .pl {
    width: 40px !important;
    height: 40px !important;
  }

  /* In-Run Level-Up ("Tăng cấp"): 3-column horizontal cards fit 100% inside 390px height! */
  #overlay #panel.lu-panel {
    width: min(760px, calc(100vw - 24px)) !important;
    max-width: 760px !important;
    padding: 10px 12px 9px !important;
    max-height: 94dvh !important;
    overflow-y: auto !important;
  }
  #overlay #panel.lu-panel .lu-title {
    font-size: 17px !important;
  }
  #overlay #panel.lu-panel .lu-sub {
    font-size: 11px !important;
    margin-bottom: 8px !important;
  }
  .lu-cards {
    display: grid !important;
    grid-auto-flow: column !important; /* one column per card (4 since 28/11/2026) */
    grid-auto-columns: minmax(0, 1fr) !important;
    gap: 8px !important;
  }
  #overlay #panel.lu-panel .card.lu-card {
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 8px 9px !important;
    gap: 6px !important;
  }
  .lu-kbd {
    display: none !important;
  }
  .lu-ico {
    width: 40px !important;
    height: 40px !important;
    margin-left: 0 !important;
    align-self: center !important;
  }
  .lu-head {
    justify-content: center;
    gap: 5px;
  }
  .lu-head h3 {
    font-size: 13px !important;
    text-align: center;
  }
  .lu-meta {
    justify-content: center;
    font-size: 10.5px;
  }
  .lu-desc {
    font-size: 11px !important;
    line-height: 1.3;
    text-align: center;
  }
  .lu-chips {
    justify-content: center;
    gap: 4px;
  }
  .lu-chip {
    font-size: 9.5px !important;
    padding: 1px 5px !important;
  }
  .lu-bonus {
    font-size: 10px !important;
    align-self: center !important;
  }
  .lu-actions {
    margin-top: 8px !important;
  }
  #overlay #panel.lu-panel button.lu-reroll {
    padding: 5px 14px !important;
    font-size: 12px !important;
  }

  /* Hub, Boss, Gacha & Tạo Đạo Thân modals on Phone Landscape */
  #hub .hub-win,
  #gacha .hub-win,
  #boss-ui .hub-win,
  #coop .hub-win,
  #pvp-ui .hub-win {
    width: min(96vw, 840px) !important;
    max-height: 94dvh !important;
  }
  #hub .hub-head,
  #gacha .hub-head,
  #boss-ui .hub-head,
  #coop .hub-head,
  #pvp-ui .hub-head {
    padding: 7px 12px !important;
  }
  #hub .hub-head h2 {
    font-size: 15px !important;
  }
  #hubbody {
    padding: 12px 14px 16px !important;
    -webkit-overflow-scrolling: touch;
  }
  #create .cbox {
    max-width: min(96vw, 820px) !important;
    max-height: 94dvh !important;
    padding: 12px 16px !important;
    gap: 14px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  #create #cprev {
    width: 176px !important;
    height: 196px !important;
  }
  #create .cform h1 {
    font-size: 18px !important;
    margin: 0 0 2px !important;
  }
  #create .csub {
    font-size: 11px !important;
    margin: 0 0 8px !important;
  }
  #create .crow {
    gap: 6px !important;
    margin-bottom: 6px !important;
  }
  #create button {
    padding: 4px 9px !important;
    font-size: 11.5px !important;
  }
  #create .cactions {
    margin-top: 8px !important;
  }
  #create .cactions button {
    padding: 7px 16px !important;
  }
}

/* ================================================================
 * CẦU ĐẠO (#gacha), TRẤN MA ĐÀI (#boss-ui), CO-OP (#coop), LUẬN ĐẠO (#pvp-ui)
 * style.css paints their insides for the old dark windows: near-black panels plus text in var(--text) / var(--muted) /
 * var(--gold2), which this theme turns dark brown, so text ended up dark-on-dark. Panels become parchment cards here
 * and the few hard-coded light text colours become theme browns. Kept dark on purpose: the boss preview stage and the
 * gacha image wells, so sprites and rarity glows still pop.
 * ================================================================ */
/* Tabs: the parchment buttons above already style them; drop the dark stone/gold images */
#pvp-ui .bs-tab,
#boss-ui .bs-tab,
#gacha .gc-tabs button {
  background: linear-gradient(180deg, #f7e9c6, #e5cd99) !important;
  color: #452814 !important;
  border: 2px solid #966a38 !important;
}
#pvp-ui .bs-tab.on,
#boss-ui .bs-tab.on,
#gacha .gc-tabs button.on {
  background: linear-gradient(180deg, #74492b, #52311b) !important;
  color: #fff8e2 !important;
  border-color: #e6bc5a !important;
}

/* Parchment cards */
.pv-card,
.pv-team,
.gc-info,
.gc-feat,
.gc-res,
.gc-pcard,
.gc-rates-box,
.bs-pick,
.bs-tip,
.bs-skills span,
.bs-tier,
.bs-foot-bar,
.bs-world-act,
.bs-rew,
.bs-hp-box,
.bs-ms,
.bs-board-wrap,
.bs-rk-tier,
.coop-panel,
.coop-open-wrap,
.coop-room-row,
.coop-room-head,
.coop-slot,
.coop-map-card,
.coop-actions {
  background: linear-gradient(180deg, #fffdf6, #f4e8cd) !important;
  border-color: #c9a366 !important;
  color: var(--text) !important;
  box-shadow: 0 2px 0 rgba(107, 67, 37, 0.18) !important;
}
/* keep the coloured accents that carry meaning (rarity, boss element, team side, selection) */
.gc-feat.r-SSR, .gc-res.r-SSR, .gc-pcard.r-SSR { border-color: #d9a520 !important; }
.gc-feat.r-SR, .gc-res.r-SR, .gc-pcard.r-SR { border-color: #a45ad6 !important; }
.gc-feat.r-R, .gc-res.r-R, .gc-pcard.r-R { border-color: #3d94cf !important; }
.bs-pick { border-left: 4px solid var(--bc, var(--gold)) !important; }
#boss-ui button.bs-pick.on:not(.hub-close-x),
#boss-ui button.bs-tier.on:not(.hub-close-x),
.coop-map-card.selected,
.bs-rk-tier.mine,
.bs-ms.ready {
  background: linear-gradient(180deg, #fff4d2, #f0d99c) !important;
  border-color: #c98f28 !important;
}
#boss-ui button.bs-pick.on:not(.hub-close-x) { border-left-color: var(--bc, var(--gold)) !important; color: var(--text) !important; }
#boss-ui button.bs-tier.on:not(.hub-close-x) { color: #3a1f0e !important; }
.pv-team.team-A { border-color: #1d8a64 !important; }
.pv-team.team-B { border-color: #d43832 !important; }
.bs-rew.gold { border-color: #d9a520 !important; color: #8a5a00 !important; }
.bs-rew.purple { border-color: #a45ad6 !important; color: #6b2f99 !important; }
.pv-mem,
.bs-el,
.cr-code {
  background: #fbf1d8 !important;
}

/* Inputs */
.pv-card input,
.pv-card select,
.pv-row input,
.coop-field select,
.coop-join-row input {
  background: #fffaf0 !important;
  color: var(--text) !important;
  border: 2px solid #b88a4a !important;
  border-radius: 6px !important;
}
.pv-card input::placeholder,
.pv-row input::placeholder,
.coop-join-row input::placeholder {
  color: #9a7a5c !important;
}
.pv-card select:disabled,
.pv-card input:disabled {
  background: #efe3c8 !important;
  color: #6f523a !important;
}

/* Buttons that carried their own dark look */
#pvp-ui .pv-btn,
#pvp-ui .pv-mini {
  background: linear-gradient(180deg, #f7e9c6, #e5cd99) !important;
  color: #452814 !important;
  border: 2px solid #966a38 !important;
  border-radius: 8px !important;
}
#pvp-ui .pv-btn.go,
#boss-ui button.bs-fight-btn:not(.hub-close-x),
#boss-ui button.bs-claim-rk:not(.hub-close-x),
#coop button.big {
  background: linear-gradient(180deg, #64cf96, #38a36d) !important;
  color: #fff !important;
  border: 2px solid #226644 !important;
  text-shadow: 0 1px 1px #195234 !important;
}
#coop button.big.secondary:not(.hub-close-x) {
  background: linear-gradient(180deg, #f7e9c6, #e5cd99) !important;
  color: #452814 !important;
  border-color: #966a38 !important;
  text-shadow: none !important;
}
#boss-ui button.bs-buy-btn:not(.hub-close-x) {
  background: linear-gradient(180deg, #f7e9c6, #e5cd99) !important;
  color: #6b3c0c !important;
  border: 2px solid #966a38 !important;
}
#coop button.danger:not(.hub-close-x),
#pvp-ui button.danger:not(.hub-close-x) {
  background: linear-gradient(180deg, #e86258, #c4362e) !important;
  color: #fff !important;
  border-color: #7d1d18 !important;
}
:is(#gacha, #boss-ui, #coop, #pvp-ui) button:not(.hub-close-x):disabled {
  opacity: 0.55;
  filter: grayscale(0.4);
}

/* Tables */
.pv-table th,
.bs-board th {
  background: #e9d3a3 !important;
  color: #4f2a10 !important;
  border-bottom: 2px solid #c9a366 !important;
}
.pv-table td,
.bs-board td {
  color: var(--text) !important;
  border-bottom: 1px solid rgba(160, 120, 60, 0.28) !important;
}
.pv-table tr.me td,
.bs-board tr.me td {
  background: rgba(29, 138, 100, 0.12) !important;
}
.bs-board .rk-bar {
  background: rgba(107, 67, 37, 0.15) !important;
}

/* Hard-coded light text -> theme browns */
.gc-sub,
.gc-pinfo p,
.gc-badge,
.bs-lore,
.bs-tier,
.bs-stat-line,
.bs-rew,
.bs-hp-head,
.bs-ms,
.bs-att-info span,
.bs-board .rk-sub,
.bs-rk-tier span,
.bs-pick-txt em,
.bs-tier span,
.bs-att-info em,
.bs-rk-wait,
.bs-empty,
.bs-tip {
  color: #6f523a !important;
}
.gc-feat b,
.gc-res b,
.bs-pick-txt b,
.bs-stat-line b,
.bs-tier.on span,
.bs-hp-head b,
.bs-ms span,
.bs-skills span {
  color: #3a1f0e !important;
}
.gc-stars {
  color: #c98f28 !important;
}
.pv-msg {
  background: #fde3de !important;
  color: #9c2a20 !important;
  border-color: #d97b6e !important;
}
.pv-ready { color: #c4362e !important; }
.pv-ready.on,
.gc-badge.new,
.gc-eqtag,
.cs-role.ready,
.cmc-status.ok,
.ca-status.ok,
.cs-link.connected { color: #1d8a64 !important; }
.cr-cnt,
.cms-rule { color: #156649 !important; }
.cr-warn,
.cmc-status.bad,
.cs-link.failed { color: #c4362e !important; }
.ca-status,
.cs-link.connecting { color: #9a6200 !important; }
.gc-res.r-SR .gc-rtag { color: #8a3fc0 !important; }
.gc-res.r-R .gc-rtag { color: #2a78b0 !important; }

/* In-run co-op panels over the battlefield: small parchment plates */
#coop-hud,
#coop-wait {
  background: rgba(252, 245, 227, 0.94) !important;
  border: 2px solid #b88a4a !important;
  color: var(--text) !important;
}
#coop-hud .st-ok { color: #1d8a64 !important; }
#coop-hud .st-dead { color: #c4362e !important; }
#coop-hud .st-left { color: #6f523a !important; }
#coop-hud .ch-bar { background: rgba(107, 67, 37, 0.18) !important; }

/* ================================================================
 * ĐẠO HỮU (#social-ui), WORLD CHAT DOCK (#chat-dock), PARTY INVITE POP-UP (.so-pop) — js/ui/social.js
 * ================================================================ */
#social-ui,
#sect-ui {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  background: rgba(28, 42, 46, 0.45);
  backdrop-filter: blur(4px);
  overflow: auto;
}
#social-ui.hidden,
#sect-ui.hidden,
#chat-dock.hidden {
  display: none;
}
#social-ui .hub-win,
#sect-ui .hub-win {
  max-width: 720px;
  width: 100%;
  max-height: 86vh;
  background: linear-gradient(180deg, var(--cream), var(--cream2)) !important;
  color: var(--text) !important;
  border: 3px solid var(--wood-bot) !important;
  border-radius: 14px !important;
  box-shadow: inset 0 0 0 2px var(--gold-rim), 0 8px 0 rgba(48, 28, 14, 0.55), 0 16px 40px rgba(20, 28, 26, 0.35) !important;
}
#social-ui .hub-head,
#sect-ui .hub-head {
  background: linear-gradient(180deg, var(--wood-top), var(--wood-bot)) !important;
  border-bottom: 2px solid var(--gold-rim) !important;
  border-radius: 10px 10px 0 0 !important;
  padding: 12px 18px !important;
  gap: 12px !important;
  display: flex;
  align-items: center;
}
#social-ui .hub-head h2,
#sect-ui .hub-head h2 {
  color: #fff9e8 !important;
  text-shadow: 0 1px 2px #261409 !important;
}
#social-ui .hub-seal,
#sect-ui .hub-seal {
  background: linear-gradient(180deg, #df9246, #b56526) !important;
  color: #fffdf5 !important;
  border: 1.5px solid #ffe48a !important;
}
.so-tabs {
  display: flex;
  gap: 8px;
  flex: 1;
}
.so-tabs button,
.so-btn {
  background: linear-gradient(180deg, #f7e9c6, #e5cd99);
  color: #452814;
  border: 2px solid #966a38;
  border-radius: 8px;
  font-weight: 700;
  padding: 6px 12px;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(78, 46, 22, 0.35);
  white-space: nowrap;
}
.so-tabs button.on {
  background: linear-gradient(180deg, #74492b, #52311b);
  color: #fff8e2;
  border-color: #e6bc5a;
}
.so-btn.go {
  background: linear-gradient(180deg, #64cf96, #38a36d);
  color: #fff;
  border-color: #226644;
  text-shadow: 0 1px 1px #195234;
}
.so-btn:hover,
.so-tabs button:hover {
  filter: brightness(1.06);
}
.so-badge {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #d43832;
  color: #fff;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  vertical-align: middle;
}
.so-body {
  padding: 16px 18px 20px;
  overflow-y: auto;
}
.so-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.so-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(180deg, #fffdf6, #f4e8cd);
  border: 2px solid #c9a366;
  border-radius: 10px;
}
.so-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #b9a68a;
  flex-shrink: 0;
}
.so-dot.on {
  background: #29b36f;
  box-shadow: 0 0 6px rgba(41, 179, 111, 0.7);
}
.so-who {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.so-who b {
  color: #3a1f0e;
}
.so-who em {
  color: #7a5a3c;
  font-size: 12px;
  font-style: normal;
}
.so-who small {
  color: #6f523a;
  font-size: 12px;
}
.so-empty,
.so-add p {
  color: #6f523a;
  line-height: 1.5;
}
.so-addrow {
  display: flex;
  gap: 8px;
  margin: 10px 0;
}
.so-addrow input {
  flex: 1;
  padding: 8px 10px;
  background: #fffaf0;
  color: var(--text);
  border: 2px solid #b88a4a;
  border-radius: 6px;
  font-size: 14px;
}
.so-me b {
  color: #4f2a10;
}
.so-msg {
  margin: 12px 0 0;
  padding: 8px 12px;
  background: #fff3c4;
  border: 1px solid #dfb44a;
  border-radius: 8px;
  color: #6b3c0c;
}
.sect-wood-pill .so-badge {
  margin-left: 4px;
}

/* World chat dock (lobby, bottom-right above town action bar) */
#chat-dock {
  position: fixed;
  left: auto;
  right: 12px;
  bottom: 60px;
  z-index: 21;
}
#chat-dock .cd-toggle {
  padding: 8px 14px;
  background: linear-gradient(180deg, #b87a46, #8d562c);
  border: 2px solid #4a2a16;
  border-radius: 10px;
  color: #fff9e8;
  font-weight: 800;
  text-shadow: 0 1px 1px #3b2010;
  box-shadow: inset 0 1px 0 rgba(255, 240, 200, 0.45), 0 3px 0 #3d2110;
  cursor: pointer;
}
#chat-dock.open {
  width: min(360px, calc(100vw - 24px));
  height: 300px;
  display: flex;
  flex-direction: column;
  background: rgba(252, 245, 227, 0.96);
  border: 3px solid var(--wood-bot);
  border-radius: 12px;
  box-shadow: inset 0 0 0 2px var(--gold-rim), 0 6px 18px rgba(20, 28, 26, 0.35);
  overflow: hidden;
}
#chat-dock .cd-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: linear-gradient(180deg, var(--wood-top), var(--wood-bot));
  color: #fff8e4;
}
#chat-dock .cd-min {
  background: none;
  border: none;
  color: #fff8e4;
  font-weight: 900;
  cursor: pointer;
  padding: 0 6px;
}
#chat-dock .cd-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 10px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
}
#chat-dock .cd-line {
  word-break: break-word;
}
#chat-dock .cd-time {
  color: #9a7a5c;
  font-size: 11px;
  margin-right: 5px;
}
#chat-dock .cd-name {
  background: none;
  border: none;
  padding: 0;
  color: #1f6fa8;
  font-weight: 800;
  cursor: pointer;
  font-size: inherit;
}
#chat-dock .cd-name:hover {
  text-decoration: underline;
}
#chat-dock .cd-me {
  color: #1d8a64;
}
#chat-dock .cd-realm {
  margin-left: 4px;
  color: #9a6200;
  font-size: 11px;
}
#chat-dock .cd-empty {
  color: #8a6d50;
  text-align: center;
  margin-top: 40px;
}
#chat-dock .cd-form {
  display: flex;
  gap: 6px;
  padding: 6px 8px 8px;
  border-top: 1px solid #d9bd85;
}
#chat-dock #cd-input {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  background: #fffaf0;
  color: var(--text);
  border: 2px solid #b88a4a;
  border-radius: 6px;
}

/* Friend's party invite pop-up */
.so-pop {
  position: fixed;
  top: 84px;
  right: 16px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 300px;
  padding: 12px 14px;
  background: linear-gradient(180deg, #fffdf6, #f4e8cd);
  border: 3px solid var(--wood-bot);
  border-radius: 12px;
  box-shadow: inset 0 0 0 2px var(--gold-rim), 0 8px 20px rgba(20, 28, 26, 0.35);
  color: var(--text);
}
.so-pop em {
  font-style: normal;
  font-weight: 800;
  color: #9a6200;
}
.so-pop span {
  display: flex;
  gap: 8px;
}

@media (max-height: 520px) {
  #chat-dock {
    bottom: 76px;
  }
  #chat-dock {
    bottom: 70px;
  }
  #chat-dock.open {
    /* phones in landscape are short: room to read beats keeping the pills visible; "—" folds it away */
    height: min(240px, calc(100dvh - 130px));
  }
  #social-ui .hub-win {
    max-height: 94dvh;
  }
}


/* ============================================================================
 * THANH VÂN TIÊN TRẤN — Playable Online Town Lobby
 * ============================================================================ */
#town-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 6;
  touch-action: none;
  image-rendering: pixelated;
}
#town-canvas.hidden {
  display: none !important;
}

/* In Town mode, hide static mountain plaques & bottom dock, keep top/bottom map open */
#lobby.town-mode {
  pointer-events: none;
}
#lobby.town-mode .sect-topbar {
  top: 8px;
  left: 10px;
  right: 10px;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
  pointer-events: none;
}
#lobby.town-mode .sect-profile {
  pointer-events: auto;
  gap: 7px;
  padding: 4px 9px 4px 5px;
  background: linear-gradient(180deg, rgba(139, 90, 52, 0.94), rgba(92, 55, 29, 0.94));
  border: 2px solid var(--gold-rim);
  border-radius: 10px;
  box-shadow: 0 3px 0 var(--wood-dark), 0 5px 12px rgba(0, 0, 0, 0.35);
}
#lobby.town-mode .sect-ava-box {
  width: 36px;
  height: 38px;
  border-radius: 7px;
}
#lobby.town-mode .sect-ava-box canvas {
  width: 36px;
  height: 38px;
}
#lobby.town-mode .sect-prof-row b {
  font-size: 13px;
}
#lobby.town-mode .sect-prof-realm {
  font-size: 10.5px;
  line-height: 1.1;
}
#lobby.town-mode .sect-tuvi-bar {
  width: 122px;
  height: 11px;
}
#lobby.town-mode .sect-tuvi-bar em {
  font-size: 8.5px;
  line-height: 10px;
}
#lobby.town-mode .sect-top-right {
  pointer-events: auto;
  gap: 5px;
  padding: 4px 6px;
  background: linear-gradient(180deg, rgba(139, 90, 52, 0.94), rgba(92, 55, 29, 0.94));
  border: 2px solid var(--gold-rim);
  border-radius: 10px;
  box-shadow: 0 3px 0 var(--wood-dark), 0 5px 12px rgba(0, 0, 0, 0.35);
}
#lobby.town-mode .sect-res-pill {
  padding: 3px 9px;
  font-size: 13px;
}
#lobby.town-mode .sect-res-pill img {
  width: 17px;
  height: 17px;
}
#lobby.town-mode .sect-icon-btn {
  width: 30px;
  height: 30px;
  font-size: 15px;
}

#lobby.town-mode .town-left-menu,
#lobby.town-mode .attr-remind-banner,
#lobby.town-mode .hubmodal {
  pointer-events: auto;
}
#lobby.town-mode #sect-overlay,
#lobby.town-mode .sect-quest-banner,
#lobby.town-mode .sect-bottom-nav {
  display: none !important;
}

/* Unified Compact Left-Side Vertical Menu in Town Mode (collapsible on both PC & mobile, grouped by tier) */
.town-left-menu {
  position: fixed;
  top: 72px;
  left: 10px;
  z-index: 20;
  width: 132px;
  max-height: calc(100vh - 88px);
  overflow-y: auto;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
  background: linear-gradient(180deg, rgba(114, 71, 40, 0.92), rgba(74, 44, 24, 0.94));
  border: 2px solid var(--gold-rim);
  border-radius: 10px;
  box-shadow: 0 4px 0 var(--wood-dark), 0 8px 18px rgba(0, 0, 0, 0.36);
}
.town-left-menu::-webkit-scrollbar {
  display: none;
}
.town-left-menu.collapsed {
  width: auto;
  max-height: none;
  overflow: visible;
}
.tlm-toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  width: 100%;
  height: 26px;
  padding: 0 8px;
  background: linear-gradient(180deg, #9a6034, #6c3e1d);
  border: 1.5px solid #f0c975;
  border-radius: 7px;
  color: #fff8e2;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(40, 20, 8, 0.78);
  transition: filter 0.12s;
}
.tlm-toggle:hover {
  filter: brightness(1.1);
}
.tlm-toggle b {
  flex: 1;
  text-align: left;
}
.tlm-toggle .tlm-caret {
  font-style: normal;
  font-size: 11px;
  opacity: 0.9;
}
.tlm-toggle .snav-dot {
  position: static;
  margin-right: 2px;
}
.tlm-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.town-left-menu.collapsed .tlm-grid {
  display: none;
}

/* Tier groups: distinct label, subtle tinted panel & left accent bar */
.tlm-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 4px;
  border-radius: 8px;
  border: 1px solid rgba(255, 224, 160, 0.25);
  border-left-width: 3px;
  background: rgba(34, 18, 10, 0.28);
}
.tlm-g-head {
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 0 3px 1px;
  line-height: 1.2;
  opacity: 0.95;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}
.tlm-g-list {
  display: flex;
  flex-direction: column;
  gap: 3.5px;
}

/* Tier 1: Chiến Đấu (Fiery Crimson-Orange) */
.tlm-g-combat {
  border-color: rgba(242, 154, 104, 0.45);
  border-left-color: #ff8c52;
  background: rgba(128, 36, 22, 0.24);
}
.tlm-g-combat .tlm-g-head {
  color: #ffd0a6;
}

/* Tier 2: Tu Luyện (Jade Emerald) */
.tlm-g-power {
  border-color: rgba(95, 214, 176, 0.45);
  border-left-color: #5ee6b8;
  background: rgba(18, 78, 62, 0.3);
}
.tlm-g-power .tlm-g-head {
  color: #9effdf;
}
.tlm-g-power .tlm-btn {
  background: linear-gradient(180deg, rgba(46, 128, 104, 0.94), rgba(28, 86, 68, 0.96));
  border-color: #72e0bc;
  color: #f2fff9;
}

/* Tier 3: Tài Nguyên (Imperial Amber-Gold) */
.tlm-g-trade {
  border-color: rgba(235, 192, 92, 0.45);
  border-left-color: #f2c45a;
  background: rgba(102, 66, 22, 0.26);
}
.tlm-g-trade .tlm-g-head {
  color: #ffe699;
}
.tlm-g-trade .tlm-btn {
  background: linear-gradient(180deg, rgba(164, 110, 56, 0.94), rgba(118, 74, 34, 0.96));
  border-color: #e4b556;
  color: #fff8e2;
}

/* Tier 4: Giao Lưu (Sky Azure) */
.tlm-g-social {
  border-color: rgba(126, 184, 245, 0.45);
  border-left-color: #7abaff;
  background: rgba(24, 54, 96, 0.3);
}
.tlm-g-social .tlm-g-head {
  color: #bfe0ff;
}
.tlm-g-social .tlm-btn {
  background: linear-gradient(180deg, rgba(64, 104, 152, 0.94), rgba(40, 70, 110, 0.96));
  border-color: #8cc2fa;
  color: #f2f8ff;
}

.tlm-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  height: 26px;
  flex: 0 0 auto;
  margin: 0;
  padding: 0 7px;
  box-sizing: border-box;
  background: linear-gradient(180deg, rgba(164, 108, 62, 0.92), rgba(122, 76, 40, 0.95));
  border: 1.5px solid #d9ab50;
  border-radius: 7px;
  color: #fff6dc;
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(48, 26, 12, 0.8);
  transition: transform 0.1s, filter 0.1s;
}
.tlm-btn:hover {
  filter: brightness(1.1);
  transform: translateX(2px);
}
.tlm-btn.primary {
  background: linear-gradient(180deg, #e08d38, #b55e1a);
  border-color: #ffe28a;
  color: #fffdf2;
}
.tlm-btn.tlm-combat {
  background: linear-gradient(180deg, #cf5646, #962f26);
  border-color: #ffb88c;
  color: #fffaf0;
}
.tlm-btn.tlm-boss {
  background: linear-gradient(180deg, #9c4a82, #6b2957);
  border-color: #f0a8e2;
  color: #fff8fc;
}
.tlm-btn span {
  font-size: 13px;
  line-height: 1;
  flex: 0 0 auto;
}
.tlm-btn b {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tlm-btn .snav-dot {
  position: absolute;
  top: 4px;
  right: 5px;
}
.tlm-sep {
  display: block;
  height: 1px;
  margin: 2px 4px;
  background: rgba(240, 200, 120, 0.35);
}

/* Floating Town HUD (Online counter top-right, Talk prompt bottom-center, Sit/Emote/Attack bottom-right) */
#town-hud {
  position: fixed;
  inset: 0;
  z-index: 19;
  pointer-events: none;
}
#town-hud.hidden {
  display: none !important;
}
.th-pill {
  position: fixed;
  top: 62px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(34, 24, 16, 0.84);
  border: 1.5px solid #d6a456;
  border-radius: 999px;
  color: #fff4d2;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
  pointer-events: auto;
}
.th-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9ca3af;
}
.th-dot.on {
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
}

.th-talk {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: linear-gradient(180deg, #fff6dc, #ecd8a6);
  border: 2px solid #7d4e24;
  border-radius: 999px;
  color: #361f10;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 4px 0 #5b3719, 0 8px 18px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  pointer-events: auto;
  animation: thPop 0.16s ease-out;
}
.th-talk kbd {
  padding: 1px 6px;
  background: #5b3719;
  color: #ffe8a6;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
}
@keyframes thPop {
  from { transform: translateX(-50%) scale(0.9); opacity: 0; }
  to { transform: translateX(-50%) scale(1); opacity: 1; }
}

.th-bar {
  position: fixed;
  right: 12px;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
}
.th-btn {
  padding: 7px 11px;
  background: linear-gradient(180deg, #8b5a34, #5e381d);
  border: 2px solid #e5bd6e;
  border-radius: 10px;
  color: #fff6dc;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 3px 0 #3a200f, 0 5px 12px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}
.th-btn:hover {
  filter: brightness(1.08);
}
.th-btn.on {
  background: linear-gradient(180deg, #4cc38a, #2c8a5e);
  border-color: #a6f7cf;
}

.th-emotes {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  display: flex;
  gap: 4px;
  padding: 6px;
  background: rgba(34, 22, 14, 0.94);
  border: 2px solid #e5bd6e;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}
.th-emotes button {
  width: 34px;
  height: 34px;
  font-size: 19px;
  background: rgba(255, 240, 200, 0.1);
  border: 1px solid rgba(255, 220, 150, 0.25);
  border-radius: 8px;
  cursor: pointer;
}
.th-emotes button:hover {
  background: rgba(255, 220, 140, 0.28);
  transform: scale(1.12);
}

/* Remote Player Interaction Popup Card */
#town-pcard {
  position: fixed;
  left: 50%;
  bottom: 138px;
  transform: translateX(-50%);
  z-index: 25;
  width: min(320px, calc(100vw - 24px));
  padding: 12px 14px;
  background: linear-gradient(180deg, #fff8e6, #eedcb5);
  border: 2px solid #7d4e24;
  border-radius: 14px;
  color: #341e0e;
  box-shadow: 0 5px 0 #573416, 0 12px 28px rgba(0, 0, 0, 0.45);
}
#town-pcard.hidden {
  display: none !important;
}
.tp-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.tp-head b {
  display: block;
  font-size: 15px;
  color: #3a1f0b;
}
.tp-head em {
  font-style: normal;
  font-size: 11.5px;
  color: #7c542e;
}
.tp-x {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid #a67848;
  background: rgba(120, 74, 34, 0.12);
  color: #4c2d14;
  font-weight: 800;
  cursor: pointer;
}
.tp-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 7px 9px;
  margin-bottom: 10px;
  background: rgba(120, 80, 38, 0.09);
  border-radius: 8px;
  font-size: 12px;
}
.tp-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tp-btn {
  flex: 1 1 44%;
  padding: 7px 10px;
  border-radius: 8px;
  border: 2px solid #7d4e24;
  background: linear-gradient(180deg, #f6e4bc, #dfbe82);
  color: #3a200e;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.tp-btn.go {
  background: linear-gradient(180deg, #5cc991, #389a67);
  border-color: #216341;
  color: #fff;
}

@media (max-width: 680px) {
  .town-left-menu { width: 102px; top: 58px; }
  .tlm-btn { padding: 4px 6px; font-size: 11px; }
  .th-pill { top: 58px; right: 8px; font-size: 10.5px; padding: 3px 8px; }
  .th-bar { right: 8px; bottom: 10px; }
  .th-btn { padding: 6px 9px; font-size: 12px; }
  .th-talk { bottom: 54px; font-size: 12px; }
}

/* ---------------------------------------------------------------- Thuộc tính (G.Attrs) & bảng chỉ số */
.attr-panel {
  margin-top: 22px;
  padding: 16px 18px;
  background: rgba(255, 250, 236, 0.6);
  border: 2px solid #d6b67c;
  border-radius: 12px;
}
#hubbody #attrbox .attr-panel {
  margin-top: 0;
}
#create .cattr { flex: 1 1 100%; }
#create .cattr .attr-panel { margin-top: 0; }
.attr-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.attr-head h3 { margin: 0; }
.attr-left { font-size: 14px; opacity: 0.8; }
.attr-left.has b { color: #c0392b; font-size: 17px; }
.attr-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px 22px; }
.attr-col h4 { margin: 0 0 6px; font-size: 14px; opacity: 0.75; }
.attr-row {
  display: grid;
  grid-template-columns: 84px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-bottom: 1px dashed rgba(150, 110, 50, 0.25);
  font-size: 14px;
}
.attr-row.school .attr-name { border-left: 5px solid var(--sc); padding-left: 7px; }
.attr-name { font-weight: 700; }
.attr-val em { color: #1e8a4c; font-style: normal; font-weight: 700; }
.attr-val i { font-style: normal; font-size: 12px; opacity: 0.7; }
.attr-ctl { display: inline-flex; align-items: center; gap: 3px; }
.attr-ctl button { min-width: 30px; padding: 2px 6px !important; font-size: 13px; }
.attr-ctl button:disabled { opacity: 0.35; }
.attr-n { min-width: 28px; text-align: center; }
.attr-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.attr-foot .note { flex: 1 1 100%; margin: 4px 0 0; }
.attr-panel > .note { margin: 10px 0 0; font-size: 13px; opacity: 0.8; }
.stat-sheet { margin: 6px auto 10px; max-width: 240px; font-size: 13px; text-align: left; }
.stat-sheet .ss-row { display: flex; gap: 6px; align-items: baseline; padding: 1px 0; }
.stat-sheet .ss-row span { min-width: 74px; opacity: 0.8; }
.stat-sheet .ss-row i { font-style: normal; font-size: 11px; color: #1e8a4c; }
.stat-sheet .ss-sub { font-size: 11px; opacity: 0.65; margin: -1px 0 2px 80px; }
.stat-sheet .ss-sch { margin-top: 4px; font-size: 12px; font-weight: 700; }
@media (max-width: 720px) {
  .attr-cols { grid-template-columns: 1fr; }
  .attr-row { grid-template-columns: 70px 1fr auto; font-size: 13px; }
}

/* ============================================================================
 * STYLE B GACHA SUB-TABS IN BRIGHT PARCHMENT THEME
 * ============================================================================ */
#gacha .gc-subtabs {
  background: rgba(139, 90, 52, 0.14);
  border-bottom: 1.5px solid #d9bd85;
}
#gacha .gc-subtabs button {
  background: linear-gradient(180deg, #fffaf0, #eedcb5) !important;
  color: #4f2a10 !important;
  border: 1.5px solid #b88a4a !important;
}
#gacha .gc-subtabs button.on {
  background: linear-gradient(180deg, #c95628, #8c2f18) !important;
  color: #fff9e8 !important;
  border-color: #f6c453 !important;
  box-shadow: 0 2px 6px rgba(140, 47, 24, 0.28) !important;
}
#gacha .gc-subseal {
  background: rgba(74, 42, 22, 0.14);
  color: #8c3d16;
}
#gacha .gc-subtabs button.on .gc-subseal {
  background: rgba(0, 0, 0, 0.28);
  color: #ffe28a;
}
.gc-feat.r-UR, .gc-res.r-UR, .gc-pcard.r-UR {
  border-color: #d94136 !important;
}

/* ============================================================================
 * MOBILE PHONE RESPONSIVE TUNING (Landscape <= 520px height or Narrow <= 720px)
 * Desktop PC stays 100% untouched.
 * ============================================================================ */
@media (hover: none) and (pointer: coarse) {
  .th-talk kbd {
    display: none;
  }
}

@media (max-height: 520px), (max-width: 720px) {
  /* 1. Town Mode Topbar: enforce slim single-row header aligned with left menu & chat dock */
  #lobby.town-mode .sect-topbar {
    top: 4px !important;
    left: max(6px, calc(env(safe-area-inset-left) * 0.45)) !important;
    right: max(8px, env(safe-area-inset-right)) !important;
    padding: 0 !important;
  }
  #lobby.town-mode .sect-profile {
    padding: 3px 8px 3px 4px;
    gap: 6px;
    border-radius: 8px;
  }
  #lobby.town-mode .sect-ava-box,
  #lobby.town-mode .sect-ava-box canvas {
    width: 28px;
    height: 30px;
  }
  #lobby.town-mode .sect-prof-row b {
    font-size: 11.5px;
  }
  #lobby.town-mode .sect-prof-realm {
    font-size: 9.5px;
  }
  #lobby.town-mode .sect-tuvi-bar {
    width: 96px;
    height: 10px;
  }
  #lobby.town-mode .sect-tuvi-bar em {
    font-size: 8px;
    line-height: 9px;
  }
  #lobby.town-mode .sect-top-right {
    padding: 3px 5px;
    gap: 4px;
    border-radius: 8px;
  }
  #lobby.town-mode .sect-res-pill {
    padding: 2px 7px;
    font-size: 11.5px;
  }
  #lobby.town-mode .sect-res-pill img {
    width: 14px;
    height: 14px;
  }
  #lobby.town-mode .sect-icon-btn {
    width: 26px;
    height: 26px;
    font-size: 13px;
  }

  /* 2. Town Left Menu: compact 2-column collapsible grid (clear of top profile bar & tucked closer to left edge) */
  .town-left-menu {
    top: 52px !important;
    left: max(6px, calc(env(safe-area-inset-left) * 0.45)) !important;
    width: 204px;
    max-height: calc(100dvh - 102px);
    padding: 4px;
    gap: 4px;
    border-radius: 9px;
  }
  .town-left-menu.collapsed {
    width: auto;
    max-height: none;
    overflow: visible;
  }
  .tlm-toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    width: 100%;
    height: 24px;
    padding: 0 7px;
    background: linear-gradient(180deg, #9a6034, #6c3e1d);
    border: 1.5px solid #f0c975;
    border-radius: 6px;
    color: #fff8e2;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 1px 0 rgba(40, 20, 8, 0.75);
  }
  .tlm-toggle b {
    flex: 1;
    text-align: left;
  }
  .tlm-toggle .tlm-caret {
    font-style: normal;
    font-size: 11px;
    opacity: 0.9;
  }
  .tlm-toggle .snav-dot {
    position: static;
    margin-right: 2px;
  }
  .tlm-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .tlm-group {
    padding: 3px;
    gap: 2px;
  }
  .tlm-g-head {
    font-size: 9px;
  }
  .tlm-g-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3px;
  }
  .town-left-menu.collapsed .tlm-grid {
    display: none;
  }
  .tlm-sep {
    grid-column: 1 / -1;
    margin: 1px 2px;
  }
  .tlm-btn {
    height: 24px;
    padding: 0 5px;
    gap: 4px;
    font-size: 10.5px;
    border-radius: 6px;
  }
  .tlm-btn span {
    font-size: 11.5px;
  }
  .tlm-btn .so-badge {
    font-size: 9px;
    min-width: 14px;
    height: 14px;
    line-height: 14px;
    padding: 0 3px;
  }

  /* 3. World Chat Dock: clean bottom-right anchor above town action bar (.th-bar) */
  #chat-dock {
    left: auto !important;
    right: max(8px, env(safe-area-inset-right)) !important;
    bottom: calc(max(10px, env(safe-area-inset-bottom)) + 36px);
    z-index: 21;
  }
  body:has(#lobby:not(.town-mode)) #chat-dock {
    bottom: 44px;
  }
  #chat-dock .cd-toggle {
    padding: 6px 11px;
    font-size: 12px;
    border-radius: 9px;
  }
  #chat-dock.open {
    z-index: 35;
    width: min(340px, calc(100vw - 16px));
    height: min(216px, calc(100dvh - 58px));
  }
  #chat-dock .cd-head {
    padding: 4px 8px;
    font-size: 12px;
  }
  #chat-dock .cd-list {
    padding: 5px 8px;
    font-size: 12px;
    line-height: 1.38;
  }
  #chat-dock .cd-form {
    padding: 4px 6px 6px;
    gap: 5px;
  }
  #chat-dock #cd-input {
    padding: 4px 7px;
    font-size: 12.5px;
  }

  /* 4. Online Counter (.th-pill) vs Fullscreen Button (#fs-fab): zero overlap */
  .th-pill {
    top: 52px;
    right: max(8px, env(safe-area-inset-right));
    font-size: 10px;
    padding: 3px 8px;
  }
  body:not(.is-fullscreen) #fs-fab:not(.hidden) ~ #town-hud .th-pill,
  body.is-mobile:not(.is-fullscreen) .th-pill {
    top: 80px;
  }
  #fs-fab:not(.in-run) {
    top: 50px !important;
    right: max(8px, env(safe-area-inset-right)) !important;
    padding: 4px 9px !important;
    font-size: 10.5px !important;
  }

  /* 5. Town Bottom Controls, Talk Prompt, Remote Player Card & Party Invite Popup */
  .th-bar {
    right: max(8px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
    gap: 5px;
  }
  .th-btn {
    padding: 5px 8px;
    font-size: 11.5px;
    border-radius: 8px;
  }
  .th-emotes button {
    width: 30px;
    height: 30px;
    font-size: 16px;
  }
  .th-talk {
    bottom: max(10px, env(safe-area-inset-bottom));
    padding: 6px 12px;
    font-size: 11.5px;
  }
  #town-pcard {
    bottom: 52px;
    padding: 9px 12px;
    width: min(300px, calc(100vw - 20px));
  }
  .so-pop {
    top: 46px;
    right: max(8px, env(safe-area-inset-right));
    max-width: min(260px, calc(100vw - 20px));
    padding: 9px 11px;
    font-size: 12px;
  }

  /* 6. Gacha Sub-Tabs, Social Window & Hub Modals on Short Phone Screens */
  #gacha .gc-subtabs {
    padding: 4px 10px;
    gap: 5px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  #gacha .gc-subtabs::-webkit-scrollbar {
    display: none;
  }
  #gacha .gc-subtabs button {
    padding: 4px 10px !important;
    font-size: 11.5px !important;
    white-space: nowrap;
    flex: 0 0 auto;
  }
  #social-ui .hub-win,
  #sect-ui .hub-win {
    width: min(96vw, 680px) !important;
    max-height: 94dvh !important;
  }
  #social-ui .so-body,
  #sect-ui .so-body {
    padding: 10px 12px 14px;
  }
  .hubmodal .box {
    padding: 12px 14px !important;
    max-height: 92dvh;
  }
}

/* ============================================================================
 * MAJOR REALM BREAKTHROUGH RITUAL (ĐỘ KIẾP TẤN THĂNG ĐẠI CẢNH GIỚI)
 * ============================================================================ */
body.bt-ritual-lock #lobby,
body.bt-ritual-lock #lobby *,
body.bt-ritual-lock #town-hud,
body.bt-ritual-lock #town-hud *,
body.bt-ritual-lock #chat-dock,
body.bt-ritual-lock #chat-dock * {
  pointer-events: none !important;
}
body.bt-ritual-lock .town-left-menu,
body.bt-ritual-lock .th-bar,
body.bt-ritual-lock .th-talk,
body.bt-ritual-lock #chat-dock {
  opacity: 0.35;
  transition: opacity 0.35s ease;
}

#town-bt-banner {
  position: fixed;
  top: 74px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  width: min(580px, calc(100vw - 24px));
  padding: 12px 20px 13px;
  border-radius: 14px;
  border: 2.5px solid #ffd875;
  background: linear-gradient(180deg, rgba(28, 18, 46, 0.92), rgba(14, 10, 28, 0.95));
  box-shadow: 0 0 28px rgba(155, 100, 255, 0.45), inset 0 0 0 1.5px rgba(255, 224, 148, 0.35), 0 8px 24px rgba(0, 0, 0, 0.5);
  color: #fff6dc;
  text-align: center;
  pointer-events: none;
  animation: btBannerIn 0.3s ease-out;
}
#town-bt-banner.hidden {
  display: none !important;
}
#town-bt-banner.mode-ok {
  border-color: #ffe28a;
  background: linear-gradient(180deg, rgba(72, 46, 14, 0.94), rgba(38, 22, 8, 0.96));
  box-shadow: 0 0 34px rgba(255, 210, 80, 0.6), inset 0 0 0 1.5px rgba(255, 240, 175, 0.55), 0 8px 24px rgba(0, 0, 0, 0.5);
}
#town-bt-banner.mode-fail {
  border-color: #ff6b6b;
  background: linear-gradient(180deg, rgba(58, 14, 24, 0.94), rgba(26, 8, 18, 0.96));
  box-shadow: 0 0 34px rgba(255, 70, 90, 0.55), inset 0 0 0 1.5px rgba(255, 140, 140, 0.45), 0 8px 24px rgba(0, 0, 0, 0.55);
}
#town-bt-banner .btb-tag {
  display: inline-block;
  padding: 2px 12px;
  margin-bottom: 5px;
  border-radius: 999px;
  background: rgba(255, 216, 117, 0.16);
  border: 1px solid rgba(255, 216, 117, 0.5);
  color: #ffe28a;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
}
#town-bt-banner.mode-fail .btb-tag {
  background: rgba(255, 90, 90, 0.2);
  border-color: rgba(255, 110, 110, 0.6);
  color: #ffb0b0;
}
#town-bt-banner .btb-msg {
  font-size: 15px;
  line-height: 1.4;
  font-weight: 600;
  text-shadow: 0 1px 2px #000;
}
#town-bt-banner .btb-msg b {
  color: #ffe484;
  font-weight: 900;
}
#town-bt-banner.mode-fail .btb-msg b {
  color: #ff9c9c;
}
#town-bt-banner .btb-bar {
  margin: 8px auto 0;
  height: 7px;
  max-width: 340px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255, 224, 148, 0.35);
}
#town-bt-banner .btb-bar i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #7be0ff, #ffe27a, #d896ff);
  box-shadow: 0 0 10px #ffe27a;
}
@keyframes btBannerIn {
  from { transform: translateX(-50%) translateY(-14px) scale(0.95); opacity: 0; }
  to { transform: translateX(-50%) translateY(0) scale(1); opacity: 1; }
}
@media (max-height: 520px), (max-width: 720px) {
  #town-bt-banner {
    top: 44px;
    padding: 7px 14px 8px;
    width: min(480px, calc(100vw - 20px));
  }
  #town-bt-banner .btb-tag {
    font-size: 9.5px;
    padding: 1px 9px;
    margin-bottom: 3px;
  }
  #town-bt-banner .btb-msg {
    font-size: 12.5px;
  }
  #town-bt-banner .btb-bar {
    margin-top: 5px;
    height: 5px;
  }
}

/* Town QR Noticeboard Modal */
.qr-modal .qr-box {
  max-width: min(420px, 92vw);
  text-align: center;
}
.qr-modal .qr-sub {
  margin: -4px 0 10px !important;
  font-size: 13px;
  font-weight: 700;
  color: #8c5318 !important;
}
.qr-modal .qr-frame {
  display: inline-flex;
  padding: 10px;
  background: #ffffff;
  border: 3px solid #7d4e24;
  border-radius: 12px;
  box-shadow: inset 0 0 0 2px #f0c975, 0 4px 12px rgba(40, 24, 10, 0.22);
}
.qr-modal .qr-img {
  display: block;
  width: min(210px, 46dvh);
  height: min(210px, 46dvh);
  image-rendering: pixelated;
}
.qr-modal .qr-desc {
  font-size: 13px;
  line-height: 1.45;
  margin: 10px 0 8px !important;
}
.qr-modal .qr-url {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11.5px;
  padding: 5px 10px;
  background: rgba(120, 80, 38, 0.1);
  border: 1px dashed #b88a4a;
  border-radius: 6px;
  color: #5b3719;
  word-break: break-all;
  margin-bottom: 12px;
}
.qr-modal .qr-acts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.qr-modal .qr-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 14px;
  border-radius: 8px;
  background: linear-gradient(180deg, #64cf96, #38a36d);
  border: 2px solid #226644;
  color: #ffffff !important;
  font-weight: 800;
  font-size: 13px;
  text-decoration: none;
  text-shadow: 0 1px 1px #195234;
  box-shadow: 0 2px 0 #1d573a;
}
.qr-modal .qr-link-btn:hover {
  filter: brightness(1.06);
}

/* ============================================================================
 * LUẬN ĐẠO ĐÀI (#pvp-ui) & TRẤN MA ĐÀI (#boss-ui) — Left Vertical Sidebar Navigation
 * ============================================================================ */
#pvp-ui .pv-layout,
#boss-ui .pv-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
#pvp-ui .pv-sidebar,
#boss-ui .pv-sidebar {
  width: 192px;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 10px;
  background: linear-gradient(180deg, rgba(168, 126, 74, 0.22), rgba(128, 86, 44, 0.28));
  border-right: 2px solid #cfa96a;
  box-shadow: inset -2px 0 6px rgba(90, 54, 22, 0.08);
}
#pvp-ui .pv-nav-btn,
#boss-ui .pv-nav-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px !important;
  text-align: left;
  background: linear-gradient(180deg, #fffdf6, #efe0bc) !important;
  color: #4a2a12 !important;
  border: 2px solid #b88a4a !important;
  border-radius: 10px !important;
  box-shadow: 0 2px 0 rgba(96, 58, 24, 0.22) !important;
  cursor: pointer;
  transition: transform 0.1s ease, filter 0.12s ease, box-shadow 0.12s ease;
}
#pvp-ui .pv-nav-btn:hover:not(.on),
#boss-ui .pv-nav-btn:hover:not(.on) {
  filter: brightness(1.04);
  transform: translateX(2px);
  border-color: #9e6b2c !important;
}
#pvp-ui .pv-nav-btn.on {
  background: linear-gradient(180deg, #c94e3a, #8e281d) !important;
  color: #fffaf0 !important;
  border-color: #ffd875 !important;
  border-left: 5px solid #ffe484 !important;
  box-shadow: inset 0 1px 0 rgba(255, 240, 195, 0.35), 0 4px 12px rgba(142, 40, 29, 0.35) !important;
}
#boss-ui .pv-nav-btn.on {
  background: linear-gradient(180deg, #9c4a82, #642250) !important;
  color: #fff8fc !important;
  border-color: #f4b6ea !important;
  border-left: 5px solid #ffe484 !important;
  box-shadow: inset 0 1px 0 rgba(255, 230, 250, 0.35), 0 4px 12px rgba(100, 34, 80, 0.38) !important;
}
#pvp-ui .pv-nav-ico,
#boss-ui .pv-nav-ico {
  font-size: 20px;
  line-height: 1;
  flex: 0 0 auto;
}
#pvp-ui .pv-nav-txt,
#boss-ui .pv-nav-txt {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
#pvp-ui .pv-nav-txt b,
#boss-ui .pv-nav-txt b {
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.15;
}
#pvp-ui .pv-nav-txt em,
#boss-ui .pv-nav-txt em {
  font-style: normal;
  font-size: 10.5px;
  opacity: 0.78;
  line-height: 1.2;
}
#pvp-ui .pv-nav-btn.on .pv-nav-txt em,
#boss-ui .pv-nav-btn.on .pv-nav-txt em {
  color: #ffe7a8;
  opacity: 0.95;
}
#boss-ui .pv-nav-btn .bs-dot {
  position: absolute;
  top: 7px;
  right: 7px;
}
#pvp-ui .pv-body,
#boss-ui .bs-body {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
}
@media (max-height: 520px), (max-width: 720px) {
  #pvp-ui .pv-sidebar,
  #boss-ui .pv-sidebar {
    width: 146px;
    padding: 8px 7px;
    gap: 6px;
  }
  #pvp-ui .pv-nav-btn,
  #boss-ui .pv-nav-btn {
    padding: 8px 8px !important;
    gap: 7px;
  }
  #pvp-ui .pv-nav-ico,
  #boss-ui .pv-nav-ico {
    font-size: 16px;
  }
  #pvp-ui .pv-nav-txt b,
  #boss-ui .pv-nav-txt b {
    font-size: 12px;
  }
  #pvp-ui .pv-nav-txt em,
  #boss-ui .pv-nav-txt em {
    font-size: 9.5px;
  }
}

/* Unspent Attribute Points Center Reminder Banner */
.attr-remind-banner {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 22;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 24px);
  padding: 8px 12px 8px 14px;
  background: linear-gradient(180deg, #fffdf4, #f4e2b8);
  border: 2.5px solid #c98624;
  border-radius: 999px;
  color: #3d210d;
  font-size: 13.5px;
  font-weight: 700;
  box-shadow: inset 0 0 0 1.5px rgba(255, 248, 220, 0.8), 0 4px 0 #6e4219, 0 8px 22px rgba(20, 14, 6, 0.36);
  animation: arbPulse 2.4s ease-in-out infinite;
}
.attr-remind-banner .arb-ico {
  font-size: 16px;
  line-height: 1;
}
.attr-remind-banner .arb-txt b {
  color: #c83226;
  font-size: 15px;
  font-weight: 900;
}
.attr-remind-banner .arb-go {
  padding: 5px 13px;
  border-radius: 999px;
  border: 2px solid #226644;
  background: linear-gradient(180deg, #64cf96, #38a36d);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  text-shadow: 0 1px 1px #195234;
  box-shadow: 0 2px 0 #1d573a;
}
.attr-remind-banner .arb-go:hover {
  filter: brightness(1.08);
}
.attr-remind-banner .arb-x {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(125, 78, 36, 0.45);
  background: rgba(125, 78, 36, 0.12);
  color: #5b3719;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  line-height: 1;
}
@keyframes arbPulse {
  0%, 100% { box-shadow: inset 0 0 0 1.5px rgba(255, 248, 220, 0.8), 0 4px 0 #6e4219, 0 6px 18px rgba(201, 134, 36, 0.32); }
  50% { box-shadow: inset 0 0 0 1.5px rgba(255, 248, 220, 0.95), 0 4px 0 #6e4219, 0 6px 26px rgba(255, 190, 60, 0.62); }
}
@media (max-height: 520px), (max-width: 720px) {
  .attr-remind-banner {
    top: 44px;
    padding: 4px 8px 4px 10px;
    gap: 6px;
    font-size: 11.5px;
  }
  .attr-remind-banner .arb-txt b {
    font-size: 12.5px;
  }
  .attr-remind-banner .arb-go {
    padding: 3px 10px;
    font-size: 11px;
  }
  .attr-remind-banner .arb-x {
    width: 20px;
    height: 20px;
    font-size: 10.5px;
  }
}

/* exclusive vo ky line on gacha character cards (G.Skills.heroSkill) */
.gc-hs { margin: 4px 0 0; padding: 4px 6px; border-left: 4px solid var(--sc); background: rgba(255, 250, 236, 0.55); border-radius: 4px; font-size: 12px; line-height: 1.35; }
.gc-hs b { font-weight: 700; }
.gc-hs i { font-style: normal; color: #1e8a4c; font-weight: 700; }
.gc-hs span { opacity: 0.8; }

/* nội tại chips (G.Attrs.traitHtml): gacha cards, character creator, Động Phủ */
.trait-list { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.trait { padding: 1px 6px; border-radius: 4px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.trait.pos { background: rgba(30, 138, 76, 0.14); color: #1e7a44; }
.trait.neg { background: rgba(192, 57, 43, 0.14); color: #b03020; }
.trait.none { font-weight: 400; opacity: 0.7; white-space: normal; }
.gc-tr { margin: 4px 0 0; font-size: 12px; }
.stat-sheet .ss-trait { margin-top: 6px; font-size: 12px; }
.stat-sheet .ss-trait em { display: block; font-style: normal; opacity: 0.7; margin-bottom: 2px; }
.stat-sheet .ss-row i.neg { color: #b03020; }
#create .ctrait { flex-wrap: wrap; align-items: center; }
#create .ctrait-hs { flex-basis: 100%; font-style: normal; font-size: 12px; opacity: 0.85; }

/* ================================================================
 * Tàng Kinh Các · Công Pháp: compact filter bar + skill detail modal (G.Hub tabCp / skillDetail)
 * ================================================================ */
#hubbody .cpbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  top: -2px;
  z-index: 2;
  margin: 0 -4px;
  padding: 4px 4px 8px;
  background: linear-gradient(180deg, #fbf3e1 85%, rgba(251, 243, 225, 0));
}
#hubbody .cphead {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
#hubbody .cphead h4 {
  margin: 0 auto 0 0 !important;
}
#hubbody .cps-sel {
  position: relative;
  display: inline-flex;
  align-items: center;
}
#hubbody .cps-sel i {
  position: absolute;
  left: 9px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--sc);
  box-shadow: 0 0 0 1px rgba(79, 42, 16, 0.35);
  pointer-events: none;
}
#hubbody .cps-sel select {
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: #4f2a10;
  padding: 4px 10px 4px 24px;
  border-radius: 8px;
  border: 2px solid #c9a366;
  background: linear-gradient(180deg, #fffdf6, #f1e2c2);
  cursor: pointer;
}
#hubbody .cphead .cp-opt {
  margin: 0 !important;
  font-size: 13px;
  white-space: nowrap;
}
#hubbody .cpf.cpf-slot {
  flex-wrap: wrap !important;
  overflow-x: visible;
  gap: 5px !important;
  margin: 0 !important;
}
#hubbody .cpf.cpf-slot button {
  flex: 0 0 auto;
  padding: 4px 9px !important;
  font-size: 12.5px !important;
  white-space: nowrap;
}
#hubbody .skill[data-cpd] {
  cursor: pointer;
}
#hubbody .skill[data-cpd]:hover {
  border-color: #b5823c !important;
}
#hubbody .skill .cp-acts {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  flex: 0 0 116px;
}
#hubbody .skill .cp-acts button {
  min-width: 0 !important;
  width: 100%;
}
#hubbody .skill .cp-acts .cp-more {
  padding: 4px 10px !important;
  font-size: 12px !important;
}
#hubbody .cp-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
#hubbody .cp-facts span,
.cpd .cpd-chips > span {
  font-size: 12px;
  padding: 1px 7px;
  border-radius: 6px;
  background: rgba(201, 163, 102, 0.18);
  border: 1px solid rgba(201, 163, 102, 0.55);
  color: #5c3c1c;
  white-space: nowrap;
}
#hubbody .cp-facts b,
.cpd .cpd-chips b {
  color: #7c3a0c;
}

/* detail modal */
.hubmodal .box.cpd {
  max-width: 640px;
  width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  text-align: left;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}
.cpd .cpd-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cpd .cpd-head img {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  flex-shrink: 0;
}
.cpd .cpd-head h2 {
  margin: 0 !important;
  font-size: 20px;
}
.cpd .cpd-head .kind {
  margin: 2px 0 0 !important;
  font-size: 13px;
}
.hubmodal .box.cpd h4 {
  margin: 14px 0 6px !important;
  color: #4f2a10 !important;
  text-shadow: none !important;
  font-size: 15px;
}
.cpd h4 em,
.cpd .cpd-note,
.cpd .cpd-extra {
  font-style: normal;
  font-weight: 400;
  font-size: 12px;
  color: #7a5a3a !important;
}
.cpd .cpd-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 4px 0;
}
.cpd .grade-prog {
  max-width: 100%;
}
.cpd .grade-head {
  color: #5c4b37;
}
.cpd .grade-head b {
  color: #7c4d12;
}
.cpd .grade-bar {
  background: rgba(120, 96, 66, 0.16);
  border-color: rgba(160, 124, 72, 0.38);
}
.cpd i.grade,
.over-modal .ovc i.grade {
  font-style: normal;
  font-size: 12px;
  font-weight: bold;
  padding: 1px 7px;
  border-radius: 4px;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.cpd i.g0, .over-modal .ovc i.g0 { color: #5b6978; background: rgba(91, 105, 120, 0.12); }
.cpd i.g1, .over-modal .ovc i.g1 { color: #1673b8; background: rgba(22, 115, 184, 0.12); }
.cpd i.g2, .over-modal .ovc i.g2 { color: #8c34b8; background: rgba(140, 52, 184, 0.12); }
.cpd i.g3, .over-modal .ovc i.g3 { color: #a86b00; background: rgba(255, 224, 120, 0.4); border-color: #d4961a; }
.cpd table.cpd-grades {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.cpd table.cpd-grades td {
  padding: 5px 6px;
  border-bottom: 1px dashed rgba(160, 124, 72, 0.35);
  vertical-align: middle;
}
.cpd table.cpd-grades td:nth-child(2) {
  white-space: nowrap;
  color: #7c4d12;
  font-weight: 700;
}
.cpd table.cpd-grades tr.on td {
  background: rgba(255, 214, 102, 0.28);
}
.cpd table.cpd-grades tr.past td {
  opacity: 0.6;
}
.cpd table.cpd-grades td i:not(.grade) {
  font-style: normal;
  font-size: 11px;
  color: #7a5a3a;
}
.cpd .cpd-need {
  display: block;
  margin-top: 2px;
  color: #b0521a !important;
}
.cpd ol.cpd-lv {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cpd ol.cpd-lv li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 253, 246, 0.7);
  border: 1px solid rgba(201, 163, 102, 0.5);
}
.cpd .cpd-lvn {
  color: #4f2a10;
  font-size: 13px;
}
.cpd .cpd-lvd {
  font-size: 13px;
  color: #4a311e;
  flex: 1 1 160px;
}
.cpd ol.cpd-lv .cpd-chips {
  flex-basis: 100%;
  margin: 0;
}
.cpd .cpd-gain {
  font-size: 12px;
  font-weight: 700;
  color: #9a5a00;
  padding: 1px 8px;
  border-radius: 6px;
  background: rgba(255, 214, 102, 0.35);
  border: 1px solid #e0b040;
}
.cpd .modal-acts {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}

@media (max-width: 720px), (max-height: 520px) {
  #hubbody .cphead h4 {
    display: none;
  }
  #hubbody .cpf.cpf-slot button {
    padding: 4px 8px !important;
    font-size: 12px !important;
  }
  #hubbody .skill {
    flex-wrap: wrap;
    gap: 10px !important;
    padding: 11px 12px !important;
  }
  #hubbody .skill > img {
    width: 40px;
    height: 40px;
    align-self: flex-start;
  }
  #hubbody .skill > div {
    flex: 1 1 0;
  }
  #hubbody .skill .cp-acts {
    flex-direction: row;
    flex: 1 1 100%;
  }
  #hubbody .skill .cp-acts > * {
    flex: 1 1 0;
    text-align: center;
  }
  #hubbody .skill .grade-prog {
    max-width: 100%;
  }
  .cpd table.cpd-grades td i:not(.grade) {
    display: none;
  }
  .hubmodal .box.cpd {
    padding: 14px 14px !important;
  }
  .cpd .cpd-head img {
    width: 42px;
    height: 42px;
  }
  .cpd .cpd-head h2 {
    font-size: 17px;
  }
}

/* ================================================================
 * REDESIGNED BÍ CẢNH MAP SELECT (.win-map): Compact Visual Cards
 * ================================================================ */
#hub .hub-win.win-map {
  max-width: min(1040px, calc(100vw - 24px)) !important;
}
#hub .win-map #hubbody {
  padding: 10px 14px 12px !important;
}

#hub .win-map .maps {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 10px !important;
  margin-bottom: 0 !important;
}
#hub .win-map .mapcard {
  display: flex !important;
  flex-direction: column !important;
  padding: 0 !important;
  gap: 0 !important;
  border-radius: 11px !important;
  overflow: hidden !important;
  background: #182024 !important;
  border: 2.5px solid #6ec96a !important;
  box-shadow: 0 4px 14px rgba(34, 22, 10, 0.28) !important;
  transition: transform 0.14s ease, box-shadow 0.14s ease !important;
}
#hub .win-map .mapcard:not(.locked):hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 8px 20px rgba(34, 22, 10, 0.38) !important;
}
#hub .win-map .mapcard.theme-grass { border-color: #6bc45c !important; --mc-accent: #8cf07a; --mc-btn: #5fa84e; --mc-btn-b: #9be889; }
#hub .win-map .mapcard.theme-jade  { border-color: #36baa0 !important; --mc-accent: #68f0d4; --mc-btn: #2d8f7e; --mc-btn-b: #74edd6; }
#hub .win-map .mapcard.theme-earth { border-color: #e29d44 !important; --mc-accent: #ffc966; --mc-btn: #bd7a2c; --mc-btn-b: #ffd47d; }
#hub .win-map .mapcard.theme-snow  { border-color: #7ab4e6 !important; --mc-accent: #a6d8ff; --mc-btn: #4f7ea8; --mc-btn-b: #b4e0ff; }
#hub .win-map .mapcard.theme-lava  { border-color: #e86234 !important; --mc-accent: #ff9460; --mc-btn: #b84220; --mc-btn-b: #ff9d6b; }
#hub .win-map .mapcard.theme-metal { border-color: #e6c456 !important; --mc-accent: #ffe688; --mc-btn: #ad8d28; --mc-btn-b: #fff0a0; }
#hub .win-map .mapcard.theme-abyss { border-color: #a864e8 !important; --mc-accent: #d496ff; --mc-btn: #763cb0; --mc-btn-b: #dca4ff; }
#hub .win-map .mapcard.theme-void  { border-color: #4ad8e8 !important; --mc-accent: #80ffff; --mc-btn: #288ea6; --mc-btn-b: #98ffff; }
#hub .win-map .mapcard.locked {
  border-color: #5d646b !important;
  filter: grayscale(0.25);
}

#hub .win-map .mc-hero {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9.2;
  overflow: hidden;
  background: #10161a;
}
#hub .win-map .mc-stage {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}
#hub .win-map .mc-realm,
#hub .win-map .mc-clear {
  position: absolute;
  top: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(12, 16, 22, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  text-shadow: 0 1px 2px #000;
  pointer-events: none;
}
#hub .win-map .mc-realm {
  left: 6px;
  color: var(--rc, #e8f2ec) !important;
  border-color: color-mix(in srgb, var(--rc, #fff) 55%, transparent);
}
#hub .win-map .mc-clear {
  right: 6px;
  color: #ffe07d !important;
  border-color: rgba(255, 224, 125, 0.5);
}
#hub .win-map .mc-clear.mc-lock {
  color: #cfd8e3 !important;
  border-color: rgba(200, 210, 220, 0.35);
}

#hub .win-map .mc-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 7px 8px 8px;
  background: linear-gradient(180deg, #1d252a 0%, #13191d 100%);
  text-align: center;
  flex: 1;
}
#hub .win-map .mc-name {
  margin: 0 !important;
  font-size: 14.5px !important;
  font-weight: 800 !important;
  color: var(--mc-accent, #f6df9e) !important;
  letter-spacing: 0.2px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75) !important;
  line-height: 1.15;
}
#hub .win-map .mapcard.locked .mc-name {
  color: #b0bcc6 !important;
}
#hub .win-map .mc-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
}
#hub .win-map .mc-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 11px;
  line-height: 1.2;
  color: #d6e2ea !important;
  white-space: nowrap;
}
#hub .win-map .mc-pill b {
  color: #ffe28a !important;
  font-weight: 800;
}
#hub .win-map .mc-pill img {
  width: 13px;
  height: 13px;
  object-fit: contain;
  image-rendering: pixelated;
  background: none !important;
  border: none !important;
}
#hub .win-map .mc-pill.mc-boss {
  color: #ffb8a8 !important;
  cursor: help;
}
#hub .win-map .mc-pill.mc-boss b {
  color: #ffd0c4 !important;
}
#hub .win-map .mc-pill.mc-online {
  color: #9aa8b2 !important;
}
/* ⚔ PK (base map) / 🌾 Thuần Farm (twin, js/data/maps.js FARM) */
#hub .win-map .mc-pill.mc-mode {
  cursor: help;
}
#hub .win-map .mc-pill.mc-mode.pk {
  border-color: rgba(255, 106, 74, 0.45);
  background: rgba(255, 106, 74, 0.12);
}
#hub .win-map .mc-pill.mc-mode.pk b {
  color: #ff9a80 !important;
}
#hub .win-map .mc-pill.mc-mode.farm {
  border-color: rgba(150, 230, 120, 0.45);
  background: rgba(150, 230, 120, 0.12);
}
#hub .win-map .mc-pill.mc-mode.farm b {
  color: #b8f59a !important;
}
#hub .win-map .mc-pill.mc-online.has {
  color: #7ff0a0 !important;
  border-color: rgba(127, 240, 160, 0.4);
  background: rgba(127, 240, 160, 0.1);
  font-weight: 700;
}
#hub .win-map .mc-go {
  margin-top: auto !important;
  width: 100%;
  padding: 5px 8px !important;
  min-height: 0 !important;
  border-radius: 7px !important;
  font-size: 12.5px !important;
  font-weight: 800 !important;
  background: linear-gradient(180deg, var(--mc-btn, #4a8f46), color-mix(in srgb, var(--mc-btn, #4a8f46) 72%, #000)) !important;
  border: 1.5px solid var(--mc-btn-b, #8de080) !important;
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65) !important;
  cursor: pointer;
}
#hub .win-map .mc-go:disabled {
  background: #2b3238 !important;
  border-color: #4d565e !important;
  color: #9aa6b0 !important;
  cursor: not-allowed;
}

@media (max-width: 820px) {
  #hub .win-map .maps {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }
}
@media (max-height: 520px) and (min-width: 560px) {
  /* Phone landscape: keep 4 compact cards side by side so zero vertical scroll is needed */
  #hub .win-map #hubbody {
    padding: 6px 10px 8px !important;
  }
  #hub .win-map .maps {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 7px !important;
  }
  #hub .win-map .mc-hero {
    aspect-ratio: 16 / 8;
  }
  #hub .win-map .mc-realm,
  #hub .win-map .mc-clear {
    top: 4px;
    padding: 1px 6px;
    font-size: 9.5px;
  }
  #hub .win-map .mc-body {
    padding: 4px 5px 5px;
    gap: 3px;
  }
  #hub .win-map .mc-name {
    font-size: 12px !important;
  }
  #hub .win-map .mc-pill {
    font-size: 9.5px;
    padding: 1px 4px;
    gap: 2px;
  }
  #hub .win-map .mc-pill img {
    width: 11px;
    height: 11px;
  }
  #hub .win-map .mc-go {
    padding: 3px 6px !important;
    font-size: 11px !important;
  }
}

/* Công Pháp: Badge row (Phẩm cấp + Cảnh giới) cleanly on its own line below title */
.cp-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 3px 0 4px;
}
.cp-badges .grade,
.cp-badges .cp-realm {
  margin: 0 !important;
  white-space: nowrap;
}
.cp-realm {
  display: inline-block;
  vertical-align: middle;
  font-style: normal;
  font-size: 11.5px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 5px;
  border: 1px solid #96a89e;
  background: #edf3ef;
  color: #3a5246;
  line-height: 1.35;
}
.cp-realm.r0 { background: #edf3ef; border-color: #9bb0a5; color: #395246; }
.cp-realm.r1 { background: #e1f7ed; border-color: #48b88a; color: #166b49; }
.cp-realm.r2 { background: #e2f2ff; border-color: #52a4e0; color: #175c8f; }
.cp-realm.r3 { background: #fff4d6; border-color: #d9a036; color: #8c590a; }
.cp-realm.r4 { background: #ffece0; border-color: #de7d3c; color: #964112; }
.cp-realm.r5 { background: #f3e8ff; border-color: #a86ce0; color: #642b9c; }
.cp-realm.r-hero { background: #f6ebff; border-color: #b474e6; color: #6b2aa6; }

/* Công Pháp left panel: stack slot title on top so equipped cards get full width below */
#hubbody .cpslots {
  gap: 10px !important;
  padding: 14px 16px !important;
}
#hubbody .cpslots .slotrow {
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 6px !important;
  padding: 6px 0 10px !important;
}
#hubbody .cpslots .slotrow h4 {
  width: auto !important;
  padding: 0 2px !important;
  margin: 0 !important;
  font-size: 13.5px;
  font-weight: 800;
  color: #5c381f;
}
#hubbody .cpslots .cells {
  width: 100% !important;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)) !important;
  gap: 7px !important;
}

/* Gacha 5-tier high-contrast rarity pills & cards (Hạ / Trung / Thượng / Tiên / Thần Phẩm) */
.gc-rpill {
  display: inline-block;
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 5px;
  border: 1px solid;
  line-height: 1.35;
  vertical-align: middle;
}
.gc-rpill.r-N, .gc-res.r-N .gc-rtag, .gc-feat.r-N .gc-rar {
  background: #eae6dc !important;
  border-color: #9e9789 !important;
  color: #4f4a42 !important;
}
.gc-rpill.r-R, .gc-res.r-R .gc-rtag, .gc-feat.r-R .gc-rar {
  background: #e1f1ff !important;
  border-color: #4ea0de !important;
  color: #135f9e !important;
}
.gc-rpill.r-SR, .gc-res.r-SR .gc-rtag, .gc-feat.r-SR .gc-rar {
  background: #f2e4ff !important;
  border-color: #ad6be6 !important;
  color: #7023b0 !important;
}
.gc-rpill.r-SSR, .gc-res.r-SSR .gc-rtag, .gc-feat.r-SSR .gc-rar {
  background: #fff2c8 !important;
  border-color: #de9e22 !important;
  color: #945605 !important;
}
.gc-rpill.r-UR, .gc-res.r-UR .gc-rtag, .gc-feat.r-UR .gc-rar {
  background: linear-gradient(180deg, #ffe0e0, #ffbaba) !important;
  border-color: #de3838 !important;
  color: #9e1111 !important;
  box-shadow: 0 0 6px rgba(226, 56, 56, 0.3);
}
.gc-res .gc-rtag {
  border: 1px solid;
  border-radius: 5px;
  padding: 1px 7px !important;
  font-weight: 800;
}
.gc-res.r-N, .gc-pcard.r-N, .gc-feat.r-N {
  border-color: #a69f92 !important;
  background: #f7f2e4 !important;
}
.gc-res.r-R, .gc-pcard.r-R, .gc-feat.r-R {
  border-color: #4ea0de !important;
}
.gc-res.r-SR, .gc-pcard.r-SR, .gc-feat.r-SR {
  border-color: #ad6be6 !important;
}
.gc-res.r-SSR, .gc-pcard.r-SSR, .gc-feat.r-SSR {
  border-color: #de9e22 !important;
}
.gc-res.r-UR, .gc-pcard.r-UR, .gc-feat.r-UR {
  border-color: #de3838 !important;
  box-shadow: 0 2px 10px rgba(222, 56, 56, 0.18) !important;
}

/* Công Pháp grade 4: Thần phẩm (crimson-gold badge & progress bar) */
#hubbody .skill i.g4,
.cpd i.g4,
.over-modal .ovc i.g4 {
  background: linear-gradient(180deg, #ffe3e3, #ffbaba) !important;
  border-color: #d93838 !important;
  color: #8f1111 !important;
  box-shadow: 0 0 6px rgba(235, 64, 64, 0.35);
}
.grade-prog.g4 .grade-bar > i,
.grade-prog.g4.max .grade-bar > i {
  background: linear-gradient(90deg, #d62828, #ff6b6b, #ffd466) !important;
}
#hubbody .grade-prog.g4.max .grade-head b {
  color: #b81818 !important;
}

/* Elemental School Chips (Hỏa, Lôi, Băng, Kiếm, Đao, Quyền Chỉ, Độc, Phong, Thổ, Mộc, Huyết, Cổ) */
.school-chip {
  display: inline-flex !important;
  align-items: center;
  gap: 3px;
  margin-left: 6px !important;
  padding: 1px 8px 1px 6px !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  line-height: 1.35 !important;
  border-radius: 999px !important;
  border: 1.5px solid var(--sc-b, #a89878) !important;
  background: var(--sc-bg, #f2ece0) !important;
  color: var(--sc-fg, #4a3520) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 1px 2px rgba(40, 24, 10, 0.12);
  vertical-align: middle;
  letter-spacing: 0.15px;
  white-space: nowrap;
}
.school-chip > i {
  font-style: normal !important;
  font-size: 10.5px !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1;
}
.school-chip.sc-hoa   { --sc-bg: linear-gradient(180deg, #fff0e6, #ffd9c2); --sc-b: #e65a28; --sc-fg: #a62b08; }
.school-chip.sc-loi   { --sc-bg: linear-gradient(180deg, #f5ecff, #e4d1ff); --sc-b: #8e54e8; --sc-fg: #541fa8; }
.school-chip.sc-bang  { --sc-bg: linear-gradient(180deg, #eaf8ff, #ccecff); --sc-b: #329be0; --sc-fg: #0e588f; }
.school-chip.sc-kiem  { --sc-bg: linear-gradient(180deg, #e8fbff, #c7f0fa); --sc-b: #1fa3bf; --sc-fg: #0c5d70; }
.school-chip.sc-dao   { --sc-bg: linear-gradient(180deg, #fff1e8, #ffdbc4); --sc-b: #d96b38; --sc-fg: #8c3410; }
.school-chip.sc-quyen { --sc-bg: linear-gradient(180deg, #fff7df, #ffe7a8); --sc-b: #d4961e; --sc-fg: #7d4e06; }
.school-chip.sc-doc   { --sc-bg: linear-gradient(180deg, #eefbe6, #d4f2be); --sc-b: #59a828; --sc-fg: #2b660b; }
.school-chip.sc-phong { --sc-bg: linear-gradient(180deg, #e6fbf4, #c2f2e2); --sc-b: #28a882; --sc-fg: #0f634a; }
.school-chip.sc-tho   { --sc-bg: linear-gradient(180deg, #faf1e4, #ebd7b8); --sc-b: #b07a3c; --sc-fg: #6b4216; }
.school-chip.sc-moc   { --sc-bg: linear-gradient(180deg, #e8f8e8, #c7ecc7); --sc-b: #389c42; --sc-fg: #185e20; }
.school-chip.sc-huyet { --sc-bg: linear-gradient(180deg, #ffe8ec, #ffc7d2); --sc-b: #d92b4b; --sc-fg: #8f0f28; }
.school-chip.sc-co    { --sc-bg: linear-gradient(180deg, #f6fae4, #e3f0b4); --sc-b: #8ea824; --sc-fg: #4e6108; }

/* Settings: Trọng sinh đạo thân button in clear crimson red */
.hubmodal .set-list .qcbh-plaque.danger-plaque,
#lobby .set-list .qcbh-plaque.danger-plaque {
  background: linear-gradient(180deg, #d93b3b, #a31f1f) !important;
  border: 2px solid #751212 !important;
  box-shadow: inset 0 1px 0 rgba(255, 190, 190, 0.35), 0 3px 0 #5a0e0e !important;
}
.hubmodal .set-list .qcbh-plaque.danger-plaque .qp-txt,
#lobby .set-list .qcbh-plaque.danger-plaque .qp-txt {
  color: #fff5f5 !important;
  text-shadow: 0 1px 2px rgba(60, 0, 0, 0.7) !important;
}


/* ============================================================================
 * CẦU ĐẠO ĐÀI 2.0 — VIVID DYNAMIC CELESTIAL GACHA UI (gc2-*)
 * Overrides legacy parchment #gacha styling with per-banner shifting backdrops,
 * animated celestial rays/motes, visual banner strip, spotlight stage, and compact panels.
 * ============================================================================ */
#gacha {
  background: rgba(5, 7, 14, 0.78) !important;
  backdrop-filter: blur(8px) !important;
  padding: 14px !important;
}

#gacha .hub-win.win-gacha.gc2-win {
  --gc-bg1: #091d1c;
  --gc-bg2: #123c36;
  --gc-accent: #4ef2c4;
  --gc-accent2: #ffd970;
  --gc-glow: rgba(78, 242, 196, 0.32);
  --gc-border: rgba(255, 217, 112, 0.45);
  position: relative !important;
  width: min(1140px, 96vw) !important;
  max-width: 1140px !important;
  height: min(700px, 92vh) !important;
  max-height: 92vh !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  border-radius: 18px !important;
  border: 2px solid var(--gc-border) !important;
  background: linear-gradient(155deg, var(--gc-bg1) 0%, #090c14 55%, var(--gc-bg2) 100%) !important;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.75), 0 0 42px var(--gc-glow), inset 0 1px 0 rgba(255, 255, 255, 0.14) !important;
  color: #f3f6ff !important;
  transition: background 0.45s ease, border-color 0.45s ease, box-shadow 0.45s ease;
}

/* Per-Banner Dynamic Themes (shifting full-screen backdrop, window frame & stage aura) */
#gacha[data-theme="pntt"] { background: radial-gradient(circle at 50% 45%, rgba(16, 82, 68, 0.58), rgba(4, 10, 14, 0.86) 72%) !important; }
#gacha[data-theme="donghua"] { background: radial-gradient(circle at 50% 45%, rgba(76, 26, 130, 0.58), rgba(8, 5, 16, 0.86) 72%) !important; }
#gacha[data-theme="std"] { background: radial-gradient(circle at 50% 45%, rgba(20, 68, 124, 0.58), rgba(4, 9, 18, 0.86) 72%) !important; }
#gacha[data-theme="cosmetic"] { background: radial-gradient(circle at 50% 45%, rgba(124, 24, 52, 0.58), rgba(14, 4, 8, 0.86) 72%) !important; }
#gacha[data-theme="skill"] { background: radial-gradient(circle at 50% 45%, rgba(112, 64, 14, 0.58), rgba(12, 8, 4, 0.86) 72%) !important; }
#gacha[data-theme="beast"] { background: radial-gradient(circle at 50% 45%, rgba(22, 92, 48, 0.58), rgba(4, 12, 8, 0.86) 72%) !important; }

#gacha .hub-win.win-gacha.gc2-win.t-pntt, .gc2-stage.t-pntt, .gc2-bcard.t-pntt, .gc2-res-wrap.t-pntt {
  --gc-bg1: #071e1c;
  --gc-bg2: #134a3e;
  --gc-accent: #4ef2c4;
  --gc-accent2: #ffd970;
  --gc-glow: rgba(62, 232, 184, 0.34);
  --gc-border: rgba(88, 240, 196, 0.52);
}
#gacha .hub-win.win-gacha.gc2-win.t-donghua, .gc2-stage.t-donghua, .gc2-bcard.t-donghua, .gc2-res-wrap.t-donghua {
  --gc-bg1: #160a28;
  --gc-bg2: #3a1766;
  --gc-accent: #c77dff;
  --gc-accent2: #ffd166;
  --gc-glow: rgba(182, 102, 255, 0.38);
  --gc-border: rgba(204, 132, 255, 0.55);
}
#gacha .hub-win.win-gacha.gc2-win.t-std, .gc2-stage.t-std, .gc2-bcard.t-std, .gc2-res-wrap.t-std {
  --gc-bg1: #081529;
  --gc-bg2: #153c6b;
  --gc-accent: #56ccff;
  --gc-accent2: #ffe082;
  --gc-glow: rgba(86, 204, 255, 0.34);
  --gc-border: rgba(98, 206, 255, 0.52);
}
#gacha .hub-win.win-gacha.gc2-win.t-cosmetic, .gc2-stage.t-cosmetic, .gc2-bcard.t-cosmetic, .gc2-res-wrap.t-cosmetic {
  --gc-bg1: #260913;
  --gc-bg2: #611a2e;
  --gc-accent: #ff6b8b;
  --gc-accent2: #ffd466;
  --gc-glow: rgba(255, 102, 138, 0.38);
  --gc-border: rgba(255, 130, 152, 0.55);
}
#gacha .hub-win.win-gacha.gc2-win.t-skill, .gc2-stage.t-skill, .gc2-bcard.t-skill, .gc2-res-wrap.t-skill {
  --gc-bg1: #211306;
  --gc-bg2: #54320f;
  --gc-accent: #ffb84d;
  --gc-accent2: #fff0a8;
  --gc-glow: rgba(255, 184, 77, 0.38);
  --gc-border: rgba(255, 198, 92, 0.58);
}
#gacha .hub-win.win-gacha.gc2-win.t-beast, .gc2-stage.t-beast, .gc2-bcard.t-beast, .gc2-res-wrap.t-beast {
  --gc-bg1: #091f14;
  --gc-bg2: #195232;
  --gc-accent: #6ef08d;
  --gc-accent2: #ffd970;
  --gc-glow: rgba(110, 240, 141, 0.34);
  --gc-border: rgba(116, 242, 148, 0.52);
}

/* Ambient shifting background aura behind entire gacha window */
.gc2-bg-aura {
  position: absolute;
  inset: -40%;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 28% 35%, var(--gc-glow), transparent 46%),
    radial-gradient(circle at 78% 72%, rgba(255, 210, 100, 0.14), transparent 42%),
    repeating-conic-gradient(from 0deg at 36% 52%, rgba(255, 255, 255, 0.025) 0deg 10deg, transparent 10deg 24deg);
  animation: gc2SpinSlow 55s linear infinite;
}
@keyframes gc2SpinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Header */
.gc2-head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 8px;
  background: linear-gradient(180deg, rgba(10, 13, 24, 0.85), rgba(10, 13, 24, 0.35));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex: none;
}
.gc2-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.gc2-spark {
  color: var(--gc-accent2);
  font-size: 18px;
  text-shadow: 0 0 12px var(--gc-accent2);
}
.gc2-title h2 {
  margin: 0 !important;
  font-size: 18px !important;
  font-weight: 800 !important;
  letter-spacing: 0.4px;
  color: #fffaf0 !important;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7) !important;
}
.gc2-hright {
  display: flex;
  align-items: center;
  gap: 10px;
}
.gc2-coin {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(12, 16, 28, 0.78);
  border: 1px solid rgba(255, 215, 110, 0.45);
  font-size: 13.5px;
  font-weight: 800;
  color: #ffe89e;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.gc2-coin img {
  width: 17px;
  height: 17px;
}
#gacha button.gc2-hbtn {
  background: rgba(255, 255, 255, 0.09) !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  color: #f3f6ff !important;
  border-radius: 999px !important;
  padding: 5px 13px !important;
  min-height: 30px !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  text-shadow: none !important;
  box-shadow: none !important;
  filter: none !important;
  transition: background 0.18s, border-color 0.18s;
}
#gacha button.gc2-hbtn:hover {
  background: rgba(255, 255, 255, 0.18) !important;
  border-color: var(--gc-accent2) !important;
  color: #fff !important;
}

/* Top Visual Banner Strip (4 cards) */
.gc2-strip {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 8px 16px 6px;
  flex: none;
}
.cp-series {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-style: normal;
  font-weight: 700;
  font-size: 11.5px;
  line-height: 1.3;
  letter-spacing: 0.2px;
  border: 1px solid rgba(212, 74, 46, 0.52);
  background: linear-gradient(180deg, rgba(255, 232, 218, 0.95), rgba(252, 206, 186, 0.92));
  color: #9e2214;
}
.cp-series.s-pham_nhan {
  border-color: rgba(31, 138, 104, 0.55);
  background: linear-gradient(180deg, rgba(220, 252, 240, 0.95), rgba(186, 242, 222, 0.92));
  color: #13684c;
}
#gacha button.gc2-bcard {
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 3px !important;
  padding: 7px 6px 6px !important;
  min-height: 0 !important;
  border-radius: 12px !important;
  background: linear-gradient(180deg, rgba(16, 20, 34, 0.72), rgba(9, 12, 22, 0.88)) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.12) !important;
  color: #cfd8ea !important;
  text-shadow: none !important;
  box-shadow: none !important;
  filter: none !important;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
#gacha button.gc2-bcard:hover {
  transform: translateY(-2px);
  border-color: var(--gc-accent) !important;
  background: linear-gradient(180deg, rgba(28, 34, 56, 0.84), rgba(11, 15, 26, 0.94)) !important;
}
#gacha button.gc2-bcard.on {
  border-color: var(--gc-accent2) !important;
  background: linear-gradient(180deg, var(--gc-bg2), rgba(10, 14, 24, 0.94)) !important;
  box-shadow: 0 0 18px var(--gc-glow), inset 0 1px 0 rgba(255, 255, 255, 0.28) !important;
  color: #fff !important;
  transform: translateY(-2px);
}
.gc2-btag {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gc-accent);
  opacity: 0.9;
}
.gc2-bthumb {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.65));
}
.gc2-bthumb .gc-art {
  max-width: 36px;
  max-height: 36px;
}
.gc2-bname {
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.gc2-bprog {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 1px;
}
.gc2-bbar {
  flex: 1;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.gc2-bbar > i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--gc-accent), var(--gc-accent2));
}
.gc2-bcnt {
  font-size: 9.5px;
  font-weight: 700;
  color: #9fb0cc;
}

/* Body Container */
#gachabody.gc2-body {
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 0;
  padding: 6px 16px 14px !important;
  overflow: hidden !important;
  display: flex;
  flex-direction: column;
}

/* Main 2-column Split */
.gc2-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.68fr) minmax(270px, 1fr);
  gap: 12px;
}
.gc2-left {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

/* Hero Spotlight Stage */
.gc2-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  border-radius: 16px;
  border: 1.5px solid var(--gc-border);
  background:
    radial-gradient(ellipse at 50% 48%, var(--gc-glow), transparent 64%),
    linear-gradient(160deg, var(--gc-bg2) 0%, #0a0f1c 56%, var(--gc-bg1) 100%);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px 16px;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.55), 0 8px 26px rgba(0, 0, 0, 0.45);
}
.gc2-rays {
  position: absolute;
  inset: -50%;
  pointer-events: none;
  background: repeating-conic-gradient(
    from 0deg at 50% 50%,
    rgba(255, 255, 255, 0.045) 0deg 8deg,
    transparent 8deg 22deg
  );
  animation: gc2SpinSlow 42s linear infinite;
}
.gc2-watermark {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(54px, 7vw, 88px);
  font-weight: 900;
  letter-spacing: 8px;
  color: rgba(255, 255, 255, 0.045);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

/* Floating Animated Spirit Motes */
.gc2-motes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.gc2-motes i {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gc-accent2);
  box-shadow: 0 0 10px var(--gc-accent), 0 0 18px var(--gc-accent2);
  opacity: 0;
  animation: gc2Mote 6.5s ease-in-out infinite;
}
.gc2-motes i:nth-child(1) { left: 12%; bottom: 10%; animation-delay: 0s; animation-duration: 5.5s; }
.gc2-motes i:nth-child(2) { left: 26%; bottom: 18%; animation-delay: 1.2s; animation-duration: 7s; width: 4px; height: 4px; }
.gc2-motes i:nth-child(3) { left: 42%; bottom: 8%; animation-delay: 2.4s; animation-duration: 6s; }
.gc2-motes i:nth-child(4) { left: 58%; bottom: 14%; animation-delay: 0.7s; animation-duration: 7.5s; width: 6px; height: 6px; }
.gc2-motes i:nth-child(5) { left: 74%; bottom: 12%; animation-delay: 3.1s; animation-duration: 5.8s; }
.gc2-motes i:nth-child(6) { left: 86%; bottom: 20%; animation-delay: 1.8s; animation-duration: 6.8s; width: 4px; height: 4px; }
.gc2-motes i:nth-child(7) { left: 18%; bottom: 32%; animation-delay: 4s; animation-duration: 8s; }
.gc2-motes i:nth-child(8) { left: 68%; bottom: 28%; animation-delay: 2.8s; animation-duration: 6.2s; }
@keyframes gc2Mote {
  0% { transform: translateY(0) scale(0.6); opacity: 0; }
  25% { opacity: 0.85; }
  80% { opacity: 0.5; }
  100% { transform: translateY(-160px) scale(1.25); opacity: 0; }
}

.gc2-stage-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.gc2-pill-tag,
.gc2-pill-rate {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  background: rgba(8, 12, 22, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #e6eefc;
  backdrop-filter: blur(4px);
}
.gc2-pill-rate b {
  color: var(--gc-accent2);
}

/* Spotlight Diorama */
.gc2-spotlight {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 6px 0;
}
.gc2-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 210px;
}
.gc2-center-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}
.gc2-rar-badge {
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.gc2-rar-badge.r-UR, .gc2-rmini.r-UR, .gc2-rtag.r-UR { background: linear-gradient(135deg, #c92222, #ff5e5e); border-color: #ffb8b8; color: #fff; }
.gc2-rar-badge.r-SSR, .gc2-rmini.r-SSR, .gc2-rtag.r-SSR { background: linear-gradient(135deg, #b8780a, #ffd25a); border-color: #fff0b3; color: #2b1600; }
.gc2-rar-badge.r-SR, .gc2-rmini.r-SR, .gc2-rtag.r-SR { background: linear-gradient(135deg, #6d28b8, #c87aff); border-color: #ebd1ff; color: #fff; }
.gc2-rar-badge.r-R, .gc2-rmini.r-R, .gc2-rtag.r-R { background: linear-gradient(135deg, #1b69a8, #5ec4ff); border-color: #bde6ff; color: #fff; }
.gc2-rar-badge.r-N, .gc2-rmini.r-N, .gc2-rtag.r-N { background: rgba(120, 128, 145, 0.55); border-color: rgba(210, 218, 232, 0.45); color: #eef2fa; }

.gc2-own-badge {
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(32, 184, 122, 0.28);
  border: 1px solid #4ef2b0;
  color: #8affcf;
}
.gc2-center-name {
  font-size: 22px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 2px 14px var(--gc-glow), 0 2px 4px rgba(0, 0, 0, 0.85);
  margin-bottom: 4px;
}
.gc2-center-ped {
  position: relative;
  width: 156px;
  height: 144px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gc2-aura-ring {
  position: absolute;
  bottom: 8px;
  width: 132px;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, var(--gc-glow) 0%, transparent 72%);
  border: 2px solid var(--gc-accent);
  box-shadow: 0 0 24px var(--gc-glow), inset 0 0 14px var(--gc-glow);
  animation: gc2PulseRing 2.8s ease-in-out infinite;
}
.gc2-aura-ring.ring2 {
  width: 158px;
  height: 44px;
  bottom: 4px;
  border-color: var(--gc-accent2);
  opacity: 0.45;
  animation-delay: 1.4s;
}
@keyframes gc2PulseRing {
  0%, 100% { transform: scale(0.96); opacity: 0.65; }
  50% { transform: scale(1.06); opacity: 1; }
}
.gc2-sprite {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.72)) drop-shadow(0 0 14px var(--gc-glow));
}
.gc2-sprite.main {
  width: 118px;
  height: 118px;
  animation: gc2Float 3.2s ease-in-out infinite;
}
.gc2-sprite.main .gc-art {
  max-width: 108px;
  max-height: 108px;
}
.gc2-sprite.main .gc-orb {
  width: 72px;
  height: 72px;
}
@keyframes gc2Float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-9px); }
}
.gc2-center-sub {
  font-size: 12px;
  font-weight: 600;
  color: #cfe0f5;
  max-width: 340px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

/* Flanking Featured Companions */
.gc2-flank {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  opacity: 0.82;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.gc2-flank:hover {
  opacity: 1;
  transform: translateY(-4px) scale(1.06);
}
.gc2-flank .gc2-sprite {
  width: 76px;
  height: 76px;
  animation: gc2Float 3.8s ease-in-out infinite;
}
.gc2-flank.right .gc2-sprite {
  animation-delay: 1.2s;
}
.gc2-flank .gc-art {
  max-width: 66px;
  max-height: 66px;
}
.gc2-ped-glow {
  position: absolute;
  bottom: 18px;
  width: 76px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(ellipse, var(--gc-glow), transparent 72%);
}
.gc2-flank-name {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #c8d6eb;
  max-width: 106px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

/* Stage Footer */
.gc2-stage-foot {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.gc2-stage-title {
  font-size: 15.5px;
  font-weight: 900;
  color: var(--gc-accent2);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}
.gc2-stage-col {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: #cbd7eb;
}
.gc2-stage-col b {
  color: #fff;
}
.gc2-colbar {
  width: 108px;
  height: 7px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}
.gc2-colbar > i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--gc-accent), var(--gc-accent2));
}

/* Juicy Pull CTA Bar */
.gc2-pullbar {
  display: flex;
  align-items: stretch;
  gap: 10px;
  flex: none;
}
#gacha button.gc2-pull {
  position: relative !important;
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 2px !important;
  padding: 9px 14px !important;
  min-height: 54px !important;
  border-radius: 13px !important;
  cursor: pointer;
  overflow: hidden;
  filter: none !important;
  transition: transform 0.14s ease, box-shadow 0.18s ease, filter 0.18s ease;
}
#gacha button.gc2-pull.p1 {
  background: linear-gradient(180deg, #1b2438, #101624) !important;
  border: 1.5px solid rgba(255, 217, 112, 0.55) !important;
  color: #fff5d6 !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45) !important;
}
#gacha button.gc2-pull.p1:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: #ffe388 !important;
  box-shadow: 0 6px 20px rgba(255, 212, 102, 0.28) !important;
}
#gacha button.gc2-pull.p10 {
  flex: 1.35 !important;
  background: linear-gradient(135deg, #f7b733 0%, #ffdf6b 48%, #f0932b 100%) !important;
  border: 1.5px solid #fff3bd !important;
  color: #2b1600 !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45) !important;
  box-shadow: 0 6px 22px rgba(247, 183, 51, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.7) !important;
}
#gacha button.gc2-pull.p10::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 28%, rgba(255, 255, 255, 0.42) 48%, transparent 66%);
  transform: translateX(-120%);
  animation: gc2Shine 3.6s ease-in-out infinite;
}
@keyframes gc2Shine {
  0%, 65% { transform: translateX(-120%); }
  100% { transform: translateX(130%); }
}
#gacha button.gc2-pull.p10:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 8px 28px rgba(255, 205, 70, 0.62) !important;
}
.gc2-pbadge {
  position: absolute;
  top: 4px;
  right: 8px;
  font-size: 9.5px;
  font-weight: 900;
  padding: 1px 6px;
  border-radius: 999px;
  background: #a81c1c;
  color: #fff6d6;
  text-shadow: none;
}
.gc2-plabel {
  font-size: 14.5px;
  font-weight: 900;
  letter-spacing: 0.2px;
}
.gc2-pcost {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 800;
  opacity: 0.92;
}
.gc2-pcost img {
  width: 15px;
  height: 15px;
}
#gacha button.gc2-skip {
  flex: none !important;
  padding: 0 13px !important;
  border-radius: 13px !important;
  background: rgba(14, 18, 30, 0.78) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.16) !important;
  color: #b4c2d9 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  text-shadow: none !important;
  box-shadow: none !important;
  filter: none !important;
}
#gacha button.gc2-skip.on {
  border-color: var(--gc-accent2) !important;
  color: var(--gc-accent2) !important;
  background: rgba(255, 215, 100, 0.12) !important;
}

/* Right Compact Tabbed Panel */
.gc2-right {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-radius: 16px;
  background: rgba(9, 13, 24, 0.78);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
  backdrop-filter: blur(6px);
}
.gc2-rtabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 6px;
  background: rgba(0, 0, 0, 0.28);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex: none;
}
#gacha .gc2-rtabs button {
  padding: 6px 8px !important;
  min-height: 30px !important;
  border-radius: 9px !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  color: #9fb0cc !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  text-shadow: none !important;
  box-shadow: none !important;
  filter: none !important;
}
#gacha .gc2-rtabs button.on {
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: var(--gc-accent2) !important;
  color: #fff6d6 !important;
}
.gc2-rbody {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 11px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Visual Pity Bars */
.gc2-sec {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gc2-pity-row {
  padding: 5px 9px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.gc2-pity-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  font-weight: 700;
  color: #dbe4f5;
  margin-bottom: 5px;
}
.gc2-pity-row.ur .gc2-pity-top b { color: #ff8080; }
.gc2-pity-row.ssr .gc2-pity-top b { color: #ffd966; }
.gc2-pity-row.sr .gc2-pity-top b { color: #d896ff; }
.gc2-pbar {
  height: 7px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.gc2-pbar > i {
  display: block;
  height: 100%;
  border-radius: 99px;
  transition: width 0.35s ease;
}
.gc2-pity-row.ur .gc2-pbar > i { background: linear-gradient(90deg, #d62828, #ff7070, #ffd466); }
.gc2-pity-row.ssr .gc2-pbar > i { background: linear-gradient(90deg, #d98a00, #ffe066); }
.gc2-pity-row.sr .gc2-pbar > i { background: linear-gradient(90deg, #7c3aed, #d896ff); }
.gc2-pity-sub {
  margin-top: 3px;
  font-size: 10px;
  color: #8f9fba;
  text-align: right;
}

/* Featured Chips Grid */
.gc2-sec-hd {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--gc-accent2);
}
.gc2-sec-hd em {
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  color: #93a4bf;
}
.gc2-fgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
#gacha button.gc2-fchip {
  display: flex !important;
  align-items: center !important;
  gap: 7px !important;
  padding: 5px 7px !important;
  min-height: 44px !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #eaf0fa !important;
  text-align: left !important;
  text-shadow: none !important;
  box-shadow: none !important;
  filter: none !important;
}
#gacha button.gc2-fchip:hover,
#gacha button.gc2-fchip.on {
  background: rgba(255, 255, 255, 0.13) !important;
  border-color: var(--gc-accent2) !important;
}
#gacha button.gc2-fchip.r-UR { border-left: 3px solid #ff5e5e !important; }
#gacha button.gc2-fchip.r-SSR { border-left: 3px solid #ffd25a !important; }
#gacha button.gc2-fchip.r-SR { border-left: 3px solid #c87aff !important; }
.gc2-fthumb {
  width: 32px;
  height: 32px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gc2-fthumb .gc-art {
  max-width: 30px;
  max-height: 30px;
}
.gc2-ftxt {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.gc2-ftxt b {
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #f4f7ff;
}
.gc2-ftxt em {
  font-style: normal;
  font-size: 10px;
  color: #9cb0cc;
}

/* Side Pool List */
.gc2-plist {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.gc2-prow {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
}
.gc2-prow.locked { opacity: 0.62; }
.gc2-pimg {
  width: 38px;
  height: 38px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
}
.gc2-pimg .gc-art { max-width: 34px; max-height: 34px; }
.gc2-pmeta {
  flex: 1;
  min-width: 0;
}
.gc2-pmeta b {
  display: block;
  font-size: 12px;
  color: #f4f7ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gc2-pmeta em {
  display: block;
  font-style: normal;
  font-size: 10.5px;
  color: #9db0cc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gc2-rmini {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 900;
  padding: 0 5px;
  border-radius: 4px;
  border: 1px solid;
  margin-right: 3px;
}
.gc2-st { font-style: normal; color: #ffd466; }
.gc2-eqd { font-size: 10.5px; font-weight: 800; color: #5ef2b5; white-space: nowrap; }
.gc2-lck { font-size: 10.5px; color: #7e8fa8; white-space: nowrap; }
#gacha button.gc2-eqsm {
  padding: 4px 9px !important;
  min-height: 24px !important;
  border-radius: 7px !important;
  background: linear-gradient(180deg, #3bbf86, #248a5e) !important;
  border: 1px solid #7ff2c0 !important;
  color: #fff !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  text-shadow: none !important;
  box-shadow: none !important;
  filter: none !important;
  white-space: nowrap;
}
#gacha button.gc2-eqsm.on {
  background: rgba(255, 255, 255, 0.14) !important;
  border-color: rgba(255, 255, 255, 0.28) !important;
}

/* Side Odds Table */
.gc2-odds {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.gc2-orow {
  display: grid;
  grid-template-columns: 38px 1fr auto auto;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11.5px;
}
.gc2-orow b { color: #f0f5ff; font-weight: 700; }
.gc2-opct { font-weight: 900; color: #ffe082; }
.gc2-orow em { font-style: normal; font-size: 10.5px; color: #9db0cc; }
.gc2-onote {
  margin: 4px 0 0;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 11.5px;
  line-height: 1.45;
  color: #b4c4dc;
}

/* Dramatic Pull Result Overlay */
.gc2-res-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: 10px 6px;
  border-radius: 16px;
  background: radial-gradient(ellipse at 50% 40%, var(--gc-glow), rgba(8, 12, 22, 0.75) 70%);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.gc2-res-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 0 12px;
  overflow-y: auto;
}
.gc2-res-grid.one {
  grid-template-columns: 220px;
  justify-content: center;
}
.gc2-rcard {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
  padding: 18px 6px 7px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(22, 29, 48, 0.92), rgba(10, 14, 24, 0.96));
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  overflow: hidden;
  animation: gc2CardPop 0.34s cubic-bezier(0.2, 0.9, 0.25, 1.15) both;
  animation-delay: var(--d, 0ms);
}
.gc2-rcard.noanim { animation: none; }
@keyframes gc2CardPop {
  from { opacity: 0; transform: translateY(16px) scale(0.88); }
  to { opacity: 1; transform: none; }
}
.gc2-rcard.r-UR {
  border-color: #ff6b6b;
  box-shadow: 0 0 22px rgba(255, 82, 82, 0.45), inset 0 0 22px rgba(255, 82, 82, 0.2);
}
.gc2-rcard.r-SSR {
  border-color: #ffd45a;
  box-shadow: 0 0 20px rgba(255, 212, 90, 0.38), inset 0 0 18px rgba(255, 212, 90, 0.16);
}
.gc2-rcard.r-SR {
  border-color: #c77dff;
  box-shadow: 0 0 14px rgba(199, 125, 255, 0.3);
}
.gc2-rcard.r-R {
  border-color: #56ccff;
}
.gc2-rtag {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 9.5px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid;
}
.gc2-rimg {
  width: 54px;
  height: 54px;
  min-height: 54px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.65));
}
.gc2-rcard b { font-size: 12.5px; color: #fff; line-height: 1.25; }
.gc2-rcard em { font-style: normal; font-size: 10.5px; color: #9db0cc; }
.gc2-rbadge { font-size: 10.5px; color: #b8c7de; }
.gc2-rbadge.new { color: #5ef2b5; font-weight: 800; }

.gc2-res-acts {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 16px;
}
.gc2-res-acts .gc2-pull { max-width: 210px; }
#gacha button.gc2-back {
  padding: 10px 18px !important;
  min-height: 46px !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.22) !important;
  color: #f0f5ff !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  text-shadow: none !important;
  box-shadow: none !important;
  filter: none !important;
}

/* Responsive Tuning */
@media (max-width: 860px) {
  #gacha .hub-win.win-gacha.gc2-win {
    height: 94vh !important;
  }
  .gc2-strip {
    grid-template-columns: repeat(4, minmax(100px, 1fr));
    overflow-x: auto;
    padding-bottom: 6px;
  }
  #gachabody.gc2-body {
    overflow-y: auto !important;
  }
  .gc2-layout {
    grid-template-columns: 1fr;
  }
  .gc2-stage {
    min-height: 290px;
  }
  .gc2-flank {
    display: none;
  }
  .gc2-res-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* ============================================================================
 * CỔ PHONG TU TIÊN OVERLAY FOR GACHA 2.0 (Dragons, Tigers, Trees, Clouds, Antique Gold Frames)
 * ============================================================================ */
#gacha .hub-win.win-gacha.gc2-win {
  border-radius: 10px !important;
  border: 2.5px solid #d4a44a !important;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.84),
    0 0 46px var(--gc-glow),
    inset 0 0 0 3px rgba(40, 24, 10, 0.85),
    inset 0 0 0 4.5px rgba(246, 206, 114, 0.36) !important;
}

/* Ornate Xianxia Gold Filigree Corner Brackets on Window & Stage */
.gc2-wcor, .gc2-cor {
  position: absolute;
  width: 22px;
  height: 22px;
  pointer-events: none;
  z-index: 6;
  border-color: #f3c868;
  border-style: solid;
  border-width: 0;
  opacity: 0.9;
}
.gc2-wcor.tl, .gc2-cor.tl { top: 6px; left: 6px; border-top-width: 3px; border-left-width: 3px; }
.gc2-wcor.tr, .gc2-cor.tr { top: 6px; right: 6px; border-top-width: 3px; border-right-width: 3px; }
.gc2-wcor.bl, .gc2-cor.bl { bottom: 6px; left: 6px; border-bottom-width: 3px; border-left-width: 3px; }
.gc2-wcor.br, .gc2-cor.br { bottom: 6px; right: 6px; border-bottom-width: 3px; border-right-width: 3px; }
.gc2-cor { width: 16px; height: 16px; border-color: rgba(255, 217, 118, 0.72); z-index: 4; }

/* Traditional Lacquered Wood Header & Cinnabar Seal */
.gc2-head {
  background: linear-gradient(180deg, rgba(44, 24, 14, 0.94), rgba(22, 13, 9, 0.82)) !important;
  border-bottom: 1.5px solid rgba(218, 170, 82, 0.45) !important;
  padding: 9px 18px 8px !important;
}
.gc2-seal-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  background: linear-gradient(180deg, #b82420, #7c1412);
  border: 1.5px solid #f2c970;
  color: #fff3d2;
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.9px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 224, 160, 0.4);
}
.gc2-title h2 {
  font-family: 'Times New Roman', 'Palatino Linotype', serif !important;
  font-size: 20px !important;
  letter-spacing: 0.6px !important;
  color: #ffe9ad !important;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85), 0 0 12px rgba(255, 200, 80, 0.35) !important;
}
.gc2-coin {
  border-radius: 6px !important;
  background: linear-gradient(180deg, rgba(36, 22, 12, 0.92), rgba(20, 12, 7, 0.95)) !important;
  border: 1.5px solid #c9963e !important;
}
#gacha button.gc2-hbtn {
  border-radius: 6px !important;
  background: linear-gradient(180deg, rgba(84, 52, 26, 0.88), rgba(48, 28, 14, 0.92)) !important;
  border: 1.5px solid #c9963e !important;
  color: #ffefc4 !important;
}
#gacha button.gc2-hbtn:hover {
  background: linear-gradient(180deg, rgba(114, 70, 34, 0.95), rgba(68, 40, 18, 0.96)) !important;
  border-color: #ffe08a !important;
}

/* Antique Jade/Ebony Spirit Tablet Banner Cards */
#gacha button.gc2-bcard {
  border-radius: 8px !important;
  border: 1.5px solid rgba(208, 162, 82, 0.36) !important;
  background: linear-gradient(180deg, rgba(30, 21, 16, 0.82), rgba(14, 11, 12, 0.92)) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 224, 150, 0.08) !important;
}
#gacha button.gc2-bcard.on {
  border-color: #f6cc68 !important;
  box-shadow: 0 0 18px var(--gc-glow), inset 0 0 0 1.5px rgba(255, 232, 160, 0.38) !important;
}
.gc2-bname {
  font-family: 'Times New Roman', 'Palatino Linotype', serif;
  letter-spacing: 0.2px;
}

/* Gacha Reward Pool Button & Tiered Modal */
.gc2-rfoot {
  flex: none;
  padding: 8px 10px 10px;
  border-top: 1px solid rgba(255, 224, 150, 0.14);
}
#gacha button.gc2-listbtn {
  width: 100%;
  padding: 9px 12px !important;
  border-radius: 9px !important;
  border: 1.5px solid rgba(246, 204, 104, 0.45) !important;
  background: linear-gradient(180deg, rgba(64, 42, 22, 0.88), rgba(28, 18, 12, 0.94)) !important;
  color: #ffe8a8 !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  letter-spacing: 0.2px;
  cursor: pointer;
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.15s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
#gacha button.gc2-listbtn em {
  font-style: normal;
  color: #ffd466;
  font-size: 12px;
}
#gacha button.gc2-listbtn:hover {
  transform: translateY(-1px);
  border-color: #ffd970 !important;
  box-shadow: 0 0 14px rgba(255, 212, 102, 0.3) !important;
}
.gc2-pmwrap {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: rgba(6, 9, 16, 0.78);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.gc2-pmbox {
  width: min(920px, 100%);
  max-height: 86%;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  border: 1.5px solid rgba(246, 204, 104, 0.52);
  background: linear-gradient(180deg, #1b1512, #0f0d12);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.72);
  overflow: hidden;
}
.gc2-pmtop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 224, 150, 0.18);
  background: rgba(255, 212, 102, 0.06);
}
.gc2-pmtop h3 {
  margin: 0;
  font-size: 16px;
  color: #ffe8a8;
}
.gc2-pmtop p {
  margin: 2px 0 0;
  font-size: 12px;
  color: rgba(235, 224, 200, 0.72);
}
.gc2-pmbody {
  padding: 12px 16px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.gc2-pmsec {
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 12px;
}
.gc2-pmsec.r-UR { border-color: rgba(255, 110, 110, 0.45); background: rgba(148, 28, 42, 0.14); }
.gc2-pmsec.r-SSR { border-color: rgba(255, 212, 102, 0.42); background: rgba(128, 86, 18, 0.14); }
.gc2-pmsec.r-SR { border-color: rgba(215, 139, 255, 0.38); background: rgba(84, 34, 118, 0.14); }
.gc2-pmsec.r-R { border-color: rgba(107, 200, 255, 0.34); background: rgba(30, 68, 108, 0.14); }
.gc2-pmhd {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  color: #f6eedc;
}
.gc2-pmhd b { font-weight: 700; }
.gc2-pmrate {
  font-size: 11.5px;
  color: rgba(255, 232, 168, 0.8);
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.32);
}
.gc2-pmhd em {
  margin-left: auto;
  font-style: normal;
  font-size: 12px;
  color: rgba(235, 224, 200, 0.75);
}
.gc2-pmgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
  gap: 7px;
}
.gc2-pmcard {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 12, 18, 0.58);
}
.gc2-pmcard.owned {
  border-color: rgba(110, 240, 141, 0.35);
}
.gc2-pmico {
  width: 34px;
  height: 34px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.gc2-pmico img, .gc2-pmico .gc-sheet {
  max-width: 100%;
  max-height: 100%;
  image-rendering: pixelated;
}
.gc2-pmtxt {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.gc2-pmtxt b {
  font-size: 12px;
  color: #f7f2e4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gc2-pmtxt em {
  font-style: normal;
  font-size: 10.5px;
  color: rgba(215, 210, 198, 0.72);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Tu Tiên Scenic Stage Layers (Dragon Medallion, Palace, Trees, Dragon/Tiger Guardians, Clouds) */
.gc2-stage {
  border-radius: 10px !important;
  border: 2px solid rgba(226, 180, 92, 0.58) !important;
  box-shadow: inset 0 0 46px rgba(0, 0, 0, 0.62), inset 0 0 0 1px rgba(255, 230, 160, 0.14), 0 8px 26px rgba(0, 0, 0, 0.5) !important;
}

.gc2-sc-palace {
  position: absolute;
  left: 50%;
  bottom: 44px;
  transform: translateX(-50%);
  width: 280px;
  max-width: 56%;
  height: auto;
  image-rendering: pixelated;
  opacity: 0.24;
  filter: drop-shadow(0 0 18px var(--gc-glow)) brightness(0.95);
  pointer-events: none;
  z-index: 1;
}

.gc2-sc-relief {
  position: absolute;
  left: 50%;
  top: 52%;
  width: 256px;
  height: 256px;
  margin-left: -128px;
  margin-top: -128px;
  image-rendering: pixelated;
  opacity: 0.26;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 14px var(--gc-glow));
  animation: gc2ReliefSpin 68s linear infinite;
}
.gc2-stage.t-cosmetic .gc2-sc-relief { filter: hue-rotate(135deg) saturate(1.5) drop-shadow(0 0 14px var(--gc-glow)); }
.gc2-stage.t-donghua .gc2-sc-relief { filter: hue-rotate(65deg) saturate(1.4) drop-shadow(0 0 14px var(--gc-glow)); }
.gc2-stage.t-skill .gc2-sc-relief { filter: hue-rotate(185deg) saturate(1.6) drop-shadow(0 0 14px var(--gc-glow)); }
.gc2-stage.t-beast .gc2-sc-relief { filter: hue-rotate(-55deg) saturate(1.3) drop-shadow(0 0 14px var(--gc-glow)); }
@keyframes gc2ReliefSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.gc2-sc-back {
  position: absolute;
  bottom: 34px;
  height: 185px;
  width: auto;
  image-rendering: pixelated;
  opacity: 0.56;
  pointer-events: none;
  z-index: 1;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.72));
}
.gc2-sc-back.left { left: -10px; }
.gc2-sc-back.right { right: -10px; transform: scaleX(-1); }

.gc2-sc-guard {
  position: absolute;
  bottom: 36px;
  height: 92px;
  width: auto;
  image-rendering: pixelated;
  opacity: 0.82;
  pointer-events: none;
  z-index: 2;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.8)) drop-shadow(0 0 10px var(--gc-glow));
}
.gc2-sc-guard.left { left: 16px; }
.gc2-sc-guard.right { right: 16px; transform: scaleX(-1); }

/* Drifting Celestial Pixel Clouds along stage floor */
.gc2-sc-clouds {
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: 24px;
  height: 54px;
  background: url('../assets/gacha/decor/clouds.png') repeat-x bottom center / auto 54px;
  image-rendering: pixelated;
  opacity: 0.24;
  pointer-events: none;
  z-index: 2;
  animation: gc2CloudDrift 36s linear infinite;
}
@keyframes gc2CloudDrift {
  from { background-position-x: 0px; }
  to { background-position-x: 320px; }
}

/* Traditional Typography & Pill Accents on Stage */
.gc2-center-name {
  font-family: 'Times New Roman', 'Palatino Linotype', serif !important;
  letter-spacing: 0.4px;
  color: #fff6dc !important;
  text-shadow: 0 2px 14px var(--gc-glow), 0 2px 4px rgba(0, 0, 0, 0.95) !important;
}
.gc2-stage-title {
  font-family: 'Times New Roman', 'Palatino Linotype', serif !important;
  letter-spacing: 0.3px;
}
.gc2-pill-tag, .gc2-pill-rate {
  border-radius: 6px !important;
  background: rgba(24, 15, 10, 0.78) !important;
  border-color: rgba(224, 178, 92, 0.42) !important;
  color: #f6e7c5 !important;
}

/* Carved Gold/Ebony Pull Plaques */
#gacha button.gc2-pull {
  border-radius: 9px !important;
}
#gacha button.gc2-pull.p1 {
  background: linear-gradient(180deg, #332014, #1b110b) !important;
  border: 2px solid #c9963e !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 224, 148, 0.25) !important;
}
#gacha button.gc2-pull.p10 {
  background: linear-gradient(180deg, #ffd970 0%, #e6a62c 52%, #b86f12 100%) !important;
  border: 2px solid #fff0b8 !important;
  color: #2b1200 !important;
  box-shadow: 0 6px 22px rgba(235, 168, 44, 0.46), inset 0 1px 0 rgba(255, 250, 214, 0.85) !important;
}
#gacha button.gc2-skip {
  border-radius: 9px !important;
  background: rgba(28, 18, 12, 0.86) !important;
  border: 1.5px solid rgba(208, 162, 82, 0.36) !important;
  color: #dfcba0 !important;
}

/* Right Scroll Panel in Antique Lacquer & Gold */
.gc2-right {
  border-radius: 10px !important;
  background: linear-gradient(180deg, rgba(24, 16, 14, 0.88), rgba(14, 10, 12, 0.92)) !important;
  border: 1.5px solid rgba(212, 166, 84, 0.42) !important;
}
.gc2-rtabs {
  background: rgba(14, 9, 7, 0.65) !important;
  border-bottom: 1px solid rgba(212, 166, 84, 0.25) !important;
}
#gacha .gc2-rtabs button {
  border-radius: 6px !important;
  color: #cbb894 !important;
}
#gacha .gc2-rtabs button.on {
  background: linear-gradient(180deg, rgba(132, 76, 30, 0.55), rgba(78, 42, 16, 0.68)) !important;
  border-color: #e8b854 !important;
  color: #fff2cc !important;
}
.gc2-pity-row, .gc2-prow, .gc2-orow {
  border-radius: 7px !important;
  background: rgba(255, 232, 180, 0.045) !important;
  border-color: rgba(212, 166, 84, 0.16) !important;
}
#gacha button.gc2-fchip {
  border-radius: 7px !important;
  background: rgba(255, 232, 180, 0.05) !important;
  border-color: rgba(212, 166, 84, 0.18) !important;
}
#gacha button.gc2-fchip.on,
#gacha button.gc2-fchip:hover {
  background: rgba(218, 165, 64, 0.18) !important;
  border-color: #f6cc68 !important;
}

@media (max-width: 860px) {
  .gc2-sc-back { height: 120px; opacity: 0.42; }
  .gc2-sc-guard { height: 64px; opacity: 0.65; }
  .gc2-sc-palace { width: 190px; }
}


/* ============================================================================
 * TRẤN MA ĐÀI (#boss-ui) — Eerie Demonic Boss Altar Theme (Quỷ Dị · Trấn Ma)
 * Overrides pixel-bright parchment for #boss-ui only, using assets from all-in-assets.
 * ============================================================================ */
@keyframes bsSealSpin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}
@keyframes bsPulseGlow {
  0%, 100% { box-shadow: 0 0 10px rgba(255, 86, 64, 0.45), inset 0 0 8px rgba(255, 190, 110, 0.2); }
  50% { box-shadow: 0 0 20px rgba(255, 110, 74, 0.85), inset 0 0 14px rgba(255, 210, 130, 0.42); }
}

#boss-ui {
  background: radial-gradient(circle at 50% 45%, rgba(28, 8, 22, 0.82), rgba(6, 3, 10, 0.92)) !important;
}
#boss-ui .hub-win.win-boss {
  position: relative;
  background:
    radial-gradient(ellipse at 22% 18%, rgba(128, 22, 48, 0.24), transparent 52%),
    radial-gradient(ellipse at 82% 84%, rgba(82, 24, 132, 0.24), transparent 55%),
    linear-gradient(180deg, #120918 0%, #170c1e 50%, #0e0714 100%) !important;
  border: 2px solid #8a2c3c !important;
  box-shadow:
    0 0 0 1px rgba(255, 198, 128, 0.28),
    inset 0 0 0 1px rgba(255, 160, 120, 0.16),
    inset 0 0 42px rgba(0, 0, 0, 0.75),
    0 20px 64px rgba(0, 0, 0, 0.88),
    0 0 38px rgba(152, 26, 56, 0.34) !important;
  color: #efe6f4 !important;
  overflow: hidden;
}
/* Subtle demonic seal watermark in window background */
#boss-ui .hub-win.win-boss::before {
  content: '';
  position: absolute;
  right: -90px;
  bottom: -90px;
  width: 360px;
  height: 360px;
  background: url('../assets/ui/boss_seal.png') center / contain no-repeat;
  opacity: 0.08;
  pointer-events: none;
  z-index: 0;
  filter: hue-rotate(-14deg) saturate(1.2);
}
#boss-ui .hub-win.win-boss > * {
  position: relative;
  z-index: 1;
}

/* Header with abyssal sky & crimson seal */
#boss-ui .hub-head {
  background:
    linear-gradient(90deg, rgba(20, 6, 16, 0.88), rgba(52, 12, 24, 0.76) 48%, rgba(20, 6, 16, 0.88)),
    url('../assets/ui/boss_sky.png') center 22% / cover no-repeat !important;
  border-bottom: 1px solid rgba(224, 140, 96, 0.45) !important;
  box-shadow: inset 0 -10px 24px rgba(0, 0, 0, 0.55) !important;
}
#boss-ui .hub-head h2 {
  color: #ffe8c8 !important;
  text-shadow: 0 2px 8px rgba(190, 26, 48, 0.85), 0 1px 2px #000 !important;
  letter-spacing: 0.6px;
}
#boss-ui .hub-seal {
  background: linear-gradient(180deg, #b81d32, #630a18) !important;
  border: 1px solid #f4c678 !important;
  color: #fff2d6 !important;
  box-shadow: 0 0 12px rgba(210, 34, 58, 0.65) !important;
}
#boss-ui .res-chip {
  background: rgba(20, 10, 24, 0.86) !important;
  border: 1px solid rgba(236, 184, 102, 0.55) !important;
  color: #ffe49c !important;
}

/* Blood-chain demonic trim right under header */
#boss-ui .bs-chain-trim {
  height: 15px;
  width: 100%;
  flex: none;
  background:
    linear-gradient(90deg, #120918 0%, transparent 10%, transparent 90%, #120918 100%),
    url('../assets/ui/boss_chain.png') center / auto 100% repeat-x;
  opacity: 0.92;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.85));
  border-bottom: 1px solid rgba(168, 46, 62, 0.35);
}

/* Sidebar */
#boss-ui .pv-sidebar {
  background: linear-gradient(180deg, rgba(16, 8, 24, 0.95), rgba(10, 5, 16, 0.96)) !important;
  border-right: 1px solid rgba(168, 56, 78, 0.36) !important;
}
#boss-ui button.pv-nav-btn:not(.hub-close-x) {
  background: linear-gradient(180deg, rgba(32, 18, 42, 0.9), rgba(20, 11, 28, 0.94)) !important;
  border: 1px solid rgba(146, 88, 128, 0.42) !important;
  color: #d6c8e4 !important;
  box-shadow: inset 0 1px 0 rgba(255, 220, 200, 0.08) !important;
}
#boss-ui button.pv-nav-btn:not(.hub-close-x) b { color: #f6e6ff !important; }
#boss-ui button.pv-nav-btn:not(.hub-close-x) em { color: #a794bc !important; }
#boss-ui button.pv-nav-btn:not(.hub-close-x):hover {
  border-color: rgba(230, 110, 118, 0.68) !important;
  background: linear-gradient(180deg, rgba(56, 22, 46, 0.92), rgba(32, 12, 28, 0.95)) !important;
}
#boss-ui button.pv-nav-btn.on:not(.hub-close-x) {
  background: linear-gradient(180deg, rgba(112, 22, 42, 0.94), rgba(58, 12, 26, 0.96)) !important;
  border: 1.5px solid #e6a862 !important;
  box-shadow: 0 0 16px rgba(196, 36, 64, 0.45), inset 0 0 12px rgba(255, 186, 110, 0.16) !important;
}
#boss-ui button.pv-nav-btn.on:not(.hub-close-x) b { color: #ffebc4 !important; }
#boss-ui button.pv-nav-btn.on:not(.hub-close-x) em { color: #f0b8a8 !important; }

/* Body & Section Titles */
#boss-ui .bs-body {
  background: transparent !important;
}
#boss-ui .bs-sec-title {
  color: #f4c886 !important;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
  border-bottom: 1px solid rgba(186, 66, 86, 0.32);
  padding-bottom: 4px;
  letter-spacing: 0.5px;
}

/* Event Schedule Bar */
#boss-ui .bs-event-bar {
  background: linear-gradient(90deg, rgba(28, 14, 40, 0.92), rgba(18, 10, 28, 0.94)) !important;
  border: 1px solid rgba(176, 84, 120, 0.5) !important;
  color: #e4d6f4 !important;
  box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.45);
}
#boss-ui .bs-event-bar.is-open {
  background: linear-gradient(90deg, rgba(108, 18, 34, 0.94), rgba(54, 12, 26, 0.95)) !important;
  border-color: #f5b662 !important;
  color: #fff2d4 !important;
  box-shadow: 0 0 14px rgba(255, 92, 64, 0.45), inset 0 0 10px rgba(255, 198, 120, 0.2);
}
#boss-ui .bs-event-bar b { color: #ffd982 !important; }

/* Boss Stage with Abyssal Sky + Rotating Seal + Demonic Altar */
#boss-ui .bs-stage-wrap {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 78%, rgba(162, 34, 86, 0.34), transparent 62%),
    linear-gradient(180deg, rgba(8, 10, 18, 0.42) 0%, rgba(18, 8, 24, 0.78) 72%, rgba(10, 4, 16, 0.96) 100%),
    url('../assets/ui/boss_sky.png') center top / cover no-repeat !important;
  border: 1.5px solid rgba(196, 78, 96, 0.65) !important;
  box-shadow:
    inset 0 0 32px rgba(0, 0, 0, 0.82),
    inset 0 0 0 1px rgba(255, 190, 120, 0.18),
    0 8px 24px rgba(0, 0, 0, 0.62) !important;
  border-radius: 8px;
}
#boss-ui .bs-stage-seal {
  position: absolute;
  left: 50%;
  top: 48%;
  width: 210px;
  height: 210px;
  background: url('../assets/ui/boss_seal.png') center / contain no-repeat;
  opacity: 0.22;
  pointer-events: none;
  z-index: 0;
  transform: translate(-50%, -50%);
}
#boss-ui .bs-stage-altar {
  position: absolute;
  left: 50%;
  bottom: -4px;
  transform: translateX(-50%);
  width: 78%;
  max-width: 310px;
  height: 82px;
  background: url('../assets/ui/boss_altar.png') center bottom / contain no-repeat;
  opacity: 0.78;
  pointer-events: none;
  z-index: 0;
}
#boss-ui .bs-stage-wrap .bs-canvas {
  position: relative;
  z-index: 1;
}
#boss-ui .bs-stage-head,
#boss-ui .bs-mode-pill,
#boss-ui .bs-best {
  z-index: 2;
}
#boss-ui .bs-stage-head h2 {
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.95), 0 0 14px var(--bc, #ff5a3a) !important;
}
#boss-ui .bs-stage-head p {
  color: #d4c4e4 !important;
}
#boss-ui .bs-tag {
  background: rgba(24, 10, 32, 0.85) !important;
  border: 1px solid rgba(232, 168, 108, 0.5) !important;
  color: #ffe2a8 !important;
}
#boss-ui .bs-mode-pill {
  background: rgba(16, 10, 26, 0.84) !important;
  border: 1px solid rgba(120, 232, 200, 0.45) !important;
  color: #a6f6e0 !important;
}

/* Dark Eerie Cards (HP box, Milestones, Foot bar, Solo cards, Rank tiers) */
#boss-ui button.bs-pick:not(.hub-close-x),
#boss-ui button.bs-tier:not(.hub-close-x),
#boss-ui .bs-pick,
#boss-ui .bs-tip,
#boss-ui .bs-skills span,
#boss-ui .bs-tier,
#boss-ui .bs-foot-bar,
#boss-ui .bs-world-act,
#boss-ui .bs-rew,
#boss-ui .bs-hp-box,
#boss-ui .bs-ms,
#boss-ui .bs-board-wrap,
#boss-ui .bs-rk-tier {
  background: linear-gradient(180deg, rgba(28, 16, 38, 0.92), rgba(18, 10, 26, 0.96)) !important;
  border: 1px solid rgba(156, 68, 94, 0.45) !important;
  color: #ebe0f5 !important;
  box-shadow: inset 0 1px 0 rgba(255, 200, 180, 0.07) !important;
}
#boss-ui button.bs-pick:not(.hub-close-x):hover,
#boss-ui button.bs-tier:not(.hub-close-x):hover {
  background: linear-gradient(180deg, rgba(54, 22, 46, 0.94), rgba(32, 12, 28, 0.96)) !important;
  border-color: rgba(232, 122, 126, 0.72) !important;
}
#boss-ui button.bs-tier:not(.hub-close-x):disabled {
  background: linear-gradient(180deg, rgba(22, 14, 30, 0.78), rgba(14, 8, 20, 0.85)) !important;
  border-color: rgba(112, 74, 102, 0.35) !important;
  opacity: 0.72;
  filter: none;
}
#boss-ui .bs-hp-box {
  border-color: rgba(204, 68, 84, 0.56) !important;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(148, 22, 42, 0.22), transparent 70%),
    linear-gradient(180deg, rgba(26, 12, 32, 0.94), rgba(14, 8, 22, 0.96)) !important;
}
#boss-ui .bs-hp-head {
  color: #f4d8c8 !important;
}
#boss-ui .bs-hp-head b {
  color: #ff9c78 !important;
  text-shadow: 0 0 8px rgba(255, 64, 48, 0.5);
}
#boss-ui .bs-hp-bar {
  background: #140812 !important;
  border: 1px solid rgba(220, 74, 86, 0.65) !important;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.85);
}
#boss-ui .bs-hp-bar i {
  background: linear-gradient(90deg, #7c0818, #d41c2c 55%, #ff6a34) !important;
  box-shadow: 0 0 14px rgba(255, 72, 48, 0.7);
}

/* Milestone Chests */
#boss-ui .bs-ms {
  border-color: rgba(164, 82, 104, 0.45) !important;
}
#boss-ui .bs-ms b { color: #ffdc96 !important; }
#boss-ui .bs-ms span { color: #ffb86c !important; font-weight: 800; }
#boss-ui .bs-ms em { color: #a998be !important; }
#boss-ui .bs-ms.ready {
  background: linear-gradient(180deg, rgba(124, 28, 42, 0.92), rgba(66, 14, 26, 0.96)) !important;
  border: 1.5px solid #ffd070 !important;
  box-shadow: 0 0 12px rgba(255, 110, 74, 0.55), inset 0 0 8px rgba(255, 200, 120, 0.22);
}
#boss-ui .bs-ms.ready em { color: #ffe89e !important; font-weight: 700; }
#boss-ui .bs-ms.claimed {
  opacity: 0.62;
  border-color: rgba(94, 206, 152, 0.45) !important;
}
#boss-ui .bs-ms.claimed em { color: #7ae6b4 !important; }

/* Text colors inside dark boss UI */
#boss-ui .bs-lore,
#boss-ui .bs-stat-line,
#boss-ui .bs-att-info span,
#boss-ui .bs-board .rk-sub,
#boss-ui .bs-rk-tier span,
#boss-ui .bs-pick-txt em,
#boss-ui .bs-tier span,
#boss-ui .bs-rk-wait,
#boss-ui .bs-tip {
  color: #bcaeCE !important;
}
#boss-ui .bs-att-info em { color: #9c8ab4 !important; }
#boss-ui .bs-att-info b,
#boss-ui .bs-stat-line b,
#boss-ui .bs-pick-txt b,
#boss-ui .bs-tier b,
#boss-ui .bs-rk-tier b {
  color: #ffebc6 !important;
}
#boss-ui .bs-el {
  background: rgba(42, 18, 52, 0.9) !important;
  border: 1px solid rgba(206, 114, 144, 0.42) !important;
  color: #f4d4ff !important;
}
#boss-ui .bs-rew.gold {
  border-color: rgba(246, 204, 102, 0.65) !important;
  color: #ffe28c !important;
}
#boss-ui .bs-rew.purple {
  border-color: rgba(188, 114, 255, 0.62) !important;
  color: #dfb4ff !important;
}

/* Selected Solo Boss / Tier / My Rank Tier */
#boss-ui button.bs-pick.on:not(.hub-close-x),
#boss-ui button.bs-tier.on:not(.hub-close-x),
#boss-ui .bs-rk-tier.mine {
  background: linear-gradient(180deg, rgba(102, 26, 48, 0.92), rgba(52, 14, 30, 0.95)) !important;
  border-color: #f2be68 !important;
  box-shadow: 0 0 14px rgba(206, 46, 74, 0.35), inset 0 0 10px rgba(255, 198, 120, 0.14) !important;
  color: #fff2d6 !important;
}
#boss-ui button.bs-pick.on:not(.hub-close-x) {
  border-left: 4px solid var(--bc, #ff6a40) !important;
}
#boss-ui button.bs-tier.on:not(.hub-close-x) span {
  color: #ffd9a0 !important;
}

/* Damage Leaderboard Table */
#boss-ui .bs-board th {
  background: linear-gradient(180deg, #321222, #220b18) !important;
  color: #ffd996 !important;
  border-bottom: 1.5px solid rgba(212, 92, 108, 0.55) !important;
}
#boss-ui .bs-board td {
  color: #efe4f8 !important;
  border-bottom: 1px solid rgba(154, 78, 112, 0.22) !important;
}
#boss-ui .bs-board td.rk { color: #ffcf72 !important; font-weight: 800; }
#boss-ui .bs-board td.num { color: #ff9c78 !important; font-weight: 700; }
#boss-ui .bs-board tr.me td {
  background: rgba(176, 36, 68, 0.26) !important;
}
#boss-ui .bs-board .rk-bar {
  background: rgba(255, 255, 255, 0.1) !important;
}
#boss-ui .bs-board .rk-bar i {
  background: linear-gradient(90deg, #c82238, #ff7a42) !important;
}
#boss-ui .bs-empty {
  color: #a996be !important;
}

/* Pending Rewards Row */
#boss-ui .bs-pending-row {
  background: linear-gradient(90deg, rgba(96, 26, 38, 0.9), rgba(58, 18, 28, 0.94)) !important;
  border: 1px solid #f4c266 !important;
  color: #fff2d0 !important;
}

/* Action Buttons — Molten Crimson & Antique Iron */
#boss-ui button.bs-fight-btn:not(.hub-close-x),
#boss-ui button.bs-claim-rk:not(.hub-close-x) {
  background: linear-gradient(180deg, #c42336, #750e1e) !important;
  border: 1.5px solid #f8cc78 !important;
  color: #fff7e2 !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9) !important;
  box-shadow: 0 4px 16px rgba(188, 24, 48, 0.55), inset 0 1px 0 rgba(255, 224, 168, 0.35) !important;
}
#boss-ui button.bs-fight-btn:not(.hub-close-x):hover,
#boss-ui button.bs-claim-rk:not(.hub-close-x):hover {
  background: linear-gradient(180deg, #df2c42, #8e1428) !important;
  box-shadow: 0 0 22px rgba(255, 78, 62, 0.72) !important;
}
#boss-ui button.bs-buy-btn:not(.hub-close-x) {
  background: linear-gradient(180deg, #321c3e, #1e1028) !important;
  border: 1.5px solid rgba(220, 160, 92, 0.65) !important;
  color: #ffe2a6 !important;
}
#boss-ui button.bs-buy-btn:not(.hub-close-x):hover {
  background: linear-gradient(180deg, #482658, #2c163a) !important;
  border-color: #ffd278 !important;
}

/* 4-Tier World Boss Bracket Selector Bar */
#boss-ui .bs-wtier-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
#boss-ui button.bs-wtier:not(.hub-close-x) {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 7px 6px !important;
  border-radius: 7px !important;
  background: linear-gradient(180deg, rgba(28, 15, 38, 0.9), rgba(16, 9, 24, 0.95)) !important;
  border: 1px solid rgba(156, 68, 96, 0.42) !important;
  color: #cdbde0 !important;
  cursor: pointer;
}
#boss-ui button.bs-wtier:not(.hub-close-x) b {
  font-size: 13px;
  color: #f4e2ff !important;
}
#boss-ui button.bs-wtier:not(.hub-close-x) span {
  font-size: 10.5px;
  color: #a896be !important;
  margin-top: 2px;
}
#boss-ui button.bs-wtier.mine:not(.hub-close-x) {
  border-color: rgba(242, 190, 104, 0.65) !important;
}
#boss-ui button.bs-wtier.on:not(.hub-close-x) {
  background: linear-gradient(180deg, rgba(116, 24, 44, 0.95), rgba(58, 12, 26, 0.96)) !important;
  border: 1.5px solid #f6c872 !important;
  box-shadow: 0 0 14px rgba(212, 38, 68, 0.45), inset 0 0 10px rgba(255, 200, 120, 0.16) !important;
}
#boss-ui button.bs-wtier.on:not(.hub-close-x) b {
  color: #ffefc8 !important;
}
#boss-ui button.bs-wtier.on:not(.hub-close-x) span {
  color: #ffd8a2 !important;
}
@media (max-width: 640px) {
  #boss-ui .bs-wtier-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Compact vertical layout for World Boss tab — eliminate dead gaps & outer scrollbar */
#boss-ui .bs-body {
  padding: 10px 14px !important;
}
#boss-ui .bs-wtier-bar {
  margin-bottom: 6px;
  gap: 6px;
}
#boss-ui button.bs-wtier:not(.hub-close-x) {
  padding: 5px 6px !important;
}
#boss-ui .bs-event-bar {
  padding: 5px 10px !important;
  margin-bottom: 0 !important;
  font-size: 12px !important;
}
#boss-ui .bs-world-grid {
  gap: 10px !important;
  height: auto !important;
  min-height: 0 !important;
  align-items: start;
}
#boss-ui .bs-world-left,
#boss-ui .bs-world-right {
  gap: 7px !important;
  justify-content: flex-start !important;
  min-height: 0 !important;
}
#boss-ui .bs-stage-wrap.world {
  height: 192px !important;
  min-height: 176px !important;
}
#boss-ui .bs-hp-box {
  padding: 8px 10px !important;
}
#boss-ui .bs-ms-row {
  gap: 6px !important;
  margin-top: 6px !important;
}
#boss-ui .bs-ms {
  padding: 6px 4px !important;
}
#boss-ui .bs-world-act {
  margin-top: 0 !important;
  padding: 8px 12px !important;
}
#boss-ui .bs-board-wrap {
  min-height: 130px !important;
  max-height: 175px !important;
}
#boss-ui .bs-rk-list {
  max-height: 152px !important;
}
#boss-ui .bs-rk-foot {
  margin-top: 0 !important;
  padding-top: 2px !important;
}
/* Base rarity pill on Công Pháp cards & detail modal (N/R/SR/SSR/UR synced 1-to-1 with realm) */
.cp-rar {
  display: inline-block;
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 5px;
  letter-spacing: 0.2px;
  border: 1px solid rgba(110, 96, 80, 0.35);
  background: rgba(120, 112, 102, 0.14);
  color: #5b554c;
}
.cp-rar.r1 { background: rgba(45, 130, 210, 0.14); border-color: rgba(45, 130, 210, 0.45); color: #1964a8; }
.cp-rar.r2 { background: rgba(148, 72, 208, 0.14); border-color: rgba(148, 72, 208, 0.45); color: #752ca8; }
.cp-rar.r3 { background: rgba(212, 148, 22, 0.16); border-color: rgba(204, 136, 12, 0.52); color: #9a6006; }
.cp-rar.r4 { background: rgba(214, 52, 52, 0.15); border-color: rgba(204, 44, 44, 0.52); color: #b51f1f; }
/* Tiên Trang & Linh Thú Hub windows */
.tt-orb {
  display: inline-block;
  width: 46px;
  height: 46px;
  min-width: 46px;
  border-radius: 50%;
  flex: none;
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 12px var(--c, #58f5c8), inset 0 0 10px rgba(255, 255, 255, 0.55);
  background: radial-gradient(circle at 35% 35%, #fff, var(--c, #58f5c8) 65%, rgba(0, 0, 0, 0.25));
}
.tt-orb.sm { width: 52px; height: 52px; min-width: 52px; }
#hubbody .cpslots .cells.cells-1 {
  grid-template-columns: 1fr !important;
}
#hubbody .cpslots .cells .eq.eq-rich {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 12px 14px !important;
  width: 100% !important;
  cursor: pointer;
}
#hubbody .cpslots .cells .eq.eq-rich > img {
  width: 56px !important;
  height: 56px !important;
  object-fit: contain !important;
  flex: none !important;
  background: rgba(180, 152, 108, 0.16);
  border: 1px solid rgba(154, 118, 66, 0.32);
  border-radius: 10px;
  padding: 3px;
}
#hubbody .cpslots .cells .eq.eq-rich .lt-thumb.sm {
  width: 56px !important;
  height: 56px !important;
  border-radius: 10px;
}
#hubbody .cpslots .cells .eq.eq-rich .lt-thumb.sm .gc-sheet {
  width: 50px !important;
  height: 50px !important;
}
#hubbody .cpslots .cells .eq.eq-rich .eq-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
#hubbody .cpslots .cells .eq.eq-rich .eq-info > span {
  order: 0 !important;
  flex: 0 0 auto !important;
  display: flex !important;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-weight: 800;
  font-size: 14.5px;
  color: #4a2a0d;
  line-height: 1.25;
  white-space: normal !important;
  overflow: visible !important;
}
#hubbody .cpslots .cells .eq.eq-rich .eq-info > small {
  order: 1 !important;
  font-size: 12px;
  color: #705232;
  line-height: 1.35;
  white-space: normal;
}
#hubbody .cpslots .cells .eq.eq-rich > button {
  order: 2 !important;
  position: static !important;
  flex: none !important;
  margin-left: auto !important;
}
.lt-thumb {
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 10px;
  background: rgba(180, 152, 108, 0.18);
  border: 1px solid rgba(154, 118, 66, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.lt-thumb.sm { width: 38px; height: 38px; border-radius: 8px; }
.lt-thumb .gc-sheet {
  display: block;
  width: 46px;
  height: 46px;
  background-repeat: no-repeat;
  image-rendering: pixelated;
}
.lt-thumb.sm .gc-sheet { width: 34px; height: 34px; }
.skill.is-unowned { opacity: 0.62; }
.skill.is-unowned:hover { opacity: 0.88; }
.tt-sum {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(240, 224, 188, 0.55);
  border: 1px solid rgba(164, 128, 72, 0.35);
}
.tt-sum h5 { margin: 0 0 6px; font-size: 12px; color: #6e451b; text-transform: uppercase; letter-spacing: 0.4px; }
.tt-sum-list { display: flex; flex-wrap: wrap; gap: 5px; }
.tt-sum-list span { font-size: 11.5px; font-weight: 700; color: #2b5a3c; background: rgba(78, 178, 120, 0.16); border: 1px solid rgba(58, 148, 96, 0.35); padding: 2px 7px; border-radius: 5px; }
.tt-gacha-btn { width: 100%; margin-top: 10px; }

/* ================================================================
 * Outfit Picker Modal inside Đổi Đạo Thân (#create)
 * ================================================================ */
#create button.op-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px !important;
  max-width: 100%;
  min-height: 36px;
}
#create button.op-trigger .op-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
  box-shadow: 0 0 0 1.5px rgba(56, 33, 18, 0.35);
}
#create button.op-trigger .op-cur {
  font-size: 13.5px;
  font-weight: 800;
  color: #3d2210;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}
#create button.op-trigger .op-btn-cta {
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  color: #6b431c;
  background: rgba(255, 252, 240, 0.65);
  border: 1px solid rgba(150, 106, 56, 0.45);
  border-radius: 6px;
  padding: 2px 7px;
  white-space: nowrap;
}
#create .op-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(24, 14, 6, 0.62);
  backdrop-filter: blur(4px);
  box-sizing: border-box;
}
#create .op-modal {
  width: min(880px, 96vw);
  max-height: 86dvh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--cream), var(--cream2));
  border: 3px solid var(--wood-bot);
  border-radius: 14px;
  box-shadow:
    0 18px 48px rgba(24, 12, 4, 0.55),
    inset 0 0 0 2px rgba(232, 190, 94, 0.45);
  overflow: hidden;
}
#create .op-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: linear-gradient(180deg, #f5e5c2, #ead2a0);
  border-bottom: 2px solid rgba(150, 106, 56, 0.45);
}
#create .op-title {
  margin-right: auto;
}
#create .op-title h3 {
  margin: 0;
  font-size: 18px;
  color: #4a270d;
  line-height: 1.2;
}
#create .op-title p {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: #6e4e32;
}
#create .op-filters {
  display: flex;
  gap: 6px;
}
#create .op-filters button {
  padding: 5px 11px !important;
  font-size: 12.5px !important;
  min-height: 30px;
}
#create button.op-close {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  border-radius: 50% !important;
}
#create .op-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px 18px;
  -webkit-overflow-scrolling: touch;
}
#create .op-group {
  margin-bottom: 16px;
}
#create .op-group:last-child {
  margin-bottom: 0;
}
#create .op-ghead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 10px;
  margin-bottom: 10px;
  border-left: 4px solid var(--tc, #c98f28);
  border-radius: 0 8px 8px 0;
  background: linear-gradient(90deg, rgba(160, 120, 62, 0.16), rgba(160, 120, 62, 0.03));
}
#create .op-ghead b {
  font-size: 14px;
  color: var(--tc, #5a3210);
  letter-spacing: 0.2px;
}
#create .op-ghead span {
  font-size: 12px;
  font-weight: 700;
  color: #705032;
}
#create .op-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  gap: 10px;
}
#create button.op-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 10px 8px 9px !important;
  background: linear-gradient(180deg, #fffaf0, #f3e4c3) !important;
  border: 2px solid rgba(164, 124, 68, 0.45) !important;
  border-top: 3px solid var(--tc, #c98f28) !important;
  border-radius: 10px !important;
  box-shadow: 0 2px 6px rgba(62, 36, 14, 0.12) !important;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
#create button.op-card:hover {
  transform: translateY(-2px);
  border-color: var(--tc, #c98f28) !important;
  box-shadow: 0 6px 14px rgba(62, 36, 14, 0.22) !important;
  filter: none;
}
#create button.op-card.is-sel {
  background: linear-gradient(180deg, #fffdf4, #f6e0a8) !important;
  border: 2px solid #1d8a64 !important;
  border-top: 3px solid #1d8a64 !important;
  box-shadow: 0 0 0 2px rgba(29, 138, 100, 0.25), 0 4px 12px rgba(29, 138, 100, 0.22) !important;
}
#create button.op-card.is-lock {
  opacity: 0.72;
  background: linear-gradient(180deg, #f4ece0, #e6d8be) !important;
}
#create button.op-card.is-lock:hover {
  opacity: 0.94;
}
#create button.op-card .op-badge {
  position: absolute;
  top: 5px;
  left: 6px;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  background: var(--tc, #888);
  padding: 1px 5px;
  border-radius: 4px;
  line-height: 1.3;
  letter-spacing: 0.2px;
}
#create button.op-card .op-sel-tag {
  position: absolute;
  top: 5px;
  right: 6px;
  font-size: 9.5px;
  font-weight: 800;
  color: #fff;
  background: #1d8a64;
  padding: 1px 5px;
  border-radius: 4px;
  line-height: 1.3;
}
#create button.op-card .op-lock-ico {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 12px;
  line-height: 1.2;
}
#create button.op-card .op-thumb {
  width: 68px;
  height: 76px;
  margin-top: 12px;
  border-radius: 8px;
  background: radial-gradient(ellipse at 50% 78%, rgba(44, 72, 82, 0.72), rgba(20, 32, 42, 0.92));
  border: 1px solid rgba(164, 128, 72, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: none;
}
#create button.op-card .op-sprite {
  display: block;
  height: 94%;
  max-width: 100%;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
#create button.op-card .op-fallback {
  font-size: 26px;
  color: #f3dfad;
}
#create button.op-card .op-name {
  font-size: 12px;
  font-weight: 800;
  color: #3d2210;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 30px;
}
#create button.op-card .op-meta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #705232;
  line-height: 1.2;
}
#create button.op-card .op-meta i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex: none;
}
#create .op-empty {
  text-align: center;
  padding: 28px 12px;
  color: #705232;
  font-size: 14px;
}
#create .op-tip {
  position: fixed;
  z-index: 60;
  pointer-events: none;
  width: max-content;
  min-width: 220px;
  max-width: min(330px, 90vw);
  padding: 10px 12px;
  border-radius: 10px;
  background: linear-gradient(180deg, #fffaf0, #f3e4c3);
  border: 2px solid var(--wood-bot);
  box-shadow:
    0 12px 28px rgba(24, 12, 4, 0.45),
    inset 0 0 0 1px rgba(232, 190, 94, 0.55);
  color: #382112;
  font-size: 12.5px;
  line-height: 1.4;
}
#create .op-tip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
#create .op-tip-head b {
  font-size: 14px;
  color: #3d2210;
}
#create .op-tip-tier {
  flex: none;
  font-size: 10.5px;
  font-weight: 800;
  color: #fff;
  padding: 2px 6px;
  border-radius: 5px;
  line-height: 1.2;
}
#create .op-tip-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: #6e4e32;
  margin-bottom: 7px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(154, 118, 66, 0.3);
}
#create .op-tip-el {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  color: #4a2a10;
}
#create .op-tip-el i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
#create .op-tip-own {
  color: #1d8a64;
  font-weight: 700;
}
#create .op-tip-lock {
  color: #b85d1a;
  font-weight: 700;
}
#create .op-tip-sec em {
  display: block;
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #7a4b10;
  margin-bottom: 4px;
}
#create .op-tip-sec .trait-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
#create .op-tip-none {
  display: block;
  font-style: italic !important;
  text-transform: none !important;
  font-weight: 400 !important;
  letter-spacing: 0 !important;
  color: #7a5f42 !important;
}
#create .op-tip-hs {
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px dashed rgba(154, 118, 66, 0.35);
  font-size: 12px;
  color: #5c3614;
}
#create .op-tip-hs b {
  color: #1d6e52;
}
@media (max-width: 640px) {
  #create .op-modal {
    max-height: 90dvh;
  }
  #create .op-head {
    padding: 10px 12px;
    gap: 8px;
  }
  #create .op-title h3 {
    font-size: 15.5px;
  }
  #create .op-body {
    padding: 10px 12px 14px;
  }
  #create .op-grid {
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    gap: 8px;
  }
  #create button.op-card .op-thumb {
    width: 58px;
    height: 66px;
  }
  #create button.op-trigger .op-cur {
    max-width: 155px;
  }
}

/* ================================================================
 * Ô VƯỢT CẤP & BẢNG HỌC SKILL VƯỢT CẤP (Công Pháp)
 * ================================================================ */
#hubbody .cpslots .slotrow h4 em {
  font-style: normal;
  font-weight: 600;
  font-size: 11.5px;
  color: #9b5915;
}
#hubbody .cpslots .cells .eq.eq-over {
  position: relative;
  border: 2px dashed #d4882a !important;
  background: linear-gradient(180deg, #fffaf0, #f9e6be) !important;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
#hubbody .cpslots .cells .eq.eq-over:hover {
  border-color: #b85d0b !important;
  box-shadow: 0 3px 8px rgba(184, 93, 11, 0.22) !important;
  transform: translateY(-1px);
}
#hubbody .cpslots .cells .eq.eq-over.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px !important;
  min-height: 58px;
  text-align: center;
  padding: 8px 10px !important;
}
#hubbody .cpslots .cells .eq.eq-over.empty.has-avail {
  border-color: #c86d10 !important;
  background: linear-gradient(180deg, #fff8e4, #f7dca3) !important;
}
#hubbody .cpslots .cells .eq.eq-over.empty.has-avail small {
  color: #9e4708;
  font-weight: 800;
}
#hubbody .cpslots .cells .eq.eq-over .over-plus {
  font-size: 12.5px;
  font-weight: 800;
  color: #9e4708;
  line-height: 1.25;
}
#hubbody .cpslots .cells .eq.eq-over.empty small {
  font-size: 11px;
  font-weight: 600;
  color: #7d5b36;
  line-height: 1.2;
}
#hubbody .cpslots .cells .eq.eq-over.on {
  border-style: solid !important;
  border-color: #cf7d1b !important;
  background: linear-gradient(180deg, #fffdf4, #f7e2b2) !important;
  box-shadow: 0 2px 0 rgba(145, 76, 12, 0.24), inset 0 0 0 1px rgba(255, 255, 255, 0.65) !important;
}
#hubbody .cpslots .cells .eq.eq-over .over-pill {
  font-style: normal;
  font-size: 10.5px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 5px;
  background: #fff1d0;
  border: 1px solid #d88b28;
  color: #8f4206;
  white-space: nowrap;
}
#hubbody .cpslots .cells .eq.eq-over .over-acts {
  order: 2;
  margin-left: auto;
  display: inline-flex;
  gap: 4px;
}
#hubbody .cpslots .cells .eq.eq-over .over-acts button {
  order: 0;
  margin-left: 0;
  padding: 3px 7px !important;
  font-size: 11.5px !important;
}
#hubbody .cpslots .cells .eq.is-muted-over {
  opacity: 0.68;
}
#hubbody .cpslots .cells .eq.is-muted-over span em {
  font-style: normal;
  font-weight: 600;
  font-size: 11px;
  color: #9a5b25;
}
#hubbody .skill .cp-acts {
  flex: 0 0 132px !important;
}
#hubbody .cp-acts .tag.tag-over,
.over-modal .tag.tag-over {
  background: linear-gradient(180deg, #ffe7b3, #f3c46b) !important;
  border: 1px solid #c67c18 !important;
  color: #6e3300 !important;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  text-align: center;
  white-space: nowrap;
}
#hubbody .cp-acts button.btn-over {
  background: linear-gradient(180deg, #fff3d1, #f3cf82) !important;
  border-color: #c78121 !important;
  color: #693204 !important;
  font-weight: 800;
  padding: 6px 8px !important;
  font-size: 12.5px !important;
}
#hubbody .cp-acts button.btn-over:hover {
  background: linear-gradient(180deg, #ffeab3, #eebf5e) !important;
}

/* Modal Bảng Học Skill Vượt Cấp */
.hubmodal .box.over-modal {
  max-width: 780px;
  width: calc(100vw - 24px);
  max-height: calc(100vh - 28px);
  max-height: calc(100dvh - 28px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  box-sizing: border-box;
  overflow: hidden;
}
.over-modal .over-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(180, 134, 72, 0.35);
  padding-bottom: 8px;
}
.over-modal .over-head h2 {
  margin: 0 0 4px !important;
  font-size: 19px;
}
.over-modal .over-sub {
  margin: 0 !important;
  font-size: 13px;
  color: #6b4928 !important;
}
.over-modal .over-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.over-modal .over-bar select,
.over-modal .over-bar input[type="search"] {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1.5px solid #c9a366;
  background: #fffdf7;
  color: #3d2510;
  font-size: 13px;
  font-family: inherit;
}
.over-modal .over-bar input[type="search"] {
  flex: 1 1 180px;
  min-width: 140px;
}
.over-modal .over-cnt {
  font-size: 12.5px;
  font-weight: 700;
  color: #7a5530;
  margin-left: auto;
}
.over-modal .over-list {
  flex: 1 1 auto;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
  min-height: 120px;
  -webkit-overflow-scrolling: touch;
}
.over-modal .skill.over-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  background: linear-gradient(180deg, #fffdf6, #f4e8cd);
  border: 2px solid #c9a366;
  border-radius: 10px;
}
.over-modal .skill.over-card.is-cur {
  border-color: #cf7d1b;
  background: linear-gradient(180deg, #fffdf2, #f8e3b4);
}
.over-modal .skill.over-card > img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  flex-shrink: 0;
}
.over-modal .skill.over-card > div:nth-child(2) {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.over-modal .skill.over-card h3,
.over-modal .skill.over-card p {
  margin: 0 !important;
}
.over-modal .skill.over-card h3 {
  font-size: 15px;
  color: #3f220d;
}
.over-modal .skill.over-card .cp-acts {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  flex-shrink: 0;
}
.over-modal .over-empty {
  padding: 18px 12px;
  text-align: center;
}
@media (max-width: 640px) {
  .over-modal .skill.over-card {
    flex-wrap: wrap;
  }
  .over-modal .skill.over-card .cp-acts {
    flex-direction: row;
    width: 100%;
    justify-content: flex-end;
  }
}

/* ================================================================
 * WORLD CHAT DOCK IN MAP RUNS (body.in-run #chat-dock)
 * Góc phải dưới như ngoài sảnh, xếp ngay TRÊN nút Về thành (#field-recall, css/field.css) để không che số nguyên liệu
 * nhặt được ở góc trái (góp ý người chơi 28/11/2026). Mở ra thì khung chat mọc lên trên.
 * ================================================================ */
body.in-run #chat-dock {
  left: auto !important;
  right: max(18px, env(safe-area-inset-right)) !important;
  bottom: max(80px, calc(env(safe-area-inset-bottom) + 74px)) !important;
  z-index: 14;
}
body.in-run #chat-dock .cd-toggle {
  padding: 6px 12px;
  font-size: 12.5px;
  background: rgba(34, 24, 16, 0.84);
  border: 1.5px solid rgba(230, 190, 96, 0.72);
  color: #fff6dc;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}
body.in-run #chat-dock .cd-toggle:hover {
  background: rgba(58, 38, 22, 0.94);
  border-color: #ffe08a;
}
body.in-run #chat-dock.open {
  width: min(330px, calc(100vw - 24px));
  height: min(230px, calc(100dvh - 140px));
  background: rgba(252, 245, 227, 0.92);
  z-index: 25;
}
body.in-run:has(#overlay:not(.hidden)) #chat-dock {
  display: none !important;
}
@media (max-width: 760px), (max-height: 520px) {
  body.in-run #chat-dock {
    left: auto !important;
    right: max(10px, env(safe-area-inset-right)) !important;
    bottom: max(160px, calc(env(safe-area-inset-bottom) + 154px)) !important; /* trên #field-recall (bottom 116px) */
  }
  body.in-run #chat-dock .cd-toggle {
    padding: 4px 9px;
    font-size: 11px;
    border-radius: 8px;
  }
  body.in-run #chat-dock.open {
    width: min(300px, calc(100vw - 16px));
    height: min(195px, calc(100dvh - 54px));
    z-index: 35;
  }
}

/* ================================================================
 * Tàng Kinh Các · Công Pháp v2 (2026-11-28): two independent scroll panes,
 * fixed filter bar (no sticky gap), compact one-row skill cards.
 * ================================================================ */
#hub .win-cpx #hubbody {
  display: flex;
  flex-direction: column;
  overflow: hidden !important;
  padding: 14px 18px 16px !important;
}
.win-cpx #hubbody .cp {
  flex: 1 1 auto;
  min-height: 0;
  display: grid !important;
  grid-template-columns: minmax(240px, 0.62fr) minmax(0, 1.38fr);
  gap: 14px !important;
}
/* slot tabs on one line: compact chips, fall back to a sideways scroll if the window is very narrow */
.win-cpx #hubbody .cpf.cpf-slot {
  flex-wrap: nowrap !important;
  overflow-x: auto;
  scrollbar-width: none;
  gap: 4px !important;
  padding: 2px 4px 4px 1px;
}
.win-cpx #hubbody .cpf.cpf-slot::-webkit-scrollbar {
  display: none;
}
.win-cpx #hubbody .cpf.cpf-slot button {
  padding: 4px 7px !important;
  font-size: 12.5px !important;
  border-radius: 8px;
}
.win-cpx #hubbody .cpf.cpf-slot button em {
  margin-left: 2px;
  font-size: 11px;
}
.win-cpx #hubbody .cpslots .cells {
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)) !important;
}
.win-cpx #hubbody .cpslots .cells .eq.eq-over.empty {
  padding: 8px 6px !important;
}
.win-cpx #hubbody .cpslots .cells .eq.eq-over .over-plus {
  font-size: 12px;
  white-space: nowrap;
}
.win-cpx #hubbody .cpslots .cells .eq.eq-over.empty small {
  font-size: 10.5px;
}
@media (max-width: 1060px) {
  #hub .win-cpx #hubbody .cpf.cpf-slot button {
    padding: 4px 5px !important;
    font-size: 11.5px !important;
  }
}
@media (max-width: 1200px) {
  .win-cpx #hubbody .cp {
    grid-template-columns: minmax(220px, 0.56fr) minmax(0, 1.44fr);
  }
  .win-cpx #hubbody .cpf.cpf-slot button {
    padding: 4px 6px !important;
    font-size: 12px !important;
  }
}
.win-cpx #hubbody .cp .cpslots {
  min-width: 0 !important;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.win-cpx #hubbody .cp .learned {
  min-width: 0 !important;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0 !important;
  padding: 12px 12px 0;
  background: rgba(255, 250, 236, 0.55);
  border: 2px solid #d6b67c;
  border-radius: 12px;
}
/* the bar sits outside the scrolling list, so nothing can peek above it */
.win-cpx #hubbody .cp .cpbar {
  position: static;
  margin: 0;
  padding: 0 2px 10px;
  background: none;
  border-bottom: 1.5px solid rgba(201, 163, 102, 0.45);
}
#hubbody .cp-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 4px 12px 0;
}
#hubbody .cp-list > .empty {
  margin: 18px 0;
  text-align: center;
  opacity: 0.7;
}
#hubbody .cp-group {
  position: sticky;
  top: -8px;
  z-index: 1;
  padding: 4px 2px;
  background: #fcf5e6;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0 0;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #8a5a2b;
}
#hubbody .cp-group:first-child {
  margin-top: 0;
}
#hubbody .cp-group::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(201, 163, 102, 0.5);
}
#hubbody .cp-group em {
  font-style: normal;
  font-size: 11px;
  padding: 0 6px;
  border-radius: 99px;
  background: rgba(201, 163, 102, 0.25);
  color: #6b4320;
}

/* compact card */
#hubbody .skill.cpc {
  display: grid !important;
  grid-template-columns: 40px minmax(0, 1fr) 92px auto;
  align-items: center !important;
  gap: 12px !important;
  padding: 8px 10px !important;
  border-radius: 10px;
}
#hubbody .skill.cpc.is-on {
  border-color: #48a678 !important;
  box-shadow: inset 3px 0 0 #48a678;
}
#hubbody .skill.cpc > img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  image-rendering: pixelated;
}
#hubbody .skill.cpc .cpc-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
#hubbody .skill.cpc h3 {
  font-size: 15px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#hubbody .skill.cpc .cp-badges {
  gap: 4px;
  margin: 0;
}
#hubbody .skill.cpc .cp-badges > i,
#hubbody .skill.cpc .cp-badges .school-chip {
  margin: 0 !important;
  font-size: 11px !important;
  padding: 0 6px !important;
  line-height: 1.45 !important;
}
#hubbody .cpc-prog {
  position: relative;
  display: block;
  height: 16px;
  border-radius: 99px;
  background: rgba(120, 96, 66, 0.16);
  border: 1px solid rgba(160, 124, 72, 0.38);
  overflow: hidden;
}
#hubbody .cpc-prog > i {
  position: absolute;
  inset: 0 auto 0 0;
  margin: 0 !important;
  border-radius: 99px;
  background: linear-gradient(90deg, #8fa3bc, #c9d6e6);
}
#hubbody .cpc-prog.g1 > i { background: linear-gradient(90deg, #3da4e8, #7fc8ff); }
#hubbody .cpc-prog.g2 > i { background: linear-gradient(90deg, #b565e8, #e7b0ff); }
#hubbody .cpc-prog.g3 > i,
#hubbody .cpc-prog.g4 > i,
#hubbody .cpc-prog.max > i { background: linear-gradient(90deg, #e5a524, #ffe184); }
#hubbody .cpc-prog > b {
  position: relative;
  display: block;
  text-align: center;
  font-size: 11px;
  line-height: 14px;
  color: #4f2a10;
}
#hubbody .skill.cpc .cp-acts {
  flex: none !important;
  display: block;
  width: 104px;
}
#hubbody .skill.cpc .cp-acts button {
  width: 100%;
  padding: 6px 8px !important;
  font-size: 13px !important;
}
#hubbody .skill.cpc .cp-acts button.cp-on {
  background: rgba(56, 163, 109, 0.14) !important;
  border-color: #48a678 !important;
  color: #1f6b46 !important;
}
#hubbody .skill.cpc .cp-acts button.cp-on.over {
  background: linear-gradient(180deg, #ffe7b3, #f3c46b) !important;
  border-color: #c67c18 !important;
  color: #6e3300 !important;
}

/* narrow / short screens: back to one scroll for the whole window */
@media (max-width: 720px), (max-height: 520px) {
  #hub .win-cpx #hubbody {
    display: block;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 10px 12px 14px !important;
  }
  .win-cpx #hubbody .cp {
    display: flex !important;
    flex-direction: column;
    gap: 12px !important;
  }
  .win-cpx #hubbody .cp .cpslots,
  #hubbody .cp-list {
    overflow: visible;
  }
  .win-cpx #hubbody .cp > .cpslots,
  .win-cpx #hubbody .cp > .learned {
    flex: none !important;
    min-height: auto;
  }
  #hubbody .cp-group {
    position: static;
  }
  .win-cpx #hubbody .cp .cpbar {
    position: sticky;
    top: -10px;
    z-index: 2;
    margin: -12px -12px 0;
    padding: 12px 12px 10px;
    background: #fbf3e1;
    border-radius: 12px 12px 0 0;
  }
  #hubbody .skill.cpc {
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 8px !important;
  }
  #hubbody .skill.cpc > img {
    width: 36px;
    height: 36px;
    align-self: center;
  }
  #hubbody .skill.cpc .cpc-prog {
    grid-column: 2 / 4;
    grid-row: 2;
  }
  #hubbody .skill.cpc .cp-acts {
    flex-direction: column;
    width: 92px;
  }
}

/* ================================================================
 * Vượt cấp v2 (2026-11-28): lightning mark (assets/ui/ico_vuotcap.png),
 * over slot looks like a normal slot + corner badge, compact pick modal.
 * ================================================================ */
img.ov-ico {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  object-fit: contain;
  vertical-align: -0.2em;
  margin-right: 3px;
  pointer-events: none;
  filter: drop-shadow(0 1px 0 rgba(90, 40, 0, 0.35));
}
/* --- slot cell: equipped --- */
#hubbody .cpslots .cells .eq.eq-over.on {
  border: 2px solid #d99a2b !important;
  background: linear-gradient(180deg, #fffaea, #f8e5b6) !important;
  box-shadow: 0 0 0 1px rgba(255, 236, 170, 0.9) inset, 0 2px 8px rgba(214, 150, 40, 0.28) !important;
}
#hubbody .cpslots .cells .eq.eq-over.on > img:not(.ov-ico) {
  width: 32px;
  height: 32px;
  object-fit: contain;
}
#hubbody .cpslots .cells .eq.eq-over img.ov-badge {
  position: absolute;
  top: -7px;
  left: -7px;
  width: 22px;
  height: 22px;
  margin: 0;
  z-index: 1;
  filter: drop-shadow(0 1px 1px rgba(90, 40, 0, 0.45));
}
/* --- slot cell: empty --- */
#hubbody .cpslots .cells .eq.eq-over.empty {
  border: 2px dashed rgba(201, 140, 50, 0.55) !important;
  background: rgba(255, 248, 230, 0.6) !important;
  min-height: 58px;
  gap: 1px !important;
}
#hubbody .cpslots .cells .eq.eq-over.empty.has-avail {
  border-color: #d08a2a !important;
  background: linear-gradient(180deg, #fff9e8, #fbe9bf) !important;
}
#hubbody .cpslots .cells .eq.eq-over .over-plus {
  display: inline-flex;
  align-items: center;
  font-size: 13px !important;
  color: #9e4708;
}
#hubbody .cpslots .cells .eq.eq-over .over-plus img.ov-ico {
  width: 18px;
  height: 18px;
}
#hubbody .cpslots .cells .eq.eq-over.empty:not(.has-avail) {
  opacity: 0.75;
}
#hubbody .cpslots .cells .eq.eq-over.empty:not(.has-avail) .over-plus {
  color: #8a6a45;
}
#hubbody .cpslots .cells .eq.eq-over.empty:not(.has-avail) .over-plus img.ov-ico {
  filter: grayscale(1) opacity(0.6);
}
/* list buttons */
#hubbody .skill.cpc .cp-acts button img.ov-ico {
  width: 15px;
  height: 15px;
}

/* --- pick modal --- */
.hubmodal .box.over-modal {
  max-width: 720px;
}
.over-modal .over-head h2 {
  display: flex;
  align-items: center;
  gap: 6px;
}
.over-modal .over-head h2 img.ov-h {
  width: 26px;
  height: 26px;
  margin: 0;
}
.over-modal .over-sub {
  font-size: 12.5px;
}
.over-modal .over-list {
  gap: 6px;
}
.over-modal .ovc {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 112px;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border: 2px solid #d6b67c;
  border-radius: 10px;
  background: linear-gradient(180deg, #fffdf6, #f6ead0);
}
.over-modal .ovc.can-det {
  cursor: pointer;
}
.over-modal .ovc.can-det:hover {
  border-color: #b5823c;
}
.over-modal .ovc.is-cur {
  border-color: #d99a2b;
  background: linear-gradient(180deg, #fffaea, #f8e5b6);
  box-shadow: inset 3px 0 0 #d99a2b;
}
.over-modal .ovc > img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(6, 10, 16, 0.7);
  image-rendering: pixelated;
}
.over-modal .ovc-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.hubmodal .box.over-modal .ovc-main h3 {
  margin: 0 !important;
  font-size: 15px;
  line-height: 1.2;
  color: #3f220d;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.over-modal .ovc .cp-badges {
  gap: 4px;
  margin: 0;
}
.over-modal .ovc .cp-badges > i,
.over-modal .ovc .cp-badges .school-chip {
  margin: 0 !important;
  font-size: 11px !important;
  padding: 0 6px !important;
  line-height: 1.45 !important;
}
.hubmodal .box.over-modal .ovc-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 10px;
  margin: 0 !important;
  font-size: 12px;
  color: #7a5a3a;
}
.over-modal .ovc-facts b {
  color: #6b300a;
}
.over-modal .ovc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
  padding: 7px 8px !important;
  font-size: 13px !important;
  font-weight: 800;
  white-space: nowrap;
  background: linear-gradient(180deg, #fff3d1, #f3cf82) !important;
  border: 2px solid #c78121 !important;
  color: #693204 !important;
  border-radius: 8px;
}
.over-modal .ovc-btn:hover {
  background: linear-gradient(180deg, #ffeab3, #eebf5e) !important;
}
.over-modal .ovc-btn.is-cur {
  background: rgba(56, 163, 109, 0.14) !important;
  border-color: #48a678 !important;
  color: #1f6b46 !important;
}
.over-modal .ovc-btn img.ov-ico {
  width: 16px;
  height: 16px;
}
@media (max-width: 560px) {
  .over-modal .ovc {
    grid-template-columns: 38px minmax(0, 1fr) 88px;
    gap: 8px;
  }
  .over-modal .ovc > img {
    width: 38px;
    height: 38px;
  }
}

/* ---------- Game logo (loading + login) ---------- */
#loading { flex-direction: column; gap: 14px; }
#loading .load-logo { width: 128px; height: 128px; border-radius: 50%; box-shadow: 0 6px 24px rgba(40, 20, 60, 0.45); }
#auth .auth-logo { display: block; width: 96px; height: 96px; margin: 0 auto 6px; border-radius: 50%; box-shadow: 0 4px 16px rgba(40, 20, 60, 0.4); image-rendering: auto; }

/* ================================================================
 * TÔNG MÔN (#sect-ui) — js/ui/sect.js (khung dùng chung với #social-ui)
 * ================================================================ */
#sect-ui .hub-win { display: flex; flex-direction: column; }
#sect-ui .so-tabs { flex-wrap: wrap; }
.sc-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 8px; }
.sc-chip { padding: 1px 7px; border-radius: 9px; background: #e3f2df; border: 1px solid #8cbf7f; color: #2c5a22; font-size: 11.5px; font-weight: 700; }
.sc-chip.full { background: #fbe2d4; border-color: #d48a5c; color: #7a3410; }
.sc-chip.outer { background: #ece7dc; border-color: #b9a88a; color: #5d4a33; }
.sc-chip i { font-style: normal; color: #8a4fc4; }
.sc-sect .so-who em { white-space: normal; }
.sc-mine { color: #2f7a4f !important; }
.sc-warn { color: #b0461b; }
.sc-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.sc-head h3 { margin: 0; color: #4a250d; font-size: 20px; }
.sc-head span { color: #6f523a; }
.sc-notice { margin: 4px 0 8px; padding: 8px 12px; background: #fffaf0; border: 1px dashed #c9a366; border-radius: 8px; color: #4f2a10; }
.sc-st { flex-shrink: 0; min-width: 76px; text-align: center; padding: 2px 6px; border-radius: 6px; font-size: 11.5px; font-weight: 800; color: #fff; background: #3f9a63; }
.sc-st.khach { background: #8a4fc4; }
.sc-st.ngoai { background: #9b8b70; }
.sc-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.sc-sp { flex: 1; }
.sc-open { color: #4f2a10; font-size: 13px; }
.so-btn.danger { background: linear-gradient(180deg, #ef7b6c, #c94736); color: #fff; border-color: #8c2a1d; }
.so-btn.sm { padding: 2px 8px; font-size: 12px; }
.so-btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.sc-rules { margin-top: 12px; padding: 10px 14px; background: #fffaf0; border: 2px solid #e2c98f; border-radius: 10px; color: #4f2a10; line-height: 1.5; font-size: 13.5px; }
.sc-rules p { margin: 4px 0; }
.sc-log p { margin: 4px 0; color: #4f2a10; }
.sc-log small { color: #8a6c4c; margin-right: 6px; }
.sc-lv { margin: 4px 0 8px; padding: 8px 12px; background: #f3f8ec; border: 1px solid #9cc28a; border-radius: 8px; color: #33431f; display: flex; flex-direction: column; gap: 4px; }
.sc-lv small { color: #5e6b4c; }
.sc-bar { display: inline-block; vertical-align: middle; width: 140px; height: 8px; margin: 0 8px; background: #d9e3cd; border-radius: 4px; overflow: hidden; }
.sc-bar i { display: block; height: 100%; background: linear-gradient(90deg, #5fbf74, #2f9a53); }
.sc-locked { opacity: 0.6; }
.sc-donate { margin-top: 12px; }
.sc-donate input { max-width: 120px; }
.sc-h4 { margin: 14px 0 6px; color: #4a250d; font-size: 15px; }
.sc-note { margin: 10px 0 0; color: #6f523a; font-size: 13px; line-height: 1.5; }
.sc-rank { min-width: 34px; font-weight: 800; color: #8a5a20; }
.sc-bar.boss { width: 200px; }
.sc-bar.boss i { background: linear-gradient(90deg, #e0564a, #b22a20); }
.sc-war { margin: 6px 0 10px; padding: 8px 12px; background: #fffaf0; border: 1px solid #d9bf87; border-radius: 8px; color: #4f2a10; }
.sc-duels { width: 100%; margin-top: 6px; border-collapse: collapse; font-size: 12.5px; }
.sc-duels th, .sc-duels td { padding: 3px 6px; border-bottom: 1px solid #eadcb9; text-align: left; }
.sc-w { color: #1f7a45; font-weight: 800; }
