.tournament-team-page {
    width: 100%;
}

.team-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 22px 0 32px;
}

.team-banner {
    position: relative;
    height: 360px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 24px 52px rgba(0, 0, 0, 0.28);
}

.team-banner-backdrop {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.team-banner-backdrop img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
}

.team-banner-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(116deg, rgba(6, 9, 15, 0.94) 0%, rgba(7, 11, 18, 0.9) 42%, rgba(8, 12, 20, 0.72) 100%),
        radial-gradient(circle at top right, rgba(255, 37, 176, 0.2), transparent 34%),
        radial-gradient(circle at 72% 28%, rgba(93, 124, 255, 0.16), transparent 28%);
}

.team-banner-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 2rem;
    width: min(1200px, calc(100% - 56px));
    padding: 0;
}

.team-logo img {
    width: 132px;
    height: 132px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.16);
    object-fit: cover;
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.3);
}

.team-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.team-name {
    margin: 0;
    color: #f8fbff;
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 0.96;
    text-transform: uppercase;
}

.team-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.9rem;
    min-height: 30px;
    padding: 0.28rem 0.72rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #d2daec;
}

.team-subcopy {
    margin: 0.9rem 0 0;
    color: #dce4f7;
    font-size: 1rem;
    font-weight: 700;
}

.team-hero-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    position: static;
    margin-top: 1rem;
    width: fit-content;
    z-index: 3;
}

.stat-item,
.section-card,
.member-card,
.summary-stat-card,
.team-note-callout {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(16, 20, 31, 0.92), rgba(12, 15, 24, 0.96));
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.22);
}

.stat-item::before,
.section-card::before,
.member-card::before,
.summary-stat-card::before,
.team-note-callout::before {
    content: "";
    position: absolute;
    top: 0;
    left: 1px;
    width: calc(100% - 2px);
    height: 3px;
    background: linear-gradient(90deg, #ff3cac 0%, #784ba0 34%, #5d7cff 68%, #2bc990 100%);
}

.stat-item {
    flex: 1;
    min-width: 110px;
    padding: 14px 16px;
    border-radius: 16px;
    text-align: center;
}

.stat-label,
.summary-stat-label {
    display: block;
    color: #93a2ba;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 0.35rem;
}

.stat-value,
.summary-stat-number {
    display: block;
    color: #f7fbff;
    font-size: 1.25rem;
    font-weight: 800;
}

.team-nav {
    background: rgba(14, 18, 29, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 18px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
    z-index: 30;
}

.team-banner-nav {
    position: absolute;
    left: 28px;
    right: 28px;
    bottom: 22px;
    margin-top: 0;
}

.nav-container {
    display: flex;
    justify-content: center;
    gap: 0;
}

.nav-item {
    padding: 1rem 1.6rem;
    color: #a4afc3;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    transition: all 0.22s ease;
    border-bottom: 3px solid transparent;
}

.nav-item:hover,
.nav-item.active {
    color: #f7fbff;
    background: rgba(93, 124, 255, 0.08);
    border-bottom-color: #5d7cff;
}

.team-profile-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 700;
    background: linear-gradient(135deg, #d103b8, #5d7cff);
    color: #fff;
    box-shadow: 0 14px 28px rgba(93, 124, 255, 0.2);
}

.team-profile-btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #edf2ff;
    box-shadow: none;
}

.overview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 2rem;
    align-items: start;
    margin-top: 22px;
}

.section-card {
    border-radius: 20px;
    padding: 20px 18px 18px;
}

.roster-section {
    grid-column: 1 / span 2;
    grid-row: 1;
}

.matches-container {
    grid-column: 3;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.recent-vods-section {
    grid-column: 1 / -1;
    grid-row: 2;
}

.history-section {
    margin-top: 22px;
}

.stats-section {
    margin-top: 22px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.section-header h2,
.role-group-title {
    margin: 0;
    color: #f7fbff;
}

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.section-header h2 i {
    color: #5d7cff;
}

.member-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: #93a2ba;
    font-weight: 700;
}

.roster-organized {
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
}

.role-group {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 16px;
    overflow: hidden;
}

.role-group-title {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem 1.2rem;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.role-count {
    margin-left: auto;
    color: #a4b0c5;
    font-size: 0.82rem;
    font-weight: 600;
}

.role-members {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.9rem;
    padding: 1.2rem;
}

.member-card.compact {
    padding: 0.9rem;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    background: rgba(255, 255, 255, 0.04);
}

.member-avatar-compact {
    position: relative;
    flex-shrink: 0;
}

.member-avatar-compact img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.role-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    border: 2px solid #0f1420;
    font-size: 0.7rem;
}

.role-badge.captain {
    background: linear-gradient(135deg, #ffd700, #ffa500);
}

.role-badge.co_captain {
    background: linear-gradient(135deg, #c0c0c0, #808080);
}

.role-badge.player,
.role-badge.sub {
    background: linear-gradient(135deg, #4169e1, #0000cd);
}

.member-details-compact {
    min-width: 0;
}

.member-name-compact {
    margin: 0 0 0.2rem;
    color: #f7fbff;
    font-size: 0.96rem;
    font-weight: 700;
}

.member-role-compact,
.member-eligibility-compact {
    margin: 0;
    color: #9eb0c7;
    font-size: 0.8rem;
    line-height: 1.45;
}

.summary-stat-stack {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.summary-stat-card {
    padding: 16px 14px 14px;
    border-radius: 14px;
}

.team-note-callout {
    padding: 18px;
    border-radius: 16px;
}

.team-note-callout strong {
    display: block;
    margin-bottom: 0.55rem;
    color: #f7fbff;
}

.matches-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.match-card {
    position: relative;
    padding: 1rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.match-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    opacity: 0.92;
}

.match-card.win::before {
    background: #22c55e;
}

.match-card.loss::before {
    background: #ef4444;
}

.match-card:hover {
    transform: translateX(4px);
    border-color: rgba(93, 124, 255, 0.4);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
}

.match-header-inline,
.match-teams,
.match-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.match-date {
    color: #8f9db4;
    font-size: 0.78rem;
    white-space: pre-line;
}

.result-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.28rem 0.72rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
}

.result-badge.win {
    background: rgba(34, 197, 94, 0.18);
    color: #78ebb6;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.result-badge.loss {
    background: rgba(239, 68, 68, 0.18);
    color: #ff9b9b;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.opponent-info {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

.opponent-info img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.opponent-details {
    min-width: 0;
}

.opponent-name {
    color: #f7fbff;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.opponent-tag {
    color: #97a5ba;
    font-size: 0.82rem;
}

.match-score,
.match-round-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.8rem;
    border-radius: 10px;
    background: rgba(93, 124, 255, 0.12);
    color: #f7fbff;
    font-weight: 700;
}

.match-maps-enhanced {
    padding: 0.8rem;
    border-radius: 10px;
    background: rgba(93, 124, 255, 0.06);
    border-left: 3px solid #5d7cff;
    color: #d8e0f0;
}

.maps-label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.5rem;
    color: #93a2ba;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.no-matches {
    text-align: center;
    padding: 2.5rem 1rem;
    color: #93a2ba;
}

.no-matches i {
    font-size: 2.5rem;
    margin-bottom: 0.8rem;
    opacity: 0.5;
}

@media (max-width: 1200px) {
    .overview-grid {
        grid-template-columns: 1fr 1fr;
    }

    .roster-section,
    .matches-container,
    .recent-vods-section {
        grid-column: 1 / -1;
        grid-row: auto;
    }

    .matches-container {
        flex-direction: row;
    }

    .matches-container .section-card {
        flex: 1;
    }
}

@media (max-width: 860px) {
    .team-banner {
        height: auto;
        min-height: 320px;
    }

    .team-banner-content {
        flex-direction: column;
        width: calc(100% - 32px);
        padding: 28px 0 86px;
        text-align: center;
    }

    .nav-container,
    .matches-container {
        flex-direction: column;
    }

    .team-hero-actions {
        position: static;
        width: 100%;
        margin-top: 1rem;
    }

    .team-banner-nav {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }

    .team-content {
        padding: 18px 0 28px;
    }

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

    .team-profile-btn {
        width: 100%;
    }

    .overview-grid,
    .summary-stat-stack,
    .role-members {
        grid-template-columns: 1fr;
    }

    .match-teams,
    .match-header-inline,
    .match-meta-row {
        flex-direction: column;
        align-items: flex-start;
    }
}
