/* Мониторинг карточками (как в шаблоне never) — monitoringType = 0 */

.servers-cards {
    --sc-accent: var(--color-head, #6080ff);
    --sc-bg: #131821;
    --sc-border: #1d2436;
    margin-bottom: 30px;
}

/* ---------- Шапка: "Сервера" / "На серверах" ---------- */
.servers-cards__heading {
    position: relative;
    z-index: 0;
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.servers-cards__head {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px;
    border-radius: 15px;
    background: var(--sc-bg);
    border: 1px solid var(--sc-border);
}

.servers-cards__head--title {
    flex: 1 1 auto;
}

.servers-cards__head--online {
    flex: 0 0 auto;
    min-width: 200px;
}

.servers-cards__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--sc-accent);
    color: #fff;
    font-size: 19px;
}

.servers-cards__online-icon {
    display: flex;
    color: var(--sc-accent);
    font-size: 22px;
}

.servers-cards__title {
    color: #fff;
    font-weight: 600;
    font-size: 17px;
}

.servers-cards__subtitle {
    color: #d9dce7;
    font-weight: 600;
    font-size: 16px;
}

/* Кольцо заполненности онлайна вокруг блока (заполняется модулем online_line) */
.servers-cards__ring {
    position: absolute;
    z-index: -1;
    top: -3px;
    left: -3px;
    width: calc(100% + 6px);
    height: calc(100% + 6px);
    border-radius: 18px;
    pointer-events: none;
}

/* ---------- Сетка карточек ---------- */
.servers-categories {
    display: grid;
    grid-gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
}

.servers-categories > .loader {
    grid-column: 1 / -1;
}

.server-card-item {
    position: relative;
    min-width: 0;
}

/* ---------- Карточка сервера ---------- */
.server-category-card {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-height: 120px;
    padding: 20px 30px 20px 20px;
    border-radius: 15px;
    border: 1px solid var(--sc-border, #1d2436);
    cursor: pointer;
}

.server-category-card,
.server-category-card:hover,
.server-category-card:focus {
    text-decoration: none;
    outline: none;
}

.server-category-card__name {
    font-size: 14px;
    text-transform: uppercase;
    font-weight: 600;
    color: #d9dce7;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 8px;
    text-shadow: 0 0 10px #000;
}

.server-category-card__infos {
    margin-top: auto;
}

.server-category-card .info-item {
    display: flex;
    align-items: baseline;
    text-shadow: 0 0 10px #000;
    min-width: 0;
}

.server-category-card .info-item__title {
    flex: 0 0 auto;
    font-size: 11px;
    padding-right: 15px;
    color: #b8bac0;
    text-align: left;
}

.server-category-card .info-item__value {
    font-size: 14px;
    font-weight: 700;
    color: #e4e6ec;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Фон с картинкой карты */
.server-category-card__bg-container,
.server-category-card__bg-container:before {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    pointer-events: none;
}

.server-category-card__bg-container {
    z-index: -2;
    overflow: hidden;
    color: #1d2848;
    transition: box-shadow .3s, color .3s;
}

.server-category-card__bg-container:before {
    content: "";
    z-index: 1;
    background-image: linear-gradient(90deg, #0c101a, rgba(12, 16, 26, .35));
    transition: box-shadow .3s;
}

.server-category-card__bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    transition: transform .4s;
}

.server-category-card:hover .server-category-card__bg-container,
.server-category-card:focus .server-category-card__bg-container {
    color: var(--sc-accent, #6080ff);
    box-shadow: 0 0 0 2px currentColor;
}

.server-category-card:hover .server-category-card__bg {
    transform: scale(1.05);
}

.server-category-card:active .server-category-card__bg-container {
    color: #9b9ea8;
    box-shadow: 0 0 0 3px currentColor, 0 0 28px 3px currentColor;
}

.server-category-card:active .server-category-card__bg-container:before {
    box-shadow: inset 0 0 28px 0 rgba(155, 158, 168, .8);
}

/* Кнопка управления сервером (RCON) */
.server-category-card__manage {
    position: absolute;
    z-index: 2;
    top: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(19, 24, 33, .8);
    color: #d9dce7;
    font-size: 16px;
    cursor: pointer;
    transition: .2s;
}

.server-category-card__manage:hover {
    background: var(--sc-accent, #6080ff);
    color: #fff;
}

/* ---------- Модалка игроков ---------- */
.server-card-modal .modal-content {
    padding: 0;
    overflow: hidden;
}

.server-card-modal__head {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
}

/* Картинка карты плавно растворяется в фон окна (любой темы) */
.server-card-modal__bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #393d50;
    background-size: cover;
    background-position: center;
    -webkit-mask-image: linear-gradient(to bottom, #000 35%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 35%, transparent 100%);
}

.server-card-modal__bg:after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, .35);
}

.server-card-modal__head .close {
    position: absolute;
    z-index: 2;
    top: 15px;
    right: 15px;
    color: #fff;
    text-shadow: none;
    opacity: .8;
}

.server-card-modal__info {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 0 20px;
    color: #fff;
    font-weight: 700;
    text-align: center;
}

.server-card-modal__name {
    font-size: 16px;
}

.server-card-modal__online {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    padding: 0 15px;
    border-radius: 50px;
    background: rgba(19, 24, 33, .81);
    font-size: 11px;
    font-weight: 600;
}

.server-card-modal__buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.server-card-modal__buttons .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
}

.server-card-modal__buttons .btn i {
    font-size: 18px;
}

/* ---------- Адаптив ---------- */
@media (max-width: 767.98px) {
    .servers-cards__heading {
        flex-direction: column;
        gap: 10px;
    }

    .servers-cards__head--online {
        min-width: 0;
    }
}

@media (max-width: 575.98px) {
    .servers-categories {
        grid-template-columns: 100%;
    }
}

@media (max-width: 420px) {
    .server-category-card {
        padding: 17px 20px 20px;
    }
}

/* =====================================================================
   Сервера на странице входа (tpl/index/body.tpl) — справа от формы, как на экране
   входа шаблона never: название сайта и карточки .gr-srv из elements/server.tpl
   (онлайн с полоской, название, IP, карта, кнопка PLAY), в золотых цветах страницы входа.
   В других местах сайта карточек .gr-srv не видно
   ===================================================================== */
.gr-srv {
    display: none;
}

.gr-auth-servers {
    position: relative;
    z-index: 2;
    flex: 0 1 440px;
    min-width: 0;
    padding: 20px;
}

.gr-auth-servers__title {
    margin: 0 0 14px;
    color: #fff;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: .02em;
    line-height: 1.2;
    text-align: center;
    text-shadow: 0 0 18px rgba(255, 215, 0, .35);
}

.gr-auth-servers__title b {
    color: #ffd700;
    font-weight: inherit;
}

/* больше четырёх серверов — с прокруткой */
.gr-auth-servers__list {
    display: block;
    max-height: 382px;
    overflow-y: auto;
    padding-right: 6px;
    scrollbar-width: thin;
    scrollbar-color: #ffd700 transparent;
}

.gr-auth-servers__list::-webkit-scrollbar { width: 5px; }
.gr-auth-servers__list::-webkit-scrollbar-thumb { background: #ffd700; border-radius: 4px; }

.gr-auth-servers__list > .loader {
    margin: 30px auto;
}

.gr-auth-servers .server-card-item {
    margin: 0 0 10px;
}

.gr-auth-servers .server-category-card,
.gr-auth-servers .server-category-card__manage {
    display: none !important;
}

.gr-auth-servers .gr-srv {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 84px;
    padding: 10px 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 215, 0, .28);
    border-radius: 15px;
    background: #11111d;
    box-shadow: 0 0 16px rgba(255, 215, 0, .12);
}

.gr-srv__bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .55;
    pointer-events: none;
}

.gr-auth-servers .gr-srv::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(10, 10, 18, .92) 0%, rgba(10, 10, 18, .5) 55%, rgba(10, 10, 18, .85) 100%);
}

.gr-srv__online,
.gr-srv__info,
.gr-srv__play {
    position: relative;
    z-index: 1;
}

.gr-srv__online {
    display: flex;
    flex: 0 0 64px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 64px;
    border: 1px solid rgba(255, 215, 0, .3);
    border-radius: 12px;
    background: rgba(10, 10, 18, .85);
    color: #fff !important;
    text-decoration: none !important;
    cursor: pointer;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.gr-srv__online:hover {
    border-color: #ffd700;
    box-shadow: 0 0 12px rgba(255, 215, 0, .45);
}

.gr-srv__now {
    font-size: 13px;
    font-weight: 800;
}

.gr-srv__bar {
    display: block;
    width: 40px;
    height: 4px;
    overflow: hidden;
    border-radius: 4px;
    background: rgba(255, 255, 255, .14);
}

.gr-srv__bar span {
    display: block;
    max-width: 100%;
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, #ffd700, #ffed4e);
}

.gr-srv__info {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    color: rgba(255, 255, 255, .85);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
}

.gr-srv__info > * {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.gr-srv__name {
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

/* PLAY — вертикальная кнопка, читается снизу вверх */
.gr-srv__play {
    display: flex;
    flex: 0 0 34px;
    align-items: center;
    justify-content: center;
    height: 64px;
    border: 1.5px solid #ffd700;
    border-radius: 18px;
    color: #fff !important;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
    text-decoration: none !important;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}

.gr-srv__play:hover {
    border-color: transparent;
    background: linear-gradient(90deg, #ffd700, #ffed4e);
    box-shadow: 0 0 14px rgba(255, 215, 0, .55);
    color: #0a0a12 !important;
}

/* планшет и телефон: сервера под формой */
@media (max-width: 991.98px) {
    .dc_auth_00 {
        flex-direction: column;
    }

    .gr-auth-servers {
        flex: 0 0 auto;
        width: 100%;
        max-width: 480px;
        padding: 0 15px 30px;
    }

    .gr-auth-servers__list {
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }
}

/* узкий телефон: название в одну строку */
@media (max-width: 479.98px) {
    .gr-auth-servers__title {
        font-size: 22px;
        font-size: min(22px, 6.2vw);
        white-space: nowrap;
    }
}
