/* ==========================================================================
   1. БАЗА
   ========================================================================== */
html,
body {
    margin: 0;
    padding: 0;
    background-color: #000;
    color: #fff;
    font-family: Arial, sans-serif;
}

/* Standalone team.html — flex-column */
body.team-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
}

/* Ссылка "← Главная" для standalone team.html */
.team-back-link {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 100;
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    font-size: 13px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 6px 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: color 0.3s ease, border-color 0.3s ease;
}

.team-back-link:hover {
    color: #ff0000;
}

/* ==========================================================================
   2. ШАПКА
   ========================================================================== */
.team-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 40px;
    border-bottom: none;
    height: 73px;
    position: relative;
}

.team-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.team-logo img {
    height: 57px;
    width: auto;
    display: block;
    padding: 8px 0;
    box-sizing: border-box;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.team-logo:hover img {
    opacity: 1;
}

/* Бургер — скрыт на десктопе, справа в шапке */
.burger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 32px;
    height: 100%;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    position: absolute;
    right: 20px;
    top: 0;
}

.burger-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: #fff;
    border-radius: 1px;
}

.burger-btn:hover span {
    background: #ff0000;
}

/* Мобильное меню — скрыто по умолчанию */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100vh;
    background: #000;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 80px 0 0 20px;
    z-index: 100002;
    visibility: hidden;
    transition: right 0.3s ease, visibility 0s linear 0.3s;
}

.mobile-menu.open {
    right: 0;
    visibility: visible;
    transition: right 0.3s ease, visibility 0s linear 0s;
}

.mobile-menu-link {
    display: flex;
    align-items: center;
    padding: 6px 14px;
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    font-weight: normal;
    font-family: Arial, sans-serif;
    letter-spacing: 0.5px;
    text-align: left;
    background: transparent;
    border: none;
    border-radius: 12px;
    width: 100%;
    box-sizing: border-box;
    transition: color 0.3s ease;
    cursor: pointer;
}

.mobile-menu-link:hover {
    color: #ff0000;
    background: transparent;
}

/* Кнопки «билеты» и «поддержать» в бургере — pill-стиль как TG-FAB */
.mobile-menu-link.ticket-btn,
.mobile-menu-link.donate-btn {
    background: transparent;
    border: none;
    border-radius: 999px;
    padding: 0 10px 0 5px;
    height: 32px;
    width: auto;
    box-shadow: inset 0 0 0 2px rgba(255, 0, 0, 0.8);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.3px;
    justify-content: flex-start;
    transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.mobile-menu-link.ticket-btn:hover,
.mobile-menu-link.donate-btn:hover {
    background: transparent;
    color: #ff0000;
    box-shadow: inset 0 0 0 2px rgba(255, 0, 0, 1);
}

.mobile-menu-link.ticket-btn:active,
.mobile-menu-link.donate-btn:active {
    transform: scale(0.97);
}

.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 100001;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.3s ease,
        visibility 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Заголовок страницы + стрелки */
.team-page-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 8px 40px 0;
}

/* Десктоп: стрелки абсолютно позиционированы справа,
   центрированы по вертикали в отступе между шапкой и карточками */
@media (min-width: 769px) {
    .team-page-header {
        position: absolute;
        top: calc(var(--header-h) + 40px);
        height: 60px;
        right: 0;
        left: 0;
        padding: 0 40px;
        align-items: center;
        justify-content: flex-end;
        pointer-events: none;
        z-index: 10;
    }
    .team-nav-arrows {
        pointer-events: auto;
    }
    /* Отступ сверху для карточек, чтобы не залезали под стрелки */
    .team-grid {
        padding-top: 60px;
    }
}


.team-page-title {
    font-family: Arial, sans-serif;
    font-size: 56px;
    /*font-weight: bold;*/
    color: #fff;
    /*text-transform: uppercase;*/
    letter-spacing: 1px;
    display: none;
}

.team-nav-arrows {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Крестик закрытия команды — скрыт на десктопе */
.team-close-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.team-close-btn:hover {
    background: rgba(255, 0, 0, 0.05);
}

.team-close-btn:hover svg path {
    stroke: #ff0000;
}

.team-close-btn svg path {
    transition: stroke 0.3s ease;
}

.team-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    outline: none;
    padding: 0;
    cursor: pointer;
}


.team-arrow:hover svg * {
    stroke: #ff0000;
}

.team-arrow svg * {
    transition: stroke 0.3s ease;
}

/* ==========================================================================
   3. ЛОАДЕР ФОТО (красный спиннер)
   ========================================================================== */
.team-card-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111;
    border-radius: 16px;
    z-index: 2;
    transition: opacity 0.3s ease;
}

.team-card-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.team-card-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #ff0000;
    border-radius: 50%;
    animation: team-spinner 0.8s linear infinite;
}

@keyframes team-spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Мобайл — скругление как у карточек */
@media (max-width: 768px) {
    .team-card-loader {
        border-radius: 24px;
    }
}

/* ==========================================================================
   4. РЯД КАРТОЧЕК — горизонтальный скролл, центрирование по вертикали
   ========================================================================== */
.team-grid {
    display: flex;
    align-items: center;
    gap: 20px;
    /*padding: 12px 450px 24px;*/
    padding-top: 24px;
    padding-right: 39px;
    padding-bottom: 24px;
    padding-left: 26.5%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
    flex: 1;
    height: auto;
    min-height: 0;
    box-sizing: border-box;
}

/* Кастомный скроллбар — WebKit */
.team-grid::-webkit-scrollbar {
    height: 6px;
}

.team-grid::-webkit-scrollbar-track {
    background: transparent;
}

.team-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.team-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 0, 0, 0.5);
}

/* ==========================================================================
   4. КАРТОЧКА УЧАСТНИКА
   ========================================================================== */
.team-card {
    flex-shrink: 0;
    width: calc((100vw - 80px - 60px) / 4);
    transition: transform 0.3s ease;
}

.team-card:hover {
    transform: none;
}

.team-card-photo {
    position: relative;
    width: 100%;
    aspect-ratio: 854 / 1280;
    max-height: calc(100dvh - var(--header-h) - 220px);
    overflow: hidden;
    background: #111;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    transition: border-color 0.3s ease;
}

.team-card:hover .team-card-photo {
}

.team-card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: filter 0.3s ease;
}

.team-card:hover .team-card-photo img {
    filter: brightness(1.1);
}

.team-card-name {
    margin-top: 12px;
    font-weight: normal;
    letter-spacing: 0.5px;
    font-family: Helvetica Neue, sans-serif;
    /*text-transform: uppercase;*/
    text-align: left;
    min-height: 56px;
}

.name-line {
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: normal;
}

/* Строка 1 — "vrkteam /" — серый, мелкий */
.name-gray {
    color: #999;
    font-size: 14px;
}

/* Строка 2 — имя — белый, крупный */
.name-white {
    color: #fff;
    font-size: 24px;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

/* Строка 3 — жанр/код — красный, крупный */
.name-red {
    color: #ff0000;
    font-size: 24px;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

/* ==========================================================================
   5. ПОПАП — оверлей и контейнер
   ========================================================================== */
.team-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.3s ease,
        visibility 0.3s ease;
}

.team-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.team-popup {
    position: relative;
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(255, 0, 0, 0.15);
    max-width: 900px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.team-popup-overlay.active .team-popup {
    transform: scale(1);
}

/* Кнопка закрытия */
.team-popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100001;
    transition:
        color 0.2s ease,
        border-color 0.2s ease;
}

.team-popup-close:hover {
    color: #ff0000;
    border-color: #ff0000;
    background: transparent;
}

/* ==========================================================================
   6. КОНТЕНТ ПОПАПА — текст слева, фото справа
   ========================================================================== */
.team-popup-content {
    display: flex;
    height: 100%;
    max-height: 85vh;
}

.team-popup-text {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.team-popup-text::-webkit-scrollbar {
    width: 4px;
}

.team-popup-text::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.team-popup-text h2 {
    margin: 0 0 20px 0;
    font-size: 24px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
}

.team-popup-text p {
    margin: 0 0 16px 0;
    font-size: 14px;
    line-height: 1.7;
    color: #ccc;
}

.team-popup-photo {
    flex-shrink: 0;
    width: 350px;
    overflow: hidden;
    background: #111;
}

.team-popup-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ==========================================================================
   7. АДАПТИВ — МОБИЛЬНЫЕ
   ========================================================================== */
@media (max-width: 768px) {
    .team-header {
        padding: 0 20px;
        height: 57px;
    }

    .team-logo img {
        height: 45px;
        padding: 6px 0;
    }

    .burger-btn {
        display: flex;
    }

    .team-page-header {
        padding: 4px 20px 0;
    }

    .team-page-title {
        font-size: 24px;
        font-family: Arial, sans-serif;
    }

    /* Стрелки скрыты на мобайле, но контейнер виден для крестика */
    .team-nav-arrows {
        display: flex;
    }

    .team-arrow {
        display: none;
    }

    /* Крестик закрытия — виден на мобайле */
    .team-close-btn {
        display: flex;
    }

    /* Карусель на весь экран — виден край следующей карточки */
    .team-grid {
        gap: 12px;
        padding: 0 12px 0 20px;
        flex: 1;
        height: auto;
        min-height: 0;
        align-items: center;
        scroll-snap-type: x mandatory;
        scroll-padding-left: 20px;
        scrollbar-width: none;
    }

    .team-grid::-webkit-scrollbar {
        display: none;
    }

    .team-card {
        width: 75vw;
        max-width: 300px;
        cursor: default;
        scroll-snap-align: start;
        opacity: 0.5;
        transition: opacity 0.3s ease;
    }

    .team-card.active {
        opacity: 1;
    }

    .team-card:hover {
        transform: none;
    }

    .team-card-photo {
        border-radius: 24px;
        border: none;
        max-height: calc(100dvh - var(--header-h-mobile) - 200px);
    }

    .team-card:hover .team-card-photo {
        border-color: transparent;
    }

    .team-card:hover .team-card-photo img {
        filter: none;
    }

    .team-card-name {
        margin-top: 6px;
        text-align: left;
        min-height: 48px;
    }

    .name-gray {
        font-size: 11px;
    }

    .name-white {
        font-size: 24px;
    }

    .name-red {
        font-size: 24px;
    }

    /* Попап — на весь экран */
    .team-popup {
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
        border: none;
        overflow: visible;
    }

    /* Попап: фото сверху, текст под ней */
    .team-popup-content {
        flex-direction: column-reverse;
        overflow-y: auto;
        max-height: 100vh;
    }

    .team-popup-photo {
        width: 100%;
        height: auto;
        flex-shrink: 0;
    }

    .team-popup-photo img {
        width: 100%;
        height: auto;
        display: block;
    }

    .team-popup-text {
        padding: 24px;
    }

    .team-popup-text h2 {
        font-size: 20px;
        margin-bottom: 16px;
    }

    .team-popup-text p {
        font-size: 13px;
        line-height: 1.6;
    }
}

@media (max-width: 480px) {
    .team-card {
        width: 80vw;
    }

    .name-gray {
        font-size: 10px;
    }

    .name-white {
        font-size: 20px;
    }

    .name-red {
        font-size: 20px;
    }

    .team-card-name {
        min-height: 55px;
    }

    .team-popup-text {
        padding: 20px;
    }
}

/* ==========================================================================
   8. ТОЧКИ-ИНДИКАТОРЫ КАРУСЕЛИ (мобильная)
   ========================================================================== */
.team-dots {
    display: none;
}

@media (max-width: 768px) {
    .team-dots {
        display: flex;
        gap: 8px;
        position: fixed;
        bottom: env(safe-area-inset-bottom, 12px);
        left: 20px;
        z-index: 100;
        padding-bottom: 12px;
    }

    .team-dot {
        width: 4px;
        height: 4px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.3);
        transition: background 0.3s ease;
    }

    .team-dot.active {
        background: #ff0000;
    }
}
