/*
 * Responsive layout for public/template/default.
 * Loaded after public.css and home.css.
 * Main tweak points are marked as CONTROL.
 */

html {
    overflow-x: hidden;
    text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
    min-width: 320px;
}

.wrapper,
main,
.header,
.footer,
#main,
#content,
#social-network,
.news_block,
#server-status,
.server-block,
.swiper-container,
.swiper-main,
.footer_all,
.banners_rating,
.subs-all {
    min-width: 0;
}

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

.wrap {
    width: min(1320px, 100%);
    max-width: 1320px;
    box-sizing: border-box;
    padding-left: clamp(14px, 2.2vw, 30px);
    padding-right: clamp(14px, 2.2vw, 30px);
}

.top_line {
    gap: clamp(10px, 2vw, 25px);
    min-width: 0;
}

.top_menu,
.top_right,
.top--right-menu,
.acp-panel-top,
.nav__langs {
    min-width: 0;
}

.nav-link,
.btn-red,
.btn-golden,
.nav__langs-item {
    white-space: nowrap;
}

.nav__langs-stroke {
    z-index: 10020;
}

.main_content_all {
    align-items: stretch;
    min-width: 0;
}

.news_block,
#server-status {
    min-width: 0;
}

#server-status {
    display: block;
}

.server-block {
    width: 100%;
    overflow: hidden;
}

.server_item,
.server-i-top,
.server_t {
    min-width: 0;
}

.server_title,
.server_t a,
.sisic__title,
.sisic__text {
    overflow-wrap: anywhere;
}

.swiper-main {
    width: 100%;
    max-width: 100%;
    border-radius: 8px;
}

.swiper-slide img {
    object-fit: cover;
}

.news_all {
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
}

.news_img {
    height: clamp(170px, 22vw, 220px);
}

.text-block,
.startgame_container,
.about_block {
    max-width: 100%;
}

.startgame_container p {
    max-width: min(800px, 100%);
}

/* Desktop geometry: keep the old full-size layout. */
@media only screen and (min-width: 1025px) {
    .wrap {
        width: 1320px;
        max-width: 1320px;
        padding-left: 15px;
        padding-right: 15px;
    }

    .logo img,
    img.logo-top {
        height: 300px;
        margin-top: 30px;
    }

    .main-start {
        margin-top: -45px;
    }

    .main_content_all {
        gap: 20px;
        align-items: stretch;
    }

    .news_block,
    #server-status {
        width: calc(50% - 10px);
    }
}

@media only screen and (max-width: 1350px) and (min-width: 1025px) {
    .wrap {
        width: 100%;
        max-width: 1320px;
        padding-left: 15px;
        padding-right: 15px;
    }
}

@media only screen and (max-width: 1360px) {
    .top_menu {
        gap: 16px;
    }

    .nav-link {
        font-size: 16px;
    }

    .nav-link svg {
        width: 19px;
        height: 19px;
        flex: 0 0 auto;
    }

    .top_right,
    .top--right-menu {
        gap: 14px;
    }
}

@media only screen and (max-width: 1180px) {
    .top_menu {
        gap: 12px;
    }

    .nav-link {
        font-size: 14px;
        gap: 5px;
    }

    .nav-link svg {
        width: 17px;
        height: 17px;
    }

    .btn-red,
    .btn-golden,
    .dropdown-toggle,
    .nav__langs-item {
        height: 32px;
        font-size: 12px;
    }

    .btn-red,
    .btn-golden,
    .dropdown-toggle {
        padding-left: 14px;
        padding-right: 14px;
    }

    .nav__langs-item {
        gap: 6px;
    }

    .nav__langs-item img {
        width: 20px;
    }

    .logo img {
        height: 235px;
    }

    .main_content_all {
        gap: 16px;
    }

    .server_title {
        font-size: 13px;
    }

    .server_t a {
        font-size: 12px;
    }

    .server_brand {
        left: 8px;
        right: 8px;
        gap: 6px;
    }
}

@media only screen and (max-width: 1024px) {
    header.header {
        position: sticky;
        top: 0;
        z-index: 10000;
    }

    .top_line {
        min-height: 52px;
    }

    .gw-burger,
    .navigation__burger {
        display: block;
        flex: 0 0 40px;
    }

    .top_menu {
        max-width: calc(100vw - 34px);
        overflow-y: auto;
        overscroll-behavior: contain;
        padding-bottom: 28px;
    }

    .top_menu .nav-item {
        width: 100%;
    }

    .top_menu .nav-link {
        width: 100%;
        justify-content: flex-start;
        padding: 10px 0;
        font-size: 17px;
    }

    .top_menu .nav-link svg {
        width: 20px;
        height: 20px;
    }

    .top_right {
        margin-left: auto;
        gap: 12px;
    }

    .main_content_all {
        flex-direction: column;
        gap: 20px;
        margin-top: 0;
    }

    #server-status {
        order: 1;
    }

    .news_block {
        order: 2;
    }

    .news_block,
    #server-status {
        width: 100%;
    }

    .swiper-main {
        height: clamp(230px, 38vw, 340px);
    }

    .server-block {
        height: auto;
        min-height: 0;
    }

    .server_item {
        width: 50%;
        min-height: 140px;
    }

    .server-i-top {
        padding-top: 50px;
        padding-left: 12px;
        padding-right: 12px;
    }

    .main-text p {
        margin-top: 0;
    }

    .footer_all {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 26px 30px;
    }

    .menu-footer {
        width: auto;
        margin-bottom: 0;
    }
}

@media only screen and (max-width: 820px) {
    .wrap {
        padding-left: 18px;
        padding-right: 18px;
    }

    .top--right-menu .nav-item {
        display: none;
    }

    .btn-red {
        height: 32px;
        padding-left: 12px;
        padding-right: 12px;
        font-size: 12px;
    }

    .nav__langs-item {
        height: 32px;
    }

    .logo img {
        height: clamp(160px, 31vw, 220px);
    }

    .btn-main {
        padding: 18px 34px;
    }

    .swiper-info {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }

    .sisic__title {
        font-size: 20px;
        line-height: 1.15;
    }

    .sisic__text {
        font-size: 14px;
        line-height: 1.35;
        margin-bottom: 18px;
    }

    .subscribers {
        margin: 34px 0;
    }

    .sub_item {
        height: 154px;
        padding-left: 20px;
    }

    .sub_item > img {
        max-width: 46px;
    }

    .sub-title p {
        font-size: 15px;
    }

    .video-panel {
        width: 82%;
        max-width: none;
        top: 58px;
        padding: 14px;
    }
}

@media only screen and (max-width: 675px) {
    .wrap {
        padding-left: 14px;
        padding-right: 14px;
    }

    .top_line {
        gap: 8px;
    }

    .top_right {
        gap: 8px;
    }

    .btn-red {
        min-width: 0;
        padding-left: 10px;
        padding-right: 10px;
    }

    .server_item {
        width: 100%;
        min-height: 126px;
        border-right: 0;
        border-bottom: 1px solid rgb(255 255 255 / 20%);
    }

    .server_item:last-child {
        border-bottom: 0;
    }

    .server-i-top {
        padding-top: 48px;
        padding-left: 12px;
        padding-right: 12px;
        gap: 8px;
    }

    .server_img {
        width: 72px;
        height: 72px;
        flex: 0 0 72px;
    }

    .server_img img {
        max-width: 44px;
    }

    .server_brand {
        align-items: flex-start;
    }

    .server-status-switch {
        right: 12px;
    }

    .swiper-main {
        height: auto;
        aspect-ratio: 16 / 10;
        min-height: 230px;
        max-height: 310px;
    }

    .swiper-info {
        position: absolute;
        left: 14px;
        right: 14px;
        bottom: 14px;
        padding: 0;
        text-align: left;
        align-items: flex-start;
    }

    .sisic__title {
        font-size: 18px;
    }

    .sisic__text {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin-bottom: 14px;
    }

    .swiper-pagination {
        bottom: 12px;
        right: 12px;
        left: auto;
        width: auto;
        text-align: right;
    }

    .swiper-pagination-bullet {
        width: 9px;
        height: 9px;
        margin: 0 4px;
    }

    .btn-golden {
        height: 32px;
        padding-left: 14px;
        padding-right: 14px;
        font-size: 12px;
    }

    #content {
        padding: 30px 0 46px;
    }

    .main-start {
        margin-top: 0;
    }

    .main-text p {
        font-size: 20px;
    }

    .subs-all {
        gap: 16px;
    }

    .sub_item {
        width: 100%;
        margin-bottom: 0;
    }

    .footer {
        padding-top: 24px;
    }
}

@media only screen and (max-width: 520px) {
    .top--right-menu {
        gap: 0;
    }

    .nav__langs-item {
        font-size: 11px;
        padding-left: 5px;
        padding-right: 5px;
    }

    .nav__langs-item img {
        width: 18px;
    }

    .nav__langs-stroke {
        right: 0;
    }

    .logo img {
        height: clamp(150px, 33vw, 160px);
    }

    .btn-main {
        padding: 15px 25px;
        border-radius: 14px;
    }

    .btn-main .text {
        font-size: 14px;
    }

    .server_title {
        font-size: 12px;
    }

    .server_t a {
        font-size: 11px;
    }

    .server-brand-i {
        font-size: 9px;
    }

    .swiper-main {
        aspect-ratio: 4 / 3;
        min-height: 224px;
    }

    .sisic__title {
        font-size: 16px;
    }

    .sisic__text {
        font-size: 12px;
    }

    .sub_item {
        height: 142px;
        padding: 16px;
    }

    .footer_all {
        grid-template-columns: 1fr;
        gap: 20px;
        text-align: center;
    }

    .menu-footer {
        align-items: center;
    }

    .banners_rating {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: min(300px, 100%);
        justify-content: center;
    }

    .copyright {
        padding-bottom: 0;
    }

    .video-toggle-btn {
        left: 8px;
        transform: translateX(-30%);
    }

    .video-toggle-btn img {
        width: 48px;
    }

    .video-panel {
        width: 100%;
        top: 56px;
        padding: 12px;
    }
}

@media only screen and (max-width: 380px) {
    .wrap {
        padding-left: 10px;
        padding-right: 10px;
    }

    .top_line {
        gap: 6px;
    }

    .gw-burger {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
    }

    .server_img {
        width: 64px;
        height: 64px;
        flex-basis: 64px;
    }

    .server_img img {
        max-width: 38px;
    }

    .server_online_count span {
        font-size: 13px;
    }

    .server_online_count p {
        font-size: 10px;
    }

    .sisic__title {
        font-size: 15px;
    }

    .btn-golden {
        height: 30px;
        padding-left: 12px;
        padding-right: 12px;
    }

    .main-text p {
        font-size: 18px;
    }

    .banners_rating {
        width: min(288px, 100%);
    }
}

@media only screen and (orientation: landscape) and (max-height: 520px) {
    .top_menu {
        padding-top: 56px;
    }

    .logo img {
        height: 120px;
    }

    .main-start .hero-btn-wrapper {
        margin-top: 14px;
        margin-bottom: 22px;
    }

    .swiper-main {
        min-height: 210px;
        max-height: 260px;
    }

    .video-panel {
        top: 0;
        height: 100%;
    }
}

/* ==========================================================
   CONTROL: character + hero button + server block spacing
   These values are intentionally grouped here for manual tuning.
   ========================================================== */

@media only screen and (max-width: 1180px) and (min-width: 961px) {
    .servers-area .logo1 {
        top: -300px;
    }

    .servers-area .logo1 img {
        height: 380px;
    }
}

@media only screen and (min-width: 676px) and (max-width: 960px) {
    .servers-area {
        position: relative;
        padding-top: 0;
    }

    .servers-area .logo1 {
        position: absolute;
        left: 50%;
        top: -515px; /* CONTROL: girl vertical position on tablets */
        z-index: 2;
        margin: 0;
        text-align: center;
        transform: translateX(-50%);
        pointer-events: none;
    }

    .servers-area .logo1 img {
        display: block;
        height: 315px; /* CONTROL: girl size on tablets */
        width: auto;
        max-width: none;
        margin: 0;
        transform: none;
    }

    .main-start .hero-btn-wrapper {
        position: relative;
        z-index: 5;
        margin-top: 85px; /* CONTROL: button lower/higher on tablets */
        margin-bottom: 34px;
    }

    .servers-area .main_content_all {
        position: relative;
        z-index: 4;
        margin-top: 80px; /* CONTROL: server/news block lower/higher on tablets */
    }
}

@media only screen and (max-width: 675px) {
    .servers-area {
        position: relative;
        padding-top: 0;
    }

    .servers-area .logo1 {
        position: absolute;
        left: 50%;
        top: -475px; /* CONTROL: girl vertical position on phones */
        z-index: 2;
        margin: 0;
        text-align: center;
        transform: translateX(-50%);
        pointer-events: none;
    }

    .servers-area .logo1 img {
        display: block;
        height: 305px; /* CONTROL: girl size on phones */
        width: auto;
        max-width: none;
        margin: 0;
        transform: none;
    }

    .main-start .hero-btn-wrapper {
        position: relative;
        z-index: 5;
        margin-top: 82px; /* CONTROL: button lower/higher on phones */
        margin-bottom: 34px;
    }

    .servers-area .main_content_all {
        position: relative;
        z-index: 4;
        margin-top: 86px; /* CONTROL: server/news block lower/higher on phones */
    }
}

@media only screen and (max-width: 520px) {
    .servers-area .logo1 {
        top: -445px;
    }

    .servers-area .logo1 img {
        height: 292px;
    }

    .main-start .hero-btn-wrapper {
        margin-top: 72px;
        margin-bottom: 30px;
    }

    .servers-area .main_content_all {
        margin-top: 82px;
    }
}

@media only screen and (max-width: 380px) {
    .servers-area .logo1 {
        top: -350px;
    }

    .servers-area .logo1 img {
        height: 274px;
    }

    .main-start .hero-btn-wrapper {
        margin-top: 250px;
        margin-bottom: -10px;
    }

    .servers-area .main_content_all {
        margin-top: 10px;
    }
}

/* Desktop + mobile sticky header */
header.header {
    position: sticky;
    top: 0;
    z-index: 10000;
}


/* FAFURION GREEN REGISTER BUTTON RESPONSIVE START */
.nav-link,
.btn-red,
.btn-green,
.btn-golden,
.nav__langs-item {
    white-space: nowrap;
}

@media only screen and (max-width: 1180px) {
    .btn-green {
        height: 32px;
        font-size: 12px;
        padding-left: 14px;
        padding-right: 14px;
    }
}

@media only screen and (max-width: 675px) {
    .btn-green {
        min-width: 0;
        padding-left: 10px;
        padding-right: 10px;
    }
}

@media only screen and (max-width: 520px) {
    .top--right-menu .btn-green {
        display: none;
    }

    .top--right-menu .btn-red {
        display: flex;
    }
}
/* FAFURION GREEN REGISTER BUTTON RESPONSIVE END */

/* FAFURION AUTH MODAL RESPONSIVE START */
@media only screen and (max-width: 675px) {
    header.header .top--right-menu {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    header.header .top--right-menu .btn-green,
    header.header .top--right-menu .btn-red {
        display: flex;
        height: 32px;
        padding: 0 9px;
        font-size: 11px;
        border-radius: 7px;
    }

    .auth-modal {
        padding: 12px;
    }

    .auth-modal__dialog {
        padding: 22px 16px 18px;
        border-radius: 14px;
    }

    .auth-modal__tabs {
        gap: 4px;
        margin-bottom: 18px;
    }

    .auth-modal__tab {
        min-height: 34px;
        font-size: 10px;
    }
}

@media only screen and (max-width: 380px) {
    header.header .top--right-menu .btn-green,
    header.header .top--right-menu .btn-red {
        height: 30px;
        padding: 0 6px;
        font-size: 9px;
    }

    .auth-modal__tabs {
        grid-template-columns: 1fr;
    }
}
/* FAFURION AUTH MODAL RESPONSIVE END */

/* FAFURION AUTH MODAL ACTUAL RESPONSIVE START */
@media only screen and (max-width: 675px) {
    .auth-modal .auth-modal__dialog {
        width: min(520px, calc(100vw - 24px));
        max-width: 520px;
        padding-left: 24px;
        padding-right: 24px;
    }
}

@media only screen and (max-width: 420px) {
    .auth-modal .auth-modal__dialog {
        width: min(390px, calc(100vw - 18px));
        max-width: 390px;
        padding-left: 18px;
        padding-right: 18px;
    }

    .auth-modal .auth-modal__tabs {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .auth-modal .auth-modal__tab {
        font-size: 10px;
        line-height: 1.1;
        padding-left: 4px;
        padding-right: 4px;
    }
}

@media only screen and (max-width: 360px) {
    .auth-modal .auth-modal__dialog {
        width: calc(100vw - 12px);
        padding-left: 14px;
        padding-right: 14px;
    }

    .auth-modal .auth-modal__tabs {
        grid-template-columns: 1fr;
    }
}
/* FAFURION AUTH MODAL ACTUAL RESPONSIVE END */
