/* CSS темы */
:root {
    --bg-primary: #000000;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #333;
    --bg-quaternary: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #666;
    --text-tertiary: #999;
    --text-accent: #8b5cf6;
    --star-color: #666;
    --border-color: #333;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --modal-overlay: rgba(0, 0, 0, 0.8);
    --button-hover: #7c3aed;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
}

/* Прелоадер */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.preloader-content {
    text-align: center;
    color: var(--text-primary);
}

.preloader-gif {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    margin-bottom: 16px;
}

.preloader-text {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
}

/* Стили для подарков на выводе */
.withdrawal-pending {
    opacity: 0.7;
    border: 2px solid #f59e0b !important;
    background: rgba(245, 158, 11, 0.1) !important;
}

.withdrawal-status {
    font-size: 12px;
    color: #f59e0b;
    font-weight: 600;
    text-align: center;
    margin: 4px 0;
    padding: 2px 6px;
    background: rgba(245, 158, 11, 0.2);
    border-radius: 4px;
}


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



/* Фиксированный размер экрана */
html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: fixed;
}

body {
    max-width: 100vw;
    max-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    /* Улучшения для Android */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    /* Убираем bounce эффект на iOS */
    -webkit-overflow-scrolling: touch;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Header Styles - Removed */

/* Main Content */
.main-content {
    padding: 20px;
    padding-top: 20px;
    padding-bottom: 100px;
    max-width: 480px;
    margin: 0 auto;
}

.page {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
    visibility: hidden;
    position: absolute;
    top: -9999px;
    left: -9999px;
    z-index: -1;
}

.page.active {
    display: block;
    visibility: visible;
    position: relative;
    top: auto;
    left: auto;
    z-index: auto;
}

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

/* Profile Section - только на странице Играть */
.play-page .profile-section {
    background-color: var(--bg-secondary);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
}

.play-page .profile-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.play-page .avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    background-color: var(--bg-tertiary);
    flex-shrink: 0;
}

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

.play-page .user-details {
    flex: 1;
    min-width: 0;
}

.play-page .username {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.play-page .level-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.play-page .level {
    font-size: 14px;
    color: #666;
    white-space: nowrap;
}

.play-page .level-bar {
    width: 100px;
    height: 4px;
    background-color: #333;
    border-radius: 2px;
    overflow: hidden;
    flex-shrink: 0;
}

.play-page .level-progress {
    width: 20%;
    height: 100%;
    background-color: #8b5cf6;
    border-radius: 2px;
}

.play-page .balance {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    position: relative;
    top: 10px;
}

.play-page .balance-amount {
    font-size: 24px;
    font-weight: 700;
}

.diamond-icon {
    font-size: 20px;
    display: flex;
    align-items: center;
}

.diamond-icon svg {
    width: 19px;
    height: 20px;
    fill: currentColor;
}

.diamond-icon.yellow svg {
    fill: #FFD700;
}

/* Betting Section */
.betting-section {
    display: flex;
    gap: 1px;
    margin-bottom: 20px;
    background-color: var(--bg-secondary);
    padding: 2px;
    border-radius: 17px;
}

.bet-btn {
    flex: 1;
    background-color: transparent;
    border: none;
    color: var(--text-primary);
    padding: 6px 10px;
    border-radius: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    height: 32px;
    margin: 1px;
    transition: background-color 0.3s ease;
}

.bet-btn:hover {
    background-color: transparent;
}

.bet-btn.active {
    background-color: var(--bg-primary);
    border-radius: 15px;
}

.bet-amount {
    font-size: 25px;
    font-weight: 600;
    white-space: nowrap;
    
}

/* Game Area */
.game-area {
    background-color: #1a1a1a;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
    overflow: visible;
    height: 220px;
}

.emoji-container {
    display: flex;
    gap: 5px;
    padding: 0;
    height: 100%;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* Быстрая анимация при кручении - применяется к emoji-track */
.emoji-track.spinning {
    animation: scrollRight 0.05s linear infinite;
}

.emoji-track.spinning-slow {
    animation: scrollRight 0.1s linear infinite;
}

.emoji-track.spinning-very-slow {
    animation: scrollRight 0.3s linear infinite;
}

/* Анимация прокрутки */
@keyframes scrollRight {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-33.33%);
    }
}

/* Анимация прокрутки СПРАВА НАЛЕВО (всегда влево!) */
@keyframes scrollLeft {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-33.33%);
    }
}

.winning-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to bottom, transparent, var(--text-accent), transparent);
    transform: translateX(-50%);
    z-index: 10;
    pointer-events: none;
}

.emoji-item {
    min-width: 112px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-primary);
    border-radius: 8px;
    flex-shrink: 0;
    padding: 15px 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.emoji {
    font-size: 80px;
    margin-bottom: 10px;
    line-height: 1;
    display: block;
    text-align: center;
}

.emoji-price {
    background-color: rgba(49, 128, 255, 0.199);
    color: #3b83f6;
    padding: 5px 10px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 3px;
}

.emoji-price span {
    color: #3b83f6;
}

.winning-line {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 180px;
    background-color: #8b5cf6;
    border-radius: 2px;
    z-index: 10;
}

@keyframes scrollRight {
    0% { transform: translateX(0); }
    100% { transform: translateX(-20%); }
}

/* Анимация прокрутки СПРАВА НАЛЕВО (всегда влево!) */
@keyframes scrollLeft {
    0% { transform: translateX(0); }
    100% { transform: translateX(-20%); }
}

.emoji-track.spinning {
    animation: spinFast 4.5s ease-out forwards;
    will-change: transform;
}

@keyframes spinFast {
    0% { transform: translateX(0); }
    5% { transform: translateX(-10%); }
    10% { transform: translateX(-20%); }
    15% { transform: translateX(-30%); }
    20% { transform: translateX(-40%); }
    25% { transform: translateX(-50%); }
    30% { transform: translateX(-60%); }
    35% { transform: translateX(-70%); }
    40% { transform: translateX(-80%); }
    45% { transform: translateX(-85%); }
    50% { transform: translateX(-90%); }
    55% { transform: translateX(-92%); }
    60% { transform: translateX(-93%); }
    65% { transform: translateX(-93.5%); }
    70% { transform: translateX(-93.7%); }
    75% { transform: translateX(-93.8%); }
    80% { transform: translateX(-93.9%); }
    85% { transform: translateX(-93.95%); }
    90% { transform: translateX(-93.97%); }
    95% { transform: translateX(-93.98%); }
    100% { transform: translateX(-94%); }
}

/* Spin Section */
.spin-section {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.spin-btn {
    flex: 1;
    background-color: var(--text-accent);
    border: none;
    color: white;
    padding: 18px 20px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 0;
    transition: background-color 0.3s ease;
}

.spin-btn:hover {
    background-color: var(--button-hover);
}

.spin-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}





.demo-container {
    background: var(--bg-secondary);
    border-radius: 15px;
    padding: 5px 16px;
    margin-top: 0;
    margin-bottom: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.demo-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.demo-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-tertiary);
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--text-accent);
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}



/* Winning Chances */
.winning-chances {
    margin-bottom: 20px;
}

.winning-chances h3 {
    font-size: 18px;
    margin-bottom: 15px;
    text-align: center;
}

.chances-container {
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    padding: 10px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.chances-container::-webkit-scrollbar {
    display: none;
}

.chances-grid {
    display: inline-flex;
    gap: 10px;
    padding: 0 5px;
}

.chance-item {
    background-color: var(--bg-secondary);
    border-radius: 8px;
    padding: 15px 10px;
    text-align: center;
    position: relative;
    min-width: 112px;
    flex-shrink: 0;
}

.chance-item.exclusive {
    border: 1px solid #3b82f6;
}

.chance-item.crystals {
    border: 1px solid #10b981;
}

.chance-emoji {
    font-size: 34px;
    margin-bottom: 8px;
}

.chance-percent {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
}

.chance-reward {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background-color: rgba(49, 128, 255, 0.199);
    border-radius: 50px;
    padding: 5px 10px;
}

.chance-reward span {
    color: #3b83f6;
}

.reward-amount {
    font-size: 14px;
    font-weight: 600;
    color: #3b83f6;
}



.exclusive-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: #3b83f6;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    text-transform: uppercase;
}

/* Navigation */
.navigation {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #000000;
    display: flex;
    padding: 10px 0;
    z-index: 1000;
    max-width: 480px;
    margin: 0 auto;
}

.nav-btn {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 8px 5px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    min-width: 0;
    transition: color 0.3s ease;
}

.nav-btn:hover {
    color: var(--text-secondary);
}

.nav-btn.active {
    color: var(--text-accent);
}

.nav-icon {
    font-size: 20px;
}

.nav-text {
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    padding: 15px;
    background-color: var(--bg-secondary);
    border-radius: 12px;
}

.theme-btn {
    background: none;
    border: none;
    color: var(--text-accent);
    font-size: 24px;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.theme-btn:hover {
    background-color: var(--bg-tertiary);
}

.theme-label {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 500;
}

/* Page Content Styles */
.page-content {
    padding:10px 0;
}

.page-content h2 {
    font-size: 24px;
    margin-bottom: 15px;
    text-align: center;
}

/* Leaders Page */
.leaders-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.leader-item {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.leader-rank {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-accent);
    min-width: 40px;
}

.leader-avatar {
    font-size: 32px;
    flex-shrink: 0;
    color: var(--text-primary);
}

.leader-name {
    flex: 1;
    font-size: 18px;
    font-weight: 600;
    min-width: 0;
    color: var(--text-primary);
}

.leader-score {
    font-size: 16px;
    color: var(--text-accent);
    font-weight: 600;
    flex-shrink: 0;
}

/* Giveaways Page */
.giveaway-item {
    background-color: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.giveaway-prize {
    font-size: 48px;
    margin-bottom: 15px;
}

.giveaway-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
}

.giveaway-description {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.giveaway-btn {
    background-color: var(--text-accent);
    border: none;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.giveaway-btn:hover {
    background-color: var(--button-hover);
}

/* Tasks Page */
.task-item {
    background-color: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.task-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.task-title {
    flex: 1;
    font-size: 18px;
    font-weight: 600;
    min-width: 0;
    color: var(--text-primary);
}

.task-reward {
    color: var(--text-accent);
    font-weight: 600;
    margin-right: 15px;
    flex-shrink: 0;
}

.task-btn {
    background-color: #8b5cf6;
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
}

.task-btn:hover {
    background-color: #9333ea;
}

/* Profile Page */
.profile-header {
    text-align: center;
    margin-bottom: 30px;
}

.profile-avatar {
    font-size: 64px;
    margin-bottom: 15px;
}

.profile-name {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.profile-level {
    color: #666;
    font-size: 16px;
}

.profile-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.stat-item {
    /* background-color: var(--bg-secondary); */
    /* border-radius: 12px; */
    padding: 5px;
    text-align: center;
}

.stat-label {
    color: #666;
    margin-bottom: 8px;
    font-size: 14px;
}

.stat-value {
    font-size: 20px;
    font-weight: 600;
    color: #8b5cf6;
}

/* Winning Modal */
.winning-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.3); /* Прозрачный фон */
    backdrop-filter: blur(5px); /* Легкое размытие */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: none;
}

.winning-modal.active {
    opacity: 1 !important;
    visibility: visible !important;
    display:flex;
}

/* Новые стили для winning-modal */
.winning-modal {
    background-color: rgb(0 0 0 / 83%);
}

.modal-content {
    background: none !important;
}

/* Стили для кнопки закрытия - СКРЫТА */
.winning-modal .close-btn {
    display: none !important; /* Скрываем кнопку закрытия */
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
    z-index: 1000;
}

.winning-modal .close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Исходные стили modal-content */
.modal-content {
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    transform: scale(1) !important;
    transition: transform 0.3s ease;
}

.winning-modal.active .modal-content {
    transform: scale(1);
}

.win-amount {
    font-size: 24px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: var(--text-primary);
}

.modal-close-btn {
    background: var(--text-accent);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.modal-close-btn:hover {
    background: var(--button-hover);
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    text-align: center;
    animation: modalSlideIn 0.3s ease-out;
    background: none;
    border: none;
    padding: 0;
}

@keyframes modalSlideIn {
    from { transform: scale(0.8) translateY(50px); }
    to { transform: scale(1) translateY(0); }
}

.congratulations {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.winning-emoji {
    font-size: 90px;
    margin-bottom: 25px;
    animation: emojiBounce 0.6s ease-out;
}

@keyframes emojiBounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-20px); }
    60% { transform: translateY(-10px); }
}

.modal-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.modal-btn {
    flex: 1;
    background-color: var(--bg-tertiary);
    border: none;
    color: var(--text-primary);
    padding: 17px 25px;
    border-radius: 13px;
    cursor: pointer;
    transition: background-color 0.3s;
    min-width: 120px;
}

.modal-btn:hover {
    background-color: var(--bg-quaternary);
}

.sell-btn {
    width: 100%;
    background-color: var(--text-accent);
    border: none;
    color: white;
    padding: 8px 30px;
    border-radius: 15px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 300px;
    text-align: center;
    align-items: center;
    justify-content: center;
}

.sell-btn:hover {
    background-color: var(--button-hover);
}

.sell-text {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
    justify-content: center;
}

.sell-subtext {
    font-size: 16px;
    opacity: 0.8;
    font-weight: 500;
}

/* Enhanced Responsive Design */
@media (max-width: 480px) {
    .main-content {
        padding: 15px;
        padding-bottom: 100px;
    }
    
    /* Header removed */
    
    .play-page .profile-section {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .play-page .profile-info {
        gap: 12px;
    }
    
    .play-page .avatar {
        width: 45px;
        height: 45px;
    }
    
    .play-page .username {
        font-size: 16px;
    }
    
    .play-page .balance-amount {
        font-size: 20px;
    }
    
    .betting-section {
        margin-bottom: 15px;
    }
    
    .bet-btn {
        padding: 10px 6px;
        height: 50px;
        border-radius: 15px;
    }
    
    .bet-amount {
        font-size: 24px;
    }
    
    .game-area {
        padding: 15px;
        margin-bottom: 15px;
        height: 200px;
    }
    
    .emoji-item {
        font-size: 50px;
        min-width: 140px;
        height: 170px;
    }
    
    .spin-section {
        gap: 15px;
        margin-bottom: 15px;
    }
    
    .spin-btn {
        padding: 15px 18px;
        font-size: 16px;
    }
    
    .chances-grid {
        gap: 8px;
    }
    
    .chance-item {
        padding: 12px 8px;
        min-width: 90px;
    }
    
    .chance-emoji {
        font-size: 30px;
    }
    
    .chance-percent {
        font-size: 11px;
    }
    
    .reward-amount {
        font-size: 12px;
    }
    
    .navigation {
        padding: 8px 0;
    }
    
    .nav-icon {
        font-size: 18px;
    }
    
    .nav-text {
        font-size: 11px;
    }
}

@media (max-width: 360px) {
    .main-content {
        padding: 12px;
    }
    
    /* Header removed */
    
    .profile-section {
        padding: 12px;
    }
    
    .profile-info {
        gap: 10px;
    }
    
    .avatar {
        width: 40px;
        height: 40px;
    }
    
    .username {
        font-size: 15px;
    }
    
    .level-bar {
        width: 80px;
    }
    
    .betting-section {
        gap: 10px;
    }
    
    .bet-btn {
        padding: 8px 4px;
        height: 35px;
        border-radius: 15px;
    }
    
    .bet-amount {
        font-size: 28px;
        
    }
    
    .game-area {
        padding: 12px;
        height: 160px;
    }
    
    .emoji-item {
        font-size: 45px;
        min-width: 65px;
        height: 65px;
    }
    
    .spin-btn {
        padding: 12px 15px;
        font-size: 15px;
    }
    
    .chances-grid {
        gap: 6px;
    }
    
    .chance-item {
        padding: 10px 6px;
        min-width: 60px;
    }
    
    .chance-emoji {
        font-size: 38px;
    }
    
    .chance-percent {
        font-size: 10px;
    }
    
    .reward-amount {
        font-size: 11px;
    }
    
    .modal-content {
        padding: 25px 20px;
        max-width: 280px;
    }
    
    .congratulations {
        font-size: 24px;
    }
    
    .winning-emoji {
        font-size: 70px;
    }
    
    .modal-buttons {
        gap: 12px;
    }
    
    .modal-btn {
        padding: 10px 16px;
        font-size: 24px;
    }
    
    .sell-btn {
        padding: 12px 26px;
    }
    
    .sell-text {
        font-size: 16px;
    }
    
    .sell-subtext {
        font-size: 12px;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .main-content {
        max-width: 100%;
        padding: 25px;
    }
    
    .navigation {
        max-width: 100%;
    }
    
    .chances-grid {
        gap: 12px;
    }
    
    .chance-item {
        padding: 18px 12px;
        min-width: 90px;
    }
    
    .chance-emoji {
        font-size: 38px;
    }
    
    .chance-percent {
        font-size: 13px;
    }
    
    .reward-amount {
        font-size: 15px;
    }
}

@media (min-width: 769px) {
    .main-content {
        max-width: 480px;
        padding: 30px;
    }
    
    .navigation {
        max-width: 480px;
    }
    
    .chances-grid {
        gap: 15px;
    }
    
    .chance-item {
        padding: 20px 15px;
        min-width: 100px;
    }
    
    .chance-emoji {
        font-size: 32px;
    }
    
    .chance-percent {
        font-size: 14px;
    }
    
    .reward-amount {
        font-size: 16px;
    }
}

/* Landscape orientation support */
@media (max-height: 500px) and (orientation: landscape) {
    /* Header removed */
    
    .main-content {
        padding: 15px 20px;
        padding-bottom: 80px;
    }
    
    .play-page .profile-section {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .play-page .profile-info {
        gap: 12px;
    }
    
    .play-page .avatar {
        width: 40px;
        height: 40px;
    }
    
    .play-page .username {
        font-size: 16px;
    }
    
    .play-page .balance-amount {
        font-size: 20px;
    }
    
    .betting-section {
        margin-bottom: 15px;
    }
    
    .game-area {
        padding: 15px;
        margin-bottom: 15px;
        height: 150px;
    }
    
    .emoji-item {
        font-size: 35px;
        min-width: 55px;
        height: 55px;
    }
    
    .spin-section {
        margin-bottom: 15px;
    }
    
    .winning-chances {
        margin-bottom: 15px;
    }
    
    .chances-grid {
        gap: 8px;
    }
    
    .chance-item {
        padding: 12px 8px;
        min-width: 70px;
    }
    
    .navigation {
        padding: 6px 0;
    }
    
    .nav-icon {
        font-size: 16px;
    }
    
    .nav-text {
        font-size: 10px;
    }
}



/* Active states */
.nav-btn.active .nav-icon,
.nav-btn.active .nav-text {
    color: #8b5cf6;
}





/* High DPI display support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .winning-line {
        width: 2px;
    }
    
    .level-bar {
        height: 2px;
    }
    
    .level-progress {
        height: 2px;
    }
}

/* System theme support */


/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .emoji-container {
        animation: none;
    }
    
    .emoji-track.spinning {
        animation: none;
    }
}

/* Bottom Modal Styles */
.bottom-modal {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-primary);
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 1000;
    max-height: 80vh;
    overflow-y: auto;
}

.bottom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--modal-overlay);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
    z-index: 999;
}

.bottom-modal-overlay.show,
.bottom-modal-overlay.active,
#modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.bottom-modal.show {
    transform: translateY(0);
}

.bottom-modal-content {
    padding: 20px;
}

.bottom-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.bottom-modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 44px;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #cccccc;
}

.payment-methods {
    display: flex;
    gap: 1px;
    margin-bottom: 20px;
    background-color: var(--bg-tertiary);
    padding: 2px;
    border-radius: 17px;
}

.payment-method-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 12px 16px;
    border-radius: 15px;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 18px;
}

.payment-method-btn.active {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

.payment-method-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    color: var(--text-secondary);
}

.payment-method-btn:disabled:hover {
    background: none;
    transform: none;
}

.bonus-badge {
    background-color: #10b981;
    color: white;
    padding: 2px 6px;
    border-radius: 50px;
    font-size: 10px;
    font-weight: 600;
}

.payment-input-section {
    margin-bottom: 20px;
}

.input-label {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 10px;
}

.input-container {
    display: flex;
    align-items: center;
    background-color: var(--bg-primary);
    border: 1px solid var(--bg-tertiary);
    border-radius: 15px;
    padding: 12px 16px;
    gap: 12px;
}

.input-icon {
    color: var(--star-color);
    font-size: 18px;
    display: flex;
    align-items: center;
}

.input-icon svg {
    width: 18px;
    height: 18px;
}

.payment-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
}

.payment-input::placeholder {
    color: var(--text-secondary);
}

.max-btn {
    background-color: var(--text-accent);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.bonus-text {
    color: var(--text-secondary);
    font-size: 12px;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.bonus-star {
    color: var(--star-color);
}

.bonus-star svg {
    width: 12px;
    height: 12px;
}

.bottom-modal-footer {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.back-btn, .top-up-btn {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: 15px;
    font-weight: 600;
    cursor: pointer;
    font-size: 16px;
}

.back-btn {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.top-up-btn {
    background-color: var(--text-accent);
    color: white;
}

.hidden {
    display: none;
}

/* Additional light theme adjustments */
@media (prefers-color-scheme: light) {
    .emoji-price {
        background-color: rgba(59, 130, 246, 0.2);
        color: #3b83f6;
    }
    
    .chance-reward {
        background-color: rgba(59, 130, 246, 0.2);
    }
    
    .chance-reward span {
        color: #3b83f6;
    }
    
    .reward-amount {
        color: #3b83f6;
    }
    
    .exclusive-badge {
        background-color: #3b83f6;
    }
    
    .bet-btn {
        color: #666;
    }
    
    .bet-btn.active {
        color: #ffffff;
    }
    
    .bottom-modal {
        background-color: #ffffff;
        color: #000000;
    }
    
    .bottom-modal-header h3 {
        color: #000000;
    }
    
    .input-container {
        background-color: #f5f5f5;
        border-color: #e0e0e0;
    }
    
    .payment-input {
        color: #000000;
    }
    
    .back-btn {
        background-color: #e0e0e0;
        color: #000000;
    }
}

/* Стили для страницы лидеров */
.trophy-section {
    text-align: center;
    padding: 20px 0;
}

.trophy-emoji {
    font-size: 64px;
    margin-bottom: 16px;
    animation: trophyAnimation 3s ease-in-out infinite;
    position: relative;
}

@keyframes trophyAnimation {
    0% {
        transform: rotate(0deg) scale(1);
    }
    25% {
        transform: rotate(15deg) scale(1.1);
    }
    50% {
        transform: rotate(-10deg) scale(1.2);
    }
    75% {
        transform: rotate(5deg) scale(1.1);
    }
    85% {
        transform: rotate(0deg) scale(1.05);
    }
    100% {
        transform: rotate(0deg) scale(1);
    }
}

.trophy-emoji::after {
    content: '';
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 24px;
    opacity: 0;
}

.leaders-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.last-updated {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.refresh-icon {
    font-size: 12px;
    cursor: pointer;
}

.leaders-tabs {
    display: flex;
    gap: 1px;
    margin: 15px 0;
    background-color: var(--bg-secondary);
    padding: 1px;
    border-radius: 15px;
    height:45px;
    width: 100%;
    /* margin-left: 10px;
    margin-right: 10px; */
}

.leader-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px 2px;
    border-radius: 15px;
    color: #ffffff;
    font-size:20px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 0;
    margin: 1px;
}

.leader-tab-btn.active {
    background-color: #000000;
    border-radius: 15px;
}

/* Контент для вкладки Баланс */
.balance-content {
    margin-bottom: 20px;
}

.leader-item {
    background: none;
    border-radius: 15px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.leader-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.leader-flag {
    font-size: 20px;
    flex-shrink: 0;
}

.leader-info {
    flex: 1;
}

.leader-name {
    font-size: 16px;
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 5px;
}

.leader-score {
    font-size: 14px;
    color: #666;
}

.leader-medal {
    font-size: 24px;
    flex-shrink: 0;
}



.leaders-list {
    padding: 0 20px;
    margin-bottom: 20px;
    max-height: 100%;
    overflow-y: auto;
    background: none;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.leaders-list::-webkit-scrollbar {
    display: none;
}

.leader-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    background: none;
}

.leader-item:last-child {
    border-bottom: none;
}

.leader-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.leader-flag {
    font-size: 20px;
    margin-right: 8px;
}

.leader-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.leader-nickname {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.leader-score {
    font-size: 14px;
    color: var(--text-secondary);
}

.leader-rank {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-left: auto;
}

.medal-1 {
    color: #FFD700;
    font-size: 24px;
}

.medal-2 {
    color: #C0C0C0;
    font-size: 24px;
}

.medal-3 {
    color: #CD7F32;
    font-size: 24px;
}

.my-position {

    background-color: rgba(0, 0, 0, 0.9);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 100;
}

.my-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

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

.my-flag {
    font-size: 18px;
}

.my-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.my-nickname {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.my-score {
    font-size: 12px;
    color: var(--text-secondary);
}

.my-rank {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-left: auto;
}

/* Адаптивность для лидеров */
@media (max-width: 480px) {
    .trophy-emoji {
        font-size: 48px;
    }
    
    .leaders-title {
        font-size: 20px;
    }
    
    /* .leaders-tabs {
        padding: 0 16px;
    } */
    
    .leader-tab-btn {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .leaders-list {
        padding: 0 16px;
    }
    
    .leader-item {
        padding: 10px 0;
        gap: 10px;
    }
    
    .leader-avatar {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .leader-nickname {
        font-size: 14px;
    }
    
    .leader-score {
        font-size: 12px;
    }
    
    .my-position {
        padding: 12px 16px;
        bottom: 70px;
    }
    
    .my-avatar {
        width: 32px;
        height: 32px;
    }
    
    .my-nickname {
        font-size: 13px;
    }
    
    .my-score {
        font-size: 11px;
    }
}

/* Стили для страницы задач */
.tasks-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    padding: 0 20px;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.empty-tasks {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-tasks-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-tasks-text {
    font-size: 16px;
    font-weight: 500;
}

/* 🎨 ПОЛНОШИРИННЫЕ УВЕДОМЛЕНИЯ СВЕРХУ */
.notification {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    padding: 20px;
    z-index: 10000;
    transform: translateY(-100%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

.notification.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.notification.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.notification.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.notification.info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.notification-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    max-width: 1200px;
    margin: 0 auto;
}

.notification-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.notification-text {
    flex: 1;
    margin: 0;
    word-wrap: break-word;
}

.notification-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 18px;
    color: inherit;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    font-weight: bold;
}

.notification-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.notification-close:active {
    transform: scale(0.95);
}

/* Анимация появления сверху */
@keyframes notificationSlideDown {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Анимация исчезновения вверх */
@keyframes notificationSlideUp {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(-100%);
        opacity: 0;
    }
}

.notification.show {
    animation: notificationSlideDown 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.notification.hide {
    animation: notificationSlideUp 0.3s ease-in;
}

.tasks-filters::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

.task-filter-btn {
    padding: 12px 20px;
    background-color: var(--bg-secondary);
    border: none;
    border-radius: 30px;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.task-filter-btn.active {
    background-color: var(--text-accent);
    color: white;
}

.task-filter-btn .diamond-icon {
    font-size: 12px;
}

.tasks-list {
    padding: 0 20px;
    margin-bottom: 50px;
}

/* Отступы между блоками задач */
.task-card {
    margin-bottom: 20px;
}

.task-card:last-child {
    margin-bottom: 0;
}

.daily-tasks-section {
    padding: 0 20px;
}

.daily-tasks-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 20px 0;
}

.daily-tasks-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.task-card {
    background-color: var(--bg-secondary);
    border-radius: 15px;
    overflow: hidden;
}

.task-header {
    background-color: #303030;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.task-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.task-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.task-action-btn {
    background-color: var(--text-accent);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.task-action-btn:hover:not(:disabled) {
    background-color: var(--text-accent-dark);
    transform: translateY(-1px);
}

.task-action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.task-action-btn.completed {
    background-color: var(--success-color);
}

.task-action-btn.claim {
    background-color: #1b9b40;
}

.task-action-btn.claim:hover:not(:disabled) {
    background-color: #158a3a;
    transform: translateY(-1px);
}

.task-action-btn.inactive {
    background-color: var(--text-muted);
}

.task-body {
    background-color: var(--bg-secondary);
    padding: 16px 20px;
}

.task-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 12px;
}

.task-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.task-reward {
    background-color: #4A4A4A;
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.task-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background-color: #4A4A4A;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: var(--text-accent);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Стили для кнопок быстрого выбора */
.quick-select-buttons {
    display: flex;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 5px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.quick-select-buttons::-webkit-scrollbar {
    display: none;
}

.quick-select-btn {
    background-color: var(--bg-secondary);
    border: none;
    border-radius: 15px;
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.quick-select-btn:hover {
    background-color: var(--text-accent);
    color: white;
}

.quick-select-btn.active {
    background-color: var(--accent-color, #4a9eff);
    color: white;
    border-color: var(--accent-color, #4a9eff);
}

.quick-select-btn.active:hover {
    background-color: var(--accent-color, #4a9eff);
    transform: scale(1.05);
}

.quick-select-btn .diamond-icon.yellow svg {
    fill: #FFD700;
}

.quick-select-btn .diamond-icon.yellow {
    color: #FFD700;
}

/* Адаптивность для задач */
@media (max-width: 480px) {
    .tasks-filters {
        padding: 0 16px;
        gap: 6px;
    }
    
    .task-filter-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .tasks-list {
        padding: 0 16px;
    }
    
    .daily-tasks-section {
        padding: 0 16px;
    }
    
    .daily-tasks-title {
        font-size: 18px;
    }
    
    .task-header {
        padding: 14px 16px;
    }
    
    .task-icon {
        font-size: 20px;
    }
    
    .task-title {
        font-size: 14px;
    }
    
    .task-action-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .task-body {
        padding: 14px 16px;
    }
    
    .task-description {
        font-size: 13px;
    }
    
    .task-reward {
        padding: 5px 10px;
        font-size: 12px;
    }
    
    .progress-text {
        font-size: 11px;
    }
}

/* Адаптивность для кнопок быстрого выбора */
@media (max-width: 480px) {
    .quick-select-buttons {
        gap: 6px;
        margin-top: 16px;
        flex-wrap: nowrap;
        overflow-x: auto;
    }
    
    .quick-select-btn {
        padding: 8px 12px;
        font-size: 20px;
        flex-shrink: 0;
    }
}

/* Стили для страницы профиля */
.profile-page {
    padding:10px;
    background: var(--bg-primary);
    min-height: 100vh;
    display: none;
    position: relative;
    z-index: 1;
}

.profile-page.active {
    display: block;
}

.profile-page .page-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Верхняя секция профиля - только на странице профиля */
.profile-page .profile-top-section {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.profile-page .profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

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

.profile-page .profile-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 1px 0;
    line-height: 1;
    height: auto;
    min-height: auto;
}

.profile-page .profile-balance-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-page .profile-username {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.profile-page .profile-balance {
    display: flex;
    align-items: center;
    gap: 1px;
    background: var(--bg-secondary);
    padding: 3px 1px 3px 7px;
    border-radius: 8px;
    width: fit-content;
    margin-right: 10px;
}

.profile-page .profile-language {
    display: flex;
    gap: 1px;
    background: var(--bg-secondary);
    padding: 3px;
    border-radius: 8px;
    width: fit-content;
}

.profile-page .lang-btn {
    background: transparent;
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.profile-page .lang-btn.active {
    background: var(--text-accent);
    color: white;
}

.profile-page .balance-amount {
    font-size: 16px;
    font-weight: bold;
    color: var(--text-primary);
}

.profile-page .profile-add-btn {
    background: var(--text-accent);
    border: none;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 8px;
}

.profile-page .profile-add-btn:hover {
    background: var(--button-hover);
    transform: scale(1.05);
}

.profile-page .add-balance-btn {
    width: 32px;
    height: 32px;
    background: var(--accent-color);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}



/* Шкала уровня - только на странице профиля */
.profile-page .level-bar-container {
    margin-bottom: 20px;
}

.profile-page .level-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.profile-page .level-progress {
    height: 100%;
    background: var(--text-accent);
    border-radius: 4px;
    width: 5%;
    transition: width 0.3s ease;
}

.profile-page .level-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-primary);
    padding: 1px 0;
    line-height: 1;
}

/* Блок приглашения друзей - только на странице профиля */
.profile-page .invite-friends-block {
    background: var(--bg-secondary);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
    width: 100%;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.profile-page .invite-friends-title {
    font-size: 20px;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.profile-page .invite-friends-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.4;
}

.profile-page .invite-btn {
    background: var(--text-accent);
    border: none;
    border-radius: 15px;
    padding: 15px 30px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 400px;
    text-align: center;
    margin: 0 auto;
    display: block;
}

.profile-page .invite-btn:hover {
    background: var(--button-hover);
    transform: translateY(-2px);
}

/* Стили для блока промокода */
.profile-page .promo-block {
    font-size: 20px;
    font-weight: bold;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
    width: 100%;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.profile-page .promo-input {
    display: block;
    margin: 0 auto;
    width: 100%;
    margin-bottom: 15px;
    padding: 12px;
    background: #8b5cf6;
    border-radius: 10px;
    border: none !important;
    color: white;
    font-weight: 600;
    text-align: center;
    font-size: 18px;
}

.profile-page .promo-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.profile-page .promo-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.3);
}

.profile-page .promo-btn {
    background: var(--text-accent);
    border: none;
    border-radius: 15px;
    padding: 15px 30px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 400px;
    text-align: center;
    margin: 0 auto;
    display: block;
}

.profile-page .promo-btn:hover {
    background: var(--button-hover);
    transform: translateY(-2px);
}

.profile-page .promo-flex {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

/* Табы профиля - только на странице профиля */
.profile-page .profile-tabs {
    display: flex;
    gap: 1px;
    margin-bottom: 20px;
    background-color: var(--bg-secondary);
    padding: 2px;
    border-radius: 17px;
    width: 100%;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.profile-page .profile-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px 16px;
    border-radius: 15px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 0;
    margin: 1px;
}

.profile-page .profile-tab-btn.active {
    background-color: var(--bg-primary);
    border-radius: 15px;
}

/* Контент подарков - только на странице профиля */
.profile-page .gifts-content {
    display: block;
}

.profile-page .gifts-content.hidden {
    display: none;
}

.profile-page .friends-content.show {
    display: block;
}

.profile-page .gift-item {
    background: var(--bg-secondary);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    width: 43%;
    margin: 0;
    margin-left: 0;
    align-items: start;
}

.profile-page .gift-emoji {
    font-size: 48px;
    margin-bottom: 15px;
}

.profile-page .gift-reward {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-weight: bold;
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.2);
    padding: 8px 16px;
    border-radius:15px;
    width: fit-content;
    margin: 0 auto;
}

/* Контент друзей - только на странице профиля */
.profile-page .friends-content {
    display: block;
}

.profile-page .friends-content.hidden {
    display: none;
}

/* Статистика рефералов */
.profile-page .referral-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 10px;
    height: 40px;
    align-items: center;
}

.profile-page .stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.profile-page .stat-top {
    display: flex;
    align-items: center;
    gap: 5px;
}

.profile-page .stat-number {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-color);
}

.profile-page .stat-icon {
    font-size: 18px;
    color: var(--text-color);
    display: flex;
    align-items: center;
}

.profile-page .stat-label {
    font-size: 10px;
    color: var(--text-color);
}

/* Блок получения награды */
.profile-page .reward-block {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 2px 10px 15px;
    background: #1a1a1a;
    border-radius: 15px;
    margin-bottom: 20px;
    height: 40px;
}

.profile-page .reward-info {
    display: flex;
    align-items: center;
    gap: 5px;
}

.profile-page .reward-number {
    font-size: 18px;
    font-weight: bold;
    color: white;
}

.profile-page .reward-star {
    color: #3b82f6;
}

.profile-page .claim-btn {
    background: rgba(48, 127, 255, 0.39);
    border: none;
    border-radius: 15px;
    padding: 8px 20px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Заголовок рефералов */
.profile-page .referrals-title {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.profile-page .friend-item {
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    background: var(--bg-secondary);
    border-radius: 15px;
}

.profile-page .friend-item:last-child {
    margin-bottom: 0;
}

.profile-page .friend-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    color: var(--text-primary);
}

.profile-page .friend-info {
    flex: 1;
}

.profile-page .friend-name {
    font-size: 16px;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.profile-page .friend-level {
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-page .friend-level-text {
    font-size: 12px;
    color: var(--text-secondary);
}

.profile-page .friend-level-bar {
    flex: 1;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
}

.profile-page .friend-level-progress {
    height: 100%;
    background: var(--text-accent);
    border-radius: 2px;
    width: 60%;
}

.profile-page .friend-percentage {

    color: white;
    font-size: 14px;
    font-weight: bold;
    padding: 8px 12px;
    border-radius: 8px;
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    margin: 2px;
}

/* Game Area */
.game-area {
    background-color: var(--bg-secondary);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
    overflow: visible;
    height: 220px;
}

.emoji-container {
    display: block;
    padding: 0;
    height: 100%;
    position: relative;
    overflow: hidden;
    /* Центрируем содержимое */
    text-align: center;
}

.emoji-item {
    min-width: 112px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-primary);
    border-radius: 8px;
    flex-shrink: 0;
    padding: 15px 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 0 5px;
}

.emoji {
    font-size: 80px;
    margin-bottom: 10px;
    line-height: 1;
    display: block;
    text-align: center;
}

.emoji-price {
    background-color: rgba(49, 128, 255, 0.199);
    color: #3b83f6;
    padding: 5px 10px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 3px;
}

.emoji-price span {
    color: #3b83f6;
}

.winning-line {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 180px;
    background-color: #8b5cf6;
    border-radius: 2px;
    z-index: 10;
}

@keyframes scrollRight {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Убедимся, что контейнер никогда не двигается */
.test-container .emoji-container {
    transform: none !important;
    animation: none !important;
}

/* Анимация для обычной прокрутки - ДЕФОЛТНАЯ 90s scrollLeft */
.emoji-track {
    animation: 90s linear 0s infinite normal none running scrollLeft !important;
}

/* ДОПОЛНИТЕЛЬНАЯ ДЕФОЛТНАЯ АНИМАЦИЯ (на случай если !important не сработает) */
.emoji-track:not(.spinning) {
    animation: 90s linear 0s infinite normal none running scrollLeft;
}

/* РЕЗЕРВНЫЙ КЛАСС ДЛЯ ЗАПУСКА АНИМАЦИИ */
/* НОВЫЙ КЛАСС ДЛЯ ДЕФОЛТНОЙ ПРОКРУТКИ (устойчивее) */
.emoji-track.auto-scroll {
    animation-name: autoScrollX !important;
    animation-duration: 90s !important;
    animation-timing-function: linear !important;
    animation-iteration-count: infinite !important;
    animation-play-state: running !important;
}

@keyframes autoScrollX {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Анимация для быстрого спина */
.emoji-track.spinning {
    animation: spinFast 4.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards !important;
    will-change: transform;
    transform: translateX(0) !important;
}

/* Убедимся, что анимации работают только для трека */
/* .test-container .emoji-track {
    animation: scrollRight 45s linear infinite;
} */

/* ВРЕМЕННО ОТКЛЮЧЕНА ДЕФОЛТНАЯ АНИМАЦИЯ ДЛЯ ТЕСТОВ */
.test-container .emoji-track {
    animation: none;
}

.test-container .emoji-track.spinning {
    animation: spinFast 4.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards !important;
}

/* Стили для тестового контейнера */
.test-container {
    max-width: 600px;
    margin: 50px auto;
    padding: 20px;
    text-align: center;
}

.test-container .emoji-container {
    width: 100%;
    height: 100px;
    background: #1a1a1a;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    margin: 20px 0;
    /* Контейнер должен оставаться неподвижным */
    transform: none !important;
    animation: none !important;
    display: block;
}

/* Внутренний контейнер для анимации */
.emoji-track {
    display: flex;
    align-items: center;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    white-space: nowrap;
    /* Трек должен двигаться, а не контейнер */
    transform-origin: left center;
    will-change: transform;
    animation: 90s linear 0s infinite normal none running scrollLeft !important;
    z-index: 1;
    /* Ограничиваем ширину трека */
    min-width: 100%;
    /* Центрируем элементы */
    justify-content: flex-start;
}

.test-container .emoji-item {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    margin: 0 10px;
    background: #333;
    border-radius: 8px;
    color: white;
    font-size: 24px;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

.test-container .emoji-price {
    font-size: 12px;
    margin-top: 5px;
}

.test-container .emoji-item .emoji {
    font-size: 40px;
    margin-bottom: 5px;
}

.test-container .emoji-item .emoji-price {
    font-size: 10px;
    background: rgba(59, 130, 246, 0.2);
    color: #3b83f6;
    padding: 2px 6px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 2px;
}

.test-button {
    background: #8b5cf6;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    margin: 10px;
}

.test-button:hover {
    background: #7c3aed;
}

.test-button:disabled {
    background: #666;
    cursor: not-allowed;
}

@keyframes spinFast {
    0% { transform: translateX(0); }
    10% { transform: translateX(-15%); }
    20% { transform: translateX(-30%); }
    30% { transform: translateX(-45%); }
    40% { transform: translateX(-60%); }
    50% { transform: translateX(-75%); }
    60% { transform: translateX(-85%); }
    70% { transform: translateX(-90%); }
    80% { transform: translateX(-92%); }
    90% { transform: translateX(-93.5%); }
    95% { transform: translateX(-93.8%); }
    100% { transform: translateX(-94%); }
}

/* Spin Section */
.spin-section {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.spin-btn {
    flex: 1;
    background-color: #8b5cf6;
    border: none;
    color: white;
    padding: 18px 20px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 0;
}



.demo-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.demo-label {
    font-size: 12px;
    color: #666;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-tertiary);
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #8b5cf6;
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

/* Winning Chances */
.winning-chances {
    margin-bottom: 20px;
}

.winning-chances h3 {
    font-size: 18px;
    margin-bottom: 15px;
    text-align: center;
}

.chances-container {
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    padding: 10px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.chances-container::-webkit-scrollbar {
    display: none;
}

.chances-grid {
    display: inline-flex;
    gap: 5px;
    padding: 0 5px;
}

.chance-item {
    background-color: var(--bg-secondary);
    border-radius: 8px;
    padding: 15px 10px;
    text-align: center;
    position: relative;
    min-width: 136px;
    flex-shrink: 0;
}
.gifts-content>.chances-grid>.chance-item {
    width: 49%;
}


.chance-item.exclusive {
    border: 1px solid #3b82f6;
}

.chance-item.crystals {
    border: 1px solid #10b981;
}

.chance-emoji {
    font-size: 34px;
    margin-bottom: 8px;
}

.chance-percent {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
}

.chance-reward {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background-color: rgba(49, 128, 255, 0.199);
    border-radius: 50px;
    padding: 5px 10px;
}

.chance-reward span {
    color: #3b83f6;
}

.reward-amount {
    font-size: 14px;
    font-weight: 600;
    color: #3b83f6;
}



.exclusive-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: #3b83f6;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    text-transform: uppercase;
}

/* User requested styles */
main.main-content {
    background-color: #000000 !important;
}

.username {
    color: white;
}

.bet-amount {
    font-size: 19px !important;
}
/* Принудительные стили для баланса в Telegram */
.balance-amount {
    font-size: 19px !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    background: linear-gradient(135deg, #4a9eff 0%, #2481cc 100%) !important;
    padding: 8px 16px !important;
    border-radius: 20px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    box-shadow: 0 4px 15px rgba(74, 158, 255, 0.3) !important;
    border: 2px solid #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}



/* Альтернативный вариант с текстом */
.balance-amount.telegram-fallback {
    background: #4a9eff !important;
    color: white !important;
    padding: 10px 20px !important;
    border-radius: 25px !important;
    font-weight: bold !important;
    text-align: center !important;
    min-width: 112px !important;
}

/* Принудительные стили для иконки алмаза в Telegram */
.diamond-icon {
    display: inline-block !important;
    vertical-align: middle !important;
    margin-left: 4px !important;
}

.diamond-icon svg {
    width: 14px !important;
    height: 15px !important;
    fill: currentColor !important;
    display: block !important;
}

/* Принудительные стили для баланса в Telegram */
.balance-amount {
    font-size: 19px !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    background: linear-gradient(135deg, #4a9eff 0%, #2481cc 100%) !important;
    padding: 8px 16px !important;
    border-radius: 20px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    box-shadow: 0 4px 15px rgba(74, 158, 255, 0.3) !important;
    border: 2px solid #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

/* Принудительно показывать SVG в Telegram */
.telegram-app .diamond-icon svg {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Модальное окно недостатка средств */
#insufficient-funds-modal {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-primary);
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 1000;
    max-height: 68vh;
    min-height: 300px;
    overflow-y: auto;
    height: auto;
}

#insufficient-funds-modal.show,
#insufficient-funds-modal.active {
    transform: translateY(0);
}

/* Анимация появления модального окна */
@keyframes slideUp {
    from {
        transform: translateY(100%);
        height: auto;
    }
    to {
        transform: translateY(0);
        height: auto;
    }
}

#insufficient-funds-modal.show,
#insufficient-funds-modal.active {
    display: block;
    opacity: 1;
}

/* Модальное окно рефералов */
.referral-header {
    text-align: center;
    margin-bottom: 25px;
}

.referral-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.referral-title {
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 5px 0;
}

.referral-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
    opacity: 0.8;
}

.referral-content {
    padding: 0;
}

.referral-link-section {
    margin-bottom: 25px;
}

.link-label {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.referral-link-container {
    position: relative;
    margin-bottom: 8px;
}

.referral-link-input {
    width: 100%;
    padding: 14px 50px 14px 16px;
    background: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
    outline: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.referral-link-input:focus {
    border-color: var(--accent-color);
    background: var(--bg-primary);
}

.referral-link-input::selection {
    background: var(--accent-color);
    color: white;
}

.copy-referral-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--accent-color);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 14px;
}

.copy-referral-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-50%) scale(1.05);
}

.copy-referral-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.link-hint {
    color: var(--text-secondary);
    font-size: 12px;
    text-align: center;
    opacity: 0.7;
    margin-top: 8px;
}

.referral-stats-section {
    margin-bottom: 25px;
}

.stats-title {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 15px 0;
    text-align: center;
}

.referral-stats {
    display: flex;
    gap: 15px;
}

.stat-item {
    flex: 1;
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 20px 16px;
    text-align: center;
    transition: all 0.2s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.stat-icon {
    font-size: 24px;
    margin-bottom: 2px;
}

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

.stat-value {
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    opacity: 0.8;
}

.telegram-version-info {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--bg-secondary);
    text-align: center;
}

.telegram-version-info small {
    color: var(--text-secondary);
    font-size: 11px;
    opacity: 0.7;
}

.referral-actions {
    text-align: center;
    margin-top: 25px;
}

.referral-actions .modal-btn {
    min-width: 120px;
}

/* Анимации для уведомлений */
@keyframes slideDown {
    from {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
    to {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
}

/* Информация о балансе */
.balance-info {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
    color: white;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.balance-info p {
    margin: 10px 0;
    font-size: 16px;
    font-weight: 500;
}

.balance-info .current-balance {
    color: #e74c3c;
    font-weight: bold;
    font-size: 18px;
}

.balance-info .required-amount {
    color: #f39c12;
    font-weight: bold;
    font-size: 18px;
}

/* Анимации для уведомлений */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* 🎨 ПОЛНОШИРИННЫЕ УВЕДОМЛЕНИЯ - ЕДИНЫЙ СТИЛЬ */
.notification-full-width {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    padding: 20px !important;
    border-radius: 0 !important;
    text-align: center !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    z-index: 10000 !important;
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%) !important;
    color: white !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2) !important;
    animation: notificationSlideDown 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    transform: translateY(-100%) !important;
    opacity: 0 !important;
}

.notification-full-width.show {
    transform: translateY(0) !important;
    opacity: 1 !important;
}

@keyframes slideOutUp {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-100%);
        opacity: 0;
    }
}

/* Стили для отключенной кнопки пополнения */
.top-up-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #6b7280;
}

.top-up-btn:disabled:hover {
    background-color: #6b7280;
    transform: none;
}

/* Дополнительная защита от масштабирования на iOS */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    html, body {
        -webkit-text-size-adjust: none;
    }
}

/* Запрет масштабирования на всех устройствах */
@media (max-width: 768px) {
    html, body {
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
        touch-action: manipulation;
    }
}

/* Стили для кнопки продажи подарков */
button.gift-sell-btn {
    background: #10b981 !important; /* Принудительный зеленый цвет */
    border: none !important;
    border-radius: 15px !important;
    padding: 15px 30px !important;
    color: white !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    width: 100% !important;
    max-width: 400px !important;
    text-align: center !important;
    margin-top: 15px !important;
    display: block !important;
}

button.gift-sell-btn:hover {
    background: #059669 !important; /* Темно-зеленый при наведении */
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3) !important;
}

/* Стили для кнопки "Подробнее" в профиле */
.profile-page button.gift-sell-btn {
    padding: 8px 0px !important;
    font-size: 12px !important;
    background: #10b981 !important;
    border: none !important;
    border-radius: 15px !important;
    color: white !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    width: 100% !important;
    max-width: 400px !important;
    text-align: center !important;
    margin-top: 15px !important;
    display: block !important;
}

.profile-page button.gift-sell-btn:hover {
    background: #059669 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
}

/* Стили для страницы профиля */
.profile-page .gifts-content {
    display: flex;
    flex-wrap: wrap;
    gap: 14%;
}

.gift-date {
    display: none;
}

.gift-reward {
    margin-bottom: 15px !important;
}

/* Скрываем языковой селектор на странице профиля */
.profile-language {
    display: none !important;
}

/* Стили для отображения баланса */
.balance-amount {
    font-size: 19px !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    padding: 8px 16px !important;
    border-radius: 20px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
    background: transparent !important;
}

/* SVG иконка для баланса */
.balance-amount svg {
    width: 14px;
    height: 15px;
    fill: #ffffff;
    flex-shrink: 0;
}

/* Гарантируем, что кнопки быстрого выбора всегда видны */
.quick-select-btn {
    display: block !important;
}

/* Стили для демо режима */
.demo-toggle input:checked + .demo-label {
    color: var(--text-accent);
    font-weight: 600;
}

/* Индикация демо режима на кнопке спина */
#spin-btn.demo-mode {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    border: none !important;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

#spin-btn.demo-mode:hover {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
}

/* Стили для span.balance-amount */
span.balance-amount {
    border: none !important;
    box-shadow: none !important;
}

/* Принудительно убираем border и box-shadow для всех .balance-amount */
.balance-amount {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

/* Гарантируем, что SVG иконка всегда отображается в балансе */
.balance-amount .diamond-icon {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.balance-amount .diamond-icon svg {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    fill: #ffffff !important;
}

/* Стили для иконки алмаза */
.diamond-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.diamond-icon svg {
    width: 14px !important;
    height: 15px !important;
    fill: #ffffff !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}
.emoji img {
    width: 100px !important;
    height: 100px !important;
}

/* Плейсхолдер для ленты эмодзи */
#emoji-container.loading {
	opacity: 0.9;
}

.emoji-placeholder {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 72px;
	height: 72px;
	margin: 0 8px;
	border-radius: 12px;
	background: linear-gradient(90deg, rgba(255,255,255,0.10) 25%, rgba(255,255,255,0.20) 37%, rgba(255,255,255,0.10) 63%);
	background-size: 400% 100%;
	animation: shimmer 1.2s ease-in-out infinite;
	border: 1px solid rgba(255,255,255,0.08);
}

.emoji-placeholder .thumb {
	width: 48px;
	height: 48px;
	border-radius: 8px;
	background: rgba(255,255,255,0.12);
}

@keyframes shimmer {
	0% { background-position: 100% 0; }
	100% { background-position: 0 0; }
}

/* Уведомление о демо режиме */
.demo-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    animation: slideInRight 0.5s ease-out;
}

.demo-notification-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.demo-notification button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.demo-notification button:hover {
    background: rgba(255, 255, 255, 0.3);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Модальное окно для подарка */
#gift-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

#gift-modal.show {
    display: block;
}

#gift-modal .modal-content {
    background-color: var(--bg-primary);
    margin: 0;
    padding: 0;
    border-radius: 20px;
    width: 100%;
    max-width: 100% !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
    margin-top: 58px;
    height: 100%;
    overflow: auto;
}

#gift-modal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#gift-modal .modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

#gift-modal .close-btn {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 44px;
    cursor: pointer;
    padding: 5px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

#gift-modal .close-btn:hover {
    color: #cccccc;
}

#gift-modal .modal-body {
    padding: 20px;
}

#gift-modal .gift-preview {
    text-align: center;
}

#gift-modal .gift-image {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 15px;
    margin-bottom: 15px;
    border: 3px solid #3b82f6;
}

#gift-modal .gift-info h4 {
    margin: 0 0 10px 0;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
}

#gift-modal .gift-info p {
    margin: 0 0 15px 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.4;
}

#gift-modal .gift-price {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 16px;
}

#gift-modal .modal-footer {
    padding: 20px;
    display: flex;
    gap: 15px;
    justify-content: center;
}

#gift-modal .btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

#gift-modal .btn-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

#gift-modal .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

#gift-modal .btn-secondary {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

#gift-modal .btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

/* Стили для подарков пользователя */
.gift-item {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.gift-item:hover {
    transform: translateY(-2px);
    border-color: #3b82f6;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

.gift-item .gift-emoji {
    font-size: 48px;
    text-align: center;
    margin-bottom: 10px;
}

.gift-item .gift-info {
    text-align: center;
}

.gift-item .gift-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.gift-item .gift-price {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

.no-gifts {
    text-align: center;
    color: var(--text-secondary);
    font-size: 16px;
    padding: 40px 20px;
    font-style: italic;
}

/* НОВЫЕ СТИЛИ ДЛЯ ПОДАРКОВ - v4.6 */
.gift-item .gift-emoji img {
    width: 100px !important;
    height: 100px !important;
}

/* Стили для текста подарков в профиле */
.profile-page .gift-item .gift-emoji {
    margin-bottom: 15px !important;
}

.profile-page .gift-item .gift-reward {
    color: #ffffff !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    margin-bottom: 15px !important;
}

.profile-page .gift-item .gift-date {
    color: #9ca3af !important;
    font-size: 12px !important;
    margin-bottom: 15px !important;
}

button.gift-sell-btn {
    background: #10b981 !important; /* Принудительный зеленый цвет */
    border: none !important;
    border-radius: 15px !important;
    padding: 8px 0px !important;
    color: white !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    width: 100% !important;
    max-width: 400px !important;
    text-align: center !important;
    margin-top: 15px !important;
    display: block !important;
}

button.gift-sell-btn:hover {
    background: #059669 !important; /* Темно-зеленый при наведении */
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
}

.profile-page .gift-item {
    background: #1f2937 !important; /* Принудительный темный фон */
    border: 2px solid #10b981 !important; /* Зеленая обводка */
    border-radius: 15px !important;
    padding: 20px !important;
    text-align: center !important;
    width: 48% !important;
    margin: 0 !important;
    margin-left: 0 !important;
    align-items: start !important;
    margin-bottom: 0 !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2) !important;
}

.profile-page .gifts-content {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Кнопка "Отключить демо-режим" */
.off-demo {
    background: var(--text-accent);
    border: none;
    border-radius: 15px;
    padding: 12px 24px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 10px auto;
    display: block;
    width: 100%;
    max-width: 300px;
}

.off-demo:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.winning-gift-image img {
    width: 100px !important;
    height: 100px !important;
}

.off-demo:active {
    transform: translateY(0);
}

/* Кнопка спина в демо-режиме */
#spin-btn.demo-mode {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    border: 2px solid #a78bfa;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

/* Стили для span внутри .spin-text */
span.spin-text span {
    font-size: 14px;
    border: 1px solid;
    padding: 6px;
    border-radius: 9px;
    background: #ffffff;
    color: #7f40ef;
}

/* Переключатель демо-режима */
.demo-toggle {
    border: 2px solid #8043f0;
    padding: 3px;
    border-radius: 10px;
}

span.demo-label {
    color: #7e3eee;
    font-weight: 700;
}

/* Элементы шансов с категориями */
.chance-item.stars {
    border: 2px solid;
    border-color: #fbbf24;
}

.chance-item.nft {
    border-color: #ff1200b5 !important;
    border: 2px solid;
}

.chance-item.exclusive {
    border-color: #ef4444;
}

.chance-item.medium {
    border-color: #8b5cf6;
    border: 2px solid #8b5cf6;
}

.chance-item.common {
    border-color: #6b7280;
    border: 2px solid #6b7280;
}

.chance-emoji img {
    width: 85px !important;
    height: 85px !important;
}

/* Стили для выигранных подарков */
.gift-item.won-gift {
    border: 2px solid #10b981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
}

.gift-item.won-gift .gift-sell-btn {
    background: #10b981;
    color: white;
}

.gift-item.won-gift .gift-sell-btn:hover {
    background: #059669;
}

.gift-item.nocontent {
    width: 100%;
}

/* Loader spinner для загрузки подарков */
.gifts-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    flex-direction: column;
    gap: 20px;
}

.gifts-loader .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--bg-tertiary);
    border-top: 4px solid var(--text-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.gifts-loader .loading-text {
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 500;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Стили для прогресс-бара уровня на странице профиля */
.profile-page .level-progress {
    height: 100%;
    background: var(--text-accent);
    border-radius: 4px;
    width: 0%; /* По умолчанию 0% для новых пользователей */
    transition: width 0.3s ease;
}

/* Стили для информации об уровне на странице профиля */
.profile-page .level-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin: 16px 0;
}

.profile-page .level-info span {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.profile-page .level-info .level {
    font-size: 18px;
    color: var(--text-accent);
}
.profile-page .profile-info {
    position: relative;
    bottom: 10px;
}
.leaders-list {
    padding: 0;
}

/* Стили для модального окна предупреждения о выводе подарков */
.warning-text {
    text-align: center;
    margin: 20px 0;
    color: var(--text-primary);
}

.warning-text p {
    margin: 8px 0;
    line-height: 1.4;
}

.confirm-withdrawal-btn {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    border: none !important;
    color: white !important;
    font-weight: 600 !important;
}

.confirm-withdrawal-btn:hover {
    background: linear-gradient(135deg, #059669, #047857) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
}

.cancel-withdrawal-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    border: none !important;
    color: white !important;
    font-weight: 600 !important;
}

.cancel-withdrawal-btn:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3) !important;
}

@media (max-width: 480px) {
    .quick-select-btn {
        padding: 8px 12px;
        font-size: 16px;
        flex-shrink: 0;
    }
}

#spin-btn.demo-mode svg {
    display: none;
}
.chance-gift img {
    width: 100px !important;
    height: 100px !important;
}

/* Referral link input styling */
.referral-href {
    display: block;
    margin: 0 auto;
    width: 100%;
    margin-bottom: 15px;
    padding: 10px;
    background: #8b5cf6;
    border-radius: 10px;
    border: none !important;
    color: white;
    font-weight: 600;
    text-align: center;
    font-size: 12px;
}

/* Стили для модального окна вывода реферальных наград */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--modal-overlay);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 0;
    max-width: 400px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 20px 20px 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.modal-close:hover {
    background-color: var(--bg-secondary);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 0 20px 20px 20px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
}

.modal-btn.primary {
    background: var(--primary-color);
    color: white;
}

.modal-btn.primary:hover {
    background: var(--button-hover);
    transform: translateY(-1px);
}

.modal-btn.secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.modal-btn.secondary:hover {
    background: var(--bg-tertiary);
}

#referral-withdrawal-modal {
    z-index: 10001;
}

.withdrawal-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    color: white;
    text-align: center;
}

.withdrawal-info p {
    margin: 8px 0;
    font-size: 16px;
    font-weight: 600;
}

.min-withdrawal-note {
    font-size: 14px !important;
    opacity: 0.9;
    font-weight: 400 !important;
}

.withdrawal-form {
    margin: 20px 0;
}

.withdrawal-form label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-primary);
}

.input-group {
    position: relative;
    margin-bottom: 15px;
}

.input-group input {
    width: 100%;
    padding: 12px 40px 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    box-sizing: border-box;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.input-suffix {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-weight: 600;
}

.quick-withdrawal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 15px 0;
}

.quick-withdrawal-btn {
    padding: 8px 16px;
    border: 2px solid var(--primary-color);
    border-radius: 20px;
    background: transparent;
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-withdrawal-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

.quick-withdrawal-btn:active {
    transform: translateY(0);
}

.remaining-balance {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.remaining-balance p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.remaining-balance span {
    color: var(--primary-color);
    font-weight: 600;
}

.profile-page .reward-block {
    margin-top: 43px;
}

/* Стили для подарков пользователя */
.empty-gifts {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    width: 100%;
}

.empty-gifts .empty-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.empty-gifts h3 {
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 18px;
}

.empty-gifts p {
    font-size: 14px;
    opacity: 0.8;
}

.gifts-header {
    padding: 20px 0 15px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.gifts-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
}

.gifts-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.user-gift-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    align-items: center;
    transition: all 0.2s ease;
}

.user-gift-card:hover {
    background: var(--bg-tertiary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.gift-visual {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.gift-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.gift-emoji {
    font-size: 24px;
}

.gift-info {
    flex: 1;
    min-width: 0;
}

.gift-name {
    margin: 0 0 4px 0;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
}

.gift-price {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.gift-date {
    color: var(--text-secondary);
    font-size: 12px;
    margin-bottom: 4px;
}

.gift-description {
    color: var(--text-secondary);
    font-size: 12px;
    margin: 4px 0 0 0;
    line-height: 1.3;
}

.gift-actions {
    flex-shrink: 0;
}

.gift-action-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.sell-btn {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.sell-btn:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: translateY(-1px);
}

.sell-btn:active {
    transform: translateY(0);
}

/* Адаптивность для мобильных устройств */
@media (max-width: 480px) {
    .user-gift-card {
        padding: 12px;
        gap: 10px;
    }
    
    .gift-visual {
        width: 40px;
        height: 40px;
    }
    
    .gift-emoji {
        font-size: 20px;
    }
    
    .gift-name {
        font-size: 14px;
    }
    
    .gift-action-btn {
        padding: 6px 12px;
        font-size: 11px;
    }
}
.gifts-content>.chances-grid {
    flex-wrap: wrap;
    width: 100%;
}
.gifts-header {
    display: none;
}
.gifts-content>.chances-grid>.chance-item>.chance-percent {
    display: none;
}
button.gift-action-btn.details-btn {
    width: 100%;
}

/* Стили для вкладок лидеров */
.leader-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    padding: 0 20px;
}

.leader-tab-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 12px;
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.leader-tab-btn.active {
    background-color: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.leader-tab-btn:hover:not(.active) {
    background-color: var(--bg-hover);
    border-color: var(--accent-primary);
}

/* Стили для списка лидеров */
.leaders-list {
    padding: 20px;
}

.leaders-header {
    text-align: center;
    margin-bottom: 20px;
}

.leaders-header h3 {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.leaders-content {
    max-height: 400px;
    overflow-y: auto;
}

/* Элемент лидера */
.leader-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: 12px;
    background-color: var(--bg-tertiary);
    transition: all 0.3s ease;
}

.leader-item:hover {
    background-color: var(--bg-hover);
    transform: translateY(-1px);
}

.leader-item.current-user {
    background-color: var(--accent-primary);
    color: white;
}

.leader-item.current-user .leader-info {
    color: white;
}

.leader-rank {
    width: 32px;
    height: 32px;
    border-radius: 28%;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    margin-right: 12px;
    flex-shrink: 0;
}

.leader-item.current-user .leader-rank {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.leader-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    flex-shrink: 0;
    background-color: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.leader-info {
    flex: 1;
    min-width: 0;
}

.leader-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leader-score {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.leader-item.current-user .leader-name,
.leader-item.current-user .leader-score {
    color: white;
}

.leader-position {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-left: auto;
    flex-shrink: 0;
}

.leader-item.current-user .leader-position {
    color: rgba(255, 255, 255, 0.8);
}

/* Стили для топ-3 */
.leader-item.rank-1 .leader-rank {
    background: linear-gradient(135deg, #ffd700, #ffb347);
    color: #333;
}

.leader-item.rank-2 .leader-rank {
    background: linear-gradient(135deg, #c0c0c0, #a8a8a8);
    color: #333;
}

.leader-item.rank-3 .leader-rank {
    background: linear-gradient(135deg, #cd7f32, #a0522d);
    color: #333;
}

/* Стили для загрузки */
.loading-leaders {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-size: 16px;
}

.loading-leaders::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--bg-primary);
    border-radius: 50%;
    border-top-color: var(--accent-primary);
    animation: spin 1s ease-in-out infinite;
    margin-left: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Адаптивность */
@media (max-width: 480px) {
    .leader-tabs {
        padding: 0 15px;
        gap: 6px;
    }

    .leader-tab-btn {
        padding: 10px 12px;
        font-size: 13px;
    }

    .leaders-list {
        padding: 15px;
    }

    .leader-item {
        padding: 10px 12px;
    }

    .leader-avatar {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}

button.modal-btn.save-btn {
    height: 55px;
}

/* === ОПТИМИЗАЦИЯ ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ === */
@media (max-width: 768px) {
    .emoji-track {
        animation: 60s linear 0s infinite normal none running scrollLeft !important;
        gap: 8px; /* Меньше расстояние между элементами */
    }

    .emoji-item {
        transform: translateZ(0); /* Hardware acceleration */
        backface-visibility: hidden;
        -webkit-transform: translateZ(0);
        -webkit-backface-visibility: hidden;
    }

    .emoji-item img {
        image-rendering: -webkit-optimize-contrast; /* Лучшее качество на мобильных */
        -webkit-image-rendering: -webkit-optimize-contrast;
        max-width: 40px; /* Меньше размер изображений */
        max-height: 40px;
    }

    /* Оптимизация анимации спина для мобильных */
    .emoji-track.spinning {
        animation-duration: 3s !important; /* Быстрее на мобильных */
    }

    /* Снижаем нагрузку на процессор */
    .emoji-track.spinning-slow {
        animation-duration: 4s !important;
    }

    .emoji-track.spinning-very-slow {
        animation-duration: 5s !important;
    }
}

/* === ДОПОЛНИТЕЛЬНАЯ ОПТИМИЗАЦИЯ ПРОИЗВОДИТЕЛЬНОСТИ === */
/* Принудительное аппаратное ускорение для emoji-track */
.emoji-track {
    -webkit-transform: translateZ(0);
    -moz-transform: translateZ(0);
    -ms-transform: translateZ(0);
    -o-transform: translateZ(0);
    transform: translateZ(0);
    will-change: transform;
}

/* Оптимизация для низкой производительности устройств */
@media (max-width: 480px) {
    .emoji-track {
        animation: 90s linear 0s infinite normal none running scrollLeft !important;
    }

    .emoji-item img {
        max-width: 100px; /* Еще меньше размер изображений */
        max-height: 100px;
    }
}
div#gift-profile-modal>.modal-content>#close-gift-profile-modal {
    display: block !important;
}
button.payment-method-btn span {
    margin-left: 9px;
    background-color: var(--text-accent);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

button.close-btn.opem {
    display: block !important;
}
/* TON кошелек - блок отключения */
.ton-disconnect {
    margin-top: 0px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: none;
    background: none !important;
    border: none !important;
    padding: 0 !important;
}


span.balance-amount-ton {
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    padding: 9px 0px !important;
    border-radius: 20px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
    background: transparent !important;
    justify-content: center;
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.2s ease;
}

span.balance-amount-ton:hover {
    color: #ffcc00 !important;
}
button.modal-btn.receive-btn.claim-btn {
    height: 55px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    flex: 1;
    background-color: var(--bg-tertiary);
    border: none;
    color: var(--text-primary);
    padding: 17px 25px;
    border-radius: 13px;
    cursor: pointer;
    transition: background-color 0.3s;
    min-width: 120px;
}

.sell-btn {
    height: 55px;
}

.leader-score svg {
    position: relative;
    top: 2px;
}
span.progress-percent {
    display: none;
}
.progress-info {
    position: relative;
    bottom: 3px;
}
.main-content {
    height: auto !important;
}
.profile-page .balance-amount {
    padding-right: 0 !important;
    font-size: 25px !important;
}
.level-info>.level-bar {
    display: none;
}

/* ===== БЛОКИРОВКА ДЛЯ ДЕСКТОПНЫХ УСТРОЙСТВ ===== */

/* Стили для страницы блокировки */
.desktop-block-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: white;
}

.desktop-block-container {
    text-align: center;
    max-width: 500px;
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.desktop-block-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.8;
}

.desktop-block-title {
    font-size: 28px;
    margin-bottom: 15px;
    font-weight: 700;
}

.desktop-block-text {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 20px;
    opacity: 0.9;
}

.desktop-block-telegram-link {
    display: inline-block;
    background: #0088cc;
    color: white;
    text-decoration: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.desktop-block-telegram-link:hover {
    background: #006699;
    transform: translateY(-2px);
}

.desktop-block-device-info {
    margin-top: 20px;
    font-size: 14px;
    opacity: 0.7;
}

/* ===== ИСПРАВЛЕНИЯ ДЛЯ ANDROID УСТРОЙСТВ ===== */

/* Улучшения прокрутки для Android */
@supports (-webkit-touch-callout: none) {
    /* iOS устройства */
    body {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: none;
    }
}

/* Android устройства */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    body {
        /* Убираем position: fixed для Android, заменяем на relative */
        position: relative !important;
        height: auto !important;
        min-height: 100vh;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    
    html {
        height: auto !important;
        overflow-y: auto !important;
    }
    
    /* Улучшаем прокрутку для контейнеров */
    .main-content,
    .play-page,
    .profile-page,
    .tasks-page,
    .leaders-page {
        min-height: 100vh;
        padding-bottom: 100px; /* Отступ для навигации */
    }
    
    /* Улучшаем прокрутку для модальных окон */
    .bottom-modal {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    
    /* Улучшаем прокрутку для списков */
    .leaders-list,
    .tasks-list,
    .gifts-list {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
}

/* Дополнительные исправления для старых Android браузеров */
@media screen and (max-width: 768px) {
    body {
        /* Принудительно включаем прокрутку */
        overflow-y: scroll !important;
        -webkit-overflow-scrolling: touch;
        /* Убираем bounce эффект */
        overscroll-behavior: none;
        /* Улучшаем производительность */
        will-change: scroll-position;
    }
    
    /* Убираем position: fixed для мобильных устройств */
    html, body {
        position: relative !important;
        height: auto !important;
    }
    
    /* Добавляем отступы для навигации */
    .main-content {
        padding-bottom: 120px;
    }
    
    .play-page,
    .profile-page,
    .tasks-page,
    .leaders-page {
        padding-bottom: 120px;
    }
}