/* ═══════════════════════════════════════════════════════════════
   /itm/balls/balls.css — Система баллов (H1)
   ═══════════════════════════════════════════════════════════════ */

/* ─── Плашка в шапке ─── */
.h1-balls-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-2, rgba(255,255,255,.06));
  border: 1px solid var(--border, rgba(255,255,255,.1));
  color: var(--text-primary, #fff);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background .15s, transform .1s;
  user-select: none;
}
.h1-balls-btn:hover {
  background: var(--surface-3, rgba(255,255,255,.12));
}
.h1-balls-shop-item__icon i {
  font-size: 20px;
  line-height: 1;
}
.h1-balls-btn:active {
  transform: scale(.96);
}
.h1-balls-btn__icon {
  font-size: 16px;
  line-height: 1;
}
.h1-balls-btn__value {
  min-width: 20px;
  text-align: right;
}
.h1-balls-btn__value.is-negative {
  color: #ff5a5a;
}
.h1-balls-btn__value.is-loading {
  opacity: .5;
}

/* ─── Модалка ─── */
.h1-balls-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  animation: ballsFadeIn .18s ease;
}
.h1-balls-modal.open {
  display: flex;
}
@keyframes ballsFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.h1-balls-modal__box {
  width: min(560px, 94vw);
  max-height: 88vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--bg-base, #141418);
  border: 1px solid var(--border, rgba(255,255,255,.1));
  border-radius: var(--radius-lg, 18px);
  box-shadow: 0 24px 64px rgba(0,0,0,.5);
  animation: ballsSlideUp .22s cubic-bezier(.2,.9,.3,1);
}
@keyframes ballsSlideUp {
  from { opacity: 0; transform: translateY(16px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ─── Шапка модалки ─── */
.h1-balls-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,.08));
}
.h1-balls-modal__title {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.h1-balls-modal__close {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-secondary, #aaa);
  cursor: pointer;
  font-size: 18px;
  transition: background .15s, color .15s;
}
.h1-balls-modal__close:hover {
  background: var(--surface-2, rgba(255,255,255,.08));
  color: var(--text-primary, #fff);
}

/* ─── Табы ─── */
.h1-balls-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 14px 0;
  border-bottom: 1px solid var(--border, rgba(255,255,255,.08));
  overflow-x: auto;
  scrollbar-width: none;
}
.h1-balls-tabs::-webkit-scrollbar { display: none; }
.h1-balls-tab {
  flex: 0 0 auto;
  padding: 8px 14px;
  border: none;
  background: transparent;
  color: var(--text-secondary, #aaa);
  font-size: 13px;
  font-weight: 600;
  border-radius: 10px 10px 0 0;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s, background .15s;
  position: relative;
}
.h1-balls-tab:hover {
  color: var(--text-primary, #fff);
  background: var(--surface-2, rgba(255,255,255,.05));
}
.h1-balls-tab.active {
  color: var(--accent, #7c5cff);
}
.h1-balls-tab.active::after {
  content: '';
  position: absolute;
  left: 10px; right: 10px; bottom: 0;
  height: 2px;
  background: var(--accent, #7c5cff);
  border-radius: 2px;
}

/* ─── Контент ─── */
.h1-balls-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  -webkit-overflow-scrolling: touch;
}
.h1-balls-panel { display: none; }
.h1-balls-panel.active { display: block; }

/* ─── Баланс ─── */
.h1-balls-balance {
  text-align: center;
  padding: 12px 0 20px;
}
.h1-balls-balance__num {
  font-size: 44px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -1px;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}
.h1-balls-balance__num.is-negative {
  color: #ff5a5a;
}
.h1-balls-balance__coin {
  font-size: 28px;
}
.h1-balls-balance__label {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-secondary, #999);
}
.h1-balls-balance__level {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-grad, linear-gradient(135deg,#7c5cff,#4b7bec));
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}

/* ─── Прогресс ─── */
.h1-balls-progress {
  margin: 18px 0 6px;
}
.h1-balls-progress__bar {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2, rgba(255,255,255,.08));
  overflow: hidden;
}
.h1-balls-progress__fill {
  height: 100%;
  background: var(--accent-grad, linear-gradient(135deg,#7c5cff,#4b7bec));
  border-radius: 999px;
  transition: width .4s ease;
}
.h1-balls-progress__meta {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-secondary, #999);
}

/* ─── Daily ─── */
.h1-balls-daily {
  margin-top: 20px;
  padding: 16px;
  border-radius: var(--radius, 14px);
  background: var(--surface-2, rgba(255,255,255,.05));
  border: 1px solid var(--border, rgba(255,255,255,.08));
  display: flex;
  align-items: center;
  gap: 14px;
}
.h1-balls-daily__info { flex: 1; }
.h1-balls-daily__title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
}
.h1-balls-daily__sub {
  font-size: 12px;
  color: var(--text-secondary, #999);
}
.h1-balls-btn-primary {
  padding: 9px 18px;
  border: none;
  border-radius: 999px;
  background: var(--accent-grad, linear-gradient(135deg,#7c5cff,#4b7bec));
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: transform .1s, opacity .15s;
}
.h1-balls-btn-primary:hover { opacity: .9; }
.h1-balls-btn-primary:active { transform: scale(.96); }
.h1-balls-btn-primary:disabled {
  opacity: .4;
  cursor: not-allowed;
}

/* ─── Список (топ / история / магазин) ─── */
.h1-balls-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.h1-balls-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius, 12px);
  background: var(--surface-2, rgba(255,255,255,.04));
  border: 1px solid var(--border, rgba(255,255,255,.06));
  transition: background .15s;
}
.h1-balls-item:hover {
  background: var(--surface-3, rgba(255,255,255,.08));
}
.h1-balls-item.is-me {
  border-color: var(--accent, #7c5cff);
  background: rgba(124,92,255,.08);
}
.h1-balls-item__rank {
  width: 26px;
  text-align: center;
  font-weight: 800;
  font-size: 14px;
  color: var(--text-secondary, #999);
}
.h1-balls-item__rank.is-top1 { color: #ffd700; }
.h1-balls-item__rank.is-top2 { color: #c0c0c0; }
.h1-balls-item__rank.is-top3 { color: #cd7f32; }
.h1-balls-item__ava {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  background: var(--surface-2, rgba(255,255,255,.06));
}
.h1-balls-item__body { flex: 1; min-width: 0; }
.h1-balls-item__name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.h1-balls-item__meta {
  font-size: 12px;
  color: var(--text-secondary, #999);
}
.h1-balls-item__value {
  font-weight: 700;
  font-size: 14px;
  color: var(--accent, #7c5cff);
  white-space: nowrap;
}
.h1-balls-item__value.is-negative { color: #ff5a5a; }
.h1-balls-item__value.is-positive { color: #3ddc84; }

/* ─── Магазин ─── */
.h1-balls-shop-item__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: var(--surface-3, rgba(255,255,255,.06));
  flex: 0 0 auto;
}
.h1-balls-shop-item__price {
  font-weight: 700;
  color: var(--accent, #7c5cff);
  font-size: 14px;
  white-space: nowrap;
}

/* ─── Перевод ─── */
.h1-balls-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.h1-balls-input {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius, 12px);
  background: var(--surface-2, rgba(255,255,255,.05));
  border: 1px solid var(--border, rgba(255,255,255,.1));
  color: var(--text-primary, #fff);
  font-size: 14px;
  outline: none;
  transition: border-color .15s;
}
.h1-balls-input:focus {
  border-color: var(--accent, #7c5cff);
}
.h1-balls-label {
  font-size: 12px;
  color: var(--text-secondary, #999);
  margin-bottom: 4px;
  display: block;
}

/* ─── История ─── */
.h1-balls-history__delta {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}
.h1-balls-history__delta.pos { color: #3ddc84; }
.h1-balls-history__delta.neg { color: #ff5a5a; }

/* ─── Скелетон ─── */
.h1-balls-skeleton {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
}
.h1-balls-skeleton__circle {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(90deg, rgba(255,255,255,.05), rgba(255,255,255,.12), rgba(255,255,255,.05));
  background-size: 200% 100%;
  animation: ballsShimmer 1.2s infinite;
}
.h1-balls-skeleton__line {
  flex: 1;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(255,255,255,.05), rgba(255,255,255,.12), rgba(255,255,255,.05));
  background-size: 200% 100%;
  animation: ballsShimmer 1.2s infinite;
}
@keyframes ballsShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Пусто ─── */
.h1-balls-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-secondary, #999);
  font-size: 14px;
}

/* ─── Кнопка "Ещё" ─── */
.h1-balls-more {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 10px;
  border-radius: var(--radius, 12px);
  background: var(--surface-2, rgba(255,255,255,.05));
  border: 1px solid var(--border, rgba(255,255,255,.08));
  color: var(--text-secondary, #aaa);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s;
}
.h1-balls-more:hover {
  background: var(--surface-3, rgba(255,255,255,.1));
  color: var(--text-primary, #fff);
}

/* ─── Светлая тема ─── */
[data-bs-theme="light"] .h1-balls-modal__box {
  background: #fff;
}
[data-bs-theme="light"] .h1-balls-btn {
  background: rgba(0,0,0,.04);
  border-color: rgba(0,0,0,.08);
  color: #111;
}
[data-bs-theme="light"] .h1-balls-btn:hover {
  background: rgba(0,0,0,.08);
}

/* ─── Мобильный ─── */
@media (max-width: 640px) {
  .h1-balls-modal__box {
    width: 100vw;
    max-height: 92vh;
    border-radius: 18px 18px 0 0;
    align-self: flex-end;
  }
  .h1-balls-modal {
    align-items: flex-end;
  }
  .h1-balls-balance__num {
    font-size: 36px;
  }
  .h1-balls-tab {
    font-size: 12px;
    padding: 8px 10px;
  }
  .h1-balls-body {
    padding: 14px;
  }
}

/* ─── Кнопка «Купить» в магазине ─── */
.h1-balls-item .h1-balls-btn-primary {
  padding: 6px 14px;
  font-size: 12px;
  border-radius: 999px;
  min-width: 76px;
}
.h1-balls-item .h1-balls-btn-primary:disabled {
  background: var(--surface-3, rgba(255,255,255,.08));
  color: var(--text-secondary, #888);
  cursor: not-allowed;
}

/* ─── Иконки (bi-*) в магазине ─── */
.h1-balls-shop-item__icon i {
  font-size: 20px;
  line-height: 1;
  color: var(--accent, #7c5cff);
}

/* ─── Промо ─── */
.h1-balls-promo {
  padding: 8px 0;
}
.h1-balls-promo__hero {
  text-align: center;
  padding: 20px 0 24px;
}
.h1-balls-promo__icon {
  font-size: 48px;
  line-height: 1;
  margin-bottom: 12px;
}
.h1-balls-promo__title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 4px;
}
.h1-balls-promo__sub {
  font-size: 13px;
  color: var(--text-secondary, #999);
}
.h1-balls-promo__input {
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
}
.h1-balls-promo__msg {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: var(--radius, 12px);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  min-height: 0;
  transition: all .2s;
}
.h1-balls-promo__msg:empty {
  display: none;
}
.h1-balls-promo__msg.is-success {
  background: rgba(61, 220, 132, .12);
  color: #3ddc84;
  border: 1px solid rgba(61, 220, 132, .3);
}
.h1-balls-promo__msg.is-error {
  background: rgba(255, 90, 90, .12);
  color: #ff5a5a;
  border: 1px solid rgba(255, 90, 90, .3);
}

/* ═══════════════════════════════════════════════════════════════
   Блок «Баллы» в сайдбаре профиля H1
   ═══════════════════════════════════════════════════════════════ */

.bsb {
  padding: 14px 4px 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ─── Цифра баланса ─── */
.bsb__num {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -1px;
  color: var(--text-primary, #fff);
}
.bsb__num.is-negative {
  color: #ff5a5a;
}
.bsb__coin {
  font-size: 22px;
  line-height: 1;
}

/* ─── Уровень ─── */
.bsb__level {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  align-self: center;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--accent-grad, linear-gradient(135deg, #7c5cff, #4b7bec));
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .3px;
}

/* ─── Прогресс ─── */
.bsb__progress {
  padding: 0 4px;
}
.bsb__progress-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2, rgba(255,255,255,.08));
  overflow: hidden;
}
.bsb__progress-fill {
  height: 100%;
  background: var(--accent-grad, linear-gradient(135deg, #7c5cff, #4b7bec));
  border-radius: 999px;
  transition: width .4s ease;
}
.bsb__progress-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  font-size: 11px;
  color: var(--text-secondary, #999);
}

/* ─── Кнопки ─── */
.bsb__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 6px;
}
.bsb__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 12px;
  border: 1px solid var(--border, rgba(255,255,255,.1));
  border-radius: var(--radius, 12px);
  background: var(--surface-2, rgba(255,255,255,.04));
  color: var(--text-primary, #fff);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .1s, border-color .15s;
  font-family: inherit;
}
.bsb__btn:hover {
  background: var(--surface-3, rgba(255,255,255,.08));
}
.bsb__btn:active {
  transform: scale(.97);
}
.bsb__btn--accent {
  background: var(--accent-grad, linear-gradient(135deg, #7c5cff, #4b7bec));
  border-color: transparent;
  color: #fff;
}
.bsb__btn--accent:hover {
  filter: brightness(1.08);
}
.bsb__btn i {
  font-size: 14px;
  line-height: 1;
}

/* ─── Skeleton ─── */
.bsb-skel {
  padding: 14px 4px 6px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}
.bsb-skel__num {
  width: 100px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(255,255,255,.05), rgba(255,255,255,.12), rgba(255,255,255,.05));
  background-size: 200% 100%;
  animation: bsbShimmer 1.2s infinite;
}
.bsb-skel__line {
  width: 130px;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(255,255,255,.05), rgba(255,255,255,.12), rgba(255,255,255,.05));
  background-size: 200% 100%;
  animation: bsbShimmer 1.2s infinite;
}
.bsb-skel__bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,255,255,.05), rgba(255,255,255,.12), rgba(255,255,255,.05));
  background-size: 200% 100%;
  animation: bsbShimmer 1.2s infinite;
}
@keyframes bsbShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Пусто ─── */
.bsb__empty {
  padding: 20px 8px;
  text-align: center;
  color: var(--text-secondary, #999);
  font-size: 13px;
}

/* ─── Светлая тема ─── */
[data-bs-theme="light"] .bsb__btn {
  background: rgba(0,0,0,.04);
  border-color: rgba(0,0,0,.08);
  color: #111;
}
[data-bs-theme="light"] .bsb__btn:hover {
  background: rgba(0,0,0,.08);
}
[data-bs-theme="light"] .bsb__btn--accent {
  background: var(--accent-grad, linear-gradient(135deg, #7c5cff, #4b7bec));
  color: #fff;
}
[data-bs-theme="light"] .bsb__progress-bar {
  background: rgba(0,0,0,.08);
}

/* ─── Активные промокоды ─── */
.h1-balls-promo__active {
  margin-bottom: 18px;
  padding: 14px;
  border-radius: var(--radius, 14px);
  background: var(--surface-2, rgba(255,255,255,.04));
  border: 1px solid var(--border, rgba(255,255,255,.08));
}
.h1-balls-promo__active-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary, #999);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 10px;
}
.h1-balls-promo__active-title i {
  color: #ffd700;
  font-size: 14px;
}

.h1-balls-promo__codes {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.h1-balls-promo__code {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius, 12px);
  background: var(--bg-base, #0e0e11);
  border: 1px solid var(--border, rgba(255,255,255,.08));
  color: var(--text-primary, #fff);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s;
  text-align: left;
  width: 100%;
}
.h1-balls-promo__code:hover {
  background: var(--surface-3, rgba(255,255,255,.06));
  border-color: var(--accent, #7c5cff);
}
.h1-balls-promo__code:active {
  transform: scale(.98);
}
.h1-balls-promo__code-name {
  flex: 1;
  font-weight: 700;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  letter-spacing: 1px;
  color: var(--accent, #7c5cff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.h1-balls-promo__code-delta {
  font-weight: 700;
  color: #3ddc84;
  white-space: nowrap;
}
.h1-balls-promo__code-left {
  font-size: 11px;
  color: var(--text-secondary, #888);
  white-space: nowrap;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2, rgba(255,255,255,.06));
}

/* ─── Скелетон списка ─── */
.h1-balls-promo__list-skel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 0;
}
.h1-balls-promo__list-skel .h1-balls-skeleton {
  padding: 8px 10px;
}

/* ─── Светлая тема ─── */
[data-bs-theme="light"] .h1-balls-promo__code {
  background: #fff;
  border-color: rgba(0,0,0,.08);
}
[data-bs-theme="light"] .h1-balls-promo__code:hover {
  background: rgba(0,0,0,.04);
}
[data-bs-theme="light"] .h1-balls-promo__code-left {
  background: rgba(0,0,0,.05);
}