/* Krytex RP — full responsive adaptation */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

img {
    max-width: 100%;
    height: auto;
}

/* ── Layout helpers ── */
.krytex-container {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding-left: clamp(16px, 4vw, 40px);
    padding-right: clamp(16px, 4vw, 40px);
}

section {
    min-height: auto !important;
    padding: clamp(32px, 6vw, 64px) 0;
}

.section__main {
    min-height: calc(100vh - 70px);
    display: flex;
    align-items: center;
    padding: clamp(24px, 5vw, 48px) 0;
}

.section__play,
.section__shop,
.section__cabinet {
    padding-top: clamp(32px, 5vw, 56px);
    padding-bottom: clamp(48px, 8vw, 80px);
}

/* ── Header ── */
.krytex-header .container {
    max-width: 1320px;
    padding-left: clamp(12px, 3vw, 24px);
    padding-right: clamp(12px, 3vw, 24px);
}

.krytex-header .row {
    min-height: 64px;
    height: auto !important;
    flex-wrap: nowrap !important;
    align-items: center;
}

.krytex-header__inner {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    column-gap: clamp(8px, 2vw, 20px);
    width: 100%;
    min-height: 64px;
    flex-wrap: nowrap !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.krytex-header__inner > .logo,
.krytex-header__inner > .profile {
    width: auto !important;
    max-width: none !important;
    flex: none !important;
    padding-left: 0;
    padding-right: 0;
}

.krytex-header__inner > .menu {
    min-width: 0;
    width: auto !important;
    max-width: 100%;
    flex: none !important;
    padding-left: 0;
    padding-right: 0;
    justify-self: center;
}

.krytex-header__inner > .profile {
    justify-self: end;
}

.krytex-header .logo {
    flex: 0 0 auto;
    max-width: none;
    width: auto !important;
    padding: 8px 0;
}

.krytex-header .menu {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: auto !important;
    max-width: none;
}

.krytex-header .profile {
    flex: 0 0 auto;
    width: auto !important;
    max-width: none;
    display: flex;
    justify-content: flex-end;
}

header .row .profile .profile_block {
    min-height: 44px;
    padding: 8px 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    width: auto !important;
    max-width: none !important;
    border: none;
    font: inherit;
    text-decoration: none;
}

header .row .profile .profile_block i,
.krytex-header .profile .profile_block i {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

/* Desktop nav */
header .row .menu .mobile_menu {
    display: none;
}

header .row .menu .nav_menu {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    position: static;
    width: auto;
    height: auto;
    background: transparent !important;
    flex-direction: row;
    padding: 0;
}

header .row .menu .nav_menu a {
    width: auto;
    height: auto;
}

header .row .menu .nav_menu a li {
    padding: 10px 14px;
    font-size: 13px;
    white-space: nowrap;
    justify-content: center;
    width: auto;
}

header .row .menu .nav_menu li::after {
    display: none;
}

header .row .menu .nav_menu a li:hover,
header .row .menu .nav_menu a li.active {
    background: rgba(238, 131, 255, 0.1) !important;
    border-radius: 6px;
}

/* Mobile menu overlay */
.krytex-nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    top: 64px;
    background: rgba(4, 18, 28, 0.7);
    backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.krytex-nav-overlay.active {
    display: block;
    opacity: 1;
}

.section__main .row.justify-content-center {
    justify-content: center !important;
}

.section__main .row.justify-content-center > [class*="col-"] {
    margin-left: auto;
    margin-right: auto;
}

/* ── Hero ── */
.section__main .name_project {
    margin-top: 0 !important;
    max-width: 100%;
    font-size: clamp(12px, 2.5vw, 14px);
    height: auto;
    min-height: 24px;
    padding: 4px 10px;
    background: rgba(238, 131, 255, 0.15) !important;
    border-radius: 4px;
    border-left: 3px solid var(--krytex-accent, #EE83FF);
}

.section__main .slogan {
    font-size: clamp(28px, 7vw, 51px) !important;
    line-height: 1.15 !important;
    word-break: break-word;
    overflow: visible !important;
    white-space: normal !important;
    max-width: 100%;
}

.section__main .slogan .wrap {
    white-space: normal !important;
    word-break: break-word;
}

.section__main .desc {
    max-width: 100%;
    font-size: clamp(13px, 2.5vw, 15px);
    line-height: 1.6;
}

.section__main .actions {
    flex-wrap: wrap;
    gap: 16px;
}

.section__main .actions .btn_start {
    width: auto;
    min-width: 170px;
    min-height: 48px;
    padding: 0 24px;
    margin-right: 0 !important;
}

.section__main .actions .social_links {
    margin-right: 0 !important;
    gap: 8px;
}

.section__main .actions .social_links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-right: 0 !important;
}

.section__main .actions .line {
    flex: 1 1 100%;
    max-width: 100% !important;
    margin-top: 8px;
}

/* Stats */
.krytex-stats {
    justify-content: flex-start;
    gap: clamp(16px, 4vw, 32px);
}

.krytex-stat {
    flex: 1 1 100px;
    min-width: 90px;
}

.krytex-stat__value {
    font-size: clamp(24px, 5vw, 32px);
}

/* Server blocks */
.server_block {
    margin-bottom: 16px;
    min-height: 54px;
}

/* Features */
.krytex-features {
    padding: clamp(40px, 8vw, 60px) 0;
}

.krytex-features__title {
    font-size: clamp(22px, 4vw, 28px);
    padding: 0 8px;
}

.krytex-features__grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: clamp(16px, 3vw, 24px);
}

.krytex-feature-card {
    padding: clamp(20px, 4vw, 28px) clamp(16px, 3vw, 24px);
}

/* ── Play page ── */
.section__play .title_section .text {
    font-size: clamp(22px, 4vw, 32px);
}

.section__play .play_container {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: clamp(16px, 3vw, 24px);
    width: 100% !important;
    height: auto !important;
    margin-bottom: 0 !important;
    clip-path: none !important;
    background: none !important;
    align-items: stretch;
}

.section__play .play_container .step {
    width: 100% !important;
    max-width: 100% !important;
    clip-path: none !important;
    padding: clamp(24px, 4vw, 40px) clamp(20px, 3vw, 32px) !important;
    margin: 0 !important;
    text-align: center;
    align-items: center !important;
}

.section__play .play_container .step._1,
.section__play .play_container .step._2,
.section__play .play_container .step._3 {
    clip-path: none !important;
    padding-left: clamp(20px, 3vw, 32px) !important;
    padding-right: clamp(20px, 3vw, 32px) !important;
    position: relative !important;
}

.section__play .play_container .step .title {
    font-size: clamp(16px, 3vw, 20px);
}

.section__play .play_container .step .desc {
    font-size: clamp(13px, 2.5vw, 14px);
    line-height: 1.6;
}

.section__play .play_container .step .button {
    width: 100%;
    max-width: 260px;
    min-height: 48px;
    margin-top: 8px;
}

.section__play .play_container .step .server_block {
    width: 100%;
    max-width: 360px;
}

/* ── Shop page ── */
.section__shop .shop-layout {
    row-gap: 24px;
}

.section__shop .shop-layout > [class*="col-"] {
    margin-bottom: 0;
}

.section__shop .row {
    min-height: auto !important;
}

.section__shop .donate_container,
.section__shop .row .donate_container {
    margin: 0 !important;
    min-height: auto !important;
    background: none !important;
    padding: clamp(24px, 4vw, 40px);
}

.section__shop .donate_container .form_block,
.section__shop .row .donate_container .form_block {
    width: 100%;
    padding: 0 !important;
}

.section__shop .donate_container .form_block .title {
    font-size: clamp(18px, 3.5vw, 24px);
    text-align: center;
    margin-bottom: 24px;
    line-height: 1.3;
}

.section__shop .form_block .form_wrap {
    width: 100%;
    margin-bottom: 16px;
}

.section__shop .form_block .input_wrap {
    width: 100%;
}

.section__shop .form_block button {
    width: 100%;
    min-height: 48px;
    margin-top: 8px;
}

.donate_items {
    margin-top: clamp(24px, 4vw, 40px) !important;
}

.donate_items .row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
    gap: clamp(12px, 2vw, 20px);
    margin: 0;
}

.donate_items .row > [class*="col-"] {
    max-width: 100%;
    flex: none;
    width: 100%;
    padding: 0;
}

.donate_items .item {
    padding: clamp(20px, 3vw, 28px);
    text-align: center;
    height: 100%;
}

.donate_items .item .title {
    font-size: clamp(18px, 3vw, 22px);
}

/* ── Footer ── */
.krytex-footer {
    padding: clamp(24px, 4vw, 32px) 0;
    padding-bottom: calc(clamp(24px, 4vw, 32px) + env(safe-area-inset-bottom, 0px));
}

.krytex-footer .row {
    height: auto !important;
    gap: 20px;
    text-align: center;
}

.krytex-footer .project_info,
.krytex-footer .logo_footer,
.krytex-footer .footer_links {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.krytex-footer .footer_links {
    gap: 8px;
}

.krytex-footer .footer_links a {
    font-size: 12px;
    line-height: 1.5;
}

/* ── Modal ── */
.modal_wrap {
    padding: 16px;
    align-items: center;
}

.modal_wrap .container {
    max-width: 480px;
    padding: 0;
}

.modal_wrap .row {
    justify-content: center;
    margin: 0;
}

.modal_wrap .row .modal_block.login {
    width: min(450px, calc(100vw - 32px)) !important;
    max-width: 100%;
    background-image: none !important;
    background: var(--krytex-bg-card, #0d2840) !important;
    padding: clamp(20px, 4vw, 32px);
    margin: 0 auto;
    border-radius: 12px;
    border: 1px solid rgba(238, 131, 255, 0.2);
    max-height: calc(100vh - 32px);
    overflow-y: auto;
}

.modal_block .form_block {
    width: 100%;
}

.modal_block .form_block .form_wrap {
    width: 100%;
}

.modal_block .form_block .input_wrap {
    width: 100%;
}

.modal_block .form_block button {
    width: 100%;
    min-height: 48px;
}

.modal_wrap .row .modal_block .close_modal {
    top: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    background: transparent;
    border: none;
    padding: 0;
    color: inherit;
}

/* ── Notifications ── */
.alert[data-notify="container"] {
    max-width: calc(100vw - 32px) !important;
    font-size: 13px;
}

/* ══════════════════════════════════════
   TABLET & MOBILE  ≤ 1024px
   ══════════════════════════════════════ */
@media (max-width: 1024px) {
    header .row .menu {
        justify-content: flex-end;
    }

    .krytex-header__inner {
        grid-template-columns: minmax(0, 1fr) auto auto;
    }

    .krytex-header__inner > .logo {
        justify-self: start;
    }

    .krytex-header__inner > .menu {
        justify-self: end;
    }

    header .row .profile .profile_block {
        width: auto !important;
    }

    header .row .menu .mobile_menu {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        margin-right: 12px;
        z-index: 1001;
        position: relative;
    }

    header .row .menu .nav_menu {
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0px));
        background: rgba(7, 33, 51, 0.98) !important;
        backdrop-filter: blur(16px);
        border-bottom: 1px solid rgba(238, 131, 255, 0.15);
        box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
        transform: translateY(-110%);
        opacity: 0;
        visibility: hidden;
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                    opacity 0.35s ease,
                    visibility 0.35s ease;
        z-index: 999;
        max-height: calc(100vh - 64px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    header .row .menu .nav_menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
        top: 64px;
    }

    header .row .menu .nav_menu a {
        width: 100%;
        display: block;
    }

    header .row .menu .nav_menu a li {
        width: 100%;
        justify-content: flex-start;
        padding: 16px 24px;
        font-size: 15px;
        min-height: 52px;
        border-bottom: 1px solid rgba(238, 131, 255, 0.08);
        color: var(--krytex-text, #fff) !important;
    }

    header .row .menu .nav_menu a li:hover,
    header .row .menu .nav_menu a li.active {
        background: rgba(238, 131, 255, 0.12) !important;
        color: var(--krytex-accent, #EE83FF) !important;
    }

    .krytex-stats {
        justify-content: space-between;
    }

    .krytex-stat {
        flex: 1 1 calc(33% - 12px);
    }
}

/* ══════════════════════════════════════
   TABLET PORTRAIT  ≤ 768px
   ══════════════════════════════════════ */
@media (max-width: 768px) {
    .section__main {
        min-height: auto;
        padding: 32px 0 24px;
    }

    .section__main .row {
        height: auto !important;
    }

    .krytex-stats {
        flex-wrap: wrap;
        gap: 12px;
    }

    .krytex-stat {
        flex: 1 1 calc(50% - 8px);
    }

    .krytex-stat:last-child {
        flex: 1 1 100%;
    }

    .section__main .actions {
        flex-direction: column;
        align-items: stretch;
    }

    .section__main .actions .btn_start {
        width: 100%;
        max-width: 100%;
    }

    .section__main .actions .social_links {
        justify-content: center;
        width: 100%;
    }

    .section__main .actions .line {
        display: none;
    }

    .krytex-footer .footer_links {
        display: flex !important;
    }

    .krytex-footer .logo_footer {
        order: -1;
    }
}

/* ══════════════════════════════════════
   PHONE  ≤ 576px
   ══════════════════════════════════════ */
@media (max-width: 576px) {
    .section__main .row.justify-content-center > .col-12 {
        text-align: center;
    }

    .krytex-logo-text {
        font-size: 18px;
        letter-spacing: 1px;
    }

    .krytex-logo-badge {
        font-size: 10px;
        padding: 2px 6px;
    }

    header .row .profile .profile_block .text {
        display: none;
    }

    header .row .profile .profile_block {
        width: 44px;
        height: 44px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
    }

    header .row .profile .profile_block i {
        display: block !important;
        font-size: 18px;
        margin: 0;
    }

    .section__main .name_project,
    .section__main .slogan,
    .section__main .desc {
        text-align: center;
    }

    .krytex-stats {
        justify-content: center;
    }

    .krytex-stat {
        flex: 1 1 calc(33% - 8px);
        min-width: 80px;
    }

    .krytex-stat__label {
        font-size: 10px;
    }

    .section__play .play_container {
        grid-template-columns: 1fr;
    }

    .donate_items .row {
        grid-template-columns: 1fr 1fr;
    }

    .krytex-footer .project_info .name,
    .krytex-footer .project_info .desc {
        font-size: 12px;
    }
}

/* ══════════════════════════════════════
   SMALL PHONE  ≤ 400px
   ══════════════════════════════════════ */
@media (max-width: 400px) {
    .krytex-logo-text {
        font-size: 16px;
    }

    .section__main .slogan {
        font-size: 26px !important;
    }

    .donate_items .row {
        grid-template-columns: 1fr;
    }

    .krytex-feature-card__icon {
        font-size: 28px;
    }
}

/* ══════════════════════════════════════
   LANDSCAPE PHONE
   ══════════════════════════════════════ */
@media (max-height: 500px) and (orientation: landscape) {
    .section__main {
        min-height: auto;
        padding: 16px 0;
    }

    .section__main .slogan {
        font-size: 24px !important;
    }

    .krytex-stats {
        margin-top: 16px;
        margin-bottom: 8px;
    }

    header .row .menu .nav_menu {
        max-height: calc(100vh - 56px);
    }

    .krytex-header .row {
        min-height: 56px;
    }

    header .row .menu .nav_menu,
    header .row .menu .nav_menu.active {
        top: 56px;
    }

    .krytex-nav-overlay {
        top: 56px;
    }
}

/* ══════════════════════════════════════
   LARGE DESKTOP  ≥ 1440px
   ══════════════════════════════════════ */
@media (min-width: 1440px) {
    .krytex-features__grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .section__play .play_container {
        grid-template-columns: repeat(3, 1fr);
    }
}

.forn_wrap {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: stretch;
}

/* iOS: prevent zoom on input focus */
@media (max-width: 768px) {
    input,
    select,
    textarea,
    .nice-select {
        font-size: 16px !important;
    }
}

@media (hover: none) and (pointer: coarse) {
    .krytex-feature-card:hover {
        transform: none;
    }

    .server_block:hover {
        box-shadow: none;
    }

    header .row .profile .profile_block:active,
    .section__main .actions .btn_start:active,
    .form_block button:active {
        transform: scale(0.98);
    }
}

/* ── Global overrides (legacy style.min.css) ── */
html.no_scroll,
body.no_scroll {
    overflow: hidden !important;
    height: 100%;
    touch-action: none;
}

body.krytex-body {
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1320px;
    padding-left: clamp(16px, 4vw, 24px);
    padding-right: clamp(16px, 4vw, 24px);
}

.krytex-header,
header.krytex-header {
    background: rgba(7, 33, 51, 0.95) !important;
    padding-top: env(safe-area-inset-top, 0px);
}


/* ── Play page extras ── */
.section__play .title_section {
    margin-top: clamp(24px, 5vw, 80px) !important;
    margin-bottom: clamp(32px, 5vw, 64px) !important;
}

.section__play .play_container .step .number_step {
    background: rgba(238, 131, 255, 0.12) !important;
    clip-path: none !important;
    border-radius: 12px;
    border: 1px solid rgba(238, 131, 255, 0.25);
    width: auto !important;
    min-width: 72px;
    height: auto !important;
    padding: 12px 16px;
}

.section__play .play_container .step .number_step .number {
    margin-bottom: 0 !important;
    font-size: clamp(32px, 6vw, 50px) !important;
    background: var(--krytex-gradient, linear-gradient(135deg, #FF0037, #EE83FF));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section__play .play_container .step:hover {
    transform: none;
}

/* ── Forms (global) ── */
.form_block .form_wrap .label {
    color: var(--krytex-text-muted, rgba(255,255,255,0.65));
    font-size: clamp(13px, 2vw, 14px);
}

.form_block .form_wrap .input_wrap {
    height: auto;
    min-height: 52px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(238, 131, 255, 0.15);
}

.form_block .form_wrap .input_wrap input,
.form_block .form_wrap .input_wrap .nice-select {
    background: transparent !important;
    border-radius: 8px;
    min-height: 52px;
    padding-left: 56px;
}

.form_block .form_wrap .input_wrap .icon,
.form_block .form_wrap .input_wrap .input-icon {
    width: auto;
    height: auto;
    left: 16px;
    opacity: 1;
}

.form_block .form_wrap .input_wrap .nice-select .list {
    background: var(--krytex-bg-light, #0d2840) !important;
    border: 1px solid rgba(238, 131, 255, 0.2);
    border-radius: 8px;
    max-height: 220px;
    overflow-y: auto;
    z-index: 100;
}

.form_block .form_wrap .input_wrap .nice-select .option:hover,
.form_block .form_wrap .input_wrap .nice-select .option.focus {
    background: rgba(238, 131, 255, 0.15) !important;
}

.form_block button {
    width: 100%;
    max-width: 100%;
    min-height: 48px;
    border-radius: 8px !important;
}

/* ── Modal (enhanced) ── */
.modal_wrap {
    z-index: 10000 !important;
    display: none;
    padding: clamp(12px, 3vw, 24px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal_wrap.active {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.modal_wrap .row {
    height: auto !important;
    min-height: min(100%, 100vh);
    width: 100%;
    padding: env(safe-area-inset-top, 0) 0 env(safe-area-inset-bottom, 0);
}

.modal_block .form_block .title {
    font-size: clamp(20px, 4vw, 24px);
    margin-bottom: clamp(20px, 4vw, 32px);
}

.krytex-servers-row {
    margin-top: clamp(24px, 4vw, 40px);
    gap: 0;
}

.krytex-servers-row > [class*="col-"] {
    margin-bottom: 12px;
}

.server_block .server_info .name {
    font-size: clamp(12px, 2.5vw, 14px);
    word-break: break-word;
}

.server_block .server_number {
    font-size: clamp(18px, 4vw, 24px);
    flex-shrink: 0;
}

/* ── Tooltip on mobile ── */
@media (max-width: 768px) {
    .tooltip {
        display: none !important;
    }
}

/* ══════════════════════════════════════
   TABLET LANDSCAPE 769–1024px
   ══════════════════════════════════════ */
@media (min-width: 769px) and (max-width: 1024px) {
    header .row .menu .nav_menu a li {
        padding: 16px 20px;
        font-size: 14px;
    }

    .section__play .play_container {
        grid-template-columns: repeat(2, 1fr);
    }

    .section__play .play_container .step._3 {
        grid-column: 1 / -1;
        max-width: 480px;
        justify-self: center;
        width: 100%;
    }

    .krytex-features__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ══════════════════════════════════════
   DESKTOP 1025–1439px
   ══════════════════════════════════════ */
@media (min-width: 1025px) and (max-width: 1439px) {
    header .row .menu .nav_menu a li {
        padding: 10px 12px;
        font-size: 12px;
    }

    .krytex-header .profile .profile_block .text {
        font-size: 12px;
    }
}

/* ══════════════════════════════════════
   ULTRA-WIDE  ≥ 1600px
   ══════════════════════════════════════ */
@media (min-width: 1600px) {
    .container {
        max-width: 1400px;
    }

    .section__main .desc {
        max-width: 640px;
    }
}

/* Cabinet mobile */
@media (max-width: 767px) {
    .cabinet-header {
        flex-direction: column;
        padding: 18px;
    }

    .cabinet-header__actions {
        width: 100%;
    }

    .cabinet-btn {
        flex: 1;
        min-width: 120px;
    }

    .donate_packages__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .profile_block--logged .text {
        max-width: 90px;
        font-size: 12px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
