/**
 * Компоненты интерфейса игры (кнопки, карточки, панели).
 * Требует предварительного подключения /theme.css
 */

.intro-hero-wrap {
  margin: 0 0 18px;
  padding: 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 6px 28px rgba(10, 5, 24, 0.45);
  background: var(--surface-deep);
}

.intro-hero {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}

button.btn {
  font: inherit;
}

/* Основные действия: .btn, .btn-primary, и компактные (btn btn-primary) */
.btn,
.btn-primary {
  display: block;
  width: 100%;
  margin: 8px 0;
  padding: 14px 16px;
  box-sizing: border-box;
  border: 1.5px solid var(--btn-border);
  border-radius: var(--btn-radius);
  background: var(--btn-bg);
  color: var(--btn-text);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: var(--btn-shadow);
  -webkit-tap-highlight-color: transparent;
}

.btn:active,
.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background: var(--btn-bg-secondary);
  color: var(--btn-text-secondary);
  border-color: var(--btn-border-2);
}

.btn:disabled,
.btn-primary:disabled {
  color: #9ea7b4;
  border-color: rgba(132, 140, 150, 0.6);
  background: linear-gradient(
      180deg,
      rgba(164, 172, 182, 0.36) 0%,
      rgba(102, 110, 120, 0.34) 52%,
      rgba(58, 64, 72, 0.5) 100%
    ),
    rgba(44, 48, 56, 0.92);
  box-shadow: inset 0 0 0 999px rgba(120, 126, 136, 0.2), 0 2px 10px rgba(6, 7, 10, 0.24);
  cursor: not-allowed;
  opacity: 0.82;
  filter: saturate(0.2) contrast(0.95);
}

.btn-danger {
  margin-top: 16px;
  background: transparent;
  color: #f0a8b8;
  border: 2px solid rgba(240, 120, 140, 0.45);
  box-shadow: none;
}

.btn-danger:active {
  transform: scale(0.98);
  background: rgba(120, 40, 60, 0.25);
}

.btn-small {
  padding: 10px 12px;
  font-size: 0.9rem;
  margin: 6px 0;
  border-radius: var(--btn-radius-compact);
}

.btn:focus-visible,
.btn-primary:focus-visible {
  outline: 2px solid var(--ui-focus-ring);
  outline-offset: 2px;
}

.choice-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(100vh - 220px);
  overflow-y: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(160, 168, 180, 0.35) transparent;
}

/* Экран выбора расы: больше ширины под строку статов */
#race-list .choice-card-row {
  gap: 10px;
}

#race-list .choice-card .race-icon-wrap {
  width: 80px;
  height: 80px;
}

.choice-card {
  text-align: left;
  padding: 14px 14px 12px;
  border-radius: 14px;
  border: 2.5px solid var(--line);
  background: rgba(42, 46, 54, 0.94);
  box-shadow: 0 1px 14px rgba(0, 0, 0, 0.32);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.choice-card-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
}

.choice-card:active {
  border-color: #d3b06f;
  box-shadow: 0 2px 22px rgba(138, 110, 54, 0.35);
}

.choice-card .race-icon-wrap {
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-deep);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
}

.choice-card-main {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.choice-card--race {
  cursor: default;
}

.choice-card--race:active {
  border-color: var(--line);
  box-shadow: 0 1px 14px rgba(0, 0, 0, 0.32);
}

.race-thumb-preview-btn {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: zoom-in;
  flex-shrink: 0;
  border-radius: 12px;
  -webkit-tap-highlight-color: transparent;
}

.race-thumb-preview-btn:focus-visible {
  outline: 2px solid var(--gold, #d3b06f);
  outline-offset: 2px;
}

.choice-card-main--pick {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

.choice-card-main--pick:focus-visible {
  outline: 2px solid var(--gold, #d3b06f);
  outline-offset: 2px;
  border-radius: 8px;
}

.race-image-preview-box {
  position: relative;
  width: min(420px, 94vw);
  max-height: min(88vh, 640px);
  padding: 14px 14px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.race-image-preview-box .card-preview-close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
}

.race-image-preview-img {
  display: block;
  width: 100%;
  max-height: min(78vh, 560px);
  object-fit: contain;
  object-position: center;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
}

.choice-card-main .title {
  display: block;
  margin: 0 0 8px;
}

/* Статы расы: одна строка; на узком экране — горизонтальный скролл */
.choice-card-main .race-stats-line {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin: 4px 0 8px;
  padding: 0 0 4px;
  font-size: 0.76rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(200, 175, 130, 0.45) transparent;
  font-weight: 600;
  color: rgba(230, 210, 170, 0.95);
  margin-top: 0;
}

.choice-card-main .race-stats-line::-webkit-scrollbar {
  height: 4px;
}

.choice-card-main .race-stats-line::-webkit-scrollbar-thumb {
  background: rgba(200, 175, 130, 0.4);
  border-radius: 4px;
}

.race-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.choice-card .race-icon-wrap .emoji {
  font-size: 2.35rem;
  line-height: 1;
}

.choice-card .title,
.choice-card-main .title {
  font-weight: 700;
  color: #ece9e4;
  font-size: 1.08rem;
  letter-spacing: 0.03em;
}

.choice-card ul {
  margin: 0;
  padding: 0 0 0 18px;
  font-size: 0.88rem;
  color: #e6e9bf;
  line-height: 1.45;
}

.choice-card li {
  margin-bottom: 4px;
}

.class-pick-summary {
  margin: 2px 0 8px;
  line-height: 1.45;
}

.choice-card-main .class-pick-perks {
  margin: 0;
  padding: 0 0 0 18px;
  font-size: 0.88rem;
  color: #e6e9bf;
  line-height: 1.45;
}

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

input.name-input {
  width: 100%;
  padding: 14px 14px;
  border-radius: 14px;
  border: 2px solid rgba(191, 160, 96, 0.52);
  background: var(--surface-deep);
  color: var(--text);
  font-size: 1.05rem;
  margin: 12px 0;
}

input.name-input::placeholder {
  color: rgba(152, 158, 168, 0.92);
  opacity: 1;
}

#screen-account #account-login-nick::placeholder,
#screen-account #account-create-nick::placeholder {
  color: rgba(152, 158, 168, 0.92);
  opacity: 1;
}

#screen-account .account-mode-row .btn {
  transition: box-shadow 0.18s ease, border-color 0.18s ease, filter 0.18s ease;
}

#screen-account .account-mode-row .btn.btn-primary {
  border-color: rgba(227, 191, 110, 0.92);
  box-shadow:
    0 0 0 1px rgba(227, 191, 110, 0.52),
    0 0 18px rgba(227, 191, 110, 0.34),
    0 0 34px rgba(227, 191, 110, 0.2),
    var(--btn-shadow);
  filter: saturate(1.06);
}

#screen-name .name-input::placeholder {
  color: rgba(152, 158, 168, 0.92);
  opacity: 1;
}

.main-screen-head {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  flex-wrap: nowrap;
  margin-bottom: 12px;
  min-width: 0;
}

.main-screen-head .main-screen-title {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main-head-stats {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-align: right;
  line-height: 1.35;
  flex: 0 0 auto;
  white-space: nowrap;
}

.main-head-sep {
  opacity: 0.5;
  font-weight: 500;
}

.main-head-vitality-btn {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 600;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  vertical-align: baseline;
}

.main-head-vitality-btn:hover {
  color: rgba(236, 229, 213, 0.95);
}

.main-head-vitality-btn:focus-visible {
  outline: 2px solid var(--gold, #d3b06f);
  outline-offset: 2px;
  border-radius: 4px;
}

.main-head-vitality-btn--energy .ui-energy-icon {
  vertical-align: -0.2em;
}

.main-head-xp-wrap,
.main-head-xp {
  display: inline-flex;
  align-items: center;
  vertical-align: baseline;
  gap: 0.28em;
}

.main-head-xp-restore-tap {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 600;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.main-head-xp-restore-tap:focus-visible {
  outline: 2px solid var(--gold, #d3b06f);
  outline-offset: 2px;
  border-radius: 4px;
}

.main-head-xp-pct {
  font-weight: inherit;
}

.main-head-death-xp-dot {
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  margin-left: 3px;
  border-radius: 50%;
  background: #ff2a2a;
  box-shadow:
    0 0 0 1px rgba(18, 22, 30, 0.95),
    0 0 6px rgba(255, 60, 60, 0.75);
  animation: mail-unread-dot-pulse 1.5s ease-in-out infinite;
  pointer-events: none;
}

.main-head-logout-btn {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0 0 0 8px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: -0.25em;
  cursor: pointer;
  opacity: 0.82;
  -webkit-tap-highlight-color: transparent;
  border-radius: 6px;
}

.main-head-logout-btn:hover {
  opacity: 1;
}

.main-head-logout-btn:focus-visible {
  outline: 2px solid var(--gold, #d3b06f);
  outline-offset: 2px;
}

.main-head-logout-btn img {
  display: block;
  width: 18px;
  height: 18px;
}

.death-xp-restore-cost {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0 0 8px;
}

.death-xp-restore-question {
  margin-top: 0;
}

.death-xp-restore-warn {
  color: #e07070;
  margin: 0 0 10px;
  text-align: center;
}

.death-xp-restore-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.menu-wrap {
  margin-bottom: 4px;
}

/* Неактивный экран всегда скрыт (main-menu-layout-mobile иначе перебивает .screen { display: none }). */
#screen-main.screen:not(.active) {
  display: none !important;
}

#screen-main.screen:not(.active) .menu-wrap {
  display: none !important;
}

/* Мобильный вид меню: фиксированная панель поверх экрана, горизонтальная прокрутка (8 пунктов в строке). */
#screen-main.main-menu-layout-mobile.active {
  --main-menu-mobile-dock-h: 86px;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  min-height: 100dvh;
}

#screen-main.main-menu-layout-mobile.active .main-screen-head {
  order: 1;
  flex-shrink: 0;
}

#screen-main.main-menu-layout-mobile.active #main-panel {
  order: 2;
  flex: 1 1 auto;
  min-height: 0;
  padding-bottom: calc(
    var(--main-menu-mobile-dock-h) + max(10px, env(safe-area-inset-bottom, 0px)) + 12px
  );
}

#screen-main.main-menu-layout-mobile.active .menu-wrap {
  order: 3;
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: max(8px, env(safe-area-inset-bottom, 0px));
  z-index: 120;
  width: min(520px, calc(100vw - 28px));
  max-width: calc(100vw - 28px);
  margin: 0;
  padding: 6px 8px 8px;
  box-sizing: border-box;
  border-radius: 14px;
  border: 1px solid rgba(154, 164, 176, 0.28);
  background: rgba(14, 16, 22, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 10px 34px rgba(0, 0, 0, 0.52),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  pointer-events: auto;
}

#screen-main.main-menu-layout-mobile.active .menu-grid-stage {
  flex-direction: column;
  align-items: stretch;
  column-gap: 0;
}

#screen-main.main-menu-layout-mobile.active .menu-toggle-row {
  display: none !important;
}

#screen-main.main-menu-layout-mobile.active #main-menu-grid.menu-grid--mobile-strip {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  scrollbar-width: none;
  gap: 2px;
  padding: 4px 2px 2px;
  cursor: grab;
}

#screen-main.main-menu-layout-mobile.active #main-menu-grid.menu-grid--mobile-strip.lb-tabs--dragging {
  cursor: grabbing;
  user-select: none;
}

#screen-main.main-menu-layout-mobile.active #main-menu-grid.menu-grid--mobile-strip.lb-tabs--dragging .btn {
  cursor: grabbing;
}

#screen-main.main-menu-layout-mobile.active #main-menu-grid.menu-grid--mobile-strip::-webkit-scrollbar {
  display: none;
}

#screen-main.main-menu-layout-mobile.active #main-menu-grid.menu-grid--mobile-strip > .btn.btn-secondary {
  flex: 0 0 calc(100% / var(--menu-mobile-cols, 8));
  min-width: calc(100% / var(--menu-mobile-cols, 8));
  max-width: calc(100% / var(--menu-mobile-cols, 8));
  scroll-snap-align: start;
  scroll-snap-stop: normal;
  gap: 4px;
  padding: 2px 0 4px;
  touch-action: pan-x;
  -webkit-user-select: none;
  user-select: none;
}

#screen-main.main-menu-layout-mobile.active #main-menu-grid.menu-grid--mobile-strip .menu-icon {
  width: 38px;
  height: 38px;
  -webkit-user-drag: none;
  user-drag: none;
  -webkit-touch-callout: none;
  pointer-events: none;
}

#screen-main.main-menu-layout-mobile.active #main-menu-grid.menu-grid--mobile-strip .menu-label {
  min-height: 1.65em;
  line-height: 1.08;
  pointer-events: none;
}

#screen-main.main-menu-layout-mobile.active #main-menu-grid.menu-grid--mobile-strip .menu-attention-dot {
  top: -2px;
  right: 0;
  width: 10px;
  height: 10px;
}

#screen-main.main-menu-layout-mobile.active #main-menu-grid.menu-grid--mobile-strip > .btn.btn-secondary.menu-btn--quest-active-count::before {
  top: 18px;
  right: calc(50% - 17px);
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  font-size: 0.55rem;
}

.settings-menu-layout-hint {
  margin: 8px 0 0;
  font-size: 0.82rem;
  line-height: 1.4;
}

.settings-menu-layout-hint[hidden] {
  display: none !important;
}

/* Кнопка «Наверх» — когда прокрутили длинную страницу и меню уже не видно. */
.scroll-top-btn {
  position: fixed;
  z-index: 115;
  right: max(14px, calc((100vw - min(520px, calc(100vw - 28px))) / 2 + 6px));
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  width: 42px;
  height: 42px;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid rgba(154, 164, 176, 0.32);
  background: rgba(14, 16, 22, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--gold);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

body.main-menu-layout-mobile .scroll-top-btn {
  bottom: calc(var(--main-menu-mobile-dock-h, 86px) + max(10px, env(safe-area-inset-bottom, 0px)) + 10px);
}

body.main-menu-layout-mobile:has(#screen-main.active .battle-root) .scroll-top-btn {
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
}

.scroll-top-btn.scroll-top-btn--visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.scroll-top-btn:active {
  transform: translateY(0) scale(0.96);
}

.scroll-top-btn__icon {
  display: block;
  pointer-events: none;
}

/* Стартовое обучение: только разрешённые пункты меню кликабельны; развернуть/свернуть отключены. */
body.main-menu-starter-lock #main-menu-grid [data-menu]:not(.menu-btn--starter-allowed) {
  pointer-events: none;
  opacity: 0.4;
  cursor: default;
  filter: grayscale(0.35);
}

body.main-menu-starter-lock #main-menu-grid [data-menu].menu-btn--starter-allowed {
  pointer-events: auto;
  opacity: 1;
  filter: none;
}

body.main-menu-starter-lock .menu-toggle-btn.menu-toggle--starter-locked {
  pointer-events: none;
  opacity: 0.4;
  cursor: default;
  filter: grayscale(0.35);
}

.main-menu-reorder-bar {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.menu-layout {
  width: 100%;
}

/* Главная область выбранного пункта меню:
   фиксируем одинаковую геометрию контейнера для всех экранов. */
#main-panel {
  width: 100%;
  min-width: 0;
}

#main-panel > * {
  width: 100%;
  max-width: 100%;
  margin-left: 0 !important;
  margin-right: 0 !important;
  box-sizing: border-box;
}

/* Единая стартовая вертикальная позиция «прямоугольника» содержимого. */
#main-panel > * {
  margin-top: 12px !important;
}

/* Сетка + кнопка развернуть/свернуть: справа; в развёрнутом виде — по центру между 1-й и 2-й строкой сетки; при свёрнутом — по центру единственного ряда. */
.menu-grid-stage {
  --menu-row-h: calc(62px + 10px + 1.18rem);
  --menu-grid-gap: 12px;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  column-gap: 12px;
  row-gap: 0;
  width: 100%;
}

/* Кнопка не прыгает при переключении: в обоих состояниях держим колонку у верхнего края. */
.menu-grid-stage:has(#main-menu-grid.menu-grid--collapsed) {
  align-items: flex-start;
}

.menu-grid {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: var(--menu-grid-gap);
  grid-template-columns: repeat(var(--menu-cols, 4), minmax(0, 1fr));
  align-items: stretch;
}

/* Перебиваем .menu-grid .btn.btn-secondary { display: flex }, иначе «свёрнутые» пункты не скрываются. */
.menu-grid.menu-grid--collapsed .btn.btn-secondary.menu-btn--collapsed-hidden {
  display: none !important;
}

.menu-toggle-row {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  width: auto;
  max-width: 3.75rem;
  min-height: 0;
  margin-top: 0;
  margin-left: 0;
}

/* Развёрнуто: колонка по высоте двух рядов меню — кнопка по центру (между 1-й и 2-й строкой). */
.menu-grid-stage:has(#main-menu-grid:not(.menu-grid--collapsed)) .menu-toggle-row {
  min-height: 0;
}

/* Обе кнопки в одной ячейке — взаимная замена без сдвига по вертикали/горизонтали. */
.menu-toggle-slot {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto;
  place-items: center;
  justify-self: center;
  align-self: center;
  transform: translateY(24px);
}

/* Смещение задаём слоту целиком: «Развернуть» и «Свернуть» остаются в той же точке. */

.menu-toggle-slot > .menu-toggle-btn {
  grid-area: 1 / 1;
}

.menu-toggle-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 32px;
  min-height: 32px;
  padding: 2px;
  margin: 0;
  background: transparent;
  border: none;
  border-radius: 8px;
  box-shadow: none;
  cursor: pointer;
  color: inherit;
  font: inherit;
  line-height: 1.1;
  -webkit-tap-highlight-color: transparent;
}

/* Иначе `display: inline-flex` выше перебивает UA [hidden] — видны обе кнопки сразу. */
.menu-toggle-btn[hidden] {
  display: none !important;
}

.menu-toggle-btn:hover {
  filter: brightness(1.08);
}

.menu-toggle-btn:active {
  filter: brightness(0.95);
}

.menu-toggle-btn:focus-visible {
  outline: 2px solid rgba(211, 176, 111, 0.65);
  outline-offset: 3px;
}

.menu-toggle-icon {
  width: 24px;
  height: 24px;
  max-width: 28px;
  max-height: 28px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.35));
  pointer-events: none;
}

.menu-toggle-text {
  display: none;
}

.menu-feature-list {
  margin: 0 0 0 1.15rem;
  padding: 0;
  line-height: 1.55;
}

.menu-feature-list li {
  margin-bottom: 8px;
}

.settings-menu-order-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(var(--settings-menu-cols, 4), minmax(0, 1fr));
  gap: 10px;
}

.settings-menu-top-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
}

.settings-menu-top-actions .btn[hidden] {
  display: none !important;
}

.settings-menu-quick-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 38px;
}

.settings-menu-bottom-actions {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 14px;
  border: 1px solid rgba(154, 164, 176, 0.28);
  background: rgba(14, 18, 24, 0.92);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  pointer-events: auto;
}

body.main-menu-layout-mobile .settings-menu-bottom-actions {
  bottom: calc(var(--main-menu-mobile-dock-h, 86px) + max(10px, env(safe-area-inset-bottom, 0px)) + 10px);
}

.settings-menu-bottom-actions .settings-menu-action-icon-btn,
.settings-menu-quick-row .settings-menu-action-icon-btn {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  min-width: 0;
  margin: 0;
  padding: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.07);
}

.settings-menu-bottom-actions .settings-menu-action-icon-btn:hover:not(:disabled),
.settings-menu-quick-row .settings-menu-action-icon-btn:hover:not(:disabled) {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.12);
}

.settings-menu-bottom-actions .settings-menu-action-icon-btn .settings-menu-action-icon,
.settings-menu-quick-row .settings-menu-action-icon-btn .settings-menu-action-icon {
  display: block;
  width: 28px;
  height: 28px;
  pointer-events: none;
}

.settings-menu-quick-row .settings-menu-quick-btn {
  width: auto;
  min-width: 0;
  min-height: 38px;
  margin: 0;
  padding: 8px 10px;
  font-size: 0.8rem;
  line-height: 1.25;
  flex: 0 0 auto;
  white-space: nowrap;
  box-sizing: border-box;
}

.settings-menu-quick-row .settings-menu-quick-btn--active {
  border-color: rgba(211, 176, 111, 0.55);
  background: rgba(211, 176, 111, 0.1);
  box-shadow: 0 0 0 1px rgba(211, 176, 111, 0.22) inset;
  color: var(--text);
}

/* Единый зазор от ряда кнопок до наполнения любого пункта. */
.settings-menu-editors-below {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.settings-menu-editors-below:empty {
  display: none;
}

.settings-menu-size-editor,
.settings-menu-editor {
  margin-top: 0;
  padding: 10px 12px;
  border: 1px solid rgba(154, 164, 176, 0.24);
  border-radius: 10px;
  background: rgba(14, 18, 24, 0.45);
  box-sizing: border-box;
}

.settings-menu-size-label {
  margin: 0 0 8px;
  font-size: 0.9rem;
}

.settings-menu-size-range {
  width: 100%;
  margin: 0;
}

/* Язык: тот же серый стиль, что у .appearance-toolbar .appearance-filter-select */
.settings-menu-language-select {
  display: block;
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border-radius: var(--ui-input-radius);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.25;
  font-family: inherit;
  border: 1px solid var(--ui-pill-line);
  background: var(--ui-pill-bg);
  color: var(--ui-pill-text);
  outline: none;
  box-shadow: none;
  cursor: pointer;
  color-scheme: dark;
}

.settings-menu-language-select:focus,
.settings-menu-language-select:focus-visible {
  border-color: var(--ui-pill-line-active);
  background: var(--ui-pill-bg-active);
  color: var(--ui-pill-text-active);
}

.settings-menu-language-select option {
  background: #2c2e34;
  color: #e8eaee;
}

/* Только ползунок */
input.settings-menu-size-range {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 36px;
  margin: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  touch-action: none;
  accent-color: var(--gold);
}

input.settings-menu-size-range:focus {
  outline: none;
}

input.settings-menu-size-range:focus-visible {
  outline: 2px solid var(--ui-focus-ring);
  outline-offset: 2px;
  border-radius: 4px;
}

input.settings-menu-size-range::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: var(--ui-range-track-bg);
  border: 1px solid rgba(191, 160, 96, 0.28);
}

input.settings-menu-size-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -7px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ead4a0 0%, var(--gold) 45%, var(--gold-dim) 100%);
  border: 1px solid rgba(255, 248, 230, 0.42);
  box-shadow: var(--ui-range-thumb-shadow);
  cursor: grab;
}

input.settings-menu-size-range:active::-webkit-slider-thumb {
  cursor: grabbing;
}

input.settings-menu-size-range::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: var(--ui-range-track-bg);
  border: 1px solid rgba(191, 160, 96, 0.28);
}

input.settings-menu-size-range::-moz-range-progress {
  height: 8px;
  border-radius: 999px 0 0 999px;
  background: var(--ui-range-track-fill);
}

input.settings-menu-size-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ead4a0 0%, var(--gold) 45%, var(--gold-dim) 100%);
  border: 1px solid rgba(255, 248, 230, 0.42);
  box-shadow: var(--ui-range-thumb-shadow);
  cursor: grab;
}

input.settings-menu-size-range:active::-moz-range-thumb {
  cursor: grabbing;
}

input.settings-menu-size-range::-ms-track {
  height: 8px;
  border-radius: 999px;
  background: transparent;
  border-color: transparent;
  color: transparent;
}

input.settings-menu-size-range::-ms-fill-lower {
  background: var(--ui-range-track-fill);
  border-radius: 999px;
}

input.settings-menu-size-range::-ms-fill-upper {
  background: var(--ui-range-track-bg);
  border-radius: 999px;
}

input.settings-menu-size-range::-ms-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ead4a0 0%, var(--gold) 45%, var(--gold-dim) 100%);
  border: 1px solid rgba(255, 248, 230, 0.42);
  box-shadow: var(--ui-range-thumb-shadow);
  cursor: grab;
}

.settings-menu-order-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 118px;
  padding: 10px 8px;
  background: rgba(20, 22, 28, 0.55);
  border: 1px solid rgba(154, 164, 176, 0.28);
  border-radius: 10px;
  cursor: grab;
  user-select: none;
}

.settings-menu-order-item:active {
  cursor: grabbing;
}

.settings-menu-order-item--dragging {
  opacity: 0.58;
  border-color: rgba(211, 176, 111, 0.6);
}

.settings-menu-order-icon-box {
  width: 62px;
  height: 62px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(14, 18, 24, 0.62);
  border: 1px solid rgba(154, 164, 176, 0.22);
}

.settings-menu-order-icon {
  width: 46px;
  height: 46px;
  object-fit: contain;
  display: block;
}

.settings-menu-order-name {
  font-weight: 700;
  font-size: 0.82rem;
  text-align: center;
  line-height: 1.25;
  color: var(--text);
}

.settings-menu-editor-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.settings-profile-actions {
  margin: 0;
  gap: 8px;
}

.settings-root,
.friends-root,
.leaderboard-root,
.achievements-root,
.guild-root {
  display: grid;
  gap: 10px;
}

.settings-root--with-bottom-actions {
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}

body.main-menu-layout-mobile .settings-root--with-bottom-actions {
  padding-bottom: calc(var(--main-menu-mobile-dock-h, 86px) + 72px + env(safe-area-inset-bottom, 0px));
}

.achievements-root.stub {
  padding-top: 10px;
  gap: 2px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.achievements-root .collections-inline-msg {
  min-height: 0;
  margin: 0;
}

.achievements-root .collections-inline-msg:empty {
  display: none;
}

.achievements-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
}

.achievements-summary {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(236, 240, 248, 0.88);
}

.achievements-summary-bm {
  margin: 0;
  flex-shrink: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gold, #d3b06f);
  font-variant-numeric: tabular-nums;
}

.ach-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ach-list-scroll {
  --ach-card-estimate: 112px;
  --ach-list-gap: 8px;
  --ach-visible-rows: 6;
  max-height: calc(
    var(--ach-card-estimate) * var(--ach-visible-rows) + var(--ach-list-gap) * (var(--ach-visible-rows) - 1)
  );
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin-top: 0;
  padding: 10px 8px 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--ui-scrollbar-thumb) var(--ui-scrollbar-track);
}

.guild-root .section-title {
  margin: 0;
}

.guild-root .guild-create-card {
  display: grid;
  gap: 8px;
}

.guild-root .guild-create-input {
  width: 100%;
  box-sizing: border-box;
}

.guild-root .guild-crest-label {
  margin: 4px 0 0;
}

.guild-crest-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.guild-crest-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 2px;
  border-radius: 10px;
  border: 1px solid var(--ui-pill-line);
  background: var(--ui-pill-bg);
  cursor: pointer;
}

.guild-crest-option:hover:not(:disabled) {
  border-color: var(--ui-pill-line-active);
  background: var(--ui-pill-bg-active);
}

.guild-crest-option--active {
  border-color: var(--ui-selected-line, rgba(211, 176, 111, 0.62));
  box-shadow: 0 0 0 1px rgba(211, 176, 111, 0.2);
}

.guild-crest-option img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.guild-crest-option:disabled {
  opacity: 0.5;
  cursor: wait;
}

.guild-root.collections-root {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 10px;
  min-height: 0;
}

.guild-root .forge-sheet-tabs-row {
  margin-top: 0;
}

.guild-root .guild-tab-pockets {
  margin-left: auto;
  padding: 6px 10px;
}

.guild-root .guild-inner-tabs.collections-tabs {
  margin: 8px 0 10px;
}

.guild-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 10px;
}

.guild-card-head--v2 {
  align-items: center;
  gap: 14px;
}

.guild-card-emblem {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 120px;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--ui-pill-line);
  background: rgba(8, 10, 14, 0.55);
  overflow: visible;
}

.guild-card-emblem img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.guild-card-emblem.guild-browse-crest--emoji {
  font-size: 3.6rem;
}

.guild-card-info {
  flex: 1 1 auto;
  min-width: 0;
}

.guild-card-name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}

.guild-card-tag {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gold, #d3b06f);
}

.guild-card-level {
  margin: 8px 0 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: #e8ebef;
}

.guild-card-xp-bar-wrap {
  margin-top: 6px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  max-width: 220px;
}

.guild-card-xp-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(211, 176, 111, 0.85), rgba(180, 140, 70, 0.95));
}

.guild-card-members {
  margin: 6px 0 0;
}

.guild-card-bm,
.guild-card-kazna {
  margin: 2px 0 0;
}

.guild-skill-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.guild-skill-level-badge {
  flex: 0 0 auto;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--gold, #d3b06f);
}

.guild-skill-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.guild-skill-books-progress {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 0.82rem;
  line-height: 1.2;
}

.guild-skill-progress-row .guild-task-bar-wrap {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

.guild-skill-progress-row .guild-task-bar {
  background: linear-gradient(90deg, var(--gold), var(--gold-dim));
}

.guild-skill-book-btn {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.guild-skill-book-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
}

.guild-skill-book-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.guild-skill-book-btn--study:not(:disabled) {
  filter: drop-shadow(0 0 6px rgba(211, 176, 111, 0.45));
}

.guild-skill-timer {
  margin: 6px 0 0;
}

.guild-skill-book-btn img {
  display: block;
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.guild-card-actions {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-self: flex-start;
}

.guild-icon-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
}

.guild-icon-action-btn:hover:not(:disabled) {
  filter: brightness(1.12);
}

.guild-icon-action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.guild-icon-action-btn img {
  display: block;
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.guild-icon-action-btn--danger {
  filter: none;
}

.guild-icon-action-btn--danger:hover:not(:disabled) {
  filter: brightness(1.15) saturate(1.1);
}

.guild-icon-tabs {
  display: flex;
  flex-wrap: nowrap;
  margin: 4px 0 12px;
  width: 100%;
  justify-content: space-between;
  gap: 14px;
}

.guild-icon-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 12px;
  border: none;
  background: transparent;
  cursor: pointer;
}

.guild-icon-tab:hover {
  background: transparent;
  opacity: 0.92;
}

.guild-icon-tab--active {
  border-color: transparent;
  box-shadow: none;
}

.guild-icon-tab--active::after {
  content: '';
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 9px;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--gold, #d3b06f), var(--gold-dim, rgba(180, 140, 70, 0.6)));
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  box-shadow: 0 0 12px rgba(211, 176, 111, 0.35);
  z-index: 2;
  pointer-events: none;
}

.guild-icon-tab img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  position: relative;
  z-index: 1;
}

.guild-icon-tab--active::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: radial-gradient(
    circle,
    rgba(211, 176, 111, 0.52) 0%,
    rgba(211, 176, 111, 0.16) 45%,
    rgba(211, 176, 111, 0.06) 65%,
    transparent 72%
  );
  filter: blur(0.2px);
  z-index: 0;
  pointer-events: none;
}

.guild-icon-tab:focus-visible {
  outline: 2px solid var(--ui-focus-ring, rgba(211, 176, 111, 0.55));
  outline-offset: 2px;
}

.guild-icon-tab-attention-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  margin: 0;
  pointer-events: none;
}

.guild-storage-slots {
  margin: 0 0 8px;
  font-weight: 600;
}

.guild-member-row {
  margin: 0;
}

.guild-member-rank {
  margin: 0;
  font-size: 0.78rem;
}

.guild-member-rank-icon {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex: 0 0 auto;
}

.guild-member-list.friends-list {
  gap: 8px;
}

.guild-skills-pane {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}

.guild-dungeon-pane {
  display: grid;
  gap: 10px;
}

.guild-skill-card {
  margin: 0;
  min-width: 0;
}

.guild-dungeon-boss-card {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 14px;
  padding: 14px 12px 16px;
  border-radius: var(--ui-panel-radius, 12px);
  background: var(--ui-panel-bg);
  border: 1px solid var(--ui-panel-border);
  text-align: left;
}

.guild-dungeon-boss-head {
  display: grid;
  justify-items: start;
  gap: 6px;
  width: 100%;
}

.guild-dungeon-boss-art-wrap {
  flex: 0 0 auto;
  width: min(176px, 40vw);
  align-self: stretch;
  min-height: 0;
  display: flex;
}

.guild-dungeon-boss-art {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100%;
  object-fit: cover;
  object-position: center top;
  border-radius: 12px;
}

.guild-dungeon-boss-meta {
  display: grid;
  justify-items: start;
  align-content: start;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
}

.guild-dungeon-boss-name {
  font-size: 1.12rem;
}

.guild-dungeon-boss-desc {
  margin: 0;
  max-width: 36ch;
}

.guild-dungeon-rewards-label {
  margin: 2px 0 0;
  font-weight: 700;
  color: var(--gold, #d3b06f);
}

.guild-dungeon-rewards {
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
}

.guild-dungeon-reward {
  position: relative;
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
}

.guild-dungeon-reward img {
  display: block;
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.guild-dungeon-reward-qty {
  position: absolute;
  right: 1px;
  bottom: 1px;
  padding: 1px 5px;
  border-radius: 6px;
  background: rgba(8, 10, 14, 0.88);
  border: 1px solid rgba(154, 164, 176, 0.35);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.2;
  color: #e9d4a3;
  white-space: nowrap;
  pointer-events: none;
}

.guild-dungeon-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 10px 14px;
  margin-top: 4px;
  width: auto;
  max-width: 100%;
}

.guild-dungeon-actions .btn {
  flex: 0 0 auto;
  width: auto;
  max-width: none;
}

.guild-dungeon-session-timer {
  margin: 0;
  flex: 0 0 auto;
  display: inline-block;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--gold, #d3b06f);
  white-space: nowrap;
}

@media (max-width: 420px) {
  .guild-dungeon-boss-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .guild-dungeon-boss-meta,
  .guild-dungeon-boss-head {
    justify-items: center;
    width: 100%;
  }

  .guild-dungeon-rewards,
  .guild-dungeon-actions {
    justify-content: center;
  }

  .guild-dungeon-boss-art-wrap {
    width: min(220px, 72vw);
    height: min(260px, 78vw);
    align-self: center;
  }

  .guild-dungeon-boss-art {
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: cover;
  }
}

.guild-donate-form-panel {
  width: min(100%, 420px);
  padding-top: 28px;
}

.guild-donate-form-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.guild-donate-form-close:hover {
  background: rgba(255, 255, 255, 0.06);
}

.guild-donate-form-close img {
  display: block;
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.guild-donate-form-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
}

.guild-donate-form-currency {
  flex: 0 0 auto;
}

.guild-donate-form-input-wrap {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
}

.guild-donate-form-input {
  width: 100%;
  min-width: 0;
  padding-right: 42px;
  box-sizing: border-box;
}

.guild-donate-form-check {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.guild-donate-form-check:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.guild-donate-form-check img {
  display: block;
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.guild-donate-form-hint {
  margin: 0 0 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
}

.guild-donate-form-hint-limit {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.guild-donate-form-hint-icon {
  display: block;
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex: 0 0 auto;
}

.guild-donate-form-hint-sep {
  opacity: 0.65;
}

.guild-storage-lead {
  margin: 0 0 8px;
}

.guild-storage-list {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.guild-storage-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: var(--ui-panel-radius, 12px);
  background: var(--ui-panel-bg);
  border: 1px solid var(--ui-panel-border);
  color: inherit;
}

.guild-storage-row-icon {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex: 0 0 auto;
}

.guild-storage-row-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}

.guild-storage-expire {
  flex: 0 0 auto;
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  color: var(--gold, #e6c36a);
  white-space: nowrap;
}

.guild-storage-row .guild-storage-expire + .guild-storage-send-btn {
  margin-left: 0;
}

.guild-storage-send-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  margin-left: auto;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
}

.guild-storage-send-btn:hover:not(:disabled) {
  border: none;
  background: transparent;
  opacity: 0.88;
}

.guild-storage-send-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.guild-storage-send-btn img {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: none;
}

.guild-storage-send-modal .guild-storage-send-box {
  width: min(100%, 420px);
  max-height: min(88vh, 640px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.guild-storage-send-modal .guild-storage-send-box > .card-preview-title {
  margin-bottom: 14px;
}

.guild-storage-send-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: var(--ui-panel-radius, 12px);
  background: var(--ui-panel-bg);
  border: 1px solid var(--ui-panel-border);
}

.guild-storage-send-item img {
  flex: 0 0 auto;
  object-fit: contain;
}

.guild-storage-send-item-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}

.guild-storage-send-qty {
  display: grid;
  gap: 4px;
  flex: 0 0 auto;
  min-width: 0;
  justify-items: stretch;
}

.guild-storage-send-qty .friends-add-label {
  margin: 0;
  font-size: 0.78rem;
}

.guild-storage-send-qty .shop-qty-input-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-width: 0;
  max-width: 100%;
}

.guild-storage-send-qty .shop-qty-input {
  width: 96px;
  padding-right: 34px;
}

.guild-storage-send-members {
  display: grid;
  gap: 6px;
  max-height: min(36vh, 240px);
  overflow: auto;
  margin: 8px 0 12px;
  padding: 4px;
}

.guild-storage-send-member {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--ui-pill-line);
  background: var(--ui-pill-bg);
  color: inherit;
  cursor: pointer;
}

.guild-storage-send-member:hover:not(:disabled) {
  border-color: var(--ui-pill-line-active);
  background: var(--ui-pill-bg-active);
}

.guild-storage-send-member--active {
  border-color: var(--ui-selected-line, rgba(211, 176, 111, 0.55));
  box-shadow: 0 0 0 1px rgba(138, 110, 54, 0.22);
}

.guild-storage-send-member-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

.guild-storage-send-member-rank {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.guild-storage-send-member-nick {
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guild-storage-send-member-right {
  display: grid;
  gap: 2px;
  justify-items: end;
  text-align: right;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 58%;
}

.guild-storage-send-member-bm {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold, #d3b06f);
  white-space: nowrap;
}

.guild-storage-send-member-meta {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
  font-size: 0.72rem;
  line-height: 1.2;
  color: rgba(200, 206, 216, 0.88);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guild-storage-send-member-class-icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.guild-storage-send-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.guild-history-lead {
  margin: 0 0 8px;
}

.guild-history-body {
  flex: 1 1 auto;
  min-height: 0;
  max-height: min(60vh, 480px);
  overflow: auto;
  padding: 4px 2px;
}

.guild-log-line {
  display: grid;
  gap: 2px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.guild-log-line:last-child {
  border-bottom: none;
}

.guild-log-time {
  font-size: 0.78rem;
  color: var(--gold-dim, #b39b6b);
}

.guild-log-text {
  color: var(--muted, #c9d0da);
}

.guild-log-line--join .guild-log-text {
  color: rgba(150, 210, 160, 0.95);
}

.guild-log-line--leave .guild-log-text {
  color: rgba(220, 150, 140, 0.95);
}

.guild-log-line--storage .guild-log-text {
  color: var(--gold, #d9be86);
}

.guild-shop-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.guild-shop-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--ui-panel-radius, 12px);
  background: var(--ui-panel-bg);
  border: 1px solid var(--ui-panel-border);
}

.guild-shop-buy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.guild-donate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.guild-donate-actions .btn img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.guild-role-pick-actions {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.guild-role-pick-icons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 4px;
}

.guild-role-pick-icon-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 10px 8px;
  border-radius: var(--btn-radius, 10px);
  border: 1px solid var(--ui-pill-border, rgba(154, 164, 176, 0.35));
  background: var(--ui-pill-bg, rgba(20, 24, 32, 0.72));
  color: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.guild-role-pick-icon-btn img {
  display: block;
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.guild-role-pick-icon-label {
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.guild-role-pick-icon-btn--selected {
  border-color: var(--ui-selected-line, rgba(211, 176, 111, 0.85));
  box-shadow: 0 0 0 1px var(--ui-selected-line, rgba(211, 176, 111, 0.55));
}

.guild-role-pick-icon-btn--current {
  opacity: 0.45;
  cursor: default;
}

.guild-role-pick-icon-btn:disabled {
  cursor: default;
}

.guild-card-crest {
  flex: 0 0 120px;
  width: 120px;
  height: 120px;
}

.guild-card-titles {
  min-width: 0;
}

.guild-card-name {
  font-size: 1rem;
  line-height: 1.25;
}

.guild-section-title {
  margin: 0 0 8px;
  font-size: 0.98rem;
  font-weight: 700;
  color: #f0f2f6;
}

.guild-list-search {
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 10px;
}

.guild-list-body {
  margin-top: 14px;
}

.guild-member-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.guild-member-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--ui-panel-radius, 12px);
  background: var(--ui-panel-bg);
  border: 1px solid var(--ui-panel-border);
}

.guild-member-item--roster {
  flex-wrap: nowrap;
  justify-content: flex-start;
}

.guild-member-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.guild-member-meta--wide {
  flex: 1;
  min-width: 0;
}

.guild-browse-row {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.guild-browse-crest {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 12, 16, 0.55);
  border: 1px solid var(--ui-pill-line);
}

.guild-browse-crest img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.guild-browse-crest--emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.65rem;
  line-height: 1;
}

.guild-card-crest.guild-browse-crest--emoji {
  font-size: 3.2rem;
}

.guild-browse-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.guild-browse-name {
  font-size: 0.95rem;
  line-height: 1.25;
}

.guild-browse-own-tag {
  display: inline-block;
  width: fit-content;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #9fe0a8;
  background: rgba(48, 120, 64, 0.28);
  border: 1px solid rgba(90, 180, 104, 0.45);
}

.guild-browse-actions {
  flex: 0 0 auto;
  margin-left: auto;
}

.guild-browse-hint {
  white-space: nowrap;
}

.guild-browse-join-btn.btn.btn-small {
  width: auto;
  min-width: 82px;
  max-width: 96px;
  margin: 0;
}

.guild-rating-rank {
  flex: 0 0 2.75rem;
  width: 2.75rem;
  min-width: 2.75rem;
  font-weight: 700;
  color: var(--gold, #d3b06f);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.guild-rating-row .guild-browse-row {
  width: 100%;
}

.guild-rating-row .guild-browse-text {
  flex: 1 1 auto;
  min-width: 0;
}

.guild-rating-row .guild-browse-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guild-rating-row--self {
  border-color: var(--ui-selected-line, rgba(211, 176, 111, 0.45));
  box-shadow: 0 0 0 1px rgba(211, 176, 111, 0.12);
}

.guild-rating-tools {
  margin-bottom: 8px;
}

.guild-task-card {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--ui-panel-radius, 12px);
  background: var(--ui-panel-bg);
  border: 1px solid var(--ui-panel-border);
}

.guild-task-bar-wrap {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.guild-task-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(120, 150, 210, 0.85), rgba(90, 180, 120, 0.85));
}

.guild-head-actions {
  margin-top: 10px;
}

.guild-donation-books-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.guild-donation-books-modal--visible {
  opacity: 1;
  pointer-events: auto;
}

.guild-donation-books-modal__backdrop {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  margin: 0;
  background: rgba(0, 0, 0, 0.62);
  cursor: pointer;
}

.guild-donation-books-modal__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 360px);
  padding: 18px 16px 16px;
  border-radius: var(--ui-panel-radius, 14px);
  border: 1px solid var(--ui-panel-border);
  background: var(--ui-elevated-bg, rgba(24, 26, 32, 0.98));
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  text-align: center;
}

.guild-donation-books-modal__title {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #f2f4f8;
}

.guild-donation-books-modal__art-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 0 12px;
}

.guild-donation-books-modal__art {
  display: flex;
  align-items: center;
  justify-content: center;
}

.guild-donation-books-modal__img {
  display: block;
  width: 120px;
  height: 120px;
  object-fit: contain;
}

.guild-donation-books-modal__text {
  margin: 0 0 8px;
  font-size: 0.9rem;
  line-height: 1.4;
  color: rgba(236, 240, 248, 0.92);
}

.guild-donation-books-modal__text--coins {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.guild-donation-books-modal__rewards {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 12px;
}

.guild-donation-books-modal__reward-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  white-space: nowrap;
}

.guild-donation-books-modal__reward-ico {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex: 0 0 auto;
}

.guild-donation-books-modal__coin-ico {
  display: inline-block;
  vertical-align: middle;
}

.guild-donation-books-modal__btn {
  width: 100%;
  margin-top: 8px;
}

.friends-root.collections-root {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.friends-root.stub {
  padding-top: 10px;
  gap: 4px;
}

.friends-root .forge-sheet-tabs-row {
  margin-top: 0;
}

.friends-add-section {
  display: grid;
  gap: 8px;
}

.friends-add-title {
  font-size: 0.95rem;
}

.friends-root .friends-add-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: stretch;
}

.friends-root .friends-add-row .panel-search-input {
  flex: 1 1 auto;
  min-width: 0;
}

.friends-outgoing-empty {
  margin: 0;
}

.friends-action-btn--send:hover:not(:disabled) {
  border-color: rgba(211, 176, 111, 0.45);
  color: var(--gold, #d3b06f);
}

.friend-gift-form {
  display: grid;
  gap: 8px;
  margin: 4px 0 2px;
}

.friend-gift-label {
  font-size: 0.88rem;
  color: rgba(210, 214, 220, 0.92);
}

.friend-gift-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.friend-gift-gold-icon {
  flex-shrink: 0;
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.friend-gift-input {
  flex: 1 1 auto;
  min-width: 0;
}

.friend-gift-balance,
.friend-gift-hint,
.friend-gift-cooldown {
  margin: 0;
}

.friend-gift-kind-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: var(--btn-radius, 8px);
  border: 1px solid var(--ui-pill-border, rgba(255, 255, 255, 0.12));
  background: var(--ui-pill-bg, rgba(255, 255, 255, 0.06));
  cursor: pointer;
}

.friend-gift-kind-btn:disabled {
  opacity: 0.85;
  cursor: default;
}

.friend-gift-kind-picker {
  display: grid;
  gap: 6px;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid var(--ui-panel-border, rgba(255, 255, 255, 0.1));
  background: var(--ui-elevated-bg, rgba(18, 20, 26, 0.96));
}

.friend-gift-kind-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.friend-gift-kind-option--active,
.friend-gift-kind-option:hover {
  border-color: var(--ui-selected-line, rgba(211, 176, 111, 0.45));
  background: rgba(211, 176, 111, 0.08);
}

.friend-gift-kind-option span {
  flex: 1 1 auto;
}

.friends-gift-action-wrap {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
}

.friends-gift-cooldown {
  font-size: 0.72rem;
  line-height: 1;
  color: rgba(210, 214, 220, 0.85);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-width: 2.6em;
  text-align: right;
}

.friend-gift-commission {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.friend-gift-commission-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  vertical-align: middle;
}

.friend-gift-actions {
  margin-top: 4px;
}

.friends-root .forge-sheet-tabs .forge-sheet-tab {
  flex: 1 1 0;
  min-width: max-content;
  text-align: center;
}

.friends-sheet-tab--attention {
  color: var(--gold, #d3b06f);
}

.friends-sheet-panel {
  display: grid;
  gap: 8px;
  padding: 8px 0 0;
  min-width: 0;
}

.friends-list {
  display: grid;
  gap: 8px;
}

.friends-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--ui-panel-border);
  border-radius: var(--ui-panel-radius);
  background: var(--ui-stub-bg, var(--ui-panel-bg));
}

.friends-row-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.friends-row-avatar-wrap {
  flex-shrink: 0;
}

.friends-row-avatar {
  display: block;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--ui-panel-border);
  background: rgba(0, 0, 0, 0.2);
}

.friends-row-avatar--placeholder {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.18));
}

.friends-row-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.friends-row-name-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.friends-row-name {
  font-size: 0.98rem;
  line-height: 1.2;
  word-break: break-word;
}

.player-title-icon {
  display: block;
  width: 26px;
  height: 26px;
  object-fit: contain;
  flex: 0 0 auto;
}

.profile-title-picker-icon.player-title-icon {
  width: 32px;
  height: 32px;
}

.friends-row-status {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.friends-row-status--online {
  background: #5ecf6a;
  box-shadow: 0 0 0 2px rgba(94, 207, 106, 0.25);
}

.friends-row-status--offline {
  background: #e06060;
  box-shadow: 0 0 0 2px rgba(224, 96, 96, 0.2);
}

.friends-row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 0.82rem;
  color: rgba(236, 240, 248, 0.82);
}

.friends-row-meta-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 0.82rem;
  color: rgba(236, 240, 248, 0.82);
}

.friends-row-meta-class {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.friends-row-class-icon {
  display: block;
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}

.friends-row-class-label {
  line-height: 1.2;
}

.friends-row-meta-stat {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.friends-row-meta-bm {
  color: var(--gold, #d3b06f);
  font-weight: 600;
}

.friends-row-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.friends-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--btn-radius, 10px);
  border: 1px solid var(--ui-pill-line);
  background: var(--ui-pill-bg);
  color: var(--ui-pill-text);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.friends-action-btn:hover:not(:disabled) {
  background: var(--ui-pill-bg-hover, rgba(255, 255, 255, 0.06));
}

.friends-action-btn:focus-visible {
  outline: 2px solid var(--ui-focus-ring);
  outline-offset: 2px;
}

.friends-action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.friends-action-btn--gift:hover:not(:disabled) {
  border-color: rgba(211, 176, 111, 0.45);
  color: var(--gold, #d3b06f);
}

.friends-action-btn--remove:hover:not(:disabled) {
  border-color: rgba(220, 120, 120, 0.45);
  color: #e8a0a0;
}

.friends-action-btn--accept:hover:not(:disabled) {
  border-color: rgba(94, 207, 106, 0.45);
  color: #8ee89a;
}

.friends-action-btn--decline:hover:not(:disabled),
.friends-action-btn--cancel:hover:not(:disabled) {
  border-color: rgba(220, 120, 120, 0.45);
  color: #e8a0a0;
}

.friends-action-icon {
  display: block;
  pointer-events: none;
}

.leaderboard-root .section-title {
  margin: 0;
}

.leaderboard-root {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.leaderboard-toolbar {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.leaderboard-kind-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
}

.leaderboard-kind-tab {
  flex: 0 0 auto;
  margin: 0;
  border-radius: 10px;
  border: 1px solid var(--ui-pill-line);
  background: var(--ui-pill-bg);
  color: var(--ui-pill-text);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 7px 12px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.leaderboard-kind-tab:hover:not(:disabled) {
  border-color: rgba(211, 176, 111, 0.35);
  background: var(--ui-pill-bg-hover, rgba(255, 255, 255, 0.06));
}

.leaderboard-kind-tab--active {
  color: var(--ui-pill-text-active);
  border-color: var(--ui-pill-line-active);
  background: var(--ui-pill-bg-active);
  box-shadow: 0 0 0 1px rgba(211, 176, 111, 0.14) inset;
}

.leaderboard-kind-tab:focus-visible {
  outline: 2px solid var(--ui-focus-ring);
  outline-offset: 2px;
}

.leaderboard-kind-tab:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.leaderboard-period-wrap {
  position: relative;
  flex: 0 0 auto;
  margin-left: auto;
}

.leaderboard-period-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 4.8rem;
  margin: 0;
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid var(--ui-pill-line);
  background: var(--ui-pill-bg);
  color: var(--ui-pill-text);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.leaderboard-period-btn-caret {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.75;
  transform: translateY(1px);
}

.leaderboard-period-btn--open,
.leaderboard-period-btn:hover:not(:disabled) {
  border-color: var(--ui-pill-line-active);
  background: var(--ui-pill-bg-active);
  color: var(--ui-pill-text-active);
}

.leaderboard-period-btn:focus-visible {
  outline: 2px solid var(--ui-focus-ring);
  outline-offset: 2px;
}

.leaderboard-period-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.leaderboard-period-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 20;
  min-width: 8.5rem;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--ui-panel-border);
  background: var(--ui-elevated-bg, var(--ui-panel-bg));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.leaderboard-period-option {
  display: block;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: rgba(236, 240, 248, 0.92);
  font: inherit;
  font-size: 0.84rem;
  text-align: left;
  cursor: pointer;
}

.leaderboard-period-option:hover {
  background: rgba(255, 255, 255, 0.05);
}

.leaderboard-period-option--active {
  color: var(--gold, #d3b06f);
  background: rgba(211, 176, 111, 0.08);
}

.leaderboard-list-scroll {
  max-height: calc(8 * 78px + 7 * 8px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
  scrollbar-width: thin;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.leaderboard-list-empty {
  margin: 0;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto;
  align-items: center;
  justify-content: stretch;
  column-gap: 10px;
}

.leaderboard-row--self-panel {
  border-color: rgba(138, 110, 54, 0.55);
  background: rgba(31, 24, 13, 0.72);
  box-shadow: 0 0 0 1px rgba(138, 110, 54, 0.22) inset;
}

.leaderboard-row-rank {
  flex: none;
  width: 2rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gold, #d3b06f);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.leaderboard-row .friends-row-main {
  flex: none;
  min-width: 0;
  width: 100%;
  max-width: none;
}

.leaderboard-row .friends-row-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}

.leaderboard-row-class-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 0.78rem;
  line-height: 1.2;
  color: rgba(236, 240, 248, 0.88);
}

.leaderboard-row-guild-line {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
  font-size: 0.72rem;
  line-height: 1.2;
  color: rgba(236, 240, 248, 0.72);
}

.leaderboard-row-guild-line--empty {
  opacity: 0.55;
  font-style: italic;
}

.leaderboard-row-guild {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  justify-self: stretch;
  gap: 2px;
  width: 100%;
  min-width: 0;
  font-size: 0.78rem;
  line-height: 1.2;
  color: rgba(236, 240, 248, 0.82);
  text-align: center;
}

.leaderboard-row-guild--empty {
  color: rgba(236, 240, 248, 0.45);
}

.leaderboard-guild-tag {
  color: var(--gold, #d3b06f);
  font-weight: 600;
}

.leaderboard-guild-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  text-align: center;
}

.leaderboard-row-metric {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-self: end;
  gap: 2px;
  width: auto;
  min-width: 3.5rem;
}

.leaderboard-row-metric-value {
  font-size: 1rem;
  font-weight: 700;
  color: rgba(236, 240, 248, 0.95);
  font-variant-numeric: tabular-nums;
}

.leaderboard-row-metric-label {
  font-size: 0.72rem;
  color: rgba(236, 240, 248, 0.62);
}

.leaderboard-self-block {
  display: grid;
  gap: 4px;
}

.leaderboard-self-label {
  margin: 0;
  font-weight: 700;
  color: var(--gold, #d3b06f);
}

.leaderboard-row--self {
  border-color: var(--ui-selected-line, rgba(211, 176, 111, 0.45));
  box-shadow: 0 0 0 1px rgba(211, 176, 111, 0.12);
}

.ach-item--claimable {
  cursor: pointer;
  border-color: var(--ui-daily-claim-border, rgba(211, 176, 111, 0.85));
  box-shadow:
    0 0 0 1px rgba(211, 176, 111, 0.32) inset,
    0 0 10px rgba(211, 176, 111, 0.22),
    0 0 18px rgba(211, 176, 111, 0.16);
}

.ach-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 12px 8px;
  background: var(--ui-panel-bg);
  border-radius: var(--ui-panel-radius, 12px);
  border: 1px solid var(--ui-panel-border);
  text-align: left;
}

.ach-item--claimable:hover {
  border-color: rgba(211, 176, 111, 0.95);
}

.ach-item-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  row-gap: 8px;
}

.ach-item-main {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  align-self: start;
}

.ach-item-reward-col {
  grid-column: 2;
  grid-row: 1 / 3;
  flex: 0 0 84px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
  align-self: center;
}

.ach-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.ach-item-title {
  margin: 0 0 8px;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.25;
  color: #f3f6fb;
}

.ach-item-pct {
  flex: 0 0 auto;
  display: block;
  margin: 0;
  padding: 0;
  min-width: 0;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
  color: #e8c878;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ach-item-desc,
.ach-item-progress {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.35;
  color: rgba(200, 206, 216, 0.88);
}

.ach-item-reward-label {
  font-size: 0.76rem;
  color: rgba(236, 240, 248, 0.9);
}

.ach-item-reward-visual {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
}

.ach-item-reward-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 6px;
  border-radius: 999px;
  border: 1px solid var(--ui-pill-line, rgba(154, 164, 176, 0.32));
  background: var(--ui-pill-bg, rgba(34, 36, 42, 0.75));
}

.ach-item-reward-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

.ach-item-reward-icon--empty {
  border-radius: 8px;
  background: rgba(34, 36, 42, 0.75);
  border: 1px solid var(--ui-pill-line, rgba(154, 164, 176, 0.32));
}

.ach-item-reward-name {
  font-size: 0.72rem;
  line-height: 1.25;
  font-weight: 600;
  color: rgba(236, 240, 248, 0.94);
  max-width: 100%;
  word-break: break-word;
}

.ach-item-reward-qty {
  position: absolute;
  right: -2px;
  bottom: -2px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold, #d3b06f);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}

.ach-item-claim-hint {
  margin: 4px 0 0;
  font-size: 0.8rem;
  line-height: 1.3;
  color: rgba(168, 188, 210, 0.92);
}

.ach-item-bar-wrap {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  align-items: center;
  align-self: center;
  margin: 0;
  min-height: 18px;
}

.ach-item-bar-row {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  min-height: 18px;
}

.ach-item-bar {
  flex: 1 1 auto;
  min-width: 0;
  height: 4px;
  align-self: center;
  background: rgba(38, 30, 18, 0.72);
  border-radius: 2px;
  overflow: hidden;
}

.ach-item-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #b98d3d 35%, #e8c878 100%);
  border-radius: 2px;
  transition: width 0.35s ease;
}

.achievement-reward-claim-dialog__name {
  margin: 0 0 2px;
  font-size: 1rem;
  font-weight: 700;
  color: #f3f6fb;
}

.achievement-reward-claim-dialog__qty {
  margin: 0 0 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gold, #d3b06f);
}

.achievement-reward-claim-dialog__stage {
  margin-top: 0;
}

.achievement-reward-claim-dialog__ok {
  min-width: 9rem;
}

.menu-grid .btn.btn-secondary {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  width: 100%;
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
  position: relative;
}

.menu-grid .btn.btn-secondary:focus,
.menu-grid .btn.btn-secondary:focus-visible {
  outline: none;
  box-shadow: none;
}

/* Явный DOM-индикатор (надёжнее, чем только ::after у кнопки). */
.menu-attention-dot {
  position: absolute;
  top: 0;
  right: 4px;
  z-index: 6;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ff2a2a;
  box-shadow:
    0 0 0 2px rgba(18, 22, 30, 0.95),
    0 0 12px rgba(255, 60, 60, 0.85);
  animation: mail-unread-dot-pulse 1.5s ease-in-out infinite;
  pointer-events: none;
}

.menu-attention-dot[hidden] {
  display: none !important;
}

.menu-icon {
  width: 62px;
  height: 62px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.3));
}

.menu-grid.menu-grid--labels-hidden .menu-label {
  display: none;
}

.menu-label {
  display: block;
  font-size: var(--menu-label-size, 0.91rem);
  font-weight: 800;
  color: var(--text);
  text-align: center;
  white-space: normal;
  line-height: 1.12;
  max-width: 100%;
  overflow-wrap: anywhere;
  min-height: 2.35em;
}

/* Активная вкладка главного меню — как «Мир» / «Расы» в базе знаний */
.menu-grid .btn.btn-secondary.menu-btn--active {
  box-shadow: none;
}

.menu-grid .btn.btn-secondary.menu-btn--active .menu-label {
  color: var(--gold);
}

.menu-grid .btn.btn-secondary.menu-btn--active .menu-icon {
  filter: drop-shadow(0 0 14px rgba(211, 176, 111, 0.6)) drop-shadow(0 2px 10px rgba(0, 0, 0, 0.25));
}

.menu-grid.menu-grid--editing .btn.btn-secondary.menu-btn--editable {
  cursor: grab;
  border-radius: 10px;
}

.menu-grid.menu-grid--editing .btn.btn-secondary.menu-btn--editable:active {
  cursor: grabbing;
}

.menu-grid.menu-grid--editing .btn.btn-secondary.menu-btn--editable:hover {
  background: rgba(255, 255, 255, 0.03);
}

.menu-grid .btn.btn-secondary.menu-btn--dragging {
  opacity: 0.58;
  filter: saturate(0.85);
}

.menu-grid .btn.btn-secondary.menu-btn--edit-locked {
  opacity: 0.6;
}

.menu-grid .btn.btn-secondary:has(.menu-attention-dot).menu-btn--quest-attention::after {
  content: none;
  display: none;
}

.menu-grid .btn.btn-secondary.menu-btn--mail-unread::after,
.menu-grid .btn.btn-secondary.menu-btn--quest-attention::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 6px;
  z-index: 4;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #ff2a2a;
  box-shadow: 0 0 0 2px rgba(18, 22, 30, 0.9), 0 0 14px rgba(255, 54, 54, 0.72), 0 0 22px rgba(255, 42, 42, 0.46);
  animation: mail-unread-dot-pulse 1.5s ease-in-out infinite;
  pointer-events: none;
}

/* Счётчик заданий — на иконке (62px), правый нижний угол; голубой кружок, цифра по центру */
.menu-grid .btn.btn-secondary.menu-btn--quest-active-count::before {
  content: attr(data-quest-active-count);
  position: absolute;
  /* Иконка 62×62, по центру кнопки; бейдж внутри картинки */
  top: 42px;
  right: calc(50% - 31px);
  z-index: 5;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  box-sizing: border-box;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(165deg, #9fdcff, #4eb2f0 45%, #2f8fd4);
  border: 1px solid rgba(220, 245, 255, 0.95);
  color: #0a1f2e;
  font-size: 0.62rem;
  font-weight: 800;
  text-align: center;
  box-shadow:
    0 0 0 1px rgba(12, 60, 90, 0.45),
    0 2px 8px rgba(0, 0, 0, 0.35),
    0 0 12px rgba(80, 180, 255, 0.5);
  pointer-events: none;
}

@keyframes mail-unread-dot-pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 2px rgba(18, 22, 30, 0.9), 0 0 12px rgba(255, 54, 54, 0.62), 0 0 18px rgba(255, 42, 42, 0.4);
  }
  50% {
    transform: scale(1.15);
    box-shadow: 0 0 0 2px rgba(18, 22, 30, 0.9), 0 0 18px rgba(255, 78, 78, 0.88), 0 0 30px rgba(255, 42, 42, 0.58);
  }
}

.stub {
  background: var(--ui-stub-bg);
  border-radius: var(--ui-panel-radius);
  padding: 16px;
  margin-top: 14px;
  font-size: 0.92rem;
  color: var(--muted);
  border: 1px solid var(--ui-panel-border);
}

/* Нужно для абсолютного позиционирования элементов внутри карты окрестностей. */
.farm-arena-btn .farm-arena-btn__inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.farm-arena-btn .farm-arena-btn__label {
  flex: 0 0 auto;
}

.farm-arena-btn .farm-arena-btn__skull {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.35));
}

.client-hint-toast {
  position: fixed;
  left: 50%;
  top: var(--ui-toast-top, calc(72px + env(safe-area-inset-top, 0px)));
  bottom: auto;
  transform: translateX(-50%) translateY(-8px);
  /* Выше оверлея обучения (12600), иначе «Коллекция закрыта» прячется под гайдом. */
  z-index: 13150;
  max-width: min(92vw, 360px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.client-hint-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.client-hint-toast__inner {
  padding: 12px 16px;
  border-radius: var(--ui-panel-radius, 12px);
  border: 1px solid var(--ui-panel-border, rgba(255, 255, 255, 0.14));
  background: var(--ui-elevated-bg, rgba(22, 18, 14, 0.94));
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

.client-hint-toast__msg {
  margin: 0;
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.35;
  color: var(--text, #f2e8d8);
}

.client-hint-toast--stacked {
  top: auto;
}

.story-quest-toast {
  position: fixed;
  left: 50%;
  top: var(--ui-toast-top, calc(72px + env(safe-area-inset-top, 0px)));
  bottom: auto;
  transform: translateX(-50%) translateY(-8px);
  /* Выше окна конца боя (12200) и гайда (12600), иначе прогресс тонет в blur. */
  z-index: 13150;
  max-width: min(92vw, 400px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.story-quest-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.story-quest-toast__inner {
  padding: 12px 16px;
  border-radius: var(--ui-panel-radius, 12px);
  border: 1px solid rgba(211, 176, 111, 0.42);
  background: var(--ui-elevated-bg, rgba(22, 18, 14, 0.94));
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

.story-quest-toast--turnin .story-quest-toast__inner {
  border-color: rgba(211, 176, 111, 0.62);
  box-shadow:
    0 8px 28px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(211, 176, 111, 0.18) inset;
}

.story-quest-toast__msg {
  margin: 0;
  text-align: center;
  font-size: 0.92rem;
  line-height: 1.35;
  color: var(--text, #f2e8d8);
}

.forge-sharpen-break-toast__inner {
  border-color: rgba(220, 90, 90, 0.58);
  box-shadow:
    0 8px 28px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(220, 72, 72, 0.16) inset;
}

.forge-sharpen-break-toast .story-quest-toast__msg {
  color: #f5d6d6;
}

.forge-sharpen-break-toast--anchored {
  top: auto;
  bottom: auto;
  left: auto;
  right: auto;
  max-width: min(88vw, 320px);
}

.forge-sharpen-break-toast--anchored.story-quest-toast--visible {
  transform: translate(-50%, -100%);
}

.forge-sharpen-break-toast--anchored:not(.story-quest-toast--visible) {
  transform: translate(-50%, calc(-100% - 8px));
}

.gear-enc-bonus--lv1 {
  color: rgba(236, 240, 248, 0.98);
}

.gear-enc-bonus--lv2 {
  color: rgba(120, 175, 255, 0.98);
}

.gear-enc-bonus--lv3 {
  color: rgba(232, 200, 120, 0.98);
}

.no-energy-toast {
  position: fixed;
  left: 50%;
  top: var(--ui-toast-top, calc(72px + env(safe-area-inset-top, 0px)));
  bottom: auto;
  transform: translateX(-50%) translateY(-8px);
  z-index: 12060;
  max-width: min(92vw, 380px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.no-energy-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.no-energy-toast__inner {
  padding: 12px 16px;
  border-radius: var(--ui-panel-radius, 12px);
  border: 1px solid var(--ui-panel-border, rgba(255, 255, 255, 0.14));
  background: var(--ui-elevated-bg, rgba(22, 18, 14, 0.94));
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

.no-energy-toast__msg {
  margin: 0;
  text-align: center;
  font-size: 0.92rem;
  line-height: 1.35;
  color: var(--text, #f2e8d8);
}

.no-energy-toast__lead {
  display: block;
  font-weight: 800;
  margin-bottom: 4px;
}

.no-energy-toast__detail {
  display: block;
  font-size: 0.86rem;
  color: var(--muted, #c9d0da);
}

.stub.farm-stub {
  position: relative;
}

/* Нехватка энергии: как disabled, но кликабельно — показываем тост «Не хватает энергии». */
.stub.farm-stub .btn.btn--farm-energy-lock {
  color: #9ea7b4;
  border-color: rgba(132, 140, 150, 0.6);
  background: linear-gradient(
      180deg,
      rgba(164, 172, 182, 0.36) 0%,
      rgba(102, 110, 120, 0.34) 52%,
      rgba(58, 64, 72, 0.5) 100%
    ),
    rgba(44, 48, 56, 0.92);
  box-shadow: inset 0 0 0 999px rgba(120, 126, 136, 0.2), 0 2px 10px rgba(6, 7, 10, 0.24);
  cursor: pointer;
  opacity: 0.82;
  filter: saturate(0.2) contrast(0.95);
}

.stub.farm-stub .btn.btn-action.btn--farm-energy-lock {
  opacity: 0.45;
}

.farm-stub--explore-map .hint,
.farm-stub--explore-map .section-title {
  /* Отодвигаем текст, чтобы кнопка "Назад" не перекрывала описание. */
  padding-right: 62px;
}


/* Узкий блок журнала действий под картой */
.farm-stub--explore-map .explore-map-log {
  max-width: min(100%, 260px);
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 16px;
  box-sizing: border-box;
}

.farm-stub--explore-map .explore-map-log--rewards {
  max-width: min(100%, 360px);
  text-align: center;
}

.farm-stub--explore-map .explore-log-potion {
  display: inline-flex;
  width: 100%;
  justify-content: center;
  align-items: center;
}

.farm-stub--explore-map .explore-log-rewards-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 2px;
  font-size: 0.95rem;
}

.farm-stub--explore-map .explore-log-reward {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.farm-stub--explore-map .explore-log-reward-icon {
  display: block;
  flex-shrink: 0;
  object-fit: contain;
}

.farm-stub--explore-map .explore-log-reward-icon--energy {
  width: 18px;
  height: 18px;
}

.farm-stub--explore-map .explore-log-reward-sep {
  color: rgba(200, 196, 180, 0.55);
  user-select: none;
}

.farm-stub--explore-map .explore-log-reward-delta {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.farm-stub--explore-map .explore-log-reward-delta--plus {
  color: #c9e6b8;
}

.farm-stub--explore-map .explore-log-reward-delta--minus {
  color: #e8c49a;
}

.farm-stub--explore-map .explore-log-potion-text {
  margin-left: 0.35rem;
}

/* Инвентарь на карте — колонка с ускорением (.explore-right-stack), только картинка */
.farm-stub--explore-map .explore-inv-fab {
  position: static;
  width: auto;
  height: auto;
  min-width: 44px;
  min-height: 44px;
  margin: 0 !important;
  padding: 2px !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  z-index: auto;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.farm-stub--explore-map .explore-inv-fab:active {
  transform: scale(0.96);
}

.farm-stub--explore-map .explore-inv-fab-icon {
  display: block;
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.explore-side-potions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.explore-side-bars {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  max-width: 76px;
  align-items: stretch;
}

.explore-mini-bar-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: stretch;
}

.explore-mini-bar-track {
  height: 5px;
  border-radius: 4px;
  background: rgba(12, 14, 20, 0.85);
  border: 1px solid rgba(100, 110, 128, 0.35);
  overflow: hidden;
}

.explore-mini-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.25s ease;
}

.explore-mini-bar-fill--hp {
  background: linear-gradient(90deg, #8b3a3a 0%, #c45c5c 55%, #e88888 100%);
}

.explore-mini-bar-fill--mana {
  background: linear-gradient(90deg, #2a4a7a 0%, #4a7ab8 55%, #7ab0e8 100%);
}

.explore-mini-bar-nums {
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
  color: rgba(236, 240, 248, 0.92);
  text-shadow: 0 1px 4px rgba(10, 5, 24, 0.45);
  text-align: center;
  white-space: nowrap;
}

.section-title {
  color: var(--accent);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.profile-card {
  background: var(--card);
  border-radius: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  margin-top: 10px;
}

.profile-card-upper {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 16px;
  margin-bottom: 14px;
}

.profile-card-left {
  flex: 1;
  min-width: 0;
}

.profile-card-left .profile-stats-core {
  margin-top: 12px;
  align-content: start;
}

.profile-card-upper--portrait .profile-portrait-wrap {
  position: relative;
  flex: 0 0 42%;
  max-width: 168px;
  min-width: 118px;
  align-self: stretch;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--line);
  box-shadow: 0 4px 20px rgba(10, 5, 24, 0.4);
  background: var(--surface-deep);
}

.profile-card-upper--portrait .profile-portrait-wrap--awakened {
  overflow: visible;
  border-color: rgba(255, 205, 115, 0.72);
  box-shadow:
    0 0 12px rgba(255, 205, 115, 0.52),
    0 0 26px rgba(255, 175, 55, 0.34),
    0 4px 20px rgba(10, 5, 24, 0.4);
}

.profile-portrait-wrap--awakened::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  border-radius: inherit;
  box-shadow: inset 0 0 22px rgba(255, 210, 120, 0.22);
}

.profile-portrait-clip {
  position: absolute;
  inset: 0;
  border-radius: calc(12px - 2px);
  overflow: hidden;
}

/* Подпись на портрете профиля («Полный профиль» — клик по картинке открывает героя). */
.profile-portrait-full-banner {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 6px 10px;
  text-align: center;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: rgba(252, 248, 235, 0.98);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  background: rgba(8, 11, 18, 0.58);
  border-top: 1px solid rgba(191, 160, 96, 0.24);
  border-radius: 0 0 calc(12px - 2px) calc(12px - 2px);
  pointer-events: none;
  z-index: 2;
}

.profile-class-emblem-wrap {
  flex: 0 0 96px;
  align-self: flex-start;
  border-radius: 12px;
  border: 2px solid rgba(191, 160, 96, 0.5);
  background: rgba(24, 28, 36, 0.85);
  box-shadow: 0 0 16px rgba(191, 160, 96, 0.22);
  padding: 4px;
  cursor: pointer;
}

.profile-class-emblem {
  display: block;
  width: 88px;
  height: 88px;
  object-fit: contain;
  border-radius: 8px;
}

.profile-card-upper .profile-portrait {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 160px;
  object-fit: cover;
  object-position: center top;
}

.profile-card-divider {
  border: none;
  border-top: 1px solid rgba(191, 160, 96, 0.42);
  margin: 0 0 8px;
}

.profile-bottom-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.profile-stats-extra {
  margin-top: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.class-tree-wrap {
  border: 1px solid rgba(191, 160, 96, 0.35);
  border-radius: 12px;
  padding: 8px;
  margin-bottom: 6px;
  background: rgba(255, 255, 255, 0.02);
}

.class-tree-modal-box {
  max-width: 760px;
}

.class-tree-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.class-path-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.class-path-card {
  border: 1px solid rgba(154, 164, 176, 0.35);
  border-radius: 10px;
  padding: 8px;
  background: rgba(11, 16, 24, 0.45);
}

.class-path-card--active {
  border-color: rgba(211, 176, 111, 0.6);
  box-shadow: 0 0 0 1px rgba(138, 110, 54, 0.32);
  box-sizing: border-box;
}

.class-path-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.class-talent-list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.class-talent-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(154, 164, 176, 0.25);
  border-radius: 8px;
}

.class-talent-row--open {
  border-color: rgba(124, 206, 142, 0.45);
}

.profile-side-buttons {
  display: flex;
  flex-direction: row;
  gap: 10px;
  flex: 0 0 auto;
  justify-content: flex-end;
  align-items: flex-end;
}

.profile-side-btn-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.profile-side-icon-label {
  font-size: 0.78rem;
  color: #b39b6b;
  line-height: 1;
  white-space: nowrap;
}

.profile-side-btn {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  border: none;
  /* The icon PNGs are transparent; let the page background show through. */
  background: transparent;
  color: #f3e1b4;
  box-shadow: none;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  padding: 0;
}

.profile-side-icon {
  width: 44px;
  height: 44px;
  object-fit: contain;
  display: block;
}

.profile-side-btn:active {
  transform: scale(0.98);
}


.profile-card .nick {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0;
  line-height: 1.2;
  word-break: break-word;
}

.profile-nick-line .nick {
  margin: 0;
}

.profile-card .meta {
  margin-top: 0;
  color: #d4ccbb;
  font-size: 0.95rem;
}

.profile-card .meta span {
  color: #f0d8a1;
}

.profile-meta-class-row {
  display: flex;
  align-items: baseline;
  gap: 0.35em;
}

.profile-meta-class-k {
  flex-shrink: 0;
}

.profile-card .meta .profile-meta-class-k {
  color: inherit;
}

.profile-meta-class-v {
  min-width: 0;
  color: #f0d8a1;
}

.profile-class-word {
  white-space: nowrap;
}

.profile-class-word + .profile-class-word::before {
  content: '\00a0';
}

.stats-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 10px;
  margin-top: 12px;
  font-size: 0.92rem;
  align-items: baseline;
}

.stats-grid b {
  color: var(--gold);
}

.profile-energy-regen-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 0.28em;
  font-weight: 300;
  white-space: nowrap;
}

.profile-energy-value-inline {
  white-space: nowrap;
}

.profile-xp-value-inline {
  white-space: nowrap;
}

.resource-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.resource-val {
  color: var(--gold);
  display: inline-flex;
  align-items: baseline;
}

.resource-val b {
  color: var(--gold);
}

.profile-chapter {
  margin-top: 8px;
  margin-bottom: 0;
}

.profile-tutorial-cta {
  text-align: center;
  color: rgba(240, 216, 161, 0.95);
  font-size: 0.95rem;
  font-weight: 600;
  margin: 16px 0 0;
  padding: 0 8px;
}

.profile-footer-actions {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  align-self: stretch;
  width: 100%;
  gap: 6px;
  max-width: 100%;
}

.profile-footer-inline {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  align-self: flex-start;
  gap: 8px;
  width: min(100%, 9.25rem);
  min-width: 0;
}

.profile-footer-actions .game-log {
  margin-top: 0;
  min-width: 0;
  width: 100%;
}

.profile-promo-input {
  flex: 1 1 0%;
  box-sizing: border-box;
  min-width: 0;
  height: 32px;
  border-radius: 9px;
  border: 1px solid rgba(154, 164, 176, 0.35);
  background: rgba(11, 9, 17, 0.55);
  color: #ece5d5;
  padding: 0 8px;
  font-weight: 600;
  font-size: 0.8rem;
}

.currency-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.currency-icon-inline {
  width: 22px;
  height: 22px;
  object-fit: contain;
  display: inline-block;
}

.currency-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.currency-inline b {
  line-height: 1;
}

.bm-eye-btn {
  margin-left: 8px;
  width: 34px;
  height: 28px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(191, 160, 96, 0.52);
  background: rgba(50, 40, 25, 0.4);
  color: #f3e1b4;
  cursor: pointer;
  box-shadow: 0 1px 12px rgba(10, 5, 24, 0.25);
}

.bm-eye-btn:active {
  transform: scale(0.98);
}

.bm-secret {
  letter-spacing: 0.14em;
  color: #b39b6baa;
}

.xp-bar {
  grid-column: 1 / -1;
  height: 10px;
  background: rgba(38, 30, 18, 0.72);
  border-radius: 6px;
  overflow: hidden;
  margin-top: 4px;
}

.profile-vip-subs {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  margin-top: 8px;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.profile-vip-sub-btn {
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  line-height: 0;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none;
  outline: none;
  transition: transform 0.15s ease;
  flex: 1 1 0;
  min-width: 0;
  max-width: 56px;
}

.profile-vip-sub-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.profile-vip-sub-btn:hover {
  transform: scale(1.05);
}

.profile-vip-sub-btn:active {
  transform: scale(0.98);
}

.profile-vip-sub-btn__img {
  width: 100%;
  height: auto;
  max-height: 40px;
  object-fit: contain;
  border: none;
  border-radius: 0;
  object-fit: contain;
  display: block;
  box-shadow: none;
  background: transparent;
}

.profile-vip-sub-dialog__visual {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 8px 0 12px;
}

.profile-vip-sub-dialog__img {
  width: auto;
  height: 120px;
  max-width: 160px;
  border: none;
  border-radius: 0;
  object-fit: contain;
  display: block;
  box-shadow: none;
  background: transparent;
}

.profile-vip-sub-dialog__perk {
  margin: 0 0 10px;
  text-align: center;
  line-height: 1.45;
}

.profile-vip-sub-dialog__remaining {
  margin: 0 0 14px;
  text-align: center;
  color: rgba(236, 240, 248, 0.92);
  font-size: 0.95rem;
}

.profile-vip-sub-dialog__remaining b {
  color: var(--accent);
}

.profile-auto-salvage-settings {
  margin: 0 0 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(154, 164, 176, 0.22);
}

.profile-auto-salvage-settings__hint {
  margin: 10px 0 8px;
  text-align: center;
  font-size: 0.8rem;
}

.profile-auto-salvage-settings__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(108px, max-content));
  justify-content: start;
  gap: 8px 14px;
  width: fit-content;
  margin: 0 auto;
}

.profile-auto-salvage-settings__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
  margin: 0;
  padding: 2px 0;
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: inherit;
  user-select: none;
}

.profile-auto-salvage-settings__checkbox {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.profile-auto-salvage-settings__box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid var(--ui-pill-line);
  background: rgba(8, 10, 14, 0.85);
  color: var(--gold, #d9be86);
  font-size: 0.95rem;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.profile-auto-salvage-settings__label {
  min-width: 0;
  margin-left: 0;
}

.profile-auto-salvage-settings__item:hover:not(:has(.profile-auto-salvage-settings__checkbox:disabled)) .profile-auto-salvage-settings__box {
  border-color: var(--ui-pill-line-active);
  background: rgba(20, 24, 32, 0.95);
}

.profile-auto-salvage-settings__item--on .profile-auto-salvage-settings__box {
  border-color: rgba(211, 176, 111, 0.55);
  background: rgba(28, 22, 14, 0.95);
  box-shadow: 0 0 0 1px rgba(211, 176, 111, 0.18) inset;
}

.profile-auto-salvage-settings__item--on .profile-auto-salvage-settings__label {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.profile-auto-salvage-settings__item:disabled,
.profile-auto-salvage-settings__checkbox:disabled + .profile-auto-salvage-settings__box {
  opacity: 0.55;
  cursor: wait;
}

.profile-auto-salvage-settings__checkbox:focus-visible + .profile-auto-salvage-settings__box {
  outline: 2px solid var(--ui-focus-ring, rgba(217, 190, 134, 0.45));
  outline-offset: 2px;
}

.profile-auto-salvage-settings__item:has(.profile-auto-salvage-settings__checkbox:disabled) {
  opacity: 0.55;
  cursor: wait;
}

.profile-vip-sub-modal.card-preview-modal {
  z-index: 12180;
}

.profile-vip-sub-dialog.card-preview-dialog {
  position: relative;
  width: min(340px, 92vw);
  margin: 0;
  padding: 16px 18px 18px;
  border-radius: 18px;
  border: 1px solid rgba(154, 164, 176, 0.32);
  background: rgba(12, 14, 18, 0.96);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  text-align: center;
}

.profile-vip-sub-dialog .card-preview-title-wrap {
  margin: 0 2.5rem 4px;
}

.profile-vip-sub-dialog .card-preview-close {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 2;
}

.profile-vip-sub-dialog .card-preview-actions {
  display: flex;
  justify-content: center;
  margin-top: 4px;
}

.profile-vip-sub-dialog .card-preview-actions .btn {
  min-width: 9rem;
  margin: 0;
}

.profile-vip-sub-dialog__perk {
  color: var(--gold, #d3b06f);
}

/* ===== Герой / статы / экипировка ===== */
.hero-root {
  padding: 8px 12px 16px;
  position: relative;
}

.hero-root.stub {
  margin-top: 4px;
  padding-top: 8px;
}

.hero-identity-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin: 0 0 6px;
  padding-right: 44px;
  min-width: 0;
}

.hero-root .hero-nickname.section-title {
  margin: 0;
  line-height: 1.2;
}

.hero-identity-meta {
  margin: 0;
  font-weight: 300;
  font-size: 0.82rem;
  line-height: 1.25;
  color: var(--muted, rgba(236, 240, 248, 0.72));
  min-width: 0;
}

.hero-profile-session-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0;
  margin-top: 14px;
}

.hero-profile-session-actions .btn {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  margin: 0;
  border-radius: 0;
}

.hero-profile-session-actions .btn:first-child {
  border-top-left-radius: var(--btn-radius, 12px);
  border-bottom-left-radius: var(--btn-radius, 12px);
}

.hero-profile-session-actions .btn:last-child {
  border-top-right-radius: var(--btn-radius, 12px);
  border-bottom-right-radius: var(--btn-radius, 12px);
}

.hero-profile-session-actions #btn-logout-profile {
  border-left-width: 0;
}

.hero-back-square {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 38px;
  height: 38px;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 14px;
  border: 2px solid rgba(191, 160, 96, 0.52);
  background: rgba(50, 40, 25, 0.35);
  color: #f3e1b4;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 1.1rem;
  z-index: 2;
  user-select: none;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}

.hero-back-square:active {
  transform: scale(0.98);
}

.ui-icon-btn-img {
  display: block;
  object-fit: contain;
}

.hero-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 10px;
  overflow: visible;
}

.hero-stats-card,
.hero-equip-card {
  border: 1px solid rgba(154, 164, 176, 0.32);
  border-radius: 14px;
  padding: 12px;
  background: rgba(20, 22, 28, 0.64);
  overflow: visible;
}

.hero-stats-grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.95rem;
}

.hero-stat-line {
  position: relative;
  border-radius: 8px;
  padding: 4px 6px;
  margin: 0 -6px;
  cursor: help;
  outline: none;
}

.hero-stat-line:hover,
.hero-stat-line:focus-within {
  background: rgba(255, 255, 255, 0.05);
}

.hero-stat-line:focus-visible .hero-stat-line-head {
  box-shadow: 0 0 0 2px rgba(191, 160, 96, 0.45);
  border-radius: 6px;
}

.hero-stat-line-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 10px;
  align-items: center;
}

.hero-stat-pop {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 40;
  min-width: min(100%, 220px);
  max-width: min(96vw, 320px);
  max-height: min(48vh, 260px);
  overflow-y: auto;
  padding: 10px 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(180, 155, 110, 0.45);
  background: linear-gradient(165deg, rgba(28, 32, 42, 0.98) 0%, rgba(12, 14, 20, 0.99) 100%);
  box-shadow:
    0 12px 36px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-4px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0.2s;
}

.hero-stat-line:hover .hero-stat-pop,
.hero-stat-line:focus-within .hero-stat-pop {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.hero-stat-pop-p {
  margin: 0 0 8px;
  font-size: 0.82rem;
  line-height: 1.45;
  color: rgba(228, 232, 240, 0.95);
}

.hero-stat-pop-p:last-child {
  margin-bottom: 0;
}

.hero-stats-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.hero-stats-aside {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  flex: 0 0 auto;
  width: 200px;
  min-width: 0;
}

.hero-stats-aside .hero-stat-alloc-toolbar {
  margin-bottom: 0;
}

.hero-stat-alloc-toolbar-wrap {
  margin-top: 10px;
}

.hero-portrait-wrap {
  position: relative;
  flex: 0 0 auto;
  border-radius: 12px;
  overflow: visible;
  border: 1px solid rgba(191, 160, 96, 0.42);
  background: #120e18;
  box-shadow: 0 4px 18px rgba(10, 5, 24, 0.25);
}

.hero-portrait-wrap--awakened {
  overflow: visible;
  border-color: rgba(255, 205, 115, 0.72);
  box-shadow:
    0 0 12px rgba(255, 205, 115, 0.52),
    0 0 26px rgba(255, 175, 55, 0.34),
    0 4px 18px rgba(10, 5, 24, 0.25);
}

.hero-portrait-wrap--awakened::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  border-radius: inherit;
  box-shadow: inset 0 0 22px rgba(255, 210, 120, 0.22);
}

.hero-portrait-wrap--awakened .hero-portrait {
  border-radius: 10px;
}

.hero-portrait {
  display: block;
  width: 200px;
  height: 320px;
  object-fit: cover;
  object-position: center top;
  border-radius: 12px;
}

.hero-portrait-wrap .battle-player-debuffs {
  position: absolute;
  left: 6px;
  bottom: 6px;
  z-index: 5;
  display: flex;
  gap: 4px;
}

.hero-portrait-wrap .battle-player-debuff {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  overflow: visible;
  border: 1px solid rgba(180, 60, 60, 0.85);
  background: rgba(12, 8, 10, 0.72);
}

.hero-portrait-wrap .battle-player-debuff.is-buff {
  border-color: var(--gold, #d4b56a);
}

.hero-portrait-wrap .battle-player-debuff img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
  margin: 1px;
}

.hero-portrait-wrap .battle-player-debuff-tip {
  display: none;
  position: absolute;
  left: 0;
  bottom: calc(100% + 6px);
  width: max-content;
  max-width: 220px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--ui-panel-border, rgba(255, 255, 255, 0.18));
  background: var(--ui-elevated-bg, rgba(16, 18, 24, 0.96));
  color: var(--text, #f2f4f8);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 8;
}

.hero-portrait-wrap .battle-player-debuff-tip strong,
.hero-portrait-wrap .battle-player-debuff-tip span {
  display: block;
}

.hero-portrait-wrap .battle-player-debuff-tip span {
  font-size: 0.78rem;
  color: var(--muted, #c9d0da);
}

.hero-portrait-wrap .battle-player-debuff:hover .battle-player-debuff-tip,
.hero-portrait-wrap .battle-player-debuff:focus-within .battle-player-debuff-tip {
  display: block;
}


.hero-stats-key {
  color: #d7ccb4;
}

.hero-stats-val b {
  color: var(--accent);
}

.hero-stats-val-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  flex-wrap: nowrap;
  min-width: 0;
}

/* Резервируем место под «+», чтобы строки не прыгали при включении режима */
.hero-stat-plus-slot {
  display: inline-flex;
  flex: 0 0 1.1rem;
  width: 1.1rem;
  min-width: 1.1rem;
  min-height: 1em;
  align-items: center;
  justify-content: flex-end;
}

.hero-stat-plus-btn {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  flex: 0 0 auto;
  margin: 0;
  padding: 1px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: rgba(211, 176, 111, 0.88);
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  cursor: pointer;
}

.hero-stat-plus-btn:hover {
  color: #fff4d8;
  background: rgba(255, 255, 255, 0.06);
}

.hero-stat-plus-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(191, 160, 96, 0.45);
}

.hero-stat-alloc-toolbar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(154, 164, 176, 0.28);
  background: rgba(12, 14, 20, 0.55);
}

.hero-stat-alloc-head {
  min-width: 0;
  width: 100%;
}

.hero-farm-gain {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--ui-panel-border, rgba(154, 164, 176, 0.28));
  background: var(--ui-panel-bg, rgba(12, 14, 20, 0.55));
  font-size: 0.9rem;
}

.hero-farm-gain b {
  color: var(--gold, #d4b56a);
}

.hero-stat-alloc-line {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}

/* В режиме распределения: ✓ (готово) + сброс справа */
.hero-stat-alloc-side-actions {
  display: flex;
  flex: 0 0 auto;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
}

.hero-stat-alloc-pool-box {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(191, 160, 96, 0.32);
  background: rgba(32, 28, 20, 0.4);
}

.hero-stat-alloc-pool-box .hero-stat-alloc-pool {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: max-content;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  line-height: 1.25;
}

.hero-stat-alloc-pool-box:has(> .hero-stat-alloc-mode-btn) .hero-stat-alloc-pool {
  max-width: calc(100% - 44px);
}

.hero-stat-alloc-pool-label {
  display: block;
  text-align: center;
}

.hero-stat-alloc-pool-num {
  display: block;
  margin-top: 1px;
  text-align: center;
}

.hero-stat-alloc-pool-num b {
  color: var(--accent);
}

.hero-stat-alloc-mode-btn {
  flex: 0 0 auto;
  margin-left: auto;
  width: 42px;
  height: 42px;
  padding: 0;
  margin: 0;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #f0e6d4;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: none;
}

.hero-stat-alloc-btn--icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  line-height: 0;
}

.hero-stat-alloc-btn--icon .hero-stat-alloc-btn-img {
  display: block;
  pointer-events: none;
  object-fit: contain;
}

.hero-stat-alloc-mode-btn.hero-stat-alloc-btn--icon .hero-stat-alloc-btn-img {
  width: 32px;
  height: 32px;
  opacity: 0.95;
}

.hero-stat-alloc-done-btn.hero-stat-alloc-btn--icon .hero-stat-alloc-btn-img,
.hero-stat-reset-gold-btn.hero-stat-alloc-btn--icon .hero-stat-alloc-btn-img {
  width: 34px;
  height: 34px;
  opacity: 0.92;
}

.hero-stat-alloc-mode-btn[aria-pressed='true'] {
  border-color: transparent;
  background: transparent;
  color: #fff4d8;
}

.hero-stat-alloc-mode-btn:hover {
  background: transparent;
}

.hero-stat-alloc-mode-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(191, 160, 96, 0.45);
}

.hero-stat-alloc-spent {
  margin: 0;
  padding-top: 2px;
  line-height: 1.3;
  font-size: 0.92em;
  opacity: 0.9;
}

.hero-stat-alloc-done-btn {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  padding: 0;
  margin: 0;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: #a8d4a8;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: none;
}

.hero-stat-alloc-done-btn.hero-stat-alloc-btn--icon {
  font-size: 0;
}

.hero-stat-alloc-done-btn:hover {
  background: transparent;
  color: #d0f0d0;
}

.hero-stat-alloc-done-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(120, 180, 130, 0.5);
}

.hero-stat-reset-gold-btn {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  padding: 0;
  margin: 0;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: #c5bdb0;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  box-shadow: none;
}

.hero-stat-reset-gold-btn.hero-stat-alloc-btn--icon {
  font-size: 0;
}

.hero-stat-reset-gold-btn:hover:not(:disabled) {
  background: transparent;
  color: #f0e6d4;
}

.hero-stat-reset-gold-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.hero-stat-reset-gold-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(191, 160, 96, 0.45);
}

.hero-stat-reset-cost {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 14px 0 0;
}

.hero-stat-reset-cost__ico {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.hero-stat-reset-cost__qty {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gold, #d3b06f);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.hero-stats-val .bm-eye-btn {
  margin-left: 0;
  margin-right: 8px;
}

/* Экипировка героя: секции (оружие / броня / бижутерия) и строки слотов */
.equip-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.equip-grid-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.equip-grid-section + .equip-grid-section {
  margin-top: 2px;
}

.equip-grid-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 1px;
}

.equip-grid-section-line {
  flex: 1 1 auto;
  min-width: 8px;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(191, 160, 96, 0.42) 12%,
    rgba(191, 160, 96, 0.42) 88%,
    transparent
  );
}

.equip-grid-section-label {
  flex: 0 1 auto;
  max-width: 92%;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(211, 176, 111, 0.78);
  text-align: center;
  line-height: 1.25;
}

/* Всегда 3 колонки: в рядах с 2 предметами третья ячейка пустая — ширина слотов как у «шлем/броня/перчатки». */
.equip-grid-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.equip-slot {
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  border: 2px solid rgba(191, 160, 96, 0.52);
  background: rgba(31, 24, 13, 0.64);
  padding: 8px 6px 10px;
  text-align: center;
  cursor: pointer;
  user-select: none;
  min-height: 168px;
  box-sizing: border-box;
}

.equip-slot--filled {
  position: relative;
  border-color: #d3b06f;
  box-shadow: 0 0 0 1px rgba(138, 110, 54, 0.35);
}

/* Симметричные отступы: иначе только padding-right сдвигает центр подписи влево относительно карточки. */
.equip-slot--filled .equip-slot-title {
  padding-inline: 40px;
  box-sizing: border-box;
}

.equip-slot-title {
  flex: 0 0 auto;
  width: 100%;
  box-sizing: border-box;
  font-size: 0.72rem;
  font-weight: 700;
  color: #f3e1b4;
  margin-bottom: 4px;
  line-height: 1.15;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  text-align: center;
}

.equip-slot-title-text {
  min-width: 0;
}

.equip-slot-new-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #e53935;
  box-shadow: 0 0 0 2px rgba(12, 10, 8, 0.92);
}

.equip-slot-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
}

.equip-slot-icon {
  font-size: 1.35rem;
  filter: drop-shadow(0 0 5px rgba(201, 156, 76, 0.55));
}

.equip-slot-empty {
  color: rgba(228, 206, 162, 0.45);
  font-weight: 700;
  font-size: 0.95rem;
}

.equip-slot-icon-img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.45));
}

.equip-slot-icon-wrap,
.inv-gear-summon-img-wrap {
  position: relative;
  display: inline-flex;
}

.gear-plus-badge {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 2;
  min-width: 20px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  border: 1px solid rgba(160, 170, 186, 0.45);
  background: rgba(10, 14, 22, 0.82);
  color: rgba(241, 245, 252, 0.96);
  font-size: 0.64rem;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
}

/* «Новое»: левый верх (инвентарь — угол ячейки; миниатюра внешности — угол превью). */
.item-thumb-new-dot {
  position: absolute;
  top: 3px;
  left: 3px;
  right: auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff2a2a;
  box-shadow:
    0 0 0 2px rgba(12, 10, 8, 0.92),
    0 0 8px rgba(255, 60, 60, 0.75);
  pointer-events: none;
  z-index: 2;
}

/* Ячейка снаряжения в сетке инвентаря — точка в левом верхнем углу всей карточки (над рамкой внутренней кнопки). */
.inv-gear-tile > .item-thumb-new-dot {
  top: 5px;
  left: 5px;
  z-index: 6;
}

.appearance-thumb-wrap {
  position: relative;
  display: inline-block;
  border-radius: 8px;
  line-height: 0;
}

.equip-slot:not(.equip-slot--filled) {
  cursor: default;
}

.equip-slot:has(.equip-slot-pick-btn) {
  cursor: pointer;
}

.equip-slot-pick-btn {
  width: 100%;
  flex: 1 1 auto;
  min-height: 108px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 6px;
  margin: 0;
  border: 1px dashed rgba(191, 160, 96, 0.5);
  border-radius: 10px;
  background: rgba(8, 10, 14, 0.45);
  color: rgba(228, 206, 162, 0.88);
  font: inherit;
  cursor: pointer;
  box-sizing: border-box;
}

.equip-slot-pick-btn:active {
  transform: scale(0.98);
}

.equip-slot-pick-plus {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
  color: rgba(211, 176, 111, 0.95);
}

.equip-slot-pick-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(220, 200, 160, 0.85);
}

.equip-slot-body--hero-filled {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
}

.hero-equip-unequip-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 4;
  width: 30px;
  height: 30px;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid rgba(191, 160, 96, 0.45);
  background: rgba(18, 22, 30, 0.92);
  color: rgba(245, 238, 220, 0.92);
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.hero-equip-unequip-btn:active {
  transform: scale(0.96);
}

.hero-equip-unequip-btn .btn-equip-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-gear-pick-box {
  width: min(420px, 96vw);
  max-height: min(88vh, 680px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-sizing: border-box;
}

/* Превью экипировки героя: карточка + колонка сравнения со слотом */
/* ===== Развитие класса (пробуждение) ===== */
.class-awakening-root {
  padding: 12px 16px 16px;
  position: relative;
}

.class-awakening-top {
  position: relative;
  margin-bottom: 10px;
}

.class-awakening-top--with-resources {
  padding-right: 44px;
  margin-bottom: 12px;
}

.class-awakening-top .class-awakening-back {
  position: absolute;
  top: 0;
  right: 0;
}

.class-awakening-resources-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  font-size: 0.88rem;
  line-height: 1.35;
}

.class-awakening-resources-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.class-awakening-resources-count {
  color: var(--text, #f0e6cc);
  font-weight: 700;
}

.class-awakening-teachings-drop {
  display: flex;
  align-items: center;
  gap: 8px;
}

.class-awakening-teachings-drop-body {
  position: relative;
  min-width: 0;
}

.class-awakening-teachings-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 2px 6px 2px 2px;
  margin: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.class-awakening-teachings-trigger:hover {
  background: var(--ui-pill-bg-hover, rgba(40, 44, 52, 0.55));
}

.class-awakening-teachings-chevron {
  font-size: 0.72rem;
  line-height: 1;
  color: var(--muted, #c9d0da);
}

.class-awakening-teachings-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 20;
  min-width: min(240px, calc(100vw - 48px));
  margin: 0;
  padding: 6px;
  list-style: none;
  border-radius: var(--ui-elevated-radius, 10px);
  border: 1px solid var(--ui-elevated-border, rgba(154, 164, 176, 0.35));
  background: var(--ui-elevated-bg, rgba(24, 26, 32, 0.96));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.class-awakening-teachings-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 8px;
  border-radius: 6px;
}

.class-awakening-teachings-menu-item + .class-awakening-teachings-menu-item {
  margin-top: 2px;
}

.class-awakening-teachings-menu-item:hover {
  background: var(--ui-pill-bg-hover, rgba(40, 44, 52, 0.55));
}

.class-awakening-pick-lead {
  margin: 0 0 14px;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text, #f0e6cc);
}

.class-awakening-stone-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 0.92rem;
}

.class-awakening-res-icon {
  display: block;
  object-fit: contain;
}

.class-awakening-log {
  margin: 8px 0;
}

.class-awakening-branch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0 16px;
}

@media (max-width: 480px) {
  .class-awakening-branch-grid {
    grid-template-columns: 1fr;
  }
}

.class-awakening-branch-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  margin-bottom: 6px;
  font-size: 2.4rem;
  line-height: 1;
}

.class-awakening-branch-icon-img {
  display: block;
  width: min(156px, 72vw);
  height: auto;
  max-height: 156px;
  object-fit: contain;
}

.class-awakening-branch-blurb {
  margin: 4px 0 0;
  font-size: 0.88rem;
  line-height: 1.35;
}

.class-awakening-branch-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  border-radius: var(--ui-panel-radius, 12px);
  border: 1px solid var(--ui-panel-border, rgba(154, 164, 176, 0.3));
  background: var(--ui-panel-bg, rgba(20, 22, 28, 0.72));
  text-align: center;
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.class-awakening-branch-card:hover:not(:disabled) {
  border-color: rgba(211, 176, 111, 0.45);
}

.class-awakening-branch-card--selected {
  border-color: var(--gold, #d3b06f);
  box-shadow: 0 0 0 1px var(--gold, #d3b06f), 0 0 14px rgba(211, 176, 111, 0.28);
}

.class-awakening-branch-card:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.class-awakening-branch-name {
  font-size: 1rem;
  color: var(--text, #f0e6cc);
}

.class-awakening-skill-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: var(--ui-panel-radius, 12px);
  border: 1px solid var(--ui-panel-border, rgba(154, 164, 176, 0.3));
  background: var(--ui-panel-bg, rgba(20, 22, 28, 0.72));
}

.class-awakening-skill-body {
  flex: 1 1 auto;
  min-width: 0;
}

/* Картинка навыка в «Развитии класса»: слева, по центру по вертикали */
.class-awakening-skill-art {
  flex: 0 0 auto;
  align-self: center;
  width: 64px;
  height: 64px;
  border-radius: 10px;
  border: 1px solid var(--ui-panel-border, rgba(154, 164, 176, 0.35));
  background: rgba(8, 10, 14, 0.55);
  overflow: hidden;
}

.class-awakening-skill-art-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.class-awakening-skill-art-fallback {
  display: block;
  width: 100%;
  height: 100%;
  background: rgba(120, 178, 255, 0.12);
}

.class-awakening-skill-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex: 0 0 auto;
  padding-top: 2px;
}

.class-awakening-skill-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
}

.class-awakening-skill-icon-btn:hover:not(:disabled) {
  filter: brightness(1.12);
}

.class-awakening-skill-icon-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
}

.class-awakening-skill-icon-btn img {
  display: block;
  object-fit: contain;
}

.class-awakening-skill-max {
  font-size: 0.78rem;
  text-align: center;
}

.class-awakening-skill-info-box {
  max-width: min(94vw, 420px);
}

.class-awakening-skill-info-head {
  margin-bottom: 6px;
}

.class-awakening-skill-info-art {
  display: block;
  width: 56px;
  height: 56px;
  margin: 0 auto 6px;
  border-radius: 10px;
  border: 1px solid var(--ui-panel-border, rgba(154, 164, 176, 0.35));
  background: rgba(8, 10, 14, 0.55);
  overflow: hidden;
}

.class-awakening-skill-info-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.class-awakening-skill-info-kind {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted, #c9d0da);
}

.class-awakening-skill-info-lv {
  margin: 0 0 10px;
}

.class-awakening-skill-info-level-picker {
  margin-bottom: 12px;
}

.class-awakening-skill-info-level-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.class-awakening-skill-info-level-nav {
  display: flex;
  gap: 6px;
}

.class-awakening-skill-lv-step {
  width: 32px;
  height: 32px;
  border: 1px solid var(--ui-pill-border, rgba(154, 164, 176, 0.35));
  border-radius: 8px;
  background: var(--ui-pill-bg, rgba(28, 32, 40, 0.85));
  color: var(--text, #f0e6cc);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.class-awakening-skill-info-stat {
  margin: 6px 0 0;
  font-size: 0.9rem;
  line-height: 1.4;
}

.class-awakening-skill-info-stat--meta {
  color: var(--muted, #c9d0da);
}

.class-awakening-awaken-btn {
  display: block;
  width: 100%;
  max-width: 320px;
  margin: 4px auto 0;
}

.class-awakening-skill-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 12px;
}

@media (min-width: 640px) {
  .class-awakening-skill-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}

.class-awakening-skill-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.class-awakening-skill-desc {
  margin: 0 0 8px;
  line-height: 1.4;
  font-size: 0.9rem;
}

.class-awakening-skill-lv {
  margin-bottom: 10px;
  font-size: 0.92rem;
}

.class-awakening-skill-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.class-awakening-learn-btn-inner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.class-awakening-learn-btn-icon {
  display: block;
  object-fit: contain;
}

.class-awakening-awaken-confirm-path {
  color: var(--gold, #d3b06f);
  font-weight: 700;
}

/* Экипировка героя: кнопка кузницы внутри окна слева */
.gear-preview-modal-with-forge {
  width: min(94vw, 440px);
}

.hero-root .gear-preview-modal--hero .gear-preview-inv-gear-wrap {
  position: relative;
}

/* Название снаряжения в «полном профиле» должно быть по центру. */
.hero-root .gear-preview-modal--hero .card-preview-title-row .card-preview-title {
  text-align: center;
}

.hero-root .gear-preview-modal--hero .gear-preview-forge-btn {
  position: absolute;
  left: 12px;
  top: 12px;
  transform: none;
  z-index: 2;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 14px;
  border: 1px solid var(--ui-pill-line, rgba(120, 124, 132, 0.55));
  background: var(--ui-pill-bg, rgba(36, 38, 44, 0.92));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.hero-root .gear-preview-modal--hero .gear-preview-forge-btn:hover {
  border-color: var(--ui-pill-line-active, rgba(150, 154, 162, 0.75));
  background: var(--ui-pill-bg-active, rgba(52, 54, 60, 0.95));
}

.hero-root .gear-preview-modal--hero .gear-preview-forge-btn:focus-visible {
  outline: 2px solid var(--ui-focus-ring, rgba(150, 155, 165, 0.9));
  outline-offset: 2px;
}

.hero-root .gear-preview-modal--hero .gear-preview-forge-btn-img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  display: block;
  pointer-events: none;
  opacity: 0.92;
}

.hero-root .gear-preview-modal--hero .card-preview-box--gear-inv {
  position: relative;
  width: 100%;
  padding-left: 18px;
}

.gear-preview-hero-body-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin-top: 4px;
  box-sizing: border-box;
}

.gear-preview-hero-body-main {
  flex: 1 1 auto;
  min-width: 0;
}

.gear-preview-compare {
  flex: 0 0 42%;
  max-width: 46%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(154, 164, 176, 0.28);
  background: rgba(10, 14, 22, 0.75);
  box-sizing: border-box;
  text-align: left;
}

.gear-preview-compare-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(211, 206, 188, 0.95);
  margin: 0 0 8px;
  line-height: 1.2;
}

.gear-preview-compare-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gear-preview-compare-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.74rem;
  line-height: 1.3;
  color: rgba(210, 215, 228, 0.92);
}

.gear-preview-compare-line--up span:last-child {
  color: #7ecf9a;
  font-weight: 700;
}

.gear-preview-compare-line--down span:last-child {
  color: #e89898;
  font-weight: 700;
}

.gear-preview-compare-line--bm {
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid rgba(154, 164, 176, 0.22);
}

.hero-gear-pick-card--equipped {
  border-color: #d3b06f;
  background: rgba(31, 24, 13, 0.64);
  box-shadow: 0 0 0 1px rgba(138, 110, 54, 0.35);
}

.hero-gear-pick-worn-badge {
  display: block;
  margin-top: 2px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ui-pill-text);
}

/* Превью снаряжения героя: полоска свободных предметов для слота */
.gear-preview-hero-equip-wrap {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(154, 164, 176, 0.22);
}

.gear-preview-hero-equip-hint {
  margin: 0 0 10px;
  text-align: center;
  font-size: 0.82rem;
  line-height: 1.35;
}

.gear-preview-hero-equip-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: flex-start;
  max-height: min(200px, 38vh);
  overflow-y: auto;
  padding: 2px 0 6px;
}

.gear-preview-strip-tile {
  position: relative;
  width: 52px;
  height: 52px;
  padding: 0;
  margin: 0;
  border-radius: 10px;
  border: 2px solid rgba(191, 160, 96, 0.45);
  background: rgba(8, 10, 14, 0.55);
  cursor: pointer;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.gear-preview-strip-tile:hover {
  border-color: #d3b06f;
  background: rgba(22, 28, 38, 0.88);
}

.gear-preview-strip-tile:active {
  transform: scale(0.96);
}

.gear-preview-strip-tile-img-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gear-preview-strip-tile-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}

.gear-preview-strip-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  z-index: 2;
}

.hero-gear-pick-empty {
  margin: 0;
  text-align: center;
}

/* Сетка «в наличии» под карточкой в превью экипировки героя */
.hero-gear-pick-grid--in-preview {
  max-height: min(260px, 44vh);
}

.hero-gear-pick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 100px;
  max-height: min(46vh, 360px);
  padding: 4px 2px 8px;
  -webkit-overflow-scrolling: touch;
}

.hero-gear-pick-card {
  position: relative;
  border-radius: 12px;
  border: 2px solid rgba(154, 164, 176, 0.35);
  background: rgba(16, 20, 28, 0.92);
  padding: 8px 6px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: center;
  box-sizing: border-box;
  min-height: 118px;
}

.hero-gear-pick-card:not(:disabled):hover {
  border-color: rgba(211, 176, 111, 0.55);
}

.hero-gear-pick-card--selected {
  border-color: rgba(236, 205, 140, 0.95);
  box-shadow: 0 0 0 2px rgba(211, 176, 111, 0.28), 0 6px 22px rgba(0, 0, 0, 0.35);
}

.hero-gear-pick-card--locked {
  opacity: 0.48;
  cursor: not-allowed;
}

.hero-gear-pick-card-img-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hero-gear-pick-card-plus {
  right: -2px;
  bottom: -2px;
  z-index: 2;
}

.hero-gear-pick-card-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  display: block;
}

.hero-gear-pick-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  z-index: 2;
}

.hero-gear-pick-card-name {
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.15;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.hero-gear-pick-card .rarity-tag {
  font-size: 0.65rem;
  padding: 1px 5px;
}

.equip-slot-gear-btn {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
}

.equip-slot-gear-btn .hint {
  font-size: 0.68rem;
  line-height: 1.2;
  max-width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.equip-slot-gear-btn .rarity-tag {
  flex-shrink: 0;
  font-size: 0.62rem;
}

.xp-fill {
  height: 100%;
  background: linear-gradient(90deg, #b98d3d 35%, #efd9a0 100%);
  border-radius: 6px;
  transition: width 0.35s ease;
}

.game-log {
  margin-top: 12px;
  padding: 12px;
  background: rgba(11, 9, 17, 0.72);
  border-radius: 10px;
  border: 1px solid rgba(154, 164, 176, 0.28);
  font-size: 0.9rem;
  line-height: 1.45;
  color: #ece5d5;
  min-height: 2.5em;
}

.btn-action {
  margin-top: 10px;
}

.btn-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.quest-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0;
  padding: 12px;
  background: var(--ui-panel-bg);
  border-radius: var(--ui-panel-radius);
  border: 1px solid var(--ui-panel-border);
}

/* Иначе author `.quest-row { display: flex }` перебивает UA-стиль [hidden], и строки не скрываются (фильтр инвентаря, разбор без надетого). */
.quest-row[hidden] {
  display: none !important;
}

.shop-row-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.shop-item-cost {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  margin-top: 4px;
}

.shop-cost-cell {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.shop-cost-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.shop-cost-icon.shop-cost-icon--gold {
  width: 15px;
  height: 15px;
}

.shop-cost-plus {
  font-weight: 700;
  opacity: 0.82;
  user-select: none;
}

.shop-snack-limit-hint {
  display: block;
  margin-top: 4px;
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.25;
  color: #c44a4a;
}

.shop-topbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  margin-bottom: 10px;
}

.shop-topbar-row1 {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.shop-topbar-row2 {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.shop-pockets {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.shop-pocket-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.shop-pocket-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.shop-pocket-qty {
  color: var(--gold);
  font-weight: 800;
  font-size: 0.92rem;
  line-height: 1;
  white-space: nowrap;
}

/* Поле поиска — единый вид (как в «Коллекциях»): лавка, крафт, внешность, коллекции */
.panel-search-input {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.9rem;
  border: 1px solid rgba(120, 124, 132, 0.55);
  background: rgba(36, 38, 44, 0.92);
  color: rgba(230, 232, 236, 0.96);
  outline: none;
  box-shadow: none;
}

.panel-search-input::placeholder {
  color: rgba(160, 164, 172, 0.75);
}

.panel-search-input:focus {
  border-color: rgba(150, 154, 162, 0.85);
  background: rgba(40, 42, 48, 0.98);
}

.shop-search {
  width: min(260px, 62vw);
  max-width: 100%;
  flex: 0 0 auto;
  min-width: 0;
}

/* Ширина поля поиска ≈ одна ячейка сетки лавки/крафта (2 колонки, gap 12px). */
.shop-search--card-width {
  width: calc((100% - 12px) / 2);
  max-width: calc((100% - 12px) / 2);
  flex: 0 0 auto;
  box-sizing: border-box;
}

.shop-topbar-row2--search-line {
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 10px 14px;
}

.shop-topbar-pockets-inline {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px 14px;
  flex: 1 1 auto;
  min-width: 0;
}

.shop-topbar-row3,
.craft-topbar-row3 {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
}

.craft-topbar {
  gap: 12px;
}

.craft-topbar-row3 {
  margin-top: 14px;
}

.craft-topbar-row3 .shop-pockets {
  width: 100%;
}

.shop-gold {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ece5d5;
  font-weight: 800;
}

.shop-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 12px;
  row-gap: 12px;
  align-items: stretch;
}

.shop-grid .quest-row {
  margin: 0;
  height: 100%;
  min-height: 150px;
  align-self: stretch;
  display: grid;
  grid-template-rows: minmax(min-content, 1fr) auto;
  grid-template-columns: 1fr;
  gap: 8px;
  align-content: stretch;
}

.shop-card-meta {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.shop-card-title {
  flex: 0 0 auto;
  line-height: 1.35;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.shop-bait-tail {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
}

.shop-card-hint {
  margin-top: 4px;
  font-size: 0.85em;
  line-height: 1.35;
  opacity: 0.9;
}

.shop-card-cost-wrap {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 4px;
  min-height: 0;
  margin-top: 10px;
}

.shop-card-cost-wrap .shop-item-cost {
  margin-top: 0;
}

.shop-card-cost-wrap .shop-snack-limit-hint {
  margin-top: 0;
}

.shop-grid .shop-row-head {
  flex: 1 1 auto;
  flex-direction: row;
  align-items: stretch;
  min-height: 0;
}

.shop-grid .shop-item-icon-wrap {
  align-self: center;
}

.shop-grid .shop-row-actions {
  margin-top: 0;
  justify-content: center;
  width: 100%;
}

.craft-card-meta {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.craft-card-title {
  flex: 0 0 auto;
  line-height: 1.35;
}

.craft-recipe-cost-wrap {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  min-height: 0;
}

.craft-recipe-cost {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 0;
}

.craft-res {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.craft-res-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.craft-res--short {
  opacity: 0.42;
}

.craft-topbar-row2 {
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 10px;
  width: 100%;
}

.craft-pockets-single {
  flex: 1 1 100%;
  min-width: 0;
  flex-wrap: wrap;
}

/* Выровнять поле количества и «Создать» по нижнему краю карточки (одинаковая высота в ряду сетки). */
.craft-grid {
  align-items: stretch;
}

.craft-grid .quest-row {
  height: 100%;
  min-height: 0;
  align-self: stretch;
  /* Сетка вместо flex-колонки: верхняя зона тянется, низ с кнопками всегда снизу — без налезания. */
  display: grid;
  grid-template-rows: minmax(min-content, 1fr) auto;
  grid-template-columns: 1fr;
  gap: 8px;
  align-content: stretch;
}

.craft-grid .shop-row-head {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  min-width: 0;
}

.craft-grid .shop-item-icon-wrap {
  align-self: center;
}

.craft-grid .shop-row-actions.craft-row-actions {
  margin-top: 0;
  justify-content: center;
  width: 100%;
  padding-left: 0;
  padding-right: 0;
}

.craft-grid .craft-card-meta {
  min-width: 0;
  min-height: 0;
}

.craft-grid .quest-row.craft-row--locked {
  opacity: 0.72;
  cursor: pointer;
}

.craft-grid .quest-row.craft-row--locked .shop-row-actions {
  pointer-events: auto;
}

/* Призыв */
.summon-root {
  text-align: center;
  overflow: visible;
}

.stub.summon-root {
  /* Свечение blur выходит за границы картинки — не обрезать скруглённым блоком .stub */
  overflow: visible;
}

.summon-hint {
  text-align: left;
  margin-bottom: 8px;
}

.summon-hint--flavor {
  font-style: italic;
  line-height: 1.55;
  color: #c8c2b4;
  letter-spacing: 0.02em;
}

.summon-balance {
  margin: 0 0 14px;
  font-weight: 700;
  color: #ece5d5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 10px;
}

.summon-balance-label {
  flex: 0 0 auto;
}

.summon-currency-toggles {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.summon-currency-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid var(--ui-pill-line);
  border-radius: var(--btn-radius, 8px);
  background: var(--ui-pill-bg);
  color: var(--ui-pill-text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.summon-currency-btn:hover:not(:disabled) {
  border-color: var(--ui-pill-line-active);
  background: var(--ui-pill-bg-active);
  color: var(--ui-pill-text-active);
}

.summon-currency-btn--active {
  border-color: var(--ui-selected-line, rgba(211, 176, 111, 0.62));
  background: var(--ui-pill-bg-active);
  color: var(--ui-pill-text-active);
  box-shadow: 0 0 0 1px var(--ui-selected-line, rgba(211, 176, 111, 0.35));
}

.summon-currency-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.summon-inline-stone {
  width: 22px;
  height: 22px;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
}

.summon-inline-stone.summon-inline-warrior-summon {
  width: 28px;
  height: 28px;
}

.summon-orb-wrap {
  position: relative;
  display: inline-block;
  margin: 8px auto 16px;
  z-index: 0;
  overflow: visible;
}

.summon-glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 300px;
  height: 300px;
  margin: 0;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transform-origin: center center;
  background: radial-gradient(
    circle,
    rgba(255, 230, 160, 0.88) 0%,
    rgba(212, 168, 72, 0.55) 24%,
    rgba(160, 110, 40, 0.22) 52%,
    rgba(80, 50, 24, 0.06) 70%,
    transparent 78%
  );
  opacity: 0;
  pointer-events: none;
  z-index: 0;
  filter: blur(3px);
  /* Убирает «матовый» прямоугольник от слоя blur на тёмном фоне */
  mix-blend-mode: screen;
  -webkit-mask-image: radial-gradient(circle closest-side, #000 0%, #000 38%, rgba(0, 0, 0, 0.45) 62%, transparent 76%);
  mask-image: radial-gradient(circle closest-side, #000 0%, #000 38%, rgba(0, 0, 0, 0.45) 62%, transparent 76%);
}

.summon-orb-img {
  position: relative;
  z-index: 1;
  display: block;
  max-width: min(168px, 72vw);
  height: auto;
  object-fit: contain;
  transition: filter 0.35s ease;
}

.summon-orb-img.summon-orb-img--menu {
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(40, 28, 10, 0.35);
}

.summon-orb-img.summon-orb-img--fate-gates {
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(40, 28, 10, 0.35);
}

.summon-orb-wrap.summon-orb-wrap--charging .summon-glow {
  opacity: 1;
  animation: summon-golden-charge 3s ease-in-out forwards;
}

.summon-orb-wrap.summon-orb-wrap--charging .summon-orb-img {
  filter: drop-shadow(0 0 22px rgba(255, 214, 120, 0.95))
    drop-shadow(0 0 52px rgba(212, 168, 55, 0.75)) drop-shadow(0 0 4px rgba(255, 248, 220, 0.5));
}

/* Прямоугольник 12px + box-shadow давали видимую «рамку» поверх круглого арта при свечении */
.summon-orb-wrap.summon-orb-wrap--charging .summon-orb-img.summon-orb-img--menu {
  border-radius: 50%;
  box-shadow: none;
}

.summon-orb-wrap.summon-orb-wrap--charging.summon-orb-wrap--prismatic .summon-glow {
  background:
    radial-gradient(
      circle at 50% 50%,
      rgba(255, 245, 180, 0.55) 0%,
      rgba(255, 201, 120, 0.4) 16%,
      rgba(255, 120, 120, 0.34) 30%,
      rgba(120, 225, 145, 0.3) 44%,
      rgba(110, 190, 255, 0.28) 58%,
      rgba(188, 128, 255, 0.26) 72%,
      rgba(255, 124, 205, 0.2) 84%,
      rgba(70, 46, 28, 0.06) 92%,
      transparent 100%
    ),
    radial-gradient(
      circle at 35% 30%,
      rgba(255, 168, 168, 0.26) 0%,
      rgba(255, 168, 168, 0.05) 55%,
      transparent 75%
    ),
    radial-gradient(
      circle at 66% 70%,
      rgba(118, 197, 255, 0.24) 0%,
      rgba(118, 197, 255, 0.05) 52%,
      transparent 72%
    );
  filter: blur(10px) saturate(1.14);
  /* Одна анимация: вторая перезаписывала opacity/transform и ломала плавное свечение */
  animation: summon-golden-charge 3s ease-in-out forwards;
}

.summon-orb-wrap.summon-orb-wrap--charging.summon-orb-wrap--prismatic .summon-orb-img {
  filter: drop-shadow(0 0 18px rgba(255, 95, 95, 0.65))
    drop-shadow(0 0 20px rgba(104, 197, 255, 0.68))
    drop-shadow(0 0 26px rgba(183, 118, 255, 0.68))
    drop-shadow(0 0 32px rgba(255, 210, 95, 0.62));
}

@keyframes summon-golden-charge {
  0% {
    opacity: 0.72;
    transform: translate(-50%, -50%) scale(0.88);
    filter: blur(2px) brightness(1.05);
  }
  18% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.12);
    filter: blur(4px) brightness(1.25);
  }
  38% {
    opacity: 0.82;
    transform: translate(-50%, -50%) scale(0.98);
    filter: blur(3px) brightness(1.1);
  }
  55% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.18);
    filter: blur(5px) brightness(1.35);
  }
  72% {
    opacity: 0.88;
    transform: translate(-50%, -50%) scale(1.02);
    filter: blur(3px) brightness(1.12);
  }
  88% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.14);
    filter: blur(4px) brightness(1.28);
  }
  100% {
    opacity: 0.96;
    transform: translate(-50%, -50%) scale(1.08);
    filter: blur(3px) brightness(1.18);
  }
}

.summon-result {
  min-height: 1.5em;
  margin: 0 0 16px;
  font-weight: 800;
  font-size: 0.98rem;
}

.summon-result--hit {
  color: #d3b06f;
}

.summon-result--miss {
  color: #9aa8b8;
}

.summon-inline-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
}

.summon-tier-buttons {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: center;
  gap: 6px;
  flex: 1 1 auto;
  width: auto;
  max-width: none;
  margin: 0;
}

.summon-custom-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  width: auto;
  max-width: none;
  margin: 0;
  justify-content: center;
}

.summon-custom-input-wrap {
  position: relative;
  display: block;
  flex: 0 0 120px;
  width: 120px;
}

.summon-custom-input {
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  flex: none;
  height: 34px;
  text-align: center;
  padding: 0 30px 0 10px;
}

.summon-custom-input-wrap .btn.btn-shop-max-inline {
  width: 24px;
  min-width: 24px;
  height: 17px;
  font-size: 7px;
  right: 4px;
}

.summon-custom-btn {
  flex: 0 0 auto;
  width: 44px;
  padding: 8px 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.summon-custom-btn-icon {
  display: block;
  width: auto !important;
  height: 20px !important;
  object-fit: contain;
  flex: 0 0 auto;
}

.summon-custom-btn-icon.summon-custom-btn-icon--warrior-summon {
  height: 26px !important;
}

.summon-tier-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  margin: 0;
  padding: 8px 6px;
}

.summon-root--busy .summon-tier-btn {
  opacity: 0.88;
}

.summon-drop-grid {
  margin: 12px auto 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 8px;
  max-width: 460px;
  align-items: stretch;
}

.summon-drop-tile {
  border: 1px solid rgba(154, 164, 176, 0.36);
  border-radius: 12px;
  background: rgba(28, 34, 43, 0.5);
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 92px;
  box-sizing: border-box;
}

button.summon-drop-tile {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  width: 100%;
  text-align: center;
}

button.summon-drop-tile--gear {
  cursor: pointer;
}

button.summon-drop-tile:focus-visible {
  outline: 2px solid rgba(197, 141, 255, 0.75);
  outline-offset: 2px;
}

button.summon-drop-tile:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.summon-drop-tile--uncommon {
  border-color: rgba(136, 207, 143, 0.58);
  background: linear-gradient(180deg, rgba(48, 118, 62, 0.32) 0%, rgba(24, 48, 32, 0.34) 100%);
}

.summon-drop-tile--uncommon .summon-drop-label {
  color: #88cf8f;
}

.summon-drop-tile--rare {
  border-color: rgba(127, 177, 255, 0.62);
  background: linear-gradient(180deg, rgba(56, 88, 142, 0.32) 0%, rgba(26, 38, 63, 0.34) 100%);
}

.summon-drop-tile--epic {
  border-color: rgba(197, 141, 255, 0.62);
  background: linear-gradient(180deg, rgba(92, 52, 136, 0.34) 0%, rgba(40, 28, 62, 0.35) 100%);
}

.summon-drop-tile--legendary {
  border-color: rgba(255, 205, 115, 0.68);
  background: linear-gradient(180deg, rgba(128, 92, 38, 0.34) 0%, rgba(58, 42, 22, 0.36) 100%);
}

.summon-drop-tile--mythic {
  border-color: rgba(255, 107, 107, 0.68);
  background: linear-gradient(180deg, rgba(136, 48, 48, 0.33) 0%, rgba(62, 25, 25, 0.36) 100%);
}

.summon-drop-icon {
  width: 48px;
  height: 48px;
  max-width: 48px;
  max-height: 48px;
  object-fit: contain;
  object-position: center;
  flex-shrink: 0;
}

/* В модалке списка дропа — чуть компактнее, пропорции те же. */
.summon-drop-list-modal .summon-drop-icon {
  width: 34px;
  height: 34px;
  max-width: 34px;
  max-height: 34px;
}

.summon-drop-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.summon-drop-qty {
  font-weight: 800;
  font-size: 0.96rem;
  color: #e9d4a3;
  line-height: 1;
}

.summon-drop-label {
  font-size: 0.73rem;
  color: #bfc9d7;
  line-height: 1.1;
}

button.summon-drop-tile--group {
  cursor: pointer;
}

.summon-drop-list-modal .summon-drop-list-box {
  position: relative;
  width: min(400px, 94vw);
  padding: 6px 10px 12px;
}

.summon-drop-list-modal .card-preview-close {
  position: absolute;
  top: 4px;
  right: 4px;
}

.summon-drop-list-modal .race-confirm-title {
  margin: 0 30px 8px 0;
  padding-top: 0;
  font-size: 1rem;
  line-height: 1.15;
}

.summon-drop-list-modal__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  max-height: min(52vh, 420px);
  overflow-y: auto;
  padding: 0 2px;
}

.summon-drop-list-modal .race-confirm-actions {
  margin-top: 10px;
}

/* ——— Почта ——— */
.mail-root {
  display: grid;
  gap: 10px;
}

.mail-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.mail-page-head .section-title {
  margin: 0;
}

.mail-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.mail-toolbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--btn-radius, 10px);
  border: 1px solid var(--ui-pill-line);
  background: var(--ui-pill-bg);
  color: var(--ui-pill-text);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.mail-toolbar-btn:hover:not(:disabled) {
  border-color: var(--ui-pill-line-active);
  background: var(--ui-pill-bg-active);
  color: var(--ui-pill-text-active);
}

.mail-toolbar-btn:focus-visible {
  outline: 2px solid var(--ui-focus-ring);
  outline-offset: 2px;
}

.mail-toolbar-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.mail-toolbar-icon {
  display: block;
  pointer-events: none;
}

.mail-unread-badge {
  color: var(--gold, #d3b06f);
  font-weight: 700;
}

.mail-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mail-item {
  flex: 0 0 auto;
  border: 1px solid var(--ui-panel-border);
  border-radius: var(--ui-panel-radius);
  background: var(--ui-panel-bg);
  overflow: hidden;
}

.mail-item--unread {
  border-color: var(--ui-selected-line, rgba(211, 176, 111, 0.45));
  box-shadow: 0 0 0 1px rgba(211, 176, 111, 0.12);
}

.mail-item--active {
  border-color: var(--ui-pill-line-active);
}

.mail-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  margin: 0;
  border: none;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.mail-item-head:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.03);
}

.mail-item-head:focus-visible {
  outline: 2px solid var(--ui-focus-ring);
  outline-offset: -2px;
}

.mail-item-head:disabled {
  cursor: wait;
  opacity: 0.7;
}

.mail-item-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.mail-item-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.mail-item-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #e8e2d4;
}

.mail-item--unread .mail-item-title {
  color: var(--gold, #e9d4a3);
}

.mail-item-sent-at {
  font-size: 0.72rem;
  color: #9aa3b0;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.mail-item-preview {
  font-size: 0.8rem;
  color: #a8b0bc;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.mail-item-chevron {
  flex-shrink: 0;
  color: #8f98a6;
  font-size: 0.9rem;
  line-height: 1;
  margin-top: 2px;
}

.mail-item-body {
  padding: 0 14px 14px;
  display: grid;
  gap: 10px;
}

.mail-item-text {
  font-size: 0.86rem;
  line-height: 1.45;
  color: #c8d0db;
  white-space: pre-wrap;
  word-break: break-word;
}

.mail-item-rewards-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mail-item-rewards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}

.mail-reward-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 6px;
  border-radius: 999px;
  border: 1px solid var(--ui-pill-line);
  background: var(--ui-pill-bg);
}

.mail-reward-chip img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.mail-reward-qty {
  font-weight: 800;
  font-size: 0.88rem;
  color: #e9d4a3;
  font-variant-numeric: tabular-nums;
}

.mail-item-claim-btn {
  flex-shrink: 0;
  margin-left: auto;
}

.mail-item-claim-btn--glow {
  border-color: var(--ui-daily-claim-border, rgba(211, 176, 111, 0.85));
  box-shadow: var(--ui-daily-claim-shadow, 0 0 0 1px rgba(211, 176, 111, 0.32) inset, 0 0 16px rgba(211, 176, 111, 0.28));
  color: var(--gold, #d3b06f);
}

.mail-item-claim-btn--glow:hover:not(:disabled) {
  border-color: rgba(211, 176, 111, 0.95);
  box-shadow:
    0 0 0 1px rgba(211, 176, 111, 0.38) inset,
    0 0 18px rgba(211, 176, 111, 0.34);
}

.mail-item-claimed-hint {
  margin: 0;
  font-size: 0.8rem;
}

.rarity-tag {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(154, 164, 176, 0.5);
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 0.67rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
  margin-left: 4px;
  vertical-align: middle;
}

.rarity-tag[hidden] {
  display: none !important;
}

.rarity-tag--common {
  color: var(--gear-rarity-color-common, #c6ced9);
  border-color: color-mix(in srgb, var(--gear-rarity-color-common, #c6ced9) 55%, transparent);
}
.rarity-tag--uncommon {
  color: var(--gear-rarity-color-uncommon, #88cf8f);
  border-color: color-mix(in srgb, var(--gear-rarity-color-uncommon, #88cf8f) 55%, transparent);
}
.rarity-tag--rare {
  color: var(--gear-rarity-color-rare, #7fb1ff);
  border-color: color-mix(in srgb, var(--gear-rarity-color-rare, #7fb1ff) 58%, transparent);
}
.rarity-tag--epic {
  color: var(--gear-rarity-color-epic, #c58dff);
  border-color: color-mix(in srgb, var(--gear-rarity-color-epic, #c58dff) 58%, transparent);
}
.rarity-tag--legendary {
  color: var(--gear-rarity-color-legendary, #ffcd73);
  border-color: color-mix(in srgb, var(--gear-rarity-color-legendary, #ffcd73) 62%, transparent);
}
.rarity-tag--mythic {
  color: var(--gear-rarity-color-mythic, #ff6b6b);
  border-color: color-mix(in srgb, var(--gear-rarity-color-mythic, #ff6b6b) 62%, transparent);
}

/** Цветное название ранга с тёмной обводкой (подпись товара). */
.shop-rank-text {
  font-weight: 700;
  -webkit-text-stroke: 0.4px rgba(0, 0, 0, 0.85);
  text-shadow:
    -1px -1px 0 rgba(0, 0, 0, 0.75),
    1px -1px 0 rgba(0, 0, 0, 0.75),
    -1px 1px 0 rgba(0, 0, 0, 0.75),
    1px 1px 0 rgba(0, 0, 0, 0.75);
}
.shop-rank-text--common { color: var(--gear-rarity-color-common, #c6ced9); }
.shop-rank-text--uncommon { color: var(--gear-rarity-color-uncommon, #88cf8f); }
.shop-rank-text--rare { color: var(--gear-rarity-color-rare, #7fb1ff); }
.shop-rank-text--epic { color: var(--gear-rarity-color-epic, #c58dff); }
.shop-rank-text--legendary { color: var(--gear-rarity-color-legendary, #ffcd73); }
.shop-rank-text--mythic { color: var(--gear-rarity-color-mythic, #ff6b6b); }

/**
 * Мягкое свечение за иконкой снаряжения (необычное+).
 * Размытый цветной «блик» без видимой окружности/тарелки.
 */
.gear-rarity-glow {
  position: relative;
  isolation: isolate;
  --gear-rarity-glow-core: transparent;
  background: none;
  box-shadow: none;
  border-radius: 0;
}

.gear-rarity-glow::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 78%;
  height: 78%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--gear-rarity-glow-core);
  filter: blur(14px);
  opacity: 0.9;
  pointer-events: none;
  z-index: 0;
}

/* Картинка и обёртка-кнопка всегда поверх блика, иначе свечение рисуется сверху. */
.gear-rarity-glow > * {
  position: relative;
  z-index: 1;
}

.gear-rarity-glow > img,
.gear-rarity-glow img,
.gear-rarity-glow .equip-slot-icon-img,
.gear-rarity-glow .inv-cell-tile__img,
.gear-rarity-glow .hero-gear-pick-card-img,
.gear-rarity-glow .forge-preview-img,
.gear-rarity-glow .forge-craft-material-img,
.gear-rarity-glow .summon-drop-icon,
.gear-rarity-glow .forge-strip-fallback,
.gear-rarity-glow .forge-center-empty,
.gear-rarity-glow .market-category-card-img,
.gear-rarity-glow .market-drill-row__img-btn,
.gear-rarity-glow .market-sell-my-img-btn,
.gear-rarity-glow.market-sell-dock-item-img img {
  position: relative;
  z-index: 1;
}

/* Бейджи количества/офферов остаются absolute — только поверх свечения. */
.gear-rarity-glow .market-sell-inv-qty,
.gear-rarity-glow .market-sell-my-qty,
.gear-rarity-glow .market-category-card-badge {
  z-index: 2;
}

.market-category-card-visual.gear-rarity-glow::before,
.market-browse-drill__visual.gear-rarity-glow::before,
.market-sell-inv-visual.gear-rarity-glow::before,
.market-sell-my-visual.gear-rarity-glow::before {
  width: 88%;
  height: 88%;
  filter: blur(12px);
}

.market-drill-row__img.gear-rarity-glow::before {
  width: 92%;
  height: 92%;
  filter: blur(10px);
}

/* Крупное превью кузницы / выбранный крафт: чуть компактнее. */
.forge-preview-visual.gear-rarity-glow::before,
.forge-craft-selected-visual.gear-rarity-glow::before {
  width: 70%;
  height: 70%;
  filter: blur(15px);
}

/* Инвентарь: блик компактнее вокруг иконки. */
.inv-cell-tile__thumb.gear-rarity-glow::before {
  top: 42%;
  width: min(52%, 2.5rem);
  height: min(52%, 2.5rem);
  filter: blur(10px);
}

.gear-rarity-glow--uncommon {
  --gear-rarity-glow-core: rgba(100, 220, 120, 0.85);
}

.gear-rarity-glow--rare {
  --gear-rarity-glow-core: rgba(100, 165, 255, 0.85);
}

.gear-rarity-glow--epic {
  --gear-rarity-glow-core: rgba(185, 125, 255, 0.85);
}

.gear-rarity-glow--legendary {
  --gear-rarity-glow-core: rgba(255, 195, 95, 0.88);
}

.gear-rarity-glow--mythic {
  --gear-rarity-glow-core: rgba(255, 95, 95, 0.88);
}

/* Мелкие ячейки кузницы/крафта: меньше радиус, чем у экипировки. */
.forge-craft-target-thumb.gear-rarity-glow::before,
.forge-gear-thumb.gear-rarity-glow::before,
.forge-craft-material-img-wrap.gear-rarity-glow::before {
  width: 68%;
  height: 68%;
  filter: blur(9px);
  opacity: 0.95;
}

/* Призыв и прочее — прежний размер (не трогаем). */
.summon-drop-icon-wrap.gear-rarity-glow::before {
  width: 92%;
  height: 92%;
  filter: blur(11px);
  opacity: 0.95;
}

.item-title-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.card-preview-btn {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 10px;
}

.card-preview-btn img {
  border-radius: 8px;
}

.appearance-card-thumb {
  width: 52px;
  height: 68px;
  object-fit: cover;
  display: block;
}

.appearance-card-action {
  width: 52px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 0 0 52px;
}

.appearance-card-action--two {
  width: 104px;
  flex: 0 0 104px;
  justify-content: flex-start;
  gap: 10px;
  padding-left: 6px;
}

.appearance-card-action .btn {
  margin: 0;
}

.appearance-card-action .btn-equip-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  box-sizing: border-box;
}

/* Кнопка «надеть» иконкой (карточки внешности, снаряжение в инвентаре). */
.btn-equip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 40px;
  padding: 0 6px;
  box-sizing: border-box;
}

.btn-equip-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.btn-equip-icon-wrap .btn-equip-action-img {
  display: block;
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
}

.hero-equip-unequip-btn .btn-equip-icon-wrap .btn-equip-action-img {
  width: 20px;
  height: 20px;
}

.inv-gear-tile .hero-equip-unequip-btn .btn-equip-icon-wrap .btn-equip-action-img,
.inv-gear-equip-corner .btn-equip-icon-wrap .btn-equip-action-img {
  width: 18px;
  height: 18px;
}

.appearance-card-action .btn-equip-icon .btn-equip-icon-wrap .btn-equip-action-img {
  width: 30px;
  height: 30px;
}

.story-ch1-reward-item .story-ch1-reward-equip-btn.btn-equip-icon .btn-equip-icon-wrap .btn-equip-action-img {
  width: 24px;
  height: 24px;
}

.gear-preview-inv-action.btn-equip-icon .btn-equip-icon-wrap .btn-equip-action-img {
  width: 28px;
  height: 28px;
}

.btn-equip-icon:disabled {
  opacity: 0.78;
  cursor: not-allowed;
}

.appearance-filter-toggle {
  margin: 0;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid var(--ui-pill-line);
  background: var(--ui-pill-bg);
  color: var(--ui-pill-text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  cursor: pointer;
}

.appearance-filter-toggle--icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
}

.appearance-filter-toggle__img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
  opacity: 0.78;
  pointer-events: none;
}

.appearance-filter-toggle--icon:hover:not(:disabled) .appearance-filter-toggle__img {
  opacity: 0.92;
}

.appearance-filter-toggle:hover:not(:disabled) {
  border-color: rgba(211, 176, 111, 0.35);
}

.appearance-filter-toggle--active {
  color: var(--gold, #e9d4a3);
  border-color: rgba(211, 176, 111, 0.78);
  background: rgba(211, 176, 111, 0.14);
  box-shadow:
    0 0 0 1px rgba(211, 176, 111, 0.32) inset,
    0 0 14px rgba(211, 176, 111, 0.28);
}

.appearance-filter-toggle--active .appearance-filter-toggle__img {
  opacity: 1;
  filter: drop-shadow(0 0 5px rgba(232, 200, 120, 0.9)) drop-shadow(0 0 2px rgba(211, 176, 111, 0.75));
}

.appearance-card-row--unowned {
  opacity: 0.66;
}

.appearance-card-row--unowned .appearance-card-thumb {
  filter: grayscale(0.85) brightness(0.78);
}

.appearance-root {
  position: relative;
}

/* Внешность: поиск, выпадающие фильтры, список карточек (7 строк + прокрутка) */
.appearance-toolbar {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  width: 100%;
  min-width: 0;
}

.appearance-toolbar__search {
  flex: 1 1 0;
  width: auto;
  max-width: none;
  min-width: 0;
  box-sizing: border-box;
}

.appearance-toolbar__filters {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  flex: 3 1 auto;
  min-width: 0;
  width: auto;
}

.appearance-toolbar__filters > .appearance-filter-menu {
  flex: 1 1 0;
  min-width: 0;
  max-width: none;
}

.appearance-toolbar__filters > .appearance-filter-toggle:not(.appearance-filter-toggle--icon) {
  flex: 1 1 0;
  min-width: 0;
}

.appearance-toolbar__filters > .appearance-filter-menu .appearance-filter-menu__toggle {
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  padding: 6px 4px;
  font-size: 0.72rem;
}

.appearance-toolbar__filters > .appearance-filter-toggle:not(.appearance-filter-toggle--icon) {
  width: 100%;
  text-align: center;
  padding: 6px 6px;
  font-size: 0.72rem;
}

.appearance-toolbar__filters > .appearance-filter-toggle--icon {
  flex: 0 0 34px;
}

/* «Наличие»: только иконка, без рамки/квадрата. */
#appearance-card-presence-btn.appearance-filter-toggle--icon {
  width: 30px;
  min-width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

#appearance-card-presence-btn.appearance-filter-toggle--icon:hover:not(:disabled) {
  border: none;
  background: transparent;
  box-shadow: none;
}

#appearance-card-presence-btn .appearance-filter-toggle__img {
  width: 28px;
  height: 28px;
  opacity: 0.9;
}

.appearance-toolbar .appearance-filter-menu__toggle,
.appearance-toolbar .appearance-filter-toggle:not(.appearance-filter-toggle--icon) {
  padding: 6px 4px;
  font-size: 0.72rem;
}

.appearance-filter-menu {
  position: relative;
  flex: 0 0 auto;
}

.appearance-filter-menu__toggle {
  margin: 0;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid var(--ui-pill-line);
  background: var(--ui-pill-bg);
  color: var(--ui-pill-text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  cursor: pointer;
}

.appearance-filter-menu__toggle:hover:not(:disabled) {
  border-color: rgba(211, 176, 111, 0.35);
  color: rgba(232, 200, 120, 0.92);
}

.appearance-filter-menu__toggle:focus-visible {
  outline: 2px solid var(--ui-focus-ring);
  outline-offset: 2px;
}

.appearance-filter-menu--active .appearance-filter-menu__toggle {
  color: var(--ui-pill-text-active);
  border-color: var(--ui-pill-line-active);
  background: var(--ui-pill-bg-active);
}

.appearance-filter-menu__panel {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  min-width: 148px;
  max-height: min(240px, 42vh);
  overflow-y: auto;
  padding: 6px;
  border-radius: var(--ui-panel-radius, 12px);
  border: 1px solid var(--ui-panel-border);
  background: var(--ui-panel-bg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.42);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 4px;
  scrollbar-width: thin;
}

.appearance-filter-menu__item {
  margin: 0;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ui-pill-text);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.appearance-filter-menu__item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.appearance-filter-menu__item--active {
  background: rgba(211, 176, 111, 0.12);
  color: var(--gold, #e9d4a3);
}

.appearance-filter-menu__item .rarity-tag {
  margin-left: 0;
}

.appearance-card-list-scroll {
  --appearance-row-estimate: 86px;
  --appearance-list-gap: 8px;
  --appearance-visible-rows: 7;
  max-height: calc(
    var(--appearance-row-estimate) * var(--appearance-visible-rows) + var(--appearance-list-gap) * (var(--appearance-visible-rows) - 1)
  );
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px 2px 4px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--ui-scrollbar-thumb) var(--ui-scrollbar-track);
}

.appearance-card-list {
  display: flex;
  flex-direction: column;
  gap: var(--appearance-list-gap, 8px);
  min-width: 0;
}

.appearance-card-list__empty {
  margin: 8px 0 0;
}

.appearance-card-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--ui-panel-line, var(--line));
  background: var(--ui-panel-bg, var(--surface-deep));
  box-sizing: border-box;
}

.appearance-card-row--equipped {
  border-color: #d3b06f;
  background: rgba(31, 24, 13, 0.5);
  box-shadow: 0 0 0 1px rgba(138, 110, 54, 0.28);
}

.appearance-card-row__thumb {
  position: relative;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 10px;
  line-height: 0;
}

.appearance-card-row__info {
  flex: 1 1 auto;
  min-width: 0;
}

.appearance-card-row__title-line {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.appearance-card-row__name {
  color: var(--gold, #e9d4a3);
  font-weight: 800;
  font-size: 0.95rem;
  line-height: 1.25;
  min-width: 0;
}

.appearance-card-row__qty {
  flex: 0 0 auto;
  white-space: nowrap;
  color: rgba(236, 240, 248, 0.82);
  font-weight: 400;
  font-size: 0.82rem;
  line-height: 1.2;
}

.appearance-card-row__meta {
  margin: 4px 0 0;
  font-size: 0.82rem;
  line-height: 1.3;
}

.appearance-card-thumb--empty {
  display: block;
  width: 52px;
  height: 68px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.appearance-toolbar .appearance-rarity-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
  flex: 0 0 clamp(5rem, 24vw, 6.5rem);
  min-width: 0;
  max-width: 7rem;
}

.appearance-toolbar .appearance-filter-select.appearance-toolbar__gender {
  flex: 0 0 clamp(5rem, 24vw, 6.5rem);
  align-self: stretch;
  min-width: 0;
  max-width: 7rem;
  margin: 0;
  box-sizing: border-box;
  cursor: pointer;
  appearance: auto;
}

.appearance-toolbar .appearance-filter-select.appearance-toolbar__race {
  flex: 0 0 clamp(5.4rem, 26vw, 7.2rem);
  align-self: stretch;
  min-width: 0;
  max-width: 7.4rem;
  margin: 0;
  box-sizing: border-box;
  cursor: pointer;
  appearance: auto;
}

.appearance-toolbar .appearance-rarity-toggle,
.appearance-toolbar .appearance-filter-select {
  margin: 0;
  padding: 8px 8px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.25;
  border: 1px solid rgba(120, 124, 132, 0.55);
  background: rgba(36, 38, 44, 0.92);
  color: rgba(230, 232, 236, 0.96);
  outline: none;
  box-shadow: none;
}

.appearance-toolbar .appearance-rarity-toggle {
  width: 100%;
  min-height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  font-family: inherit;
}

.appearance-toolbar .appearance-rarity-toggle:focus,
.appearance-toolbar .appearance-filter-select:focus {
  border-color: rgba(150, 154, 162, 0.85);
  background: rgba(40, 42, 48, 0.98);
}

.appearance-toolbar .appearance-filter-select option {
  background: #2c2e34;
  color: #e8eaee;
}

.appearance-rarity-wrap {
  position: relative;
}

.appearance-rarity-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  min-width: 150px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid rgba(146, 158, 173, 0.4);
  background: rgba(13, 12, 18, 0.96);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.42);
  z-index: 12;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.appearance-rarity-menu[hidden] {
  display: none !important;
}

.appearance-rarity-item {
  border: 0;
  background: transparent;
  padding: 2px 4px;
  text-align: left;
  cursor: pointer;
}

.appearance-rarity-item .rarity-tag {
  margin-left: 0;
}

.appearance-card-worn {
  display: inline-block;
  margin-top: 4px;
  color: #e9d4a3;
  font-size: 0.78rem;
  font-weight: 700;
}

.gear-meta-line,
.gear-stats-line {
  color: #eef3fb;
}

/* Снаряжение в инвентаре: 4 карточки в ряд, слегка вытянутые по вертикали (ранг под названием) */
.inv-gear-tiles-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.inv-gear-tile.quest-row {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin: 0;
  gap: 0;
  padding: 2px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 10 / 12;
  min-height: 0;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-deep);
  box-sizing: border-box;
  text-align: center;
  overflow: hidden;
  box-shadow: none;
}

/* Надетое: коричневый фон и золотая рамка (как слоты героя) */
.inv-gear-tile.inv-gear-row--equipped {
  border: 1px solid #d3b06f;
  border-radius: 12px;
  background: rgba(31, 24, 13, 0.64);
  box-shadow: 0 0 0 1px rgba(138, 110, 54, 0.35);
  box-sizing: border-box;
}

.inv-gear-tile .hero-equip-unequip-btn {
  width: 26px;
  height: 26px;
  top: 2px;
  right: 2px;
  border-radius: 8px;
}

.inv-gear-equip-corner {
  position: absolute;
  top: 2px;
  right: 2px;
  bottom: auto;
  z-index: 4;
  width: 26px;
  height: 26px;
  min-width: 0;
  min-height: 0;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(16, 22, 32, 0.92);
  color: rgba(245, 238, 220, 0.92);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  box-sizing: border-box;
}

.inv-gear-equip-corner:active {
  transform: scale(0.96);
}

.inv-gear-equip-corner:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.inv-gear-tile-body {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  overflow: hidden;
}

/* Внутренняя карточка: у не-надетого — те же нейтральные тона, что у трофеев/остального инвентаря */
.inv-gear-summon-card {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  margin: 0;
  border: 1px solid rgba(154, 164, 176, 0.26);
  border-radius: 8px;
  padding: 15px 28px 5px 28px;
  background: rgba(20, 22, 28, 0.72);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  cursor: pointer;
  font: inherit;
  color: inherit;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

.inv-gear-tile.inv-gear-row--equipped .inv-gear-summon-card {
  border-color: rgba(191, 160, 96, 0.38);
  background: rgba(28, 22, 14, 0.88);
  box-shadow: inset 0 0 0 1px rgba(211, 176, 111, 0.12);
}

.inv-gear-summon-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
}

.inv-gear-summon-title-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  align-self: stretch;
  /* Шире, чем центрированная картинка: заходим в боковой padding карточки */
  width: calc(100% + 48px);
  max-width: none;
  margin-inline: -24px;
  min-width: 0;
  flex-shrink: 0;
  box-sizing: border-box;
}

.inv-gear-summon-name {
  font-weight: 600;
  font-size: 0.72rem;
  line-height: 1.25;
  color: #eef3fb;
  text-align: center;
  width: 100%;
  max-width: none;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
  overflow-wrap: anywhere;
  box-sizing: border-box;
}

.inv-gear-summon-rarity {
  flex-shrink: 0;
  font-size: 0.54rem;
  padding: 1px 5px;
  line-height: 1.22;
  margin: 0;
}

.inv-gear-summon-img {
  display: block;
  width: auto;
  max-width: min(210px, 98%);
  max-height: clamp(96px, 84%, 152px);
  flex: 0 0 auto;
  margin: 0 auto;
  object-fit: contain;
}

.gear-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.gear-salvage-toggle {
  border: 0;
  background: transparent;
  color: #ff7f8f;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 0;
}

.gear-salvage-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 2px 0 8px;
}

.gear-salvage-controls[hidden] {
  display: none !important;
}

.gear-salvage-rarity-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin: 0 0 8px;
}

.gear-salvage-rarity-list[hidden] {
  display: none !important;
}

.gear-salvage-controls .btn {
  width: auto;
  margin: 0;
}

.gear-salvage-box {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #dbe3ef;
  font-size: 0.9rem;
  font-weight: 400;
}

.gear-salvage-box .ui-check {
  width: 14px;
  height: 14px;
}

.inv-block-gear--salvage-mode .inv-gear-tile:not([hidden]) {
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(211, 176, 111, 0.12);
}

.inv-block-gear--salvage-mode .inv-gear-tile .hero-equip-unequip-btn {
  display: none !important;
}

.inv-block-gear--salvage-mode .inv-gear-tile .inv-gear-equip-corner {
  display: none !important;
}

.quest-row.inv-gear-row--salvage-selected {
  border-color: rgba(230, 200, 120, 0.62);
  box-shadow:
    0 0 0 1px rgba(230, 200, 120, 0.32),
    0 0 28px rgba(220, 185, 95, 0.32),
    inset 0 0 26px rgba(230, 200, 120, 0.09);
  background: rgba(34, 30, 20, 0.7);
}

.gear-salvage-rarity-list .rarity-tag {
  font-weight: 500;
  margin-left: 0;
  padding: 1px 6px;
}

.salvage-reward-modal {
  position: fixed;
  inset: 0;
  z-index: 10065;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: rgba(6, 9, 14, 0.74);
}

.salvage-reward-modal[hidden] {
  display: none !important;
}

.salvage-reward-box {
  width: min(340px, 92vw);
  border-radius: 16px;
  border: 1px solid rgba(150, 160, 172, 0.4);
  background: linear-gradient(180deg, rgba(19, 27, 40, 0.96) 0%, rgba(10, 16, 25, 0.96) 100%);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.45);
  padding: 14px 14px 12px;
}

.salvage-reward-title {
  color: #eef3fb;
  font-size: 1.02rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 10px;
}

.salvage-reward-grid {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  margin-bottom: 8px;
}

.salvage-reward-sub {
  color: #d3ddec;
  font-size: 0.92rem;
  text-align: center;
  margin-bottom: 10px;
}

.salvage-reward-box .btn {
  margin: 0 auto;
  min-width: 110px;
}

.inventory-consumables-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.inventory-consumable-card {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.inventory-consumable-card.inv-consumable-wrap--hp-potion {
  position: relative;
}

.inv-consumable-text {
  width: 100%;
  text-align: center;
  line-height: 1.35;
  font-weight: 600;
}

/* Трофеи с мобов и рыбалки: сетка 4 колонки; иконка сверху, название по центру снизу; число на иконке. */
.inv-trophy-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.inv-trophy-grid > .inv-empty-msg {
  grid-column: 1 / -1;
  margin: 4px 0 0;
}

.inv-trophy-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  margin: 0;
  padding: 10px 6px;
  min-width: 0;
}

.inv-trophy-icon-slot {
  position: relative;
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
}

.inv-trophy-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-deep);
  display: flex;
  align-items: center;
  justify-content: center;
}

.inv-trophy-icon-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 5px;
  box-sizing: border-box;
}

.inv-trophy-icon-slot .inventory-count-badge {
  right: -3px;
  bottom: -3px;
  z-index: 1;
}

.inv-trophy-icon-slot > .item-thumb-new-dot,
.inventory-use-icon-btn > .item-thumb-new-dot {
  top: -2px;
  left: -2px;
  z-index: 3;
}

.inv-trophy-title {
  width: 100%;
  font-size: 0.86rem;
  line-height: 1.3;
  font-weight: 600;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.inv-trophy-title b {
  font-weight: 700;
}

.inventory-use-icon-btn {
  position: relative;
  width: 56px;
  height: 56px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  flex: 0 0 56px;
}

.inventory-use-icon-btn img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  display: block;
}

.inventory-count-badge {
  position: absolute;
  right: -2px;
  bottom: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(16, 22, 32, 0.92);
  border: 1px solid rgba(154, 164, 176, 0.5);
  color: #eef3fb;
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 20px;
  text-align: center;
}

.inventory-use-icon-btn:disabled {
  opacity: 0.78;
  cursor: not-allowed;
}

.inv-consumable-icon-wrap {
  position: relative;
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
}

.inventory-consumable-card.inv-consumable-wrap--hp-potion .inventory-hp-potion-upgrade-btn {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 4;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid rgba(212, 175, 55, 0.65);
  border-radius: 6px;
  background: rgba(16, 22, 32, 0.94);
  color: #f0d78a;
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.inventory-hp-potion-upgrade-btn:hover {
  background: rgba(32, 40, 56, 0.98);
  border-color: rgba(240, 215, 138, 0.85);
}

.health-potion-upgrade-cost {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 24px 32px;
  margin: 10px 0 4px;
}

.health-potion-upgrade-res {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}

.health-potion-upgrade-res-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  min-width: 0;
}

.health-potion-upgrade-need {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text, #e8e4dc);
  line-height: 1.15;
  white-space: nowrap;
  text-align: left;
  font-variant-numeric: tabular-nums;
}

.health-potion-upgrade-res-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.health-potion-upgrade-have {
  font-size: 0.82rem;
  line-height: 1.15;
  color: var(--muted, #9aa4b0);
  white-space: nowrap;
  text-align: left;
  font-variant-numeric: tabular-nums;
}

.health-potion-upgrade-lack {
  color: #e88a8a;
}

.health-potion-upgrade-level {
  margin: 4px 0 0;
  text-align: center;
}

.health-potion-upgrade-box {
  width: min(380px, 94vw);
  text-align: center;
  padding: 16px 18px 14px;
}

.health-potion-upgrade-box .race-confirm-message {
  margin: 8px 0 10px;
}

.health-potion-upgrade-box .health-potion-upgrade-level {
  margin: 0 0 10px;
}

.health-potion-upgrade-box .health-potion-upgrade-cost {
  margin-bottom: 4px;
}

.health-potion-upgrade-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.health-potion-upgrade-actions .btn {
  width: auto;
  flex: 0 1 auto;
  min-width: 108px;
  max-width: 160px;
  margin: 0;
  padding: 10px 16px;
  font-size: 0.92rem;
}

.class-skill-upgrade-box {
  width: min(400px, 94vw);
}

.class-skill-upgrade-box .class-skill-upgrade-head {
  margin: 8px 0 10px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(211, 176, 111, 0.95);
}

.class-skill-upgrade-box .class-skill-upgrade-head b {
  color: rgba(230, 200, 140, 0.98);
  font-weight: 700;
}

.class-skill-upgrade-box .class-skill-upgrade-effect {
  margin: 0;
  line-height: 1.45;
  text-align: center;
  font-size: 0.88rem;
}

.class-skill-upgrade-box .class-skill-upgrade-effect--now {
  color: rgba(232, 236, 245, 0.96);
}

.class-skill-upgrade-box .class-skill-upgrade-effect--after {
  margin-top: 6px;
  margin-bottom: 12px;
  font-weight: 600;
  color: rgba(211, 176, 111, 0.95);
}

.class-skill-upgrade-teaching-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.class-skill-upgrade-teaching-img {
  display: block;
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.class-skill-upgrade-rank {
  display: flex;
  justify-content: center;
  line-height: 1;
}

.class-skill-upgrade-rank .rarity-tag {
  font-size: 0.62rem;
  padding: 2px 5px;
  line-height: 1.15;
}

.class-skill-upgrade-res {
  gap: 14px;
  align-items: center;
}

.card-preview-modal {
  position: fixed;
  inset: 0;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  margin: 0 !important;
  box-sizing: border-box;
  background: rgba(5, 8, 14, 0.82);
  /* Выше weather-overlay (11800), иначе снег/иней дают светлую полоску сверху поверх затемнения. */
  z-index: 12150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.explore-trade-result-modal {
  /* Крафт/выдача предметов — поверх обычных модалок и weather-overlay. */
  z-index: 12280;
}

.card-preview-modal[hidden] {
  display: none !important;
}

/* Выше .guild-crest-modal, ниже trade-result; выше weather-overlay (11800). */
.guild-master-confirm-modal.card-preview-modal {
  z-index: 12200;
}

.card-preview-box {
  width: min(420px, 94vw);
  background: rgba(18, 24, 33, 0.94);
  border: 1px solid rgba(154, 164, 176, 0.34);
  border-radius: 16px;
  padding: 12px;
}

.race-confirm-box {
  width: min(380px, 94vw);
  text-align: center;
}

.forced-race-reselect-modal {
  z-index: 12000;
  pointer-events: auto;
}

.forced-race-reselect-box {
  width: min(520px, 96vw);
  max-height: min(88vh, 900px);
  overflow: auto;
  text-align: left;
}

.forced-race-reselect-lead {
  margin: 0 0 12px;
  line-height: 1.45;
}

.forced-race-reselect-list {
  max-height: min(58vh, 560px);
  overflow: auto;
  margin: 0;
}

.forced-race-reselect-error {
  color: #e8a0a0;
  margin-top: 10px;
}

.race-confirm-title {
  margin: 0 0 6px;
}

.race-confirm-message {
  margin: 10px 0 18px;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--text, #e8e4dc);
}

.card-switch-box {
  position: relative;
  text-align: center;
  padding-top: 4px;
}

.card-switch-box .race-confirm-title {
  margin-top: 0;
  margin-bottom: 4px;
}

.card-switch-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0 10px;
  align-items: center;
}

.card-switch-tabs-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 8px 0 12px;
  flex-wrap: wrap;
}

.card-switch-tab {
  border: 1px solid rgba(154, 164, 176, 0.34);
  background: rgba(18, 24, 33, 0.7);
  color: rgba(232, 228, 220, 0.9);
  padding: 6px 12px;
  border-radius: 12px;
  cursor: pointer;
}

.card-switch-tab--active {
  border-color: var(--gold, #d3b06f);
  color: var(--gold, #d3b06f);
  box-shadow: inset 0 0 0 1px rgba(211, 176, 111, 0.45);
}

.card-switch-selects {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.card-switch-select {
  width: 100%;
  box-sizing: border-box;
  background: rgba(5, 8, 14, 0.35);
  border: 1px solid rgba(154, 164, 176, 0.34);
  color: rgba(232, 228, 220, 0.95);
  border-radius: 12px;
  padding: 10px 12px;
  outline: none;
}

.card-switch-select:focus-visible {
  border-color: var(--gold, #d3b06f);
  box-shadow: 0 0 0 2px rgba(211, 176, 111, 0.15);
}

.card-switch-price {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.card-switch-price__qty {
  color: rgba(232, 228, 220, 0.96);
  font-weight: 700;
  line-height: 1;
}

.card-switch-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 16px;
}

.card-switch-actions .btn {
  margin: 0;
}

.card-switch-close {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 2;
}

.delete-profile-secret-lead {
  margin: 6px 0 4px;
  text-align: center;
}

.delete-profile-secret-box .name-input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin-top: 12px;
}

.delete-profile-secret-box #delete-profile-secret-msg {
  margin: 8px 0 0;
  font-size: 0.9rem;
}

.delete-profile-secret-box .race-confirm-actions {
  margin-top: 14px;
}

.delete-profile-secret-box .race-confirm-actions .btn {
  margin: 0;
  padding: 9px 12px;
  font-size: 0.9rem;
  line-height: 1.2;
  min-height: 0;
}

.delete-profile-secret-box .race-confirm-actions .btn-danger {
  margin-top: 0;
}

.account-secret-field {
  margin-top: 6px;
}

.account-secret-recovery-warn {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.account-secret-field-wrap {
  position: relative;
  width: 100%;
  margin: 6px 0 0;
}

.account-secret-field-wrap .name-input {
  margin: 0;
  padding-right: 48px;
  width: 100%;
  box-sizing: border-box;
}

.account-secret-field-wrap .name-input::placeholder {
  color: rgba(152, 158, 168, 0.92);
  opacity: 1;
}

.account-secret-toggle-vis {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: rgba(211, 176, 111, 0.88);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.account-secret-toggle-vis:hover {
  color: rgba(236, 210, 150, 0.98);
  background: rgba(211, 176, 111, 0.1);
}

.account-secret-toggle-vis:focus-visible {
  outline: 2px solid rgba(211, 176, 111, 0.65);
  outline-offset: 2px;
}

/* Видимость только через класс — на SVG атрибут `hidden` в части WebView ломает переключение. */
.account-secret-toggle-vis .account-secret-eye-svg {
  display: none !important;
  flex-shrink: 0;
}

.account-secret-toggle-vis .account-secret-eye-svg.account-secret-eye-svg--active {
  display: block !important;
}

.race-confirm-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.race-confirm-actions .btn {
  flex: 1 1 calc(50% - 8px);
  min-width: 120px;
  max-width: 200px;
}

.race-confirm-actions #onboarding-confirm-yes {
  border-color: rgba(217, 190, 134, 0.9);
  color: #f8efd8;
  background: linear-gradient(180deg, rgba(52, 46, 32, 0.92) 0%, rgba(28, 26, 20, 0.94) 100%);
  box-shadow:
    0 4px 16px rgba(8, 6, 14, 0.32),
    0 0 0 1px rgba(211, 176, 111, 0.45),
    0 0 18px rgba(211, 176, 111, 0.55),
    0 0 36px rgba(180, 140, 70, 0.28);
}

.race-confirm-actions #onboarding-confirm-yes:active {
  box-shadow:
    0 2px 12px rgba(8, 6, 14, 0.35),
    0 0 0 1px rgba(230, 200, 140, 0.55),
    0 0 22px rgba(230, 200, 140, 0.45);
}

.race-confirm-actions #battle-flee-confirm-yes,
.race-confirm-actions #battle-hp-pot-waste-confirm-yes,
.race-confirm-actions .battle-economy-nav-blocked-ok {
  border-color: rgba(217, 190, 134, 0.9);
  color: #f8efd8;
  background: linear-gradient(180deg, rgba(52, 46, 32, 0.92) 0%, rgba(28, 26, 20, 0.94) 100%);
  box-shadow:
    0 4px 16px rgba(8, 6, 14, 0.32),
    0 0 0 1px rgba(211, 176, 111, 0.45),
    0 0 18px rgba(211, 176, 111, 0.55),
    0 0 36px rgba(180, 140, 70, 0.28);
}

.race-confirm-actions #battle-flee-confirm-yes:active,
.race-confirm-actions #battle-hp-pot-waste-confirm-yes:active,
.race-confirm-actions .battle-economy-nav-blocked-ok:active {
  box-shadow:
    0 2px 12px rgba(8, 6, 14, 0.35),
    0 0 0 1px rgba(230, 200, 140, 0.55),
    0 0 22px rgba(230, 200, 140, 0.45);
}

.onboarding-back-row {
  margin: 0 0 6px;
}

/* «Назад» снизу по центру (класс, пол, под «Подтвердить» на экране ника). */
.onboarding-back-row--foot {
  margin-top: 28px;
  margin-bottom: 8px;
  text-align: center;
}

.onboarding-back-row .onboarding-back-btn {
  display: inline-block;
  width: auto;
  max-width: none;
  margin: 0;
  padding: 10px 18px;
  font-size: 0.92rem;
}

.story-ch1-reward-box {
  text-align: center;
}

.story-ch1-reward-box .card-preview-head {
  margin-bottom: 14px;
}

.story-ch1-reward-lead {
  margin: 0 0 12px;
  font-size: 0.92rem;
  color: var(--text-muted, rgba(200, 210, 230, 0.88));
  line-height: 1.35;
}

.story-ch1-reward-items {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.story-ch1-reward-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(30, 38, 52, 0.65);
  border: 1px solid rgba(154, 164, 176, 0.22);
  font-size: 0.9rem;
  color: #e8edf5;
}

/* Поверх модалки сюжетной награды (тоже 10060). */
.global-gear-preview-modal {
  z-index: 10070;
}

/* Кнопка «Назад» с иконкой в правом верхнем углу шапки, не по центру по вертикали (ряд с заголовком + подпись слота). */
.global-gear-preview-modal .card-preview-head {
  align-items: start;
}
.global-gear-preview-modal .card-preview-close {
  align-self: start;
}

/* В наградах квеста (глобальная карточка снаряжения) подписи под картинкой читаются лучше по центру. */
.global-gear-preview-modal .card-preview-stats,
.global-gear-preview-modal .gear-preview-meta {
  text-align: center;
}

.story-ch1-reward-item-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.story-ch1-reward-item-icon-btn:focus-visible {
  outline: 2px solid rgba(211, 176, 111, 0.75);
  outline-offset: 2px;
}

.story-ch1-reward-item-icon-btn .story-ch1-reward-item-icon {
  display: block;
}

.story-ch1-reward-item-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
}

.story-ch1-reward-item-text {
  flex: 1;
  min-width: 0;
  line-height: 1.3;
  font-weight: 600;
}

.story-ch1-reward-equip-btn {
  flex-shrink: 0;
  align-self: center;
}

/* Иконка «надеть»: компактный квадрат (перебиваем .btn { width:100% }). */
.story-ch1-reward-item .story-ch1-reward-equip-btn.btn-equip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  max-width: 36px;
  min-height: 36px;
  max-height: 36px;
  margin: 0;
  padding: 0;
  flex: 0 0 36px;
  box-sizing: border-box;
}

.story-ch1-reward-equip-btn--done {
  opacity: 0.72;
  cursor: default;
}

.story-ch1-reward-xp-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 8px 0 16px;
  padding: 14px 12px;
  border-radius: 12px;
  background: rgba(211, 176, 111, 0.1);
  border: 1px solid rgba(211, 176, 111, 0.28);
}

/* Иначе `display: flex` выше перебивает UA [hidden] — блок «Опыт героя» остаётся виден при +0. */
.story-ch1-reward-xp-wrap[hidden] {
  display: none !important;
}

.story-ch1-reward-xp-label {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(211, 176, 111, 0.95);
}

.story-ch1-reward-xp-value {
  font-size: 1.65rem;
  font-weight: 800;
  color: #f0efe8;
  text-shadow: 0 0 16px rgba(120, 110, 80, 0.22);
}

.story-ch1-reward-levelup {
  margin: -8px 0 14px;
  font-weight: 800;
  color: #7ee787;
}

.story-ch1-reward-box .btn {
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
  display: block;
}

/* Симметричные боковые колонки: слева отступ, по центру заголовок, справа закрыть. */
.card-preview-head {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  margin-bottom: 10px;
  column-gap: 8px;
}

.card-preview-head-spacer {
  grid-column: 1;
  width: 48px;
  height: 1px;
}

.card-preview-head-center {
  grid-column: 2;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 10px;
  min-width: 0;
}

/* Карточки персонажа: строка «название + ранг» как единый блок по центру, ниже — раса мелким шрифтом. */
.card-preview-head-center--with-sub {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0;
}

/* Карточка снаряжения: заголовок + тип слота, картинка компактнее. */
.card-preview-head-center--gear-preview {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.gear-preview-slot-line {
  margin-top: 4px;
  width: 100%;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.25;
  color: rgba(186, 196, 212, 0.96);
}

.card-preview-title-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
  min-width: 0;
}

.card-preview-title-row {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 10px;
  max-width: 100%;
}

.card-preview-head-center .rarity-tag {
  margin-left: 0;
  flex-shrink: 0;
}

.card-preview-race {
  margin-top: 4px;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.25;
  color: rgba(186, 196, 212, 0.92);
  text-align: center;
  max-width: 100%;
}

.summon-card-preview-meta {
  margin: 4px 0 0;
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.25;
  color: rgba(186, 196, 212, 0.92);
  text-align: center;
}

.card-preview-title {
  color: #eef3fb;
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1.2;
  min-height: 1.2em;
  text-align: center;
  margin: 0;
  padding: 0;
  min-width: 0;
  flex: 0 1 auto;
}

.card-preview-title-row .card-preview-title {
  text-align: left;
  flex: 0 1 auto;
}

.card-preview-head-center--gear-preview .card-preview-title-row .card-preview-title {
  text-align: center;
}

.card-preview-close {
  grid-column: 3;
  justify-self: end;
  align-self: center;
  position: static;
  transform: none;
  margin: 0;
  z-index: 3;
}

.card-preview-close:active {
  transform: scale(0.98);
}

/* Превью карточки персонажа: «Назад» крупнее и в самом правом верхнем углу окна. */
#summon-card-preview-modal .card-preview-box {
  position: relative;
}

#summon-card-preview-modal .card-preview-close {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 44px;
  height: 44px;
  justify-self: auto;
  align-self: auto;
  z-index: 5;
}

#summon-card-preview-modal .card-preview-close img {
  width: 30px;
  height: 30px;
  display: block;
  object-fit: contain;
}

.card-preview-image {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
}

/* Превью снаряжения: компактная иллюстрация (инвентарь, профиль, призыв, глобальная карточка). */
#gear-preview-modal .gear-preview-hero-body-main .card-preview-image--gear,
#global-gear-preview-modal .card-preview-image--gear,
#summon-gear-preview-modal .card-preview-image--gear,
#market-gear-preview-modal .card-preview-image--gear {
  display: block;
  width: auto;
  max-width: min(140px, 72%);
  max-height: 118px;
  margin: 6px auto 2px;
  object-fit: contain;
}

/* Инвентарь: слева крупная картинка+статы, справа дельта при надеть/снять, снизу кнопка действия. */
.inventory-root .card-preview-box--gear-inv {
  width: min(460px, 88vw);
}

.inventory-root #gear-preview-modal .gear-preview-hero-body-row--inv {
  position: static;
  width: 100%;
  display: block;
  min-height: 0;
}

.inventory-root #gear-preview-modal .gear-preview-hero-body-main--inv {
  flex: 0 0 auto;
  width: min(520px, 100%);
  max-width: min(520px, 100%);
  min-width: 0;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Картинка — по горизонтальному центру ряда; панель дельт — у правого края (три равнозаполняющие зоны) */
.inventory-root #gear-preview-modal .gear-preview-inv-visual-row {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 0 auto;
  min-height: 0;
}

.inventory-root #gear-preview-modal .gear-preview-inv-visual-spacer {
  flex: 1 1 0;
  min-width: 0;
}

.inventory-root #gear-preview-modal .gear-preview-inv-visual-row .gear-preview-inv-gear-wrap {
  display: inline-block;
  position: relative;
  margin: 4px 0 8px;
  line-height: 0;
  flex: 0 0 auto;
}

.inventory-root #gear-preview-modal .gear-preview-inv-visual-right {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
}

.inventory-root #gear-preview-modal .gear-preview-inv-gear-wrap .card-preview-image--gear {
  max-width: 126px;
  max-height: 126px;
  margin: 0;
  display: block;
}

.inventory-root #gear-preview-modal .gear-preview-hero-body-main--inv .card-preview-stats {
  width: 100%;
  font-size: 0.92rem;
  line-height: 1.35;
  text-align: center;
  margin-top: 0;
}

.inventory-root #gear-preview-modal .gear-preview-hero-body-main--inv .gear-preview-meta {
  text-align: center;
  font-size: 0.76rem;
  margin-top: 4px;
}

.inventory-root #gear-preview-modal .gear-preview-compare--inv {
  position: static;
  flex: 0 0 auto;
  width: min(220px, 72vw);
  max-width: 220px;
  min-width: 0;
  margin: 8px auto 0;
  transform: none;
  align-self: center;
}

.inventory-root #gear-preview-modal .gear-preview-compare--inv .gear-preview-compare-line {
  justify-content: flex-start;
  gap: 4px;
}

.inventory-root #gear-preview-modal .gear-preview-compare--inv .gear-preview-compare-line span:last-child {
  min-width: 38px;
  text-align: right;
}

.inventory-root #gear-preview-modal .gear-preview-compare--below-stats,
.hero-root .gear-preview-modal--hero .gear-preview-compare--below-stats {
  display: block;
}

.hero-root .gear-preview-modal--hero .gear-preview-inv-visual-row {
  display: flex;
  justify-content: center;
  width: 100%;
}

.hero-root .gear-preview-modal--hero .gear-preview-inv-gear-wrap {
  margin: 4px auto 8px;
}

.hero-root .gear-preview-modal--hero .card-preview-stats {
  text-align: center;
}

.hero-root .gear-preview-modal--hero .gear-preview-compare--inv {
  width: min(220px, 72vw);
  max-width: 220px;
  margin: 8px auto 0;
}

.inventory-root #gear-preview-modal .gear-preview-inv-action {
  width: min(240px, 100%);
  margin: 4px auto 0;
}

/* Если справа нечего сравнивать, центрируем картинку+статы в модалке. */
.inventory-root #gear-preview-modal.gear-preview-modal--inv-no-compare .gear-preview-hero-body-row--inv {
  min-height: auto;
}

.inventory-root #gear-preview-modal.gear-preview-modal--inv-no-compare .gear-preview-hero-body-main--inv {
  flex: 0 0 auto;
  width: min(520px, 100%);
  max-width: min(520px, 100%);
}

.inventory-root #gear-preview-modal.gear-preview-modal--inv-no-compare .gear-preview-compare--inv {
  display: none !important;
}

#market-gear-preview-modal .card-preview-box--gear-inv {
  width: min(460px, 88vw);
}

#market-gear-preview-modal .gear-preview-hero-body-row--inv {
  position: static;
  width: 100%;
  display: block;
  min-height: 0;
}

#market-gear-preview-modal .gear-preview-hero-body-main--inv {
  flex: 0 0 auto;
  width: min(520px, 100%);
  max-width: min(520px, 100%);
  min-width: 0;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#market-gear-preview-modal .gear-preview-inv-visual-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  width: 100%;
  margin: 0 auto;
}

#market-gear-preview-modal .gear-preview-inv-visual-row .gear-preview-inv-gear-wrap {
  display: inline-block;
  position: relative;
  margin: 2px 0 6px;
  line-height: 0;
  grid-column: 2;
  justify-self: center;
}

#market-gear-preview-modal .gear-preview-inv-gear-wrap .card-preview-image--gear {
  max-width: 108px;
  max-height: 108px;
  margin: 0;
  display: block;
}

#market-gear-preview-modal .gear-preview-inv-visual-right {
  grid-column: 3;
  min-width: 0;
  display: flex;
  justify-content: flex-end;
  justify-self: end;
}

#market-gear-preview-modal .gear-preview-compare--inv {
  position: static;
  flex: 0 0 auto;
  width: min(106px, 32vw);
  max-width: 106px;
  margin: 4px 0 8px;
}

#market-gear-preview-modal .gear-preview-compare--inv .gear-preview-compare-line {
  justify-content: flex-start;
  gap: 4px;
}

#market-gear-preview-modal .gear-preview-compare--inv .gear-preview-compare-line span:last-child {
  min-width: 38px;
  text-align: right;
}

#market-gear-preview-modal .gear-preview-hero-body-main--inv .card-preview-stats,
#market-gear-preview-modal .gear-preview-hero-body-main--inv .gear-preview-meta {
  text-align: center;
}

#market-gear-preview-modal #btn-market-gear-preview-buy {
  width: min(240px, 100%);
  margin: 4px auto 0;
}

.market-gear-preview-buy-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 10px;
}

.market-gear-preview-own {
  margin: 0;
  text-align: center;
}

#market-gear-preview-modal .gear-preview-inv-gear-wrap {
  position: relative;
}

#market-gear-preview-modal .gear-preview-inv-gear-wrap .forge-gear-plus {
  right: -4px;
  bottom: -4px;
}

.market-drill-row__img-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 8px;
  -webkit-tap-highlight-color: transparent;
}

.market-drill-row__img-btn:hover {
  box-shadow: 0 0 0 1px rgba(211, 176, 111, 0.35);
}

.market-drill-row__img-btn:focus-visible {
  outline: 2px solid var(--ui-focus-ring, rgba(211, 176, 111, 0.55));
  outline-offset: 2px;
}

.market-drill-row__img-btn img {
  display: block;
}

.card-preview-stats {
  margin-top: 10px;
  color: #e9d4a3;
  font-weight: 400;
  line-height: 1.35;
}

.card-preview-stats--inline {
  text-align: center;
  font-size: 0.92rem;
}

.card-preview-stats--stack {
  text-align: center;
}

.card-preview-stats__combat {
  margin: 0;
}

.card-preview-stats__bm {
  margin: 6px 0 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(232, 200, 120, 0.95);
  line-height: 1.35;
}

.card-preview-stats-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.card-preview-stats-list li {
  font-size: 0.92rem;
  line-height: 1.35;
}

#gear-preview-modal .gear-preview-hero-body-main .card-preview-stats {
  text-align: center;
}

.summon-tier-cost {
  font-weight: 700;
  font-size: 1.05rem;
}

.collections-root .hint,
.collections-root .hint b,
.collections-root .collection-row-meta,
.collections-root .collection-actions .hint {
  color: rgba(210, 214, 220, 0.92);
}

.collections-inline-msg {
  min-height: 1.2em;
  margin: 0 0 4px;
  color: rgba(196, 160, 140, 0.95);
}

.collections-root--page.stub {
  padding-top: 10px;
  gap: 4px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.collections-root--page .collections-inline-msg {
  min-height: 0;
  margin: 0;
}

.collections-root--page .collections-inline-msg:empty {
  display: none;
}

.collections-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
}

.collections-summary {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(236, 240, 248, 0.88);
}

.collections-summary-bm {
  margin: 0;
  flex-shrink: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gold, #d3b06f);
  font-variant-numeric: tabular-nums;
}

.collections-toolbar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  min-width: 0;
}

.collections-stat-filter--compact {
  width: auto;
  flex: 0 0 clamp(6.5rem, 24vw, 8.5rem);
  max-width: 8.5rem;
  min-width: 6.5rem;
  padding: 7px 8px;
  font-size: 0.82rem;
}

.collections-stat-filter--qty {
  width: auto;
  flex: 0 0 4.25rem;
  min-width: 4.25rem;
  padding: 7px 6px;
  font-size: 0.82rem;
}

.collections-root--page .collections-section-tabs.market-cat-tabs--icons {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: thin;
  margin: 0;
  width: auto;
}

.collections-root--page .collections-section-tabs .lb-tab.market-cat-tab--icon {
  padding: 6px 2px 4px;
  min-width: 0;
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.collections-root--page .collections-section-tabs .market-cat-tab-img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  opacity: 0.78;
}

.collections-root--page .collections-section-tabs .lb-tab--active .market-cat-tab-img {
  opacity: 1;
  filter: drop-shadow(0 0 4px rgba(211, 176, 111, 0.35));
}

.collections-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.collections-list-scroll {
  --col-card-estimate: 188px;
  --col-list-gap: 8px;
  --col-visible-rows: 4;
  max-height: calc(
    var(--col-card-estimate) * var(--col-visible-rows) + var(--col-list-gap) * (var(--col-visible-rows) - 1)
  );
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin-top: 0;
  padding: 4px 2px 4px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--ui-scrollbar-thumb) var(--ui-scrollbar-track);
}

.collection-row--card {
  position: relative;
  margin-bottom: 0;
  padding: 12px;
  border-radius: var(--ui-panel-radius, 12px);
  border: 1px solid var(--ui-panel-border);
  background: var(--ui-panel-bg);
  box-sizing: border-box;
}

.collection-action-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff2a2a;
  box-shadow:
    0 0 0 1px rgba(18, 22, 30, 0.95),
    0 0 6px rgba(255, 60, 60, 0.75);
  animation: mail-unread-dot-pulse 1.5s ease-in-out infinite;
  pointer-events: none;
}

.collections-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 8px 0 10px;
}

.collections-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  margin: 8px 0 10px;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.collections-tab {
  flex: 0 0 auto;
  border-radius: 10px;
  border: 1px solid var(--ui-pill-line);
  background: var(--ui-pill-bg);
  color: var(--ui-pill-text);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 7px 12px;
  cursor: pointer;
}

.collections-tab--active {
  color: var(--ui-pill-text-active);
  border-color: var(--ui-pill-line-active);
  background: var(--ui-pill-bg-active);
}

/* Рынок: аналогичная тонкая стрелочка над активным пунктом. */
.market-collections-tabs-row .collections-tab {
  position: relative;
}

.market-collections-tabs-row .collections-tabs {
  overflow-y: visible;
}

.market-collections-tabs-row .collections-tab--active::after {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 9px;
  height: 6px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--gold, #d3b06f), var(--gold-dim, rgba(180, 140, 70, 0.6)));
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  box-shadow: 0 0 10px rgba(211, 176, 111, 0.3);
  z-index: 2;
  pointer-events: none;
}

.collections-tools {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

/* Коллекции: разделы иконками под поиском — ширина; вертикальные поля задаются ниже (перебивают .lb-tabs). */
.collections-root .collections-section-tabs.market-cat-tabs--icons.lb-tabs {
  width: 100%;
}

.collections-search {
  width: 220px;
  flex: 0 0 220px;
  min-width: 0;
}

.collections-stat-filter {
  width: 170px;
  flex: 0 0 170px;
  box-sizing: border-box;
  border-radius: var(--ui-input-radius);
  border: 1px solid var(--ui-pill-line);
  background: var(--ui-pill-bg);
  color: var(--ui-pill-text);
  padding: 10px 10px;
  outline: none;
  box-shadow: none;
}

.collections-stat-filter:focus {
  border-color: var(--ui-pill-line-active);
}

.collections-stat-filter option {
  background: #2c2e34;
  color: #e8eaee;
}

/* Инвентарь: вкладки-иконки, сетка ячеек 5×N */
.inventory-root--grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
}

.inventory-root .inventory-toolbar {
  flex-shrink: 0;
  margin-bottom: 14px;
}

.menu-icon-wrap {
  position: relative;
  display: inline-block;
  line-height: 0;
}

.menu-attention-dot--on-icon {
  top: 2px;
  right: 2px;
}

.inventory-mode-hint {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.25;
  color: rgba(238, 243, 251, 0.78);
}

.inventory-toolbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.inventory-cat-tabs {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 0;
  scrollbar-width: thin;
}

.inventory-cat-tab {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.inventory-cat-tab:hover:not(:disabled) {
  border: none;
  background: transparent;
}

.inventory-cat-tab--active {
  border: none;
  background: transparent;
  box-shadow: none;
}

.inventory-cat-tab--active::after {
  content: '';
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 9px;
  height: 6px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--gold, #d3b06f), var(--gold-dim, rgba(180, 140, 70, 0.6)));
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  box-shadow: 0 0 14px rgba(211, 176, 111, 0.42);
  z-index: 5;
  pointer-events: none;
}

.inventory-cat-tab--active {
  z-index: 4;
}

.inventory-cat-tab__img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  opacity: 0.82;
  pointer-events: none;
}

.inventory-cat-tab--active .inventory-cat-tab__img {
  opacity: 1;
  filter: drop-shadow(0 0 4px rgba(211, 176, 111, 0.35));
}

.inventory-toolbar-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.inventory-tool-btn {
  position: relative;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 3px;
  border-radius: 9px;
  border: 1px solid var(--ui-pill-line);
  background: var(--ui-pill-bg);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.inventory-tool-btn--salvage {
  border-color: rgba(255, 90, 90, 0.45);
  background: rgba(72, 18, 22, 0.55);
}

.inventory-tool-btn--delete {
  border-color: rgba(255, 90, 90, 0.45);
  background: rgba(72, 18, 22, 0.55);
}

.inventory-tool-btn--active {
  border-color: rgba(255, 120, 120, 0.75);
  box-shadow: 0 0 0 1px rgba(255, 90, 90, 0.35) inset;
}

.inventory-tool-btn--filter {
  border-color: rgba(211, 176, 111, 0.42);
  background: rgba(40, 34, 22, 0.55);
}

.inventory-tool-btn--filter-active {
  border-color: rgba(211, 176, 111, 0.78);
  box-shadow:
    0 0 0 1px rgba(211, 176, 111, 0.32) inset,
    0 0 10px rgba(211, 176, 111, 0.22);
}

.inventory-rarity-filter {
  position: relative;
  flex: 0 0 auto;
}

.inventory-rarity-filter__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 148px;
  max-height: min(260px, 42vh);
  overflow-y: auto;
  padding: 6px;
  border-radius: var(--ui-panel-radius, 12px);
  border: 1px solid var(--ui-panel-border);
  background: var(--ui-panel-bg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.42);
  z-index: 24;
  display: flex;
  flex-direction: column;
  gap: 4px;
  scrollbar-width: thin;
}

.inventory-rarity-filter__item {
  margin: 0;
  padding: 7px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--ui-pill-text, rgba(220, 224, 230, 0.92));
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.inventory-rarity-filter__item:hover {
  background: rgba(211, 176, 111, 0.12);
}

.inventory-rarity-filter__item--active {
  background: rgba(211, 176, 111, 0.16);
  box-shadow: 0 0 0 1px rgba(211, 176, 111, 0.28) inset;
}

.inventory-tool-btn__img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  pointer-events: none;
}

.inventory-tool-btn__badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 999px;
  background: #ff4d5f;
  color: #fff;
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
}

.inventory-mode-hint {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.35;
  color: rgba(238, 243, 251, 0.78);
}

.inventory-slot-counter {
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--gold, #e9d4a3);
  white-space: nowrap;
  cursor: pointer;
}

.inventory-slot-counter:disabled {
  cursor: default;
  opacity: 0.72;
}

.inventory-slot-expand-cost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  vertical-align: middle;
}

.inventory-slot-expand-cost__ico {
  width: 28px;
  height: 28px;
  object-fit: contain;
  vertical-align: middle;
}

/* Ширина для cqi — на родителе: на самом scroll 100cqi даёт слишком большую высоту. */
.inventory-cells-frame {
  flex: 0 1 auto;
  min-width: 0;
  min-height: 0;
  width: 100%;
  container-type: inline-size;
  container-name: inv-cells;
}

.inventory-cells-scroll {
  --inv-gap: 5px;
  --inv-visible-rows: 7;
  --inv-cols: 5;
  /* 7 рядов квадратных ячеек (5 колонок): высота = ширина ячейки × 7 + gap */
  max-height: calc(
    ((100cqi - (var(--inv-cols) - 1) * var(--inv-gap)) / var(--inv-cols)) * var(--inv-visible-rows) +
      var(--inv-gap) * (var(--inv-visible-rows) - 1)
  );
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 2px 2px 0;
  margin-top: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--ui-scrollbar-thumb) var(--ui-scrollbar-track);
}

@supports not (width: 1cqi) {
  .inventory-cells-scroll {
    /* ~7 рядов при типичной ширине панели (~5×64px + gaps) */
    max-height: min(48vh, 420px);
  }
}

.quest-claim-modal-rewards {
  --quest-claim-row-estimate: 68px;
  --quest-claim-gap: 10px;
  --quest-claim-visible-rows: 7;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: var(--quest-claim-gap);
  margin: 12px 0 16px;
  max-height: calc(
    var(--quest-claim-row-estimate) * var(--quest-claim-visible-rows) +
      var(--quest-claim-gap) * (var(--quest-claim-visible-rows) - 1)
  );
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 2px 2px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--ui-scrollbar-thumb) var(--ui-scrollbar-track);
}

.quest-claim-modal-rewards > * {
  flex: 0 0 auto;
}

.inventory-cells-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--inv-gap, 5px);
  min-width: 0;
}

.inventory-cells-empty {
  grid-column: 1 / -1;
  margin: 8px 0 0;
}

.inv-cell-tile {
  position: relative;
  min-width: 0;
  aspect-ratio: 1;
}

.inv-cell-tile__btn {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 4px 3px 5px;
  border-radius: 10px;
  border: 1px solid var(--ui-panel-border, var(--line));
  background: var(--ui-panel-bg, var(--surface-deep));
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-height: 0;
  font: inherit;
  color: inherit;
  box-sizing: border-box;
}

.inv-cell-tile--selected .inv-cell-tile__btn {
  border-color: rgba(211, 176, 111, 0.72);
  box-shadow: 0 0 0 1px rgba(211, 176, 111, 0.42) inset;
}

.inv-cell-tile--muted .inv-cell-tile__btn {
  opacity: 0.52;
}

.inv-cell-tile__lock-btn,
.inv-cell-tile__upgrade-btn {
  position: absolute;
  top: 2px;
  left: 2px;
  z-index: 4;
  width: 20px;
  height: 20px;
  margin: 0;
  padding: 1px;
  border: 0;
  border-radius: 6px;
  background: rgba(8, 10, 14, 0.72);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.inv-cell-tile__lock-btn--locked {
  background: rgba(40, 24, 8, 0.82);
}

.inv-cell-tile__lock-img,
.inv-cell-tile__upgrade-img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  pointer-events: none;
}

.inv-cell-tile__new-dot {
  top: 3px;
  right: 3px;
  left: auto;
}

.inv-cell-tile--equipped:not(.inv-cell-tile--locked) .inv-cell-tile__btn {
  border-color: #d3b06f;
  background: rgba(31, 24, 13, 0.64);
  box-shadow: 0 0 0 1px rgba(138, 110, 54, 0.35);
}

.inv-cell-tile--locked .inv-cell-tile__btn {
  border-color: var(--ui-panel-border, var(--line));
  background: rgba(31, 24, 13, 0.64);
  box-shadow: none;
}

.inv-cell-tile__thumb {
  position: relative;
  width: 100%;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.inv-cell-tile__img {
  width: auto;
  max-width: 88%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.inv-cell-tile__img--empty {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.inv-cell-tile__qty {
  position: absolute;
  right: 2px;
  bottom: 0;
  padding: 1px 4px;
  border-radius: 6px;
  background: rgba(8, 10, 14, 0.88);
  border: 1px solid rgba(154, 164, 176, 0.35);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.2;
  color: #eef3fb;
}

.inv-cell-tile__plus {
  position: absolute;
  right: 2px;
  bottom: 0;
  z-index: 2;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  color: #f4f7fc;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
  pointer-events: none;
}

.inv-cell-tile__rarity {
  margin: 0;
  font-size: 0.52rem;
  padding: 1px 5px;
  line-height: 1.2;
}

.inv-cell-tile__name {
  width: 100%;
  flex: 0 0 auto;
  font-size: 0.64rem;
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
  color: #eef3fb;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

.inventory-consumable-foot {
  flex-shrink: 0;
  padding-top: 2px;
}

.craft-card-hint {
  margin: 2px 0 4px;
  font-size: 0.74rem;
  line-height: 1.3;
}

.gear-preview-title-row--with-lock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.gear-preview-lock-btn {
  width: 24px;
  height: 24px;
  margin: 0;
  padding: 2px;
  border: 0;
  border-radius: 6px;
  background: rgba(8, 10, 14, 0.72);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.gear-preview-lock-btn--locked {
  background: rgba(40, 24, 8, 0.82);
}

.gear-preview-lock-btn img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.gear-preview-inv-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

.gear-preview-forge-btn {
  width: 42px;
  height: 42px;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.gear-preview-forge-btn__img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.gear-preview-modal--inv-centered .gear-preview-inv-visual-row--centered {
  justify-content: center;
}

.gear-preview-modal--inv-centered .gear-preview-inv-visual-row--centered .gear-preview-inv-gear-wrap--center {
  margin-left: auto;
  margin-right: auto;
}

.inventory-root .card-preview-box--gear-inv .gear-preview-inv-actions .gear-preview-inv-action.btn-equip-icon {
  width: 42px;
  height: 42px;
  min-width: 42px;
  padding: 0;
}

.inventory-root .collections-tabs {
  margin-top: 2px;
}

.inv-collections-tools.collections-tools {
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
}

.inv-filter-select.collections-stat-filter {
  width: auto;
  flex: 0 0 clamp(7.5rem, 34vw, 10.5rem);
  max-width: 10.5rem;
  min-width: 6.5rem;
}

.inv-panel-search {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  max-width: none;
}

.inv-tab-block {
  margin-bottom: 2px;
}

.inv-subhead {
  margin: 10px 0 6px;
}

.inv-loot-fallback {
  font-size: 1.55rem;
  line-height: 1;
}

.collection-row {
  margin-bottom: 10px;
}

.collection-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.collection-row-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.collection-row-icon {
  display: inline-flex;
  position: relative;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 0;
  border: none;
  background: transparent;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.collection-row-icon--large {
  width: 56px;
  height: 56px;
  font-size: 2rem;
}

.collection-row-icon--large .collection-row-icon-img {
  width: 52px;
  height: 52px;
}

.collection-row-icon::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(211, 176, 111, 0.38) 0%, rgba(211, 176, 111, 0.16) 42%, rgba(211, 176, 111, 0) 64%);
  pointer-events: none;
}

.collection-row-icon--glow-gold::before {
  inset: -6px;
  background:
    radial-gradient(circle, rgba(255, 210, 120, 0.32) 0%, rgba(255, 186, 80, 0.14) 40%, rgba(211, 160, 60, 0) 68%);
  filter: blur(1px);
  animation: collection-gold-pulse 2.8s ease-in-out infinite;
}

.collection-row-icon--glow-gold .collection-row-icon-img {
  filter: drop-shadow(0 0 3px rgba(255, 205, 110, 0.4)) drop-shadow(0 0 7px rgba(255, 180, 60, 0.18));
}

@keyframes collection-gold-pulse {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(0.98);
  }
  50% {
    opacity: 0.85;
    transform: scale(1.03);
  }
}

.collection-row-icon-img {
  width: 27px;
  height: 27px;
  object-fit: contain;
  display: block;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 0 8px rgba(211, 176, 111, 0.55));
}

.collection-row-meta {
  margin-bottom: 6px;
  line-height: 1.35;
  padding-left: 0;
  box-sizing: border-box;
}

.collection-row-layout {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  min-width: 0;
}

.collection-row-media {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.collection-row-info {
  flex: 1 1 auto;
  min-width: 0;
}

.collection-row-title-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 8px;
  min-width: 0;
}

.collection-row-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gold, #d3b06f);
  line-height: 1.25;
}

.collection-row-progress-brackets {
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(236, 240, 248, 0.82);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.collection-row-bonus {
  margin: 4px 0 0;
  font-size: 0.82rem;
  line-height: 1.35;
  color: rgba(236, 240, 248, 0.88);
}

.collection-closed-label {
  margin: 0;
  width: 100%;
  text-align: center;
}

.collection-progress {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(106, 119, 134, 0.22);
  border: 1px solid rgba(146, 160, 178, 0.28);
  margin-bottom: 8px;
}

.collection-progress > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(120, 124, 132, 0.85) 0%, rgba(168, 172, 180, 0.9) 50%, rgba(200, 204, 210, 0.88) 100%);
}

.collection-row--chain-locked {
  opacity: 0.72;
}

.collection-row--chain.collection-chain-wrap {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 6px;
}

.collection-chain-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.collection-chain-counter {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  margin: 0;
  padding: 0;
  line-height: 1.2;
  opacity: 0.88;
}

.collection-chain-arrow--side {
  flex: 0 0 auto;
  align-self: center;
  width: 26px;
  height: 26px;
  min-width: 26px;
  padding: 0;
  margin: 0;
  border-radius: 6px;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(28, 34, 44, 0.95);
  border: 1px solid rgba(154, 164, 176, 0.38);
  color: #e8ecf4;
  cursor: pointer;
}

.collection-chain-arrow--side:hover:not(:disabled) {
  border-color: rgba(196, 200, 210, 0.55);
  color: #fff;
}

.collection-chain-arrow--side:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.collection-chain-arrow-img {
  display: block;
  width: 20px;
  height: 20px;
  object-fit: contain;
  pointer-events: none;
}

.collection-chain-arrow--side:disabled .collection-chain-arrow-img {
  opacity: 0.55;
}

.collection-row-title-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}

.collection-current-target-label {
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  color: #d4b44a;
  line-height: 1.2;
  opacity: 0.95;
}

.collection-slide-inner--locked {
  opacity: 0.72;
}

.collection-row-chain-msg {
  margin: 2px 0 6px;
  font-size: 0.86rem;
  color: rgba(180, 184, 192, 0.9);
  padding-left: 0;
  box-sizing: border-box;
}

.collection-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
}

.collection-actions-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-left: auto;
}

.collection-in-stock,
.collection-actions-trail {
  flex: 0 0 auto;
  margin-left: 0;
  text-align: left;
  white-space: nowrap;
  font-size: 0.82rem;
  color: rgba(236, 240, 248, 0.82);
}

.collection-in-stock b {
  font-weight: 600;
  color: rgba(236, 240, 248, 0.95);
}

.collection-actions .btn {
  width: auto;
  margin: 0;
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 0.82rem;
}

.summon-tier-stone {
  width: auto !important;
  height: 24px !important;
  object-fit: contain;
  flex: 0 0 auto;
  display: block;
}

.summon-tier-stone.summon-tier-stone--warrior-summon {
  height: 30px !important;
}

@media (max-width: 520px) {
  .shop-grid,
  .craft-grid.shop-grid {
    grid-template-columns: 1fr;
  }

  .shop-search--card-width {
    width: 100%;
    max-width: 100%;
  }
}

.shop-item-icon-wrap {
  position: relative;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shop-item-icon {
  width: 58px;
  height: 58px;
  object-fit: contain;
  display: block;
}

.shop-item-qty-badge {
  position: absolute;
  right: -6px;
  bottom: -6px;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(191, 160, 96, 0.55);
  background: rgba(20, 22, 28, 0.82);
  color: #f3e1b4;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  min-width: 26px;
  text-align: center;
}

.shop-row-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
}

.shop-qty-input {
  width: 82px;
  height: 34px;
  box-sizing: border-box;
  border-radius: var(--ui-input-radius);
  border: 1px solid var(--ui-input-line);
  background: var(--ui-input-bg);
  color: #ece5d5;
  padding: 0 30px 0 10px;
  font-weight: 700;
}

.shop-qty-input-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* Компактные кнопки в сетке лавки/крафта: размер, без смены варианта (primary/secondary) */
.btn.btn-shop-buy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: 34px;
  height: 34px;
  margin: 0;
  padding: 0 14px;
  border-radius: var(--btn-radius-compact);
  font-size: 0.88rem;
  font-weight: 700;
  box-sizing: border-box;
}

.btn.btn-shop-max {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 34px;
  margin: 0;
  padding: 0 8px;
  border-radius: var(--btn-radius-compact);
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1;
}

.btn.btn-shop-max-inline {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 24px;
  width: 24px;
  height: 16px;
  padding: 0 2px;
  margin: 0;
  border-radius: 5px;
  font-size: 7px;
  font-weight: 700;
  line-height: 1;
  z-index: 1;
}

.btn.btn-shop-buy:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: rgba(22, 24, 30, 0.75);
  color: rgba(180, 186, 198, 0.65);
  border-color: rgba(120, 128, 140, 0.35);
  box-shadow: none;
}

/* Дневной лимит сумеречной закуски: серая кнопка, но клик открывает подсказку. */
.btn.btn-shop-buy.btn-shop-buy--snack-limit {
  opacity: 0.55;
  cursor: pointer;
  background: rgba(22, 24, 30, 0.75);
  color: rgba(180, 186, 198, 0.65);
  border-color: rgba(120, 128, 140, 0.35);
  box-shadow: none;
}

.craft-blocked-box {
  max-width: min(92vw, 360px);
}

.craft-blocked-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 8px 0 4px;
}

.craft-blocked-item-icon {
  border-radius: 10px;
  object-fit: cover;
}

.craft-blocked-item-name {
  margin: 0;
  text-align: center;
  font-size: 14px;
}

.craft-blocked-lead {
  margin-bottom: 8px !important;
}

.craft-blocked-reasons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 14px;
  text-align: left;
}

.craft-blocked-modal__line {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(210, 216, 228, 0.92);
}

.craft-blocked-modal__line--shortage {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.craft-blocked-modal__res-icon {
  flex: 0 0 auto;
  margin-top: 1px;
  border-radius: 4px;
}

.quest-row.done {
  opacity: 0.55;
}

.codex-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
}

/* ===== Рынок (как лавка / крафт / инвентарь: stub, shop-topbar, collections-tabs, shop-grid) ===== */
.collections-root .shop-topbar {
  gap: 4px;
  margin-bottom: 4px;
}

.market-collections-tabs-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 2px;
}

/* Фиксированная высота — текст лога не двигает шапку и вкладки */
.collections-root #market-log.collections-inline-msg {
  display: block;
  min-height: 1.1rem;
  max-height: 1.5rem;
  margin: 0 0 1px;
  padding: 0;
  line-height: 1.35;
  font-size: 0.88rem;
  overflow-x: hidden;
  overflow-y: auto;
  box-sizing: border-box;
  scrollbar-width: thin;
}

.market-browse-pay-tabs--concealed {
  opacity: 0;
  pointer-events: none;
}

.market-collections-tabs-row .collections-tab {
  box-sizing: border-box;
  min-height: 2.125rem;
}

.market-collections-tabs-row .market-pay-tab:not(.market-pay-tab--active) {
  box-shadow: 0 0 0 1px transparent;
}

.market-collections-tabs-row .collections-tabs {
  margin: 0;
  flex: 0 1 auto;
  min-width: 0;
}

.market-collections-tabs-row .market-browse-pay-tabs {
  margin: 0;
  margin-left: auto;
  flex: 0 0 auto;
}

.market-vip-inline-pockets {
  margin-left: auto;
  flex: 0 0 auto;
}

.market-browse-cat-tabs {
  margin: 0 0 8px;
  width: 100%;
}

/* Рынок: категории «Купить» / «Продать» — иконки в одну строку */
.market-browse-cat-tabs.market-cat-tabs--icons,
.market-sell-cat-tabs.market-cat-tabs--icons {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  overflow-x: auto;
  overflow-y: visible;
  gap: 4px;
  justify-content: space-between;
  scrollbar-width: thin;
}

.market-cat-tabs--icons .lb-tab.market-cat-tab--icon {
  padding: 8px 2px 4px;
  min-width: 0;
  flex: 1 1 0;
  max-width: none;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  position: relative;
}

.market-cat-tabs--icons .lb-tab--active::after {
  content: '';
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 9px;
  height: 6px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--gold, #d3b06f), var(--gold-dim, rgba(180, 140, 70, 0.6)));
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  box-shadow: 0 0 14px rgba(211, 176, 111, 0.45);
  z-index: 5;
  pointer-events: none;
}

.market-cat-tabs--icons .lb-tab--active {
  z-index: 4;
}

.market-cat-tabs--icons .market-cat-tab-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
  opacity: 0.78;
  pointer-events: none;
}

.market-cat-tabs--icons .lb-tab--active .market-cat-tab-img {
  opacity: 1;
  filter: drop-shadow(0 0 4px rgba(211, 176, 111, 0.35));
}

/* VIP на рынке — всегда «золотая» кнопка */
.market-collections-tabs-row .collections-tab.market-tab-vip {
  color: var(--gold, #d3b06f);
  border-color: rgba(211, 176, 111, 0.48);
  background: linear-gradient(180deg, rgba(42, 36, 22, 0.94) 0%, rgba(22, 20, 14, 0.96) 100%);
  box-shadow: 0 0 0 1px rgba(138, 110, 54, 0.12);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.market-collections-tabs-row .collections-tab.market-tab-vip:hover {
  border-color: rgba(232, 200, 120, 0.55);
  color: #e8c878;
}

.market-collections-tabs-row .collections-tab.market-tab-vip:focus-visible {
  outline: 2px solid rgba(211, 176, 111, 0.5);
  outline-offset: 2px;
}

.market-collections-tabs-row .collections-tab.market-tab-vip.collections-tab--active {
  border-color: rgba(211, 176, 111, 0.72);
  color: #f4e0b8;
  background: linear-gradient(180deg, rgba(62, 52, 30, 0.98) 0%, rgba(32, 28, 16, 0.99) 100%);
  box-shadow: 0 0 0 1px rgba(211, 176, 111, 0.28), 0 0 12px rgba(211, 176, 111, 0.12);
}

.market-vip-section {
  margin-bottom: 16px;
}

.market-vip-section--packs {
  margin-top: 8px;
}

.market-vip-section-title {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.market-vip-section-desc {
  margin: 0 0 10px;
}

.market-vip-sub-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  align-items: stretch;
}

.market-vip-sub {
  display: flex;
  gap: 10px;
  align-items: stretch;
  height: 100%;
  min-height: 172px;
  padding: 10px;
  border-radius: var(--ui-panel-radius, 12px);
  border: 1px solid var(--ui-panel-border, rgba(154, 164, 176, 0.3));
  background: var(--ui-panel-bg, rgba(20, 22, 28, 0.72));
  box-sizing: border-box;
}

.market-vip-sub--active {
  border-color: rgba(211, 176, 111, 0.55);
  box-shadow: 0 0 0 1px rgba(211, 176, 111, 0.18);
}

.market-vip-sub__visual {
  flex: 0 0 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
}

.market-vip-sub__img {
  width: 88px;
  height: 88px;
  object-fit: contain;
  display: block;
}

.market-vip-sub__body {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

.market-vip-sub__name {
  font-weight: 700;
  font-size: 0.95rem;
}

.market-vip-sub__perk {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.35;
  text-align: left;
  flex: 1 1 auto;
}

.market-vip-sub__status {
  margin: 0;
  font-size: 0.75rem;
}

.market-vip-sub__status--active {
  color: var(--gold, #d3b06f);
  font-weight: 600;
}

.market-vip-sub__price {
  margin: 2px 0 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text, #e8ebef);
}

.market-vip-sub__buy {
  margin-top: auto;
  flex-shrink: 0;
}

.market-vip-quest-block {
  margin-top: 14px;
}

.market-vip-pack-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  margin-top: 2px;
}

.market-vip-pack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 12px 12px 10px;
  border-radius: var(--ui-panel-radius, 12px);
  border: 1px solid var(--ui-panel-border, rgba(154, 164, 176, 0.3));
  background: var(--ui-panel-bg, rgba(20, 22, 28, 0.72));
  text-align: center;
}

.market-vip-pack-strip .market-vip-pack {
  padding: 8px;
  gap: 6px;
  min-width: 0;
}

.market-vip-pack__name {
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--gold, #d9be86);
  text-wrap: balance;
}

.market-vip-pack-strip .market-vip-pack__name {
  font-size: 0.72rem;
  line-height: 1.2;
}

.market-vip-pack__visual {
  position: relative;
  border-radius: var(--ui-input-radius, 10px);
  overflow: hidden;
  background: #08080a;
  border: 1px solid rgba(154, 164, 176, 0.22);
}

.market-vip-pack__visual--btn {
  appearance: none;
  margin: 0;
  padding: 0;
  width: 100%;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.market-vip-pack__visual--btn:focus-visible {
  outline: 2px solid var(--ui-focus-ring, rgba(212, 181, 106, 0.65));
  outline-offset: 2px;
}

.market-vip-pack-strip .market-vip-pack__visual {
  aspect-ratio: 1;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.market-vip-pack__img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}

.market-vip-pack-strip .market-vip-pack__img {
  width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
}

.market-vip-pack-strip .market-vip-pack__price {
  font-size: 0.88rem;
}

.market-vip-pack-strip .market-vip-pack__badge {
  font-size: 0.76rem;
  padding: 3px 7px;
}

.market-vip-pack-strip .market-vip-pack__badge--gold {
  font-size: 0.76rem;
  padding: 3px 7px;
}

.market-vip-pack__badge {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.15;
  color: #14110c;
  background: linear-gradient(180deg, #ead4a0 0%, var(--gold, #d9be86) 45%, var(--gold-dim, #b39b6b) 100%);
  border: 1px solid rgba(255, 248, 230, 0.38);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

.market-vip-pack__badge--gold {
  color: #1a1208;
  background: linear-gradient(180deg, #f0d78c 0%, #e0b85a 40%, #c99830 100%);
  border-color: rgba(255, 236, 200, 0.55);
}

.market-vip-pack__price--inline-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.market-vip-pack__price-ico {
  display: block;
  flex-shrink: 0;
}

.market-vip-pack__price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text, #e8ebef);
}

.market-vip-pack__buy {
  margin-top: auto;
  width: 100%;
}

/* VIP «Пак Судьбы»: лимит суток / недели (UTC) — карточка видна, но серая и без покупки. */
.market-vip-pack--unavailable {
  border-color: rgba(120, 128, 140, 0.28);
  background: var(--ui-stub-bg, rgba(14, 16, 20, 0.55));
}

.market-vip-pack--unavailable .market-vip-pack__visual {
  border-color: rgba(100, 108, 120, 0.28);
}

.market-vip-pack--unavailable .market-vip-pack__img {
  filter: grayscale(0.9) brightness(0.78);
}

.market-vip-pack--unavailable .market-vip-pack__badge {
  opacity: 0.65;
}

.market-vip-pack--unavailable .market-vip-pack__name,
.market-vip-pack--unavailable .market-vip-pack__price {
  color: rgba(180, 186, 198, 0.55);
}

/* «Недоступно»: серая кнопка, клик открывает подсказку о лимите. */
.market-vip-pack--unavailable .market-vip-pack__buy.market-vip-pack__buy--unavailable-info,
.btn.market-vip-pack__buy.market-vip-pack__buy--unavailable-info {
  opacity: 0.55;
  cursor: pointer;
  background: rgba(22, 24, 30, 0.75);
  color: rgba(180, 186, 198, 0.65);
  border-color: rgba(120, 128, 140, 0.35);
  box-shadow: none;
  filter: none;
  white-space: nowrap;
  font-size: 0.82rem;
  line-height: 1.2;
  padding-left: 8px;
  padding-right: 8px;
}

/* «Недоступно до: дата» — две мелкие строки; отрицательные поля держат высоту кнопки как у «Купить». */
.market-vip-buy-until {
  display: inline-block;
  margin: -4px 0;
  font-size: 0.56rem;
  line-height: 1.1;
  font-weight: 600;
  white-space: nowrap;
  text-align: center;
  vertical-align: middle;
}

.market-vip-pack--unavailable .market-vip-pack__buy.market-vip-pack__buy--unavailable-info:hover,
.btn.market-vip-pack__buy.market-vip-pack__buy--unavailable-info:hover {
  background: rgba(28, 30, 36, 0.82);
  color: rgba(190, 196, 208, 0.72);
  border-color: rgba(120, 128, 140, 0.42);
}

.market-panel[hidden] {
  display: none !important;
}

.market-browse-pay-tabs {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* Как у .collections-tab: те же padding и border-radius */
.market-collections-tabs-row .market-pay-tab {
  padding: 7px 12px;
  border-radius: 10px;
  box-sizing: border-box;
}

.market-pay-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: var(--ui-panel-radius, 12px);
  border: 1px solid var(--ui-pill-line, rgba(154, 164, 176, 0.35));
  background: var(--ui-pill-bg, rgba(20, 22, 28, 0.85));
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.market-pay-tab:hover {
  border-color: rgba(211, 176, 111, 0.35);
}

.market-pay-tab:focus-visible {
  outline: 2px solid var(--ui-focus-ring, rgba(211, 176, 111, 0.55));
  outline-offset: 2px;
}

.market-pay-tab--active {
  border-color: rgba(211, 176, 111, 0.5);
  box-shadow: 0 0 0 1px rgba(138, 110, 54, 0.28);
}

.market-pay-tab--disabled,
.market-pay-tab:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.market-pay-tab-icon {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.market-collections-tabs-row .market-pay-tab-icon {
  width: 20px;
  height: 20px;
}

.market-topbar-row1 {
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
}

.collections-root .market-topbar-row1 {
  align-items: center;
  min-height: 2.75rem;
}

.market-topbar-row1 .section-title {
  flex: 0 0 auto;
  margin-bottom: 0;
}

.market-topbar-pockets {
  flex: 0 0 auto;
}

.market-topbar-row1:not(.market-topbar-row1--vip) .market-topbar-search-slot {
  margin-left: auto;
}

.market-topbar-row1--vip .market-topbar-pockets {
  margin-left: auto;
}

.collections-root .market-topbar-search-slot {
  position: relative;
  flex: 0 0 auto;
  width: 10.5rem;
  max-width: min(10.5rem, 40vw);
  min-width: 7rem;
  min-height: 2.25rem;
}

.collections-root .market-topbar-search-slot .shop-search {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.market-topbar-search-input {
  padding: 6px 10px;
  font-size: 0.88rem;
}

.market-sell-cat-tabs {
  margin: 0 0 6px;
  width: 100%;
}

#market-panel-sell .inv-subhead {
  margin: 6px 0 4px;
}

/* Как кузница: 5 ячеек в ряд, прокрутка по вертикали */
.market-sell-inv-strip-wrap {
  margin-bottom: 8px;
}

.market-sell-inv-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-content: start;
  gap: 8px;
  min-height: 120px;
  max-height: 236px;
  overflow-y: auto;
  padding: 4px 0 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(184, 193, 208, 0.42) transparent;
}

.market-sell-inv-grid::-webkit-scrollbar {
  width: 6px;
}

.market-sell-inv-grid::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(184, 193, 208, 0.42);
}

.market-sell-inv-grid::-webkit-scrollbar-track {
  background: transparent;
}

.market-sell-inv-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  gap: 6px;
  margin: 0;
  padding: 8px 4px 10px;
  min-height: 0;
  text-align: center;
  border-radius: 10px;
  border: 1px solid rgba(100, 110, 128, 0.45);
  background: rgba(18, 22, 30, 0.88);
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.market-sell-inv-tile:hover {
  border-color: rgba(211, 176, 111, 0.35);
}

.market-sell-inv-tile:focus-visible {
  outline: 2px solid var(--ui-focus-ring, rgba(211, 176, 111, 0.55));
  outline-offset: 2px;
}

.market-sell-inv-tile--selected {
  border-color: rgba(200, 175, 120, 0.75);
  box-shadow: 0 0 0 1px rgba(200, 175, 120, 0.35);
}

.market-sell-inv-visual {
  position: relative;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
}

.market-sell-inv-visual.gear-rarity-glow {
  background: rgba(0, 0, 0, 0.35);
}

.market-sell-inv-visual.gear-rarity-glow > img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  flex: 0 0 auto;
}

.market-sell-inv-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.market-sell-inv-qty {
  position: absolute;
  right: 2px;
  bottom: 2px;
  z-index: 2;
  padding: 0 4px;
  min-width: 20px;
  height: 16px;
  border-radius: 999px;
  font-size: 0.64rem;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
  background: rgba(10, 14, 22, 0.82);
  border: 1px solid rgba(160, 170, 186, 0.45);
  color: rgba(241, 245, 252, 0.96);
}

.market-sell-inv-title {
  width: 100%;
  margin-top: 2px;
  font-size: 0.72rem;
  line-height: 1.25;
  max-width: 100%;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

.market-sell-my-head {
  margin-top: 12px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.market-sell-my-head-count {
  font-weight: 400;
  color: rgba(170, 178, 192, 0.88);
  white-space: nowrap;
}

.market-sell-my-grid {
  margin-bottom: 0;
}

.market-sell-my-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--ui-pill-border, rgba(154, 164, 176, 0.28));
  background: var(--ui-stub-bg, rgba(10, 12, 16, 0.72));
}

.market-sell-my-card--sold {
  border-color: rgba(211, 176, 111, 0.7);
  background: linear-gradient(180deg, rgba(52, 42, 24, 0.9) 0%, rgba(24, 20, 14, 0.95) 100%);
  box-shadow: 0 0 0 1px rgba(211, 176, 111, 0.25);
}

.market-sell-my-visual {
  position: relative;
  align-self: center;
  width: 3.75rem;
  height: 3.75rem;
}

.market-sell-my-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.market-sell-my-qty {
  position: absolute;
  right: -4px;
  bottom: -2px;
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(10, 12, 16, 0.88);
  border: 1px solid rgba(154, 164, 176, 0.35);
  line-height: 1.2;
}

.market-sell-my-title {
  font-size: 0.88rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

.market-sell-my-price {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.market-sell-my-price-total {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-weight: 600;
}

.market-sell-my-price-unit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 0.78rem;
  line-height: 1.2;
  font-weight: 400;
}

.market-sell-limit-hint {
  margin: 0 0 8px;
}

.market-sell-limit-warn {
  color: #e8c878;
  margin: 0 0 8px;
}

.market-sell-my-price-hint {
  font-weight: 400;
  margin-left: 4px;
}

.market-sell-my-withdraw--claim {
  background: linear-gradient(180deg, rgba(84, 69, 37, 0.98) 0%, rgba(49, 40, 20, 0.99) 100%);
  border-color: rgba(211, 176, 111, 0.8);
  color: #f4e0b8;
  box-shadow: 0 0 0 1px rgba(211, 176, 111, 0.3);
}

.market-sell-my-withdraw--claim:hover {
  border-color: rgba(232, 200, 120, 0.95);
  color: #ffe7bd;
}

.market-sell-dock {
  margin-top: 8px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(211, 176, 111, 0.22);
  background: rgba(10, 12, 16, 0.45);
}

.market-sell-dock-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.market-sell-dock-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: flex-start;
}

.market-sell-dock-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.88rem;
  flex: 1 1 140px;
  min-width: 0;
}

.market-sell-dock-label-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 1.4em;
  line-height: 1.25;
}

.market-sell-dock-label input {
  max-width: 100%;
}

.market-sell-price-hint {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35em;
}

.market-sell-price-min,
.market-sell-price-unit {
  font-size: 0.78rem;
  font-weight: 500;
  color: rgba(176, 184, 196, 0.9);
  line-height: 1.2;
}

.market-sell-price-unit {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.market-sell-price-unit img {
  width: 14px;
  height: 14px;
  object-fit: contain;
}

.market-sell-dock-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.market-sell-dock-item-img {
  position: relative;
  flex: 0 0 auto;
  width: 3.6rem;
  height: 3.6rem;
  padding: 0;
  border: 1px solid rgba(154, 164, 176, 0.28);
  border-radius: 12px;
  background: rgba(8, 10, 14, 0.55);
  cursor: default;
}

button.market-sell-dock-item-img {
  cursor: pointer;
}

button.market-sell-dock-item-img:hover {
  border-color: rgba(211, 176, 111, 0.55);
}

.market-sell-dock-item-img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.market-sell-dock-stats {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.market-sell-dock-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.82rem;
  line-height: 1.3;
  color: rgba(214, 220, 228, 0.92);
}

.market-sell-dock-stat-val {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  white-space: nowrap;
}

.market-sell-dock-stat-val img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.market-sell-dock-stats-empty {
  margin: 0;
}

.market-sell-my-img-btn {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.market-item-plus-badge {
  position: absolute;
  right: 1px;
  bottom: 1px;
  z-index: 2;
  padding: 0 4px;
  min-width: 18px;
  height: 16px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
  background: rgba(10, 14, 22, 0.86);
  border: 1px solid rgba(211, 176, 111, 0.55);
  color: rgba(244, 224, 184, 0.98);
  pointer-events: none;
}

.market-sell-price-currency-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  object-fit: contain;
  vertical-align: -3px;
}

.market-sell-dock-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* Модалка выставления лота (рынок → Продать) */
.market-sell-modal {
  position: fixed;
  inset: 0;
  z-index: 10140;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
}

.market-sell-modal[hidden] {
  display: none !important;
}

.market-sell-confirm-modal {
  z-index: 10155;
}

/* VIP-паки на рынке: окно подтверждения состава и цены */
.market-vip-pack-modal {
  z-index: 10158;
}

.market-vip-pack-modal__box {
  position: relative;
  max-width: 24rem;
  padding: 18px 16px 16px;
}

.market-vip-pack-modal__close,
.market-vip-pack-modal__box > .card-preview-close.market-vip-pack-modal__close {
  position: absolute;
  top: 6px;
  right: 8px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  appearance: none;
  font-size: 1.55rem;
  font-weight: 500;
  line-height: 1;
  color: rgba(220, 224, 232, 0.82);
  cursor: pointer;
}

.market-vip-pack-modal__close:hover,
.market-vip-pack-modal__box > .card-preview-close.market-vip-pack-modal__close:hover {
  background: transparent;
  color: rgba(244, 236, 216, 0.98);
}

.market-vip-pack-modal__close:active,
.market-vip-pack-modal__box > .card-preview-close.market-vip-pack-modal__close:active {
  transform: none;
  background: transparent;
}

.market-vip-pack-modal__title {
  margin: 0 2rem 14px 0;
  padding: 0;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
  color: var(--gold, #d9be86);
}

.market-vip-pack-modal__body {
  display: grid;
  grid-template-columns: minmax(0, 7.5rem) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.market-vip-pack-modal__visual {
  border-radius: var(--ui-input-radius, 10px);
  overflow: hidden;
  background: var(--ui-panel-bg-2, rgba(8, 10, 14, 0.95));
  border: 1px solid var(--ui-panel-border, rgba(154, 164, 176, 0.28));
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.market-vip-pack-modal__visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.market-vip-pack-modal__contents {
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: center;
  min-height: 100%;
  text-align: left;
}

.market-vip-pack-modal__line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  line-height: 1.35;
  color: var(--text, #e8ebef);
}

.market-vip-pack-modal__line-ico {
  flex-shrink: 0;
  border-radius: 6px;
  object-fit: contain;
}

.market-vip-pack-modal__line-text b {
  font-weight: 800;
  color: rgba(244, 236, 216, 0.98);
}

.market-vip-pack-modal__line--stacked {
  align-items: center;
}

.market-vip-pack-modal__line-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}

.market-vip-pack-modal__line-name {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text, #e8ebef);
}

.market-vip-pack-modal__line-qty {
  font-size: 0.95rem;
  line-height: 1.2;
}

.market-vip-pack-modal__line-qty b {
  font-weight: 800;
  color: rgba(244, 236, 216, 0.98);
}

.market-vip-pack-modal__price-wrap {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.market-vip-pack-modal__price-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(200, 206, 216, 0.72);
}

.market-vip-pack-modal__price {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text, #e8ebef);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.market-vip-pack-modal__price--inline-ico {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.market-vip-pack-modal__buy {
  display: block;
  width: auto;
  min-width: 5.5rem;
  margin: 14px auto 0;
  padding: 6px 18px;
  font-size: 0.85rem;
}

@media (max-width: 420px) {
  .market-vip-pack-modal__body {
    grid-template-columns: minmax(0, 5.75rem) minmax(0, 1fr);
    gap: 10px;
  }

  .market-vip-pack-modal__line--stacked .market-vip-pack-modal__line-name,
  .market-vip-pack-modal__line--stacked .market-vip-pack-modal__line-qty {
    font-size: 0.84rem;
  }

  .market-vip-pack-modal__line {
    font-size: 0.84rem;
  }
}

.market-sell-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 10, 0.62);
  -webkit-tap-highlight-color: transparent;
}

.market-sell-modal__box {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 22.5rem;
  margin: auto;
  padding: 18px 16px 14px;
  border-radius: 16px;
  border: 1px solid rgba(211, 176, 111, 0.38);
  background: linear-gradient(180deg, rgba(26, 28, 34, 0.98) 0%, rgba(14, 16, 20, 0.99) 100%);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

.market-sell-modal__box--narrow {
  max-width: 19rem;
  text-align: center;
  padding: 20px 16px 16px;
}

.market-sell-modal__x {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 2.25rem;
  height: 2.25rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: rgba(180, 188, 200, 0.85);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.market-sell-modal__x:hover {
  color: var(--gold, #d3b06f);
  background: rgba(211, 176, 111, 0.1);
}

.market-sell-modal__hero {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding-right: 1.5rem;
}

.market-sell-modal__visual {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

.market-sell-modal__visual img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.market-sell-modal__meta {
  flex: 1 1 auto;
  min-width: 0;
}

.market-sell-modal__title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: #ece8df;
}

.market-sell-modal__stock {
  margin: 6px 0 0;
  font-size: 0.82rem;
}

.market-sell-modal__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 10px;
}

.market-sell-modal__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 5.5rem;
  min-width: 0;
  max-width: 8.5rem;
  font-size: 0.8rem;
  color: rgba(200, 206, 216, 0.92);
}

.market-sell-modal__field .panel-search-input {
  width: 100%;
  box-sizing: border-box;
}

.market-sell-modal__input-wrap {
  position: relative;
  display: block;
}

.market-sell-modal__input-wrap .panel-search-input {
  padding-right: 2.1rem;
}

.market-sell-modal__field-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.market-sell-modal__curr-wrap {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 2px 10px;
}

.market-sell-modal__curr {
  display: block;
  object-fit: contain;
}

.market-sell-modal__submit {
  flex: 1 1 7rem;
  min-width: min(100%, 7.5rem);
}

.market-sell-modal__fee {
  margin: 10px 0 0;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
}

.market-sell-modal__fee img {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.market-sell-confirm__text {
  margin: 0 0 16px;
  font-size: 0.92rem;
  line-height: 1.45;
  color: rgba(228, 224, 216, 0.95);
}

.market-sell-confirm__actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  justify-content: center;
}

.market-sell-confirm__actions .btn {
  width: auto;
  flex: 0 0 auto;
  min-width: 6.5rem;
  margin: 0;
  padding: 10px 18px;
}

.market-category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.market-group-block {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 100%;
}

.market-browse-drill {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
}

.market-browse-drill__hero.market-category-card-row {
  position: relative;
  margin: 0;
  padding: 0;
}

.market-browse-drill__hero-main {
  display: flex;
  flex: 1 1 auto;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
  padding: 12px 46px 12px 0;
}

.market-browse-drill__back {
  position: absolute;
  top: 4px;
  right: 4px;
  flex: 0 0 auto;
  margin: 0;
  z-index: 2;
}

.market-browse-drill__empty {
  position: relative;
  min-height: 2.75rem;
  padding: 10px 46px 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--ui-pill-border, rgba(154, 164, 176, 0.28));
  background: var(--ui-stub-bg, rgba(10, 12, 16, 0.72));
}

.market-browse-drill__empty .hint {
  margin: 0;
}

.market-browse-drill__close {
  display: none;
}

.market-browse-drill__visual {
  flex: 0 0 auto;
  width: 4.5rem;
  height: 4.5rem;
}

.market-browse-drill__visual img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.market-browse-drill__meta {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.market-browse-drill__title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.25;
  color: rgba(236, 232, 224, 0.96);
}

.market-browse-drill__sub {
  margin: 0;
  font-size: 0.82rem;
}

.market-browse-drill__filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 14px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(154, 164, 176, 0.2);
  background: rgba(6, 8, 12, 0.45);
}

.market-browse-drill__filters-kicker {
  flex: 1 1 100%;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(154, 164, 176, 0.75);
}

.market-browse-drill__filter {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 5.5rem;
  min-width: min(100%, 5.5rem);
  max-width: 10rem;
  font-size: 0.78rem;
  color: rgba(200, 206, 216, 0.88);
}

.market-browse-drill__filter-lab {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.market-browse-drill__filter .panel-search-input {
  width: 100%;
  box-sizing: border-box;
  font-size: 0.88rem;
}

.market-drill-filter-empty {
  margin: 0;
}

.market-browse-drill__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 2px;
}

.market-drill-row {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr) minmax(4.5rem, auto) 5.75rem 5.75rem 2.75rem;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  min-height: 3.5rem;
  border-radius: 12px;
  border: 1px solid rgba(154, 164, 176, 0.24);
  background: rgba(10, 12, 16, 0.72);
}

.market-drill-row__img {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
}

.market-drill-row__img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.market-drill-row__name {
  min-width: 0;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.25;
  color: rgba(236, 232, 224, 0.96);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.market-drill-row__qty {
  text-align: center;
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(200, 206, 216, 0.92);
  white-space: nowrap;
}

.market-drill-row__unit,
.market-drill-row__total {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.market-drill-row__buy {
  display: flex;
  align-items: center;
  justify-content: center;
}

.market-drill-row__own {
  font-size: 0.78rem;
  white-space: nowrap;
}

.market-buy-icon-img {
  display: block;
  width: 1.35rem;
  height: 1.35rem;
  object-fit: contain;
}

.market-browse-drill__list-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.market-drill-head {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr) minmax(4.5rem, auto) 5.75rem 5.75rem 2.75rem;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(154, 164, 176, 0.22);
  background: rgba(8, 10, 14, 0.55);
}

.market-drill-head-spacer {
  display: block;
  width: 2.75rem;
  min-width: 2.75rem;
}

.market-drill-head-spacer--buy {
  justify-self: center;
}

.market-drill-head-col {
  font-size: 0.78rem;
  color: rgba(170, 178, 192, 0.88);
}

.market-drill-head-col--item {
  justify-self: start;
  text-align: left;
}

.market-drill-sort-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  margin: 0;
  padding: 2px 4px;
  border: none;
  background: transparent;
  color: rgba(170, 178, 192, 0.88);
  font: inherit;
  font-size: 0.78rem;
  line-height: 1.25;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  justify-self: center;
  width: auto;
  max-width: 100%;
  border-radius: 6px;
  -webkit-tap-highlight-color: transparent;
}

.market-drill-sort-btn.market-drill-head-col--item {
  text-align: left;
  justify-content: flex-start;
  justify-self: stretch;
}

.market-drill-sort-btn:hover {
  color: rgba(211, 176, 111, 0.85);
}

.market-drill-sort-btn:focus-visible {
  outline: 2px solid var(--ui-focus-ring, rgba(211, 176, 111, 0.55));
  outline-offset: 1px;
}

.market-drill-sort-btn--active {
  color: rgba(232, 200, 120, 0.95);
  font-weight: 600;
}

.market-drill-sort-btn__label {
  display: inline;
}

.market-drill-sort-btn__dir {
  display: inline;
  flex-shrink: 0;
  opacity: 0.9;
}

.market-buy--icon {
  min-width: 2.4rem !important;
  width: 2.4rem !important;
  height: 2.1rem;
  padding: 0 !important;
  font-size: 1rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.market-flash-toast {
  position: fixed;
  left: 50%;
  top: var(--ui-toast-top, calc(72px + env(safe-area-inset-top, 0px)));
  bottom: auto;
  transform: translateX(-50%) translateY(-8px);
  z-index: 12050;
  max-width: min(92vw, 360px);
  padding: 12px 16px;
  border-radius: var(--ui-panel-radius, 12px);
  border: 1px solid var(--ui-panel-border, rgba(255, 255, 255, 0.14));
  background: var(--ui-elevated-bg, rgba(22, 18, 14, 0.94));
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.35;
  color: var(--text, #f2e8d8);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.market-flash-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Одна карточка позиции: избранное слева, основная кнопка справа */
.market-category-card-row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--ui-pill-border, rgba(154, 164, 176, 0.28));
  background: var(--ui-stub-bg, rgba(10, 12, 16, 0.72));
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.market-category-card-row:has(.market-category-card:hover) {
  border-color: rgba(211, 176, 111, 0.35);
}

.market-category-card-row:has(.market-category-card[aria-expanded='true']) {
  border-color: rgba(211, 176, 111, 0.45);
  box-shadow: 0 0 0 1px rgba(211, 176, 111, 0.12);
}

.market-fav-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.65rem;
  min-width: 2.65rem;
  margin: 0;
  padding: 0;
  align-self: stretch;
  border-radius: 14px;
  border: 1px solid var(--ui-pill-border, rgba(154, 164, 176, 0.32));
  background: var(--ui-stub-bg, rgba(10, 12, 16, 0.72));
  color: rgba(154, 164, 176, 0.75);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.market-fav-btn--in-card {
  width: 2.5rem;
  min-width: 2.5rem;
  border: none;
  border-radius: 0;
  border-right: 1px solid rgba(154, 164, 176, 0.22);
  background: rgba(6, 8, 12, 0.35);
  align-self: stretch;
}

.market-fav-btn--in-card:hover {
  background: rgba(12, 14, 18, 0.55);
}

.market-fav-btn:hover {
  border-color: rgba(211, 176, 111, 0.35);
  color: rgba(211, 176, 111, 0.65);
}

.market-fav-btn:focus-visible {
  outline: 2px solid var(--ui-focus-ring, rgba(211, 176, 111, 0.55));
  outline-offset: 2px;
}

.market-fav-btn--on {
  color: var(--gold, #d3b06f);
  border-color: rgba(211, 176, 111, 0.45);
  box-shadow: 0 0 0 1px rgba(138, 110, 54, 0.15);
}

.market-fav-icon {
  display: block;
  transform: translateY(-1px);
}

.market-category-card-row .market-category-card {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.market-category-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex: 1 1 auto;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 12px 14px;
  text-align: left;
  border-radius: 16px;
  border: 1px solid var(--ui-pill-border, rgba(154, 164, 176, 0.28));
  background: var(--ui-stub-bg, rgba(10, 12, 16, 0.72));
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.market-category-card-top {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.market-category-card:hover {
  border-color: rgba(211, 176, 111, 0.35);
}

.market-category-card-row .market-category-card:hover {
  border-color: transparent;
}

.market-category-card:focus-visible {
  outline: 2px solid var(--ui-focus-ring, rgba(211, 176, 111, 0.55));
  outline-offset: 2px;
}

.market-category-card[aria-expanded='true'] {
  border-color: rgba(211, 176, 111, 0.45);
  box-shadow: 0 0 0 1px rgba(211, 176, 111, 0.12);
}

.market-category-card-row .market-category-card[aria-expanded='true'] {
  border-color: transparent;
  box-shadow: none;
}

.market-category-card-visual {
  position: relative;
  flex: 0 0 auto;
  align-self: flex-start;
  width: 4.5rem;
  height: 4.5rem;
}

.market-category-card-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid rgba(154, 164, 176, 0.2);
  background: rgba(0, 0, 0, 0.25);
}

.market-category-card-badge {
  position: absolute;
  right: -6px;
  bottom: -4px;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  color: #f3f6ff;
  background: rgba(12, 14, 18, 0.92);
  border: 2px solid rgba(211, 176, 111, 0.65);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.market-category-card-info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
}

.market-category-card-name {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 700;
  font-size: 0.95rem;
  color: #eef3fb;
  line-height: 1.25;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.market-category-card-prices {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  margin-top: 0;
}

.market-cat-price-chip {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(238, 243, 251, 0.95);
}

.market-cat-price-from {
  font-weight: 600;
  color: rgba(200, 206, 218, 0.88);
  font-size: 0.82rem;
  margin-right: 2px;
}

.market-unit-price {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.market-unit-price-amt {
  font-weight: 700;
  color: var(--gold, #d3b06f);
}

.market-per-unit {
  font-weight: 500;
  color: rgba(200, 206, 218, 0.88);
  font-size: 0.8rem;
  white-space: nowrap;
}

.market-lot-total-price {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  color: var(--gold, #d3b06f);
}

.market-group-listings {
  margin-top: 10px;
  padding: 10px 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(154, 164, 176, 0.18);
  background: rgba(6, 8, 11, 0.45);
}

.market-offer-list-head {
  margin: 0 0 8px;
  font-size: 0.82rem;
}

.market-offer-grid {
  margin: 0;
}

.market-offer-row .market-offer-total {
  font-size: 0.88rem;
}

.market-listings-grid.shop-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.market-listings-grid .quest-row.market-row-quest {
  margin: 0;
  min-height: 0;
}

#market-search-wrap[hidden] {
  display: none !important;
}

.quest-row.market-row-quest {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.market-row-quest-main {
  flex: 1 1 12rem;
  min-width: 0;
}

.market-row-quest-side {
  flex: 0 0 auto;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.market-row-stone-ico {
  vertical-align: middle;
  margin-right: 2px;
}

.market-row-title {
  font-weight: 700;
  color: #eef3fb;
  font-size: 0.9rem;
}

.market-drill-info-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.market-drill-info-i {
  margin-left: 4px;
  width: 22px;
  height: 22px;
  font-size: 0.74rem;
}

.market-row-meta {
  font-size: 0.8rem;
  color: rgba(180, 186, 198, 0.95);
}

.market-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 10px;
}

.market-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.82rem;
  color: #d4d8e0;
}

.market-form-grid input,
.market-form-grid select {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(120, 124, 132, 0.55);
  background: rgba(36, 38, 44, 0.92);
  color: #ece5d5;
  font-size: 0.88rem;
}

.codex-tab {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  padding: 6px 14px;
  border-radius: var(--ui-panel-radius);
  border: 1px solid var(--ui-pill-line);
  background: var(--ui-pill-bg);
  color: var(--ui-pill-text);
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1.2;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}

.codex-tab--active {
  border-color: #d3b06f;
  color: #f3e1b4;
  box-shadow: 0 0 0 1px rgba(138, 110, 54, 0.35);
}

.codex-pane[hidden] {
  display: none !important;
}

.codex-pane--world {
  max-height: min(72vh, 640px);
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 6px;
  margin-top: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--ui-scrollbar-thumb) var(--ui-scrollbar-track);
}

.codex-world {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-bottom: 8px;
}

.codex-world-title {
  margin-top: 0;
  margin-bottom: 10px;
}

.codex-world-hero {
  margin: 0 0 12px;
  border-radius: 14px;
  overflow: hidden;
  border: none;
  background: transparent;
}

.codex-world-hero-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(28vh, 200px);
  object-fit: cover;
  object-position: center 20%;
}

.codex-world-lead {
  margin: 0 0 16px;
  line-height: 1.55;
  color: #dcd4c4;
  font-size: 0.94rem;
}

.codex-world-section {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: var(--ui-panel-radius);
  border: 1px solid var(--ui-panel-border);
  /* Нейтральный серый (было 22,20,28 — уход в сирень) */
  background: rgba(20, 22, 28, 0.55);
}

.codex-world-section p {
  margin: 0 0 10px;
  line-height: 1.52;
  color: #d8d0c4;
  font-size: 0.9rem;
}

.codex-world-section p:last-child {
  margin-bottom: 0;
}

.codex-world-h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 700;
  color: #f0e6d2;
  display: flex;
  align-items: center;
  gap: 8px;
}

.codex-world-section--split {
  display: grid;
  grid-template-columns: 1fr minmax(100px, 34%);
  gap: 14px;
  align-items: center;
}

.codex-world-section--reverse .codex-world-section-text {
  order: 1;
}

.codex-world-section--reverse .codex-world-aside {
  order: 0;
}

.codex-world-aside {
  display: flex;
  justify-content: center;
  align-items: center;
}

.codex-world-aside--duo {
  flex-direction: column;
  gap: 8px;
}

.codex-world-aside--icons {
  flex-wrap: wrap;
  gap: 10px;
}

.codex-world-aside-img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  border: none;
}

.codex-world-aside-img--wide {
  width: 100%;
  max-width: 220px;
}

.codex-world-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 4px 0 6px;
  padding: 12px;
  border-radius: var(--ui-panel-radius);
  background: rgba(32, 34, 40, 0.5);
  border: 1px dashed var(--ui-panel-border);
}

.codex-world-strip img {
  border-radius: 10px;
  border: none;
  background: transparent;
}

.codex-world-strip-caption {
  margin: 0 0 16px;
  text-align: center;
}

.codex-world-loot-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.codex-world-loot-row img {
  flex-shrink: 0;
  border-radius: 10px;
  padding: 0;
  background: transparent;
  border: none;
}

.codex-world-loot-text {
  flex: 1 1 12rem;
  min-width: 0;
}

.codex-world-loot-text p {
  margin: 0;
}

.codex-world-races-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(154, 164, 176, 0.15);
}

.codex-world-races-strip img {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  border: none;
}

.codex-world-mini-fig {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 10px 0 12px;
}

.codex-world-mini-fig img {
  border-radius: 10px;
  border: none;
}

.codex-world-footer {
  margin: 4px 0 0;
}

.codex-world-center-fig {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 12px 0 0;
}

.codex-world-center-img {
  display: block;
  max-width: min(100%, 280px);
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: none;
}

.codex-world-section--hero {
  padding: 0;
  border: none;
  background: transparent;
}

.codex-world-section--hero .codex-world-center-fig {
  margin: 0;
}

.codex-world-section--hero .codex-world-hero-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(28vh, 200px);
  object-fit: cover;
  object-position: center 20%;
  border-radius: var(--ui-panel-radius);
}

.codex-world-section--empty {
  opacity: 0.7;
}

@media (max-width: 520px) {
  .codex-world-section--split {
    grid-template-columns: 1fr;
  }

  .codex-world-section--reverse .codex-world-section-text,
  .codex-world-section--reverse .codex-world-aside {
    order: unset;
  }

  .codex-world-aside {
    justify-content: flex-start;
  }
}

.stub.codex-root {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.codex-pane--races {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
  max-height: min(78vh, 720px);
  overflow: hidden;
}

.codex-pane--races .section-title,
.codex-world-title,
.codex-pane--world .section-title {
  margin-top: 0;
  margin-bottom: 10px;
}

.codex-pane--races .section-title {
  flex-shrink: 0;
}

.codex-pane--races > .hint {
  flex-shrink: 0;
}

.race-codex-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 4px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--ui-scrollbar-thumb) var(--ui-scrollbar-track);
}

.race-codex-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  flex-shrink: 0;
  padding: 0;
  border-radius: 14px;
  border: 1px solid rgba(191, 160, 96, 0.32);
  background: var(--ui-stub-bg);
  overflow: visible;
}

.race-codex-top {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  padding: 14px 16px 12px;
  box-sizing: border-box;
}

.race-codex-main {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.race-codex-lore-wrap {
  min-width: 0;
}

.race-codex-perks-toggle {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 12px 16px;
  border: none;
  border-top: 1px solid rgba(191, 160, 96, 0.28);
  border-radius: 0;
  box-sizing: border-box;
  background: rgba(20, 22, 28, 0.58);
  color: #e4dfd4;
  font: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

.race-codex-perks-toggle:hover {
  background: rgba(255, 255, 255, 0.05);
}

.race-codex-perks-toggle:focus-visible {
  outline: 2px solid rgba(211, 176, 111, 0.85);
  outline-offset: -2px;
  z-index: 1;
}

.race-codex-perks-toggle-label {
  flex: 1;
  min-width: 0;
  color: var(--gold);
}

.race-codex-chevron {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(211, 176, 111, 0.95);
  transition: transform 0.2s ease;
}

.race-codex-chevron::before {
  content: '▶';
  font-size: 0.62rem;
  line-height: 1;
  display: block;
}

.race-codex-perks-toggle[aria-expanded='true'] .race-codex-chevron {
  transform: rotate(90deg);
}

.race-codex-details {
  padding: 0 16px 16px;
  border-top: 1px solid rgba(191, 160, 96, 0.15);
}

.race-codex-details[hidden] {
  display: none !important;
}

.race-codex-top .race-codex-icon {
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-deep);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
}

.race-codex-thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.race-codex-emoji {
  font-size: 2.6rem;
  line-height: 1;
}

.race-codex-name {
  margin: 0;
  padding-top: 0;
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--accent);
}

.race-codex-top .race-codex-name {
  margin: 0;
  padding: 2px 0 0;
  font-size: 1.2rem;
  line-height: 1.25;
  text-align: left;
}

.race-codex-lore {
  margin: 0 0 8px;
  line-height: 1.5;
  color: #d4ccbb;
}

.race-codex-lore:last-child {
  margin-bottom: 0;
}

.race-codex-perks-title {
  margin: 10px 0 6px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--gold);
}

.race-codex-perks {
  margin: 0;
  padding-left: 1.15rem;
  color: #c8bfac;
  font-size: 0.92rem;
  line-height: 1.5;
}

.race-codex-main .race-codex-lore {
  font-size: 0.92rem;
}

.race-codex-details .race-codex-perks {
  padding-top: 4px;
}

.explore-loc-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 12px 0;
  max-height: min(70vh, 560px);
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--ui-scrollbar-thumb) var(--ui-scrollbar-track);
}

.explore-loc-banner {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(120, 40, 60, 0.25);
  border: 1px solid rgba(240, 120, 140, 0.35);
  font-size: 0.9rem;
}

.explore-loc-btn.explore-loc-card {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  text-align: left;
  gap: 12px;
  padding: 10px 12px;
  margin: 0;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
}

.explore-loc-card--locked {
  opacity: 0.72;
  cursor: not-allowed;
}

.explore-loc-card--locked::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(130, 138, 148, 0.28);
  pointer-events: none;
}

.explore-loc-thumb-wrap {
  flex: 0 0 38%;
  max-width: 140px;
  min-width: 96px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(191, 160, 96, 0.42);
  background: #120e18;
  align-self: center;
}

.explore-loc-thumb {
  display: block;
  width: 100%;
  height: 88px;
  object-fit: cover;
  object-position: center;
}

.explore-loc-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
  font-weight: 400;
}

.explore-loc-title {
  font-weight: 700;
  color: var(--gold);
  font-size: 1rem;
}

.explore-loc-title--shared,
.section-title.explore-map-title--shared {
  color: var(--shared-loc-title);
}

.explore-loc-desc {
  display: block;
  line-height: 1.35;
  font-size: 0.88rem;
  font-weight: 400;
  color: #f3f6fb;
  white-space: pre-line;
}

.explore-loc-req {
  font-size: 0.8rem;
  font-weight: 400;
}

/* Перебиваем color у .btn-secondary (#e7e9ed) — подпись условия входа светло-серая */
.explore-loc-btn.explore-loc-card .explore-loc-req,
.explore-loc-btn.explore-loc-card .explore-loc-req--locked {
  color: var(--ui-explore-loc-req);
}

.explore-loc-intro {
  margin: 0 0 12px;
  color: #f3f6fb;
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.45;
}

/* Обёртка: золотые полоски по краю видимого куска мира (см. worldEdge* в ответе API). */
.explore-grid-wrap {
  position: relative;
  max-width: min(96vw, 340px);
  width: 100%;
  margin: 12px auto 16px;
  box-sizing: border-box;
}

.explore-grid-wrap .explore-grid {
  margin: 0;
  width: 100%;
}

.explore-map-edge {
  position: absolute;
  pointer-events: none;
  z-index: 6;
  box-sizing: border-box;
}

.explore-map-edge--top {
  left: 3px;
  right: 3px;
  top: 0;
  height: 4px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(
    90deg,
    rgba(236, 205, 140, 0),
    rgba(236, 205, 140, 0.92) 18%,
    rgba(255, 228, 170, 0.98) 50%,
    rgba(236, 205, 140, 0.92) 82%,
    rgba(236, 205, 140, 0)
  );
  box-shadow: 0 0 14px rgba(210, 165, 75, 0.55), 0 1px 0 rgba(20, 16, 10, 0.35);
}

.explore-map-edge--bottom {
  left: 3px;
  right: 3px;
  bottom: 0;
  height: 4px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(
    90deg,
    rgba(236, 205, 140, 0),
    rgba(236, 205, 140, 0.92) 18%,
    rgba(255, 228, 170, 0.98) 50%,
    rgba(236, 205, 140, 0.92) 82%,
    rgba(236, 205, 140, 0)
  );
  box-shadow: 0 0 14px rgba(210, 165, 75, 0.55), 0 -1px 0 rgba(20, 16, 10, 0.35);
}

.explore-map-edge--left {
  top: 3px;
  bottom: 3px;
  left: 0;
  width: 4px;
  border-radius: 3px 0 0 3px;
  background: linear-gradient(
    180deg,
    rgba(236, 205, 140, 0),
    rgba(236, 205, 140, 0.92) 22%,
    rgba(255, 228, 170, 0.98) 50%,
    rgba(236, 205, 140, 0.92) 78%,
    rgba(236, 205, 140, 0)
  );
  box-shadow: 0 0 14px rgba(210, 165, 75, 0.55), 1px 0 0 rgba(20, 16, 10, 0.3);
}

.explore-map-edge--right {
  top: 3px;
  bottom: 3px;
  right: 0;
  width: 4px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(
    180deg,
    rgba(236, 205, 140, 0),
    rgba(236, 205, 140, 0.92) 22%,
    rgba(255, 228, 170, 0.98) 50%,
    rgba(236, 205, 140, 0.92) 78%,
    rgba(236, 205, 140, 0)
  );
  box-shadow: 0 0 14px rgba(210, 165, 75, 0.55), -1px 0 0 rgba(20, 16, 10, 0.3);
}

.explore-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  max-width: min(96vw, 340px);
  margin: 12px auto 16px;
  user-select: none;
}

.explore-cell {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  border: 1px solid rgba(191, 160, 96, 0.34);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  line-height: 1;
  background: rgba(23, 26, 31, 0.68);
  min-width: 0;
}

/* Обычная проходимая трава — без отдельного арта на всю клетку. */
.explore-cell--grass {
  background: rgba(26, 30, 36, 0.66);
}

/* Непроходимая вода — воронка/водоворот. */
.explore-cell--water {
  background-color: rgba(12, 28, 48, 0.75);
  background-image: url('/images/explore/tile-water.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-color: rgba(101, 180, 220, 0.55);
  box-shadow: inset 0 0 10px rgba(56, 120, 180, 0.25);
}

.explore-cell--rock {
  background: rgba(36, 33, 45, 0.7);
  border-color: rgba(161, 161, 178, 0.45);
}

.explore-cell--bush {
  background: rgba(21, 34, 26, 0.68);
  border-color: rgba(91, 135, 104, 0.45);
}

/* Золотое кольцо у цветков только на этапах гайда «подойди / собери» — класс вешает `exploreGridHtml` в app.js. */
.explore-grid--flower-guide-ring .explore-cell[data-explore-entity='flower'] {
  position: relative;
  z-index: 2;
  box-sizing: border-box;
  border-radius: 10px;
  border: 2px solid rgba(236, 205, 140, 0.95);
  box-shadow: 0 0 0 1px rgba(20, 16, 10, 0.5), 0 4px 28px rgba(200, 155, 70, 0.35);
}

.explore-grid--flower-guide-ring .explore-cell[data-explore-entity='flower'] .explore-icon--entity {
  filter: drop-shadow(0 0 5px rgba(232, 190, 110, 0.5)) drop-shadow(0 1px 4px rgba(10, 5, 24, 0.45));
}

.explore-terrain {
  opacity: 0.85;
  font-size: 1rem;
}

.explore-entity {
  font-size: 1.25rem;
}

.explore-icon {
  display: block;
  width: 86%;
  height: 86%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.explore-icon--entity {
  filter: drop-shadow(0 1px 4px rgba(10, 5, 24, 0.45));
}

/* Чёрный колокольчик тёмный — фиолетовое свечение, чтобы не сливался с фоном карты. */
.explore-cell[data-explore-entity='black_bellflower'] .explore-icon--entity {
  filter:
    drop-shadow(0 0 2px rgba(190, 130, 255, 0.75))
    drop-shadow(0 0 6px rgba(150, 80, 230, 0.55))
    drop-shadow(0 0 10px rgba(110, 50, 200, 0.35))
    drop-shadow(0 1px 4px rgba(10, 5, 24, 0.45));
}

/* Вход в данж — мягкое золотое свечение. */
.explore-cell[data-explore-entity='dungeon'] .explore-icon--entity {
  filter:
    drop-shadow(0 0 2px rgba(232, 200, 120, 0.7))
    drop-shadow(0 0 6px rgba(211, 176, 111, 0.45))
    drop-shadow(0 0 10px rgba(180, 140, 70, 0.28))
    drop-shadow(0 1px 4px rgba(10, 5, 24, 0.45));
}

.explore-cell[data-explore-entity='dungeon'][data-explore-empowered='1'] .explore-icon--entity {
  filter:
    drop-shadow(0 0 2px rgba(190, 130, 255, 0.85))
    drop-shadow(0 0 6px rgba(150, 80, 230, 0.6))
    drop-shadow(0 0 12px rgba(110, 50, 200, 0.4))
    drop-shadow(0 1px 4px rgba(10, 5, 24, 0.45));
}

.explore-dungeon-ttl {
  position: absolute;
  top: 1px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  padding: 0 3px;
  border-radius: 4px;
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: rgba(246, 236, 214, 0.96);
  background: rgba(12, 10, 16, 0.72);
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

.explore-cell[data-explore-empowered='1'] .explore-dungeon-ttl {
  color: rgba(230, 210, 255, 0.96);
  background: rgba(28, 12, 40, 0.75);
}

.explore-log-reward-icon--black-bellflower,
.inv-cell-tile__img--black-bellflower,
.loot-icon--black-bellflower {
  filter:
    drop-shadow(0 0 2px rgba(190, 130, 255, 0.7))
    drop-shadow(0 0 6px rgba(150, 80, 230, 0.5))
    drop-shadow(0 0 10px rgba(110, 50, 200, 0.3));
}

/* Ожерелье Затмения — золотое свечение (коллекции не трогаем: там свой .collection-row-icon--glow-gold). */
.loot-icon--eclipse-necklace,
.inv-cell-tile__img--eclipse-necklace,
.explore-log-reward-icon--eclipse-necklace,
.quest-daily-reward-icon.loot-icon--eclipse-necklace,
.quest-claim-modal-reward-icon.loot-icon--eclipse-necklace {
  filter:
    drop-shadow(0 0 3px rgba(255, 205, 110, 0.55))
    drop-shadow(0 0 8px rgba(255, 180, 60, 0.35))
    drop-shadow(0 0 14px rgba(211, 160, 60, 0.22));
}

.market-drill-row__img--eclipse-necklace::before,
.market-sell-inv-visual:has(.loot-icon--eclipse-necklace)::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 210, 120, 0.32) 0%, rgba(255, 186, 80, 0.12) 42%, rgba(211, 160, 60, 0) 70%);
  filter: blur(1px);
  pointer-events: none;
  animation: collection-gold-pulse 2.8s ease-in-out infinite;
  z-index: 0;
}

.market-drill-row__img--eclipse-necklace,
.market-sell-inv-visual:has(.loot-icon--eclipse-necklace) {
  position: relative;
}

.market-drill-row__img--eclipse-necklace > *,
.market-sell-inv-visual:has(.loot-icon--eclipse-necklace) > * {
  position: relative;
  z-index: 1;
}

.quest-daily-reward-chip--glow-gold,
.quest-claim-modal-reward-icon-wrap--glow-gold {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.quest-daily-reward-chip--glow-gold::before,
.quest-claim-modal-reward-icon-wrap--glow-gold::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 210, 120, 0.38) 0%, rgba(255, 186, 80, 0.16) 42%, rgba(211, 160, 60, 0) 70%);
  filter: blur(1px);
  pointer-events: none;
  animation: collection-gold-pulse 2.8s ease-in-out infinite;
  z-index: 0;
}

.quest-daily-reward-chip--glow-gold > *,
.quest-claim-modal-reward-icon-wrap--glow-gold > * {
  position: relative;
  z-index: 1;
}

.explore-dungeon-modal {
  z-index: 120;
}

.explore-dungeon-modal__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(8, 6, 14, 0.62);
  cursor: pointer;
}

.explore-dungeon-modal__panel {
  position: relative;
  z-index: 1;
  width: min(360px, calc(100vw - 28px));
  max-height: min(92vh, 780px);
  overflow: auto;
  margin: auto;
  padding: 14px 14px 16px;
  border-radius: var(--ui-panel-radius, 12px);
  border: 1px solid var(--ui-elevated-line, rgba(140, 145, 155, 0.45));
  background: var(--ui-elevated-surface, linear-gradient(165deg, rgba(32, 32, 38, 0.98) 0%, rgba(16, 18, 24, 0.99) 100%));
  box-shadow:
    var(--ui-elevated-inset, 0 0 0 1px rgba(220, 220, 230, 0.06) inset),
    0 16px 40px rgba(0, 0, 0, 0.45);
}

.explore-dungeon-modal__close {
  position: absolute;
  top: 6px;
  right: 8px;
  z-index: 2;
}

.explore-dungeon-modal__layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
}

.explore-dungeon-modal__art-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  border-radius: 12px;
  background: rgba(18, 20, 26, 0.72);
  border: 1px solid var(--ui-panel-border, rgba(154, 164, 176, 0.3));
  overflow: hidden;
}

.explore-dungeon-modal__art-wrap--empowered {
  border-color: rgba(170, 120, 230, 0.45);
  box-shadow:
    0 0 0 1px rgba(150, 90, 220, 0.2) inset,
    0 0 18px rgba(120, 60, 200, 0.22);
}

.explore-dungeon-modal__art {
  display: block;
  width: 100%;
  height: auto;
  max-height: 280px;
  object-fit: contain;
  filter:
    drop-shadow(0 0 4px rgba(180, 190, 205, 0.28))
    drop-shadow(0 0 12px rgba(120, 130, 145, 0.18));
}

.explore-dungeon-modal--empowered .explore-dungeon-modal__art {
  filter:
    drop-shadow(0 0 4px rgba(190, 140, 255, 0.45))
    drop-shadow(0 0 14px rgba(130, 70, 220, 0.35));
}

.explore-dungeon-modal__rune {
  position: absolute;
  z-index: 2;
  width: 36px;
  height: 36px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
}

.explore-dungeon-modal__rune::after {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  line-height: 1;
  color: rgba(160, 166, 176, 0.92);
  text-shadow:
    0 0 1px rgba(20, 22, 28, 0.9),
    0 1px 2px rgba(0, 0, 0, 0.55);
  -webkit-text-stroke: 0.5px rgba(90, 96, 108, 0.55);
}

.explore-dungeon-modal__rune--top::after {
  content: 'ᛟ';
  font-size: 1.4rem;
}

.explore-dungeon-modal__rune--right::after {
  content: 'ᚠ';
  font-size: 1.45rem;
  transform: scaleX(1.08);
}

.explore-dungeon-modal__rune--left::after {
  content: 'ᛉ';
  font-size: 1.38rem;
  transform: rotate(-8deg) scaleY(1.05);
}

.explore-dungeon-modal__rune--top {
  top: 2%;
  left: 50%;
  transform: translateX(-50%);
}

.explore-dungeon-modal__rune--right {
  top: 46%;
  right: 14%;
  transform: translateY(-50%);
}

.explore-dungeon-modal__rune--left {
  top: 46%;
  left: 14%;
  transform: translateY(-50%);
}

.explore-dungeon-modal__rune--lit {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.explore-dungeon-modal__rune--lit::after {
  color: rgba(255, 220, 140, 0.98);
  text-shadow:
    0 0 4px rgba(232, 190, 100, 0.75),
    0 0 10px rgba(211, 176, 111, 0.45),
    0 1px 2px rgba(0, 0, 0, 0.45);
  -webkit-text-stroke: 0.5px rgba(200, 150, 60, 0.55);
}

.explore-dungeon-modal__rune--locked::after {
  color: rgba(255, 110, 110, 0.96);
  text-shadow:
    0 0 5px rgba(220, 50, 50, 0.85),
    0 0 12px rgba(180, 20, 30, 0.55),
    0 1px 2px rgba(0, 0, 0, 0.5);
  -webkit-text-stroke: 0.5px rgba(160, 30, 40, 0.65);
  animation: explore-dungeon-rune-locked-pulse 2.4s ease-in-out infinite;
}

.explore-dungeon-modal__art-wrap--runes-locked {
  border-color: rgba(180, 60, 70, 0.4);
  box-shadow:
    0 0 0 1px rgba(160, 40, 50, 0.18) inset,
    0 0 14px rgba(140, 30, 40, 0.16);
}

@keyframes explore-dungeon-rune-locked-pulse {
  0%,
  100% {
    filter: brightness(0.95);
  }
  50% {
    filter: brightness(1.15);
  }
}

.explore-dungeon-modal__rune:disabled {
  cursor: default;
}

.explore-dungeon-modal__enter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 12px;
}

.explore-dungeon-modal__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-start;
  gap: 8px 12px;
  margin: 0 0 10px;
}

.explore-dungeon-modal__title {
  margin: 0;
  font-size: 1.15rem;
  color: rgba(236, 238, 242, 0.96);
}

.explore-dungeon-modal__timer {
  margin: 0;
  font-weight: 300;
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  color: var(--gold, #d3b06f);
  opacity: 0.92;
  white-space: nowrap;
}

.explore-dungeon-modal__lock-hint {
  margin: 0 0 10px;
  text-align: center;
}

.explore-dungeon-modal__enter:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.35);
}

.explore-dungeon-modal__desc {
  margin: 0 0 12px;
  font-size: 0.9rem;
  line-height: 1.4;
  color: rgba(210, 214, 222, 0.88);
}

.explore-dungeon-modal__rewards {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 14px;
}

.explore-dungeon-modal__reward {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
}

.explore-dungeon-modal__reward img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  position: relative;
  z-index: 1;
}

.explore-dungeon-modal__enter {
  width: auto;
  min-width: 7.5rem;
  max-width: 10rem;
  flex: 0 0 auto;
}

.explore-dungeon-modal__stone-cost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: rgba(220, 224, 232, 0.92);
}

.explore-dungeon-modal__stone-cost img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

@media (max-width: 420px) {
  .explore-dungeon-modal__panel {
    width: min(340px, calc(100vw - 20px));
  }

  .explore-dungeon-modal__art {
    max-height: 220px;
  }
}

.explore-icon--terrain {
  opacity: 0.95;
}

.explore-player {
  font-size: 1.35rem;
  filter: drop-shadow(0 0 5px rgba(201, 156, 76, 0.75));
}

.explore-player-icon {
  display: block;
  width: 88%;
  height: 88%;
  object-fit: contain;
  filter: drop-shadow(0 0 5px rgba(201, 156, 76, 0.75));
}

.explore-legend-hero-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  vertical-align: -3px;
  margin-right: 4px;
}

.explore-dpad {
  display: grid;
  grid-template-columns: auto auto auto;
  grid-template-rows: auto auto;
  gap: 2px;
  max-width: 190px;
  margin: 0 auto 14px;
  justify-content: center;
  justify-items: center;
  align-items: stretch;
}

.explore-controls {
  position: relative;
  width: 100%;
  max-width: min(100%, 300px);
  margin: 0 auto 14px;
  padding: 0 10px 0 10px;
  box-sizing: border-box;
}

/* Полоса управления на всю ширину карточки: зелья слева у края, ускорение справа у края */
.farm-stub--explore-map .explore-controls {
  max-width: calc(100% + 32px);
  width: calc(100% + 32px);
  margin-left: -16px;
  margin-right: -16px;
  padding-left: 0;
  padding-right: 0;
}

.explore-side-stats {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 76px;
  z-index: 2;
}

.farm-stub--explore-map .explore-side-stats {
  left: max(2px, env(safe-area-inset-left, 0px));
  align-items: flex-start;
}

/* Текст ХП на карте заменён компактными полосками (.explore-side-bars). */

.explore-side-potion-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 54px;
  height: 54px;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
}

.explore-side-potion-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.explore-side-potion-btn:active {
  transform: scale(0.98);
}

.explore-side-potion-icon {
  width: 50px;
  height: 50px;
  object-fit: contain;
  display: block;
}

.explore-side-potion-count {
  color: #f3f6fb;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 1px 6px rgba(10, 5, 24, 0.35);
  position: absolute;
  right: -2px;
  top: -2px;
  background: rgba(10, 10, 14, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  padding: 2px 4px;
}

.explore-dpad-spacer {
  min-height: 0;
}

.explore-dpad-mid {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6a5a8044;
  font-size: 1.2rem;
}

.explore-back-square {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 48px;
  height: 48px;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  line-height: 1;
  font-size: 1.15rem;
  z-index: 2;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}

.explore-ambient-burst-wrap {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 48px;
  min-width: 48px;
  z-index: 2;
}

/* Правая колонка: ускорение + инвентарь у правого края карточки; внутри колонки — по центру относительно подписей */
.farm-stub--explore-map .explore-right-stack {
  position: absolute;
  right: max(2px, env(safe-area-inset-right, 0px));
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  z-index: 2;
}

.farm-stub--explore-map .explore-right-stack .explore-ambient-burst-wrap {
  position: static;
  top: auto;
  right: auto;
  transform: none;
  width: auto;
  min-width: min-content;
  align-items: center;
}

.explore-ambient-burst {
  width: 48px;
  height: 48px;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  line-height: 1;
  font-size: 1.15rem;
  box-sizing: border-box;
  background: transparent !important;
  border: none !important;
  border-color: transparent !important;
  box-shadow: none !important;
  outline: none !important;
}

.explore-ambient-burst-label {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 0.62rem;
  line-height: 1.05;
  margin-top: 0;
  color: var(--muted, #c9d0da);
}

.explore-ambient-burst-energy-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 100%;
  min-width: 52px;
}

.explore-ambient-burst-energy-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
}

.explore-ambient-burst-energy-numbers {
  display: inline;
  font-size: 0.68rem;
  line-height: 1.15;
  font-weight: 600;
  color: #f3f6fb;
  white-space: nowrap;
}

.explore-ambient-burst-energy-bolt {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 0;
}

.explore-ambient-burst-energy-bolt .ui-energy-icon,
.explore-ambient-burst-energy-bolt img {
  display: block;
  width: 14px;
  height: 14px;
}

.farm-stub--explore-map .explore-dir {
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.farm-stub--explore-map .explore-dir:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.farm-stub--explore-map .explore-dir:active:not(:disabled) {
  transform: scale(0.94);
}

.farm-stub--explore-map .explore-move-icon {
  width: 52px;
  height: 52px;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.farm-stub--explore-map .explore-dpad {
  gap: 4px;
  max-width: 220px;
}

.explore-trade-result-modal .explore-trade-result-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 10px 0 14px;
}

.explore-trade-result-modal .explore-trade-result-icon {
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex-shrink: 0;
}

.explore-trade-result-modal .explore-trade-result-text {
  font-size: 0.95rem;
  color: #f3f6fb;
}

/* --- Диалог NPC на карте окрестностей --- */
.explore-npc-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 12400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 10px max(10px, env(safe-area-inset-bottom));
}

.explore-npc-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 14, 0.82);
}

.explore-npc-dialog-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(420px, 100%);
  height: min(700px, 92vh);
  max-height: 92vh;
  background: rgba(12, 14, 18, 0.98);
  border: 1px solid var(--ui-panel-border);
  border-radius: 14px;
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.explore-npc-dialog-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.explore-npc-dialog-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding: 14px 16px 28px;
  background: linear-gradient(180deg, rgba(8, 10, 14, 0.82) 0%, rgba(8, 10, 14, 0.42) 58%, transparent 100%);
  pointer-events: none;
}

.explore-npc-dialog-hero-crop,
.explore-npc-dialog-hero-placeholder {
  position: absolute;
  inset: 0;
}

.explore-npc-dialog-hero-crop {
  overflow: hidden;
}

.explore-npc-dialog-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 21%;
  /* Умеренный зум: меньше обрезка по бокам, кадр по-прежнему с уровня головы */
  transform: scale(1.22) translateY(-3.5%);
  transform-origin: center top;
  border: none;
}

.explore-npc-dialog-hero-placeholder {
  background: var(--ui-input-bg);
  display: block;
}

.explore-npc-dialog-name {
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1.15;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.65);
}

.explore-npc-dialog-sub {
  margin: 4px 0 0;
  font-size: 0.84rem;
  color: rgba(201, 190, 168, 0.92);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.55);
}

.explore-npc-dialog-speech {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 2;
}

.explore-npc-dialog-speech--bubble {
  background: var(--explore-npc-speech-bg);
  color: var(--explore-npc-speech-fg);
  border: 1px solid var(--explore-npc-speech-line);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: var(--explore-npc-speech-shadow);
  backdrop-filter: blur(6px);
}

.explore-npc-dialog-intro {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.48;
  white-space: pre-wrap;
}

.explore-npc-dialog-intro-question {
  font-style: italic;
}

.explore-npc-dialog-foot {
  flex-shrink: 0;
  padding: 12px;
  background: rgba(10, 12, 16, 0.98);
  border-top: 1px solid var(--ui-panel-border);
}

.explore-npc-dialog-pending {
  margin: 0 0 8px;
  text-align: center;
  font-size: 0.85rem;
}

.explore-npc-dialog-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.explore-npc-dialog-actions--grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

/** Одна кнопка (напр. «Хорошо» у Мелиссы в «Тёплой воде») — по центру. */
.fishing-melissa-dialog-overlay .explore-npc-dialog-actions--single {
  grid-template-columns: minmax(0, min(100%, 240px));
  justify-content: center;
  justify-items: stretch;
}

.explore-npc-choice-btn {
  width: 100%;
  text-align: center;
  white-space: normal;
  line-height: 1.32;
  min-height: 54px;
  padding: 10px 8px;
  font-size: 0.82rem;
  border-radius: 10px;
  background: var(--ui-pill-bg);
  border: 1px solid var(--ui-pill-line);
  color: var(--ui-pill-text);
  display: flex;
  align-items: center;
  justify-content: center;
}

.explore-npc-choice-btn:hover:not(:disabled) {
  background: var(--ui-pill-bg-active);
  border-color: var(--ui-pill-line-active);
}

.explore-npc-choice-btn--gear {
  flex-direction: column;
  gap: 6px;
  padding: 8px 6px;
  min-height: 72px;
}

.explore-npc-choice-gear-thumb {
  flex-shrink: 0;
}

.explore-npc-choice-gear-img-wrap {
  position: relative;
  display: block;
  width: 44px;
  height: 44px;
}

.explore-npc-choice-gear-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--ui-input-bg);
  border: 1px solid var(--ui-panel-border);
}

.explore-npc-choice-gear-plus {
  position: absolute;
  right: -4px;
  bottom: -4px;
}

.explore-npc-choice-gear-label {
  flex: 1;
  min-width: 0;
  font-size: 0.78rem;
  line-height: 1.28;
}

.explore-npc-dialog-overlay--outcome .explore-npc-dialog-panel {
  filter: blur(3px);
}

.explore-npc-dialog-outcome-layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 14px;
  background: rgba(5, 8, 14, 0.58);
  backdrop-filter: blur(8px);
  z-index: 3;
}

.explore-npc-dialog-outcome-card {
  width: min(400px, 100%);
  background: rgba(16, 18, 24, 0.97);
  border: 1px solid var(--ui-panel-border);
  border-radius: 14px;
  padding: 18px 16px 16px;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.5);
}

.explore-npc-dialog-outcome-reply {
  margin: 0 0 14px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text);
  text-align: left;
}

.explore-npc-dialog-outcome-reward {
  margin: 0 0 14px;
  font-size: 0.88rem;
  text-align: center;
}

.explore-npc-dialog-outcome-reward--gold {
  color: var(--gold);
  font-weight: 600;
}

.explore-npc-dialog-outcome-no-reward {
  margin: 0 0 14px;
  font-size: 0.86rem;
  text-align: center;
}

.explore-npc-reward-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 2px 0 16px;
}

.explore-npc-reward-thumb-wrap {
  position: relative;
  width: 88px;
  height: 104px;
}

.explore-npc-reward-thumb-img {
  width: 88px;
  height: 104px;
  object-fit: contain;
  border-radius: 8px;
  background: transparent;
  border: none;
}

.explore-npc-reward-qty-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(12, 14, 18, 0.94);
  border: 1px solid var(--ui-panel-border);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--gold);
}

.explore-npc-dialog-outcome-claim {
  width: 100%;
  max-width: none;
  min-height: 46px;
}

.secret-quest-unlock-modal {
  z-index: 10090;
}

.secret-quest-unlock-quest-title {
  margin: 8px 0 4px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gold);
}

.secret-quest-unlock-hint {
  margin: 0 0 12px;
  font-size: 0.88rem;
}

/* --- Бой: полоски HP/маны, действия, история --- */
.battle-hp-wrap { width: 100%; margin: 0 0 8px; }
.battle-seg-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; font-size: 0.86rem; white-space: nowrap; overflow: hidden; }
.battle-seg-row { display: flex; flex-wrap: nowrap; gap: 2px; align-items: stretch; width: 100%; max-width: 100%; overflow: hidden; }
.battle-seg-row .battle-seg { flex: 1 1 0; min-width: 2px; display: block; background: rgba(255, 255, 255, 0.08); border-radius: 2px; }
.battle-seg-row--mob .battle-seg, .battle-seg-row .battle-seg--mob { height: 14px; }
.battle-seg-row--player .battle-seg, .battle-seg-row--mana .battle-seg, .battle-seg-row .battle-seg--player, .battle-seg-row .battle-seg--mana { height: 8px; }
.battle-seg--on.battle-seg--mob { background: linear-gradient(180deg, #ef6a6a 0%, #b83232 100%); }
.battle-seg--on.battle-seg--player { background: linear-gradient(180deg, #6fd39a 0%, #2f9f67 100%); }
.battle-seg--on.battle-seg--mana { background: linear-gradient(180deg, #6eb8ff 0%, #2f74c8 100%); }
.battle-pct-track { width: 100%; height: 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.battle-pct-fill--mob { background: linear-gradient(90deg, #b83232 0%, #ef6a6a 100%); height: 100%; border-radius: inherit; }
.battle-pct-fill--player { background: linear-gradient(90deg, #2f9f67 0%, #6fd39a 100%); height: 100%; border-radius: inherit; }
.battle-pct-fill--mana { background: linear-gradient(90deg, #2f74c8 0%, #6eb8ff 100%); height: 100%; border-radius: inherit; }
.battle-actions-block { margin-top: 14px; }
.battle-actions-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.battle-actions-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted, #c9d0da); }
.battle-log-history-btn { flex: 0 0 auto; width: 40px; height: 40px; padding: 2px; border: none; border-radius: 8px; background: transparent; cursor: pointer; opacity: 0.92; }
.battle-log-history-btn img { display: block; width: 100%; height: 100%; object-fit: contain; }
.battle-actions-sheet { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--ui-sheet-tab-line); border-radius: 10px; overflow: hidden; background: var(--ui-sheet-content-bg); }
.battle-actions-tabs { display: flex; align-items: stretch; gap: 0; margin: 0; padding: 0; background: var(--ui-sheet-tab-bg); border-bottom: 1px solid var(--ui-sheet-tab-line); }
.battle-actions-tab { flex: 1 1 0; min-width: 0; margin: 0; padding: 9px 6px 8px; border: none; border-right: 1px solid var(--ui-sheet-tab-line); border-radius: 0; background: transparent; color: var(--ui-sheet-tab-text); font-size: 0.76rem; font-weight: 600; line-height: 1.2; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.battle-actions-tab:last-child { border-right: none; }
.battle-actions-tab--active { position: relative; z-index: 1; margin-bottom: -1px; padding-top: 8px; padding-bottom: 9px; background: var(--ui-sheet-content-bg); color: var(--gold, #d3b06f); box-shadow: inset 0 2px 0 var(--gold, #d3b06f); border-bottom: 1px solid var(--ui-sheet-content-bg); }
.battle-actions-log, .battle-actions-sheet .battle-log-history-body { padding: 10px 12px; border: none; border-radius: 0; background: transparent; min-height: 72px; max-height: 160px; overflow: auto; }
.battle-actions-sheet--history .battle-log-history-body { max-height: min(52vh, 420px); }
.battle-action-line { font-size: 0.86rem; line-height: 1.35; color: var(--muted, #c9d0da); }
.battle-log-mob { color: #e07070; font-weight: 700; }
.battle-log-actor { font-weight: 700; color: var(--gold, #d3b06f); }
.battle-log-actor--mob { color: #e07070; }
.battle-log-danger { color: #e07070; font-weight: 700; }
.battle-log-dmg { font-weight: 700; color: #f0c878; }
.battle-log-reward { color: var(--gold-dim, #b39b6b); }
.battle-log-summary-row { display: flex; justify-content: space-between; gap: 10px; font-size: 0.84rem; line-height: 1.35; padding: 2px 0; }
.battle-log-history-overlay { position: fixed; inset: 0; z-index: 10060; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(4, 6, 10, 0.78); }
.battle-log-history-dialog { width: min(100%, 520px); max-height: min(88vh, 640px); display: flex; flex-direction: column; border-radius: var(--ui-panel-radius, 12px); border: 1px solid var(--ui-panel-border); background: var(--ui-panel-bg); padding: 14px 14px 12px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45); }
.battle-log-history-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.battle-log-history-title { margin: 0; font-size: 1.05rem; color: var(--gold, #d3b06f); }
.battle-log-history-dialog .battle-actions-sheet { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; border: 1px solid var(--ui-sheet-tab-line); border-radius: 10px; overflow: hidden; }
.battle-log-history-line { font-size: 0.86rem; line-height: 1.35; color: var(--muted, #c9d0da); padding: 2px 0; }
.battle-log-history-line--empty { color: var(--muted, #c9d0da); }
.battle-main-row { display: grid; grid-template-columns: minmax(0, 38%) minmax(0, 1fr); grid-template-rows: auto auto; gap: 10px; align-items: stretch; margin-bottom: 12px; }
.battle-mob-visual { grid-column: 1; grid-row: 1; display: flex; min-height: 0; min-width: 0; }
.battle-panel--mob { grid-column: 2; grid-row: 1; min-width: 0; }
.battle-player-visual { grid-column: 1; grid-row: 2; display: flex; min-height: 0; min-width: 0; }
.battle-panel--player { grid-column: 2; grid-row: 2; min-width: 0; }
.battle-mob-visual, .battle-player-visual { border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(10, 12, 16, 0.45); overflow: hidden; }
.battle-mob-img, .battle-player-img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: cover; object-position: center 20%; will-change: transform; }
@keyframes battle-portrait-player-up { 0% { transform: translateY(0); } 35% { transform: translateY(-18px); } 100% { transform: translateY(0); } }
@keyframes battle-portrait-mob-down { 0% { transform: translateY(0); } 35% { transform: translateY(18px); } 100% { transform: translateY(0); } }
.battle-portrait-anim--player-up { animation: battle-portrait-player-up 320ms ease-out; }
.battle-portrait-anim--mob-down { animation: battle-portrait-mob-down 320ms ease-out; }
.battle-btn-with-hotkey { position: relative; padding-top: 18px; }
.battle-btn-hotkey { position: absolute; top: 4px; left: 8px; font-size: 0.68rem; font-weight: 700; line-height: 1; color: var(--muted, #c9d0da); opacity: 0.85; pointer-events: none; }
.battle-btn-hotkey--esc { font-size: 0.58rem; left: 6px; }
.battle-btn-label { display: block; }
.battle-potion-btn { position: relative; flex: 0 0 auto; width: 56px; height: 56px; padding: 0; border: none; border-radius: 0; background: transparent; cursor: pointer; }
.battle-potion-btn img { display: block; width: 100%; height: 100%; object-fit: contain; }
.battle-potion-badge { position: absolute; right: 2px; bottom: 2px; padding: 1px 5px; border-radius: 8px; background: rgba(8, 10, 14, 0.82); font-size: 0.72rem; font-weight: 700; line-height: 1.2; }

/* --- Всплывашки: пополнение HP/MP/энергии, уровень, новый противник, итог боя --- */
.vitality-refill-batch {
  position: fixed;
  left: 50%;
  top: var(--ui-toast-top-lower, calc(96px + env(safe-area-inset-top, 0px)));
  transform: translateX(-50%) translateY(-8px);
  z-index: 12100;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.26s ease, transform 0.26s ease;
}
.vitality-refill-batch--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.vitality-refill-batch__inner {
  min-width: 148px;
  padding: 10px 12px 9px;
  border-radius: 12px;
  border: 1px solid rgba(211, 176, 111, 0.42);
  background: rgba(14, 16, 20, 0.94);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}
.vitality-refill-row + .vitality-refill-row { margin-top: 8px; }
.vitality-refill-delta {
  font-size: 0.95rem;
  font-weight: 800;
  color: #f2ece0;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.vitality-refill-bar-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  margin-bottom: 5px;
}
.vitality-refill-bar-fill {
  height: 100%;
  border-radius: inherit;
  transition: width 0.2s ease;
}
.vitality-refill-row--hp .vitality-refill-bar-fill {
  background: linear-gradient(90deg, #2f9f67 0%, #6fd39a 100%);
}
.vitality-refill-row--mana .vitality-refill-bar-fill {
  background: linear-gradient(90deg, #2f74c8 0%, #6eb8ff 100%);
}
.vitality-refill-row--energy .vitality-refill-bar-fill {
  background: linear-gradient(90deg, #c9a227 0%, #f0d060 100%);
}
.vitality-refill-fraction {
  font-size: 0.82rem;
  font-weight: 700;
  color: #e8ebef;
  text-align: center;
}

.level-up-toast {
  position: fixed;
  left: 50%;
  top: var(--ui-toast-top, calc(72px + env(safe-area-inset-top, 0px)));
  bottom: auto;
  transform: translateX(-50%) translateY(-10px);
  z-index: 12350;
  max-width: min(92vw, 420px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.28s ease, transform 0.28s ease;
}
.level-up-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.level-up-toast__inner {
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(211, 176, 111, 0.55);
  background: rgba(14, 16, 20, 0.95);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  text-align: center;
}
.level-up-toast__title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--gold, #d3b06f);
  margin-bottom: 4px;
}
.level-up-toast__msg {
  font-size: 0.92rem;
  color: #f2ece0;
  line-height: 1.35;
}
.level-up-toast__num {
  font-weight: 800;
  color: var(--gold, #d3b06f);
}
.level-up-toast__sub {
  margin-top: 6px;
  font-size: 0.78rem;
  line-height: 1.3;
}

/* Позицию top выставляет achievementToast.ts — под остальными верхними тостами. */
.achievement-toast-stack {
  position: fixed;
  left: 50%;
  top: var(--ui-toast-top, calc(72px + env(safe-area-inset-top, 0px)));
  transform: translateX(-50%);
  z-index: 13300;
  width: min(92vw, 380px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  transition: top 0.22s ease;
}
.achievement-toast {
  pointer-events: auto;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.28s ease, transform 0.28s ease;
}
.achievement-toast--visible {
  opacity: 1;
  transform: translateY(0);
}
.achievement-toast__inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--ui-daily-claim-border, rgba(211, 176, 111, 0.85));
  background: var(--ui-elevated-surface, rgba(14, 16, 20, 0.96));
  box-shadow: var(--ui-daily-claim-shadow), 0 10px 30px rgba(0, 0, 0, 0.5);
}
.achievement-toast__icon {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  object-fit: contain;
}
.achievement-toast__body {
  min-width: 0;
  flex: 1 1 auto;
}
.achievement-toast__kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold, #d3b06f);
}
.achievement-toast__title {
  font-size: 1rem;
  font-weight: 800;
  color: #f2ece0;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.achievement-toast__desc {
  margin-top: 2px;
  font-size: 0.8rem;
  color: rgba(236, 229, 213, 0.82);
  line-height: 1.3;
}
.achievement-toast__reward {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold, #d3b06f);
}
.achievement-toast__reward-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
}
.achievement-toast__hint {
  margin-top: 4px;
  font-size: 0.72rem;
  color: rgba(236, 229, 213, 0.6);
}

.stat-change-toast {
  position: fixed;
  left: 50%;
  top: var(--ui-toast-top-lower, calc(118px + env(safe-area-inset-top, 0px)));
  bottom: auto;
  transform: translateX(-50%) translateY(-10px);
  /* Выше оверлея обучения (12600), иначе тост параметров не виден при заточке в туториале. */
  z-index: 13150;
  max-width: min(92vw, 360px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.stat-change-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.stat-change-toast__inner {
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(211, 176, 111, 0.55);
  background: rgba(14, 16, 20, 0.95);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.stat-change-toast__title {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--gold, #d3b06f);
  margin-bottom: 6px;
  text-align: center;
}

.stat-change-toast__bm-line {
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.95rem;
  color: #f2ece0;
}

.stat-change-toast__bm-label {
  font-weight: 800;
  color: var(--gold, #d3b06f);
}

.stat-change-toast__bm-total {
  font-weight: 800;
}

.stat-change-toast__bm-paren {
  font-weight: 700;
}

.stat-change-toast__stats {
  display: grid;
  gap: 4px;
  margin-top: 8px;
}

.stat-change-toast__row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
}

.stat-change-toast__stat-name {
  flex: 1 1 auto;
  color: rgba(236, 240, 248, 0.9);
}

.stat-change-toast__stat-num {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stat-change-toast__delta--up {
  color: #8fd4a0;
}

.stat-change-toast__delta--down {
  color: #e07a7a;
}

.stat-change-toast__arrow {
  width: 1rem;
  text-align: center;
  flex-shrink: 0;
}

.stat-change-toast--welcome {
  max-width: min(92vw, 400px);
  /* Выше пузыря обучения (13000), чтобы тост после создания персонажа был сверху. */
  z-index: 13200;
}

.stat-change-toast__inner--welcome {
  text-align: center;
  padding: 16px 20px;
}

.stat-change-toast__welcome-msg {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  color: #f2ece0;
}

/* Оверлей обучения: затемнение + подсветка + стрелка + пузырь */
.tutorial-guide-overlay {
  position: fixed;
  inset: 0;
  z-index: 12600;
  pointer-events: none;
}

.tutorial-guide-dim {
  position: absolute;
  inset: 0;
  /* Лёгкое затемнение: игра и меню остаются читаемыми, обучение поверх. */
  background: rgba(4, 6, 10, 0.28);
  /* Клики проходят к цели; блокировку делает capture-listener гайда. */
  pointer-events: none;
  z-index: 0;
}

.tutorial-focus-rect {
  position: fixed;
  box-sizing: border-box;
  border: 2px solid rgba(211, 176, 111, 0.95);
  border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), 0 0 18px rgba(211, 176, 111, 0.35);
  pointer-events: none;
  z-index: 1;
}

.tutorial-guide-arrow {
  position: fixed;
  z-index: 2;
  font-size: 26px;
  line-height: 1;
  color: var(--gold, #d3b06f);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.75);
  pointer-events: none;
  animation: tutorial-guide-arrow-bob 1.1s ease-in-out infinite;
}

.tutorial-gates-intro-continue-wrap {
  position: fixed;
  left: 50%;
  bottom: max(96px, calc(18vh + env(safe-area-inset-bottom, 0px)));
  transform: translateX(-50%);
  z-index: 3;
  pointer-events: auto;
}

.tutorial-gates-intro-continue-wrap #btn-tutorial-continue {
  min-width: 160px;
  pointer-events: auto;
}

@keyframes tutorial-guide-arrow-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

.tutorial-guide-bubble {
  position: fixed;
  z-index: 13000;
  max-width: min(300px, calc(100vw - 36px));
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(211, 176, 111, 0.55);
  background: rgba(14, 16, 20, 0.98);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
  color: #f2ece0;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  pointer-events: none;
}

.tutorial-guide-bubble__hint {
  margin-top: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(211, 176, 111, 0.9);
}

.tutorial-guide-bubble--center {
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  max-width: min(340px, calc(100vw - 40px));
  pointer-events: none;
}

.tutorial-resume-float {
  position: fixed;
  left: 50%;
  right: auto;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 14000;
  pointer-events: none;
}

body.main-menu-layout-mobile .tutorial-resume-float {
  bottom: calc(18px + var(--main-menu-mobile-dock-h, 86px) + env(safe-area-inset-bottom, 0px));
}

.tutorial-resume-float__btn {
  pointer-events: auto;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
}

body.tutorial-guide-ui-lock #main-panel,
body.tutorial-guide-ui-lock .main-screen-head {
  pointer-events: none;
}

body.tutorial-guide-ui-lock #main-menu-grid [data-menu].menu-btn--starter-allowed {
  pointer-events: auto;
}

body.tutorial-guide-ui-lock #main-menu-grid [data-menu].tutorial-focus-target {
  position: relative;
  z-index: 12650;
  pointer-events: auto;
}

/*
 * Не поднимать цель в #main-panel выше оверлея (12600): иначе слот экипировки
 * перекрывает пузырь подсказки. Клики проходят через dim (pointer-events: none + clip-path).
 */
body.tutorial-guide-ui-lock .tutorial-focus-target {
  pointer-events: auto;
}

body.tutorial-guide-ui-lock #main-panel .tutorial-focus-target {
  pointer-events: auto;
}

body.tutorial-guide-ui-lock #main-panel .tutorial-focus-target:not(.fishing-hole-pick):not(.fishing-hole-pick-frozen) {
  position: relative;
}

.battle-next-opponent-toast {
  position: fixed;
  left: 50%;
  top: calc(56px + env(safe-area-inset-top, 0px));
  transform: translateX(-50%) translateY(-8px);
  /* Выше оверлея обучения (12600) и пузыря (13000). */
  z-index: 13150;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.24s ease, transform 0.24s ease;
}
.battle-next-opponent-toast--in-stage {
  position: fixed;
  left: 50%;
  top: calc(56px + env(safe-area-inset-top, 0px));
  transform: translateX(-50%) translateY(-8px);
  z-index: 13150;
}
.battle-next-opponent-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.battle-next-opponent-toast__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid rgba(211, 176, 111, 0.45);
  background: rgba(12, 14, 18, 0.94);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.42);
  white-space: nowrap;
}
.battle-next-opponent-toast__title {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--gold, #d3b06f);
}
.battle-next-opponent-toast__name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #f2ece0;
}

.battle-outcome-overlay {
  position: fixed;
  inset: 0;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  margin: 0 !important;
  box-sizing: border-box;
  z-index: 12250;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(4, 6, 10, 0.82);
  backdrop-filter: blur(2px);
}
.battle-outcome-dialog {
  width: min(100%, 340px);
  padding: 16px 16px 14px;
  border-radius: var(--ui-panel-radius, 12px);
  border: 1px solid var(--ui-panel-border, rgba(154, 164, 176, 0.35));
  background: var(--ui-panel-bg, rgba(20, 22, 28, 0.96));
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
}
.battle-outcome-title {
  margin: 0 0 12px;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 800;
  color: #f2ece0;
}
.battle-outcome-body {
  margin-bottom: 14px;
}
.battle-outcome-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
  font-size: 0.92rem;
  line-height: 1.35;
  color: #e8ebef;
}
.battle-outcome-coin {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  object-fit: contain;
}
.battle-outcome-drop-fallback {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
}
.battle-outcome-level {
  font-weight: 800;
  color: var(--gold, #d3b06f);
}
.battle-outcome-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.battle-outcome-actions .battle-outcome-btn {
  flex: 1 1 auto;
  min-width: 0;
}
.battle-outcome-actions .battle-outcome-open-log,
.battle-outcome-actions .battle-log-history-btn {
  flex: 0 0 auto;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.battle-main-row {
  position: relative;
}

/* ===== Кузница ===== */
.forge-root.collections-root {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.collections-root .forge-msg.collections-inline-msg {
  display: none;
}

/* Вкладки «как в браузере» + панель контента */
.forge-sheet {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: none;
  border-radius: 0;
  overflow: visible;
  background: transparent;
}

.forge-sheet-tabs-row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0;
  margin: 0 0 4px;
  padding: 0 0 4px;
  background: transparent;
  border-bottom: 1px solid var(--ui-panel-border);
}

.forge-sheet-tabs {
  display: flex;
  align-items: stretch;
  flex: 0 1 auto;
  min-width: 0;
}

.forge-sheet-tab {
  flex: 0 0 auto;
  margin: 0;
  padding: 8px 14px 7px;
  border: none;
  border-right: 1px solid var(--ui-sheet-tab-line, rgba(128, 134, 144, 0.38));
  border-radius: 0;
  background: transparent;
  color: var(--ui-sheet-tab-text, rgba(182, 186, 194, 0.9));
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.forge-sheet-tab:hover:not(.forge-sheet-tab--active) {
  color: rgba(220, 224, 230, 0.95);
  background: rgba(255, 255, 255, 0.03);
}

.forge-sheet-tab--active {
  color: var(--ui-sheet-tab-text-active, #e8eaec);
  background: transparent;
  box-shadow: inset 0 -2px 0 rgba(211, 176, 111, 0.72);
}

.forge-sheet-tab:focus-visible {
  outline: 2px solid var(--ui-focus-ring, rgba(211, 176, 111, 0.55));
  outline-offset: -2px;
}

.forge-tab-pockets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 12px;
  flex: 1 1 auto;
  min-width: 0;
  margin-left: auto;
  padding: 6px 10px;
}

.forge-tab-pockets .shop-pocket-item {
  gap: 4px;
}

.forge-tab-pockets .shop-pocket-icon {
  width: 24px;
  height: 24px;
}

.forge-sheet-body {
  padding: 0;
  min-width: 0;
}

.forge-sharp-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}

.forge-sharp-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: 0 0 10px;
  padding: 0;
  border: none;
  background: transparent;
}

.forge-sharp-pockets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 12px;
  flex: 1 1 auto;
  min-width: 0;
  margin-left: auto;
}

.forge-sharp-pockets .shop-pocket-icon {
  width: 24px;
  height: 24px;
}

.forge-mass-toggle-all {
  flex: 0 0 auto;
  white-space: nowrap;
}

.forge-strip-label {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.82rem;
  color: rgba(211, 176, 111, 0.88);
}

.forge-strip-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 6px;
}

.forge-strip-all-btn {
  flex: 0 0 auto;
  margin-left: auto;
}

.forge-target-presets {
  display: inline-flex;
  gap: 4px;
  margin-left: 6px;
  vertical-align: middle;
}

.forge-target-preset-btn {
  margin: 0;
  padding: 2px 8px;
  min-width: 2.1rem;
  border-radius: 8px;
  border: 1px solid var(--ui-pill-border, rgba(154, 164, 176, 0.32));
  background: var(--ui-pill-bg, rgba(10, 12, 16, 0.72));
  color: var(--ui-pill-text, rgba(200, 206, 216, 0.9));
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.forge-target-preset-btn:hover:not(:disabled) {
  border-color: rgba(211, 176, 111, 0.35);
  color: rgba(232, 200, 120, 0.92);
}

.forge-target-preset-btn--active {
  border-color: rgba(211, 176, 111, 0.5);
  background: rgba(211, 176, 111, 0.12);
  color: rgba(232, 200, 120, 0.98);
}

.forge-target-preset-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.forge-target-preset-btn--custom {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 2px 4px 2px 6px;
  cursor: text;
}

.forge-target-preset-btn--custom.forge-target-preset-btn--active {
  border-color: rgba(211, 176, 111, 0.5);
  background: rgba(211, 176, 111, 0.12);
}

.forge-target-custom-plus {
  font-size: 0.78rem;
  font-weight: 600;
  color: inherit;
  line-height: 1;
}

.forge-target-custom-input {
  width: 2rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
  -moz-appearance: textfield;
}

.forge-target-custom-input::-webkit-outer-spin-button,
.forge-target-custom-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.forge-target-custom-input:focus {
  outline: none;
}

.forge-target-custom-input::placeholder {
  color: rgba(168, 176, 188, 0.55);
}

.forge-mass-target-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 7.5rem;
  margin-bottom: 4px;
  text-align: center;
}

.forge-mass-target-label {
  margin: 0;
  font-size: 0.82rem;
}

.forge-mass-target-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: rgba(236, 205, 140, 0.98);
  line-height: 1.15;
}

.forge-center-sub-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 8px;
  width: 100%;
  max-width: 18rem;
  margin-bottom: 4px;
}

.forge-center-sub-row .forge-center-sub {
  margin: 0;
}

.forge-sharpen-cost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 6px 0 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(236, 232, 224, 0.95);
}

.forge-sharpen-cost-icon {
  width: 1.125rem;
  height: 1.125rem;
  object-fit: contain;
}

.forge-mass-pick-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ui-pill-border, rgba(154, 164, 176, 0.2));
}

.forge-mass-pick-scroll {
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(184, 193, 208, 0.42) transparent;
}

.forge-mass-pick-scroll::-webkit-scrollbar {
  height: 5px;
}

.forge-mass-pick-scroll::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(184, 193, 208, 0.42);
}

.forge-preview-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  text-align: center;
}

.forge-preview-visual {
  position: relative;
  width: 6rem;
  height: 6rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.forge-preview-img {
  position: relative;
  z-index: 1;
  width: 5.5rem;
  height: 5.5rem;
  object-fit: contain;
  transition: filter 0.2s ease;
}

.forge-preview-visual--fx-gold .forge-preview-img {
  animation: forge-img-glow-gold 1.4s ease-out;
}

.forge-preview-visual--fx-red .forge-preview-img {
  animation: forge-img-glow-red 1.4s ease-out;
}

.forge-preview-visual--fx-ench-1 .forge-preview-img {
  animation: forge-img-glow-ench-1 1.4s ease-out;
}

.forge-preview-visual--fx-ench-2 .forge-preview-img {
  animation: forge-img-glow-ench-2 1.4s ease-out;
}

.forge-preview-visual--fx-ench-3 .forge-preview-img {
  animation: forge-img-glow-ench-3 1.4s ease-out;
}

@keyframes forge-img-glow-gold {
  0% {
    filter: drop-shadow(0 0 2px rgba(211, 176, 111, 0.35));
  }
  35% {
    filter: drop-shadow(0 0 10px rgba(211, 176, 111, 0.95)) drop-shadow(0 0 22px rgba(211, 176, 111, 0.55));
  }
  100% {
    filter: drop-shadow(0 0 4px rgba(211, 176, 111, 0.2));
  }
}

@keyframes forge-img-glow-red {
  0% {
    filter: drop-shadow(0 0 2px rgba(220, 72, 72, 0.35));
  }
  35% {
    filter: drop-shadow(0 0 10px rgba(220, 72, 72, 0.95)) drop-shadow(0 0 22px rgba(220, 72, 72, 0.5));
  }
  100% {
    filter: drop-shadow(0 0 4px rgba(220, 72, 72, 0.18));
  }
}

@keyframes forge-img-glow-ench-1 {
  0% {
    filter: drop-shadow(0 0 2px rgba(236, 240, 248, 0.35));
  }
  35% {
    filter: drop-shadow(0 0 10px rgba(236, 240, 248, 0.95)) drop-shadow(0 0 20px rgba(200, 210, 230, 0.55));
  }
  100% {
    filter: drop-shadow(0 0 4px rgba(236, 240, 248, 0.2));
  }
}

@keyframes forge-img-glow-ench-2 {
  0% {
    filter: drop-shadow(0 0 2px rgba(120, 175, 255, 0.35));
  }
  35% {
    filter: drop-shadow(0 0 10px rgba(120, 175, 255, 0.95)) drop-shadow(0 0 22px rgba(90, 140, 230, 0.55));
  }
  100% {
    filter: drop-shadow(0 0 4px rgba(120, 175, 255, 0.2));
  }
}

@keyframes forge-img-glow-ench-3 {
  0% {
    filter: drop-shadow(0 0 2px rgba(232, 200, 120, 0.35));
  }
  35% {
    filter: drop-shadow(0 0 10px rgba(232, 200, 120, 0.98)) drop-shadow(0 0 24px rgba(211, 176, 111, 0.6));
  }
  100% {
    filter: drop-shadow(0 0 4px rgba(232, 200, 120, 0.22));
  }
}

.forge-center-empty {
  position: relative;
  z-index: 1;
}

.forge-preview-plus {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(8, 10, 14, 0.82);
  border: 1px solid rgba(211, 176, 111, 0.35);
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(232, 200, 120, 0.98);
}

.forge-preview-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(236, 232, 224, 0.98);
  line-height: 1.25;
  max-width: 14rem;
}

.forge-preview-bm {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gold, #d3b06f);
  font-variant-numeric: tabular-nums;
}

.forge-preview-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  max-width: 14rem;
}

.forge-preview-rarity {
  margin: 0;
}

.forge-gear-tile-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 100%;
  min-width: 0;
}

.forge-gear-tile-rarity {
  margin: 0;
}

.forge-center-card--gold {
  box-shadow: 0 0 0 2px rgba(211, 176, 111, 0.55), 0 0 18px rgba(211, 176, 111, 0.28);
}

.forge-center-card--red {
  box-shadow: 0 0 0 2px rgba(220, 72, 72, 0.55), 0 0 18px rgba(220, 72, 72, 0.28);
}

.forge-gear-strip--multi .forge-gear-tile--pickable {
  position: relative;
}

.forge-gear-pick-mark {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 2;
  width: 1.1rem;
  height: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  border: 1px solid rgba(154, 164, 176, 0.35);
  background: rgba(8, 10, 14, 0.75);
  font-size: 0.72rem;
  line-height: 1;
  color: transparent;
  pointer-events: none;
}

.forge-gear-pick-mark--on {
  border-color: rgba(211, 176, 111, 0.55);
  background: rgba(211, 176, 111, 0.2);
  color: rgba(232, 200, 120, 0.98);
}

.forge-mode-btn {
  margin: 0;
  padding: 6px 14px;
  border-radius: var(--btn-radius, 10px);
  border: 1px solid var(--ui-pill-border, rgba(154, 164, 176, 0.32));
  background: var(--ui-pill-bg, rgba(10, 12, 16, 0.72));
  color: var(--ui-pill-text, rgba(200, 206, 216, 0.9));
  font: inherit;
  font-size: 0.86rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.forge-mode-btn:hover {
  border-color: rgba(211, 176, 111, 0.35);
  color: rgba(232, 200, 120, 0.92);
}

.forge-mode-btn--active {
  border-color: rgba(211, 176, 111, 0.5);
  background: rgba(211, 176, 111, 0.1);
  color: rgba(232, 200, 120, 0.98);
  box-shadow: 0 0 0 1px rgba(138, 110, 54, 0.12);
}

.forge-mode-btn:focus-visible {
  outline: 2px solid var(--ui-focus-ring, rgba(211, 176, 111, 0.55));
  outline-offset: 2px;
}

.forge-pane {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.forge-strip-wrap {
  margin-bottom: 10px;
}

.forge-gear-strip-scroll {
  max-height: 236px;
  overflow-y: auto;
  padding: 4px 0 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(184, 193, 208, 0.42) transparent;
}

.forge-gear-strip-scroll--grid2 {
  max-height: 13.75rem;
  overflow-x: hidden;
  overflow-y: auto;
  padding-bottom: 6px;
}

.forge-gear-strip-scroll--grid2::-webkit-scrollbar {
  width: 6px;
  height: auto;
}

.forge-gear-strip-scroll::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.forge-gear-strip-scroll::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(184, 193, 208, 0.42);
}

.forge-gear-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-content: start;
  gap: 8px;
}

.forge-gear-strip--grid2 {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.forge-gear-strip--massRow {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  width: max-content;
  min-width: min-content;
  padding-bottom: 2px;
}

.forge-gear-strip--massRow .forge-gear-tile {
  flex: 0 0 auto;
  width: 5.25rem;
  padding: 6px 5px 8px;
}

.forge-gear-strip--massRow .forge-gear-thumb {
  width: 3rem;
  height: 3rem;
}

.forge-gear-strip--massRow .forge-gear-thumb img {
  width: 2.75rem;
  height: 2.75rem;
}

.forge-gear-tile-name--mass {
  font-size: 0.68rem;
  line-height: 1.15;
  max-height: 2.3em;
  overflow: hidden;
}

.forge-gear-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  gap: 6px;
  margin: 0;
  padding: 8px 6px 10px;
  border-radius: 12px;
  border: 1px solid var(--ui-pill-border, rgba(154, 164, 176, 0.28));
  background: var(--ui-stub-bg, rgba(10, 12, 16, 0.72));
  color: inherit;
  font: inherit;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.forge-gear-tile:hover {
  border-color: rgba(211, 176, 111, 0.35);
}

.forge-gear-tile--active {
  border-color: rgba(211, 176, 111, 0.55);
  box-shadow: 0 0 0 1px rgba(211, 176, 111, 0.2);
}

.forge-gear-tile--equipped {
  border-color: rgba(120, 86, 42, 0.62);
  background: rgba(48, 32, 18, 0.78);
  box-shadow: inset 0 0 0 1px rgba(90, 62, 28, 0.35);
}

.forge-gear-tile--equipped:hover:not(:disabled) {
  border-color: rgba(138, 100, 52, 0.72);
}

.forge-gear-tile--equipped.forge-gear-tile--active {
  border-color: rgba(211, 176, 111, 0.55);
  background: rgba(52, 34, 18, 0.86);
  box-shadow: 0 0 0 1px rgba(211, 176, 111, 0.2), inset 0 0 0 1px rgba(90, 62, 28, 0.35);
}

.forge-gear-tile--disabled,
.forge-gear-tile:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  pointer-events: none;
}

.forge-gear-tile--disabled:hover,
.forge-gear-tile:disabled:hover {
  border-color: var(--ui-pill-border, rgba(154, 164, 176, 0.32));
}

.forge-gear-tile:focus-visible {
  outline: 2px solid var(--ui-focus-ring, rgba(211, 176, 111, 0.55));
  outline-offset: 2px;
}

.forge-gear-thumb {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
}

.forge-gear-thumb img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: filter 0.2s ease;
}

.forge-gear-thumb--fx-gold img {
  animation: forge-img-glow-gold 1.4s ease-out;
}

.forge-gear-thumb--fx-red img {
  animation: forge-img-glow-red 1.4s ease-out;
}

.forge-gear-thumb--fx-ench-1 img {
  animation: forge-img-glow-ench-1 1.4s ease-out;
}

.forge-gear-thumb--fx-ench-2 img {
  animation: forge-img-glow-ench-2 1.4s ease-out;
}

.forge-gear-thumb--fx-ench-3 img {
  animation: forge-img-glow-ench-3 1.4s ease-out;
}

.forge-strip-fallback {
  font-size: 1.75rem;
  line-height: 1;
  opacity: 0.65;
}

.forge-gear-plus {
  position: absolute;
  right: -2px;
  bottom: -2px;
  z-index: 2;
  min-width: 1.35rem;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.82);
  border: 1px solid rgba(154, 164, 176, 0.35);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.2;
  color: rgba(236, 232, 224, 0.95);
}

.gear-preview-inv-sharpen-badge {
  z-index: 2;
}

.forge-gear-tile-name {
  width: 100%;
  min-height: 2.4em;
  font-size: 0.72rem;
  line-height: 1.2;
  color: rgba(200, 206, 216, 0.92);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  word-break: break-word;
}

.forge-strip-empty {
  margin: 8px 0;
}

.forge-fx-wrap {
  transition: box-shadow 0.35s ease, border-color 0.35s ease;
}

.forge-table-wrap {
  border-radius: 14px;
  border: 1px solid var(--ui-panel-border, rgba(154, 164, 176, 0.24));
  background: rgba(6, 8, 12, 0.45);
}

.forge-table-wrap--gold {
  border-color: rgba(211, 176, 111, 0.55);
  box-shadow: 0 0 0 1px rgba(211, 176, 111, 0.2), 0 0 18px rgba(211, 176, 111, 0.12);
}

.forge-table-wrap--red {
  border-color: rgba(220, 90, 90, 0.55);
  box-shadow: 0 0 0 1px rgba(220, 90, 90, 0.2), 0 0 18px rgba(220, 90, 90, 0.1);
}

.forge-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 12px;
  padding: 14px 12px;
  align-items: start;
}

.forge-wb-col {
  min-width: 0;
}

.forge-wb-col--material {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.forge-stone-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 4.75rem;
}

.forge-wb-title--stone {
  margin: 0 0 8px;
  text-align: left;
  width: 100%;
}

.forge-stat-divider {
  margin: 10px 0;
  border: none;
  border-top: 1px solid var(--ui-pill-border, rgba(154, 164, 176, 0.28));
}

.forge-delta-list--enchant {
  margin-top: 0;
}

.forge-wb-title {
  margin: 0 0 6px;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(170, 178, 192, 0.9);
}

.forge-wb-title--spaced {
  margin-top: 12px;
}

.forge-big-pct {
  margin: 0 0 8px;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  color: var(--gold, #d3b06f);
}

.forge-risk {
  color: rgba(232, 170, 100, 0.95);
}

.forge-safe {
  color: rgba(140, 200, 140, 0.92);
}

.forge-delta-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.88rem;
  line-height: 1.45;
}

.forge-delta-list li {
  margin: 0 0 4px;
}

.forge-delta-plus {
  color: rgba(120, 210, 130, 0.95);
  font-weight: 600;
}

.forge-wb-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.forge-center-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  text-align: center;
  transition: box-shadow 0.35s ease, border-color 0.35s ease;
}

.forge-center-visual {
  position: relative;
  width: 6rem;
  height: 6rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.forge-center-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.forge-center-empty {
  font-size: 2.5rem;
  opacity: 0.5;
}

.forge-center-plus {
  position: absolute;
  right: -4px;
  bottom: -4px;
  min-width: 1.5rem;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid rgba(154, 164, 176, 0.35);
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(236, 232, 224, 0.95);
}

.forge-center-name {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
  color: rgba(236, 232, 224, 0.98);
}

.forge-center-sub {
  margin: 0;
  font-size: 0.82rem;
  color: rgba(211, 176, 111, 0.9);
}

.forge-sharpen-btn {
  width: 100%;
  max-width: 14rem;
}

.forge-gold-hint,
.forge-mass-gold-hint,
.forge-enchant-cost {
  margin: 0;
  font-size: 0.78rem;
  text-align: center;
}

.forge-stone-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.forge-stone-visual {
  position: relative;
  width: 4.75rem;
  height: 4.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--ui-pill-border, rgba(154, 164, 176, 0.28));
  background: rgba(8, 10, 14, 0.55);
}

.forge-stone-visual img {
  width: 3.25rem;
  height: 3.25rem;
  object-fit: contain;
}

.forge-stone-qty-badge {
  position: absolute;
  right: 4px;
  bottom: 4px;
  min-width: 1.25rem;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid rgba(154, 164, 176, 0.35);
  font-size: 0.68rem;
  font-weight: 700;
  color: rgba(236, 232, 224, 0.95);
}

.forge-stone-need-badge {
  position: absolute;
  left: 4px;
  top: 4px;
  min-width: 1.25rem;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(211, 176, 111, 0.22);
  border: 1px solid rgba(211, 176, 111, 0.55);
  font-size: 0.68rem;
  font-weight: 700;
  color: rgba(232, 200, 120, 0.98);
}

.forge-stone-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(200, 206, 216, 0.92);
}

.forge-mass-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 8px;
}

.forge-mass-target-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.forge-mass-input {
  width: 4rem;
  min-width: 3.5rem;
}

.forge-mass-table-wrap {
  padding: 10px 12px;
}

.forge-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.forge-table th,
.forge-table td {
  padding: 8px 6px;
  text-align: left;
  border-bottom: 1px solid rgba(154, 164, 176, 0.16);
  vertical-align: top;
}

.forge-table th {
  font-size: 0.78rem;
  color: rgba(170, 178, 192, 0.88);
  font-weight: 600;
}

.forge-table tr:last-child td {
  border-bottom: none;
}

.forge-topbar-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.forge-craft-top-meta {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.25;
  color: rgba(168, 176, 188, 0.88);
}

.forge-craft-pane {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.forge-craft-hint {
  margin: 0;
  color: rgba(211, 176, 111, 0.88);
  font-size: 0.82rem;
  line-height: 1.35;
}

.forge-craft-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.forge-craft-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
}

.forge-craft-filter-select {
  margin: 0;
  padding: 4px 8px;
  border-radius: var(--btn-radius, 10px);
  border: 1px solid var(--ui-input-border, rgba(154, 164, 176, 0.35));
  background: var(--ui-input-bg, rgba(10, 12, 16, 0.82));
  color: var(--ui-input-text, rgba(236, 232, 224, 0.95));
  font: inherit;
  font-size: 0.82rem;
}

.forge-craft-toolbar-meta {
  font-size: 0.72rem;
  color: rgba(168, 176, 188, 0.88);
}

.forge-craft-target-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  max-height: min(280px, 42vh);
  overflow-y: auto;
  padding: 2px;
  -webkit-overflow-scrolling: touch;
}

.forge-craft-target-card {
  position: relative;
  border-radius: 10px;
  border: 1px solid var(--ui-pill-border, rgba(154, 164, 176, 0.32));
  background: var(--ui-panel-bg, rgba(16, 20, 28, 0.9));
  padding: 8px 6px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: center;
  min-height: 112px;
  box-sizing: border-box;
}

.forge-craft-target-card:hover {
  border-color: rgba(211, 176, 111, 0.45);
}

.forge-craft-target-card--active {
  border-color: var(--ui-selected-line, rgba(236, 205, 140, 0.95));
  box-shadow: 0 0 0 1px rgba(211, 176, 111, 0.22);
}

.forge-craft-target-thumb {
  position: relative;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.forge-craft-target-thumb img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.forge-craft-target-name {
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.15;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forge-craft-target-card .rarity-tag {
  font-size: 0.62rem;
  padding: 1px 5px;
}

.forge-craft-target-cat {
  font-size: 0.66rem;
  color: rgba(211, 176, 111, 0.78);
}

.forge-craft-workbench {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid rgba(154, 164, 176, 0.18);
}

#summon-gear-preview-modal.summon-gear-preview-modal--centered .gear-preview-hero-body-main--centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  text-align: center;
}

#summon-gear-preview-modal.summon-gear-preview-modal--centered .card-preview-image--gear {
  margin-left: auto;
  margin-right: auto;
  display: block;
}

#summon-gear-preview-modal.summon-gear-preview-modal--centered .card-preview-stats {
  width: 100%;
  max-width: 100%;
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

#summon-gear-preview-modal.summon-gear-preview-modal--centered .card-preview-close img {
  width: 22px;
  height: 22px;
}

.forge-craft-selected {
  display: flex;
  align-items: center;
  gap: 12px;
}

.forge-craft-selected--centered {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  margin-bottom: 4px;
}

.forge-craft-selected-visual--btn {
  margin: 0;
  padding: 4px;
  border: none;
  border-radius: 10px;
  background: rgba(10, 12, 16, 0.45);
  cursor: pointer;
  line-height: 0;
  -webkit-tap-highlight-color: transparent;
}

.forge-craft-selected-visual--btn:hover {
  background: rgba(211, 176, 111, 0.1);
  box-shadow: 0 0 0 1px rgba(211, 176, 111, 0.28);
}

.forge-craft-selected-visual--btn:focus-visible {
  outline: 2px solid var(--ui-focus-ring, rgba(211, 176, 111, 0.55));
  outline-offset: 2px;
}

.forge-craft-selected--centered .forge-craft-selected-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.forge-craft-selected-visual img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.forge-craft-selected-name {
  font-size: 1rem;
  font-weight: 700;
  color: rgba(236, 232, 224, 0.98);
}

.forge-craft-selected-cat {
  font-size: 0.82rem;
  color: rgba(211, 176, 111, 0.85);
  margin: 2px 0 4px;
}

.forge-craft-materials {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.forge-craft-material-slot-wrap {
  position: relative;
  min-width: 0;
}

.forge-craft-material-slot {
  width: 100%;
  min-height: 88px;
  border-radius: 10px;
  border: 1px dashed rgba(154, 164, 176, 0.42);
  background: rgba(10, 12, 16, 0.55);
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  font: inherit;
  color: rgba(168, 176, 188, 0.9);
  text-align: center;
  box-sizing: border-box;
}

.forge-craft-material-img-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.forge-craft-material-slot--filled {
  border-style: solid;
  border-color: rgba(154, 164, 176, 0.35);
  color: inherit;
}

.forge-craft-material-placeholder {
  font-size: 0.72rem;
  line-height: 1.2;
}

.forge-craft-material-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.forge-craft-material-plus {
  font-size: 0.68rem;
  font-weight: 700;
  color: rgba(236, 205, 140, 0.95);
}

.forge-craft-material-name {
  font-size: 0.64rem;
  line-height: 1.15;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forge-craft-material-clear {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: rgba(20, 24, 32, 0.92);
  color: rgba(200, 206, 216, 0.9);
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.forge-craft-picker {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 6;
  max-height: 180px;
  overflow-y: auto;
  border-radius: 10px;
  border: 1px solid var(--ui-elevated-border, rgba(154, 164, 176, 0.35));
  background: var(--ui-elevated-bg, rgba(12, 14, 20, 0.98));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  padding: 4px;
}

.forge-craft-picker-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.forge-craft-picker-item:hover {
  background: rgba(211, 176, 111, 0.1);
}

.forge-craft-picker-name {
  flex: 1 1 auto;
  font-size: 0.76rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forge-craft-picker-plus {
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(236, 205, 140, 0.95);
}

.forge-craft-picker-empty {
  margin: 6px;
  font-size: 0.76rem;
}

.forge-craft-cost {
  margin: 0;
  font-size: 0.8rem;
}

.forge-craft-btn-cost {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 12px;
  margin: 0 0 6px;
}

.forge-craft-cost-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(236, 232, 224, 0.95);
}

.forge-craft-cost-icon {
  width: 1.125rem;
  height: 1.125rem;
  object-fit: contain;
}

.forge-craft-btn {
  width: 100%;
  margin-top: 0;
}

.forge-craft-empty {
  margin: 0;
}

@media (max-width: 720px) {
  .forge-workbench {
    grid-template-columns: 1fr;
  }

  .forge-gear-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .forge-craft-target-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .forge-craft-materials {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .forge-gear-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .forge-craft-target-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ——— Рыбалка (фарм) ——— */
.stub.farm-stub--fishing {
  padding-top: 8px;
  padding-bottom: 18px;
}

.stub.farm-stub--fishing-loc-picker {
  position: relative;
  padding-top: 6px;
}

.fishing-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.fishing-header-row--session .fishing-header-title {
  padding-right: 48px;
}

.fishing-header-title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

.fishing-close-std {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.fishing-header-row--loc-picker {
  position: absolute;
  top: 2px;
  right: 0;
  justify-content: flex-end;
  margin-bottom: 0;
  z-index: 2;
}

.fishing-xp-block {
  margin: 0 0 10px;
  padding-right: 42px;
}

.fishing-xp-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.fishing-xp-icon {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.fishing-xp-body {
  flex: 1 1 auto;
  min-width: 0;
  max-width: min(100%, 300px);
}

.fishing-xp-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: #e8ebef;
  line-height: 1.25;
  margin-bottom: 6px;
}

.fishing-xp-bar-row {
  margin: 0;
}

.fishing-xp-bar {
  height: 10px;
  max-width: 100%;
  background: rgba(38, 30, 18, 0.72);
  border-radius: 6px;
  overflow: hidden;
}

.fishing-xp-fill {
  height: 100%;
  background: linear-gradient(90deg, #b98d3d 35%, #efd9a0 100%);
  border-radius: 6px;
  transition: width 0.35s ease;
}

.fishing-xp-stats {
  margin: 6px 0 0;
  font-size: 0.8rem;
  line-height: 1.35;
  color: rgba(236, 240, 248, 0.78);
}

.fishing-loc-list {
  margin-top: 0;
}

.explore-loc-btn.fishing-loc-btn {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  text-align: left;
  gap: 12px;
  padding: 10px 12px;
  width: 100%;
  box-sizing: border-box;
}

.fishing-hole-image-wrap {
  position: relative;
  width: min(100%, 480px);
  margin: 8px auto 12px;
  line-height: 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--ui-panel-border, rgba(154, 164, 176, 0.28));
  background: rgba(8, 12, 18, 0.55);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.fishing-hole-image-wrap--ch1-done {
  opacity: 0.92;
}

.fishing-hole-field-bg {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: top;
}

.fishing-hole-pick,
.fishing-hole-pick-frozen {
  position: absolute;
  left: var(--hole-x, 50%);
  top: var(--hole-y, 50%);
  transform: translate(-50%, -50%);
  width: 104px;
  height: 104px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  z-index: 2;
}

.fishing-hole-pick-frozen {
  pointer-events: none;
  opacity: 0.85;
}

.fishing-hole-pick--selected .fishing-hole-spot-img {
  filter: drop-shadow(0 0 10px rgba(239, 217, 160, 0.95)) brightness(1.08);
  transform: scale(1.06);
}

.fishing-hole-spot-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.fishing-hole-pick:active:not(:disabled) .fishing-hole-spot-img {
  transform: scale(0.96);
}

.fishing-hole-cast-wrap {
  display: flex;
  justify-content: center;
  margin: 8px 0 14px;
}

.fishing-bait-block {
  margin-top: 4px;
}

.fishing-bait-rod-row {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.9fr);
  gap: 12px;
  align-items: start;
}

@media (max-width: 560px) {
  .fishing-bait-rod-row {
    grid-template-columns: 1fr;
  }
}

.fishing-bait-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--gold, #d3b06f);
  margin-bottom: 8px;
}

.fishing-equip-grid {
  display: grid;
  gap: 8px;
}

.fishing-equip-grid--baits {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.fishing-equip-grid--rods-modal {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 8px;
}

.fishing-equip-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 8px 6px 10px;
  border-radius: 12px;
  border: 1px solid var(--ui-pill-border, rgba(154, 164, 176, 0.28));
  background: var(--ui-pill-bg, rgba(24, 28, 36, 0.88));
  color: inherit;
  font: inherit;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.fishing-equip-card--selected {
  border-color: var(--ui-selected-line, rgba(211, 176, 111, 0.72));
  box-shadow: 0 0 0 1px rgba(211, 176, 111, 0.35);
}

.fishing-equip-card--no-stock {
  opacity: 0.45;
  cursor: not-allowed;
}

.fishing-equip-card .rarity-tag {
  font-size: 0.68rem;
  padding: 2px 6px;
}

.fishing-equip-img {
  display: block;
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.fishing-bait-icon-slot {
  position: relative;
  width: 44px;
  height: 44px;
}

.fishing-bait-qty-badge {
  position: absolute;
  right: -4px;
  bottom: -2px;
  min-width: 18px;
  padding: 1px 4px;
  border-radius: 8px;
  background: rgba(8, 10, 14, 0.88);
  border: 1px solid rgba(191, 160, 96, 0.45);
  font-size: 0.68rem;
  font-weight: 700;
  color: #f2ece0;
}

.fishing-equip-name {
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 100%;
  font-size: 0.72rem;
  line-height: 1.2;
  color: #e8ebef;
}

.fishing-bait-name-line {
  display: block;
  min-height: 0.85em;
}

.fishing-equip-bonus {
  font-size: 0.68rem;
  margin: 0;
}

.fishing-wait-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  font-size: 0.82rem;
}

.fishing-wait-icon {
  display: inline-flex;
  color: #c9d0da;
}

.fishing-rod-pick-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 10px 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--ui-pill-border, rgba(154, 164, 176, 0.28));
  background: var(--ui-pill-bg, rgba(24, 28, 36, 0.88));
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.fishing-rod-wait-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(8, 10, 14, 0.86);
  border: 1px solid rgba(154, 164, 176, 0.35);
  font-size: 0.66rem;
  font-weight: 600;
  line-height: 1.2;
  color: #c9d0da;
  pointer-events: none;
}

.fishing-rod-wait-badge svg {
  flex-shrink: 0;
}

.fishing-rod-pick-img {
  width: 80px;
  height: 80px;
}

.fishing-rod-pick-hint {
  margin: 0;
  font-size: 0.72rem;
}

.fishing-rod-modal-box {
  width: min(440px, 96vw);
}

.fishing-rod-modal-hint {
  margin: 0 0 8px;
  text-align: center;
}

.fishing-wait-visual {
  position: relative;
  width: min(100%, 420px);
  margin: 8px auto 10px;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--ui-panel-border, rgba(154, 164, 176, 0.28));
  background: rgba(6, 14, 24, 0.75);
}

.fishing-wait-visual--clickable {
  cursor: pointer;
}

.fishing-wait-ripples {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fishing-wait-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(120, 180, 220, 0.22) 0%, transparent 68%);
  pointer-events: none;
  animation: fishing-wait-pulse 2.4s ease-in-out infinite;
}

@keyframes fishing-wait-pulse {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

.fishing-wait-caption {
  text-align: center;
  margin-top: 0;
}

.fishing-countdown {
  text-align: center;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--gold, #d3b06f);
  margin: 4px 0 0;
}

.fishing-loot-overlay {
  z-index: 12300;
}

.fishing-loot-dialog {
  width: min(100%, 360px);
  padding: 0;
  overflow: hidden;
}

.fishing-loot-dialog-head {
  position: relative;
  padding: 10px 12px 8px;
}

.fishing-loot-dialog-title {
  margin: 0;
}

.fishing-loot-close-btn {
  position: relative;
  top: 0;
  right: 0;
}

.fishing-loot-dialog .battle-outcome-body {
  padding: 0 16px 16px;
  margin: 0;
}

.battle-outcome-line--fishing-xp {
  color: #efd9a0;
}

.battle-outcome-fishing-xp-icon {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.fishing-catch-reveal-overlay {
  position: fixed;
  inset: 0;
  z-index: 12400;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: rgba(4, 8, 14, 0.35);
}

.fishing-catch-reveal-overlay--inline {
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
}

.fishing-catch-reveal-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-radius: 16px;
  background: rgba(12, 16, 22, 0.88);
  border: 1px solid rgba(211, 176, 111, 0.45);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  animation: fishing-catch-pop 0.35s ease-out;
}

@keyframes fishing-catch-pop {
  from {
    opacity: 0;
    transform: scale(0.82);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.fishing-catch-reveal-img {
  width: 120px;
  height: 120px;
  object-fit: contain;
}

.fishing-catch-reveal-name {
  font-weight: 700;
  color: #f2ece0;
  text-align: center;
}

/* ===== Наличие карточек (прогресс по рангам) ===== */
.card-presence-root {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-presence-head {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  gap: 4px;
}

.card-presence-back {
  justify-self: start;
}

.card-presence-title {
  margin: 0;
  text-align: center;
}

.card-presence-head-spacer {
  width: 42px;
  height: 1px;
}

.card-presence-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.card-presence-row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 8px 10px;
  padding: 8px 10px;
  border-radius: var(--ui-panel-radius, 12px);
  border: 1px solid var(--ui-panel-border, rgba(154, 164, 176, 0.3));
  background: var(--ui-panel-bg, rgba(20, 22, 28, 0.72));
}

.card-presence-rarity {
  margin: 0;
  justify-self: start;
}

.card-presence-count {
  font-size: 0.84rem;
  font-weight: 700;
  color: rgba(232, 236, 242, 0.92);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.card-presence-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  min-width: 0;
}

.card-presence-fill {
  height: 100%;
  border-radius: inherit;
  min-width: 0;
  transition: width 0.25s ease;
}

.card-presence-fill--common {
  background: linear-gradient(90deg, rgba(198, 206, 217, 0.55), #c6ced9);
}

.card-presence-fill--uncommon {
  background: linear-gradient(90deg, rgba(136, 207, 143, 0.55), #88cf8f);
}

.card-presence-fill--rare {
  background: linear-gradient(90deg, rgba(127, 177, 255, 0.55), #7fb1ff);
}

.card-presence-fill--epic {
  background: linear-gradient(90deg, rgba(197, 141, 255, 0.55), #c58dff);
}

.card-presence-fill--legendary {
  background: linear-gradient(90deg, rgba(255, 205, 115, 0.55), #ffcd73);
}

.card-presence-fill--mythic {
  background: linear-gradient(90deg, rgba(255, 107, 107, 0.55), #ff6b6b);
}

.card-presence-track--common {
  box-shadow: inset 0 0 0 1px rgba(198, 206, 217, 0.18);
}

.card-presence-track--uncommon {
  box-shadow: inset 0 0 0 1px rgba(136, 207, 143, 0.2);
}

.card-presence-track--rare {
  box-shadow: inset 0 0 0 1px rgba(127, 177, 255, 0.2);
}

.card-presence-track--epic {
  box-shadow: inset 0 0 0 1px rgba(197, 141, 255, 0.2);
}

.card-presence-track--legendary {
  box-shadow: inset 0 0 0 1px rgba(255, 205, 115, 0.22);
}

.card-presence-track--mythic {
  box-shadow: inset 0 0 0 1px rgba(255, 107, 107, 0.22);
}

.card-presence-bonuses {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: var(--ui-panel-radius, 12px);
  border: 1px solid var(--ui-panel-border, rgba(154, 164, 176, 0.3));
  background: var(--ui-panel-bg, rgba(20, 22, 28, 0.72));
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-presence-bonuses-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.card-presence-bonuses-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--ui-panel-title, rgba(236, 240, 246, 0.95));
}

.card-presence-bonuses-bm {
  font-size: 0.84rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--gold, #d4b45a);
  white-space: nowrap;
}

.card-presence-bonuses-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-presence-bonus-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 0 0;
  border-top: 1px solid rgba(154, 164, 176, 0.18);
}

.card-presence-bonus-row:first-child {
  border-top: none;
  padding-top: 0;
}

.card-presence-bonus-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-presence-bonus-count {
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: rgba(232, 236, 242, 0.88);
  white-space: nowrap;
}

.card-presence-piece-meter {
  min-width: 0;
}

.card-presence-piece-groups {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  width: 100%;
  overflow-x: auto;
  padding-bottom: 2px;
}

.card-presence-piece-group {
  flex: 2 1 0;
  min-width: 2.2rem;
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: stretch;
}

.card-presence-piece-group--set {
  flex: 1.35 1 0;
  min-width: 3.2rem;
}

.card-presence-piece-label {
  display: block;
  text-align: center;
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.01em;
  color: rgba(180, 190, 204, 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-presence-piece-group--set .card-presence-piece-label {
  font-size: 0.54rem;
}

.card-presence-piece-label--on,
.card-presence-piece-group--done .card-presence-piece-label {
  color: var(--gold, #d4b45a);
}

.card-presence-piece-cells {
  display: grid;
  gap: 2px;
  min-height: 10px;
}

.card-presence-piece-cell {
  height: 10px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(154, 164, 176, 0.16);
}

.card-presence-piece-cell.is-filled {
  box-shadow: none;
}

.card-presence-piece-cell--common.is-filled {
  background: linear-gradient(180deg, rgba(198, 206, 217, 0.75), #c6ced9);
}

.card-presence-piece-cell--uncommon.is-filled {
  background: linear-gradient(180deg, rgba(136, 207, 143, 0.75), #88cf8f);
}

.card-presence-piece-cell--rare.is-filled {
  background: linear-gradient(180deg, rgba(127, 177, 255, 0.75), #7fb1ff);
}

.card-presence-piece-cell--epic.is-filled {
  background: linear-gradient(180deg, rgba(197, 141, 255, 0.75), #c58dff);
}

.card-presence-piece-cell--legendary.is-filled {
  background: linear-gradient(180deg, rgba(255, 205, 115, 0.75), #ffcd73);
}

.card-presence-piece-cell--mythic.is-filled {
  background: linear-gradient(180deg, rgba(255, 107, 107, 0.75), #ff6b6b);
}

.card-presence-piece-cell.is-set-done.is-filled {
  box-shadow: 0 0 0 1px rgba(212, 180, 90, 0.4);
}

/* ===== Объединение карточек ===== */
.card-fusion-root {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-fusion-back {
  top: 0;
  right: 0;
}

.card-fusion-title {
  margin: 0 0 4px;
  text-align: center;
  padding-right: 42px;
  box-sizing: border-box;
}

.card-fusion-pane {
  align-items: center;
}

.card-fusion-hint {
  text-align: center;
  max-width: 36rem;
}

.card-fusion-crest-wrap {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  margin: 4px auto 12px;
  z-index: 0;
  overflow: visible;
}

.card-fusion-glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(320px, 88vw);
  height: min(420px, 70vh);
  transform: translate(-50%, -50%);
  border-radius: 16px;
  opacity: 0;
  pointer-events: none;
  z-index: 0;
  filter: blur(8px);
  mix-blend-mode: screen;
  transition: opacity 0.25s ease;
}

.card-fusion-crest-img {
  position: relative;
  z-index: 1;
  display: block;
  width: min(220px, 62vw);
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  transition: filter 0.35s ease;
}

.card-fusion-crest-wrap--white .card-fusion-glow {
  opacity: 1;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(240, 244, 255, 0.55) 28%,
    rgba(200, 210, 230, 0.18) 58%,
    transparent 78%
  );
  animation: card-fusion-white-pulse 3s ease-in-out forwards;
}

.card-fusion-crest-wrap--white .card-fusion-crest-img {
  filter: drop-shadow(0 0 18px rgba(255, 255, 255, 0.95)) drop-shadow(0 0 42px rgba(230, 236, 255, 0.75));
}

.card-fusion-crest-wrap--gold .card-fusion-glow {
  opacity: 1;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 230, 160, 0.95) 0%,
    rgba(212, 168, 72, 0.62) 30%,
    rgba(160, 110, 40, 0.2) 62%,
    transparent 80%
  );
  animation: card-fusion-result-pulse 1.5s ease-in-out forwards;
}

.card-fusion-crest-wrap--gold .card-fusion-crest-img {
  filter: drop-shadow(0 0 22px rgba(255, 214, 120, 0.95)) drop-shadow(0 0 52px rgba(212, 168, 55, 0.75));
}

.card-fusion-crest-wrap--red .card-fusion-glow {
  opacity: 1;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 120, 120, 0.92) 0%,
    rgba(200, 50, 50, 0.55) 32%,
    rgba(120, 20, 20, 0.18) 62%,
    transparent 80%
  );
  animation: card-fusion-result-pulse 1.5s ease-in-out forwards;
}

.card-fusion-crest-wrap--red .card-fusion-crest-img {
  filter: drop-shadow(0 0 22px rgba(255, 100, 100, 0.95)) drop-shadow(0 0 48px rgba(180, 40, 40, 0.72));
}

@keyframes card-fusion-white-pulse {
  0%,
  100% {
    opacity: 0.75;
    transform: translate(-50%, -50%) scale(0.96);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.04);
  }
}

@keyframes card-fusion-result-pulse {
  0%,
  100% {
    opacity: 0.82;
    transform: translate(-50%, -50%) scale(0.98);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.05);
  }
}

.card-fusion-auto-meta {
  margin: 0 0 6px;
  text-align: center;
  color: rgba(211, 176, 111, 0.88);
  font-size: 0.82rem;
}

.card-fusion-workbench {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}

.card-fusion-materials {
  margin-top: 4px;
}

.card-fusion-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  column-gap: 8px;
  width: 100%;
  margin-top: 10px;
  min-height: 40px;
}

.card-fusion-pity {
  justify-self: start;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}

.card-fusion-pity-row {
  margin: 0;
  padding: 2px 4px;
  border: none;
  border-radius: 8px;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: default;
  font: inherit;
  color: inherit;
  line-height: 1.2;
  opacity: 0.88;
}

.card-fusion-pity-row:disabled {
  cursor: default;
  opacity: 0.88;
}

.card-fusion-pity-row--ready {
  cursor: pointer;
  opacity: 1;
  box-shadow: 0 0 0 1px rgba(211, 176, 111, 0.45);
  background: rgba(211, 176, 111, 0.1);
}

.card-fusion-pity-row--ready:hover:not(:disabled) {
  background: rgba(211, 176, 111, 0.18);
}

.card-fusion-pity-count {
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(220, 224, 230, 0.92);
  white-space: nowrap;
}

.card-fusion-fuse-cluster {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.card-fusion-btn {
  display: inline-flex;
  align-items: center;
  width: auto;
  min-width: 0;
  margin-top: 0;
  padding: 7px 14px;
  font-size: 0.82rem;
}

.card-fusion-count {
  flex: 0 0 auto;
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1;
  color: var(--gold, #e9d4a3);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.card-fusion-auto-btn {
  justify-self: end;
  align-self: center;
  min-width: 0;
  width: auto;
  margin: 0;
  padding: 7px 12px;
  font-size: 0.82rem;
}

.card-fusion-result-modal .card-fusion-result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 16px;
  max-height: min(62vh, 560px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 2px 2px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--ui-scrollbar-thumb) var(--ui-scrollbar-track);
}

.card-fusion-result-modal .card-fusion-result-grid > * {
  min-width: 0;
  width: auto;
  flex: none;
}

.card-fusion-result-tile {
  position: relative;
  min-height: 0;
  align-items: stretch;
  padding-bottom: 6px;
}

.card-fusion-result-icon-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  width: 100%;
}

.card-fusion-result-icon-row .summon-drop-icon {
  grid-column: 2;
  justify-self: center;
}

.card-fusion-result-qty {
  grid-column: 3;
  justify-self: start;
  margin-left: 4px;
  font-weight: 800;
  font-size: 0.78rem;
  color: #e9d4a3;
  line-height: 1;
  white-space: nowrap;
}

.card-fusion-result-modal .card-fusion-result-tile .summon-drop-label {
  display: block;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

.card-fusion-result-tile .rarity-tag {
  margin-left: 0;
  align-self: center;
}

.card-fusion-result-badge {
  display: block;
  margin-top: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.15;
}

.card-fusion-result-badge--success {
  color: rgba(255, 214, 120, 0.95);
}

.card-fusion-result-badge--fail {
  color: rgba(255, 130, 130, 0.92);
}

.card-fusion-result-modal .quest-reward-claim-box {
  max-width: min(560px, 96vw);
  width: min(560px, 96vw);
}

.card-fusion-result-modal .card-preview-box {
  position: relative;
}

.card-fusion-result-modal .card-fusion-result-close {
  top: 8px;
  right: 10px;
  z-index: 3;
}

.card-fusion-picker {
  z-index: 12;
  overflow: visible;
  max-height: none;
}

.card-fusion-picker-rarities {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 6px 4px;
  border-bottom: 1px solid rgba(154, 164, 176, 0.18);
}

.card-fusion-picker-rarity {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 6px;
  border-radius: 999px;
  border: 1px solid var(--ui-pill-line, rgba(120, 124, 132, 0.55));
  background: var(--ui-pill-bg, rgba(36, 38, 44, 0.92));
  color: var(--ui-pill-text, rgba(210, 212, 218, 0.95));
  cursor: pointer;
}

.card-fusion-picker-rarity:hover:not(:disabled) {
  background: var(--ui-pill-bg-active, rgba(52, 54, 60, 0.95));
}

.card-fusion-picker-rarity--active {
  border-color: var(--ui-pill-line-active, rgba(150, 154, 162, 0.75));
  background: var(--ui-pill-bg-active, rgba(52, 54, 60, 0.95));
  box-shadow: 0 0 0 1px var(--ui-selected-line, rgba(212, 180, 90, 0.45));
}

.card-fusion-picker-rarity:disabled {
  opacity: 0.55;
  cursor: default;
}

.card-fusion-picker-cards {
  max-height: 160px;
  overflow-y: auto;
  padding: 4px;
}

.card-fusion-picker-preview {
  position: absolute;
  left: calc(100% + 8px);
  top: 0;
  z-index: 20;
  width: 150px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--ui-elevated-border, rgba(154, 164, 176, 0.35));
  background: var(--ui-elevated-bg, rgba(12, 14, 20, 0.98));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.card-fusion-picker-preview-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.card-fusion-picker-preview-img--empty {
  min-height: 120px;
}

.card-fusion-picker-preview-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.card-fusion-picker-preview-name {
  font-size: 0.78rem;
  line-height: 1.25;
  color: rgba(236, 240, 246, 0.96);
}

.card-fusion-picker-preview-rarity {
  align-self: flex-start;
}

.card-fusion-picker-preview-meta {
  font-size: 0.7rem;
  line-height: 1.3;
  color: rgba(180, 190, 204, 0.88);
}

@media (max-width: 720px) {
  .card-fusion-picker-preview {
    left: 8px;
    right: 8px;
    top: auto;
    bottom: calc(100% + 8px);
    width: auto;
    flex-direction: row;
    align-items: center;
  }

  .card-fusion-picker-preview-img {
    width: 56px;
    flex: 0 0 auto;
    aspect-ratio: 3 / 4;
  }
}

/* Гильдейский рейд: кнопка способностей босса (i в круге) */
.battle-panel-label--with-info {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: nowrap;
}

.boss-ability-info-btn {
  box-sizing: border-box;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(201, 208, 218, 0.75);
  background: rgba(12, 16, 24, 0.45);
  color: var(--muted, #c9d0da);
  font-size: 0.78rem;
  font-weight: 700;
  font-style: italic;
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
}

.boss-ability-info-btn:hover,
.boss-ability-info-btn:focus-visible {
  border-color: var(--gold, #d3b06f);
  color: var(--gold, #d3b06f);
  outline: none;
}

.guild-raid-turn-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  width: 100%;
  margin: 0 0 8px;
}

.guild-raid-turn-bar .guild-raid-turn-hint {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.guild-raid-alive-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  margin-left: auto;
}

.guild-raid-alive-count {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--gold, #d3b06f);
  white-space: nowrap;
}

.guild-raid-roster-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  gap: 6px;
  max-height: min(50vh, 360px);
  overflow: auto;
}

.guild-raid-roster-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(8, 10, 14, 0.35);
  border: 1px solid rgba(154, 164, 176, 0.22);
}

.guild-raid-roster-nick {
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guild-raid-roster-status {
  flex: 0 0 auto;
  font-size: 0.82rem;
  color: rgba(180, 210, 170, 0.95);
}

.guild-raid-roster-status--down {
  color: rgba(220, 150, 140, 0.95);
}

.guild-raid-roster-row--empty {
  justify-content: center;
  color: var(--muted, #c9d0da);
}

