/* ================= АДМИН-ПАНЕЛЬ ================= */
.admin-container {
  padding: 10px 20px 20px;
  max-width: 520px;
  margin: 0 auto;
  /* height removed to avoid nested scroll in admin panel */
  /* overflow-y removed to avoid nested scroll in admin panel */
}

.admin-header {
  text-align: center;
  margin-bottom: 30px;
}

.admin-title {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
  background: linear-gradient(90deg, #9fa8ff 0%, #7b68ee 40%, #4fd1c5 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.admin-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #4fd1c5;
  font-weight: 600;
  font-size: 14px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #4fd1c5;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Статистика */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 15px;
  margin-bottom: 30px;
}

.stat-card {
  background: linear-gradient(135deg, rgba(21,21,48,0.9) 0%, rgba(10,10,31,0.9) 100%);
  border: 1px solid rgba(106, 90, 205, 0.3);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(106, 90, 205, 0.2);
}

.stat-icon {
  font-size: 28px;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #9fa8ff 0%, #7b68ee 100%);
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(159, 168, 255, 0.3);
}

.stat-content {
  flex: 1;
}

.stat-number {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  color: #b8b8f5;
  text-transform: uppercase;
  font-weight: 600;
  margin-top: 4px;
  opacity: 0.9;
}

/* Управление */
.admin-controls {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.control-section {
  background: linear-gradient(135deg, rgba(21,21,48,0.9) 0%, rgba(10,10,31,0.9) 100%);
  border: 1px solid rgba(106, 90, 205, 0.3);
  border-radius: 16px;
  padding: 25px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.control-section h3 {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Инпуты */
.admin-input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(106, 90, 205, 0.3);
  border-radius: 12px;
  padding: 14px 16px;
  color: #fff;
  font-size: 14px;
  transition: all 0.3s ease;
  flex: 1;
}

.admin-input:focus {
  border-color: rgba(159, 168, 255, 0.6);
  background: rgba(255, 255, 255, 0.08);
  outline: none;
  box-shadow: 0 0 0 3px rgba(159, 168, 255, 0.1);
}

.admin-input::placeholder {
  color: #b8b8f5;
  opacity: 0.7;
}

.input-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

/* Кнопки */
.admin-btn {
  padding: 14px 20px;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.admin-btn.primary {
  background: linear-gradient(135deg, #9fa8ff 0%, #7b68ee 100%);
  color: white;
  box-shadow: 0 6px 20px rgba(159, 168, 255, 0.3);
}

.admin-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(159, 168, 255, 0.4);
}

.admin-btn.success {
  background: linear-gradient(135deg, #4fd1c5 0%, #38b2ac 100%);
  color: white;
  box-shadow: 0 6px 20px rgba(79, 209, 197, 0.3);
}

.admin-btn.danger:hover,
.admin-btn.warning:hover,
.admin-btn.info:hover,
.admin-btn.success:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(159, 168, 255, 0.4);
}

/* Списки */
.promo-list, .withdrawal-list, .user-list {
  /* max-height removed to allow outer screen to handle scrolling */
  /* overflow-y removed to avoid inner scrollbars */
  margin-top: 15px;
}

.promo-item, .withdrawal-item, .user-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(106, 90, 205, 0.2);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
}

.promo-item:hover, .withdrawal-item:hover, .user-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(159, 168, 255, 0.4);
  transform: translateY(-1px);
}

.item-info {
  flex: 1;
}

.item-title {
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 4px;
}

.item-details {
  color: #b8b8f5;
  font-size: 12px;
  opacity: 0.9;
}

.item-actions {
  display: flex;
  gap: 8px;
}

.item-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.item-btn.delete,
.item-btn.approve,
.item-btn.reject {
  background: linear-gradient(135deg, #9fa8ff 0%, #7b68ee 100%);
  color: white;
}

.item-btn:hover {
  transform: translateY(-1px);
}

/* Системные команды */
.system-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

/* Admin textarea matching inputs */
.admin-textarea {
  min-height: 90px;
  resize: vertical;
}

/* Аналитика */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 15px;
}

.analytics-card {
  background: linear-gradient(135deg, rgba(21,21,48,0.9) 0%, rgba(10,10,31,0.9) 100%);
  border: 1px solid rgba(106, 90, 205, 0.3);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transition: all 0.3s ease;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.analytics-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(106, 90, 205, 0.2);
}

.analytics-card h4 {
  color: #b8b8f5;
  font-size: 12px;
  text-transform: uppercase;
  margin-bottom: 10px;
  font-weight: 600;
  opacity: 0.9;
}

.analytics-value {
  color: #fff;
  font-size: 24px;
  font-weight: 700;
}

.loading {
  text-align: center;
  color: #b8b8f5;
  font-style: italic;
  padding: 30px;
  opacity: 0.8;
}

/* Адаптивность */
@media (max-width: 768px) {
  .admin-container {
    padding: 10px 15px 20px;
  }
  
  .admin-stats-grid {
    grid-template-columns: 1fr;
  }
  
  .input-row {
    flex-direction: column;
  }
  
  .admin-input, .admin-btn {
    width: 100%;
  }
  
  .system-controls {
    grid-template-columns: 1fr;
  }
}

/* Основные стили */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Убираем синий tap-highlight и outline у кнопок и ссылок */
button, .wallet-btn, .withdraw-btn, .task-btn, .ref-copy, #promoCodeBtn, #withdrawBtn, a {
  -webkit-tap-highlight-color: transparent;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

button:focus, .wallet-btn:focus, .withdraw-btn:focus, .task-btn:focus, .ref-copy:focus, #promoCodeBtn:focus, #withdrawBtn:focus, a:focus {
  outline: none;
  box-shadow: none;
}

body {
  font-family: 'Segoe UI', 'Roboto', sans-serif;
  background: #0a0a1f; /* Темно-синий */
  color: #e0e0ff; /* Светло-синий текст */
  display: flex;
  flex-direction: column;
  /* iOS: динамические вьюпорт-единицы, чтобы не прыгала высота */
  min-height: 100dvh;
  height: 100dvh;
  /* Разрешаем вертикальный скролл для длинных экранов (избегаем обрезания на iOS) */
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent; /* Убираем синий блок на мобильных */

  /* Safe-area отступы для iOS (челка/домашняя полоска) */
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);

  /* Сетка с синими линиями */
  background-image:
    linear-gradient(rgba(100, 100, 180, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 120, 200, 0.1) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* Мягкое свечение (аврора) на фоне */
body::before {
  content: "";
  position: fixed;
  inset: -20% -10% auto -10%;
  height: 60vh;
  background: radial-gradient(600px 300px at 20% 30%, rgba(123,104,238,0.18), transparent 60%),
              radial-gradient(500px 260px at 80% 10%, rgba(70,130,180,0.18), transparent 60%),
              radial-gradient(480px 240px at 60% 80%, rgba(0,255,196,0.12), transparent 60%);
  filter: blur(30px);
  pointer-events: none;
  z-index: 0;
}

#app {
  flex: 1;
  padding: 15px;
  display: flex;
  flex-direction: column;
  max-width: 600px;
  margin: 0;
  width: 100%;
  z-index: 1;
}

/* Hero блок */
.hero {
  text-align: center;
  margin-top: 0px; /* подняли ближе к верху */
  margin-bottom: 50px;
  padding: 10px 10px 0;
}

.gradient-text {
  font-size: 28px;
  line-height: 1.2;
  font-weight: 800;
  background: linear-gradient(90deg, #9fa8ff 0%, #7b68ee 40%, #4fd1c5 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: 0.3px;
}

.hero-subtitle {
  margin-top: 4px; /* компактнее */
  color: #b8b8f5;
  font-size: 14px;
  opacity: 0.9;
}

/* Верхняя панель */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* Добавляем верхний safe-area */
  padding: calc(10px + env(safe-area-inset-top)) 15px 10px 15px;
  background: #151530; /* Темно-синий */
  border-bottom: 1px solid #3a3a7a;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 50;
}

/* Экран друзей */
#friends {
  padding: 20px;
}

.friends-container {
  max-width: 520px;
  margin: 0 auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.friends-container h2 {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 20px;
  text-align: center;
}

#friendsList {
  text-align: center;
}

#friendsList p {
  font-size: 16px;
  color: #b8b8f5;
  opacity: 0.8;
  text-align: center;
  margin: 20px 0;
}

/* Блок реферальной ссылки в экране друзей */
.referral-section {
  background: linear-gradient(135deg, rgba(21,21,48,0.9) 0%, rgba(10,10,31,0.9) 100%);
  border: 1px solid rgba(106, 90, 205, 0.3);
  border-radius: 16px;
  padding: 20px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
  flex-shrink: 0;
}

.referral-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.referral-icon {
  font-size: 24px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6a5acd 0%, #7b68ee 100%);
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(106, 90, 205, 0.3);
}

.referral-header h3 {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}

.referral-description {
  color: #b8b8f5;
  font-size: 14px;
  margin-bottom: 16px;
  opacity: 0.9;
  line-height: 1.4;
}

.ref-container-friends {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

#refLinkFriends {
  flex: 1;
  padding: 12px 16px;
  background: rgba(21,21,48,0.8);
  border: 1px solid rgba(106, 90, 205, 0.4);
  border-radius: 10px;
  color: #e0e0ff;
  font-size: 14px;
  outline: none;
}

.ref-copy-friends {
  padding: 12px 16px;
  background: linear-gradient(135deg, #6a5acd 0%, #7b68ee 100%);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(106, 90, 205, 0.3);
}

.ref-copy-friends:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(106, 90, 205, 0.4);
}

.referral-stats {
  text-align: center;
  color: #b8b8f5;
  font-size: 14px;
}

.referral-stats strong {
  color: #4fd1c5;
  font-weight: 700;
}

/* Секция списка друзей */
.friends-list-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 200px;
}

.friends-list-section h2 {
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
  text-align: center;
}

#friendsList {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 150px;
}

#friendsList p {
  font-size: 16px;
  color: #b8b8f5;
  opacity: 0.8;
  text-align: center;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}

/* Админ панель */
#admin {
  padding: 80px 20px 20px;
}

.admin-container {
  max-width: 520px;
  margin: 0 auto;
}

.admin-container h2 {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 30px;
  text-align: center;
  /* Unified to app theme (blue/purple) */
  background: linear-gradient(90deg, #9fa8ff 0%, #7b68ee 40%, #4fd1c5 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.admin-stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
  margin-bottom: 30px;
}

.stat-card {
  background: linear-gradient(135deg, rgba(21,21,48,0.9) 0%, rgba(10,10,31,0.9) 100%);
  border: 1px solid rgba(106, 90, 205, 0.3);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 25px rgba(106, 90, 205, 0.2);
}

.stat-icon {
  font-size: 28px;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #9fa8ff 0%, #7b68ee 100%);
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(159, 168, 255, 0.3);
}

.stat-info h3 {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 4px 0;
}

.stat-info p {
  color: #b8b8f5;
  font-size: 14px;
  margin: 0;
  opacity: 0.9;
}

.admin-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 30px;
}

.admin-btn {
  padding: 16px 20px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #9fa8ff 0%, #7b68ee 100%);
  box-shadow: 0 6px 20px rgba(159, 168, 255, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.admin-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(159, 168, 255, 0.4);
  background: linear-gradient(135deg, #9fa8ff 0%, #7b68ee 100%);
}

.admin-btn:active {
  transform: translateY(0px);
  box-shadow: 0 4px 15px rgba(159, 168, 255, 0.3);
}

.admin-btn span {
  font-size: 18px;
}

.admin-info {
  text-align: center;
  color: #b8b8f5;
  font-size: 12px;
  opacity: 0.7;
  padding: 20px 0;
  border-top: 1px solid rgba(106, 90, 205, 0.2);
}

.admin-info p {
  margin: 0;
}

/* Экран управления пользователями */
#userManagement {
  padding: 80px 20px 20px;
}

.user-management-container {
  max-width: 520px;
  margin: 0 auto;
}

.management-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 25px;
}

.back-btn {
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 107, 107, 0.2);
  color: #ff6b6b;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.back-btn:hover {
  background: rgba(255, 107, 107, 0.3);
}

.management-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.search-section {
  margin-bottom: 25px;
}

.search-input-group {
  display: flex;
  gap: 8px;
}

#userSearchInput {
  flex: 1;
  padding: 12px 16px;
  background: rgba(21,21,48,0.8);
  border: 1px solid rgba(255, 107, 107, 0.3);
  border-radius: 10px;
  color: #e0e0ff;
  font-size: 14px;
  outline: none;
}

#userSearchInput:focus {
  border-color: rgba(255, 107, 107, 0.6);
}

.search-btn {
  padding: 12px 16px;
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.search-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.user-result {
  margin-top: 20px;
}

.user-card {
  background: linear-gradient(135deg, rgba(21,21,48,0.9) 0%, rgba(10,10,31,0.9) 100%);
  border: 1px solid rgba(255, 107, 107, 0.3);
  border-radius: 16px;
  padding: 20px;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 25px rgba(255, 107, 107, 0.1);
}

.user-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(255, 107, 107, 0.2);
}

.user-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-avatar .avatar-placeholder {
  color: #fff;
  font-size: 20px;
  font-weight: bold;
}

.user-basic-info h3 {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 4px 0;
}

.user-basic-info p {
  color: #b8b8f5;
  font-size: 14px;
  margin: 0;
  opacity: 0.8;
}

.user-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 25px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  color: #b8b8f5;
  font-size: 12px;
  opacity: 0.8;
}

.stat-value {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.user-actions {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.action-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.action-group label {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.input-with-btn {
  display: flex;
  gap: 8px;
}

.input-with-btn input {
  flex: 1;
  padding: 10px 12px;
  background: rgba(21,21,48,0.8);
  border: 1px solid rgba(255, 107, 107, 0.3);
  border-radius: 8px;
  color: #e0e0ff;
  font-size: 14px;
  outline: none;
}

.input-with-btn input:focus {
  border-color: rgba(255, 107, 107, 0.6);
}

.action-btn {
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
  color: #fff;
}

.action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.action-btn.success {
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
}

.action-btn.success:hover {
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.action-btn.danger {
  background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
}

.action-btn.danger:hover {
  box-shadow: 0 4px 15px rgba(244, 67, 54, 0.3);
}

.balance-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.balance-controls input {
  flex: 1;
  padding: 10px 12px;
  background: rgba(21,21,48,0.8);
  border: 1px solid rgba(255, 107, 107, 0.3);
  border-radius: 8px;
  color: #e0e0ff;
  font-size: 14px;
  outline: none;
}

.danger-zone {
  display: flex;
  gap: 10px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 107, 107, 0.2);
}

.no-results {
  text-align: center;
  padding: 40px 20px;
  color: #b8b8f5;
  opacity: 0.8;
}

/* Нижнее меню */
.bottom-menu {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #151530; /* Темно-синий */
  border-top: 1px solid #3a3a7a;
  display: flex;
  justify-content: space-around;
  /* Добавляем нижний safe-area */
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom)) 0;
  z-index: 100;
}

/* ================= Wallet (премиум оформление) ================ */
/* Карточка кошелька — стеклянная, с сиянием и аккуратными отступами */
.wallet-container {
   /* ниже топ-бара */
  width: 100%;
  max-width: 520px;
  padding: 22px 18px;
  border-radius: 16px;
  border: 1px solid rgba(106, 90, 205, 0.35); /* сиреневый контур */
  background: linear-gradient(135deg, rgba(21,21,48,0.85) 0%, rgba(10,10,31,0.85) 100%);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.45), inset 0 0 0 1px rgba(255,255,255,0.03);
  overflow: hidden;
}

.wallet-header { 
  text-align: center;
  margin-bottom: 20px;
  padding: 16px 0;
}

.wallet-header .balance {
  font-size: 42px;
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 8px;
  background: linear-gradient(90deg, #9fa8ff 0%, #7b68ee 40%, #4fd1c5 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: 0.5px;
}

.wallet-header .currency {
  font-size: 24px;
  font-weight: 700;
  opacity: 0.9;
}

.wallet-header p {
  color: #b8b8f5;
  font-size: 15px;
  opacity: 0.85;
  margin: 0;
  font-weight: 500;
}

.wallet-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 8px;
}

.wallet-btn {
  padding: 16px 24px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #6a5acd 0%, #7b68ee 100%);
  box-shadow: 0 6px 20px rgba(106, 90, 205, 0.35);
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: none;
  letter-spacing: 0.3px;
}

.wallet-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(106, 90, 205, 0.5);
  background: linear-gradient(135deg, #7b68ee 0%, #8a7aee 100%);
}

.wallet-btn:active {
  transform: translateY(0px);
  box-shadow: 0 4px 15px rgba(106, 90, 205, 0.4);
}

/* Кнопка старта и подарок — фиксируем размер, чтобы не раздувало кнопку */
.start-game-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0px;
  padding: 14px 18px;
  min-height: 56px;
}

.gift-container1 {
  width: 28px; /* размер якоря для выравнивания текста */
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative; /* чтобы центрировать содержимое */
  overflow: visible; /* позволяем выходить за границы кнопки */
  left: 2%;
}

#gift { pointer-events: none; }

#gift > svg,
#gift > canvas {
  position: absolute;
  transform: translate(-50%, -50%);
  right: 1%;
   
  width: 86px !important;  /* увеличить подарок */
  height: 86px !important;
}

.btn-text { white-space: nowrap; }

.prize-levels {
  width: 100%;
  max-width: 400px;
  margin: 6px auto 14px; /* ещё выше и компактнее */
  background: rgba(20, 20, 45, 0.9); /* Темно-синий */
  border: 1px solid #3a3a7a;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.prize-level {
  display: flex;
  align-items: center;
  padding: 12px 16px; /* компактнее, мягче */
  border-bottom: 1px solid #3a3a7a;
  background: linear-gradient(to right, #1a1a3f, #0f0f2a);
}

.prize-level:last-child {
  border-bottom: none;
}

.level-text {
  flex: 1;
  font-size: 15px;
  color: #d6d6ff;
}

.level-amount {
  font-size: 16px;
  font-weight: 800;
  margin-left: 12px;
  white-space: nowrap;
  background: linear-gradient(90deg, #b9b3ff 0%, #7b68ee 40%, #52e6d6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Анимация при наведении */
.prize-level:hover {
  background: linear-gradient(to right, #252550, #151530);
  transform: translateX(5px);
  transition: all 0.3s ease;
}

/* Модальные окна */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
}

.modal-content {
  background: #151530;
  border-radius: 15px;
  padding: 25px;
  width: 90%;
  max-width: 400px;
  border: 1px solid #3a3a7a;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  position: relative;
  z-index: 3001;
}

.modal-content.withdraw {
  background: linear-gradient(135deg, #151530 0%, #0a0a1f 100%);
  border: 1px solid #6a5acd; /* Сиреневый акцент */
  box-shadow: 0 0 20px rgba(106, 90, 205, 0.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #3a3a7a;
}

.modal-header h2 {
  color: #7b68ee; /* Сиреневый */
  font-size: 22px;
  margin: 0;
}

.input-group {
  margin-bottom: 20px;
}

.input-group label {
  display: block;
  margin-bottom: 8px;
  color: #a0a0e0;
  font-size: 14px;
}

.input-field {
  width: 100%;
  padding: 14px;
  background: #0f0f25;
  border: 1px solid #3a3a7a;
  border-radius: 8px;
  color: #fff;
  font-size: 16px;
  transition: all 0.3s ease;
}

.input-field:focus {
  outline: none;
  border-color: #6a5acd; /* Сиреневый */
  box-shadow: 0 0 0 2px rgba(106, 90, 205, 0.3);
}

.balance-info {
  text-align: center;
  margin: 20px 0;
  padding: 12px;
  background: rgba(15, 15, 35, 0.6);
  border-radius: 8px;
  color: #a0a0e0;
  font-size: 14px;
  border: 1px solid #3a3a7a;
}

.withdraw-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #4a4a9a 0%, #6a5acd 100%); /* Фиолетовый градиент */
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.withdraw-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(90, 80, 180, 0.5);
}

.withdraw-btn:disabled {
  background: #5a5a8a;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.min-amount {
  text-align: center;
  margin-top: 10px;
  color: #a0a0e0;
  font-size: 12px;
}

.level-number {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 40%; /* круглый бейдж */
  background: linear-gradient(135deg, #6a5acd, #7b68ee);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-right: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}

.level-text {
  flex: 1;
  font-size: 15px;
  color: #d6d6ff;
}

.level-amount {
  font-size: 16px;
  font-weight: 800;
  margin-left: 12px;
  white-space: nowrap;
  background: linear-gradient(90deg, #b9b3ff 0%, #7b68ee 40%, #52e6d6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Анимация при наведении */
.prize-level:hover {
  background: linear-gradient(to right, #252550, #151530);
  transform: translateX(5px);
  transition: all 0.3s ease;
}

/* Адаптация для мобильных */
@media (max-width: 480px) {
  .prize-levels {
    margin: 20px 0;
  }
  
  .prize-level {
    padding: 12px 15px;
  }
  
  .level-number {
    font-size: 20px;
    width: 30px;
    margin-right: 10px;
  }
  
  .level-text {
    font-size: 14px;
  }
  
  .level-amount {
    font-size: 16px;
  }
}

.avatar-placeholder-friends {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, #6a5acd, #7b68ee);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 18px;
}

.avatar-placeholder {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6a5acd, #7b68ee);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 18px;
  
}
.promo-success {
  text-align: center;
  padding: 20px;
}

.promo-success-icon {
  font-size: 48px;
  color: #4ade80;
  margin-bottom: 15px;
}

/* Иконка успеха в модалке вывода */
.success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-size: 32px;
  font-weight: 900;
  color: #052e1b;
  background: linear-gradient(135deg, #34d399, #22c55e);
  box-shadow: 0 10px 25px rgba(34, 197, 94, 0.35), inset 0 0 0 2px rgba(255,255,255,0.3);
}

/* Стили для контейнера кнопки "Начать играть" */
.start-game-container {
  position: fixed;
  bottom: 120px; /* 60px (высота меню) + 10px */
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  z-index: 5;
}

.start-game-btn-container {
  position: relative;
  display: inline-block;
  margin: 0 auto;
  text-align: center;
}

.start-game-btn {
  position: relative;
  background: linear-gradient(135deg, #6a5acd, #7b68ee);
  border: none;
  border-radius: 50px;
  color: white;
  padding: 15px 40px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 4px 15px rgba(106, 90, 205, 0.4);
  transition: all 0.3s ease;
  text-transform: uppercase;
  -webkit-tap-highlight-color: transparent; /* Убираем синий прямоугольник на мобильных */
  outline: none; /* Убираем outline при фокусе */
}

/* Добавляем активное состояние */
.start-game-btn:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 2px 10px rgba(106, 90, 205, 0.6);
}

.start-game-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 7px 20px rgba(106, 90, 205, 0.6);
}

.start-game-btn:active {
  transform: translateY(1px);
}

/* Полоса под кнопкой */
.start-game-btn-container .button-strip {
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 4px;
  background: rgba(123, 104, 238, 0.3);
  border-radius: 2px;
  z-index: 1;
  filter: blur(2px);
}

/* Левая часть — пользователь */
.user-box {
  display: flex;
  align-items: center;
}

.avatar {
  background: none !important;
}
.user-box .avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  margin-right: 10px;
  object-fit: cover;
  border: 2px solid #7b68ee; /* Сиреневый */
}

.user-box .username {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}

/* Правая часть — баланс */
.balance-box {
  font-size: 15px;
  font-weight: 600;
  color: #ffd700; /* Золотой (ТОЛЬКО здесь!) */
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: rgba(26, 26, 58, 0.3);
  border: 1px solid #3a3a7a;
  border-radius: 8px;
}

/* Чтобы контент не залезал под верхнюю панель */
#app {
  padding-top: 60px;
}

/* Главная страница */
.home-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  height: 100%;
  justify-content: center;
}

.start-btn-container {
  position: relative;
  display: inline-block;
  margin: 30px 0;
}

.button-strip {
  position: absolute;
  top: 90%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 160%;
  height: 1px;
  background: linear-gradient(to right, #1a1a3f, #1a1a3f);
  border-radius: 8px;
  z-index: 0;
}

.big-button {
  position: relative;
  border: none;
  outline: none;
  overflow: hidden;
  padding: 32px 80px;
  font-size: 34px;
  font-weight: bold;
  color: #ffd700; /* Золотой (ТОЛЬКО здесь!) */
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  z-index: 1;
  margin-top: 225px;
  clip-path: polygon(8% 0, 92% 0, 100% 50%, 92% 100%, 8% 100%, 0 50%);
  transform: scale(1.2);
  transform-origin: center;
}

.big-button::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, #151530 0%, #0a0a1f 30%, #050518 70%, #151530 100%);
  clip-path: inherit;
  z-index: -1;
}

/* Верхняя и нижняя обводка */
.big-button::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: 
    linear-gradient(
      to bottom, 
      #7b68ee 0%, /* Сиреневый */
      #7b68ee 3px, 
      transparent 3px, 
      transparent calc(100% - 3px), 
      #7b68ee calc(100% - 3px), 
      #7b68ee 100%
    );
  clip-path: inherit;
}

/* Исправление позиционирования экранов */
.screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* Глобально убираем отступ от шапки — применим его точечно только для home */
  padding-top: 0;
  padding-bottom: 70px;
  /* Делаем экраны прозрачными, чтобы был виден настоящий фон body */
  background: transparent;
  z-index: 10;
}

/* Только экран home имеет фиксированную шапку (.top-bar), добавим отступ под неё */
#home {
  padding-top: 72px; /* высота .top-bar (~60px) + небольшой зазор */
}

.screen.hidden {
  display: none !important;
  visibility: hidden;
  opacity: 0;
}

/* Экран кошелька */
.wallet-container {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #151530;
  border: 1px solid #3a3a7a;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  text-align: center;
  width: 400px;
  max-width: 90%;
}
.wallet-btn {
  background: linear-gradient(135deg, #4a4a9a 0%, #6a5acd 100%);
  border: none;
  border-radius: 12px;
  color: #fff;
  padding: 15px 30px;
  font-size: 18px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  margin: 10px 0;
  width: 100%;
}

.wallet-btn:hover {
  background: linear-gradient(135deg, #42428a 0%, #5a4aad 100%);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(90, 80, 180, 0.5);
}

.wallet-btn:active {
  transform: scale(0.95);
}

.wallet-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%);
  transform-origin: 50% 50%;
}

.wallet-btn:focus:not(:active)::after {
  animation: ripple 1s ease-out;
}

/* Отключаем фокус-анимацию (рябь) на тач-устройствах, чтобы не было вспышки */
@media (hover: none), (pointer: coarse) {
  .wallet-btn:focus:not(:active)::after,
  .withdraw-btn:focus:not(:active)::after,
  .task-btn:focus:not(:active)::after,
  .ref-copy:focus:not(:active)::after {
    animation: none !important;
  }
}

@keyframes ripple {
  0% {
    transform: scale(0, 0);
    opacity: 1;
  }
  100% {
    transform: scale(20, 20);
    opacity: 0;
  }
}

.balance {
  font-size: 56px;
  color: #ffd700; /* Золотой (ТОЛЬКО здесь!) */
  margin: 25px 0;
  background: rgba(20, 20, 45, 0.4);
  padding: 20px 40px;
  border-radius: 15px;
  border: 1px solid #3a3a7a;
}

.currency {
  font-size: 28px;
  color: #3a3a7a; /* Золотой (ТОЛЬКО здесь!) */
}

/* Нижнее меню */
#menu {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 8px 0;
  background: #151530;
  border-top: 1px solid #3a3a7a;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 100;
}

#menu button {
  background: transparent;
  border: none;
  color: #a0a0e0;
  font-weight: bold;
  padding: 8px 5px;
  font-size: 12px;
  transition: all 0.3s ease;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex: 1;
  max-width: 20%;
}

#menu button span {
  font-size: 18px;
  margin-bottom: 2px;
}

#menu button.active,
#menu button:hover {
  color: #7b68ee; /* Сиреневый */
  background: rgba(123, 104, 238, 0.15);
}

/* Стили для таблицы лидеров */
.leaderboard-container {
  /* убираем правый внутренний отступ, чтобы скроллбар был прямо у правого края */
  padding: 10px 0 20px 20px;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  /* Растягиваем экран ТОП на всю доступную высоту и даём прокрутку списку */
  height: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* Заголовок ТОП — по центру и чуть ниже от верхнего края */
#leaderboard .leaderboard-container > h2 {
  text-align: center;
  margin-top: 12px;
}

/* Список лидеров занимает всё оставшееся пространство и скроллится внутри */
#leaderboardList {
  flex: 1 1 auto;
  overflow-y: auto;
  /* небольшой внутренний отступ, чтобы контент не прятался под скроллбаром */
  padding-right: 10px;
  /* Firefox: делаем скролл тонким и контрастным */
  scrollbar-width: thin;
  scrollbar-color: #7b68ee transparent;
}

/* WebKit-скроллбар — шире и у самого края */
#leaderboardList::-webkit-scrollbar {
  width: 10px; /* шире, как просили */
}
#leaderboardList::-webkit-scrollbar-track {
  background: transparent;
}
#leaderboardList::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #9fa8ff, #7b68ee);
  border-radius: 8px;
}
#leaderboardList::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #b6bdff, #8a7aee);
}

.leaderboard-item {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  margin: 8px 0;
  background: rgba(25, 25, 55, 0.9);
  border: 1px solid #3a3a7a;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.leaderboard-item.current-user {
  background: rgba(123, 104, 238, 0.2);
  border: 1px solid #7b68ee; /* Сиреневый */
}

.leaderboard-position {
  font-size: 18px;
  font-weight: bold;
  width: 40px;
  text-align: center;
  color: #7b68ee; /* Сиреневый */
}

.leaderboard-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 10px;
  border: 2px solid #7b68ee; /* Сиреневый */
  flex-shrink: 0;
}

.leaderboard-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.leaderboard-name {
  flex: 1;
  font-size: 16px;
  font-weight: 500;
  color: #d0d0f0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-score {
  font-size: 16px;
  font-weight: bold;
  color: #7b68ee; /* Сиреневый */
  min-width: 100px;
  text-align: right;
}

.tasks-container {
  padding: 0 16px 16px 16px; /* убираем верхний внутренний отступ */
  width: 100%;            /* избегаем горизонтального скролла из-за 100vw */
  max-width: 520px;       /* визуально выравниваем как остальные экраны */
  margin: 0 auto;         /* центрируем контейнер */
  background: transparent;
  box-sizing: border-box;
  min-height: 100%;      /* растягиваем контейнер по высоте экрана */
}

/* Заголовок на экране задач — без отступа сверху */
#tasks h2 {
  margin-top: 0;
  padding-top: 8px;
}

/* Первый элемент внутри контейнера задач — без внешнего отступа сверху */
#tasks .tasks-container > *:first-child {
  margin-top: 0 !important;
}

.task-card {
  background: rgba(25, 25, 55, 0.9);
  border: 1px solid #3a3a7a;
  border-radius: 15px;
  padding: 16px;
  margin: 12px 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  backdrop-filter: blur(5px);
}

/* Тематические палитры для партнёрских заданий */
.task-card.theme-purple {
  background: linear-gradient(135deg, rgba(30,30,70,0.9) 0%, rgba(20,20,55,0.9) 100%);
  border-color: rgba(123,104,238,0.45);
}
.task-card.theme-purple .task-btn { 
  background: linear-gradient(135deg, #6a5acd 0%, #7b68ee 100%);
  box-shadow: 0 6px 20px rgba(123,104,238,0.35);
}

.task-card.theme-teal {
  background: linear-gradient(135deg, rgba(13,40,45,0.9) 0%, rgba(10,28,35,0.9) 100%);
  border-color: rgba(79,209,197,0.45);
}
.task-card.theme-teal .task-btn {
  background: linear-gradient(135deg, #38b2ac 0%, #4fd1c5 100%);
  box-shadow: 0 6px 20px rgba(79,209,197,0.35);
}

.task-card.theme-amber {
  background: linear-gradient(135deg, rgba(45,35,10,0.9) 0%, rgba(28,22,8,0.9) 100%);
  border-color: rgba(255,193,7,0.45);
}
.task-card.theme-amber .task-btn {
  background: linear-gradient(135deg, #ffb300 0%, #ffc107 100%);
  color: #2b2440;
  box-shadow: 0 6px 20px rgba(255,193,7,0.35);
}

.task-card.theme-rose {
  background: linear-gradient(135deg, rgba(55,20,35,0.9) 0%, rgba(40,12,28,0.9) 100%);
  border-color: rgba(244,114,182,0.45);
}
.task-card.theme-rose .task-btn {
  background: linear-gradient(135deg, #ec4899 0%, #f472b6 100%);
  box-shadow: 0 6px 20px rgba(236,72,153,0.35);
}

/* Кастомная тема через переменную --custom-color */
.task-card.theme-custom {
  /* Фон оставляем общий, акцентируем рамку и кнопки кастомным цветом */
  background: linear-gradient(135deg, rgba(25,25,55,0.95) 0%, rgba(15,15,35,0.95) 100%);
  border-color: color-mix(in oklab, var(--custom-color) 60%, #3a3a7a);
}
.task-card.theme-custom .task-btn {
  background: var(--custom-color, #7b68ee);
  box-shadow: 0 6px 20px rgba(0,0,0,0.35);
}

.task-card .small-note {
  color: #b8b8f5;
  font-size: 12px;
  /* Больше отступ сверху, чтобы отделить от описания задания */
  margin: 10px 0 8px 0;
  opacity: 0.9;
}

/* Отступы абзаца описания внутри карточки задания */
.task-card p {
  margin: 0 0 8px 0;
}

.task-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.task-header {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

.task-icon {
  font-size: 28px;
  margin-right: 15px;
  width: 50px;
  height: 50px;
  border-radius: 50%; /* круглая рамка */
  overflow: hidden; /* чтобы картинка не вылезала за границы */
  /* Гарантируем квадратную область и отсутствие искажений */
  aspect-ratio: 1 / 1;
  display: flex;              /* центрируем содержимое и фиксируем геометрию */
  /* Не даём флекс-алгоритму сжимать или растягивать иконку */
  flex: 0 0 50px;
  min-width: 50px;
  min-height: 50px;
  max-width: 50px;
  max-height: 50px;
  align-items: center;
  justify-content: center;
  color: #7b68ee; /* Сиреневый */
}

/* Аватарки партнёрских заданий внутри .task-icon */
.task-icon img,
.task-avatar {
  width: 100%;
  height: 100%;
  display: block;         /* исключаем артефакты строчного img */
  object-fit: cover;      /* обрезаем по кругу, без сплющивания */
  aspect-ratio: 1 / 1;    /* на самом элементе тоже фиксируем пропорции */
  max-width: 100% !important;
  max-height: 100% !important;
}

/* Плейсхолдер-эмодзи по центру */
.task-avatar.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.task-progress {
  display: flex;
  align-items: center;
  margin: 15px 0;
}

.progress-bar {
  flex: 1;
  height: 10px;
  background: #0f0f25;
  border-radius: 5px;
  overflow: hidden;
  margin-right: 10px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6a5acd, #7b68ee);
  border-radius: 5px;
  transition: width 0.5s ease;
}

.ref-container {
  display: flex;
  margin-top: 10px;
  align-items: center;
}

#refLink {
  flex: 1;
  padding: 10px 12px;
  background: #0f0f25;
  border: 1px solid #3a3a7a;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  width: calc(100% - 50px);
}

.ref-copy {
  background: #4a4a9a;
  border: none;
  border-radius: 8px;
  color: #fff;
  
  padding: 10px 15px;
  margin-left: 8px;
  cursor: pointer;
  font-size: 16px;
  white-space: nowrap;
}

/* Стили для списка друзей */
.friend-item {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  margin: 8px 0;
  background: rgba(25, 25, 55, 0.9);
  border: 1px solid #3a3a7a;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.friend-position {
  font-size: 16px;
  width: 30px;
  text-align: center;
  color: #a0a0e0;
}

.friend-avatar, .leaderboard-avatar {
  display: flex;
  align-items: center;
  justify-content: center; /* Центрируем содержимое */
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #7b68ee; /* Сиреневый акцент */
  flex-shrink: 0;
  margin: 0 10px; /* Отступы от номера и имени */
}

.friend-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.friend-name {
  flex: 1;
  font-size: 16px;
  color: #d0d0f0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-score {
  font-size: 16px;
  color: #7b68ee; /* Сиреневый */
  min-width: 100px;
  text-align: right;
}

#tasks {
  /* Соответствует базовой разметке .screen: полноэкранно без лишнего отступа сверху */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 0 70px 0; /* нижний отступ под нижнее меню */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: transparent;
}

#tasks::-webkit-scrollbar {
  width: 6px;
}

#tasks::-webkit-scrollbar-track {
  background: #0f0f25;
}

#tasks::-webkit-scrollbar-thumb {
  background: #6a5acd;
  border-radius: 3px;
}

#tasks::-webkit-scrollbar-thumb:hover {
  background: #7b68ee;
}

.task-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #4a4a9a 0%, #6a5acd 100%);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.task-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(90, 80, 180, 0.5);
}

.success-icon {
  font-size: 60px;
  color: #4ade80;
  margin: 15px 0;
}

.task-btn:disabled {
  background: #3a3a7a !important;
  cursor: default;
}

.small-note {
  font-size: 12px;
  color: #a0a0e0;
  margin-top: 10px;
}

/* Анимации */
/* Плавное поэтапное появление элементов списков (лидерборд/друзья) */
.item-appear {
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInUp 0.4s ease forwards;
  animation-delay: var(--delay, 0s);
  will-change: transform, opacity; /* производительность */
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.fade-in {
  animation: fadeIn 0.5s ease forwards;
  opacity: 0;
  animation-delay: var(--delay, 0.1s);
}

.slide-in {
  animation: slideIn 0.5s ease forwards;
  opacity: 0;
  animation-delay: 0.1s;
}

.pulse {
  animation: pulse 2s infinite;
}

/* Скрытые элементы */
.hidden {
  display: none;
}

/* Адаптация для мобильных */
@media (max-width: 480px) {
  .big-button {
    padding: 20px 50px;
    font-size: 26px;
    margin-top: 180px;
  }
  
  .leaderboard-position {
    font-size: 16px;
    width: 30px;
  }
  
 
  
  .leaderboard-name {
    font-size: 14px;
  }
  
  .leaderboard-score {
    font-size: 14px;
    min-width: 80px;
  }
}

/* Премиальный бейдж под балансом (минимальный вывод) */
.wallet-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  /* Убираем рамку полностью, оставляем только текст */
  padding: 18px 20px;
  border-radius: 16px;
  background: transparent;
  border: none;
  color: #aab2ff;
  font-size: 13px;
  letter-spacing: 0.1px;
  /* Убираем размеры и центрирование */
  width: auto;
  justify-content: center;
  margin: 0 auto;
}

.wallet-note::before {
  /* мини-иконка информации */
  content: "\2139"; /* ℹ */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-size: 12px;
  color: #b6a9ff;
  background: rgba(123, 104, 238, 0.15);
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(106, 90, 205, 0.35);
}

/* Вариант для верхней надписи над карточкой кошелька */
.wallet-top-note {
  display: block;
  text-align: center;
  margin: 10px auto 12px;
  max-width: 520px;
  /* Совпадает по ширине с карточкой кошелька */
  width: 100%;
  /* Без внутреннего паддинга, чтобы плашка имела ту же внешнюю ширину, что и .wallet-container */
  padding: 0;
  box-sizing: border-box;
}

/* Градиентный акцент для значения USDT внутри бейджа */
.wallet-note .highlight-usdt {
  background: linear-gradient(90deg, #b9b3ff 0%, #7b68ee 45%, #52e6d6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}

/* Ненавязчивое мини-упоминание над кошельком */
.subtle-note {
  font-size: 12px;
  line-height: 1.3;
  color: #9aa0d0; /* приглушённый сине-фиолетовый */
  opacity: 0.85;
}