/* ==========================================================================
   STARFALL ONLINE v3.10 — premium HUD (loaded last; layouts chosen by js/hud.js)
   body.ui-desk  mouse & keyboard · body.ui-land  touch landscape · body.ui-port  touch portrait (+ .ui-big tablets)
   Look: dark glass panels with a thin gold edge, round avatar and slots, glossy bars. No backdrop blur
   (it re-renders every game frame on phones), just layered gradients.
   ========================================================================== */
:root {
  --hg-bg: linear-gradient(180deg, rgba(36, 30, 70, .9) 0%, rgba(17, 14, 36, .88) 100%);
  --hg-bg2: linear-gradient(180deg, rgba(28, 23, 56, .8) 0%, rgba(12, 10, 26, .78) 100%);
  --hg-edge: linear-gradient(155deg, rgba(255, 223, 145, .9) 0%, rgba(255, 223, 145, .18) 28%, rgba(139, 124, 246, .28) 62%, rgba(255, 213, 120, .7) 100%);
  --hg-edge2: linear-gradient(155deg, rgba(255, 255, 255, .28), rgba(255, 255, 255, .06) 45%, rgba(139, 124, 246, .3));
  --hg-shadow: 0 10px 26px rgba(0, 0, 0, .42), inset 0 1px 0 rgba(255, 255, 255, .09);
  --hg-gold: #f5cf73;
  --hg-gold2: #d99b33;
  --hg-text: #f3efff;
  --hg-dim: #b9b2dc;
  --hg-r: 16px;
}

/* ---------------------------------------------------------------- shared: glass frames */
body.ui #hud #hud-player, body.ui #hud #minimap-box, body.ui #hud #quest-tracker, body.ui #hud #bot-panel, body.ui #hud #gift-btn,
body.ui #hud #target-frame, body.ui #hud #party-frame, body.ui #hud #boss-dmg, body.ui #hud #skillbar, body.ui #hud #quickbar,
body.ui #hud #chat, body.ui #hud #menubar, body.ui #hud #chat-open-btn {
  background: var(--hg-bg) padding-box, var(--hg-edge) border-box !important;
  border: 1px solid transparent !important;
  border-radius: var(--hg-r) !important;
  box-shadow: var(--hg-shadow) !important;
  color: var(--hg-text);
}
body.ui #hud #quest-tracker, body.ui #hud #chat { background: var(--hg-bg2) padding-box, var(--hg-edge2) border-box !important; }

/* ---------------------------------------------------------------- player card & branding */
body.ui #hud #hud-player {
  display: flex !important;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px 9px 10px !important;
  background: radial-gradient(circle at 15% 20%, rgba(48, 36, 92, 0.95), rgba(20, 16, 44, 0.96) 60%, rgba(12, 10, 28, 0.98) 100%) padding-box,
              linear-gradient(135deg, rgba(255, 223, 145, 0.95) 0%, rgba(217, 155, 51, 0.6) 24%, rgba(168, 85, 247, 0.45) 55%, rgba(56, 189, 248, 0.5) 80%, rgba(255, 223, 145, 0.9) 100%) border-box !important;
  border: 1.5px solid transparent !important;
  border-radius: 18px !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65), 0 0 18px rgba(168, 85, 247, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
  position: relative;
  z-index: 20;
}
body.ui #hud .hud-game-tag {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  font: 800 10px/1 'Kanit', sans-serif;
  letter-spacing: 1.5px;
  background: linear-gradient(90deg, #fff3c4, #f5cf73 40%, #ffdf91 70%, #fff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.8)) drop-shadow(0 0 6px rgba(245, 207, 115, 0.6));
  padding-left: 2px;
  margin-bottom: 2px;
  user-select: none;
  pointer-events: none;
}
body.ui #hud .hud-game-tag .hgt-star {
  color: #ffd700;
  font-size: 11px;
  animation: star-pulse 2s infinite alternate ease-in-out;
}
@keyframes star-pulse {
  0% { transform: scale(0.9); opacity: 0.8; filter: drop-shadow(0 0 2px #ffd700); }
  100% { transform: scale(1.15); opacity: 1; filter: drop-shadow(0 0 6px #ffe29a); }
}
body.ui #hud .hud-player-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
}
body.ui #hud .hud-avatar-wrap {
  position: relative;
  flex: 0 0 auto;
}
body.ui #hud #hud-avatar {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  border-radius: 50% !important;
  border: 0 !important;
  background: radial-gradient(circle at 50% 35%, #503d9e, #181238 75%);
  box-shadow: 0 0 0 2px #15102d, 0 0 0 4px var(--hg-gold), 0 0 0 5.5px rgba(0, 0, 0, 0.65), 0 0 18px rgba(245, 207, 115, 0.55);
  display: block;
  cursor: pointer;
  transition: transform .12s, box-shadow .15s;
}
body.ui #hud #hud-avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 0 0 2px #15102d, 0 0 0 4px #fff, 0 0 0 5.5px rgba(0, 0, 0, 0.65), 0 0 22px rgba(245, 207, 115, 0.85);
}
body.ui #hud .hud-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font: 700 14px/1.2 'Kanit', sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
  color: #fff;
  min-width: 0;
  cursor: pointer;
}
body.ui #hud #hud-name {
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  max-width: 130px;
}
body.ui #hud .lv-badge {
  flex: 0 0 auto;
  padding: 1px 7px;
  border-radius: 999px;
  font: 800 11px/1.35 'Kanit', sans-serif;
  color: #3b2400;
  background: linear-gradient(#fff4cc, #f5cf73 55%, #c98a1f);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 2px 4px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 240, 180, 0.5);
}
body.ui #hud #hud-class, body.ui #hud .class-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 7px;
  border-radius: 6px;
  font: 600 11px 'Kanit', sans-serif;
  color: #d8b4fe;
  background: rgba(91, 33, 182, 0.35);
  border: 1px solid rgba(192, 132, 252, 0.35);
  box-shadow: inset 0 0 6px rgba(168, 85, 247, 0.2);
}
body.ui #hud .hp-col {
  flex: 1;
  min-width: 0;
}
body.ui #hud .hp-col .bar {
  margin-top: 4px;
}
body.ui #hud .hud-gold {
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
body.ui #hud .gold-badge, body.ui #hud .hud-gold > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px !important;
  font: 700 11px 'Kanit', sans-serif;
  white-space: nowrap;
  color: #ffe29a;
  background: rgba(0, 0, 0, 0.45);
  box-shadow: inset 0 0 0 1px rgba(255, 213, 120, 0.4), 0 2px 5px rgba(0, 0, 0, 0.4);
}
body.ui #hud .diamonds-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px !important;
  font: 700 11px 'Kanit', sans-serif;
  white-space: nowrap;
  color: #bfefff;
  background: rgba(14, 116, 144, 0.4);
  box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.6), 0 2px 5px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: all 0.15s ease;
}
body.ui #hud .diamonds-badge:hover {
  background: rgba(14, 116, 144, 0.7);
  box-shadow: inset 0 0 0 1px #7dd3fc, 0 0 10px rgba(56, 189, 248, 0.5);
  transform: translateY(-1px);
}
body.ui #hud .prem-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px !important;
  font: 700 10.5px 'Kanit', sans-serif;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}
body.ui #hud .prem-badge.active {
  background: linear-gradient(135deg, #b45309, #f59e0b 60%, #fde68a);
  color: #3b1a00;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
body.ui #hud .prem-badge.off {
  background: rgba(30, 25, 55, 0.6);
  color: #a5b4fc;
  border: 1px solid rgba(165, 180, 252, 0.3);
}
body.ui #hud .prem-badge:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}
body.ui #hud .points-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px !important;
  font: 700 11px 'Kanit', sans-serif;
  white-space: nowrap;
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  cursor: pointer;
  animation: pulse-pts 1.5s infinite;
}
@keyframes pulse-pts {
  0%, 100% { box-shadow: 0 0 6px rgba(16, 185, 129, 0.4); }
  50% { box-shadow: 0 0 14px rgba(16, 185, 129, 0.9); }
}
body.ui #hud #hud-cp {
  position: absolute;
  top: -11px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px 3px;
  border-radius: 999px;
  background: linear-gradient(135deg, #1c1108, #521c10 45%, #2a0b0b);
  border: 1px solid #f59e0b;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 0 10px rgba(245, 158, 11, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  font-family: 'Lilita One', 'Kanit', sans-serif;
  letter-spacing: 0.5px;
  z-index: 22;
}
body.ui #hud #hud-cp .cp-label {
  font: 800 10px 'Kanit', sans-serif;
  color: #fde047;
  letter-spacing: 0.8px;
  text-shadow: 0 1px 2px #000;
}
body.ui #hud #hud-cp #hud-cp-txt {
  font: 800 13.5px 'Lilita One', 'Kanit', sans-serif;
  background: linear-gradient(180deg, #fffbeb, #fde047 50%, #f59e0b);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 1px 1px #3b1e06);
}

/* bars: rounded, glossy */
body.ui #hud .bar, body.ui #hud #expbar {
  border: 0 !important;
  border-radius: 999px !important;
  background: rgba(5, 4, 14, 0.85);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.12) !important;
  overflow: hidden;
}
body.ui #hud .bar { height: 14px; }
body.ui #hud .bar.mp { height: 12px; }
body.ui #hud .bar > div, body.ui #hud #expfill { position: relative; border-radius: 999px; }
body.ui #hud .bar > div::after, body.ui #hud #expfill::after {
  content: '';
  position: absolute;
  left: 2px;
  right: 2px;
  top: 1px;
  height: 42%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0));
  pointer-events: none;
}
body.ui #hud .bar.hp > div { background: linear-gradient(90deg, #991b1b, #ef4444 55%, #fca5a5) !important; box-shadow: 0 0 10px rgba(239, 68, 68, 0.65); }
body.ui #hud .bar.mp > div { background: linear-gradient(90deg, #1e40af, #3b82f6 55%, #93c5fd) !important; box-shadow: 0 0 10px rgba(59, 130, 246, 0.65); }
body.ui #hud .bar > span { font: 700 9.5px/14px 'Kanit', sans-serif; letter-spacing: .3px; color: #fff; text-shadow: 0 1px 2px #000, 0 0 4px #000; }
body.ui #hud .bar.mp > span { line-height: 12px; font-size: 9px; }
body.ui #hud #expfill { background: linear-gradient(90deg, #b45309, #f59e0b 45%, #fde68a) !important; box-shadow: 0 0 10px rgba(245, 158, 11, .6); }
body.ui #hud #exptxt { font: 600 9.5px/10px 'Kanit', sans-serif; letter-spacing: .3px; }

/* buffs */
body.ui #hud #buff-bar { gap: 5px; }
body.ui #hud .buff { width: 30px; height: 30px; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #3b2f7a, #140f2b); border: 0; box-shadow: 0 0 0 1.5px var(--hg-gold), 0 2px 6px rgba(0, 0, 0, .5); }

/* target / status stack */
body.ui #hud #target-frame { padding: 7px 12px 9px; }
body.ui #hud #target-name { font: 600 13.5px 'Kanit', sans-serif; text-shadow: 0 1px 2px #000; }
body.ui #hud #target-frame .bar { height: 12px; }
body.ui #hud #event-banner { border-radius: 14px; border: 1px solid rgba(196, 181, 253, .7); background: linear-gradient(90deg, rgba(76, 29, 149, .92), rgba(30, 27, 75, .9)); box-shadow: 0 0 18px rgba(167, 139, 250, .4), 0 8px 20px rgba(0, 0, 0, .35); }

/* minimap */
body.ui #hud #minimap-box { padding: 8px; }
body.ui #hud .mm-head { align-items: center; font: 600 12px 'Kanit', sans-serif; color: #ffe8a8; }
body.ui #hud #minimap { display: block; margin: 0 auto; border-radius: 12px !important; border: 0; box-shadow: 0 0 0 1px rgba(255, 223, 145, .45), 0 0 0 3px rgba(0, 0, 0, .45), inset 0 0 12px rgba(0, 0, 0, .6) !important; }
body.ui #hud .mm-foot { font: 500 11px 'Kanit', sans-serif; color: var(--hg-dim); margin-top: 6px; }
body.ui #hud .mm-btn, body.ui #hud .mm-ch { height: 24px; min-width: 24px; border-radius: 999px !important; border: 0; background: rgba(255, 255, 255, .08) !important; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16) !important; color: #fff; font: 600 11px 'Kanit', sans-serif; }
body.ui #hud .mm-ch { padding: 0 8px; color: #ffe8a8; }
body.ui #hud .mm-btn:hover, body.ui #hud .mm-ch:hover { background: rgba(255, 223, 145, .22) !important; }

/* auto (bot), gift, quests */
body.ui #hud #bot-panel { padding: 6px; }
body.ui #hud .btn-bot { border-radius: 999px; border: 0; background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); font: 600 13px 'Kanit', sans-serif; }
body.ui #hud .btn-bot.active { background: linear-gradient(135deg, #047857, #10b981); box-shadow: 0 0 14px rgba(16, 185, 129, .55), inset 0 1px 0 rgba(255, 255, 255, .35); }
body.ui #hud .bot-cfg { border-radius: 50% !important; }
body.ui #hud #gift-btn { display: flex; align-items: center; justify-content: center; gap: 6px; font: 600 13px 'Kanit', sans-serif; }
body.ui #hud #gift-btn.ready { background: linear-gradient(135deg, #db2777, #f472b6) padding-box, var(--hg-edge) border-box !important; box-shadow: 0 0 16px rgba(244, 114, 182, .6) !important; }
body.ui #hud #quest-tracker { padding: 9px 11px; }
body.ui #hud .qt-head { font: 600 12.5px 'Kanit', sans-serif; color: #ffe29a; padding-bottom: 5px; margin-bottom: 2px; border-bottom: 1px solid rgba(255, 223, 145, .2); }
body.ui #hud .qt-row { font-size: 12px; margin-top: 6px; }
body.ui #hud .qt-name { font-family: 'Kanit', sans-serif; }

/* skills & quick slots */
body.ui #hud #skillbar { gap: 6px; padding: 8px 10px; border-radius: 20px !important; }
body.ui #hud .sk {
  width: 52px; height: 52px; border: 0 !important; border-radius: 14px !important;
  background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--c, #6d5fd8) 38%, #221b48), #0d0a20 78%);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c, #6d5fd8) 80%, #fff 20%), inset 0 -10px 14px rgba(0, 0, 0, .45), 0 3px 8px rgba(0, 0, 0, .45);
}
body.ui #hud .sk .ico-img { width: 38px; height: 38px; image-rendering: pixelated; }
body.ui #hud .sk .key { top: 2px; left: 3px; padding: 0 4px; border-radius: 6px; background: rgba(0, 0, 0, .55); font: 700 9.5px/13px 'Kanit', sans-serif; color: #ffe8a8; }
body.ui #hud .sk .mpc { font: 600 9px 'Kanit', sans-serif; }
body.ui #hud .sk .cd { border-radius: 0; }
body.ui #hud .sk.pot { --c: #e11d48; }
body.ui #hud .sk.pot[data-pot=mp] { --c: #2563eb; }
body.ui #hud .sk.dodge { --c: #22d3ee; }
body.ui #hud .sk:active { filter: brightness(1.35); }
body.ui #hud #quickbar { gap: 5px; padding: 5px 7px; border-radius: 14px !important; }
body.ui #hud .qs { border-radius: 11px; border: 0; background: radial-gradient(circle at 50% 30%, #2b2459, #0e0b22 80%); box-shadow: inset 0 0 0 1px rgba(255, 223, 145, .35), 0 2px 5px rgba(0, 0, 0, .4); }
body.ui #hud .qs.empty { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); opacity: .6; }

/* activity icons */
body.ui #hud #act-dock { gap: 6px 4px; }
body.ui #hud .dock-btn { width: 54px; height: auto; padding: 0; gap: 3px; background: none !important; box-shadow: none !important; }
body.ui #hud .dock-btn .pxi {
  width: 44px; height: 44px; padding: 9px; border-radius: 50%; image-rendering: pixelated;
  background: radial-gradient(circle at 50% 30%, #43368c, #171231 75%); box-shadow: 0 0 0 1.5px rgba(255, 223, 145, .75), 0 0 0 3px rgba(0, 0, 0, .45), 0 4px 10px rgba(0, 0, 0, .45);
  transition: transform .12s, box-shadow .15s;
}
body.ui #hud .dock-btn:hover { transform: none; filter: none; }
body.ui #hud .dock-btn:hover .pxi { transform: translateY(-2px) scale(1.06); box-shadow: 0 0 0 1.5px #fff1c2, 0 0 0 3px rgba(0, 0, 0, .45), 0 0 16px rgba(255, 223, 145, .55); }
body.ui #hud .dock-btn.on .pxi { background: radial-gradient(circle at 50% 30%, #7c5ce0, #2d2456 75%); }
body.ui #hud .dock-btn span { font: 600 10.5px/1.1 'Kanit', sans-serif; color: #fff; text-shadow: 0 1px 2px #000, 0 0 4px #000; }
body.ui #hud .dock-sys .pxi { background: radial-gradient(circle at 50% 30%, #334155, #0f172a 75%); }
body.ui #hud .dock-badge { top: -2px; right: 2px; box-shadow: 0 0 0 2px #140f2b; }
body.ui #hud #act-dock .dock-head { width: 22px; height: 22px; border-radius: 50%; padding: 0; font-size: 11px; background: rgba(20, 16, 44, .85); box-shadow: 0 0 0 1px rgba(255, 223, 145, .5); }

/* menu */
body.ui #hud #menubar button { border: 0 !important; border-radius: 14px !important; background: linear-gradient(180deg, rgba(64, 52, 128, .92), rgba(28, 22, 58, .92)) !important; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), inset 0 -3px 0 rgba(0, 0, 0, .35), 0 0 0 1px rgba(255, 223, 145, .22) !important; cursor: pointer; }
body.ui #hud #menubar button:hover { background: linear-gradient(180deg, rgba(96, 78, 190, .95), rgba(40, 31, 86, .95)) !important; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 0 0 1px var(--hg-gold), 0 0 14px rgba(255, 223, 145, .35) !important; }
body.ui #hud #menubar button.open { background: linear-gradient(180deg, rgba(124, 92, 224, .95), rgba(54, 40, 120, .95)) !important; box-shadow: inset 0 0 0 1px var(--hg-gold), 0 0 12px rgba(255, 223, 145, .35) !important; }
body.ui #hud #menubar button span { color: #eee9ff !important; font: 600 9.5px/1.1 'Kanit', sans-serif !important; text-shadow: 0 1px 2px #000 !important; }
body.ui #hud #menubar .mb-head, body.ui #hud #menubar .mb-cat { display: none; }
body.ui #hud #mobile-menu-toggle {
  display: flex; align-items: center; justify-content: center; padding: 0; width: 50px; height: 50px; border-radius: 16px; cursor: pointer;
  font-size: 22px; color: #ffe8a8; border: 1px solid transparent; background: linear-gradient(180deg, #6b4fd1, #2a1f63) padding-box, var(--hg-edge) border-box;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .25); z-index: 61;
}
body.ui #hud.mobile-nav-open #mobile-menu-toggle { background: linear-gradient(180deg, #b91c1c, #5b1010) padding-box, var(--hg-edge) border-box; color: #fff; }
/* the full menu (every layout): a categorised sheet */
body.ui #hud.mobile-nav-open #menubar {
  display: grid !important; grid-template-columns: repeat(6, 1fr); gap: 8px; padding: 14px 16px 16px;
  overflow-y: auto; overscroll-behavior: contain; z-index: 60; flex-wrap: initial;
}
body.ui #hud.mobile-nav-open #menubar > button { display: flex !important; width: auto !important; height: 64px !important; flex-direction: column; align-items: center; justify-content: center; gap: 4px; transition: transform 0.12s, box-shadow 0.12s; }
body.ui #hud.mobile-nav-open #menubar > button:active { transform: scale(0.94); }
body.ui #hud.mobile-nav-open #menubar > button img.mi { width: 26px; height: 26px; }
body.ui #hud.mobile-nav-open #menubar > button span { display: block !important; font-size: 10.5px !important; }
body.ui #hud.mobile-nav-open #menubar .mb-head { display: flex; grid-column: 1 / -1; align-items: baseline; justify-content: space-between; gap: 10px; padding: 0 2px 6px; border-bottom: 1px solid rgba(255, 223, 145, .28); }
body.ui #hud.mobile-nav-open #menubar .mb-head b { font: 700 17px 'Kanit', sans-serif; color: #ffe29a; text-shadow: 0 1px 4px rgba(0,0,0,0.8); }
body.ui #hud.mobile-nav-open #menubar .mb-head small { color: var(--hg-dim); font-size: 11px; }
body.ui #hud.mobile-nav-open #menubar .mb-cat {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  grid-column: 1 / -1;
  margin-top: 10px;
  margin-bottom: 2px;
  padding: 4px 10px;
  border-radius: 8px;
  font: 700 12.5px 'Kanit', sans-serif;
  color: #fde68a;
  letter-spacing: .5px;
  background: linear-gradient(90deg, rgba(245, 207, 115, 0.18), rgba(139, 124, 246, 0.08) 70%, transparent);
  border-left: 3px solid #f59e0b;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
body.ui #hud.mobile-nav-open #menubar .mb-cat .mb-cat-badge {
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  color: #d8b4fe;
  border: 1px solid rgba(192, 132, 252, 0.3);
}
body.ui #hud #mobile-close-panels { display: none !important; }
body.ui #hud.mobile-nav-open::before { content: ''; position: fixed; inset: 0; background: rgba(5, 3, 14, .65); z-index: 59; backdrop-filter: blur(4px); }

/* chat */
body.ui #hud #chat { overflow: hidden; }
body.ui #hud .chat-tabs { gap: 4px; padding: 7px 8px 6px; background: rgba(0, 0, 0, .25); border-bottom: 1px solid rgba(255, 255, 255, .08); display: flex; align-items: center; }
body.ui #hud .chat-tabs button { border-radius: 999px !important; padding: 4px 10px; font: 600 11.5px 'Kanit', sans-serif; color: #a5b4fc; background: rgba(255, 255, 255, .06); box-shadow: none; border: 1px solid rgba(255, 255, 255, .08); cursor: pointer; transition: all .15s ease; flex-shrink: 0; }
body.ui #hud .chat-tabs button:hover { background: rgba(255, 255, 255, .15); color: #fff; border-color: rgba(255, 255, 255, .2); }
body.ui #hud .chat-tabs button.active { background: linear-gradient(180deg, #7c3aed, #4c1d95) !important; color: #fff !important; border-color: rgba(255, 255, 255, .3) !important; box-shadow: 0 2px 6px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .3) !important; }
body.ui #hud .chat-actions { background: none; }
body.ui #hud .chat-min, body.ui #hud .chat-close { border-radius: 50%; width: 22px; height: 22px; background: rgba(255, 255, 255, .08); border: 0; }
body.ui #hud #chat-log { font-size: 12.5px; line-height: 1.5; padding: 2px 10px 4px; }
body.ui #hud #chat-form { background: rgba(0, 0, 0, .28); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); padding: 6px 8px; gap: 5px; }
body.ui #hud #chat-ch, body.ui #hud #chat-to, body.ui #hud #chat-input { border-radius: 999px !important; background: rgba(0, 0, 0, .45) !important; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12) !important; padding-left: 10px; }
body.ui #hud #chat-send, body.ui #hud #emote-btn { border-radius: 999px !important; }
body.ui #hud #chat-open-btn { padding: 8px 14px; font: 600 13px 'Kanit', sans-serif; border-radius: 999px !important; }

/* misc overlays */
body.ui #close-all { border-radius: 999px; padding: 6px 16px; background: linear-gradient(180deg, #b91c1c, #6b0f0f); box-shadow: 0 6px 16px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 200, 200, .45); }
body.ui .toast { border-radius: 14px !important; background: linear-gradient(180deg, rgba(36, 30, 70, .95), rgba(17, 14, 36, .95)) !important; box-shadow: inset 4px 0 0 #8b7ff0, 0 8px 22px rgba(0, 0, 0, .45) !important; border: 0 !important; }
body.ui .toast.error { box-shadow: inset 4px 0 0 #f87171, 0 8px 22px rgba(0, 0, 0, .45) !important; }
body.ui .toast.levelup { box-shadow: inset 4px 0 0 var(--hg-gold), 0 8px 22px rgba(0, 0, 0, .45) !important; }
body.ui .toast.quest, body.ui .toast.success { box-shadow: inset 4px 0 0 #34d399, 0 8px 22px rgba(0, 0, 0, .45) !important; }
body.ui #hud-restore { border-radius: 999px; }

/* ==========================================================================
   DESKTOP
   ========================================================================== */
body.ui-desk #hud #hud-player { position: absolute; top: 14px; left: 14px; right: auto; bottom: auto; width: 330px; }
body.ui-desk #hud #buff-bar { position: absolute; top: 152px; left: 16px; }
body.ui-desk #hud #top-stack > #party-frame { position: fixed; top: 192px; left: 14px; width: 210px; }
body.ui-desk #hud #top-stack > #boss-dmg { position: fixed; left: 236px; top: 192px; bottom: auto; }
body.ui-desk #hud #hud-right { position: absolute; top: 14px; right: 14px; width: 214px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; z-index: 5; }
body.ui-desk #hud #hud-right > * { position: relative; top: auto; right: auto; left: auto; bottom: auto; width: auto; pointer-events: auto; }
body.ui-desk #hud #minimap-box.collapsed { width: auto; }
body.ui-desk #hud #quest-tracker { max-height: min(34vh, calc(100vh - 480px)); min-height: 0; }
body.ui-desk #hud #act-dock { position: absolute; top: 14px; right: 240px; display: grid; grid-template-columns: repeat(6, 54px); z-index: 6; }
body.ui-desk #hud #act-dock .dock-head { position: absolute; left: -26px; top: 12px; }
body.ui-desk #hud #act-dock.min { grid-template-columns: 22px; }
body.ui-desk #hud.no-mm #act-dock { right: 240px; }
body.ui-desk #hud #top-stack { top: 14px; left: 360px; right: 598px; width: auto; max-width: none; margin: 0; align-items: center; }
body.ui-desk #hud.no-dock #top-stack { right: 240px; }
/* bottom: skills centred, chat left, menu dock right, exp bar along the edge */
body.ui-desk #hud #expbar { left: 0; right: 0; bottom: 0; height: 12px; border-radius: 0 !important; }
body.ui-desk #hud #expfill { border-radius: 0 6px 6px 0; }
body.ui-desk #hud #skillbar { position: absolute; bottom: 20px; left: 50%; right: auto; top: auto; transform: translateX(-50%); }
body.ui-desk #hud .sk.pot[data-pot=hp] { margin-left: 10px; }
body.ui-desk #hud #quickbar { position: absolute; bottom: 96px; left: 50%; right: auto; top: auto; transform: translateX(-50%); }
body.ui-desk #hud #chat { position: absolute; left: 14px; bottom: 20px; right: auto; top: auto; width: clamp(280px, calc(50vw - 354px), 400px); }
body.ui-desk #hud #chat-log { height: 128px; }
body.ui-desk #hud #chat-open-btn { position: absolute; left: 14px; bottom: 20px; top: auto; }
body.ui-desk #hud #menubar { position: absolute; right: 78px; bottom: 20px; top: auto; left: auto; display: flex; gap: 6px; padding: 7px 8px; max-height: none; overflow: visible; }
body.ui-desk #hud #menubar > button { display: none; }
body.ui-desk #hud #menubar > button.mb-main { display: flex; width: 50px; height: 50px; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
body.ui-desk #hud #menubar > button.mb-main img.mi { width: 24px; height: 24px; }
body.ui-desk #hud #mobile-menu-toggle { position: absolute; right: 14px; bottom: 27px; top: auto; }
body.ui-desk #hud.mobile-nav-open #menubar { right: 14px; bottom: 84px; width: 470px; max-height: calc(100vh - 110px); }
body.ui-desk #hud #bot-panel { display: flex; }
body.ui-desk #close-all { top: auto; bottom: 152px; }
body.ui-desk #loot-feed { right: 244px; bottom: 90px; left: auto; transform: none; }
body.ui-desk #prompts { top: 150px; right: 244px; left: auto; transform: none; }
/* narrower screens */
@media (max-width: 1439px) {
  body.ui-desk #hud .sk { width: 48px; height: 48px; }
  body.ui-desk #hud .sk .ico-img { width: 34px; height: 34px; }
  body.ui-desk #hud #skillbar { gap: 5px; padding: 7px 8px; }
  body.ui-desk #hud #quickbar { bottom: 88px; }
}
@media (max-width: 1279px) {
  body.ui-desk #hud #act-dock { grid-template-columns: repeat(2, 48px); gap: 6px; }
  body.ui-desk #hud #act-dock .dock-btn { width: 48px; }
  body.ui-desk #hud #act-dock .dock-btn span { display: none; }
  body.ui-desk #hud #top-stack { right: 356px; }
  body.ui-desk #hud #chat { bottom: 150px; width: 320px; }
  body.ui-desk #hud #chat-log { height: 108px; }
  body.ui-desk #hud #chat-open-btn { bottom: 150px; }
  body.ui-desk #hud #menubar > button.mb-main { width: 44px; height: 44px; }
  body.ui-desk #hud #menubar > button.mb-main span { display: none; }
  body.ui-desk #hud #menubar { right: 70px; }
  body.ui-desk #hud #mobile-menu-toggle { width: 46px; height: 46px; bottom: 25px; }
}
@media (max-width: 1100px) {
  body.ui-desk #hud #skillbar, body.ui-desk #hud #quickbar { left: 42%; }
  body.ui-desk #hud .sk { width: 42px; height: 42px; border-radius: 12px !important; }
  body.ui-desk #hud .sk .ico-img { width: 30px; height: 30px; }
  body.ui-desk #hud #skillbar { gap: 4px; padding: 6px; }
  body.ui-desk #hud #quickbar { bottom: 78px; }
  body.ui-desk #hud .qs { width: 34px; height: 34px; }
  body.ui-desk #hud #menubar > button.mb-main { width: 40px; height: 40px; }
  body.ui-desk #hud #menubar { right: 64px; gap: 4px; padding: 6px; }
}
@media (max-height: 700px) {
  body.ui-desk #hud #quest-tracker { max-height: calc(100vh - 470px); }
}

/* ==========================================================================
   TOUCH (phones & tablets) — shared
   ========================================================================== */
body.ui-touch {
  --cx: 64px; --cy: 62px;          /* centre of the attack button, from the right / bottom edge */
  --atk: 76px; --ss: 44px; --ps: 42px;
  --r1: 82px; --r2: 136px;
}
body.ui-touch #hud #expbar { left: 0; right: 0; bottom: 0; height: 5px; border-radius: 0 !important; }
body.ui-touch #hud #exptxt { display: none; }
body.ui-touch #hud #bot-panel, body.ui-touch #hud #act-dock, body.ui-touch #hud #mob-emote, body.ui-touch #hud #mob-dodge { display: none !important; }
body.ui-touch #hud #hud-right { display: contents; }
body.ui-touch #hud #mobile-actions { display: contents; }
body.ui-touch #hud #hud-player {
  position: absolute;
  top: 8px;
  left: 8px;
  right: auto;
  bottom: auto;
  gap: 3px;
  padding: 6px 10px 7px 8px !important;
}
body.ui-touch #hud #hud-avatar { width: 46px; height: 46px; }
body.ui-touch #hud .hud-game-tag { font-size: 8.5px; letter-spacing: 1px; margin-bottom: 0; }
body.ui-touch #hud .hud-name { font-size: 13px; gap: 4px; }
body.ui-touch #hud #hud-class, body.ui-touch #hud .class-badge {
  display: inline-flex !important;
  font-size: 9.5px;
  padding: 0 5px;
}
body.ui-touch #hud .hp-col .bar { height: 12px; margin-top: 3px; }
body.ui-touch #hud .hp-col .bar.mp { height: 10px; }
body.ui-touch #hud .bar > span { font-size: 8.5px; line-height: 12px; }
body.ui-touch #hud .bar.mp > span { font-size: 8px; line-height: 10px; }
body.ui-touch #hud .hud-gold { margin-top: 3px; gap: 4px; }
body.ui-touch #hud .hud-gold > span:first-child,
body.ui-touch #hud .gold-badge,
body.ui-touch #hud .diamonds-badge,
body.ui-touch #hud .prem-badge,
body.ui-touch #hud .points-badge {
  display: inline-flex !important;
  height: 18px;
  font-size: 10px;
  padding: 0 6px;
}
body.ui-touch #hud #hud-cp { top: -9px; right: 8px; transform: scale(.85); transform-origin: right center; }
body.ui-touch #hud #minimap-box { position: absolute; top: 8px; right: 8px; left: auto; bottom: auto; width: 132px; padding: 6px; }
body.ui-touch #hud #minimap { width: 118px; height: 118px; }
body.ui-touch #hud .mm-head { font-size: 10.5px; margin-bottom: 4px; display: flex; align-items: center; justify-content: space-between; gap: 4px; overflow: hidden; }
body.ui-touch #hud #mm-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.ui-touch #hud .mm-range, body.ui-touch #hud .mm-foot { display: none; }
body.ui-touch #hud #minimap-box.collapsed { width: auto; }
/* /* round utility buttons: menu · bag · char · auto · ride · gift · target */
body.ui-touch #hud #mobile-menu-toggle, body.ui-touch #hud #mob-bag, body.ui-touch #hud #mob-char, body.ui-touch #hud #mob-auto, body.ui-touch #hud #mob-ride, body.ui-touch #hud #gift-btn, body.ui-touch #hud #mob-target {
  position: absolute; width: 46px; height: 46px; padding: 0; margin: 0; border-radius: 50% !important; font-size: 20px; line-height: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; top: auto; left: auto; right: auto; bottom: auto; transform: none;
  cursor: pointer; transition: transform .12s, box-shadow .12s;
}
body.ui-touch #hud #mob-bag, body.ui-touch #hud #mob-char, body.ui-touch #hud #mob-auto, body.ui-touch #hud #mob-ride, body.ui-touch #hud #mob-target {
  color: #fff; border: 1px solid transparent !important; background: radial-gradient(circle at 50% 30%, #3e3386, #15102f 78%) padding-box, var(--hg-edge) border-box !important;
  box-shadow: 0 5px 14px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .2) !important;
}
body.ui-touch #hud #mob-bag {
  background: radial-gradient(circle at 50% 30%, #b45309, #451a03 78%) padding-box, var(--hg-edge) border-box !important;
  box-shadow: 0 5px 14px rgba(0, 0, 0, .45), 0 0 12px rgba(245, 158, 11, .35), inset 0 1px 0 rgba(255, 255, 255, .25) !important;
}
body.ui-touch #hud #mob-char {
  background: radial-gradient(circle at 50% 30%, #4f46e5, #1e1b4b 78%) padding-box, var(--hg-edge) border-box !important;
  box-shadow: 0 5px 14px rgba(0, 0, 0, .45), 0 0 12px rgba(99, 102, 241, .35), inset 0 1px 0 rgba(255, 255, 255, .25) !important;
}
body.ui-touch #hud #mob-auto { background: radial-gradient(circle at 50% 30%, #0f9f74, #064e3b 78%) padding-box, var(--hg-edge) border-box !important; }
body.ui-touch #hud #mob-auto.active { box-shadow: 0 0 0 3px rgba(110, 231, 183, .65), 0 0 18px rgba(52, 211, 153, .8) !important; }
body.ui-touch #hud #gift-btn { width: 50px; height: 50px; gap: 0; }
body.ui-touch #hud #gift-btn .gift-ico { font-size: 18px; }
body.ui-touch #hud #gift-txt { font: 600 8.5px/1 'Kanit', sans-serif; margin-top: 1px; }
/* joystick */
body.ui-touch #hud #joystick { position: absolute; left: 18px; bottom: 22px; top: auto; right: auto; width: 124px; height: 124px; border: 0;
  background: radial-gradient(circle, rgba(255, 255, 255, .02) 38%, rgba(139, 124, 246, .16) 62%, rgba(255, 255, 255, .06) 70%);
  box-shadow: 0 0 0 2px rgba(255, 223, 145, .35), inset 0 0 22px rgba(139, 124, 246, .3); }
body.ui-touch #hud #joy-knob { left: 38px; top: 38px; width: 48px; height: 48px; border: 0;
  background: radial-gradient(circle at 40% 35%, #fff4cc, #f2c14e 45%, #b7791f 100%); box-shadow: 0 0 0 2px rgba(255, 255, 255, .5), 0 4px 12px rgba(0, 0, 0, .5), 0 0 16px rgba(245, 207, 115, .55); }
/* attack button + arc skill pad (the skill bar becomes a zero-size anchor at the attack button's centre) */
body.ui-touch #hud #mob-attack {
  position: absolute; right: calc(var(--cx) - var(--atk) / 2); bottom: calc(var(--cy) - var(--atk) / 2); top: auto; left: auto;
  width: var(--atk); height: var(--atk); border-radius: 50%; font-size: calc(var(--atk) * .4); z-index: 8;
  border: 2px solid rgba(255, 223, 145, .85) !important; color: #fff;
  background: radial-gradient(circle at 50% 30%, #ff6b6b, #b91c1c 55%, #5b0b0b) !important;
  box-shadow: 0 0 0 4px rgba(0, 0, 0, .35), 0 8px 20px rgba(0, 0, 0, .5), 0 0 24px rgba(248, 113, 113, .45), inset 0 2px 0 rgba(255, 255, 255, .35) !important;
}
body.ui-touch #hud #mob-attack:active { transform: scale(.94); }
body.ui-touch #hud #mob-target { right: calc(var(--cx) - (var(--r1) + 4px) * .5 - 20px); bottom: calc(var(--cy) + (var(--r1) + 4px) * .866 - 20px); width: 40px; height: 40px; font-size: 17px; }
body.ui-touch #hud #skillbar {
  position: absolute; right: var(--cx); bottom: var(--cy); left: auto; top: auto; width: 0; height: 0; padding: 0; gap: 0; transform: none;
  display: block; background: none !important; box-shadow: none !important; border: 0 !important; overflow: visible; max-width: none; z-index: 7;
}
body.ui-touch #hud #skillbar .sk {
  position: absolute; left: calc(cos(var(--a)) * var(--r)); top: calc(sin(var(--a)) * var(--r)); margin: calc(var(--ss) / -2) 0 0 calc(var(--ss) / -2);
  width: var(--ss); height: var(--ss); border-radius: 50% !important; transform: none;
}
body.ui-touch #hud #skillbar .sk .ico-img { width: calc(var(--ss) * .68); height: calc(var(--ss) * .68); }
body.ui-touch #hud #skillbar .sk .key { display: none; }
body.ui-touch #hud #skillbar .sk .mpc { right: 50%; transform: translateX(50%); bottom: -1px; font-size: 8.5px; }
body.ui-touch #hud #skillbar .sk .lock { border-radius: 50%; font-size: 9px; }
body.ui-touch #hud #skillbar .sk .cdt { font-size: 14px; }
body.ui-touch #hud #skillbar .sk:nth-child(1) { --a: 188deg; --r: var(--r1); }
body.ui-touch #hud #skillbar .sk:nth-child(2) { --a: 220deg; --r: var(--r1); }
body.ui-touch #hud #skillbar .sk:nth-child(3) { --a: 252deg; --r: var(--r1); }
body.ui-touch #hud #skillbar .sk:nth-child(4) { --a: 284deg; --r: var(--r1); }
body.ui-touch #hud #skillbar .sk:nth-child(5) { --a: 185deg; --r: var(--r2); }
body.ui-touch #hud #skillbar .sk:nth-child(6) { --a: 205deg; --r: var(--r2); }
body.ui-touch #hud #skillbar .sk:nth-child(7) { --a: 225deg; --r: var(--r2); }
body.ui-touch #hud #skillbar .sk:nth-child(8) { --a: 245deg; --r: var(--r2); }
body.ui-touch #hud #skillbar .sk:nth-child(9) { --a: 265deg; --r: var(--r2); }
body.ui-touch #hud #skillbar .sk:nth-child(10) { --a: 285deg; --r: var(--r2); }
/* potions + dodge: a row along the bottom edge, left of the attack button */
body.ui-touch #hud #skillbar .sk.dodge, body.ui-touch #hud #skillbar .sk.pot { top: calc(var(--cy) - 10px - var(--ps)); margin: 0; width: var(--ps); height: var(--ps); }
body.ui-touch #hud #skillbar .sk.dodge { left: calc(var(--atk) / -2 - 12px - var(--ps)); }
body.ui-touch #hud #skillbar .sk.pot[data-pot=hp] { left: calc(var(--atk) / -2 - 20px - var(--ps) * 2); }
body.ui-touch #hud #skillbar .sk.pot[data-pot=mp] { left: calc(var(--atk) / -2 - 28px - var(--ps) * 3); }
body.ui-touch #hud #skillbar .sk.pot img { width: 26px; height: 26px; }
body.ui-touch #hud #skillbar .sk .cnt { right: 50%; transform: translateX(50%); bottom: -2px; font: 600 9px 'Kanit', sans-serif; }
body.ui-touch #hud #skillbar .sk.dodge .dodge-ico { font-size: 18px; }
/* chat: two-line peek, tap to open */
body.ui-touch #hud #chat { position: absolute; top: auto; right: auto; z-index: 30; }
body.ui-touch #hud #chat.peek { width: min(250px, 42vw); background: linear-gradient(180deg, rgba(14, 11, 30, .55), rgba(14, 11, 30, .7)) !important; box-shadow: 0 4px 12px rgba(0, 0, 0, .3) !important; border: 0 !important; border-radius: 12px !important; cursor: pointer; }
body.ui-touch #hud #chat.peek .chat-tabs, body.ui-touch #hud #chat.peek #chat-form { display: none; }
body.ui-touch #hud #chat.peek #chat-log { display: block; height: 38px; overflow: hidden; padding: 3px 9px; font-size: 11px; line-height: 1.45; pointer-events: none; }
body.ui-touch #hud #chat.peek::after { content: '💬'; position: absolute; right: 6px; bottom: 4px; font-size: 12px; opacity: .8; }
body.ui-touch #hud #chat.kb { position: fixed; top: 6px; bottom: auto; left: 6px; right: 6px; width: auto; transform: none; z-index: 13000; }
body.ui-touch #hud #chat:not(.peek):not(.kb) { left: 50%; transform: translateX(-50%); bottom: 12px; width: min(460px, 94vw); z-index: 40; }
body.ui-touch #hud #chat:not(.peek):not(.kb) #chat-log { height: min(32vh, 170px); }
body.ui-touch #hud #chat-open-btn { position: absolute; top: auto; right: auto; }
body.ui-touch #hud #quest-tracker { display: block; position: absolute; right: auto; bottom: auto; padding: 7px 9px; }
body.ui-touch #hud .qt-head { font-size: 11.5px; }
body.ui-touch #hud .qt-row { font-size: 10.5px; margin-top: 4px; }
body.ui-touch #hud #quickbar { position: absolute; top: auto; right: auto; transform: none; gap: 4px; padding: 4px 6px; display: flex !important; flex-wrap: nowrap; grid-template-columns: none; width: auto; height: auto; max-width: none; }
body.ui-touch #hud #quickbar:not(:has(.qs:not(.empty))) { display: none !important; }
body.ui-touch #hud .qs { width: 36px; height: 36px; }
body.ui-touch #hud .qs.empty { display: none; }
body.ui-touch #hud .qs .key { display: none; }
body.ui-touch #hud #top-stack { position: absolute; margin: 0; max-width: none; min-width: 0; width: auto; }
body.ui-touch #hud #top-stack > #target-frame { width: min(260px, 100%); }
body.ui-touch #hud #party-frame .dps-meter-wrap, body.ui-touch #hud #party-frame .pf-dps-btn, body.ui-touch #hud #party-frame .bar.mp { display: none; }
/* full menu as a centred sheet */
body.ui-touch #hud #menubar { display: none; }
body.ui-touch #hud.mobile-nav-open #menubar { position: fixed; left: 50%; top: 50%; right: auto; bottom: auto; transform: translate(-50%, -50%); width: min(560px, 94vw); max-height: 86dvh; }
body.ui-touch #close-all { top: auto; left: 50%; transform: translateX(-50%); }

/* ==========================================================================
   TOUCH · LANDSCAPE PHONES
   ========================================================================== */
body.ui-land #hud #hud-player { width: 250px; }
body.ui-land #hud #buff-bar { position: absolute; top: 84px; left: 10px; }
body.ui-land #hud #minimap-box { width: 124px; }
body.ui-land #hud #minimap { width: 110px; height: 110px; }
body.ui-land #hud #mobile-menu-toggle { top: 8px; right: 136px; }
body.ui-land #hud #mob-bag { top: 8px; right: 186px; }
body.ui-land #hud #mob-char { top: 8px; right: 236px; }
body.ui-land #hud #mob-auto { top: 8px; right: 286px; }
body.ui-land #hud #mob-ride { top: 8px; right: 336px; }
body.ui-land #hud #gift-btn { top: 6px; right: 388px; }
body.ui-land #hud #top-stack { top: 8px; left: 264px; right: 444px; align-items: center; }
body.ui-land #hud #quest-tracker { top: 118px; left: 8px; width: 196px; max-height: calc(100dvh - 118px - 172px); }
body.ui-land #hud #top-stack > #party-frame { position: fixed; top: 118px; left: 212px; width: 150px; max-height: calc(100dvh - 300px); overflow-y: auto; }
body.ui-land #hud #quickbar { left: 160px; bottom: 58px; }
body.ui-land #hud #chat.peek { left: 160px; bottom: 10px; }
body.ui-land #hud #chat-open-btn { left: 160px; bottom: 10px; }
body.ui-land #hud #joystick { bottom: 18px; left: 16px; }
body.ui-land #hud.mobile-nav-open #menubar { grid-template-columns: repeat(8, 1fr); width: min(720px, 94vw); }
body.ui-land #hud.mobile-nav-open #menubar > button { height: 56px !important; }
body.ui-land #close-all { bottom: 110px; }
body.ui-land #toasts { top: 22%; }
body.ui-land #loot-feed { left: 50%; right: auto; top: 58%; bottom: auto; transform: translateX(-50%); }
body.ui-land #prompts { top: 64px; left: 50%; right: auto; transform: translateX(-50%); }

/* ==========================================================================
   TOUCH · PORTRAIT PHONES
   ========================================================================== */
body.ui-port { --cx: 70px; --cy: 84px; --atk: 80px; --ss: 48px; --ps: 44px; --r1: 88px; --r2: 146px; }
body.ui-port #hud #hud-player { width: calc(100vw - 146px); max-width: 290px; min-width: 215px; padding: 6px 10px 8px 8px !important; }
body.ui-port #hud .hud-game-tag { font-size: 9.5px; letter-spacing: 1px; }
body.ui-port #hud #hud-avatar { width: 50px; height: 50px; }
body.ui-port #hud #hud-class, body.ui-port #hud .class-badge { display: inline-flex !important; font-size: 10px; padding: 1px 5px; }
body.ui-port #hud .diamonds-badge { display: inline-flex !important; height: 18px; font-size: 10px; padding: 0 5px; }
body.ui-port #hud .gold-badge { height: 18px; font-size: 10px; padding: 0 5px; }
body.ui-port #hud .prem-badge { display: inline-flex !important; height: 18px; font-size: 10px; padding: 0 5px; }
body.ui-port #hud #hud-name { max-width: 85px; font-size: 13px; }
body.ui-port #hud .mm-head { display: flex; align-items: center; justify-content: space-between; gap: 4px; overflow: hidden; font-size: 11px; }
body.ui-port #hud #mm-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; max-width: 72px; }
body.ui-port #hud #buff-bar { position: absolute; top: 100px; left: 10px; }
body.ui-port #hud #mobile-menu-toggle { top: 156px; right: 10px; }
body.ui-port #hud #mob-bag { top: 208px; right: 10px; }
body.ui-port #hud #mob-char { top: 260px; right: 10px; }
body.ui-port #hud #mob-auto { top: 312px; right: 10px; }
body.ui-port #hud #mob-ride { top: 364px; right: 10px; }
body.ui-port #hud #gift-btn { top: 416px; right: 8px; }
body.ui-port #hud #top-stack { top: 176px; left: 8px; right: 66px; align-items: stretch; }
body.ui-port #hud #top-stack > #target-frame { width: auto; }
body.ui-port #hud #top-stack > #party-frame { order: 3; position: static; width: auto; }
body.ui-port #hud #quest-tracker { top: 44vh; left: 8px; width: min(170px, 44vw); max-height: 22vh; }
body.ui-port #hud #quickbar { right: 8px; left: auto; transform: none; bottom: calc(var(--cy) + var(--r2) + var(--ss) / 2 + 12px); }
body.ui-port #hud #chat.peek { left: 8px; bottom: calc(var(--cy) + 140px); width: min(168px, 42vw); }
body.ui-port #hud #chat-open-btn { left: 8px; bottom: calc(var(--cy) + 140px); }
body.ui-port #hud #joystick { left: 16px; bottom: calc(var(--cy) + 6px); }
body.ui-port #hud.mobile-nav-open #menubar { grid-template-columns: repeat(4, 1fr); }
body.ui-port #close-all { bottom: calc(var(--cy) + var(--r2) + 80px); }
body.ui-port #toasts { top: 30%; }
body.ui-port #loot-feed { left: 50%; right: auto; top: 58%; bottom: auto; transform: translateX(-50%); }
body.ui-port #prompts { top: 30%; left: 50%; right: auto; transform: translateX(-50%); }

/* short / narrow portrait phones (e.g. 360×640) */
@media (max-height: 700px), (max-width: 374px) {
  body.ui-port { --cx: 58px; --cy: 66px; --atk: 70px; --ss: 42px; --ps: 40px; --r1: 76px; --r2: 124px; }
  body.ui-port #hud #joystick { width: 110px; height: 110px; left: 10px; bottom: calc(var(--cy) + 2px); }
  body.ui-port #hud #joy-knob { left: 33px; top: 33px; width: 44px; height: 44px; }
  body.ui-port #hud #chat.peek, body.ui-port #hud #chat-open-btn { bottom: calc(var(--cy) + 122px); }
  body.ui-port #hud #quest-tracker { top: 36vh; max-height: 18vh; }
  body.ui-port #hud #top-stack { top: 168px; }
  body.ui-port #hud #mobile-menu-toggle, body.ui-port #hud #mob-bag, body.ui-port #hud #mob-char, body.ui-port #hud #mob-auto, body.ui-port #hud #mob-ride { width: 38px; height: 38px; font-size: 17px; }
  body.ui-port #hud #mobile-menu-toggle { top: 152px; right: 10px; }
  body.ui-port #hud #mob-bag { top: 194px; right: 10px; }
  body.ui-port #hud #mob-char { top: 236px; right: 10px; }
  body.ui-port #hud #mob-auto { top: 278px; right: 10px; }
  body.ui-port #hud #mob-ride { top: 320px; right: 10px; }
  body.ui-port #hud #gift-btn { top: 362px; width: 42px; height: 42px; right: 8px; }
}

/* tablets: the same layouts, larger */
body.ui-touch.ui-big { --atk: 92px; --ss: 56px; --ps: 50px; --r1: 100px; --r2: 168px; --cx: 84px; --cy: 88px; }
body.ui-big #hud #hud-player { width: 340px; max-width: none; }
body.ui-big #hud #minimap-box { width: 176px; }
body.ui-big #hud #minimap { width: 162px; height: 162px; }
body.ui-big #hud .diamonds-badge { display: inline-flex !important; }
body.ui-big.ui-port #hud #mobile-menu-toggle { top: 200px; }
body.ui-big.ui-port #hud #mob-bag { top: 254px; right: 10px; }
body.ui-big.ui-port #hud #mob-char { top: 308px; right: 10px; }
body.ui-big.ui-port #hud #mob-auto { top: 362px; right: 10px; }
body.ui-big.ui-port #hud #mob-ride { top: 416px; right: 10px; }
body.ui-big.ui-port #hud #gift-btn { top: 470px; right: 8px; }
body.ui-big #hud #chat.peek { width: 300px; }
body.ui-big #hud #quest-tracker { width: 220px; }
body.ui-big.ui-port #hud #top-stack { top: 226px; }

/* ==========================================================================
   v3.10 phones: nothing may cover the play field — compact party, target, quests, toasts and drops
   ========================================================================== */
/* quest tracker: foldable everywhere (js/hud.js adds the ▾ button) */
body.ui #hud .qt-head { display: flex; align-items: center; gap: 6px; }
body.ui #hud .qt-head .qt-toggle { margin-left: auto; flex: 0 0 auto; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; color: #ffe8a8; font-size: 11px; line-height: 1; background: rgba(255, 255, 255, .1); box-shadow: inset 0 0 0 1px rgba(255, 223, 145, .35); }
body.ui #hud .qt-head .qt-count { flex: 0 0 auto; min-width: 18px; padding: 0 5px; border-radius: 999px; background: rgba(245, 207, 115, .22); color: #ffe8a8; font: 700 10.5px/16px 'Kanit', sans-serif; text-align: center; }
body.ui #hud #quest-tracker.folded { cursor: pointer; }
body.ui #hud #quest-tracker.folded .qt-row, body.ui #hud #quest-tracker.folded .qt-empty { display: none; }
body.ui #hud #quest-tracker.folded .qt-head { border-bottom: 0; padding-bottom: 0; margin-bottom: 0; }
body.ui #hud #quest-tracker.folded { width: auto; }

body.ui-touch #hud .qt-head small, body.ui-touch #hud .qt-cat { display: none; }
body.ui-touch #hud #quest-tracker { padding: 5px 8px; overflow-y: auto; overscroll-behavior: contain; }
body.ui-touch #hud .qt-head { font-size: 11px; padding-bottom: 3px; }
body.ui-touch #hud .qt-row { font-size: 10.5px; margin-top: 3px; line-height: 1.3; }
body.ui-touch #hud .qt-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
body.ui-touch #hud .qt-prog { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.ui-port #hud #quest-tracker { top: 40vh; width: min(158px, 42vw); max-height: 92px; }
body.ui-land #hud #quest-tracker { width: 180px; max-height: min(92px, calc(100dvh - 118px - 172px)); }
body.ui-big #hud #quest-tracker { max-height: 150px; }

/* party frame: names + thin HP only */
body.ui-touch #hud #party-frame { padding: 4px 7px 5px; border-radius: 12px !important; }
body.ui-touch #hud #party-frame .pf-title { font-size: 10.5px; margin-bottom: 1px; }
body.ui-touch #hud #party-frame .pf-row { padding: 1px 2px; }
body.ui-touch #hud #party-frame .pf-name { font-size: 10px; line-height: 1.25; }
body.ui-touch #hud #party-frame .bar { height: 5px; margin-top: 1px; }
body.ui-touch #hud #party-frame .bar > span { display: none; }
body.ui-port #hud #top-stack > #party-frame { align-self: flex-start; width: min(150px, 40vw); order: 3; }
body.ui-land #hud #top-stack > #party-frame { width: 140px; }
/* target (monster HP): a slim centred bar */
body.ui-touch #hud #top-stack > #target-frame { align-self: center; width: min(210px, 100%); padding: 3px 10px 5px; border-radius: 12px !important; }
body.ui-touch #hud #target-name { font-size: 11px; }
body.ui-touch #hud #target-frame .bar { height: 9px; margin-top: 2px; }
body.ui-touch #hud #target-frame .bar > span { font-size: 8px; line-height: 9px; }
body.ui-touch #hud #event-banner { align-self: center; padding: 3px 10px; font-size: 11px; gap: 6px; max-width: 100%; }
body.ui-touch #hud #event-banner .eb-ico { font-size: 15px; }
body.ui-touch #hud #event-banner small { display: none; }
body.ui-touch #hud #boss-dmg { align-self: flex-start; width: min(170px, 46vw); font-size: 10px; padding: 4px 6px; }
/* toasts and drop cards */
body.ui-touch #toasts { width: min(330px, 86vw); gap: 3px; }
body.ui-touch .toast { padding: 4px 11px; font-size: 11px; line-height: 1.35; border-radius: 10px !important; }
body.ui-touch #toasts .toast:nth-last-child(n+3) { display: none; }
body.ui-port #toasts { top: 24%; }
body.ui-touch .drop-card { min-width: 0; max-width: 46vw; gap: 5px; padding: 2px 8px 2px 2px; font-size: 10.5px; }
body.ui-touch .drop-card img { width: 22px; height: 22px; }
body.ui-port #loot-feed { left: auto; right: 8px; top: 384px; bottom: auto; transform: none; align-items: flex-end; max-height: 96px; overflow: hidden; }
body.ui-land #loot-feed { left: 50%; right: auto; top: 30%; bottom: auto; transform: translateX(-50%); max-height: 70px; overflow: hidden; }
@media (max-height: 700px), (max-width: 374px) { body.ui-port #loot-feed { top: 356px; max-height: 60px; } body.ui-port #hud #quest-tracker { top: 36vh; max-height: 74px; } }
/* skills that are locked stay visible with opacity and level badge so players see progression */
body.ui-touch #hud #skillbar .sk.locked { display: flex; opacity: .55; filter: grayscale(.65); }
body.ui-touch #hud #skillbar .sk.locked .lock { border-radius: 999px; font-size: 8px; background: rgba(0, 0, 0, .8); color: #fca5a5; padding: 1px 3px; letter-spacing: -0.3px; }
body.ui-touch #hud #chat-open-btn { width: 40px; height: 40px; padding: 0; display: flex; align-items: center; justify-content: center; border-radius: 50% !important; font-size: 17px; }
body.ui-touch #hud #chat-open-btn span { display: none; }
body.ui-touch #hud #chat-open-btn.hidden { display: none; }

/* phones: the folded quest tracker is one more round button (📜 + count); opened, it drops next to it */
body.ui-touch #hud #quest-tracker.folded { width: 46px; height: 46px; padding: 0; border-radius: 50% !important; display: flex !important; align-items: center; justify-content: center; overflow: visible; max-height: none; }
body.ui-touch #hud #quest-tracker.folded .qt-head { font-size: 0; gap: 0; padding: 0; }
body.ui-touch #hud #quest-tracker.folded .qt-head::before { content: '📜'; font-size: 19px; line-height: 1; }
body.ui-touch #hud #quest-tracker.folded .qt-toggle { display: none; }
body.ui-touch #hud #quest-tracker.folded .qt-count { position: absolute; top: -4px; right: -4px; background: #ef4444; color: #fff; box-shadow: 0 0 0 2px #140f2b; }
body.ui-port #hud #quest-tracker { top: 214px; right: 62px; left: auto; bottom: auto; width: 168px; max-height: 110px; }
body.ui-port #hud #quest-tracker.folded { top: 162px; right: 62px; }
body.ui-port #hud #top-stack { right: 116px; }
body.ui-land #hud #quest-tracker { top: 58px; right: 300px; left: auto; bottom: auto; width: 190px; max-height: min(110px, calc(100dvh - 240px)); }
body.ui-land #hud #quest-tracker.folded { top: 8px; right: 352px; }
body.ui-land #hud #top-stack { right: 406px; }
body.ui-land #hud #top-stack > #party-frame { position: fixed; top: 118px; left: 8px; width: 140px; max-height: calc(100dvh - 118px - 160px); overflow-y: auto; }
body.ui-big.ui-port #hud #quest-tracker.folded { top: 206px; right: 66px; }
body.ui-big.ui-port #hud #quest-tracker { top: 262px; right: 66px; width: 230px; max-height: 170px; }
@media (max-height: 700px), (max-width: 374px) {
  body.ui-port #hud #quest-tracker { top: 212px; right: 58px; max-height: 96px; }
  body.ui-port #hud #quest-tracker.folded { top: 162px; right: 58px; width: 42px; height: 42px; }
}
/* toasts sit where nothing else lives: under the feet (portrait), under the top row (landscape) */
body.ui-port #toasts { top: calc(50% + 64px); }
body.ui-land #toasts { top: 58px; }
/* target bar: readable numbers */
body.ui-touch #hud #target-frame .bar { height: 11px; }
body.ui-touch #hud #target-frame .bar > span { font-size: 8.5px; line-height: 11px; }
@media (max-height: 700px), (max-width: 374px) { body.ui-port #toasts { top: calc(50% + 40px); } }
/* ---------------------------------------------------------------- v3.11 tower bar */
#tw-bar { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 10px; padding: 5px 12px; border-radius: 12px; font-size: 13px; color: #fef3c7; white-space: nowrap;
  background: linear-gradient(180deg, rgba(41, 24, 8, .92), rgba(20, 12, 6, .94)); border: 1px solid rgba(251, 191, 36, .55); box-shadow: 0 4px 14px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .08); backdrop-filter: blur(6px); }
#tw-bar.boss { border-color: #f87171; box-shadow: 0 0 16px rgba(248, 113, 113, .45), inset 0 1px 0 rgba(255, 255, 255, .08); }
#tw-bar .twb-name b { font: 700 17px 'Kanit', sans-serif; color: #fde047; margin: 0 1px 0 3px; } #tw-bar .twb-name small { color: #d6c7a1; }
#tw-bar .twb-tier { padding: 0 8px; border-radius: 999px; font-weight: 700; font-size: 11.5px; color: var(--tc); border: 1px solid var(--tc); background: rgba(0, 0, 0, .35); }
#tw-bar .twb-lv { color: #d6c7a1; font-size: 12px; }
#tw-bar .twb-mobs, #tw-bar .twb-time { font-weight: 700; font-variant-numeric: tabular-nums; }
#tw-bar .twb-time.low { color: #fca5a5; animation: twb-blink 1s steps(2) infinite; }
#tw-bar .twb-st { font-weight: 700; } #tw-bar .twb-st.ok { color: #86efac; } #tw-bar .twb-st.bad { color: #fca5a5; }
#tw-bar .btn { padding: 1px 8px; font-size: 11.5px; }
@keyframes twb-blink { 50% { opacity: .45; } }
body.ui-touch #hud #tw-bar { font-size: 11.5px; gap: 2px 7px; padding: 3px 9px; border-radius: 10px; }
body.ui-touch #hud #tw-bar .twb-name b { font-size: 14px; }
body.ui-touch #hud #tw-bar .twb-lv { display: none; }
body.ui-port #hud #tw-bar { align-self: center; flex-wrap: nowrap; gap: 2px 6px; padding: 3px 7px; }
body.ui-port #hud #tw-bar .twb-name small, body.ui-port #hud #tw-bar .twb-lbl { display: none; }
body.ui-port #hud #tw-bar .btn { padding: 1px 5px; }

.seg.seg3 { grid-template-columns: repeat(3, 1fr); }
body.ui #hud .qt-head small { display: none; }

/* ---------------------------------------------------------------- World Boss Radar Banner */
.boss-radar-banner {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%) translateY(-120%);
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(24, 12, 10, 0.96), rgba(45, 15, 10, 0.94));
  border: 1.5px solid #ef4444;
  border-radius: 12px;
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.55), 0 8px 24px rgba(0, 0, 0, 0.6);
  padding: 8px 16px;
  color: #fff;
  transition: transform 0.35s cubic-bezier(0.18, 0.89, 0.32, 1.28), opacity 0.3s;
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(8px);
}
.boss-radar-banner.active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.bra-pulse {
  font-size: 22px;
  animation: bra-bounce 1s infinite alternate;
}
@keyframes bra-bounce {
  from { transform: scale(0.9); }
  to { transform: scale(1.18); }
}
.bra-info {
  display: flex;
  flex-direction: column;
}
.bra-title {
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.bra-sub {
  font-size: 11.5px;
}
.bra-btn {
  font-weight: bold;
  padding: 4px 12px;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.4);
}
.bra-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.bra-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* ---------------------------------------------------------------- Cosmic Ultimate Skill Slot */
.sk.cosmic {
  border-color: #fde047 !important;
  box-shadow: 0 0 12px rgba(253, 224, 71, 0.6), inset 0 0 6px rgba(168, 85, 247, 0.5) !important;
  animation: cosmic-glow 2.5s infinite alternate ease-in-out;
}
@keyframes cosmic-glow {
  0% { box-shadow: 0 0 8px rgba(253, 224, 71, 0.4), inset 0 0 4px rgba(168, 85, 247, 0.3); }
  100% { box-shadow: 0 0 16px rgba(253, 224, 71, 0.8), inset 0 0 8px rgba(168, 85, 247, 0.7); }
}

/* ---------------------------------------------------------------- Job Advance Placeholder Slot (Key 9) */
.sk.job-placeholder {
  cursor: pointer;
  background: radial-gradient(circle at 50% 30%, #2a1f10, #140d05) !important;
  border-color: #78350f !important;
}
.sk.job-placeholder .job-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
}
.sk.job-placeholder.ready {
  border-color: #f59e0b !important;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.7), inset 0 0 6px rgba(251, 191, 36, 0.4) !important;
  animation: job-pulse 2s infinite alternate ease-in-out;
}
.sk.job-placeholder.ready .lock {
  background: #f59e0b !important;
  color: #140d05 !important;
  font-weight: 800 !important;
  border-radius: 6px;
  padding: 1px 4px;
}
@keyframes job-pulse {
  0% { box-shadow: 0 0 8px rgba(245, 158, 11, 0.4); }
  100% { box-shadow: 0 0 16px rgba(245, 158, 11, 0.9), 0 0 24px rgba(251, 191, 36, 0.5); }
}

/* ---------------------------------------------------------------- Starfall Rift (v81) */
#rift-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: radial-gradient(circle at 10% 50%, rgba(124, 58, 237, 0.95), rgba(30, 27, 75, 0.96) 60%, rgba(15, 23, 42, 0.98)) padding-box,
              linear-gradient(135deg, #c084fc, #38bdf8 50%, #f472b6) border-box !important;
  border: 1.5px solid transparent !important;
  border-radius: 12px;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  animation: rift-glow 2.5s infinite alternate ease-in-out;
  pointer-events: auto;
  min-height: 38px;
}
@keyframes rift-glow {
  0% { box-shadow: 0 4px 16px rgba(124, 58, 237, 0.4), 0 0 8px rgba(56, 189, 248, 0.3); }
  100% { box-shadow: 0 6px 24px rgba(192, 132, 252, 0.7), 0 0 16px rgba(56, 189, 248, 0.6); }
}
#rift-banner.here {
  background: radial-gradient(circle at 10% 50%, rgba(225, 29, 72, 0.95), rgba(76, 29, 149, 0.96) 60%, rgba(15, 23, 42, 0.98)) padding-box,
              linear-gradient(135deg, #f43f5e, #fbbf24 50%, #c084fc) border-box !important;
}
#rift-banner .eb-ico {
  font-size: 20px;
  line-height: 1;
  filter: drop-shadow(0 0 6px #c084fc);
}
#rift-banner .eb-main {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.25;
}
#rift-banner .eb-main b {
  font-size: 12.5px;
  color: #fbcfe8;
}
#rift-banner .eb-main small {
  font-size: 10.5px;
  color: #bae6fd;
}
#rift-banner .eb-time {
  margin-left: auto;
  font: 800 13px 'Lilita One', 'Kanit', sans-serif;
  color: #fde047;
  padding: 2px 8px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 6px;
  border: 1px solid rgba(253, 224, 71, 0.4);
}

/* Rift Window Styling */
.rift-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: radial-gradient(circle at 20% 50%, rgba(124, 58, 237, 0.35), rgba(15, 23, 42, 0.8));
  border: 1px solid rgba(192, 132, 252, 0.3);
  border-radius: 12px;
  margin-bottom: 12px;
}
.rift-hero-icon {
  font-size: 32px;
  line-height: 1;
  filter: drop-shadow(0 0 10px #c084fc);
}
.rift-hero-info {
  flex: 1;
  min-width: 0;
}
.rift-hero-title {
  font: 800 15px 'Kanit', sans-serif;
  background: linear-gradient(90deg, #fbcfe8, #c084fc 50%, #38bdf8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: 0.5px;
}
.rift-hero-sub {
  font-size: 11.5px;
  color: #94a3b8;
  margin-top: 2px;
}
.rift-crystal-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(14, 116, 144, 0.4);
  border: 1px solid #38bdf8;
  color: #e0f2fe;
  font: 700 12px 'Kanit', sans-serif;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}
.rift-crystal-pill b {
  color: #38bdf8;
  font-size: 14px;
}
.rift-status-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(192, 132, 252, 0.25);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.rift-status-card.active {
  border-color: #a855f7;
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.2);
}
.rift-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.rift-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font: 700 11px 'Kanit', sans-serif;
}
.rift-badge.live {
  background: rgba(239, 68, 68, 0.25);
  border: 1px solid #ef4444;
  color: #fca5a5;
  animation: pulse-pts 1.5s infinite alternate;
}
.rift-badge.idle {
  background: rgba(100, 116, 139, 0.25);
  border: 1px solid #64748b;
  color: #cbd5e1;
}
.rift-timer {
  font: 700 12px 'Kanit', sans-serif;
  color: #fde047;
}
.rift-wave-box {
  margin-top: 10px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.rift-wave-title {
  font: 700 13px 'Kanit', sans-serif;
  color: #fbcfe8;
}
.rift-boss-hp-bar {
  position: relative;
  height: 22px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid #ec4899;
  border-radius: 999px;
  margin-top: 8px;
  overflow: hidden;
  box-shadow: 0 0 10px rgba(236, 72, 153, 0.4);
}
.rift-boss-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #be185d, #ec4899 60%, #f472b6);
  border-radius: 999px;
  transition: width 0.3s ease;
}
.rift-boss-hp-txt {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 700 11px 'Kanit', sans-serif;
  color: #fff;
  text-shadow: 0 1px 2px #000;
}
.rift-sect {
  font: 700 13px 'Kanit', sans-serif;
  color: #e2e8f0;
  margin: 10px 0 6px;
}
.rift-ranks {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
}
.rift-rank-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  font-size: 12px;
}
.rift-rank-row.top {
  background: rgba(88, 28, 135, 0.35);
  border-color: rgba(192, 132, 252, 0.4);
}
.rift-rank-num {
  font-size: 14px;
  font-weight: bold;
  min-width: 24px;
}
.rift-rank-name {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.rank-tier {
  font: 800 10px 'Kanit', sans-serif;
  padding: 1px 6px;
  border-radius: 4px;
}
.rank-tier.s { background: #e11d48; color: #fff; }
.rank-tier.a { background: #d97706; color: #fff; }
.rank-tier.b { background: #2563eb; color: #fff; }
.rift-rank-stat {
  color: #94a3b8;
  font-size: 11.5px;
}
.rift-shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}
.rift-shop-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 10px;
}
.rift-shop-ico {
  font-size: 26px;
  line-height: 1;
}
.rift-shop-detail {
  flex: 1;
  min-width: 0;
}
.rift-shop-name {
  font: 700 13px 'Kanit', sans-serif;
  color: #f1f5f9;
}
.rift-shop-desc {
  font-size: 11px;
  color: #94a3b8;
  margin: 2px 0 4px;
}
.rift-shop-price {
  font: 700 11.5px 'Kanit', sans-serif;
  color: #38bdf8;
}

/* ==========================================================================
   Grade 6 (Mythic / Rainbow Cosmic) & Rainbow Shimmer Helpers
   ========================================================================== */
.rainbow-shimmer-text, .rainbow-text, .grade-mythic {
  background: linear-gradient(90deg, #ff3dfa, #f43f5e, #fb923c, #facc15, #4ade80, #38bdf8, #818cf8, #ff3dfa);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: rainbow-flow 3s linear infinite;
  text-shadow: 0 0 12px rgba(255, 61, 250, 0.4);
  font-weight: 700;
  display: inline-block;
}
.tt-rainbow-bonus {
  color: #ff9cf7 !important;
  text-shadow: 0 0 8px rgba(255, 61, 250, 0.5);
  font-weight: 600;
}

/* >>> NET STRIP v3.30 */
/* status strip under the minimap: three framed pixel chips — channel · online | FPS | MS */
#net-strip { display: flex; align-items: stretch; gap: 4px; pointer-events: auto; font-family: 'Press Start 2P', 'Kanit', monospace; -webkit-font-smoothing: none; user-select: none; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .55)); }
/* frame, outside in: gold line · dark gap · steel-blue line · navy fill; the corners are notched like pixel art */
#net-strip .ns-chip { position: relative; display: flex; align-items: center; justify-content: center; gap: 5px; min-width: 0; margin: 0; padding: 9px 8px 8px; white-space: nowrap;
  color: #f1f5ff; font: inherit; font-size: 7px; line-height: 1; letter-spacing: .02em; text-shadow: 1px 1px 0 #070a18;
  background: linear-gradient(180deg, #2a3466 0, #1c2349 50%, #141a38 100%);
  border: 2px solid #b39245; border-top-color: #d8b760; border-bottom-color: #7d6327; border-radius: 0;
  box-shadow: inset 0 0 0 1px #0a0c1b, inset 0 0 0 2px #4d5aa3, inset 0 3px 0 0 rgba(255, 255, 255, .06);
  clip-path: polygon(0 2px, 2px 2px, 2px 0, calc(100% - 2px) 0, calc(100% - 2px) 2px, 100% 2px, 100% calc(100% - 2px), calc(100% - 2px) calc(100% - 2px), calc(100% - 2px) 100%, 2px 100%, 2px calc(100% - 2px), 0 calc(100% - 2px)); }
#net-strip .ns-main { flex: 1 1 auto; justify-content: flex-start; cursor: pointer; }
#net-strip .ns-main:hover { filter: brightness(1.18); }
#net-strip .ns-dot { flex: 0 0 8px; width: 8px; height: 8px; background: #4ade80; box-shadow: 0 0 0 1px #0b3d1f, inset -2px -2px 0 rgba(0, 0, 0, .28), 0 0 6px rgba(74, 222, 128, .8); }
#net-strip[data-q="mid"] .ns-dot { background: #fde047; box-shadow: 0 0 0 1px #4a3b05, inset -2px -2px 0 rgba(0, 0, 0, .28), 0 0 6px rgba(253, 224, 71, .8); }
#net-strip[data-q="bad"] .ns-dot { background: #f87171; box-shadow: 0 0 0 1px #4a0d0d, inset -2px -2px 0 rgba(0, 0, 0, .28), 0 0 6px rgba(248, 113, 113, .8); animation: nsBlink 1s steps(2) infinite; }
#net-strip .ns-txt { display: flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden; }
#net-strip .ns-txt b { font-weight: 400; }
#net-strip .ns-txt em { font-style: normal; opacity: .6; }
#net-strip .ns-txt u { text-decoration: none; font: 700 10px 'Kanit', sans-serif; letter-spacing: 0; -webkit-font-smoothing: antialiased; transform: translateY(-.5px); }
#net-strip .ns-num { flex: 0 0 auto; color: #6ee7b7; }
#net-strip .ns-num b { font-weight: 400; min-width: 2ch; text-align: right; }
#net-strip .ns-num small { font-size: 6px; opacity: .92; }
#net-strip .ns-num[data-q="mid"] { color: #fde047; }
#net-strip .ns-num[data-q="bad"] { color: #f87171; }
@keyframes nsBlink { 50% { opacity: .35; } }
/* a little wider than the column, so the whole line fits: it grows to the left */
body.ui-desk #hud #hud-right > #net-strip { margin-left: -40px; }
/* the old numbers in the minimap footer are in the strip now */
body.ui #hud .mm-foot > span:nth-child(2), body.ui #hud .mm-foot > #mm-ping { display: none; }
/* phones: a slim version along the bottom edge of the map (the channel is already in the map's header) */
body.ui-touch #hud #minimap-box > #net-strip { position: absolute; left: 5px; right: 5px; bottom: 5px; z-index: 2; gap: 1px; filter: none; justify-content: space-between; }
body.ui-touch #hud #minimap-box.collapsed > #net-strip { display: none; }
body.ui-touch #hud #net-strip .ns-chip { flex: 0 1 auto; padding: 4px 2px 3px; font-size: 6px; letter-spacing: 0; gap: 1px; border-width: 1px; clip-path: none; box-shadow: inset 0 0 0 1px #0a0c1b; background: linear-gradient(180deg, rgba(42, 52, 102, .93), rgba(20, 26, 56, .93)); }
body.ui-touch #hud #net-strip .ns-main { flex: 1 1 auto; justify-content: center; gap: 3px; }
body.ui-touch #hud #net-strip #ns-ch, body.ui-touch #hud #net-strip .ns-txt em, body.ui-touch #hud #net-strip .ns-txt u { display: none; }
body.ui-touch #hud #net-strip .ns-dot { flex-basis: 5px; width: 5px; height: 5px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .6); }
body.ui-touch #hud #net-strip .ns-num { flex: 0 0 auto; }
body.ui-touch #hud #net-strip .ns-num b { min-width: 0; }
body.ui-touch #hud #net-strip .ns-num small { font-size: 5px; }
/* portrait phones: the round menu button overlaps the map's bottom-right corner — the strip stops before it and keeps only the light, FPS and MS */
body.ui-port:not(.ui-big) #hud #minimap-box > #net-strip { right: 36px; justify-content: flex-start; gap: 2px; }
body.ui-port:not(.ui-big) #hud #net-strip .ns-main { flex: 0 0 auto; padding-left: 4px; padding-right: 4px; }
body.ui-port:not(.ui-big) #hud #net-strip #ns-online { display: none; }
body.hud-hidden #net-strip { display: none; }
/* <<< NET STRIP v3.30 */

/* >>> ULT BANNER v3.30 */
/* the name of an ultimate: brush lettering in white-gold with a dark outline, a light that sweeps across it, a kicker with the tier */
#ult-banner { top: 17%; gap: 18px; z-index: 46; }
#ult-banner.show { animation: ubIn 1.75s cubic-bezier(.16, .9, .22, 1) forwards; }
#ult-banner .ub-mid { position: relative; display: flex; flex-direction: column; align-items: center; }
#ult-banner .ub-kicker { font: italic 700 clamp(10px, 1.25vw, 14px) 'Chakra Petch', 'Kanit', sans-serif; letter-spacing: .42em; color: #fff7d6; text-shadow: 0 1px 2px #000, 0 0 10px var(--c); opacity: .95; margin-bottom: -.2em; }
#ult-banner b.ub-name { position: relative; display: block; font: 700 clamp(30px, 5.4vw, 68px) 'Charmonman', 'Kanit', serif; font-style: normal; letter-spacing: .02em; line-height: 1.55; padding: 0 .3em;
  color: transparent; -webkit-text-fill-color: transparent; background: none; filter: drop-shadow(0 .05em 0 rgba(12, 6, 2, .9)) drop-shadow(0 0 .04em rgba(12, 6, 2, .9)) drop-shadow(0 0 .28em var(--c)); }
#ult-banner b.ub-name::before { content: attr(data-t); position: absolute; inset: 0; padding: inherit; color: #1a0d05; -webkit-text-fill-color: #1a0d05; -webkit-text-stroke: .07em #1a0d05; }
#ult-banner b.ub-name::after { content: attr(data-t); position: absolute; inset: 0; padding: inherit; -webkit-text-fill-color: transparent;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, .95) 50%, transparent 60%) no-repeat, linear-gradient(180deg, #ffffff 16%, #fff3c4 40%, #fbbf24 62%, var(--c) 96%);
  background-size: 240% 100%, 100% 100%; background-position: 130% 0, 0 0; -webkit-background-clip: text; background-clip: text; animation: ubShine 1.1s .2s ease-out both; }
#ult-banner small { position: static; transform: none; margin-top: -.5em; font: italic 600 clamp(11px, 1.3vw, 15px) 'Chakra Petch', 'Kanit', sans-serif; letter-spacing: .34em; }
#ult-banner i { position: relative; width: clamp(40px, 11vw, 170px); height: 2px; background: linear-gradient(90deg, transparent, var(--c) 55%, #fff); box-shadow: 0 0 12px var(--c); }
#ult-banner i::after { content: ''; position: absolute; right: -5px; top: -4px; width: 9px; height: 9px; background: #fff; transform: rotate(45deg); box-shadow: 0 0 10px 2px var(--c); }
#ult-banner .ub-flare { position: absolute; left: 50%; top: 55%; width: 130%; height: 240%; transform: translate(-50%, -50%); pointer-events: none; z-index: -2;
  background: radial-gradient(ellipse at center, color-mix(in srgb, var(--c) 46%, transparent) 0, transparent 62%); opacity: .0; animation: ubFlare 1.75s ease-out forwards; }
#ult-banner.cosmic b.ub-name::after { background-image: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, .95) 50%, transparent 60%), linear-gradient(180deg, #ffffff 12%, #e0f2fe 32%, #fde68a 56%, var(--c) 80%, #f0abfc 100%); }
#ult-banner.cosmic .ub-kicker { color: #fde68a; }
@keyframes ubIn {
  0% { opacity: 0; transform: translateX(-50%) scale(2.1) skewX(-14deg); filter: blur(6px); }
  10% { opacity: 1; transform: translateX(-50%) scale(.96) skewX(-5deg); filter: blur(0); }
  16% { transform: translateX(-50%) scale(1.03) skewX(-5deg); }
  22%, 74% { opacity: 1; transform: translateX(-50%) scale(1) skewX(-5deg); filter: blur(0); }
  100% { opacity: 0; transform: translateX(-46%) scale(1.08) skewX(-5deg); filter: blur(2px); }
}
@keyframes ubShine { from { background-position: 130% 0, 0 0; } to { background-position: -40% 0, 0 0; } }
@keyframes ubFlare { 0% { opacity: 0; } 9% { opacity: 1; } 60% { opacity: .5; } 100% { opacity: 0; } }
/* phones: the name sits under the top HUD, the cut-in band is slimmer */
body.ui-touch #ult-banner { gap: 8px; }
body.ui-port #ult-banner { top: 25%; }
body.ui-land #ult-banner { top: 21%; }
/* the punch-in: only the world scales, the HUD does not move */
body.ult-punch #game, body.ult-punch #game3d { animation: ultPunch .26s cubic-bezier(.2, .8, .3, 1); transform-origin: 50% 55%; }
@keyframes ultPunch { 0% { transform: scale(1); } 28% { transform: scale(1.045); } 100% { transform: scale(1); } }
/* cut-in of the cosmic ultimates */
#ult-cutin { position: fixed; left: 0; right: 0; top: 34%; height: clamp(84px, 17vh, 150px); z-index: 44; pointer-events: none; display: none; --c: #fbbf24; }
#ult-cutin.show { display: block; animation: ucIn 1.25s cubic-bezier(.2, .85, .25, 1) forwards; }
#ult-cutin .uc-band { position: absolute; inset: 0 -6%; transform: skewY(-4deg); overflow: hidden; display: flex; align-items: center; gap: clamp(10px, 3vw, 34px); padding: 0 12%;
  background: linear-gradient(90deg, rgba(8, 5, 20, .0) 0, rgba(8, 5, 20, .88) 14%, color-mix(in srgb, var(--c) 34%, rgba(8, 5, 20, .9)) 50%, rgba(8, 5, 20, .88) 86%, rgba(8, 5, 20, 0) 100%);
  border-top: 2px solid color-mix(in srgb, var(--c) 80%, #fff); border-bottom: 2px solid color-mix(in srgb, var(--c) 80%, #fff); box-shadow: 0 0 28px color-mix(in srgb, var(--c) 60%, transparent); }
#ult-cutin .uc-lines { position: absolute; inset: 0; opacity: .5; background: repeating-linear-gradient(90deg, transparent 0 26px, rgba(255, 255, 255, .16) 26px 28px, transparent 28px 61px, rgba(255, 255, 255, .09) 61px 64px); animation: ucLines .35s linear infinite; }
#ult-cutin canvas { position: relative; height: 150%; aspect-ratio: 1; image-rendering: pixelated; transform: skewY(4deg); filter: drop-shadow(0 0 10px var(--c)) drop-shadow(0 3px 0 rgba(0, 0, 0, .6)); animation: ucHero 1.25s cubic-bezier(.2, .85, .25, 1) both; }
#ult-cutin .uc-text { position: relative; display: flex; flex-direction: column; transform: skewY(4deg); min-width: 0; }
#ult-cutin .uc-text em { font: italic 700 clamp(10px, 1.3vw, 15px) 'Chakra Petch', 'Kanit', sans-serif; letter-spacing: .3em; color: #fde68a; text-shadow: 0 1px 2px #000; }
#ult-cutin .uc-text b { font: 700 clamp(20px, 3.4vw, 44px) 'Charmonman', 'Kanit', serif; color: #fff; line-height: 1.5; white-space: nowrap; text-shadow: 0 2px 0 rgba(10, 5, 2, .9), 0 0 16px var(--c); }
@keyframes ucIn { 0% { opacity: 0; clip-path: inset(48% 0 48% 0); } 12% { opacity: 1; clip-path: inset(0 0 0 0); } 78% { opacity: 1; clip-path: inset(0 0 0 0); } 100% { opacity: 0; clip-path: inset(48% 0 48% 0); } }
@keyframes ucHero { 0% { translate: -60vw 0; } 16% { translate: 0 0; } 80% { translate: 2vw 0; } 100% { translate: 40vw 0; } }
@keyframes ucLines { from { background-position: 0 0; } to { background-position: -64px 0; } }
body.ui-touch #ult-cutin { top: 38%; height: clamp(64px, 11vh, 96px); }
body.ui-touch #ult-cutin canvas { height: 118%; }
@media (prefers-reduced-motion: reduce) { body.ult-punch #game, body.ult-punch #game3d { animation: none; } #ult-cutin .uc-lines { animation: none; } }
/* <<< ULT BANNER v3.30 */
/* >>> NEWBIE BOXES v3.32 */
#nb-pop { position: fixed; inset: 0; z-index: 390; display: none; place-items: center; padding: 14px; background: radial-gradient(circle, rgba(8, 6, 26, .5), rgba(3, 2, 12, .86)); }
#nb-pop.show { display: grid; animation: nbFade .25s; }
@keyframes nbFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes nbPop { from { transform: translateY(14px) scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes nbSpin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.nb-card { position: relative; width: min(430px, 100%); max-height: calc(100dvh - 28px); overflow: auto; padding: 20px 20px 16px; border-radius: 18px; text-align: center; color: #f4f2ff; border: 1px solid rgba(251, 191, 36, .65); background: radial-gradient(420px 220px at 50% 0%, rgba(56, 189, 248, .28), transparent 70%), linear-gradient(180deg, #221a57, #0f0b2a); box-shadow: 0 24px 70px rgba(0, 0, 0, .7), 0 0 0 1px rgba(251, 191, 36, .2), 0 0 50px rgba(56, 189, 248, .25); animation: nbPop .35s cubic-bezier(.2, 1.3, .4, 1); }
.nb-glow { position: absolute; left: 50%; top: 70px; width: 230px; height: 230px; transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none; background: conic-gradient(from 0deg, rgba(251, 191, 36, .0), rgba(251, 191, 36, .28), rgba(251, 191, 36, 0) 25%, rgba(56, 189, 248, .25) 50%, rgba(251, 191, 36, 0) 75%, rgba(251, 191, 36, .28)); filter: blur(10px); animation: nbSpin 9s linear infinite; }
.nb-box { position: relative; width: 96px; height: 96px; image-rendering: pixelated; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .6)); }
.nb-kicker { position: relative; margin-top: 4px; font-size: 11px; font-weight: 800; letter-spacing: .14em; color: #7dd3fc; }
.nb-title { position: relative; margin: 2px 0 8px; font: 400 23px/1.2 'Lilita One', 'Kanit', sans-serif; letter-spacing: .02em; color: #fde68a; text-shadow: 0 2px 0 #3b2a05; }
.nb-desc { position: relative; margin-bottom: 12px; padding: 10px 12px; border-radius: 12px; font-size: 12.5px; line-height: 1.6; color: #dbe4ff; background: rgba(0, 0, 0, .28); border: 1px solid rgba(165, 155, 235, .25); }
.nb-list { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 12px; text-align: left; }
.nb-it { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 5px 8px; border-radius: 10px; font-size: 12.5px; background: rgba(0, 0, 0, .28); border: 1px solid rgba(165, 155, 235, .22); }
.nb-it img { width: 32px; height: 32px; flex: none; image-rendering: pixelated; }
.nb-it i { width: 32px; flex: none; text-align: center; font-style: normal; font-size: 20px; }
.nb-it span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb-it b { color: #fde68a; }
.nb-acts { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.nb-acts .btn-big { flex: 1 1 100%; }
.nb-note { position: relative; margin-top: 10px; font-size: 11.5px; line-height: 1.5; color: #a8a3cf; }
@media (max-width: 420px) { .nb-list { grid-template-columns: 1fr; } .nb-title { font-size: 20px; } }
@media (max-height: 480px) { .nb-card { width: min(640px, 100%); padding: 10px 14px; } .nb-box { width: 56px; height: 56px; } .nb-glow { top: 44px; } .nb-title { font-size: 18px; margin-bottom: 5px; } .nb-desc { margin-bottom: 8px; padding: 6px 10px; } .nb-list { grid-template-columns: repeat(3, 1fr); gap: 4px; margin-bottom: 8px; } .nb-it { padding: 3px 6px; font-size: 11.5px; } .nb-it img { width: 24px; height: 24px; } .nb-acts .btn-big { flex: 1 1 auto; } .nb-note { margin-top: 6px; } }
/* <<< NEWBIE BOXES v3.32 */
/* >>> POWER SAVE v3.33 */
/* the button: one more chip on the status strip, a little battery drawn in pixels */
#net-strip .ns-power { flex: 0 0 auto; padding: 7px 8px; cursor: pointer; }
#net-strip .ns-power:hover { filter: brightness(1.22); }
.ns-bat { position: relative; display: block; width: 15px; height: 9px; border: 2px solid #f1f5ff; box-shadow: 1px 1px 0 #070a18; }
.ns-bat::after { content: ''; position: absolute; right: -5px; top: 1px; width: 2px; height: 3px; background: #f1f5ff; }
.ns-bat i { position: absolute; left: 1px; top: 1px; bottom: 1px; width: 6px; background: #4ade80; }
body.ui-touch #hud #net-strip .ns-power { flex: 0 0 auto; padding: 4px 6px; }
body.ui-touch #hud #net-strip .ns-bat { width: 12px; height: 7px; border-width: 1px; box-shadow: none; }
body.ui-touch #hud #net-strip .ns-bat::after { right: -3px; top: 1px; width: 1px; height: 3px; }
body.ui-touch #hud #net-strip .ns-bat i { width: 5px; }
body.ui-port:not(.ui-big) #hud #net-strip #ns-fps-chip { display: none; }   /* portrait phones: the battery takes the place of the FPS chip */
/* the dark screen */
#ps-overlay { position: fixed; inset: 0; z-index: 4000; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 24px 18px calc(28px + env(safe-area-inset-bottom)); background: #000; color: #8f96b3; font-family: 'Kanit', 'Sarabun', sans-serif; text-align: center; touch-action: none; user-select: none; -webkit-user-select: none; }
#ps-overlay.show { display: flex; }
body.power-save #hud, body.power-save #game, body.power-save #game3d, body.power-save #panels { visibility: hidden !important; }   /* nothing underneath is painted */
body.power-save * { animation-play-state: paused !important; }
.ps-info { display: grid; gap: 8px; justify-items: center; width: min(360px, 100%); transition: transform 2s ease; }
.ps-clock { font: 400 64px/1 'Lilita One', 'Kanit', sans-serif; letter-spacing: .04em; color: #c9cee3; }
.ps-mode { font-size: 13px; letter-spacing: .08em; color: #5f6788; }
.ps-char { margin-top: 10px; font-size: 16px; color: #aab1cc; }
.ps-char b { color: #d4d9ec; font-weight: 600; }
.ps-bars { display: grid; gap: 5px; width: 100%; }
.ps-bar { position: relative; height: 5px; border-radius: 99px; background: #14172a; overflow: hidden; }
.ps-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; }
.ps-bar.hp i { background: #7f2a35; } .ps-bar.mp i { background: #243f7a; } .ps-bar.exp i { background: #7a6420; }
.ps-bar.exp { height: 16px; }
.ps-bar.exp em { position: absolute; inset: 0; font: 600 10.5px/16px 'Kanit', sans-serif; font-style: normal; color: #c9cee3; }
.ps-bot { min-height: 20px; font-size: 13px; color: #8f96b3; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-gain { font-size: 12.5px; color: #6f7799; }
.ps-warn { color: #d97706; } .ps-dim { color: #5f6788; }
.ps-slide { position: relative; width: min(340px, 100%); height: 56px; border-radius: 99px; background: #0d0f1c; border: 1px solid #262b45; overflow: hidden; outline: none; }
.ps-slide:focus-visible { border-color: #5f6788; }
.ps-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 99px; background: linear-gradient(90deg, rgba(74, 222, 128, .05), rgba(74, 222, 128, .28)); }
.ps-hint { position: absolute; inset: 0; display: grid; place-items: center; padding-left: 44px; font-size: 14px; letter-spacing: .06em; color: #5f6788; pointer-events: none; }
.ps-knob { position: absolute; left: 4px; top: 4px; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; cursor: grab; touch-action: none; background: radial-gradient(circle at 35% 30%, #3a4168, #1b1f38); border: 1px solid #4b5380; box-shadow: 0 0 14px rgba(120, 130, 190, .25); }
.ps-knob:active { cursor: grabbing; }
@media (max-height: 420px) { #ps-overlay { gap: 12px; padding-top: 10px; } .ps-clock { font-size: 40px; } .ps-char { margin-top: 2px; } .ps-slide { height: 48px; } .ps-knob { width: 38px; height: 38px; } }
/* <<< POWER SAVE v3.33 */
/* >>> HUD v3.37 */
/* ==========================================================================
   The screen laid out again (desktop · phone landscape · phone portrait). Nothing here adds or removes an element:
   the same pieces get a fixed place each, so that none covers another at any common size.
     desktop   top-left the hero · top-right the map with two rows of activity icons beside it, then status,
               quests and one helper row (bot + gift) · bottom: chat | action bar | a 4×2 menu block · exp along the edge
     landscape one row of round buttons from the map leftwards; the target bar under it
     portrait  a column of round buttons under the map; the target bar under the hero
   The glass is darker and bluer than before and every frame shares it.
   ========================================================================== */
body.ui {
  --hg-bg: linear-gradient(180deg, rgba(22, 24, 54, .9) 0%, rgba(9, 10, 26, .88) 100%);
  --hg-bg2: linear-gradient(180deg, rgba(15, 17, 40, .78) 0%, rgba(7, 8, 22, .76) 100%);
  --hg-edge: linear-gradient(160deg, rgba(255, 226, 150, .82) 0%, rgba(255, 226, 150, .14) 26%, rgba(120, 140, 255, .22) 64%, rgba(255, 214, 120, .58) 100%);
  --hg-edge2: linear-gradient(160deg, rgba(255, 255, 255, .24), rgba(255, 255, 255, .05) 45%, rgba(120, 140, 255, .26));
  --hg-shadow: 0 12px 30px rgba(0, 0, 0, .46), inset 0 1px 0 rgba(255, 255, 255, .08);
  --hg-r: 14px;
}
/* the hero card keeps its wordmark (✦ STARFALL ONLINE ✦) and takes the same glass as everything else */
body.ui #hud #hud-player {
  background: radial-gradient(ellipse 80% 120% at 0% 0%, rgba(86, 70, 170, .38), transparent 62%) padding-box, var(--hg-bg) padding-box, var(--hg-edge) border-box !important;
  border: 1px solid transparent !important; border-radius: 16px !important;
  box-shadow: var(--hg-shadow) !important;
}
body.ui #hud #menubar button.mb-main img.mi, body.ui-touch #hud #mobile-actions img.mi { image-rendering: pixelated; }

/* ---------------------------------------------------------------- desktop */
body.ui-desk { --sk: clamp(40px, 3.25vw, 54px); --edge: 12px; --foot: 22px; }
body.ui-desk #hud #hud-player, body.ui-desk #hud #minimap-box, body.ui-desk #hud #quest-tracker, body.ui-desk #hud #chat, body.ui-desk #hud #menubar,
body.ui-desk #hud #skillbar, body.ui-desk #hud #quickbar, body.ui-desk #hud #bot-panel, body.ui-desk #hud #gift-btn, body.ui-desk #hud #act-dock { -webkit-backdrop-filter: blur(10px) saturate(1.15); backdrop-filter: blur(10px) saturate(1.15); }
body.ui-desk #hud #hud-player { top: var(--edge); left: var(--edge); width: 322px; }
body.ui-desk #hud #buff-bar { top: 150px; left: 14px; }
body.ui-desk #hud #top-stack > #party-frame { top: 190px; left: var(--edge); }
body.ui-desk #hud #top-stack > #boss-dmg { top: 190px; }
/* activity icons: two rows of seven beside the map, the name of each shows under it on hover */
body.ui-desk #hud #act-dock {
  top: var(--edge); right: 238px; grid-template-columns: repeat(7, 40px); gap: 8px 7px; padding: 8px 10px;
  border: 1px solid transparent; border-radius: 16px; background: var(--hg-bg2) padding-box, var(--hg-edge2) border-box; box-shadow: var(--hg-shadow);
}
body.ui-desk #hud #act-dock.min { grid-template-columns: 22px; padding: 4px; background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
body.ui-desk #hud #act-dock .dock-btn { position: relative; width: 40px; }
body.ui-desk #hud #act-dock .dock-btn .pxi { width: 40px; height: 40px; padding: 8px; }
body.ui-desk #hud #act-dock .dock-btn span {
  display: block; position: absolute; left: 50%; top: calc(100% + 7px); transform: translateX(-50%); z-index: 9; padding: 3px 9px; border-radius: 8px; white-space: nowrap;
  background: rgba(8, 9, 22, .95); box-shadow: 0 0 0 1px rgba(255, 226, 150, .42), 0 6px 14px rgba(0, 0, 0, .5); font: 600 11.5px/1.3 'Kanit', sans-serif; opacity: 0; pointer-events: none; transition: opacity .12s;
}
body.ui-desk #hud #act-dock .dock-btn:hover span { opacity: 1; }
body.ui-desk #hud #act-dock .dock-head { left: -28px; top: 9px; }
body.ui-desk #hud #top-stack { top: var(--edge); left: 350px; right: 604px; }
body.ui-desk #hud.no-dock #top-stack { right: 240px; }
/* the right column: map · status · quests · then the bot and the gift side by side */
body.ui-desk #hud #hud-right { top: var(--edge); right: var(--edge); flex-flow: row wrap; align-content: flex-start; }
body.ui-desk #hud #hud-right > * { flex: 0 0 100%; min-width: 0; }
body.ui-desk #hud #hud-right > #net-strip { order: 2; flex: 0 0 calc(100% + 40px); max-width: calc(100% + 40px); }
body.ui-desk #hud #hud-right > #quest-tracker { order: 3; max-height: min(30vh, calc(100vh - 540px)); }
body.ui-desk #hud #hud-right > #bot-panel { order: 4; flex: 1 1 0; flex-direction: column; justify-content: center; }
body.ui-desk #hud #hud-right > #bot-panel .hotkey { display: none; }
body.ui-desk #hud #hud-right > #gift-btn { order: 5; flex: 0 0 auto; flex-direction: column; gap: 1px; padding: 4px 13px; }
body.ui-desk #prompts { right: 250px; }
/* bottom: the action bar is centred on the screen; the menu is a 4 × 2 block in the corner (its eighth cell is "all menus") */
body.ui-desk #hud #expbar { height: 10px; }
body.ui-desk #hud .sk { width: var(--sk); height: var(--sk); border-radius: 13px !important; }
body.ui-desk #hud .sk .ico-img { width: calc(var(--sk) - 14px); height: calc(var(--sk) - 14px); }
body.ui-desk #hud #skillbar { bottom: var(--foot); left: 50%; gap: 5px; padding: 8px 10px; }
body.ui-desk #hud #quickbar { bottom: calc(var(--foot) + var(--sk) + 26px); left: 50%; }
body.ui-desk #hud #chat { left: var(--edge); bottom: var(--foot); width: clamp(286px, 23vw, 380px); }
body.ui-desk #hud #chat-log { height: 118px; }
body.ui-desk #hud #chat .chat-tabs { gap: 3px; }
body.ui-desk #hud #chat .chat-tabs { overflow: hidden; }
body.ui-desk #hud #chat .chat-tabs > button { padding: 3px 7px; font-size: 11px; }
body.ui-desk #hud #chat-open-btn { left: var(--edge); bottom: var(--foot); }
body.ui-desk #hud:not(.mobile-nav-open) #menubar { right: var(--edge); bottom: var(--foot); display: grid; grid-template-columns: repeat(4, 48px); gap: 6px; padding: 8px; }
body.ui-desk #hud:not(.mobile-nav-open) #menubar > button.mb-main { width: 48px; height: 48px; }
body.ui-desk #hud:not(.mobile-nav-open) #menubar > button.mb-main span { display: block; }
body.ui-desk #hud #mobile-menu-toggle { right: calc(var(--edge) + 8px); bottom: calc(var(--foot) + 8px); width: 48px; height: 48px; border-radius: 14px; font-size: 20px; }
body.ui-desk #hud.mobile-nav-open #menubar { right: var(--edge); bottom: calc(var(--foot) + 64px); }
body.ui-desk #loot-feed { right: 252px; bottom: 150px; }
body.ui-desk #close-all { bottom: 160px; }
@media (max-width: 1439px) { body.ui-desk #hud #quickbar { bottom: calc(var(--foot) + var(--sk) + 26px); } }
/* narrower windows: the chat moves up, the action bar takes the room left of the menu block */
@media (max-width: 1199px) {
  body.ui-desk #hud #skillbar, body.ui-desk #hud #quickbar { left: calc((100vw - 238px) / 2); }
  body.ui-desk #hud #skillbar { gap: 4px; padding: 6px 7px; }
  body.ui-desk #hud #chat, body.ui-desk #hud #chat-open-btn { bottom: calc(var(--foot) + var(--sk) + 84px); width: 300px; }
  body.ui-desk #hud #chat-log { height: 96px; }
  body.ui-desk #hud #act-dock { grid-template-columns: repeat(4, 40px); }
  body.ui-desk #hud #top-stack { right: 462px; }
}
@media (max-height: 700px) { body.ui-desk #hud #hud-right > #quest-tracker { max-height: calc(100vh - 520px); } }

/* ---------------------------------------------------------------- phones (both ways up) */
body.ui-touch #hud .prem-badge.off { display: none !important; }   /* "not Premium" is not worth a row on a small screen */
body.ui-touch #hud #mob-bag, body.ui-touch #hud #mob-char, body.ui-touch #hud #mob-auto, body.ui-touch #hud #mob-ride {
  background: radial-gradient(circle at 50% 28%, #34408a, #0e1030 78%) padding-box, var(--hg-edge) border-box !important;
  box-shadow: 0 5px 14px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .18) !important;
}
body.ui-touch #hud #mob-auto.active { background: radial-gradient(circle at 50% 28%, #10b981, #064e3b 78%) padding-box, var(--hg-edge) border-box !important; box-shadow: 0 0 0 3px rgba(110, 231, 183, .6), 0 0 18px rgba(52, 211, 153, .75) !important; }
body.ui-touch #hud #mobile-actions img.mi { width: 24px; height: 24px; display: block; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .6)); }
/* landscape: menu · bag · hero · bot · mount · quests · gift in one row, nothing on top of anything */
body.ui-land { --tb: 46px; --tg: 50px; --tr: 140px; }
body.ui-land #hud #hud-player { width: 218px; }
body.ui-land #hud #mobile-menu-toggle, body.ui-land #hud #mob-bag, body.ui-land #hud #mob-char, body.ui-land #hud #mob-auto, body.ui-land #hud #mob-ride, body.ui-land #hud #gift-btn, body.ui-land #hud #quest-tracker.folded { top: 8px; width: var(--tb); height: var(--tb); }
body.ui-land #hud #mobile-menu-toggle { right: var(--tr); }
body.ui-land #hud #mob-bag { right: calc(var(--tr) + var(--tg)); }
body.ui-land #hud #mob-char { right: calc(var(--tr) + var(--tg) * 2); }
body.ui-land #hud #mob-auto { right: calc(var(--tr) + var(--tg) * 3); }
body.ui-land #hud #mob-ride { right: calc(var(--tr) + var(--tg) * 4); }
body.ui-land #hud #quest-tracker.folded { right: calc(var(--tr) + var(--tg) * 5); }
body.ui-land #hud #gift-btn { right: calc(var(--tr) + var(--tg) * 6); }
body.ui-land #hud #quest-tracker { top: 60px; right: 140px; }
body.ui-land #hud #top-stack { top: 60px; left: 236px; right: 344px; }
@media (max-width: 780px) {
  body.ui-land { --tb: 40px; --tg: 44px; --tr: 138px; }
  body.ui-land #hud #hud-player { width: 204px; }
  body.ui-land #hud #mobile-menu-toggle, body.ui-land #hud #mob-bag, body.ui-land #hud #mob-char, body.ui-land #hud #mob-auto, body.ui-land #hud #mob-ride { font-size: 17px; }
  body.ui-land #hud #top-stack { left: 220px; }
}
/* portrait: the column of round buttons starts under the map; the quest button sits beside the first one */
body.ui-port { --tc: 176px; --tg: 50px; }
body.ui-port #hud #mobile-menu-toggle { top: var(--tc); }
body.ui-port #hud #mob-bag { top: calc(var(--tc) + var(--tg)); }
body.ui-port #hud #mob-char { top: calc(var(--tc) + var(--tg) * 2); }
body.ui-port #hud #mob-auto { top: calc(var(--tc) + var(--tg) * 3); }
body.ui-port #hud #mob-ride { top: calc(var(--tc) + var(--tg) * 4); }
body.ui-port #hud #gift-btn { top: calc(var(--tc) + var(--tg) * 5); right: 8px; }
body.ui-port #hud #quest-tracker.folded { top: var(--tc); right: 62px; }
body.ui-port #hud #quest-tracker { top: calc(var(--tc) + 52px); right: 62px; }
body.ui-port #hud #top-stack { top: 136px; left: 8px; right: 148px; }
body.ui-port:not(.ui-big) #hud #minimap-box > #net-strip { right: 5px; justify-content: space-between; }
body.ui-big.ui-port { --tc: 222px; }   /* tablets: the map is taller */
body.ui-big.ui-port #hud #quest-tracker.folded { top: var(--tc); right: 66px; width: 46px; }
body.ui-big.ui-port #hud #quest-tracker { top: calc(var(--tc) + 56px); right: 66px; }
/* short or narrow portrait screens: two columns of smaller buttons, so the column ends above the quick slots */
@media (max-height: 700px), (max-width: 374px) {
  body.ui-port { --tc: 172px; --tg: 42px; }
  body.ui-port #hud #mob-char { top: calc(var(--tc) + var(--tg) * 2); }
  body.ui-port #hud #mob-auto { top: calc(var(--tc) + var(--tg) * 3); }
  body.ui-port #hud #mob-ride { top: calc(var(--tc) + var(--tg)); right: 54px; }
  body.ui-port #hud #gift-btn { top: calc(var(--tc) + var(--tg) * 2); right: 52px; width: 42px; height: 42px; }
  body.ui-port #hud #quest-tracker.folded { top: var(--tc); right: 54px; width: 38px; height: 38px; }
  body.ui-port #hud #quest-tracker { top: calc(var(--tc) + 132px); right: 54px; max-height: 96px; }
  body.ui-port #hud #top-stack { top: 134px; }
}
/* tablets: a taller map, so the column starts lower; larger steps; the row in landscape starts left of the wider map */
body.ui-big.ui-port { --tc: 222px; --tg: 54px; }
body.ui-big.ui-port #hud #mobile-menu-toggle { top: var(--tc); }
body.ui-big.ui-port #hud #mob-bag { top: calc(var(--tc) + var(--tg)); }
body.ui-big.ui-port #hud #mob-char { top: calc(var(--tc) + var(--tg) * 2); }
body.ui-big.ui-port #hud #mob-auto { top: calc(var(--tc) + var(--tg) * 3); }
body.ui-big.ui-port #hud #mob-ride { top: calc(var(--tc) + var(--tg) * 4); }
body.ui-big.ui-port #hud #gift-btn { top: calc(var(--tc) + var(--tg) * 5); }
body.ui-big.ui-port #hud #top-stack { top: 136px; right: 192px; }
body.ui-big.ui-land { --tr: 192px; --tg: 54px; }
body.ui-big.ui-land #hud #hud-player { width: 300px; }
body.ui-big.ui-land #hud #top-stack { left: 316px; right: 396px; }
body.ui-big.ui-land #hud #quest-tracker { right: 192px; }
/* ---------------------------------------------------------------- the ornate frame: gold brackets in the corners, a second line inside
   Every panel of the HUD wears it — the hero card set the style (gold on deep blue, the wordmark on top), the rest now match it. */
body.ui #hud #hud-player, body.ui #hud #minimap-box, body.ui #hud #quest-tracker, body.ui #hud #chat,
body.ui-desk #hud #skillbar, body.ui-desk #hud #act-dock, body.ui-desk #hud #bot-panel, body.ui-desk #hud:not(.mobile-nav-open) #menubar {
  --g: #edc765;
  background:
    linear-gradient(var(--g), var(--g)) left 5px top 5px / 14px 2px no-repeat padding-box, linear-gradient(var(--g), var(--g)) left 5px top 5px / 2px 14px no-repeat padding-box,
    linear-gradient(var(--g), var(--g)) right 5px top 5px / 14px 2px no-repeat padding-box, linear-gradient(var(--g), var(--g)) right 5px top 5px / 2px 14px no-repeat padding-box,
    linear-gradient(var(--g), var(--g)) left 5px bottom 5px / 14px 2px no-repeat padding-box, linear-gradient(var(--g), var(--g)) left 5px bottom 5px / 2px 14px no-repeat padding-box,
    linear-gradient(var(--g), var(--g)) right 5px bottom 5px / 14px 2px no-repeat padding-box, linear-gradient(var(--g), var(--g)) right 5px bottom 5px / 2px 14px no-repeat padding-box,
    radial-gradient(ellipse 70% 90% at 0% 0%, rgba(96, 78, 190, .34), transparent 64%) padding-box,
    var(--pane, var(--hg-bg)) padding-box, var(--hg-edge) border-box !important;
  border: 1.5px solid transparent !important;
  box-shadow: var(--hg-shadow), 0 0 0 1px rgba(4, 5, 14, .55), inset 0 0 0 1px rgba(4, 5, 14, .8), inset 0 0 0 2px rgba(255, 222, 140, .16) !important;
}
body.ui #hud #quest-tracker, body.ui #hud #chat { --pane: var(--hg-bg2); }
body.ui #hud #hud-player { padding: 10px 14px 11px 12px !important; }
/* titles sit on a ribbon: gold letters, a gold rule under them that fades out, a small lozenge at its head */
body.ui #hud .mm-head, body.ui #hud .qt-head {
  position: relative; padding: 2px 4px 6px 16px; margin-bottom: 6px; border-bottom: 0;
  background: linear-gradient(90deg, rgba(255, 214, 120, .2), rgba(255, 214, 120, 0) 78%) left bottom / 100% 100% no-repeat, linear-gradient(90deg, #f1cd6c, rgba(241, 205, 108, 0)) left bottom / 100% 1.5px no-repeat;
  border-radius: 6px 6px 0 0; color: #ffe9a8; font-weight: 700; text-shadow: 0 1px 2px #000;
}
body.ui #hud .mm-head::before, body.ui #hud .qt-head::before { content: ''; position: absolute; left: 4px; top: 50%; width: 7px; height: 7px; margin-top: -6px; transform: rotate(45deg); background: linear-gradient(135deg, #fff3c4, #e0a530); box-shadow: 0 0 6px rgba(255, 210, 110, .8); }
body.ui-touch #hud .mm-head { padding: 1px 2px 4px 13px; margin-bottom: 4px; }
body.ui-touch #hud #quest-tracker.folded { background: radial-gradient(circle at 50% 28%, #34408a, #0e1030 78%) padding-box, var(--hg-edge) border-box !important; border: 1px solid transparent !important; box-shadow: 0 5px 14px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .18) !important; }
body.ui-touch #hud #quest-tracker.folded .qt-head { padding: 0; margin: 0; background: none; }
body.ui-touch #hud #quest-tracker.folded .qt-head::before { position: static; width: auto; height: auto; margin: 0; transform: none; background: none; box-shadow: none; }
/* the map itself gets a bezel */
body.ui #hud #minimap { box-shadow: 0 0 0 1.5px #f1cd6c, 0 0 0 4px rgba(6, 7, 18, .9), 0 0 0 5px rgba(255, 222, 140, .35), inset 0 0 14px rgba(0, 0, 0, .6) !important; }

/* ---------------------------------------------------------------- desktop: the action bar as a centrepiece */
/* a jewel at each end of the bar */
body.ui-desk #hud #skillbar::before, body.ui-desk #hud #skillbar::after {
  content: ''; position: absolute; top: 50%; width: 17px; height: 17px; margin-top: -9px; transform: rotate(45deg); border-radius: 3px;
  background: linear-gradient(135deg, #fff6d0, #f0b93a 46%, #8f5f0e); box-shadow: 0 0 0 2px #080918, 0 0 0 3.5px rgba(255, 222, 140, .75), 0 0 16px rgba(255, 200, 90, .65);
}
body.ui-desk #hud #skillbar::before { left: -11px; }
body.ui-desk #hud #skillbar::after { right: -11px; }
/* life and mana over the bar, the level on a medal between them (filled by js/hud.js from the hero card's own bars) */
#hud-vitals { display: none; }
body.ui-desk #hud #hud-vitals {
  display: flex; align-items: center; position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(var(--foot) + var(--sk) + 19px); z-index: 4; pointer-events: none;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .55));
}
#hud-vitals .hv { position: relative; flex: 1 1 0; height: 17px; overflow: hidden; background: linear-gradient(180deg, #05060f, #11132b); box-shadow: inset 0 0 0 1.5px rgba(241, 205, 108, .75), inset 0 0 0 3px rgba(4, 5, 14, .9); }
#hud-vitals .hv.hp { border-radius: 999px 0 0 999px; margin-right: -14px; padding-right: 14px; }
#hud-vitals .hv.mp { border-radius: 0 999px 999px 0; margin-left: -14px; padding-left: 14px; }
#hud-vitals .hv i { position: absolute; top: 3px; bottom: 3px; width: calc((100% - 20px) * var(--p, 1)); transition: width .25s ease-out; }
#hud-vitals .hv.hp i { right: 14px; border-radius: 999px 0 0 999px; background: linear-gradient(180deg, #ffb1b1 0%, #f43f5e 38%, #be123c 62%, #7f1d1d 100%); box-shadow: 0 0 10px rgba(244, 63, 94, .6); }
#hud-vitals .hv.mp i { left: 14px; border-radius: 0 999px 999px 0; background: linear-gradient(180deg, #b6dcff 0%, #3b82f6 38%, #1d4ed8 62%, #172554 100%); box-shadow: 0 0 10px rgba(59, 130, 246, .6); }
#hud-vitals .hv span { position: absolute; inset: 0; display: flex; align-items: center; font: 700 10.5px/1 'Kanit', sans-serif; color: #fff; text-shadow: 0 1px 2px #000, 0 0 3px #000; letter-spacing: .02em; }
#hud-vitals .hv.hp span { justify-content: flex-start; padding-left: 12px; }
#hud-vitals .hv.mp span { justify-content: flex-end; padding-right: 12px; }
#hud-vitals .hv-lv {
  position: relative; z-index: 2; flex: 0 0 44px; width: 44px; height: 44px; margin: -14px 0; border-radius: 50%; display: grid; place-content: center; text-align: center;
  background: radial-gradient(circle at 50% 30%, #3b3690, #0d0e2a 72%); box-shadow: 0 0 0 2px #f1cd6c, 0 0 0 4px #080918, 0 0 0 5px rgba(255, 222, 140, .5), 0 0 16px rgba(255, 200, 90, .45);
}
#hud-vitals .hv-lv small { font: 700 7.5px/1 'Kanit', sans-serif; letter-spacing: .12em; color: #f1cd6c; }
#hud-vitals .hv-lv b { font: 700 16px/1.05 'Kanit', sans-serif; color: #fff; text-shadow: 0 1px 2px #000; }
#hud-vitals.low .hv.hp i { animation: hvLow .7s ease-in-out infinite; }
@keyframes hvLow { 50% { filter: brightness(1.7); } }
body.hud-hidden #hud-vitals { display: none !important; }
body.ui-desk #hud #quickbar { bottom: calc(var(--foot) + var(--sk) + 62px); }
@media (max-width: 1439px) { body.ui-desk #hud #quickbar { bottom: calc(var(--foot) + var(--sk) + 62px); } }
@media (max-width: 1199px) {
  body.ui-desk #hud #hud-vitals { left: calc((100vw - 238px) / 2); }
  body.ui-desk #hud #chat, body.ui-desk #hud #chat-open-btn { bottom: calc(var(--foot) + var(--sk) + 118px); }
}
/* the menu block: each entry a little crest */
body.ui-desk #hud:not(.mobile-nav-open) #menubar > button.mb-main {
  background: linear-gradient(180deg, #3b3690, #17163f 62%, #0d0e2a) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), inset 0 -3px 0 rgba(0, 0, 0, .35), 0 0 0 1px rgba(6, 7, 18, .9), 0 0 0 2px rgba(255, 222, 140, .42) !important;
}
body.ui-desk #hud:not(.mobile-nav-open) #menubar > button.mb-main:hover { background: linear-gradient(180deg, #5a4fd0, #26236a 62%, #14143c) !important; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 0 0 1px rgba(6, 7, 18, .9), 0 0 0 2px #f1cd6c, 0 0 16px rgba(255, 210, 110, .5) !important; transform: translateY(-1px); }
body.ui-desk #hud #menubar > button.mb-main span { color: #ffe9a8 !important; }
body.ui-desk #hud #mobile-menu-toggle { background: linear-gradient(180deg, #f6d77a, #c9902e) padding-box, var(--hg-edge) border-box; color: #3a2606; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 0 0 1px rgba(6, 7, 18, .9), 0 0 14px rgba(255, 200, 90, .45); }
/* activity icons: gold rim, a touch larger glow on the ones with news */
body.ui-desk #hud #act-dock .dock-btn .pxi { box-shadow: 0 0 0 1.5px #f1cd6c, 0 0 0 3.5px rgba(6, 7, 18, .9), 0 0 0 4.5px rgba(255, 222, 140, .28), 0 4px 10px rgba(0, 0, 0, .45); }
/* ---------------------------------------------------------------- skill slots: the picture is the slot
   A skill icon is drawn with its own frame (the metal of the frame tells the tier), so the slot adds none: the picture fills it
   edge to edge. Before, the picture sat in the top-left corner of a slot that carried two more rims — three frames in one. */
body.ui #hud .sk .ico-img { inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; border-radius: 0; image-rendering: auto; }
body.ui-desk #hud .sk {
  border-radius: 19% !important;   /* the corner of the drawn icon: 12 of 64 */
  background: #05060f !important; transition: transform .12s, box-shadow .12s;
  box-shadow: 0 0 0 1px rgba(4, 5, 14, .95), 0 3px 7px rgba(0, 0, 0, .55) !important;
}
body.ui-desk #hud .sk:hover { filter: none; transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(4, 5, 14, .95), 0 0 0 2.5px #f1cd6c, 0 0 14px rgba(255, 210, 110, .55), 0 5px 9px rgba(0, 0, 0, .5) !important; }
body.ui-desk #hud #skillbar { gap: 6px; }
/* the slots without a drawn picture (potions, the dodge, the job still to choose) get the same build: a lit face inside one metal rim */
body.ui-desk #hud .sk.pot, body.ui-desk #hud .sk.dodge, body.ui-desk #hud .sk.job-placeholder {
  border: 2px solid transparent !important;
  background:
    radial-gradient(circle at 50% 34%, color-mix(in srgb, var(--c) 50%, #1a1c3c), #06070f 76%) padding-box,
    linear-gradient(135deg, color-mix(in srgb, var(--c) 45%, #fff), color-mix(in srgb, var(--c) 72%, #000) 52%, color-mix(in srgb, var(--c) 60%, #fff)) border-box !important;
  box-shadow: inset 0 0 0 1px rgba(255, 236, 170, .28), 0 0 0 1px rgba(4, 5, 14, .95), 0 3px 7px rgba(0, 0, 0, .55) !important;
}
body.ui-desk #hud .sk.pot img { width: 66%; height: 66%; }
body.ui-desk #hud .sk.dodge .dodge-ico { font-size: calc(var(--sk) * .44); }
/* the key and the cost are plain lettering on the picture — no plate over the corner of the frame */
body.ui-desk #hud .sk .key { top: 2px; left: 4px; padding: 0; border-radius: 0; background: none; font: 700 10px/1.15 'Kanit', sans-serif; color: #fff3cf; text-shadow: -1px 0 #000, 1px 0 #000, 0 -1px #000, 0 1px #000, 0 0 3px #000; z-index: 2; }
body.ui-desk #hud .sk .mpc, body.ui-desk #hud .sk .cnt { right: 4px; bottom: 2px; font: 700 9.5px/1.1 'Kanit', sans-serif; text-shadow: -1px 0 #000, 1px 0 #000, 0 -1px #000, 0 1px #000, 0 0 3px #000; z-index: 2; }
body.ui-desk #hud .sk .cnt { color: #fff; }
/* the ultimate: a gold halo, and a light that crosses it now and then */
body.ui-desk #hud .sk.cosmic { animation: none; box-shadow: 0 0 0 1px rgba(4, 5, 14, .95), 0 0 0 2px rgba(253, 224, 71, .7), 0 0 14px rgba(253, 224, 71, .5), 0 3px 7px rgba(0, 0, 0, .55) !important; }
body.ui #hud .sk.cosmic:not(.locked)::after, body.ui #hud .sk.job-placeholder.ready::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen;
  background: linear-gradient(115deg, transparent 38%, rgba(255, 247, 204, .6) 50%, transparent 62%) 130% 0 / 260% 100% no-repeat; animation: skShine 3.6s ease-in-out infinite;
}
@keyframes skShine { 0%, 60% { background-position: 130% 0; } 100% { background-position: -40% 0; } }
@media (prefers-reduced-motion: reduce) { body.ui #hud .sk.cosmic::after, body.ui #hud .sk.job-placeholder::after { animation: none; opacity: 0; } }
/* the job still to choose (key 9): the emblem on a dark face, its word on a band — it was one flat orange block */
body.ui #hud .sk.job-placeholder { --c: #f59e0b; animation: none; }
body.ui #hud .sk.job-placeholder .job-ico { position: absolute; inset: 0 0 26% 0; width: auto; height: auto; display: flex; align-items: center; justify-content: center; font-size: calc(var(--sk, 48px) * .4); line-height: 1; filter: drop-shadow(0 0 5px rgba(255, 200, 90, .8)); }
body.ui #hud .sk.job-placeholder .lock { inset: auto 0 0 0; height: 30%; padding: 0; border-radius: 0; background: linear-gradient(180deg, #f8dc85, #c9902e) !important; color: #2a1a04 !important; font: 700 calc(var(--sk, 48px) * .185)/1 'Kanit', sans-serif; letter-spacing: -.2px; white-space: nowrap; }
body.ui #hud .sk.job-placeholder.locked .job-ico { filter: grayscale(1) brightness(.55); }
body.ui #hud .sk.job-placeholder.locked .lock { background: rgba(4, 5, 14, .86) !important; color: #fca5a5 !important; }
body.ui-desk #hud .sk.job-placeholder.ready { box-shadow: inset 0 0 0 1px rgba(255, 236, 170, .4), 0 0 0 1px rgba(4, 5, 14, .95), 0 0 12px rgba(245, 158, 11, .6), 0 3px 7px rgba(0, 0, 0, .55) !important; }

/* ---------------------------------------------------------------- phones and tablets: the skill pad
   Every size follows the skill button (--ss), so the pad keeps its proportions on any screen; the two arcs are given as a first
   angle and a step. With the old fixed angles the buttons of the inner arc touched (0–1 px apart) and the target button lay
   under the fourth skill. Now: at least 5 px between any two buttons, and the target button rides the attack button's shoulder.
   (scratch check: pad-solve.js on paper, pre-pad.js in the browser — both list every pair that is closer than that) */
body.ui-touch, body.ui-touch.ui-big, body.ui-port, body.ui-land {
  --atk: calc(var(--ss) * 1.68); --ps: calc(var(--ss) * .92); --ts: calc(var(--ss) * .78);
  --r1: calc(var(--ss) * 1.84); --r2: calc(var(--ss) * 2.84 + 10px);
  --tgr: calc(var(--atk) / 2 + var(--ts) / 2 + 5px);
  --d1: 36deg; --d2: 21.1deg;
}
body.ui-land { --ss: clamp(38px, 11.3vh, 46px); --cx: calc(var(--ss) * 1.9); --cy: calc(var(--ss) * 1.41); --a1: 192deg; --a2: 188deg; --ta: 334deg; }
body.ui-port { --ss: clamp(38px, 12.3vw, 48px); --cx: calc(var(--ss) * 1.58); --cy: calc(var(--ss) * 1.75); --a1: 181deg; --a2: 181deg; --ta: 322deg; }
@media (max-height: 700px) { body.ui-port { --ss: clamp(38px, 11.7vw, 42px); } }
body.ui-touch.ui-big.ui-port { --ss: 56px; --cx: calc(var(--ss) * 1.58); --cy: calc(var(--ss) * 1.62); }
body.ui-touch.ui-big.ui-land { --ss: 56px; --cx: calc(var(--ss) * 1.9); --cy: calc(var(--ss) * 1.5); --a1: 190deg; --a2: 186deg; }
body.ui-touch #hud #skillbar .sk:nth-child(1) { --a: var(--a1); }
body.ui-touch #hud #skillbar .sk:nth-child(2) { --a: calc(var(--a1) + var(--d1)); }
body.ui-touch #hud #skillbar .sk:nth-child(3) { --a: calc(var(--a1) + var(--d1) * 2); }
body.ui-touch #hud #skillbar .sk:nth-child(4) { --a: calc(var(--a1) + var(--d1) * 3); }
body.ui-touch #hud #skillbar .sk:nth-child(5) { --a: var(--a2); }
body.ui-touch #hud #skillbar .sk:nth-child(6) { --a: calc(var(--a2) + var(--d2)); }
body.ui-touch #hud #skillbar .sk:nth-child(7) { --a: calc(var(--a2) + var(--d2) * 2); }
body.ui-touch #hud #skillbar .sk:nth-child(8) { --a: calc(var(--a2) + var(--d2) * 3); }
body.ui-touch #hud #skillbar .sk:nth-child(9) { --a: calc(var(--a2) + var(--d2) * 4); }
body.ui-touch #hud #skillbar .sk:nth-child(10) { --a: calc(var(--a2) + var(--d2) * 5); }
body.ui-touch #hud #mob-target {
  width: var(--ts); height: var(--ts); font-size: calc(var(--ts) * .46); z-index: 8;
  right: calc(var(--cx) - cos(var(--ta)) * var(--tgr) - var(--ts) / 2); bottom: calc(var(--cy) - sin(var(--ta)) * var(--tgr) - var(--ts) / 2);
}
body.ui-port #hud #joystick { left: 16px; bottom: calc(var(--cy) + 6px); width: calc(var(--ss) * 2.58); height: calc(var(--ss) * 2.58); }
body.ui-port #hud #joy-knob { left: calc(var(--ss) * .79); top: calc(var(--ss) * .79); width: var(--ss); height: var(--ss); }
/* round buttons: the picture fills the circle (its square frame falls outside), one gold rim round it */
body.ui-touch #hud #skillbar .sk {
  border: 2px solid transparent !important; border-radius: 50% !important;
  background: linear-gradient(#06070f, #06070f) padding-box, linear-gradient(150deg, #fff3c4, #e9b744 36%, #8f5f0e 64%, #f1cd6c) border-box !important;
  box-shadow: 0 0 0 1.5px rgba(4, 5, 14, .9), 0 4px 10px rgba(0, 0, 0, .5) !important;
}
body.ui-touch #hud #skillbar .sk[data-skill] .ico-img { inset: -14%; width: 128%; height: 128%; }
body.ui-touch #hud #skillbar .sk.pot, body.ui-touch #hud #skillbar .sk.dodge {
  background: radial-gradient(circle at 50% 32%, color-mix(in srgb, var(--c) 55%, #1a1c3c), #06070f 78%) padding-box,
    linear-gradient(150deg, color-mix(in srgb, var(--c) 40%, #fff), var(--c) 50%, color-mix(in srgb, var(--c) 55%, #000)) border-box !important;
}
body.ui-touch #hud #skillbar .sk.pot img { width: 58%; height: 58%; }
body.ui-touch #hud #skillbar .sk.cosmic { animation: none; box-shadow: 0 0 0 1.5px rgba(4, 5, 14, .9), 0 0 12px rgba(253, 224, 71, .6), 0 4px 10px rgba(0, 0, 0, .5) !important; }
body.ui-touch #hud #skillbar .sk .mpc { bottom: 1px; padding: 0 4px; border-radius: 6px; background: rgba(4, 5, 14, .62); font-size: 8.5px; line-height: 1.25; }
body.ui-touch #hud #skillbar .sk .cnt { bottom: 1px; padding: 0 4px; border-radius: 6px; background: rgba(4, 5, 14, .62); line-height: 1.25; }
body.ui-touch #hud #skillbar .sk.job-placeholder { background: radial-gradient(circle at 50% 30%, #3a2a10, #0b0804 76%) padding-box, linear-gradient(150deg, #fff3c4, #e9b744 36%, #8f5f0e 64%, #f1cd6c) border-box !important; opacity: 1; filter: none; }
body.ui-touch #hud #skillbar .sk.job-placeholder .job-ico { inset: 4% 0 34% 0; font-size: calc(var(--ss) * .38); }
body.ui-touch #hud #skillbar .sk.job-placeholder .lock { inset: auto 0 0 0; height: 37%; align-items: flex-start; padding: 2px 0 0; border-radius: 0; font-size: calc(var(--ss) * .17); letter-spacing: -.3px; }
body.ui-touch #hud #skillbar .sk.job-placeholder.locked .lock { background: rgba(4, 5, 14, .86) !important; color: #fca5a5 !important; }
/* ---------------------------------------------------------------- the last pixels: pieces that still touched one another
   (each line answers a pair the scratch check pre-pad.js reported; it now reports none on ten screen sizes) */
/* portrait: the hero card stops 6 px short of the map, the row under the card starts 6 px below it, the round buttons 6 px under the map */
body.ui-port:not(.ui-big) #hud #hud-player { width: calc(100vw - 154px); min-width: 0; }
body.ui-port:not(.ui-big) #hud #top-stack { top: 142px; }
body.ui-port:not(.ui-big) { --tc: 179px; }
/* the chat peek sits above the joystick whatever its size (on tablets the larger joystick reached into it) */
body.ui-port #hud #chat.peek, body.ui-port #hud #chat-open-btn { bottom: calc(var(--cy) + var(--ss) * 2.58 + 16px); }
/* very narrow phones (320 px): a smaller map, and the seven round buttons in three short columns so they end above the quick slots */
@media (max-width: 340px) {
  body.ui-port:not(.ui-big) #hud #minimap-box { width: 110px; }
  body.ui-port:not(.ui-big) #hud #minimap { width: 96px; height: 96px; }
  body.ui-port:not(.ui-big) #hud #hud-player { width: calc(100vw - 132px); }
  body.ui-port:not(.ui-big) { --tc: 157px; }
  body.ui-port:not(.ui-big) #hud #mob-auto { top: calc(var(--tc) + var(--tg) * 2); right: 54px; }
  body.ui-port:not(.ui-big) #hud #gift-btn { top: var(--tc); right: 98px; }
}
/* landscape: the chat peek ends before the potion row; on short screens the map is smaller so the top of the skill pad clears it */
body.ui-land #hud #chat.peek { width: min(250px, calc(100vw - var(--cx) - var(--atk) / 2 - var(--ps) * 3 - 198px)); }
@media (max-height: 380px) {
  body.ui-land:not(.ui-big) #hud #minimap-box { width: 110px; }
  body.ui-land:not(.ui-big) #hud #minimap { width: 96px; height: 96px; }
}
@media (max-height: 340px) {
  body.ui-land:not(.ui-big) #hud #minimap-box { width: 86px; }
  body.ui-land:not(.ui-big) #hud #minimap { width: 72px; height: 72px; }
}
/* phones: the level rides on the avatar as a medal, so the name has its row to itself (it was cut down to "La…") */
body.ui-land { --av: 46px; }
body.ui-port { --av: 50px; }
body.ui-touch:not(.ui-big) #hud .hud-player-row { position: relative; }
body.ui-touch:not(.ui-big) #hud .lv-badge { position: absolute; left: calc(var(--av) / 2); top: calc(50% + var(--av) / 2 - 7px); transform: translateX(-50%); padding: 0 6px; font-size: 9.5px; line-height: 1.5; white-space: nowrap; z-index: 2; }
body.ui-touch:not(.ui-big) #hud #hud-name { max-width: none; flex: 0 1 auto; }
/* <<< HUD v3.37 */
