﻿.team-page {
    padding-bottom: 24px;
    background: var(--color-bg);
    border-radius: 18px;
}

.team-page__header {
    --team-logo-size: clamp(154px, 15vw, 210px);
    display: grid;
    grid-template-columns: var(--team-logo-size) minmax(0, 1fr);
    gap: 20px;
    margin-bottom: 18px;
    padding: 18px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 4px 14px rgba(15,23,42,0.04);
    align-items: start;
}

.team-page__logo-wrap {
    width: var(--team-logo-size);
    height: var(--team-logo-size);
    border: 0;
    border-radius: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.team-page__head-main {
    min-width: 0;
    display: grid;
    grid-template-rows: auto auto auto;
    align-content: start;
}

@media (min-width: 821px) {
    .team-page__facts {
        height: var(--team-logo-size);
        gap: 0;
        justify-content: space-between;
    }
}

.team-page__logo {
    width: 94%;
    height: 94%;
    object-fit: contain;
    display: block;
}

.team-page__logo-ph {
    width: 56%;
    height: 56%;
    border-radius: 999px;
    background: #e5e7eb;
    display: block;
}

.team-page__title {
    margin: 0 0 10px;
    font-size: clamp(30px, 3vw, 40px);
    line-height: 1.1;
    color: #111827;
    text-align: left;
}

.team-page__intro {
    display: block;
    width: 100%;
    margin: 0;
}

.team-page__facts {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.team-page__fact {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #f9fafb;
    padding: 10px 12px;
}

.team-page__fact-label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #6b7280;
    margin-bottom: 4px;
}

.team-page__fact-value {
    display: block;
    font-size: 16px;
    font-weight: 800;
    color: #111827;
    line-height: 1.2;
}

.team-page__fact-value--country {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.team-page__country-flag {
    width: 20px;
    height: 14px;
    object-fit: cover;
    border-radius: 3px;
    border: 1px solid rgba(17,24,39,0.1);
    box-shadow: 0 1px 2px rgba(15,23,42,0.08);
    flex: 0 0 auto;
}

.team-page__intro-description {
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 0;
    font-size: 15px;
    line-height: 1.65;
    color: #374151;
}

.team-page__description-copy {
    max-width: 900px;
}

.team-page__intro-description p {
    margin: 0;
}

.team-page__intro-description p + p {
    margin-top: 10px;
}

.team-page__section-title {
    margin: 0 0 14px;
    font-size: 26px;
    line-height: 1.2;
    color: #111827;
}

.team-page__history-content {
    font-size: 15px;
    line-height: 1.65;
    color: #374151;
}

.team-page__history-content p {
    margin: 0;
}

.team-page__history-content p + p {
    margin-top: 10px;
}

.team-page__history-content h2,
.team-page__history-content h3,
.team-page__history-content h4 {
    margin: 14px 0 8px;
    color: #111827;
    line-height: 1.25;
}

.team-page__history-content ul,
.team-page__history-content ol {
    margin: 8px 0 0;
    padding-left: 22px;
}

.team-page__roster,
.team-page__devices {
    margin-top: 18px;
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 4px 14px rgba(15,23,42,0.04);
}

.team-page__roster {
    margin-top: 18px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.team-page__roster .team-page__section-title {
    margin: 0 0 14px;
}

.team-roster-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.team-page .team-roster-card.player-card {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #ffffff;
    padding: 9px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .05);
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.team-page .team-roster-card.player-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .07);
    transform: translateY(-1px);
}

.team-page .team-roster-card--empty.player-card:hover {
    border-color: #e5e7eb;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .05);
    transform: none;
}

.team-page .team-roster-card .player-card__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.team-page .team-roster-card .player-card__thumb {
    position: relative;
    aspect-ratio: 1 / 1.1;
    margin-bottom: 9px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: linear-gradient(180deg, #f7f8fa 0%, #edf0f3 100%);
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.team-page .team-roster-card.player-card:hover .player-card__thumb {
    background: linear-gradient(180deg, #f3f5f7 0%, #e8ecef 100%);
}

.team-page .team-roster-card .player-card__thumb-player {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center bottom;
    display: block;
}

.team-page .team-roster-card .team-roster-card__team-bg {
    position: absolute;
    z-index: 0;
    inset: 9%;
    width: 82%;
    height: 82%;
    object-fit: contain;
    object-position: center;
    opacity: .17;
    pointer-events: none;
}

.team-page .team-roster-card .player-card__thumb--placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 13px;
}

.team-page .team-roster-card .player-card__nickname {
    justify-content: center;
    text-align: center;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.15;
    gap: 8px;
    color: #111827;
}

.team-page .team-roster-card .player-card__nickname--empty {
    color: #6b7280;
    font-weight: 700;
}

.team-page .team-roster-card .player-card__nickname--empty::before {
    content: "Нет игрока";
}

.team-page .team-roster-card .player-card__content {
    padding: 2px 2px 1px;
    text-align: center;
}

.team-page .team-roster-card .player-card__flag {
    width: 22px;
    height: 16px;
    max-width: none;
    border-radius: 3px;
    object-fit: contain;
    display: inline-block;
    flex: 0 0 22px;
    background: #ffffff;
    border: 1px solid rgba(17, 24, 39, .12);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
    transform: none;
}

.team-devices-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.team-device-card {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #fff;
    padding: 7px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.team-device-card__title-link {
    color: inherit;
    text-decoration: none;
    display: block;
}

.team-device-card__thumb-wrap {
    position: relative;
}

.team-device-card__thumb-link {
    display: block;
    text-decoration: none;
}

.team-device-card__thumb {
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #f8fafc;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.team-device-card__img {
    width: 86%;
    height: 86%;
    object-fit: contain;
    display: block;
}

.team-device-card__thumb-placeholder {
    width: 60%;
    height: 60%;
    border-radius: 10px;
    background: #e5e7eb;
    display: block;
}

.team-device-card__title {
    margin: 0;
    font-size: 13px;
    line-height: 1.35;
    min-height: 34px;
    color: #111827;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.team-device-card__buy {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 10px;

    border: 1px solid var(--brand-color);
    border-radius: 10px;
    padding: 9px 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #111827;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    background: #ffffff;

    opacity: 0;
    transform: translateY(6px);
    pointer-events: none;
    transition: opacity .15s ease, transform .15s ease, background-color .15s ease, color .15s ease;
}

.team-device-card__buy:hover {
    background: var(--brand-color);
    color: #ffffff;
}

.team-device-card__buy-ico {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.team-device-card__buy--mobile {
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
    width: 100%;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    display: none;
}

@media (hover: hover) and (pointer: fine) {
    .team-device-card:hover .team-device-card__buy:not(.team-device-card__buy--mobile),
    .team-device-card:focus-within .team-device-card__buy:not(.team-device-card__buy--mobile) {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }
}

@media (max-width: 1100px) {
    .team-devices-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .team-roster-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .team-page__header {
        grid-template-columns: minmax(140px, 170px) minmax(0, 1fr);
        gap: 14px;
        padding: 12px;
    }

    .team-page__logo-wrap {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
        max-width: none;
    }

    .team-page__section-title {
        font-size: 22px;
    }

    .team-page__intro {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 8px;
    }

    .team-page__facts {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .team-page__history {
        grid-column: 1 / -1;
    }

    .team-devices-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .team-page__devices {
        padding: 12px;
        border-radius: 14px;
    }
}

@media (max-width: 560px) {
    .team-page {
        padding-bottom: 20px;
    }

    .team-page__title {
        font-size: clamp(24px, 8vw, 30px);
        margin-bottom: 8px;
        text-align: center;
    }

    .team-page__section-title {
        font-size: 20px;
    }

    .team-page__header {
        border-radius: 14px;
        grid-template-columns: 1fr;
        grid-template-areas:
            "logo"
            "desc";
        align-items: center;
        gap: 12px;
        margin-bottom: 12px;
    }

    .team-page__logo-wrap {
        grid-area: logo;
        width: clamp(132px, 42vw, 170px);
        height: auto;
        aspect-ratio: 1 / 1;
        max-width: 170px;
        border-radius: 12px;
        justify-self: center;
    }

    .team-page__head-main {
        min-width: 0;
        display: contents;
    }

    .team-page__intro {
        display: contents;
        margin-bottom: 0;
        gap: 0;
    }

    .team-page__intro-description {
        grid-area: desc;
        margin-top: 0;
        text-align: center;
    }

    .team-page__history {
        grid-column: 1 / -1;
    }

    .team-page__history-content {
        font-size: 14px;
        line-height: 1.6;
    }

    .team-page__fact {
        border-radius: 10px;
        padding: 8px 10px;
    }

    .team-page__fact-value {
        font-size: 14px;
    }

    .team-page__country-flag {
        width: 16px;
        height: 12px;
        border-radius: 2px;
    }

    .team-page__intro-description {
        border-radius: 10px;
        padding: 0;
        font-size: 14px;
        line-height: 1.55;
    }

    .team-roster-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .team-devices-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .team-page .team-roster-card.player-card {
        border-radius: 12px;
        padding: 8px;
    }

    .team-page .team-roster-card .player-card__thumb {
        border-radius: 10px;
        margin-bottom: 8px;
    }

    .team-page .team-roster-card .player-card__nickname {
        font-size: 15px;
        line-height: 1.15;
        gap: 5px;
    }

    .team-page .team-roster-card .player-card__flag {
        width: 19px;
        height: 14px;
        flex-basis: 19px;
        border-radius: 2px;
    }

    .team-device-card {
        border-radius: 14px;
        padding: 7px;
        gap: 8px;
    }

    .team-device-card__thumb {
        border-radius: 11px;
    }

    .team-device-card__title {
        font-size: 12px;
        min-height: 30px;
        line-height: 1.3;
    }

    .team-device-card__buy {
        display: none;
    }

    .team-device-card__buy--mobile {
        display: inline-flex;
        min-height: 38px;
        padding: 10px 10px;
        font-size: 12px;
    }

    .team-device-card__buy-ico {
        width: 18px;
        height: 18px;
    }

    .team-devices-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


