* {
    margin: 0;
    padding: 0;
}

/* Utility class for hiding elements - CSP compliant alternative to inline styles */
.hidden {
    display: none;
}

/* @font-face {
    font-family: 'Raleway-regular';
    src: url('../FONTS/raleway-regular-webfont.woff2') format('woff2'),
         url('./FONTS/Raleway-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
} */

:focus::-webkit-input-placeholder { color:transparent; }
:focus::-moz-placeholder { color:transparent; }
:focus::placeholder { color:transparent; }

body {
    overflow: hidden;
    background-color: rgb(14, 64, 64);
    font-family: Helvetica;
    position: relative;
}
hr {
    opacity: 0.8;
    margin: 2% auto;
    width: 80%;
    color: #555;
    background-color:#555;
    border:0 none;
    height:1px;
    clear:both;
}
a {
    text-decoration: none;
    color: rgb(205, 147, 65); 
    opacity: 0.9;
}
a:hover {
    color: rgb(255, 198, 123);
    transition: all 0.1s ease-in;
}


.heading {
    display: flex;
    justify-content: center; /* Выравнивание элементов по центру по горизонтали */
    align-items: center; /* Выравнивание элементов по центру по вертикали */

    /* Резерв ширины = формуле #canvas (инлайн от JS позже пишет то же значение) */
    width: min(99vw, calc((100vh - var(--game-header-h, 130px) - 10px) * 1.6));
    margin: 0 auto;
}
.logo-container {
    display: flex;
    justify-content: center;
}
.logo-container img {
    width: 50%;
    height: auto;
}
/* БАГФИКС: логотип обрезался до высоты кнопок после Shift+Cmd+R.
   Причина: img width:50% — циклический процент от shrink-to-fit контейнера; пока
   logo.avif не загружен (uncached reload), intrinsic неизвестны и контейнер
   схлопывается, headerHeightFix.js фиксирует высоту ТОЛЬКО по текстам кнопок
   (~37px), затем логотип прыгает на 49.5px и его низ уходит под canvas.
   min-width делает размер контейнера детерминированным до загрузки картинки
   (развёрнутый layout = тому, что получается после загрузки: 270 → img 135×49.5).
   >=768px только: в портрете <768px контейнер растягивается по flex-grow (трогать
   нельзя), в ландшафте <=1024 контейнер display:none — min-width не действует. */
@media screen and (min-width: 768px) {
    .logo-container {
        min-width: 270px; /* нативная ширина logo.avif (270×99) */
    }
}
.header-nav {
    display: flex;
    flex-grow: 1; /* Занимает все доступное пространство по горизонтали */
    align-items: center;
    padding: 0.6vh 0 0.2vh 0;
}
.headerbox {
    flex-grow: 1; /* Равномерно распределяет пространство между элементами */
    text-align: center; /* Выравнивание текста по центру */
}

.window-main-account {
    display: none;
    position: fixed;
    min-width: 100%;
    min-height: 100%;
    top: 0;
    left: 0;
    background-color: rgba(3, 15, 15, 0.85);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 2;
    animation-name: accountFadeIn;
    animation-duration: 0.3s;
}

@keyframes accountFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Эффект частиц на фоне оверлея - только для десктопа */
.window-main-account::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(2px 2px at 20px 30px, rgba(205, 147, 65, 0.3), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255, 200, 120, 0.2), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(205, 147, 65, 0.4), transparent),
        radial-gradient(2px 2px at 160px 120px, rgba(255, 200, 120, 0.25), transparent),
        radial-gradient(1px 1px at 230px 80px, rgba(205, 147, 65, 0.3), transparent),
        radial-gradient(2px 2px at 300px 150px, rgba(255, 200, 120, 0.2), transparent);
    background-size: 350px 200px;
    animation: particleFloat 20s linear infinite;
    pointer-events: none;
    opacity: 0.6;
}

@keyframes particleFloat {
    0% {
        transform: translateY(0px) translateX(0px);
    }
    100% {
        transform: translateY(-200px) translateX(50px);
    }
}

/* Отключаем частицы на мобильных для производительности */
@media screen and (max-width: 767px) {
    .window-main-account::before {
        display: none;
    }

    /* Упрощаем анимацию рамки на мобильных */
    .window-content-account::after {
        animation: none;
        opacity: 0.5;
    }

    /* Упрощаем анимацию карточки на мобильных */
    .player_profile_card::after {
        animation: none;
        opacity: 0.4;
    }

    .player_profile_card::before {
        animation: none;
    }

    /* Упрощаем shine эффекты на мобильных */
    .stat_item.stat_badge::before,
    .player_id_bar::before,
    .player_vip_badge::before,
    .account-header::before {
        animation: none;
    }
}
.window-content-account {
    border: none;
    margin: 40px auto auto;
    width: 90%;
    max-width: 600px;
    border-radius: 24px;
    background: linear-gradient(145deg,
        rgba(15, 35, 45, 0.98) 0%,
        rgba(10, 25, 35, 0.96) 50%,
        rgba(8, 20, 28, 0.98) 100%);
    background-clip: padding-box;
    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.8),
        0 10px 40px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(205, 147, 65, 0.2),
        inset 0 2px 0 rgba(255, 255, 255, 0.08),
        inset 0 -2px 0 rgba(0, 0, 0, 0.3);
    color: rgb(205, 147, 65);
    position: relative;
    animation-name: contentaccountGlow;
    animation-duration: 0.4s;
    animation-timing-function: ease-out;
    display: flex;
    flex-direction: column;
}

/* Скрытие скроллбара */
.window-content-account::-webkit-scrollbar {
    width: 8px;
}

.window-content-account::-webkit-scrollbar-track {
    background: linear-gradient(180deg,
        rgba(10, 25, 35, 0.6) 0%,
        rgba(8, 20, 28, 0.8) 100%);
    border-radius: 4px;
    border: 1px solid rgba(205, 147, 65, 0.1);
}

.window-content-account::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg,
        rgba(205, 147, 65, 0.6) 0%,
        rgba(180, 130, 60, 0.8) 50%,
        rgba(205, 147, 65, 0.6) 100%);
    border-radius: 4px;
    border: 1px solid rgba(255, 200, 120, 0.3);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 0 10px rgba(205, 147, 65, 0.3);
    transition: all 0.3s ease;
}

.window-content-account::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg,
        rgba(255, 200, 120, 0.8) 0%,
        rgba(220, 170, 80, 1) 50%,
        rgba(255, 200, 120, 0.8) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 0 15px rgba(205, 147, 65, 0.6);
}

/* Декоративный градиентный фон для модального окна */
.window-content-account::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(255, 180, 80, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(205, 147, 65, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(180, 130, 60, 0.08) 0%, transparent 60%),
        linear-gradient(145deg, rgba(20, 45, 55, 0.9), rgba(10, 30, 40, 0.95));
    border-radius: 26px;
    pointer-events: none !important;
    z-index: -1;
    animation: gradientShift 8s ease-in-out infinite alternate;

    /* Дополнительная защита от перехвата событий */
    -webkit-pointer-events: none !important;
    -moz-pointer-events: none !important;
    -ms-pointer-events: none !important;
}

@keyframes gradientShift {
    0% {
        filter: hue-rotate(0deg) brightness(1);
    }
    100% {
        filter: hue-rotate(15deg) brightness(1.1);
    }
}

/* Анимированная светящаяся рамка */
.window-content-account::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 26px;
    padding: 2px;
    background: linear-gradient(45deg,
        transparent 0%,
        rgba(205, 147, 65, 0.6) 20%,
        rgba(255, 200, 120, 0.8) 50%,
        rgba(205, 147, 65, 0.6) 80%,
        transparent 100%);
    background-size: 300% 300%;

    /* Standard mask property for modern browsers */
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;

    /* WebKit prefix for Safari and older Chrome */
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    pointer-events: none !important;
    z-index: 1;
    animation: borderGlow 4s linear infinite;
    opacity: 0.8;

    /* Дополнительная защита от перехвата событий */
    -webkit-pointer-events: none !important;
    -moz-pointer-events: none !important;
    -ms-pointer-events: none !important;
}

@keyframes borderGlow {
    0% {
        background-position: 0% 50%;
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
    100% {
        background-position: 300% 50%;
        opacity: 0.6;
    }
}

.form {
    position: relative;
    z-index: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;

    /* Изолируем от крестика */
    contain: layout style;
    isolation: isolate;

    /* Убедимся, что псевдоэлементы не выходят за пределы */
    overflow: hidden;
}

/* Заголовок модального окна */
.account-header {
    text-align: center;
    margin-bottom: 18px;
    padding: 14px 16px;
    background: linear-gradient(135deg,
        rgba(205, 147, 65, 0.12) 0%,
        rgba(180, 130, 60, 0.08) 50%,
        rgba(150, 100, 50, 0.12) 100%);
    border-radius: 16px;
    border: 1px solid rgba(205, 147, 65, 0.25);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 0 20px rgba(205, 147, 65, 0.05);
    position: relative;
    overflow: hidden;

    /* Создаем новый stacking context */
    transform: translateZ(0);

    /* Гарантируем, что псевдоэлементы не выходят за пределы */
    isolation: isolate;
}

.account-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.05) 50%,
        transparent 70%);
    animation: headerShine 6s linear infinite;

    /* Гарантируем, что не перехватывает события мыши */
    pointer-events: none !important;
    -webkit-pointer-events: none !important;
    -moz-pointer-events: none !important;
    -ms-pointer-events: none !important;

    /* Ограничиваем влияние на соседние элементы */
    z-index: -1;
    contain: layout paint;
}

@keyframes headerShine {
    0% {
        transform: translateX(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) rotate(45deg);
    }
}

.account-title {
    color: rgb(205, 147, 65);
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 4px 0;
    text-shadow:
        0 2px 8px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(205, 147, 65, 0.3),
        0 0 40px rgba(205, 147, 65, 0.15);
    letter-spacing: 0.6px;
    position: relative;
    z-index: 1;
    animation: titlePulse 3s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% {
        text-shadow:
            0 2px 8px rgba(0, 0, 0, 0.4),
            0 0 20px rgba(205, 147, 65, 0.3),
            0 0 40px rgba(205, 147, 65, 0.15);
    }
    50% {
        text-shadow:
            0 2px 8px rgba(0, 0, 0, 0.4),
            0 0 30px rgba(205, 147, 65, 0.5),
            0 0 60px rgba(205, 147, 65, 0.25);
    }
}

.account-subtitle {
    color: rgb(180, 160, 140);
    font-size: 11px;
    margin: 0;
    font-weight: 500;
    letter-spacing: 0.4px;
    position: relative;
    z-index: 1;
    text-transform: uppercase;
    opacity: 0.9;
}

/* Основной контейнер */
.account-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 12px;
}

/* Секция профиля игрока */
.player_profile_section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ============================================
   RIOT GAMES STYLE PROFILE CARD
   ============================================ */

/* Основная карточка профиля */
.player_profile_card {
    display: flex;
    gap: 16px;
    padding: 16px 18px;
    background: linear-gradient(145deg,
        rgba(25, 40, 55, 0.95) 0%,
        rgba(18, 32, 45, 0.93) 50%,
        rgba(15, 28, 40, 0.95) 100%);
    border-radius: 20px;
    border: 2px solid transparent;
    background-clip: padding-box;
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.5),
        0 4px 15px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 0 0 1px rgba(205, 147, 65, 0.15);
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    align-items: flex-start;
}

.player_profile_card:hover {
    transform: translateY(-2px);
    box-shadow:
        0 16px 50px rgba(0, 0, 0, 0.6),
        0 8px 25px rgba(205, 147, 65, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 0 2px rgba(205, 147, 65, 0.3);
}

/* Декоративный фон */
.player_profile_card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 15% 25%, rgba(255, 200, 120, 0.1) 0%, transparent 45%),
        radial-gradient(ellipse at 85% 75%, rgba(205, 147, 65, 0.08) 0%, transparent 45%),
        linear-gradient(135deg, rgba(205, 147, 65, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
    animation: cardGlow 5s ease-in-out infinite alternate;
}

@keyframes cardGlow {
    0% {
        opacity: 0.6;
    }
    100% {
        opacity: 1;
    }
}

/* Анимированная рамка карточки */
.player_profile_card::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 22px;
    padding: 2px;
    background: linear-gradient(135deg,
        rgba(205, 147, 65, 0.4) 0%,
        rgba(255, 200, 120, 0.6) 25%,
        rgba(180, 130, 60, 0.4) 50%,
        rgba(205, 147, 65, 0.6) 75%,
        rgba(255, 200, 120, 0.4) 100%);
    background-size: 300% 300%;

    /* Standard mask property for modern browsers */
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;

    /* WebKit prefix for Safari and older Chrome */
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    pointer-events: none;
    z-index: 1;
    animation: cardBorder 4s linear infinite;
}

@keyframes cardBorder {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 300% 50%;
    }
}

/* Секция аватара */
.profile_avatar_section {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.avatar_frame {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(135deg,
        rgba(100, 200, 100, 0.5) 0%,
        rgba(205, 147, 65, 0.6) 25%,
        rgba(255, 200, 120, 0.7) 50%,
        rgba(205, 147, 65, 0.6) 75%,
        rgba(100, 200, 100, 0.5) 100%);
    background-size: 200% 200%;
    box-shadow:
        0 0 0 2px rgba(100, 200, 100, 0.3),
        0 0 0 4px rgba(205, 147, 65, 0.2),
        0 0 25px rgba(205, 147, 65, 0.5),
        0 0 40px rgba(100, 200, 100, 0.2),
        0 6px 25px rgba(0, 0, 0, 0.6),
        inset 0 2px 0 rgba(255, 255, 255, 0.15);
    position: relative;
    animation: avatarGlow 3s ease-in-out infinite;
    transition: all 0.3s ease;
}

@keyframes avatarGlow {
    0%, 100% {
        background-position: 0% 50%;
        box-shadow:
            0 0 0 2px rgba(100, 200, 100, 0.3),
            0 0 0 4px rgba(205, 147, 65, 0.2),
            0 0 25px rgba(205, 147, 65, 0.5),
            0 0 40px rgba(100, 200, 100, 0.2),
            0 6px 25px rgba(0, 0, 0, 0.6),
            inset 0 2px 0 rgba(255, 255, 255, 0.15);
    }
    50% {
        background-position: 100% 50%;
        box-shadow:
            0 0 0 2px rgba(100, 200, 100, 0.4),
            0 0 0 4px rgba(205, 147, 65, 0.3),
            0 0 35px rgba(205, 147, 65, 0.7),
            0 0 50px rgba(100, 200, 100, 0.3),
            0 6px 25px rgba(0, 0, 0, 0.6),
            inset 0 2px 0 rgba(255, 255, 255, 0.2);
    }
}

.avatar_frame:hover {
    transform: scale(1.05);
    box-shadow:
        0 0 0 2px rgba(100, 200, 100, 0.5),
        0 0 0 5px rgba(205, 147, 65, 0.4),
        0 0 40px rgba(205, 147, 65, 0.8),
        0 0 60px rgba(100, 200, 100, 0.4),
        0 8px 30px rgba(0, 0, 0, 0.7),
        inset 0 2px 0 rgba(255, 255, 255, 0.2);
}

.avatar_frame img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(15, 25, 35, 0.9);
    box-shadow:
        inset 0 2px 10px rgba(0, 0, 0, 0.4),
        inset 0 -1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.avatar_frame:hover img {
    border-color: rgba(20, 35, 50, 0.95);
}

/* Секция информации */
.profile_info_section {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

/* Идентификация игрока */
.player_identity {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 4px;
}

.player_name {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: rgb(220, 200, 180);
    letter-spacing: 0.5px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    line-height: 1.2;
}

.player_divider {
    height: 2px;
    background: linear-gradient(90deg,
        rgba(205, 147, 65, 0.6) 0%,
        rgba(205, 147, 65, 0.1) 50%,
        transparent 100%);
    border-radius: 1px;
}

/* Сетка статистики */
.player_stats_grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 8px;
}

.stat_item.stat_badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 6px;
    background: linear-gradient(135deg,
        rgba(180, 140, 80, 0.2) 0%,
        rgba(120, 90, 50, 0.12) 50%,
        rgba(180, 140, 80, 0.2) 100%);
    border-radius: 12px;
    border: 1px solid rgba(205, 147, 65, 0.25);
    box-shadow:
        0 3px 12px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat_item.stat_badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent);
    animation: statBadgeShine 4s infinite;
}

@keyframes statBadgeShine {
    0% {
        left: -100%;
    }
    50%, 100% {
        left: 100%;
    }
}

.stat_item.stat_badge:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 200, 120, 0.4);
    box-shadow:
        0 5px 18px rgba(0, 0, 0, 0.35),
        0 0 20px rgba(205, 147, 65, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.stat_item.stat_badge .stat_icon {
    width: auto;
    height: auto;
    font-size: 18px;
    background: none;
    border: none;
    box-shadow: none;
    line-height: 1;
    margin-bottom: 2px;
}

.stat_item.stat_badge .stat_content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    width: 100%;
}

.stat_item.stat_badge .stat_value {
    font-size: 10px;
    font-weight: 700;
    color: rgb(255, 200, 120);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    text-align: center;
    white-space: nowrap;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat_icon {
    font-size: 14px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg,
        rgba(255, 200, 120, 0.2) 0%,
        rgba(205, 147, 65, 0.15) 50%,
        rgba(180, 130, 60, 0.2) 100%);
    border-radius: 8px;
    border: 1px solid rgba(205, 147, 65, 0.3);
    flex-shrink: 0;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: statIconPulse 2s ease-in-out infinite;
}

.stat_item.stat_badge .stat_icon {
    background: none;
    border: none;
    box-shadow: none;
    width: auto;
    height: auto;
}

@keyframes statIconPulse {
    0%, 100% {
        box-shadow:
            0 2px 8px rgba(0, 0, 0, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }
    50% {
        box-shadow:
            0 2px 8px rgba(0, 0, 0, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.15),
            0 0 15px rgba(205, 147, 65, 0.3);
    }
}

.stat_icon:hover {
    transform: scale(1.1) rotate(5deg);
    background: linear-gradient(135deg,
        rgba(255, 200, 120, 0.3) 0%,
        rgba(205, 147, 65, 0.25) 50%,
        rgba(180, 130, 60, 0.3) 100%);
    border-color: rgba(255, 200, 120, 0.5);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(205, 147, 65, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.stat_content {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.stat_label {
    font-size: 9px;
    font-weight: 600;
    color: rgb(140, 130, 120);
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.stat_value {
    font-size: 12px;
    font-weight: 600;
    color: rgb(205, 147, 65);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stat_id {
    font-size: 10px;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    word-break: break-all;
}

/* ID полоса */
.player_id_bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: linear-gradient(135deg,
        rgba(180, 140, 80, 0.2) 0%,
        rgba(120, 90, 50, 0.12) 50%,
        rgba(180, 140, 80, 0.2) 100%);
    border-radius: 12px;
    border: 1px solid rgba(205, 147, 65, 0.25);
    box-shadow:
        0 3px 12px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    position: relative;
    overflow: hidden;
}

.player_id_bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.08),
        transparent);
    animation: idBarShine 4s infinite;
}

@keyframes idBarShine {
    0% {
        left: -100%;
    }
    50%, 100% {
        left: 100%;
    }
}

.id_label {
    font-size: 11px;
    font-weight: 600;
    color: rgb(180, 160, 140);
    white-space: nowrap;
    flex-shrink: 0;
}

.id_value {
    font-size: 10px;
    font-weight: 700;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    color: rgb(255, 200, 120);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

/* Кнопка копирования ID */
.id_copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    flex-shrink: 0;
    background: rgba(205, 147, 65, 0.15);
    border: 1px solid rgba(205, 147, 65, 0.35);
    border-radius: 6px;
    color: rgb(255, 200, 120);
    cursor: pointer;
    transition: color 0.25s ease, background 0.25s ease, border-color 0.25s ease, transform 0.15s ease;
}

.id_copy svg {
    display: block;
    pointer-events: none;
}

.id_copy:hover {
    background: rgba(205, 147, 65, 0.3);
    border-color: rgba(255, 200, 120, 0.6);
    color: rgb(255, 220, 160);
}

.id_copy:active {
    transform: scale(0.88);
}

/* Состояние после клика — ID скопирован */
.id_copy.copied {
    color: rgb(120, 230, 140);
    background: rgba(120, 230, 140, 0.15);
    border-color: rgba(120, 230, 140, 0.55);
}

/* VIP значок - удален, теперь интегрирован в stat_badge */

/* Секция действий */
.profile_actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 8px 0 4px;
}

.profile_actions_title {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: rgb(205, 147, 65);
    text-align: center;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.profile_actions .acsubmit.nickname {
    width: 100%;
    max-width: 280px;
    padding: 12px 24px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    border-radius: 12px;
    border: 2px solid rgba(180, 140, 100, 0.4);
    background: linear-gradient(135deg,
        rgba(180, 140, 220, 0.4) 0%,
        rgba(150, 120, 180, 0.3) 50%,
        rgba(140, 100, 160, 0.4) 100%);
    box-shadow:
        0 4px 20px rgba(180, 140, 220, 0.35),
        inset 0 2px 0 rgba(255, 255, 255, 0.15),
        inset 0 -2px 0 rgba(0, 0, 0, 0.1);
    color: rgb(220, 200, 255);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.profile_actions .acsubmit.nickname::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent);
    transition: left 0.5s;
}

.profile_actions .acsubmit.nickname:hover::before {
    left: 100%;
}

.profile_actions .acsubmit.nickname:hover {
    border-color: rgba(200, 170, 255, 0.6);
    background: linear-gradient(135deg,
        rgba(200, 160, 240, 0.5) 0%,
        rgba(180, 140, 220, 0.4) 50%,
        rgba(160, 120, 200, 0.5) 100%);
    box-shadow:
        0 6px 25px rgba(180, 140, 220, 0.5),
        0 0 35px rgba(180, 140, 220, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 0.2),
        inset 0 -2px 0 rgba(0, 0, 0, 0.15);
    color: rgb(240, 220, 255);
    transform: translateY(-2px);
}

.profile_actions .acsubmit.nickname:active {
    transform: translateY(0);
    box-shadow:
        0 2px 10px rgba(180, 140, 220, 0.4),
        inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Футер модального окна */
.account-footer {
    margin-top: auto;
    padding: 12px 0 0;
    text-align: center;
}

.acline {
    opacity: 0.8;
    margin: 14px auto 12px;
    border: 0;
    height: 2px;
    width: 100%;
    max-width: 400px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(205, 147, 65, 0.1) 20%,
        rgba(255, 200, 120, 0.4) 50%,
        rgba(205, 147, 65, 0.1) 80%,
        transparent 100%);
    box-shadow:
        0 0 10px rgba(205, 147, 65, 0.3),
        0 0 20px rgba(255, 200, 120, 0.15);
    position: relative;
}

.acline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%);
    animation: aclineShine 3s linear infinite;
}

@keyframes aclineShine {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Кнопка выхода */
.output {
    width: auto;
    min-width: 80px;
    padding: 10px 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-radius: 10px;
    border: 2px solid transparent;
    background: linear-gradient(135deg,
        rgba(220, 80, 80, 0.2) 0%,
        rgba(180, 50, 50, 0.15) 50%,
        rgba(150, 30, 30, 0.2) 100%);
    box-shadow:
        0 4px 15px rgba(220, 80, 80, 0.2),
        inset 0 2px 0 rgba(255, 255, 255, 0.08),
        inset 0 -2px 0 rgba(0, 0, 0, 0.1);
    color: rgb(255, 120, 120);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.output::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.15),
        transparent);
    transition: left 0.5s;
}

.output:hover::before {
    left: 100%;
}

.output:hover {
    border-color: rgba(255, 150, 150, 0.4);
    background: linear-gradient(135deg,
        rgba(255, 100, 100, 0.3) 0%,
        rgba(220, 70, 70, 0.25) 50%,
        rgba(180, 50, 50, 0.3) 100%);
    box-shadow:
        0 6px 20px rgba(255, 100, 100, 0.3),
        0 0 30px rgba(255, 100, 100, 0.2),
        inset 0 2px 0 rgba(255, 255, 255, 0.12),
        inset 0 -2px 0 rgba(0, 0, 0, 0.15);
    color: rgb(255, 180, 180);
    transform: translateY(-2px);
}

.output:active {
    transform: translateY(0);
    box-shadow:
        0 2px 8px rgba(220, 80, 80, 0.3),
        inset 0 2px 4px rgba(0, 0, 0, 0.2),
        inset 0 -1px 0 rgba(255, 255, 255, 0.05);
}

/* =============================================
   АДАПТИВНОСТЬ ДЛЯ ТРЕХ РЕЖИМОВ
   ============================================= */

/* ПЛАНШЕТ (768px - 1024px) */
@media screen and (min-width: 768px) and (max-width: 1024px) {
    .window-content-account {
        width: 85%;
        margin: 30px auto auto;
    }

    .account-title {
        font-size: 17px;
    }

    .account-subtitle {
        font-size: 11px;
    }

    .account-content-wrapper {
        gap: 14px;
    }

    .player_profile_card {
        padding: 16px 18px;
        gap: 16px;
    }

    .avatar_frame {
        width: 75px;
        height: 75px;
        padding: 3px;
    }

    .player_name {
        font-size: 18px;
    }

    .player_identity {
        align-items: flex-start;
    }

    .player_stats_grid {
        gap: 6px;
    }

    .stat_item.stat_badge {
        padding: 9px 6px;
    }

    .stat_item.stat_badge .stat_icon {
        font-size: 17px;
    }

    .stat_item.stat_badge .stat_value {
        font-size: 9px;
    }

    .player_id_bar {
        padding: 9px 14px;
    }

    .id_label {
        font-size: 11px;
    }

    .id_value {
        font-size: 10px;
    }

    .profile_actions_title {
        font-size: 11px;
    }

    .acline {
        max-width: 350px;
    }
}

/* МОБИЛЬНЫЕ УСТРОЙСТВА (< 768px) */
@media screen and (max-width: 767px) {
    .window-content-account {
        width: 95%;
        margin: 20px auto auto;
    }

    .form {
        padding: 16px;
    }

    .account-header {
        padding: 12px;
        margin-bottom: 14px;
    }

    .account-title {
        font-size: 16px;
    }

    .account-subtitle {
        font-size: 10px;
    }

    .account-content-wrapper {
        gap: 12px;
    }

    .player_profile_card {
        flex-direction: column;
        align-items: flex-start;
        padding: 14px 16px;
        gap: 12px;
    }

    .avatar_frame {
        width: 70px;
        height: 70px;
        padding: 2px;
    }

    .profile_info_section {
        width: 100%;
    }

    .player_identity {
        align-items: flex-start;
    }

    .player_divider {
        width: 100%;
        max-width: 200px;
    }

    .player_name {
        font-size: 16px;
    }

    .player_stats_grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 4px;
    }

    .stat_item.stat_badge {
        padding: 8px 4px;
    }

    .stat_item.stat_badge .stat_icon {
        font-size: 16px;
    }

    .stat_item.stat_badge .stat_value {
        font-size: 8px;
    }

    .stat_item {
        justify-content: center;
    }

    .player_id_bar {
        padding: 8px 10px;
    }

    .id_label {
        font-size: 10px;
    }

    .id_value {
        font-size: 9px;
    }

    .profile_actions .acsubmit.nickname {
        padding: 10px 20px;
        font-size: 11px;
    }

    .profile_actions_title {
        font-size: 11px;
    }

    .account-footer {
        margin-top: 10px;
        padding: 6px 0 0;
    }

    .acline {
        margin: 10px auto 8px;
        max-width: 100%;
    }

    .output {
        width: auto;
        min-width: 70px;
        padding: 8px 16px;
        font-size: 11px;
    }

    .close-account {
        font-size: 28px;
        margin-right: 10px;
        margin-top: 6px;
    }
}

/* БОЛЬШИЕ МОНИТОРЫ (> 1200px) */
@media screen and (min-width: 1200px) {
    .window-content-account {
        width: 45%;
        margin: 50px auto auto;
    }

    .account-content-wrapper {
        gap: 16px;
    }

    .player_profile_card {
        padding: 20px 24px;
        gap: 20px;
    }

    .avatar_frame {
        width: 85px;
        height: 85px;
        padding: 4px;
    }

    .player_name {
        font-size: 22px;
    }

    .player_identity {
        align-items: flex-start;
    }

    .player_stats_grid {
        gap: 8px;
    }

    .stat_item.stat_badge {
        padding: 10px 8px;
    }

    .stat_item.stat_badge .stat_icon {
        font-size: 20px;
    }

    .stat_item.stat_badge .stat_value {
        font-size: 11px;
    }

    .player_id_bar {
        padding: 10px 16px;
    }

    .id_label {
        font-size: 12px;
    }

    .id_value {
        font-size: 11px;
    }

    .profile_actions_title {
        font-size: 13px;
    }

    .acline {
        max-width: 450px;
    }

    /* Опускаем крестик Language для больших экранов */
    .close-language-wrapper {
        top: 8px;
    }

    .close-language {
        top: 16px;
    }
}
@keyframes contentaccountGlow {
    0% {
        left: -300px;
        opacity: 0;
    }
    100% {
        left: 0px;
        opacity: 1;
    }
}
.player_avatar {
    width: 80%;
    border: 1px solid rgba(120,120,120,.5);
    box-shadow: 0px 5px 13px 0px rgba(0,0,0,.5);
    border-radius: 6px;
    display: flex;
    margin: 2%;
}
/* Профессиональный блок информации игрока - Production Ready */
.player_avatar {
    width: 100%;
    border: none;
    box-shadow: none;
    border-radius: 0;
    display: flex;
    margin: 0;
    background: transparent;
}

.wrapper_avatar {
    margin: 0;
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px;
    background: linear-gradient(135deg, rgba(205, 147, 65, 0.05) 0%, rgba(150, 100, 50, 0.03) 100%);
    border-radius: 12px;
    border: 1px solid rgba(205, 147, 65, 0.15);
    box-shadow:
        0 2px 12px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.03),
        0 0 25px rgba(205, 147, 65, 0.06);
    position: relative;
    overflow: hidden;
}

/* Декоративный градиентный фон */
.wrapper_avatar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(205, 147, 65, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(150, 100, 50, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.avatar_img {
    position: relative;
    z-index: 1;
    margin-bottom: 4px;
}

.avatar_img img {
    width: 85px;
    height: 85px;
    border-radius: 50%;
    border: 2px solid rgba(205, 147, 65, 0.4);
    box-shadow:
        0 0 0 2px rgba(205, 147, 65, 0.15),
        0 0 0 5px rgba(150, 100, 50, 0.08),
        0 4px 16px rgba(0, 0, 0, 0.3),
        inset 0 1px 4px rgba(255, 255, 255, 0.1);
    object-fit: cover;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, rgba(30, 60, 60, 0.9), rgba(15, 30, 30, 0.95));
}

.avatar_img img:hover {
    transform: scale(1.02);
    box-shadow:
        0 0 0 2px rgba(205, 147, 65, 0.6),
        0 0 0 5px rgba(205, 147, 65, 0.2),
        0 6px 20px rgba(0, 0, 0, 0.4),
        inset 0 2px 6px rgba(255, 255, 255, 0.2);
}

.wrapper_avatar h3 {
    color: rgb(205, 147, 65);
    font-size: 14px;
    margin: 0;
    font-weight: 700;
    text-shadow:
        0 1px 4px rgba(0, 0, 0, 0.3),
        0 0 10px rgba(205, 147, 65, 0.2);
    letter-spacing: 0.3px;
    position: relative;
    z-index: 1;
}

.wrapper_avatar p {
    color: rgb(180, 160, 140);
    font-size: 11px;
    margin: 0;
    position: relative;
    z-index: 1;
    transition: color 0.2s ease;
}

.player_clan {
    padding: 3px 12px;
    background: linear-gradient(135deg, rgba(100, 80, 60, 0.2), rgba(60, 50, 40, 0.12));
    border-radius: 10px;
    border: 1px solid rgba(150, 120, 80, 0.2);
    font-weight: 500;
}

.vip_status {
    padding: 4px 14px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 10px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* VIP статус - Active (золотой градиент) */
.vip_status::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: vipShine 3s infinite;
}

@keyframes vipShine {
    0% { left: -100%; }
    50%, 100% { left: 100%; }
}

/* Стили для кнопки смены имени */
.submit_box {
    margin: 8px 0 0;
    display: flex;
    justify-content: center;
    width: 100%;
}

.submit_box .acsubmit.nickname {
    padding: 8px 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-radius: 18px;
    border: 2px solid rgba(205, 147, 65, 0.25);
    background: linear-gradient(135deg,
        rgba(205, 147, 65, 0.12) 0%,
        rgba(150, 100, 50, 0.1) 50%,
        rgba(100, 70, 30, 0.08) 100%);
    box-shadow:
        0 2px 10px rgba(205, 147, 65, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 0 0 1px rgba(205, 147, 65, 0.08);
    color: rgb(205, 147, 65);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.submit_box .acsubmit.nickname::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(205, 147, 65, 0.15);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.submit_box .acsubmit.nickname:hover {
    border-color: rgba(205, 147, 65, 0.5);
    background: linear-gradient(135deg,
        rgba(205, 147, 65, 0.2) 0%,
        rgba(150, 100, 50, 0.15) 50%,
        rgba(100, 70, 30, 0.12) 100%);
    box-shadow:
        0 4px 15px rgba(205, 147, 65, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 0 2px rgba(205, 147, 65, 0.12);
    color: rgb(255, 215, 120);
    transform: translateY(-1px);
}

.submit_box .acsubmit.nickname:hover::before {
    width: 150px;
    height: 150px;
}

.submit_box .acsubmit.nickname:active {
    transform: translateY(0);
    box-shadow:
        0 1px 6px rgba(205, 147, 65, 0.3),
        inset 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* Адаптивность для мобильных */
@media screen and (max-width: 767px) {
    .wrapper_avatar {
        padding: 10px;
        gap: 6px;
    }

    .avatar_img img {
        width: 60px;
        height: 60px;
    }

    .wrapper_avatar h3 {
        font-size: 11px;
    }

    .wrapper_avatar p {
        font-size: 9px;
    }

    .player_clan {
        font-size: 9px;
        padding: 2px 8px;
    }

    .vip_status {
        font-size: 8px;
        padding: 2px 8px;
    }

    .submit_box .acsubmit.nickname {
        padding: 6px 14px;
        font-size: 10px;
    }

    .submit_box {
        margin: 4px 0 0;
    }
}
.data_player {
    margin: 5%;
}
.info_player {
    text-align: left;
    margin: 3% 3% 6% 3%;
}
.media_profiles {
    margin: 0 auto;
}
.media_text {
    margin-bottom: 2%;
}
.acsubmit {
    min-width: 15%;
    padding: 0.5% 3%;
    margin: 1% 0%;
    font-size: 2.2vh;
    border-radius: 6px;
    border: 1px solid #253737;
    background: linear-gradient(rgb(37, 131, 129), rgb(6, 54, 51) 60.71%);
    box-shadow: rgba(255,255,255,0.1) 0 1px 0, inset rgba(255,255,255,0.7) 0 1px 0;
    color: rgb(248, 185, 97);
    outline: none;
    cursor: pointer;
}
.acsubmit:hover {
    border: 1px solid #253737;
    background: linear-gradient(rgb(3, 165, 162), rgb(2, 85, 79) 60.71%);
    color: rgb(247, 200, 136);
}
.acsubmit:active {
    border: 1px solid #333333;
    background: linear-gradient(rgb(3, 165, 162), rgb(2, 85, 79) 60.71%);
    box-shadow: rgba(255,255,255,0) 0 1px 0, inset rgba(255,255,255,0.7) 0 1px 0;
    color: rgb(221, 179, 120);
    text-shadow: 0px 0px 1px rgba(0, 0, 0, 0.49);
}
/* Контейнер для крестика с максимальной изоляцией */
.close-account-wrapper {
    position: absolute;
    top: 0;
    right: 16px;
    width: 60px;
    height: 60px;
    z-index: 99999;

    /* Создаем новый stacking context */
    position: absolute;
    transform: translateZ(0);
    isolation: isolate;
    contain: layout style paint;

    /* Гарантируем, что контейнер не перехватывает события */
    pointer-events: none;

    /* Защита от перекрытия другими элементами */
    will-change: transform;
}

.close-account {
    /* Наследуем позицию от контейнера, но включаем события */
    position: relative;
    top: 12px;
    right: -12px;

    font-size: 32px;
    line-height: 1;
    color: rgba(205, 147, 65, 0.6);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);

    /* Фиксация точки вращения и изоляция */
    transform-origin: center center;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;

    /* Гарантируем перехват всех событий мыши */
    pointer-events: auto !important;
    -webkit-pointer-events: auto !important;
    -moz-pointer-events: auto !important;
    -ms-pointer-events: auto !important;

    /* Создаем невидимую область вокруг крестика */
    padding: 15px;
    margin: -15px;

    /* Изолируем от влияния других элементов */
    isolation: isolate;

    /* Создаем новый stacking context и композитный слой */
    transform: translateZ(0);
    will-change: transform;

    /* Защита от перекрытия */
    contain: layout style paint;

    /* Дополнительная защита от смешивания */
    mix-blend-mode: normal;

    /* Предотвращаем наследование нежелательных стилей */
    background: transparent;
    border: none;
    outline: none;
}

.close-account:hover {
    color: rgba(255, 200, 120, 1);
    transform: scale(1.1) rotate(90deg) translateZ(0);
    text-shadow:
        0 0 20px rgba(205, 147, 65, 0.8),
        0 0 40px rgba(255, 200, 120, 0.5);

    /* Повышаем приоритет при наведении */
    will-change: transform, color;
}

.close-account:active {
    transform: scale(0.95) rotate(90deg) translateZ(0);
}

/* ============================================
   LANGUAGE MODAL WINDOW - Account-info Style
   ============================================ */

.window-main-language {
    display: none;
    position: fixed;
    min-width: 100%;
    min-height: 100%;
    top: 0;
    left: 0;
    background-color: rgba(3, 15, 15, 0.85);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 100000;
    animation-name: languageFadeIn;
    animation-duration: 0.3s;
}

@keyframes languageFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.window-content-language {
    border: none;
    margin: 60px auto auto;
    width: 90%;
    max-width: 450px;
    border-radius: 24px;
    background: linear-gradient(145deg,
        rgba(15, 35, 45, 0.98) 0%,
        rgba(10, 25, 35, 0.96) 50%,
        rgba(8, 20, 28, 0.98) 100%);
    background-clip: padding-box;
    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.8),
        0 10px 40px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(205, 147, 65, 0.2),
        inset 0 2px 0 rgba(255, 255, 255, 0.08),
        inset 0 -2px 0 rgba(0, 0, 0, 0.3);
    color: rgb(205, 147, 65);
    position: relative;
    animation-name: languageSlideDown;
    animation-duration: 0.4s;
    animation-timing-function: ease-out;
    display: flex;
    flex-direction: column;
}

@keyframes languageSlideDown {
    0% {
        transform: translateY(-100px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Анимированная светящаяся рамка */
.window-content-language::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 26px;
    padding: 2px;
    background: linear-gradient(45deg,
        transparent 0%,
        rgba(205, 147, 65, 0.6) 20%,
        rgba(255, 200, 120, 0.8) 50%,
        rgba(205, 147, 65, 0.6) 80%,
        transparent 100%);
    background-size: 300% 300%;

    /* Standard mask property for modern browsers */
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;

    /* WebKit prefix for Safari and older Chrome */
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    pointer-events: none !important;
    -webkit-pointer-events: none !important;
    -moz-pointer-events: none !important;
    -ms-pointer-events: none !important;
    z-index: 1;
    animation: languageBorderGlow 4s linear infinite;
    opacity: 0.8;
}

@keyframes languageBorderGlow {
    0% {
        background-position: 0% 50%;
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
    100% {
        background-position: 300% 50%;
        opacity: 0.6;
    }
}

/* Контейнер для крестика с максимальной изоляцией */
.close-language-wrapper {
    position: absolute;
    top: 0;
    right: 16px;
    width: 60px;
    height: 60px;
    z-index: 99999;

    /* Создаем новый stacking context */
    position: absolute;
    transform: translateZ(0);
    isolation: isolate;
    contain: layout style paint;

    /* Гарантируем, что контейнер не перехватывает события */
    pointer-events: none;

    /* Защита от перекрытия другими элементами */
    will-change: transform;
}

.close-language {
    /* Наследуем позицию от контейнера, но включаем события */
    position: relative;
    top: 20px;
    right: 5px;

    font-size: 32px;
    line-height: 1;
    color: rgba(205, 147, 65, 0.6);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);

    /* Фиксация точки вращения и изоляция */
    transform-origin: center center;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;

    /* Гарантируем перехват всех событий мыши */
    pointer-events: auto !important;
    -webkit-pointer-events: auto !important;
    -moz-pointer-events: auto !important;
    -ms-pointer-events: auto !important;

    /* Создаем невидимую область вокруг крестика */
    padding: 15px;
    margin: -15px;

    /* Изолируем от влияния других элементов */
    isolation: isolate;

    /* Создаем новый stacking context и композитный слой */
    transform: translateZ(0);
    will-change: transform;

    /* Защита от перекрытия */
    contain: layout style paint;

    /* Дополнительная защита от смешивания */
    mix-blend-mode: normal;

    /* Предотвращаем наследование нежелательных стилей */
    background: transparent;
    border: none;
    outline: none;
}

.close-language:hover {
    color: rgba(255, 200, 120, 1);
    transform: scale(1.1) rotate(90deg) translateZ(0);
    text-shadow:
        0 0 20px rgba(205, 147, 65, 0.8),
        0 0 40px rgba(255, 200, 120, 0.5);

    /* Повышаем приоритет при наведении */
    will-change: transform, color;
}

.close-language:active {
    transform: scale(0.95) rotate(90deg) translateZ(0);
}

.language-content {
    position: relative;
    z-index: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    max-height: 75vh;
    overflow-y: auto;
}

/* Стилизация скроллбара для language-content и support-content */
.language-content::-webkit-scrollbar,
.support-content::-webkit-scrollbar {
    width: 8px;
}

.language-content::-webkit-scrollbar-track,
.support-content::-webkit-scrollbar-track {
    background: linear-gradient(180deg,
        rgba(10, 25, 35, 0.6) 0%,
        rgba(8, 20, 28, 0.8) 100%);
    border-radius: 4px;
    border: 1px solid rgba(205, 147, 65, 0.1);
}

.language-content::-webkit-scrollbar-thumb,
.support-content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg,
        rgba(205, 147, 65, 0.6) 0%,
        rgba(180, 130, 60, 0.8) 50%,
        rgba(205, 147, 65, 0.6) 100%);
    border-radius: 4px;
    border: 1px solid rgba(255, 200, 120, 0.3);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 0 10px rgba(205, 147, 65, 0.3);
    transition: all 0.3s ease;
}

.language-content::-webkit-scrollbar-thumb:hover,
.support-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg,
        rgba(255, 200, 120, 0.8) 0%,
        rgba(220, 170, 80, 1) 50%,
        rgba(255, 200, 120, 0.8) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 0 15px rgba(205, 147, 65, 0.6);
}

/* Заголовок модального окна */
.language-header {
    text-align: center;
    margin-bottom: 20px;
    padding: 14px 16px;
    background: linear-gradient(135deg,
        rgba(205, 147, 65, 0.12) 0%,
        rgba(180, 130, 60, 0.08) 50%,
        rgba(150, 100, 50, 0.12) 100%);
    border-radius: 16px;
    border: 1px solid rgba(205, 147, 65, 0.25);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 0 20px rgba(205, 147, 65, 0.05);
    position: relative;
    overflow: hidden;
}

.language-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.05) 50%,
        transparent 70%);
    animation: languageHeaderShine 6s linear infinite;
    pointer-events: none !important;
    -webkit-pointer-events: none !important;
    -moz-pointer-events: none !important;
    -ms-pointer-events: none !important;
    z-index: -1;
    contain: layout paint;
}

@keyframes languageHeaderShine {
    0% {
        transform: translateX(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) rotate(45deg);
    }
}

.language-title {
    color: rgb(205, 147, 65);
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 4px 0;
    text-shadow:
        0 2px 8px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(205, 147, 65, 0.3),
        0 0 40px rgba(205, 147, 65, 0.15);
    letter-spacing: 0.6px;
    position: relative;
    z-index: 1;
    animation: languageTitlePulse 3s ease-in-out infinite;
}

@keyframes languageTitlePulse {
    0%, 100% {
        text-shadow:
            0 2px 8px rgba(0, 0, 0, 0.4),
            0 0 20px rgba(205, 147, 65, 0.3),
            0 0 40px rgba(205, 147, 65, 0.15);
    }
    50% {
        text-shadow:
            0 2px 8px rgba(0, 0, 0, 0.4),
            0 0 30px rgba(205, 147, 65, 0.5),
            0 0 60px rgba(205, 147, 65, 0.25);
    }
}

.language-subtitle {
    color: rgb(180, 160, 140);
    font-size: 11px;
    margin: 0;
    font-weight: 500;
    letter-spacing: 0.4px;
    position: relative;
    z-index: 1;
    text-transform: uppercase;
    opacity: 0.9;
}

/* Сетка кнопок языков */
.language-buttons-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

/* Не сжимаем шапку и сетку: при нехватке высоты работает скролл language-content */
.language-content .language-header,
.language-content .language-buttons-grid {
    flex-shrink: 0;
}

.language-btn {
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-radius: 12px;
    border: 2px solid rgba(205, 147, 65, 0.25);
    background: linear-gradient(135deg,
        rgba(205, 147, 65, 0.12) 0%,
        rgba(150, 100, 50, 0.1) 50%,
        rgba(100, 70, 30, 0.08) 100%);
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 0 0 1px rgba(205, 147, 65, 0.08);
    color: rgb(205, 147, 65);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.language-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(205, 147, 65, 0.15);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.language-btn:hover {
    border-color: rgba(205, 147, 65, 0.5);
    background: linear-gradient(135deg,
        rgba(205, 147, 65, 0.2) 0%,
        rgba(150, 100, 50, 0.15) 50%,
        rgba(100, 70, 30, 0.12) 100%);
    box-shadow:
        0 6px 20px rgba(205, 147, 65, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 0 2px rgba(205, 147, 65, 0.12);
    color: rgb(255, 215, 120);
    transform: translateY(-2px);
}

.language-btn:hover::before {
    width: 150px;
    height: 150px;
}

.language-btn:active {
    transform: translateY(0);
    box-shadow:
        0 2px 10px rgba(205, 147, 65, 0.3),
        inset 0 1px 3px rgba(0, 0, 0, 0.15);
}

.language-btn.active {
    border-color: rgba(100, 200, 100, 0.6);
    background: linear-gradient(135deg,
        rgba(100, 200, 100, 0.3) 0%,
        rgba(80, 180, 80, 0.2) 50%,
        rgba(60, 160, 60, 0.3) 100%);
    box-shadow:
        0 6px 20px rgba(100, 200, 100, 0.4),
        0 0 20px rgba(100, 200, 100, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    color: rgb(150, 255, 150);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.language-btn.active:hover {
    border-color: rgba(120, 220, 120, 0.8);
    background: linear-gradient(135deg,
        rgba(120, 220, 120, 0.4) 0%,
        rgba(100, 200, 100, 0.3) 50%,
        rgba(80, 180, 80, 0.4) 100%);
    box-shadow:
        0 8px 25px rgba(120, 220, 120, 0.5),
        0 0 30px rgba(120, 220, 120, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    color: rgb(180, 255, 180);
}

/* Адаптивность для планшетов (768px - 1024px) */
@media screen and (min-width: 768px) and (max-width: 1024px) {
    .window-content-language {
        width: 85%;
        max-width: 420px;
        margin: 40px auto auto;
    }

    .language-content {
        padding: 18px;
    }

    .language-header {
        padding: 12px;
        margin-bottom: 18px;
    }

    .language-title {
        font-size: 17px;
    }

    .language-subtitle {
        font-size: 10px;
    }

    .language-buttons-grid {
        gap: 11px;
    }

    .language-btn {
        padding: 13px 15px;
        font-size: 13px;
    }
}

/* Адаптивность для мобильных */
@media screen and (max-width: 767px) {
    .window-content-language {
        width: 95%;
        max-width: 95vw;
        margin: 10px auto auto;
    }

    .language-content {
        padding: 12px;
        max-height: 70vh;
        overflow-y: auto;
    }

    .language-header {
        padding: 10px;
        margin-bottom: 12px;
    }

    .language-title {
        font-size: 14px;
    }

    .language-subtitle {
        font-size: 9px;
    }

    .language-buttons-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .language-btn {
        padding: 10px 12px;
        font-size: 12px;
        min-height: 40px;
    }

    /* Уменьшаем крестик для мобильных */
    .close-language {
        font-size: 28px;
        padding: 12px;
        margin: -12px;
    }

    .close-language-wrapper {
        width: 50px;
        height: 50px;
        right: 12px;
    }
}

/* ============================================================================
   МОДАЛЬНОЕ ОКНО ПОДДЕРЖКИ — единый визуальный стиль с окном выбора языка
   (переиспользуются keyframes languageFadeIn/languageSlideDown/languageBorderGlow/
   languageHeaderShine/languageTitlePulse — они глобальные)
   ============================================================================ */
.window-main-support {
    display: none;
    position: fixed;
    min-width: 100%;
    min-height: 100%;
    top: 0;
    left: 0;
    background-color: rgba(3, 15, 15, 0.85);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 100000;
    animation-name: languageFadeIn;
    animation-duration: 0.3s;
}

.window-content-support {
    border: none;
    margin: 24px auto auto;
    width: 90%;
    max-width: 560px;
    max-height: calc(100vh - 48px);
    border-radius: 24px;
    background: linear-gradient(145deg,
        rgba(15, 35, 45, 0.98) 0%,
        rgba(10, 25, 35, 0.96) 50%,
        rgba(8, 20, 28, 0.98) 100%);
    background-clip: padding-box;
    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.8),
        0 10px 40px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(205, 147, 65, 0.2),
        inset 0 2px 0 rgba(255, 255, 255, 0.08),
        inset 0 -2px 0 rgba(0, 0, 0, 0.3);
    color: rgb(205, 147, 65);
    position: relative;
    animation-name: languageSlideDown;
    animation-duration: 0.4s;
    animation-timing-function: ease-out;
    display: flex;
    flex-direction: column;
}

/* Анимированная светящаяся рамка (как у окна выбора языка) */
.window-content-support::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 26px;
    padding: 2px;
    background: linear-gradient(45deg,
        transparent 0%,
        rgba(205, 147, 65, 0.6) 20%,
        rgba(255, 200, 120, 0.8) 50%,
        rgba(205, 147, 65, 0.6) 80%,
        transparent 100%);
    background-size: 300% 300%;

    /* Standard mask property for modern browsers */
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;

    /* WebKit prefix for Safari and older Chrome */
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    pointer-events: none !important;
    -webkit-pointer-events: none !important;
    -moz-pointer-events: none !important;
    -ms-pointer-events: none !important;
    z-index: 1;
    animation: languageBorderGlow 4s linear infinite;
    opacity: 0.8;
}

/* Контейнер для крестика с максимальной изоляцией (как у окна выбора языка) */
.close-support-wrapper {
    position: absolute;
    top: 0;
    right: 16px;
    width: 60px;
    height: 60px;
    z-index: 99999;

    /* Создаем новый stacking context */
    transform: translateZ(0);
    isolation: isolate;
    contain: layout style paint;

    /* Гарантируем, что контейнер не перехватывает события */
    pointer-events: none;

    /* Защита от перекрытия другими элементами */
    will-change: transform;
}

.close-support {
    /* Наследуем позицию от контейнера, но включаем события */
    position: relative;
    top: 20px;
    right: 5px;

    font-size: 32px;
    line-height: 1;
    color: rgba(205, 147, 65, 0.6);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);

    /* Фиксация точки вращения и изоляция */
    transform-origin: center center;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;

    /* Гарантируем перехват всех событий мыши */
    pointer-events: auto !important;
    -webkit-pointer-events: auto !important;
    -moz-pointer-events: auto !important;
    -ms-pointer-events: auto !important;

    /* Создаем невидимую область вокруг крестика */
    padding: 15px;
    margin: -15px;

    /* Изолируем от влияния других элементов */
    isolation: isolate;

    /* Создаем новый stacking context и композитный слой */
    transform: translateZ(0);
    will-change: transform;

    /* Защита от перекрытия */
    contain: layout style paint;

    /* Дополнительная защита от смешивания */
    mix-blend-mode: normal;

    /* Предотвращаем наследование нежелательных стилей */
    background: transparent;
    border: none;
    outline: none;
}

.close-support:hover {
    color: rgba(255, 200, 120, 1);
    transform: scale(1.1) rotate(90deg) translateZ(0);
    text-shadow:
        0 0 20px rgba(205, 147, 65, 0.8),
        0 0 40px rgba(255, 200, 120, 0.5);

    /* Повышаем приоритет при наведении */
    will-change: transform, color;
}

.close-support:active {
    transform: scale(0.95) rotate(90deg) translateZ(0);
}

.support-content {
    position: relative;
    z-index: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;

    /* Растягиваемся на всю высоту окна, но не выходим за его пределы:
       при нехватке высоты прокручивается только support-content */
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.form {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Не сжимаем содержимое окна: при нехватке высоты включается скролл support-content,
   а не сплющивание шапки/полей/кнопки (иначе заголовок обрезается, кнопка исчезает) */
.support-content .form,
.support-content .form > * {
    flex-shrink: 0;
}

/* Заголовок модального окна (как у окна выбора языка) */
.support-header {
    text-align: center;
    margin-bottom: 6px;
    padding: 14px 16px;
    background: linear-gradient(135deg,
        rgba(205, 147, 65, 0.12) 0%,
        rgba(180, 130, 60, 0.08) 50%,
        rgba(150, 100, 50, 0.12) 100%);
    border-radius: 16px;
    border: 1px solid rgba(205, 147, 65, 0.25);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 0 20px rgba(205, 147, 65, 0.05);
    position: relative;
    overflow: hidden;
}

.support-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.05) 50%,
        transparent 70%);
    animation: languageHeaderShine 6s linear infinite;
    pointer-events: none !important;
    -webkit-pointer-events: none !important;
    -moz-pointer-events: none !important;
    -ms-pointer-events: none !important;
    z-index: -1;
    contain: layout paint;
}

/* Заголовок: текст приходит из переводов (mainText), «✦» добавляем псевдоэлементами,
   чтобы декор не пропадал при смене языка */
.mainText {
    color: rgb(205, 147, 65);
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 4px 0;
    text-shadow:
        0 2px 8px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(205, 147, 65, 0.3),
        0 0 40px rgba(205, 147, 65, 0.15);
    letter-spacing: 0.6px;
    position: relative;
    z-index: 1;
    animation: languageTitlePulse 3s ease-in-out infinite;
}

.support-header .mainText::before {
    content: '✦ ';
}

.support-header .mainText::after {
    content: ' ✦';
}

.secondText {
    color: rgb(180, 160, 140);
    font-size: 11px;
    margin: 0;
    font-weight: 500;
    letter-spacing: 0.4px;
    position: relative;
    z-index: 1;
    text-transform: uppercase;
    opacity: 0.9;
}

/* Подписи полей — в стиле подзаголовка окна выбора языка */
.textinput,
.forminput,
.emailinput {
    color: rgb(180, 160, 140);
    font-size: 11px;
    margin: 0 0 6px 0;
    font-weight: 500;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    opacity: 0.9;
    text-align: left;
}

/* Поля ввода — в стиле кнопок языков */
.window_input {
    border: 2px solid rgba(205, 147, 65, 0.25);
    outline: none;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    font-size: 14px;
    margin: 0;
    border-radius: 12px;
    background: linear-gradient(135deg,
        rgba(205, 147, 65, 0.12) 0%,
        rgba(150, 100, 50, 0.1) 50%,
        rgba(100, 70, 30, 0.08) 100%);
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 0 0 1px rgba(205, 147, 65, 0.08);
    color: rgb(248, 239, 196);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.window_input:hover {
    border-color: rgba(205, 147, 65, 0.5);
    box-shadow:
        0 6px 20px rgba(205, 147, 65, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 0 2px rgba(205, 147, 65, 0.12);
}

.window_input:focus {
    border-color: rgba(205, 147, 65, 0.5);
    box-shadow:
        0 6px 20px rgba(205, 147, 65, 0.35),
        0 0 20px rgba(205, 147, 65, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    color: rgb(255, 215, 120);
}

.window_input::placeholder,
.window-textarea::placeholder {
    color: rgba(180, 160, 140, 0.6);
}

.window-textarea {
    outline: none;
    border: 2px solid rgba(205, 147, 65, 0.25);
    border-radius: 12px;
    box-sizing: border-box;
    padding: 12px 14px;
    font-size: 14px;
    background: linear-gradient(135deg,
        rgba(205, 147, 65, 0.12) 0%,
        rgba(150, 100, 50, 0.1) 50%,
        rgba(100, 70, 30, 0.08) 100%);
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 0 0 1px rgba(205, 147, 65, 0.08);
    color: rgb(248, 239, 196);
    resize: vertical;
    width: 100%;
    /* Фиксированная компактная высота вместо высокой (rows="9"),
       чтобы форма целиком помещалась в окно без прокрутки */
    height: 150px;
    min-height: 150px;
    margin: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.window-textarea:hover {
    border-color: rgba(205, 147, 65, 0.5);
    box-shadow:
        0 6px 20px rgba(205, 147, 65, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 0 2px rgba(205, 147, 65, 0.12);
}

.window-textarea:focus {
    border-color: rgba(205, 147, 65, 0.5);
    box-shadow:
        0 6px 20px rgba(205, 147, 65, 0.35),
        0 0 20px rgba(205, 147, 65, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    color: rgb(255, 215, 120);
}

/* Загрузка файла — кнопка в стиле кнопок языков */
.input_file {
    cursor: pointer;
    opacity: 0;
    position: absolute;
    z-index: -1;
}

.input_file-icon {
    width: 20px !important;
    height: auto;
    display: block;
}

.input-icon {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-radius: 12px;
    border: 2px solid rgba(205, 147, 65, 0.25);
    background: linear-gradient(135deg,
        rgba(205, 147, 65, 0.12) 0%,
        rgba(150, 100, 50, 0.1) 50%,
        rgba(100, 70, 30, 0.08) 100%);
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 0 0 1px rgba(205, 147, 65, 0.08);
    color: rgb(205, 147, 65);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-icon:hover {
    border-color: rgba(205, 147, 65, 0.5);
    background: linear-gradient(135deg,
        rgba(205, 147, 65, 0.2) 0%,
        rgba(150, 100, 50, 0.15) 50%,
        rgba(100, 70, 30, 0.12) 100%);
    box-shadow:
        0 6px 20px rgba(205, 147, 65, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 0 2px rgba(205, 147, 65, 0.12);
    color: rgb(255, 215, 120);
    transform: translateY(-2px);
}

.file_text {
    position: relative;
    z-index: 1;
}

/* Разделительная черта в форме поддержки: отступы сжаты на 6px сверху и 6px снизу,
   чтобы блок «Прикрепить файл» и кнопка отправки были ближе друг к другу.
   Скоуп .form — базовый .acline используется и в других окнах */
.form .acline {
    margin: 8px auto 6px;
}

/* Кнопка отправки — в золотом стиле кнопок языков (только внутри окна поддержки) */
.form .acsubmit.send {
    min-width: 0;
    width: 100%;
    padding: 14px 16px;
    margin: 4px 0 0;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-radius: 12px;
    border: 2px solid rgba(205, 147, 65, 0.25);
    background: linear-gradient(135deg,
        rgba(205, 147, 65, 0.12) 0%,
        rgba(150, 100, 50, 0.1) 50%,
        rgba(100, 70, 30, 0.08) 100%);
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 0 0 1px rgba(205, 147, 65, 0.08);
    color: rgb(205, 147, 65);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form .acsubmit.send:hover {
    border-color: rgba(205, 147, 65, 0.5);
    background: linear-gradient(135deg,
        rgba(205, 147, 65, 0.2) 0%,
        rgba(150, 100, 50, 0.15) 50%,
        rgba(100, 70, 30, 0.12) 100%);
    box-shadow:
        0 6px 20px rgba(205, 147, 65, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 0 2px rgba(205, 147, 65, 0.12);
    color: rgb(255, 215, 120);
    transform: translateY(-2px);
}

.form .acsubmit.send:active {
    transform: translateY(0);
    box-shadow:
        0 2px 10px rgba(205, 147, 65, 0.3),
        inset 0 1px 3px rgba(0, 0, 0, 0.15);
}

.form .acsubmit.send:disabled {
    opacity: 0.6;
    cursor: default;
    transform: none;
}
#supbox {
    display: none;
}
#supbox:checked ~ .popup-lng {
    top: 22vh;
    visibility: visible;
    opacity: 1;
}
.gold {
    color: rgb(205, 147, 65);
    cursor: pointer;
    opacity: 0.9;
}
.gold:hover {
    color: rgb(255, 198, 123);
    transition: all 0.1s ease-in;
}
.popup-lng {
    color: rgb(248, 239, 196);
    border-radius: 2%;
    left: 50%;
    margin-right: -50%;
    transform: translate(-50%, 0%);
    min-width: 10%;
    background-color: rgba(202, 152, 83, 0.9);
    padding: 1% 3%;
    position: absolute;
    transition: 1s all;
    top: -600px;
    box-shadow: 0 0 5px rgba(14, 1, 1, 0.9);
    background-image: linear-gradient(180deg, transparent 30%, rgb(184, 120, 30));
    z-index: 1;
    opacity: 0;
    visibility: hidden;
}
.clouse-supbox {
    position: absolute;
    left: 89%;
    bottom: 92%;
}
.line {
    height: 3vh;
}
.clouse {
    font-size: calc(0.2em + 1vw);
    cursor: pointer;
}
.changelng {
display: flex;
flex-direction: column;
}
input.active {
    color: rgb(223, 16, 27);
    text-shadow: 0px 0px 1px rgba(177, 76, 163, 0.49);
    }
.translate {
    border-radius: 5px;
    margin: 2% 0%;
    border: none;
    font-size: 2.2vh;
    min-height: 3.5vh;
    text-align: center;
    box-shadow: 0px 0px 3px rgb(29, 29, 29);
    cursor: pointer;
    color: rgb(87, 57, 16);
    background-color: rgb(255, 255, 255);
    background-image: linear-gradient(180deg, transparent 90%, rgb(188, 191, 197));
}
.translate:hover {
    background-image: linear-gradient(180deg, transparent 85%, rgb(188, 191, 197));
    box-shadow: 0 0 6px rgb(58, 7, 7);
    margin: 2% 1%;
}
.translate:active {
    margin: 2% 2%;
}
.colorbg {
    position: absolute;
    right: 2rem;
    top: 43vh;
    z-index: 100;
}
.colorpoint {
    padding: 8px;
    margin: 5px;
    border: 2px solid rgba(255, 255, 255, .5);
    border-radius: 35%;
    opacity: 0.7;
    cursor: pointer;
    background-image: linear-gradient(50deg, transparent 70%, rgb(255, 255, 255));
}
.colorpoint:hover {
    opacity: 1;
    border: 2px solid rgba(255, 255, 255, .9);
    transition: all 0.100s ease-in-out;
    background-image: none;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.7);
}
#c0 {
    background-color: rgb(55, 40, 35);
}
#c1 {
    background-color: rgb(39, 38, 39);
}
#c2 {
    background-color: rgb(19, 33, 60);
}
#c3 {
    background-color: rgb(37, 23, 37);
}
#c4 {
    background-color: rgb(14, 64, 64);
}

/* ============================================
   CANVAS CONTAINER - ИЗОЛЯЦИЯ ОТ CSS
   ============================================ */
.canvas-container {
    /* Создаем новый stacking context для изоляции */
    position: relative;
    z-index: 1;
    isolation: isolate;

    /* Изолируем перерисовку и компоновку */
    contain: layout style paint;

    /* Создаем отдельный GPU слой для canvas */
    transform: translateZ(0);
    will-change: transform;

    /* Предотвращаем наследование нежелательных стилей */
    display: block;
    margin: 0 auto;
    max-width: 100%;

    /* Защита от CSS фильтров родительских элементов */
    filter: none;
    backdrop-filter: none;

    /* Предотвращаем влияние transform на canvas контекст */
    transform-origin: center center;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;

    /* Изолируем от смешивания режимов */
    mix-blend-mode: normal;
    isolation: isolate;
}

/* Canvas элементы внутри контейнера */
.canvas-container canvas {
    /* Сохраняем нативный canvas рендеринг */
    display: block;
    margin: 0 auto;

    /* === ОПТИМИЗАЦИЯ: Баланс качества и производительности === */
    /* Используем auto для сбалансированного рендеринга */
    image-rendering: auto;
    /* Убраны smooth/high-quality для улучшения производительности */

    /* === ОПТИМИЗАЦИЯ: Аппаратное ускорение === */
    /* Используем transform для GPU ускорения вместо width/height */
    /* transform: scale() будет применяться динамически через JS */
    transform-origin: center center;
    will-change: transform;

    /* Предотвращаем влияние CSS трансформаций на контекст */
    filter: none !important;
    backdrop-filter: none !important;

    /* Изолируем от смешивания */
    mix-blend-mode: normal;

    /* Создаем отдельный слой для каждого canvas */
    position: relative;
    z-index: 1;

    /* Предотвращаем влияние на canvas контекст */
    contain: layout style paint;

    /* === ОПТИМИЗАЦИЯ: Предотвращаем перерисовку === */
    /* Используем GPU композитинг */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    perspective: 1000px;
}


/* Canvas объявлен без размеров (Game/index.html) → рендерился дефолтными 300×150,
   а CanvasResizeManager растягивал его позже → гигантский layout shift.
   Формула 1-в-1 с resizeCanvas(): widthPercent = innerWidth*0.99 (= 99vw, body без скроллбара),
   availableHeight = innerHeight - headerHeight - 10, пропорция 3072/1920 = 1.6.
   Инлайн-стили от JS всё равно побеждают этот резерв (совпадает по значению — скачка нет).
   Без !important: мобильный media-квери ≤767px (height:100% !important) продолжает побеждать.
   --game-header-h ставится внешним JS/headerHeightFix.js ДО парсинга canvas (fallback 130px). */
#canvas {
    width: min(99vw, calc((100vh - var(--game-header-h, 130px) - 10px) * 1.6));
    aspect-ratio: 3072 / 1920;
    height: auto;
}

#canvas:focus {
    outline: none; /* Убираем обрамление */
}
@media screen and (max-width: 1280px) {
    .header-nav {
        padding: 1vh 0;
        font-size: 14px;
    }
        /* Уменьшение размера изображения логотипа */
        .logo-container {
            display: flex;
            justify-content: center;
            align-items: center;
        }
    .main-section {
        width: 75%;
        height: 81vh;
    }
    .colorbg {
        pointer-events: none;
        opacity: 0.01;
    }
    .popup {
        width: 15%;
    }
    .window-content-account {
        width: 40%;
        margin: 35px auto auto;
    }
    .logo-container img {
        width: 40%;
        height: auto;
    }
    .window-content-support {
        width: 85%;
        max-width: 520px;
        margin: 24px auto auto;
    }

    .support-content {
        padding: 18px;
    }

    .support-header {
        padding: 12px;
    }

    .mainText {
        font-size: 17px;
    }

    .secondText {
        font-size: 10px;
    }
}
@media screen and (max-width: 767px) {
    .header-nav {
        display: flex; /* Включаем flexbox */
        justify-content: center; /* Центрируем логотип */
        align-items: center; /* Выравнивание по центру */
        gap: 2vw; /* Равномерные отступы между всеми элементами */
        padding: 1vh 2vw; /* Добавляем боковые отступы */
        font-size: 11px;
    }

    .headerbox {
        flex-grow: 1; /* Равномерно распределяет пространство между элементами */
        text-align: center; /* Выравнивание текста по центру */
    }

    .logo-container {
        display: flex;
        justify-content: center;
        align-items: center;
        flex-grow: 1; /* Равномерно распределяет пространство */
        padding: 0;
    }
    .main-section {
        width: 90%;
        height: 82vh;
    }
    .colorbg {
        pointer-events: none;
        opacity: 0.01;
    }
    .popup {
        width: 20%;
    }
    .window-content-account {
        width: 95%;
    }
    .logo-container img {
        width: 20%; /* Более компактный логотип */
        height: auto;
        max-width: 80px; /* Ограничиваем максимальный размер */
    }
    #supbox:checked ~ .popup-lng {
        top: 2vh;
    }
    .window-content-support {
        width: 95%;
        max-width: 95vw;
        margin: 10px auto auto;
    }

    .support-content {
        padding: 12px;
        max-height: 70vh;
        overflow-y: auto;
    }

    .support-header {
        padding: 10px;
        margin-bottom: 4px;
    }

    .mainText {
        font-size: 14px;
    }

    .secondText,
    .textinput,
    .forminput,
    .emailinput {
        font-size: 9px;
    }

    .window_input,
    .window-textarea {
        padding: 10px 12px;
        font-size: 12px;
    }

    .input-icon {
        font-size: 11px;
        padding: 10px 12px;
    }

    /* Уменьшаем крестик для мобильных */
    .close-support {
        font-size: 28px;
        padding: 12px;
        margin: -12px;
    }

    .close-support-wrapper {
        width: 50px;
        height: 50px;
        right: 12px;
    }
    #loadingOverlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.8);
        color: white;
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 10000;
        font-size: 2rem;
        display: none;
      }

      .nickname-modal-content {
          width: 85%;
      }
}

/* Nickname Modal Styles */
.nickname-modal {
    display: none;
    position: fixed;
    min-width: 100%;
    min-height: 100%;
    top: 0;
    left: 0;
    background-color: rgba(3, 15, 15, 0.85);
    backdrop-filter: blur(5px);
    z-index: 1000;
    animation-name: fadeIn;
    animation-duration: 0.3s;
}

@keyframes fadeIn {
    from {opacity: 0;}
    to {opacity: 1;}
}

.nickname-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    max-width: 90%;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(9, 41, 41, 0.98), rgba(6, 30, 30, 0.98));
    border: 2px solid rgba(205, 147, 65, 0.3);
    box-shadow: 0 0 30px 10px rgba(0, 0, 0, 0.7), 0 0 60px 20px rgba(205, 147, 65, 0.1);
    padding: 30px;
    animation-name: modalAppear;
    animation-duration: 0.4s;
}

@keyframes modalAppear {
    from {
        top: 45%;
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        top: 50%;
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.nickname-modal-content h2 {
    color: rgb(205, 147, 65);
    text-align: center;
    margin-bottom: 8px;
    font-size: 24px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    font-weight: 600;
}

.nickname-modal-content p {
    color: rgb(180, 160, 140);
    text-align: center;
    margin-bottom: 25px;
    font-size: 14px;
}

.nickname-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 32px;
    color: rgba(138, 126, 23, 0.6);
    cursor: pointer;
    line-height: 1;
    transition: all 0.2s ease;
}

.nickname-modal-close:hover {
    color: rgba(205, 147, 65, 1);
    transform: scale(1.1);
}

.form-group {
    margin-bottom: 20px;
}

.nickname-input {
    width: 100%;
    height: 45px;
    font-size: 16px;
    padding: 12px 15px;
    border-radius: 8px;
    border: 2px solid rgba(205, 147, 65, 0.3);
    background-color: rgba(212, 211, 209, 0.95);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    display: block;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
    font-family: inherit;
}

.nickname-input:focus {
    box-shadow: 0 0 15px rgba(205, 147, 65, 0.4), inset 0 2px 4px rgba(0, 0, 0, 0.1);
    border-color: rgba(205, 147, 65, 0.8);
    background-color: rgba(255, 255, 255, 0.98);
}

.nickname-input::placeholder {
    color: rgba(100, 100, 100, 0.6);
}

.nickname-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
}

.nickname-confirm,
.nickname-cancel {
    padding: 12px 30px;
    font-size: 16px;
    border-radius: 8px;
    border: 2px solid rgba(205, 147, 65, 0.4);
    background: linear-gradient(180deg, rgb(37, 131, 129), rgb(6, 54, 51));
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    color: rgb(248, 185, 97);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 120px;
}

.nickname-confirm:hover,
.nickname-cancel:hover {
    border-color: rgba(205, 147, 65, 0.8);
    background: linear-gradient(180deg, rgb(3, 165, 162), rgb(2, 85, 79));
    color: rgb(247, 200, 136);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.nickname-confirm:active,
.nickname-cancel:active {
    border-color: rgba(205, 147, 65, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 2px rgba(0, 0, 0, 0.2);
    color: rgb(221, 179, 120);
    transform: translateY(0);
}

/* Изумрудный стиль для кнопки подтверждения ника */
.nickname-confirm {
    background: linear-gradient(135deg,
        rgba(180, 140, 220, 0.6) 0%,
        rgba(150, 120, 180, 0.5) 100%);
    border: 2px solid rgba(200, 170, 255, 0.4);
}

.nickname-confirm:hover {
    border-color: rgba(200, 170, 255, 0.6);
    background: linear-gradient(135deg,
        rgba(200, 160, 240, 0.7) 0%,
        rgba(170, 130, 200, 0.6) 100%);
    color: rgb(240, 220, 255);
    box-shadow:
        0 6px 20px rgba(180, 140, 220, 0.4),
        0 0 30px rgba(180, 140, 220, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.nickname-confirm:active {
    border-color: rgba(220, 180, 255, 0.8);
    box-shadow:
        0 2px 8px rgba(180, 140, 220, 0.4),
        inset 0 1px 2px rgba(0, 0, 0, 0.2);
    color: rgb(255, 230, 255);
}

/* Nickname Success State */
.nickname-success-container {
    text-align: center;
    padding: 10px 0;
}

.nickname-success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(205, 147, 65, 0.3), rgba(150, 200, 100, 0.3));
    border: 3px solid rgba(205, 147, 65, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: rgb(205, 147, 65);
    animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.nickname-new-name {
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    color: rgb(205, 147, 65);
    padding: 15px;
    background: rgba(205, 147, 65, 0.1);
    border-radius: 8px;
    margin: 15px 0 25px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Nickname Error Message */
.nickname-error {
    background: rgba(220, 80, 80, 0.95);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    animation: errorShake 0.4s ease-out;
    box-shadow:
        0 2px 8px rgba(220, 80, 80, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 100, 100, 0.3);
}

@keyframes errorShake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}
/* ========================================
   LocationCache - оптимизация рендеринга локаций
   ======================================== */

/* Контейнер для кэшированных локаций */
.location-container {
    /* Предотвращает рендеринг скрытых элементов */
    content-visibility: auto;
    
    /* Задаёт естественный размер для правильной работы content-visibility */
    contain-intrinsic-size: 3072px 1920px;
    
    /* Изоляция компоновки и стилей для ускорения рендеринга */
    contain: layout style paint;
    
    /* Аппаратное ускорение */
    will-change: transform;
    transform: translateZ(0);
    
    /* Оптимизация слоёв */
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Изображения в локациях - оптимизация загрузки */
.location-container img {
    /* Предотвращает сдвиги при загрузке */
    aspect-ratio: attr(width) / attr(height);
    
    /* Аппаратное ускорение для изображений */
    will-change: transform;
    transform: translateZ(0);
    
    /* Оптимизация рендеринга */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
}

/* Анимированные элементы в локациях */
.location-container .animated {
    /* Выносит анимированные элементы на отдельный слой */
    will-change: transform, opacity;
    transform: translateZ(0);
}

/* Оптимизация для больших локаций */
.location-container.large {
    /* Включает GPU ускорение */
    transform: translate3d(0, 0, 0);
    
    /* Изоляция для предотвращения влияния на другие элементы */
    contain: strict;
}

/* Предзагруженные изображения - не показываем до полной загрузки */
.location-container img[loading="lazy"] {
    background: linear-gradient(
        90deg,
        rgba(14, 64, 64, 0.1) 0%,
        rgba(14, 64, 64, 0.2) 50%,
        rgba(14, 64, 64, 0.1) 100%
    );
    background-size: 200% 100%;
    animation: loadingShimmer 1.5s infinite;
}

@keyframes loadingShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Оптимизация для фоновых изображений */
.location-container .background-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    contain: layout style paint;
}

/* Скрытые локации - вообще не рендерим */
.location-container[style*="display: none"],
.location-container.hidden {
    display: none !important;
    content-visibility: hidden;
    contain: strict;
}

/* Оптимизация переходов между локациями */
.location-container.fade-in {
    animation: locationFadeIn 0.15s ease-out;
}

@keyframes locationFadeIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Оптимизация памяти для невидимых локаций */
@media (prefers-reduced-motion: no-preference) {
    .location-container:not([style*="display: block"]) {
        /* Выгружаем из памяти невидимые локации */
        content-visibility: hidden;
        contain: strict;
    }
}

/* ===================================================================
   Xsolla Payment Modal Styles
   =================================================================== */

/* Модальное окно оплаты */
.xsolla-payment-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
}

.xsolla-payment-modal.hidden {
    display: none;
}

.xsolla-payment-modal.active {
    display: block;
}

/* Оверлей с затемнением */
.xsolla-payment-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Контейнер для виджета */
.xsolla-payment-container {
    position: relative;
    width: 90%;
    max-width: 1000px;
    height: 90%;
    max-height: 800px;
    background: #1a1a1a;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8),
                0 0 0 2px rgba(255, 215, 0, 0.3);
    overflow: hidden;
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Кнопка закрытия */
.xsolla-payment-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #ffffff;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10001;
    line-height: 1;
}

.xsolla-payment-close:hover {
    background: rgba(255, 69, 58, 0.8);
    border-color: rgba(255, 69, 58, 1);
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(255, 69, 58, 0.5);
}

.xsolla-payment-close:active {
    transform: scale(0.95);
}

/* Контейнер для Xsolla Widget iframe */
#xsolla-widget-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* Loading индикатор */
#xsolla-widget-container::before {
    content: 'Loading payment interface...';
    position: absolute;
    color: rgba(255, 255, 255, 0.7);
    font-size: 18px;
    font-family: Arial, sans-serif;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

/* Стилизация iframe внутри контейнера */
#xsolla-widget-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 20px;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .xsolla-payment-container {
        width: 95%;
        height: 95%;
        max-height: 95%;
        border-radius: 15px;
    }

    .xsolla-payment-close {
        width: 40px;
        height: 40px;
        font-size: 24px;
        top: 10px;
        right: 10px;
    }

    #xsolla-widget-container::before {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .xsolla-payment-container {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .xsolla-payment-close {
        width: 38px;
        height: 38px;
        font-size: 22px;
    }
}

/* Предотвращение скролла body когда модальное окно открыто */
body.xsolla-modal-open {
    overflow: hidden;
}

/* Улучшение видимости на темном фоне */
.xsolla-payment-overlay {
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.9) 0%,
        rgba(20, 20, 40, 0.85) 50%,
        rgba(0, 0, 0, 0.9) 100%
    );
}

/* =====================================================
   БЛОКИРОВКА СТАНДАРТНЫХ ЖЕСТОВ БРАУЗЕРА - МАКСИМАЛЬНАЯ
   ===================================================== */

/* АГРЕССИВНАЯ БЛОКИРОВКА ЖЕСТОВ ДЛЯ ВСЕХ ЭЛЕМЕНТОВ */
* {
    /* Блокируем все touch-жесты глобально */
    touch-action: none !important;
    -ms-touch-action: none !important;

    /* Отключаем контекстное меню на длинное нажатие (iOS/Android) */
    -webkit-touch-callout: none !important;

    /* Отключаем выделение текста для всех элементов */
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;

    /* Отключаем drag & drop */
    -webkit-user-drag: none !important;
}

/* Полная блокировка жестов для canvas с максимальным приоритетом */
#canvas,
.canvas-container,
canvas {
    /* Блокируем все touch-жесты с !important */
    touch-action: none !important;
    -ms-touch-action: none !important;

    /* Дополнительная блокировка */
    pointer-events: auto !important; /* Canvas принимает клики */

    /* Предотвращаем scroll на canvas */
    overscroll-behavior: none !important;
    -webkit-overflow-scrolling: none !important;

    /* Предотвращаем pull-to-refresh и bounce эффекты */
    overscroll-behavior-x: none !important;
    overscroll-behavior-y: none !important;
}

/* Предотвращаем zoom и scroll на всем body */
html, body {
    /* Максимальная блокировка жестов */
    touch-action: none !important;
    -ms-touch-action: none !important;

    /* Предотвращаем bounce эффект на iOS */
    overscroll-behavior: none !important;
    overscroll-behavior-x: none !important;
    overscroll-behavior-y: none !important;

    /* Блокируем инерциальный скролл */
    -webkit-overflow-scrolling: none !important;

    /* Отключаем стандартную подсветку на тап */
    -webkit-tap-highlight-color: transparent !important;
}

/* РАЗРЕШАЕМ ЖЕСТЫ ТОЛЬКО ДЛЯ КНОПОК И ИНТЕРАКТИВНЫХ ЭЛЕМЕНТОВ */
button,
input,
textarea,
a,
.acsubmit,
.language-btn,
.nickname-confirm,
.nickname-cancel,
.headerbox,
.headerbox span,
.headerbox a {
    /* Разрешаем только базовые touch-действия для кнопок */
    touch-action: manipulation !important;
    -ms-touch-action: manipulation !important;

    /* Включаем клики для кнопок */
    pointer-events: auto !important;

    /* Сохраняем подсветку для кнопок */
    -webkit-tap-highlight-color: rgba(205, 147, 65, 0.3) !important;

    /* Разрешаем выбор текста в input для удобства */
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
}

/* Специальная блокировка для модальных окон */
.window-main-account,
.window-main-language,
.window-main-support,
.nickname-modal,
.xsolla-payment-modal {
    /* Предотвращаем прокрутку за пределами модального окна */
    overscroll-behavior: contain;

    /* Блокируем жесты на модальных окнах */
    touch-action: none;
}

/* Предотвращаем zoom на input элементах (проблема iOS) */
input:focus,
textarea:focus {
    font-size: 16px !important;
    /* Предотвращаем auto-zoom на iOS */
}

/* iOS специфичные фиксы */
@supports (-webkit-touch-callout: none) {
    /* Safari и Chrome на iOS */
    body {
        /* Предотвращаем bounce effect */
        position: fixed;
        width: 100%;
        height: 100%;
        overflow: hidden;

        /* Восстанавливаем scroll для контента */
        -webkit-overflow-scrolling: touch;
    }

    main {
        /* Разрешаем scroll только в main */
        height: 100%;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Android специфичные фиксы */
@supports (touch-action: none) {
    /* Chrome и Firefox на Android */
    body {
        /* Предотвращаем pull-to-refresh */
        overscroll-behavior-y: contain;
    }
}

/* Дополнительная защита для canvas на мобильных */
@media screen and (max-width: 767px) {
    #canvas,
    .canvas-container {
        /* Максимальная блокировка жестов на мобильных */
        touch-action: none !important;
        pointer-events: auto !important;

        /* Предотвращаем любой скролл на canvas */
        overscroll-behavior: none !important;
        -webkit-overflow-scrolling: none !important;

        /* Отключаем все жесты */
        -ms-touch-action: none !important;

        /* === МОБИЛЬНАЯ ОПТИМИЗАЦИЯ: Полная ширина экрана === */
        width: 100vw; /* Занимаем всю ширину viewport */
        max-width: 100vw; /* Ограничиваем максимальную ширину */
        margin: 0 !important; /* Убираем все отступы */
        padding: 0 !important; /* Убираем все padding */
        left: 0 !important; /* Прижимаем к левому краю */
        right: 0 !important; /* Прижимаем к правому краю */
    }

    /* Дополнительная фиксация для body чтобы убрать зазоры */
    body {
        overflow-x: hidden; /* Скрываем горизонтальный скролл */
        margin: 0 !important;
        padding: 0 !important;
        width: 100vw;
    }

    /* Фиксация для main контейнера */
    main {
        width: 100vw;
        max-width: 100vw;
        margin: 0 !important;
        padding: 0 !important;
        overflow-x: hidden;
    }
}

/* =====================================================
   ГОРИЗОНТАЛЬНАЯ ОРИЕНТАЦИЯ ТЕЛЕФОНА (LANDSCAPE) - ИСПРАВЛЕНО
   ===================================================== */
@media screen and (max-width: 1024px) and (orientation: landscape) {

    /* === 0. ФИКСАЦИЯ VIEWPORT - Предотвращаем неправильные размеры === */
    html, body {
        overflow: hidden !important;
        position: fixed !important;
        width: 100% !important;
        height: 100% !important;
        top: 0 !important;
        left: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* === 1. Скрываем лишние элементы === */
    .logo-container {
        display: none !important;
    }
    .colorbg {
        display: none !important;
    }

    /* === 2. CANVAS - Полная высота, ограниченная ширина === */

    /* Контейнер canvas */
    .canvas-container {
        position: fixed !important;
        top: 0 !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        height: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 1 !important;
        pointer-events: none !important;
        background: transparent !important;
        border: none !important;
        overflow: hidden !important;
    }

    /* Сам canvas элемент — СТРОГО пропорциональный (3072/1920 = 1.6), без растяжения:
       ширина = min(100vw — края экрана, 100vh×1.6 = 160vh — потолок по высоте),
       высота автоматически из aspect-ratio → холст никогда не выше окна; в ландшафте
       (окно шире 1.6) холст доходит до левого/правого края, а пустота остаётся
       сверху/снизу — там размещаются угловые кнопки.
       Центрируем по обеим осям; пустоту закрашивает фон body. */
    #canvas {
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: min(100vw, 160vh) !important;
        height: auto !important;
        aspect-ratio: 3072 / 1920 !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        z-index: 2 !important;
        border: none !important;
        background: transparent !important;
    }

    /* === 4. ЭЛЕМЕНТЫ УПРАВЛЕНИЯ - Безопасное позиционирование === */

    /* ОБЩИЕ СТИЛИ ДЛЯ ВСЕХ ЭЛЕМЕНТОВ */
    .headerbox {
        position: absolute !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 6px !important;
        min-width: 55px !important;
        max-width: 75px !important;
        padding: 8px 5px !important;
        pointer-events: auto !important;
        background: rgba(14, 64, 64, 0.95) !important;
        border: 1px solid rgba(205, 147, 65, 0.5) !important;
        border-radius: 6px !important;
        z-index: 1001 !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5) !important;
    }

    /* Элементы внутри headerbox.
       Только прямые потомки (кнопки Account/Support/Language/Agreement) —
       иначе правило с !important ломает крестик внутри модальных окон */
    .headerbox > span,
    .headerbox > a {
        font-size: 8px !important;
        padding: 3px 5px !important;
        white-space: nowrap !important;
        text-align: center !important;
        color: rgb(205, 147, 65) !important;
        text-decoration: none !important;
        line-height: 1.1 !important;
    }

    /* БАГФИКС: зона наведения = ВЕСЬ бокс кнопки (рамка + padding), а не только текст.
       Раньше доступный отклик — курсор pointer от .gold над текстом; подсветки не было
       вовсе (.gold:hover / a:hover перекрыты !important-цветом .headerbox span). */
    .headerbox {
        cursor: pointer !important;
    }
    .headerbox:hover {
        border-color: rgb(255, 198, 123) !important;
        background: rgba(24, 82, 82, 0.97) !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.6), 0 0 8px rgba(205, 147, 65, 0.3) !important;
    }
    .headerbox:hover span,
    .headerbox:hover a {
        color: rgb(255, 198, 123) !important;
    }

    /* === ЛЕВАЯ СТОРОНА === */

    /* Account - левый верхний угол */
    .headerbox:nth-child(1) {
        top: 5px !important;
        left: 5px !important;
        max-height: 40vh !important;
        overflow: hidden !important;
    }

    /* Support - левый нижний угол */
    .headerbox:nth-child(2) {
        bottom: 5px !important;
        left: 5px !important;
        max-height: 40vh !important;
        overflow: hidden !important;
    }

    /* === ПРАВАЯ СТОРОНА === */

    /* Language - правый верхний угол */
    .headerbox:nth-child(4) {
        top: 5px !important;
        right: 5px !important;
        max-height: 40vh !important;
        overflow: hidden !important;
    }

    /* Agreement - правый нижний угол */
    .headerbox:nth-child(5) {
        bottom: 5px !important;
        right: 5px !important;
        max-height: 40vh !important;
        overflow: hidden !important;
    }

    /* === 5. ШАПКА - Корректное позиционирование === */
    .heading {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 100% !important;
        z-index: 1000 !important;
        pointer-events: none !important;
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .header-nav {
        position: relative !important;
        width: 100% !important;
        height: 100% !important;
        display: block !important;
        pointer-events: none !important;
        background: transparent !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
    }

    /* === 5. АДАПТАЦИЯ МОДАЛЬНЫХ ОКОН === */
    .window-content-account,
    .window-content-language {
        margin: 10vh auto !important;
        max-height: 80vh !important;
        overflow-y: auto !important;
        width: 80% !important;
        max-width: 600px !important;
    }

    /* Окно поддержки: компактные отступы, вся высота экрана,
       прокрутка внутри support-content — ничего не обрезается */
    .window-content-support {
        margin: 12px auto !important;
        width: 92% !important;
        max-width: 560px !important;
        max-height: calc(100vh - 24px) !important;
    }

    /* === 6. MAIN - Гарантируем видимость canvas === */
    main {
        position: relative !important;
        z-index: 1 !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
    }
}

/* =====================================================
   УСИЛЕННАЯ БЛОКИРОВКА ЖЕСТОВ ДЛЯ CANVAS
   ===================================================== */

/* Дополнительная защита canvas - усиливаем базовую блокировку */
#canvas {
    /* Гарантируем, что canvas не масштабируется */
    touch-action: none !important;
    -ms-touch-action: none !important;
    pointer-events: auto !important; /* Принимаем клики */
}

.canvas-container {
    /* Пропускаем клики к canvas */
    touch-action: none !important;
    pointer-events: none !important;
}

/* =====================================================
   TOAST УВЕДОМЛЕНИЯ ДЛЯ PAYMENT ОШИБОК
   ===================================================== */

.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    pointer-events: none;
}

.toast-notification {
    background: linear-gradient(135deg, rgba(220, 80, 80, 0.95) 0%, rgba(180, 60, 60, 0.95) 100%);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    margin-bottom: 12px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
    box-shadow: 0 8px 32px rgba(220, 80, 80, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 100, 100, 0.3);
    backdrop-filter: blur(10px);
    animation: toastSlideDown 0.4s ease-out, toastFadeOut 0.3s ease-in 2.7s forwards;
    pointer-events: auto;
    max-width: 400px;
    min-width: 280px;
}

@keyframes toastSlideDown {
    0% {
        transform: translateY(-100px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes toastFadeOut {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-20px);
    }
}

.toast-notification.success {
    background: linear-gradient(135deg, rgba(80, 180, 80, 0.95) 0%, rgba(60, 150, 60, 0.95) 100%);
    box-shadow: 0 8px 32px rgba(80, 180, 80, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(100, 255, 100, 0.3);
}

.toast-notification.info {
    background: linear-gradient(135deg, rgba(80, 140, 220, 0.95) 0%, rgba(60, 110, 180, 0.95) 100%);
    box-shadow: 0 8px 32px rgba(80, 140, 220, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(100, 180, 255, 0.3);
}

/* ===================================================================
   Vote Modal Styles (BrowserMMORPG) — кнопка «Проголосовать» в окне
   «Аккаунт» (#vote-open-btn) и окно «Поддержать Oblivion Sword» (#vote-modal).
   Палитра и рамки — как у nickname-modal: тёмный тил, золото rgb(205,147,65).
   =================================================================== */

/* Кнопка «Проголосовать»: геометрия — как у соседней «Change Nickname»
   (.profile_actions .acsubmit.nickname), гамма — золотая (как вариант
   .submit_box .acsubmit.nickname), чтобы отличаться от кнопки смены ника. */
.profile_actions .acsubmit.vote-btn {
    width: 100%;
    max-width: 280px;
    padding: 12px 24px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    border-radius: 12px;
    border: 2px solid rgba(205, 147, 65, 0.25);
    background: linear-gradient(135deg,
        rgba(205, 147, 65, 0.12) 0%,
        rgba(150, 100, 50, 0.1) 50%,
        rgba(100, 70, 30, 0.08) 100%);
    box-shadow:
        0 2px 10px rgba(205, 147, 65, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 0 0 1px rgba(205, 147, 65, 0.08);
    color: rgb(205, 147, 65);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.profile_actions .acsubmit.vote-btn:hover {
    border-color: rgba(205, 147, 65, 0.5);
    background: linear-gradient(135deg,
        rgba(205, 147, 65, 0.2) 0%,
        rgba(150, 100, 50, 0.15) 50%,
        rgba(100, 70, 30, 0.12) 100%);
    box-shadow:
        0 4px 15px rgba(205, 147, 65, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 0 2px rgba(205, 147, 65, 0.12);
    color: rgb(255, 215, 120);
    transform: translateY(-2px);
}

.profile_actions .acsubmit.vote-btn:active {
    transform: translateY(0);
    box-shadow:
        0 2px 10px rgba(205, 147, 65, 0.3),
        inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Оверлей окна голосования — как у nickname-modal (rgba(3,15,15,.85) + blur) */
.vote-modal {
    display: none;
    position: fixed;
    min-width: 100%;
    min-height: 100%;
    top: 0;
    left: 0;
    background-color: rgba(3, 15, 15, 0.85);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation-name: fadeIn;
    animation-duration: 0.3s;
}

/* Панель — та же тёмная тил-градиентная рамка с золотым свечением */
.vote-modal-content {
    position: relative;
    width: 560px;
    max-width: 92%;
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(9, 41, 41, 0.98), rgba(6, 30, 30, 0.98));
    border: 2px solid rgba(205, 147, 65, 0.3);
    box-shadow: 0 0 30px 10px rgba(0, 0, 0, 0.7), 0 0 60px 20px rgba(205, 147, 65, 0.1);
    padding: 30px 24px 24px;
    animation-name: voteModalAppear;
    animation-duration: 0.4s;
}

@keyframes voteModalAppear {
    from {
        opacity: 0;
        transform: scale(0.92);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.vote-modal-title {
    color: rgb(205, 147, 65);
    text-align: center;
    margin: 0 0 18px;
    font-size: 22px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    font-weight: 600;
}

.vote-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 32px;
    color: rgba(138, 126, 23, 0.6);
    cursor: pointer;
    line-height: 1;
    transition: all 0.2s ease;
    z-index: 1;
}

.vote-modal-close:hover {
    color: rgba(205, 147, 65, 1);
    transform: scale(1.1);
}

/* Внутренняя рамка-вставка под карточку виджета: золотая кромка на тёмном
   фоне — карточка BrowserMMORPG выглядит элементом интерфейса, а не чужой
   рекламой. Стили самой карточки (.bmmorc-*) НЕ переопределяются. */
.vote-widget-frame {
    border: 1px solid rgba(205, 147, 65, 0.25);
    border-radius: 10px;
    background: rgba(6, 22, 26, 0.6);
    padding: 12px;
    box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.45);
    overflow-x: auto; /* широкая карточка скроллится внутри рамки, а не рвёт окно */
}

/* Мобильные: окно почти во всю ширину, отступы компактнее */
@media screen and (max-width: 767px) {
    .vote-modal-content {
        width: 92%;
        max-width: none;
        padding: 24px 10px 16px;
    }

    .vote-modal-title {
        font-size: 18px;
        padding: 0 34px 0 0;
    }

    .vote-widget-frame {
        padding: 8px;
    }
}
