/* ==========================================================================
   MU Online 0.97k - Stylesheet (Modern Strict Theme)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,600;1,700&display=swap');

/* === Base Layout & Resets === */
body {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #08090d;
  color: #f1f5f9;
}

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  background: #000;
  overflow: hidden;
  cursor: default;
}

#status, #log {
  display: none;
}

pre {
  white-space: pre-wrap;
}

/* === Game Canvas === */
canvas#canvas {
  background: #000;
  position: fixed;
  left: 0;
  top: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  width: 100dvw !important;
  height: 100dvh !important;
  z-index: 2;
  outline: none;
  border: 0;
  cursor: default;
  touch-action: none !important;
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
}

#muStick, #muSkillCluster, #muTopLeftBar {
  will-change: transform;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

/* Completely remove / hide top control bar */
header.mu-topbar {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  pointer-events: none !important;
}

canvas#canvas:focus,
canvas#canvas:focus-visible {
  outline: none !important;
}

/* ==========================================================================
   40px Top Control Bar & Game Header
   ========================================================================== */

header.mu-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: rgba(10, 12, 18, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  z-index: 99;
  user-select: none;
  -webkit-user-select: none;
  box-sizing: border-box;
}

.mu-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mu-brand-box {
  display: flex;
  align-items: center;
  gap: 7px;
}

.mu-brand-title {
  font-family: 'Montserrat', 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 1.1px;
  background: linear-gradient(135deg, #ffffff 20%, #e2e8f0 60%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 10px rgba(255, 255, 255, 0.1);
}

.mu-brand-sep {
  color: rgba(255, 255, 255, 0.2);
  font-weight: 400;
  font-size: 12px;
}

.mu-brand-desc {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: 0.8px;
  color: #717d96;
}

/* Server Realm Mode Badge */
.mu-realm-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
  cursor: default;
}

.mu-realm-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  position: relative;
}

.realm-easy {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #4ade80;
}
.realm-easy .mu-realm-dot {
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
}

.realm-medium {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}
.realm-medium .mu-realm-dot {
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
}

.realm-hard {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
}
.realm-hard .mu-realm-dot {
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
}

.realm-fun-easy {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.45);
  color: #c084fc;
}
.realm-fun-easy .mu-realm-dot {
  background: #a855f7;
  box-shadow: 0 0 8px #a855f7;
}

.realm-fun-medium {
  background: rgba(236, 72, 153, 0.15);
  border: 1px solid rgba(236, 72, 153, 0.45);
  color: #f472b6;
}
.realm-fun-medium .mu-realm-dot {
  background: #ec4899;
  box-shadow: 0 0 8px #ec4899;
}

.realm-fun-hard {
  background: rgba(244, 63, 94, 0.18);
  border: 1px solid rgba(244, 63, 94, 0.5);
  color: #fb7185;
}
.realm-fun-hard .mu-realm-dot {
  background: #f43f5e;
  box-shadow: 0 0 8px #f43f5e;
}

/* Right Controls */
.mu-topbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mu-top-sep {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.14);
  margin: 0 3px;
}

.mu-top-btn {
  height: 28px;
  padding: 0 8px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  font-family: 'Montserrat', sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  outline: none;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
  text-decoration: none;
}

.mu-top-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
  transform: translateY(-1px);
}

.mu-top-btn:active {
  transform: translateY(0);
}

.mu-btn-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Auto Attack Toggle Button */
.mu-btn-auto {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.08);
  color: #fbbf24;
}

.mu-btn-auto:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.5);
  color: #fef08a;
}

.mu-btn-auto.active {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.85), rgba(220, 38, 38, 0.95));
  border-color: #f87171;
  color: #ffffff;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.55);
  animation: mu-pulse-glow 1.6s infinite ease-in-out;
}

@keyframes mu-pulse-glow {
  0%, 100% {
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.45);
    border-color: #f87171;
  }
  50% {
    box-shadow: 0 0 22px rgba(239, 68, 68, 0.85);
    border-color: #fca5a5;
  }
}

/* Real Server External Link Button */
.mu-btn-real-server {
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.32);
  color: #38bdf8;
  text-decoration: none;
}

.mu-btn-real-server:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.65);
  color: #f0f9ff;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
  transform: translateY(-1px);
}

.mu-btn-real-server:active {
  transform: translateY(0);
}

.mu-btn-icon-ext {
  width: 11px;
  height: 11px;
  opacity: 0.65;
  flex-shrink: 0;
  margin-left: 1px;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.mu-btn-real-server:hover .mu-btn-icon-ext {
  opacity: 1;
  transform: translate(1px, -1px);
}

/* Support Donatello Button */
.mu-btn-support {
  background: rgba(244, 63, 94, 0.1);
  border-color: rgba(244, 63, 94, 0.35);
  color: #fb7185;
  text-decoration: none;
}

.mu-btn-support:hover {
  background: rgba(244, 63, 94, 0.22);
  border-color: rgba(244, 63, 94, 0.7);
  color: #fff1f2;
  box-shadow: 0 0 14px rgba(244, 63, 94, 0.4);
  transform: translateY(-1px);
}

.mu-btn-support:active {
  transform: translateY(0);
}

.mu-btn-support .mu-icon-heart {
  color: #f43f5e;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mu-btn-support:hover .mu-icon-heart {
  color: #fb7185;
  transform: scale(1.2);
}

.mu-btn-support:hover .mu-btn-icon-ext {
  opacity: 1;
  transform: translate(1px, -1px);
}

/* Floating Toast Notification */
.mu-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7);
  border-radius: 8px;
  padding: 10px 20px;
  color: #f8fafc;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 600;
  pointer-events: none;
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10000;
  white-space: nowrap;
}

.mu-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Responsive adjustments for top bar */
@media (max-width: 1080px) {
  .mu-brand-desc,
  .mu-brand-sep {
    display: none;
  }
  .mu-topbar-left {
    gap: 8px;
  }
}

@media (max-width: 720px) {
  .mu-brand-desc {
    display: none;
  }
  .mu-brand-sep {
    display: none;
  }
  .mu-btn-text {
    display: none;
  }
  .mu-btn-icon-ext {
    display: none;
  }
  .mu-top-btn {
    padding: 0 8px;
  }
}

@media (max-width: 480px) {
  .mu-realm-badge,
  .mu-topbar-left .mu-top-sep {
    display: none;
  }
}

/* === Mobile / Touch Virtual Controls === */
/* === Mobile / Touch Virtual Controls === */
#muKeys, #muStick, #muSkillCluster {
  display: none;
}

/* Action Bar (Vertical Column: AUTO, AUTORESET, PARTY, SHOWITEM - Default Top-Right, Draggable & Collapsible) */
#muTopLeftBar {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  left: auto;
  z-index: 9999 !important;
  display: flex;
  flex-direction: column; /* Vertical column alignment */
  align-items: stretch;
  gap: 5px;
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
  transition: opacity 0.25s ease;
}

#muTopLeftBar.mu-hidden,
#muSkillCluster.mu-hidden,
#muStick.mu-hidden {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Header with Drag Handle & Collapse Button */
.mu-bar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 6px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  cursor: grab;
  touch-action: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  box-sizing: border-box;
}

.mu-bar-header:active {
  cursor: grabbing;
}

.mu-bar-drag-pill {
  font-family: 'Montserrat', 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 4px;
  pointer-events: none;
}

.mu-bar-collapse-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #cbd5e1;
  border-radius: 3px;
  width: 17px;
  height: 17px;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
  transition: all 0.15s ease;
}

.mu-bar-collapse-btn:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
  color: #fff;
}

.mu-bar-buttons-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* When collapsed: hide buttons list, show compact pill */
#muTopLeftBar.collapsed .mu-bar-buttons-list {
  display: none !important;
}

#muTopLeftBar.collapsed .mu-bar-header {
  background: rgba(15, 23, 42, 0.95);
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
}

#muTopLeftBar.collapsed .mu-bar-drag-pill {
  color: #38bdf8;
}

.mu-img-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 115px;
  height: 23px;
  padding: 0;
  margin: 0;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(15, 23, 42, 0.85);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  cursor: pointer;
  touch-action: manipulation;
  overflow: visible;
  transition: transform 0.1s ease, border-color 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.mu-img-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 3px;
  display: block;
  pointer-events: none;
}

/* Touch hit-box padding for screen accuracy */
.mu-img-btn::before {
  content: '';
  position: absolute;
  inset: -6px -10px;
  border-radius: 8px;
}

.mu-img-btn:hover {
  filter: brightness(1.18);
  border-color: rgba(56, 189, 248, 0.6);
}

.mu-img-btn:active {
  transform: scale(0.93);
  filter: brightness(0.88);
}

/* Toggle ON / Active State */
.mu-img-btn.on {
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.75), 0 3px 8px rgba(0, 0, 0, 0.6);
  filter: brightness(1.22);
}

.mu-img-btn .mu-active-indicator {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e, 0 0 10px #22c55e;
  display: none;
  pointer-events: none;
  animation: muDotPulse 1.2s infinite ease-in-out;
}

.mu-img-btn.on .mu-active-indicator {
  display: block;
}

/* === Mobile & Touch Responsive Adjustments === */
@media (pointer: coarse), (max-width: 900px), (max-height: 500px) {
  /* #muKeyBtn enabled for mobile keyboard access */
  /* #muStick and #muSkillCluster are managed dynamically by muUpdateInGameState */

  /* Compact Action Bar on Mobile: positioned at Top-Right, completely clear of Move/Teleport menu and Joypad */
  #muTopLeftBar {
    top: max(10px, env(safe-area-inset-top));
    right: max(10px, env(safe-area-inset-right));
    left: auto;
    bottom: auto;
    transform: none;
    gap: 3px;
    z-index: 99999 !important;
  }

  .mu-bar-header {
    padding: 3px 6px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(56, 189, 248, 0.45);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.65);
  }

  .mu-bar-drag-pill {
    font-size: 10px;
    color: #e2e8f0;
    font-weight: 700;
  }

  .mu-bar-collapse-btn {
    width: 17px;
    height: 17px;
    font-size: 12px;
  }

  .mu-bar-buttons-list {
    gap: 3px;
  }

  #muTopLeftBar .mu-img-btn {
    width: 96px;
    height: 25px;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.35);
  }

  /* Extended touch hit-box so tapping on mobile remains easy and responsive */
  #muTopLeftBar .mu-img-btn::before {
    inset: -8px -12px;
    border-radius: 8px;
  }

  #muTopLeftBar .mu-img-btn .mu-active-indicator {
    width: 6px;
    height: 6px;
    top: -2px;
    right: -2px;
  }
}

@keyframes muDotPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.65; }
}



#muKeys {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 7;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  background: rgba(10, 12, 18, 0.94);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

#muKeys.on {
  display: block;
}

#muKeys .row {
  display: flex;
  gap: 3px;
  margin: 3px 0;
}

#muKeys button {
  flex: 1;
  min-height: 40px;
  border-radius: 6px;
  border: 0;
  background: #2a2d37;
  color: #f1f5f9;
  font: 15px/1 sans-serif;
  touch-action: none;
  padding: 0;
}

#muKeys button.wide { flex: 1.6; }
#muKeys button.space { flex: 4; }
#muKeys button.lit { background: #4f566b; color: #fff; }

#muStick {
  position: fixed;
  left: max(14px, env(safe-area-inset-left));
  top: auto;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 6;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  background: rgba(18, 20, 28, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.2);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#muStickKnob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 54px;
  height: 54px;
  margin: -27px 0 0 -27px;
  border-radius: 50%;
  background: rgba(220, 225, 235, 0.85);
  pointer-events: none;
}

/* ==========================================================================
   Mobile Skill & Combat Cluster (Right Thumb Controls: 1 Center + 3 Satellite Skills)
   ========================================================================== */

#muSkillCluster {
  display: none;
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  width: 180px;
  height: 180px;
  z-index: 10000;
  pointer-events: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

@media (pointer: coarse), (max-width: 900px), (max-height: 500px) {
  /* #muKeyBtn enabled */
}

/* Base styling for all 4 skill buttons */
.mu-skill-btn,
.mu-main-attack-btn {
  display: flex;
  position: absolute;
  border-radius: 50%;
  pointer-events: auto;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 0;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.08s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  overflow: visible;
}

/* Center Main Button (Nút Chính ở giữa: Slot 0) */
#muRBtn.mu-main-attack-btn,
#muRBtn {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: absolute !important;
  right: 6px !important;
  bottom: 6px !important;
  width: 82px !important;
  height: 82px !important;
  border-radius: 50% !important;
  background: radial-gradient(circle at 35% 35%, #2a2e3d, #14161f 70%, #0a0c12 100%);
  border: 2.5px solid rgba(234, 179, 8, 0.75);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.85), inset 0 2px 4px rgba(255, 255, 255, 0.2), 0 0 14px rgba(234, 179, 8, 0.3);
  z-index: 10 !important;
  pointer-events: auto !important;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 0;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.08s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  overflow: visible;
}

#muRBtn.mu-main-attack-btn:active,
#muRBtn.mu-main-attack-btn.on,
#muRBtn.on {
  transform: scale(0.92);
  border-color: #f59e0b;
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.8), inset 0 0 10px rgba(255, 255, 255, 0.35);
}

/* 3 Satellite Skill Buttons (Slot 1, 2, 3) */
.mu-skill-btn {
  width: 52px;
  height: 52px;
  background: radial-gradient(circle at 35% 35%, #222634, #12141c 75%);
  border: 2px solid rgba(148, 163, 184, 0.6);
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.75), inset 0 1px 3px rgba(255, 255, 255, 0.18);
  z-index: 9;
}

.mu-skill-btn:active,
.mu-skill-btn.active {
  transform: scale(0.91);
  border-color: #38bdf8;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.85), inset 0 1px 3px rgba(255, 255, 255, 0.3);
}

/* Satellite Positions surrounding the center button */
.mu-skill-btn-1 {
  right: 98px;
  bottom: 18px;
}
.mu-skill-btn-2 {
  right: 76px;
  bottom: 76px;
}
.mu-skill-btn-3 {
  right: 18px;
  bottom: 98px;
}

/* Button Content Container */
.mu-skill-content {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0d1017;
  pointer-events: none;
}

#muRBtn .mu-skill-content {
  inset: 5px;
}

/* Skill Image */
.mu-skill-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  display: block;
}

/* Empty Button Plus Sign */
.mu-skill-empty-plus {
  display: none;
  font-family: 'Montserrat', sans-serif;
  font-size: 26px;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

.mu-main-empty {
  font-size: 38px;
  color: rgba(234, 179, 8, 0.7);
}

/* Empty State Classes */
.mu-skill-btn.is-empty,
.mu-main-attack-btn.is-empty {
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.35);
  background: radial-gradient(circle at 50% 50%, rgba(30, 41, 59, 0.85), rgba(15, 23, 42, 0.95));
}

.mu-skill-btn.is-empty .mu-skill-img,
.mu-main-attack-btn.is-empty .mu-skill-img {
  display: none;
}

.mu-skill-btn.is-empty .mu-skill-empty-plus,
.mu-main-attack-btn.is-empty .mu-skill-empty-plus {
  display: block;
}

.mu-skill-btn.is-empty .mu-skill-badge,
.mu-main-attack-btn.is-empty .mu-skill-badge {
  display: none;
}

/* Hotkey Badge - Hidden as requested by user */
.mu-skill-badge {
  display: none !important;
  position: absolute;
  top: -4px;
  left: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: #f59e0b;
  color: #111;
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.4);
  pointer-events: none;
  z-index: 12;
}

.mu-main-badge {
  background: #ef4444;
  color: #fff;
  top: -3px;
  left: -3px;
  min-width: 20px;
  height: 20px;
}

/* ==========================================================================
   3-Second Long-Press Circular Progress Ring (SVG)
   ========================================================================== */

.mu-hold-ring {
  position: absolute;
  inset: -3px;
  width: calc(100% + 6px);
  height: calc(100% + 6px);
  pointer-events: none;
  transform: rotate(-90deg); /* Start progress from top (12 o'clock) */
  z-index: 11;
  overflow: visible;
}

.mu-hold-ring-bg {
  fill: none;
  stroke: transparent;
  stroke-width: 3.5;
}

.mu-hold-ring-bar {
  fill: none;
  stroke: #38bdf8;
  stroke-width: 3.5;
  stroke-linecap: round;
  /* 2 * PI * 23 = ~144.5 */
  stroke-dasharray: 144.5;
  stroke-dashoffset: 144.5;
  transition: stroke-dashoffset 0s linear;
}

.mu-hold-ring-main .mu-hold-ring-bar {
  stroke: #f59e0b;
  stroke-width: 4;
  /* 2 * PI * 37 = ~232.5 */
  stroke-dasharray: 232.5;
  stroke-dashoffset: 232.5;
}

/* When button is being held down, animate progress ring smoothly over 3s */
.mu-skill-btn.charging .mu-hold-ring-bar,
.mu-main-attack-btn.charging .mu-hold-ring-bar {
  stroke-dashoffset: 0 !important;
  transition: stroke-dashoffset 3s linear !important;
  filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.9));
}

/* ==========================================================================
   Mobile Skill Assignment Modal Sheet
   ========================================================================== */

.mu-skill-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Montserrat', sans-serif;
  padding: 10px;
  box-sizing: border-box;
}

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

.mu-skill-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.mu-skill-modal-dialog {
  position: relative;
  z-index: 2;
  width: 95vw;
  max-width: 680px;
  max-height: 92vh;
  background: linear-gradient(145deg, #181b26, #0e1118);
  border: 1.5px solid rgba(234, 179, 8, 0.45);
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.85), 0 0 25px rgba(234, 179, 8, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: muModalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes muModalFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.mu-skill-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(10, 12, 18, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mu-skill-modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #fbbf24;
}

.mu-skill-modal-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.12s, background 0.12s;
}

.mu-skill-modal-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.mu-skill-modal-body {
  padding: 12px 14px;
  overflow-y: auto;
  max-height: 72vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mu-skill-modal-desc {
  margin: 0;
  font-size: 11.5px;
  color: #94a3b8;
  line-height: 1.4;
}

/* 4 Slots Selector Cards Grid */
.mu-skill-slots-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.mu-slot-select-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 4px;
  background: rgba(30, 34, 48, 0.6);
  border: 1.5px solid rgba(148, 163, 184, 0.25);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  color: #f1f5f9;
}

.mu-slot-select-card.active {
  background: rgba(234, 179, 8, 0.16);
  border-color: #f59e0b;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.4);
}

.mu-slot-num {
  font-size: 9.5px;
  font-weight: 700;
  color: #94a3b8;
  white-space: nowrap;
}

.mu-slot-select-card.active .mu-slot-num {
  color: #fbbf24;
}

.mu-slot-cur-img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: cover;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: #0b0d13;
}

.mu-slot-cur-name {
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Skill Picker Container */
.mu-skill-picker-area {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(10, 12, 18, 0.55);
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.mu-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: #cbd5e1;
}

.mu-picker-header strong {
  color: #fbbf24;
}

.mu-btn-clear-slot {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  padding: 3px 8px;
  border-radius: 6px;
  font-family: 'Montserrat', sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.12s;
}

.mu-btn-clear-slot:hover,
.mu-btn-clear-slot:active {
  background: rgba(239, 68, 68, 0.35);
  color: #fff;
}

/* Filter Tabs */
.mu-skill-filter-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.mu-tab-btn {
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #94a3b8;
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.12s ease;
}

.mu-tab-btn.active {
  background: #f59e0b;
  color: #0f172a;
  border-color: #f59e0b;
  font-weight: 800;
}

/* Skill Grid in Modal */
.mu-preset-keys-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 4px;
}

.mu-key-option-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  min-height: 44px;
  background: #191c28;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #cbd5e1;
  font-family: 'Montserrat', sans-serif;
  font-size: 10.5px;
  cursor: pointer;
  transition: all 0.12s ease;
  text-align: left;
}

.mu-key-option-btn:hover,
.mu-key-option-btn:active {
  background: #23283a;
  border-color: #38bdf8;
  color: #fff;
  transform: translateY(-1px);
}

.mu-key-option-btn.selected {
  background: rgba(245, 158, 11, 0.2);
  border-color: #f59e0b;
  color: #fbbf24;
  font-weight: 700;
}

.mu-key-opt-img {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  object-fit: cover;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #000;
}

.mu-key-opt-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
}

.mu-key-opt-name {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  font-weight: 700;
  line-height: 1.25;
  font-size: 11px;
}

.mu-key-opt-meta {
  font-size: 9px;
  color: #64748b;
  margin-top: 1px;
}

/* Modal Footer */
.mu-skill-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(10, 12, 18, 0.8);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.mu-btn-reset-skills {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(30, 41, 59, 0.5);
  color: #94a3b8;
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.mu-btn-reset-skills:hover {
  background: rgba(30, 41, 59, 0.8);
  color: #fff;
}

.mu-btn-done-skills {
  padding: 6px 20px;
  border-radius: 6px;
  border: none;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0f172a;
  font-family: 'Montserrat', sans-serif;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
  transition: transform 0.08s, filter 0.12s;
}

.mu-btn-done-skills:hover {
  filter: brightness(1.1);
}

.mu-btn-done-skills:active {
  transform: scale(0.96);
}

/* ==========================================================================
   Mobile Map Teleport Modal (Touch Optimized)
   ========================================================================== */

.mu-move-modal-dialog {
  max-width: 580px;
  max-height: 88vh;
}

.mu-move-modal-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mu-move-filter-tabs {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 3px;
  scrollbar-width: none;
}

.mu-move-filter-tabs::-webkit-scrollbar {
  display: none;
}

.mu-move-tab-btn {
  padding: 5px 10px;
  border-radius: 6px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #94a3b8;
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.12s ease;
}

.mu-move-tab-btn.active {
  background: #38bdf8;
  color: #0f172a;
  border-color: #38bdf8;
  font-weight: 800;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.mu-move-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 8px;
  max-height: 56vh;
  overflow-y: auto;
  padding: 2px 4px 6px 2px;
}

.mu-move-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px 10px;
  min-height: 54px;
  background: linear-gradient(135deg, rgba(30, 36, 52, 0.85), rgba(16, 20, 30, 0.95));
  border: 1.5px solid rgba(148, 163, 184, 0.25);
  border-radius: 10px;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.08s ease, border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
  box-sizing: border-box;
}

.mu-move-card:hover,
.mu-move-card:active {
  transform: scale(0.96);
  border-color: #f59e0b;
  background: linear-gradient(135deg, rgba(45, 52, 75, 0.95), rgba(24, 30, 45, 0.98));
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.4);
}

.mu-move-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.mu-move-card-name {
  font-size: 13px;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mu-move-card:hover .mu-move-card-name,
.mu-move-card:active .mu-move-card-name {
  color: #fbbf24;
}

.mu-move-card-arrow {
  color: #38bdf8;
  font-size: 13px;
  font-weight: 800;
  opacity: 0.7;
}

.mu-move-card-desc {
  font-size: 9.5px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 1px 0 3px 0;
}

.mu-move-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  font-size: 10px;
}

.mu-move-badge-level {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
  font-weight: 700;
  font-size: 9.5px;
}

.mu-move-badge-zen {
  color: #fbbf24;
  font-weight: 700;
  font-size: 9.5px;
  display: flex;
  align-items: center;
  gap: 2px;
}

.mu-move-footer-hint {
  font-size: 11px;
  color: #94a3b8;
}

@media (max-height: 520px) {
  .mu-move-modal-dialog {
    max-height: 94vh;
    max-width: 580px;
  }
  .mu-move-modal-body {
    padding: 8px 10px;
    gap: 6px;
  }
  .mu-move-cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
    gap: 6px;
    max-height: 58vh;
  }
  .mu-move-card {
    padding: 6px 8px;
    min-height: 46px;
  }
  .mu-move-card-name {
    font-size: 12px;
  }
  .mu-move-card-desc {
    display: none;
  }
  .mu-move-card-bottom {
    margin-top: 3px;
  }
}


/* ==========================================================================
   Modern Strict Preloader (Clean Dark Theme - Zero Gaudy Yellow)
   ========================================================================== */

.mu-preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #08090d;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.mu-preloader.fade-out {
  opacity: 0;
  pointer-events: none;
}

/* Subtle Deep Dark Vignette with Screen Background */
/* Cinematic Background Video under Preloader Loading Screen */
.mu-preloader-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  z-index: 0;
  opacity: 0.65;
  filter: brightness(0.8) contrast(1.1);
}

.mu-preloader-video-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(circle at 50% 50%, rgba(8, 10, 16, 0.45) 0%, rgba(5, 6, 9, 0.88) 80%, #030406 100%);
}

.mu-preloader-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 50%, rgba(8, 10, 16, 0.55) 0%, rgba(5, 6, 9, 0.92) 80%, #030406 100%),
    url('preloader_screen_bg.jpg') center/cover no-repeat;
}

/* High-Density Atmospheric Particle Canvas */
.mu-particle-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* Strict Modern Glass Card with Custom Generated Dark Plate Texture */
.mu-preloader-card {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(90vw, 440px);
  padding: 38px 30px 30px;
  background:
    linear-gradient(170deg, rgba(14, 17, 26, 0.88) 0%, rgba(8, 10, 16, 0.95) 100%),
    url('preloader_panel_bg.jpg') center/cover no-repeat;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.95),
    0 0 1px 1px rgba(255, 255, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  text-align: center;
  overflow: hidden;
}

.mu-preloader-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  pointer-events: none;
}


/* Clean Modern Typography */
.mu-title-section {
  width: 100%;
  margin-bottom: 22px;
}

.mu-preloader-title {
  margin: 0;
  font-family: 'Montserrat', sans-serif;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 0.16em;
  line-height: 1.1;
  text-transform: uppercase;
  background: linear-gradient(180deg, #ffffff 0%, #e2e8f0 60%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.8));
}

@media (max-width: 480px) {
  .mu-preloader-title {
    font-size: 26px;
    letter-spacing: 0.12em;
  }
}

.mu-preloader-sub {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 10px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-family: 'Montserrat', 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #94a3b8;
}

/* Sleek HUD-Style Progress Bar */
.mu-progress-box {
  width: 100%;
  margin-bottom: 18px;
}

.mu-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Montserrat', sans-serif;
  margin-bottom: 8px;
  padding: 0 1px;
}

.mu-status-label-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  max-width: 72%;
}

.mu-status-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.8);
  flex-shrink: 0;
  animation: muDotBlink 1.8s infinite ease-in-out;
}

@keyframes muDotBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.85); }
}

#muStatusMsg {
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

#muStatusDetail {
  color: #f1f5f9;
  font-family: 'Montserrat', monospace;
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  margin-left: 8px;
}

.mu-bar-track {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  padding: 1.5px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.8);
}

.mu-bar-fill {
  height: 100%;
  width: 2%;
  border-radius: 2px;
  background: linear-gradient(90deg, #991b1b 0%, #dc2626 50%, #f87171 100%);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
  position: relative;
  transition: width 0.22s ease-out;
}

.mu-bar-plasma {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.4) 50%, transparent 100%);
  animation: muShimmer 1.8s infinite linear;
}

@keyframes muShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Minimalist Clean Tips Box */
.mu-tips-box {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  text-align: left;
}

.mu-tip-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #94a3b8;
  flex-shrink: 0;
}

.mu-tip-msg {
  flex: 1;
  font-family: 'Montserrat', sans-serif;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.45;
  color: #94a3b8;
  transition: opacity 0.3s ease;
}

/* ==========================================================================
   Game Guide & Info Modal Popup Dialog
   ========================================================================== */

.mu-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: text;
  -webkit-user-select: text;
}

.mu-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.mu-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 4, 8, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.mu-modal-dialog {
  position: relative;
  z-index: 2;
  width: 92%;
  max-width: 840px;
  max-height: 86vh;
  background: #0b0d13;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 25px 65px rgba(0, 0, 0, 0.85), 0 0 1px 1px rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95) translateY(8px);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.mu-modal.open .mu-modal-dialog {
  transform: scale(1) translateY(0);
}

/* Modal Header */
.mu-modal-header {
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
}

.mu-modal-title-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mu-modal-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(14, 165, 233, 0.08));
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #38bdf8;
  flex-shrink: 0;
}

.mu-modal-icon-badge svg {
  width: 20px;
  height: 20px;
  display: block;
}

.mu-modal-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #f8fafc;
  margin: 0;
  line-height: 1.25;
}

.mu-modal-subtitle {
  font-family: 'Montserrat', sans-serif;
  font-size: 11.5px;
  color: #94a3b8;
  margin: 2px 0 0;
}

.mu-modal-close {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
}

.mu-modal-close:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.mu-modal-close svg {
  width: 16px;
  height: 16px;
}

/* Modal Tabs */
.mu-modal-tabs {
  display: flex;
  gap: 6px;
  padding: 8px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(14, 17, 24, 0.7);
  overflow-x: auto;
  scrollbar-width: thin;
}

.mu-tab-btn {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: #94a3b8;
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.mu-tab-btn:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.05);
}

.mu-tab-btn.active {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
}

/* Modal Body */
.mu-modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  flex: 1;
  min-height: 260px;
  max-height: 54vh;
}

.mu-tab-pane {
  display: none;
  animation: muModalFadeIn 0.2s ease;
}

.mu-tab-pane.active {
  display: block;
}

@keyframes muModalFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.mu-section-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 14.5px;
  font-weight: 700;
  color: #f1f5f9;
  margin: 0 0 6px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mu-section-sub {
  font-size: 12px;
  color: #94a3b8;
  margin: 0 0 14px 0;
  line-height: 1.45;
}

/* Grid & Cards */
.mu-guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
}

.mu-guide-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px 14px;
}

.mu-guide-card-head {
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #cbd5e1;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* Hotkey list */
.mu-hotkey-list, .mu-tips-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mu-hotkey-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: #cbd5e1;
}

.mu-key-combo {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

kbd {
  display: inline-block;
  padding: 2px 6px;
  font-family: 'Montserrat', monospace;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  color: #f8fafc;
  background: #171a24;
  border: 1px solid #2d3345;
  border-radius: 4px;
  box-shadow: 0 2px 0 #0c0e14;
}

/* Table styling */
.mu-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.mu-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.mu-table th {
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mu-table td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
}

.mu-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.mu-table code {
  font-family: monospace;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #7dd3fc;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11.5px;
}

/* Realms Cards */
.mu-realms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.mu-realm-card {
  border-radius: 8px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
}

.mu-realm-card.realm-easy {
  border-color: rgba(34, 197, 94, 0.35);
  background: radial-gradient(circle at top right, rgba(34, 197, 94, 0.08) 0%, rgba(10, 12, 18, 0.6) 80%);
}

.mu-realm-card.realm-medium {
  border-color: rgba(245, 158, 11, 0.35);
  background: radial-gradient(circle at top right, rgba(245, 158, 11, 0.08) 0%, rgba(10, 12, 18, 0.6) 80%);
}

.mu-realm-card.realm-hard {
  border-color: rgba(239, 68, 68, 0.35);
  background: radial-gradient(circle at top right, rgba(239, 68, 68, 0.08) 0%, rgba(10, 12, 18, 0.6) 80%);
}

.mu-realm-card.realm-fun-easy {
  border-color: rgba(168, 85, 247, 0.45);
  background: radial-gradient(circle at top right, rgba(168, 85, 247, 0.12) 0%, rgba(10, 12, 18, 0.6) 80%);
}

.mu-realm-card.realm-fun-medium {
  border-color: rgba(236, 72, 153, 0.45);
  background: radial-gradient(circle at top right, rgba(236, 72, 153, 0.12) 0%, rgba(10, 12, 18, 0.6) 80%);
}

.mu-realm-card.realm-fun-hard {
  border-color: rgba(244, 63, 94, 0.45);
  background: radial-gradient(circle at top right, rgba(244, 63, 94, 0.12) 0%, rgba(10, 12, 18, 0.6) 80%);
}

.mu-realm-card-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.mu-realm-rate {
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
  margin-bottom: 12px;
}

.mu-card-perks {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11.5px;
  color: #cbd5e1;
}

.mu-card-perks strong {
  color: #f1f5f9;
}

/* Saves Info Box */
.mu-saves-info-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mu-info-item {
  display: flex;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.5;
}

.mu-info-item strong {
  color: #f8fafc;
  display: block;
  margin-bottom: 3px;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
}

.mu-info-item p {
  margin: 0;
}

.mu-info-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}

/* Tips list */
.mu-tips-list li {
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.5;
}

/* Modal Footer */
.mu-modal-footer {
  padding: 12px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(14, 17, 24, 0.7);
  gap: 12px;
}

.mu-modal-foot-tip {
  font-size: 11.5px;
  color: #94a3b8;
}

/* Modal Footer Left Box */
.mu-modal-foot-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.mu-modal-foot-sep {
  color: rgba(255, 255, 255, 0.2);
  font-size: 11px;
}

.mu-modal-author-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: #38bdf8;
  text-decoration: none;
  transition: all 0.15s ease;
}

.mu-modal-author-link:hover {
  color: #7dd3fc;
  text-decoration: underline;
}

/* About Tab & Author Card Styles */
.mu-about-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mu-author-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.45) 0%, rgba(15, 23, 42, 0.7) 100%);
  border: 1px solid rgba(56, 189, 248, 0.25);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.mu-author-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}

.mu-author-avatar-wrap {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
  flex-shrink: 0;
  background: #0f172a;
}

.mu-author-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mu-author-avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
}

.mu-author-details {
  flex: 1;
}

.mu-author-name {
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #f8fafc;
  margin: 0;
  line-height: 1.25;
}

.mu-author-handle {
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  color: #38bdf8;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 6px;
}

.mu-author-bio {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.45;
  margin: 0;
}

.mu-about-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.mu-about-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 6px;
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: all 0.15s ease;
}

.mu-about-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.mu-about-btn.mu-btn-primary {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

.mu-about-btn.mu-btn-primary:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: rgba(56, 189, 248, 0.6);
  color: #7dd3fc;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

.mu-about-btn.mu-btn-donatello {
  background: rgba(244, 63, 94, 0.15);
  border-color: rgba(244, 63, 94, 0.4);
  color: #fb7185;
}

.mu-about-btn.mu-btn-donatello:hover {
  background: rgba(244, 63, 94, 0.25);
  border-color: rgba(244, 63, 94, 0.6);
  color: #fff1f2;
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.3);
}



/* ==========================================================================
   Mobile Orientation Guide Overlay (Landscape enforcement)
   ========================================================================== */
.mu-rotate-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 15000;
  background: rgba(8, 9, 13, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  color: #fff;
  user-select: none;
  -webkit-user-select: none;
}

/* Only display when on mobile / small screen AND orientation is PORTRAIT */
@media screen and (orientation: portrait) and (max-width: 900px) {
  .mu-rotate-overlay {
    display: flex;
  }
}

.mu-rotate-card {
  max-width: 340px;
  padding: 30px 24px;
  background: linear-gradient(170deg, rgba(20, 24, 36, 0.95) 0%, rgba(10, 13, 20, 0.98) 100%);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9), 0 0 25px rgba(245, 158, 11, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.mu-rotate-icon-anim {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 50%;
  animation: muRotatePhone 2.2s infinite ease-in-out;
}

@keyframes muRotatePhone {
  0% { transform: rotate(0deg); }
  35% { transform: rotate(90deg); }
  65% { transform: rotate(90deg); }
  100% { transform: rotate(0deg); }
}

.mu-rotate-title {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #fbbf24;
  text-shadow: 0 0 12px rgba(245, 158, 11, 0.5);
  text-transform: uppercase;
}

.mu-rotate-desc {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: #cbd5e1;
}

.mu-rotate-desc strong {
  color: #38bdf8;
}

.mu-rotate-btn {
  margin-top: 6px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #000;
  font-weight: 700;
  font-size: 14px;
  border: none;
  border-radius: 8px;
  padding: 10px 22px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.mu-rotate-btn:active {
  transform: scale(0.96);
}

/* Antilag Mobile Button */
.mu-antilag-btn {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(180, 83, 9, 0.3) 100%) !important;
  border-color: rgba(245, 158, 11, 0.5) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.mu-antilag-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 800;
  color: #fbbf24;
  letter-spacing: 0.5px;
  pointer-events: none;
}

.mu-antilag-btn.on {
  border-color: #22c55e !important;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.3) 0%, rgba(21, 128, 61, 0.4) 100%) !important;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.6) !important;
}

.mu-antilag-btn.on .mu-antilag-label {
  color: #86efac;
}




/* ==========================================================================
   Mobile Native Character Name Input Bar
   ========================================================================== */
.mu-mobile-input-bar {
  display: none;
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 100000;
  width: 94%;
  max-width: 440px;
  background: rgba(15, 23, 42, 0.98);
  border: 1.5px solid rgba(245, 158, 11, 0.7);
  border-radius: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85), 0 0 20px rgba(245, 158, 11, 0.35);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 6px 10px;
  box-sizing: border-box;
}

.mu-mobile-input-bar.mu-active {
  display: block !important;
}

.mu-mobile-input-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.mu-mobile-input-icon {
  font-size: 1.1rem;
  padding-left: 4px;
}

.mu-mobile-input-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.mu-mobile-native-input {
  width: 100%;
  height: 38px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 16px;
  padding: 0 12px;
  color: #fff;
  font-family: inherit;
  font-size: 16px !important; /* CRITICAL for iOS Safari: >=16px prevents viewport auto-zoom */
  font-weight: 700;
  letter-spacing: 0.5px;
  outline: none;
  box-sizing: border-box;
}

.mu-mobile-native-input:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
  background: rgba(255, 255, 255, 0.16);
}

.mu-mobile-input-preview {
  font-size: 0.75rem;
  color: #38bdf8;
  font-weight: 700;
  padding: 1px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mu-mobile-char-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: #94a3b8;
  white-space: nowrap;
}

.mu-mobile-input-btn-done {
  padding: 7px 14px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: 0;
  border-radius: 18px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.mu-mobile-input-btn-done:active {
  transform: scale(0.95);
}

.mu-mobile-input-btn-close {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.1);
  border: 0;
  border-radius: 50%;
  color: #cbd5e1;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mu-mobile-input-btn-close:active {
  background: rgba(255, 255, 255, 0.2);
}

.mu-mobile-input-btn-create {
  padding: 7px 14px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  border: 0;
  border-radius: 18px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.mu-mobile-input-btn-create:active {
  transform: scale(0.95);
}

.mu-char-name-quick-btn {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #000;
  border: 2px solid #fbbf24;
  border-radius: 24px;
  padding: 10px 18px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.7), 0 0 16px rgba(245, 158, 11, 0.7);
  cursor: pointer;
  align-items: center;
  gap: 6px;
}

.mu-char-name-quick-btn:active {
  transform: scale(0.95);
}

/* Right-Click Toggle Button */
.mu-rclick-btn {
  background: rgba(30, 41, 59, 0.85) !important;
  border-color: rgba(245, 158, 11, 0.4) !important;
}

.mu-rclick-btn.on {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.9), rgba(217, 119, 6, 0.9)) !important;
  border-color: #fef08a !important;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.7) !important;
}

.mu-rclick-btn.on span {
  color: #1e1b4b !important;
}

/* ==========================================================================
   Mobile Optimization: Cursor Removal & GPU Lag Prevention (Mobile Devices Only)
   ========================================================================== */
html.is-mobile-device,
html.is-mobile-device body {
  cursor: none !important;
  overflow: hidden;
  touch-action: none !important;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-touch-callout: none !important;
  user-select: none !important;
}

html.is-mobile-device #canvas {
  cursor: none !important;
  touch-action: none !important;
  image-rendering: auto !important;
}

/* Disable expensive backdrop-filter on Android devices to prevent GPU stalls */
html.platform-android .mu-top-bar,
html.platform-android .mu-touch-cluster,
html.platform-android .mu-stick-pad,
html.platform-android .mu-hud,
html.platform-android .mu-modal-content {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* PC Guarantee: Cursor ALWAYS visible on Desktop PC */
html.platform-pc #canvas,
html:not(.is-mobile-device) #canvas {
  cursor: default !important;
}
