* { box-sizing: border-box; margin: 0; padding: 0; font-family: "Segoe UI", Tahoma, sans-serif; }
html, body {
  width: 100%; height: 100%; overflow: hidden;
  background: #070a10; color: #f0e6d2; user-select: none;
  touch-action: none;
}
#gl {
  position: fixed; inset: 0; width: 100%; height: 100%; display: block;
}
#ui-viewport {
  position: fixed; inset: 0; pointer-events: none; overflow: hidden;
}
#ui-stage {
  position: absolute; left: 0; top: 0; width: 1920px; height: 1080px;
  transform-origin: top left; pointer-events: none;
}

.mu-w {
  position: absolute; pointer-events: auto;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; white-space: pre-wrap; word-break: break-word;
  border-radius: 4px;
}
.mu-w-panel {
  pointer-events: auto;
  background: linear-gradient(180deg, rgba(16, 20, 30, 0.88), rgba(8, 10, 16, 0.94));
  border: 1px solid rgba(208, 168, 92, 0.45);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.65);
}
.mu-w-text {
  pointer-events: none;
  justify-content: flex-start;
  padding: 2px 6px;
  font-size: 16px; line-height: 1.25;
  color: #efe2c4;
  text-shadow: 0 1px 3px #000, 0 0 6px rgba(0, 0, 0, 0.85);
}
.mu-w-button {
  cursor: pointer;
  background: linear-gradient(180deg, #2d3548, #1a202c);
  border: 1px solid #967740;
  color: #f6e7c6; font-size: 15px; font-weight: 600;
  padding: 3px 6px; text-align: center;
  text-shadow: 0 1px 2px #000;
  transition: filter 0.12s, border-color 0.12s;
}
.mu-w-button:hover {
  filter: brightness(1.18);
  border-color: #ffd37a;
}
.mu-w-input {
  background: rgba(8, 11, 18, 0.92);
  border: 1px solid #6b88b4;
  justify-content: flex-start;
  padding: 4px 12px;
  font-family: Consolas, monospace;
}
.mu-w-slot {
  padding: 2px;
  background: rgba(14, 17, 26, 0.92);
  border: 1px solid #485468;
}
.mu-w-slot[data-rarity="rare"] { border-color: #4aa3ff; box-shadow: inset 0 0 8px rgba(74, 163, 255, 0.35); }
.mu-w-slot[data-rarity="sr"]   { border-color: #c26cff; box-shadow: inset 0 0 8px rgba(194, 108, 255, 0.45); }
.mu-w-slot[data-rarity="ssr"]  { border-color: #ffb830; box-shadow: inset 0 0 10px rgba(255, 184, 48, 0.55); }
.mu-w-slot[data-rarity="exl"]  { border-color: #42ff8c; box-shadow: inset 0 0 12px rgba(66, 255, 140, 0.65); }

.mu-w-icon {
  max-width: 86%; max-height: 86%; object-fit: contain; pointer-events: none;
}
.mu-w-badge {
  position: absolute; right: 3px; bottom: 2px;
  font-size: 11px; font-weight: 800; color: #ffe468;
  background: rgba(0, 0, 0, 0.72); padding: 0 3px; border-radius: 2px;
}

.mu-w-progress {
  pointer-events: none;
  background: rgba(10, 12, 18, 0.9);
  border: 1px solid rgba(208, 168, 92, 0.55);
}
.mu-prog-fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0%;
  background: linear-gradient(90deg, #c98c2b, #ffd56e);
}
.mu-boss-bar .mu-prog-fill {
  background: linear-gradient(90deg, #981616, #ff443a);
}
.mu-exp-bar .mu-prog-fill {
  background: linear-gradient(90deg, #2b8244, #63f08a);
}

.mu-orb {
  border-radius: 50%;
  border: 2px solid #c69c51;
  background: radial-gradient(circle at 35% 30%, #2a181c, #0c0d12);
  box-shadow: inset 0 0 14px #000, 0 2px 10px rgba(0, 0, 0, 0.8);
}
.mu-orb-fill {
  position: absolute; left: 0; right: 0; bottom: 0; height: 100%;
  transition: height 0.08s linear;
}
.mu-orb-hp .mu-orb-fill { background: linear-gradient(180deg, #ef3434, #7c0808); }
.mu-orb-mp .mu-orb-fill { background: linear-gradient(180deg, #327eff, #0c2c7e); }
.mu-orb-txt {
  position: relative; z-index: 2; font-size: 13px; font-weight: 700;
  text-align: center; color: #fff; text-shadow: 0 1px 3px #000;
}

.mu-w-minimap {
  background: rgba(8, 12, 20, 0.92);
  border: 1px solid #967740;
  flex-direction: column;
}
.mu-mm-canvas { width: 100%; height: 100%; display: block; }
.mu-mm-lbl {
  position: absolute; left: 6px; top: 4px;
  font-size: 13px; font-weight: 700; color: #ffd479;
  text-shadow: 0 1px 3px #000;
}

#ui-tooltip {
  position: fixed; display: none; z-index: 40; max-width: 280px;
  padding: 8px 10px; border-radius: 6px; pointer-events: none;
  background: rgba(10, 14, 22, 0.96); border: 1px solid #c89f54;
  color: #f3e8d0; font-size: 12px; line-height: 1.4; white-space: pre-wrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);
}

#platform-bar {
  position: fixed; left: 8px; bottom: 8px; z-index: 30;
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px; border-radius: 6px;
  background: rgba(10, 14, 22, 0.84); border: 1px solid rgba(208, 168, 92, 0.45);
  font-size: 12px;
}
#platform-badge { color: #ffd578; font-weight: 700; }
#fps-badge { color: #72ff9e; font-weight: 700; }
#btn-toggle-mobile {
  background: #232c3d; color: #eee; border: 1px solid #6b7d9e;
  border-radius: 4px; padding: 2px 8px; cursor: pointer; font-size: 11px;
}

#mobile-touch-controls {
  position: fixed; inset: 0; pointer-events: none; z-index: 25;
}
#touch-dpad {
  position: fixed; left: 16px; bottom: 132px; pointer-events: auto;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
}
#touch-dpad .dpad-mid { display: flex; gap: 32px; }
#touch-dpad button, #touch-skills button {
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(18, 24, 38, 0.78); color: #ffd989;
  border: 1.5px solid rgba(212, 172, 92, 0.65); font-weight: 700;
}
#touch-skills {
  position: fixed; right: 16px; bottom: 132px; pointer-events: auto;
  display: grid; grid-template-columns: repeat(3, 54px); gap: 6px;
}
#touch-skills button { width: 54px; height: 42px; border-radius: 10px; font-size: 11px; }

#loading-screen {
  position: fixed; inset: 0; z-index: 60;
  background: radial-gradient(circle at center, #141b2c 0%, #06090f 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
}
#loading-screen h1 { color: #ffd578; font-size: 24px; letter-spacing: 2px; }
#loading-status { color: #bfd0ec; font-size: 14px; }
