﻿/* D:\Code\Startup\mu-box-web\style.css */
/* MU Online Gothic Dark Web Interface */

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

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #050608;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #d8d8d8;
}

#game-app {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  position: relative;
}

/* 1. TOP HEADER HUD */
#top-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 48px;
  background: linear-gradient(180deg, #181b20 0%, #0d0f12 100%);
  border-bottom: 2px solid #3c3424;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.7);
  padding: 0 14px;
  z-index: 10;
}

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

.lvl-badge {
  background: linear-gradient(135deg, #a47a24 0%, #523b0d 100%);
  border: 1px solid #ffd24a;
  color: #fff;
  font-weight: 900;
  font-size: 13px;
  padding: 3px 8px;
  border-radius: 4px;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.4);
}

.hero-meta {
  display: flex;
  flex-direction: column;
}

.hero-meta span:first-child {
  font-weight: bold;
  font-size: 14px;
  color: #f5eedb;
}

.hero-meta span:last-child {
  font-size: 11px;
  color: #ff9933;
}

.hud-center .map-label {
  font-size: 13px;
  color: #e0d8c0;
}

.hud-center .map-label b {
  color: #ffd24a;
}

.currency-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.zen-box {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid #443c2c;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  color: #ffd24a;
  font-weight: bold;
}

.jewel-pill {
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: bold;
  border: 1px solid #333;
}

.jewel-pill.bless {
  background: #112233;
  color: #66b2ff;
  border-color: #225588;
}

.jewel-pill.soul {
  background: #2b1133;
  color: #d166ff;
  border-color: #772288;
}

.jewel-pill.chaos {
  background: #332211;
  color: #ffaa33;
  border-color: #885522;
}

/* 2. BATTLEFIELD ARENA */
#battlefield {
  flex: 1;
  position: relative;
  overflow: hidden;
  background-color: #0b0c10;
}

#arena, #arena-2d {
  display: block;
  width: 100%;
  height: 100%;
}

/* 3. BOTTOM INTERFACE BAR */
#bottom-hud {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  height: 110px;
  background: linear-gradient(180deg, #14171c 0%, #08090b 100%);
  border-top: 2px solid #3c3424;
  box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.8);
  padding: 0 10px 6px 10px;
  z-index: 10;
}

.dragon-orb-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  position: relative;
  bottom: 4px;
}

.stone-dragon {
  height: 88px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.9));
  pointer-events: none;
}

/* DUAL GLASS ORBS */
.glass-orb {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  border: 3px solid #4a3e29;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.9), 0 0 10px rgba(0, 0, 0, 0.7);
  background: #0d0f12;
  display: flex;
  align-items: center;
  justify-content: center;
}

.orb-fluid {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  transition: height 0.25s ease-out;
}

.hp-fluid {
  background: linear-gradient(180deg, #ff4d4d 0%, #a80000 100%);
  box-shadow: 0 0 12px #ff2222;
}

.mp-fluid {
  background: linear-gradient(180deg, #4da6ff 0%, #0044a8 100%);
  box-shadow: 0 0 12px #2277ff;
}

.orb-val {
  position: relative;
  z-index: 2;
  font-size: 10px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 1px 3px #000, 0 0 2px #000;
}

/* CENTER CONTROLS */
.hud-center-controls {
  flex: 1;
  max-width: 680px;
  margin: 0 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.quick-potions, .quick-skills {
  display: flex;
  gap: 6px;
}

.pot-btn {
  width: 44px;
  height: 38px;
  background: linear-gradient(180deg, #2b3038 0%, #15181c 100%);
  border: 1px solid #4e4431;
  border-radius: 4px;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}

.pot-btn:hover {
  border-color: #ffd24a;
}

.pot-btn b {
  font-size: 9px;
  color: #aaa;
}

.pot-qty {
  font-size: 10px;
  font-weight: bold;
}

.skill-slot {
  width: 44px;
  height: 38px;
  background: linear-gradient(180deg, #22262e 0%, #101216 100%);
  border: 1px solid #3c3424;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bbb;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
}

.skill-slot.active {
  border-color: #ffd24a;
  background: linear-gradient(180deg, #4a3e24 0%, #1c180e 100%);
  color: #ffd24a;
  box-shadow: 0 0 8px rgba(255, 210, 74, 0.4);
}

/* EXP BAR */
.xp-bar-container {
  width: 100%;
  height: 12px;
  background: #08090c;
  border: 1px solid #332b1d;
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}

.xp-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #886214 0%, #ffd24a 100%);
  transition: width 0.2s ease-out;
}

.xp-text {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  font-size: 9px;
  font-weight: bold;
  line-height: 12px;
  text-align: center;
  color: #fff;
  text-shadow: 0 1px 2px #000;
}

/* BOTTOM NAVIGATION TABS */
.bottom-nav-tabs {
  display: flex;
  gap: 4px;
  width: 100%;
  justify-content: center;
}

.nav-tab-btn {
  flex: 1;
  height: 28px;
  background: linear-gradient(180deg, #242830 0%, #111317 100%);
  border: 1px solid #3d3422;
  border-radius: 3px;
  color: #dcd4c0;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.15s;
}

.nav-tab-btn:hover {
  background: linear-gradient(180deg, #3d3422 0%, #1c180e 100%);
  border-color: #ffd24a;
  color: #fff;
}

/* 4. MODAL POPUP */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-backdrop.hidden {
  display: none !important;
}

.modal-window {
  width: 90%;
  max-width: 650px;
  max-height: 85vh;
  background: #111318;
  border: 2px solid #5a4b2c;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.9), inset 0 0 10px rgba(0, 0, 0, 0.8);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  height: 44px;
  background: linear-gradient(180deg, #252b36 0%, #12151b 100%);
  border-bottom: 2px solid #4a3c22;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
}

.modal-header h2 {
  font-size: 14px;
  color: #ffd24a;
  letter-spacing: 0.5px;
}

.btn-close {
  background: transparent;
  border: none;
  color: #aaa;
  font-size: 18px;
  cursor: pointer;
}

.btn-close:hover {
  color: #ff4444;
}

.modal-content {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
}

/* CHARACTER TAB STYLING */
.char-tab-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
  align-items: start;
}

.char-3d-box {
  background: radial-gradient(circle at 50% 60%, #1e2230 0%, #0d0f14 100%);
  border: 2px solid #544322;
  border-radius: 6px;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8), 0 4px 12px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px;
  position: relative;
  overflow: hidden;
}

.char-3d-viewport {
  width: 220px;
  height: 260px;
  cursor: grab;
  touch-action: none;
}
.char-3d-viewport:active {
  cursor: grabbing;
}

.char-3d-hint {
  font-size: 11px;
  color: #a4916a;
  margin-top: 4px;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.char-stats-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.char-tab-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.char-header {
  display: flex;
  gap: 14px;
  align-items: center;
  background: #171a22;
  padding: 10px;
  border-radius: 4px;
  border: 1px solid #332b1d;
}

.char-avatar {
  width: 72px;
  height: 72px;
  border-radius: 6px;
  border: 2px solid #a47a24;
  object-fit: cover;
}

.char-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat-row {
  background: #15181f;
  border: 1px solid #2d2618;
  padding: 8px 12px;
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.btn-stat {
  background: linear-gradient(180deg, #6e5015 0%, #3a2a09 100%);
  border: 1px solid #ffd24a;
  color: #fff;
  font-weight: bold;
  padding: 2px 7px;
  border-radius: 3px;
  cursor: pointer;
  margin-left: 4px;
}

.char-combat-stats {
  background: #15181f;
  border: 1px solid #2d2618;
  padding: 12px;
  border-radius: 4px;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* INVENTORY TAB STYLING */
.inv-tab-container {
  display: flex;
  gap: 18px;
}

.inv-section h4 {
  font-size: 13px;
  color: #ffd24a;
  margin-bottom: 8px;
}

.eq-slots-grid {
  display: grid;
  grid-template-columns: repeat(3, 44px);
  gap: 6px;
  background: #171a22;
  padding: 10px;
  border-radius: 4px;
  border: 1px solid #332b1d;
}

.eq-slot {
  width: 44px;
  height: 44px;
  background: #0d0f13;
  border: 1px solid #3c3424;
  border-radius: 4px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.eq-slot:hover {
  border-color: #ffd24a;
}

.slot-bg {
  width: 26px;
  height: 26px;
  opacity: 0.35;
}

.it-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.it-plus {
  position: absolute;
  top: 1px;
  right: 2px;
  font-size: 10px;
  font-weight: 900;
  color: #ffd24a;
  text-shadow: 0 1px 2px #000;
}

.inv-grid-64 {
  display: grid;
  grid-template-columns: repeat(8, 38px);
  gap: 4px;
  background: #171a22;
  padding: 8px;
  border-radius: 4px;
  border: 1px solid #332b1d;
}

.inv-slot {
  width: 38px;
  height: 38px;
  background-color: #0d0f13;
  background-image: url('assets/ui/inventorybox2.jpg');
  background-size: cover;
  background-repeat: no-repeat;
  border: 1px solid #3c3424;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
}

.inv-slot:hover {
  border-color: #ffd24a;
  background: #191d24;
}

/* SKILLS TAB */
.skills-tab-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skill-card {
  background: #15181f;
  border: 1px solid #2d2618;
  padding: 12px;
  border-radius: 4px;
}

.skill-card.active {
  border-color: #ffd24a;
  background: #1c1d1a;
}

.skill-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.hotkey-badge {
  background: #ffd24a;
  color: #000;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 6px;
}

.mana-badge {
  color: #66b2ff;
  font-size: 12px;
}

.skill-desc {
  font-size: 12px;
  color: #aaa;
  margin-bottom: 8px;
}

.btn-select-skill {
  background: #2b303a;
  border: 1px solid #4a3e24;
  color: #ffd24a;
  font-size: 11px;
  font-weight: bold;
  padding: 5px 12px;
  border-radius: 3px;
  cursor: pointer;
}

/* CHAOS MACHINE TAB */
.chaos-tab-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chaos-banner {
  background: rgba(255, 170, 0, 0.08);
  border: 1px solid #774411;
  padding: 10px;
  border-radius: 4px;
  font-size: 12px;
  color: #ffbb66;
  line-height: 1.5;
}

.chaos-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #171a22;
  border: 1px solid #2d2618;
  padding: 8px 12px;
  border-radius: 4px;
}

.chaos-item-row img {
  width: 40px;
  height: 40px;
  border: 1px solid #443c2c;
  border-radius: 3px;
}

.chaos-row-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  font-size: 13px;
}

.chaos-row-info span {
  font-size: 11px;
  color: #66b2ff;
}

.chaos-row-btns button {
  background: #232730;
  border: 1px solid #443c2c;
  color: #eee;
  padding: 5px 9px;
  font-size: 11px;
  border-radius: 3px;
  cursor: pointer;
  margin-left: 4px;
}

.chaos-row-btns button:hover {
  border-color: #ffd24a;
  color: #ffd24a;
}

/* MAP TAB */
.maps-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.map-card {
  background: #171a22;
  border: 1px solid #332b1d;
  padding: 10px;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.map-card.current {
  border-color: #ffd24a;
}

.map-thumb {
  width: 100%;
  height: 90px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid #222;
}

.map-card-info {
  text-align: center;
}

.map-card-info h4 {
  color: #ffd24a;
  font-size: 14px;
}

.map-sub {
  font-size: 11px;
  color: #aaa;
}

.map-req {
  font-size: 11px;
  color: #66b2ff;
  margin-top: 4px;
}

.btn-travel {
  width: 100%;
  background: #2b303a;
  border: 1px solid #4a3e24;
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  padding: 6px 0;
  border-radius: 3px;
  cursor: pointer;
}

.btn-travel:hover:not(:disabled) {
  background: #ffd24a;
  color: #000;
}

.btn-travel:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* SETTINGS TAB */
.settings-tab-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.settings-group {
  background: #171a22;
  border: 1px solid #2d2618;
  padding: 12px;
  border-radius: 4px;
}

.settings-group h4 {
  color: #ffd24a;
  font-size: 13px;
  margin-bottom: 10px;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  margin-bottom: 8px;
}

.class-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.btn-pick-class {
  background: #0f1116;
  border: 1px solid #332b1d;
  padding: 10px;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #ddd;
  font-size: 12px;
  cursor: pointer;
}

.btn-pick-class img {
  width: 48px;
  height: 48px;
  border-radius: 4px;
}

.btn-pick-class.active {
  border-color: #ffd24a;
  background: #1c1d1a;
  color: #ffd24a;
}

.btn-danger {
  background: #6e1c1c;
  border: 1px solid #ff4444;
  color: #fff;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
}

/* ITEM TOOLTIP */
.item-tooltip {
  position: fixed;
  z-index: 200;
  width: 240px;
  background: rgba(12, 14, 18, 0.95);
  border: 1px solid #5a4b2c;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.9);
  padding: 10px;
  border-radius: 4px;
  pointer-events: none;
  font-size: 12px;
  line-height: 1.4;
}

.item-tooltip.hidden {
  display: none !important;
}

.tip-title {
  font-weight: bold;
  font-size: 13px;
  margin-bottom: 2px;
}

.tip-type {
  font-size: 10px;
  color: #888;
  margin-bottom: 6px;
}

.tip-desc {
  font-size: 11px;
  color: #bbb;
  margin-top: 6px;
  border-top: 1px solid #222;
  padding-top: 4px;
}

/* COLOR UTILITIES */
.text-yellow { color: #ffd24a; }
.text-cyan { color: #00e5ff; }
.text-green { color: #00ff66; }
.text-blue { color: #66b2ff; }


/* ---------------------------------------------------- */
/* AUTHENTIC MU GOTHIC PAPERDOLL & EQUIPMENT SLOTS     */
/* ---------------------------------------------------- */
.char-tab-layout, .inv-tab-layout {
  display: grid;
  grid-template-columns: 285px 1fr;
  gap: 16px;
  align-items: start;
}

.char-pd-wrapper, .inv-pd-section {
  display: flex;
  flex-direction: column;
}

.section-title {
  font-size: 12px;
  color: #ffd24a;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.pd-hint {
  font-size: 11px;
  color: #8c7b5a;
  text-align: center;
  margin-top: 6px;
  font-style: italic;
}

.mu-paperdoll {
  display: flex;
  justify-content: center;
  gap: 10px;
  background: radial-gradient(circle at 50% 40%, #1e2430 0%, #0d0f14 100%);
  border: 2px solid #544322;
  border-radius: 6px;
  padding: 12px;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8), 0 4px 12px rgba(0, 0, 0, 0.6);
}

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

.pd-column.pd-center {
  align-items: center;
}

.pd-hero-stage {
  width: 120px;
  height: 140px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 2px 0;
}

.pd-wings-fx {
  position: absolute;
  top: 0px;
  width: 130px;
  height: 95px;
  display: none;
  pointer-events: none;
  z-index: 1;
}

.pd-wings-fx.active {
  display: block;
}

.pd-wing-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  animation: wingHover 2.4s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 8px rgba(255, 180, 50, 0.6));
}

@keyframes wingHover {
  0% { transform: scale(0.95) translateY(0px); }
  100% { transform: scale(1.05) translateY(-5px); }
}

.pd-hero-token {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: 3px solid #ffcc00;
  box-shadow: 0 0 15px rgba(255, 204, 0, 0.4), inset 0 0 10px rgba(0, 0, 0, 0.8);
  position: relative;
  overflow: hidden;
  z-index: 2;
  background: #111;
}

.pd-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pd-hero-caption {
  margin-top: 4px;
  text-align: center;
  z-index: 2;
}

.pd-hero-name {
  font-weight: bold;
  font-size: 12px;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.9);
}

.pd-hero-lvl {
  font-size: 10.5px;
  color: #a4916a;
}

/* EQ SLOTS */
.eq-slot {
  width: 48px;
  height: 48px;
  background: #0f1218;
  border: 1.5px solid #3c3424;
  border-radius: 4px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.eq-slot:hover {
  border-color: #ffd24a;
  box-shadow: 0 0 8px rgba(255, 210, 74, 0.4);
}

.eq-slot.equipped {
  background: radial-gradient(circle, #252835 0%, #10121a 100%);
  border-color: #7a6a48;
}

.eq-slot.rarity-1, .inv-slot.rarity-1 { border-color: #4a90e2 !important; box-shadow: 0 0 6px rgba(74, 144, 226, 0.4); }
.eq-slot.rarity-2, .inv-slot.rarity-2 { border-color: #22dd55 !important; box-shadow: 0 0 8px rgba(34, 221, 85, 0.5); }
.eq-slot.rarity-3, .inv-slot.rarity-3 { border-color: #ffd24a !important; box-shadow: 0 0 10px rgba(255, 210, 74, 0.6); }

.slot-bg {
  width: 22px;
  height: 22px;
  opacity: 0.35;
}

.slot-label {
  font-size: 8.5px;
  color: #6d6655;
  margin-top: 2px;
  font-weight: 600;
  text-transform: uppercase;
}

.slot-tag {
  position: absolute;
  bottom: 1px;
  right: 2px;
  font-size: 8px;
  color: rgba(255, 255, 255, 0.5);
}

.eq-slot-spacer {
  width: 48px;
  height: 48px;
}

.it-plus {
  position: absolute;
  top: 1px;
  left: 3px;
  font-size: 10px;
  font-weight: bold;
  color: #ffd24a;
  text-shadow: 0 0 4px #000;
}

.inv-grid-64 {
  display: grid;
  grid-template-columns: repeat(8, 38px);
  gap: 4px;
  background: #171a22;
  padding: 8px;
  border-radius: 4px;
  border: 1px solid #332b1d;
}

.inv-slot {
  width: 38px;
  height: 38px;
  background-color: #0d0f13;
  background-image: url('assets/ui/inventorybox2.jpg');
  background-size: cover;
  background-repeat: no-repeat;
  border: 1px solid #3c3424;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
}

.inv-slot:hover {
  border-color: #ffd24a;
  background: #191d24;
}


/* 3D WebGL BATTLEFIELD & OVERLAY */
#battlefield {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0c0e14;
}

#arena {
  display: block;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

#arena-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}




/* =====================================================================
   MU CLASSIC UI (ghi de HUD cu): thanh 3 manh newui_menu01/02/03 (640x51),
   cua so noi voi khung msgbox cua client goc. Toa do do tu anh goc.
   ===================================================================== */
:root { --mu-s: 2.4; }
@media (max-width: 1400px) { :root { --mu-s: 1.9; } }
@media (max-width: 1000px) { :root { --mu-s: 1.4; } }

#mu-hud {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: calc(640px * var(--mu-s));
  height: calc(51px * var(--mu-s));
  transform: translateX(-50%);
  z-index: 20;
  pointer-events: none;
}

.mu-bar {
  position: absolute;
  left: 0;
  top: 0;
  width: 640px;
  height: 51px;
  transform: scale(var(--mu-s));
  transform-origin: 0 0;
  pointer-events: auto;
  filter: drop-shadow(0 -2px 6px rgba(0, 0, 0, 0.7));
}

.mu-seg {
  position: absolute;
  top: 0;
  height: 51px;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}
.mu-s1 { left: 0;     width: 256px; background-image: url(assets/ui/newui_menu01.jpg); }
.mu-s2 { left: 256px; width: 128px; background-image: url(assets/ui/newui_menu02.jpg); }
.mu-s3 { left: 384px; width: 256px; background-image: url(assets/ui/newui_menu03.jpg); }

.mu-slot {
  position: absolute;
  top: 1px;
  width: 36px;
  height: 38px;
  padding: 0;
  margin: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e8d9a8;
}
.mu-slot:hover { background: rgba(255, 225, 140, 0.12); box-shadow: inset 0 0 0 1px rgba(255, 215, 100, 0.55); }
.skill-slot.mu-slot.active {
  background: rgba(255, 210, 74, 0.14);
  box-shadow: inset 0 0 0 1px #ffd24a, 0 0 5px rgba(255, 210, 74, 0.85);
}

.pot-btn.mu-slot { flex-direction: column; }
.pot-btn.mu-slot img { width: 22px; height: 22px; object-fit: cover; margin-top: 2px; filter: drop-shadow(0 1px 1px #000); }
.pot-btn.mu-slot .pot-qty {
  position: absolute;
  right: 2px;
  bottom: 1px;
  font-size: 7px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 2px #000, 0 1px 1px #000;
}

.mu-menu-btn { flex-direction: column; gap: 0; }
.mu-menu-btn b { font-size: 13px; line-height: 13px; color: #ffd978; text-shadow: 0 1px 2px #000; }
.mu-menu-btn span { font-size: 5px; line-height: 7px; color: #cdbf96; text-shadow: 0 1px 1px #000; }

/* Cau HP / MP nam trong o tron cua thanh */
.mu-orb {
  position: absolute;
  top: 1px;
  width: 45px;
  height: 39px;
  overflow: hidden;
  pointer-events: none;
}
.mu-orb.hp { left: 154px; }
.mu-orb.mp { left: 441px; }
.mu-orb .orb-fluid {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  box-shadow: none;
  background-color: transparent;
  background-repeat: no-repeat;
  background-position: left bottom;
  background-size: 45px 39px;
  mix-blend-mode: screen;
  transition: height 0.2s ease-out;
}
.mu-orb.hp .orb-fluid { background-image: url(assets/ui/newui_menu_red.jpg); }
.mu-orb.mp .orb-fluid { background-image: url(assets/ui/newui_menu_blue.jpg); }

.mu-bar .orb-val {
  position: absolute;
  top: 17px;
  width: 61px;
  text-align: center;
  font-size: 6px;
  line-height: 7px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 2px #000, 0 1px 1px #000;
  pointer-events: none;
}

/* Thanh kinh nghiem trong ranh o day thanh (y ~ 42..48) */
.mu-xp {
  position: absolute;
  left: 8px;
  top: 42px;
  width: 624px;
  height: 5px;
  overflow: hidden;
}
.mu-xp .xp-bar-fill {
  height: 100%;
  background: linear-gradient(180deg, #ffe28a 0%, #c9962a 55%, #7a5712 100%);
  box-shadow: 0 0 4px rgba(255, 210, 90, 0.8);
}
.mu-bar .xp-text {
  position: absolute;
  left: 0;
  top: 41px;
  width: 640px;
  height: 7px;
  font-size: 5px;
  line-height: 7px;
  text-align: center;
  color: #fff;
  text-shadow: 0 0 2px #000, 0 1px 1px #000;
  pointer-events: none;
}

/* Nut Ban Do / He Thong tren thanh tren */
.top-btns { display: flex; gap: 6px; margin-right: 12px; }
.mu-top-btn {
  flex: none;
  height: 24px;
  padding: 0 10px;
  background: linear-gradient(180deg, #2c2518 0%, #0f0d09 100%);
  border: 1px solid #6b5a30;
  border-radius: 2px;
  color: #e8d9a8;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.mu-top-btn:hover { border-color: #ffd24a; color: #fff; }

/* Cua so noi kieu MU (khung msgbox + nen da), keo duoc bang thanh tieu de */
.modal-backdrop {
  background: transparent;
  pointer-events: none;
  align-items: flex-start;
  justify-content: flex-start;
}
.modal-window {
  position: absolute;
  left: 50%;
  top: 64px;
  transform: translateX(-50%);
  pointer-events: auto;
  width: 92%;
  max-width: 640px;
  max-height: calc(100vh - 64px - 150px);
  background: #0c0c0d url(assets/ui/newui_msgbox_back.jpg);
  border: 0;
  border-radius: 0;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.85);
  overflow: visible;
  display: flex;
  flex-direction: column;
}
.modal-header {
  position: relative;
  flex: none;
  height: 52px;
  padding: 0 80px 4px 40px;
  background: none;
  border: 0;
  justify-content: center;
  cursor: move;
}
.modal-header::before {
  content: '';
  position: absolute;
  inset: 0 0 -6px 0;
  border-style: solid;
  border-width: 58px 80px 0 80px;
  border-image: url(assets/ui/newui_msgbox_top.png) 67 80 0 80 / 58px 80px 0 80px stretch;
  pointer-events: none;
}
.modal-header h2 {
  position: relative;
  font-size: 13px;
  letter-spacing: 0.6px;
  color: #ffe29a;
  text-shadow: 0 1px 3px #000, 0 0 8px rgba(255, 200, 80, 0.35);
  text-align: center;
}
.modal-header .btn-close {
  position: absolute;
  right: 26px;
  top: 12px;
  width: 54px;
  height: 30px;
  font-size: 0;
  background: url(assets/ui/newui_button_close.png) 0 0 no-repeat;
  cursor: pointer;
}
.modal-header .btn-close:hover { background-position: 0 -30px; color: transparent; }
.modal-header .btn-close:active { background-position: 0 -60px; }
.modal-content {
  position: relative;
  overflow-y: auto;
  padding: 10px 26px 14px;
  border-style: solid;
  border-width: 0 8px;
  border-image: url(assets/ui/newui_msgbox_middle.png) 0 8 0 8 / 0 8px 0 8px repeat;
}
.modal-footer {
  position: relative;
  flex: none;
  height: 44px;
  margin-top: -2px;
  border-style: solid;
  border-width: 0 80px 44px 80px;
  border-image: url(assets/ui/newui_msgbox_bottom.png) 0 80 50 80 / 0 80px 44px 80px stretch;
  pointer-events: none;
}

.hud-right { display: flex; align-items: center; }

/* Cua so MU: rong hon de luoi 8 cot khong bi cat, khong cuon ngang */
.modal-window { max-width: 700px; }
.modal-content { overflow-x: hidden; }

/* ---- Noi dung cac tab trong cua so MU (class JS dung khong khop CSS cu nen bo sung o day) ---- */
.chaos-intro { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.goblin-avatar {
  width: 84px;
  height: 84px;
  flex: none;
  object-fit: cover;
  object-position: top;
  border: 2px solid #6b5a30;
  box-shadow: 0 0 0 1px #000, inset 0 0 8px #000;
}
.goblin-speech h3 { color: #ffe29a; font-size: 14px; margin-bottom: 4px; }
.goblin-speech p { font-size: 12px; line-height: 1.45; color: #d9d0b8; }
.chaos-tab-container h4,
.settings-section h4 { color: #ffd978; font-size: 12px; letter-spacing: 0.4px; margin: 6px 0; }
.chaos-log {
  margin-top: 10px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid #3a3220;
  font-size: 12px;
  color: #cfc7ad;
  min-height: 34px;
}
.empty-text { padding: 14px; color: #8d8672; font-size: 12px; text-align: center; }

.map-grid-container { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.map-card { align-items: stretch; text-align: center; }
.map-card-thumb { height: 70px; background-size: cover; background-position: center; border: 1px solid #3a3220; filter: saturate(0.8) brightness(0.85); }
.map-card.locked { opacity: 0.6; }
.map-card-info .map-monsters { font-size: 11px; color: #cfc7ad; margin-top: 3px; }
.map-card-info .map-boss, .text-yellow { font-size: 11px; color: #ffd24a; margin-top: 2px; }
.text-green { color: #66e08a; font-size: 11px; }
.btn-map, .btn-map-warp {
  width: 100%;
  padding: 6px 0;
  font-size: 11px;
  font-weight: 700;
  color: #e8d9a8;
  background: linear-gradient(180deg, #2c2518 0%, #0f0d09 100%);
  border: 1px solid #6b5a30;
  cursor: pointer;
}
.btn-map-warp:hover { border-color: #ffd24a; color: #fff; }
.btn-map.disabled, .btn-map.locked { opacity: 0.55; cursor: default; }

.settings-section { margin-bottom: 14px; }
.settings-section .section-desc { font-size: 11px; color: #a39b84; margin-bottom: 8px; }
.setting-toggle-row { display: flex; justify-content: space-between; align-items: center; font-size: 12px; margin-bottom: 6px; }
.class-picker-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.btn-class-pick {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  text-align: left;
  background: linear-gradient(180deg, #1c1a14 0%, #0d0c09 100%);
  border: 1px solid #4a3e24;
  color: #ddd;
  font-size: 12px;
  cursor: pointer;
}
.btn-class-pick img { width: 44px; height: 44px; object-fit: cover; object-position: top; flex: none; border: 1px solid #000; }
.btn-class-pick small { display: block; color: #a39b84; font-size: 10px; }
.btn-class-pick.active { box-shadow: inset 0 0 0 1px #ffd24a, 0 0 6px rgba(255, 210, 74, 0.5); background: #241f12; }

#btnSaveGame, #btnResetGame {
  padding: 6px 12px;
  margin-right: 8px;
  font-size: 11px;
  font-weight: 700;
  color: #e8d9a8;
  background: linear-gradient(180deg, #2c2518 0%, #0f0d09 100%);
  border: 1px solid #6b5a30;
  cursor: pointer;
}
#btnSaveGame:hover, #btnResetGame:hover { border-color: #ffd24a; color: #fff; }
#btnResetGame { border-color: #7a2a2a; color: #f0b0a8; }

/* Tab kỹ năng kiểu Võ Lâm */
.skill-top { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 6px 4px 10px; }
.skill-card.locked { opacity: 0.6; }
.skill-card .skill-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.skill-card .btn-select-skill:disabled { opacity: 0.35; cursor: default; }

/* Hành trang kiểu Võ Lâm (G3) */
.inv-slot { position: relative; }
.inv-slot.bad { box-shadow: inset 0 0 0 2px rgba(255, 60, 40, 0.7); }
.inv-slot .up { position: absolute; top: 1px; right: 2px; color: #4dff6a; font-size: 11px; text-decoration: none; text-shadow: 0 0 3px #000; }
.inv-slot .up.soon { color: #c8b070; }
.inv-slot .it-lvl { position: absolute; left: 2px; bottom: 1px; font-size: 10px; font-style: normal; color: #ddd; text-shadow: 0 0 3px #000; }
.inv-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 4px 0 8px; font-size: 12px; }
.inv-mats { display: flex; gap: 10px; margin-top: 8px; font-size: 12px; color: #ffd24a; }
.inv-mats .mat { display: inline-flex; align-items: center; gap: 3px; }
.inv-mats img { width: 18px; height: 18px; object-fit: cover; border-radius: 3px; }
.item-tip .tip-sep { border-top: 1px solid #555; margin: 4px 0; }

/* Cửa hàng / Kho đồ / Bộ lọc (G3b) */
.dtabs { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.dtabs button { background: #2a2418; color: #d8c08a; border: 1px solid #5a4a2a; padding: 4px 12px; cursor: pointer; }
.dtabs button.on { background: #5a4a2a; color: #ffd24a; }
.dtabs .shop-zen { margin-left: auto; color: #ffd24a; font-size: 12px; }
.shoplist { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; max-height: 380px; overflow: auto; }
.shoprow { display: flex; align-items: center; gap: 8px; background: #1b1812; border: 1px solid #3a3020; color: #ddd; padding: 4px 6px; text-align: left; cursor: pointer; }
.shoprow:hover { border-color: #ffd24a; }
.shoprow.bad { opacity: 0.6; }
.shoprow.own { border-color: #4dff7a; }
.shoprow img { width: 32px; height: 32px; object-fit: cover; }
.shoprow span { display: flex; flex-direction: column; flex: 1; }
.shoprow small { color: #999; font-size: 11px; }
.shoprow em { color: #ffd24a; font-style: normal; font-size: 12px; }
.stash-mats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; font-size: 12px; }
.stash-mats .mat-row { display: flex; align-items: center; gap: 4px; }
.stash-mats img { width: 18px; height: 18px; }
.loot-grid { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; margin: 6px 0; }
.loot-custom { border: 1px solid #3a3020; padding: 6px 8px; margin: 6px 0; }
.loot-custom[disabled] { opacity: 0.45; }
.loot-row { font-size: 12px; margin: 4px 0; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.loot-row .chip { background: #1b1812; border: 1px solid #3a3020; padding: 1px 6px; border-radius: 3px; }
.eq-slot.rarity-4, .inv-slot.rarity-4 { border-color: #00e5ff !important; box-shadow: 0 0 10px rgba(0, 229, 255, 0.6); }

/* Lò rèn: tẩy luyện / mảnh (G4) */
.forge-tabs { margin-bottom: 10px; }
.reroll-list { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.reroll-list .inv-slot { width: 44px; height: 44px; cursor: pointer; }
.reroll-list .inv-slot.picked { outline: 2px solid #ffd24a; }
.reroll-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; font-size: 12px; }
.rr-line { display: block; padding: 2px 0; color: #7fb4ff; }
.rr-line.kept { color: #888; }
.rr-line.new { color: #4dff7a; }
.rr-line.dim { color: #777; }

/* Thông báo nhỏ & tổng kết offline */
#mu-toast { position: fixed; left: 50%; top: 70px; transform: translateX(-50%); background: rgba(20, 16, 10, 0.92); color: #ffd24a; border: 1px solid #8a6a2a; padding: 6px 14px; border-radius: 4px; font-size: 13px; z-index: 9999; opacity: 0; transition: opacity 0.25s; pointer-events: none; }
#mu-toast.on { opacity: 1; }
.offline-box { display: flex; flex-direction: column; gap: 6px; font-size: 14px; padding: 6px 4px; }
.offline-box button { align-self: flex-start; margin-top: 8px; }

/* Tên chiêu trên ô Q/W/E/R & chấm báo điểm chưa cộng */
.skill-slot .slot-name { position: absolute; left: 2px; right: 2px; bottom: 3px; font-size: 7px; line-height: 1.1; color: #ffe9a8; text-align: center; text-shadow: 0 0 3px #000, 0 0 2px #000; pointer-events: none; }

.nav-tab-btn.has-dot::after { content: ''; position: absolute; top: 3px; right: 3px; width: 9px; height: 9px; border-radius: 50%; background: #ff3b30; box-shadow: 0 0 6px #ff3b30; }

/* Tạo nhân vật / slot / xuất nhập save */
.create-box { display: flex; flex-direction: column; gap: 10px; }
.create-box input, #rename-input { background: #15120c; border: 1px solid #5a4a2a; color: #ffe9a8; padding: 5px 8px; font-size: 14px; }
.slot-list { display: flex; flex-direction: column; gap: 4px; }
.slot-row { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px; border: 1px solid #3a3020; font-size: 13px; }
.slot-row.current { border-color: #ffd24a; }

/* G5: thanh thành, Town Portal, nhật ký, danh sách bãi */
#battlefield { position: relative; }
.town-bar { position: absolute; left: 50%; top: 56px; transform: translateX(-50%); display: flex; gap: 6px; align-items: center; background: rgba(20, 16, 10, 0.88); border: 1px solid #8a6a2a; padding: 6px 10px; z-index: 20; }
.town-bar.hidden { display: none; }
.town-bar b { color: #ffd24a; margin-right: 6px; }
.town-bar button { background: #2a2216; color: #ffe9a8; border: 1px solid #6a5226; padding: 4px 8px; cursor: pointer; font-size: 12px; }
.town-bar button:hover { border-color: #ffd24a; }
#quickTown.cooling img { filter: grayscale(1) brightness(0.6); }
.log-panel { position: absolute; left: 8px; bottom: 112px; width: 330px; max-width: calc(100% - 16px); background: rgba(10, 8, 6, 0.72); border: 1px solid #4a3a20; z-index: 15; font-size: 12px; color: #d8ccb4; }
.log-head { display: flex; justify-content: space-between; align-items: center; padding: 2px 6px; background: rgba(40, 30, 16, 0.85); color: #ffd24a; }
.log-head button { background: none; border: none; color: #ffd24a; cursor: pointer; font-size: 14px; line-height: 1; }
.log-body { max-height: 140px; overflow-y: auto; padding: 3px 6px; }
.log-body div { padding: 1px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.04); }
.log-panel.collapsed .log-body { display: none; }
.log-body .boss { color: #ff7a4a; }
.log-body .gold, .log-body b.gold { color: #ffd24a; }
.log-body .bad { color: #ff6060; }
.log-body .r4 { color: #3ec93e; }
.map-auto { display: block; margin: 4px 0; color: #ffe9a8; }
.zone-list { display: flex; flex-direction: column; gap: 3px; max-height: 60vh; overflow-y: auto; }
.zone-map-head { padding: 4px 8px; color: #ffd24a; font-weight: bold; background-size: 64px; text-shadow: 0 0 3px #000, 0 0 2px #000; margin-top: 6px; }
.zrow { display: grid; grid-template-columns: 1fr auto; text-align: left; background: #1a150e; color: #e8dcc0; border: 1px solid #3a3020; padding: 5px 8px; cursor: pointer; }
.zrow small { grid-column: 1 / -1; color: #a89878; }
.zrow .zlv { color: #ffd24a; }
.zrow.cur { border-color: #ffd24a; background: #2a2010; }
.zrow.lock { opacity: 0.45; cursor: not-allowed; }

/* G4b: Lò Ép Đồ, Bạch Kim, Cửa Hàng WCoin */
.jewel-pill.wcoin { color: #ffd24a; }
.ep-tabs { margin-top: 4px; }
.ep-card { border: 1px solid #3a3020; background: rgba(20, 16, 10, 0.6); padding: 6px 8px; margin: 6px 0; }
.ep-card h4 { margin: 2px 0 4px; color: #ffd24a; }
.ep-card label { display: inline-block; margin: 2px 10px 2px 0; }
.ep-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.ep-row > span { flex: 1; }
.ep-row.dim { opacity: 0.5; }
.ep-row .inv-slot { flex: 0 0 auto; }
.ep-odds { color: #c8b070; margin: 4px 0; }
.ep-ht .chip, .ep-aux input { margin: 2px; }
.chip { background: #2a2216; color: #ffe9a8; border: 1px solid #6a5226; padding: 1px 6px; cursor: pointer; }
.chip.on { border-color: #ffd24a; background: #3a2e18; }
.ep-aux input[type=number] { width: 44px; }
.ep-aux { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; }
.ep-slots { display: flex; flex-direction: column; gap: 2px; margin: 4px 0; }
.ep-slot { padding: 2px 6px; border: 1px dashed #3a3020; color: #888; }
.ep-slot.full { border-style: solid; color: #c77bff; }
.ep-slot.next { border-color: #ffd24a; color: #ffd24a; }
.it-vio { position: absolute; left: 2px; top: 1px; font-size: 9px; color: #c77bff; font-style: normal; text-shadow: 0 0 2px #000; }
.inv-slot.r3 { border-color: #c77bff; }
.inv-slot.r5 { border-color: #9fe8ff; }
.ktc-row img { width: 32px; height: 32px; }
.ktc-row em { color: #ffd24a; font-style: normal; min-width: 90px; text-align: right; }
.ktc-list { display: flex; flex-direction: column; max-height: 52vh; overflow-y: auto; }

/* G6: chế độ, trạng thái phó bản, cửa sổ Nhiệm Vụ / Hoạt Động */
.mode-sw { position: absolute; right: 8px; top: 142px; z-index: 18; background: rgba(20, 16, 10, 0.88); color: #ffd24a; border: 1px solid #8a6a2a; padding: 4px 10px; cursor: pointer; font-size: 12px; }
.mode-menu { position: absolute; right: 8px; top: 170px; z-index: 19; display: flex; flex-direction: column; background: rgba(20, 16, 10, 0.95); border: 1px solid #8a6a2a; }
.mode-menu.hidden { display: none; }
.mode-menu button { background: none; color: #ffe9a8; border: none; border-bottom: 1px solid #3a3020; padding: 6px 12px; text-align: left; cursor: pointer; }
.mode-menu button:hover { background: #2a2216; }
.dg-hud { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); z-index: 17; background: rgba(0, 0, 0, 0.6); color: #f3d88a; padding: 3px 12px; font-size: 13px; border: 1px solid #5a4a2a; white-space: nowrap; }
.dg-hud.hidden { display: none; }
.dg-hud.warn { color: #ff6060; }
.stat-grid { display: grid; grid-template-columns: auto auto; gap: 2px 14px; }
.stat-grid b { color: #ffe9a8; }
.st-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.dg-card h4 small { color: #c8b070; font-weight: normal; }
.btn-util.danger { border-color: #8a2a2a; }

/* G7: Quà, danh hiệu, Reset, Chuồng Thú Cưỡi, Thần Thú, Đồng hành, hướng dẫn, việc cần làm */
.mu-top-btn { position: relative; }
.qrow { display: flex; align-items: center; gap: 8px; padding: 4px 2px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.qrow > span:first-child { flex: 1; display: flex; flex-direction: column; }
.qrow small { color: #b8a888; }
.qrow.lock { opacity: 0.5; }
.qrow .btnrow { display: flex; flex-wrap: wrap; gap: 3px; justify-content: flex-end; max-width: 55%; }
.gdot { display: inline-block; min-width: 14px; padding: 0 3px; border-radius: 7px; background: #c0291f; color: #fff; font-size: 10px; line-height: 14px; text-align: center; }
.gift-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 6px 0; }
.gift-day { border: 1px solid #3a3020; background: #1a150e; padding: 4px; font-size: 11px; display: flex; flex-direction: column; gap: 2px; }
.gift-day b { color: #ffd24a; }
.gift-day small { color: #c8b890; }
.gift-day.got { opacity: 0.45; }
.gift-day.cur { border-color: #ffd24a; box-shadow: 0 0 6px rgba(255, 210, 74, 0.4); }
.gift-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.chip2 { background: #221c12; color: #e8dcc0; border: 1px solid #4a3a20; padding: 2px 7px; font-size: 11px; cursor: pointer; }
.chip2.on { border-color: #ffd24a; color: #ffd24a; }
.chip2.hc-on { border-color: #5fd46a; color: #b8ffb0; }
.hct { margin: 6px 0; }
.xp-mini { position: relative; height: 12px; background: #1a150e; border: 1px solid #3a3020; margin: 4px 0; }
.xp-mini i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #8a6a20, #ffd24a); }
.xp-mini span { position: relative; font-size: 10px; padding-left: 4px; color: #fff; text-shadow: 0 0 2px #000; }
.pet-pick { display: flex; flex-wrap: wrap; gap: 4px; }
.pet-pick button { background: #1a150e; color: #e8dcc0; border: 1px solid #3a3020; padding: 4px 8px; cursor: pointer; }
.pet-pick button.on { border-color: #9fe36a; color: #9fe36a; }
.char-meta-btns { display: flex; gap: 4px; margin-top: 4px; }
.btn-select-skill.hot { border-color: #ffd24a; color: #ffd24a; box-shadow: 0 0 6px rgba(255, 210, 74, 0.5); }
.tut-body { line-height: 1.55; color: #e8dcc0; padding: 6px 2px 10px; max-width: 560px; }
.ride-btn { position: absolute; right: 8px; top: 170px; z-index: 18; background: rgba(20, 16, 10, 0.88); color: #ffe9a8; border: 1px solid #8a6a2a; padding: 4px 10px; cursor: pointer; font-size: 12px; }
.ride-btn.on { color: #9fe36a; border-color: #5fd46a; }
.ride-btn.hidden { display: none; }
.todo-box { display: flex; flex-wrap: wrap; gap: 3px; padding: 3px 6px; border-bottom: 1px solid #3a3020; align-items: center; }
.todo-box.hidden { display: none; }
.todo-box b { color: #ffd24a; font-size: 11px; margin-right: 2px; }
.todochip { background: #2a2216; color: #ffe9a8; border: 1px solid #6a5226; padding: 1px 6px; font-size: 11px; cursor: pointer; }
.todochip:hover { border-color: #ffd24a; }
.log-panel.collapsed .todo-box { display: none; }
.log-body .up { color: #9fe36a; }
.log-body .dim, .dim { color: #8a8070; }
.log-body .mat { color: #7fd0ff; }
.btn-util { background: #2b2418; border: 1px solid #6a5226; color: #ffe9a8; font-size: 11px; padding: 4px 10px; border-radius: 3px; cursor: pointer; }
.btn-util:hover:not(:disabled) { border-color: #ffd24a; color: #fff; }
.btn-util:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-util.on { border-color: #ffd24a; color: #ffd24a; }

/* G9: icon skill từ atlas client */
.sk-ic { display: inline-block; vertical-align: middle; margin-right: 6px; border: 1px solid #5a4a2a; box-shadow: 0 0 2px #000; flex: 0 0 auto; }
.skill-slot .slot-ic { margin: 0; border: 0; box-shadow: none; }
.skill-slot .sk-cd { position: absolute; left: 6px; right: 6px; bottom: 2px; height: 0; background: rgba(0, 0, 0, 0.62); pointer-events: none; }

/* G8: cửa sổ chi tiết món đồ (itemModal) */
.item-win { position: fixed; right: 16px; top: 64px; z-index: 150; width: 330px; max-width: calc(100vw - 32px); max-height: calc(100vh - 160px); overflow-y: auto; background: rgba(14, 11, 7, 0.97); border: 1px solid #8a6a2a; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.8); color: #e8dcc0; font-size: 12px; }
.item-win.hidden { display: none; }
.item-win-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px; background: #2a2216; color: #ffd24a; border-bottom: 1px solid #5a4a2a; }
.item-win-body { padding: 6px 8px; }
.item-win .inv-bar { padding: 0 8px 8px; }
.cmp2 { margin: 6px 0; padding: 6px; border: 1px solid #3a3020; background: #15110a; }
.cmpv { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 3px 0; }
.cp { color: #7fe07f; } .cn { color: #ff7a6a; }
.reqbad { color: #ff8a7a; margin: 4px 0; }
.reqnote { color: #c8b890; margin-top: 4px; font-size: 11px; }
.cmp { margin-top: 6px; border-top: 1px dashed #5a4a2a; padding-top: 4px; }

/* G8: màn chọn nhân vật */
.csel-win { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at center, rgba(30, 22, 10, 0.92), rgba(0, 0, 0, 0.97)), url(assets/ui/back1.jpg) center/cover; padding: 16px; overflow-y: auto; }
.csel-box { max-width: 860px; width: 100%; text-align: center; color: #e8dcc0; }
.csel-box h2 { color: #ffd24a; letter-spacing: 3px; text-shadow: 0 0 8px rgba(255, 180, 40, 0.6); margin-bottom: 14px; }
.csel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 12px; }
.csel-card { background: rgba(20, 16, 10, 0.92); border: 1px solid #5a4a2a; padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 230px; }
.csel-card.cur { border-color: #ffd24a; box-shadow: 0 0 10px rgba(255, 210, 74, 0.35); }
.csel-card h4 { color: #c8a868; margin: 0 0 4px; }
.csel-card img { width: 96px; height: 96px; object-fit: cover; border: 1px solid #5a4a2a; }
.csel-card small { color: #c8b890; }
.csel-empty { flex: 1; display: flex; align-items: center; color: #776; font-style: italic; }
.csel-btns { margin-top: auto; display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }

.buff-bar { position: absolute; left: 8px; top: 8px; z-index: 16; background: rgba(10, 8, 6, 0.7); border: 1px solid #4a3a20; color: #ffe9a8; font-size: 11px; padding: 3px 8px; max-width: calc(100% - 200px); }
.buff-bar.hidden { display: none; }
.buff-bar small { color: #c8b890; }

/* G8: điện thoại — thanh tab cuộn ngang ngay trên thanh MU, cửa sổ phủ ngang màn hình */
.m-only { display: none; }
@media (max-width: 700px) {
  :root { --m-hud: calc(51px * var(--mu-s)); --m-tabs: 34px; }
  #top-hud { height: 44px; padding: 0 6px; }
  .hero-meta #heroClass, .hud-center { display: none; }
  .hud-right { gap: 4px; }
  .currency-group { gap: 3px; font-size: 10px; }
  .currency-group .jewel-pill.bless, .currency-group .jewel-pill.soul { display: none; }
  .top-btns { position: fixed; left: 0; right: 0; bottom: var(--m-hud); height: var(--m-tabs); margin: 0; padding: 3px 4px; gap: 4px; overflow-x: auto; overflow-y: hidden; white-space: nowrap; background: rgba(10, 8, 6, 0.92); border-top: 1px solid #4a3a20; z-index: 21; -webkit-overflow-scrolling: touch; }
  .top-btns .mu-top-btn { flex: 0 0 auto; padding: 3px 8px; font-size: 11px; }
  .m-only { display: inline-block; }
  .modal-window { left: 4px !important; right: 4px; top: 48px !important; width: auto !important; max-width: none !important; transform: none !important; max-height: calc(100vh - 48px - var(--m-hud) - var(--m-tabs) - 8px) !important; }
  .item-win { left: 4px; right: 4px; top: 48px; width: auto; max-height: calc(100vh - 48px - var(--m-hud) - var(--m-tabs) - 8px); }
  .log-panel { width: 62%; bottom: calc(var(--m-hud) + var(--m-tabs) + 4px); font-size: 11px; }
  .log-body { max-height: 90px; }
  .mode-sw { top: 114px; right: 6px; }
  .mode-menu { top: 140px; right: 6px; }
  .ride-btn { top: 140px; right: 6px; }
  .buff-bar { max-width: calc(100% - 140px); font-size: 10px; }
  .gift-days { grid-template-columns: repeat(4, 1fr); }
  .qrow { flex-wrap: wrap; }
  .qrow .btnrow { max-width: 100%; }
  .csel-card { min-height: 0; }
  .char-tab-layout, .inv-tab-layout { grid-template-columns: 1fr; gap: 8px; }
  .inv-grid-64 { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 2px; padding: 4px; }
  .inv-grid-64 .inv-slot { width: auto; height: auto; aspect-ratio: 1; }
  .modal-content { padding: 6px !important; }
  .modal-header { padding: 0 64px 4px 12px !important; }
}
@media (max-width: 700px) { .dtabs { flex-wrap: wrap; } .dtabs button { padding: 3px 8px; } }

/* ===================================================================================================
   BỘ UI MU THỐNG NHẤT — đè lên các kiểu cũ ở trên. Nút / checkbox / nút đóng dùng ảnh gốc client MU
   (assets/ui/kit: cắt từ newui_btn_empty, newui_option_check, newui_exit_00), bảng màu như Xưởng Nhân Vật.
   =================================================================================================== */
:root {
  --k-gold: #e8c46a;
  --k-gold2: #ffdf8a;
  --k-text: #ece3d0;
  --k-dim: #b9ac92;
  --k-line: #3b3022;
  --k-line2: #5a4a30;
  --k-card: rgba(22, 18, 13, 0.82);
}

/* --- Nút MU (3 trạng thái: thường / rê chuột / nhấn) --- */
.btn-util, .btn-select-skill, .btn-stat, .mu-top-btn, .btn-soul, .btn-chaos, .btn-bless, .town-bar button,
.mode-sw, .ride-btn, .offline-box button, .dtabs button, .btn-travel, .btn-map, .btn-map-warp, .chaos-row-btns button,
#btnSaveGame, #btnResetGame {
  border: 5px solid transparent;
  border-image: url(assets/ui/kit/btn_n.png) 5 fill / 5px stretch;
  background: none;
  border-radius: 0;
  box-shadow: none;
  color: #eadcb4;
  font-weight: 600;
  font-size: 12px;
  line-height: 1.2;
  padding: 1px 8px;
  min-height: 26px;
  text-shadow: 0 1px 2px #000, 0 0 3px #000;
  cursor: pointer;
  transition: color 0.12s;
}
.btn-util:hover:not(:disabled), .btn-select-skill:hover:not(:disabled), .btn-stat:hover:not(:disabled), .mu-top-btn:hover,
.btn-soul:hover, .btn-chaos:hover, .btn-bless:hover, .town-bar button:hover, .mode-sw:hover, .ride-btn:hover,
.offline-box button:hover, .dtabs button:hover, .btn-travel:hover:not(:disabled), .btn-map:hover, .btn-map-warp:hover,
.chaos-row-btns button:hover, #btnSaveGame:hover, #btnResetGame:hover {
  border-image-source: url(assets/ui/kit/btn_h.png);
  color: #fff;
  border-color: transparent;
}
.btn-util:active:not(:disabled), .btn-select-skill:active:not(:disabled), .btn-stat:active:not(:disabled), .mu-top-btn:active,
.dtabs button:active, .town-bar button:active, .chaos-row-btns button:active {
  border-image-source: url(assets/ui/kit/btn_p.png);
}
.btn-util:disabled, .btn-select-skill:disabled, .btn-stat:disabled, .btn-travel:disabled { opacity: 0.45; filter: grayscale(0.7); cursor: not-allowed; }
.btn-util.danger, #btnResetGame { color: #ff9f8f; }
.btn-util.on, .btn-select-skill.hot, .ride-btn.on { color: var(--k-gold2); border-image-source: url(assets/ui/kit/btn_h.png); }
.btn-select-skill.hot { box-shadow: 0 0 8px rgba(255, 210, 74, 0.45); }
.btn-stat { min-width: 34px; padding: 0 6px; min-height: 24px; color: #ffe29a; }
/* tab: tab đang chọn sáng + chữ vàng */
.dtabs { gap: 3px; flex-wrap: wrap; }
.dtabs button { color: var(--k-dim); }
.dtabs button.on { border-image-source: url(assets/ui/kit/btn_h.png); color: var(--k-gold2); }
.dtabs .shop-zen { border: 0; border-image: none; }

/* --- Thanh trên: dải đá tối + đường viền vàng, nút MU --- */
#top-hud {
  background: linear-gradient(180deg, rgba(34, 27, 18, 0.97) 0%, rgba(12, 10, 7, 0.97) 100%);
  border-bottom: 1px solid #7a6232;
  box-shadow: 0 1px 0 #000, 0 4px 14px rgba(0, 0, 0, 0.75);
}
.mu-top-btn { height: auto; min-height: 28px; padding: 1px 10px; font-size: 12px; }
.lvl-badge { border-radius: 2px; border-color: #c99a3a; }
.zen-box, .jewel-pill { border-radius: 2px; background: rgba(0, 0, 0, 0.55); }

/* --- Ô chọn, ô nhập, checkbox kiểu MU --- */
.modal-content select, .modal-content input[type=text], .modal-content input[type=number], .create-box input, #rename-input, .item-win select {
  background: #120f0b;
  color: var(--k-text);
  border: 1px solid var(--k-line2);
  border-radius: 2px;
  padding: 3px 6px;
  font: inherit;
  font-size: 12px;
  outline: none;
}
.modal-content select:focus, .modal-content input:focus, .create-box input:focus { border-color: var(--k-gold); }
.modal-content select option { background: #17130f; color: var(--k-text); }
input[type=checkbox] {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  margin: 0 5px 0 0;
  vertical-align: -3px;
  background: url(assets/ui/kit/chk_off.png) 0 0 / 15px 15px no-repeat;
  cursor: pointer;
  flex: none;
}
input[type=checkbox]:checked { background-image: url(assets/ui/kit/chk_on.png); }
input[type=checkbox]:disabled { opacity: 0.4; cursor: not-allowed; }
input[type=range] { accent-color: var(--k-gold); }

/* --- Thanh cuộn: rãnh tối + con trượt đồng --- */
.modal-content, .log-body, .zone-list, .item-win, .shoplist, .csel-win {
  scrollbar-width: thin;
  scrollbar-color: #8a6a2e #0d0b08;
}
.modal-content::-webkit-scrollbar, .log-body::-webkit-scrollbar, .zone-list::-webkit-scrollbar, .item-win::-webkit-scrollbar,
.shoplist::-webkit-scrollbar { width: 9px; height: 9px; }
.modal-content::-webkit-scrollbar-track, .log-body::-webkit-scrollbar-track, .zone-list::-webkit-scrollbar-track,
.item-win::-webkit-scrollbar-track, .shoplist::-webkit-scrollbar-track {
  background: #0d0b08 url(assets/ui/newui_scrollbar_m.png) center / 7px 15px repeat-y;
}
.modal-content::-webkit-scrollbar-thumb, .log-body::-webkit-scrollbar-thumb, .zone-list::-webkit-scrollbar-thumb,
.item-win::-webkit-scrollbar-thumb, .shoplist::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, #5e4518, #b48a3a 50%, #5e4518);
  border: 1px solid #241a0a;
  border-radius: 2px;
}
.modal-content::-webkit-scrollbar-button, .log-body::-webkit-scrollbar-button { display: none; }

/* --- Nút đóng cửa sổ: nút X của client thay ảnh chữ "Close" --- */
.modal-header .btn-close {
  width: 36px;
  height: 29px;
  right: 28px;
  top: 12px;
  background: url(assets/ui/kit/x_n.png) 0 0 / 36px 29px no-repeat;
  border: 0;
}
.modal-header .btn-close:hover { background: url(assets/ui/kit/x_h.png) 0 0 / 36px 29px no-repeat; }
.modal-header .btn-close:active { background: url(assets/ui/kit/x_h.png) 0 1px / 36px 29px no-repeat; }

/* --- Chữ: gợi ý / mô tả đọc được (không nghiêng, không xám nhạt) --- */
.pd-hint, .char-3d-hint, .settings-section .section-desc, .empty-text, .zrow small, .qrow small, .gift-day small, .csel-card small {
  font-style: normal;
  color: var(--k-dim);
  font-size: 12px;
}
.modal-content { color: var(--k-text); font-size: 13px; }
.modal-content p.hint, .modal-content .hint { color: var(--k-dim); font-style: normal; font-size: 12px; }
/* tiêu đề vùng trên ảnh nền vùng (Devias tuyết sáng): phủ dải tối để chữ vàng luôn đọc được */
.zone-map-head {
  background-blend-mode: multiply;
  background-color: rgba(0, 0, 0, 0.55);
  border-left: 3px solid var(--k-gold);
  padding: 5px 10px;
  text-shadow: 0 1px 2px #000, 0 0 4px #000;
}
/* ô nhật ký cuối cửa sổ: chỉ hiện khi có nội dung */
.chaos-log:empty { display: none; }

/* --- Cửa sổ nhân vật: chỉ số 1 cột (không gãy dòng), paperdoll nền đá ấm --- */
.char-stats-grid { grid-template-columns: 1fr; gap: 6px; }
.stat-row { padding: 5px 10px; background: var(--k-card); border-color: var(--k-line); font-size: 13px; white-space: nowrap; gap: 8px; }
.stat-row > :first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.char-header, .char-combat-stats { background: var(--k-card); border-color: var(--k-line); border-radius: 2px; }
.mu-paperdoll {
  background: radial-gradient(circle at 50% 38%, #2e2518 0%, #120e09 75%), #120e09;
  border: 1px solid #6b5a30;
  border-radius: 2px;
}
.pd-hero-figure { width: 110px; height: 132px; display: flex; align-items: flex-end; justify-content: center; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.8)); }
.sp-ava { display: inline-block; flex: none; background-repeat: no-repeat; }
.char-header .char-avatar { width: 64px; height: 64px; border: 1px solid #6b5a30; border-radius: 2px; background-color: #120e09; }
.goblin-avatar { width: 72px; height: 72px; background-color: #120e09; }
.btn-class-pick .sp-ava { background-color: #120e09; border: 1px solid #000; }

/* --- Màn chọn nhân vật: nền thành Lorencia thật, nhân vật đứng toàn thân --- */
.csel-win {
  background: linear-gradient(180deg, rgba(8, 6, 4, 0.55), rgba(8, 6, 4, 0.88)), url(assets/maps/bg/town.webp) center / cover;
}
.csel-card { background: rgba(16, 13, 9, 0.86); border: 1px solid #6b5a30; border-radius: 2px; }
.csel-card.cur { border-color: var(--k-gold); }
.csel-fig { width: 150px; height: 180px; background: radial-gradient(ellipse 50% 42% at 50% 62%, rgba(255, 200, 110, 0.22), transparent 70%); display: flex; align-items: flex-end; justify-content: center; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.85)); }
.csel-card .csel-btns { display: flex; gap: 6px; margin-top: 4px; }
.csel-warn { color: #ff9a7a; font-size: 12px; line-height: 1.35; margin-top: 4px; }

/* --- Ô đồ không mặc được: viền đỏ mờ, không chói --- */
.inv-slot.bad { border-color: rgba(190, 60, 50, 0.55) !important; box-shadow: inset 0 0 8px rgba(160, 30, 20, 0.35); }

/* --- Bảng nổi trên sân đấu: nhật ký, buff, chế độ — cùng kiểu thẻ tối viền đồng --- */
.log-panel, .buff-bar, .mode-menu, .town-bar, .dg-hud {
  background: rgba(14, 11, 8, 0.82);
  border: 1px solid #6b5a30;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}
.log-head { background: linear-gradient(180deg, rgba(60, 46, 24, 0.9), rgba(30, 23, 13, 0.9)); border-bottom: 1px solid #4a3a20; font-weight: 600; }
.buff-bar { padding: 4px 9px; border-radius: 2px; }
.mode-sw, .ride-btn { min-height: 28px; font-size: 12px; }
.todochip { border-radius: 2px; background: rgba(40, 32, 20, 0.9); }
.stat-row > :first-child { flex: 1; }
.stat-row .btn-stat { margin-left: 4px; }
.pd-wings-fx { display: none !important; } /* cánh đã có trên sprite nhân vật */
.zone-map-head { background-size: cover; background-position: center 40%; }

/* Ô HUD 4, 5, ô xanh (thú cưỡi / quà / chế độ) */
.hud-act.off img { filter: grayscale(1) brightness(0.55); }
.hud-act.on { box-shadow: inset 0 0 0 1px #ffd24a, 0 0 6px rgba(255, 210, 74, 0.8); }
.hud-act.has-dot::after { content: ''; position: absolute; right: 2px; top: 2px; width: 7px; height: 7px; border-radius: 50%; background: #ff3a2a; box-shadow: 0 0 4px #ff3a2a; }
.hud-mode b { font-size: 17px; line-height: 1; filter: drop-shadow(0 1px 2px #000); }
/* Nhật ký nổi gọn: hẹp hơn, 4 dòng gần nhất, chip "Việc cần làm" một hàng cuộn ngang; mờ khi không rê chuột */
.log-panel { width: 300px; opacity: 0.88; transition: opacity 0.15s; }
.log-panel:hover { opacity: 1; }
.log-body { max-height: 74px; }
.todo-box { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; white-space: nowrap; }
.todo-box::-webkit-scrollbar { display: none; }
.todo-box .todochip { flex: none; }

/* Thanh MU 2 hàng trên điện thoại (app.js: fitHud) */
body.hud-2row { --m-hud: calc(102px * var(--mu-s)); }
.hud-2row #mu-hud { width: calc(384px * var(--mu-s)); height: calc(102px * var(--mu-s)); }
.hud-2row .mu-bar { width: 384px; height: 102px; }
.hud-2row .mu-bar > :not(.r2) { translate: 0 51px; }
.hud-2row .mu-bar > .r2 { translate: -320px 0; }
.hud-2row .mu-xp { width: 368px; }
.hud-2row .mu-bar .xp-text { width: 384px; }
.top-btns { scrollbar-width: none; }
.top-btns::-webkit-scrollbar { display: none; }


/* Ô đồ: hiệu ứng cấp + / excellent kiểu client MU (src/mu-glow.js) — lớp phủ cắt theo hình icon (mask), texture Chrome/Shiny gốc */
.inv-slot, .eq-slot { position: relative; }
.mu-gl { position: absolute; left: 50%; top: 50%; width: 38px; height: 38px; transform: translate(-50%, -50%); pointer-events: none;
  -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat; }
.mu-gl.l3 { background: rgb(255, 153, 153); mix-blend-mode: multiply; animation: muLum 1.6s ease-in-out infinite alternate; }
.mu-gl.l5 { background: rgb(128, 179, 255); mix-blend-mode: multiply; animation: muLum 1.6s ease-in-out infinite alternate; }
.mu-gl.l7, .mu-gl.l9, .mu-gl.l11, .mu-gl.l13 { background-image: url(assets/fx/mu/chrome01.jpg); background-size: 38px 38px; background-color: var(--c1);
  background-blend-mode: multiply; mix-blend-mode: plus-lighter; animation: muChrome 10s linear infinite; }
.mu-gl.l9, .mu-gl.l11, .mu-gl.l13 { background-image: url(assets/fx/mu/shiny01.jpg), url(assets/fx/mu/chrome01.jpg); background-size: 42px 42px, 38px 38px;
  background-position: center, 0 0; background-repeat: no-repeat, repeat; animation: muChrome2 10s linear infinite; }
.mu-gl.l11::after, .mu-gl.l13::after { content: ''; position: absolute; inset: 0; background: url(assets/fx/mu/chrome02.jpg) 0 0 / 24px 24px; background-color: var(--c2);
  background-blend-mode: multiply; mix-blend-mode: plus-lighter; animation: muChromeB 5s linear infinite; }
.mu-gl.l13::after { animation: muChromeC 6.3s linear infinite; }
/* excellent (ZzzObject.cpp RenderPartObjectEffect): vẽ lại CHÍNH texture món × màu (L, 0.3L, 1−L) rồi cộng sáng (RENDER_BRIGHT) —
   chỗ sáng của món ánh màu, chỗ tối giữ tối, món giữ đúng màu / hoa văn (như addSelf của mu-glow.js trên sprite, cường độ 0.55).
   L = sin(t·0.002)·0.5 + 0.5 → một vòng đỏ ↔ xanh 3.14 s (alternate 1.57 s) */
.mu-gl.exc::before { content: ''; position: absolute; inset: 0; background: var(--ic) center / contain no-repeat; background-blend-mode: multiply;
  mix-blend-mode: plus-lighter; opacity: 0.55; animation: muExc 1.57s ease-in-out infinite alternate; }
/* exc không kèm chrome: cả lớp phủ cộng sáng lên icon (để normal thì lớp màu tô đè thành mảng phẳng, mất hình món) */
.mu-gl.exc:not(.l7):not(.l9):not(.l11):not(.l13) { mix-blend-mode: plus-lighter; }
@keyframes muLum { from { opacity: 0.55; } to { opacity: 0.85; } }
@keyframes muChrome { from { background-position: 0 0; } to { background-position: -38px -76px; } }
@keyframes muChrome2 { from { background-position: center, 0 0; } to { background-position: center, -38px -76px; } }
@keyframes muChromeB { from { background-position: 19px 29px; } to { background-position: -38px -58px; } }
@keyframes muChromeC { 0% { background-position: 0 0; } 25% { background-position: 18px -12px; } 50% { background-position: 0 -24px; } 75% { background-position: -18px -12px; } 100% { background-position: 0 0; } }
@keyframes muExc { from { background-color: rgb(255, 77, 0); } 50% { background-color: rgb(128, 38, 128); } to { background-color: rgb(0, 0, 255); } }

/* Dọn kho (ui-donkho.js) */
.dk-ck { display: block; margin: 2px 0; }
.dk-tbl { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 12px; }
.dk-tbl th, .dk-tbl td { border: 1px solid var(--k-line); padding: 4px 8px; text-align: left; }
.dk-tbl th { color: var(--k-gold); background: rgba(40, 30, 16, 0.6); }
.dk-warn { border-color: #8a2a2a; }
/* ô thuốc: icon bình thuốc bake (trong suốt) */
.pot-btn.mu-slot img { object-fit: contain; }

/* Điều khiển tay (input.js): Auto / Tự điều khiển, Xoay chiêu — ngay dưới nút Chế Độ / Lên thú */
.ctrl-btn, .rot-btn { position: absolute; right: 8px; z-index: 18; min-height: 26px; font-size: 12px;
  border: 5px solid transparent; border-image: url(assets/ui/kit/btn_n.png) 5 fill / 5px stretch; background: none; color: #eadcb4;
  font-weight: 600; text-shadow: 0 1px 2px #000; padding: 1px 8px; cursor: pointer; }
.ctrl-btn { top: 198px; }
.rot-btn { top: 226px; }
.ctrl-btn:hover, .rot-btn:hover { border-image-source: url(assets/ui/kit/btn_h.png); color: #fff; }
.ctrl-btn:not(.on) { color: #ffb070; }
.rot-btn:not(.on) { color: #a89878; }
@media (max-width: 700px) { .ctrl-btn { top: 166px; right: 6px; } .rot-btn { top: 194px; right: 6px; } }
#arena { touch-action: none; }
.ep-card .dk-ck { display: block; margin: 3px 0; }

/* Hộp xác nhận trong game (src/ui-ask.js) — thay window.confirm */
.mu-ask { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.55); padding: 16px; }
.mu-ask-box { width: 380px; max-width: 100%; background: rgba(16, 13, 9, 0.97); border: 1px solid #8a6a2a; box-shadow: 0 0 0 1px #000, 0 8px 28px rgba(0, 0, 0, 0.85); padding: 16px 18px 14px; color: #e8dcc0; text-align: center; }
.mu-ask-msg { margin: 0 0 14px; font-size: 13px; line-height: 1.5; white-space: pre-line; }
.mu-ask-btns { display: flex; gap: 10px; justify-content: center; }
.mu-ask-btns .btn-util { min-width: 96px; }

/* Con trỏ chuột của client MU (ZzzInterface.cpp: RenderCursor, ảnh Data/Interface/Cursor*.tga; vẽ lệch 2px → điểm nhấn góc trên
   trái): mặc định Cursor ở mọi nơi kể cả cửa sổ/nút; trên sân đổi theo thứ dưới chuột (src/input.js: hoverCursor). */
html, body, body * { cursor: url(assets/ui/cursor.png) 3 3, default !important; }
input[type="text"], input:not([type]), input[type="number"], input[type="search"], textarea { cursor: text !important; }
#arena.cur-attack { cursor: url(assets/ui/cursorattack.png) 3 3, crosshair !important; }
#arena.cur-get { cursor: url(assets/ui/cursorget.png) 3 3, pointer !important; }
#arena.cur-push { cursor: url(assets/ui/cursorpush.png) 3 3, grabbing !important; }
#arena.cur-dontmove { cursor: url(assets/ui/cursordontmove.png) 3 3, not-allowed !important; }
.mu-ask-box { max-height: calc(100vh - 32px); overflow-y: auto; }
.mu-ask-title { margin: 0 0 8px; color: #ffd24a; font-size: 14px; letter-spacing: 1px; }
.mu-ask-box .mu-ask-btns { flex-wrap: wrap; margin-top: 8px; }
.mu-ask-num { width: 110px; font-size: 16px; padding: 4px 6px; background: #0d0a06; color: #ffe29a; border: 1px solid #8a6a2a; text-align: center; }
.mu-ask-stats { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; text-align: left; font-size: 12px; margin: 0 auto 6px; max-width: 260px; }
.mu-ask-card { text-align: left; font-size: 12px; line-height: 1.5; background: rgba(0, 0, 0, 0.35); border: 1px solid #4a3c22; padding: 8px 10px; margin: 8px 0; }
.mu-ask-card .dim { color: #a89878; }
.pts-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 6px 0 2px; color: #e8dcc0; }

#modeMenu button.on { color: #ffd24a; box-shadow: inset 0 0 0 1px #c8a050; }
#dgHud.click { cursor: pointer; pointer-events: auto; }
.pd-hint.rank-on { color: #ffd24a; background: rgba(255, 210, 74, 0.08); }

/* Cụm C: chấm hệ quái trên bản đồ (ui.js của Võ Lâm: seriesDots) */
.sdot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 2px; vertical-align: middle; box-shadow: 0 0 0 1px #000; }

/* Cụm A: cửa sổ Nhân vật / Kỹ năng (port renderChar20 / renderSkill20 / skillTipJX của Võ Lâm) */
.skill-opts { display: flex; flex-direction: column; gap: 2px; padding: 0 4px 8px; font-size: 12px; color: #e8dcc0; }
.skill-foot { font-size: 12px; color: #a89878; padding: 6px 4px 2px; }
.skill-card.lock h4 { color: #b0a080; }
.sk-req-bad { color: #ff6a5a; font-weight: bold; }
.skb { color: #7fe08a; }
.sk-open { display: inline-block; }
.sktag { display: inline-block; font-size: 11px; padding: 0 5px; border: 1px solid #5a4a2a; border-radius: 2px; color: #e8dcc0; background: rgba(0, 0, 0, 0.35); vertical-align: middle; }
.sktag.buff { color: #7fe08a; border-color: #2f6a35; }
.sktag.aura { color: #ffd24a; border-color: #8a6a2a; }
.sktag.curse { color: #ff8a7a; border-color: #8a2a2a; }
.btn-util.sm { min-width: 0; padding: 0 8px; font-size: 11px; line-height: 18px; }
.mu-ask-box:has(.skd) { width: 440px; }
.skd { text-align: left; }
.skd-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.skd-head .mu-ask-title { margin: 0 0 4px; }
.skd-head small { color: #a89878; font-weight: normal; letter-spacing: 0; }
.skd-lines { font-size: 12px; line-height: 1.55; }
.skd-lines .b { color: #e8dcc0; }
.skd-lines .in { color: #c8b890; font-style: normal; }
.skd-lines .rq { color: #ff6a5a; }
.skd-lines .g { color: #7fe08a; }
.skd-lines .tt { color: #ffd24a; margin-top: 4px; }
.skd-lines .m { color: #9fd0ff; }
.skd-lines .h { color: #8a8070; }
.skd-lines .sep { border-top: 1px solid #4a3c22; margin: 6px 0; }
.char-combat-stats .cs-note, .char-combat-stats .cs-gear { color: #7fe08a; font-size: 11px; }
.char-combat-stats .cs-res { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 2px; }
.char-tab-layout + .reqbad { padding: 6px 8px; font-size: 12px; background: rgba(60, 10, 10, 0.35); border: 1px solid #6a2a2a; }

/* Cụm A (lead): chỉ số khởi đầu khi tạo nhân vật, nút được hướng dẫn nhắc tới nhấp nháy */
.btn-class-pick .cc-st { display: block; color: #c8b890; font-size: 10px; margin-top: 2px; }
.tut-hl { animation: tutHl 0.9s ease-in-out infinite alternate; }
@keyframes tutHl { from { filter: brightness(1); box-shadow: none; } to { filter: brightness(1.5); box-shadow: 0 0 10px 2px rgba(255, 210, 74, 0.8); } }

/* Cụm D: Hệ Thống (ô đánh dấu, ngưỡng thuốc, mã lưu), cấp chiêu + bảng chọn chiêu trên ô Q–R, hồi thuốc, số trên ô thú cưỡi,
   cỡ chữ (main.js của Võ Lâm: --fs) */
.sys-ck { display: block; font-size: 12px; margin: 3px 0; line-height: 1.4; }
.sys-ck input { vertical-align: middle; margin-right: 4px; }
.sys-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 12px; margin: 4px 0 6px 20px; }
.sys-row input[type="range"] { flex: 1; max-width: 220px; }
.sys-pot select, .sys-row select { background: #0d0a06; color: #ffe29a; border: 1px solid #6a5426; font-size: 12px; }
.sys-code { width: 100%; box-sizing: border-box; margin-top: 6px; background: #0d0a06; color: #ffe29a; border: 1px solid #6a5426; font: 11px monospace; resize: vertical; }
.btn-class-pick:disabled { opacity: 0.55; cursor: default; }
.btn-class-pick.active:disabled { opacity: 1; }
.skill-slot .sklv { position: absolute; right: 3px; bottom: 1px; font: bold 9px/1 sans-serif; text-decoration: none; color: #e8dcc0; text-shadow: 0 0 2px #000, 0 0 2px #000; pointer-events: none; }
.skill-slot .sklv.up { color: #7fe07f; }
.sk-pick { position: fixed; z-index: 900; max-width: 300px; background: rgba(16, 13, 9, 0.96); border: 1px solid #8a6a2a; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.8); padding: 5px 6px; color: #e8dcc0; }
.sk-pick .nm { font-size: 11px; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sk-pick .nm small { color: #a89878; }
.sk-pick-list { display: flex; flex-wrap: wrap; gap: 3px; }
.sk-pick .spk { position: relative; width: 32px; height: 36px; padding: 0; background: #15120c; border: 1px solid #4a3c22; display: flex; align-items: center; justify-content: center; color: #ff7a6a; font-size: 14px; }
.sk-pick .spk:hover, .sk-pick .spk.on { border-color: #ffd24a; }
.sk-pick .spk i { position: absolute; left: 1px; top: 0; font: bold 9px/1 sans-serif; font-style: normal; color: #ffd24a; text-shadow: 0 0 2px #000; }
.sk-pick .spk u { position: absolute; right: 1px; bottom: 0; font: bold 9px/1 sans-serif; text-decoration: none; color: #e8dcc0; text-shadow: 0 0 2px #000; }
.pot-btn .pot-cd { position: absolute; left: 2px; right: 2px; bottom: 2px; height: 0; background: rgba(0, 0, 0, 0.6); pointer-events: none; }
.hud-badge { position: absolute; top: 0; right: 0; min-width: 12px; padding: 0 2px; border-radius: 6px; background: #ff3b30; color: #fff; font: bold 9px/12px sans-serif; text-align: center; box-shadow: 0 0 4px #ff3b30; pointer-events: none; }
.hud-badge.hidden { display: none; }
.modal-window, .log-panel, .mu-ask-box { zoom: var(--fs, 1); }

/* Cụm E: phản hồi trong trận — hàng biểu tượng trạng thái (style.css của Võ Lâm: #skBuffs .sti), khung máu trùm (ui20.css: #u20boss),
   màu dòng nhật ký kinh nghiệm / Zen (.xpl b, .gdl b) */
.buff-bar { display: flex; flex-wrap: wrap; gap: 2px; max-width: 60%; padding: 0; background: none; border: 0; box-shadow: none; pointer-events: none; }
.buff-bar.hidden { display: none; }
.buff-bar .sti { width: 26px; text-align: center; pointer-events: auto; }
.buff-bar .sti > i, .buff-bar .sti-em { display: block; margin: 0 auto; height: 22px; border: 1px solid #000; background: rgba(0, 0, 0, 0.53); }
.buff-bar .sti-em { width: 22px; font-size: 14px; line-height: 22px; }
.buff-bar .sti b { display: block; font: 700 9px/10px "Segoe UI", Tahoma, sans-serif; color: #5dff5d; text-shadow: 0 0 2px #000, 0 0 2px #000, 0 0 1px #000; }
.boss-frame { position: absolute; left: 50%; transform: translateX(-50%); top: 40px; width: min(34vw, 440px); z-index: 17; text-align: center; pointer-events: none; }
.boss-frame.hidden { display: none; }
.boss-frame .t { color: #ffd970; font-weight: 700; font-size: 12px; text-shadow: 0 1px 2px #000; }
.boss-frame .b { height: 12px; border: 2px solid #8c7440; border-radius: 7px; background: #200; margin-top: 2px; position: relative; overflow: hidden; }
.boss-frame .b i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(#e44, #911); }
.boss-frame .b span { position: absolute; inset: 0; font-size: 10px; line-height: 12px; color: #fff; text-shadow: 0 0 2px #000; }
.log-body .xpl b { color: #7fe07f; }
.log-body .gdl b { color: #ffd24a; }
/* Cụm D: Bách khoa (guide.js của Võ Lâm: codexModal) */
.mu-ask-box .codex { max-height: 60vh; overflow-y: auto; margin-top: 6px; }
.mu-ask-box .dtabs { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }

/* Cụm B: hành trang / kho chung / máy Chaos / bộ lọc / Cửa Hàng WCoin (ui.js của Võ Lâm: itemCell .s5 / .lk, upMark △, rương mở rộng) */
.inv-slot .s5 { position: absolute; right: 2px; bottom: 2px; width: 6px; height: 6px; border-radius: 50%; box-shadow: 0 0 0 1px #000; pointer-events: none; }
.inv-slot .lk, .eq-slot .lk { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); font-size: 10px; text-decoration: none; line-height: 1; text-shadow: 0 0 2px #000; pointer-events: none; }
.inv-slot .up.pot { color: #7fc8ff; }
.eq-slot.bad { box-shadow: inset 0 0 8px rgba(200, 40, 30, 0.6) !important; border-color: rgba(200, 60, 50, 0.8) !important; }
.inv-rx { margin-top: 6px; border-top: 1px solid #4a3c22; padding-top: 4px; }
.inv-rx-lk { text-align: center; padding: 8px; color: #e8dcc0; }
.section-title select { margin-left: 6px; font-size: 11px; background: #0d0a06; color: #e8dcc0; border: 1px solid #5a4a2a; }
.section-title .btn-select-skill { margin-left: 6px; font-size: 11px; padding: 1px 8px; }
.section-title .btn-select-skill.on, .loot-modes .btn-select-skill.on { color: #ffd24a; box-shadow: inset 0 0 0 1px #c8a050; }
.loot-modes small { color: #a89878; font-size: 10px; }
.chaos-item-row .inv-slot { flex: 0 0 auto; width: 44px; height: 44px; }
.chaos-item-row .inv-slot img { width: 100%; height: 100%; border: 0; }
.chaos-item-row.picked { border-color: #ffd24a; box-shadow: 0 0 6px rgba(255, 210, 74, 0.35); }
.chaos-row-btns button:disabled { opacity: 0.45; cursor: default; border-color: #443c2c; color: #888; }
.chaos-row-info .text-red, .text-red { color: #ff6a5a; }
@media (max-width: 660px) {
  .chaos-item-row { flex-wrap: wrap; }
  .chaos-row-btns { display: flex; flex-wrap: wrap; gap: 4px; }
}

/* Nhãn chiêu chính trên ô Q (control.js của Võ Lâm: #bMain) */
.main-chip { position: absolute; left: 16px; bottom: 100%; margin-bottom: 1px; display: flex; align-items: center; gap: 2px; max-width: 110px; padding: 0 4px 0 1px; font-size: 7px; line-height: 12px; color: #ffe29a; background: rgba(12, 9, 5, 0.82); border: 1px solid #6b5a30; border-radius: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; pointer-events: auto; text-shadow: 0 0 2px #000; }
.main-chip span { overflow: hidden; text-overflow: ellipsis; }
.main-chip:empty { display: none; }

/* Stadium nhiều người chơi (src/stadium-ui.js) */
.stadium-bar .st-status { color: #cfe6ff; font-size: 12px; }
.log-panel .hidden { display: none; }
.log-tabs { display: flex; gap: 4px; }
.log-head .log-tabs button { font-size: 12px; color: #a89068; padding: 0 4px; }
.log-head .log-tabs button.on { color: #ffd24a; }
#stChatBody { max-height: 112px; overflow-y: auto; }
#stChatBody b { color: #9fd8ff; }
#stChatBody .me b { color: #9fe8a0; }
#stChatIn { width: 100%; box-sizing: border-box; margin-top: 3px; background: #0f0c08; border: 1px solid #4a3a20; color: #e8dcc0; font-size: 12px; padding: 3px 5px; }
.st-login .st-in { display: block; width: 100%; box-sizing: border-box; margin: 0 0 8px; padding: 6px 8px; background: #0f0c08; border: 1px solid #5a4b2c; color: #e8dcc0; }
.st-login .st-in[hidden] { display: none; } /* display:block ở trên đè thuộc tính hidden */
.st-login-tabs { display: flex; gap: 6px; justify-content: center; margin-bottom: 10px; }
.st-login-tabs .on { border-color: #ffd24a; color: #ffd24a; }
.st-err { min-height: 16px; color: #ff7a6a; font-size: 12px; margin-bottom: 8px; }
.st-prof-head { margin-bottom: 10px; line-height: 1.6; }
.st-prof-grid { display: grid; grid-template-columns: repeat(4, 48px); gap: 6px; justify-content: center; margin-bottom: 10px; }
.map-stadium { display: block; width: 100%; margin: 8px 0; }
/* HUD phóng theo --mu-s (tới ×2.4) + chip chiêu chính cao hơn 112px → đầu khung nhật ký thu gọn (nút mở, tab Stadium) bị đè */
@media (min-width: 701px) { .log-panel { bottom: max(112px, calc(66px * var(--mu-s, 1) + 6px)); } }
/* Đấu tay đôi (src/stadium-ui.js) — bảng đấu như client MU (NewUIDuelWindow: mình xanh, đối thủ đỏ) */
.duel-hud { position: absolute; left: 50%; top: 104px; transform: translateX(-50%); z-index: 21; width: 260px; padding: 6px 10px; background: rgba(12, 9, 5, 0.88); border: 1px solid #8a6a2a; color: #e8dcc0; font-size: 12px; }
.duel-hud.hidden { display: none; }
.duel-hud .dh-t { color: #ffd24a; text-align: center; margin-bottom: 4px; }
.duel-hud .dh-row { display: grid; grid-template-columns: 1fr 22px; align-items: center; gap: 2px 6px; margin: 3px 0; }
.duel-hud .dh-row b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duel-hud .me b { color: #4fa8ff; }
.duel-hud .op b { color: #ff5a4a; }
.duel-hud .dh-sc { font-weight: bold; text-align: right; color: #ffd24a; }
.duel-hud .dh-hp { grid-column: 1 / span 2; height: 6px; background: #2a1d10; display: block; }
.duel-hud .dh-hp i { display: block; height: 100%; background: #d23a2a; transition: width 0.2s; }
.duel-hud .me .dh-hp i { background: #3a8ad2; }
.st-elo { color: #ffd24a; font-size: 12px; }
.st-why { color: #ff9a7a; font-size: 12px; margin: 6px 0 0; }
.st-errs { text-align: left; color: #ff9a7a; font-size: 12px; margin-bottom: 10px; line-height: 1.6; }
.st-rank { max-height: 50vh; overflow-y: auto; margin-bottom: 8px; }
.st-rank table { width: 100%; border-collapse: collapse; font-size: 12px; }
.st-rank th { color: #ffd24a; position: sticky; top: 0; background: rgba(16, 13, 9, 0.97); }
.st-rank td, .st-rank th { padding: 3px 4px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); text-align: left; }
.st-rank tr.me td { color: #9fe8a0; }
