/* ═══════════════════════════════════════════════════════════
   MONSTER HUNTER · RISE OF THE BEAST SLAYER — style.css
   Dark fantasy premium mobile UI · Canvas game shell
   ═══════════════════════════════════════════════════════════ */

:root {
  --gold: #f5c542;
  --gold-2: #ff9d2e;
  --blue: #57b6ff;
  --red: #ff554a;
  --green: #6dff8e;
  --purple: #b48cff;
  --ink: #0a0714;
  --panel: rgba(16, 12, 32, 0.78);
  --bord: rgba(245, 197, 66, 0.35);
  --shadow: 0 0 24px rgba(0, 0, 0, 0.6);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  position: fixed;
  inset: 0;
  background: var(--ink);
  color: #efe9ff;
  font-family: 'Rajdhani', system-ui, sans-serif;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

body { -webkit-touch-callout: none; }

button { font-family: inherit; cursor: pointer; touch-action: none; }
img { -webkit-user-drag: none; user-select: none; }

.mh-root { position: fixed; inset: 0; overflow: hidden; }

.hidden { display: none !important; }
.pointer-none { pointer-events: none; }

/* ══════════ SCREENS ══════════ */
.mh-screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  background: radial-gradient(120% 90% at 50% 0%, #1a1233 0%, #0a0714 60%, #05030a 100%);
  animation: screenIn 0.35s ease both;
  z-index: 10;
}
@keyframes screenIn { from { opacity: 0; transform: scale(1.02); } to { opacity: 1; transform: none; } }

#game-wrap { position: fixed; inset: 0; background: #000; z-index: 5; }
#game-canvas, #menu-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

/* ══════════ FANTASY TEXT ══════════ */
.mh-title-main {
  font-family: 'Cinzel', serif;
  font-weight: 900;
  letter-spacing: 0.14em;
  font-size: clamp(26px, 9vw, 44px);
  text-align: center;
  background: linear-gradient(180deg, #fff7cf 0%, var(--gold) 45%, var(--gold-2) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 10px rgba(245, 197, 66, 0.45));
}
.mh-title-sub {
  font-family: 'Cinzel', serif;
  font-weight: 700; font-size: clamp(11px, 3.4vw, 15px);
  letter-spacing: 0.35em;
  text-align: center;
  color: #cbb8ff;
  text-shadow: 0 0 12px rgba(180, 140, 255, 0.6);
  text-transform: uppercase;
}

/* ══════════ SPLASH ══════════ */
.mh-splash {
  align-items: center; justify-content: center; gap: 12px;
  background: radial-gradient(90% 70% at 50% 42%, #221640 0%, #0b0718 55%, #05030a 100%);
  z-index: 60;
}
.mh-splash-logo {
  width: clamp(120px, 40vw, 220px); height: clamp(120px, 40vw, 220px);
  border-radius: 12px; object-fit: contain;
  box-shadow: 0 0 60px rgba(245, 197, 66, 0.35), inset 0 0 40px rgba(0,0,0,0.4);
  animation: logoFloat 3s ease-in-out infinite;
}
@keyframes logoFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.mh-splash .mh-title-sub { margin-top: -4px; }
.mh-splash-tip {
  margin-top: 14px; font-weight: 700; letter-spacing: 0.3em; font-size: 13px;
  color: #ffd97a; animation: pulseGlow 1.6s ease-in-out infinite;
}
@keyframes pulseGlow { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

.mh-loader { display: flex; gap: 8px; margin-top: 8px; }
.mh-loader span {
  width: 10px; height: 10px; border-radius: 50%; background: var(--gold);
  animation: loadB 1s ease-in-out infinite;
}
.mh-loader span:nth-child(2){ animation-delay: 0.15s; }
.mh-loader span:nth-child(3){ animation-delay: 0.3s; }
@keyframes loadB { 0%,100% { transform: scale(0.5); opacity: 0.4;} 50% { transform: scale(1.2); opacity: 1;} }

/* ══════════ MENU ══════════ */
.mh-menu-top {
  display: flex; justify-content: space-between; align-items: center;
  padding: calc(env(safe-area-inset-top) + 10px) 14px 0 14px;
  position: relative; z-index: 3;
}
.mh-menu-center {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; position: relative; z-index: 3; padding-bottom: 36px;
}
.mh-menu-logo {
  width: clamp(92px, 30vw, 150px); height: clamp(92px, 30vw, 150px);
  border-radius: 12px; object-fit: contain; margin-bottom: 2px;
  box-shadow: 0 0 42px rgba(245, 197, 66, 0.4);
  animation: logoFloat 4s ease-in-out infinite;
}
.mh-menu-grad {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(10,7,20,0.05) 0%, rgba(10,7,20,0.55) 50%, rgba(5,3,10,0.95) 100%);
}

.mh-btn {
  min-width: min(300px, 76vw);
  padding: 12px 26px;
  font-weight: 700; font-size: 15px; letter-spacing: 0.22em;
  color: #f0e6ff;
  background: linear-gradient(180deg, rgba(46,34,88,0.85), rgba(24,16,50,0.92));
  border: 1px solid rgba(150,120,230,0.35);
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.08);
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
}
.mh-btn:active { transform: scale(0.96); }
.mh-btn.primary {
  background: linear-gradient(180deg, #ffd66b 0%, #f5a02e 60%, #d97b1f 100%);
  color: #241304; border-color: #ffe9a8;
  box-shadow: 0 4px 22px rgba(245, 160, 46, 0.45);
  font-family: 'Cinzel', serif; letter-spacing: 0.26em;
}
.mh-btn.danger { border-color: rgba(255,85,74,0.5); color: #ffb0a8; }
.mh-btn.ghost { background: transparent; border-color: rgba(180,140,255,0.25); }
.mh-menu-btns { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; align-items: center; }
.mh-menu-footer { font-size: 10px; letter-spacing: 0.3em; color: #6f6390; margin-top: 10px; }

/* ══════════ BADGES / RESOURCES ══════════ */
.mh-lvbadge {
  background: linear-gradient(180deg, #2c1e4d, #181030);
  border: 1px solid var(--bord);
  border-radius: 999px; padding: 4px 14px;
  font-size: 13px; font-weight: 700; color: var(--gold);
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}
.mh-lvbadge b { letter-spacing: 0.05em; }
.mh-res {
  font-weight: 700; font-size: 12.5px; letter-spacing: 0.04em;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(12,8,24,0.8); border: 1px solid rgba(255,255,255,0.12);
  color: #e9e2ff; white-space: nowrap;
}
.mh-res.ed-gold::before { content: '◆ '; color: var(--gold); text-shadow: 0 0 8px rgba(245,197,66,0.8); }
.mh-res.ed-gem::before { content: '⬢ '; color: var(--purple); text-shadow: 0 0 8px rgba(180,140,255,0.9); }

/* ══════════ HEADERS / SCROLL ══════════ */
.mh-screen-head {
  display: grid; grid-template-columns: 46px 1fr 46px;
  align-items: center;
  padding: calc(env(safe-area-inset-top) + 8px) 10px 8px 10px;
  border-bottom: 1px solid rgba(180,140,255,0.12);
  background: linear-gradient(180deg, rgba(20,13,42,0.9), rgba(12,8,26,0.4));
}
.mh-screen-title { text-align: center; font-family: 'Cinzel', serif; font-weight: 900; letter-spacing: 0.18em; font-size: 18px; color: #ffe9ad; }
.mh-subcount { font-family: 'Rajdhani', sans-serif; font-size: 13px; color: var(--purple); letter-spacing: 0.05em; }
.mh-head-spacer { width: 46px; }
.mh-scroll {
  flex: 1; overflow-y: auto; padding-bottom: calc(env(safe-area-inset-bottom) + 44px);
  -webkit-overflow-scrolling: touch;
}
.mh-scroll::-webkit-scrollbar { display: none; }

.mh-icon-btn {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(180deg, #2a1f4d, #17102e);
  border: 1px solid rgba(180,140,255,0.35);
  color: #d6c8ff; font-size: 18px; font-weight: 700;
  box-shadow: 0 3px 12px rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.1s;
}
.mh-icon-btn:active { transform: scale(0.92); }

.mh-chiplv {
  background: linear-gradient(180deg, #2c1e4d, #181030);
  border: 1px solid var(--bord);
  border-radius: 999px; padding: 3px 10px; font-weight: 800; font-size: 12px; color: var(--gold);
}

/* ══════════ GLASS PANELS / CARDS ══════════ */
.glass {
  background: var(--panel);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(180,140,255,0.22);
  box-shadow: 0 10px 40px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.08);
  border-radius: 18px;
}
.mh-panel {
  background: var(--panel);
  border: 1px solid rgba(180,140,255,0.18);
  border-radius: 16px;
  box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.mh-panel-title {
  font-family: 'Cinzel', serif; font-weight: 700; letter-spacing: 0.15em;
  color: var(--gold); font-size: 13px;
}

.mh-card {
  background: linear-gradient(160deg, rgba(30,20,58,0.9), rgba(14,9,30,0.94));
  border: 1px solid rgba(180,140,255,0.2);
  border-radius: 14px;
  padding: 10px;
  margin-bottom: 10px;
  transition: transform 0.1s, border-color 0.15s;
}
.mh-card:active { transform: scale(0.98); }
.mh-card.rar-common { border-color: rgba(190,190,200,0.25); }
.mh-card.rar-uncommon { border-color: rgba(109,215,255,0.4); }
.mh-card.rar-rare { border-color: rgba(111,255,142,0.45); box-shadow: 0 0 18px rgba(111,255,142,0.12); }
.mh-card.rar-epic { border-color: rgba(180,140,255,0.55); box-shadow: 0 0 22px rgba(180,140,255,0.2); }
.mh-card.rar-legendary { border-color: rgba(245,197,66,0.7); box-shadow: 0 0 26px rgba(245,197,66,0.28); animation: legend 2.4s ease-in-out infinite; }
@keyframes legend { 0%,100% { box-shadow: 0 0 14px rgba(245,197,66,0.25);} 50% { box-shadow: 0 0 30px rgba(245,197,66,0.5);} }

.rar-txt { font-weight: 800; letter-spacing: 0.12em; font-size: 11px; }
.rar-txt.common { color: #c6c6d2; }
.rar-txt.uncommon { color: var(--blue); }
.rar-txt.rare { color: var(--green); }
.rar-txt.epic { color: var(--purple); }
.rar-txt.legendary { color: var(--gold); text-shadow: 0 0 10px rgba(245,197,66,0.6); }

.mh-item-ico {
  width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 24px;
  background: radial-gradient(circle at 30% 25%, #2f2158, #150f2b);
  border: 1px solid rgba(255,255,255,0.12);
}
.mh-item-ico.large { width: 64px; height: 64px; font-size: 32px; }

/* ══════════ BARS (HUD) ══════════ */
.mh-bar-wrap {
  position: relative; height: 20px; border-radius: 999px; overflow: visible;
  background: rgba(0,0,0,0.55); border: 1px solid rgba(255,255,255,0.14);
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.6);
}
.mh-bar { position: absolute; inset: 0 auto 0 0; width: 0%; border-radius: 999px; transition: width 0.08s linear; }
.mh-bar.hp { background: linear-gradient(180deg, #ff8a7a, #e12b2b 70%, #9b0f0f); box-shadow: 0 0 12px rgba(255,70,60,0.55); }
.mh-bar.mp { background: linear-gradient(180deg, #8fd0ff, #2f8cff 70%, #0f4fae); box-shadow: 0 0 12px rgba(80,150,255,0.5); }
.mh-bar.st { background: linear-gradient(180deg, #b9ff7e, #49b334 70%, #24751a); box-shadow: 0 0 10px rgba(120,255,120,0.4); }
.mh-bar.ult { background: linear-gradient(90deg, #ffb347, #ff5e3a 55%, #b3123f); box-shadow: 0 0 16px rgba(255,120,60,0.7); }
.mh-bar-txt {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.06em; color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
}

/* ══════════ QUEST PILL / BOSS BAR ══════════ */
.mh-questpill {
  max-width: 60vw; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: rgba(10,7,20,0.78); border: 1px solid rgba(180,140,255,0.3);
  border-radius: 999px; padding: 4px 14px; font-size: 11.5px; font-weight: 700; color: #e6dcff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}
.mh-questpill b { color: var(--gold); }

.mh-bossbar { position: absolute; top: calc(env(safe-area-inset-top) + 62px); left: 50%; transform: translateX(-50%); width: min(86vw, 460px); }
.mh-bossbar-track { height: 16px; border-radius: 999px; background: rgba(0,0,0,0.6); border: 1px solid rgba(255,90,70,0.5); overflow: hidden; box-shadow: 0 0 18px rgba(255,70,50,0.35); }
.mh-bossbar-fill {
  height: 100%; width: 100%;
  background: linear-gradient(180deg, #ff9b8a, #e02424 65%, #7e0e0e);
  transition: width 0.08s linear;
}
.mh-bossbar-name { text-align: center; font-family: 'Cinzel', serif; font-weight: 900; font-size: 12px; letter-spacing: 0.2em; color: #ffc9c2; text-shadow: 0 1px 6px rgba(0,0,0,0.9); margin-top: 4px; }

/* ══════════ HUD TOUCH: JOYSTICK / BUTTONS ══════════ */
.mh-hud { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.mh-hud button { pointer-events: auto; }

.mh-joyzone {
  position: absolute; left: 6px; bottom: calc(env(safe-area-inset-bottom) + 6px);
  width: 172px; height: 172px; pointer-events: auto;
}
.mh-joybase {
  position: absolute; left: 20px; bottom: 20px; width: 132px; height: 132px; border-radius: 50%;
  background: radial-gradient(circle, rgba(60,44,110,0.55), rgba(10,7,22,0.8));
  border: 2px solid rgba(255,255,255,0.22);
  box-shadow: 0 0 30px rgba(180,140,255,0.25), inset 0 0 24px rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.1s;
}
.mh-joyknob {
  width: 54px; height: 54px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d8c0ff, #6a4cc0 60%, #33206e);
  border: 2px solid rgba(240,230,255,0.7);
  box-shadow: 0 0 18px rgba(180,140,255,0.6);
}

.mh-actions {
  position: absolute; right: 4px; bottom: calc(env(safe-area-inset-bottom) + 4px);
  width: min(300px, calc(100vw - 190px));
  height: 216px;
  pointer-events: none;
}
.mh-actions button { pointer-events: auto; }
.mh-skill-grid {
  position: absolute; left: 0; top: 0;
  display: grid; grid-template-columns: repeat(3, 46px);
  grid-template-rows: repeat(2, 46px);
  gap: 5px;
}
.mh-skillbtn {
  position: relative; border-radius: 50%;
  width: 46px; height: 46px;
  background: radial-gradient(circle at 32% 28%, #43307c, #1c1338 70%);
  border: 1.5px solid rgba(180,140,255,0.5);
  box-shadow: 0 3px 12px rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.1s;
  overflow: hidden;
}
.mh-skillbtn:active { transform: scale(0.9); }
.mh-skillbtn.locked { opacity: 0.45; filter: grayscale(1); }
.sk-ico { font-size: 17px; line-height: 1; filter: drop-shadow(0 0 6px rgba(255,255,255,0.4)); }
.sk-cd {
  position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from 0deg, rgba(0,0,0,0.78) 0%, rgba(0,0,0,0.15) 0%);
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; color: #fff;
  opacity: 0;
}
.sk-mp {
  position: absolute; bottom: -1px; font-size: 7.5px; font-weight: 800;
  color: #a9d8ff; text-shadow: 0 1px 2px #000; letter-spacing: 0.03em;
}

.mh-dodgebtn {
  position: absolute; left: 128px; bottom: 8px;
  width: 64px; height: 64px; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #3f7a3a, #173013 70%);
  border: 1.5px solid rgba(130,255,150,0.55);
  box-shadow: 0 3px 12px rgba(0,0,0,0.55);
  font-size: 22px; display: flex; align-items: center; justify-content: center;
}
.mh-dodgebtn:active { transform: scale(0.9); }

.mh-attackbtn {
  position: absolute; right: 0; bottom: 0;
  width: 100px; height: 100px; border-radius: 50%;
  background: radial-gradient(circle at 32% 26%, #ffd77a, #e8782a 55%, #8f2c0e 100%);
  border: 3px solid rgba(255,240,190,0.85);
  box-shadow: 0 0 26px rgba(255,140,50,0.5), inset 0 -6px 14px rgba(0,0,0,0.4);
  transition: transform 0.08s;
}
.mh-attackbtn::after {
  content: '⚔'; font-size: 34px; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}
.mh-attackbtn:active { transform: scale(0.92); }
.mh-attackbtn.charging { box-shadow: 0 0 44px rgba(255,200,90,0.9); }

.mh-ultbtn {
  position: absolute; top: 0; right: 2px;
  width: 48px; height: 48px; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #ffe08a, #ff5e3a 60%, #8f1030);
  border: 2px solid #ffe9ad;
  box-shadow: 0 0 26px rgba(255,120,60,0.85);
  font-size: 20px; display: flex; align-items: center; justify-content: center;
  animation: ultPulse 1s ease-in-out infinite;
}
@keyframes ultPulse { 0%,100% { transform: scale(1); box-shadow: 0 0 20px rgba(255,120,60,0.7);} 50% { transform: scale(1.1); box-shadow: 0 0 36px rgba(255,120,60,1);} }

/* combo display */
.mh-combo {
  position: absolute; top: calc(env(safe-area-inset-top) + 178px); left: 50%; transform: translateX(-50%);
  text-align: center; pointer-events: none;
}
.mh-combo-x { font-family: 'Cinzel', serif; font-weight: 900; font-size: 22px; color: #ffc94d; text-shadow: 0 0 18px rgba(255,180,60,0.8), 0 2px 4px #000; letter-spacing: 0.1em; }
.mh-combo-t { display: block; font-size: 10px; letter-spacing: 0.3em; color: #ff8a6a; font-weight: 700; }

.mh-tuthint {
  position: absolute; bottom: calc(env(safe-area-inset-bottom) + 212px); left: 50%; transform: translateX(-50%);
  background: rgba(10,7,20,0.82); border: 1px solid rgba(245,197,66,0.5);
  border-radius: 999px; padding: 8px 18px; font-size: 13px; font-weight: 700; color: #ffe9ad;
  box-shadow: 0 0 20px rgba(245,197,66,0.25); animation: pulseGlow 1.4s infinite;
}

/* ══════════ OVERLAYS / MODALS ══════════ */
.mh-overlay {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(5,3,12,0.72);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.25s ease both;
  padding: 16px;
}
@keyframes fadeIn { from { opacity: 0;} to { opacity: 1;} }

.mh-modal {
  width: min(420px, 92vw); max-height: 86vh; overflow-y: auto;
  padding: 22px 20px; border-radius: 20px;
  display: flex; flex-direction: column; gap: 10px; align-items: stretch;
  animation: popIn 0.3s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
@keyframes popIn { from { transform: scale(0.85); opacity: 0;} to { transform: scale(1); opacity: 1;} }
.mh-modal.small { width: min(340px, 88vw); }
.mh-modal-title {
  font-family: 'Cinzel', serif; font-weight: 900; font-size: 22px; letter-spacing: 0.2em;
  text-align: center; color: #ffe9ad; text-shadow: 0 0 16px rgba(245,197,66,0.5);
}
.mh-modal-title.vict { color: #8dffad; text-shadow: 0 0 22px rgba(111,255,142,0.7); }
.mh-modal-title.def { color: #ff8a74; text-shadow: 0 0 22px rgba(255,80,60,0.7); }

.mh-stars { display: flex; justify-content: center; gap: 8px; font-size: 30px; margin: 2px 0; }
.mh-stars span { text-shadow: 0 0 12px rgba(245,197,66,0.7); }
.mh-stars span.dim { opacity: 0.18; }
.mh-vic-stats { text-align: center; font-size: 13.5px; color: #d9cbff; line-height: 1.7; }
.mh-vic-loot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 6px 0; }
.mh-vic-loot .loot-chip {
  min-width: 56px; padding: 6px 4px; border-radius: 10px; text-align: center;
  background: rgba(20,14,40,0.9); border: 1px solid rgba(255,255,255,0.14);
  font-size: 10px; color: #e4dbff;
}
.mh-vic-loot .loot-chip b { display: block; font-size: 18px; line-height: 1.2; }

.mh-detailpanel {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 14px 14px calc(env(safe-area-inset-bottom) + 14px);
  background: linear-gradient(180deg, rgba(24,16,48,0.96), rgba(10,7,22,0.98));
  border-top: 1px solid rgba(180,140,255,0.3);
  box-shadow: 0 -10px 40px rgba(0,0,0,0.6);
  transform: translateY(105%); transition: transform 0.25s cubic-bezier(0.2,1,0.3,1);
}
.mh-detailpanel.open { transform: translateY(0); }
.mh-buildbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; padding: 8px 12px calc(env(safe-area-inset-bottom) + 8px); pointer-events: none; }

.mh-tabs { display: flex; gap: 8px; overflow-x: auto; padding-top: 12px; padding-bottom: 2px; }
.mh-tabs::-webkit-scrollbar { display: none; }
.mh-tab {
  flex-shrink: 0; padding: 8px 16px; border-radius: 999px; font-weight: 700; font-size: 13px; letter-spacing: 0.08em;
  background: rgba(28,20,56,0.8); border: 1px solid rgba(150,120,230,0.25); color: #cfc2ff;
}
.mh-tab.on { background: linear-gradient(180deg, #3a2a6e, #241646); border-color: var(--gold); color: #ffe9ad; }

.mh-tut-body {
  text-align: center; font-size: 14px; line-height: 1.6; color: #dccfff;
  padding: 6px 4px 10px;
}

.mh-toast {
  position: fixed; top: calc(env(safe-area-inset-top) + 70px); left: 50%; transform: translateX(-50%);
  z-index: 50; padding: 10px 22px; border-radius: 999px;
  background: rgba(12,8,24,0.92); border: 1px solid rgba(245,197,66,0.5);
  color: #ffe9ad; font-weight: 800; letter-spacing: 0.1em; font-size: 13px;
  box-shadow: 0 6px 26px rgba(0,0,0,0.6); text-align: center;
  animation: toastIn 0.3s ease both;
}
@keyframes toastIn { from { transform: translate(-50%, -16px); opacity: 0;} to { transform: translate(-50%, 0); opacity: 1;} }

.mh-lvfx {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: 'Cinzel', serif; font-weight: 900; font-size: clamp(34px, 12vw, 60px);
  letter-spacing: 0.2em; color: #ffe9ad;
  text-shadow: 0 0 30px rgba(245,197,66,0.9), 0 0 80px rgba(255,150,50,0.6), 0 4px 10px #000;
  animation: lvAnim 2s ease-out both;
}
@keyframes lvAnim { 0% { transform: scale(0.4); opacity: 0;} 15% { transform: scale(1.15); opacity: 1;} 25% { transform: scale(1);} 80% { opacity: 1;} 100% { opacity: 0; transform: scale(1.1);} }

.mh-cost-row { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; color: #e4dbff; }
.mh-cost-row .ok { color: #7dff9d; }
.mh-cost-row .no { color: #ff7a66; }

/* skill tree node */
.mh-skillnode { border-radius: 14px; }
.mh-skillnode .node-dots { display: flex; gap: 4px; margin-left: auto; }
.mh-skillnode .node-dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.2); }
.mh-skillnode .node-dot.on { background: var(--gold); box-shadow: 0 0 8px rgba(245,197,66,0.8); border-color: #fff0c0; }

.branch-head { display: flex; align-items: center; gap: 8px; margin: 14px 0 8px; }
.branch-head .bh-ico { font-size: 20px; }
.branch-head .bh-txt { font-family:'Cinzel', serif; font-weight: 800; letter-spacing: 0.14em; color: var(--gold); font-size: 14px; }

/* toggle switch */
.mh-switch {
  width: 54px; height: 30px; border-radius: 999px; padding: 3px; flex-shrink: 0;
  background: #241b42; border: 1px solid rgba(180,140,255,0.3); transition: background 0.2s;
}
.mh-switch::after {
  content: ''; display: block; width: 22px; height: 22px; border-radius: 50%;
  background: #b9a8e8; transition: transform 0.2s, background 0.2s; box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}
.mh-switch.on { background: linear-gradient(180deg, #3a2a6e, #241646); border-color: var(--gold); }
.mh-switch.on::after { transform: translateX(24px); background: var(--gold); }

.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 4px; border-bottom: 1px solid rgba(180,140,255,0.1); }
.setting-row .s-label { font-weight: 700; font-size: 15px; color: #eee5ff; }
.setting-row .s-desc { font-size: 11px; color: #9487b8; }

body.mh-settings-open .mh-screen { display: none; }

.diff-easy { color: #7dff9d; } .diff-normal { color: var(--blue); } .diff-hard { color: var(--gold); }
.diff-expert { color: #ff9d5c; } .diff-nightmare { color: #ff5c7a; }