* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent; /* Убирает синий квадрат на iOS */
    -webkit-text-size-adjust: 100%; /* Предотвращает увеличение текста на iOS */
}

/* Предотвращение скролла и масштабирования */
html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: fixed;
    touch-action: manipulation; /* Отключает масштабирование жестами */
}

/* Светлая тема (по умолчанию) */
:root {
    --bg-color: #ffffff;
    --text-color: #333333;
    --container-bg: transparent;
    --balance-color: #2c5530;
    --stat-bg: #f8f9fa;
    --stat-border: #e9ecef;
    --modal-bg: #f5f5f5;
    --modal-header-bg: #ffffff;
    --modal-border: #e0e0e0;
    --player-bg: #ffffff;
    --player-shadow: rgba(0,0,0,0.1);
    --tab-bg: #ffffff;
    --tab-active: #4CAF50;
    --theme-toggle-bg: rgba(0,0,0,0.1);
}

/* Темная тема */
[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #ffffff;
    --container-bg: transparent;
    --balance-color: #4CAF50;
    --stat-bg: #2d2d2d;
    --stat-border: #404040;
    --modal-bg: #2d2d2d;
    --modal-header-bg: #1a1a1a;
    --modal-border: #404040;
    --player-bg: #1a1a1a;
    --player-shadow: rgba(0,0,0,0.3);
    --tab-bg: #1a1a1a;
    --tab-active: #4CAF50;
    --theme-toggle-bg: rgba(255,255,255,0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    padding: 20px;
    -webkit-user-select: none; /* Запрет выделения текста */
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow: hidden;
    position: relative;
}

.container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.balance-section {
    text-align: center;
    margin-bottom: 25px;
    padding-top: 15px;
}

.balance-title {
    font-size: 20px;
    margin-bottom: 12px;
    color: var(--text-color);
    font-weight: 600;
    opacity: 0.9;
}

.balance-amount {
    font-size: 28px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    color: var(--balance-color);
    flex-wrap: nowrap;
}

.coin-icon {
    width: 28px; /* Уменьшено на ~10% с 32px */
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    -webkit-user-drag: none;
}

.buttons-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 30px;
    width: 100%;
}

.btn {
    background: none;
    border: none;
    border-radius: 15px;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70px;
    outline: none;
    width: 100%;
}

.btn:hover {
    transform: translateY(-3px);
    filter: brightness(1.1);
}

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

.btn-image {
    width: 100%;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 4px 15px var(--player-shadow);
    min-height: 70px;
    object-fit: cover;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    pointer-events: none;
}

/* ОГРОМНАЯ МОНЕТА - адаптивная */
.click-coin {
    width: min(250px, 50vw);
    height: min(250px, 50vw);
    margin: 0 auto 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s ease;
    user-select: none;
    border-radius: 50%;
    border: none;
    background: none;
    padding: 0;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.click-coin:active {
    transform: scale(0.95);
}

.click-coin-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 10px 30px rgba(44, 85, 48, 0.4);
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    pointer-events: none;
}

.stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
    width: 100%;
}

.stat-item {
    background: #2196F3; /* Голубой фон */
    padding: 15px;
    border-radius: 15px;
    border: none;
    transition: all 0.3s ease;
    width: 100%;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
    color: white;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.stat-label {
    font-size: 14px;
    color: white;
    margin-bottom: 8px;
    font-weight: 600;
    opacity: 0.9;
}

.stat-value {
    font-size: 16px;
    font-weight: bold;
    color: white;
    word-break: break-all;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 12px;
    border-radius: 10px;
    margin-top: 0;
    width: 100%;
    text-align: center;
}

/* Кнопка переключения темы */
.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: var(--theme-toggle-bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 1000;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-icon {
    width: 24px;
    height: 24px;
    transition: all 0.3s ease;
}



/* Для очень маленьких экранов */
@media (max-width: 320px) {
    .buttons-grid {
        gap: 8px;
    }
    
    .btn {
        min-height: 60px; /* Увеличено для очень маленьких экранов */
        border-radius: 10px;
    }
    
    .btn-image {
        min-height: 60px;
        border-radius: 10px;
    }
}

/* Анимация клика */
@keyframes coinClick {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.click-animation {
    animation: coinClick 0.15s ease;
}

/* Стили для модальных окон */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow: hidden;
}

.modal-content {
    background-color: var(--modal-bg);
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    transition: all 0.3s ease;
    -webkit-overflow-scrolling: touch; /* Плавный скролл на iOS */
}

.modal-header {
    background: var(--modal-header-bg);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--modal-border);
    transition: all 0.3s ease;
    position: sticky;
    top: 0;
    z-index: 10;
}

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

.close-modal {
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-color);
    opacity: 0.7;
}

.close-modal:hover {
    opacity: 1;
}


/* Стили для контента топа */
.tabs {
    display: flex;
    background: var(--tab-bg);
    border-radius: 12px;
    padding: 4px;
    margin: 15px;
    box-shadow: 0 2px 8px var(--player-shadow);
    transition: all 0.3s ease;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    outline: none;
    color: var(--text-color);
}

.tab-btn.active {
    background: var(--tab-active);
    color: white;
}

.total-users {
    text-align: center;
    margin: 0 15px 20px;
    font-size: 16px;
    color: #2196F3;
    font-weight: 600;
}

.players-list {
    margin-bottom: 80px;
    padding: 0 15px;
}

.player-item {
    display: flex;
    align-items: center;
    background: var(--player-bg);
    padding: 15px;
    border-radius: 15px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px var(--player-shadow);
    transition: all 0.3s ease;
    width: 100%;
}

.player-rank {
    font-weight: bold;
    font-size: 16px;
    margin-right: 12px;
    min-width: 30px;
    text-align: center;
    color: var(--text-color);
}

.rank-1 { color: #FFD700; }
.rank-2 { color: #C0C0C0; }
.rank-3 { color: #CD7F32; }

.player-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #4CAF50;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    margin-right: 12px;
    flex-shrink: 0;
}

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

.player-name {
    font-weight: bold;
    margin-bottom: 8px;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 16px;
}


.player-balance {
    font-size: 20px;
    color: #4CAF50;
    margin-bottom: 8px;
    word-break: break-all;
    font-weight: bold;
}

.player-stats {
    display: flex;
    gap: 15px;
    font-size: 10px;
    color: var(--text-color);
    opacity: 0.7;
    flex-wrap: nowrap;
}

.player-stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 0, 0, 0.1);
    padding: 4px 8px;
    border-radius: 8px;
}

[data-theme="dark"] .player-stat-item {
    background: rgba(255, 255, 255, 0.1);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.bottom-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--player-bg);
    padding: 12px 15px;
    border-top: 1px solid var(--modal-border);
    box-shadow: 0 -2px 8px var(--player-shadow);
    transition: all 0.3s ease;
}

.current-user {
    display: flex;
    align-items: center;
}

.loading, .error {
    text-align: center;
    padding: 20px;
    color: var(--text-color);
    opacity: 0.8;
}

.error {
    color: #f44336;
}

/* Запрет контекстного меню для всех изображений */
img {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Стили для аватарок */
.avatar-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-fallback {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #4CAF50;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 18px;
}

.player-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Стили для магазина */
.shop-header {
    background: #2196F3;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--modal-border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.shop-header h3 {
    margin: 0;
    color: white;
    font-size: 18px;
}

.shop-back-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
}

.shop-back-btn:hover {
    background: rgba(255,255,255,0.2);
}

.shop-header-spacer {
    width: 30px;
}

.shop-categories {
    display: flex;
    background: var(--player-bg);
    border-bottom: 1px solid var(--modal-border);
    padding: 0 15px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: sticky;
    top: 60px;
    z-index: 5;
}

.shop-category-btn {
    flex: 1;
    padding: 12px 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    color: var(--text-color);
    white-space: nowrap;
    min-width: 80px;
    position: relative;
}

.shop-category-btn.active {
    color: #2196F3;
}

.shop-category-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 8px;
    right: 8px;
    height: 3px;
    background: #2196F3;
    border-radius: 3px 3px 0 0;
}

.modal-balance-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--modal-header-bg);
    border-top: 1px solid var(--modal-border);
    padding: 12px 15px;
    text-align: center;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 100;
}

.balance-label {
    font-size: 14px;
    color: var(--text-color);
    margin-bottom: 5px;
    font-weight: 500;
}

.balance-amount-modal {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 16px;
    font-weight: bold;
    color: var(--balance-color);
}

.coin-icon-modal {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
}


.shop-content {
    padding: 15px;
    overflow-y: auto;
    max-height: calc(100vh - 200px); /* Уменьшаем высоту из-за панели баланса */
    -webkit-overflow-scrolling: touch;
    margin-bottom: 60px; /* Отступ для панели баланса */
}

.shop-category-content {
    display: none;
}

.shop-category-content.active {
    display: block;
}

.shop-info-card {
    background: #E3F2FD;
    border: 1px solid #BBDEFB;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

[data-theme="dark"] .shop-info-card {
    background: #0D47A1;
    border-color: #1976D2;
}

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

.shop-info-text {
    font-size: 14px;
    line-height: 1.4;
    color: var(--text-color);
}

.shop-items-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shop-item {
    background: var(--player-bg);
    border: 1px solid var(--modal-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 4px var(--player-shadow);
    width: 100%;
}

.shop-item-header {
    background: var(--stat-bg);
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--modal-border);
}

.shop-item-name {
    font-weight: bold;
    color: var(--text-color);
    font-size: 16px;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shop-item-owned {
    font-size: 12px;
    color: var(--text-color);
    opacity: 0.8;
    flex-shrink: 0;
    margin-left: 10px;
}

.shop-item-content {
    padding: 15px;
}

.shop-item-stats {
    margin-bottom: 12px;
}

.shop-item-stat {
    font-size: 14px;
    color: var(--text-color);
    margin-bottom: 4px;
    word-break: break-all;
}

.shop-item-stat.highlight {
    color: #4CAF50;
    font-weight: bold;
}

.shop-item-price {
    font-size: 14px;
    color: var(--text-color);
    margin-bottom: 12px;
    word-break: break-all;
}

.shop-buy-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.shop-buy-btn.available {
    background: #4CAF50;
    color: white;
}

.shop-buy-btn.available:hover {
    background: #45a049;
    transform: translateY(-1px);
}

.shop-buy-btn.available:active {
    transform: translateY(0);
}

.shop-buy-btn.unavailable {
    background: #f44336;
    color: white;
    cursor: not-allowed;
}

.shop-buy-btn.unavailable:hover {
    background: #da190b;
}

/* Стили для системы переводов */
.transfer-header {
    background: #1565C0;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--modal-border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.transfer-header h3 {
    margin: 0;
    color: white;
    font-size: 18px;
}

.transfer-back-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
}

.transfer-back-btn:hover {
    background: rgba(255,255,255,0.2);
}

.transfer-header-spacer {
    width: 30px;
}

.transfer-tabs {
    display: flex;
    background: var(--player-bg);
    border-bottom: 1px solid var(--modal-border);
    padding: 0 15px;
    position: sticky;
    top: 60px;
    z-index: 5;
}

.transfer-tab-btn {
    flex: 1;
    padding: 12px 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    color: var(--text-color);
    position: relative;
}

.transfer-tab-btn.active {
    color: #1565C0;
}

.transfer-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 8px;
    right: 8px;
    height: 3px;
    background: #1565C0;
    border-radius: 3px 3px 0 0;
}

.transfer-content {
    padding: 15px;
    overflow-y: auto;
    max-height: calc(100vh - 140px);
    -webkit-overflow-scrolling: touch;
}

.transfer-tab-content {
    display: none;
}

.transfer-tab-content.active {
    display: block;
}

/* Стили для поиска */
.search-section {
    margin-bottom: 20px;
}

.search-info {
    text-align: center;
    padding: 20px;
    color: var(--text-color);
    opacity: 0.7;
    font-size: 16px;
}

.search-input-container {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.search-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid var(--modal-border);
    border-radius: 10px;
    background: var(--player-bg);
    color: var(--text-color);
    font-size: 14px;
    outline: none;
}

.search-input::placeholder {
    color: var(--text-color);
    opacity: 0.5;
}

.search-confirm-btn {
    background: #1565C0;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
}

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

/* Стили для результатов поиска */
.search-results {
    margin-bottom: 20px;
}

.user-result-item {
    display: flex;
    align-items: center;
    background: var(--player-bg);
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px var(--player-shadow);
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-result-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--player-shadow);
}

.user-result-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 15px;
    flex-shrink: 0;
}

.user-result-info {
    flex: 1;
}

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

.user-result-balance {
    font-size: 14px;
    color: #4CAF50;
    margin-bottom: 5px;
}

.user-result-stats {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: var(--text-color);
    opacity: 0.7;
}

/* Стили для ввода суммы */
.amount-input-container {
    display: flex;
    align-items: center;
    background: var(--player-bg);
    border: 1px solid var(--modal-border);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
}

.amount-input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-color);
    font-size: 18px;
    font-weight: bold;
    outline: none;
}

.amount-currency {
    color: var(--text-color);
    font-weight: bold;
    margin-left: 10px;
}

.balance-info {
    text-align: center;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--text-color);
    opacity: 0.7;
}

.transfer-confirm-btn {
    width: 100%;
    padding: 15px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.transfer-confirm-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
}

.transfer-confirm-btn:active:not(:disabled) {
    transform: scale(0.98);
}

/* Стили для истории переводов */
.history-list {
    margin-bottom: 20px;
}

.history-item {
    display: flex;
    align-items: center;
    background: var(--player-bg);
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px var(--player-shadow);
}

.history-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 15px;
    flex-shrink: 0;
}

.history-info {
    flex: 1;
}

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

.history-name {
    font-weight: bold;
    color: var(--text-color);
}

.history-amount {
    font-weight: bold;
    font-size: 16px;
}

.amount-positive {
    color: #4CAF50;
}

.amount-negative {
    color: #f44336;
}

.history-time {
    font-size: 12px;
    color: var(--text-color);
    opacity: 0.7;
}

/* Стили для модального окна подтверждения */
.confirm-modal {
    max-width: 90%;
    margin: 50px auto;
    border-radius: 15px;
    background: var(--modal-bg);
}

.confirm-header {
    background: #1565C0;
    padding: 15px;
    border-radius: 15px 15px 0 0;
    text-align: center;
}

.confirm-header h3 {
    margin: 0;
    color: white;
    font-size: 18px;
}

.confirm-body {
    padding: 20px;
}

.recipient-info {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--player-bg);
    border-radius: 10px;
}

.amount-info {
    text-align: center;
    margin-bottom: 15px;
}

.amount-label {
    font-size: 14px;
    color: var(--text-color);
    opacity: 0.7;
    margin-bottom: 5px;
}

.amount-value {
    font-size: 24px;
    font-weight: bold;
    color: #1565C0;
}

.fee-info {
    text-align: center;
    font-size: 12px;
    color: var(--text-color);
    opacity: 0.7;
    margin-bottom: 20px;
}

.confirm-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
}

.confirm-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
    width: auto;
}

.confirm-btn.cancel {
    background: #f44336;
    color: white;
}

.confirm-btn.proceed {
    background: #4CAF50;
    color: white;
}

.confirm-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

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

/* Стили для модального окна игр */
.games-modal {
    max-width: 100%;
    margin: 25% 0 0 0;
    height: 75%;
    border-radius: 20px 20px 0 0;
    background: var(--modal-bg);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.games-header {
    background: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--modal-border);
    border-radius: 20px 20px 0 0;
}

.games-title {
    font-weight: bold;
    font-size: 18px;
    color: var(--text-color);
}

.games-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-color);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.games-list {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(100% - 60px);
}

.game-item {
    display: flex;
    background: var(--player-bg);
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px var(--player-shadow);
}

.game-image {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    overflow: hidden;
    margin-right: 15px;
    flex-shrink: 0;
}

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

.game-info {
    flex: 1;
}

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

.game-description {
    font-size: 12px;
    color: var(--text-color);
    opacity: 0.8;
    margin-bottom: 10px;
    line-height: 1.3;
}

.game-buttons {
    display: flex;
    gap: 10px;
}

.game-btn {
    padding: 8px 15px;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}

.game-btn.primary {
    background: #2196F3;
}

.game-btn.secondary {
    background: #1565C0;
}

.game-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Стили для лотереи */
.lottery-header {
    background: #1565C0;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--modal-border);
}

.lottery-header h3 {
    margin: 0;
    color: white;
    font-size: 18px;
}

.lottery-back-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
}

.lottery-header-spacer {
    width: 30px;
}

.lottery-tabs {
    display: flex;
    background: var(--player-bg);
    border-bottom: 1px solid var(--modal-border);
    padding: 0 15px;
}

.lottery-tab-btn {
    flex: 1;
    padding: 12px 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    color: var(--text-color);
    position: relative;
}

.lottery-tab-btn.active {
    color: #1565C0;
}

.lottery-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 8px;
    right: 8px;
    height: 3px;
    background: #1565C0;
    border-radius: 3px 3px 0 0;
}

.lottery-content {
    padding: 15px;
    overflow-y: auto;
    max-height: calc(100vh - 200px); /* Уменьшаем высоту из-за панели баланса */
    margin-bottom: 60px; /* Отступ для панели баланса */
}

.lottery-tab-content {
    display: none;
}

.lottery-tab-content.active {
    display: block;
}

/* Стили для игры в лотерею */
.lottery-play-section {
    text-align: center;
}

.amount-section, .comment-section {
    margin-bottom: 20px;
}

.amount-label {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--text-color);
}

.lottery-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--modal-border);
    border-radius: 10px;
    background: var(--player-bg);
    color: var(--text-color);
    font-size: 16px;
    outline: none;
    text-align: center;
}

.lottery-input::placeholder {
    color: var(--text-color);
    opacity: 0.5;
}

.play-btn {
    width: 100%;
    padding: 15px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.play-btn:disabled {
    background: #cccccc !important;
    cursor: not-allowed;
    transform: none !important;
}

.play-btn:hover:not(:disabled) {
    background: #1976D2;
    transform: translateY(-1px);
}

.play-btn.success {
    background: #4CAF50 !important;
    transform: scale(1.02);
}

.play-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.lottery-stats {
    background: transparent !important; /* Прозрачный фон у всего блока */
    border-radius: 0;
    padding: 5px 0;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    text-align: center;
}

.lottery-stats .stat-item {
    display: block;
    text-align: center;
    font-size: 13px;
    white-space: nowrap;
    color: var(--text-color);
    line-height: 1.1;
    background: none;
    padding: 0;
}

.lottery-stats .stat-label {
    color: var(--text-color);
    opacity: 0.8;
    font-size: 12px;
    display: inline;
}

.lottery-stats .stat-value {
    font-weight: bold;
    color: var(--text-color);
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: 4px;
}

.stat-coin {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    object-fit: cover;
    display: inline-block;
    vertical-align: middle;
    margin-left: 1px;
}

.stat-coin, .small-coin {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0; /* Не сжимается */
}

.bets-list {
    text-align: left;
}

.no-bets {
    text-align: center;
    padding: 20px;
    color: var(--text-color);
    opacity: 0.7;
}

.bet-item {
    display: flex;
    align-items: flex-start;
    background: var(--player-bg);
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 10px;
    box-shadow: 0 1px 4px var(--player-shadow);
}

.bet-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    flex-shrink: 0;
}

.bet-info {
    flex: 1;
}

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

.bet-user {
    font-weight: bold;
    color: var(--text-color);
}

.bet-amount {
    font-size: 12px;
    color: #4CAF50;
    display: flex;
    align-items: center;
    gap: 4px;
}

.bet-chance {
    font-size: 12px;
    color: #FF9800;
    margin-bottom: 5px;
}

.bet-comment {
    font-size: 11px;
    color: var(--text-color);
    opacity: 0.7;
    font-style: italic;
    padding: 5px;
    background: rgba(0,0,0,0.05);
    border-radius: 5px;
}

[data-theme="dark"] .bet-comment {
    background: rgba(255,255,255,0.1);
}

/* Стили для победителей */
.winner-item {
    display: flex;
    align-items: flex-start;
    background: var(--player-bg);
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 10px;
    box-shadow: 0 1px 4px var(--player-shadow);
}

.winner-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    flex-shrink: 0;
}

.winner-info {
    flex: 1;
}

.winner-header {
    margin-bottom: 5px;
}

.winner-name {
    font-weight: bold;
    color: var(--text-color);
}

.winner-details {
    font-size: 12px;
    color: var(--text-color);
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.winner-time {
    font-size: 11px;
    color: var(--text-color);
    opacity: 0.7;
}

/* Стили для результатов лотереи */
.result-modal {
    max-width: 90%;
    margin: 50px auto;
    border-radius: 20px;
    background: var(--modal-bg);
    text-align: center;
}

.result-image {
    padding: 20px;
}

.result-img {
    width: 100px;
    height: 100px;
    object-fit: contain;
}

.result-content {
    padding: 0 20px 20px;
}

.result-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
}

.result-message {
    font-size: 16px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.result-close-btn {
    width: 100%;
    padding: 12px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 15px;
}

.winner-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 15px 0;
}

.winner-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    flex-shrink: 0;
}

.winner-details {
    text-align: left;
}

.winner-name {
    font-weight: bold;
    margin-bottom: 2px;
    color: var(--text-color);
}

.winner-bet, .winner-prize, .winner-chance {
    font-size: 12px;
    color: var(--text-color);
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Стили для раздела в разработке */
.in-development {
    text-align: center;
    padding: 40px 20px;
}

.dev-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.dev-text {
    font-size: 16px;
    color: var(--text-color);
    margin-bottom: 20px;
}

.dev-close-btn {
    padding: 10px 20px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.loading, .error {
    text-align: center;
    padding: 20px;
    color: var(--text-color);
}

/* Адаптивность */
@media (max-width: 480px) {
    .lottery-stats {
        padding: 10px 12px;
        gap: 3px;
    }
    
    .lottery-stats .stat-item {
        font-size: 13px;
    }
    
    .lottery-stats .stat-label {
        font-size: 12px;
    }
    
    .stat-coin {
        width: 12px;
        height: 12px;
    }
}

/* Анимации */
@keyframes slideInFromTop {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.shop-modal .modal-content {
    animation: slideInFromTop 0.3s ease-out;
}

/* Предотвращение горизонтального скролла */
body, .container, .modal-content, .shop-content {
    overflow-x: hidden;
}

/* Гарантия что ничего не выходит за пределы */
* {
    max-width: 100%;
}