:root {
  --bg: #1E1E1E;
  --card: #242424;
  --input: #2E2E2E;
  --btn: #383838;
  --text: #E6E6E6;
  --muted: #A0A0A0;
  --blue: #2D6BFF;
  --r: 14px;
  --gap: 8px;
  --fw-regular: 500;
  --fw-medium: 600;
  --fw-bold: 700;
}

/* RESET */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, sans-serif;
  font-weight: var(--fw-regular);
  touch-action: manipulation;
  overflow-x: hidden;
  display: flex;
  justify-content: center;
}

/* ===== ОСНОВНЫЕ СТИЛИ ===== */
.container {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 8px 12px 20px;
}

.app {
  width: 100%;
  max-width: 420px;
  padding: 8px 12px 80px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* TOP */
.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  padding: 6px 0;
  font-size: 12px;
  color: var(--muted);
}

#userId {
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 4px 10px;
  font-size: 12px;
  display: inline-block;
  width: fit-content;
  justify-self: start;
  margin-left: 4px;
  background: var(--card);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
}

.admin-btn {
  background: var(--btn);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text);
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.admin-btn:hover {
  border-color: rgba(94, 245, 124, 0.4);
  box-shadow: 0 0 10px rgba(94, 245, 124, 0.2);
}

.admin-btn.hidden {
  display: none;
}

.tg-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--btn);
  border-radius: 8px;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.2s ease;
}

.tg-btn:hover {
  border-color: rgba(94, 245, 124, 0.4);
  box-shadow: 0 0 10px rgba(94, 245, 124, 0.2);
}

.tg-btn img {
  width: 15px;
  height: 15px;
}

/* CARD */
.card {
  background: var(--card);
  border-radius: var(--r);
  padding: 10px;
  margin: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* HERO */
.hero {
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 22px;
  overflow: hidden;
  background: transparent;
}

.hero-img {
  width: 100%;
  height: 155px;
  margin: 0;
  padding: 0;
  line-height: 0;
}

.hero-img img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  border: none;
  box-shadow: none;
}

/* INPUT */
input {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  outline: none;
  background: var(--input);
  color: var(--text);
  transition: all 0.2s ease;
}

input:focus {
  border-color: rgba(94, 245, 124, 0.4);
  box-shadow: 0 0 10px rgba(94, 245, 124, 0.15);
}

/* ROW */
.row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 6px;
  align-items: center;
}

/* BUTTONS */
.btn.small {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: var(--btn);
  color: var(--muted);
  font-size: 13px;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.05);
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn.small:hover {
  border-color: rgba(94, 245, 124, 0.4);
  box-shadow: 0 0 10px rgba(94, 245, 124, 0.2);
  transform: scale(0.98);
}

.btn.small.active {
  background: rgba(94, 245, 124, 0.15);
  color: #5ef57c;
  border-color: #5ef57c;
  box-shadow: 0 0 14px rgba(94, 245, 124, 0.4);
}

/* PRICE */
.price-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: nowrap;
}

.price-line input {
  width: 65px;
  text-align: center;
  padding: 8px 4px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  outline: none;
  background: var(--input);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.price-line input:focus {
  border-color: rgba(94, 245, 124, 0.4);
  box-shadow: 0 0 10px rgba(94, 245, 124, 0.15);
}

.price-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.arrow-icon {
  width: 67px;
  height: 36px;
  opacity: 0.8;
  flex-shrink: 0;
}

#rubOut {
  color: var(--muted);
  font-weight: var(--fw-bold);
  font-size: 14px;
  white-space: nowrap;
  min-width: 70px;
  text-align: center;
}

/* PACKS */
.packs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.packs button {
  padding: 8px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: var(--btn);
  color: var(--muted);
  font-size: 13px;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.05);
  transition: all 0.2s ease;
  cursor: pointer;
}

.packs button:hover {
  border-color: rgba(94, 245, 124, 0.4);
  box-shadow: 0 0 10px rgba(94, 245, 124, 0.2);
  transform: scale(0.95);
}

.packs button.active {
  background: rgba(94, 245, 124, 0.15);
  color: #5ef57c;
  border-color: #5ef57c;
  box-shadow: 0 0 16px rgba(94, 245, 124, 0.5);
}

/* ПЛАТЁЖКИ */
.payment-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
}

.pay-card {
  background: #1c1c1e;
  border-radius: 18px;
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
}

.pay-card:hover {
  border-color: rgba(94, 245, 124, 0.6);
  box-shadow: 0 0 20px rgba(94, 245, 124, 0.3);
  transform: scale(1.02);
}

.pay-card:active {
  transform: scale(0.96);
}

.currency-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  color: #5ef57c;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 4px 10px;
  border-radius: 16px;
  background: rgba(20, 30, 20, 0.8);
  backdrop-filter: blur(6px);
  border: 0.5px solid rgba(94, 245, 124, 0.35);
  box-shadow: 0 0 10px rgba(94, 245, 124, 0.3);
  text-transform: uppercase;
  line-height: 1;
  z-index: 2;
}

.payment-logo {
  width: 75px;
  height: 75px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.25), rgba(255,255,255,0.02) 70%);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4), inset 0 1px 2px rgba(255,255,255,0.3);
  margin-bottom: 10px;
  backdrop-filter: blur(4px);
  overflow: hidden;
  padding: 8px;
}

.payment-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4));
}

.pay-card[data-method="sbp"] .payment-logo img {
  transform: scale(0.95);
}

.pay-card[data-method="ton"] .payment-logo img {
  transform: scale(1.15);
}

.payment-name {
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-align: center;
  opacity: 0.95;
  margin-top: 4px;
}

.pay-card.selected {
  border: 2px solid #5ef57c;
  box-shadow: 0 0 20px rgba(94, 245, 124, 0.5), 0 4px 12px rgba(0,0,0,0.5);
  background: #1e2a1e;
}

/* TERMS */
.terms {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}

.terms a {
  color: var(--muted);
  text-decoration: none;
}

.terms a:hover {
  color: #5ef57c;
}

/* BUY */
.buy {
  position: fixed;
  bottom: 12px;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: calc(100% - 24px);
  max-width: 420px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #5ef57c;
  background: #5ef57c;
  color: #000;
  font-weight: var(--fw-bold);
  font-size: 15px;
  transition: all 0.2s ease;
  z-index: 10;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(94, 245, 124, 0.4);
}

.buy:hover {
  box-shadow: 0 0 24px rgba(94, 245, 124, 0.8);
  background: #6ffa8c;
  transform: translateX(-50%) scale(1.02);
}

button:active {
  transform: scale(0.98);
  filter: brightness(1.15);
}

button {
  background: #2c2c2c;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 16px;
}

button:hover {
  opacity: 0.9;
}

.seller-info {
  transition: all 0.3s ease;
}

@media (min-width: 768px) {
  .seller-info {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* Анимация появления карточек */
@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  animation: fadeSlideUp 0.4s ease forwards;
  opacity: 0;
}

.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.10s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.20s; }
.card:nth-child(5) { animation-delay: 0.25s; }
.card:nth-child(6) { animation-delay: 0.30s; }

/* ПК версия (широкий экран) — теперь тёмный фон */
@media (min-width: 1024px) {
  body {
    background: var(--bg); /* убираем светлый фон, оставляем тёмный */
    padding: 0;
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: flex-start;
  }

  .container {
    max-width: 1000px;
    width: 85%;
    margin: 20px 0 20px 40px;
    background: transparent;
    padding: 0;
  }

  .products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
  }

  .content-page {
    max-width: 100%;
    margin: 0;
  }

  .seller-info {
    text-align: left;
  }

  .card {
    animation: fadeSlideUp 0.4s ease forwards;
  }
}

/* Активные кнопки */
.packs button.active,
.btn.small.active,
.pay-card.selected {
  background: rgba(94, 245, 124, 0.15) !important;
  color: #5ef57c !important;
  border-color: #5ef57c !important;
  box-shadow: 0 0 14px rgba(94, 245, 124, 0.5) !important;
  transition: all 0.2s ease;
}

#userId,
.admin-btn:not(.hidden) {
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.pay-card {
  transition: all 0.2s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

.pay-card.selected {
  transform: scale(0.98);
}

.packs button {
  transition: all 0.2s ease;
}