/**
 * MOBILE CRASH GAME STYLES
 */

/* UNIVERSAL GAME CONTAINER - для всех игр */
.mobile-game-container {
    position: fixed;
    top: 60px; /* Высота header */
    left: 0;
    right: 0;
    bottom: 80px; /* Высота pin-bar */
    background: #0f0515;
    z-index: 999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mobile-game-content {
    flex: 1;
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.mobile-game-content iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #0f0515;
}

/* Старый класс для обратной совместимости */
.mobile-crash-container {
    position: fixed;
    top: 60px; /* Высота header */
    left: 0;
    right: 0;
    bottom: 80px; /* Высота pin-bar */
    background: #0f0515;
    z-index: 999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mobile-crash-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: rgba(26, 15, 46, 0.95);
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
    flex-shrink: 0;
}

.mobile-crash-back {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    color: #8b5cf6;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.2s;
}

.mobile-crash-back:active {
    background: rgba(139, 92, 246, 0.1);
}

.mobile-crash-back svg {
    width: 20px;
    height: 20px;
}

.mobile-crash-header h3 {
    flex: 1;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.mobile-crash-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 0;
    margin-top: 0; /* Убираем т.к. container уже имеет padding-top */
    margin-bottom: 0; /* Убираем отступ снизу */
    height: 100%;
}

/* Адаптация стилей игры для мобильных */
@media (max-width: 1200px) {
    .mobile-crash-content .wrapper {
        max-width: 100%;
        padding: 0;
        margin: 0;
    }
    
    .mobile-crash-content .crash {
        margin-top: 0 !important;
    }
    
    .mobile-crash-content .crash__top {
        flex-direction: column;
        gap: 20px;
    }
    
    .mobile-crash-content .crash__left,
    .mobile-crash-content .crash__right {
        width: 100%;
        max-width: none;
    }
    
    .mobile-crash-content .crash__canvas {
        width: 100%;
        height: 300px;
        border-radius: 16px;
        overflow: hidden;
    }
    
    .mobile-crash-content canvas#crashChart {
        max-width: 100%;
    }
    
    /* Инпуты */
    .mobile-crash-content .bx-input__input input {
        font-size: 16px;
        padding: 12px;
    }
    
    /* Кнопки */
    .mobile-crash-content .btn {
        padding: 14px 20px;
        font-size: 16px;
        min-height: 50px;
    }
    
    /* История */
    .mobile-crash-content .crash__history {
        width: 100%;
    }
    
    .mobile-crash-content .crash__scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* История пользователей */
    .mobile-crash-content .crash__history-users {
        margin-top: 20px;
    }
}

/* Кнопка закрытия игры в header */
.mobile-game-close {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.15);
    border: none;
    color: #8b5cf6;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}

.mobile-game-close:active {
    background: rgba(139, 92, 246, 0.25);
    transform: translateY(-50%) scale(0.95);
}

.mobile-game-close svg {
    width: 20px;
    height: 20px;
}

/* Когда игра открыта - фиксируем header чтобы не пропадал при фокусе на input */
body.game-opened .mobile-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1001 !important;
}

/* Когда игра открыта - скрываем фиолетовый контейнер с надписями */
body.game-opened .pin-bar-labels-container {
    display: none !important;
}

/* Отступ для контейнера с учетом высоты tab bar БЕЗ надписей */
body.game-opened .mobile-crash-container {
    bottom: 50px; /* Высота плашки только с иконками */
}

/* Анимация загрузки */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(0.95);
    }
}








