:root {
  --nx108-ink: #eef8ff;
  --nx108-muted: #9bb5c9;
  --nx108-night: rgba(4, 17, 31, 0.97);
  --nx108-panel: linear-gradient(145deg, rgba(12, 42, 68, 0.98), rgba(4, 17, 31, 0.99) 58%, rgba(12, 27, 47, 0.99));
  --nx108-line: rgba(133, 220, 255, 0.58);
  --nx108-blue: #43d8ff;
  --nx108-gold: #ffd777;
  --nx108-green: #66e58a;
  --nx108-purple: #c078ff;
  --nx108-danger: #ff7b86;
}

.nx108-root,
.nx108-root *,
.nx108-root *::before,
.nx108-root *::after {
  box-sizing: border-box;
}

.nx108-root {
  position: relative;
  z-index: 950;
  color: var(--nx108-ink);
  font-family: "Noto Sans", "Segoe UI", Arial, sans-serif;
  letter-spacing: 0.01em;
}

.nx108-root [hidden],
.overhead-layer [hidden],
.loot-flight-layer [hidden] {
  display: none !important;
}

.nx108-root button,
.nx108-root input {
  color: inherit;
  font: inherit;
}

.nx108-root button {
  -webkit-tap-highlight-color: transparent;
}

.nx108-layer,
.nx108-sub-layer {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 3.5vh 3vw;
  background:
    radial-gradient(circle at 50% 34%, rgba(22, 111, 156, 0.24), transparent 44%),
    rgba(0, 7, 15, 0.76);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.nx108-layer { z-index: 960; }
.nx108-sub-layer { z-index: 970; }

.nx108-panel,
.nx108-flow-card,
.nx108-item-card,
.nx108-confirm-card,
.nx108-interaction {
  position: relative;
  border: 1px solid var(--nx108-line);
  border-radius: 20px 8px 20px 8px;
  background: var(--nx108-panel);
  box-shadow:
    0 25px 80px rgba(0, 0, 0, 0.68),
    inset 0 0 0 2px rgba(196, 235, 255, 0.05),
    inset 0 1px rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.nx108-panel::before,
.nx108-flow-card::before,
.nx108-item-card::before,
.nx108-confirm-card::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(255, 215, 119, 0.16);
  border-radius: 14px 4px 14px 4px;
  pointer-events: none;
}

.nx108-title small,
.nx108-panel-header small,
.nx108-confirm-card > small,
.nx108-item-card small {
  color: var(--nx108-blue);
  font-weight: 800;
  letter-spacing: 0.2em;
}

.nx108-title h2,
.nx108-panel-header h2,
.nx108-confirm-card h2,
.nx108-item-card h2 {
  margin: 0.18em 0;
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  text-shadow: 0 2px 18px rgba(67, 216, 255, 0.3);
}

.nx108-primary,
.nx108-flow-card button,
.nx108-tabs button,
.nx108-forge-tabs button,
.nx108-pagination button,
.nx108-interaction button,
.nx108-confirm-card button {
  border: 1px solid rgba(115, 211, 255, 0.5);
  border-radius: 9px 3px 9px 3px;
  background: linear-gradient(180deg, rgba(27, 91, 126, 0.86), rgba(7, 35, 57, 0.96));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.12), 0 5px 15px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  min-height: 42px;
  transition: border-color 120ms ease, filter 120ms ease, transform 120ms ease;
}

.nx108-root button:hover:not(:disabled),
.nx108-root button:focus-visible {
  border-color: var(--nx108-gold);
  filter: brightness(1.14);
  outline: none;
}

.nx108-root button:active:not(:disabled) { transform: translateY(1px) scale(0.985); }
.nx108-root button:disabled { cursor: default; filter: grayscale(0.65); opacity: 0.45; }

.nx108-primary {
  padding: 0.65rem 1.65rem;
  color: #fff !important;
  font-weight: 800 !important;
  background: linear-gradient(180deg, #167baa, #084565 62%, #052d47) !important;
}

.nx108-close {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  min-height: 0 !important;
  padding: 0;
  border: 1px solid rgba(151, 220, 250, 0.48) !important;
  border-radius: 50% !important;
  background: rgba(4, 20, 34, 0.78) !important;
  font-size: 1.8rem !important;
  line-height: 1;
}

/* Tạo/chọn đúng một nhân vật. */
.nx108-character-flow {
  background:
    linear-gradient(rgba(0, 11, 22, 0.4), rgba(0, 8, 16, 0.82)),
    radial-gradient(circle at 50% 30%, rgba(37, 171, 216, 0.24), transparent 48%),
    #061523;
}

.nx108-flow-card {
  width: min(720px, 94vw);
  max-height: 92vh;
  padding: clamp(22px, 4vw, 46px);
  overflow: auto;
}

.nx108-title { text-align: center; }
.nx108-title h2 { font-size: clamp(1.75rem, 4vw, 2.7rem); }
.nx108-title p { margin: 0.35rem 0 1.35rem; color: var(--nx108-muted); }

.nx108-flow-status {
  display: grid;
  justify-items: center;
  gap: 12px;
  max-width: 540px;
  margin: 12px auto 18px;
  padding: 15px 18px;
  border: 1px solid rgba(115, 211, 255, 0.32);
  border-radius: 12px;
  background: rgba(2, 19, 33, 0.72);
  text-align: center;
}
.nx108-flow-status p { margin: 0; color: #cfefff; }
.nx108-flow-status.is-error { border-color: rgba(255, 123, 134, 0.58); }
.nx108-flow-status.is-error p { color: var(--nx108-danger); }
.nx108-flow-status button { min-width: 150px; }

.nx108-create {
  display: grid;
  gap: 10px;
  max-width: 520px;
  margin: 0 auto;
}

.nx108-model-preview {
  position: relative;
  display: grid;
  place-items: center;
  height: clamp(180px, 34vh, 340px);
  margin: 2px 0 14px;
  border: 1px solid rgba(115, 211, 255, 0.32);
  border-radius: 50% 50% 18px 18px;
  background: radial-gradient(ellipse at center 65%, rgba(48, 187, 231, 0.25), transparent 56%);
  overflow: hidden;
}

.nx108-model-preview::after {
  content: "";
  position: absolute;
  left: 14%;
  right: 14%;
  bottom: 11%;
  height: 16px;
  border: 2px solid rgba(68, 216, 255, 0.66);
  border-radius: 50%;
  box-shadow: 0 0 24px var(--nx108-blue);
}

.nx108-model-preview img {
  width: min(78%, 280px);
  height: 90%;
  object-fit: contain;
  filter: drop-shadow(0 18px 16px rgba(0, 0, 0, 0.62));
}

.nx108-model-preview span {
  position: absolute;
  bottom: 6px;
  z-index: 1;
  color: var(--nx108-gold);
  font-family: Georgia, serif;
  font-weight: 800;
}

.nx108-create label { color: #cfefff; font-weight: 700; }
.nx108-name-row { display: grid; grid-template-columns: 1fr auto; align-items: center; }
.nx108-name-row input {
  width: 100%;
  min-height: 48px;
  padding: 0 5.6rem 0 1rem;
  border: 1px solid rgba(115, 211, 255, 0.46);
  border-radius: 10px;
  outline: none;
  background: rgba(1, 13, 25, 0.8);
}
.nx108-name-row input:focus { border-color: var(--nx108-gold); box-shadow: 0 0 0 3px rgba(255, 215, 119, 0.12); }
.nx108-name-row output { margin-left: -4.7rem; color: var(--nx108-muted); pointer-events: none; }
.nx108-message { min-height: 1.4em; margin: 0; color: #96eeb5; }
.nx108-message.is-error { color: var(--nx108-danger); }

.nx108-character-list { display: grid; gap: 12px; margin: 18px 0; }
.nx108-character-choice {
  display: grid !important;
  grid-template-columns: 92px 1fr;
  align-items: center;
  width: 100%;
  min-height: 106px !important;
  padding: 8px 18px 8px 8px;
  text-align: left;
}
.nx108-character-choice img { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; border: 2px solid #58cfff; }
.nx108-character-choice span { display: grid; gap: 4px; padding-left: 14px; }
.nx108-character-choice strong { font-family: Georgia, serif; font-size: 1.45rem; }
.nx108-character-choice small { color: var(--nx108-gold); letter-spacing: 0.08em; }
.nx108-character-choice.is-selected { border-color: var(--nx108-gold); box-shadow: 0 0 22px rgba(255, 215, 119, 0.22), inset 0 0 25px rgba(41, 150, 198, 0.16); }
.nx108-flow-actions { display: flex; justify-content: center; margin-top: 16px; }

/* Nhân vật bên trái, hành trang 30 ô bên phải. */
.nx108-panel {
  width: min(1180px, 96vw);
  max-height: 93vh;
}

.nx108-panel-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 12px 18px 12px 26px;
  border-bottom: 1px solid rgba(121, 214, 255, 0.28);
  background: linear-gradient(90deg, rgba(21, 76, 111, 0.55), transparent 72%);
}
.nx108-panel-header h2 { font-size: clamp(1.35rem, 3vw, 2rem); }
.nx108-panel-header span { color: var(--nx108-gold); font-weight: 800; letter-spacing: 0.1em; }

.nx108-two-pane {
  display: grid;
  grid-template-columns: minmax(330px, 0.82fr) minmax(440px, 1.18fr);
  min-height: 540px;
  max-height: calc(93vh - 76px);
}
.nx108-two-pane.is-read-only { grid-template-columns: minmax(330px, 520px); justify-content: center; }

.nx108-paperdoll-pane,
.nx108-bag-pane { min-width: 0; padding: 16px; }
.nx108-paperdoll-pane { border-right: 1px solid rgba(121, 214, 255, 0.2); overflow: auto; }
.nx108-bag-pane { overflow: auto; }

.nx108-paperdoll {
  position: relative;
  min-height: 360px;
  border: 1px solid rgba(121, 214, 255, 0.2);
  border-radius: 50% 50% 16px 16px;
  background:
    radial-gradient(ellipse at 50% 69%, rgba(40, 188, 232, 0.22), transparent 48%),
    linear-gradient(180deg, rgba(12, 41, 65, 0.2), rgba(0, 9, 18, 0.56));
  overflow: hidden;
}

.nx108-paperdoll::after {
  content: "";
  position: absolute;
  left: 22%;
  right: 22%;
  bottom: 6%;
  height: 18px;
  border: 2px solid rgba(67, 216, 255, 0.6);
  border-radius: 50%;
  box-shadow: 0 0 22px rgba(67, 216, 255, 0.62);
}

.nx108-paperdoll > img {
  position: absolute;
  inset: 7% 21% 10%;
  z-index: 1;
  width: 58%;
  height: 83%;
  object-fit: contain;
  filter: drop-shadow(0 13px 12px rgba(0, 0, 0, 0.7));
}

.nx108-equip-slot,
.nx108-inventory-cell {
  position: relative;
  display: grid;
  place-items: center;
  padding: 4px;
  border: 1px solid rgba(137, 194, 220, 0.35);
  background:
    linear-gradient(145deg, rgba(16, 51, 75, 0.8), rgba(2, 13, 24, 0.96)),
    #071523;
  box-shadow: inset 0 0 0 2px rgba(202, 231, 244, 0.04), 0 4px 12px rgba(0, 0, 0, 0.38);
}

.nx108-equip-slot {
  position: absolute;
  z-index: 3;
  width: 68px;
  height: 68px;
  min-height: 0 !important;
  border-radius: 12px 3px 12px 3px;
}
.nx108-equip-slot img,
.nx108-inventory-cell img { width: 92%; height: 92%; object-fit: contain; filter: drop-shadow(0 3px 4px rgba(0,0,0,.7)); }
.nx108-equip-slot span { color: #7893a7; font-size: 0.68rem; }
.nx108-equip-slot b,
.nx108-inventory-cell b,
.nx108-inventory-cell small {
  position: absolute;
  right: 4px;
  bottom: 2px;
  padding: 1px 4px;
  border-radius: 4px;
  color: #fff;
  background: rgba(0, 9, 19, 0.86);
  font-size: 0.67rem;
}
.nx108-inventory-cell small { left: 3px; right: auto; }

.nx108-equip-slot--weapon { left: 4%; top: 8%; }
.nx108-equip-slot--helmet { right: 4%; top: 5%; }
.nx108-equip-slot--armor { right: 3%; top: 29%; }
.nx108-equip-slot--pants { left: 3%; top: 34%; }
.nx108-equip-slot--shoes { right: 4%; top: 56%; }
.nx108-equip-slot--necklace { left: 4%; top: 61%; }
.nx108-equip-slot--ring { right: 15%; top: 77%; }

.rarity-white { --rarity: #dce8ef; }
.rarity-green { --rarity: var(--nx108-green); }
.rarity-purple { --rarity: var(--nx108-purple); }
.rarity-gold { --rarity: var(--nx108-gold); }
.nx108-equip-slot.is-equipped,
.nx108-inventory-cell.has-item { border-color: var(--rarity, rgba(137, 194, 220, 0.52)); box-shadow: inset 0 0 12px color-mix(in srgb, var(--rarity, #69cfff) 18%, transparent), 0 4px 12px rgba(0, 0, 0, 0.38); }

.nx108-character-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 14px;
  margin-top: 12px;
}
.nx108-character-stats p { display: flex; justify-content: space-between; gap: 10px; margin: 0; padding: 7px 10px; border-bottom: 1px solid rgba(121, 214, 255, 0.16); color: var(--nx108-muted); }
.nx108-character-stats strong { color: var(--nx108-ink); }
.nx108-character-stats .nx108-set-bonus { grid-column: 1 / -1; display: block; border: 1px solid rgba(192, 120, 255, .28); border-radius: 7px; background: rgba(90, 31, 127, .16); color: #ddb8ff; font-size: .76rem; }

.nx108-bag-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.nx108-bag-heading h3,
.nx108-forge-layout h3 { margin: 0; color: var(--nx108-gold); font-family: Georgia, serif; letter-spacing: 0.1em; }
.nx108-tabs,
.nx108-forge-tabs { display: flex; gap: 5px; }
.nx108-tabs button,
.nx108-forge-tabs button { min-height: 34px; padding: 4px 12px; }
.nx108-tabs button.is-active,
.nx108-forge-tabs button.is-active { color: #fff; border-color: var(--nx108-gold); background: linear-gradient(180deg, rgba(125, 92, 28, .9), rgba(49, 33, 7, .96)); }

.nx108-inventory-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(52px, 1fr));
  gap: 8px;
}
.nx108-inventory-cell { width: 100%; aspect-ratio: 1; min-height: 0 !important; border-radius: 9px 2px 9px 2px; }
.nx108-inventory-cell.is-empty { opacity: 0.62; }
.nx108-pagination { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 12px; }
.nx108-pagination button { min-width: 40px; min-height: 34px; }
.nx108-pagination span { color: #cdeeff; font-weight: 700; }

/* Chi tiết vật phẩm. */
.nx108-item-card {
  display: grid;
  grid-template-columns: minmax(130px, 0.42fr) minmax(220px, 1fr);
  gap: clamp(18px, 4vw, 36px);
  width: min(650px, 92vw);
  max-height: 88vh;
  padding: clamp(24px, 4vw, 44px);
  overflow: auto;
}
.nx108-item-card > .nx108-close { position: absolute; top: 12px; right: 12px; z-index: 2; }
.nx108-item-card > img { width: 100%; aspect-ratio: 1; align-self: start; object-fit: contain; margin-top: 20px; border: 1px solid rgba(121, 214, 255, .3); border-radius: 14px; background: rgba(0, 9, 19, .72); }
.nx108-item-card h2 { padding-right: 38px; font-size: clamp(1.4rem, 4vw, 2rem); }
.nx108-item-stats { margin: 14px 0; padding: 10px 0; border-block: 1px solid rgba(121, 214, 255, .18); }
.nx108-item-stats p { margin: 6px 0; color: #cceafb; }
.nx108-item-stats .nx108-enhancement-line { color: var(--nx108-gold); }
.nx108-item-stats .nx108-gem-line { color: #d8abff; }

.nx108-socket-row { display: flex; flex-wrap: wrap; gap: 8px; min-height: 32px; margin: 10px 0 16px; }
.nx108-socket {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid #425b6d;
  border-radius: 50%;
  color: #526575;
  background: radial-gradient(circle, #102638, #020a12 70%);
  box-shadow: inset 0 0 7px rgba(0, 0, 0, .8);
  font-style: normal;
}
.nx108-socket.is-open { border-color: #69d9ff; color: #88e4ff; box-shadow: inset 0 0 8px rgba(41, 185, 237, .38), 0 0 8px rgba(41, 185, 237, .25); }
.nx108-socket.is-filled { border-color: var(--nx108-purple); color: #e2b7ff; background: radial-gradient(circle, #7d27b3, #19052d 68%); }
.nx108-socket.is-filled { cursor: pointer; touch-action: manipulation; }

/* Thợ rèn: cơ chế cường hóa và khảm đá. */
.nx108-forge-panel { width: min(980px, 95vw); }
.nx108-forge-tabs { padding: 12px 22px 0; }
.nx108-forge-tabs button { min-width: 130px; }
.nx108-forge-layout { display: grid; grid-template-columns: minmax(280px, .85fr) minmax(360px, 1.15fr); gap: 22px; padding: 18px 22px 24px; max-height: calc(92vh - 132px); overflow: auto; }
.nx108-forge-stage { display: flex; flex-direction: column; align-items: center; padding: 18px; border: 1px solid rgba(121, 214, 255, .2); border-radius: 16px; background: radial-gradient(circle at 50% 28%, rgba(139, 65, 201, .24), transparent 44%), rgba(0, 9, 18, .48); text-align: center; }
.nx108-forge-slot { display: grid; place-items: center; gap: 6px; width: 128px; height: 128px; padding: 8px; border: 2px solid rgba(190, 124, 255, .58); border-radius: 18px 5px 18px 5px; background: rgba(5, 14, 27, .84); box-shadow: 0 0 28px rgba(163, 73, 230, .2), inset 0 0 24px rgba(45, 173, 223, .14); color: var(--nx108-muted); }
.nx108-forge-slot img { width: 82px; height: 82px; object-fit: contain; }
.nx108-forge-slot strong { font-size: .76rem; }
.nx108-five-sockets { justify-content: center; }
.nx108-forge-stage > p { color: #cde9f8; }
.nx108-forge-gems { display: grid; width: 100%; gap: 7px; margin: 6px 0 13px; }
.nx108-gem-choice { display: grid; grid-template-columns: 42px 1fr; align-items: center; min-height: 48px; padding: 4px 10px; border: 1px solid rgba(121, 214, 255, .3); border-radius: 9px; background: rgba(3, 19, 32, .82); text-align: left; }
.nx108-gem-choice img { width: 38px; height: 38px; object-fit: contain; }
.nx108-forge-grid { grid-template-columns: repeat(5, minmax(48px, 1fr)); margin-top: 12px; }
.nx108-ore-craft { display: grid; width: 100%; gap: 6px; margin-top: 14px; padding-top: 10px; border-top: 1px solid rgba(255, 215, 119, .2); }
.nx108-ore-craft strong { color: var(--nx108-gold); font-size: .72rem; letter-spacing: .14em; }
.nx108-ore-craft button { min-height: 36px; border: 1px solid rgba(255, 215, 119, .35); border-radius: 7px; background: linear-gradient(180deg, rgba(94, 67, 26, .72), rgba(31, 24, 15, .9)); color: #ffe8af; }

/* Popup người chơi và solo. */
.nx108-interaction {
  position: fixed;
  z-index: 975;
  display: grid;
  width: 210px;
  padding: 14px;
  gap: 7px;
  transform: translate(-50%, -50%);
}
.nx108-interaction strong { padding: 6px 4px 10px; color: var(--nx108-gold); text-align: center; }
.nx108-interaction button { min-height: 38px; }
.nx108-confirm-card { width: min(500px, 90vw); padding: 34px; text-align: center; }
.nx108-confirm-card > div { display: flex; justify-content: center; gap: 12px; margin-top: 20px; }
.nx108-confirm-card button { min-width: 130px; padding: 7px 18px; }

.nx108-countdown {
  position: fixed;
  inset: 0;
  z-index: 990;
  display: grid;
  place-content: center;
  pointer-events: none;
  color: #fff;
  text-align: center;
  text-shadow: 0 4px 22px #000, 0 0 32px #19c8ff;
}
.nx108-countdown small { color: var(--nx108-gold); font-weight: 900; letter-spacing: .18em; }
.nx108-countdown strong { font-family: Georgia, serif; font-size: clamp(4rem, 17vw, 10rem); animation: nx108-count-pulse 1s ease infinite; }
@keyframes nx108-count-pulse { 50% { transform: scale(.86); opacity: .78; } }

.nx108-toast {
  position: fixed;
  left: 50%;
  bottom: max(28px, env(safe-area-inset-bottom));
  z-index: 999;
  max-width: min(620px, 88vw);
  padding: 12px 22px;
  transform: translateX(-50%);
  border: 1px solid rgba(121, 214, 255, .6);
  border-radius: 12px;
  background: rgba(2, 17, 29, .94);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .55);
  color: #e9f9ff;
  text-align: center;
}

/* Các nút/overlay đã có trong index.html. */
#hudAvatarButton.hud-avatar-frame {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  touch-action: manipulation;
  pointer-events: auto;
}
#hudAvatarButton.hud-avatar-frame:focus-visible { filter: drop-shadow(0 0 9px #7de1ff); }

#bagButton.bag-button,
.nexoria-bag-button {
  cursor: pointer;
  touch-action: manipulation;
}
#bagButton.bag-button svg { fill: none; stroke: #eafaff; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 5px rgba(55, 210, 255, .82)); }
#bagButton.bag-button:focus-visible { outline: 2px solid var(--nx108-gold); outline-offset: 3px; }
.nx108-bag-glyph { color: #8ee9ff; text-shadow: 0 0 10px #20c8ff; }

#blacksmithPrompt.blacksmith-prompt {
  position: absolute;
  left: 18%;
  top: 34%;
  z-index: 35;
  display: grid;
  gap: 9px;
  min-width: 220px;
  padding: 13px 15px;
  pointer-events: auto;
  border: 1px solid rgba(255, 205, 102, .56);
  border-radius: 16px 5px 16px 5px;
  background: linear-gradient(145deg, rgba(38, 26, 16, .96), rgba(8, 20, 31, .96));
  box-shadow: 0 15px 36px rgba(0,0,0,.5), inset 0 0 18px rgba(238, 160, 61, .1);
  color: #f7ead5;
}
#blacksmithPrompt.blacksmith-prompt[hidden] { display: none !important; }
#blacksmithPrompt.blacksmith-prompt strong { color: var(--nx108-gold); font-family: Georgia, serif; }
#blacksmithPrompt.blacksmith-prompt > div { display: flex; gap: 7px; }
#blacksmithPrompt.blacksmith-prompt button { border: 1px solid rgba(255, 205, 102, .4); border-radius: 7px; background: rgba(61, 40, 18, .84); color: #fff0cf; }

/* Tên + HP của người chơi/quái trong thế giới. */
.overhead-layer,
.loot-flight-layer {
  position: absolute;
  inset: 0;
  z-index: 22;
  overflow: hidden;
  pointer-events: none;
}
.loot-flight-layer { z-index: 24; }

.world-nameplate,
.monster-nameplate {
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  width: clamp(92px, 8.5vw, 150px);
  min-height: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font: 700 clamp(9px, .78vw, 13px)/1.15 "Segoe UI", sans-serif;
  text-align: center;
  text-shadow: 0 2px 3px #000, 0 0 5px #000;
  pointer-events: auto;
  will-change: transform;
}
.world-nameplate.is-local { pointer-events: none; }
.world-nameplate-name,
.monster-nameplate > b { overflow: hidden; padding: 1px 3px 3px; white-space: nowrap; text-overflow: ellipsis; }
.world-nameplate-hp,
.monster-nameplate > span {
  display: block;
  width: 100%;
  height: 8px;
  padding: 1px;
  border: 1px solid rgba(222, 240, 250, .7);
  border-radius: 5px;
  background: rgba(6, 10, 15, .88);
  box-shadow: 0 2px 5px rgba(0,0,0,.75);
  overflow: hidden;
}
.world-nameplate-hp i,
.monster-nameplate > span i { display: block; width: 100%; height: 100%; border-radius: 3px; background: linear-gradient(180deg, #ff6370, #bb101f); box-shadow: inset 0 1px rgba(255,255,255,.34); transition: width 160ms linear; }
.world-nameplate-value,
.monster-nameplate > small { margin-top: 1px; color: #f2f7fa; font-size: .78em; }
.world-nameplate.is-local .world-nameplate-name { color: #a7eeff; }

.monster-nameplate > b { color: #ffd66c; }
.monster-nameplate.is-boss { width: clamp(124px, 11vw, 190px); font-size: clamp(10px, .88vw, 14px); }
.monster-nameplate.is-boss > b { color: #ffd86b; letter-spacing: .05em; text-shadow: 0 1px 5px #5b3100; }
.monster-nameplate.is-boss > span { height: 10px; border-color: #ffbb72; }
.monster-nameplate.is-boss > span i { background: linear-gradient(180deg, #ff5d54, #8e0928); }
.monster-nameplate.is-targeted { filter: drop-shadow(0 0 7px #ffe070); }
.monster-nameplate.is-targeted::after { content: "▼"; position: absolute; left: 50%; top: -18px; transform: translateX(-50%); color: #ffe66b; animation: nx108-target 650ms ease-in-out infinite alternate; }
@keyframes nx108-target { to { transform: translate(-50%, 3px); } }

.loot-flight-item {
  position: absolute;
  left: 0;
  top: 0;
  width: clamp(38px, 4.4vw, 70px);
  height: clamp(38px, 4.4vw, 70px);
  padding: 3px;
  border: 2px solid var(--rarity, #dce8ef);
  border-radius: 13px 4px 13px 4px;
  background: radial-gradient(circle, color-mix(in srgb, var(--rarity, #dce8ef) 25%, #071321), #02070d 70%);
  box-shadow: 0 0 18px color-mix(in srgb, var(--rarity, #dce8ef) 55%, transparent), inset 0 0 9px rgba(255,255,255,.12);
  object-fit: contain;
  pointer-events: none;
  will-change: transform, opacity;
}

@media (max-width: 820px), (max-height: 560px) {
  .nx108-layer,
  .nx108-sub-layer { padding: 8px; }
  .nx108-panel { max-height: 98vh; }
  .nx108-panel-header { min-height: 58px; padding: 7px 12px 7px 18px; }
  .nx108-panel-header h2 { margin: 0; font-size: 1.25rem; }
  .nx108-panel-header small { font-size: .62rem; }
  .nx108-close { width: 34px; height: 34px; font-size: 1.35rem !important; }
  .nx108-two-pane { grid-template-columns: minmax(270px, .78fr) minmax(370px, 1.22fr); min-height: 0; max-height: calc(98vh - 58px); }
  .nx108-paperdoll-pane,
  .nx108-bag-pane { padding: 9px; }
  .nx108-paperdoll { min-height: 265px; }
  .nx108-equip-slot { width: 49px; height: 49px; }
  .nx108-character-stats { gap: 2px 8px; margin-top: 5px; font-size: .71rem; }
  .nx108-character-stats p { padding: 3px 5px; }
  .nx108-bag-heading { margin-bottom: 6px; }
  .nx108-bag-heading h3 { font-size: .9rem; }
  .nx108-tabs button { min-height: 28px; padding: 2px 7px; font-size: .68rem; }
  .nx108-inventory-grid { grid-template-columns: repeat(6, minmax(40px, 1fr)); gap: 5px; }
  .nx108-pagination { margin-top: 6px; }
  .nx108-forge-layout { grid-template-columns: minmax(230px, .8fr) minmax(320px, 1.2fr); padding: 9px 12px 14px; gap: 12px; max-height: calc(98vh - 108px); }
  .nx108-forge-stage { padding: 10px; }
  .nx108-forge-slot { width: 92px; height: 92px; }
  .nx108-forge-slot img { width: 58px; height: 58px; }
  .nx108-forge-stage > p { margin: 6px 0; font-size: .75rem; }
  .nx108-gem-choice { min-height: 40px; grid-template-columns: 34px 1fr; font-size: .7rem; }
  .nx108-gem-choice img { width: 31px; height: 31px; }
  .nx108-socket { width: 25px; height: 25px; }
  .nx108-flow-card { padding: 18px; }
  .nx108-model-preview { height: 165px; }
}

@media (orientation: portrait) and (max-width: 680px) {
  .nx108-panel { width: 96vw; overflow: auto; }
  .nx108-two-pane { grid-template-columns: 1fr; max-height: calc(94vh - 64px); overflow: auto; }
  .nx108-paperdoll-pane { border-right: 0; border-bottom: 1px solid rgba(121, 214, 255, .2); }
  .nx108-paperdoll { min-height: 330px; }
  .nx108-inventory-grid { grid-template-columns: repeat(5, minmax(48px, 1fr)); }
  .nx108-forge-layout { grid-template-columns: 1fr; }
  .nx108-item-card { grid-template-columns: 100px 1fr; padding: 22px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .nx108-root *,
  .monster-nameplate.is-targeted::after { animation: none !important; transition: none !important; }
}
