/**
 * Crash Game Styles
 * Стили для игры Crash
 */

/* ========== ПЛАТФОРМО-ЗАВИСИМЫЕ ПОЗИЦИИ ========== */

#crash-screen {
    min-height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    background: 
        url('../assets/bg-crash.svg') center top / cover no-repeat fixed,
        linear-gradient(180deg, #0a0a1f 0%, #12102a 30%, #1a1535 60%, #0d0d1a 100%) !important;
}

#crash-screen header {
    top: 25px !important;
    background: transparent !important;
    padding: 8px 12px !important;
}
#crash-screen header::before { display: none !important; }

/* iOS: настройка позиций */
html[data-platform="ios"] #crash-screen header {
    top: 90px !important;
}

/* Android: настройка позиций */
html[data-platform="android"] #crash-screen header {
    top: 70px !important;
}

/* ========== ОСНОВНОЙ ЛЕЙАУТ ========== */

.crash-main {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    padding: 45px 8px 10px 8px;
    box-sizing: border-box;
}

html[data-platform="ios"] .crash-main {
    padding-top: 75px;
}

html[data-platform="android"] .crash-main {
    padding-top: 55px;
}

/* Контейнер игры */
#crash-game-container {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    position: relative;
    transition: box-shadow 0.3s ease;
}

#crash-canvas {
    width: 100%;
    height: 300px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(138, 43, 226, 0.3);
    border-radius: 12px;
}

/* ========== МНОЖИТЕЛЬ ========== */

#crash-multiplier {
    font-size: 3rem;
    font-weight: bold;
    text-shadow: 0 0 20px currentColor;
    transition: color 0.2s ease, text-shadow 0.2s ease;
}

/* ========== ИСТОРИЯ КРЭШЕЙ ========== */

#crash-history {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
}

#crash-history span {
    transition: transform 0.2s ease;
}

#crash-history span:hover {
    transform: scale(1.1);
}

/* ========== КОНТРОЛЫ ========== */

.crash-controls {
    flex-shrink: 0;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.crash-settings {
    padding: 12px !important;
}

/* ========== КНОПКА ДЕЙСТВИЯ ========== */

#crash-action-btn {
    transition: all 0.2s ease;
    border-radius: 12px;
}

#crash-action-btn.animate-pulse {
    animation: crash-pulse 0.5s ease-in-out infinite;
}

@keyframes crash-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* ========== АВТО-ВЫВОД ========== */

.crash-auto-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.crash-auto-container input[type="number"] {
    width: 80px;
    text-align: center;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 6px;
    color: white;
}

.crash-auto-container input[type="number"]:disabled {
    opacity: 0.5;
}

/* ========== ЭФФЕКТ ТРЯСКИ ========== */

.crash-shake {
    animation: crash-shake 0.5s ease-in-out;
}

@keyframes crash-shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* ========== РЕЗУЛЬТАТ (поверх игрового поля) ========== */

#crash-result {
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#crash-result.visible {
    opacity: 1;
}

#crash-result-text {
    text-shadow: 
        0 0 10px currentColor,
        0 2px 4px rgba(0, 0, 0, 0.8);
    padding: 8px 16px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.6);
}

/* ========== СТАТИСТИКА СЕССИИ ========== */

.crash-session-stats {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    padding: 8px 12px;
}

/* ========== КНОПКИ СТАВКИ ========== */

.crash-bet-btn {
    width: 48px;
    height: 40px;
    background: rgba(75, 85, 99, 0.8);
    border-radius: 8px;
    font-size: 1.5rem;
    font-weight: bold;
    transition: all 0.2s ease;
}

.crash-bet-btn:hover {
    background: rgba(107, 114, 128, 0.9);
}

.crash-bet-btn:active {
    transform: scale(0.95);
}

/* ========== ПЕРЕКЛЮЧАТЕЛЬ АВТО-ВЫВОДА ========== */

.crash-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    background: rgba(75, 85, 99, 0.8);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.crash-toggle:checked {
    background: #8b5cf6;
}

.crash-toggle::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s ease;
}

.crash-toggle:checked::before {
    transform: translateX(20px);
}

/* ========== АДАПТИВНОСТЬ ========== */

@media (max-height: 700px) {
    #crash-canvas {
        height: 160px;
    }
    
    #crash-multiplier {
        font-size: 2.5rem;
    }
    
    .crash-settings {
        padding: 8px !important;
    }
}

@media (max-height: 600px) {
    #crash-canvas {
        height: 140px;
    }
    
    #crash-multiplier {
        font-size: 2rem;
    }
}
