:root {
  --bg: #0a0a0c;
  --bg-2: #111114;
  --card: #16161a;
  --card-2: #1c1c22;
  --line: #232329;
  --text: #f4f4f6;
  --muted: #8b8b94;
  --pink: #2aabee;
  --pink-soft: rgba(42, 171, 238, 0.45);
  --accent-grad: linear-gradient(180deg, #34b6f5, #229ed9);
  --accent-ink: #ffffff;
  --r-common: #3b82f6;
  --r-rare: #22d3ee;
  --r-epic: #a855f7;
  --r-legend: #facc15;
  --radius: 16px;
  --nav-h: 64px;
  --maxw: 1480px;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

#app {
  min-height: 100vh;
  min-height: 100dvh;
}

.view {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 10px 12px calc(var(--nav-h) + env(safe-area-inset-bottom) + 28px); /* Уменьшили боковые отступы для увеличения контента */
}
@media (min-width: 860px) {
  .view { padding-left: 20px; padding-right: 20px; }
}

/* ---------- Catalog topbar ---------- */
.cases-topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 4px;
}

/* ---------- Section header ---------- */
.section-title {
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 8px 0 18px;
}
@media (min-width: 900px) { .section-title { font-size: 19px; } }

.page-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.back-btn {
  width: 40px; height: 40px;
  flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  cursor: pointer;
  transition: background .18s ease, transform .18s ease;
}
.back-btn:hover { background: var(--card-2); }
.back-btn svg { width: 20px; height: 20px; }
.page-head h1 { font-size: 22px; font-weight: 700; margin: 0; }

/* ---------- Balance pill ---------- */
.balance-pill {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px 8px 14px; /* Уменьшен правый отступ для плюсика */
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}
.balance-pill:hover {
  background: var(--card-2);
  border-color: var(--pink);
}
.balance-pill:active {
  transform: scale(.96);
}
.balance-pill img { width: 18px; height: 18px; object-fit: contain; }

.balance-pill .plus-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--pink);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  margin-left: 4px;
  text-align: center;
  transition: transform 0.15s ease;
}
.balance-pill:hover .plus-circle {
  transform: scale(1.15);
}

/* ---------- Cards grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

/* Изменено: Сетки кейсов отображают по 2 кейса в ряд, но сами кейсы визуально уменьшены в 1.5 раза */
#event-cases-grid, #free-cases-grid, #basic-cases-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px;
}
#event-cases-grid .card, #free-cases-grid .card, #basic-cases-grid .card {
  padding: 4px 6px 8px;
  justify-content: flex-start;
  gap: 2px;
}
#event-cases-grid .card .thumb, #free-cases-grid .card .thumb, #basic-cases-grid .card .thumb {
  margin-bottom: 2px;
}
#event-cases-grid .card .thumb img, #free-cases-grid .card .thumb img, #basic-cases-grid .card .thumb img {
  transform: scale(0.96); /* Уменьшенный масштаб кейса */
}
#event-cases-grid .card .name, #free-cases-grid .card .name, #basic-cases-grid .card .name {
  font-size: 16px;
  font-weight: 700;
  min-height: 1.3em;
  line-height: 1.3;
}
#event-cases-grid .card .price, #free-cases-grid .card .price, #basic-cases-grid .card .price {
  font-size: 18px;
  margin-top: 2px;
}
#event-cases-grid .card .price img, #free-cases-grid .card .price img, #basic-cases-grid .card .price img {
  width: 20px;
  height: 20px;
}

/* Изменено: Карточка кейса теперь без рамок и фона */
.card {
  position: relative;
  background: transparent;
  border: none;
  border-radius: var(--radius);
  padding: 10px 8px 14px;
  text-align: center;
  cursor: pointer;
  transition: transform .22s cubic-bezier(.22,.61,.36,1), filter .22s ease;
  will-change: transform;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}
.card:hover {
  transform: translateY(-4px) scale(1.06);
}

.card .thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  margin-bottom: 15px; /* Увеличили отступ снизу для компенсации масштаба */
  z-index: 2; /* Поверх свечения */
}

/* Изменено: Свечение кейсов в каталоге уменьшено и сделано мягче */
.card .case-glow {
  position: absolute;
  top: 5%;
  left: 5%;
  width: 90%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  filter: blur(24px); /* Меньше размытие */
  opacity: 0.55 !important; /* Уменьшили яркость */
  z-index: 1; /* Под остальными элементами (thumb, name, price) */
  pointer-events: none;
  transform: translateY(-8px); /* Сдвинуто вверх */
}

.card .thumb img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,.5));
  pointer-events: none;
  transform: scale(1.45); /* Кейс увеличенного размера */
  transform-origin: center;
}
.card .name {
  position: relative;
  z-index: 3; /* Поверх свечения и изображения */
  transform: translateZ(0); /* Аппаратное ускорение (GPU промоушен), чтобы размытие не перекрывало текст */
  font-size: 16px;
  font-weight: 700;
  color: #ffffff; /* Чистый белый цвет для контраста */
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.95); /* Мощная тень, чтобы свечение не засвечивало буквы */
  line-height: 1.3;
  min-height: 1.3em;
  display: flex; align-items: center; justify-content: center;
}
.card .price {
  position: relative;
  z-index: 3; /* Поверх свечения и изображения */
  transform: translateZ(0); /* Аппаратное ускорение (GPU промоушен), чтобы размытие не перекрывало текст */
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 20px;
  font-weight: 800;
  color: #ffffff; /* Чистый белый цвет для контраста */
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.95); /* Мощная тень */
}
.card .price img { width: 24px; height: 24px; object-fit: contain; }

/* На ПК карточки крупнее */
@media (min-width: 900px) {
  .card { padding: 12px 12px 16px; }
  .card .name { font-size: 18px; }
  .card .price { font-size: 22px; }
  .card .price img { width: 22px; height: 22px; }
}

/* ---------- Single case page ---------- */
.case-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 4px 0 4px;
}
.case-arena {
  position: relative;
  width: 100%;
  max-width: 760px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  min-height: 300px;
}
@media (min-width: 900px) {
  .case-arena { max-width: 1040px; }
}
.case-arena .case-img {
  position: relative;
  z-index: 1;
  width: min(96vw, 480px); /* Изменено: В 1.5 раза больше (было 64vw/320px) */
  max-width: 480px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  filter: drop-shadow(0 26px 50px rgba(0,0,0,.6));
  transition: opacity .7s ease, transform .7s cubic-bezier(.22,.61,.36,1), filter .7s ease;
}

/* Изменено: Свечение на странице открытия кейса уменьшено и сделано мягче */
.case-arena .case-hero-glow {
  position: absolute;
  top: 50%; left: 50%;
  width: min(80vw, 400px); /* Уменьшили размер */
  height: min(80vw, 400px);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  filter: blur(40px); /* Уменьшили размытие */
  opacity: 0.55 !important; /* Уменьшили яркость */
  z-index: 0;
  pointer-events: none;
}

/* при открытии кейс тускнеет и отъезжает на задний план */
.case-arena.pushed { min-height: 220px; }
.case-arena.pushed.multi { min-height: auto; }
/* при нескольких лентах делаем их компактнее, чтобы влезали в стопку */
.case-arena.multi .roulette-wrap { padding: 16px 0; }
.case-arena.multi .r-item { width: 92px; height: 92px; }
@media (min-width: 900px) {
  .case-arena.multi .r-item { width: 120px; height: 120px; }
}
.case-arena .case-img.faded {
  position: absolute;
  opacity: .12;
  transform: scale(.7) translateZ(0);
  filter: drop-shadow(0 26px 50px rgba(0,0,0,.6)) blur(1.5px);
  z-index: 0;
}

.open-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
}

/* x1 / x2 / x3 переключатель */
.count-switch {
  display: inline-flex;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
}
.count-opt {
  min-width: 54px;
  padding: 9px 14px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.count-opt.active { background: var(--accent-grad); color: var(--accent-ink); }

/* несколько лент рядом (вертикальный стек) */
.reels {
  position: relative;
  z-index: 2;
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.open-btn {
  min-width: 250px;
  padding: 16px 28px;
  border: none;
  border-radius: 14px;
  background: var(--accent-grad);
  color: var(--accent-ink);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.2px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  box-shadow: 0 14px 34px -10px var(--pink-soft);
  transition: transform .15s ease, filter .15s ease, opacity .15s ease;
}
.open-btn:hover { transform: translateY(-1px); filter: brightness(1.06); }
.open-btn:active { transform: translateY(0) scale(.99); }
.open-btn img { width: 18px; height: 18px; object-fit: contain; }
.open-btn:disabled {
  background: var(--card-2);
  color: var(--muted);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

/* toggles row */
.toggles {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  justify-content: center;
}

/* fast toggle */
.fast-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  user-select: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}
.fast-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.fast-toggle .switch {
  position: relative;
  width: 48px; height: 28px;
  border-radius: 999px;
  background: var(--card-2);
  border: 1px solid var(--line);
  transition: background .18s ease;
}
.fast-toggle .switch::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #6b6b74;
  transition: transform .18s ease, background .18s ease;
}
.fast-toggle input:checked + .switch { background: rgba(42,171,238,.35); border-color: var(--pink-soft); }
.fast-toggle input:checked + .switch::after { transform: translateX(20px); background: var(--pink); }
.fast-toggle input:checked ~ .fast-label { color: var(--text); }

.opening-label {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-top: 16px;
}

/* ---------- Contents of case ---------- */
.contents { margin-top: 28px; }
.contents-title {
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}
.contents-grid {
  max-width: 760px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.content-item {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 10px 12px;
  text-align: center;
}
.content-item .ci-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  display: grid; place-items: center;
  margin-bottom: 6px;
}

/* Свечение предметов внутри кейса */
.content-item .ci-thumb .glow {
  display: none !important; /* Отключено по запросу */
}
.content-item .ci-thumb img,
.content-item .ci-thumb .gift-img { position: relative; z-index: 1; width: 83%; height: 83%; object-fit: contain; }
.content-item .ci-name { font-size: 12px; color: var(--text); margin-bottom: 2px; line-height: 1.2; }
.content-item .ci-price {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 14px; font-weight: 800;
}
.content-item .ci-price img { width: 15px; height: 15px; object-fit: contain; }
.content-item .ci-price .ton-icon-img { width: 18px !important; height: 18px !important; }

/* ---------- Roulette ---------- */
.roulette-wrap {
  position: relative;
  z-index: 2;
  width: 100%;
  margin: 0;
  overflow: hidden;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(14,14,18,.86), rgba(19,19,24,.86));
  border: 1px solid var(--line);
  padding: 30px 0;
  opacity: 0;
  transform: scale(.98);
  transition: opacity .45s ease, transform .45s ease;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.roulette-wrap.show { opacity: 1; transform: scale(1); }
.roulette-track {
  display: flex;
  align-items: center;
  gap: 0;
  will-change: transform;
}
.r-item {
  position: relative;
  flex: 0 0 auto;
  width: 120px;
  height: 120px;
  display: grid;
  place-items: center;
  border-right: 1px solid rgba(255,255,255,.12);
}
.r-item:first-child { border-left: 1px solid rgba(255,255,255,.12); }
@media (min-width: 900px) {
  .roulette-wrap { padding: 60px 0; }
  .r-item { width: 200px; height: 200px; }
}

/* Изменено: Свечение предметов в крутящейся рулетке */
.r-item .glow {
  display: none !important; /* Отключено по запросу */
}
.r-item img,
.r-item .gift-img,
.r-item .premium-prize {
  position: relative;
  z-index: 1;
  width: 74%;
  height: 74%;
  object-fit: contain;
}

/* приз-звёзды: число золотом в левом нижнем углу звезды */
.star-prize {
  position: relative;
  z-index: 1;
  width: 74%;
  height: 74%;
  display: grid;
  place-items: center;
}
.star-prize img { width: 100%; height: 100%; object-fit: contain; }
.star-prize .star-amt {
  position: absolute;
  left: 4%;
  bottom: 2%;
  color: var(--pink);
  font-weight: 800;
  font-size: 18px;
  text-shadow: 0 1px 3px rgba(0,0,0,.8);
  line-height: 1;
}
.r-marker {
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, transparent, var(--pink), transparent);
  z-index: 3;
  pointer-events: none;
}
.r-marker::before, .r-marker::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
}
.r-marker::before { top: -1px; border-top: 8px solid var(--pink); }
.r-marker::after  { bottom: -1px; border-bottom: 8px solid var(--pink); }

/* ---------- Win screen ---------- */
.win-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
}
.win-title { font-size: 15px; color: var(--muted); margin-bottom: 16px; }
.win-grid {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 12px !important;
  width: calc(100% - 24px) !important;
  max-width: 380px !important; /* Сетка шире, чтобы предметы были больше */
  margin: 0 auto !important;
}

.win-grid.single {
  grid-template-columns: 1fr !important;
  max-width: 180px !important;
}

/* Расположение трех предметов: 2 сверху, 1 по центру снизу */
.win-grid.count-3 .win-card:nth-child(3) {
  grid-column: 1 / span 2 !important;
  justify-self: center !important;
  width: calc(50% - 6px) !important; /* Точный размер одной колонки с учетом отступа */
}
.win-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 12px;
  text-align: center;
  animation: pop .35s cubic-bezier(.22,.61,.36,1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}
.win-card.sold { opacity: .5; }
@keyframes pop { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.win-card .win-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  display: grid; 
  place-items: center;
  margin-bottom: 8px;
}

/* Свечение на экране выигрыша */
.win-card .win-thumb .glow {
  display: none !important; /* Отключено по запросу */
}
.win-card .win-thumb img,
.win-card .win-thumb .gift-img,
.win-card .win-thumb .premium-prize,
.win-card .win-thumb .star-prize {
  position: relative;
  z-index: 1;
  width: 64%;
  height: 64%;
  object-fit: contain;
}
.win-card .win-thumb .star-prize img { width: 100%; height: 100%; }
.win-card .win-thumb .star-prize .star-amt { 
  color: var(--pink); 
  position: absolute; 
  left: 4%; 
  bottom: 2%; 
  font-weight: 800; 
  font-size: 18px; 
  text-shadow: 0 1px 3px rgba(0,0,0,.8); 
}
.win-sub { font-size: 12px; color: var(--muted); }
.win-card .win-price {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 18px; font-weight: 800; margin-bottom: 12px;
}
.win-card .win-price img { width: 18px; height: 18px; object-fit: contain; }

/* Кнопка продажи одного предмета (TG стиль) */
.win-card .win-sell-one {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  background: rgba(42, 171, 238, 0.12);
  color: var(--pink);
  border: 1px solid rgba(42, 171, 238, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.win-card .win-sell-one:hover {
  background: rgba(42, 171, 238, 0.2);
}
.win-card .win-sell-one:active {
  transform: scale(0.97);
}
.win-card .win-sell-one:disabled {
  background: var(--card-2);
  color: var(--muted);
  border-color: var(--line);
  opacity: 0.6;
}

.win-actions-all {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 24px;
  width: 100%;
  max-width: 340px;
}
.btn {
  width: 100%;
  padding: 15px 16px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.2px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .15s ease, filter .15s ease, background .15s ease, box-shadow .15s ease;
  user-select: none;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn img { width: 18px; height: 18px; object-fit: contain; }

.btn-keep {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
}
.btn-keep:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
}

.btn-sell {
  background: var(--accent-grad);
  color: var(--accent-ink);
  box-shadow: 0 4px 15px -4px rgba(34, 161, 222, 0.35);
}
.btn-sell:hover:not(:disabled) {
  filter: brightness(1.08);
  box-shadow: 0 6px 18px -3px rgba(34, 161, 222, 0.45);
}

/* ---------- Inventory / generic item ---------- */
.empty {
  text-align: center;
  color: var(--muted);
  padding: 60px 16px;
  font-size: 15px;
}

/* Изменено: Карточка в инвентаре сохраняет рамку и фон для аккуратности */
.inv-card { 
  cursor: default; 
  background: var(--card);
  border: 1px solid var(--line);
}
.inv-card:hover { 
  transform: none; 
  background: var(--card);
  border-color: var(--line); 
  box-shadow: none; 
}

.new-badge {
  position: absolute;
  top: 10px; left: 10px;
  z-index: 3;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--pink);
  color: var(--accent-ink);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .6px;
  text-transform: uppercase;
  box-shadow: 0 6px 16px -4px var(--pink-soft);
}
.inv-card .thumb { position: relative; }

/* Свечение у карточек в инвентаре */
.inv-card .thumb .glow {
  display: none !important; /* Отключено по запросу */
}
.inv-card .thumb img { position: relative; z-index: 1; }



/* ---------- Profile ---------- */
.profile-balance {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 20px;
  text-align: center;
  margin-bottom: 14px;
}
.profile-balance .label { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.profile-balance .value {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 34px;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.profile-balance .value:hover {
  filter: brightness(1.15);
}
.profile-balance .value:active {
  transform: scale(0.96);
}
.profile-balance .value img { width: 30px; height: 30px; object-fit: contain; }
.profile-balance .value .plus-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--pink);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  margin-left: 8px;
  text-align: center;
  transition: transform 0.15s ease;
}
.profile-balance .value:hover .plus-circle {
  transform: scale(1.15);
}
.profile-rows {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.profile-rows .row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.profile-rows .row:last-child { border-bottom: none; }
.profile-rows .row .k { color: #e1e3e6; font-weight: 500; }
.profile-rows .row .v { font-weight: 700; }

.profile-stats .row {
  padding: 18px 22px;
}
.profile-stats .row .k {
  font-size: 15px;
  color: #b9bbbe;
  font-weight: 600;
}
.profile-stats .row .v {
  font-size: 18px;
  font-weight: 850;
  color: #ffffff;
}

.topup-btn {
  width: 100%;
  margin-top: 14px;
  padding: 15px;
  border: none;
  border-radius: 14px;
  background: var(--accent-grad);
  color: var(--accent-ink);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 14px 34px -10px var(--pink-soft);
  transition: transform .15s ease, filter .15s ease;
}
.topup-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.topup-btn:active { transform: scale(.99); }

.settings-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 24px 0 12px;
}
/* тумблер звука в профиле — без подписи справа выровнен */
.profile-rows .row .fast-toggle { gap: 0; }

/* ---------- Bottom nav ---------- */
.tabbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--maxw);
  bottom: 0;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  align-items: stretch;
  background: rgba(14,14,18,.92);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  z-index: 50;
}
.tab {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  transition: color .18s ease;
}
.tab svg { width: 25px; height: 25px; }
.tab.has-badge::after {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  margin-left: 9px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 0 2px rgba(14,14,18,.92);
}
.tab.active { color: var(--text); }
.tab.active svg { stroke: var(--pink); }

@media (min-width: 860px) {
  .tabbar { justify-content: center; gap: 40px; }
  .tab { flex: 0 0 auto; min-width: 96px; }
}

/* ===================== Background Glows ===================== */
.bg-glow {
  position: fixed;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  filter: blur(140px);
  z-index: -1;
  opacity: 0.28;
  pointer-events: none;
}
.glow-1 {
  background: #af54ff;
  top: -100px;
  left: -50px;
  animation: floatGlow1 16s infinite alternate ease-in-out;
}
.glow-2 {
  background: #2aabee;
  bottom: -60px;
  right: -60px;
  animation: floatGlow2 20s infinite alternate ease-in-out;
}
@keyframes floatGlow1 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(60px, 40px) scale(1.1); }
}
@keyframes floatGlow2 {
  0% { transform: translate(0, 0) scale(1.1); }
  100% { transform: translate(-60px, -40px) scale(0.9); }
}

/* ===================== Bottom Sheets / Drawers ===================== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  opacity: 0;
  z-index: 1000;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.drawer-container {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 85vh;
  background: #111116;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
  z-index: 1001;
  padding: 16px 20px calc(20px + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.94, 0.6, 1);
  overflow-y: auto;
  color: var(--text);
}
@media (min-width: 600px) {
  .drawer-container {
    max-width: 500px;
    margin: 0 auto;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px 24px 0 0;
  }
}
.drawer-container.active {
  transform: translateY(0);
}

.drawer-header {
  text-align: center;
  margin-bottom: 16px;
}
.drawer-drag-handle {
  width: 36px;
  height: 4px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 99px;
  margin: 0 auto 10px;
}
.drawer-title {
  font-size: 17px;
  font-weight: 750;
  letter-spacing: 0.3px;
}
.drawer-text {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
  margin: 10px 0 16px;
}
.drawer-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

/* ===================== Subscription Check Drawer ===================== */
.channel-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 14px;
  border-radius: 14px;
  margin-bottom: 12px;
}
.channel-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #2aabee;
  display: grid;
  place-items: center;
  color: #fff;
}
.channel-logo svg {
  width: 20px;
  height: 20px;
}
.channel-info {
  flex: 1;
}
.channel-title {
  font-size: 14px;
  font-weight: 700;
}
.channel-username {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* ===================== Withdraw Drawer ===================== */
.prize-card-preview {
  position: relative;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 8px auto 16px;
  max-width: 220px;
  overflow: hidden;
  text-align: center;
}
.prize-card-preview .glow {
  display: none !important; /* Отключено по запросу */
}
.preview-visual-box {
  position: relative;
  width: 90px;
  height: 90px;
  display: grid;
  place-items: center;
  z-index: 1;
  margin-bottom: 10px;
}
.preview-visual-box img,
.preview-visual-box .premium-prize {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.preview-name {
  position: relative;
  z-index: 1;
  font-size: 15px;
  font-weight: 700;
}
.preview-price {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 17px;
  font-weight: 800;
  color: var(--pink);
  margin-top: 6px;
}
.info-alert {
  background: rgba(250, 204, 21, 0.06);
  border: 1px solid rgba(250, 204, 21, 0.18);
  color: #facc15;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.45;
  margin-bottom: 16px;
}

/* ===================== Top-up Packs Selector ===================== */
.packs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.pack-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.pack-card:active {
  transform: scale(0.97);
}
.pack-card:hover {
  border-color: rgba(42, 171, 238, 0.4);
  box-shadow: 0 6px 18px rgba(42, 171, 238, 0.1);
}
.pack-stars-visual {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.pack-stars-visual img {
  width: 20px;
  height: 20px;
}
.pack-stars-count {
  font-size: 17px;
  font-weight: 800;
}
.pack-price {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

/* ===================== Invoice Page Mimic ===================== */
.invoice-container {
  display: flex;
  flex-direction: column;
  padding: 8px 0 0;
}
.invoice-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 20px;
}
.telegram-stars-logo {
  width: 64px;
  height: 64px;
  margin-bottom: 10px;
}
.telegram-star-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 4px 12px rgba(230, 161, 0, 0.35));
}
.invoice-title {
  font-size: 18px;
  font-weight: 800;
}
.invoice-desc {
  font-size: 13px;
  color: var(--muted);
  margin-top: 3px;
}
.invoice-details {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 20px;
}
.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.detail-row:last-child {
  border-bottom: none;
}
.detail-label {
  color: var(--muted);
}
.detail-value {
  font-weight: 700;
}
.detail-row.total {
  padding-top: 12px;
  margin-top: 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 15px;
}
.text-accent {
  color: #2aabee;
}
.btn-invoice-pay {
  background: linear-gradient(180deg, #34b6f5, #229ed9);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.15s ease, filter 0.15s ease;
  box-shadow: 0 8px 20px rgba(42, 171, 238, 0.25);
}
.btn-invoice-pay:active {
  transform: scale(0.98);
}
.btn-invoice-cancel {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 10px;
  font-size: 13px;
  font-weight: 600;
  margin-top: 6px;
  cursor: pointer;
  transition: color 0.2s ease;
}
.btn-invoice-cancel:hover {
  color: var(--text);
}

/* ===================== Toast Notifications ===================== */
.toast-container {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translate(-50%, -80px);
  z-index: 2000;
  width: 90%;
  max-width: 360px;
  background: #15151b;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
  padding: 12px 16px;
  transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.25);
  pointer-events: none;
}
.toast-container.active {
  transform: translate(-50%, 0);
}
.toast-content {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 13.5px;
  font-weight: 700;
}
.toast-success {
  border-left: 3px solid var(--pink);
}
.toast-error {
  border-left: 3px solid #ef4444;
}

/* ===================== Accordion Panel & Admin API Form ===================== */
.accordion-section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 14px;
}
.accordion-trigger {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 18px;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease;
}
.accordion-trigger:hover {
  background: var(--card-2);
}
.accordion-arrow {
  transition: transform 0.2s ease;
  color: var(--muted);
}
.accordion-trigger.active .accordion-arrow {
  transform: rotate(180deg);
}
.accordion-content {
  padding: 16px;
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.15);
}
.form-group {
  margin-bottom: 14px;
}
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.form-input {
  width: 100%;
  background: #0a0a0c;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 12px;
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  transition: border-color 0.2s ease;
}
.form-input:focus {
  outline: none;
  border-color: var(--pink);
}
.form-help {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.35;
}

/* ===================== Profile Hero Layout ===================== */
.profile-hero-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.profile-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #af54ff 0%, #2aabee 100%);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(175, 84, 255, 0.25);
}
.profile-meta {
  flex: 1;
}
.profile-name {
  font-size: 16px;
  font-weight: 700;
}
.profile-username {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 1px;
}
.profile-badge-twa {
  font-size: 9px;
  font-weight: 850;
  color: var(--pink);
  border: 1px solid rgba(42, 171, 238, 0.25);
  background: rgba(42, 171, 238, 0.05);
  padding: 4px 8px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.topup-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  background: linear-gradient(180deg, #34b6f5, #229ed9);
  color: #fff;
  border: none;
  border-radius: 99px;
  padding: 6px 14px;
  font-size: 11.5px;
  font-weight: 750;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease;
  box-shadow: 0 4px 12px rgba(42, 171, 238, 0.2);
}
.topup-pill-btn:active {
  transform: scale(0.97);
}

/* ===================== Inventory Action Buttons ===================== */
.inv-card-actions {
  display: flex;
  gap: 5px;
  margin-top: 10px;
  width: 100%;
}
.inv-card-actions button {
  flex: 1;
  border: none;
  border-radius: 8px;
  padding: 8px 3px;
  font-weight: 700;
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.inv-card-actions .sell-btn {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.inv-card-actions .sell-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
}
.inv-card-actions .withdraw-btn {
  background: linear-gradient(180deg, #34b6f5, #229ed9);
  color: #fff;
}
.inv-card-actions .withdraw-btn:hover:not(:disabled) {
  filter: brightness(1.08);
}
.inv-card-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.status-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  padding: 2.5px 7px;
  border-radius: 5px;
  font-size: 9px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.status-withdrawing {
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.22);
  color: #facc15;
}
.status-withdrawn {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.22);
  color: #22c55e;
}

/* ===================== Telegram Premium Custom Prize Cards ===================== */
.premium-prize {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 4px;
}
.premium-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 3px 8px rgba(140, 43, 245, 0.3));
}

/* Spinner */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.w-100 {
  width: 100% !important;
}

.win-title-glow {
  position: absolute;
  top: -80px;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(175, 84, 255, 0.3) 0%, transparent 70%);
  z-index: 0;
  pointer-events: none;
}
.win-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-top: 8px;
}
.star-icon-img {
  vertical-align: middle;
}

/* ===================== Mobile Only Gate ===================== */
.mobile-gate {
  position: fixed;
  inset: 0;
  background: #0a0a0c;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}
.mobile-gate-card {
  position: relative;
  background: #111116;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 32px 24px;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(0,0,0,0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}
.mobile-gate-glow {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(42, 171, 238, 0.25) 0%, transparent 70%);
  z-index: 0;
  pointer-events: none;
  filter: blur(40px);
}
.mobile-gate-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.mobile-gate-icon {
  width: 64px;
  height: 64px;
  color: #2aabee;
  margin-bottom: 20px;
  filter: drop-shadow(0 4px 12px rgba(42, 171, 238, 0.4));
}
.mobile-gate h2 {
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 12px 0;
  color: #fff;
  font-family: inherit;
}
.mobile-gate p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 24px 0;
  font-family: inherit;
}
.qr-container {
  background: #ffffff;
  padding: 12px;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  margin-bottom: 16px;
}
.qr-container img {
  display: block;
  width: 180px;
  height: 180px;
}
.mobile-gate-link {
  font-size: 11px;
  color: #2aabee;
  word-break: break-all;
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px dashed rgba(42, 171, 238, 0.4);
  padding-bottom: 2px;
}

/* ===================== Upgrade Section ===================== */
.upgrade-container {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 20px;
  padding-bottom: 30px;
}

.upgrade-wheel-section {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px 0;
}

.wheel-box {
  position: relative;
  width: 200px;
  height: 200px;
  display: grid;
  place-items: center;
}

.upgrade-wheel-svg {
  width: 200px;
  height: 200px;
}

.upgrade-chance-ring {
  transition: stroke-dashoffset 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.upgrade-chance-pct {
  font-family: inherit;
  font-size: 32px;
  font-weight: 800;
  fill: #ffffff;
  transition: opacity 0.3s ease;
}

.upgrade-chance-label {
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  fill: var(--muted);
  letter-spacing: 1.5px;
  transition: opacity 0.3s ease;
}

.upgrade-arrow {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#upgrade-arrow-g {
  transition: transform 4s cubic-bezier(0.15, 0.85, 0.2, 1), opacity 0.3s ease;
}

/* Состояние вращения: скрываем текст и показываем стрелку */
.upgrade-wheel-svg.rolling .upgrade-arrow {
  opacity: 1;
}

.upgrade-wheel-svg.rolling .upgrade-chance-pct,
.upgrade-wheel-svg.rolling .upgrade-chance-label {
  opacity: 0;
}

/* Окна сравнения */
.upgrade-slots {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.upgrade-slot {
  flex: 1;
  aspect-ratio: 1 / 1.15;
  background: var(--card);
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  padding: 10px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
  overflow: hidden;
}

.upgrade-slot.slot-source:hover, .upgrade-slot.slot-target:hover {
  border-color: var(--pink-soft);
  background: rgba(42, 171, 238, 0.02);
}

.upgrade-slot .slot-empty-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.4;
  padding: 0 10px;
}

/* Карточка выбранного предмета внутри слота */
.upgrade-item-card {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.upgrade-slot.slot-source .upgrade-item-card, 
.upgrade-slot.slot-target .upgrade-item-card {
  border: none;
  background: transparent;
}

.upgrade-item-card .thumb {
  position: relative;
  width: 65%;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
}

.upgrade-item-card .thumb img,
.upgrade-item-card .thumb .gift-img,
.upgrade-item-card .thumb .premium-prize,
.upgrade-item-card .thumb .premium-svg,
.upgrade-item-card .thumb .star-prize {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: scale(0.9) !important;
}

.upgrade-item-card .name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  max-width: 100%;
}

.upgrade-item-card .price {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 800;
}

.upgrade-divider {
  display: grid;
  place-items: center;
  color: var(--muted);
  animation: pulseDivider 2s infinite alternate ease-in-out;
}

@keyframes pulseDivider {
  0% { transform: scale(0.92); opacity: 0.5; }
  100% { transform: scale(1.08); opacity: 0.9; }
}

/* Кнопка запуска апгрейда */
.upgrade-action-section {
  display: flex;
  justify-content: center;
  margin-top: 5px;
}

.upgrade-btn {
  width: 100%;
  max-width: 320px;
  padding: 16px 20px;
  border-radius: 14px;
  border: none;
  background: var(--accent-grad);
  color: var(--accent-ink);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 24px -6px var(--pink-soft);
  transition: transform 0.15s ease, filter 0.15s ease, opacity 0.15s ease;
}

.upgrade-btn:hover:not(:disabled) {
  filter: brightness(1.08);
}

.upgrade-btn:active:not(:disabled) {
  transform: scale(0.97);
}

.upgrade-btn:disabled {
  background: var(--card-2);
  border: 1px solid var(--line);
  color: var(--muted);
  box-shadow: none;
  cursor: not-allowed;
}

.upgrade-selection-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-top: 10px;
}

/* Панель фильтров */
.upgrade-filters {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
}

.filter-inputs {
  display: flex;
  gap: 8px;
}

.filter-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  outline: none;
  font-family: inherit;
}

.filter-input::placeholder {
  color: var(--muted);
}

.filter-input:focus {
  border-color: var(--pink-soft);
}

.filter-multipliers {
  display: flex;
  gap: 6px;
  align-items: center;
}

.mult-btn {
  flex: 1;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  padding: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

.mult-btn:hover {
  border-color: var(--pink);
  background: rgba(42, 171, 238, 0.05);
}

.filter-reset-btn {
  background: transparent;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--muted);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.filter-reset-btn:hover {
  color: var(--text);
  border-color: var(--muted);
}

/* Сетки для выбора */
.upgrade-grid-wrap {
  min-height: 200px;
}

.select-target-card.selected {
  border-color: var(--pink);
  background: rgba(42, 171, 238, 0.05);
  box-shadow: 0 4px 15px -4px var(--pink-soft);
}

/* Уменьшение масштаба предметов в инвентаре, чтобы они вписывались в карточки */
.inv-card .thumb img,
.inv-card .thumb .gift-img,
.inv-card .thumb .premium-prize,
.inv-card .thumb .premium-svg,
.inv-card .thumb .star-prize {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  transform: scale(0.9) !important;
  transform-origin: center !important;
}

/* ==========================================================================
   OVERRIDE STYLES FOR INVENTORY AND UPGRADE CORRECTIONS
   ========================================================================== */

/* 1. Inventory Card Action Buttons Side-by-Side */
.inv-card {
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 12px 12px 16px !important;
  background: var(--card) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
}

.inv-card-actions {
  display: flex !important;
  flex-direction: row !important;
  gap: 6px !important;
  margin-top: 10px !important;
  width: 100% !important;
}

.inv-card-actions button {
  flex: 1 1 0% !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 8px 4px !important;
  font-weight: 700 !important;
  font-size: 11.5px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  white-space: nowrap !important;
}

.inv-card-actions .sell-btn {
  background: rgba(255, 255, 255, 0.03) !important;
  color: var(--text) !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
}

.inv-card-actions .sell-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06) !important;
}

.inv-card-actions .withdraw-btn {
  background: linear-gradient(180deg, #34b6f5, #229ed9) !important;
  color: #fff !important;
}

.inv-card-actions .withdraw-btn:hover:not(:disabled) {
  filter: brightness(1.08) !important;
}

.inv-card-actions button:disabled {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
}

/* 2. Upgrade Screen Slots and Items */
.upgrade-container {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 24px !important;
  padding-bottom: 30px !important;
  width: 100% !important;
}

.upgrade-wheel-section {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  padding: 10px 0 !important;
  width: 100% !important;
}

.wheel-box {
  position: relative !important;
  width: 200px !important;
  height: 200px !important;
  display: grid !important;
  place-items: center !important;
  margin: 0 auto !important;
}

.upgrade-slots {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  width: 100% !important;
}

.upgrade-slot {
  flex: 1 1 0% !important;
  aspect-ratio: 1 / 1.25 !important; /* Увеличено соотношение сторон, чтобы карточка была выше */
  background: var(--card) !important;
  border: 2px dashed var(--line) !important;
  border-radius: var(--radius) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 8px !important; /* Уменьшено padding для большей рабочей области */
  text-align: center !important;
  cursor: pointer !important;
  transition: border-color 0.2s ease, background-color 0.2s ease !important;
  overflow: hidden !important;
  min-height: 180px !important; /* Увеличено для вмещения больших превью */
}

.upgrade-slot.slot-source:hover, 
.upgrade-slot.slot-target:hover {
  border-color: var(--pink-soft) !important;
  background: rgba(42, 171, 238, 0.02) !important;
}

.upgrade-slot .slot-empty-label {
  font-size: 12px !important;
  font-weight: 600 !important;
  color: var(--muted) !important;
  line-height: 1.4 !important;
  padding: 0 10px !important;
}

.upgrade-item-card {
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
}

.upgrade-slot.slot-source .upgrade-item-card, 
.upgrade-slot.slot-target .upgrade-item-card {
  border: none !important;
  background: transparent !important;
}

.upgrade-item-card .thumb {
  position: relative !important;
  width: 96px !important;
  height: 96px !important;
  display: grid !important;
  place-items: center !important;
  margin-bottom: 6px !important;
  flex-shrink: 0 !important;
}

.upgrade-item-card .thumb img,
.upgrade-item-card .thumb .gift-img,
.upgrade-item-card .thumb .premium-prize,
.upgrade-item-card .thumb .premium-svg,
.upgrade-item-card .thumb .star-prize {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  transform: scale(1.0) !important; /* На всю область без уменьшения */
}

.upgrade-item-card .name {
  font-size: 14.5px !important; /* Увеличено как в инвентаре */
  font-weight: 700 !important;
  color: var(--text) !important;
  margin-top: 2px !important;
  margin-bottom: 4px !important;
  text-overflow: ellipsis !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  max-width: 100% !important;
  text-align: center !important;
  flex-shrink: 0 !important;
  height: 18px !important;
  line-height: 18px !important;
}

.upgrade-item-card .price {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 3px !important;
  font-size: 16px !important; /* Увеличено как в инвентаре */
  font-weight: 700 !important;
  margin-top: 0 !important;
  margin-bottom: 2px !important;
  flex-shrink: 0 !important;
  height: 18px !important;
  line-height: 18px !important;
}

.upgrade-item-card .price img {
  width: 16px !important; /* Увеличено как в инвентаре */
  height: 16px !important;
}

.upgrade-item-card .price-ton {
  font-size: 13px !important; /* Увеличено как в инвентаре */
  font-weight: 700 !important; /* Жирный как у звезд */
  color: #0098ea !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 2px !important;
  margin-top: 0px !important;
  margin-bottom: 2px !important;
  flex-shrink: 0 !important;
  height: 16px !important;
  line-height: 16px !important;
}

.upgrade-item-card .price-ton img,
.upgrade-item-card .price-ton .ton-icon {
  width: 17px !important;
  height: 17px !important;
}


.upgrade-divider {
  display: grid !important;
  place-items: center !important;
  color: var(--muted) !important;
  flex: 0 0 auto !important;
  animation: pulseDivider 2s infinite alternate ease-in-out !important;
}

@keyframes pulseDivider {
  0% { transform: scale(0.92); opacity: 0.5; }
  100% { transform: scale(1.08); opacity: 0.9; }
}

/* 3. Missing Selection & Checkmark styles */
.select-source-card.selected,
.select-target-card.selected {
  border-color: var(--pink) !important;
  background: rgba(42, 171, 238, 0.08) !important;
  box-shadow: 0 4px 15px -4px var(--pink-soft) !important;
}

.select-badge {
  position: absolute !important;
  top: 6px !important;
  right: 6px !important;
  width: 18px !important;
  height: 18px !important;
  border-radius: 50% !important;
  background: var(--pink) !important;
  color: #fff !important;
  display: grid !important;
  place-items: center !important;
  box-shadow: 0 2px 6px rgba(42, 171, 238, 0.4) !important;
  z-index: 5 !important;
}

.select-badge svg {
  width: 10px !important;
  height: 10px !important;
  stroke: #fff !important;
}

/* ==========================================================================
   MOBILE DEVICE PREVIEW ON DESKTOP (PC) SCREENS
   ========================================================================== */
@media (min-width: 481px) {
  .hud-logo-img {
    height: 145px !important; /* Scaled on PC */
    max-width: 60% !important;
  }
  /* 1. Center the viewport box on PC */
  html {
    overflow: hidden !important;
    overflow-x: hidden !important;
    height: 100% !important;
    width: 100% !important;
  }
  body {
    background: #020204 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    height: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important; /* Completely block page scroll */
    overflow-x: hidden !important;
  }

  /* 2. Style the #app container as a clean viewport box stretching 100% height */
  #app {
    position: relative !important;
    width: 480px !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.75) !important;
    background: var(--bg) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  /* 3. Render content within viewport bounds with independent scroll */
  .view {
    flex: 1 !important;
    overflow-y: auto !important;
    width: 100% !important;
    height: 100% !important;
    padding: 20px 14px calc(var(--nav-h) + 24px) !important;
    /* Custom thin scrollbar */
    scrollbar-width: thin !important;
    scrollbar-color: rgba(255,255,255,0.08) transparent !important;
  }
  .view::-webkit-scrollbar {
    width: 4px !important;
  }
  .view::-webkit-scrollbar-track {
    background: transparent !important;
  }
  .view::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08) !important;
    border-radius: 2px !important;
  }

  /* 4. Position the tabbar absolutely at the bottom of #app */
  .tabbar {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
    width: 100% !important;
    max-width: 100% !important;
    border-top: 1px solid var(--line) !important;
    background: rgba(14, 14, 18, 0.95) !important;
  }

  /* 5. Keep modals/drawers inside the viewport container */
  .drawer-backdrop {
    position: absolute !important;
    inset: 0 !important;
    z-index: 1000 !important;
  }

  .drawer-container {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    max-height: 80% !important;
    z-index: 1001 !important;
  }

  /* 6. Keep background glows positioned nicely inside the viewport */
  .bg-glow {
    position: absolute !important;
    width: 250px !important;
    height: 250px !important;
  }

  /* 7. Fit toast notices within the frame boundaries */
  .toast-container {
    position: absolute !important;
    left: 50% !important;
    transform: translate(-50%, 20px) !important;
    width: calc(100% - 32px) !important;
    max-width: 100% !important;
    z-index: 2000 !important;
  }
  .toast-container.active {
    transform: translate(-50%, 0) !important;
  }
}

/* ==========================================================================
   CARD PROPORTIONS CORRECTION (SQUAREISH 1:1.22 ASPECT RATIO)
   ========================================================================== */
.inv-card {
  /* Fixed height to ensure all cards align perfectly without any vertical shifting */
  height: 230px !important;
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  padding: 16px 14px 18px !important;
  background: var(--card) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 220px !important;
  margin: 0 auto !important;
  overflow: hidden !important;
}

.inv-card .thumb {
  position: relative !important;
  width: 100% !important;
  height: 110px !important;
  display: grid !important;
  place-items: center !important;
  margin-bottom: 10px !important;
  margin-top: 0 !important;
}

/* Force absolute centering and scale-down on all dynamic elements inside thumbs */
.inv-card .thumb > *:not(.glow) {
  position: relative !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 96px !important; /* Использование фиксированного пиксельного максимума гарантирует одинаковый размер */
  max-height: 96px !important;
  transform: scale(1.18) !important;
}

.inv-card .thumb img,
.inv-card .thumb .gift-img,
.inv-card .thumb .premium-prize,
.inv-card .thumb .premium-svg,
.inv-card .thumb .star-prize {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}

.inv-card .name {
  font-size: 15px !important; /* Увеличено */
  font-weight: 700 !important; /* Сделано жирнее */
  color: var(--text) !important;
  margin: 0 0 6px 0 !important;
  text-overflow: ellipsis !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  width: 100% !important;
  text-align: center !important;
  flex-shrink: 0 !important;
  height: 18px !important;
  line-height: 18px !important;
}

/* Wrapper for prices so they stack nicely if there is TON price */
.inv-card .price-wrapper {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 4px !important;
  width: 100% !important;
}

.inv-card .price {
  font-size: 17px !important; /* Увеличено */
  font-weight: 750 !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
}

.inv-card .price img {
  width: 18px !important; /* Увеличено */
  height: 18px !important;
}

.inv-card .price-ton {
  font-size: 13.5px !important; /* Увеличено */
  font-weight: 750 !important; /* Сделано жирным как у звезд */
  color: #0098ea !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 2px !important;
  margin: 0 !important;
}

.inv-card .price-ton img,
.inv-card .price-ton .ton-icon {
  width: 18px !important;
  height: 18px !important;
}

.inv-card-actions {
  margin-top: 10px !important; /* Force space below the card */
  display: flex !important;
  flex-direction: row !important;
  gap: 6px !important;
  margin-bottom: 0 !important;
  width: 100% !important;
  flex-shrink: 0 !important;
}

.inv-card-actions button {
  flex: 1 1 0% !important;
  border: none !important;
  border-radius: 11px !important;
  padding: 10px 4px !important;
  font-weight: 700 !important;
  font-size: 13.5px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  white-space: nowrap !important;
  height: 40px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* ==========================================================================
   CENTERED AND STYLISH UPGRADE TABS
   ========================================================================== */
.upgrade-tabs {
  display: flex !important;
  background: rgba(255, 255, 255, 0.02) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  border-radius: 14px !important;
  padding: 4px !important;
  gap: 6px !important;
  margin: 24px auto 16px !important;
  max-width: 320px !important;
  width: 100% !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5) !important;
}

.upgrade-tab {
  flex: 1 !important;
  padding: 10px 8px !important;
  border: none !important;
  border-radius: 10px !important;
  background: transparent !important;
  color: var(--muted) !important;
  font-family: inherit !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  text-align: center !important;
  white-space: nowrap !important;
}

.upgrade-tab.active {
  background: linear-gradient(135deg, #34b6f5, #229ed9) !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(34, 158, 217, 0.3) !important;
}

/* ==========================================================================
   MODERN CASE WIN ACTIONS
   ========================================================================== */
.win-actions-all {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  margin-top: 24px !important;
  width: 100% !important;
  max-width: 320px !important;
}

.win-actions-all .btn {
  padding: 14px 20px !important;
  border-radius: 12px !important;
  font-size: 14px !important;
  font-weight: 750 !important;
  letter-spacing: 0.5px !important;
}

.win-actions-all .btn-sell {
  background: linear-gradient(135deg, #34b6f5, #229ed9) !important;
  color: #fff !important;
  box-shadow: 0 6px 20px rgba(34, 158, 217, 0.3) !important;
  border: none !important;
}

.win-actions-all .btn-keep {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #fff !important;
  box-shadow: none !important;
}

.win-actions-all .btn-keep:hover {
  background: rgba(255, 255, 255, 0.07) !important;
}

/* ==========================================================================
   MULTI-ITEM UPGRADE SLOT STYLING (2x2 GRID)
   ========================================================================== */
.upgrade-multi-card {
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
}

.multi-thumbs-grid {
  display: grid !important;
  gap: 6px !important;
  margin-bottom: 6px !important;
  justify-content: center !important;
  align-items: center !important;
}

/* 2 items layout: side-by-side, larger */
.multi-thumbs-grid.count-2 {
  grid-template-columns: repeat(2, 1fr) !important;
  grid-template-rows: 1fr !important;
  width: 120px !important;
  height: 57px !important;
  gap: 6px !important;
}
.multi-thumbs-grid.count-2 .multi-thumb-item {
  width: 57px !important;
  height: 57px !important;
}

/* 3 items layout: 2 on top, 1 bottom center */
.multi-thumbs-grid.count-3 {
  grid-template-columns: repeat(2, 1fr) !important;
  grid-template-rows: repeat(2, 1fr) !important;
  width: 120px !important;
  height: 120px !important;
  gap: 6px !important;
}
.multi-thumbs-grid.count-3 .multi-thumb-item {
  width: 57px !important;
  height: 57px !important;
}
.multi-thumbs-grid.count-3 .multi-thumb-item:nth-child(3) {
  grid-column: 1 / span 2 !important;
  justify-self: center !important;
}

/* 4 or more items layout: 2x2 grid */
.multi-thumbs-grid.count-4,
.multi-thumbs-grid.count-more {
  grid-template-columns: repeat(2, 1fr) !important;
  grid-template-rows: repeat(2, 1fr) !important;
  width: 120px !important;
  height: 120px !important;
  gap: 6px !important;
}
.multi-thumbs-grid.count-4 .multi-thumb-item,
.multi-thumbs-grid.count-more .multi-thumb-item {
  width: 57px !important;
  height: 57px !important;
}

.multi-thumb-item {
  position: relative !important;
  background: rgba(255, 255, 255, 0.02) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 6px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  padding: 1px !important;
  box-sizing: border-box !important;
}

.multi-thumb-item img, 
.multi-thumb-item .gift-img, 
.multi-thumb-item .premium-prize, 
.multi-thumb-item .premium-svg, 
.multi-thumb-item .star-prize {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  transform: scale(1.0) !important; /* Увеличено с 0.9 для максимального масштаба */
}

.upgrade-multi-card .name {
  font-size: 14.5px !important; /* Увеличено как в инвентаре */
  font-weight: 700 !important;
  color: var(--text) !important;
  margin-top: 2px !important;
  margin-bottom: 4px !important;
  text-align: center !important;
  flex-shrink: 0 !important;
  height: 18px !important;
  line-height: 18px !important;
}

.upgrade-multi-card .price {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 3px !important;
  font-size: 16px !important; /* Увеличено как в инвентаре */
  font-weight: 700 !important;
  margin-top: 0 !important;
  margin-bottom: 2px !important;
  flex-shrink: 0 !important;
  height: 18px !important;
  line-height: 18px !important;
}

.upgrade-multi-card .price img {
  width: 16px !important; /* Увеличено как в инвентаре */
  height: 16px !important;
}

.upgrade-multi-card .price-ton {
  font-size: 13px !important; /* Увеличено как в инвентаре */
  font-weight: 700 !important; /* Жирный как у звезд */
  color: #0098ea !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 2px !important;
  margin-top: 0px !important;
  margin-bottom: 2px !important;
  flex-shrink: 0 !important;
  height: 16px !important;
  line-height: 16px !important;
}

.upgrade-multi-card .price-ton img,
.upgrade-multi-card .price-ton .ton-icon {
  width: 17px !important;
  height: 17px !important;
}

.more-overlay {
  position: absolute !important;
  inset: 0 !important;
  background: rgba(0, 0, 0, 0.75) !important;
  display: grid !important;
  place-items: center !important;
  color: #fff !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  z-index: 2 !important;
}

/* ==========================================================================
   UNIFYING CASE WIN CARDS WITH INVENTORY CARDS (DYNAMIC HEIGHT ASPECT)
   ========================================================================== */
.win-card {
  /* Fixed height to ensure all cards align perfectly without any vertical shifting */
  height: 230px !important;
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  padding: 16px 14px 18px !important;
  background: var(--card) !important;
  border: 1px solid var(--line) !important;
  border-radius: 12px !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 220px !important;
  margin: 0 auto !important;
  overflow: hidden !important;
}

.win-card .win-thumb {
  position: relative !important;
  width: 100% !important;
  height: 110px !important;
  display: grid !important;
  place-items: center !important;
  margin-bottom: 10px !important;
  margin-top: 0 !important;
}

/* Force absolute centering and scale-down on all dynamic elements inside win-thumbs */
.win-card .win-thumb > *:not(.glow) {
  position: relative !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 96px !important; /* Фиксированный максимум для одинакового масштаба */
  max-height: 96px !important;
  transform: scale(1.18) !important;
}

.win-card .win-thumb img,
.win-card .win-thumb .gift-img,
.win-card .win-thumb .premium-prize,
.win-card .win-thumb .premium-svg,
.win-card .win-thumb .star-prize {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}

.win-card .win-card-title {
  font-size: 15px !important; /* Увеличено для большего размера */
  font-weight: 700 !important;
  color: var(--text) !important;
  margin: 0 0 6px 0 !important;
  text-overflow: ellipsis !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  width: 100% !important;
  text-align: center !important;
  flex-shrink: 0 !important;
  height: 18px !important;
  line-height: 18px !important;
}

.win-card .win-price {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  width: 100% !important;
}

.win-card .win-price .price {
  font-size: 17px !important; /* Увеличено для большего размера */
  font-weight: 750 !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
}

.win-card.no-ton .win-card-title {
  margin-bottom: 6px !important;
}

.win-card .win-price img {
  width: 18px !important; /* Увеличено для лучшей видимости */
  height: 18px !important;
}

.win-card .win-price-ton {
  font-size: 13.5px !important; /* Увеличено для большего размера */
  font-weight: 750 !important; /* Сделано жирным как у звезд */
  color: #0098ea !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 2px !important;
  margin: 0 !important;
}

.win-card .win-price-ton img,
.win-card .win-price-ton .ton-icon {
  width: 18px !important;
  height: 18px !important;
}

.card-wrapper {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.win-sell-one {
  width: 100% !important;
  height: 40px !important;
  font-size: 14px !important;
  padding: 10px 4px !important;
  border-radius: 11px !important;
  flex-shrink: 0 !important;
  margin-top: 10px !important;
  background: rgba(255, 255, 255, 0.04) !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-weight: 700 !important;
  letter-spacing: 0.2px !important;
  transition: all 0.2s ease !important;
  user-select: none !important;
}

.win-sell-one:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

.win-sell-one:disabled {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
}

.win-sub {
  font-size: 13px !important;
  color: var(--muted) !important;
  margin-top: 10px !important;
  text-align: center !important;
  width: 100% !important;
  flex-shrink: 0 !important;
}

/* ---------- Summer Event Banner ---------- */
.summer-banner-container {
  position: relative !important;
  width: 100% !important;
  margin-top: 8px !important;
  margin-bottom: 24px !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  overflow: hidden !important;
  border-radius: var(--radius) !important;
}

.summer-banner {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 3 / 4 !important;
  object-fit: cover !important;
  border-radius: var(--radius) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.summer-banner-overlay {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background: transparent !important; /* No tinting/toning */
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important; /* Aligned to the top */
  align-items: center !important;
  padding: 12px !important;
  z-index: 3 !important;
  pointer-events: none !important;
}

.summer-banner-text-img {
  width: 100% !important;
  height: auto !important;
  object-fit: contain !important;
  pointer-events: none !important;
}

.summer-banner-btn {
  background: #facc15 !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  font-size: 15px !important;
  text-transform: uppercase !important;
  letter-spacing: 1.5px !important;
  padding: 14px 36px !important;
  border-radius: 8px !important;
  border: none !important;
  box-shadow: 0 4px 16px rgba(250, 204, 21, 0.4) !important;
  cursor: pointer !important;
  margin-top: auto !important;
  margin-bottom: 70px !important;
  pointer-events: auto !important;
  transition: transform 0.2s ease, background-color 0.2s ease !important;
}

.summer-banner-btn:hover {
  background: #eab308 !important;
  transform: scale(1.03) !important;
}

.summer-banner-btn:active {
  transform: scale(0.98) !important;
}

/* ---------- Top Fixed HUD Header ---------- */
.hud-header {
  position: fixed !important;
  top: 0 !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: 100% !important;
  max-width: var(--maxw) !important;
  height: 80px !important;
  background: rgba(10, 10, 12, 0.85) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border-bottom: 1px solid var(--line) !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0 16px !important;
  box-sizing: border-box !important;
  z-index: 999 !important;
}

.hud-logo {
  display: flex !important;
  align-items: center !important;
  height: 100% !important;
  cursor: pointer !important;
}

.hud-logo-img {
  height: 135px !important; /* Slightly larger height */
  max-width: 80% !important; /* Wider maximum limit */
  width: auto !important;
  object-fit: contain !important;
  transform: scaleX(1.18) !important; /* Perfectly balanced horizontal scale */
  transform-origin: left center !important;
}


.hud-right {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 15px !important;
}

.hud-right .balance-pill {
  margin: 0 !important;
  height: 50px !important;
  display: flex !important;
  align-items: center !important;
  padding: 0 15px !important;
  font-size: 20px !important;
  font-weight: 750 !important;
  border-radius: 25px !important;
}

.hud-right .balance-pill svg {
  width: 26px !important;
  height: 26px !important;
}

.hud-right .balance-pill .plus-circle {
  font-size: 22px !important;
  width: 26px !important;
  height: 26px !important;
  margin-left: 6px !important;
}

.hud-profile-btn {
  width: 50px !important;
  height: 50px !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  cursor: pointer !important;
  overflow: hidden !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  transition: transform 0.1s ease !important;
}

.hud-profile-btn:active {
  transform: scale(0.95) !important;
}

.hud-avatar-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

.hud-avatar-char {
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: var(--pink) !important;
  font-weight: 800 !important;
  font-size: 21px !important;
  background: rgba(42, 171, 238, 0.15) !important;
}

/* Override page top padding to prevent content from hiding behind HUD */
.view {
  padding-top: 96px !important;
}

@media (min-width: 481px) {
  .hud-header {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 0 !important;
  }
}

/* --- Pagination styling --- */
.upgrade-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  margin-bottom: 20px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.upgrade-pagination:empty {
  display: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

.pag-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 6px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: #8e9297;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.pag-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: #fff;
  transform: translateY(-1px);
}

.pag-btn:active:not(:disabled) {
  transform: translateY(0);
  background: rgba(255, 255, 255, 0.12);
}

.pag-btn.active {
  background: linear-gradient(135deg, #0088cc, #00a2ff);
  border-color: #00a2ff;
  color: #fff;
  box-shadow: 0 0 10px rgba(0, 162, 255, 0.3);
}

.pag-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.pag-ellipsis {
  color: rgba(255, 255, 255, 0.3);
  padding: 0 4px;
  font-size: 10px;
  letter-spacing: 1px;
}

/* ===================== Authorization & Rules Modal ===================== */
.auth-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 10000;
  background: rgba(10, 10, 12, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  font-family: 'Inter', sans-serif;
}

.auth-modal {
  background: rgba(20, 20, 24, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  width: 100%;
  max-width: 460px;
  padding: 28px;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: authFadeIn 0.3s ease-out;
}

@keyframes authFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.auth-title {
  font-size: 20px;
  font-weight: 800;
  text-align: center;
  background: linear-gradient(135deg, #fff, #888);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 3px;
}

.auth-tab-btn {
  flex: 1;
  background: none;
  border: none;
  color: #8e9297;
  font-size: 13px;
  font-weight: 600;
  padding: 8px;
  cursor: pointer;
  border-radius: 7px;
  transition: all 0.2s;
}

.auth-tab-btn.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.auth-doc-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 16px;
  height: 280px;
  overflow-y: auto;
  font-size: 11px;
  line-height: 1.6;
  color: #b9bbbe;
}

.auth-doc-box h3 {
  margin-top: 0;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.auth-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-checkbox-row {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 13px;
  color: #b9bbbe;
}

.auth-checkbox-row input {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #00a2ff;
  flex-shrink: 0;
}

.auth-checkbox-row span {
  user-select: none;
}

.auth-submit-btn {
  background: linear-gradient(135deg, #0088cc, #00a2ff);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 162, 255, 0.2);
  transition: all 0.2s;
}

.auth-submit-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 162, 255, 0.3);
}

.auth-submit-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

/* ===================== Segmented Language Toggle ===================== */
.lang-switch-container {
  display: flex;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 3px;
}

.lang-btn-opt {
  background: none;
  border: none;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  color: #8e9297;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.lang-btn-opt.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* ===================== Custom Top-Up Styles ===================== */
.topup-input-container {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 10px 20px;
  margin: 15px auto 20px;
  max-width: 260px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.topup-input-container:focus-within {
  border-color: #00a2ff;
  box-shadow: 0 0 12px rgba(0, 162, 255, 0.3);
}
.topup-number-input {
  background: none;
  border: none;
  color: #fff;
  font-size: 28px;
  font-weight: 850;
  text-align: center;
  width: 140px;
  outline: none;
  font-family: 'Inter', sans-serif;
}
.topup-number-input::-webkit-outer-spin-button,
.topup-number-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.topup-number-input {
  -moz-appearance: textfield;
}
.topup-star-symbol {
  font-size: 28px;
  color: #ffb500;
  margin-left: 10px;
  text-shadow: 0 0 10px rgba(255, 181, 0, 0.4);
}
.topup-error-text {
  animation: authFadeIn 0.25s ease-out;
}

/* Fix for iOS WebKit WebView: prevent parents with user-select:none from blocking keyboard/typing in inputs */
input[type="text"], input[type="number"], input[type="password"], input[type="search"], textarea, [contenteditable="true"] {
  user-select: text !important;
  -webkit-user-select: text !important;
}