/* =====================================================================
   UX-слой (docs/UX-АУДИТ.md): метки вещей в сумке, «красные точки» HUD, вердикт тултипа,
   шанс заточки на вещи, ▲ в магазине, кнопка «Сложить камни» в Хранилище.
   Подключён последним. Заточка по-прежнему меняет только подсветку вещи — фон ячейки красится
   лишь у вещей, которые надеть нельзя (как в MU), и это не связано с заточкой.
   ===================================================================== */

/* ---------- метки на ячейках сумки ---------- */
/* ▲ — вещь сильнее надетой (Gear Score) и её можно надеть; правый нижний угол (стек — справа сверху, +N — слева сверху) */
#inv .item .upg, #inv .slot > .upg, .sh-card .upg {
  position: absolute; right: 1px; bottom: 1px; width: 14px; height: 14px; display: block; pointer-events: none; z-index: 3;
  filter: drop-shadow(0 0 1px #000) drop-shadow(0 1px 1px #000);
}
#inv .item .upg svg, #inv .slot > .upg svg, .sh-card .upg svg, #btn-inv .bdg-up svg { width: 100%; height: 100%; display: block; fill: #5fe07a; stroke: #0b2a10; stroke-width: 0.9; }
#inv .slot > .upg { right: -3px; bottom: -3px; width: 15px; height: 15px; animation: uxBob 1.4s ease-in-out infinite; }
#inv .slot.better { border-color: #5fe07a; }
/* нельзя надеть (класс, уровень, профессия) — красноватая ячейка, как в MU */
#inv .grid .item.cant { background: rgba(190, 40, 40, 0.26); box-shadow: inset 0 0 0 1px rgba(255, 90, 90, 0.45); }
#inv .grid .item.cant canvas { opacity: 0.8; }
/* «new» — пришла, пока сумка была закрыта; снимается при закрытии сумки */
#inv .item .new {
  position: absolute; left: 50%; bottom: 1px; transform: translateX(-50%); z-index: 3; pointer-events: none;
  padding: 0 3px; border-radius: 2px; background: #c81e1e; color: #fff; font: 800 11px/13px -apple-system, system-ui, sans-serif; font-style: normal;
  letter-spacing: 0.2px; box-shadow: 0 0 0 1px #000, 0 0 6px rgba(255, 60, 60, 0.6);
}
#inv .item.fresh canvas { animation: uxFresh 1.6s ease-in-out 2; }
/* фильтр сумки и режим заточки камнем — неподходящее приглушено */
#inv .grid .item.dim { opacity: 0.22; filter: grayscale(0.9); }
#inv .grid .item.dim .new, #inv .grid .item.dim .upg { display: none; }
/* шанс камня прямо на вещи в режиме заточки */
#inv .item .chance {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 3; pointer-events: none;
  padding: 1px 4px; border-radius: 3px; background: rgba(6, 26, 36, 0.86); border: 1px solid #6fd0ff; color: #bfeeff;
  font: 800 11px/13px -apple-system, system-ui, sans-serif; font-style: normal; white-space: nowrap;
}
#inv .item .chance.risk { border-color: #f0b44a; color: #ffd98a; }
/* двойное касание принято — короткая вспышка */
#inv .item.quick { animation: uxQuick 0.35s ease-out; }
#inv-tools.on { box-shadow: 0 0 0 2px #5fb8ff, 0 0 10px rgba(95, 184, 255, 0.6); }
#inv-sub .gs { color: #f4e36b; font-weight: 700; }
#inv-sub .flt { color: #8fd0ff; font-weight: 700; }

/* панель заточки камнем: имя камня, число подходящих вещей и правило шанса */
/* слева от сумки, над игровым полем — не закрывает шапку окна */
#enh-bar { white-space: normal; box-sizing: border-box; text-align: left; line-height: 1.25; justify-content: space-between;
  left: calc(6px + var(--sal, 0px)); right: auto; transform: none; width: calc(100vw - var(--inv-w, 0px) - 22px - var(--sal, 0px)); max-width: 420px; font-size: 12px; padding: 5px 6px 5px 8px; }
#enh-bar button { flex: none; min-width: 64px; }
#enh-bar > span { display: block; min-width: 0; }
#enh-bar em { display: block; font-style: normal; font-size: 11px; color: #8fc8dc; }

/* ---------- тултип: вердикт под названием, подсказка про двойное касание ---------- */
.tip .t-verdict { margin: 0; padding: 4px 8px 5px; font: 700 12.5px/1.3 -apple-system, system-ui, sans-serif; color: #c9d1db; background: rgba(255, 255, 255, 0.04); border-bottom: 1px solid #2c333d; }
.tip .t-verdict.up { color: #5fe07a; background: rgba(60, 200, 90, 0.10); }
.tip .t-verdict.down { color: #ff8a7a; background: rgba(220, 70, 60, 0.10); }
.tip .t-verdict.bad { color: #ff6b6b; background: rgba(220, 50, 50, 0.14); }
.tip .t-btns .t-dbl { flex: 1 0 100%; padding: 0; margin: -2px 0 -2px; font-size: 11px; line-height: 13px; color: #8a94a3; }

/* ---------- HUD: «красные точки» на кнопке «Сумка» ---------- */
#hud #btn-inv { overflow: visible; }
#btn-inv .bdg-n {
  position: absolute; right: 0; top: 0; z-index: 3; min-width: 18px; height: 18px; padding: 0 4px; box-sizing: border-box; border-radius: 9px;
  background: radial-gradient(circle at 40% 35%, #ff5a4a, #b4120c); color: #fff; font: 800 11px/18px -apple-system, system-ui, sans-serif; font-style: normal; text-align: center;
  box-shadow: 0 0 0 1.5px #2a0604, 0 1px 3px rgba(0, 0, 0, 0.7); pointer-events: none;
}
#btn-inv .bdg-up { position: absolute; left: 0; top: 0; z-index: 3; width: 16px; height: 16px; pointer-events: none; filter: drop-shadow(0 0 1px #000) drop-shadow(0 1px 2px #000); animation: uxBob 1.4s ease-in-out infinite; }
#btn-inv .bdg-n[hidden], #btn-inv .bdg-up[hidden] { display: none; }

/* ---------- магазин: ▲ на товаре, который сильнее надетого ---------- */
.sh-card { position: relative; }
.sh-card .upg { right: 3px; bottom: auto; top: 3px; width: 17px; height: 17px; }

/* ---------- Хранилище: «Сложить камни и материалы» одной кнопкой ---------- */
#stg-win .stg-dep { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 44px; margin: 0 0 6px; box-sizing: border-box;
  border: 1px solid #5d7a9a; border-radius: 3px; background: linear-gradient(#2a4566, #16263a); color: #e8f1ff; font: 700 12px/1.2 -apple-system, system-ui, sans-serif; }
#stg-win .stg-dep:disabled { filter: grayscale(0.85) brightness(0.6); }
#stg-win .stg-dep:active { transform: scale(0.97); filter: brightness(1.2); }

@keyframes uxBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
@keyframes uxFresh { 0%, 100% { filter: none; } 50% { filter: brightness(1.5) drop-shadow(0 0 4px #ffd36a); } }
@keyframes uxQuick { from { filter: brightness(2.2); transform: scale(1.08); } to { filter: none; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  #inv .slot > .upg, #btn-inv .bdg-up, #inv .item.fresh canvas, #inv .item.quick { animation: none; }
}
#enh-bar i { font-style: normal; }
#enh-bar.narrow .enh-l, #enh-bar.narrow em { display: none; }
#enh-bar.narrow > span b { display: block; }
#enh-bar.narrow button { min-width: 44px; width: 44px; padding: 0; display: flex; align-items: center; justify-content: center; }
#enh-bar.narrow button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
