body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #020c22 url('../img/bg.png') repeat;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1 {
    display: none;
}

.wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 1900px;
    margin: 0 auto;
    width: 100%;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background-color: #020c22;
    max-width: 1900px;
    margin: 0 auto;
    width: 95%;
}

.header .logo {
    width: 100px;
}

.header .game-logo {
    display: flex;
    justify-content: center;
    flex-grow: 1;
}

.header .game-logo img {
    width: 145px;
}

.game-logo-mob {
    display: none;
    justify-content: center;
    width: 145px;
    margin: auto;
}

.header .lang-panel, .header .join-btn {
    display: flex;
    align-items: center;
}

.header .join-btn {
    background-color: #FF7C1E;
    width: 160px;
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 5px;
    color: white;
    text-decoration: none;
    transition: background-color 0.3s;
    font-size: 16px;
    text-transform: uppercase;
}

.header .join-btn:hover {
    background-color: #e66c1b;
}

.banner {
    text-align: center;
    margin: 20px 20px;
}

.banner img {
    width: 100%;
    max-width: 1760px;
    height: auto;
}

.main {
    display: flex;
    justify-content: center;
    padding: 20px;
    align-items: center;
    gap: 20px;
    flex: 1;
    max-width: 1800px;
    margin: 0 auto;
    width: 98%;
}

.main .game-frame {
    width: 60%;
}

.main .advantages {
    width: 40%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.advantages .advantage {
    text-align: center;
    color: white;
    font-size: 18px;
}

.advantage img {
    width: 100%;
    max-width: 250px;
    height: auto;
}

.game-frame iframe {
    display: block;
    width: 100%;
    max-width: 1000px;
    height: 100%;
    max-height: 620px;
    aspect-ratio: 1000 / 620;
    border-radius: 8px;
    border: 4px solid #2e056c;
    margin: auto;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.7);
}

.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background-color: #020c22;
    color: white;
    font-size: 14px;
    max-width: 1920px;
    margin: 0 auto;
    width: 95%;
}

.footer .logo {
    width: 100px;
}

@media (max-width: 1100px) {
    .advantages .advantage {
        text-align: center;
        color: white;
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .main {
        flex-direction: column;
        align-items: center;
    }
    .main .game-frame {
        width: 100%;
        height: 620px;
    }
    .main .advantages {
        width: 100%;
    }
    .advantages {
        grid-template-columns: 1fr;
    }
    .advantages .advantage {
        text-align: center;
        color: white;
        font-size: 14px;
    }
    .header {
        width: 88%;
        max-width: 768px;
        margin: 0 auto;
    }
    .footer {
        width: 88%;
        max-width: 768px;
        margin: 0 auto;
        font-size: 12px;
    }
}


/* Popup Styles */
.popup {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
}

.popup-content {
    background-color: #1C2539;
    margin: auto;
    padding: 20px;
    width: 360px;
    height: 514px;
    border-radius: 15px;
    text-align: center;
    position: relative;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    width: 24px;
    height: 24px;
    cursor: pointer;
}

.close-btn:hover,
.close-btn:focus {
    opacity: 0.8;
}

.popup-img {
    width: 320px;
    height: 320px;
    border-radius: 12px;
    margin-top: 35px;
}

.popup-text {
    color: white;
    font-family: Roboto, sans-serif;
    font-weight: 500;
    font-size: 18px;
    margin: 20px 0;
}

.popup-join-btn {
    background-color: #FF7C1E;
    width: 320px;
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 5px;
    color: white;
    text-decoration: none;
    transition: background-color 0.3s;
    font-size: 18px;
    margin: 0 auto;
    text-transform: uppercase;
}

.popup-join-btn:hover {
    background-color: #e66c1b;
}

.language-selector {
    position: relative;
    display: flex;
    align-items: center;
}

.current-lang {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 0 15px; /* Добавляем паддинги для кнопки */
}

.current-lang .arrow {
    margin-left: 5px;
}

.arrow {
    transition: transform 0.3s ease; /* Добавляем плавный переход */
}

.arrow.up {
    transform: rotate(180deg); /* Поворачиваем стрелку вверх */
}

.languages-list {
    display: none;
    position: absolute;
    top: 100%;
    left: -85px;
    background-color: #1b2438;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(2, 2, 2, 0.2);
    z-index: 1;
    padding: 0;
    margin-top: 5px;
    overflow: hidden; /* Добавляем это свойство */
}

.languages-list li:first-child {
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
}

.languages-list li:last-child {
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
}

.languages-list li {
    color: white;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}

.languages-list li:hover, .languages-list li a:hover {
    background-color: #333B4C;
}

.languages-list li a {
    color: white;
    text-decoration: none;
    display: block;
}

@media (max-width: 768px) {
    .header {
        display: flex;
        justify-content: space-between; /* Выравниваем элементы по краям */
        align-items: center;
        padding: 10px; /* Уменьшаем отступы для компактности */
    }

    .header .logo {
        flex-shrink: 0; /* Логотип не должен сжиматься */
    }

    .header .lang-panel {
        display: flex;
        align-items: center;
        margin-left: auto; /* Прижимаем языковую панель вправо */
    }

    .header .join-btn {
        margin-left: 10px; /* Добавляем отступ слева, если нужно */
        min-width: 126px;
        height: 42px;
        font-size: 14px;
    }

    .header .game-logo {
        display: none; /* Скрываем основной логотип игры */
    }

    .game-logo-mob {
        display: block; /* Показываем мобильный логотип */
        width: 100%;
        text-align: center;
        margin-top: 10px; /* Добавляем отступ сверху, если нужно */
    }

    .game-logo-mob img {
        width: 145px;
    }
    .banner img {
        content: url('../img/baner2.png');   
    }
}

@media (max-width: 420px) {
    .banner img {
        content: url('../img/banerm.png');   
    }
}

@media (max-width: 700px) {
    .popup-content {
        background-color: #1C2539;
        margin: auto;
        padding: 20px;
        width: 290px;
        height: 460px;
        border-radius: 15px;
        text-align: center;
        position: relative;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    }
    .popup-img {
        width: 280px;
        height: 280px;
        border-radius: 12px;
        margin-top: 35px;
    }
    .popup-join-btn {
        background-color: #FF7C1E;
        width: 290px;
        height: 48px;
        display: flex;
        justify-content: center;
        align-items: center;
        border-radius: 5px;
        color: white;
        text-decoration: none;
        transition: background-color 0.3s;
        font-size: 18px;
        margin: 0 auto;
        text-transform: uppercase;
    }  
    .main {
        display: flex;
        justify-content: center;
        padding: 10px;
        align-items: center;
        gap: 20px;
        flex: 1;
        max-width: 1800px;
        margin: auto;
        width: 90%;
    }
    .main .game-frame {
        width: 98%;
        height: 620px;
    } 
}

.loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 16px solid #f3f3f3; /* Light grey */
    border-top: 16px solid #3498db; /* Blue */
    border-radius: 50%;
    width: 120px;
    height: 120px;
    animation: spin 2s linear infinite;
}

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

.game-frame iframe {
    display: none; /* Скрываем фрейм до загрузки */
    width: 100%;
    height: 100%;
}

.game-frame.loaded iframe {
    display: block; /* Показываем фрейм после загрузки */
}

.game-frame.loaded .loader {
    display: none; /* Скрываем элемент загрузки после загрузки фрейма */
}