:root {
  --bg-1: #0a0a1a;
  --bg-2: #0f0f2d;
  --accent-1: #8b5cf6;
  --accent-2: #a855f7;
  --glass: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.15);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --muted: rgba(255, 255, 255, 0.7);
  --radius: 16px;
  --max-width: 1100px;
  --nav-height: 80px;
  /* новый отступ снизу с учётом высоты панели и безопасной зоны */
  --bottom-offset: calc(var(--nav-height) + 28px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100%;
  overflow-y: auto; /* разрешаем вертикальную прокрутку страницы */
  overflow-x: hidden;
  position: static;
  width: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: 
    radial-gradient(ellipse at 20% 20%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(168, 85, 247, 0.1) 0%, transparent 50%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 100%);
  color: #fff;
}

/* Snow - только на фоне, не поверх элементов */
.snow-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0; /* Теперь снег под всеми элементами */
  overflow: hidden;
}

.snowflake {
  position: absolute;
  top: -10px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  opacity: 0.9;
  animation: fall linear infinite;
}

@keyframes fall {
  to {
    transform: translateY(100vh) rotate(360deg);
  }
}

/* Glass Morphism - непрозрачные элементы */
.glass {
  background: rgba(16, 16, 32, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  position: relative;
  z-index: 2;
}

/* App Layout */
.app-container {
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  position: relative; /* не фиксируем, позволяя странице прокручиваться */
  z-index: 1;
}

/* Header */
.header {
  flex-shrink: 0;
  padding: 15px 16px 0;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
}

.header-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius);
  text-align: center;
}

.header-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.logo {
  font-size: 24px;
  font-weight: 800;
  background: linear-gradient(45deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 8px rgba(139, 92, 246, 0.3));
  letter-spacing: 0.5px;
}

.header-subtitle {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.balance-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.balance-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.balance-container {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 18px;
  min-width: 120px;
  justify-content: center;
}

.balance {
  font-weight: 800;
  font-size: 20px;
  background: linear-gradient(45deg, #fff, #e0e0e0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 4px rgba(139, 92, 246, 0.3));
}

.balance-icon {
  width: 24px;
  height: 24px;
  filter: drop-shadow(0 2px 4px rgba(139, 92, 246, 0.4));
}

.stats-row {
  display: flex;
  gap: 16px;
  margin-top: 8px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-value {
  font-weight: 700;
  font-size: 16px;
  color: var(--accent-1);
}

.stat-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

/* Main Content */
.main-content {
  flex: 1;
  overflow-y: visible; /* позволяем странице прокручиваться естественно */
  overflow-x: hidden;
  margin: 0;
  padding: 16px;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  /* основной контент: резервируем место под нижнюю панель */
  padding-bottom: var(--bottom-offset);
}

.page {
  display: none;
}

.page.active {
  display: block;
}

/* Category Selector */
.category-selector {
  margin-bottom: 24px;
  position: sticky;
  top: 0;
  z-index: 10;
  padding-top: 8px;
  background: linear-gradient(180deg, var(--bg-1) 0%, transparent 100%);
}

.category-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 4px;
  gap: 4px;
}

.category-tab {
  flex: 1;
  padding: 14px 16px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.category-tab:hover {
  color: white;
  background: rgba(255, 255, 255, 0.05);
}

.category-tab.active {
  background: rgba(139, 92, 246, 0.2);
  color: white;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

/* Category Content */
.category-content {
  display: none;
}

.category-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* Gift Selection */
.gift-selection {
  padding-bottom: 20px;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 20px;
  text-align: center;
  text-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.gifts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 0;
}

.gift-card {
  padding: 22px;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  cursor: pointer;
  transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 200px; /* подогнано под уменьшенные изображения */
  position: relative;
  overflow: hidden;
}

.gift-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s;
}

.gift-card:hover::before {
  left: 100%;
}

.gift-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 
    0 20px 40px rgba(139, 92, 246, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.gift-image {
  width: 100px;
  height: 100px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
}

.gift-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.gift-name {
  font-size: 16px;
  font-weight: 700;
  text-align: center;
}

.gift-price {
	/* новый стиль: компактный pill-бейдж */
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 10px;
	border-radius: 999px;
	background: linear-gradient(90deg, rgba(139,92,246,0.12), rgba(168,85,247,0.08));
	border: 1px solid rgba(139,92,246,0.18);
	color: #fff;
	font-weight: 800;
	font-size: 14px;
	box-shadow: 0 6px 18px rgba(139,92,246,0.06);;
	transition: transform .15s ease, box-shadow .15s ease;
}

.gift-price:hover {
	transform: translateY(-2px);
	box-shadow: 0 12px 28px rgba(139,92,246,0.12);
}

/* маленькая аккуратная иконка звезды */
.price-star {
	width: 14px;
	height: 14px;
	display: inline-block;
	object-fit: contain;
	border-radius: 50%;
	filter: drop-shadow(0 1px 2px rgba(0,0,0,0.25));
}

/* модальная цена — тот же визуальный стиль, но чуть крупнее */
#payment-gift-price {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 8px 12px;
	border-radius: 999px;
	background: linear-gradient(90deg, rgba(139,92,246,0.14), rgba(168,85,247,0.09));
	border: 1px solid rgba(139,92,246,0.2);
	font-weight: 900;
	font-size: 18px;
	color: #fff;
	box-shadow: 0 10px 26px rgba(139,92,246,0.08);
}

/* небольшая корректировка иконки в модальном окне */
#payment-gift-price .price-star {
	width: 16px;
	height: 16px;
}

.gift-chance {
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
}

/* Cases Section */
.cases-section {
  padding-bottom: 20px;
}

.cases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 0;
}

.case-card {
  padding: 24px;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  min-height: 280px;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.case-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s;
}

.case-card:hover::before {
  left: 100%;
}

.case-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: var(--accent-1);
  box-shadow: 
    0 20px 40px rgba(139, 92, 246, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.case-image {
  width: 140px;
  height: 140px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 4px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
}

.case-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.case-name {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  color: white;
}

.case-price {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(139,92,246,0.2), rgba(168,85,247,0.15));
  border: 1px solid rgba(139,92,246,0.3);
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 8px 20px rgba(139,92,246,0.1);
}

.case-rewards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 8px;
}

.reward-item {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.reward-item.highlight {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  font-weight: 600;
}

.case-chance {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin-top: 8px;
}

/* Case Spin Animation */
.case-spin-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(20px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.case-spin-content {
  width: 90%;
  max-width: 500px;
  border-radius: 20px;
  padding: 30px;
  animation: modalAppear 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
}

.spin-wheel {
  width: 250px;
  height: 250px;
  margin: 0 auto 30px;
  position: relative;
  border-radius: 50%;
  overflow: hidden;
  border: 8px solid var(--accent-1);
  background: rgba(0, 0, 0, 0.5);
}

.spin-wheel-items {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.spin-item {
  position: absolute;
  width: 50%;
  height: 50%;
  transform-origin: 100% 100%;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 20px;
  color: white;
  font-weight: 600;
}

.spin-item.empty {
  color: var(--muted);
}

.spin-pointer {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 40px;
  color: var(--accent-1);
  font-size: 32px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
  z-index: 10;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.spinning {
  animation: spin 0.1s linear infinite;
}

/* Shop - Updated Stars Packages */
.stars-packages {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 20px;
}

.package-card {
  padding: 24px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  min-height: 120px;
}

.package-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(168, 85, 247, 0.1));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.package-card:hover::before {
  opacity: 1;
}

.package-card:hover {
  transform: translateY(-4px);
  box-shadow: 
    0 15px 30px rgba(139, 92, 246, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.package-card.popular {
  border: 2px solid var(--accent-1);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(168, 85, 247, 0.15));
}

.popular-badge {
  position: absolute;
  top: -8px;
  right: 20px;
  background: var(--accent-1);
  color: white;
  padding: 6px 14px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.package-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.package-amount {
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(45deg, #fff, #e0e0e0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 4px rgba(139, 92, 246, 0.3));
}

.package-icon {
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 2px 4px rgba(139, 92, 246, 0.4));
}

.package-price {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent-1);
  text-shadow: 0 2px 4px rgba(139, 92, 246, 0.3);
}

.package-bonus {
  position: absolute;
  bottom: 12px;
  left: 24px;
  font-size: 12px;
  color: #10b981;
  font-weight: 600;
}

/* Profile */
.profile-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 20px;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius);
}

.user-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid var(--accent-1);
  object-fit: cover;
}

.user-info {
  flex: 1;
}

.user-name {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}

.user-username {
  color: var(--muted);
  font-size: 14px;
}

.profile-sections {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.section {
  padding: 20px;
  border-radius: var(--radius);
}

.promo-input {
  display: flex;
  gap: 12px;
  align-items: center;
}

.promo-input input {
  flex: 1;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.08);
  color: white;
  font-size: 16px;
  outline: none;
  transition: all 0.3s ease;
}

.promo-input input:focus {
  border-color: var(--accent-1);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

.promo-input input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.promo-btn {
  padding: 14px 24px;
  border-radius: var(--radius);
  border: none;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: white;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.promo-btn:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 10px 20px rgba(139, 92, 246, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.user-gifts {
  display: flex;
  flex-direction: row;
  gap: 12px;
  align-items: center;
  overflow-x: auto;
  padding: 8px 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.user-gifts::-webkit-scrollbar {
  height: 6px;
}

.user-gifts::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08);
  border-radius: 6px;
}

.inventory-text-item {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.03);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}

/* когда инвентарь пуст — показать менее выделенный текст */
.user-gifts.horizontal .inventory-text-item.empty {
  background: transparent;
  color: rgba(255,255,255,0.7);
  font-weight: 600;
}

/* Empty Inventory */
.empty-inventory {
  text-align: center;
  padding: 40px 20px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  border: 2px dashed rgba(255, 255, 255, 0.1);
}

.empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.7;
  filter: drop-shadow(0 4px 8px rgba(139, 92, 246, 0.3));
}

.empty-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #fff;
}

.empty-subtitle {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 20px;
  opacity: 0.8;
}

.empty-button {
  padding: 12px 24px;
  border-radius: var(--radius);
  border: none;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
}

.empty-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(139, 92, 246, 0.3);
}

/* Bottom Navigation — плавающая полукруглая панель */
.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 18px;
  width: min(520px, calc(100% - 48px));
  max-width: 520px;
  padding: 8px;
  border-radius: 34px;
  background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.04);
  box-shadow: 0 12px 30px rgba(0,0,0,0.45);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-container {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between; /* ровно 3 кнопки */
  gap: 6px;
  padding: 0 6px;
}

/* упрощённые кнопки — ровно 3, без лишних эффектов */
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 0;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease;
  flex-basis: calc(100% / 3 - 8px);
  max-width: calc(100% / 3 - 8px);
  background: transparent;
  color: var(--muted);
  border: none;            /* убрать любую рамку */
  box-shadow: none;        /* убрать квадратные тени */
  overflow: visible;
}

/* отключаем визуальные псевдоэлементы */
.nav-item::before { display: none; }

.nav-item:hover {
  transform: translateY(-2px);
  color: white;
  background: rgba(255,255,255,0.02);
}

/* мягкая подсветка активной кнопки, без жёсткой рамки */
.nav-item.active {
  color: var(--accent-1);
  background: linear-gradient(135deg, rgba(139,92,246,0.12), rgba(168,85,247,0.08));
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(139,92,246,0.08);
}

/* иконки и подписи компактнее */
.nav-icon { font-size: 20px; }
.nav-label { font-size: 12px; font-weight: 700; }

/* Mobile adjustments */
@media (max-width: 480px) {
  .bottom-nav { width: calc(100% - 32px); padding: 6px; border-radius: 28px; }
  .nav-item { padding: 10px 0; flex-basis: calc(100% / 3 - 6px); max-width: none; }
  .nav-icon { font-size: 18px; }
}

/* Modals */
.payment-modal,
.spin-modal,
.message-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(20px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.payment-container,
.spin-container,
.message-content {
  width: 90%;
  max-width: 400px;
  border-radius: 20px;
  padding: 24px;
  animation: modalAppear 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin: auto;
}

/* Payment Modal */
.payment-container {
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.payment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  position: relative;
}

.payment-header h3 {
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  width: 100%;
  margin: 0;
}

.payment-close {
  position: absolute;
  right: 0;
  top: 0;
  font-size: 28px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s ease;
}

.payment-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.payment-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  flex: 1;
}

.selected-gift {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0;
  gap: 16px;
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

#payment-gift-image {
  width: 160px;
  height: 160px;
  max-width: 100%;
  max-height: 60vh;
  border-radius: 20px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  object-fit: cover;
  box-sizing: border-box;
  background: transparent;
}

.gift-details {
  text-align: center;
  background: transparent;
}

.gift-name {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #fff;
}

.gift-price {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent-1);
}

.payment-options {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.payment-title {
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 16px;
  color: var(--muted);
}

.payment-option {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
}

.payment-option:hover {
  transform: translateX(5px);
  background: rgba(255, 255, 255, 0.05);
}

.option-icon {
  font-size: 24px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.option-info {
  flex: 1;
  text-align: left;
}

.option-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
  color: #fff;
}

.option-desc {
  font-size: 13px;
  color: var(--muted);
}

.option-arrow {
  font-size: 20px;
  color: var(--muted);
  flex-shrink: 0;
}

/* Spin Modal */
.spin-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 24px;
  max-height: 90vh;
  overflow-y: auto;
}

.result-header {
  margin-bottom: 0;
}

.result-title {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 0;
  display: none;
}

.result-title.success {
  display: block;
  color: #10b981;
  text-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.result-title.fail {
  display: block;
  color: #ef4444;
  text-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.result-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 0;
}

.result-image {
  margin-bottom: 0;
}

#result-gift-image {
  width: 160px;
  height: 160px;
  border-radius: 20px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  object-fit: cover;
}

.result-text {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
}

.result-buttons {
  display: flex;
  gap: 12px;
  width: 100%;
  max-width: 300px;
  margin-top: 0;
}

.result-btn {
  flex: 1;
  padding: 14px 20px;
  border-radius: 12px;
  border: none;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
}

.result-btn.continue {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: white;
  width: 100%;
}

.result-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(139, 92, 246, 0.3);
}

/* Message Modal */
.message-content {
  text-align: center;
  max-width: 320px;
  padding: 28px;
}

#message-text {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 20px;
  color: #fff;
  line-height: 1.4;
}

.message-close {
  padding: 12px 32px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: white;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
  width: 100%;
  max-width: 200px;
}

.message-close:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(139, 92, 246, 0.3);
}

/* Maintenance Modal */
.maintenance-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(20px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  padding: 20px;
}

.maintenance-container {
  width: 90%;
  max-width: 400px;
  border-radius: 20px;
  padding: 30px;
  text-align: center;
  animation: modalAppear 0.5s ease;
}

.maintenance-icon {
  font-size: 64px;
  margin-bottom: 20px;
  filter: drop-shadow(0 4px 12px rgba(139, 92, 246, 0.4));
}

.maintenance-title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 16px;
  background: linear-gradient(45deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.maintenance-message {
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 8px;
}

.maintenance-submessage {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  opacity: 0.8;
}

/* Modal Animations */
@keyframes modalAppear {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes modalDisappear {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  to {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
}

.modal-show {
  animation: modalAppear 0.3s ease forwards;
}

.modal-hide {
  animation: modalDisappear 0.3s ease forwards;
}

/* Preloader */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--bg-1), var(--bg-2));
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loader-container {
  text-align: center;
  padding: 40px;
  border-radius: var(--radius);
}

.loader-logo {
  font-size: 32px;
  font-weight: 800;
  background: linear-gradient(45deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 24px;
  filter: drop-shadow(0 4px 8px rgba(139, 92, 246, 0.3));
}

.loader-bar {
  width: 200px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 12px;
}

.loader-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  border-radius: 3px;
  animation: loading 2s ease-in-out infinite;
}

@keyframes loading {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(0); }
  100% { transform: translateX(100%); }
}

.loader-text {
  color: var(--muted);
  font-size: 14px;
}

/* Auth Required */
.auth-required {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-1), var(--bg-2));
  z-index: 10000;
}

.auth-container {
  text-align: center;
  padding: 40px;
  border-radius: var(--radius);
  max-width: 400px;
  width: 90%;
}

.auth-icon {
  margin-bottom: 24px;
}

.auth-gif {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid var(--accent-1);
  box-shadow: 0 8px 32px rgba(139, 92, 246, 0.3);
}

.auth-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
}

.auth-message {
  color: var(--muted);
  margin-bottom: 24px;
  line-height: 1.5;
}

.auth-button {
  display: inline-block;
  padding: 14px 32px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: white;
  text-decoration: none;
  border-radius: var(--radius);
  font-weight: 700;
  transition: all 0.3s ease;
  margin-bottom: 12px;
}

.auth-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(139, 92, 246, 0.3);
}

.auth-hint {
  font-size: 12px;
  color: var(--muted);
}

/* Scrollbar */
.main-content::-webkit-scrollbar {
  width: 4px;
}

.main-content::-webkit-scrollbar-track {
  background: transparent;
}

.main-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
}

.main-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.payment-container::-webkit-scrollbar,
.spin-container::-webkit-scrollbar {
  width: 4px;
}

.payment-container::-webkit-scrollbar-track,
.spin-container::-webkit-scrollbar-track {
  background: transparent;
}

.payment-container::-webkit-scrollbar-thumb,
.spin-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
}

/* Utilities */
body.no-scroll {
  overflow: hidden;
}

.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .header {
    padding: 10px 12px 0;
  }
  
  .header-content {
    padding: 12px;
    gap: 10px;
  }
  
  .logo {
    font-size: 22px;
  }
  
  .gifts-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .gift-card {
    padding: 14px;
    min-height: 200px;
  }
  
  .gift-image {
    width: 90px;
    height: 90px;
  }
  
  .cases-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .case-card {
    padding: 20px;
    min-height: 240px;
  }
  
  .case-image {
    width: 120px;
    height: 120px;
  }
  
  .main-content {
    padding: 12px;
  }
  
  .payment-container,
  .spin-container,
  .message-content,
  .maintenance-container {
    width: 95%;
    max-width: 350px;
    padding: 20px;
  }
  
  #payment-gift-image {
    width: 140px;
    height: 140px;
  }
  
  .stats-row {
    gap: 12px;
  }
  
  .stat-item {
    padding: 6px 12px;
  }
  
  .nav-item {
    padding: 10px 12px;
  }
  
  .nav-icon {
    font-size: 20px;
  }
  
  .category-tab {
    padding: 12px 8px;
    font-size: 13px;
  }
  
  .spin-wheel {
    width: 200px;
    height: 200px;
  }
}

@media (max-width: 480px) {
  .gifts-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .gift-card {
    min-height: 160px;
  }
  
  .gift-image {
    width: 70px;
    height: 70px;
  }
  
  .cases-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .case-card {
    min-height: 200px;
  }
  
  .case-image {
    width: 100px;
    height: 100px;
  }
  
  .stats-row {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .stat-item {
    min-width: 70px;
    padding: 6px 10px;
  }
  
  .payment-container,
  .spin-container,
  .message-content,
  .maintenance-container {
    width: 92%;
    max-width: 320px;
    padding: 16px;
  }
  
  .payment-header h3 {
    font-size: 18px;
  }
  
  #payment-gift-image {
    width: 120px;
    height: 120px;
  }
  
  .gift-name {
    font-size: 16px;
  }
  
  .gift-price {
    font-size: 18px;
  }
  
  .payment-option {
    padding: 14px;
    gap: 12px;
  }
  
  .option-icon {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
  
  .result-title {
    font-size: 24px;
  }
  
  #result-gift-image {
    width: 120px;
    height: 120px;
  }
  
  .result-text {
    font-size: 15px;
  }
  
  .message-content {
    padding: 20px;
  }
  
  .maintenance-icon {
    font-size: 48px;
  }
  
  .maintenance-title {
    font-size: 20px;
  }
}

/* Safe Area Support */
@supports(padding: max(0px)) {
  .header {
    padding-top: max(10px, env(safe-area-inset-top));
  }
  
  .bottom-nav {
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    height: calc(var(--nav-height) + env(safe-area-inset-bottom));
  }
  
  .main-content {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
  
  .payment-modal,
  .spin-modal,
  .message-modal,
  .maintenance-modal {
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
    padding-top: max(20px, env(safe-area-inset-top));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }
}

/* Скрыть возможную старую квадратную панель если она ещё есть */
.nav-shell {
	display: none !important;
}

/* Убедиться, что осталась только одна полукруглая панель */
.bottom-nav {
	/* Уточняем визуал: полупрозрачный фон без жесткой темной вставки */
	background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.02));
	border: 1px solid rgba(255,255,255,0.04);
	box-shadow: 0 12px 30px rgba(0,0,0,0.45);
}

/* Навигация: только три плоские кнопки, без чёткой рамки */
.nav-container {
	justify-content: space-between; /* ровно 3 кнопки */
}

.nav-item {
	border: none;            /* убрать любую рамку */
	box-shadow: none;        /* убрать квадратные тени */
	background: transparent; /* минимальный фон */
}

/* Активная кнопка — мягкая подсветка, без чёткой рамки */
.nav-item.active {
	border: none;
	box-shadow: 0 10px 28px rgba(139,92,246,0.08);
}