/* ===========================
   PACK TILES (CARDS)
   =========================== */

/* TILE CARD */
.pack-tile {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(15,23,42,0.85);
  background:
    radial-gradient(circle at 0 0, rgba(56,189,248,0.16), transparent 60%),
    radial-gradient(circle at 100% 100%, rgba(249,115,22,0.18), transparent 60%),
    rgba(15,23,42,0.98);
  box-shadow: 0 16px 42px rgba(15,23,42,0.96);
  min-width: 0;

  /* чуть выровняем тайминги */
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.pack-tile:hover {
  transform: translateY(-2px);
  border-color: rgba(15,23,42,0.85);
  box-shadow: 0 22px 58px rgba(15,23,42,1);
}

/* COVER */
.tile-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: radial-gradient(circle at 50% 0, rgba(15,23,42,0.7), #020617 70%);
}

.tile-cover.is-clickable {
  cursor: pointer;
}

.tile-cover__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  /* убираем transform отсюда, только прозрачность */
  transition: opacity 0.2s ease;
}

/* лёгкий zoom на hover */
.pack-tile:hover .tile-cover__img {
  transform: scale(1.03);
}

/* показываем картинку, когда контейнер НЕ пустой */
.tile-cover:not(.is-empty) .tile-cover__img {
  opacity: 1;
}

/* FALLBACK */
.tile-cover__fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 30%, rgba(56,189,248,0.22), transparent 70%),
    radial-gradient(circle at 50% 70%, rgba(249,115,22,0.18), transparent 70%),
    #0f172a;
  border: none;

  /* мягкий блюр */
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

/* маленькая SVG-иконка */
.tile-cover__fallback::before {
  content: "";
  width: 46px;
  height: 46px;

  opacity: 0.32;

  background-image: url("data:image/svg+xml,%3Csvg width='48' height='48' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='3' y='3' width='18' height='18' rx='2' ry='2'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'/%3E%3Cpath d='M21 15l-5-5L5 21'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* SPINNER */
.tile-cover__spinner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  background: radial-gradient(circle at 50% 0, rgba(15,23,42,0.82), rgba(15,23,42,0.96));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);

  z-index: 3;
  border-radius: inherit;
}

.tile-cover__spinner[hidden] {
  display: none;
}

.tile-cover__spinner .pcs-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(248,250,252,0.9);
  animation: pcs-bounce 1s infinite ease-in-out;
}

.tile-cover__spinner .pcs-dot:nth-child(2) { animation-delay: .15s; }
.tile-cover__spinner .pcs-dot:nth-child(3) { animation-delay: .30s; }

.tile-cover__spinner .pcs-label {
  margin-left: 6px;
  font-weight: 700;
  color: #e5e7eb;
  font-size: 0.9rem;
}

@keyframes pcs-bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* BADGES / PRICE / OWNED / LOCK */
.tile-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 4px 9px;

  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;

  border-radius: 999px;
  color: #ecfdf5;
  background: rgba(16,185,129,0.95);
  border: 1px solid rgba(16,185,129,0.4);
}

.tile-badge[data-type="premium"] {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  background-clip: padding-box;
  border-color: rgba(124,58,237,0.6);
}

/* price — справа */
.tile-price {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 9px;

  font-size: 0.78rem;
  font-weight: 800;

  border-radius: 999px;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #111827;
  border: 1px solid rgba(248,250,252,0.45);
  box-shadow: 0 8px 20px rgba(15,23,42,0.9);
}

/* owned badge */
.tile-owned-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 8px;

  font-size: 0.75rem;
  font-weight: 800;

  border-radius: 999px;
  background: rgba(16,185,129,0.96);
  color: #ecfdf5;
  border: 1px solid rgba(16,185,129,0.5);
  z-index: 2;
}

/* lock overlay */
.tile-lock {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;

  background: linear-gradient(180deg, rgba(15,23,42,0.05) 35%, rgba(15,23,42,0.7) 100%);
  color: #f9fafb;
  font-size: 22px;
  pointer-events: none;
  z-index: 2;
}

.tile-lock .bi {
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.6));
}

/* ===========================
   META & STATS
   =========================== */

.tile-meta {
  padding: 10px 14px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  flex: 1;            /* чтобы все карточки были одной высоты */
  min-height: 0;
}

/* Заголовок */

.tile-title {
  margin: 0;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #f9fafb;

  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow-wrap: anywhere;

  font-size: clamp(0.96rem, 0.9vw + 0.55rem, 1.08rem);
  min-height: calc(1.2em * 2);
}

@media (max-width: 1024px) {
  .tile-title {
    font-size: clamp(0.95rem, 1vw + 0.6rem, 1.02rem);
  }
}

@media (max-width: 480px) {
  .tile-title {
    -webkit-line-clamp: 3;
    line-clamp: 3;
    min-height: calc(1.2em * 3);
  }
}

/* Строка со статистикой */
.tile-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--muted);
  min-width: 0;
}

.tile-stats i {
  opacity: 0.8;
  margin-right: 4px;
}

/* Левая группа: рейтинг + rounds */
.tile-rating,
.tile-rounds {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* Правая группа: сложность */
.tile-difficulty {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}

.tile-rating,
.tile-rounds,
.tile-difficulty {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* Звезда рейтинга */

.tile-rating .bi-star-fill {
  color: #fbbf24;
  font-size: 0.95rem;
}

.tile-rating__val {
  color: #e5e7eb;
}

/* На очень узких экранах переносим статы в колонку */

/* планшеты и ниже — разрешаем перенос */
@media (max-width: 900px) {
  .tile-stats {
    flex-wrap: wrap;
    align-items: flex-start;
    row-gap: 4px;
  }

  .tile-rating,
  .tile-rounds,
  .tile-difficulty {
    white-space: normal; /* текст можно переносить */
  }

  .tile-difficulty {
    margin-left: 0;
  }
}
@media (max-width: 900px) {
  .tile-stats {
    flex-wrap: wrap;
    align-items: flex-start;
    row-gap: 4px;
  }

  .tile-rating,
  .tile-rounds,
  .tile-difficulty {
    white-space: normal; /* текст можно переносить */
  }

  .tile-difficulty {
    margin-left: 0;
  }
}
@media (max-width: 1280px) {
  .tile-stats {
    flex-wrap: wrap;
    align-items: flex-start;
    row-gap: 4px;
  }

  .tile-rating,
  .tile-rounds,
  .tile-difficulty {
    white-space: normal; /* текст можно переносить */
  }

  .tile-difficulty {
    margin-left: 0;
  }
}
/* очень узкие — всё в колонку (если хочешь оставить) */
@media (max-width: 600px) {
  .tile-stats {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

/* ===========================
   STORE – EMPTY STATE
   =========================== */

.pack-empty {
  margin-top: 32px;
  padding: 22px 18px 20px;
  border-radius: 24px;

  border: 1px solid rgba(15,23,42,0.9);
  background:
    radial-gradient(circle at 0 0, rgba(56,189,248,0.16), transparent 60%),
    radial-gradient(circle at 100% 100%, rgba(249,115,22,0.16), transparent 60%),
    rgba(15,23,42,0.98);
  box-shadow: 0 18px 46px rgba(15,23,42,0.96);

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

/* круглый чип под SVG */
.pack-empty__icon {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;

  background:
    radial-gradient(circle at 30% 0, rgba(56,189,248,0.4), transparent 60%),
    radial-gradient(circle at 100% 100%, rgba(249,115,22,0.5), transparent 70%),
    rgba(15,23,42,1);
  box-shadow:
    0 0 0 1px rgba(15,23,42,1),
    0 14px 32px rgba(15,23,42,0.9);
}

.pack-empty__svg {
  width: 32px;
  height: 32px;
}

/* текст */
.pack-empty__title {
  margin: 6px 0 0;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: #f9fafb;
}

.pack-empty__hint {
  margin: 4px 0 10px;
  font-size: 0.9rem;
  color: var(--muted);
  max-width: 360px;
}

/* кнопка "Back to All" в стиле карточек */
.store-empty-btn {
  margin-top: 4px;
  padding-inline: 16px;
  min-height: 38px;
  border-radius: 999px;
  font-weight: 700;
  border: 1px solid rgba(148,163,184,0.65);
  background: rgba(15,23,42,0.9);
  color: #e5e7eb;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    transform 0.12s ease,
    box-shadow 0.16s ease;
}

.store-empty-btn:hover {
  transform: translateY(-1px);
  background: rgba(15,23,42,1);
  border-color: rgba(248,250,252,0.7);
  box-shadow: 0 12px 28px rgba(15,23,42,0.9);
}

/* адаптив */
@media (max-width: 768px) {
  .pack-empty {
    margin-top: 24px;
    padding: 18px 14px 16px;
  }

  .pack-empty__icon {
    width: 56px;
    height: 56px;
  }

  .pack-empty__title {
    font-size: 0.8rem;
  }

  .pack-empty__hint {
    font-size: 0.86rem;
  }
}

/* ===========================
   SKELETONS
   =========================== */

.pack-tile.is-skeleton {
  position: relative;
}

.skeleton-block,
.skeleton-line,
.skeleton-btn {
  border-radius: 10px;
  background: linear-gradient(90deg, #0f172a 25%, #111827 37%, #020617 63%);
  background-size: 400% 100%;
  animation: shimmer 1.15s infinite;
}

.skeleton-block {
  height: 0;
  padding-bottom: 56.25%; /* 16:9 */
}

.skeleton-line {
  height: 14px;
}

.skeleton-btn {
  width: 96px;
  height: 28px;
}

@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}