/* ============================================================================
   ⭐ CSS VARIABLES / ДИЗАЙН-ТОКЕНЫ
   =========================================================================== */

:root {
    /* 🎨 COLOR SYSTEM / ЦВЕТОВАЯ СИСТЕМА */
    --bg: #0d1b2a;
    --panel: #1b263b;
    --accent: #2e8eff;
    --accent-hover: #1e7eff;
    --success: #2ecc71;
    --warning: #f39c12;
    --danger: #e74c3c;
    --muted: #9db4c0;
    --text: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    
    /* 📏 SPACING / ОТСТУПЫ */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* 🔵 BORDER RADIUS / СКРУГЛЕНИЯ */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    /* 🌓 SHADOWS / ТЕНИ */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.5);
    
    /* ⚡ TRANSITIONS / ПЕРЕХОДЫ */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    --transition-slow: 500ms ease;
}

/* ============================================================================
   🔧 RESET & BASE STYLES / СБРОС И БАЗОВЫЕ СТИЛИ
   =========================================================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
    overflow-x: hidden;
    width: 100%;
}

#app {
    padding-bottom: 80px;
    min-height: 100vh;
    position: relative;
}

/* ============================================================================
   📝 TYPOGRAPHY / ТИПОГРАФИКА
   =========================================================================== */

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
}

h1 {
    font-size: 24px;
}

h2 {
    font-size: 20px;
}

h3 {
    font-size: 18px;
}

p {
    margin-bottom: var(--spacing-md);
}

small {
    font-size: 12px;
    color: var(--muted);
}

/* ============================================================================
   🔄 LOADING OVERLAY / ЭКРАН ЗАГРУЗКИ
   =========================================================================== */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.loading-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.loading-content {
    text-align: center;
    padding: var(--spacing-xl);
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--spacing-md);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 16px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: var(--spacing-sm);
}

.loading-security {
    font-size: 12px;
    color: var(--muted);
}

/* ============================================================================
   🔝 TOP BAR / ВЕРХНЯЯ ПАНЕЛЬ
   =========================================================================== */

.topbar {
  height: 70px;
  width: 100%;
  background: var(--panel);
  display: flex;
  align-items: center;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 
    0 2px 10px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Аватар - максимально влево */
.topbar__left {
  flex: 0 0 auto;
  margin-right: auto; /* Прижимает к левому краю */
}

.topbar__avatar {
  width: 46px; /* Высота как у баланса */
  height: 46px; /* Такая же высота как у баланса */
  border-radius: 50%;
  background: linear-gradient(135deg, #ff6b67, #ff4f76);
  color: #fff;
  font-weight: 700;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    0 4px 12px rgba(255, 107, 103, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  transition: all var(--transition-fast);
  cursor: pointer;
  user-select: none;
}

.topbar__avatar:hover {
  transform: scale(1.05);
  box-shadow: 
    0 6px 16px rgba(255, 107, 103, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.15);
}

.topbar__avatar:active {
  transform: scale(0.98);
}

/* Заголовок - точно по центру */
.topbar__center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  
}

.topbar__title {
  color: #fff;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.5px;
  line-height: 1;
  text-shadow: 
    0 1px 2px rgba(0, 0, 0, 0.5);
}

.topbar__gift {
  font-size: 18px;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(255, 215, 0, 0.2));
}

/* Баланс - максимально вправо */
.topbar__right {
  flex: 0 0 auto;
  margin-left: auto; /* Прижимает к правому краю */
}

.topbar__pill {
  height: 46px; /* Такая же высота как у аватарки */
  border-radius: 23px;
  padding: 6px 8px;
  background: linear-gradient(135deg, #151b26, #0d1524);
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 4px 12px rgba(0, 0, 0, 0.2);
}

.topbar__plus {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0d6eff, #2e8eff);
  color: #fff;
  font-weight: 700;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 
    0 3px 8px rgba(13, 110, 255, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  user-select: none;
}

.topbar__plus:hover {
  transform: scale(1.05);
  background: linear-gradient(135deg, #1e7eff, #4aa1ff);
  box-shadow: 
    0 4px 12px rgba(13, 110, 255, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.topbar__plus:active {
  transform: scale(0.95);
}

.topbar__balance {
  height: 34px;
  border-radius: 17px;
  padding: 0 12px;
  background: linear-gradient(135deg, #0c1017, #070a10);
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  min-width: 80px;
}

.topbar__star {
  font-size: 18px;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(255, 215, 0, 0.4));
}

.topbar__count {
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  line-height: 1;
  text-shadow: 
    0 1px 2px rgba(0, 0, 0, 0.5);
  letter-spacing: 0.5px;
}


/* Responsive design for compact topbar */
@media (max-width: 768px) {
  .topbar {
    height: 60px;
    padding: 0 12px;
  }
  
  .topbar__avatar {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
  
  .topbar__title {
    font-size: 18px;
  }
  
  .topbar__gift {
    font-size: 16px;
  }
  
  .topbar__pill {
    height: 40px;
    padding: 5px 6px;
    gap: 8px;
  }
  
  .topbar__plus {
    width: 30px;
    height: 30px;
    font-size: 18px;
  }
  
  .topbar__balance {
    height: 30px;
    padding: 0 10px;
    min-width: 70px;
  }
  
  .topbar__star {
    font-size: 16px;
  }
  
  .topbar__count {
    font-size: 16px;
  }
  

}

@media (max-width: 480px) {
  .topbar {
    height: 55px;
    padding: 0 10px;
  }
  
  .topbar__avatar {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }
  
  .topbar__title {
    font-size: 16px;
  }
  
  .topbar__gift {
    font-size: 14px;
  }
  
  .topbar__center {
    gap: 5px;
  }
  
  .topbar__pill {
    height: 36px;
    padding: 4px 5px;
    gap: 6px;
  }
  
  .topbar__plus {
    width: 28px;
    height: 28px;
    font-size: 16px;
  }
  
  .topbar__balance {
    height: 28px;
    padding: 0 8px;
    min-width: 60px;
    gap: 6px;
  }
  
  .topbar__star {
    font-size: 14px;
  }
  
  .topbar__count {
    font-size: 14px;
  }
  
}

@media (max-width: 360px) {
  .topbar {
    height: 50px;
    padding: 0 8px;
  }
  
  .topbar__avatar {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }
  
  .topbar__title {
    font-size: 15px;
  }
  
  .topbar__gift {
    font-size: 13px;
  }
  
  .topbar__center {
    gap: 4px;
  }
  
  .topbar__pill {
    height: 32px;
    padding: 3px 4px;
    gap: 5px;
  }
  
  .topbar__plus {
    width: 26px;
    height: 26px;
    font-size: 14px;
  }
  
  .topbar__balance {
    height: 26px;
    padding: 0 7px;
    min-width: 55px;
    gap: 5px;
  }
  
  .topbar__star {
    font-size: 13px;
  }
  
  .topbar__count {
    font-size: 13px;
  }
  

}

/* Для очень узких экранов скрываем подарок */
@media (max-width: 320px) {
  .topbar__gift {
    display: none;
  }
  
  .topbar__title {
    font-size: 14px;
  }
  
  .topbar__pill {
    gap: 4px;
  }
  
  .topbar__balance {
    min-width: 50px;
    padding: 0 6px;
  }
  
  .topbar__count {
    font-size: 12px;
  }
}

/* Adjust main content for smaller topbar */
#screen-home,
#screen-balance,
#screen-profile,
#screen-case-details {
  padding-top: 0;
}

.cases-grid,
.balance-container,
.profile-screen,
.case-details-container {
  padding-top: 10px;
}

.banner {
  margin-top: 10px;
}

/* Ensure there's enough space between topbar and content */
.screen:not(.visible) {
  padding-top: 0;
}


/* ============================================================================
   🎪 BANNER / БАННЕР
   =========================================================================== */

.banner {
    display: flex;
    align-items: center;
    padding: var(--spacing-md);
    margin: var(--spacing-md);
    background: linear-gradient(135deg, var(--accent), #00c6ff);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.banner:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.banner:active {
    transform: translateY(0);
}

.banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.banner-left, .banner-right {
    flex: 0 0 auto;
}

.banner-center {
    flex: 1;
    text-align: center;
    padding: 0 var(--spacing-md);
}

.mascot, .arrow {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.banner h1 {
    font-size: 20px;
    color: white;
    margin-bottom: 4px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.banner-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

/* ============================================================================
   🎁 CASES GRID / СЕТКА КЕЙСОВ
   =========================================================================== */

.cases-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
    padding: var(--spacing-md);
}

.case-card {
    background: var(--panel);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    cursor: pointer;
    position: relative;
    border: 2px solid transparent;
    overflow: hidden;
}

.case-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}

.case-card.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.case-card.disabled:hover {
    transform: none;
    box-shadow: var(--shadow-md);
    border-color: transparent;
}

.case-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--success);
    color: white;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.case-rarity {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.case-rarity.common {
    background: var(--muted);
    color: white;
}

.case-rarity.uncommon {
    background: #2ecc71;
    color: white;
}

.case-rarity.rare {
    background: #3498db;
    color: white;
}

.case-rarity.epic {
    background: #9b59b6;
    color: white;
}

.case-rarity.legendary {
    background: linear-gradient(45deg, #f39c12, #e74c3c);
    color: white;
}

.case-rarity.special {
    background: linear-gradient(45deg, #00cec9, #0984e3);
    color: white;
}

/* УВЕЛИЧЕННЫЕ ИКОНКИ КЕЙСОВ - было 80px, стало 100px */
.case-img {
    width: 100%; /* Картинка на всю ширину карточки */
    height: auto; /* Автоматическая высота для пропорций */
    max-height: 140px; /* Максимальная высота, можно увеличить */
    object-fit: contain;
    margin: 0 auto var(--spacing-sm);
    display: block;
}

.case-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

.case-subtitle {
    font-size: 11px;
    color: var(--muted);
    margin-bottom: var(--spacing-sm);
    height: 16px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.price {
    font-size: 16px;
    font-weight: 700;
    color: #ffd700;
    margin-bottom: var(--spacing-sm);
}

.case-stats {
    display: flex;
    justify-content: space-between;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-sm);
}

.case-stats .stat {
    font-size: 9px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    flex: 1;
    text-align: center;
}
/* Стили для кликабельного заголовка в топбаре */
.topbar__title {
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.topbar__title:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.topbar__title:active {
    transform: scale(0.95);
}
/* ============================================================================
   📱 SCREENS & NAVIGATION / ЭКРАНЫ И НАВИГАЦИЯ
   =========================================================================== */

.screen {
    display: none;
    width: 100%;
    position: relative;
    z-index: 1;
    padding-bottom: 80px;
}

.screen.visible {
    display: block;
}

#screen-earnings {
    padding-bottom: 0;
}

/* ============================================================================
   📱 SCREENS & NAVIGATION / ЭКРАНЫ И НАВИГАЦИЯ
   =========================================================================== */

.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--panel);
  display: flex;
  justify-content: space-around;
  padding: var(--spacing-sm) 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 1;
}

.tab {
  flex: 1;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  background: transparent;
  border: none;
  padding: 8px 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0; /* Для корректного отображения 4 кнопок */
}

.tab.active {
  color: var(--accent);
  font-weight: 600;
}

.tab:hover:not(.active) {
  color: var(--text-secondary);
}

/* Адаптивность для 4 кнопок */
@media (max-width: 480px) {
  .tab {
    font-size: 10px;
    padding: 6px 2px;
  }
}

@media (max-width: 360px) {
  .tab {
    font-size: 9px;
    padding: 5px 1px;
  }
}

/* ============================================================================
   🔍 CASE DETAILS PAGE / СТРАНИЦА ДЕТАЛЕЙ КЕЙСА
   =========================================================================== */

#screen-case-details {
    padding: 0 var(--spacing-md); /* Убрали padding-top */
    padding-bottom: 80px; /* Для нижней навигации */
    min-height: calc(100vh - 70px); /* Высота минус topbar */
}

.case-details-container {
    max-width: 600px;
    margin: 0 auto;
    padding-top: 0; /* Убрали верхний отступ */
}

.case-details-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-md);
    background: var(--panel);
    border-radius: var(--radius-lg);
    margin-top: 10px; /* Добавили небольшой отступ сверху */
}

.back-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    font-size: 20px;
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.case-details-header h2 {
    margin: 0;
    font-size: 18px;
    text-align: center;
    flex: 1;
}

.case-price-display {
    font-weight: 600;
    color: #ffd700;
}

.case-details-content {
    background: var(--panel);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
}

.case-preview-section {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

/* УВЕЛИЧЕННАЯ ИКОНКА КЕЙСА НА СТРАНИЦЕ ДЕТАЛЕЙ - было 150px, стало 180px */
.case-details-img {
    width: 100%; /* На всю ширину контейнера */
    max-width: 200px; /* Максимальная ширина */
    height: auto; /* Автоматическая высота */
    max-height: 200px; /* Максимальная высота */
    object-fit: contain;
    margin: 0 auto 20px;
    display: block;
    transition: all 0.3s ease;
}

.case-info h3 {
    margin-bottom: var(--spacing-sm);
    font-size: 20px;
}

.case-your-balance {
    color: var(--muted);
    font-size: 14px;
}

/* АДАПТИВНОСТЬ ДЛЯ УВЕЛИЧЕННЫХ ИКОНОК */
@media (max-width: 768px) {
    .case-img {
        width: 100%; /* Картинка на всю ширину карточки */
        height: auto; /* Автоматическая высота для пропорций */
        max-height: 140px; /* Максимальная высота, можно увеличить */
        object-fit: contain;
        margin: 0 auto var(--spacing-sm);
        display: block;
    }
    
    .case-details-img {
        width: 160px; /* Увеличен с 130px для планшетов */
        height: 160px; /* Увеличен с 130px для планшетов */
    }
}

@media (max-width: 480px) {
    .cases-grid {
        grid-template-columns: 1fr;
    }
    
    .case-img {
        width: 100%; /* Картинка на всю ширину карточки */
        height: auto; /* Автоматическая высота для пропорций */
        max-height: 140px; /* Максимальная высота, можно увеличить */
        object-fit: contain;
        margin: 0 auto var(--spacing-sm);
        display: block;
    }
    
    .case-details-img {
        width: 140px; /* Увеличен с 110px для мобильных */
        height: 140px; /* Увеличен с 110px для мобильных */
    }
}

@media (max-width: 360px) {
    .case-img {
        width: 100%; /* Картинка на всю ширину карточки */
        height: auto; /* Автоматическая высота для пропорций */
        max-height: 140px; /* Максимальная высота, можно увеличить */
        object-fit: contain;
        margin: 0 auto var(--spacing-sm);
        display: block;
    }
    
    .case-details-img {
        width: 120px; /* Увеличен с 90px для маленьких экранов */
        height: 120px; /* Увеличен с 90px для маленьких экранов */
    }
}

/* ============================================================================
   📱 АДАПТИВНОСТЬ ДЛЯ ВИТРИНЫ
   =========================================================================== */

@media (min-width: 768px) {
    .loot-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
    }
    
    .loot-item {
        min-height: 160px !important;
    }
}

@media (max-width: 480px) {
    .case-open-section {
        flex-direction: column;
        gap: 10px;
    }
    
    .case-open-section .btn {
        min-width: 100%;
    }
    
    .loot-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    .loot-item {
        min-height: 140px !important;
        padding: 15px !important;
    }
    
    .loot-item img {
        width: 70px !important;
        height: 70px !important;
    }
}

/* ============================================================================
   ⚡ УСКОРЕННЫЕ АНИМАЦИИ
   =========================================================================== */

.spinner-animation, .spinner-animation-fast {
    transition: opacity 0.3s ease !important;
}

.result-animation {
    animation: quickFadeIn 0.3s ease forwards !important;
}

@keyframes quickFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.case-open-section {
    transition: opacity 0.3s ease !important;
}
/* ============================================================================
   💰 BALANCE SCREEN / ЭКРАН БАЛАНСА
   =========================================================================== */

.balance-container {
    padding: var(--spacing-md);
    max-width: 600px;
    margin: 0 auto;
}

.current-balance-card {
    background: linear-gradient(135deg, var(--panel), rgba(27, 38, 59, 0.8));
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.balance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.balance-header h2 {
    margin: 0;
    font-size: 18px;
    color: var(--text);
}

.balance-refresh {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    color: var(--text);
}

.balance-refresh:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(180deg);
}

.balance-amount {
    font-size: 36px;
    font-weight: 700;
    color: #ffd700;
    margin: var(--spacing-lg) 0;
    text-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.balance-stats {
    display: flex;
    justify-content: space-around;
    margin-top: var(--spacing-lg);
}

.stat {
    text-align: center;
}

.stat-label {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.quick-topup-section {
    margin-bottom: var(--spacing-lg);
}

.quick-topup-section h3 {
    margin-bottom: var(--spacing-md);
    font-size: 16px;
}

.quick-amounts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
}

.quick-amount {
    background: var(--panel);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    border: none;
    color: var(--text);
}

.quick-amount:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.quick-amount.selected {
    border-color: var(--accent);
    background: rgba(46, 142, 255, 0.1);
    box-shadow: 0 0 20px rgba(46, 142, 255, 0.3);
}

.quick-amount .amount {
    font-size: 16px;
    font-weight: 700;
    color: #ffd700;
}

.quick-amount .price {
    font-size: 12px;
    color: var(--muted);
}

.custom-amount-section {
    margin-bottom: var(--spacing-lg);
    background: var(--panel);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
}

.custom-amount-section h3 {
    margin-bottom: var(--spacing-md);
    font-size: 16px;
}

.amount-input-container {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.currency-selector select {
    width: 100px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    padding: 12px;
    color: var(--text);
    font-size: 14px;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%239db4c0' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 36px;
}

.currency-selector select:focus {
    border-color: var(--accent);
}

.amount-input-wrapper {
    flex: 1;
    position: relative;
}

.amount-input-wrapper input {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    padding: 12px 16px 12px 48px;
    color: var(--text);
    font-size: 16px;
    font-weight: 600;
    outline: none;
}

.amount-input-wrapper input:focus {
    border-color: var(--accent);
}

.currency-label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-weight: 600;
}

.stars-preview {
    text-align: center;
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
}

.stars-amount {
    font-size: 20px;
    font-weight: 700;
    color: #ffd700;
    margin-bottom: 4px;
}

.conversion-rate {
    font-size: 12px;
    color: var(--muted);
}

.payment-methods-section {
    margin-bottom: var(--spacing-lg);
}

.payment-methods-section h3 {
    margin-bottom: var(--spacing-md);
    font-size: 16px;
}

.payment-methods {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
}

.payment-method {
    background: var(--panel);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    color: var(--text);
}

.payment-method:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.payment-method.selected {
    border-color: var(--accent);
    background: rgba(46, 142, 255, 0.1);
    box-shadow: 0 0 20px rgba(46, 142, 255, 0.3);
}

.method-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.method-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.method-fee {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 4px;
}

.method-description {
    font-size: 10px;
    color: var(--text-secondary);
}

.promo-section {
    margin-bottom: var(--spacing-lg);
    background: var(--panel);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
}

.promo-section h3 {
    margin-bottom: var(--spacing-md);
    font-size: 16px;
}

.promo-input-container {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.promo-input-container input {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: var(--text);
    font-size: 14px;
    outline: none;
}

.promo-input-container input:focus {
    border-color: var(--accent);
}

.btn-promo {
    background: var(--accent);
    border: none;
    border-radius: var(--radius-md);
    padding: 0 20px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.btn-promo:hover {
    background: var(--accent-hover);
}

.promo-result {
    padding: 12px;
    border-radius: var(--radius-md);
    font-size: 14px;
    text-align: center;
    min-height: 20px;
}

.promo-result.success {
    background: rgba(46, 204, 113, 0.2);
    color: var(--success);
}

.promo-result.error {
    background: rgba(231, 76, 60, 0.2);
    color: var(--danger);
}

.payment-button-section {
    margin-bottom: var(--spacing-xl);
}

.btn-pay {
    width: 100%;
    background: linear-gradient(135deg, var(--success), #27ae60);
    border: none;
    border-radius: var(--radius-lg);
    padding: 20px;
    color: white;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
}

.btn-pay:disabled {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    cursor: not-allowed;
    opacity: 0.7;
}

.btn-pay:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(46, 204, 113, 0.4);
}

.btn-text {
    font-size: 16px;
}

.btn-details {
    font-size: 12px;
    opacity: 0.9;
}

/* ============================================================================
   👤 PROFILE SCREEN / ЭКРАН ПРОФИЛЯ
   =========================================================================== */

.profile-container {
    padding: var(--spacing-md);
    max-width: 600px;
    margin: 0 auto;
}

.big-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent);
    margin: 0 auto var(--spacing-lg);
    display: block;
}

.profile-field {
    background: var(--panel);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-sm);
    font-size: 14px;
}

.inventory-count {
    font-size: 14px;
    color: var(--muted);
    font-weight: normal;
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.inventory-item {
    aspect-ratio: 1;
    background: linear-gradient(135deg, var(--panel), rgba(255, 255, 255, 0.1));
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.inventory-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.empty-inventory {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: var(--muted);
    font-style: italic;
}

/* ============================================================================
   🪟 MODALS / МОДАЛЬНЫЕ ОКНА
   =========================================================================== */

.case-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: var(--spacing-md);
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.case-modal:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

.case-box {
    background: var(--panel);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 400px;
    color: var(--text);
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 18px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: background-color var(--transition-fast);
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* 🎰 Анимации открытия кейса */
.spinner {
    overflow: hidden;
    width: 100%;
    height: 140px;
    border-radius: var(--radius-md);
    border: 2px solid rgba(78, 168, 222, 0.3);
    margin-bottom: var(--spacing-md);
    background: linear-gradient(180deg, var(--bg), rgba(20, 37, 53, 0.8));
    position: relative;
    display: flex;
    align-items: center;
}

.center-line {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 100%;
    background: rgba(255, 215, 0, 0.7);
    z-index: 2;
    pointer-events: none;
}

.spin-strip {
    display: flex;
    width: max-content;
    align-items: center;
    padding: 20px;
    position: absolute;
    left: 0;
    top: 0;
}

.spin-strip img {
    width: 100px;
    height: 100px;
    margin-right: 20px;
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, var(--panel), rgba(35, 50, 74, 0.8));
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.modal-body {
    text-align: center;
}

#loot-result {
    min-height: 40px;
    font-size: 18px;
    font-weight: 700;
    color: #ffd700;
    margin-bottom: var(--spacing-md);
}

.btn {
    width: 100%;
    padding: 14px;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-cancel {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-confirm {
    background: linear-gradient(135deg, var(--success), #27ae60);
}

.btn-confirm:hover {
    background: linear-gradient(135deg, #27ae60, #219955);
}

.reward-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.reward-icon {
    font-size: 48px;
    margin-bottom: var(--spacing-md);
}

.reward-details {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.reward-amount {
    font-size: 32px;
    font-weight: 700;
    color: #ffd700;
    margin: var(--spacing-md) 0;
}

/* Оставляем только подсветку при замедлении */
.spin-strip img.center-highlight {
    transform: scale(1.1);
    border-color: #ffd700 !important;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.7);
    z-index: 3;
    transition: all 0.3s ease;
}

/* Финальный результат */
.final-result {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    z-index: 4;
    pointer-events: none;
}

.final-result.show {
    opacity: 1;
    visibility: visible;
}

.final-result img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border: 3px solid;
    border-radius: var(--radius-md);
    background: var(--panel);
    padding: 12px;
    box-shadow: var(--shadow-xl);
    animation: pulseResult 0.5s ease-in-out 2;
}

@keyframes pulseResult {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ⭐ Telegram Stars Modal / Модалка Telegram Stars */
.telegram-stars-content {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.stars-icon {
    font-size: 48px;
    margin: var(--spacing-lg) 0;
}

.stars-description {
    margin-bottom: var(--spacing-lg);
    color: var(--text-secondary);
}

.stars-amount-selector {
    margin-bottom: var(--spacing-lg);
}

.stars-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.stars-option {
    background: var(--panel);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 12px;
    font-size: 16px;
    color: var(--text);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
}

.stars-option:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.stars-option.selected {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
    color: #ffd700;
}

.custom-stars {
    position: relative;
}

.custom-stars input {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    padding: 12px 16px 12px 40px;
    color: var(--text);
    font-size: 16px;
    outline: none;
}

.custom-stars input:focus {
    border-color: var(--accent);
}

.stars-label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #ffd700;
    font-weight: 600;
}

.stars-warning {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
    border-radius: var(--radius-md);
    padding: 12px;
    font-size: 12px;
    color: var(--danger);
}

/* 🪙 TON Payment Modal / Модалка оплаты TON */
.ton-content {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.ton-icon {
    font-size: 48px;
    margin: var(--spacing-lg) 0;
}

.ton-description {
    margin-bottom: var(--spacing-lg);
    color: var(--text-secondary);
}

.ton-amount-input {
    position: relative;
    margin-bottom: var(--spacing-lg);
}

.ton-amount-input input {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    padding: 16px 20px 16px 60px;
    color: var(--text);
    font-size: 18px;
    font-weight: 600;
    outline: none;
}

.ton-amount-input input:focus {
    border-color: var(--accent);
}

.ton-label {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 600;
    color: var(--muted);
}

.ton-stars-preview {
    background: rgba(255, 215, 0, 0.1);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    font-size: 18px;
    font-weight: 600;
    color: #ffd700;
}

.ton-instructions {
    text-align: center;
}

.qr-code-container {
    margin: var(--spacing-lg) auto;
    width: 200px;
    height: 200px;
    background: white;
    padding: 12px;
    border-radius: var(--radius-md);
}

.qr-code {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.wallet-address {
    background: rgba(255, 255, 255, 0.1);
    padding: 12px;
    border-radius: var(--radius-md);
    font-family: monospace;
    word-break: break-all;
    margin: var(--spacing-md) 0;
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.wallet-address:hover {
    background: rgba(255, 255, 255, 0.2);
}

.memo-text {
    background: rgba(46, 142, 255, 0.1);
    padding: 12px;
    border-radius: var(--radius-md);
    font-family: monospace;
    margin: var(--spacing-md) 0;
}

.ton-warning {
    color: var(--danger);
    font-size: 12px;
    margin-top: var(--spacing-md);
}

.ton-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-lg);
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--warning);
    animation: pulse 1.5s infinite;
}

/* ✅ Success Modal / Модалка успеха */
.success-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.success-icon {
    font-size: 48px;
    margin-bottom: var(--spacing-md);
}

.success-details {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.success-amount {
    font-size: 32px;
    font-weight: 700;
    color: #ffd700;
    margin: var(--spacing-md) 0;
}

.success-balance {
    font-size: 16px;
    color: var(--text-secondary);
}

.transaction-details {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin: var(--spacing-lg) 0;
    font-size: 12px;
    color: var(--muted);
}

.success-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2) !important;
}

/* ❌ Error Modal / Модалка ошибки */
.error-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.error-icon {
    font-size: 48px;
    margin-bottom: var(--spacing-md);
    color: var(--danger);
}

.error-body {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

/* ============================================================================
   🔔 NOTIFICATIONS / УВЕДОМЛЕНИЯ
   =========================================================================== */

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    left: 20px;
    background: var(--panel);
    color: var(--text);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    z-index: 10000;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(0, 0, 0, 0.1);
    animation: slideDown 0.3s ease;
    text-align: center;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.notification.success {
    background: rgba(46, 204, 113, 0.9);
    color: white;
}

.notification.error {
    background: rgba(231, 76, 60, 0.9);
    color: white;
}

.notification.warning {
    background: rgba(241, 196, 15, 0.9);
    color: white;
}

.notification.info {
    background: rgba(52, 152, 219, 0.9);
    color: white;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-100%);
        opacity: 0;
    }
}

/* ============================================================================
   📱 RESPONSIVE DESIGN / АДАПТИВНЫЙ ДИЗАЙН
   =========================================================================== */

@media (min-width: 768px) {
    .cases-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .quick-amounts {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .payment-methods {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .inventory-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .loot-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

@media (min-width: 1024px) {
    .cases-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .inventory-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .loot-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

@media (max-width: 480px) {
    .cases-grid {
        grid-template-columns: 1fr;
    }
    
    .success-actions {
        flex-direction: column;
    }
    
    .case-open-section {
        flex-direction: column;
    }
    
    .loot-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
}

/* ============================================================================
   ♿ ACCESSIBILITY / ДОСТУПНОСТЬ
   =========================================================================== */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================================================
   🖱️ SCROLLBAR STYLING / СТИЛИЗАЦИЯ СКРОЛЛБАРА
   =========================================================================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) rgba(255, 255, 255, 0.05);
}

/* ============================================================================
   💸 INVENTORY WITH SELL FUNCTIONALITY / ИНВЕНТАРЬ С ВОЗМОЖНОСТЬЮ ПРОДАЖИ
   =========================================================================== */

.inventory-item {
    position: relative;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 2px solid transparent;
}

.inventory-item.selected-for-sale {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.inventory-item.selected-for-sale::after {
    content: '✓';
    position: absolute;
    top: 5px;
    right: 5px;
    background: #ffd700;
    color: #000;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
}

.item-info {
    margin-top: 8px;
    text-align: center;
}

.item-name {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-type {
    font-size: 10px;
    color: var(--muted);
    margin: 2px 0;
}

.item-value {
    font-size: 11px;
    color: #ffd700;
    font-weight: 600;
}

/* Секция продажи */
.sell-section {
    margin-bottom: var(--spacing-md);
    text-align: center;
}

.sell-section .btn {
    margin-bottom: var(--spacing-sm);
}

.sell-hint {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
}

/* ============================================================================
   🎯 PROBABILITY SYSTEM / СИСТЕМА ВЕРОЯТНОСТЕЙ
   =========================================================================== */

.case-probabilities {
    margin-top: 8px;
    font-size: 10px;
    color: var(--muted);
}

.probability-info {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
}

.probability-tooltip {
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 12px;
    max-width: 300px;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
    z-index: 10001;
}

.tooltip-title {
    font-weight: 600;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.rarity-group {
    margin-bottom: 10px;
    padding-left: 8px;
    border-left-width: 3px;
    border-left-style: solid;
}

.rarity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.rarity-name {
    font-weight: 600;
    font-size: 12px;
}

.rarity-probability {
    font-weight: 700;
    font-size: 11px;
}

.rarity-items {
    font-size: 10px;
}

.rarity-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 4px;
    border-radius: 4px;
    margin-bottom: 2px;
}

.rarity-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.loot-probability {
    font-size: 12px;
    color: var(--muted);
    margin: 4px 0;
}

.loot-item-probability {
    font-size: 10px;
    color: var(--muted);
    margin-top: 2px;
}

/* ============================================================================
   📊 STATISTICS / СТАТИСТИКА
   =========================================================================== */

.stats-section {
    margin: 15px 0;
    text-align: center;
}

.stats-content {
    padding: 15px 0;
}

.stats-total {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
}

.stats-per-case {
    margin-top: 15px;
}

.case-stat-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 10px;
}

.case-stat-name {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--accent);
}

.rarity-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.rarity-stat:last-child {
    border-bottom: none;
}

.rarity-stat-name {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rarity-color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.rarity-stat-count {
    font-weight: 600;
}

.rarity-stat-percentage {
    color: var(--muted);
    font-size: 11px;
}

.stats-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* 🎨 Цвета редкостей для статистики */
.rarity-color-dot.common { background-color: #95a5a6; }
.rarity-color-dot.uncommon { background-color: #2ecc71; }
.rarity-color-dot.rare { background-color: #3498db; }
.rarity-color-dot.epic { background-color: #9b59b6; }
.rarity-color-dot.legendary { background-color: #f39c12; }
.rarity-color-dot.random { background-color: #00cec9; }
.rarity-color-dot.casino { background-color: #e74c3c; }
.rarity-color-dot.captain { background-color: #1abc9c; }
.rarity-color-dot.friends { background-color: #e67e22; }

/* ============================================================================
   🎰 CASE OPENING ANIMATIONS / АНИМАЦИИ ОТКРЫТИЯ КЕЙСОВ
   =========================================================================== */

.spinner-animation, .spinner-animation-fast {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: linear-gradient(90deg, 
        rgba(13, 27, 42, 0.8) 0%,
        rgba(27, 38, 59, 0.8) 50%,
        rgba(13, 27, 42, 0.8) 100%);
}

.spin-item {
    transition: all 0.3s ease;
}

.spin-item[data-is-win="true"] {
    position: relative;
    z-index: 2;
}

.spin-item img {
    transition: transform 0.3s ease;
}

.result-animation {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Анимация пульсации для выигрышного предмета */
@keyframes pulseWin {
    0%, 100% {
        box-shadow: 0 0 20px var(--win-color, #ffd700);
        transform: scale(1.1);
    }
    50% {
        box-shadow: 0 0 40px var(--win-color, #ffd700);
        transform: scale(1.2);
    }
}

/* ============================================================================
   🎁 CASE DETAILS IMPROVEMENTS / УЛУЧШЕНИЯ ДЕТАЛЕЙ КЕЙСА
   =========================================================================== */

.case-details-img {
    width: 150px;
    height: 150px;
    object-fit: contain;
    margin: 0 auto 20px;
    display: block;
    transition: all 0.3s ease;
}

.case-open-section {
    display: flex;
    gap: 15px;
    margin: 25px 0;
    justify-content: center;
}

.case-open-section .btn {
    min-width: 160px;
    padding: 15px 20px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.case-open-section .btn-primary {
    background: linear-gradient(135deg, var(--accent), #1e7eff);
    box-shadow: 0 4px 20px rgba(46, 142, 255, 0.4);
}

.case-open-section .btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(46, 142, 255, 0.6);
}

.case-open-section .btn-secondary {
    background: linear-gradient(135deg, #6c757d, #495057);
    box-shadow: 0 4px 20px rgba(108, 117, 125, 0.4);
}

.case-open-section .btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(108, 117, 125, 0.6);
}

.loot-section h4 {
    text-align: center;
    margin: 30px 0 20px;
    color: var(--text);
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    padding-bottom: 10px;
}

.loot-section h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

/* Вероятности выпадения */
.case-probabilities {
    margin-top: 8px;
    font-size: 10px;
    color: var(--muted);
}

.probability-info {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
}
/* ============================================================================
   🎯 УЛУЧШЕННАЯ ВИТРИНА ПРЕДМЕТОВ
   =========================================================================== */

.loot-grid {
    width: 100%;
    margin-top: 20px;
}

.loot-grid > div {
    width: 100% !important;
    max-width: 100% !important;
}

.loot-item {
    width: 100% !important;
    min-height: 150px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    box-sizing: border-box !important;
}

.loot-item img {
    width: 80px !important;
    height: 80px !important;
    margin-bottom: 12px !important;
}

.loot-name {
    font-size: 14px !important;
    font-weight: 600 !important;
    margin-bottom: 8px !important;
    text-align: center !important;
    width: 100% !important;
}

.loot-type {
    font-size: 12px !important;
    font-weight: 500 !important;
    margin-bottom: 8px !important;
}

.loot-value {
    font-size: 14px !important;
    font-weight: 700 !important;
}

/* ============================================================================
   ⚡ УСКОРЕННЫЕ АНИМАЦИИ
   =========================================================================== */

.spinner-animation, .spinner-animation-fast {
    transition: opacity 0.3s ease !important;
}

.result-animation {
    animation: quickFadeIn 0.3s ease forwards !important;
}

@keyframes quickFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.case-open-section {
    transition: opacity 0.3s ease !important;
}

/* ============================================================================
   📱 АДАПТИВНОСТЬ ДЛЯ ВИТРИНЫ
   =========================================================================== */

@media (min-width: 768px) {
    .loot-grid > div {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
    }
    
    .loot-item {
        min-height: 160px !important;
    }
}

@media (max-width: 480px) {
    .loot-grid > div {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    .loot-item {
        min-height: 140px !important;
        padding: 15px !important;
    }
    
    .loot-item img {
        width: 70px !important;
        height: 70px !important;
    }
}

/* ============================================================================
   ⚡ УПРОЩЕННЫЕ АНИМАЦИИ
   =========================================================================== */

@keyframes pulseWin {
    0%, 100% {
        box-shadow: 0 0 15px var(--win-color, #ffd700);
        transform: scale(1.15);
    }
    50% {
        box-shadow: 0 0 30px var(--win-color, #ffd700);
        transform: scale(1.25);
    }
}

@keyframes pulseResult {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 30px var(--result-color, #ffd700);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 40px var(--result-color, #ffd700);
    }
}

.spinner-animation, .spinner-animation-fast {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: linear-gradient(90deg, 
        rgba(13, 27, 42, 0.8) 0%,
        rgba(27, 38, 59, 0.8) 50%,
        rgba(13, 27, 42, 0.8) 100%);
}

.spin-item {
    transition: all 0.3s ease;
}

.spin-item[data-is-win="true"] {
    position: relative;
    z-index: 2;
}

.simple-result {
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================================================
   💸 UPDATED PAYMENT FORM / ОБНОВЛЕННАЯ ФОРМА ПОПОЛНЕНИЯ
   =========================================================================== */

.balance-container {
    padding: var(--spacing-md);
    max-width: 420px;
    margin: 0 auto;
}

/* Header */
.payment-header {
    position: relative;
    text-align: center;
    padding: 12px 0 20px;
}

.payment-back-btn {
    position: absolute;
    left: 0;
    top: 8px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--panel);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
}

.payment-back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.payment-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

/* Payment methods */
.payment-methods-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.payment-method-select {
    flex: 1;
    background: var(--panel);
    border-radius: 14px;
    padding: 18px 0;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
    align-items: center;
    border: none;
}

.payment-method-select:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

.payment-method-select.active {
    border: 2px solid var(--accent);
    background: rgba(46, 142, 255, 0.1);
    color: var(--accent);
}

.method-icon {
    display: block;
    font-size: 24px;
    margin-bottom: 8px;
}

.method-icon.star {
    color: #ffd700;
}

.method-icon.ton {
    color: #38bdf8;
}

.method-icon.gift {
    color: var(--muted);
}

/* Payment card */
.payment-card {
    background: linear-gradient(180deg, var(--panel), rgba(13, 27, 42, 0.8));
    border-radius: 20px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-lg);
}

.payment-card-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text);
    text-align: center;
}

/* Fields */
.payment-field {
    margin-bottom: 20px;
}

.payment-label {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 8px;
    font-weight: 500;
}

.payment-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 16px;
    font-size: 16px;
    color: var(--text);
    outline: none;
    transition: all var(--transition-fast);
}

.payment-input:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
}

.payment-input::placeholder {
    color: var(--muted);
}

/* Input with icon */
.payment-input-with-icon {
    position: relative;
}

.star-input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #ffd700;
    font-size: 18px;
    font-weight: 700;
}

.payment-input-with-icon input {
    padding-left: 48px;
    font-size: 18px;
    font-weight: 600;
}

/* Rate */
.payment-rate {
    font-size: 14px;
    color: var(--muted);
    margin: 16px 0 24px;
    text-align: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

/* Button */
.payment-submit-btn {
    width: 100%;
    height: 56px;
    border-radius: 16px;
    border: none;
    background: linear-gradient(135deg, var(--accent), #1e7eff);
    color: white;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.payment-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(46, 142, 255, 0.4);
}

.payment-submit-btn:disabled {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: rgba(255, 255, 255, 0.5);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Balance display in payment screen */
.payment-current-balance {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, var(--panel), rgba(27, 38, 59, 0.8));
    border-radius: var(--radius-lg);
}

.payment-current-balance .label {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 8px;
}

.payment-current-balance .amount {
    font-size: 36px;
    font-weight: 700;
    color: #ffd700;
    text-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

/* Responsive */
@media (max-width: 480px) {
    .payment-methods-selector {
        gap: 8px;
    }
    
    .payment-method-select {
        padding: 16px 0;
        font-size: 14px;
    }
    
    .method-icon {
        font-size: 20px;
        margin-bottom: 6px;
    }
    
    .payment-card {
        padding: 20px;
    }
    
    .payment-card-title {
        font-size: 20px;
    }
}

/* ============================================================================
   📊 PAYMENT HISTORY / ИСТОРИЯ ПЛАТЕЖЕЙ
   =========================================================================== */

.history-section {
    margin-top: 30px;
    background: var(--panel);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.history-header h3 {
    margin: 0;
    font-size: 18px;
}

.btn-history {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    padding: 8px 16px;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-history:hover {
    background: rgba(255, 255, 255, 0.2);
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
}

.empty-history {
    text-align: center;
    padding: 40px 20px;
    color: var(--muted);
    font-style: italic;
}

.history-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.history-item:last-child {
    margin-bottom: 0;
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.history-method {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.history-status {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 20px;
}

.history-status.success {
    background: rgba(46, 204, 113, 0.2);
    color: var(--success);
}

.history-status.pending {
    background: rgba(241, 196, 15, 0.2);
    color: var(--warning);
}

.history-status.failed {
    background: rgba(231, 76, 60, 0.2);
    color: var(--danger);
}

.history-item-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-amount {
    font-size: 18px;
    font-weight: 700;
}

.history-amount.positive {
    color: #ffd700;
}

.history-amount.negative {
    color: var(--danger);
}

.history-date {
    font-size: 12px;
    color: var(--muted);
}


/* ============================================================================
   👤 NEW PROFILE DESIGN / НОВЫЙ ДИЗАЙН ПРОФИЛЯ
   =========================================================================== */

.profile-screen {
  min-height: 100vh;
  padding: 22px 18px 40px;
  position: relative;
  background:
    radial-gradient(900px 420px at 50% 0%, rgba(255,255,255,.10), rgba(255,255,255,0) 55%),
    radial-gradient(500px 280px at 25% 10%, rgba(255,255,255,.06), rgba(255,255,255,0) 60%),
    radial-gradient(520px 300px at 70% 14%, rgba(255,255,255,.05), rgba(255,255,255,0) 62%),
    var(--bg);
}

.wrap {
  max-width: 920px;
  margin: 0 auto;
}

/* Top Bar */
.topbar {
  position: relative;
  padding-top: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.topbar .back {
  position: absolute;
  left: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(27, 38, 59, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cfd6e6;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
}

.topbar .back:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.05);
}

.topbar .back svg {
  display: block;
}

.topbar .title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: .2px;
  margin: 8px 0 0;
  text-align: center;
  color: var(--text);
}

/* Profile Section */
.profile {
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.profile .avatar {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ff7f66, #ff4f76);
  box-shadow: 
    0 0 0 4px rgba(0, 0, 0, 0.35),
    0 20px 40px rgba(255, 79, 118, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-normal);
}

.profile .avatar:hover {
  transform: scale(1.05);
  box-shadow: 
    0 0 0 4px rgba(0, 0, 0, 0.35),
    0 25px 50px rgba(255, 79, 118, 0.4);
}

.profile .avatar span {
  font-size: 64px;
  font-weight: 700;
  color: #fff;
  transform: translateY(-2px);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.profile .name {
  font-size: 28px;
  font-weight: 800;
  margin: 4px 0 0;
  text-align: center;
  color: var(--text);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.profile .userid {
  margin: 0;
  font-size: 18px;
  color: var(--muted);
  text-align: center;
  font-weight: 500;
}

/* Inventory Header */
.inventory {
  margin: 26px 0 0;
  width: 100%;
  max-width: 920px;
  border-radius: 14px;
  background: rgba(27, 38, 59, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 8px 32px rgba(0, 0, 0, 0.2);
}

.inventory .cube {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  color: var(--text);
  opacity: 0.95;
}

.inventory .label {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.inventory-count {
  font-size: 16px;
  font-weight: 500;
  color: var(--muted);
  opacity: 0.8;
}

/* Inventory Grid Modern */
.inventory-grid-modern {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 16px;
  padding: 20px 0;
}

/* Empty State */
.empty-inventory {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 40px 20px;
  background: rgba(27, 38, 59, 0.3);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.empty-inventory .h {
  font-size: 26px;
  font-weight: 900;
  margin: 0;
  color: var(--text);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.empty-inventory .p {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.35;
  max-width: 520px;
  opacity: 0.9;
}

.empty-inventory .btn {
  margin-top: 18px;
  background: linear-gradient(135deg, var(--accent), #1e7eff);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px 22px;
  font-size: 20px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  box-shadow: 
    0 8px 18px rgba(46, 142, 255, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.empty-inventory .btn:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 12px 24px rgba(46, 142, 255, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.15);
}

.empty-inventory .btn:active {
  transform: translateY(0);
}

.cube2 {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: #ffffff;
}

/* Background Dots */
.dots {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .28;
  background:
    radial-gradient(2px 2px at 15% 12%, rgba(255,255,255,.6), rgba(255,255,255,0) 70%),
    radial-gradient(2px 2px at 32% 18%, rgba(255,255,255,.55), rgba(255,255,255,0) 70%),
    radial-gradient(2px 2px at 58% 10%, rgba(255,255,255,.55), rgba(255,255,255,0) 70%),
    radial-gradient(2px 2px at 74% 22%, rgba(255,255,255,.55), rgba(255,255,255,0) 70%),
    radial-gradient(2px 2px at 80% 14%, rgba(255,255,255,.55), rgba(255,255,255,0) 70%),
    radial-gradient(2px 2px at 42% 8%, rgba(255,255,255,.55), rgba(255,255,255,0) 70%);
  mix-blend-mode: screen;
  z-index: 0;
}

/* Inventory Items Styling */
/* Добавить в существующие стили для inventory-grid-modern */
.inventory-grid-modern .inventory-item {
  aspect-ratio: 1;
  background: linear-gradient(135deg, rgba(27, 38, 59, 0.8), rgba(13, 27, 42, 0.8));
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all var(--transition-fast);
  cursor: pointer; /* Добавить курсор указателя */
  position: relative;
  overflow: hidden;
}

.inventory-grid-modern .inventory-item:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(46, 142, 255, 0.2);
}

.inventory-grid-modern .inventory-item:active {
  transform: translateY(-2px);
}

.inventory-grid-modern .inventory-item.selected {
  border-color: #ffd700;
  background: rgba(255, 215, 0, 0.05);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
}

.inventory-grid-modern .inventory-item img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  margin-bottom: 8px;
}

.inventory-grid-modern .item-info {
  text-align: center;
  width: 100%;
}

.inventory-grid-modern .item-name {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.inventory-grid-modern .item-type {
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 500;
}

.inventory-grid-modern .item-value {
  font-size: 11px;
  color: #ffd700;
  font-weight: 700;
}

/* Responsive Design for New Profile */
@media (max-width: 768px) {
  .profile-screen {
    padding: 16px 12px 40px;
  }
  
  .topbar .title {
    font-size: 22px;
  }
  
  .profile .avatar {
    width: 120px;
    height: 120px;
  }
  
  .profile .avatar span {
    font-size: 48px;
  }
  
  .profile .name {
    font-size: 24px;
  }
  
  .profile .userid {
    font-size: 16px;
  }
  
  .inventory .label {
    font-size: 18px;
  }
  
  .empty-inventory .h {
    font-size: 22px;
  }
  
  .empty-inventory .p {
    font-size: 16px;
  }
  
  .empty-inventory .btn {
    font-size: 18px;
    padding: 12px 20px;
  }
  
  .inventory-grid-modern {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .profile-screen {
    padding: 12px 8px 40px;
  }
  
  .topbar .title {
    font-size: 20px;
  }
  
  .profile .avatar {
    width: 100px;
    height: 100px;
  }
  
  .profile .avatar span {
    font-size: 40px;
  }
  
  .profile .name {
    font-size: 20px;
  }
  
  .inventory .label {
    font-size: 16px;
  }
  
  .empty-inventory .h {
    font-size: 20px;
  }
  
  .empty-inventory .p {
    font-size: 14px;
  }
  
  .empty-inventory .btn {
    font-size: 16px;
    padding: 10px 18px;
  }
  
  .inventory-grid-modern {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 10px;
  }
}

/* ============================================================================
   👥 REFERRALS SCREEN / ЭКРАН РЕФЕРАЛОВ
   =========================================================================== */

.referrals-screen {
  min-height: 100vh;
  padding: 22px 18px 40px;
  position: relative;
  background:
    radial-gradient(900px 520px at 50% 0%, rgba(255,255,255,.09), rgba(255,255,255,0) 60%),
    var(--bg);
}

.referrals-screen .wrap {
  max-width: 920px;
  margin: 0 auto;
}

.referrals-screen .topbar {
  background: transparent;
  box-shadow: none;
  border: none;
  height: auto;
  padding: 0;
  position: relative;
  margin-bottom: 20px;
}

.referrals-screen .back {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(27, 38, 59, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #cfd6e6;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
}

.referrals-screen .back:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.05);
}

.referrals-screen .back svg {
  display: block;
}

.referrals-screen .title {
  margin: 28px 0 0;
  text-align: center;
  font-weight: 900;
  font-size: 36px;
  line-height: 1.12;
  letter-spacing: .2px;
  color: var(--text);
}

.referrals-screen .btn-invite {
  margin: 46px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 420px;
  height: 74px;
  border-radius: 14px;
  border: 1.5px solid #2e8eff;
  background: linear-gradient(180deg, rgba(46, 142, 255, 0.28), rgba(46, 142, 255, 0.14));
  color: #ffffff;
  font-weight: 800;
  font-size: 22px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.referrals-screen .btn-invite:hover {
  background: linear-gradient(180deg, rgba(46, 142, 255, 0.38), rgba(46, 142, 255, 0.24));
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(46, 142, 255, 0.3);
}

.referrals-screen .btn-invite:active {
  transform: translateY(0);
}

.referrals-screen .btn-icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  color: #ffffff;
}

.referrals-screen .copy {
  margin: 22px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #6f7a90;
  font-weight: 700;
  font-size: 24px;
  cursor: pointer;
  transition: color var(--transition-fast);
  max-width: 420px;
  padding: 12px;
  border-radius: 12px;
}

.referrals-screen .copy:hover {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.05);
}

.referrals-screen .copy-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: inherit;
}

.referrals-screen .card {
  width: 100%;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(27, 38, 59, 0.90), rgba(18, 27, 42, 0.88));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 8px 32px rgba(0, 0, 0, 0.2);
}

.referrals-screen .promo {
  margin-top: 46px;
  padding: 22px 18px 18px;
}

.referrals-screen .promo-title {
  font-size: 26px;
  font-weight: 900;
  margin: 0;
  color: var(--text);
}

.referrals-screen .promo-sub {
  margin-top: 12px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.35;
}

.referrals-screen .c-blue { 
  color: #3aa0ff; 
  font-weight: 800; 
}

.referrals-screen .c-pink { 
  color: #ff3d7a; 
  font-weight: 800; 
}

.referrals-screen .codebox {
  margin-top: 18px;
  background: rgba(13, 27, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.referrals-screen .code-label {
  color: #5f6a7f;
  font-size: 18px;
  margin: 0;
}

.referrals-screen .code-value {
  margin-top: 4px;
  font-size: 24px;
  font-weight: 800;
  color: #ffffff;
  font-family: monospace;
  letter-spacing: 1px;
}

.referrals-screen .code-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.referrals-screen .icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8791a6;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.referrals-screen .icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--accent);
  transform: scale(1.05);
}

.referrals-screen .icon-btn:active {
  transform: scale(0.95);
}

.referrals-screen .stats {
  margin-top: 18px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.referrals-screen .stats-icon {
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.referrals-screen .badge {
  width: 62px;
  height: 62px;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffd36a, #f2a91f);
  transform: rotate(-10deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
}

.referrals-screen .badge svg {
  background: radial-gradient(circle at 35% 30%, #66a9ff, #2e8eff);
  border-radius: 50%;
  padding: 6px;
}

.referrals-screen .stats-text { 
  display: flex; 
  flex-direction: column; 
  gap: 4px; 
}

.referrals-screen .stats-value {
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
  color: var(--text);
}

.referrals-screen .stats-label {
  color: var(--muted);
  font-size: 18px;
  font-weight: 700;
}

.referrals-screen .section {
  margin-top: 34px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.referrals-screen .hex {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  color: #19d6d6;
}

.referrals-screen .section-title {
  font-size: 26px;
  font-weight: 900;
  color: var(--text);
}

.referrals-screen .referrals-list {
  margin-top: 20px;
}

.referrals-screen .empty-referrals {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  font-style: italic;
  background: rgba(27, 38, 59, 0.3);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.referrals-screen .empty-referrals p:first-child {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.referrals-screen .empty-referrals p:last-child {
  font-size: 14px;
  opacity: 0.8;
}

.referrals-screen .referral-item {
  display: flex;
  align-items: center;
  padding: 16px;
  margin-bottom: 12px;
  background: rgba(27, 38, 59, 0.4);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.2s ease;
}

.referrals-screen .referral-item:hover {
  background: rgba(27, 38, 59, 0.6);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.referrals-screen .referral-avatar {
  margin-right: 16px;
}

.referrals-screen .avatar-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
  color: white;
}

.referrals-screen .referral-info {
  flex: 1;
}

.referrals-screen .referral-name {
  font-size: 16px;
  font-weight: 600;
  color: white;
  margin-bottom: 4px;
}

.referrals-screen .referral-username {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 6px;
}

.referrals-screen .referral-stats {
  display: flex;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}

.referrals-screen .referral-date {
  color: #a0aec0;
}

.referrals-screen .referral-divider {
  margin: 0 8px;
  color: rgba(255, 255, 255, 0.3);
}

.referrals-screen .referral-cases {
  color: #48bb78;
  font-weight: 500;
}

/* Responsive design for referrals screen */
@media (max-width: 768px) {
  .referrals-screen {
    padding: 16px 12px 40px;
  }
  
  .referrals-screen .title {
    font-size: 28px;
  }
  
  .referrals-screen .btn-invite {
    height: 64px;
    font-size: 20px;
    max-width: 360px;
  }
  
  .referrals-screen .copy {
    font-size: 20px;
    max-width: 360px;
  }
  
  .referrals-screen .promo-title {
    font-size: 22px;
  }
  
  .referrals-screen .promo-sub {
    font-size: 16px;
  }
  
  .referrals-screen .code-value {
    font-size: 20px;
  }
  
  .referrals-screen .stats-value {
    font-size: 28px;
  }
  
  .referrals-screen .stats-label {
    font-size: 16px;
  }
  
  .referrals-screen .section-title {
    font-size: 22px;
  }
}

@media (max-width: 480px) {
  .referrals-screen {
    padding: 12px 8px 40px;
  }
  
  .referrals-screen .title {
    font-size: 24px;
  }
  
  .referrals-screen .btn-invite {
    height: 58px;
    font-size: 18px;
    max-width: 320px;
  }
  
  .referrals-screen .copy {
    font-size: 18px;
    max-width: 320px;
  }
  
  .referrals-screen .promo-title {
    font-size: 20px;
  }
  
  .referrals-screen .promo-sub {
    font-size: 15px;
  }
  
  .referrals-screen .code-label {
    font-size: 16px;
  }
  
  .referrals-screen .code-value {
    font-size: 18px;
  }
  
  .referrals-screen .icon-btn {
    width: 38px;
    height: 38px;
  }
  
  .referrals-screen .stats {
    padding: 16px;
  }
  
  .referrals-screen .stats-icon {
    width: 60px;
    height: 60px;
  }
  
  .referrals-screen .badge {
    width: 54px;
    height: 54px;
  }
  
  .referrals-screen .stats-value {
    font-size: 24px;
  }
  
  .referrals-screen .stats-label {
    font-size: 15px;
  }
  
  .referrals-screen .section-title {
    font-size: 20px;
  }
}

/* ============================================================================
   🛒 INVENTORY SELL FUNCTIONALITY / ФУНКЦИОНАЛ ПРОДАЖИ ПРЕДМЕТОВ
   =========================================================================== */

/* Контекстное меню */
.context-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.context-menu:not(.hidden) {
  opacity: 1;
  visibility: visible;
}

.context-menu-content {
  background: var(--panel);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 500px;
  padding: 24px;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.4);
  transform: translateY(100%);
  transition: transform var(--transition-normal);
}

.context-menu:not(.hidden) .context-menu-content {
  transform: translateY(0);
}

.context-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.context-menu-item-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  max-width: 80%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-menu-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.context-menu-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.context-menu-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.context-menu-item-type {
  font-size: 16px;
  font-weight: 600;
  color: var(--muted);
}

.context-menu-item-value {
  font-size: 18px;
  font-weight: 700;
  color: #ffd700;
}

.context-menu-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.context-menu-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 18px 20px;
  border-radius: 14px;
  border: none;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
}

.context-menu-btn-icon {
  font-size: 22px;
  width: 30px;
  text-align: center;
}

.context-menu-btn-text {
  flex: 1;
}

.context-menu-btn.sell-btn {
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  color: white;
}

.context-menu-btn.sell-btn:hover {
  background: linear-gradient(135deg, #2ecc71, #34d67c);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(46, 204, 113, 0.4);
}

.context-menu-btn.withdraw-btn {
  background: linear-gradient(135deg, #6c757d, #495057);
  color: white;
}

.context-menu-btn.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.context-menu-btn.disabled:hover {
  transform: none;
  box-shadow: none;
}

/* Модальное окно подтверждения продажи */
.context-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2100;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
  padding: 20px;
}

.context-modal:not(.hidden) {
  opacity: 1;
  visibility: visible;
}

.context-modal-content {
  background: var(--panel);
  border-radius: 20px;
  width: 100%;
  max-width: 400px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transform: scale(0.9);
  transition: transform var(--transition-normal);
}

.context-modal:not(.hidden) .context-modal-content {
  transform: scale(1);
}

.context-modal-header {
  text-align: center;
  margin-bottom: 24px;
}

.context-modal-header h3 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.context-modal-body {
  margin-bottom: 24px;
}

.sell-confirm-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.sell-confirm-image {
  width: 70px;
  height: 70px;
  object-fit: contain;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--panel), rgba(255, 255, 255, 0.1));
  padding: 8px;
  border: 2px solid;
}

.sell-confirm-info {
  flex: 1;
}

.sell-confirm-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.sell-confirm-details {
  display: flex;
  gap: 12px;
}

.sell-confirm-type {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.sell-confirm-value {
  font-size: 16px;
  font-weight: 700;
  color: #ffd700;
}

.sell-confirm-message {
  text-align: center;
  font-size: 18px;
  color: var(--text);
  padding: 16px;
  background: rgba(46, 204, 113, 0.1);
  border-radius: 12px;
  border: 1px solid rgba(46, 204, 113, 0.2);
}

.sell-confirm-amount {
  font-weight: 900;
  font-size: 24px;
  color: #ffd700;
  text-shadow: 0 2px 4px rgba(255, 215, 0, 0.3);
}

.context-modal-actions {
  display: flex;
  gap: 12px;
}

.context-modal-btn {
  flex: 1;
  padding: 16px;
  border-radius: 12px;
  border: none;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.context-modal-btn.cancel-btn {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.context-modal-btn.cancel-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.context-modal-btn.confirm-btn {
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  color: white;
}

.context-modal-btn.confirm-btn:hover {
  background: linear-gradient(135deg, #2ecc71, #34d67c);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(46, 204, 113, 0.4);
}

/* Адаптивность */
@media (max-width: 480px) {
  .context-menu-content {
    padding: 20px;
  }
  
  .context-menu-item-name {
    font-size: 18px;
  }
  
  .context-menu-btn {
    padding: 16px 18px;
    font-size: 16px;
  }
  
  .sell-confirm-item {
    padding: 14px;
  }
  
  .sell-confirm-image {
    width: 60px;
    height: 60px;
  }
  
  .sell-confirm-name {
    font-size: 16px;
  }
}

@media (max-width: 360px) {
  .context-menu-content {
    padding: 18px;
  }
  
  .context-menu-btn {
    padding: 14px 16px;
    font-size: 15px;
  }
  
  .context-menu-btn-icon {
    font-size: 20px;
  }
}

/* Fix for case details positioning */
#screen-case-details {
    position: fixed;
    top: 70px; /* Высота topbar */
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    z-index: 50;
    overflow-y: auto;
    padding: 0 !important;
}

.case-details-container {
    height: 100%;
    overflow-y: auto;
    padding-bottom: 80px; /* Для нижней навигации */
}

/* Добавить в CSS или в БЛОК 10 app.js */
.scroll-icons {
    display: flex;
    overflow-x: hidden; /* Изменить с auto на hidden */
    scrollbar-width: none;
    -ms-overflow-style: none;
    width: 100%;
}

.scroll-icons::-webkit-scrollbar {
    display: none;
}



/* Для кнопки "Продать все" */
.inventory-actions {
    margin-top: 20px;
    padding: 0 15px;
}

.sell-all-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #e53e3e, #c53030);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sell-all-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(229, 62, 62, 0.4);
}

.sell-all-btn:active {
    transform: translateY(0);
}

.btn-icon {
    display: flex;
    align-items: center;
}



/* Live лента с предметами */
.live-container {
    background: linear-gradient(90deg, rgba(13, 27, 42, 0.9) 0%, rgba(27, 38, 59, 0.9) 100%);
    border-radius: 12px;
    padding: 10px 15px;
    margin: 10px 15px 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.live-badge {
    background: linear-gradient(135deg, #e53935, #d32f2f);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(229, 57, 53, 0.4);
}

.live-dot {
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.feed-window {
    flex: 1;
    position: relative;
    overflow: hidden;
    height: 60px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.feed-track {
    display: flex;
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    align-items: center;
    animation: scrollItems 50s linear infinite;
    gap: 25px;
    padding: 0 20px;
}

@keyframes scrollItems {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.feed-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}

.feed-item-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(27, 38, 59, 0.9), rgba(13, 27, 42, 0.9));
    padding: 8px;
    border: 2px solid;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.feed-item:hover .feed-item-img {
    transform: scale(1.15);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.fade-right {
    position: absolute;
    right: 0;
    top: 0;
    width: 60px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(13, 27, 42, 0.9));
    pointer-events: none;
    z-index: 1;
}





/* Админ панель */
#screen-admin {
    background: var(--bg-primary);
    min-height: 100vh;
}

.admin-tabs {
    display: flex;
    gap: 10px;
    padding: 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
}

.admin-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 15px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.admin-tab:hover:not(:disabled) {
    background: var(--bg-hover);
}

.admin-tab.active {
    background: linear-gradient(135deg, var(--accent), #1e7eff);
    color: white;
    border-color: var(--accent);
}

.admin-tab:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.coming-soon {
    background: #ff9800;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 4px;
}

.admin-tab-content {
    display: none;
    padding: 20px;
}

.admin-tab-content.active {
    display: block;
}

/* Поиск в админке */
.admin-search {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.admin-search input {
    flex: 1;
    padding: 12px 15px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 14px;
}

.admin-search input:focus {
    outline: none;
    border-color: var(--accent);
}

.admin-search button {
    background: linear-gradient(135deg, var(--accent), #1e7eff);
    border: none;
    border-radius: 12px;
    color: white;
    width: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.admin-search button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(46, 142, 255, 0.4);
}

/* Список пользователей */
.admin-users-list {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-secondary);
}

.loading-admin {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-style: italic;
}

.error-loading {
    text-align: center;
    padding: 40px;
    color: #fc8181;
}

.empty-admin {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.admin-user-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--border);
    transition: all 0.3s ease;
    cursor: pointer;
}

.admin-user-item:last-child {
    border-bottom: none;
}

.admin-user-item:hover {
    background: var(--bg-hover);
}

.admin-user-item.admin {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1), rgba(238, 90, 82, 0.05));
    border-left: 4px solid #ff6b6b;
}

.admin-user-item.selected {
    background: rgba(46, 142, 255, 0.1);
    border-left: 4px solid var(--accent);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #1e7eff);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    margin-right: 15px;
    flex-shrink: 0;
}

.admin-user-item.admin .user-avatar {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
}

.user-info {
    flex: 1;
}

.user-name {
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text);
}

.user-id {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.user-details {
    display: flex;
    gap: 15px;
    font-size: 12px;
    margin-bottom: 4px;
}

.user-balance {
    color: #ffd700;
    font-weight: 600;
}

.user-cases, .user-items {
    color: var(--text-secondary);
}

.user-created {
    font-size: 11px;
    color: #666;
}

.admin-badge {
    background: #ff6b6b;
    color: white;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
}

/* Контролы админки */
.admin-controls {
    margin-top: 20px;
}

.admin-control-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: linear-gradient(135deg, var(--accent), #1e7eff);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.admin-control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(46, 142, 255, 0.4);
}

/* Заглушка "скоро" */
.admin-coming-soon {
    text-align: center;
    padding: 60px 20px;
}

.coming-soon-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.admin-coming-soon h3 {
    margin-bottom: 15px;
    color: var(--text);
}

.admin-coming-soon p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Модальные окна админки */
.admin-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.admin-modal.hidden {
    display: none;
}

.admin-modal-content {
    background: var(--bg-primary);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.admin-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.admin-modal-header h3 {
    margin: 0;
    color: var(--text);
}

.admin-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.admin-modal-close:hover {
    background: var(--bg-hover);
}

.admin-modal-body {
    padding: 20px;
}

.admin-modal-footer {
    display: flex;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid var(--border);
}

.admin-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.admin-btn.primary {
    background: linear-gradient(135deg, var(--accent), #1e7eff);
    color: white;
}

.admin-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(46, 142, 255, 0.4);
}

.admin-btn.secondary {
    background: var(--bg-secondary);
    color: var(--text);
    border: 1px solid var(--border);
}

.admin-btn.secondary:hover {
    background: var(--bg-hover);
}

/* Форма добавления баланса */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text);
    font-weight: 600;
    font-size: 14px;
}

.selected-user-info {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 15px;
    color: var(--text-secondary);
}

.selected-user-info.has-user {
    background: rgba(46, 142, 255, 0.1);
    border-color: var(--accent);
    color: var(--text);
}

.input-with-icon {
    position: relative;
}

.input-with-icon input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 16px;
}

.input-with-icon input:focus {
    outline: none;
    border-color: var(--accent);
}

.input-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #ffd700;
    font-size: 18px;
}

.quick-amounts {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.quick-amount {
    flex: 1;
    padding: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.quick-amount:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
}

select, textarea {
    width: 100%;
    padding: 12px 15px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 14px;
    resize: vertical;
}

select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
}

/* Добавьте в styles.css */

/* Стили для модалки вывода */
.withdraw-confirm-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(27, 38, 59, 0.5);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.withdraw-confirm-image {
    width: 70px;
    height: 70px;
    border-radius: 10px;
    border: 3px solid;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.2);
    padding: 5px;
}

.withdraw-confirm-info {
    flex: 1;
}

.withdraw-confirm-name {
    font-weight: 600;
    font-size: 16px;
    color: white;
    margin-bottom: 5px;
}

.withdraw-confirm-details {
    display: flex;
    gap: 15px;
    align-items: center;
}

.withdraw-confirm-type {
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    font-weight: 500;
}

.withdraw-confirm-value {
    font-size: 14px;
    font-weight: 700;
    color: #FFD700;
}

/* Кнопка вывода */
.confirm-withdraw-btn {
    background: linear-gradient(135deg, #9C27B0, #673AB7) !important;
    border: none !important;
    color: white !important;
    font-weight: 600 !important;
    padding: 12px 24px !important;
    border-radius: 25px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.confirm-withdraw-btn:hover {
    background: linear-gradient(135deg, #7B1FA2, #5E35B1) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 5px 15px rgba(156, 39, 176, 0.4) !important;
}

/* Кнопка вывода в контекстном меню */
.context-menu-btn.withdraw-btn {
    background: linear-gradient(135deg, #9C27B0, #673AB7) !important;
    border: 1px solid #9C27B0 !important;
    color: white !important;
}

.context-menu-btn.withdraw-btn:hover {
    background: linear-gradient(135deg, #7B1FA2, #5E35B1) !important;
    transform: translateY(-1px) !important;
}

/* Кнопка отмены */
.context-modal-btn.cancel-btn {
    background: #666 !important;
    color: white !important;
    border: none !important;
}

.context-modal-btn.cancel-btn:hover {
    background: #777 !important;
}

/* Кнопка продажи в контекстном меню */
.context-menu-btn.sell-btn {
    background: linear-gradient(135deg, #2196F3, #1976D2) !important;
    border: 1px solid #2196F3 !important;
    color: white !important;
}

.context-menu-btn.sell-btn:hover {
    background: linear-gradient(135deg, #1976D2, #1565C0) !important;
    transform: translateY(-1px) !important;
}

/* ============================================================================
   📱 MOBILE OPTIMIZATIONS / ОПТИМИЗАЦИЯ ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ
   =========================================================================== */

/* УВЕЛИЧИВАЕМ НИЖНУЮ ПАНЕЛЬ НАВИГАЦИИ НА ТЕЛЕФОНАХ */
@media (max-width: 480px) {
    .tabbar {
        padding: 12px 0; /* Увеличиваем padding */
        height: 80px; /* Увеличиваем высоту */
    }
    
    .tab {
        padding: 12px 4px; /* Увеличиваем padding для кнопок */
        font-size: 15px; /* Увеличиваем размер шрифта */
        gap: 5px; /* Увеличиваем расстояние между иконкой и текстом */
    }
    
    .tab br {
        display: block; /* Убеждаемся, что перенос строки работает */
    }
}

/* УВЕЛИЧИВАЕМ ИКОНКИ КЕЙСОВ НА ТЕЛЕФОНАХ */
@media (max-width: 480px) {
    .case-img {
        max-height: 160px; /* Увеличиваем максимальную высоту для телефонов */
    }
    
    .cases-grid {
        gap: 16px; /* Увеличиваем расстояние между карточками */
        padding: 16px;
    }
    
    .case-card {
        padding: 16px; /* Увеличиваем padding карточек */
        border-radius: 18px; /* Увеличиваем скругление углов */
    }
}

@media (max-width: 360px) {
    .case-img {
        max-height: 140px;
    }
    
    .cases-grid {
        gap: 14px;
        padding: 14px;
    }
}

/* УВЕЛИЧИВАЕМ ИКОНКУ КЕЙСА НА СТРАНИЦЕ ДЕТАЛЕЙ */
@media (max-width: 480px) {
    .case-details-img {
        width: 180px; /* Увеличиваем с 140px */
        height: 180px; /* Увеличиваем с 140px */
    }
}

@media (max-width: 360px) {
    .case-details-img {
        width: 160px; /* Увеличиваем с 120px */
        height: 160px; /* Увеличиваем с 120px */
    }
}

/* АДАПТИВНОСТЬ ДЛЯ БОЛЬШИХ ЭКРАНОВ */
@media (min-width: 769px) {
    .case-img {
        max-height: 180px; /* Большие иконки на планшетах и десктопах */
    }
    
    .case-details-img {
        width: 200px;
        height: 200px;
    }
}

/* СТИЛИ ДЛЯ КЛИКАБЕЛЬНОГО ЗАГОЛОВКА */
.topbar__title {
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.topbar__title:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.topbar__title:active {
    transform: scale(0.95);
}

/* УВЕЛИЧИВАЕМ ТОПБАР ДЛЯ ЛУЧШЕГО СООТНОШЕНИЯ С УВЕЛИЧЕННЫМИ КНОПКАМИ */
@media (max-width: 480px) {
    .topbar {
        height: 65px; /* Немного увеличиваем topbar */
    }
    
    .topbar__avatar {
        width: 42px; /* Увеличиваем аватар */
        height: 42px;
        font-size: 20px;
    }
    
    .topbar__pill {
        height: 42px; /* Увеличиваем блок с балансом */
        border-radius: 21px;
    }
    
    .topbar__plus {
        width: 32px;
        height: 32px;
        font-size: 20px;
    }
    
    .topbar__balance {
        height: 32px;
        padding: 0 10px;
    }
    
    .topbar__count {
        font-size: 17px; /* Увеличиваем цифры баланса */
    }
}

/* УВЕЛИЧИВАЕМ ШРИФТЫ НА КАРТОЧКАХ КЕЙСОВ */
@media (max-width: 480px) {
    .case-title {
        font-size: 16px; /* Увеличиваем с 14px */
        margin-bottom: 4px;
    }
    
    .price {
        font-size: 18px; /* Увеличиваем с 16px */
        margin-bottom: 8px;
    }
    
    .case-badge {
        font-size: 11px; /* Увеличиваем с 10px */
        padding: 5px 10px; /* Увеличиваем padding */
        border-radius: 12px; /* Увеличиваем скругление */
    }
}

/* УЛУЧШАЕМ ПРОБЕЛЫ И ВЫРАВНИВАНИЕ */
.case-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}

.case-img {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================================
   💰 ADMIN BALANCE FORM STYLES / СТИЛИ ФОРМЫ ДОБАВЛЕНИЯ БАЛАНСА
   =========================================================================== */

/* Контейнер для добавления баланса */
.add-balance-form {
    background: linear-gradient(135deg, rgba(46, 142, 255, 0.05), rgba(46, 142, 255, 0.02));
    border: 1px solid rgba(46, 142, 255, 0.2);
    border-radius: 16px;
    padding: 20px;
    margin: 0 0 20px 0;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Группа формы */
.add-balance-form .form-group {
    margin-bottom: 18px;
}

.add-balance-form .form-group:last-child {
    margin-bottom: 0;
}

.add-balance-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-weight: 500;
    font-size: 14px;
}

/* Контейнер с кнопками для ввода суммы */
.input-with-buttons {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Поле ввода суммы баланса */
.add-balance-form .balance-input {
    width: 100% !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 14px !important;
    padding: 16px !important;
    font-size: 16px !important;
    color: var(--text) !important;
    outline: none !important;
    transition: all var(--transition-fast) !important;
    font-weight: 400 !important;
}

.add-balance-form .balance-input:focus {
    border-color: var(--accent) !important;
    background: rgba(255, 255, 255, 0.08) !important;
}

.add-balance-form .balance-input::placeholder {
    color: var(--muted) !important;
}

/* Select для выбора причины */
.add-balance-form .reason-select {
    width: 100% !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 14px !important;
    padding: 16px !important;
    color: var(--text) !important;
    font-size: 16px !important;
    font-weight: 400 !important;
    cursor: pointer !important;
    transition: all var(--transition-fast) !important;
    outline: none !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 16px center !important;
    padding-right: 45px !important;
}

.add-balance-form .reason-select:hover {
    border-color: rgba(255, 255, 255, 0.15) !important;
}

.add-balance-form .reason-select:focus {
    border-color: var(--accent) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 16px center !important;
}

.add-balance-form .reason-select option {
    background: var(--bg) !important;
    color: var(--text) !important;
    padding: 8px !important;
}

/* Textarea для примечания */
.add-balance-form .balance-note {
    width: 100% !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 14px !important;
    padding: 16px !important;
    color: var(--text) !important;
    font-size: 16px !important;
    font-family: 'Inter', sans-serif !important;
    font-weight: 400 !important;
    transition: all var(--transition-fast) !important;
    outline: none !important;
    resize: vertical !important;
    min-height: 60px !important;
    max-height: 120px !important;
}

.add-balance-form .balance-note:focus {
    border-color: var(--accent) !important;
    background: rgba(255, 255, 255, 0.08) !important;
}

.add-balance-form .balance-note::placeholder {
    color: var(--muted) !important;
}

/* Кнопка добавления баланса в форме */
.add-balance-form .admin-btn {
    width: 100%;
    margin-top: 10px;
    padding: 14px 16px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.add-balance-form .admin-btn.primary {
    background: linear-gradient(135deg, var(--accent), #1e7eff);
    color: white;
    border: none;
    box-shadow: 0 4px 16px rgba(46, 142, 255, 0.3);
}

.add-balance-form .admin-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 142, 255, 0.4);
    background: linear-gradient(135deg, #4aa1ff, #3a92ff);
}

.add-balance-form .admin-btn.primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(46, 142, 255, 0.2);
}

/* Состояние disabled */
.add-balance-form .admin-btn.primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Контейнер "пользователь не выбран" */
.no-user-selected {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, rgba(100, 100, 100, 0.05), rgba(100, 100, 100, 0.02));
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    color: var(--text-secondary);
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.no-user-selected p {
    font-size: 16px;
    margin: 0;
    letter-spacing: 0.3px;
}

/* Адаптивность для мобильных */
@media (max-width: 600px) {
    .add-balance-form {
        padding: 16px;
        border-radius: 12px;
    }

    .add-balance-form .form-group {
        margin-bottom: 16px;
    }

    .add-balance-form label {
        font-size: 13px !important;
        margin-bottom: 8px !important;
    }

    .add-balance-form .balance-input,
    .add-balance-form .reason-select,
    .add-balance-form .balance-note {
        padding: 14px !important;
        font-size: 15px !important;
    }

    .add-balance-form .admin-btn {
        padding: 12px 14px;
        font-size: 15px;
    }

    .no-user-selected {
        padding: 30px 16px;
    }

    .no-user-selected p {
        font-size: 14px;
    }
}

@media (max-width: 400px) {
    .add-balance-form label {
        font-size: 12px !important;
    }

    .add-balance-form .balance-input,
    .add-balance-form .reason-select,
    .add-balance-form .balance-note {
        padding: 12px !important;
        font-size: 14px !important;
    }
}

/* ============================================================================
   💰 EARNINGS SCREEN / ЭКРАН ЗАРАБОТКА
   =========================================================================== */

.earnings-screen {
    background: var(--bg);
    position: relative;
    overflow: visible;
    width: 100%;
    display: block;
}

.earnings-wrap {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
    padding-top: 24px;
    padding-bottom: 120px;
    position: relative;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

/* iOS-specific fixes */
.earnings-wrap button {
    -webkit-appearance: none;
    -webkit-border-radius: inherit;
}

.earnings-back-btn {
    position: fixed;
    top: 8px;
    left: 8px;
    background: none;
    border: none;
    color: var(--text);
    font-size: 20px;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    -webkit-border-radius: var(--radius-md);
    transition: background var(--transition-fast);
    -webkit-transition: background var(--transition-fast);
    -webkit-appearance: none;
    -webkit-touch-callout: none;
    z-index: 10;
}

.earnings-back-btn:active {
    background: rgba(255, 255, 255, 0.1);
}

.earnings-title {
    font-size: 32px;
    font-weight: 800;
    margin: 0 0 4px 0;
    color: var(--text);
    line-height: 1.2;
}

.earnings-subtitle {
    font-size: 16px;
    color: var(--muted);
    margin: 0 0 20px 0;
    font-weight: 400;
}

.earnings-card {
    background: linear-gradient(135deg, #1b263b 0%, #162031 100%) !important;
    border: 2px solid #2e8eff !important;
    border-radius: var(--radius-lg);
    -webkit-border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    margin-top: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    -webkit-box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all var(--transition-fast);
    -webkit-transition: all var(--transition-fast);
    overflow: hidden;
    display: block;
    width: 100%;
    box-sizing: border-box;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto;
}

.earnings-card:active {
    transform: scale(0.98);
    -webkit-transform: scale(0.98);
}

.card-heading {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: var(--text);
}

.card-subtext {
    font-size: 14px;
    color: var(--muted);
    margin: 0 0 16px 0;
    font-weight: 400;
}

.invite-highlight {
    background: rgba(46, 142, 255, 0.1);
    border-left: 3px solid var(--accent);
    padding: 12px;
    border-radius: 6px;
    margin: 16px 0;
}

.highlight-text {
    font-size: 14px;
    color: var(--accent);
    margin: 0;
    font-weight: 600;
}

.btn-invite-earn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #2e8eff 0%, #1e7eff 100%);
    border: none;
    border-radius: var(--radius-lg);
    -webkit-border-radius: var(--radius-lg);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    -webkit-transition: all var(--transition-fast);
    box-shadow: 0 4px 12px rgba(46, 142, 255, 0.3);
    -webkit-box-shadow: 0 4px 12px rgba(46, 142, 255, 0.3);
    -webkit-appearance: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
}

.btn-invite-earn:active {
    transform: scale(0.95);
    -webkit-transform: scale(0.95);
    box-shadow: 0 2px 6px rgba(46, 142, 255, 0.2);
    -webkit-box-shadow: 0 2px 6px rgba(46, 142, 255, 0.2);
}

.btn-open-free {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #2e8eff 0%, #1e7eff 100%);
    border: none;
    border-radius: var(--radius-lg);
    -webkit-border-radius: var(--radius-lg);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    -webkit-transition: all var(--transition-fast);
    box-shadow: 0 4px 12px rgba(46, 142, 255, 0.3);
    -webkit-box-shadow: 0 4px 12px rgba(46, 142, 255, 0.3);
    -webkit-appearance: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
}

.btn-open-free:active {
    transform: scale(0.95);
    -webkit-transform: scale(0.95);
    box-shadow: 0 2px 6px rgba(46, 142, 255, 0.2);
    -webkit-box-shadow: 0 2px 6px rgba(46, 142, 255, 0.2);
}

.reward-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.reward-amount {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent);
    margin: 0 0 4px 0;
}

.reward-frequency {
    font-size: 13px;
    color: var(--muted);
    margin: 0;
    font-weight: 400;
}

.earnings-card-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--text);
}

.earnings-card-description {
    font-size: 14px;
    color: var(--muted);
    margin: 0 0 16px 0;
    font-weight: 400;
}

.referrals-section {
    position: relative;
}

.referrals-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.referrals-count {
    background: rgba(46, 142, 255, 0.15);
    color: var(--accent);
    padding: 4px 12px;
    border-radius: 12px;
    -webkit-border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    white-space: nowrap;
}

.referrals-list-earnings {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.referrals-list-earnings .referral-item {
    background: rgba(46, 142, 255, 0.05);
    padding: 12px 0;
    border-bottom: 1px solid rgba(46, 142, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.referrals-list-earnings .referral-item:last-child {
    border-bottom: none;
}

.referral-avatar {
    flex-shrink: 0;
}

.avatar-placeholder {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 50%;
    -webkit-border-radius: 50%;
    background: linear-gradient(135deg, #2e8eff, #1e7eff);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.referral-info {
    flex: 1;
}

.referral-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.referral-username {
    font-size: 12px;
    color: var(--muted);
    margin: 2px 0 0 0;
}

.referral-stats {
    font-size: 11px;
    color: var(--muted);
    margin: 4px 0 0 0;
}

.referral-date {
    color: var(--muted);
}

.referral-divider {
    margin: 0 6px;
}

.referral-cases {
    color: var(--muted);
}

.empty-referrals {
    text-align: center;
    padding: 24px 16px;
    color: var(--muted);
}

.empty-referrals p {
    font-size: 13px;
    margin: 4px 0;
}

.empty-referrals p:first-child {
    margin-top: 0;
}

.btn-show-all {
    width: 100%;
    padding: 12px;
    background: rgba(46, 142, 255, 0.1);
    border: 1px solid rgba(46, 142, 255, 0.2);
    border-radius: var(--radius-md);
    -webkit-border-radius: var(--radius-md);
    color: var(--accent);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    -webkit-transition: all var(--transition-fast);
    margin-top: 12px;
    -webkit-appearance: none;
    -webkit-touch-callout: none;
}

.btn-show-all:active {
    background: rgba(46, 142, 255, 0.15);
}

.full-referrals-list {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(46, 142, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 0;
}

.full-referrals-content {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.full-referrals-list .referral-item {
    background: rgba(46, 142, 255, 0.05);
    padding: 12px 0;
    border-bottom: 1px solid rgba(46, 142, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-show-less {
    width: 100%;
    padding: 12px;
    background: rgba(46, 142, 255, 0.1);
    border: 1px solid rgba(46, 142, 255, 0.2);
    border-radius: var(--radius-md);
    -webkit-border-radius: var(--radius-md);
    color: var(--accent);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    -webkit-transition: all var(--transition-fast);
    margin-bottom: 12px;
    -webkit-appearance: none;
    -webkit-touch-callout: none;
}

.btn-show-less:active {
    background: rgba(46, 142, 255, 0.15);
}