/* --- Start Game Grid Layout --- */
.grd_start_game {
    display: grid;
    /* Улучшенная пропорция для десктопа */
    grid-template-columns: 1fr 320px; 
    gap: 20px;
    align-items: center;
}

.box_h_start_game {
    min-height: auto;
}

.h1_start_game {
    font-size: 28px;
    color: #fff;
    font-family: "Unbounded", sans-serif;
    margin: 0; /* Убираем дефолтные маргины h1 */
}

/* --- Download Button --- */
.buttons_download {
    margin-top: 30px;
    width: 270px;
    display: flex; /* Flexbox проще для выравнивания */
    gap: 0.5em;
    background: #438CFF;
    padding: 10px 15px; /* Улучшенный padding */
    color: #fff;
    text-decoration: none;
    align-items: center;
    border-radius: 4px;
    transition: box-shadow 0.3s ease-out, transform 0.3s ease-out;
    will-change: transform, box-shadow; /* Подсказка браузеру об анимации */
}

.buttons_download i {
    font-size: 34px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.buttons_download p {
    font-size: 14px;
    font-family: "Unbounded", sans-serif;
    margin: 0;
}

.buttons_download p b {
    font-size: 17px;
    display: block; /* Перенос жирного текста на новую строку для лучшего вида */
    font-weight: 600;
}

.buttons_download:hover {
    box-shadow: rgb(255 255 255 / 40%) 0px 4px 20px; /* Улучшенная тень */
    transform: translateY(-5px); /* Более чистая запись */
}

/* --- Info Texts --- */
.windows_info {
    margin-top: 16px;
    font-size: 12px;
    color: #ec9107;
    font-family: "Unbounded", sans-serif;
    opacity: 0.9; /* Не 1, а 0.9 для мягкости */
}

.windows_info_download {
    margin-top: 30px;
    font-family: "Unbounded", sans-serif;
    color: #fff;
    font-size: 13px; /* Чуть меньше для иерархии */
    line-height: 1.4;
}

.windows_info_download a {
    font-family: "Unbounded", sans-serif;
    color: #fff;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.windows_info_download a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* --- Island Image Animation --- */
.img_ostrov_main{
    display: flex;
    justify-content: flex-end;
}

.img_ostrov {
    width: 281px;
    height: 377px;
    /* Рекомендуется использовать локальное изображение для скорости загрузки */
    background-image: url(../image/background/ostrov.png);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    animation: floatIsland 6s infinite ease-in-out; /* Изменено название анимации и тайминг-функция */
    will-change: transform, filter;
}

/* Удалены неиспользуемые классы img_ostrov2 и a_sv */


@keyframes floatIsland {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        filter: drop-shadow(0 4px 6px rgba(0, 128, 0, 0.493));
    }
    25% {
        transform: translateY(-2px) rotate(1deg);
    }
    50% {
        transform: translateY(-7px) rotate(-1deg);
        filter: drop-shadow(0 6px 12px rgba(0, 128, 0, 0.6));
    }
    75% {
        transform: translateY(-4px) rotate(1deg);
    }
}

/* --- Media Queries --- */
@media(max-width: 760px) {
    .grd_start_game {
        /* Переключаемся на одну колонку на планшетах/мобильных */
        grid-template-columns: 1fr; 
    }
    .img_ostrov_main {
        display: none; /* Скрываем изображение острова, чтобы освободить место */
    }
    .h1_start_game {
        font-size: 22px;
    }
    .buttons_download {
        width: 100%; /* Кнопка занимает всю доступную ширину */
        max-width: 350px;
    }
}


/* Фоновая подложка */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; 
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px); /* Усилили блюр для глубины */
    -webkit-backdrop-filter: blur(10px); /* Поддержка Safari/iOS */
    z-index: 9999;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 15px; /* Отступ, чтобы окно не липло к краям на мобилках */
    box-sizing: border-box;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-box {
    background: linear-gradient(145deg, #1e1e1e, #121212);
    padding: 40px 30px;
    border-radius: 24px;
    max-width: 420px;
    width: 100%; /* Резиновая ширина */
    text-align: center;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    transform: translateY(30px) scale(0.9);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-box {
    transform: translateY(0) scale(1);
}

/* Иконка (адаптирована под мобильные) */
.modal-icon-circle {
    width: 64px;
    height: 64px;
    background: #4CAF50;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: -72px auto 20px; 
    font-size: 26px;
    color: white;
    box-shadow: 0 0 25px rgba(76, 175, 80, 0.5);
    border: 4px solid #161616; /* Чтобы круг не сливался с фоном при наложении */
}

.close-modal {
    position: absolute; right: 15px; top: 15px;
    width: 30px; height: 30px;
    font-size: 28px; cursor: pointer; color: #555;
    display: flex; align-items: center; justify-content: center;
    transition: color 0.2s, transform 0.2s;
}
.close-modal:hover { color: #fff; transform: rotate(90deg); }

.modal-title { color: #fff; font-size: clamp(20px, 5vw, 24px); margin-bottom: 10px; font-weight: 700; }
.modal-text { color: #aaa; font-size: 15px; line-height: 1.5; margin-bottom: 25px; padding: 0 5px; }

.modal-buttons { display: flex; flex-direction: column; gap: 10px; }

.m-btn {
    padding: 16px;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s ease;
    display: block;
    -webkit-tap-highlight-color: transparent; /* Убираем синий блик при нажатии на iOS */
}

.m-btn-content {
    display: flex; align-items: center; justify-content: center; gap: 12px;
}

.m-primary {
    background: #4CAF50;
    color: white;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}
.m-primary:active { transform: scale(0.98); } /* Эффект нажатия */

.m-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: #eee;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-footer-info {
    margin-top: 20px; font-size: 11px; color: #555; text-transform: uppercase; letter-spacing: 1px;
}

/* --- АДАПТИВНОСТЬ ДЛЯ МОБИЛЬНЫХ --- */

@media (max-width: 480px) {
    .modal-box {
        padding: 35px 20px 20px; /* Уменьшаем внутренние отступы */
        border-radius: 20px;
    }
    
    .modal-icon-circle {
        width: 56px; height: 56px;
        margin: -63px auto 15px;
        font-size: 22px;
    }

    .modal-text { font-size: 14px; margin-bottom: 20px; }
    
    .m-btn { padding: 14px; } /* Кнопки чуть компактнее */
    
    .close-modal { top: 10px; right: 10px; }
}

/* Если телефон повернут горизонтально (малая высота экрана) */
@media (max-height: 500px) {
    .modal-icon-circle { display: none; } /* Убираем иконку, чтобы влез текст */
    .modal-box { padding: 25px 20px; margin-top: 10px; }
    .modal-title { font-size: 18px; margin-bottom: 5px; }
    .modal-text { margin-bottom: 15px; }
}