/* ================================================================
   TANKNEXUS — Tanks Block styles
   ================================================================ */

/* ── Общий контейнер ─────────────────────────────────────────── */
.lot-tanks-block {
  max-width: var(--max-width, 1280px);
  display: flex;
  flex-direction: column;
  gap: 36px;
  padding-top: 0px;
}

/* ── Обёртка: счётчики танков + ресурсы (визуально единый блок) ─ */
.tb-info-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── Блок (техника / ресурсы) ────────────────────────────────── */
.tanks-block {
  display: flex;
  flex-direction: column;
}

/* ── Общий заголовок блока ───────────────────────────────────── */
.tb-block-header {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #e4e4e4;
  padding: 6px 14px 5px;
  /*background: linear-gradient(90deg, #242831, transparent 70%);*/
  border-radius: 10px 10px 0 0;
}

/* ── Секция (Прем 8-9 / Т10 / Прем 5-7) ─────────────────────── */
.tanks-section {
  display: flex;
  flex-direction: column;
}

/* Разделитель между секциями внутри премиум-блока */
/*.tanks-block--premium .tanks-section + .tanks-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 0px solid rgba(255,255,255,0.06);
}
*/
.tanks-section-body {
  /*background: linear-gradient(90deg, #1a1c21, transparent 70%);*/
  border-radius: 0 0 14px 14px;
  padding: 0px 4px;
  overflow: hidden;
  transition: padding 0.25s ease;
}

/* Промежуточные секции — без нижних скруглений */
.tanks-section:not(:last-child) .tanks-section-body {
  border-radius: 0;
}

/* ── Ряд иконок ──────────────────────────────────────────────── */
.tanks-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 9px;
}

/* ── Отдельный танк ──────────────────────────────────────────── */
.tank-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0px;
  cursor: pointer;
  padding: 6px;
  border-radius: 16px;
  border: 1px solid transparent;
  transition: border-color 0.15s, background 0.15s;
  min-width: 94px;
  max-width: 94px;
  text-align: center;
  user-select: none;
  -webkit-user-select: none;
}

.tank-name {
  user-select: text;
  -webkit-user-select: text;
}

.tank-item:hover {
  background: var(--hover-bg, rgba(255,255,255,0.05));
}

.tank-item--active {
  border-color: rgb(255 255 255 / 4%);
  background: var(--hover-bg, rgba(255,255,255,0.05));
}

/* ── Иконка танка ────────────────────────────────────────────── */
.tank-icon-wrap {
  width: 112px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  position: relative;
}

.tank-icon {
  max-width: 120px;
  max-height: 80px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  filter: brightness(1.3) contrast(1.03);
  pointer-events: none;
}

.tank-icon--missing {
  width: 44px;
  height: 36px;
  border-radius: 6px;
  background: var(--border, rgba(255,255,255,0.08));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--text-muted, #888);
}

/* ── Строка с именем и уровнем ───────────────────────────────── */
.tank-name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-wrap: wrap;
}

/* ── Название танка ──────────────────────────────────────────── */
.tank-name {
  font-size: 12px;
  line-height: 1.3;
  color: var(--text-secondary, #aaa);
  word-break: keep-all;
  hyphens: auto;
}

.tank-item--active .tank-name {
  color: var(--text, #eee);
}

/* ── Бейдж уровня (как в фильтре) ───────────────────────────── */
.tb-tier-badge {
  display: flex;
  font-size: 12px;
  font-weight: 600;
  color: #9b9b9b;
  border-radius: 20px;
  padding: 3px 0px;
  background: #ffffff14;
  flex-shrink: 0;
  line-height: 1;
  position: absolute;
  margin: 0px 0px 163px -62px;
  width: 24px;
  justify-content: center;
}

.tb-tier-badge[data-tier="8"],
.tb-tier-badge[data-tier="9"] {
  background: rgb(21 124 255);
  color: #ffffff;
}

/* Раритетные десятки: корона вместо плашки уровня.
   Размер/положение короны легко настраиваются через переменные ниже —
   --rare-crown-w/h задают размер, --rare-crown-x/y смещение от центра. */
.tb-tier-badge.tb-tier-badge--rare {
  background: none;
  overflow: visible;
  color: #000000;
  --rare-crown-w: 23px;
  --rare-crown-h: 31px;
  --rare-crown-x: 0px;
  --rare-crown-y: -2px;
  font-size: 10px;
  font-weight: 800;
}

.tb-tier-badge__crown {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--rare-crown-w);
  height: var(--rare-crown-h);
  transform: translate(-50%, -50%) translate(var(--rare-crown-x), var(--rare-crown-y));
  color: #FFD200;
  pointer-events: none;
  z-index: 0;
  filter: drop-shadow(6px 4px 18px #FFD200) drop-shadow(0px 0px 3px #FFD200);
}

.tb-tier-badge__crown svg,
.tb-tier-badge__crown img {
  width: 100%;
  height: 100%;
  display: block;
}

.tb-tier-badge__num {
  position: relative;
  z-index: 1;
}

/* ── Панель описания (раскрывается по клику) ─────────────────── */
.tank-desc-panel {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--bg-subtle, rgba(255,255,255,0.04));
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary, #bbb);
  border-left: 3px solid var(--accent, #f0a500);
  animation: fadeInDown 0.2s ease;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Блок ресурсов ───────────────────────────────────────────── */
.tb-resources-body {
  /*background: linear-gradient(90deg, #1a1c21, transparent 70%);*/
  border-radius: 0px 0px 0px 0px;
  padding: 0px 0px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
}

.tb-resources-block .tb-resources-body {
  padding: 0px 0px;
}

.tb-resource-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 0px 10px;
  border-radius: 8px;
  /*background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);*/
}

.tb-resource-icon {
  width: 60px;
  height: 60px;
  object-fit: contain;
  flex-shrink: 0;
}

.tb-resource-icon--camo {
  width: 88px;
  height: 66px;
}

.tb-resource-icon--boosters {
  width: 66px;
  height: 51px;
}

.tb-resource-icon--premtank {
margin: 0px 0px 0px -10px;
}

.tb-resource-icon--bonds {
  width: 80px;
  height: 80px;
  margin: 0px -12px 0px -16px;
  filter: drop-shadow(21px 2px 20px #8a01f4);
}

.tb-resource-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tb-resource-name {
  font-size: 10px;
  color: var(--text-muted, #888);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  z-index: 1;
}

.tb-resource-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text, #eee);
  z-index: 1;
}

/* ================================================================
   Карточка-витрина танка (десктоп) — всегда видимое продающее
   описание слева от lot-tanks-block.
   ================================================================ */

/* Ряд: карточка + блок техники. Высота карточки автоматически
   совпадает с высотой lot-tanks-block, т.к. это flex-row и оба
   элемента растягиваются на высоту самого высокого (align-items: stretch). */
.lot-showcase-row {
  display: flex;
  align-items: flex-start;
  gap: 50px;
  max-width: var(--max-width, 1280px);
  margin-bottom: 50px;
}

.lot-showcase-row .lot-tanks-block {
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
}

.tank-showcase {
  flex: 0 0 440px;
  max-width: 440px;
  border-radius: 50px;
  border: 0px solid rgba(255,255,255,0.08);
  background: linear-gradient(135deg, rgb(2 65 89 / 100%) 0%, rgb(124 164 202) 100%);
  padding: 32px 34px;
  overflow: hidden;
  position: relative;
  /* Высота выставляется через JS (syncShowcaseHeight) по фактической
     высоте lot-tanks-block — так описание скроллится внутри карточки
     вместо того, чтобы раздувать её и тащить за собой блок танков. */
  box-sizing: border-box;
}

.tsc-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

/* Стаггер-анимация смены танка: слайд вправо с исчезанием при уходе,
   слайд из левой позиции с появлением при входе. Порядок каскада —
   название → описание → иконка — задаётся через transition-delay. */
.tsc-header,
.tsc-desc,
.tsc-icon-wrap {
  opacity: 1;
  transform: translateX(0);
}

.tsc-anim-leave .tsc-header,
.tsc-anim-leave .tsc-desc,
.tsc-anim-leave .tsc-icon-wrap {
  transition: opacity 0.16s cubic-bezier(0.4, 0, 1, 1),
              transform 0.16s cubic-bezier(0.4, 0, 1, 1);
}

.tsc-anim-enter .tsc-header,
.tsc-anim-enter .tsc-desc,
.tsc-anim-enter .tsc-icon-wrap {
  transition: opacity 0.2s cubic-bezier(0, 0, 0.2, 1),
              transform 0.2s cubic-bezier(0, 0, 0.2, 1);
}

.tsc-anim-leave .tsc-header    { transition-delay: 0ms;   }
.tsc-anim-leave .tsc-icon-wrap { transition-delay: 40ms;  }
.tsc-anim-leave .tsc-desc      { transition-delay: 80ms;  }

.tsc-anim-leave .tsc-header,
.tsc-anim-leave .tsc-desc,
.tsc-anim-leave .tsc-icon-wrap {
  opacity: 0;
  transform: translateX(24px);
}

.tsc-anim-enter .tsc-header    { transition-delay: 0ms;   }
.tsc-anim-enter .tsc-icon-wrap { transition-delay: 40ms;  }
.tsc-anim-enter .tsc-desc      { transition-delay: 80ms;  }

.tsc-anim-enter .tsc-header,
.tsc-anim-enter .tsc-desc,
.tsc-anim-enter .tsc-icon-wrap {
  opacity: 1;
  transform: translateX(0);
}

/* Стартовая позиция для входящего контента — выставляется мгновенно,
   без transition, чтобы затем анимированно "въехать" в .tsc-anim-enter */
.tsc-anim-enter-start .tsc-header,
.tsc-anim-enter-start .tsc-desc,
.tsc-anim-enter-start .tsc-icon-wrap {
  transition: none !important;
  opacity: 0;
  transform: translateX(-24px);
}

.tsc-header {
  text-align: left;
}

.tsc-name {
  font-size: 32px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.tsc-meta {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #ffffff80;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tsc-icon-wrap {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  padding: 4px 0 10px 0;
}

.tsc-icon {
  max-width: 100%;
  max-height: 300px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: brightness(1.15) contrast(1.05);
  pointer-events: none;
}

.tsc-icon--missing {
  width: 64px;
  height: 52px;
  border-radius: 8px;
  background: var(--border, rgba(255,255,255,0.08));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--text-muted, #888);
}

.tsc-desc {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tsc-desc-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #ffffff;
  margin-bottom: 8px;
  flex: 0 0 auto;
}

.tsc-desc-text {
  font-size: 14px;
  line-height: 1.6;
  color: #b4cbdd;
  overflow-y: auto;
  padding-right: 6px;
  /* Тонкий скролл, не перегружающий карточку визуально */
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.18) transparent;
}

.tsc-desc-text::-webkit-scrollbar {
  width: 5px;
}

.tsc-desc-text::-webkit-scrollbar-track {
  background: transparent;
}

.tsc-desc-text::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.18);
  border-radius: 3px;
}

/* Ниже 860px карточка-витрина скрыта — на планшете/мобиле остаётся
   прежнее поведение: описание раскрывается по клику в панели. */
@media (max-width: 860px) {
  .lot-showcase-row {
    display: block;
  }
  .tank-showcase {
    display: none;
  }
}

/* ── Адаптив ─────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .lot-tanks-block {
    padding: 10px 0px 0px 0px;
  }
  .tanks-section-body {
    padding: 10px 6px 10px 12px;
  }
  .tb-resources-body {
    padding: 0px 14px;
    gap: 0px 0px;
  }
  .tb-resource-value {
    font-size: 14px;
  }
  .tanks-row {
    gap: 8px 0px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    justify-items: start;
  }
  .tank-item {
    min-width: 80px;
    max-width: 88px;
    padding: 0px;
    gap: 10px;
  }
  .tank-icon-wrap {
    width: 40px;
    height: 50px;
  }
  .tank-icon {
    max-width: 100px;
    max-height: 80px;
  }
  .tb-resource-item {
    min-width: 60px;
    padding: 4px 6px;
    gap: 4px;
  }
  .tb-resource-icon {
    width: 60px;
    height: 60px;
  }
  .tb-resource-icon--camo {
    width: 74px;
    height: 56px;
  }
  .tb-resource-icon--bonds {
    width: 80px;
    height: 80px;
    margin: -12px
  }
  .tb-resource-icon--boosters{
    margin: 0px 0px 0px -6px;
  }
  /* Бейдж уровня на мобилке */
  .tb-tier-badge {
    margin: 0px 0px 130px -54px;
    padding: 2px 0px;
    width: 22px;
  }
  .tb-resources-block .tb-resources-body {
    padding: 0px 20px 0px 10px;
    gap: 0px 0px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    justify-items: start;
  }
}
