:root {
  --vltk-bg: rgba(14, 18, 16, 0.88);
  --vltk-border: #8b6f3d;
  --vltk-gold: #ffd470;
  --vltk-jade: #6bd6a8;
  --vltk-crimson: #c9302c;
  --vltk-mana: #2478d8;
  --vltk-text: #f3ead8;
  --vltk-muted: #b0a38b;
  --font-ui: "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
}

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

html, body, #game-root {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0d120f;
  color: var(--vltk-text);
  font-family: var(--font-ui);
  touch-action: none;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.hidden {
  display: none !important;
}

.vltk-panel {
  background: linear-gradient(160deg, rgba(22, 26, 23, 0.92), rgba(11, 13, 12, 0.94));
  border: 1.5px solid var(--vltk-border);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.65), inset 0 0 8px rgba(255, 212, 112, 0.12);
  border-radius: 6px;
}

/* Loading Overlay */
#loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(circle at center, #1e271e 0%, #090c0a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.loading-box {
  width: min(520px, 94vw);
  text-align: center;
  padding: 28px 24px;
  border: 2px solid var(--vltk-border);
  border-radius: 10px;
  background: rgba(15, 19, 16, 0.95);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.85);
}

.loading-emblem {
  width: 58px;
  height: 58px;
  margin: 0 auto 12px;
  line-height: 56px;
  font-size: 30px;
  color: var(--vltk-gold);
  border: 2px solid var(--vltk-gold);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 212, 112, 0.2), transparent);
}

.loading-box h1 {
  font-size: 18px;
  color: var(--vltk-gold);
  letter-spacing: 0.8px;
  margin-bottom: 10px;
}

#loading-status {
  font-size: 13px;
  color: var(--vltk-jade);
  margin-bottom: 12px;
}

.loading-bar-wrap {
  width: 100%;
  height: 10px;
  background: #101511;
  border: 1px solid var(--vltk-border);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 10px;
}

#loading-bar-fill {
  width: 10%;
  height: 100%;
  background: linear-gradient(90deg, #a67824, #ffd470);
  transition: width 0.2s ease;
}

.loading-sub {
  font-size: 12px;
  color: var(--vltk-muted);
}

/* HUD Top-Left Hero */
#hud-hero {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  max-width: min(430px, 72vw);
}

.hero-avatar-wrap {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border: 2px solid var(--vltk-gold);
  border-radius: 6px;
  background: radial-gradient(circle, #2a332a, #0e120f);
  overflow: hidden;
  cursor: pointer;
}

#hero-portrait {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hero-level {
  position: absolute;
  bottom: 1px;
  right: 2px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.78);
  color: var(--vltk-gold);
  padding: 1px 4px;
  border-radius: 3px;
}

.hero-stats {
  flex: 1;
  min-width: 170px;
}

.hero-name-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.hero-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--vltk-gold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-badge {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid var(--vltk-jade);
  color: var(--vltk-jade);
  white-space: nowrap;
}

.hero-rank-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.hero-rank-label {
  font-size: 11px;
  color: #a8df8f;
  font-weight: 600;
}

.bar-track {
  position: relative;
  height: 13px;
  background: rgba(5, 7, 6, 0.9);
  border: 1px solid #493f2b;
  border-radius: 3px;
  margin-bottom: 3px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 100%;
  transition: width 0.15s ease;
}

.hp-fill { background: linear-gradient(90deg, #8b1414, #e34234); }
.mp-fill { background: linear-gradient(90deg, #13408a, #368dff); }
.exp-track { height: 11px; margin-bottom: 5px; }
.exp-fill { background: linear-gradient(90deg, #b88a1e, #ffe066); width: 0%; }
.exp-text { font-size: 9px; line-height: 10px; color: #fff6d9; }

.bar-text {
  position: absolute;
  inset: 0;
  font-size: 10px;
  font-weight: 600;
  text-align: center;
  line-height: 12px;
  text-shadow: 0 1px 2px #000;
}

.hero-quick-toggles {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.btn-with-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.hud-point-badge {
  display: inline-block;
  min-width: 16px;
  padding: 0 4px;
  border-radius: 99px;
  background: linear-gradient(180deg, #ff513a, #b81d13);
  border: 1px solid #ffd470;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 14px;
  text-align: center;
  box-shadow: 0 0 8px rgba(255, 88, 52, 0.75);
  animation: vltkBadgePulse 1.3s ease-in-out infinite;
}

@keyframes vltkBadgePulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.1); filter: brightness(1.25); }
}

.silver-display {
  font-size: 11px;
  color: var(--vltk-gold);
}

.vltk-mini-btn {
  background: linear-gradient(180deg, #332c1d, #1c1810);
  color: var(--vltk-text);
  border: 1px solid var(--vltk-border);
  border-radius: 4px;
  padding: 3px 7px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.12s;
}

.vltk-mini-btn:hover {
  border-color: var(--vltk-gold);
  color: var(--vltk-gold);
}

.vltk-mini-btn.active {
  background: linear-gradient(180deg, #6b5322, #3e2e10);
  border-color: var(--vltk-gold);
  color: var(--vltk-gold);
}

/* HUD Top-Right Minimap */
#hud-minimap {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 20;
  padding: 6px;
  width: 186px;
}

.minimap-header {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  color: var(--vltk-gold);
  margin-bottom: 4px;
}

#coord-label {
  color: var(--vltk-jade);
  font-weight: 500;
}

.minimap-canvas-wrap {
  width: 172px;
  height: 150px;
  border: 1px solid #59492a;
  background: #101812;
  overflow: hidden;
  border-radius: 3px;
  margin-bottom: 5px;
}

#minimap-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: pointer;
}

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

#map-selector, #zone-selector {
  width: 100%;
  background: #181c19;
  color: var(--vltk-gold);
  border: 1px solid var(--vltk-border);
  border-radius: 4px;
  padding: 3px 4px;
  font-size: 11px;
}

#zone-selector {
  color: var(--vltk-jade);
}

/* HUD Bottom-Left Chat */
#hud-chat {
  position: fixed;
  bottom: 10px;
  left: 10px;
  z-index: 18;
  width: min(310px, 42vw);
  font-size: 11px;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 8px;
  border-bottom: 1px solid rgba(139, 111, 61, 0.45);
  color: var(--vltk-gold);
  font-weight: 700;
}

.chat-collapse-btn {
  background: transparent;
  color: var(--vltk-gold);
  border: none;
  cursor: pointer;
  font-weight: 700;
  padding: 0 4px;
}

#chat-log {
  height: 92px;
  overflow-y: auto;
  padding: 5px 8px;
  line-height: 1.4;
}

#hud-chat.collapsed #chat-log {
  display: none;
}

.chat-line { margin-bottom: 2px; }
.chat-sys { color: #ffe08a; }
.chat-dmg { color: #ff8e72; }
.chat-loot { color: #7dff9c; }

/* HUD Bottom-Center Skillbar */
#hud-skillbar {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
}

.skill-slots {
  display: flex;
  gap: 6px;
}

.skill-btn {
  position: relative;
  width: 66px;
  height: 68px;
  border: 1.5px solid var(--vltk-border);
  border-radius: 6px;
  background: linear-gradient(180deg, #171410, #0d100e);
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 3px;
  transition: transform 0.08s, border-color 0.12s, box-shadow 0.12s;
}

.skill-btn:hover, .skill-btn.selected {
  border-color: var(--vltk-gold);
  box-shadow: 0 0 12px rgba(255, 212, 112, 0.5);
}

.skill-btn:active {
  transform: scale(0.93);
}

.skill-btn img {
  width: 44px;
  height: 44px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid rgba(255, 212, 112, 0.25);
}

.skill-name-tag {
  width: 100%;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.1;
  color: #f3e4bd;
  text-align: center;
  padding: 2px 2px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px #000;
}

.skill-key {
  position: absolute;
  top: 2px;
  left: 3px;
  z-index: 2;
  background: rgba(10, 12, 10, 0.78);
  padding: 0 3px;
  border-radius: 2px;
  font-size: 9px;
  font-weight: 700;
  color: var(--vltk-gold);
  text-shadow: 0 1px 2px #000;
}

.skill-cd-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.skill-btn.skill-locked img {
  filter: grayscale(1) brightness(0.45);
}

.skill-lock-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  z-index: 3;
  background: rgba(15, 10, 10, 0.88);
  border: 1px solid #754a3a;
  color: #ffb899;
  font-size: 8px;
  font-weight: 700;
  padding: 0 3px;
  border-radius: 3px;
}

.skill-lv-tag {
  position: absolute;
  top: 2px;
  right: 2px;
  z-index: 3;
  background: rgba(10, 26, 14, 0.88);
  border: 1px solid #4d8b5a;
  color: #88f7a6;
  font-size: 8px;
  font-weight: 700;
  padding: 0 3px;
  border-radius: 3px;
}

.utility-slots {
  display: flex;
  gap: 5px;
  padding-left: 6px;
  border-left: 1px solid rgba(139, 111, 61, 0.5);
}

.util-btn {
  position: relative;
  width: 44px;
  height: 48px;
  border: 1px solid var(--vltk-border);
  border-radius: 5px;
  background: linear-gradient(180deg, #272116, #16140f);
  color: var(--vltk-text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.util-btn.active {
  border-color: var(--vltk-jade);
  box-shadow: 0 0 8px rgba(107, 214, 168, 0.45);
}

.u-key { font-size: 11px; font-weight: 700; color: var(--vltk-gold); }
.u-label { font-size: 10px; }

#controls-hint {
  position: fixed;
  bottom: 66px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  background: rgba(10, 12, 11, 0.65);
  border: 1px solid rgba(139, 111, 61, 0.35);
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 11px;
  color: var(--vltk-muted);
  white-space: nowrap;
  pointer-events: none;
}

/* Mobile Touch Controls */
#touch-controls {
  position: fixed;
  inset: 0;
  z-index: 25;
  pointer-events: none;
}

#touch-joystick-base {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background: rgba(20, 26, 22, 0.45);
  border: 2px solid rgba(255, 212, 112, 0.5);
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

#touch-joystick-knob {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--vltk-gold), #8a6421);
  border: 1px solid #fff6d5;
  transform: translate(0, 0);
}

#touch-action-cluster {
  position: fixed;
  bottom: 22px;
  right: 22px;
  width: 196px;
  height: 175px;
  pointer-events: none;
}

.touch-atk-btn {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid var(--vltk-gold);
  background: radial-gradient(circle, #9a241b, #4c110d);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  pointer-events: auto;
}

.touch-sub-btn {
  position: absolute;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1.5px solid var(--vltk-border);
  background: rgba(20, 26, 22, 0.85);
  color: var(--vltk-gold);
  font-size: 10px;
  font-weight: 700;
  pointer-events: auto;
}

#touch-btn-skill1 { right: 86px; bottom: 8px; }
#touch-btn-skill2 { right: 76px; bottom: 64px; }
#touch-btn-skill3 { right: 20px; bottom: 84px; }
#touch-btn-mount  { right: 138px; bottom: 52px; }
#touch-btn-heal   { right: 126px; bottom: 108px; }

/* Asset Explorer Modal */
#asset-explorer-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(5, 7, 6, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.explorer-dialog {
  width: min(1040px, 96vw);
  height: min(680px, 90vh);
  display: flex;
  flex-direction: column;
  padding: 12px;
}

.explorer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.explorer-header h2 {
  font-size: 15px;
  color: var(--vltk-gold);
}

.explorer-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.explorer-tab {
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid var(--vltk-border);
  background: #171c19;
  color: var(--vltk-text);
  font-size: 12px;
  cursor: pointer;
}

.explorer-tab.active {
  background: #4d3b1b;
  border-color: var(--vltk-gold);
  color: var(--vltk-gold);
  font-weight: 700;
}

.explorer-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 10px;
}

.explorer-grid {
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 8px;
  align-content: start;
  padding: 6px;
  background: rgba(8, 10, 9, 0.75);
  border: 1px solid #3c3424;
  border-radius: 4px;
}

.asset-card {
  border: 1px solid #443b2a;
  background: #161a17;
  border-radius: 4px;
  padding: 6px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.asset-card:hover, .asset-card.selected {
  border-color: var(--vltk-gold);
  background: #242118;
}

.asset-card img {
  width: 78px;
  height: 78px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 3px;
}

.asset-card span {
  font-size: 11px;
  color: var(--vltk-text);
  word-break: break-word;
  line-height: 1.2;
}

.explorer-inspector {
  background: rgba(10, 12, 11, 0.85);
  border: 1px solid #3c3424;
  border-radius: 4px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.inspector-preview-wrap {
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, #202820, #0d100e);
  border: 1px solid #4a3f28;
  border-radius: 4px;
  overflow: hidden;
}

#inspector-canvas, #inspector-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

#inspector-title {
  font-size: 14px;
  color: var(--vltk-gold);
}

#inspector-meta {
  font-size: 12px;
  color: var(--vltk-muted);
  line-height: 1.45;
  flex: 1;
  overflow-y: auto;
}

.inspector-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Floating Skill Cast Banner */
#skill-cast-banner {
  position: fixed;
  bottom: 92px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  padding: 5px 16px;
  border-radius: 18px;
  border: 1.5px solid var(--vltk-gold);
  background: rgba(14, 18, 15, 0.88);
  color: var(--vltk-gold);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.4px;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.65);
  transition: opacity 0.2s ease;
}

/* Login, Ngu Hanh & 10 Faction Selection Modal (Authentic VLTK UI artwork) */
#login-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  background:
    linear-gradient(180deg, rgba(6, 9, 7, 0.72), rgba(4, 6, 5, 0.88)),
    url("/assets/06_UI_And_Items/ui/dang-nhap/login.webp") center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  overflow-y: auto;
}

.login-dialog {
  width: min(1040px, 97vw);
  max-height: 95vh;
  overflow-y: auto;
  padding: 16px 18px;
  border: 2px solid var(--vltk-gold);
  background: linear-gradient(170deg, rgba(16, 20, 17, 0.94), rgba(9, 11, 10, 0.96));
  box-shadow: 0 20px 65px rgba(0, 0, 0, 0.95), inset 0 0 26px rgba(255, 212, 112, 0.14);
}

.login-header {
  text-align: center;
  margin-bottom: 10px;
}

.login-header h2 {
  font-size: 19px;
  color: var(--vltk-gold);
  letter-spacing: 0.7px;
  margin-bottom: 3px;
}

.login-sub {
  font-size: 12px;
  color: var(--vltk-muted);
}

.login-top-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: rgba(10, 14, 11, 0.78);
  border: 1px solid #4c4028;
  border-radius: 6px;
}

.login-field {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--vltk-gold);
}

.login-field input, .login-field select {
  background: #141916;
  color: var(--vltk-text);
  border: 1px solid var(--vltk-border);
  border-radius: 4px;
  padding: 5px 9px;
  font-size: 13px;
}

.login-body-grid {
  display: grid;
  grid-template-columns: 1.08fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.login-left-col, .login-right-col {
  background: rgba(12, 15, 13, 0.82);
  border: 1px solid #463b26;
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.elem-tab-btn {
  padding: 6px 4px;
  border-radius: 5px;
  border: 1.5px solid #4d412b;
  background: #171b18;
  color: var(--vltk-text);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.14s;
}

.elem-tab-btn.active {
  border-color: var(--el-col, var(--vltk-gold));
  color: var(--el-col, var(--vltk-gold));
  background: rgba(45, 38, 22, 0.92);
  box-shadow: 0 0 12px rgba(255, 212, 112, 0.25);
}

.portrait-stage {
  position: relative;
  border-radius: 6px;
  border: 1px solid #3c3423;
  background: radial-gradient(circle at 50% 42%, rgba(56, 48, 28, 0.45), rgba(8, 10, 9, 0.95));
  height: 292px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
  padding-bottom: 10px;
}

#login-portrait-canvas {
  position: relative;
  z-index: 1;
  max-width: 100%;
  max-height: 235px;
  object-fit: contain;
}

.faction-picker {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  padding: 6px 10px;
  background: rgba(8, 10, 9, 0.82);
  border: 1px solid rgba(139, 111, 61, 0.7);
  border-radius: 6px;
}

.fac-pick-btn {
  padding: 6px 14px;
  border-radius: 5px;
  border: 1.5px solid #594b31;
  background: #1a1e1b;
  color: #e6dac1;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.fac-pick-btn.active {
  border-color: var(--vltk-gold);
  background: linear-gradient(180deg, #755823, #422f0f);
  color: #fff6dc;
  box-shadow: 0 0 10px rgba(255, 212, 112, 0.35);
}

.faction-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #3c3424;
  padding-bottom: 6px;
}

.faction-detail-header h3 {
  font-size: 16px;
  color: var(--vltk-gold);
}

.login-faction-desc {
  font-size: 12px;
  color: var(--vltk-muted);
  line-height: 1.4;
}

.faction-skills-list {
  flex: 1;
  max-height: 256px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  padding-right: 4px;
}

.fac-skill-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 6px;
  background: rgba(18, 22, 19, 0.88);
  border: 1px solid #393122;
  border-radius: 5px;
}

.fac-skill-item img {
  width: 34px;
  height: 34px;
  border-radius: 4px;
  border: 1px solid #635130;
  flex-shrink: 0;
}

.fac-skill-meta {
  min-width: 0;
}

.fac-skill-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--vltk-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fac-skill-req {
  font-size: 10px;
  color: var(--vltk-jade);
}

.login-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.btn-enter-world {
  background: linear-gradient(180deg, #b88322, #7a4f10);
  color: #fff6dc;
  border: 2px solid #ffd470;
  border-radius: 8px;
  padding: 10px 28px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.6px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(255, 196, 68, 0.35);
  transition: transform 0.1s, filter 0.15s;
}

.btn-enter-world:hover {
  filter: brightness(1.12);
  transform: scale(1.02);
}

/* Potential & Character Sheet Modal [C] */
#potential-modal {
  position: fixed;
  inset: 0;
  z-index: 62;
  background: rgba(5, 7, 6, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.potential-dialog {
  width: min(920px, 96vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
  border: 2px solid var(--vltk-gold);
  overflow-y: auto;
}

.pot-layout {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 12px;
}

.pot-left-col, .pot-right-col {
  background: rgba(10, 14, 11, 0.84);
  border: 1px solid #453a25;
  border-radius: 6px;
  padding: 11px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.pot-identity-card {
  background: rgba(24, 21, 15, 0.88);
  border: 1px solid #594a2d;
  border-radius: 5px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pot-id-row, .pot-meta-row, .pot-exp-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.pot-id-row strong { font-size: 15px; color: var(--vltk-gold); }
.pot-meta-row strong, .pot-exp-row strong { color: #ffe39a; }

.pot-free-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: rgba(48, 37, 16, 0.72);
  border: 1px solid #967432;
  border-radius: 5px;
  font-size: 12px;
}

.pot-free-bar strong {
  font-size: 16px;
  color: #ffe066;
}

.pot-free-bar small {
  color: var(--vltk-muted);
}

.pot-attr-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pot-attr-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #141915;
  border: 1px solid #3c3423;
  border-radius: 5px;
}

.pot-attr-info h4 {
  font-size: 13px;
  color: var(--vltk-gold);
  margin-bottom: 2px;
}

.pot-attr-info small {
  font-size: 10px;
  color: var(--vltk-muted);
}

.pot-attr-val {
  display: flex;
  align-items: center;
  gap: 5px;
}

.pot-attr-num {
  min-width: 72px;
  text-align: right;
  font-size: 14px;
  font-weight: 800;
  color: #fff6dc;
  margin-right: 4px;
}

.pot-attr-num em {
  font-style: normal;
  font-size: 11px;
  color: var(--vltk-jade);
}

.pot-add-btn {
  padding: 4px 7px;
  border-radius: 4px;
  border: 1px solid #8b6f3d;
  background: linear-gradient(180deg, #5d471d, #31240d);
  color: #ffe8a6;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.pot-add-btn:hover:not(:disabled) {
  border-color: var(--vltk-gold);
  filter: brightness(1.18);
}

.pot-add-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.pot-section-title {
  font-size: 12px;
  color: var(--vltk-gold);
  border-bottom: 1px solid #3d3423;
  padding-bottom: 4px;
}

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

.pot-stat-box {
  background: #151a16;
  border: 1px solid #352e20;
  border-radius: 4px;
  padding: 5px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
}

.pot-stat-box span { color: var(--vltk-muted); }
.pot-stat-box strong { color: #f6ead0; }

.pot-res-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pot-res-bar {
  background: #141815;
  border: 1px solid #383021;
  border-radius: 4px;
  padding: 4px 8px;
}

.pot-res-head {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-bottom: 3px;
}

.pot-res-track {
  height: 5px;
  background: #0a0d0b;
  border-radius: 3px;
  overflow: hidden;
}

.pot-res-fill {
  height: 100%;
  transition: width 0.15s ease;
}

/* Skill Book Modal [K] */
#skillbook-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(5, 7, 6, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.skillbook-dialog {
  width: min(960px, 96vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  padding: 14px;
  border: 2px solid var(--vltk-gold);
}

.sk-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  margin-bottom: 8px;
  background: rgba(34, 28, 16, 0.82);
  border: 1px solid #755c2b;
  border-radius: 5px;
  font-size: 12px;
}

.sk-status-group {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.sk-status-group strong { color: #ffe066; font-size: 14px; }
.sk-status-group small { color: var(--vltk-muted); }

.sk-action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sk-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.skillbook-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
  padding-right: 4px;
}

.skillbook-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 9px;
  border-radius: 6px;
  border: 1px solid #493d28;
  background: #151916;
  transition: border-color 0.12s, background 0.12s;
}

.skillbook-card.learned {
  border-color: #7c6633;
  background: linear-gradient(160deg, rgba(30, 32, 22, 0.92), rgba(16, 19, 15, 0.95));
}

.skillbook-card.locked {
  opacity: 0.72;
  background: #101311;
}

.skillbook-card.locked img {
  filter: grayscale(0.85) brightness(0.65);
}

.sk-card-top {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.skillbook-card img {
  width: 42px;
  height: 42px;
  border-radius: 4px;
  border: 1px solid #6b5835;
  flex-shrink: 0;
}

.skillbook-card-info {
  flex: 1;
  min-width: 0;
}

.skillbook-card-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.skillbook-card-title h4 {
  font-size: 13px;
  color: var(--vltk-gold);
  margin: 0;
}

.sk-lvl-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
  background: #232a20;
  border: 1px solid #4e6346;
  color: #a9f09f;
  white-space: nowrap;
}

.sk-lvl-badge.locked {
  background: #241918;
  border-color: #6b3b36;
  color: #ff9c8a;
}

.skillbook-card-sub {
  font-size: 10px;
  color: var(--vltk-jade);
  margin-bottom: 3px;
}

.skillbook-card-info p {
  font-size: 10px;
  color: var(--vltk-muted);
  line-height: 1.3;
}

.sk-attr-preview {
  font-size: 10px;
  color: #e6d8b3;
  background: rgba(8, 10, 9, 0.7);
  border: 1px solid #2e291e;
  border-radius: 4px;
  padding: 4px 6px;
  line-height: 1.35;
}

.sk-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-top: auto;
}

.sk-req-note {
  font-size: 10px;
  color: #ffad85;
}

.sk-req-note.ok {
  color: #8ee59b;
}

.sk-up-btn {
  padding: 4px 9px;
  border-radius: 4px;
  border: 1px solid var(--vltk-gold);
  background: linear-gradient(180deg, #7c5b1e, #4a330e);
  color: #fff6dc;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.sk-up-btn:hover:not(:disabled) {
  filter: brightness(1.18);
}

.sk-up-btn:disabled {
  opacity: 0.38;
  border-color: #554832;
  background: #1b1a16;
  cursor: not-allowed;
}

/* Compact Quest Tracker HUD */
#hud-quest-tracker {
  position: fixed;
  top: 138px;
  left: 10px;
  z-index: 18;
  width: min(295px, 60vw);
  padding: 6px 9px;
  cursor: pointer;
  transition: border-color 0.14s;
}

#hud-quest-tracker:hover {
  border-color: var(--vltk-gold);
}

.qt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--vltk-gold);
  border-bottom: 1px solid rgba(139, 111, 61, 0.45);
  padding-bottom: 3px;
  margin-bottom: 4px;
}

.qt-hint {
  font-size: 10px;
  color: var(--vltk-jade);
}

.qt-item {
  font-size: 11px;
  line-height: 1.35;
  margin-bottom: 4px;
}

.qt-item:last-child { margin-bottom: 0; }
.qt-title { font-weight: 700; color: #f5e6c3; }
.qt-prog { font-size: 10px; color: var(--vltk-jade); }
.qt-prog.done { color: #ffd470; font-weight: 700; }

/* Inventory, Weapons & Golden Equipment Modal [I] */
#inventory-modal, #quest-modal {
  position: fixed;
  inset: 0;
  z-index: 64;
  background: rgba(5, 7, 6, 0.84);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.inventory-dialog {
  width: min(1100px, 97vw);
  height: min(670px, 90vh);
  display: flex;
  flex-direction: column;
  padding: 14px;
  border: 2px solid var(--vltk-gold);
}

.inv-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 270px 1fr 295px;
  gap: 10px;
}

.inv-equip-col, .inv-bag-col, .inv-inspector-col {
  background: rgba(10, 14, 11, 0.86);
  border: 1px solid #443924;
  border-radius: 6px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.inv-equip-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  overflow-y: auto;
}

.inv-equip-slot {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px;
  border-radius: 5px;
  border: 1px solid #3c3322;
  background: #141915;
  cursor: pointer;
  min-height: 46px;
  transition: border-color 0.12s, background 0.12s;
}

.inv-equip-slot:hover, .inv-equip-slot.selected {
  border-color: var(--vltk-gold);
  background: #221f15;
}

.inv-equip-slot.rarity-blue {
  border-color: #4f79b8;
  background: rgba(20, 32, 48, 0.82);
}

.inv-equip-slot.rarity-gold {
  border-color: #ffd54a;
  background: linear-gradient(155deg, rgba(64, 48, 12, 0.92), rgba(24, 19, 8, 0.95));
  box-shadow: inset 0 0 10px rgba(255, 213, 74, 0.25);
}

.inv-equip-slot img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
}

.inv-slot-empty-icon {
  width: 32px;
  height: 32px;
  border-radius: 3px;
  border: 1px dashed #4a402c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #6b6250;
  flex-shrink: 0;
}

.inv-slot-meta {
  min-width: 0;
  flex: 1;
}

.inv-slot-label {
  font-size: 9px;
  color: var(--vltk-muted);
}

.inv-slot-name {
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inv-bonus-summary {
  margin-top: auto;
  font-size: 10px;
  color: #cfe3c8;
  background: rgba(18, 24, 19, 0.9);
  border: 1px solid #354132;
  border-radius: 4px;
  padding: 6px 8px;
  line-height: 1.45;
}

.inv-bag-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid #3a3121;
}

.inv-bag-grid {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  grid-auto-rows: 66px;
  gap: 6px;
  align-content: start;
}

.inv-bag-cell {
  position: relative;
  border-radius: 5px;
  border: 1px solid #3c3424;
  background: #141815;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3px;
  cursor: pointer;
  overflow: hidden;
}

.inv-bag-cell.empty {
  opacity: 0.45;
  cursor: default;
}

.inv-bag-cell:not(.empty):hover, .inv-bag-cell.selected {
  border-color: var(--vltk-gold);
  background: #242116;
}

.inv-bag-cell.rarity-blue {
  border-color: #4f79b8;
  background: rgba(18, 30, 48, 0.85);
}

.inv-bag-cell.rarity-gold {
  border-color: #ffd54a;
  background: linear-gradient(155deg, rgba(68, 51, 14, 0.94), rgba(26, 20, 8, 0.96));
  box-shadow: 0 0 8px rgba(255, 213, 74, 0.28);
}

.inv-bag-cell.rarity-potion {
  border-color: #3d7d52;
  background: rgba(16, 36, 23, 0.85);
}

.inv-bag-cell img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.inv-cell-name {
  width: 100%;
  font-size: 9px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inv-cell-qty {
  position: absolute;
  top: 2px;
  right: 3px;
  font-size: 9px;
  font-weight: 800;
  background: rgba(0, 0, 0, 0.82);
  color: #95ffa9;
  padding: 0 3px;
  border-radius: 3px;
}

.inv-cell-gold-tag {
  position: absolute;
  top: 2px;
  left: 2px;
  font-size: 8px;
  font-weight: 800;
  background: #7c560d;
  color: #ffe88f;
  padding: 0 3px;
  border-radius: 2px;
}

.inv-inspector-col {
  overflow-y: auto;
}

.inv-insp-empty {
  color: var(--vltk-muted);
  font-size: 12px;
  text-align: center;
  margin: auto 10px;
  line-height: 1.5;
}

.inv-insp-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #3c3322;
}

.inv-insp-head img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 5px;
  border: 1px solid #6b5835;
  background: rgba(0, 0, 0, 0.45);
  padding: 3px;
}

.inv-insp-title { font-size: 14px; font-weight: 800; margin-bottom: 2px; }
.inv-insp-title.gold { color: #ffd54a; }
.inv-insp-title.blue { color: #8fb8ff; }
.inv-insp-title.potion { color: #7dff9c; }
.inv-insp-sub { font-size: 11px; color: var(--vltk-muted); }

.inv-insp-lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  line-height: 1.4;
}

.inv-line-base { color: #f0e6d0; }
.inv-line-req { color: #ffad85; }
.inv-line-req.ok { color: #95e59d; }
.inv-line-magic { color: #8fb8ff; font-weight: 600; }
.inv-line-magic.gold { color: #ffd54a; }
.inv-line-magic.inactive { color: #707782; font-weight: 400; }
.inv-line-kich {
  font-size: 10px;
  color: #c8ba94;
  background: rgba(26, 23, 15, 0.85);
  border: 1px solid #493f28;
  border-radius: 4px;
  padding: 5px 7px;
  margin-top: 4px;
}

.inv-insp-actions {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid #3c3322;
}

/* Quests (Faction + Da Tau) & Ba Lang Shop Modal [L] */
.quest-dialog {
  width: min(980px, 96vw);
  height: min(650px, 89vh);
  display: flex;
  flex-direction: column;
  padding: 14px;
  border: 2px solid var(--vltk-gold);
}

.quest-content-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.quest-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quest-card {
  background: rgba(16, 20, 17, 0.9);
  border: 1px solid #4a3f29;
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.quest-card.ready {
  border-color: #ffd54a;
  background: linear-gradient(160deg, rgba(50, 41, 16, 0.92), rgba(16, 20, 15, 0.94));
}

.quest-card.completed {
  opacity: 0.62;
  border-color: #3a543c;
}

.quest-card h4 {
  font-size: 13px;
  color: var(--vltk-gold);
  margin-bottom: 3px;
}

.quest-card p {
  font-size: 11px;
  color: var(--vltk-text);
  margin-bottom: 4px;
}

.quest-reward-line {
  font-size: 11px;
  color: #ffd54a;
}

.quest-prog-line {
  font-size: 11px;
  color: var(--vltk-jade);
  margin-top: 2px;
}

.datau-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.datau-banner {
  background: rgba(34, 28, 15, 0.85);
  border: 1px solid #7d622d;
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.datau-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12px;
}

.datau-stats strong { color: #ffe066; }

.datau-task-box {
  background: #131814;
  border: 1px solid #4e422b;
  border-radius: 6px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.datau-rewards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 6px;
}

.datau-reward-btn {
  padding: 12px 10px;
  border-radius: 6px;
  border: 1.5px solid #8a6c30;
  background: linear-gradient(170deg, #3a2e14, #1c170b);
  color: #fff3d1;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform 0.1s, border-color 0.15s;
}

.datau-reward-btn:hover {
  border-color: #ffd54a;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(255, 213, 74, 0.25);
}

.datau-reward-btn strong { font-size: 13px; color: #ffd54a; }
.datau-reward-btn span { font-size: 11px; color: var(--vltk-muted); }

.shop-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

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

.shop-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 9px;
  border-radius: 6px;
  border: 1px solid #443925;
  background: #141915;
}

.shop-card.gold {
  border-color: #b58d2e;
  background: linear-gradient(155deg, rgba(46, 36, 12, 0.88), rgba(16, 18, 14, 0.94));
}

.shop-card img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 4px;
  border: 1px solid #63512f;
  background: rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.shop-card-info { flex: 1; min-width: 0; }
.shop-card-info h4 { font-size: 12px; color: #f6e7c2; margin-bottom: 2px; }
.shop-card.gold .shop-card-info h4 { color: #ffd54a; }
.shop-card-info p { font-size: 10px; color: var(--vltk-muted); line-height: 1.3; }
.shop-price { font-size: 11px; font-weight: 700; color: #ffe066; margin-top: 3px; }

/* Responsive Mobile Rules */
@media (max-width: 920px) {
  .inv-layout { grid-template-columns: 1fr; overflow-y: auto; }
  .datau-rewards-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .login-body-grid, .pot-layout { grid-template-columns: 1fr; }
  .portrait-stage { height: 210px; }
  .faction-skills-list { grid-template-columns: 1fr; max-height: 190px; }
}

@media (max-width: 768px) {
  #hud-hero { max-width: 62vw; padding: 5px 7px; gap: 6px; }
  #hud-quest-tracker { display: none; }
  .hero-avatar-wrap { width: 42px; height: 42px; }
  .hero-stats { min-width: 120px; }
  #hud-minimap { width: 142px; padding: 4px; }
  .minimap-canvas-wrap { width: 132px; height: 104px; }
  #hud-chat, #controls-hint { display: none; }
  #hud-skillbar { bottom: 6px; padding: 4px; max-width: 96vw; overflow-x: auto; }
  .skill-btn { width: 46px; height: 50px; flex-shrink: 0; }
  .skill-btn img { width: 30px; height: 30px; }
  .skill-name-tag { font-size: 8px; }
  .utility-slots { display: none; }
  .explorer-body { grid-template-columns: 1fr; }
  .explorer-inspector { display: none; }
}
