/* Final responsive layer for the public website. Keep it loaded after legacy styles. */
.wrap {
    width: 100%;
    max-width: 1456px;
    padding-right: 20px;
    padding-left: 20px;
}

img,
svg,
video {
    max-width: 100%;
}

#top {
    z-index: 1000;
}

#top .navigation__burger {
    display: none;
}

.mobile-menu-backdrop {
    display: none;
}

.scrollbar {
    pointer-events: none;
}

.scrollbar .scroll-circle {
    pointer-events: auto;
}

.home-alert {
    position: relative;
    z-index: 5;
    width: min(calc(100% - 40px), 960px);
    margin: 0 auto 24px;
}

.server_about_all {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 24px;
    margin-top: 100px;
}

.s_about_item {
    width: auto;
    min-width: 0;
}

.s_about_item::after {
    display: none;
}

.s_about_item p {
    padding-right: 18px;
    padding-left: 18px;
}

#about {
    height: auto;
    min-height: 100vh;
    padding-bottom: 60px;
}

#auth {
    height: auto;
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    padding-bottom: 80px;
}

.auth-block .form-group,
.auth-block .form-group input,
.auth-block .check-block,
.auth-block .checkbox-container {
    width: 100%;
    max-width: 420px;
}

.auth-block .form-group input {
    min-width: 0;
}

.auth-block .alert-red {
    width: 100%;
    max-width: 420px;
    margin: 8px auto;
    color: #ff8c8c;
    text-align: left;
}

.auth-block .auth-form {
    width: min(100%, 420px);
    margin-right: auto;
    margin-left: auto;
}

.auth-block .g-recaptcha {
    margin-right: auto;
    margin-left: auto;
}

.auth-block .log-in-buttons {
    display: flex;
    justify-content: center;
}

.auth-block .log-in-buttons .link-auth {
    margin-right: auto;
    margin-left: auto;
}

#donate {
    flex: 0 0 auto;
    height: auto;
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    overflow: visible;
}

.payment-result-page {
    display: flex;
    justify-content: center;
}

.payment-result-page .payment-pay {
    width: min(100%, 720px);
}

/* Keep the homepage hero stable across viewport widths and browser zoom. */
#bg {
    display: grid;
    grid-template-rows: minmax(min-content, 1fr) auto;
    height: auto;
    min-height: 100vh;
    min-height: 100svh;
    padding-top: 93px;
}

#bg .main-text {
    height: auto;
    min-height: 0;
    padding: clamp(20px, 4svh, 48px) 72px clamp(20px, 3svh, 36px);
}

#bg .main-text > img {
    width: min(397px, 100%);
    height: auto;
}

#bg .main-text h3 {
    margin-top: clamp(8px, 1.5svh, 15px);
    margin-bottom: clamp(10px, 2svh, 20px);
}

#bg .main-text .link-auth {
    margin-top: clamp(20px, 5svh, 50px) !important;
}

#bg .server_rates {
    position: relative;
    inset: auto;
    padding: 0 72px clamp(24px, 5svh, 60px);
}

#bg .rate-all {
    margin-top: clamp(14px, 3svh, 30px);
}

#top .mobile-drawer-only,
#top .mobile-menu-only,
#top .mobile-drawer-label {
    display: none;
}

@media (max-width: 1199px) {
    .wrap {
        max-width: 100%;
    }

    #top .top-line {
        display: grid;
        grid-template-columns: 40px minmax(150px, 202px) minmax(0, 1fr);
        gap: 20px;
    }

    #top .top-l,
    #top .top-r,
    #top .logo {
        width: auto;
    }

    #top .logo {
        display: block;
        min-width: 0;
    }

    #top .logo img {
        width: 100%;
        height: auto;
    }

    #top .top-r {
        gap: 18px;
        min-width: 0;
    }

    #top .top-r .nav-link {
        display: none;
    }

    #top .top-r .link-files {
        display: none;
    }

    body.mobile-menu-open {
        overflow: hidden;
    }

    #top .mobile-menu-backdrop {
        position: fixed;
        inset: 0;
        z-index: 9998;
        display: block;
        width: 100vw;
        height: 100vh;
        padding: 0;
        border: 0;
        background: rgba(6, 6, 10, 0.68);
        opacity: 0;
        pointer-events: none;
        transition: opacity .25s ease;
    }

    #top .mobile-menu-backdrop.active {
        opacity: 1;
        pointer-events: auto;
    }

    #top .menu {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 9999;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        width: min(360px, 82vw);
        height: 100vh;
        height: 100dvh;
        padding: 18px 38px 22px;
        overflow-y: auto;
        overflow-x: hidden;
        box-sizing: border-box;
        border-radius: 0 16px 16px 0;
        background:
            radial-gradient(circle at 68% 5%, rgba(151, 146, 158, 0.38), transparent 27%),
            linear-gradient(180deg, #37343c 0%, #29262e 43%, #1c1a20 100%);
        box-shadow: 18px 0 44px rgba(0, 0, 0, 0.4);
        transform: translateX(-100%);
        transition: transform .28s ease-in-out;
        list-style: none;
    }

    #top .top-line .top-r > .nav__langs {
        display: none !important;
    }

    #top .menu .nav-item {
        width: 100%;
        border: 0;
    }

    #top .menu .nav-item:last-child {
        border-bottom: 0;
    }

    #top .menu .nav-link {
        display: flex;
        min-height: 46px;
        padding: 7px 8px;
        gap: 14px;
        color: rgba(226, 229, 252, 0.9);
        font-size: 13px;
        line-height: 1.25;
        text-transform: uppercase;
    }

    #top .menu .nav-link::after {
        display: none;
    }

    #top .menu .nav-link img {
        flex: 0 0 20px;
        width: 20px;
        height: 20px;
        object-fit: contain;
    }

    #top .menu .desktop-menu-label {
        display: none;
    }

    #top .menu .mobile-drawer-label {
        display: inline;
    }

    #top .menu .mobile-drawer-only {
        display: flex;
    }

    #top .mobile-menu-brand {
        order: 1;
        align-items: flex-start;
        min-height: 68px;
        padding-left: 40px;
    }

    #top .mobile-menu-brand a {
        display: block;
        width: 170px;
    }

    #top .mobile-menu-brand img {
        display: block;
        width: 100%;
        height: auto;
    }

    #top .mobile-menu-divider {
        position: relative;
        flex: 0 0 1px;
        width: 100%;
        height: 1px;
        background: linear-gradient(90deg, transparent, rgba(226, 229, 252, 0.55), transparent);
    }

    #top .mobile-menu-divider::after {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        width: 5px;
        height: 5px;
        border: 1px solid rgba(226, 229, 252, 0.72);
        background: #302d35;
        transform: translate(-50%, -50%) rotate(45deg);
    }

    #top .mobile-menu-divider--top {
        order: 2;
        margin: 26px 0 22px;
    }

    #top .nav-donate {
        order: 3;
    }

    #top .nav-media {
        order: 4;
    }

    #top .nav-forum {
        order: 5;
    }

    #top .nav-informer {
        order: 6;
    }

    #top .nav-support {
        order: 7;
    }

    #top .nav-statistics,
    #top .mobile-files-nav {
        display: none !important;
    }

    #top .mobile-menu-divider--bottom {
        order: 8;
        margin: 22px 0 33px;
    }

    #top .mobile-menu-socials {
        order: 9;
        align-items: center;
        justify-content: center;
        gap: 26px;
    }

    #top .mobile-menu-socials a {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 22px;
        height: 22px;
    }

    #top .mobile-menu-socials img {
        max-width: 22px;
        max-height: 22px;
        object-fit: contain;
    }

    #top .mobile-menu-language {
        position: relative;
        order: 10;
        justify-content: center;
        margin-top: auto;
        padding-top: 22px;
    }

    #top .mobile-menu-language details {
        position: relative;
    }

    #top .mobile-menu-language summary,
    #top .mobile-menu-language__options button {
        display: flex;
        align-items: center;
        min-height: 28px;
        gap: 8px;
        color: rgba(226, 229, 252, 0.9);
        font-size: 12px;
        cursor: pointer;
    }

    #top .mobile-menu-language__options form {
        margin: 0;
    }

    #top .mobile-menu-language__options button {
        width: 100%;
        padding: 0;
        border: 0;
        background: none;
        font: inherit;
        text-align: left;
    }

    #top .mobile-menu-language summary::-webkit-details-marker {
        display: none;
    }

    #top .mobile-menu-language summary::after {
        content: "";
        width: 6px;
        height: 6px;
        margin-left: 2px;
        border-right: 1px solid rgba(226, 229, 252, 0.8);
        border-bottom: 1px solid rgba(226, 229, 252, 0.8);
        transform: translateY(-2px) rotate(45deg);
    }

    #top .mobile-menu-language details[open] summary::after {
        transform: translateY(2px) rotate(225deg);
    }

    #top .mobile-menu-language summary img,
    #top .mobile-menu-language__options img {
        flex: 0 0 16px;
        width: 16px;
        height: 16px;
        border-radius: 50%;
        object-fit: cover;
    }

    #top .mobile-menu-language__options {
        position: absolute;
        bottom: calc(100% + 6px);
        left: 50%;
        min-width: 92px;
        padding: 7px 10px;
        border: 1px solid rgba(226, 229, 252, 0.14);
        border-radius: 8px;
        background: rgba(24, 22, 28, 0.98);
        transform: translateX(-50%);
    }

    #top ul.menu.active {
        transform: translateX(0);
    }

    #top .navigation__burger {
        display: block;
    }

    #top .gw-burger {
        position: relative;
        z-index: 10000;
        display: block;
        width: 40px;
        height: 40px;
        padding: 0;
        border: 0;
        outline: 0;
        background: transparent;
        cursor: pointer;
        box-sizing: border-box;
    }

    #top .gw-burger_active {
        position: fixed;
        top: 20px;
        left: 20px;
    }

    #top .gw-burger__line {
        position: absolute;
        left: 8px;
        width: 24px;
        height: 2px;
        border-radius: 2px;
        background-color: #aaa7ad;
        transition: all .3s;
    }

    #top .gw-burger__line_pos_top {
        top: 32%;
        pointer-events: none;
    }

    #top .gw-burger__line_pos_middle {
        top: 50%;
        transform: translateY(-50%);
        pointer-events: none;
    }

    #top .gw-burger__line_pos_bottom {
        bottom: 32%;
        pointer-events: none;
    }

    #top .gw-burger_active .gw-burger__line_pos_top {
        top: 50%;
        transform: rotate(45deg) translateY(-50%);
        transform-origin: center top;
    }

    #top .gw-burger_active .gw-burger__line_pos_middle {
        opacity: 0;
        transform: rotate(180deg);
    }

    #top .gw-burger_active .gw-burger__line_pos_bottom {
        bottom: 50%;
        transform: rotate(-45deg) translateY(50%);
        transform-origin: center bottom;
    }

    #top .menu .nav-link:hover {
        color: #ffffff;
    }

    .server_about_all {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        margin-top: 70px;
    }
}

@media (max-width: 900px) {
    #top {
        height: 76px;
    }

    #top > .wrap {
        height: 100%;
    }

    #top .top-line {
        align-items: center;
        grid-template-columns: 40px minmax(130px, 180px) minmax(0, 1fr);
        gap: 12px;
        height: 100%;
        margin-top: 0;
    }

    #top .top-l,
    #top .logo,
    #top .top-r {
        align-self: center;
        height: 40px;
    }

    #top .top-l,
    #top .logo,
    #top .logo a,
    #top .top-r {
        display: flex;
        align-items: center;
    }

    #top .logo,
    #top .logo a {
        justify-content: center;
    }

    #top .logo a {
        width: 100%;
        height: 100%;
        line-height: 0;
    }

    #top .logo img {
        display: block;
        max-height: 40px;
    }

    #top .top-r {
        justify-content: flex-end;
    }

    #top .top-r .link-account {
        flex: 0 0 105px;
        margin: 0;
    }

    #top .top-r .public-account-profile {
        flex: 0 1 150px;
        margin: 0;
        justify-content: flex-end;
    }

    #bg {
        padding-top: 76px;
    }

    #bg .main-text {
        padding-right: clamp(20px, 6vw, 48px);
        padding-left: clamp(20px, 6vw, 48px);
    }

    #bg .server_rates {
        padding-right: clamp(20px, 6vw, 48px);
        padding-left: clamp(20px, 6vw, 48px);
    }

    #bg .socials,
    #bg .scrollbar {
        display: none;
    }

    .auth-block {
        flex-wrap: wrap;
        gap: 40px;
    }

    .auth-block > * {
        width: 100%;
    }
}

@media (max-width: 767px) {
    .wrap {
        padding-right: 15px;
        padding-left: 15px;
    }

    #bg .main-text {
        padding: clamp(18px, 3svh, 36px) 20px clamp(12px, 2svh, 24px);
    }

    #bg .server_rates {
        padding: 0 15px clamp(16px, 3svh, 32px);
    }

    #bg .rate-all {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: clamp(8px, 3vw, 20px);
    }

    #bg .r-item {
        min-width: 0;
    }

    #bg .r-item h4 {
        font-size: clamp(26px, 7vw, 32px);
    }

    #bg .r-item p {
        font-size: clamp(11px, 2.5vw, 14px);
        line-height: 1.25;
    }

    #top .top-line {
        grid-template-columns: 40px minmax(120px, 150px) minmax(105px, 1fr);
        gap: 10px;
    }

    #top .top-r {
        gap: 10px;
    }

    #top .top-r .nav-link {
        display: none;
    }

    .server_about_all {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-top: 40px;
    }

    .about_server .title-center {
        margin-top: 50px;
    }
}

@media (max-width: 480px) {
    #top {
        position: fixed;
        height: 76px;
    }

    #top .top-line {
        grid-template-columns: 40px 110px minmax(105px, 1fr);
        gap: 8px;
    }

    #top .logo {
        display: flex;
    }

    #top .nav__langs {
        display: none;
    }

    #top .public-account-profile {
        max-width: 100%;
        font-size: 13px;
    }

    #top .mobile-files-nav {
        display: list-item !important;
        order: 4;
    }

    .server_about_all {
        grid-template-columns: 1fr;
    }

    .s_about_item {
        width: 100%;
    }

    .auth-block .g-recaptcha {
        width: 304px;
        max-width: 100%;
        overflow: hidden;
    }
}

@media (max-width: 340px) {
    .auth-block .g-recaptcha {
        margin-bottom: -9px;
        transform: scale(.88);
        transform-origin: center top;
    }
}

@media (min-width: 1200px) and (max-height: 760px) {
    #bg,
    #about {
        height: auto;
        min-height: 760px;
    }
}

/* Homepage server information buttons */
.about_server > .link-media {
    box-sizing: border-box;
    flex: 0 0 64px;
    width: 258px;
    max-width: calc(100vw - 40px);
    min-height: 64px;
    height: 64px;
    padding: 0 16px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 258px 64px;
    text-align: center;
}

.about_server > .link-media span {
    display: block;
    width: 100%;
    font-size: 17px;
    line-height: 1.2;
    text-align: center;
    hyphens: none;
}

@media (max-width: 480px) {
    .about_server > .link-media span {
        font-size: 15px;
    }
}

#media {
    height: auto;
    min-height: 100vh;
    padding-bottom: 60px;
}

.link-media,
.link-auth {
    max-width: 100%;
    min-height: 64px;
    height: auto;
    padding: 10px 28px;
    background-size: 100% 100%;
    text-align: center;
    line-height: 1.2;
    white-space: normal;
}

.link-media span,
.link-auth span {
    line-height: 1.2;
    text-align: center;
    white-space: normal;
}

@media (max-width: 1199px) {
    .streamers {
        flex-wrap: wrap;
    }
}

@media (min-width: 768px) and (max-width: 900px) {
    .rate-all {
        flex-wrap: wrap;
        gap: 16px 24px;
    }
}

@media (max-width: 767px) {
    .stream-item,
    .media_page .stream-item img {
        width: 100%;
        max-width: 100%;
        height: auto;
    }
}
