/* ===== Апгрейд (#upgrade) ===== */
.upg { display: none; --ease-out: cubic-bezier(0.230, 1, 0.320, 1); }
body.is-upg .upg { display: block; max-width: 980px; margin: 0 auto; animation: cview-in 0.400s var(--ease-out); }
body.is-upg .promo,
body.is-upg .cases,
body.is-upg .cview,
body.is-upg .inv,
body.is-upg .dep,
body.is-upg .prof { display: none; }
.upg [hidden] { display: none !important; }

.upg__head { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.upg__ico {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(160deg, var(--accent-hi), var(--accent-deep));
  box-shadow: inset 0 1px 0 #ffffff66, 0 6px 18px rgb(var(--accent-rgb) / 0.450);
  color: #fff;
}
.upg__ico svg { width: 24px; height: 24px; fill: currentColor; }
.upg__title { margin: 0; font: 900 28px/1 var(--font-title); letter-spacing: -0.010em; color: #fff; }
.upg__hint { margin-left: auto; font: 700 12px/1.200 var(--font-title); letter-spacing: 0.040em; text-transform: uppercase; color: #6f7080; text-align: right; }

/* ---------- сцена ---------- */
.ustage {
  position: relative;
  margin-top: 14px;
  padding: 22px 14px 16px;
  overflow: hidden;
  border-radius: 26px;
  background:
    radial-gradient(70% 46% at 50% 22%, rgb(var(--accent-rgb) / 0.200), transparent 70%),
    repeating-linear-gradient(90deg, #ffffff05 0 1px, transparent 1px 44px),
    linear-gradient(180deg, #1d1c22, #131316);
  box-shadow: inset 0 0 0 1px #ffffff14;
}
/* декоративные «рельсы» по бокам сцены */
.ustage::before, .ustage::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 18px;
  background: linear-gradient(180deg, #ffffff0f, transparent 40%, #00000040);
  pointer-events: none;
}
.ustage::before { left: 0; border-right: 1px solid #ffffff0f; }
.ustage::after { right: 0; border-left: 1px solid #ffffff0f; }

/* ---------- круг ---------- */
.udial { position: relative; width: min(74vw, 300px); aspect-ratio: 1; margin: 0 auto; }
.udial::before {
  content: "";
  position: absolute;
  inset: -7%;
  border-radius: 50%;
  background: radial-gradient(closest-side, transparent 78%, rgb(var(--accent-rgb) / 0.220) 86%, transparent 100%);
  filter: blur(6px);
  transition: opacity 0.400s;
}
.udial__svg { position: relative; display: block; width: 100%; height: 100%; }
#upg-arc { transition: stroke-dasharray 0.500s var(--ease-out); filter: drop-shadow(0 0 6px rgb(var(--accent-rgb) / 0.750)); }
.udial__ptr { position: absolute; inset: 0; transform: rotate(0deg); will-change: transform; }
.udial__ptr i {
  position: absolute;
  left: 50%;
  top: 1.500%;
  width: 0;
  height: 0;
  translate: -50% 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 16px solid #fff;
  filter: drop-shadow(0 0 6px #fff) drop-shadow(0 2px 3px #000000b3);
}
.udial__core { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px; text-align: center; pointer-events: none; }
.udial__core b { font: 900 clamp(26px, 8.500vw, 38px)/1 var(--font-title); font-variant-numeric: tabular-nums; letter-spacing: -0.020em; color: #fff; text-shadow: 0 0 22px rgb(var(--accent-rgb) / 0.600); }
.udial__core span { font: 800 13px/1 var(--font-title); letter-spacing: 0.080em; text-transform: uppercase; color: var(--accent-hi); }
.upg[data-state="spin"] .udial::before { opacity: 0.500; }
.upg[data-state="win"] .udial__core b { color: #6fe0a8; text-shadow: 0 0 22px #3ddc9799; }
.upg[data-state="lose"] .udial__core b { color: #ff7a7a; text-shadow: 0 0 22px #ff4d4d80; }

/* ---------- слоты ---------- */
.uslots { display: grid; grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr); align-items: stretch; gap: 6px; margin-top: 18px; }
.uslots__arrow { display: grid; place-items: center; color: var(--accent-hi); }
.uslots__arrow svg { width: 22px; height: 22px; fill: currentColor; filter: drop-shadow(0 0 6px rgb(var(--accent-rgb) / 0.700)); }
.uslot {
  --r: #8d8d9b;
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  min-height: 148px;
  padding: 12px 8px 12px;
  overflow: hidden;
  border: 0;
  border-radius: 18px;
  background: #1a1b1e;
  box-shadow: inset 0 0 0 1px #ffffff14;
  color: #fff;
  cursor: pointer;
  transition: box-shadow 0.200s, transform 0.200s;
}
.uslot:hover { box-shadow: inset 0 0 0 1px #ffffff2e; }
.uslot:active { transform: scale(0.985); }
.uslot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.uslot.is-set {
  background: radial-gradient(90% 70% at 50% 0%, color-mix(in srgb, var(--r) 32%, transparent), transparent 72%), #1a1b1e;
  box-shadow: inset 0 0 0 1.500px color-mix(in srgb, var(--r) 70%, transparent);
}
.uslot.is-set::before { content: ""; position: absolute; left: 50%; top: 0; width: 44%; height: 4px; translate: -50% 0; border-radius: 0 0 6px 6px; background: var(--r); box-shadow: 0 0 12px var(--r); }
.uslot__img { width: 76%; max-width: 150px; height: auto; --w1: color-mix(in srgb, var(--r) 55%, #fff); --w2: var(--r); filter: drop-shadow(0 6px 10px #00000080); }
.uslot__img--ghost { --w1: #6b6c78; --w2: #4a4b55; opacity: 0.550; filter: none; }
.uslot__pick { padding: 9px 12px; border-radius: 12px; background: #2a2b31; font: 800 13px/1 var(--font-title); color: #e9e9f2; }
.uslot__text { display: grid; gap: 3px; justify-items: center; min-width: 0; max-width: 100%; }
.uslot__text small { font: 600 11px/1 var(--font-text); color: #b4b5c4; }
.uslot__text b { max-width: 100%; font: 800 14px/1.150 var(--font-title); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uslot__price { font: 900 14px/1 var(--font-title); font-variant-numeric: tabular-nums; color: color-mix(in srgb, var(--r) 45%, #fff); }

/* ---------- управление ---------- */
.uctl { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 8px; margin-top: 12px; }
.uctl__fast {
  display: grid;
  place-items: center;
  height: 48px;
  border: 0;
  border-radius: 14px;
  background: #26272d;
  box-shadow: inset 0 0 0 1px #ffffff14;
  color: #8d8d9b;
  cursor: pointer;
  transition: color 0.200s, box-shadow 0.200s, background-color 0.200s;
}
.uctl__fast svg { width: 22px; height: 22px; fill: currentColor; }
.uctl__fast.is-on { color: #fff; background: rgb(var(--accent-rgb) / 0.220); box-shadow: inset 0 0 0 1.500px var(--accent), 0 0 16px rgb(var(--accent-rgb) / 0.350); }
.uctl__fast:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.uctl .cta { --h: var(--accent); width: 100%; height: 48px; margin: 0; border: 0; border-radius: 14px; font: 900 15px/1 var(--font-title); }
.uctl .cta:disabled { background: #26272d; box-shadow: inset 0 0 0 1px #ffffff14; color: #7b7d8e; text-shadow: none; cursor: default; }
.uctl .cta:disabled::after { display: none; }
.umult { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-top: 8px; padding: 5px; border-radius: 16px; background: #1a1b1e; box-shadow: inset 0 0 0 1px #ffffff14; }
.umult button {
  display: grid;
  place-items: center;
  height: 40px;
  border: 0;
  border-radius: 11px;
  background: none;
  font: 800 14px/1 var(--font-title);
  font-variant-numeric: tabular-nums;
  color: #c9c9d6;
  cursor: pointer;
  transition: background-color 0.150s, color 0.150s;
}
.umult button svg { width: 20px; height: 20px; fill: currentColor; }
.umult button:hover:not(:disabled) { background: rgb(var(--accent-rgb) / 0.200); color: #fff; }
.umult button:disabled { color: #54556a; cursor: default; }
.umult button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.upg__msg { min-height: 0; margin-top: 10px; text-align: center; font-size: 13px; color: #e9e9f2; }
.upg__msg:empty { display: none; }
.upg[data-state="win"] .upg__msg { color: #6fe0a8; }
.upg[data-state="lose"] .upg__msg { color: #ff9a9a; }
.ustage .modal__note { margin-top: 10px; text-align: center; }

/* ---------- списки ---------- */
.ubox { margin-top: 14px; padding: 16px 12px; border-radius: 22px; }
.ubox .dcard__title { font: 900 19px/1.200 var(--font-title); }
.ubox .wgrid { max-height: 520px; overflow-y: auto; padding: 2px; margin: 12px -2px 0; scrollbar-width: thin; scrollbar-color: #ffffff2e transparent; }
.ubox .icard { cursor: pointer; min-height: 150px; transition: transform 0.200s, box-shadow 0.200s; }
.ubox .icard__type { margin-top: 82px; }
.ubox .icard:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ubox .icard.is-sel { box-shadow: inset 0 0 0 2px var(--accent), 0 0 20px rgb(var(--accent-rgb) / 0.450); transform: translateY(-2px); }
.ubox__empty { margin: 14px 0 4px; padding: 22px 12px; border-radius: 16px; background: #ffffff08; font: 600 14px/1.450 var(--font-text); color: var(--text-2); text-align: center; }

/* ---------- вопросы ---------- */
.ufaq { margin-top: 22px; }
.ufaq__title { margin: 0 0 10px; font: 900 19px/1 var(--font-title); color: #fff; }
.ufaq__item { margin-top: 8px; border-radius: 16px; background: #1a1b1e; box-shadow: inset 0 0 0 1px #ffffff0f; }
.ufaq__item summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  font: 800 15px/1.250 var(--font-title);
  color: #e9e9f2;
  cursor: pointer;
  list-style: none;
}
.ufaq__item summary::-webkit-details-marker { display: none; }
.ufaq__item summary::before {
  content: "";
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-right: 2.500px solid var(--accent-hi);
  border-bottom: 2.500px solid var(--accent-hi);
  rotate: -45deg;
  transition: rotate 0.200s;
}
.ufaq__item[open] summary::before { rotate: 45deg; }
.ufaq__item summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 16px; }
.ufaq__item p { margin: 0; padding: 0 16px 16px 36px; font: 500 14px/1.550 var(--font-text); color: var(--text-2); }

@media (min-width: 761px) {
  .ustage { padding: 28px 28px 20px; }
  .udial { width: 320px; }
  .uslots { max-width: 640px; margin-inline: auto; }
  .uctl, .umult { max-width: 640px; margin-inline: auto; }
  .ubox { padding: 20px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  body.is-upg .upg { animation: none; }
  #upg-arc { transition: none; }
}

/* итог прокрута остаётся на экране: сгоревшее гаснет, выигранное подсвечено */
.uslot.is-gone { filter: grayscale(1) brightness(0.650); }
.uslot.is-gone::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(135deg, #00000059 0 8px, transparent 8px 16px); pointer-events: none; }
.uslot.is-won { box-shadow: inset 0 0 0 2px #3ddc97, 0 0 26px #3ddc9780; animation: uslot-won 0.900s var(--ease-out); }
@keyframes uslot-won { 0% { transform: scale(0.940); } 55% { transform: scale(1.040); } 100% { transform: scale(1); } }
.udial__core b { font-size: clamp(24px, 8vw, 36px); }
@media (prefers-reduced-motion: reduce) { .uslot.is-won { animation: none; } }

/* ===== Вторая версия: компактнее, размеры как в образце; свои иконки и типографика ===== */
.upg__head { gap: 10px; margin-top: 8px; }
.upg__ico { width: 30px; height: 30px; border-radius: 0; background: none; box-shadow: none; color: var(--accent); filter: drop-shadow(0 0 8px rgb(var(--accent-rgb) / 0.700)); }
.upg__ico svg { width: 28px; height: 28px; }
.upg__title { font: 900 23px/1 var(--font-title); letter-spacing: -0.015em; }
.upg__hint { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 12px; background: #1a1b1e; box-shadow: inset 0 0 0 1px #ffffff12; font: 800 11px/1 var(--font-title); letter-spacing: 0.030em; color: #a9abbd; text-transform: none; }
.upg__hint svg { width: 15px; height: 15px; fill: var(--accent-hi); }

.ustage { margin-top: 12px; padding: 18px 12px 12px; border-radius: 22px; }
.ustage::before, .ustage::after { width: 12px; }
.udial { width: min(58vw, 216px); }
.udial__ptr i { border-left-width: 7px; border-right-width: 7px; border-top-width: 12px; }
.udial__core { gap: 5px; }
.udial__core b { font: 900 clamp(20px, 6.200vw, 27px)/1 var(--font-title); letter-spacing: -0.020em; }
.udial__core span { font: 800 10.500px/1 var(--font-title); letter-spacing: 0.100em; }

/* слоты: без карточки, предмет «стоит» на светящейся платформе */
.uslots { grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr); gap: 4px; margin-top: 10px; }
.uslots__arrow svg { width: 18px; height: 18px; }
.uslot, .uslot.is-set {
  gap: 6px;
  min-height: 0;
  padding: 6px 4px 22px;
  overflow: visible;
  border-radius: 14px;
  background: none;
  box-shadow: none;
}
.uslot:hover { box-shadow: none; }
.uslot.is-set::before { display: none; }
.uslot::after, .uslot.is-gone::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 4px;
  top: auto;
  height: 10px;
  border-radius: 6px;
  background:
    radial-gradient(circle at 50% 50%, var(--r) 0 2.500px, transparent 3.500px),
    linear-gradient(90deg, transparent 6%, var(--r) 6% 30%, transparent 30% 70%, var(--r) 70% 94%, transparent 94%) center / 100% 3px no-repeat,
    #101013;
  box-shadow: inset 0 0 0 1px #ffffff1f, 0 0 14px color-mix(in srgb, var(--r) 55%, transparent);
}
.uslot:not(.is-set) { --r: var(--accent); }
.uslot__img { width: 82%; max-width: 132px; }
.uslot__img--ghost { opacity: 0.700; --w1: #a9abbd; --w2: #6f7080; }
.uslot__pick { padding: 9px 12px; border-radius: 10px; background: #2a2b31; box-shadow: inset 0 1px 0 #ffffff1a; font: 800 12px/1 var(--font-title); letter-spacing: 0.010em; }
.uslot__text small { font: 700 10px/1 var(--font-title); letter-spacing: 0.050em; text-transform: uppercase; color: #8587a0; }
.uslot__text b { font: 800 13px/1.150 var(--font-title); }
.uslot__price { padding: 5px 9px; border-radius: 8px; background: #101013; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--r) 50%, transparent); font: 900 12px/1 var(--font-title); }
.uslot.is-won { box-shadow: none; }
.uslot.is-won .uslot__img { filter: drop-shadow(0 0 14px #3ddc97); }

/* управление: всё по 42–44px */
.uctl { grid-template-columns: 44px minmax(0, 1fr); gap: 6px; margin-top: 12px; }
.uctl__fast { height: 44px; border-radius: 12px; }
.uctl__fast svg { width: 19px; height: 19px; }
.uctl .cta { height: 44px; gap: 8px; border-radius: 12px; font: 900 14px/1 var(--font-title); letter-spacing: 0.010em; }
.uctl .cta svg { width: 18px; height: 18px; fill: currentColor; }
.ustep { display: grid; grid-template-columns: 40px 1fr 1fr; gap: 4px; margin-top: 6px; padding: 4px; border-radius: 14px; background: #1a1b1e; box-shadow: inset 0 0 0 1px #ffffff14; }
.ustep__ico { display: grid; place-items: center; color: #7b7d8e; }
.ustep__ico svg { width: 18px; height: 18px; fill: currentColor; }
.ustep button {
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: none;
  font: 800 13px/1 var(--font-title);
  color: #c9c9d6;
  cursor: pointer;
  transition: background-color 0.150s, color 0.150s;
}
.ustep button:hover:not(:disabled) { background: #2a2b31; color: #fff; }
.ustep button:active:not(:disabled) { background: rgb(var(--accent-rgb) / 0.250); }
.ustep button:disabled { color: #54556a; cursor: default; }
.ustep button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.umult { gap: 4px; margin-top: 6px; padding: 4px; border-radius: 14px; }
.umult button { height: 36px; border-radius: 10px; font: 800 13px/1 var(--font-title); }
.umult button svg { width: 18px; height: 18px; }
.upg__msg { font: 700 12.500px/1.400 var(--font-title); }
.ustage .modal__note { margin-top: 8px; font-size: 11px; }

/* списки */
.ubox { margin-top: 12px; padding: 14px 10px 12px; border-radius: 20px; }
.ubox__title { display: flex; align-items: center; gap: 8px; font: 900 16px/1.200 var(--font-title) !important; letter-spacing: -0.010em; }
.ubox__title svg { width: 20px; height: 20px; fill: var(--accent-hi); }
.ubox .wfil { grid-template-columns: 1.250fr 1fr 1fr; gap: 6px; margin-top: 12px; }
.ubox .wfil__sort { order: -1; grid-column: auto; }
.ubox .wfil__search { grid-column: 1 / -1; }
.ubox .wfil__num, .ubox .wfil__search, .ubox .wfil__sort { height: 40px; padding: 0 12px; border-radius: 12px; font: 700 13px/1 var(--font-title); }
.ubox .wfil__sort::after { display: none; }
.ubox .wgrid { gap: 6px; margin-top: 10px; }
.ubox .icard { min-height: 128px; padding: 8px 10px 10px; border-radius: 14px; }
.ubox .icard__img { top: 26px; }
.ubox .icard__type { margin-top: 70px; font-size: 10px; }
.ubox .icard__name { font-size: 13px; }
.ubox .icard__price { font-size: 12px; }
.ubox__empty { margin-top: 10px; padding: 18px 12px; font-size: 13px; }

/* вопросы */
.ufaq { margin-top: 18px; }
.ufaq__title { margin-bottom: 8px; font: 800 14px/1 var(--font-title); letter-spacing: 0.060em; text-transform: uppercase; color: #a9abbd; }
.ufaq__item { margin-top: 6px; border-radius: 12px; }
.ufaq__item summary { padding: 13px 14px; font: 700 14px/1.250 var(--font-title); }
.ufaq__item p { padding: 0 14px 14px 34px; font-size: 13px; }

@media (min-width: 761px) {
  .ustage { padding: 22px 24px 16px; }
  .udial { width: 240px; }
  .uslots, .uctl, .ustep, .umult { max-width: 560px; margin-inline: auto; }
  .ubox .wfil { grid-template-columns: 180px 120px 120px minmax(0, 1fr); }
  .ubox .wfil__search { grid-column: auto; }
}
/* кнопка сортировки: значок слева, короткая подпись */
.ubox .wfil__sort { display: flex; align-items: center; gap: 8px; white-space: nowrap; font-weight: 800; }
.ubox .wfil__sort::before { content: ""; flex: 0 0 auto; width: 16px; height: 12px; background: linear-gradient(#fff, #fff) 0 0 / 16px 2.500px no-repeat, linear-gradient(#fff, #fff) 0 50% / 11px 2.500px no-repeat, linear-gradient(#fff, #fff) 0 100% / 6px 2.500px no-repeat; }

/* ===== Фон сцены: реактор с иллюминатором; круг-индикатор сидит точно в его окне ===== */
.ustage {
  --d: min(58vw, 216px);
  padding-top: 0;
  background: #17111a;
}
.ustage::before, .ustage::after { display: none; }
.udial { width: var(--d); margin-top: calc(var(--d) * 0.340); margin-bottom: calc(var(--d) * 0.500); }
.udial::before { display: none; }
/* окно на картинке: центр 50% / 41,5%, радиус 250 из 1024 — отсюда коэффициенты */
.udial__bg {
  position: absolute;
  left: calc(var(--d) * -0.524);
  top: calc(var(--d) * -0.350);
  width: calc(var(--d) * 2.048);
  max-width: none;
  height: auto;
  -webkit-mask: linear-gradient(180deg, #000 0%, #000 72%, transparent 96%);
  mask: linear-gradient(180deg, #000 0%, #000 72%, transparent 96%);
  pointer-events: none;
  user-select: none;
}
.udial__svg, .udial__ptr, .udial__core { z-index: 1; }
.udial__svg { position: relative; }
/* в окне реактора свои кольца не нужны — оставляем дорожку шанса и ядро */
.udial__svg > circle:first-of-type { display: none; }
.uslots { position: relative; z-index: 1; margin-top: 0; }
.uctl, .ustep, .umult, .upg__msg, .ustage .modal__note { position: relative; z-index: 1; }
/* лёгкое «дыхание» свечения вокруг окна */
.udial::after {
  content: "";
  position: absolute;
  inset: -9%;
  border-radius: 50%;
  box-shadow: 0 0 34px 6px rgb(var(--accent-rgb) / 0.350);
  animation: reactor-pulse 3.200s ease-in-out infinite;
  pointer-events: none;
}
@keyframes reactor-pulse { 0%, 100% { opacity: 0.350; } 50% { opacity: 1; } }
.upg[data-state="spin"] .udial::after { animation-duration: 0.700s; }
@media (min-width: 761px) { .ustage { --d: 240px; } .udial { width: var(--d); } }
@media (prefers-reduced-motion: reduce) { .udial::after { animation: none; } }
/* на широком экране картинка уже сцены — растворяем её боковые края, чтобы не было «квадрата» */
@media (min-width: 620px) {
  .udial__bg {
    -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 72%, transparent 96%), linear-gradient(90deg, transparent 0%, #000 16%, #000 84%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 0%, #000 72%, transparent 96%), linear-gradient(90deg, transparent 0%, #000 16%, #000 84%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-composite: intersect;
  }
}

/* ===== «Дешевле / Дороже» и множители — третья версия ===== */
/* шаг цели: две стеклянные кнопки со стрелками, между ними цена текущей цели */
.ustep {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  gap: 6px;
  margin-top: 8px;
  padding: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}
.ustep button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(180deg, #2c2d34, #202126);
  box-shadow: inset 0 1px 0 #ffffff1f, inset 0 0 0 1px #ffffff14, 0 4px 10px #00000059;
  font: 800 13px/1 var(--font-title);
  letter-spacing: 0.010em;
  color: #e9e9f2;
  transition: box-shadow 0.180s, transform 0.120s, color 0.180s;
}
.ustep button svg { width: 16px; height: 16px; fill: currentColor; transition: transform 0.180s; }
.ustep button[data-step="-1"] svg { color: #5cc8ff; }
.ustep button[data-step="1"] svg { color: var(--accent-hi); }
.ustep button:hover:not(:disabled) { background: linear-gradient(180deg, #34353d, #24252b); color: #fff; }
.ustep button[data-step="-1"]:hover:not(:disabled) { box-shadow: inset 0 1px 0 #ffffff29, inset 0 0 0 1.500px #5cc8ff, 0 0 16px #5cc8ff59; }
.ustep button[data-step="1"]:hover:not(:disabled) { box-shadow: inset 0 1px 0 #ffffff29, inset 0 0 0 1.500px var(--accent), 0 0 16px rgb(var(--accent-rgb) / 0.400); }
.ustep button[data-step="-1"]:active:not(:disabled) svg { transform: translateY(2px); }
.ustep button[data-step="1"]:active:not(:disabled) svg { transform: translateY(-2px); }
.ustep button:active:not(:disabled) { transform: scale(0.975); background: linear-gradient(180deg, #24252b, #1c1d21); }
.ustep button:disabled { background: #1c1d21; box-shadow: inset 0 0 0 1px #ffffff0d; color: #54556a; }
.ustep button:disabled svg { color: #54556a; }
.ustep__val {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 4px;
  min-width: 92px;
  padding: 0 10px;
  border-radius: 12px;
  background: #101013;
  box-shadow: inset 0 0 0 1px rgb(var(--accent-rgb) / 0.350);
}
.ustep__val small { font: 800 9px/1 var(--font-title); letter-spacing: 0.120em; text-transform: uppercase; color: #6f7080; }
.ustep__val b { font: 900 14px/1 var(--font-title); font-variant-numeric: tabular-nums; color: #fff; }

/* множители: отдельные чипы, выбранный залит розовым */
.umult { gap: 6px; margin-top: 8px; padding: 0; border-radius: 0; background: none; box-shadow: none; }
.umult button {
  height: 40px;
  border-radius: 12px;
  background: #1c1d21;
  box-shadow: inset 0 0 0 1px #ffffff14;
  font: 900 14px/1 var(--font-title);
  letter-spacing: -0.010em;
  color: #c9c9d6;
  transition: background-color 0.180s, box-shadow 0.180s, color 0.180s, transform 0.120s;
}
.umult button:hover:not(:disabled) { background: #26272d; box-shadow: inset 0 0 0 1.500px rgb(var(--accent-rgb) / 0.650); color: #fff; }
.umult button:active:not(:disabled) { transform: scale(0.950); }
.umult button.is-active {
  background: linear-gradient(180deg, var(--accent-hi), var(--accent) 55%, var(--accent-deep));
  box-shadow: inset 0 1px 0 #ffffff80, 0 6px 16px rgb(var(--accent-rgb) / 0.450);
  color: #fff;
  text-shadow: 0 1px 2px #00000059;
}
.umult button:disabled { background: #18191c; box-shadow: inset 0 0 0 1px #ffffff0a; color: #4a4b5c; }
.umult button[data-k="rnd"] { color: var(--accent-hi); }
.umult button[data-k="rnd"]:disabled { color: #4a4b5c; }
.umult button[data-k="rnd"].is-active { color: #fff; }

/* «стеклянные» предметы в пустых слотах */
.uslot__ghost {
  width: 100%;
  max-width: 190px;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: contain;
  opacity: 0.900;
  filter: drop-shadow(0 0 14px #ffffff26) drop-shadow(0 8px 12px #00000080);
  pointer-events: none;
  user-select: none;
}
.uslot:not(.is-set) { padding-top: 0; gap: 2px; }

/* два «стеклянных» автомата в пустых слотах: крупнее, с мягким белым свечением */
.uslot__ghost { width: 112%; max-width: 230px; margin: -4px -6% -2px; opacity: 1; filter: drop-shadow(0 0 10px #ffffff40) drop-shadow(0 10px 14px #00000099); }
.uslots { gap: 0; grid-template-columns: minmax(0, 1fr) 14px minmax(0, 1fr); }
.uslots__arrow svg { width: 14px; height: 14px; }

/* ===== Анимация апгрейда ===== */
/* энергия в окне реактора: вращающийся вихрь, виден только во время прокрута */
.udial__fx {
  position: absolute;
  inset: 16%;
  z-index: 1;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 20%, rgb(var(--accent-rgb) / 0.550) 34%, transparent 46% 62%, #b06bff8c 76%, transparent 88%);
  filter: blur(7px);
  opacity: 0;
  transition: opacity 0.350s;
  pointer-events: none;
}
.upg[data-state="spin"] .udial__fx { opacity: 1; animation: upg-vortex 0.700s linear infinite; }
@keyframes upg-vortex { to { rotate: 360deg; } }

/* прокрут: стрелка светится, цифры пульсируют, реактор «разгоняется» */
.upg[data-state="spin"] .udial__ptr i { border-top-color: var(--accent-hi); filter: drop-shadow(0 0 10px var(--accent)) drop-shadow(0 0 3px #fff); }
.upg[data-state="spin"] .udial__core b { animation: upg-beat 0.420s ease-in-out infinite alternate; }
@keyframes upg-beat { from { transform: scale(1); opacity: 0.800; } to { transform: scale(1.080); opacity: 1; } }
.upg[data-state="spin"] .udial__bg { animation: upg-charge 0.900s ease-in-out infinite alternate; }
@keyframes upg-charge { from { filter: brightness(1) saturate(1); } to { filter: brightness(1.300) saturate(1.350); } }
.upg[data-state="spin"] #upg-arc { animation: upg-arc 0.600s ease-in-out infinite alternate; }
@keyframes upg-arc { from { opacity: 0.750; } to { opacity: 1; } }

/* свой предмет «засасывает» в реактор, цель ждёт и мерцает */
.upg[data-state="spin"] #upg-src .uslot__img { animation: upg-feed 0.900s cubic-bezier(0.550, 0, 0.850, 0.360) forwards; }
@keyframes upg-feed {
  0% { transform: translateY(0) scale(1) rotate(0deg); opacity: 1; }
  35% { transform: translateY(8%) scale(1.060) rotate(-4deg); opacity: 1; }
  100% { transform: translateY(-260%) scale(0.120) rotate(22deg); opacity: 0; filter: brightness(2.500) drop-shadow(0 0 14px var(--accent)); }
}
.upg[data-state="spin"] #upg-src .uslot__text,
.upg[data-state="spin"] #upg-src .uslot__price { animation: upg-fade 0.600s 0.300s forwards; }
@keyframes upg-fade { to { opacity: 0.250; } }
.upg[data-state="spin"] #upg-dst .uslot__img { animation: upg-wait 0.550s ease-in-out infinite alternate; }
@keyframes upg-wait { from { transform: translateY(0) scale(1); filter: brightness(1) drop-shadow(0 6px 10px #00000080); } to { transform: translateY(-4px) scale(1.040); filter: brightness(1.350) drop-shadow(0 0 16px var(--r)); } }
.upg[data-state="spin"] .uslots__arrow svg { animation: upg-arrow 0.500s ease-in-out infinite; }
@keyframes upg-arrow { 0%, 100% { transform: translateX(-3px); opacity: 0.500; } 50% { transform: translateX(3px); opacity: 1; } }

/* вспышка */
.udial__flash { position: absolute; inset: -30%; z-index: 2; border-radius: 50%; opacity: 0; pointer-events: none; }
.udial__flash.is-win { background: radial-gradient(closest-side, #ffffffe6 0%, #6fe0a8cc 26%, #3ddc9766 48%, transparent 70%); }
.udial__flash.is-lose { background: radial-gradient(closest-side, #ffffffb3 0%, #ff4d4dcc 24%, #ff4d4d4d 46%, transparent 68%); }
.udial__flash.is-on { animation: upg-flash 0.900s cubic-bezier(0.230, 1, 0.320, 1) forwards; }
@keyframes upg-flash { 0% { opacity: 0; transform: scale(0.300); } 18% { opacity: 1; } 100% { opacity: 0; transform: scale(1.250); } }

/* искры */
.udial__sparks { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.udial__sparks i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--s);
  height: var(--s);
  margin: calc(var(--s) / -2);
  border-radius: 50%;
  background: #6fe0a8;
  box-shadow: 0 0 10px 2px #3ddc97;
  animation: upg-spark var(--t) cubic-bezier(0.160, 0.840, 0.300, 1) forwards;
}
.udial__sparks.is-win i:nth-child(3n) { background: #fff; box-shadow: 0 0 10px 2px #fff; }
.udial__sparks.is-win i:nth-child(3n + 1) { background: var(--accent-hi); box-shadow: 0 0 10px 2px var(--accent); }
.udial__sparks.is-lose i { background: #ff7a7a; box-shadow: 0 0 8px 1px #ff4d4d; }
@keyframes upg-spark {
  0% { transform: rotate(var(--a)) translateY(0) scale(1); opacity: 1; }
  100% { transform: rotate(var(--a)) translateY(calc(var(--d) * -1.800)) scale(0.200); opacity: 0; }
}

/* итог: победа — зелёная дуга и «прыжок» цели; проигрыш — красная дуга и встряска сцены */
.upg[data-state="win"] #upg-arc { stroke: #3ddc97; filter: drop-shadow(0 0 8px #3ddc97); }
.upg[data-state="lose"] #upg-arc { stroke: #ff4d4d; filter: drop-shadow(0 0 8px #ff4d4d); opacity: 0.800; }
.upg[data-state="win"] .udial::after { box-shadow: 0 0 40px 10px #3ddc9780; animation-duration: 1.200s; }
.upg[data-state="lose"] .udial::after { box-shadow: 0 0 34px 6px #ff4d4d66; }
.upg[data-state="win"] .udial__core b { animation: upg-pop 0.700s cubic-bezier(0.230, 1, 0.320, 1); }
@keyframes upg-pop { 0% { transform: scale(0.500); opacity: 0; } 60% { transform: scale(1.200); opacity: 1; } 100% { transform: scale(1); } }
.upg[data-state="lose"] .ustage { animation: upg-shake 0.450s ease-in-out; }
@keyframes upg-shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
.upg[data-state="lose"] #upg-src .uslot__img { animation: upg-burn 0.800s ease-out forwards; }
@keyframes upg-burn { 0% { filter: brightness(2) sepia(1) saturate(6) hue-rotate(-30deg); transform: scale(1.080); } 100% { filter: grayscale(1) brightness(0.500); transform: scale(0.940) rotate(-6deg); } }
.upg[data-state="win"] #upg-dst .uslot__img { animation: upg-prize 1s cubic-bezier(0.230, 1, 0.320, 1); }
@keyframes upg-prize { 0% { transform: translateY(-120%) scale(0.300); opacity: 0; } 55% { transform: translateY(6%) scale(1.180); opacity: 1; } 100% { transform: translateY(0) scale(1); } }

@media (prefers-reduced-motion: reduce) {
  .upg[data-state] .udial__fx, .upg[data-state] .udial__bg, .upg[data-state] .udial__core b, .upg[data-state] #upg-arc,
  .upg[data-state] .uslot__img, .upg[data-state] .uslot__text, .upg[data-state] .uslot__price,
  .upg[data-state] .uslots__arrow svg, .upg[data-state] .ustage, .udial__flash.is-on { animation: none; }
}

/* ===== Окно реактора во время прокрута: вместо размытого вихря — чёткие кольца-сканеры и расходящиеся импульсы ===== */
.udial__fx,
.upg[data-state="spin"] .udial__fx {
  inset: 19%;
  background: none;
  filter: none;
  animation: none;
  rotate: none;
}
.udial__fx::before, .udial__fx::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
/* внешнее кольцо: тонкие штрихи, бегут по часовой */
.udial__fx::before {
  inset: 0;
  border: 2px dashed rgb(var(--accent-rgb) / 0.850);
  -webkit-mask: conic-gradient(#000 0 28%, transparent 40% 60%, #000 72% 100%);
  mask: conic-gradient(#000 0 28%, transparent 40% 60%, #000 72% 100%);
}
/* внутреннее кольцо: короткая яркая дуга-«сканер», против часовой */
.udial__fx::after {
  inset: 13%;
  border: 2px solid transparent;
  border-top-color: #fff;
  border-right-color: rgb(var(--accent-rgb) / 0.700);
  box-shadow: 0 0 10px rgb(var(--accent-rgb) / 0.450) inset;
}
.upg[data-state="spin"] .udial__fx::before { animation: upg-ring 1.600s linear infinite; }
.upg[data-state="spin"] .udial__fx::after { animation: upg-ring 0.900s linear infinite reverse; }
@keyframes upg-ring { to { rotate: 360deg; } }

/* импульсы из центра: три тонких кольца расходятся одно за другим */
.udial__core::before, .udial__core::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  border: 1.500px solid rgb(var(--accent-rgb) / 0.900);
  opacity: 0;
  pointer-events: none;
}
.upg[data-state="spin"] .udial__core::before { animation: upg-ripple 1.100s ease-out infinite; }
.upg[data-state="spin"] .udial__core::after { animation: upg-ripple 1.100s ease-out 0.550s infinite; }
@keyframes upg-ripple { 0% { transform: scale(0.500); opacity: 0.900; } 100% { transform: scale(1.950); opacity: 0; } }

/* цифры во время прокрута: спокойное «дыхание» без мигания */
.upg[data-state="spin"] .udial__core b { animation: upg-beat2 0.800s ease-in-out infinite alternate; }
@keyframes upg-beat2 { from { transform: scale(1); } to { transform: scale(1.050); } }
/* фон реактора больше не мигает яркостью — только лёгкое усиление */
.upg[data-state="spin"] .udial__bg { animation: none; filter: brightness(1.120) saturate(1.150); transition: filter 0.400s; }
.udial__bg { transition: filter 0.400s; }

@media (prefers-reduced-motion: reduce) {
  .upg[data-state] .udial__fx::before, .upg[data-state] .udial__fx::after,
  .upg[data-state] .udial__core::before, .upg[data-state] .udial__core::after { animation: none; }
}

/* ===== Анимация, вторая версия: экран подъезжает к кругу, кнопки прячутся, предметы остаются на платформах ===== */
.ustage { scroll-margin-top: calc(var(--header-h) + 8px); }
/* кнопки под слотами сворачиваются на время прокрута и показа итога */
.uctl, .ustep, .umult { max-height: 60px; transition: max-height 0.450s var(--ease-out), opacity 0.300s, margin-top 0.450s var(--ease-out), transform 0.450s var(--ease-out); }
.ustage .modal__note, .upg__msg { transition: opacity 0.300s; }
.upg[data-hold] .uctl, .upg[data-hold] .ustep, .upg[data-hold] .umult { max-height: 0; margin-top: 0; opacity: 0; transform: translateY(10px); overflow: hidden; pointer-events: none; }
.upg[data-hold] .ustage .modal__note { opacity: 0; }

/* предметы никуда не улетают: оба слегка парят над платформами, платформы «бегут» огнями */
.upg[data-state="spin"] #upg-src .uslot__img,
.upg[data-state="spin"] #upg-dst .uslot__img { animation: upg-hover 1.100s ease-in-out infinite alternate; }
.upg[data-state="spin"] #upg-dst .uslot__img { animation-delay: -0.550s; }
@keyframes upg-hover { from { transform: translateY(2px); filter: drop-shadow(0 6px 10px #00000080); } to { transform: translateY(-5px); filter: drop-shadow(0 12px 14px #00000080) drop-shadow(0 0 12px var(--r)); } }
.upg[data-state="spin"] #upg-src .uslot__text, .upg[data-state="spin"] #upg-src .uslot__price { animation: none; }
.upg[data-state="spin"] .uslot::after { animation: upg-rail 0.700s linear infinite; }
@keyframes upg-rail { 0% { filter: brightness(0.800); } 50% { filter: brightness(1.700); } 100% { filter: brightness(0.800); } }

/* табличка под выбранным предметом */
.uslot__plate {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 3px;
  width: 92%;
  max-width: 150px;
  padding: 8px 8px 7px;
  border-radius: 12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--r) 34%, #17171b), color-mix(in srgb, var(--r) 12%, #131316));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--r) 45%, transparent), 0 8px 18px color-mix(in srgb, var(--r) 22%, transparent);
}
.uslot__plate::before { content: ""; position: absolute; left: 50%; top: -1px; width: 34%; height: 3px; translate: -50% 0; border-radius: 0 0 4px 4px; background: var(--r); box-shadow: 0 0 10px var(--r); }
.uslot__plate small { font: 700 9px/1 var(--font-title); letter-spacing: 0.080em; text-transform: uppercase; color: color-mix(in srgb, var(--r) 40%, #c9c9d6); }
.uslot__plate b { max-width: 100%; font: 800 13px/1.100 var(--font-title); color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uslot__plate em { font: 900 12px/1 var(--font-title); font-style: normal; font-variant-numeric: tabular-nums; color: #fff; opacity: 0.900; }
.uslot.is-set { padding-top: 2px; gap: 4px; }
.uslot.is-set .uslot__img { width: 74%; max-width: 124px; }
.uslot.is-gone .uslot__plate { background: #1a1b1e; box-shadow: inset 0 0 0 1px #ffffff14; }

/* итог в центре: три шеврона вверх (удача) или вниз (мимо), загораются по очереди */
.uarrows { display: inline-flex; gap: 7px; align-items: center; height: 1em; }
.uarrows i {
  width: 0.420em;
  height: 0.420em;
  border-left: 0.130em solid currentColor;
  border-top: 0.130em solid currentColor;
  border-radius: 1px;
  opacity: 0.250;
}
.uarrows.is-up i { rotate: 45deg; animation: upg-chev-up 0.900s ease-in-out infinite; }
.uarrows.is-down i { rotate: 225deg; animation: upg-chev-down 0.900s ease-in-out infinite; }
.uarrows i:nth-child(2) { animation-delay: 0.150s; }
.uarrows i:nth-child(3) { animation-delay: 0.300s; }
@keyframes upg-chev-up { 0%, 100% { opacity: 0.250; translate: 0 3px; } 40% { opacity: 1; translate: 0 -3px; } }
@keyframes upg-chev-down { 0%, 100% { opacity: 0.250; translate: 0 -3px; } 40% { opacity: 1; translate: 0 3px; } }
.upg[data-state="win"] .udial__core b, .upg[data-state="lose"] .udial__core b { animation: upg-pop 0.600s cubic-bezier(0.230, 1, 0.320, 1); }
.upg[data-state="win"] .udial__core span { color: #6fe0a8; }
.upg[data-state="lose"] .udial__core span { color: #ff9a9a; }
/* цветное зарево в окне реактора под итог */
.upg[data-state="win"] .udial__svg > circle:nth-of-type(4) { fill: #0f2a20; transition: fill 0.400s; }
.upg[data-state="lose"] .udial__svg > circle:nth-of-type(4) { fill: #2e1014; transition: fill 0.400s; }
.upg[data-state="lose"] #upg-arc { opacity: 0.350; }
/* встряску сцены убираем — итог и так читается */
.upg[data-state="lose"] .ustage { animation: none; }

@media (prefers-reduced-motion: reduce) {
  .uctl, .ustep, .umult { transition: none; }
  .uarrows i, .upg[data-state] .uslot::after { animation: none; opacity: 1; }
}
/* шевроны итога крупнее */
.uarrows { gap: 10px; font-size: 1.700em; height: 0.800em; }
.uarrows i { border-left-width: 0.150em; border-top-width: 0.150em; }
/* шевроны итога: точные размеры в пикселях (на span действует размер подписи) */
.udial__core .uarrows { gap: 9px; height: 26px; font-size: 16px; letter-spacing: 0; }
.udial__core .uarrows i { width: 16px; height: 16px; border-left-width: 4.500px; border-top-width: 4.500px; border-radius: 2px; }

/* ===== Панели «Мои предметы» и «Желаемый предмет» (новый вид) ===== */
.uboxes { display: grid; gap: 12px; margin-top: 12px; }
#upg .ubox { display: flex; flex-direction: column; margin: 0; padding: 0 0 10px; overflow: hidden; border-radius: 22px;
  background: linear-gradient(180deg, #1c1a21, #141318); box-shadow: inset 0 0 0 1px #ffffff12, 0 10px 30px #00000059; }
/* шапка панели: значок, название, справа — управление; под ней тонкая линия */
.ubox__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 58px; padding: 10px 12px 10px 14px;
  border-bottom: 1px solid #ffffff10; background: linear-gradient(90deg, rgb(var(--accent-rgb) / 0.100), transparent 65%); }
#upg .ubox__title { display: flex; align-items: center; gap: 10px; min-width: 0; margin: 0; font: 900 16px/1.200 var(--font-title) !important;
  letter-spacing: -0.010em; color: #fff; white-space: nowrap; }
#upg .ubox__title svg { flex: 0 0 auto; width: 30px; height: 30px; padding: 6px; border-radius: 10px; fill: #fff; rotate: -6deg;
  background: linear-gradient(145deg, #8cc8ff, var(--accent) 55%, var(--accent-deep)); box-shadow: inset 0 1px 0 #ffffff66, 0 4px 12px rgb(var(--accent-rgb) / 0.400); }
.ubox__count { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: #ffffff14; font: 800 11px/1 var(--font-title); color: #c9c9d6; }

/* выбор игры в «Мои предметы» */
.ugame { display: flex; flex: 0 0 auto; gap: 2px; padding: 3px; border-radius: 12px; background: #0e0d12; box-shadow: inset 0 0 0 1px #ffffff12; }
.ugame button { --g: var(--accent); height: 30px; padding: 0 10px; border: 0; border-radius: 9px; background: none; cursor: pointer;
  font: italic 900 12px/1 var(--font-title); color: #7c7d8c; transition: color 0.200s, background-color 0.200s, box-shadow 0.200s; }
.ugame button[data-g="cs2"] { --g: #ff9d2e; }
.ugame button[data-g="standoff"] { --g: #38b6f0; }
.ugame button:hover { color: color-mix(in srgb, var(--g) 60%, #fff); }
.ugame button.is-active { color: #fff; background: color-mix(in srgb, var(--g) 24%, transparent);
  box-shadow: inset 0 0 0 1.500px var(--g), 0 0 12px color-mix(in srgb, var(--g) 40%, transparent); }
.ugame button:focus-visible { outline: 2px solid var(--g); outline-offset: 1px; }

/* сортировка целей */
.usort { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border: 0; border-radius: 11px; cursor: pointer;
  background: #ffffff0d; box-shadow: inset 0 0 0 1px #ffffff17; font: 800 13px/1 var(--font-title); color: #fff; white-space: nowrap;
  transition: box-shadow 0.200s, background-color 0.200s; }
.usort::before { content: ""; width: 15px; height: 11px; background:
  linear-gradient(#8cc8ff, #8cc8ff) 0 0 / 15px 2.500px no-repeat, linear-gradient(#8cc8ff, #8cc8ff) 0 50% / 10px 2.500px no-repeat, linear-gradient(#8cc8ff, #8cc8ff) 0 100% / 5px 2.500px no-repeat; }
.usort:hover { background: rgb(var(--accent-rgb) / 0.120); box-shadow: inset 0 0 0 1px rgb(var(--accent-rgb) / 0.550); }
.usort:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* фильтры: от / до с монеткой, поиск */
.ufil { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 12px 0; }
.ufil__num, .ufil__search { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 8px 0 12px; border-radius: 12px;
  background: #0e0d12; box-shadow: inset 0 0 0 1px #ffffff14; transition: box-shadow 0.200s; cursor: text; }
.ufil__num:focus-within, .ufil__search:focus-within { box-shadow: inset 0 0 0 1.500px var(--accent), 0 0 14px rgb(var(--accent-rgb) / 0.250); }
.ufil__num span { font: 700 12px/1 var(--font-title); color: #7c7d8c; }
.ufil input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; background: none; outline: none;
  font: 800 14px/1 var(--font-title); color: #fff; -moz-appearance: textfield; appearance: textfield; }
.ufil input::placeholder { color: #5d5e6b; font-weight: 700; }
.ufil input::-webkit-outer-spin-button, .ufil input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ufil input::-webkit-search-cancel-button { filter: grayscale(1) brightness(1.600); }
.ufil__num i { flex: 0 0 auto; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(145deg, #8cc8ff, var(--accent) 55%, var(--accent-deep)); box-shadow: inset 0 1px 0 #ffffff70, 0 0 8px rgb(var(--accent-rgb) / 0.450);
  font: normal 900 11px/1 var(--font-title); color: #fff; }
.ufil__search { grid-column: 1 / -1; padding-left: 12px; }
.ufil__search svg { flex: 0 0 auto; width: 17px; height: 17px; fill: #7c7d8c; }

/* поле с карточками: тёмная подложка, прокрутка внутри */
.ubox__body { flex: 1; margin: 12px 10px 0; padding: 6px; border-radius: 16px; background: #0b0a0eb3; box-shadow: inset 0 0 0 1px #ffffff0a; }
.ugrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; max-height: 456px; padding: 1px; overflow-y: auto;
  overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgb(var(--accent-rgb) / 0.550) transparent; }
.ugrid:empty { display: none; }

/* карточка предмета */
.ucard { position: relative; display: flex; flex-direction: column; min-height: 142px; padding: 8px 9px 9px; overflow: hidden;
  border-radius: 14px; cursor: pointer; text-align: left; isolation: isolate;
  background: radial-gradient(115% 75% at 50% 0%, color-mix(in srgb, var(--r) 34%, transparent), transparent 72%),
    linear-gradient(180deg, color-mix(in srgb, var(--r) 12%, #1b1a21), #141318);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--r) 26%, #ffffff0a);
  transition: transform 0.180s var(--ease-out), box-shadow 0.180s; }
.ucard::before { content: ""; position: absolute; top: 0; left: 50%; width: 42%; height: 3px; border-radius: 0 0 5px 5px; translate: -50% 0;
  background: var(--r); box-shadow: 0 0 12px 1px var(--r); }
.ucard__top { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.ucard__game { padding: 3px 5px; border-radius: 6px; font: italic 900 10px/1 var(--font-title); letter-spacing: 0.020em; }
.ucard__game--cs2 { color: #ffb45c; background: #ff9d2e1f; box-shadow: inset 0 0 0 1px #ff9d2e33; }
.ucard__game--standoff { color: #6fcbf5; background: #38b6f01f; box-shadow: inset 0 0 0 1px #38b6f033; }
.ucard__price { padding: 4px 7px; border-radius: 8px; background: #00000066; font: 800 12px/1 var(--font-title); color: #fff; white-space: nowrap; }
.ucard__img { display: block; width: 88%; aspect-ratio: 2 / 1; margin: 8px auto 6px; rotate: -8deg; filter: drop-shadow(0 6px 8px #000000a6);
  transition: rotate 0.300s var(--ease-out), scale 0.300s var(--ease-out); }
.ucard__type, .ucard__name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ucard__type { margin-top: auto; font: 700 10px/1.300 var(--font-title); color: #9a9aa3; }
.ucard__name { padding-right: 22px; font: 800 13px/1.300 var(--font-title); color: #fff; }
.ucard__check { position: absolute; right: 8px; bottom: 9px; width: 20px; height: 20px; border-radius: 50%; opacity: 0; scale: 0.500;
  background: var(--accent); box-shadow: 0 0 10px rgb(var(--accent-rgb) / 0.700); transition: opacity 0.180s, scale 0.220s var(--ease-out); }
.ucard__check::after { content: ""; position: absolute; left: 7px; top: 4px; width: 5px; height: 9px; border: solid #fff; border-width: 0 2.500px 2.500px 0; rotate: 45deg; }
@media (hover: hover) {
  .ucard:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--r) 60%, transparent), 0 8px 18px #00000073; }
  .ucard:hover .ucard__img { rotate: -3deg; scale: 1.060; }
}
.ucard:active { transform: scale(0.980); }
.ucard.is-sel { box-shadow: inset 0 0 0 2px var(--accent), 0 0 18px rgb(var(--accent-rgb) / 0.450);
  background: radial-gradient(115% 75% at 50% 0%, color-mix(in srgb, var(--r) 34%, transparent), transparent 72%),
    linear-gradient(180deg, rgb(var(--accent-rgb) / 0.180), #141318); }
.ucard.is-sel .ucard__check { opacity: 1; scale: 1; }
.ucard:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* пустая панель */
#upg .ubox__empty { display: grid; place-items: center; align-content: center; gap: 10px; min-height: 190px; margin: 0; padding: 18px 14px;
  background: none; text-align: center; font: 600 13px/1.450 var(--font-text); color: #8c8d9c; }
#upg .ubox__empty[hidden] { display: none; }
.ubox__ghost { width: 96px; height: 48px; --w1: #3a3a46; --w2: #2a2a33; rotate: -8deg; }
.ubox__btn { display: inline-flex; align-items: center; height: 36px; padding: 0 16px; border: 0; border-radius: 11px; cursor: pointer; text-decoration: none;
  background: linear-gradient(135deg, #8cc8ff, var(--accent) 55%, var(--accent-deep)); box-shadow: inset 0 1px 0 #ffffff59, 0 4px 14px rgb(var(--accent-rgb) / 0.350);
  font: 800 13px/1 var(--font-title); color: #fff; }

@media (min-width: 761px) {
  .ugrid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); max-height: 500px; }
  .ufil { grid-template-columns: 1fr 1fr 1.600fr; }
  .ufil__search { grid-column: auto; }
  .ucard__name { font-size: 14px; }
}
/* на компьютере панели стоят рядом */
@media (min-width: 980px) {
  .uboxes { grid-template-columns: minmax(0, 1fr) minmax(0, 1.250fr); gap: 14px; margin-top: 14px; align-items: stretch; }
  .uboxes .ufil { grid-template-columns: 1fr 1fr; }
  .uboxes .ufil__search { grid-column: 1 / -1; }
  #upg-mine-box .ubox__body { margin-top: 12px; }
  .ugrid { grid-template-columns: repeat(3, minmax(0, 1fr)); max-height: 540px; }
}
@media (prefers-reduced-motion: reduce) {
  .ucard, .ucard__img, .ucard__check { transition: none; }
}
/* поля фильтров не должны распирать панель */
.ufil { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ufil > label { min-width: 0; }
@media (min-width: 761px) { .ufil { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.600fr); } }
@media (min-width: 980px) { .uboxes .ufil { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* узкий телефон: шапка панели компактнее, чтобы всё влезло в одну строку */
#upg .ubox__title { overflow: hidden; }
@media (max-width: 420px) {
  .ubox__head { gap: 8px; padding: 10px 10px 10px 12px; }
  #upg .ubox__title { gap: 8px; font-size: 15px !important; }
  #upg .ubox__title svg { width: 28px; height: 28px; padding: 5px; }
  .ugame button { height: 28px; padding: 0 8px; font-size: 11px; }
  .usort { height: 32px; padding: 0 10px; font-size: 12px; }
}

/* голубая тема: картинка реактора была розовой — перекрашиваем её оттенок в голубой */
.udial__bg { filter: hue-rotate(-116deg) saturate(1.050); }
.upg[data-state="spin"] .udial__bg { filter: hue-rotate(-116deg) brightness(1.120) saturate(1.150); }

/* цели апгрейда: фильтр игры в шапке (переносится на узких экранах) и подсказка «показаны N из M» */
#upg-target-box .ubox__head { flex-wrap: wrap; }
#upg-target-box .ubox__head .ubox__title { flex: 1 1 auto; }
.ubox__more { margin: 8px 4px 2px; font: 700 12px/1.350 var(--font-body, inherit); color: #8b8c9c; text-align: center; }
/* ===== Компьютер: сцена апгрейда во всю ширину — ангар с кольцом-порталом по центру и двумя подставками =====
   Фон assets/upgrade/scene-pc.jpg (2:1 примерно 1200×514). Все места на нём заданы в процентах от сцены:
   кольцо — центр 50% / 46,5%, окно кольца ≈ 21,5% ширины; подставки — 17% и 83% по ширине, верх ≈ 76% высоты. */
.ustage__t { display: none; }
@media (min-width: 1024px) {
  .upg .ustage {
    position: relative; width: 100vw; max-width: none; margin: 14px 0 0 calc(50% - 50vw); padding: 0; aspect-ratio: 1200 / 514; max-height: 860px;
    border-radius: 0; overflow: hidden;
    background: #060a18 url('/assets/upgrade/scene-pc.jpg?v=2') center 42% / cover no-repeat;
  }
  /* мягкое затемнение снизу и по краям, чтобы сцена перетекала в страницу */
  .upg .ustage::before { content: ""; display: block; position: absolute; inset: 0; z-index: 0; border: 0; width: auto; pointer-events: none;
    background: linear-gradient(180deg, rgb(8 10 22 / 0.550) 0%, transparent 18%, transparent 78%, #0b0d1c 100%),
      linear-gradient(90deg, rgb(8 10 22 / 0.600) 0%, transparent 12%, transparent 88%, rgb(8 10 22 / 0.600) 100%); }
  .upg .ustage::after { display: none; }

  /* кольцо шанса — точно в окне портала */
  .upg .udial { position: absolute; left: 50%; top: 46.500%; width: 20.500%; max-width: 340px; margin: 0; translate: -50% -50%; z-index: 2; }
  .upg .udial__bg { display: none; }
  .upg .udial::after { inset: -6%; box-shadow: 0 0 46px 8px rgb(47 140 255 / 0.350); }

  /* заголовки над подставками */
  .upg .ustage__t { position: absolute; top: 15%; z-index: 2; display: grid; gap: 6px; justify-items: center; width: 26%; translate: -50% 0; text-align: center; pointer-events: none; }
  .upg .ustage__t--l { left: 17%; }
  .upg .ustage__t--r { left: 83%; }
  .upg .ustage__t b { font: italic 900 clamp(30px, 3vw, 46px)/1 var(--font-title); letter-spacing: 0.020em; text-transform: uppercase; color: #fff;
    text-shadow: 0 0 18px rgb(47 140 255 / 0.900), 0 0 2px #fff; }
  .upg .ustage__t small { font: 700 13px/1.200 var(--font-title); color: #9fc4ff; }

  /* предметы стоят на подставках */
  .upg .uslots { position: static; display: block; margin: 0; max-width: none; }
  .upg .uslots__arrow { display: none; }
  .upg .uslot { position: absolute; top: 74%; z-index: 2; width: 19%; max-width: 300px; min-height: 0; aspect-ratio: 5 / 4; translate: -50% -100%;
    background: transparent; box-shadow: none; align-content: end; padding: 0 6px 6%; overflow: visible; }
  .upg #upg-src { left: 17%; }
  .upg #upg-dst { left: 83%; }
  .upg .uslot.is-set { background: transparent; box-shadow: none; }
  .upg .uslot.is-set::before { display: none; }
  .upg .uslot:hover { box-shadow: none; }
  .upg .uslot:hover .uslot__img { scale: 1.050; }
  .upg .uslot__img { width: 86%; max-width: 230px; transition: scale 0.250s; filter: drop-shadow(0 0 18px color-mix(in srgb, var(--r) 60%, transparent)) drop-shadow(0 10px 10px #000a); }
  .upg .uslot__pick { background: rgb(12 20 46 / 0.800); box-shadow: inset 0 0 0 1px rgb(92 160 255 / 0.500), 0 0 16px -4px #2f8cff; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
  .upg .uslot__text b, .upg .uslot__text small { text-shadow: 0 2px 6px #000; }

  /* управление: кнопка под кольцом, «дешевле/дороже» — под левой подставкой, множители — под правой */
  .upg .uctl { position: absolute; left: 50%; top: 84%; z-index: 3; width: 340px; max-width: none; margin: 0; translate: -50% 0; }
  .upg .ustep { position: absolute; left: 17%; top: 84%; z-index: 3; width: min(24%, 340px); max-width: none; margin: 0; translate: -50% 0; }
  .upg .umult { position: absolute; left: 83%; top: 84%; z-index: 3; width: min(26%, 380px); max-width: none; margin: 0; translate: -50% 0; }
  .upg .upg__msg { position: absolute; left: 50%; top: 93%; z-index: 3; width: 420px; margin: 0; translate: -50% 0; text-align: center; }
  .upg .ustage .modal__note { position: absolute; left: 50%; bottom: 2.500%; z-index: 3; width: 460px; margin: 0; translate: -50% 0; color: #8ea2cc; }
  .upg .upg__msg:not(:empty) ~ .modal__note { display: none; }
}

/* ПК: «Мои предметы» и «Желаемый предмет» — две равные панели во всю ширину сцены (как размеры у Midas: 2×652, промежуток 24, высота 572) */
@media (min-width: 1024px) {
  .upg .uboxes { --uw: min(1328px, calc(100vw - 112px)); width: var(--uw); margin: 24px 0 0 calc(50% - var(--uw) / 2);
    grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: stretch; }
  #upg .ubox { height: 572px; padding: 0 0 16px; border-radius: 24px; }
  #upg .ubox__head { flex-wrap: nowrap; height: 72px; min-height: 72px; padding: 0 20px; }
  #upg .ubox__title { font-size: 18px !important; }
  #upg-target-box .ubox__head .ubox__title { flex: 0 1 auto; }
  .uboxes .ufil { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.600fr); padding: 16px 20px 0; }
  .uboxes .ufil__search { grid-column: auto; }
  .ufil__num, .ufil__search { height: 48px; }
  #upg .ubox__body { display: flex; flex-direction: column; min-height: 0; margin: 16px 12px 0 20px; }
  #upg-mine-box .ubox__body { margin-top: 0; }
  #upg .ugrid { flex: 1 1 auto; min-height: 0; max-height: none; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; align-content: start; }
}@media (min-width: 1024px) and (max-width: 1279px) {
  #upg .ubox__head { gap: 8px; padding: 0 14px; }
  #upg .ubox__title { gap: 8px; font-size: 15px !important; }
  #upg .ubox__title svg { width: 26px; height: 26px; padding: 5px; }
}@media (min-width: 1024px) and (max-width: 1279px) {
  #upg-target-box .ubox__count { display: none; }
  #upg .ubox__head .ugame button { padding-left: 8px; padding-right: 8px; }
}
/* техника в апгрейдере: свой значок «ТЕХ», фото предмета ровно и целиком (без наклона, как у скинов) */
.ucard__game--prize { color: #ffd45c; background: #ffc4001f; box-shadow: inset 0 0 0 1px #ffc40040; }
.ucard--prize .ucard__img, .ucard--prize:hover .ucard__img { rotate: 0deg; object-fit: contain; }
.uslot.is-set .uslot__img[src*="/prizes/"] { rotate: 0deg; object-fit: contain; }@media (min-width: 1024px) and (max-width: 1279px) { #upg-target-box .ubox__title svg { display: none; } #upg .ubox__head .ugame button { padding-left: 5px; padding-right: 5px; } }
