:root {
  --bg: #0c1210;
  --panel: #15201c;
  --ink: #e8f0ea;
  --muted: #8fa398;
  --accent: #c4a35a;
  --accent-2: #3d7a5f;
  --danger: #b85c4a;
  --radius: 14px;
  --font-display: "Cinzel", Georgia, serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  overflow: hidden;
  touch-action: none;
  cursor: url("assets/ui/cursors/Cursor.png") 0 0, default;
}

#c {
  cursor: url("assets/ui/cursors/Cursor.png") 0 0, crosshair;
}
button, .cta, .hud-btn, .char-card, .linkish {
  cursor: url("assets/ui/cursors/CursorGet.png") 0 0, pointer;
}
#hud.combat-cursor #c,
body.mu-combat #c {
  cursor: url("assets/ui/cursors/CursorAttack.png") 0 0, crosshair;
}

#app, #c {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.screen {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(61, 122, 95, 0.35), transparent 55%),
    radial-gradient(ellipse at 80% 80%, rgba(196, 163, 90, 0.18), transparent 50%),
    linear-gradient(160deg, #0a100e, #121a16 45%, #0c1210);
}

/* boot antigo — mantido p/ refs; login clássico usa .mu-login */
.mu-boot-screen {
  background:
    linear-gradient(180deg, rgba(8, 12, 10, 0.55), rgba(8, 12, 10, 0.82)),
    url("assets/ui/login/loading01.jpg") center / cover no-repeat,
    #0a100e;
}

/* —— Login clássico MU (Logo/Interface S2.5) —— */
.mu-login {
  padding: 0;
  place-items: unset;
  overflow: hidden;
  background: #000;
  z-index: 5;
  image-rendering: pixelated;
  font-family: Tahoma, "MS Sans Serif", sans-serif;
}

.mu-login-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.28) 55%, rgba(0, 0, 0, 0.7) 100%),
    url("assets/ui/charselect/login_back01.jpg") center / cover no-repeat,
    #1a0604;
  z-index: 0;
  pointer-events: none;
}

/* Bloco central — frame MU na proporção nativa (329×245) */
.mu-login-stage {
  position: absolute;
  left: 50%;
  top: 46%;
  z-index: 3;
  width: min(420px, 92vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.mu-login-stage > * { pointer-events: auto; }

.mu-login-logo {
  position: relative;
  top: auto;
  left: auto;
  transform: none;
  width: min(220px, 52vw);
  max-width: 100%;
  height: auto;
  z-index: 2;
  mix-blend-mode: screen;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.7));
  pointer-events: none;
  image-rendering: auto;
  flex-shrink: 0;
}

.mu-login-panel {
  /* proporção exacta do login_back.png — sem esticar dragões / header */
  --mu-login-w: min(400px, 92vw);
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  width: var(--mu-login-w);
  aspect-ratio: 329 / 245;
  height: auto;
  min-height: 0;
  z-index: 3;
  margin: 0;
  /* inset para a área de pedra (fora dos cantos/dragões e da barra MU ONLINE) */
  padding: 14% 11% 11%;
  box-sizing: border-box;
  background: url("assets/ui/login/login_back.png?v=2") center / 100% 100% no-repeat;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 0.55rem;
  border: 0;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.55));
  overflow: hidden;
  flex-shrink: 0;
  image-rendering: auto;
}

.mu-login-fields {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  width: 100%;
  max-width: 100%;
}

.mu-login-row {
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  width: 100%;
  max-width: 100%;
}

.mu-login-label {
  color: #f0e6c0;
  font-size: 13px;
  font-weight: 700;
  text-shadow: 1px 1px 0 #000, 0 0 6px rgba(0, 0, 0, 0.85);
  text-align: right;
  letter-spacing: 0.03em;
}

.mu-login-box {
  display: block;
  width: 100%;
  max-width: none;
  height: 28px;
  box-sizing: border-box;
  background: url("assets/ui/login/login_me.png?v=2") center / 100% 100% no-repeat;
  border: 0;
  box-shadow: none;
  overflow: hidden;
}

.mu-login-box:focus-within {
  filter: brightness(1.12);
  outline: 1px solid rgba(220, 190, 100, 0.55);
  outline-offset: 0;
}

.mu-login-box input {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  color: #fff8e8;
  font: 600 13px/1 Tahoma, sans-serif;
  padding: 0 10px;
  outline: none;
  text-shadow: 1px 1px 0 #000;
  box-sizing: border-box;
}

.mu-login-box input::placeholder {
  color: rgba(200, 195, 175, 0.5);
  font-weight: 400;
  font-size: 12px;
}

.mu-login-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.85rem;
  margin-top: 0.35rem;
  width: 100%;
}

/* Connect — sprite 54×30 ×4, escala legível sem partir o frame */
.mu-login-connect {
  width: 108px;
  height: 48px;
  border: 0;
  padding: 0;
  background: url("assets/ui/login/b_connect.png?v=2") 0 0 / 108px 192px no-repeat;
  image-rendering: pixelated;
  cursor: url("assets/ui/cursors/CursorGet.png") 0 0, pointer;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.75));
  flex-shrink: 0;
}

.mu-login-connect:hover { background-position: 0 -48px; filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.75)) brightness(1.1); }
.mu-login-connect:active { background-position: 0 -96px; transform: translateY(1px); }
.mu-login-connect:disabled { background-position: 0 -144px; opacity: 0.9; cursor: default; }

.mu-login-exit {
  width: 78px;
  height: 24px;
  border: 0;
  padding: 0;
  background: url("assets/ui/login/cancel.jpg?v=1") center / 100% 100% no-repeat;
  image-rendering: pixelated;
  cursor: url("assets/ui/cursors/CursorGet.png") 0 0, pointer;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.7));
  color: transparent;
  font-size: 0;
  flex-shrink: 0;
}

.mu-login-exit:hover { filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.7)) brightness(1.12); }
.mu-login-exit:active { transform: translateY(1px); }

.mu-login-status {
  margin: 0.25rem 0 0;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #c9a227;
  text-shadow: 1px 1px 0 #000;
  min-height: 1.1em;
  width: 100%;
}

.mu-login-status[hidden] { display: none !important; }

.mu-login-cache {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.1rem;
  width: 100%;
  flex-wrap: wrap;
}

.mu-login-cache-btn {
  min-width: 84px;
  height: 22px;
  padding: 0 0.55rem;
  border: 1px solid #7a6840;
  background: linear-gradient(180deg, #4a4030 0%, #221c14 100%);
  color: #f0e6c0;
  font: 700 11px/20px Tahoma, sans-serif;
  text-shadow: 1px 1px 0 #000;
  letter-spacing: 0.02em;
  cursor: url("assets/ui/cursors/CursorGet.png") 0 0, pointer;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.55));
}

.mu-login-cache-btn:hover {
  border-color: #b09850;
  color: #fff8d8;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.55)) brightness(1.12);
}

.mu-login-cache-btn:active { transform: translateY(1px); }
.mu-login-cache-btn[hidden] { display: none !important; }

.mu-login-newacc {
  align-self: center;
  margin-top: 0.05rem;
  width: 96px;
  min-width: 96px;
  height: 22px;
  padding: 0;
  border: 0;
  background: url("assets/ui/login/0On_Botton.jpg?v=1") center / 100% 100% no-repeat;
  color: #f0e8c8;
  font: 700 11px/22px Tahoma, sans-serif;
  text-shadow: 1px 1px 0 #000;
  letter-spacing: 0.02em;
  text-align: center;
  cursor: url("assets/ui/cursors/CursorGet.png") 0 0, pointer;
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.55));
}

.mu-login-newacc:hover {
  background-image: url("assets/ui/login/0On_Botton2.jpg?v=1");
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.55)) brightness(1.12);
  color: #fff;
}
.mu-login-newacc:active { transform: translateY(1px); }

/* —— Loading (OK → mundo) —— */
.mu-loading {
  padding: 0;
  place-items: unset;
  overflow: hidden;
  background: #050508;
  z-index: 8;
  font-family: Tahoma, "MS Sans Serif", sans-serif;
}

.mu-loading-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 50% 42%, rgba(40, 28, 12, 0.35), transparent 70%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.75) 100%),
    url("assets/ui/login/loading01.jpg") center / cover no-repeat,
    #0a0806;
  z-index: 0;
  pointer-events: none;
  animation: mu-loading-pulse 3.2s ease-in-out infinite alternate;
}

@keyframes mu-loading-pulse {
  from { filter: brightness(0.92); }
  to { filter: brightness(1.08); }
}

.mu-loading-stage {
  position: absolute;
  left: 50%;
  top: 48%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: min(360px, 88vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.mu-loading-logo {
  width: min(220px, 55vw);
  height: auto;
  mix-blend-mode: screen;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.75));
  pointer-events: none;
}

.mu-loading-status {
  margin: 0;
  min-height: 1.3em;
  text-align: center;
  color: #f0e6c0;
  font: 700 14px/1.3 Tahoma, sans-serif;
  text-shadow: 1px 1px 0 #000, 0 0 10px rgba(200, 160, 60, 0.35);
  letter-spacing: 0.04em;
}

.mu-loading-bar {
  width: min(280px, 78vw);
}

.mu-loading-bar-track {
  height: 18px;
  box-sizing: border-box;
  padding: 2px;
  background: url("assets/ui/login/Progress_Back.jpg") center / 100% 100% no-repeat;
  border: 1px solid rgba(120, 100, 60, 0.45);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.mu-loading-bar-fill {
  height: 100%;
  width: 0%;
  background: url("assets/ui/login/Progress.jpg") left center / auto 100% repeat-x;
  transition: width 0.28s ease;
  image-rendering: pixelated;
}

.mu-loading-hint {
  margin: 0;
  color: rgba(210, 200, 170, 0.7);
  font: 500 11px/1 Tahoma, sans-serif;
  text-shadow: 1px 1px 0 #000;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Aviso: cache 3D desatualizado (pedido pelo MU Lab) */
.mu-cache-update {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.72);
}
.mu-cache-update[hidden] { display: none !important; }
.mu-cache-update-panel {
  width: min(420px, 94vw);
  padding: 1.35rem 1.25rem 1.15rem;
  text-align: center;
  color: #efe6c8;
  background:
    linear-gradient(180deg, rgba(28, 36, 28, 0.96), rgba(12, 16, 12, 0.98));
  border: 1px solid rgba(196, 163, 90, 0.45);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65);
}
.mu-cache-update-panel h2 {
  margin: 0 0 0.55rem;
  font: 600 1.15rem/1.25 var(--font-display);
  color: var(--accent);
  letter-spacing: 0.04em;
}
.mu-cache-update-panel p {
  margin: 0 0 1rem;
  font: 400 0.92rem/1.45 var(--font-body);
  color: rgba(232, 240, 234, 0.88);
}
.mu-cache-update-panel .meta {
  margin: -0.45rem 0 1rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.mu-cache-update-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
}
.mu-cache-update-actions button {
  min-width: 132px;
  padding: 0.55rem 1rem;
  border: 1px solid rgba(196, 163, 90, 0.55);
  background: linear-gradient(180deg, #3a4a38, #1e281c);
  color: #efe6c8;
  font: 600 0.88rem/1 var(--font-body);
  letter-spacing: 0.04em;
}
.mu-cache-update-actions button.primary {
  background: linear-gradient(180deg, #6a5430, #3a2e18);
  border-color: rgba(230, 190, 90, 0.7);
}
.mu-cache-update-actions button:disabled {
  opacity: 0.55;
  cursor: default;
}

.mu-reg {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.55);
}

.mu-reg[hidden] { display: none !important; }

.mu-reg-frame {
  width: min(280px, 92vw);
  padding: 2.4rem 1.4rem 1.2rem;
  margin: 0;
  box-sizing: border-box;
  background:
    url("assets/ui/login/0New_Account02.png?v=1") center bottom / 100% auto no-repeat,
    url("assets/ui/login/0New_Account01.png?v=1") center top / 100% auto no-repeat,
    #1a1a1c;
  border: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  filter: drop-shadow(0 10px 28px rgba(0, 0, 0, 0.75));
}

.mu-reg-title {
  margin: 0 0 0.35rem;
  text-align: center;
  color: #f0e6c0;
  font: 700 13px/1 Tahoma, sans-serif;
  text-shadow: 1px 1px 0 #000, 0 0 6px rgba(0, 0, 0, 0.8);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mu-reg-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.mu-reg-ok {
  min-width: 70px;
  height: 21px;
  border: 0;
  padding: 0 10px;
  background: url("assets/ui/login/ok.jpg?v=1") center / contain no-repeat;
  color: transparent;
  image-rendering: pixelated;
  cursor: url("assets/ui/cursors/CursorGet.png") 0 0, pointer;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.7));
}

.mu-reg-ok:hover { filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.7)) brightness(1.1); }
.mu-reg-ok:active { transform: translateY(1px); }
.mu-reg-ok:disabled { opacity: 0.55; cursor: default; }


/* Sprite já traz "Menu" — sem texto HTML por cima */
.mu-login-menu {
  position: absolute;
  left: 12px;
  bottom: 28px;
  z-index: 3;
  display: block;
  width: 54px;
  min-width: 54px;
  height: 30px;
  padding: 0;
  border: 0;
  background: url("assets/ui/login/server_menu_b_all.png?v=1") 0 0 / 54px 90px no-repeat;
  color: transparent;
  font-size: 0;
  line-height: 0;
  text-decoration: none;
  text-indent: -9999px;
  overflow: hidden;
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.65));
  cursor: url("assets/ui/cursors/CursorGet.png") 0 0, pointer;
}

.mu-login-menu:hover { background-position: 0 -30px; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.65)) brightness(1.08); }
.mu-login-menu:active { background-position: 0 -60px; }

.mu-login-foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 1.25rem;
  flex-wrap: wrap;
  padding: 0 12px;
  color: rgba(230, 225, 210, 0.85);
  font: 400 11px/1.2 Tahoma, sans-serif;
  text-shadow: 1px 1px 0 #000;
  pointer-events: none;
}

@media (max-width: 520px) {
  .mu-login-stage {
    width: min(96vw, 400px);
    top: 48%;
    gap: 0.5rem;
  }
  .mu-login-logo { width: min(180px, 48vw); }
  .mu-login-panel {
    --mu-login-w: min(360px, 94vw);
    padding: 13% 10% 10%;
    gap: 0.4rem;
  }
  .mu-login-row { grid-template-columns: 52px 1fr; gap: 0.3rem; }
  .mu-login-label { font-size: 12px; }
  .mu-login-box { height: 26px; }
  .mu-login-box input { font-size: 12px; padding: 0 8px; }
  .mu-login-connect { width: 96px; height: 42px; background-size: 96px 168px; }
  .mu-login-connect:hover { background-position: 0 -42px; }
  .mu-login-connect:active { background-position: 0 -84px; }
  .mu-login-connect:disabled { background-position: 0 -126px; }
  .mu-login-exit { width: 70px; height: 21px; }
  .mu-login-foot { font-size: 10px; gap: 0.5rem; }
  .mu-login-menu { bottom: 32px; }
}

.screen[hidden] { display: none !important; }

.panel {
  width: min(420px, 100%);
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  border: 1px solid rgba(232, 240, 234, 0.08);
  border-radius: var(--radius);
  padding: 1.5rem 1.35rem 1.25rem;
  backdrop-filter: blur(10px);
  animation: rise 0.55s ease both;
}

.panel.compact { text-align: center; }

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

h1 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 8vw, 2.6rem);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.lede, .sub {
  margin: 0 0 1rem;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.95rem;
}

.sub { margin-top: 0.5rem; font-size: 0.85rem; }

label {
  display: grid;
  gap: 0.3rem;
  margin-bottom: 0.75rem;
  font-size: 0.82rem;
  color: var(--muted);
}

input, select {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  border: 1px solid rgba(232, 240, 234, 0.12);
  background: #0e1613;
  color: var(--ink);
  font: inherit;
}

.cta {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.85rem 1rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #a8883f);
  color: #1a1408;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
}

.cta.secondary {
  background: linear-gradient(135deg, var(--accent-2), #2f5f4a);
  color: #e8f0ea;
  margin-top: 0.65rem;
}

.back, .linkish {
  display: inline-block;
  margin-top: 1rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}

.char-list {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.char-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid rgba(232, 240, 234, 0.1);
  background: #101916;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
  width: 100%;
}

.char-card:hover, .char-card:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.char-card strong { font-family: var(--font-display); }
.char-card small { color: var(--muted); }

hr {
  border: 0;
  border-top: 1px solid rgba(232, 240, 234, 0.08);
  margin: 1rem 0;
}

#hud {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

#hud:not([hidden]) .stick,
#hud:not([hidden]) .hud-btn,
#hud:not([hidden]) .loot-pick-btn,
#hud:not([hidden]) .game-panel,
#hud:not([hidden]) .panel-close { pointer-events: auto; }
/* painéis fora do #hud (chaos/social/skills) */
#app > .game-panel { pointer-events: auto; }

/* moved:zen */
/* moved:zen strong */

/* Stack inferior (mobile): [skills] acima de [comandos].
   Desktop ≥768: Menu01|02|03 lado a lado ~640px (Main 640×48). */
#hud:not([hidden]) #hud-bottom { pointer-events: none; }
#hud:not([hidden]) #hud-actions .skill-slot,
#hud:not([hidden]) #hud-actions .hud-action-slot,
#hud:not([hidden]) #skill-bar .skill-slot { pointer-events: auto; }
#hud-bottom {
  --hud-slot-h: 4.15rem;
  --hud-slot-gap: 0.3rem;
  --hud-bar-pad-y: 0.38rem;
  --hud-bar-pad-x: 0.42rem;
  --hud-mu-w: min(40rem, 99vw);
  position: absolute;
  left: 50%;
  right: auto;
  top: auto;
  /* acima da faixa XP (5px) + label % */
  bottom: max(1.35rem, calc(env(safe-area-inset-bottom) + 1.2rem));
  transform: translateX(-50%);
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  width: var(--hud-mu-w);
  max-width: var(--hud-mu-w);
  pointer-events: none;
}
/* in_main.ozt — cabeças/moldura Main nas pontas da barra inferior */
.hud-in-main {
  position: absolute;
  bottom: 0.15rem;
  width: clamp(4.6rem, 16vw, 6.8rem);
  height: auto;
  aspect-ratio: 122 / 98;
  object-fit: contain;
  image-rendering: pixelated;
  pointer-events: none;
  z-index: 0;
  opacity: 0.95;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.55));
}
.hud-in-main-l {
  left: -0.35rem;
  transform: scaleX(-1);
}
.hud-in-main-r {
  right: -0.35rem;
}
.hud-bottom-chrome {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: calc(100% - 1.2rem);
  max-width: 100%;
  gap: 0;
  padding: 0.2rem 0.15rem 0.28rem;
  /* m_main.ozt — painel base atrás do stack mobile */
  background:
    url("assets/ui/hud/m_main.png?v=6") center / 100% 100% no-repeat;
  border: none;
  border-radius: 2px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
}
.hud-menu02-bridge {
  flex: 0 0 clamp(0.55rem, 2.2vw, 0.85rem);
  width: 100%;
  margin: 0;
  background: url("assets/ui/hud/Menu02.png?v=6") center / 100% 100% no-repeat;
  image-rendering: pixelated;
  pointer-events: none;
}
#hud-actions {
  --hud-cmd-w: clamp(3.35rem, 14vw, 4.35rem);
  position: relative;
  left: auto;
  right: auto;
  top: auto;
  bottom: auto;
  transform: none;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  column-gap: var(--hud-slot-gap);
  width: 100%;
  max-width: 100%;
  max-height: none;
  overflow: visible;
  padding: var(--hud-bar-pad-y) var(--hud-bar-pad-x);
  pointer-events: none;
  /* Menu03 = Char/Inv chrome (Main.exe) */
  background: url("assets/ui/hud/Menu03.png?v=6") center / 100% 100% no-repeat;
  image-rendering: pixelated;
  border: none;
  border-radius: 0;
  box-shadow: none;
}
#hud-actions .skill-slot,
#hud-actions .hud-action-slot {
  pointer-events: auto;
}
/* Três zonas: Atk | Char Hunt Inv | Skill (borda direita) */
.hud-actions-left,
.hud-actions-center,
.hud-actions-right {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: var(--hud-slot-gap);
  min-width: 0;
}
.hud-actions-left {
  justify-content: flex-start;
  justify-self: stretch;
}
.hud-actions-center {
  justify-content: center;
  justify-self: center;
}
.hud-actions-right {
  justify-content: flex-end;
  justify-self: stretch;
}
.hud-actions-left .hud-action-slot,
.hud-actions-center .hud-action-slot,
.hud-actions-right .hud-action-slot {
  flex: 0 0 var(--hud-cmd-w);
  width: var(--hud-cmd-w);
  max-width: var(--hud-cmd-w);
}

.hud-actions-sep {
  display: none;
}

.hud-btn {
  min-width: 52px;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(232, 240, 234, 0.18);
  background: rgba(12, 18, 16, 0.82);
  color: var(--ink);
  font: 600 0.78rem var(--font-body);
  cursor: pointer;
  text-align: center;
}
.hud-btn:hover, .hud-btn:focus-visible {
  border-color: var(--accent);
  outline: none;
}
.hud-btn[hidden],
#hud-actions .skill-slot[hidden],
#btn-shop[hidden] { display: none !important; }

/* Comandos = mesma altura da hotbar; Atk/Skill nas pontas (mesmo tamanho) */
#hud-actions .hud-action-slot {
  position: relative;
  overflow: hidden;
  flex: 0 0 var(--hud-cmd-w);
  width: var(--hud-cmd-w);
  min-width: 0;
  max-width: var(--hud-cmd-w);
  height: var(--hud-slot-h);
  min-height: var(--hud-slot-h);
  font-size: 0.58rem;
  gap: 0.02rem;
  line-height: 1.05;
  border-radius: 8px;
  justify-content: flex-end;
  align-items: center;
  padding: 0.12rem 0.1rem 0.1rem;
}
#hud-actions .hud-action-edge,
#hud-actions #btn-atk,
#hud-actions #btn-skill {
  flex: 0 0 var(--hud-cmd-w);
  width: var(--hud-cmd-w);
  min-width: 0;
  max-width: var(--hud-cmd-w);
  height: var(--hud-slot-h);
  min-height: var(--hud-slot-h);
}
#hud-actions .hud-action-ico {
  position: absolute;
  inset: 3px;
  width: auto;
  height: auto;
  max-width: calc(100% - 6px);
  max-height: calc(100% - 1.15rem);
  margin: auto;
  object-fit: contain;
  image-rendering: pixelated;
  pointer-events: none;
  flex-shrink: 0;
  opacity: 0.95;
  z-index: 0;
}
#hud-actions #btn-atk .hud-action-ico,
#hud-actions #btn-skill .hud-action-ico {
  max-height: calc(100% - 1.05rem);
  max-width: calc(100% - 8px);
}
#hud-actions #btn-char .hud-action-ico,
#hud-actions #btn-inv .hud-action-ico,
#hud-actions #btn-party .hud-action-ico {
  max-height: calc(100% - 1.1rem);
}
#hud-actions .hud-action-slot.party {
  border-color: rgba(196, 163, 90, 0.42);
}
#hud-actions .hud-action-label,
#hud-actions .hud-action-slot .skill-name {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1.05;
  text-align: center;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
  text-shadow:
    0 0 2px #000,
    0 1px 2px #000;
}
#hud-actions .hud-action-slot small {
  position: absolute;
  top: 1px;
  right: 2px;
  z-index: 1;
  pointer-events: none;
}
#hud-actions .hud-action-slot.atk {
  border-color: rgba(232, 160, 140, 0.5);
  color: #ffd0c0;
  background: rgba(72, 32, 28, 0.72);
}
#hud-actions .hud-action-slot.skill,
#hud-actions .hud-action-slot.skill-ready {
  border-color: rgba(120,180,255,.55);
  color: #cfe4ff;
  background: rgba(28, 40, 64, 0.72);
}
#hud-actions .hud-action-slot.skill-flash {
  border-color: rgba(120,180,255,.85);
  background: rgba(36, 56, 84, 0.96);
}
#skill-bar .skill-slot.cfg,
#skill-bar #btn-skill-cfg {
  border-color: rgba(255, 210, 90, 0.85);
  color: #ffe9a8;
  background:
    linear-gradient(180deg, rgba(72, 52, 16, 0.95), rgba(36, 26, 10, 0.98));
  box-shadow:
    0 0 0 1px rgba(255, 220, 120, 0.35) inset,
    0 0 10px rgba(255, 190, 60, 0.35);
}
#skill-bar #btn-skill-cfg .skill-name {
  color: #ffe9a8;
  font-weight: 800;
  letter-spacing: 0.02em;
}
#skill-bar #btn-skill-cfg small {
  color: #fff3c0;
  font-weight: 800;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 3px;
  padding: 0 3px;
}
#skill-bar #btn-skill-cfg:hover,
#skill-bar #btn-skill-cfg:focus-visible {
  border-color: rgba(255, 230, 140, 0.95);
  box-shadow:
    0 0 0 1px rgba(255, 236, 160, 0.5) inset,
    0 0 14px rgba(255, 200, 80, 0.5);
}
#hud-actions .hud-action-slot.hunt {
  border-color: rgba(140, 200, 140, 0.4);
  color: #c8f0c8;
}
#hud-actions .hud-action-slot.hunt.active,
#hud-actions .hud-action-slot.active {
  border-color: rgba(120,180,255,.7);
  background: rgba(30, 48, 72, 0.95);
  color: #cfe4ff;
}
#hud-actions .hud-action-slot.hunt.active,
#hud-actions .hud-action-slot.hunt.hunting {
  border-color: rgba(160, 230, 160, 0.75);
  background: rgba(28, 56, 36, 0.95);
  color: #d8ffe0;
}
.hud-playpause-ico {
  width: 18px;
  height: 18px;
  display: block;
  flex-shrink: 0;
  pointer-events: none;
}
#hud-actions .hud-playpause-ico {
  position: absolute;
  inset: 4px;
  width: auto;
  height: auto;
  max-width: 1.35rem;
  max-height: calc(100% - 1.2rem);
  margin: auto;
  opacity: 0.95;
  z-index: 0;
}

.hud-btn.atk {
  background: rgba(184, 92, 74, 0.9);
  border-color: rgba(232, 180, 160, 0.35);
}
.hud-btn.hunt {
  background: rgba(40, 72, 48, 0.9);
  border-color: rgba(140, 200, 140, 0.35);
}
.hud-btn.hunt.active {
  background: rgba(56, 130, 72, 0.95);
  border-color: rgba(160, 230, 160, 0.65);
  color: #d8ffe0;
  box-shadow: 0 0 0 1px rgba(120, 220, 140, 0.25);
}

.game-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(360px, calc(100vw - 1.5rem));
  max-height: min(78vh, 560px);
  display: flex;
  flex-direction: column;
  background: color-mix(in srgb, var(--panel) 94%, #000);
  border: 1px solid rgba(196, 163, 90, 0.28);
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  /* Acima do rail de skills / barra de comandos — inv/char recebem clique */
  z-index: 12;
  overflow: hidden;
}
.game-panel.wide { width: min(420px, calc(100vw - 1.5rem)); }
.game-panel[hidden] { display: none !important; }
.game-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid rgba(232, 240, 234, 0.08);
}
.game-panel h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--accent);
  letter-spacing: 0.04em;
}
.panel-close {
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}
.panel-body {
  padding: 0.75rem 0.9rem 1rem;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.panel-title {
  margin: 0 0 0.2rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
}
.panel-meta, .panel-foot {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.8rem;
}
.panel-foot { margin: 0.75rem 0 0; }
.stat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}
.stat-list li {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  background: #101916;
  font-size: 0.88rem;
}
.stat-list li span { color: var(--muted); }

/* Inventário estilo Main.exe — bag 8×32; paperdoll 190×256 com zoom à largura da bag */
.game-panel.mu-inv {
  --mu-inv-scale: 1;
  --mu-inv-bag-size: calc(256px * var(--mu-inv-scale));
  /* Zoom inteiro do quadro equip = largura da bag (256/190) */
  --mu-inv-equip-scale: calc(var(--mu-inv-scale) * 256 / 190);
  --mu-inv-equip-w: calc(190px * var(--mu-inv-equip-scale));
  --mu-inv-equip-h: calc(256px * var(--mu-inv-equip-scale));
  /* coluna: largura = bag (256) + padding; altura cresce com scroll */
  width: min(300px, calc(100vw - 0.75rem));
  max-height: min(92vh, 720px);
  background: #1a1410 url("assets/ui/inventory/Item_Back02.jpg?v=2") center top / 100% auto no-repeat;
  border-color: rgba(180, 140, 70, 0.45);
  image-rendering: pixelated;
}
.mu-inv header {
  background: linear-gradient(180deg, rgba(40, 28, 16, 0.95), rgba(20, 14, 10, 0.9));
  gap: 0.45rem;
  padding: 0.4rem 0.65rem;
  flex: 0 0 auto;
}
.mu-inv header h2 { font-size: 0.95rem; }
.mu-inv-tab { image-rendering: pixelated; flex: 0 0 auto; }
.mu-inv-body {
  padding: 0.2rem 0.35rem 0.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
/* Tabs Inventário | Baú — removidas da UI */
.mu-inv-seg {
  display: none !important;

  display: none;
  flex: 0 0 auto;
  gap: 3px;
  margin: 0;
  padding: 0.22rem 0.4rem 0.28rem;
  border-bottom: 1px solid rgba(90, 64, 32, 0.75);
  background: linear-gradient(180deg, rgba(36, 26, 14, 0.96), rgba(18, 12, 8, 0.92));
  pointer-events: none;
}
.mu-inv-seg-btn {
  pointer-events: auto;
  flex: 1 1 0;
  min-width: 0;
  height: 22px;
  padding: 0 0.2rem;
  border: 1px solid #5a4020;
  border-radius: 0;
  background:
    url("assets/ui/login/0On_Botton.jpg") center / 100% 100% no-repeat,
    linear-gradient(180deg, #3a2c14, #1a140a);
  color: #c9b87a;
  font: 700 0.68rem/22px Tahoma, "IBM Plex Sans", sans-serif;
  text-shadow: 1px 1px 0 #000;
  letter-spacing: 0.02em;
  cursor: pointer;
  image-rendering: pixelated;
}
.mu-inv-seg-btn:hover,
.mu-inv-seg-btn:focus-visible {
  color: #fff6c8;
  border-color: #c9a227;
  outline: none;
  filter: brightness(1.1);
}
.mu-inv-seg-btn.is-active {
  color: #ffe6a0;
  border-color: #d4a84b;
  background:
    url("assets/ui/login/0On_Botton2.jpg") center / 100% 100% no-repeat,
    linear-gradient(180deg, #5a4020, #2a1c0c);
  filter: brightness(1.08);
}
.mu-inv-seg-btn:active {
  transform: translateY(1px);
  filter: brightness(0.95);
}
.mu-inv-pane { min-width: 0; }
/*
 * Orientação pedida: equip (paperdoll) em cima → ações → bag → zen.
 * Coluna única (não side-by-side). NÃO usar display:contents na bag.
 */
.mu-inv-main {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  width: 100%;
}
.mu-inv-gear {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 0 auto;
  min-width: 0;
  width: var(--mu-inv-equip-w);
}
.mu-inv-side {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.18rem;
  flex: 0 0 auto;
  width: var(--mu-inv-bag-size);
  max-width: var(--mu-inv-bag-size);
  min-width: var(--mu-inv-bag-size);
}
/* wrappers antigos — se restarem no DOM, não partem o layout */
.mu-inv-strip,
.mu-inv-bag-col {
  display: contents;
}
.mu-inv-gear-hint {
  margin: 0.12rem 0 0;
  text-align: center;
  font-size: 0.6rem;
  color: #a89870;
  max-width: var(--mu-inv-equip-w);
  line-height: 1.2;
}
/* Quadro nativo 190×256 — zoom uniforme (--mu-inv-equip-scale) à largura da bag */
.mu-inv-paper-wrap {
  width: var(--mu-inv-equip-w);
  height: var(--mu-inv-equip-h);
  margin: 0 auto;
  display: grid;
  place-items: start start;
  overflow: hidden;
}
.mu-inv-paper {
  position: relative;
  width: 190px;
  height: 256px;
  margin: 0;
  transform: scale(var(--mu-inv-equip-scale));
  transform-origin: top left;
  background: url("assets/ui/inventory/Item_Back01.jpg?v=5") center / 100% 100% no-repeat;
  image-rendering: pixelated;
  flex: 0 0 auto;
  pointer-events: auto;
}
.mu-equip {
  position: absolute;
  /* Tamanhos nativos Interface/Item_*.OZJ (Main.exe RenderEqiupmentBox) */
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background-color: transparent;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  image-rendering: pixelated;
  cursor: pointer;
  color: transparent;
  overflow: hidden;
  pointer-events: auto;
  touch-action: manipulation;
  z-index: 2;
}
.mu-equip.has {
  box-shadow: inset 0 0 0 1px rgba(212, 168, 75, 0.45);
  color: #f5e6c0;
  font-size: 0.55rem;
  text-shadow: 0 1px 2px #000;
  display: grid;
  place-items: center;
  background-blend-mode: normal;
}
.mu-equip.is-selected {
  outline: 2px solid #ffe08a;
  outline-offset: 0;
  z-index: 3;
}
.mu-equip.w40h60 { width: 40px; height: 60px; }
.mu-equip.w60h40 { width: 60px; height: 40px; }
.mu-equip.w20 { width: 20px; height: 20px; }
/*
 * Paperdoll Main.exe / ClienteFacil S2.5 — coords de ZzzInventory::RenderEqiupmentBox
 * (sven-n/MuMain), relativas a Item_Back01 190×256. Escala: --mu-inv-scale no wrap.
 *
 *   [helper 15,46] [helm 75,46] [wings 115,46]
 *   [weapon 15,89] [pend 55,89] [armor 75,89] [shield 134,89]
 *   [gloves 15,152] [ringR 55,152] [pants 75,152] [ringL 115,152] [boots 134,152]
 */
.mu-equip[data-slot="helper"] { left: 15px; top: 46px; }
.mu-equip[data-slot="helm"] { left: 75px; top: 46px; }
.mu-equip[data-slot="wings"] { left: 115px; top: 46px; }
.mu-equip[data-slot="weapon"] { left: 15px; top: 89px; }
.mu-equip[data-slot="pendant"] { left: 55px; top: 89px; }
.mu-equip[data-slot="armor"] { left: 75px; top: 89px; }
.mu-equip[data-slot="shield"] { left: 134px; top: 89px; }
.mu-equip[data-slot="gloves"] { left: 15px; top: 152px; }
.mu-equip[data-slot="ring1"] { left: 55px; top: 152px; }   /* EQUIPMENT_RING_RIGHT */
.mu-equip[data-slot="pants"] { left: 75px; top: 152px; }
.mu-equip[data-slot="ring2"] { left: 115px; top: 152px; }  /* EQUIPMENT_RING_LEFT */
.mu-equip[data-slot="boots"] { left: 134px; top: 152px; }

.mu-inv-bag {
  padding: 0;
  border: 1px solid #5a4020;
  background: #0c0a08;
  image-rendering: pixelated;
  /* Entre ações (cima) e zen (baixo) — altura fixa, não colapsa */
  width: var(--mu-inv-bag-size);
  max-width: var(--mu-inv-bag-size);
  height: var(--mu-inv-bag-size);
  min-height: var(--mu-inv-bag-size);
  flex: 0 0 var(--mu-inv-bag-size);
  margin: 0;
  box-sizing: border-box;
  position: relative;
  z-index: 2;
  overflow: hidden;
  order: 0;
}
.inv-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  grid-template-rows: repeat(8, minmax(0, 1fr));
  gap: 0;
  aspect-ratio: 1;
  max-width: 256px;
  width: 100%;
  margin: 0;
}
.inv-grid--layered {
  position: relative;
  isolation: isolate;
}
.inv-grid--layered > .inv-item {
  position: absolute;
  z-index: 3;
}
/* Bag: grelha com px explícitos (à prova de colapso 1fr→0) */
.mu-inv .inv-grid {
  --mu-inv-cell: calc(32px * var(--mu-inv-scale));
  width: var(--mu-inv-bag-size);
  height: var(--mu-inv-bag-size);
  min-width: var(--mu-inv-bag-size);
  min-height: var(--mu-inv-bag-size);
  max-width: none;
  aspect-ratio: auto;
  grid-template-columns: repeat(8, var(--mu-inv-cell));
  grid-template-rows: repeat(8, var(--mu-inv-cell));
}
/* body tem touch-action:none — sem isto o painel não faz scroll tátil */
.game-panel.mu-inv,
.game-panel.mu-inv .mu-inv-body {
  touch-action: pan-y;
}
.inv-cell {
  min-width: 0;
  min-height: 0;
  border-radius: 0;
  background: rgba(10, 8, 6, 0.55);
  border: 1px solid rgba(90, 64, 32, 0.55);
  font-size: 0.55rem;
  color: #e8d090;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: default;
  overflow: hidden;
  text-align: center;
  line-height: 1.1;
  image-rendering: pixelated;
}
.mu-inv .inv-cell {
  width: var(--mu-inv-cell);
  height: var(--mu-inv-cell);
  min-width: var(--mu-inv-cell);
  min-height: var(--mu-inv-cell);
  background: url("assets/ui/inventory/InventoryBox2.jpg?v=4") center / 100% 100% no-repeat;
  border: 0;
  z-index: 0;
}
.inv-drop.drop-foot.drop-ok {
  background:
    linear-gradient(rgba(48, 96, 48, 0.45), rgba(48, 96, 48, 0.45)),
    url("assets/ui/inventory/InventoryBox2.jpg?v=4") center / 100% 100% no-repeat;
  box-shadow: inset 0 0 0 1px rgba(120, 220, 120, 0.55);
}
.inv-drop.drop-foot.drop-bad {
  background:
    linear-gradient(rgba(96, 32, 32, 0.45), rgba(96, 32, 32, 0.45)),
    url("assets/ui/inventory/InventoryBox2.jpg?v=4") center / 100% 100% no-repeat;
  box-shadow: inset 0 0 0 1px rgba(224, 112, 112, 0.55);
}
.mu-inv .inv-item {
  border-width: 1px;
  /* placa cinza fria (Main) — sem wash amarelo/dourado */
  background: rgba(18, 18, 20, 0.94);
  border-color: #3a3a40;
  z-index: 3;
}
.inv-item {
  position: absolute;
  z-index: 2;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 1px solid #3a3a40;
  border-radius: 0;
  background: rgba(18, 18, 20, 0.92);
  color: transparent;
  cursor: grab;
  overflow: hidden;
  display: grid;
  place-items: center;
  image-rendering: pixelated;
  touch-action: none;
  user-select: none;
  -webkit-user-drag: none;
}
.inv-item:hover {
  border-color: #6a6a72;
  background: rgba(28, 28, 32, 0.96);
  z-index: 3;
}
.inv-item.dragging {
  opacity: 0.45;
  cursor: grabbing;
  z-index: 5;
  pointer-events: none;
}
.inv-item.exc-item,
.mu-equip.exc-item {
  border-color: #5ec8ff;
  box-shadow: inset 0 0 0 1px rgba(94, 200, 255, 0.35);
}
.inv-item.luck-item,
.mu-equip.luck-item {
  border-color: #e0c060;
  box-shadow: inset 0 0 0 1px rgba(224, 192, 96, 0.4);
}
.inv-cell.filled {
  background: rgba(14, 14, 16, 0.9);
  border-color: #3a3a40;
  cursor: pointer;
}
.inv-cell.filled:hover { border-color: #6a6a72; background: rgba(26, 26, 30, 0.95); }

.inv-cell.has-icon {
  background-color: rgba(12, 12, 14, 0.8);
}
.mu-equip.has-item-icon {
  background-blend-mode: normal;
}
.mu-inv-zen {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35rem;
  margin: 0;
  width: 100%;
  max-width: var(--mu-inv-bag-size);
  font-variant-numeric: tabular-nums;
  color: #f0d78a;
  font-size: 0.82rem;
  min-height: 18px;
  flex: 0 0 auto;
  order: 0; /* DOM: depois da bag — fica em baixo */
  position: relative;
  z-index: 1;
}
.mu-inv-zen img { image-rendering: pixelated; height: 14px; width: auto; }

.mu-inv-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.28rem;
  margin: 0;
  width: 100%;
  max-width: var(--mu-inv-bag-size);
  flex: 0 0 auto;
}
/* Message_box + Level_box (Main.exe) — detalhe do item selecionado */
.mu-inv-detail {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  margin: 0;
  min-height: 64px;
  padding: 0.28rem 0.4rem 0.32rem;
  box-sizing: border-box;
  background: #14100c center / 100% 100% no-repeat;
  border: 1px solid rgba(90, 64, 32, 0.55);
  image-rendering: pixelated;
  color: #e8d090;
  text-shadow: 1px 1px 0 #000;
}
.mu-inv-detail-namebox {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 21px;
  padding: 0.1rem 0.35rem;
  box-sizing: border-box;
  background: rgba(20, 16, 12, 0.55) center / 100% 100% no-repeat;
  image-rendering: pixelated;
}
#inv-detail-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  image-rendering: pixelated;
  flex: 0 0 auto;
}
#inv-detail-icon[hidden] {
  display: none !important;
}
.mu-inv-detail-namebox strong,
#inv-detail-name {
  margin: 0;
  font: 700 0.78rem/1.15 Tahoma, "Segoe UI", sans-serif;
  letter-spacing: 0.02em;
  text-align: center;
  color: #ffe8a8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
#inv-detail-name.is-exc { color: #7ad8ff; }
#inv-detail-name.is-luck { color: #ffe08a; }
.mu-inv-detail-body {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.mu-inv-detail-meta {
  margin: 0;
  font: 0.68rem/1.3 Tahoma, "Segoe UI", sans-serif;
  color: #d8c89a;
  white-space: normal;
  word-break: break-word;
}
.mu-inv-detail-meta:empty { display: none; }
.mu-inv-detail-opts {
  margin: 0;
  padding: 0;
  list-style: none;
  font: 0.65rem/1.25 Tahoma, "Segoe UI", sans-serif;
  color: #6ecfff;
}
.mu-inv-detail-opts li {
  margin: 0;
  padding: 0;
}
.mu-inv-detail-opts[hidden] { display: none !important; }
.mu-inv-detail-hint {
  margin: 0.05rem 0 0;
  font: 0.62rem/1.25 Tahoma, "Segoe UI", sans-serif;
  color: #a89870;
}
.mu-inv-detail-hint.is-status {
  color: #ffe08a;
}
.mu-inv-detail-hint.is-error {
  color: #ffb0a0;
}
.mu-inv-action-btns {
  display: flex;
  flex: 0 0 auto;
  gap: 0.25rem;
  justify-content: stretch;
}
.mu-inv-action-btns .hud-btn {
  flex: 1 1 0;
}
.inv-equip-btn,
.inv-unequip-btn,
.inv-drop-btn {
  flex: 0 0 auto;
  padding: 0.28rem 0.55rem !important;
  font-size: 0.72rem !important;
  min-height: 0 !important;
}
.inv-drop-btn:not([hidden]) {
  border-color: rgba(220, 140, 120, 0.55);
  color: #ffd0c0;
  background: rgba(72, 32, 28, 0.82);
}
.inv-item.is-selected {
  border-color: #9a9aa4;
  box-shadow: inset 0 0 0 1px rgba(180, 180, 190, 0.4);
  background: rgba(32, 32, 36, 0.96);
  z-index: 4;
}
.item-icon-host,
.item-3d-host {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  overflow: hidden;
}
.item-icon,
.item-3d-fallback {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  /* MMK = footprint exacto; fill = Main a preencher o rect W×H */
  object-fit: fill;
  object-position: center;
  image-rendering: pixelated;
  display: block;
  transform: none;
}
.item-icon-text,
.item-3d-fallback-text {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #e8d090 !important;
  font: 700 0.62rem/1 Tahoma, sans-serif;
  text-shadow: 0 1px 2px #000;
}
.mu-equip.has-item-icon .item-icon-text,
.mu-equip.has-3d .item-3d-fallback-text {
  color: #ffe6a0 !important;
  font-size: 0.5rem;
  padding: 1px;
  text-align: center;
  white-space: normal;
  line-height: 1.05;
}
.inv-cell {
  position: relative;
}
.inv-cell.filled {
  color: transparent;
}
.inv-item .item-lv,
.inv-cell .item-lv,
.mu-equip .item-lv {
  position: absolute;
  right: 1px;
  bottom: 0;
  z-index: 2;
  font-size: 0.55rem;
  font-weight: 700;
  color: #ffe6a0;
  text-shadow: 0 1px 2px #000;
  pointer-events: none;
}
.inv-item .item-icon-host,
.inv-item .item-3d-host {
  inset: 1px;
}
.inv-item .item-icon,
.inv-item .item-3d-fallback {
  width: 100%;
  height: 100%;
  object-fit: fill;
  object-position: center;
}
.mu-equip {
  position: absolute;
}
.mu-equip.has-item-icon,
.mu-equip.has-3d {
  color: transparent;
}
.mu-equip .item-icon-host,
.mu-equip .item-3d-host {
  inset: 1px;
  z-index: 2;
  overflow: hidden;
}
/* Paperdoll: slots 40×40 / 20×20 — contain; armas/armadura 40×60 — fill como Main */
.mu-equip .item-icon,
.mu-equip .item-3d-fallback {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  transform: none;
}
.mu-equip.w40h60 .item-icon,
.mu-equip.w40h60 .item-3d-fallback {
  object-fit: fill;
}
.mu-equip.has-item-icon.w40h60 {
  /* Silhueta vazia por baixo atrapalha armas altas (Giant Sword) */
  background-blend-mode: multiply;
}
.mu-inv .inv-item .item-icon,
.mu-inv .inv-item .item-3d-fallback {
  width: 100%;
  height: 100%;
  object-fit: fill;
}
/* Loja — mesma grelha de células que a bag */
.mu-shop .inv-item .item-icon,
.shop-grid .item-icon {
  object-fit: fill;
}
/* Loja NPC — chrome Main.exe (Item_Back + grelha InventoryBox2) */
.game-panel.mu-shop {
  width: min(360px, calc(100vw - 0.75rem));
  max-height: min(86vh, 640px);
  background: #1a1410 url("assets/ui/shop/Item_Back02.jpg?v=1") center top / 100% auto no-repeat;
  border-color: rgba(180, 140, 70, 0.45);
  image-rendering: pixelated;
}
.mu-shop header {
  background: linear-gradient(180deg, rgba(40, 28, 16, 0.95), rgba(20, 14, 10, 0.9));
  gap: 0.45rem;
  padding: 0.4rem 0.65rem;
  flex: 0 0 auto;
}
.mu-shop header h2 { font-size: 0.95rem; }
.mu-shop-ico { image-rendering: pixelated; flex: 0 0 auto; }
.mu-shop-modes {
  display: flex;
  flex: 0 0 auto;
  gap: 3px;
  margin: 0;
  padding: 0.22rem 0.4rem 0.28rem;
  border-bottom: 1px solid rgba(90, 64, 32, 0.75);
  background: linear-gradient(180deg, rgba(36, 26, 14, 0.96), rgba(18, 12, 8, 0.92));
}
.mu-shop-mode {
  flex: 1 1 0;
  min-width: 0;
  height: 28px;
  padding: 0 0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 1px solid #5a4020;
  border-radius: 0;
  background:
    url("assets/ui/login/0On_Botton.jpg") center / 100% 100% no-repeat,
    linear-gradient(180deg, #3a2c14, #1a140a);
  color: #c9b87a;
  font: 700 0.72rem/1 Tahoma, "IBM Plex Sans", sans-serif;
  text-shadow: 1px 1px 0 #000;
  cursor: pointer;
  image-rendering: pixelated;
}
.mu-shop-mode img {
  width: 20px;
  height: 20px;
  image-rendering: pixelated;
  flex: 0 0 auto;
  pointer-events: none;
}
.mu-shop-mode:hover,
.mu-shop-mode:focus-visible {
  color: #fff6c8;
  border-color: #c9a227;
  outline: none;
  filter: brightness(1.1);
}
.mu-shop-mode.is-active {
  color: #ffe6a0;
  border-color: #d4a84b;
  background:
    url("assets/ui/login/0On_Botton2.jpg") center / 100% 100% no-repeat,
    linear-gradient(180deg, #5a4020, #2a1c0c);
  filter: brightness(1.08);
}
.mu-shop-body {
  padding: 0.35rem 0.5rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.mu-shop-pane {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
/* display:flex acima anula o UA [hidden] — forçar hide */
.mu-shop-pane[hidden] {
  display: none !important;
}
.mu-shop-grid-wrap {
  flex: 1 1 auto;
  min-height: 140px;
  max-height: min(52vh, 360px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 4px;
  background:
    url("assets/ui/shop/shopdisplay/itembackpanel.png?v=1") center / 100% 100% no-repeat,
    rgba(12, 10, 8, 0.85);
  border: 1px solid rgba(90, 64, 32, 0.65);
  image-rendering: pixelated;
  -webkit-overflow-scrolling: touch;
  pointer-events: auto;
}
.shop-grid.inv-grid {
  --shop-rows: 8;
  position: relative;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(var(--shop-rows), 1fr);
  aspect-ratio: 8 / var(--shop-rows);
  max-width: 296px;
  width: 100%;
  margin: 0 auto;
  /* altura natural via aspect-ratio → wrap faz scroll */
  flex: 0 0 auto;
  touch-action: pan-y;
}
.shop-grid .inv-cell {
  background: url("assets/ui/shop/InventoryBox2.jpg?v=1") center / 100% 100% no-repeat;
  border-color: rgba(70, 55, 35, 0.45);
  pointer-events: none;
}
.shop-grid .inv-item {
  cursor: pointer;
  /* inv usa touch-action:none (drag); na loja precisa scroll + tap */
  touch-action: manipulation;
  pointer-events: auto;
}
.shop-grid .inv-item .shop-price-tag {
  position: absolute;
  left: 1px;
  right: 1px;
  bottom: 1px;
  z-index: 2;
  font: 700 0.52rem/1 Tahoma, sans-serif;
  color: #ffe08a;
  text-shadow: 1px 1px 0 #000, 0 0 2px #000;
  text-align: center;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mu-shop-detail {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 0.2rem 0.45rem;
  align-items: center;
  flex: 0 0 auto;
  min-height: 52px;
  padding: 0.35rem 0.45rem;
  background: url("assets/ui/shop/Message_box.jpg?v=1") center / 100% 100% no-repeat;
  border: 1px solid rgba(90, 64, 32, 0.55);
  image-rendering: pixelated;
  font-size: 0.78rem;
  color: #e8d090;
  pointer-events: auto;
  z-index: 2;
}
.mu-shop-detail #shop-detail,
.mu-shop-detail #shop-sell-sel {
  grid-column: 1;
  grid-row: 1;
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 1px 1px 0 #000;
}
.mu-shop-detail #shop-detail-price,
.mu-shop-detail #shop-sell-price {
  grid-column: 1;
  grid-row: 2;
  color: #ffe08a;
  font-variant-numeric: tabular-nums;
  text-shadow: 1px 1px 0 #000;
}
.mu-shop-action-btn {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  image-rendering: pixelated;
  line-height: 0;
  pointer-events: auto;
  touch-action: manipulation;
  z-index: 3;
}
.mu-shop-action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.mu-shop-action-btn:not(:disabled):hover {
  filter: brightness(1.15);
}
.mu-shop-action-btn img {
  display: block;
  image-rendering: pixelated;
  pointer-events: none;
}
.mu-shop-zen {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.05rem 0 0;
  padding: 0.2rem 0.25rem;
  flex: 0 0 auto;
  font: 700 0.85rem Tahoma, sans-serif;
  color: #ffe08a;
  text-shadow: 1px 1px 0 #000;
}
.mu-shop-zen img { image-rendering: pixelated; height: 14px; width: auto; }
.mu-shop-status {
  flex: 1 1 auto;
  min-width: 0;
  font: 600 0.68rem Tahoma, sans-serif;
  color: #b8a878;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shop-sell-hint {
  margin: 0;
  flex: 0 0 auto;
  font-size: 0.72rem;
  color: #a89870;
  text-shadow: 1px 1px 0 #000;
}

/* Listas genéricas (Move / Social) — mantém layout simples */
.shop-list {
  display: grid;
  gap: 0.4rem;
  max-height: 48vh;
  overflow: auto;
}
.shop-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.55rem 0.6rem;
  border-radius: 10px;
  background: #101916;
  border: 1px solid rgba(232, 240, 234, 0.08);
  font-size: 0.82rem;
}
.shop-row .item-3d-host {
  position: relative;
  inset: auto;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(180,140,70,0.35);
}
.shop-row button {
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  border: 0;
  background: var(--accent-2);
  color: #e8f0ea;
  font: 600 0.75rem var(--font-body);
  cursor: pointer;
}
.shop-row .price { color: var(--accent); font-variant-numeric: tabular-nums; }
.shop-item-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Mobile: coluna equip → ações → bag → zen. Escala pela bag (256). */
@media (max-width: 767px) {
  .game-panel.mu-inv {
    --mu-inv-hud-clear: max(9.4rem, calc(env(safe-area-inset-bottom) + 8.8rem));
    /* min(number, number, number) — NUNCA misturar 1 com px (fica inválido) */
    --mu-inv-scale: min(
      1,
      calc((100vw - 1.2rem) / 272px),
      calc((100dvh - 12rem) / 520px)
    );
    --mu-inv-bag-size: calc(256px * var(--mu-inv-scale));
    --mu-inv-equip-scale: calc(var(--mu-inv-scale) * 256 / 190);
    --mu-inv-equip-w: calc(190px * var(--mu-inv-equip-scale));
    --mu-inv-equip-h: calc(256px * var(--mu-inv-equip-scale));
    width: min(calc(100vw - 0.4rem), calc(var(--mu-inv-bag-size) + 1.2rem));
    max-width: 100vw;
    left: 50%;
    right: auto;
    top: max(0.3rem, env(safe-area-inset-top));
    bottom: var(--mu-inv-hud-clear);
    transform: translateX(-50%);
    max-height: none;
    height: auto;
    border-radius: 10px;
    z-index: 14;
    overflow: hidden;
    touch-action: pan-y;
  }
  .mu-inv header {
    padding: 0.32rem 0.5rem;
    flex: 0 0 auto;
  }
  .mu-inv header h2 { font-size: 0.88rem; }
  .mu-inv .panel-close {
    width: 2.35rem;
    height: 2.35rem;
    font-size: 1.45rem;
  }
  .mu-inv-seg { display: none !important; }
  .mu-inv-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0.25rem 0.35rem 0.45rem;
    gap: 0.2rem;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
  }
  .mu-inv-pane { display: none; }
  .mu-inv-pane.is-active {
    display: block !important;
    width: 100%;
    min-height: 0;
  }
  .mu-inv-main {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 0.3rem;
    width: 100%;
    max-width: 100%;
  }
  .mu-inv-side {
    width: var(--mu-inv-bag-size);
    max-width: var(--mu-inv-bag-size);
    min-width: var(--mu-inv-bag-size);
  }
  .mu-inv-gear-hint { display: none; }
  .mu-inv-paper-wrap {
    width: var(--mu-inv-equip-w);
    height: var(--mu-inv-equip-h);
    max-width: 100%;
    display: grid;
    place-items: start start;
    overflow: hidden;
  }
  .mu-inv-paper {
    width: 190px;
    height: 256px;
    transform: scale(var(--mu-inv-equip-scale));
    transform-origin: top left;
  }
  .mu-inv-actions {
    width: 100%;
    min-height: 0;
    gap: 0.22rem;
  }
  .mu-inv-detail {
    min-height: 58px;
    padding: 0.24rem 0.32rem 0.28rem;
  }
  .mu-inv-detail-namebox strong,
  #inv-detail-name {
    font-size: 0.72rem;
    white-space: normal;
    line-height: 1.2;
  }
  .mu-inv-detail-meta {
    font-size: 0.64rem;
  }
  .mu-inv-detail-opts {
    font-size: 0.62rem;
    max-height: 3.6em;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
  .mu-inv-detail-hint {
    font-size: 0.58rem;
  }
  .mu-inv-action-btns {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.2rem;
    width: 100%;
  }
  .inv-equip-btn,
  .inv-unequip-btn,
  .inv-drop-btn {
    width: 100%;
    min-height: 2.1rem !important;
    padding: 0.28rem 0.2rem !important;
    font-size: 0.72rem !important;
    touch-action: manipulation;
  }
  .mu-inv-bag {
    width: var(--mu-inv-bag-size);
    height: var(--mu-inv-bag-size);
    min-height: var(--mu-inv-bag-size);
    flex: 0 0 var(--mu-inv-bag-size);
  }
  .mu-inv .inv-grid {
    --mu-inv-cell: calc(32px * var(--mu-inv-scale));
    width: var(--mu-inv-bag-size);
    height: var(--mu-inv-bag-size);
    min-width: var(--mu-inv-bag-size);
    min-height: var(--mu-inv-bag-size);
    grid-template-columns: repeat(8, var(--mu-inv-cell));
    grid-template-rows: repeat(8, var(--mu-inv-cell));
  }
  .mu-inv .inv-item { border-width: 1.5px; }
  .mu-inv-zen {
    font-size: 0.8rem;
    width: 100%;
  }
}

@media (max-width: 767px) and (orientation: landscape) {
  .game-panel.mu-inv {
    --mu-inv-scale: min(1, calc((100vw - 1.2rem) / 456px), calc(78dvh / 280px));
    --mu-inv-bag-size: calc(256px * var(--mu-inv-scale));
    --mu-inv-equip-scale: calc(var(--mu-inv-scale) * 256 / 190);
    --mu-inv-equip-w: calc(190px * var(--mu-inv-equip-scale));
    --mu-inv-equip-h: calc(256px * var(--mu-inv-equip-scale));
  }
}

@media (max-width: 360px) {
  .game-panel.mu-inv {
    --mu-inv-scale: min(1, calc((100vw - 0.9rem) / 456px));
    --mu-inv-bag-size: calc(256px * var(--mu-inv-scale));
    --mu-inv-equip-scale: calc(var(--mu-inv-scale) * 256 / 190);
    --mu-inv-equip-w: calc(190px * var(--mu-inv-equip-scale));
    --mu-inv-equip-h: calc(256px * var(--mu-inv-equip-scale));
  }
}

@media (max-width: 520px) {
  .game-panel {
    top: auto;
    bottom: max(0.5rem, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    max-height: 62vh;
  }
  .game-panel.mu-inv {
    top: max(0.3rem, env(safe-area-inset-top));
    bottom: max(9.4rem, calc(env(safe-area-inset-bottom) + 8.8rem));
    max-height: none;
    transform: translateX(-50%);
  }
  #hud-bottom {
    --hud-slot-h: 3.75rem;
    --hud-slot-gap: 0.16rem;
    --hud-bar-pad-y: 0.28rem;
    --hud-bar-pad-x: 0.22rem;
    width: min(38rem, 99vw);
    max-width: min(38rem, 99vw);
    bottom: max(1.25rem, calc(env(safe-area-inset-bottom) + 1.1rem));
    gap: 0;
  }
  .hud-in-main {
    width: clamp(3.6rem, 14vw, 5.2rem);
    bottom: 0.05rem;
  }
  .hud-in-main-l { left: -0.2rem; }
  .hud-in-main-r { right: -0.2rem; }
  .hud-bottom-chrome {
    width: calc(100% - 0.6rem);
    padding: 0.12rem 0.1rem 0.2rem;
  }
  .hud-menu02-bridge {
    flex-basis: 0.5rem;
  }
  #hud-actions {
    /* +Party no centro: slots um pouco mais estreitos no telemóvel */
    --hud-cmd-w: clamp(2.55rem, 11.5vw, 3.35rem);
  }
  #hud-actions .hud-action-slot {
    font-size: 0.52rem;
  }
  #hud-actions .hud-action-label,
  #hud-actions .hud-action-slot .skill-name {
    font-size: 0.48rem;
  }
  .stick {
    bottom: max(10.6rem, calc(env(safe-area-inset-bottom) + 10.1rem));
  }
}

/* Desktop: hotbar Main 640×48 — Menu01|02|03 + slots sobre gravuras Q/W/E */
@media (min-width: 768px) {
  #hud-bottom {
    --hud-mu-w: 640px;
    --hud-slot-h: 2.7rem;
    --hud-slot-gap: 0.14rem;
    --hud-bar-pad-y: 0.12rem;
    --hud-bar-pad-x: 0.18rem;
    --hud-cmd-w: 2.2rem; /* pass9: slots Menu03 absolutos */
    /* Q/W/E em hotbar_640 (px / 640) — pass7: poços quadrados (não a célula letra+círculo) */
    --qwe-q-l: 33.75%;      /* 216 */
    --qwe-w-l: 38.59375%;   /* 247 */
    --qwe-e-l: 43.4375%;    /* 278 */
    --qwe-slot-w: 2.8125%;  /* 18 */
    --qwe-slot-t: 31.25%;   /* 15 */
    --qwe-slot-h: 29.1667%; /* 14 — acima das letras */
    width: min(640px, 98vw);
    max-width: min(640px, 98vw);
    bottom: max(1.1rem, calc(env(safe-area-inset-bottom) + 0.95rem));
  }
  .hud-in-main {
    width: 4.6rem;
    bottom: -0.15rem;
    opacity: 0.92;
  }
  .hud-in-main-l { left: -1.65rem; }
  .hud-in-main-r { right: -1.65rem; }
  .hud-bottom-chrome {
    position: relative;
    flex-direction: row;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    height: 48px;
    min-height: 48px;
    padding: 0;
    gap: 0;
    border-radius: 0;
    /* composite Menu01|02|03 — seamless Main strip */
    background: url("assets/ui/hud/hotbar_640.png?v=7") center / 100% 100% no-repeat;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.55);
  }
  /* skill-bar vira overlay absoluto p/ alinhar aos Q/W/E (E entra no Menu02) */
  #skill-bar {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    flex: none;
    width: 100%;
    max-width: 100%;
    min-height: 0;
    height: 100%;
    padding: 0;
    margin: 0;
    background: none;
    box-shadow: none;
    gap: 0;
    z-index: 3;
    pointer-events: none;
  }
  /* #skill-bar é absolute — ::before reserva os 40% do Menu01 no flex */
  .hud-bottom-chrome::before {
    content: "";
    flex: 0 0 40%;
    width: 40%;
    max-width: 40%;
    height: 100%;
    pointer-events: none;
  }
  .hud-menu02-bridge {
    flex: 0 0 20%; /* 128/640 — spacer; E overlay fica por cima */
    flex-basis: 20%;
    width: 20%;
    max-width: 20%;
    height: 100%;
    background: none;
  }
  #hud-actions {
    flex: 0 0 40%;
    width: 40%;
    max-width: 40%;
    height: 100%;
    padding: 0;
    background: none;
    box-shadow: none;
    column-gap: 0;
    position: relative;
    z-index: 2;
    display: block; /* pass9: slots absolutos sobre poços Menu03 */
    /* Poços Char/Inv no asset 256×48 → % do #hud-actions */
    --m03-slot-w: 9.375%;   /* 24/256 */
    --m03-slot-t: 20.833%;  /* 10/48 */
    --m03-slot-h: 58.333%;  /* 28/48 */
  }
  .hud-actions-left,
  .hud-actions-center,
  .hud-actions-right {
    display: contents; /* botões posicionam no #hud-actions */
  }
  #hud-actions .hud-action-slot,
  #hud-actions #btn-atk,
  #hud-actions #btn-skill {
    position: absolute;
    top: var(--m03-slot-t);
    flex: none;
    width: var(--m03-slot-w);
    max-width: none;
    min-width: 0;
    height: var(--m03-slot-h);
    min-height: 0;
    padding: 0.04rem 0.02rem 0.02rem;
    border-radius: 2px;
    justify-content: center;
  }
  /* Char / Inv = poços gravados; Party = 3.º poço lab; Hunt/Atk/Skill à direita */
  #hud-actions #btn-char { left: 3.125%; }   /* x≈8 */
  #hud-actions #btn-inv { left: 14.0625%; }  /* x≈36 */
  #hud-actions #btn-party { left: 25%; }     /* x≈64 — após Inv, antes da garra */
  #hud-actions #btn-hunt { left: 36.5%; }
  #hud-actions #btn-chaos { left: 47.5%; }
  #hud-actions #btn-atk { left: 62.5%; width: 10.5%; }
  #hud-actions #btn-skill { left: 78%; width: 10.5%; }
  /* Char/Inv/Party: só ícone (chrome já tem moldura) */
  #hud-actions #btn-char .hud-action-label,
  #hud-actions #btn-inv .hud-action-label,
  #hud-actions #btn-party .hud-action-label,
  #hud-actions #btn-char small,
  #hud-actions #btn-inv small,
  #hud-actions #btn-party small {
    display: none;
  }
  #hud-actions #btn-char .hud-action-ico,
  #hud-actions #btn-inv .hud-action-ico,
  #hud-actions #btn-party .hud-action-ico {
    inset: 2px;
    top: 50%;
    max-height: 88%;
    max-width: 88%;
  }
  #hud-actions .hud-action-slot.party {
    border-color: rgba(196, 163, 90, 0.55);
    background: rgba(36, 28, 12, 0.35);
  }
  /* Slots transparentes — o chrome Menu já traz moldura + Q/W/E */
  #skill-bar .skill-slot {
    position: absolute;
    pointer-events: auto;
    flex: none;
    width: var(--qwe-slot-w);
    height: var(--qwe-slot-h);
    min-width: 0;
    min-height: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: hidden;
  }
  #skill-bar .skill-slot:hover,
  #skill-bar .skill-slot:focus-visible {
    border: none;
    box-shadow: inset 0 0 0 1px rgba(255, 220, 120, 0.55);
    outline: none;
    background: rgba(255, 220, 140, 0.08);
  }
  #skill-bar .skill-slot.active {
    border: none;
    background: rgba(120, 180, 255, 0.14);
    box-shadow: inset 0 0 0 1px rgba(140, 190, 255, 0.55);
  }
  #skill-bar .skill-slot.empty {
    opacity: 1;
    border: none;
  }
  /* Q/W/E = hotbar 1/2/3 — ícone acima da letra gravada */
  #skill-bar .skill-slot[data-slot="0"] { left: var(--qwe-q-l); top: var(--qwe-slot-t); }
  #skill-bar .skill-slot[data-slot="1"] { left: var(--qwe-w-l); top: var(--qwe-slot-t); }
  #skill-bar .skill-slot[data-slot="2"] { left: var(--qwe-e-l); top: var(--qwe-slot-t); }
  /* Lab: slots 4–6 + K na zona decorativa esquerda do Menu01 */
  #skill-bar .skill-slot[data-slot="3"] { left: 14.5%; top: 24%; width: 4.1%; height: 52%; }
  #skill-bar .skill-slot[data-slot="4"] { left: 19.2%; top: 24%; width: 4.1%; height: 52%; }
  #skill-bar .skill-slot[data-slot="5"] { left: 23.9%; top: 24%; width: 4.1%; height: 52%; }
  #skill-bar #btn-skill-cfg {
    left: 28.2%;
    top: 24%;
    width: 3.6%;
    height: 52%;
    border: none;
    background: rgba(36, 26, 10, 0.35);
    box-shadow: inset 0 0 0 1px rgba(255, 210, 90, 0.35);
  }
  #skill-bar #btn-skill-cfg:hover,
  #skill-bar #btn-skill-cfg:focus-visible {
    background: rgba(72, 52, 16, 0.55);
    box-shadow: inset 0 0 0 1px rgba(255, 230, 140, 0.65);
  }
  /* Gravuras Q/W/E do chrome — esconde labels duplicados nos 3 primeiros */
  #skill-bar .skill-slot[data-slot="0"] .skill-name,
  #skill-bar .skill-slot[data-slot="1"] .skill-name,
  #skill-bar .skill-slot[data-slot="2"] .skill-name,
  #skill-bar .skill-slot[data-slot="0"] small,
  #skill-bar .skill-slot[data-slot="1"] small,
  #skill-bar .skill-slot[data-slot="2"] small {
    display: none;
  }
  #skill-bar .skill-slot[data-slot="3"] .skill-name,
  #skill-bar .skill-slot[data-slot="4"] .skill-name,
  #skill-bar .skill-slot[data-slot="5"] .skill-name,
  #skill-bar #btn-skill-cfg .skill-name {
    font-size: 0.32rem;
  }
  #skill-bar .skill-slot[data-slot="3"] small,
  #skill-bar .skill-slot[data-slot="4"] small,
  #skill-bar .skill-slot[data-slot="5"] small,
  #skill-bar #btn-skill-cfg small {
    font-size: 0.36rem;
    top: 0;
    right: 0;
  }
  #skill-bar #btn-skill-cfg .hud-action-ico,
  #skill-bar .skill-slot .skill-ico {
    top: 38%;
    max-height: 68%;
    max-width: 78%;
    width: 78%;
    height: 68%;
  }
  /* Q/W/E: ícone preenche o poço (letras ficam no chrome abaixo) */
  #skill-bar .skill-slot[data-slot="0"] .skill-ico,
  #skill-bar .skill-slot[data-slot="1"] .skill-ico,
  #skill-bar .skill-slot[data-slot="2"] .skill-ico {
    top: 50%;
    max-height: 92%;
    height: 92%;
    max-width: 92%;
    width: 92%;
  }
  #hud-actions .hud-action-label,
  #hud-actions .hud-action-slot .skill-name {
    font-size: 0.36rem;
    letter-spacing: -0.03em;
  }
  #hud-actions .hud-action-slot small {
    font-size: 0.38rem;
  }
  #hud-actions .hud-action-ico {
    top: 38%;
    max-height: 70%;
  }
  #hud-actions #btn-atk .hud-action-label,
  #hud-actions #btn-skill .hud-action-label,
  #hud-actions #btn-hunt .hud-action-label {
    font-size: 0.34rem;
  }
  .hud-t-main {
    top: -12px;
    max-height: 24px;
  }
}

.hud-bar { display: none; }
#hud-top {
  position: absolute;
  top: max(0.25rem, env(safe-area-inset-top));
  left: max(0.4rem, env(safe-area-inset-left));
  right: max(0.4rem, env(safe-area-inset-right));
  z-index: 9;
  display: grid;
  grid-template-columns: 82px minmax(10rem, 1fr) 82px;
  align-items: start;
  gap: 0.35rem 0.55rem;
  pointer-events: none;
}
.hud-hp-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  justify-self: center;
  width: 100%;
}
.hud-move-btn {
  pointer-events: auto;
  position: relative;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.22rem;
  min-width: 4.4rem;
  max-width: 100%;
  margin-top: 0.1rem;
  padding: 0.22rem 0.42rem;
  border-radius: 7px;
  border: 1px solid rgba(180, 170, 140, 0.4);
  background:
    linear-gradient(180deg, rgba(36, 32, 24, 0.92), rgba(14, 12, 10, 0.94));
  color: #e8e0c8;
  font: 700 0.62rem/1 var(--font-body);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  text-shadow: 0 1px 2px #000;
}
.hud-move-btn:hover,
.hud-move-btn:focus-visible {
  border-color: rgba(220, 200, 140, 0.65);
  color: #fff4d0;
  outline: none;
}
.hud-move-btn:active {
  transform: translateY(1px);
}
.hud-move-ico {
  width: 18px;
  height: 18px;
  object-fit: contain;
  image-rendering: pixelated;
  flex-shrink: 0;
  pointer-events: none;
}
.hud-move-label {
  pointer-events: none;
}
.hud-move-btn small {
  position: static;
  opacity: 0.7;
  font-size: 0.55rem;
  font-weight: 600;
  pointer-events: none;
}
#hud-mid {
  position: relative;
  background:
    linear-gradient(180deg, rgba(20, 18, 12, 0.55), rgba(8, 10, 8, 0.65)),
    url("assets/ui/hud/in_bar.png?v=6") center / 100% 100% no-repeat;
  border: 1px solid rgba(180, 150, 80, 0.35);
  border-radius: 3px;
  padding: 0.42rem 0.55rem 0.32rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  min-width: 0;
  /* in_bar2 — filete Main sob o meta */
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.55),
    inset 0 -2px 0 0 transparent;
}
#hud-mid::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 2px;
  height: 4px;
  background: url("assets/ui/hud/in_bar2.png?v=6") center / 100% 100% no-repeat;
  image-rendering: pixelated;
  opacity: 0.85;
  pointer-events: none;
  z-index: 0;
}
/* t_main.ozt — ornamento superior do chrome mid (Main) */
.hud-t-main {
  position: absolute;
  left: 50%;
  top: -11px;
  transform: translateX(-50%);
  width: min(155px, 78%);
  height: auto;
  max-height: 22px;
  object-fit: contain;
  object-position: center top;
  image-rendering: pixelated;
  pointer-events: none;
  z-index: 2;
  opacity: 0.95;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.65));
}
#hud-mid > :not(.hud-t-main) {
  position: relative;
  z-index: 1;
}
.hud-mid-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-size: 0.78rem;
  text-shadow: 0 1px 3px #000;
  color: #e8f0ea;
}
#char-name { font-weight: 700; max-width: 7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#hud-level,
.hud-level-box {
  color: #e8c86a;
  font-weight: 700;
  padding: 0.08rem 0.42rem 0.1rem;
  min-width: 2.6rem;
  text-align: center;
  background: url("assets/ui/hud/Level_box.png?v=6") center / 100% 100% no-repeat;
  image-rendering: pixelated;
  border-radius: 1px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}
#zen-bar {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: rgba(12, 18, 16, 0.55);
  border: 1px solid rgba(196, 163, 90, 0.35);
  font-size: 0.68rem;
  color: var(--muted);
}
#zen-bar strong { color: var(--accent); }
#prog-bar { display: none !important; }
.hud-mid-meta {
  display: flex;
  gap: 0.55rem;
  font-size: 0.62rem;
  color: rgba(220,232,224,0.55);
  text-shadow: 0 1px 2px #000;
}
/* MU-style Life / Mana orbs — líquido enche o círculo (clip circular) */
.mu-orb {
  position: relative;
  width: 86px;
  height: 86px;
  justify-self: center;
  filter: drop-shadow(0 3px 10px rgba(0,0,0,.65));
}
.mu-orb::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 5;
  box-shadow:
    inset 0 0 0 1px rgba(220, 190, 110, 0.35),
    0 0 0 1px rgba(40, 28, 10, 0.55);
}
.mu-orb-ring {
  position: absolute;
  inset: 0;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  pointer-events: none;
  z-index: 3;
}
/* Grail_mu / Grail_illusion — cristal nativo Interface (badge no orbe) */
.mu-orb-gem {
  position: absolute;
  left: 50%;
  top: 7%;
  width: 38%;
  height: 34%;
  transform: translateX(-50%);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center top;
  pointer-events: none;
  z-index: 4;
  opacity: 0.92;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.75));
}
.mu-orb-glass {
  position: absolute;
  /* alinhado ao furo do SVG (~r34/48 do orbe) */
  inset: 12px;
  border-radius: 50%;
  overflow: hidden;
  clip-path: circle(50% at 50% 50%);
  background:
    radial-gradient(circle at 38% 28%, rgba(40, 28, 22, 0.95), #050304 72%);
  z-index: 1;
  box-shadow:
    inset 0 0 12px rgba(0, 0, 0, 0.9),
    inset 0 -6px 14px rgba(0, 0, 0, 0.45);
}
.mu-orb-mp .mu-orb-glass {
  background:
    radial-gradient(circle at 38% 28%, rgba(22, 32, 48, 0.95), #04060c 72%);
}
.mu-orb-glass > i {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0%;
  width: 100%;
  transform: none;
  transition: height 0.22s ease;
  will-change: height;
}
.mu-orb-glass > i::after {
  content: "";
  position: absolute;
  left: -8%;
  right: -8%;
  top: -5px;
  height: 10px;
  border-radius: 50%;
  background: inherit;
  filter: brightness(1.25);
  opacity: 0.85;
}
.mu-orb strong.mu-orb-digits {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  font-size: 0;
  letter-spacing: 0;
  top: 48%;
}
.mu-orb strong.mu-orb-digits img {
  height: 1.05rem;
  width: auto;
  image-rendering: pixelated;
  filter: drop-shadow(0 1px 1px #000);
}
.mu-orb strong {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  z-index: 4;
  font: 800 0.7rem/1 Tahoma, "IBM Plex Sans", sans-serif;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 2px #000, 0 0 5px #000, 0 0 1px #000;
  color: #fff8e0;
  pointer-events: none;
  white-space: nowrap;
}
.mu-orb-hp strong {
  color: #ffe0d0;
  font-size: 0.72rem;
}
.mu-orb-mp strong {
  color: #d8e8ff;
  font-size: 0.72rem;
}
.mu-orb .vit-label {
  position: absolute;
  left: 50%;
  bottom: -0.05rem;
  transform: translateX(-50%);
  z-index: 4;
  font: 800 0.62rem/1 Tahoma, sans-serif;
  letter-spacing: 0.05em;
  text-shadow: 0 1px 2px #000, 0 0 3px #000;
  pointer-events: none;
}
#hp-fill {
  background:
    linear-gradient(180deg, rgba(255, 200, 160, 0.55) 0%, transparent 28%),
    linear-gradient(to top, #4a0606 0%, #a81818 38%, #e83828 70%, #ff8a60 92%, #ffd0b0 100%);
  box-shadow: 0 0 14px rgba(220, 50, 35, 0.55);
}
#mp-fill {
  background:
    linear-gradient(180deg, rgba(200, 230, 255, 0.55) 0%, transparent 28%),
    linear-gradient(to top, #061228 0%, #1648a0 38%, #3a88ef 70%, #7ab8ff 92%, #d0e8ff 100%);
  box-shadow: 0 0 14px rgba(50, 120, 230, 0.55);
}
.mu-orb-hp .vit-label { color: #ff8a7a; }
.mu-orb-mp .vit-label { color: #7ab0ff; }
@media (max-width: 520px) {
  #hud-top {
    grid-template-columns: 72px 1fr 72px;
    align-items: start;
  }
  .mu-orb { width: 72px; height: 72px; }
  .mu-orb-glass { inset: 10px; }
  .mu-orb strong { font-size: 0.58rem; }
  .hud-move-btn {
    min-width: 3.8rem;
    padding: 0.18rem 0.32rem;
    font-size: 0.56rem;
    gap: 0.16rem;
  }
  .hud-move-ico { width: 16px; height: 16px; }
  .hud-t-main {
    top: -8px;
    max-height: 16px;
    width: min(120px, 72%);
  }
  #hud-mid {
    padding-top: 0.36rem;
  }
  #hud-level,
  .hud-level-box {
    min-width: 2.2rem;
    padding: 0.06rem 0.32rem 0.08rem;
    font-size: 0.68rem;
  }
}

#place-name {
  font-family: var(--font-display);
  color: var(--accent);
  letter-spacing: 0.06em;
}

.world-note {
  position: absolute;
  top: 2.6rem;
  left: 50%;
  transform: translateX(-50%);
  width: min(92vw, 420px);
  margin: 0;
  padding: 0.45rem 0.75rem;
  border-radius: 10px;
  background: rgba(12, 18, 16, 0.72);
  color: var(--muted);
  font-size: 0.75rem;
  text-align: center;
  line-height: 1.35;
  pointer-events: none;
}

#minimap, #mini-c { display: none !important; }

.hint {
  position: absolute;
  top: max(5.8rem, calc(env(safe-area-inset-top) + 5.2rem));
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(12, 18, 16, 0.65);
  font-size: 0.8rem;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 6;
  max-width: min(92vw, 22rem);
  text-align: center;
  pointer-events: none;
}

.hint.show { opacity: 1; }

/* Desktop: message_back.ozt — moldura Main p/ toasts de alvo/skill */
@media (min-width: 768px) {
  .hint {
    top: max(6.2rem, calc(env(safe-area-inset-top) + 5.6rem));
    padding: 0.55rem 1.35rem 0.6rem;
    border-radius: 0;
    border: none;
    background: url("assets/ui/hud/message_back.png?v=7") center / 100% 100% no-repeat;
    image-rendering: pixelated;
    font-size: 0.78rem;
    color: #f0e6c8;
    text-shadow: 0 1px 2px #000;
    min-width: min(22rem, 48vw);
    max-width: min(28rem, 56vw);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  }
}

/* Miniframe.OZT — status frame (desktop); mobile fica oculto */
.hud-miniframe {
  display: none;
}
@media (min-width: 768px) {
  #hud:not([hidden]) .hud-miniframe {
    display: block;
    position: absolute;
    /* pass9: baseline partilhada com chat (--hud-dock-b) */
    --hud-dock-b: max(4.75rem, calc(env(safe-area-inset-bottom) + 4.35rem));
    --hud-mf-w: 112px;
    left: max(0.5rem, env(safe-area-inset-left));
    bottom: var(--hud-dock-b);
    width: var(--hud-mf-w);
    height: 168px;
    z-index: 5;
    pointer-events: none;
    background: url("assets/ui/hud/Miniframe.png?v=9") center / 100% 100% no-repeat;
    image-rendering: pixelated;
    filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.55));
  }
  .hud-miniframe-panel {
    position: absolute;
    left: 9%;
    right: 9%;
    top: 40%;
    bottom: 7%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0.28rem;
    padding: 0.45rem 0.3rem 0.35rem;
    text-align: center;
    overflow: hidden;
  }
  .hud-miniframe-label {
    font: 700 0.55rem/1 var(--font-display, Cinzel, serif);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(220, 190, 110, 0.85);
    text-shadow: 0 1px 2px #000;
  }
  #hud-miniframe-text {
    font: 600 0.62rem/1.25 var(--font-body, "IBM Plex Sans", sans-serif);
    color: #e8f0ea;
    text-shadow: 0 1px 2px #000;
    word-break: break-word;
    max-height: 100%;
    overflow: hidden;
  }
  .hud-miniframe.live #hud-miniframe-text {
    color: #ffe6a0;
  }
  .hud-miniframe.live .hud-miniframe-label {
    color: #ffd878;
  }
}

.loot-pick-btn {
  position: fixed;
  /* abaixo dos game-panels (inv/char = 12) */
  z-index: 10;
  transform: translate(-50%, -130%);
  margin: 0;
  padding: 0.45rem 0.95rem;
  border: 1px solid rgba(201, 162, 39, 0.75);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(48, 36, 18, 0.94), rgba(22, 16, 10, 0.96));
  color: #ffe6a0;
  font: 600 0.78rem/1 "Cinzel", serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  pointer-events: auto !important;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}
.loot-pick-btn:hover,
.loot-pick-btn:focus-visible {
  border-color: #e6c23a;
  color: #fff6d0;
  outline: none;
}
.loot-pick-btn[hidden] {
  display: none !important;
}

.stick {
  position: absolute;
  left: max(1rem, env(safe-area-inset-left));
  bottom: max(11.2rem, calc(env(safe-area-inset-bottom) + 10.7rem));
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: rgba(21, 32, 28, 0.55);
  border: 1px solid rgba(232, 240, 234, 0.15);
  touch-action: none;
}

#stick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  background: rgba(196, 163, 90, 0.85);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.shop-row.is-selected {
  outline: 1px solid #ffe08a;
  background: rgba(80,55,18,0.55);
}
.shop-grid .inv-item.is-selected {
  border-color: #ffe08a;
  box-shadow: inset 0 0 0 1px rgba(255, 224, 138, 0.45);
  z-index: 4;
}

@media (max-width: 520px) {
  .game-panel.mu-shop {
    width: min(100vw - 0.4rem, 360px);
    max-height: min(72vh, 560px);
    bottom: max(5.8rem, calc(env(safe-area-inset-bottom) + 5.2rem));
    top: auto;
    transform: translateX(-50%);
  }
  .mu-shop header { padding: 0.3rem 0.5rem; }
  .mu-shop header h2 { font-size: 0.88rem; }
  .mu-shop-body { padding: 0.22rem 0.35rem 0.35rem; }
  .mu-shop-grid-wrap {
    min-height: 120px;
    max-height: min(42vh, 300px);
  }
  .shop-grid.inv-grid { max-width: none; }
}


/* moved:prog */
/* moved:hud-level */
/* moved:hud-exp */
/* XP — faixa fina no fundo do ecrã (abaixo do painel de ataque, sem o levantar) */
#xp-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  gap: 1px;
  padding: 0;
  padding-bottom: env(safe-area-inset-bottom, 0);
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.45) 40%, rgba(0, 0, 0, 0.72));
}
#xp-bar .xp-label,
#hud-exp.xp-label {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(7px + env(safe-area-inset-bottom, 0px));
  margin: 0;
  padding: 0.06rem 0.35rem;
  font: 600 0.56rem/1 Tahoma, "IBM Plex Sans", sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
  color: rgba(255, 236, 180, 0.95);
  text-shadow: 0 1px 2px #000, 0 0 4px #000;
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 2px;
  z-index: 1;
}
.xp-segs {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 1px;
  width: 100%;
  height: 5px;
  /* Progress.OZJ — faixa Main sob os segmentos */
  background:
    #1a1208 url("assets/ui/hud/Progress.png?v=6") center / 100% 100% no-repeat;
  border-top: 1px solid rgba(180, 140, 60, 0.45);
  box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.55);
}
.xp-seg {
  position: relative;
  display: block;
  margin: 0;
  background: rgba(28, 20, 12, 0.95);
  overflow: hidden;
}
.xp-seg::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: calc(var(--xp-fill, 0) * 100%);
  background:
    linear-gradient(180deg, rgba(255, 240, 180, 0.95), transparent 42%),
    linear-gradient(90deg, #a87820, #e8c45a 45%, #fff0a8 78%, #c99628);
  box-shadow: 0 0 4px rgba(232, 196, 90, 0.35);
  transition: width 0.18s ease;
}
.xp-seg.is-full::after {
  width: 100%;
}
.xp-seg.is-empty::after {
  width: 0%;
}
/* Personagem / pontos — Main.exe Interface (assets/ui/character/) */
.game-panel.mu-char {
  width: min(232px, calc(100vw - 1.1rem));
  max-height: min(82vh, 560px);
  background:
    #14110e url("assets/ui/character/Item_Back02.jpg?v=1") center top / 100% auto no-repeat;
  border: 1px solid rgba(160, 130, 70, 0.5);
  border-radius: 4px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
  image-rendering: pixelated;
  font-family: Tahoma, "IBM Plex Sans", sans-serif;
}
.mu-char-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.45rem;
  background:
    url("assets/ui/character/Message_box.jpg?v=1") center / 100% 100% no-repeat;
  border-bottom: 1px solid rgba(90, 70, 40, 0.65);
  flex: 0 0 auto;
}
.mu-char-head h2 {
  margin: 0;
  flex: 1 1 auto;
  font-family: Tahoma, "IBM Plex Sans", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: #f0e6c8;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 0 #000;
}
.mu-char-tab {
  image-rendering: pixelated;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
}
.mu-char .panel-close {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 2px;
  color: #d8c8a0;
  font-size: 1.1rem;
  background: rgba(0, 0, 0, 0.25);
}
.mu-char-body {
  padding: 0.45rem 0.5rem 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: linear-gradient(180deg, rgba(12, 10, 8, 0.55), rgba(8, 7, 6, 0.72));
}
.mu-char-name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff6d8;
  text-align: center;
  text-shadow: 0 1px 2px #000;
}
.mu-char-levelrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}
.mu-char-levelbox {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 75px;
  height: 21px;
  padding: 0 0.35rem;
  background: url("assets/ui/character/Level_box.jpg?v=1") center / 100% 100% no-repeat;
  color: #ffe56a;
  font-size: 0.72rem;
  font-weight: 700;
  image-rendering: pixelated;
}
.mu-char-class {
  flex: 1 1 auto;
  text-align: right;
  color: #ffe56a;
  font-size: 0.72rem;
  font-weight: 600;
}
.mu-char-meta,
.mu-char-exp {
  margin: 0;
  color: #b8b0a0;
  font-size: 0.7rem;
  text-align: center;
}
.mu-char-combat {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 0.4rem;
  margin: 0.1rem 0;
  padding: 0.28rem 0.35rem;
  background: url("assets/ui/character/Message_box1.jpg?v=1") center / 100% 100% no-repeat;
  color: #c8c0b0;
  font-size: 0.68rem;
  image-rendering: pixelated;
}
.mu-char-combat strong {
  color: #fff8e0;
  font-weight: 700;
}
.mu-char-points {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.15rem 0 0.1rem;
  padding: 0.22rem 0.4rem;
  background: url("assets/ui/character/win_button.png?v=1") center / 100% 100% no-repeat;
  color: #d0c8b8;
  font-size: 0.72rem;
  image-rendering: pixelated;
}
.mu-char-points span { flex: 0 0 auto; }
.mu-char-points strong {
  flex: 1 1 auto;
  color: #ffef7a;
  font-size: 0.9rem;
  font-weight: 800;
  text-align: right;
}
.mu-char-points.has-points strong {
  color: #ff5a3a;
  text-shadow: 0 0 6px rgba(255, 60, 40, 0.45);
}
.mu-char-bulk {
  flex: 0 0 auto;
  min-width: 40px;
  height: 20px;
  border: 0;
  padding: 0 0.35rem;
  background: url("assets/ui/character/text_button.jpg?v=1") center / 100% 100% no-repeat;
  color: #fff8d0;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  image-rendering: pixelated;
}
.mu-char-bulk:hover { filter: brightness(1.15); }
.mu-char-stats {
  list-style: none;
  margin: 0.15rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.22rem;
}
.mu-char-stat {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 0.3rem;
  min-height: 24px;
  padding: 0.12rem 0.2rem 0.12rem 0.35rem;
  background: url("assets/ui/character/b_command01.jpg?v=1") center / 100% 100% no-repeat;
  image-rendering: pixelated;
}
.mu-char-stat-label {
  color: #e8e0d0;
  font-size: 0.74rem;
  font-weight: 600;
  text-shadow: 0 1px 1px #000;
}
.mu-char-stat-val {
  min-width: 2.4rem;
  padding: 0.1rem 0.3rem;
  text-align: right;
  color: #fff56a;
  font-size: 0.8rem;
  font-weight: 800;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(180, 160, 100, 0.35);
}
.mu-char-plus {
  width: 24px;
  height: 24px;
  border: 0;
  padding: 0;
  background: url("assets/ui/character/level_01.jpg?v=1") center / contain no-repeat;
  cursor: pointer;
  image-rendering: pixelated;
  flex: 0 0 auto;
}
.mu-char-plus:hover:not(:disabled) {
  background-image: url("assets/ui/character/level_02.jpg?v=1");
  filter: brightness(1.12);
}
.mu-char-plus:disabled {
  opacity: 0.28;
  cursor: not-allowed;
  filter: grayscale(0.6);
}
@media (max-width: 640px) {
  .game-panel.mu-char {
    width: min(248px, calc(100vw - 0.9rem));
    max-height: min(78vh, 520px);
  }
}


/* Chat: mobile oculto (não tapa stick/HUD); desktop = chrome nis_* */
#chat-box {
  display: none !important;
  position: absolute;
  left: max(0.75rem, env(safe-area-inset-left));
  bottom: max(1rem, calc(env(safe-area-inset-bottom) + 0.75rem));
  width: min(22rem, 72vw);
  pointer-events: none;
  z-index: 5;
}
@media (min-width: 768px) {
  #hud:not([hidden]) #chat-box {
    display: flex !important;
    flex-direction: column;
    /* pass9: à direita do Miniframe, mesma baseline — gap fixo 0.7rem */
    --hud-dock-b: max(4.75rem, calc(env(safe-area-inset-bottom) + 4.35rem));
    --hud-mf-w: 112px;
    left: max(
      calc(0.5rem + var(--hud-mf-w) + 0.7rem),
      calc(env(safe-area-inset-left) + var(--hud-mf-w) + 0.7rem)
    );
    bottom: var(--hud-dock-b);
    width: min(18.5rem, 30vw);
    max-width: min(18.5rem, calc(50vw - 7rem));
    pointer-events: none;
    gap: 0;
    filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.45));
  }
  #chat-box .mu-chat-frame {
    display: none;
  }
  #chat-log {
    /* altura total chat ≈ Miniframe (168px) − form */
    max-height: 6.85rem;
    overflow: auto;
    background:
      linear-gradient(180deg, rgba(10, 14, 12, 0.72), rgba(8, 12, 10, 0.78)),
      url("assets/ui/hud/nis/nis_back.jpg?v=9") center / 100% 100% repeat;
    border: 1px solid rgba(180, 150, 90, 0.35);
    border-bottom: 0;
    border-image: url("assets/ui/hud/nis/nis_hframe.jpg?v=9") 2 fill;
    border-image-slice: 2 fill;
    border-image-width: 3px;
    border-radius: 0;
    padding: 0.35rem 0.5rem;
    font-size: 0.7rem;
    color: #e8f0ea;
    text-shadow: 0 1px 2px #000;
    pointer-events: auto;
  }
  #chat-form {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    pointer-events: auto;
    padding: 0.2rem 0.32rem 0.26rem;
    background:
      linear-gradient(180deg, rgba(12, 16, 14, 0.88), rgba(8, 12, 10, 0.92)),
      url("assets/ui/hud/nis/nis_bar.jpg?v=9") center / 100% 100% repeat-x;
    border: 1px solid rgba(180, 150, 90, 0.4);
    border-top: 1px solid rgba(196, 163, 90, 0.28);
    box-shadow: inset 0 1px 0 rgba(255, 220, 140, 0.08);
  }
  .mu-chat-ico {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    image-rendering: pixelated;
    opacity: 0.9;
  }
  #chat-input {
    flex: 1;
    min-width: 0;
    border: 1px solid rgba(196, 163, 90, 0.28);
    border-radius: 0;
    background:
      linear-gradient(180deg, rgba(6, 10, 8, 0.72), rgba(6, 10, 8, 0.82)),
      url("assets/ui/hud/nis/FontInput.png?v=9") center / 100% 100% no-repeat;
    color: #f0e6c8;
    padding: 0.28rem 0.45rem;
    font: 500 0.74rem var(--font-body, "IBM Plex Sans", sans-serif);
    outline: none;
    image-rendering: pixelated;
  }
  #chat-input:focus {
    border-color: rgba(255, 214, 120, 0.55);
    box-shadow: 0 0 0 1px rgba(255, 214, 120, 0.18);
  }
  #chat-input::placeholder {
    color: rgba(200, 190, 160, 0.45);
  }
}
#chat-log {
  max-height: 7.5rem;
  overflow: auto;
  background: rgba(8, 12, 10, 0.55);
  border: 1px solid rgba(232, 240, 234, 0.12);
  border-radius: 8px 8px 0 0;
  padding: 0.35rem 0.5rem;
  font-size: 0.72rem;
  color: #e8f0ea;
  text-shadow: 0 1px 2px #000;
}
.chat-line { margin: 0.1rem 0; }
.chat-line.sys { color: #b8c4bc; }
.chat-line.party { color: #9fd0ff; }
#chat-form { display: flex; }
#chat-input {
  flex: 1;
  border: 1px solid rgba(232, 240, 234, 0.18);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: rgba(8, 12, 10, 0.72);
  color: #e8f0ea;
  padding: 0.4rem 0.55rem;
  font: inherit;
  font-size: 0.78rem;
}
.mu-chat-ico { display: none; }
@media (min-width: 768px) {
  .mu-chat-ico { display: block; }
}

/* Party panel — quest frame chrome */
.game-panel.mu-party {
  border-color: rgba(196, 163, 90, 0.38);
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.45),
    inset 0 0 0 1px rgba(255, 214, 120, 0.06);
}
.mu-party-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid rgba(232, 240, 234, 0.08);
  background:
    linear-gradient(180deg, rgba(36, 28, 14, 0.55), rgba(16, 14, 10, 0.2)),
    url("assets/ui/hud/nis/nis_hframe.jpg?v=8") top / 100% 5px no-repeat;
}
.mu-party-head h2 {
  flex: 1;
  margin: 0;
  font: 700 0.95rem/1.1 var(--font-display, Cinzel, serif);
  color: #f0e6c8;
  letter-spacing: 0.04em;
}
.mu-party-tab {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  image-rendering: pixelated;
  filter: drop-shadow(0 1px 2px #000);
}
/* pass9: filete quest2 sob o cabeçalho Party */
.game-panel.mu-party .panel-body {
  background:
    url("assets/ui/hud/nis/quest2.jpg?v=9") top center / min(100%, 220px) 3px no-repeat;
}

.inv-warehouse {
  margin-top: 0.35rem;
  border-top: 1px solid rgba(232,240,234,0.12);
  padding-top: 0.35rem;
}
/* Desktop / tablet: proporções Main nativas (scale 1) */
@media (min-width: 768px) {
  .mu-inv-seg { display: none !important; }
  .mu-inv-pane { display: block !important; }
  .mu-inv-body { display: flex; flex-direction: column; }
  .game-panel.mu-inv {
    --mu-inv-scale: 1;
    --mu-inv-bag-size: calc(256px * var(--mu-inv-scale));
    --mu-inv-equip-scale: calc(var(--mu-inv-scale) * 256 / 190);
    --mu-inv-equip-w: calc(190px * var(--mu-inv-equip-scale));
    --mu-inv-equip-h: calc(256px * var(--mu-inv-equip-scale));
    width: min(300px, calc(100vw - 0.75rem));
  }
  .mu-inv-main {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 0.35rem;
  }
  .mu-inv-side {
    width: var(--mu-inv-bag-size);
    min-width: var(--mu-inv-bag-size);
  }
  .mu-inv-paper-wrap {
    width: var(--mu-inv-equip-w);
    height: var(--mu-inv-equip-h);
  }
  .mu-inv-paper {
    transform: scale(var(--mu-inv-equip-scale));
    transform-origin: top left;
  }
  .mu-inv-bag {
    width: var(--mu-inv-bag-size);
    height: var(--mu-inv-bag-size);
    min-height: var(--mu-inv-bag-size);
    flex: 0 0 var(--mu-inv-bag-size);
  }
  .mu-inv .inv-grid {
    --mu-inv-cell: calc(32px * var(--mu-inv-scale));
    width: var(--mu-inv-bag-size);
    height: var(--mu-inv-bag-size);
    min-width: var(--mu-inv-bag-size);
    min-height: var(--mu-inv-bag-size);
    grid-template-columns: repeat(8, var(--mu-inv-cell));
    grid-template-rows: repeat(8, var(--mu-inv-cell));
  }
}

.wh-grid {
  max-height: 9.5rem;
  overflow: auto;
  max-width: 320px;
}

/* moved:mp */
.hud-btn.skill-flash { border-color: rgba(120,180,255,.6); color: #cfe4ff; }

/* Lab: chaos / social / events */
#event-hud {
  position: absolute;
  left: 50%;
  top: max(3.2rem, env(safe-area-inset-top));
  transform: translateX(-50%);
  display: flex;
  gap: 0.65rem;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 10px;
  background: rgba(21, 32, 28, 0.9);
  border: 1px solid rgba(196, 163, 90, 0.35);
  font-size: 0.78rem;
  z-index: 5;
  max-width: min(92vw, 420px);
}
#event-hud[hidden] { display: none !important; }
#event-hud-name { color: var(--accent); font-family: var(--font-display); }
#toast-stack {
  position: absolute;
  right: max(0.75rem, env(safe-area-inset-right));
  top: max(4.5rem, calc(env(safe-area-inset-top) + 4rem));
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  z-index: 8;
  pointer-events: none;
  max-width: min(280px, 70vw);
}
.mu-toast {
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  background: rgba(12, 18, 16, 0.92);
  border: 1px solid rgba(196, 163, 90, 0.4);
  color: var(--ink);
  font-size: 0.78rem;
  animation: toast-in 0.25s ease both;
}
.mu-toast.ok { border-color: rgba(109, 191, 138, 0.5); }
.mu-toast.bad { border-color: rgba(184, 92, 74, 0.55); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}
.social-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.5rem 0;
}
#chaos-item-sel, #trade-zen, #trade-uids {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  background: #0a100e;
  border: 1px solid rgba(232, 240, 234, 0.12);
  color: var(--ink);
  border-radius: 8px;
  padding: 0.4rem 0.5rem;
  font: 0.84rem var(--font-body);
}
.trade-state {
  margin: 0.5rem 0 0;
  padding: 0.5rem;
  border-radius: 8px;
  background: #0a100e;
  border: 1px solid rgba(232, 240, 234, 0.1);
  font: 0.7rem/1.35 ui-monospace, monospace;
  color: var(--muted);
  white-space: pre-wrap;
  max-height: 140px;
  overflow: auto;
}
.social-player-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(232, 240, 234, 0.08);
  font-size: 0.84rem;
}
.social-player-row .row-btns { display: flex; gap: 0.3rem; }
.inv-cell.filled.exc-item, .mu-equip.has.exc-item {
  box-shadow: inset 0 0 0 1px rgba(80, 200, 120, 0.55);
}

/* —— Character select (Main.exe S2.5) —— */
.mu-charselect {
  display: block;
  padding: 0;
  place-items: unset;
  overflow: hidden;
  background: #000;
  z-index: 5;
  image-rendering: pixelated;
}

.mu-cs-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.12) 0%, rgba(0, 0, 0, 0.35) 45%, rgba(0, 0, 0, 0.72) 100%),
    url("assets/ui/charselect/login_back01.jpg") center / cover no-repeat,
    #1a0604;
  z-index: 0;
  pointer-events: none;
}
/* estrelas MU só no topo (asset original character_back) */
.mu-cs-bg::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: min(28vh, 220px);
  background: url("assets/ui/charselect/character_back01.jpg") top center / 100% auto no-repeat;
  opacity: 0.85;
  mix-blend-mode: screen;
  pointer-events: none;
}

.mu-cs-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.mu-cs-deco {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  opacity: 0.95;
  height: min(42vh, 280px);
  width: auto;
  bottom: 18%;
  mix-blend-mode: screen;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.55));
}
.mu-cs-deco-l { left: 0; }
.mu-cs-deco-r { right: 0; transform: scaleX(-1); }

.mu-cs-header {
  position: absolute;
  top: max(0.35rem, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  width: min(420px, 72vw);
  height: auto;
  z-index: 3;
  pointer-events: none;
  opacity: 0.95;
  mix-blend-mode: screen;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.55));
}

.mu-cs-info {
  position: absolute;
  top: max(4.2rem, calc(env(safe-area-inset-top) + 3.6rem));
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  min-width: min(280px, 78vw);
  padding: 0.55rem 1rem 0.65rem;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(20, 18, 14, 0.72), rgba(8, 8, 10, 0.85)),
    url("assets/ui/charselect/character_ex.png") center / 100% 100% no-repeat;
  border: 1px solid rgba(180, 170, 140, 0.35);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.8), 0 8px 24px rgba(0, 0, 0, 0.55);
  color: #f0e6c8;
  text-shadow: 0 1px 2px #000, 0 0 6px rgba(120, 180, 220, 0.35);
}
.mu-cs-info[hidden] { display: none !important; }
.mu-cs-info strong {
  display: block;
  font-family: Tahoma, "MS Sans Serif", sans-serif;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  color: #fff8dc;
}
.mu-cs-info span {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.82rem;
  color: #b8d4ef;
}

.mu-cs-slots {
  position: absolute;
  left: 50%;
  bottom: max(9.2rem, calc(env(safe-area-inset-bottom) + 8.6rem));
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  gap: 0.45rem;
  justify-content: center;
  align-items: flex-end;
  width: min(920px, 96vw);
  padding: 0 0.5rem;
}

.mu-cs-slot {
  flex: 1 1 0;
  max-width: 150px;
  min-height: 72px;
  padding: 0.55rem 0.4rem 0.45rem;
  border: 0;
  background:
    linear-gradient(180deg, rgba(30, 28, 24, 0.55), rgba(8, 8, 10, 0.8)),
    url("assets/ui/charselect/character_ex.png") center / 100% 100% no-repeat;
  color: #d8d0b8;
  font: 600 0.78rem/1.25 Tahoma, "MS Sans Serif", sans-serif;
  text-align: center;
  text-shadow: 0 1px 2px #000;
  cursor: url("assets/ui/cursors/CursorGet.png") 0 0, pointer;
  box-shadow: inset 0 0 0 1px rgba(160, 150, 120, 0.25);
  transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
}
.mu-cs-slot:hover,
.mu-cs-slot:focus-visible {
  outline: none;
  transform: translateY(-2px);
  box-shadow: inset 0 0 0 1px rgba(220, 200, 120, 0.55), 0 0 12px rgba(180, 160, 80, 0.25);
}
.mu-cs-slot.selected {
  transform: translateY(-4px) scale(1.03);
  box-shadow: inset 0 0 0 2px rgba(240, 210, 110, 0.85), 0 0 16px rgba(200, 170, 70, 0.35);
  color: #fff8dc;
}
.mu-cs-slot.empty {
  opacity: 0.55;
  color: #8a8470;
  background:
    linear-gradient(180deg, rgba(20, 18, 16, 0.4), rgba(0, 0, 0, 0.65)),
    url("assets/ui/charselect/New_Character201.png") center 40% / 92% auto no-repeat;
  min-height: 88px;
}
.mu-cs-slot .cls {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.68rem;
  font-weight: 500;
  color: #9eb8d4;
}
.mu-cs-slot.selected .cls { color: #c8e0ff; }
.mu-cs-slot .lv {
  display: block;
  font-size: 0.7rem;
  color: #c4a35a;
}

.mu-cs-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(0.45rem, env(safe-area-inset-bottom));
  z-index: 5;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(0.6rem, 2.5vw, 1.6rem);
  padding: 0 0.75rem;
  pointer-events: none;
}
.mu-cs-bar > * { pointer-events: auto; }

.mu-cs-sprite {
  border: 0;
  padding: 0;
  background-color: transparent;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  cursor: url("assets/ui/cursors/CursorGet.png") 0 0, pointer;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.65));
}
.mu-cs-create,
.mu-cs-delete {
  width: 96px;
  height: 54px;
  background-size: 96px 216px;
  margin-bottom: 1.1rem;
  opacity: 0.92;
}
.mu-cs-create {
  background-image: url("assets/ui/charselect/b_create.png");
  background-position: 0 0;
}
.mu-cs-create:hover { background-position: 0 -54px; }
.mu-cs-create:active { background-position: 0 -108px; }
.mu-cs-create:disabled { background-position: 0 -162px; opacity: 0.85; cursor: default; }

.mu-cs-delete {
  background-image: url("assets/ui/charselect/b_delete.png");
  background-position: 0 0;
}
.mu-cs-delete:hover { background-position: 0 -54px; }
.mu-cs-delete:active { background-position: 0 -108px; }
.mu-cs-delete:disabled { background-position: 0 -162px; opacity: 0.85; cursor: default; }

/* OK = mesmo sprite Connect do login (54×30 ×4), bem maior */
.mu-cs-ok {
  width: 200px;
  height: 88px;
  border: 0;
  padding: 0;
  background: url("assets/ui/login/b_connect.png?v=2") 0 0 / 200px 352px no-repeat;
  image-rendering: pixelated;
  cursor: url("assets/ui/cursors/CursorGet.png") 0 0, pointer;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.8));
  position: relative;
  flex: 0 0 auto;
  transition: filter 0.12s ease, transform 0.12s ease;
}
.mu-cs-ok:hover {
  background-position: 0 -88px;
  filter: drop-shadow(0 5px 14px rgba(0, 0, 0, 0.85)) brightness(1.1);
  transform: translateY(-2px);
}
.mu-cs-ok:active {
  background-position: 0 -176px;
  transform: translateY(1px);
}
.mu-cs-ok:disabled {
  background-position: 0 -264px;
  opacity: 0.9;
  cursor: default;
  filter: none;
  transform: none;
}
.mu-cs-ok-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  pointer-events: none;
}

@media (max-width: 520px) {
  .mu-cs-ok {
    width: 160px;
    height: 70px;
    background-size: 160px 280px;
  }
  .mu-cs-ok:hover { background-position: 0 -70px; }
  .mu-cs-ok:active { background-position: 0 -140px; }
  .mu-cs-ok:disabled { background-position: 0 -210px; }
  .mu-cs-create,
  .mu-cs-delete {
    width: 72px;
    height: 40px;
    background-size: 72px 160px;
    margin-bottom: 0.75rem;
  }
  .mu-cs-create:hover { background-position: 0 -40px; }
  .mu-cs-create:active { background-position: 0 -80px; }
  .mu-cs-create:disabled { background-position: 0 -120px; }
  .mu-cs-delete:hover { background-position: 0 -40px; }
  .mu-cs-delete:active { background-position: 0 -80px; }
  .mu-cs-delete:disabled { background-position: 0 -120px; }
}

.mu-cs-status {
  position: absolute;
  left: 50%;
  bottom: max(5.4rem, calc(env(safe-area-inset-bottom) + 5rem));
  transform: translateX(-50%);
  z-index: 6;
  margin: 0;
  padding: 0.25rem 0.7rem;
  font: 600 0.78rem Tahoma, sans-serif;
  color: #c9a227;
  text-shadow: 0 1px 3px #000;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(180, 160, 100, 0.25);
}
.mu-cs-status[hidden] { display: none !important; }

.mu-cs-logout {
  position: absolute;
  top: max(0.55rem, env(safe-area-inset-top));
  right: max(0.65rem, env(safe-area-inset-right));
  z-index: 6;
  border: 0;
  background: rgba(0, 0, 0, 0.45);
  color: #9a9080;
  font: 500 0.72rem Tahoma, sans-serif;
  padding: 0.35rem 0.55rem;
  cursor: pointer;
  text-decoration: underline;
}
.mu-cs-logout:hover { color: #e8dcc0; }

/* Create character panel */
.mu-create,
.mu-delete {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.62);
  padding: 1rem;
}
.mu-create[hidden],
.mu-delete[hidden] { display: none !important; }

.mu-create-frame {
  width: min(320px, 94vw);
  max-height: min(92vh, 560px);
  padding: 1.1rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.55rem;
  background:
    linear-gradient(180deg, rgba(28, 26, 22, 0.94), rgba(10, 9, 8, 0.96)),
    url("assets/ui/charselect/New_Character01.png") center / cover no-repeat;
  border: 2px solid #6a5a40;
  box-shadow: 0 0 0 1px #1a1510, 0 16px 40px rgba(0, 0, 0, 0.75);
  image-rendering: pixelated;
  animation: mu-cs-rise 0.35s ease both;
  overflow: auto;
}

.mu-create-title {
  margin: 0;
  text-align: center;
  color: #f0e6c0;
  font: 700 0.95rem Tahoma, sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow: 1px 1px 0 #000;
}

@keyframes mu-cs-rise {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.mu-create-viewport {
  width: 100%;
  height: 150px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  position: relative;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid #3a3428;
}
.mu-create-viewport canvas {
  width: 100%;
  height: 100%;
  max-height: 150px;
  object-fit: contain;
}
.mu-create-class {
  font: 700 0.7rem Tahoma, sans-serif;
  color: #f0e6c8;
  text-shadow: 0 1px 2px #000;
}

.mu-create-name {
  width: 100%;
  display: grid;
  gap: 0.25rem;
  font: 600 0.75rem Tahoma, sans-serif;
  color: #e8dcc0;
}
.mu-create-name span { text-align: left; }
.mu-create-name input {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border: 1px solid #5a5040;
  border-radius: 2px;
  background: #0a0a0c;
  color: #f0e6c8;
  font: 600 0.95rem Tahoma, sans-serif;
  text-align: left;
}
.mu-create-name input:focus {
  outline: 1px solid #c9a227;
  border-color: #c9a227;
}

.mu-create-classes {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.mu-create-classes legend {
  padding: 0 0 0.3rem;
  color: #e8dcc0;
  font: 600 0.75rem Tahoma, sans-serif;
}
.mu-create-class-list {
  display: grid;
  gap: 0.35rem;
}
.mu-create-class-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 1px solid #4a4030;
  background: linear-gradient(180deg, rgba(55, 48, 36, 0.95), rgba(22, 20, 16, 0.95));
  color: #d8ceb0;
  text-align: left;
  cursor: url("assets/ui/cursors/CursorGet.png") 0 0, pointer;
}
.mu-create-class-btn strong {
  font: 700 0.82rem Tahoma, sans-serif;
  color: #f0e6c8;
}
.mu-create-class-btn span {
  font: 500 0.68rem Tahoma, sans-serif;
  color: #9a9078;
}
.mu-create-class-btn:hover {
  border-color: #8a7850;
  filter: brightness(1.08);
}
.mu-create-class-btn.selected {
  border-color: #c9a227;
  box-shadow: inset 0 0 0 1px rgba(201, 162, 39, 0.35);
  background: linear-gradient(180deg, rgba(80, 64, 32, 0.98), rgba(30, 24, 12, 0.98));
}
.mu-create-class-btn.selected strong { color: #ffe08a; }


.mu-create-nav {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.15rem;
}
.mu-create-arrow {
  width: 28px;
  height: 22px;
  border: 1px solid #5a5040;
  background: linear-gradient(180deg, #6a5a40, #3a3224);
  color: #f0e6c8;
  font-size: 0.75rem;
  cursor: pointer;
  line-height: 1;
}
.mu-create-arrow:hover { filter: brightness(1.15); }

.mu-create-actions,
.mu-delete-actions {
  display: flex;
  gap: 0.55rem;
  margin-top: 0.25rem;
  justify-content: center;
}

.mu-create-btn {
  width: 58px;
  height: 23px;
  border: 0;
  padding: 0;
  background-size: 58px 23px;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  cursor: pointer;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}
.mu-create-btn.ok {
  background-image: url("assets/ui/charselect/New_Character_Ok.jpg");
}
.mu-create-btn.cancel {
  background-image: url("assets/ui/charselect/New_Character_Cancel.jpg");
}
.mu-create-btn:hover { filter: brightness(1.1) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6)); }
.mu-create-btn:active { transform: translateY(1px); }

.mu-delete-box {
  width: min(320px, 92vw);
  padding: 1.1rem 1rem 1rem;
  background:
    linear-gradient(180deg, rgba(40, 36, 30, 0.92), rgba(12, 10, 8, 0.95)),
    url("assets/ui/charselect/back1.jpg") center / cover;
  border: 2px solid #5a5040;
  box-shadow: 0 0 0 1px #1a1510, 0 16px 40px rgba(0, 0, 0, 0.7);
  text-align: center;
  animation: mu-cs-rise 0.3s ease both;
}
.mu-delete-title {
  margin: 0 0 0.5rem;
  font: 700 0.95rem Tahoma, sans-serif;
  color: #f0e6c8;
  text-shadow: 0 1px 2px #000;
}
.mu-delete-msg {
  margin: 0 0 0.85rem;
  font: 500 0.82rem Tahoma, sans-serif;
  color: #c8b8a0;
}
.mu-delete-ok {
  width: 179px;
  height: 61px;
  border: 0;
  padding: 0;
  background: url("assets/ui/charselect/Delete01.png") center / contain no-repeat;
  image-rendering: pixelated;
  cursor: pointer;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.65));
}
.mu-delete-ok:hover { filter: brightness(1.08) drop-shadow(0 3px 6px rgba(0, 0, 0, 0.65)); }

@media (max-width: 640px) {
  .mu-cs-deco { display: none; }
  .mu-cs-create,
  .mu-cs-delete {
    width: 81px;
    height: 45px;
    background-size: 81px 180px;
  }
  .mu-cs-create:hover { background-position: 0 -45px; }
  .mu-cs-create:active { background-position: 0 -90px; }
  .mu-cs-create:disabled { background-position: 0 -135px; }
  .mu-cs-delete:hover { background-position: 0 -45px; }
  .mu-cs-delete:active { background-position: 0 -90px; }
  .mu-cs-delete:disabled { background-position: 0 -135px; }
  .mu-cs-ok {
    width: 168px;
    height: 74px;
    background-size: 168px 296px;
  }
  .mu-cs-ok:hover { background-position: 0 -74px; }
  .mu-cs-ok:active { background-position: 0 -148px; }
  .mu-cs-ok:disabled { background-position: 0 -222px; }
  .mu-cs-slots { bottom: max(5.8rem, calc(env(safe-area-inset-bottom) + 5.2rem)); gap: 0.3rem; }
  .mu-cs-slot { min-height: 64px; font-size: 0.7rem; padding: 0.4rem 0.25rem; }
}

/* Hotbar de skills — fila superior: [1][2][3] [K] [4][5][6] (7 slots) */
#hud:not([hidden]) #skill-bar { pointer-events: none; }
#hud:not([hidden]) #skill-bar .skill-slot { pointer-events: auto; }
#skill-bar {
  position: relative;
  right: auto;
  left: auto;
  top: auto;
  transform: none;
  bottom: auto;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: stretch;
  gap: var(--hud-slot-gap, 0.26rem);
  z-index: 1;
  width: 100%;
  max-width: 100%;
  max-height: none;
  min-height: calc(var(--hud-slot-h, 3.5rem) + 2 * var(--hud-bar-pad-y, 0.32rem));
  overflow: visible;
  padding: var(--hud-bar-pad-y, 0.32rem) var(--hud-bar-pad-x, 0.4rem);
  pointer-events: none;
  /* Menu01 = slots Q/W… (Main.exe skill chrome) */
  background: url("assets/ui/hud/Menu01.png?v=6") center / 100% 100% no-repeat;
  image-rendering: pixelated;
  border: none;
  border-image: none;
  border-radius: 0;
  box-shadow: none;
}
/* Grupos 3+3 entram no flex da barra — K fica no meio como 7º slot */
.skill-bar-group {
  display: contents;
}
.skill-slot {
  width: 2.6rem;
  height: 2.6rem;
  min-width: 2.6rem;
  padding: 0.1rem;
  border-radius: 7px;
  border: 1px solid rgba(232, 240, 234, 0.28);
  background: rgba(18, 28, 24, 0.94);
  color: #dce8e0;
  font: 600 0.5rem/1.05 var(--font-body);
  cursor: pointer;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.05rem;
  text-shadow: 0 1px 2px #000;
  touch-action: manipulation;
}
.skill-slot small {
  color: rgba(220,232,224,.55);
  font-size: 0.5rem;
  font-weight: 500;
  line-height: 1;
}
.skill-slot .skill-ico {
  width: 20px;
  height: 28px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  pointer-events: none;
  flex-shrink: 0;
  display: block;
}
/* Hotbar skills + K central: mesma altura/flex da barra de comandos */
#skill-bar .skill-slot {
  position: relative;
  overflow: hidden;
  flex: 1 1 0;
  width: auto;
  height: var(--hud-slot-h, 3.5rem);
  min-width: 0;
  min-height: var(--hud-slot-h, 3.5rem);
  justify-content: flex-end;
  padding: 0.14rem 0.1rem 0.12rem;
  flex-shrink: 1;
  border-radius: 3px;
  border: 1px solid rgba(180, 150, 80, 0.45);
  background:
    linear-gradient(180deg, rgba(30, 26, 18, 0.55), rgba(12, 14, 12, 0.7)),
    url("assets/ui/skills/Menu04.png?v=1") center / 100% 100% no-repeat;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.45);
}
#skill-bar #btn-skill-cfg {
  justify-content: flex-end;
  align-items: center;
}
#skill-bar #btn-skill-cfg .skill-name {
  font-size: 0.5rem;
  letter-spacing: 0;
}
#skill-bar #btn-skill-cfg .hud-action-ico,
#skill-bar .skill-slot .skill-ico {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  width: 80%;
  height: 80%;
  max-width: 80%;
  max-height: 80%;
  margin: 0;
  object-fit: contain;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  -ms-interpolation-mode: nearest-neighbor;
  opacity: 1;
  z-index: 0;
  pointer-events: none;
  border-radius: 4px;
}
#skill-bar .skill-slot .skill-name {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  max-width: 100%;
  font-size: 0.46rem;
  font-weight: 700;
  line-height: 1.05;
  text-align: center;
  color: #f2f7f4;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
  text-shadow:
    0 0 2px #000,
    0 1px 2px #000,
    1px 0 0 #000,
    -1px 0 0 #000,
    0 -1px 0 #000,
    0 1px 0 #000;
}
#skill-bar .skill-slot small {
  position: absolute;
  top: 1px;
  right: 2px;
  z-index: 1;
  pointer-events: none;
}
.skill-slot .skill-ico-empty {
  opacity: 0.45;
}
#hud-actions .skill-slot .skill-ico,
#hud-actions .hud-action-slot .skill-ico {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  width: 80%;
  height: 80%;
  max-width: 80%;
  max-height: 80%;
  margin: 0;
  object-fit: contain;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  -ms-interpolation-mode: nearest-neighbor;
  opacity: 1;
  z-index: 0;
  pointer-events: none;
  border-radius: 4px;
}
.skill-slot.active {
  border-color: rgba(120,180,255,.7);
  background: rgba(30, 48, 72, 0.95);
  color: #cfe4ff;
}
#skill-bar .skill-slot.empty {
  opacity: 0.7;
  border-style: dashed;
}
/* Reafirma Q/W/E desktop — o bloco base #skill-bar (position:relative) vem depois do @media anterior */
@media (min-width: 768px) {
  #skill-bar {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    min-height: 0;
    padding: 0;
    background: none;
    pointer-events: none;
  }
  #skill-bar .skill-slot {
    position: absolute;
    pointer-events: auto;
    flex: none;
    width: var(--qwe-slot-w, 2.8125%);
    height: var(--qwe-slot-h, 29.1667%);
    min-width: 0;
    min-height: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  #skill-bar .skill-slot.empty {
    opacity: 1;
    border-style: none;
  }
  #skill-bar .skill-slot[data-slot="0"] { left: var(--qwe-q-l, 33.75%); top: var(--qwe-slot-t, 31.25%); }
  #skill-bar .skill-slot[data-slot="1"] { left: var(--qwe-w-l, 38.59375%); top: var(--qwe-slot-t, 31.25%); }
  #skill-bar .skill-slot[data-slot="2"] { left: var(--qwe-e-l, 43.4375%); top: var(--qwe-slot-t, 31.25%); }
  #skill-bar .skill-slot[data-slot="3"] { left: 14.5%; top: 24%; width: 4.1%; height: 52%; }
  #skill-bar .skill-slot[data-slot="4"] { left: 19.2%; top: 24%; width: 4.1%; height: 52%; }
  #skill-bar .skill-slot[data-slot="5"] { left: 23.9%; top: 24%; width: 4.1%; height: 52%; }
  #skill-bar #btn-skill-cfg {
    left: 28.2%;
    top: 24%;
    width: 3.6%;
    height: 52%;
    border: none;
    background: rgba(36, 26, 10, 0.35);
    box-shadow: inset 0 0 0 1px rgba(255, 210, 90, 0.35);
  }
  #skill-bar .skill-slot[data-slot="0"] .skill-name,
  #skill-bar .skill-slot[data-slot="1"] .skill-name,
  #skill-bar .skill-slot[data-slot="2"] .skill-name,
  #skill-bar .skill-slot[data-slot="0"] small,
  #skill-bar .skill-slot[data-slot="1"] small,
  #skill-bar .skill-slot[data-slot="2"] small {
    display: none;
  }
  #skill-bar .skill-slot[data-slot="0"] .skill-ico,
  #skill-bar .skill-slot[data-slot="1"] .skill-ico,
  #skill-bar .skill-slot[data-slot="2"] .skill-ico {
    top: 50%;
    max-height: 92%;
    height: 92%;
    max-width: 92%;
    width: 92%;
  }
}
.skill-slot:hover, .skill-slot:focus-visible {
  border-color: var(--accent);
  outline: none;
}
.hud-btn.skill-ready {
  border-color: rgba(120,180,255,.45);
}

#dmg-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  overflow: hidden;
}
.dmg-float {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  font-family: "Cinzel", "Times New Roman", serif;
  font-weight: 800;
  font-size: clamp(1.05rem, 2.4vw, 1.55rem);
  color: #ffe14a;
  letter-spacing: 0.02em;
  text-shadow:
    0 0 2px #000,
    1px 0 0 #000,
    -1px 0 0 #000,
    0 1px 0 #000,
    0 -1px 0 #000,
    0 2px 4px rgba(0,0,0,.75);
  animation: dmg-rise 0.9s ease-out forwards;
  white-space: nowrap;
}
.dmg-float.miss {
  color: #d0d0d0;
  font-size: clamp(0.95rem, 2vw, 1.25rem);
}
.dmg-float.player {
  color: #ff5a5a;
}
.dmg-float.skill {
  color: #8fd0ff;
}
.dmg-float.crit {
  color: #ffb347;
  font-size: clamp(1.25rem, 2.8vw, 1.85rem);
}
@keyframes dmg-rise {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -140%) scale(0.85); }
}


/* Painel de config de skills (textures ClienteFacil) */
.mu-skill-panel {
  width: min(420px, calc(100vw - 1.2rem));
  max-height: min(82vh, 620px);
}
.mu-skill-panel-head {
  position: relative;
  overflow: hidden;
}
.mu-skill-panel-deco {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(200px, 70%);
  height: auto;
  opacity: 0.55;
  pointer-events: none;
  image-rendering: pixelated;
}
.mu-skill-panel-head h2 {
  position: relative;
  z-index: 1;
}
.mu-skill-panel-body {
  gap: 0.55rem;
}
.mu-skill-layout {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.mu-skill-grid-wrap {
  border: 1px solid rgba(180, 170, 140, 0.35);
  border-radius: 6px;
  padding: 0.4rem;
  background-color: rgba(8, 10, 12, 0.92);
  background-size: cover;
  background-position: center;
  min-height: 9.5rem;
  max-height: min(38vh, 240px);
  overflow: auto;
}
.mu-skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(3.1rem, 1fr));
  gap: 0.3rem;
}
.mu-skill-pick {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  min-height: 3.1rem;
  padding: 0.15rem;
  border-radius: 5px;
  border: 1px solid rgba(200, 190, 150, 0.35);
  background: rgba(10, 14, 12, 0.82);
  color: #e8efe8;
  cursor: grab;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.05rem;
  touch-action: none;
}
.mu-skill-pick:active { cursor: grabbing; }
.mu-skill-pick.selected,
.mu-skill-pick.on-bar {
  border-color: rgba(120, 180, 255, 0.75);
  box-shadow: inset 0 0 0 1px rgba(120, 180, 255, 0.25);
}
.mu-skill-pick .skill-ico {
  position: absolute;
  inset: 3px;
  width: auto;
  height: auto;
  max-width: calc(100% - 6px);
  max-height: calc(100% - 6px);
  margin: auto;
  object-fit: contain;
  image-rendering: pixelated;
  opacity: 0.95;
  pointer-events: none;
}
.mu-skill-pick .skill-name {
  position: relative;
  z-index: 1;
  font-size: 0.42rem;
  font-weight: 700;
  line-height: 1.05;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 0 2px #000, 0 1px 2px #000;
}
.mu-skill-detail {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 4.2rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid rgba(180, 170, 140, 0.35);
  border-radius: 6px;
  background-color: rgba(12, 14, 12, 0.9);
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
.mu-skill-detail-ico {
  width: 2.6rem;
  height: 2.6rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(200, 190, 150, 0.3);
  background: rgba(0, 0, 0, 0.45);
}
.mu-skill-detail-ico .skill-ico {
  width: 20px;
  height: 28px;
  object-fit: contain;
  image-rendering: pixelated;
}
.mu-skill-detail-text {
  min-width: 0;
  flex: 1;
}
.mu-skill-detail-text strong {
  display: block;
  font-size: 0.92rem;
  color: #f2e6c0;
  margin-bottom: 0.15rem;
}
.mu-skill-hotbar-cfg {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.4rem;
  border: 1px solid rgba(180, 170, 140, 0.3);
  border-radius: 6px;
  background: rgba(10, 14, 12, 0.85);
}
.mu-skill-hotbar-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: rgba(232, 230, 200, 0.75);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.mu-skill-cfg-slots {
  display: flex;
  flex: 1;
  gap: 0.22rem;
  justify-content: space-between;
}
.mu-skill-cfg-slot {
  position: relative;
  flex: 1;
  min-width: 0;
  aspect-ratio: 1;
  max-width: 3.2rem;
  border-radius: 5px;
  border: 1px solid rgba(200, 190, 150, 0.4);
  background: rgba(0, 0, 0, 0.5);
  color: #e8efe8;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 0.1rem;
  touch-action: none;
}
.mu-skill-cfg-slot.drop-target {
  border-color: rgba(120, 220, 140, 0.85);
  background: rgba(28, 56, 36, 0.75);
}
.mu-skill-cfg-slot.empty {
  opacity: 0.72;
}
.mu-skill-cfg-slot .skill-ico {
  position: absolute;
  inset: 3px;
  width: auto;
  height: auto;
  max-width: calc(100% - 6px);
  max-height: calc(100% - 6px);
  margin: auto;
  object-fit: contain;
  image-rendering: pixelated;
  pointer-events: none;
}
.mu-skill-cfg-slot small {
  position: relative;
  z-index: 1;
  font-size: 0.55rem;
  color: rgba(220, 232, 224, 0.7);
}
.mu-skill-panel-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.mu-skill-ok {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  line-height: 0;
}
.mu-skill-ok img {
  display: block;
  image-rendering: pixelated;
}
.mu-skill-ok:hover img,
.mu-skill-ok:focus-visible img {
  filter: brightness(1.15);
  outline: none;
}
.mu-skill-drag-ghost {
  position: fixed;
  z-index: 80;
  pointer-events: none;
  width: 2.6rem;
  height: 2.6rem;
  opacity: 0.9;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.55));
}
.mu-skill-drag-ghost img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

/* Drag-to-equip highlight */
.mu-equip.drop-equip {
  outline: 2px solid rgba(232, 208, 144, 0.95);
  outline-offset: 2px;
  filter: brightness(1.15);
}
.inv-equip-btn:not([hidden]) {
  animation: inv-equip-pulse 1.4s ease-in-out infinite;
}
@keyframes inv-equip-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 208, 144, 0.35); }
  50% { box-shadow: 0 0 0 4px rgba(232, 208, 144, 0.12); }
}
